@ostack.tech/ui-kform 1.2.0-beta.0 → 1.2.0-beta.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.
Files changed (97) hide show
  1. package/dist/chunks/{en-D4xMcf6Q.js → en-BHlLXSzh.js} +4 -16
  2. package/dist/chunks/en-BHlLXSzh.js.map +1 -0
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +5 -17
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +3 -15
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui-kform.js +15299 -4434
  10. package/dist/ostack-ui-kform.js.map +1 -1
  11. package/package.json +16 -14
  12. package/scss/components/Annexes/_Annexes-variables.scss +4 -9
  13. package/scss/components/Annexes/_Annexes.scss +9 -15
  14. package/scss/components/FormApp/_FormApp.scss +1 -4
  15. package/scss/components/FormPages/_FormPages-variables.scss +8 -27
  16. package/scss/components/FormPages/_FormPages.scss +11 -33
  17. package/scss/components/IssuesPanel/_IssuesPanel-variables.scss +3 -8
  18. package/scss/components/IssuesPanel/_IssuesPanel.scss +3 -8
  19. package/types/components/Annexes/Annex.d.ts +26 -37
  20. package/types/components/Annexes/Annexes.d.ts +8 -10
  21. package/types/components/Annexes/AnnexesContext.d.ts +1 -1
  22. package/types/components/Annexes/AnnexesManager.d.ts +8 -12
  23. package/types/components/CheckboxControl/CheckboxControl.d.ts +9 -19
  24. package/types/components/CheckboxGroupControl/CheckboxGroupControl.d.ts +14 -31
  25. package/types/components/CheckboxGroupControl/CheckboxGroupControlItem.d.ts +1 -2
  26. package/types/components/ControlField/ControlField.d.ts +6 -6
  27. package/types/components/DateControl/DateControl.d.ts +13 -18
  28. package/types/components/DateRangeControl/DateRangeControl.d.ts +16 -22
  29. package/types/components/DebugInfo/DebugInfo.d.ts +3 -4
  30. package/types/components/DebugInfo/DebugInfoControlAddonTrigger.d.ts +1 -1
  31. package/types/components/FileControl/FileControl.d.ts +16 -22
  32. package/types/components/FileControl/FileControlDownloadAddon.d.ts +2 -2
  33. package/types/components/FileControl/FileControlViewAddon.d.ts +1 -1
  34. package/types/components/FormApp/FormApp.d.ts +25 -34
  35. package/types/components/FormApp/FormAppContext.d.ts +20 -44
  36. package/types/components/FormApp/FormAppIssueMessages.d.ts +6 -8
  37. package/types/components/FormApp/FormAppStatus.d.ts +1 -1
  38. package/types/components/FormPages/FormPage.d.ts +12 -20
  39. package/types/components/FormPages/FormPages.d.ts +8 -17
  40. package/types/components/FormPages/FormPagesContext.d.ts +1 -1
  41. package/types/components/FormPages/FormPagesNavigation.d.ts +3 -3
  42. package/types/components/FormStepper/FormStep.d.ts +8 -9
  43. package/types/components/FormStepper/FormStepper.d.ts +14 -18
  44. package/types/components/FormStepper/FormStepperContext.d.ts +1 -1
  45. package/types/components/IssueMessage/IssueMessage.d.ts +1 -1
  46. package/types/components/IssueMessages/IssueMessages.d.ts +17 -25
  47. package/types/components/IssuesPanel/IssuesPanel.d.ts +11 -15
  48. package/types/components/IssuesPanel/IssuesPanelControls.d.ts +1 -1
  49. package/types/components/IssuesPopover/IssuesPopover.d.ts +4 -4
  50. package/types/components/LoadAction/LoadAction.d.ts +7 -10
  51. package/types/components/NumericControl/NumericControl.d.ts +15 -21
  52. package/types/components/PathLink/PathLink.d.ts +4 -5
  53. package/types/components/PrintAction/PrintAction.d.ts +7 -11
  54. package/types/components/RadioGroupControl/RadioGroupControl.d.ts +12 -21
  55. package/types/components/RadioGroupControl/RadioGroupControlItem.d.ts +2 -2
  56. package/types/components/ResetOnChange/ResetOnChange.d.ts +6 -14
  57. package/types/components/ResetOnChange/index.d.ts +1 -1
  58. package/types/components/ResetOnChange/useResetOnChange.d.ts +22 -32
  59. package/types/components/SaveAction/SaveAction.d.ts +22 -30
  60. package/types/components/SelectControl/SelectControl.d.ts +11 -21
  61. package/types/components/SelectControl/SelectControlItem.d.ts +2 -2
  62. package/types/components/SelectControl/SelectControlItemGroup.d.ts +2 -3
  63. package/types/components/SelectMultipleControl/SelectMultipleControl.d.ts +17 -35
  64. package/types/components/SelectMultipleControl/SelectMultipleControlItem.d.ts +1 -2
  65. package/types/components/SelectMultipleControl/SelectMultipleControlItemGroup.d.ts +2 -2
  66. package/types/components/SubmitAction/SubmitAction.d.ts +19 -33
  67. package/types/components/TableControl/TableControl.d.ts +27 -41
  68. package/types/components/TableControl/TableControlActionsColumn.d.ts +3 -5
  69. package/types/components/TableControl/TableControlAddRowTrigger.d.ts +7 -13
  70. package/types/components/TableControl/TableControlApi.d.ts +4 -4
  71. package/types/components/TableControl/TableControlColumn.d.ts +5 -8
  72. package/types/components/TableControl/TableControlColumnFns.d.ts +21 -31
  73. package/types/components/TableControl/TableControlColumnGroup.d.ts +3 -6
  74. package/types/components/TableControl/TableControlColumns.d.ts +4 -4
  75. package/types/components/TableControl/TableControlContent.d.ts +1 -1
  76. package/types/components/TableControl/TableControlIndexColumn.d.ts +2 -2
  77. package/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +9 -16
  78. package/types/components/TextControl/TextControl.d.ts +7 -13
  79. package/types/components/UnknownValue/UnknownValue.d.ts +1 -1
  80. package/types/components/ValidateAction/ValidateAction.d.ts +7 -10
  81. package/types/providers/ActivePathProvider/ActivePathProvider.d.ts +4 -7
  82. package/types/providers/LocalizationProvider/LocalizationProvider.d.ts +1 -4
  83. package/types/providers/LocalizationProvider/useLocale.d.ts +1 -4
  84. package/types/providers/PrefixSuffixProvider/PrefixSuffixProvider.d.ts +1 -1
  85. package/types/providers/PrefixSuffixProvider/defaultPrefixSuffix.d.ts +3 -3
  86. package/types/providers/PrefixSuffixProvider/usePrefix.d.ts +1 -4
  87. package/types/utils/mostSpecificPath.d.ts +4 -6
  88. package/types/utils/pathSpecificity.d.ts +7 -8
  89. package/types/utils/selectionTransformations.d.ts +2 -8
  90. package/types/utils/useControlAutofocus.d.ts +6 -8
  91. package/types/utils/useControlIssues.d.ts +4 -4
  92. package/types/utils/useFormLoader.d.ts +24 -31
  93. package/types/utils/useFormSaver.d.ts +29 -34
  94. package/types/utils/useFormValidator.d.ts +13 -20
  95. package/types/utils/useRegisterControl.d.ts +1 -1
  96. package/types/utils/useTemporalStringTransformer.d.ts +4 -10
  97. package/dist/chunks/en-D4xMcf6Q.js.map +0 -1
