@vuetify/nightly 3.7.4-next.2024-11-06 → 3.7.5-dev.2024-12-16
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 +2853 -2845
- package/dist/json/importMap-labs.json +20 -20
- package/dist/json/importMap.json +150 -150
- package/dist/json/tags.json +2 -0
- package/dist/json/web-types.json +5324 -5306
- package/dist/vuetify-labs.css +25135 -23418
- package/dist/vuetify-labs.d.ts +202 -196
- package/dist/vuetify-labs.esm.js +107 -106
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +106 -105
- package/dist/vuetify-labs.min.css +4 -3
- package/dist/vuetify.css +23838 -22118
- package/dist/vuetify.d.ts +191 -185
- package/dist/vuetify.esm.js +96 -96
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +95 -95
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +4 -3
- package/dist/vuetify.min.js +884 -889
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAlert/VAlert.css +215 -207
- package/lib/components/VApp/VApp.css +15 -16
- package/lib/components/VAppBar/VAppBar.css +12 -14
- package/lib/components/VAppBar/index.d.mts +6 -6
- package/lib/components/VAutocomplete/VAutocomplete.css +85 -86
- package/lib/components/VAutocomplete/VAutocomplete.mjs +4 -4
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +22 -22
- package/lib/components/VAvatar/VAvatar.css +106 -108
- package/lib/components/VBadge/VBadge.css +77 -73
- package/lib/components/VBadge/VBadge.sass +4 -0
- package/lib/components/VBanner/VBanner.css +166 -161
- package/lib/components/VBottomNavigation/VBottomNavigation.css +63 -64
- package/lib/components/VBottomSheet/VBottomSheet.css +31 -34
- package/lib/components/VBreadcrumbs/VBreadcrumbs.css +57 -54
- package/lib/components/VBtn/VBtn.css +408 -385
- package/lib/components/VBtn/VBtn.sass +4 -4
- package/lib/components/VBtn/index.d.mts +7 -7
- package/lib/components/VBtnGroup/VBtnGroup.css +64 -63
- package/lib/components/VBtnToggle/VBtnToggle.css +14 -16
- package/lib/components/VBtnToggle/index.d.mts +9 -9
- package/lib/components/VCard/VCard.css +302 -294
- package/lib/components/VCarousel/VCarousel.css +65 -63
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.sass +1 -1
- package/lib/components/VCarousel/index.d.mts +9 -9
- package/lib/components/VCheckbox/VCheckbox.css +5 -7
- package/lib/components/VCheckbox/VCheckbox.mjs +3 -3
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +411 -378
- package/lib/components/VChip/VChip.mjs +18 -10
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/index.d.mts +13 -8
- package/lib/components/VChipGroup/VChipGroup.css +18 -19
- package/lib/components/VChipGroup/VChipGroup.mjs +2 -0
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.d.mts +20 -15
- package/lib/components/VCode/VCode.css +8 -10
- package/lib/components/VColorPicker/VColorPicker.css +22 -22
- package/lib/components/VColorPicker/VColorPickerCanvas.css +22 -24
- package/lib/components/VColorPicker/VColorPickerEdit.css +28 -29
- package/lib/components/VColorPicker/VColorPickerPreview.css +67 -69
- package/lib/components/VColorPicker/VColorPickerPreview.sass +2 -4
- package/lib/components/VColorPicker/VColorPickerSwatches.css +34 -34
- package/lib/components/VCombobox/VCombobox.css +85 -86
- package/lib/components/VCombobox/VCombobox.mjs +4 -4
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.mts +22 -22
- package/lib/components/VConfirmEdit/VConfirmEdit.mjs +9 -7
- package/lib/components/VConfirmEdit/VConfirmEdit.mjs.map +1 -1
- package/lib/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.mjs +1 -1
- package/lib/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.mjs.map +1 -1
- package/lib/components/VConfirmEdit/index.d.mts +3 -7
- package/lib/components/VCounter/VCounter.css +5 -7
- package/lib/components/VDataTable/VDataTable.css +186 -189
- package/lib/components/VDataTable/VDataTable.sass +10 -20
- package/lib/components/VDataTable/VDataTableFooter.css +31 -33
- package/lib/components/VDatePicker/VDatePicker.css +6 -8
- package/lib/components/VDatePicker/VDatePickerControls.css +56 -54
- package/lib/components/VDatePicker/VDatePickerHeader.css +60 -56
- package/lib/components/VDatePicker/VDatePickerHeader.mjs +2 -1
- package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonth.css +55 -51
- package/lib/components/VDatePicker/VDatePickerMonths.css +19 -20
- package/lib/components/VDatePicker/VDatePickerYears.css +15 -16
- package/lib/components/VDatePicker/index.d.mts +5 -5
- package/lib/components/VDialog/VDialog.css +95 -95
- package/lib/components/VDivider/VDivider.css +52 -52
- package/lib/components/VEmptyState/VEmptyState.css +67 -62
- package/lib/components/VExpansionPanel/VExpansionPanel.css +209 -203
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +25 -27
- package/lib/components/VExpansionPanel/index.d.mts +7 -7
- package/lib/components/VFab/VFab.css +69 -74
- package/lib/components/VFab/VFab.sass +4 -5
- package/lib/components/VFab/index.d.mts +6 -6
- package/lib/components/VField/VField.css +579 -539
- package/lib/components/VField/VField.mjs +5 -4
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +29 -31
- package/lib/components/VFooter/VFooter.css +36 -38
- package/lib/components/VGrid/VGrid.css +592 -565
- package/lib/components/VIcon/VIcon.css +52 -51
- package/lib/components/VImg/VImg.css +51 -50
- package/lib/components/VInfiniteScroll/VInfiniteScroll.css +37 -36
- package/lib/components/VInput/VInput.css +142 -131
- package/lib/components/VInput/VInput.mjs +3 -3
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.css +5 -7
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.mts +9 -9
- package/lib/components/VKbd/VKbd.css +11 -13
- package/lib/components/VLabel/VLabel.css +15 -16
- package/lib/components/VLayout/VLayout.css +8 -10
- package/lib/components/VLayout/VLayoutItem.css +7 -8
- package/lib/components/VList/VList.css +108 -104
- package/lib/components/VList/VList.mjs +3 -2
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VList.sass +1 -1
- package/lib/components/VList/VListItem.css +452 -440
- package/lib/components/VList/VListItem.mjs +3 -2
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +1 -2
- package/lib/components/VList/index.d.mts +10 -10
- package/lib/components/VLocaleProvider/VLocaleProvider.css +2 -4
- package/lib/components/VMain/VMain.css +30 -32
- package/lib/components/VMenu/VMenu.css +19 -21
- package/lib/components/VMenu/VMenu.mjs +3 -3
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.mts +6 -6
- package/lib/components/VMessages/VMessages.css +15 -17
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +108 -106
- package/lib/components/VOtpInput/VOtpInput.css +58 -56
- package/lib/components/VOverlay/VOverlay.css +63 -60
- package/lib/components/VOverlay/VOverlay.sass +13 -14
- package/lib/components/VPagination/VPagination.css +8 -10
- package/lib/components/VParallax/VParallax.css +6 -8
- package/lib/components/VProgressCircular/VProgressCircular.css +101 -95
- package/lib/components/VProgressLinear/VProgressLinear.css +222 -209
- package/lib/components/VRadioGroup/VRadioGroup.css +12 -14
- package/lib/components/VRadioGroup/VRadioGroup.mjs +3 -3
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRating/VRating.css +53 -52
- package/lib/components/VRating/VRating.mjs +4 -3
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.css +26 -25
- package/lib/components/VSelect/VSelect.css +52 -54
- package/lib/components/VSelect/VSelect.mjs +3 -3
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.mts +22 -22
- package/lib/components/VSelectionControl/VSelectionControl.css +102 -100
- package/lib/components/VSelectionControl/VSelectionControl.mjs +3 -3
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.css +8 -10
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +3 -3
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.css +36 -38
- package/lib/components/VSkeletonLoader/VSkeletonLoader.css +224 -225
- package/lib/components/VSlideGroup/VSlideGroup.css +55 -53
- package/lib/components/VSlideGroup/index.d.mts +10 -10
- package/lib/components/VSlider/VSlider.css +57 -53
- package/lib/components/VSlider/VSliderThumb.css +153 -142
- package/lib/components/VSlider/VSliderTrack.css +174 -155
- package/lib/components/VSnackbar/VSnackbar.css +140 -140
- package/lib/components/VSparkline/VBarline.mjs +3 -3
- package/lib/components/VSparkline/VBarline.mjs.map +1 -1
- package/lib/components/VSparkline/VTrendline.mjs +3 -3
- package/lib/components/VSparkline/VTrendline.mjs.map +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.css +41 -43
- package/lib/components/VStepper/VStepper.css +56 -55
- package/lib/components/VStepper/VStepper.mjs +5 -4
- package/lib/components/VStepper/VStepper.mjs.map +1 -1
- package/lib/components/VStepper/VStepperItem.css +115 -112
- package/lib/components/VStepper/VStepperItem.mjs +5 -4
- package/lib/components/VStepper/VStepperItem.mjs.map +1 -1
- package/lib/components/VStepper/index.d.mts +51 -45
- package/lib/components/VSwitch/VSwitch.css +139 -129
- package/lib/components/VSwitch/VSwitch.mjs +3 -3
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.css +43 -45
- package/lib/components/VTable/VTable.css +141 -140
- package/lib/components/VTable/VTable.sass +2 -4
- package/lib/components/VTabs/VTab.css +29 -30
- package/lib/components/VTabs/VTabs.css +65 -59
- package/lib/components/VTabs/index.d.mts +7 -7
- package/lib/components/VTextField/VTextField.css +68 -65
- package/lib/components/VTextarea/VTextarea.css +39 -47
- package/lib/components/VTextarea/VTextarea.sass +2 -4
- package/lib/components/VThemeProvider/VThemeProvider.css +3 -5
- package/lib/components/VTimeline/VTimeline.css +418 -379
- package/lib/components/VToolbar/VToolbar.css +143 -136
- package/lib/components/VTooltip/VTooltip.css +21 -25
- package/lib/components/VTooltip/VTooltip.mjs +3 -3
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.sass +6 -8
- package/lib/components/VVirtualScroll/VVirtualScroll.css +9 -11
- package/lib/components/VWindow/VWindow.css +70 -73
- package/lib/components/VWindow/index.d.mts +7 -7
- package/lib/components/index.d.mts +138 -132
- package/lib/composables/form.mjs +7 -2
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/group.mjs +3 -3
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/layout.mjs +3 -3
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +2 -2
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/theme.mjs +4 -4
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/validation.mjs +13 -15
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/directives/ripple/VRipple.css +36 -38
- package/lib/entry-bundler.mjs +1 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +2 -3
- package/lib/framework.mjs.map +1 -1
- package/lib/index.d.mts +53 -53
- package/lib/labs/VCalendar/VCalendar.css +225 -219
- package/lib/labs/VCalendar/VCalendarDay.css +32 -33
- package/lib/labs/VCalendar/VCalendarHeader.css +13 -13
- package/lib/labs/VCalendar/VCalendarInterval.css +42 -43
- package/lib/labs/VCalendar/VCalendarIntervalEvent.css +5 -7
- package/lib/labs/VCalendar/VCalendarMonthDay.css +58 -61
- package/lib/labs/VCalendar/VCalendarMonthDay.sass +2 -3
- package/lib/labs/VDateInput/VDateInput.mjs +1 -1
- package/lib/labs/VDateInput/VDateInput.mjs.map +1 -1
- package/lib/labs/VNumberInput/VNumberInput.css +38 -40
- package/lib/labs/VNumberInput/VNumberInput.mjs +7 -5
- package/lib/labs/VNumberInput/VNumberInput.mjs.map +1 -1
- package/lib/labs/VPicker/VPicker.css +57 -53
- package/lib/labs/VStepperVertical/index.d.mts +44 -44
- package/lib/labs/VTimePicker/VTimePicker.css +7 -9
- package/lib/labs/VTimePicker/VTimePickerClock.css +129 -126
- package/lib/labs/VTimePicker/VTimePickerControls.css +103 -102
- package/lib/labs/VTreeview/VTreeviewItem.css +15 -17
- package/lib/labs/VTreeview/VTreeviewItem.mjs +3 -4
- package/lib/labs/VTreeview/VTreeviewItem.mjs.map +1 -1
- package/lib/labs/VTreeview/VTreeviewItem.sass +1 -2
- package/lib/labs/VTreeview/index.d.mts +20 -20
- package/lib/labs/components.d.mts +64 -64
- package/lib/locale/fr.mjs +1 -1
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/styles/elements/_global.sass +1 -1
- package/lib/styles/generic/_colors.scss +3 -3
- package/lib/styles/generic/_layers.scss +1 -13
- package/lib/styles/generic/_transitions.scss +32 -32
- package/lib/styles/main.css +16139 -14666
- package/lib/styles/settings/_utilities.scss +5 -0
- package/lib/styles/settings/_variables.scss +2 -1
- package/lib/styles/tools/_bootable.sass +3 -0
- package/lib/styles/tools/_border.sass +4 -4
- package/lib/styles/tools/_display.sass +10 -0
- package/lib/styles/tools/_elevation.sass +2 -2
- package/lib/styles/tools/_index.sass +2 -0
- package/lib/styles/tools/_layer.scss +2 -4
- package/lib/styles/tools/_position.sass +2 -2
- package/lib/styles/tools/_radius.sass +10 -0
- package/lib/styles/tools/_rounded.sass +2 -2
- package/lib/styles/tools/_utilities.sass +5 -1
- package/lib/styles/utilities/_elevation.scss +1 -1
- package/lib/util/getCurrentInstance.mjs +1 -15
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/package.json +1 -1
@@ -1,133 +1,143 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
.
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
.
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
1
|
+
.v-switch .v-label {
|
2
|
+
padding-inline-start: 10px;
|
3
|
+
}
|
4
|
+
|
5
|
+
.v-switch__loader {
|
6
|
+
display: flex;
|
7
|
+
}
|
8
|
+
.v-switch__loader .v-progress-circular {
|
9
|
+
color: rgb(var(--v-theme-surface));
|
10
|
+
}
|
11
|
+
|
12
|
+
.v-switch__track,
|
13
|
+
.v-switch__thumb {
|
14
|
+
transition: none;
|
15
|
+
}
|
16
|
+
.v-selection-control--error:not(.v-selection-control--disabled) .v-switch__track,
|
17
|
+
.v-selection-control--error:not(.v-selection-control--disabled) .v-switch__thumb {
|
18
|
+
background-color: rgb(var(--v-theme-error));
|
19
|
+
color: rgb(var(--v-theme-on-error));
|
20
|
+
}
|
21
|
+
|
22
|
+
.v-switch__track-true {
|
23
|
+
margin-inline-end: auto;
|
24
|
+
}
|
25
|
+
.v-selection-control:not(.v-selection-control--dirty) .v-switch__track-true {
|
26
|
+
opacity: 0;
|
27
|
+
}
|
28
|
+
|
29
|
+
.v-switch__track-false {
|
30
|
+
margin-inline-start: auto;
|
31
|
+
}
|
32
|
+
.v-selection-control--dirty .v-switch__track-false {
|
33
|
+
opacity: 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
.v-switch__track {
|
37
|
+
display: inline-flex;
|
38
|
+
align-items: center;
|
39
|
+
font-size: 0.5rem;
|
40
|
+
padding: 0 5px;
|
41
|
+
background-color: rgb(var(--v-theme-surface-variant));
|
42
|
+
border-radius: 9999px;
|
43
|
+
height: 14px;
|
44
|
+
opacity: 0.6;
|
45
|
+
min-width: 36px;
|
46
|
+
cursor: pointer;
|
47
|
+
transition: 0.2s background-color cubic-bezier(0.4, 0, 0.2, 1);
|
48
|
+
}
|
49
|
+
.v-switch--inset .v-switch__track {
|
50
|
+
border-radius: 9999px;
|
51
|
+
font-size: 0.75rem;
|
52
|
+
height: 32px;
|
53
|
+
min-width: 52px;
|
54
|
+
}
|
55
|
+
|
56
|
+
.v-switch__thumb {
|
57
|
+
align-items: center;
|
58
|
+
background-color: rgb(var(--v-theme-surface-bright));
|
59
|
+
color: rgb(var(--v-theme-on-surface-bright));
|
60
|
+
border-radius: 50%;
|
61
|
+
display: flex;
|
62
|
+
font-size: 0.75rem;
|
63
|
+
height: 20px;
|
64
|
+
justify-content: center;
|
65
|
+
width: 20px;
|
66
|
+
pointer-events: none;
|
67
|
+
transition: 0.15s 0.05s transform cubic-bezier(0, 0, 0.2, 1), 0.2s color cubic-bezier(0.4, 0, 0.2, 1), 0.2s background-color cubic-bezier(0.4, 0, 0.2, 1);
|
68
|
+
position: relative;
|
69
|
+
overflow: hidden;
|
70
|
+
}
|
71
|
+
.v-switch:not(.v-switch--inset) .v-switch__thumb {
|
72
|
+
box-shadow: 0px 2px 4px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 4px 5px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 1px 10px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12));
|
73
|
+
}
|
74
|
+
.v-switch.v-switch--flat:not(.v-switch--inset) .v-switch__thumb {
|
75
|
+
background: rgb(var(--v-theme-surface-variant));
|
76
|
+
color: rgb(var(--v-theme-on-surface-variant));
|
77
|
+
}
|
78
|
+
.v-switch.v-switch--flat:not(.v-switch--inset) .v-switch__thumb {
|
79
|
+
box-shadow: 0px 0px 0px 0px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 0px 0px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 0px 0px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12));
|
80
|
+
}
|
81
|
+
.v-switch--inset .v-switch__thumb {
|
82
|
+
height: 24px;
|
83
|
+
width: 24px;
|
84
|
+
transform: scale(0.6666666667);
|
85
|
+
}
|
86
|
+
.v-switch--inset .v-switch__thumb--filled {
|
87
|
+
transform: none;
|
88
|
+
}
|
89
|
+
.v-switch--inset .v-selection-control--dirty .v-switch__thumb {
|
90
|
+
transform: none;
|
91
|
+
transition: 0.15s 0.05s transform cubic-bezier(0, 0, 0.2, 1);
|
92
|
+
}
|
93
|
+
|
94
|
+
.v-switch.v-input {
|
95
|
+
flex: 0 1 auto;
|
96
|
+
}
|
97
|
+
.v-switch .v-selection-control {
|
98
|
+
min-height: var(--v-input-control-height);
|
99
|
+
}
|
100
|
+
.v-switch .v-selection-control__input {
|
101
|
+
border-radius: 50%;
|
102
|
+
transition: 0.2s transform cubic-bezier(0.4, 0, 0.2, 1);
|
103
|
+
position: absolute;
|
104
|
+
}
|
105
|
+
.v-locale--is-ltr.v-switch .v-selection-control__input, .v-locale--is-ltr .v-switch .v-selection-control__input {
|
106
|
+
transform: translateX(-10px);
|
107
|
+
}
|
108
|
+
|
109
|
+
.v-locale--is-rtl.v-switch .v-selection-control__input, .v-locale--is-rtl .v-switch .v-selection-control__input {
|
110
|
+
transform: translateX(10px);
|
111
|
+
}
|
112
|
+
|
113
|
+
.v-switch .v-selection-control__input .v-icon {
|
114
|
+
position: absolute;
|
115
|
+
}
|
116
|
+
.v-locale--is-ltr.v-switch .v-selection-control--dirty .v-selection-control__input, .v-locale--is-ltr .v-switch .v-selection-control--dirty .v-selection-control__input {
|
117
|
+
transform: translateX(10px);
|
118
|
+
}
|
119
|
+
|
120
|
+
.v-locale--is-rtl.v-switch .v-selection-control--dirty .v-selection-control__input, .v-locale--is-rtl .v-switch .v-selection-control--dirty .v-selection-control__input {
|
121
|
+
transform: translateX(-10px);
|
122
|
+
}
|
123
|
+
|
124
|
+
.v-switch.v-switch--indeterminate .v-selection-control__input {
|
125
|
+
transform: scale(0.8);
|
126
|
+
}
|
127
|
+
.v-switch.v-switch--indeterminate .v-switch__thumb {
|
128
|
+
transform: scale(0.75);
|
129
|
+
box-shadow: none;
|
130
|
+
}
|
131
|
+
.v-switch.v-switch--inset .v-selection-control__wrapper {
|
132
|
+
width: auto;
|
133
|
+
}
|
134
|
+
.v-switch.v-input--vertical .v-label {
|
135
|
+
min-width: max-content;
|
136
|
+
}
|
137
|
+
.v-switch.v-input--vertical .v-selection-control__wrapper {
|
138
|
+
transform: rotate(-90deg);
|
130
139
|
}
|
140
|
+
|
131
141
|
@media (forced-colors: active) {
|
132
142
|
.v-switch .v-switch__loader .v-progress-circular {
|
133
143
|
color: currentColor;
|
@@ -12,8 +12,8 @@ import { makeVSelectionControlProps, VSelectionControl } from "../VSelectionCont
|
|
12
12
|
import { useFocus } from "../../composables/focus.mjs";
|
13
13
|
import { LoaderSlot, useLoader } from "../../composables/loader.mjs";
|
14
14
|
import { useProxiedModel } from "../../composables/proxiedModel.mjs"; // Utilities
|
15
|
-
import { computed, ref } from 'vue';
|
16
|
-
import { filterInputAttrs, genericComponent,
|
15
|
+
import { computed, ref, useId } from 'vue';
|
16
|
+
import { filterInputAttrs, genericComponent, IN_BROWSER, propsFactory, useRender } from "../../util/index.mjs"; // Types
|
17
17
|
export const makeVSwitchProps = propsFactory({
|
18
18
|
indeterminate: Boolean,
|
19
19
|
inset: Boolean,
|
@@ -54,7 +54,7 @@ export const VSwitch = genericComponent()({
|
|
54
54
|
const loaderColor = computed(() => {
|
55
55
|
return typeof props.loading === 'string' && props.loading !== '' ? props.loading : props.color;
|
56
56
|
});
|
57
|
-
const uid =
|
57
|
+
const uid = useId();
|
58
58
|
const id = computed(() => props.id || `switch-${uid}`);
|
59
59
|
function onChange() {
|
60
60
|
if (indeterminate.value) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VDefaultsProvider","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","getUid","IN_BROWSER","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","value","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","control","isForcedColorsModeActive","window","matchMedia","matches","loaderColor","color","uid","id","onChange","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","_createVNode","_mergeProps","class","$event","style","_ref2","messagesId","isDisabled","isReadonly","isValid","slotProps","undefined","_ref3","backgroundColorClasses","backgroundColorStyles","_ref4","inputNode","icon","_Fragment","thumb","size","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider/VDefaultsProvider'\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, IN_BROWSER, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef, Ref } from 'vue'\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { IconValue } from '@/composables/icons'\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { GenericProps } from '@/util'\n\nexport type VSwitchSlot = {\n model: Ref<boolean>\n isValid: ComputedRef<boolean | null>\n}\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & {\n loader: LoaderSlotProps\n thumb: { icon: IconValue | undefined } & VSwitchSlot\n 'track-false': VSwitchSlot\n 'track-true': VSwitchSlot\n }\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<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VSwitchSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (value: any) => true,\n 'update:indeterminate': (value: 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 const isForcedColorsModeActive = IN_BROWSER && window.matchMedia('(forced-colors: active)').matches\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 = VInput.filterProps(props)\n const controlProps = VSelectionControl.filterProps(props)\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--flat': props.flat },\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n focused={ isFocused.value }\n style={ props.style }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => {\n const slotProps = {\n model,\n isValid,\n }\n\n return (\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: ({ backgroundColorClasses, backgroundColorStyles }) => (\n <div\n class={[\n 'v-switch__track',\n !isForcedColorsModeActive ? backgroundColorClasses.value : undefined,\n ]}\n style={ backgroundColorStyles.value }\n onClick={ onTrackClick }\n >\n { slots['track-true'] && (\n <div key=\"prepend\" class=\"v-switch__track-true\">\n { slots['track-true'](slotProps) }\n </div>\n )}\n\n { slots['track-false'] && (\n <div key=\"append\" class=\"v-switch__track-false\">\n { slots['track-false'](slotProps) }\n </div>\n )}\n </div>\n ),\n input: ({ inputNode, icon, backgroundColorClasses, backgroundColorStyles }) => (\n <>\n { inputNode }\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n props.inset || isForcedColorsModeActive ? undefined : backgroundColorClasses.value,\n ]}\n style={ props.inset ? undefined : backgroundColorStyles.value }\n >\n { slots.thumb ? (\n <VDefaultsProvider\n defaults={{\n VIcon: {\n icon,\n size: 'x-small',\n },\n }}\n >\n { slots.thumb({ ...slotProps, icon }) }\n </VDefaultsProvider>\n ) : (\n <VScaleTransition>\n { !props.loading ? (\n (icon && (\n <VIcon\n key={ String(icon) }\n icon={ icon }\n size=\"x-small\"\n />\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 )}\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n )\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,SAChBC,iBAAiB;AAAA,SACjBC,KAAK;AAAA,SACLC,eAAe,EAAEC,MAAM;AAAA,SACvBC,iBAAiB;AAAA,SACjBC,0BAA0B,EAAEC,iBAAiB,sDAEtD;AAAA,SACSC,QAAQ;AAAA,SACRC,UAAU,EAAEC,SAAS;AAAA,SACrBC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC1BC,gBAAgB,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,UAAU,EAAEC,YAAY,EAAEC,SAAS,gCAExF;AAuBA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,aAAa,EAAEC,OAAO;EACtBC,KAAK,EAAED,OAAO;EACdE,IAAI,EAAEF,OAAO;EACbG,OAAO,EAAE;IACPC,IAAI,EAAE,CAACJ,OAAO,EAAEK,MAAM,CAAC;IACvBC,OAAO,EAAE;EACX,CAAC;EAED,GAAGzB,eAAe,CAAC,CAAC;EACpB,GAAGG,0BAA0B,CAAC;AAChC,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,MAAMuB,OAAO,GAAGd,gBAAgB,CAMQ,CAAC,CAAC;EAC/Ce,IAAI,EAAE,SAAS;EAEfC,YAAY,EAAE,KAAK;EAEnBC,KAAK,EAAEZ,gBAAgB,CAAC,CAAC;EAEzBa,KAAK,EAAE;IACL,gBAAgB,EAAGC,OAAgB,IAAK,IAAI;IAC5C,mBAAmB,EAAGC,KAAU,IAAK,IAAI;IACzC,sBAAsB,EAAGA,KAAc,IAAK;EAC9C,CAAC;EAEDC,KAAKA,CAAEJ,KAAK,EAAAK,IAAA,EAAoB;IAAA,IAAlB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OAAA,EAAAA,CAAA,MAECW,KAAK,CAAC8C,KAAK,CAAC;kBAAE,GAAGT,SAAS;kBAAEO;gBAAK,CAAC,CAAC;cAAA,KAAAjB,YAAA,CAAAlE,gBAAA;gBAAA4B,OAAA,EAAAA,CAAA,MAInC,CAACI,KAAK,CAACP,OAAO,GACb0D,IAAI,IAAAjB,YAAA,CAAAhE,KAAA;kBAAA,OAEKyB,MAAM,CAACwD,IAAI,CAAC;kBAAA,QACXA,IAAI;kBAAA;gBAAA,QAGd,GAAAjB,YAAA,CAAAzD,UAAA;kBAAA;kBAAA;kBAAA,SAISkE,OAAO,CAACxC,KAAK,KAAK,KAAK,GAAG0C,SAAS,GAAG3B,WAAW,CAACf;gBAAK;kBAAAP,OAAA,EAE7DgD,SAAS,IACTrC,KAAK,CAACgD,MAAM,GACRhD,KAAK,CAACgD,MAAM,CAACX,SAAS,CAAC,GAAAV,YAAA,CAAA7D,iBAAA;oBAAA,UAGZuE,SAAS,CAACY,QAAQ;oBAAA,SACnBZ,SAAS,CAACzB,KAAK;oBAAA;oBAAA;oBAAA;kBAAA;gBAM9B,EAEJ;cAAA,EAEJ;YAAA;UAGN;QAIT;MAAC;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VDefaultsProvider","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","useId","filterInputAttrs","genericComponent","IN_BROWSER","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","value","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","control","isForcedColorsModeActive","window","matchMedia","matches","loaderColor","color","uid","id","onChange","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","_createVNode","_mergeProps","class","$event","style","_ref2","messagesId","isDisabled","isReadonly","isValid","slotProps","undefined","_ref3","backgroundColorClasses","backgroundColorStyles","_ref4","inputNode","icon","_Fragment","thumb","size","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider/VDefaultsProvider'\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, useId } from 'vue'\nimport { filterInputAttrs, genericComponent, IN_BROWSER, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef, Ref } from 'vue'\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { IconValue } from '@/composables/icons'\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { GenericProps } from '@/util'\n\nexport type VSwitchSlot = {\n model: Ref<boolean>\n isValid: ComputedRef<boolean | null>\n}\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & {\n loader: LoaderSlotProps\n thumb: { icon: IconValue | undefined } & VSwitchSlot\n 'track-false': VSwitchSlot\n 'track-true': VSwitchSlot\n }\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<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VSwitchSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (value: any) => true,\n 'update:indeterminate': (value: 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 const isForcedColorsModeActive = IN_BROWSER && window.matchMedia('(forced-colors: active)').matches\n\n const loaderColor = computed(() => {\n return typeof props.loading === 'string' && props.loading !== ''\n ? props.loading\n : props.color\n })\n\n const uid = useId()\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 = VInput.filterProps(props)\n const controlProps = VSelectionControl.filterProps(props)\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--flat': props.flat },\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n focused={ isFocused.value }\n style={ props.style }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => {\n const slotProps = {\n model,\n isValid,\n }\n\n return (\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: ({ backgroundColorClasses, backgroundColorStyles }) => (\n <div\n class={[\n 'v-switch__track',\n !isForcedColorsModeActive ? backgroundColorClasses.value : undefined,\n ]}\n style={ backgroundColorStyles.value }\n onClick={ onTrackClick }\n >\n { slots['track-true'] && (\n <div key=\"prepend\" class=\"v-switch__track-true\">\n { slots['track-true'](slotProps) }\n </div>\n )}\n\n { slots['track-false'] && (\n <div key=\"append\" class=\"v-switch__track-false\">\n { slots['track-false'](slotProps) }\n </div>\n )}\n </div>\n ),\n input: ({ inputNode, icon, backgroundColorClasses, backgroundColorStyles }) => (\n <>\n { inputNode }\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n props.inset || isForcedColorsModeActive ? undefined : backgroundColorClasses.value,\n ]}\n style={ props.inset ? undefined : backgroundColorStyles.value }\n >\n { slots.thumb ? (\n <VDefaultsProvider\n defaults={{\n VIcon: {\n icon,\n size: 'x-small',\n },\n }}\n >\n { slots.thumb({ ...slotProps, icon }) }\n </VDefaultsProvider>\n ) : (\n <VScaleTransition>\n { !props.loading ? (\n (icon && (\n <VIcon\n key={ String(icon) }\n icon={ icon }\n size=\"x-small\"\n />\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 )}\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n )\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,SAChBC,iBAAiB;AAAA,SACjBC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AAhE,KAAA;kBAAA,OAEKyB,MAAM,CAACwD,IAAI,CAAC;kBAAA,QACXA,IAAI;kBAAA;gBAAA,QAGd,GAAAjB,YAAA,CAAAzD,UAAA;kBAAA;kBAAA;kBAAA,SAISkE,OAAO,CAACxC,KAAK,KAAK,KAAK,GAAG0C,SAAS,GAAG3B,WAAW,CAACf;gBAAK;kBAAAP,OAAA,EAE7DgD,SAAS,IACTrC,KAAK,CAACgD,MAAM,GACRhD,KAAK,CAACgD,MAAM,CAACX,SAAS,CAAC,GAAAV,YAAA,CAAA7D,iBAAA;oBAAA,UAGZuE,SAAS,CAACY,QAAQ;oBAAA,SACnBZ,SAAS,CAACzB,KAAK;oBAAA;oBAAA;oBAAA;kBAAA;gBAM9B,EAEJ;cAAA,EAEJ;YAAA;UAGN;QAIT;MAAC;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -1,46 +1,44 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
.v-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
padding-inline-end: calc(var(--v-scrollbar-offset) + 8px);
|
45
|
-
}
|
1
|
+
.v-system-bar {
|
2
|
+
align-items: center;
|
3
|
+
display: flex;
|
4
|
+
flex: 1 1 auto;
|
5
|
+
height: 24px;
|
6
|
+
justify-content: flex-end;
|
7
|
+
max-width: 100%;
|
8
|
+
padding-inline: 8px;
|
9
|
+
position: relative;
|
10
|
+
text-align: end;
|
11
|
+
width: 100%;
|
12
|
+
}
|
13
|
+
.v-system-bar .v-icon {
|
14
|
+
opacity: var(--v-medium-emphasis-opacity);
|
15
|
+
}
|
16
|
+
.v-system-bar {
|
17
|
+
box-shadow: 0px 0px 0px 0px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 0px 0px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 0px 0px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12));
|
18
|
+
}
|
19
|
+
.v-system-bar--absolute {
|
20
|
+
position: absolute;
|
21
|
+
}
|
22
|
+
.v-system-bar--fixed {
|
23
|
+
position: fixed;
|
24
|
+
}
|
25
|
+
.v-system-bar {
|
26
|
+
background: rgba(var(--v-theme-surface-light));
|
27
|
+
color: rgba(var(--v-theme-on-surface-light), var(--v-high-emphasis-opacity));
|
28
|
+
}
|
29
|
+
.v-system-bar {
|
30
|
+
font-size: 0.75rem;
|
31
|
+
font-weight: 400;
|
32
|
+
letter-spacing: 0.0333333333em;
|
33
|
+
line-height: 1.667;
|
34
|
+
text-transform: none;
|
35
|
+
}
|
36
|
+
.v-system-bar--rounded {
|
37
|
+
border-radius: 0;
|
38
|
+
}
|
39
|
+
.v-system-bar--window {
|
40
|
+
height: 32px;
|
41
|
+
}
|
42
|
+
.v-system-bar:not(.v-system-bar--absolute) {
|
43
|
+
padding-inline-end: calc(var(--v-scrollbar-offset) + 8px);
|
46
44
|
}
|