powell-react 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +36892 -59
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/api/PowellProvider.d.ts +5 -0
- package/dist/cjs/types/api/configService.d.ts +2 -0
- package/dist/cjs/types/api/forms.d.ts +73 -0
- package/dist/cjs/types/api/index.d.ts +5 -0
- package/dist/cjs/types/api/powellDefaults.d.ts +2 -0
- package/dist/cjs/types/api/primereact.d.ts +981 -0
- package/dist/cjs/types/components/AutoComplete/AutoComplete.d.ts +24 -0
- package/dist/cjs/types/components/AutoComplete/index.d.ts +1 -0
- package/dist/cjs/types/components/Button/Button.d.ts +21 -6
- package/dist/cjs/types/components/Button/index.d.ts +1 -2
- package/dist/cjs/types/components/CascadeSelect/CascadeSelect.d.ts +24 -0
- package/dist/cjs/types/components/CascadeSelect/index.d.ts +1 -0
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +21 -0
- package/dist/cjs/types/components/Checkbox/index.d.ts +1 -0
- package/dist/cjs/types/components/Chips/Chips.d.ts +24 -0
- package/dist/cjs/types/components/Chips/index.d.ts +1 -0
- package/dist/cjs/types/components/ColorPicker/ColorPicker.d.ts +24 -0
- package/dist/cjs/types/components/ColorPicker/index.d.ts +1 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +24 -0
- package/dist/cjs/types/components/Dropdown/index.d.ts +1 -0
- package/dist/cjs/types/components/Editor/Editor.d.ts +23 -0
- package/dist/cjs/types/components/Editor/index.d.ts +1 -0
- package/dist/cjs/types/components/FormContainer/FormContainer.d.ts +7 -0
- package/dist/cjs/types/components/FormContainer/FormContext.d.ts +4 -0
- package/dist/cjs/types/components/FormContainer/index.d.ts +2 -0
- package/dist/cjs/types/components/InputMask/InputMask.d.ts +24 -0
- package/dist/cjs/types/components/InputMask/index.d.ts +1 -0
- package/dist/cjs/types/components/InputNumber/InputNumber.d.ts +24 -0
- package/dist/cjs/types/components/InputNumber/index.d.ts +1 -0
- package/dist/cjs/types/components/InputOtp/InputOtp.d.ts +21 -0
- package/dist/cjs/types/components/InputOtp/index.d.ts +1 -0
- package/dist/cjs/types/components/InputPassword/InputPassword.d.ts +24 -0
- package/dist/cjs/types/components/InputPassword/index.d.ts +1 -0
- package/dist/cjs/types/components/InputSwitch/InputSwitch.d.ts +21 -0
- package/dist/cjs/types/components/InputSwitch/index.d.ts +1 -0
- package/dist/cjs/types/components/InputText/InputText.d.ts +24 -0
- package/dist/cjs/types/components/InputText/index.d.ts +1 -0
- package/dist/cjs/types/components/InputTextarea/InputTextarea.d.ts +23 -0
- package/dist/cjs/types/components/InputTextarea/index.d.ts +1 -0
- package/dist/cjs/types/components/Knob/Knob.d.ts +21 -0
- package/dist/cjs/types/components/Knob/index.d.ts +1 -0
- package/dist/cjs/types/components/ListBox/ListBox.d.ts +21 -0
- package/dist/cjs/types/components/ListBox/index.d.ts +1 -0
- package/dist/cjs/types/components/Mention/Mention.d.ts +24 -0
- package/dist/cjs/types/components/Mention/index.d.ts +1 -0
- package/dist/cjs/types/components/MultiSelect/MultiSelect.d.ts +24 -0
- package/dist/cjs/types/components/MultiSelect/index.d.ts +1 -0
- package/dist/cjs/types/components/MultiStateCheckbox/MultiStateCheckbox.d.ts +21 -0
- package/dist/cjs/types/components/MultiStateCheckbox/index.d.ts +1 -0
- package/dist/cjs/types/components/RadioGroup/RadioGroup.d.ts +24 -0
- package/dist/cjs/types/components/RadioGroup/index.d.ts +1 -0
- package/dist/cjs/types/components/Rating/Rating.d.ts +21 -0
- package/dist/cjs/types/components/Rating/index.d.ts +1 -0
- package/dist/cjs/types/components/SelectButton/SelectButton.d.ts +21 -0
- package/dist/cjs/types/components/SelectButton/index.d.ts +1 -0
- package/dist/cjs/types/components/Slider/Slider.d.ts +21 -0
- package/dist/cjs/types/components/Slider/index.d.ts +1 -0
- package/dist/cjs/types/components/ToggleButton/ToggleButton.d.ts +21 -0
- package/dist/cjs/types/components/ToggleButton/index.d.ts +1 -0
- package/dist/cjs/types/components/TreeSelect/TreeSelect.d.ts +24 -0
- package/dist/cjs/types/components/TreeSelect/index.d.ts +1 -0
- package/dist/cjs/types/components/TriStateCheckbox/TriStateCheckbox.d.ts +21 -0
- package/dist/cjs/types/components/TriStateCheckbox/index.d.ts +1 -0
- package/dist/cjs/types/components22/Button/Button.d.ts +7 -0
- package/dist/cjs/types/components22/Button/index.d.ts +2 -0
- package/dist/cjs/types/hooks/index.d.ts +3 -0
- package/dist/cjs/types/hooks/useApplyConfig.d.ts +17 -0
- package/dist/cjs/types/hooks/useFormContext.d.ts +2 -0
- package/dist/cjs/types/hooks/usePowellConfig.d.ts +2 -0
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/cjs/types/models/common.d.ts +7 -0
- package/dist/cjs/types/models/config.d.ts +13 -0
- package/dist/cjs/types/models/forms.d.ts +28 -0
- package/dist/cjs/types/models/index.d.ts +3 -0
- package/dist/cjs/types/utils/globalState.d.ts +19 -0
- package/dist/cjs/types/utils/index.d.ts +2 -0
- package/dist/cjs/types/utils/utilsService.d.ts +8 -0
- package/dist/esm/index.js +36893 -59
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api/PowellProvider.d.ts +5 -0
- package/dist/esm/types/api/configService.d.ts +2 -0
- package/dist/esm/types/api/forms.d.ts +73 -0
- package/dist/esm/types/api/index.d.ts +5 -0
- package/dist/esm/types/api/powellDefaults.d.ts +2 -0
- package/dist/esm/types/api/primereact.d.ts +981 -0
- package/dist/esm/types/components/AutoComplete/AutoComplete.d.ts +24 -0
- package/dist/esm/types/components/AutoComplete/index.d.ts +1 -0
- package/dist/esm/types/components/Button/Button.d.ts +21 -6
- package/dist/esm/types/components/Button/index.d.ts +1 -2
- package/dist/esm/types/components/CascadeSelect/CascadeSelect.d.ts +24 -0
- package/dist/esm/types/components/CascadeSelect/index.d.ts +1 -0
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +21 -0
- package/dist/esm/types/components/Checkbox/index.d.ts +1 -0
- package/dist/esm/types/components/Chips/Chips.d.ts +24 -0
- package/dist/esm/types/components/Chips/index.d.ts +1 -0
- package/dist/esm/types/components/ColorPicker/ColorPicker.d.ts +24 -0
- package/dist/esm/types/components/ColorPicker/index.d.ts +1 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +24 -0
- package/dist/esm/types/components/Dropdown/index.d.ts +1 -0
- package/dist/esm/types/components/Editor/Editor.d.ts +23 -0
- package/dist/esm/types/components/Editor/index.d.ts +1 -0
- package/dist/esm/types/components/FormContainer/FormContainer.d.ts +7 -0
- package/dist/esm/types/components/FormContainer/FormContext.d.ts +4 -0
- package/dist/esm/types/components/FormContainer/index.d.ts +2 -0
- package/dist/esm/types/components/InputMask/InputMask.d.ts +24 -0
- package/dist/esm/types/components/InputMask/index.d.ts +1 -0
- package/dist/esm/types/components/InputNumber/InputNumber.d.ts +24 -0
- package/dist/esm/types/components/InputNumber/index.d.ts +1 -0
- package/dist/esm/types/components/InputOtp/InputOtp.d.ts +21 -0
- package/dist/esm/types/components/InputOtp/index.d.ts +1 -0
- package/dist/esm/types/components/InputPassword/InputPassword.d.ts +24 -0
- package/dist/esm/types/components/InputPassword/index.d.ts +1 -0
- package/dist/esm/types/components/InputSwitch/InputSwitch.d.ts +21 -0
- package/dist/esm/types/components/InputSwitch/index.d.ts +1 -0
- package/dist/esm/types/components/InputText/InputText.d.ts +24 -0
- package/dist/esm/types/components/InputText/index.d.ts +1 -0
- package/dist/esm/types/components/InputTextarea/InputTextarea.d.ts +23 -0
- package/dist/esm/types/components/InputTextarea/index.d.ts +1 -0
- package/dist/esm/types/components/Knob/Knob.d.ts +21 -0
- package/dist/esm/types/components/Knob/index.d.ts +1 -0
- package/dist/esm/types/components/ListBox/ListBox.d.ts +21 -0
- package/dist/esm/types/components/ListBox/index.d.ts +1 -0
- package/dist/esm/types/components/Mention/Mention.d.ts +24 -0
- package/dist/esm/types/components/Mention/index.d.ts +1 -0
- package/dist/esm/types/components/MultiSelect/MultiSelect.d.ts +24 -0
- package/dist/esm/types/components/MultiSelect/index.d.ts +1 -0
- package/dist/esm/types/components/MultiStateCheckbox/MultiStateCheckbox.d.ts +21 -0
- package/dist/esm/types/components/MultiStateCheckbox/index.d.ts +1 -0
- package/dist/esm/types/components/RadioGroup/RadioGroup.d.ts +24 -0
- package/dist/esm/types/components/RadioGroup/index.d.ts +1 -0
- package/dist/esm/types/components/Rating/Rating.d.ts +21 -0
- package/dist/esm/types/components/Rating/index.d.ts +1 -0
- package/dist/esm/types/components/SelectButton/SelectButton.d.ts +21 -0
- package/dist/esm/types/components/SelectButton/index.d.ts +1 -0
- package/dist/esm/types/components/Slider/Slider.d.ts +21 -0
- package/dist/esm/types/components/Slider/index.d.ts +1 -0
- package/dist/esm/types/components/ToggleButton/ToggleButton.d.ts +21 -0
- package/dist/esm/types/components/ToggleButton/index.d.ts +1 -0
- package/dist/esm/types/components/TreeSelect/TreeSelect.d.ts +24 -0
- package/dist/esm/types/components/TreeSelect/index.d.ts +1 -0
- package/dist/esm/types/components/TriStateCheckbox/TriStateCheckbox.d.ts +21 -0
- package/dist/esm/types/components/TriStateCheckbox/index.d.ts +1 -0
- package/dist/esm/types/components22/Button/Button.d.ts +7 -0
- package/dist/esm/types/components22/Button/index.d.ts +2 -0
- package/dist/esm/types/hooks/index.d.ts +3 -0
- package/dist/esm/types/hooks/useApplyConfig.d.ts +17 -0
- package/dist/esm/types/hooks/useFormContext.d.ts +2 -0
- package/dist/esm/types/hooks/usePowellConfig.d.ts +2 -0
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/models/common.d.ts +7 -0
- package/dist/esm/types/models/config.d.ts +13 -0
- package/dist/esm/types/models/forms.d.ts +28 -0
- package/dist/esm/types/models/index.d.ts +3 -0
- package/dist/esm/types/utils/globalState.d.ts +19 -0
- package/dist/esm/types/utils/index.d.ts +2 -0
- package/dist/esm/types/utils/utilsService.d.ts +8 -0
- package/dist/index.d.ts +22 -7
- package/package.json +1 -1
- /package/dist/cjs/types/{components → components22}/Input/Input.d.ts +0 -0
- /package/dist/cjs/types/{components → components22}/Input/index.d.ts +0 -0
- /package/dist/cjs/types/{components → components22}/index.d.ts +0 -0
- /package/dist/esm/types/{components → components22}/Input/Input.d.ts +0 -0
- /package/dist/esm/types/{components → components22}/Input/index.d.ts +0 -0
- /package/dist/esm/types/{components → components22}/index.d.ts +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { FixLabelPosition } from "@models";
|
3
|
+
import { $SelectButtonProps } from "@api";
|
4
|
+
import { SafeAny } from "@models";
|
5
|
+
import './SelectButton.scss';
|
6
|
+
interface SelectButtonProps extends Omit<$SelectButtonProps, 'checked'> {
|
7
|
+
checked?: boolean;
|
8
|
+
name?: string;
|
9
|
+
parseError?: (error: string) => ReactNode;
|
10
|
+
transform?: {
|
11
|
+
input?: (value: SafeAny) => string;
|
12
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
13
|
+
};
|
14
|
+
showRequiredStar?: boolean;
|
15
|
+
rtl?: boolean;
|
16
|
+
label?: string;
|
17
|
+
hint?: string;
|
18
|
+
labelPosition?: FixLabelPosition;
|
19
|
+
}
|
20
|
+
export declare const SelectButton: (props: SelectButtonProps) => import("react/jsx-runtime").JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./SelectButton";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { FixLabelPosition } from "@models";
|
3
|
+
import { $SliderProps } from "@api";
|
4
|
+
import { SafeAny } from "@models";
|
5
|
+
import './Slider.scss';
|
6
|
+
interface SliderProps extends Omit<$SliderProps, 'checked'> {
|
7
|
+
checked?: boolean;
|
8
|
+
name?: string;
|
9
|
+
parseError?: (error: string) => ReactNode;
|
10
|
+
transform?: {
|
11
|
+
input?: (value: SafeAny) => string;
|
12
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
13
|
+
};
|
14
|
+
showRequiredStar?: boolean;
|
15
|
+
rtl?: boolean;
|
16
|
+
label?: string;
|
17
|
+
hint?: string;
|
18
|
+
labelPosition?: FixLabelPosition;
|
19
|
+
}
|
20
|
+
export declare const Slider: (props: SliderProps) => import("react/jsx-runtime").JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./Slider";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { FixLabelPosition } from "@models";
|
3
|
+
import { $ToggleButtonProps } from "@api";
|
4
|
+
import { SafeAny } from "@models";
|
5
|
+
import './ToggleButton.scss';
|
6
|
+
interface ToggleButtonProps extends Omit<$ToggleButtonProps, 'checked'> {
|
7
|
+
checked?: boolean;
|
8
|
+
name?: string;
|
9
|
+
parseError?: (error: string) => ReactNode;
|
10
|
+
transform?: {
|
11
|
+
input?: (value: SafeAny) => string;
|
12
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
13
|
+
};
|
14
|
+
showRequiredStar?: boolean;
|
15
|
+
rtl?: boolean;
|
16
|
+
label?: string;
|
17
|
+
hint?: string;
|
18
|
+
labelPosition?: FixLabelPosition;
|
19
|
+
}
|
20
|
+
export declare const ToggleButton: (props: ToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./ToggleButton";
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { Addon, LabelPosition, Size } from "@models";
|
3
|
+
import { $IconFieldProps, $TreeSelectProps } from "@api";
|
4
|
+
import { SafeAny } from "@models";
|
5
|
+
import './TreeSelect.scss';
|
6
|
+
interface TreeSelectProps extends $TreeSelectProps {
|
7
|
+
name?: string;
|
8
|
+
parseError?: (error: string) => ReactNode;
|
9
|
+
transform?: {
|
10
|
+
input?: (value: SafeAny) => string;
|
11
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
12
|
+
};
|
13
|
+
showRequiredStar?: boolean;
|
14
|
+
rtl?: boolean;
|
15
|
+
label?: string;
|
16
|
+
icon?: string | ReactNode;
|
17
|
+
hint?: string;
|
18
|
+
inputSize?: Size;
|
19
|
+
addon?: Addon;
|
20
|
+
iconPosition?: $IconFieldProps["iconPosition"];
|
21
|
+
labelPosition?: LabelPosition;
|
22
|
+
}
|
23
|
+
export declare const TreeSelect: (props: TreeSelectProps) => import("react/jsx-runtime").JSX.Element;
|
24
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./TreeSelect";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { FixLabelPosition } from "@models";
|
3
|
+
import { $TriStateCheckboxProps } from "@api";
|
4
|
+
import { SafeAny } from "@models";
|
5
|
+
import './TriStateCheckbox.scss';
|
6
|
+
interface TriStateCheckboxProps extends Omit<$TriStateCheckboxProps, 'checked'> {
|
7
|
+
checked?: boolean;
|
8
|
+
name?: string;
|
9
|
+
parseError?: (error: string) => ReactNode;
|
10
|
+
transform?: {
|
11
|
+
input?: (value: SafeAny) => string;
|
12
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
13
|
+
};
|
14
|
+
showRequiredStar?: boolean;
|
15
|
+
rtl?: boolean;
|
16
|
+
label?: string;
|
17
|
+
hint?: string;
|
18
|
+
labelPosition?: FixLabelPosition;
|
19
|
+
}
|
20
|
+
export declare const TriStateCheckbox: (props: TriStateCheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./TriStateCheckbox";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { PowellConfig } from "@models";
|
2
|
+
interface ApplyConfigOptions {
|
3
|
+
isFixLabel?: boolean;
|
4
|
+
sizable?: boolean;
|
5
|
+
}
|
6
|
+
interface CommonConfigProps {
|
7
|
+
rtl?: PowellConfig["rtl"];
|
8
|
+
showRequiredStar?: PowellConfig["showRequiredStar"];
|
9
|
+
labelPosition?: PowellConfig["labelPosition"];
|
10
|
+
inputSize?: PowellConfig["inputSize"];
|
11
|
+
}
|
12
|
+
export declare const useApplyConfig: <T extends CommonConfigProps>(props: T, options?: ApplyConfigOptions) => T & {
|
13
|
+
rtl: boolean | undefined;
|
14
|
+
showRequiredStar: boolean | undefined;
|
15
|
+
labelPosition: import("@models").LabelPosition | undefined;
|
16
|
+
};
|
17
|
+
export {};
|
@@ -1 +1 @@
|
|
1
|
-
export
|
1
|
+
export { Button } from "./components/Button";
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export type ButtonAppearance = 'default' | 'text' | 'outlined' | 'link';
|
2
|
+
export type Direction = 'rtl' | 'ltr';
|
3
|
+
export type Size = 'sm' | 'md' | 'lg';
|
4
|
+
export type Orientation = 'horizontal' | 'vertical';
|
5
|
+
export type Position = 'left' | 'right' | 'top' | 'bottom';
|
6
|
+
export type Nullable<T = void> = T | null | undefined;
|
7
|
+
export type SafeAny = any;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { $APIOptions } from "@api";
|
2
|
+
import { FixLabelPosition, LabelPosition, Size } from "@models";
|
3
|
+
export type ThemeName = "arya-blue" | "arya-green" | "arya-orange" | "arya-purple" | "bootstrap4-dark-blue" | "bootstrap4-dark-purple" | "bootstrap4-light-blue" | "bootstrap4-light-purple" | "fluent-light" | "lara-dark-amber" | "lara-dark-blue" | "lara-dark-cyan" | "lara-dark-green" | "lara-dark-indigo" | "lara-dark-pink" | "lara-dark-purple" | "lara-dark-teal" | "lara-light-amber" | "lara-light-blue" | "lara-light-cyan" | "lara-light-green" | "lara-light-indigo" | "lara-light-pink" | "lara-light-purple" | "lara-light-teal" | "luna-amber" | "luna-blue" | "luna-green" | "luna-pink" | "md-dark-deeppurple" | "md-dark-indigo" | "md-light-deeppurple" | "md-light-indigo" | "mdc-dark-deeppurple" | "mdc-dark-indigo" | "mdc-light-deeppurple" | "mdc-light-indigo" | "mira" | "nano" | "nova" | "nova-accent" | "nova-alt" | "rhea" | "saga-blue" | "saga-green" | "saga-orange" | "saga-purple" | "soho-dark" | "soho-light" | "tailwind-light" | "vela-blue" | "vela-green" | "vela-orange" | "vela-purple" | "viva-dark" | "viva-light";
|
4
|
+
type OmittedApiOptions = Omit<$APIOptions, "setAppendTo" | "setStyleContainer" | "setAutoZIndex" | "setCssTransition" | "setFilterMatchModeOptions" | "setHideOverlaysOnDocumentScrolling" | "setInputStyle" | "setLocale" | "setNonce" | "setNullSortOrder" | "setRipple" | "setZIndex" | "setPt" | "changeTheme">;
|
5
|
+
export interface PowellConfig extends OmittedApiOptions {
|
6
|
+
theme?: ThemeName;
|
7
|
+
rtl?: boolean;
|
8
|
+
showRequiredStar?: boolean;
|
9
|
+
inputSize?: Size;
|
10
|
+
labelPosition?: LabelPosition;
|
11
|
+
fixLabelPosition?: FixLabelPosition;
|
12
|
+
}
|
13
|
+
export {};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { $ButtonProps } from "@api";
|
2
|
+
import { ButtonAppearance, Position, SafeAny } from "@models";
|
3
|
+
import { MouseEvent } from "react";
|
4
|
+
export type LabelPosition = 'float' | 'fix-side' | 'fix-top';
|
5
|
+
export type FixLabelPosition = Exclude<LabelPosition, 'float'>;
|
6
|
+
export type IconPosition = Exclude<Position, 'top' | 'bottom'>;
|
7
|
+
export interface AddonConfig {
|
8
|
+
type: 'button' | 'icon' | 'text';
|
9
|
+
label?: string;
|
10
|
+
severity?: $ButtonProps["severity"];
|
11
|
+
appearance?: ButtonAppearance;
|
12
|
+
icon?: string;
|
13
|
+
iconPosition?: IconPosition;
|
14
|
+
text?: string;
|
15
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
16
|
+
}
|
17
|
+
export interface Addon {
|
18
|
+
before?: AddonConfig;
|
19
|
+
after?: AddonConfig;
|
20
|
+
}
|
21
|
+
export type TransformOptions<V = SafeAny, T = SafeAny> = {
|
22
|
+
value: V;
|
23
|
+
onChange: (...event: V[]) => void;
|
24
|
+
transform?: {
|
25
|
+
input?: (value: V) => SafeAny;
|
26
|
+
output?: (...event: T[]) => SafeAny;
|
27
|
+
};
|
28
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { SetStateAction } from "react";
|
2
|
+
type Set<T> = (newState: SetStateAction<T>, callback?: (newState: T) => void) => void;
|
3
|
+
type UseSelector<T> = <TSelected = unknown>(selector: (state: T) => TSelected, equalityFn?: Comparator<TSelected>) => TSelected;
|
4
|
+
export interface StateWithValue<T> {
|
5
|
+
use: () => [T, Set<T>];
|
6
|
+
useValue: () => T;
|
7
|
+
get: () => T;
|
8
|
+
useSelector: UseSelector<T>;
|
9
|
+
set: Set<T>;
|
10
|
+
reset: () => void;
|
11
|
+
subscribe(subscriber: SubscriberFunc<T>): () => void;
|
12
|
+
}
|
13
|
+
type SubscriberFunc<T> = (newState: T, previousState: T) => void;
|
14
|
+
interface Options<T> {
|
15
|
+
onSet?: SubscriberFunc<T>;
|
16
|
+
}
|
17
|
+
type Comparator<TSelected = unknown> = (a: TSelected, b: TSelected) => boolean;
|
18
|
+
export declare function globalState<T>(initialValue: T, options?: Options<T>): StateWithValue<T>;
|
19
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { AddonConfig, TransformOptions } from "@models";
|
2
|
+
import { $FormikContextType, $FormikValues } from "@api";
|
3
|
+
export declare const getAddonTemplate: (config?: AddonConfig) => import("react/jsx-runtime").JSX.Element;
|
4
|
+
export declare const isRequiredField: (formContext: $FormikContextType<$FormikValues> | null, name: string | undefined) => any;
|
5
|
+
export declare const transformer: <V = any, T = any>(options: TransformOptions<V, T>) => {
|
6
|
+
value: V;
|
7
|
+
onChange: (...event: T[]) => void;
|
8
|
+
};
|