@@ -5,16 +5,13 @@ export declare const DEFAULT_LOAD_KEYBINDS = "$mod+O";
5
5
  /** Properties of the load action. */
6
6
  export interface LoadActionProps<T = unknown> extends Partial<ActionButtonProps>, Omit<FormLoaderOptions<T>, "id"> {
7
7
  /**
8
- * Keybinds for triggering the action. Set to `null` to disable the keyboard
9
- * shortcut.
8
+ * Keybinds for triggering the action. Set to `null` to disable the keyboard shortcut.
10
9
  *
11
- * Keyboard handling is built on top of the
12
- * [`tinykeys`](https://jamiebuilds.github.io/tinykeys) library. For
13
- * information on keybinding syntax, read the [`tinykeys`
10
+ * Keyboard handling is built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)
11
+ * library. For information on keybinding syntax, read the [`tinykeys`
14
12
  * documentation](https://github.com/jamiebuilds/tinykeys).
15
13
  *
16
- * Defaults to the keybinds defined by the current locale or to
17
- * {@link DEFAULT_LOAD_KEYBINDS}.
14
+ * Defaults to the keybinds defined by the current locale or to {@link DEFAULT_LOAD_KEYBINDS}.
18
15
  */
19
16
  keybinds?: string | string[] | null;
20
17
  /**
@@ -24,8 +21,8 @@ export interface LoadActionProps<T = unknown> extends Partial<ActionButtonProps>
24
21
  */
25
22
  showWhenReadOnly?: boolean;
26
23
  /**
27
- * By specifying a filesystem ID, the user agent can remember different
28
- * directories for different IDs.
24
+ * By specifying a filesystem ID, the user agent can remember different directories for different
25
+ * IDs.
29
26
  */
30
27
  fileSystemId?: string;
31
28
  }
@@ -49,4 +46,4 @@ export interface LoadActionProps<T = unknown> extends Partial<ActionButtonProps>
49
46
  * }
