vuetify 3.2.3 → 3.2.4
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 +9 -9
- package/dist/json/importMap.json +12 -12
- package/dist/json/web-types.json +11 -11
- package/dist/vuetify-labs.css +34 -35
- package/dist/vuetify-labs.d.ts +72 -72
- package/dist/vuetify-labs.esm.js +142 -124
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +142 -124
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +1 -2
- package/dist/vuetify.d.ts +75 -68
- package/dist/vuetify.esm.js +131 -115
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +131 -115
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +469 -469
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAlert/VAlert.mjs +1 -2
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.mjs +2 -2
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarNavIcon.mjs +1 -2
- package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarTitle.mjs +1 -2
- package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +5 -5
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.ts +9 -9
- package/lib/components/VChip/VChip.css +0 -1
- package/lib/components/VChip/VChip.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +5 -5
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +5 -5
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.ts +9 -9
- package/lib/components/VFooter/VFooter.mjs +2 -2
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VForm/index.d.ts +3 -3
- package/lib/components/VImg/VImg.mjs +6 -6
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/index.d.ts +12 -12
- package/lib/components/VList/VList.mjs +2 -2
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/index.d.ts +9 -9
- package/lib/components/VList/list.mjs +4 -4
- package/lib/components/VList/list.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.mjs +3 -3
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.ts +3 -3
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +2 -2
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/index.d.ts +3 -3
- package/lib/components/VNavigationDrawer/sticky.mjs +5 -4
- package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/touch.mjs +4 -4
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +2 -2
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VRating/VRating.mjs +6 -3
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.mjs +2 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.ts +9 -9
- package/lib/components/VSelectionControl/VSelectionControl.mjs +3 -3
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.ts +3 -3
- package/lib/components/VSlideGroup/VSlideGroup.mjs +7 -7
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.ts +3 -3
- package/lib/components/VSlider/slider.mjs +3 -3
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.mjs +2 -2
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VTabs/VTab.mjs +4 -5
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.mjs +6 -3
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.mjs +2 -2
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.mjs +2 -2
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +3 -3
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.mjs +3 -3
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindowItem.mjs +3 -3
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/index.d.ts +63 -63
- package/lib/composables/display.mjs +3 -3
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/form.mjs +4 -4
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/hydration.mjs +6 -6
- package/lib/composables/hydration.mjs.map +1 -1
- package/lib/composables/intersectionObserver.mjs +2 -2
- package/lib/composables/intersectionObserver.mjs.map +1 -1
- package/lib/composables/layout.mjs +3 -3
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/lazy.mjs +2 -2
- package/lib/composables/lazy.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +5 -4
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/scroll.mjs +6 -6
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/ssrBoot.mjs +2 -2
- package/lib/composables/ssrBoot.mjs.map +1 -1
- package/lib/composables/stack.mjs +5 -4
- package/lib/composables/stack.mjs.map +1 -1
- package/lib/composables/transition.mjs +5 -2
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +3 -3
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.ts +12 -5
- package/lib/labs/VDataTable/VDataTable.mjs +2 -1
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs +2 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +6 -6
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/virtual.mjs +3 -3
- package/lib/labs/VDataTable/composables/virtual.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/index.d.ts +9 -9
- package/lib/labs/components.d.ts +9 -9
- package/lib/locale/adapters/vuetify.mjs +8 -5
- package/lib/locale/adapters/vuetify.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VWindowItem.mjs","names":["Touch","makeComponentProps","makeGroupItemProps","useGroupItem","makeLazyProps","useLazy","MaybeTransition","useSsrBoot","computed","inject","nextTick","
|
|
1
|
+
{"version":3,"file":"VWindowItem.mjs","names":["Touch","makeComponentProps","makeGroupItemProps","useGroupItem","makeLazyProps","useLazy","MaybeTransition","useSsrBoot","computed","inject","nextTick","shallowRef","convertToUnit","genericComponent","propsFactory","useRender","VWindowGroupSymbol","VWindowSymbol","makeVWindowItemProps","reverseTransition","type","Boolean","String","default","undefined","transition","VWindowItem","name","directives","props","emits","val","setup","_ref","slots","window","groupItem","isBooted","Error","isTransitioning","hasTransition","value","isReversed","onAfterTransition","transitionCount","transitionHeight","onBeforeTransition","rootRef","clientHeight","onTransitionCancelled","onEnterTransition","el","onBeforeEnter","onAfterEnter","onEnterCancelled","onBeforeLeave","onAfterLeave","onLeaveCancelled","onEnter","hasContent","isSelected","_createVNode","_withDirectives","selectedClass","class","style","_vShow"],"sources":["../../../src/components/VWindow/VWindowItem.tsx"],"sourcesContent":["// Directives\nimport Touch from '@/directives/touch'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeGroupItemProps, useGroupItem } from '@/composables/group'\nimport { makeLazyProps, useLazy } from '@/composables/lazy'\nimport { MaybeTransition } from '@/composables/transition'\nimport { useSsrBoot } from '@/composables/ssrBoot'\n\n// Utilities\nimport { computed, inject, nextTick, shallowRef } from 'vue'\nimport { convertToUnit, genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport { VWindowGroupSymbol, VWindowSymbol } from './VWindow'\n\nexport const makeVWindowItemProps = propsFactory({\n reverseTransition: {\n type: [Boolean, String],\n default: undefined,\n },\n transition: {\n type: [Boolean, String],\n default: undefined,\n },\n\n ...makeComponentProps(),\n ...makeGroupItemProps(),\n ...makeLazyProps(),\n}, 'v-window-item')\n\nexport const VWindowItem = genericComponent()({\n name: 'VWindowItem',\n\n directives: {\n Touch,\n },\n\n props: makeVWindowItemProps(),\n\n emits: {\n 'group:selected': (val: { value: boolean }) => true,\n },\n\n setup (props, { slots }) {\n const window = inject(VWindowSymbol)\n const groupItem = useGroupItem(props, VWindowGroupSymbol)\n const { isBooted } = useSsrBoot()\n\n if (!window || !groupItem) throw new Error('[Vuetify] VWindowItem must be used inside VWindow')\n\n const isTransitioning = shallowRef(false)\n const hasTransition = computed(() => isBooted.value && (\n window.isReversed.value\n ? props.reverseTransition !== false\n : props.transition !== false\n ))\n\n function onAfterTransition () {\n if (!isTransitioning.value || !window) {\n return\n }\n\n // Finalize transition state.\n isTransitioning.value = false\n if (window.transitionCount.value > 0) {\n window.transitionCount.value -= 1\n\n // Remove container height if we are out of transition.\n if (window.transitionCount.value === 0) {\n window.transitionHeight.value = undefined\n }\n }\n }\n\n function onBeforeTransition () {\n if (isTransitioning.value || !window) {\n return\n }\n\n // Initialize transition state here.\n isTransitioning.value = true\n\n if (window.transitionCount.value === 0) {\n // Set initial height for height transition.\n window.transitionHeight.value = convertToUnit(window.rootRef.value?.clientHeight)\n }\n\n window.transitionCount.value += 1\n }\n\n function onTransitionCancelled () {\n onAfterTransition() // This should have the same path as normal transition end.\n }\n\n function onEnterTransition (el: Element) {\n if (!isTransitioning.value) {\n return\n }\n\n nextTick(() => {\n // Do not set height if no transition or cancelled.\n if (!hasTransition.value || !isTransitioning.value || !window) {\n return\n }\n\n // Set transition target height.\n window.transitionHeight.value = convertToUnit(el.clientHeight)\n })\n }\n\n const transition = computed(() => {\n const name = window.isReversed.value\n ? props.reverseTransition\n : props.transition\n\n return !hasTransition.value ? false : {\n name: typeof name !== 'string' ? window.transition.value : name,\n onBeforeEnter: onBeforeTransition,\n onAfterEnter: onAfterTransition,\n onEnterCancelled: onTransitionCancelled,\n onBeforeLeave: onBeforeTransition,\n onAfterLeave: onAfterTransition,\n onLeaveCancelled: onTransitionCancelled,\n onEnter: onEnterTransition,\n }\n })\n\n const { hasContent } = useLazy(props, groupItem.isSelected)\n\n useRender(() => (\n <MaybeTransition transition={ transition.value } disabled={ !isBooted.value }>\n <div\n class={[\n 'v-window-item',\n groupItem.selectedClass.value,\n props.class,\n ]}\n style={ props.style }\n v-show={ groupItem.isSelected.value }\n >\n { hasContent.value && slots.default?.() }\n </div>\n </MaybeTransition>\n ))\n\n return {}\n },\n})\n\nexport type VWindowItem = InstanceType<typeof VWindowItem>\n"],"mappings":";AAAA;AAAA,OACOA,KAAK,0CAEZ;AAAA,SACSC,kBAAkB;AAAA,SAClBC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,aAAa,EAAEC,OAAO;AAAA,SACtBC,eAAe;AAAA,SACfC,UAAU,yCAEnB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,KAAK;AAAA,SACnDC,aAAa,EAAEC,gBAAgB,EAAEC,YAAY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3657
3657
|
type Val$2<T, ReturnObject extends boolean> = T extends Primitive$2 ? T : (ReturnObject extends true ? T : any);
|
|
3658
|
-
type Value$2<T, ReturnObject extends boolean, Multiple extends boolean> = Multiple extends true ? readonly Val$2<T, ReturnObject>[] : Val$2<T, ReturnObject
|
|
3658
|
+
type Value$2<T, ReturnObject extends boolean, Multiple extends boolean> = Multiple extends true ? readonly Val$2<T, ReturnObject>[] : Val$2<T, ReturnObject> | null;
|
|
3659
3659
|
declare const VAutocomplete: {
|
|
3660
3660
|
new (...args: any[]): {
|
|
3661
3661
|
$: vue.ComponentInternalInstance;
|
|
@@ -4942,31 +4942,31 @@ declare const VAutocomplete: {
|
|
|
4942
4942
|
filterMode: FilterMode;
|
|
4943
4943
|
noFilter: boolean;
|
|
4944
4944
|
filterKeys: NonNullable<FilterKeys>;
|
|
4945
|
-
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1, ReturnObject extends boolean = false, Multiple extends boolean = false, V extends Value$2<
|
|
4946
|
-
items?:
|
|
4945
|
+
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1 extends readonly any[], Item = T_1 extends (infer U)[] ? U : never, ReturnObject extends boolean = false, Multiple extends boolean = false, V extends Value$2<Item, ReturnObject, Multiple> = Value$2<Item, ReturnObject, Multiple>>(props: {
|
|
4946
|
+
items?: T_1 | undefined;
|
|
4947
4947
|
returnObject?: ReturnObject | undefined;
|
|
4948
4948
|
multiple?: Multiple | undefined;
|
|
4949
|
-
modelValue?: V | undefined;
|
|
4949
|
+
modelValue?: V | null | undefined;
|
|
4950
4950
|
'onUpdate:modelValue'?: ((val: V) => void) | undefined;
|
|
4951
4951
|
}) => GenericProps<{
|
|
4952
|
-
items?:
|
|
4952
|
+
items?: T_1 | undefined;
|
|
4953
4953
|
returnObject?: ReturnObject | undefined;
|
|
4954
4954
|
multiple?: Multiple | undefined;
|
|
4955
|
-
modelValue?: V | undefined;
|
|
4955
|
+
modelValue?: V | null | undefined;
|
|
4956
4956
|
'onUpdate:modelValue'?: ((val: V) => void) | undefined;
|
|
4957
4957
|
}, Omit<VInputSlots & VFieldSlots, "default"> & {
|
|
4958
4958
|
item: [{
|
|
4959
|
-
item: InternalItem<
|
|
4959
|
+
item: InternalItem<Item>;
|
|
4960
4960
|
index: number;
|
|
4961
4961
|
props: Record<string, unknown>;
|
|
4962
4962
|
}];
|
|
4963
4963
|
chip: [{
|
|
4964
|
-
item: InternalItem<
|
|
4964
|
+
item: InternalItem<Item>;
|
|
4965
4965
|
index: number;
|
|
4966
4966
|
props: Record<string, unknown>;
|
|
4967
4967
|
}];
|
|
4968
4968
|
selection: [{
|
|
4969
|
-
item: InternalItem<
|
|
4969
|
+
item: InternalItem<Item>;
|
|
4970
4970
|
index: number;
|
|
4971
4971
|
}];
|
|
4972
4972
|
'prepend-item': [];
|
|
@@ -10750,11 +10750,11 @@ declare const VImg: {
|
|
|
10750
10750
|
onLoad?: ((value: string | undefined) => any) | undefined;
|
|
10751
10751
|
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
10752
10752
|
}, {
|
|
10753
|
-
currentSrc: vue.
|
|
10753
|
+
currentSrc: vue.ShallowRef<string>;
|
|
10754
10754
|
image: vue.Ref<HTMLImageElement | undefined>;
|
|
10755
|
-
state: vue.
|
|
10756
|
-
naturalWidth: vue.
|
|
10757
|
-
naturalHeight: vue.
|
|
10755
|
+
state: vue.ShallowRef<"error" | "loaded" | "idle" | "loading">;
|
|
10756
|
+
naturalWidth: vue.ShallowRef<number | undefined>;
|
|
10757
|
+
naturalHeight: vue.ShallowRef<number | undefined>;
|
|
10758
10758
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
10759
10759
|
loadstart: (value: string | undefined) => true;
|
|
10760
10760
|
load: (value: string | undefined) => true;
|
|
@@ -10829,11 +10829,11 @@ declare const VImg: {
|
|
|
10829
10829
|
onLoad?: ((value: string | undefined) => any) | undefined;
|
|
10830
10830
|
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
10831
10831
|
} & vue.ShallowUnwrapRef<{
|
|
10832
|
-
currentSrc: vue.
|
|
10832
|
+
currentSrc: vue.ShallowRef<string>;
|
|
10833
10833
|
image: vue.Ref<HTMLImageElement | undefined>;
|
|
10834
|
-
state: vue.
|
|
10835
|
-
naturalWidth: vue.
|
|
10836
|
-
naturalHeight: vue.
|
|
10834
|
+
state: vue.ShallowRef<"error" | "loaded" | "idle" | "loading">;
|
|
10835
|
+
naturalWidth: vue.ShallowRef<number | undefined>;
|
|
10836
|
+
naturalHeight: vue.ShallowRef<number | undefined>;
|
|
10837
10837
|
}> & {} & vue.ComponentCustomProperties & {};
|
|
10838
10838
|
__isFragment?: undefined;
|
|
10839
10839
|
__isTeleport?: undefined;
|
|
@@ -10879,11 +10879,11 @@ declare const VImg: {
|
|
|
10879
10879
|
onLoad?: ((value: string | undefined) => any) | undefined;
|
|
10880
10880
|
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
10881
10881
|
}, {
|
|
10882
|
-
currentSrc: vue.
|
|
10882
|
+
currentSrc: vue.ShallowRef<string>;
|
|
10883
10883
|
image: vue.Ref<HTMLImageElement | undefined>;
|
|
10884
|
-
state: vue.
|
|
10885
|
-
naturalWidth: vue.
|
|
10886
|
-
naturalHeight: vue.
|
|
10884
|
+
state: vue.ShallowRef<"error" | "loaded" | "idle" | "loading">;
|
|
10885
|
+
naturalWidth: vue.ShallowRef<number | undefined>;
|
|
10886
|
+
naturalHeight: vue.ShallowRef<number | undefined>;
|
|
10887
10887
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
10888
10888
|
loadstart: (value: string | undefined) => true;
|
|
10889
10889
|
load: (value: string | undefined) => true;
|
|
@@ -11683,7 +11683,7 @@ declare const VSelectionControl: {
|
|
|
11683
11683
|
falseValue: null;
|
|
11684
11684
|
value: null;
|
|
11685
11685
|
}, "$children" | "v-slot:default" | "v-slots" | "modelValue" | "onUpdate:modelValue" | "v-slot:label" | "v-slot:input">>>, {
|
|
11686
|
-
isFocused:
|
|
11686
|
+
isFocused: vue.ShallowRef<boolean>;
|
|
11687
11687
|
input: Ref<HTMLInputElement | undefined>;
|
|
11688
11688
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
11689
11689
|
'update:modelValue': (val: any) => boolean;
|
|
@@ -11758,7 +11758,7 @@ declare const VSelectionControl: {
|
|
|
11758
11758
|
falseValue: null;
|
|
11759
11759
|
value: null;
|
|
11760
11760
|
}, "$children" | "v-slot:default" | "v-slots" | "modelValue" | "onUpdate:modelValue" | "v-slot:label" | "v-slot:input">>> & vue.ShallowUnwrapRef<{
|
|
11761
|
-
isFocused:
|
|
11761
|
+
isFocused: vue.ShallowRef<boolean>;
|
|
11762
11762
|
input: Ref<HTMLInputElement | undefined>;
|
|
11763
11763
|
}> & {} & vue.ComponentCustomProperties & {};
|
|
11764
11764
|
__isFragment?: undefined;
|
|
@@ -11805,7 +11805,7 @@ declare const VSelectionControl: {
|
|
|
11805
11805
|
falseValue: null;
|
|
11806
11806
|
value: null;
|
|
11807
11807
|
}, "$children" | "v-slot:default" | "v-slots" | "modelValue" | "onUpdate:modelValue" | "v-slot:label" | "v-slot:input">>>, {
|
|
11808
|
-
isFocused:
|
|
11808
|
+
isFocused: vue.ShallowRef<boolean>;
|
|
11809
11809
|
input: Ref<HTMLInputElement | undefined>;
|
|
11810
11810
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
11811
11811
|
'update:modelValue': (val: any) => boolean;
|
|
@@ -14326,7 +14326,7 @@ type VColorPicker = InstanceType<typeof VColorPicker>;
|
|
|
14326
14326
|
|
|
14327
14327
|
type Primitive$1 = string | number | boolean | symbol;
|
|
14328
14328
|
type Val$1<T, ReturnObject extends boolean> = string | (T extends Primitive$1 ? T : (ReturnObject extends true ? T : any));
|
|
14329
|
-
type Value$1<T, ReturnObject extends boolean, Multiple extends boolean> = Multiple extends true ? readonly Val$1<T, ReturnObject>[] : Val$1<T, ReturnObject
|
|
14329
|
+
type Value$1<T, ReturnObject extends boolean, Multiple extends boolean> = Multiple extends true ? readonly Val$1<T, ReturnObject>[] : Val$1<T, ReturnObject> | null;
|
|
14330
14330
|
declare const VCombobox: {
|
|
14331
14331
|
new (...args: any[]): {
|
|
14332
14332
|
$: vue.ComponentInternalInstance;
|
|
@@ -15637,31 +15637,31 @@ declare const VCombobox: {
|
|
|
15637
15637
|
filterMode: FilterMode;
|
|
15638
15638
|
noFilter: boolean;
|
|
15639
15639
|
filterKeys: NonNullable<FilterKeys>;
|
|
15640
|
-
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1, ReturnObject extends boolean = true, Multiple extends boolean = false, V extends Value$1<
|
|
15641
|
-
items?:
|
|
15640
|
+
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1 extends readonly any[], Item = T_1 extends (infer U)[] ? U : never, ReturnObject extends boolean = true, Multiple extends boolean = false, V extends Value$1<Item, ReturnObject, Multiple> = Value$1<Item, ReturnObject, Multiple>>(props: {
|
|
15641
|
+
items?: T_1 | undefined;
|
|
15642
15642
|
returnObject?: ReturnObject | undefined;
|
|
15643
15643
|
multiple?: Multiple | undefined;
|
|
15644
|
-
modelValue?: V | undefined;
|
|
15644
|
+
modelValue?: V | null | undefined;
|
|
15645
15645
|
'onUpdate:modelValue'?: ((val: V) => void) | undefined;
|
|
15646
15646
|
}) => GenericProps<{
|
|
15647
|
-
items?:
|
|
15647
|
+
items?: T_1 | undefined;
|
|
15648
15648
|
returnObject?: ReturnObject | undefined;
|
|
15649
15649
|
multiple?: Multiple | undefined;
|
|
15650
|
-
modelValue?: V | undefined;
|
|
15650
|
+
modelValue?: V | null | undefined;
|
|
15651
15651
|
'onUpdate:modelValue'?: ((val: V) => void) | undefined;
|
|
15652
15652
|
}, Omit<VInputSlots & VFieldSlots, "default"> & {
|
|
15653
15653
|
item: [{
|
|
15654
|
-
item: InternalItem<
|
|
15654
|
+
item: InternalItem<Item>;
|
|
15655
15655
|
index: number;
|
|
15656
15656
|
props: Record<string, unknown>;
|
|
15657
15657
|
}];
|
|
15658
15658
|
chip: [{
|
|
15659
|
-
item: InternalItem<
|
|
15659
|
+
item: InternalItem<Item>;
|
|
15660
15660
|
index: number;
|
|
15661
15661
|
props: Record<string, unknown>;
|
|
15662
15662
|
}];
|
|
15663
15663
|
selection: [{
|
|
15664
|
-
item: InternalItem<
|
|
15664
|
+
item: InternalItem<Item>;
|
|
15665
15665
|
index: number;
|
|
15666
15666
|
}];
|
|
15667
15667
|
'prepend-item': [];
|
|
@@ -21138,7 +21138,7 @@ declare const VForm: {
|
|
|
21138
21138
|
}[]>;
|
|
21139
21139
|
isDisabled: vue.ComputedRef<boolean>;
|
|
21140
21140
|
isReadonly: vue.ComputedRef<boolean>;
|
|
21141
|
-
isValidating: vue.
|
|
21141
|
+
isValidating: vue.ShallowRef<boolean>;
|
|
21142
21142
|
items: vue.Ref<{
|
|
21143
21143
|
id: string | number;
|
|
21144
21144
|
validate: () => Promise<string[]>;
|
|
@@ -21214,7 +21214,7 @@ declare const VForm: {
|
|
|
21214
21214
|
}[]>;
|
|
21215
21215
|
isDisabled: vue.ComputedRef<boolean>;
|
|
21216
21216
|
isReadonly: vue.ComputedRef<boolean>;
|
|
21217
|
-
isValidating: vue.
|
|
21217
|
+
isValidating: vue.ShallowRef<boolean>;
|
|
21218
21218
|
items: vue.Ref<{
|
|
21219
21219
|
id: string | number;
|
|
21220
21220
|
validate: () => Promise<string[]>;
|
|
@@ -21264,7 +21264,7 @@ declare const VForm: {
|
|
|
21264
21264
|
}[]>;
|
|
21265
21265
|
isDisabled: vue.ComputedRef<boolean>;
|
|
21266
21266
|
isReadonly: vue.ComputedRef<boolean>;
|
|
21267
|
-
isValidating: vue.
|
|
21267
|
+
isValidating: vue.ShallowRef<boolean>;
|
|
21268
21268
|
items: vue.Ref<{
|
|
21269
21269
|
id: string | number;
|
|
21270
21270
|
validate: () => Promise<string[]>;
|
|
@@ -23834,15 +23834,6 @@ declare const VLazy: {
|
|
|
23834
23834
|
}>>;
|
|
23835
23835
|
type VLazy = InstanceType<typeof VLazy>;
|
|
23836
23836
|
|
|
23837
|
-
type SelectStrategyFn = (data: {
|
|
23838
|
-
id: unknown;
|
|
23839
|
-
value: boolean;
|
|
23840
|
-
selected: Map<unknown, 'on' | 'off' | 'indeterminate'>;
|
|
23841
|
-
children: Map<unknown, unknown[]>;
|
|
23842
|
-
parents: Map<unknown, unknown>;
|
|
23843
|
-
event?: Event;
|
|
23844
|
-
}) => Map<unknown, 'on' | 'off' | 'indeterminate'>;
|
|
23845
|
-
|
|
23846
23837
|
type OpenStrategyFn = (data: {
|
|
23847
23838
|
id: unknown;
|
|
23848
23839
|
value: boolean;
|
|
@@ -23865,6 +23856,15 @@ type OpenStrategy = {
|
|
|
23865
23856
|
select: OpenSelectStrategyFn;
|
|
23866
23857
|
};
|
|
23867
23858
|
|
|
23859
|
+
type SelectStrategyFn = (data: {
|
|
23860
|
+
id: unknown;
|
|
23861
|
+
value: boolean;
|
|
23862
|
+
selected: Map<unknown, 'on' | 'off' | 'indeterminate'>;
|
|
23863
|
+
children: Map<unknown, unknown[]>;
|
|
23864
|
+
parents: Map<unknown, unknown>;
|
|
23865
|
+
event?: Event;
|
|
23866
|
+
}) => Map<unknown, 'on' | 'off' | 'indeterminate'>;
|
|
23867
|
+
|
|
23868
23868
|
type SelectStrategy = 'single-leaf' | 'leaf' | 'independent' | 'single-independent' | 'classic' | SelectStrategyFn;
|
|
23869
23869
|
type OpenStrategyProp = 'single' | 'multiple' | 'list' | OpenStrategy;
|
|
23870
23870
|
|
|
@@ -26706,7 +26706,7 @@ declare const VMenu: {
|
|
|
26706
26706
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
26707
26707
|
}, {
|
|
26708
26708
|
id: vue.ComputedRef<string>;
|
|
26709
|
-
ΨopenChildren: vue.
|
|
26709
|
+
ΨopenChildren: vue.ShallowRef<number>;
|
|
26710
26710
|
} & Omit<Omit<{
|
|
26711
26711
|
$: vue.ComponentInternalInstance;
|
|
26712
26712
|
$data: {};
|
|
@@ -27172,7 +27172,7 @@ declare const VMenu: {
|
|
|
27172
27172
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
27173
27173
|
} & vue.ShallowUnwrapRef<{
|
|
27174
27174
|
id: vue.ComputedRef<string>;
|
|
27175
|
-
ΨopenChildren: vue.
|
|
27175
|
+
ΨopenChildren: vue.ShallowRef<number>;
|
|
27176
27176
|
} & Omit<Omit<{
|
|
27177
27177
|
$: vue.ComponentInternalInstance;
|
|
27178
27178
|
$data: {};
|
|
@@ -27591,7 +27591,7 @@ declare const VMenu: {
|
|
|
27591
27591
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
27592
27592
|
}, {
|
|
27593
27593
|
id: vue.ComputedRef<string>;
|
|
27594
|
-
ΨopenChildren: vue.
|
|
27594
|
+
ΨopenChildren: vue.ShallowRef<number>;
|
|
27595
27595
|
} & Omit<Omit<{
|
|
27596
27596
|
$: vue.ComponentInternalInstance;
|
|
27597
27597
|
$data: {};
|
|
@@ -28570,7 +28570,7 @@ declare const VNavigationDrawer: {
|
|
|
28570
28570
|
"onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
|
|
28571
28571
|
"onUpdate:rail"?: ((val: boolean) => any) | undefined;
|
|
28572
28572
|
}, {
|
|
28573
|
-
isStuck: vue.
|
|
28573
|
+
isStuck: vue.ShallowRef<boolean | "top" | "bottom">;
|
|
28574
28574
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
28575
28575
|
'update:modelValue': (val: boolean) => true;
|
|
28576
28576
|
'update:rail': (val: boolean) => true;
|
|
@@ -28664,7 +28664,7 @@ declare const VNavigationDrawer: {
|
|
|
28664
28664
|
"onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
|
|
28665
28665
|
"onUpdate:rail"?: ((val: boolean) => any) | undefined;
|
|
28666
28666
|
} & vue.ShallowUnwrapRef<{
|
|
28667
|
-
isStuck: vue.
|
|
28667
|
+
isStuck: vue.ShallowRef<boolean | "top" | "bottom">;
|
|
28668
28668
|
}> & {} & vue.ComponentCustomProperties & {};
|
|
28669
28669
|
__isFragment?: undefined;
|
|
28670
28670
|
__isTeleport?: undefined;
|
|
@@ -28719,7 +28719,7 @@ declare const VNavigationDrawer: {
|
|
|
28719
28719
|
"onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
|
|
28720
28720
|
"onUpdate:rail"?: ((val: boolean) => any) | undefined;
|
|
28721
28721
|
}, {
|
|
28722
|
-
isStuck: vue.
|
|
28722
|
+
isStuck: vue.ShallowRef<boolean | "top" | "bottom">;
|
|
28723
28723
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
28724
28724
|
'update:modelValue': (val: boolean) => true;
|
|
28725
28725
|
'update:rail': (val: boolean) => true;
|
|
@@ -32972,7 +32972,7 @@ type VResponsive = InstanceType<typeof VResponsive>;
|
|
|
32972
32972
|
|
|
32973
32973
|
type Primitive = string | number | boolean | symbol;
|
|
32974
32974
|
type Val<T, ReturnObject extends boolean> = T extends Primitive ? T : (ReturnObject extends true ? T : any);
|
|
32975
|
-
type Value<T, ReturnObject extends boolean, Multiple extends boolean> = Multiple extends true ? readonly Val<T, ReturnObject>[] : Val<T, ReturnObject
|
|
32975
|
+
type Value<T, ReturnObject extends boolean, Multiple extends boolean> = Multiple extends true ? readonly Val<T, ReturnObject>[] : Val<T, ReturnObject> | null;
|
|
32976
32976
|
declare const VSelect: {
|
|
32977
32977
|
new (...args: any[]): {
|
|
32978
32978
|
$: vue.ComponentInternalInstance;
|
|
@@ -34218,31 +34218,31 @@ declare const VSelect: {
|
|
|
34218
34218
|
hideSelected: boolean;
|
|
34219
34219
|
menuIcon: IconValue;
|
|
34220
34220
|
openOnClear: boolean;
|
|
34221
|
-
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1, ReturnObject extends boolean = false, Multiple extends boolean = false, V extends Value<
|
|
34222
|
-
items?:
|
|
34221
|
+
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1 extends readonly any[], Item = T_1 extends (infer U)[] ? U : never, ReturnObject extends boolean = false, Multiple extends boolean = false, V extends Value<Item, ReturnObject, Multiple> = Value<Item, ReturnObject, Multiple>>(props: {
|
|
34222
|
+
items?: T_1 | undefined;
|
|
34223
34223
|
returnObject?: ReturnObject | undefined;
|
|
34224
34224
|
multiple?: Multiple | undefined;
|
|
34225
|
-
modelValue?: V | undefined;
|
|
34225
|
+
modelValue?: V | null | undefined;
|
|
34226
34226
|
'onUpdate:modelValue'?: ((val: V) => void) | undefined;
|
|
34227
34227
|
}) => GenericProps<{
|
|
34228
|
-
items?:
|
|
34228
|
+
items?: T_1 | undefined;
|
|
34229
34229
|
returnObject?: ReturnObject | undefined;
|
|
34230
34230
|
multiple?: Multiple | undefined;
|
|
34231
|
-
modelValue?: V | undefined;
|
|
34231
|
+
modelValue?: V | null | undefined;
|
|
34232
34232
|
'onUpdate:modelValue'?: ((val: V) => void) | undefined;
|
|
34233
34233
|
}, Omit<VInputSlots & VFieldSlots, "default"> & {
|
|
34234
34234
|
item: [{
|
|
34235
|
-
item: InternalItem<
|
|
34235
|
+
item: InternalItem<Item>;
|
|
34236
34236
|
index: number;
|
|
34237
34237
|
props: Record<string, unknown>;
|
|
34238
34238
|
}];
|
|
34239
34239
|
chip: [{
|
|
34240
|
-
item: InternalItem<
|
|
34240
|
+
item: InternalItem<Item>;
|
|
34241
34241
|
index: number;
|
|
34242
34242
|
props: Record<string, unknown>;
|
|
34243
34243
|
}];
|
|
34244
34244
|
selection: [{
|
|
34245
|
-
item: InternalItem<
|
|
34245
|
+
item: InternalItem<Item>;
|
|
34246
34246
|
index: number;
|
|
34247
34247
|
}];
|
|
34248
34248
|
'prepend-item': [];
|
|
@@ -35111,7 +35111,7 @@ declare const VSlideGroup: {
|
|
|
35111
35111
|
}, {
|
|
35112
35112
|
selected: vue.Ref<readonly number[]>;
|
|
35113
35113
|
scrollTo: (location: 'prev' | 'next') => void;
|
|
35114
|
-
scrollOffset: vue.
|
|
35114
|
+
scrollOffset: vue.ShallowRef<number>;
|
|
35115
35115
|
focus: (location?: 'next' | 'prev' | 'first' | 'last') => void;
|
|
35116
35116
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
35117
35117
|
'update:modelValue': (value: any) => boolean;
|
|
@@ -35184,7 +35184,7 @@ declare const VSlideGroup: {
|
|
|
35184
35184
|
} & vue.ShallowUnwrapRef<{
|
|
35185
35185
|
selected: vue.Ref<readonly number[]>;
|
|
35186
35186
|
scrollTo: (location: 'prev' | 'next') => void;
|
|
35187
|
-
scrollOffset: vue.
|
|
35187
|
+
scrollOffset: vue.ShallowRef<number>;
|
|
35188
35188
|
focus: (location?: 'next' | 'prev' | 'first' | 'last') => void;
|
|
35189
35189
|
}> & {} & vue.ComponentCustomProperties & {};
|
|
35190
35190
|
__isFragment?: undefined;
|
|
@@ -35227,7 +35227,7 @@ declare const VSlideGroup: {
|
|
|
35227
35227
|
}, {
|
|
35228
35228
|
selected: vue.Ref<readonly number[]>;
|
|
35229
35229
|
scrollTo: (location: 'prev' | 'next') => void;
|
|
35230
|
-
scrollOffset: vue.
|
|
35230
|
+
scrollOffset: vue.ShallowRef<number>;
|
|
35231
35231
|
focus: (location?: 'next' | 'prev' | 'first' | 'last') => void;
|
|
35232
35232
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
35233
35233
|
'update:modelValue': (value: any) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Utilities
|
|
2
|
-
import { inject, reactive,
|
|
2
|
+
import { inject, reactive, shallowRef, toRefs, watchEffect } from 'vue';
|
|
3
3
|
import { mergeDeep } from "../util/index.mjs"; // Globals
|
|
4
4
|
import { IN_BROWSER, SUPPORTS_TOUCH } from "../util/globals.mjs"; // Types
|
|
5
5
|
export const breakpoints = ['sm', 'md', 'lg', 'xl', 'xxl']; // no xs
|
|
@@ -63,10 +63,10 @@ export function createDisplay(options, ssr) {
|
|
|
63
63
|
thresholds,
|
|
64
64
|
mobileBreakpoint
|
|
65
65
|
} = parseDisplayOptions(options);
|
|
66
|
-
const height =
|
|
66
|
+
const height = shallowRef(getClientHeight(ssr));
|
|
67
67
|
const platform = shallowRef(getPlatform(ssr));
|
|
68
68
|
const state = reactive({});
|
|
69
|
-
const width =
|
|
69
|
+
const width = shallowRef(getClientWidth(ssr));
|
|
70
70
|
function updateSize() {
|
|
71
71
|
height.value = getClientHeight();
|
|
72
72
|
width.value = getClientWidth();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.mjs","names":["inject","reactive","ref","shallowRef","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","breakpoints","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","arguments","length","undefined","getClientWidth","isHydrate","window","innerWidth","getClientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","touch","ssr","createDisplay","height","platform","state","width","updateSize","value","update","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"sources":["../../src/composables/display.ts"],"sourcesContent":["// Utilities\nimport { inject, reactive, ref, shallowRef, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const breakpoints = ['sm', 'md', 'lg', 'xl', 'xxl'] as const // no xs\n\nexport type Breakpoint = typeof breakpoints[number]\n\nexport type DisplayBreakpoint = 'xs' | Breakpoint\n\nexport type DisplayThresholds = {\n [key in DisplayBreakpoint]: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: Ref<boolean>\n sm: Ref<boolean>\n md: Ref<boolean>\n lg: Ref<boolean>\n xl: Ref<boolean>\n xxl: Ref<boolean>\n smAndUp: Ref<boolean>\n mdAndUp: Ref<boolean>\n lgAndUp: Ref<boolean>\n xlAndUp: Ref<boolean>\n smAndDown: Ref<boolean>\n mdAndDown: Ref<boolean>\n lgAndDown: Ref<boolean>\n xlAndDown: Ref<boolean>\n name: Ref<DisplayBreakpoint>\n height: Ref<number>\n width: Ref<number>\n mobile: Ref<boolean>\n mobileBreakpoint: Ref<number | DisplayBreakpoint>\n platform: Ref<DisplayPlatform>\n thresholds: Ref<DisplayThresholds>\n\n /** @internal */\n ssr: boolean\n\n update (): void\n}\n\nexport const DisplaySymbol: InjectionKey<DisplayInstance> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\nfunction getClientWidth (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerWidth\n : 0\n}\n\nfunction getClientHeight (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerHeight\n : 0\n}\n\nfunction getPlatform (isHydrate?: boolean): DisplayPlatform {\n const userAgent = IN_BROWSER && !isHydrate\n ? window.navigator.userAgent\n : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr: userAgent === 'ssr',\n }\n}\n\nexport function createDisplay (options?: DisplayOptions, ssr?: boolean): DisplayInstance {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = ref(getClientHeight(ssr))\n const platform = shallowRef(getPlatform(ssr))\n const state = reactive({} as DisplayInstance)\n const width = ref(getClientWidth(ssr))\n\n function updateSize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n function update () {\n updateSize()\n platform.value = getPlatform()\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = width.value < breakpointValue\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform.value\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', updateSize, { passive: true })\n }\n\n return { ...toRefs(state), update, ssr: !!ssr }\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"mappings":"AAAA;AACA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,EAAEC,MAAM,EAAEC,WAAW,QAAQ,KAAK;AAAA,SACnEC,SAAS,6BAElB;AAAA,SACSC,UAAU,EAAEC,cAAc,+BAEnC;AAGA,OAAO,MAAMC,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,EAAC;;AAiEpE,OAAO,MAAMC,aAA4C,GAAGC,MAAM,CAACC,GAAG,CAAC,iBAAiB,CAAC;AAEzF,MAAMC,qBAAqC,GAAG;EAC5CC,gBAAgB,EAAE,IAAI;EACtBC,UAAU,EAAE;IACVC,EAAE,EAAE,CAAC;IACLC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,IAAI;IACRC,EAAE,EAAE,IAAI;IACRC,GAAG,EAAE;EACP;AACF,CAAC;AAED,MAAMC,mBAAmB,GAAG,SAAAA,CAAA,EAAqD;EAAA,IAApDC,OAAuB,GAAAC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S,GAAG,EAAEjD,EAAE,IAAIC,EAAE,IAAIC,GAAG,CAAC;IACpCkC,KAAK,CAACc,SAAS,GAAG,EAAEjD,EAAE,IAAIC,GAAG,CAAC;IAC9BkC,KAAK,CAACe,SAAS,GAAG,CAACjD,GAAG;IACtBkC,KAAK,CAACK,IAAI,GAAGA,IAAI;IACjBL,KAAK,CAACF,MAAM,GAAGA,MAAM,CAACK,KAAK;IAC3BH,KAAK,CAACC,KAAK,GAAGA,KAAK,CAACE,KAAK;IACzBH,KAAK,CAACO,MAAM,GAAGA,MAAM;IACrBP,KAAK,CAACzC,gBAAgB,GAAGA,gBAAgB;IACzCyC,KAAK,CAACD,QAAQ,GAAGA,QAAQ,CAACI,KAAK;IAC/BH,KAAK,CAACxC,UAAU,GAAGA,UAAU;EAC/B,CAAC,CAAC;EAEF,IAAIR,UAAU,EAAE;IACdsB,MAAM,CAAC0C,gBAAgB,CAAC,QAAQ,EAAEd,UAAU,EAAE;MAAEe,OAAO,EAAE;IAAK,CAAC,CAAC;EAClE;EAEA,OAAO;IAAE,GAAGpE,MAAM,CAACmD,KAAK,CAAC;IAAEI,MAAM;IAAER,GAAG,EAAE,CAAC,CAACA;EAAI,CAAC;AACjD;AAEA,OAAO,SAASsB,UAAUA,CAAA,EAAI;EAC5B,MAAMC,OAAO,GAAG1E,MAAM,CAACU,aAAa,CAAC;EAErC,IAAI,CAACgE,OAAO,EAAE,MAAM,IAAIC,KAAK,CAAC,0CAA0C,CAAC;EAEzE,OAAOD,OAAO;AAChB"}
|
|
1
|
+
{"version":3,"file":"display.mjs","names":["inject","reactive","shallowRef","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","breakpoints","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","arguments","length","undefined","getClientWidth","isHydrate","window","innerWidth","getClientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","touch","ssr","createDisplay","height","platform","state","width","updateSize","value","update","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"sources":["../../src/composables/display.ts"],"sourcesContent":["// Utilities\nimport { inject, reactive, shallowRef, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const breakpoints = ['sm', 'md', 'lg', 'xl', 'xxl'] as const // no xs\n\nexport type Breakpoint = typeof breakpoints[number]\n\nexport type DisplayBreakpoint = 'xs' | Breakpoint\n\nexport type DisplayThresholds = {\n [key in DisplayBreakpoint]: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: Ref<boolean>\n sm: Ref<boolean>\n md: Ref<boolean>\n lg: Ref<boolean>\n xl: Ref<boolean>\n xxl: Ref<boolean>\n smAndUp: Ref<boolean>\n mdAndUp: Ref<boolean>\n lgAndUp: Ref<boolean>\n xlAndUp: Ref<boolean>\n smAndDown: Ref<boolean>\n mdAndDown: Ref<boolean>\n lgAndDown: Ref<boolean>\n xlAndDown: Ref<boolean>\n name: Ref<DisplayBreakpoint>\n height: Ref<number>\n width: Ref<number>\n mobile: Ref<boolean>\n mobileBreakpoint: Ref<number | DisplayBreakpoint>\n platform: Ref<DisplayPlatform>\n thresholds: Ref<DisplayThresholds>\n\n /** @internal */\n ssr: boolean\n\n update (): void\n}\n\nexport const DisplaySymbol: InjectionKey<DisplayInstance> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\nfunction getClientWidth (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerWidth\n : 0\n}\n\nfunction getClientHeight (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerHeight\n : 0\n}\n\nfunction getPlatform (isHydrate?: boolean): DisplayPlatform {\n const userAgent = IN_BROWSER && !isHydrate\n ? window.navigator.userAgent\n : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr: userAgent === 'ssr',\n }\n}\n\nexport function createDisplay (options?: DisplayOptions, ssr?: boolean): DisplayInstance {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = shallowRef(getClientHeight(ssr))\n const platform = shallowRef(getPlatform(ssr))\n const state = reactive({} as DisplayInstance)\n const width = shallowRef(getClientWidth(ssr))\n\n function updateSize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n function update () {\n updateSize()\n platform.value = getPlatform()\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = width.value < breakpointValue\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform.value\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', updateSize, { passive: true })\n }\n\n return { ...toRefs(state), update, ssr: !!ssr }\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"mappings":"AAAA;AACA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,EAAEC,WAAW,QAAQ,KAAK;AAAA,SAC9DC,SAAS,6BAElB;AAAA,SACSC,UAAU,EAAEC,cAAc,+BAEnC;AAGA,OAAO,MAAMC,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,EAAC;;AAiEpE,OAAO,MAAMC,aAA4C,GAAGC,MAAM,CAACC,G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CAA0C,CAAC;EAEzE,OAAOD,OAAO;AAChB"}
|
package/lib/composables/form.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
// Composables
|
|
2
|
+
import { useProxiedModel } from "./proxiedModel.mjs"; // Utilities
|
|
3
|
+
import { computed, inject, provide, ref, shallowRef, toRef, watch } from 'vue';
|
|
4
4
|
import { consoleWarn, propsFactory } from "../util/index.mjs"; // Types
|
|
5
5
|
export const FormKey = Symbol.for('vuetify:form');
|
|
6
6
|
export const makeFormProps = propsFactory({
|
|
@@ -20,7 +20,7 @@ export function createForm(props) {
|
|
|
20
20
|
const model = useProxiedModel(props, 'modelValue');
|
|
21
21
|
const isDisabled = computed(() => props.disabled);
|
|
22
22
|
const isReadonly = computed(() => props.readonly);
|
|
23
|
-
const isValidating =
|
|
23
|
+
const isValidating = shallowRef(false);
|
|
24
24
|
const items = ref([]);
|
|
25
25
|
const errors = ref([]);
|
|
26
26
|
async function validate() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","
|
|
1
|
+
{"version":3,"file":"form.mjs","names":["useProxiedModel","computed","inject","provide","ref","shallowRef","toRef","watch","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","_ref","some","unregister","filter","update","found","find","useForm"],"sources":["../../src/composables/form.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, inject, provide, ref, shallowRef, toRef, watch } from 'vue'\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\nexport interface FormField {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n isValid: boolean | null\n errorMessages: string[]\n}\n\nexport interface FieldValidationResult {\n id: number | string\n errorMessages: string[]\n}\n\nexport interface 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 = shallowRef(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;AAAA,SACSA,eAAe,8BAExB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACrEC,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;EACjBC,QAAQ,EAAED,OAAO;EACjBE,QAAQ,EAAEF,OAAO;EACjBG,UAAU,EAAE;IACVC,IAAI,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// Composables
|
|
2
|
+
import { useDisplay } from "./display.mjs"; // Utilities
|
|
3
3
|
import { IN_BROWSER } from "../util/index.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { onMounted, shallowRef } from 'vue';
|
|
5
5
|
export function useHydration() {
|
|
6
|
-
if (!IN_BROWSER) return
|
|
6
|
+
if (!IN_BROWSER) return shallowRef(false);
|
|
7
7
|
const {
|
|
8
8
|
ssr
|
|
9
9
|
} = useDisplay();
|
|
10
10
|
if (ssr) {
|
|
11
|
-
const isMounted =
|
|
11
|
+
const isMounted = shallowRef(false);
|
|
12
12
|
onMounted(() => {
|
|
13
13
|
isMounted.value = true;
|
|
14
14
|
});
|
|
15
15
|
return isMounted;
|
|
16
16
|
} else {
|
|
17
|
-
return
|
|
17
|
+
return shallowRef(true);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=hydration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration.mjs","names":["
|
|
1
|
+
{"version":3,"file":"hydration.mjs","names":["useDisplay","IN_BROWSER","onMounted","shallowRef","useHydration","ssr","isMounted","value"],"sources":["../../src/composables/hydration.ts"],"sourcesContent":["// Composables\nimport { useDisplay } from '@/composables/display'\n\n// Utilities\nimport { IN_BROWSER } from '@/util'\nimport { onMounted, shallowRef } from 'vue'\n\nexport function useHydration () {\n if (!IN_BROWSER) return shallowRef(false)\n\n const { ssr } = useDisplay()\n\n if (ssr) {\n const isMounted = shallowRef(false)\n onMounted(() => {\n isMounted.value = true\n })\n return isMounted\n } else {\n return shallowRef(true)\n }\n}\n"],"mappings":"AAAA;AAAA,SACSA,UAAU,yBAEnB;AAAA,SACSC,UAAU;AACnB,SAASC,SAAS,EAAEC,UAAU,QAAQ,KAAK;AAE3C,OAAO,SAASC,YAAYA,CAAA,EAAI;EAC9B,IAAI,CAACH,UAAU,EAAE,OAAOE,UAAU,CAAC,KAAK,CAAC;EAEzC,MAAM;IAAEE;EAAI,CAAC,GAAGL,UAAU,EAAE;EAE5B,IAAIK,GAAG,EAAE;IACP,MAAMC,SAAS,GAAGH,UAAU,CAAC,KAAK,CAAC;IACnCD,SAAS,CAAC,MAAM;MACdI,SAAS,CAACC,KAAK,GAAG,IAAI;IACxB,CAAC,CAAC;IACF,OAAOD,SAAS;EAClB,CAAC,MAAM;IACL,OAAOH,UAAU,CAAC,IAAI,CAAC;EACzB;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Utilities
|
|
2
|
-
import { onBeforeUnmount, ref, watch } from 'vue';
|
|
2
|
+
import { onBeforeUnmount, ref, shallowRef, watch } from 'vue';
|
|
3
3
|
import { SUPPORTS_INTERSECTION } from "../util/index.mjs";
|
|
4
4
|
export function useIntersectionObserver(callback, options) {
|
|
5
5
|
const intersectionRef = ref();
|
|
6
|
-
const isIntersecting =
|
|
6
|
+
const isIntersecting = shallowRef(false);
|
|
7
7
|
if (SUPPORTS_INTERSECTION) {
|
|
8
8
|
const observer = new IntersectionObserver(entries => {
|
|
9
9
|
callback?.(entries, observer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersectionObserver.mjs","names":["onBeforeUnmount","ref","watch","SUPPORTS_INTERSECTION","useIntersectionObserver","callback","options","intersectionRef","isIntersecting","observer","IntersectionObserver","entries","value","find","entry","disconnect","newValue","oldValue","unobserve","observe","flush"],"sources":["../../src/composables/intersectionObserver.ts"],"sourcesContent":["// Utilities\nimport { onBeforeUnmount, ref, watch } from 'vue'\nimport { SUPPORTS_INTERSECTION } from '@/util'\n\nexport function useIntersectionObserver (callback?: IntersectionObserverCallback, options?: IntersectionObserverInit) {\n const intersectionRef = ref<HTMLElement>()\n const isIntersecting =
|
|
1
|
+
{"version":3,"file":"intersectionObserver.mjs","names":["onBeforeUnmount","ref","shallowRef","watch","SUPPORTS_INTERSECTION","useIntersectionObserver","callback","options","intersectionRef","isIntersecting","observer","IntersectionObserver","entries","value","find","entry","disconnect","newValue","oldValue","unobserve","observe","flush"],"sources":["../../src/composables/intersectionObserver.ts"],"sourcesContent":["// Utilities\nimport { onBeforeUnmount, ref, shallowRef, watch } from 'vue'\nimport { SUPPORTS_INTERSECTION } from '@/util'\n\nexport function useIntersectionObserver (callback?: IntersectionObserverCallback, options?: IntersectionObserverInit) {\n const intersectionRef = ref<HTMLElement>()\n const isIntersecting = shallowRef(false)\n\n if (SUPPORTS_INTERSECTION) {\n const observer = new IntersectionObserver((entries: IntersectionObserverEntry[]) => {\n callback?.(entries, observer)\n\n isIntersecting.value = !!entries.find(entry => entry.isIntersecting)\n }, options)\n\n onBeforeUnmount(() => {\n observer.disconnect()\n })\n\n watch(intersectionRef, (newValue, oldValue) => {\n if (oldValue) {\n observer.unobserve(oldValue)\n isIntersecting.value = false\n }\n\n if (newValue) observer.observe(newValue)\n }, {\n flush: 'post',\n })\n }\n\n return { intersectionRef, isIntersecting }\n}\n"],"mappings":"AAAA;AACA,SAASA,eAAe,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACpDC,qBAAqB;AAE9B,OAAO,SAASC,uBAAuBA,CAAEC,QAAuC,EAAEC,OAAkC,EAAE;EACpH,MAAMC,eAAe,GAAGP,GAAG,EAAe;EAC1C,MAAMQ,cAAc,GAAGP,UAAU,CAAC,KAAK,CAAC;EAExC,IAAIE,qBAAqB,EAAE;IACzB,MAAMM,QAAQ,GAAG,IAAIC,oBAAoB,CAAEC,OAAoC,IAAK;MAClFN,QAAQ,GAAGM,OAAO,EAAEF,QAAQ,CAAC;MAE7BD,cAAc,CAACI,KAAK,GAAG,CAAC,CAACD,OAAO,CAACE,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACN,cAAc,CAAC;IACtE,CAAC,EAAEF,OAAO,CAAC;IAEXP,eAAe,CAAC,MAAM;MACpBU,QAAQ,CAACM,UAAU,EAAE;IACvB,CAAC,CAAC;IAEFb,KAAK,CAACK,eAAe,EAAE,CAACS,QAAQ,EAAEC,QAAQ,KAAK;MAC7C,IAAIA,QAAQ,EAAE;QACZR,QAAQ,CAACS,SAAS,CAACD,QAAQ,CAAC;QAC5BT,cAAc,CAACI,KAAK,GAAG,KAAK;MAC9B;MAEA,IAAII,QAAQ,EAAEP,QAAQ,CAACU,OAAO,CAACH,QAAQ,CAAC;IAC1C,CAAC,EAAE;MACDI,KAAK,EAAE;IACT,CAAC,CAAC;EACJ;EAEA,OAAO;IAAEb,eAAe;IAAEC;EAAe,CAAC;AAC5C"}
|