@fastkit/vui 0.12.8 → 0.12.9
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/LICENSE +1 -1
- package/dist/vui.css +2786 -2716
- package/dist/vui.css.map +1 -0
- package/dist/vui.d.ts +9072 -10172
- package/dist/vui.mjs +2141 -1969
- package/dist/vui.mjs.map +1 -0
- package/package.json +89 -59
- package/src/components/VApp/VApp.tsx +3 -1
- package/src/components/VAvatar/VAvatar.scss +62 -60
- package/src/components/VAvatar/VAvatar.tsx +6 -1
- package/src/components/VBreadcrumbs/VBreadcrumbs.scss +53 -51
- package/src/components/VBusyImage/VBusyImage.scss +50 -51
- package/src/components/VButton/VButton.scss +120 -118
- package/src/components/VButton/VButton.tsx +6 -1
- package/src/components/VButton/VButtonGroup.scss +21 -19
- package/src/components/VCard/VCard.scss +41 -42
- package/src/components/VCard/VCard.tsx +5 -0
- package/src/components/VCard/VCardActions.scss +9 -7
- package/src/components/VCard/VCardContent.scss +4 -2
- package/src/components/VCheckable/VCheckable.scss +79 -80
- package/src/components/VCheckable/VCheckable.tsx +1 -1
- package/src/components/VCheckbox/VCheckbox.scss +50 -48
- package/src/components/VCheckbox/VCheckbox.tsx +2 -2
- package/src/components/VChip/VChip.scss +61 -59
- package/src/components/VChip/VChip.tsx +6 -1
- package/src/components/VContentSwitcher/VContentSwitcher.scss +52 -50
- package/src/components/VControlField/VControlField.scss +148 -146
- package/src/components/VControlField/VControlField.tsx +3 -3
- package/src/components/VDataTable/VDataTable.scss +167 -168
- package/src/components/VDrawerLayout/VDrawerLayout.scss +27 -25
- package/src/components/VForm/VForm.tsx +3 -4
- package/src/components/VFormControl/VFormControl.scss +84 -82
- package/src/components/VFormControl/VFormControl.tsx +2 -3
- package/src/components/VGrid/VGridContainer.scss +5 -3
- package/src/components/VGrid/VGridItem.scss +4 -2
- package/src/components/VHero/VHero.scss +23 -21
- package/src/components/VIcon/VIcon.scss +19 -17
- package/src/components/VListTile/VListTile.scss +60 -58
- package/src/components/VListTile/VListTile.tsx +5 -0
- package/src/components/VNavigation/VNavigation.scss +12 -10
- package/src/components/VNavigation/VNavigationItem.scss +21 -19
- package/src/components/VNavigation/VNavigationItem.tsx +5 -0
- package/src/components/VOption/VOption.scss +55 -56
- package/src/components/VOption/VOption.tsx +2 -2
- package/src/components/VOptionGroup/VOptionGroup.scss +14 -12
- package/src/components/VOptionGroup/VOptionGroup.tsx +3 -1
- package/src/components/VPagination/VPagination.scss +81 -79
- package/src/components/VPagination/VPagination.tsx +1 -1
- package/src/components/VPaper/VPaper.scss +43 -41
- package/src/components/VRadio/VRadio.scss +52 -53
- package/src/components/VRadio/VRadio.tsx +2 -2
- package/src/components/VSelect/VSelect.scss +77 -75
- package/src/components/VSelect/VSelect.tsx +5 -2
- package/src/components/VSkeltonLoader/VSkeltonLoaderBone.scss +24 -22
- package/src/components/VSwitch/VSwitch.scss +96 -94
- package/src/components/VSwitch/VSwitch.tsx +2 -2
- package/src/components/VTabs/VTab.scss +59 -57
- package/src/components/VTabs/VTabs.scss +41 -39
- package/src/components/VTabs/VTabs.tsx +5 -2
- package/src/components/VTextCounter/VTextCounter.scss +4 -2
- package/src/components/VTextField/VTextField.scss +37 -35
- package/src/components/VTextField/VTextField.tsx +2 -2
- package/src/components/VTextarea/VTextarea.scss +33 -31
- package/src/components/VTextarea/VTextarea.tsx +2 -2
- package/src/components/VToolbar/VToolbar.scss +19 -17
- package/src/components/VToolbar/VToolbarEdge.scss +21 -19
- package/src/components/VToolbar/VToolbarMenu.scss +6 -4
- package/src/components/VToolbar/VToolbarMenu.tsx +5 -0
- package/src/components/VToolbar/VToolbarTitle.scss +19 -17
- package/src/components/VWysiwygEditor/VWysiwygEditor.scss +52 -50
- package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +2 -2
- package/src/components/VWysiwygEditor/extensions/linter/Linter.scss +108 -109
- package/src/components/VWysiwygEditor/schemes.ts +1 -1
- package/src/components/VWysiwygEditor/tools/color.scss +106 -112
- package/src/components/kits.ts +1 -1
- package/src/composables/control.ts +1 -1
- package/src/composables/form-selector.scss +20 -18
- package/src/composables/form-selector.tsx +5 -3
- package/src/index.ts +13 -2
- package/src/plugin.tsx +4 -4
- package/src/schemes/control.ts +2 -2
- package/src/service.tsx +5 -5
- package/src/styles/core/functions.scss +2 -2
- package/src/styles/index.scss +23 -9
- package/dist/tool/index.d.ts +0 -2
- package/dist/tool/index.d.ts.map +0 -1
- package/dist/tool/index.mjs +0 -193
- package/dist/tool/vite-plugin.d.ts +0 -25
- package/dist/tool/vite-plugin.d.ts.map +0 -1
- package/src/.DS_Store +0 -0
- package/src/assets/builtins/color-scheme.ts +0 -9
- package/src/assets/builtins/media-match.ts +0 -3
- package/src/components/.DS_Store +0 -0
- package/src/components/VAvatar/.DS_Store +0 -0
- package/src/components/VChip/.DS_Store +0 -0
- package/src/components/VSkeltonLoader/.DS_Store +0 -0
- package/src/components/VTextField/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/extensions/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/extensions/linter/.DS_Store +0 -0
- package/src/tool/index.ts +0 -2
- package/src/tool/vite-plugin.ts +0 -266
- /package/{src/styles → dist}/after-effects/display-flow.scss +0 -0
- /package/{src/styles → dist}/after-effects/spacing.scss +0 -0
- /package/{src/styles → dist}/after-effects/text.scss +0 -0
- /package/{src/styles → dist}/after-effects.scss +0 -0
- /package/dist/{assets/builtins → builtins}/color-scheme.ts +0 -0
- /package/dist/{assets/builtins → builtins}/media-match.ts +0 -0
|
@@ -1,146 +1,148 @@
|
|
|
1
1
|
@use 'sass:math';
|
|
2
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
|
-
|
|
3
|
+
@layer vui {
|
|
4
|
+
.v-button {
|
|
5
|
+
// $base-height: 2.285714285714286em;
|
|
6
|
+
$base-height: 2.571428571428571em;
|
|
7
|
+
|
|
8
|
+
--padding: 1em;
|
|
9
|
+
--height: #{$base-height};
|
|
10
|
+
--icon-margin: 0.6em;
|
|
11
|
+
|
|
12
|
+
position: relative;
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
flex: 0 0 auto;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
min-width: calc(var(--root-em) * 4);
|
|
18
|
+
// height: calc(var(--root-em) * 2);
|
|
19
|
+
height: var(--height);
|
|
20
|
+
// padding: 0 var(--root-em);
|
|
21
|
+
padding: 0 var(--padding);
|
|
22
|
+
// margin: 0;
|
|
23
|
+
margin: calc(var(--root-em) * 0.375) calc(var(--root-em) * 0.5);
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
font: inherit;
|
|
26
|
+
// font-size: calc(var(--root-em) * 0.875);
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
line-height: 1;
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
text-transform: uppercase;
|
|
31
|
+
letter-spacing: math.div(1.25, 14) * 1em; //1.25px;
|
|
32
|
+
vertical-align: bottom;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
user-select: none;
|
|
35
|
+
border-style: solid;
|
|
36
|
+
border-width: 1px;
|
|
37
|
+
border-radius: var(--control-field-radius);
|
|
38
|
+
outline: 0;
|
|
39
|
+
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1), color 1ms;
|
|
40
|
+
appearance: none;
|
|
41
|
+
|
|
42
|
+
&--align-left {
|
|
43
|
+
justify-content: flex-start;
|
|
44
|
+
}
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
&--align-right {
|
|
47
|
+
justify-content: flex-end;
|
|
48
|
+
}
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
&--plain {
|
|
51
|
+
color: inherit !important;
|
|
52
|
+
// color: inherit !important;
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
&[disabled] {
|
|
55
|
+
opacity: 0.5;
|
|
56
|
+
}
|
|
55
57
|
}
|
|
56
|
-
}
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
&--sm {
|
|
60
|
+
// height: 2em;
|
|
61
|
+
// height: calc(var(--root-em) * 1.5); // 24
|
|
62
|
+
font-size: calc(var(--root-em) * 0.75); // 12
|
|
63
|
+
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
&--md {
|
|
66
|
+
// height: 2.285714285714286em;
|
|
67
|
+
// height: calc(var(--root-em) * 2); // 32
|
|
68
|
+
// font-size: calc(var(--root-em) * 0.875); // 14
|
|
69
|
+
font-size: calc(var(--root-em) * 0.875); // 14
|
|
70
|
+
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
&--lg {
|
|
73
|
+
// height: calc(var(--root-em) * 2.875); // 46
|
|
74
|
+
font-size: calc(var(--root-em) * 1.375); // 20
|
|
75
|
+
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
&--rounded {
|
|
78
|
+
--padding: 0;
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
min-width: 0;
|
|
81
|
+
aspect-ratio: 1 / 1;
|
|
82
|
+
margin: calc(var(--root-em) * 0.125) calc(var(--root-em) * 0.125);
|
|
83
|
+
border-radius: 50%;
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
--height: auto;
|
|
86
|
+
}
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
&--icon {
|
|
89
|
+
// aspect-ratio: 1 / 1;
|
|
90
|
+
min-width: #{$base-height * 0.75};
|
|
91
|
+
margin: calc(var(--root-em) * 0.125) calc(var(--root-em) * 0.125);
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
// --height: #{$base-height};
|
|
94
|
+
// --height: calc(var);
|
|
95
|
+
--height: #{$base-height * 0.75};
|
|
96
|
+
--padding: 0em;
|
|
97
|
+
}
|
|
97
98
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
&::-moz-focus-inner {
|
|
100
|
+
border: 0;
|
|
101
|
+
}
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
&[disabled] {
|
|
104
|
+
cursor: default;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--spacer {
|
|
108
|
+
&-left {
|
|
109
|
+
margin-left: auto;
|
|
110
|
+
}
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
&-right {
|
|
113
|
+
margin-right: auto;
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
&__content {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
justify-self: stretch;
|
|
122
|
+
pointer-events: none;
|
|
113
123
|
}
|
|
114
|
-
}
|
|
115
124
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
justify-self: stretch;
|
|
121
|
-
pointer-events: none;
|
|
122
|
-
}
|
|
125
|
+
&--loading &__content {
|
|
126
|
+
// pointer-events: none;
|
|
127
|
+
opacity: 0;
|
|
128
|
+
}
|
|
123
129
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
&__icon {
|
|
131
|
+
&--start {
|
|
132
|
+
margin-right: var(--icon-margin);
|
|
133
|
+
}
|
|
128
134
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
&--end {
|
|
136
|
+
margin-left: var(--icon-margin);
|
|
137
|
+
}
|
|
132
138
|
}
|
|
133
139
|
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
&__loading {
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: 50%;
|
|
143
|
+
left: 50%;
|
|
144
|
+
z-index: 1;
|
|
145
|
+
transform: translate(-50%, -50%);
|
|
136
146
|
}
|
|
137
147
|
}
|
|
138
|
-
|
|
139
|
-
&__loading {
|
|
140
|
-
position: absolute;
|
|
141
|
-
top: 50%;
|
|
142
|
-
left: 50%;
|
|
143
|
-
z-index: 1;
|
|
144
|
-
transform: translate(-50%, -50%);
|
|
145
|
-
}
|
|
146
148
|
}
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
} from 'vue';
|
|
9
9
|
import { colorSchemeProps, useColorClasses } from '@fastkit/vue-color-scheme';
|
|
10
10
|
import {
|
|
11
|
-
navigationableInheritProps,
|
|
12
11
|
ExtractPropInput,
|
|
13
12
|
createPropsOptions,
|
|
14
13
|
renderSlotOrEmpty,
|
|
15
14
|
htmlAttributesPropOptions,
|
|
16
15
|
VLink,
|
|
16
|
+
navigationableInheritProps,
|
|
17
17
|
} from '@fastkit/vue-utils';
|
|
18
18
|
import { useVui } from '../../injections';
|
|
19
19
|
import { createControlProps, useControl } from '../../composables';
|
|
@@ -22,6 +22,11 @@ import { ControlSize } from '../../schemes/control';
|
|
|
22
22
|
import { VIcon } from '../VIcon';
|
|
23
23
|
import type { IconName } from '../VIcon';
|
|
24
24
|
|
|
25
|
+
// @TODO Unable to resolve dts for `navigationableInheritProps`.
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
29
|
+
|
|
25
30
|
export type VButtonSpacer = 'left' | 'right';
|
|
26
31
|
|
|
27
32
|
export type RawVButtonSpacer = boolean | VButtonSpacer;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
@layer vui {
|
|
2
|
+
.v-button-group {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: stretch;
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
&__item {
|
|
7
|
+
position: relative;
|
|
8
|
+
margin: 0;
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
&--has-left {
|
|
11
|
+
border-top-left-radius: 0;
|
|
12
|
+
border-bottom-left-radius: 0;
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
&--has-right {
|
|
16
|
+
border-top-right-radius: 0;
|
|
17
|
+
border-bottom-right-radius: 0;
|
|
18
|
+
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
&:focus {
|
|
21
|
+
z-index: 1;
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
|
-
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
// &--has-icon &__item {
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
// }
|
|
28
|
+
}
|
|
27
29
|
}
|
|
@@ -1,54 +1,53 @@
|
|
|
1
1
|
@use '../../styles/core.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
&:focus {
|
|
19
|
-
text-decoration: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&.clickable {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
|
|
25
|
-
&::before {
|
|
26
|
-
position: absolute;
|
|
27
|
-
top: 0;
|
|
28
|
-
right: 0;
|
|
29
|
-
bottom: 0;
|
|
30
|
-
left: 0;
|
|
31
|
-
content: '';
|
|
32
|
-
background: currentColor;
|
|
33
|
-
border-radius: inherit;
|
|
34
|
-
opacity: 0;
|
|
35
|
-
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
|
|
36
|
-
}
|
|
37
|
-
|
|
3
|
+
@layer vui {
|
|
4
|
+
.v-card {
|
|
5
|
+
@include core.remove-tap-highlight();
|
|
6
|
+
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding: 0;
|
|
10
|
+
text-align: left;
|
|
11
|
+
touch-action: manipulation;
|
|
12
|
+
user-select: none;
|
|
13
|
+
border: 0;
|
|
14
|
+
outline: 0;
|
|
15
|
+
appearance: none;
|
|
16
|
+
|
|
17
|
+
&,
|
|
38
18
|
&:hover,
|
|
39
19
|
&:focus {
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.clickable {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
40
26
|
&::before {
|
|
41
|
-
|
|
27
|
+
position: absolute;
|
|
28
|
+
inset: 0;
|
|
29
|
+
content: '';
|
|
30
|
+
background: currentColor;
|
|
31
|
+
border-radius: inherit;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:hover,
|
|
37
|
+
&:focus {
|
|
38
|
+
&::before {
|
|
39
|
+
opacity: 0.125;
|
|
40
|
+
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
}
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
&[disabled] {
|
|
45
|
+
pointer-events: none;
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
&::before {
|
|
48
|
+
content: none;
|
|
49
|
+
}
|
|
51
50
|
}
|
|
51
|
+
// noop
|
|
52
52
|
}
|
|
53
|
-
// noop
|
|
54
53
|
}
|
|
@@ -3,6 +3,11 @@ import { defineComponent, computed } from 'vue';
|
|
|
3
3
|
import { VPaper, createPaperProps } from '../VPaper';
|
|
4
4
|
import { navigationableInheritProps, VLink } from '@fastkit/vue-utils';
|
|
5
5
|
|
|
6
|
+
// @TODO Unable to resolve dts for `navigationableInheritProps`.
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
10
|
+
|
|
6
11
|
export function createCardProps() {
|
|
7
12
|
return {
|
|
8
13
|
...createPaperProps(),
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
@layer vui {
|
|
2
|
+
.v-card-actions {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: var(--card-actions-padding);
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
.v-btn {
|
|
8
|
+
margin-top: 0;
|
|
9
|
+
margin-bottom: 0;
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
}
|
|
@@ -1,103 +1,102 @@
|
|
|
1
1
|
@use '../../styles/core.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
display: inline-flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
padding-right: 1em;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
user-select: none;
|
|
17
|
-
|
|
18
|
-
&--invalid:not(#{&}--readonly) {
|
|
19
|
-
--color: var(--main-color);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&--disabled {
|
|
23
|
-
--color: var(--control-disabled-color);
|
|
24
|
-
// --color: var(--main-color);
|
|
25
|
-
|
|
26
|
-
pointer-events: none;
|
|
27
|
-
cursor: default;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&--readonly {
|
|
31
|
-
pointer-events: none;
|
|
32
|
-
cursor: default;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
input {
|
|
36
|
-
@include core.hidden-input-element;
|
|
37
|
-
}
|
|
3
|
+
@layer vui {
|
|
4
|
+
.v-checkable {
|
|
5
|
+
--outer-size: var(--control-checkable-outer-size);
|
|
6
|
+
--icon-size: var(--control-checkable-icon-size);
|
|
7
|
+
--color: var(--control-checkable-base-color);
|
|
8
|
+
|
|
9
|
+
&--checked {
|
|
10
|
+
--color: var(--main-color);
|
|
11
|
+
}
|
|
38
12
|
|
|
39
|
-
&__faux {
|
|
40
|
-
position: relative;
|
|
41
13
|
display: inline-flex;
|
|
42
|
-
flex: 0 0 var(--outer-size);
|
|
43
14
|
align-items: center;
|
|
44
|
-
|
|
45
|
-
width: var(--outer-size);
|
|
46
|
-
height: var(--outer-size);
|
|
47
|
-
margin: var(--control-checkable-faux-margin);
|
|
48
|
-
margin-left: 0;
|
|
49
|
-
color: var(--color);
|
|
15
|
+
padding-right: 1em;
|
|
50
16
|
cursor: pointer;
|
|
17
|
+
user-select: none;
|
|
18
|
+
|
|
19
|
+
&--invalid:not(#{&}--readonly) {
|
|
20
|
+
--color: var(--main-color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--disabled {
|
|
24
|
+
--color: var(--control-disabled-color);
|
|
25
|
+
// --color: var(--main-color);
|
|
51
26
|
|
|
52
|
-
&__icon {
|
|
53
|
-
position: relative;
|
|
54
|
-
display: block;
|
|
55
|
-
width: var(--icon-size);
|
|
56
|
-
height: var(--icon-size);
|
|
57
27
|
pointer-events: none;
|
|
58
|
-
|
|
28
|
+
cursor: default;
|
|
59
29
|
}
|
|
60
30
|
|
|
61
|
-
|
|
62
|
-
position: absolute;
|
|
63
|
-
top: 0;
|
|
64
|
-
right: 0;
|
|
65
|
-
bottom: 0;
|
|
66
|
-
left: 0;
|
|
67
|
-
display: block;
|
|
31
|
+
&--readonly {
|
|
68
32
|
pointer-events: none;
|
|
69
|
-
|
|
70
|
-
background: currentColor;
|
|
71
|
-
border-radius: 50%;
|
|
72
|
-
opacity: 0;
|
|
73
|
-
transition: opacity 0.2s;
|
|
33
|
+
cursor: default;
|
|
74
34
|
}
|
|
75
35
|
|
|
76
|
-
|
|
77
|
-
|
|
36
|
+
input {
|
|
37
|
+
@include core.hidden-input-element;
|
|
78
38
|
}
|
|
79
|
-
}
|
|
80
39
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
40
|
+
&__faux {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
flex: 0 0 var(--outer-size);
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
width: var(--outer-size);
|
|
47
|
+
height: var(--outer-size);
|
|
48
|
+
margin: var(--control-checkable-faux-margin);
|
|
49
|
+
margin-left: 0;
|
|
50
|
+
color: var(--color);
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
|
|
53
|
+
&__icon {
|
|
54
|
+
position: relative;
|
|
55
|
+
display: block;
|
|
56
|
+
width: var(--icon-size);
|
|
57
|
+
height: var(--icon-size);
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
transform: scale(var(--control-checkable-faux-scale));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::before {
|
|
63
|
+
position: absolute;
|
|
64
|
+
inset: 0;
|
|
65
|
+
display: block;
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
content: '';
|
|
68
|
+
background: currentColor;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
opacity: 0;
|
|
71
|
+
transition: opacity 0.2s;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:hover::before {
|
|
75
|
+
opacity: 0.1;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
84
78
|
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
&--custom-icon &__faux {
|
|
80
|
+
flex-basis: auto;
|
|
81
|
+
width: auto;
|
|
82
|
+
|
|
83
|
+
&::before {
|
|
84
|
+
content: none;
|
|
85
|
+
}
|
|
87
86
|
}
|
|
88
|
-
}
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
&:focus-within &__faux {
|
|
89
|
+
&::before {
|
|
90
|
+
opacity: 0.2;
|
|
91
|
+
}
|
|
93
92
|
}
|
|
94
|
-
}
|
|
95
93
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
&__label {
|
|
95
|
+
line-height: 1.5;
|
|
96
|
+
}
|
|
99
97
|
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
&--disabled &__label {
|
|
99
|
+
color: var(--color);
|
|
100
|
+
}
|
|
102
101
|
}
|
|
103
102
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './VCheckable.scss';
|
|
2
2
|
import { computed, defineComponent } from 'vue';
|
|
3
|
-
import { defineSlotsProps, renderSlotOrEmpty } from '@fastkit/vue-
|
|
3
|
+
import { defineSlotsProps, renderSlotOrEmpty } from '@fastkit/vue-utils';
|
|
4
4
|
import { useVuiColorProvider } from '../../injections';
|
|
5
5
|
|
|
6
6
|
export const VCheckable = defineComponent({
|