50
47
  * ```
51
48
  */
52
- export declare function LoadAction<T = unknown>({ label, keybinds, showWhenReadOnly, fileSystemId, loading, disabled, onClick, decode, path, extensions, mimeTypes, description, startIn, onBeforeLoad, onAfterLoad, setPristineOnLoad, setTouchedOnLoad, validateOnLoad, successMessage, errorMessage, ...otherProps }: LoadActionProps<T>): false | import("react").JSX.Element | undefined;
49
+ export declare function LoadAction<T = unknown>({ label: labelProp, keybinds: keybindsProp, showWhenReadOnly, fileSystemId, loading, disabled, onClick, decode, path, extensions, mimeTypes, description, startIn, onBeforeLoad, onAfterLoad, setPristineOnLoad, setTouchedOnLoad, validateOnLoad, successMessage, errorMessage, ...otherProps }: LoadActionProps<T>): false | import("react").JSX.Element | undefined;
@@ -1,10 +1,10 @@
1
1
  import type { Path } from "@ostack.tech/kform";
2
2
  import { type Numeric, type NumericInputController, type NumericInputOptions } from "@ostack.tech/kform-react";
3
- import { NumericInput, type NumericInputProps } from "@ostack.tech/ui";
4
- import { type ComponentRef, type ReactNode, type Ref } from "react";
3
+ import { type NumericInputProps } from "@ostack.tech/ui";
4
+ import { type ReactNode, type Ref } from "react";
5
5
  import type { IssueMessagesByCode, IssueMessagesProps } from "../IssueMessages";
6
6
  /** Properties of the numeric control component. */
7
- export interface NumericControlProps<T extends Numeric | null = Numeric | null> extends Omit<NumericInputOptions<T, string, ComponentRef<typeof NumericInput>>, "enabled" | "formatFromString" | "parseToString">, Omit<NumericInputProps, "defaultValue" | "value" | "onValueChange" | "valueIsUnformattedString" | "status" | "validate" | "validationMode"> {
7
+ export interface NumericControlProps<T extends Numeric | null = Numeric | null> extends Omit<NumericInputOptions<T>, "enabled" | "formatFromString" | "parseToString">, Omit<NumericInputProps, "defaultValue" | "value" | "onValueChange" | "valueIsUnformattedString" | "status" | "validate" | "validationMode"> {
8
8
  /** Path to the value. */
9
9
  path?: string | Path;
10
10
  /**
@@ -14,8 +14,7 @@ export interface NumericControlProps<T extends Numeric | null = Numeric | null>
14
14
  */
15
15
  issueMessages?: IssueMessagesByCode;
16
16
  /**
17
- * Label to use in the issues panel when displaying issues associated with
18
- * this field.
17
+ * Label to use in the issues panel when displaying issues associated with this field.
19
18
  *
20
19
  * This label has priority over the field's `Label`.
21
20
  */
@@ -27,28 +26,25 @@ export interface NumericControlProps<T extends Numeric | null = Numeric | null>
27
26
  */
28
27
  displayIssues?: boolean;
29
28
  /**
30
- * Whether to prevent the auto-focusing behaviour that causes this control to
31
- * be focused when the form app's `focus` is called with this control's path.
29
+ * Whether to prevent the auto-focusing behaviour that causes this control to be focused when the
30
+ * form app's `focus` is called with this control's path.
32
31
  *
33
- * Preventing this behaviour is useful when multiple controls for the same
34
- * path are rendered at once, and only one of them should be focused.
32
+ * Preventing this behaviour is useful when multiple controls for the same path are rendered at
33
+ * once, and only one of them should be focused.
35
34
  *
36
35
  * @default false
37
36
  */
38
37
  preventAutoFocus?: boolean;
39
- /**
40
- * Whether to show debug information. This property has no effect in
41
- * production builds.
42
- */
38
+ /** Whether to show debug information. This property has no effect in production builds. */
43
39
  debug?: boolean;
44
40
  /** Reference to the control's API. */
45
- apiRef?: Ref<NumericInputController<T, string, ComponentRef<typeof NumericInput>> | undefined>;
41
+ apiRef?: Ref<NumericInputController<T> | undefined>;
46
42
  /** Properties to pass to the `IssueMessages` component. */
47
43
  issueMessagesProps?: Omit<IssueMessagesProps, "path" | "issues" | "messages" | "unwrapped">;
48
44
  }
49
45
  /**
50
- * The numeric control component is a KForm form control for values with
51
- * (typically nullable) numeric schemas. It is built on top of the
46
+ * The numeric control component is a KForm form control for values with (typically nullable)
47
+ * numeric schemas. It is built on top of the
52
48
  * [`NumericInput`](/docs/ostack-ui-forms-numeric-input--docs) component.
53
49
  *
54
50
  * The following (typically
@@ -75,8 +71,8 @@ export interface NumericControlProps<T extends Numeric | null = Numeric | null>
75
71
  * - [`Scale`](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.validations/-scale/index.html)/[`MaxScale`](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.validations/-max-scale/index.html):
76
72
  * Sets the `scale` property.
77
73
  *
78
- * The `valueIsInteger` property is further automatically set for integer
79
- * schemas (`Byte`, `Char`, `Short`, `Int`, `Long`, and `BigInteger`).
74
+ * The `valueIsInteger` property is further automatically set for integer schemas (`Byte`, `Char`,
75
+ * `Short`, `Int`, `Long`, and `BigInteger`).
80
76
  *
81
77
  * Example usage:
82
78
  *
@@ -84,9 +80,7 @@ export interface NumericControlProps<T extends Numeric | null = Numeric | null>
84
80
  * import { NumericControl } from "@ostack.tech/ui-kform";
85
81
  *
86
82
  * function QuantityControl() {
87
- * return (
88
- * <NumericControl path="/quantity" placeholder="Number of items…" />
89
- * );
83
+ * return <NumericControl path="/quantity" placeholder="Number of items…" />;
90
84
  * }
91
85
  * ```
92
86
  */
@@ -10,9 +10,8 @@ export interface PathLinkOwnProps extends LinkOwnProps {
10
10
  to: string | Path;
11
11
  }
12
12
  /**
13
- * The path link component creates a link (although typically rendered as a
14
- * `<button>`) to a part of the form identified by the provided path. It is
15
- * built on top of the [`Link`
13
+ * The path link component creates a link (although typically rendered as a `<button>`) to a part of
14
+ * the form identified by the provided path. It is built on top of the [`Link`
16
15
  * component](/docs/ostack-ui-typography-link--docs).
17
16
  *
18
17
  * Example usage:
@@ -24,8 +23,8 @@ export interface PathLinkOwnProps extends LinkOwnProps {
24
23
  * function ProfileNotice() {
25
24
  * return (
26
25
  * <Alert>
27
- * Your profile URL will be generated using your handle. To change it,
28
- * update your <PathLink to="/username">username</PathLink>.
26
+ * Your profile URL will be generated using your handle. To change it, update your{" "}
27
+ * <PathLink to="/username">username</PathLink>.
29
28
  * </Alert>
30
29
  * );
31
30
  * }
@@ -4,16 +4,13 @@ export declare const DEFAULT_PRINT_KEYBINDS = "$mod+P";
4
4
  /** Properties of the print action. */
