vuetify 3.4.0-beta.1 → 3.4.1
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 +1947 -1967
- package/dist/json/importMap.json +86 -86
- package/dist/json/tags.json +2 -7
- package/dist/json/web-types.json +3738 -3886
- package/dist/vuetify-labs.css +2203 -2195
- package/dist/vuetify-labs.d.ts +1977 -9281
- package/dist/vuetify-labs.esm.js +106 -90
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +106 -90
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +1361 -1353
- package/dist/vuetify.d.ts +2031 -9325
- package/dist/vuetify.esm.js +106 -90
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +106 -90
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +75 -74
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.mts +0 -2
- package/lib/blueprints/md1.d.mts +0 -2
- package/lib/blueprints/md2.d.mts +0 -2
- package/lib/blueprints/md3.d.mts +0 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs +3 -3
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +74 -98
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/index.d.mts +44 -69
- package/lib/components/VBtn/VBtn.css +0 -1
- package/lib/components/VBtn/VBtn.mjs +1 -1
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/_variables.scss +1 -1
- package/lib/components/VBtn/index.d.mts +11 -11
- package/lib/components/VBtnGroup/VBtnGroup.css +0 -1
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/index.d.mts +45 -71
- package/lib/components/VCarousel/VCarousel.mjs +1 -1
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/index.d.mts +73 -513
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +100 -482
- package/lib/components/VChip/index.d.mts +15 -18
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.d.mts +49 -189
- package/lib/components/VCombobox/VCombobox.mjs +3 -3
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.mts +74 -98
- package/lib/components/VDataIterator/index.d.mts +8 -6
- package/lib/components/VDataTable/VDataTable.css +3 -0
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTable.sass +2 -0
- package/lib/components/VDataTable/VDataTableRow.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableServer.mjs +2 -2
- package/lib/components/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableVirtual.mjs +4 -3
- package/lib/components/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/components/VDataTable/composables/items.mjs.map +1 -1
- package/lib/components/VDataTable/composables/paginate.mjs.map +1 -1
- package/lib/components/VDataTable/composables/select.mjs.map +1 -1
- package/lib/components/VDataTable/index.d.mts +431 -4162
- package/lib/components/VDataTable/types.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.css +4 -0
- package/lib/components/VDatePicker/VDatePicker.mjs +29 -22
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.sass +4 -0
- package/lib/components/VDatePicker/VDatePickerMonth.mjs +3 -1
- package/lib/components/VDatePicker/VDatePickerMonth.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/components/VDatePicker/index.d.mts +32 -36
- package/lib/components/VDialog/VDialog.css +4 -1
- package/lib/components/VDialog/VDialog.sass +4 -3
- package/lib/components/VField/VField.mjs +1 -1
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/index.d.mts +33 -41
- package/lib/components/VFileInput/index.d.mts +144 -385
- package/lib/components/VGrid/VSpacer.mjs +3 -0
- package/lib/components/VGrid/VSpacer.mjs.map +1 -1
- package/lib/components/VImg/VImg.mjs +10 -2
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VInput/VInput.mjs +1 -1
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.mts +72 -154
- package/lib/components/VItemGroup/VItemGroup.mjs +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.mts +49 -189
- package/lib/components/VList/VList.mjs +2 -2
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/index.d.mts +58 -95
- package/lib/components/VOtpInput/index.d.mts +8 -11
- package/lib/components/VRadio/index.d.mts +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.mts +77 -211
- package/lib/components/VRangeSlider/index.d.mts +22 -25
- package/lib/components/VSelect/VSelect.mjs +2 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.mts +67 -91
- package/lib/components/VSelectionControl/VSelectionControl.mjs +2 -2
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +9 -18
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/index.d.mts +46 -68
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.mts +47 -101
- package/lib/components/VSlider/index.d.mts +22 -25
- package/lib/components/VStepper/VStepperWindow.mjs +8 -6
- package/lib/components/VStepper/VStepperWindow.mjs.map +1 -1
- package/lib/components/VStepper/VStepperWindowItem.mjs +3 -1
- package/lib/components/VStepper/VStepperWindowItem.mjs.map +1 -1
- package/lib/components/VStepper/index.d.mts +18 -140
- package/lib/components/VSwitch/VSwitch.mjs +7 -5
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.mts +90 -303
- package/lib/components/VTextField/index.d.mts +173 -451
- package/lib/components/VTextarea/index.d.mts +144 -385
- package/lib/components/VValidation/VValidation.mjs +2 -2
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.d.mts +88 -359
- package/lib/components/VWindow/VWindow.mjs +1 -1
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/index.d.mts +58 -245
- package/lib/components/index.d.mts +1974 -9264
- package/lib/composables/date/DateAdapter.mjs.map +1 -1
- package/lib/composables/date/adapters/vuetify.mjs +1 -13
- package/lib/composables/date/adapters/vuetify.mjs.map +1 -1
- package/lib/composables/date/date.mjs +1 -1
- package/lib/composables/date/date.mjs.map +1 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/virtual.mjs +11 -13
- package/lib/composables/virtual.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.mts +24 -28
- package/lib/labs/VConfirmEdit/index.d.mts +0 -10
- package/lib/labs/components.d.mts +0 -10
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useDisplay } from "./display.mjs";
|
|
3
3
|
import { useResizeObserver } from "./resizeObserver.mjs"; // Utilities
|
|
4
4
|
import { computed, nextTick, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue';
|
|
5
|
-
import { clamp,
|
|
5
|
+
import { clamp, debounce, IN_BROWSER, propsFactory } from "../util/index.mjs"; // Types
|
|
6
6
|
const UP = -1;
|
|
7
7
|
const DOWN = 1;
|
|
8
8
|
|
|
@@ -52,11 +52,10 @@ export function useVirtual(props, items) {
|
|
|
52
52
|
const hasInitialRender = computed(() => {
|
|
53
53
|
return !!(containerRef.value && markerRef.value && viewportHeight.value && itemHeight.value);
|
|
54
54
|
});
|
|
55
|
-
const sizeMap = new Map();
|
|
56
55
|
let sizes = Array.from({
|
|
57
56
|
length: items.value.length
|
|
58
57
|
});
|
|
59
|
-
|
|
58
|
+
let offsets = Array.from({
|
|
60
59
|
length: items.value.length
|
|
61
60
|
});
|
|
62
61
|
const updateTime = shallowRef(0);
|
|
@@ -102,7 +101,6 @@ export function useVirtual(props, items) {
|
|
|
102
101
|
itemHeight.value = prevMinHeight ? Math.min(itemHeight.value, height) : height;
|
|
103
102
|
if (prevHeight !== height || prevMinHeight !== itemHeight.value) {
|
|
104
103
|
sizes[index] = height;
|
|
105
|
-
sizeMap.set(items.value[index], height);
|
|
106
104
|
updateOffsets();
|
|
107
105
|
}
|
|
108
106
|
}
|
|
@@ -186,17 +184,17 @@ export function useVirtual(props, items) {
|
|
|
186
184
|
index: index + first.value
|
|
187
185
|
}));
|
|
188
186
|
});
|
|
189
|
-
watch(
|
|
190
|
-
sizes =
|
|
191
|
-
|
|
192
|
-
const index = items.value.indexOf(item);
|
|
193
|
-
if (index === -1) {
|
|
194
|
-
sizeMap.delete(item);
|
|
195
|
-
} else {
|
|
196
|
-
sizes[index] = height;
|
|
197
|
-
}
|
|
187
|
+
watch(items, () => {
|
|
188
|
+
sizes = Array.from({
|
|
189
|
+
length: items.value.length
|
|
198
190
|
});
|
|
191
|
+
offsets = Array.from({
|
|
192
|
+
length: items.value.length
|
|
193
|
+
});
|
|
194
|
+
updateOffsets.immediate();
|
|
199
195
|
calculateVisibleItems();
|
|
196
|
+
}, {
|
|
197
|
+
deep: true
|
|
200
198
|
});
|
|
201
199
|
return {
|
|
202
200
|
containerRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual.mjs","names":["useDisplay","useResizeObserver","computed","nextTick","onScopeDispose","ref","shallowRef","watch","watchEffect","clamp","createRange","debounce","IN_BROWSER","propsFactory","UP","DOWN","BUFFER_PX","makeVirtualProps","itemHeight","type","Number","String","default","height","useVirtual","props","items","display","value","parseFloat","first","last","Math","ceil","parseInt","paddingTop","paddingBottom","containerRef","markerRef","markerOffset","resizeRef","contentRect","viewportHeight","document","documentElement","hasInitialRender","sizeMap","Map","sizes","Array","from","length","offsets","updateTime","targetScrollIndex","getSize","index","updateOffsets","start","performance","now","i","max","unwatch","v","offsetTop","immediate","calculateVisibleItems","window","requestAnimationFrame","scrollToIndex","val","oldVal","clear","handleItemResize","prevHeight","prevMinHeight","min","set","calculateOffset","calculateIndex","scrollTop","binaryClosest","lastScrollTop","scrollVelocity","lastScrollTime","handleScroll","scrollTime","scrollDeltaT","sign","handleScrollend","raf","cancelAnimationFrame","_calculateVisibleItems","direction","startPx","endPx","end","topOverflow","bottomOverflow","bufferOverflow","offset","computedItems","slice","map","item","raw","forEach","indexOf","delete","arr","high","low","mid","target"],"sources":["../../src/composables/virtual.ts"],"sourcesContent":["// Composables\nimport { useDisplay } from '@/composables/display'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { computed, nextTick, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue'\nimport {\n clamp,\n createRange,\n debounce,\n IN_BROWSER,\n propsFactory,\n} from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nconst UP = -1\nconst DOWN = 1\n\n/** Determines how large each batch of items should be */\nconst BUFFER_PX = 100\n\ntype VirtualProps = {\n itemHeight?: number | string\n height?: number | string\n}\n\nexport const makeVirtualProps = propsFactory({\n itemHeight: {\n type: [Number, String],\n default: null,\n },\n height: [Number, String],\n}, 'virtual')\n\nexport function useVirtual <T> (props: VirtualProps, items: Ref<readonly T[]>) {\n const display = useDisplay()\n\n const itemHeight = shallowRef(0)\n watchEffect(() => {\n itemHeight.value = parseFloat(props.itemHeight || 0)\n })\n\n const first = shallowRef(0)\n const last = shallowRef(Math.ceil(\n // Assume 16px items filling the entire screen height if\n // not provided. This is probably incorrect but it minimises\n // the chance of ending up with empty space at the bottom.\n // The default value is set here to avoid poisoning getSize()\n (parseInt(props.height!) || display.height.value) / (itemHeight.value || 16)\n ) || 1)\n const paddingTop = shallowRef(0)\n const paddingBottom = shallowRef(0)\n\n /** The scrollable element */\n const containerRef = ref<HTMLElement>()\n /** An element marking the top of the scrollable area,\n * used to add an offset if there's padding or other elements above the virtual list */\n const markerRef = ref<HTMLElement>()\n /** markerRef's offsetTop, lazily evaluated */\n let markerOffset = 0\n\n const { resizeRef, contentRect } = useResizeObserver()\n watchEffect(() => {\n resizeRef.value = containerRef.value\n })\n const viewportHeight = computed(() => {\n return containerRef.value === document.documentElement\n ? display.height.value\n : contentRect.value?.height || parseInt(props.height!) || 0\n })\n /** All static elements have been rendered and we have an assumed item height */\n const hasInitialRender = computed(() => {\n return !!(containerRef.value && markerRef.value && viewportHeight.value && itemHeight.value)\n })\n\n const sizeMap = new Map<any, number>()\n let sizes = Array.from<number | null>({ length: items.value.length })\n const offsets = Array.from<number>({ length: items.value.length })\n const updateTime = shallowRef(0)\n let targetScrollIndex = -1\n\n function getSize (index: number) {\n return sizes[index] || itemHeight.value\n }\n\n const updateOffsets = debounce(() => {\n const start = performance.now()\n offsets[0] = 0\n const length = items.value.length\n for (let i = 1; i <= length - 1; i++) {\n offsets[i] = (offsets[i - 1] || 0) + getSize(i - 1)\n }\n updateTime.value = Math.max(updateTime.value, performance.now() - start)\n }, updateTime)\n\n const unwatch = watch(hasInitialRender, v => {\n if (!v) return\n // First render is complete, update offsets and visible\n // items in case our assumed item height was incorrect\n\n unwatch()\n markerOffset = markerRef.value!.offsetTop\n updateOffsets.immediate()\n calculateVisibleItems()\n\n if (!~targetScrollIndex) return\n\n nextTick(() => {\n IN_BROWSER && window.requestAnimationFrame(() => {\n scrollToIndex(targetScrollIndex)\n targetScrollIndex = -1\n })\n })\n })\n watch(viewportHeight, (val, oldVal) => {\n oldVal && calculateVisibleItems()\n })\n\n onScopeDispose(() => {\n updateOffsets.clear()\n })\n\n function handleItemResize (index: number, height: number) {\n const prevHeight = sizes[index]\n const prevMinHeight = itemHeight.value\n\n itemHeight.value = prevMinHeight ? Math.min(itemHeight.value, height) : height\n\n if (prevHeight !== height || prevMinHeight !== itemHeight.value) {\n sizes[index] = height\n sizeMap.set(items.value[index], height)\n updateOffsets()\n }\n }\n\n function calculateOffset (index: number) {\n index = clamp(index, 0, items.value.length - 1)\n return offsets[index] || 0\n }\n\n function calculateIndex (scrollTop: number) {\n return binaryClosest(offsets, scrollTop)\n }\n\n let lastScrollTop = 0\n let scrollVelocity = 0\n let lastScrollTime = 0\n function handleScroll () {\n if (!containerRef.value || !markerRef.value) return\n\n const scrollTop = containerRef.value.scrollTop\n const scrollTime = performance.now()\n const scrollDeltaT = scrollTime - lastScrollTime\n\n if (scrollDeltaT > 500) {\n scrollVelocity = Math.sign(scrollTop - lastScrollTop)\n\n // Not super important, only update at the\n // start of a scroll sequence to avoid reflows\n markerOffset = markerRef.value.offsetTop\n } else {\n scrollVelocity = scrollTop - lastScrollTop\n }\n\n lastScrollTop = scrollTop\n lastScrollTime = scrollTime\n\n calculateVisibleItems()\n }\n function handleScrollend () {\n if (!containerRef.value || !markerRef.value) return\n\n scrollVelocity = 0\n lastScrollTime = 0\n\n calculateVisibleItems()\n }\n\n let raf = -1\n function calculateVisibleItems () {\n cancelAnimationFrame(raf)\n raf = requestAnimationFrame(_calculateVisibleItems)\n }\n function _calculateVisibleItems () {\n if (!containerRef.value || !viewportHeight.value) return\n const scrollTop = lastScrollTop - markerOffset\n const direction = Math.sign(scrollVelocity)\n\n const startPx = Math.max(0, scrollTop - BUFFER_PX)\n const start = clamp(calculateIndex(startPx), 0, items.value.length)\n\n const endPx = scrollTop + viewportHeight.value + BUFFER_PX\n const end = clamp(calculateIndex(endPx) + 1, start + 1, items.value.length)\n\n if (\n // Only update the side we're scrolling towards,\n // the other side will be updated incidentally\n (direction !== UP || start < first.value) &&\n (direction !== DOWN || end > last.value)\n ) {\n const topOverflow = calculateOffset(first.value) - calculateOffset(start)\n const bottomOverflow = calculateOffset(end) - calculateOffset(last.value)\n const bufferOverflow = Math.max(topOverflow, bottomOverflow)\n\n if (bufferOverflow > BUFFER_PX) {\n first.value = start\n last.value = end\n } else {\n // Only update the side that's reached its limit if there's still buffer left\n if (start <= 0) first.value = start\n if (end >= items.value.length) last.value = end\n }\n }\n\n paddingTop.value = calculateOffset(first.value)\n paddingBottom.value = calculateOffset(items.value.length) - calculateOffset(last.value)\n }\n\n function scrollToIndex (index: number) {\n const offset = calculateOffset(index)\n if (!containerRef.value || (index && !offset)) {\n targetScrollIndex = index\n } else {\n containerRef.value.scrollTop = offset\n }\n }\n\n const computedItems = computed(() => {\n return items.value.slice(first.value, last.value).map((item, index) => ({\n raw: item,\n index: index + first.value,\n }))\n })\n\n watch(() => items.value.length, () => {\n sizes = createRange(items.value.length).map(() => itemHeight.value)\n sizeMap.forEach((height, item) => {\n const index = items.value.indexOf(item)\n if (index === -1) {\n sizeMap.delete(item)\n } else {\n sizes[index] = height\n }\n })\n calculateVisibleItems()\n })\n\n return {\n containerRef,\n markerRef,\n computedItems,\n paddingTop,\n paddingBottom,\n scrollToIndex,\n handleScroll,\n handleScrollend,\n handleItemResize,\n }\n}\n\n// https://gist.github.com/robertleeplummerjr/1cc657191d34ecd0a324\nfunction binaryClosest (arr: ArrayLike<number>, val: number) {\n let high = arr.length - 1\n let low = 0\n let mid = 0\n let item = null\n let target = -1\n\n if (arr[high]! < val) {\n return high\n }\n\n while (low <= high) {\n mid = (low + high) >> 1\n item = arr[mid]!\n\n if (item > val) {\n high = mid - 1\n } else if (item < val) {\n target = mid\n low = mid + 1\n } else if (item === val) {\n return mid\n } else {\n return low\n }\n }\n\n return target\n}\n"],"mappings":"AAAA;AAAA,SACSA,UAAU;AAAA,SACVC,iBAAiB,gCAE1B;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,EAAEC,WAAW,QAAQ,KAAK;AAAA,SAE3FC,KAAK,EACLC,WAAW,EACXC,QAAQ,EACRC,UAAU,EACVC,YAAY,6BAGd;AAGA,MAAMC,EAAE,GAAG,CAAC,CAAC;AACb,MAAMC,IAAI,GAAG,CAAC;;AAEd;AACA,MAAMC,SAAS,GAAG,GAAG;AAOrB,OAAO,MAAMC,gBAAgB,GAAGJ,YAAY,CAAC;EAC3CK,UAAU,EAAE;IACVC,IAAI,EAAE,CAACC,MAAM,EAAEC,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE,CAACH,MAAM,EAAEC,MAAM;AACzB,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,SAASG,UAAUA,CAAMC,KAAmB,EAAEC,KAAwB,EAAE;EAC7E,MAAMC,OAAO,GAAG3B,UAAU,EAAE;EAE5B,MAAMkB,UAAU,GAAGZ,UAAU,CAAC,CAAC,CAAC;EAChCE,WAAW,CAAC,MAAM;IAChBU,UAAU,CAACU,KAAK,GAAGC,UAAU,CAACJ,KAAK,CAACP,UAAU,IAAI,CAAC,CAAC;EACtD,CAAC,CAAC;EAEF,MAAMY,KAAK,GAAGxB,UAAU,CAAC,CAAC,CAAC;EAC3B,MA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CAAC,CAAC,EAAE;QAChBV,OAAO,CAAC+D,MAAM,CAACJ,IAAI,CAAC;MACtB,CAAC,MAAM;QACLzD,KAAK,CAACQ,KAAK,CAAC,GAAGjC,MAAM;MACvB;IACF,CAAC,CAAC;IACF4C,qBAAqB,EAAE;EACzB,CAAC,CAAC;EAEF,OAAO;IACL9B,YAAY;IACZC,SAAS;IACTgE,aAAa;IACbnE,UAAU;IACVC,aAAa;IACbkC,aAAa;IACbgB,YAAY;IACZI,eAAe;IACfhB;EACF,CAAC;AACH;;AAEA;AACA,SAASQ,aAAaA,CAAE4B,GAAsB,EAAEvC,GAAW,EAAE;EAC3D,IAAIwC,IAAI,GAAGD,GAAG,CAAC3D,MAAM,GAAG,CAAC;EACzB,IAAI6D,GAAG,GAAG,CAAC;EACX,IAAIC,GAAG,GAAG,CAAC;EACX,IAAIR,IAAI,GAAG,IAAI;EACf,IAAIS,MAAM,GAAG,CAAC,CAAC;EAEf,IAAIJ,GAAG,CAACC,IAAI,CAAC,GAAIxC,GAAG,EAAE;IACpB,OAAOwC,IAAI;EACb;EAEA,OAAOC,GAAG,IAAID,IAAI,EAAE;IAClBE,GAAG,GAAID,GAAG,GAAGD,IAAI,IAAK,CAAC;IACvBN,IAAI,GAAGK,GAAG,CAACG,GAAG,CAAE;IAEhB,IAAIR,IAAI,GAAGlC,GAAG,EAAE;MACdwC,IAAI,GAAGE,GAAG,GAAG,CAAC;IAChB,CAAC,MAAM,IAAIR,IAAI,GAAGlC,GAAG,EAAE;MACrB2C,MAAM,GAAGD,GAAG;MACZD,GAAG,GAAGC,GAAG,GAAG,CAAC;IACf,CAAC,MAAM,IAAIR,IAAI,KAAKlC,GAAG,EAAE;MACvB,OAAO0C,GAAG;IACZ,CAAC,MAAM;MACL,OAAOD,GAAG;IACZ;EACF;EAEA,OAAOE,MAAM;AACf"}
|
|
1
|
+
{"version":3,"file":"virtual.mjs","names":["useDisplay","useResizeObserver","computed","nextTick","onScopeDispose","ref","shallowRef","watch","watchEffect","clamp","debounce","IN_BROWSER","propsFactory","UP","DOWN","BUFFER_PX","makeVirtualProps","itemHeight","type","Number","String","default","height","useVirtual","props","items","display","value","parseFloat","first","last","Math","ceil","parseInt","paddingTop","paddingBottom","containerRef","markerRef","markerOffset","resizeRef","contentRect","viewportHeight","document","documentElement","hasInitialRender","sizes","Array","from","length","offsets","updateTime","targetScrollIndex","getSize","index","updateOffsets","start","performance","now","i","max","unwatch","v","offsetTop","immediate","calculateVisibleItems","window","requestAnimationFrame","scrollToIndex","val","oldVal","clear","handleItemResize","prevHeight","prevMinHeight","min","calculateOffset","calculateIndex","scrollTop","binaryClosest","lastScrollTop","scrollVelocity","lastScrollTime","handleScroll","scrollTime","scrollDeltaT","sign","handleScrollend","raf","cancelAnimationFrame","_calculateVisibleItems","direction","startPx","endPx","end","topOverflow","bottomOverflow","bufferOverflow","offset","computedItems","slice","map","item","raw","deep","arr","high","low","mid","target"],"sources":["../../src/composables/virtual.ts"],"sourcesContent":["// Composables\nimport { useDisplay } from '@/composables/display'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { computed, nextTick, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue'\nimport { clamp, debounce, IN_BROWSER, propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nconst UP = -1\nconst DOWN = 1\n\n/** Determines how large each batch of items should be */\nconst BUFFER_PX = 100\n\ntype VirtualProps = {\n itemHeight?: number | string\n height?: number | string\n}\n\nexport const makeVirtualProps = propsFactory({\n itemHeight: {\n type: [Number, String],\n default: null,\n },\n height: [Number, String],\n}, 'virtual')\n\nexport function useVirtual <T> (props: VirtualProps, items: Ref<readonly T[]>) {\n const display = useDisplay()\n\n const itemHeight = shallowRef(0)\n watchEffect(() => {\n itemHeight.value = parseFloat(props.itemHeight || 0)\n })\n\n const first = shallowRef(0)\n const last = shallowRef(Math.ceil(\n // Assume 16px items filling the entire screen height if\n // not provided. This is probably incorrect but it minimises\n // the chance of ending up with empty space at the bottom.\n // The default value is set here to avoid poisoning getSize()\n (parseInt(props.height!) || display.height.value) / (itemHeight.value || 16)\n ) || 1)\n const paddingTop = shallowRef(0)\n const paddingBottom = shallowRef(0)\n\n /** The scrollable element */\n const containerRef = ref<HTMLElement>()\n /** An element marking the top of the scrollable area,\n * used to add an offset if there's padding or other elements above the virtual list */\n const markerRef = ref<HTMLElement>()\n /** markerRef's offsetTop, lazily evaluated */\n let markerOffset = 0\n\n const { resizeRef, contentRect } = useResizeObserver()\n watchEffect(() => {\n resizeRef.value = containerRef.value\n })\n const viewportHeight = computed(() => {\n return containerRef.value === document.documentElement\n ? display.height.value\n : contentRect.value?.height || parseInt(props.height!) || 0\n })\n /** All static elements have been rendered and we have an assumed item height */\n const hasInitialRender = computed(() => {\n return !!(containerRef.value && markerRef.value && viewportHeight.value && itemHeight.value)\n })\n\n let sizes = Array.from<number | null>({ length: items.value.length })\n let offsets = Array.from<number>({ length: items.value.length })\n const updateTime = shallowRef(0)\n let targetScrollIndex = -1\n\n function getSize (index: number) {\n return sizes[index] || itemHeight.value\n }\n\n const updateOffsets = debounce(() => {\n const start = performance.now()\n offsets[0] = 0\n const length = items.value.length\n for (let i = 1; i <= length - 1; i++) {\n offsets[i] = (offsets[i - 1] || 0) + getSize(i - 1)\n }\n updateTime.value = Math.max(updateTime.value, performance.now() - start)\n }, updateTime)\n\n const unwatch = watch(hasInitialRender, v => {\n if (!v) return\n // First render is complete, update offsets and visible\n // items in case our assumed item height was incorrect\n\n unwatch()\n markerOffset = markerRef.value!.offsetTop\n updateOffsets.immediate()\n calculateVisibleItems()\n\n if (!~targetScrollIndex) return\n\n nextTick(() => {\n IN_BROWSER && window.requestAnimationFrame(() => {\n scrollToIndex(targetScrollIndex)\n targetScrollIndex = -1\n })\n })\n })\n watch(viewportHeight, (val, oldVal) => {\n oldVal && calculateVisibleItems()\n })\n\n onScopeDispose(() => {\n updateOffsets.clear()\n })\n\n function handleItemResize (index: number, height: number) {\n const prevHeight = sizes[index]\n const prevMinHeight = itemHeight.value\n\n itemHeight.value = prevMinHeight ? Math.min(itemHeight.value, height) : height\n\n if (prevHeight !== height || prevMinHeight !== itemHeight.value) {\n sizes[index] = height\n updateOffsets()\n }\n }\n\n function calculateOffset (index: number) {\n index = clamp(index, 0, items.value.length - 1)\n return offsets[index] || 0\n }\n\n function calculateIndex (scrollTop: number) {\n return binaryClosest(offsets, scrollTop)\n }\n\n let lastScrollTop = 0\n let scrollVelocity = 0\n let lastScrollTime = 0\n function handleScroll () {\n if (!containerRef.value || !markerRef.value) return\n\n const scrollTop = containerRef.value.scrollTop\n const scrollTime = performance.now()\n const scrollDeltaT = scrollTime - lastScrollTime\n\n if (scrollDeltaT > 500) {\n scrollVelocity = Math.sign(scrollTop - lastScrollTop)\n\n // Not super important, only update at the\n // start of a scroll sequence to avoid reflows\n markerOffset = markerRef.value.offsetTop\n } else {\n scrollVelocity = scrollTop - lastScrollTop\n }\n\n lastScrollTop = scrollTop\n lastScrollTime = scrollTime\n\n calculateVisibleItems()\n }\n function handleScrollend () {\n if (!containerRef.value || !markerRef.value) return\n\n scrollVelocity = 0\n lastScrollTime = 0\n\n calculateVisibleItems()\n }\n\n let raf = -1\n function calculateVisibleItems () {\n cancelAnimationFrame(raf)\n raf = requestAnimationFrame(_calculateVisibleItems)\n }\n function _calculateVisibleItems () {\n if (!containerRef.value || !viewportHeight.value) return\n const scrollTop = lastScrollTop - markerOffset\n const direction = Math.sign(scrollVelocity)\n\n const startPx = Math.max(0, scrollTop - BUFFER_PX)\n const start = clamp(calculateIndex(startPx), 0, items.value.length)\n\n const endPx = scrollTop + viewportHeight.value + BUFFER_PX\n const end = clamp(calculateIndex(endPx) + 1, start + 1, items.value.length)\n\n if (\n // Only update the side we're scrolling towards,\n // the other side will be updated incidentally\n (direction !== UP || start < first.value) &&\n (direction !== DOWN || end > last.value)\n ) {\n const topOverflow = calculateOffset(first.value) - calculateOffset(start)\n const bottomOverflow = calculateOffset(end) - calculateOffset(last.value)\n const bufferOverflow = Math.max(topOverflow, bottomOverflow)\n\n if (bufferOverflow > BUFFER_PX) {\n first.value = start\n last.value = end\n } else {\n // Only update the side that's reached its limit if there's still buffer left\n if (start <= 0) first.value = start\n if (end >= items.value.length) last.value = end\n }\n }\n\n paddingTop.value = calculateOffset(first.value)\n paddingBottom.value = calculateOffset(items.value.length) - calculateOffset(last.value)\n }\n\n function scrollToIndex (index: number) {\n const offset = calculateOffset(index)\n if (!containerRef.value || (index && !offset)) {\n targetScrollIndex = index\n } else {\n containerRef.value.scrollTop = offset\n }\n }\n\n const computedItems = computed(() => {\n return items.value.slice(first.value, last.value).map((item, index) => ({\n raw: item,\n index: index + first.value,\n }))\n })\n\n watch(items, () => {\n sizes = Array.from({ length: items.value.length })\n offsets = Array.from({ length: items.value.length })\n updateOffsets.immediate()\n calculateVisibleItems()\n }, { deep: true })\n\n return {\n containerRef,\n markerRef,\n computedItems,\n paddingTop,\n paddingBottom,\n scrollToIndex,\n handleScroll,\n handleScrollend,\n handleItemResize,\n }\n}\n\n// https://gist.github.com/robertleeplummerjr/1cc657191d34ecd0a324\nfunction binaryClosest (arr: ArrayLike<number>, val: number) {\n let high = arr.length - 1\n let low = 0\n let mid = 0\n let item = null\n let target = -1\n\n if (arr[high]! < val) {\n return high\n }\n\n while (low <= high) {\n mid = (low + high) >> 1\n item = arr[mid]!\n\n if (item > val) {\n high = mid - 1\n } else if (item < val) {\n target = mid\n low = mid + 1\n } else if (item === val) {\n return mid\n } else {\n return low\n }\n }\n\n return target\n}\n"],"mappings":"AAAA;AAAA,SACSA,UAAU;AAAA,SACVC,iBAAiB,gCAE1B;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,EAAEC,WAAW,QAAQ,KAAK;AAAA,SACpFC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,YAAY,6BAElD;AAGA,MAAMC,EAAE,GAAG,CAAC,CAAC;AACb,MAAMC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GAAG;MACZD,GAAG,GAAGC,GAAG,GAAG,CAAC;IACf,CAAC,MAAM,IAAIN,IAAI,KAAKjC,GAAG,EAAE;MACvB,OAAOuC,GAAG;IACZ,CAAC,MAAM;MACL,OAAOD,GAAG;IACZ;EACF;EAEA,OAAOE,MAAM;AACf"}
|
package/lib/entry-bundler.mjs
CHANGED
|
@@ -15,7 +15,7 @@ export const createVuetify = function () {
|
|
|
15
15
|
...options
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
export const version = "3.4.
|
|
18
|
+
export const version = "3.4.1";
|
|
19
19
|
createVuetify.version = version;
|
|
20
20
|
export { components, directives };
|
|
21
21
|
export * from "./composables/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-bundler.mjs","names":["components","directives","createVuetify","_createVuetify","options","arguments","length","undefined","version"],"sources":["../src/entry-bundler.ts"],"sourcesContent":["/* eslint-disable local-rules/sort-imports */\n\n// Styles\nimport './styles/main.sass'\n\n// Components\nimport * as components from './components'\nimport * as directives from './directives'\nimport { createVuetify as _createVuetify } from './framework'\n\n// Types\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;;AAEA;AACA;;AAEA;AAAA,OACO,KAAKA,UAAU;AAAA,OACf,KAAKC,UAAU;AAAA,SACbC,aAAa,IAAIC,cAAc,2BAExC;AAGA,OAAO,MAAMD,aAAa,GAAG,SAAAA,CAAA,EAAkC;EAAA,IAAjCE,OAAuB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACxD,OAAOF,cAAc,CAAC;IAAEH,UAAU;IAAEC,UAAU;IAAE,GAAGG;EAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,OAAO,MAAMI,OAAO,
|
|
1
|
+
{"version":3,"file":"entry-bundler.mjs","names":["components","directives","createVuetify","_createVuetify","options","arguments","length","undefined","version"],"sources":["../src/entry-bundler.ts"],"sourcesContent":["/* eslint-disable local-rules/sort-imports */\n\n// Styles\nimport './styles/main.sass'\n\n// Components\nimport * as components from './components'\nimport * as directives from './directives'\nimport { createVuetify as _createVuetify } from './framework'\n\n// Types\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;;AAEA;AACA;;AAEA;AAAA,OACO,KAAKA,UAAU;AAAA,OACf,KAAKC,UAAU;AAAA,SACbC,aAAa,IAAIC,cAAc,2BAExC;AAGA,OAAO,MAAMD,aAAa,GAAG,SAAAA,CAAA,EAAkC;EAAA,IAAjCE,OAAuB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACxD,OAAOF,cAAc,CAAC;IAAEH,UAAU;IAAEC,UAAU;IAAE,GAAGG;EAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,OAAO,MAAMI,OAAO,UAAsB;AAC1CN,aAAa,CAACM,OAAO,GAAGA,OAAO;AAE/B,SACER,UAAU,EACVC,UAAU;AACX"}
|
package/lib/framework.mjs
CHANGED
package/lib/framework.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.mjs","names":["createDate","DateAdapterSymbol","createDefaults","DefaultsSymbol","createDisplay","DisplaySymbol","createIcons","IconSymbol","createLocale","LocaleSymbol","createTheme","ThemeSymbol","nextTick","reactive","defineComponent","getUid","IN_BROWSER","mergeDeep","createVuetify","vuetify","arguments","length","undefined","blueprint","rest","options","aliases","components","directives","defaults","display","ssr","theme","icons","locale","date","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 { createDate, DateAdapterSymbol } from '@/composables/date'\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 { nextTick, reactive } from 'vue'\nimport { defineComponent, getUid, IN_BROWSER, mergeDeep } from '@/util'\n\n// Types\nimport type { App, ComponentPublicInstance, InjectionKey } from 'vue'\nimport type { DateOptions } from '@/composables/date'\nimport type { DefaultsOptions } from '@/composables/defaults'\nimport type { DisplayOptions, SSROptions } from '@/composables/display'\nimport type { IconOptions } from '@/composables/icons'\nimport type { LocaleOptions, RtlOptions } from '@/composables/locale'\nimport type { ThemeOptions } from '@/composables/theme'\nexport * from './composables'\nexport type { DateOptions, DateInstance } from '@/composables/date'\n\nexport interface VuetifyOptions {\n aliases?: Record<string, any>\n blueprint?: Blueprint\n components?: Record<string, any>\n date?: DateOptions\n directives?: Record<string, any>\n defaults?: DefaultsOptions\n display?: DisplayOptions\n theme?: ThemeOptions\n icons?: IconOptions\n locale?: LocaleOptions & RtlOptions\n ssr?: SSROptions\n}\n\nexport interface Blueprint extends Omit<VuetifyOptions, 'blueprint'> {}\n\nexport function createVuetify (vuetify: VuetifyOptions = {}) {\n const { blueprint, ...rest } = vuetify\n const options: VuetifyOptions = 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 const date = createDate(options.date, 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 app.provide(DateAdapterSymbol, date)\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 date: inject.call(this, DateAdapterSymbol),\n })\n },\n },\n })\n }\n }\n\n return {\n install,\n defaults,\n display,\n theme,\n icons,\n locale,\n date,\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,UAAU,EAAEC,iBAAiB;AAAA,SAC7BC,cAAc,EAAEC,cAAc;AAAA,SAC9BC,aAAa,EAAEC,aAAa;AAAA,SAC5BC,WAAW,EAAEC,UAAU;AAAA,SACvBC,YAAY,EAAEC,YAAY;AAAA,SAC1BC,WAAW,EAAEC,WAAW,m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KAAK,SAAS,IAAIA,mBAAmB,EAAE;MACnEb,GAAG,CAACc,KAAK,CAAC;QACRC,QAAQ,EAAE;UACRC,QAAQA,CAAA,EAAI;YACV,OAAOxC,QAAQ,CAAC;cACdgB,QAAQ,EAAEyB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEpD,cAAc,CAAC;cAC3C2B,OAAO,EAAEwB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAElD,aAAa,CAAC;cACzC2B,KAAK,EAAEsB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE5C,WAAW,CAAC;cACrCsB,KAAK,EAAEqB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEhD,UAAU,CAAC;cACpC2B,MAAM,EAAEoB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE9C,YAAY,CAAC;cACvC0B,IAAI,EAAEmB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEtD,iBAAiB;YAC3C,CAAC,CAAC;UACJ;QACF;MACF,CAAC,CAAC;IACJ;EACF,CAAC;EAED,OAAO;IACLmC,OAAO;IACPP,QAAQ;IACRC,OAAO;IACPE,KAAK;IACLC,KAAK;IACLC,MAAM;IACNC;EACF,CAAC;AACH;AAEA,OAAO,MAAMqB,OAAO,
|
|
1
|
+
{"version":3,"file":"framework.mjs","names":["createDate","DateAdapterSymbol","createDefaults","DefaultsSymbol","createDisplay","DisplaySymbol","createIcons","IconSymbol","createLocale","LocaleSymbol","createTheme","ThemeSymbol","nextTick","reactive","defineComponent","getUid","IN_BROWSER","mergeDeep","createVuetify","vuetify","arguments","length","undefined","blueprint","rest","options","aliases","components","directives","defaults","display","ssr","theme","icons","locale","date","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 { createDate, DateAdapterSymbol } from '@/composables/date'\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 { nextTick, reactive } from 'vue'\nimport { defineComponent, getUid, IN_BROWSER, mergeDeep } from '@/util'\n\n// Types\nimport type { App, ComponentPublicInstance, InjectionKey } from 'vue'\nimport type { DateOptions } from '@/composables/date'\nimport type { DefaultsOptions } from '@/composables/defaults'\nimport type { DisplayOptions, SSROptions } from '@/composables/display'\nimport type { IconOptions } from '@/composables/icons'\nimport type { LocaleOptions, RtlOptions } from '@/composables/locale'\nimport type { ThemeOptions } from '@/composables/theme'\nexport * from './composables'\nexport type { DateOptions, DateInstance } from '@/composables/date'\n\nexport interface VuetifyOptions {\n aliases?: Record<string, any>\n blueprint?: Blueprint\n components?: Record<string, any>\n date?: DateOptions\n directives?: Record<string, any>\n defaults?: DefaultsOptions\n display?: DisplayOptions\n theme?: ThemeOptions\n icons?: IconOptions\n locale?: LocaleOptions & RtlOptions\n ssr?: SSROptions\n}\n\nexport interface Blueprint extends Omit<VuetifyOptions, 'blueprint'> {}\n\nexport function createVuetify (vuetify: VuetifyOptions = {}) {\n const { blueprint, ...rest } = vuetify\n const options: VuetifyOptions = 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 const date = createDate(options.date, 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 app.provide(DateAdapterSymbol, date)\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 date: inject.call(this, DateAdapterSymbol),\n })\n },\n },\n })\n }\n }\n\n return {\n install,\n defaults,\n display,\n theme,\n icons,\n locale,\n date,\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,UAAU,EAAEC,iBAAiB;AAAA,SAC7BC,cAAc,EAAEC,cAAc;AAAA,SAC9BC,aAAa,EAAEC,aAAa;AAAA,SAC5BC,WAAW,EAAEC,UAAU;AAAA,SACvBC,YAAY,EAAEC,YAAY;AAAA,SAC1BC,WAAW,EAAEC,WAAW,mCAEjC;AACA,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;AAAA,SAC/BC,eAAe,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS,4BAEvD;AAAA;AA2BA,OAAO,SAASC,aAAaA,CAAA,EAAgC;EAAA,IAA9BC,OAAuB,GAAAC,SAAA,CAA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AC;cAC3C2B,OAAO,EAAEwB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAElD,aAAa,CAAC;cACzC2B,KAAK,EAAEsB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE5C,WAAW,CAAC;cACrCsB,KAAK,EAAEqB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEhD,UAAU,CAAC;cACpC2B,MAAM,EAAEoB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE9C,YAAY,CAAC;cACvC0B,IAAI,EAAEmB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEtD,iBAAiB;YAC3C,CAAC,CAAC;UACJ;QACF;MACF,CAAC,CAAC;IACJ;EACF,CAAC;EAED,OAAO;IACLmC,OAAO;IACPP,QAAQ;IACRC,OAAO;IACPE,KAAK;IACLC,KAAK;IACLC,MAAM;IACNC;EACF,CAAC;AACH;AAEA,OAAO,MAAMqB,OAAO,UAAsB;AAC1CtC,aAAa,CAACsC,OAAO,GAAGA,OAAO;;AAE/B;AACA,SAASF,MAAMA,CAAiChB,GAA+B,EAAE;EAC/E,MAAMU,EAAE,GAAG,IAAI,CAACS,CAAC;EAEjB,MAAMC,QAAQ,GAAGV,EAAE,CAACW,MAAM,EAAED,QAAQ,IAAIV,EAAE,CAACY,KAAK,CAACC,UAAU,EAAEH,QAAQ;EAErE,IAAIA,QAAQ,IAAKpB,GAAG,IAAYoB,QAAQ,EAAE;IACxC,OAAOA,QAAQ,CAAEpB,GAAG,CAAY;EAClC;AACF"}
|
package/lib/index.d.mts
CHANGED
|
@@ -207,9 +207,7 @@ interface DateAdapter<T = unknown> {
|
|
|
207
207
|
addDays(date: T, amount: number): T;
|
|
208
208
|
addMonths(date: T, amount: number): T;
|
|
209
209
|
getYear(date: T): number;
|
|
210
|
-
getNextYear(date: T): T;
|
|
211
210
|
setYear(date: T, year: number): T;
|
|
212
|
-
getDate(date: T): number;
|
|
213
211
|
getDiff(date: T, comparing: T | string, unit?: string): number;
|
|
214
212
|
getWeekArray(date: T): T[][];
|
|
215
213
|
getWeekdays(): string[];
|
|
@@ -378,9 +376,7 @@ declare function createVuetify(vuetify?: VuetifyOptions): {
|
|
|
378
376
|
addDays: (date: unknown, amount: number) => unknown;
|
|
379
377
|
addMonths: (date: unknown, amount: number) => unknown;
|
|
380
378
|
getYear: (date: unknown) => number;
|
|
381
|
-
getNextYear: (date: unknown) => unknown;
|
|
382
379
|
setYear: (date: unknown, year: number) => unknown;
|
|
383
|
-
getDate: (date: unknown) => number;
|
|
384
380
|
getDiff: (date: unknown, comparing: unknown, unit?: string | undefined) => number;
|
|
385
381
|
getWeekArray: (date: unknown) => unknown[][];
|
|
386
382
|
getWeekdays: () => string[];
|
|
@@ -438,25 +434,20 @@ declare module '@vue/runtime-core' {
|
|
|
438
434
|
|
|
439
435
|
export interface GlobalComponents {
|
|
440
436
|
VApp: typeof import('vuetify/components')['VApp']
|
|
437
|
+
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
441
438
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
442
439
|
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
443
440
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
444
|
-
VAlert: typeof import('vuetify/components')['VAlert']
|
|
445
|
-
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
446
|
-
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
447
|
-
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
448
441
|
VBadge: typeof import('vuetify/components')['VBadge']
|
|
442
|
+
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
449
443
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
450
444
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
451
445
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
452
446
|
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
453
447
|
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
448
|
+
VAlert: typeof import('vuetify/components')['VAlert']
|
|
449
|
+
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
457
450
|
VBtn: typeof import('vuetify/components')['VBtn']
|
|
458
|
-
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
459
|
-
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
460
451
|
VCard: typeof import('vuetify/components')['VCard']
|
|
461
452
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
462
453
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
|
@@ -465,12 +456,16 @@ declare module '@vue/runtime-core' {
|
|
|
465
456
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
466
457
|
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
467
458
|
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
459
|
+
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
460
|
+
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
461
|
+
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
462
|
+
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
468
463
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
469
464
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
465
|
+
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
470
466
|
VChip: typeof import('vuetify/components')['VChip']
|
|
471
|
-
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
472
467
|
VCode: typeof import('vuetify/components')['VCode']
|
|
473
|
-
|
|
468
|
+
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
474
469
|
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
475
470
|
VCounter: typeof import('vuetify/components')['VCounter']
|
|
476
471
|
VDataTable: typeof import('vuetify/components')['VDataTable']
|
|
@@ -485,16 +480,17 @@ declare module '@vue/runtime-core' {
|
|
|
485
480
|
VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
|
|
486
481
|
VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
|
|
487
482
|
VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
|
|
483
|
+
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
488
484
|
VDialog: typeof import('vuetify/components')['VDialog']
|
|
489
485
|
VDivider: typeof import('vuetify/components')['VDivider']
|
|
486
|
+
VField: typeof import('vuetify/components')['VField']
|
|
487
|
+
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
490
488
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
491
489
|
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
|
|
492
490
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
|
493
491
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
|
494
|
-
VField: typeof import('vuetify/components')['VField']
|
|
495
|
-
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
496
|
-
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
497
492
|
VFooter: typeof import('vuetify/components')['VFooter']
|
|
493
|
+
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
498
494
|
VIcon: typeof import('vuetify/components')['VIcon']
|
|
499
495
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
|
500
496
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
|
@@ -502,9 +498,9 @@ declare module '@vue/runtime-core' {
|
|
|
502
498
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
503
499
|
VImg: typeof import('vuetify/components')['VImg']
|
|
504
500
|
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
|
505
|
-
VInput: typeof import('vuetify/components')['VInput']
|
|
506
501
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
507
502
|
VItem: typeof import('vuetify/components')['VItem']
|
|
503
|
+
VInput: typeof import('vuetify/components')['VInput']
|
|
508
504
|
VKbd: typeof import('vuetify/components')['VKbd']
|
|
509
505
|
VLabel: typeof import('vuetify/components')['VLabel']
|
|
510
506
|
VList: typeof import('vuetify/components')['VList']
|
|
@@ -519,9 +515,9 @@ declare module '@vue/runtime-core' {
|
|
|
519
515
|
VMain: typeof import('vuetify/components')['VMain']
|
|
520
516
|
VMenu: typeof import('vuetify/components')['VMenu']
|
|
521
517
|
VMessages: typeof import('vuetify/components')['VMessages']
|
|
518
|
+
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
522
519
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
523
520
|
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
|
524
|
-
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
525
521
|
VPagination: typeof import('vuetify/components')['VPagination']
|
|
526
522
|
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
527
523
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
@@ -529,11 +525,11 @@ declare module '@vue/runtime-core' {
|
|
|
529
525
|
VRating: typeof import('vuetify/components')['VRating']
|
|
530
526
|
VSelect: typeof import('vuetify/components')['VSelect']
|
|
531
527
|
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
532
|
-
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
533
528
|
VSheet: typeof import('vuetify/components')['VSheet']
|
|
534
|
-
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
535
529
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
536
530
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
531
|
+
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
532
|
+
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
537
533
|
VSlider: typeof import('vuetify/components')['VSlider']
|
|
538
534
|
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
539
535
|
VStepper: typeof import('vuetify/components')['VStepper']
|
|
@@ -542,21 +538,21 @@ declare module '@vue/runtime-core' {
|
|
|
542
538
|
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
|
543
539
|
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
|
544
540
|
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
|
545
|
-
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
546
|
-
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
547
541
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
548
542
|
VTab: typeof import('vuetify/components')['VTab']
|
|
543
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
544
|
+
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
549
545
|
VTable: typeof import('vuetify/components')['VTable']
|
|
550
546
|
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
551
|
-
VTextField: typeof import('vuetify/components')['VTextField']
|
|
552
547
|
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
553
548
|
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
549
|
+
VTextField: typeof import('vuetify/components')['VTextField']
|
|
554
550
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
555
551
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
556
552
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
557
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
558
553
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
559
554
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
555
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
560
556
|
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
|
561
557
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
562
558
|
VForm: typeof import('vuetify/components')['VForm']
|
|
@@ -571,12 +567,12 @@ declare module '@vue/runtime-core' {
|
|
|
571
567
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
572
568
|
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
573
569
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
574
|
-
VRadio: typeof import('vuetify/components')['VRadio']
|
|
575
570
|
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
571
|
+
VRadio: typeof import('vuetify/components')['VRadio']
|
|
576
572
|
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
577
573
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
578
|
-
VValidation: typeof import('vuetify/components')['VValidation']
|
|
579
574
|
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
|
575
|
+
VValidation: typeof import('vuetify/components')['VValidation']
|
|
580
576
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
|
581
577
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
|
582
578
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
|
@@ -47,8 +47,6 @@ declare const VConfirmEdit: {
|
|
|
47
47
|
cancelText: string;
|
|
48
48
|
okText: string;
|
|
49
49
|
color?: string | undefined;
|
|
50
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
51
|
-
onSave?: ((value: any) => any) | undefined;
|
|
52
50
|
onCancel?: (() => any) | undefined;
|
|
53
51
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
|
|
54
52
|
cancelText: string;
|
|
@@ -56,8 +54,6 @@ declare const VConfirmEdit: {
|
|
|
56
54
|
} & {
|
|
57
55
|
color?: string | undefined;
|
|
58
56
|
} & {
|
|
59
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
60
|
-
onSave?: ((value: any) => any) | undefined;
|
|
61
57
|
onCancel?: (() => any) | undefined;
|
|
62
58
|
}, "cancelText" | "okText">;
|
|
63
59
|
$attrs: {
|
|
@@ -86,8 +82,6 @@ declare const VConfirmEdit: {
|
|
|
86
82
|
} & {
|
|
87
83
|
color?: string | undefined;
|
|
88
84
|
} & {
|
|
89
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
90
|
-
onSave?: ((value: any) => any) | undefined;
|
|
91
85
|
onCancel?: (() => any) | undefined;
|
|
92
86
|
}, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
93
87
|
cancel: () => true;
|
|
@@ -131,8 +125,6 @@ declare const VConfirmEdit: {
|
|
|
131
125
|
} & {
|
|
132
126
|
color?: string | undefined;
|
|
133
127
|
} & {
|
|
134
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
135
|
-
onSave?: ((value: any) => any) | undefined;
|
|
136
128
|
onCancel?: (() => any) | undefined;
|
|
137
129
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties & {};
|
|
138
130
|
__isFragment?: undefined;
|
|
@@ -144,8 +136,6 @@ declare const VConfirmEdit: {
|
|
|
144
136
|
} & {
|
|
145
137
|
color?: string | undefined;
|
|
146
138
|
} & {
|
|
147
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
148
|
-
onSave?: ((value: any) => any) | undefined;
|
|
149
139
|
onCancel?: (() => any) | undefined;
|
|
150
140
|
}, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
151
141
|
cancel: () => true;
|
|
@@ -53,8 +53,6 @@ declare const VConfirmEdit: {
|
|
|
53
53
|
cancelText: string;
|
|
54
54
|
okText: string;
|
|
55
55
|
color?: string | undefined;
|
|
56
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
57
|
-
onSave?: ((value: any) => any) | undefined;
|
|
58
56
|
onCancel?: (() => any) | undefined;
|
|
59
57
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
|
|
60
58
|
cancelText: string;
|
|
@@ -62,8 +60,6 @@ declare const VConfirmEdit: {
|
|
|
62
60
|
} & {
|
|
63
61
|
color?: string | undefined;
|
|
64
62
|
} & {
|
|
65
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
66
|
-
onSave?: ((value: any) => any) | undefined;
|
|
67
63
|
onCancel?: (() => any) | undefined;
|
|
68
64
|
}, "cancelText" | "okText">;
|
|
69
65
|
$attrs: {
|
|
@@ -92,8 +88,6 @@ declare const VConfirmEdit: {
|
|
|
92
88
|
} & {
|
|
93
89
|
color?: string | undefined;
|
|
94
90
|
} & {
|
|
95
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
96
|
-
onSave?: ((value: any) => any) | undefined;
|
|
97
91
|
onCancel?: (() => any) | undefined;
|
|
98
92
|
}, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
99
93
|
cancel: () => true;
|
|
@@ -137,8 +131,6 @@ declare const VConfirmEdit: {
|
|
|
137
131
|
} & {
|
|
138
132
|
color?: string | undefined;
|
|
139
133
|
} & {
|
|
140
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
141
|
-
onSave?: ((value: any) => any) | undefined;
|
|
142
134
|
onCancel?: (() => any) | undefined;
|
|
143
135
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties & {};
|
|
144
136
|
__isFragment?: undefined;
|
|
@@ -150,8 +142,6 @@ declare const VConfirmEdit: {
|
|
|
150
142
|
} & {
|
|
151
143
|
color?: string | undefined;
|
|
152
144
|
} & {
|
|
153
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
154
|
-
onSave?: ((value: any) => any) | undefined;
|
|
155
145
|
onCancel?: (() => any) | undefined;
|
|
156
146
|
}, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
157
147
|
cancel: () => true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineComponent.mjs","names":["injectDefaults","internalUseDefaults","defineComponent","_defineComponent","consoleWarn","pick","propsFactory","options","_setup","setup","name","props","propKeys","Object","keys","filter","key","filterProps","_as","String","ctx","defaults","value","_props","provideSubDefaults","setupBindings","genericComponent","exposeDefaults","arguments","length","undefined","defineFunctionalComponent","render"],"sources":["../../src/util/defineComponent.tsx"],"sourcesContent":["// Composables\nimport { injectDefaults, internalUseDefaults } from '@/composables/defaults'\n\n// Utilities\nimport {\n defineComponent as _defineComponent, // eslint-disable-line no-restricted-imports\n} from 'vue'\nimport { consoleWarn } from '@/util/console'\nimport { pick } from '@/util/helpers'\nimport { propsFactory } from '@/util/propsFactory'\n\n// Types\nimport type {\n AllowedComponentProps,\n ComponentCustomProps,\n ComponentInjectOptions,\n ComponentObjectPropsOptions,\n ComponentOptions,\n ComponentOptionsMixin,\n ComponentOptionsWithObjectProps,\n ComponentOptionsWithoutProps,\n ComponentPropsOptions,\n ComputedOptions,\n DefineComponent,\n EmitsOptions,\n ExtractDefaultPropTypes,\n ExtractPropTypes,\n FunctionalComponent,\n MethodOptions,\n ObjectEmitsOptions,\n SlotsType,\n VNode,\n VNodeChild,\n VNodeProps,\n} from 'vue'\n\n// No props\nexport function defineComponent<\n Props = {},\n RawBindings = {},\n D = {},\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = {},\n EE extends string = string,\n I extends {} = {},\n II extends string = string,\n S extends SlotsType = {},\n>(\n options: ComponentOptionsWithoutProps<\n Props,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E,\n EE,\n I,\n II,\n S\n >\n): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>\n\n// Object Props\nexport function defineComponent<\n PropsOptions extends Readonly<ComponentPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = {},\n EE extends string = string,\n I extends {} = {},\n II extends string = string,\n S extends SlotsType = {},\n>(\n options: ComponentOptionsWithObjectProps<\n PropsOptions,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E,\n EE,\n I,\n II,\n S\n >\n): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE> & FilterPropsOptions<PropsOptions>\n\n// Implementation\nexport function defineComponent (options: ComponentOptions) {\n options._setup = options._setup ?? options.setup\n\n if (!options.name) {\n consoleWarn('The component is missing an explicit name, unable to generate default prop value')\n\n return options\n }\n\n if (options._setup) {\n options.props = propsFactory(options.props ?? {}, options.name)()\n const propKeys = Object.keys(options.props).filter(key => key !== 'class' && key !== 'style')\n options.filterProps = function filterProps (props: Record<string, any>) {\n return pick(props, propKeys)\n }\n\n options.props._as = String\n options.setup = function setup (props: Record<string, any>, ctx) {\n const defaults = injectDefaults()\n\n // Skip props proxy if defaults are not provided\n if (!defaults.value) return options._setup(props, ctx)\n\n const { props: _props, provideSubDefaults } = internalUseDefaults(props, props._as ?? options.name, defaults)\n\n const setupBindings = options._setup(_props, ctx)\n\n provideSubDefaults()\n\n return setupBindings\n }\n }\n\n return options\n}\n\ntype ToListeners<T extends string | number | symbol> = { [K in T]: K extends `on${infer U}` ? Uncapitalize<U> : K }[T]\n\nexport type SlotsToProps<\n U extends RawSlots,\n T = MakeInternalSlots<U>\n> = {\n $children?: (\n | VNodeChild\n | (T extends { default: infer V } ? V : {})\n | { [K in keyof T]?: T[K] }\n )\n 'v-slots'?: { [K in keyof T]?: T[K] | false }\n} & {\n [K in keyof T as `v-slot:${K & string}`]?: T[K] | false\n}\n\ntype RawSlots = Record<string, unknown>\ntype Slot<T> = [T] extends [never] ? () => VNodeChild : (arg: T) => VNodeChild\ntype VueSlot<T> = [T] extends [never] ? () => VNode[] : (arg: T) => VNode[]\ntype MakeInternalSlots<T extends RawSlots> = {\n [K in keyof T]: Slot<T[K]>\n}\ntype MakeSlots<T extends RawSlots> = {\n [K in keyof T]: VueSlot<T[K]>\n}\n\nexport type GenericProps<Props, Slots extends Record<string, unknown>> = {\n $props: Props & SlotsToProps<Slots>\n $slots: MakeSlots<Slots>\n}\n\ntype DefineComponentWithGenericProps<T extends (new (props: Record<string, any>, slots: RawSlots) => {\n $props?: Record<string, any>\n})> = <\n PropsOptions extends Readonly<ComponentObjectPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = Record<string, any>,\n EE extends string = string,\n I extends ComponentInjectOptions = {},\n II extends string = string,\n // Slots extends RawSlots = ConstructorParameters<T> extends [any, infer SS extends RawSlots | undefined] ? Exclude<SS, undefined> : {},\n Slots extends RawSlots = ConstructorParameters<T>[1],\n S extends SlotsType = SlotsType<Partial<MakeSlots<Slots>>>,\n III = InstanceType<T>,\n P = III extends Record<'$props', any>\n ? Omit<PropsOptions, keyof III['$props']>\n : PropsOptions,\n Base = DefineComponent<\n P,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E extends any[] ? E : III extends Record<'$props', any> ? Omit<E, ToListeners<keyof III['$props']>> : E,\n EE,\n PublicProps,\n ExtractPropTypes<P> & ({} extends E ? {} : EmitsToProps<E>),\n ExtractDefaultPropTypes<P>,\n S\n >\n>(\n options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>\n) => Base & T & FilterPropsOptions<PropsOptions>\n\ntype DefineComponentWithSlots<Slots extends RawSlots> = <\n PropsOptions extends Readonly<ComponentPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = Record<string, any>,\n EE extends string = string,\n I extends ComponentInjectOptions = {},\n II extends string = string,\n S extends SlotsType = SlotsType<Partial<MakeSlots<Slots>>>,\n>(\n options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>\n) => DefineComponent<\n ExtractPropTypes<PropsOptions> & SlotsToProps<Slots>,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E,\n EE,\n PublicProps,\n ExtractPropTypes<PropsOptions> & SlotsToProps<Slots> & ({} extends E ? {} : EmitsToProps<E>),\n ExtractDefaultPropTypes<PropsOptions>,\n S\n> & FilterPropsOptions<PropsOptions>\n\n// No argument - simple default slot\nexport function genericComponent (exposeDefaults?: boolean): DefineComponentWithSlots<{ default: never }>\n\n// Generic constructor argument - generic props and slots\nexport function genericComponent<T extends (new (props: Record<string, any>, slots: any) => {\n $props?: Record<string, any>\n})> (exposeDefaults?: boolean): DefineComponentWithGenericProps<T>\n\n// Slots argument - simple slots\nexport function genericComponent<\n Slots extends RawSlots\n> (exposeDefaults?: boolean): DefineComponentWithSlots<Slots>\n\n// Implementation\nexport function genericComponent (exposeDefaults = true) {\n return (options: any) => ((exposeDefaults ? defineComponent : _defineComponent) as any)(options)\n}\n\nexport function defineFunctionalComponent<\n T extends FunctionalComponent<Props>,\n PropsOptions = ComponentObjectPropsOptions,\n Defaults = ExtractDefaultPropTypes<PropsOptions>,\n Props = Readonly<ExtractPropTypes<PropsOptions>>,\n> (props: PropsOptions, render: T): FunctionalComponent<Partial<Defaults> & Omit<Props, keyof Defaults>> {\n render.props = props as any\n return render as any\n}\n\ntype EmitsToProps<T extends EmitsOptions> = T extends string[]\n ? {\n [K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any\n }\n : T extends ObjectEmitsOptions\n ? {\n [K in string &\n `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}`\n ? T[Uncapitalize<C>] extends null\n ? (...args: any[]) => any\n : (\n ...args: T[Uncapitalize<C>] extends (...args: infer P) => any\n ? P\n : never\n ) => any\n : never\n }\n : {}\n\ntype PublicProps =\n & VNodeProps\n & AllowedComponentProps\n & ComponentCustomProps\n\n// Adds a filterProps method to the component options\nexport interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {\n filterProps<\n T extends Partial<Props>,\n U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>\n > (props: T): Partial<Pick<T, U>>\n}\n"],"mappings":"AAAA;AAAA,SACSA,cAAc,EAAEC,mBAAmB,uCAE5C;AACA,SACEC,eAAe,IAAIC,gBAAgB,CAAE;AAAA,OAChC,KAAK;AAAA,SACHC,WAAW;AAAA,SACXC,IAAI;AAAA,SACJC,YAAY,8BAErB;AAuFA;AACA,OAAO,SAASJ,eAAeA,CAAEK,OAAyB,EAAE;EAC1DA,OAAO,CAACC,MAAM,GAAGD,OAAO,CAACC,MAAM,IAAID,OAAO,CAACE,KAAK;EAEhD,IAAI,CAACF,OAAO,CAACG,IAAI,EAAE;IACjBN,WAAW,CAAC,kFAAkF,CAAC;IAE/F,OAAOG,OAAO;EAChB;EAEA,IAAIA,OAAO,CAACC,MAAM,EAAE;IAClBD,OAAO,CAACI,KAAK,GAAGL,YAAY,CAACC,OAAO,CAACI,KAAK,IAAI,CAAC,CAAC,EAAEJ,OAAO,CAACG,IAAI,CAAC,EAAE;IACjE,MAAME,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACP,OAAO,CAACI,KAAK,CAAC,CAACI,MAAM,CAACC,GAAG,IAAIA,GAAG,KAAK,OAAO,IAAIA,GAAG,KAAK,OAAO,CAAC;IAC7FT,OAAO,CAACU,WAAW,GAAG,SAASA,WAAWA,CAAEN,KAA0B,EAAE;MACtE,OAAON,IAAI,CAACM,KAAK,EAAEC,QAAQ,CAAC;IAC9B,CAAC;IAEDL,OAAO,CAACI,KAAK,CAACO,GAAG,GAAGC,MAAM;IAC1BZ,OAAO,CAACE,KAAK,GAAG,SAASA,KAAKA,CAAEE,KAA0B,EAAES,GAAG,EAAE;MAC/D,MAAMC,QAAQ,GAAGrB,cAAc,EAAE;;MAEjC;MACA,IAAI,CAACqB,QAAQ,CAACC,KAAK,EAAE,OAAOf,OAAO,CAACC,MAAM,CAACG,KAAK,EAAES,GAAG,CAAC;MAEtD,MAAM;QAAET,KAAK,EAAEY,MAAM;QAAEC;MAAmB,CAAC,GAAGvB,mBAAmB,CAACU,KAAK,EAAEA,KAAK,CAACO,GAAG,IAAIX,OAAO,CAACG,IAAI,EAAEW,QAAQ,CAAC;MAE7G,MAAMI,aAAa,GAAGlB,OAAO,CAACC,MAAM,CAACe,MAAM,EAAEH,GAAG,CAAC;MAEjDI,kBAAkB,EAAE;MAEpB,OAAOC,aAAa;IACtB,CAAC;EACH;EAEA,OAAOlB,OAAO;AAChB;AAqHA;AACA,OAAO,SAASmB,gBAAgBA,CAAA,EAAyB;EAAA,IAAvBC,cAAc,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EACrD,OAAQrB,OAAY,IAAK,CAAEoB,cAAc,GAAGzB,eAAe,GAAGC,gBAAgB,EAAUI,OAAO,CAAC;AAClG;AAEA,OAAO,SAASwB,yBAAyBA,CAKtCpB,KAAmB,EAAEqB,MAAS,EAAwE;EACvGA,MAAM,CAACrB,KAAK,GAAGA,KAAY;EAC3B,OAAOqB,MAAM;AACf"}
|
|
1
|
+
{"version":3,"file":"defineComponent.mjs","names":["injectDefaults","internalUseDefaults","defineComponent","_defineComponent","consoleWarn","pick","propsFactory","options","_setup","setup","name","props","propKeys","Object","keys","filter","key","filterProps","_as","String","ctx","defaults","value","_props","provideSubDefaults","setupBindings","genericComponent","exposeDefaults","arguments","length","undefined","defineFunctionalComponent","render"],"sources":["../../src/util/defineComponent.tsx"],"sourcesContent":["// Composables\nimport { injectDefaults, internalUseDefaults } from '@/composables/defaults'\n\n// Utilities\nimport {\n defineComponent as _defineComponent, // eslint-disable-line no-restricted-imports\n} from 'vue'\nimport { consoleWarn } from '@/util/console'\nimport { pick } from '@/util/helpers'\nimport { propsFactory } from '@/util/propsFactory'\n\n// Types\nimport type {\n AllowedComponentProps,\n ComponentCustomProps,\n ComponentInjectOptions,\n ComponentObjectPropsOptions,\n ComponentOptions,\n ComponentOptionsMixin,\n ComponentOptionsWithObjectProps,\n ComponentOptionsWithoutProps,\n ComponentPropsOptions,\n ComputedOptions,\n DefineComponent,\n EmitsOptions,\n ExtractDefaultPropTypes,\n ExtractPropTypes,\n FunctionalComponent,\n MethodOptions,\n ObjectEmitsOptions,\n SlotsType,\n VNode,\n VNodeChild,\n VNodeProps,\n} from 'vue'\n\n// No props\nexport function defineComponent<\n Props = {},\n RawBindings = {},\n D = {},\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = {},\n EE extends string = string,\n I extends {} = {},\n II extends string = string,\n S extends SlotsType = {},\n>(\n options: ComponentOptionsWithoutProps<\n Props,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E,\n EE,\n I,\n II,\n S\n >\n): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>\n\n// Object Props\nexport function defineComponent<\n PropsOptions extends Readonly<ComponentPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = {},\n EE extends string = string,\n I extends {} = {},\n II extends string = string,\n S extends SlotsType = {},\n>(\n options: ComponentOptionsWithObjectProps<\n PropsOptions,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E,\n EE,\n I,\n II,\n S\n >\n): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE> & FilterPropsOptions<PropsOptions>\n\n// Implementation\nexport function defineComponent (options: ComponentOptions) {\n options._setup = options._setup ?? options.setup\n\n if (!options.name) {\n consoleWarn('The component is missing an explicit name, unable to generate default prop value')\n\n return options\n }\n\n if (options._setup) {\n options.props = propsFactory(options.props ?? {}, options.name)()\n const propKeys = Object.keys(options.props).filter(key => key !== 'class' && key !== 'style')\n options.filterProps = function filterProps (props: Record<string, any>) {\n return pick(props, propKeys)\n }\n\n options.props._as = String\n options.setup = function setup (props: Record<string, any>, ctx) {\n const defaults = injectDefaults()\n\n // Skip props proxy if defaults are not provided\n if (!defaults.value) return options._setup(props, ctx)\n\n const { props: _props, provideSubDefaults } = internalUseDefaults(props, props._as ?? options.name, defaults)\n\n const setupBindings = options._setup(_props, ctx)\n\n provideSubDefaults()\n\n return setupBindings\n }\n }\n\n return options\n}\n\ntype ToListeners<T extends string | number | symbol> = { [K in T]: K extends `on${infer U}` ? Uncapitalize<U> : K }[T]\n\nexport type SlotsToProps<\n U extends RawSlots,\n T = MakeInternalSlots<U>\n> = {\n $children?: (\n | VNodeChild\n | (T extends { default: infer V } ? V : {})\n | { [K in keyof T]?: T[K] }\n )\n 'v-slots'?: { [K in keyof T]?: T[K] | false }\n} & {\n [K in keyof T as `v-slot:${K & string}`]?: T[K] | false\n}\n\ntype RawSlots = Record<string, unknown>\ntype Slot<T> = [T] extends [never] ? () => VNodeChild : (arg: T) => VNodeChild\ntype VueSlot<T> = [T] extends [never] ? () => VNode[] : (arg: T) => VNode[]\ntype MakeInternalSlots<T extends RawSlots> = {\n [K in keyof T]: Slot<T[K]>\n}\ntype MakeSlots<T extends RawSlots> = {\n [K in keyof T]: VueSlot<T[K]>\n}\n\nexport type GenericProps<Props, Slots extends Record<string, unknown>> = {\n $props: Props & SlotsToProps<Slots>\n $slots: MakeSlots<Slots>\n}\n\ntype DefineComponentWithGenericProps<T extends (new (props: Record<string, any>, slots: RawSlots) => {\n $props?: Record<string, any>\n})> = <\n PropsOptions extends Readonly<ComponentObjectPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = Record<string, any>,\n EE extends string = string,\n I extends ComponentInjectOptions = {},\n II extends string = string,\n // Slots extends RawSlots = ConstructorParameters<T> extends [any, infer SS extends RawSlots | undefined] ? Exclude<SS, undefined> : {},\n Slots extends RawSlots = ConstructorParameters<T>[1],\n S extends SlotsType = SlotsType<Partial<MakeSlots<Slots>>>,\n III = InstanceType<T>,\n P = III extends Record<'$props', any>\n ? Omit<PropsOptions, keyof III['$props']>\n : PropsOptions,\n EEE extends EmitsOptions = E extends any[]\n ? E\n : III extends Record<'$props', any>\n ? Omit<E, ToListeners<keyof III['$props']>>\n : E,\n Base = DefineComponent<\n P,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n EEE,\n EE,\n PublicProps,\n ExtractPropTypes<P> & ({} extends E ? {} : EmitsToProps<EEE>),\n ExtractDefaultPropTypes<P>,\n S\n >\n>(\n options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>\n) => Base & T & FilterPropsOptions<PropsOptions>\n\ntype DefineComponentWithSlots<Slots extends RawSlots> = <\n PropsOptions extends Readonly<ComponentPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = Record<string, any>,\n EE extends string = string,\n I extends ComponentInjectOptions = {},\n II extends string = string,\n S extends SlotsType = SlotsType<Partial<MakeSlots<Slots>>>,\n>(\n options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>\n) => DefineComponent<\n ExtractPropTypes<PropsOptions> & SlotsToProps<Slots>,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E,\n EE,\n PublicProps,\n ExtractPropTypes<PropsOptions> & SlotsToProps<Slots> & ({} extends E ? {} : EmitsToProps<E>),\n ExtractDefaultPropTypes<PropsOptions>,\n S\n> & FilterPropsOptions<PropsOptions>\n\n// No argument - simple default slot\nexport function genericComponent (exposeDefaults?: boolean): DefineComponentWithSlots<{ default: never }>\n\n// Generic constructor argument - generic props and slots\nexport function genericComponent<T extends (new (props: Record<string, any>, slots: any) => {\n $props?: Record<string, any>\n})> (exposeDefaults?: boolean): DefineComponentWithGenericProps<T>\n\n// Slots argument - simple slots\nexport function genericComponent<\n Slots extends RawSlots\n> (exposeDefaults?: boolean): DefineComponentWithSlots<Slots>\n\n// Implementation\nexport function genericComponent (exposeDefaults = true) {\n return (options: any) => ((exposeDefaults ? defineComponent : _defineComponent) as any)(options)\n}\n\nexport function defineFunctionalComponent<\n T extends FunctionalComponent<Props>,\n PropsOptions = ComponentObjectPropsOptions,\n Defaults = ExtractDefaultPropTypes<PropsOptions>,\n Props = Readonly<ExtractPropTypes<PropsOptions>>,\n> (props: PropsOptions, render: T): FunctionalComponent<Partial<Defaults> & Omit<Props, keyof Defaults>> {\n render.props = props as any\n return render as any\n}\n\ntype EmitsToProps<T extends EmitsOptions> = T extends string[]\n ? {\n [K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any\n }\n : T extends ObjectEmitsOptions\n ? {\n [K in string &\n `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}`\n ? T[Uncapitalize<C>] extends null\n ? (...args: any[]) => any\n : (\n ...args: T[Uncapitalize<C>] extends (...args: infer P) => any\n ? P\n : never\n ) => any\n : never\n }\n : {}\n\ntype PublicProps =\n & VNodeProps\n & AllowedComponentProps\n & ComponentCustomProps\n\n// Adds a filterProps method to the component options\nexport interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {\n filterProps<\n T extends Partial<Props>,\n U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>\n > (props: T): Partial<Pick<T, U>>\n}\n"],"mappings":"AAAA;AAAA,SACSA,cAAc,EAAEC,mBAAmB,uCAE5C;AACA,SACEC,eAAe,IAAIC,gBAAgB,CAAE;AAAA,OAChC,KAAK;AAAA,SACHC,WAAW;AAAA,SACXC,IAAI;AAAA,SACJC,YAAY,8BAErB;AAuFA;AACA,OAAO,SAASJ,eAAeA,CAAEK,OAAyB,EAAE;EAC1DA,OAAO,CAACC,MAAM,GAAGD,OAAO,CAACC,MAAM,IAAID,OAAO,CAACE,KAAK;EAEhD,IAAI,CAACF,OAAO,CAACG,IAAI,EAAE;IACjBN,WAAW,CAAC,kFAAkF,CAAC;IAE/F,OAAOG,OAAO;EAChB;EAEA,IAAIA,OAAO,CAACC,MAAM,EAAE;IAClBD,OAAO,CAACI,KAAK,GAAGL,YAAY,CAACC,OAAO,CAACI,KAAK,IAAI,CAAC,CAAC,EAAEJ,OAAO,CAACG,IAAI,CAAC,EAAE;IACjE,MAAME,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACP,OAAO,CAACI,KAAK,CAAC,CAACI,MAAM,CAACC,GAAG,IAAIA,GAAG,KAAK,OAAO,IAAIA,GAAG,KAAK,OAAO,CAAC;IAC7FT,OAAO,CAACU,WAAW,GAAG,SAASA,WAAWA,CAAEN,KAA0B,EAAE;MACtE,OAAON,IAAI,CAACM,KAAK,EAAEC,QAAQ,CAAC;IAC9B,CAAC;IAEDL,OAAO,CAACI,KAAK,CAACO,GAAG,GAAGC,MAAM;IAC1BZ,OAAO,CAACE,KAAK,GAAG,SAASA,KAAKA,CAAEE,KAA0B,EAAES,GAAG,EAAE;MAC/D,MAAMC,Q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