vuetify 3.8.4 → 3.8.6
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 +3300 -2956
- package/dist/json/importMap-labs.json +24 -20
- package/dist/json/importMap.json +182 -182
- package/dist/json/tags.json +91 -0
- package/dist/json/web-types.json +6720 -5503
- package/dist/vuetify-labs.cjs +294 -51
- package/dist/vuetify-labs.css +4169 -4130
- package/dist/vuetify-labs.d.ts +2235 -1152
- package/dist/vuetify-labs.esm.js +294 -51
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +294 -51
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +22 -42
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +2580 -2544
- package/dist/vuetify.d.ts +532 -526
- package/dist/vuetify.esm.js +22 -42
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +22 -42
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +582 -579
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.d.ts +84 -84
- 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/VCheckbox/VCheckbox.d.ts +12 -12
- package/lib/components/VCombobox/VCombobox.d.ts +84 -84
- package/lib/components/VFileInput/VFileInput.d.ts +30 -30
- package/lib/components/VInput/VInput.d.ts +12 -12
- package/lib/components/VList/VList.d.ts +3 -3
- package/lib/components/VList/VList.js.map +1 -1
- package/lib/components/VNumberInput/VNumberInput.css +15 -4
- package/lib/components/VNumberInput/VNumberInput.d.ts +80 -80
- package/lib/components/VNumberInput/VNumberInput.sass +18 -6
- package/lib/components/VRadioGroup/VRadioGroup.d.ts +12 -12
- package/lib/components/VRangeSlider/VRangeSlider.d.ts +12 -12
- package/lib/components/VSelect/VSelect.d.ts +84 -84
- package/lib/components/VSelect/VSelect.js +6 -4
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSlider/VSlider.d.ts +12 -12
- package/lib/components/VSnackbarQueue/VSnackbarQueue.d.ts +3 -1
- package/lib/components/VSnackbarQueue/VSnackbarQueue.js.map +1 -1
- package/lib/components/VSwitch/VSwitch.d.ts +12 -12
- package/lib/components/VTextField/VTextField.d.ts +30 -30
- package/lib/components/VTextarea/VTextarea.d.ts +30 -30
- package/lib/components/VValidation/VValidation.d.ts +8 -8
- 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/composables/validation.d.ts +6 -5
- package/lib/composables/validation.js +4 -29
- package/lib/composables/validation.js.map +1 -1
- package/lib/entry-bundler.js +1 -1
- package/lib/framework.d.ts +71 -68
- 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 +130 -105
- 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/lib/labs/rules/rules.d.ts +9 -5
- package/lib/labs/rules/rules.js +73 -51
- package/lib/labs/rules/rules.js.map +1 -1
- package/lib/util/helpers.js +1 -1
- package/lib/util/helpers.js.map +1 -1
- package/package.json +2 -3
package/dist/vuetify-labs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vuetify v3.8.
|
|
2
|
+
* Vuetify v3.8.6
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
}
|
|
513
513
|
function focusChild(el, location) {
|
|
514
514
|
const focusable = focusableChildren(el);
|
|
515
|
-
if (
|
|
515
|
+
if (location == null) {
|
|
516
516
|
if (el === document.activeElement || !el.contains(document.activeElement)) {
|
|
517
517
|
focusable[0]?.focus();
|
|
518
518
|
}
|
|
@@ -4510,7 +4510,8 @@
|
|
|
4510
4510
|
treeviewCollapse: 'mdi-menu-down',
|
|
4511
4511
|
treeviewExpand: 'mdi-menu-right',
|
|
4512
4512
|
eyeDropper: 'mdi-eyedropper',
|
|
4513
|
-
upload: 'mdi-cloud-upload'
|
|
4513
|
+
upload: 'mdi-cloud-upload',
|
|
4514
|
+
color: 'mdi-palette'
|
|
4514
4515
|
};
|
|
4515
4516
|
const mdi = {
|
|
4516
4517
|
// Not using mergeProps here, functional components merge props by default (?)
|
|
@@ -6760,13 +6761,18 @@
|
|
|
6760
6761
|
};
|
|
6761
6762
|
}
|
|
6762
6763
|
|
|
6764
|
+
// Utilities
|
|
6765
|
+
const RulesSymbol = Symbol.for('vuetify:rules');
|
|
6766
|
+
function useRules(fn) {
|
|
6767
|
+
const resolveRules = vue.inject(RulesSymbol, null);
|
|
6768
|
+
if (!resolveRules) return vue.toRef(fn);
|
|
6769
|
+
return resolveRules(fn);
|
|
6770
|
+
}
|
|
6771
|
+
|
|
6763
6772
|
// Composables
|
|
6764
6773
|
|
|
6765
6774
|
// Types
|
|
6766
6775
|
|
|
6767
|
-
// type ValidationRuleParams = [any, string?]
|
|
6768
|
-
// type ValidationAlias = string | [string, ...ValidationRuleParams]
|
|
6769
|
-
|
|
6770
6776
|
const makeValidationProps = propsFactory({
|
|
6771
6777
|
disabled: {
|
|
6772
6778
|
type: Boolean,
|
|
@@ -6789,7 +6795,6 @@
|
|
|
6789
6795
|
},
|
|
6790
6796
|
rules: {
|
|
6791
6797
|
type: Array,
|
|
6792
|
-
// type: Array as PropType<readonly (ValidationRule | ValidationAlias)[]>,
|
|
6793
6798
|
default: () => []
|
|
6794
6799
|
},
|
|
6795
6800
|
modelValue: null,
|
|
@@ -6803,7 +6808,7 @@
|
|
|
6803
6808
|
const model = useProxiedModel(props, 'modelValue');
|
|
6804
6809
|
const validationModel = vue.computed(() => props.validationValue === undefined ? model.value : props.validationValue);
|
|
6805
6810
|
const form = useForm(props);
|
|
6806
|
-
|
|
6811
|
+
const rules = useRules(() => props.rules);
|
|
6807
6812
|
const internalErrorMessages = vue.ref([]);
|
|
6808
6813
|
const isPristine = vue.shallowRef(true);
|
|
6809
6814
|
const isDirty = vue.computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
|
|
@@ -6843,28 +6848,6 @@
|
|
|
6843
6848
|
});
|
|
6844
6849
|
const vm = getCurrentInstance('validation');
|
|
6845
6850
|
const uid = vue.computed(() => props.name ?? vue.unref(id));
|
|
6846
|
-
|
|
6847
|
-
// const resolvedRules = computed(() => props.rules.map(rule => {
|
|
6848
|
-
// let ruleName: string | null = null
|
|
6849
|
-
// let ruleParams: ValidationRuleParams = [undefined]
|
|
6850
|
-
// if (Array.isArray(rule)) {
|
|
6851
|
-
// ruleName = rule[0]
|
|
6852
|
-
// ruleParams = rule.slice(1) as ValidationRuleParams
|
|
6853
|
-
// } else if (typeof rule === 'string') {
|
|
6854
|
-
// ruleName = rule
|
|
6855
|
-
// }
|
|
6856
|
-
|
|
6857
|
-
// if (ruleName !== null) {
|
|
6858
|
-
// if (ruleName.startsWith('$')) {
|
|
6859
|
-
// ruleName = ruleName.slice(1)
|
|
6860
|
-
// }
|
|
6861
|
-
|
|
6862
|
-
// return rules?.[ruleName]?.(...ruleParams)
|
|
6863
|
-
// } else {
|
|
6864
|
-
// return rule
|
|
6865
|
-
// }
|
|
6866
|
-
// }))
|
|
6867
|
-
|
|
6868
6851
|
vue.onBeforeMount(() => {
|
|
6869
6852
|
form.register?.({
|
|
6870
6853
|
id: uid.value,
|
|
@@ -6920,7 +6903,7 @@
|
|
|
6920
6903
|
let silent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6921
6904
|
const results = [];
|
|
6922
6905
|
isValidating.value = true;
|
|
6923
|
-
for (const rule of
|
|
6906
|
+
for (const rule of rules.value) {
|
|
6924
6907
|
if (results.length >= Number(props.maxErrors ?? 1)) {
|
|
6925
6908
|
break;
|
|
6926
6909
|
}
|
|
@@ -12832,11 +12815,13 @@
|
|
|
12832
12815
|
keyboardLookupLastTime = now;
|
|
12833
12816
|
const item = items.value.find(item => item.title.toLowerCase().startsWith(keyboardLookupPrefix));
|
|
12834
12817
|
if (item !== undefined) {
|
|
12835
|
-
|
|
12818
|
+
if (!props.multiple) {
|
|
12819
|
+
model.value = [item];
|
|
12820
|
+
}
|
|
12836
12821
|
const index = displayItems.value.indexOf(item);
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
}
|
|
12822
|
+
if (~index && IN_BROWSER) {
|
|
12823
|
+
listRef.value?.focus(index);
|
|
12824
|
+
}
|
|
12840
12825
|
}
|
|
12841
12826
|
}
|
|
12842
12827
|
|
|
@@ -13506,11 +13491,6 @@
|
|
|
13506
13491
|
menu.value = true;
|
|
13507
13492
|
}
|
|
13508
13493
|
});
|
|
13509
|
-
vue.watch(model, value => {
|
|
13510
|
-
if (!props.multiple && !hasSelectionSlot.value) {
|
|
13511
|
-
search.value = value[0]?.title ?? '';
|
|
13512
|
-
}
|
|
13513
|
-
});
|
|
13514
13494
|
useRender(() => {
|
|
13515
13495
|
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
|
13516
13496
|
const isDirty = model.value.length > 0;
|
|
@@ -29081,6 +29061,236 @@
|
|
|
29081
29061
|
|
|
29082
29062
|
// Types
|
|
29083
29063
|
|
|
29064
|
+
const makeVColorInputProps = propsFactory({
|
|
29065
|
+
pip: Boolean,
|
|
29066
|
+
pipIcon: {
|
|
29067
|
+
type: String,
|
|
29068
|
+
default: '$color'
|
|
29069
|
+
},
|
|
29070
|
+
...makeFocusProps(),
|
|
29071
|
+
...makeVConfirmEditProps(),
|
|
29072
|
+
...makeVTextFieldProps(),
|
|
29073
|
+
...omit(makeVColorPickerProps(), ['width'])
|
|
29074
|
+
}, 'VColorInput');
|
|
29075
|
+
const VColorInput = genericComponent()({
|
|
29076
|
+
name: 'VColorInput',
|
|
29077
|
+
props: makeVColorInputProps(),
|
|
29078
|
+
emits: {
|
|
29079
|
+
'update:modelValue': val => true
|
|
29080
|
+
},
|
|
29081
|
+
setup(props, _ref) {
|
|
29082
|
+
let {
|
|
29083
|
+
slots
|
|
29084
|
+
} = _ref;
|
|
29085
|
+
const {
|
|
29086
|
+
isFocused,
|
|
29087
|
+
focus,
|
|
29088
|
+
blur
|
|
29089
|
+
} = useFocus(props);
|
|
29090
|
+
const model = useProxiedModel(props, 'modelValue');
|
|
29091
|
+
const menu = vue.shallowRef(false);
|
|
29092
|
+
const isInteractive = vue.computed(() => !props.disabled && !props.readonly);
|
|
29093
|
+
const display = vue.computed(() => model.value || null);
|
|
29094
|
+
function onKeydown(e) {
|
|
29095
|
+
if (e.key !== 'Enter') return;
|
|
29096
|
+
if (!menu.value || !isFocused.value) {
|
|
29097
|
+
menu.value = true;
|
|
29098
|
+
return;
|
|
29099
|
+
}
|
|
29100
|
+
const target = e.target;
|
|
29101
|
+
model.value = target.value;
|
|
29102
|
+
}
|
|
29103
|
+
function onClick(e) {
|
|
29104
|
+
e.preventDefault();
|
|
29105
|
+
e.stopPropagation();
|
|
29106
|
+
menu.value = true;
|
|
29107
|
+
}
|
|
29108
|
+
function onSave() {
|
|
29109
|
+
menu.value = false;
|
|
29110
|
+
}
|
|
29111
|
+
useRender(() => {
|
|
29112
|
+
const confirmEditProps = VConfirmEdit.filterProps(props);
|
|
29113
|
+
const colorPickerProps = VColorPicker.filterProps(omit(props, ['active', 'color']));
|
|
29114
|
+
const textFieldProps = VTextField.filterProps(omit(props, ['prependInnerIcon']));
|
|
29115
|
+
const hasPrepend = !!(slots.prepend || props.pipIcon);
|
|
29116
|
+
return vue.createVNode(VTextField, vue.mergeProps(textFieldProps, {
|
|
29117
|
+
"class": ['v-color-input', props.class],
|
|
29118
|
+
"style": props.style,
|
|
29119
|
+
"modelValue": display.value,
|
|
29120
|
+
"onKeydown": isInteractive.value ? onKeydown : undefined,
|
|
29121
|
+
"focused": menu.value || isFocused.value,
|
|
29122
|
+
"onFocus": focus,
|
|
29123
|
+
"onBlur": blur,
|
|
29124
|
+
"onClick:control": isInteractive.value ? onClick : undefined,
|
|
29125
|
+
"onClick:prependInner": isInteractive.value ? onClick : undefined,
|
|
29126
|
+
"onClick:appendInner": isInteractive.value ? onClick : undefined,
|
|
29127
|
+
"onUpdate:modelValue": val => {
|
|
29128
|
+
model.value = val;
|
|
29129
|
+
}
|
|
29130
|
+
}), {
|
|
29131
|
+
...slots,
|
|
29132
|
+
prepend: props.pipIcon ? arg => vue.createVNode(vue.Fragment, null, [hasPrepend && vue.createVNode(VIcon, {
|
|
29133
|
+
"color": props.pip ? model.value : undefined,
|
|
29134
|
+
"icon": props.pipIcon
|
|
29135
|
+
}, null), slots.prepend?.(arg)]) : undefined,
|
|
29136
|
+
default: () => vue.createVNode(vue.Fragment, null, [vue.createVNode(VMenu, {
|
|
29137
|
+
"modelValue": menu.value,
|
|
29138
|
+
"onUpdate:modelValue": $event => menu.value = $event,
|
|
29139
|
+
"activator": "parent",
|
|
29140
|
+
"min-width": "0",
|
|
29141
|
+
"closeOnContentClick": false,
|
|
29142
|
+
"openOnClick": false
|
|
29143
|
+
}, {
|
|
29144
|
+
default: () => [vue.createVNode(VConfirmEdit, vue.mergeProps(confirmEditProps, {
|
|
29145
|
+
"modelValue": model.value,
|
|
29146
|
+
"onUpdate:modelValue": $event => model.value = $event,
|
|
29147
|
+
"onSave": onSave
|
|
29148
|
+
}), {
|
|
29149
|
+
default: _ref2 => {
|
|
29150
|
+
let {
|
|
29151
|
+
actions,
|
|
29152
|
+
model: proxyModel,
|
|
29153
|
+
save,
|
|
29154
|
+
cancel,
|
|
29155
|
+
isPristine
|
|
29156
|
+
} = _ref2;
|
|
29157
|
+
return vue.createVNode(VColorPicker, vue.mergeProps(colorPickerProps, {
|
|
29158
|
+
"modelValue": proxyModel.value,
|
|
29159
|
+
"onUpdate:modelValue": val => {
|
|
29160
|
+
proxyModel.value = val;
|
|
29161
|
+
model.value = val;
|
|
29162
|
+
},
|
|
29163
|
+
"onMousedown": e => e.preventDefault()
|
|
29164
|
+
}), {
|
|
29165
|
+
actions: !props.hideActions ? () => slots.actions?.({
|
|
29166
|
+
save,
|
|
29167
|
+
cancel,
|
|
29168
|
+
isPristine
|
|
29169
|
+
}) ?? actions() : undefined
|
|
29170
|
+
});
|
|
29171
|
+
}
|
|
29172
|
+
})]
|
|
29173
|
+
}), slots.default?.()])
|
|
29174
|
+
});
|
|
29175
|
+
});
|
|
29176
|
+
}
|
|
29177
|
+
});
|
|
29178
|
+
|
|
29179
|
+
// Composables
|
|
29180
|
+
|
|
29181
|
+
// Types
|
|
29182
|
+
|
|
29183
|
+
// Types
|
|
29184
|
+
|
|
29185
|
+
class DateFormatSpec {
|
|
29186
|
+
constructor(order,
|
|
29187
|
+
// mdy | dmy | ymd
|
|
29188
|
+
separator // / | - | .
|
|
29189
|
+
) {
|
|
29190
|
+
this.order = order;
|
|
29191
|
+
this.separator = separator;
|
|
29192
|
+
}
|
|
29193
|
+
get format() {
|
|
29194
|
+
return this.order.split('').map(sign => `${sign}${sign}`).join(this.separator).replace('yy', 'yyyy');
|
|
29195
|
+
}
|
|
29196
|
+
static canBeParsed(v) {
|
|
29197
|
+
if (typeof v !== 'string') return false;
|
|
29198
|
+
const lowercase = v.toLowerCase();
|
|
29199
|
+
return ['y', 'm', 'd'].every(sign => lowercase.includes(sign)) && ['/', '-', '.'].some(sign => v.includes(sign));
|
|
29200
|
+
}
|
|
29201
|
+
static parse(v) {
|
|
29202
|
+
if (!DateFormatSpec.canBeParsed(v)) {
|
|
29203
|
+
throw new Error(`[${v}] cannot be parsed into date format specification`);
|
|
29204
|
+
}
|
|
29205
|
+
const order = v.toLowerCase().split('').filter((c, i, all) => 'dmy'.includes(c) && all.indexOf(c) === i).join('');
|
|
29206
|
+
const separator = ['/', '-', '.'].find(sign => v.includes(sign));
|
|
29207
|
+
return new DateFormatSpec(order, separator);
|
|
29208
|
+
}
|
|
29209
|
+
}
|
|
29210
|
+
const makeDateFormatProps = propsFactory({
|
|
29211
|
+
inputFormat: {
|
|
29212
|
+
type: String,
|
|
29213
|
+
validator: v => !v || DateFormatSpec.canBeParsed(v)
|
|
29214
|
+
}
|
|
29215
|
+
}, 'date-format');
|
|
29216
|
+
function useDateFormat(props, locale) {
|
|
29217
|
+
const adapter = useDate();
|
|
29218
|
+
function inferFromLocale() {
|
|
29219
|
+
const localeForDateFormat = locale.value ?? 'en-US';
|
|
29220
|
+
const formatFromLocale = Intl.DateTimeFormat(localeForDateFormat, {
|
|
29221
|
+
year: 'numeric',
|
|
29222
|
+
month: '2-digit',
|
|
29223
|
+
day: '2-digit'
|
|
29224
|
+
}).format(adapter.toJsDate(adapter.parseISO('1999-12-07'))).replace(/(07)|(٠٧)|(٢٩)|(۱۶)|(০৭)/, 'dd').replace(/(12)|(١٢)|(٠٨)|(۰۹)|(১২)/, 'mm').replace(/(1999)|(2542)|(١٩٩٩)|(١٤٢٠)|(۱۳۷۸)|(১৯৯৯)/, 'yyyy').replace(/[^ymd\-/.]/g, '').replace(/\.$/, '');
|
|
29225
|
+
if (!DateFormatSpec.canBeParsed(formatFromLocale)) {
|
|
29226
|
+
consoleWarn(`Date format inferred from locale [${localeForDateFormat}] is invalid: [${formatFromLocale}]`);
|
|
29227
|
+
return 'mm/dd/yyyy';
|
|
29228
|
+
}
|
|
29229
|
+
return formatFromLocale;
|
|
29230
|
+
}
|
|
29231
|
+
const currentFormat = vue.toRef(() => {
|
|
29232
|
+
return DateFormatSpec.canBeParsed(props.inputFormat) ? DateFormatSpec.parse(props.inputFormat) : DateFormatSpec.parse(inferFromLocale());
|
|
29233
|
+
});
|
|
29234
|
+
function parseDate(dateString) {
|
|
29235
|
+
function parseDateParts(text) {
|
|
29236
|
+
const parts = text.trim().split(currentFormat.value.separator);
|
|
29237
|
+
return {
|
|
29238
|
+
y: Number(parts[currentFormat.value.order.indexOf('y')]),
|
|
29239
|
+
m: Number(parts[currentFormat.value.order.indexOf('m')]),
|
|
29240
|
+
d: Number(parts[currentFormat.value.order.indexOf('d')])
|
|
29241
|
+
};
|
|
29242
|
+
}
|
|
29243
|
+
function validateDateParts(dateParts) {
|
|
29244
|
+
const {
|
|
29245
|
+
y: year,
|
|
29246
|
+
m: month,
|
|
29247
|
+
d: day
|
|
29248
|
+
} = dateParts;
|
|
29249
|
+
if (!year || !month || !day) return null;
|
|
29250
|
+
if (month < 1 || month > 12) return null;
|
|
29251
|
+
if (day < 1 || day > 31) return null;
|
|
29252
|
+
return {
|
|
29253
|
+
year: autoFixYear(year),
|
|
29254
|
+
month,
|
|
29255
|
+
day
|
|
29256
|
+
};
|
|
29257
|
+
}
|
|
29258
|
+
function autoFixYear(year) {
|
|
29259
|
+
const currentYear = adapter.getYear(adapter.date());
|
|
29260
|
+
if (year > 100 || currentYear % 100 >= 50) {
|
|
29261
|
+
return year;
|
|
29262
|
+
}
|
|
29263
|
+
const currentCentury = ~~(currentYear / 100) * 100;
|
|
29264
|
+
return year < 50 ? currentCentury + year : currentCentury - 100 + year;
|
|
29265
|
+
}
|
|
29266
|
+
const dateParts = parseDateParts(dateString);
|
|
29267
|
+
const validatedParts = validateDateParts(dateParts);
|
|
29268
|
+
if (!validatedParts) return null;
|
|
29269
|
+
const {
|
|
29270
|
+
year,
|
|
29271
|
+
month,
|
|
29272
|
+
day
|
|
29273
|
+
} = validatedParts;
|
|
29274
|
+
const pad = v => String(v).padStart(2, '0');
|
|
29275
|
+
return adapter.parseISO(`${year}-${pad(month)}-${pad(day)}`);
|
|
29276
|
+
}
|
|
29277
|
+
function isValid(text) {
|
|
29278
|
+
return !!parseDate(text);
|
|
29279
|
+
}
|
|
29280
|
+
function formatDate(value) {
|
|
29281
|
+
const parts = adapter.toISO(value).split('-');
|
|
29282
|
+
return currentFormat.value.order.split('').map(sign => parts['ymd'.indexOf(sign)]).join(currentFormat.value.separator);
|
|
29283
|
+
}
|
|
29284
|
+
return {
|
|
29285
|
+
isValid,
|
|
29286
|
+
parseDate,
|
|
29287
|
+
formatDate,
|
|
29288
|
+
parserFormat: vue.toRef(() => currentFormat.value.format)
|
|
29289
|
+
};
|
|
29290
|
+
}
|
|
29291
|
+
|
|
29292
|
+
// Types
|
|
29293
|
+
|
|
29084
29294
|
// Types
|
|
29085
29295
|
|
|
29086
29296
|
const makeVDateInputProps = propsFactory({
|
|
@@ -29089,10 +29299,12 @@
|
|
|
29089
29299
|
type: String,
|
|
29090
29300
|
default: 'bottom start'
|
|
29091
29301
|
},
|
|
29302
|
+
menu: Boolean,
|
|
29092
29303
|
updateOn: {
|
|
29093
29304
|
type: Array,
|
|
29094
29305
|
default: () => ['blur', 'enter']
|
|
29095
29306
|
},
|
|
29307
|
+
...makeDateFormatProps(),
|
|
29096
29308
|
...makeDisplayProps({
|
|
29097
29309
|
mobile: null
|
|
29098
29310
|
}),
|
|
@@ -29101,7 +29313,6 @@
|
|
|
29101
29313
|
hideActions: true
|
|
29102
29314
|
}),
|
|
29103
29315
|
...makeVTextFieldProps({
|
|
29104
|
-
placeholder: 'mm/dd/yyyy',
|
|
29105
29316
|
prependIcon: '$calendar'
|
|
29106
29317
|
}),
|
|
29107
29318
|
...omit(makeVDatePickerProps({
|
|
@@ -29115,7 +29326,8 @@
|
|
|
29115
29326
|
emits: {
|
|
29116
29327
|
save: value => true,
|
|
29117
29328
|
cancel: () => true,
|
|
29118
|
-
'update:modelValue': val => true
|
|
29329
|
+
'update:modelValue': val => true,
|
|
29330
|
+
'update:menu': val => true
|
|
29119
29331
|
},
|
|
29120
29332
|
setup(props, _ref) {
|
|
29121
29333
|
let {
|
|
@@ -29123,9 +29335,16 @@
|
|
|
29123
29335
|
slots
|
|
29124
29336
|
} = _ref;
|
|
29125
29337
|
const {
|
|
29126
|
-
t
|
|
29338
|
+
t,
|
|
29339
|
+
current: currentLocale
|
|
29127
29340
|
} = useLocale();
|
|
29128
29341
|
const adapter = useDate();
|
|
29342
|
+
const {
|
|
29343
|
+
isValid,
|
|
29344
|
+
parseDate,
|
|
29345
|
+
formatDate,
|
|
29346
|
+
parserFormat
|
|
29347
|
+
} = useDateFormat(props, currentLocale);
|
|
29129
29348
|
const {
|
|
29130
29349
|
mobile
|
|
29131
29350
|
} = useDisplay(props);
|
|
@@ -29136,7 +29355,7 @@
|
|
|
29136
29355
|
} = useFocus(props);
|
|
29137
29356
|
const emptyModelValue = () => props.multiple ? [] : null;
|
|
29138
29357
|
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);
|
|
29139
|
-
const menu =
|
|
29358
|
+
const menu = useProxiedModel(props, 'menu');
|
|
29140
29359
|
const isEditingInput = vue.shallowRef(false);
|
|
29141
29360
|
const vTextFieldRef = vue.ref();
|
|
29142
29361
|
const disabledActions = vue.ref(['save']);
|
|
@@ -29144,7 +29363,10 @@
|
|
|
29144
29363
|
if (typeof props.displayFormat === 'function') {
|
|
29145
29364
|
return props.displayFormat(date);
|
|
29146
29365
|
}
|
|
29147
|
-
|
|
29366
|
+
if (props.displayFormat) {
|
|
29367
|
+
return adapter.format(date, props.displayFormat ?? 'keyboardDate');
|
|
29368
|
+
}
|
|
29369
|
+
return formatDate(date);
|
|
29148
29370
|
}
|
|
29149
29371
|
const display = vue.computed(() => {
|
|
29150
29372
|
const value = wrapInArray(model.value);
|
|
@@ -29179,7 +29401,6 @@
|
|
|
29179
29401
|
if (e.key !== 'Enter') return;
|
|
29180
29402
|
if (!menu.value || !isFocused.value) {
|
|
29181
29403
|
menu.value = true;
|
|
29182
|
-
return;
|
|
29183
29404
|
}
|
|
29184
29405
|
if (props.updateOn.includes('enter')) {
|
|
29185
29406
|
onUserInput(e.target);
|
|
@@ -29223,13 +29444,32 @@
|
|
|
29223
29444
|
let {
|
|
29224
29445
|
value
|
|
29225
29446
|
} = _ref2;
|
|
29226
|
-
if (value
|
|
29227
|
-
|
|
29447
|
+
if (!value.trim()) {
|
|
29448
|
+
model.value = emptyModelValue();
|
|
29449
|
+
} else if (!props.multiple) {
|
|
29450
|
+
if (isValid(value)) {
|
|
29451
|
+
model.value = parseDate(value);
|
|
29452
|
+
}
|
|
29453
|
+
} else {
|
|
29454
|
+
const parts = value.trim().split(/\D+-\D+|[^\d\-/.]+/);
|
|
29455
|
+
if (parts.every(isValid)) {
|
|
29456
|
+
if (props.multiple === 'range') {
|
|
29457
|
+
model.value = getRange(parts);
|
|
29458
|
+
} else {
|
|
29459
|
+
model.value = parts.map(parseDate);
|
|
29460
|
+
}
|
|
29461
|
+
}
|
|
29462
|
+
}
|
|
29463
|
+
}
|
|
29464
|
+
function getRange(inputDates) {
|
|
29465
|
+
const [start, stop] = inputDates.map(parseDate).toSorted((a, b) => adapter.isAfter(a, b) ? 1 : -1);
|
|
29466
|
+
const diff = adapter.getDiff(stop ?? start, start, 'days');
|
|
29467
|
+
return [start, ...createRange(diff, 1).map(i => adapter.addDays(start, i))];
|
|
29228
29468
|
}
|
|
29229
29469
|
useRender(() => {
|
|
29230
29470
|
const confirmEditProps = VConfirmEdit.filterProps(props);
|
|
29231
29471
|
const datePickerProps = VDatePicker.filterProps(omit(props, ['active', 'location', 'rounded']));
|
|
29232
|
-
const textFieldProps = VTextField.filterProps(props);
|
|
29472
|
+
const textFieldProps = VTextField.filterProps(omit(props, ['placeholder']));
|
|
29233
29473
|
return vue.createVNode(VTextField, vue.mergeProps({
|
|
29234
29474
|
"ref": vTextFieldRef
|
|
29235
29475
|
}, textFieldProps, {
|
|
@@ -29237,11 +29477,13 @@
|
|
|
29237
29477
|
"style": props.style,
|
|
29238
29478
|
"modelValue": display.value,
|
|
29239
29479
|
"inputmode": inputmode.value,
|
|
29480
|
+
"placeholder": props.placeholder ?? parserFormat.value,
|
|
29240
29481
|
"readonly": isReadonly.value,
|
|
29241
29482
|
"onKeydown": isInteractive.value ? onKeydown : undefined,
|
|
29242
29483
|
"focused": menu.value || isFocused.value,
|
|
29243
29484
|
"onFocus": focus,
|
|
29244
29485
|
"onBlur": onBlur,
|
|
29486
|
+
"validationValue": model.value,
|
|
29245
29487
|
"onClick:control": isInteractive.value ? onClick : undefined,
|
|
29246
29488
|
"onClick:prepend": isInteractive.value ? onClick : undefined,
|
|
29247
29489
|
"onUpdate:modelValue": onUpdateDisplayModel
|
|
@@ -31208,6 +31450,7 @@
|
|
|
31208
31450
|
VClassIcon: VClassIcon,
|
|
31209
31451
|
VCode: VCode,
|
|
31210
31452
|
VCol: VCol,
|
|
31453
|
+
VColorInput: VColorInput,
|
|
31211
31454
|
VColorPicker: VColorPicker,
|
|
31212
31455
|
VCombobox: VCombobox,
|
|
31213
31456
|
VComponentIcon: VComponentIcon,
|
|
@@ -31674,7 +31917,7 @@
|
|
|
31674
31917
|
};
|
|
31675
31918
|
});
|
|
31676
31919
|
}
|
|
31677
|
-
const version$1 = "3.8.
|
|
31920
|
+
const version$1 = "3.8.6";
|
|
31678
31921
|
createVuetify$1.version = version$1;
|
|
31679
31922
|
|
|
31680
31923
|
// Vue's inject() can only be used in setup
|
|
@@ -31972,7 +32215,7 @@
|
|
|
31972
32215
|
|
|
31973
32216
|
/* eslint-disable local-rules/sort-imports */
|
|
31974
32217
|
|
|
31975
|
-
const version = "3.8.
|
|
32218
|
+
const version = "3.8.6";
|
|
31976
32219
|
|
|
31977
32220
|
/* eslint-disable local-rules/sort-imports */
|
|
31978
32221
|
|