5
5
  export interface PrintActionProps extends Partial<ActionButtonProps> {
6
6
  /**
7
- * Keybinds for triggering the action. Set to `null` to disable the keyboard
8
- * shortcut.
7
+ * Keybinds for triggering the action. Set to `null` to disable the keyboard shortcut.
9
8
  *
10
- * Keyboard handling is built on top of the
11
- * [`tinykeys`](https://jamiebuilds.github.io/tinykeys) library. For
12
- * information on keybinding syntax, read the [`tinykeys`
9
+ * Keyboard handling is built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)
10
+ * library. For information on keybinding syntax, read the [`tinykeys`
13
11
  * documentation](https://github.com/jamiebuilds/tinykeys).
14
12
  *
15
- * Defaults to the keybinds defined by the current locale or to
16
- * `DEFAULT_PRINT_KEYBINDS`.
13
+ * Defaults to the keybinds defined by the current locale or to `DEFAULT_PRINT_KEYBINDS`.
17
14
  */
18
15
  keybinds?: string | string[] | null;
19
16
  /**
@@ -28,9 +25,8 @@ export interface PrintActionProps extends Partial<ActionButtonProps> {
28
25
  * [`Button`](/docs/ostack-ui-forms-button--docs) and
29
26
  * [`PrinterTrigger`](/docs/ostack-ui-utilities-printer--docs) components.
30
27
  *
31
- * To print a whole form application, requires the `<FormApp>` component to be
32
- * wrapped within a `<Printer>`, and for the `<PrinterContent>` to wrap all
33
- * annexes, pages, and form controls.
28
+ * To print a whole form application, requires the `<FormApp>` component to be wrapped within a
29
+ * `<Printer>`, and for the `<PrinterContent>` to wrap all annexes, pages, and form controls.
34
30
  *
35
31
  * Example usage:
36
32
  *
@@ -63,4 +59,4 @@ export interface PrintActionProps extends Partial<ActionButtonProps> {
63
59
  * }
64
60
  * ```
65
61
  */
66
- export declare function PrintAction({ label, keybinds, showWhenReadOnly, disabled, loading, onClick, ...otherProps }: PrintActionProps): false | import("react").JSX.Element;
62
+ export declare function PrintAction({ label: labelProp, keybinds: keybindsProp, showWhenReadOnly, disabled, loading, onClick, ...otherProps }: PrintActionProps): false | import("react").JSX.Element;
@@ -17,8 +17,7 @@ export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T
17
17
  */
18
18
  issueMessages?: IssueMessagesByCode;
19
19
  /**
20
- * Label to use in the issues panel when displaying issues associated with
21
- * this field.
20
+ * Label to use in the issues panel when displaying issues associated with this field.
22
21
  *
23
22
  * This label has priority over the field's `Label`.
24
23
  */
@@ -32,21 +31,18 @@ export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T
32
31
  /** Label shown when the control's value isn't one of the existing options. */
33
32
  unknownValueLabel?: ReactNode;
34
33
  /**
35
- * Whether to prevent the auto-focusing behaviour that causes this control to
36
- * be focused when the form app's `focus` is called with this control's path.
34
+ * Whether to prevent the auto-focusing behaviour that causes this control to be focused when the
35
+ * form app's `focus` is called with this control's path.
37
36
  *
38
- * Preventing this behaviour is useful when multiple controls for the same
39
- * path are rendered at once, and only one of them should be focused.
37
+ * Preventing this behaviour is useful when multiple controls for the same path are rendered at
38
+ * once, and only one of them should be focused.
40
39
  *
41
40
  * @default false
42
41
  */
43
42
  preventAutoFocus?: boolean;
44
43
  /** Radio group control children. */
45
44
  children?: ReactNode;
46
- /**
47
- * Whether to show debug information. This property has no effect in
48
- * production builds.
49
- */
45
+ /** Whether to show debug information. This property has no effect in production builds. */
50
46
  debug?: boolean;
51
47
  /** Reference to the control's API. */
52
48
  apiRef?: Ref<InputController<T, string, ComponentRef<typeof RadioGroup>> | undefined>;
@@ -54,16 +50,14 @@ export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T
54
50
  issueMessagesProps?: Omit<IssueMessagesProps, "path" | "issues" | "messages" | "unwrapped">;
55
51
  }
56
52
  /**
57
- * The radio group control component is a KForm form control for values with any
58
- * type of (typically
53
+ * The radio group control component is a KForm form control for values with any type of (typically
59
54
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
60
- * schema. It is built on top of the
61
- * [`RadioGroup`](/docs/ostack-ui-forms-radio-group--docs) component.
55
+ * schema. It is built on top of the [`RadioGroup`](/docs/ostack-ui-forms-radio-group--docs)
56
+ * component.
62
57
  *
63
58
  * It composes the following subcomponent:
64
59
  *
65
- * - `RadioGroupControlItem`: Component used to define an item of the radio group
66
- * control.
60
+ * - `RadioGroupControlItem`: Component used to define an item of the radio group control.
67
61
  *
68
62
  * The following built-in KForm validation affects this control:
69
63
  *
@@ -73,10 +67,7 @@ export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T
73
67
  * Example usage:
74
68
  *
75
69
  * ```tsx
76
- * import {
77
- * RadioGroupControl,
78
- * RadioGroupControlItem,
79
- * } from "@ostack.tech/ui-kform";
70
+ * import { RadioGroupControl, RadioGroupControlItem } from "@ostack.tech/ui-kform";
80
71
  *
81
72
  * function ShirtSizeControl() {
82
73
  * return (
@@ -90,4 +81,4 @@ export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T
90
81
  * }
91
82
  * ```
92
83
  */
