vuetify 3.6.15 → 3.7.0
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 +182 -26
- package/dist/json/importMap-labs.json +30 -30
- package/dist/json/importMap.json +150 -150
- package/dist/json/tags.json +44 -5
- package/dist/json/web-types.json +445 -42
- package/dist/vuetify-labs.css +2359 -2344
- package/dist/vuetify-labs.d.ts +690 -341
- package/dist/vuetify-labs.esm.js +253 -211
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +252 -210
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +2553 -2538
- package/dist/vuetify.d.ts +559 -315
- package/dist/vuetify.esm.js +189 -127
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +188 -126
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +160 -156
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VApp/VApp.mjs +2 -5
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/index.d.mts +6 -6
- package/lib/components/VAppBar/VAppBar.mjs +5 -5
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.mts +8 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs +15 -8
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +78 -49
- package/lib/components/VAvatar/VAvatar.css +9 -0
- package/lib/components/VAvatar/VAvatar.mjs +6 -1
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.sass +1 -0
- package/lib/components/VAvatar/_variables.scss +13 -0
- package/lib/components/VAvatar/index.d.mts +6 -0
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +2 -3
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/index.d.mts +2 -2
- package/lib/components/VBreadcrumbs/index.d.mts +8 -8
- package/lib/components/VBtn/VBtn.css +0 -4
- package/lib/components/VBtn/VBtn.mjs +3 -1
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.sass +0 -6
- package/lib/components/VBtn/_variables.scss +0 -1
- package/lib/components/VBtn/index.d.mts +6 -0
- package/lib/components/VCard/VCard.css +1 -0
- package/lib/components/VCard/VCard.sass +1 -0
- package/lib/components/VCard/_variables.scss +7 -3
- package/lib/components/VCarousel/index.d.mts +9 -0
- package/lib/components/VCheckbox/index.d.mts +7 -6
- package/lib/components/VCombobox/VCombobox.mjs +15 -8
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.mts +78 -49
- package/lib/components/VDialog/index.d.mts +3 -3
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +7 -2
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
- package/lib/components/VExpansionPanel/index.d.mts +72 -0
- package/lib/components/VFab/index.d.mts +6 -0
- package/lib/components/VFileInput/index.d.mts +19 -18
- package/lib/components/VFooter/VFooter.mjs +1 -3
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/index.d.mts +3 -3
- package/lib/components/VForm/index.d.mts +10 -9
- package/lib/components/VGrid/VContainer.mjs +6 -1
- package/lib/components/VGrid/VContainer.mjs.map +1 -1
- package/lib/components/VGrid/index.d.mts +36 -0
- package/lib/components/VImg/VImg.css +9 -0
- package/lib/components/VImg/VImg.mjs +2 -0
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/VImg.sass +9 -0
- package/lib/components/VImg/index.d.mts +9 -0
- package/lib/components/VInput/index.d.mts +7 -6
- package/lib/components/VLayout/VLayout.mjs +2 -5
- package/lib/components/VLayout/VLayout.mjs.map +1 -1
- package/lib/components/VLayout/VLayoutItem.mjs +4 -6
- package/lib/components/VLayout/VLayoutItem.mjs.map +1 -1
- package/lib/components/VLayout/index.d.mts +9 -9
- package/lib/components/VList/VListItem.css +2 -2
- package/lib/components/VList/VListItem.mjs +3 -1
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +1 -1
- package/lib/components/VList/index.d.mts +19 -18
- package/lib/components/VMain/VMain.mjs +2 -3
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/index.d.mts +2 -2
- package/lib/components/VMenu/VMenu.mjs +26 -8
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.mts +30 -15
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +3 -4
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.mjs +5 -4
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs +0 -6
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +3 -2
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.mts +7 -6
- package/lib/components/VRangeSlider/index.d.mts +7 -6
- package/lib/components/VSelect/VSelect.mjs +15 -13
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.mts +78 -49
- package/lib/components/VSelect/useScrolling.mjs +3 -3
- package/lib/components/VSelect/useScrolling.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.mjs +3 -1
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.mts +6 -0
- package/lib/components/VSlider/index.d.mts +7 -6
- package/lib/components/VSnackbar/index.d.mts +3 -3
- package/lib/components/VSpeedDial/VSpeedDial.mjs +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.mjs.map +1 -1
- package/lib/components/VSpeedDial/index.d.mts +28 -13
- package/lib/components/VSwitch/index.d.mts +7 -6
- package/lib/components/VTabs/index.d.mts +21 -3
- package/lib/components/VTextField/index.d.mts +19 -18
- package/lib/components/VTextarea/index.d.mts +19 -18
- package/lib/components/VTooltip/index.d.mts +3 -3
- package/lib/components/VValidation/index.d.mts +7 -6
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +2 -0
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.d.mts +3 -0
- package/lib/components/index.d.mts +504 -259
- package/lib/composables/layout.mjs +37 -14
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +3 -3
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/nested/openStrategies.mjs +4 -2
- package/lib/composables/nested/openStrategies.mjs.map +1 -1
- package/lib/composables/nested/selectStrategies.mjs +5 -5
- package/lib/composables/nested/selectStrategies.mjs.map +1 -1
- package/lib/composables/validation.mjs +8 -6
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/virtual.mjs +1 -0
- 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 +55 -56
- package/lib/labs/VDateInput/index.d.mts +7 -6
- package/lib/labs/VNumberInput/index.d.mts +43 -42
- package/lib/labs/VPullToRefresh/VPullToRefresh.mjs +4 -3
- package/lib/labs/VPullToRefresh/VPullToRefresh.mjs.map +1 -1
- package/lib/labs/VPullToRefresh/index.d.mts +9 -0
- package/lib/labs/VSnackbarQueue/index.d.mts +3 -3
- package/lib/labs/VStepperVertical/index.d.mts +36 -0
- package/lib/labs/VTreeview/VTreeview.mjs +21 -6
- package/lib/labs/VTreeview/VTreeview.mjs.map +1 -1
- package/lib/labs/VTreeview/VTreeviewChildren.mjs +33 -10
- package/lib/labs/VTreeview/VTreeviewChildren.mjs.map +1 -1
- package/lib/labs/VTreeview/VTreeviewItem.css +1 -1
- package/lib/labs/VTreeview/VTreeviewItem.mjs +14 -74
- package/lib/labs/VTreeview/VTreeviewItem.mjs.map +1 -1
- package/lib/labs/VTreeview/VTreeviewItem.sass +2 -5
- package/lib/labs/VTreeview/index.d.mts +133 -95
- package/lib/labs/components.d.mts +193 -109
- package/lib/util/helpers.mjs +5 -0
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -12,7 +12,8 @@ declare const EventProp: <T extends any[] = any[]>() => PropType<EventProp<T>>;
|
|
|
12
12
|
|
|
13
13
|
type ValidationResult = string | boolean;
|
|
14
14
|
type ValidationRule = ValidationResult | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>);
|
|
15
|
-
type ValidateOnValue = 'blur' | 'input' | 'submit';
|
|
15
|
+
type ValidateOnValue = 'blur' | 'input' | 'submit' | 'invalid-input';
|
|
16
|
+
type ValidateOn = ValidateOnValue | `${ValidateOnValue} lazy` | `${ValidateOnValue} eager` | `lazy ${ValidateOnValue}` | `eager ${ValidateOnValue}` | 'lazy' | 'eager';
|
|
16
17
|
interface ValidationProps {
|
|
17
18
|
disabled: boolean | null;
|
|
18
19
|
error: boolean;
|
|
@@ -25,7 +26,7 @@ interface ValidationProps {
|
|
|
25
26
|
rules: readonly ValidationRule[];
|
|
26
27
|
modelValue: any;
|
|
27
28
|
'onUpdate:modelValue': EventProp | undefined;
|
|
28
|
-
validateOn?:
|
|
29
|
+
validateOn?: ValidateOn;
|
|
29
30
|
validationValue: any;
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -54,7 +55,7 @@ declare const VForm: {
|
|
|
54
55
|
disabled: boolean;
|
|
55
56
|
readonly: boolean;
|
|
56
57
|
modelValue: boolean | null;
|
|
57
|
-
validateOn: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
58
|
+
validateOn: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
58
59
|
fastFail: boolean;
|
|
59
60
|
} & {
|
|
60
61
|
class?: any;
|
|
@@ -223,7 +224,7 @@ declare const VForm: {
|
|
|
223
224
|
disabled: boolean;
|
|
224
225
|
readonly: boolean;
|
|
225
226
|
modelValue: boolean | null;
|
|
226
|
-
validateOn: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
227
|
+
validateOn: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
227
228
|
fastFail: boolean;
|
|
228
229
|
} & {
|
|
229
230
|
class?: any;
|
|
@@ -360,7 +361,7 @@ declare const VForm: {
|
|
|
360
361
|
disabled: boolean;
|
|
361
362
|
readonly: boolean;
|
|
362
363
|
modelValue: boolean | null;
|
|
363
|
-
validateOn: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
364
|
+
validateOn: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
364
365
|
fastFail: boolean;
|
|
365
366
|
}, true, {}, vue.SlotsType<Partial<{
|
|
366
367
|
default: (arg: {
|
|
@@ -405,7 +406,7 @@ declare const VForm: {
|
|
|
405
406
|
disabled: boolean;
|
|
406
407
|
readonly: boolean;
|
|
407
408
|
modelValue: boolean | null;
|
|
408
|
-
validateOn: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
409
|
+
validateOn: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
409
410
|
fastFail: boolean;
|
|
410
411
|
} & {
|
|
411
412
|
class?: any;
|
|
@@ -571,7 +572,7 @@ declare const VForm: {
|
|
|
571
572
|
disabled: boolean;
|
|
572
573
|
readonly: boolean;
|
|
573
574
|
modelValue: boolean | null;
|
|
574
|
-
validateOn: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
575
|
+
validateOn: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
575
576
|
fastFail: boolean;
|
|
576
577
|
}>;
|
|
577
578
|
__isFragment?: never;
|
|
@@ -582,7 +583,7 @@ declare const VForm: {
|
|
|
582
583
|
disabled: boolean;
|
|
583
584
|
readonly: boolean;
|
|
584
585
|
modelValue: boolean | null;
|
|
585
|
-
validateOn: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
586
|
+
validateOn: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
586
587
|
fastFail: boolean;
|
|
587
588
|
} & {
|
|
588
589
|
class?: any;
|
|
@@ -751,7 +752,7 @@ declare const VForm: {
|
|
|
751
752
|
disabled: boolean;
|
|
752
753
|
readonly: boolean;
|
|
753
754
|
modelValue: boolean | null;
|
|
754
|
-
validateOn: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
755
|
+
validateOn: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
755
756
|
fastFail: boolean;
|
|
756
757
|
}, {}, string, vue.SlotsType<Partial<{
|
|
757
758
|
default: (arg: {
|
|
@@ -4,6 +4,7 @@ import "./VGrid.css";
|
|
|
4
4
|
|
|
5
5
|
// Composables
|
|
6
6
|
import { makeComponentProps } from "../../composables/component.mjs";
|
|
7
|
+
import { makeDimensionProps, useDimension } from "../../composables/dimensions.mjs";
|
|
7
8
|
import { useRtl } from "../../composables/locale.mjs";
|
|
8
9
|
import { makeTagProps } from "../../composables/tag.mjs"; // Utilities
|
|
9
10
|
import { genericComponent, propsFactory, useRender } from "../../util/index.mjs";
|
|
@@ -13,6 +14,7 @@ export const makeVContainerProps = propsFactory({
|
|
|
13
14
|
default: false
|
|
14
15
|
},
|
|
15
16
|
...makeComponentProps(),
|
|
17
|
+
...makeDimensionProps(),
|
|
16
18
|
...makeTagProps()
|
|
17
19
|
}, 'VContainer');
|
|
18
20
|
export const VContainer = genericComponent()({
|
|
@@ -25,11 +27,14 @@ export const VContainer = genericComponent()({
|
|
|
25
27
|
const {
|
|
26
28
|
rtlClasses
|
|
27
29
|
} = useRtl();
|
|
30
|
+
const {
|
|
31
|
+
dimensionStyles
|
|
32
|
+
} = useDimension(props);
|
|
28
33
|
useRender(() => _createVNode(props.tag, {
|
|
29
34
|
"class": ['v-container', {
|
|
30
35
|
'v-container--fluid': props.fluid
|
|
31
36
|
}, rtlClasses.value, props.class],
|
|
32
|
-
"style": props.style
|
|
37
|
+
"style": [dimensionStyles.value, props.style]
|
|
33
38
|
}, slots));
|
|
34
39
|
return {};
|
|
35
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VContainer.mjs","names":["makeComponentProps","useRtl","makeTagProps","genericComponent","propsFactory","useRender","makeVContainerProps","fluid","type","Boolean","default","VContainer","name","props","setup","_ref","slots","rtlClasses","_createVNode","tag","value","class","style"],"sources":["../../../src/components/VGrid/VContainer.tsx"],"sourcesContent":["// Styles\nimport './VGrid.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { useRtl } from '@/composables/locale'\nimport { makeTagProps } from '@/composables/tag'\n\n// Utilities\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVContainerProps = propsFactory({\n fluid: {\n type: Boolean,\n default: false,\n },\n\n ...makeComponentProps(),\n ...makeTagProps(),\n}, 'VContainer')\n\nexport const VContainer = genericComponent()({\n name: 'VContainer',\n\n props: makeVContainerProps(),\n\n setup (props, { slots }) {\n const { rtlClasses } = useRtl()\n\n useRender(() => (\n <props.tag\n class={[\n 'v-container',\n { 'v-container--fluid': props.fluid },\n rtlClasses.value,\n props.class,\n ]}\n style={
|
|
1
|
+
{"version":3,"file":"VContainer.mjs","names":["makeComponentProps","makeDimensionProps","useDimension","useRtl","makeTagProps","genericComponent","propsFactory","useRender","makeVContainerProps","fluid","type","Boolean","default","VContainer","name","props","setup","_ref","slots","rtlClasses","dimensionStyles","_createVNode","tag","value","class","style"],"sources":["../../../src/components/VGrid/VContainer.tsx"],"sourcesContent":["// Styles\nimport './VGrid.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { useRtl } from '@/composables/locale'\nimport { makeTagProps } from '@/composables/tag'\n\n// Utilities\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVContainerProps = propsFactory({\n fluid: {\n type: Boolean,\n default: false,\n },\n\n ...makeComponentProps(),\n ...makeDimensionProps(),\n ...makeTagProps(),\n}, 'VContainer')\n\nexport const VContainer = genericComponent()({\n name: 'VContainer',\n\n props: makeVContainerProps(),\n\n setup (props, { slots }) {\n const { rtlClasses } = useRtl()\n const { dimensionStyles } = useDimension(props)\n\n useRender(() => (\n <props.tag\n class={[\n 'v-container',\n { 'v-container--fluid': props.fluid },\n rtlClasses.value,\n props.class,\n ]}\n style={[\n dimensionStyles.value,\n props.style,\n ]}\n v-slots={ slots }\n />\n ))\n\n return {}\n },\n})\n\nexport type VContainer = InstanceType<typeof VContainer>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,MAAM;AAAA,SACNC,YAAY,qCAErB;AAAA,SACSC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS;AAElD,OAAO,MAAMC,mBAAmB,GAAGF,YAAY,CAAC;EAC9CG,KAAK,EAAE;IACLC,IAAI,EAAEC,OAAO;IACbC,OAAO,EAAE;EACX,CAAC;EAED,GAAGZ,kBAAkB,CAAC,CAAC;EACvB,GAAGC,kBAAkB,CAAC,CAAC;EACvB,GAAGG,YAAY,CAAC;AAClB,CAAC,EAAE,YAAY,CAAC;AAEhB,OAAO,MAAMS,UAAU,GAAGR,gBAAgB,CAAC,CAAC,CAAC;EAC3CS,IAAI,EAAE,YAAY;EAElBC,KAAK,EAAEP,mBAAmB,CAAC,CAAC;EAE5BQ,KAAKA,CAAED,KAAK,EAAAE,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACrB,MAAM;MAAEE;IAAW,CAAC,GAAGhB,MAAM,CAAC,CAAC;IAC/B,MAAM;MAAEiB;IAAgB,CAAC,GAAGlB,YAAY,CAACa,KAAK,CAAC;IAE/CR,SAAS,CAAC,MAAAc,YAAA,CAAAN,KAAA,CAAAO,GAAA;MAAA,SAEC,CACL,aAAa,EACb;QAAE,oBAAoB,EAAEP,KAAK,CAACN;MAAM,CAAC,EACrCU,UAAU,CAACI,KAAK,EAChBR,KAAK,CAACS,KAAK,CACZ;MAAA,SACM,CACLJ,eAAe,CAACG,KAAK,EACrBR,KAAK,CAACU,KAAK;IACZ,GACSP,KAAK,CAElB,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -13,6 +13,12 @@ declare const VContainer: {
|
|
|
13
13
|
tag: string;
|
|
14
14
|
fluid: boolean;
|
|
15
15
|
} & {
|
|
16
|
+
height?: string | number | undefined;
|
|
17
|
+
width?: string | number | undefined;
|
|
18
|
+
maxHeight?: string | number | undefined;
|
|
19
|
+
maxWidth?: string | number | undefined;
|
|
20
|
+
minHeight?: string | number | undefined;
|
|
21
|
+
minWidth?: string | number | undefined;
|
|
16
22
|
class?: any;
|
|
17
23
|
} & {
|
|
18
24
|
$children?: vue.VNodeChild | {
|
|
@@ -28,6 +34,12 @@ declare const VContainer: {
|
|
|
28
34
|
tag: string;
|
|
29
35
|
fluid: boolean;
|
|
30
36
|
} & {
|
|
37
|
+
height?: string | number | undefined;
|
|
38
|
+
width?: string | number | undefined;
|
|
39
|
+
maxHeight?: string | number | undefined;
|
|
40
|
+
maxWidth?: string | number | undefined;
|
|
41
|
+
minHeight?: string | number | undefined;
|
|
42
|
+
minWidth?: string | number | undefined;
|
|
31
43
|
class?: any;
|
|
32
44
|
} & {
|
|
33
45
|
$children?: vue.VNodeChild | {
|
|
@@ -56,6 +68,12 @@ declare const VContainer: {
|
|
|
56
68
|
tag: string;
|
|
57
69
|
fluid: boolean;
|
|
58
70
|
} & {
|
|
71
|
+
height?: string | number | undefined;
|
|
72
|
+
width?: string | number | undefined;
|
|
73
|
+
maxHeight?: string | number | undefined;
|
|
74
|
+
maxWidth?: string | number | undefined;
|
|
75
|
+
minHeight?: string | number | undefined;
|
|
76
|
+
minWidth?: string | number | undefined;
|
|
59
77
|
class?: any;
|
|
60
78
|
} & {
|
|
61
79
|
$children?: vue.VNodeChild | {
|
|
@@ -79,6 +97,12 @@ declare const VContainer: {
|
|
|
79
97
|
tag: string;
|
|
80
98
|
fluid: boolean;
|
|
81
99
|
} & {
|
|
100
|
+
height?: string | number | undefined;
|
|
101
|
+
width?: string | number | undefined;
|
|
102
|
+
maxHeight?: string | number | undefined;
|
|
103
|
+
maxWidth?: string | number | undefined;
|
|
104
|
+
minHeight?: string | number | undefined;
|
|
105
|
+
minWidth?: string | number | undefined;
|
|
82
106
|
class?: any;
|
|
83
107
|
} & {
|
|
84
108
|
$children?: vue.VNodeChild | {
|
|
@@ -100,6 +124,12 @@ declare const VContainer: {
|
|
|
100
124
|
type: StringConstructor;
|
|
101
125
|
default: string;
|
|
102
126
|
};
|
|
127
|
+
height: (StringConstructor | NumberConstructor)[];
|
|
128
|
+
maxHeight: (StringConstructor | NumberConstructor)[];
|
|
129
|
+
maxWidth: (StringConstructor | NumberConstructor)[];
|
|
130
|
+
minHeight: (StringConstructor | NumberConstructor)[];
|
|
131
|
+
minWidth: (StringConstructor | NumberConstructor)[];
|
|
132
|
+
width: (StringConstructor | NumberConstructor)[];
|
|
103
133
|
class: vue.PropType<ClassValue>;
|
|
104
134
|
style: {
|
|
105
135
|
type: vue.PropType<vue.StyleValue>;
|
|
@@ -114,6 +144,12 @@ declare const VContainer: {
|
|
|
114
144
|
type: StringConstructor;
|
|
115
145
|
default: string;
|
|
116
146
|
};
|
|
147
|
+
height: (StringConstructor | NumberConstructor)[];
|
|
148
|
+
maxHeight: (StringConstructor | NumberConstructor)[];
|
|
149
|
+
maxWidth: (StringConstructor | NumberConstructor)[];
|
|
150
|
+
minHeight: (StringConstructor | NumberConstructor)[];
|
|
151
|
+
minWidth: (StringConstructor | NumberConstructor)[];
|
|
152
|
+
width: (StringConstructor | NumberConstructor)[];
|
|
117
153
|
class: vue.PropType<ClassValue>;
|
|
118
154
|
style: {
|
|
119
155
|
type: vue.PropType<vue.StyleValue>;
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
--v-theme-overlay-multiplier: 3;
|
|
3
3
|
z-index: 0;
|
|
4
4
|
}
|
|
5
|
+
.v-img.v-img--absolute {
|
|
6
|
+
height: 100%;
|
|
7
|
+
left: 0;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: 0;
|
|
11
|
+
width: 100%;
|
|
12
|
+
z-index: -1;
|
|
13
|
+
}
|
|
5
14
|
.v-img--booting .v-responsive__sizer {
|
|
6
15
|
transition: none;
|
|
7
16
|
}
|
|
@@ -13,6 +13,7 @@ import { computed, nextTick, onBeforeMount, onBeforeUnmount, ref, shallowRef, to
|
|
|
13
13
|
import { convertToUnit, genericComponent, getCurrentInstance, propsFactory, SUPPORTS_INTERSECTION, useRender } from "../../util/index.mjs"; // Types
|
|
14
14
|
// not intended for public use, this is passed in by vuetify-loader
|
|
15
15
|
export const makeVImgProps = propsFactory({
|
|
16
|
+
absolute: Boolean,
|
|
16
17
|
alt: String,
|
|
17
18
|
cover: Boolean,
|
|
18
19
|
color: String,
|
|
@@ -269,6 +270,7 @@ export const VImg = genericComponent()({
|
|
|
269
270
|
const responsiveProps = VResponsive.filterProps(props);
|
|
270
271
|
return _withDirectives(_createVNode(VResponsive, _mergeProps({
|
|
271
272
|
"class": ['v-img', {
|
|
273
|
+
'v-img--absolute': props.absolute,
|
|
272
274
|
'v-img--booting': !isBooted.value
|
|
273
275
|
}, backgroundColorClasses.value, roundedClasses.value, props.class],
|
|
274
276
|
"style": [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VImg.mjs","names":["makeVResponsiveProps","VResponsive","useBackgroundColor","makeComponentProps","makeRoundedProps","useRounded","makeTransitionProps","MaybeTransition","intersect","computed","nextTick","onBeforeMount","onBeforeUnmount","ref","shallowRef","toRef","vShow","watch","withDirectives","convertToUnit","genericComponent","getCurrentInstance","propsFactory","SUPPORTS_INTERSECTION","useRender","makeVImgProps","alt","String","cover","Boolean","color","draggable","type","default","undefined","eager","gradient","lazySrc","options","Object","root","rootMargin","threshold","sizes","src","crossorigin","referrerpolicy","srcset","position","VImg","name","directives","props","emits","loadstart","value","load","error","setup","_ref","emit","slots","backgroundColorClasses","backgroundColorStyles","roundedClasses","vm","currentSrc","image","state","naturalWidth","naturalHeight","normalisedSrc","aspect","Number","aspectRatio","init","val","oldVal","pollForSize","isIntersecting","lazyImg","Image","setTimeout","isUnmounted","complete","onError","onLoad","getSrc","img","timer","clearTimeout","timeout","arguments","length","poll","imgHeight","imgWidth","window","endsWith","startsWith","containClasses","__image","_createVNode","objectPosition","sources","transition","__preloadImage","__placeholder","placeholder","__error","__gradient","backgroundImage","isBooted","stop","requestAnimationFrame","responsiveProps","filterProps","_withDirectives","_mergeProps","class","width","style","additional","_Fragment","_resolveDirective","handler","once"],"sources":["../../../src/components/VImg/VImg.tsx"],"sourcesContent":["// Styles\nimport './VImg.sass'\n\n// Components\nimport { makeVResponsiveProps, VResponsive } from '@/components/VResponsive/VResponsive'\n\n// Composables\nimport { useBackgroundColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTransitionProps, MaybeTransition } from '@/composables/transition'\n\n// Directives\nimport intersect from '@/directives/intersect'\n\n// Utilities\nimport {\n computed,\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n ref,\n shallowRef,\n toRef,\n vShow,\n watch,\n withDirectives,\n} from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n getCurrentInstance,\n propsFactory,\n SUPPORTS_INTERSECTION,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\n// not intended for public use, this is passed in by vuetify-loader\nexport interface srcObject {\n src?: string\n srcset?: string\n lazySrc?: string\n aspect: number\n}\n\nexport type VImgSlots = {\n default: never\n placeholder: never\n error: never\n sources: never\n}\n\nexport const makeVImgProps = propsFactory({\n alt: String,\n cover: Boolean,\n color: String,\n draggable: {\n type: [Boolean, String] as PropType<boolean | 'true' | 'false'>,\n default: undefined,\n },\n eager: Boolean,\n gradient: String,\n lazySrc: String,\n options: {\n type: Object as PropType<IntersectionObserverInit>,\n // For more information on types, navigate to:\n // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n default: () => ({\n root: undefined,\n rootMargin: undefined,\n threshold: undefined,\n }),\n },\n sizes: String,\n src: {\n type: [String, Object] as PropType<string | srcObject>,\n default: '',\n },\n crossorigin: String as PropType<'' | 'anonymous' | 'use-credentials'>,\n referrerpolicy: String as PropType<\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'same-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url'\n >,\n srcset: String,\n position: String,\n\n ...makeVResponsiveProps(),\n ...makeComponentProps(),\n ...makeRoundedProps(),\n ...makeTransitionProps(),\n}, 'VImg')\n\nexport const VImg = genericComponent<VImgSlots>()({\n name: 'VImg',\n\n directives: { intersect },\n\n props: makeVImgProps(),\n\n emits: {\n loadstart: (value: string | undefined) => true,\n load: (value: string | undefined) => true,\n error: (value: string | undefined) => true,\n },\n\n setup (props, { emit, slots }) {\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'color'))\n const { roundedClasses } = useRounded(props)\n const vm = getCurrentInstance('VImg')\n\n const currentSrc = shallowRef('') // Set from srcset\n const image = ref<HTMLImageElement>()\n const state = shallowRef<'idle' | 'loading' | 'loaded' | 'error'>(props.eager ? 'loading' : 'idle')\n const naturalWidth = shallowRef<number>()\n const naturalHeight = shallowRef<number>()\n\n const normalisedSrc = computed<srcObject>(() => {\n return props.src && typeof props.src === 'object'\n ? {\n src: props.src.src,\n srcset: props.srcset || props.src.srcset,\n lazySrc: props.lazySrc || props.src.lazySrc,\n aspect: Number(props.aspectRatio || props.src.aspect || 0),\n } : {\n src: props.src,\n srcset: props.srcset,\n lazySrc: props.lazySrc,\n aspect: Number(props.aspectRatio || 0),\n }\n })\n const aspectRatio = computed(() => {\n return normalisedSrc.value.aspect || naturalWidth.value! / naturalHeight.value! || 0\n })\n\n watch(() => props.src, () => {\n init(state.value !== 'idle')\n })\n watch(aspectRatio, (val, oldVal) => {\n if (!val && oldVal && image.value) {\n pollForSize(image.value)\n }\n })\n\n // TODO: getSrc when window width changes\n\n onBeforeMount(() => init())\n\n function init (isIntersecting?: boolean) {\n if (props.eager && isIntersecting) return\n if (\n SUPPORTS_INTERSECTION &&\n !isIntersecting &&\n !props.eager\n ) return\n\n state.value = 'loading'\n\n if (normalisedSrc.value.lazySrc) {\n const lazyImg = new Image()\n lazyImg.src = normalisedSrc.value.lazySrc\n pollForSize(lazyImg, null)\n }\n\n if (!normalisedSrc.value.src) return\n\n nextTick(() => {\n emit('loadstart', image.value?.currentSrc || normalisedSrc.value.src)\n\n setTimeout(() => {\n if (vm.isUnmounted) return\n\n if (image.value?.complete) {\n if (!image.value.naturalWidth) {\n onError()\n }\n\n if (state.value === 'error') return\n\n if (!aspectRatio.value) pollForSize(image.value, null)\n if (state.value === 'loading') onLoad()\n } else {\n if (!aspectRatio.value) pollForSize(image.value!)\n getSrc()\n }\n })\n })\n }\n\n function onLoad () {\n if (vm.isUnmounted) return\n\n getSrc()\n pollForSize(image.value!)\n state.value = 'loaded'\n emit('load', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function onError () {\n if (vm.isUnmounted) return\n\n state.value = 'error'\n emit('error', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function getSrc () {\n const img = image.value\n if (img) currentSrc.value = img.currentSrc || img.src\n }\n\n let timer = -1\n\n onBeforeUnmount(() => {\n clearTimeout(timer)\n })\n\n function pollForSize (img: HTMLImageElement, timeout: number | null = 100) {\n const poll = () => {\n clearTimeout(timer)\n if (vm.isUnmounted) return\n\n const { naturalHeight: imgHeight, naturalWidth: imgWidth } = img\n\n if (imgHeight || imgWidth) {\n naturalWidth.value = imgWidth\n naturalHeight.value = imgHeight\n } else if (!img.complete && state.value === 'loading' && timeout != null) {\n timer = window.setTimeout(poll, timeout)\n } else if (img.currentSrc.endsWith('.svg') || img.currentSrc.startsWith('data:image/svg+xml')) {\n naturalWidth.value = 1\n naturalHeight.value = 1\n }\n }\n\n poll()\n }\n\n const containClasses = computed(() => ({\n 'v-img__img--cover': props.cover,\n 'v-img__img--contain': !props.cover,\n }))\n\n const __image = () => {\n if (!normalisedSrc.value.src || state.value === 'idle') return null\n\n const img = (\n <img\n class={['v-img__img', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.src }\n srcset={ normalisedSrc.value.srcset }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n sizes={ props.sizes }\n ref={ image }\n onLoad={ onLoad }\n onError={ onError }\n />\n )\n\n const sources = slots.sources?.()\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n {\n withDirectives(\n sources\n ? <picture class=\"v-img__picture\">{ sources }{ img }</picture>\n : img,\n [[vShow, state.value === 'loaded']]\n )\n }\n </MaybeTransition>\n )\n }\n\n const __preloadImage = () => (\n <MaybeTransition transition={ props.transition }>\n { normalisedSrc.value.lazySrc && state.value !== 'loaded' && (\n <img\n class={['v-img__img', 'v-img__img--preload', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.lazySrc }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n />\n )}\n </MaybeTransition>\n )\n\n const __placeholder = () => {\n if (!slots.placeholder) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { (state.value === 'loading' || (state.value === 'error' && !slots.error)) &&\n <div class=\"v-img__placeholder\">{ slots.placeholder() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __error = () => {\n if (!slots.error) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { state.value === 'error' &&\n <div class=\"v-img__error\">{ slots.error() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __gradient = () => {\n if (!props.gradient) return null\n\n return <div class=\"v-img__gradient\" style={{ backgroundImage: `linear-gradient(${props.gradient})` }} />\n }\n\n const isBooted = shallowRef(false)\n {\n const stop = watch(aspectRatio, val => {\n if (val) {\n // Doesn't work with nextTick, idk why\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n isBooted.value = true\n })\n })\n stop()\n }\n })\n }\n\n useRender(() => {\n const responsiveProps = VResponsive.filterProps(props)\n return (\n <VResponsive\n class={[\n 'v-img',\n { 'v-img--booting': !isBooted.value },\n backgroundColorClasses.value,\n roundedClasses.value,\n props.class,\n ]}\n style={[\n { width: convertToUnit(props.width === 'auto' ? naturalWidth.value : props.width) },\n backgroundColorStyles.value,\n props.style,\n ]}\n { ...responsiveProps }\n aspectRatio={ aspectRatio.value }\n aria-label={ props.alt }\n role={ props.alt ? 'img' : undefined }\n v-intersect={[{\n handler: init,\n options: props.options,\n }, null, ['once']]}\n >{{\n additional: () => (\n <>\n <__image />\n <__preloadImage />\n <__gradient />\n <__placeholder />\n <__error />\n </>\n ),\n default: slots.default,\n }}</VResponsive>\n )\n })\n\n return {\n currentSrc,\n image,\n state,\n naturalWidth,\n naturalHeight,\n }\n },\n})\n\nexport type VImg = InstanceType<typeof VImg>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,oBA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E,KAAK,KAAK,MAAM,GAAGnD,YAAY,CAACd,KAAK,GAAGH,KAAK,CAACoE,KAAK;QAAE,CAAC,EACnFzD,qBAAqB,CAACR,KAAK,EAC3BH,KAAK,CAACqE,KAAK;MACZ,GACIN,eAAe;QAAA,eACNzC,WAAW,CAACnB,KAAK;QAAA,cAClBH,KAAK,CAAC1B,GAAG;QAAA,QACf0B,KAAK,CAAC1B,GAAG,GAAG,KAAK,GAAGQ;MAAS;QAMpCwF,UAAU,EAAEA,CAAA,KAAApB,YAAA,CAAAqB,SAAA,SAAArB,YAAA,CAAAD,OAAA,eAAAC,YAAA,CAAAI,cAAA,eAAAJ,YAAA,CAAAQ,UAAA,eAAAR,YAAA,CAAAK,aAAA,eAAAL,YAAA,CAAAO,OAAA,eAQX;QACD5E,OAAO,EAAE4B,KAAK,CAAC5B;MAAO,MAAA2F,iBAAA,eAdR;QACZC,OAAO,EAAElD,IAAI;QACbrC,OAAO,EAAEc,KAAK,CAACd;MACjB,CAAC,EAAE,IAAI;QAAAwF,IAAA;MAAA;IAcb,CAAC,CAAC;IAEF,OAAO;MACL5D,UAAU;MACVC,KAAK;MACLC,KAAK;MACLC,YAAY;MACZC;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"VImg.mjs","names":["makeVResponsiveProps","VResponsive","useBackgroundColor","makeComponentProps","makeRoundedProps","useRounded","makeTransitionProps","MaybeTransition","intersect","computed","nextTick","onBeforeMount","onBeforeUnmount","ref","shallowRef","toRef","vShow","watch","withDirectives","convertToUnit","genericComponent","getCurrentInstance","propsFactory","SUPPORTS_INTERSECTION","useRender","makeVImgProps","absolute","Boolean","alt","String","cover","color","draggable","type","default","undefined","eager","gradient","lazySrc","options","Object","root","rootMargin","threshold","sizes","src","crossorigin","referrerpolicy","srcset","position","VImg","name","directives","props","emits","loadstart","value","load","error","setup","_ref","emit","slots","backgroundColorClasses","backgroundColorStyles","roundedClasses","vm","currentSrc","image","state","naturalWidth","naturalHeight","normalisedSrc","aspect","Number","aspectRatio","init","val","oldVal","pollForSize","isIntersecting","lazyImg","Image","setTimeout","isUnmounted","complete","onError","onLoad","getSrc","img","timer","clearTimeout","timeout","arguments","length","poll","imgHeight","imgWidth","window","endsWith","startsWith","containClasses","__image","_createVNode","objectPosition","sources","transition","__preloadImage","__placeholder","placeholder","__error","__gradient","backgroundImage","isBooted","stop","requestAnimationFrame","responsiveProps","filterProps","_withDirectives","_mergeProps","class","width","style","additional","_Fragment","_resolveDirective","handler","once"],"sources":["../../../src/components/VImg/VImg.tsx"],"sourcesContent":["// Styles\nimport './VImg.sass'\n\n// Components\nimport { makeVResponsiveProps, VResponsive } from '@/components/VResponsive/VResponsive'\n\n// Composables\nimport { useBackgroundColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTransitionProps, MaybeTransition } from '@/composables/transition'\n\n// Directives\nimport intersect from '@/directives/intersect'\n\n// Utilities\nimport {\n computed,\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n ref,\n shallowRef,\n toRef,\n vShow,\n watch,\n withDirectives,\n} from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n getCurrentInstance,\n propsFactory,\n SUPPORTS_INTERSECTION,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\n// not intended for public use, this is passed in by vuetify-loader\nexport interface srcObject {\n src?: string\n srcset?: string\n lazySrc?: string\n aspect: number\n}\n\nexport type VImgSlots = {\n default: never\n placeholder: never\n error: never\n sources: never\n}\n\nexport const makeVImgProps = propsFactory({\n absolute: Boolean,\n alt: String,\n cover: Boolean,\n color: String,\n draggable: {\n type: [Boolean, String] as PropType<boolean | 'true' | 'false'>,\n default: undefined,\n },\n eager: Boolean,\n gradient: String,\n lazySrc: String,\n options: {\n type: Object as PropType<IntersectionObserverInit>,\n // For more information on types, navigate to:\n // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n default: () => ({\n root: undefined,\n rootMargin: undefined,\n threshold: undefined,\n }),\n },\n sizes: String,\n src: {\n type: [String, Object] as PropType<string | srcObject>,\n default: '',\n },\n crossorigin: String as PropType<'' | 'anonymous' | 'use-credentials'>,\n referrerpolicy: String as PropType<\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'same-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url'\n >,\n srcset: String,\n position: String,\n\n ...makeVResponsiveProps(),\n ...makeComponentProps(),\n ...makeRoundedProps(),\n ...makeTransitionProps(),\n}, 'VImg')\n\nexport const VImg = genericComponent<VImgSlots>()({\n name: 'VImg',\n\n directives: { intersect },\n\n props: makeVImgProps(),\n\n emits: {\n loadstart: (value: string | undefined) => true,\n load: (value: string | undefined) => true,\n error: (value: string | undefined) => true,\n },\n\n setup (props, { emit, slots }) {\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'color'))\n const { roundedClasses } = useRounded(props)\n const vm = getCurrentInstance('VImg')\n\n const currentSrc = shallowRef('') // Set from srcset\n const image = ref<HTMLImageElement>()\n const state = shallowRef<'idle' | 'loading' | 'loaded' | 'error'>(props.eager ? 'loading' : 'idle')\n const naturalWidth = shallowRef<number>()\n const naturalHeight = shallowRef<number>()\n\n const normalisedSrc = computed<srcObject>(() => {\n return props.src && typeof props.src === 'object'\n ? {\n src: props.src.src,\n srcset: props.srcset || props.src.srcset,\n lazySrc: props.lazySrc || props.src.lazySrc,\n aspect: Number(props.aspectRatio || props.src.aspect || 0),\n } : {\n src: props.src,\n srcset: props.srcset,\n lazySrc: props.lazySrc,\n aspect: Number(props.aspectRatio || 0),\n }\n })\n const aspectRatio = computed(() => {\n return normalisedSrc.value.aspect || naturalWidth.value! / naturalHeight.value! || 0\n })\n\n watch(() => props.src, () => {\n init(state.value !== 'idle')\n })\n watch(aspectRatio, (val, oldVal) => {\n if (!val && oldVal && image.value) {\n pollForSize(image.value)\n }\n })\n\n // TODO: getSrc when window width changes\n\n onBeforeMount(() => init())\n\n function init (isIntersecting?: boolean) {\n if (props.eager && isIntersecting) return\n if (\n SUPPORTS_INTERSECTION &&\n !isIntersecting &&\n !props.eager\n ) return\n\n state.value = 'loading'\n\n if (normalisedSrc.value.lazySrc) {\n const lazyImg = new Image()\n lazyImg.src = normalisedSrc.value.lazySrc\n pollForSize(lazyImg, null)\n }\n\n if (!normalisedSrc.value.src) return\n\n nextTick(() => {\n emit('loadstart', image.value?.currentSrc || normalisedSrc.value.src)\n\n setTimeout(() => {\n if (vm.isUnmounted) return\n\n if (image.value?.complete) {\n if (!image.value.naturalWidth) {\n onError()\n }\n\n if (state.value === 'error') return\n\n if (!aspectRatio.value) pollForSize(image.value, null)\n if (state.value === 'loading') onLoad()\n } else {\n if (!aspectRatio.value) pollForSize(image.value!)\n getSrc()\n }\n })\n })\n }\n\n function onLoad () {\n if (vm.isUnmounted) return\n\n getSrc()\n pollForSize(image.value!)\n state.value = 'loaded'\n emit('load', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function onError () {\n if (vm.isUnmounted) return\n\n state.value = 'error'\n emit('error', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function getSrc () {\n const img = image.value\n if (img) currentSrc.value = img.currentSrc || img.src\n }\n\n let timer = -1\n\n onBeforeUnmount(() => {\n clearTimeout(timer)\n })\n\n function pollForSize (img: HTMLImageElement, timeout: number | null = 100) {\n const poll = () => {\n clearTimeout(timer)\n if (vm.isUnmounted) return\n\n const { naturalHeight: imgHeight, naturalWidth: imgWidth } = img\n\n if (imgHeight || imgWidth) {\n naturalWidth.value = imgWidth\n naturalHeight.value = imgHeight\n } else if (!img.complete && state.value === 'loading' && timeout != null) {\n timer = window.setTimeout(poll, timeout)\n } else if (img.currentSrc.endsWith('.svg') || img.currentSrc.startsWith('data:image/svg+xml')) {\n naturalWidth.value = 1\n naturalHeight.value = 1\n }\n }\n\n poll()\n }\n\n const containClasses = computed(() => ({\n 'v-img__img--cover': props.cover,\n 'v-img__img--contain': !props.cover,\n }))\n\n const __image = () => {\n if (!normalisedSrc.value.src || state.value === 'idle') return null\n\n const img = (\n <img\n class={['v-img__img', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.src }\n srcset={ normalisedSrc.value.srcset }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n sizes={ props.sizes }\n ref={ image }\n onLoad={ onLoad }\n onError={ onError }\n />\n )\n\n const sources = slots.sources?.()\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n {\n withDirectives(\n sources\n ? <picture class=\"v-img__picture\">{ sources }{ img }</picture>\n : img,\n [[vShow, state.value === 'loaded']]\n )\n }\n </MaybeTransition>\n )\n }\n\n const __preloadImage = () => (\n <MaybeTransition transition={ props.transition }>\n { normalisedSrc.value.lazySrc && state.value !== 'loaded' && (\n <img\n class={['v-img__img', 'v-img__img--preload', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.lazySrc }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n />\n )}\n </MaybeTransition>\n )\n\n const __placeholder = () => {\n if (!slots.placeholder) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { (state.value === 'loading' || (state.value === 'error' && !slots.error)) &&\n <div class=\"v-img__placeholder\">{ slots.placeholder() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __error = () => {\n if (!slots.error) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { state.value === 'error' &&\n <div class=\"v-img__error\">{ slots.error() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __gradient = () => {\n if (!props.gradient) return null\n\n return <div class=\"v-img__gradient\" style={{ backgroundImage: `linear-gradient(${props.gradient})` }} />\n }\n\n const isBooted = shallowRef(false)\n {\n const stop = watch(aspectRatio, val => {\n if (val) {\n // Doesn't work with nextTick, idk why\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n isBooted.value = true\n })\n })\n stop()\n }\n })\n }\n\n useRender(() => {\n const responsiveProps = VResponsive.filterProps(props)\n return (\n <VResponsive\n class={[\n 'v-img',\n {\n 'v-img--absolute': props.absolute,\n 'v-img--booting': !isBooted.value,\n },\n backgroundColorClasses.value,\n roundedClasses.value,\n props.class,\n ]}\n style={[\n { width: convertToUnit(props.width === 'auto' ? naturalWidth.value : props.width) },\n backgroundColorStyles.value,\n props.style,\n ]}\n { ...responsiveProps }\n aspectRatio={ aspectRatio.value }\n aria-label={ props.alt }\n role={ props.alt ? 'img' : undefined }\n v-intersect={[{\n handler: init,\n options: props.options,\n }, null, ['once']]}\n >{{\n additional: () => (\n <>\n <__image />\n <__preloadImage />\n <__gradient />\n <__placeholder />\n <__error />\n </>\n ),\n default: slots.default,\n }}</VResponsive>\n )\n })\n\n return {\n currentSrc,\n image,\n state,\n naturalWidth,\n naturalHeight,\n }\n },\n})\n\nexport type VImg = InstanceType<typeof VImg>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,oBAAoB,EAAEC,WAAW,0CAE1C;AAAA,SACSC,kBAAkB;AAAA,SAClBC,kBAAkB;AAAA,SAClBC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,mBAAmB,EAAEC,eAAe,4CAE7C;AAAA,OACOC,SAAS,8CAEhB;AACA,SACEC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,eAAe,EACfC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,cAAc,QACT,KAAK;AAAA,SAEVC,aAAa,EACbC,gBAAgB,EAChBC,kBAAkB,EAClBC,YAAY,EACZC,qBAAqB,EACrBC,SAAS,gCAGX;AAGA;AAeA,OAAO,MAAMC,aAAa,GAAGH,YAAY,CAAC;EACxCI,QAAQ,EAAEC,OAAO;EACjBC,GAAG,EAAEC,MAAM;EACXC,KA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AL,YAAA,CAAAO,OAAA,eAQX;QACD5E,OAAO,EAAE4B,KAAK,CAAC5B;MAAO,MAAA2F,iBAAA,eAdR;QACZC,OAAO,EAAElD,IAAI;QACbrC,OAAO,EAAEc,KAAK,CAACd;MACjB,CAAC,EAAE,IAAI;QAAAwF,IAAA;MAAA;IAcb,CAAC,CAAC;IAEF,OAAO;MACL5D,UAAU;MACVC,KAAK;MACLC,KAAK;MACLC,YAAY;MACZC;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,7 @@ interface srcObject {
|
|
|
16
16
|
declare const VImg: {
|
|
17
17
|
new (...args: any[]): vue.CreateComponentPublicInstance<{
|
|
18
18
|
inline: boolean;
|
|
19
|
+
absolute: boolean;
|
|
19
20
|
transition: string | boolean | (vue.TransitionProps & {
|
|
20
21
|
component?: vue.Component;
|
|
21
22
|
});
|
|
@@ -80,6 +81,7 @@ declare const VImg: {
|
|
|
80
81
|
error: (value: string | undefined) => true;
|
|
81
82
|
}, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
|
|
82
83
|
inline: boolean;
|
|
84
|
+
absolute: boolean;
|
|
83
85
|
transition: string | boolean | (vue.TransitionProps & {
|
|
84
86
|
component?: vue.Component;
|
|
85
87
|
});
|
|
@@ -134,6 +136,7 @@ declare const VImg: {
|
|
|
134
136
|
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
135
137
|
}, {
|
|
136
138
|
inline: boolean;
|
|
139
|
+
absolute: boolean;
|
|
137
140
|
transition: string | boolean | (vue.TransitionProps & {
|
|
138
141
|
component?: vue.Component;
|
|
139
142
|
});
|
|
@@ -159,6 +162,7 @@ declare const VImg: {
|
|
|
159
162
|
Defaults: {};
|
|
160
163
|
}, {
|
|
161
164
|
inline: boolean;
|
|
165
|
+
absolute: boolean;
|
|
162
166
|
transition: string | boolean | (vue.TransitionProps & {
|
|
163
167
|
component?: vue.Component;
|
|
164
168
|
});
|
|
@@ -219,6 +223,7 @@ declare const VImg: {
|
|
|
219
223
|
naturalHeight: vue.ShallowRef<number | undefined>;
|
|
220
224
|
}, {}, {}, {}, {
|
|
221
225
|
inline: boolean;
|
|
226
|
+
absolute: boolean;
|
|
222
227
|
transition: string | boolean | (vue.TransitionProps & {
|
|
223
228
|
component?: vue.Component;
|
|
224
229
|
});
|
|
@@ -236,6 +241,7 @@ declare const VImg: {
|
|
|
236
241
|
__isSuspense?: never;
|
|
237
242
|
} & vue.ComponentOptionsBase<{
|
|
238
243
|
inline: boolean;
|
|
244
|
+
absolute: boolean;
|
|
239
245
|
transition: string | boolean | (vue.TransitionProps & {
|
|
240
246
|
component?: vue.Component;
|
|
241
247
|
});
|
|
@@ -300,6 +306,7 @@ declare const VImg: {
|
|
|
300
306
|
error: (value: string | undefined) => true;
|
|
301
307
|
}, string, {
|
|
302
308
|
inline: boolean;
|
|
309
|
+
absolute: boolean;
|
|
303
310
|
transition: string | boolean | (vue.TransitionProps & {
|
|
304
311
|
component?: vue.Component;
|
|
305
312
|
});
|
|
@@ -343,6 +350,7 @@ declare const VImg: {
|
|
|
343
350
|
aspectRatio: (StringConstructor | NumberConstructor)[];
|
|
344
351
|
contentClass: null;
|
|
345
352
|
inline: BooleanConstructor;
|
|
353
|
+
absolute: BooleanConstructor;
|
|
346
354
|
alt: StringConstructor;
|
|
347
355
|
cover: BooleanConstructor;
|
|
348
356
|
color: StringConstructor;
|
|
@@ -397,6 +405,7 @@ declare const VImg: {
|
|
|
397
405
|
aspectRatio: (StringConstructor | NumberConstructor)[];
|
|
398
406
|
contentClass: null;
|
|
399
407
|
inline: BooleanConstructor;
|
|
408
|
+
absolute: BooleanConstructor;
|
|
400
409
|
alt: StringConstructor;
|
|
401
410
|
cover: BooleanConstructor;
|
|
402
411
|
color: StringConstructor;
|
|
@@ -39,7 +39,8 @@ type Density = null | 'default' | 'comfortable' | 'compact';
|
|
|
39
39
|
|
|
40
40
|
type ValidationResult = string | boolean;
|
|
41
41
|
type ValidationRule = ValidationResult | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>);
|
|
42
|
-
type ValidateOnValue = 'blur' | 'input' | 'submit';
|
|
42
|
+
type ValidateOnValue = 'blur' | 'input' | 'submit' | 'invalid-input';
|
|
43
|
+
type ValidateOn = ValidateOnValue | `${ValidateOnValue} lazy` | `${ValidateOnValue} eager` | `lazy ${ValidateOnValue}` | `eager ${ValidateOnValue}` | 'lazy' | 'eager';
|
|
43
44
|
interface ValidationProps {
|
|
44
45
|
disabled: boolean | null;
|
|
45
46
|
error: boolean;
|
|
@@ -52,7 +53,7 @@ interface ValidationProps {
|
|
|
52
53
|
rules: readonly ValidationRule[];
|
|
53
54
|
modelValue: any;
|
|
54
55
|
'onUpdate:modelValue': EventProp | undefined;
|
|
55
|
-
validateOn?:
|
|
56
|
+
validateOn?: ValidateOn;
|
|
56
57
|
validationValue: any;
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -109,7 +110,7 @@ declare const VInput: {
|
|
|
109
110
|
class?: any;
|
|
110
111
|
theme?: string | undefined;
|
|
111
112
|
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
112
|
-
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
113
|
+
validateOn?: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
113
114
|
validationValue?: any;
|
|
114
115
|
prependIcon?: IconValue | undefined;
|
|
115
116
|
appendIcon?: IconValue | undefined;
|
|
@@ -150,7 +151,7 @@ declare const VInput: {
|
|
|
150
151
|
class?: any;
|
|
151
152
|
theme?: string | undefined;
|
|
152
153
|
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
153
|
-
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
154
|
+
validateOn?: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
154
155
|
validationValue?: any;
|
|
155
156
|
prependIcon?: IconValue | undefined;
|
|
156
157
|
appendIcon?: IconValue | undefined;
|
|
@@ -211,7 +212,7 @@ declare const VInput: {
|
|
|
211
212
|
class?: any;
|
|
212
213
|
theme?: string | undefined;
|
|
213
214
|
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
214
|
-
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
215
|
+
validateOn?: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
215
216
|
validationValue?: any;
|
|
216
217
|
prependIcon?: IconValue | undefined;
|
|
217
218
|
appendIcon?: IconValue | undefined;
|
|
@@ -269,7 +270,7 @@ declare const VInput: {
|
|
|
269
270
|
class?: any;
|
|
270
271
|
theme?: string | undefined;
|
|
271
272
|
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
272
|
-
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
273
|
+
validateOn?: ("eager" | "lazy" | ("input" | "blur" | "submit" | "invalid-input") | "input lazy" | "blur lazy" | "submit lazy" | "invalid-input lazy" | "input eager" | "blur eager" | "submit eager" | "invalid-input eager" | "lazy input" | "lazy blur" | "lazy submit" | "lazy invalid-input" | "eager input" | "eager blur" | "eager submit" | "eager invalid-input") | undefined;
|
|
273
274
|
validationValue?: any;
|
|
274
275
|
prependIcon?: IconValue | undefined;
|
|
275
276
|
appendIcon?: IconValue | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVNode as _createVNode
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
|
2
2
|
// Styles
|
|
3
3
|
import "./VLayout.css";
|
|
4
4
|
|
|
@@ -6,7 +6,6 @@ import "./VLayout.css";
|
|
|
6
6
|
import { makeComponentProps } from "../../composables/component.mjs";
|
|
7
7
|
import { makeDimensionProps, useDimension } from "../../composables/dimensions.mjs";
|
|
8
8
|
import { createLayout, makeLayoutProps } from "../../composables/layout.mjs"; // Utilities
|
|
9
|
-
import { Suspense } from 'vue';
|
|
10
9
|
import { genericComponent, propsFactory, useRender } from "../../util/index.mjs";
|
|
11
10
|
export const makeVLayoutProps = propsFactory({
|
|
12
11
|
...makeComponentProps(),
|
|
@@ -34,9 +33,7 @@ export const VLayout = genericComponent()({
|
|
|
34
33
|
"ref": layoutRef,
|
|
35
34
|
"class": [layoutClasses.value, props.class],
|
|
36
35
|
"style": [dimensionStyles.value, layoutStyles.value, props.style]
|
|
37
|
-
}, [
|
|
38
|
-
default: () => [_createVNode(_Fragment, null, [slots.default?.()])]
|
|
39
|
-
})]));
|
|
36
|
+
}, [slots.default?.()]));
|
|
40
37
|
return {
|
|
41
38
|
getLayoutItem,
|
|
42
39
|
items
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VLayout.mjs","names":["makeComponentProps","makeDimensionProps","useDimension","createLayout","makeLayoutProps","
|
|
1
|
+
{"version":3,"file":"VLayout.mjs","names":["makeComponentProps","makeDimensionProps","useDimension","createLayout","makeLayoutProps","genericComponent","propsFactory","useRender","makeVLayoutProps","VLayout","name","props","setup","_ref","slots","layoutClasses","layoutStyles","getLayoutItem","items","layoutRef","dimensionStyles","_createVNode","value","class","style","default"],"sources":["../../../src/components/VLayout/VLayout.tsx"],"sourcesContent":["// Styles\nimport './VLayout.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { createLayout, makeLayoutProps } from '@/composables/layout'\n\n// Utilities\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVLayoutProps = propsFactory({\n ...makeComponentProps(),\n ...makeDimensionProps(),\n ...makeLayoutProps(),\n}, 'VLayout')\n\nexport const VLayout = genericComponent()({\n name: 'VLayout',\n\n props: makeVLayoutProps(),\n\n setup (props, { slots }) {\n const { layoutClasses, layoutStyles, getLayoutItem, items, layoutRef } = createLayout(props)\n const { dimensionStyles } = useDimension(props)\n\n useRender(() => (\n <div\n ref={ layoutRef }\n class={[\n layoutClasses.value,\n props.class,\n ]}\n style={[\n dimensionStyles.value,\n layoutStyles.value,\n props.style,\n ]}\n >\n { slots.default?.() }\n </div>\n ))\n\n return {\n getLayoutItem,\n items,\n }\n },\n})\n\nexport type VLayout = InstanceType<typeof VLayout>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,YAAY,EAAEC,eAAe,wCAEtC;AAAA,SACSC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS;AAElD,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3C,GAAGN,kBAAkB,CAAC,CAAC;EACvB,GAAGC,kBAAkB,CAAC,CAAC;EACvB,GAAGG,eAAe,CAAC;AACrB,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,MAAMK,OAAO,GAAGJ,gBAAgB,CAAC,CAAC,CAAC;EACxCK,IAAI,EAAE,SAAS;EAEfC,KAAK,EAAEH,gBAAgB,CAAC,CAAC;EAEzBI,KAAKA,CAAED,KAAK,EAAAE,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACrB,MAAM;MAAEE,aAAa;MAAEC,YAAY;MAAEC,aAAa;MAAEC,KAAK;MAAEC;IAAU,CAAC,GAAGhB,YAAY,CAACQ,KAAK,CAAC;IAC5F,MAAM;MAAES;IAAgB,CAAC,GAAGlB,YAAY,CAACS,KAAK,CAAC;IAE/CJ,SAAS,CAAC,MAAAc,YAAA;MAAA,OAEAF,SAAS;MAAA,SACR,CACLJ,aAAa,CAACO,KAAK,EACnBX,KAAK,CAACY,KAAK,CACZ;MAAA,SACM,CACLH,eAAe,CAACE,KAAK,EACrBN,YAAY,CAACM,KAAK,EAClBX,KAAK,CAACa,KAAK;IACZ,IAECV,KAAK,CAACW,OAAO,GAAG,CAAC,EAEtB,CAAC;IAEF,OAAO;MACLR,aAAa;MACbC;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ import "./VLayoutItem.css";
|
|
|
6
6
|
import { makeComponentProps } from "../../composables/component.mjs";
|
|
7
7
|
import { makeLayoutItemProps, useLayoutItem } from "../../composables/layout.mjs"; // Utilities
|
|
8
8
|
import { computed, toRef } from 'vue';
|
|
9
|
-
import { genericComponent, propsFactory
|
|
9
|
+
import { genericComponent, propsFactory } from "../../util/index.mjs"; // Types
|
|
10
10
|
export const makeVLayoutItemProps = propsFactory({
|
|
11
11
|
position: {
|
|
12
12
|
type: String,
|
|
@@ -28,8 +28,7 @@ export const VLayoutItem = genericComponent()({
|
|
|
28
28
|
slots
|
|
29
29
|
} = _ref;
|
|
30
30
|
const {
|
|
31
|
-
layoutItemStyles
|
|
32
|
-
layoutIsReady
|
|
31
|
+
layoutItemStyles
|
|
33
32
|
} = useLayoutItem({
|
|
34
33
|
id: props.name,
|
|
35
34
|
order: computed(() => parseInt(props.order, 10)),
|
|
@@ -39,11 +38,10 @@ export const VLayoutItem = genericComponent()({
|
|
|
39
38
|
active: toRef(props, 'modelValue'),
|
|
40
39
|
absolute: toRef(props, 'absolute')
|
|
41
40
|
});
|
|
42
|
-
|
|
41
|
+
return () => _createVNode("div", {
|
|
43
42
|
"class": ['v-layout-item', props.class],
|
|
44
43
|
"style": [layoutItemStyles.value, props.style]
|
|
45
|
-
}, [slots.default?.()])
|
|
46
|
-
return layoutIsReady;
|
|
44
|
+
}, [slots.default?.()]);
|
|
47
45
|
}
|
|
48
46
|
});
|
|
49
47
|
//# sourceMappingURL=VLayoutItem.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VLayoutItem.mjs","names":["makeComponentProps","makeLayoutItemProps","useLayoutItem","computed","toRef","genericComponent","propsFactory","
|
|
1
|
+
{"version":3,"file":"VLayoutItem.mjs","names":["makeComponentProps","makeLayoutItemProps","useLayoutItem","computed","toRef","genericComponent","propsFactory","makeVLayoutItemProps","position","type","String","required","size","Number","default","modelValue","Boolean","VLayoutItem","name","props","setup","_ref","slots","layoutItemStyles","id","order","parseInt","elementSize","layoutSize","active","absolute","_createVNode","class","value","style"],"sources":["../../../src/components/VLayout/VLayoutItem.tsx"],"sourcesContent":["// Styles\nimport './VLayoutItem.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeLayoutItemProps, useLayoutItem } from '@/composables/layout'\n\n// Utilities\nimport { computed, toRef } from 'vue'\nimport { genericComponent, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nexport const makeVLayoutItemProps = propsFactory({\n position: {\n type: String as PropType<'top' | 'right' | 'bottom' | 'left'>,\n required: true,\n },\n size: {\n type: [Number, String],\n default: 300,\n },\n modelValue: Boolean,\n\n ...makeComponentProps(),\n ...makeLayoutItemProps(),\n}, 'VLayoutItem')\n\nexport const VLayoutItem = genericComponent()({\n name: 'VLayoutItem',\n\n props: makeVLayoutItemProps(),\n\n setup (props, { slots }) {\n const { layoutItemStyles } = useLayoutItem({\n id: props.name,\n order: computed(() => parseInt(props.order, 10)),\n position: toRef(props, 'position'),\n elementSize: toRef(props, 'size'),\n layoutSize: toRef(props, 'size'),\n active: toRef(props, 'modelValue'),\n absolute: toRef(props, 'absolute'),\n })\n\n return () => (\n <div\n class={[\n 'v-layout-item',\n props.class,\n ]}\n style={[\n layoutItemStyles.value,\n props.style,\n ]}\n >\n { slots.default?.() }\n </div>\n )\n },\n})\n\nexport type VLayoutItem = InstanceType<typeof VLayoutItem>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,mBAAmB,EAAEC,aAAa,wCAE3C;AACA,SAASC,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5BC,gBAAgB,EAAEC,YAAY,gCAEvC;AAGA,OAAO,MAAMC,oBAAoB,GAAGD,YAAY,CAAC;EAC/CE,QAAQ,EAAE;IACRC,IAAI,EAAEC,MAAuD;IAC7DC,QAAQ,EAAE;EACZ,CAAC;EACDC,IAAI,EAAE;IACJH,IAAI,EAAE,CAACI,MAAM,EAAEH,MAAM,CAAC;IACtBI,OAAO,EAAE;EACX,CAAC;EACDC,UAAU,EAAEC,OAAO;EAEnB,GAAGhB,kBAAkB,CAAC,CAAC;EACvB,GAAGC,mBAAmB,CAAC;AACzB,CAAC,EAAE,aAAa,CAAC;AAEjB,OAAO,MAAMgB,WAAW,GAAGZ,gBAAgB,CAAC,CAAC,CAAC;EAC5Ca,IAAI,EAAE,aAAa;EAEnBC,KAAK,EAAEZ,oBAAoB,CAAC,CAAC;EAE7Ba,KAAKA,CAAED,KAAK,EAAAE,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACrB,MAAM;MAAEE;IAAiB,CAAC,GAAGrB,aAAa,CAAC;MACzCsB,EAAE,EAAEL,KAAK,CAACD,IAAI;MACdO,KAAK,EAAEtB,QAAQ,C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