@scm-manager/ui-forms 2.44.2 → 2.44.3-20230527-064447
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 +106 -45
- package/build/index.js +525 -255
- package/build/index.mjs +396 -122
- package/package.json +7 -6
- package/src/Form.stories.tsx +22 -0
- package/src/chip-input/ChipInputField.stories.tsx +41 -12
- package/src/chip-input/ChipInputField.tsx +83 -56
- package/src/chip-input/ControlledChipInputField.tsx +12 -4
- package/src/combobox/Combobox.stories.tsx +96 -0
- package/src/combobox/Combobox.tsx +217 -0
- package/src/combobox/ComboboxField.tsx +62 -0
- package/src/combobox/ControlledComboboxField.tsx +96 -0
- package/src/headless-chip-input/ChipInput.tsx +127 -59
- package/src/helpers.ts +23 -0
- package/src/index.ts +4 -0
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 36d004cffe873672
|
|
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:
|
|
10
|
-
@scm-manager/ui-forms:build:
|
|
11
|
-
@scm-manager/ui-forms:build:
|
|
12
|
-
@scm-manager/ui-forms:build:
|
|
9
|
+
@scm-manager/ui-forms:build: ESM build/index.mjs 49.58 KB
|
|
10
|
+
@scm-manager/ui-forms:build: ESM ⚡️ Build success in 266ms
|
|
11
|
+
@scm-manager/ui-forms:build: CJS build/index.js 56.13 KB
|
|
12
|
+
@scm-manager/ui-forms:build: CJS ⚡️ Build success in 241ms
|
|
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 22070ms
|
|
15
|
+
@scm-manager/ui-forms:build: DTS build/index.d.ts 25.56 KB
|
package/build/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { ComponentProps } from 'react';
|
|
2
|
+
import React__default, { ComponentProps, ReactElement, KeyboardEventHandler, ForwardedRef, Ref } from 'react';
|
|
3
3
|
import { SubmitHandler, UseFormReturn, ControllerRenderProps, Controller, Path, RegisterOptions, PathValue, UseFieldArrayReturn } from 'react-hook-form';
|
|
4
|
-
import { HalRepresentation } from '@scm-manager/ui-types';
|
|
4
|
+
import { Option, HalRepresentation } from '@scm-manager/ui-types';
|
|
5
|
+
import * as styled_components from 'styled-components';
|
|
5
6
|
|
|
6
7
|
declare type RenderProps$3<T extends Record<string, unknown>> = Omit<UseFormReturn<T>, "register" | "unregister" | "handleSubmit" | "control">;
|
|
7
|
-
declare type Props$
|
|
8
|
+
declare type Props$b<FormType extends Record<string, unknown>, DefaultValues extends FormType> = {
|
|
8
9
|
children: ((renderProps: RenderProps$3<FormType>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
9
10
|
translationPath: [namespace: string, prefix: string];
|
|
10
11
|
onSubmit: SubmitHandler<FormType>;
|
|
@@ -45,14 +46,14 @@ declare type Props$a<FormType extends Record<string, unknown>, DefaultValues ext
|
|
|
45
46
|
* @beta
|
|
46
47
|
* @since 2.41.0
|
|
47
48
|
*/
|
|
48
|
-
declare function Form$1<FormType extends Record<string, unknown>, DefaultValues extends FormType = FormType>({ children, onSubmit, defaultValues, translationPath, readOnly, withResetTo, withDiscardChanges, successMessageFallback, submitButtonTestId, }: Props$
|
|
49
|
+
declare function Form$1<FormType extends Record<string, unknown>, DefaultValues extends FormType = FormType>({ children, onSubmit, defaultValues, translationPath, readOnly, withResetTo, withDiscardChanges, successMessageFallback, submitButtonTestId, }: Props$b<FormType, DefaultValues>): JSX.Element;
|
|
49
50
|
|
|
50
51
|
declare const Input: React__default.ForwardRefExoticComponent<{
|
|
51
52
|
variant?: "danger" | undefined;
|
|
52
53
|
testId?: string | undefined;
|
|
53
54
|
} & React__default.InputHTMLAttributes<HTMLInputElement> & React__default.RefAttributes<HTMLInputElement>>;
|
|
54
55
|
|
|
55
|
-
declare type InputFieldProps = {
|
|
56
|
+
declare type InputFieldProps$1 = {
|
|
56
57
|
label: string;
|
|
57
58
|
helpText?: string;
|
|
58
59
|
error?: string;
|
|
@@ -60,14 +61,14 @@ declare type InputFieldProps = {
|
|
|
60
61
|
/**
|
|
61
62
|
* @see https://bulma.io/documentation/form/input/
|
|
62
63
|
*/
|
|
63
|
-
declare const InputField: React__default.ForwardRefExoticComponent<Pick<InputFieldProps, "label" | "key" | "testId" | keyof React__default.InputHTMLAttributes<HTMLInputElement> | "error" | "helpText" | "variant"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
64
|
+
declare const InputField: React__default.ForwardRefExoticComponent<Pick<InputFieldProps$1, "label" | "key" | "testId" | keyof React__default.InputHTMLAttributes<HTMLInputElement> | "error" | "helpText" | "variant"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
64
65
|
|
|
65
|
-
declare type Props$
|
|
66
|
+
declare type Props$a<T extends Record<string, unknown>> = Omit<ComponentProps<typeof InputField>, "error" | "label" | "defaultChecked" | "required" | keyof ControllerRenderProps> & {
|
|
66
67
|
rules?: ComponentProps<typeof Controller>["rules"];
|
|
67
68
|
name: Path<T>;
|
|
68
69
|
label?: string;
|
|
69
70
|
};
|
|
70
|
-
declare function ControlledInputField$1<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, className, ...props }: Props$
|
|
71
|
+
declare function ControlledInputField$1<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, className, ...props }: Props$a<T>): JSX.Element;
|
|
71
72
|
|
|
72
73
|
declare const CheckboxField: React__default.ForwardRefExoticComponent<Pick<{
|
|
73
74
|
label: string;
|
|
@@ -75,14 +76,14 @@ declare const CheckboxField: React__default.ForwardRefExoticComponent<Pick<{
|
|
|
75
76
|
testId?: string | undefined;
|
|
76
77
|
} & 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>>;
|
|
77
78
|
|
|
78
|
-
declare type Props$
|
|
79
|
+
declare type Props$9<T extends Record<string, unknown>> = Omit<ComponentProps<typeof CheckboxField>, "label" | "defaultValue" | "required" | keyof ControllerRenderProps> & {
|
|
79
80
|
name: Path<T>;
|
|
80
81
|
label?: string;
|
|
81
82
|
rules?: Pick<RegisterOptions, "deps">;
|
|
82
83
|
};
|
|
83
|
-
declare function ControlledInputField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultChecked, readOnly, className, ...props }: Props$
|
|
84
|
+
declare function ControlledInputField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultChecked, readOnly, className, ...props }: Props$9<T>): JSX.Element;
|
|
84
85
|
|
|
85
|
-
declare type Props$
|
|
86
|
+
declare type Props$8<T extends Record<string, unknown>> = Omit<ComponentProps<typeof InputField>, "error" | "label" | "defaultChecked" | "required" | keyof ControllerRenderProps> & {
|
|
86
87
|
rules?: ComponentProps<typeof Controller>["rules"];
|
|
87
88
|
name: Path<T>;
|
|
88
89
|
label?: string;
|
|
@@ -91,7 +92,7 @@ declare type Props$7<T extends Record<string, unknown>> = Omit<ComponentProps<ty
|
|
|
91
92
|
confirmationErrorMessage?: string;
|
|
92
93
|
confirmationTestId?: string;
|
|
93
94
|
};
|
|
94
|
-
declare function ControlledSecretConfirmationField<T extends Record<string, unknown>>({ name, label, confirmationLabel, helpText, confirmationHelpText, rules, confirmationErrorMessage, className, testId, confirmationTestId, defaultValue, readOnly, ...props }: Props$
|
|
95
|
+
declare function ControlledSecretConfirmationField<T extends Record<string, unknown>>({ name, label, confirmationLabel, helpText, confirmationHelpText, rules, confirmationErrorMessage, className, testId, confirmationTestId, defaultValue, readOnly, ...props }: Props$8<T>): JSX.Element;
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* @beta
|
|
@@ -105,7 +106,7 @@ declare const Select: React__default.ForwardRefExoticComponent<{
|
|
|
105
106
|
testId?: string | undefined;
|
|
106
107
|
} & React__default.InputHTMLAttributes<HTMLSelectElement> & React__default.RefAttributes<HTMLSelectElement>>;
|
|
107
108
|
|
|
108
|
-
declare type Props$
|
|
109
|
+
declare type Props$7 = {
|
|
109
110
|
label: string;
|
|
110
111
|
helpText?: string;
|
|
111
112
|
error?: string;
|
|
@@ -115,49 +116,48 @@ declare type Props$6 = {
|
|
|
115
116
|
* @beta
|
|
116
117
|
* @since 2.44.0
|
|
117
118
|
*/
|
|
118
|
-
declare const SelectField: React__default.ForwardRefExoticComponent<Pick<Props$
|
|
119
|
+
declare const SelectField: React__default.ForwardRefExoticComponent<Pick<Props$7, "label" | "key" | "testId" | "error" | "helpText" | "options" | "variant" | keyof React__default.InputHTMLAttributes<HTMLSelectElement>> & React__default.RefAttributes<HTMLSelectElement>>;
|
|
119
120
|
|
|
120
|
-
declare type Props$
|
|
121
|
+
declare type Props$6<T extends Record<string, unknown>> = Omit<ComponentProps<typeof SelectField>, "error" | "label" | "required" | keyof ControllerRenderProps> & {
|
|
121
122
|
rules?: ComponentProps<typeof Controller>["rules"];
|
|
122
123
|
name: Path<T>;
|
|
123
124
|
label?: string;
|
|
124
125
|
};
|
|
125
|
-
declare function ControlledSelectField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, className, ...props }: Props$
|
|
126
|
+
declare function ControlledSelectField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, className, ...props }: Props$6<T>): JSX.Element;
|
|
126
127
|
|
|
127
|
-
|
|
128
|
-
* @beta
|
|
129
|
-
* @since 2.44.0
|
|
130
|
-
*/
|
|
131
|
-
declare const ChipInputField: React__default.ForwardRefExoticComponent<{
|
|
128
|
+
declare type InputFieldProps<T> = {
|
|
132
129
|
label: string;
|
|
133
|
-
createDeleteText?: (
|
|
134
|
-
helpText?: string
|
|
135
|
-
error?: string
|
|
136
|
-
testId?: string
|
|
137
|
-
id?: string
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
value?:
|
|
142
|
-
|
|
143
|
-
readOnly?: boolean
|
|
144
|
-
disabled?: boolean
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
130
|
+
createDeleteText?: (value: string) => string;
|
|
131
|
+
helpText?: string;
|
|
132
|
+
error?: string;
|
|
133
|
+
testId?: string;
|
|
134
|
+
id?: string;
|
|
135
|
+
children?: ReactElement;
|
|
136
|
+
placeholder?: string;
|
|
137
|
+
onChange?: (newValue: Option<T>[]) => void;
|
|
138
|
+
value?: Option<T>[] | null;
|
|
139
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
140
|
+
readOnly?: boolean;
|
|
141
|
+
disabled?: boolean;
|
|
142
|
+
className?: string;
|
|
143
|
+
isLoading?: boolean;
|
|
144
|
+
isNewItemDuplicate?: (existingItem: Option<T>, newItem: Option<T>) => boolean;
|
|
145
|
+
};
|
|
146
|
+
declare const _default$1: <T>({ label, helpText, readOnly, disabled, error, createDeleteText, onChange, placeholder, value, className, testId, id, children, isLoading, isNewItemDuplicate, ...props }: InputFieldProps<T>, ref: React__default.ForwardedRef<HTMLInputElement>) => JSX.Element;
|
|
148
147
|
|
|
149
|
-
declare type Props$
|
|
148
|
+
declare type Props$5<T extends Record<string, unknown>> = Omit<Parameters<typeof _default$1>[0], "error" | "createDeleteText" | "label" | "defaultChecked" | "required" | keyof ControllerRenderProps> & {
|
|
150
149
|
rules?: ComponentProps<typeof Controller>["rules"];
|
|
151
150
|
name: Path<T>;
|
|
152
151
|
label?: string;
|
|
153
152
|
defaultValue?: string[];
|
|
154
153
|
createDeleteText?: (value: string) => string;
|
|
154
|
+
optionFactory?: (val: any) => Option<unknown>;
|
|
155
155
|
};
|
|
156
156
|
/**
|
|
157
157
|
* @beta
|
|
158
158
|
* @since 2.44.0
|
|
159
159
|
*/
|
|
160
|
-
declare function ControlledChipInputField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, placeholder, className, createDeleteText, ...props }: Props$
|
|
160
|
+
declare function ControlledChipInputField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, placeholder, className, createDeleteText, children, optionFactory, ...props }: Props$5<T>): JSX.Element;
|
|
161
161
|
|
|
162
162
|
declare type ArrayItemType<T> = T extends Array<infer U> ? U : unknown;
|
|
163
163
|
declare type RenderProps$2<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
@@ -165,7 +165,7 @@ declare type RenderProps$2<T extends Record<string, unknown>, PATH extends Path<
|
|
|
165
165
|
index: number;
|
|
166
166
|
remove: () => void;
|
|
167
167
|
};
|
|
168
|
-
declare type Props$
|
|
168
|
+
declare type Props$4<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
169
169
|
withDelete?: boolean;
|
|
170
170
|
children: ((renderProps: RenderProps$2<T, PATH>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
171
171
|
};
|
|
@@ -173,14 +173,14 @@ declare type Props$3<T extends Record<string, unknown>, PATH extends Path<T>> =
|
|
|
173
173
|
* @beta
|
|
174
174
|
* @since 2.43.0
|
|
175
175
|
*/
|
|
176
|
-
declare function ControlledList<T extends Record<string, unknown>, PATH extends Path<T>>({ withDelete, children, }: Props$
|
|
176
|
+
declare function ControlledList<T extends Record<string, unknown>, PATH extends Path<T>>({ withDelete, children, }: Props$4<T, PATH>): JSX.Element;
|
|
177
177
|
|
|
178
178
|
declare type RenderProps$1<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
179
179
|
value: PathValue<T, PATH>;
|
|
180
180
|
index: number;
|
|
181
181
|
remove: () => void;
|
|
182
182
|
};
|
|
183
|
-
declare type Props$
|
|
183
|
+
declare type Props$3<T extends Record<string, unknown>, PATH extends Path<T>> = {
|
|
184
184
|
withDelete?: boolean;
|
|
185
185
|
children: ((renderProps: RenderProps$1<T, PATH>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
186
186
|
className?: string;
|
|
@@ -189,10 +189,10 @@ declare type Props$2<T extends Record<string, unknown>, PATH extends Path<T>> =
|
|
|
189
189
|
* @beta
|
|
190
190
|
* @since 2.43.0
|
|
191
191
|
*/
|
|
192
|
-
declare function ControlledTable<T extends Record<string, unknown>, PATH extends Path<T>>({ withDelete, children, className, }: Props$
|
|
192
|
+
declare function ControlledTable<T extends Record<string, unknown>, PATH extends Path<T>>({ withDelete, children, className, }: Props$3<T, PATH>): JSX.Element;
|
|
193
193
|
|
|
194
194
|
declare type RenderProps<T extends Record<string, unknown>> = Omit<UseFormReturn<T>, "register" | "unregister" | "handleSubmit" | "control">;
|
|
195
|
-
declare type Props$
|
|
195
|
+
declare type Props$2<FormType extends Record<string, unknown>, DefaultValues extends FormType> = {
|
|
196
196
|
children: ((renderProps: RenderProps<FormType>) => React__default.ReactNode | React__default.ReactNode[]) | React__default.ReactNode;
|
|
197
197
|
defaultValues: DefaultValues;
|
|
198
198
|
submit?: (data: FormType, append: UseFieldArrayReturn["append"]) => unknown;
|
|
@@ -205,7 +205,67 @@ declare type Props$1<FormType extends Record<string, unknown>, DefaultValues ext
|
|
|
205
205
|
* @beta
|
|
206
206
|
* @since 2.43.0
|
|
207
207
|
*/
|
|
208
|
-
declare function AddListEntryForm<FormType extends Record<string, unknown>, DefaultValues extends FormType>({ children, defaultValues, submit, disableSubmitWhenDirty, }: Props$
|
|
208
|
+
declare function AddListEntryForm<FormType extends Record<string, unknown>, DefaultValues extends FormType>({ children, defaultValues, submit, disableSubmitWhenDirty, }: Props$2<FormType, DefaultValues>): JSX.Element | null;
|
|
209
|
+
|
|
210
|
+
declare type BaseProps<T> = {
|
|
211
|
+
className?: string;
|
|
212
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
213
|
+
value?: Option<T> | null;
|
|
214
|
+
onChange?: (value?: Option<T>) => void;
|
|
215
|
+
onBlur?: () => void;
|
|
216
|
+
disabled?: boolean;
|
|
217
|
+
defaultValue?: Option<T>;
|
|
218
|
+
nullable?: boolean;
|
|
219
|
+
readOnly?: boolean;
|
|
220
|
+
onQueryChange?: (value: string) => void;
|
|
221
|
+
id?: string;
|
|
222
|
+
placeholder?: string;
|
|
223
|
+
"aria-describedby"?: string;
|
|
224
|
+
"aria-labelledby"?: string;
|
|
225
|
+
"aria-label"?: string;
|
|
226
|
+
testId?: string;
|
|
227
|
+
ref?: Ref<HTMLInputElement>;
|
|
228
|
+
form?: string;
|
|
229
|
+
name?: string;
|
|
230
|
+
};
|
|
231
|
+
declare type ComboboxProps<T> = (BaseProps<T> & {
|
|
232
|
+
options: Array<Option<T>> | ((query: string) => Array<Option<T>> | Promise<Array<Option<T>>>);
|
|
233
|
+
children?: (option: Option<T>, index: number) => ReactElement;
|
|
234
|
+
}) | (BaseProps<T> & {
|
|
235
|
+
children: Array<ReactElement | null>;
|
|
236
|
+
options?: never;
|
|
237
|
+
});
|
|
238
|
+
/**
|
|
239
|
+
* @beta
|
|
240
|
+
* @since 2.45.0
|
|
241
|
+
*/
|
|
242
|
+
declare function ComboboxComponent<T>(props: ComboboxProps<T>, ref: ForwardedRef<HTMLInputElement>): JSX.Element;
|
|
243
|
+
declare const Combobox: typeof ComboboxComponent & {
|
|
244
|
+
Option: styled_components.StyledComponent<"li", any, {
|
|
245
|
+
className: "px-3 py-2 has-text-inherit is-clickable is-size-6 is-borderless has-background-transparent";
|
|
246
|
+
} & {
|
|
247
|
+
isActive: boolean;
|
|
248
|
+
}, "className">;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
declare const _default: <T>({ label, helpText, error, className, isLoading, ...props }: ComboboxProps<T> & {
|
|
252
|
+
label: string;
|
|
253
|
+
helpText?: string | undefined;
|
|
254
|
+
error?: string | undefined;
|
|
255
|
+
isLoading?: boolean | undefined;
|
|
256
|
+
}, ref: React__default.ForwardedRef<HTMLInputElement>) => JSX.Element;
|
|
257
|
+
|
|
258
|
+
declare type Props$1<T extends Record<string, unknown>> = Omit<Parameters<typeof _default>[0], "error" | "label" | keyof ControllerRenderProps> & {
|
|
259
|
+
rules?: ComponentProps<typeof Controller>["rules"];
|
|
260
|
+
name: Path<T>;
|
|
261
|
+
label?: string;
|
|
262
|
+
optionFactory?: (val: any) => Option<unknown>;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* @beta
|
|
266
|
+
* @since 2.45.0
|
|
267
|
+
*/
|
|
268
|
+
declare function ControlledComboboxField<T extends Record<string, unknown>>({ name, label, helpText, rules, testId, defaultValue, readOnly, className, optionFactory, ...props }: Props$1<T>): JSX.Element;
|
|
209
269
|
|
|
210
270
|
declare type Props<T extends HalRepresentation> = Omit<ComponentProps<typeof Form$1<T>>, "onSubmit" | "defaultValues" | "readOnly" | "successMessageFallback"> & {
|
|
211
271
|
link: string;
|
|
@@ -271,6 +331,7 @@ declare const Form: typeof Form$1 & {
|
|
|
271
331
|
} & React.HTMLAttributes<HTMLTableCellElement>>;
|
|
272
332
|
};
|
|
273
333
|
ChipInput: typeof ControlledChipInputField;
|
|
334
|
+
Combobox: typeof ControlledComboboxField;
|
|
274
335
|
};
|
|
275
336
|
|
|
276
|
-
export { ChipInputField, ConfigurationForm, Form, Select, SelectField, useCreateResource, useDeleteResource, useUpdateResource };
|
|
337
|
+
export { _default$1 as ChipInputField, Combobox, _default as ComboboxField, ConfigurationForm, Form, Select, SelectField, useCreateResource, useDeleteResource, useUpdateResource };
|