93
- export declare function RadioGroupControl<T = unknown>({ path, options, issueMessages, issuesPanelLabel, displayIssues, unknownValueLabel, preventAutoFocus, apiRef, issueMessagesProps, formManager, onInitialized, onFormManagerEvent, onValueChange, onValidationStatusChange, onDisplayStatusChange, onDirtyStatusChange, onTouchedStatusChange, required, loading, showSpinner, disabled, readOnly, showClearButton, endAdornment, onFocus, onBlurToOutside, children, debug, ref, ...otherProps }: RadioGroupControlProps<T>): import("react").JSX.Element;
84
+ export declare function RadioGroupControl<T = unknown>({ path, options: optionsProp, issueMessages, issuesPanelLabel, displayIssues, unknownValueLabel: unknownValueLabelProp, preventAutoFocus, apiRef, issueMessagesProps, formManager, onInitialized, onFormManagerEvent, onValueChange, onValidationStatusChange, onDisplayStatusChange, onDirtyStatusChange, onTouchedStatusChange, required, loading, showSpinner, disabled, readOnly, showClearButton, endAdornment, onFocus, onBlurToOutside, children, debug, ref, ...otherProps }: RadioGroupControlProps<T>): import("react").JSX.Element;
@@ -19,7 +19,7 @@ export interface RadioGroupControlItemProps<T = unknown> extends Omit<RadioGroup
19
19
  /**
20
20
  * Definition of a radio group control item.
21
21
  *
22
- * This component doesn't actually render anything by itself; it is used by the
23
- * `RadioGroupControl` component to automatically create the `options` array.
22
+ * This component doesn't actually render anything by itself; it is used by the `RadioGroupControl`
23
+ * component to automatically create the `options` array.
24
24
  */
25
25
  export declare function RadioGroupControlItem(_props: RadioGroupControlItemProps): null;
@@ -8,15 +8,12 @@ export interface ResetOnChangeProps extends UseResetOnChangeOptions {
8
8
  children?: ReactNode;
9
9
  }
10
10
  /**
11
- * Component used to reset path(s) to their initial value when the value of
12
- * controls within it change (according to the `when` function). Built on top of
13
- * the `useResetOnChange` hook.
11
+ * Component used to reset path(s) to their initial value when the value of controls within it
12
+ * change (according to the `when` function). Built on top of the `useResetOnChange` hook.
14
13
  *
15
- * Optionally requests user-confirmation via alert dialog if `showConfirmation`
16
- * is provided.
14
+ * Optionally requests user-confirmation via alert dialog if `showConfirmation` is provided.
17
15
  *
18
- * When using wildcards in `reset`, certain fields may be excluded via
19
- * `exclude`.
16
+ * When using wildcards in `reset`, certain fields may be excluded via `exclude`.
20
17
  *
21
18
  * Example usage:
22
19
  *
@@ -25,13 +22,8 @@ export interface ResetOnChangeProps extends UseResetOnChangeOptions {
25
22
  *
26
23
  * function SameAddressControl() {
27
24
  * return (
28
- * <ResetOnChange
29
- * reset="/mailingAddress"
30
- * when={({ value }) => Boolean(value)}
31
- * >
32
- * <CheckboxControl path="/sameAddress">
33
- * Same as residential address
34
- * </CheckboxControl>
25
+ * <ResetOnChange reset="/mailingAddress" when={({ value }) => Boolean(value)}>
26
+ * <CheckboxControl path="/sameAddress">Same as residential address</CheckboxControl>
35
27
  * </ResetOnChange>
36
28
  * );
37
29
  * }
@@ -1,3 +1,3 @@
1
1
  export * from "./ResetOnChange.tsx";
2
- export { type ResetOnChangeContextValue, useResetOnChangeContext, } from "./ResetOnChangeContext.ts";
2
+ export { type ResetOnChangeContextValue, useResetOnChangeContext } from "./ResetOnChangeContext.ts";
3
3
  export * from "./useResetOnChange.tsx";
@@ -3,29 +3,29 @@ import { type PrefixedConfirmDialogOptions } from "../../utils/extractConfirmDia
3
3
  /** Options of the `useResetOnChange` hook. */
