@commercelayer/app-elements 0.0.77 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Async-eb36604c.js → Async-2e9c3da2.js} +5 -3
- package/dist/{InputDateComponent-3a568d05.js → InputDateComponent-fe3ffd00.js} +4 -2
- package/dist/{Select-9ad06632.js → Select-be90391b.js} +5 -3
- package/dist/helpers/appsNavigation.d.ts +1 -0
- package/dist/hooks/useOverlayNavigation.d.ts +1 -0
- package/dist/{main-237699b9.js → main-bd408fbe.js} +12509 -10957
- package/dist/main.d.ts +18 -0
- package/dist/main.js +151 -127
- package/dist/{overrides-1089f4f3.js → overrides-684ed062.js} +2 -2
- package/dist/providers/TokenProvider/MockTokenProvider.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/ui/atoms/A.d.ts +1 -0
- package/dist/ui/atoms/Avatar.d.ts +1 -0
- package/dist/ui/atoms/AvatarLetter.d.ts +1 -0
- package/dist/ui/atoms/BlockCode.d.ts +1 -0
- package/dist/ui/atoms/ButtonFilter.d.ts +1 -0
- package/dist/ui/atoms/Card.d.ts +2 -0
- package/dist/ui/atoms/Container.d.ts +1 -0
- package/dist/ui/atoms/CopyToClipboard.d.ts +1 -0
- package/dist/ui/atoms/Hr.d.ts +1 -0
- package/dist/ui/atoms/Icon.d.ts +1 -0
- package/dist/ui/atoms/Pagination.d.ts +1 -0
- package/dist/ui/atoms/Progress.d.ts +1 -0
- package/dist/ui/atoms/StatusDot.d.ts +1 -0
- package/dist/ui/atoms/Steps.d.ts +1 -0
- package/dist/ui/atoms/dropdown/DropdownMenu.d.ts +1 -0
- package/dist/ui/atoms/dropdown/DropdownMenuDivider.d.ts +1 -0
- package/dist/ui/atoms/dropdown/DropdownMenuItem.d.ts +1 -0
- package/dist/ui/atoms/tables/Td.d.ts +1 -0
- package/dist/ui/atoms/tables/Th.d.ts +1 -0
- package/dist/ui/atoms/tables/Tr.d.ts +1 -0
- package/dist/ui/composite/ContextMenu.d.ts +1 -0
- package/dist/ui/composite/PageError.d.ts +1 -0
- package/dist/ui/composite/PageSkeleton.d.ts +1 -0
- package/dist/ui/composite/SearchBar.d.ts +12 -5
- package/dist/ui/forms/Input.d.ts +1 -0
- package/dist/ui/forms/InputCheckbox.d.ts +1 -0
- package/dist/ui/forms/InputCurrency/index.d.ts +1 -0
- package/dist/ui/forms/InputCurrencyRange.d.ts +1 -0
- package/dist/ui/forms/InputDate/InputDateComponent.d.ts +1 -0
- package/dist/ui/forms/InputDate/index.d.ts +1 -0
- package/dist/ui/forms/InputDateRange.d.ts +1 -0
- package/dist/ui/forms/InputFeedback.d.ts +1 -0
- package/dist/ui/forms/InputFile.d.ts +1 -0
- package/dist/ui/forms/InputJson.d.ts +1 -0
- package/dist/ui/forms/InputReadonly.d.ts +1 -0
- package/dist/ui/forms/InputSelect/Async.d.ts +1 -0
- package/dist/ui/forms/InputSelect/Select.d.ts +1 -0
- package/dist/ui/forms/InputSelect/overrides.d.ts +1 -0
- package/dist/ui/forms/InputSpinner.d.ts +1 -0
- package/dist/ui/forms/InputTextArea.d.ts +1 -0
- package/dist/ui/forms/InputToggleBox.d.ts +1 -0
- package/dist/ui/forms/InputToggleListBox.d.ts +1 -0
- package/dist/ui/forms/Label.d.ts +1 -0
- package/dist/ui/forms/ToggleButtons.d.ts +1 -0
- package/dist/ui/hook-form/HookedForm.d.ts +34 -0
- package/dist/ui/hook-form/HookedInput.d.ts +17 -0
- package/dist/ui/hook-form/HookedInputCheckbox.d.ts +17 -0
- package/dist/ui/hook-form/HookedInputCurrency.d.ts +18 -0
- package/dist/ui/hook-form/HookedInputDate.d.ts +18 -0
- package/dist/ui/hook-form/HookedInputDateRange.d.ts +19 -0
- package/dist/ui/hook-form/HookedInputMetadata.d.ts +19 -0
- package/dist/ui/hook-form/HookedInputSelect.d.ts +34 -0
- package/dist/ui/hook-form/HookedInputSpinner.d.ts +17 -0
- package/dist/ui/hook-form/HookedInputToggleBox.d.ts +21 -0
- package/dist/ui/hook-form/HookedInputToggleListBox.d.ts +21 -0
- package/dist/ui/hook-form/HookedRelationshipSelector.d.ts +18 -0
- package/dist/ui/hook-form/HookedToggleButtons.d.ts +18 -0
- package/dist/ui/hook-form/HookedValidationApiError.d.ts +22 -0
- package/dist/ui/hook-form/HookedValidationError.d.ts +12 -0
- package/dist/ui/hook-form/setApiFormErrors.d.ts +19 -0
- package/dist/ui/hook-form/setApiFormErrors.test.d.ts +1 -0
- package/dist/ui/hook-form/useValidationFeedback.d.ts +4 -0
- package/dist/ui/internals/InputWrapper.d.ts +1 -0
- package/dist/ui/resources/Filters/FieldCurrencyRange.d.ts +7 -0
- package/dist/ui/resources/Filters/FieldItem.d.ts +7 -0
- package/dist/ui/resources/Filters/FieldTimeRange.d.ts +7 -0
- package/dist/ui/resources/Filters/FiltersForm.d.ts +17 -0
- package/dist/ui/resources/Filters/FiltersNav.d.ts +25 -0
- package/dist/ui/resources/Filters/FiltersSearchBar.d.ts +28 -0
- package/dist/ui/resources/Filters/adaptFormValuesToSdk.d.ts +19 -0
- package/dist/ui/resources/Filters/adaptFormValuesToSdk.test.d.ts +1 -0
- package/dist/ui/resources/Filters/adaptFormValuesToUrlQuery.d.ts +11 -0
- package/dist/ui/resources/Filters/adaptFormValuesToUrlQuery.test.d.ts +1 -0
- package/dist/ui/resources/Filters/adaptUrlQueryToFormValues.d.ts +11 -0
- package/dist/ui/resources/Filters/adaptUrlQueryToFormValues.test.d.ts +1 -0
- package/dist/ui/resources/Filters/adaptUrlQueryToSdk.d.ts +14 -0
- package/dist/ui/resources/Filters/adaptUrlQueryToSdk.test.d.ts +1 -0
- package/dist/ui/resources/Filters/adaptUrlQueryToUrlQuery.d.ts +11 -0
- package/dist/ui/resources/Filters/adaptUrlQueryToUrlQuery.test.d.ts +1 -0
- package/dist/ui/resources/Filters/adapters.d.ts +2 -0
- package/dist/ui/resources/Filters/adapters.types.d.ts +20 -0
- package/dist/ui/resources/Filters/index.d.ts +5 -0
- package/dist/ui/resources/Filters/mockedInstructions.d.ts +2 -0
- package/dist/ui/resources/Filters/timeUtils.d.ts +36 -0
- package/dist/ui/resources/Filters/timeUtils.test.d.ts +1 -0
- package/dist/ui/resources/Filters/types.d.ts +130 -0
- package/dist/ui/resources/Filters/useFilters.d.ts +59 -0
- package/dist/ui/resources/Filters/utils.d.ts +29 -0
- package/dist/ui/resources/Filters/utils.test.d.ts +1 -0
- package/dist/ui/resources/OrderSummary.d.ts +1 -0
- package/dist/ui/resources/RelationshipSelector/Checkbox.d.ts +1 -0
- package/dist/ui/resources/RelationshipSelector/FullList.d.ts +1 -0
- package/dist/ui/resources/RelationshipSelector/index.d.ts +1 -0
- package/dist/ui/resources/ResourceList/utils.d.ts +1 -0
- package/dist/ui/tables/TableData.d.ts +1 -0
- package/dist/{unsupportedIterableToArray-35997f1b.js → unsupportedIterableToArray-a4407b22.js} +1 -1
- package/dist/utils/htmltags.d.ts +1 -0
- package/package.json +8 -1
package/dist/ui/atoms/A.d.ts
CHANGED
package/dist/ui/atoms/Card.d.ts
CHANGED
package/dist/ui/atoms/Hr.d.ts
CHANGED
package/dist/ui/atoms/Icon.d.ts
CHANGED
package/dist/ui/atoms/Steps.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
interface SearchBarProps {
|
|
2
3
|
/**
|
|
3
4
|
* Initial value of the search bar. When changed, the search bar will be updated.
|
|
@@ -25,9 +26,15 @@ interface SearchBarProps {
|
|
|
25
26
|
* Placeholder text for the input element
|
|
26
27
|
*/
|
|
27
28
|
placeholder?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Enable auto focus on the input element
|
|
31
|
+
*/
|
|
32
|
+
autoFocus?: boolean;
|
|
28
33
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* This component renders a search bar with a clear button with debounced `onSearch` callback.
|
|
36
|
+
* <blockquote type='info'>In this way the `onSearch` callback will be triggered only when the user stops typing
|
|
37
|
+
* for the specified value of `debounceMs` (default 500ms).</blockquote>
|
|
38
|
+
*/
|
|
39
|
+
export declare const SearchBar: import("react").ForwardRefExoticComponent<SearchBarProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
40
|
+
export {};
|
package/dist/ui/forms/Input.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { type InputDateProps } from './InputDateComponent';
|
|
2
3
|
import type DatePicker from 'react-datepicker';
|
|
3
4
|
declare const InputDate: import("react").ForwardRefExoticComponent<InputDateProps & import("react").RefAttributes<DatePicker<never, undefined>>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { type InputWrapperBaseProps } from '../internals/InputWrapper';
|
|
2
3
|
import { type InputDateProps, type MaybeDate } from './InputDate/InputDateComponent';
|
|
3
4
|
export interface InputDateRangeProps extends Pick<InputDateProps, 'isClearable' | 'format' | 'autoPlaceholder'>, InputWrapperBaseProps {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { type ClearIndicatorProps, type DropdownIndicatorProps, type MultiValueRemoveProps } from 'react-select';
|
|
2
3
|
import { type SelectValue } from '.';
|
|
3
4
|
declare function DropdownIndicator(props: DropdownIndicatorProps<SelectValue>): JSX.Element;
|
package/dist/ui/forms/Label.d.ts
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type FieldValues, type FormProviderProps } from 'react-hook-form';
|
|
2
|
+
interface FormProps<T extends FieldValues> extends FormProviderProps<T> {
|
|
3
|
+
/**
|
|
4
|
+
* Callback invoked on submit when form has been successfully validated
|
|
5
|
+
*/
|
|
6
|
+
onSubmit: (data: T) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Form component to be used as main provider for the `react-hook-form` context.
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* ```
|
|
13
|
+
* import { useForm } from "react-hook-form"
|
|
14
|
+
* import { zodResolver } from "@hookform/resolvers/zod"
|
|
15
|
+
* import { HookedForm, HookedInput, HookedInputDate} from "@commercelayer/app-elements"
|
|
16
|
+
* function MyForm() {
|
|
17
|
+
* const methods = useForm({
|
|
18
|
+
* resolver: zodResolver(schema),
|
|
19
|
+
* });
|
|
20
|
+
* return (
|
|
21
|
+
* <HookedForm {...methods} onSubmit={(values) => myPostToServer(values)}>
|
|
22
|
+
* <HookedInput name="companyName" label="Company name" />
|
|
23
|
+
* <HookedInputDate name="dateSingle" label="Date" />
|
|
24
|
+
* <Button type='submit'>Submit</Button>
|
|
25
|
+
* </HookedForm>
|
|
26
|
+
* );
|
|
27
|
+
* }
|
|
28
|
+
*```
|
|
29
|
+
*/
|
|
30
|
+
export declare const HookedForm: {
|
|
31
|
+
<T extends FieldValues>({ onSubmit, children, handleSubmit, ...rest }: FormProps<T>): JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputProps } from '../forms/Input';
|
|
3
|
+
interface Props extends InputProps {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `Input` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* @see InputSelect
|
|
12
|
+
*/
|
|
13
|
+
declare function HookedInput({ name, ...props }: Props): JSX.Element;
|
|
14
|
+
declare namespace HookedInput {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
export { HookedInput };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputCheckboxProps } from '../forms/InputCheckbox';
|
|
3
|
+
interface Props extends InputCheckboxProps {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `InputCheckbox` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* @see InputCheckbox
|
|
12
|
+
*/
|
|
13
|
+
declare function HookedInputCheckbox({ name, ...props }: Props): JSX.Element;
|
|
14
|
+
declare namespace HookedInputCheckbox {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
export { HookedInputCheckbox };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputCurrencyProps } from '../forms/InputCurrency';
|
|
3
|
+
interface Props extends Omit<InputCurrencyProps, 'onChange' | 'onBlur' | 'cents'> {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `InputCurrency` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* Value is stored in form state as cents.
|
|
12
|
+
* @see InputCurrency
|
|
13
|
+
*/
|
|
14
|
+
declare function HookedInputCurrency({ name, ...props }: Props): JSX.Element;
|
|
15
|
+
declare namespace HookedInputCurrency {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export { HookedInputCurrency };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputDateProps } from '../forms/InputDate/InputDateComponent';
|
|
3
|
+
interface Props extends Omit<InputDateProps, 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `InputDate` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* Value is stored in form state as iso date string (example: `"2023-08-01T22:00:00.000Z"` ).
|
|
12
|
+
* @see InputDate
|
|
13
|
+
*/
|
|
14
|
+
declare function HookedInputDate({ name, ...props }: Props): JSX.Element;
|
|
15
|
+
declare namespace HookedInputDate {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export { HookedInputDate };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputDateRangeProps } from '../forms/InputDateRange';
|
|
3
|
+
interface Props extends Omit<InputDateRangeProps, 'onChange' | 'value'> {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `InputDateRange` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* Value is stored in form state as tuple of two iso date strings
|
|
12
|
+
* (example: `["2023-08-01T22:00:00.000Z", "2023-08-14T22:00:00.000Z"]` ).
|
|
13
|
+
* @see InputDateRange
|
|
14
|
+
*/
|
|
15
|
+
declare function HookedInputDateRange({ name, ...props }: Props): JSX.Element;
|
|
16
|
+
declare namespace HookedInputDateRange {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
export { HookedInputDateRange };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* field name to match hook-form state
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `InputMetadata` component ready to be used with the `react-hook-form` context.
|
|
10
|
+
* Metadata is stored in form state as object of strings (example: `{foo: 'bar'}` )
|
|
11
|
+
* and should match the core api metadata structure. Non-string values are ignored and will not appear
|
|
12
|
+
* in the form state.
|
|
13
|
+
* @see InputMetadata
|
|
14
|
+
*/
|
|
15
|
+
declare function HookedInputMetadata({ name }: Props): JSX.Element;
|
|
16
|
+
declare namespace HookedInputMetadata {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
export { HookedInputMetadata };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputSelectProps } from '../forms/InputSelect';
|
|
3
|
+
interface Props extends Omit<InputSelectProps, 'onSelect' | 'defaultValue'> {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Specify the path (in the `SelectValue` object) to reach the value to store in field.
|
|
10
|
+
* @default
|
|
11
|
+
* "value"
|
|
12
|
+
*
|
|
13
|
+
* Example:
|
|
14
|
+
* ```
|
|
15
|
+
* // single mode
|
|
16
|
+
* {value: 'ff0000', label: 'Red'} // set field value as 'ff0000'
|
|
17
|
+
*
|
|
18
|
+
* // multi mode
|
|
19
|
+
* [{value: 'ff0000', label: 'Red'}, {value: 'ffff00', label: 'Yellow'}]
|
|
20
|
+
* // set field value as ['ff0000', 'ffff00']
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
pathToValue?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `InputSelect` component ready to be used with the `react-hook-form` context.
|
|
27
|
+
* Value to be stored in the field can be controlled from the `pathToValue` prop.
|
|
28
|
+
* @see InputSelect
|
|
29
|
+
*/
|
|
30
|
+
declare function HookedInputSelect({ name, pathToValue, ...props }: Props): JSX.Element;
|
|
31
|
+
declare namespace HookedInputSelect {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
export { HookedInputSelect };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputSpinnerProps } from '../forms/InputSpinner';
|
|
3
|
+
interface Props extends Omit<InputSpinnerProps, 'onChange' | 'defaultValues'> {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `InputSpinner` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* @see InputSpinner
|
|
12
|
+
*/
|
|
13
|
+
declare function HookedInputSpinner({ name, ...props }: Props): JSX.Element;
|
|
14
|
+
declare namespace HookedInputSpinner {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
export { HookedInputSpinner };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputToggleBoxProps } from '../forms/InputToggleBox';
|
|
3
|
+
interface Props extends InputToggleBoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* show validation error message underneath
|
|
10
|
+
*/
|
|
11
|
+
showValidation?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `InputToggleBox` component ready to be used with the `react-hook-form` context.
|
|
15
|
+
* @see InputToggleBox
|
|
16
|
+
*/
|
|
17
|
+
declare function HookedInputToggleBox({ name, showValidation, ...props }: Props): JSX.Element;
|
|
18
|
+
declare namespace HookedInputToggleBox {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
export { HookedInputToggleBox };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputToggleListBoxProps } from '../forms/InputToggleListBox';
|
|
3
|
+
interface Props extends InputToggleListBoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* show validation error message underneath
|
|
10
|
+
*/
|
|
11
|
+
showValidation?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `InputToggleListBox` component ready to be used with the `react-hook-form` context.
|
|
15
|
+
* @see InputToggleListBox
|
|
16
|
+
*/
|
|
17
|
+
declare function HookedInputToggleListBox({ name, showValidation, ...props }: Props): JSX.Element;
|
|
18
|
+
declare namespace HookedInputToggleListBox {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
export { HookedInputToggleListBox };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type RelationshipSelectorProps } from '../resources/RelationshipSelector';
|
|
3
|
+
interface Props extends Omit<RelationshipSelectorProps, 'onChange' | 'defaultValues'> {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `RelationshipSelector` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* Since it will perform api requests to fetch list of options, it also needs to access `CoreSdkProvider` context.
|
|
12
|
+
* @see RelationshipSelector
|
|
13
|
+
*/
|
|
14
|
+
declare function HookedRelationshipSelector({ name, ...props }: Props): JSX.Element;
|
|
15
|
+
declare namespace HookedRelationshipSelector {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export { HookedRelationshipSelector };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ToggleButtonsProps } from '../forms/ToggleButtons';
|
|
3
|
+
type Props = Omit<ToggleButtonsProps, 'value' | 'onChange'> & {
|
|
4
|
+
/**
|
|
5
|
+
* field name to match hook-form state
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* `ToggleButtons` component ready to be used with the `react-hook-form` context.
|
|
11
|
+
* Stored value will be a string when used as `mode="single"` or an array of strings when `mode="multiple"`.
|
|
12
|
+
* @see ToggleButtons
|
|
13
|
+
*/
|
|
14
|
+
declare function HookedToggleButtons({ name, ...props }: Props): JSX.Element;
|
|
15
|
+
declare namespace HookedToggleButtons {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export { HookedToggleButtons };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ValidationApiErrorProps {
|
|
3
|
+
/**
|
|
4
|
+
* An error object returned from a failed API request.
|
|
5
|
+
* We expect an object that contain an `errors` property with the Core Api error items shape.
|
|
6
|
+
*/
|
|
7
|
+
apiError: any;
|
|
8
|
+
/**
|
|
9
|
+
* Optional map of app field names to API error field names.
|
|
10
|
+
* This is useful when the API returns field names that are different from the app field names.
|
|
11
|
+
* For example, if the API returns `first_name` instead of `firstName`, you can pass `{ first_name: 'firstName' }`.
|
|
12
|
+
*
|
|
13
|
+
* Format is:
|
|
14
|
+
* ```{ apiFieldName: appFieldName }```
|
|
15
|
+
*/
|
|
16
|
+
fieldMap?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
declare function HookedValidationApiError({ apiError, fieldMap }: ValidationApiErrorProps): JSX.Element;
|
|
19
|
+
declare namespace HookedValidationApiError {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
export { HookedValidationApiError };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* field name to match hook-form state
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
declare function HookedValidationError({ name }: Props): JSX.Element | null;
|
|
9
|
+
declare namespace HookedValidationError {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export { HookedValidationError };
|