@khsura/sui 1.20.0 → 1.21.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/avatar/index.d.ts +2 -0
- package/@types/components/avatar/sAvatar.vue.d.ts +13 -0
- package/@types/components/avatar/sAvatarGroup.vue.d.ts +16 -0
- package/@types/components/form/index.d.ts +1 -0
- package/@types/components/form/sFormRow.vue.d.ts +1 -1
- package/@types/components/form/sNumberInput.vue.d.ts +29 -0
- package/@types/components/form/sSelect.vue.d.ts +8 -3
- package/@types/components/index.d.ts +5 -0
- package/@types/components/sAutocomplete.vue.d.ts +8 -1
- package/@types/components/sEmptyState.vue.d.ts +26 -0
- package/@types/components/sFileInput.vue.d.ts +35 -0
- package/@types/components/sPagination.vue.d.ts +21 -0
- package/@types/components/sSkeletonLoader.vue.d.ts +19 -0
- package/@types/components/toggleButtonGroup/sToggleButtonGroup.vue.d.ts +2 -0
- package/@types/configs/fileInput.d.ts +5 -0
- package/@types/configs/index.d.ts +2 -0
- package/@types/configs/provider.d.ts +1 -0
- package/@types/configs/skeletonLoader.d.ts +57 -0
- package/@types/constants/avatar.d.ts +3 -0
- package/@types/constants/fileInput.d.ts +31 -0
- package/@types/constants/index.d.ts +5 -0
- package/@types/constants/layout.d.ts +2 -0
- package/@types/constants/numberInput.d.ts +22 -0
- package/@types/constants/pagination.d.ts +20 -0
- package/@types/constants/skeletonLoader.d.ts +33 -0
- package/@types/constants/tabs.d.ts +6 -0
- package/@types/definitions/props/index.d.ts +7 -0
- package/@types/definitions/props/propsAutocomplete.d.ts +2 -0
- package/@types/definitions/props/propsAvatar.d.ts +13 -0
- package/@types/definitions/props/propsAvatarGroup.d.ts +8 -0
- package/@types/definitions/props/propsEmptyState.d.ts +17 -0
- package/@types/definitions/props/propsFileInput.d.ts +41 -0
- package/@types/definitions/props/propsNumberInput.d.ts +46 -0
- package/@types/definitions/props/propsPagination.d.ts +32 -0
- package/@types/definitions/props/propsRow.d.ts +1 -0
- package/@types/definitions/props/propsSelect.d.ts +2 -0
- package/@types/definitions/props/propsSkeletonLoader.d.ts +18 -0
- package/@types/definitions/props/propsTabs.d.ts +4 -0
- package/@types/helpers/fileInputRules.d.ts +18 -0
- package/@types/helpers/index.d.ts +1 -0
- package/@types/lib/escapeHtml.d.ts +2 -0
- package/@types/lib/flattenVNodes.d.ts +2 -0
- package/@types/lib/index.d.ts +3 -0
- package/@types/lib/numberInput.d.ts +23 -0
- package/@types/lib/revealInScroller.d.ts +14 -0
- package/@types/services/appBarService.d.ts +14 -0
- package/@types/services/core/layoutCoreService.d.ts +4 -0
- package/@types/services/index.d.ts +2 -0
- package/@types/services/layoutProviderService.d.ts +6 -0
- package/@types/services/layoutService.d.ts +4 -0
- package/@types/services/paginationService.d.ts +39 -0
- package/@types/services/skeletonLoaderService.d.ts +22 -0
- package/@types/services/tabsService.d.ts +6 -1
- package/@types/types/emits.d.ts +12 -0
- package/@types/types/fileInput.d.ts +28 -0
- package/@types/types/index.d.ts +4 -0
- package/@types/types/numberInput.d.ts +12 -0
- package/@types/types/pagination.d.ts +17 -0
- package/@types/types/skeletonLoader.d.ts +16 -0
- package/dist/s-ui.css +1 -1
- package/dist/s-ui.js +3966 -2856
- package/dist/s-ui.umd.cjs +1 -1
- package/dist/styles/components/avatar/_variables.scss +17 -0
- package/dist/styles/components/avatar/index.scss +1 -0
- package/dist/styles/components/index.scss +1 -0
- package/dist/sui-api.json +1208 -235
- package/package.json +3 -2
- package/sui-plugin/.claude-plugin/plugin.json +1 -1
- package/sui-plugin/skills/sui-component/SKILL.md +10 -3
- package/sui-plugin/skills/sui-component/references/autocomplete.md +51 -48
- package/sui-plugin/skills/sui-component/references/avatar-group.md +66 -0
- package/sui-plugin/skills/sui-component/references/avatar.md +76 -0
- package/sui-plugin/skills/sui-component/references/badge.md +4 -4
- package/sui-plugin/skills/sui-component/references/button.md +11 -11
- package/sui-plugin/skills/sui-component/references/calendar.md +1 -1
- package/sui-plugin/skills/sui-component/references/cards.md +9 -9
- package/sui-plugin/skills/sui-component/references/carousel.md +9 -9
- package/sui-plugin/skills/sui-component/references/chip.md +1 -1
- package/sui-plugin/skills/sui-component/references/date-picker.md +12 -12
- package/sui-plugin/skills/sui-component/references/dialog.md +8 -8
- package/sui-plugin/skills/sui-component/references/droppable.md +8 -8
- package/sui-plugin/skills/sui-component/references/empty-state.md +104 -0
- package/sui-plugin/skills/sui-component/references/file-input.md +106 -0
- package/sui-plugin/skills/sui-component/references/form.md +27 -25
- package/sui-plugin/skills/sui-component/references/image.md +8 -8
- package/sui-plugin/skills/sui-component/references/layout.md +47 -44
- package/sui-plugin/skills/sui-component/references/list.md +1 -1
- package/sui-plugin/skills/sui-component/references/menu.md +8 -8
- package/sui-plugin/skills/sui-component/references/number-input.md +102 -0
- package/sui-plugin/skills/sui-component/references/pagination.md +83 -0
- package/sui-plugin/skills/sui-component/references/progress.md +4 -4
- package/sui-plugin/skills/sui-component/references/sheet.md +8 -8
- package/sui-plugin/skills/sui-component/references/skeleton-loader.md +75 -0
- package/sui-plugin/skills/sui-component/references/slide-group.md +1 -1
- package/sui-plugin/skills/sui-component/references/snackbar.md +3 -3
- package/sui-plugin/skills/sui-component/references/split-view.md +2 -2
- package/sui-plugin/skills/sui-component/references/table.md +2 -1
- package/sui-plugin/skills/sui-component/references/tabs.md +18 -15
- package/sui-plugin/skills/sui-component/references/toggle-button-group.md +5 -4
- package/sui-plugin/skills/sui-component/references/toolbar.md +5 -5
- package/sui-plugin/skills/sui-component/references/tooltip.md +9 -9
- package/sui-plugin/skills/sui-component/references/window.md +1 -1
- package/sui-plugin/skills/sui-form/SKILL.md +6 -3
|
@@ -17,9 +17,9 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsSplitView.d.ts`
|
|
|
17
17
|
|
|
18
18
|
| Prop | Type | Default | Required | Values |
|
|
19
19
|
| --- | --- | --- | --- | --- |
|
|
20
|
-
| `height` | `
|
|
20
|
+
| `height` | `number \| string` | `"100%"` | no | — |
|
|
21
21
|
| `vertical` | `boolean` | — | no | — |
|
|
22
|
-
| `width` | `
|
|
22
|
+
| `width` | `number \| string` | `"100%"` | no | — |
|
|
23
23
|
|
|
24
24
|
**SSplitView slots**
|
|
25
25
|
|
|
@@ -124,7 +124,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsTable.d.ts`. The
|
|
|
124
124
|
- `group` (slot): Group row content (default: the group name)
|
|
125
125
|
- `itemHeader` / `itemFooter` (slot): Full-width rows from `itemHeader`/`itemFooter`
|
|
126
126
|
- `expanded` (slot): Content of an expanded row
|
|
127
|
-
- `noData` (slot): Empty state
|
|
127
|
+
- `noData` (slot): Empty state — put an `SEmptyState` here for an icon, title or action: `<template #noData><SEmptyState size="small" icon="mdi-cart-outline" title="No orders yet" /></template>`
|
|
128
128
|
- `loadingData` (slot): Loading row, shown while `loading` is set and `items` is empty
|
|
129
129
|
- `itemsPerPageLabel` (slot): Pager label
|
|
130
130
|
|
|
@@ -207,6 +207,7 @@ const perPage = ref(10)
|
|
|
207
207
|
|
|
208
208
|
| ❌ | ✅ |
|
|
209
209
|
|----|----|
|
|
210
|
+
| A hand-made `<div><SIcon …/><p>No data</p></div>` in `#noData` | `<SEmptyState size="small" icon="…" title="…" />` in `#noData` |
|
|
210
211
|
| `{ key: 'name', title: 'Name' }` | `{ text: 'Name', value: 'name' }`. Using `key` throws a `TypeError` (`value` is undefined) |
|
|
211
212
|
| `#item.name` slot with a header whose `value` is not `'name'` | The slot suffix is the header's `value` |
|
|
212
213
|
| Expecting a built-in checkbox column with `v-model:selected` | No select column exists. Render one with `select` / `isSelected` from the slot scope |
|
|
@@ -6,7 +6,7 @@ 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.)
|
|
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. An end that hides tabs fades out, so on a phone the row visibly scrolls (swipe it) instead of looking clipped; when every tab fits there is no fade. `show-arrows` adds a scroll arrow at each end that hides tabs (pointer only); `wrap` lays the tabs out on several rows instead. 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 always wrapped the tabs onto several rows on phones; `wrap` keeps that layout.)
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -17,16 +17,18 @@ The tabs stay on **one row**. Each tab keeps the width of its label (tabs stretc
|
|
|
17
17
|
|
|
18
18
|
**STabs props**
|
|
19
19
|
|
|
20
|
-
| Prop | Type | Default | Required | Values |
|
|
21
|
-
| --- | --- | --- | --- | --- |
|
|
22
|
-
| `borderRadius` | `` number \| "
|
|
23
|
-
| `bordered` | `boolean` | — | no | — |
|
|
24
|
-
| `dense` | `boolean` | — | no | — |
|
|
25
|
-
| `modelValue` | `
|
|
26
|
-
| `outlined` | `boolean \| null` | — | no | — |
|
|
27
|
-
| `selectedTabColor` | `string` | `"primary"` | no | — |
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
20
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
21
|
+
| --- | --- | --- | --- | --- | --- |
|
|
22
|
+
| `borderRadius` | `` number \| "rounded" \| "tile" \| `${number}%` \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — | — |
|
|
23
|
+
| `bordered` | `boolean` | — | no | — | — |
|
|
24
|
+
| `dense` | `boolean` | — | no | — | — |
|
|
25
|
+
| `modelValue` | `number \| string` | — | yes | — | — |
|
|
26
|
+
| `outlined` | `boolean \| null` | — | no | — | — |
|
|
27
|
+
| `selectedTabColor` | `string` | `"primary"` | no | — | — |
|
|
28
|
+
| `showArrows` | `boolean` | — | no | — | Show a scroll arrow at each end of the row that hides tabs (pointer only; the row still swipes). Ignored with `wrap`. |
|
|
29
|
+
| `shrink` | `boolean` | — | no | — | — |
|
|
30
|
+
| `underlined` | `boolean \| null` | — | no | — | — |
|
|
31
|
+
| `wrap` | `boolean` | — | no | — | Lay the tabs out on several rows when they do not fit, instead of one row that scrolls sideways. |
|
|
30
32
|
|
|
31
33
|
**STabs slots**
|
|
32
34
|
|
|
@@ -68,16 +70,16 @@ Always exactly one tab active (mandatory, single-select).
|
|
|
68
70
|
|
|
69
71
|
| Prop | Type | Default | Required | Values |
|
|
70
72
|
| --- | --- | --- | --- | --- |
|
|
71
|
-
| `alignSelf` | `"
|
|
73
|
+
| `alignSelf` | `"auto" \| "baseline" \| "center" \| "end" \| "first baseline" \| "flex-end" \| "flex-start" \| "inherit" \| "initial" \| "last baseline" \| "normal" \| "safe center" \| "self-end" \| "self-start" \| "start" \| "stretch" \| "unsafe center" \| null` | — | no | `auto`, `baseline`, `center`, `end`, `first baseline`, `flex-end`, `flex-start`, `inherit`, `initial`, `last baseline`, `normal`, `safe center`, `self-end`, `self-start`, `start`, `stretch`, `unsafe center` |
|
|
72
74
|
| `cols` | `"1" \| "2" \| "3" \| "4" \| "5" \| "6" \| "7" \| "8" \| "9" \| "10" \| "11" \| "12" \| ColumnNumber \| null` | — | no | — |
|
|
73
|
-
| `contentClass` | `string \|
|
|
75
|
+
| `contentClass` | `string \| Record<string, boolean> \| string[]` | — | no | — |
|
|
74
76
|
| `contentStyle` | `StyleValue` | — | no | — |
|
|
75
77
|
| `disabled` | `boolean` | — | no | — |
|
|
76
78
|
| `lg` | `"1" \| "2" \| "3" \| "4" \| "5" \| "6" \| "7" \| "8" \| "9" \| "10" \| "11" \| "12" \| ColumnNumber \| null` | — | no | — |
|
|
77
79
|
| `md` | `"1" \| "2" \| "3" \| "4" \| "5" \| "6" \| "7" \| "8" \| "9" \| "10" \| "11" \| "12" \| ColumnNumber \| null` | — | no | — |
|
|
78
80
|
| `order` | `number \| null` | — | no | — |
|
|
79
81
|
| `sm` | `"1" \| "2" \| "3" \| "4" \| "5" \| "6" \| "7" \| "8" \| "9" \| "10" \| "11" \| "12" \| ColumnNumber \| null` | — | no | — |
|
|
80
|
-
| `tab` | `
|
|
82
|
+
| `tab` | `number \| string` | — | yes | — |
|
|
81
83
|
|
|
82
84
|
**STab slots**
|
|
83
85
|
|
|
@@ -132,5 +134,6 @@ const active = ref<'overview' | 'api'>('overview')
|
|
|
132
134
|
| `<STab value="a">` / `<STab :index="0">` | `<STab tab="a">`. The identifier prop is `tab` |
|
|
133
135
|
| `<STabs>` without `v-model` | `modelValue` is required |
|
|
134
136
|
| 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 |
|
|
137
|
+
| Many tabs on a phone wrapping onto several rows | By default the row scrolls sideways (swipe); set `wrap` to keep the several-row layout. Keep labels short either way |
|
|
138
|
+
| `shrink`, `cols`, a wrapper or CSS truncation to fit tabs on a 375px phone | The plain `<STabs v-model><STab v-for … :tab>` setup: tabs that do not fit scroll sideways with an edge fade (or set `wrap` for several rows). See the `tabbed-sections` recipe |
|
|
136
139
|
| `underlined` to get an active underline | It styles the strip's border. Use `selectedTabColor` for the active state |
|
|
@@ -17,7 +17,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsToggleButtonGroup
|
|
|
17
17
|
|
|
18
18
|
| Prop | Type | Default | Required | Values |
|
|
19
19
|
| --- | --- | --- | --- | --- |
|
|
20
|
-
| `borderRadius` | `` number \| "
|
|
20
|
+
| `borderRadius` | `` number \| "rounded" \| "tile" \| `${number}%` \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — |
|
|
21
21
|
| `bordered` | `boolean` | — | no | — |
|
|
22
22
|
| `dense` | `boolean` | — | no | — |
|
|
23
23
|
| `mandatory` | `boolean` | — | no | — |
|
|
@@ -28,13 +28,14 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsToggleButtonGroup
|
|
|
28
28
|
| `selectedColor` | `string` | `"primary"` | no | — |
|
|
29
29
|
| `shrink` | `boolean` | — | no | — |
|
|
30
30
|
| `underlined` | `boolean \| null` | — | no | — |
|
|
31
|
-
| `variant` | `"
|
|
31
|
+
| `variant` | `"inset" \| "underlined" \| null` | — | no | `inset`, `underlined` |
|
|
32
32
|
|
|
33
33
|
**SToggleButtonGroup slots**
|
|
34
34
|
|
|
35
35
|
| Slot | Slot props |
|
|
36
36
|
| --- | --- |
|
|
37
37
|
| `default` | `{}` |
|
|
38
|
+
| `overlay` | `{}` |
|
|
38
39
|
|
|
39
40
|
**SToggleButtonGroup events**
|
|
40
41
|
|
|
@@ -76,9 +77,9 @@ Must be inside `SToggleButtonGroup` (throws otherwise).
|
|
|
76
77
|
| Prop | Type | Default | Required | Values |
|
|
77
78
|
| --- | --- | --- | --- | --- |
|
|
78
79
|
| `activeClass` | `string \| null` | — | no | — |
|
|
79
|
-
| `alignSelf` | `"
|
|
80
|
+
| `alignSelf` | `"auto" \| "baseline" \| "center" \| "end" \| "first baseline" \| "flex-end" \| "flex-start" \| "inherit" \| "initial" \| "last baseline" \| "normal" \| "safe center" \| "self-end" \| "self-start" \| "start" \| "stretch" \| "unsafe center" \| null` | — | no | `auto`, `baseline`, `center`, `end`, `first baseline`, `flex-end`, `flex-start`, `inherit`, `initial`, `last baseline`, `normal`, `safe center`, `self-end`, `self-start`, `start`, `stretch`, `unsafe center` |
|
|
80
81
|
| `cols` | `"1" \| "2" \| "3" \| "4" \| "5" \| "6" \| "7" \| "8" \| "9" \| "10" \| "11" \| "12" \| ColumnNumber \| null` | — | no | — |
|
|
81
|
-
| `contentClass` | `string \|
|
|
82
|
+
| `contentClass` | `string \| Record<string, boolean> \| string[]` | — | no | — |
|
|
82
83
|
| `contentStyle` | `StyleValue` | — | no | — |
|
|
83
84
|
| `disabled` | `boolean` | — | no | — |
|
|
84
85
|
| `index` | `GroupItemValue \| null` | — | no | — |
|
|
@@ -17,18 +17,18 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsToolbar.d.ts`, `p
|
|
|
17
17
|
|
|
18
18
|
| Prop | Type | Default | Required | Values |
|
|
19
19
|
| --- | --- | --- | --- | --- |
|
|
20
|
-
| `borderRadius` | `` number \| "
|
|
20
|
+
| `borderRadius` | `` number \| "rounded" \| "tile" \| `${number}%` \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — |
|
|
21
21
|
| `color` | `string` | — | no | — |
|
|
22
22
|
| `colorThreshold` | `number` | — | no | — |
|
|
23
|
-
| `contentClass` | `string \|
|
|
23
|
+
| `contentClass` | `string \| Record<string, boolean> \| string[]` | — | no | — |
|
|
24
24
|
| `contentStyle` | `StyleValue` | — | no | — |
|
|
25
25
|
| `density` | `ToolbarDensityType \| null` | — | no | `comfortable`, `compact`, `default` |
|
|
26
|
-
| `elevation` | `"" \|
|
|
26
|
+
| `elevation` | `"" \| "1" \| "2" \| "3" \| "4" \| "5" \| "6" \| "7" \| "8" \| "9" \| "10" \| "11" \| "12" \| "13" \| "14" \| "15" \| "16" \| "17" \| "18" \| "19" \| "20" \| "21" \| "22" \| "23" \| "24" \| 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13 \| 14 \| 15 \| 16 \| 17 \| 18 \| 19 \| 20 \| 21 \| 22 \| 23 \| 24 \| null` | — | no | — |
|
|
27
27
|
| `extended` | `boolean \| null` | — | no | — |
|
|
28
28
|
| `extensionClass` | `string \| Record<string, boolean \| undefined>` | — | no | — |
|
|
29
|
-
| `extensionHeight` | `
|
|
29
|
+
| `extensionHeight` | `number \| string` | `defaultToolbarExtensionHeight` | no | — |
|
|
30
30
|
| `extensionStyle` | `Record<string, string>` | — | no | — |
|
|
31
|
-
| `height` | `
|
|
31
|
+
| `height` | `number \| string \| null` | `defaultToolbarContentHeight` | no | — |
|
|
32
32
|
| `outlined` | `boolean \| null` | — | no | — |
|
|
33
33
|
| `position` | `Position` | — | no | `absolute`, `fixed`, `relative`, `static`, `sticky` |
|
|
34
34
|
| `tag` | `HtmlTagName \| null` | — | no | `a`, `abbr`, `acronym`, `address`, `applet`, `area`, `article`, `aside`, `audio`, `b`, `base`, `basefont`, `bdi`, `bdo`, `big`, `blockquote`, `body`, `br`, `button`, `canvas`, `caption`, `center`, `cite`, `code`, `col`, `colgroup`, `data`, `datalist`, `dd`, `del`, `details`, `dfn`, `dialog`, `dir`, `div`, `dl`, `dt`, `em`, `embed`, `fieldset`, `figcaption`, `figure`, `font`, `footer`, `form`, `frame`, `frameset`, `h1`, `h1> to <h6`, `h2`, `h3`, `h4`, `h5`, `h6`, `head`, `header`, `hr`, `html`, `i`, `iframe`, `img`, `input`, `ins`, `kbd`, `label`, `legend`, `li`, `link`, `main`, `map`, `mark`, `meta`, `meter`, `nav`, `noframes`, `noscript`, `object`, `ol`, `optgroup`, `option`, `output`, `p`, `param`, `picture`, `pre`, `progress`, `q`, `rp`, `rt`, `ruby`, `s`, `samp`, `script`, `section`, `select`, `small`, `source`, `span`, `strike`, `strong`, `style`, `sub`, `summary`, `sup`, `svg`, `table`, `tbody`, `td`, `template`, `textarea`, `tfoot`, `th`, `thead`, `time`, `title`, `tr`, `track`, `tt`, `u`, `ul`, `var`, `video`, `wbr` |
|
|
@@ -13,31 +13,31 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsTooltip.d.ts`
|
|
|
13
13
|
|
|
14
14
|
| Prop | Type | Default | Required | Values |
|
|
15
15
|
| --- | --- | --- | --- | --- |
|
|
16
|
-
| `activator` | `string \|
|
|
16
|
+
| `activator` | `string \| ComponentPublicInstance \| HTMLElement \| null` | — | no | — |
|
|
17
17
|
| `closeOnClick` | `boolean` | — | no | — |
|
|
18
18
|
| `closeOnContentClick` | `boolean` | — | no | — |
|
|
19
19
|
| `closeOnScroll` | `boolean` | — | no | — |
|
|
20
20
|
| `color` | `string` | — | no | — |
|
|
21
21
|
| `colorThreshold` | `number` | — | no | — |
|
|
22
|
-
| `contentClass` | `string \|
|
|
22
|
+
| `contentClass` | `string \| Record<string, boolean> \| string[]` | — | no | — |
|
|
23
23
|
| `contentStyle` | `StyleValue` | — | no | — |
|
|
24
24
|
| `disabled` | `boolean \| null` | — | no | — |
|
|
25
|
-
| `height` | `
|
|
25
|
+
| `height` | `number \| string \| null` | — | no | — |
|
|
26
26
|
| `location` | `LocationRaw` | — | no | — |
|
|
27
|
-
| `maxHeight` | `
|
|
28
|
-
| `maxWidth` | `
|
|
29
|
-
| `minHeight` | `
|
|
30
|
-
| `minWidth` | `
|
|
27
|
+
| `maxHeight` | `number \| string \| null` | — | no | — |
|
|
28
|
+
| `maxWidth` | `number \| string \| null` | — | no | — |
|
|
29
|
+
| `minHeight` | `number \| string \| null` | — | no | — |
|
|
30
|
+
| `minWidth` | `number \| string \| null` | — | no | — |
|
|
31
31
|
| `modelValue` | `boolean` | — | no | — |
|
|
32
32
|
| `offsetX` | `number \| null` | — | no | — |
|
|
33
33
|
| `offsetY` | `number \| null` | — | no | — |
|
|
34
|
-
| `opacity` | `
|
|
34
|
+
| `opacity` | `number \| string` | — | no | — |
|
|
35
35
|
| `position` | `Position` | — | no | `absolute`, `fixed`, `relative`, `static`, `sticky` |
|
|
36
36
|
| `preventCloseOnClick` | `boolean` | — | no | — |
|
|
37
37
|
| `readonly` | `boolean \| null` | — | no | — |
|
|
38
38
|
| `screenPadding` | `number \| null` | — | no | — |
|
|
39
39
|
| `theme` | `AppThemeType` | — | no | `dark`, `light` |
|
|
40
|
-
| `width` | `
|
|
40
|
+
| `width` | `number \| string \| null` | — | no | — |
|
|
41
41
|
|
|
42
42
|
**STooltip slots**
|
|
43
43
|
|
|
@@ -69,7 +69,7 @@ Shows one panel at a time with a slide transition, arrows and swipe. Use it for
|
|
|
69
69
|
| --- | --- | --- | --- | --- |
|
|
70
70
|
| `activeClass` | `string \| null` | — | no | — |
|
|
71
71
|
| `selected` | `boolean` | — | no | — |
|
|
72
|
-
| `value` | `
|
|
72
|
+
| `value` | `boolean \| number \| string` | — | no | — |
|
|
73
73
|
|
|
74
74
|
**SWindowItem slots**
|
|
75
75
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sui-form
|
|
3
|
-
description: Build validated forms in a Vue or Nuxt app with @khsura/sui — SForm, SInput, STextarea, SSelect, SAutocomplete, SCheckbox, SRadioGroup/SRadio, SSwitch, SDatePickerInput. Use when creating a form, login/registration/settings/data-entry UI, adding validation rules (inline or the i18n-backed getFormInputModelValueRules), handling submit with SForm.validate(), async/searchable selects, or fixing a SUI form whose validation, error display or v-model doesn't behave.
|
|
3
|
+
description: Build validated forms in a Vue or Nuxt app with @khsura/sui — SForm, SInput, SNumberInput, STextarea, SSelect, SAutocomplete, SCheckbox, SRadioGroup/SRadio, SSwitch, SDatePickerInput. Use when creating a form, login/registration/settings/data-entry UI, adding validation rules (inline or the i18n-backed getFormInputModelValueRules), handling submit with SForm.validate(), async/searchable selects, or fixing a SUI form whose validation, error display or v-model doesn't behave.
|
|
4
4
|
argument-hint: [describe the form fields and purpose]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -76,7 +76,7 @@ Use `v-model:error` to disable the submit button **only after a failed submit**:
|
|
|
76
76
|
|
|
77
77
|
- Use **`hideError`** when you only want to drop the message line (dense tables, inline filters) but keep the label.
|
|
78
78
|
- Use **`hideDetails`** only when the field should have no label either — it is not a "compact" switch. On `SCheckbox` the label is the only text, so `hideDetails` leaves a bare box ("Remember me" disappears); use `hideError` there.
|
|
79
|
-
- With `hideDetails` the hidden label still names the field (it becomes the control's `aria-label`). A field with no `label` at all needs `aria-label` (`ariaLabel` on SInput, STextarea, SSelect, SAutocomplete; on each SRadio without a `label`).
|
|
79
|
+
- With `hideDetails` the hidden label still names the field (it becomes the control's `aria-label`). On screen only the placeholder (or slot content) is left, so make the placeholder say what the field is for (`label="Search" placeholder="Search by name"`, not `placeholder="e.g. Anna"`); `validate_sui_template` warns otherwise (`hidden-label-no-visible-name`). A field with no `label` at all needs `aria-label` (`ariaLabel` on SInput, STextarea, SSelect, SAutocomplete; on each SRadio without a `label`).
|
|
80
80
|
- Labels, ids and errors are wired for you: an `id` is generated when you don't pass one, and an invalid field gets `aria-invalid` and `aria-describedby` pointing at its error message. Don't add your own `<label for>` or `aria-describedby`.
|
|
81
81
|
- The field frame turns red on error even with either flag set (`SInput`, `STextarea`, `SSelect`, `SCheckbox`, `SRadioGroup`, `SDatePickerInput`), so users can still see which field is invalid. Don't add your own `:deep()` error border.
|
|
82
82
|
|
|
@@ -143,11 +143,12 @@ const numeric = (v: string) => /^\d+$/.test(v) || 'Must be a number'
|
|
|
143
143
|
|
|
144
144
|
Use this to choose the right component and props for each field.
|
|
145
145
|
|
|
146
|
-
**Common to the validated inputs** (`SInput`, `STextarea`, `SSelect`, `SCheckbox`, `SRadioGroup`, `SDatePickerInput`): `label`, `rules`, `disabled`, `hideDetails`, `hideError`, `error`, `dirty`, `id`. `SAutocomplete` and `SSwitch` don't run rules.
|
|
146
|
+
**Common to the validated inputs** (`SInput`, `SNumberInput`, `STextarea`, `SSelect`, `SCheckbox`, `SRadioGroup`, `SDatePickerInput`): `label`, `rules`, `disabled`, `hideDetails`, `hideError`, `error`, `dirty`, `id`. `SAutocomplete` and `SSwitch` don't run rules.
|
|
147
147
|
|
|
148
148
|
| Component | v-model | Key props | When to use |
|
|
149
149
|
| ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
|
|
150
150
|
| **SInput** | `string \| number` | `label`, `type` (`text` \| `email` \| `password` \| `number` \| `tel` \| `url` \| `search`), `placeholder`, `suffix`, `dense`, `readonly`, `max`/`min`, `maxlength`/`minlength`, `inputmode` (`numeric` \| `decimal` \| `email` \| `tel`), `positive` / `allowDecimal` (numbers), `size` | Single-line text, email, password, number |
|
|
151
|
+
| **SNumberInput** | `number \| null` | `label`, `min`/`max`, `step`, `precision` (decimals; default `0`, `2` for money, `null` for any), `controlVariant` (`stacked` \| `split`), `hideControls`, `prefix`/`suffix`, `textRight`, `placeholder`, `readonly`, `dense`, `tile`, `size` | Quantities, amounts, percentages: any number (since 1.21.0) |
|
|
151
152
|
| **STextarea** | `string` | `label`, `placeholder`, `rows`, `cols`, `autogrow`, `resize`, `counter`, `dense`, `tile`, `maxlength`/`minlength`, `readonly` | Multi-line text |
|
|
152
153
|
| **SSelect** | `string \| number` | `items`: `SelectItem[]` or `string[]` (type from `@khsura/sui`: `text`, `value`, optional `disabled`). Also `label`, `placeholder`, `dense`, `grow`, `text`, `divided`, `color`, `outlined` (default `true`)/`underlined`/`borderRadius`. **No** `multiple`/`chips`/`clearable` | Single-value dropdown |
|
|
153
154
|
| **SAutocomplete** | `any` or `any[]` | Same `items` as SSelect; + `multiple`, `chips`, `closableChips`, `clearable`, `placeholder`, `filter`, `filterMode`, `debounce`, `loading`, `allowUnlisted`, `delimiter`. `debounce` defaults to 500 ms. Events: **`@search-item`** (search text, for async options), **`@create-item`** (with `allowUnlisted`). No `rules`; `disabled` does not disable its text field | Searchable / multi / async select |
|
|
@@ -160,6 +161,8 @@ Use this to choose the right component and props for each field.
|
|
|
160
161
|
|
|
161
162
|
**SAutocomplete async search:** listen to `@search-item`, not `@update:search-input` (that name is accepted by the typings but never emitted).
|
|
162
163
|
|
|
164
|
+
**Numbers: prefer `SNumberInput`** (since `@khsura/sui` 1.21.0). It writes `number | null`, steps with +/- buttons and ArrowUp/ArrowDown, keeps `precision` decimals, clamps to `min`/`max` on blur and has spinbutton semantics. It renders `type="text"` with the right `inputmode`, so a browser validation bubble never covers the SUI error inside `SForm`. Older SUI versions don't have it — use SInput `type="number"` there.
|
|
165
|
+
|
|
163
166
|
**SInput `type="number"`:** bind a plain `v-model` — SInput already writes a `number | null` to the model, so `.number` is unnecessary. Use `min`/`max`/`positive` when the value should be clamped while typing; use a rule when the user should see a message instead. Number inputs are **integer-only by default** — `.` is blocked and pasted decimals are rounded; add `allowDecimal` (with `inputmode="decimal"`) to accept decimals, in which case `min`/`positive` are enforced on blur so values like `0.5` can be typed.
|
|
164
167
|
|
|
165
168
|
**Imports:** form components and `getFormInputModelValueRules` from `@khsura/sui`.
|