@scm-manager/ui-forms 2.42.3 → 2.42.4-20230213-150253
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/.turbo/turbo-build.log +7 -7
- package/build/index.d.ts +105 -38
- package/build/index.js +447 -207
- package/build/index.mjs +435 -195
- package/package.json +8 -6
- package/src/AddListEntryForm.tsx +123 -0
- package/src/Form.stories.tsx +295 -0
- package/src/Form.tsx +39 -49
- package/src/FormPathContext.tsx +73 -0
- package/src/FormRow.tsx +15 -2
- package/src/ScmFormContext.tsx +1 -0
- package/src/ScmFormListContext.tsx +65 -0
- package/src/base/help/Help.tsx +4 -6
- package/src/checkbox/ControlledCheckboxField.tsx +11 -8
- package/src/helpers.ts +27 -0
- package/src/index.ts +28 -1
- package/src/input/ControlledInputField.tsx +16 -9
- package/src/input/ControlledSecretConfirmationField.tsx +28 -17
- package/src/list/ControlledList.tsx +88 -0
- package/src/select/ControlledSelectField.tsx +16 -9
- package/src/select/Select.tsx +18 -8
- package/src/table/ControlledColumn.tsx +49 -0
- package/src/table/ControlledTable.tsx +100 -0
- package/src/Form.stories.mdx +0 -160
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@scm-manager/ui-forms:build: cache hit, replaying output
|
|
1
|
+
@scm-manager/ui-forms:build: cache hit, replaying output e6c3d832906f6750
|
|
2
2
|
@scm-manager/ui-forms:build: $ tsup ./src/index.ts -d build --format esm,cjs --dts
|
|
3
3
|
@scm-manager/ui-forms:build: CLI Building entry: ./src/index.ts
|
|
4
4
|
@scm-manager/ui-forms:build: CLI Using tsconfig: tsconfig.json
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
@scm-manager/ui-forms:build: CLI Target: node14
|
|
7
7
|
@scm-manager/ui-forms:build: ESM Build start
|
|
8
8
|
@scm-manager/ui-forms:build: CJS Build start
|
|
9
|
-
@scm-manager/ui-forms:build: ESM build/index.mjs
|
|
10
|
-
@scm-manager/ui-forms:build: ESM ⚡️ Build success in
|
|
11
|
-
@scm-manager/ui-forms:build: CJS build/index.js
|
|
12
|
-
@scm-manager/ui-forms:build: CJS ⚡️ Build success in
|
|
9
|
+
@scm-manager/ui-forms:build: ESM build/index.mjs 29.75 KB
|
|
10
|
+
@scm-manager/ui-forms:build: ESM ⚡️ Build success in 231ms
|
|
11
|
+
@scm-manager/ui-forms:build: CJS build/index.js 34.38 KB
|
|
12
|
+
@scm-manager/ui-forms:build: CJS ⚡️ Build success in 208ms
|
|
13
13
|
@scm-manager/ui-forms:build: DTS Build start
|
|
14
|
-
@scm-manager/ui-forms:build: DTS ⚡️ Build success in
|
|
15
|
-
@scm-manager/ui-forms:build: DTS build/index.d.ts
|
|
14
|
+
@scm-manager/ui-forms:build: DTS ⚡️ Build success in 17070ms
|
|
15
|
+
@scm-manager/ui-forms:build: DTS build/index.d.ts 25.09 KB
|
package/build/index.d.ts
CHANGED
|
@@ -1,44 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { ComponentProps } from 'react';
|
|
3
|
+
import { SubmitHandler, UseFormReturn, ControllerRenderProps, Controller, Path, RegisterOptions, PathValue, UseFieldArrayReturn } from 'react-hook-form';
|
|
3
4
|
import { HalRepresentation } from '@scm-manager/ui-types';
|
|
4
5
|
|
|
5
|
-
declare
|
|
6
|
+
declare type RenderProps$3<T extends Record<string, unknown>> = Omit<UseFormReturn<T>, "register" | "unregister" | "handleSubmit" | "control">;
|
|
7
|
+
declare type Props$9<FormType extends Record<string, unknown>, DefaultValues extends FormType> = {
|
|
8
|
+
children: ((renderProps: RenderProps$3<FormType>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
9
|
+
translationPath: [namespace: string, prefix: string];
|
|
10
|
+
onSubmit: SubmitHandler<FormType>;
|
|
11
|
+
defaultValues: Omit<DefaultValues, keyof HalRepresentation>;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
submitButtonTestId?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @beta
|
|
17
|
+
* @since 2.41.0
|
|
18
|
+
*/
|
|
19
|
+
declare function Form$1<FormType extends Record<string, unknown>, DefaultValues extends FormType>({ children, onSubmit, defaultValues, translationPath, readOnly, submitButtonTestId, }: Props$9<FormType, DefaultValues>): JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare const Input: React__default.ForwardRefExoticComponent<{
|
|
6
22
|
variant?: "danger" | undefined;
|
|
7
23
|
testId?: string | undefined;
|
|
8
|
-
} &
|
|
24
|
+
} & React__default.InputHTMLAttributes<HTMLInputElement> & React__default.RefAttributes<HTMLInputElement>>;
|
|
9
25
|
|
|
10
26
|
declare type InputFieldProps = {
|
|
11
27
|
label: string;
|
|
12
28
|
helpText?: string;
|
|
13
29
|
error?: string;
|
|
14
30
|
type?: "text" | "password" | "email" | "tel";
|
|
15
|
-
} & Omit<
|
|
31
|
+
} & Omit<React__default.ComponentProps<typeof Input>, "type">;
|
|
16
32
|
/**
|
|
17
33
|
* @see https://bulma.io/documentation/form/input/
|
|
18
34
|
*/
|
|
19
|
-
declare const InputField:
|
|
35
|
+
declare const InputField: React__default.ForwardRefExoticComponent<Pick<InputFieldProps, "className" | "children" | "hidden" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "label" | "list" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "step" | "type" | "value" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "testId" | "enterKeyHint" | "error" | "helpText" | "variant"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
20
36
|
|
|
21
|
-
declare type Props$
|
|
37
|
+
declare type Props$8<T extends Record<string, unknown>> = Omit<ComponentProps<typeof InputField>, "error" | "label" | "defaultChecked" | "required" | keyof ControllerRenderProps> & {
|
|
22
38
|
rules?: ComponentProps<typeof Controller>["rules"];
|
|
23
39
|
name: Path<T>;
|
|
24
40
|
label?: string;
|
|
25
41
|
};
|
|
26
|
-
declare function ControlledInputField$1<T extends Record<string, unknown>>({ name, label, helpText, rules,
|
|
42
|
+
declare function ControlledInputField$1<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, ...props }: Props$8<T>): JSX.Element;
|
|
27
43
|
|
|
28
|
-
declare const CheckboxField:
|
|
44
|
+
declare const CheckboxField: React__default.ForwardRefExoticComponent<Pick<{
|
|
29
45
|
label: string;
|
|
30
46
|
helpText?: string | undefined;
|
|
31
47
|
testId?: string | undefined;
|
|
32
|
-
} & Omit<
|
|
48
|
+
} & Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type"> & React__default.RefAttributes<HTMLInputElement>, "className" | "children" | "hidden" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "label" | "list" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "step" | "value" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "testId" | "enterKeyHint" | "helpText"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
33
49
|
|
|
34
|
-
declare type Props$
|
|
50
|
+
declare type Props$7<T extends Record<string, unknown>> = Omit<ComponentProps<typeof CheckboxField>, "label" | "defaultValue" | "required" | keyof ControllerRenderProps> & {
|
|
35
51
|
name: Path<T>;
|
|
36
52
|
label?: string;
|
|
37
53
|
rules?: Pick<RegisterOptions, "deps">;
|
|
38
54
|
};
|
|
39
|
-
declare function ControlledInputField<T extends Record<string, unknown>>({ name, label, helpText, rules,
|
|
55
|
+
declare function ControlledInputField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultChecked, readOnly, ...props }: Props$7<T>): JSX.Element;
|
|
40
56
|
|
|
41
|
-
declare type Props$
|
|
57
|
+
declare type Props$6<T extends Record<string, unknown>> = Omit<ComponentProps<typeof InputField>, "error" | "label" | "defaultChecked" | "required" | keyof ControllerRenderProps> & {
|
|
42
58
|
rules?: ComponentProps<typeof Controller>["rules"];
|
|
43
59
|
name: Path<T>;
|
|
44
60
|
label?: string;
|
|
@@ -47,53 +63,82 @@ declare type Props$4<T extends Record<string, unknown>> = Omit<ComponentProps<ty
|
|
|
47
63
|
confirmationErrorMessage?: string;
|
|
48
64
|
confirmationTestId?: string;
|
|
49
65
|
};
|
|
50
|
-
declare function ControlledSecretConfirmationField<T extends Record<string, unknown>>({ name, label, confirmationLabel, helpText, confirmationHelpText, rules, confirmationErrorMessage, className, testId, confirmationTestId, defaultValue, readOnly, ...props }: Props$
|
|
66
|
+
declare function ControlledSecretConfirmationField<T extends Record<string, unknown>>({ name, label, confirmationLabel, helpText, confirmationHelpText, rules, confirmationErrorMessage, className, testId, confirmationTestId, defaultValue, readOnly, ...props }: Props$6<T>): JSX.Element;
|
|
51
67
|
|
|
52
|
-
declare const Select:
|
|
68
|
+
declare const Select: React__default.ForwardRefExoticComponent<{
|
|
53
69
|
variant?: "danger" | undefined;
|
|
70
|
+
options?: (React__default.OptionHTMLAttributes<HTMLOptionElement> & {
|
|
71
|
+
label: string;
|
|
72
|
+
})[] | undefined;
|
|
54
73
|
testId?: string | undefined;
|
|
55
|
-
} &
|
|
74
|
+
} & React__default.InputHTMLAttributes<HTMLSelectElement> & React__default.RefAttributes<HTMLSelectElement>>;
|
|
56
75
|
|
|
57
|
-
declare type Props$
|
|
76
|
+
declare type Props$5 = {
|
|
58
77
|
label: string;
|
|
59
78
|
helpText?: string;
|
|
60
79
|
error?: string;
|
|
61
|
-
} &
|
|
80
|
+
} & React__default.ComponentProps<typeof Select>;
|
|
62
81
|
/**
|
|
63
82
|
* @see https://bulma.io/documentation/form/select/
|
|
64
83
|
*/
|
|
65
|
-
declare const SelectField:
|
|
84
|
+
declare const SelectField: React__default.ForwardRefExoticComponent<Pick<Props$5, "label" | "key" | "testId" | "error" | "helpText" | "options" | "variant" | keyof React__default.InputHTMLAttributes<HTMLSelectElement>> & React__default.RefAttributes<HTMLSelectElement>>;
|
|
66
85
|
|
|
67
|
-
declare type Props$
|
|
86
|
+
declare type Props$4<T extends Record<string, unknown>> = Omit<ComponentProps<typeof SelectField>, "error" | "label" | "required" | keyof ControllerRenderProps> & {
|
|
68
87
|
rules?: ComponentProps<typeof Controller>["rules"];
|
|
69
88
|
name: Path<T>;
|
|
70
89
|
label?: string;
|
|
71
90
|
};
|
|
72
|
-
declare function ControlledSelectField<T extends Record<string, unknown>>({ name, label, helpText, rules,
|
|
91
|
+
declare function ControlledSelectField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, ...props }: Props$4<T>): JSX.Element;
|
|
92
|
+
|
|
93
|
+
declare type ArrayItemType<T> = T extends Array<infer U> ? U : unknown;
|
|
94
|
+
declare type RenderProps$2<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
95
|
+
value: ArrayItemType<PathValue<T, PATH>>;
|
|
96
|
+
index: number;
|
|
97
|
+
remove: () => void;
|
|
98
|
+
};
|
|
99
|
+
declare type Props$3<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
100
|
+
withDelete?: boolean;
|
|
101
|
+
children: ((renderProps: RenderProps$2<T, PATH>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* @beta
|
|
105
|
+
* @since 2.43.0
|
|
106
|
+
*/
|
|
107
|
+
declare function ControlledList<T extends Record<string, unknown>, PATH extends Path<T>>({ withDelete, children, }: Props$3<T, PATH>): JSX.Element;
|
|
108
|
+
|
|
109
|
+
declare type RenderProps$1<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
110
|
+
value: PathValue<T, PATH>;
|
|
111
|
+
index: number;
|
|
112
|
+
remove: () => void;
|
|
113
|
+
};
|
|
114
|
+
declare type Props$2<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
115
|
+
withDelete?: boolean;
|
|
116
|
+
children: ((renderProps: RenderProps$1<T, PATH>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
117
|
+
className?: string;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* @beta
|
|
121
|
+
* @since 2.43.0
|
|
122
|
+
*/
|
|
123
|
+
declare function ControlledTable<T extends Record<string, unknown>, PATH extends Path<T>>({ withDelete, children, className, }: Props$2<T, PATH>): JSX.Element | null;
|
|
73
124
|
|
|
74
125
|
declare type RenderProps<T extends Record<string, unknown>> = Omit<UseFormReturn<T>, "register" | "unregister" | "handleSubmit" | "control">;
|
|
75
126
|
declare type Props$1<FormType extends Record<string, unknown>, DefaultValues extends FormType> = {
|
|
76
|
-
children: ((renderProps: RenderProps<FormType>) =>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
127
|
+
children: ((renderProps: RenderProps<FormType>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
128
|
+
defaultValues: DefaultValues;
|
|
129
|
+
submit?: (data: FormType, append: UseFieldArrayReturn["append"]) => unknown;
|
|
130
|
+
/**
|
|
131
|
+
* @default true
|
|
132
|
+
*/
|
|
133
|
+
disableSubmitWhenDirty?: boolean;
|
|
82
134
|
};
|
|
83
135
|
/**
|
|
84
136
|
* @beta
|
|
85
|
-
* @since 2.
|
|
137
|
+
* @since 2.43.0
|
|
86
138
|
*/
|
|
87
|
-
declare function
|
|
88
|
-
declare const _default: typeof Form & {
|
|
89
|
-
Row: React.ForwardRefExoticComponent<Pick<React.HTMLProps<HTMLDivElement>, "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "default" | "type" | "className" | "key" | "dateTime" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "as" | "name" | "alt" | "src" | "href" | "disabled" | "action" | "download" | "hrefLang" | "media" | "rel" | "target" | "value" | "size" | "open" | "step" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "method" | "min" | "width" | "crossOrigin" | "classID" | "useMap" | "wmode" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "acceptCharset" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "sizes" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "integrity" | "charSet" | "content" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "start" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "wrap" | "kind" | "srcLang" | "poster"> & React.RefAttributes<HTMLDivElement>>;
|
|
90
|
-
Input: typeof ControlledInputField$1;
|
|
91
|
-
Checkbox: typeof ControlledInputField;
|
|
92
|
-
SecretConfirmation: typeof ControlledSecretConfirmationField;
|
|
93
|
-
Select: typeof ControlledSelectField;
|
|
94
|
-
};
|
|
139
|
+
declare function AddListEntryForm<FormType extends Record<string, unknown>, DefaultValues extends FormType>({ children, defaultValues, submit, disableSubmitWhenDirty, }: Props$1<FormType, DefaultValues>): JSX.Element | null;
|
|
95
140
|
|
|
96
|
-
declare type Props<T extends HalRepresentation> = Pick<ComponentProps<typeof
|
|
141
|
+
declare type Props<T extends HalRepresentation> = Pick<ComponentProps<typeof Form$1<T, T>>, "translationPath" | "children"> & {
|
|
97
142
|
link: string;
|
|
98
143
|
};
|
|
99
144
|
/**
|
|
@@ -136,4 +181,26 @@ declare type DeleteResourceOptions = {
|
|
|
136
181
|
*/
|
|
137
182
|
declare const useDeleteResource: <T extends HalRepresentation>(idFactory: (createdResource: T) => string, { collectionName: [entityQueryKey, collectionName] }?: DeleteResourceOptions) => MutationResult<T, unknown>;
|
|
138
183
|
|
|
139
|
-
|
|
184
|
+
declare const Form: typeof Form$1 & {
|
|
185
|
+
Row: React.ForwardRefExoticComponent<Pick<React.HTMLProps<HTMLDivElement>, "className" | "children" | "hidden" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLDivElement>>;
|
|
186
|
+
Input: typeof ControlledInputField$1;
|
|
187
|
+
Checkbox: typeof ControlledInputField;
|
|
188
|
+
SecretConfirmation: typeof ControlledSecretConfirmationField;
|
|
189
|
+
Select: typeof ControlledSelectField;
|
|
190
|
+
PathContext: React.FC<{
|
|
191
|
+
path: string;
|
|
192
|
+
}>;
|
|
193
|
+
ListContext: React.FC<{
|
|
194
|
+
name: string;
|
|
195
|
+
}>;
|
|
196
|
+
List: typeof ControlledList;
|
|
197
|
+
AddListEntryForm: typeof AddListEntryForm;
|
|
198
|
+
Table: typeof ControlledTable & {
|
|
199
|
+
Column: React.FC<{
|
|
200
|
+
name: string;
|
|
201
|
+
children?: ((value: unknown) => React.ReactNode | React.ReactNode[]) | undefined;
|
|
202
|
+
} & React.HTMLAttributes<HTMLTableCellElement>>;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export { ConfigurationForm, Form, useCreateResource, useDeleteResource, useUpdateResource };
|