@toife/vue 3.1.3 → 3.1.4
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/package.json +1 -1
- package/src/components/app/app.type.ts +6 -0
- package/src/components/app/app.vue +7 -1
- package/src/components/avatar/avatar.scss +3 -2
- package/src/components/button/button.scss +9 -6
- package/src/components/button/button.type.ts +3 -1
- package/src/components/card/card/card.scss +3 -1
- package/src/components/checkbox/checkbox.scss +9 -14
- package/src/components/checkbox/checkbox.type.ts +4 -0
- package/src/components/checkbox/checkbox.vue +2 -0
- package/src/components/decision-modal/decision-modal.scss +3 -1
- package/src/components/dropdown/dropdown.scss +5 -2
- package/src/components/dropdown/dropdown.type.ts +4 -1
- package/src/components/dropdown/dropdown.vue +4 -0
- package/src/components/field/field.type.ts +2 -2
- package/src/components/field/outline/outline.scss +9 -8
- package/src/components/gesture-indicator/gesture-indicator.scss +3 -1
- package/src/components/index.ts +1 -0
- package/src/components/layout/flex/flex.scss +0 -2
- package/src/components/layout/flex-item/flex-item.html +1 -0
- package/src/components/layout/flex-item/flex-item.scss +48 -0
- package/src/components/layout/flex-item/flex-item.type.ts +11 -0
- package/src/components/layout/flex-item/flex-item.vue +27 -0
- package/src/components/layout/flex-item/index.ts +2 -0
- package/src/components/layout/grid/grid.scss +0 -2
- package/src/components/layout/grid-item/grid-item.html +1 -0
- package/src/components/layout/grid-item/grid-item.scss +49 -0
- package/src/components/layout/grid-item/grid-item.type.ts +14 -0
- package/src/components/layout/grid-item/grid-item.vue +27 -0
- package/src/components/layout/grid-item/index.ts +2 -0
- package/src/components/layout/index.ts +2 -1
- package/src/components/modal/modal.scss +3 -1
- package/src/components/radio/radio/radio.scss +7 -5
- package/src/components/radio/radio/radio.type.ts +4 -0
- package/src/components/radio/radio/radio.vue +2 -0
- package/src/components/refresher/refresher.html +4 -4
- package/src/components/refresher/refresher.scss +10 -4
- package/src/components/refresher/refresher.vue +3 -3
- package/src/components/skeleton/skeleton.scss +3 -1
- package/src/components/slide-range/index.ts +2 -0
- package/src/components/slide-range/slide-range.html +20 -0
- package/src/components/slide-range/slide-range.scss +161 -0
- package/src/components/slide-range/slide-range.type.ts +16 -0
- package/src/components/slide-range/slide-range.vue +229 -0
- package/src/components/switch/switch.scss +11 -22
- package/src/components/switch/switch.type.ts +5 -0
- package/src/components/switch/switch.vue +2 -0
- package/src/components/tabs/tabs/tabs.scss +135 -95
- package/src/components/tabs/tabs/tabs.type.ts +0 -1
- package/src/components/tabs/tabs/tabs.vue +6 -10
- package/src/components/toast/toast-content/toast-content.scss +3 -2
- package/src/components/toolbar/toolbar.scss +1 -1
- package/src/components/toolbar/toolbar.type.ts +1 -1
- package/src/components/toolbar/toolbar.vue +2 -2
- package/src/factory.ts +6 -2
- package/src/index.ts +1 -1
- package/src/components/action/action.md +0 -115
- package/src/components/app/app.md +0 -77
- package/src/components/avatar/avatar.md +0 -64
- package/src/components/button/button.md +0 -66
- package/src/components/cable/cable.md +0 -57
- package/src/components/card/card/card.md +0 -57
- package/src/components/card/card-body/card-body.md +0 -34
- package/src/components/card/card-footer/card-footer.md +0 -42
- package/src/components/card/card-header/card-header.md +0 -44
- package/src/components/checkbox/checkbox.md +0 -60
- package/src/components/collapse/collapse.md +0 -59
- package/src/components/container/container.md +0 -38
- package/src/components/decision-modal/decision-modal.md +0 -79
- package/src/components/divider/divider.md +0 -42
- package/src/components/field/field.md +0 -68
- package/src/components/field/outline/outline-field.md +0 -44
- package/src/components/form-group/form-group.md +0 -41
- package/src/components/gesture-indicator/gesture-indicator.md +0 -42
- package/src/components/image/image.md +0 -41
- package/src/components/layout/cell/cell.html +0 -1
- package/src/components/layout/cell/cell.md +0 -47
- package/src/components/layout/cell/cell.scss +0 -54
- package/src/components/layout/cell/cell.type.ts +0 -19
- package/src/components/layout/cell/cell.vue +0 -35
- package/src/components/layout/cell/index.ts +0 -2
- package/src/components/layout/grid/grid.md +0 -50
- package/src/components/modal/modal.md +0 -65
- package/src/components/page/page.md +0 -39
- package/src/components/present/present.md +0 -60
- package/src/components/radio/radio/radio.md +0 -53
- package/src/components/radio/radio-group/radio-group.md +0 -62
- package/src/components/refresher/refresher.md +0 -53
- package/src/components/route/route-navigator/route-navigator.md +0 -50
- package/src/components/route/route-outlet/route-outlet.md +0 -30
- package/src/components/route/route-provider/route-provider.md +0 -46
- package/src/components/route/route-wrapper/route-wrapper.md +0 -45
- package/src/components/segmented-field/segmented-field.md +0 -58
- package/src/components/skeleton/skeleton.md +0 -47
- package/src/components/switch/switch.md +0 -57
- package/src/components/tabs/tab/tab.md +0 -52
- package/src/components/tabs/tabs/tabs.md +0 -59
- package/src/components/toast/toast/toast.md +0 -56
- package/src/components/toast/toast-content/toast-content.md +0 -41
- package/src/components/toolbar/toolbar.md +0 -54
|
@@ -10,6 +10,7 @@ import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
|
10
10
|
// ----------------------------------------------------------------------------
|
|
11
11
|
const props = withDefaults(defineProps<SwitchProps>(), {
|
|
12
12
|
modelValue: false,
|
|
13
|
+
size: "standard",
|
|
13
14
|
readonly: false,
|
|
14
15
|
shadow: undefined,
|
|
15
16
|
});
|
|
@@ -47,6 +48,7 @@ const switchAttrs = computed(() => {
|
|
|
47
48
|
withPrefix(["layer", "switch"]),
|
|
48
49
|
withPrefix(["role", role]),
|
|
49
50
|
withPrefix(["shape", shape]),
|
|
51
|
+
withPrefix(["size", props.size]),
|
|
50
52
|
withPrefix("switch"),
|
|
51
53
|
],
|
|
52
54
|
};
|
|
@@ -6,23 +6,55 @@ $tab: sass.fn-naming-prefix("tab");
|
|
|
6
6
|
$button: sass.fn-naming-prefix("button");
|
|
7
7
|
|
|
8
8
|
// Property name - layer: tabs
|
|
9
|
-
|
|
10
|
-
$tabs-
|
|
11
|
-
$tabs-
|
|
12
|
-
|
|
13
|
-
$
|
|
14
|
-
$
|
|
15
|
-
$
|
|
9
|
+
// Underline
|
|
10
|
+
$tabs-underline-color: sass.fn-naming-var("tabs", "underline", "color");
|
|
11
|
+
$tabs-underline-color-active: sass.fn-naming-var("tabs", "underline", "color", "active");
|
|
12
|
+
$tabs-underline-color-hover: sass.fn-naming-var("tabs", "underline", "color", "hover");
|
|
13
|
+
$tabs-underline-color-focus: sass.fn-naming-var("tabs", "underline", "color", "focus");
|
|
14
|
+
$tabs-underline-color-disabled: sass.fn-naming-var("tabs", "underline", "color", "disabled");
|
|
15
|
+
$tabs-underline-background-color: sass.fn-naming-var("tabs", "underline", "background-color");
|
|
16
|
+
|
|
17
|
+
// Fill
|
|
18
|
+
$tabs-fill-color: sass.fn-naming-var("tabs", "fill", "color");
|
|
19
|
+
$tabs-fill-color-active: sass.fn-naming-var("tabs", "fill", "color", "active");
|
|
20
|
+
$tabs-fill-color-hover: sass.fn-naming-var("tabs", "fill", "color", "hover");
|
|
21
|
+
$tabs-fill-color-focus: sass.fn-naming-var("tabs", "fill", "color", "focus");
|
|
22
|
+
$tabs-fill-color-disabled: sass.fn-naming-var("tabs", "fill", "color", "disabled");
|
|
23
|
+
|
|
24
|
+
$tabs-fill-background-color: sass.fn-naming-var("tabs", "fill", "background-color");
|
|
25
|
+
$tabs-fill-background-color-active: sass.fn-naming-var(
|
|
26
|
+
"tabs",
|
|
27
|
+
"fill",
|
|
28
|
+
"background-color",
|
|
29
|
+
"active"
|
|
30
|
+
);
|
|
31
|
+
$tabs-fill-background-color-hover: sass.fn-naming-var("tabs", "fill", "background-color", "hover");
|
|
32
|
+
$tabs-fill-background-color-focus: sass.fn-naming-var("tabs", "fill", "background-color", "focus");
|
|
33
|
+
$tabs-fill-background-color-disabled: sass.fn-naming-var(
|
|
34
|
+
"tabs",
|
|
35
|
+
"fill",
|
|
36
|
+
"background-color",
|
|
37
|
+
"disabled"
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Text
|
|
41
|
+
$tabs-text-color: sass.fn-naming-var("tabs", "text", "color");
|
|
42
|
+
$tabs-text-color-active: sass.fn-naming-var("tabs", "text", "color", "active");
|
|
43
|
+
$tabs-text-color-hover: sass.fn-naming-var("tabs", "text", "color", "hover");
|
|
44
|
+
$tabs-text-color-focus: sass.fn-naming-var("tabs", "text", "color", "focus");
|
|
45
|
+
$tabs-text-color-disabled: sass.fn-naming-var("tabs", "text", "color", "disabled");
|
|
46
|
+
|
|
47
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
16
48
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
17
49
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
18
|
-
|
|
50
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
19
51
|
// layer: highlight (indicator geometry)
|
|
20
|
-
$highlight-top: sass.fn-naming-var("highlight", "top");
|
|
21
|
-
$highlight-left: sass.fn-naming-var("highlight", "left");
|
|
22
|
-
$highlight-width: sass.fn-naming-var("highlight", "width");
|
|
23
|
-
$highlight-height: sass.fn-naming-var("highlight", "height");
|
|
24
|
-
$highlight-space-x: sass.fn-naming-var("highlight", "space-x");
|
|
25
|
-
$highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
52
|
+
$highlight-top: sass.fn-naming-var("tabs", "highlight", "top");
|
|
53
|
+
$highlight-left: sass.fn-naming-var("tabs", "highlight", "left");
|
|
54
|
+
$highlight-width: sass.fn-naming-var("tabs", "highlight", "width");
|
|
55
|
+
$highlight-height: sass.fn-naming-var("tabs", "highlight", "height");
|
|
56
|
+
$highlight-space-x: sass.fn-naming-var("tabs", "highlight", "space-x");
|
|
57
|
+
$highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
26
58
|
|
|
27
59
|
.#{$tabs} {
|
|
28
60
|
display: flex;
|
|
@@ -53,8 +85,9 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
53
85
|
height: #{$highlight-height};
|
|
54
86
|
transform: translate(#{$highlight-left}, #{$highlight-top});
|
|
55
87
|
box-sizing: border-box;
|
|
56
|
-
|
|
57
|
-
|
|
88
|
+
border-radius: calc(
|
|
89
|
+
min(#{$highlight-width}, #{$highlight-height}, #{$radius-size}) * #{$radius-ratio}
|
|
90
|
+
);
|
|
58
91
|
}
|
|
59
92
|
|
|
60
93
|
&.top-start,
|
|
@@ -88,6 +121,8 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
88
121
|
flex-direction: row;
|
|
89
122
|
height: fit-content;
|
|
90
123
|
width: 100%;
|
|
124
|
+
padding-top: #{$highlight-space-y};
|
|
125
|
+
padding-bottom: #{$highlight-space-y};
|
|
91
126
|
|
|
92
127
|
> * {
|
|
93
128
|
height: 100%;
|
|
@@ -100,6 +135,8 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
100
135
|
&.right-start,
|
|
101
136
|
&.right-center,
|
|
102
137
|
&.right-end {
|
|
138
|
+
padding-left: #{$highlight-space-x};
|
|
139
|
+
padding-right: #{$highlight-space-x};
|
|
103
140
|
flex-direction: column;
|
|
104
141
|
width: fit-content;
|
|
105
142
|
height: 100%;
|
|
@@ -109,81 +146,81 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
109
146
|
}
|
|
110
147
|
}
|
|
111
148
|
|
|
112
|
-
&.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
&.top-end {
|
|
116
|
-
border-bottom: #{$border-width} solid rgb(#{$tabs-border-color});
|
|
149
|
+
&.underline {
|
|
150
|
+
&::before {
|
|
151
|
+
background-color: rgb(#{$tabs-underline-background-color});
|
|
117
152
|
}
|
|
118
153
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
154
|
+
:deep(.#{$tab}) {
|
|
155
|
+
.#{$button} {
|
|
156
|
+
color: rgb(#{$tabs-underline-color});
|
|
157
|
+
}
|
|
124
158
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
159
|
+
&.active {
|
|
160
|
+
.#{$button} {
|
|
161
|
+
color: rgb(#{$tabs-underline-color-active});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
130
164
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
165
|
+
&:hover,
|
|
166
|
+
&.hover {
|
|
167
|
+
.#{$button} {
|
|
168
|
+
color: rgb(#{$tabs-underline-color-hover});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
137
171
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
&.bottom-end {
|
|
145
|
-
padding-top: #{$highlight-space-y};
|
|
146
|
-
padding-bottom: #{$highlight-space-y};
|
|
147
|
-
}
|
|
172
|
+
&:focus,
|
|
173
|
+
&.focus {
|
|
174
|
+
.#{$button} {
|
|
175
|
+
color: rgb(#{$tabs-underline-color-focus});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
148
178
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
padding-left: #{$highlight-space-x};
|
|
156
|
-
padding-right: #{$highlight-space-x};
|
|
179
|
+
&:disabled,
|
|
180
|
+
&.disabled {
|
|
181
|
+
.#{$button} {
|
|
182
|
+
color: rgb(#{$tabs-underline-color-disabled});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
157
185
|
}
|
|
158
186
|
}
|
|
159
187
|
|
|
160
188
|
&.fill {
|
|
189
|
+
&::before {
|
|
190
|
+
background-color: rgb(#{$tabs-fill-background-color});
|
|
191
|
+
}
|
|
192
|
+
|
|
161
193
|
:deep(.#{$tab}) {
|
|
194
|
+
.#{$button} {
|
|
195
|
+
color: rgb(#{$tabs-fill-color});
|
|
196
|
+
}
|
|
197
|
+
|
|
162
198
|
&.active {
|
|
163
199
|
.#{$button} {
|
|
164
|
-
color: rgb(#{$tabs-color})
|
|
200
|
+
color: rgb(#{$tabs-fill-color-active});
|
|
165
201
|
}
|
|
166
202
|
}
|
|
167
|
-
}
|
|
168
203
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
padding-top: calc(#{$highlight-space-y} + #{$space-y});
|
|
176
|
-
padding-bottom: calc(#{$highlight-space-y} + #{$space-y});
|
|
177
|
-
}
|
|
204
|
+
&:hover,
|
|
205
|
+
&.hover {
|
|
206
|
+
.#{$button} {
|
|
207
|
+
color: rgb(#{$tabs-fill-color-hover});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
178
210
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
211
|
+
&:focus,
|
|
212
|
+
&.focus {
|
|
213
|
+
.#{$button} {
|
|
214
|
+
color: rgb(#{$tabs-fill-color-focus});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&:disabled,
|
|
219
|
+
&.disabled {
|
|
220
|
+
.#{$button} {
|
|
221
|
+
color: rgb(#{$tabs-fill-color-disabled});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
187
224
|
}
|
|
188
225
|
}
|
|
189
226
|
|
|
@@ -193,32 +230,36 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
193
230
|
}
|
|
194
231
|
|
|
195
232
|
:deep(.#{$tab}) {
|
|
233
|
+
.#{$button} {
|
|
234
|
+
color: rgb(#{$tabs-text-color});
|
|
235
|
+
}
|
|
236
|
+
|
|
196
237
|
&.active {
|
|
197
238
|
.#{$button} {
|
|
198
|
-
color: rgb(#{$tabs-
|
|
199
|
-
text-shadow: 0 0 rgb(#{$tabs-background-color});
|
|
239
|
+
color: rgb(#{$tabs-text-color-active});
|
|
200
240
|
}
|
|
201
241
|
}
|
|
202
|
-
}
|
|
203
242
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
padding-top: calc(#{$highlight-space-y} + #{$space-y});
|
|
211
|
-
padding-bottom: calc(#{$highlight-space-y} + #{$space-y});
|
|
212
|
-
}
|
|
243
|
+
&:hover,
|
|
244
|
+
&.hover {
|
|
245
|
+
.#{$button} {
|
|
246
|
+
color: rgb(#{$tabs-text-color-hover});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
213
249
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
250
|
+
&:focus,
|
|
251
|
+
&.focus {
|
|
252
|
+
.#{$button} {
|
|
253
|
+
color: rgb(#{$tabs-text-color-focus});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&:disabled,
|
|
258
|
+
&.disabled {
|
|
259
|
+
.#{$button} {
|
|
260
|
+
color: rgb(#{$tabs-text-color-disabled});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
222
263
|
}
|
|
223
264
|
}
|
|
224
265
|
|
|
@@ -256,7 +297,6 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
256
297
|
align-items: center;
|
|
257
298
|
|
|
258
299
|
.#{$button} {
|
|
259
|
-
padding: #{$space-y} calc(#{$space-x} * 4);
|
|
260
300
|
color: unset;
|
|
261
301
|
cursor: pointer;
|
|
262
302
|
background-color: transparent !important;
|
|
@@ -13,7 +13,6 @@ const props = withDefaults(defineProps<TabsProps>(), {
|
|
|
13
13
|
placement: "top-start",
|
|
14
14
|
margin: () => [0, 0],
|
|
15
15
|
border: 2,
|
|
16
|
-
divider: undefined,
|
|
17
16
|
transition: true,
|
|
18
17
|
});
|
|
19
18
|
const emit = defineEmits<TabsEmit>();
|
|
@@ -42,8 +41,6 @@ const activeValue = computed(() => {
|
|
|
42
41
|
});
|
|
43
42
|
|
|
44
43
|
const tabsAttrs = computed(() => {
|
|
45
|
-
const divider =
|
|
46
|
-
(props.divider !== undefined ? props.divider : appState?.divider.value || false) ?? false;
|
|
47
44
|
let l = left.value;
|
|
48
45
|
let t = top.value;
|
|
49
46
|
let w = width.value;
|
|
@@ -91,17 +88,16 @@ const tabsAttrs = computed(() => {
|
|
|
91
88
|
props.variant,
|
|
92
89
|
props.placement,
|
|
93
90
|
{
|
|
94
|
-
divider,
|
|
95
91
|
transition: props.transition,
|
|
96
92
|
},
|
|
97
93
|
],
|
|
98
94
|
style: {
|
|
99
|
-
[property("highlight-top")]: typeof t === "string" ? t : t + "px",
|
|
100
|
-
[property("highlight-left")]: typeof l === "string" ? l : l + "px",
|
|
101
|
-
[property("highlight-width")]: typeof w === "string" ? w : w + "px",
|
|
102
|
-
[property("highlight-height")]: typeof h === "string" ? h : h + "px",
|
|
103
|
-
[property("highlight-space-x")]: (props.margin[1] > 0 ? props.margin[1] : 0) + "px",
|
|
104
|
-
[property("highlight-space-y")]: (props.margin[0] > 0 ? props.margin[0] : 0) + "px",
|
|
95
|
+
[property("tabs-highlight-top")]: typeof t === "string" ? t : t + "px",
|
|
96
|
+
[property("tabs-highlight-left")]: typeof l === "string" ? l : l + "px",
|
|
97
|
+
[property("tabs-highlight-width")]: typeof w === "string" ? w : w + "px",
|
|
98
|
+
[property("tabs-highlight-height")]: typeof h === "string" ? h : h + "px",
|
|
99
|
+
[property("tabs-highlight-space-x")]: (props.margin[1] > 0 ? props.margin[1] : 0) + "px",
|
|
100
|
+
[property("tabs-highlight-space-y")]: (props.margin[0] > 0 ? props.margin[0] : 0) + "px",
|
|
105
101
|
},
|
|
106
102
|
};
|
|
107
103
|
});
|
|
@@ -10,7 +10,8 @@ $toast-border-color: sass.fn-naming-var("toast", "border-color");
|
|
|
10
10
|
|
|
11
11
|
$space-x: sass.fn-naming-var("spacing", "x");
|
|
12
12
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
13
|
-
$
|
|
13
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
14
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
14
15
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
15
16
|
$max-height: sass.fn-naming-var("overlay", "max-height");
|
|
16
17
|
|
|
@@ -33,7 +34,7 @@ $max-height: sass.fn-naming-var("overlay", "max-height");
|
|
|
33
34
|
max-height: #{$max-height};
|
|
34
35
|
max-width: 100%;
|
|
35
36
|
padding: calc(#{$space-x} * 2) calc(#{$space-x} * 4);
|
|
36
|
-
border-radius: #{$
|
|
37
|
+
border-radius: calc(min(#{$radius-size}, #{$max-height}) * #{$radius-ratio});
|
|
37
38
|
|
|
38
39
|
&.closing {
|
|
39
40
|
opacity: 0;
|
|
@@ -12,7 +12,7 @@ import { CABLE_PROVIDER_STATE_KEY } from "../cable";
|
|
|
12
12
|
// ----------------------------------------------------------------------------
|
|
13
13
|
const props = withDefaults(defineProps<ToolbarProps>(), {
|
|
14
14
|
placement: null,
|
|
15
|
-
|
|
15
|
+
safe: true,
|
|
16
16
|
divider: undefined,
|
|
17
17
|
});
|
|
18
18
|
const cable = inject<CableProviderState>(CABLE_PROVIDER_STATE_KEY);
|
|
@@ -32,7 +32,7 @@ const toolbarAttrs = computed(() => {
|
|
|
32
32
|
withPrefix("toolbar"),
|
|
33
33
|
placement,
|
|
34
34
|
{
|
|
35
|
-
|
|
35
|
+
safe: props.safe,
|
|
36
36
|
divider: divider.value,
|
|
37
37
|
},
|
|
38
38
|
],
|
package/src/factory.ts
CHANGED
|
@@ -16,10 +16,11 @@ import {
|
|
|
16
16
|
Dropdown,
|
|
17
17
|
Field,
|
|
18
18
|
Flex,
|
|
19
|
+
FlexItem,
|
|
19
20
|
FormGroup,
|
|
20
21
|
GestureIndicator,
|
|
21
22
|
Grid,
|
|
22
|
-
|
|
23
|
+
GridItem,
|
|
23
24
|
Image,
|
|
24
25
|
Modal,
|
|
25
26
|
Page,
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
RouteOutlet,
|
|
34
35
|
SegmentedField,
|
|
35
36
|
Select,
|
|
37
|
+
SlideRange,
|
|
36
38
|
Skeleton,
|
|
37
39
|
Switch,
|
|
38
40
|
Tab,
|
|
@@ -67,10 +69,11 @@ export const createToife = (options?: CreateToifeOptions) => {
|
|
|
67
69
|
app.component(prefix + "dropdown", Dropdown);
|
|
68
70
|
app.component(prefix + "field", Field);
|
|
69
71
|
app.component(prefix + "flex", Flex);
|
|
72
|
+
app.component(prefix + "flex-item", FlexItem);
|
|
70
73
|
app.component(prefix + "form-group", FormGroup);
|
|
71
74
|
app.component(prefix + "gesture-indicator", GestureIndicator);
|
|
72
75
|
app.component(prefix + "grid", Grid);
|
|
73
|
-
app.component(prefix + "
|
|
76
|
+
app.component(prefix + "grid-item", GridItem);
|
|
74
77
|
app.component(prefix + "image", Image);
|
|
75
78
|
app.component(prefix + "modal", Modal);
|
|
76
79
|
app.component(prefix + "page", Page);
|
|
@@ -82,6 +85,7 @@ export const createToife = (options?: CreateToifeOptions) => {
|
|
|
82
85
|
app.component(prefix + "route-outlet", RouteOutlet);
|
|
83
86
|
app.component(prefix + "segmented-field", SegmentedField);
|
|
84
87
|
app.component(prefix + "select", Select);
|
|
88
|
+
app.component(prefix + "slide-range", SlideRange);
|
|
85
89
|
app.component(prefix + "skeleton", Skeleton);
|
|
86
90
|
app.component(prefix + "switch", Switch);
|
|
87
91
|
app.component(prefix + "tab", Tab);
|
package/src/index.ts
CHANGED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# `<t-action>`
|
|
2
|
-
|
|
3
|
-
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
-
|
|
5
|
-
## Description
|
|
6
|
-
|
|
7
|
-
Action sheet: groups of buttons rendered inside `Present`, typically for quick choices or secondary menus. Control via props or the `useAction()` composable wired by `t-app`.
|
|
8
|
-
|
|
9
|
-
## Requirements / dependencies
|
|
10
|
-
|
|
11
|
-
| Item | Notes |
|
|
12
|
-
| ----- | ----------------------------------------------------------------------------------------- |
|
|
13
|
-
| Vue | ^3.5 |
|
|
14
|
-
| Other | Prefer `t-app` for theme/context (`inject`). Depends on `Present`, `FormGroup`, `Button`. |
|
|
15
|
-
|
|
16
|
-
## Basic usage
|
|
17
|
-
|
|
18
|
-
```vue
|
|
19
|
-
<template>
|
|
20
|
-
<t-action
|
|
21
|
-
:visible="show"
|
|
22
|
-
:actions="[[{ text: 'Confirm', variant: 'fill', handler: onOk }]]"
|
|
23
|
-
placement="bottom"
|
|
24
|
-
@close="show = false"
|
|
25
|
-
@choose="onChoose"
|
|
26
|
-
/>
|
|
27
|
-
</template>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Or open via `useAction()` (wired by `t-app`):
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
import { useAction } from "@toife/vue";
|
|
34
|
-
|
|
35
|
-
const action = useAction();
|
|
36
|
-
action.open({
|
|
37
|
-
actions: [[{ text: "OK", handler: () => {} }]],
|
|
38
|
-
onClose: () => {},
|
|
39
|
-
onChoose: (btn) => {},
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Props
|
|
44
|
-
|
|
45
|
-
| Prop | Type | Default | Description |
|
|
46
|
-
| ----------- | ----------------------- | ------------ | -------------------------------------------------------------- |
|
|
47
|
-
| `visible` | `boolean` | `false` | Show the action layer. |
|
|
48
|
-
| `dismiss` | `string[]` | — | `Present` close reasons that emit `close` (e.g. `'backdrop'`). |
|
|
49
|
-
| `actions` | `Array<ActionButton[]>` | _(required)_ | Rows of button groups; each row is an array of buttons. |
|
|
50
|
-
| `role` | `string` | — | Theme role override; default from `t-app`. |
|
|
51
|
-
| `shape` | `string` | — | Shape override; default from `t-app`. |
|
|
52
|
-
| `divider` | `boolean` | — | Divider; default from `t-app`. |
|
|
53
|
-
| `shadow` | `boolean` | — | Shadow; default from `t-app`. |
|
|
54
|
-
| `placement` | `PresentPlacement` | `"bottom"` | `Present` placement (`top`, `bottom`, …). |
|
|
55
|
-
|
|
56
|
-
**Type source:** `src/components/action/action.type.ts`
|
|
57
|
-
|
|
58
|
-
`ActionButton`: `text`, `role`, `variant`, `shadow`, `handler`, `data`.
|
|
59
|
-
|
|
60
|
-
## Events (emits)
|
|
61
|
-
|
|
62
|
-
| Event | Payload | Description |
|
|
63
|
-
| -------- | ------------------- | --------------------------------------------------------- |
|
|
64
|
-
| `close` | `type?: string` | When `dismiss` matches the close reason. |
|
|
65
|
-
| `choose` | `btn: ActionButton` | After a button is chosen (after that button’s `handler`). |
|
|
66
|
-
|
|
67
|
-
## Slots
|
|
68
|
-
|
|
69
|
-
| Slot | Slot props | Description |
|
|
70
|
-
| ------ | ---------- | -------------------------------------------- |
|
|
71
|
-
| `body` | — | Replaces the default button layout entirely. |
|
|
72
|
-
|
|
73
|
-
## `v-model`
|
|
74
|
-
|
|
75
|
-
No `v-model` support.
|
|
76
|
-
|
|
77
|
-
## Provide / inject / context
|
|
78
|
-
|
|
79
|
-
Injects `APP_PROVIDER_STATE_KEY` from `t-app` for `divider`, `shadow`, `shape`, `role` when props are omitted.
|
|
80
|
-
|
|
81
|
-
## Expose (template ref)
|
|
82
|
-
|
|
83
|
-
Nothing exposed.
|
|
84
|
-
|
|
85
|
-
## Special behavior
|
|
86
|
-
|
|
87
|
-
- Backdrop close: if the payload is not in `dismiss`, a short `pop` animation runs instead of emitting `close`.
|
|
88
|
-
|
|
89
|
-
## Accessibility (a11y)
|
|
90
|
-
|
|
91
|
-
Inherits from `Present` (backdrop, focus). Buttons use inner `Button`.
|
|
92
|
-
|
|
93
|
-
## Style / class notes
|
|
94
|
-
|
|
95
|
-
BEM-style classes via `withPrefix`: `action`, `layer`, `surface`, `role`, `shape`, placement, `pop`, `divider`, `shadow`.
|
|
96
|
-
|
|
97
|
-
## Advanced example
|
|
98
|
-
|
|
99
|
-
```vue
|
|
100
|
-
<t-action
|
|
101
|
-
:visible="open"
|
|
102
|
-
:dismiss="['backdrop']"
|
|
103
|
-
:actions="[
|
|
104
|
-
[{ text: 'Cancel', variant: 'text', handler: cancel }],
|
|
105
|
-
[{ text: 'Delete', variant: 'fill', role: 'danger', handler: remove }],
|
|
106
|
-
]"
|
|
107
|
-
placement="bottom"
|
|
108
|
-
@close="(t) => console.log(t)"
|
|
109
|
-
/>
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## See also
|
|
113
|
-
|
|
114
|
-
- Source: `src/components/action`
|
|
115
|
-
- Composable: `action.composable.ts` (`useAction`)
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# `<t-app>`
|
|
2
|
-
|
|
3
|
-
> Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
|
|
4
|
-
|
|
5
|
-
## Description
|
|
6
|
-
|
|
7
|
-
Library root layout: provides theme/context (`provide`) for descendants, mounts multiple `Toast` regions by placement, and hosts `Action` / `DecisionModal` when using `useAction` / `useDecisionModal`.
|
|
8
|
-
|
|
9
|
-
## Requirements / dependencies
|
|
10
|
-
|
|
11
|
-
| Item | Notes |
|
|
12
|
-
| ----- | -------------------- |
|
|
13
|
-
| Vue | ^3.5 |
|
|
14
|
-
| Other | Router not required. |
|
|
15
|
-
|
|
16
|
-
## Basic usage
|
|
17
|
-
|
|
18
|
-
```vue
|
|
19
|
-
<template>
|
|
20
|
-
<t-app>
|
|
21
|
-
<t-page>App content</t-page>
|
|
22
|
-
</t-app>
|
|
23
|
-
</template>
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Props
|
|
27
|
-
|
|
28
|
-
| Prop | Type | Default | Description |
|
|
29
|
-
| ----------- | ------------------- | -------- | ------------------------------------------------ |
|
|
30
|
-
| `shape` | `string` | `"pill"` | Default shape for children (buttons, fields, …). |
|
|
31
|
-
| `divider` | `boolean` | `false` | Default divider flag. |
|
|
32
|
-
| `role` | `string` | `"mode"` | Default theme role. |
|
|
33
|
-
| `shadow` | `boolean` | `false` | Default shadow. |
|
|
34
|
-
| `triple` | `boolean` | `false` | Layout flag (provided to children). |
|
|
35
|
-
| `direction` | `"left" \| "right"` | `"left"` | Direction (fields, …). |
|
|
36
|
-
|
|
37
|
-
**Type source:** `src/components/app/app.type.ts`
|
|
38
|
-
|
|
39
|
-
## Events (emits)
|
|
40
|
-
|
|
41
|
-
_No public emits._
|
|
42
|
-
|
|
43
|
-
## Slots
|
|
44
|
-
|
|
45
|
-
| Slot | Description |
|
|
46
|
-
| --------- | ----------------------------------------------------- |
|
|
47
|
-
| `default` | Main app content. |
|
|
48
|
-
| `global` | Extra slot (after default, before internal overlays). |
|
|
49
|
-
|
|
50
|
-
## `v-model`
|
|
51
|
-
|
|
52
|
-
No.
|
|
53
|
-
|
|
54
|
-
## Provide / inject / context
|
|
55
|
-
|
|
56
|
-
`provide(APP_PROVIDER_STATE_KEY)`: `{ shape, divider, role, shadow, triple, direction }` — children inject for consistent theming.
|
|
57
|
-
|
|
58
|
-
## Expose
|
|
59
|
-
|
|
60
|
-
Nothing.
|
|
61
|
-
|
|
62
|
-
## Special behavior
|
|
63
|
-
|
|
64
|
-
- Renders several `Toast` instances with fixed placements (top/bottom × start/center/end).
|
|
65
|
-
- When `useAction()` / `useDecisionModal()` has `data`, renders the matching `Action` / `DecisionModal`.
|
|
66
|
-
|
|
67
|
-
## Accessibility (a11y)
|
|
68
|
-
|
|
69
|
-
Wrapper only; no special root role.
|
|
70
|
-
|
|
71
|
-
## Style / class notes
|
|
72
|
-
|
|
73
|
-
Classes: `layer`, `base`, `shape`, `app`.
|
|
74
|
-
|
|
75
|
-
## See also
|
|
76
|
-
|
|
77
|
-
- Source: `src/components/app`
|