init component
This commit is contained in:
133
node_modules/buetify/lib/components/table/BSimpleTable.d.ts
generated
vendored
Executable file
133
node_modules/buetify/lib/components/table/BSimpleTable.d.ts
generated
vendored
Executable file
@@ -0,0 +1,133 @@
|
||||
import { SizeVariant } from '../../types';
|
||||
import { PropType } from 'vue';
|
||||
export declare const BSimpleTablePropsDefinition: {
|
||||
isBordered: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isSelectable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isStriped: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isNarrow: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isFullwidth: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
size: {
|
||||
type: PropType<SizeVariant>;
|
||||
};
|
||||
isHoverable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isLoading: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isScrollable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
useMobileCards: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
themeMap: {
|
||||
type: PropType<import("../../types").ThemeColorMap>;
|
||||
required: boolean;
|
||||
default: import("fp-ts/lib/function").Lazy<import("../../types").ThemeColorMap>;
|
||||
};
|
||||
isThemeable: {
|
||||
type: PropType<boolean>;
|
||||
required: boolean;
|
||||
default: boolean;
|
||||
};
|
||||
};
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
isBordered: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isSelectable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isStriped: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isNarrow: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isFullwidth: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
size: {
|
||||
type: PropType<SizeVariant>;
|
||||
};
|
||||
isHoverable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isLoading: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isScrollable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
useMobileCards: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
themeMap: {
|
||||
type: PropType<import("../../types").ThemeColorMap>;
|
||||
required: boolean;
|
||||
default: import("fp-ts/lib/function").Lazy<import("../../types").ThemeColorMap>;
|
||||
};
|
||||
isThemeable: {
|
||||
type: PropType<boolean>;
|
||||
required: boolean;
|
||||
default: boolean;
|
||||
};
|
||||
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
||||
isThemeable: boolean;
|
||||
themeMap: import("../../types").ThemeColorMap;
|
||||
isLoading: boolean;
|
||||
isFullwidth: boolean;
|
||||
isHoverable: boolean;
|
||||
isBordered: boolean;
|
||||
isSelectable: boolean;
|
||||
isStriped: boolean;
|
||||
isNarrow: boolean;
|
||||
isScrollable: boolean;
|
||||
useMobileCards: boolean;
|
||||
} & {
|
||||
size?: "" | "is-small" | "is-medium" | "is-large" | undefined;
|
||||
}>, {
|
||||
isThemeable: boolean;
|
||||
themeMap: import("../../types").ThemeColorMap;
|
||||
isLoading: boolean;
|
||||
isFullwidth: boolean;
|
||||
isHoverable: boolean;
|
||||
isBordered: boolean;
|
||||
isSelectable: boolean;
|
||||
isStriped: boolean;
|
||||
isNarrow: boolean;
|
||||
isScrollable: boolean;
|
||||
useMobileCards: boolean;
|
||||
}>;
|
||||
export default _default;
|
||||
85
node_modules/buetify/lib/components/table/BSimpleTable.js
generated
vendored
Executable file
85
node_modules/buetify/lib/components/table/BSimpleTable.js
generated
vendored
Executable file
@@ -0,0 +1,85 @@
|
||||
import { DefaultThemePropsDefinition, useTheme } from '../../composables/theme';
|
||||
import BScroll from '../scroll/BScroll';
|
||||
import { defineComponent, h } from 'vue';
|
||||
import BStyledTable from './BStyledTable';
|
||||
export const BSimpleTablePropsDefinition = { ...DefaultThemePropsDefinition,
|
||||
isBordered: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSelectable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isStriped: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isNarrow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isFullwidth: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
size: {
|
||||
type: String
|
||||
},
|
||||
isHoverable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isLoading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isScrollable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
useMobileCards: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
};
|
||||
export default defineComponent({
|
||||
name: 'b-simple-table',
|
||||
inheritAttrs: false,
|
||||
props: BSimpleTablePropsDefinition,
|
||||
|
||||
setup(props, {
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
themeClasses
|
||||
} = useTheme(props);
|
||||
|
||||
function table() {
|
||||
return [h('div', {
|
||||
class: 'table-wrapper'
|
||||
}, [h(BStyledTable, {
|
||||
class: [props.size, {
|
||||
'is-bordered': props.isBordered,
|
||||
'is-striped': props.isStriped,
|
||||
'is-narrow': props.isNarrow,
|
||||
'is-fullwidth': props.isFullwidth,
|
||||
'is-hoverable': props.isHoverable || props.isSelectable,
|
||||
'has-mobile-cards': props.useMobileCards
|
||||
}, ...themeClasses.value]
|
||||
}, slots.default)])];
|
||||
}
|
||||
|
||||
return () => {
|
||||
return h('div', {
|
||||
class: ['b-table', {
|
||||
'is-loading': props.isLoading
|
||||
}]
|
||||
}, props.isScrollable ? h(BScroll, {
|
||||
class: 'is-fullwidth'
|
||||
}, table) : table());
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
//# sourceMappingURL=BSimpleTable.js.map
|
||||
1
node_modules/buetify/lib/components/table/BSimpleTable.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/BSimpleTable.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/table/BSimpleTable.ts"],"names":[],"mappings":"AAAA,SAAS,2BAAT,EAAsC,QAAtC,QAAsD,yBAAtD;AAEA,OAAO,OAAP,MAAoB,mBAApB;AACA,SAAS,eAAT,EAA0B,CAA1B,QAA6C,KAA7C;AACA,OAAO,YAAP,MAAyB,gBAAzB;AAEA,OAAO,MAAM,2BAA2B,GAAG,EACzC,GAAG,2BADsC;AAEzC,EAAA,UAAU,EAAE;AACV,IAAA,IAAI,EAAE,OADI;AAEV,IAAA,OAAO,EAAE;AAFC,GAF6B;AAMzC,EAAA,YAAY,EAAE;AACZ,IAAA,IAAI,EAAE,OADM;AAEZ,IAAA,OAAO,EAAE;AAFG,GAN2B;AAUzC,EAAA,SAAS,EAAE;AACT,IAAA,IAAI,EAAE,OADG;AAET,IAAA,OAAO,EAAE;AAFA,GAV8B;AAczC,EAAA,QAAQ,EAAE;AACR,IAAA,IAAI,EAAE,OADE;AAER,IAAA,OAAO,EAAE;AAFD,GAd+B;AAkBzC,EAAA,WAAW,EAAE;AACX,IAAA,IAAI,EAAE,OADK;AAEX,IAAA,OAAO,EAAE;AAFE,GAlB4B;AAsBzC,EAAA,IAAI,EAAE;AACJ,IAAA,IAAI,EAAE;AADF,GAtBmC;AAyBzC,EAAA,WAAW,EAAE;AACX,IAAA,IAAI,EAAE,OADK;AAEX,IAAA,OAAO,EAAE;AAFE,GAzB4B;AA6BzC,EAAA,SAAS,EAAE;AACT,IAAA,IAAI,EAAE,OADG;AAET,IAAA,OAAO,EAAE;AAFA,GA7B8B;AAiCzC,EAAA,YAAY,EAAE;AACZ,IAAA,IAAI,EAAE,OADM;AAEZ,IAAA,OAAO,EAAE;AAFG,GAjC2B;AAqCzC,EAAA,cAAc,EAAE;AACd,IAAA,IAAI,EAAE,OADQ;AAEd,IAAA,OAAO,EAAE;AAFK;AArCyB,CAApC;AA2CP,eAAe,eAAe,CAAC;AAC7B,EAAA,IAAI,EAAE,gBADuB;AAE7B,EAAA,YAAY,EAAE,KAFe;AAG7B,EAAA,KAAK,EAAE,2BAHsB;;AAI7B,EAAA,KAAK,CAAC,KAAD,EAAQ;AAAE,IAAA;AAAF,GAAR,EAAiB;AACpB,UAAM;AAAE,MAAA;AAAF,QAAmB,QAAQ,CAAC,KAAD,CAAjC;;AAEA,aAAS,KAAT,GAAc;AACZ,aAAO,CACL,CAAC,CAAC,KAAD,EAAQ;AAAE,QAAA,KAAK,EAAE;AAAT,OAAR,EAAoC,CACnC,CAAC,CACC,YADD,EAEC;AACE,QAAA,KAAK,EAAE,CACL,KAAK,CAAC,IADD,EAEL;AACE,yBAAe,KAAK,CAAC,UADvB;AAEE,wBAAc,KAAK,CAAC,SAFtB;AAGE,uBAAa,KAAK,CAAC,QAHrB;AAIE,0BAAgB,KAAK,CAAC,WAJxB;AAKE,0BAAgB,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,YAL7C;AAME,8BAAoB,KAAK,CAAC;AAN5B,SAFK,EAUL,GAAG,YAAY,CAAC,KAVX;AADT,OAFD,EAgBC,KAAK,CAAC,OAhBP,CADkC,CAApC,CADI,CAAP;AAsBD;;AACD,WAAO,MAAK;AACV,aAAO,CAAC,CACN,KADM,EAEN;AACE,QAAA,KAAK,EAAE,CAAC,SAAD,EAAY;AAAE,wBAAc,KAAK,CAAC;AAAtB,SAAZ;AADT,OAFM,EAKN,KAAK,CAAC,YAAN,GAAqB,CAAC,CAAC,OAAD,EAAU;AAAE,QAAA,KAAK,EAAE;AAAT,OAAV,EAAqC,KAArC,CAAtB,GAAoE,KAAK,EALnE,CAAR;AAOD,KARD;AASD;;AAxC4B,CAAD,CAA9B","sourcesContent":["import { DefaultThemePropsDefinition, useTheme } from '../../composables/theme';\nimport { SizeVariant } from '../../types';\nimport BScroll from '../scroll/BScroll';\nimport { defineComponent, h, PropType } from 'vue';\nimport BStyledTable from './BStyledTable';\n\nexport const BSimpleTablePropsDefinition = {\n ...DefaultThemePropsDefinition,\n isBordered: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n isSelectable: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n isStriped: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n isNarrow: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n isFullwidth: {\n type: Boolean as PropType<boolean>,\n default: true\n },\n size: {\n type: String as PropType<SizeVariant>\n },\n isHoverable: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n isLoading: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n isScrollable: {\n type: Boolean as PropType<boolean>,\n default: true\n },\n useMobileCards: {\n type: Boolean as PropType<boolean>,\n default: false\n }\n};\n\nexport default defineComponent({\n name: 'b-simple-table',\n inheritAttrs: false,\n props: BSimpleTablePropsDefinition,\n setup(props, { slots }) {\n const { themeClasses } = useTheme(props);\n\n function table() {\n return [\n h('div', { class: 'table-wrapper' }, [\n h(\n BStyledTable,\n {\n class: [\n props.size,\n {\n 'is-bordered': props.isBordered,\n 'is-striped': props.isStriped,\n 'is-narrow': props.isNarrow,\n 'is-fullwidth': props.isFullwidth,\n 'is-hoverable': props.isHoverable || props.isSelectable,\n 'has-mobile-cards': props.useMobileCards\n },\n ...themeClasses.value\n ]\n },\n slots.default\n )\n ])\n ];\n }\n return () => {\n return h(\n 'div',\n {\n class: ['b-table', { 'is-loading': props.isLoading }]\n },\n props.isScrollable ? h(BScroll, { class: 'is-fullwidth' }, table) : table()\n );\n };\n }\n});\n"],"sourceRoot":"","file":"BSimpleTable.js"}
|
||||
30
node_modules/buetify/lib/components/table/BStyledTable.d.ts
generated
vendored
Executable file
30
node_modules/buetify/lib/components/table/BStyledTable.d.ts
generated
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
import '../../sass/helpers/animations.sass';
|
||||
import '../../sass/helpers/cursor-helpers.sass';
|
||||
import './table.sass';
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
tag: {
|
||||
type: (FunctionConstructor | StringConstructor)[];
|
||||
default: string;
|
||||
};
|
||||
themeMap: {
|
||||
type: import("vue").PropType<import("../..").ThemeColorMap>;
|
||||
required: boolean;
|
||||
default: import("fp-ts/lib/function").Lazy<import("../..").ThemeColorMap>;
|
||||
};
|
||||
isThemeable: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
required: boolean;
|
||||
default: boolean;
|
||||
};
|
||||
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
||||
isThemeable: boolean;
|
||||
themeMap: import("../..").ThemeColorMap;
|
||||
tag: string | Function;
|
||||
} & {}>, {
|
||||
isThemeable: boolean;
|
||||
themeMap: import("../..").ThemeColorMap;
|
||||
tag: string | Function;
|
||||
}>;
|
||||
export default _default;
|
||||
9
node_modules/buetify/lib/components/table/BStyledTable.js
generated
vendored
Executable file
9
node_modules/buetify/lib/components/table/BStyledTable.js
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
import "../../../src/sass/helpers/animations.sass";
|
||||
import "../../../src/sass/helpers/cursor-helpers.sass";
|
||||
import "../../../src/components/table/table.sass";
|
||||
import { getThemeableFunctionalComponent } from '../../utils/getThemeableFunctionalComponent';
|
||||
export default getThemeableFunctionalComponent({
|
||||
cls: 'table',
|
||||
el: 'table'
|
||||
});
|
||||
//# sourceMappingURL=BStyledTable.js.map
|
||||
1
node_modules/buetify/lib/components/table/BStyledTable.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/BStyledTable.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/table/BStyledTable.ts"],"names":[],"mappings":"AAAA,OAAO,2CAAP;AACA,OAAO,+CAAP;AACA,OAAO,0CAAP;AACA,SAAS,+BAAT,QAAgD,6CAAhD;AAEA,eAAe,+BAA+B,CAAC;AAAE,EAAA,GAAG,EAAE,OAAP;AAAgB,EAAA,EAAE,EAAE;AAApB,CAAD,CAA9C","sourcesContent":["import '../../sass/helpers/animations.sass';\nimport '../../sass/helpers/cursor-helpers.sass';\nimport './table.sass';\nimport { getThemeableFunctionalComponent } from '../../utils/getThemeableFunctionalComponent';\n\nexport default getThemeableFunctionalComponent({ cls: 'table', el: 'table' });\n"],"sourceRoot":"","file":"BStyledTable.js"}
|
||||
432
node_modules/buetify/lib/components/table/BTable.d.ts
generated
vendored
Executable file
432
node_modules/buetify/lib/components/table/BTable.d.ts
generated
vendored
Executable file
@@ -0,0 +1,432 @@
|
||||
import { FunctionN } from 'fp-ts/lib/function';
|
||||
import { PropType, VNode, ExtractPropTypes } from 'vue';
|
||||
import { Classes } from '../../utils/mergeClasses';
|
||||
import { PaginationPosition, PaginationSize, PaginationVerticalPosition } from '../pagination/BPagination';
|
||||
import { BTableColumn, BTableRow } from './shared';
|
||||
export interface BTablePaginationInput {
|
||||
page?: number;
|
||||
'onUpdate:page'?: FunctionN<[number], void>;
|
||||
perPage?: number;
|
||||
size?: PaginationSize;
|
||||
isSimple?: boolean;
|
||||
isRounded?: boolean;
|
||||
horizontalPosition?: PaginationPosition;
|
||||
verticalPosition?: PaginationVerticalPosition;
|
||||
}
|
||||
export declare const BTablePropsDefinition: {
|
||||
useMobileCards: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
rows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
required: true;
|
||||
};
|
||||
sortBy: {
|
||||
type: PropType<BTableColumn<BTableRow> | BTableColumn<BTableRow>[]>;
|
||||
};
|
||||
'onUpdate:sortBy': {
|
||||
type: PropType<FunctionN<[BTableColumn<BTableRow> | BTableColumn<BTableRow>[]], void>>;
|
||||
};
|
||||
sortType: {
|
||||
type: PropType<import("./shared").SortType>;
|
||||
default: "Descending";
|
||||
};
|
||||
'onUpdate:sortType': {
|
||||
type: PropType<FunctionN<[import("./shared").SortType], void>>;
|
||||
};
|
||||
isSelectable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
selectedRows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
default: import("fp-ts/lib/function").Lazy<never[]>;
|
||||
};
|
||||
'onUpdate:selectedRows': {
|
||||
type: PropType<FunctionN<[BTableRow[]], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onSelectRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onUnselectRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
isDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: boolean;
|
||||
};
|
||||
dropEffect: {
|
||||
type: PropType<"copy" | "link" | "none" | "move">;
|
||||
default: "move";
|
||||
};
|
||||
onDragstart: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragenter: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragover: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragleave: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragend: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDrop: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
isCheckable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
checkedRows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
default: never[];
|
||||
};
|
||||
'onUpdate:checkedRows': {
|
||||
type: PropType<FunctionN<[BTableRow[]], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
checkboxVariant: {
|
||||
type: PropType<import("../..").ColorVariant>;
|
||||
default: "is-primary";
|
||||
};
|
||||
canCheckAllRows: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onCheckRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onUncheckRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
isBordered: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isStriped: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isNarrow: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isFullwidth: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
size: {
|
||||
type: PropType<import("../..").SizeVariant>;
|
||||
};
|
||||
isHoverable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isLoading: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isScrollable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
themeMap: {
|
||||
type: PropType<import("../..").ThemeColorMap>;
|
||||
required: boolean;
|
||||
default: import("fp-ts/lib/function").Lazy<import("../..").ThemeColorMap>;
|
||||
};
|
||||
isThemeable: {
|
||||
type: PropType<boolean>;
|
||||
required: boolean;
|
||||
default: boolean;
|
||||
};
|
||||
columns: {
|
||||
type: PropType<BTableColumn<unknown>[]>;
|
||||
required: true;
|
||||
};
|
||||
isFocusable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
mobileSortPlaceholder: {
|
||||
type: PropType<string>;
|
||||
};
|
||||
headerClasses: {
|
||||
type: PropType<Classes>;
|
||||
default: undefined;
|
||||
};
|
||||
onRowClick: {
|
||||
type: PropType<FunctionN<[BTableRow, MouseEvent], void>>;
|
||||
required: boolean;
|
||||
};
|
||||
pagination: {
|
||||
type: PropType<boolean | BTablePaginationInput>;
|
||||
required: boolean;
|
||||
};
|
||||
};
|
||||
export interface BTableProps extends ExtractPropTypes<typeof BTablePropsDefinition> {
|
||||
}
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
useMobileCards: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
rows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
required: true;
|
||||
};
|
||||
sortBy: {
|
||||
type: PropType<BTableColumn<BTableRow> | BTableColumn<BTableRow>[]>;
|
||||
};
|
||||
'onUpdate:sortBy': {
|
||||
type: PropType<FunctionN<[BTableColumn<BTableRow> | BTableColumn<BTableRow>[]], void>>;
|
||||
};
|
||||
sortType: {
|
||||
type: PropType<import("./shared").SortType>;
|
||||
default: "Descending";
|
||||
};
|
||||
'onUpdate:sortType': {
|
||||
type: PropType<FunctionN<[import("./shared").SortType], void>>;
|
||||
};
|
||||
isSelectable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
selectedRows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
default: import("fp-ts/lib/function").Lazy<never[]>;
|
||||
};
|
||||
'onUpdate:selectedRows': {
|
||||
type: PropType<FunctionN<[BTableRow[]], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onSelectRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onUnselectRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
isDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: boolean;
|
||||
};
|
||||
dropEffect: {
|
||||
type: PropType<"copy" | "link" | "none" | "move">;
|
||||
default: "move";
|
||||
};
|
||||
onDragstart: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragenter: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragover: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragleave: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragend: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDrop: {
|
||||
type: PropType<FunctionN<[BTableRow, DragEvent, number], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
isCheckable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
checkedRows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
default: never[];
|
||||
};
|
||||
'onUpdate:checkedRows': {
|
||||
type: PropType<FunctionN<[BTableRow[]], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
checkboxVariant: {
|
||||
type: PropType<import("../..").ColorVariant>;
|
||||
default: "is-primary";
|
||||
};
|
||||
canCheckAllRows: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onCheckRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onUncheckRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
isBordered: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isStriped: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isNarrow: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isFullwidth: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
size: {
|
||||
type: PropType<import("../..").SizeVariant>;
|
||||
};
|
||||
isHoverable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isLoading: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isScrollable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
themeMap: {
|
||||
type: PropType<import("../..").ThemeColorMap>;
|
||||
required: boolean;
|
||||
default: import("fp-ts/lib/function").Lazy<import("../..").ThemeColorMap>;
|
||||
};
|
||||
isThemeable: {
|
||||
type: PropType<boolean>;
|
||||
required: boolean;
|
||||
default: boolean;
|
||||
};
|
||||
columns: {
|
||||
type: PropType<BTableColumn<unknown>[]>;
|
||||
required: true;
|
||||
};
|
||||
isFocusable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
mobileSortPlaceholder: {
|
||||
type: PropType<string>;
|
||||
};
|
||||
headerClasses: {
|
||||
type: PropType<Classes>;
|
||||
default: undefined;
|
||||
};
|
||||
onRowClick: {
|
||||
type: PropType<FunctionN<[BTableRow, MouseEvent], void>>;
|
||||
required: boolean;
|
||||
};
|
||||
pagination: {
|
||||
type: PropType<boolean | BTablePaginationInput>;
|
||||
required: boolean;
|
||||
};
|
||||
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
||||
isThemeable: boolean;
|
||||
themeMap: import("../..").ThemeColorMap;
|
||||
columns: BTableColumn<unknown>[];
|
||||
isLoading: boolean;
|
||||
isFullwidth: boolean;
|
||||
isHoverable: boolean;
|
||||
isBordered: boolean;
|
||||
isSelectable: boolean;
|
||||
isStriped: boolean;
|
||||
isNarrow: boolean;
|
||||
isScrollable: boolean;
|
||||
useMobileCards: boolean;
|
||||
rows: BTableRow[];
|
||||
sortType: import("./shared").SortType;
|
||||
isDraggable: boolean;
|
||||
isCheckable: boolean;
|
||||
checkedRows: BTableRow[];
|
||||
"onUpdate:checkedRows": FunctionN<[BTableRow[]], void>;
|
||||
checkboxVariant: import("../..").ColorVariant;
|
||||
canCheckAllRows: boolean;
|
||||
onCheckRow: FunctionN<[BTableRow], void>;
|
||||
onUncheckRow: FunctionN<[BTableRow], void>;
|
||||
dropEffect: "copy" | "link" | "none" | "move";
|
||||
onDragstart: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragenter: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragover: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragleave: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragend: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDrop: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
selectedRows: BTableRow[];
|
||||
"onUpdate:selectedRows": FunctionN<[BTableRow[]], void>;
|
||||
onSelectRow: FunctionN<[BTableRow], void>;
|
||||
onUnselectRow: FunctionN<[BTableRow], void>;
|
||||
isFocusable: boolean;
|
||||
headerClasses: Classes;
|
||||
} & {
|
||||
size?: "" | "is-small" | "is-medium" | "is-large" | undefined;
|
||||
pagination?: boolean | BTablePaginationInput | undefined;
|
||||
sortBy?: BTableColumn<BTableRow> | BTableColumn<BTableRow>[] | undefined;
|
||||
"onUpdate:sortBy"?: FunctionN<[BTableColumn<BTableRow> | BTableColumn<BTableRow>[]], void> | undefined;
|
||||
"onUpdate:sortType"?: FunctionN<[import("./shared").SortType], void> | undefined;
|
||||
onRowClick?: FunctionN<[BTableRow, MouseEvent], void> | undefined;
|
||||
mobileSortPlaceholder?: string | undefined;
|
||||
}>, {
|
||||
isThemeable: boolean;
|
||||
themeMap: import("../..").ThemeColorMap;
|
||||
isLoading: boolean;
|
||||
isFullwidth: boolean;
|
||||
isHoverable: boolean;
|
||||
isBordered: boolean;
|
||||
isSelectable: boolean;
|
||||
isStriped: boolean;
|
||||
isNarrow: boolean;
|
||||
isScrollable: boolean;
|
||||
useMobileCards: boolean;
|
||||
sortType: import("./shared").SortType;
|
||||
isDraggable: boolean;
|
||||
isCheckable: boolean;
|
||||
checkedRows: BTableRow[];
|
||||
"onUpdate:checkedRows": FunctionN<[BTableRow[]], void>;
|
||||
checkboxVariant: import("../..").ColorVariant;
|
||||
canCheckAllRows: boolean;
|
||||
onCheckRow: FunctionN<[BTableRow], void>;
|
||||
onUncheckRow: FunctionN<[BTableRow], void>;
|
||||
dropEffect: "copy" | "link" | "none" | "move";
|
||||
onDragstart: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragenter: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragover: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragleave: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDragend: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
onDrop: FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
selectedRows: BTableRow[];
|
||||
"onUpdate:selectedRows": FunctionN<[BTableRow[]], void>;
|
||||
onSelectRow: FunctionN<[BTableRow], void>;
|
||||
onUnselectRow: FunctionN<[BTableRow], void>;
|
||||
isFocusable: boolean;
|
||||
headerClasses: Classes;
|
||||
}>;
|
||||
export default _default;
|
||||
166
node_modules/buetify/lib/components/table/BTable.js
generated
vendored
Executable file
166
node_modules/buetify/lib/components/table/BTable.js
generated
vendored
Executable file
@@ -0,0 +1,166 @@
|
||||
import { isEmpty } from 'fp-ts/lib/Array';
|
||||
import { defineComponent, h, computed, toRef } from 'vue';
|
||||
import { useProxy } from '../../composables/proxy';
|
||||
import { useWindowSize } from '../../composables/windowSize';
|
||||
import { isBoolean } from '../../utils/helpers';
|
||||
import BPagination from '../pagination/BPagination';
|
||||
import BSimpleTable, { BSimpleTablePropsDefinition } from './BSimpleTable';
|
||||
import BTableHeader from './BTableHeader';
|
||||
import BTableMobileSort from './BTableMobileSort';
|
||||
import BTableRowElement from './BTableRow';
|
||||
import { provideVisibleColumns } from './composables/shared';
|
||||
import { BTableCheckPropsDefinition, useCheckableTable } from './composables/useCheckableTable';
|
||||
import { BTableDraggablePropsDefinition, useDraggableTable } from './composables/useDraggableTable';
|
||||
import { BTableSelectablePropsDefinition, useSelectableTable } from './composables/useSelectableTable';
|
||||
import { BTableSortingPropsDefinition, useSortableTable } from './composables/useSortableTable';
|
||||
export const BTablePropsDefinition = {
|
||||
columns: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
isFocusable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
mobileSortPlaceholder: {
|
||||
type: String
|
||||
},
|
||||
headerClasses: {
|
||||
type: [String, Object, Array],
|
||||
default: undefined
|
||||
},
|
||||
onRowClick: {
|
||||
type: Function,
|
||||
required: false
|
||||
},
|
||||
pagination: {
|
||||
type: [Boolean, Object],
|
||||
required: false
|
||||
},
|
||||
...BSimpleTablePropsDefinition,
|
||||
...BTableCheckPropsDefinition,
|
||||
...BTableDraggablePropsDefinition,
|
||||
...BTableSelectablePropsDefinition,
|
||||
...BTableSortingPropsDefinition,
|
||||
useMobileCards: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
};
|
||||
|
||||
function generateTableHeader(classes, slots) {
|
||||
return h(BTableHeader, {
|
||||
class: classes
|
||||
}, { ...slots
|
||||
});
|
||||
}
|
||||
|
||||
function generateEmptyTable(visibleColumns, slots) {
|
||||
return h('tbody', [h('tr', {
|
||||
class: 'is-empty'
|
||||
}, [h('td', {
|
||||
colspan: visibleColumns.value.length
|
||||
}, slots.empty && slots.empty())])]);
|
||||
}
|
||||
|
||||
function generateTableBody(props, rows, visibleColumns, slots) {
|
||||
if (isEmpty(props.rows)) {
|
||||
return generateEmptyTable(visibleColumns, slots);
|
||||
}
|
||||
|
||||
const onRowClick = props.onRowClick;
|
||||
return h('tbody', rows.map((row, index) => slots.row ? slots.row({
|
||||
row,
|
||||
index,
|
||||
onRowClick,
|
||||
columns: visibleColumns.value
|
||||
}) : h(BTableRowElement, {
|
||||
key: row.id,
|
||||
row,
|
||||
index,
|
||||
onRowClick
|
||||
}, { ...slots
|
||||
})));
|
||||
}
|
||||
|
||||
function generateTableFooter(visibleColumns, slots) {
|
||||
return h('tfoot', [h('tr', {
|
||||
class: 'table-footer'
|
||||
}, slots.footer && slots.footer({
|
||||
numberOfColumns: visibleColumns.value.length,
|
||||
columns: visibleColumns.value
|
||||
}))]);
|
||||
}
|
||||
|
||||
function generateTable(props, rows, visibleColumns, slots) {
|
||||
return h(BSimpleTable, props, () => {
|
||||
const nodes = [generateTableHeader(props.headerClasses, slots), generateTableBody(props, rows, visibleColumns, slots)];
|
||||
|
||||
if (slots.footer) {
|
||||
nodes.push(generateTableFooter(visibleColumns, slots));
|
||||
}
|
||||
|
||||
return nodes;
|
||||
});
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'b-table',
|
||||
props: BTablePropsDefinition,
|
||||
|
||||
setup(props, {
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
value: rows
|
||||
} = useProxy(toRef(props, 'rows'));
|
||||
const visibleColumns = computed(() => props.columns.filter(column => column.isVisible ?? true));
|
||||
provideVisibleColumns(visibleColumns);
|
||||
const {
|
||||
hasSortableColumns
|
||||
} = useSortableTable(props, rows, visibleColumns);
|
||||
useCheckableTable(props, rows);
|
||||
useSelectableTable(props);
|
||||
useDraggableTable(props);
|
||||
const windowSize = useWindowSize();
|
||||
const useMobileSorting = computed(() => props.useMobileCards && hasSortableColumns.value && windowSize.value.isTouch);
|
||||
return () => {
|
||||
const nodes = [];
|
||||
|
||||
if (useMobileSorting.value) {
|
||||
nodes.push(h(BTableMobileSort, {
|
||||
placeholder: props.mobileSortPlaceholder
|
||||
}));
|
||||
}
|
||||
|
||||
if (props.pagination) {
|
||||
nodes.push(h(BPagination, isBoolean(props.pagination) ? {
|
||||
total: props.rows.length,
|
||||
items: rows.value
|
||||
} : {
|
||||
isSimple: props.pagination.isSimple,
|
||||
isRounded: props.pagination.isRounded,
|
||||
modelValue: props.pagination.page,
|
||||
'onUpdate:modelValue': props.pagination['onUpdate:page'],
|
||||
total: props.rows.length,
|
||||
items: rows.value,
|
||||
perPage: props.pagination.perPage,
|
||||
size: props.pagination.size,
|
||||
position: props.pagination.horizontalPosition,
|
||||
verticalPosition: props.pagination.verticalPosition
|
||||
}, // eslint-disable-line
|
||||
{
|
||||
default: paginatedState => {
|
||||
return generateTable(props, paginatedState.paginatedItems, visibleColumns, slots);
|
||||
}
|
||||
}));
|
||||
return h('div', nodes);
|
||||
} else {
|
||||
nodes.push(generateTable(props, rows.value, visibleColumns, slots));
|
||||
return h('div', nodes);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
//# sourceMappingURL=BTable.js.map
|
||||
1
node_modules/buetify/lib/components/table/BTable.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/BTable.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
13
node_modules/buetify/lib/components/table/BTableColumn.d.ts
generated
vendored
Executable file
13
node_modules/buetify/lib/components/table/BTableColumn.d.ts
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { PropType } from 'vue';
|
||||
import { BTableColumn } from './shared';
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
column: {
|
||||
type: PropType<BTableColumn<import("./shared").BTableRow>>;
|
||||
required: true;
|
||||
};
|
||||
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
||||
column: BTableColumn<import("./shared").BTableRow>;
|
||||
} & {}>, {}>;
|
||||
export default _default;
|
||||
98
node_modules/buetify/lib/components/table/BTableColumn.js
generated
vendored
Executable file
98
node_modules/buetify/lib/components/table/BTableColumn.js
generated
vendored
Executable file
@@ -0,0 +1,98 @@
|
||||
import { h, defineComponent, computed } from 'vue';
|
||||
import VerticalExpansionIcon from '../icons/verticalExpansion/VerticalExpansionIcon';
|
||||
import BTooltip from '../tooltip/BTooltip';
|
||||
import { isBoolean, isString } from '../../utils/helpers';
|
||||
import { useInjectedSortableTable } from './composables/useSortableTable';
|
||||
|
||||
function formatWidth(width, suffix = 'px') {
|
||||
return isString(width) ? width : `${width}${suffix}`;
|
||||
}
|
||||
|
||||
function useSortType(sortType, column) {
|
||||
return column === undefined || isBoolean(column.sort) || column.sort === undefined ? sortType : column.sort.sortType ?? sortType;
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'b-table-column',
|
||||
props: {
|
||||
column: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, {
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
sortByMap,
|
||||
isMultiple,
|
||||
sortType,
|
||||
updateSortColumn,
|
||||
updateSortDirection
|
||||
} = useInjectedSortableTable();
|
||||
const isSortable = computed(() => !!props.column.sort);
|
||||
const isSortColumn = computed(() => sortByMap.value.has(props.column.label));
|
||||
const sortColumn = computed(() => sortByMap.value.get(props.column.label));
|
||||
|
||||
function updateColumn(e) {
|
||||
e && e.stopPropagation();
|
||||
updateSortColumn(props.column.label);
|
||||
}
|
||||
|
||||
function onClick() {
|
||||
if (isSortColumn.value) {
|
||||
updateSortDirection(props.column.label);
|
||||
} else {
|
||||
updateColumn();
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
const slot = slots[`header.${props.column.label}`] || slots.header;
|
||||
const children = [];
|
||||
|
||||
if (slot) {
|
||||
children.push(slot(props.column));
|
||||
} else {
|
||||
children.push(isString(props.column.detail) ? h(BTooltip, {
|
||||
label: props.column.detail,
|
||||
position: 'is-left'
|
||||
}, () => props.column.label) : props.column.label);
|
||||
}
|
||||
|
||||
if (isSortColumn.value) {
|
||||
const type = useSortType(sortType.value, sortColumn.value);
|
||||
const icon = slots['sort-icon'] ? slots['sort-icon']({
|
||||
sortType: type
|
||||
}) : h(VerticalExpansionIcon, {
|
||||
isExpanded: useSortType(sortType.value, sortColumn.value) === 'Ascending'
|
||||
});
|
||||
|
||||
if (isMultiple.value && sortColumn.value) {
|
||||
children.push(icon, sortColumn.value.sortIndex + 1, h('button', {
|
||||
class: 'delete is-small b-column-delete',
|
||||
onClick: updateColumn
|
||||
}));
|
||||
} else {
|
||||
children.push(icon);
|
||||
}
|
||||
}
|
||||
|
||||
return h('th', {
|
||||
class: {
|
||||
'is-sortable': isSortable.value,
|
||||
'is-sticky-left': !!props.column.isSticky
|
||||
},
|
||||
onClick: isSortable.value ? onClick : undefined,
|
||||
style: props.column.width !== undefined ? {
|
||||
'min-width': formatWidth(props.column.width)
|
||||
} : undefined
|
||||
}, [h('div', {
|
||||
class: ['th-wrap', props.column.position]
|
||||
}, children)]);
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
//# sourceMappingURL=BTableColumn.js.map
|
||||
1
node_modules/buetify/lib/components/table/BTableColumn.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/BTableColumn.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
7
node_modules/buetify/lib/components/table/BTableHeader.d.ts
generated
vendored
Executable file
7
node_modules/buetify/lib/components/table/BTableHeader.d.ts
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
import { SetupContext } from 'vue';
|
||||
export interface BTableHeaderProps {
|
||||
isDisabled?: boolean;
|
||||
}
|
||||
export default function BTableHeader(props: BTableHeaderProps, { slots }: SetupContext): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>;
|
||||
39
node_modules/buetify/lib/components/table/BTableHeader.js
generated
vendored
Executable file
39
node_modules/buetify/lib/components/table/BTableHeader.js
generated
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
import { BCheckbox } from '../form/checkbox/BCheckbox';
|
||||
import BTableColumn from './BTableColumn';
|
||||
import { useInjectedVisibleColumns } from './composables/shared';
|
||||
import { useInjectedCheckableTable } from './composables/useCheckableTable';
|
||||
import { h } from 'vue';
|
||||
export default function BTableHeader(props, {
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
allRowsChecked,
|
||||
toggleAllRows,
|
||||
variant,
|
||||
isCheckable
|
||||
} = useInjectedCheckableTable();
|
||||
const columns = useInjectedVisibleColumns();
|
||||
const nodes = columns.value.map(column => h(BTableColumn, {
|
||||
key: column.label,
|
||||
column
|
||||
}, slots));
|
||||
|
||||
if (isCheckable.value) {
|
||||
nodes.unshift(slots['header.checkbox'] ? h('th', slots['header.checkbox']({
|
||||
modelValue: allRowsChecked.value,
|
||||
variant: variant.value,
|
||||
isDisabled: props.isDisabled,
|
||||
'onUpdate:modelValue': toggleAllRows
|
||||
})) : h('th', {
|
||||
class: 'checkbox-cell'
|
||||
}, [h(BCheckbox, {
|
||||
modelValue: allRowsChecked.value,
|
||||
variant: variant.value,
|
||||
isDisabled: props.isDisabled,
|
||||
'onUpdate:modelValue': toggleAllRows
|
||||
})]));
|
||||
}
|
||||
|
||||
return h('thead', [h('tr', nodes)]);
|
||||
}
|
||||
//# sourceMappingURL=BTableHeader.js.map
|
||||
1
node_modules/buetify/lib/components/table/BTableHeader.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/BTableHeader.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/table/BTableHeader.ts"],"names":[],"mappings":"AAAA,SAAS,SAAT,QAA0B,4BAA1B;AACA,OAAO,YAAP,MAAyB,gBAAzB;AACA,SAAS,yBAAT,QAA0C,sBAA1C;AACA,SAAS,yBAAT,QAA0C,iCAA1C;AACA,SAAuB,CAAvB,QAAgC,KAAhC;AAMA,eAAc,SAAU,YAAV,CAAuB,KAAvB,EAAiD;AAAE,EAAA;AAAF,CAAjD,EAAwE;AACpF,QAAM;AAAE,IAAA,cAAF;AAAkB,IAAA,aAAlB;AAAiC,IAAA,OAAjC;AAA0C,IAAA;AAA1C,MAA0D,yBAAyB,EAAzF;AACA,QAAM,OAAO,GAAG,yBAAyB,EAAzC;AACA,QAAM,KAAK,GAAG,OAAO,CAAC,KAAR,CAAc,GAAd,CAAkB,MAAM,IACpC,CAAC,CACC,YADD,EAEC;AACE,IAAA,GAAG,EAAE,MAAM,CAAC,KADd;AAEE,IAAA;AAFF,GAFD,EAMC,KAND,CADW,CAAd;;AAUA,MAAI,WAAW,CAAC,KAAhB,EAAuB;AACrB,IAAA,KAAK,CAAC,OAAN,CACE,KAAK,CAAC,iBAAD,CAAL,GACI,CAAC,CACC,IADD,EAEC,KAAK,CAAC,iBAAD,CAAL,CAAyB;AACvB,MAAA,UAAU,EAAE,cAAc,CAAC,KADJ;AAEvB,MAAA,OAAO,EAAE,OAAO,CAAC,KAFM;AAGvB,MAAA,UAAU,EAAE,KAAK,CAAC,UAHK;AAIvB,6BAAuB;AAJA,KAAzB,CAFD,CADL,GAUI,CAAC,CAAC,IAAD,EAAO;AAAE,MAAA,KAAK,EAAE;AAAT,KAAP,EAAmC,CAClC,CAAC,CAAC,SAAD,EAAY;AACX,MAAA,UAAU,EAAE,cAAc,CAAC,KADhB;AAEX,MAAA,OAAO,EAAE,OAAO,CAAC,KAFN;AAGX,MAAA,UAAU,EAAE,KAAK,CAAC,UAHP;AAIX,6BAAuB;AAJZ,KAAZ,CADiC,CAAnC,CAXP;AAoBD;;AACD,SAAO,CAAC,CAAC,OAAD,EAAU,CAAC,CAAC,CAAC,IAAD,EAAO,KAAP,CAAF,CAAV,CAAR;AACD","sourcesContent":["import { BCheckbox } from '../form/checkbox/BCheckbox';\nimport BTableColumn from './BTableColumn';\nimport { useInjectedVisibleColumns } from './composables/shared';\nimport { useInjectedCheckableTable } from './composables/useCheckableTable';\nimport { SetupContext, h } from 'vue';\n\nexport interface BTableHeaderProps {\n isDisabled?: boolean;\n}\n\nexport default function BTableHeader(props: BTableHeaderProps, { slots }: SetupContext) {\n const { allRowsChecked, toggleAllRows, variant, isCheckable } = useInjectedCheckableTable();\n const columns = useInjectedVisibleColumns();\n const nodes = columns.value.map(column =>\n h(\n BTableColumn,\n {\n key: column.label,\n column\n },\n slots\n )\n );\n if (isCheckable.value) {\n nodes.unshift(\n slots['header.checkbox']\n ? h(\n 'th',\n slots['header.checkbox']({\n modelValue: allRowsChecked.value,\n variant: variant.value,\n isDisabled: props.isDisabled,\n 'onUpdate:modelValue': toggleAllRows\n })\n )\n : h('th', { class: 'checkbox-cell' }, [\n h(BCheckbox, {\n modelValue: allRowsChecked.value,\n variant: variant.value,\n isDisabled: props.isDisabled,\n 'onUpdate:modelValue': toggleAllRows\n })\n ])\n );\n }\n return h('thead', [h('tr', nodes)]);\n}\n"],"sourceRoot":"","file":"BTableHeader.js"}
|
||||
11
node_modules/buetify/lib/components/table/BTableMobileSort.d.ts
generated
vendored
Executable file
11
node_modules/buetify/lib/components/table/BTableMobileSort.d.ts
generated
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
import { VNode } from 'vue';
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
placeholder: {
|
||||
type: StringConstructor;
|
||||
};
|
||||
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {
|
||||
placeholder?: string | undefined;
|
||||
}>, {}>;
|
||||
export default _default;
|
||||
67
node_modules/buetify/lib/components/table/BTableMobileSort.js
generated
vendored
Executable file
67
node_modules/buetify/lib/components/table/BTableMobileSort.js
generated
vendored
Executable file
@@ -0,0 +1,67 @@
|
||||
import { defineSelect } from '../form/select/BSelect';
|
||||
import VerticalExpansionIcon from '../icons/verticalExpansion/VerticalExpansionIcon';
|
||||
import { useInjectedSortableTable } from './composables/useSortableTable';
|
||||
import { eqBTableColumn } from './shared';
|
||||
import { head } from 'fp-ts/lib/Array';
|
||||
import { toUndefined } from 'fp-ts/lib/Option';
|
||||
import { pipe } from 'fp-ts/lib/pipeable';
|
||||
import { defineComponent, h } from 'vue';
|
||||
const SelectBTableColumn = defineSelect(eqBTableColumn);
|
||||
|
||||
function generateSortDirectionButton(sortType, toggleSortType) {
|
||||
return h('div', {
|
||||
class: 'control'
|
||||
}, [h('button', {
|
||||
class: 'button is-primary',
|
||||
onClick: toggleSortType
|
||||
}, [h(VerticalExpansionIcon, {
|
||||
isExpanded: sortType === 'Descending',
|
||||
size: 'is-small'
|
||||
})])]);
|
||||
}
|
||||
|
||||
function generateBSelect(placeholder, sortableColumns, sortBy, setSortColumn) {
|
||||
return h(SelectBTableColumn, {
|
||||
placeholder,
|
||||
items: sortableColumns,
|
||||
itemKey: 'label',
|
||||
itemText: 'label',
|
||||
modelValue: pipe(head(sortBy), toUndefined),
|
||||
isExpanded: true,
|
||||
'onUpdate:modelValue': setSortColumn
|
||||
});
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'b-table-mobile-sort',
|
||||
props: {
|
||||
placeholder: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
const sorting = useInjectedSortableTable();
|
||||
|
||||
function toggleSortDirection() {
|
||||
sorting.updateSortDirection();
|
||||
}
|
||||
|
||||
function updateSortColumn(column) {
|
||||
if (column) {
|
||||
sorting.updateSortColumn(column.label);
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
return h('section', {
|
||||
class: 'field table-mobile-sort',
|
||||
'aria-label': 'Table Sort Controls'
|
||||
}, [h('div', {
|
||||
class: 'field has-addons'
|
||||
}, [generateBSelect(props.placeholder, sorting.sortableColumns.value, sorting.sortBy.value, updateSortColumn), generateSortDirectionButton(sorting.sortType.value, toggleSortDirection)])]);
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
//# sourceMappingURL=BTableMobileSort.js.map
|
||||
1
node_modules/buetify/lib/components/table/BTableMobileSort.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/BTableMobileSort.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/table/BTableMobileSort.ts"],"names":[],"mappings":"AAEA,SAAS,YAAT,QAA6B,wBAA7B;AACA,OAAO,qBAAP,MAAkC,kDAAlC;AACA,SAAS,wBAAT,QAAyC,gCAAzC;AACA,SAAuB,cAAvB,QAAuD,UAAvD;AACA,SAAS,IAAT,QAAqB,iBAArB;AACA,SAAS,WAAT,QAA4B,kBAA5B;AACA,SAAS,IAAT,QAAqB,oBAArB;AACA,SAAgB,eAAhB,EAAiC,CAAjC,QAA0C,KAA1C;AAEA,MAAM,kBAAkB,GAAG,YAAY,CAAe,cAAf,CAAvC;;AAEA,SAAS,2BAAT,CAAqC,QAArC,EAAyD,cAAzD,EAAiF;AAC/E,SAAO,CAAC,CAAC,KAAD,EAAQ;AAAE,IAAA,KAAK,EAAE;AAAT,GAAR,EAA8B,CACpC,CAAC,CACC,QADD,EAEC;AACE,IAAA,KAAK,EAAE,mBADT;AAEE,IAAA,OAAO,EAAE;AAFX,GAFD,EAMC,CACE,CAAC,CAAC,qBAAD,EAAwB;AACvB,IAAA,UAAU,EAAE,QAAQ,KAAK,YADF;AAEvB,IAAA,IAAI,EAAE;AAFiB,GAAxB,CADH,CAND,CADmC,CAA9B,CAAR;AAeD;;AAED,SAAS,eAAT,CACE,WADF,EAEE,eAFF,EAGE,MAHF,EAIE,aAJF,EAIgD;AAE9C,SAAO,CAAC,CAAC,kBAAD,EAAqB;AAC3B,IAAA,WAD2B;AAE3B,IAAA,KAAK,EAAE,eAFoB;AAG3B,IAAA,OAAO,EAAE,OAHkB;AAI3B,IAAA,QAAQ,EAAE,OAJiB;AAK3B,IAAA,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAD,CAAL,EAAe,WAAf,CALW;AAM3B,IAAA,UAAU,EAAE,IANe;AAO3B,2BAAuB;AAPI,GAArB,CAAR;AASD;;AAED,eAAe,eAAe,CAAC;AAC7B,EAAA,IAAI,EAAE,qBADuB;AAE7B,EAAA,KAAK,EAAE;AACL,IAAA,WAAW,EAAE;AACX,MAAA,IAAI,EAAE;AADK;AADR,GAFsB;;AAO7B,EAAA,KAAK,CAAC,KAAD,EAAM;AACT,UAAM,OAAO,GAAG,wBAAwB,EAAxC;;AAEA,aAAS,mBAAT,GAA4B;AAC1B,MAAA,OAAO,CAAC,mBAAR;AACD;;AAED,aAAS,gBAAT,CAA0B,MAA1B,EAA+C;AAC7C,UAAI,MAAJ,EAAY;AACV,QAAA,OAAO,CAAC,gBAAR,CAAyB,MAAM,CAAC,KAAhC;AACD;AACF;;AAED,WAAO,MAAK;AACV,aAAO,CAAC,CACN,SADM,EAEN;AACE,QAAA,KAAK,EAAE,yBADT;AAEE,sBAAc;AAFhB,OAFM,EAMN,CACE,CAAC,CAAC,KAAD,EAAQ;AAAE,QAAA,KAAK,EAAE;AAAT,OAAR,EAAuC,CACtC,eAAe,CAAC,KAAK,CAAC,WAAP,EAAoB,OAAO,CAAC,eAAR,CAAwB,KAA5C,EAAmD,OAAO,CAAC,MAAR,CAAe,KAAlE,EAAyE,gBAAzE,CADuB,EAEtC,2BAA2B,CAAC,OAAO,CAAC,QAAR,CAAiB,KAAlB,EAAyB,mBAAzB,CAFW,CAAvC,CADH,CANM,CAAR;AAaD,KAdD;AAeD;;AAnC4B,CAAD,CAA9B","sourcesContent":["import { IO } from 'fp-ts/IO';\nimport { FunctionN } from 'fp-ts/lib/function';\nimport { defineSelect } from '../form/select/BSelect';\nimport VerticalExpansionIcon from '../icons/verticalExpansion/VerticalExpansionIcon';\nimport { useInjectedSortableTable } from './composables/useSortableTable';\nimport { BTableColumn, eqBTableColumn, SortType } from './shared';\nimport { head } from 'fp-ts/lib/Array';\nimport { toUndefined } from 'fp-ts/lib/Option';\nimport { pipe } from 'fp-ts/lib/pipeable';\nimport { VNode, defineComponent, h } from 'vue';\n\nconst SelectBTableColumn = defineSelect<BTableColumn>(eqBTableColumn);\n\nfunction generateSortDirectionButton(sortType: SortType, toggleSortType: IO<void>): VNode {\n return h('div', { class: 'control' }, [\n h(\n 'button',\n {\n class: 'button is-primary',\n onClick: toggleSortType\n },\n [\n h(VerticalExpansionIcon, {\n isExpanded: sortType === 'Descending',\n size: 'is-small'\n })\n ]\n )\n ]);\n}\n\nfunction generateBSelect(\n placeholder: string | undefined,\n sortableColumns: BTableColumn[],\n sortBy: BTableColumn[],\n setSortColumn: FunctionN<[BTableColumn], void>\n): VNode {\n return h(SelectBTableColumn, {\n placeholder,\n items: sortableColumns,\n itemKey: 'label',\n itemText: 'label',\n modelValue: pipe(head(sortBy), toUndefined),\n isExpanded: true,\n 'onUpdate:modelValue': setSortColumn\n });\n}\n\nexport default defineComponent({\n name: 'b-table-mobile-sort',\n props: {\n placeholder: {\n type: String\n }\n },\n setup(props) {\n const sorting = useInjectedSortableTable();\n\n function toggleSortDirection() {\n sorting.updateSortDirection();\n }\n\n function updateSortColumn(column?: BTableColumn) {\n if (column) {\n sorting.updateSortColumn(column.label);\n }\n }\n\n return () => {\n return h(\n 'section',\n {\n class: 'field table-mobile-sort',\n 'aria-label': 'Table Sort Controls'\n },\n [\n h('div', { class: 'field has-addons' }, [\n generateBSelect(props.placeholder, sorting.sortableColumns.value, sorting.sortBy.value, updateSortColumn),\n generateSortDirectionButton(sorting.sortType.value, toggleSortDirection)\n ])\n ]\n );\n };\n }\n});\n"],"sourceRoot":"","file":"BTableMobileSort.js"}
|
||||
24
node_modules/buetify/lib/components/table/BTableRow.d.ts
generated
vendored
Executable file
24
node_modules/buetify/lib/components/table/BTableRow.d.ts
generated
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
import { FunctionN } from 'fp-ts/lib/function';
|
||||
import { BTableRow } from './shared';
|
||||
import { VNode, PropType } from 'vue';
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
index: {
|
||||
type: PropType<number>;
|
||||
required: true;
|
||||
};
|
||||
row: {
|
||||
type: PropType<BTableRow>;
|
||||
required: true;
|
||||
};
|
||||
onRowClick: {
|
||||
type: PropType<FunctionN<[BTableRow, MouseEvent], void>>;
|
||||
};
|
||||
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
||||
index: number;
|
||||
row: BTableRow;
|
||||
} & {
|
||||
onRowClick?: FunctionN<[BTableRow, MouseEvent], void> | undefined;
|
||||
}>, {}>;
|
||||
export default _default;
|
||||
120
node_modules/buetify/lib/components/table/BTableRow.js
generated
vendored
Executable file
120
node_modules/buetify/lib/components/table/BTableRow.js
generated
vendored
Executable file
@@ -0,0 +1,120 @@
|
||||
import { exists } from 'fp-ts/Option';
|
||||
import { pipe } from 'fp-ts/pipeable';
|
||||
import { BCheckbox } from '../form/checkbox/BCheckbox';
|
||||
import { isString } from '../../utils/helpers';
|
||||
import { useInjectedVisibleColumns } from './composables/shared';
|
||||
import { useInjectedCheckableTable } from './composables/useCheckableTable';
|
||||
import { useInjectedDraggableTable } from './composables/useDraggableTable';
|
||||
import { useInjectedSelectableTable } from './composables/useSelectableTable';
|
||||
import { eqBTableRowData } from './shared';
|
||||
import { h, defineComponent, computed } from 'vue';
|
||||
export default defineComponent({
|
||||
name: 'b-table-row',
|
||||
props: {
|
||||
index: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
row: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
onRowClick: {
|
||||
type: Function
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, {
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
checkedRowIds,
|
||||
variant,
|
||||
toggleRow,
|
||||
isCheckable
|
||||
} = useInjectedCheckableTable();
|
||||
const {
|
||||
selectedRowIds,
|
||||
toggleRowSelection,
|
||||
isSelectable
|
||||
} = useInjectedSelectableTable();
|
||||
const draggable = useInjectedDraggableTable();
|
||||
const visibleColumns = useInjectedVisibleColumns();
|
||||
const isChecked = computed(() => checkedRowIds.value.has(props.row.id));
|
||||
const isSelected = computed(() => selectedRowIds.value.has(props.row.id));
|
||||
const classes = computed(() => {
|
||||
const isActive = draggable.isActive.value;
|
||||
const isDroppable = props.row.isDroppable ?? !!props.row.isDraggable;
|
||||
return [{
|
||||
'is-selected': isSelected.value,
|
||||
'is-checked': isChecked.value,
|
||||
'is-draggable': draggable.isDraggable.value && !!props.row.isDraggable,
|
||||
'is-droppable': isActive && isDroppable,
|
||||
'is-undroppable': isActive && !isDroppable,
|
||||
'is-drop-target': isActive && pipe(draggable.target.value, exists(t => eqBTableRowData.equals(t, props.row)))
|
||||
}, props.row.classes];
|
||||
});
|
||||
const dragListeners = computed(() => draggable.useRowDragListeners(props.row, props.index));
|
||||
|
||||
function toggleCheck() {
|
||||
toggleRow(props.row);
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
if (props.onRowClick) {
|
||||
props.onRowClick(props.row, e);
|
||||
}
|
||||
|
||||
if (props.row.isSelectable ?? isSelectable.value) {
|
||||
e.stopPropagation();
|
||||
toggleRowSelection(props.row);
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
const columns = visibleColumns.value.map(column => {
|
||||
const children = [];
|
||||
const value = column.value ? isString(column.value) ? props.row[column.value] : column.value(props.row) : undefined;
|
||||
const columnSlot = slots[column.slotName || column.label];
|
||||
|
||||
if (columnSlot) {
|
||||
children.push(columnSlot({
|
||||
row: props.row,
|
||||
column,
|
||||
value
|
||||
}));
|
||||
} else if (value !== null) {
|
||||
children.push(String(value));
|
||||
}
|
||||
|
||||
const textClass = column.position === undefined ? 'has-text-left' : column.position === 'is-left' ? 'has-text-left' : column.position === 'is-centered' ? 'has-text-centered' : 'has-text-right';
|
||||
return h('td', {
|
||||
class: [textClass, {
|
||||
'is-sticky-left': column.isSticky
|
||||
}],
|
||||
'data-label': column.label
|
||||
}, children);
|
||||
});
|
||||
|
||||
if (isCheckable.value) {
|
||||
columns.unshift(h('td', {
|
||||
class: 'checkbox-cell'
|
||||
}, [h(BCheckbox, {
|
||||
modelValue: isChecked.value,
|
||||
variant: variant.value,
|
||||
isDisabled: props.row.isCheckable === false,
|
||||
'onUpdate:modelValue': toggleCheck
|
||||
})]));
|
||||
}
|
||||
|
||||
return h('tr', {
|
||||
class: classes.value,
|
||||
onClick,
|
||||
draggable: draggable.isDraggable.value && !!props.row.isDraggable,
|
||||
...dragListeners.value
|
||||
}, columns);
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
//# sourceMappingURL=BTableRow.js.map
|
||||
1
node_modules/buetify/lib/components/table/BTableRow.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/BTableRow.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
5
node_modules/buetify/lib/components/table/composables/shared.d.ts
generated
vendored
Executable file
5
node_modules/buetify/lib/components/table/composables/shared.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import { ComputedRef } from 'vue';
|
||||
import { BTableColumn, BTableRow } from '../shared';
|
||||
export declare function toSet(rows: BTableRow[]): Set<unknown>;
|
||||
export declare function provideVisibleColumns(visibleColumns: ComputedRef<BTableColumn[]>): void;
|
||||
export declare function useInjectedVisibleColumns(): ComputedRef<BTableColumn[]>;
|
||||
16
node_modules/buetify/lib/components/table/composables/shared.js
generated
vendored
Executable file
16
node_modules/buetify/lib/components/table/composables/shared.js
generated
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
import { provide, inject, computed } from 'vue';
|
||||
import { constEmptyArray } from '../../../utils/helpers';
|
||||
export function toSet(rows) {
|
||||
const set = new Set();
|
||||
rows.forEach(row => set.add(row.id));
|
||||
return set;
|
||||
}
|
||||
const COLUMNS_INJECTION_SYMBOL = Symbol();
|
||||
export function provideVisibleColumns(visibleColumns) {
|
||||
provide(COLUMNS_INJECTION_SYMBOL, visibleColumns);
|
||||
}
|
||||
const DEFAULT_VISIBLE_COLUMNS = computed(constEmptyArray);
|
||||
export function useInjectedVisibleColumns() {
|
||||
return inject(COLUMNS_INJECTION_SYMBOL, DEFAULT_VISIBLE_COLUMNS);
|
||||
}
|
||||
//# sourceMappingURL=shared.js.map
|
||||
1
node_modules/buetify/lib/components/table/composables/shared.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/composables/shared.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/components/table/composables/shared.ts"],"names":[],"mappings":"AAAA,SAAsB,OAAtB,EAA+B,MAA/B,EAAuC,QAAvC,QAAuD,KAAvD;AACA,SAAS,eAAT,QAAgC,wBAAhC;AAIA,OAAM,SAAU,KAAV,CAAgB,IAAhB,EAAiC;AACrC,QAAM,GAAG,GAAG,IAAI,GAAJ,EAAZ;AACA,EAAA,IAAI,CAAC,OAAL,CAAa,GAAG,IAAI,GAAG,CAAC,GAAJ,CAAQ,GAAG,CAAC,EAAZ,CAApB;AACA,SAAO,GAAP;AACD;AAED,MAAM,wBAAwB,GAAG,MAAM,EAAvC;AAEA,OAAM,SAAU,qBAAV,CAAgC,cAAhC,EAA2E;AAC/E,EAAA,OAAO,CAAC,wBAAD,EAA2B,cAA3B,CAAP;AACD;AAED,MAAM,uBAAuB,GAAG,QAAQ,CAAiB,eAAjB,CAAxC;AAEA,OAAM,SAAU,yBAAV,GAAmC;AACvC,SAAO,MAAM,CAAC,wBAAD,EAA2B,uBAA3B,CAAb;AACD","sourcesContent":["import { ComputedRef, provide, inject, computed } from 'vue';\r\nimport { constEmptyArray } from '../../../utils/helpers';\r\n\r\nimport { BTableColumn, BTableRow } from '../shared';\r\n\r\nexport function toSet(rows: BTableRow[]): Set<unknown> {\r\n const set = new Set<unknown>();\r\n rows.forEach(row => set.add(row.id));\r\n return set;\r\n}\r\n\r\nconst COLUMNS_INJECTION_SYMBOL = Symbol();\r\n\r\nexport function provideVisibleColumns(visibleColumns: ComputedRef<BTableColumn[]>) {\r\n provide(COLUMNS_INJECTION_SYMBOL, visibleColumns);\r\n}\r\n\r\nconst DEFAULT_VISIBLE_COLUMNS = computed<BTableColumn[]>(constEmptyArray);\r\n\r\nexport function useInjectedVisibleColumns(): ComputedRef<BTableColumn[]> {\r\n return inject(COLUMNS_INJECTION_SYMBOL, DEFAULT_VISIBLE_COLUMNS);\r\n}\r\n"],"sourceRoot":"","file":"shared.js"}
|
||||
53
node_modules/buetify/lib/components/table/composables/useCheckableTable.d.ts
generated
vendored
Executable file
53
node_modules/buetify/lib/components/table/composables/useCheckableTable.d.ts
generated
vendored
Executable file
@@ -0,0 +1,53 @@
|
||||
import { IO } from 'fp-ts/lib/IO';
|
||||
import { ExtractPropTypes, Ref, ComputedRef } from 'vue';
|
||||
import { FunctionN } from 'fp-ts/lib/function';
|
||||
import { PropType } from 'vue';
|
||||
import { ColorVariant } from '../../../types/ColorVariants';
|
||||
import { BTableRow } from '../shared';
|
||||
export declare const BTableCheckPropsDefinition: {
|
||||
isCheckable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
checkedRows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
default: never[];
|
||||
};
|
||||
'onUpdate:checkedRows': {
|
||||
type: PropType<FunctionN<[BTableRow[]], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
checkboxVariant: {
|
||||
type: PropType<ColorVariant>;
|
||||
default: "is-primary";
|
||||
};
|
||||
canCheckAllRows: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onCheckRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onUncheckRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
};
|
||||
export interface BTableCheckProps extends ExtractPropTypes<typeof BTableCheckPropsDefinition> {
|
||||
}
|
||||
export declare function useCheckableTable(props: BTableCheckProps, rows: Ref<BTableRow[]>): UseCheckableTable;
|
||||
export interface UseCheckableTable {
|
||||
isCheckable: ComputedRef<boolean>;
|
||||
variant: ComputedRef<ColorVariant>;
|
||||
checkedRowIds: ComputedRef<Set<unknown>>;
|
||||
toggleAllRows: IO<void>;
|
||||
checkAllRows: IO<void>;
|
||||
uncheckAllRows: IO<void>;
|
||||
allRowsChecked: ComputedRef<boolean>;
|
||||
toggleRow: FunctionN<[BTableRow], void>;
|
||||
allRowsUncheckable: ComputedRef<boolean>;
|
||||
hasCheckableRows: ComputedRef<boolean>;
|
||||
allRowsUnchecked: ComputedRef<boolean>;
|
||||
}
|
||||
export declare function useInjectedCheckableTable(): UseCheckableTable;
|
||||
119
node_modules/buetify/lib/components/table/composables/useCheckableTable.js
generated
vendored
Executable file
119
node_modules/buetify/lib/components/table/composables/useCheckableTable.js
generated
vendored
Executable file
@@ -0,0 +1,119 @@
|
||||
import { computed, provide, inject, shallowRef, watch } from 'vue';
|
||||
import { constant, constFalse, constTrue, constVoid } from 'fp-ts/lib/function';
|
||||
import { constEmptyArray } from '../../../utils/helpers';
|
||||
import { toggleBTableRow } from '../shared';
|
||||
import { toSet } from './shared';
|
||||
export const BTableCheckPropsDefinition = {
|
||||
isCheckable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
checkedRows: {
|
||||
type: Array,
|
||||
default: constEmptyArray()
|
||||
},
|
||||
'onUpdate:checkedRows': {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
checkboxVariant: {
|
||||
type: String,
|
||||
default: 'is-primary'
|
||||
},
|
||||
canCheckAllRows: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
onCheckRow: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onUncheckRow: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
}
|
||||
};
|
||||
const USE_CHECKABLE_TABLE_INJECTION_SYMBOL = Symbol();
|
||||
export function useCheckableTable(props, rows) {
|
||||
const checkableRows = computed(() => props.isCheckable ? rows.value.filter(row => row.isCheckable ?? true) : []);
|
||||
const propCheckedRows = computed(() => props.isCheckable ? props.checkedRows : []);
|
||||
const newCheckedRows = shallowRef(propCheckedRows.value);
|
||||
watch(propCheckedRows, newValue => {
|
||||
newCheckedRows.value = newValue;
|
||||
});
|
||||
const checkedRowIds = computed(() => toSet(newCheckedRows.value));
|
||||
const allRowsChecked = computed(() => {
|
||||
const ids = checkedRowIds.value;
|
||||
return checkableRows.value.length > 0 && checkableRows.value.every(row => ids.has(row.id));
|
||||
});
|
||||
const allRowsUncheckable = computed(() => rows.value.every(row => !row.isCheckable));
|
||||
|
||||
function checkAllRows() {
|
||||
const cRows = checkableRows.value;
|
||||
newCheckedRows.value = cRows;
|
||||
props['onUpdate:checkedRows'](cRows);
|
||||
}
|
||||
|
||||
function toggleRow(row) {
|
||||
if (row.isCheckable) {
|
||||
const ids = checkedRowIds.value;
|
||||
|
||||
if (ids.has(row.id)) {
|
||||
props.onUncheckRow(row);
|
||||
} else {
|
||||
props.onCheckRow(row);
|
||||
}
|
||||
|
||||
const cRows = toggleBTableRow(row, newCheckedRows.value);
|
||||
newCheckedRows.value = cRows;
|
||||
props['onUpdate:checkedRows'](cRows);
|
||||
}
|
||||
}
|
||||
|
||||
function uncheckAllRows() {
|
||||
newCheckedRows.value = [];
|
||||
props['onUpdate:checkedRows']([]);
|
||||
}
|
||||
|
||||
function toggleAllRows() {
|
||||
allRowsChecked.value ? uncheckAllRows() : checkAllRows();
|
||||
}
|
||||
|
||||
const hasCheckableRows = computed(() => checkableRows.value.length > 0);
|
||||
const state = {
|
||||
isCheckable: computed(() => props.isCheckable),
|
||||
variant: computed(() => props.checkboxVariant),
|
||||
checkedRowIds,
|
||||
toggleAllRows,
|
||||
checkAllRows,
|
||||
uncheckAllRows,
|
||||
allRowsChecked,
|
||||
toggleRow,
|
||||
allRowsUncheckable,
|
||||
hasCheckableRows,
|
||||
allRowsUnchecked: computed(() => hasCheckableRows.value && checkedRowIds.value.size === 0)
|
||||
};
|
||||
provide(USE_CHECKABLE_TABLE_INJECTION_SYMBOL, state);
|
||||
return state;
|
||||
}
|
||||
|
||||
function useDefaultCheckableTableState() {
|
||||
return {
|
||||
isCheckable: computed(constFalse),
|
||||
variant: computed(() => 'is-primary'),
|
||||
checkedRowIds: computed(() => new Set()),
|
||||
toggleAllRows: constVoid,
|
||||
checkAllRows: constVoid,
|
||||
uncheckAllRows: constVoid,
|
||||
toggleRow: constVoid,
|
||||
allRowsChecked: computed(constFalse),
|
||||
allRowsUncheckable: computed(constFalse),
|
||||
hasCheckableRows: computed(constFalse),
|
||||
allRowsUnchecked: computed(constTrue)
|
||||
};
|
||||
}
|
||||
|
||||
export function useInjectedCheckableTable() {
|
||||
return inject(USE_CHECKABLE_TABLE_INJECTION_SYMBOL, useDefaultCheckableTableState, true);
|
||||
}
|
||||
//# sourceMappingURL=useCheckableTable.js.map
|
||||
1
node_modules/buetify/lib/components/table/composables/useCheckableTable.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/composables/useCheckableTable.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
53
node_modules/buetify/lib/components/table/composables/useDraggableTable.d.ts
generated
vendored
Executable file
53
node_modules/buetify/lib/components/table/composables/useDraggableTable.d.ts
generated
vendored
Executable file
@@ -0,0 +1,53 @@
|
||||
import { Option } from 'fp-ts/lib/Option';
|
||||
import { ExtractPropTypes } from 'vue';
|
||||
import { FunctionN } from 'fp-ts/lib/function';
|
||||
import { PropType, Ref } from 'vue';
|
||||
import { BTableRow } from '../shared';
|
||||
declare type DropEffect = 'none' | 'copy' | 'link' | 'move';
|
||||
declare type DragHandler = FunctionN<[DragEvent], void>;
|
||||
declare type OnDragEffect = FunctionN<[BTableRow, DragEvent, number], void>;
|
||||
export declare const BTableDraggablePropsDefinition: {
|
||||
isDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: boolean;
|
||||
};
|
||||
dropEffect: {
|
||||
type: PropType<DropEffect>;
|
||||
default: "move";
|
||||
};
|
||||
onDragstart: {
|
||||
type: PropType<OnDragEffect>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragenter: {
|
||||
type: PropType<OnDragEffect>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragover: {
|
||||
type: PropType<OnDragEffect>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragleave: {
|
||||
type: PropType<OnDragEffect>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDragend: {
|
||||
type: PropType<OnDragEffect>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onDrop: {
|
||||
type: PropType<OnDragEffect>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
};
|
||||
export interface BTableDraggableProps extends ExtractPropTypes<typeof BTableDraggablePropsDefinition> {
|
||||
}
|
||||
export interface UseDraggableTable {
|
||||
isDraggable: Ref<boolean>;
|
||||
isActive: Ref<boolean>;
|
||||
target: Ref<Option<BTableRow>>;
|
||||
useRowDragListeners: FunctionN<[BTableRow, number], Record<string, DragHandler>>;
|
||||
}
|
||||
export declare function useDraggableTable(props: BTableDraggableProps): UseDraggableTable;
|
||||
export declare function useInjectedDraggableTable(): UseDraggableTable;
|
||||
export {};
|
||||
155
node_modules/buetify/lib/components/table/composables/useDraggableTable.js
generated
vendored
Executable file
155
node_modules/buetify/lib/components/table/composables/useDraggableTable.js
generated
vendored
Executable file
@@ -0,0 +1,155 @@
|
||||
import { isNone, isSome, none, some } from 'fp-ts/lib/Option';
|
||||
import { shallowRef, toRef, computed } from 'vue';
|
||||
import { constant, constVoid } from 'fp-ts/lib/function';
|
||||
import { provide, inject } from 'vue';
|
||||
import { eqBTableRowData } from '../shared';
|
||||
export const BTableDraggablePropsDefinition = {
|
||||
isDraggable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
dropEffect: {
|
||||
type: String,
|
||||
default: 'move'
|
||||
},
|
||||
onDragstart: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onDragenter: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onDragover: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onDragleave: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onDragend: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onDrop: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
}
|
||||
};
|
||||
const USE_DRAGGABLE_TABLE_INJECTION_SYMBOL = Symbol();
|
||||
export function useDraggableTable(props) {
|
||||
const dropTarget = shallowRef(none);
|
||||
const dragIsActive = computed(() => props.isDraggable && isSome(dropTarget.value));
|
||||
|
||||
function getOnDragStartListener(row, index) {
|
||||
return e => {
|
||||
if (e.dataTransfer) {
|
||||
e.dataTransfer.setData('text/plain', String(index));
|
||||
e.dataTransfer.dropEffect = props.dropEffect;
|
||||
}
|
||||
|
||||
dropTarget.value = some(row);
|
||||
props.onDragstart(row, e, index);
|
||||
};
|
||||
}
|
||||
|
||||
function getOnDropListener(row, index) {
|
||||
return e => {
|
||||
if (row.isDroppable) {
|
||||
e.preventDefault();
|
||||
props.onDrop(row, e, index);
|
||||
}
|
||||
|
||||
dropTarget.value = none;
|
||||
};
|
||||
}
|
||||
|
||||
function getOnDragEnterListener(row, index) {
|
||||
return e => {
|
||||
if (row.isDroppable) {
|
||||
e.preventDefault();
|
||||
dropTarget.value = some(row);
|
||||
props.onDragenter(row, e, index);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getOnDragOverListener(row, index) {
|
||||
return e => {
|
||||
if (row.isDroppable) {
|
||||
e.preventDefault();
|
||||
const target = dropTarget.value;
|
||||
|
||||
if (isNone(target) || isSome(target) && !eqBTableRowData.equals(target.value, row)) {
|
||||
dropTarget.value = some(row);
|
||||
}
|
||||
|
||||
props.onDragover(row, e, index);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getOnDragLeaveListener(row, index) {
|
||||
return e => {
|
||||
if (row.isDroppable) {
|
||||
e.preventDefault();
|
||||
const target = dropTarget.value;
|
||||
|
||||
if (isSome(target) && eqBTableRowData.equals(target.value, row)) {
|
||||
dropTarget.value = none;
|
||||
}
|
||||
|
||||
props.onDragleave(row, e, index);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getOnDragEndListener(row, index) {
|
||||
return e => {
|
||||
props.onDragend(row, e, index);
|
||||
|
||||
if (isSome(dropTarget.value)) {
|
||||
dropTarget.value = none;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function useRowDragListeners(row, index) {
|
||||
if (props.isDraggable && !!row.isDraggable) {
|
||||
return {
|
||||
onDragstart: getOnDragStartListener(row, index),
|
||||
onDrop: getOnDropListener(row, index),
|
||||
onDragenter: getOnDragEnterListener(row, index),
|
||||
onDragleave: getOnDragLeaveListener(row, index),
|
||||
onDragover: getOnDragOverListener(row, index),
|
||||
onDragend: getOnDragEndListener(row, index)
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
const draggableTable = {
|
||||
isDraggable: toRef(props, 'isDraggable'),
|
||||
useRowDragListeners,
|
||||
isActive: dragIsActive,
|
||||
target: dropTarget
|
||||
};
|
||||
provide(USE_DRAGGABLE_TABLE_INJECTION_SYMBOL, draggableTable);
|
||||
return draggableTable;
|
||||
}
|
||||
|
||||
function useDefaultDraggableTable() {
|
||||
return {
|
||||
isDraggable: shallowRef(false),
|
||||
useRowDragListeners: constant({}),
|
||||
isActive: shallowRef(false),
|
||||
target: shallowRef(none)
|
||||
};
|
||||
}
|
||||
|
||||
export function useInjectedDraggableTable() {
|
||||
return inject(USE_DRAGGABLE_TABLE_INJECTION_SYMBOL, useDefaultDraggableTable, true);
|
||||
}
|
||||
//# sourceMappingURL=useDraggableTable.js.map
|
||||
1
node_modules/buetify/lib/components/table/composables/useDraggableTable.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/composables/useDraggableTable.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
34
node_modules/buetify/lib/components/table/composables/useSelectableTable.d.ts
generated
vendored
Executable file
34
node_modules/buetify/lib/components/table/composables/useSelectableTable.d.ts
generated
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
import { FunctionN } from 'fp-ts/lib/function';
|
||||
import { ExtractPropTypes, PropType, ComputedRef, Ref } from 'vue';
|
||||
import { BTableRow } from '../shared';
|
||||
export declare const BTableSelectablePropsDefinition: {
|
||||
isSelectable: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
selectedRows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
default: import("fp-ts/lib/function").Lazy<never[]>;
|
||||
};
|
||||
'onUpdate:selectedRows': {
|
||||
type: PropType<FunctionN<[BTableRow[]], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onSelectRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
onUnselectRow: {
|
||||
type: PropType<FunctionN<[BTableRow], void>>;
|
||||
default: import("fp-ts/lib/function").Lazy<() => void>;
|
||||
};
|
||||
};
|
||||
export interface BTableSelectableProps extends ExtractPropTypes<typeof BTableSelectablePropsDefinition> {
|
||||
}
|
||||
export declare function useSelectableTable(props: BTableSelectableProps): UseSelectableTableState;
|
||||
export interface UseSelectableTableState {
|
||||
isSelectable: Ref<boolean>;
|
||||
selectedRowIds: ComputedRef<Set<unknown>>;
|
||||
toggleRowSelection: FunctionN<[BTableRow], void>;
|
||||
}
|
||||
export declare function useInjectedSelectableTable(): UseSelectableTableState;
|
||||
64
node_modules/buetify/lib/components/table/composables/useSelectableTable.js
generated
vendored
Executable file
64
node_modules/buetify/lib/components/table/composables/useSelectableTable.js
generated
vendored
Executable file
@@ -0,0 +1,64 @@
|
||||
import { constant, constVoid } from 'fp-ts/lib/function';
|
||||
import { computed, toRef, provide, inject, shallowRef } from 'vue';
|
||||
import { useProxy } from '../../../composables/proxy/useProxy';
|
||||
import { constEmptyArray } from '../../../utils/helpers';
|
||||
import { toggleBTableRow } from '../shared';
|
||||
import { toSet } from './shared';
|
||||
export const BTableSelectablePropsDefinition = {
|
||||
isSelectable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
selectedRows: {
|
||||
type: Array,
|
||||
default: constEmptyArray
|
||||
},
|
||||
'onUpdate:selectedRows': {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onSelectRow: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
},
|
||||
onUnselectRow: {
|
||||
type: Function,
|
||||
default: constant(constVoid)
|
||||
}
|
||||
};
|
||||
const USE_SELECTABLE_TABLE_INJECTION_SYMBOL = Symbol();
|
||||
export function useSelectableTable(props) {
|
||||
const {
|
||||
value: selectedRows
|
||||
} = useProxy(computed(() => props.isSelectable ? props.selectedRows : []), toRef(props, 'onUpdate:selectedRows'));
|
||||
const selectedRowIds = computed(() => toSet(selectedRows.value));
|
||||
|
||||
function toggleRowSelection(row) {
|
||||
if (row.isSelectable ?? props.isSelectable) {
|
||||
const ids = selectedRowIds.value;
|
||||
ids.has(row.id) ? props.onUnselectRow(row) : props.onSelectRow(row);
|
||||
selectedRows.value = toggleBTableRow(row, selectedRows.value);
|
||||
}
|
||||
}
|
||||
|
||||
const state = {
|
||||
isSelectable: toRef(props, 'isSelectable'),
|
||||
selectedRowIds,
|
||||
toggleRowSelection
|
||||
};
|
||||
provide(USE_SELECTABLE_TABLE_INJECTION_SYMBOL, state);
|
||||
return state;
|
||||
}
|
||||
|
||||
function useDefaultSelectableTableState() {
|
||||
return {
|
||||
isSelectable: shallowRef(false),
|
||||
selectedRowIds: computed(() => new Set()),
|
||||
toggleRowSelection: constVoid
|
||||
};
|
||||
}
|
||||
|
||||
export function useInjectedSelectableTable() {
|
||||
return inject(USE_SELECTABLE_TABLE_INJECTION_SYMBOL, useDefaultSelectableTableState, true);
|
||||
}
|
||||
//# sourceMappingURL=useSelectableTable.js.map
|
||||
1
node_modules/buetify/lib/components/table/composables/useSelectableTable.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/composables/useSelectableTable.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/components/table/composables/useSelectableTable.ts"],"names":[],"mappings":"AAAA,SAAS,QAAT,EAAmB,SAAnB,QAA+C,oBAA/C;AACA,SAAS,QAAT,EAA+C,KAA/C,EAAsD,OAAtD,EAA+D,MAA/D,EAAyF,UAAzF,QAA2G,KAA3G;AACA,SAAS,QAAT,QAAyB,qCAAzB;AACA,SAAS,eAAT,QAAgC,wBAAhC;AACA,SAAoB,eAApB,QAA2C,WAA3C;AACA,SAAS,KAAT,QAAsB,UAAtB;AAEA,OAAO,MAAM,+BAA+B,GAAG;AAC7C,EAAA,YAAY,EAAE;AACZ,IAAA,IAAI,EAAE,OADM;AAEZ,IAAA,OAAO,EAAE;AAFG,GAD+B;AAK7C,EAAA,YAAY,EAAE;AACZ,IAAA,IAAI,EAAE,KADM;AAEZ,IAAA,OAAO,EAAE;AAFG,GAL+B;AAS7C,2BAAyB;AACvB,IAAA,IAAI,EAAE,QADiB;AAEvB,IAAA,OAAO,EAAE,QAAQ,CAAC,SAAD;AAFM,GAToB;AAa7C,EAAA,WAAW,EAAE;AACX,IAAA,IAAI,EAAE,QADK;AAEX,IAAA,OAAO,EAAE,QAAQ,CAAC,SAAD;AAFN,GAbgC;AAiB7C,EAAA,aAAa,EAAE;AACb,IAAA,IAAI,EAAE,QADO;AAEb,IAAA,OAAO,EAAE,QAAQ,CAAC,SAAD;AAFJ;AAjB8B,CAAxC;AAyBP,MAAM,qCAAqC,GAAG,MAAM,EAApD;AAEA,OAAM,SAAU,kBAAV,CAA6B,KAA7B,EAAyD;AAC7D,QAAM;AAAE,IAAA,KAAK,EAAE;AAAT,MAA0B,QAAQ,CACtC,QAAQ,CAAC,MAAO,KAAK,CAAC,YAAN,GAAqB,KAAK,CAAC,YAA3B,GAA0C,EAAlD,CAD8B,EAEtC,KAAK,CAAC,KAAD,EAAQ,uBAAR,CAFiC,CAAxC;AAKA,QAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,YAAY,CAAC,KAAd,CAAZ,CAA/B;;AAEA,WAAS,kBAAT,CAA4B,GAA5B,EAA0C;AACxC,QAAI,GAAG,CAAC,YAAJ,IAAoB,KAAK,CAAC,YAA9B,EAA4C;AAC1C,YAAM,GAAG,GAAG,cAAc,CAAC,KAA3B;AACA,MAAA,GAAG,CAAC,GAAJ,CAAQ,GAAG,CAAC,EAAZ,IAAkB,KAAK,CAAC,aAAN,CAAoB,GAApB,CAAlB,GAA6C,KAAK,CAAC,WAAN,CAAkB,GAAlB,CAA7C;AACA,MAAA,YAAY,CAAC,KAAb,GAAqB,eAAe,CAAC,GAAD,EAAM,YAAY,CAAC,KAAnB,CAApC;AACD;AACF;;AAED,QAAM,KAAK,GAA4B;AACrC,IAAA,YAAY,EAAE,KAAK,CAAC,KAAD,EAAQ,cAAR,CADkB;AAErC,IAAA,cAFqC;AAGrC,IAAA;AAHqC,GAAvC;AAMA,EAAA,OAAO,CAAC,qCAAD,EAAwC,KAAxC,CAAP;AAEA,SAAO,KAAP;AACD;;AAQD,SAAS,8BAAT,GAAuC;AACrC,SAAO;AACL,IAAA,YAAY,EAAE,UAAU,CAAC,KAAD,CADnB;AAEL,IAAA,cAAc,EAAE,QAAQ,CAAC,MAAM,IAAI,GAAJ,EAAP,CAFnB;AAGL,IAAA,kBAAkB,EAAE;AAHf,GAAP;AAKD;;AAED,OAAM,SAAU,0BAAV,GAAoC;AACxC,SAAO,MAAM,CAAC,qCAAD,EAAwC,8BAAxC,EAAwE,IAAxE,CAAb;AACD","sourcesContent":["import { constant, constVoid, FunctionN } from 'fp-ts/lib/function';\nimport { computed, ExtractPropTypes, PropType, toRef, provide, inject, ComputedRef, Ref, shallowRef } from 'vue';\nimport { useProxy } from '../../../composables/proxy/useProxy';\nimport { constEmptyArray } from '../../../utils/helpers';\nimport { BTableRow, toggleBTableRow } from '../shared';\nimport { toSet } from './shared';\n\nexport const BTableSelectablePropsDefinition = {\n isSelectable: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n selectedRows: {\n type: Array as PropType<BTableRow[]>,\n default: constEmptyArray\n },\n 'onUpdate:selectedRows': {\n type: Function as PropType<FunctionN<[BTableRow[]], void>>,\n default: constant(constVoid)\n },\n onSelectRow: {\n type: Function as PropType<FunctionN<[BTableRow], void>>,\n default: constant(constVoid)\n },\n onUnselectRow: {\n type: Function as PropType<FunctionN<[BTableRow], void>>,\n default: constant(constVoid)\n }\n};\n\nexport interface BTableSelectableProps extends ExtractPropTypes<typeof BTableSelectablePropsDefinition> {}\n\nconst USE_SELECTABLE_TABLE_INJECTION_SYMBOL = Symbol();\n\nexport function useSelectableTable(props: BTableSelectableProps) {\n const { value: selectedRows } = useProxy<BTableRow[]>(\n computed(() => (props.isSelectable ? props.selectedRows : [])),\n toRef(props, 'onUpdate:selectedRows')\n );\n\n const selectedRowIds = computed(() => toSet(selectedRows.value));\n\n function toggleRowSelection(row: BTableRow) {\n if (row.isSelectable ?? props.isSelectable) {\n const ids = selectedRowIds.value;\n ids.has(row.id) ? props.onUnselectRow(row) : props.onSelectRow(row);\n selectedRows.value = toggleBTableRow(row, selectedRows.value);\n }\n }\n\n const state: UseSelectableTableState = {\n isSelectable: toRef(props, 'isSelectable'),\n selectedRowIds,\n toggleRowSelection\n };\n\n provide(USE_SELECTABLE_TABLE_INJECTION_SYMBOL, state);\n\n return state;\n}\n\nexport interface UseSelectableTableState {\n isSelectable: Ref<boolean>;\n selectedRowIds: ComputedRef<Set<unknown>>;\n toggleRowSelection: FunctionN<[BTableRow], void>;\n}\n\nfunction useDefaultSelectableTableState(): UseSelectableTableState {\n return {\n isSelectable: shallowRef(false),\n selectedRowIds: computed(() => new Set()),\n toggleRowSelection: constVoid\n };\n}\n\nexport function useInjectedSelectableTable(): UseSelectableTableState {\n return inject(USE_SELECTABLE_TABLE_INJECTION_SYMBOL, useDefaultSelectableTableState, true);\n}\n"],"sourceRoot":"","file":"useSelectableTable.js"}
|
||||
39
node_modules/buetify/lib/components/table/composables/useSortableTable.d.ts
generated
vendored
Executable file
39
node_modules/buetify/lib/components/table/composables/useSortableTable.d.ts
generated
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
import { ExtractPropTypes, Ref, ComputedRef } from 'vue';
|
||||
import { FunctionN } from 'fp-ts/lib/function';
|
||||
import { PropType } from 'vue';
|
||||
import { BTableColumn, BTableRow, SortType } from '../shared';
|
||||
export declare const BTableSortingPropsDefinition: {
|
||||
rows: {
|
||||
type: PropType<BTableRow[]>;
|
||||
required: true;
|
||||
};
|
||||
sortBy: {
|
||||
type: PropType<BTableColumn<BTableRow> | BTableColumn<BTableRow>[]>;
|
||||
};
|
||||
'onUpdate:sortBy': {
|
||||
type: PropType<FunctionN<[BTableColumn<BTableRow> | BTableColumn<BTableRow>[]], void>>;
|
||||
};
|
||||
sortType: {
|
||||
type: PropType<SortType>;
|
||||
default: "Descending";
|
||||
};
|
||||
'onUpdate:sortType': {
|
||||
type: PropType<FunctionN<[SortType], void>>;
|
||||
};
|
||||
};
|
||||
export interface BTableSortingProps extends ExtractPropTypes<typeof BTableSortingPropsDefinition> {
|
||||
}
|
||||
export interface UseSortableTable {
|
||||
sortBy: Ref<BTableColumn[]>;
|
||||
sortType: Ref<SortType>;
|
||||
isMultiple: ComputedRef<boolean>;
|
||||
sortByMap: ComputedRef<Map<string, BTableColumn & {
|
||||
sortIndex: number;
|
||||
}>>;
|
||||
updateSortColumn: FunctionN<[string], void>;
|
||||
updateSortDirection: (columnLabel?: string) => void;
|
||||
sortableColumns: ComputedRef<BTableColumn[]>;
|
||||
hasSortableColumns: ComputedRef<boolean>;
|
||||
}
|
||||
export declare function useSortableTable(props: BTableSortingProps, rows: Ref<BTableRow[]>, columns: Ref<BTableColumn[]>): UseSortableTable;
|
||||
export declare function useInjectedSortableTable(): UseSortableTable;
|
||||
181
node_modules/buetify/lib/components/table/composables/useSortableTable.js
generated
vendored
Executable file
181
node_modules/buetify/lib/components/table/composables/useSortableTable.js
generated
vendored
Executable file
@@ -0,0 +1,181 @@
|
||||
import { findFirst, isEmpty, isNonEmpty, reverse, snoc, sortBy as sortBy_ } from 'fp-ts/lib/Array';
|
||||
import { fromCompare } from 'fp-ts/lib/Ord';
|
||||
import { alt, isNone, isSome, none } from 'fp-ts/Option';
|
||||
import { toRef, computed, watch, shallowRef, provide, inject } from 'vue';
|
||||
import { constFalse, constVoid, pipe } from 'fp-ts/lib/function';
|
||||
import { useProxy } from '../../../composables/proxy/useProxy';
|
||||
import { constEmptyArray, isBoolean } from '../../../utils/helpers';
|
||||
import { toggleBTableColumn } from '../shared';
|
||||
export const BTableSortingPropsDefinition = {
|
||||
rows: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
sortBy: {
|
||||
type: [Object, Array]
|
||||
},
|
||||
'onUpdate:sortBy': {
|
||||
type: Function
|
||||
},
|
||||
sortType: {
|
||||
type: String,
|
||||
default: 'Descending'
|
||||
},
|
||||
'onUpdate:sortType': {
|
||||
type: Function
|
||||
}
|
||||
};
|
||||
|
||||
function useSortType(sortType, columnSortType, invert) {
|
||||
if (invert) {
|
||||
return (columnSortType ?? sortType) === 'Ascending' ? 'Descending' : 'Ascending';
|
||||
} else {
|
||||
return columnSortType ?? sortType;
|
||||
}
|
||||
}
|
||||
|
||||
function useSortColumn(sortType, column, invert) {
|
||||
return { ...column,
|
||||
sort: isBoolean(column.sort) ? column.sort : column.sort === undefined ? undefined : { ...column.sort,
|
||||
sortType: useSortType(sortType, column.sort?.sortType, invert)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const USE_SORTABLE_TABLE_INJECTION_SYMBOL = Symbol();
|
||||
|
||||
function toMap(columns) {
|
||||
return new Map(columns.map((c, sortIndex) => [c.label, { ...c,
|
||||
sortIndex
|
||||
}]));
|
||||
}
|
||||
|
||||
export function useSortableTable(props, rows, columns) {
|
||||
const initialSortType = props.sortType;
|
||||
const {
|
||||
value: sortType
|
||||
} = useProxy(toRef(props, 'sortType'), toRef(props, 'onUpdate:sortType'));
|
||||
/*
|
||||
fp-ts sorts in ascending order so we need to reverse the ords if the initial sort type is 'Descending'
|
||||
Future sortType changes just reverse the array so we don't need to readjust the ords
|
||||
*/
|
||||
|
||||
const isMultiple = computed(() => Array.isArray(props.sortBy));
|
||||
const internalSortBy = shallowRef(Array.isArray(props.sortBy) ? props.sortBy : props.sortBy ? [props.sortBy] : []);
|
||||
watch(() => props.sortBy, newVal => {
|
||||
internalSortBy.value = Array.isArray(newVal) ? newVal : newVal ? [newVal] : [];
|
||||
});
|
||||
const sortBy = computed({
|
||||
get() {
|
||||
return internalSortBy.value;
|
||||
},
|
||||
|
||||
set(columns) {
|
||||
internalSortBy.value = columns;
|
||||
|
||||
if (!props['onUpdate:sortBy']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(props.sortBy)) {
|
||||
props['onUpdate:sortBy'](columns);
|
||||
} else if (isNonEmpty(columns)) {
|
||||
props['onUpdate:sortBy'](columns[0]);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
const sortByMap = computed(() => toMap(sortBy.value));
|
||||
const ords = computed(() => {
|
||||
const ords = [];
|
||||
sortBy.value.forEach(c => {
|
||||
const sort = c.sort;
|
||||
|
||||
if (sort && !isBoolean(sort)) {
|
||||
ords.push(sort.sortType === 'Ascending' || sort.sortType === undefined && initialSortType === 'Ascending' ? sort.ord : fromCompare((x, y) => {
|
||||
return sort.ord.compare(x, y) * -1;
|
||||
}));
|
||||
}
|
||||
});
|
||||
return ords;
|
||||
});
|
||||
|
||||
function sort() {
|
||||
if (!isEmpty(ords.value) && !isEmpty(rows.value)) {
|
||||
rows.value = sortBy_(ords.value)(rows.value);
|
||||
}
|
||||
}
|
||||
|
||||
watch(sortType, () => {
|
||||
if (Array.isArray(sortBy.value) && sortBy.value.length > 1) {
|
||||
sort();
|
||||
} else {
|
||||
rows.value = reverse(rows.value);
|
||||
}
|
||||
});
|
||||
watch(() => [props.rows, sortBy.value], sort, {
|
||||
immediate: true
|
||||
});
|
||||
const sortableColumns = computed(() => columns.value.filter(column => !!column.sort));
|
||||
|
||||
function updateSortColumn(label) {
|
||||
const column = pipe(sortBy.value, findFirst(c => c.label === label), alt(() => pipe(sortableColumns.value, findFirst(c => c.label === label))));
|
||||
if (isNone(column)) return;
|
||||
|
||||
if (isMultiple.value) {
|
||||
sortBy.value = toggleBTableColumn(useSortColumn(sortType.value, column.value, false), sortBy.value);
|
||||
} else {
|
||||
sortBy.value = [column.value];
|
||||
}
|
||||
}
|
||||
|
||||
function updateSortDirection(columnLabel) {
|
||||
const column = columnLabel ? pipe(sortBy.value, findFirst(c => c.label === columnLabel), alt(() => pipe(sortableColumns.value, findFirst(c => c.label === columnLabel)))) : none;
|
||||
|
||||
if (isMultiple.value && columnLabel && isSome(column)) {
|
||||
const index = sortBy.value.findIndex(c => c.label === columnLabel);
|
||||
const newColumn = useSortColumn(sortType.value, column.value, true);
|
||||
|
||||
if (index > -1) {
|
||||
const newVal = sortBy.value.slice();
|
||||
newVal.splice(index, 1, newColumn);
|
||||
sortBy.value = newVal;
|
||||
} else {
|
||||
sortBy.value = snoc(sortBy.value, newColumn);
|
||||
}
|
||||
} else {
|
||||
sortType.value = sortType.value === 'Ascending' ? 'Descending' : 'Ascending';
|
||||
}
|
||||
}
|
||||
|
||||
const sortableTable = {
|
||||
sortBy,
|
||||
sortType,
|
||||
isMultiple,
|
||||
sortByMap,
|
||||
updateSortDirection,
|
||||
updateSortColumn,
|
||||
sortableColumns,
|
||||
hasSortableColumns: computed(() => isNonEmpty(sortableColumns.value))
|
||||
};
|
||||
provide(USE_SORTABLE_TABLE_INJECTION_SYMBOL, sortableTable);
|
||||
return sortableTable;
|
||||
}
|
||||
|
||||
function useDefaultSortableTable() {
|
||||
return {
|
||||
sortBy: shallowRef([]),
|
||||
sortType: shallowRef('Ascending'),
|
||||
updateSortColumn: constVoid,
|
||||
updateSortDirection: constVoid,
|
||||
sortableColumns: computed(constEmptyArray),
|
||||
hasSortableColumns: computed(constFalse),
|
||||
isMultiple: computed(constFalse),
|
||||
sortByMap: computed(() => new Map())
|
||||
};
|
||||
}
|
||||
|
||||
export function useInjectedSortableTable() {
|
||||
return inject(USE_SORTABLE_TABLE_INJECTION_SYMBOL, useDefaultSortableTable, true);
|
||||
}
|
||||
//# sourceMappingURL=useSortableTable.js.map
|
||||
1
node_modules/buetify/lib/components/table/composables/useSortableTable.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/composables/useSortableTable.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
5
node_modules/buetify/lib/components/table/index.d.ts
generated
vendored
Executable file
5
node_modules/buetify/lib/components/table/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import BTable from './BTable';
|
||||
import BSimpleTable from './BSimpleTable';
|
||||
import BStyledTable from './BStyledTable';
|
||||
import BTableColumn from './BTableColumn';
|
||||
export { BTable, BTableColumn, BSimpleTable, BStyledTable };
|
||||
6
node_modules/buetify/lib/components/table/index.js
generated
vendored
Executable file
6
node_modules/buetify/lib/components/table/index.js
generated
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
import BTable from './BTable';
|
||||
import BSimpleTable from './BSimpleTable';
|
||||
import BStyledTable from './BStyledTable';
|
||||
import BTableColumn from './BTableColumn';
|
||||
export { BTable, BTableColumn, BSimpleTable, BStyledTable };
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/buetify/lib/components/table/index.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/index.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAP,MAAmB,UAAnB;AACA,OAAO,YAAP,MAAyB,gBAAzB;AACA,OAAO,YAAP,MAAyB,gBAAzB;AACA,OAAO,YAAP,MAAyB,gBAAzB;AAEA,SAAS,MAAT,EAAiB,YAAjB,EAA+B,YAA/B,EAA6C,YAA7C","sourcesContent":["import BTable from './BTable';\nimport BSimpleTable from './BSimpleTable';\nimport BStyledTable from './BStyledTable';\nimport BTableColumn from './BTableColumn';\n\nexport { BTable, BTableColumn, BSimpleTable, BStyledTable };\n"],"sourceRoot":"","file":"index.js"}
|
||||
36
node_modules/buetify/lib/components/table/shared.d.ts
generated
vendored
Executable file
36
node_modules/buetify/lib/components/table/shared.d.ts
generated
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
import { FunctionN } from 'fp-ts/function';
|
||||
import { Eq } from 'fp-ts/lib/Eq';
|
||||
import { Ord } from 'fp-ts/lib/Ord';
|
||||
import { Classes } from '../../utils/mergeClasses';
|
||||
export interface BTableRow {
|
||||
id: unknown;
|
||||
isDroppable?: boolean;
|
||||
isDraggable?: boolean;
|
||||
isSelectable?: boolean;
|
||||
isCheckable?: boolean;
|
||||
classes?: Classes;
|
||||
}
|
||||
export declare type SortType = 'Ascending' | 'Descending';
|
||||
export declare type BTableColumnPosition = 'is-left' | 'is-centered' | 'is-right';
|
||||
export interface BTableColumnSort<T = BTableRow> {
|
||||
ord: Ord<T>;
|
||||
sortType?: SortType;
|
||||
}
|
||||
export interface BTableColumn<T = BTableRow> {
|
||||
label: string;
|
||||
detail?: string;
|
||||
slotName?: string;
|
||||
value?: keyof T | FunctionN<[T], unknown>;
|
||||
asHtml?: boolean;
|
||||
sort?: boolean | BTableColumnSort<T>;
|
||||
meta?: unknown;
|
||||
isVisible?: boolean;
|
||||
position?: BTableColumnPosition;
|
||||
width?: string | number;
|
||||
classes?: Classes;
|
||||
isSticky?: boolean;
|
||||
}
|
||||
export declare const eqBTableRowData: Eq<BTableRow>;
|
||||
export declare const eqBTableColumn: Eq<BTableColumn>;
|
||||
export declare const toggleBTableRow: (a: BTableRow, as: BTableRow[]) => BTableRow[];
|
||||
export declare const toggleBTableColumn: (a: BTableColumn<BTableRow>, as: BTableColumn<BTableRow>[]) => BTableColumn<BTableRow>[];
|
||||
7
node_modules/buetify/lib/components/table/shared.js
generated
vendored
Executable file
7
node_modules/buetify/lib/components/table/shared.js
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
import { contramap, eqStrict, eqString } from 'fp-ts/lib/Eq';
|
||||
import { toggleListItem } from '../../utils/helpers';
|
||||
export const eqBTableRowData = contramap(row => row.id)(eqStrict);
|
||||
export const eqBTableColumn = contramap(column => column.label)(eqString);
|
||||
export const toggleBTableRow = toggleListItem(eqBTableRowData);
|
||||
export const toggleBTableColumn = toggleListItem(eqBTableColumn);
|
||||
//# sourceMappingURL=shared.js.map
|
||||
1
node_modules/buetify/lib/components/table/shared.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/components/table/shared.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/table/shared.ts"],"names":[],"mappings":"AACA,SAAS,SAAT,EAAwB,QAAxB,EAAkC,QAAlC,QAAkD,cAAlD;AAEA,SAAS,cAAT,QAA+B,qBAA/B;AAmCA,OAAO,MAAM,eAAe,GAAkB,SAAS,CAAqB,GAAG,IAAI,GAAG,CAAC,EAAhC,CAAT,CAA6C,QAA7C,CAAvC;AAEP,OAAO,MAAM,cAAc,GAAqB,SAAS,CAAuB,MAAM,IAAI,MAAM,CAAC,KAAxC,CAAT,CAAwD,QAAxD,CAAzC;AAEP,OAAO,MAAM,eAAe,GAAG,cAAc,CAAC,eAAD,CAAtC;AAEP,OAAO,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAD,CAAzC","sourcesContent":["import { FunctionN } from 'fp-ts/function';\nimport { contramap, Eq, eqStrict, eqString } from 'fp-ts/lib/Eq';\nimport { Ord } from 'fp-ts/lib/Ord';\nimport { toggleListItem } from '../../utils/helpers';\nimport { Classes } from '../../utils/mergeClasses';\n\nexport interface BTableRow {\n id: unknown;\n isDroppable?: boolean;\n isDraggable?: boolean;\n isSelectable?: boolean;\n isCheckable?: boolean;\n classes?: Classes;\n}\n\nexport type SortType = 'Ascending' | 'Descending';\n\nexport type BTableColumnPosition = 'is-left' | 'is-centered' | 'is-right';\n\nexport interface BTableColumnSort<T = BTableRow> {\n ord: Ord<T>;\n sortType?: SortType;\n}\nexport interface BTableColumn<T = BTableRow> {\n label: string;\n detail?: string;\n slotName?: string;\n value?: keyof T | FunctionN<[T], unknown>;\n asHtml?: boolean;\n sort?: boolean | BTableColumnSort<T>;\n meta?: unknown;\n isVisible?: boolean;\n position?: BTableColumnPosition;\n width?: string | number;\n classes?: Classes;\n isSticky?: boolean;\n}\n\nexport const eqBTableRowData: Eq<BTableRow> = contramap<unknown, BTableRow>(row => row.id)(eqStrict);\n\nexport const eqBTableColumn: Eq<BTableColumn> = contramap<string, BTableColumn>(column => column.label)(eqString);\n\nexport const toggleBTableRow = toggleListItem(eqBTableRowData);\n\nexport const toggleBTableColumn = toggleListItem(eqBTableColumn);\n"],"sourceRoot":"","file":"shared.js"}
|
||||
Reference in New Issue
Block a user