vuetify 3.3.13 → 3.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json/attributes.json +70 -66
- package/dist/json/importMap-labs.json +4 -4
- package/dist/json/importMap.json +12 -12
- package/dist/json/tags.json +5 -4
- package/dist/json/web-types.json +180 -140
- package/dist/vuetify-labs.css +363 -304
- package/dist/vuetify-labs.d.ts +384 -236
- package/dist/vuetify-labs.esm.js +410 -297
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +409 -296
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +291 -232
- package/dist/vuetify.d.ts +232 -76
- package/dist/vuetify.esm.js +210 -160
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +209 -159
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +838 -827
- 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/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/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 +22 -7
- package/lib/components/VField/VField.sass +8 -1
- package/lib/components/VField/_variables.scss +1 -0
- package/lib/components/VGrid/VGrid.css +153 -142
- package/lib/components/VProgressLinear/VProgressLinear.css +3 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- 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 +2 -1
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- 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.mjs +9 -9
- package/lib/components/VSwitch/VSwitch.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 +228 -72
- 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 +2 -5
- 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 +4 -4
- 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/no.mjs +1 -1
- package/lib/locale/no.mjs.map +1 -1
- package/lib/styles/tools/_rtl.sass +4 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSlider.mjs","names":["VSliderThumb","VSliderTrack","makeVInputProps","VInput","VLabel","makeSliderProps","useSlider","useSteps","makeFocusProps","useFocus","useRtl","useProxiedModel","computed","ref","genericComponent","propsFactory","useRender","makeVSliderProps","modelValue","type","Number","String","default","VSlider","name","props","emits","value","v","start","end","setup","_ref","slots","emit","thumbContainerRef","rtlClasses","steps","model","undefined","roundValue","min","max","mousePressed","onSliderMousedown","onSliderTouchstart","trackContainerRef","position","hasLabels","readonly","onSliderStart","onSliderEnd","_ref2","roundedValue","onSliderMove","_ref3","getActiveThumb","$el","isFocused","focus","blur","trackStop","inputProps","_","filterProps","hasPrepend","label","prepend","_createVNode","_mergeProps","disabled","class","style","slotProps","_Fragment","id","_ref4","messagesId","elevation"],"sources":["../../../src/components/VSlider/VSlider.tsx"],"sourcesContent":["// Styles\nimport './VSlider.sass'\n\n// Components\nimport { VSliderThumb } from './VSliderThumb'\nimport { VSliderTrack } from './VSliderTrack'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VLabel } from '@/components/VLabel'\n\n// Composables\nimport { makeSliderProps, useSlider, useSteps } from './slider'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useRtl } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VInputSlot, VInputSlots } from '@/components/VInput/VInput'\n\nexport type VSliderSlots = VInputSlots & {\n label: VInputSlot\n 'tick-label': never\n 'thumb-label': never\n}\n\nexport const makeVSliderProps = propsFactory({\n ...makeFocusProps(),\n ...makeSliderProps(),\n ...makeVInputProps(),\n\n modelValue: {\n type: [Number, String],\n default: 0,\n },\n}, 'VSlider')\n\nexport const VSlider = genericComponent<VSliderSlots>()({\n name: 'VSlider',\n\n props: makeVSliderProps(),\n\n emits: {\n 'update:focused': (value: boolean) => true,\n 'update:modelValue': (v: number) => true,\n start: (value: number) => true,\n end: (value: number) => true,\n },\n\n setup (props, { slots, emit }) {\n const thumbContainerRef = ref()\n const { rtlClasses } = useRtl()\n\n const steps = useSteps(props)\n\n const model = useProxiedModel(\n props,\n 'modelValue',\n undefined,\n value => {\n return steps.roundValue(value == null ? steps.min.value : value)\n },\n )\n\n const {\n min,\n max,\n mousePressed,\n roundValue,\n onSliderMousedown,\n onSliderTouchstart,\n trackContainerRef,\n position,\n hasLabels,\n readonly,\n } = useSlider({\n props,\n steps,\n onSliderStart: () => {\n emit('start', model.value)\n },\n onSliderEnd: ({ value }) => {\n const roundedValue = roundValue(value)\n model.value = roundedValue\n emit('end', roundedValue)\n },\n onSliderMove: ({ value }) => model.value = roundValue(value),\n getActiveThumb: () => thumbContainerRef.value?.$el,\n })\n\n const { isFocused, focus, blur } = useFocus(props)\n const trackStop = computed(() => position(model.value))\n\n useRender(() => {\n const [inputProps, _] = VInput.filterProps(props)\n const hasPrepend = !!(props.label || slots.label || slots.prepend)\n\n return (\n <VInput\n class={[\n 'v-slider',\n {\n 'v-slider--has-labels': !!slots['tick-label'] || hasLabels.value,\n 'v-slider--focused': isFocused.value,\n 'v-slider--pressed': mousePressed.value,\n 'v-slider--disabled': props.disabled,\n },\n rtlClasses.value,\n props.class,\n ]}\n style={ props.style }\n { ...inputProps }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n prepend: hasPrepend ? slotProps => (\n <>\n { slots.label?.(slotProps) ?? props.label\n ? (\n <VLabel\n id={ slotProps.id.value }\n class=\"v-slider__label\"\n text={ props.label }\n />\n ) : undefined\n }\n\n { slots.prepend?.(slotProps) }\n </>\n ) : undefined,\n default: ({ id, messagesId }) => (\n <div\n class=\"v-slider__container\"\n onMousedown={ !readonly.value ? onSliderMousedown : undefined }\n onTouchstartPassive={ !readonly.value ? onSliderTouchstart : undefined }\n >\n <input\n id={ id.value }\n name={ props.name || id.value }\n disabled={ !!props.disabled }\n readonly={ !!props.readonly }\n tabindex=\"-1\"\n value={ model.value }\n />\n\n <VSliderTrack\n ref={ trackContainerRef }\n start={ 0 }\n stop={ trackStop.value }\n >\n {{ 'tick-label': slots['tick-label'] }}\n </VSliderTrack>\n\n <VSliderThumb\n ref={ thumbContainerRef }\n aria-describedby={ messagesId.value }\n focused={ isFocused.value }\n min={ min.value }\n max={ max.value }\n modelValue={ model.value }\n onUpdate:modelValue={ v => (model.value = v) }\n position={ trackStop.value }\n elevation={ props.elevation }\n onFocus={ focus }\n onBlur={ blur }\n >\n {{ 'thumb-label': slots['thumb-label'] }}\n </VSliderThumb>\n </div>\n ),\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSlider = InstanceType<typeof VSlider>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,YAAY;AAAA,SACZC,YAAY;AAAA,SACZC,eAAe,EAAEC,MAAM;AAAA,SACvBC,MAAM,+BAEf;AAAA,SACSC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IAAI;YAAA,SACLX,KAAK,CAACX;UAAK,UAAAyC,YAAA,CAAAnE,YAAA;YAAA,OAIb6C,iBAAiB;YAAA,SACf,CAAC;YAAA,QACFe,SAAS,CAAClC;UAAK;YAEnB,YAAY,EAAEM,KAAK,CAAC,YAAY;UAAC,IAAAmC,YAAA,CAAApE,YAAA;YAAA,OAI9BmC,iBAAiB;YAAA,oBACJ0C,UAAU,CAAClD,KAAK;YAAA,WACzB+B,SAAS,CAAC/B,KAAK;YAAA,OACnBc,GAAG,CAACd,KAAK;YAAA,OACTe,GAAG,CAACf,KAAK;YAAA,cACFW,KAAK,CAACX,KAAK;YAAA,uBACFC,CAAC,IAAKU,KAAK,CAACX,KAAK,GAAGC,CAAE;YAAA,YACjCiC,SAAS,CAAClC,KAAK;YAAA,aACdF,KAAK,CAACqD,SAAS;YAAA,WACjBnB,KAAK;YAAA,UACNC;UAAI;YAEV,aAAa,EAAE3B,KAAK,CAAC,aAAa;UAAC;QAAA;MAG3C;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VSlider.mjs","names":["VSliderThumb","VSliderTrack","makeVInputProps","VInput","VLabel","makeSliderProps","useSlider","useSteps","makeFocusProps","useFocus","useRtl","useProxiedModel","computed","ref","genericComponent","propsFactory","useRender","makeVSliderProps","modelValue","type","Number","String","default","VSlider","name","props","emits","value","v","start","end","setup","_ref","slots","emit","thumbContainerRef","rtlClasses","steps","model","undefined","roundValue","min","max","mousePressed","onSliderMousedown","onSliderTouchstart","trackContainerRef","position","hasLabels","readonly","onSliderStart","onSliderEnd","_ref2","roundedValue","onSliderMove","_ref3","getActiveThumb","$el","isFocused","focus","blur","trackStop","inputProps","_","filterProps","hasPrepend","label","prepend","_createVNode","_mergeProps","disabled","class","style","slotProps","_Fragment","id","_ref4","messagesId","elevation"],"sources":["../../../src/components/VSlider/VSlider.tsx"],"sourcesContent":["// Styles\nimport './VSlider.sass'\n\n// Components\nimport { VSliderThumb } from './VSliderThumb'\nimport { VSliderTrack } from './VSliderTrack'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VLabel } from '@/components/VLabel'\n\n// Composables\nimport { makeSliderProps, useSlider, useSteps } from './slider'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useRtl } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VSliderThumbSlots } from './VSliderThumb'\nimport type { VSliderTrackSlots } from './VSliderTrack'\nimport type { VInputSlot, VInputSlots } from '@/components/VInput/VInput'\n\nexport type VSliderSlots = VInputSlots & VSliderThumbSlots & VSliderTrackSlots & {\n label: VInputSlot\n}\n\nexport const makeVSliderProps = propsFactory({\n ...makeFocusProps(),\n ...makeSliderProps(),\n ...makeVInputProps(),\n\n modelValue: {\n type: [Number, String],\n default: 0,\n },\n}, 'VSlider')\n\nexport const VSlider = genericComponent<VSliderSlots>()({\n name: 'VSlider',\n\n props: makeVSliderProps(),\n\n emits: {\n 'update:focused': (value: boolean) => true,\n 'update:modelValue': (v: number) => true,\n start: (value: number) => true,\n end: (value: number) => true,\n },\n\n setup (props, { slots, emit }) {\n const thumbContainerRef = ref()\n const { rtlClasses } = useRtl()\n\n const steps = useSteps(props)\n\n const model = useProxiedModel(\n props,\n 'modelValue',\n undefined,\n value => {\n return steps.roundValue(value == null ? steps.min.value : value)\n },\n )\n\n const {\n min,\n max,\n mousePressed,\n roundValue,\n onSliderMousedown,\n onSliderTouchstart,\n trackContainerRef,\n position,\n hasLabels,\n readonly,\n } = useSlider({\n props,\n steps,\n onSliderStart: () => {\n emit('start', model.value)\n },\n onSliderEnd: ({ value }) => {\n const roundedValue = roundValue(value)\n model.value = roundedValue\n emit('end', roundedValue)\n },\n onSliderMove: ({ value }) => model.value = roundValue(value),\n getActiveThumb: () => thumbContainerRef.value?.$el,\n })\n\n const { isFocused, focus, blur } = useFocus(props)\n const trackStop = computed(() => position(model.value))\n\n useRender(() => {\n const [inputProps, _] = VInput.filterProps(props)\n const hasPrepend = !!(props.label || slots.label || slots.prepend)\n\n return (\n <VInput\n class={[\n 'v-slider',\n {\n 'v-slider--has-labels': !!slots['tick-label'] || hasLabels.value,\n 'v-slider--focused': isFocused.value,\n 'v-slider--pressed': mousePressed.value,\n 'v-slider--disabled': props.disabled,\n },\n rtlClasses.value,\n props.class,\n ]}\n style={ props.style }\n { ...inputProps }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n prepend: hasPrepend ? slotProps => (\n <>\n { slots.label?.(slotProps) ?? props.label\n ? (\n <VLabel\n id={ slotProps.id.value }\n class=\"v-slider__label\"\n text={ props.label }\n />\n ) : undefined\n }\n\n { slots.prepend?.(slotProps) }\n </>\n ) : undefined,\n default: ({ id, messagesId }) => (\n <div\n class=\"v-slider__container\"\n onMousedown={ !readonly.value ? onSliderMousedown : undefined }\n onTouchstartPassive={ !readonly.value ? onSliderTouchstart : undefined }\n >\n <input\n id={ id.value }\n name={ props.name || id.value }\n disabled={ !!props.disabled }\n readonly={ !!props.readonly }\n tabindex=\"-1\"\n value={ model.value }\n />\n\n <VSliderTrack\n ref={ trackContainerRef }\n start={ 0 }\n stop={ trackStop.value }\n >\n {{ 'tick-label': slots['tick-label'] }}\n </VSliderTrack>\n\n <VSliderThumb\n ref={ thumbContainerRef }\n aria-describedby={ messagesId.value }\n focused={ isFocused.value }\n min={ min.value }\n max={ max.value }\n modelValue={ model.value }\n onUpdate:modelValue={ v => (model.value = v) }\n position={ trackStop.value }\n elevation={ props.elevation }\n onFocus={ focus }\n onBlur={ blur }\n >\n {{ 'thumb-label': slots['thumb-label'] }}\n </VSliderThumb>\n </div>\n ),\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSlider = InstanceType<typeof VSlider>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,YAAY;AAAA,SACZC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,CAAC6C,QAAQ;YAAA,YAChB,CAAC,CAAC7C,KAAK,CAACwB,QAAQ;YAAA,YAClB,IAAI;YAAA,SACLX,KAAK,CAACX;UAAK,UAAAyC,YAAA,CAAAnE,YAAA;YAAA,OAIb6C,iBAAiB;YAAA,SACf,CAAC;YAAA,QACFe,SAAS,CAAClC;UAAK;YAEnB,YAAY,EAAEM,KAAK,CAAC,YAAY;UAAC,IAAAmC,YAAA,CAAApE,YAAA;YAAA,OAI9BmC,iBAAiB;YAAA,oBACJ0C,UAAU,CAAClD,KAAK;YAAA,WACzB+B,SAAS,CAAC/B,KAAK;YAAA,OACnBc,GAAG,CAACd,KAAK;YAAA,OACTe,GAAG,CAACf,KAAK;YAAA,cACFW,KAAK,CAACX,KAAK;YAAA,uBACFC,CAAC,IAAKU,KAAK,CAACX,KAAK,GAAGC,CAAE;YAAA,YACjCiC,SAAS,CAAClC,KAAK;YAAA,aACdF,KAAK,CAACqD,SAAS;YAAA,WACjBnB,KAAK;YAAA,UACNC;UAAI;YAEV,aAAa,EAAE3B,KAAK,CAAC,aAAa;UAAC;QAAA;MAG3C;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
@@ -90,12 +90,14 @@
|
|
|
90
90
|
top: 50%;
|
|
91
91
|
transform: translateY(-50%);
|
|
92
92
|
}
|
|
93
|
-
.v-slider.v-input--horizontal .v-slider-thumb
|
|
93
|
+
.v-locale--is-ltr.v-slider.v-input--horizontal .v-slider-thumb, .v-locale--is-ltr .v-slider.v-input--horizontal .v-slider-thumb {
|
|
94
94
|
left: calc(var(--v-slider-thumb-position) - var(--v-slider-thumb-size) / 2);
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
|
|
97
|
+
.v-locale--is-rtl.v-slider.v-input--horizontal .v-slider-thumb, .v-locale--is-rtl .v-slider.v-input--horizontal .v-slider-thumb {
|
|
97
98
|
right: calc(var(--v-slider-thumb-position) - var(--v-slider-thumb-size) / 2);
|
|
98
99
|
}
|
|
100
|
+
|
|
99
101
|
.v-slider.v-input--horizontal .v-slider-thumb__label-container {
|
|
100
102
|
left: calc(var(--v-slider-thumb-size) / 2);
|
|
101
103
|
top: 0;
|
|
@@ -103,12 +105,14 @@
|
|
|
103
105
|
.v-slider.v-input--horizontal .v-slider-thumb__label {
|
|
104
106
|
bottom: calc(var(--v-slider-thumb-size) / 2);
|
|
105
107
|
}
|
|
106
|
-
.v-slider.v-input--horizontal .v-slider-thumb__label
|
|
108
|
+
.v-locale--is-ltr.v-slider.v-input--horizontal .v-slider-thumb__label, .v-locale--is-ltr .v-slider.v-input--horizontal .v-slider-thumb__label {
|
|
107
109
|
transform: translateX(-50%);
|
|
108
110
|
}
|
|
109
|
-
|
|
111
|
+
|
|
112
|
+
.v-locale--is-rtl.v-slider.v-input--horizontal .v-slider-thumb__label, .v-locale--is-rtl .v-slider.v-input--horizontal .v-slider-thumb__label {
|
|
110
113
|
transform: translateX(50%);
|
|
111
114
|
}
|
|
115
|
+
|
|
112
116
|
.v-slider.v-input--horizontal .v-slider-thumb__label::before {
|
|
113
117
|
border-left: 6px solid transparent;
|
|
114
118
|
border-right: 6px solid transparent;
|
|
@@ -44,16 +44,19 @@
|
|
|
44
44
|
height: var(--v-slider-tick-size);
|
|
45
45
|
transform: translate(calc(var(--v-slider-tick-size) / -2), calc(var(--v-slider-tick-size) / -2));
|
|
46
46
|
}
|
|
47
|
-
.v-slider-track__tick--first .v-slider-track__tick-label
|
|
47
|
+
.v-locale--is-ltr.v-slider-track__tick--first .v-slider-track__tick-label, .v-locale--is-ltr .v-slider-track__tick--first .v-slider-track__tick-label {
|
|
48
48
|
transform: none;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
.v-locale--is-rtl.v-slider-track__tick--first .v-slider-track__tick-label, .v-locale--is-rtl .v-slider-track__tick--first .v-slider-track__tick-label {
|
|
51
52
|
transform: translateX(100%);
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
|
|
55
|
+
.v-locale--is-ltr.v-slider-track__tick--last .v-slider-track__tick-label, .v-locale--is-ltr .v-slider-track__tick--last .v-slider-track__tick-label {
|
|
54
56
|
transform: translateX(-100%);
|
|
55
57
|
}
|
|
56
|
-
|
|
58
|
+
|
|
59
|
+
.v-locale--is-rtl.v-slider-track__tick--last .v-slider-track__tick-label, .v-locale--is-rtl .v-slider-track__tick--last .v-slider-track__tick-label {
|
|
57
60
|
transform: none;
|
|
58
61
|
}
|
|
59
62
|
|
|
@@ -79,34 +82,40 @@
|
|
|
79
82
|
.v-slider.v-input--horizontal .v-slider-track__tick {
|
|
80
83
|
margin-top: calc(calc(var(--v-slider-track-size) + 2px) / 2);
|
|
81
84
|
}
|
|
82
|
-
.v-slider.v-input--horizontal .v-slider-track__tick
|
|
85
|
+
.v-locale--is-rtl.v-slider.v-input--horizontal .v-slider-track__tick, .v-locale--is-rtl .v-slider.v-input--horizontal .v-slider-track__tick {
|
|
83
86
|
transform: translate(calc(var(--v-slider-tick-size) / 2), calc(var(--v-slider-tick-size) / -2));
|
|
84
87
|
}
|
|
88
|
+
|
|
85
89
|
.v-slider.v-input--horizontal .v-slider-track__tick .v-slider-track__tick-label {
|
|
86
90
|
margin-top: calc(var(--v-slider-track-size) / 2 + 8px);
|
|
87
91
|
}
|
|
88
|
-
.v-slider.v-input--horizontal .v-slider-track__tick .v-slider-track__tick-label
|
|
92
|
+
.v-locale--is-ltr.v-slider.v-input--horizontal .v-slider-track__tick .v-slider-track__tick-label, .v-locale--is-ltr .v-slider.v-input--horizontal .v-slider-track__tick .v-slider-track__tick-label {
|
|
89
93
|
transform: translateX(-50%);
|
|
90
94
|
}
|
|
91
|
-
|
|
95
|
+
|
|
96
|
+
.v-locale--is-rtl.v-slider.v-input--horizontal .v-slider-track__tick .v-slider-track__tick-label, .v-locale--is-rtl .v-slider.v-input--horizontal .v-slider-track__tick .v-slider-track__tick-label {
|
|
92
97
|
transform: translateX(50%);
|
|
93
98
|
}
|
|
99
|
+
|
|
94
100
|
.v-slider.v-input--horizontal .v-slider-track__tick--first {
|
|
95
101
|
margin-inline-start: calc(var(--v-slider-tick-size) + 1px);
|
|
96
102
|
}
|
|
97
|
-
.v-slider.v-input--horizontal .v-slider-track__tick--first .v-slider-track__tick-label
|
|
103
|
+
.v-locale--is-ltr.v-slider.v-input--horizontal .v-slider-track__tick--first .v-slider-track__tick-label, .v-locale--is-ltr .v-slider.v-input--horizontal .v-slider-track__tick--first .v-slider-track__tick-label {
|
|
98
104
|
transform: translateX(0%);
|
|
99
105
|
}
|
|
100
|
-
|
|
106
|
+
|
|
107
|
+
.v-locale--is-rtl.v-slider.v-input--horizontal .v-slider-track__tick--first .v-slider-track__tick-label, .v-locale--is-rtl .v-slider.v-input--horizontal .v-slider-track__tick--first .v-slider-track__tick-label {
|
|
101
108
|
transform: translateX(0%);
|
|
102
109
|
}
|
|
110
|
+
|
|
103
111
|
.v-slider.v-input--horizontal .v-slider-track__tick--last {
|
|
104
112
|
margin-inline-start: calc(100% - var(--v-slider-tick-size) - 1px);
|
|
105
113
|
}
|
|
106
|
-
.v-slider.v-input--horizontal .v-slider-track__tick--last .v-slider-track__tick-label
|
|
114
|
+
.v-locale--is-ltr.v-slider.v-input--horizontal .v-slider-track__tick--last .v-slider-track__tick-label, .v-locale--is-ltr .v-slider.v-input--horizontal .v-slider-track__tick--last .v-slider-track__tick-label {
|
|
107
115
|
transform: translateX(-100%);
|
|
108
116
|
}
|
|
109
|
-
|
|
117
|
+
|
|
118
|
+
.v-locale--is-rtl.v-slider.v-input--horizontal .v-slider-track__tick--last .v-slider-track__tick-label, .v-locale--is-rtl .v-slider.v-input--horizontal .v-slider-track__tick--last .v-slider-track__tick-label {
|
|
110
119
|
transform: translateX(100%);
|
|
111
120
|
}
|
|
112
121
|
|
|
@@ -130,9 +139,10 @@
|
|
|
130
139
|
margin-inline-start: calc(calc(var(--v-slider-track-size) + 2px) / 2);
|
|
131
140
|
transform: translate(calc(var(--v-slider-tick-size) / -2), calc(var(--v-slider-tick-size) / 2));
|
|
132
141
|
}
|
|
133
|
-
.v-slider.v-input--vertical .v-slider-track__tick
|
|
142
|
+
.v-locale--is-rtl.v-slider.v-input--vertical .v-slider-track__tick, .v-locale--is-rtl .v-slider.v-input--vertical .v-slider-track__tick {
|
|
134
143
|
transform: translate(calc(var(--v-slider-tick-size) / 2), calc(var(--v-slider-tick-size) / 2));
|
|
135
144
|
}
|
|
145
|
+
|
|
136
146
|
.v-slider.v-input--vertical .v-slider-track__tick--first {
|
|
137
147
|
bottom: calc(0% + var(--v-slider-tick-size) + 1px);
|
|
138
148
|
}
|
|
@@ -8,6 +8,12 @@ interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions
|
|
|
8
8
|
type EventProp<T extends any[] = any[], F = (...args: T) => any> = F | F[];
|
|
9
9
|
declare const EventProp: <T extends any[] = any[]>() => PropType<EventProp<T, (...args: T) => any>>;
|
|
10
10
|
|
|
11
|
+
type Tick = {
|
|
12
|
+
value: number;
|
|
13
|
+
position: number;
|
|
14
|
+
label?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
11
17
|
type VMessageSlot = {
|
|
12
18
|
message: string;
|
|
13
19
|
};
|
|
@@ -76,9 +82,14 @@ declare const VSlider: {
|
|
|
76
82
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
77
83
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
78
84
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
85
|
+
'thumb-label'?: ((arg: {
|
|
86
|
+
modelValue: number;
|
|
87
|
+
}) => vue.VNodeChild) | undefined;
|
|
88
|
+
'tick-label'?: ((arg: {
|
|
89
|
+
tick: Tick;
|
|
90
|
+
index: number;
|
|
91
|
+
}) => vue.VNodeChild) | undefined;
|
|
79
92
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
80
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
81
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
82
93
|
};
|
|
83
94
|
ref?: vue.VNodeRef | undefined;
|
|
84
95
|
ref_for?: boolean | undefined;
|
|
@@ -90,9 +101,14 @@ declare const VSlider: {
|
|
|
90
101
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
91
102
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
92
103
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
104
|
+
'thumb-label'?: false | ((arg: {
|
|
105
|
+
modelValue: number;
|
|
106
|
+
}) => vue.VNodeChild) | undefined;
|
|
107
|
+
'tick-label'?: false | ((arg: {
|
|
108
|
+
tick: Tick;
|
|
109
|
+
index: number;
|
|
110
|
+
}) => vue.VNodeChild) | undefined;
|
|
93
111
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
94
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
95
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
96
112
|
} | undefined;
|
|
97
113
|
onVnodeBeforeMount?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
98
114
|
[key: string]: any;
|
|
@@ -147,12 +163,17 @@ declare const VSlider: {
|
|
|
147
163
|
hint?: string | undefined;
|
|
148
164
|
hideDetails?: boolean | "auto" | undefined;
|
|
149
165
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
150
|
-
"v-slot:tick-label"?: false | ((
|
|
166
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
167
|
+
tick: Tick;
|
|
168
|
+
index: number;
|
|
169
|
+
}) => vue.VNodeChild) | undefined;
|
|
151
170
|
trackColor?: string | undefined;
|
|
152
171
|
trackFillColor?: string | undefined;
|
|
153
172
|
thumbColor?: string | undefined;
|
|
154
173
|
ticks?: readonly number[] | Record<number, string> | undefined;
|
|
155
|
-
"v-slot:thumb-label"?: false | ((
|
|
174
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
175
|
+
modelValue: number;
|
|
176
|
+
}) => vue.VNodeChild) | undefined;
|
|
156
177
|
onEnd?: ((value: number) => any) | undefined;
|
|
157
178
|
onStart?: ((value: number) => any) | undefined;
|
|
158
179
|
};
|
|
@@ -178,13 +199,18 @@ declare const VSlider: {
|
|
|
178
199
|
message?: ((arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
179
200
|
[key: string]: any;
|
|
180
201
|
}>[]) | undefined;
|
|
181
|
-
label?: ((arg:
|
|
202
|
+
'thumb-label'?: ((arg: {
|
|
203
|
+
modelValue: number;
|
|
204
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
182
205
|
[key: string]: any;
|
|
183
206
|
}>[]) | undefined;
|
|
184
|
-
'tick-label'?: ((
|
|
207
|
+
'tick-label'?: ((arg: {
|
|
208
|
+
tick: Tick;
|
|
209
|
+
index: number;
|
|
210
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
185
211
|
[key: string]: any;
|
|
186
212
|
}>[]) | undefined;
|
|
187
|
-
|
|
213
|
+
label?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
188
214
|
[key: string]: any;
|
|
189
215
|
}>[]) | undefined;
|
|
190
216
|
}>;
|
|
@@ -244,9 +270,14 @@ declare const VSlider: {
|
|
|
244
270
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
245
271
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
246
272
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
273
|
+
'thumb-label'?: ((arg: {
|
|
274
|
+
modelValue: number;
|
|
275
|
+
}) => vue.VNodeChild) | undefined;
|
|
276
|
+
'tick-label'?: ((arg: {
|
|
277
|
+
tick: Tick;
|
|
278
|
+
index: number;
|
|
279
|
+
}) => vue.VNodeChild) | undefined;
|
|
247
280
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
248
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
249
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
250
281
|
};
|
|
251
282
|
'v-slots'?: {
|
|
252
283
|
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -254,9 +285,14 @@ declare const VSlider: {
|
|
|
254
285
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
255
286
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
256
287
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
288
|
+
'thumb-label'?: false | ((arg: {
|
|
289
|
+
modelValue: number;
|
|
290
|
+
}) => vue.VNodeChild) | undefined;
|
|
291
|
+
'tick-label'?: false | ((arg: {
|
|
292
|
+
tick: Tick;
|
|
293
|
+
index: number;
|
|
294
|
+
}) => vue.VNodeChild) | undefined;
|
|
257
295
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
258
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
259
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
260
296
|
} | undefined;
|
|
261
297
|
} & {
|
|
262
298
|
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -264,9 +300,14 @@ declare const VSlider: {
|
|
|
264
300
|
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
265
301
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
266
302
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
303
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
304
|
+
modelValue: number;
|
|
305
|
+
}) => vue.VNodeChild) | undefined;
|
|
306
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
307
|
+
tick: Tick;
|
|
308
|
+
index: number;
|
|
309
|
+
}) => vue.VNodeChild) | undefined;
|
|
267
310
|
"v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
268
|
-
"v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
269
|
-
"v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
270
311
|
} & {
|
|
271
312
|
"onUpdate:modelValue"?: ((v: number) => any) | undefined;
|
|
272
313
|
"onUpdate:focused"?: ((value: boolean) => any) | undefined;
|
|
@@ -319,13 +360,18 @@ declare const VSlider: {
|
|
|
319
360
|
message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
320
361
|
[key: string]: any;
|
|
321
362
|
}>[];
|
|
322
|
-
label: (arg:
|
|
363
|
+
'thumb-label': (arg: {
|
|
364
|
+
modelValue: number;
|
|
365
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
323
366
|
[key: string]: any;
|
|
324
367
|
}>[];
|
|
325
|
-
'tick-label': (
|
|
368
|
+
'tick-label': (arg: {
|
|
369
|
+
tick: Tick;
|
|
370
|
+
index: number;
|
|
371
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
326
372
|
[key: string]: any;
|
|
327
373
|
}>[];
|
|
328
|
-
|
|
374
|
+
label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
329
375
|
[key: string]: any;
|
|
330
376
|
}>[];
|
|
331
377
|
}>>> & {
|
|
@@ -400,9 +446,14 @@ declare const VSlider: {
|
|
|
400
446
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
401
447
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
402
448
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
449
|
+
'thumb-label'?: ((arg: {
|
|
450
|
+
modelValue: number;
|
|
451
|
+
}) => vue.VNodeChild) | undefined;
|
|
452
|
+
'tick-label'?: ((arg: {
|
|
453
|
+
tick: Tick;
|
|
454
|
+
index: number;
|
|
455
|
+
}) => vue.VNodeChild) | undefined;
|
|
403
456
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
404
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
405
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
406
457
|
};
|
|
407
458
|
'v-slots'?: {
|
|
408
459
|
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -410,9 +461,14 @@ declare const VSlider: {
|
|
|
410
461
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
411
462
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
412
463
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
464
|
+
'thumb-label'?: false | ((arg: {
|
|
465
|
+
modelValue: number;
|
|
466
|
+
}) => vue.VNodeChild) | undefined;
|
|
467
|
+
'tick-label'?: false | ((arg: {
|
|
468
|
+
tick: Tick;
|
|
469
|
+
index: number;
|
|
470
|
+
}) => vue.VNodeChild) | undefined;
|
|
413
471
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
414
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
415
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
416
472
|
} | undefined;
|
|
417
473
|
} & {
|
|
418
474
|
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -420,9 +476,14 @@ declare const VSlider: {
|
|
|
420
476
|
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
421
477
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
422
478
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
479
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
480
|
+
modelValue: number;
|
|
481
|
+
}) => vue.VNodeChild) | undefined;
|
|
482
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
483
|
+
tick: Tick;
|
|
484
|
+
index: number;
|
|
485
|
+
}) => vue.VNodeChild) | undefined;
|
|
423
486
|
"v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
424
|
-
"v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
425
|
-
"v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
426
487
|
} & {
|
|
427
488
|
"onUpdate:modelValue"?: ((v: number) => any) | undefined;
|
|
428
489
|
"onUpdate:focused"?: ((value: boolean) => any) | undefined;
|
|
@@ -484,9 +545,14 @@ declare const VSlider: {
|
|
|
484
545
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
485
546
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
486
547
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
548
|
+
'thumb-label'?: ((arg: {
|
|
549
|
+
modelValue: number;
|
|
550
|
+
}) => vue.VNodeChild) | undefined;
|
|
551
|
+
'tick-label'?: ((arg: {
|
|
552
|
+
tick: Tick;
|
|
553
|
+
index: number;
|
|
554
|
+
}) => vue.VNodeChild) | undefined;
|
|
487
555
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
488
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
489
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
490
556
|
};
|
|
491
557
|
'v-slots'?: {
|
|
492
558
|
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -494,9 +560,14 @@ declare const VSlider: {
|
|
|
494
560
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
495
561
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
496
562
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
563
|
+
'thumb-label'?: false | ((arg: {
|
|
564
|
+
modelValue: number;
|
|
565
|
+
}) => vue.VNodeChild) | undefined;
|
|
566
|
+
'tick-label'?: false | ((arg: {
|
|
567
|
+
tick: Tick;
|
|
568
|
+
index: number;
|
|
569
|
+
}) => vue.VNodeChild) | undefined;
|
|
497
570
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
498
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
499
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
500
571
|
} | undefined;
|
|
501
572
|
} & {
|
|
502
573
|
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -504,9 +575,14 @@ declare const VSlider: {
|
|
|
504
575
|
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
505
576
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
506
577
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
578
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
579
|
+
modelValue: number;
|
|
580
|
+
}) => vue.VNodeChild) | undefined;
|
|
581
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
582
|
+
tick: Tick;
|
|
583
|
+
index: number;
|
|
584
|
+
}) => vue.VNodeChild) | undefined;
|
|
507
585
|
"v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
508
|
-
"v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
509
|
-
"v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
510
586
|
} & {
|
|
511
587
|
"onUpdate:modelValue"?: ((v: number) => any) | undefined;
|
|
512
588
|
"onUpdate:focused"?: ((value: boolean) => any) | undefined;
|
|
@@ -559,13 +635,18 @@ declare const VSlider: {
|
|
|
559
635
|
message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
560
636
|
[key: string]: any;
|
|
561
637
|
}>[];
|
|
562
|
-
label: (arg:
|
|
638
|
+
'thumb-label': (arg: {
|
|
639
|
+
modelValue: number;
|
|
640
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
563
641
|
[key: string]: any;
|
|
564
642
|
}>[];
|
|
565
|
-
'tick-label': (
|
|
643
|
+
'tick-label': (arg: {
|
|
644
|
+
tick: Tick;
|
|
645
|
+
index: number;
|
|
646
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
566
647
|
[key: string]: any;
|
|
567
648
|
}>[];
|
|
568
|
-
|
|
649
|
+
label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
569
650
|
[key: string]: any;
|
|
570
651
|
}>[];
|
|
571
652
|
}>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
|
|
@@ -48,6 +48,7 @@ export const VSwitch = genericComponent()({
|
|
|
48
48
|
focus,
|
|
49
49
|
blur
|
|
50
50
|
} = useFocus(props);
|
|
51
|
+
const control = ref();
|
|
51
52
|
const loaderColor = computed(() => {
|
|
52
53
|
return typeof props.loading === 'string' && props.loading !== '' ? props.loading : props.color;
|
|
53
54
|
});
|
|
@@ -58,16 +59,15 @@ export const VSwitch = genericComponent()({
|
|
|
58
59
|
indeterminate.value = false;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
62
|
+
function onTrackClick(e) {
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
control.value?.input?.click();
|
|
66
|
+
}
|
|
61
67
|
useRender(() => {
|
|
62
|
-
const [
|
|
68
|
+
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
63
69
|
const [inputProps, _1] = VInput.filterProps(props);
|
|
64
70
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
|
65
|
-
const control = ref();
|
|
66
|
-
function onClick(e) {
|
|
67
|
-
e.stopPropagation();
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
control.value?.input?.click();
|
|
70
|
-
}
|
|
71
71
|
return _createVNode(VInput, _mergeProps({
|
|
72
72
|
"class": ['v-switch', {
|
|
73
73
|
'v-switch--inset': props.inset
|
|
@@ -75,7 +75,7 @@ export const VSwitch = genericComponent()({
|
|
|
75
75
|
'v-switch--indeterminate': indeterminate.value
|
|
76
76
|
}, loaderClasses.value, props.class],
|
|
77
77
|
"style": props.style
|
|
78
|
-
},
|
|
78
|
+
}, rootAttrs, inputProps, {
|
|
79
79
|
"id": id.value,
|
|
80
80
|
"focused": isFocused.value
|
|
81
81
|
}), {
|
|
@@ -105,7 +105,7 @@ export const VSwitch = genericComponent()({
|
|
|
105
105
|
...slots,
|
|
106
106
|
default: () => _createVNode("div", {
|
|
107
107
|
"class": "v-switch__track",
|
|
108
|
-
"onClick":
|
|
108
|
+
"onClick": onTrackClick
|
|
109
109
|
}, null),
|
|
110
110
|
input: _ref3 => {
|
|
111
111
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","getUid","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","update:modelValue","val","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","loaderColor","color","uid","id","onChange","value","inputAttrs","controlAttrs","inputProps","_1","filterProps","controlProps","_2","control","onClick","e","stopPropagation","preventDefault","input","click","_createVNode","_mergeProps","class","style","_ref2","messagesId","isDisabled","isReadonly","isValid","$event","undefined","_ref3","inputNode","icon","_Fragment","slotProps","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VIcon } from '@/components/VIcon'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VProgressCircular } from '@/components/VProgressCircular'\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { LoaderSlot, useLoader } from '@/composables/loader'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { filterInputAttrs, genericComponent, getUid, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { LoaderSlotProps } from '@/composables/loader'\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & { loader: LoaderSlotProps }\n\nexport const makeVSwitchProps = propsFactory({\n indeterminate: Boolean,\n inset: Boolean,\n flat: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n\n ...makeVInputProps(),\n ...makeVSelectionControlProps(),\n}, 'VSwitch')\n\nexport const VSwitch = genericComponent<VSwitchSlots>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': () => true,\n 'update:indeterminate': (val: boolean) => true,\n },\n\n setup (props, { attrs, slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n const { loaderClasses } = useLoader(props)\n const { isFocused, focus, blur } = useFocus(props)\n\n const loaderColor = computed(() => {\n return typeof props.loading === 'string' && props.loading !== ''\n ? props.loading\n : props.color\n })\n\n const uid = getUid()\n const id = computed(() => props.id || `switch-${uid}`)\n\n function onChange () {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n\n useRender(() => {\n const [inputAttrs, controlAttrs] = filterInputAttrs(attrs)\n const [inputProps, _1] = VInput.filterProps(props)\n const [controlProps, _2] = VSelectionControl.filterProps(props)\n const control = ref<VSelectionControl>()\n\n function onClick (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n control.value?.input?.click()\n }\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n style={ props.style }\n { ...inputAttrs }\n { ...inputProps }\n id={ id.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => (\n <VSelectionControl\n ref={ control }\n { ...controlProps }\n v-model={ model.value }\n id={ id.value }\n aria-describedby={ messagesId.value }\n type=\"checkbox\"\n onUpdate:modelValue={ onChange }\n aria-checked={ indeterminate.value ? 'mixed' : undefined }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n onFocus={ focus }\n onBlur={ blur }\n { ...controlAttrs }\n >\n {{\n ...slots,\n default: () => (<div class=\"v-switch__track\" onClick={ onClick }></div>),\n input: ({ inputNode, icon }) => (\n <>\n { inputNode }\n\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n ]}\n >\n <VScaleTransition>\n { !props.loading ? (\n icon && <VIcon key={ icon as any } icon={ icon } size=\"x-small\" />\n ) : (\n <LoaderSlot\n name=\"v-switch\"\n active\n color={ isValid.value === false ? undefined : loaderColor.value }\n >\n { slotProps => (\n slots.loader\n ? slots.loader(slotProps)\n : (\n <VProgressCircular\n active={ slotProps.isActive }\n color={ slotProps.color }\n indeterminate\n size=\"16\"\n width=\"2\"\n />\n )\n )}\n </LoaderSlot>\n )}\n </VScaleTransition>\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n ),\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSwitch = InstanceType<typeof VSwitch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OAAA,EAAAA,CAAA,MAGG,CAACI,KAAK,CAACP,OAAO,GACdsD,IAAI,IAAAb,YAAA,CAAA/D,KAAA;kBAAA,OAAiB4E,IAAI;kBAAA,QAAiBA,IAAI;kBAAA,QAAQ;gBAAS,QAAG,GAAAb,YAAA,CAAAxD,UAAA;kBAAA,QAG3D,UAAU;kBAAA;kBAAA,SAEPgE,OAAO,CAACvB,KAAK,KAAK,KAAK,GAAGyB,SAAS,GAAG9B,WAAW,CAACK;gBAAK;kBAAAvB,OAAA,EAE7DqD,SAAS,IACTzC,KAAK,CAAC0C,MAAM,GACR1C,KAAK,CAAC0C,MAAM,CAACD,SAAS,CAAC,GAAAf,YAAA,CAAA5D,iBAAA;oBAAA,UAGZ2E,SAAS,CAACE,QAAQ;oBAAA,SACnBF,SAAS,CAAClC,KAAK;oBAAA;oBAAA,QAElB,IAAI;oBAAA,SACH;kBAAG;gBAGhB,EAEJ;cAAA;YAAA;UAIR;QAAA;MAGN;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","getUid","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","update:modelValue","val","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","control","loaderColor","color","uid","id","onChange","value","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","_1","filterProps","controlProps","_2","_createVNode","_mergeProps","class","style","_ref2","messagesId","isDisabled","isReadonly","isValid","$event","undefined","_ref3","inputNode","icon","_Fragment","slotProps","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VIcon } from '@/components/VIcon'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VProgressCircular } from '@/components/VProgressCircular'\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { LoaderSlot, useLoader } from '@/composables/loader'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { filterInputAttrs, genericComponent, getUid, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { LoaderSlotProps } from '@/composables/loader'\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & { loader: LoaderSlotProps }\n\nexport const makeVSwitchProps = propsFactory({\n indeterminate: Boolean,\n inset: Boolean,\n flat: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n\n ...makeVInputProps(),\n ...makeVSelectionControlProps(),\n}, 'VSwitch')\n\nexport const VSwitch = genericComponent<VSwitchSlots>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': () => true,\n 'update:indeterminate': (val: boolean) => true,\n },\n\n setup (props, { attrs, slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n const { loaderClasses } = useLoader(props)\n const { isFocused, focus, blur } = useFocus(props)\n const control = ref<VSelectionControl>()\n\n const loaderColor = computed(() => {\n return typeof props.loading === 'string' && props.loading !== ''\n ? props.loading\n : props.color\n })\n\n const uid = getUid()\n const id = computed(() => props.id || `switch-${uid}`)\n\n function onChange () {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n function onTrackClick (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n control.value?.input?.click()\n }\n\n useRender(() => {\n const [rootAttrs, controlAttrs] = filterInputAttrs(attrs)\n const [inputProps, _1] = VInput.filterProps(props)\n const [controlProps, _2] = VSelectionControl.filterProps(props)\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n style={ props.style }\n { ...rootAttrs }\n { ...inputProps }\n id={ id.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => (\n <VSelectionControl\n ref={ control }\n { ...controlProps }\n v-model={ model.value }\n id={ id.value }\n aria-describedby={ messagesId.value }\n type=\"checkbox\"\n onUpdate:modelValue={ onChange }\n aria-checked={ indeterminate.value ? 'mixed' : undefined }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n onFocus={ focus }\n onBlur={ blur }\n { ...controlAttrs }\n >\n {{\n ...slots,\n default: () => (<div class=\"v-switch__track\" onClick={ onTrackClick }></div>),\n input: ({ inputNode, icon }) => (\n <>\n { inputNode }\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n ]}\n >\n <VScaleTransition>\n { !props.loading ? (\n icon && <VIcon key={ icon as any } icon={ icon } size=\"x-small\" />\n ) : (\n <LoaderSlot\n name=\"v-switch\"\n active\n color={ isValid.value === false ? undefined : loaderColor.value }\n >\n { slotProps => (\n slots.loader\n ? slots.loader(slotProps)\n : (\n <VProgressCircular\n active={ slotProps.isActive }\n color={ slotProps.color }\n indeterminate\n size=\"16\"\n width=\"2\"\n />\n )\n )}\n </LoaderSlot>\n )}\n </VScaleTransition>\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n ),\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSwitch = InstanceType<typeof VSwitch>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB;AAAA,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