vuetify 3.8.4 → 3.8.5
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/_component-variables-labs.sass +1 -0
- package/dist/json/attributes.json +3194 -2850
- package/dist/json/importMap-labs.json +28 -24
- package/dist/json/importMap.json +158 -158
- package/dist/json/tags.json +91 -0
- package/dist/json/web-types.json +6341 -5124
- package/dist/vuetify-labs.cjs +277 -18
- package/dist/vuetify-labs.css +3763 -3735
- package/dist/vuetify-labs.d.ts +1380 -300
- package/dist/vuetify-labs.esm.js +277 -18
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +277 -18
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +5 -9
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +2976 -2951
- package/dist/vuetify.d.ts +67 -64
- package/dist/vuetify.esm.js +5 -9
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +5 -9
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +5 -5
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.js +0 -5
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.css +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.sass +1 -1
- package/lib/components/VBtn/VBtn.css +25 -0
- package/lib/components/VBtn/VBtn.sass +9 -0
- package/lib/components/VBtn/_variables.scss +1 -0
- package/lib/components/VSnackbarQueue/VSnackbarQueue.d.ts +3 -1
- package/lib/components/VSnackbarQueue/VSnackbarQueue.js.map +1 -1
- package/lib/composables/dateFormat.d.ts +24 -0
- package/lib/composables/dateFormat.js +112 -0
- package/lib/composables/dateFormat.js.map +1 -0
- package/lib/entry-bundler.js +1 -1
- package/lib/framework.d.ts +67 -64
- package/lib/framework.js +1 -1
- package/lib/iconsets/mdi.js +2 -1
- package/lib/iconsets/mdi.js.map +1 -1
- package/lib/labs/VColorInput/VColorInput.css +4 -0
- package/lib/labs/VColorInput/VColorInput.d.ts +1767 -0
- package/lib/labs/VColorInput/VColorInput.js +129 -0
- package/lib/labs/VColorInput/VColorInput.js.map +1 -0
- package/lib/labs/VColorInput/VColorInput.sass +7 -0
- package/lib/labs/VColorInput/_variables.scss +2 -0
- package/lib/labs/VColorInput/index.d.ts +1 -0
- package/lib/labs/VColorInput/index.js +2 -0
- package/lib/labs/VColorInput/index.js.map +1 -0
- package/lib/labs/VDateInput/VDateInput.d.ts +46 -21
- package/lib/labs/VDateInput/VDateInput.js +43 -10
- package/lib/labs/VDateInput/VDateInput.js.map +1 -1
- package/lib/labs/components.d.ts +1 -0
- package/lib/labs/components.js +1 -0
- package/lib/labs/components.js.map +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
+
// Styles
|
|
3
|
+
import "./VColorInput.css";
|
|
4
|
+
|
|
5
|
+
// Components
|
|
6
|
+
import { makeVColorPickerProps, VColorPicker } from "../../components/VColorPicker/VColorPicker.js";
|
|
7
|
+
import { makeVConfirmEditProps, VConfirmEdit } from "../../components/VConfirmEdit/VConfirmEdit.js";
|
|
8
|
+
import { VIcon } from "../../components/VIcon/VIcon.js";
|
|
9
|
+
import { VMenu } from "../../components/VMenu/VMenu.js";
|
|
10
|
+
import { makeVTextFieldProps, VTextField } from "../../components/VTextField/VTextField.js"; // Composables
|
|
11
|
+
import { makeFocusProps, useFocus } from "../../composables/focus.js";
|
|
12
|
+
import { useProxiedModel } from "../../composables/proxiedModel.js"; // Utilities
|
|
13
|
+
import { computed, shallowRef } from 'vue';
|
|
14
|
+
import { genericComponent, omit, propsFactory, useRender } from "../../util/index.js"; // Types
|
|
15
|
+
export const makeVColorInputProps = propsFactory({
|
|
16
|
+
pip: Boolean,
|
|
17
|
+
pipIcon: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '$color'
|
|
20
|
+
},
|
|
21
|
+
...makeFocusProps(),
|
|
22
|
+
...makeVConfirmEditProps(),
|
|
23
|
+
...makeVTextFieldProps(),
|
|
24
|
+
...omit(makeVColorPickerProps(), ['width'])
|
|
25
|
+
}, 'VColorInput');
|
|
26
|
+
export const VColorInput = genericComponent()({
|
|
27
|
+
name: 'VColorInput',
|
|
28
|
+
props: makeVColorInputProps(),
|
|
29
|
+
emits: {
|
|
30
|
+
'update:modelValue': val => true
|
|
31
|
+
},
|
|
32
|
+
setup(props, _ref) {
|
|
33
|
+
let {
|
|
34
|
+
slots
|
|
35
|
+
} = _ref;
|
|
36
|
+
const {
|
|
37
|
+
isFocused,
|
|
38
|
+
focus,
|
|
39
|
+
blur
|
|
40
|
+
} = useFocus(props);
|
|
41
|
+
const model = useProxiedModel(props, 'modelValue');
|
|
42
|
+
const menu = shallowRef(false);
|
|
43
|
+
const isInteractive = computed(() => !props.disabled && !props.readonly);
|
|
44
|
+
const display = computed(() => model.value || null);
|
|
45
|
+
function onKeydown(e) {
|
|
46
|
+
if (e.key !== 'Enter') return;
|
|
47
|
+
if (!menu.value || !isFocused.value) {
|
|
48
|
+
menu.value = true;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const target = e.target;
|
|
52
|
+
model.value = target.value;
|
|
53
|
+
}
|
|
54
|
+
function onClick(e) {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
menu.value = true;
|
|
58
|
+
}
|
|
59
|
+
function onSave() {
|
|
60
|
+
menu.value = false;
|
|
61
|
+
}
|
|
62
|
+
useRender(() => {
|
|
63
|
+
const confirmEditProps = VConfirmEdit.filterProps(props);
|
|
64
|
+
const colorPickerProps = VColorPicker.filterProps(omit(props, ['active', 'color']));
|
|
65
|
+
const textFieldProps = VTextField.filterProps(omit(props, ['prependInnerIcon']));
|
|
66
|
+
const hasPrepend = !!(slots.prepend || props.pipIcon);
|
|
67
|
+
return _createVNode(VTextField, _mergeProps(textFieldProps, {
|
|
68
|
+
"class": ['v-color-input', props.class],
|
|
69
|
+
"style": props.style,
|
|
70
|
+
"modelValue": display.value,
|
|
71
|
+
"onKeydown": isInteractive.value ? onKeydown : undefined,
|
|
72
|
+
"focused": menu.value || isFocused.value,
|
|
73
|
+
"onFocus": focus,
|
|
74
|
+
"onBlur": blur,
|
|
75
|
+
"onClick:control": isInteractive.value ? onClick : undefined,
|
|
76
|
+
"onClick:prependInner": isInteractive.value ? onClick : undefined,
|
|
77
|
+
"onClick:appendInner": isInteractive.value ? onClick : undefined,
|
|
78
|
+
"onUpdate:modelValue": val => {
|
|
79
|
+
model.value = val;
|
|
80
|
+
}
|
|
81
|
+
}), {
|
|
82
|
+
...slots,
|
|
83
|
+
prepend: props.pipIcon ? arg => _createVNode(_Fragment, null, [hasPrepend && _createVNode(VIcon, {
|
|
84
|
+
"color": props.pip ? model.value : undefined,
|
|
85
|
+
"icon": props.pipIcon
|
|
86
|
+
}, null), slots.prepend?.(arg)]) : undefined,
|
|
87
|
+
default: () => _createVNode(_Fragment, null, [_createVNode(VMenu, {
|
|
88
|
+
"modelValue": menu.value,
|
|
89
|
+
"onUpdate:modelValue": $event => menu.value = $event,
|
|
90
|
+
"activator": "parent",
|
|
91
|
+
"min-width": "0",
|
|
92
|
+
"closeOnContentClick": false,
|
|
93
|
+
"openOnClick": false
|
|
94
|
+
}, {
|
|
95
|
+
default: () => [_createVNode(VConfirmEdit, _mergeProps(confirmEditProps, {
|
|
96
|
+
"modelValue": model.value,
|
|
97
|
+
"onUpdate:modelValue": $event => model.value = $event,
|
|
98
|
+
"onSave": onSave
|
|
99
|
+
}), {
|
|
100
|
+
default: _ref2 => {
|
|
101
|
+
let {
|
|
102
|
+
actions,
|
|
103
|
+
model: proxyModel,
|
|
104
|
+
save,
|
|
105
|
+
cancel,
|
|
106
|
+
isPristine
|
|
107
|
+
} = _ref2;
|
|
108
|
+
return _createVNode(VColorPicker, _mergeProps(colorPickerProps, {
|
|
109
|
+
"modelValue": proxyModel.value,
|
|
110
|
+
"onUpdate:modelValue": val => {
|
|
111
|
+
proxyModel.value = val;
|
|
112
|
+
model.value = val;
|
|
113
|
+
},
|
|
114
|
+
"onMousedown": e => e.preventDefault()
|
|
115
|
+
}), {
|
|
116
|
+
actions: !props.hideActions ? () => slots.actions?.({
|
|
117
|
+
save,
|
|
118
|
+
cancel,
|
|
119
|
+
isPristine
|
|
120
|
+
}) ?? actions() : undefined
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
})]
|
|
124
|
+
}), slots.default?.()])
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=VColorInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VColorInput.js","names":["makeVColorPickerProps","VColorPicker","makeVConfirmEditProps","VConfirmEdit","VIcon","VMenu","makeVTextFieldProps","VTextField","makeFocusProps","useFocus","useProxiedModel","computed","shallowRef","genericComponent","omit","propsFactory","useRender","makeVColorInputProps","pip","Boolean","pipIcon","type","String","default","VColorInput","name","props","emits","val","setup","_ref","slots","isFocused","focus","blur","model","menu","isInteractive","disabled","readonly","display","value","onKeydown","e","key","target","onClick","preventDefault","stopPropagation","onSave","confirmEditProps","filterProps","colorPickerProps","textFieldProps","hasPrepend","prepend","_createVNode","_mergeProps","class","style","undefined","arg","_Fragment","$event","_ref2","actions","proxyModel","save","cancel","isPristine","hideActions"],"sources":["../../../src/labs/VColorInput/VColorInput.tsx"],"sourcesContent":["// Styles\nimport './VColorInput.sass'\n\n// Components\nimport { makeVColorPickerProps, VColorPicker } from '@/components/VColorPicker/VColorPicker'\nimport { makeVConfirmEditProps, VConfirmEdit } from '@/components/VConfirmEdit/VConfirmEdit'\nimport { VIcon } from '@/components/VIcon/VIcon'\nimport { VMenu } from '@/components/VMenu/VMenu'\nimport { makeVTextFieldProps, VTextField } from '@/components/VTextField/VTextField'\n\n// Composables\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, shallowRef } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VTextFieldSlots } from '@/components/VTextField/VTextField'\n\nexport type VColorInputActionsSlot = {\n save: () => void\n cancel: () => void\n isPristine: boolean\n}\n\nexport type VColorInputSlots = Omit<VTextFieldSlots, 'default'> & {\n actions: VColorInputActionsSlot\n default: never\n}\n\nexport const makeVColorInputProps = propsFactory({\n pip: Boolean,\n pipIcon: {\n type: String,\n default: '$color',\n },\n\n ...makeFocusProps(),\n ...makeVConfirmEditProps(),\n ...makeVTextFieldProps(),\n ...omit(makeVColorPickerProps(), ['width']),\n}, 'VColorInput')\n\nexport const VColorInput = genericComponent<VColorInputSlots>()({\n name: 'VColorInput',\n\n props: makeVColorInputProps(),\n\n emits: {\n 'update:modelValue': (val: string) => true,\n },\n\n setup (props, { slots }) {\n const { isFocused, focus, blur } = useFocus(props)\n const model = useProxiedModel(props, 'modelValue')\n const menu = shallowRef(false)\n\n const isInteractive = computed(() => !props.disabled && !props.readonly)\n\n const display = computed(() => model.value || null)\n\n function onKeydown (e: KeyboardEvent) {\n if (e.key !== 'Enter') return\n\n if (!menu.value || !isFocused.value) {\n menu.value = true\n\n return\n }\n\n const target = e.target as HTMLInputElement\n\n model.value = target.value\n }\n\n function onClick (e: MouseEvent) {\n e.preventDefault()\n e.stopPropagation()\n\n menu.value = true\n }\n\n function onSave () {\n menu.value = false\n }\n\n useRender(() => {\n const confirmEditProps = VConfirmEdit.filterProps(props)\n const colorPickerProps = VColorPicker.filterProps(omit(props, ['active', 'color']))\n const textFieldProps = VTextField.filterProps(omit(props, ['prependInnerIcon']))\n\n const hasPrepend = !!(slots.prepend || props.pipIcon)\n\n return (\n <VTextField\n { ...textFieldProps }\n class={[\n 'v-color-input',\n props.class,\n ]}\n style={ props.style }\n modelValue={ display.value }\n onKeydown={ isInteractive.value ? onKeydown : undefined }\n focused={ menu.value || isFocused.value }\n onFocus={ focus }\n onBlur={ blur }\n onClick:control={ isInteractive.value ? onClick : undefined }\n onClick:prependInner={ isInteractive.value ? onClick : undefined }\n onClick:appendInner={ isInteractive.value ? onClick : undefined }\n onUpdate:modelValue={ val => {\n model.value = val\n }}\n >\n {{\n ...slots,\n prepend: props.pipIcon ? arg => (\n <>\n { hasPrepend && (\n <VIcon\n color={ props.pip ? model.value as string : undefined }\n icon={ props.pipIcon }\n />\n )}\n\n { slots.prepend?.(arg) }\n </>\n ) : undefined,\n default: () => (\n <>\n <VMenu\n v-model={ menu.value }\n activator=\"parent\"\n min-width=\"0\"\n closeOnContentClick={ false }\n openOnClick={ false }\n >\n <VConfirmEdit\n { ...confirmEditProps }\n v-model={ model.value }\n onSave={ onSave }\n >\n {{\n default: ({ actions, model: proxyModel, save, cancel, isPristine }) => {\n return (\n <VColorPicker\n { ...colorPickerProps }\n modelValue={ proxyModel.value }\n onUpdate:modelValue={ val => {\n proxyModel.value = val\n model.value = val\n }}\n onMousedown={ (e: MouseEvent) => e.preventDefault() }\n >\n {{\n actions: !props.hideActions ? () => slots.actions?.({ save, cancel, isPristine }) ?? actions() : undefined,\n }}\n </VColorPicker>\n )\n },\n }}\n </VConfirmEdit>\n </VMenu>\n\n { slots.default?.() }\n </>\n ),\n }}\n </VTextField>\n )\n })\n },\n})\n\nexport type VColorInput = InstanceType<typeof VColorInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,qBAAqB,EAAEC,YAAY;AAAA,SACnCC,qBAAqB,EAAEC,YAAY;AAAA,SACnCC,KAAK;AAAA,SACLC,KAAK;AAAA,SACLC,mBAAmB,EAAEC,UAAU,qDAExC;AAAA,SACSC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,eAAe,6CAExB;AACA,SAASC,QAAQ,EAAEC,UAAU,QAAQ,KAAK;AAAA,SACjCC,gBAAgB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AAU,CAACzB,KAAK,GAAGb,GAAG;kBACtBO,KAAK,CAACM,KAAK,GAAGb,GAAG;gBACnB,CAAC;gBAAA,eACce,CAAa,IAAKA,CAAC,CAACI,cAAc,CAAC;cAAC;gBAGjDkB,OAAO,EAAE,CAACvC,KAAK,CAAC4C,WAAW,GAAG,MAAMvC,KAAK,CAACkC,OAAO,GAAG;kBAAEE,IAAI;kBAAEC,MAAM;kBAAEC;gBAAW,CAAC,CAAC,IAAIJ,OAAO,CAAC,CAAC,GAAGL;cAAS;YAIlH;UAAC;QAAA,IAKL7B,KAAK,CAACR,OAAO,GAAG,CAAC;MAEtB;IAIT,CAAC,CAAC;EACJ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VColorInput } from './VColorInput.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["VColorInput"],"sources":["../../../src/labs/VColorInput/index.ts"],"sourcesContent":["export { VColorInput } from './VColorInput'\n"],"mappings":"SAASA,WAAW","ignoreList":[]}
|
|
@@ -114,8 +114,10 @@ export declare const makeVDateInputProps: <Defaults extends {
|
|
|
114
114
|
hideActions?: unknown;
|
|
115
115
|
mobile?: unknown;
|
|
116
116
|
mobileBreakpoint?: unknown;
|
|
117
|
+
inputFormat?: unknown;
|
|
117
118
|
displayFormat?: unknown;
|
|
118
119
|
location?: unknown;
|
|
120
|
+
menu?: unknown;
|
|
119
121
|
updateOn?: unknown;
|
|
120
122
|
} = {}>(defaults?: Defaults | undefined) => {
|
|
121
123
|
max: unknown extends Defaults["max"] ? PropType<unknown> : {
|
|
@@ -674,13 +676,7 @@ export declare const makeVDateInputProps: <Defaults extends {
|
|
|
674
676
|
type: PropType<unknown extends Defaults["prefix"] ? string : string | Defaults["prefix"]>;
|
|
675
677
|
default: unknown extends Defaults["prefix"] ? string : string | Defaults["prefix"];
|
|
676
678
|
};
|
|
677
|
-
placeholder: unknown extends Defaults["placeholder"] ? {
|
|
678
|
-
type: PropType<string>;
|
|
679
|
-
default: string;
|
|
680
|
-
} : Omit<{
|
|
681
|
-
type: PropType<string>;
|
|
682
|
-
default: string;
|
|
683
|
-
}, "type" | "default"> & {
|
|
679
|
+
placeholder: unknown extends Defaults["placeholder"] ? StringConstructor : {
|
|
684
680
|
type: PropType<unknown extends Defaults["placeholder"] ? string : string | Defaults["placeholder"]>;
|
|
685
681
|
default: unknown extends Defaults["placeholder"] ? string : string | Defaults["placeholder"];
|
|
686
682
|
};
|
|
@@ -764,6 +760,16 @@ export declare const makeVDateInputProps: <Defaults extends {
|
|
|
764
760
|
type: PropType<unknown extends Defaults["mobileBreakpoint"] ? number | import("../../composables/display.js").DisplayBreakpoint : number | import("../../composables/display.js").DisplayBreakpoint | Defaults["mobileBreakpoint"]>;
|
|
765
761
|
default: unknown extends Defaults["mobileBreakpoint"] ? number | import("../../composables/display.js").DisplayBreakpoint : NonNullable<number | import("../../composables/display.js").DisplayBreakpoint> | Defaults["mobileBreakpoint"];
|
|
766
762
|
};
|
|
763
|
+
inputFormat: unknown extends Defaults["inputFormat"] ? {
|
|
764
|
+
type: StringConstructor;
|
|
765
|
+
validator: (v: string) => boolean;
|
|
766
|
+
} : Omit<{
|
|
767
|
+
type: StringConstructor;
|
|
768
|
+
validator: (v: string) => boolean;
|
|
769
|
+
}, "type" | "default"> & {
|
|
770
|
+
type: PropType<unknown extends Defaults["inputFormat"] ? string : string | Defaults["inputFormat"]>;
|
|
771
|
+
default: unknown extends Defaults["inputFormat"] ? string : string | Defaults["inputFormat"];
|
|
772
|
+
};
|
|
767
773
|
displayFormat: unknown extends Defaults["displayFormat"] ? (FunctionConstructor | StringConstructor)[] : {
|
|
768
774
|
type: PropType<unknown extends Defaults["displayFormat"] ? string | Function : string | Function | Defaults["displayFormat"]>;
|
|
769
775
|
default: unknown extends Defaults["displayFormat"] ? string | Function : NonNullable<string | Function> | Defaults["displayFormat"];
|
|
@@ -778,6 +784,10 @@ export declare const makeVDateInputProps: <Defaults extends {
|
|
|
778
784
|
type: PropType<unknown extends Defaults["location"] ? import("../../util/index.js").Anchor : import("../../util/index.js").Anchor | Defaults["location"]>;
|
|
779
785
|
default: unknown extends Defaults["location"] ? import("../../util/index.js").Anchor : NonNullable<import("../../util/index.js").Anchor> | Defaults["location"];
|
|
780
786
|
};
|
|
787
|
+
menu: unknown extends Defaults["menu"] ? BooleanConstructor : {
|
|
788
|
+
type: PropType<unknown extends Defaults["menu"] ? boolean : boolean | Defaults["menu"]>;
|
|
789
|
+
default: unknown extends Defaults["menu"] ? boolean : boolean | Defaults["menu"];
|
|
790
|
+
};
|
|
781
791
|
updateOn: unknown extends Defaults["updateOn"] ? {
|
|
782
792
|
type: PropType<("blur" | "enter")[]>;
|
|
783
793
|
default: () => string[];
|
|
@@ -801,6 +811,7 @@ export declare const VDateInput: {
|
|
|
801
811
|
direction: "horizontal" | "vertical";
|
|
802
812
|
transition: string;
|
|
803
813
|
header: string;
|
|
814
|
+
menu: boolean;
|
|
804
815
|
style: import("vue").StyleValue;
|
|
805
816
|
title: string;
|
|
806
817
|
autofocus: boolean;
|
|
@@ -809,7 +820,6 @@ export declare const VDateInput: {
|
|
|
809
820
|
readonly: boolean | null;
|
|
810
821
|
tag: string | import("../../util/index.js").JSXComponent;
|
|
811
822
|
landscape: boolean;
|
|
812
|
-
placeholder: string;
|
|
813
823
|
messages: string | readonly string[];
|
|
814
824
|
rules: readonly import("../../types.js").ValidationRule[];
|
|
815
825
|
focused: boolean;
|
|
@@ -868,6 +878,7 @@ export declare const VDateInput: {
|
|
|
868
878
|
year?: number | undefined;
|
|
869
879
|
class?: any;
|
|
870
880
|
theme?: string | undefined;
|
|
881
|
+
placeholder?: string | undefined;
|
|
871
882
|
elevation?: string | number | undefined;
|
|
872
883
|
counter?: string | number | boolean | undefined;
|
|
873
884
|
mobileBreakpoint?: number | import("../../composables/display.js").DisplayBreakpoint | undefined;
|
|
@@ -897,6 +908,7 @@ export declare const VDateInput: {
|
|
|
897
908
|
modelModifiers?: Record<string, boolean> | undefined;
|
|
898
909
|
firstDayOfWeek?: string | number | undefined;
|
|
899
910
|
allowedDates?: unknown[] | ((date: unknown) => boolean) | undefined;
|
|
911
|
+
inputFormat?: string | undefined;
|
|
900
912
|
displayFormat?: string | Function | undefined;
|
|
901
913
|
} & {
|
|
902
914
|
$children?: import("vue").VNodeChild | (() => import("vue").VNodeChild) | {
|
|
@@ -958,6 +970,7 @@ export declare const VDateInput: {
|
|
|
958
970
|
} & {
|
|
959
971
|
onCancel?: (() => any) | undefined;
|
|
960
972
|
"onUpdate:modelValue"?: ((val: string) => any) | undefined;
|
|
973
|
+
"onUpdate:menu"?: ((val: boolean) => any) | undefined;
|
|
961
974
|
onSave?: ((value: string) => any) | undefined;
|
|
962
975
|
}, Omit<Omit<{
|
|
963
976
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -2901,6 +2914,7 @@ export declare const VDateInput: {
|
|
|
2901
2914
|
save: (value: string) => true;
|
|
2902
2915
|
cancel: () => true;
|
|
2903
2916
|
'update:modelValue': (val: string) => true;
|
|
2917
|
+
'update:menu': (val: boolean) => true;
|
|
2904
2918
|
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
|
|
2905
2919
|
flat: boolean;
|
|
2906
2920
|
reverse: boolean;
|
|
@@ -2912,6 +2926,7 @@ export declare const VDateInput: {
|
|
|
2912
2926
|
direction: "horizontal" | "vertical";
|
|
2913
2927
|
transition: string;
|
|
2914
2928
|
header: string;
|
|
2929
|
+
menu: boolean;
|
|
2915
2930
|
style: import("vue").StyleValue;
|
|
2916
2931
|
title: string;
|
|
2917
2932
|
autofocus: boolean;
|
|
@@ -2920,7 +2935,6 @@ export declare const VDateInput: {
|
|
|
2920
2935
|
readonly: boolean | null;
|
|
2921
2936
|
tag: string | import("../../util/index.js").JSXComponent;
|
|
2922
2937
|
landscape: boolean;
|
|
2923
|
-
placeholder: string;
|
|
2924
2938
|
messages: string | readonly string[];
|
|
2925
2939
|
rules: readonly import("../../types.js").ValidationRule[];
|
|
2926
2940
|
focused: boolean;
|
|
@@ -2994,6 +3008,7 @@ export declare const VDateInput: {
|
|
|
2994
3008
|
direction: "horizontal" | "vertical";
|
|
2995
3009
|
transition: string;
|
|
2996
3010
|
header: string;
|
|
3011
|
+
menu: boolean;
|
|
2997
3012
|
style: import("vue").StyleValue;
|
|
2998
3013
|
title: string;
|
|
2999
3014
|
autofocus: boolean;
|
|
@@ -3002,7 +3017,6 @@ export declare const VDateInput: {
|
|
|
3002
3017
|
readonly: boolean | null;
|
|
3003
3018
|
tag: string | import("../../util/index.js").JSXComponent;
|
|
3004
3019
|
landscape: boolean;
|
|
3005
|
-
placeholder: string;
|
|
3006
3020
|
messages: string | readonly string[];
|
|
3007
3021
|
rules: readonly import("../../types.js").ValidationRule[];
|
|
3008
3022
|
focused: boolean;
|
|
@@ -3061,6 +3075,7 @@ export declare const VDateInput: {
|
|
|
3061
3075
|
year?: number | undefined;
|
|
3062
3076
|
class?: any;
|
|
3063
3077
|
theme?: string | undefined;
|
|
3078
|
+
placeholder?: string | undefined;
|
|
3064
3079
|
elevation?: string | number | undefined;
|
|
3065
3080
|
counter?: string | number | boolean | undefined;
|
|
3066
3081
|
mobileBreakpoint?: number | import("../../composables/display.js").DisplayBreakpoint | undefined;
|
|
@@ -3090,6 +3105,7 @@ export declare const VDateInput: {
|
|
|
3090
3105
|
modelModifiers?: Record<string, boolean> | undefined;
|
|
3091
3106
|
firstDayOfWeek?: string | number | undefined;
|
|
3092
3107
|
allowedDates?: unknown[] | ((date: unknown) => boolean) | undefined;
|
|
3108
|
+
inputFormat?: string | undefined;
|
|
3093
3109
|
displayFormat?: string | Function | undefined;
|
|
3094
3110
|
} & {
|
|
3095
3111
|
$children?: import("vue").VNodeChild | (() => import("vue").VNodeChild) | {
|
|
@@ -3151,6 +3167,7 @@ export declare const VDateInput: {
|
|
|
3151
3167
|
} & {
|
|
3152
3168
|
onCancel?: (() => any) | undefined;
|
|
3153
3169
|
"onUpdate:modelValue"?: ((val: string) => any) | undefined;
|
|
3170
|
+
"onUpdate:menu"?: ((val: boolean) => any) | undefined;
|
|
3154
3171
|
onSave?: ((value: string) => any) | undefined;
|
|
3155
3172
|
}, Omit<Omit<{
|
|
3156
3173
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -5101,6 +5118,7 @@ export declare const VDateInput: {
|
|
|
5101
5118
|
direction: "horizontal" | "vertical";
|
|
5102
5119
|
transition: string;
|
|
5103
5120
|
header: string;
|
|
5121
|
+
menu: boolean;
|
|
5104
5122
|
style: import("vue").StyleValue;
|
|
5105
5123
|
title: string;
|
|
5106
5124
|
autofocus: boolean;
|
|
@@ -5109,7 +5127,6 @@ export declare const VDateInput: {
|
|
|
5109
5127
|
readonly: boolean | null;
|
|
5110
5128
|
tag: string | import("../../util/index.js").JSXComponent;
|
|
5111
5129
|
landscape: boolean;
|
|
5112
|
-
placeholder: string;
|
|
5113
5130
|
messages: string | readonly string[];
|
|
5114
5131
|
rules: readonly import("../../types.js").ValidationRule[];
|
|
5115
5132
|
focused: boolean;
|
|
@@ -5162,6 +5179,7 @@ export declare const VDateInput: {
|
|
|
5162
5179
|
direction: "horizontal" | "vertical";
|
|
5163
5180
|
transition: string;
|
|
5164
5181
|
header: string;
|
|
5182
|
+
menu: boolean;
|
|
5165
5183
|
style: import("vue").StyleValue;
|
|
5166
5184
|
title: string;
|
|
5167
5185
|
autofocus: boolean;
|
|
@@ -5170,7 +5188,6 @@ export declare const VDateInput: {
|
|
|
5170
5188
|
readonly: boolean | null;
|
|
5171
5189
|
tag: string | import("../../util/index.js").JSXComponent;
|
|
5172
5190
|
landscape: boolean;
|
|
5173
|
-
placeholder: string;
|
|
5174
5191
|
messages: string | readonly string[];
|
|
5175
5192
|
rules: readonly import("../../types.js").ValidationRule[];
|
|
5176
5193
|
focused: boolean;
|
|
@@ -5229,6 +5246,7 @@ export declare const VDateInput: {
|
|
|
5229
5246
|
year?: number | undefined;
|
|
5230
5247
|
class?: any;
|
|
5231
5248
|
theme?: string | undefined;
|
|
5249
|
+
placeholder?: string | undefined;
|
|
5232
5250
|
elevation?: string | number | undefined;
|
|
5233
5251
|
counter?: string | number | boolean | undefined;
|
|
5234
5252
|
mobileBreakpoint?: number | import("../../composables/display.js").DisplayBreakpoint | undefined;
|
|
@@ -5258,6 +5276,7 @@ export declare const VDateInput: {
|
|
|
5258
5276
|
modelModifiers?: Record<string, boolean> | undefined;
|
|
5259
5277
|
firstDayOfWeek?: string | number | undefined;
|
|
5260
5278
|
allowedDates?: unknown[] | ((date: unknown) => boolean) | undefined;
|
|
5279
|
+
inputFormat?: string | undefined;
|
|
5261
5280
|
displayFormat?: string | Function | undefined;
|
|
5262
5281
|
} & {
|
|
5263
5282
|
$children?: import("vue").VNodeChild | (() => import("vue").VNodeChild) | {
|
|
@@ -5319,6 +5338,7 @@ export declare const VDateInput: {
|
|
|
5319
5338
|
} & {
|
|
5320
5339
|
onCancel?: (() => any) | undefined;
|
|
5321
5340
|
"onUpdate:modelValue"?: ((val: string) => any) | undefined;
|
|
5341
|
+
"onUpdate:menu"?: ((val: boolean) => any) | undefined;
|
|
5322
5342
|
onSave?: ((value: string) => any) | undefined;
|
|
5323
5343
|
}, Omit<Omit<{
|
|
5324
5344
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -7262,6 +7282,7 @@ export declare const VDateInput: {
|
|
|
7262
7282
|
save: (value: string) => true;
|
|
7263
7283
|
cancel: () => true;
|
|
7264
7284
|
'update:modelValue': (val: string) => true;
|
|
7285
|
+
'update:menu': (val: boolean) => true;
|
|
7265
7286
|
}, string, {
|
|
7266
7287
|
flat: boolean;
|
|
7267
7288
|
reverse: boolean;
|
|
@@ -7273,6 +7294,7 @@ export declare const VDateInput: {
|
|
|
7273
7294
|
direction: "horizontal" | "vertical";
|
|
7274
7295
|
transition: string;
|
|
7275
7296
|
header: string;
|
|
7297
|
+
menu: boolean;
|
|
7276
7298
|
style: import("vue").StyleValue;
|
|
7277
7299
|
title: string;
|
|
7278
7300
|
autofocus: boolean;
|
|
@@ -7281,7 +7303,6 @@ export declare const VDateInput: {
|
|
|
7281
7303
|
readonly: boolean | null;
|
|
7282
7304
|
tag: string | import("../../util/index.js").JSXComponent;
|
|
7283
7305
|
landscape: boolean;
|
|
7284
|
-
placeholder: string;
|
|
7285
7306
|
messages: string | readonly string[];
|
|
7286
7307
|
rules: readonly import("../../types.js").ValidationRule[];
|
|
7287
7308
|
focused: boolean;
|
|
@@ -7525,10 +7546,7 @@ export declare const VDateInput: {
|
|
|
7525
7546
|
counter: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
7526
7547
|
counterValue: PropType<number | ((value: any) => number)>;
|
|
7527
7548
|
prefix: StringConstructor;
|
|
7528
|
-
placeholder:
|
|
7529
|
-
type: PropType<string>;
|
|
7530
|
-
default: string;
|
|
7531
|
-
};
|
|
7549
|
+
placeholder: StringConstructor;
|
|
7532
7550
|
persistentPlaceholder: BooleanConstructor;
|
|
7533
7551
|
persistentCounter: BooleanConstructor;
|
|
7534
7552
|
suffix: StringConstructor;
|
|
@@ -7558,11 +7576,16 @@ export declare const VDateInput: {
|
|
|
7558
7576
|
default: NonNullable<boolean | null> | null;
|
|
7559
7577
|
};
|
|
7560
7578
|
mobileBreakpoint: PropType<number | import("../../composables/display.js").DisplayBreakpoint>;
|
|
7579
|
+
inputFormat: {
|
|
7580
|
+
type: StringConstructor;
|
|
7581
|
+
validator: (v: string) => boolean;
|
|
7582
|
+
};
|
|
7561
7583
|
displayFormat: (FunctionConstructor | StringConstructor)[];
|
|
7562
7584
|
location: {
|
|
7563
7585
|
type: PropType<StrategyProps["location"]>;
|
|
7564
7586
|
default: string;
|
|
7565
7587
|
};
|
|
7588
|
+
menu: BooleanConstructor;
|
|
7566
7589
|
updateOn: {
|
|
7567
7590
|
type: PropType<("blur" | "enter")[]>;
|
|
7568
7591
|
default: () => string[];
|
|
@@ -7755,10 +7778,7 @@ export declare const VDateInput: {
|
|
|
7755
7778
|
counter: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
7756
7779
|
counterValue: PropType<number | ((value: any) => number)>;
|
|
7757
7780
|
prefix: StringConstructor;
|
|
7758
|
-
placeholder:
|
|
7759
|
-
type: PropType<string>;
|
|
7760
|
-
default: string;
|
|
7761
|
-
};
|
|
7781
|
+
placeholder: StringConstructor;
|
|
7762
7782
|
persistentPlaceholder: BooleanConstructor;
|
|
7763
7783
|
persistentCounter: BooleanConstructor;
|
|
7764
7784
|
suffix: StringConstructor;
|
|
@@ -7788,11 +7808,16 @@ export declare const VDateInput: {
|
|
|
7788
7808
|
default: NonNullable<boolean | null> | null;
|
|
7789
7809
|
};
|
|
7790
7810
|
mobileBreakpoint: PropType<number | import("../../composables/display.js").DisplayBreakpoint>;
|
|
7811
|
+
inputFormat: {
|
|
7812
|
+
type: StringConstructor;
|
|
7813
|
+
validator: (v: string) => boolean;
|
|
7814
|
+
};
|
|
7791
7815
|
displayFormat: (FunctionConstructor | StringConstructor)[];
|
|
7792
7816
|
location: {
|
|
7793
7817
|
type: PropType<StrategyProps["location"]>;
|
|
7794
7818
|
default: string;
|
|
7795
7819
|
};
|
|
7820
|
+
menu: BooleanConstructor;
|
|
7796
7821
|
updateOn: {
|
|
7797
7822
|
type: PropType<("blur" | "enter")[]>;
|
|
7798
7823
|
default: () => string[];
|
|
@@ -5,13 +5,14 @@ import { makeVDatePickerProps, VDatePicker } from "../../components/VDatePicker/
|
|
|
5
5
|
import { VMenu } from "../../components/VMenu/VMenu.js";
|
|
6
6
|
import { makeVTextFieldProps, VTextField } from "../../components/VTextField/VTextField.js"; // Composables
|
|
7
7
|
import { useDate } from "../../composables/date/index.js";
|
|
8
|
+
import { makeDateFormatProps, useDateFormat } from "../../composables/dateFormat.js";
|
|
8
9
|
import { makeDisplayProps, useDisplay } from "../../composables/display.js";
|
|
9
10
|
import { makeFocusProps, useFocus } from "../../composables/focus.js";
|
|
10
11
|
import { forwardRefs } from "../../composables/forwardRefs.js";
|
|
11
12
|
import { useLocale } from "../../composables/locale.js";
|
|
12
13
|
import { useProxiedModel } from "../../composables/proxiedModel.js"; // Utilities
|
|
13
14
|
import { computed, ref, shallowRef, watch } from 'vue';
|
|
14
|
-
import { genericComponent, omit, propsFactory, useRender, wrapInArray } from "../../util/index.js"; // Types
|
|
15
|
+
import { createRange, genericComponent, omit, propsFactory, useRender, wrapInArray } from "../../util/index.js"; // Types
|
|
15
16
|
// Types
|
|
16
17
|
export const makeVDateInputProps = propsFactory({
|
|
17
18
|
displayFormat: [Function, String],
|
|
@@ -19,10 +20,12 @@ export const makeVDateInputProps = propsFactory({
|
|
|
19
20
|
type: String,
|
|
20
21
|
default: 'bottom start'
|
|
21
22
|
},
|
|
23
|
+
menu: Boolean,
|
|
22
24
|
updateOn: {
|
|
23
25
|
type: Array,
|
|
24
26
|
default: () => ['blur', 'enter']
|
|
25
27
|
},
|
|
28
|
+
...makeDateFormatProps(),
|
|
26
29
|
...makeDisplayProps({
|
|
27
30
|
mobile: null
|
|
28
31
|
}),
|
|
@@ -31,7 +34,6 @@ export const makeVDateInputProps = propsFactory({
|
|
|
31
34
|
hideActions: true
|
|
32
35
|
}),
|
|
33
36
|
...makeVTextFieldProps({
|
|
34
|
-
placeholder: 'mm/dd/yyyy',
|
|
35
37
|
prependIcon: '$calendar'
|
|
36
38
|
}),
|
|
37
39
|
...omit(makeVDatePickerProps({
|
|
@@ -45,7 +47,8 @@ export const VDateInput = genericComponent()({
|
|
|
45
47
|
emits: {
|
|
46
48
|
save: value => true,
|
|
47
49
|
cancel: () => true,
|
|
48
|
-
'update:modelValue': val => true
|
|
50
|
+
'update:modelValue': val => true,
|
|
51
|
+
'update:menu': val => true
|
|
49
52
|
},
|
|
50
53
|
setup(props, _ref) {
|
|
51
54
|
let {
|
|
@@ -53,9 +56,16 @@ export const VDateInput = genericComponent()({
|
|
|
53
56
|
slots
|
|
54
57
|
} = _ref;
|
|
55
58
|
const {
|
|
56
|
-
t
|
|
59
|
+
t,
|
|
60
|
+
current: currentLocale
|
|
57
61
|
} = useLocale();
|
|
58
62
|
const adapter = useDate();
|
|
63
|
+
const {
|
|
64
|
+
isValid,
|
|
65
|
+
parseDate,
|
|
66
|
+
formatDate,
|
|
67
|
+
parserFormat
|
|
68
|
+
} = useDateFormat(props, currentLocale);
|
|
59
69
|
const {
|
|
60
70
|
mobile
|
|
61
71
|
} = useDisplay(props);
|
|
@@ -66,7 +76,7 @@ export const VDateInput = genericComponent()({
|
|
|
66
76
|
} = useFocus(props);
|
|
67
77
|
const emptyModelValue = () => props.multiple ? [] : null;
|
|
68
78
|
const model = useProxiedModel(props, 'modelValue', emptyModelValue(), val => Array.isArray(val) ? val.map(item => adapter.toJsDate(item)) : val ? adapter.toJsDate(val) : val, val => Array.isArray(val) ? val.map(item => adapter.date(item)) : val ? adapter.date(val) : val);
|
|
69
|
-
const menu =
|
|
79
|
+
const menu = useProxiedModel(props, 'menu');
|
|
70
80
|
const isEditingInput = shallowRef(false);
|
|
71
81
|
const vTextFieldRef = ref();
|
|
72
82
|
const disabledActions = ref(['save']);
|
|
@@ -74,7 +84,10 @@ export const VDateInput = genericComponent()({
|
|
|
74
84
|
if (typeof props.displayFormat === 'function') {
|
|
75
85
|
return props.displayFormat(date);
|
|
76
86
|
}
|
|
77
|
-
|
|
87
|
+
if (props.displayFormat) {
|
|
88
|
+
return adapter.format(date, props.displayFormat ?? 'keyboardDate');
|
|
89
|
+
}
|
|
90
|
+
return formatDate(date);
|
|
78
91
|
}
|
|
79
92
|
const display = computed(() => {
|
|
80
93
|
const value = wrapInArray(model.value);
|
|
@@ -109,7 +122,6 @@ export const VDateInput = genericComponent()({
|
|
|
109
122
|
if (e.key !== 'Enter') return;
|
|
110
123
|
if (!menu.value || !isFocused.value) {
|
|
111
124
|
menu.value = true;
|
|
112
|
-
return;
|
|
113
125
|
}
|
|
114
126
|
if (props.updateOn.includes('enter')) {
|
|
115
127
|
onUserInput(e.target);
|
|
@@ -153,13 +165,32 @@ export const VDateInput = genericComponent()({
|
|
|
153
165
|
let {
|
|
154
166
|
value
|
|
155
167
|
} = _ref2;
|
|
156
|
-
if (value
|
|
157
|
-
|
|
168
|
+
if (!value.trim()) {
|
|
169
|
+
model.value = emptyModelValue();
|
|
170
|
+
} else if (!props.multiple) {
|
|
171
|
+
if (isValid(value)) {
|
|
172
|
+
model.value = parseDate(value);
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
const parts = value.trim().split(/\D+-\D+|[^\d\-/.]+/);
|
|
176
|
+
if (parts.every(isValid)) {
|
|
177
|
+
if (props.multiple === 'range') {
|
|
178
|
+
model.value = getRange(parts);
|
|
179
|
+
} else {
|
|
180
|
+
model.value = parts.map(parseDate);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function getRange(inputDates) {
|
|
186
|
+
const [start, stop] = inputDates.map(parseDate).toSorted((a, b) => adapter.isAfter(a, b) ? 1 : -1);
|
|
187
|
+
const diff = adapter.getDiff(stop ?? start, start, 'days');
|
|
188
|
+
return [start, ...createRange(diff, 1).map(i => adapter.addDays(start, i))];
|
|
158
189
|
}
|
|
159
190
|
useRender(() => {
|
|
160
191
|
const confirmEditProps = VConfirmEdit.filterProps(props);
|
|
161
192
|
const datePickerProps = VDatePicker.filterProps(omit(props, ['active', 'location', 'rounded']));
|
|
162
|
-
const textFieldProps = VTextField.filterProps(props);
|
|
193
|
+
const textFieldProps = VTextField.filterProps(omit(props, ['placeholder']));
|
|
163
194
|
return _createVNode(VTextField, _mergeProps({
|
|
164
195
|
"ref": vTextFieldRef
|
|
165
196
|
}, textFieldProps, {
|
|
@@ -167,11 +198,13 @@ export const VDateInput = genericComponent()({
|
|
|
167
198
|
"style": props.style,
|
|
168
199
|
"modelValue": display.value,
|
|
169
200
|
"inputmode": inputmode.value,
|
|
201
|
+
"placeholder": props.placeholder ?? parserFormat.value,
|
|
170
202
|
"readonly": isReadonly.value,
|
|
171
203
|
"onKeydown": isInteractive.value ? onKeydown : undefined,
|
|
172
204
|
"focused": menu.value || isFocused.value,
|
|
173
205
|
"onFocus": focus,
|
|
174
206
|
"onBlur": onBlur,
|
|
207
|
+
"validationValue": model.value,
|
|
175
208
|
"onClick:control": isInteractive.value ? onClick : undefined,
|
|
176
209
|
"onClick:prepend": isInteractive.value ? onClick : undefined,
|
|
177
210
|
"onUpdate:modelValue": onUpdateDisplayModel
|