@streamscloud/kit 0.80.0 → 0.81.1
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/dist/core/utils/html-helper.d.ts +7 -1
- package/dist/core/utils/html-helper.js +83 -10
- package/dist/styles/_mixins.scss +12 -0
- package/dist/ui/color-picker/cmp.color-picker.svelte +2 -2
- package/dist/ui/color-picker/cmp.color-picker.svelte.d.ts +2 -0
- package/dist/ui/dialog/cmp.dialog-container.svelte +9 -0
- package/dist/ui/dialog/cmp.dialog.svelte +1 -1
- package/dist/ui/dialog/cmp.dialog.svelte.d.ts +1 -1
- package/dist/ui/dialog/dialog-controller.d.ts +2 -0
- package/dist/ui/dialog/dialog-controller.js +3 -0
- package/dist/ui/dialog/layout/cmp.frameless-dialog.svelte +1 -1
- package/dist/ui/dialog/layout/cmp.stepper-dialog.svelte +1 -1
- package/dist/ui/file-uploader/cmp.file-uploader.svelte +4 -1
- package/dist/ui/file-uploader/file-uploader-localization.d.ts +1 -0
- package/dist/ui/file-uploader/file-uploader-localization.js +7 -0
- package/dist/ui/form-field/cmp.form-field-validatable.svelte +22 -37
- package/dist/ui/form-field/cmp.form-field-validatable.svelte.d.ts +3 -25
- package/dist/ui/form-field/cmp.form-field.svelte +23 -12
- package/dist/ui/form-field/cmp.form-field.svelte.d.ts +7 -7
- package/dist/ui/icon/cmp.icon.svelte +6 -5
- package/dist/ui/icon/cmp.icon.svelte.d.ts +1 -1
- package/dist/ui/navigation/cmp.nav-rail-item.svelte +17 -0
- package/dist/ui/navigation/cmp.nav-rail-item.svelte.d.ts +1 -1
- package/dist/ui/navigation/cmp.nav-rail.svelte +4 -4
- package/dist/ui/navigation/cmp.nav-rail.svelte.d.ts +2 -0
- package/dist/ui/navigation/nav-rail-item-localization.d.ts +3 -0
- package/dist/ui/navigation/nav-rail-item-localization.js +12 -0
- package/dist/ui/pin-input/cmp.pin-input.svelte +5 -2
- package/dist/ui/pin-input/cmp.pin-input.svelte.d.ts +1 -0
- package/dist/ui/pin-input/pin-input-localization.d.ts +3 -0
- package/dist/ui/pin-input/pin-input-localization.js +12 -0
- package/dist/ui/segmented-control/cmp.segmented-control.svelte +52 -12
- package/dist/ui/segmented-control/cmp.segmented-control.svelte.d.ts +12 -10
- package/dist/ui/table/cmp.table-draggable.svelte.d.ts +6 -0
- package/dist/ui/table/cmp.table.svelte.d.ts +4 -0
- package/dist/ui/table/table-cells/table-actions-cell.svelte +3 -1
- package/dist/ui/table/table-cells/table-by-cell.svelte +1 -1
- package/dist/ui/table/table-core.svelte +51 -7
- package/dist/ui/table/table-core.svelte.d.ts +4 -0
- package/dist/ui/table/table-localization.d.ts +1 -0
- package/dist/ui/table/table-localization.js +7 -0
- package/dist/ui/toast/cmp.toast-item.svelte +29 -4
- package/dist/ui/toast/types.d.ts +1 -1
- package/dist/ui/tooltip/cmp.tooltip.svelte +15 -4
- package/dist/ui/tooltip/cmp.tooltip.svelte.d.ts +7 -2
- package/dist/ui/validatable/cmp.validatable.svelte +6 -42
- package/dist/ui/validatable/cmp.validatable.svelte.d.ts +9 -43
- package/dist/ui/validatable/cmp.validation-error.svelte +3 -2
- package/dist/ui/validatable/cmp.validation-error.svelte.d.ts +4 -1
- package/dist/ui/validatable/field-frame.svelte +2 -2
- package/dist/ui/validatable/field-frame.svelte.d.ts +2 -0
- package/package.json +1 -1
|
@@ -27,10 +27,12 @@ const runValidate = async () => {
|
|
|
27
27
|
const validate = $derived(debounceMs > 0 ? Utils.debounce(runValidate, debounceMs) : runValidate);
|
|
28
28
|
const runs = (mode) => validateOn.includes(mode);
|
|
29
29
|
const showErrors = $derived(!pendingValidation && !!handler.errors[name] && (disableTouchedTracking || !!handler.touched[name]));
|
|
30
|
+
const messageId = $props.id();
|
|
30
31
|
const field = $derived({
|
|
31
32
|
name,
|
|
32
33
|
value: handler.form[name],
|
|
33
34
|
error: showErrors,
|
|
35
|
+
'aria-describedby': showErrors ? messageId : undefined,
|
|
34
36
|
on: {
|
|
35
37
|
input: (v) => {
|
|
36
38
|
handler.updateField(name, v);
|
|
@@ -64,51 +66,13 @@ const field = $derived({
|
|
|
64
66
|
});
|
|
65
67
|
</script>
|
|
66
68
|
|
|
67
|
-
<FieldFrame error={showErrors ? handler.errors[name] : null} errorPlacement={errorPlacement}>
|
|
69
|
+
<FieldFrame error={showErrors ? handler.errors[name] : null} errorPlacement={errorPlacement} messageId={messageId}>
|
|
68
70
|
{@render children(field, pendingValidation)}
|
|
69
71
|
</FieldFrame>
|
|
70
72
|
|
|
71
73
|
<!--
|
|
72
74
|
@component
|
|
73
|
-
Binds
|
|
74
|
-
`Validatable`
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### Usage
|
|
78
|
-
```svelte
|
|
79
|
-
<Validatable {handler} name="email">
|
|
80
|
-
{#snippet children(field)}
|
|
81
|
-
<Input {...field} placeholder="Email" />
|
|
82
|
-
{/snippet}
|
|
83
|
-
</Validatable>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
The first snippet argument has shape `{ name, value, error, on: { input, change, blur } }` — the
|
|
87
|
-
minimal interface every kit input supports. Inputs whose primary value prop is not `value`
|
|
88
|
-
(e.g. `Checkbox` uses `checked`) wire the field explicitly inside the snippet.
|
|
89
|
-
|
|
90
|
-
### Validating flag
|
|
91
|
-
The second snippet argument is true from the value change until the validator has caught up — the
|
|
92
|
-
debounce window included, which `handler.isValidating` does not cover. Drives an inline async
|
|
93
|
-
indicator; everything else it might pair with is already public (`field.error` for the gated error
|
|
94
|
-
state, `handler.errors[name]` for the text, `handler.touched[name]`):
|
|
95
|
-
|
|
96
|
-
```svelte
|
|
97
|
-
<Validatable {handler} name="handle" debounceMs={400}>
|
|
98
|
-
{#snippet children(field, validating)}
|
|
99
|
-
<HandleInput {...field} status={validating ? 'checking' : field.error ? 'taken' : handler.touched.handle ? 'available' : undefined} />
|
|
100
|
-
{/snippet}
|
|
101
|
-
</Validatable>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
With a `validateOn` that excludes `input` and `change`, the flag stays true for the whole typing
|
|
105
|
-
session — pair an async indicator with the default `validateOn` plus a `debounceMs`.
|
|
106
|
-
|
|
107
|
-
### Validation events
|
|
108
|
-
`validateOn` accepts an array. Default `['input', 'change', 'blur']` validates on every event.
|
|
109
|
-
Pass `['blur']` for blur-only validation, `['change', 'blur']` for the classic "validate on commit" pattern.
|
|
110
|
-
|
|
111
|
-
### Consumer callbacks
|
|
112
|
-
Pass extra callbacks via `Validatable`'s own `on={...}` — they run AFTER the validation wiring
|
|
113
|
-
and cannot override it.
|
|
75
|
+
Binds any kit input to a `FormValidationHandler` through a render-prop snippet that receives the wired field, and renders the error message below
|
|
76
|
+
it per `errorPlacement`. Inputs stay unaware of validation; around a `FormField`, keep `Validatable` on the outside so the error stays out of the
|
|
77
|
+
field's name.
|
|
114
78
|
-->
|
|
@@ -3,6 +3,8 @@ export type FieldBinding<V> = {
|
|
|
3
3
|
name: string;
|
|
4
4
|
value: V;
|
|
5
5
|
error: boolean;
|
|
6
|
+
/** Id of the visible error message, set only while the error is shown. */
|
|
7
|
+
'aria-describedby'?: string;
|
|
6
8
|
on: {
|
|
7
9
|
input: (v: V) => void;
|
|
8
10
|
change: (v: V) => void;
|
|
@@ -47,8 +49,10 @@ declare function $$render<T extends Record<string, unknown>, K extends keyof T &
|
|
|
47
49
|
blur?: () => void;
|
|
48
50
|
};
|
|
49
51
|
/**
|
|
50
|
-
* Receives a wired `FieldBinding<T[K]>` to spread into a kit input
|
|
51
|
-
*
|
|
52
|
+
* Receives a wired `FieldBinding<T[K]>` to spread into a kit input (`aria-describedby` points at the visible error message; inputs without that
|
|
53
|
+
* prop ignore it; a control whose value prop is not `value`, e.g. `Checkbox`, is wired by hand), plus a `validating` flag — true from the value
|
|
54
|
+
* change until the validator has caught up, debounce window included, which `handler.isValidating` does not cover. With a `validateOn` that
|
|
55
|
+
* excludes `input` and `change` the flag stays true for the whole typing session.
|
|
52
56
|
*/
|
|
53
57
|
children: Snippet<[FieldBinding<T[K]>, boolean]>;
|
|
54
58
|
};
|
|
@@ -72,47 +76,9 @@ interface $$IsomorphicComponent {
|
|
|
72
76
|
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
73
77
|
}
|
|
74
78
|
/**
|
|
75
|
-
* Binds
|
|
76
|
-
* `Validatable`
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* ### Usage
|
|
80
|
-
* ```svelte
|
|
81
|
-
* <Validatable {handler} name="email">
|
|
82
|
-
* {#snippet children(field)}
|
|
83
|
-
* <Input {...field} placeholder="Email" />
|
|
84
|
-
* {/snippet}
|
|
85
|
-
* </Validatable>
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* The first snippet argument has shape `{ name, value, error, on: { input, change, blur } }` — the
|
|
89
|
-
* minimal interface every kit input supports. Inputs whose primary value prop is not `value`
|
|
90
|
-
* (e.g. `Checkbox` uses `checked`) wire the field explicitly inside the snippet.
|
|
91
|
-
*
|
|
92
|
-
* ### Validating flag
|
|
93
|
-
* The second snippet argument is true from the value change until the validator has caught up — the
|
|
94
|
-
* debounce window included, which `handler.isValidating` does not cover. Drives an inline async
|
|
95
|
-
* indicator; everything else it might pair with is already public (`field.error` for the gated error
|
|
96
|
-
* state, `handler.errors[name]` for the text, `handler.touched[name]`):
|
|
97
|
-
*
|
|
98
|
-
* ```svelte
|
|
99
|
-
* <Validatable {handler} name="handle" debounceMs={400}>
|
|
100
|
-
* {#snippet children(field, validating)}
|
|
101
|
-
* <HandleInput {...field} status={validating ? 'checking' : field.error ? 'taken' : handler.touched.handle ? 'available' : undefined} />
|
|
102
|
-
* {/snippet}
|
|
103
|
-
* </Validatable>
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* With a `validateOn` that excludes `input` and `change`, the flag stays true for the whole typing
|
|
107
|
-
* session — pair an async indicator with the default `validateOn` plus a `debounceMs`.
|
|
108
|
-
*
|
|
109
|
-
* ### Validation events
|
|
110
|
-
* `validateOn` accepts an array. Default `['input', 'change', 'blur']` validates on every event.
|
|
111
|
-
* Pass `['blur']` for blur-only validation, `['change', 'blur']` for the classic "validate on commit" pattern.
|
|
112
|
-
*
|
|
113
|
-
* ### Consumer callbacks
|
|
114
|
-
* Pass extra callbacks via `Validatable`'s own `on={...}` — they run AFTER the validation wiring
|
|
115
|
-
* and cannot override it.
|
|
79
|
+
* Binds any kit input to a `FormValidationHandler` through a render-prop snippet that receives the wired field, and renders the error message below
|
|
80
|
+
* it per `errorPlacement`. Inputs stay unaware of validation; around a `FormField`, keep `Validatable` on the outside so the error stays out of the
|
|
81
|
+
* field's name.
|
|
116
82
|
*/
|
|
117
83
|
declare const Cmp: $$IsomorphicComponent;
|
|
118
84
|
type Cmp<T extends Record<string, unknown>, K extends keyof T & string> = InstanceType<typeof Cmp<T, K>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends Record<string, unknown>">import { default as FieldFrame } from './field-frame.svelte';
|
|
2
2
|
let { name, validationResult, errorPlacement = 'overlay', children } = $props();
|
|
3
3
|
const errorText = $derived(validationResult?.errors[name] ?? null);
|
|
4
|
+
const messageId = $props.id();
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
|
-
<FieldFrame error={errorText} errorPlacement={errorPlacement}>
|
|
7
|
-
{@render children()}
|
|
7
|
+
<FieldFrame error={errorText} errorPlacement={errorPlacement} messageId={messageId}>
|
|
8
|
+
{@render children({ 'aria-describedby': errorText ? messageId : undefined })}
|
|
8
9
|
</FieldFrame>
|
|
9
10
|
|
|
10
11
|
<!--
|
|
@@ -13,7 +13,10 @@ declare function $$render<T extends Record<string, unknown>>(): {
|
|
|
13
13
|
* @default 'overlay'
|
|
14
14
|
*/
|
|
15
15
|
errorPlacement?: ErrorPlacement;
|
|
16
|
-
|
|
16
|
+
/** Receives `aria-describedby` pointing at the visible error message — spread it onto the field. */
|
|
17
|
+
children: Snippet<[{
|
|
18
|
+
"aria-describedby"?: string;
|
|
19
|
+
}]>;
|
|
17
20
|
};
|
|
18
21
|
exports: {};
|
|
19
22
|
bindings: "";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<script lang="ts">let { error, errorPlacement = 'overlay', children } = $props();
|
|
1
|
+
<script lang="ts">let { error, errorPlacement = 'overlay', messageId, children } = $props();
|
|
2
2
|
export {};
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<div class="field-frame" class:field-frame--reserved={errorPlacement === 'reserved'}>
|
|
6
6
|
{@render children()}
|
|
7
7
|
{#if error}
|
|
8
|
-
<small class="field-frame__message field-frame__message--{errorPlacement}">{error}</small>
|
|
8
|
+
<small id={messageId} class="field-frame__message field-frame__message--{errorPlacement}">{error}</small>
|
|
9
9
|
{/if}
|
|
10
10
|
</div>
|
|
11
11
|
|
|
@@ -5,6 +5,8 @@ type Props = {
|
|
|
5
5
|
error?: string | null | undefined;
|
|
6
6
|
/** Where the error message sits relative to the field. @default 'overlay' */
|
|
7
7
|
errorPlacement?: ErrorPlacement;
|
|
8
|
+
/** Id of the message element — the field points `aria-describedby` at it while the error is shown. */
|
|
9
|
+
messageId: string;
|
|
8
10
|
children: Snippet;
|
|
9
11
|
};
|
|
10
12
|
/**
|