react-luna-form 0.0.86 → 0.0.88
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/README.md +15 -10
- package/dist/client/cjs/index.js +2 -1
- package/dist/client/esm/index.js +2 -1
- package/dist/config/cjs/index.js +1 -1
- package/dist/config/esm/index.js +1 -1
- package/dist/schema/cjs/index.js +1 -1
- package/dist/schema/esm/index.js +1 -1
- package/dist/server/cjs/index.js +1 -1
- package/dist/server/esm/index.js +1 -1
- package/dist/types/luna-core/handle/source-event.d.ts +2 -1
- package/dist/types/luna-core/handle/value-event.d.ts +2 -1
- package/dist/types/luna-core/helper/input.d.ts +16 -7
- package/dist/types/luna-core/type.d.ts +15 -4
- package/dist/types/luna-core/util/constant.d.ts +4 -0
- package/dist/types/luna-core/util/date.d.ts +132 -6
- package/dist/types/luna-core/util/extract.d.ts +21 -0
- package/dist/types/luna-core/util/format.d.ts +11 -0
- package/dist/types/luna-core/util/is-input.d.ts +3 -2
- package/dist/types/luna-core/util/pattern.d.ts +28 -0
- package/dist/types/luna-core/util/prepare.d.ts +3 -2
- package/dist/types/luna-core/util/schema.d.ts +2 -1
- package/dist/types/luna-core/util/string.d.ts +7 -0
- package/dist/types/luna-react/src/client/component/field/field-list-preview-item.d.ts +3 -3
- package/dist/types/luna-react/src/client/component/field/field-preview-item.d.ts +4 -2
- package/dist/types/luna-react/src/client/component/field/field-preview-value.d.ts +4 -1
- package/dist/types/luna-react/src/client/component/field/field-preview.d.ts +6 -4
- package/dist/types/luna-react/src/{component → client/component}/field/field-set-advanced.d.ts +1 -1
- package/dist/types/luna-react/src/client/component/field/field-set.d.ts +11 -0
- package/dist/types/luna-react/src/client/component/field/field.d.ts +20 -11
- package/dist/types/luna-react/src/client/component/field-description.d.ts +2 -0
- package/dist/types/luna-react/src/{component → client/component}/formatted-description.d.ts +3 -3
- package/dist/types/luna-react/src/client/component/guard/list-guard.d.ts +1 -1
- package/dist/types/luna-react/src/client/component/input-strategies.d.ts +10 -2
- package/dist/types/luna-react/src/client/component/slot/slot.d.ts +1 -2
- package/dist/types/luna-react/src/client/hook/use-entry-atom.d.ts +18 -0
- package/dist/types/luna-react/src/client/hook/use-input-core.d.ts +4 -4
- package/dist/types/luna-react/src/client/hook/use-latest.d.ts +22 -0
- package/dist/types/luna-react/src/client/hook/use-live-item-value.d.ts +17 -3
- package/dist/types/luna-react/src/client/hook/use-value.d.ts +1 -1
- package/dist/types/luna-react/src/client/lib/error-store.d.ts +3 -4
- package/dist/types/luna-react/src/client/lib/host-value-store.d.ts +13 -15
- package/dist/types/luna-react/src/client/lib/list-store.d.ts +0 -2
- package/dist/types/luna-react/src/client/lib/resolve-value.d.ts +0 -5
- package/dist/types/luna-react/src/client/lib/source-store.d.ts +7 -4
- package/dist/types/luna-react/src/client/lib/state-store.d.ts +0 -4
- package/dist/types/luna-react/src/client/lib/store-helper.d.ts +5 -15
- package/dist/types/luna-react/src/client/lib/value-store.d.ts +0 -4
- package/dist/types/luna-react/src/component/column.d.ts +4 -2
- package/dist/types/luna-react/src/component/description.d.ts +9 -0
- package/dist/types/luna-react/src/component/field/field-list.d.ts +2 -3
- package/dist/types/luna-react/src/component/field/{field-set.d.ts → field-set-static.d.ts} +1 -1
- package/dist/types/luna-react/src/component/field/field.d.ts +4 -4
- package/dist/types/luna-react/src/component/field-description.d.ts +5 -4
- package/dist/types/luna-react/src/component/form.d.ts +10 -0
- package/dist/types/luna-react/src/component/input/input-base.d.ts +3 -3
- package/dist/types/luna-react/src/component/input-group.d.ts +4 -2
- package/dist/types/luna-react/src/component/input-label.d.ts +4 -2
- package/dist/types/luna-react/src/component/slot/list-slot.d.ts +1 -1
- package/dist/types/luna-react/src/component/slot/slot-base.d.ts +4 -3
- package/dist/types/luna-react/src/component/slot/slot-create.d.ts +2 -3
- package/dist/types/luna-react/src/component/slot/slot-list.d.ts +2 -3
- package/dist/types/luna-react/src/component/slot/slot.d.ts +1 -2
- package/dist/types/luna-react/src/config/index.d.ts +1 -0
- package/dist/types/luna-react/src/lib/visibility.d.ts +3 -0
- package/dist/types/luna-react/src/server/component/field.d.ts +2 -0
- package/dist/types/luna-react/src/server/component/input.d.ts +2 -2
- package/dist/types/luna-react/src/server/component/list-slot.d.ts +2 -0
- package/dist/types/luna-react/src/server/component/slot.d.ts +14 -0
- package/dist/types/luna-react/src/type.d.ts +2 -1
- package/docs/events/change.md +4 -1
- package/docs/fields/custom-inputs.md +153 -4
- package/docs/fields/data-source.md +5 -3
- package/docs/fields/input.md +175 -3
- package/docs/fields/list.md +1 -1
- package/docs/fields/specialized-selectors.md +51 -12
- package/docs/forms/submit.md +13 -14
- package/docs/index.md +2 -1
- package/docs/interpolation/format-filters.md +28 -29
- package/docs/interpolation/overview.md +44 -14
- package/docs/setup.md +56 -35
- package/docs/structure/definition.md +45 -6
- package/docs/validation/overview.md +15 -12
- package/package.json +5 -5
- package/dist/types/luna-react/src/client/component/field/field-with-state.d.ts +0 -13
- package/dist/types/luna-react/src/client/hook/use-format.d.ts +0 -5
|
@@ -2,6 +2,13 @@ import type { Nullable } from '../../../../luna-core/index';
|
|
|
2
2
|
export declare const hostValueAtom: import("jotai").PrimitiveAtom<Nullable<Record<string, unknown>>> & {
|
|
3
3
|
init: Nullable<Record<string, unknown>>;
|
|
4
4
|
};
|
|
5
|
+
/** What the host says about one field, with the sentinel already read. */
|
|
6
|
+
export type HostEntry = {
|
|
7
|
+
/** The host names this field. A field it does not name reads `undefined`. */
|
|
8
|
+
found: boolean;
|
|
9
|
+
value: unknown;
|
|
10
|
+
};
|
|
11
|
+
export declare function readHostEntry(entry: unknown): HostEntry;
|
|
5
12
|
/**
|
|
6
13
|
* One field's entry in that record.
|
|
7
14
|
*
|
|
@@ -12,19 +19,10 @@ export declare const hostValueAtom: import("jotai").PrimitiveAtom<Nullable<Recor
|
|
|
12
19
|
* read; doing it at the call site is what keeps this correct where a memo
|
|
13
20
|
* comparator could not be. See `ListPathContext`.
|
|
14
21
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* 23 and this one stays at 29, its high-water mark. Worth knowing before
|
|
21
|
-
* someone reads the absence of a release as an oversight.
|
|
22
|
+
* Made by whoever subscribes rather than cached by name, so it goes with the
|
|
23
|
+
* component that asked: a family kept one per name for the life of the page,
|
|
24
|
+
* and this one was never released at all -- 110 keys after ten definitions of
|
|
25
|
+
* ten fields. See `useEntryAtom` for the same move on the records a field
|
|
26
|
+
* writes into.
|
|
22
27
|
*/
|
|
23
|
-
|
|
24
|
-
export type HostEntry = {
|
|
25
|
-
/** The host names this field. A field it does not name reads `undefined`. */
|
|
26
|
-
found: boolean;
|
|
27
|
-
value: unknown;
|
|
28
|
-
};
|
|
29
|
-
export declare function readHostEntry(entry: unknown): HostEntry;
|
|
30
|
-
export declare const hostEntryAtom: import("jotai-family").AtomFamily<string, import("jotai").Atom<unknown>>;
|
|
28
|
+
export declare function hostEntryAtom(name: string): import("jotai").Atom<unknown>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const pendingListRowsAtom: import("jotai").PrimitiveAtom<Record<string, Record<string, unknown>[]>> & {
|
|
2
2
|
init: Record<string, Record<string, unknown>[]>;
|
|
3
3
|
};
|
|
4
|
-
export declare const reportPendingListRowsAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<Record<string, unknown>[] | undefined, [newValue: Record<string, unknown>[] | undefined], void>>;
|
|
5
4
|
/**
|
|
6
5
|
* What a list on screen is holding: the stable ids of its live rows, in the
|
|
7
6
|
* order they are shown, and the name of every leaf a row owns.
|
|
@@ -37,4 +36,3 @@ export type MountedList = {
|
|
|
37
36
|
export declare const mountedListsAtom: import("jotai").PrimitiveAtom<Record<string, MountedList>> & {
|
|
38
37
|
init: Record<string, MountedList>;
|
|
39
38
|
};
|
|
40
|
-
export declare const reportMountedListAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<MountedList | undefined, [newValue: MountedList | undefined], void>>;
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export type Entry = {
|
|
2
|
-
found: boolean;
|
|
3
|
-
value: unknown;
|
|
4
|
-
};
|
|
5
|
-
export declare function resolveEntry(name: string, currentValue: Record<string, unknown> | unknown[]): Entry;
|
|
6
1
|
export declare function resolveValue(name: string, currentValue: Record<string, unknown> | unknown[]): unknown;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type DataSource } from '../../../../luna-core/index';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
init: null;
|
|
2
|
+
export declare const sourceAtom: import("jotai").PrimitiveAtom<Record<string, Record<string, DataSource>>> & {
|
|
3
|
+
init: Record<string, Record<string, DataSource>>;
|
|
5
4
|
};
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const SOURCE_OPTIONS: {
|
|
6
|
+
readonly merge: (values: DataSource[]) => DataSource | undefined;
|
|
7
|
+
readonly validateTarget: (target: string) => boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const clearInputSourceAtom: import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
|
|
7
10
|
init: null;
|
|
8
11
|
};
|
|
@@ -2,7 +2,3 @@ import type { FieldState } from '../../../../luna-core/index';
|
|
|
2
2
|
export declare const fieldStateAtom: import("jotai").PrimitiveAtom<Record<string, FieldState>> & {
|
|
3
3
|
init: Record<string, FieldState>;
|
|
4
4
|
};
|
|
5
|
-
export declare const releaseFieldStateAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
|
|
6
|
-
init: null;
|
|
7
|
-
};
|
|
8
|
-
export declare const reportFieldStateAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<FieldState | undefined, [newValue: FieldState | undefined], void>>;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { type PrimitiveAtom } from 'jotai';
|
|
2
|
-
type NestedAtomFamilyOptions<TInner> = {
|
|
3
|
-
merge?: (values: TInner[]) => TInner | undefined;
|
|
4
|
-
validateTarget?: (target: string) => boolean;
|
|
5
|
-
};
|
|
6
2
|
export declare function omitKey<T extends Record<string, unknown>>(obj: T, key: string): T;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
3
|
+
export declare function createEntryAtom<T>(base: PrimitiveAtom<Record<string, T>>, name: string): import("jotai").WritableAtom<NonNullable<T> | undefined, [next: T | undefined], void>;
|
|
4
|
+
export declare function createContributionAtom<T>(base: PrimitiveAtom<Record<string, Record<string, T>>>, name: string, options: Readonly<{
|
|
5
|
+
merge: (values: T[]) => T | undefined;
|
|
6
|
+
validateTarget: (target: string) => boolean;
|
|
7
|
+
}>): import("jotai").WritableAtom<T | undefined, [target: string, value: T | undefined], void>;
|
|
13
8
|
export declare function createNestedClearAtom<TInner>(baseAtom: PrimitiveAtom<Record<string, Record<string, TInner>>>): import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
|
|
14
9
|
init: null;
|
|
15
10
|
};
|
|
@@ -26,9 +21,4 @@ export declare function createAtomStore<T>(initialValue?: Record<string, T>): {
|
|
|
26
21
|
bulkReport: import("jotai").WritableAtom<null, [newValue: Record<string, T>], void> & {
|
|
27
22
|
init: null;
|
|
28
23
|
};
|
|
29
|
-
release: import("jotai").WritableAtom<null, [names: string[]], void> & {
|
|
30
|
-
init: null;
|
|
31
|
-
};
|
|
32
|
-
report: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<NonNullable<T> | undefined, [newValue: T | undefined], void>>;
|
|
33
24
|
};
|
|
34
|
-
export {};
|
|
@@ -7,10 +7,6 @@ export declare const clearAllValueAtom: import("jotai").WritableAtom<null, [], v
|
|
|
7
7
|
export declare const clearInputValueAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
|
|
8
8
|
init: null;
|
|
9
9
|
};
|
|
10
|
-
export declare const releaseInputValueAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
|
|
11
|
-
init: null;
|
|
12
|
-
};
|
|
13
|
-
export declare const reportValueAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<{} | undefined, [newValue: unknown], void>>;
|
|
14
10
|
export declare const appliedAutoFillAtom: import("jotai").PrimitiveAtom<Record<string, unknown>> & {
|
|
15
11
|
init: Record<string, unknown>;
|
|
16
12
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DescriptionTextProps } from './description';
|
|
2
|
+
import { type Column, type Localization } from '../../../luna-core/index';
|
|
2
3
|
import type { Config } from '../type';
|
|
3
4
|
export declare function Column(props: Readonly<{
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
column?: Column;
|
|
6
7
|
config?: Config;
|
|
7
8
|
context?: Record<string, unknown>;
|
|
8
|
-
|
|
9
|
+
description?: React.ComponentType<DescriptionTextProps>;
|
|
10
|
+
localization?: Localization;
|
|
9
11
|
}>): import("react").JSX.Element;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import { type Description as DescriptionType, type Localization } from '../../../luna-core/index';
|
|
2
|
+
import type { Config } from '../type';
|
|
1
3
|
export declare function Description(props: Readonly<{
|
|
2
4
|
children: string | React.ReactNode;
|
|
3
5
|
title?: string;
|
|
4
6
|
}>): import("react").JSX.Element;
|
|
7
|
+
export type DescriptionTextProps = Readonly<{
|
|
8
|
+
config?: Config;
|
|
9
|
+
context?: Record<string, unknown>;
|
|
10
|
+
localization?: Localization;
|
|
11
|
+
text?: DescriptionType;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function DescriptionText(props: DescriptionTextProps): import("react").JSX.Element | null;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type List, type Nullable } from '../../../../luna-core/index';
|
|
1
|
+
import { type List, type Nullable, type Localization } from '../../../../luna-core/index';
|
|
2
2
|
export type ListProps = Readonly<{
|
|
3
3
|
children: (index: number) => React.ReactNode;
|
|
4
4
|
field: List;
|
|
5
|
-
lang?: string;
|
|
6
5
|
onValueChange?: (input: {
|
|
7
6
|
name: string;
|
|
8
7
|
value: unknown;
|
|
9
8
|
}) => void;
|
|
10
|
-
|
|
9
|
+
localization?: Localization;
|
|
11
10
|
value?: Nullable<Record<string, unknown>>;
|
|
12
11
|
}>;
|
|
13
12
|
export declare function FieldList(props: ListProps): import("react").JSX.Element[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type Field, type Style } from '../../../../luna-core/index';
|
|
1
|
+
import { type Field, type Style, type Localization } from '../../../../luna-core/index';
|
|
2
2
|
import type { Children } from '../../type';
|
|
3
3
|
export type FieldProps = Readonly<{
|
|
4
4
|
children: Children;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
errors?:
|
|
6
|
+
errors?: string[];
|
|
7
7
|
field: Field;
|
|
8
|
-
|
|
8
|
+
now?: string;
|
|
9
9
|
style?: Style;
|
|
10
|
-
|
|
10
|
+
localization?: Localization;
|
|
11
11
|
}>;
|
|
12
12
|
export declare function Field(props: FieldProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Config } from '../type';
|
|
2
|
-
import type { Field } from '../../../luna-core/index';
|
|
3
|
-
export
|
|
2
|
+
import type { Field, Localization } from '../../../luna-core/index';
|
|
3
|
+
export type DescriptionProps = Readonly<{
|
|
4
4
|
config?: Config;
|
|
5
5
|
context?: Record<string, unknown>;
|
|
6
6
|
field: Field;
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
localization?: Localization;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function StaticDescription(props: DescriptionProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { StaticFieldSet } from './field/field-set-static';
|
|
1
2
|
import { type Definition, type Sections } from '../../../luna-core/index';
|
|
2
3
|
import type { Config, Control, Slot } from '../type';
|
|
4
|
+
import type { Fields } from '../../../luna-core/index';
|
|
3
5
|
import type { FormEvent } from 'react';
|
|
6
|
+
export type GuardProps = Readonly<{
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
fields: Fields;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function StaticGuard(props: GuardProps): import("react").ReactNode;
|
|
4
11
|
export declare function Form(props: Readonly<{
|
|
5
12
|
advanced?: {
|
|
6
13
|
step?: boolean;
|
|
@@ -8,8 +15,11 @@ export declare function Form(props: Readonly<{
|
|
|
8
15
|
action?: (formData: FormData) => void;
|
|
9
16
|
children: Slot;
|
|
10
17
|
config: Config;
|
|
18
|
+
context?: Record<string, unknown>;
|
|
11
19
|
control?: Control;
|
|
12
20
|
definition?: Definition;
|
|
21
|
+
fieldSet?: React.ComponentType<React.ComponentProps<typeof StaticFieldSet>>;
|
|
22
|
+
guard?: React.ComponentType<GuardProps>;
|
|
13
23
|
isPending?: boolean;
|
|
14
24
|
noValidate?: boolean;
|
|
15
25
|
onSubmit?: (event: FormEvent<HTMLFormElement>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Field } from '../../../../luna-core/index';
|
|
1
|
+
import { type Field, type Localization } from '../../../../luna-core/index';
|
|
2
2
|
import type { Children } from '../../type';
|
|
3
3
|
export declare function InputBase(props: Readonly<{
|
|
4
4
|
children: Children;
|
|
@@ -6,7 +6,7 @@ export declare function InputBase(props: Readonly<{
|
|
|
6
6
|
errors?: string[];
|
|
7
7
|
field: Field;
|
|
8
8
|
horizontal?: boolean;
|
|
9
|
-
|
|
9
|
+
localization?: Localization;
|
|
10
|
+
now?: string;
|
|
10
11
|
readOnly?: boolean;
|
|
11
|
-
translations?: Record<string, string>;
|
|
12
12
|
}>): import("react").ReactNode;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { type DescriptionProps } from './field-description';
|
|
1
2
|
import type { Config } from '../type';
|
|
2
|
-
import type { Field } from '../../../luna-core/index';
|
|
3
|
+
import type { Field, Localization } from '../../../luna-core/index';
|
|
3
4
|
export declare function InputGroup(props: Readonly<{
|
|
4
5
|
children: React.ReactNode;
|
|
5
6
|
config?: Config;
|
|
6
7
|
context?: Record<string, unknown>;
|
|
8
|
+
description?: React.ComponentType<DescriptionProps>;
|
|
7
9
|
field: Field;
|
|
8
10
|
horizontal?: boolean;
|
|
9
|
-
|
|
11
|
+
localization?: Localization;
|
|
10
12
|
}>): import("react").JSX.Element;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DescriptionProps } from './field-description';
|
|
2
|
+
import { type Field, type Localization } from '../../../luna-core/index';
|
|
2
3
|
import type { Config } from '../type';
|
|
3
4
|
export declare function InputLabel(props: Readonly<{
|
|
4
5
|
config?: Config;
|
|
5
6
|
context?: Record<string, unknown>;
|
|
7
|
+
description?: React.ComponentType<DescriptionProps>;
|
|
6
8
|
field: Field;
|
|
7
9
|
horizontal?: boolean;
|
|
8
|
-
|
|
10
|
+
localization?: Localization;
|
|
9
11
|
}>): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ListProps } from '../field/field-list';
|
|
2
|
-
export declare function ListSlot({ children, field,
|
|
2
|
+
export declare function ListSlot({ children, field, localization, value }: ListProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { type Fields, type Nullable, type Style } from '../../../../luna-core/index';
|
|
1
|
+
import { type Fields, type Nullable, type Style, type Localization } from '../../../../luna-core/index';
|
|
2
|
+
import type { DescriptionTextProps } from '../description';
|
|
2
3
|
import type { Children, Config } from '../../type';
|
|
3
4
|
import type { FieldProps } from '../field/field';
|
|
4
5
|
import type { ListProps } from '../field/field-list';
|
|
5
6
|
export type SlotComponents = {
|
|
7
|
+
description?: React.ComponentType<DescriptionTextProps>;
|
|
6
8
|
field: React.ComponentType<FieldProps>;
|
|
7
9
|
list: React.ComponentType<ListProps>;
|
|
8
10
|
};
|
|
@@ -13,12 +15,11 @@ export declare function SlotBase(props: Readonly<{
|
|
|
13
15
|
context?: Record<string, unknown>;
|
|
14
16
|
disabled?: boolean;
|
|
15
17
|
fields?: Fields;
|
|
16
|
-
lang?: string;
|
|
17
18
|
onValueChange?: (input: {
|
|
18
19
|
name: string;
|
|
19
20
|
value: unknown;
|
|
20
21
|
}) => void;
|
|
21
22
|
style?: Style;
|
|
22
|
-
|
|
23
|
+
localization?: Localization;
|
|
23
24
|
value?: Nullable<Record<string, unknown>>;
|
|
24
25
|
}>): import("react").JSX.Element[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Children, Config } from '../../type';
|
|
2
|
-
import type { Fields, Nullable, Style } from '../../../../luna-core/index';
|
|
2
|
+
import type { Fields, Localization, Nullable, Style } from '../../../../luna-core/index';
|
|
3
3
|
import type { SlotComponents } from './slot-base';
|
|
4
4
|
export declare function createSlot(components: SlotComponents): (props: Readonly<{
|
|
5
5
|
children: Children;
|
|
@@ -7,12 +7,11 @@ export declare function createSlot(components: SlotComponents): (props: Readonly
|
|
|
7
7
|
context?: Record<string, unknown>;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
fields?: Fields;
|
|
10
|
-
lang?: string;
|
|
11
10
|
onValueChange?: (input: {
|
|
12
11
|
name: string;
|
|
13
12
|
value: unknown;
|
|
14
13
|
}) => void;
|
|
15
14
|
style?: Style;
|
|
16
|
-
|
|
15
|
+
localization?: Localization;
|
|
17
16
|
value?: Nullable<Record<string, unknown>>;
|
|
18
17
|
}>) => import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type List, type Nullable, type Style } from '../../../../luna-core/index';
|
|
1
|
+
import { type List, type Nullable, type Style, type Localization } from '../../../../luna-core/index';
|
|
2
2
|
import { type SlotComponents } from './slot-base';
|
|
3
3
|
import type { Children, Config } from '../../type';
|
|
4
4
|
export declare function SlotList(props: Readonly<{
|
|
@@ -9,12 +9,11 @@ export declare function SlotList(props: Readonly<{
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
field: List;
|
|
11
11
|
index: number;
|
|
12
|
-
lang?: string;
|
|
13
12
|
onValueChange?: (input: {
|
|
14
13
|
name: string;
|
|
15
14
|
value: unknown;
|
|
16
15
|
}) => void;
|
|
17
16
|
style?: Style;
|
|
18
|
-
|
|
17
|
+
localization?: Localization;
|
|
19
18
|
value?: Nullable<Record<string, unknown>>;
|
|
20
19
|
}>): import("react").JSX.Element;
|
|
@@ -4,12 +4,11 @@ export declare const Slot: (props: Readonly<{
|
|
|
4
4
|
context?: Record<string, unknown>;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
fields?: import('../../../../luna-core/index').Fields;
|
|
7
|
-
lang?: string;
|
|
8
7
|
onValueChange?: (input: {
|
|
9
8
|
name: string;
|
|
10
9
|
value: unknown;
|
|
11
10
|
}) => void;
|
|
12
11
|
style?: import('../../../../luna-core/index').Style;
|
|
13
|
-
|
|
12
|
+
localization?: import('../../../../luna-core/index').Localization;
|
|
14
13
|
value?: import('../../../../luna-core/index').Nullable<Record<string, unknown>>;
|
|
15
14
|
}>) => import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Environment, type Protocol } from '../../../luna-core/index';
|
|
2
2
|
import type { AlertProps, Config, InputConfig } from '../type';
|
|
3
|
+
export { readDateProps, type DateProps } from '../../../luna-core/index';
|
|
3
4
|
export declare function defineConfig<T extends React.ElementType>(options: Readonly<{
|
|
4
5
|
alert?: React.ComponentType<AlertProps>;
|
|
5
6
|
env?: Environment;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Field, FieldState, Fields, List } from '../../../luna-core/index';
|
|
2
|
+
export declare function isEntryHidden(entry: Fields[number], states: Record<string, FieldState>): boolean;
|
|
3
|
+
export declare function isGuardHidden(states: Record<string, FieldState>, fields: Fields, container?: Field | List): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AriaAttributes, type CommonProps, type DataAttributes, type Field } from '../../../../luna-core/index';
|
|
1
|
+
import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Localization } from '../../../../luna-core/index';
|
|
2
2
|
import type { Config } from '../../type';
|
|
3
3
|
export declare function Input(props: Readonly<{
|
|
4
4
|
ariaAttributes?: AriaAttributes;
|
|
@@ -8,6 +8,6 @@ export declare function Input(props: Readonly<{
|
|
|
8
8
|
dataAttributes?: DataAttributes;
|
|
9
9
|
field: Field;
|
|
10
10
|
horizontal?: boolean;
|
|
11
|
-
|
|
11
|
+
localization?: Localization;
|
|
12
12
|
value?: Record<string, unknown>;
|
|
13
13
|
}>): import("react").ReactNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Slot: (props: Readonly<{
|
|
2
|
+
children: import("../../type").Children;
|
|
3
|
+
config: import("../../type").Config;
|
|
4
|
+
context?: Record<string, unknown>;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
fields?: import('../../../../luna-core/index').Fields;
|
|
7
|
+
onValueChange?: (input: {
|
|
8
|
+
name: string;
|
|
9
|
+
value: unknown;
|
|
10
|
+
}) => void;
|
|
11
|
+
style?: import('../../../../luna-core/index').Style;
|
|
12
|
+
localization?: import('../../../../luna-core/index').Localization;
|
|
13
|
+
value?: import('../../../../luna-core/index').Nullable<Record<string, unknown>>;
|
|
14
|
+
}>) => import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AriaAttributes, BaseConfig, CommonProps, DataAttributes, Field, Fields, FormStateError } from '../../luna-core/index';
|
|
1
|
+
import type { AriaAttributes, BaseConfig, CommonProps, DataAttributes, Field, Fields, FormStateError, Localization } from '../../luna-core/index';
|
|
2
2
|
export type Slot = (props: {
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
fields?: Fields;
|
|
@@ -12,6 +12,7 @@ export type Children = (props: {
|
|
|
12
12
|
dataAttributes?: DataAttributes;
|
|
13
13
|
field: Field;
|
|
14
14
|
horizontal?: boolean;
|
|
15
|
+
localization?: Localization;
|
|
15
16
|
readOnly?: boolean;
|
|
16
17
|
}) => React.ReactNode;
|
|
17
18
|
export type InputConfig<T extends React.ElementType> = {
|
package/docs/events/change.md
CHANGED
|
@@ -189,7 +189,7 @@ The `state` action modifies the interactive state or visibility of other fields
|
|
|
189
189
|
- `action` (string): Must be set to `"state"`.
|
|
190
190
|
- `target` (string | array of strings): The field name, or an array of field names, that the state modifications should be applied to.
|
|
191
191
|
- `state` (object): An object containing the new state to apply. Properties are independent of field names — the form may safely contain a field whose `name` is `"description"`, `"disabled"` or `"hidden"`; `target` identifies the field, the keys inside `state` configure it.
|
|
192
|
-
- `disabled` (boolean, optional): Whether the field should be disabled.
|
|
192
|
+
- `disabled` (boolean, optional): Whether the field should be disabled. While the condition holds it takes the place of the field's own `disabled`, in either direction: `false` enables a field declared `"disabled": true`. Once the condition stops holding, the field's own `disabled` applies again.
|
|
193
193
|
- `hidden` (boolean, optional): Whether the field should be hidden from view. **Note:** When a field becomes hidden (`hidden: true`), its current value is automatically cleared from the form state to ensure no non-applicable data is submitted. See [What clearing a hidden target means](#what-clearing-a-hidden-target-means).
|
|
194
194
|
- `description` (string | object, optional): A new description to render for the target field. Supports interpolation, format filters, and **Markdown** (specifically links). e.g. `"Check our [terms](https://example.com) for details."`.
|
|
195
195
|
- `when` (string | array of strings | [Condition object](#the-condition-object), optional): A condition that specifies when this state should be applied.
|
|
@@ -409,6 +409,9 @@ Two details:
|
|
|
409
409
|
`source`, the initial run is held until the data has loaded, so an action
|
|
410
410
|
keyed on the selected entity sees the entity rather than a bare value. Text
|
|
411
411
|
and date fields run as soon as the value is valid.
|
|
412
|
+
- **A date range carries its pair.** A [range](../fields/input.md#a-range-of-days)
|
|
413
|
+
runs its events with `[from, to]`, at mount and on a click alike: `{value}` is
|
|
414
|
+
that pair.
|
|
412
415
|
- **A `chips` field carries its array, not an entity.** No single option answers
|
|
413
416
|
to a value that can hold several, so a `chips` change carries the array
|
|
414
417
|
itself, at mount and on a click alike: `{value}` is that array, and there is
|