4
4
  export interface UseResetOnChangeOptions<T = unknown> extends PrefixedConfirmDialogOptions {
5
5
  /**
6
- * Function which determines whether to reset the fields when the value
7
- * changes. By default, fields are reset whenever the value changes.
6
+ * Function which determines whether to reset the fields when the value changes. By default,
7
+ * fields are reset whenever the value changes.
8
8
  *
9
9
  * @param event Value event.
10
10
  */
11
11
  when?: (event: SealedValueEvent<T>) => boolean;
12
12
  /**
13
- * Fields in `reset` that should be excluded from being reset (relative to the
14
- * current path). This is useful when using wildcards in `reset` and you want
15
- * to exclude some of the fields that match the wildcard.
13
+ * Fields in `reset` that should be excluded from being reset (relative to the current path). This
14
+ * is useful when using wildcards in `reset` and you want to exclude some of the fields that match
15
+ * the wildcard.
16
16
  *
17
- * E.g. if the path being reset is `/a/*`, setting `exclude` to `/a/b` will
18
- * reset all children of `/a` except `/a/b`.
17
+ * E.g. if the path being reset is `/a/*`, setting `exclude` to `/a/b` will reset all children of
18
+ * `/a` except `/a/b`.
19
19
  */
20
20
  exclude?: string | Path | (string | Path)[];
21
21
  /**
22
22
  * Whether to show a confirmation message before performing the reset.
23
23
  *
24
- * If the confirmation is cancelled, the event which caused the reset in the
25
- * first place is undone.
24
+ * If the confirmation is cancelled, the event which caused the reset in the first place is
25
+ * undone.
26
26
  *
27
- * This property is `false` by default, but is automatically set to `true` if
28
- * a `confirmDialogMessage` is provided.
27
+ * This property is `false` by default, but is automatically set to `true` if a
28
+ * `confirmDialogMessage` is provided.
29
29
  */
30
30
  showConfirmation?: boolean;
31
31
  /**
@@ -46,23 +46,17 @@ export interface UseResetOnChangeOptions<T = unknown> extends PrefixedConfirmDia
46
46
  /** Event handler returned by the `useResetOnChange` hook. */
47
47
  export type UseResetOnChangeResult = (event: SealedValueEvent<any>) => void;
48
48
  /**
49
- * Hook which returns an `onValueChange` event handler which resets the fields
50
- * at the provided `reset` path(s) to their initial value when a value changes
51
- * (according to the `when` function).
49
+ * Hook which returns an `onValueChange` event handler which resets the fields at the provided
50
+ * `reset` path(s) to their initial value when a value changes (according to the `when` function).
52
51
  *
53
- * Optionally requests user-confirmation via alert dialog if `showConfirmation`
54
- * is provided.
52
+ * Optionally requests user-confirmation via alert dialog if `showConfirmation` is provided.
55
53
  *
56
- * When using wildcards in `reset`, certain fields may be excluded via
57
- * `exclude`.
54
+ * When using wildcards in `reset`, certain fields may be excluded via `exclude`.
58
55
  *
59
56
  * Example usage:
60
57
  *
61
58
  * ```tsx
62
- * import {
63
- * CheckboxControl,
64
- * useResetOnChange,
65
- * } from "@ostack.tech/ui-kform";
59
+ * import { CheckboxControl, useResetOnChange } from "@ostack.tech/ui-kform";
66
60
  *
67
61
  * function NoTransactionsControl() {
68
62
  * const handleOnChange = useResetOnChange("/transactions", {
@@ -70,27 +64,23 @@ export type UseResetOnChangeResult = (event: SealedValueEvent<any>) => void;
70
64
  * confirmDialogTitle: "Confirm no transactions",
71
65
  * confirmDialogMessage: (
72
66
  * <>
73
- * By checking this box, the “Itemised transactions” table will be
74
- * cleared. Are you sure you want to continue?
67
+ * By checking this box, the “Itemised transactions” table will be cleared. Are you sure
68
+ * you want to continue?
75
69
  * </>
76
70
  * ),
77
71
  * confirmDialogOkText: "Confirm",
78
72
  * });
79
73
  *
80
74
  * return (
81
- * <CheckboxControl
82
- * path="/noTransactions"
83
- * onValueChange={handleOnChange}
84
- * >
85
- * I declare that no taxable transactions were performed during this
86
- * filing period.
75
+ * <CheckboxControl path="/noTransactions" onValueChange={handleOnChange}>
76
+ * I declare that no taxable transactions were performed during this filing period.
87
77
  * </CheckboxControl>
88
78
  * );
89
79
  * }
90
80
  * ```
91
81
  *
92
- * @param reset Path(s) to reset when the value changes (relative to the current
93
- * path). Wildcards in paths (`*` or `**`) are supported.
82
+ * @param reset Path(s) to reset when the value changes (relative to the current path). Wildcards in
83
+ * paths (`*` or `**`) are supported.
94
84
  * @param options Hook options. See {@link UseResetOnChangeOptions}.
95
85
  */
96
86
  export declare function useResetOnChange<T = unknown>(reset: string | Path | (string | Path)[], { when, exclude, confirmDialogMessage, showConfirmation, setUntouched, setPristine, undo, ...confirmDialogOptions }?: UseResetOnChangeOptions<T>): UseResetOnChangeResult;
@@ -8,16 +8,13 @@ export declare const DEFAULT_SAVE_AS_KEYBINDS = "$mod+Shift+S";
8
8
  /** Properties of the save action. */
9
9
  export interface SaveActionProps<T = unknown> extends Partial<ActionButtonProps>, Pick<ActionSplitProps, "groupCollapsed" | "buttonGroupProps" | "dropdownMenuGroupProps" | "defaultOpen" | "open" | "onOpenChange" | "modal" | "dropdownMenuContentProps" | "groupLabel">, Omit<FormSaverOptions<T>, "id" | "overwrite"> {
10
10
  /**
11
- * Keybinds for triggering the action. Set to `null` to disable the keyboard
12
- * shortcut.
11
+ * Keybinds for triggering the action. Set to `null` to disable the keyboard shortcut.
13
12
  *
14
- * Keyboard handling is built on top of the
15
- * [`tinykeys`](https://jamiebuilds.github.io/tinykeys) library. For
16
- * information on keybinding syntax, read the [`tinykeys`
13
+ * Keyboard handling is built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)
14
+ * library. For information on keybinding syntax, read the [`tinykeys`
17
15
  * documentation](https://github.com/jamiebuilds/tinykeys).
18
16
  *
19
- * Defaults to the keybinds defined by the current locale or to
20
- * `DEFAULT_SAVE_KEYBINDS`.
17
+ * Defaults to the keybinds defined by the current locale or to `DEFAULT_SAVE_KEYBINDS`.
21
18
  */
22
19
  keybinds?: string | string[] | null;
23
20
  /**
@@ -27,17 +24,16 @@ export interface SaveActionProps<T = unknown> extends Partial<ActionButtonProps>
27
24
  */
28
25
  showWhenReadOnly?: boolean;
29
26
  /**
30
- * By specifying a filesystem ID, the user agent can remember different
31
- * directories for different IDs.
27
+ * By specifying a filesystem ID, the user agent can remember different directories for different
28
+ * IDs.
32
29
  */
33
30
  fileSystemId?: string;
34
31
  /**
35
- * Whether to disable the overwriting behaviour of the “save” button. When
36
- * set, the “save” button will function as the “save as” button and the “save
37
- * as” button will not be rendered.
32
+ * Whether to disable the overwriting behaviour of the “save” button. When set, the “save” button
33
+ * will function as the “save as” button and the “save as” button will not be rendered.
38
34
  *
39
- * This property only affects browsers that support modern file system APIs,
40
- * since other browsers already function in the above-mentioned way.
35
+ * This property only affects browsers that support modern file system APIs, since other browsers
36
+ * already function in the above-mentioned way.
41
37
  *
42
38
  * Defaults to `true` when the form is read-only and `false` otherwise.
43
39
  */
@@ -49,28 +45,26 @@ export interface SaveActionProps<T = unknown> extends Partial<ActionButtonProps>
49
45
  /** Placement of the save options button. */
50
46
  saveOptionsPlacement?: ActionSplitProps["splitPlacement"];
51
47
  /**
52
- * Keybinds for triggering the "save as" sub-action. Set to `null` to disable
53
- * the keyboard shortcut.
48
+ * Keybinds for triggering the "save as" sub-action. Set to `null` to disable the keyboard
49
+ * shortcut.
54
50
  *
55
- * Keyboard handling is built on top of the
56
- * [`tinykeys`](https://jamiebuilds.github.io/tinykeys) library. For
57
- * information on keybinding syntax, read the [`tinykeys`
51
+ * Keyboard handling is built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)
52
+ * library. For information on keybinding syntax, read the [`tinykeys`
58
53
  * documentation](https://github.com/jamiebuilds/tinykeys).
59
54
  *
60
- * Defaults to the keybinds defined by the current locale or to
61
- * `DEFAULT_SAVE_AS_KEYBINDS`.
55
+ * Defaults to the keybinds defined by the current locale or to `DEFAULT_SAVE_AS_KEYBINDS`.
62
56
  */
63
57
  saveAsKeybinds?: string | string[] | null;
64
58
  /** Properties to pass to the save options button component. */
65
59
  saveOptionsProps?: Omit<ActionButtonProps, "label">;
66
60
  }
67
61
  /**
68
- * Form action used to save the form to a file, supporting both overwriting and
69
- * non-overwriting behaviours (i.e. supporting both “save” and “save as”). Built
70
- * on top of the [`ButtonGroup`](/docs/ostack-ui-layout-button-group--docs),
62
+ * Form action used to save the form to a file, supporting both overwriting and non-overwriting
63
+ * behaviours (i.e. supporting both “save” and “save as”). Built on top of the
64
+ * [`ButtonGroup`](/docs/ostack-ui-layout-button-group--docs),
71
65
  * [`Button`](/docs/ostack-ui-forms-button--docs), and
72
- * [`DropdownMenu`](/docs/ostack-ui-overlay-dropdown-menu--docs) components, as
73
- * well as the `useFormSaver` hook.
66
+ * [`DropdownMenu`](/docs/ostack-ui-overlay-dropdown-menu--docs) components, as well as the
67
+ * `useFormSaver` hook.
74
68
  *
75
69
  * Example usage:
76
70
  *
@@ -80,9 +74,7 @@ export interface SaveActionProps<T = unknown> extends Partial<ActionButtonProps>
80
74
  * function SaveForm() {
81
75
  * return (
82
76
  * <SaveAction
83
- * encode={(formValue) =>
84
- * encodeFormToJSON(formValue, { pretty: true })
85
- * }
77
+ * encode={(formValue) => encodeFormToJSON(formValue, { pretty: true })}
86
78
  * mimeTypes={["application/json"]}
87
79
  * extensions={[".json"]}
88
80
  * />
@@ -90,4 +82,4 @@ export interface SaveActionProps<T = unknown> extends Partial<ActionButtonProps>
90
82
  * }
91
83
  * ```
92
84
  */
93
- export declare function SaveAction<T = unknown>({ label, keybinds, showWhenReadOnly, fileSystemId, disableOverwrite, saveOptionsLabel, saveAsLabel, saveAsKeybinds, loading, disabled, onClick, variant, color, path, encode, fileName, extensions, description, mimeTypes, startIn, excludeAcceptAllOption, onBeforeSave, onAfterSave, setPristineOnSave, successMessage, errorMessage, groupCollapsed, defaultOpen, open, onOpenChange, modal, groupLabel, saveOptionsPlacement, buttonGroupProps, saveOptionsProps, dropdownMenuGroupProps, dropdownMenuContentProps, ...otherProps }: SaveActionProps<T>): false | import("react").JSX.Element;
85
+ export declare function SaveAction<T = unknown>({ label: labelProp, keybinds: keybindsProp, showWhenReadOnly, fileSystemId, disableOverwrite: disableOverwriteProp, saveOptionsLabel: saveOptionsLabelProp, saveAsLabel: saveAsLabelProp, saveAsKeybinds: saveAsKeybindsProp, loading, disabled, onClick, variant, color, path, encode, fileName, extensions, description, mimeTypes, startIn, excludeAcceptAllOption, onBeforeSave, onAfterSave, setPristineOnSave, successMessage, errorMessage, groupCollapsed, defaultOpen, open, onOpenChange, modal, groupLabel, saveOptionsPlacement, buttonGroupProps, saveOptionsProps, dropdownMenuGroupProps, dropdownMenuContentProps, ...otherProps }: SaveActionProps<T>): false | import("react").JSX.Element;
@@ -18,8 +18,7 @@ export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, T,
18
18
  */
19
19
  issueMessages?: IssueMessagesByCode;
20
20
  /**
21
- * Label to use in the issues panel when displaying issues associated with
22
- * this field.
21
+ * Label to use in the issues panel when displaying issues associated with this field.
23
22
  *
24
23
  * This label has priority over the field's `Label`.
25
24
  */
@@ -33,21 +32,18 @@ export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, T,
33
32
  /** Label shown when the control's value isn't one of the existing options. */
34
33
  unknownValueLabel?: ReactNode;
35
34
  /**
36
- * Whether to prevent the auto-focusing behaviour that causes this control to
37
- * be focused when the form app's `focus` is called with this control's path.
35
+ * Whether to prevent the auto-focusing behaviour that causes this control to be focused when the
36
+ * form app's `focus` is called with this control's path.
38
37
  *
39
- * Preventing this behaviour is useful when multiple controls for the same
40
- * path are rendered at once, and only one of them should be focused.
38
+ * Preventing this behaviour is useful when multiple controls for the same path are rendered at
39
+ * once, and only one of them should be focused.
41
40
  *
42
41
  * @default false
43
42
  */
44
43
  preventAutoFocus?: boolean;
45
44
  /** Select control children. */
46
45
  children?: ReactNode;
47
- /**
48
- * Whether to show debug information. This property has no effect in
49
- * production builds.
50
- */
46
+ /** Whether to show debug information. This property has no effect in production builds. */
51
47
  debug?: boolean;
52
48
  /** Reference to the control's API. */
53
49
  apiRef?: Ref<InputController<T, string, ComponentRef<typeof Select>> | undefined>;
@@ -55,17 +51,14 @@ export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, T,
55
51
  issueMessagesProps?: Omit<IssueMessagesProps, "path" | "issues" | "messages" | "unwrapped">;
56
52
  }
