vuetify 3.1.1 → 3.1.3
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/dist/json/attributes.json +495 -483
- package/dist/json/importMap.json +58 -58
- package/dist/json/tags.json +4 -1
- package/dist/json/web-types.json +892 -839
- package/dist/vuetify-labs.css +356 -346
- package/dist/vuetify-labs.d.ts +257 -179
- package/dist/vuetify-labs.esm.js +432 -278
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +431 -277
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +94 -84
- package/dist/vuetify.d.ts +261 -194
- package/dist/vuetify.esm.js +346 -242
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +345 -241
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +731 -721
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.ts +2 -2
- package/lib/blueprints/md1.d.ts +2 -2
- package/lib/blueprints/md2.d.ts +2 -2
- package/lib/blueprints/md3.d.ts +2 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs +4 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.ts +43 -20
- package/lib/components/VBtn/VBtn.mjs +16 -5
- 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/VChip/VChip.mjs +18 -4
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/index.d.ts +15 -2
- package/lib/components/VChipGroup/VChipGroup.mjs +1 -0
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +5 -4
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.ts +43 -20
- package/lib/components/VDefaultsProvider/index.d.ts +5 -4
- package/lib/components/VDialog/VDialog.mjs +6 -5
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/index.d.ts +57 -34
- package/lib/components/VDivider/VDivider.mjs +6 -6
- package/lib/components/VDivider/VDivider.mjs.map +1 -1
- package/lib/components/VField/VField.mjs +28 -26
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +1 -0
- package/lib/components/VFileInput/VFileInput.mjs +7 -4
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +1 -0
- package/lib/components/VForm/index.d.ts +0 -3
- package/lib/components/VGrid/VGrid.css +5 -0
- package/lib/components/VGrid/VGrid.sass +5 -0
- package/lib/components/VList/VList.mjs +4 -1
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +1 -1
- package/lib/components/VList/VListItem.mjs +34 -20
- 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/VMenu/VMenu.mjs +6 -5
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.ts +57 -34
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +4 -0
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +4 -0
- package/lib/components/VNavigationDrawer/index.d.ts +3 -3
- package/lib/components/VNavigationDrawer/touch.mjs +7 -6
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VOverlay/index.d.ts +34 -11
- package/lib/components/VOverlay/locationStrategies.mjs +40 -29
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +25 -16
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +1 -1
- package/lib/components/VPagination/VPagination.mjs.map +1 -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 +4 -4
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.ts +43 -20
- package/lib/components/VSlider/VSliderThumb.mjs +5 -1
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSnackbar/index.d.ts +42 -19
- package/lib/components/VTable/VTable.css +4 -4
- package/lib/components/VTable/VTable.sass +2 -2
- package/lib/components/VTooltip/VTooltip.mjs +4 -3
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/index.d.ts +57 -34
- package/lib/components/index.d.ts +247 -179
- package/lib/composables/defaults.mjs +1 -1
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/filter.mjs +3 -3
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/form.mjs +0 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/teleport.mjs +6 -7
- package/lib/composables/teleport.mjs.map +1 -1
- package/lib/composables/toggleScope.mjs +14 -7
- package/lib/composables/toggleScope.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.ts +17 -17
- package/lib/labs/VDataTable/VDataTable.mjs +10 -6
- 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/VDataTableServer.mjs +23 -10
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +6 -2
- 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/lib/labs/VDataTable/composables/options.mjs +4 -2
- package/lib/labs/VDataTable/composables/options.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/sort.mjs +3 -5
- package/lib/labs/VDataTable/composables/sort.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.ts +11 -0
- package/lib/labs/components.d.ts +11 -0
- package/lib/locale/adapters/vue-i18n.mjs +12 -2
- package/lib/locale/adapters/vue-i18n.mjs.map +1 -1
- package/lib/locale/en.mjs +2 -2
- package/lib/locale/en.mjs.map +1 -1
- package/lib/locale/sv.mjs +7 -7
- package/lib/locale/sv.mjs.map +1 -1
- package/lib/util/defineComponent.mjs +21 -18
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/helpers.mjs +5 -1
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { computed, inject, provide, ref, unref } from 'vue';
|
|
|
3
3
|
import { mergeDeep } from "../util/index.mjs"; // Types
|
|
4
4
|
export const DefaultsSymbol = Symbol.for('vuetify:defaults');
|
|
5
5
|
export function createDefaults(options) {
|
|
6
|
-
return ref(options
|
|
6
|
+
return ref(options);
|
|
7
7
|
}
|
|
8
8
|
export function useDefaults() {
|
|
9
9
|
const defaults = inject(DefaultsSymbol);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.mjs","names":["computed","inject","provide","ref","unref","mergeDeep","DefaultsSymbol","Symbol","for","createDefaults","options","useDefaults","defaults","Error","provideDefaults","injectedDefaults","providedDefaults","newDefaults","scoped","reset","root","properties","value","prev","len","Number","Infinity","i"],"sources":["../../src/composables/defaults.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, unref } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, Ref } from 'vue'\nimport type { MaybeRef } from '@/util'\n\nexport
|
|
1
|
+
{"version":3,"file":"defaults.mjs","names":["computed","inject","provide","ref","unref","mergeDeep","DefaultsSymbol","Symbol","for","createDefaults","options","useDefaults","defaults","Error","provideDefaults","injectedDefaults","providedDefaults","newDefaults","scoped","reset","root","properties","value","prev","len","Number","Infinity","i"],"sources":["../../src/composables/defaults.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, unref } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, Ref } from 'vue'\nimport type { MaybeRef } from '@/util'\n\nexport type DefaultsInstance = undefined | {\n [key: string]: undefined | Record<string, unknown>\n global?: Record<string, unknown>\n}\n\nexport type DefaultsOptions = Partial<DefaultsInstance>\n\nexport const DefaultsSymbol: InjectionKey<Ref<DefaultsInstance>> = Symbol.for('vuetify:defaults')\n\nexport function createDefaults (options?: DefaultsInstance): Ref<DefaultsInstance> {\n return ref(options)\n}\n\nexport function useDefaults () {\n const defaults = inject(DefaultsSymbol)\n\n if (!defaults) throw new Error('[Vuetify] Could not find defaults instance')\n\n return defaults\n}\n\nexport function provideDefaults (\n defaults?: MaybeRef<DefaultsInstance | undefined>,\n options?: {\n reset?: MaybeRef<number | string | undefined>\n root?: MaybeRef<boolean | undefined>\n scoped?: MaybeRef<boolean | undefined>\n }\n) {\n const injectedDefaults = useDefaults()\n const providedDefaults = ref(defaults)\n\n const newDefaults = computed(() => {\n const scoped = unref(options?.scoped)\n const reset = unref(options?.reset)\n const root = unref(options?.root)\n\n let properties = mergeDeep(providedDefaults.value, { prev: injectedDefaults.value })\n\n if (scoped) return properties\n\n if (reset || root) {\n const len = Number(reset || Infinity)\n\n for (let i = 0; i <= len; i++) {\n if (!properties.prev) break\n\n properties = properties.prev\n }\n\n return properties\n }\n\n return m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AACN,KAAK,IAAIO,QAAQ,CAAC;MAErC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIH,GAAG,EAAEG,CAAC,EAAE,EAAE;QAC7B,IAAI,CAACN,UAAU,CAACE,IAAI,EAAE;QAEtBF,UAAU,GAAGA,UAAU,CAACE,IAAI;MAC9B;MAEA,OAAOF,UAAU;IACnB;IAEA,OAAOhB,SAAS,CAACgB,UAAU,CAACE,IAAI,EAAEF,UAAU,CAAC;EAC/C,CAAC,CAAkC;EAEnCnB,OAAO,CAACI,cAAc,EAAEW,WAAW,CAAC;EAEpC,OAAOA,WAAW;AACpB"}
|
|
@@ -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,E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IAAI,CAAC;MAC9B2C,eAAe,CAAC7C,KAAK,CAACkD,GAAG,CAAChD,IAAI,CAACF,KAAK,EAAEwC,OAAO,CAAC;IAChD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,SAASW,UAAU,CAAEjD,IAAO,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,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oBAAPA,OAAO,CAAEV,UAAU,CAAC,IAAI8B,KAAK,CAAC9B,UAAU;MAC1DG,UAAU,EAAE2B,KAAK,CAAC3B,UAAU;MAC5BG,QAAQ,EAAEwB,KAAK,CAACxB;IAClB,CAAC,CACF;IAED8B,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/composables/form.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","toRef","watch","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","
|
|
1
|
+
{"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","toRef","watch","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","readonly","modelValue","type","default","validateOn","String","createForm","props","model","isDisabled","isReadonly","isValidating","items","errors","validate","results","valid","value","item","itemErrorMessages","length","push","id","errorMessages","reset","forEach","resetValidation","invalid","isValid","deep","register","some","unregister","filter","update","found","find","useForm"],"sources":["../../src/composables/form.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, toRef, watch } from 'vue'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'\nimport type { ValidationProps } from './validation'\n\nexport interface FormProvide {\n register: (item: {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n }) => void\n unregister: (id: number | string) => void\n update: (id: number | string, isValid: boolean | null, errorMessages: string[]) => void\n items: Ref<FormField[]>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isValidating: Ref<boolean>\n validateOn: Ref<FormProps['validateOn']>\n}\n\ninterface FormField {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n isValid: boolean | null\n errorMessages: string[]\n}\n\ninterface FieldValidationResult {\n id: number | string\n errorMessages: string[]\n}\n\ninterface FormValidationResult {\n valid: boolean\n errors: FieldValidationResult[]\n}\n\nexport interface SubmitEventPromise extends SubmitEvent, Promise<FormValidationResult> {}\n\nexport const FormKey: InjectionKey<FormProvide> = Symbol.for('vuetify:form')\n\nexport interface FormProps {\n disabled: boolean\n fastFail: boolean\n readonly: boolean\n modelValue: boolean | null\n 'onUpdate:modelValue': ((val: boolean | null) => void) | undefined\n validateOn: ValidationProps['validateOn']\n}\n\nexport const makeFormProps = propsFactory({\n disabled: Boolean,\n fastFail: Boolean,\n readonly: Boolean,\n modelValue: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n validateOn: {\n type: String as PropType<FormProps['validateOn']>,\n default: 'input',\n },\n}, 'form')\n\nexport function createForm (props: FormProps) {\n const model = useProxiedModel(props, 'modelValue')\n\n const isDisabled = computed(() => props.disabled)\n const isReadonly = computed(() => props.readonly)\n const isValidating = ref(false)\n const items = ref<FormField[]>([])\n const errors = ref<FieldValidationResult[]>([])\n\n async function validate () {\n const results = []\n let valid = true\n\n errors.value = []\n isValidating.value = true\n\n for (const item of items.value) {\n const itemErrorMessages = await item.validate()\n\n if (itemErrorMessages.length > 0) {\n valid = false\n\n results.push({\n id: item.id,\n errorMessages: itemErrorMessages,\n })\n }\n\n if (!valid && props.fastFail) break\n }\n\n errors.value = results\n isValidating.value = false\n\n return { valid, errors: errors.value }\n }\n\n function reset () {\n items.value.forEach(item => item.reset())\n model.value = null\n }\n\n function resetValidation () {\n items.value.forEach(item => item.resetValidation())\n errors.value = []\n model.value = null\n }\n\n watch(items, () => {\n let valid = 0\n let invalid = 0\n const results = []\n\n for (const item of items.value) {\n if (item.isValid === false) {\n invalid++\n results.push({\n id: item.id,\n errorMessages: item.errorMessages,\n })\n } else if (item.isValid === true) valid++\n }\n\n errors.value = results\n model.value =\n invalid > 0 ? false\n : valid === items.value.length ? true\n : null\n }, { deep: true })\n\n provide(FormKey, {\n register: ({ id, validate, reset, resetValidation }) => {\n if (items.value.some(item => item.id === id)) {\n consoleWarn(`Duplicate input name \"${id}\"`)\n }\n\n items.value.push({\n id,\n validate,\n reset,\n resetValidation,\n isValid: null,\n errorMessages: [],\n })\n },\n unregister: id => {\n items.value = items.value.filter(item => {\n return item.id !== id\n })\n },\n update: (id, isValid, errorMessages) => {\n const found = items.value.find(item => item.id === id)\n\n if (!found) return\n\n found.isValid = isValid\n found.errorMessages = errorMessages\n },\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validateOn: toRef(props, 'validateOn'),\n })\n\n return {\n errors,\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validate,\n reset,\n resetValidation,\n }\n}\n\nexport function useForm () {\n return inject(FormKey, null)\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACzDC,eAAe;AAAA,SACfC,WAAW,EAAEC,YAAY,6BAElC;AAyCA,OAAO,MAAMC,OAAkC,GAAGC,MAAM,CAACC,GAAG,CAAC,cAAc,CAAC;AAW5E,OAAO,MAAMC,aAAa,GAAGJ,YAAY,CAAC;EACxCK,QAAQ,EAAEC,OAAO;EACjB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
|
|
|
10
10
|
warn(`Unable to locate target ${_target}`);
|
|
11
11
|
return undefined;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
let container = targetElement.querySelector('.v-overlay-container');
|
|
14
|
+
if (!container) {
|
|
15
|
+
container = document.createElement('div');
|
|
16
|
+
container.className = 'v-overlay-container';
|
|
17
|
+
targetElement.appendChild(container);
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return container;
|
|
20
20
|
});
|
|
21
21
|
return {
|
|
22
22
|
teleportTarget
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
useTeleport.cache = new WeakMap();
|
|
26
25
|
//# sourceMappingURL=teleport.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teleport.mjs","names":["computed","warn","IN_BROWSER","useTeleport","target","teleportTarget","_target","value","undefined","targetElement","document","body","querySelector","
|
|
1
|
+
{"version":3,"file":"teleport.mjs","names":["computed","warn","IN_BROWSER","useTeleport","target","teleportTarget","_target","value","undefined","targetElement","document","body","querySelector","container","createElement","className","appendChild"],"sources":["../../src/composables/teleport.ts"],"sourcesContent":["// Utilities\nimport { computed, warn } from 'vue'\nimport { IN_BROWSER } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nexport function useTeleport (target: Ref<boolean | string | Element>) {\n const teleportTarget = computed(() => {\n const _target = target.value\n\n if (_target === true || !IN_BROWSER) return undefined\n\n const targetElement =\n _target === false ? document.body\n : typeof _target === 'string' ? document.querySelector(_target)\n : _target\n\n if (targetElement == null) {\n warn(`Unable to locate target ${_target}`)\n return undefined\n }\n\n let container = targetElement.querySelector('.v-overlay-container')\n\n if (!container) {\n container = document.createElement('div')\n container.className = 'v-overlay-container'\n targetElement.appendChild(container)\n }\n\n return container\n })\n\n return { teleportTarget }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,IAAI,QAAQ,KAAK;AAAA,SAC3BC,UAAU,6BAEnB;AAGA,OAAO,SAASC,WAAW,CAAEC,MAAuC,EAAE;EACpE,MAAMC,cAAc,GAAGL,QAAQ,CAAC,MAAM;IACpC,MAAMM,OAAO,GAAGF,MAAM,CAACG,KAAK;IAE5B,IAAID,OAAO,KAAK,IAAI,IAAI,CAACJ,UAAU,EAAE,OAAOM,SAAS;IAErD,MAAMC,aAAa,GACjBH,OAAO,KAAK,KAAK,GAAGI,QAAQ,CAACC,IAAI,GAC/B,OAAOL,OAAO,KAAK,QAAQ,GAAGI,QAAQ,CAACE,aAAa,CAACN,OAAO,CAAC,GAC7DA,OAAO;IAEX,IAAIG,aAAa,IAAI,IAAI,EAAE;MACzBR,IAAI,CAAE,2BAA0BK,OAAQ,EAAC,CAAC;MAC1C,OAAOE,SAAS;IAClB;IAEA,IAAIK,SAAS,GAAGJ,aAAa,CAACG,aAAa,CAAC,sBAAsB,CAAC;IAEnE,IAAI,CAACC,SAAS,EAAE;MACdA,SAAS,GAAGH,QAAQ,CAACI,aAAa,CAAC,KAAK,CAAC;MACzCD,SAAS,CAACE,SAAS,GAAG,qBAAqB;MAC3CN,aAAa,CAACO,WAAW,CAACH,SAAS,CAAC;IACtC;IAEA,OAAOA,SAAS;EAClB,CAAC,CAAC;EAEF,OAAO;IAAER;EAAe,CAAC;AAC3B"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { effectScope, onScopeDispose, watch } from 'vue';
|
|
2
|
-
export function useToggleScope(source,
|
|
2
|
+
export function useToggleScope(source, fn) {
|
|
3
3
|
let scope;
|
|
4
|
+
function start() {
|
|
5
|
+
scope = effectScope();
|
|
6
|
+
scope.run(() => fn.length ? fn(() => {
|
|
7
|
+
var _scope;
|
|
8
|
+
(_scope = scope) == null ? void 0 : _scope.stop();
|
|
9
|
+
start();
|
|
10
|
+
}) : fn());
|
|
11
|
+
}
|
|
4
12
|
watch(source, active => {
|
|
5
13
|
if (active && !scope) {
|
|
6
|
-
|
|
7
|
-
scope.run(cb);
|
|
14
|
+
start();
|
|
8
15
|
} else if (!active) {
|
|
9
|
-
var
|
|
10
|
-
(
|
|
16
|
+
var _scope2;
|
|
17
|
+
(_scope2 = scope) == null ? void 0 : _scope2.stop();
|
|
11
18
|
scope = undefined;
|
|
12
19
|
}
|
|
13
20
|
}, {
|
|
14
21
|
immediate: true
|
|
15
22
|
});
|
|
16
23
|
onScopeDispose(() => {
|
|
17
|
-
var
|
|
18
|
-
(
|
|
24
|
+
var _scope3;
|
|
25
|
+
(_scope3 = scope) == null ? void 0 : _scope3.stop();
|
|
19
26
|
});
|
|
20
27
|
}
|
|
21
28
|
//# sourceMappingURL=toggleScope.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleScope.mjs","names":["effectScope","onScopeDispose","watch","useToggleScope","source","
|
|
1
|
+
{"version":3,"file":"toggleScope.mjs","names":["effectScope","onScopeDispose","watch","useToggleScope","source","fn","scope","start","run","length","stop","active","undefined","immediate"],"sources":["../../src/composables/toggleScope.ts"],"sourcesContent":["import { effectScope, onScopeDispose, watch } from 'vue'\nimport type { EffectScope, WatchSource } from 'vue'\n\nexport function useToggleScope (source: WatchSource<boolean>, fn: (reset: () => void) => void) {\n let scope: EffectScope | undefined\n function start () {\n scope = effectScope()\n scope.run(() => fn.length\n ? fn(() => { scope?.stop(); start() })\n : (fn as any)()\n )\n }\n\n watch(source, active => {\n if (active && !scope) {\n start()\n } else if (!active) {\n scope?.stop()\n scope = undefined\n }\n }, { immediate: true })\n\n onScopeDispose(() => {\n scope?.stop()\n })\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,cAAc,EAAEC,KAAK,QAAQ,KAAK;AAGxD,OAAO,SAASC,cAAc,CAAEC,MAA4B,EAAEC,EAA+B,EAAE;EAC7F,IAAIC,KAA8B;EAClC,SAASC,KAAK,GAAI;IAChBD,KAAK,GAAGN,WAAW,EAAE;IACrBM,KAAK,CAACE,GAAG,CAAC,MAAMH,EAAE,CAACI,MAAM,GACrBJ,EAAE,CAAC,MAAM;MAAA;MAAE,UAAAC,KAAK,qBAAL,OAAOI,IAAI,EAAE;MAAEH,KAAK,EAAE;IAAC,CAAC,CAAC,GACnCF,EAAE,EAAU,CAChB;EACH;EAEAH,KAAK,CAACE,MAAM,EAAEO,MAAM,IAAI;IACtB,IAAIA,MAAM,IAAI,CAACL,KAAK,EAAE;MACpBC,KAAK,EAAE;IACT,CAAC,MAAM,IAAI,CAACI,MAAM,EAAE;MAAA;MAClB,WAAAL,KAAK,qBAAL,QAAOI,IAAI,EAAE;MACbJ,KAAK,GAAGM,SAAS;IACnB;EACF,CAAC,EAAE;IAAEC,SAAS,EAAE;EAAK,CAAC,CAAC;EAEvBZ,cAAc,CAAC,MAAM;IAAA;IACnB,WAAAK,KAAK,qBAAL,QAAOI,IAAI,EAAE;EACf,CAAC,CAAC;AACJ"}
|
package/lib/entry-bundler.mjs
CHANGED
package/lib/framework.mjs
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -145,10 +145,10 @@ interface DisplayInstance {
|
|
|
145
145
|
}
|
|
146
146
|
declare function useDisplay(): DisplayInstance;
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
declare type DefaultsInstance = undefined | {
|
|
149
149
|
[key: string]: undefined | Record<string, unknown>;
|
|
150
150
|
global?: Record<string, unknown>;
|
|
151
|
-
}
|
|
151
|
+
};
|
|
152
152
|
declare type DefaultsOptions = Partial<DefaultsInstance>;
|
|
153
153
|
|
|
154
154
|
declare type IconValue = string | JSXComponent;
|
|
@@ -315,22 +315,23 @@ declare module '@vue/runtime-core' {
|
|
|
315
315
|
|
|
316
316
|
export interface GlobalComponents {
|
|
317
317
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
318
|
-
VHover: typeof import('vuetify/components')['VHover']
|
|
319
318
|
VForm: typeof import('vuetify/components')['VForm']
|
|
320
319
|
VContainer: typeof import('vuetify/components')['VContainer']
|
|
321
320
|
VCol: typeof import('vuetify/components')['VCol']
|
|
322
321
|
VRow: typeof import('vuetify/components')['VRow']
|
|
323
322
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
|
323
|
+
VHover: typeof import('vuetify/components')['VHover']
|
|
324
324
|
VLayout: typeof import('vuetify/components')['VLayout']
|
|
325
325
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
326
326
|
VLazy: typeof import('vuetify/components')['VLazy']
|
|
327
327
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
328
328
|
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
329
329
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
330
|
-
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
331
330
|
VRadio: typeof import('vuetify/components')['VRadio']
|
|
331
|
+
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
332
332
|
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
333
333
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
334
|
+
VValidation: typeof import('vuetify/components')['VValidation']
|
|
334
335
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
|
335
336
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
|
336
337
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
|
@@ -348,47 +349,46 @@ declare module '@vue/runtime-core' {
|
|
|
348
349
|
VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
|
|
349
350
|
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
|
350
351
|
VApp: typeof import('vuetify/components')['VApp']
|
|
351
|
-
VValidation: typeof import('vuetify/components')['VValidation']
|
|
352
352
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
353
353
|
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
354
354
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
355
|
-
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
356
355
|
VAlert: typeof import('vuetify/components')['VAlert']
|
|
357
356
|
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
357
|
+
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
358
358
|
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
359
359
|
VBadge: typeof import('vuetify/components')['VBadge']
|
|
360
360
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
361
361
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
362
362
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
363
|
+
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
363
364
|
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
364
365
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
365
366
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
366
|
-
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
367
367
|
VBtn: typeof import('vuetify/components')['VBtn']
|
|
368
368
|
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
369
369
|
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
370
|
-
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
371
|
-
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
372
370
|
VCard: typeof import('vuetify/components')['VCard']
|
|
373
371
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
374
372
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
|
375
373
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
|
376
374
|
VCardText: typeof import('vuetify/components')['VCardText']
|
|
377
375
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
378
|
-
|
|
376
|
+
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
377
|
+
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
379
378
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
380
379
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
380
|
+
VChip: typeof import('vuetify/components')['VChip']
|
|
381
381
|
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
382
382
|
VCode: typeof import('vuetify/components')['VCode']
|
|
383
383
|
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
384
384
|
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
385
385
|
VCounter: typeof import('vuetify/components')['VCounter']
|
|
386
|
+
VDialog: typeof import('vuetify/components')['VDialog']
|
|
386
387
|
VDivider: typeof import('vuetify/components')['VDivider']
|
|
387
388
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
388
389
|
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
|
|
389
390
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
|
390
391
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
|
391
|
-
VDialog: typeof import('vuetify/components')['VDialog']
|
|
392
392
|
VField: typeof import('vuetify/components')['VField']
|
|
393
393
|
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
394
394
|
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
@@ -402,7 +402,6 @@ declare module '@vue/runtime-core' {
|
|
|
402
402
|
VInput: typeof import('vuetify/components')['VInput']
|
|
403
403
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
404
404
|
VItem: typeof import('vuetify/components')['VItem']
|
|
405
|
-
VKbd: typeof import('vuetify/components')['VKbd']
|
|
406
405
|
VLabel: typeof import('vuetify/components')['VLabel']
|
|
407
406
|
VList: typeof import('vuetify/components')['VList']
|
|
408
407
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
|
@@ -418,33 +417,34 @@ declare module '@vue/runtime-core' {
|
|
|
418
417
|
VMessages: typeof import('vuetify/components')['VMessages']
|
|
419
418
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
420
419
|
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
421
|
-
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
422
420
|
VPagination: typeof import('vuetify/components')['VPagination']
|
|
421
|
+
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
423
422
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
424
423
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
|
425
424
|
VRating: typeof import('vuetify/components')['VRating']
|
|
426
|
-
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
427
425
|
VSelect: typeof import('vuetify/components')['VSelect']
|
|
426
|
+
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
428
427
|
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
428
|
+
VSheet: typeof import('vuetify/components')['VSheet']
|
|
429
429
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
430
430
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
431
431
|
VSlider: typeof import('vuetify/components')['VSlider']
|
|
432
432
|
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
433
|
-
VSheet: typeof import('vuetify/components')['VSheet']
|
|
434
433
|
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
434
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
435
435
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
436
436
|
VTab: typeof import('vuetify/components')['VTab']
|
|
437
|
-
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
438
437
|
VTable: typeof import('vuetify/components')['VTable']
|
|
439
438
|
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
440
439
|
VTextField: typeof import('vuetify/components')['VTextField']
|
|
441
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
442
440
|
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
443
441
|
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
444
442
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
445
443
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
446
444
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
445
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
447
446
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
448
447
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
448
|
+
VKbd: typeof import('vuetify/components')['VKbd']
|
|
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);
|
|
@@ -107,7 +110,8 @@ export const VDataTable = defineComponent({
|
|
|
107
110
|
sortBy,
|
|
108
111
|
pageCount,
|
|
109
112
|
startIndex,
|
|
110
|
-
stopIndex
|
|
113
|
+
stopIndex,
|
|
114
|
+
groupBy
|
|
111
115
|
});
|
|
112
116
|
provideDefaults({
|
|
113
117
|
VDataTableRows: {
|
|
@@ -124,7 +128,7 @@ export const VDataTable = defineComponent({
|
|
|
124
128
|
"height": props.height
|
|
125
129
|
}, {
|
|
126
130
|
top: slots.top,
|
|
127
|
-
default: slots.default
|
|
131
|
+
default: slots.default ?? (() => {
|
|
128
132
|
var _slots$colgroup, _slots$thead, _slots$tbody, _slots$tfoot;
|
|
129
133
|
return _createVNode(_Fragment, null, [(_slots$colgroup = slots.colgroup) == null ? void 0 : _slots$colgroup.call(slots, {
|
|
130
134
|
columns
|
|
@@ -135,10 +139,10 @@ export const VDataTable = defineComponent({
|
|
|
135
139
|
"items": paginatedItems.value,
|
|
136
140
|
"onClick:row": (event, value) => emit('click:row', event, value)
|
|
137
141
|
}, slots)]), (_slots$tbody = slots.tbody) == null ? void 0 : _slots$tbody.call(slots), (_slots$tfoot = slots.tfoot) == null ? void 0 : _slots$tfoot.call(slots)]);
|
|
138
|
-
},
|
|
139
|
-
bottom: slots.bottom
|
|
142
|
+
}),
|
|
143
|
+
bottom: slots.bottom ?? (() => _createVNode(VDataTableFooter, null, {
|
|
140
144
|
prepend: slots['footer.prepend']
|
|
141
|
-
})
|
|
145
|
+
}))
|
|
142
146
|
}));
|
|
143
147
|
return {};
|
|
144
148
|
}
|
|
@@ -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 ? 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 ? slots.bottom() : () => (\n <VDataTableFooter\n v-slots={{\n prepend: slots['footer.prep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AAG;QAAA;QAAA,yDAErCe,KAAK,CAACqB,QAAQ,qBAAd,qBAAArB,KAAK,EAAY;UAAEE;QAAQ,CAAC,CAAC,+BAE3BF,KAAK,CAACsB,OAAO,GAAGtB,KAAK,CAACsB,OAAO,EAAE;UAAA,UAEpB7B,KAAK,CAACJ,WAAW;UAAA,aACdI,KAAK,CAAC8B;QAAS,GACjBvB,KAAK,CAElB,oBAEDA,KAAK,CAACwB,KAAK,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;MACD4B,MAAM,EAAE5B,KAAK,CAAC4B,MAAM,GAAG5B,KAAK,CAAC4B,MAAM,EAAE,GAAG,2CAE3B;QACPC,OAAO,EAAE7B,KAAK,CAAC,gBAAgB;MACjC,CAAC;IAEJ,EAGN,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 groupBy,\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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CAEZ;QACPC,OAAO,EAAEjC,KAAK,CAAC,gBAAgB;MACjC,CAAC,CAEJ;IAAC,EAGP,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
@@ -21,7 +21,7 @@ export const VDataTableGroupHeaderRow = defineComponent({
|
|
|
21
21
|
slots
|
|
22
22
|
} = _ref;
|
|
23
23
|
const {
|
|
24
|
-
|
|
24
|
+
isGroupOpen,
|
|
25
25
|
toggleGroup,
|
|
26
26
|
extractRows
|
|
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,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