@khsura/sui 1.19.0 → 1.20.0
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/@types/components/cards/sCardText.vue.d.ts +2 -2
- package/@types/components/datePicker/sDatePickerSwitch.vue.d.ts +2 -0
- package/@types/components/form/index.d.ts +1 -0
- package/@types/components/form/radio/sRadio.vue.d.ts +3 -0
- package/@types/components/form/sFormRow.vue.d.ts +18 -0
- package/@types/components/form/sInput.vue.d.ts +1 -0
- package/@types/components/form/sSelect.vue.d.ts +2 -0
- package/@types/components/layout/sNavigationDrawer.vue.d.ts +6 -6
- package/@types/components/progress/sProgressCircular.vue.d.ts +1 -0
- package/@types/components/progress/sProgressLinear.vue.d.ts +1 -0
- package/@types/components/sAutocomplete.vue.d.ts +3 -0
- package/@types/components/slideGroup/sSlideGroup.vue.d.ts +4 -1
- package/@types/components/table/sTable.vue.d.ts +2 -0
- package/@types/components/tabs/sTabs.vue.d.ts +2 -2
- package/@types/configs/app.d.ts +4 -0
- package/@types/configs/i18n.d.ts +3 -0
- package/@types/configs/provider.d.ts +1 -0
- package/@types/constants/color.d.ts +15 -0
- package/@types/constants/cssVariables.d.ts +4 -0
- package/@types/constants/datePicker.d.ts +7 -0
- package/@types/constants/i18n.d.ts +3 -0
- package/@types/constants/index.d.ts +3 -0
- package/@types/constants/keyboard.d.ts +12 -0
- package/@types/constants/listbox.d.ts +1 -0
- package/@types/constants/overlay.d.ts +5 -0
- package/@types/constants/tabs.d.ts +4 -0
- package/@types/definitions/props/core/propsLink.d.ts +2 -2
- package/@types/definitions/props/propsAutocomplete.d.ts +6 -0
- package/@types/definitions/props/propsInput.d.ts +1 -0
- package/@types/definitions/props/propsLink.d.ts +2 -2
- package/@types/definitions/props/propsProgressCircular.d.ts +2 -0
- package/@types/definitions/props/propsProgressLinear.d.ts +2 -0
- package/@types/definitions/props/propsSelect.d.ts +4 -0
- package/@types/definitions/props/propsSlideGroup.d.ts +4 -0
- package/@types/definitions/props/propsTable.d.ts +1 -0
- package/@types/definitions/props/propsTextarea.d.ts +3 -0
- package/@types/helpers/colorHelpers.d.ts +1 -1
- package/@types/helpers/createAppStore.d.ts +4 -0
- package/@types/lib/color.d.ts +21 -2
- package/@types/lib/index.d.ts +4 -0
- package/@types/lib/linkLocation.d.ts +9 -0
- package/@types/lib/overlayPlacement.d.ts +11 -0
- package/@types/lib/revealInScroller.d.ts +11 -0
- package/@types/lib/safeArea.d.ts +3 -0
- package/@types/playwright.visual.config.d.ts +3 -0
- package/@types/services/backgroundScrollService.d.ts +8 -2
- package/@types/services/datePicker/datePickerItemDateService.d.ts +1 -0
- package/@types/services/dialogService.d.ts +4 -8
- package/@types/services/fieldLayoutService.d.ts +19 -0
- package/@types/services/formInputService.d.ts +6 -0
- package/@types/services/index.d.ts +7 -0
- package/@types/services/linkService.d.ts +11 -1
- package/@types/services/listboxNavigationService.d.ts +20 -0
- package/@types/services/menuService.d.ts +2 -0
- package/@types/services/overlayFocusService.d.ts +10 -0
- package/@types/services/routerLinkService.d.ts +19 -0
- package/@types/services/scrollableFocusService.d.ts +10 -0
- package/@types/services/surfaceTextColorService.d.ts +8 -0
- package/@types/services/tabsService.d.ts +9 -0
- package/@types/store/index.d.ts +1 -0
- package/@types/store/scrollLockStore.d.ts +1 -0
- package/@types/tests/visual/constants/a11yAudit.d.ts +4 -0
- package/@types/tests/visual/constants/index.d.ts +4 -0
- package/@types/tests/visual/constants/resizeScroll.d.ts +10 -0
- package/@types/tests/visual/constants/storyRender.d.ts +5 -0
- package/@types/tests/visual/constants/visualMatrix.d.ts +20 -0
- package/@types/tests/visual/schemas/index.d.ts +1 -0
- package/@types/tests/visual/schemas/storyIndex.d.ts +17 -0
- package/@types/tests/visual/types/a11yAudit.d.ts +2 -0
- package/@types/tests/visual/types/index.d.ts +2 -0
- package/@types/tests/visual/types/visualStory.d.ts +8 -0
- package/@types/types/app.d.ts +2 -0
- package/@types/types/breadcrumbs.d.ts +2 -2
- package/@types/types/index.d.ts +2 -0
- package/@types/types/link.d.ts +20 -0
- package/@types/types/menu.d.ts +17 -0
- package/@types/types/safeArea.d.ts +1 -0
- package/@types/vite.config.d.ts +1 -0
- package/README.md +12 -0
- package/dist/base.css.map +1 -1
- package/dist/s-ui.css +1 -1
- package/dist/s-ui.js +3122 -2478
- package/dist/s-ui.umd.cjs +1 -1
- package/dist/styles/components/button/mixins.scss +5 -0
- package/dist/styles/components/form/_variables.scss +11 -0
- package/dist/styles/components/form/index.scss +1 -0
- package/dist/styles/components/index.scss +1 -0
- package/dist/styles/mixins/_app.scss +7 -0
- package/dist/styles/tools/_safeArea.scss +8 -0
- package/dist/styles/tools/index.scss +1 -0
- package/dist/sui-api.json +115 -5
- package/package.json +13 -3
- package/sui-plugin/.claude-plugin/plugin.json +1 -1
- package/sui-plugin/skills/sui-component/SKILL.md +11 -3
- package/sui-plugin/skills/sui-component/references/autocomplete.md +6 -1
- package/sui-plugin/skills/sui-component/references/breadcrumbs.md +3 -2
- package/sui-plugin/skills/sui-component/references/button.md +2 -2
- package/sui-plugin/skills/sui-component/references/cards.md +3 -3
- package/sui-plugin/skills/sui-component/references/date-picker.md +2 -1
- package/sui-plugin/skills/sui-component/references/dialog.md +3 -2
- package/sui-plugin/skills/sui-component/references/expansion-panels.md +1 -1
- package/sui-plugin/skills/sui-component/references/form.md +143 -95
- package/sui-plugin/skills/sui-component/references/image.md +3 -2
- package/sui-plugin/skills/sui-component/references/layout.md +7 -6
- package/sui-plugin/skills/sui-component/references/list.md +5 -2
- package/sui-plugin/skills/sui-component/references/menu.md +4 -1
- package/sui-plugin/skills/sui-component/references/progress.md +20 -18
- package/sui-plugin/skills/sui-component/references/slide-group.md +14 -12
- package/sui-plugin/skills/sui-component/references/snackbar.md +4 -2
- package/sui-plugin/skills/sui-component/references/table.md +8 -2
- package/sui-plugin/skills/sui-component/references/tabs.md +3 -0
- package/sui-plugin/skills/sui-component/references/tooltip.md +1 -0
- package/sui-plugin/skills/sui-component/references/window.md +5 -0
- package/sui-plugin/skills/sui-form/SKILL.md +20 -15
- package/sui-plugin/skills/sui-getting-started/SKILL.md +32 -7
- package/sui-plugin/skills/sui-layout/SKILL.md +3 -1
- package/sui-plugin/skills/sui-utilities/docs/classes.md +1 -1
|
@@ -18,7 +18,7 @@ Shared form-input props (`SInput`, `STextarea`, `SSelect`, `SCheckbox`, `SRadioG
|
|
|
18
18
|
| `rules` | `FormInputModelValueRule[]` | `undefined` | `(value) => true \| string` — a string is the error message |
|
|
19
19
|
| `id` | `string` | auto/`undefined` | Element id |
|
|
20
20
|
| `disabled` / `readonly` | `boolean \| null` | `undefined` | Disabled inputs show no errors |
|
|
21
|
-
| `hideDetails` | `boolean` | `undefined` | Hide label + error area |
|
|
21
|
+
| `hideDetails` | `boolean` | `undefined` | Hide the label above the field + error area (`SCheckbox` / `SRadio` keep their own label) |
|
|
22
22
|
| `hideError` | `boolean` | `undefined` | Hide only the error message |
|
|
23
23
|
| `error` / `dirty` | `boolean` | `undefined` | Typed; `dirty` only syncs the internal flag — neither triggers validation |
|
|
24
24
|
|
|
@@ -33,7 +33,9 @@ Shared events: `update:error` (`boolean`), `update:errors` (`string[]`), `update
|
|
|
33
33
|
|
|
34
34
|
## SForm
|
|
35
35
|
|
|
36
|
-
Renders a native `<form>` and collects child inputs.
|
|
36
|
+
Renders a native `<form novalidate>` and collects child inputs. Native browser validation is off, so `type="email"` / `required` never show the browser bubble over the SUI error; validate with `rules`. `:novalidate="false"` turns it back on. Before 1.20.0 `SForm` did not add `novalidate`; add it yourself there.
|
|
37
|
+
|
|
38
|
+
Every validated field reserves one error line under itself. For an action row (field + button: search bar, filter bar) use `SFormRow` (below), never a plain flex `<div>`, where the button lines up with the label. Field labels are inset 16px to line up with the value text inside the field.
|
|
37
39
|
|
|
38
40
|
| Model | Type | Description |
|
|
39
41
|
|-------|------|-------------|
|
|
@@ -77,6 +79,42 @@ Exposed: `validate(): boolean` — **returns `true` when there ARE errors**; `re
|
|
|
77
79
|
|
|
78
80
|
---
|
|
79
81
|
|
|
82
|
+
## SFormRow
|
|
83
|
+
|
|
84
|
+
*Since 1.20.0.* A wrapping row of text fields (`SInput`, `SSelect`, `SDatePickerInput`, `SAutocomplete`, `STextarea`) and their buttons. Each button's top and bottom match the field box: with or without a label, while an error shows, and when the row wraps at 375px. No props; slot `default`.
|
|
85
|
+
|
|
86
|
+
<!-- generated:api:start SFormRow -->
|
|
87
|
+
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
88
|
+
|
|
89
|
+
**SFormRow props**
|
|
90
|
+
|
|
91
|
+
None.
|
|
92
|
+
|
|
93
|
+
**SFormRow slots**
|
|
94
|
+
|
|
95
|
+
| Slot | Slot props | Description |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `default` | `any` | The fields and buttons of the row. |
|
|
98
|
+
|
|
99
|
+
**SFormRow events**
|
|
100
|
+
|
|
101
|
+
None.
|
|
102
|
+
|
|
103
|
+
<!-- generated:api:end SFormRow -->
|
|
104
|
+
|
|
105
|
+
```vue
|
|
106
|
+
<SFormRow>
|
|
107
|
+
<SDatePickerInput v-model="from" label="From" />
|
|
108
|
+
<SSelect v-model="status" label="Status" :items="statuses" />
|
|
109
|
+
<SButton color="primary" @click="apply">Apply</SButton>
|
|
110
|
+
</SFormRow>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- `SInput` / `STextarea` / `SAutocomplete` (and `grow` `SSelect`, `block` `SDatePickerInput`) share the free width; `SSelect` / `SDatePickerInput` otherwise keep their own width; buttons keep theirs; the row wraps when they don't fit. Each field keeps its error line; buttons reserve the same space, so wrapped lines and the next row keep their gap.
|
|
114
|
+
- Don't mix a `simple` field into it (its label is shorter). Before 1.20.0 there is no `SFormRow`: put `hide-details` on the field in a flex row.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
80
118
|
## SInput
|
|
81
119
|
|
|
82
120
|
<!-- generated:api:start SInput -->
|
|
@@ -88,6 +126,7 @@ Exposed: `validate(): boolean` — **returns `true` when there ARE errors**; `re
|
|
|
88
126
|
| --- | --- | --- | --- | --- |
|
|
89
127
|
| `allowDecimal` | `boolean \| null` | — | no | — |
|
|
90
128
|
| `appendOuter` | `string \| null` | — | no | — |
|
|
129
|
+
| `ariaLabel` | `string` | — | no | — |
|
|
91
130
|
| `ariaLabelledby` | `string` | — | no | — |
|
|
92
131
|
| `autocapitalize` | `"on" \| "off" \| null` | — | no | `off`, `on` |
|
|
93
132
|
| `autocomplete` | `string \| null` | — | no | — |
|
|
@@ -171,44 +210,46 @@ Model: `v-model` — `string | number | null`. Slots: `suffix`, `appendOuter` (n
|
|
|
171
210
|
|
|
172
211
|
## STextarea
|
|
173
212
|
|
|
174
|
-
Props: `label`, `placeholder`, `rows` (default `2`), `cols` (default `20`), **`autogrow`** (not `autoGrow`), `resize` (default off → `resize: none`), `simple`, `dense`, `tile`, `minlength`, `maxlength`, `name`, `autocomplete`, `autocapitalize`, `autofocus`, `spellcheck`, `ariaLabelledby`, `inputBackground`, `placeholderBackground`, `size` + shared. Model: `string` (`null` → `''`). Events: `change`, `input`, `blur`, `keydown` + shared. No slots. Exposed: `validate()`.
|
|
213
|
+
Props: `label`, `placeholder`, `rows` (default `2`), `cols` (default `20`), **`autogrow`** (not `autoGrow`), `resize` (default off → `resize: none`), **`counter`** (character count at the right of the error line; `12 / 200` with `maxlength`), `simple`, `dense`, `tile`, `minlength`, `maxlength`, `name`, `autocomplete`, `autocapitalize`, `autofocus`, `spellcheck`, `ariaLabelledby`, `inputBackground`, `placeholderBackground`, `size` + shared. Model: `string` (`null` → `''`). Events: `change`, `input`, `blur`, `keydown` + shared. No slots. Exposed: `validate()`.
|
|
175
214
|
|
|
176
215
|
<!-- generated:api:start STextarea -->
|
|
177
216
|
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
178
217
|
|
|
179
218
|
**STextarea props**
|
|
180
219
|
|
|
181
|
-
| Prop | Type | Default | Required | Values |
|
|
182
|
-
| --- | --- | --- | --- | --- |
|
|
183
|
-
| `
|
|
184
|
-
| `
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
190
|
-
| `
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
193
|
-
| `
|
|
194
|
-
| `
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `
|
|
200
|
-
| `
|
|
201
|
-
| `
|
|
202
|
-
| `
|
|
203
|
-
| `
|
|
204
|
-
| `
|
|
205
|
-
| `
|
|
206
|
-
| `
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
220
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
221
|
+
| --- | --- | --- | --- | --- | --- |
|
|
222
|
+
| `ariaLabel` | `string` | — | no | — | — |
|
|
223
|
+
| `ariaLabelledby` | `string` | — | no | — | — |
|
|
224
|
+
| `autocapitalize` | `"on" \| "off"` | — | no | `off`, `on` | — |
|
|
225
|
+
| `autocomplete` | `string` | — | no | — | — |
|
|
226
|
+
| `autofocus` | `boolean` | — | no | — | — |
|
|
227
|
+
| `autogrow` | `boolean` | — | no | — | — |
|
|
228
|
+
| `cols` | `number` | `20` | no | — | — |
|
|
229
|
+
| `counter` | `boolean` | — | no | — | Shows the character count (`12 / 200` with `maxlength`) at the right of the error line, right under the field. |
|
|
230
|
+
| `dense` | `boolean` | — | no | — | — |
|
|
231
|
+
| `dirty` | `boolean` | — | no | — | — |
|
|
232
|
+
| `disabled` | `boolean \| null` | — | no | — | — |
|
|
233
|
+
| `error` | `boolean` | — | no | — | — |
|
|
234
|
+
| `hideDetails` | `boolean` | — | no | — | — |
|
|
235
|
+
| `hideError` | `boolean` | — | no | — | — |
|
|
236
|
+
| `id` | `string` | — | no | — | — |
|
|
237
|
+
| `inputBackground` | `string` | — | no | — | — |
|
|
238
|
+
| `label` | `string` | — | no | — | — |
|
|
239
|
+
| `maxlength` | `string \| number` | — | no | — | — |
|
|
240
|
+
| `minlength` | `string \| number` | — | no | — | — |
|
|
241
|
+
| `modelValue` | `string` | `""` | no | — | — |
|
|
242
|
+
| `name` | `string` | — | no | — | — |
|
|
243
|
+
| `placeholder` | `string` | — | no | — | — |
|
|
244
|
+
| `placeholderBackground` | `string` | — | no | — | — |
|
|
245
|
+
| `readonly` | `boolean \| null` | — | no | — | — |
|
|
246
|
+
| `resize` | `boolean` | — | no | — | — |
|
|
247
|
+
| `rows` | `number` | `2` | no | — | — |
|
|
248
|
+
| `rules` | `FormInputModelValueRule[]` | — | no | — | — |
|
|
249
|
+
| `simple` | `boolean` | — | no | — | — |
|
|
250
|
+
| `size` | `SizePropertyType` | — | no | `default`, `extra`, `large`, `mini`, `small` | — |
|
|
251
|
+
| `spellcheck` | `boolean` | — | no | — | — |
|
|
252
|
+
| `tile` | `boolean` | — | no | — | — |
|
|
212
253
|
|
|
213
254
|
**STextarea slots**
|
|
214
255
|
|
|
@@ -241,49 +282,51 @@ Single-value dropdown (no `multiple`, `chips`, `clearable` or `placeholder` —
|
|
|
241
282
|
|
|
242
283
|
**SSelect props**
|
|
243
284
|
|
|
244
|
-
| Prop | Type | Default | Required | Values |
|
|
245
|
-
| --- | --- | --- | --- | --- |
|
|
246
|
-
| `activator` | `string \| HTMLElement \| ComponentPublicInstance \| null` | — | no | — |
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
251
|
-
| `
|
|
252
|
-
| `
|
|
253
|
-
| `
|
|
254
|
-
| `
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
| `
|
|
266
|
-
| `
|
|
267
|
-
| `
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
271
|
-
| `
|
|
272
|
-
| `
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
285
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
286
|
+
| --- | --- | --- | --- | --- | --- |
|
|
287
|
+
| `activator` | `string \| HTMLElement \| ComponentPublicInstance \| null` | — | no | — | — |
|
|
288
|
+
| `ariaLabel` | `string \| null` | — | no | — | Accessible name when there is no visible `label` (otherwise the label names the field). |
|
|
289
|
+
| `borderRadius` | `` number \| "tile" \| "rounded" \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}%` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — | — |
|
|
290
|
+
| `closeOnClick` | `boolean` | — | no | — | — |
|
|
291
|
+
| `closeOnContentClick` | `boolean` | — | no | — | — |
|
|
292
|
+
| `closeOnScroll` | `boolean` | — | no | — | — |
|
|
293
|
+
| `color` | `string` | — | no | — | — |
|
|
294
|
+
| `colorThreshold` | `number` | — | no | — | — |
|
|
295
|
+
| `contentClass` | `string \| string[] \| Record<string, boolean>` | — | no | — | — |
|
|
296
|
+
| `contentStyle` | `StyleValue` | — | no | — | — |
|
|
297
|
+
| `dense` | `boolean` | — | no | — | — |
|
|
298
|
+
| `dirty` | `boolean` | — | no | — | — |
|
|
299
|
+
| `disabled` | `boolean \| null` | — | no | — | — |
|
|
300
|
+
| `divided` | `boolean` | — | no | — | — |
|
|
301
|
+
| `error` | `boolean` | — | no | — | — |
|
|
302
|
+
| `grow` | `boolean` | — | no | — | — |
|
|
303
|
+
| `height` | `string \| number \| null` | — | no | — | — |
|
|
304
|
+
| `hideDetails` | `boolean` | — | no | — | — |
|
|
305
|
+
| `hideError` | `boolean` | — | no | — | — |
|
|
306
|
+
| `id` | `string` | — | no | — | — |
|
|
307
|
+
| `items` | `(string \| SelectItem \| null \| undefined)[]` | — | no | — | — |
|
|
308
|
+
| `label` | `string \| null` | — | no | — | — |
|
|
309
|
+
| `location` | `LocationRaw` | — | no | — | — |
|
|
310
|
+
| `maxHeight` | `string \| number \| null` | — | no | — | — |
|
|
311
|
+
| `maxWidth` | `string \| number \| null` | — | no | — | — |
|
|
312
|
+
| `menu` | `boolean` | — | no | — | — |
|
|
313
|
+
| `minHeight` | `string \| number \| null` | — | no | — | — |
|
|
314
|
+
| `minWidth` | `string \| number \| null` | — | no | — | — |
|
|
315
|
+
| `modelValue` | `T \| null` | — | no | — | — |
|
|
316
|
+
| `name` | `string \| null` | — | no | — | — |
|
|
317
|
+
| `offsetX` | `number \| null` | — | no | — | — |
|
|
318
|
+
| `offsetY` | `number \| null` | — | no | — | — |
|
|
319
|
+
| `outlined` | `boolean \| null` | `true` | no | — | — |
|
|
320
|
+
| `placeholder` | `string \| null` | — | no | — | Text shown in the field while nothing is selected. The label is never repeated inside the field. |
|
|
321
|
+
| `position` | `Position` | — | no | `absolute`, `fixed`, `relative`, `static`, `sticky` | — |
|
|
322
|
+
| `preventCloseOnClick` | `boolean` | — | no | — | — |
|
|
323
|
+
| `readonly` | `boolean \| null` | — | no | — | — |
|
|
324
|
+
| `rules` | `FormInputModelValueRule[]` | — | no | — | — |
|
|
325
|
+
| `screenPadding` | `number \| null` | — | no | — | — |
|
|
326
|
+
| `text` | `boolean` | — | no | — | — |
|
|
327
|
+
| `theme` | `AppThemeType` | — | no | `dark`, `light` | — |
|
|
328
|
+
| `underlined` | `boolean \| null` | — | no | — | — |
|
|
329
|
+
| `width` | `string \| number \| null` | — | no | — | — |
|
|
287
330
|
|
|
288
331
|
**SSelect slots**
|
|
289
332
|
|
|
@@ -308,11 +351,14 @@ Single-value dropdown (no `multiple`, `chips`, `clearable` or `placeholder` —
|
|
|
308
351
|
**SSelect notes**
|
|
309
352
|
|
|
310
353
|
- `items`: Options
|
|
311
|
-
- `label`: Label above
|
|
354
|
+
- `label`: Label above the field (never repeated inside it)
|
|
355
|
+
- `placeholder`: Text shown in the field while nothing is selected
|
|
356
|
+
- Width: as wide as the longest option or placeholder, like a native select; a long selection is clipped with an ellipsis; a long option in the list stays on one line with an ellipsis and its full text in `title`
|
|
312
357
|
- `name`: Name of a hidden native `<select>`
|
|
313
358
|
- `dense` / `grow` / `text` / `divided`: Compact / full width / text list style / list dividers
|
|
314
359
|
- `color`: List color
|
|
315
|
-
- `outlined
|
|
360
|
+
- `outlined`: default **`true`** (matches `SInput`); `:outlined="false"` for the borderless, shadowed look
|
|
361
|
+
- `underlined` / `borderRadius`: Activator border
|
|
316
362
|
- `location`, `offsetX`, `offsetY`, …: Dropdown positioning
|
|
317
363
|
|
|
318
364
|
```ts
|
|
@@ -323,7 +369,7 @@ Model: `v-model` — `string | number | null`; `v-model:menu` — open state. Sl
|
|
|
323
369
|
|
|
324
370
|
## SCheckbox
|
|
325
371
|
|
|
326
|
-
Boolean only. Props: `label`, `color` (preset name only), `size` (`'default' | 'large'`), `block`, `bordered` + shared. Model: `boolean`. Events: `change` (`boolean`) + shared. No `value`, `indeterminate` or array/group model.
|
|
372
|
+
Boolean only. Props: `label`, `color` (preset name only), `size` (`'default' | 'large'`), `block`, `bordered` + shared. Model: `boolean`. Events: `change` (`boolean`) + shared. No `value`, `indeterminate` or array/group model. The error line sits under the box; `hideDetails` removes only the error area, never the label.
|
|
327
373
|
|
|
328
374
|
<!-- generated:api:start SCheckbox -->
|
|
329
375
|
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
@@ -367,7 +413,7 @@ None.
|
|
|
367
413
|
|
|
368
414
|
## SRadioGroup / SRadio
|
|
369
415
|
|
|
370
|
-
Options are **`SRadio` children** — there is no `items` prop.
|
|
416
|
+
Options are **`SRadio` children** — there is no `items` prop. Long option labels wrap; the group's `hideDetails` removes only its error area (labels stay). Options have no background (before 1.20.0 a group with no value showed grey chips behind its options).
|
|
371
417
|
|
|
372
418
|
`SRadioGroup` props: `name`, `column`, `grow`, `color` (preset name), `mandatory`, `outlined` / `underlined` / `borderRadius` + shared. Model: `string | number | boolean`. Events: `change` + shared.
|
|
373
419
|
|
|
@@ -423,20 +469,21 @@ Options are **`SRadio` children** — there is no `items` prop.
|
|
|
423
469
|
|
|
424
470
|
**SRadio props**
|
|
425
471
|
|
|
426
|
-
| Prop | Type | Default | Required | Values |
|
|
427
|
-
| --- | --- | --- | --- | --- |
|
|
428
|
-
| `activeClass` | `string \| null` | — | no | — |
|
|
429
|
-
| `
|
|
430
|
-
| `
|
|
431
|
-
| `
|
|
432
|
-
| `
|
|
433
|
-
| `
|
|
434
|
-
| `
|
|
435
|
-
| `
|
|
436
|
-
| `
|
|
437
|
-
| `
|
|
438
|
-
| `
|
|
439
|
-
| `
|
|
472
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
473
|
+
| --- | --- | --- | --- | --- | --- |
|
|
474
|
+
| `activeClass` | `string \| null` | — | no | — | — |
|
|
475
|
+
| `ariaLabel` | `string \| null` | — | no | — | Accessible name for a radio without a visible `label` (for example an icon-only option). |
|
|
476
|
+
| `borderRadius` | `` number \| "tile" \| "rounded" \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}%` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — | — |
|
|
477
|
+
| `disabled` | `boolean \| null` | — | no | — | — |
|
|
478
|
+
| `id` | `string` | — | no | — | — |
|
|
479
|
+
| `label` | `string \| null` | — | no | — | — |
|
|
480
|
+
| `name` | `string \| null` | — | no | — | — |
|
|
481
|
+
| `outlined` | `boolean \| null` | — | no | — | — |
|
|
482
|
+
| `readonly` | `boolean \| null` | — | no | — | — |
|
|
483
|
+
| `selected` | `boolean` | — | no | — | — |
|
|
484
|
+
| `type` | `ButtonTypeType` | — | no | `button`, `reset`, `submit` | — |
|
|
485
|
+
| `underlined` | `boolean \| null` | — | no | — | — |
|
|
486
|
+
| `value` | `string \| number \| boolean` | — | no | — | — |
|
|
440
487
|
|
|
441
488
|
**SRadio slots**
|
|
442
489
|
|
|
@@ -573,3 +620,4 @@ const submit = () => {
|
|
|
573
620
|
|
|
574
621
|
- `SRadioGroup` without `mandatory`: clicking the selected radio clears the value.
|
|
575
622
|
- `SSelect` validates when its menu opens, so a required error can appear on first open.
|
|
623
|
+
- `SSelect` / `SAutocomplete` / `SDatePickerInput` dropdowns flip or shift to stay 8px inside the viewport — no wrapper, padding or `location` workaround needed for fields at the bottom or right edge.
|
|
@@ -68,9 +68,10 @@ None.
|
|
|
68
68
|
|
|
69
69
|
## Gotchas
|
|
70
70
|
|
|
71
|
-
- The wrapper defaults to `width: 100%; height: 100
|
|
71
|
+
- The wrapper defaults to `width: 100%; height: 100%` (`height: auto` when `aspect-ratio` is set). In a parent with no height, give it `aspect-ratio` or `height`.
|
|
72
72
|
- Use `object-fit="cover"` with `aspect-ratio` to avoid stretching.
|
|
73
|
-
-
|
|
73
|
+
- With `aspect-ratio` and no `height`, the wrapper uses `height: auto`, so the ratio sets its height even in a flex-column card (an equal-height grid). Older versions kept `height: 100%` there and the images in one row got different heights; on those, add `height="auto"`.
|
|
74
|
+
- Without a `src` the wrapper shows a neutral placeholder (the app background colour) instead of a blank gap, so a card with a missing image keeps its shape.
|
|
74
75
|
|
|
75
76
|
| ❌ | ✅ |
|
|
76
77
|
|----|----|
|
|
@@ -18,16 +18,16 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/props<AppBar|Navigatio
|
|
|
18
18
|
|
|
19
19
|
## How layouts are linked (read this first)
|
|
20
20
|
|
|
21
|
-
- **`SApp`** is the root. It provides the app state and is itself an *app-level* layout. Wrap the whole app in it (after installing the `createSUI()` plugin).
|
|
21
|
+
- **`SApp`** is the root. It provides the app state and is itself an *app-level* layout. Wrap the whole app in it (after installing the `createSUI()` plugin). It is at least the viewport height (`100dvh`), and an `SLayout` directly inside it grows with it, so don't add your own `min-height: 100vh` wrapper. A direct child with `s_height--fill` grows the same way, so a page root with `s_display__flex s_justify__center s_align__center s_height--fill` centres its content in the viewport (see the `centered-page` recipe).
|
|
22
22
|
- **`SLayout`** creates a layout scope. Children find it by name:
|
|
23
23
|
- SLayout without `name` → children **without `for`** join it as the **app-level** layout (inside `SApp`).
|
|
24
24
|
- SLayout with `name="x"` → **every** child needs `for="x"`. A child without `for` joins the app-level layout instead, so offsets silently break.
|
|
25
25
|
- **App-level vs nested.** A layout is app-level when its name equals the plugin name (`'sui'` by default, so: no `name`) or when it has the `app` prop. A named layout (`name="x"` with no `app` prop on it and its children) is a *nested* layout:
|
|
26
26
|
- `SNavigationDrawer` is `position: absolute` inside the layout (not fixed), and `permanent` has **no effect**.
|
|
27
27
|
- `SFooter` ignores `position`. `SBottomNavigation` is not fixed unless you set `position="fixed"`.
|
|
28
|
-
- `SMain` renders `<section>` with `min-height: 100%` instead of `<main>` with `100vh
|
|
28
|
+
- `SMain` renders `<section>` with `min-height: 100%` instead of `<main>` with `100vh` (minus the app bar and footer heights).
|
|
29
29
|
- Without `SApp`, an unnamed `SLayout` and its children do **not** link up.
|
|
30
|
-
- Below the `md` breakpoint (or with `forceMobile`), a drawer becomes a mobile overlay. It does not push `SMain`, opens by swiping in from the screen edge, and closes on an outside click.
|
|
30
|
+
- Below the `md` breakpoint (or with `forceMobile`), a drawer becomes a mobile overlay. It does not push `SMain`, opens by swiping in from the screen edge, dims what is behind it with a scrim (the page for an app-level drawer, the layout for a nested one), and closes on an outside click or a tap on the scrim.
|
|
31
31
|
|
|
32
32
|
```vue
|
|
33
33
|
<!-- Recommended: app-level layout -->
|
|
@@ -171,7 +171,7 @@ None.
|
|
|
171
171
|
- `color`: Background
|
|
172
172
|
- `elevation`, `outlined`, `underlined`, `borderRadius`, `tag`: Shared props (default: `tag: 'header'`)
|
|
173
173
|
|
|
174
|
-
**Slots:** `default`, `extension`. SAppBar does **not** forward `prepend`/`append`, so put everything in `default` and use `SSpacer`.
|
|
174
|
+
**Slots:** `default`, `extension`. SAppBar does **not** forward `prepend`/`append`, so put everything in `default` and use `SSpacer`. The content keeps an inset from the bar edges (the title and any other first/last item 16px, toolbar buttons 10px); no extra padding is needed.
|
|
175
175
|
|
|
176
176
|
## SAppBarTitle
|
|
177
177
|
|
|
@@ -260,7 +260,7 @@ None.
|
|
|
260
260
|
**SNavigationDrawer notes**
|
|
261
261
|
|
|
262
262
|
- `for` / `app`: Layout link
|
|
263
|
-
- `v-model`: Open state.
|
|
263
|
+
- `v-model`: Open state. At mount and on every resize it opens itself on desktop and closes itself on mobile, whatever the starting value (unless `persistent`)
|
|
264
264
|
- `location`: Side. `bottom` is always mobile-style (default: `'left'`)
|
|
265
265
|
- `permanent`: Always open on desktop (**app-level layout only**)
|
|
266
266
|
- `persistent`: Desktop: ignore outside clicks and resizes
|
|
@@ -276,7 +276,7 @@ None.
|
|
|
276
276
|
- `height`: Height. App-level = the drawer has `app`, or its `for` is the app's name (default: `100vh` when app-level, else `100%`)
|
|
277
277
|
- `position`, `elevation`: Shared props
|
|
278
278
|
- `tag`: Root element (default: `nav` when app-level, else `aside`)
|
|
279
|
-
- `hideOverlay`:
|
|
279
|
+
- `hideOverlay`: Don't dim the page (or the nested layout) behind an open mobile drawer
|
|
280
280
|
|
|
281
281
|
**Slots:** `prepend`, `default` (scope `{ on }`: `click`, `transitionend`, `mouseenter`, `mouseleave` handlers), `append`.
|
|
282
282
|
**Events:** `update:modelValue`, `update:width` (resize end), `update:miniVariant`, `transitionend`.
|
|
@@ -610,3 +610,4 @@ None.
|
|
|
610
610
|
| `<SCol>` | `<SColumn>` |
|
|
611
611
|
| `<SBottomNavigation v-model="tab">` with no `height`/`active-class` | Set `:height` and `active-class` |
|
|
612
612
|
| `<SAppBar elevate-on-scroll>` with no position | Add `position="fixed"` |
|
|
613
|
+
| `padding-top: env(safe-area-inset-top)` on a fixed `SAppBar` / `SBottomNavigation` / mobile drawer | They pad by the iPhone safe areas themselves; only add `viewport-fit=cover` to the viewport meta (getting-started skill). Your own `env()` padding doubles the inset |
|
|
@@ -77,7 +77,7 @@ A flex row with a minimum height of 48px (40px when the list is `dense`).
|
|
|
77
77
|
| `selectable` | `boolean \| null` | — | no | — |
|
|
78
78
|
| `tag` | `"div" \| "li" \| null` | — | no | `div`, `li` |
|
|
79
79
|
| `target` | `"_blank" \| "_self" \| "_parent" \| "_top"` | — | no | `_blank`, `_parent`, `_self`, `_top` |
|
|
80
|
-
| `to` | `
|
|
80
|
+
| `to` | `LinkLocation \| null` | — | no | — |
|
|
81
81
|
|
|
82
82
|
**SListItem slots**
|
|
83
83
|
|
|
@@ -100,7 +100,7 @@ A flex row with a minimum height of 48px (40px when the list is `dense`).
|
|
|
100
100
|
- `lines`: Subtitle line clamp for this item (overrides the list's `lines`)
|
|
101
101
|
- `disabled`: Disabled state
|
|
102
102
|
- `href`: Render as `<a>`
|
|
103
|
-
- `to`: Render as `router-link`
|
|
103
|
+
- `to`: Render as `router-link` (plain `<a href>` without vue-router)
|
|
104
104
|
- `target` / `rel`: Link attributes
|
|
105
105
|
- `tag`: Root element (when not a link) (default: `'div'`)
|
|
106
106
|
- `default` (slot): Item content
|
|
@@ -177,6 +177,8 @@ None.
|
|
|
177
177
|
|
|
178
178
|
Leading icon area and trailing action area. `default` slot.
|
|
179
179
|
|
|
180
|
+
`SListItemContent` keeps a minimum width of `min(40%, 160px)`. When the icon and the actions leave less room than that (two text buttons on a phone), the list item moves the `SListItemAction` onto its own line below the text, aligned to the right edge, instead of squeezing the title to one letter. (Older versions squeezed it.)
|
|
181
|
+
|
|
180
182
|
<!-- generated:api:start SListItemIcon -->
|
|
181
183
|
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
182
184
|
|
|
@@ -319,3 +321,4 @@ A collapsible sub-list. By default it renders a clickable header row (title, sub
|
|
|
319
321
|
| `<SListItem selectable>` expecting a selected highlight | Manage the active state yourself (e.g. a class), since `selectable` only changes the cursor |
|
|
320
322
|
| `<SListItemGroup>` used for single/multi selection | It only expands and collapses. Track selection yourself |
|
|
321
323
|
| `<SList inset>` | No effect |
|
|
324
|
+
| Shrinking the actions (or the title's font) so two text buttons fit next to a long title on a phone | Not needed: the actions move below the text when it would get narrower than `min(40%, 160px)` |
|
|
@@ -58,7 +58,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsMenu.d.ts`
|
|
|
58
58
|
- `closeOnScroll`: Close on window scroll
|
|
59
59
|
- `position`: `'fixed'` positions relative to the viewport (use inside fixed containers)
|
|
60
60
|
- `offsetX` / `offsetY`: Extra offset in px
|
|
61
|
-
- `screenPadding`:
|
|
61
|
+
- `screenPadding`: Gap in px the menu keeps from the viewport edges (default 8)
|
|
62
62
|
- `contentClass`: Classes on the content element
|
|
63
63
|
- `contentStyle`: Styles on the content element
|
|
64
64
|
- `preventCloseOnClick`: Activator click only opens, never closes
|
|
@@ -105,3 +105,6 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsMenu.d.ts`
|
|
|
105
105
|
|
|
106
106
|
- The app must be wrapped in `<SApp>` (menus teleport into its overlay container).
|
|
107
107
|
- `closeOnClick` exists in the prop types but has no effect; outside clicks always close the menu.
|
|
108
|
+
- The menu stays inside the viewport: it flips above or below its activator when the other side has room, otherwise shifts, and keeps an 8px gutter from every edge (`screenPadding` overrides the gutter). It follows its activator when the page or a scroll container scrolls, so a row menu inside an `SList` or table is safe.
|
|
109
|
+
- The menu is as wide as its items (capped at 90vw), so list titles are not cut off.
|
|
110
|
+
- Esc closes the menu and returns focus to the activator.
|
|
@@ -15,15 +15,16 @@ Horizontal progress bar.
|
|
|
15
15
|
|
|
16
16
|
**SProgressLinear props**
|
|
17
17
|
|
|
18
|
-
| Prop | Type | Default | Required | Values |
|
|
19
|
-
| --- | --- | --- | --- | --- |
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
18
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
19
|
+
| --- | --- | --- | --- | --- | --- |
|
|
20
|
+
| `ariaLabel` | `string` | `"Loading"` | no | — | Accessible name of the progress bar. Defaults to `'Loading'`; name what is loading when you can. |
|
|
21
|
+
| `backgroundColor` | `string \| null` | — | no | — | — |
|
|
22
|
+
| `backgroundOpacity` | `string \| number \| null` | — | no | — | — |
|
|
23
|
+
| `color` | `string` | `"info"` | no | — | — |
|
|
24
|
+
| `indeterminate` | `boolean` | — | no | — | — |
|
|
25
|
+
| `position` | `Position` | — | no | `absolute`, `fixed`, `relative`, `static`, `sticky` | — |
|
|
26
|
+
| `size` | `string \| number \| null` | — | no | — | — |
|
|
27
|
+
| `value` | `string \| number` | `0` | no | — | — |
|
|
27
28
|
|
|
28
29
|
**SProgressLinear slots**
|
|
29
30
|
|
|
@@ -61,15 +62,16 @@ Circular progress / spinner.
|
|
|
61
62
|
|
|
62
63
|
**SProgressCircular props**
|
|
63
64
|
|
|
64
|
-
| Prop | Type | Default | Required | Values |
|
|
65
|
-
| --- | --- | --- | --- | --- |
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
65
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
66
|
+
| --- | --- | --- | --- | --- | --- |
|
|
67
|
+
| `ariaLabel` | `string` | `"Loading"` | no | — | Accessible name of the progress bar. Defaults to `'Loading'`; name what is loading when you can. |
|
|
68
|
+
| `color` | `string \| null` | — | no | — | — |
|
|
69
|
+
| `indeterminate` | `boolean` | — | no | — | — |
|
|
70
|
+
| `rotate` | `number` | — | no | — | — |
|
|
71
|
+
| `size` | `string \| number` | `32` | no | — | — |
|
|
72
|
+
| `theme` | `AppThemeType` | — | no | `dark`, `light` | — |
|
|
73
|
+
| `value` | `number` | `0` | no | — | — |
|
|
74
|
+
| `width` | `number` | `4` | no | — | — |
|
|
73
75
|
|
|
74
76
|
**SProgressCircular slots**
|
|
75
77
|
|
|
@@ -15,17 +15,19 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsSlideGroup.d.ts`
|
|
|
15
15
|
|
|
16
16
|
**SSlideGroup props**
|
|
17
17
|
|
|
18
|
-
| Prop | Type | Default | Required | Values |
|
|
19
|
-
| --- | --- | --- | --- | --- |
|
|
20
|
-
| `activeClass` | `string \| null` | — | no | — |
|
|
21
|
-
| `centerActive` | `boolean` | — | no | — |
|
|
22
|
-
| `contentClass` | `string \| string[] \| Record<string, boolean>` | — | no | — |
|
|
23
|
-
| `contentStyle` | `StyleValue` | — | no | — |
|
|
24
|
-
| `mandatory` | `boolean` | — | no | — |
|
|
25
|
-
| `modelValue` | `GroupItemValue[]` | `[]` | no | — |
|
|
26
|
-
| `multiple` | `boolean` | — | no | — |
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
18
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
19
|
+
| --- | --- | --- | --- | --- | --- |
|
|
20
|
+
| `activeClass` | `string \| null` | — | no | — | — |
|
|
21
|
+
| `centerActive` | `boolean` | — | no | — | — |
|
|
22
|
+
| `contentClass` | `string \| string[] \| Record<string, boolean>` | — | no | — | — |
|
|
23
|
+
| `contentStyle` | `StyleValue` | — | no | — | — |
|
|
24
|
+
| `mandatory` | `boolean` | — | no | — | — |
|
|
25
|
+
| `modelValue` | `GroupItemValue[]` | `[]` | no | — | — |
|
|
26
|
+
| `multiple` | `boolean` | — | no | — | — |
|
|
27
|
+
| `nextAriaLabel` | `string` | `"Next"` | no | — | Accessible name of the next arrow button. Defaults to `'Next'`. |
|
|
28
|
+
| `prevAriaLabel` | `string` | `"Previous"` | no | — | Accessible name of the previous arrow button. Defaults to `'Previous'`. |
|
|
29
|
+
| `scrollable` | `boolean \| null` | — | no | — | — |
|
|
30
|
+
| `slideStep` | `number \| null` | — | no | — | — |
|
|
29
31
|
|
|
30
32
|
**SSlideGroup slots**
|
|
31
33
|
|
|
@@ -156,5 +158,5 @@ const activeFilters = ref<string[]>([])
|
|
|
156
158
|
| `#default="{ isSelected, select }"` + `@click="select"` | Only `isSelected` exists; the item itself toggles on click |
|
|
157
159
|
| `scrollable` to get arrows | Arrows appear when `scrollable` is **off** and items overflow |
|
|
158
160
|
|
|
159
|
-
-
|
|
161
|
+
- Each slot's `attrs.disabled` is `true` only at that arrow's own edge, so `v-bind="attrs"` is enough for a custom arrow. Before 1.20.0 the `right` slot's `attrs.disabled` mirrored the *previous* button's state; there, compute your own disabled state for a custom "next" button.
|
|
160
162
|
- `disabled` on an item blocks clicks via CSS (`pointer-events: none`) and dims it.
|
|
@@ -68,7 +68,7 @@ None — use `v-model`.
|
|
|
68
68
|
<SSnackbar v-model="offline" location="top">
|
|
69
69
|
Connection lost.
|
|
70
70
|
<template #action>
|
|
71
|
-
<SButton variant="text"
|
|
71
|
+
<SButton variant="text" @click="retry">Retry</SButton>
|
|
72
72
|
<SButton variant="icon" @click="offline = false"><SIcon icon="mdi-close" /></SButton>
|
|
73
73
|
</template>
|
|
74
74
|
</SSnackbar>
|
|
@@ -81,8 +81,10 @@ None — use `v-model`.
|
|
|
81
81
|
## Gotchas
|
|
82
82
|
|
|
83
83
|
- No `color` prop — colors come from the theme's `snackbar` color.
|
|
84
|
-
- The snackbar is dark (`#424242`) in both themes.
|
|
84
|
+
- The snackbar is dark (`#424242`) in both themes. Give a `variant="text"` (or `variant="icon"`) action **no** `color`: it takes the snackbar's light text colour, so the readable action is `<SButton variant="text">Undo</SButton>`. Since 1.20.0 a preset `color` (`warning`, `primary`, ...) inside the snackbar uses a variant that reaches 4.5:1 on it, but adds nothing over the default. A CSS colour (`color="#1976d2"`) is used as is, so pick a light one such as `color="#ffffff"`. Before 1.20.0 an action without `color` kept the page's dark text colour (about 1.3:1) and `primary`, `secondary`, `success`, `info` and `error` were below 4.5:1 (`primary` 2.18:1), so use `color="warning"` or a light CSS colour there.
|
|
85
|
+
- One snackbar per location: two open at the same `location` overlap. Show one at a time (or one `top`, one bottom); a queue component for stacking is planned.
|
|
85
86
|
- `outlined`, `underlined` and `borderRadius` appear in the prop types but are not applied.
|
|
86
87
|
- Without `timeout`, provide a close action in `#action`.
|
|
87
88
|
- Single-line by default: long text is cut with an ellipsis — use `multi-line`.
|
|
88
89
|
- The app must be wrapped in `<SApp>` (the snackbar teleports into its overlay container).
|
|
90
|
+
- On an iPhone with `viewport-fit=cover` the snackbar clears the home indicator (or the notch with `location="top"`) by itself.
|
|
@@ -37,6 +37,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsTable.d.ts`. The
|
|
|
37
37
|
| `itemsPerPage` | `number` | — | no | — |
|
|
38
38
|
| `itemsPerPageLabel` | `string` | — | no | — |
|
|
39
39
|
| `loading` | `boolean` | — | no | — |
|
|
40
|
+
| `loadingText` | `string` | — | no | — |
|
|
40
41
|
| `multiSort` | `boolean` | `false` | no | — |
|
|
41
42
|
| `noDataText` | `string` | — | no | — |
|
|
42
43
|
| `outlined` | `boolean` | `false` | no | — |
|
|
@@ -65,6 +66,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsTable.d.ts`. The
|
|
|
65
66
|
| `itemFooter` | `TableItemFooterSlotProps<T>` | Full-width row below an item, rendered when `itemFooter` is set and the item has that key. |
|
|
66
67
|
| `itemHeader` | `TableItemHeaderSlotProps<T>` | Full-width row above an item, rendered when `itemHeader` is set and the item has that key. |
|
|
67
68
|
| `itemsPerPageLabel` | `any` | Label of the items-per-page selector in the pagination. |
|
|
69
|
+
| `loadingData` | `any` | Shown instead of the rows while `loading` is set and `items` is still empty. |
|
|
68
70
|
| `noData` | `any` | Shown instead of the rows when `items` is empty and not loading. |
|
|
69
71
|
|
|
70
72
|
**STable events**
|
|
@@ -86,14 +88,15 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsTable.d.ts`. The
|
|
|
86
88
|
- `items`: Row objects
|
|
87
89
|
- `itemKey`: Field used to match **expanded** rows (default: first header's `value`)
|
|
88
90
|
- `dense`: Compact cells
|
|
89
|
-
- `loading`: Indeterminate progress bar. Hides the no-data row
|
|
91
|
+
- `loading`: Indeterminate progress bar. Hides the no-data row; while `items` is still empty it shows a full-width loading row instead
|
|
92
|
+
- `loadingText`: Text of that loading row (`#loadingData` slot overrides it) (default: i18n `table.loading` → `'Loading…'`)
|
|
90
93
|
- `outlined` / `underlined`: Border styles
|
|
91
94
|
- `rounded` / `tile`: Declared, but **no effect** (the table never reads them)
|
|
92
95
|
- `hideHeader`: Hide `<thead>`
|
|
93
96
|
- `hideVerticalBorders`: Remove column borders
|
|
94
97
|
- `hideTopBottomBorders`: Remove outer top/bottom borders
|
|
95
98
|
- `hidePagination`: Hides the pager only when `itemsPerPage` is unset or greater than the total
|
|
96
|
-
- `stickyHeader`: Sticky header row
|
|
99
|
+
- `stickyHeader`: Sticky header row. Give the table a height limit (`style="max-height: 400px"` or a `height`): the rows scroll inside the table, the header sticks and the pagination stays visible below
|
|
97
100
|
- `multiSort`: Sort by several columns
|
|
98
101
|
- `groupBy`: Group rows by item field(s). Group name = values joined with a space
|
|
99
102
|
- `foldable`: Clicking a group row collapses or expands it
|
|
@@ -122,6 +125,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsTable.d.ts`. The
|
|
|
122
125
|
- `itemHeader` / `itemFooter` (slot): Full-width rows from `itemHeader`/`itemFooter`
|
|
123
126
|
- `expanded` (slot): Content of an expanded row
|
|
124
127
|
- `noData` (slot): Empty state
|
|
128
|
+
- `loadingData` (slot): Loading row, shown while `loading` is set and `items` is empty
|
|
125
129
|
- `itemsPerPageLabel` (slot): Pager label
|
|
126
130
|
|
|
127
131
|
### TableHeader
|
|
@@ -211,3 +215,5 @@ const perPage = ref(10)
|
|
|
211
215
|
| Waiting for `update:options` to fetch on sort change | It fires only for page/page-size changes. Sorting is always client-side |
|
|
212
216
|
| Rebuilding item objects and expecting `selected` to persist | Selection matches by **object identity** (`itemKey` applies only to expansion) |
|
|
213
217
|
| Buttons inside a row also trigger `click:row` | Use `@click.stop` |
|
|
218
|
+
| Using `STable` without importing it (registered globally with `app.component` and no `GlobalComponents` types) and expecting typed `#item.<value>` slots | The slot `item` is typed from `items` only when the template knows the component type: import `STable` from `@khsura/sui` in the SFC (Nuxt's generated component types also work). Otherwise `item` is `any` |
|
|
219
|
+
| Wrapping `STable` in a fixed-height `div` to get a sticky header | Put the height limit on `STable` itself. Older versions clipped the rows and the pagination instead of scrolling them |
|
|
@@ -6,6 +6,8 @@ Single-select tab strip, built on the toggle-button group. It renders only the t
|
|
|
6
6
|
|
|
7
7
|
Types: `node_modules/@khsura/sui/@types/definitions/props/propsTabs.d.ts`, `propsTab.d.ts`
|
|
8
8
|
|
|
9
|
+
The tabs stay on **one row**. Each tab keeps the width of its label (tabs stretch to fill spare room), and when they do not fit, the row scrolls sideways (touch, trackpad, shift+wheel) with no scrollbar. The selected tab is scrolled into view on mount and whenever the selection changes. Don't wrap `STabs` in `SSlideGroup` or add `overflow-x: auto` yourself. (Older versions wrapped the tabs onto several rows on phones.)
|
|
10
|
+
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
## STabs
|
|
@@ -130,4 +132,5 @@ const active = ref<'overview' | 'api'>('overview')
|
|
|
130
132
|
| `<STab value="a">` / `<STab :index="0">` | `<STab tab="a">`. The identifier prop is `tab` |
|
|
131
133
|
| `<STabs>` without `v-model` | `modelValue` is required |
|
|
132
134
|
| Panels that slide between tabs | Bind the same model to [SWindow](./window.md) with `SWindowItem value` = the `STab tab` |
|
|
135
|
+
| Many tabs on a phone wrapping onto several rows | They no longer wrap: the row scrolls sideways. Keep labels short anyway, so more of them are visible |
|
|
133
136
|
| `underlined` to get an active underline | It styles the strip's border. Use `selectedTabColor` for the active state |
|