57
53
  /**
58
- * The select control component is a KForm form control for values with any type
59
- * of (typically
54
+ * The select control component is a KForm form control for values with any type of (typically
60
55
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
61
- * schema. It is built on top of the
62
- * [`Select`](/docs/ostack-ui-forms-select--docs) component.
56
+ * schema. It is built on top of the [`Select`](/docs/ostack-ui-forms-select--docs) component.
63
57
  *
64
58
  * It composes the following subcomponents:
65
59
  *
66
60
  * - `SelectControlItem`: Component used to define an item of the select control.
67
- * - `SelectControlItemGroup`: Component used to define a group of items of the
68
- * select control.
61
+ * - `SelectControlItemGroup`: Component used to define a group of items of the select control.
69
62
  *
70
63
  * The following built-in KForm validation affects this control:
71
64
  *
@@ -79,10 +72,7 @@ export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, T,
79
72
  *
80
73
  * function ShirtSizeControl() {
81
74
  * return (
82
- * <SelectControl
83
- * path="/shirtSize"
84
- * placeholder="Select your shirt size…"
85
- * >
75
+ * <SelectControl path="/shirtSize" placeholder="Select your shirt size…">
86
76
  * <SelectControlItem value="sm">Small</SelectControlItem>
87
77
  * <SelectControlItem value="md">Medium</SelectControlItem>
88
78
  * <SelectControlItem value="lg">Large</SelectControlItem>
@@ -92,4 +82,4 @@ export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, T,
92
82
  * }
93
83
  * ```
94
84
  */
