@vuetify/nightly 3.1.2-next-20230113.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -2
- package/dist/json/importMap.json +56 -56
- package/dist/vuetify-labs.css +178 -177
- package/dist/vuetify-labs.d.ts +40 -3
- package/dist/vuetify-labs.esm.js +158 -90
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +158 -90
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +203 -202
- package/dist/vuetify.d.ts +56 -19
- package/dist/vuetify.esm.js +105 -74
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +105 -74
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +52 -52
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +1 -0
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.mjs +9 -3
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VCard/VCard.mjs +5 -2
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/index.d.ts +8 -2
- package/lib/components/VCombobox/VCombobox.mjs +2 -1
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +1 -0
- package/lib/components/VFileInput/VFileInput.sass +1 -0
- package/lib/components/VList/VListItem.css +1 -1
- package/lib/components/VList/VListItem.mjs +5 -1
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +1 -1
- package/lib/components/VList/index.d.ts +20 -1
- package/lib/components/VProgressLinear/VProgressLinear.mjs +13 -1
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VProgressLinear/index.d.ts +18 -0
- package/lib/components/VSelect/VSelect.mjs +1 -0
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.mjs +5 -1
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/index.d.ts +40 -3
- package/lib/composables/filter.mjs +3 -3
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/framework.mjs.map +1 -1
- package/lib/index.d.ts +16 -16
- package/lib/labs/VDataTable/VDataTable.mjs +4 -1
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableGroupHeaderRow.mjs +3 -3
- package/lib/labs/VDataTable/VDataTableGroupHeaderRow.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableRows.mjs +36 -8
- package/lib/labs/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +4 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/group.mjs +9 -4
- package/lib/labs/VDataTable/composables/group.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4430,7 +4430,10 @@ declare const VCard: vue.DefineComponent<{
|
|
|
4430
4430
|
};
|
|
4431
4431
|
prependAvatar: StringConstructor;
|
|
4432
4432
|
prependIcon: vue.PropType<IconValue>;
|
|
4433
|
-
ripple:
|
|
4433
|
+
ripple: {
|
|
4434
|
+
type: BooleanConstructor;
|
|
4435
|
+
default: boolean;
|
|
4436
|
+
};
|
|
4434
4437
|
subtitle: StringConstructor;
|
|
4435
4438
|
text: StringConstructor;
|
|
4436
4439
|
title: StringConstructor;
|
|
@@ -4491,7 +4494,10 @@ declare const VCard: vue.DefineComponent<{
|
|
|
4491
4494
|
};
|
|
4492
4495
|
prependAvatar: StringConstructor;
|
|
4493
4496
|
prependIcon: vue.PropType<IconValue>;
|
|
4494
|
-
ripple:
|
|
4497
|
+
ripple: {
|
|
4498
|
+
type: BooleanConstructor;
|
|
4499
|
+
default: boolean;
|
|
4500
|
+
};
|
|
4495
4501
|
subtitle: StringConstructor;
|
|
4496
4502
|
text: StringConstructor;
|
|
4497
4503
|
title: StringConstructor;
|
|
@@ -11734,6 +11740,7 @@ declare const VListItem: {
|
|
|
11734
11740
|
rounded: string | number | boolean;
|
|
11735
11741
|
density: Density;
|
|
11736
11742
|
variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
|
|
11743
|
+
ripple: boolean;
|
|
11737
11744
|
}> & Omit<Readonly<vue.ExtractPropTypes<Omit<{
|
|
11738
11745
|
color: StringConstructor;
|
|
11739
11746
|
variant: Omit<{
|
|
@@ -11790,6 +11797,10 @@ declare const VListItem: {
|
|
|
11790
11797
|
nav: BooleanConstructor;
|
|
11791
11798
|
prependAvatar: StringConstructor;
|
|
11792
11799
|
prependIcon: PropType<IconValue>;
|
|
11800
|
+
ripple: {
|
|
11801
|
+
type: BooleanConstructor;
|
|
11802
|
+
default: boolean;
|
|
11803
|
+
};
|
|
11793
11804
|
subtitle: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
11794
11805
|
title: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
11795
11806
|
value: null;
|
|
@@ -11797,7 +11808,7 @@ declare const VListItem: {
|
|
|
11797
11808
|
onClickOnce: PropType<EventProp<(...args: any[]) => any>>;
|
|
11798
11809
|
}, "$children" | "v-slots" | "v-slot:default" | "v-slot:prepend" | "v-slot:append" | "v-slot:title" | "v-slot:subtitle">>> & {
|
|
11799
11810
|
onClick?: ((e: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
11800
|
-
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "replace" | "link" | "exact" | "active" | "nav" | "disabled" | "tag" | "rounded" | "density" | "variant">;
|
|
11811
|
+
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "replace" | "link" | "exact" | "active" | "nav" | "disabled" | "tag" | "rounded" | "density" | "variant" | "ripple">;
|
|
11801
11812
|
$attrs: {
|
|
11802
11813
|
[x: string]: unknown;
|
|
11803
11814
|
};
|
|
@@ -11867,6 +11878,10 @@ declare const VListItem: {
|
|
|
11867
11878
|
nav: BooleanConstructor;
|
|
11868
11879
|
prependAvatar: StringConstructor;
|
|
11869
11880
|
prependIcon: PropType<IconValue>;
|
|
11881
|
+
ripple: {
|
|
11882
|
+
type: BooleanConstructor;
|
|
11883
|
+
default: boolean;
|
|
11884
|
+
};
|
|
11870
11885
|
subtitle: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
11871
11886
|
title: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
11872
11887
|
value: null;
|
|
@@ -11887,6 +11902,7 @@ declare const VListItem: {
|
|
|
11887
11902
|
rounded: string | number | boolean;
|
|
11888
11903
|
density: Density;
|
|
11889
11904
|
variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
|
|
11905
|
+
ripple: boolean;
|
|
11890
11906
|
}> & {
|
|
11891
11907
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
11892
11908
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -11963,6 +11979,10 @@ declare const VListItem: {
|
|
|
11963
11979
|
nav: BooleanConstructor;
|
|
11964
11980
|
prependAvatar: StringConstructor;
|
|
11965
11981
|
prependIcon: PropType<IconValue>;
|
|
11982
|
+
ripple: {
|
|
11983
|
+
type: BooleanConstructor;
|
|
11984
|
+
default: boolean;
|
|
11985
|
+
};
|
|
11966
11986
|
subtitle: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
11967
11987
|
title: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
11968
11988
|
value: null;
|
|
@@ -12030,6 +12050,10 @@ declare const VListItem: {
|
|
|
12030
12050
|
nav: BooleanConstructor;
|
|
12031
12051
|
prependAvatar: StringConstructor;
|
|
12032
12052
|
prependIcon: PropType<IconValue>;
|
|
12053
|
+
ripple: {
|
|
12054
|
+
type: BooleanConstructor;
|
|
12055
|
+
default: boolean;
|
|
12056
|
+
};
|
|
12033
12057
|
subtitle: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
12034
12058
|
title: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
12035
12059
|
value: null;
|
|
@@ -12050,6 +12074,7 @@ declare const VListItem: {
|
|
|
12050
12074
|
rounded: string | number | boolean;
|
|
12051
12075
|
density: Density;
|
|
12052
12076
|
variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
|
|
12077
|
+
ripple: boolean;
|
|
12053
12078
|
}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
12054
12079
|
$props: SlotsToProps<{
|
|
12055
12080
|
prepend: [ListItemSlot];
|
|
@@ -14678,6 +14703,11 @@ declare const VProgressLinear: vue.DefineComponent<{
|
|
|
14678
14703
|
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
14679
14704
|
default: undefined;
|
|
14680
14705
|
};
|
|
14706
|
+
location: {
|
|
14707
|
+
type: vue.PropType<Anchor | (Anchor & {})>;
|
|
14708
|
+
default: Anchor | (Anchor & {});
|
|
14709
|
+
};
|
|
14710
|
+
absolute: BooleanConstructor;
|
|
14681
14711
|
active: {
|
|
14682
14712
|
type: BooleanConstructor;
|
|
14683
14713
|
default: boolean;
|
|
@@ -14719,6 +14749,11 @@ declare const VProgressLinear: vue.DefineComponent<{
|
|
|
14719
14749
|
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
14720
14750
|
default: undefined;
|
|
14721
14751
|
};
|
|
14752
|
+
location: {
|
|
14753
|
+
type: vue.PropType<Anchor | (Anchor & {})>;
|
|
14754
|
+
default: Anchor | (Anchor & {});
|
|
14755
|
+
};
|
|
14756
|
+
absolute: BooleanConstructor;
|
|
14722
14757
|
active: {
|
|
14723
14758
|
type: BooleanConstructor;
|
|
14724
14759
|
default: boolean;
|
|
@@ -14753,6 +14788,8 @@ declare const VProgressLinear: vue.DefineComponent<{
|
|
|
14753
14788
|
}, {
|
|
14754
14789
|
reverse: boolean;
|
|
14755
14790
|
max: string | number;
|
|
14791
|
+
absolute: boolean;
|
|
14792
|
+
location: Anchor | (Anchor & {});
|
|
14756
14793
|
height: string | number;
|
|
14757
14794
|
active: boolean;
|
|
14758
14795
|
tag: string;
|
|
@@ -29,7 +29,7 @@ export function filterItems(items, query, options) {
|
|
|
29
29
|
const customFiltersLength = Object.keys((options == null ? void 0 : options.customKeyFilter) ?? {}).length;
|
|
30
30
|
if (!(items != null && items.length)) return array;
|
|
31
31
|
loop: for (let i = 0; i < items.length; i++) {
|
|
32
|
-
const item = items[i]
|
|
32
|
+
const item = items[i];
|
|
33
33
|
const customMatches = {};
|
|
34
34
|
const defaultMatches = {};
|
|
35
35
|
let match = -1;
|
|
@@ -69,7 +69,7 @@ export function filterItems(items, query, options) {
|
|
|
69
69
|
}
|
|
70
70
|
return array;
|
|
71
71
|
}
|
|
72
|
-
export function useFilter(props, items, query) {
|
|
72
|
+
export function useFilter(props, items, query, options) {
|
|
73
73
|
const strQuery = computed(() => typeof (query == null ? void 0 : query.value) !== 'string' && typeof (query == null ? void 0 : query.value) !== 'number' ? '' : String(query.value));
|
|
74
74
|
const filteredItems = ref([]);
|
|
75
75
|
const filteredMatches = ref(new Map());
|
|
@@ -80,7 +80,7 @@ export function useFilter(props, items, query) {
|
|
|
80
80
|
const results = filterItems(transformedItems, strQuery.value, {
|
|
81
81
|
customKeyFilter: props.customKeyFilter,
|
|
82
82
|
default: props.customFilter,
|
|
83
|
-
filterKeys: props.filterKeys,
|
|
83
|
+
filterKeys: unref(options == null ? void 0 : options.filterKeys) ?? props.filterKeys,
|
|
84
84
|
filterMode: props.filterMode,
|
|
85
85
|
noFilter: props.noFilter
|
|
86
86
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.mjs","names":["getPropertyFromItem","propsFactory","wrapInArray","computed","ref","unref","watchEffect","defaultFilter","value","query","item","toString","toLocaleLowerCase","indexOf","makeFilterProps","customFilter","Function","customKeyFilter","Object","filterKeys","Array","String","filterMode","type","default","noFilter","Boolean","filterItems","items","options","array","filter","keys","customFiltersLength","length","loop","i","raw","customMatches","defaultMatches","match","key","keyFilter","title","defaultMatchesLength","customMatchesLength","push","index","matches","useFilter","props","strQuery","filteredItems","filteredMatches","Map","transformedItems","results","forEach","set","getMatches","get"],"sources":["../../src/composables/filter.ts"],"sourcesContent":["/* eslint-disable max-statements */\n/* eslint-disable no-labels */\n\n// Utilities\nimport { getPropertyFromItem, propsFactory, wrapInArray } from '@/util'\nimport { computed, ref, unref, watchEffect } from 'vue'\n\n// Types\nimport type { PropType, Ref } from 'vue'\nimport type { MaybeRef } from '@/util'\nimport type { InternalItem } from './items'\n\n/**\n * - match without highlight\n * - single match (index), length already known\n * - single match (start, end)\n * - multiple matches (start, end), probably shouldn't overlap\n */\nexport type FilterMatch = boolean | number | [number, number] | [number, number][]\nexport type FilterFunction = (value: string, query: string, item?: any) => FilterMatch\nexport type FilterKeyFunctions = Record<string, FilterFunction>\nexport type FilterKeys = string | string[]\nexport type FilterMode = 'some' | 'every' | 'union' | 'intersection'\n\nexport interface FilterProps {\n customFilter?: FilterFunction\n customKeyFilter?: FilterKeyFunctions\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n}\n\n// Composables\nexport const defaultFilter: FilterFunction = (value, query, item) => {\n if (value == null || query == null) return -1\n\n return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase())\n}\n\nexport const makeFilterProps = propsFactory({\n customFilter: Function as PropType<FilterFunction>,\n customKeyFilter: Object as PropType<FilterKeyFunctions>,\n filterKeys: [Array, String] as PropType<FilterKeys>,\n filterMode: {\n type: String as PropType<FilterMode>,\n default: 'intersection',\n },\n noFilter: Boolean,\n}, 'filter')\n\nexport function filterItems (\n items: InternalItem[],\n query: string,\n options?: {\n customKeyFilter?: FilterKeyFunctions\n default?: FilterFunction\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n },\n) {\n const array: { index: number, matches: Record<string, FilterMatch> }[] = []\n // always ensure we fall back to a functioning filter\n const filter = options?.default ?? defaultFilter\n const keys = options?.filterKeys ? wrapInArray(options.filterKeys) : false\n const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length\n\n if (!items?.length) return array\n\n loop:\n for (let i = 0; i < items.length; i++) {\n const item = items[i].raw\n const customMatches: Record<string, FilterMatch> = {}\n const defaultMatches: Record<string, FilterMatch> = {}\n let match: FilterMatch = -1\n\n if (query && !options?.noFilter) {\n if (typeof item === 'object') {\n const filterKeys = keys || Object.keys(item)\n\n for (const key of filterKeys) {\n const value = getPropertyFromItem(item as any, key, item)\n const keyFilter = options?.customKeyFilter?.[key]\n\n match = keyFilter\n ? keyFilter(value, query, item)\n : filter(value, query, item)\n\n if (match !== -1 && match !== false) {\n if (keyFilter) customMatches[key] = match\n else defaultMatches[key] = match\n } else if (options?.filterMode === 'every') {\n continue loop\n }\n }\n } else {\n match = filter(item, query, item)\n if (match !== -1 && match !== false) {\n defaultMatches.title = match\n }\n }\n\n const defaultMatchesLength = Object.keys(defaultMatches).length\n const customMatchesLength = Object.keys(customMatches).length\n\n if (!defaultMatchesLength && !customMatchesLength) continue\n\n if (\n options?.filterMode === 'union' &&\n customMatchesLength !== customFiltersLength &&\n !defaultMatchesLength\n ) continue\n\n if (\n options?.filterMode === 'intersection' &&\n (\n customMatchesLength !== customFiltersLength ||\n !defaultMatchesLength\n )\n ) continue\n }\n\n array.push({ index: i, matches: { ...defaultMatches, ...customMatches } })\n }\n\n return array\n}\n\nexport function useFilter <T extends InternalItem> (\n props: FilterProps,\n items: MaybeRef<T[]>,\n query?: Ref<string | undefined>,\n) {\n const strQuery = computed(() => (\n typeof query?.value !== 'string' &&\n typeof query?.value !== 'number'\n ) ? '' : String(query.value))\n\n const filteredItems: Ref<T[]> = ref([])\n const filteredMatches: Ref<Map<unknown, Record<string, FilterMatch>>> = ref(new Map())\n\n watchEffect(() => {\n filteredItems.value = []\n filteredMatches.value = new Map()\n\n const transformedItems = unref(items)\n const results = filterItems(\n transformedItems,\n strQuery.value,\n {\n customKeyFilter: props.customKeyFilter,\n default: props.customFilter,\n filterKeys: props.filterKeys,\n filterMode: props.filterMode,\n noFilter: props.noFilter,\n },\n )\n\n results.forEach(({ index, matches }) => {\n const item = transformedItems[index]\n filteredItems.value.push(item)\n filteredMatches.value.set(item.value, matches)\n })\n })\n\n function getMatches (item: T) {\n return filteredMatches.value.get(item.value)\n }\n\n return { filteredItems, filteredMatches, getMatches }\n}\n"],"mappings":"AAAA;AACA;AAEA;AAAA,SACSA,mBAAmB,EAAEC,YAAY,EAAEC,WAAW;AACvD,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAEC,WAAW,QAAQ,KAAK;;AAEvD;;AAyBA;AACA,OAAO,MAAMC,aAA6B,GAAG,CAACC,KAAK,EAAEC,KAAK,EAAEC,IAAI,KAAK;EACnE,IAAIF,KAAK,IAAI,IAAI,IAAIC,KAAK,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;EAE7C,OAAOD,KAAK,CAACG,QAAQ,EAAE,CAACC,iBAAiB,EAAE,CAACC,OAAO,CAACJ,KAAK,CAACE,QAAQ,EAAE,CAACC,iBAAiB,EAAE,CAAC;AAC3F,CAAC;AAED,OAAO,MAAME,eAAe,GAAGb,YAAY,CAAC;EAC1Cc,YAAY,EAAEC,QAAoC;EAClDC,eAAe,EAAEC,MAAsC;EACvDC,UAAU,EAAE,CAACC,KAAK,EAAEC,MAAM,CAAyB;EACnDC,UAAU,EAAE;IACVC,IAAI,EAAEF,MAA8B;IACpCG,OAAO,EAAE;EACX,CAAC;EACDC,QAAQ,EAAEC;AACZ,CAAC,EAAE,QAAQ,CAAC;AAEZ,OAAO,SAASC,WAAW,CACzBC,KAAqB,EACrBnB,KAAa,EACboB,OAMC,EACD;EACA,MAAMC,KAAgE,GAAG,EAA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O,EAAE;IAC5B,OAAO2C,eAAe,CAAC7C,KAAK,CAACoD,GAAG,CAAClD,IAAI,CAACF,KAAK,CAAC;EAC9C;EAEA,OAAO;IAAE4C,aAAa;IAAEC,eAAe;IAAEM;EAAW,CAAC;AACvD"}
|
|
1
|
+
{"version":3,"file":"filter.mjs","names":["getPropertyFromItem","propsFactory","wrapInArray","computed","ref","unref","watchEffect","defaultFilter","value","query","item","toString","toLocaleLowerCase","indexOf","makeFilterProps","customFilter","Function","customKeyFilter","Object","filterKeys","Array","String","filterMode","type","default","noFilter","Boolean","filterItems","items","options","array","filter","keys","customFiltersLength","length","loop","i","customMatches","defaultMatches","match","key","keyFilter","title","defaultMatchesLength","customMatchesLength","push","index","matches","useFilter","props","strQuery","filteredItems","filteredMatches","Map","transformedItems","results","forEach","set","getMatches","get"],"sources":["../../src/composables/filter.ts"],"sourcesContent":["/* eslint-disable max-statements */\n/* eslint-disable no-labels */\n\n// Utilities\nimport { getPropertyFromItem, propsFactory, wrapInArray } from '@/util'\nimport { computed, ref, unref, watchEffect } from 'vue'\n\n// Types\nimport type { PropType, Ref } from 'vue'\nimport type { MaybeRef } from '@/util'\nimport type { InternalItem } from './items'\n\n/**\n * - match without highlight\n * - single match (index), length already known\n * - single match (start, end)\n * - multiple matches (start, end), probably shouldn't overlap\n */\nexport type FilterMatch = boolean | number | [number, number] | [number, number][]\nexport type FilterFunction = (value: string, query: string, item?: any) => FilterMatch\nexport type FilterKeyFunctions = Record<string, FilterFunction>\nexport type FilterKeys = string | string[]\nexport type FilterMode = 'some' | 'every' | 'union' | 'intersection'\n\nexport interface FilterProps {\n customFilter?: FilterFunction\n customKeyFilter?: FilterKeyFunctions\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n}\n\n// Composables\nexport const defaultFilter: FilterFunction = (value, query, item) => {\n if (value == null || query == null) return -1\n\n return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase())\n}\n\nexport const makeFilterProps = propsFactory({\n customFilter: Function as PropType<FilterFunction>,\n customKeyFilter: Object as PropType<FilterKeyFunctions>,\n filterKeys: [Array, String] as PropType<FilterKeys>,\n filterMode: {\n type: String as PropType<FilterMode>,\n default: 'intersection',\n },\n noFilter: Boolean,\n}, 'filter')\n\nexport function filterItems (\n items: InternalItem[],\n query: string,\n options?: {\n customKeyFilter?: FilterKeyFunctions\n default?: FilterFunction\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n },\n) {\n const array: { index: number, matches: Record<string, FilterMatch> }[] = []\n // always ensure we fall back to a functioning filter\n const filter = options?.default ?? defaultFilter\n const keys = options?.filterKeys ? wrapInArray(options.filterKeys) : false\n const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length\n\n if (!items?.length) return array\n\n loop:\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n const customMatches: Record<string, FilterMatch> = {}\n const defaultMatches: Record<string, FilterMatch> = {}\n let match: FilterMatch = -1\n\n if (query && !options?.noFilter) {\n if (typeof item === 'object') {\n const filterKeys = keys || Object.keys(item)\n\n for (const key of filterKeys) {\n const value = getPropertyFromItem(item as any, key, item)\n const keyFilter = options?.customKeyFilter?.[key]\n\n match = keyFilter\n ? keyFilter(value, query, item)\n : filter(value, query, item)\n\n if (match !== -1 && match !== false) {\n if (keyFilter) customMatches[key] = match\n else defaultMatches[key] = match\n } else if (options?.filterMode === 'every') {\n continue loop\n }\n }\n } else {\n match = filter(item, query, item)\n if (match !== -1 && match !== false) {\n defaultMatches.title = match\n }\n }\n\n const defaultMatchesLength = Object.keys(defaultMatches).length\n const customMatchesLength = Object.keys(customMatches).length\n\n if (!defaultMatchesLength && !customMatchesLength) continue\n\n if (\n options?.filterMode === 'union' &&\n customMatchesLength !== customFiltersLength &&\n !defaultMatchesLength\n ) continue\n\n if (\n options?.filterMode === 'intersection' &&\n (\n customMatchesLength !== customFiltersLength ||\n !defaultMatchesLength\n )\n ) continue\n }\n\n array.push({ index: i, matches: { ...defaultMatches, ...customMatches } })\n }\n\n return array\n}\n\nexport function useFilter <T extends InternalItem> (\n props: FilterProps,\n items: MaybeRef<T[]>,\n query: Ref<string | undefined>,\n options?: {\n filterKeys?: MaybeRef<FilterKeys>\n }\n) {\n const strQuery = computed(() => (\n typeof query?.value !== 'string' &&\n typeof query?.value !== 'number'\n ) ? '' : String(query.value))\n\n const filteredItems: Ref<T[]> = ref([])\n const filteredMatches: Ref<Map<unknown, Record<string, FilterMatch>>> = ref(new Map())\n\n watchEffect(() => {\n filteredItems.value = []\n filteredMatches.value = new Map()\n\n const transformedItems = unref(items)\n const results = filterItems(\n transformedItems,\n strQuery.value,\n {\n customKeyFilter: props.customKeyFilter,\n default: props.customFilter,\n filterKeys: unref(options?.filterKeys) ?? props.filterKeys,\n filterMode: props.filterMode,\n noFilter: props.noFilter,\n },\n )\n\n results.forEach(({ index, matches }) => {\n const item = transformedItems[index]\n filteredItems.value.push(item)\n filteredMatches.value.set(item.value, matches)\n })\n })\n\n function getMatches (item: T) {\n return filteredMatches.value.get(item.value)\n }\n\n return { filteredItems, filteredMatches, getMatches }\n}\n"],"mappings":"AAAA;AACA;AAEA;AAAA,SACSA,mBAAmB,EAAEC,YAAY,EAAEC,WAAW;AACvD,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAEC,WAAW,QAAQ,KAAK;;AAEvD;;AAyBA;AACA,OAAO,MAAMC,aAA6B,GAAG,CAACC,KAAK,EAAEC,KAAK,EAAEC,IAAI,KAAK;EACnE,IAAIF,KAAK,IAAI,IAAI,IAAIC,KAAK,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;EAE7C,OAAOD,KAAK,CAACG,QAAQ,EAAE,CAACC,iBAAiB,EAAE,CAACC,OAAO,CAACJ,KAAK,CAACE,QAAQ,EAAE,CAACC,iBAAiB,EAAE,CAAC;AAC3F,CAAC;AAED,OAAO,MAAME,eAAe,GAAGb,YAAY,CAAC;EAC1Cc,YAAY,EAAEC,QAAoC;EAClDC,eAAe,EAA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OAAO,CAACC,OAAO,CAAC,QAAwB;MAAA,IAAvB;QAAEV,KAAK;QAAEC;MAAQ,CAAC;MACjC,MAAMrC,IAAI,GAAG4C,gBAAgB,CAACR,KAAK,CAAC;MACpCK,aAAa,CAAC3C,KAAK,CAACqC,IAAI,CAACnC,IAAI,CAAC;MAC9B0C,eAAe,CAAC5C,KAAK,CAACiD,GAAG,CAAC/C,IAAI,CAACF,KAAK,EAAEuC,OAAO,CAAC;IAChD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,SAASW,UAAU,CAAEhD,IAAO,EAAE;IAC5B,OAAO0C,eAAe,CAAC5C,KAAK,CAACmD,GAAG,CAACjD,IAAI,CAACF,KAAK,CAAC;EAC9C;EAEA,OAAO;IAAE2C,aAAa;IAAEC,eAAe;IAAEM;EAAW,CAAC;AACvD"}
|
package/lib/entry-bundler.mjs
CHANGED
|
@@ -10,7 +10,7 @@ export const createVuetify = function () {
|
|
|
10
10
|
...options
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
-
export const version = "3.1.2
|
|
13
|
+
export const version = "3.1.2";
|
|
14
14
|
createVuetify.version = version;
|
|
15
15
|
export { components, directives };
|
|
16
16
|
export * from "./composables/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-bundler.mjs","names":["components","directives","createVuetify","_createVuetify","options","version"],"sources":["../src/entry-bundler.ts"],"sourcesContent":["import './styles/main.sass'\nimport * as components from './components'\nimport * as directives from './directives'\nimport { createVuetify as _createVuetify } from './framework'\nimport type { VuetifyOptions } from './framework'\n\nexport const createVuetify = (options: VuetifyOptions = {}) => {\n return _createVuetify({ components, directives, ...options })\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\nexport {\n components,\n directives,\n}\nexport * from './composables'\n"],"mappings":"AAAA;AAA2B,OACpB,KAAKA,UAAU;AAAA,OACf,KAAKC,UAAU;AAAA,SACbC,aAAa,IAAIC,cAAc;AAGxC,OAAO,MAAMD,aAAa,GAAG,YAAkC;EAAA,IAAjCE,OAAuB,uEAAG,CAAC,CAAC;EACxD,OAAOD,cAAc,CAAC;IAAEH,UAAU;IAAEC,UAAU;IAAE,GAAGG;EAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,OAAO,MAAMC,OAAO,
|
|
1
|
+
{"version":3,"file":"entry-bundler.mjs","names":["components","directives","createVuetify","_createVuetify","options","version"],"sources":["../src/entry-bundler.ts"],"sourcesContent":["import './styles/main.sass'\nimport * as components from './components'\nimport * as directives from './directives'\nimport { createVuetify as _createVuetify } from './framework'\nimport type { VuetifyOptions } from './framework'\n\nexport const createVuetify = (options: VuetifyOptions = {}) => {\n return _createVuetify({ components, directives, ...options })\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\nexport {\n components,\n directives,\n}\nexport * from './composables'\n"],"mappings":"AAAA;AAA2B,OACpB,KAAKA,UAAU;AAAA,OACf,KAAKC,UAAU;AAAA,SACbC,aAAa,IAAIC,cAAc;AAGxC,OAAO,MAAMD,aAAa,GAAG,YAAkC;EAAA,IAAjCE,OAAuB,uEAAG,CAAC,CAAC;EACxD,OAAOD,cAAc,CAAC;IAAEH,UAAU;IAAEC,UAAU;IAAE,GAAGG;EAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,OAAO,MAAMC,OAAO,UAAsB;AAC1CH,aAAa,CAACG,OAAO,GAAGA,OAAO;AAE/B,SACEL,UAAU,EACVC,UAAU;AACX"}
|
package/lib/framework.mjs
CHANGED
package/lib/framework.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.mjs","names":["createDefaults","DefaultsSymbol","createDisplay","DisplaySymbol","createIcons","IconSymbol","createLocale","LocaleSymbol","createTheme","ThemeSymbol","defineComponent","getUid","IN_BROWSER","mergeDeep","nextTick","reactive","createVuetify","vuetify","blueprint","rest","options","aliases","components","directives","defaults","display","ssr","theme","icons","locale","install","app","key","directive","component","name","aliasName","provide","$nuxt","hook","update","mount","vm","reset","__VUE_OPTIONS_API__","mixin","computed","$vuetify","inject","call","version","$","provides","parent","vnode","appContext"],"sources":["../src/framework.ts"],"sourcesContent":["// Composables\nimport { createDefaults, DefaultsSymbol } from '@/composables/defaults'\nimport { createDisplay, DisplaySymbol } from '@/composables/display'\nimport { createIcons, IconSymbol } from '@/composables/icons'\nimport { createLocale, LocaleSymbol } from '@/composables/locale'\nimport { createTheme, ThemeSymbol } from '@/composables/theme'\n\n// Utilities\nimport { defineComponent, getUid, IN_BROWSER, mergeDeep } from '@/util'\nimport { nextTick, reactive } from 'vue'\n\n// Types\nimport type { App, ComponentPublicInstance, InjectionKey } from 'vue'\nimport type { DefaultsOptions } from '@/composables/defaults'\nimport type { DisplayOptions } from '@/composables/display'\nimport type { IconOptions } from '@/composables/icons'\nimport type { LocaleOptions, RtlOptions } from '@/composables/locale'\nimport type { ThemeOptions } from '@/composables/theme'\n\nexport * from './composables'\n\nexport interface VuetifyOptions {\n aliases?: Record<string, any>\n blueprint?: Blueprint\n components?: Record<string, any>\n directives?: Record<string, any>\n defaults?: DefaultsOptions\n display?: DisplayOptions\n theme?: ThemeOptions\n icons?: IconOptions\n locale?: LocaleOptions & RtlOptions\n ssr?: boolean\n}\n\nexport interface Blueprint extends Omit<VuetifyOptions, 'blueprint'> {}\n\nexport function createVuetify (vuetify: VuetifyOptions = {}) {\n const { blueprint, ...rest } = vuetify\n const options = mergeDeep(blueprint, rest)\n const {\n aliases = {},\n components = {},\n directives = {},\n } = options\n\n const defaults = createDefaults(options.defaults)\n const display = createDisplay(options.display, options.ssr)\n const theme = createTheme(options.theme)\n const icons = createIcons(options.icons)\n const locale = createLocale(options.locale)\n\n const install = (app: App) => {\n for (const key in directives) {\n app.directive(key, directives[key])\n }\n\n for (const key in components) {\n app.component(key, components[key])\n }\n\n for (const key in aliases) {\n app.component(key, defineComponent({\n ...aliases[key],\n name: key,\n aliasName: aliases[key].name,\n }))\n }\n\n theme.install(app)\n\n app.provide(DefaultsSymbol, defaults)\n app.provide(DisplaySymbol, display)\n app.provide(ThemeSymbol, theme)\n app.provide(IconSymbol, icons)\n app.provide(LocaleSymbol, locale)\n\n if (IN_BROWSER && options.ssr) {\n if (app.$nuxt) {\n app.$nuxt.hook('app:suspense:resolve', () => {\n display.update()\n })\n } else {\n const { mount } = app\n app.mount = (...args) => {\n const vm = mount(...args)\n nextTick(() => display.update())\n app.mount = mount\n return vm\n }\n }\n }\n\n getUid.reset()\n\n if (typeof __VUE_OPTIONS_API__ !== 'boolean' || __VUE_OPTIONS_API__) {\n app.mixin({\n computed: {\n $vuetify () {\n return reactive({\n defaults: inject.call(this, DefaultsSymbol),\n display: inject.call(this, DisplaySymbol),\n theme: inject.call(this, ThemeSymbol),\n icons: inject.call(this, IconSymbol),\n locale: inject.call(this, LocaleSymbol),\n })\n },\n },\n })\n }\n }\n\n return {\n install,\n defaults,\n display,\n theme,\n icons,\n locale,\n }\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\n// Vue's inject() can only be used in setup\nfunction inject (this: ComponentPublicInstance, key: InjectionKey<any> | string) {\n const vm = this.$\n\n const provides = vm.parent?.provides ?? vm.vnode.appContext?.provides\n\n if (provides && (key as any) in provides) {\n return provides[(key as string)]\n }\n}\n"],"mappings":"AAAA;AAAA,SACSA,cAAc,EAAEC,cAAc;AAAA,SAC9BC,aAAa,EAAEC,aAAa;AAAA,SAC5BC,WAAW,EAAEC,UAAU;AAAA,SACvBC,YAAY,EAAEC,YAAY;AAAA,SAC1BC,WAAW,EAAEC,WAAW,mCAEjC;AAAA,SACSC,eAAe,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS;AACvD,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;;AAExC;AAAA;AAyBA,OAAO,SAASC,aAAa,GAAgC;EAAA,IAA9BC,OAAuB,uEAAG,CAAC,CAAC;EACzD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAK,CAAC,GAAGF,OAAO;EACtC,M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,CAAC,CAAC;UACJ;QACF;MACF,CAAC,CAAC;IACJ;EACF,CAAC;EAED,OAAO;IACLuB,OAAO;IACPN,QAAQ;IACRC,OAAO;IACPE,KAAK;IACLC,KAAK;IACLC;EACF,CAAC;AACH;AAEA,OAAO,MAAMqB,OAAO,
|
|
1
|
+
{"version":3,"file":"framework.mjs","names":["createDefaults","DefaultsSymbol","createDisplay","DisplaySymbol","createIcons","IconSymbol","createLocale","LocaleSymbol","createTheme","ThemeSymbol","defineComponent","getUid","IN_BROWSER","mergeDeep","nextTick","reactive","createVuetify","vuetify","blueprint","rest","options","aliases","components","directives","defaults","display","ssr","theme","icons","locale","install","app","key","directive","component","name","aliasName","provide","$nuxt","hook","update","mount","vm","reset","__VUE_OPTIONS_API__","mixin","computed","$vuetify","inject","call","version","$","provides","parent","vnode","appContext"],"sources":["../src/framework.ts"],"sourcesContent":["// Composables\nimport { createDefaults, DefaultsSymbol } from '@/composables/defaults'\nimport { createDisplay, DisplaySymbol } from '@/composables/display'\nimport { createIcons, IconSymbol } from '@/composables/icons'\nimport { createLocale, LocaleSymbol } from '@/composables/locale'\nimport { createTheme, ThemeSymbol } from '@/composables/theme'\n\n// Utilities\nimport { defineComponent, getUid, IN_BROWSER, mergeDeep } from '@/util'\nimport { nextTick, reactive } from 'vue'\n\n// Types\nimport type { App, ComponentPublicInstance, InjectionKey } from 'vue'\nimport type { DefaultsOptions } from '@/composables/defaults'\nimport type { DisplayOptions } from '@/composables/display'\nimport type { IconOptions } from '@/composables/icons'\nimport type { LocaleOptions, RtlOptions } from '@/composables/locale'\nimport type { ThemeOptions } from '@/composables/theme'\n\nexport * from './composables'\n\nexport interface VuetifyOptions {\n aliases?: Record<string, any>\n blueprint?: Blueprint\n components?: Record<string, any>\n directives?: Record<string, any>\n defaults?: DefaultsOptions\n display?: DisplayOptions\n theme?: ThemeOptions\n icons?: IconOptions\n locale?: LocaleOptions & RtlOptions\n ssr?: boolean\n}\n\nexport interface Blueprint extends Omit<VuetifyOptions, 'blueprint'> {}\n\nexport function createVuetify (vuetify: VuetifyOptions = {}) {\n const { blueprint, ...rest } = vuetify\n const options = mergeDeep(blueprint, rest)\n const {\n aliases = {},\n components = {},\n directives = {},\n } = options\n\n const defaults = createDefaults(options.defaults)\n const display = createDisplay(options.display, options.ssr)\n const theme = createTheme(options.theme)\n const icons = createIcons(options.icons)\n const locale = createLocale(options.locale)\n\n const install = (app: App) => {\n for (const key in directives) {\n app.directive(key, directives[key])\n }\n\n for (const key in components) {\n app.component(key, components[key])\n }\n\n for (const key in aliases) {\n app.component(key, defineComponent({\n ...aliases[key],\n name: key,\n aliasName: aliases[key].name,\n }))\n }\n\n theme.install(app)\n\n app.provide(DefaultsSymbol, defaults)\n app.provide(DisplaySymbol, display)\n app.provide(ThemeSymbol, theme)\n app.provide(IconSymbol, icons)\n app.provide(LocaleSymbol, locale)\n\n if (IN_BROWSER && options.ssr) {\n if (app.$nuxt) {\n app.$nuxt.hook('app:suspense:resolve', () => {\n display.update()\n })\n } else {\n const { mount } = app\n app.mount = (...args) => {\n const vm = mount(...args)\n nextTick(() => display.update())\n app.mount = mount\n return vm\n }\n }\n }\n\n getUid.reset()\n\n if (typeof __VUE_OPTIONS_API__ !== 'boolean' || __VUE_OPTIONS_API__) {\n app.mixin({\n computed: {\n $vuetify () {\n return reactive({\n defaults: inject.call(this, DefaultsSymbol),\n display: inject.call(this, DisplaySymbol),\n theme: inject.call(this, ThemeSymbol),\n icons: inject.call(this, IconSymbol),\n locale: inject.call(this, LocaleSymbol),\n })\n },\n },\n })\n }\n }\n\n return {\n install,\n defaults,\n display,\n theme,\n icons,\n locale,\n }\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\n// Vue's inject() can only be used in setup\nfunction inject (this: ComponentPublicInstance, key: InjectionKey<any> | string) {\n const vm = this.$\n\n const provides = vm.parent?.provides ?? vm.vnode.appContext?.provides\n\n if (provides && (key as any) in provides) {\n return provides[(key as string)]\n }\n}\n"],"mappings":"AA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AK,CAAC;QACRC,QAAQ,EAAE;UACRC,QAAQ,GAAI;YACV,OAAOhC,QAAQ,CAAC;cACdS,QAAQ,EAAEwB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEhD,cAAc,CAAC;cAC3CwB,OAAO,EAAEuB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE9C,aAAa,CAAC;cACzCwB,KAAK,EAAEqB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAExC,WAAW,CAAC;cACrCmB,KAAK,EAAEoB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE5C,UAAU,CAAC;cACpCwB,MAAM,EAAEmB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE1C,YAAY;YACxC,CAAC,CAAC;UACJ;QACF;MACF,CAAC,CAAC;IACJ;EACF,CAAC;EAED,OAAO;IACLuB,OAAO;IACPN,QAAQ;IACRC,OAAO;IACPE,KAAK;IACLC,KAAK;IACLC;EACF,CAAC;AACH;AAEA,OAAO,MAAMqB,OAAO,UAAsB;AAC1ClC,aAAa,CAACkC,OAAO,GAAGA,OAAO;;AAE/B;AACA,SAASF,MAAM,CAAiChB,GAA+B,EAAE;EAAA;EAC/E,MAAMU,EAAE,GAAG,IAAI,CAACS,CAAC;EAEjB,MAAMC,QAAQ,GAAG,eAAAV,EAAE,CAACW,MAAM,qBAAT,WAAWD,QAAQ,8BAAIV,EAAE,CAACY,KAAK,CAACC,UAAU,qBAAnB,qBAAqBH,QAAQ;EAErE,IAAIA,QAAQ,IAAKpB,GAAG,IAAYoB,QAAQ,EAAE;IACxC,OAAOA,QAAQ,CAAEpB,GAAG,CAAY;EAClC;AACF"}
|
package/lib/index.d.ts
CHANGED
|
@@ -315,20 +315,20 @@ declare module '@vue/runtime-core' {
|
|
|
315
315
|
|
|
316
316
|
export interface GlobalComponents {
|
|
317
317
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
318
|
-
|
|
318
|
+
VHover: typeof import('vuetify/components')['VHover']
|
|
319
319
|
VContainer: typeof import('vuetify/components')['VContainer']
|
|
320
320
|
VCol: typeof import('vuetify/components')['VCol']
|
|
321
321
|
VRow: typeof import('vuetify/components')['VRow']
|
|
322
322
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
|
323
|
-
|
|
323
|
+
VForm: typeof import('vuetify/components')['VForm']
|
|
324
324
|
VLayout: typeof import('vuetify/components')['VLayout']
|
|
325
325
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
326
|
-
VLazy: typeof import('vuetify/components')['VLazy']
|
|
327
326
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
328
|
-
|
|
327
|
+
VLazy: typeof import('vuetify/components')['VLazy']
|
|
329
328
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
330
329
|
VRadio: typeof import('vuetify/components')['VRadio']
|
|
331
330
|
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
331
|
+
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
332
332
|
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
333
333
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
334
334
|
VValidation: typeof import('vuetify/components')['VValidation']
|
|
@@ -349,14 +349,11 @@ declare module '@vue/runtime-core' {
|
|
|
349
349
|
VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
|
|
350
350
|
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
|
351
351
|
VApp: typeof import('vuetify/components')['VApp']
|
|
352
|
-
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
353
|
-
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
354
|
-
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
355
352
|
VAlert: typeof import('vuetify/components')['VAlert']
|
|
356
353
|
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
357
354
|
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
358
|
-
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
359
355
|
VBadge: typeof import('vuetify/components')['VBadge']
|
|
356
|
+
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
360
357
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
361
358
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
362
359
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
@@ -377,12 +374,12 @@ declare module '@vue/runtime-core' {
|
|
|
377
374
|
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
378
375
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
379
376
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
380
|
-
VChip: typeof import('vuetify/components')['VChip']
|
|
381
377
|
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
378
|
+
VChip: typeof import('vuetify/components')['VChip']
|
|
382
379
|
VCode: typeof import('vuetify/components')['VCode']
|
|
383
380
|
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
384
|
-
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
385
381
|
VCounter: typeof import('vuetify/components')['VCounter']
|
|
382
|
+
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
386
383
|
VDialog: typeof import('vuetify/components')['VDialog']
|
|
387
384
|
VDivider: typeof import('vuetify/components')['VDivider']
|
|
388
385
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
@@ -392,6 +389,9 @@ declare module '@vue/runtime-core' {
|
|
|
392
389
|
VField: typeof import('vuetify/components')['VField']
|
|
393
390
|
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
394
391
|
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
392
|
+
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
393
|
+
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
394
|
+
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
395
395
|
VFooter: typeof import('vuetify/components')['VFooter']
|
|
396
396
|
VIcon: typeof import('vuetify/components')['VIcon']
|
|
397
397
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
|
@@ -400,9 +400,9 @@ declare module '@vue/runtime-core' {
|
|
|
400
400
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
401
401
|
VImg: typeof import('vuetify/components')['VImg']
|
|
402
402
|
VInput: typeof import('vuetify/components')['VInput']
|
|
403
|
+
VKbd: typeof import('vuetify/components')['VKbd']
|
|
403
404
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
404
405
|
VItem: typeof import('vuetify/components')['VItem']
|
|
405
|
-
VKbd: typeof import('vuetify/components')['VKbd']
|
|
406
406
|
VLabel: typeof import('vuetify/components')['VLabel']
|
|
407
407
|
VList: typeof import('vuetify/components')['VList']
|
|
408
408
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
|
@@ -414,17 +414,17 @@ declare module '@vue/runtime-core' {
|
|
|
414
414
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
|
415
415
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
|
416
416
|
VMain: typeof import('vuetify/components')['VMain']
|
|
417
|
-
VMessages: typeof import('vuetify/components')['VMessages']
|
|
418
417
|
VMenu: typeof import('vuetify/components')['VMenu']
|
|
419
418
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
420
419
|
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
421
420
|
VPagination: typeof import('vuetify/components')['VPagination']
|
|
422
|
-
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
423
421
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
422
|
+
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
423
|
+
VMessages: typeof import('vuetify/components')['VMessages']
|
|
424
424
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
|
425
425
|
VRating: typeof import('vuetify/components')['VRating']
|
|
426
|
-
VSelect: typeof import('vuetify/components')['VSelect']
|
|
427
426
|
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
427
|
+
VSelect: typeof import('vuetify/components')['VSelect']
|
|
428
428
|
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
429
429
|
VSheet: typeof import('vuetify/components')['VSheet']
|
|
430
430
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
@@ -432,9 +432,9 @@ declare module '@vue/runtime-core' {
|
|
|
432
432
|
VSlider: typeof import('vuetify/components')['VSlider']
|
|
433
433
|
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
434
434
|
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
435
|
-
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
436
435
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
437
436
|
VTab: typeof import('vuetify/components')['VTab']
|
|
437
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
438
438
|
VTable: typeof import('vuetify/components')['VTable']
|
|
439
439
|
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
440
440
|
VTextField: typeof import('vuetify/components')['VTextField']
|
|
@@ -443,8 +443,8 @@ declare module '@vue/runtime-core' {
|
|
|
443
443
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
444
444
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
445
445
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
446
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
447
446
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
448
447
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
448
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
449
449
|
}
|
|
450
450
|
}
|
|
@@ -71,9 +71,12 @@ export const VDataTable = defineComponent({
|
|
|
71
71
|
const {
|
|
72
72
|
items
|
|
73
73
|
} = useDataTableItems(props, columns);
|
|
74
|
+
const filterKeys = computed(() => columns.value.map(c => 'columns.' + c.key));
|
|
74
75
|
const {
|
|
75
76
|
filteredItems
|
|
76
|
-
} = useFilter(props, items, toRef(props, 'search')
|
|
77
|
+
} = useFilter(props, items, toRef(props, 'search'), {
|
|
78
|
+
filterKeys
|
|
79
|
+
});
|
|
77
80
|
const {
|
|
78
81
|
sortBy
|
|
79
82
|
} = createSort(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDataTable.mjs","names":["VTable","VDataTableHeaders","VDataTableRows","VDataTableFooter","useProxiedModel","makeDataTableItemProps","useDataTableItems","createHeaders","makeDataTableHeaderProps","createSort","makeDataTableSortProps","useSortedItems","createGroupBy","makeDataTableGroupProps","useGroupedItems","createPagination","makeDataTablePaginateProps","usePaginatedItems","createSelection","makeDataTableSelectProps","createExpanded","makeDataTableExpandProps","useOptions","provideDefaults","computed","toRef","defineComponent","propsFactory","useRender","makeFilterProps","useFilter","makeVDataTableProps","hideNoData","Boolean","noDataText","type","String","default","height","Number","width","fixedHeader","fixedFooter","VDataTable","name","props","search","emits","value","event","setup","emit","slots","groupBy","columns","showSelect","showExpand","items","filteredItems","sortBy","sortByWithGroups","opened","extractRows","sortedItems","flatItems","page","itemsPerPage","startIndex","stopIndex","pageCount","paginatedItems","paginatedItemsWithoutGroups","top","colgroup","headers","multiSort","thead","body","tbody","tfoot","bottom","prepend"],"sources":["../../../src/labs/VDataTable/VDataTable.tsx"],"sourcesContent":["// Styles\nimport './VDataTable.sass'\n\n// Components\nimport { VTable } from '@/components/VTable'\nimport { VDataTableHeaders } from './VDataTableHeaders'\nimport { VDataTableRows } from './VDataTableRows'\nimport { VDataTableFooter } from './VDataTableFooter'\n\n// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeDataTableItemProps, useDataTableItems } from './composables/items'\nimport { createHeaders, makeDataTableHeaderProps } from './composables/headers'\nimport { createSort, makeDataTableSortProps, useSortedItems } from './composables/sort'\nimport { createGroupBy, makeDataTableGroupProps, useGroupedItems } from './composables/group'\nimport { createPagination, makeDataTablePaginateProps, usePaginatedItems } from './composables/paginate'\nimport { createSelection, makeDataTableSelectProps } from './composables/select'\nimport { createExpanded, makeDataTableExpandProps } from './composables/expand'\nimport { useOptions } from './composables/options'\nimport { provideDefaults } from '@/composables/defaults'\n\n// Utilities\nimport { computed, toRef } from 'vue'\nimport { defineComponent, propsFactory, useRender } from '@/util'\nimport { makeFilterProps, useFilter } from '@/composables/filter'\n\n// Types\nimport type { DataTableItem } from './types'\n\nexport const makeVDataTableProps = propsFactory({\n ...makeDataTableItemProps(),\n ...makeDataTableHeaderProps(),\n hideNoData: Boolean,\n noDataText: {\n type: String,\n default: '$vuetify.noDataText',\n },\n height: [String, Number],\n width: [String, Number],\n fixedHeader: Boolean,\n fixedFooter: Boolean,\n}, 'v-data-table')\n\nexport const VDataTable = defineComponent({\n name: 'VDataTable',\n\n props: {\n search: String,\n\n ...makeVDataTableProps(),\n ...makeDataTableExpandProps(),\n ...makeDataTableGroupProps(),\n ...makeDataTableSelectProps(),\n ...makeDataTableSortProps(),\n ...makeDataTablePaginateProps(),\n ...makeFilterProps(),\n },\n\n emits: {\n 'update:modelValue': (value: any[]) => true,\n 'update:page': (value: number) => true,\n 'update:itemsPerPage': (value: number) => true,\n 'update:sortBy': (value: any) => true,\n 'update:options': (value: any) => true,\n 'update:groupBy': (value: any) => true,\n 'update:expanded': (value: any) => true,\n 'click:row': (event: Event, value: { item: DataTableItem }) => true,\n },\n\n setup (props, { emit, slots }) {\n const groupBy = useProxiedModel(props, 'groupBy')\n\n const { columns } = createHeaders(props, {\n groupBy,\n showSelect: toRef(props, 'showSelect'),\n showExpand: toRef(props, 'showExpand'),\n })\n\n const { items } = useDataTableItems(props, columns)\n\n const { filteredItems } = useFilter<DataTableItem>(props, items, toRef(props, 'search'))\n\n const { sortBy } = createSort(props)\n const { sortByWithGroups, opened, extractRows } = createGroupBy(props, groupBy, sortBy)\n\n const { sortedItems } = useSortedItems(filteredItems, sortByWithGroups, columns)\n const { flatItems } = useGroupedItems(sortedItems, groupBy, opened)\n\n const { page, itemsPerPage, startIndex, stopIndex, pageCount } = createPagination(props, flatItems)\n const { paginatedItems } = usePaginatedItems(flatItems, startIndex, stopIndex, itemsPerPage)\n\n const paginatedItemsWithoutGroups = computed(() => extractRows(paginatedItems.value))\n\n createSelection(props, paginatedItemsWithoutGroups)\n\n createExpanded(props)\n\n useOptions({\n page,\n itemsPerPage,\n sortBy,\n pageCount,\n startIndex,\n stopIndex,\n })\n\n provideDefaults({\n VDataTableRows: {\n hideNoData: toRef(props, 'hideNoData'),\n noDataText: toRef(props, 'noDataText'),\n },\n })\n\n useRender(() => (\n <VTable\n class={[\n 'v-data-table',\n {\n 'v-data-table--show-select': props.showSelect,\n },\n ]}\n fixedHeader={ props.fixedHeader }\n fixedFooter={ props.fixedFooter }\n height={ props.height }\n >\n {{\n top: slots.top,\n default: slots.default ?? (() => (\n <>\n { slots.colgroup?.({ columns }) }\n <thead>\n { slots.headers ? slots.headers() : (\n <VDataTableHeaders\n sticky={ props.fixedHeader }\n multiSort={ props.multiSort }\n v-slots={ slots }\n />\n ) }\n </thead>\n { slots.thead?.() }\n <tbody>\n { slots.body ? slots.body() : (\n <VDataTableRows\n items={ paginatedItems.value }\n onClick:row={ (event, value) => emit('click:row', event, value) }\n v-slots={ slots }\n />\n ) }\n </tbody>\n { slots.tbody?.() }\n { slots.tfoot?.() }\n </>\n )),\n bottom: slots.bottom ?? (() => (\n <VDataTableFooter\n v-slots={{\n prepend: slots['footer.prepend'],\n }}\n />\n )),\n }}\n </VTable>\n ))\n\n return {}\n },\n})\n\nexport type VDataTable = InstanceType<typeof VDataTable>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,MAAM;AAAA,SACNC,iBAAiB;AAAA,SACjBC,cAAc;AAAA,SACdC,gBAAgB,kCAEzB;AAAA,SACSC,eAAe;AAAA,SACfC,sBAAsB,EA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AAK,qBAAX,kBAAAxB,KAAK,CAAU,+BAEbA,KAAK,CAACyB,IAAI,GAAGzB,KAAK,CAACyB,IAAI,EAAE;UAAA,SAEfP,cAAc,CAACtB,KAAK;UAAA,eACd,CAACC,KAAK,EAAED,KAAK,KAAKG,IAAI,CAAC,WAAW,EAAEF,KAAK,EAAED,KAAK;QAAC,GACrDI,KAAK,CAElB,oBAEDA,KAAK,CAAC0B,KAAK,qBAAX,kBAAA1B,KAAK,CAAU,kBACfA,KAAK,CAAC2B,KAAK,qBAAX,kBAAA3B,KAAK,CAAU;MAAA,CAEpB,CAAC;MACF4B,MAAM,EAAE5B,KAAK,CAAC4B,MAAM,KAAK,2CAEZ;QACPC,OAAO,EAAE7B,KAAK,CAAC,gBAAgB;MACjC,CAAC,CAEJ;IAAC,EAGP,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VDataTable.mjs","names":["VTable","VDataTableHeaders","VDataTableRows","VDataTableFooter","useProxiedModel","makeDataTableItemProps","useDataTableItems","createHeaders","makeDataTableHeaderProps","createSort","makeDataTableSortProps","useSortedItems","createGroupBy","makeDataTableGroupProps","useGroupedItems","createPagination","makeDataTablePaginateProps","usePaginatedItems","createSelection","makeDataTableSelectProps","createExpanded","makeDataTableExpandProps","useOptions","provideDefaults","computed","toRef","defineComponent","propsFactory","useRender","makeFilterProps","useFilter","makeVDataTableProps","hideNoData","Boolean","noDataText","type","String","default","height","Number","width","fixedHeader","fixedFooter","VDataTable","name","props","search","emits","value","event","setup","emit","slots","groupBy","columns","showSelect","showExpand","items","filterKeys","map","c","key","filteredItems","sortBy","sortByWithGroups","opened","extractRows","sortedItems","flatItems","page","itemsPerPage","startIndex","stopIndex","pageCount","paginatedItems","paginatedItemsWithoutGroups","top","colgroup","headers","multiSort","thead","body","tbody","tfoot","bottom","prepend"],"sources":["../../../src/labs/VDataTable/VDataTable.tsx"],"sourcesContent":["// Styles\nimport './VDataTable.sass'\n\n// Components\nimport { VTable } from '@/components/VTable'\nimport { VDataTableHeaders } from './VDataTableHeaders'\nimport { VDataTableRows } from './VDataTableRows'\nimport { VDataTableFooter } from './VDataTableFooter'\n\n// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeDataTableItemProps, useDataTableItems } from './composables/items'\nimport { createHeaders, makeDataTableHeaderProps } from './composables/headers'\nimport { createSort, makeDataTableSortProps, useSortedItems } from './composables/sort'\nimport { createGroupBy, makeDataTableGroupProps, useGroupedItems } from './composables/group'\nimport { createPagination, makeDataTablePaginateProps, usePaginatedItems } from './composables/paginate'\nimport { createSelection, makeDataTableSelectProps } from './composables/select'\nimport { createExpanded, makeDataTableExpandProps } from './composables/expand'\nimport { useOptions } from './composables/options'\nimport { provideDefaults } from '@/composables/defaults'\n\n// Utilities\nimport { computed, toRef } from 'vue'\nimport { defineComponent, propsFactory, useRender } from '@/util'\nimport { makeFilterProps, useFilter } from '@/composables/filter'\n\n// Types\nimport type { DataTableItem } from './types'\n\nexport const makeVDataTableProps = propsFactory({\n ...makeDataTableItemProps(),\n ...makeDataTableHeaderProps(),\n hideNoData: Boolean,\n noDataText: {\n type: String,\n default: '$vuetify.noDataText',\n },\n height: [String, Number],\n width: [String, Number],\n fixedHeader: Boolean,\n fixedFooter: Boolean,\n}, 'v-data-table')\n\nexport const VDataTable = defineComponent({\n name: 'VDataTable',\n\n props: {\n search: String,\n\n ...makeVDataTableProps(),\n ...makeDataTableExpandProps(),\n ...makeDataTableGroupProps(),\n ...makeDataTableSelectProps(),\n ...makeDataTableSortProps(),\n ...makeDataTablePaginateProps(),\n ...makeFilterProps(),\n },\n\n emits: {\n 'update:modelValue': (value: any[]) => true,\n 'update:page': (value: number) => true,\n 'update:itemsPerPage': (value: number) => true,\n 'update:sortBy': (value: any) => true,\n 'update:options': (value: any) => true,\n 'update:groupBy': (value: any) => true,\n 'update:expanded': (value: any) => true,\n 'click:row': (event: Event, value: { item: DataTableItem }) => true,\n },\n\n setup (props, { emit, slots }) {\n const groupBy = useProxiedModel(props, 'groupBy')\n\n const { columns } = createHeaders(props, {\n groupBy,\n showSelect: toRef(props, 'showSelect'),\n showExpand: toRef(props, 'showExpand'),\n })\n\n const { items } = useDataTableItems(props, columns)\n\n const filterKeys = computed(() => columns.value.map(c => 'columns.' + c.key))\n const { filteredItems } = useFilter<DataTableItem>(props, items, toRef(props, 'search'), { filterKeys })\n\n const { sortBy } = createSort(props)\n const { sortByWithGroups, opened, extractRows } = createGroupBy(props, groupBy, sortBy)\n\n const { sortedItems } = useSortedItems(filteredItems, sortByWithGroups, columns)\n const { flatItems } = useGroupedItems(sortedItems, groupBy, opened)\n\n const { page, itemsPerPage, startIndex, stopIndex, pageCount } = createPagination(props, flatItems)\n const { paginatedItems } = usePaginatedItems(flatItems, startIndex, stopIndex, itemsPerPage)\n\n const paginatedItemsWithoutGroups = computed(() => extractRows(paginatedItems.value))\n\n createSelection(props, paginatedItemsWithoutGroups)\n\n createExpanded(props)\n\n useOptions({\n page,\n itemsPerPage,\n sortBy,\n pageCount,\n startIndex,\n stopIndex,\n })\n\n provideDefaults({\n VDataTableRows: {\n hideNoData: toRef(props, 'hideNoData'),\n noDataText: toRef(props, 'noDataText'),\n },\n })\n\n useRender(() => (\n <VTable\n class={[\n 'v-data-table',\n {\n 'v-data-table--show-select': props.showSelect,\n },\n ]}\n fixedHeader={ props.fixedHeader }\n fixedFooter={ props.fixedFooter }\n height={ props.height }\n >\n {{\n top: slots.top,\n default: slots.default ?? (() => (\n <>\n { slots.colgroup?.({ columns }) }\n <thead>\n { slots.headers ? slots.headers() : (\n <VDataTableHeaders\n sticky={ props.fixedHeader }\n multiSort={ props.multiSort }\n v-slots={ slots }\n />\n ) }\n </thead>\n { slots.thead?.() }\n <tbody>\n { slots.body ? slots.body() : (\n <VDataTableRows\n items={ paginatedItems.value }\n onClick:row={ (event, value) => emit('click:row', event, value) }\n v-slots={ slots }\n />\n ) }\n </tbody>\n { slots.tbody?.() }\n { slots.tfoot?.() }\n </>\n )),\n bottom: slots.bottom ?? (() => (\n <VDataTableFooter\n v-slots={{\n prepend: slots['footer.prepend'],\n }}\n />\n )),\n }}\n </VTable>\n ))\n\n return {}\n },\n})\n\nexport type VDataTable = InstanceType<typeof VDataTable>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,MAAM;AAAA,SACNC,iBAAiB;AAAA,SACjBC,cAAc;AAAA,SACdC,gBAAgB,kCAEzB;AAAA,SACSC,eAAe;AAAA,SACfC,sBAAsB,EAAEC,iBAAiB;AAAA,SACzCC,aAAa,EAAEC,wBAAwB;AAAA,SACvCC,UAAU,EAAEC,sBAAsB,EAAEC,cAAc;AAAA,SAClDC,aAAa,EAAEC,uBAAuB,EAAEC,eAAe;AAAA,SACvDC,gBAAgB,EAAEC,0BAA0B,EAAEC,iBAAiB;AAAA,SAC/DC,eAAe,EAAEC,wBAAwB;AAAA,SACzCC,cAAc,EAAEC,wBAAwB;AAAA,SACxCC,UAAU;AAAA,SACVC,eAAe,0CAExB;AACA,SAASC,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5BC,eAAe,EAAEC,YAAY,EAAEC,SAAS;AAAA,SACxCC,eAAe,EAAEC,SAAS,wCAEnC;AAGA,OAAO,MAAMC,mBAAmB,GAAGJ,YAAY,CAAC;EAC9C,GAAGtB,sBAAsB,EAAE;EAC3B,GAAGG,wBAAwB,EAAE;EAC7BwB,UAAU,EAAEC,OAAO;EACnBC,UAAU,EAAE;IACVC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE,CAACF,MAAM,EAAEG,MAAM,CAAC;EACxBC,KAAK,EAAE,CAACJ,MAAM,EAAEG,MAAM,CAAC;EACvBE,WAAW,EAAER,OAAO;EACpBS,WAAW,EAAET;AACf,CAAC,EAAE,cAAc,CAAC;AAElB,OAAO,MAAMU,UAAU,GAAGjB,eAAe,CAAC;EACxCkB,IAAI,EAAE,YAAY;EAElBC,K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|
27
27
|
} = useGroupBy();
|
|
@@ -44,8 +44,8 @@ export const VDataTableGroupHeaderRow = defineComponent({
|
|
|
44
44
|
}, [columns.value.map(column => {
|
|
45
45
|
if (column.key === 'data-table-group') {
|
|
46
46
|
var _slots$dataTableGro;
|
|
47
|
-
const icon =
|
|
48
|
-
const onClick = () => toggleGroup(props.item
|
|
47
|
+
const icon = isGroupOpen(props.item) ? '$expand' : '$next';
|
|
48
|
+
const onClick = () => toggleGroup(props.item);
|
|
49
49
|
return ((_slots$dataTableGro = slots['data-table-group']) == null ? void 0 : _slots$dataTableGro.call(slots, {
|
|
50
50
|
item: props.item,
|
|
51
51
|
count: rows.value.length,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDataTableGroupHeaderRow.mjs","names":["VBtn","VCheckboxBtn","VDataTableColumn","useHeaders","useSelection","useGroupBy","computed","defineComponent","VDataTableGroupHeaderRow","name","props","item","type","Object","required","setup","slots","
|
|
1
|
+
{"version":3,"file":"VDataTableGroupHeaderRow.mjs","names":["VBtn","VCheckboxBtn","VDataTableColumn","useHeaders","useSelection","useGroupBy","computed","defineComponent","VDataTableGroupHeaderRow","name","props","item","type","Object","required","setup","slots","isGroupOpen","toggleGroup","extractRows","isSelected","isSomeSelected","select","columns","rows","depth","value","map","column","key","icon","onClick","count","length","modelValue","indeterminate","selectGroup","v"],"sources":["../../../src/labs/VDataTable/VDataTableGroupHeaderRow.tsx"],"sourcesContent":["// Components\nimport { VBtn } from '@/components/VBtn'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\nimport { VDataTableColumn } from './VDataTableColumn'\n\n// Composables\nimport { useHeaders } from './composables/headers'\nimport { useSelection } from './composables/select'\nimport { useGroupBy } from './composables/group'\n\n// Utilities\nimport { computed } from 'vue'\nimport { defineComponent } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { GroupHeaderItem } from './types'\n\nexport const VDataTableGroupHeaderRow = defineComponent({\n name: 'VDataTableGroupHeaderRow',\n\n props: {\n item: {\n type: Object as PropType<GroupHeaderItem>,\n required: true,\n },\n },\n\n setup (props, { slots }) {\n const { isGroupOpen, toggleGroup, extractRows } = useGroupBy()\n const { isSelected, isSomeSelected, select } = useSelection()\n const { columns } = useHeaders()\n\n const rows = computed(() => {\n return extractRows([props.item])\n })\n\n return () => (\n <tr\n class=\"v-data-table-group-header-row\"\n style={{\n '--v-data-table-group-header-row-depth': props.item.depth,\n }}\n >\n { columns.value.map(column => {\n if (column.key === 'data-table-group') {\n const icon = isGroupOpen(props.item) ? '$expand' : '$next'\n const onClick = () => toggleGroup(props.item)\n\n return slots['data-table-group']?.({ item: props.item, count: rows.value.length, props: { icon, onClick } }) ?? (\n <VDataTableColumn class=\"v-data-table-group-header-row__column\">\n <VBtn\n size=\"small\"\n variant=\"text\"\n icon={ icon }\n onClick={ onClick }\n />\n <span>{ props.item.value }</span>\n <span>({ rows.value.length })</span>\n </VDataTableColumn>\n )\n }\n\n if (column.key === 'data-table-select') {\n const modelValue = isSelected(rows.value)\n const indeterminate = isSomeSelected(rows.value) && !modelValue\n const selectGroup = (v: boolean) => select(rows.value, v)\n return slots['data-table-select']?.({ props: { modelValue, indeterminate, 'onUpdate:modelValue': selectGroup } }) ?? (\n <td>\n <VCheckboxBtn\n modelValue={ modelValue }\n indeterminate={ indeterminate }\n onUpdate:modelValue={ selectGroup }\n />\n </td>\n )\n }\n\n return <td />\n })}\n </tr>\n )\n },\n})\n"],"mappings":";AAAA;AAAA,SACSA,IAAI;AAAA,SACJC,YAAY;AAAA,SACZC,gBAAgB,kCAEzB;AAAA,SACSC,UAAU;AAAA,SACVC,YAAY;AAAA,SACZC,UAAU,mCAEnB;AACA,SAASC,QAAQ,QAAQ,KAAK;AAAA,SACrBC,eAAe,gCAExB;AAIA,OAAO,MAAMC,wBAAwB,GAAGD,eAAe,CAAC;EACtDE,IAAI,EAAE,0BAA0B;EAEhCC,KAAK,EAAE;IACLC,IAAI,EAAE;MACJC,IAAI,EAAEC,MAAmC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AE7B;MACH;MAEA,IAAIL,MAAM,CAACC,GAAG,KAAK,mBAAmB,EAAE;QAAA;QACtC,MAAMK,UAAU,GAAGd,UAAU,CAACI,IAAI,CAACE,KAAK,CAAC;QACzC,MAAMS,aAAa,GAAGd,cAAc,CAACG,IAAI,CAACE,KAAK,CAAC,IAAI,CAACQ,UAAU;QAC/D,MAAME,WAAW,GAAIC,CAAU,IAAKf,MAAM,CAACE,IAAI,CAACE,KAAK,EAAEW,CAAC,CAAC;QACzD,OAAO,wBAAArB,KAAK,CAAC,mBAAmB,CAAC,qBAA1B,yBAAAA,KAAK,EAAwB;UAAEN,KAAK,EAAE;YAAEwB,UAAU;YAAEC,aAAa;YAAE,qBAAqB,EAAEC;UAAY;QAAE,CAAC,CAAC;UAAA,cAG9FF,UAAU;UAAA,iBACPC,aAAa;UAAA,uBACPC;QAAW,UAGtC;MACH;MAEA;IACF,CAAC,CAAC,EAEL;EACH;AACF,CAAC,CAAC"}
|
|
@@ -2,9 +2,11 @@ import { resolveDirective as _resolveDirective, createVNode as _createVNode, Fra
|
|
|
2
2
|
// Components
|
|
3
3
|
import { VDataTableGroupHeaderRow } from "./VDataTableGroupHeaderRow.mjs";
|
|
4
4
|
import { VDataTableRow } from "./VDataTableRow.mjs"; // Composables
|
|
5
|
+
import { useLocale } from "../../composables/locale.mjs";
|
|
5
6
|
import { useExpanded } from "./composables/expand.mjs";
|
|
6
7
|
import { useHeaders } from "./composables/headers.mjs";
|
|
7
|
-
import {
|
|
8
|
+
import { useSelection } from "./composables/select.mjs";
|
|
9
|
+
import { useGroupBy } from "./composables/group.mjs"; // Utilities
|
|
8
10
|
import { defineComponent, useRender } from "../../util/index.mjs"; // Types
|
|
9
11
|
export const VDataTableRows = defineComponent({
|
|
10
12
|
name: 'VDataTableRows',
|
|
@@ -37,10 +39,18 @@ export const VDataTableRows = defineComponent({
|
|
|
37
39
|
columns
|
|
38
40
|
} = useHeaders();
|
|
39
41
|
const {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
expandOnClick,
|
|
43
|
+
toggleExpand,
|
|
44
|
+
isExpanded
|
|
43
45
|
} = useExpanded();
|
|
46
|
+
const {
|
|
47
|
+
isSelected,
|
|
48
|
+
toggleSelect
|
|
49
|
+
} = useSelection();
|
|
50
|
+
const {
|
|
51
|
+
toggleGroup,
|
|
52
|
+
isGroupOpen
|
|
53
|
+
} = useGroupBy();
|
|
44
54
|
const {
|
|
45
55
|
t
|
|
46
56
|
} = useLocale();
|
|
@@ -59,23 +69,41 @@ export const VDataTableRows = defineComponent({
|
|
|
59
69
|
})), props.items.map((item, index) => {
|
|
60
70
|
var _slots$expandedRow;
|
|
61
71
|
if (item.type === 'group-header') {
|
|
62
|
-
return
|
|
72
|
+
return slots['group-header'] ? slots['group-header']({
|
|
73
|
+
index,
|
|
74
|
+
item,
|
|
75
|
+
columns: columns.value,
|
|
76
|
+
isExpanded,
|
|
77
|
+
toggleExpand,
|
|
78
|
+
isSelected,
|
|
79
|
+
toggleSelect,
|
|
80
|
+
toggleGroup,
|
|
81
|
+
isGroupOpen
|
|
82
|
+
}) : _createVNode(VDataTableGroupHeaderRow, {
|
|
63
83
|
"key": `group-header_${item.id}`,
|
|
64
84
|
"item": item
|
|
65
85
|
}, slots);
|
|
66
86
|
}
|
|
67
|
-
return _createVNode(_Fragment, null, [
|
|
87
|
+
return _createVNode(_Fragment, null, [slots.item ? slots.item({
|
|
88
|
+
index,
|
|
89
|
+
item,
|
|
90
|
+
columns: columns.value,
|
|
91
|
+
isExpanded,
|
|
92
|
+
toggleExpand,
|
|
93
|
+
isSelected,
|
|
94
|
+
toggleSelect
|
|
95
|
+
}) : _createVNode(VDataTableRow, {
|
|
68
96
|
"key": `item_${item.value}`,
|
|
69
97
|
"onClick": event => {
|
|
70
98
|
if (expandOnClick.value) {
|
|
71
|
-
|
|
99
|
+
toggleExpand(item.value);
|
|
72
100
|
}
|
|
73
101
|
emit('click:row', event, {
|
|
74
102
|
item
|
|
75
103
|
});
|
|
76
104
|
},
|
|
77
105
|
"item": item
|
|
78
|
-
}, slots),
|
|
106
|
+
}, slots), isExpanded(item.value) && ((_slots$expandedRow = slots['expanded-row']) == null ? void 0 : _slots$expandedRow.call(slots, {
|
|
79
107
|
item,
|
|
80
108
|
columns: columns.value
|
|
81
109
|
}))]);
|