@react-fabric/form 1.0.0-beta.8 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src/input/ArrayInput.module.css → css/_arrayInput.css} +8 -8
- package/css/_colorPicker.css +95 -0
- package/{src/internal/Field.module.css → css/_field.css} +94 -33
- package/{src/input/File.module.css → css/_file.css} +21 -6
- package/css/styles.css +27 -0
- package/dist/cjs/builder/FileField.js +107 -78
- package/dist/cjs/builder/FormField.js +60 -39
- package/dist/cjs/builder/SchemaEditor.js +72 -0
- package/dist/cjs/builder/components/AddSchemaFields.js +64 -0
- package/dist/cjs/builder/components/SchemaArrayForm.js +146 -0
- package/dist/cjs/builder/components/SchemaField.js +423 -0
- package/dist/cjs/form/Controller.js +66 -19
- package/dist/cjs/form/Form.js +97 -39
- package/dist/cjs/form/useForm.js +32 -0
- package/dist/cjs/hooks/useFileUploader.js +74 -45
- package/dist/cjs/hooks/useFormBuilder.js +85 -31
- package/dist/cjs/i18n/{ar.json.js → ar/form.json.js} +5 -4
- package/dist/cjs/i18n/{en.json.js → en/form.json.js} +5 -5
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/index.js +41 -2
- package/dist/cjs/input/ArrayInput.js +259 -135
- package/dist/cjs/input/AvatarInput.js +99 -63
- package/dist/cjs/input/Checkbox.js +24 -25
- package/dist/cjs/input/ColorInput.js +138 -81
- package/dist/cjs/input/ColorPicker.js +78 -95
- package/dist/cjs/input/DateInput.js +192 -0
- package/dist/cjs/input/Field.js +21 -20
- package/dist/cjs/input/File.js +85 -80
- package/dist/cjs/input/Hidden.js +27 -13
- package/dist/cjs/input/Input.js +49 -48
- package/dist/cjs/input/Number.js +46 -44
- package/dist/cjs/input/Password.js +51 -49
- package/dist/cjs/input/Radio.js +26 -16
- package/dist/cjs/input/RadioGroup.js +26 -11
- package/dist/cjs/input/{Range.js → RangeSlider.js} +61 -66
- package/dist/cjs/input/Search.js +58 -64
- package/dist/cjs/input/Slider.js +57 -66
- package/dist/cjs/input/Switch.js +29 -27
- package/dist/cjs/input/Textarea.js +65 -53
- package/dist/cjs/internal/ErrorIcon.js +9 -9
- package/dist/cjs/internal/FieldWrapper.js +23 -13
- package/dist/cjs/internal/InputWrapper.js +85 -87
- package/dist/cjs/ranger/index.js +7 -7
- package/dist/cjs/ranger/utils.js +9 -4
- package/dist/cjs/select/AutoComplete.js +93 -76
- package/dist/cjs/select/DualList.js +235 -154
- package/dist/cjs/select/List.js +122 -89
- package/dist/cjs/select/Options.js +58 -54
- package/dist/cjs/select/Select.js +119 -89
- package/dist/cjs/select/helpers.js +5 -5
- package/dist/cjs/select/useSelect.js +83 -58
- package/dist/cjs/types/schema.js +43 -0
- package/dist/cjs/utils/eventHandlers.js +16 -6
- package/dist/cjs/utils/getColor.js +6 -6
- package/dist/cjs/utils/getProps.js +49 -0
- package/dist/esm/builder/FileField.js +109 -80
- package/dist/esm/builder/FormField.js +60 -39
- package/dist/esm/builder/SchemaEditor.js +72 -0
- package/dist/esm/builder/components/AddSchemaFields.js +64 -0
- package/dist/esm/builder/components/SchemaArrayForm.js +146 -0
- package/dist/esm/builder/components/SchemaField.js +423 -0
- package/dist/esm/form/Controller.js +66 -19
- package/dist/esm/form/Form.js +97 -39
- package/dist/esm/form/useForm.js +32 -0
- package/dist/esm/hooks/useFileUploader.js +75 -46
- package/dist/esm/hooks/useFormBuilder.js +84 -30
- package/dist/esm/i18n/{ar.json.js → ar/form.json.js} +5 -4
- package/dist/esm/i18n/{en.json.js → en/form.json.js} +5 -5
- package/dist/esm/i18n/index.js +2 -2
- package/dist/esm/index.js +36 -1
- package/dist/esm/input/ArrayInput.js +260 -136
- package/dist/esm/input/AvatarInput.js +99 -63
- package/dist/esm/input/Checkbox.js +26 -27
- package/dist/esm/input/ColorInput.js +141 -84
- package/dist/esm/input/ColorPicker.js +80 -97
- package/dist/esm/input/DateInput.js +192 -0
- package/dist/esm/input/Field.js +21 -20
- package/dist/esm/input/File.js +89 -84
- package/dist/esm/input/Hidden.js +28 -14
- package/dist/esm/input/Input.js +51 -50
- package/dist/esm/input/Number.js +48 -46
- package/dist/esm/input/Password.js +54 -52
- package/dist/esm/input/Radio.js +27 -17
- package/dist/esm/input/RadioGroup.js +27 -12
- package/dist/esm/input/{Range.js → RangeSlider.js} +62 -67
- package/dist/esm/input/Search.js +61 -67
- package/dist/esm/input/Slider.js +58 -67
- package/dist/esm/input/Switch.js +31 -29
- package/dist/esm/input/Textarea.js +67 -55
- package/dist/esm/internal/ErrorIcon.js +11 -11
- package/dist/esm/internal/FieldWrapper.js +23 -13
- package/dist/esm/internal/InputWrapper.js +88 -90
- package/dist/esm/ranger/index.js +7 -7
- package/dist/esm/ranger/utils.js +9 -4
- package/dist/esm/select/AutoComplete.js +95 -78
- package/dist/esm/select/DualList.js +233 -152
- package/dist/esm/select/List.js +125 -92
- package/dist/esm/select/Options.js +58 -54
- package/dist/esm/select/Select.js +122 -92
- package/dist/esm/select/helpers.js +5 -5
- package/dist/esm/select/useSelect.js +84 -59
- package/{src/input/ColorPicker.module.css → dist/esm/types/schema.js} +18 -27
- package/dist/esm/utils/eventHandlers.js +16 -6
- package/dist/esm/utils/getColor.js +6 -6
- package/dist/esm/utils/getProps.js +49 -0
- package/dist/types/builder/FileField.d.ts +7 -4
- package/dist/types/builder/FormField.d.ts +4 -2
- package/dist/types/builder/SchemaEditor.d.ts +6 -0
- package/dist/types/builder/components/AddSchemaFields.d.ts +2 -0
- package/dist/types/builder/components/SchemaArrayForm.d.ts +2 -0
- package/dist/types/builder/components/SchemaField.d.ts +12 -0
- package/dist/types/form/Controller.d.ts +45 -3
- package/dist/types/form/Form.d.ts +38 -7
- package/dist/types/form/useForm.d.ts +6 -0
- package/dist/types/hooks/useFileUploader.d.ts +24 -3
- package/dist/types/hooks/useFormBuilder.d.ts +41 -3
- package/dist/types/index.d.ts +32 -2
- package/dist/types/input/ArrayInput.d.ts +68 -13
- package/dist/types/input/AvatarInput.d.ts +23 -6
- package/dist/types/input/Checkbox.d.ts +12 -10
- package/dist/types/input/ColorInput.d.ts +15 -5
- package/dist/types/input/ColorPicker.d.ts +10 -2
- package/dist/types/input/DateInput.d.ts +21 -0
- package/dist/types/input/Field.d.ts +9 -36
- package/dist/types/input/File.d.ts +16 -4
- package/dist/types/input/Hidden.d.ts +7 -6
- package/dist/types/input/Input.d.ts +11 -4
- package/dist/types/input/Number.d.ts +9 -4
- package/dist/types/input/Password.d.ts +9 -4
- package/dist/types/input/Radio.d.ts +9 -4
- package/dist/types/input/RadioGroup.d.ts +14 -6
- package/dist/types/input/{Range.d.ts → RangeSlider.d.ts} +11 -6
- package/dist/types/input/Search.d.ts +14 -4
- package/dist/types/input/Slider.d.ts +9 -6
- package/dist/types/input/Switch.d.ts +13 -8
- package/dist/types/input/Textarea.d.ts +15 -4
- package/dist/types/internal/ErrorIcon.d.ts +4 -1
- package/dist/types/internal/FieldWrapper.d.ts +10 -1
- package/dist/types/internal/InputWrapper.d.ts +19 -1
- package/dist/types/ranger/index.d.ts +7 -3
- package/dist/types/ranger/utils.d.ts +2 -2
- package/dist/types/select/AutoComplete.d.ts +7 -2
- package/dist/types/select/DualList.d.ts +11 -37
- package/dist/types/select/List.d.ts +7 -2
- package/dist/types/select/Options.d.ts +8 -7
- package/dist/types/select/Select.d.ts +7 -2
- package/dist/types/select/helpers.d.ts +2 -2
- package/dist/types/select/useSelect.d.ts +10 -28
- package/dist/types/types/index.d.ts +73 -39
- package/dist/types/types/schema.d.ts +78 -32
- package/dist/types/utils/eventHandlers.d.ts +4 -4
- package/dist/types/utils/getColor.d.ts +4 -4
- package/dist/types/utils/getProps.d.ts +26 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +25 -25
- package/src/builder/FileField.tsx +73 -56
- package/src/builder/FormField.tsx +66 -58
- package/src/builder/SchemaEditor.tsx +78 -0
- package/src/builder/components/AddSchemaFields.tsx +64 -0
- package/src/builder/components/SchemaArrayForm.tsx +146 -0
- package/src/builder/components/SchemaField.tsx +405 -0
- package/src/form/Controller.tsx +61 -24
- package/src/form/Form.tsx +74 -50
- package/src/form/useForm.ts +53 -0
- package/src/hooks/useFileUploader.ts +115 -84
- package/src/hooks/useFormBuilder.tsx +80 -41
- package/src/i18n/{ar.json → ar/form.json} +5 -4
- package/src/i18n/{en.json → en/form.json} +5 -5
- package/src/i18n/index.ts +2 -2
- package/src/index.ts +34 -20
- package/src/input/ArrayInput.tsx +255 -173
- package/src/input/AvatarInput.tsx +82 -39
- package/src/input/Checkbox.tsx +30 -54
- package/src/input/ColorInput.tsx +146 -105
- package/src/input/ColorPicker.tsx +76 -102
- package/src/input/DateInput.tsx +225 -0
- package/src/input/Field.tsx +23 -65
- package/src/input/File.tsx +76 -98
- package/src/input/Hidden.tsx +36 -24
- package/src/input/Input.tsx +55 -53
- package/src/input/Number.tsx +49 -54
- package/src/input/Password.tsx +61 -66
- package/src/input/Radio.tsx +28 -37
- package/src/input/RadioGroup.tsx +30 -25
- package/src/input/{Range.tsx → RangeSlider.tsx} +81 -109
- package/src/input/Search.tsx +64 -77
- package/src/input/Slider.tsx +80 -109
- package/src/input/Switch.tsx +39 -53
- package/src/input/Textarea.tsx +72 -59
- package/src/internal/ErrorIcon.tsx +22 -21
- package/src/internal/FieldWrapper.tsx +33 -23
- package/src/internal/InputWrapper.tsx +132 -143
- package/src/ranger/index.tsx +37 -117
- package/src/ranger/utils.ts +12 -11
- package/src/select/AutoComplete.tsx +113 -123
- package/src/select/DualList.tsx +218 -204
- package/src/select/List.tsx +130 -97
- package/src/select/Options.tsx +59 -57
- package/src/select/Select.tsx +148 -122
- package/src/select/helpers.ts +13 -8
- package/src/select/useSelect.tsx +110 -127
- package/src/types/index.ts +76 -45
- package/src/types/schema.ts +97 -40
- package/src/utils/eventHandlers.ts +24 -26
- package/src/utils/getColor.ts +9 -8
- package/src/utils/getProps.ts +47 -0
- package/src/utils/index.ts +1 -0
- package/dist/cjs/input/ArrayInput.module.css +0 -1
- package/dist/cjs/input/ColorPicker.module.css +0 -1
- package/dist/cjs/input/File.module.css +0 -1
- package/dist/cjs/internal/Field.module.css +0 -1
- package/dist/esm/input/ArrayInput.module.css +0 -1
- package/dist/esm/input/ColorPicker.module.css +0 -1
- package/dist/esm/input/File.module.css +0 -1
- package/dist/esm/internal/Field.module.css +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { RefProp } from "@react-fabric/core/dist/types/types";
|
|
2
|
+
import type { InputHTMLAttributes } from "react";
|
|
3
|
+
import type { InputProps, WrapperProps } from "../types";
|
|
4
|
+
export interface PasswordProps extends InputProps, WrapperProps, RefProp<HTMLInputElement> {
|
|
4
5
|
/**
|
|
5
6
|
* show password toggle
|
|
6
7
|
*/
|
|
@@ -9,5 +10,9 @@ export interface PasswordProps extends InputProps, RefProp<HTMLInputElement> {
|
|
|
9
10
|
* password strength meter (0-1)
|
|
10
11
|
*/
|
|
11
12
|
strength?: number;
|
|
13
|
+
autoComplete?: InputHTMLAttributes<HTMLInputElement>["autoComplete"];
|
|
12
14
|
}
|
|
13
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Password input component with optional strength meter and toggle visibility.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Password(props: PasswordProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { type RefProp } from "@react-fabric/core/dist/types/types";
|
|
1
|
+
import type { RefProp } from "@react-fabric/core/dist/types/types";
|
|
3
2
|
export interface RadioProps extends RefProp<HTMLInputElement> {
|
|
4
3
|
name?: string;
|
|
5
4
|
/**
|
|
6
5
|
* radio label
|
|
7
6
|
*/
|
|
8
|
-
label?:
|
|
7
|
+
label?: React.ReactElement | string;
|
|
9
8
|
/**
|
|
10
9
|
* value
|
|
11
10
|
*/
|
|
@@ -39,4 +38,10 @@ export interface RadioProps extends RefProp<HTMLInputElement> {
|
|
|
39
38
|
*/
|
|
40
39
|
iconChecked?: string;
|
|
41
40
|
}
|
|
42
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Radio input component with custom icons and label.
|
|
43
|
+
*
|
|
44
|
+
* This component renders a radio button with an optional label and custom icons for checked and unchecked states.
|
|
45
|
+
* It supports disabled and invalid states, and allows for custom width.
|
|
46
|
+
*/
|
|
47
|
+
export declare function Radio({ ref, name, label, value, invalid, disabled, width, icon, error, iconChecked, onChange, ...rest }: RadioProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export interface RadioGroupProps extends ChildrenProp<typeof Radio>, CssProp {
|
|
1
|
+
import type { ChildrenProp, CssProp } from "@react-fabric/core/dist/types/types";
|
|
2
|
+
import type { RadioProps } from "./Radio";
|
|
3
|
+
export interface RadioGroupProps extends ChildrenProp<RadioProps>, CssProp {
|
|
5
4
|
/**
|
|
6
5
|
* input label
|
|
7
6
|
*/
|
|
@@ -9,7 +8,7 @@ export interface RadioGroupProps extends ChildrenProp<typeof Radio>, CssProp {
|
|
|
9
8
|
/**
|
|
10
9
|
* append to label end
|
|
11
10
|
*/
|
|
12
|
-
appendLabel?:
|
|
11
|
+
appendLabel?: React.ReactElement | string | number | boolean;
|
|
13
12
|
/**
|
|
14
13
|
* field info
|
|
15
14
|
*/
|
|
@@ -38,9 +37,18 @@ export interface RadioGroupProps extends ChildrenProp<typeof Radio>, CssProp {
|
|
|
38
37
|
* vertical orientation
|
|
39
38
|
*/
|
|
40
39
|
vertical?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* value
|
|
42
|
+
*/
|
|
43
|
+
value?: string | number;
|
|
41
44
|
/**
|
|
42
45
|
* change handler
|
|
43
46
|
*/
|
|
44
47
|
onChange?: (value: AnyObject) => void;
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
/**
|
|
50
|
+
* RadioGroup component for rendering a group of radio buttons.
|
|
51
|
+
* It allows for customization of the label, options, and layout.
|
|
52
|
+
* The component supports inline and vertical orientations, and can handle change events.
|
|
53
|
+
*/
|
|
54
|
+
export declare function RadioGroup({ children, name, className, optionWidth, vertical, value, onChange, ...rest }: RadioGroupProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface RangeProps extends Omit<InputProps<[number, number]>, "placeholder" | "allowClear" | "children"
|
|
1
|
+
import type { InputProps, WrapperProps } from "../types";
|
|
2
|
+
export interface RangeProps extends Omit<InputProps<[number, number]>, "placeholder" | "allowClear" | "children" | "defaultValue">, WrapperProps {
|
|
3
3
|
/**
|
|
4
4
|
* min value
|
|
5
5
|
*/
|
|
@@ -35,11 +35,11 @@ export interface RangeProps extends Omit<InputProps<[number, number]>, "placehol
|
|
|
35
35
|
/**
|
|
36
36
|
* custom min label
|
|
37
37
|
*/
|
|
38
|
-
minLabel?: string;
|
|
38
|
+
minLabel?: string | React.ReactElement;
|
|
39
39
|
/**
|
|
40
40
|
* custom max label
|
|
41
41
|
*/
|
|
42
|
-
maxLabel?: string;
|
|
42
|
+
maxLabel?: string | React.ReactElement;
|
|
43
43
|
/**
|
|
44
44
|
* step ranges
|
|
45
45
|
*/
|
|
@@ -54,6 +54,11 @@ export interface RangeProps extends Omit<InputProps<[number, number]>, "placehol
|
|
|
54
54
|
onSlide?: (val: number) => void;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* RangeSlider component for rendering a range slider input.
|
|
58
|
+
* It supports vertical orientation, custom colors, step increments,
|
|
59
|
+
* min/max values, and display of labels and value tooltips.
|
|
60
|
+
* The component uses the Ranger library for handling the slider functionality.
|
|
61
|
+
* It also provides error handling and supports disabled and read-only states.
|
|
62
|
+
* The component is designed to be flexible and customizable, allowing for various configurations.
|
|
58
63
|
*/
|
|
59
|
-
export declare
|
|
64
|
+
export declare function RangeSlider(props: RangeProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface SearchProps extends InputProps, RefProp<HTMLInputElement> {
|
|
1
|
+
import type { RefProp } from "@react-fabric/core/dist/types/types";
|
|
2
|
+
import type { InputProps, WrapperProps } from "../types";
|
|
3
|
+
export interface SearchProps extends InputProps, WrapperProps, RefProp<HTMLInputElement> {
|
|
4
4
|
/**
|
|
5
5
|
* is searching
|
|
6
6
|
*/
|
|
@@ -9,9 +9,19 @@ export interface SearchProps extends InputProps, RefProp<HTMLInputElement> {
|
|
|
9
9
|
* search on value change
|
|
10
10
|
*/
|
|
11
11
|
searchOnChange?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* hide search action handle
|
|
14
|
+
*/
|
|
15
|
+
hideHandle?: boolean;
|
|
12
16
|
/**
|
|
13
17
|
* search handler
|
|
14
18
|
*/
|
|
15
19
|
onSearch?: (query?: string) => void;
|
|
16
20
|
}
|
|
17
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Search input component with optional searching state and search handler.
|
|
23
|
+
* This component allows users to input search queries and trigger a search action.
|
|
24
|
+
* It supports features like searching on value change, showing a search handle,
|
|
25
|
+
* and handling search actions with a debounce mechanism.
|
|
26
|
+
*/
|
|
27
|
+
export declare function Search(props: SearchProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface SliderProps extends Omit<InputProps<number>, "placeholder" | "allowClear" | "children"
|
|
1
|
+
import type { InputProps, WrapperProps } from "../types";
|
|
2
|
+
export interface SliderProps extends Omit<InputProps<number>, "placeholder" | "allowClear" | "children" | "defaultValue">, WrapperProps {
|
|
3
3
|
/**
|
|
4
4
|
* min value
|
|
5
5
|
*/
|
|
@@ -35,11 +35,11 @@ export interface SliderProps extends Omit<InputProps<number>, "placeholder" | "a
|
|
|
35
35
|
/**
|
|
36
36
|
* custom min label
|
|
37
37
|
*/
|
|
38
|
-
minLabel?: string;
|
|
38
|
+
minLabel?: string | React.ReactElement;
|
|
39
39
|
/**
|
|
40
40
|
* custom max label
|
|
41
41
|
*/
|
|
42
|
-
maxLabel?: string;
|
|
42
|
+
maxLabel?: string | React.ReactElement;
|
|
43
43
|
/**
|
|
44
44
|
* step ranges
|
|
45
45
|
*/
|
|
@@ -58,6 +58,9 @@ export interface SliderProps extends Omit<InputProps<number>, "placeholder" | "a
|
|
|
58
58
|
onSlide?: (val: number) => void;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Slider component for rendering a slider input with labels and value display.
|
|
62
|
+
* It supports vertical orientation, custom min/max labels, and step ranges.
|
|
63
|
+
* The component handles value changes, displays tooltips, and integrates with ranger for slider functionality.
|
|
64
|
+
* It also supports deferred value updates for smoother interactions.
|
|
62
65
|
*/
|
|
63
|
-
export declare
|
|
66
|
+
export declare function Slider(props: SliderProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { type ColorType, type RefProp } from "@react-fabric/core/dist/types/types";
|
|
1
|
+
import type { ColorUnion, RefProp } from "@react-fabric/core/dist/types/types";
|
|
3
2
|
export interface SwitchProps extends RefProp<HTMLInputElement> {
|
|
4
3
|
/**
|
|
5
4
|
* Switch label
|
|
6
5
|
*/
|
|
7
|
-
label?:
|
|
6
|
+
label?: React.ReactElement | string;
|
|
8
7
|
/**
|
|
9
8
|
* checked
|
|
10
9
|
*/
|
|
@@ -32,15 +31,21 @@ export interface SwitchProps extends RefProp<HTMLInputElement> {
|
|
|
32
31
|
/**
|
|
33
32
|
* cutom Switch icon
|
|
34
33
|
*/
|
|
35
|
-
color?:
|
|
34
|
+
color?: ColorUnion;
|
|
36
35
|
/**
|
|
37
36
|
* cutom Switch icon
|
|
38
37
|
*/
|
|
39
|
-
defaultColor?:
|
|
38
|
+
defaultColor?: ColorUnion;
|
|
40
39
|
name?: string;
|
|
41
40
|
onLabel?: string;
|
|
42
|
-
onLabelColor?:
|
|
41
|
+
onLabelColor?: ColorUnion;
|
|
43
42
|
offLabel?: string;
|
|
44
|
-
offLabelColor?:
|
|
43
|
+
offLabelColor?: ColorUnion;
|
|
45
44
|
}
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Switch input component with custom labels and colors.
|
|
47
|
+
* This component renders a switch input with optional labels for the "on" and "off" states,
|
|
48
|
+
* and allows for custom colors for the switch background and labels.
|
|
49
|
+
* It supports disabled and invalid states, and handles change events.
|
|
50
|
+
*/
|
|
51
|
+
export declare function Switch({ ref, label, checked, invalid, disabled, error, width, color, name, onLabel, offLabel, onLabelColor, offLabelColor, defaultColor, onChange, ...rest }: SwitchProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface TextareaProps extends InputProps, RefProp<HTMLTextAreaElement> {
|
|
1
|
+
import type { RefProp } from "@react-fabric/core/dist/types/types";
|
|
2
|
+
import type { InputProps, WrapperProps } from "../types";
|
|
3
|
+
export interface TextareaProps extends InputProps, WrapperProps, RefProp<HTMLTextAreaElement> {
|
|
4
4
|
/**
|
|
5
5
|
* textarae rows
|
|
6
6
|
*/
|
|
@@ -13,5 +13,16 @@ export interface TextareaProps extends InputProps, RefProp<HTMLTextAreaElement>
|
|
|
13
13
|
* increment rows on value change
|
|
14
14
|
*/
|
|
15
15
|
variableRows?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* expandable textarea
|
|
18
|
+
*/
|
|
19
|
+
expandable?: boolean;
|
|
16
20
|
}
|
|
17
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Textarea component that allows users to input multi-line text.
|
|
23
|
+
* It supports features like variable row count, expandable behavior,
|
|
24
|
+
* and handling of focus, blur, and change events.
|
|
25
|
+
* This component is designed to be flexible and user-friendly,
|
|
26
|
+
* providing a clear interface for text input with optional validation and accessibility features.
|
|
27
|
+
*/
|
|
28
|
+
export declare function Textarea(props: TextareaProps): import("react").JSX.Element;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CssProp } from "@react-fabric/core/dist/types/types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { WrapperProps } from "../types";
|
|
4
|
+
export interface FieldProps extends CssProp, WrapperProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
showError?: boolean;
|
|
8
|
+
listing?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function FieldWrapper({ id, name, label, appendLabel, width, labelWidth, inline, info, required, children, listing, invalid, disabled, error, showError, }: FieldProps): import("react").JSX.Element;
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CssProp } from "@react-fabric/core/dist/types/types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { WrapperProps } from "../types";
|
|
4
|
+
export interface InputWrapperProps extends CssProp, WrapperProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
showClear?: boolean;
|
|
8
|
+
onClear?: () => void;
|
|
9
|
+
textarea?: boolean;
|
|
10
|
+
hasStepper?: boolean;
|
|
11
|
+
actionButton?: ReactNode;
|
|
12
|
+
textareaExpandable?: boolean;
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
focusRing?: boolean;
|
|
15
|
+
floatingExpand?: boolean;
|
|
16
|
+
listing?: ReactNode;
|
|
17
|
+
ref?: React.Ref<HTMLDivElement | null>;
|
|
18
|
+
}
|
|
19
|
+
export declare function InputWrapper(props: InputWrapperProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* react-ranger
|
|
3
|
+
* https://github.com/TanStack/ranger
|
|
4
|
+
*/
|
|
1
5
|
import { type KeyboardEvent as KE, type MouseEvent as ME, type TouchEvent as TE } from "react";
|
|
2
6
|
type RangerChangeEvent = (newValue: readonly number[]) => void;
|
|
3
7
|
type RangerConfig = {
|
|
@@ -17,8 +21,8 @@ type RangerConfig = {
|
|
|
17
21
|
} | {
|
|
18
22
|
steps: number[];
|
|
19
23
|
});
|
|
20
|
-
export declare
|
|
21
|
-
trackElRef: import("react").RefObject<HTMLDivElement>;
|
|
24
|
+
export declare function useRanger(opts: RangerConfig): {
|
|
25
|
+
trackElRef: import("react").RefObject<HTMLDivElement | null>;
|
|
22
26
|
activeHandleIndex: number | undefined;
|
|
23
27
|
ticks: {
|
|
24
28
|
key: number;
|
|
@@ -33,7 +37,7 @@ export declare const useRanger: (opts: RangerConfig) => {
|
|
|
33
37
|
value: number;
|
|
34
38
|
active: boolean;
|
|
35
39
|
props: {
|
|
36
|
-
ref: import("react").RefObject<HTMLDivElement>;
|
|
40
|
+
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
37
41
|
onMouseDownCapture: (e: ME) => void;
|
|
38
42
|
onTouchStartCapture: (e: TE) => void;
|
|
39
43
|
} | {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* react-ranger
|
|
3
3
|
* https://github.com/TanStack/ranger
|
|
4
4
|
*/
|
|
5
|
-
export declare
|
|
5
|
+
export declare function getBoundingClientRect(element: AnyObject): {
|
|
6
6
|
top: number;
|
|
7
7
|
left: number;
|
|
8
8
|
right: number;
|
|
@@ -10,7 +10,7 @@ export declare const getBoundingClientRect: (element: any) => {
|
|
|
10
10
|
bottom: number;
|
|
11
11
|
height: number;
|
|
12
12
|
};
|
|
13
|
-
export declare
|
|
13
|
+
export declare function sortNumList(arr: ReadonlyArray<number | string>): number[];
|
|
14
14
|
export declare const linearInterpolator: {
|
|
15
15
|
getPercentageForValue: (val: number, min: number, max: number) => number;
|
|
16
16
|
getValueForClientX: (clientX: number, trackDims: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { RefProp } from "@react-fabric/core/dist/types/types";
|
|
1
2
|
import { type SelectProps } from "../types";
|
|
2
|
-
type AutoCompleteProps = Omit<SelectProps<string>, "options" | "allowCreate" | "createOption"> & {
|
|
3
|
+
type AutoCompleteProps = Omit<SelectProps<string>, "ref" | "options" | "allowCreate" | "createOption"> & RefProp<HTMLTextAreaElement> & {
|
|
3
4
|
/**
|
|
4
5
|
* auto-complete history
|
|
5
6
|
*/
|
|
@@ -13,5 +14,9 @@ type AutoCompleteProps = Omit<SelectProps<string>, "options" | "allowCreate" | "
|
|
|
13
14
|
*/
|
|
14
15
|
onInput?: (query: string) => void;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* AutoComplete component for selecting or entering values with history suggestions.
|
|
19
|
+
* It supports multiple selections, history suggestions, and custom styling.
|
|
20
|
+
*/
|
|
21
|
+
export declare function AutoComplete(props: AutoCompleteProps): import("react").JSX.Element;
|
|
17
22
|
export {};
|
|
@@ -1,38 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { DualSelectProps } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* DualList component allows users to select items from two lists.
|
|
4
|
+
* It displays two lists side by side, one for unselected items and one for selected items.
|
|
5
|
+
* Users can move items between the lists using buttons or drag-and-drop functionality.
|
|
6
|
+
* It supports multiple selections and provides options for grouping, labeling, and rendering items.
|
|
7
|
+
* It also includes features for handling empty states and custom rendering of items.
|
|
8
|
+
* This component is useful for scenarios where users need to manage selections from a larger set of options, such as in forms or settings.
|
|
9
|
+
*/
|
|
10
|
+
export declare function DualList<T extends AnyObject = string>(props: DualSelectProps<T> & {
|
|
8
11
|
height?: string | number;
|
|
9
|
-
|
|
10
|
-
* list options
|
|
11
|
-
*/
|
|
12
|
-
options: T[];
|
|
13
|
-
/**
|
|
14
|
-
* selected value
|
|
15
|
-
*/
|
|
16
|
-
value?: string[];
|
|
17
|
-
/**
|
|
18
|
-
* group by property name
|
|
19
|
-
*/
|
|
20
|
-
groupProperty?: keyof T;
|
|
21
|
-
/**
|
|
22
|
-
* label property name
|
|
23
|
-
*/
|
|
24
|
-
labelProperty?: keyof T;
|
|
25
|
-
/**
|
|
26
|
-
* value property name
|
|
27
|
-
*/
|
|
28
|
-
valueProperty?: keyof T;
|
|
29
|
-
/**
|
|
30
|
-
* item renderer
|
|
31
|
-
*/
|
|
32
|
-
renderer?: (option: T) => React.ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* change handler
|
|
35
|
-
*/
|
|
36
|
-
onChange?: (value?: string[]) => void;
|
|
37
|
-
}
|
|
38
|
-
export declare const DualList: <T extends unknown = string>({ ref, value, options, groupProperty, height, labelProperty, valueProperty, renderer, onChange, name, invalid, readOnly, disabled, placeholder, autoFocus, error, ...rest }: DualListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type SelectProps } from "../types";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* List component for selecting items from a list.
|
|
4
|
+
* It supports single and multiple selections, searching, creating new options,
|
|
5
|
+
* and custom rendering of options.
|
|
6
|
+
*/
|
|
7
|
+
export declare function List<T extends AnyObject = string>(props: Omit<SelectProps<T>, "defaultOpen" | "hideHandle"> & {
|
|
3
8
|
height?: string | number;
|
|
4
|
-
})
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare function Options({ ref, style, items, active, className, itemRef, empty, info, labelProperty, itemProps, children, onMouseOut, }: {
|
|
2
|
+
ref: React.Ref<HTMLDivElement | null>;
|
|
3
|
+
info?: AnyObject;
|
|
4
4
|
itemRef: AnyObject;
|
|
5
|
-
style?:
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
6
|
items: AnyObject[];
|
|
7
7
|
active: number | null;
|
|
8
8
|
className?: string;
|
|
9
|
-
empty?:
|
|
9
|
+
empty?: React.ReactNode;
|
|
10
10
|
valueProperty?: AnyObject;
|
|
11
11
|
labelProperty?: AnyObject;
|
|
12
|
+
onMouseOut?: () => void;
|
|
12
13
|
itemProps: (item: AnyObject) => AnyObject;
|
|
13
|
-
children: (item: AnyObject, label: string) => ReactNode;
|
|
14
|
-
}
|
|
14
|
+
children: (item: AnyObject, label: string) => React.ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { SelectProps } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Select component for selecting items from a dropdown list.
|
|
4
|
+
* It supports single and multiple selections, searching, creating new options,
|
|
5
|
+
* and custom rendering of options.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Select<T extends AnyObject = string>(props: SelectProps<T>): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare
|
|
1
|
+
export declare function makeOption(query: string): string;
|
|
2
|
+
export declare function getSelectedValue(value: AnyObject, emptyValue: string | string[], valueProperty?: string): string | string[];
|
|
@@ -1,47 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import type { SelectProps } from "../types";
|
|
2
2
|
interface State {
|
|
3
3
|
multiple: boolean;
|
|
4
4
|
emptyValue: AnyObject;
|
|
5
5
|
open: boolean;
|
|
6
6
|
loading: boolean;
|
|
7
7
|
activeIndex: number | null;
|
|
8
|
+
activeItem: AnyObject;
|
|
8
9
|
selectedIndex: number | null;
|
|
9
10
|
value: AnyObject;
|
|
10
11
|
query?: string;
|
|
11
12
|
items: AnyObject[];
|
|
12
13
|
}
|
|
13
|
-
export declare
|
|
14
|
-
value?: AnyObject;
|
|
15
|
-
options?: AnyObject[];
|
|
14
|
+
export declare function useSelect(props: Omit<SelectProps<AnyObject>, "multiple"> & {
|
|
16
15
|
multiple?: boolean;
|
|
17
|
-
allowCreate?: boolean;
|
|
18
|
-
groupProperty?: AnyObject;
|
|
19
|
-
valueProperty?: AnyObject;
|
|
20
|
-
labelProperty?: AnyObject;
|
|
21
16
|
autoComplete?: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
state: State | {
|
|
29
|
-
value: any;
|
|
30
|
-
activeIndex: null;
|
|
31
|
-
selectedIndex: any;
|
|
32
|
-
multiple: boolean;
|
|
33
|
-
emptyValue: AnyObject;
|
|
34
|
-
open: boolean;
|
|
35
|
-
loading: boolean;
|
|
36
|
-
query?: string | undefined;
|
|
37
|
-
items: AnyObject[];
|
|
38
|
-
};
|
|
39
|
-
listRef: import("react").MutableRefObject<HTMLElement[]>;
|
|
40
|
-
focusableRef: import("react").RefObject<HTMLElement>;
|
|
41
|
-
listContentRef: import("react").MutableRefObject<any[]>;
|
|
17
|
+
alwaysOpen?: boolean;
|
|
18
|
+
}): {
|
|
19
|
+
state: State;
|
|
20
|
+
listRef: import("react").RefObject<HTMLElement[]>;
|
|
21
|
+
focusableRef: import("react").RefObject<HTMLElement | null>;
|
|
22
|
+
listContentRef: import("react").RefObject<any[]>;
|
|
42
23
|
handleChange: (value?: AnyObject) => void;
|
|
43
24
|
handleRemove: (index?: number) => void;
|
|
44
25
|
handleQuery: (query: string) => void;
|
|
26
|
+
clearActiveIndex: () => void;
|
|
45
27
|
macthOption: (item: AnyObject, query: string) => boolean;
|
|
46
28
|
setActiveIndex: (index: number | null) => void;
|
|
47
29
|
setOpen: (open: boolean) => void;
|