@vuetify/nightly 4.0.0-dev-20230419.0 → 4.0.0-dev-20230422.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 +58 -58
- package/dist/json/tags.json +16 -0
- package/dist/json/web-types.json +522 -220
- package/dist/vuetify-labs.css +335 -172
- package/dist/vuetify-labs.d.ts +620 -171
- package/dist/vuetify-labs.esm.js +864 -182
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +864 -181
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +166 -3
- package/dist/vuetify.d.ts +584 -167
- package/dist/vuetify.esm.js +806 -134
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +806 -133
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +748 -682
- 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 +43 -23
- 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 +59 -17
- 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.esm.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Vuetify v4.0.0-dev-
|
2
|
+
* Vuetify v4.0.0-dev-20230422.0
|
3
3
|
* Forged by John Leider
|
4
4
|
* Released under the MIT License.
|
5
5
|
*/
|
@@ -3249,6 +3249,98 @@ const VToolbar = genericComponent()({
|
|
3249
3249
|
|
3250
3250
|
// Utilities
|
3251
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 = ref(null);
|
3272
|
+
const currentScroll = ref(0);
|
3273
|
+
const savedScroll = ref(0);
|
3274
|
+
const currentThreshold = ref(0);
|
3275
|
+
const isScrollActive = ref(false);
|
3276
|
+
const isScrollingUp = ref(false);
|
3277
|
+
const computedScrollThreshold = 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
|
+
watch(isScrollingUp, () => {
|
3289
|
+
savedScroll.value = savedScroll.value || currentScroll.value;
|
3290
|
+
});
|
3291
|
+
watch(isScrollActive, () => {
|
3292
|
+
savedScroll.value = 0;
|
3293
|
+
});
|
3294
|
+
onMounted(() => {
|
3295
|
+
watch(() => props.scrollTarget, scrollTarget => {
|
3296
|
+
const newTarget = scrollTarget ? document.querySelector(scrollTarget) : window;
|
3297
|
+
if (!newTarget) {
|
3298
|
+
consoleWarn(`Unable to locate element with identifier ${scrollTarget}`, getCurrentInstance$1());
|
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
|
+
onBeforeUnmount(() => {
|
3312
|
+
target.value?.removeEventListener('scroll', onScroll);
|
3313
|
+
});
|
3314
|
+
thresholdMetCallback && 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 && 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
|
+
|
3252
3344
|
// Composables
|
3253
3345
|
function useSsrBoot() {
|
3254
3346
|
const isBooted = ref(false);
|
@@ -3271,13 +3363,7 @@ function useSsrBoot() {
|
|
3271
3363
|
const VAppBar = genericComponent()({
|
3272
3364
|
name: 'VAppBar',
|
3273
3365
|
props: {
|
3274
|
-
|
3275
|
-
// hideOnScroll: Boolean
|
3276
|
-
// invertedScroll: Boolean
|
3277
|
-
// collapseOnScroll: Boolean
|
3278
|
-
// elevateOnScroll: Boolean
|
3279
|
-
// shrinkOnScroll: Boolean
|
3280
|
-
// fadeImageOnScroll: Boolean
|
3366
|
+
scrollBehavior: String,
|
3281
3367
|
modelValue: {
|
3282
3368
|
type: Boolean,
|
3283
3369
|
default: true
|
@@ -3289,6 +3375,7 @@ const VAppBar = genericComponent()({
|
|
3289
3375
|
},
|
3290
3376
|
...makeVToolbarProps(),
|
3291
3377
|
...makeLayoutItemProps(),
|
3378
|
+
...makeScrollProps(),
|
3292
3379
|
height: {
|
3293
3380
|
type: [Number, String],
|
3294
3381
|
default: 64
|
@@ -3303,11 +3390,63 @@ const VAppBar = genericComponent()({
|
|
3303
3390
|
} = _ref;
|
3304
3391
|
const vToolbarRef = ref();
|
3305
3392
|
const isActive = useProxiedModel(props, 'modelValue');
|
3393
|
+
const scrollBehavior = 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 = 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 = computed(() => props.collapse || scrollBehavior.value.collapse && (scrollBehavior.value.inverted ? currentScroll.value < 1 : currentScroll.value > 0));
|
3423
|
+
const isFlat = computed(() => props.flat || scrollBehavior.value.elevate && currentScroll.value === (scrollBehavior.value.inverted ? 1 : 0));
|
3424
|
+
const scrollRatio = computed(() => Math.min((currentThreshold.value - currentScroll.value) / currentThreshold.value || 1, 1));
|
3425
|
+
const opacity = computed(() => scrollBehavior.value.fadeImage ? scrollBehavior.value.inverted ? 1 - scrollRatio.value : scrollRatio.value : undefined);
|
3306
3426
|
const height = computed(() => {
|
3427
|
+
if (scrollBehavior.value.hide && scrollBehavior.value.inverted) return 0;
|
3307
3428
|
const height = vToolbarRef.value?.contentHeight ?? 0;
|
3308
3429
|
const extensionHeight = vToolbarRef.value?.extensionHeight ?? 0;
|
3309
3430
|
return height + extensionHeight;
|
3310
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
|
+
watch(currentScroll, setActive, {
|
3447
|
+
immediate: true
|
3448
|
+
});
|
3449
|
+
watch(scrollBehavior, setActive);
|
3311
3450
|
const {
|
3312
3451
|
ssrBootStyles
|
3313
3452
|
} = useSsrBoot();
|
@@ -3318,7 +3457,7 @@ const VAppBar = genericComponent()({
|
|
3318
3457
|
order: computed(() => parseInt(props.order, 10)),
|
3319
3458
|
position: toRef(props, 'location'),
|
3320
3459
|
layoutSize: height,
|
3321
|
-
elementSize:
|
3460
|
+
elementSize: ref(undefined),
|
3322
3461
|
active: isActive,
|
3323
3462
|
absolute: toRef(props, 'absolute')
|
3324
3463
|
});
|
@@ -3331,10 +3470,14 @@ const VAppBar = genericComponent()({
|
|
3331
3470
|
}],
|
3332
3471
|
"style": {
|
3333
3472
|
...layoutItemStyles.value,
|
3473
|
+
'--v-toolbar-image-opacity': opacity.value,
|
3334
3474
|
height: undefined,
|
3335
3475
|
...ssrBootStyles.value
|
3336
3476
|
}
|
3337
|
-
}, toolbarProps
|
3477
|
+
}, toolbarProps, {
|
3478
|
+
"collapse": isCollapsed.value,
|
3479
|
+
"flat": isFlat.value
|
3480
|
+
}), slots);
|
3338
3481
|
});
|
3339
3482
|
return {};
|
3340
3483
|
}
|
@@ -5292,7 +5435,8 @@ const VFieldLabel = genericComponent()({
|
|
5292
5435
|
|
5293
5436
|
// Composables
|
5294
5437
|
const makeFocusProps = propsFactory({
|
5295
|
-
focused: Boolean
|
5438
|
+
focused: Boolean,
|
5439
|
+
'onUpdate:focused': EventProp()
|
5296
5440
|
}, 'focus');
|
5297
5441
|
function useFocus(props) {
|
5298
5442
|
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstanceName();
|
@@ -5887,6 +6031,8 @@ const makeVInputProps = propsFactory({
|
|
5887
6031
|
appendIcon: IconValue,
|
5888
6032
|
prependIcon: IconValue,
|
5889
6033
|
hideDetails: [Boolean, String],
|
6034
|
+
hint: String,
|
6035
|
+
persistentHint: Boolean,
|
5890
6036
|
messages: {
|
5891
6037
|
type: [Array, String],
|
5892
6038
|
default: () => []
|
@@ -5950,10 +6096,19 @@ const VInput = genericComponent()({
|
|
5950
6096
|
resetValidation,
|
5951
6097
|
validate
|
5952
6098
|
}));
|
6099
|
+
const messages = 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
|
+
});
|
5953
6108
|
useRender(() => {
|
5954
6109
|
const hasPrepend = !!(slots.prepend || props.prependIcon);
|
5955
6110
|
const hasAppend = !!(slots.append || props.appendIcon);
|
5956
|
-
const hasMessages =
|
6111
|
+
const hasMessages = messages.value.length > 0;
|
5957
6112
|
const hasDetails = !props.hideDetails || props.hideDetails === 'auto' && (hasMessages || !!slots.details);
|
5958
6113
|
return createVNode("div", {
|
5959
6114
|
"class": ['v-input', `v-input--${props.direction}`, densityClasses.value, validationClasses.value]
|
@@ -5976,7 +6131,7 @@ const VInput = genericComponent()({
|
|
5976
6131
|
}, [createVNode(VMessages, {
|
5977
6132
|
"id": messagesId.value,
|
5978
6133
|
"active": hasMessages,
|
5979
|
-
"messages":
|
6134
|
+
"messages": messages.value
|
5980
6135
|
}, {
|
5981
6136
|
message: slots.message
|
5982
6137
|
}), slots.details?.(slotProps.value)])]);
|
@@ -5988,10 +6143,6 @@ const VInput = genericComponent()({
|
|
5988
6143
|
};
|
5989
6144
|
}
|
5990
6145
|
});
|
5991
|
-
function filterInputProps(props) {
|
5992
|
-
const keys = Object.keys(VInput.props).filter(k => !isOn(k));
|
5993
|
-
return pick(props, keys);
|
5994
|
-
}
|
5995
6146
|
|
5996
6147
|
const VCounter = genericComponent()({
|
5997
6148
|
name: 'VCounter',
|
@@ -6117,8 +6268,6 @@ const makeVTextFieldProps = propsFactory({
|
|
6117
6268
|
autofocus: Boolean,
|
6118
6269
|
counter: [Boolean, Number, String],
|
6119
6270
|
counterValue: Function,
|
6120
|
-
hint: String,
|
6121
|
-
persistentHint: Boolean,
|
6122
6271
|
prefix: String,
|
6123
6272
|
placeholder: String,
|
6124
6273
|
persistentPlaceholder: Boolean,
|
@@ -6173,9 +6322,6 @@ const VTextField = genericComponent()({
|
|
6173
6322
|
const vFieldRef = ref();
|
6174
6323
|
const inputRef = ref();
|
6175
6324
|
const isActive = computed(() => activeTypes.includes(props.type) || props.persistentPlaceholder || isFocused.value);
|
6176
|
-
const messages = computed(() => {
|
6177
|
-
return props.messages.length ? props.messages : isFocused.value || props.persistentHint ? props.hint : '';
|
6178
|
-
});
|
6179
6325
|
function onFocus() {
|
6180
6326
|
if (inputRef.value !== document.activeElement) {
|
6181
6327
|
inputRef.value?.focus();
|
@@ -6218,7 +6364,7 @@ const VTextField = genericComponent()({
|
|
6218
6364
|
const [{
|
6219
6365
|
modelValue: _,
|
6220
6366
|
...inputProps
|
6221
|
-
}] =
|
6367
|
+
}] = VInput.filterProps(props);
|
6222
6368
|
const [fieldProps] = filterFieldProps(props);
|
6223
6369
|
return createVNode(VInput, mergeProps({
|
6224
6370
|
"ref": vInputRef,
|
@@ -6228,12 +6374,9 @@ const VTextField = genericComponent()({
|
|
6228
6374
|
'v-text-field--prefixed': props.prefix,
|
6229
6375
|
'v-text-field--suffixed': props.suffix,
|
6230
6376
|
'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant)
|
6231
|
-
}]
|
6232
|
-
"onClick:prepend": props['onClick:prepend'],
|
6233
|
-
"onClick:append": props['onClick:append']
|
6377
|
+
}]
|
6234
6378
|
}, rootAttrs, inputProps, {
|
6235
|
-
"focused": isFocused.value
|
6236
|
-
"messages": messages.value
|
6379
|
+
"focused": isFocused.value
|
6237
6380
|
}), {
|
6238
6381
|
...slots,
|
6239
6382
|
default: _ref2 => {
|
@@ -6642,7 +6785,7 @@ const VCheckbox = genericComponent()({
|
|
6642
6785
|
const id = computed(() => props.id || `checkbox-${uid}`);
|
6643
6786
|
useRender(() => {
|
6644
6787
|
const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
|
6645
|
-
const [inputProps, _1] =
|
6788
|
+
const [inputProps, _1] = VInput.filterProps(props);
|
6646
6789
|
const [checkboxProps, _2] = VCheckboxBtn.filterProps(props);
|
6647
6790
|
return createVNode(VInput, mergeProps({
|
6648
6791
|
"class": "v-checkbox"
|
@@ -8054,7 +8197,12 @@ function transformItems$1(props, items) {
|
|
8054
8197
|
function useItems(props) {
|
8055
8198
|
const items = computed(() => transformItems$1(props, props.items));
|
8056
8199
|
function transformIn(value) {
|
8057
|
-
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
|
+
});
|
8058
8206
|
}
|
8059
8207
|
function transformOut(value) {
|
8060
8208
|
return value.map(_ref => {
|
@@ -8732,7 +8880,7 @@ function staticLocationStrategy() {
|
|
8732
8880
|
}
|
8733
8881
|
|
8734
8882
|
/** Get size of element ignoring max-width/max-height */
|
8735
|
-
function getIntrinsicSize(el) {
|
8883
|
+
function getIntrinsicSize(el, isRtl) {
|
8736
8884
|
// const scrollables = new Map<Element, [number, number]>()
|
8737
8885
|
// el.querySelectorAll('*').forEach(el => {
|
8738
8886
|
// const x = el.scrollLeft
|
@@ -8749,7 +8897,11 @@ function getIntrinsicSize(el) {
|
|
8749
8897
|
|
8750
8898
|
/* eslint-disable-next-line sonarjs/prefer-immediate-return */
|
8751
8899
|
const contentBox = nullifyTransforms(el);
|
8752
|
-
|
8900
|
+
if (isRtl) {
|
8901
|
+
contentBox.x += parseFloat(el.style.right || 0);
|
8902
|
+
} else {
|
8903
|
+
contentBox.x -= parseFloat(el.style.left || 0);
|
8904
|
+
}
|
8753
8905
|
contentBox.y -= parseFloat(el.style.top || 0);
|
8754
8906
|
|
8755
8907
|
// el.style.maxWidth = initialMaxWidth
|
@@ -8830,7 +8982,7 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
8830
8982
|
});
|
8831
8983
|
if (!data.activatorEl.value || !data.contentEl.value) return;
|
8832
8984
|
const targetBox = data.activatorEl.value.getBoundingClientRect();
|
8833
|
-
const contentBox = getIntrinsicSize(data.contentEl.value);
|
8985
|
+
const contentBox = getIntrinsicSize(data.contentEl.value, data.isRtl.value);
|
8834
8986
|
const scrollParents = getScrollParents(data.contentEl.value);
|
8835
8987
|
const viewportMargin = 12;
|
8836
8988
|
if (!scrollParents.length) {
|
@@ -9006,7 +9158,8 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
9006
9158
|
transformOrigin: `${placement.origin.side} ${placement.origin.align}`,
|
9007
9159
|
// transform: `translate(${pixelRound(x)}px, ${pixelRound(y)}px)`,
|
9008
9160
|
top: convertToUnit(pixelRound(y)),
|
9009
|
-
left: convertToUnit(pixelRound(x)),
|
9161
|
+
left: data.isRtl.value ? undefined : convertToUnit(pixelRound(x)),
|
9162
|
+
right: data.isRtl.value ? convertToUnit(pixelRound(-x)) : undefined,
|
9010
9163
|
minWidth: convertToUnit(axis === 'y' ? Math.min(minWidth.value, targetBox.width) : minWidth.value),
|
9011
9164
|
maxWidth: convertToUnit(pixelCeil(clamp(available.x, minWidth.value === Infinity ? 0 : minWidth.value, maxWidth.value))),
|
9012
9165
|
maxHeight: convertToUnit(pixelCeil(clamp(available.y, minHeight.value === Infinity ? 0 : minHeight.value, maxHeight.value)))
|
@@ -9901,6 +10054,7 @@ const VSelect = genericComponent()({
|
|
9901
10054
|
})
|
9902
10055
|
},
|
9903
10056
|
emits: {
|
10057
|
+
'update:focused': focused => true,
|
9904
10058
|
'update:modelValue': val => true,
|
9905
10059
|
'update:menu': val => true
|
9906
10060
|
},
|
@@ -10017,6 +10171,9 @@ const VSelect = genericComponent()({
|
|
10017
10171
|
menu.value = false;
|
10018
10172
|
}
|
10019
10173
|
}
|
10174
|
+
function onFocusin(e) {
|
10175
|
+
isFocused.value = true;
|
10176
|
+
}
|
10020
10177
|
function onFocusout(e) {
|
10021
10178
|
if (e.relatedTarget == null) {
|
10022
10179
|
vTextFieldRef.value?.focus();
|
@@ -10071,6 +10228,7 @@ const VSelect = genericComponent()({
|
|
10071
10228
|
"selected": selected.value,
|
10072
10229
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
10073
10230
|
"onMousedown": e => e.preventDefault(),
|
10231
|
+
"onFocusin": onFocusin,
|
10074
10232
|
"onFocusout": onFocusout
|
10075
10233
|
}, {
|
10076
10234
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
@@ -10149,6 +10307,7 @@ const VSelect = genericComponent()({
|
|
10149
10307
|
});
|
10150
10308
|
});
|
10151
10309
|
return forwardRefs({
|
10310
|
+
isFocused,
|
10152
10311
|
menu,
|
10153
10312
|
select
|
10154
10313
|
}, vTextFieldRef);
|
@@ -10287,6 +10446,7 @@ const VAutocomplete = genericComponent()({
|
|
10287
10446
|
})
|
10288
10447
|
},
|
10289
10448
|
emits: {
|
10449
|
+
'update:focused': focused => true,
|
10290
10450
|
'update:search': val => true,
|
10291
10451
|
'update:modelValue': val => true,
|
10292
10452
|
'update:menu': val => true
|
@@ -10310,11 +10470,17 @@ const VAutocomplete = genericComponent()({
|
|
10310
10470
|
_menu.value = v;
|
10311
10471
|
}
|
10312
10472
|
});
|
10473
|
+
const selectionIndex = ref(-1);
|
10474
|
+
const color = computed(() => vTextFieldRef.value?.color);
|
10313
10475
|
const {
|
10314
10476
|
items,
|
10315
10477
|
transformIn,
|
10316
10478
|
transformOut
|
10317
10479
|
} = useItems(props);
|
10480
|
+
const {
|
10481
|
+
textColorClasses,
|
10482
|
+
textColorStyles
|
10483
|
+
} = useTextColor(color);
|
10318
10484
|
const search = useProxiedModel(props, 'search', '');
|
10319
10485
|
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
|
10320
10486
|
const transformed = transformOut(v);
|
@@ -10337,6 +10503,7 @@ const VAutocomplete = genericComponent()({
|
|
10337
10503
|
return filteredItems.value;
|
10338
10504
|
});
|
10339
10505
|
const selected = computed(() => selections.value.map(selection => selection.props.value));
|
10506
|
+
const selection = computed(() => selections.value[selectionIndex.value]);
|
10340
10507
|
const listRef = ref();
|
10341
10508
|
function onClear(e) {
|
10342
10509
|
if (props.openOnClear) {
|
@@ -10350,7 +10517,9 @@ const VAutocomplete = genericComponent()({
|
|
10350
10517
|
}
|
10351
10518
|
function onKeydown(e) {
|
10352
10519
|
if (props.readonly || form?.isReadonly.value) return;
|
10353
|
-
|
10520
|
+
const selectionStart = vTextFieldRef.value.selectionStart;
|
10521
|
+
const length = selected.value.length;
|
10522
|
+
if (selectionIndex.value > -1 || ['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
10354
10523
|
e.preventDefault();
|
10355
10524
|
}
|
10356
10525
|
if (['Enter', 'ArrowDown'].includes(e.key)) {
|
@@ -10367,6 +10536,38 @@ const VAutocomplete = genericComponent()({
|
|
10367
10536
|
} else if (e.key === 'ArrowUp') {
|
10368
10537
|
listRef.value?.focus('prev');
|
10369
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
|
+
}
|
10370
10571
|
}
|
10371
10572
|
function onInput(e) {
|
10372
10573
|
search.value = e.target.value;
|
@@ -10388,7 +10589,6 @@ const VAutocomplete = genericComponent()({
|
|
10388
10589
|
const index = selected.value.findIndex(selection => props.valueComparator(selection, item.value));
|
10389
10590
|
if (index === -1) {
|
10390
10591
|
model.value = [...model.value, item];
|
10391
|
-
search.value = '';
|
10392
10592
|
} else {
|
10393
10593
|
const value = [...model.value];
|
10394
10594
|
value.splice(index, 1);
|
@@ -10433,12 +10633,15 @@ const VAutocomplete = genericComponent()({
|
|
10433
10633
|
"onUpdate:modelValue": v => {
|
10434
10634
|
if (v == null) model.value = [];
|
10435
10635
|
},
|
10636
|
+
"focused": isFocused.value,
|
10637
|
+
"onUpdate:focused": $event => isFocused.value = $event,
|
10436
10638
|
"validationValue": model.externalValue,
|
10437
10639
|
"dirty": isDirty,
|
10438
10640
|
"onInput": onInput,
|
10439
10641
|
"class": ['v-autocomplete', {
|
10440
10642
|
'v-autocomplete--active-menu': menu.value,
|
10441
10643
|
'v-autocomplete--chips': !!props.chips,
|
10644
|
+
'v-autocomplete--selecting-index': selectionIndex.value > -1,
|
10442
10645
|
[`v-autocomplete--${props.multiple ? 'multiple' : 'single'}`]: true,
|
10443
10646
|
'v-autocomplete--selection-slot': !!slots.selection
|
10444
10647
|
}],
|
@@ -10447,8 +10650,6 @@ const VAutocomplete = genericComponent()({
|
|
10447
10650
|
"placeholder": isDirty ? undefined : props.placeholder,
|
10448
10651
|
"onClick:clear": onClear,
|
10449
10652
|
"onMousedown:control": onMousedownControl,
|
10450
|
-
"onFocus": () => isFocused.value = true,
|
10451
|
-
"onBlur": () => isFocused.value = false,
|
10452
10653
|
"onKeydown": onKeydown
|
10453
10654
|
}), {
|
10454
10655
|
...slots,
|
@@ -10513,7 +10714,8 @@ const VAutocomplete = genericComponent()({
|
|
10513
10714
|
};
|
10514
10715
|
return createVNode("div", {
|
10515
10716
|
"key": item.value,
|
10516
|
-
"class":
|
10717
|
+
"class": ['v-autocomplete__selection', index === selectionIndex.value && ['v-autocomplete__selection--selected', textColorClasses.value]],
|
10718
|
+
"style": index === selectionIndex.value ? textColorStyles.value : {}
|
10517
10719
|
}, [hasChips ? !slots.chip ? createVNode(VChip, mergeProps({
|
10518
10720
|
"key": "chip",
|
10519
10721
|
"closable": props.closableChips,
|
@@ -12408,11 +12610,33 @@ const makeSliderProps = propsFactory({
|
|
12408
12610
|
elevation: 2
|
12409
12611
|
})
|
12410
12612
|
}, 'slider');
|
12613
|
+
const useSteps = props => {
|
12614
|
+
const min = computed(() => parseFloat(props.min));
|
12615
|
+
const max = computed(() => parseFloat(props.max));
|
12616
|
+
const step = computed(() => +props.step > 0 ? parseFloat(props.step) : 0);
|
12617
|
+
const decimals = computed(() => Math.max(getDecimals(step.value), getDecimals(min.value)));
|
12618
|
+
function roundValue(value) {
|
12619
|
+
if (step.value <= 0) return value;
|
12620
|
+
const clamped = clamp(value, min.value, max.value);
|
12621
|
+
const offset = min.value % step.value;
|
12622
|
+
const newValue = Math.round((clamped - offset) / step.value) * step.value + offset;
|
12623
|
+
return parseFloat(Math.min(newValue, max.value).toFixed(decimals.value));
|
12624
|
+
}
|
12625
|
+
return {
|
12626
|
+
min,
|
12627
|
+
max,
|
12628
|
+
step,
|
12629
|
+
decimals,
|
12630
|
+
roundValue
|
12631
|
+
};
|
12632
|
+
};
|
12411
12633
|
const useSlider = _ref => {
|
12412
12634
|
let {
|
12413
12635
|
props,
|
12414
|
-
|
12415
|
-
|
12636
|
+
steps,
|
12637
|
+
onSliderStart,
|
12638
|
+
onSliderMove,
|
12639
|
+
onSliderEnd,
|
12416
12640
|
getActiveThumb
|
12417
12641
|
} = _ref;
|
12418
12642
|
const {
|
@@ -12426,10 +12650,13 @@ const useSlider = _ref => {
|
|
12426
12650
|
}
|
12427
12651
|
return hd;
|
12428
12652
|
});
|
12429
|
-
const
|
12430
|
-
|
12431
|
-
|
12432
|
-
|
12653
|
+
const {
|
12654
|
+
min,
|
12655
|
+
max,
|
12656
|
+
step,
|
12657
|
+
decimals,
|
12658
|
+
roundValue
|
12659
|
+
} = steps;
|
12433
12660
|
const thumbSize = computed(() => parseInt(props.thumbSize, 10));
|
12434
12661
|
const tickSize = computed(() => parseInt(props.tickSize, 10));
|
12435
12662
|
const trackSize = computed(() => parseInt(props.trackSize, 10));
|
@@ -12443,13 +12670,6 @@ const useSlider = _ref => {
|
|
12443
12670
|
const startOffset = ref(0);
|
12444
12671
|
const trackContainerRef = ref();
|
12445
12672
|
const activeThumbRef = ref();
|
12446
|
-
function roundValue(value) {
|
12447
|
-
if (step.value <= 0) return value;
|
12448
|
-
const clamped = clamp(value, min.value, max.value);
|
12449
|
-
const offset = min.value % step.value;
|
12450
|
-
const newValue = Math.round((clamped - offset) / step.value) * step.value + offset;
|
12451
|
-
return parseFloat(Math.min(newValue, max.value).toFixed(decimals.value));
|
12452
|
-
}
|
12453
12673
|
function parseMouseMove(e) {
|
12454
12674
|
const vertical = props.direction === 'vertical';
|
12455
12675
|
const start = vertical ? 'top' : 'left';
|
@@ -12466,14 +12686,11 @@ const useSlider = _ref => {
|
|
12466
12686
|
if (vertical || horizontalDirection.value === 'rtl') clickPos = 1 - clickPos;
|
12467
12687
|
return roundValue(min.value + clickPos * (max.value - min.value));
|
12468
12688
|
}
|
12469
|
-
let thumbMoved = false;
|
12470
12689
|
const handleStop = e => {
|
12471
|
-
|
12472
|
-
|
12473
|
-
|
12474
|
-
}
|
12690
|
+
onSliderEnd({
|
12691
|
+
value: parseMouseMove(e)
|
12692
|
+
});
|
12475
12693
|
mousePressed.value = false;
|
12476
|
-
thumbMoved = false;
|
12477
12694
|
startOffset.value = 0;
|
12478
12695
|
};
|
12479
12696
|
const handleStart = e => {
|
@@ -12482,20 +12699,25 @@ const useSlider = _ref => {
|
|
12482
12699
|
activeThumbRef.value.focus();
|
12483
12700
|
mousePressed.value = true;
|
12484
12701
|
if (activeThumbRef.value.contains(e.target)) {
|
12485
|
-
thumbMoved = true;
|
12486
12702
|
startOffset.value = getOffset(e, activeThumbRef.value, props.direction);
|
12487
12703
|
} else {
|
12488
12704
|
startOffset.value = 0;
|
12489
|
-
|
12705
|
+
onSliderMove({
|
12706
|
+
value: parseMouseMove(e)
|
12707
|
+
});
|
12490
12708
|
}
|
12709
|
+
onSliderStart({
|
12710
|
+
value: parseMouseMove(e)
|
12711
|
+
});
|
12491
12712
|
};
|
12492
12713
|
const moveListenerOptions = {
|
12493
12714
|
passive: true,
|
12494
12715
|
capture: true
|
12495
12716
|
};
|
12496
12717
|
function onMouseMove(e) {
|
12497
|
-
|
12498
|
-
|
12718
|
+
onSliderMove({
|
12719
|
+
value: parseMouseMove(e)
|
12720
|
+
});
|
12499
12721
|
}
|
12500
12722
|
function onSliderMouseUp(e) {
|
12501
12723
|
e.stopPropagation();
|
@@ -12871,13 +13093,21 @@ const VSlider = genericComponent()({
|
|
12871
13093
|
},
|
12872
13094
|
emits: {
|
12873
13095
|
'update:focused': value => true,
|
12874
|
-
'update:modelValue': v => true
|
13096
|
+
'update:modelValue': v => true,
|
13097
|
+
start: value => true,
|
13098
|
+
end: value => true
|
12875
13099
|
},
|
12876
13100
|
setup(props, _ref) {
|
12877
13101
|
let {
|
12878
|
-
slots
|
13102
|
+
slots,
|
13103
|
+
emit
|
12879
13104
|
} = _ref;
|
12880
13105
|
const thumbContainerRef = ref();
|
13106
|
+
const steps = useSteps(props);
|
13107
|
+
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
13108
|
+
const value = typeof v === 'string' ? parseFloat(v) : v == null ? steps.min.value : v;
|
13109
|
+
return steps.roundValue(value);
|
13110
|
+
});
|
12881
13111
|
const {
|
12882
13112
|
min,
|
12883
13113
|
max,
|
@@ -12891,16 +13121,26 @@ const VSlider = genericComponent()({
|
|
12891
13121
|
readonly
|
12892
13122
|
} = useSlider({
|
12893
13123
|
props,
|
12894
|
-
|
12895
|
-
|
12896
|
-
|
12897
|
-
|
13124
|
+
steps,
|
13125
|
+
onSliderStart: () => {
|
13126
|
+
emit('start', model.value);
|
13127
|
+
},
|
13128
|
+
onSliderEnd: _ref2 => {
|
13129
|
+
let {
|
13130
|
+
value
|
13131
|
+
} = _ref2;
|
13132
|
+
const roundedValue = roundValue(value);
|
13133
|
+
model.value = roundedValue;
|
13134
|
+
emit('end', roundedValue);
|
13135
|
+
},
|
13136
|
+
onSliderMove: _ref3 => {
|
13137
|
+
let {
|
13138
|
+
value
|
13139
|
+
} = _ref3;
|
13140
|
+
return model.value = roundValue(value);
|
13141
|
+
},
|
12898
13142
|
getActiveThumb: () => thumbContainerRef.value?.$el
|
12899
13143
|
});
|
12900
|
-
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
12901
|
-
const value = typeof v === 'string' ? parseFloat(v) : v == null ? min.value : v;
|
12902
|
-
return roundValue(value);
|
12903
|
-
});
|
12904
13144
|
const {
|
12905
13145
|
isFocused,
|
12906
13146
|
focus,
|
@@ -12908,7 +13148,7 @@ const VSlider = genericComponent()({
|
|
12908
13148
|
} = useFocus(props);
|
12909
13149
|
const trackStop = computed(() => position(model.value));
|
12910
13150
|
useRender(() => {
|
12911
|
-
const [inputProps, _] =
|
13151
|
+
const [inputProps, _] = VInput.filterProps(props);
|
12912
13152
|
const hasPrepend = !!(props.label || slots.label || slots.prepend);
|
12913
13153
|
return createVNode(VInput, mergeProps({
|
12914
13154
|
"class": ['v-slider', {
|
@@ -12926,11 +13166,11 @@ const VSlider = genericComponent()({
|
|
12926
13166
|
"class": "v-slider__label",
|
12927
13167
|
"text": props.label
|
12928
13168
|
}, null) : undefined, slots.prepend?.(slotProps)]) : undefined,
|
12929
|
-
default:
|
13169
|
+
default: _ref4 => {
|
12930
13170
|
let {
|
12931
13171
|
id,
|
12932
13172
|
messagesId
|
12933
|
-
} =
|
13173
|
+
} = _ref4;
|
12934
13174
|
return createVNode("div", {
|
12935
13175
|
"class": "v-slider__container",
|
12936
13176
|
"onMousedown": !readonly.value ? onSliderMousedown : undefined,
|
@@ -13572,6 +13812,7 @@ const VCombobox = genericComponent()({
|
|
13572
13812
|
})
|
13573
13813
|
},
|
13574
13814
|
emits: {
|
13815
|
+
'update:focused': focused => true,
|
13575
13816
|
'update:modelValue': val => true,
|
13576
13817
|
'update:search': val => true,
|
13577
13818
|
'update:menu': val => true
|
@@ -13709,8 +13950,9 @@ const VCombobox = genericComponent()({
|
|
13709
13950
|
}
|
13710
13951
|
return;
|
13711
13952
|
}
|
13712
|
-
|
13713
|
-
|
13953
|
+
const originalSelectionIndex = selectionIndex.value;
|
13954
|
+
if (selection.value) select(selection.value);
|
13955
|
+
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
13714
13956
|
}
|
13715
13957
|
if (e.key === 'ArrowLeft') {
|
13716
13958
|
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
@@ -13795,6 +14037,8 @@ const VCombobox = genericComponent()({
|
|
13795
14037
|
"onUpdate:modelValue": [$event => search.value = $event, v => {
|
13796
14038
|
if (v == null) model.value = [];
|
13797
14039
|
}],
|
14040
|
+
"focused": isFocused.value,
|
14041
|
+
"onUpdate:focused": $event => isFocused.value = $event,
|
13798
14042
|
"validationValue": model.externalValue,
|
13799
14043
|
"dirty": isDirty,
|
13800
14044
|
"class": ['v-combobox', {
|
@@ -13808,8 +14052,6 @@ const VCombobox = genericComponent()({
|
|
13808
14052
|
"placeholder": isDirty ? undefined : props.placeholder,
|
13809
14053
|
"onClick:clear": onClear,
|
13810
14054
|
"onMousedown:control": onMousedownControl,
|
13811
|
-
"onFocus": () => isFocused.value = true,
|
13812
|
-
"onBlur": () => isFocused.value = false,
|
13813
14055
|
"onKeydown": onKeydown
|
13814
14056
|
}), {
|
13815
14057
|
...slots,
|
@@ -14261,8 +14503,6 @@ const VFileInput = genericComponent()({
|
|
14261
14503
|
default: '$vuetify.fileInput.counter'
|
14262
14504
|
},
|
14263
14505
|
multiple: Boolean,
|
14264
|
-
hint: String,
|
14265
|
-
persistentHint: Boolean,
|
14266
14506
|
showSize: {
|
14267
14507
|
type: [Boolean, Number],
|
14268
14508
|
default: false,
|
@@ -14287,6 +14527,7 @@ const VFileInput = genericComponent()({
|
|
14287
14527
|
emits: {
|
14288
14528
|
'click:control': e => true,
|
14289
14529
|
'mousedown:control': e => true,
|
14530
|
+
'update:focused': focused => true,
|
14290
14531
|
'update:modelValue': files => true
|
14291
14532
|
},
|
14292
14533
|
setup(props, _ref) {
|
@@ -14299,6 +14540,11 @@ const VFileInput = genericComponent()({
|
|
14299
14540
|
t
|
14300
14541
|
} = useLocale();
|
14301
14542
|
const model = useProxiedModel(props, 'modelValue');
|
14543
|
+
const {
|
14544
|
+
isFocused,
|
14545
|
+
focus,
|
14546
|
+
blur
|
14547
|
+
} = useFocus(props);
|
14302
14548
|
const base = computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined);
|
14303
14549
|
const totalBytes = computed(() => (model.value ?? []).reduce((bytes, _ref2) => {
|
14304
14550
|
let {
|
@@ -14320,21 +14566,14 @@ const VFileInput = genericComponent()({
|
|
14320
14566
|
});
|
14321
14567
|
const vInputRef = ref();
|
14322
14568
|
const vFieldRef = ref();
|
14323
|
-
const isFocused = ref(false);
|
14324
14569
|
const inputRef = ref();
|
14325
|
-
const messages = computed(() => {
|
14326
|
-
return props.messages.length ? props.messages : props.persistentHint ? props.hint : '';
|
14327
|
-
});
|
14328
14570
|
function onFocus() {
|
14329
14571
|
if (inputRef.value !== document.activeElement) {
|
14330
14572
|
inputRef.value?.focus();
|
14331
14573
|
}
|
14332
|
-
if (!isFocused.value)
|
14333
|
-
isFocused.value = true;
|
14334
|
-
}
|
14574
|
+
if (!isFocused.value) focus();
|
14335
14575
|
}
|
14336
14576
|
function onClickPrepend(e) {
|
14337
|
-
callEvent(props['onClick:prepend'], e);
|
14338
14577
|
onControlClick(e);
|
14339
14578
|
}
|
14340
14579
|
function onControlMousedown(e) {
|
@@ -14365,18 +14604,16 @@ const VFileInput = genericComponent()({
|
|
14365
14604
|
const [{
|
14366
14605
|
modelValue: _,
|
14367
14606
|
...inputProps
|
14368
|
-
}] =
|
14607
|
+
}] = VInput.filterProps(props);
|
14369
14608
|
const [fieldProps] = filterFieldProps(props);
|
14370
14609
|
return createVNode(VInput, mergeProps({
|
14371
14610
|
"ref": vInputRef,
|
14372
14611
|
"modelValue": model.value,
|
14373
14612
|
"onUpdate:modelValue": $event => model.value = $event,
|
14374
14613
|
"class": "v-file-input",
|
14375
|
-
"onClick:prepend": onClickPrepend
|
14376
|
-
"onClick:append": props['onClick:append']
|
14614
|
+
"onClick:prepend": onClickPrepend
|
14377
14615
|
}, rootAttrs, inputProps, {
|
14378
|
-
"focused": isFocused.value
|
14379
|
-
"messages": messages.value
|
14616
|
+
"focused": isFocused.value
|
14380
14617
|
}), {
|
14381
14618
|
...slots,
|
14382
14619
|
default: _ref3 => {
|
@@ -14428,7 +14665,7 @@ const VFileInput = genericComponent()({
|
|
14428
14665
|
model.value = [...(target.files ?? [])];
|
14429
14666
|
},
|
14430
14667
|
"onFocus": onFocus,
|
14431
|
-
"onBlur":
|
14668
|
+
"onBlur": blur
|
14432
14669
|
}, slotProps, inputAttrs), null), createVNode("div", {
|
14433
14670
|
"class": fieldClass
|
14434
14671
|
}, [!!model.value?.length && (slots.selection ? slots.selection({
|
@@ -15119,6 +15356,432 @@ const VMain = genericComponent()({
|
|
15119
15356
|
}
|
15120
15357
|
});
|
15121
15358
|
|
15359
|
+
// Utilities
|
15360
|
+
|
15361
|
+
// Types
|
15362
|
+
|
15363
|
+
function getWeekArray(date) {
|
15364
|
+
let currentWeek = [];
|
15365
|
+
const weeks = [];
|
15366
|
+
const firstDayOfMonth = startOfMonth(date);
|
15367
|
+
const lastDayOfMonth = endOfMonth(date);
|
15368
|
+
for (let i = 0; i < firstDayOfMonth.getDay(); i++) {
|
15369
|
+
currentWeek.push(null);
|
15370
|
+
}
|
15371
|
+
for (let i = 1; i <= lastDayOfMonth.getDate(); i++) {
|
15372
|
+
const day = new Date(date.getFullYear(), date.getMonth(), i);
|
15373
|
+
|
15374
|
+
// Add the day to the current week
|
15375
|
+
currentWeek.push(day);
|
15376
|
+
|
15377
|
+
// If the current week has 7 days, add it to the weeks array and start a new week
|
15378
|
+
if (currentWeek.length === 7) {
|
15379
|
+
weeks.push(currentWeek);
|
15380
|
+
currentWeek = [];
|
15381
|
+
}
|
15382
|
+
}
|
15383
|
+
for (let i = currentWeek.length; i < 7; i++) {
|
15384
|
+
currentWeek.push(null);
|
15385
|
+
}
|
15386
|
+
weeks.push(currentWeek);
|
15387
|
+
return weeks;
|
15388
|
+
}
|
15389
|
+
function startOfMonth(date) {
|
15390
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
15391
|
+
}
|
15392
|
+
function endOfMonth(date) {
|
15393
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
15394
|
+
}
|
15395
|
+
function date(value) {
|
15396
|
+
if (value == null) return null;
|
15397
|
+
if (value instanceof Date) return value;
|
15398
|
+
if (typeof value === 'string') {
|
15399
|
+
const parsed = Date.parse(value);
|
15400
|
+
if (!isNaN(parsed)) return new Date(parsed);
|
15401
|
+
}
|
15402
|
+
return null;
|
15403
|
+
}
|
15404
|
+
const firstDay = {
|
15405
|
+
'001': 1,
|
15406
|
+
AD: 1,
|
15407
|
+
AE: 6,
|
15408
|
+
AF: 6,
|
15409
|
+
AG: 0,
|
15410
|
+
AI: 1,
|
15411
|
+
AL: 1,
|
15412
|
+
AM: 1,
|
15413
|
+
AN: 1,
|
15414
|
+
AR: 1,
|
15415
|
+
AS: 0,
|
15416
|
+
AT: 1,
|
15417
|
+
AU: 0,
|
15418
|
+
AX: 1,
|
15419
|
+
AZ: 1,
|
15420
|
+
BA: 1,
|
15421
|
+
BD: 0,
|
15422
|
+
BE: 1,
|
15423
|
+
BG: 1,
|
15424
|
+
BH: 6,
|
15425
|
+
BM: 1,
|
15426
|
+
BN: 1,
|
15427
|
+
BR: 0,
|
15428
|
+
BS: 0,
|
15429
|
+
BT: 0,
|
15430
|
+
BW: 0,
|
15431
|
+
BY: 1,
|
15432
|
+
BZ: 0,
|
15433
|
+
CA: 0,
|
15434
|
+
CH: 1,
|
15435
|
+
CL: 1,
|
15436
|
+
CM: 1,
|
15437
|
+
CN: 0,
|
15438
|
+
CO: 0,
|
15439
|
+
CR: 1,
|
15440
|
+
CY: 1,
|
15441
|
+
CZ: 1,
|
15442
|
+
DE: 1,
|
15443
|
+
DJ: 6,
|
15444
|
+
DK: 1,
|
15445
|
+
DM: 0,
|
15446
|
+
DO: 0,
|
15447
|
+
DZ: 6,
|
15448
|
+
EC: 1,
|
15449
|
+
EE: 1,
|
15450
|
+
EG: 6,
|
15451
|
+
ES: 1,
|
15452
|
+
ET: 0,
|
15453
|
+
FI: 1,
|
15454
|
+
FJ: 1,
|
15455
|
+
FO: 1,
|
15456
|
+
FR: 1,
|
15457
|
+
GB: 1,
|
15458
|
+
'GB-alt-variant': 0,
|
15459
|
+
GE: 1,
|
15460
|
+
GF: 1,
|
15461
|
+
GP: 1,
|
15462
|
+
GR: 1,
|
15463
|
+
GT: 0,
|
15464
|
+
GU: 0,
|
15465
|
+
HK: 0,
|
15466
|
+
HN: 0,
|
15467
|
+
HR: 1,
|
15468
|
+
HU: 1,
|
15469
|
+
ID: 0,
|
15470
|
+
IE: 1,
|
15471
|
+
IL: 0,
|
15472
|
+
IN: 0,
|
15473
|
+
IQ: 6,
|
15474
|
+
IR: 6,
|
15475
|
+
IS: 1,
|
15476
|
+
IT: 1,
|
15477
|
+
JM: 0,
|
15478
|
+
JO: 6,
|
15479
|
+
JP: 0,
|
15480
|
+
KE: 0,
|
15481
|
+
KG: 1,
|
15482
|
+
KH: 0,
|
15483
|
+
KR: 0,
|
15484
|
+
KW: 6,
|
15485
|
+
KZ: 1,
|
15486
|
+
LA: 0,
|
15487
|
+
LB: 1,
|
15488
|
+
LI: 1,
|
15489
|
+
LK: 1,
|
15490
|
+
LT: 1,
|
15491
|
+
LU: 1,
|
15492
|
+
LV: 1,
|
15493
|
+
LY: 6,
|
15494
|
+
MC: 1,
|
15495
|
+
MD: 1,
|
15496
|
+
ME: 1,
|
15497
|
+
MH: 0,
|
15498
|
+
MK: 1,
|
15499
|
+
MM: 0,
|
15500
|
+
MN: 1,
|
15501
|
+
MO: 0,
|
15502
|
+
MQ: 1,
|
15503
|
+
MT: 0,
|
15504
|
+
MV: 5,
|
15505
|
+
MX: 0,
|
15506
|
+
MY: 1,
|
15507
|
+
MZ: 0,
|
15508
|
+
NI: 0,
|
15509
|
+
NL: 1,
|
15510
|
+
NO: 1,
|
15511
|
+
NP: 0,
|
15512
|
+
NZ: 1,
|
15513
|
+
OM: 6,
|
15514
|
+
PA: 0,
|
15515
|
+
PE: 0,
|
15516
|
+
PH: 0,
|
15517
|
+
PK: 0,
|
15518
|
+
PL: 1,
|
15519
|
+
PR: 0,
|
15520
|
+
PT: 0,
|
15521
|
+
PY: 0,
|
15522
|
+
QA: 6,
|
15523
|
+
RE: 1,
|
15524
|
+
RO: 1,
|
15525
|
+
RS: 1,
|
15526
|
+
RU: 1,
|
15527
|
+
SA: 0,
|
15528
|
+
SD: 6,
|
15529
|
+
SE: 1,
|
15530
|
+
SG: 0,
|
15531
|
+
SI: 1,
|
15532
|
+
SK: 1,
|
15533
|
+
SM: 1,
|
15534
|
+
SV: 0,
|
15535
|
+
SY: 6,
|
15536
|
+
TH: 0,
|
15537
|
+
TJ: 1,
|
15538
|
+
TM: 1,
|
15539
|
+
TR: 1,
|
15540
|
+
TT: 0,
|
15541
|
+
TW: 0,
|
15542
|
+
UA: 1,
|
15543
|
+
UM: 0,
|
15544
|
+
US: 0,
|
15545
|
+
UY: 1,
|
15546
|
+
UZ: 1,
|
15547
|
+
VA: 1,
|
15548
|
+
VE: 0,
|
15549
|
+
VI: 0,
|
15550
|
+
VN: 1,
|
15551
|
+
WS: 0,
|
15552
|
+
XK: 1,
|
15553
|
+
YE: 0,
|
15554
|
+
ZA: 0,
|
15555
|
+
ZW: 0
|
15556
|
+
};
|
15557
|
+
const sundayJanuarySecond2000 = new Date(2000, 0, 2);
|
15558
|
+
function getWeekdays(locale) {
|
15559
|
+
const daysFromSunday = firstDay[locale.slice(-2).toUpperCase()];
|
15560
|
+
return createRange(7).map(i => {
|
15561
|
+
const weekday = new Date(sundayJanuarySecond2000);
|
15562
|
+
weekday.setDate(sundayJanuarySecond2000.getDate() + daysFromSunday + i);
|
15563
|
+
return new Intl.DateTimeFormat(locale, {
|
15564
|
+
weekday: 'long'
|
15565
|
+
}).format(weekday);
|
15566
|
+
});
|
15567
|
+
}
|
15568
|
+
function format(value, formatString, locale) {
|
15569
|
+
const date = new Date(value);
|
15570
|
+
let options = {};
|
15571
|
+
switch (formatString) {
|
15572
|
+
case 'fullDateWithWeekday':
|
15573
|
+
options = {
|
15574
|
+
weekday: 'long',
|
15575
|
+
day: 'numeric',
|
15576
|
+
month: 'long',
|
15577
|
+
year: 'numeric'
|
15578
|
+
};
|
15579
|
+
break;
|
15580
|
+
case 'normalDateWithWeekday':
|
15581
|
+
options = {
|
15582
|
+
weekday: 'short',
|
15583
|
+
day: 'numeric',
|
15584
|
+
month: 'short',
|
15585
|
+
year: 'numeric'
|
15586
|
+
};
|
15587
|
+
break;
|
15588
|
+
case 'keyboardDate':
|
15589
|
+
options = {};
|
15590
|
+
break;
|
15591
|
+
case 'monthAndDate':
|
15592
|
+
options = {
|
15593
|
+
month: 'long',
|
15594
|
+
day: 'numeric'
|
15595
|
+
};
|
15596
|
+
break;
|
15597
|
+
case 'monthAndYear':
|
15598
|
+
options = {
|
15599
|
+
month: 'long',
|
15600
|
+
year: 'numeric'
|
15601
|
+
};
|
15602
|
+
break;
|
15603
|
+
default:
|
15604
|
+
options = {
|
15605
|
+
timeZone: 'UTC',
|
15606
|
+
timeZoneName: 'short'
|
15607
|
+
};
|
15608
|
+
}
|
15609
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
15610
|
+
}
|
15611
|
+
function addDays(date, amount) {
|
15612
|
+
const d = new Date(date);
|
15613
|
+
d.setDate(d.getDate() + amount);
|
15614
|
+
return d;
|
15615
|
+
}
|
15616
|
+
function addMonths(date, amount) {
|
15617
|
+
const d = new Date(date);
|
15618
|
+
d.setMonth(d.getMonth() + amount);
|
15619
|
+
return d;
|
15620
|
+
}
|
15621
|
+
function getYear(date) {
|
15622
|
+
return date.getFullYear();
|
15623
|
+
}
|
15624
|
+
function getMonth(date) {
|
15625
|
+
return date.getMonth();
|
15626
|
+
}
|
15627
|
+
function startOfYear(date) {
|
15628
|
+
return new Date(date.getFullYear(), 0, 1);
|
15629
|
+
}
|
15630
|
+
function endOfYear(date) {
|
15631
|
+
return new Date(date.getFullYear(), 11, 31);
|
15632
|
+
}
|
15633
|
+
function getMondayOfFirstWeekOfYear(year) {
|
15634
|
+
return new Date(year, 0, 1);
|
15635
|
+
}
|
15636
|
+
|
15637
|
+
// https://stackoverflow.com/questions/274861/how-do-i-calculate-the-week-number-given-a-date/275024#275024
|
15638
|
+
function getWeek(date) {
|
15639
|
+
let year = date.getFullYear();
|
15640
|
+
let d1w1 = getMondayOfFirstWeekOfYear(year);
|
15641
|
+
if (date < d1w1) {
|
15642
|
+
year = year - 1;
|
15643
|
+
d1w1 = getMondayOfFirstWeekOfYear(year);
|
15644
|
+
} else {
|
15645
|
+
const tv = getMondayOfFirstWeekOfYear(year + 1);
|
15646
|
+
if (date >= tv) {
|
15647
|
+
year = year + 1;
|
15648
|
+
d1w1 = tv;
|
15649
|
+
}
|
15650
|
+
}
|
15651
|
+
const diffTime = Math.abs(date.getTime() - d1w1.getTime());
|
15652
|
+
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
15653
|
+
return Math.floor(diffDays / 7) + 1;
|
15654
|
+
}
|
15655
|
+
function isWithinRange(date, range) {
|
15656
|
+
return isAfter(date, range[0]) && isBefore(date, range[1]);
|
15657
|
+
}
|
15658
|
+
function isValid(date) {
|
15659
|
+
const d = new Date(date);
|
15660
|
+
return d instanceof Date && !isNaN(d.getTime());
|
15661
|
+
}
|
15662
|
+
function isAfter(date, comparing) {
|
15663
|
+
return date.getTime() > comparing.getTime();
|
15664
|
+
}
|
15665
|
+
function isBefore(date, comparing) {
|
15666
|
+
return date.getTime() < comparing.getTime();
|
15667
|
+
}
|
15668
|
+
function isEqual(date, comparing) {
|
15669
|
+
return date.getTime() === comparing.getTime();
|
15670
|
+
}
|
15671
|
+
function isSameDay(date, comparing) {
|
15672
|
+
return date.getDate() === comparing.getDate() && date.getMonth() === comparing.getMonth() && date.getFullYear() === comparing.getFullYear();
|
15673
|
+
}
|
15674
|
+
function isSameMonth(date, comparing) {
|
15675
|
+
return date.getMonth() === comparing.getMonth() && date.getFullYear() === comparing.getFullYear();
|
15676
|
+
}
|
15677
|
+
function getDiff(date, comparing, unit) {
|
15678
|
+
const d = new Date(date);
|
15679
|
+
const c = new Date(comparing);
|
15680
|
+
if (unit === 'month') {
|
15681
|
+
return d.getMonth() - c.getMonth() + (d.getFullYear() - c.getFullYear()) * 12;
|
15682
|
+
}
|
15683
|
+
return Math.floor((d.getTime() - c.getTime()) / (1000 * 60 * 60 * 24));
|
15684
|
+
}
|
15685
|
+
function setYear(date, year) {
|
15686
|
+
const d = new Date(date);
|
15687
|
+
d.setFullYear(year);
|
15688
|
+
return d;
|
15689
|
+
}
|
15690
|
+
class VuetifyDateAdapter {
|
15691
|
+
constructor() {
|
15692
|
+
let locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
|
15693
|
+
this.locale = locale;
|
15694
|
+
}
|
15695
|
+
date(value) {
|
15696
|
+
return date(value);
|
15697
|
+
}
|
15698
|
+
addDays(date, amount) {
|
15699
|
+
return addDays(date, amount);
|
15700
|
+
}
|
15701
|
+
addMonths(date, amount) {
|
15702
|
+
return addMonths(date, amount);
|
15703
|
+
}
|
15704
|
+
getWeekArray(date) {
|
15705
|
+
return getWeekArray(date);
|
15706
|
+
}
|
15707
|
+
startOfMonth(date) {
|
15708
|
+
return startOfMonth(date);
|
15709
|
+
}
|
15710
|
+
endOfMonth(date) {
|
15711
|
+
return endOfMonth(date);
|
15712
|
+
}
|
15713
|
+
format(date, formatString) {
|
15714
|
+
return format(date, formatString, this.locale);
|
15715
|
+
}
|
15716
|
+
isEqual(date, comparing) {
|
15717
|
+
return isEqual(date, comparing);
|
15718
|
+
}
|
15719
|
+
isValid(date) {
|
15720
|
+
return isValid(date);
|
15721
|
+
}
|
15722
|
+
isWithinRange(date, range) {
|
15723
|
+
return isWithinRange(date, range);
|
15724
|
+
}
|
15725
|
+
isAfter(date, comparing) {
|
15726
|
+
return isAfter(date, comparing);
|
15727
|
+
}
|
15728
|
+
isSameDay(date, comparing) {
|
15729
|
+
return isSameDay(date, comparing);
|
15730
|
+
}
|
15731
|
+
isSameMonth(date, comparing) {
|
15732
|
+
return isSameMonth(date, comparing);
|
15733
|
+
}
|
15734
|
+
setYear(date, year) {
|
15735
|
+
return setYear(date, year);
|
15736
|
+
}
|
15737
|
+
getDiff(date, comparing, unit) {
|
15738
|
+
return getDiff(date, comparing, unit);
|
15739
|
+
}
|
15740
|
+
getWeek(date) {
|
15741
|
+
return getWeek(date);
|
15742
|
+
}
|
15743
|
+
getWeekdays() {
|
15744
|
+
return getWeekdays(this.locale);
|
15745
|
+
}
|
15746
|
+
getYear(date) {
|
15747
|
+
return getYear(date);
|
15748
|
+
}
|
15749
|
+
getMonth(date) {
|
15750
|
+
return getMonth(date);
|
15751
|
+
}
|
15752
|
+
startOfYear(date) {
|
15753
|
+
return startOfYear(date);
|
15754
|
+
}
|
15755
|
+
endOfYear(date) {
|
15756
|
+
return endOfYear(date);
|
15757
|
+
}
|
15758
|
+
}
|
15759
|
+
|
15760
|
+
// Composables
|
15761
|
+
|
15762
|
+
// Types
|
15763
|
+
|
15764
|
+
const DateAdapterSymbol = Symbol.for('vuetify:date-adapter');
|
15765
|
+
function createDate(options) {
|
15766
|
+
return options ?? {
|
15767
|
+
adapter: VuetifyDateAdapter
|
15768
|
+
};
|
15769
|
+
}
|
15770
|
+
function useDate(props) {
|
15771
|
+
const date = inject$1(DateAdapterSymbol);
|
15772
|
+
const locale = useLocale();
|
15773
|
+
if (!date) throw new Error('[Vuetify] Could not find injected date');
|
15774
|
+
|
15775
|
+
// eslint-disable-next-line new-cap
|
15776
|
+
const instance = new date.adapter(locale.current.value);
|
15777
|
+
watch(locale.current, val => {
|
15778
|
+
instance.locale = val;
|
15779
|
+
}, {
|
15780
|
+
immediate: true
|
15781
|
+
});
|
15782
|
+
return instance;
|
15783
|
+
}
|
15784
|
+
|
15122
15785
|
function useSticky(_ref) {
|
15123
15786
|
let {
|
15124
15787
|
rootEl,
|
@@ -16123,7 +16786,7 @@ const VRadioGroup = genericComponent()({
|
|
16123
16786
|
const model = useProxiedModel(props, 'modelValue');
|
16124
16787
|
useRender(() => {
|
16125
16788
|
const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
|
16126
|
-
const [inputProps, _1] =
|
16789
|
+
const [inputProps, _1] = VInput.filterProps(props);
|
16127
16790
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
16128
16791
|
const label = slots.label ? slots.label({
|
16129
16792
|
label: props.label,
|
@@ -16188,11 +16851,14 @@ const VRangeSlider = genericComponent()({
|
|
16188
16851
|
},
|
16189
16852
|
emits: {
|
16190
16853
|
'update:focused': value => true,
|
16191
|
-
'update:modelValue': value => true
|
16854
|
+
'update:modelValue': value => true,
|
16855
|
+
end: value => true,
|
16856
|
+
start: value => true
|
16192
16857
|
},
|
16193
16858
|
setup(props, _ref) {
|
16194
16859
|
let {
|
16195
|
-
slots
|
16860
|
+
slots,
|
16861
|
+
emit
|
16196
16862
|
} = _ref;
|
16197
16863
|
const startThumbRef = ref();
|
16198
16864
|
const stopThumbRef = ref();
|
@@ -16205,6 +16871,11 @@ const VRangeSlider = genericComponent()({
|
|
16205
16871
|
const b = Math.abs(stopOffset);
|
16206
16872
|
return a < b || a === b && startOffset < 0 ? startThumbRef.value.$el : stopThumbRef.value.$el;
|
16207
16873
|
}
|
16874
|
+
const steps = useSteps(props);
|
16875
|
+
const model = useProxiedModel(props, 'modelValue', undefined, arr => {
|
16876
|
+
if (!arr?.length) return [0, 0];
|
16877
|
+
return arr.map(value => steps.roundValue(value));
|
16878
|
+
});
|
16208
16879
|
const {
|
16209
16880
|
activeThumbRef,
|
16210
16881
|
hasLabels,
|
@@ -16214,34 +16885,37 @@ const VRangeSlider = genericComponent()({
|
|
16214
16885
|
onSliderMousedown,
|
16215
16886
|
onSliderTouchstart,
|
16216
16887
|
position,
|
16217
|
-
roundValue,
|
16218
16888
|
trackContainerRef
|
16219
16889
|
} = useSlider({
|
16220
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
16221
16890
|
props,
|
16222
|
-
|
16223
|
-
|
16891
|
+
steps,
|
16892
|
+
onSliderStart: () => {
|
16893
|
+
emit('start', model.value);
|
16224
16894
|
},
|
16225
|
-
|
16895
|
+
onSliderEnd: _ref2 => {
|
16896
|
+
let {
|
16897
|
+
value
|
16898
|
+
} = _ref2;
|
16899
|
+
const newValue = activeThumbRef.value === startThumbRef.value?.$el ? [value, model.value[1]] : [model.value[0], value];
|
16900
|
+
model.value = newValue;
|
16901
|
+
emit('end', newValue);
|
16902
|
+
},
|
16903
|
+
onSliderMove: _ref3 => {
|
16904
|
+
let {
|
16905
|
+
value
|
16906
|
+
} = _ref3;
|
16226
16907
|
const [start, stop] = model.value;
|
16227
16908
|
if (!props.strict && start === stop && start !== min.value) {
|
16228
|
-
activeThumbRef.value =
|
16909
|
+
activeThumbRef.value = value > start ? stopThumbRef.value?.$el : startThumbRef.value?.$el;
|
16229
16910
|
activeThumbRef.value?.focus();
|
16230
16911
|
}
|
16231
16912
|
if (activeThumbRef.value === startThumbRef.value?.$el) {
|
16232
|
-
model.value = [Math.min(
|
16913
|
+
model.value = [Math.min(value, stop), stop];
|
16233
16914
|
} else {
|
16234
|
-
model.value = [start, Math.max(start,
|
16915
|
+
model.value = [start, Math.max(start, value)];
|
16235
16916
|
}
|
16236
16917
|
},
|
16237
16918
|
getActiveThumb
|
16238
|
-
/* eslint-enable @typescript-eslint/no-use-before-define */
|
16239
|
-
});
|
16240
|
-
|
16241
|
-
const model = useProxiedModel(props, 'modelValue', undefined, arr => {
|
16242
|
-
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
16243
|
-
if (!arr || !arr.length) return [0, 0];
|
16244
|
-
return arr.map(value => roundValue(value));
|
16245
16919
|
});
|
16246
16920
|
const {
|
16247
16921
|
isFocused,
|
@@ -16251,7 +16925,7 @@ const VRangeSlider = genericComponent()({
|
|
16251
16925
|
const trackStart = computed(() => position(model.value[0]));
|
16252
16926
|
const trackStop = computed(() => position(model.value[1]));
|
16253
16927
|
useRender(() => {
|
16254
|
-
const [inputProps, _] =
|
16928
|
+
const [inputProps, _] = VInput.filterProps(props);
|
16255
16929
|
const hasPrepend = !!(props.label || slots.label || slots.prepend);
|
16256
16930
|
return createVNode(VInput, mergeProps({
|
16257
16931
|
"class": ['v-slider', 'v-range-slider', {
|
@@ -16269,11 +16943,11 @@ const VRangeSlider = genericComponent()({
|
|
16269
16943
|
"class": "v-slider__label",
|
16270
16944
|
"text": props.label
|
16271
16945
|
}, null) : undefined, slots.prepend?.(slotProps)]) : undefined,
|
16272
|
-
default:
|
16946
|
+
default: _ref4 => {
|
16273
16947
|
let {
|
16274
16948
|
id,
|
16275
16949
|
messagesId
|
16276
|
-
} =
|
16950
|
+
} = _ref4;
|
16277
16951
|
return createVNode("div", {
|
16278
16952
|
"class": "v-slider__container",
|
16279
16953
|
"onMousedown": onSliderMousedown,
|
@@ -17096,10 +17770,12 @@ const VSwitch = genericComponent()({
|
|
17096
17770
|
}
|
17097
17771
|
useRender(() => {
|
17098
17772
|
const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
|
17099
|
-
const [inputProps, _1] =
|
17773
|
+
const [inputProps, _1] = VInput.filterProps(props);
|
17100
17774
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
17101
17775
|
const control = ref();
|
17102
|
-
function onClick() {
|
17776
|
+
function onClick(e) {
|
17777
|
+
e.stopPropagation();
|
17778
|
+
e.preventDefault();
|
17103
17779
|
control.value?.input?.click();
|
17104
17780
|
}
|
17105
17781
|
return createVNode(VInput, mergeProps({
|
@@ -17460,8 +18136,6 @@ const VTextarea = genericComponent()({
|
|
17460
18136
|
autofocus: Boolean,
|
17461
18137
|
counter: [Boolean, Number, String],
|
17462
18138
|
counterValue: Function,
|
17463
|
-
hint: String,
|
17464
|
-
persistentHint: Boolean,
|
17465
18139
|
prefix: String,
|
17466
18140
|
placeholder: String,
|
17467
18141
|
persistentPlaceholder: Boolean,
|
@@ -17516,9 +18190,6 @@ const VTextarea = genericComponent()({
|
|
17516
18190
|
const controlHeight = ref('');
|
17517
18191
|
const textareaRef = ref();
|
17518
18192
|
const isActive = computed(() => isFocused.value || props.persistentPlaceholder);
|
17519
|
-
const messages = computed(() => {
|
17520
|
-
return props.messages.length ? props.messages : isFocused.value || props.persistentHint ? props.hint : '';
|
17521
|
-
});
|
17522
18193
|
function onFocus() {
|
17523
18194
|
if (textareaRef.value !== document.activeElement) {
|
17524
18195
|
textareaRef.value?.focus();
|
@@ -17590,7 +18261,7 @@ const VTextarea = genericComponent()({
|
|
17590
18261
|
const [{
|
17591
18262
|
modelValue: _,
|
17592
18263
|
...inputProps
|
17593
|
-
}] =
|
18264
|
+
}] = VInput.filterProps(props);
|
17594
18265
|
const [fieldProps] = filterFieldProps(props);
|
17595
18266
|
return createVNode(VInput, mergeProps({
|
17596
18267
|
"ref": vInputRef,
|
@@ -17604,12 +18275,9 @@ const VTextarea = genericComponent()({
|
|
17604
18275
|
'v-textarea--auto-grow': props.autoGrow,
|
17605
18276
|
'v-textarea--no-resize': props.noResize || props.autoGrow,
|
17606
18277
|
'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant)
|
17607
|
-
}]
|
17608
|
-
"onClick:prepend": props['onClick:prepend'],
|
17609
|
-
"onClick:append": props['onClick:append']
|
18278
|
+
}]
|
17610
18279
|
}, rootAttrs, inputProps, {
|
17611
|
-
"focused": isFocused.value
|
17612
|
-
"messages": messages.value
|
18280
|
+
"focused": isFocused.value
|
17613
18281
|
}), {
|
17614
18282
|
...slots,
|
17615
18283
|
default: _ref2 => {
|
@@ -18491,6 +19159,7 @@ function createVuetify$1() {
|
|
18491
19159
|
const theme = createTheme(options.theme);
|
18492
19160
|
const icons = createIcons(options.icons);
|
18493
19161
|
const locale = createLocale(options.locale);
|
19162
|
+
const date = createDate(options.date);
|
18494
19163
|
const install = app => {
|
18495
19164
|
for (const key in directives) {
|
18496
19165
|
app.directive(key, directives[key]);
|
@@ -18511,6 +19180,7 @@ function createVuetify$1() {
|
|
18511
19180
|
app.provide(ThemeSymbol, theme);
|
18512
19181
|
app.provide(IconSymbol, icons);
|
18513
19182
|
app.provide(LocaleSymbol, locale);
|
19183
|
+
app.provide(DateAdapterSymbol, date);
|
18514
19184
|
if (IN_BROWSER && options.ssr) {
|
18515
19185
|
if (app.$nuxt) {
|
18516
19186
|
app.$nuxt.hook('app:suspense:resolve', () => {
|
@@ -18538,7 +19208,8 @@ function createVuetify$1() {
|
|
18538
19208
|
display: inject.call(this, DisplaySymbol),
|
18539
19209
|
theme: inject.call(this, ThemeSymbol),
|
18540
19210
|
icons: inject.call(this, IconSymbol),
|
18541
|
-
locale: inject.call(this, LocaleSymbol)
|
19211
|
+
locale: inject.call(this, LocaleSymbol),
|
19212
|
+
date: inject.call(this, DateAdapterSymbol)
|
18542
19213
|
});
|
18543
19214
|
}
|
18544
19215
|
}
|
@@ -18551,10 +19222,11 @@ function createVuetify$1() {
|
|
18551
19222
|
display,
|
18552
19223
|
theme,
|
18553
19224
|
icons,
|
18554
|
-
locale
|
19225
|
+
locale,
|
19226
|
+
date
|
18555
19227
|
};
|
18556
19228
|
}
|
18557
|
-
const version$1 = "4.0.0-dev-
|
19229
|
+
const version$1 = "4.0.0-dev-20230422.0";
|
18558
19230
|
createVuetify$1.version = version$1;
|
18559
19231
|
|
18560
19232
|
// Vue's inject() can only be used in setup
|
@@ -18574,8 +19246,8 @@ const createVuetify = function () {
|
|
18574
19246
|
...options
|
18575
19247
|
});
|
18576
19248
|
};
|
18577
|
-
const version = "4.0.0-dev-
|
19249
|
+
const version = "4.0.0-dev-20230422.0";
|
18578
19250
|
createVuetify.version = version;
|
18579
19251
|
|
18580
|
-
export { components, createVuetify, directives, useDisplay, useLayout, useLocale, useRtl, useTheme, version };
|
19252
|
+
export { components, createVuetify, directives, useDate, useDisplay, useLayout, useLocale, useRtl, useTheme, version };
|
18581
19253
|
//# sourceMappingURL=vuetify.esm.js.map
|