@vuetify/nightly 4.0.0-dev-20230419.0 → 4.0.0-dev-20230421.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -2
- package/dist/json/attributes.json +172 -108
- package/dist/json/importMap.json +34 -34
- package/dist/json/tags.json +16 -0
- package/dist/json/web-types.json +522 -220
- package/dist/vuetify-labs.css +293 -130
- package/dist/vuetify-labs.d.ts +620 -171
- package/dist/vuetify-labs.esm.js +867 -186
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +867 -185
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +166 -3
- package/dist/vuetify.d.ts +577 -160
- package/dist/vuetify.esm.js +809 -138
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +809 -137
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +802 -736
- package/dist/vuetify.min.js.map +1 -1
- package/lib/adapters/date-adapter.mjs +2 -0
- package/lib/adapters/date-adapter.mjs.map +1 -0
- package/lib/adapters/vuetify.mjs +399 -0
- package/lib/adapters/vuetify.mjs.map +1 -0
- package/lib/blueprints/index.d.ts +34 -0
- package/lib/blueprints/md1.d.ts +34 -0
- package/lib/blueprints/md2.d.ts +34 -0
- package/lib/blueprints/md3.d.ts +34 -0
- package/lib/components/VAppBar/VAppBar.mjs +62 -10
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.ts +26 -0
- package/lib/components/VAutocomplete/VAutocomplete.css +9 -0
- package/lib/components/VAutocomplete/VAutocomplete.mjs +50 -6
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +10 -0
- package/lib/components/VAutocomplete/index.d.ts +29 -17
- package/lib/components/VBtn/_mixins.scss +1 -1
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/index.d.ts +21 -16
- package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.ts +22 -1
- package/lib/components/VCombobox/VCombobox.css +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +6 -4
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +1 -1
- package/lib/components/VCombobox/index.d.ts +29 -17
- package/lib/components/VField/index.d.ts +6 -0
- package/lib/components/VFileInput/VFileInput.mjs +13 -17
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/index.d.ts +68 -23
- package/lib/components/VInput/VInput.mjs +14 -7
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.ts +22 -1
- package/lib/components/VOverlay/locationStrategies.mjs +9 -4
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.ts +22 -1
- package/lib/components/VRangeSlider/VRangeSlider.mjs +33 -22
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.d.ts +39 -6
- package/lib/components/VSelect/VSelect.mjs +6 -0
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.ts +32 -17
- package/lib/components/VSlider/VSlider.mjs +33 -15
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/index.d.ts +39 -6
- package/lib/components/VSlider/slider.mjs +47 -24
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.mjs +5 -3
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.ts +43 -1
- package/lib/components/VTextField/VTextField.mjs +4 -12
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/index.d.ts +70 -22
- package/lib/components/VTextarea/VTextarea.mjs +4 -12
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/index.d.ts +61 -22
- package/lib/components/VToolbar/VToolbar.css +3 -1
- package/lib/components/VToolbar/VToolbar.sass +3 -1
- package/lib/components/VValidation/index.d.ts +10 -1
- package/lib/components/index.d.ts +525 -150
- package/lib/composables/date.mjs +39 -0
- package/lib/composables/date.mjs.map +1 -0
- package/lib/composables/focus.mjs +3 -2
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/index.mjs +1 -0
- package/lib/composables/index.mjs.map +1 -1
- package/lib/composables/items.mjs +7 -2
- package/lib/composables/items.mjs.map +1 -1
- package/lib/composables/scroll.mjs +3 -0
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +8 -3
- package/lib/framework.mjs.map +1 -1
- package/lib/iconsets/mdi-svg.mjs +2 -2
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/index.d.ts +52 -10
- package/lib/labs/VDataTable/VDataTable.mjs +2 -2
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableFooter.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableHeaders.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableRows.mjs +52 -44
- package/lib/labs/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs +2 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +0 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/options.mjs +2 -1
- package/lib/labs/VDataTable/composables/options.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.ts +44 -11
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs +1 -0
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/index.d.ts +9 -9
- package/lib/labs/components.d.ts +53 -20
- package/lib/styles/main.css +152 -0
- package/lib/styles/settings/_utilities.scss +11 -1
- package/lib/util/helpers.mjs +4 -0
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +2 -2
package/dist/vuetify.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Vuetify v4.0.0-dev-
|
2
|
+
* Vuetify v4.0.0-dev-20230421.0
|
3
3
|
* Forged by John Leider
|
4
4
|
* Released under the MIT License.
|
5
5
|
*/
|
@@ -207,10 +207,6 @@
|
|
207
207
|
let max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
208
208
|
return Math.max(min, Math.min(max, value));
|
209
209
|
}
|
210
|
-
function getDecimals(value) {
|
211
|
-
const trimmedStr = value.toString().trim();
|
212
|
-
return trimmedStr.includes('.') ? trimmedStr.length - trimmedStr.indexOf('.') - 1 : 0;
|
213
|
-
}
|
214
210
|
function padEnd(str, length) {
|
215
211
|
let char = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';
|
216
212
|
return str + char.repeat(Math.max(0, length - str.length));
|
@@ -3253,6 +3249,98 @@
|
|
3253
3249
|
|
3254
3250
|
// Utilities
|
3255
3251
|
|
3252
|
+
// Types
|
3253
|
+
|
3254
|
+
// Composables
|
3255
|
+
const makeScrollProps = propsFactory({
|
3256
|
+
scrollTarget: {
|
3257
|
+
type: String
|
3258
|
+
},
|
3259
|
+
scrollThreshold: {
|
3260
|
+
type: [String, Number]
|
3261
|
+
}
|
3262
|
+
}, 'scroll');
|
3263
|
+
function useScroll(props) {
|
3264
|
+
let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
3265
|
+
const {
|
3266
|
+
thresholdMetCallback,
|
3267
|
+
scrollThreshold,
|
3268
|
+
canScroll
|
3269
|
+
} = args;
|
3270
|
+
let previousScroll = 0;
|
3271
|
+
const target = vue.ref(null);
|
3272
|
+
const currentScroll = vue.ref(0);
|
3273
|
+
const savedScroll = vue.ref(0);
|
3274
|
+
const currentThreshold = vue.ref(0);
|
3275
|
+
const isScrollActive = vue.ref(false);
|
3276
|
+
const isScrollingUp = vue.ref(false);
|
3277
|
+
const computedScrollThreshold = vue.computed(() => {
|
3278
|
+
return Number(props.scrollThreshold ?? scrollThreshold ?? 300);
|
3279
|
+
});
|
3280
|
+
const onScroll = () => {
|
3281
|
+
const targetEl = target.value;
|
3282
|
+
if (!targetEl || canScroll && !canScroll.value) return;
|
3283
|
+
previousScroll = currentScroll.value;
|
3284
|
+
currentScroll.value = 'window' in targetEl ? targetEl.pageYOffset : targetEl.scrollTop;
|
3285
|
+
isScrollingUp.value = currentScroll.value < previousScroll;
|
3286
|
+
currentThreshold.value = Math.abs(currentScroll.value - computedScrollThreshold.value);
|
3287
|
+
};
|
3288
|
+
vue.watch(isScrollingUp, () => {
|
3289
|
+
savedScroll.value = savedScroll.value || currentScroll.value;
|
3290
|
+
});
|
3291
|
+
vue.watch(isScrollActive, () => {
|
3292
|
+
savedScroll.value = 0;
|
3293
|
+
});
|
3294
|
+
vue.onMounted(() => {
|
3295
|
+
vue.watch(() => props.scrollTarget, scrollTarget => {
|
3296
|
+
const newTarget = scrollTarget ? document.querySelector(scrollTarget) : window;
|
3297
|
+
if (!newTarget) {
|
3298
|
+
consoleWarn(`Unable to locate element with identifier ${scrollTarget}`, vue.getCurrentInstance());
|
3299
|
+
return;
|
3300
|
+
}
|
3301
|
+
if (newTarget === target.value) return;
|
3302
|
+
target.value?.removeEventListener('scroll', onScroll);
|
3303
|
+
target.value = newTarget;
|
3304
|
+
target.value.addEventListener('scroll', onScroll, {
|
3305
|
+
passive: true
|
3306
|
+
});
|
3307
|
+
}, {
|
3308
|
+
immediate: true
|
3309
|
+
});
|
3310
|
+
});
|
3311
|
+
vue.onBeforeUnmount(() => {
|
3312
|
+
target.value?.removeEventListener('scroll', onScroll);
|
3313
|
+
});
|
3314
|
+
thresholdMetCallback && vue.watch(() => Math.abs(currentScroll.value - savedScroll.value) > computedScrollThreshold.value, thresholdMet => {
|
3315
|
+
thresholdMet && thresholdMetCallback({
|
3316
|
+
currentThreshold: currentThreshold.value,
|
3317
|
+
isScrollingUp: isScrollingUp.value,
|
3318
|
+
savedScroll
|
3319
|
+
});
|
3320
|
+
}, {
|
3321
|
+
immediate: true
|
3322
|
+
});
|
3323
|
+
|
3324
|
+
// Do we need this? If yes - seems that
|
3325
|
+
// there's no need to expose onScroll
|
3326
|
+
canScroll && vue.watch(canScroll, onScroll, {
|
3327
|
+
immediate: true
|
3328
|
+
});
|
3329
|
+
return {
|
3330
|
+
computedScrollThreshold,
|
3331
|
+
currentScroll,
|
3332
|
+
currentThreshold,
|
3333
|
+
isScrollActive,
|
3334
|
+
// required only for testing
|
3335
|
+
// probably can be removed
|
3336
|
+
// later (2 chars chlng)
|
3337
|
+
isScrollingUp,
|
3338
|
+
savedScroll
|
3339
|
+
};
|
3340
|
+
}
|
3341
|
+
|
3342
|
+
// Utilities
|
3343
|
+
|
3256
3344
|
// Composables
|
3257
3345
|
function useSsrBoot() {
|
3258
3346
|
const isBooted = vue.ref(false);
|
@@ -3275,13 +3363,7 @@
|
|
3275
3363
|
const VAppBar = genericComponent()({
|
3276
3364
|
name: 'VAppBar',
|
3277
3365
|
props: {
|
3278
|
-
|
3279
|
-
// hideOnScroll: Boolean
|
3280
|
-
// invertedScroll: Boolean
|
3281
|
-
// collapseOnScroll: Boolean
|
3282
|
-
// elevateOnScroll: Boolean
|
3283
|
-
// shrinkOnScroll: Boolean
|
3284
|
-
// fadeImageOnScroll: Boolean
|
3366
|
+
scrollBehavior: String,
|
3285
3367
|
modelValue: {
|
3286
3368
|
type: Boolean,
|
3287
3369
|
default: true
|
@@ -3293,6 +3375,7 @@
|
|
3293
3375
|
},
|
3294
3376
|
...makeVToolbarProps(),
|
3295
3377
|
...makeLayoutItemProps(),
|
3378
|
+
...makeScrollProps(),
|
3296
3379
|
height: {
|
3297
3380
|
type: [Number, String],
|
3298
3381
|
default: 64
|
@@ -3307,11 +3390,63 @@
|
|
3307
3390
|
} = _ref;
|
3308
3391
|
const vToolbarRef = vue.ref();
|
3309
3392
|
const isActive = useProxiedModel(props, 'modelValue');
|
3393
|
+
const scrollBehavior = vue.computed(() => {
|
3394
|
+
const behavior = new Set(props.scrollBehavior?.split(' ') ?? []);
|
3395
|
+
return {
|
3396
|
+
hide: behavior.has('hide'),
|
3397
|
+
// fullyHide: behavior.has('fully-hide'),
|
3398
|
+
inverted: behavior.has('inverted'),
|
3399
|
+
collapse: behavior.has('collapse'),
|
3400
|
+
elevate: behavior.has('elevate'),
|
3401
|
+
fadeImage: behavior.has('fade-image')
|
3402
|
+
// shrink: behavior.has('shrink'),
|
3403
|
+
};
|
3404
|
+
});
|
3405
|
+
|
3406
|
+
const canScroll = vue.computed(() => {
|
3407
|
+
const behavior = scrollBehavior.value;
|
3408
|
+
return behavior.hide ||
|
3409
|
+
// behavior.fullyHide ||
|
3410
|
+
behavior.inverted || behavior.collapse || behavior.elevate || behavior.fadeImage ||
|
3411
|
+
// behavior.shrink ||
|
3412
|
+
!isActive.value;
|
3413
|
+
});
|
3414
|
+
const {
|
3415
|
+
currentScroll,
|
3416
|
+
currentThreshold,
|
3417
|
+
computedScrollThreshold,
|
3418
|
+
isScrollingUp
|
3419
|
+
} = useScroll(props, {
|
3420
|
+
canScroll
|
3421
|
+
});
|
3422
|
+
const isCollapsed = vue.computed(() => props.collapse || scrollBehavior.value.collapse && (scrollBehavior.value.inverted ? currentScroll.value < 1 : currentScroll.value > 0));
|
3423
|
+
const isFlat = vue.computed(() => props.flat || scrollBehavior.value.elevate && currentScroll.value === (scrollBehavior.value.inverted ? 1 : 0));
|
3424
|
+
const scrollRatio = vue.computed(() => Math.min((currentThreshold.value - currentScroll.value) / currentThreshold.value || 1, 1));
|
3425
|
+
const opacity = vue.computed(() => scrollBehavior.value.fadeImage ? scrollBehavior.value.inverted ? 1 - scrollRatio.value : scrollRatio.value : undefined);
|
3310
3426
|
const height = vue.computed(() => {
|
3427
|
+
if (scrollBehavior.value.hide && scrollBehavior.value.inverted) return 0;
|
3311
3428
|
const height = vToolbarRef.value?.contentHeight ?? 0;
|
3312
3429
|
const extensionHeight = vToolbarRef.value?.extensionHeight ?? 0;
|
3313
3430
|
return height + extensionHeight;
|
3314
3431
|
});
|
3432
|
+
function setActive() {
|
3433
|
+
const val = currentScroll.value;
|
3434
|
+
if (scrollBehavior.value.hide) {
|
3435
|
+
if (scrollBehavior.value.inverted) {
|
3436
|
+
isActive.value = val > computedScrollThreshold.value;
|
3437
|
+
} else {
|
3438
|
+
isActive.value = isScrollingUp.value || val < computedScrollThreshold.value;
|
3439
|
+
}
|
3440
|
+
} else if (scrollBehavior.value.inverted) {
|
3441
|
+
isActive.value = currentScroll.value === 0;
|
3442
|
+
} else {
|
3443
|
+
isActive.value = true;
|
3444
|
+
}
|
3445
|
+
}
|
3446
|
+
vue.watch(currentScroll, setActive, {
|
3447
|
+
immediate: true
|
3448
|
+
});
|
3449
|
+
vue.watch(scrollBehavior, setActive);
|
3315
3450
|
const {
|
3316
3451
|
ssrBootStyles
|
3317
3452
|
} = useSsrBoot();
|
@@ -3322,7 +3457,7 @@
|
|
3322
3457
|
order: vue.computed(() => parseInt(props.order, 10)),
|
3323
3458
|
position: vue.toRef(props, 'location'),
|
3324
3459
|
layoutSize: height,
|
3325
|
-
elementSize:
|
3460
|
+
elementSize: vue.ref(undefined),
|
3326
3461
|
active: isActive,
|
3327
3462
|
absolute: vue.toRef(props, 'absolute')
|
3328
3463
|
});
|
@@ -3335,10 +3470,14 @@
|
|
3335
3470
|
}],
|
3336
3471
|
"style": {
|
3337
3472
|
...layoutItemStyles.value,
|
3473
|
+
'--v-toolbar-image-opacity': opacity.value,
|
3338
3474
|
height: undefined,
|
3339
3475
|
...ssrBootStyles.value
|
3340
3476
|
}
|
3341
|
-
}, toolbarProps
|
3477
|
+
}, toolbarProps, {
|
3478
|
+
"collapse": isCollapsed.value,
|
3479
|
+
"flat": isFlat.value
|
3480
|
+
}), slots);
|
3342
3481
|
});
|
3343
3482
|
return {};
|
3344
3483
|
}
|
@@ -5296,7 +5435,8 @@
|
|
5296
5435
|
|
5297
5436
|
// Composables
|
5298
5437
|
const makeFocusProps = propsFactory({
|
5299
|
-
focused: Boolean
|
5438
|
+
focused: Boolean,
|
5439
|
+
'onUpdate:focused': EventProp()
|
5300
5440
|
}, 'focus');
|
5301
5441
|
function useFocus(props) {
|
5302
5442
|
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstanceName();
|
@@ -5891,6 +6031,8 @@
|
|
5891
6031
|
appendIcon: IconValue,
|
5892
6032
|
prependIcon: IconValue,
|
5893
6033
|
hideDetails: [Boolean, String],
|
6034
|
+
hint: String,
|
6035
|
+
persistentHint: Boolean,
|
5894
6036
|
messages: {
|
5895
6037
|
type: [Array, String],
|
5896
6038
|
default: () => []
|
@@ -5954,10 +6096,19 @@
|
|
5954
6096
|
resetValidation,
|
5955
6097
|
validate
|
5956
6098
|
}));
|
6099
|
+
const messages = vue.computed(() => {
|
6100
|
+
if (errorMessages.value.length > 0) {
|
6101
|
+
return errorMessages.value;
|
6102
|
+
} else if (props.hint && (props.persistentHint || props.focused)) {
|
6103
|
+
return props.hint;
|
6104
|
+
} else {
|
6105
|
+
return props.messages;
|
6106
|
+
}
|
6107
|
+
});
|
5957
6108
|
useRender(() => {
|
5958
6109
|
const hasPrepend = !!(slots.prepend || props.prependIcon);
|
5959
6110
|
const hasAppend = !!(slots.append || props.appendIcon);
|
5960
|
-
const hasMessages =
|
6111
|
+
const hasMessages = messages.value.length > 0;
|
5961
6112
|
const hasDetails = !props.hideDetails || props.hideDetails === 'auto' && (hasMessages || !!slots.details);
|
5962
6113
|
return vue.createVNode("div", {
|
5963
6114
|
"class": ['v-input', `v-input--${props.direction}`, densityClasses.value, validationClasses.value]
|
@@ -5980,7 +6131,7 @@
|
|
5980
6131
|
}, [vue.createVNode(VMessages, {
|
5981
6132
|
"id": messagesId.value,
|
5982
6133
|
"active": hasMessages,
|
5983
|
-
"messages":
|
6134
|
+
"messages": messages.value
|
5984
6135
|
}, {
|
5985
6136
|
message: slots.message
|
5986
6137
|
}), slots.details?.(slotProps.value)])]);
|
@@ -5992,10 +6143,6 @@
|
|
5992
6143
|
};
|
5993
6144
|
}
|
5994
6145
|
});
|
5995
|
-
function filterInputProps(props) {
|
5996
|
-
const keys = Object.keys(VInput.props).filter(k => !isOn(k));
|
5997
|
-
return pick(props, keys);
|
5998
|
-
}
|
5999
6146
|
|
6000
6147
|
const VCounter = genericComponent()({
|
6001
6148
|
name: 'VCounter',
|
@@ -6121,8 +6268,6 @@
|
|
6121
6268
|
autofocus: Boolean,
|
6122
6269
|
counter: [Boolean, Number, String],
|
6123
6270
|
counterValue: Function,
|
6124
|
-
hint: String,
|
6125
|
-
persistentHint: Boolean,
|
6126
6271
|
prefix: String,
|
6127
6272
|
placeholder: String,
|
6128
6273
|
persistentPlaceholder: Boolean,
|
@@ -6177,9 +6322,6 @@
|
|
6177
6322
|
const vFieldRef = vue.ref();
|
6178
6323
|
const inputRef = vue.ref();
|
6179
6324
|
const isActive = vue.computed(() => activeTypes.includes(props.type) || props.persistentPlaceholder || isFocused.value);
|
6180
|
-
const messages = vue.computed(() => {
|
6181
|
-
return props.messages.length ? props.messages : isFocused.value || props.persistentHint ? props.hint : '';
|
6182
|
-
});
|
6183
6325
|
function onFocus() {
|
6184
6326
|
if (inputRef.value !== document.activeElement) {
|
6185
6327
|
inputRef.value?.focus();
|
@@ -6222,7 +6364,7 @@
|
|
6222
6364
|
const [{
|
6223
6365
|
modelValue: _,
|
6224
6366
|
...inputProps
|
6225
|
-
}] =
|
6367
|
+
}] = VInput.filterProps(props);
|
6226
6368
|
const [fieldProps] = filterFieldProps(props);
|
6227
6369
|
return vue.createVNode(VInput, vue.mergeProps({
|
6228
6370
|
"ref": vInputRef,
|
@@ -6232,12 +6374,9 @@
|
|
6232
6374
|
'v-text-field--prefixed': props.prefix,
|
6233
6375
|
'v-text-field--suffixed': props.suffix,
|
6234
6376
|
'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant)
|
6235
|
-
}]
|
6236
|
-
"onClick:prepend": props['onClick:prepend'],
|
6237
|
-
"onClick:append": props['onClick:append']
|
6377
|
+
}]
|
6238
6378
|
}, rootAttrs, inputProps, {
|
6239
|
-
"focused": isFocused.value
|
6240
|
-
"messages": messages.value
|
6379
|
+
"focused": isFocused.value
|
6241
6380
|
}), {
|
6242
6381
|
...slots,
|
6243
6382
|
default: _ref2 => {
|
@@ -6646,7 +6785,7 @@
|
|
6646
6785
|
const id = vue.computed(() => props.id || `checkbox-${uid}`);
|
6647
6786
|
useRender(() => {
|
6648
6787
|
const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
|
6649
|
-
const [inputProps, _1] =
|
6788
|
+
const [inputProps, _1] = VInput.filterProps(props);
|
6650
6789
|
const [checkboxProps, _2] = VCheckboxBtn.filterProps(props);
|
6651
6790
|
return vue.createVNode(VInput, vue.mergeProps({
|
6652
6791
|
"class": "v-checkbox"
|
@@ -8058,7 +8197,12 @@
|
|
8058
8197
|
function useItems(props) {
|
8059
8198
|
const items = vue.computed(() => transformItems$1(props, props.items));
|
8060
8199
|
function transformIn(value) {
|
8061
|
-
return value.map(
|
8200
|
+
return value.map(v => {
|
8201
|
+
const existingItem = items.value.find(item => deepEqual(v, item.value));
|
8202
|
+
// Nullish existingItem means value is a custom input value from combobox
|
8203
|
+
// In this case, use transformItem to create an InternalItem based on value
|
8204
|
+
return existingItem ?? transformItem$1(props, v);
|
8205
|
+
});
|
8062
8206
|
}
|
8063
8207
|
function transformOut(value) {
|
8064
8208
|
return value.map(_ref => {
|
@@ -8736,7 +8880,7 @@
|
|
8736
8880
|
}
|
8737
8881
|
|
8738
8882
|
/** Get size of element ignoring max-width/max-height */
|
8739
|
-
function getIntrinsicSize(el) {
|
8883
|
+
function getIntrinsicSize(el, isRtl) {
|
8740
8884
|
// const scrollables = new Map<Element, [number, number]>()
|
8741
8885
|
// el.querySelectorAll('*').forEach(el => {
|
8742
8886
|
// const x = el.scrollLeft
|
@@ -8753,7 +8897,11 @@
|
|
8753
8897
|
|
8754
8898
|
/* eslint-disable-next-line sonarjs/prefer-immediate-return */
|
8755
8899
|
const contentBox = nullifyTransforms(el);
|
8756
|
-
|
8900
|
+
if (isRtl) {
|
8901
|
+
contentBox.x += parseFloat(el.style.right || 0);
|
8902
|
+
} else {
|
8903
|
+
contentBox.x -= parseFloat(el.style.left || 0);
|
8904
|
+
}
|
8757
8905
|
contentBox.y -= parseFloat(el.style.top || 0);
|
8758
8906
|
|
8759
8907
|
// el.style.maxWidth = initialMaxWidth
|
@@ -8834,7 +8982,7 @@
|
|
8834
8982
|
});
|
8835
8983
|
if (!data.activatorEl.value || !data.contentEl.value) return;
|
8836
8984
|
const targetBox = data.activatorEl.value.getBoundingClientRect();
|
8837
|
-
const contentBox = getIntrinsicSize(data.contentEl.value);
|
8985
|
+
const contentBox = getIntrinsicSize(data.contentEl.value, data.isRtl.value);
|
8838
8986
|
const scrollParents = getScrollParents(data.contentEl.value);
|
8839
8987
|
const viewportMargin = 12;
|
8840
8988
|
if (!scrollParents.length) {
|
@@ -9010,7 +9158,8 @@
|
|
9010
9158
|
transformOrigin: `${placement.origin.side} ${placement.origin.align}`,
|
9011
9159
|
// transform: `translate(${pixelRound(x)}px, ${pixelRound(y)}px)`,
|
9012
9160
|
top: convertToUnit(pixelRound(y)),
|
9013
|
-
left: convertToUnit(pixelRound(x)),
|
9161
|
+
left: data.isRtl.value ? undefined : convertToUnit(pixelRound(x)),
|
9162
|
+
right: data.isRtl.value ? convertToUnit(pixelRound(-x)) : undefined,
|
9014
9163
|
minWidth: convertToUnit(axis === 'y' ? Math.min(minWidth.value, targetBox.width) : minWidth.value),
|
9015
9164
|
maxWidth: convertToUnit(pixelCeil(clamp(available.x, minWidth.value === Infinity ? 0 : minWidth.value, maxWidth.value))),
|
9016
9165
|
maxHeight: convertToUnit(pixelCeil(clamp(available.y, minHeight.value === Infinity ? 0 : minHeight.value, maxHeight.value)))
|
@@ -9905,6 +10054,7 @@
|
|
9905
10054
|
})
|
9906
10055
|
},
|
9907
10056
|
emits: {
|
10057
|
+
'update:focused': focused => true,
|
9908
10058
|
'update:modelValue': val => true,
|
9909
10059
|
'update:menu': val => true
|
9910
10060
|
},
|
@@ -10021,6 +10171,9 @@
|
|
10021
10171
|
menu.value = false;
|
10022
10172
|
}
|
10023
10173
|
}
|
10174
|
+
function onFocusin(e) {
|
10175
|
+
isFocused.value = true;
|
10176
|
+
}
|
10024
10177
|
function onFocusout(e) {
|
10025
10178
|
if (e.relatedTarget == null) {
|
10026
10179
|
vTextFieldRef.value?.focus();
|
@@ -10075,6 +10228,7 @@
|
|
10075
10228
|
"selected": selected.value,
|
10076
10229
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
10077
10230
|
"onMousedown": e => e.preventDefault(),
|
10231
|
+
"onFocusin": onFocusin,
|
10078
10232
|
"onFocusout": onFocusout
|
10079
10233
|
}, {
|
10080
10234
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
@@ -10153,6 +10307,7 @@
|
|
10153
10307
|
});
|
10154
10308
|
});
|
10155
10309
|
return forwardRefs({
|
10310
|
+
isFocused,
|
10156
10311
|
menu,
|
10157
10312
|
select
|
10158
10313
|
}, vTextFieldRef);
|
@@ -10291,6 +10446,7 @@
|
|
10291
10446
|
})
|
10292
10447
|
},
|
10293
10448
|
emits: {
|
10449
|
+
'update:focused': focused => true,
|
10294
10450
|
'update:search': val => true,
|
10295
10451
|
'update:modelValue': val => true,
|
10296
10452
|
'update:menu': val => true
|
@@ -10314,11 +10470,17 @@
|
|
10314
10470
|
_menu.value = v;
|
10315
10471
|
}
|
10316
10472
|
});
|
10473
|
+
const selectionIndex = vue.ref(-1);
|
10474
|
+
const color = vue.computed(() => vTextFieldRef.value?.color);
|
10317
10475
|
const {
|
10318
10476
|
items,
|
10319
10477
|
transformIn,
|
10320
10478
|
transformOut
|
10321
10479
|
} = useItems(props);
|
10480
|
+
const {
|
10481
|
+
textColorClasses,
|
10482
|
+
textColorStyles
|
10483
|
+
} = useTextColor(color);
|
10322
10484
|
const search = useProxiedModel(props, 'search', '');
|
10323
10485
|
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
|
10324
10486
|
const transformed = transformOut(v);
|
@@ -10341,6 +10503,7 @@
|
|
10341
10503
|
return filteredItems.value;
|
10342
10504
|
});
|
10343
10505
|
const selected = vue.computed(() => selections.value.map(selection => selection.props.value));
|
10506
|
+
const selection = vue.computed(() => selections.value[selectionIndex.value]);
|
10344
10507
|
const listRef = vue.ref();
|
10345
10508
|
function onClear(e) {
|
10346
10509
|
if (props.openOnClear) {
|
@@ -10354,7 +10517,9 @@
|
|
10354
10517
|
}
|
10355
10518
|
function onKeydown(e) {
|
10356
10519
|
if (props.readonly || form?.isReadonly.value) return;
|
10357
|
-
|
10520
|
+
const selectionStart = vTextFieldRef.value.selectionStart;
|
10521
|
+
const length = selected.value.length;
|
10522
|
+
if (selectionIndex.value > -1 || ['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
10358
10523
|
e.preventDefault();
|
10359
10524
|
}
|
10360
10525
|
if (['Enter', 'ArrowDown'].includes(e.key)) {
|
@@ -10371,6 +10536,38 @@
|
|
10371
10536
|
} else if (e.key === 'ArrowUp') {
|
10372
10537
|
listRef.value?.focus('prev');
|
10373
10538
|
}
|
10539
|
+
if (!props.multiple) return;
|
10540
|
+
if (['Backspace', 'Delete'].includes(e.key)) {
|
10541
|
+
if (selectionIndex.value < 0) {
|
10542
|
+
if (e.key === 'Backspace' && !search.value) {
|
10543
|
+
selectionIndex.value = length - 1;
|
10544
|
+
}
|
10545
|
+
return;
|
10546
|
+
}
|
10547
|
+
const originalSelectionIndex = selectionIndex.value;
|
10548
|
+
if (selection.value) select(selection.value);
|
10549
|
+
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
10550
|
+
}
|
10551
|
+
if (e.key === 'ArrowLeft') {
|
10552
|
+
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
10553
|
+
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
10554
|
+
if (selections.value[prev]) {
|
10555
|
+
selectionIndex.value = prev;
|
10556
|
+
} else {
|
10557
|
+
selectionIndex.value = -1;
|
10558
|
+
vTextFieldRef.value.setSelectionRange(search.value?.length, search.value?.length);
|
10559
|
+
}
|
10560
|
+
}
|
10561
|
+
if (e.key === 'ArrowRight') {
|
10562
|
+
if (selectionIndex.value < 0) return;
|
10563
|
+
const next = selectionIndex.value + 1;
|
10564
|
+
if (selections.value[next]) {
|
10565
|
+
selectionIndex.value = next;
|
10566
|
+
} else {
|
10567
|
+
selectionIndex.value = -1;
|
10568
|
+
vTextFieldRef.value.setSelectionRange(0, 0);
|
10569
|
+
}
|
10570
|
+
}
|
10374
10571
|
}
|
10375
10572
|
function onInput(e) {
|
10376
10573
|
search.value = e.target.value;
|
@@ -10392,7 +10589,6 @@
|
|
10392
10589
|
const index = selected.value.findIndex(selection => props.valueComparator(selection, item.value));
|
10393
10590
|
if (index === -1) {
|
10394
10591
|
model.value = [...model.value, item];
|
10395
|
-
search.value = '';
|
10396
10592
|
} else {
|
10397
10593
|
const value = [...model.value];
|
10398
10594
|
value.splice(index, 1);
|
@@ -10437,12 +10633,15 @@
|
|
10437
10633
|
"onUpdate:modelValue": v => {
|
10438
10634
|
if (v == null) model.value = [];
|
10439
10635
|
},
|
10636
|
+
"focused": isFocused.value,
|
10637
|
+
"onUpdate:focused": $event => isFocused.value = $event,
|
10440
10638
|
"validationValue": model.externalValue,
|
10441
10639
|
"dirty": isDirty,
|
10442
10640
|
"onInput": onInput,
|
10443
10641
|
"class": ['v-autocomplete', {
|
10444
10642
|
'v-autocomplete--active-menu': menu.value,
|
10445
10643
|
'v-autocomplete--chips': !!props.chips,
|
10644
|
+
'v-autocomplete--selecting-index': selectionIndex.value > -1,
|
10446
10645
|
[`v-autocomplete--${props.multiple ? 'multiple' : 'single'}`]: true,
|
10447
10646
|
'v-autocomplete--selection-slot': !!slots.selection
|
10448
10647
|
}],
|
@@ -10451,8 +10650,6 @@
|
|
10451
10650
|
"placeholder": isDirty ? undefined : props.placeholder,
|
10452
10651
|
"onClick:clear": onClear,
|
10453
10652
|
"onMousedown:control": onMousedownControl,
|
10454
|
-
"onFocus": () => isFocused.value = true,
|
10455
|
-
"onBlur": () => isFocused.value = false,
|
10456
10653
|
"onKeydown": onKeydown
|
10457
10654
|
}), {
|
10458
10655
|
...slots,
|
@@ -10517,7 +10714,8 @@
|
|
10517
10714
|
};
|
10518
10715
|
return vue.createVNode("div", {
|
10519
10716
|
"key": item.value,
|
10520
|
-
"class":
|
10717
|
+
"class": ['v-autocomplete__selection', index === selectionIndex.value && ['v-autocomplete__selection--selected', textColorClasses.value]],
|
10718
|
+
"style": index === selectionIndex.value ? textColorStyles.value : {}
|
10521
10719
|
}, [hasChips ? !slots.chip ? vue.createVNode(VChip, vue.mergeProps({
|
10522
10720
|
"key": "chip",
|
10523
10721
|
"closable": props.closableChips,
|
@@ -12412,11 +12610,36 @@
|
|
12412
12610
|
elevation: 2
|
12413
12611
|
})
|
12414
12612
|
}, 'slider');
|
12613
|
+
const useSteps = props => {
|
12614
|
+
const min = vue.computed(() => parseFloat(props.min));
|
12615
|
+
const max = vue.computed(() => parseFloat(props.max));
|
12616
|
+
const step = vue.computed(() => +props.step > 0 ? parseFloat(props.step) : 0);
|
12617
|
+
const decimals = vue.computed(() => {
|
12618
|
+
const trimmedStep = step.value.toString().trim();
|
12619
|
+
return trimmedStep.includes('.') ? trimmedStep.length - trimmedStep.indexOf('.') - 1 : 0;
|
12620
|
+
});
|
12621
|
+
function roundValue(value) {
|
12622
|
+
if (step.value <= 0) return value;
|
12623
|
+
const clamped = clamp(value, min.value, max.value);
|
12624
|
+
const offset = min.value % step.value;
|
12625
|
+
const newValue = Math.round((clamped - offset) / step.value) * step.value + offset;
|
12626
|
+
return parseFloat(Math.min(newValue, max.value).toFixed(decimals.value));
|
12627
|
+
}
|
12628
|
+
return {
|
12629
|
+
min,
|
12630
|
+
max,
|
12631
|
+
step,
|
12632
|
+
decimals,
|
12633
|
+
roundValue
|
12634
|
+
};
|
12635
|
+
};
|
12415
12636
|
const useSlider = _ref => {
|
12416
12637
|
let {
|
12417
12638
|
props,
|
12418
|
-
|
12419
|
-
|
12639
|
+
steps,
|
12640
|
+
onSliderStart,
|
12641
|
+
onSliderMove,
|
12642
|
+
onSliderEnd,
|
12420
12643
|
getActiveThumb
|
12421
12644
|
} = _ref;
|
12422
12645
|
const {
|
@@ -12430,10 +12653,13 @@
|
|
12430
12653
|
}
|
12431
12654
|
return hd;
|
12432
12655
|
});
|
12433
|
-
const
|
12434
|
-
|
12435
|
-
|
12436
|
-
|
12656
|
+
const {
|
12657
|
+
min,
|
12658
|
+
max,
|
12659
|
+
step,
|
12660
|
+
decimals,
|
12661
|
+
roundValue
|
12662
|
+
} = steps;
|
12437
12663
|
const thumbSize = vue.computed(() => parseInt(props.thumbSize, 10));
|
12438
12664
|
const tickSize = vue.computed(() => parseInt(props.tickSize, 10));
|
12439
12665
|
const trackSize = vue.computed(() => parseInt(props.trackSize, 10));
|
@@ -12447,13 +12673,6 @@
|
|
12447
12673
|
const startOffset = vue.ref(0);
|
12448
12674
|
const trackContainerRef = vue.ref();
|
12449
12675
|
const activeThumbRef = vue.ref();
|
12450
|
-
function roundValue(value) {
|
12451
|
-
if (step.value <= 0) return value;
|
12452
|
-
const clamped = clamp(value, min.value, max.value);
|
12453
|
-
const offset = min.value % step.value;
|
12454
|
-
const newValue = Math.round((clamped - offset) / step.value) * step.value + offset;
|
12455
|
-
return parseFloat(Math.min(newValue, max.value).toFixed(decimals.value));
|
12456
|
-
}
|
12457
12676
|
function parseMouseMove(e) {
|
12458
12677
|
const vertical = props.direction === 'vertical';
|
12459
12678
|
const start = vertical ? 'top' : 'left';
|
@@ -12470,14 +12689,11 @@
|
|
12470
12689
|
if (vertical || horizontalDirection.value === 'rtl') clickPos = 1 - clickPos;
|
12471
12690
|
return roundValue(min.value + clickPos * (max.value - min.value));
|
12472
12691
|
}
|
12473
|
-
let thumbMoved = false;
|
12474
12692
|
const handleStop = e => {
|
12475
|
-
|
12476
|
-
|
12477
|
-
|
12478
|
-
}
|
12693
|
+
onSliderEnd({
|
12694
|
+
value: parseMouseMove(e)
|
12695
|
+
});
|
12479
12696
|
mousePressed.value = false;
|
12480
|
-
thumbMoved = false;
|
12481
12697
|
startOffset.value = 0;
|
12482
12698
|
};
|
12483
12699
|
const handleStart = e => {
|
@@ -12486,20 +12702,25 @@
|
|
12486
12702
|
activeThumbRef.value.focus();
|
12487
12703
|
mousePressed.value = true;
|
12488
12704
|
if (activeThumbRef.value.contains(e.target)) {
|
12489
|
-
thumbMoved = true;
|
12490
12705
|
startOffset.value = getOffset(e, activeThumbRef.value, props.direction);
|
12491
12706
|
} else {
|
12492
12707
|
startOffset.value = 0;
|
12493
|
-
|
12708
|
+
onSliderMove({
|
12709
|
+
value: parseMouseMove(e)
|
12710
|
+
});
|
12494
12711
|
}
|
12712
|
+
onSliderStart({
|
12713
|
+
value: parseMouseMove(e)
|
12714
|
+
});
|
12495
12715
|
};
|
12496
12716
|
const moveListenerOptions = {
|
12497
12717
|
passive: true,
|
12498
12718
|
capture: true
|
12499
12719
|
};
|
12500
12720
|
function onMouseMove(e) {
|
12501
|
-
|
12502
|
-
|
12721
|
+
onSliderMove({
|
12722
|
+
value: parseMouseMove(e)
|
12723
|
+
});
|
12503
12724
|
}
|
12504
12725
|
function onSliderMouseUp(e) {
|
12505
12726
|
e.stopPropagation();
|
@@ -12875,13 +13096,21 @@
|
|
12875
13096
|
},
|
12876
13097
|
emits: {
|
12877
13098
|
'update:focused': value => true,
|
12878
|
-
'update:modelValue': v => true
|
13099
|
+
'update:modelValue': v => true,
|
13100
|
+
start: value => true,
|
13101
|
+
end: value => true
|
12879
13102
|
},
|
12880
13103
|
setup(props, _ref) {
|
12881
13104
|
let {
|
12882
|
-
slots
|
13105
|
+
slots,
|
13106
|
+
emit
|
12883
13107
|
} = _ref;
|
12884
13108
|
const thumbContainerRef = vue.ref();
|
13109
|
+
const steps = useSteps(props);
|
13110
|
+
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
13111
|
+
const value = typeof v === 'string' ? parseFloat(v) : v == null ? steps.min.value : v;
|
13112
|
+
return steps.roundValue(value);
|
13113
|
+
});
|
12885
13114
|
const {
|
12886
13115
|
min,
|
12887
13116
|
max,
|
@@ -12895,16 +13124,26 @@
|
|
12895
13124
|
readonly
|
12896
13125
|
} = useSlider({
|
12897
13126
|
props,
|
12898
|
-
|
12899
|
-
|
12900
|
-
|
12901
|
-
|
13127
|
+
steps,
|
13128
|
+
onSliderStart: () => {
|
13129
|
+
emit('start', model.value);
|
13130
|
+
},
|
13131
|
+
onSliderEnd: _ref2 => {
|
13132
|
+
let {
|
13133
|
+
value
|
13134
|
+
} = _ref2;
|
13135
|
+
const roundedValue = roundValue(value);
|
13136
|
+
model.value = roundedValue;
|
13137
|
+
emit('end', roundedValue);
|
13138
|
+
},
|
13139
|
+
onSliderMove: _ref3 => {
|
13140
|
+
let {
|
13141
|
+
value
|
13142
|
+
} = _ref3;
|
13143
|
+
return model.value = roundValue(value);
|
13144
|
+
},
|
12902
13145
|
getActiveThumb: () => thumbContainerRef.value?.$el
|
12903
13146
|
});
|
12904
|
-
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
12905
|
-
const value = typeof v === 'string' ? parseFloat(v) : v == null ? min.value : v;
|
12906
|
-
return roundValue(value);
|
12907
|
-
});
|
12908
13147
|
const {
|
12909
13148
|
isFocused,
|
12910
13149
|
focus,
|
@@ -12912,7 +13151,7 @@
|
|
12912
13151
|
} = useFocus(props);
|
12913
13152
|
const trackStop = vue.computed(() => position(model.value));
|
12914
13153
|
useRender(() => {
|
12915
|
-
const [inputProps, _] =
|
13154
|
+
const [inputProps, _] = VInput.filterProps(props);
|
12916
13155
|
const hasPrepend = !!(props.label || slots.label || slots.prepend);
|
12917
13156
|
return vue.createVNode(VInput, vue.mergeProps({
|
12918
13157
|
"class": ['v-slider', {
|
@@ -12930,11 +13169,11 @@
|
|
12930
13169
|
"class": "v-slider__label",
|
12931
13170
|
"text": props.label
|
12932
13171
|
}, null) : undefined, slots.prepend?.(slotProps)]) : undefined,
|
12933
|
-
default:
|
13172
|
+
default: _ref4 => {
|
12934
13173
|
let {
|
12935
13174
|
id,
|
12936
13175
|
messagesId
|
12937
|
-
} =
|
13176
|
+
} = _ref4;
|
12938
13177
|
return vue.createVNode("div", {
|
12939
13178
|
"class": "v-slider__container",
|
12940
13179
|
"onMousedown": !readonly.value ? onSliderMousedown : undefined,
|
@@ -13576,6 +13815,7 @@
|
|
13576
13815
|
})
|
13577
13816
|
},
|
13578
13817
|
emits: {
|
13818
|
+
'update:focused': focused => true,
|
13579
13819
|
'update:modelValue': val => true,
|
13580
13820
|
'update:search': val => true,
|
13581
13821
|
'update:menu': val => true
|
@@ -13713,8 +13953,9 @@
|
|
13713
13953
|
}
|
13714
13954
|
return;
|
13715
13955
|
}
|
13716
|
-
|
13717
|
-
|
13956
|
+
const originalSelectionIndex = selectionIndex.value;
|
13957
|
+
if (selection.value) select(selection.value);
|
13958
|
+
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
13718
13959
|
}
|
13719
13960
|
if (e.key === 'ArrowLeft') {
|
13720
13961
|
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
@@ -13799,6 +14040,8 @@
|
|
13799
14040
|
"onUpdate:modelValue": [$event => search.value = $event, v => {
|
13800
14041
|
if (v == null) model.value = [];
|
13801
14042
|
}],
|
14043
|
+
"focused": isFocused.value,
|
14044
|
+
"onUpdate:focused": $event => isFocused.value = $event,
|
13802
14045
|
"validationValue": model.externalValue,
|
13803
14046
|
"dirty": isDirty,
|
13804
14047
|
"class": ['v-combobox', {
|
@@ -13812,8 +14055,6 @@
|
|
13812
14055
|
"placeholder": isDirty ? undefined : props.placeholder,
|
13813
14056
|
"onClick:clear": onClear,
|
13814
14057
|
"onMousedown:control": onMousedownControl,
|
13815
|
-
"onFocus": () => isFocused.value = true,
|
13816
|
-
"onBlur": () => isFocused.value = false,
|
13817
14058
|
"onKeydown": onKeydown
|
13818
14059
|
}), {
|
13819
14060
|
...slots,
|
@@ -14265,8 +14506,6 @@
|
|
14265
14506
|
default: '$vuetify.fileInput.counter'
|
14266
14507
|
},
|
14267
14508
|
multiple: Boolean,
|
14268
|
-
hint: String,
|
14269
|
-
persistentHint: Boolean,
|
14270
14509
|
showSize: {
|
14271
14510
|
type: [Boolean, Number],
|
14272
14511
|
default: false,
|
@@ -14291,6 +14530,7 @@
|
|
14291
14530
|
emits: {
|
14292
14531
|
'click:control': e => true,
|
14293
14532
|
'mousedown:control': e => true,
|
14533
|
+
'update:focused': focused => true,
|
14294
14534
|
'update:modelValue': files => true
|
14295
14535
|
},
|
14296
14536
|
setup(props, _ref) {
|
@@ -14303,6 +14543,11 @@
|
|
14303
14543
|
t
|
14304
14544
|
} = useLocale();
|
14305
14545
|
const model = useProxiedModel(props, 'modelValue');
|
14546
|
+
const {
|
14547
|
+
isFocused,
|
14548
|
+
focus,
|
14549
|
+
blur
|
14550
|
+
} = useFocus(props);
|
14306
14551
|
const base = vue.computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined);
|
14307
14552
|
const totalBytes = vue.computed(() => (model.value ?? []).reduce((bytes, _ref2) => {
|
14308
14553
|
let {
|
@@ -14324,21 +14569,14 @@
|
|
14324
14569
|
});
|
14325
14570
|
const vInputRef = vue.ref();
|
14326
14571
|
const vFieldRef = vue.ref();
|
14327
|
-
const isFocused = vue.ref(false);
|
14328
14572
|
const inputRef = vue.ref();
|
14329
|
-
const messages = vue.computed(() => {
|
14330
|
-
return props.messages.length ? props.messages : props.persistentHint ? props.hint : '';
|
14331
|
-
});
|
14332
14573
|
function onFocus() {
|
14333
14574
|
if (inputRef.value !== document.activeElement) {
|
14334
14575
|
inputRef.value?.focus();
|
14335
14576
|
}
|
14336
|
-
if (!isFocused.value)
|
14337
|
-
isFocused.value = true;
|
14338
|
-
}
|
14577
|
+
if (!isFocused.value) focus();
|
14339
14578
|
}
|
14340
14579
|
function onClickPrepend(e) {
|
14341
|
-
callEvent(props['onClick:prepend'], e);
|
14342
14580
|
onControlClick(e);
|
14343
14581
|
}
|
14344
14582
|
function onControlMousedown(e) {
|
@@ -14369,18 +14607,16 @@
|
|
14369
14607
|
const [{
|
14370
14608
|
modelValue: _,
|
14371
14609
|
...inputProps
|
14372
|
-
}] =
|
14610
|
+
}] = VInput.filterProps(props);
|
14373
14611
|
const [fieldProps] = filterFieldProps(props);
|
14374
14612
|
return vue.createVNode(VInput, vue.mergeProps({
|
14375
14613
|
"ref": vInputRef,
|
14376
14614
|
"modelValue": model.value,
|
14377
14615
|
"onUpdate:modelValue": $event => model.value = $event,
|
14378
14616
|
"class": "v-file-input",
|
14379
|
-
"onClick:prepend": onClickPrepend
|
14380
|
-
"onClick:append": props['onClick:append']
|
14617
|
+
"onClick:prepend": onClickPrepend
|
14381
14618
|
}, rootAttrs, inputProps, {
|
14382
|
-
"focused": isFocused.value
|
14383
|
-
"messages": messages.value
|
14619
|
+
"focused": isFocused.value
|
14384
14620
|
}), {
|
14385
14621
|
...slots,
|
14386
14622
|
default: _ref3 => {
|
@@ -14432,7 +14668,7 @@
|
|
14432
14668
|
model.value = [...(target.files ?? [])];
|
14433
14669
|
},
|
14434
14670
|
"onFocus": onFocus,
|
14435
|
-
"onBlur":
|
14671
|
+
"onBlur": blur
|
14436
14672
|
}, slotProps, inputAttrs), null), vue.createVNode("div", {
|
14437
14673
|
"class": fieldClass
|
14438
14674
|
}, [!!model.value?.length && (slots.selection ? slots.selection({
|
@@ -15123,6 +15359,432 @@
|
|
15123
15359
|
}
|
15124
15360
|
});
|
15125
15361
|
|
15362
|
+
// Utilities
|
15363
|
+
|
15364
|
+
// Types
|
15365
|
+
|
15366
|
+
function getWeekArray(date) {
|
15367
|
+
let currentWeek = [];
|
15368
|
+
const weeks = [];
|
15369
|
+
const firstDayOfMonth = startOfMonth(date);
|
15370
|
+
const lastDayOfMonth = endOfMonth(date);
|
15371
|
+
for (let i = 0; i < firstDayOfMonth.getDay(); i++) {
|
15372
|
+
currentWeek.push(null);
|
15373
|
+
}
|
15374
|
+
for (let i = 1; i <= lastDayOfMonth.getDate(); i++) {
|
15375
|
+
const day = new Date(date.getFullYear(), date.getMonth(), i);
|
15376
|
+
|
15377
|
+
// Add the day to the current week
|
15378
|
+
currentWeek.push(day);
|
15379
|
+
|
15380
|
+
// If the current week has 7 days, add it to the weeks array and start a new week
|
15381
|
+
if (currentWeek.length === 7) {
|
15382
|
+
weeks.push(currentWeek);
|
15383
|
+
currentWeek = [];
|
15384
|
+
}
|
15385
|
+
}
|
15386
|
+
for (let i = currentWeek.length; i < 7; i++) {
|
15387
|
+
currentWeek.push(null);
|
15388
|
+
}
|
15389
|
+
weeks.push(currentWeek);
|
15390
|
+
return weeks;
|
15391
|
+
}
|
15392
|
+
function startOfMonth(date) {
|
15393
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
15394
|
+
}
|
15395
|
+
function endOfMonth(date) {
|
15396
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
15397
|
+
}
|
15398
|
+
function date(value) {
|
15399
|
+
if (value == null) return null;
|
15400
|
+
if (value instanceof Date) return value;
|
15401
|
+
if (typeof value === 'string') {
|
15402
|
+
const parsed = Date.parse(value);
|
15403
|
+
if (!isNaN(parsed)) return new Date(parsed);
|
15404
|
+
}
|
15405
|
+
return null;
|
15406
|
+
}
|
15407
|
+
const firstDay = {
|
15408
|
+
'001': 1,
|
15409
|
+
AD: 1,
|
15410
|
+
AE: 6,
|
15411
|
+
AF: 6,
|
15412
|
+
AG: 0,
|
15413
|
+
AI: 1,
|
15414
|
+
AL: 1,
|
15415
|
+
AM: 1,
|
15416
|
+
AN: 1,
|
15417
|
+
AR: 1,
|
15418
|
+
AS: 0,
|
15419
|
+
AT: 1,
|
15420
|
+
AU: 0,
|
15421
|
+
AX: 1,
|
15422
|
+
AZ: 1,
|
15423
|
+
BA: 1,
|
15424
|
+
BD: 0,
|
15425
|
+
BE: 1,
|
15426
|
+
BG: 1,
|
15427
|
+
BH: 6,
|
15428
|
+
BM: 1,
|
15429
|
+
BN: 1,
|
15430
|
+
BR: 0,
|
15431
|
+
BS: 0,
|
15432
|
+
BT: 0,
|
15433
|
+
BW: 0,
|
15434
|
+
BY: 1,
|
15435
|
+
BZ: 0,
|
15436
|
+
CA: 0,
|
15437
|
+
CH: 1,
|
15438
|
+
CL: 1,
|
15439
|
+
CM: 1,
|
15440
|
+
CN: 0,
|
15441
|
+
CO: 0,
|
15442
|
+
CR: 1,
|
15443
|
+
CY: 1,
|
15444
|
+
CZ: 1,
|
15445
|
+
DE: 1,
|
15446
|
+
DJ: 6,
|
15447
|
+
DK: 1,
|
15448
|
+
DM: 0,
|
15449
|
+
DO: 0,
|
15450
|
+
DZ: 6,
|
15451
|
+
EC: 1,
|
15452
|
+
EE: 1,
|
15453
|
+
EG: 6,
|
15454
|
+
ES: 1,
|
15455
|
+
ET: 0,
|
15456
|
+
FI: 1,
|
15457
|
+
FJ: 1,
|
15458
|
+
FO: 1,
|
15459
|
+
FR: 1,
|
15460
|
+
GB: 1,
|
15461
|
+
'GB-alt-variant': 0,
|
15462
|
+
GE: 1,
|
15463
|
+
GF: 1,
|
15464
|
+
GP: 1,
|
15465
|
+
GR: 1,
|
15466
|
+
GT: 0,
|
15467
|
+
GU: 0,
|
15468
|
+
HK: 0,
|
15469
|
+
HN: 0,
|
15470
|
+
HR: 1,
|
15471
|
+
HU: 1,
|
15472
|
+
ID: 0,
|
15473
|
+
IE: 1,
|
15474
|
+
IL: 0,
|
15475
|
+
IN: 0,
|
15476
|
+
IQ: 6,
|
15477
|
+
IR: 6,
|
15478
|
+
IS: 1,
|
15479
|
+
IT: 1,
|
15480
|
+
JM: 0,
|
15481
|
+
JO: 6,
|
15482
|
+
JP: 0,
|
15483
|
+
KE: 0,
|
15484
|
+
KG: 1,
|
15485
|
+
KH: 0,
|
15486
|
+
KR: 0,
|
15487
|
+
KW: 6,
|
15488
|
+
KZ: 1,
|
15489
|
+
LA: 0,
|
15490
|
+
LB: 1,
|
15491
|
+
LI: 1,
|
15492
|
+
LK: 1,
|
15493
|
+
LT: 1,
|
15494
|
+
LU: 1,
|
15495
|
+
LV: 1,
|
15496
|
+
LY: 6,
|
15497
|
+
MC: 1,
|
15498
|
+
MD: 1,
|
15499
|
+
ME: 1,
|
15500
|
+
MH: 0,
|
15501
|
+
MK: 1,
|
15502
|
+
MM: 0,
|
15503
|
+
MN: 1,
|
15504
|
+
MO: 0,
|
15505
|
+
MQ: 1,
|
15506
|
+
MT: 0,
|
15507
|
+
MV: 5,
|
15508
|
+
MX: 0,
|
15509
|
+
MY: 1,
|
15510
|
+
MZ: 0,
|
15511
|
+
NI: 0,
|
15512
|
+
NL: 1,
|
15513
|
+
NO: 1,
|
15514
|
+
NP: 0,
|
15515
|
+
NZ: 1,
|
15516
|
+
OM: 6,
|
15517
|
+
PA: 0,
|
15518
|
+
PE: 0,
|
15519
|
+
PH: 0,
|
15520
|
+
PK: 0,
|
15521
|
+
PL: 1,
|
15522
|
+
PR: 0,
|
15523
|
+
PT: 0,
|
15524
|
+
PY: 0,
|
15525
|
+
QA: 6,
|
15526
|
+
RE: 1,
|
15527
|
+
RO: 1,
|
15528
|
+
RS: 1,
|
15529
|
+
RU: 1,
|
15530
|
+
SA: 0,
|
15531
|
+
SD: 6,
|
15532
|
+
SE: 1,
|
15533
|
+
SG: 0,
|
15534
|
+
SI: 1,
|
15535
|
+
SK: 1,
|
15536
|
+
SM: 1,
|
15537
|
+
SV: 0,
|
15538
|
+
SY: 6,
|
15539
|
+
TH: 0,
|
15540
|
+
TJ: 1,
|
15541
|
+
TM: 1,
|
15542
|
+
TR: 1,
|
15543
|
+
TT: 0,
|
15544
|
+
TW: 0,
|
15545
|
+
UA: 1,
|
15546
|
+
UM: 0,
|
15547
|
+
US: 0,
|
15548
|
+
UY: 1,
|
15549
|
+
UZ: 1,
|
15550
|
+
VA: 1,
|
15551
|
+
VE: 0,
|
15552
|
+
VI: 0,
|
15553
|
+
VN: 1,
|
15554
|
+
WS: 0,
|
15555
|
+
XK: 1,
|
15556
|
+
YE: 0,
|
15557
|
+
ZA: 0,
|
15558
|
+
ZW: 0
|
15559
|
+
};
|
15560
|
+
const sundayJanuarySecond2000 = new Date(2000, 0, 2);
|
15561
|
+
function getWeekdays(locale) {
|
15562
|
+
const daysFromSunday = firstDay[locale.slice(-2).toUpperCase()];
|
15563
|
+
return createRange(7).map(i => {
|
15564
|
+
const weekday = new Date(sundayJanuarySecond2000);
|
15565
|
+
weekday.setDate(sundayJanuarySecond2000.getDate() + daysFromSunday + i);
|
15566
|
+
return new Intl.DateTimeFormat(locale, {
|
15567
|
+
weekday: 'long'
|
15568
|
+
}).format(weekday);
|
15569
|
+
});
|
15570
|
+
}
|
15571
|
+
function format(value, formatString, locale) {
|
15572
|
+
const date = new Date(value);
|
15573
|
+
let options = {};
|
15574
|
+
switch (formatString) {
|
15575
|
+
case 'fullDateWithWeekday':
|
15576
|
+
options = {
|
15577
|
+
weekday: 'long',
|
15578
|
+
day: 'numeric',
|
15579
|
+
month: 'long',
|
15580
|
+
year: 'numeric'
|
15581
|
+
};
|
15582
|
+
break;
|
15583
|
+
case 'normalDateWithWeekday':
|
15584
|
+
options = {
|
15585
|
+
weekday: 'short',
|
15586
|
+
day: 'numeric',
|
15587
|
+
month: 'short',
|
15588
|
+
year: 'numeric'
|
15589
|
+
};
|
15590
|
+
break;
|
15591
|
+
case 'keyboardDate':
|
15592
|
+
options = {};
|
15593
|
+
break;
|
15594
|
+
case 'monthAndDate':
|
15595
|
+
options = {
|
15596
|
+
month: 'long',
|
15597
|
+
day: 'numeric'
|
15598
|
+
};
|
15599
|
+
break;
|
15600
|
+
case 'monthAndYear':
|
15601
|
+
options = {
|
15602
|
+
month: 'long',
|
15603
|
+
year: 'numeric'
|
15604
|
+
};
|
15605
|
+
break;
|
15606
|
+
default:
|
15607
|
+
options = {
|
15608
|
+
timeZone: 'UTC',
|
15609
|
+
timeZoneName: 'short'
|
15610
|
+
};
|
15611
|
+
}
|
15612
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
15613
|
+
}
|
15614
|
+
function addDays(date, amount) {
|
15615
|
+
const d = new Date(date);
|
15616
|
+
d.setDate(d.getDate() + amount);
|
15617
|
+
return d;
|
15618
|
+
}
|
15619
|
+
function addMonths(date, amount) {
|
15620
|
+
const d = new Date(date);
|
15621
|
+
d.setMonth(d.getMonth() + amount);
|
15622
|
+
return d;
|
15623
|
+
}
|
15624
|
+
function getYear(date) {
|
15625
|
+
return date.getFullYear();
|
15626
|
+
}
|
15627
|
+
function getMonth(date) {
|
15628
|
+
return date.getMonth();
|
15629
|
+
}
|
15630
|
+
function startOfYear(date) {
|
15631
|
+
return new Date(date.getFullYear(), 0, 1);
|
15632
|
+
}
|
15633
|
+
function endOfYear(date) {
|
15634
|
+
return new Date(date.getFullYear(), 11, 31);
|
15635
|
+
}
|
15636
|
+
function getMondayOfFirstWeekOfYear(year) {
|
15637
|
+
return new Date(year, 0, 1);
|
15638
|
+
}
|
15639
|
+
|
15640
|
+
// https://stackoverflow.com/questions/274861/how-do-i-calculate-the-week-number-given-a-date/275024#275024
|
15641
|
+
function getWeek(date) {
|
15642
|
+
let year = date.getFullYear();
|
15643
|
+
let d1w1 = getMondayOfFirstWeekOfYear(year);
|
15644
|
+
if (date < d1w1) {
|
15645
|
+
year = year - 1;
|
15646
|
+
d1w1 = getMondayOfFirstWeekOfYear(year);
|
15647
|
+
} else {
|
15648
|
+
const tv = getMondayOfFirstWeekOfYear(year + 1);
|
15649
|
+
if (date >= tv) {
|
15650
|
+
year = year + 1;
|
15651
|
+
d1w1 = tv;
|
15652
|
+
}
|
15653
|
+
}
|
15654
|
+
const diffTime = Math.abs(date.getTime() - d1w1.getTime());
|
15655
|
+
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
15656
|
+
return Math.floor(diffDays / 7) + 1;
|
15657
|
+
}
|
15658
|
+
function isWithinRange(date, range) {
|
15659
|
+
return isAfter(date, range[0]) && isBefore(date, range[1]);
|
15660
|
+
}
|
15661
|
+
function isValid(date) {
|
15662
|
+
const d = new Date(date);
|
15663
|
+
return d instanceof Date && !isNaN(d.getTime());
|
15664
|
+
}
|
15665
|
+
function isAfter(date, comparing) {
|
15666
|
+
return date.getTime() > comparing.getTime();
|
15667
|
+
}
|
15668
|
+
function isBefore(date, comparing) {
|
15669
|
+
return date.getTime() < comparing.getTime();
|
15670
|
+
}
|
15671
|
+
function isEqual(date, comparing) {
|
15672
|
+
return date.getTime() === comparing.getTime();
|
15673
|
+
}
|
15674
|
+
function isSameDay(date, comparing) {
|
15675
|
+
return date.getDate() === comparing.getDate() && date.getMonth() === comparing.getMonth() && date.getFullYear() === comparing.getFullYear();
|
15676
|
+
}
|
15677
|
+
function isSameMonth(date, comparing) {
|
15678
|
+
return date.getMonth() === comparing.getMonth() && date.getFullYear() === comparing.getFullYear();
|
15679
|
+
}
|
15680
|
+
function getDiff(date, comparing, unit) {
|
15681
|
+
const d = new Date(date);
|
15682
|
+
const c = new Date(comparing);
|
15683
|
+
if (unit === 'month') {
|
15684
|
+
return d.getMonth() - c.getMonth() + (d.getFullYear() - c.getFullYear()) * 12;
|
15685
|
+
}
|
15686
|
+
return Math.floor((d.getTime() - c.getTime()) / (1000 * 60 * 60 * 24));
|
15687
|
+
}
|
15688
|
+
function setYear(date, year) {
|
15689
|
+
const d = new Date(date);
|
15690
|
+
d.setFullYear(year);
|
15691
|
+
return d;
|
15692
|
+
}
|
15693
|
+
class VuetifyDateAdapter {
|
15694
|
+
constructor() {
|
15695
|
+
let locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
|
15696
|
+
this.locale = locale;
|
15697
|
+
}
|
15698
|
+
date(value) {
|
15699
|
+
return date(value);
|
15700
|
+
}
|
15701
|
+
addDays(date, amount) {
|
15702
|
+
return addDays(date, amount);
|
15703
|
+
}
|
15704
|
+
addMonths(date, amount) {
|
15705
|
+
return addMonths(date, amount);
|
15706
|
+
}
|
15707
|
+
getWeekArray(date) {
|
15708
|
+
return getWeekArray(date);
|
15709
|
+
}
|
15710
|
+
startOfMonth(date) {
|
15711
|
+
return startOfMonth(date);
|
15712
|
+
}
|
15713
|
+
endOfMonth(date) {
|
15714
|
+
return endOfMonth(date);
|
15715
|
+
}
|
15716
|
+
format(date, formatString) {
|
15717
|
+
return format(date, formatString, this.locale);
|
15718
|
+
}
|
15719
|
+
isEqual(date, comparing) {
|
15720
|
+
return isEqual(date, comparing);
|
15721
|
+
}
|
15722
|
+
isValid(date) {
|
15723
|
+
return isValid(date);
|
15724
|
+
}
|
15725
|
+
isWithinRange(date, range) {
|
15726
|
+
return isWithinRange(date, range);
|
15727
|
+
}
|
15728
|
+
isAfter(date, comparing) {
|
15729
|
+
return isAfter(date, comparing);
|
15730
|
+
}
|
15731
|
+
isSameDay(date, comparing) {
|
15732
|
+
return isSameDay(date, comparing);
|
15733
|
+
}
|
15734
|
+
isSameMonth(date, comparing) {
|
15735
|
+
return isSameMonth(date, comparing);
|
15736
|
+
}
|
15737
|
+
setYear(date, year) {
|
15738
|
+
return setYear(date, year);
|
15739
|
+
}
|
15740
|
+
getDiff(date, comparing, unit) {
|
15741
|
+
return getDiff(date, comparing, unit);
|
15742
|
+
}
|
15743
|
+
getWeek(date) {
|
15744
|
+
return getWeek(date);
|
15745
|
+
}
|
15746
|
+
getWeekdays() {
|
15747
|
+
return getWeekdays(this.locale);
|
15748
|
+
}
|
15749
|
+
getYear(date) {
|
15750
|
+
return getYear(date);
|
15751
|
+
}
|
15752
|
+
getMonth(date) {
|
15753
|
+
return getMonth(date);
|
15754
|
+
}
|
15755
|
+
startOfYear(date) {
|
15756
|
+
return startOfYear(date);
|
15757
|
+
}
|
15758
|
+
endOfYear(date) {
|
15759
|
+
return endOfYear(date);
|
15760
|
+
}
|
15761
|
+
}
|
15762
|
+
|
15763
|
+
// Composables
|
15764
|
+
|
15765
|
+
// Types
|
15766
|
+
|
15767
|
+
const DateAdapterSymbol = Symbol.for('vuetify:date-adapter');
|
15768
|
+
function createDate(options) {
|
15769
|
+
return options ?? {
|
15770
|
+
adapter: VuetifyDateAdapter
|
15771
|
+
};
|
15772
|
+
}
|
15773
|
+
function useDate(props) {
|
15774
|
+
const date = vue.inject(DateAdapterSymbol);
|
15775
|
+
const locale = useLocale();
|
15776
|
+
if (!date) throw new Error('[Vuetify] Could not find injected date');
|
15777
|
+
|
15778
|
+
// eslint-disable-next-line new-cap
|
15779
|
+
const instance = new date.adapter(locale.current.value);
|
15780
|
+
vue.watch(locale.current, val => {
|
15781
|
+
instance.locale = val;
|
15782
|
+
}, {
|
15783
|
+
immediate: true
|
15784
|
+
});
|
15785
|
+
return instance;
|
15786
|
+
}
|
15787
|
+
|
15126
15788
|
function useSticky(_ref) {
|
15127
15789
|
let {
|
15128
15790
|
rootEl,
|
@@ -16127,7 +16789,7 @@
|
|
16127
16789
|
const model = useProxiedModel(props, 'modelValue');
|
16128
16790
|
useRender(() => {
|
16129
16791
|
const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
|
16130
|
-
const [inputProps, _1] =
|
16792
|
+
const [inputProps, _1] = VInput.filterProps(props);
|
16131
16793
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
16132
16794
|
const label = slots.label ? slots.label({
|
16133
16795
|
label: props.label,
|
@@ -16192,11 +16854,14 @@
|
|
16192
16854
|
},
|
16193
16855
|
emits: {
|
16194
16856
|
'update:focused': value => true,
|
16195
|
-
'update:modelValue': value => true
|
16857
|
+
'update:modelValue': value => true,
|
16858
|
+
end: value => true,
|
16859
|
+
start: value => true
|
16196
16860
|
},
|
16197
16861
|
setup(props, _ref) {
|
16198
16862
|
let {
|
16199
|
-
slots
|
16863
|
+
slots,
|
16864
|
+
emit
|
16200
16865
|
} = _ref;
|
16201
16866
|
const startThumbRef = vue.ref();
|
16202
16867
|
const stopThumbRef = vue.ref();
|
@@ -16209,6 +16874,11 @@
|
|
16209
16874
|
const b = Math.abs(stopOffset);
|
16210
16875
|
return a < b || a === b && startOffset < 0 ? startThumbRef.value.$el : stopThumbRef.value.$el;
|
16211
16876
|
}
|
16877
|
+
const steps = useSteps(props);
|
16878
|
+
const model = useProxiedModel(props, 'modelValue', undefined, arr => {
|
16879
|
+
if (!arr?.length) return [0, 0];
|
16880
|
+
return arr.map(value => steps.roundValue(value));
|
16881
|
+
});
|
16212
16882
|
const {
|
16213
16883
|
activeThumbRef,
|
16214
16884
|
hasLabels,
|
@@ -16218,34 +16888,37 @@
|
|
16218
16888
|
onSliderMousedown,
|
16219
16889
|
onSliderTouchstart,
|
16220
16890
|
position,
|
16221
|
-
roundValue,
|
16222
16891
|
trackContainerRef
|
16223
16892
|
} = useSlider({
|
16224
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
16225
16893
|
props,
|
16226
|
-
|
16227
|
-
|
16894
|
+
steps,
|
16895
|
+
onSliderStart: () => {
|
16896
|
+
emit('start', model.value);
|
16228
16897
|
},
|
16229
|
-
|
16898
|
+
onSliderEnd: _ref2 => {
|
16899
|
+
let {
|
16900
|
+
value
|
16901
|
+
} = _ref2;
|
16902
|
+
const newValue = activeThumbRef.value === startThumbRef.value?.$el ? [value, model.value[1]] : [model.value[0], value];
|
16903
|
+
model.value = newValue;
|
16904
|
+
emit('end', newValue);
|
16905
|
+
},
|
16906
|
+
onSliderMove: _ref3 => {
|
16907
|
+
let {
|
16908
|
+
value
|
16909
|
+
} = _ref3;
|
16230
16910
|
const [start, stop] = model.value;
|
16231
16911
|
if (!props.strict && start === stop && start !== min.value) {
|
16232
|
-
activeThumbRef.value =
|
16912
|
+
activeThumbRef.value = value > start ? stopThumbRef.value?.$el : startThumbRef.value?.$el;
|
16233
16913
|
activeThumbRef.value?.focus();
|
16234
16914
|
}
|
16235
16915
|
if (activeThumbRef.value === startThumbRef.value?.$el) {
|
16236
|
-
model.value = [Math.min(
|
16916
|
+
model.value = [Math.min(value, stop), stop];
|
16237
16917
|
} else {
|
16238
|
-
model.value = [start, Math.max(start,
|
16918
|
+
model.value = [start, Math.max(start, value)];
|
16239
16919
|
}
|
16240
16920
|
},
|
16241
16921
|
getActiveThumb
|
16242
|
-
/* eslint-enable @typescript-eslint/no-use-before-define */
|
16243
|
-
});
|
16244
|
-
|
16245
|
-
const model = useProxiedModel(props, 'modelValue', undefined, arr => {
|
16246
|
-
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
16247
|
-
if (!arr || !arr.length) return [0, 0];
|
16248
|
-
return arr.map(value => roundValue(value));
|
16249
16922
|
});
|
16250
16923
|
const {
|
16251
16924
|
isFocused,
|
@@ -16255,7 +16928,7 @@
|
|
16255
16928
|
const trackStart = vue.computed(() => position(model.value[0]));
|
16256
16929
|
const trackStop = vue.computed(() => position(model.value[1]));
|
16257
16930
|
useRender(() => {
|
16258
|
-
const [inputProps, _] =
|
16931
|
+
const [inputProps, _] = VInput.filterProps(props);
|
16259
16932
|
const hasPrepend = !!(props.label || slots.label || slots.prepend);
|
16260
16933
|
return vue.createVNode(VInput, vue.mergeProps({
|
16261
16934
|
"class": ['v-slider', 'v-range-slider', {
|
@@ -16273,11 +16946,11 @@
|
|
16273
16946
|
"class": "v-slider__label",
|
16274
16947
|
"text": props.label
|
16275
16948
|
}, null) : undefined, slots.prepend?.(slotProps)]) : undefined,
|
16276
|
-
default:
|
16949
|
+
default: _ref4 => {
|
16277
16950
|
let {
|
16278
16951
|
id,
|
16279
16952
|
messagesId
|
16280
|
-
} =
|
16953
|
+
} = _ref4;
|
16281
16954
|
return vue.createVNode("div", {
|
16282
16955
|
"class": "v-slider__container",
|
16283
16956
|
"onMousedown": onSliderMousedown,
|
@@ -17100,10 +17773,12 @@
|
|
17100
17773
|
}
|
17101
17774
|
useRender(() => {
|
17102
17775
|
const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
|
17103
|
-
const [inputProps, _1] =
|
17776
|
+
const [inputProps, _1] = VInput.filterProps(props);
|
17104
17777
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
17105
17778
|
const control = vue.ref();
|
17106
|
-
function onClick() {
|
17779
|
+
function onClick(e) {
|
17780
|
+
e.stopPropagation();
|
17781
|
+
e.preventDefault();
|
17107
17782
|
control.value?.input?.click();
|
17108
17783
|
}
|
17109
17784
|
return vue.createVNode(VInput, vue.mergeProps({
|
@@ -17464,8 +18139,6 @@
|
|
17464
18139
|
autofocus: Boolean,
|
17465
18140
|
counter: [Boolean, Number, String],
|
17466
18141
|
counterValue: Function,
|
17467
|
-
hint: String,
|
17468
|
-
persistentHint: Boolean,
|
17469
18142
|
prefix: String,
|
17470
18143
|
placeholder: String,
|
17471
18144
|
persistentPlaceholder: Boolean,
|
@@ -17520,9 +18193,6 @@
|
|
17520
18193
|
const controlHeight = vue.ref('');
|
17521
18194
|
const textareaRef = vue.ref();
|
17522
18195
|
const isActive = vue.computed(() => isFocused.value || props.persistentPlaceholder);
|
17523
|
-
const messages = vue.computed(() => {
|
17524
|
-
return props.messages.length ? props.messages : isFocused.value || props.persistentHint ? props.hint : '';
|
17525
|
-
});
|
17526
18196
|
function onFocus() {
|
17527
18197
|
if (textareaRef.value !== document.activeElement) {
|
17528
18198
|
textareaRef.value?.focus();
|
@@ -17594,7 +18264,7 @@
|
|
17594
18264
|
const [{
|
17595
18265
|
modelValue: _,
|
17596
18266
|
...inputProps
|
17597
|
-
}] =
|
18267
|
+
}] = VInput.filterProps(props);
|
17598
18268
|
const [fieldProps] = filterFieldProps(props);
|
17599
18269
|
return vue.createVNode(VInput, vue.mergeProps({
|
17600
18270
|
"ref": vInputRef,
|
@@ -17608,12 +18278,9 @@
|
|
17608
18278
|
'v-textarea--auto-grow': props.autoGrow,
|
17609
18279
|
'v-textarea--no-resize': props.noResize || props.autoGrow,
|
17610
18280
|
'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant)
|
17611
|
-
}]
|
17612
|
-
"onClick:prepend": props['onClick:prepend'],
|
17613
|
-
"onClick:append": props['onClick:append']
|
18281
|
+
}]
|
17614
18282
|
}, rootAttrs, inputProps, {
|
17615
|
-
"focused": isFocused.value
|
17616
|
-
"messages": messages.value
|
18283
|
+
"focused": isFocused.value
|
17617
18284
|
}), {
|
17618
18285
|
...slots,
|
17619
18286
|
default: _ref2 => {
|
@@ -18495,6 +19162,7 @@
|
|
18495
19162
|
const theme = createTheme(options.theme);
|
18496
19163
|
const icons = createIcons(options.icons);
|
18497
19164
|
const locale = createLocale(options.locale);
|
19165
|
+
const date = createDate(options.date);
|
18498
19166
|
const install = app => {
|
18499
19167
|
for (const key in directives) {
|
18500
19168
|
app.directive(key, directives[key]);
|
@@ -18515,6 +19183,7 @@
|
|
18515
19183
|
app.provide(ThemeSymbol, theme);
|
18516
19184
|
app.provide(IconSymbol, icons);
|
18517
19185
|
app.provide(LocaleSymbol, locale);
|
19186
|
+
app.provide(DateAdapterSymbol, date);
|
18518
19187
|
if (IN_BROWSER && options.ssr) {
|
18519
19188
|
if (app.$nuxt) {
|
18520
19189
|
app.$nuxt.hook('app:suspense:resolve', () => {
|
@@ -18542,7 +19211,8 @@
|
|
18542
19211
|
display: inject.call(this, DisplaySymbol),
|
18543
19212
|
theme: inject.call(this, ThemeSymbol),
|
18544
19213
|
icons: inject.call(this, IconSymbol),
|
18545
|
-
locale: inject.call(this, LocaleSymbol)
|
19214
|
+
locale: inject.call(this, LocaleSymbol),
|
19215
|
+
date: inject.call(this, DateAdapterSymbol)
|
18546
19216
|
});
|
18547
19217
|
}
|
18548
19218
|
}
|
@@ -18555,10 +19225,11 @@
|
|
18555
19225
|
display,
|
18556
19226
|
theme,
|
18557
19227
|
icons,
|
18558
|
-
locale
|
19228
|
+
locale,
|
19229
|
+
date
|
18559
19230
|
};
|
18560
19231
|
}
|
18561
|
-
const version$1 = "4.0.0-dev-
|
19232
|
+
const version$1 = "4.0.0-dev-20230421.0";
|
18562
19233
|
createVuetify$1.version = version$1;
|
18563
19234
|
|
18564
19235
|
// Vue's inject() can only be used in setup
|
@@ -18578,12 +19249,13 @@
|
|
18578
19249
|
...options
|
18579
19250
|
});
|
18580
19251
|
};
|
18581
|
-
const version = "4.0.0-dev-
|
19252
|
+
const version = "4.0.0-dev-20230421.0";
|
18582
19253
|
createVuetify.version = version;
|
18583
19254
|
|
18584
19255
|
exports.components = components;
|
18585
19256
|
exports.createVuetify = createVuetify;
|
18586
19257
|
exports.directives = directives;
|
19258
|
+
exports.useDate = useDate;
|
18587
19259
|
exports.useDisplay = useDisplay;
|
18588
19260
|
exports.useLayout = useLayout;
|
18589
19261
|
exports.useLocale = useLocale;
|