@vuetify/nightly 3.8.4-master.2025-05-13 → 3.8.5-master.2025-05-14
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/CHANGELOG.md +3 -27
- package/dist/_component-variables-labs.sass +1 -0
- package/dist/json/attributes.json +3177 -2841
- package/dist/json/importMap-labs.json +36 -32
- package/dist/json/importMap.json +180 -180
- package/dist/json/tags.json +89 -0
- package/dist/json/web-types.json +6734 -5547
- package/dist/vuetify-labs.cjs +272 -82
- package/dist/vuetify-labs.css +5164 -5136
- package/dist/vuetify-labs.d.ts +1371 -309
- package/dist/vuetify-labs.esm.js +272 -82
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +272 -82
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +5 -4
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +3047 -3022
- package/dist/vuetify.d.ts +70 -67
- package/dist/vuetify.esm.js +5 -4
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +5 -4
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +4 -4
- package/dist/vuetify.min.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 +70 -67
- 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 +28 -31
- package/lib/labs/VDateInput/VDateInput.js +38 -79
- 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 +1 -1
@@ -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,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,+BAExD;AAcA,OAAO,MAAMC,oBAAoB,GAAGF,YAAY,CAAC;EAC/CG,GAAG,EAAEC,OAAO;EACZC,OAAO,EAAE;IACPC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EAED,GAAGf,cAAc,CAAC,CAAC;EACnB,GAAGN,qBAAqB,CAAC,CAAC;EAC1B,GAAGI,mBAAmB,CAAC,CAAC;EACxB,GAAGQ,IAAI,CAACd,qBAAqB,CAAC,CAAC,EAAE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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,8 @@ export declare const makeVDateInputProps: <Defaults extends {
|
|
114
114
|
hideActions?: unknown;
|
115
115
|
mobile?: unknown;
|
116
116
|
mobileBreakpoint?: unknown;
|
117
|
-
displayFormat?: unknown;
|
118
117
|
inputFormat?: unknown;
|
118
|
+
displayFormat?: unknown;
|
119
119
|
location?: unknown;
|
120
120
|
menu?: unknown;
|
121
121
|
updateOn?: unknown;
|
@@ -676,13 +676,7 @@ export declare const makeVDateInputProps: <Defaults extends {
|
|
676
676
|
type: PropType<unknown extends Defaults["prefix"] ? string : string | Defaults["prefix"]>;
|
677
677
|
default: unknown extends Defaults["prefix"] ? string : string | Defaults["prefix"];
|
678
678
|
};
|
679
|
-
placeholder: unknown extends Defaults["placeholder"] ? {
|
680
|
-
type: PropType<string>;
|
681
|
-
default: string;
|
682
|
-
} : Omit<{
|
683
|
-
type: PropType<string>;
|
684
|
-
default: string;
|
685
|
-
}, "type" | "default"> & {
|
679
|
+
placeholder: unknown extends Defaults["placeholder"] ? StringConstructor : {
|
686
680
|
type: PropType<unknown extends Defaults["placeholder"] ? string : string | Defaults["placeholder"]>;
|
687
681
|
default: unknown extends Defaults["placeholder"] ? string : string | Defaults["placeholder"];
|
688
682
|
};
|
@@ -766,14 +760,20 @@ export declare const makeVDateInputProps: <Defaults extends {
|
|
766
760
|
type: PropType<unknown extends Defaults["mobileBreakpoint"] ? number | import("../../composables/display.js").DisplayBreakpoint : number | import("../../composables/display.js").DisplayBreakpoint | Defaults["mobileBreakpoint"]>;
|
767
761
|
default: unknown extends Defaults["mobileBreakpoint"] ? number | import("../../composables/display.js").DisplayBreakpoint : NonNullable<number | import("../../composables/display.js").DisplayBreakpoint> | Defaults["mobileBreakpoint"];
|
768
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
|
+
};
|
769
773
|
displayFormat: unknown extends Defaults["displayFormat"] ? (FunctionConstructor | StringConstructor)[] : {
|
770
774
|
type: PropType<unknown extends Defaults["displayFormat"] ? string | Function : string | Function | Defaults["displayFormat"]>;
|
771
775
|
default: unknown extends Defaults["displayFormat"] ? string | Function : NonNullable<string | Function> | Defaults["displayFormat"];
|
772
776
|
};
|
773
|
-
inputFormat: unknown extends Defaults["inputFormat"] ? (FunctionConstructor | StringConstructor)[] : {
|
774
|
-
type: PropType<unknown extends Defaults["inputFormat"] ? string | Function : string | Function | Defaults["inputFormat"]>;
|
775
|
-
default: unknown extends Defaults["inputFormat"] ? string | Function : NonNullable<string | Function> | Defaults["inputFormat"];
|
776
|
-
};
|
777
777
|
location: unknown extends Defaults["location"] ? {
|
778
778
|
type: PropType<StrategyProps["location"]>;
|
779
779
|
default: string;
|
@@ -820,7 +820,6 @@ export declare const VDateInput: {
|
|
820
820
|
readonly: boolean | null;
|
821
821
|
tag: string | import("../../util/index.js").JSXComponent;
|
822
822
|
landscape: boolean;
|
823
|
-
placeholder: string;
|
824
823
|
messages: string | readonly string[];
|
825
824
|
rules: readonly import("../../types.js").ValidationRule[];
|
826
825
|
focused: boolean;
|
@@ -879,6 +878,7 @@ export declare const VDateInput: {
|
|
879
878
|
year?: number | undefined;
|
880
879
|
class?: any;
|
881
880
|
theme?: string | undefined;
|
881
|
+
placeholder?: string | undefined;
|
882
882
|
elevation?: string | number | undefined;
|
883
883
|
counter?: string | number | boolean | undefined;
|
884
884
|
mobileBreakpoint?: number | import("../../composables/display.js").DisplayBreakpoint | undefined;
|
@@ -908,8 +908,8 @@ export declare const VDateInput: {
|
|
908
908
|
modelModifiers?: Record<string, boolean> | undefined;
|
909
909
|
firstDayOfWeek?: string | number | undefined;
|
910
910
|
allowedDates?: unknown[] | ((date: unknown) => boolean) | undefined;
|
911
|
+
inputFormat?: string | undefined;
|
911
912
|
displayFormat?: string | Function | undefined;
|
912
|
-
inputFormat?: string | Function | undefined;
|
913
913
|
} & {
|
914
914
|
$children?: import("vue").VNodeChild | (() => import("vue").VNodeChild) | {
|
915
915
|
message?: ((arg: import("../../components/VMessages/VMessages.js").VMessageSlot) => import("vue").VNodeChild) | undefined;
|
@@ -2935,7 +2935,6 @@ export declare const VDateInput: {
|
|
2935
2935
|
readonly: boolean | null;
|
2936
2936
|
tag: string | import("../../util/index.js").JSXComponent;
|
2937
2937
|
landscape: boolean;
|
2938
|
-
placeholder: string;
|
2939
2938
|
messages: string | readonly string[];
|
2940
2939
|
rules: readonly import("../../types.js").ValidationRule[];
|
2941
2940
|
focused: boolean;
|
@@ -3018,7 +3017,6 @@ export declare const VDateInput: {
|
|
3018
3017
|
readonly: boolean | null;
|
3019
3018
|
tag: string | import("../../util/index.js").JSXComponent;
|
3020
3019
|
landscape: boolean;
|
3021
|
-
placeholder: string;
|
3022
3020
|
messages: string | readonly string[];
|
3023
3021
|
rules: readonly import("../../types.js").ValidationRule[];
|
3024
3022
|
focused: boolean;
|
@@ -3077,6 +3075,7 @@ export declare const VDateInput: {
|
|
3077
3075
|
year?: number | undefined;
|
3078
3076
|
class?: any;
|
3079
3077
|
theme?: string | undefined;
|
3078
|
+
placeholder?: string | undefined;
|
3080
3079
|
elevation?: string | number | undefined;
|
3081
3080
|
counter?: string | number | boolean | undefined;
|
3082
3081
|
mobileBreakpoint?: number | import("../../composables/display.js").DisplayBreakpoint | undefined;
|
@@ -3106,8 +3105,8 @@ export declare const VDateInput: {
|
|
3106
3105
|
modelModifiers?: Record<string, boolean> | undefined;
|
3107
3106
|
firstDayOfWeek?: string | number | undefined;
|
3108
3107
|
allowedDates?: unknown[] | ((date: unknown) => boolean) | undefined;
|
3108
|
+
inputFormat?: string | undefined;
|
3109
3109
|
displayFormat?: string | Function | undefined;
|
3110
|
-
inputFormat?: string | Function | undefined;
|
3111
3110
|
} & {
|
3112
3111
|
$children?: import("vue").VNodeChild | (() => import("vue").VNodeChild) | {
|
3113
3112
|
message?: ((arg: import("../../components/VMessages/VMessages.js").VMessageSlot) => import("vue").VNodeChild) | undefined;
|
@@ -5128,7 +5127,6 @@ export declare const VDateInput: {
|
|
5128
5127
|
readonly: boolean | null;
|
5129
5128
|
tag: string | import("../../util/index.js").JSXComponent;
|
5130
5129
|
landscape: boolean;
|
5131
|
-
placeholder: string;
|
5132
5130
|
messages: string | readonly string[];
|
5133
5131
|
rules: readonly import("../../types.js").ValidationRule[];
|
5134
5132
|
focused: boolean;
|
@@ -5190,7 +5188,6 @@ export declare const VDateInput: {
|
|
5190
5188
|
readonly: boolean | null;
|
5191
5189
|
tag: string | import("../../util/index.js").JSXComponent;
|
5192
5190
|
landscape: boolean;
|
5193
|
-
placeholder: string;
|
5194
5191
|
messages: string | readonly string[];
|
5195
5192
|
rules: readonly import("../../types.js").ValidationRule[];
|
5196
5193
|
focused: boolean;
|
@@ -5249,6 +5246,7 @@ export declare const VDateInput: {
|
|
5249
5246
|
year?: number | undefined;
|
5250
5247
|
class?: any;
|
5251
5248
|
theme?: string | undefined;
|
5249
|
+
placeholder?: string | undefined;
|
5252
5250
|
elevation?: string | number | undefined;
|
5253
5251
|
counter?: string | number | boolean | undefined;
|
5254
5252
|
mobileBreakpoint?: number | import("../../composables/display.js").DisplayBreakpoint | undefined;
|
@@ -5278,8 +5276,8 @@ export declare const VDateInput: {
|
|
5278
5276
|
modelModifiers?: Record<string, boolean> | undefined;
|
5279
5277
|
firstDayOfWeek?: string | number | undefined;
|
5280
5278
|
allowedDates?: unknown[] | ((date: unknown) => boolean) | undefined;
|
5279
|
+
inputFormat?: string | undefined;
|
5281
5280
|
displayFormat?: string | Function | undefined;
|
5282
|
-
inputFormat?: string | Function | undefined;
|
5283
5281
|
} & {
|
5284
5282
|
$children?: import("vue").VNodeChild | (() => import("vue").VNodeChild) | {
|
5285
5283
|
message?: ((arg: import("../../components/VMessages/VMessages.js").VMessageSlot) => import("vue").VNodeChild) | undefined;
|
@@ -7305,7 +7303,6 @@ export declare const VDateInput: {
|
|
7305
7303
|
readonly: boolean | null;
|
7306
7304
|
tag: string | import("../../util/index.js").JSXComponent;
|
7307
7305
|
landscape: boolean;
|
7308
|
-
placeholder: string;
|
7309
7306
|
messages: string | readonly string[];
|
7310
7307
|
rules: readonly import("../../types.js").ValidationRule[];
|
7311
7308
|
focused: boolean;
|
@@ -7549,10 +7546,7 @@ export declare const VDateInput: {
|
|
7549
7546
|
counter: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
7550
7547
|
counterValue: PropType<number | ((value: any) => number)>;
|
7551
7548
|
prefix: StringConstructor;
|
7552
|
-
placeholder:
|
7553
|
-
type: PropType<string>;
|
7554
|
-
default: string;
|
7555
|
-
};
|
7549
|
+
placeholder: StringConstructor;
|
7556
7550
|
persistentPlaceholder: BooleanConstructor;
|
7557
7551
|
persistentCounter: BooleanConstructor;
|
7558
7552
|
suffix: StringConstructor;
|
@@ -7582,8 +7576,11 @@ export declare const VDateInput: {
|
|
7582
7576
|
default: NonNullable<boolean | null> | null;
|
7583
7577
|
};
|
7584
7578
|
mobileBreakpoint: PropType<number | import("../../composables/display.js").DisplayBreakpoint>;
|
7579
|
+
inputFormat: {
|
7580
|
+
type: StringConstructor;
|
7581
|
+
validator: (v: string) => boolean;
|
7582
|
+
};
|
7585
7583
|
displayFormat: (FunctionConstructor | StringConstructor)[];
|
7586
|
-
inputFormat: (FunctionConstructor | StringConstructor)[];
|
7587
7584
|
location: {
|
7588
7585
|
type: PropType<StrategyProps["location"]>;
|
7589
7586
|
default: string;
|
@@ -7781,10 +7778,7 @@ export declare const VDateInput: {
|
|
7781
7778
|
counter: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
7782
7779
|
counterValue: PropType<number | ((value: any) => number)>;
|
7783
7780
|
prefix: StringConstructor;
|
7784
|
-
placeholder:
|
7785
|
-
type: PropType<string>;
|
7786
|
-
default: string;
|
7787
|
-
};
|
7781
|
+
placeholder: StringConstructor;
|
7788
7782
|
persistentPlaceholder: BooleanConstructor;
|
7789
7783
|
persistentCounter: BooleanConstructor;
|
7790
7784
|
suffix: StringConstructor;
|
@@ -7814,8 +7808,11 @@ export declare const VDateInput: {
|
|
7814
7808
|
default: NonNullable<boolean | null> | null;
|
7815
7809
|
};
|
7816
7810
|
mobileBreakpoint: PropType<number | import("../../composables/display.js").DisplayBreakpoint>;
|
7811
|
+
inputFormat: {
|
7812
|
+
type: StringConstructor;
|
7813
|
+
validator: (v: string) => boolean;
|
7814
|
+
};
|
7817
7815
|
displayFormat: (FunctionConstructor | StringConstructor)[];
|
7818
|
-
inputFormat: (FunctionConstructor | StringConstructor)[];
|
7819
7816
|
location: {
|
7820
7817
|
type: PropType<StrategyProps["location"]>;
|
7821
7818
|
default: string;
|
@@ -5,17 +5,17 @@ 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],
|
18
|
-
inputFormat: [Function, String],
|
19
19
|
location: {
|
20
20
|
type: String,
|
21
21
|
default: 'bottom start'
|
@@ -25,6 +25,7 @@ export const makeVDateInputProps = propsFactory({
|
|
25
25
|
type: Array,
|
26
26
|
default: () => ['blur', 'enter']
|
27
27
|
},
|
28
|
+
...makeDateFormatProps(),
|
28
29
|
...makeDisplayProps({
|
29
30
|
mobile: null
|
30
31
|
}),
|
@@ -33,7 +34,6 @@ export const makeVDateInputProps = propsFactory({
|
|
33
34
|
hideActions: true
|
34
35
|
}),
|
35
36
|
...makeVTextFieldProps({
|
36
|
-
placeholder: 'mm/dd/yyyy',
|
37
37
|
prependIcon: '$calendar'
|
38
38
|
}),
|
39
39
|
...omit(makeVDatePickerProps({
|
@@ -56,9 +56,16 @@ export const VDateInput = genericComponent()({
|
|
56
56
|
slots
|
57
57
|
} = _ref;
|
58
58
|
const {
|
59
|
-
t
|
59
|
+
t,
|
60
|
+
current: currentLocale
|
60
61
|
} = useLocale();
|
61
62
|
const adapter = useDate();
|
63
|
+
const {
|
64
|
+
isValid,
|
65
|
+
parseDate,
|
66
|
+
formatDate,
|
67
|
+
parserFormat
|
68
|
+
} = useDateFormat(props, currentLocale);
|
62
69
|
const {
|
63
70
|
mobile
|
64
71
|
} = useDisplay(props);
|
@@ -77,80 +84,10 @@ export const VDateInput = genericComponent()({
|
|
77
84
|
if (typeof props.displayFormat === 'function') {
|
78
85
|
return props.displayFormat(date);
|
79
86
|
}
|
80
|
-
|
81
|
-
|
82
|
-
function parseDateString(dateString, format) {
|
83
|
-
function countConsecutiveChars(str, startIndex) {
|
84
|
-
const char = str[startIndex];
|
85
|
-
let count = 0;
|
86
|
-
while (str[startIndex + count] === char) count++;
|
87
|
-
return count;
|
88
|
-
}
|
89
|
-
function parseDateParts(dateString, format) {
|
90
|
-
const dateParts = {};
|
91
|
-
let stringIndex = 0;
|
92
|
-
const upperFormat = format.toUpperCase();
|
93
|
-
for (let formatIndex = 0; formatIndex < upperFormat.length;) {
|
94
|
-
const formatChar = upperFormat[formatIndex];
|
95
|
-
const charCount = countConsecutiveChars(upperFormat, formatIndex);
|
96
|
-
const dateValue = dateString.slice(stringIndex, stringIndex + charCount);
|
97
|
-
if (['Y', 'M', 'D'].includes(formatChar)) {
|
98
|
-
const numValue = parseInt(dateValue);
|
99
|
-
if (isNaN(numValue)) return null;
|
100
|
-
dateParts[formatChar] = numValue;
|
101
|
-
}
|
102
|
-
formatIndex += charCount;
|
103
|
-
stringIndex += charCount;
|
104
|
-
}
|
105
|
-
return dateParts;
|
106
|
-
}
|
107
|
-
function validateDateParts(dateParts) {
|
108
|
-
const {
|
109
|
-
Y: year,
|
110
|
-
M: month,
|
111
|
-
D: day
|
112
|
-
} = dateParts;
|
113
|
-
if (!year || !month || !day) return null;
|
114
|
-
if (month < 1 || month > 12) return null;
|
115
|
-
if (day < 1 || day > 31) return null;
|
116
|
-
return {
|
117
|
-
year,
|
118
|
-
month,
|
119
|
-
day
|
120
|
-
};
|
121
|
-
}
|
122
|
-
const dateParts = parseDateParts(dateString, format);
|
123
|
-
if (!dateParts) return null;
|
124
|
-
const validatedParts = validateDateParts(dateParts);
|
125
|
-
if (!validatedParts) return null;
|
126
|
-
const {
|
127
|
-
year,
|
128
|
-
month,
|
129
|
-
day
|
130
|
-
} = validatedParts;
|
131
|
-
return {
|
132
|
-
year,
|
133
|
-
month,
|
134
|
-
day
|
135
|
-
};
|
136
|
-
}
|
137
|
-
function parseUserInput(value) {
|
138
|
-
if (typeof props.inputFormat === 'function') {
|
139
|
-
return props.inputFormat(value);
|
140
|
-
}
|
141
|
-
if (typeof props.inputFormat === 'string') {
|
142
|
-
const formattedDate = parseDateString(value, props.inputFormat);
|
143
|
-
if (!formattedDate) {
|
144
|
-
return model.value;
|
145
|
-
}
|
146
|
-
const {
|
147
|
-
year,
|
148
|
-
month,
|
149
|
-
day
|
150
|
-
} = formattedDate;
|
151
|
-
return adapter.parseISO(`${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`);
|
87
|
+
if (props.displayFormat) {
|
88
|
+
return adapter.format(date, props.displayFormat ?? 'keyboardDate');
|
152
89
|
}
|
153
|
-
return
|
90
|
+
return formatDate(date);
|
154
91
|
}
|
155
92
|
const display = computed(() => {
|
156
93
|
const value = wrapInArray(model.value);
|
@@ -228,12 +165,32 @@ export const VDateInput = genericComponent()({
|
|
228
165
|
let {
|
229
166
|
value
|
230
167
|
} = _ref2;
|
231
|
-
|
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))];
|
232
189
|
}
|
233
190
|
useRender(() => {
|
234
191
|
const confirmEditProps = VConfirmEdit.filterProps(props);
|
235
192
|
const datePickerProps = VDatePicker.filterProps(omit(props, ['active', 'location', 'rounded']));
|
236
|
-
const textFieldProps = VTextField.filterProps(props);
|
193
|
+
const textFieldProps = VTextField.filterProps(omit(props, ['placeholder']));
|
237
194
|
return _createVNode(VTextField, _mergeProps({
|
238
195
|
"ref": vTextFieldRef
|
239
196
|
}, textFieldProps, {
|
@@ -241,11 +198,13 @@ export const VDateInput = genericComponent()({
|
|
241
198
|
"style": props.style,
|
242
199
|
"modelValue": display.value,
|
243
200
|
"inputmode": inputmode.value,
|
201
|
+
"placeholder": props.placeholder ?? parserFormat.value,
|
244
202
|
"readonly": isReadonly.value,
|
245
203
|
"onKeydown": isInteractive.value ? onKeydown : undefined,
|
246
204
|
"focused": menu.value || isFocused.value,
|
247
205
|
"onFocus": focus,
|
248
206
|
"onBlur": onBlur,
|
207
|
+
"validationValue": model.value,
|
249
208
|
"onClick:control": isInteractive.value ? onClick : undefined,
|
250
209
|
"onClick:prepend": isInteractive.value ? onClick : undefined,
|
251
210
|
"onUpdate:modelValue": onUpdateDisplayModel
|