vuetify 3.3.13 → 3.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json/attributes.json +70 -66
- package/dist/json/importMap.json +12 -12
- package/dist/json/tags.json +5 -4
- package/dist/json/web-types.json +274 -185
- package/dist/vuetify-labs.css +565 -486
- package/dist/vuetify-labs.d.ts +831 -462
- package/dist/vuetify-labs.esm.js +453 -310
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +452 -309
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +318 -239
- package/dist/vuetify.d.ts +678 -301
- package/dist/vuetify.esm.js +253 -173
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +252 -172
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +842 -830
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.mts +6 -6
- package/lib/components/VAutocomplete/VAutocomplete.mjs +12 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.css +1 -1
- package/lib/components/VBadge/_variables.scss +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.css +13 -2
- package/lib/components/VBtnToggle/VBtnToggle.sass +3 -3
- package/lib/components/VBtnToggle/_variables.scss +2 -1
- package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +14 -11
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +203 -87
- package/lib/components/VColorPicker/VColorPickerEdit.css +4 -2
- package/lib/components/VColorPicker/VColorPickerPreview.css +11 -6
- package/lib/components/VCombobox/VCombobox.mjs +11 -1
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VField/VField.css +25 -7
- package/lib/components/VField/VField.sass +15 -1
- package/lib/components/VGrid/VGrid.css +153 -142
- package/lib/components/VIcon/VIcon.css +1 -0
- package/lib/components/VIcon/VIcon.sass +1 -0
- package/lib/components/VOverlay/useActivator.mjs +1 -1
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.css +3 -2
- package/lib/components/VRadio/index.d.mts +82 -23
- package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.mts +75 -109
- package/lib/components/VRangeSlider/index.d.mts +114 -33
- package/lib/components/VSelect/VSelect.mjs +12 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.mjs +19 -3
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +19 -5
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.css +8 -4
- package/lib/components/VSlider/VSliderTrack.css +22 -12
- package/lib/components/VSlider/index.d.mts +114 -33
- package/lib/components/VSwitch/VSwitch.css +7 -5
- package/lib/components/VSwitch/VSwitch.mjs +26 -16
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.sass +6 -4
- package/lib/components/VSwitch/_variables.scss +5 -3
- package/lib/components/VSwitch/index.d.mts +82 -23
- package/lib/components/VTable/VTable.css +3 -0
- package/lib/components/VTable/VTable.sass +4 -0
- package/lib/components/VTable/_variables.scss +3 -0
- package/lib/components/VTabs/VTab.mjs +2 -2
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.mjs +1 -0
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.css +19 -10
- package/lib/components/VTimeline/VTimeline.sass +5 -0
- package/lib/components/VToolbar/VToolbar.css +4 -2
- package/lib/components/index.d.mts +676 -299
- package/lib/composables/color.mjs +6 -1
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs +9 -9
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/theme.mjs +8 -7
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +3 -3
- package/lib/labs/VDateInput/index.d.mts +2 -2
- package/lib/labs/VDatePicker/VDateCard.mjs +3 -0
- package/lib/labs/VDatePicker/VDateCard.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePicker.mjs +51 -21
- package/lib/labs/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerControls.css +1 -1
- package/lib/labs/VDatePicker/VDatePickerControls.mjs +53 -35
- package/lib/labs/VDatePicker/VDatePickerControls.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerMonth.mjs +37 -28
- package/lib/labs/VDatePicker/VDatePickerMonth.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerYears.mjs +19 -17
- package/lib/labs/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/labs/VDatePicker/index.d.mts +148 -156
- package/lib/labs/VDateRangePicker/VDateRangeCard.mjs +3 -0
- package/lib/labs/VDateRangePicker/VDateRangeCard.mjs.map +1 -1
- package/lib/labs/VDateRangePicker/index.d.mts +59 -52
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/index.d.mts +8 -8
- package/lib/labs/components.d.mts +156 -164
- package/lib/locale/bg.mjs +23 -23
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/fa.mjs +16 -16
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/locale/no.mjs +1 -1
- package/lib/locale/no.mjs.map +1 -1
- package/lib/styles/tools/_rtl.sass +4 -2
- package/lib/styles/tools/_states.sass +5 -5
- package/lib/util/colorUtils.mjs +6 -0
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/helpers.mjs +10 -4
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/injectSelf.mjs +2 -1
- package/lib/util/injectSelf.mjs.map +1 -1
- package/package.json +2 -2
package/dist/vuetify-labs.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vuetify v3.3.
|
|
2
|
+
* Vuetify v3.3.15
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Fragment, reactive, computed, watchEffect, toRefs, capitalize, warn,
|
|
7
|
+
import { Fragment, reactive, computed, watchEffect, toRefs, capitalize, warn, ref, unref, provide, shallowRef, inject as inject$1, defineComponent as defineComponent$1, camelize, h, getCurrentInstance as getCurrentInstance$1, onBeforeUnmount, watch, readonly, onDeactivated, onActivated, onMounted, onScopeDispose, effectScope, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, Teleport, cloneVNode, createTextVNode, onBeforeUpdate, vModelText, withModifiers } from 'vue';
|
|
8
8
|
|
|
9
9
|
// Types
|
|
10
10
|
// eslint-disable-line vue/prefer-import-from-vue
|
|
@@ -229,14 +229,22 @@ function only(obj, include) {
|
|
|
229
229
|
include.forEach(prop => clone[prop] = obj[prop]);
|
|
230
230
|
return clone;
|
|
231
231
|
}
|
|
232
|
+
const onRE = /^on[^a-z]/;
|
|
233
|
+
const isOn = key => onRE.test(key);
|
|
234
|
+
const bubblingEvents = ['onAfterscriptexecute', 'onAnimationcancel', 'onAnimationend', 'onAnimationiteration', 'onAnimationstart', 'onAuxclick', 'onBeforeinput', 'onBeforescriptexecute', 'onChange', 'onClick', 'onCompositionend', 'onCompositionstart', 'onCompositionupdate', 'onContextmenu', 'onCopy', 'onCut', 'onDblclick', 'onFocusin', 'onFocusout', 'onFullscreenchange', 'onFullscreenerror', 'onGesturechange', 'onGestureend', 'onGesturestart', 'onGotpointercapture', 'onInput', 'onKeydown', 'onKeypress', 'onKeyup', 'onLostpointercapture', 'onMousedown', 'onMousemove', 'onMouseout', 'onMouseover', 'onMouseup', 'onMousewheel', 'onPaste', 'onPointercancel', 'onPointerdown', 'onPointerenter', 'onPointerleave', 'onPointermove', 'onPointerout', 'onPointerover', 'onPointerup', 'onReset', 'onSelect', 'onSubmit', 'onTouchcancel', 'onTouchend', 'onTouchmove', 'onTouchstart', 'onTransitioncancel', 'onTransitionend', 'onTransitionrun', 'onTransitionstart', 'onWheel'];
|
|
232
235
|
|
|
233
236
|
/**
|
|
234
237
|
* Filter attributes that should be applied to
|
|
235
|
-
* the root element of
|
|
238
|
+
* the root element of an input component. Remaining
|
|
236
239
|
* attributes should be passed to the <input> element inside.
|
|
237
240
|
*/
|
|
238
241
|
function filterInputAttrs(attrs) {
|
|
239
|
-
|
|
242
|
+
const [events, props] = pick(attrs, [onRE]);
|
|
243
|
+
const inputEvents = omit(events, bubblingEvents);
|
|
244
|
+
const [rootAttrs, inputAttrs] = pick(props, ['class', 'style', 'id', /^data-/]);
|
|
245
|
+
Object.assign(rootAttrs, events);
|
|
246
|
+
Object.assign(inputAttrs, inputEvents);
|
|
247
|
+
return [rootAttrs, inputAttrs];
|
|
240
248
|
}
|
|
241
249
|
function wrapInArray(v) {
|
|
242
250
|
return v == null ? [] : Array.isArray(v) ? v : [v];
|
|
@@ -389,8 +397,6 @@ function destructComputed(getter) {
|
|
|
389
397
|
function includes(arr, val) {
|
|
390
398
|
return arr.includes(val);
|
|
391
399
|
}
|
|
392
|
-
const onRE = /^on[^a-z]/;
|
|
393
|
-
const isOn = key => onRE.test(key);
|
|
394
400
|
function eventName(propName) {
|
|
395
401
|
return propName[2].toLowerCase() + propName.slice(3);
|
|
396
402
|
}
|
|
@@ -660,6 +666,94 @@ function unbindProps(el, props) {
|
|
|
660
666
|
});
|
|
661
667
|
}
|
|
662
668
|
|
|
669
|
+
/**
|
|
670
|
+
* WCAG 3.0 APCA perceptual contrast algorithm from https://github.com/Myndex/SAPC-APCA
|
|
671
|
+
* @licence https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
|
672
|
+
* @see https://www.w3.org/WAI/GL/task-forces/silver/wiki/Visual_Contrast_of_Text_Subgroup
|
|
673
|
+
*/
|
|
674
|
+
// Types
|
|
675
|
+
|
|
676
|
+
// MAGICAL NUMBERS
|
|
677
|
+
|
|
678
|
+
// sRGB Conversion to Relative Luminance (Y)
|
|
679
|
+
|
|
680
|
+
// Transfer Curve (aka "Gamma") for sRGB linearization
|
|
681
|
+
// Simple power curve vs piecewise described in docs
|
|
682
|
+
// Essentially, 2.4 best models actual display
|
|
683
|
+
// characteristics in combination with the total method
|
|
684
|
+
const mainTRC = 2.4;
|
|
685
|
+
const Rco = 0.2126729; // sRGB Red Coefficient (from matrix)
|
|
686
|
+
const Gco = 0.7151522; // sRGB Green Coefficient (from matrix)
|
|
687
|
+
const Bco = 0.0721750; // sRGB Blue Coefficient (from matrix)
|
|
688
|
+
|
|
689
|
+
// For Finding Raw SAPC Contrast from Relative Luminance (Y)
|
|
690
|
+
|
|
691
|
+
// Constants for SAPC Power Curve Exponents
|
|
692
|
+
// One pair for normal text, and one for reverse
|
|
693
|
+
// These are the "beating heart" of SAPC
|
|
694
|
+
const normBG = 0.55;
|
|
695
|
+
const normTXT = 0.58;
|
|
696
|
+
const revTXT = 0.57;
|
|
697
|
+
const revBG = 0.62;
|
|
698
|
+
|
|
699
|
+
// For Clamping and Scaling Values
|
|
700
|
+
|
|
701
|
+
const blkThrs = 0.03; // Level that triggers the soft black clamp
|
|
702
|
+
const blkClmp = 1.45; // Exponent for the soft black clamp curve
|
|
703
|
+
const deltaYmin = 0.0005; // Lint trap
|
|
704
|
+
const scaleBoW = 1.25; // Scaling for dark text on light
|
|
705
|
+
const scaleWoB = 1.25; // Scaling for light text on dark
|
|
706
|
+
const loConThresh = 0.078; // Threshold for new simple offset scale
|
|
707
|
+
const loConFactor = 12.82051282051282; // = 1/0.078,
|
|
708
|
+
const loConOffset = 0.06; // The simple offset
|
|
709
|
+
const loClip = 0.001; // Output clip (lint trap #2)
|
|
710
|
+
|
|
711
|
+
function APCAcontrast(text, background) {
|
|
712
|
+
// Linearize sRGB
|
|
713
|
+
const Rtxt = (text.r / 255) ** mainTRC;
|
|
714
|
+
const Gtxt = (text.g / 255) ** mainTRC;
|
|
715
|
+
const Btxt = (text.b / 255) ** mainTRC;
|
|
716
|
+
const Rbg = (background.r / 255) ** mainTRC;
|
|
717
|
+
const Gbg = (background.g / 255) ** mainTRC;
|
|
718
|
+
const Bbg = (background.b / 255) ** mainTRC;
|
|
719
|
+
|
|
720
|
+
// Apply the standard coefficients and sum to Y
|
|
721
|
+
let Ytxt = Rtxt * Rco + Gtxt * Gco + Btxt * Bco;
|
|
722
|
+
let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
|
|
723
|
+
|
|
724
|
+
// Soft clamp Y when near black.
|
|
725
|
+
// Now clamping all colors to prevent crossover errors
|
|
726
|
+
if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp;
|
|
727
|
+
if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp;
|
|
728
|
+
|
|
729
|
+
// Return 0 Early for extremely low ∆Y (lint trap #1)
|
|
730
|
+
if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0.0;
|
|
731
|
+
|
|
732
|
+
// SAPC CONTRAST
|
|
733
|
+
|
|
734
|
+
let outputContrast; // For weighted final values
|
|
735
|
+
if (Ybg > Ytxt) {
|
|
736
|
+
// For normal polarity, black text on white
|
|
737
|
+
// Calculate the SAPC contrast value and scale
|
|
738
|
+
|
|
739
|
+
const SAPC = (Ybg ** normBG - Ytxt ** normTXT) * scaleBoW;
|
|
740
|
+
|
|
741
|
+
// NEW! SAPC SmoothScale™
|
|
742
|
+
// Low Contrast Smooth Scale Rollout to prevent polarity reversal
|
|
743
|
+
// and also a low clip for very low contrasts (lint trap #2)
|
|
744
|
+
// much of this is for very low contrasts, less than 10
|
|
745
|
+
// therefore for most reversing needs, only loConOffset is important
|
|
746
|
+
outputContrast = SAPC < loClip ? 0.0 : SAPC < loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC - loConOffset;
|
|
747
|
+
} else {
|
|
748
|
+
// For reverse polarity, light text on dark
|
|
749
|
+
// WoB should always return negative value.
|
|
750
|
+
|
|
751
|
+
const SAPC = (Ybg ** revBG - Ytxt ** revTXT) * scaleWoB;
|
|
752
|
+
outputContrast = SAPC > -loClip ? 0.0 : SAPC > -loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC + loConOffset;
|
|
753
|
+
}
|
|
754
|
+
return outputContrast * 100;
|
|
755
|
+
}
|
|
756
|
+
|
|
663
757
|
/* eslint-disable no-console */
|
|
664
758
|
|
|
665
759
|
function consoleWarn(message) {
|
|
@@ -1016,36 +1110,13 @@ function getContrast(first, second) {
|
|
|
1016
1110
|
const dark = Math.min(l1, l2);
|
|
1017
1111
|
return (light + 0.05) / (dark + 0.05);
|
|
1018
1112
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
function useToggleScope(source, fn) {
|
|
1025
|
-
let scope;
|
|
1026
|
-
function start() {
|
|
1027
|
-
scope = effectScope();
|
|
1028
|
-
scope.run(() => fn.length ? fn(() => {
|
|
1029
|
-
scope?.stop();
|
|
1030
|
-
start();
|
|
1031
|
-
}) : fn());
|
|
1032
|
-
}
|
|
1033
|
-
watch(source, active => {
|
|
1034
|
-
if (active && !scope) {
|
|
1035
|
-
start();
|
|
1036
|
-
} else if (!active) {
|
|
1037
|
-
scope?.stop();
|
|
1038
|
-
scope = undefined;
|
|
1039
|
-
}
|
|
1040
|
-
}, {
|
|
1041
|
-
immediate: true
|
|
1042
|
-
});
|
|
1043
|
-
onScopeDispose(() => {
|
|
1044
|
-
scope?.stop();
|
|
1045
|
-
});
|
|
1113
|
+
function getForeground(color) {
|
|
1114
|
+
const blackContrast = Math.abs(APCAcontrast(parseColor(0), parseColor(color)));
|
|
1115
|
+
const whiteContrast = Math.abs(APCAcontrast(parseColor(0xffffff), parseColor(color)));
|
|
1116
|
+
return whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000';
|
|
1046
1117
|
}
|
|
1047
1118
|
|
|
1048
|
-
//
|
|
1119
|
+
// Utilities
|
|
1049
1120
|
|
|
1050
1121
|
// Types
|
|
1051
1122
|
|
|
@@ -1067,6 +1138,7 @@ function provideDefaults(defaults, options) {
|
|
|
1067
1138
|
const scoped = unref(options?.scoped);
|
|
1068
1139
|
const reset = unref(options?.reset);
|
|
1069
1140
|
const root = unref(options?.root);
|
|
1141
|
+
if (providedDefaults.value == null && !(scoped || reset || root)) return injectedDefaults.value;
|
|
1070
1142
|
let properties = mergeDeep(providedDefaults.value, {
|
|
1071
1143
|
prev: injectedDefaults.value
|
|
1072
1144
|
});
|
|
@@ -1122,16 +1194,16 @@ function internalUseDefaults() {
|
|
|
1122
1194
|
let [key] = _ref;
|
|
1123
1195
|
return key.startsWith(key[0].toUpperCase());
|
|
1124
1196
|
});
|
|
1125
|
-
|
|
1197
|
+
_subcomponentDefaults.value = subComponents.length ? Object.fromEntries(subComponents) : undefined;
|
|
1198
|
+
} else {
|
|
1199
|
+
_subcomponentDefaults.value = undefined;
|
|
1126
1200
|
}
|
|
1127
1201
|
});
|
|
1128
1202
|
function provideSubDefaults() {
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
provideDefaults(mergeDeep(injectSelf(DefaultsSymbol)?.value ?? {}, _subcomponentDefaults.value));
|
|
1134
|
-
});
|
|
1203
|
+
const injected = injectSelf(DefaultsSymbol, vm);
|
|
1204
|
+
provide(DefaultsSymbol, computed(() => {
|
|
1205
|
+
return _subcomponentDefaults.value ? mergeDeep(injected?.value ?? {}, _subcomponentDefaults.value) : injected?.value;
|
|
1206
|
+
}));
|
|
1135
1207
|
}
|
|
1136
1208
|
return {
|
|
1137
1209
|
props: _props,
|
|
@@ -1313,9 +1385,10 @@ function isPotentiallyScrollable(el) {
|
|
|
1313
1385
|
// Types
|
|
1314
1386
|
|
|
1315
1387
|
function injectSelf(key) {
|
|
1388
|
+
let vm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstance('injectSelf');
|
|
1316
1389
|
const {
|
|
1317
1390
|
provides
|
|
1318
|
-
} =
|
|
1391
|
+
} = vm;
|
|
1319
1392
|
if (provides && key in provides) {
|
|
1320
1393
|
// TS doesn't allow symbol as index type
|
|
1321
1394
|
return provides[key];
|
|
@@ -1792,6 +1865,34 @@ const defaultRtl = {
|
|
|
1792
1865
|
zhHant: false
|
|
1793
1866
|
};
|
|
1794
1867
|
|
|
1868
|
+
// Utilities
|
|
1869
|
+
|
|
1870
|
+
// Types
|
|
1871
|
+
|
|
1872
|
+
function useToggleScope(source, fn) {
|
|
1873
|
+
let scope;
|
|
1874
|
+
function start() {
|
|
1875
|
+
scope = effectScope();
|
|
1876
|
+
scope.run(() => fn.length ? fn(() => {
|
|
1877
|
+
scope?.stop();
|
|
1878
|
+
start();
|
|
1879
|
+
}) : fn());
|
|
1880
|
+
}
|
|
1881
|
+
watch(source, active => {
|
|
1882
|
+
if (active && !scope) {
|
|
1883
|
+
start();
|
|
1884
|
+
} else if (!active) {
|
|
1885
|
+
scope?.stop();
|
|
1886
|
+
scope = undefined;
|
|
1887
|
+
}
|
|
1888
|
+
}, {
|
|
1889
|
+
immediate: true
|
|
1890
|
+
});
|
|
1891
|
+
onScopeDispose(() => {
|
|
1892
|
+
scope?.stop();
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1795
1896
|
// Composables
|
|
1796
1897
|
|
|
1797
1898
|
// Types
|
|
@@ -1993,94 +2094,6 @@ function useRtl() {
|
|
|
1993
2094
|
};
|
|
1994
2095
|
}
|
|
1995
2096
|
|
|
1996
|
-
/**
|
|
1997
|
-
* WCAG 3.0 APCA perceptual contrast algorithm from https://github.com/Myndex/SAPC-APCA
|
|
1998
|
-
* @licence https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
|
1999
|
-
* @see https://www.w3.org/WAI/GL/task-forces/silver/wiki/Visual_Contrast_of_Text_Subgroup
|
|
2000
|
-
*/
|
|
2001
|
-
// Types
|
|
2002
|
-
|
|
2003
|
-
// MAGICAL NUMBERS
|
|
2004
|
-
|
|
2005
|
-
// sRGB Conversion to Relative Luminance (Y)
|
|
2006
|
-
|
|
2007
|
-
// Transfer Curve (aka "Gamma") for sRGB linearization
|
|
2008
|
-
// Simple power curve vs piecewise described in docs
|
|
2009
|
-
// Essentially, 2.4 best models actual display
|
|
2010
|
-
// characteristics in combination with the total method
|
|
2011
|
-
const mainTRC = 2.4;
|
|
2012
|
-
const Rco = 0.2126729; // sRGB Red Coefficient (from matrix)
|
|
2013
|
-
const Gco = 0.7151522; // sRGB Green Coefficient (from matrix)
|
|
2014
|
-
const Bco = 0.0721750; // sRGB Blue Coefficient (from matrix)
|
|
2015
|
-
|
|
2016
|
-
// For Finding Raw SAPC Contrast from Relative Luminance (Y)
|
|
2017
|
-
|
|
2018
|
-
// Constants for SAPC Power Curve Exponents
|
|
2019
|
-
// One pair for normal text, and one for reverse
|
|
2020
|
-
// These are the "beating heart" of SAPC
|
|
2021
|
-
const normBG = 0.55;
|
|
2022
|
-
const normTXT = 0.58;
|
|
2023
|
-
const revTXT = 0.57;
|
|
2024
|
-
const revBG = 0.62;
|
|
2025
|
-
|
|
2026
|
-
// For Clamping and Scaling Values
|
|
2027
|
-
|
|
2028
|
-
const blkThrs = 0.03; // Level that triggers the soft black clamp
|
|
2029
|
-
const blkClmp = 1.45; // Exponent for the soft black clamp curve
|
|
2030
|
-
const deltaYmin = 0.0005; // Lint trap
|
|
2031
|
-
const scaleBoW = 1.25; // Scaling for dark text on light
|
|
2032
|
-
const scaleWoB = 1.25; // Scaling for light text on dark
|
|
2033
|
-
const loConThresh = 0.078; // Threshold for new simple offset scale
|
|
2034
|
-
const loConFactor = 12.82051282051282; // = 1/0.078,
|
|
2035
|
-
const loConOffset = 0.06; // The simple offset
|
|
2036
|
-
const loClip = 0.001; // Output clip (lint trap #2)
|
|
2037
|
-
|
|
2038
|
-
function APCAcontrast(text, background) {
|
|
2039
|
-
// Linearize sRGB
|
|
2040
|
-
const Rtxt = (text.r / 255) ** mainTRC;
|
|
2041
|
-
const Gtxt = (text.g / 255) ** mainTRC;
|
|
2042
|
-
const Btxt = (text.b / 255) ** mainTRC;
|
|
2043
|
-
const Rbg = (background.r / 255) ** mainTRC;
|
|
2044
|
-
const Gbg = (background.g / 255) ** mainTRC;
|
|
2045
|
-
const Bbg = (background.b / 255) ** mainTRC;
|
|
2046
|
-
|
|
2047
|
-
// Apply the standard coefficients and sum to Y
|
|
2048
|
-
let Ytxt = Rtxt * Rco + Gtxt * Gco + Btxt * Bco;
|
|
2049
|
-
let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
|
|
2050
|
-
|
|
2051
|
-
// Soft clamp Y when near black.
|
|
2052
|
-
// Now clamping all colors to prevent crossover errors
|
|
2053
|
-
if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp;
|
|
2054
|
-
if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp;
|
|
2055
|
-
|
|
2056
|
-
// Return 0 Early for extremely low ∆Y (lint trap #1)
|
|
2057
|
-
if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0.0;
|
|
2058
|
-
|
|
2059
|
-
// SAPC CONTRAST
|
|
2060
|
-
|
|
2061
|
-
let outputContrast; // For weighted final values
|
|
2062
|
-
if (Ybg > Ytxt) {
|
|
2063
|
-
// For normal polarity, black text on white
|
|
2064
|
-
// Calculate the SAPC contrast value and scale
|
|
2065
|
-
|
|
2066
|
-
const SAPC = (Ybg ** normBG - Ytxt ** normTXT) * scaleBoW;
|
|
2067
|
-
|
|
2068
|
-
// NEW! SAPC SmoothScale™
|
|
2069
|
-
// Low Contrast Smooth Scale Rollout to prevent polarity reversal
|
|
2070
|
-
// and also a low clip for very low contrasts (lint trap #2)
|
|
2071
|
-
// much of this is for very low contrasts, less than 10
|
|
2072
|
-
// therefore for most reversing needs, only loConOffset is important
|
|
2073
|
-
outputContrast = SAPC < loClip ? 0.0 : SAPC < loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC - loConOffset;
|
|
2074
|
-
} else {
|
|
2075
|
-
// For reverse polarity, light text on dark
|
|
2076
|
-
// WoB should always return negative value.
|
|
2077
|
-
|
|
2078
|
-
const SAPC = (Ybg ** revBG - Ytxt ** revTXT) * scaleWoB;
|
|
2079
|
-
outputContrast = SAPC > -loClip ? 0.0 : SAPC > -loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC + loConOffset;
|
|
2080
|
-
}
|
|
2081
|
-
return outputContrast * 100;
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2084
2097
|
// Utilities
|
|
2085
2098
|
|
|
2086
2099
|
// Types
|
|
@@ -2102,6 +2115,7 @@ const defaultThemeOptions = {
|
|
|
2102
2115
|
colors: {
|
|
2103
2116
|
background: '#FFFFFF',
|
|
2104
2117
|
surface: '#FFFFFF',
|
|
2118
|
+
'surface-bright': '#FFFFFF',
|
|
2105
2119
|
'surface-variant': '#424242',
|
|
2106
2120
|
'on-surface-variant': '#EEEEEE',
|
|
2107
2121
|
primary: '#6200EE',
|
|
@@ -2137,7 +2151,8 @@ const defaultThemeOptions = {
|
|
|
2137
2151
|
colors: {
|
|
2138
2152
|
background: '#121212',
|
|
2139
2153
|
surface: '#212121',
|
|
2140
|
-
'surface-
|
|
2154
|
+
'surface-bright': '#ccbfd6',
|
|
2155
|
+
'surface-variant': '#a3a3a3',
|
|
2141
2156
|
'on-surface-variant': '#424242',
|
|
2142
2157
|
primary: '#BB86FC',
|
|
2143
2158
|
'primary-darken-1': '#3700B3',
|
|
@@ -2216,8 +2231,6 @@ function createTheme(options) {
|
|
|
2216
2231
|
if (/^on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
|
|
2217
2232
|
const onColor = `on-${color}`;
|
|
2218
2233
|
const colorVal = parseColor(theme.colors[color]);
|
|
2219
|
-
const blackContrast = Math.abs(APCAcontrast(parseColor(0), colorVal));
|
|
2220
|
-
const whiteContrast = Math.abs(APCAcontrast(parseColor(0xffffff), colorVal));
|
|
2221
2234
|
|
|
2222
2235
|
// TODO: warn about poor color selections
|
|
2223
2236
|
// const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))
|
|
@@ -2229,7 +2242,7 @@ function createTheme(options) {
|
|
|
2229
2242
|
// }
|
|
2230
2243
|
|
|
2231
2244
|
// Prefer white text if both have an acceptable contrast ratio
|
|
2232
|
-
theme.colors[onColor] =
|
|
2245
|
+
theme.colors[onColor] = getForeground(colorVal);
|
|
2233
2246
|
}
|
|
2234
2247
|
}
|
|
2235
2248
|
return acc;
|
|
@@ -2330,12 +2343,14 @@ function provideTheme(props) {
|
|
|
2330
2343
|
const theme = inject$1(ThemeSymbol, null);
|
|
2331
2344
|
if (!theme) throw new Error('Could not find Vuetify theme injection');
|
|
2332
2345
|
const name = computed(() => {
|
|
2333
|
-
return props.theme ?? theme
|
|
2346
|
+
return props.theme ?? theme.name.value;
|
|
2334
2347
|
});
|
|
2348
|
+
const current = computed(() => theme.themes.value[name.value]);
|
|
2335
2349
|
const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${name.value}`);
|
|
2336
2350
|
const newTheme = {
|
|
2337
2351
|
...theme,
|
|
2338
2352
|
name,
|
|
2353
|
+
current,
|
|
2339
2354
|
themeClasses
|
|
2340
2355
|
};
|
|
2341
2356
|
provide(ThemeSymbol, newTheme);
|
|
@@ -3258,6 +3273,11 @@ function useColor(colors) {
|
|
|
3258
3273
|
if (colors.value.background) {
|
|
3259
3274
|
if (isCssColor(colors.value.background)) {
|
|
3260
3275
|
styles.backgroundColor = colors.value.background;
|
|
3276
|
+
if (!colors.value.text) {
|
|
3277
|
+
const textColor = getForeground(styles.backgroundColor);
|
|
3278
|
+
styles.color = textColor;
|
|
3279
|
+
styles.caretColor = textColor;
|
|
3280
|
+
}
|
|
3261
3281
|
} else {
|
|
3262
3282
|
classes.push(`bg-${colors.value.background}`);
|
|
3263
3283
|
}
|
|
@@ -5787,6 +5807,12 @@ function useSelectionControl(props) {
|
|
|
5787
5807
|
} = useTextColor(computed(() => {
|
|
5788
5808
|
return model.value && !props.error && !props.disabled ? props.color : undefined;
|
|
5789
5809
|
}));
|
|
5810
|
+
const {
|
|
5811
|
+
backgroundColorClasses,
|
|
5812
|
+
backgroundColorStyles
|
|
5813
|
+
} = useBackgroundColor(computed(() => {
|
|
5814
|
+
return model.value && !props.error && !props.disabled ? props.color : undefined;
|
|
5815
|
+
}));
|
|
5790
5816
|
const icon = computed(() => model.value ? props.trueIcon : props.falseIcon);
|
|
5791
5817
|
return {
|
|
5792
5818
|
group,
|
|
@@ -5796,6 +5822,8 @@ function useSelectionControl(props) {
|
|
|
5796
5822
|
model,
|
|
5797
5823
|
textColorClasses,
|
|
5798
5824
|
textColorStyles,
|
|
5825
|
+
backgroundColorClasses,
|
|
5826
|
+
backgroundColorStyles,
|
|
5799
5827
|
icon
|
|
5800
5828
|
};
|
|
5801
5829
|
}
|
|
@@ -5821,6 +5849,8 @@ const VSelectionControl = genericComponent()({
|
|
|
5821
5849
|
model,
|
|
5822
5850
|
textColorClasses,
|
|
5823
5851
|
textColorStyles,
|
|
5852
|
+
backgroundColorClasses,
|
|
5853
|
+
backgroundColorStyles,
|
|
5824
5854
|
trueValue
|
|
5825
5855
|
} = useSelectionControl(props);
|
|
5826
5856
|
const uid = getUid();
|
|
@@ -5885,12 +5915,17 @@ const VSelectionControl = genericComponent()({
|
|
|
5885
5915
|
}), [createVNode("div", {
|
|
5886
5916
|
"class": ['v-selection-control__wrapper', textColorClasses.value],
|
|
5887
5917
|
"style": textColorStyles.value
|
|
5888
|
-
}, [slots.default?.(
|
|
5918
|
+
}, [slots.default?.({
|
|
5919
|
+
backgroundColorClasses,
|
|
5920
|
+
backgroundColorStyles
|
|
5921
|
+
}), withDirectives(createVNode("div", {
|
|
5889
5922
|
"class": ['v-selection-control__input']
|
|
5890
5923
|
}, [slots.input?.({
|
|
5891
5924
|
model,
|
|
5892
5925
|
textColorClasses,
|
|
5893
5926
|
textColorStyles,
|
|
5927
|
+
backgroundColorClasses,
|
|
5928
|
+
backgroundColorStyles,
|
|
5894
5929
|
inputNode,
|
|
5895
5930
|
icon: icon.value,
|
|
5896
5931
|
props: {
|
|
@@ -5903,7 +5938,8 @@ const VSelectionControl = genericComponent()({
|
|
|
5903
5938
|
"icon": icon.value
|
|
5904
5939
|
}, null), inputNode])]), [[resolveDirective("ripple"), props.ripple && [!props.disabled && !props.readonly, null, ['center', 'circle']]]])]), label && createVNode(VLabel, {
|
|
5905
5940
|
"for": id.value,
|
|
5906
|
-
"clickable": true
|
|
5941
|
+
"clickable": true,
|
|
5942
|
+
"onClick": e => e.stopPropagation()
|
|
5907
5943
|
}, {
|
|
5908
5944
|
default: () => [label]
|
|
5909
5945
|
})]);
|
|
@@ -5952,16 +5988,19 @@ const VCheckboxBtn = genericComponent()({
|
|
|
5952
5988
|
const trueIcon = computed(() => {
|
|
5953
5989
|
return indeterminate.value ? props.indeterminateIcon : props.trueIcon;
|
|
5954
5990
|
});
|
|
5955
|
-
useRender(() =>
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5991
|
+
useRender(() => {
|
|
5992
|
+
const controlProps = omit(VSelectionControl.filterProps(props)[0], ['modelValue']);
|
|
5993
|
+
return createVNode(VSelectionControl, mergeProps(controlProps, {
|
|
5994
|
+
"modelValue": model.value,
|
|
5995
|
+
"onUpdate:modelValue": [$event => model.value = $event, onChange],
|
|
5996
|
+
"class": ['v-checkbox-btn', props.class],
|
|
5997
|
+
"style": props.style,
|
|
5998
|
+
"type": "checkbox",
|
|
5999
|
+
"falseIcon": falseIcon.value,
|
|
6000
|
+
"trueIcon": trueIcon.value,
|
|
6001
|
+
"aria-checked": indeterminate.value ? 'mixed' : undefined
|
|
6002
|
+
}), slots);
|
|
6003
|
+
});
|
|
5965
6004
|
return {};
|
|
5966
6005
|
}
|
|
5967
6006
|
});
|
|
@@ -6525,12 +6564,12 @@ const VCheckbox = genericComponent()({
|
|
|
6525
6564
|
const uid = getUid();
|
|
6526
6565
|
const id = computed(() => props.id || `checkbox-${uid}`);
|
|
6527
6566
|
useRender(() => {
|
|
6528
|
-
const [
|
|
6567
|
+
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
6529
6568
|
const [inputProps, _1] = VInput.filterProps(props);
|
|
6530
6569
|
const [checkboxProps, _2] = VCheckboxBtn.filterProps(props);
|
|
6531
6570
|
return createVNode(VInput, mergeProps({
|
|
6532
6571
|
"class": ['v-checkbox', props.class]
|
|
6533
|
-
},
|
|
6572
|
+
}, rootAttrs, inputProps, {
|
|
6534
6573
|
"modelValue": model.value,
|
|
6535
6574
|
"onUpdate:modelValue": $event => model.value = $event,
|
|
6536
6575
|
"id": id.value,
|
|
@@ -9097,7 +9136,7 @@ function _useActivator(props, vm, _ref2) {
|
|
|
9097
9136
|
if (selector) {
|
|
9098
9137
|
if (selector === 'parent') {
|
|
9099
9138
|
let el = vm?.proxy?.$el?.parentNode;
|
|
9100
|
-
while (el
|
|
9139
|
+
while (el?.hasAttribute('data-no-activator')) {
|
|
9101
9140
|
el = el.parentNode;
|
|
9102
9141
|
}
|
|
9103
9142
|
activator = el;
|
|
@@ -10858,6 +10897,7 @@ const VSelect = genericComponent()({
|
|
|
10858
10897
|
} = useLocale();
|
|
10859
10898
|
const vTextFieldRef = ref();
|
|
10860
10899
|
const vMenuRef = ref();
|
|
10900
|
+
const vVirtualScrollRef = ref();
|
|
10861
10901
|
const _menu = useProxiedModel(props, 'menu');
|
|
10862
10902
|
const menu = computed({
|
|
10863
10903
|
get: () => _menu.value,
|
|
@@ -10987,6 +11027,14 @@ const VSelect = genericComponent()({
|
|
|
10987
11027
|
vTextFieldRef.value.value = '';
|
|
10988
11028
|
}
|
|
10989
11029
|
}
|
|
11030
|
+
watch(menu, () => {
|
|
11031
|
+
if (!props.hideSelected && menu.value && selections.value.length) {
|
|
11032
|
+
const index = displayItems.value.findIndex(item => selections.value.some(s => item.value === s.value));
|
|
11033
|
+
IN_BROWSER && window.requestAnimationFrame(() => {
|
|
11034
|
+
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
|
11035
|
+
});
|
|
11036
|
+
}
|
|
11037
|
+
});
|
|
10990
11038
|
useRender(() => {
|
|
10991
11039
|
const hasChips = !!(props.chips || slots.chip);
|
|
10992
11040
|
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
|
@@ -11048,6 +11096,7 @@ const VSelect = genericComponent()({
|
|
|
11048
11096
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
|
11049
11097
|
"title": t(props.noDataText)
|
|
11050
11098
|
}, null)), createVNode(VVirtualScroll, {
|
|
11099
|
+
"ref": vVirtualScrollRef,
|
|
11051
11100
|
"renderless": true,
|
|
11052
11101
|
"items": displayItems.value
|
|
11053
11102
|
}, {
|
|
@@ -11308,6 +11357,7 @@ const VAutocomplete = genericComponent()({
|
|
|
11308
11357
|
const isPristine = shallowRef(true);
|
|
11309
11358
|
const listHasFocus = shallowRef(false);
|
|
11310
11359
|
const vMenuRef = ref();
|
|
11360
|
+
const vVirtualScrollRef = ref();
|
|
11311
11361
|
const _menu = useProxiedModel(props, 'menu');
|
|
11312
11362
|
const menu = computed({
|
|
11313
11363
|
get: () => _menu.value,
|
|
@@ -11398,7 +11448,7 @@ const VAutocomplete = genericComponent()({
|
|
|
11398
11448
|
menu.value = false;
|
|
11399
11449
|
}
|
|
11400
11450
|
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key)) {
|
|
11401
|
-
select(
|
|
11451
|
+
select(displayItems.value[0]);
|
|
11402
11452
|
}
|
|
11403
11453
|
if (e.key === 'ArrowDown' && highlightFirst.value) {
|
|
11404
11454
|
listRef.value?.focus('next');
|
|
@@ -11511,6 +11561,14 @@ const VAutocomplete = genericComponent()({
|
|
|
11511
11561
|
if (val) menu.value = true;
|
|
11512
11562
|
isPristine.value = !val;
|
|
11513
11563
|
});
|
|
11564
|
+
watch(menu, () => {
|
|
11565
|
+
if (!props.hideSelected && menu.value && selections.value.length) {
|
|
11566
|
+
const index = displayItems.value.findIndex(item => selections.value.some(s => item.value === s.value));
|
|
11567
|
+
IN_BROWSER && window.requestAnimationFrame(() => {
|
|
11568
|
+
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
|
11569
|
+
});
|
|
11570
|
+
}
|
|
11571
|
+
});
|
|
11514
11572
|
useRender(() => {
|
|
11515
11573
|
const hasChips = !!(props.chips || slots.chip);
|
|
11516
11574
|
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
|
@@ -11570,6 +11628,7 @@ const VAutocomplete = genericComponent()({
|
|
|
11570
11628
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
|
11571
11629
|
"title": t(props.noDataText)
|
|
11572
11630
|
}, null)), createVNode(VVirtualScroll, {
|
|
11631
|
+
"ref": vVirtualScrollRef,
|
|
11573
11632
|
"renderless": true,
|
|
11574
11633
|
"items": displayItems.value
|
|
11575
11634
|
}, {
|
|
@@ -14841,6 +14900,7 @@ const VCombobox = genericComponent()({
|
|
|
14841
14900
|
const isPristine = shallowRef(true);
|
|
14842
14901
|
const listHasFocus = shallowRef(false);
|
|
14843
14902
|
const vMenuRef = ref();
|
|
14903
|
+
const vVirtualScrollRef = ref();
|
|
14844
14904
|
const _menu = useProxiedModel(props, 'menu');
|
|
14845
14905
|
const menu = computed({
|
|
14846
14906
|
get: () => _menu.value,
|
|
@@ -15074,6 +15134,14 @@ const VCombobox = genericComponent()({
|
|
|
15074
15134
|
search.value = '';
|
|
15075
15135
|
}
|
|
15076
15136
|
});
|
|
15137
|
+
watch(menu, () => {
|
|
15138
|
+
if (!props.hideSelected && menu.value && selections.value.length) {
|
|
15139
|
+
const index = displayItems.value.findIndex(item => selections.value.some(s => item.value === s.value));
|
|
15140
|
+
IN_BROWSER && window.requestAnimationFrame(() => {
|
|
15141
|
+
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
|
15142
|
+
});
|
|
15143
|
+
}
|
|
15144
|
+
});
|
|
15077
15145
|
useRender(() => {
|
|
15078
15146
|
const hasChips = !!(props.chips || slots.chip);
|
|
15079
15147
|
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
|
@@ -15132,6 +15200,7 @@ const VCombobox = genericComponent()({
|
|
|
15132
15200
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
|
15133
15201
|
"title": t(props.noDataText)
|
|
15134
15202
|
}, null)), createVNode(VVirtualScroll, {
|
|
15203
|
+
"ref": vVirtualScrollRef,
|
|
15135
15204
|
"renderless": true,
|
|
15136
15205
|
"items": displayItems.value
|
|
15137
15206
|
}, {
|
|
@@ -17523,7 +17592,7 @@ const VRadioGroup = genericComponent()({
|
|
|
17523
17592
|
const id = computed(() => props.id || `radio-group-${uid}`);
|
|
17524
17593
|
const model = useProxiedModel(props, 'modelValue');
|
|
17525
17594
|
useRender(() => {
|
|
17526
|
-
const [
|
|
17595
|
+
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
17527
17596
|
const [inputProps, _1] = VInput.filterProps(props);
|
|
17528
17597
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
|
17529
17598
|
const label = slots.label ? slots.label({
|
|
@@ -17535,7 +17604,7 @@ const VRadioGroup = genericComponent()({
|
|
|
17535
17604
|
return createVNode(VInput, mergeProps({
|
|
17536
17605
|
"class": ['v-radio-group', props.class],
|
|
17537
17606
|
"style": props.style
|
|
17538
|
-
},
|
|
17607
|
+
}, rootAttrs, inputProps, {
|
|
17539
17608
|
"modelValue": model.value,
|
|
17540
17609
|
"onUpdate:modelValue": $event => model.value = $event,
|
|
17541
17610
|
"id": id.value
|
|
@@ -18512,6 +18581,7 @@ const VSwitch = genericComponent()({
|
|
|
18512
18581
|
focus,
|
|
18513
18582
|
blur
|
|
18514
18583
|
} = useFocus(props);
|
|
18584
|
+
const control = ref();
|
|
18515
18585
|
const loaderColor = computed(() => {
|
|
18516
18586
|
return typeof props.loading === 'string' && props.loading !== '' ? props.loading : props.color;
|
|
18517
18587
|
});
|
|
@@ -18522,16 +18592,15 @@ const VSwitch = genericComponent()({
|
|
|
18522
18592
|
indeterminate.value = false;
|
|
18523
18593
|
}
|
|
18524
18594
|
}
|
|
18595
|
+
function onTrackClick(e) {
|
|
18596
|
+
e.stopPropagation();
|
|
18597
|
+
e.preventDefault();
|
|
18598
|
+
control.value?.input?.click();
|
|
18599
|
+
}
|
|
18525
18600
|
useRender(() => {
|
|
18526
|
-
const [
|
|
18601
|
+
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
18527
18602
|
const [inputProps, _1] = VInput.filterProps(props);
|
|
18528
18603
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
|
18529
|
-
const control = ref();
|
|
18530
|
-
function onClick(e) {
|
|
18531
|
-
e.stopPropagation();
|
|
18532
|
-
e.preventDefault();
|
|
18533
|
-
control.value?.input?.click();
|
|
18534
|
-
}
|
|
18535
18604
|
return createVNode(VInput, mergeProps({
|
|
18536
18605
|
"class": ['v-switch', {
|
|
18537
18606
|
'v-switch--inset': props.inset
|
|
@@ -18539,7 +18608,7 @@ const VSwitch = genericComponent()({
|
|
|
18539
18608
|
'v-switch--indeterminate': indeterminate.value
|
|
18540
18609
|
}, loaderClasses.value, props.class],
|
|
18541
18610
|
"style": props.style
|
|
18542
|
-
},
|
|
18611
|
+
}, rootAttrs, inputProps, {
|
|
18543
18612
|
"id": id.value,
|
|
18544
18613
|
"focused": isFocused.value
|
|
18545
18614
|
}), {
|
|
@@ -18567,19 +18636,29 @@ const VSwitch = genericComponent()({
|
|
|
18567
18636
|
"onBlur": blur
|
|
18568
18637
|
}, controlAttrs), {
|
|
18569
18638
|
...slots,
|
|
18570
|
-
default:
|
|
18571
|
-
"class": "v-switch__track",
|
|
18572
|
-
"onClick": onClick
|
|
18573
|
-
}, null),
|
|
18574
|
-
input: _ref3 => {
|
|
18639
|
+
default: _ref3 => {
|
|
18575
18640
|
let {
|
|
18576
|
-
|
|
18577
|
-
|
|
18641
|
+
backgroundColorClasses,
|
|
18642
|
+
backgroundColorStyles
|
|
18578
18643
|
} = _ref3;
|
|
18644
|
+
return createVNode("div", {
|
|
18645
|
+
"class": ['v-switch__track', ...backgroundColorClasses.value],
|
|
18646
|
+
"style": backgroundColorStyles.value,
|
|
18647
|
+
"onClick": onTrackClick
|
|
18648
|
+
}, null);
|
|
18649
|
+
},
|
|
18650
|
+
input: _ref4 => {
|
|
18651
|
+
let {
|
|
18652
|
+
inputNode,
|
|
18653
|
+
icon,
|
|
18654
|
+
backgroundColorClasses,
|
|
18655
|
+
backgroundColorStyles
|
|
18656
|
+
} = _ref4;
|
|
18579
18657
|
return createVNode(Fragment, null, [inputNode, createVNode("div", {
|
|
18580
18658
|
"class": ['v-switch__thumb', {
|
|
18581
18659
|
'v-switch__thumb--filled': icon || props.loading
|
|
18582
|
-
}]
|
|
18660
|
+
}, props.inset ? undefined : backgroundColorClasses.value],
|
|
18661
|
+
"style": props.inset ? undefined : backgroundColorStyles.value
|
|
18583
18662
|
}, [createVNode(VScaleTransition, null, {
|
|
18584
18663
|
default: () => [!props.loading ? icon && createVNode(VIcon, {
|
|
18585
18664
|
"key": icon,
|
|
@@ -18720,8 +18799,8 @@ const VTab = genericComponent()({
|
|
|
18720
18799
|
const delta = prevPos > nextPos ? prevBox[rightBottom] - nextBox[rightBottom] : prevBox[xy] - nextBox[xy];
|
|
18721
18800
|
const origin = Math.sign(delta) > 0 ? isHorizontal.value ? 'right' : 'bottom' : Math.sign(delta) < 0 ? isHorizontal.value ? 'left' : 'top' : 'center';
|
|
18722
18801
|
const size = Math.abs(delta) + (Math.sign(delta) < 0 ? prevBox[widthHeight] : nextBox[widthHeight]);
|
|
18723
|
-
const scale = size / Math.max(prevBox[widthHeight], nextBox[widthHeight]);
|
|
18724
|
-
const initialScale = prevBox[widthHeight] / nextBox[widthHeight];
|
|
18802
|
+
const scale = size / Math.max(prevBox[widthHeight], nextBox[widthHeight]) || 0;
|
|
18803
|
+
const initialScale = prevBox[widthHeight] / nextBox[widthHeight] || 0;
|
|
18725
18804
|
const sigma = 1.5;
|
|
18726
18805
|
animate(nextEl, {
|
|
18727
18806
|
backgroundColor: [color, 'currentcolor'],
|
|
@@ -19117,6 +19196,7 @@ const VTextarea = genericComponent()({
|
|
|
19117
19196
|
once: true
|
|
19118
19197
|
}]]), props.autoGrow && withDirectives(createVNode("textarea", {
|
|
19119
19198
|
"class": [fieldClass, 'v-textarea__sizer'],
|
|
19199
|
+
"id": `${slotProps.id}-sizer`,
|
|
19120
19200
|
"onUpdate:modelValue": $event => model.value = $event,
|
|
19121
19201
|
"ref": sizerRef,
|
|
19122
19202
|
"readonly": true,
|
|
@@ -21721,6 +21801,98 @@ const VDataTableServer = genericComponent()({
|
|
|
21721
21801
|
}
|
|
21722
21802
|
});
|
|
21723
21803
|
|
|
21804
|
+
// Types
|
|
21805
|
+
|
|
21806
|
+
const makeVDatePickerControlsProps = propsFactory({
|
|
21807
|
+
displayDate: String,
|
|
21808
|
+
disabled: {
|
|
21809
|
+
type: [Boolean, String],
|
|
21810
|
+
default: false
|
|
21811
|
+
},
|
|
21812
|
+
nextIcon: {
|
|
21813
|
+
type: [String],
|
|
21814
|
+
default: '$next'
|
|
21815
|
+
},
|
|
21816
|
+
prevIcon: {
|
|
21817
|
+
type: [String],
|
|
21818
|
+
default: '$prev'
|
|
21819
|
+
},
|
|
21820
|
+
expandIcon: {
|
|
21821
|
+
type: [String],
|
|
21822
|
+
default: '$expand'
|
|
21823
|
+
},
|
|
21824
|
+
collapseIcon: {
|
|
21825
|
+
type: [String],
|
|
21826
|
+
default: '$collapse'
|
|
21827
|
+
},
|
|
21828
|
+
viewMode: {
|
|
21829
|
+
type: String,
|
|
21830
|
+
default: 'month'
|
|
21831
|
+
}
|
|
21832
|
+
}, 'VDatePickerControls');
|
|
21833
|
+
const VDatePickerControls = genericComponent()({
|
|
21834
|
+
name: 'VDatePickerControls',
|
|
21835
|
+
props: makeVDatePickerControlsProps(),
|
|
21836
|
+
emits: {
|
|
21837
|
+
'click:mode': () => true,
|
|
21838
|
+
'click:prev': () => true,
|
|
21839
|
+
'click:next': () => true
|
|
21840
|
+
},
|
|
21841
|
+
setup(props, _ref) {
|
|
21842
|
+
let {
|
|
21843
|
+
emit
|
|
21844
|
+
} = _ref;
|
|
21845
|
+
const modeIcon = computed(() => {
|
|
21846
|
+
return props.viewMode === 'month' ? props.expandIcon : props.collapseIcon;
|
|
21847
|
+
});
|
|
21848
|
+
const disableMode = computed(() => {
|
|
21849
|
+
return Array.isArray(props.disabled) ? props.disabled.includes('mode') : props.disabled;
|
|
21850
|
+
});
|
|
21851
|
+
const disablePrev = computed(() => {
|
|
21852
|
+
return Array.isArray(props.disabled) ? props.disabled.includes('prev') : props.disabled;
|
|
21853
|
+
});
|
|
21854
|
+
const disableNext = computed(() => {
|
|
21855
|
+
return Array.isArray(props.disabled) ? props.disabled.includes('next') : props.disabled;
|
|
21856
|
+
});
|
|
21857
|
+
function onClickPrev() {
|
|
21858
|
+
emit('click:prev');
|
|
21859
|
+
}
|
|
21860
|
+
function onClickNext() {
|
|
21861
|
+
emit('click:next');
|
|
21862
|
+
}
|
|
21863
|
+
function onClickMode() {
|
|
21864
|
+
emit('click:mode');
|
|
21865
|
+
}
|
|
21866
|
+
useRender(() => {
|
|
21867
|
+
return createVNode("div", {
|
|
21868
|
+
"class": "v-date-picker-controls"
|
|
21869
|
+
}, [createVNode("div", {
|
|
21870
|
+
"class": "v-date-picker-controls__date"
|
|
21871
|
+
}, [props.displayDate]), createVNode(VBtn, {
|
|
21872
|
+
"disabled": disableMode.value,
|
|
21873
|
+
"key": "expand-btn",
|
|
21874
|
+
"icon": modeIcon.value,
|
|
21875
|
+
"variant": "text",
|
|
21876
|
+
"onClick": onClickMode
|
|
21877
|
+
}, null), createVNode(VSpacer, null, null), createVNode("div", {
|
|
21878
|
+
"key": "month-buttons",
|
|
21879
|
+
"class": "v-date-picker-controls__month"
|
|
21880
|
+
}, [createVNode(VBtn, {
|
|
21881
|
+
"disabled": disablePrev.value,
|
|
21882
|
+
"icon": props.prevIcon,
|
|
21883
|
+
"variant": "text",
|
|
21884
|
+
"onClick": onClickPrev
|
|
21885
|
+
}, null), createVNode(VBtn, {
|
|
21886
|
+
"disabled": disableNext.value,
|
|
21887
|
+
"icon": props.nextIcon,
|
|
21888
|
+
"variant": "text",
|
|
21889
|
+
"onClick": onClickNext
|
|
21890
|
+
}, null)])]);
|
|
21891
|
+
});
|
|
21892
|
+
return {};
|
|
21893
|
+
}
|
|
21894
|
+
});
|
|
21895
|
+
|
|
21724
21896
|
// Utilities
|
|
21725
21897
|
|
|
21726
21898
|
// Types
|
|
@@ -22289,76 +22461,6 @@ function createDateInput(props, isRange) {
|
|
|
22289
22461
|
};
|
|
22290
22462
|
}
|
|
22291
22463
|
|
|
22292
|
-
const makeVDatePickerControlsProps = propsFactory({
|
|
22293
|
-
nextIcon: {
|
|
22294
|
-
type: [String],
|
|
22295
|
-
default: '$next'
|
|
22296
|
-
},
|
|
22297
|
-
prevIcon: {
|
|
22298
|
-
type: [String],
|
|
22299
|
-
default: '$prev'
|
|
22300
|
-
},
|
|
22301
|
-
expandIcon: {
|
|
22302
|
-
type: [String],
|
|
22303
|
-
default: '$expand'
|
|
22304
|
-
},
|
|
22305
|
-
collapseIcon: {
|
|
22306
|
-
type: [String],
|
|
22307
|
-
default: '$collapse'
|
|
22308
|
-
},
|
|
22309
|
-
range: {
|
|
22310
|
-
default: false,
|
|
22311
|
-
type: [Boolean, String],
|
|
22312
|
-
validator: v => v === false || ['start', 'end'].includes(v)
|
|
22313
|
-
},
|
|
22314
|
-
...omit(makeDateProps(), ['modelValue', 'inputMode'])
|
|
22315
|
-
}, 'VDatePickerControls');
|
|
22316
|
-
const VDatePickerControls = genericComponent()({
|
|
22317
|
-
name: 'VDatePickerControls',
|
|
22318
|
-
props: makeVDatePickerControlsProps(),
|
|
22319
|
-
emits: {
|
|
22320
|
-
...omit(dateEmits, ['update:modelValue', 'update:inputMode'])
|
|
22321
|
-
},
|
|
22322
|
-
setup(props, _ref) {
|
|
22323
|
-
let {
|
|
22324
|
-
emit
|
|
22325
|
-
} = _ref;
|
|
22326
|
-
const adapter = useDate();
|
|
22327
|
-
const monthAndYear = computed(() => {
|
|
22328
|
-
const month = props.range === 'end' ? adapter.addMonths(props.displayDate, 1) : props.displayDate;
|
|
22329
|
-
return adapter.format(month, 'monthAndYear');
|
|
22330
|
-
});
|
|
22331
|
-
useRender(() => {
|
|
22332
|
-
const prevBtn = createVNode(VBtn, {
|
|
22333
|
-
"variant": "text",
|
|
22334
|
-
"icon": props.prevIcon,
|
|
22335
|
-
"onClick": () => emit('update:displayDate', adapter.addMonths(props.displayDate, -1))
|
|
22336
|
-
}, null);
|
|
22337
|
-
const nextBtn = createVNode(VBtn, {
|
|
22338
|
-
"variant": "text",
|
|
22339
|
-
"icon": props.nextIcon,
|
|
22340
|
-
"onClick": () => emit('update:displayDate', adapter.addMonths(props.displayDate, 1))
|
|
22341
|
-
}, null);
|
|
22342
|
-
return createVNode("div", {
|
|
22343
|
-
"class": "v-date-picker-controls"
|
|
22344
|
-
}, [props.viewMode === 'month' && props.range === 'start' && prevBtn, !!props.range && createVNode(VSpacer, {
|
|
22345
|
-
"key": "range-spacer"
|
|
22346
|
-
}, null), createVNode("div", {
|
|
22347
|
-
"class": "v-date-picker-controls__date"
|
|
22348
|
-
}, [monthAndYear.value]), createVNode(VBtn, {
|
|
22349
|
-
"key": "expand-btn",
|
|
22350
|
-
"variant": "text",
|
|
22351
|
-
"icon": props.viewMode === 'month' ? props.expandIcon : props.collapseIcon,
|
|
22352
|
-
"onClick": () => emit('update:viewMode', props.viewMode === 'month' ? 'year' : 'month')
|
|
22353
|
-
}, null), createVNode(VSpacer, null, null), props.viewMode === 'month' && !props.range && createVNode("div", {
|
|
22354
|
-
"class": "v-date-picker-controls__month",
|
|
22355
|
-
"key": "month-buttons"
|
|
22356
|
-
}, [prevBtn, nextBtn]), props.viewMode === 'month' && props.range === 'end' && nextBtn]);
|
|
22357
|
-
});
|
|
22358
|
-
return {};
|
|
22359
|
-
}
|
|
22360
|
-
});
|
|
22361
|
-
|
|
22362
22464
|
// Composables
|
|
22363
22465
|
|
|
22364
22466
|
// Types
|
|
@@ -22415,6 +22517,8 @@ const makeVDatePickerMonthProps = propsFactory({
|
|
|
22415
22517
|
side: {
|
|
22416
22518
|
type: String
|
|
22417
22519
|
},
|
|
22520
|
+
min: [Number, String, Date],
|
|
22521
|
+
max: [Number, String, Date],
|
|
22418
22522
|
...omit(makeDateProps(), ['inputMode', 'viewMode'])
|
|
22419
22523
|
}, 'VDatePickerMonth');
|
|
22420
22524
|
const VDatePickerMonth = genericComponent()({
|
|
@@ -22490,6 +22594,7 @@ const VDatePickerMonth = genericComponent()({
|
|
|
22490
22594
|
const startDate = validDates[0];
|
|
22491
22595
|
const endDate = validDates[1];
|
|
22492
22596
|
return days.map((date, index) => {
|
|
22597
|
+
const isDisabled = !!(props.min && adapter.isAfter(props.min, date) || props.max && adapter.isAfter(date, props.max));
|
|
22493
22598
|
const isStart = startDate && adapter.isSameDay(date, startDate);
|
|
22494
22599
|
const isEnd = endDate && adapter.isSameDay(date, endDate);
|
|
22495
22600
|
const isAdjacent = !adapter.isSameMonth(date, month.value);
|
|
@@ -22500,6 +22605,7 @@ const VDatePickerMonth = genericComponent()({
|
|
|
22500
22605
|
formatted: adapter.format(date, 'keyboardDate'),
|
|
22501
22606
|
year: adapter.getYear(date),
|
|
22502
22607
|
month: adapter.getMonth(date),
|
|
22608
|
+
isDisabled,
|
|
22503
22609
|
isWeekStart: index % 7 === 0,
|
|
22504
22610
|
isWeekEnd: index % 7 === 6,
|
|
22505
22611
|
isSelected: isStart || isEnd,
|
|
@@ -22642,50 +22748,55 @@ const VDatePickerMonth = genericComponent()({
|
|
|
22642
22748
|
"onTouchstart": handleMousedown
|
|
22643
22749
|
}, [!props.hideWeekdays && adapter.getWeekdays().map(weekDay => createVNode("div", {
|
|
22644
22750
|
"class": ['v-date-picker-month__day', 'v-date-picker-month__weekday']
|
|
22645
|
-
}, [weekDay])), daysInMonth.value.map((item, index) =>
|
|
22646
|
-
|
|
22647
|
-
|
|
22648
|
-
|
|
22649
|
-
'v-date-picker-month__day
|
|
22650
|
-
|
|
22651
|
-
|
|
22652
|
-
|
|
22653
|
-
|
|
22654
|
-
|
|
22655
|
-
|
|
22656
|
-
|
|
22657
|
-
|
|
22658
|
-
|
|
22659
|
-
|
|
22660
|
-
"
|
|
22661
|
-
|
|
22662
|
-
|
|
22663
|
-
|
|
22664
|
-
|
|
22665
|
-
|
|
22666
|
-
|
|
22667
|
-
|
|
22668
|
-
|
|
22669
|
-
|
|
22670
|
-
|
|
22671
|
-
|
|
22672
|
-
|
|
22751
|
+
}, [weekDay])), daysInMonth.value.map((item, index) => {
|
|
22752
|
+
const color = item.isSelected || item.isToday ? props.color : item.isHovered || item.isDisabled ? undefined : 'transparent';
|
|
22753
|
+
const variant = item.isDisabled ? 'text' : (item.isToday || item.isHovered) && !item.isSelected ? 'outlined' : 'flat';
|
|
22754
|
+
return createVNode("div", {
|
|
22755
|
+
"class": ['v-date-picker-month__day', {
|
|
22756
|
+
'v-date-picker-month__day--selected': item.isSelected,
|
|
22757
|
+
'v-date-picker-month__day--start': item.isStart,
|
|
22758
|
+
'v-date-picker-month__day--end': item.isEnd,
|
|
22759
|
+
'v-date-picker-month__day--adjacent': item.isAdjacent,
|
|
22760
|
+
'v-date-picker-month__day--hide-adjacent': item.isHidden,
|
|
22761
|
+
'v-date-picker-month__day--week-start': item.isWeekStart,
|
|
22762
|
+
'v-date-picker-month__day--week-end': item.isWeekEnd,
|
|
22763
|
+
'v-date-picker-month__day--hovered': item.isHovered
|
|
22764
|
+
}],
|
|
22765
|
+
"data-v-date": !item.isHidden && !item.isDisabled ? item.isoDate : undefined
|
|
22766
|
+
}, [item.inRange && createVNode("div", {
|
|
22767
|
+
"key": "in-range",
|
|
22768
|
+
"class": ['v-date-picker-month__day--range', backgroundColorClasses.value],
|
|
22769
|
+
"style": backgroundColorStyles.value
|
|
22770
|
+
}, null), item.inHover && !item.isStart && !item.isEnd && !item.isHovered && !item.inRange && createVNode("div", {
|
|
22771
|
+
"key": "in-hover",
|
|
22772
|
+
"class": "v-date-picker-month__day--hover"
|
|
22773
|
+
}, null), (props.showAdjacentMonths || !item.isAdjacent) && createVNode(VBtn, {
|
|
22774
|
+
"active": item.isSelected,
|
|
22775
|
+
"color": color,
|
|
22776
|
+
"disabled": item.isDisabled,
|
|
22777
|
+
"icon": true,
|
|
22778
|
+
"ripple": false,
|
|
22779
|
+
"variant": variant
|
|
22780
|
+
}, {
|
|
22781
|
+
default: () => [item.localized]
|
|
22782
|
+
})]);
|
|
22783
|
+
})])]);
|
|
22673
22784
|
}
|
|
22674
22785
|
});
|
|
22675
22786
|
|
|
22676
22787
|
const makeVDatePickerYearsProps = propsFactory({
|
|
22677
22788
|
color: String,
|
|
22678
|
-
min: Number,
|
|
22679
|
-
max: Number,
|
|
22680
22789
|
height: [String, Number],
|
|
22681
|
-
displayDate: null
|
|
22790
|
+
displayDate: null,
|
|
22791
|
+
min: [Number, String, Date],
|
|
22792
|
+
max: [Number, String, Date]
|
|
22682
22793
|
}, 'VDatePickerYears');
|
|
22683
22794
|
const VDatePickerYears = genericComponent()({
|
|
22684
22795
|
name: 'VDatePickerYears',
|
|
22685
22796
|
props: makeVDatePickerYearsProps(),
|
|
22686
22797
|
emits: {
|
|
22687
22798
|
'update:displayDate': date => true,
|
|
22688
|
-
'
|
|
22799
|
+
'click:mode': () => true
|
|
22689
22800
|
},
|
|
22690
22801
|
setup(props, _ref) {
|
|
22691
22802
|
let {
|
|
@@ -22694,8 +22805,8 @@ const VDatePickerYears = genericComponent()({
|
|
|
22694
22805
|
const adapter = useDate();
|
|
22695
22806
|
const displayYear = computed(() => adapter.getYear(props.displayDate ?? new Date()));
|
|
22696
22807
|
const years = computed(() => {
|
|
22697
|
-
const min = props.min
|
|
22698
|
-
const max = props.max
|
|
22808
|
+
const min = props.min ? adapter.date(props.min).getFullYear() : displayYear.value - 100;
|
|
22809
|
+
const max = props.max ? adapter.date(props.max).getFullYear() : displayYear.value + 50;
|
|
22699
22810
|
return createRange(max - min, min);
|
|
22700
22811
|
});
|
|
22701
22812
|
const yearRef = ref();
|
|
@@ -22711,19 +22822,21 @@ const VDatePickerYears = genericComponent()({
|
|
|
22711
22822
|
}
|
|
22712
22823
|
}, [createVNode("div", {
|
|
22713
22824
|
"class": "v-date-picker-years__content"
|
|
22714
|
-
}, [years.value.map(year =>
|
|
22715
|
-
|
|
22716
|
-
"variant": year === displayYear.value ? 'flat' : 'text',
|
|
22717
|
-
"rounded": "xl",
|
|
22718
|
-
"active": year === displayYear.value,
|
|
22719
|
-
"color": year === displayYear.value ? props.color : undefined,
|
|
22720
|
-
"onClick": () => {
|
|
22825
|
+
}, [years.value.map(year => {
|
|
22826
|
+
function onClick() {
|
|
22721
22827
|
emit('update:displayDate', adapter.setYear(props.displayDate, year));
|
|
22722
|
-
emit('
|
|
22723
|
-
}
|
|
22724
|
-
|
|
22725
|
-
|
|
22726
|
-
|
|
22828
|
+
emit('click:mode');
|
|
22829
|
+
}
|
|
22830
|
+
return createVNode(VBtn, {
|
|
22831
|
+
"ref": year === displayYear.value ? yearRef : undefined,
|
|
22832
|
+
"active": year === displayYear.value,
|
|
22833
|
+
"color": year === displayYear.value ? props.color : undefined,
|
|
22834
|
+
"rounded": "xl",
|
|
22835
|
+
"text": String(year),
|
|
22836
|
+
"variant": year === displayYear.value ? 'flat' : 'text',
|
|
22837
|
+
"onClick": onClick
|
|
22838
|
+
}, null);
|
|
22839
|
+
})])]));
|
|
22727
22840
|
return {};
|
|
22728
22841
|
}
|
|
22729
22842
|
});
|
|
@@ -23008,21 +23121,24 @@ const VDatePicker = genericComponent()({
|
|
|
23008
23121
|
const header = computed(() => model.value.length ? adapter.format(model.value[0], 'normalDateWithWeekday') : t(props.header));
|
|
23009
23122
|
const headerIcon = computed(() => inputMode.value === 'calendar' ? props.keyboardIcon : props.calendarIcon);
|
|
23010
23123
|
const headerTransition = computed(() => `date-picker-header${isReversing.value ? '-reverse' : ''}-transition`);
|
|
23011
|
-
|
|
23012
|
-
|
|
23013
|
-
|
|
23014
|
-
|
|
23015
|
-
|
|
23016
|
-
if (
|
|
23017
|
-
const
|
|
23018
|
-
|
|
23019
|
-
if (props.hideActions) {
|
|
23020
|
-
model.value = newModel;
|
|
23021
|
-
} else {
|
|
23022
|
-
temporaryModel.value = newModel;
|
|
23023
|
-
}
|
|
23124
|
+
const minDate = computed(() => props.min && adapter.isValid(props.min) ? adapter.date(props.min) : null);
|
|
23125
|
+
const maxDate = computed(() => props.max && adapter.isValid(props.max) ? adapter.date(props.max) : null);
|
|
23126
|
+
const disabled = computed(() => {
|
|
23127
|
+
if (!minDate.value && !maxDate.value) return false;
|
|
23128
|
+
const targets = [];
|
|
23129
|
+
if (minDate.value) {
|
|
23130
|
+
const date = adapter.addDays(adapter.startOfMonth(displayDate.value), -1);
|
|
23131
|
+
adapter.isAfter(minDate.value, date) && targets.push('prev');
|
|
23024
23132
|
}
|
|
23025
|
-
|
|
23133
|
+
if (maxDate.value) {
|
|
23134
|
+
const date = adapter.addDays(adapter.endOfMonth(displayDate.value), 1);
|
|
23135
|
+
adapter.isAfter(date, maxDate.value) && targets.push('next');
|
|
23136
|
+
}
|
|
23137
|
+
if (minDate.value?.getFullYear() === maxDate.value?.getFullYear()) {
|
|
23138
|
+
targets.push('mode');
|
|
23139
|
+
}
|
|
23140
|
+
return targets;
|
|
23141
|
+
});
|
|
23026
23142
|
watch(model, val => {
|
|
23027
23143
|
if (!isEqual(val, temporaryModel.value)) {
|
|
23028
23144
|
temporaryModel.value = val;
|
|
@@ -23037,6 +23153,21 @@ const VDatePicker = genericComponent()({
|
|
|
23037
23153
|
isReversing.value = adapter.isBefore(val[0], oldVal[0]);
|
|
23038
23154
|
}
|
|
23039
23155
|
});
|
|
23156
|
+
function updateFromInput(input, index) {
|
|
23157
|
+
const {
|
|
23158
|
+
isValid,
|
|
23159
|
+
date
|
|
23160
|
+
} = adapter;
|
|
23161
|
+
if (isValid(input)) {
|
|
23162
|
+
const newModel = model.value.slice();
|
|
23163
|
+
newModel[index] = date(input);
|
|
23164
|
+
if (props.hideActions) {
|
|
23165
|
+
model.value = newModel;
|
|
23166
|
+
} else {
|
|
23167
|
+
temporaryModel.value = newModel;
|
|
23168
|
+
}
|
|
23169
|
+
}
|
|
23170
|
+
}
|
|
23040
23171
|
function onClickCancel() {
|
|
23041
23172
|
emit('click:cancel');
|
|
23042
23173
|
}
|
|
@@ -23047,6 +23178,15 @@ const VDatePicker = genericComponent()({
|
|
|
23047
23178
|
function onClickAppend() {
|
|
23048
23179
|
inputMode.value = inputMode.value === 'calendar' ? 'keyboard' : 'calendar';
|
|
23049
23180
|
}
|
|
23181
|
+
function onClickNext() {
|
|
23182
|
+
displayDate.value = adapter.addMonths(displayDate.value, 1);
|
|
23183
|
+
}
|
|
23184
|
+
function onClickPrev() {
|
|
23185
|
+
displayDate.value = adapter.addMonths(displayDate.value, -1);
|
|
23186
|
+
}
|
|
23187
|
+
function onClickMode() {
|
|
23188
|
+
viewMode.value = viewMode.value === 'month' ? 'year' : 'month';
|
|
23189
|
+
}
|
|
23050
23190
|
const headerSlotProps = computed(() => ({
|
|
23051
23191
|
header: header.value,
|
|
23052
23192
|
appendIcon: headerIcon.value,
|
|
@@ -23068,10 +23208,11 @@ const VDatePicker = genericComponent()({
|
|
|
23068
23208
|
"key": "header"
|
|
23069
23209
|
}, headerSlotProps.value), null),
|
|
23070
23210
|
default: () => inputMode.value === 'calendar' ? createVNode(Fragment, null, [createVNode(VDatePickerControls, mergeProps(datePickerControlsProps, {
|
|
23071
|
-
"
|
|
23072
|
-
"
|
|
23073
|
-
"
|
|
23074
|
-
"
|
|
23211
|
+
"disabled": disabled.value,
|
|
23212
|
+
"displayDate": adapter.format(displayDate.value, 'monthAndYear'),
|
|
23213
|
+
"onClick:next": onClickNext,
|
|
23214
|
+
"onClick:prev": onClickPrev,
|
|
23215
|
+
"onClick:mode": onClickMode
|
|
23075
23216
|
}), null), createVNode(VFadeTransition, {
|
|
23076
23217
|
"hideOnLeave": true
|
|
23077
23218
|
}, {
|
|
@@ -23081,14 +23222,16 @@ const VDatePicker = genericComponent()({
|
|
|
23081
23222
|
"modelValue": temporaryModel.value,
|
|
23082
23223
|
"onUpdate:modelValue": $event => temporaryModel.value = $event,
|
|
23083
23224
|
"displayDate": displayDate.value,
|
|
23084
|
-
"
|
|
23225
|
+
"min": minDate.value,
|
|
23226
|
+
"max": maxDate.value
|
|
23085
23227
|
}), null) : createVNode(VDatePickerYears, mergeProps({
|
|
23086
23228
|
"key": "date-picker-years"
|
|
23087
23229
|
}, datePickerYearsProps, {
|
|
23088
23230
|
"displayDate": displayDate.value,
|
|
23089
23231
|
"onUpdate:displayDate": $event => displayDate.value = $event,
|
|
23090
|
-
"
|
|
23091
|
-
"
|
|
23232
|
+
"min": minDate.value,
|
|
23233
|
+
"max": maxDate.value,
|
|
23234
|
+
"onClick:mode": onClickMode
|
|
23092
23235
|
}), null)]
|
|
23093
23236
|
})]) : createVNode("div", {
|
|
23094
23237
|
"class": "v-date-picker__input"
|
|
@@ -24431,7 +24574,7 @@ function createVuetify$1() {
|
|
|
24431
24574
|
date
|
|
24432
24575
|
};
|
|
24433
24576
|
}
|
|
24434
|
-
const version$1 = "3.3.
|
|
24577
|
+
const version$1 = "3.3.15";
|
|
24435
24578
|
createVuetify$1.version = version$1;
|
|
24436
24579
|
|
|
24437
24580
|
// Vue's inject() can only be used in setup
|
|
@@ -24445,7 +24588,7 @@ function inject(key) {
|
|
|
24445
24588
|
|
|
24446
24589
|
/* eslint-disable local-rules/sort-imports */
|
|
24447
24590
|
|
|
24448
|
-
const version = "3.3.
|
|
24591
|
+
const version = "3.3.15";
|
|
24449
24592
|
|
|
24450
24593
|
/* eslint-disable local-rules/sort-imports */
|
|
24451
24594
|
|