95
- export declare function SelectControl<T = unknown>({ path, options: groupedOptions, issueMessages, issuesPanelLabel, displayIssues, unknownValueLabel, preventAutoFocus, apiRef, issueMessagesProps, formManager, onInitialized, onFormManagerEvent, onValueChange, onValidationStatusChange, onDisplayStatusChange, onDirtyStatusChange, onTouchedStatusChange, required, loading, showSpinner, disabled, readOnly, showClearButton, endAdornment, onFocus, onBlurToOutside, children, debug, ref, ...otherProps }: SelectControlProps<T>): import("react").JSX.Element;
85
+ export declare function SelectControl<T = unknown>({ path, options: optionsProp, issueMessages, issuesPanelLabel, displayIssues, unknownValueLabel: unknownValueLabelProp, preventAutoFocus, apiRef, issueMessagesProps, formManager, onInitialized, onFormManagerEvent, onValueChange, onValidationStatusChange, onDisplayStatusChange, onDirtyStatusChange, onTouchedStatusChange, required, loading, showSpinner, disabled, readOnly, showClearButton, endAdornment, onFocus, onBlurToOutside, children, debug, ref, ...otherProps }: SelectControlProps<T>): import("react").JSX.Element;
@@ -17,7 +17,7 @@ export interface SelectControlItemProps<T = unknown> extends Omit<SelectControlI
17
17
  /**
18
18
  * Definition of a select control item.
19
19
  *
20
- * This component doesn't actually render anything by itself; it is used by the
21
- * `SelectControl` component to automatically create the `options` array.
20
+ * This component doesn't actually render anything by itself; it is used by the `SelectControl`
21
+ * component to automatically create the `options` array.
22
22
  */
23
23
  export declare function SelectControlItem(_props: SelectControlItemProps): null;
@@ -16,8 +16,7 @@ export interface SelectControlItemGroupProps<T = unknown> extends Omit<SelectCon
16
16
  /**
17
17
  * Definition of a select control item group.
18
18
  *
19
- * This component doesn't actually render anything by itself; it is used by the
20
- * `SelectControl` component to automatically create groups of items in the
21
- * `options` array.
19
+ * This component doesn't actually render anything by itself; it is used by the `SelectControl`
20
+ * component to automatically create groups of items in the `options` array.
22
21
  */
23
22
  export declare function SelectControlItemGroup(_props: SelectControlItemGroupProps): null;