entasis 0.10.2 → 0.11.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/components/Form/Ask/ask.mcp.d.ts +1 -1
- package/dist/components/Form/Ask/ask.mcp.js +1 -1
- package/dist/components/Form/Field/Field.svelte +2 -2
- package/dist/components/Form/Field/Field.svelte.d.ts +6 -6
- package/dist/components/Form/Field/field.d.ts +12 -3
- package/dist/components/Form/Field/field.state.svelte.d.ts +8 -37
- package/dist/components/Form/Field/field.state.svelte.js +21 -4
- package/dist/components/Form/Form/Form.svelte +2 -1
- package/dist/components/Form/Form/FormFieldRenderer.svelte +57 -11
- package/dist/components/Form/Form/FormFieldRenderer.svelte.d.ts +3 -2
- package/dist/components/Form/Form/form.d.ts +52 -8
- package/dist/components/Form/Form/form.mcp.d.ts +1 -1
- package/dist/components/Form/Form/form.mcp.js +66 -0
- package/dist/components/Form/Form/form.registry.d.ts +28 -0
- package/dist/components/Form/Form/form.registry.js +62 -0
- package/dist/components/Form/Form/form.state.svelte.d.ts +49 -8
- package/dist/components/Form/Form/form.state.svelte.js +3 -2
- package/dist/components/Form/Form/index.d.ts +2 -1
- package/dist/components/Form/Form/index.js +1 -0
- package/dist/components/Form/Form/visibility.d.ts +32 -30
- package/dist/components/Form/MultiStepForm/multiStepForm.state.svelte.d.ts +28 -0
- package/dist/generated/componentContract.d.ts +1 -1
- package/dist/generated/componentContract.js +6 -0
- package/dist/generated/componentMcpRegistry.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import type { RegisteredInputType } from '../Field/field.js';
|
|
4
|
+
import type { FieldValidationResult } from '../Field/field.state.svelte.js';
|
|
5
|
+
import type { FormInputDefinition, FormRegisteredInput, FormRenderableInput } from './form.js';
|
|
6
|
+
/** The definitions `registerFormInputs` takes: one per `FormInputRegistry` key, all optional. */
|
|
7
|
+
export type FormInputDefinitions = {
|
|
8
|
+
[T in RegisteredInputType]?: FormInputDefinition<T>;
|
|
9
|
+
};
|
|
10
|
+
/** A definition with its value type erased, as the registry stores and Form renders it. */
|
|
11
|
+
export type RegisteredFormInputDefinition = {
|
|
12
|
+
component: Component<Record<string, unknown>>;
|
|
13
|
+
isEmpty: (value: unknown) => boolean;
|
|
14
|
+
validate?: (value: unknown) => FieldValidationResult;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Registers the components behind the app's `FormInputRegistry` types, so entries such as
|
|
18
|
+
* `{ type: 'money', label: 'Price' }` render in every Form and ask() dialog. Call it at the top
|
|
19
|
+
* level of a module the server and the browser both load before a form renders, such as one the
|
|
20
|
+
* root layout imports. Registering a type again replaces it, so hot reloads keep working.
|
|
21
|
+
*
|
|
22
|
+
* Returns a function that removes these registrations.
|
|
23
|
+
*/
|
|
24
|
+
export declare function registerFormInputs(inputs: FormInputDefinitions): () => void;
|
|
25
|
+
export declare const getFormInputDefinition: (type: string) => RegisteredFormInputDefinition | undefined;
|
|
26
|
+
export declare const isRegisteredFormInput: (input: FormRenderableInput) => input is FormRegisteredInput;
|
|
27
|
+
/** The `required`/optional check a registered type gets, in the built-in schemas' terms. */
|
|
28
|
+
export declare function getRegisteredInputSchema(definition: RegisteredFormInputDefinition, required: boolean): v.GenericSchema;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { schemas } from '../Field/schemas.js';
|
|
3
|
+
// Form's own entry kinds; the built-in input types are rejected through the schema table.
|
|
4
|
+
const ENTRY_KINDS = new Set(['field', 'custom', 'action', 'group']);
|
|
5
|
+
const definitions = new Map();
|
|
6
|
+
const isEmptyValue = (value) => value === null ||
|
|
7
|
+
value === undefined ||
|
|
8
|
+
value === '' ||
|
|
9
|
+
(Array.isArray(value) && value.length === 0);
|
|
10
|
+
/**
|
|
11
|
+
* Registers the components behind the app's `FormInputRegistry` types, so entries such as
|
|
12
|
+
* `{ type: 'money', label: 'Price' }` render in every Form and ask() dialog. Call it at the top
|
|
13
|
+
* level of a module the server and the browser both load before a form renders, such as one the
|
|
14
|
+
* root layout imports. Registering a type again replaces it, so hot reloads keep working.
|
|
15
|
+
*
|
|
16
|
+
* Returns a function that removes these registrations.
|
|
17
|
+
*/
|
|
18
|
+
export function registerFormInputs(inputs) {
|
|
19
|
+
const added = [];
|
|
20
|
+
// Erased: inside the library the registry is empty, so each definition's own type is `never`.
|
|
21
|
+
const entries = Object.entries(inputs);
|
|
22
|
+
for (const [type, definition] of entries) {
|
|
23
|
+
if (!definition)
|
|
24
|
+
continue;
|
|
25
|
+
if (ENTRY_KINDS.has(type) || Object.hasOwn(schemas.required, type)) {
|
|
26
|
+
throw new Error(`[Form] "${type}" is a built-in input type and cannot be registered.`);
|
|
27
|
+
}
|
|
28
|
+
added.push([
|
|
29
|
+
type,
|
|
30
|
+
{
|
|
31
|
+
// The registry erases each definition's value type; Form hands the component the
|
|
32
|
+
// field it registered for that type, which restores it.
|
|
33
|
+
component: definition.component,
|
|
34
|
+
isEmpty: definition.isEmpty ?? isEmptyValue,
|
|
35
|
+
validate: definition.validate
|
|
36
|
+
}
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
for (const [type, definition] of added)
|
|
40
|
+
definitions.set(type, definition);
|
|
41
|
+
return () => {
|
|
42
|
+
for (const [type, definition] of added) {
|
|
43
|
+
if (definitions.get(type) === definition)
|
|
44
|
+
definitions.delete(type);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export const getFormInputDefinition = (type) => definitions.get(type);
|
|
49
|
+
export const isRegisteredFormInput = (input) => definitions.has(input.type);
|
|
50
|
+
const registeredSchemas = new WeakMap();
|
|
51
|
+
/** The `required`/optional check a registered type gets, in the built-in schemas' terms. */
|
|
52
|
+
export function getRegisteredInputSchema(definition, required) {
|
|
53
|
+
let entry = registeredSchemas.get(definition);
|
|
54
|
+
if (!entry) {
|
|
55
|
+
entry = {
|
|
56
|
+
required: v.pipe(v.unknown(), v.check((value) => !definition.isEmpty(value))),
|
|
57
|
+
optional: v.unknown()
|
|
58
|
+
};
|
|
59
|
+
registeredSchemas.set(definition, entry);
|
|
60
|
+
}
|
|
61
|
+
return required ? entry.required : entry.optional;
|
|
62
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Attachment } from 'svelte/attachments';
|
|
2
2
|
import { SvelteMap } from 'svelte/reactivity';
|
|
3
3
|
import type { FieldState } from '../Field/field.state.svelte.js';
|
|
4
|
-
import type { FieldValue, InputType } from '../Field/field.js';
|
|
4
|
+
import type { FieldType, FieldValue, InputType } from '../Field/field.js';
|
|
5
5
|
import type { FormGroup, FormInputs, FormRenderableInput, FormSubmitHandler, FormValueRecord, InferFormValue, LiveFormValue } from './form.js';
|
|
6
6
|
type FormStateOptions<I extends FormInputs> = {
|
|
7
7
|
inputs: I;
|
|
@@ -26,18 +26,31 @@ export declare class FormState<I extends FormInputs = FormInputs> {
|
|
|
26
26
|
get controlAttrs(): import("../Field/field.state.svelte.js").FieldControlAttributes;
|
|
27
27
|
setValue: (nextValue: FieldValue<T> | null | undefined) => void;
|
|
28
28
|
syncValue: (nextValue: FieldValue<T> | null | undefined) => void;
|
|
29
|
-
|
|
29
|
+
get definition(): import("./form.registry.js").RegisteredFormInputDefinition | undefined;
|
|
30
|
+
checkSchema(value?: string | number | boolean | string[] | number[] | Date | Blob | File | File[] | [Date | null, Date | null] | import("../Field/field.js").KeyValuePair[] | {
|
|
31
|
+
amount: number;
|
|
32
|
+
currency: string;
|
|
33
|
+
} | null | undefined): import("valibot", { with: { "resolution-mode": "require" } }).SafeParseResult<import("valibot", { with: { "resolution-mode": "require" } }).BaseSchema<unknown, unknown, import("valibot", { with: { "resolution-mode": "require" } }).BaseIssue<unknown>>>;
|
|
30
34
|
get isValid(): boolean;
|
|
31
35
|
validate: (value?: FieldValue<T> | null | undefined) => readonly [boolean, unknown];
|
|
32
|
-
value?: string | number | boolean | string[] | number[] | Date | Blob | File | File[] | [Date | null, Date | null] | import("../Field/field.js").KeyValuePair[] |
|
|
36
|
+
value?: string | number | boolean | string[] | number[] | Date | Blob | File | File[] | [Date | null, Date | null] | import("../Field/field.js").KeyValuePair[] | {
|
|
37
|
+
amount: number;
|
|
38
|
+
currency: string;
|
|
39
|
+
} | null | undefined;
|
|
33
40
|
errors: string[] | boolean;
|
|
34
41
|
focused: boolean;
|
|
35
|
-
type:
|
|
42
|
+
type: FieldType;
|
|
36
43
|
required?: boolean;
|
|
37
44
|
disabled?: boolean;
|
|
38
45
|
visible?: boolean;
|
|
39
|
-
onValidate?: ((value: string | number | boolean | string[] | number[] | Date | Blob | File | File[] | [Date | null, Date | null] | import("../Field/field.js").KeyValuePair[] |
|
|
40
|
-
|
|
46
|
+
onValidate?: ((value: string | number | boolean | string[] | number[] | Date | Blob | File | File[] | [Date | null, Date | null] | import("../Field/field.js").KeyValuePair[] | {
|
|
47
|
+
amount: number;
|
|
48
|
+
currency: string;
|
|
49
|
+
} | null) => import("../Field/field.state.svelte.js").FieldValidationResult) | undefined;
|
|
50
|
+
onValueChange?: ((value: string | number | boolean | string[] | number[] | Date | Blob | File | File[] | [Date | null, Date | null] | import("../Field/field.js").KeyValuePair[] | {
|
|
51
|
+
amount: number;
|
|
52
|
+
currency: string;
|
|
53
|
+
} | null) => void) | undefined;
|
|
41
54
|
id: string;
|
|
42
55
|
}>;
|
|
43
56
|
loading: boolean;
|
|
@@ -853,6 +866,13 @@ export declare class FormState<I extends FormInputs = FormInputs> {
|
|
|
853
866
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
854
867
|
}, "visible"> & {
|
|
855
868
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
869
|
+
}) | ({
|
|
870
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
871
|
+
class?: string;
|
|
872
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
873
|
+
currencies?: readonly string[];
|
|
874
|
+
} & {
|
|
875
|
+
type: "test-money";
|
|
856
876
|
}) ? T_9["type"] : never : never : never>> : FieldValue<Extract<T_1[K_1], import("./form.js").FormValueInput> extends infer T_10 ? T_10 extends Extract<T_1[K_1], import("./form.js").FormValueInput> ? T_10 extends import("./form.js").FormFieldEntry<infer Input extends InputType> ? Input : T_10 extends (Omit<{
|
|
857
877
|
type: "time";
|
|
858
878
|
} & {
|
|
@@ -1625,6 +1645,13 @@ export declare class FormState<I extends FormInputs = FormInputs> {
|
|
|
1625
1645
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
1626
1646
|
}, "visible"> & {
|
|
1627
1647
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
1648
|
+
}) | ({
|
|
1649
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
1650
|
+
class?: string;
|
|
1651
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
1652
|
+
currencies?: readonly string[];
|
|
1653
|
+
} & {
|
|
1654
|
+
type: "test-money";
|
|
1628
1655
|
}) ? T_10["type"] : never : never : never> | null; } : never) & (((({ [K_3 in keyof I]: I[K_3] extends infer T_6 ? T_6 extends I[K_3] ? T_6 extends FormGroup<infer Inputs extends import("./form.js").FormGroupInputs> ? (T_6 extends infer T_7 ? T_7 extends T_6 ? T_7 extends {
|
|
1629
1656
|
visible: infer Visibility;
|
|
1630
1657
|
} ? boolean extends Visibility ? true : Extract<Visibility, false | ((value: FormValueRecord) => boolean)> extends never ? false : true : false : never : never) extends true ? { [K_6 in keyof Inputs]: Omit<Inputs[K_6], "visible"> & {
|
|
@@ -2431,6 +2458,13 @@ export declare class FormState<I extends FormInputs = FormInputs> {
|
|
|
2431
2458
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
2432
2459
|
}, "visible"> & {
|
|
2433
2460
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
2461
|
+
}) | ({
|
|
2462
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
2463
|
+
class?: string;
|
|
2464
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
2465
|
+
currencies?: readonly string[];
|
|
2466
|
+
} & {
|
|
2467
|
+
type: "test-money";
|
|
2434
2468
|
}) ? T_12["type"] : never : never : never>> : FieldValue<Extract<T_4[K_4], import("./form.js").FormValueInput> extends infer T_13 ? T_13 extends Extract<T_4[K_4], import("./form.js").FormValueInput> ? T_13 extends import("./form.js").FormFieldEntry<infer Input extends InputType> ? Input : T_13 extends (Omit<{
|
|
2435
2469
|
type: "time";
|
|
2436
2470
|
} & {
|
|
@@ -3203,10 +3237,17 @@ export declare class FormState<I extends FormInputs = FormInputs> {
|
|
|
3203
3237
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
3204
3238
|
}, "visible"> & {
|
|
3205
3239
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
3240
|
+
}) | ({
|
|
3241
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
3242
|
+
class?: string;
|
|
3243
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
3244
|
+
currencies?: readonly string[];
|
|
3245
|
+
} & {
|
|
3246
|
+
type: "test-money";
|
|
3206
3247
|
}) ? T_13["type"] : never : never : never> | null) | undefined; } : never) extends infer T ? { [K in keyof T]: T[K]; } : never>;
|
|
3207
3248
|
constructor(options: FormStateOptions<I>);
|
|
3208
|
-
registerField<T extends
|
|
3209
|
-
updateFieldValue<T extends
|
|
3249
|
+
registerField<T extends FieldType>(field: FieldState<T>): () => void;
|
|
3250
|
+
updateFieldValue<T extends FieldType>(field: FieldState<T>, notify?: boolean): void;
|
|
3210
3251
|
keyboardNavigation: Attachment<HTMLElement>;
|
|
3211
3252
|
private handleKeydown;
|
|
3212
3253
|
isInputVisible(name: string): boolean;
|
|
@@ -2,6 +2,7 @@ import { setContext, untrack } from 'svelte';
|
|
|
2
2
|
import { on } from 'svelte/events';
|
|
3
3
|
import { SvelteMap, SvelteSet } from 'svelte/reactivity';
|
|
4
4
|
import { flattenFormInputs, getFormValueInputType } from './form.js';
|
|
5
|
+
import { getFormInputDefinition } from './form.registry.js';
|
|
5
6
|
import { isFieldVisible } from './visibility.js';
|
|
6
7
|
const focusableControl = 'input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
|
|
7
8
|
const enterNavigationInputTypes = new Set([
|
|
@@ -220,8 +221,8 @@ export class FormState {
|
|
|
220
221
|
}
|
|
221
222
|
for (const { name, input } of definitions) {
|
|
222
223
|
const inputType = getFormValueInputType(input);
|
|
223
|
-
if (!supportedInputTypes.has(inputType)) {
|
|
224
|
-
throw new Error(`Form field "${name}" uses unsupported input type "${String(inputType)}".`);
|
|
224
|
+
if (!supportedInputTypes.has(inputType) && !getFormInputDefinition(inputType)) {
|
|
225
|
+
throw new Error(`Form field "${name}" uses unsupported input type "${String(inputType)}". Register app-defined types with registerFormInputs().`);
|
|
225
226
|
}
|
|
226
227
|
if (!hasOwn(externalValue, name))
|
|
227
228
|
continue;
|
|
@@ -3,6 +3,7 @@ export { Ask, ask } from '../Ask/index.js';
|
|
|
3
3
|
export type { AskButton, AskDialogOptions, AskOptions, AskProps, AskResult } from '../Ask/index.js';
|
|
4
4
|
export type { FormLayout, FormProps, FormVariant } from './form.props.js';
|
|
5
5
|
export { FormState } from './form.state.svelte.js';
|
|
6
|
+
export { registerFormInputs, type FormInputDefinitions } from './form.registry.js';
|
|
6
7
|
export type { FieldLabelPosition } from '../Field/field.js';
|
|
7
8
|
export { formTheme, setFormTheme, useFormTheme, type FormTheme, type FormThemeProps } from './form.theme.js';
|
|
8
|
-
export type { FormInput, FormAction, FormActionInput, FormCustomInput, FormInputAction, FormInputState, FormFieldController, FormFieldInput, FormFieldEntry, FormGroup, FormGroupColumns, FormGroupInputs, FormInputsWithState, FormInputs, FormRenderableInput, FormValueInput, FlattenFormInputs, InferFormValue, LiveFormValue, FormSubmitHandler, MaybePromise } from './form.js';
|
|
9
|
+
export type { FormInput, FormAction, FormActionInput, FormCustomInput, FormInputAction, FormInputState, FormFieldController, FormFieldInput, FormFieldEntry, FormInputComponentProps, FormInputDefinition, FormInputRegistry, FormRegisteredInput, FormGroup, FormGroupColumns, FormGroupInputs, FormInputsWithState, FormInputs, FormRenderableInput, FormValueInput, FlattenFormInputs, InferFormValue, LiveFormValue, FormSubmitHandler, MaybePromise } from './form.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Form } from './Form.svelte';
|
|
2
2
|
export { Ask, ask } from '../Ask/index.js';
|
|
3
3
|
export { FormState } from './form.state.svelte.js';
|
|
4
|
+
export { registerFormInputs } from './form.registry.js';
|
|
4
5
|
export { formTheme, setFormTheme, useFormTheme } from './form.theme.js';
|
|
@@ -4801,21 +4801,6 @@ export declare function prepareInputProps(input: FormFieldInput, size: Sizes, la
|
|
|
4801
4801
|
name?: string | undefined;
|
|
4802
4802
|
label?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4803
4803
|
items: import("../TagGroup/tagGroup.props.js").TagGroupOption[];
|
|
4804
|
-
header?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4805
|
-
actions?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4806
|
-
description?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4807
|
-
helper?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4808
|
-
footer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4809
|
-
errorsContainer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4810
|
-
onValueChange?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => void) | undefined;
|
|
4811
|
-
defaultValue?: import("../TagGroup/tagGroup.props.js").TagGroupValue | undefined;
|
|
4812
|
-
required?: boolean | undefined;
|
|
4813
|
-
density?: import("../../../types/theme.js").Density | undefined;
|
|
4814
|
-
labelPosition?: FieldLabelPosition;
|
|
4815
|
-
onValidate?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => string[] | boolean) | undefined;
|
|
4816
|
-
fieldAttrs?: import("../Field/field.js").FieldAttributes | undefined;
|
|
4817
|
-
errors?: string[] | boolean | undefined;
|
|
4818
|
-
focused?: boolean | undefined;
|
|
4819
4804
|
field?: {
|
|
4820
4805
|
name: string;
|
|
4821
4806
|
size: Sizes;
|
|
@@ -4831,6 +4816,7 @@ export declare function prepareInputProps(input: FormFieldInput, size: Sizes, la
|
|
|
4831
4816
|
get controlAttrs(): import("../Field/field.state.svelte.js").FieldControlAttributes;
|
|
4832
4817
|
setValue: (nextValue: import("../Field/field.js").FieldValue<T> | null | undefined) => void;
|
|
4833
4818
|
syncValue: (nextValue: import("../Field/field.js").FieldValue<T> | null | undefined) => void;
|
|
4819
|
+
get definition(): import("./form.registry.js").RegisteredFormInputDefinition | undefined;
|
|
4834
4820
|
checkSchema(value?: string | string[] | null | undefined): import("valibot", { with: { "resolution-mode": "require" } }).SafeParseResult<import("valibot", { with: { "resolution-mode": "require" } }).BaseSchema<unknown, unknown, import("valibot", { with: { "resolution-mode": "require" } }).BaseIssue<unknown>>>;
|
|
4835
4821
|
get isValid(): boolean;
|
|
4836
4822
|
validate: (value?: import("../Field/field.js").FieldValue<T> | null | undefined) => readonly [boolean, unknown];
|
|
@@ -4845,6 +4831,21 @@ export declare function prepareInputProps(input: FormFieldInput, size: Sizes, la
|
|
|
4845
4831
|
onValueChange?: ((value: string | string[] | null) => void) | undefined;
|
|
4846
4832
|
id: string;
|
|
4847
4833
|
} | undefined;
|
|
4834
|
+
header?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4835
|
+
actions?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4836
|
+
description?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4837
|
+
helper?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4838
|
+
footer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4839
|
+
errorsContainer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
4840
|
+
onValueChange?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => void) | undefined;
|
|
4841
|
+
defaultValue?: import("../TagGroup/tagGroup.props.js").TagGroupValue | undefined;
|
|
4842
|
+
required?: boolean | undefined;
|
|
4843
|
+
density?: import("../../../types/theme.js").Density | undefined;
|
|
4844
|
+
labelPosition?: FieldLabelPosition;
|
|
4845
|
+
onValidate?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => string[] | boolean) | undefined;
|
|
4846
|
+
fieldAttrs?: import("../Field/field.js").FieldAttributes | undefined;
|
|
4847
|
+
errors?: string[] | boolean | undefined;
|
|
4848
|
+
focused?: boolean | undefined;
|
|
4848
4849
|
labelFor?: string | false | undefined;
|
|
4849
4850
|
multiple?: boolean | undefined;
|
|
4850
4851
|
unselectedColor?: import("../../../types/theme.js").Colors | undefined;
|
|
@@ -10417,21 +10418,6 @@ export declare function prepareInputProps(input: FormFieldInput, size: Sizes, la
|
|
|
10417
10418
|
name?: string | undefined;
|
|
10418
10419
|
label?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10419
10420
|
items: import("../TagGroup/tagGroup.props.js").TagGroupOption[];
|
|
10420
|
-
header?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10421
|
-
actions?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10422
|
-
description?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10423
|
-
helper?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10424
|
-
footer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10425
|
-
errorsContainer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10426
|
-
onValueChange?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => void) | undefined;
|
|
10427
|
-
defaultValue?: import("../TagGroup/tagGroup.props.js").TagGroupValue | undefined;
|
|
10428
|
-
required?: boolean | undefined;
|
|
10429
|
-
density?: import("../../../types/theme.js").Density | undefined;
|
|
10430
|
-
labelPosition?: FieldLabelPosition;
|
|
10431
|
-
onValidate?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => string[] | boolean) | undefined;
|
|
10432
|
-
fieldAttrs?: import("../Field/field.js").FieldAttributes | undefined;
|
|
10433
|
-
errors?: string[] | boolean | undefined;
|
|
10434
|
-
focused?: boolean | undefined;
|
|
10435
10421
|
field?: {
|
|
10436
10422
|
name: string;
|
|
10437
10423
|
size: Sizes;
|
|
@@ -10447,6 +10433,7 @@ export declare function prepareInputProps(input: FormFieldInput, size: Sizes, la
|
|
|
10447
10433
|
get controlAttrs(): import("../Field/field.state.svelte.js").FieldControlAttributes;
|
|
10448
10434
|
setValue: (nextValue: import("../Field/field.js").FieldValue<T> | null | undefined) => void;
|
|
10449
10435
|
syncValue: (nextValue: import("../Field/field.js").FieldValue<T> | null | undefined) => void;
|
|
10436
|
+
get definition(): import("./form.registry.js").RegisteredFormInputDefinition | undefined;
|
|
10450
10437
|
checkSchema(value?: string | string[] | null | undefined): import("valibot", { with: { "resolution-mode": "require" } }).SafeParseResult<import("valibot", { with: { "resolution-mode": "require" } }).BaseSchema<unknown, unknown, import("valibot", { with: { "resolution-mode": "require" } }).BaseIssue<unknown>>>;
|
|
10451
10438
|
get isValid(): boolean;
|
|
10452
10439
|
validate: (value?: import("../Field/field.js").FieldValue<T> | null | undefined) => readonly [boolean, unknown];
|
|
@@ -10461,6 +10448,21 @@ export declare function prepareInputProps(input: FormFieldInput, size: Sizes, la
|
|
|
10461
10448
|
onValueChange?: ((value: string | string[] | null) => void) | undefined;
|
|
10462
10449
|
id: string;
|
|
10463
10450
|
} | undefined;
|
|
10451
|
+
header?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10452
|
+
actions?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10453
|
+
description?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10454
|
+
helper?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10455
|
+
footer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10456
|
+
errorsContainer?: import("../../Slot/slot.js").Slot<undefined> | undefined;
|
|
10457
|
+
onValueChange?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => void) | undefined;
|
|
10458
|
+
defaultValue?: import("../TagGroup/tagGroup.props.js").TagGroupValue | undefined;
|
|
10459
|
+
required?: boolean | undefined;
|
|
10460
|
+
density?: import("../../../types/theme.js").Density | undefined;
|
|
10461
|
+
labelPosition?: FieldLabelPosition;
|
|
10462
|
+
onValidate?: ((value: import("../TagGroup/tagGroup.props.js").TagGroupValue) => string[] | boolean) | undefined;
|
|
10463
|
+
fieldAttrs?: import("../Field/field.js").FieldAttributes | undefined;
|
|
10464
|
+
errors?: string[] | boolean | undefined;
|
|
10465
|
+
focused?: boolean | undefined;
|
|
10464
10466
|
labelFor?: string | false | undefined;
|
|
10465
10467
|
multiple?: boolean | undefined;
|
|
10466
10468
|
unselectedColor?: import("../../../types/theme.js").Colors | undefined;
|
|
@@ -833,6 +833,13 @@ export declare class MultiStepFormState<I extends MultiStepFormItems = FormStep[
|
|
|
833
833
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
834
834
|
}, "visible"> & {
|
|
835
835
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
836
|
+
}) | ({
|
|
837
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
838
|
+
class?: string;
|
|
839
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
840
|
+
currencies?: readonly string[];
|
|
841
|
+
} & {
|
|
842
|
+
type: "test-money";
|
|
836
843
|
}) ? T_15["type"] : never : never : never>> : import("../Field/field.js").FieldValue<Extract<T_1[K_1], import("../Form/form.js").FormValueInput> extends infer T_16 ? T_16 extends Extract<T_1[K_1], import("../Form/form.js").FormValueInput> ? T_16 extends import("../Form/form.js").FormFieldEntry<infer Input extends import("../Field/field.js").InputType> ? Input : T_16 extends (Omit<{
|
|
837
844
|
type: "time";
|
|
838
845
|
} & {
|
|
@@ -1605,6 +1612,13 @@ export declare class MultiStepFormState<I extends MultiStepFormItems = FormStep[
|
|
|
1605
1612
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
1606
1613
|
}, "visible"> & {
|
|
1607
1614
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
1615
|
+
}) | ({
|
|
1616
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
1617
|
+
class?: string;
|
|
1618
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
1619
|
+
currencies?: readonly string[];
|
|
1620
|
+
} & {
|
|
1621
|
+
type: "test-money";
|
|
1608
1622
|
}) ? T_16["type"] : never : never : never> | null; } : never) & (((((MergedMultiStepFormInputs<I> extends infer T_8 extends FormInputs ? { [K_3 in keyof T_8]: T_8[K_3] extends infer T_9 ? T_9 extends T_8[K_3] ? T_9 extends import("../Form/form.js").FormGroup<infer Inputs extends import("../Form/form.js").FormGroupInputs> ? (T_9 extends infer T_10 ? T_10 extends T_9 ? T_10 extends {
|
|
1609
1623
|
visible: infer Visibility;
|
|
1610
1624
|
} ? boolean extends Visibility ? true : Extract<Visibility, false | ((value: FormValueRecord) => boolean)> extends never ? false : true : false : never : never) extends true ? { [K_6 in keyof Inputs]: Omit<Inputs[K_6], "visible"> & {
|
|
@@ -2411,6 +2425,13 @@ export declare class MultiStepFormState<I extends MultiStepFormItems = FormStep[
|
|
|
2411
2425
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
2412
2426
|
}, "visible"> & {
|
|
2413
2427
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
2428
|
+
}) | ({
|
|
2429
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
2430
|
+
class?: string;
|
|
2431
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
2432
|
+
currencies?: readonly string[];
|
|
2433
|
+
} & {
|
|
2434
|
+
type: "test-money";
|
|
2414
2435
|
}) ? T_20["type"] : never : never : never>> : import("../Field/field.js").FieldValue<Extract<T_6[K_4], import("../Form/form.js").FormValueInput> extends infer T_21 ? T_21 extends Extract<T_6[K_4], import("../Form/form.js").FormValueInput> ? T_21 extends import("../Form/form.js").FormFieldEntry<infer Input extends import("../Field/field.js").InputType> ? Input : T_21 extends (Omit<{
|
|
2415
2436
|
type: "time";
|
|
2416
2437
|
} & {
|
|
@@ -3183,6 +3204,13 @@ export declare class MultiStepFormState<I extends MultiStepFormItems = FormStep[
|
|
|
3183
3204
|
theme?: import("../PinInput/pinInput.theme.js").PinInputThemeProps & import("../Field/field.js").InputProps<"pin">["theme"];
|
|
3184
3205
|
}, "visible"> & {
|
|
3185
3206
|
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
3207
|
+
}) | ({
|
|
3208
|
+
visible?: boolean | ((value: FormValueRecord) => boolean);
|
|
3209
|
+
class?: string;
|
|
3210
|
+
} & Omit<import("../Field/field.js").InputProps<"test-money">, "class" | "name" | "visible"> & {
|
|
3211
|
+
currencies?: readonly string[];
|
|
3212
|
+
} & {
|
|
3213
|
+
type: "test-money";
|
|
3186
3214
|
}) ? T_21["type"] : never : never : never> | null) | undefined; } : never) extends infer T ? { [K in keyof T]: T[K]; } : never>;
|
|
3187
3215
|
progress: {
|
|
3188
3216
|
value: number;
|
|
@@ -617,7 +617,7 @@ export declare const componentInventory: readonly [{
|
|
|
617
617
|
readonly id: "form";
|
|
618
618
|
readonly subpath: "entasis/form";
|
|
619
619
|
readonly sourceIndex: "src/lib/components/Form/Form/index.ts";
|
|
620
|
-
readonly exportedSymbols: readonly ["Ask", "AskButton", "AskDialogOptions", "AskOptions", "AskProps", "AskResult", "FieldLabelPosition", "FlattenFormInputs", "Form", "FormAction", "FormActionInput", "FormCustomInput", "FormFieldController", "FormFieldEntry", "FormFieldInput", "FormGroup", "FormGroupColumns", "FormGroupInputs", "FormInput", "FormInputAction", "FormInputState", "FormInputs", "FormInputsWithState", "FormLayout", "FormProps", "FormRenderableInput", "FormState", "FormSubmitHandler", "FormTheme", "FormThemeProps", "FormValueInput", "FormVariant", "InferFormValue", "LiveFormValue", "MaybePromise", "ask", "formTheme", "setFormTheme", "useFormTheme"];
|
|
620
|
+
readonly exportedSymbols: readonly ["Ask", "AskButton", "AskDialogOptions", "AskOptions", "AskProps", "AskResult", "FieldLabelPosition", "FlattenFormInputs", "Form", "FormAction", "FormActionInput", "FormCustomInput", "FormFieldController", "FormFieldEntry", "FormFieldInput", "FormGroup", "FormGroupColumns", "FormGroupInputs", "FormInput", "FormInputAction", "FormInputComponentProps", "FormInputDefinition", "FormInputDefinitions", "FormInputRegistry", "FormInputState", "FormInputs", "FormInputsWithState", "FormLayout", "FormProps", "FormRegisteredInput", "FormRenderableInput", "FormState", "FormSubmitHandler", "FormTheme", "FormThemeProps", "FormValueInput", "FormVariant", "InferFormValue", "LiveFormValue", "MaybePromise", "ask", "formTheme", "registerFormInputs", "setFormTheme", "useFormTheme"];
|
|
621
621
|
readonly docs: readonly [{
|
|
622
622
|
readonly id: "form";
|
|
623
623
|
readonly route: "/components/form";
|
|
@@ -1491,11 +1491,16 @@ export const componentInventory = [
|
|
|
1491
1491
|
'FormGroupInputs',
|
|
1492
1492
|
'FormInput',
|
|
1493
1493
|
'FormInputAction',
|
|
1494
|
+
'FormInputComponentProps',
|
|
1495
|
+
'FormInputDefinition',
|
|
1496
|
+
'FormInputDefinitions',
|
|
1497
|
+
'FormInputRegistry',
|
|
1494
1498
|
'FormInputState',
|
|
1495
1499
|
'FormInputs',
|
|
1496
1500
|
'FormInputsWithState',
|
|
1497
1501
|
'FormLayout',
|
|
1498
1502
|
'FormProps',
|
|
1503
|
+
'FormRegisteredInput',
|
|
1499
1504
|
'FormRenderableInput',
|
|
1500
1505
|
'FormState',
|
|
1501
1506
|
'FormSubmitHandler',
|
|
@@ -1508,6 +1513,7 @@ export const componentInventory = [
|
|
|
1508
1513
|
'MaybePromise',
|
|
1509
1514
|
'ask',
|
|
1510
1515
|
'formTheme',
|
|
1516
|
+
'registerFormInputs',
|
|
1511
1517
|
'setFormTheme',
|
|
1512
1518
|
'useFormTheme'
|
|
1513
1519
|
],
|