@toife/vue 3.1.4 → 3.1.6
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/README.md +1 -1
- package/package.json +4 -4
- package/src/components/action/action.scss +2 -2
- package/src/components/action/action.vue +5 -5
- package/src/components/app/app.scss +3 -3
- package/src/components/app/app.type.ts +0 -6
- package/src/components/app/app.vue +2 -8
- package/src/components/avatar/avatar.scss +4 -3
- package/src/components/avatar/avatar.vue +6 -6
- package/src/components/button/button.scss +29 -21
- package/src/components/button/button.type.ts +2 -4
- package/src/components/button/button.vue +7 -7
- package/src/components/cable/cable.vue +2 -2
- package/src/components/card/card/card.scss +3 -3
- package/src/components/card/card/card.vue +5 -5
- package/src/components/card/card-body/card-body.scss +3 -3
- package/src/components/card/card-body/card-body.vue +2 -2
- package/src/components/card/card-footer/card-footer.scss +4 -4
- package/src/components/card/card-footer/card-footer.vue +2 -2
- package/src/components/card/card-header/card-header.scss +4 -4
- package/src/components/card/card-header/card-header.vue +2 -2
- package/src/components/checkbox/checkbox.html +1 -1
- package/src/components/checkbox/checkbox.scss +19 -14
- package/src/components/checkbox/checkbox.type.ts +1 -3
- package/src/components/checkbox/checkbox.vue +7 -7
- package/src/components/collapse/collapse.html +1 -1
- package/src/components/collapse/collapse.scss +4 -7
- package/src/components/collapse/collapse.vue +9 -9
- package/src/components/container/container.vue +2 -2
- package/src/components/decision-modal/decision-modal.scss +11 -11
- package/src/components/decision-modal/decision-modal.vue +8 -8
- package/src/components/divider/divider.scss +3 -3
- package/src/components/divider/divider.vue +4 -4
- package/src/components/dropdown/dropdown.scss +4 -4
- package/src/components/dropdown/dropdown.type.ts +2 -2
- package/src/components/dropdown/dropdown.vue +7 -9
- package/src/components/field/field.html +28 -9
- package/src/components/field/{outline/outline.scss → field.scss} +29 -125
- package/src/components/field/field.type.ts +4 -4
- package/src/components/field/field.vue +83 -46
- package/src/components/field/index.ts +1 -1
- package/src/components/form-group/form-group.vue +2 -2
- package/src/components/gesture-indicator/gesture-indicator.scss +2 -2
- package/src/components/gesture-indicator/gesture-indicator.vue +4 -4
- package/src/components/image/image.vue +12 -5
- package/src/components/layout/flex/flex.vue +8 -8
- package/src/components/layout/flex-item/flex-item.vue +6 -6
- package/src/components/layout/grid/grid.vue +6 -6
- package/src/components/layout/grid-item/grid-item.vue +6 -6
- package/src/components/modal/modal.scss +2 -2
- package/src/components/modal/modal.vue +68 -5
- package/src/components/page/page.vue +2 -2
- package/src/components/present/present.scss +4 -4
- package/src/components/present/present.vue +14 -14
- package/src/components/radio/radio/radio.html +1 -1
- package/src/components/radio/radio/radio.scss +19 -14
- package/src/components/radio/radio/radio.type.ts +1 -3
- package/src/components/radio/radio/radio.vue +6 -6
- package/src/components/radio/radio-group/radio-group.vue +2 -2
- package/src/components/refresher/refresher.html +0 -3
- package/src/components/refresher/refresher.scss +1 -25
- package/src/components/refresher/refresher.vue +2 -16
- package/src/components/route/route-navigator/route-navigator.html +1 -1
- package/src/components/route/route-navigator/route-navigator.scss +3 -3
- package/src/components/route/route-navigator/route-navigator.vue +11 -14
- package/src/components/route/route-wrapper/route-wrapper.composable.ts +5 -15
- package/src/components/route/route-wrapper/route-wrapper.type.ts +0 -4
- package/src/components/route/route-wrapper/route-wrapper.vue +4 -12
- package/src/components/route/route.type.ts +0 -1
- package/src/components/segmented-field/segmented-field.html +1 -1
- package/src/components/segmented-field/segmented-field.scss +3 -3
- package/src/components/segmented-field/segmented-field.vue +8 -8
- package/src/components/select/select.html +2 -2
- package/src/components/select/select.scss +11 -11
- package/src/components/select/select.vue +10 -10
- package/src/components/skeleton/skeleton.scss +1 -1
- package/src/components/skeleton/skeleton.vue +7 -7
- package/src/components/slide-range/slide-range.html +3 -4
- package/src/components/slide-range/slide-range.scss +17 -14
- package/src/components/slide-range/slide-range.vue +17 -16
- package/src/components/switch/switch.html +1 -1
- package/src/components/switch/switch.scss +23 -21
- package/src/components/switch/switch.type.ts +2 -3
- package/src/components/switch/switch.vue +23 -9
- package/src/components/tabs/tab/tab.html +1 -1
- package/src/components/tabs/tab/tab.scss +13 -0
- package/src/components/tabs/tab/tab.vue +4 -2
- package/src/components/tabs/tabs/index.ts +1 -0
- package/src/components/tabs/tabs/tabs.scss +82 -54
- package/src/components/tabs/tabs/tabs.type.ts +4 -1
- package/src/components/tabs/tabs/tabs.vue +47 -23
- package/src/components/toast/toast/toast.scss +1 -1
- package/src/components/toast/toast/toast.vue +2 -2
- package/src/components/toast/toast-content/toast-content.scss +4 -4
- package/src/components/toast/toast-content/toast-content.vue +5 -5
- package/src/components/toolbar/toolbar.scss +4 -4
- package/src/components/toolbar/toolbar.vue +5 -5
- package/src/factory.ts +105 -51
- package/src/type.ts +2 -1
- package/src/utils/style/index.ts +9 -9
- package/src/utils/style.md +9 -9
- package/src/components/field/outline/index.ts +0 -1
- package/src/components/field/outline/outline.html +0 -36
- package/src/components/field/outline/outline.vue +0 -286
|
@@ -12,7 +12,31 @@ $tabs-underline-color-active: sass.fn-naming-var("tabs", "underline", "color", "
|
|
|
12
12
|
$tabs-underline-color-hover: sass.fn-naming-var("tabs", "underline", "color", "hover");
|
|
13
13
|
$tabs-underline-color-focus: sass.fn-naming-var("tabs", "underline", "color", "focus");
|
|
14
14
|
$tabs-underline-color-disabled: sass.fn-naming-var("tabs", "underline", "color", "disabled");
|
|
15
|
-
$tabs-underline-
|
|
15
|
+
$tabs-underline-border-color: sass.fn-naming-var("tabs", "underline", "border-color");
|
|
16
|
+
$tabs-underline-border-color-active: sass.fn-naming-var(
|
|
17
|
+
"tabs",
|
|
18
|
+
"underline",
|
|
19
|
+
"border-color",
|
|
20
|
+
"active"
|
|
21
|
+
);
|
|
22
|
+
$tabs-underline-border-color-hover: sass.fn-naming-var(
|
|
23
|
+
"tabs",
|
|
24
|
+
"underline",
|
|
25
|
+
"border-color",
|
|
26
|
+
"hover"
|
|
27
|
+
);
|
|
28
|
+
$tabs-underline-border-color-focus: sass.fn-naming-var(
|
|
29
|
+
"tabs",
|
|
30
|
+
"underline",
|
|
31
|
+
"border-color",
|
|
32
|
+
"focus"
|
|
33
|
+
);
|
|
34
|
+
$tabs-underline-border-color-disabled: sass.fn-naming-var(
|
|
35
|
+
"tabs",
|
|
36
|
+
"underline",
|
|
37
|
+
"border-color",
|
|
38
|
+
"disabled"
|
|
39
|
+
);
|
|
16
40
|
|
|
17
41
|
// Fill
|
|
18
42
|
$tabs-fill-color: sass.fn-naming-var("tabs", "fill", "color");
|
|
@@ -20,7 +44,6 @@ $tabs-fill-color-active: sass.fn-naming-var("tabs", "fill", "color", "active");
|
|
|
20
44
|
$tabs-fill-color-hover: sass.fn-naming-var("tabs", "fill", "color", "hover");
|
|
21
45
|
$tabs-fill-color-focus: sass.fn-naming-var("tabs", "fill", "color", "focus");
|
|
22
46
|
$tabs-fill-color-disabled: sass.fn-naming-var("tabs", "fill", "color", "disabled");
|
|
23
|
-
|
|
24
47
|
$tabs-fill-background-color: sass.fn-naming-var("tabs", "fill", "background-color");
|
|
25
48
|
$tabs-fill-background-color-active: sass.fn-naming-var(
|
|
26
49
|
"tabs",
|
|
@@ -36,6 +59,11 @@ $tabs-fill-background-color-disabled: sass.fn-naming-var(
|
|
|
36
59
|
"background-color",
|
|
37
60
|
"disabled"
|
|
38
61
|
);
|
|
62
|
+
$tabs-fill-border-color: sass.fn-naming-var("tabs", "fill", "border-color");
|
|
63
|
+
$tabs-fill-border-color-active: sass.fn-naming-var("tabs", "fill", "border-color", "active");
|
|
64
|
+
$tabs-fill-border-color-hover: sass.fn-naming-var("tabs", "fill", "border-color", "hover");
|
|
65
|
+
$tabs-fill-border-color-focus: sass.fn-naming-var("tabs", "fill", "border-color", "focus");
|
|
66
|
+
$tabs-fill-border-color-disabled: sass.fn-naming-var("tabs", "fill", "border-color", "disabled");
|
|
39
67
|
|
|
40
68
|
// Text
|
|
41
69
|
$tabs-text-color: sass.fn-naming-var("tabs", "text", "color");
|
|
@@ -46,7 +74,7 @@ $tabs-text-color-disabled: sass.fn-naming-var("tabs", "text", "color", "disabled
|
|
|
46
74
|
|
|
47
75
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
48
76
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
49
|
-
$transition-duration: sass.fn-naming-var("
|
|
77
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
50
78
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
51
79
|
// layer: highlight (indicator geometry)
|
|
52
80
|
$highlight-top: sass.fn-naming-var("tabs", "highlight", "top");
|
|
@@ -63,31 +91,29 @@ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
|
63
91
|
margin: 0;
|
|
64
92
|
list-style: none;
|
|
65
93
|
border: none;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
border-color #{$transition-duration} ease,
|
|
69
|
-
background-color #{$transition-duration} ease,
|
|
70
|
-
color #{$transition-duration} ease,
|
|
71
|
-
border-radius #{$transition-duration} ease;
|
|
94
|
+
overflow-y: hidden;
|
|
95
|
+
overflow-x: hidden;
|
|
72
96
|
|
|
73
97
|
> * {
|
|
74
98
|
z-index: 1;
|
|
75
99
|
}
|
|
76
100
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
&:not(.text) {
|
|
102
|
+
&::before {
|
|
103
|
+
content: "";
|
|
104
|
+
z-index: 1;
|
|
105
|
+
display: block;
|
|
106
|
+
position: absolute;
|
|
107
|
+
top: 0;
|
|
108
|
+
left: 0;
|
|
109
|
+
width: #{$highlight-width};
|
|
110
|
+
height: #{$highlight-height};
|
|
111
|
+
transform: translate(#{$highlight-left}, #{$highlight-top});
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
border-radius: calc(
|
|
114
|
+
min(#{$highlight-width}, #{$highlight-height}, #{$radius-size}) * #{$radius-ratio}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
91
117
|
}
|
|
92
118
|
|
|
93
119
|
&.top-start,
|
|
@@ -123,6 +149,7 @@ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
|
123
149
|
width: 100%;
|
|
124
150
|
padding-top: #{$highlight-space-y};
|
|
125
151
|
padding-bottom: #{$highlight-space-y};
|
|
152
|
+
overflow-x: auto;
|
|
126
153
|
|
|
127
154
|
> * {
|
|
128
155
|
height: 100%;
|
|
@@ -140,6 +167,7 @@ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
|
140
167
|
flex-direction: column;
|
|
141
168
|
width: fit-content;
|
|
142
169
|
height: 100%;
|
|
170
|
+
overflow-y: auto;
|
|
143
171
|
|
|
144
172
|
> * {
|
|
145
173
|
width: 100%;
|
|
@@ -148,38 +176,39 @@ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
|
148
176
|
|
|
149
177
|
&.underline {
|
|
150
178
|
&::before {
|
|
151
|
-
background-color:
|
|
179
|
+
background-color: rgba(#{$tabs-underline-border-color-active});
|
|
152
180
|
}
|
|
153
181
|
|
|
154
182
|
:deep(.#{$tab}) {
|
|
155
183
|
.#{$button} {
|
|
156
|
-
color:
|
|
184
|
+
color: rgba(#{$tabs-underline-color});
|
|
185
|
+
background-color: transparent !important;
|
|
157
186
|
}
|
|
158
187
|
|
|
159
188
|
&.active {
|
|
160
189
|
.#{$button} {
|
|
161
|
-
color:
|
|
190
|
+
color: rgba(#{$tabs-underline-color-active});
|
|
162
191
|
}
|
|
163
192
|
}
|
|
164
193
|
|
|
165
194
|
&:hover,
|
|
166
195
|
&.hover {
|
|
167
196
|
.#{$button} {
|
|
168
|
-
color:
|
|
197
|
+
color: rgba(#{$tabs-underline-color-hover});
|
|
169
198
|
}
|
|
170
199
|
}
|
|
171
200
|
|
|
172
201
|
&:focus,
|
|
173
202
|
&.focus {
|
|
174
203
|
.#{$button} {
|
|
175
|
-
color:
|
|
204
|
+
color: rgba(#{$tabs-underline-color-focus});
|
|
176
205
|
}
|
|
177
206
|
}
|
|
178
207
|
|
|
179
208
|
&:disabled,
|
|
180
209
|
&.disabled {
|
|
181
210
|
.#{$button} {
|
|
182
|
-
color:
|
|
211
|
+
color: rgba(#{$tabs-underline-color-disabled});
|
|
183
212
|
}
|
|
184
213
|
}
|
|
185
214
|
}
|
|
@@ -187,83 +216,92 @@ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
|
187
216
|
|
|
188
217
|
&.fill {
|
|
189
218
|
&::before {
|
|
190
|
-
background-color:
|
|
219
|
+
background-color: rgba(#{$tabs-fill-background-color-active});
|
|
191
220
|
}
|
|
192
221
|
|
|
193
222
|
:deep(.#{$tab}) {
|
|
194
223
|
.#{$button} {
|
|
195
|
-
color:
|
|
224
|
+
color: rgba(#{$tabs-fill-color});
|
|
225
|
+
background-color: rgba(#{$tabs-fill-background-color});
|
|
196
226
|
}
|
|
197
227
|
|
|
198
228
|
&.active {
|
|
199
229
|
.#{$button} {
|
|
200
|
-
color:
|
|
230
|
+
color: rgba(#{$tabs-fill-color-active});
|
|
231
|
+
background-color: transparent !important;
|
|
201
232
|
}
|
|
202
233
|
}
|
|
203
234
|
|
|
204
235
|
&:hover,
|
|
205
236
|
&.hover {
|
|
206
237
|
.#{$button} {
|
|
207
|
-
color:
|
|
238
|
+
color: rgba(#{$tabs-fill-color-hover});
|
|
239
|
+
background-color: rgba(#{$tabs-fill-background-color-hover});
|
|
208
240
|
}
|
|
209
241
|
}
|
|
210
242
|
|
|
211
243
|
&:focus,
|
|
212
244
|
&.focus {
|
|
213
245
|
.#{$button} {
|
|
214
|
-
color:
|
|
246
|
+
color: rgba(#{$tabs-fill-color-focus});
|
|
247
|
+
background-color: rgba(#{$tabs-fill-background-color-focus});
|
|
215
248
|
}
|
|
216
249
|
}
|
|
217
250
|
|
|
218
251
|
&:disabled,
|
|
219
252
|
&.disabled {
|
|
220
253
|
.#{$button} {
|
|
221
|
-
color:
|
|
254
|
+
color: rgba(#{$tabs-fill-color-disabled});
|
|
255
|
+
background-color: rgba(#{$tabs-fill-background-color-disabled});
|
|
222
256
|
}
|
|
223
257
|
}
|
|
224
258
|
}
|
|
225
259
|
}
|
|
226
260
|
|
|
227
261
|
&.text {
|
|
228
|
-
&::before {
|
|
229
|
-
display: none;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
262
|
:deep(.#{$tab}) {
|
|
233
263
|
.#{$button} {
|
|
234
|
-
color:
|
|
264
|
+
color: rgba(#{$tabs-text-color});
|
|
265
|
+
background-color: transparent;
|
|
235
266
|
}
|
|
236
267
|
|
|
237
268
|
&.active {
|
|
238
269
|
.#{$button} {
|
|
239
|
-
color:
|
|
270
|
+
color: rgba(#{$tabs-text-color-active});
|
|
240
271
|
}
|
|
241
272
|
}
|
|
242
273
|
|
|
243
274
|
&:hover,
|
|
244
275
|
&.hover {
|
|
245
276
|
.#{$button} {
|
|
246
|
-
color:
|
|
277
|
+
color: rgba(#{$tabs-text-color-hover});
|
|
247
278
|
}
|
|
248
279
|
}
|
|
249
280
|
|
|
250
281
|
&:focus,
|
|
251
282
|
&.focus {
|
|
252
283
|
.#{$button} {
|
|
253
|
-
color:
|
|
284
|
+
color: rgba(#{$tabs-text-color-focus});
|
|
254
285
|
}
|
|
255
286
|
}
|
|
256
287
|
|
|
257
288
|
&:disabled,
|
|
258
289
|
&.disabled {
|
|
259
290
|
.#{$button} {
|
|
260
|
-
color:
|
|
291
|
+
color: rgba(#{$tabs-text-color-disabled});
|
|
261
292
|
}
|
|
262
293
|
}
|
|
263
294
|
}
|
|
264
295
|
}
|
|
265
296
|
|
|
266
297
|
&.transition {
|
|
298
|
+
transition:
|
|
299
|
+
box-shadow #{$transition-duration} ease,
|
|
300
|
+
border-color #{$transition-duration} ease,
|
|
301
|
+
background-color #{$transition-duration} ease,
|
|
302
|
+
color #{$transition-duration} ease,
|
|
303
|
+
border-radius #{$transition-duration} ease;
|
|
304
|
+
|
|
267
305
|
&::before {
|
|
268
306
|
transition:
|
|
269
307
|
background-color #{$transition-duration} ease,
|
|
@@ -276,10 +314,6 @@ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
|
276
314
|
}
|
|
277
315
|
|
|
278
316
|
:deep(.#{$tab}) {
|
|
279
|
-
display: flex;
|
|
280
|
-
justify-content: center;
|
|
281
|
-
align-items: center;
|
|
282
|
-
|
|
283
317
|
.#{$button} {
|
|
284
318
|
transition:
|
|
285
319
|
box-shadow #{$transition-duration} ease,
|
|
@@ -297,13 +331,7 @@ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
|
297
331
|
align-items: center;
|
|
298
332
|
|
|
299
333
|
.#{$button} {
|
|
300
|
-
color: unset;
|
|
301
334
|
cursor: pointer;
|
|
302
|
-
background-color: transparent !important;
|
|
303
|
-
border: none !important;
|
|
304
|
-
box-shadow: none !important;
|
|
305
|
-
border-radius: 0 !important;
|
|
306
|
-
transition: none;
|
|
307
335
|
}
|
|
308
336
|
}
|
|
309
337
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComputedRef } from "vue";
|
|
2
2
|
|
|
3
3
|
export type TabsVariant = "fill" | "underline" | "text";
|
|
4
|
+
export type TabsSize = string;
|
|
4
5
|
export type TabsPlacement =
|
|
5
6
|
| "top-start"
|
|
6
7
|
| "top-end"
|
|
@@ -17,10 +18,11 @@ export type TabsProps = {
|
|
|
17
18
|
variant?: TabsVariant;
|
|
18
19
|
role?: string;
|
|
19
20
|
modelValue?: string;
|
|
20
|
-
border?: number;
|
|
21
|
+
border?: number[];
|
|
21
22
|
margin?: number[];
|
|
22
23
|
shape?: string;
|
|
23
24
|
transition?: boolean;
|
|
25
|
+
size?: TabsSize;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
export type TabsEmit = {
|
|
@@ -31,5 +33,6 @@ export type TabsProviderState = {
|
|
|
31
33
|
activeValue: ComputedRef<string>;
|
|
32
34
|
role: ComputedRef<string>;
|
|
33
35
|
shape: ComputedRef<string>;
|
|
36
|
+
size: ComputedRef<TabsSize>;
|
|
34
37
|
setValue: (val: string) => void;
|
|
35
38
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, nextTick, onMounted, onUnmounted, provide, ref, watch } from "vue";
|
|
5
5
|
import { type TabsProps, type TabsEmit, type TabsProviderState } from "./tabs.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssProperty, cssPrefix } from "../../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../../app";
|
|
8
8
|
import { TABS_PROVIDER_STATE_KEY } from "./tabs.constants";
|
|
9
9
|
|
|
@@ -12,8 +12,9 @@ import { TABS_PROVIDER_STATE_KEY } from "./tabs.constants";
|
|
|
12
12
|
const props = withDefaults(defineProps<TabsProps>(), {
|
|
13
13
|
placement: "top-start",
|
|
14
14
|
margin: () => [0, 0],
|
|
15
|
-
border: 2,
|
|
15
|
+
border: () => [2, 0],
|
|
16
16
|
transition: true,
|
|
17
|
+
size: "standard",
|
|
17
18
|
});
|
|
18
19
|
const emit = defineEmits<TabsEmit>();
|
|
19
20
|
const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
|
|
@@ -25,6 +26,7 @@ const height = ref(0);
|
|
|
25
26
|
const top = ref(0);
|
|
26
27
|
const left = ref(0);
|
|
27
28
|
const container = ref();
|
|
29
|
+
const isFirstRender = ref(true);
|
|
28
30
|
|
|
29
31
|
// Computed properties
|
|
30
32
|
// ----------------------------------------------------------------------------
|
|
@@ -36,6 +38,10 @@ const shape = computed(() => {
|
|
|
36
38
|
return props.shape || appState?.shape.value || "";
|
|
37
39
|
});
|
|
38
40
|
|
|
41
|
+
const size = computed(() => {
|
|
42
|
+
return props.size;
|
|
43
|
+
});
|
|
44
|
+
|
|
39
45
|
const activeValue = computed(() => {
|
|
40
46
|
return props.modelValue || "";
|
|
41
47
|
});
|
|
@@ -54,7 +60,7 @@ const tabsAttrs = computed(() => {
|
|
|
54
60
|
if (props.variant === "underline") {
|
|
55
61
|
// Underline variant: align the highlight strip for top vs bottom tab bars
|
|
56
62
|
if (props.placement.startsWith("top-")) {
|
|
57
|
-
t = h - props.border;
|
|
63
|
+
t = h - props.border[0];
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
if (props.placement.startsWith("bottom-")) {
|
|
@@ -62,12 +68,17 @@ const tabsAttrs = computed(() => {
|
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
if (props.placement.startsWith("top-") || props.placement.startsWith("bottom-")) {
|
|
65
|
-
h = props.border + 0.5;
|
|
71
|
+
h = props.border[0] + 0.5;
|
|
72
|
+
|
|
73
|
+
if (props.border[1]) {
|
|
74
|
+
l += (w - props.border[1]) / 2;
|
|
75
|
+
w = props.border[1];
|
|
76
|
+
}
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
// Left, Right
|
|
69
80
|
if (props.placement.startsWith("left-")) {
|
|
70
|
-
l = w - props.border;
|
|
81
|
+
l = w - props.border[0];
|
|
71
82
|
}
|
|
72
83
|
|
|
73
84
|
if (props.placement.startsWith("right-")) {
|
|
@@ -75,29 +86,34 @@ const tabsAttrs = computed(() => {
|
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
if (props.placement.startsWith("left-") || props.placement.startsWith("right-")) {
|
|
78
|
-
w = props.border;
|
|
89
|
+
w = props.border[0];
|
|
90
|
+
|
|
91
|
+
if (props.border[1]) {
|
|
92
|
+
t += (h - props.border[1]) / 2;
|
|
93
|
+
h = props.border[1];
|
|
94
|
+
}
|
|
79
95
|
}
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
return {
|
|
83
99
|
class: [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
100
|
+
cssPrefix(["layer", "tabs"]),
|
|
101
|
+
cssPrefix(["role", role.value]),
|
|
102
|
+
cssPrefix(["shape", shape.value]),
|
|
103
|
+
cssPrefix("tabs"),
|
|
88
104
|
props.variant,
|
|
89
105
|
props.placement,
|
|
90
106
|
{
|
|
91
|
-
transition: props.transition,
|
|
107
|
+
transition: isFirstRender.value ? false : props.transition,
|
|
92
108
|
},
|
|
93
109
|
],
|
|
94
110
|
style: {
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
[
|
|
111
|
+
[cssProperty("tabs-highlight-top")]: typeof t === "string" ? t : t + "px",
|
|
112
|
+
[cssProperty("tabs-highlight-left")]: typeof l === "string" ? l : l + "px",
|
|
113
|
+
[cssProperty("tabs-highlight-width")]: typeof w === "string" ? w : w + "px",
|
|
114
|
+
[cssProperty("tabs-highlight-height")]: typeof h === "string" ? h : h + "px",
|
|
115
|
+
[cssProperty("tabs-highlight-space-x")]: (props.margin[1] > 0 ? props.margin[1] : 0) + "px",
|
|
116
|
+
[cssProperty("tabs-highlight-space-y")]: (props.margin[0] > 0 ? props.margin[0] : 0) + "px",
|
|
101
117
|
},
|
|
102
118
|
};
|
|
103
119
|
});
|
|
@@ -120,20 +136,27 @@ const calcPosition = () => {
|
|
|
120
136
|
}
|
|
121
137
|
};
|
|
122
138
|
|
|
139
|
+
const checkRender = async () => {
|
|
140
|
+
await nextTick();
|
|
141
|
+
calcPosition();
|
|
142
|
+
};
|
|
143
|
+
|
|
123
144
|
// Lifecycle
|
|
124
145
|
// ----------------------------------------------------------------------------
|
|
125
146
|
watch(
|
|
126
147
|
() => props.modelValue,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
calcPosition();
|
|
148
|
+
() => {
|
|
149
|
+
checkRender();
|
|
130
150
|
}
|
|
131
151
|
);
|
|
132
152
|
|
|
133
|
-
onMounted(
|
|
134
|
-
|
|
135
|
-
calcPosition();
|
|
153
|
+
onMounted(() => {
|
|
154
|
+
checkRender();
|
|
136
155
|
window.addEventListener("resize", calcPosition);
|
|
156
|
+
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
isFirstRender.value = false;
|
|
159
|
+
}, 500);
|
|
137
160
|
});
|
|
138
161
|
|
|
139
162
|
onUnmounted(() => {
|
|
@@ -146,6 +169,7 @@ provide<TabsProviderState>(TABS_PROVIDER_STATE_KEY, {
|
|
|
146
169
|
activeValue,
|
|
147
170
|
role,
|
|
148
171
|
shape,
|
|
172
|
+
size,
|
|
149
173
|
setValue: (val: unknown) => {
|
|
150
174
|
emit("update:modelValue", val as string);
|
|
151
175
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import { type ToastProps } from "../toast.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../../utils";
|
|
7
7
|
import { useToast } from "../toast.composable";
|
|
8
8
|
import { ToastContent } from "../toast-content";
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ const toast = useToast();
|
|
|
18
18
|
// ----------------------------------------------------------------------------
|
|
19
19
|
const toastAttrs = computed(() => {
|
|
20
20
|
return {
|
|
21
|
-
class: [
|
|
21
|
+
class: [cssPrefix("toast"), props.placement],
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
24
|
|
|
@@ -9,7 +9,7 @@ $toast-color: sass.fn-naming-var("toast", "color");
|
|
|
9
9
|
$toast-border-color: sass.fn-naming-var("toast", "border-color");
|
|
10
10
|
|
|
11
11
|
$space-x: sass.fn-naming-var("spacing", "x");
|
|
12
|
-
$transition-duration: sass.fn-naming-var("
|
|
12
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
13
13
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
14
14
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
15
15
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
@@ -26,9 +26,9 @@ $max-height: sass.fn-naming-var("overlay", "max-height");
|
|
|
26
26
|
border-radius #{$transition-duration} ease,
|
|
27
27
|
opacity #{$transition-duration} ease;
|
|
28
28
|
|
|
29
|
-
background-color:
|
|
30
|
-
color:
|
|
31
|
-
border-color:
|
|
29
|
+
background-color: rgba(#{$toast-background-color});
|
|
30
|
+
color: rgba(#{$toast-color});
|
|
31
|
+
border-color: rgba(#{$toast-border-color});
|
|
32
32
|
border-width: #{$border-width};
|
|
33
33
|
border-style: solid;
|
|
34
34
|
max-height: #{$max-height};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, onMounted, ref } from "vue";
|
|
5
5
|
import { type ToastContentProps, type ToastContentEmit } from "../toast.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../../app";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -27,10 +27,10 @@ const contentAttrs = computed(() => {
|
|
|
27
27
|
const shape = props.shape || appState?.shape.value || "";
|
|
28
28
|
return {
|
|
29
29
|
class: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
cssPrefix(["layer", "toast"]),
|
|
31
|
+
cssPrefix(["role", role]),
|
|
32
|
+
cssPrefix(["shape", shape]),
|
|
33
|
+
cssPrefix("toast-content"),
|
|
34
34
|
props.variant,
|
|
35
35
|
{
|
|
36
36
|
closing: isClosing.value,
|
|
@@ -11,14 +11,14 @@ $safe-area-right: sass.fn-naming-var("safe-area", "right");
|
|
|
11
11
|
$safe-area-left: sass.fn-naming-var("safe-area", "left");
|
|
12
12
|
$safe-area-bottom: sass.fn-naming-var("safe-area", "bottom");
|
|
13
13
|
$safe-area-top: sass.fn-naming-var("safe-area", "top");
|
|
14
|
-
$transition-duration: sass.fn-naming-var("
|
|
14
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
15
15
|
|
|
16
16
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
17
|
-
$border: #{$border-width} solid
|
|
17
|
+
$border: #{$border-width} solid rgba(#{$toolbar-border-color});
|
|
18
18
|
|
|
19
19
|
.#{$toolbar} {
|
|
20
|
-
background-color:
|
|
21
|
-
color:
|
|
20
|
+
background-color: rgba(#{$toolbar-background-color});
|
|
21
|
+
color: rgba(#{$toolbar-color});
|
|
22
22
|
transition:
|
|
23
23
|
box-shadow #{$transition-duration} ease,
|
|
24
24
|
border-color #{$transition-duration} ease,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject } from "vue";
|
|
5
5
|
import { type ToolbarProps } from "./toolbar.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssProperty, cssPrefix } from "../../utils";
|
|
7
7
|
import { type CableProviderState } from "../cable/cable.type";
|
|
8
8
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
9
9
|
import { CABLE_PROVIDER_STATE_KEY } from "../cable";
|
|
@@ -27,13 +27,13 @@ const toolbarAttrs = computed(() => {
|
|
|
27
27
|
|
|
28
28
|
return {
|
|
29
29
|
class: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
cssPrefix(["layer", "toolbar"]),
|
|
31
|
+
cssPrefix(["role", role]),
|
|
32
|
+
cssPrefix("toolbar"),
|
|
33
33
|
placement,
|
|
34
34
|
{
|
|
35
35
|
safe: props.safe,
|
|
36
|
-
divider: divider
|
|
36
|
+
divider: divider,
|
|
37
37
|
},
|
|
38
38
|
],
|
|
39
39
|
};
|