@streamscloud/kit 0.41.0 → 0.42.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/dist/core/validation/form-validation-handler/form-validation-handler.svelte.d.ts +7 -0
- package/dist/core/validation/form-validation-handler/form-validation-handler.svelte.js +18 -0
- package/dist/ui/play-indicator/cmp.play-indicator.svelte +2 -2
- package/dist/ui/play-indicator/cmp.play-indicator.svelte.d.ts +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,13 @@ export declare class FormValidationHandler<T extends TypeToValidate<T> = TypeToV
|
|
|
33
33
|
updateValidateField: <K extends keyof T>(field: K, value: T[K]) => Promise<void>;
|
|
34
34
|
updateTouched: (field: keyof T, value: boolean) => void;
|
|
35
35
|
updateTouchedForAllFields: (value: boolean) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Sets an error the schema can't produce (a server-side rejection), marking the field touched so it renders.
|
|
38
|
+
* The next validation pass overwrites it — `validateField` (blur by default), `validate()`, `handleSubmit`.
|
|
39
|
+
*/
|
|
40
|
+
setFieldError: (field: keyof T, message: string) => void;
|
|
41
|
+
/** Batch {@link setFieldError} — skips `undefined` entries, same overwrite-on-next-validation semantics. */
|
|
42
|
+
setFieldErrors: (errors: Partial<Record<keyof T, string>>) => void;
|
|
36
43
|
validateField: (field: keyof T) => Promise<void>;
|
|
37
44
|
updateInitialValues: (newValues: T) => void;
|
|
38
45
|
updateValidator: (validator: IFormHandlerValidator<T>) => void;
|
|
@@ -75,6 +75,24 @@ export class FormValidationHandler {
|
|
|
75
75
|
ValidationUtils.update(this._touched, key, value);
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Sets an error the schema can't produce (a server-side rejection), marking the field touched so it renders.
|
|
80
|
+
* The next validation pass overwrites it — `validateField` (blur by default), `validate()`, `handleSubmit`.
|
|
81
|
+
*/
|
|
82
|
+
setFieldError = (field, message) => {
|
|
83
|
+
ValidationUtils.update(this._errors, field, message);
|
|
84
|
+
this.updateTouched(field, true);
|
|
85
|
+
};
|
|
86
|
+
/** Batch {@link setFieldError} — skips `undefined` entries, same overwrite-on-next-validation semantics. */
|
|
87
|
+
setFieldErrors = (errors) => {
|
|
88
|
+
Object.keys(errors).forEach((field) => {
|
|
89
|
+
const message = errors[field];
|
|
90
|
+
if (message === undefined) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.setFieldError(field, message);
|
|
94
|
+
});
|
|
95
|
+
};
|
|
78
96
|
validateField = async (field) => {
|
|
79
97
|
return await this.validateFieldValue(field);
|
|
80
98
|
};
|
|
@@ -21,14 +21,14 @@ outline there — pass a softer filter, or `none`.
|
|
|
21
21
|
### CSS Custom Properties
|
|
22
22
|
| Property | Description | Default |
|
|
23
23
|
|---|---|---|
|
|
24
|
-
| `--sc-kit--play-indicator--size` | Glyph size; container-query clamp scales it to parent width, reaching the
|
|
24
|
+
| `--sc-kit--play-indicator--size` | Glyph size; container-query clamp scales it to parent width, reaching the 54px ceiling at 450px | `clamp(1.75rem, 12cqi, 3.375rem)` |
|
|
25
25
|
| `--sc-kit--play-indicator--filter` | Shadow applied to the glyph | `--sc-kit--filter--icon-overlay` |
|
|
26
26
|
-->
|
|
27
27
|
|
|
28
28
|
<style>.play-indicator {
|
|
29
29
|
--_play-indicator--size: var(
|
|
30
30
|
--sc-kit--play-indicator--size,
|
|
31
|
-
var(--_--play-indicator--size, clamp(1.75rem,
|
|
31
|
+
var(--_--play-indicator--size, clamp(1.75rem, 12cqi, 3.375rem))
|
|
32
32
|
);
|
|
33
33
|
--_play-indicator--filter: var(--sc-kit--play-indicator--filter, var(--sc-kit--filter--icon-overlay));
|
|
34
34
|
display: inline-flex;
|
|
@@ -14,7 +14,7 @@ type Props = {
|
|
|
14
14
|
* ### CSS Custom Properties
|
|
15
15
|
* | Property | Description | Default |
|
|
16
16
|
* |---|---|---|
|
|
17
|
-
* | `--sc-kit--play-indicator--size` | Glyph size; container-query clamp scales it to parent width, reaching the
|
|
17
|
+
* | `--sc-kit--play-indicator--size` | Glyph size; container-query clamp scales it to parent width, reaching the 54px ceiling at 450px | `clamp(1.75rem, 12cqi, 3.375rem)` |
|
|
18
18
|
* | `--sc-kit--play-indicator--filter` | Shadow applied to the glyph | `--sc-kit--filter--icon-overlay` |
|
|
19
19
|
*/
|
|
20
20
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|