@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
|
@@ -14,13 +14,13 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDroppable.d.ts`
|
|
|
14
14
|
| Prop | Type | Default | Required | Values |
|
|
15
15
|
| --- | --- | --- | --- | --- |
|
|
16
16
|
| `disabled` | `boolean \| null` | — | no | — |
|
|
17
|
-
| `height` | `
|
|
18
|
-
| `maxHeight` | `
|
|
19
|
-
| `maxWidth` | `
|
|
20
|
-
| `minHeight` | `
|
|
21
|
-
| `minWidth` | `
|
|
17
|
+
| `height` | `number \| string \| null` | — | no | — |
|
|
18
|
+
| `maxHeight` | `number \| string \| null` | — | no | — |
|
|
19
|
+
| `maxWidth` | `number \| string \| null` | — | no | — |
|
|
20
|
+
| `minHeight` | `number \| string \| null` | — | no | — |
|
|
21
|
+
| `minWidth` | `number \| string \| null` | — | no | — |
|
|
22
22
|
| `readonly` | `boolean \| null` | — | no | — |
|
|
23
|
-
| `width` | `
|
|
23
|
+
| `width` | `number \| string \| null` | — | no | — |
|
|
24
24
|
|
|
25
25
|
**SDroppable slots**
|
|
26
26
|
|
|
@@ -84,5 +84,5 @@ const handleDrop = (event: DragEvent) => {
|
|
|
84
84
|
|
|
85
85
|
- The drop zone has no built-in look: draw the border/background yourself. While dragging over it, the root gets class `s_droppable--drag` (opacity 0.6).
|
|
86
86
|
- `drop` gives the raw `DragEvent`; read `event.dataTransfer?.files`. Default browser handling (opening the file) is already prevented.
|
|
87
|
-
-
|
|
88
|
-
-
|
|
87
|
+
- For **file uploads** use `<SFileInput variant="dropzone">` (see [file-input.md](file-input.md)): it adds click-to-browse, keyboard, `accept` filtering, a label, `rules` and the chosen file names. Use SDroppable for other dragged content.
|
|
88
|
+
- SDroppable itself has no click-to-upload and no `accept`/file-type filtering: validate files in your `drop` handler.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# SEmptyState
|
|
2
|
+
|
|
3
|
+
**Import:** `import { SEmptyState } from '@khsura/sui'`
|
|
4
|
+
|
|
5
|
+
The "nothing here yet" block: a decorative icon or illustration, a short title, a supporting sentence and an optional action button, centred in a column. It is a plain `<div class="s_emptyState">` (no role, no Tab stop of its own) that takes the full width of its parent and wraps instead of overflowing, also at 375 px. Use it on an empty page or card, and in the `#noData` slot of `STable`, `SSelect` and `SAutocomplete`.
|
|
6
|
+
|
|
7
|
+
Types: `node_modules/@khsura/sui/@types/definitions/props/propsEmptyState.d.ts`
|
|
8
|
+
|
|
9
|
+
Docs: https://sui.surakh.com/?path=/docs/ui-components-emptystate--docs
|
|
10
|
+
|
|
11
|
+
<!-- generated:api:start SEmptyState -->
|
|
12
|
+
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
13
|
+
|
|
14
|
+
**SEmptyState props**
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
17
|
+
| --- | --- | --- | --- | --- | --- |
|
|
18
|
+
| `actionText` | `string` | — | no | — | Label of the built-in action button. The button is shown only when this is set; clicking it emits `action`. |
|
|
19
|
+
| `color` | `string \| null` | — | no | — | Colour of the icon only (preset name or CSS colour), not a background: an empty state has no background of its own. |
|
|
20
|
+
| `icon` | `string` | — | no | — | Material Design icon shown above the title, such as `mdi-inbox-outline`. Ignored when `image` is set. Decorative: hidden from screen readers. |
|
|
21
|
+
| `image` | `string` | — | no | — | Illustration URL shown above the title. Wins over `icon`. Decorative (`alt=""`): put the meaning in `title` and `text`. |
|
|
22
|
+
| `size` | `SizePropertyType` | — | no | `default`, `extra`, `large`, `mini`, `small` | — |
|
|
23
|
+
| `text` | `string` | — | no | — | Supporting sentence under the title that says why it is empty or what to do next. |
|
|
24
|
+
| `theme` | `AppThemeType` | — | no | `dark`, `light` | — |
|
|
25
|
+
| `title` | `string` | — | no | — | Short headline, such as `No orders yet`. Rendered as text, not as a heading element. |
|
|
26
|
+
|
|
27
|
+
**SEmptyState slots**
|
|
28
|
+
|
|
29
|
+
| Slot | Slot props | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `actions` | `any` | Replaces the built-in action button, such as two SButtons or a link. |
|
|
32
|
+
| `default` | `any` | Extra content between the text and the actions. |
|
|
33
|
+
| `media` | `any` | Replaces the icon or image, such as an illustration component. Keep it decorative. |
|
|
34
|
+
| `text` | `any` | Replaces the `text` sentence. |
|
|
35
|
+
| `title` | `any` | Replaces the `title` text. |
|
|
36
|
+
|
|
37
|
+
**SEmptyState events**
|
|
38
|
+
|
|
39
|
+
| Event | Payload |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `action` | `[event: Event]` |
|
|
42
|
+
|
|
43
|
+
<!-- generated:api:end SEmptyState -->
|
|
44
|
+
|
|
45
|
+
**SEmptyState notes**
|
|
46
|
+
|
|
47
|
+
- Each part renders only when its prop or slot is set; `actionText` alone adds a primary `SButton` that emits `action`.
|
|
48
|
+
- `image` wins over `icon`. Both are decorative (`aria-hidden` / `alt=""`): the meaning goes in `title` and `text`.
|
|
49
|
+
- `color` colours the **icon only**; there is no background colour.
|
|
50
|
+
- `size` scales padding, icon, image, title, text and the action button. Use `size="small"` in a table cell and `size="mini"` in a select or autocomplete menu.
|
|
51
|
+
- The title is plain text, not a heading. For a page-level heading use `<template #title><h2>…</h2></template>`.
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<SEmptyState
|
|
57
|
+
icon="mdi-inbox-outline"
|
|
58
|
+
title="No orders yet"
|
|
59
|
+
text="Orders you create appear here."
|
|
60
|
+
action-text="Create order"
|
|
61
|
+
@action="openNewOrder"
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<!-- Several actions or a link: the actions slot -->
|
|
65
|
+
<SEmptyState icon="mdi-account-multiple-outline" title="No members">
|
|
66
|
+
<template #actions>
|
|
67
|
+
<SButton color="primary" @click="invite">Invite</SButton>
|
|
68
|
+
<SButton variant="text" to="/help/members">Learn more</SButton>
|
|
69
|
+
</template>
|
|
70
|
+
</SEmptyState>
|
|
71
|
+
|
|
72
|
+
<!-- STable: without the slot the row keeps its plain noDataText -->
|
|
73
|
+
<STable :headers="headers" :items="orders">
|
|
74
|
+
<template #noData>
|
|
75
|
+
<SEmptyState size="small" icon="mdi-cart-outline" title="No orders yet" />
|
|
76
|
+
</template>
|
|
77
|
+
</STable>
|
|
78
|
+
|
|
79
|
+
<!-- SSelect / SAutocomplete: opt-in, an empty menu stays blank without noDataText or the slot -->
|
|
80
|
+
<SSelect label="Warehouse" :items="warehouses">
|
|
81
|
+
<template #noData>
|
|
82
|
+
<SEmptyState size="mini" icon="mdi-warehouse" title="No warehouses" />
|
|
83
|
+
</template>
|
|
84
|
+
</SSelect>
|
|
85
|
+
<SAutocomplete :items="fruits">
|
|
86
|
+
<template #noData="{ query }">
|
|
87
|
+
<SEmptyState size="mini" icon="mdi-magnify" :title="`Nothing matches “${query}”`" />
|
|
88
|
+
</template>
|
|
89
|
+
</SAutocomplete>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Gotchas
|
|
93
|
+
|
|
94
|
+
| ❌ | ✅ |
|
|
95
|
+
|----|----|
|
|
96
|
+
| `<SEmptyState headline="…" />` (Vuetify) | `title="…"` (there is no `headline`) |
|
|
97
|
+
| `<SEmptyState bg-color="grey" />` or expecting `color` to fill a background | `color` colours the icon; put the background on the parent |
|
|
98
|
+
| `<SEmptyState action-text="Go" href="/new" />` / `:to` | `<template #actions><SButton to="/new">Go</SButton></template>` |
|
|
99
|
+
| `@click:action="…"` (Vuetify event name) | `@action="…"` |
|
|
100
|
+
| `action-text` without `@action` (a button that does nothing) | Add `@action`, or use the `actions` slot |
|
|
101
|
+
| `<img>` or `<SIcon>` in the default slot | `image="…"` / `icon="…"`, or the `media` slot |
|
|
102
|
+
| A hand-made `<div class="text-center"><SIcon …/><p>No data</p></div>` in `#noData` | `<SEmptyState size="small" icon="…" title="…" />` |
|
|
103
|
+
| `<SSelect :items="[]" no-data-text="…">` expected to show without opening | The message shows in the **open** menu only |
|
|
104
|
+
| An `SEmptyState` inside the default slot of `SSelect` / `SAutocomplete` | The `#noData` slot |
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# SFileInput
|
|
2
|
+
|
|
3
|
+
**Import:** `import { SFileInput, getFileInputRules } from '@khsura/sui'`
|
|
4
|
+
|
|
5
|
+
A file picker built like SInput (label, field box, error line, `rules`) over a real, invisible `<input type="file">`. Shows the chosen files as names, chips or a count. `variant="dropzone"` makes a large drop area that also takes dragged files.
|
|
6
|
+
|
|
7
|
+
Types: `node_modules/@khsura/sui/@types/definitions/props/propsFileInput.d.ts`
|
|
8
|
+
|
|
9
|
+
Docs: https://sui.surakh.com/?path=/docs/ui-components-fileinput--docs
|
|
10
|
+
|
|
11
|
+
<!-- generated:api:start SFileInput -->
|
|
12
|
+
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
13
|
+
|
|
14
|
+
**SFileInput props**
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
17
|
+
| --- | --- | --- | --- | --- | --- |
|
|
18
|
+
| `accept` | `string` | — | no | — | Allowed types in the native format: `.csv,.xlsx`, `image/*`, `application/pdf`. Dropped files that do not match are rejected (the `reject` event). |
|
|
19
|
+
| `ariaLabel` | `string` | — | no | — | Accessible name when there is no visible `label`; wins over `label`. |
|
|
20
|
+
| `ariaLabelledby` | `string` | — | no | — | Id of the element that names the file input. |
|
|
21
|
+
| `clearAriaLabel` | `string` | `"Clear"` | no | — | Accessible name of the clear button. |
|
|
22
|
+
| `clearable` | `boolean` | — | no | — | Show a button that clears the chosen files. |
|
|
23
|
+
| `countText` | `string` | `"{count} files"` | no | — | The `count` display text for several files; `{count}` is replaced by the number. |
|
|
24
|
+
| `dense` | `boolean` | — | no | — | Smaller paddings, as SInput's `dense`. |
|
|
25
|
+
| `dirty` | `boolean` | — | no | — | — |
|
|
26
|
+
| `disabled` | `boolean \| null` | — | no | — | — |
|
|
27
|
+
| `display` | `"chips" \| "count" \| "names"` | `"names"` | no | `chips`, `count`, `names` | How the chosen files are shown: their names, one chip each, or a count such as `3 files`. |
|
|
28
|
+
| `dropText` | `string` | `"Drop files here or click to browse"` | no | — | The `dropzone` variant's call to action. |
|
|
29
|
+
| `error` | `boolean` | — | no | — | — |
|
|
30
|
+
| `hideDetails` | `boolean` | — | no | — | — |
|
|
31
|
+
| `hideError` | `boolean` | — | no | — | — |
|
|
32
|
+
| `icon` | `string` | — | no | — | Material Design icon before the selection (`input`) or above the text (`dropzone`); `''` hides it. |
|
|
33
|
+
| `id` | `string` | — | no | — | — |
|
|
34
|
+
| `label` | `string` | — | no | — | Visible label above the field, tied to the file input. With `hideDetails` it is hidden and becomes the `aria-label`, as in SInput. |
|
|
35
|
+
| `loading` | `boolean` | — | no | — | Show a spinner and block picking, e.g. while the chosen file uploads or is parsed. |
|
|
36
|
+
| `loadingAriaLabel` | `string` | `"Loading"` | no | — | Accessible name of the loading spinner. |
|
|
37
|
+
| `modelValue` | `File[] \| null` | — | no | — | — |
|
|
38
|
+
| `multiple` | `boolean` | — | no | — | Allow several files. The model is always a `File[]` (or `null` when empty), even for one file. |
|
|
39
|
+
| `name` | `string` | — | no | — | The native input's `name`, so a plain `<form>` submit sends the files. |
|
|
40
|
+
| `placeholder` | `string` | — | no | — | Text shown in the field while no file is chosen. |
|
|
41
|
+
| `readonly` | `boolean \| null` | — | no | — | — |
|
|
42
|
+
| `rules` | `FormInputModelValueRule[]` | — | no | — | — |
|
|
43
|
+
| `showSize` | `boolean` | — | no | — | Show each file's size next to its name. |
|
|
44
|
+
| `size` | `SizePropertyType` | — | no | `default`, `extra`, `large`, `mini`, `small` | — |
|
|
45
|
+
| `variant` | `"dropzone" \| "input"` | `"input"` | no | `dropzone`, `input` | `input`: a text-field box. `dropzone`: a large area that also takes dragged files. |
|
|
46
|
+
|
|
47
|
+
**SFileInput slots**
|
|
48
|
+
|
|
49
|
+
None.
|
|
50
|
+
|
|
51
|
+
**SFileInput events**
|
|
52
|
+
|
|
53
|
+
| Event | Payload |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `change` | `[File[] \| null]` |
|
|
56
|
+
| `clear` | `[]` |
|
|
57
|
+
| `reject` | `[File[]]` |
|
|
58
|
+
| `update:dirty` | `[boolean]` |
|
|
59
|
+
| `update:error` | `[boolean]` |
|
|
60
|
+
| `update:errors` | `[string[]]` |
|
|
61
|
+
| `update:modelValue` | `[value: File[] \| null \| undefined]` |
|
|
62
|
+
|
|
63
|
+
<!-- generated:api:end SFileInput -->
|
|
64
|
+
|
|
65
|
+
**SFileInput notes**
|
|
66
|
+
|
|
67
|
+
- `v-model`: always `File[] | null` — an array even without `multiple`, `null` after clearing. Read `files?.[0]` for one file.
|
|
68
|
+
- `change` (event): passes the files (`File[] | null`), not a DOM event.
|
|
69
|
+
- `reject` (event): dropped files that do not match `accept`, or the extra files without `multiple`.
|
|
70
|
+
- `rules`: build them with `getFileInputRules({ required, maxSize, accept, maxFiles, messages })`; `maxSize` is in bytes.
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { ref } from 'vue'
|
|
77
|
+
import { SFileInput, getFileInputRules } from '@khsura/sui'
|
|
78
|
+
|
|
79
|
+
const accept = '.csv,.xlsx'
|
|
80
|
+
const workbook = ref<File[] | null>(null)
|
|
81
|
+
const rules = getFileInputRules({ required: true, accept, maxSize: 5 * 1024 * 1024 })
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<SFileInput v-model="workbook" label="Employee workbook" :accept="accept" :rules="rules" show-size clearable />
|
|
86
|
+
|
|
87
|
+
<SFileInput v-model="workbook" variant="dropzone" label="Employee workbook" :accept="accept" :rules="rules" />
|
|
88
|
+
|
|
89
|
+
<!-- act right after picking -->
|
|
90
|
+
<SFileInput label="Attendance sheet" :accept="accept" :loading="previewing" @change="(files) => preview(files?.[0])" />
|
|
91
|
+
</template>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Gotchas
|
|
95
|
+
|
|
96
|
+
| ❌ | ✅ |
|
|
97
|
+
|----|----|
|
|
98
|
+
| `<input ref="file" type="file" class="hidden">` + `<SButton @click="file?.click()">` | `<SFileInput v-model="files" label="…" accept="…" />` — labelled, keyboard-reachable, runs `rules`, shows the file name |
|
|
99
|
+
| `<SInput type="file">` | `<SFileInput>` |
|
|
100
|
+
| `<SDroppable>` + your own hidden input for an upload area | `<SFileInput variant="dropzone">` |
|
|
101
|
+
| `@change="upload($event.target.files[0])"` | `@change="(files) => upload(files?.[0])"` or `v-model="files"` |
|
|
102
|
+
| `const file = ref<File \| null>(null)` + `v-model="file"` | `const files = ref<File[] \| null>(null)`, then `files.value?.[0]` |
|
|
103
|
+
| Vuetify `chips` / `counter` / `prepend-icon` / `show-size` | `display="chips"` / `display="count"` / `icon` / `show-size` |
|
|
104
|
+
| `:rules="[(f) => f.size < max]"` (the value is an array) | `getFileInputRules({ maxSize: max })` |
|
|
105
|
+
| Relying on `accept` to block other types | `accept` filters the picker and drops; still add `getFileInputRules({ accept })` and check on the server |
|
|
106
|
+
| A preview image inside the field | Keep the preview outside (`SAvatar` / `SImage` with `URL.createObjectURL(files[0])`) |
|
|
@@ -81,7 +81,7 @@ Exposed: `validate(): boolean` — **returns `true` when there ARE errors**; `re
|
|
|
81
81
|
|
|
82
82
|
## SFormRow
|
|
83
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`.
|
|
84
|
+
*Since 1.20.0.* A wrapping row of text fields (`SInput`, `SNumberInput` since 1.21.0, `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
85
|
|
|
86
86
|
<!-- generated:api:start SFormRow -->
|
|
87
87
|
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
@@ -128,7 +128,7 @@ None.
|
|
|
128
128
|
| `appendOuter` | `string \| null` | — | no | — |
|
|
129
129
|
| `ariaLabel` | `string` | — | no | — |
|
|
130
130
|
| `ariaLabelledby` | `string` | — | no | — |
|
|
131
|
-
| `autocapitalize` | `"
|
|
131
|
+
| `autocapitalize` | `"off" \| "on" \| null` | — | no | `off`, `on` |
|
|
132
132
|
| `autocomplete` | `string \| null` | — | no | — |
|
|
133
133
|
| `autofocus` | `boolean \| null` | — | no | — |
|
|
134
134
|
| `dense` | `boolean` | — | no | — |
|
|
@@ -142,10 +142,10 @@ None.
|
|
|
142
142
|
| `inputmode` | `InputModeTypeText \| null` | — | no | `decimal`, `email`, `none`, `numeric`, `search`, `tel`, `text`, `url` |
|
|
143
143
|
| `isPasteDisabled` | `boolean` | — | no | — |
|
|
144
144
|
| `label` | `string \| null` | — | no | — |
|
|
145
|
-
| `max` | `
|
|
146
|
-
| `maxlength` | `
|
|
147
|
-
| `min` | `
|
|
148
|
-
| `minlength` | `
|
|
145
|
+
| `max` | `number \| string \| null` | — | no | — |
|
|
146
|
+
| `maxlength` | `number \| string \| null` | — | no | — |
|
|
147
|
+
| `min` | `number \| string \| null` | — | no | — |
|
|
148
|
+
| `minlength` | `number \| string \| null` | — | no | — |
|
|
149
149
|
| `modelValue` | `T \| null` | — | no | — |
|
|
150
150
|
| `name` | `string` | — | no | — |
|
|
151
151
|
| `pattern` | `string \| null` | — | no | — |
|
|
@@ -221,7 +221,7 @@ Props: `label`, `placeholder`, `rows` (default `2`), `cols` (default `20`), **`a
|
|
|
221
221
|
| --- | --- | --- | --- | --- | --- |
|
|
222
222
|
| `ariaLabel` | `string` | — | no | — | — |
|
|
223
223
|
| `ariaLabelledby` | `string` | — | no | — | — |
|
|
224
|
-
| `autocapitalize` | `"
|
|
224
|
+
| `autocapitalize` | `"off" \| "on"` | — | no | `off`, `on` | — |
|
|
225
225
|
| `autocomplete` | `string` | — | no | — | — |
|
|
226
226
|
| `autofocus` | `boolean` | — | no | — | — |
|
|
227
227
|
| `autogrow` | `boolean` | — | no | — | — |
|
|
@@ -236,8 +236,8 @@ Props: `label`, `placeholder`, `rows` (default `2`), `cols` (default `20`), **`a
|
|
|
236
236
|
| `id` | `string` | — | no | — | — |
|
|
237
237
|
| `inputBackground` | `string` | — | no | — | — |
|
|
238
238
|
| `label` | `string` | — | no | — | — |
|
|
239
|
-
| `maxlength` | `
|
|
240
|
-
| `minlength` | `
|
|
239
|
+
| `maxlength` | `number \| string` | — | no | — | — |
|
|
240
|
+
| `minlength` | `number \| string` | — | no | — | — |
|
|
241
241
|
| `modelValue` | `string` | `""` | no | — | — |
|
|
242
242
|
| `name` | `string` | — | no | — | — |
|
|
243
243
|
| `placeholder` | `string` | — | no | — | — |
|
|
@@ -284,15 +284,15 @@ Single-value dropdown (no `multiple`, `chips`, `clearable` or `placeholder` —
|
|
|
284
284
|
|
|
285
285
|
| Prop | Type | Default | Required | Values | Description |
|
|
286
286
|
| --- | --- | --- | --- | --- | --- |
|
|
287
|
-
| `activator` | `string \|
|
|
287
|
+
| `activator` | `string \| ComponentPublicInstance \| HTMLElement \| null` | — | no | — | — |
|
|
288
288
|
| `ariaLabel` | `string \| null` | — | no | — | Accessible name when there is no visible `label` (otherwise the label names the field). |
|
|
289
|
-
| `borderRadius` | `` number \| "
|
|
289
|
+
| `borderRadius` | `` number \| "rounded" \| "tile" \| `${number}%` \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — | — |
|
|
290
290
|
| `closeOnClick` | `boolean` | — | no | — | — |
|
|
291
291
|
| `closeOnContentClick` | `boolean` | — | no | — | — |
|
|
292
292
|
| `closeOnScroll` | `boolean` | — | no | — | — |
|
|
293
293
|
| `color` | `string` | — | no | — | — |
|
|
294
294
|
| `colorThreshold` | `number` | — | no | — | — |
|
|
295
|
-
| `contentClass` | `string \|
|
|
295
|
+
| `contentClass` | `string \| Record<string, boolean> \| string[]` | — | no | — | — |
|
|
296
296
|
| `contentStyle` | `StyleValue` | — | no | — | — |
|
|
297
297
|
| `dense` | `boolean` | — | no | — | — |
|
|
298
298
|
| `dirty` | `boolean` | — | no | — | — |
|
|
@@ -300,20 +300,21 @@ Single-value dropdown (no `multiple`, `chips`, `clearable` or `placeholder` —
|
|
|
300
300
|
| `divided` | `boolean` | — | no | — | — |
|
|
301
301
|
| `error` | `boolean` | — | no | — | — |
|
|
302
302
|
| `grow` | `boolean` | — | no | — | — |
|
|
303
|
-
| `height` | `
|
|
303
|
+
| `height` | `number \| string \| null` | — | no | — | — |
|
|
304
304
|
| `hideDetails` | `boolean` | — | no | — | — |
|
|
305
305
|
| `hideError` | `boolean` | — | no | — | — |
|
|
306
306
|
| `id` | `string` | — | no | — | — |
|
|
307
307
|
| `items` | `(string \| SelectItem \| null \| undefined)[]` | — | no | — | — |
|
|
308
308
|
| `label` | `string \| null` | — | no | — | — |
|
|
309
309
|
| `location` | `LocationRaw` | — | no | — | — |
|
|
310
|
-
| `maxHeight` | `
|
|
311
|
-
| `maxWidth` | `
|
|
310
|
+
| `maxHeight` | `number \| string \| null` | — | no | — | — |
|
|
311
|
+
| `maxWidth` | `number \| string \| null` | — | no | — | — |
|
|
312
312
|
| `menu` | `boolean` | — | no | — | — |
|
|
313
|
-
| `minHeight` | `
|
|
314
|
-
| `minWidth` | `
|
|
313
|
+
| `minHeight` | `number \| string \| null` | — | no | — | — |
|
|
314
|
+
| `minWidth` | `number \| string \| null` | — | no | — | — |
|
|
315
315
|
| `modelValue` | `T \| null` | — | no | — | — |
|
|
316
316
|
| `name` | `string \| null` | — | no | — | — |
|
|
317
|
+
| `noDataText` | `string` | — | no | — | Message shown in the open menu when `items` is empty. Without it (and without the `noData` slot) an empty menu stays blank. Put an `SEmptyState` in the `noData` slot for an icon or an action. |
|
|
317
318
|
| `offsetX` | `number \| null` | — | no | — | — |
|
|
318
319
|
| `offsetY` | `number \| null` | — | no | — | — |
|
|
319
320
|
| `outlined` | `boolean \| null` | `true` | no | — | — |
|
|
@@ -326,14 +327,15 @@ Single-value dropdown (no `multiple`, `chips`, `clearable` or `placeholder` —
|
|
|
326
327
|
| `text` | `boolean` | — | no | — | — |
|
|
327
328
|
| `theme` | `AppThemeType` | — | no | `dark`, `light` | — |
|
|
328
329
|
| `underlined` | `boolean \| null` | — | no | — | — |
|
|
329
|
-
| `width` | `
|
|
330
|
+
| `width` | `number \| string \| null` | — | no | — | — |
|
|
330
331
|
|
|
331
332
|
**SSelect slots**
|
|
332
333
|
|
|
333
|
-
| Slot | Slot props |
|
|
334
|
-
| --- | --- |
|
|
335
|
-
| `activator` | `{ item: SelectItem \| null; value: boolean \| undefined; }` |
|
|
336
|
-
| `dropdownIcon` | `{ color: string \| undefined; value: boolean \| undefined; }` |
|
|
334
|
+
| Slot | Slot props | Description |
|
|
335
|
+
| --- | --- | --- |
|
|
336
|
+
| `activator` | `{ item: SelectItem \| null; value: boolean \| undefined; }` | Replaces the selected item's text in the field. |
|
|
337
|
+
| `dropdownIcon` | `{ color: string \| undefined; value: boolean \| undefined; }` | Replaces the chevron icon. |
|
|
338
|
+
| `noData` | `any` | Replaces `noDataText` when `items` is empty, such as an `SEmptyState`. |
|
|
337
339
|
|
|
338
340
|
**SSelect events**
|
|
339
341
|
|
|
@@ -426,7 +428,7 @@ Options are **`SRadio` children** — there is no `items` prop. Long option labe
|
|
|
426
428
|
|
|
427
429
|
| Prop | Type | Default | Required | Values |
|
|
428
430
|
| --- | --- | --- | --- | --- |
|
|
429
|
-
| `borderRadius` | `` number \| "
|
|
431
|
+
| `borderRadius` | `` number \| "rounded" \| "tile" \| `${number}%` \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — |
|
|
430
432
|
| `color` | `string \| null` | — | no | — |
|
|
431
433
|
| `column` | `boolean \| null` | — | no | — |
|
|
432
434
|
| `continuous` | `boolean` | — | no | — |
|
|
@@ -473,7 +475,7 @@ Options are **`SRadio` children** — there is no `items` prop. Long option labe
|
|
|
473
475
|
| --- | --- | --- | --- | --- | --- |
|
|
474
476
|
| `activeClass` | `string \| null` | — | no | — | — |
|
|
475
477
|
| `ariaLabel` | `string \| null` | — | no | — | Accessible name for a radio without a visible `label` (for example an icon-only option). |
|
|
476
|
-
| `borderRadius` | `` number \| "
|
|
478
|
+
| `borderRadius` | `` number \| "rounded" \| "tile" \| `${number}%` \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — | — |
|
|
477
479
|
| `disabled` | `boolean \| null` | — | no | — | — |
|
|
478
480
|
| `id` | `string` | — | no | — | — |
|
|
479
481
|
| `label` | `string \| null` | — | no | — | — |
|
|
@@ -483,7 +485,7 @@ Options are **`SRadio` children** — there is no `items` prop. Long option labe
|
|
|
483
485
|
| `selected` | `boolean` | — | no | — | — |
|
|
484
486
|
| `type` | `ButtonTypeType` | — | no | `button`, `reset`, `submit` | — |
|
|
485
487
|
| `underlined` | `boolean \| null` | — | no | — | — |
|
|
486
|
-
| `value` | `
|
|
488
|
+
| `value` | `boolean \| number \| string` | — | no | — | — |
|
|
487
489
|
|
|
488
490
|
**SRadio slots**
|
|
489
491
|
|
|
@@ -15,15 +15,15 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsImage.d.ts`
|
|
|
15
15
|
| --- | --- | --- | --- | --- |
|
|
16
16
|
| `alt` | `string \| null` | — | no | — |
|
|
17
17
|
| `aspectRatio` | `number \| null` | — | no | — |
|
|
18
|
-
| `height` | `
|
|
18
|
+
| `height` | `number \| string \| null` | — | no | — |
|
|
19
19
|
| `lazyLoad` | `LazyLoad \| null` | — | no | — |
|
|
20
|
-
| `maxHeight` | `
|
|
21
|
-
| `maxWidth` | `
|
|
22
|
-
| `minHeight` | `
|
|
23
|
-
| `minWidth` | `
|
|
24
|
-
| `objectFit` | `"
|
|
20
|
+
| `maxHeight` | `number \| string \| null` | — | no | — |
|
|
21
|
+
| `maxWidth` | `number \| string \| null` | — | no | — |
|
|
22
|
+
| `minHeight` | `number \| string \| null` | — | no | — |
|
|
23
|
+
| `minWidth` | `number \| string \| null` | — | no | — |
|
|
24
|
+
| `objectFit` | `"contain" \| "cover" \| "fill" \| "none" \| "scale-down"` | — | no | `contain`, `cover`, `fill`, `none`, `scale-down` |
|
|
25
25
|
| `src` | `string \| null` | — | yes | — |
|
|
26
|
-
| `width` | `
|
|
26
|
+
| `width` | `number \| string \| null` | — | no | — |
|
|
27
27
|
|
|
28
28
|
**SImage slots**
|
|
29
29
|
|
|
@@ -57,7 +57,7 @@ None.
|
|
|
57
57
|
<!-- 16:9 cover -->
|
|
58
58
|
<SImage src="/banner.jpg" :aspect-ratio="16/9" object-fit="cover" />
|
|
59
59
|
|
|
60
|
-
<!-- Square avatar -->
|
|
60
|
+
<!-- Square image (for a user avatar with an initials fallback, use SAvatar) -->
|
|
61
61
|
<SImage src="/avatar.jpg" :aspect-ratio="1" object-fit="cover" :width="80" />
|
|
62
62
|
|
|
63
63
|
<!-- Overlay -->
|