@react-fabric/form 1.0.0-beta.62 → 1.0.0-beta.63
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/css/_colorPicker.css +35 -5
- package/css/_file.css +2 -2
- package/dist/cjs/builder/FileField.js +6 -6
- package/dist/cjs/builder/SchemaEditor.js +1 -1
- package/dist/cjs/builder/components/SchemaArrayForm.js +1 -3
- package/dist/cjs/builder/components/SchemaField.js +1 -1
- package/dist/cjs/form/Controller.js +1 -1
- package/dist/cjs/form/Form.js +11 -35
- package/dist/cjs/form/useForm.js +32 -0
- package/dist/cjs/hooks/useFileUploader.js +5 -5
- package/dist/cjs/hooks/useFormBuilder.js +3 -3
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/input/ArrayInput.js +66 -19
- package/dist/cjs/input/AvatarInput.js +7 -7
- package/dist/cjs/input/Checkbox.js +1 -1
- package/dist/cjs/input/ColorInput.js +26 -19
- package/dist/cjs/input/ColorPicker.js +16 -9
- package/dist/cjs/input/DateInput.js +3 -3
- package/dist/cjs/input/Field.js +1 -1
- package/dist/cjs/input/File.js +1 -1
- package/dist/cjs/input/Hidden.js +1 -1
- package/dist/cjs/input/Input.js +1 -1
- package/dist/cjs/input/Number.js +1 -1
- package/dist/cjs/input/Password.js +1 -1
- package/dist/cjs/input/Radio.js +1 -1
- package/dist/cjs/input/RadioGroup.js +5 -3
- package/dist/cjs/input/RangeSlider.js +1 -1
- package/dist/cjs/input/Search.js +1 -1
- package/dist/cjs/input/Slider.js +1 -1
- package/dist/cjs/input/Switch.js +4 -4
- package/dist/cjs/input/Textarea.js +1 -1
- package/dist/cjs/internal/InputWrapper.js +2 -2
- package/dist/cjs/ranger/index.js +5 -5
- package/dist/cjs/select/AutoComplete.js +4 -2
- package/dist/cjs/select/DualList.js +2 -2
- package/dist/cjs/select/List.js +3 -2
- package/dist/cjs/select/Options.js +5 -4
- package/dist/cjs/select/Select.js +4 -2
- package/dist/cjs/select/useSelect.js +15 -13
- package/dist/esm/builder/FileField.js +6 -6
- package/dist/esm/builder/SchemaEditor.js +1 -1
- package/dist/esm/builder/components/SchemaArrayForm.js +1 -3
- package/dist/esm/builder/components/SchemaField.js +1 -1
- package/dist/esm/form/Controller.js +1 -1
- package/dist/esm/form/Form.js +14 -37
- package/dist/esm/form/useForm.js +32 -0
- package/dist/esm/hooks/useFileUploader.js +5 -5
- package/dist/esm/hooks/useFormBuilder.js +3 -3
- package/dist/esm/index.js +2 -1
- package/dist/esm/input/ArrayInput.js +66 -19
- package/dist/esm/input/AvatarInput.js +7 -7
- package/dist/esm/input/Checkbox.js +1 -1
- package/dist/esm/input/ColorInput.js +27 -20
- package/dist/esm/input/ColorPicker.js +17 -10
- package/dist/esm/input/DateInput.js +3 -3
- package/dist/esm/input/Field.js +1 -1
- package/dist/esm/input/File.js +1 -1
- package/dist/esm/input/Hidden.js +1 -1
- package/dist/esm/input/Input.js +1 -1
- package/dist/esm/input/Number.js +1 -1
- package/dist/esm/input/Password.js +1 -1
- package/dist/esm/input/Radio.js +1 -1
- package/dist/esm/input/RadioGroup.js +5 -3
- package/dist/esm/input/RangeSlider.js +1 -1
- package/dist/esm/input/Search.js +1 -1
- package/dist/esm/input/Slider.js +1 -1
- package/dist/esm/input/Switch.js +4 -4
- package/dist/esm/input/Textarea.js +1 -1
- package/dist/esm/internal/InputWrapper.js +2 -2
- package/dist/esm/ranger/index.js +5 -5
- package/dist/esm/select/AutoComplete.js +4 -2
- package/dist/esm/select/DualList.js +2 -2
- package/dist/esm/select/List.js +4 -3
- package/dist/esm/select/Options.js +5 -4
- package/dist/esm/select/Select.js +5 -3
- package/dist/esm/select/useSelect.js +15 -13
- package/dist/types/builder/SchemaEditor.d.ts +1 -1
- package/dist/types/form/Controller.d.ts +1 -1
- package/dist/types/form/Form.d.ts +1 -12
- package/dist/types/form/useForm.d.ts +11 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/input/ArrayInput.d.ts +5 -4
- package/dist/types/input/AvatarInput.d.ts +1 -1
- package/dist/types/input/Checkbox.d.ts +2 -2
- package/dist/types/input/ColorInput.d.ts +1 -1
- package/dist/types/input/ColorPicker.d.ts +5 -1
- package/dist/types/input/DateInput.d.ts +1 -1
- package/dist/types/input/Field.d.ts +1 -1
- package/dist/types/input/File.d.ts +1 -1
- package/dist/types/input/Hidden.d.ts +1 -1
- package/dist/types/input/Input.d.ts +1 -1
- package/dist/types/input/Number.d.ts +1 -1
- package/dist/types/input/Password.d.ts +1 -1
- package/dist/types/input/Radio.d.ts +2 -2
- package/dist/types/input/RadioGroup.d.ts +3 -3
- package/dist/types/input/RangeSlider.d.ts +1 -1
- package/dist/types/input/Search.d.ts +1 -1
- package/dist/types/input/Slider.d.ts +1 -1
- package/dist/types/input/Switch.d.ts +2 -2
- package/dist/types/input/Textarea.d.ts +1 -1
- package/dist/types/select/AutoComplete.d.ts +1 -1
- package/dist/types/select/DualList.d.ts +1 -1
- package/dist/types/select/List.d.ts +1 -1
- package/dist/types/select/Select.d.ts +1 -1
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/types/schema.d.ts +1 -1
- package/package.json +14 -14
- package/src/builder/SchemaEditor.tsx +2 -2
- package/src/builder/components/SchemaArrayForm.tsx +0 -2
- package/src/builder/components/SchemaField.tsx +1 -1
- package/src/form/Controller.tsx +1 -1
- package/src/form/Form.tsx +1 -30
- package/src/form/useForm.ts +44 -0
- package/src/index.ts +3 -7
- package/src/input/ArrayInput.tsx +20 -10
- package/src/input/AvatarInput.tsx +1 -1
- package/src/input/Checkbox.tsx +2 -2
- package/src/input/ColorInput.tsx +29 -45
- package/src/input/ColorPicker.tsx +42 -49
- package/src/input/DateInput.tsx +3 -3
- package/src/input/Field.tsx +2 -2
- package/src/input/File.tsx +1 -1
- package/src/input/Hidden.tsx +1 -3
- package/src/input/Input.tsx +1 -1
- package/src/input/Number.tsx +1 -1
- package/src/input/Password.tsx +1 -1
- package/src/input/Radio.tsx +2 -2
- package/src/input/RadioGroup.tsx +5 -3
- package/src/input/RangeSlider.tsx +1 -1
- package/src/input/Search.tsx +1 -1
- package/src/input/Slider.tsx +1 -1
- package/src/input/Switch.tsx +6 -6
- package/src/input/Textarea.tsx +1 -1
- package/src/internal/InputWrapper.tsx +1 -2
- package/src/select/AutoComplete.tsx +13 -52
- package/src/select/DualList.tsx +2 -2
- package/src/select/List.tsx +29 -67
- package/src/select/Options.tsx +4 -3
- package/src/select/Select.tsx +18 -40
- package/src/select/useSelect.tsx +24 -69
- package/src/types/index.ts +3 -3
- package/src/types/schema.ts +1 -1
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { cloneChildren } from '@react-fabric/core';
|
|
6
|
+
import classNames from 'classnames';
|
|
6
7
|
import { cloneElement } from 'react';
|
|
7
8
|
import { FieldWrapper } from '../internal/FieldWrapper.js';
|
|
8
9
|
import { jsx } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
|
-
var _excluded = ["children", "name", "className", "optionWidth", "value", "onChange"];
|
|
11
|
+
var _excluded = ["children", "name", "className", "optionWidth", "vertical", "value", "onChange"];
|
|
11
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
14
|
/**
|
|
@@ -16,19 +17,20 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
17
|
* The component supports inline and vertical orientations, and can handle change events.
|
|
17
18
|
*
|
|
18
19
|
* @param {RadioGroupProps} props - The properties for the RadioGroup component.
|
|
19
|
-
* @returns {
|
|
20
|
+
* @returns {React.ReactElement} The rendered RadioGroup component.
|
|
20
21
|
*/
|
|
21
22
|
var RadioGroup = function RadioGroup(_ref) {
|
|
22
23
|
var children = _ref.children,
|
|
23
24
|
name = _ref.name,
|
|
24
25
|
className = _ref.className,
|
|
25
26
|
optionWidth = _ref.optionWidth,
|
|
27
|
+
vertical = _ref.vertical,
|
|
26
28
|
value = _ref.value,
|
|
27
29
|
onChange = _ref.onChange,
|
|
28
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
31
|
return /*#__PURE__*/jsx(FieldWrapper, _objectSpread(_objectSpread({}, rest), {}, {
|
|
30
32
|
children: /*#__PURE__*/jsx("div", {
|
|
31
|
-
className: className,
|
|
33
|
+
className: classNames(className, vertical && "flex flex-col gap-1"),
|
|
32
34
|
children: cloneChildren(children, function (child) {
|
|
33
35
|
return /*#__PURE__*/cloneElement(child, {
|
|
34
36
|
name: name,
|
|
@@ -22,7 +22,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
22
22
|
* The component is designed to be flexible and customizable, allowing for various configurations.
|
|
23
23
|
*
|
|
24
24
|
* @param {RangeProps} props - The properties for the RangeSlider component.
|
|
25
|
-
* @returns {
|
|
25
|
+
* @returns {React.ReactElement} The rendered RangeSlider component.
|
|
26
26
|
*/
|
|
27
27
|
var RangeSlider = function RangeSlider(_ref) {
|
|
28
28
|
var error = _ref.error;
|
package/dist/esm/input/Search.js
CHANGED
|
@@ -20,7 +20,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
20
|
* and handling search actions with a debounce mechanism.
|
|
21
21
|
*
|
|
22
22
|
* @param {SearchProps} props - The properties for the Search component.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered Search input component.
|
|
24
24
|
*/
|
|
25
25
|
var Search = function Search(_ref) {
|
|
26
26
|
var ref = _ref.ref,
|
package/dist/esm/input/Slider.js
CHANGED
|
@@ -20,7 +20,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
20
|
* It also supports deferred value updates for smoother interactions.
|
|
21
21
|
*
|
|
22
22
|
* @param {SliderProps} props - The properties for the Slider component.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered Slider component.
|
|
24
24
|
*/
|
|
25
25
|
var Slider = function Slider(_ref) {
|
|
26
26
|
var error = _ref.error;
|
package/dist/esm/input/Switch.js
CHANGED
|
@@ -21,7 +21,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
21
21
|
* It supports disabled and invalid states, and handles change events.
|
|
22
22
|
*
|
|
23
23
|
* @param {SwitchProps} props - The properties for the Switch component.
|
|
24
|
-
* @returns {
|
|
24
|
+
* @returns {React.ReactElement} The rendered Switch input component.
|
|
25
25
|
*/
|
|
26
26
|
var Switch = function Switch(_ref) {
|
|
27
27
|
var ref = _ref.ref,
|
|
@@ -55,17 +55,17 @@ var Switch = function Switch(_ref) {
|
|
|
55
55
|
onChange === null || onChange === void 0 || onChange((_e$target$checked2 = e === null || e === void 0 ? void 0 : e.target.checked) !== null && _e$target$checked2 !== void 0 ? _e$target$checked2 : false);
|
|
56
56
|
}, [onChange]);
|
|
57
57
|
return /*#__PURE__*/jsxs("label", {
|
|
58
|
-
className: classNames(invalid ? "ring-danger-500" : "ring-primary-500", disabled ? "opacity-50 cursor-not-allowed" : "hover:opacity-100 cursor-pointer", "inline-flex gap-1 py-1 items-center relative
|
|
58
|
+
className: classNames(invalid ? "ring-danger-500" : "ring-primary-500", disabled ? "opacity-50 cursor-not-allowed" : "opacity-85 hover:opacity-100 cursor-pointer", "inline-flex gap-1 py-1 items-center relative rounded ring-offset-2 has-focus-visible:ring-1"),
|
|
59
59
|
style: {
|
|
60
60
|
width: width
|
|
61
61
|
},
|
|
62
62
|
children: [/*#__PURE__*/jsxs("div", {
|
|
63
|
-
className: classNames(actualValue && getBgClass(color ? "".concat(color, "-500") : "primary-500"), !actualValue && (defaultColor ? getBgClass("".concat(defaultColor, "-500")) : "bg-tint-200"), "relative grid grid-cols-2 items-center h-[1.5em] min-w-[2.5em]
|
|
63
|
+
className: classNames(actualValue && getBgClass(color ? "".concat(color, "-500") : "primary-500"), !actualValue && (defaultColor ? getBgClass("".concat(defaultColor, "-500")) : "bg-tint-200"), "relative grid grid-cols-2 items-center h-[1.5em] min-w-[2.5em] rounded-full p-[0.25em] transition-colors duration-200 ease-in-out"),
|
|
64
64
|
style: {
|
|
65
65
|
backgroundColor: actualValue ? getColor(color) : getColor(defaultColor)
|
|
66
66
|
},
|
|
67
67
|
children: [/*#__PURE__*/jsx("input", _objectSpread({
|
|
68
|
-
className: classNames("appearance-none absolute opacity-0 inset-0 bg-transparent border-none outline-none ring-0"),
|
|
68
|
+
className: classNames("appearance-none absolute opacity-0 inset-0 bg-transparent border-none cursor-[inherit] outline-none ring-0"),
|
|
69
69
|
"aria-invalid": invalid,
|
|
70
70
|
"aria-disabled": disabled,
|
|
71
71
|
disabled: disabled,
|
|
@@ -20,7 +20,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
20
|
* providing a clear interface for text input with optional validation and accessibility features.
|
|
21
21
|
*
|
|
22
22
|
* @param {TextareaProps} props - The properties for the Textarea component.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered Textarea component.
|
|
24
24
|
*/
|
|
25
25
|
var Textarea = function Textarea(_ref) {
|
|
26
26
|
var ref = _ref.ref,
|
|
@@ -87,7 +87,7 @@ var InputWrapper = function InputWrapper(_ref) {
|
|
|
87
87
|
}), children, allowClear && showClear && /*#__PURE__*/jsx(Icon, {
|
|
88
88
|
icon: "icon-[mdi--close]",
|
|
89
89
|
onClick: handleClear,
|
|
90
|
-
className: classNames("text-tint-500 hover:text-tint-700 p-1 z-1 flex-content", "fabric-inputClear"
|
|
90
|
+
className: classNames("text-tint-500 hover:text-tint-700 p-1 z-1 flex-content", "fabric-inputClear")
|
|
91
91
|
}), decorateEnd && /*#__PURE__*/jsx("div", {
|
|
92
92
|
onClickCapture: doFocus,
|
|
93
93
|
className: classNames("fabric-decorate", "text-muted leading-none flex-content", isString(decorateEnd) && "px-1", decorateEndHideWhenEmpty && "peer-placeholder-shown:hidden", decorateEndShowWhenEmpty && "hidden peer-placeholder-shown:inline-block"),
|
|
@@ -101,7 +101,7 @@ var InputWrapper = function InputWrapper(_ref) {
|
|
|
101
101
|
return setExpanded(!isExpanded);
|
|
102
102
|
},
|
|
103
103
|
icon: isExpanded ? "icon-[mdi--arrow-collapse]" : "icon-[mdi--arrow-expand]",
|
|
104
|
-
className: "hidden group-hover:block absolute top-0
|
|
104
|
+
className: "hidden group-hover:block absolute top-0 inset-e-0 bg-default hover:bg-tint-200 p-1 opacity-65 rounded-capped"
|
|
105
105
|
})]
|
|
106
106
|
});
|
|
107
107
|
return /*#__PURE__*/jsx(Wrapper, _objectSpread(_objectSpread({}, wrapperProps), {}, {
|
package/dist/esm/ranger/index.js
CHANGED
|
@@ -195,17 +195,17 @@ var useRanger = function useRanger(opts) {
|
|
|
195
195
|
} else {
|
|
196
196
|
setActiveHandleIndex(i);
|
|
197
197
|
}
|
|
198
|
-
var
|
|
198
|
+
var _handleRelease = function handleRelease(e) {
|
|
199
199
|
var _getLatest5 = getLatest(),
|
|
200
200
|
tempValues = _getLatest5.tempValues,
|
|
201
201
|
onChange = _getLatest5.onChange,
|
|
202
202
|
onDragEnd = _getLatest5.onDragEnd;
|
|
203
203
|
document.removeEventListener("mousemove", i === -1 ? handleSegmentDrag : handleDrag);
|
|
204
204
|
document.removeEventListener("touchmove", i === -1 ? handleSegmentDrag : handleDrag);
|
|
205
|
-
document.removeEventListener("mouseup",
|
|
205
|
+
document.removeEventListener("mouseup", _handleRelease, {
|
|
206
206
|
capture: true
|
|
207
207
|
});
|
|
208
|
-
document.removeEventListener("touchend",
|
|
208
|
+
document.removeEventListener("touchend", _handleRelease, {
|
|
209
209
|
capture: true
|
|
210
210
|
});
|
|
211
211
|
var sortedValues = sortNumList(tempValues || values);
|
|
@@ -218,10 +218,10 @@ var useRanger = function useRanger(opts) {
|
|
|
218
218
|
onDragStart === null || onDragStart === void 0 || onDragStart();
|
|
219
219
|
document.addEventListener("mousemove", i === -1 ? handleSegmentDrag : handleDrag);
|
|
220
220
|
document.addEventListener("touchmove", i === -1 ? handleSegmentDrag : handleDrag);
|
|
221
|
-
document.addEventListener("mouseup",
|
|
221
|
+
document.addEventListener("mouseup", _handleRelease, {
|
|
222
222
|
capture: true
|
|
223
223
|
});
|
|
224
|
-
document.addEventListener("touchend",
|
|
224
|
+
document.addEventListener("touchend", _handleRelease, {
|
|
225
225
|
capture: true
|
|
226
226
|
});
|
|
227
227
|
}, [getLatest, handleDrag]);
|
|
@@ -20,10 +20,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
20
|
* It supports multiple selections, history suggestions, and custom styling.
|
|
21
21
|
*
|
|
22
22
|
* @param {AutoCompleteProps} props - The properties for the AutoComplete component.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered AutoComplete component.
|
|
24
24
|
*/
|
|
25
25
|
var AutoComplete = function AutoComplete(_ref) {
|
|
26
|
-
var _refs$reference$curre;
|
|
26
|
+
var _refs$domReference$cu2, _refs$domReference$cu3, _refs$reference$curre;
|
|
27
27
|
var ref = _ref.ref,
|
|
28
28
|
name = _ref.name,
|
|
29
29
|
value = _ref.value,
|
|
@@ -246,10 +246,12 @@ var AutoComplete = function AutoComplete(_ref) {
|
|
|
246
246
|
className: classNames("flex-content p-2 z-0 order-9 text-muted pointer-events-none"),
|
|
247
247
|
icon: "icon-[svg-spinners--eclipse]"
|
|
248
248
|
}), state.open && !state.loading && /*#__PURE__*/jsx(FloatingPortal, {
|
|
249
|
+
root: (_refs$domReference$cu2 = (_refs$domReference$cu3 = refs.domReference.current) === null || _refs$domReference$cu3 === void 0 ? void 0 : _refs$domReference$cu3.closest(".theme-base")) !== null && _refs$domReference$cu2 !== void 0 ? _refs$domReference$cu2 : undefined,
|
|
249
250
|
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
250
251
|
context: context,
|
|
251
252
|
initialFocus: -1,
|
|
252
253
|
visuallyHiddenDismiss: true,
|
|
254
|
+
closeOnFocusOut: true,
|
|
253
255
|
children: /*#__PURE__*/jsx(Options, _objectSpread(_objectSpread({
|
|
254
256
|
ref: refs.setFloating,
|
|
255
257
|
className: "outline shadow-lg max-h-[40vh] z-(--z-popover)",
|
|
@@ -25,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
25
25
|
* This component is useful for scenarios where users need to manage selections from a larger set of options, such as in forms or settings.
|
|
26
26
|
*
|
|
27
27
|
* @param {DualListProps<T>} props - The properties for the DualList component.
|
|
28
|
-
* @returns {
|
|
28
|
+
* @returns {React.ReactElement} The rendered DualList component.
|
|
29
29
|
*/
|
|
30
30
|
var DualList = function DualList(_ref) {
|
|
31
31
|
var ref = _ref.ref,
|
|
@@ -188,7 +188,7 @@ var DualList = function DualList(_ref) {
|
|
|
188
188
|
className: "self-center mx-2",
|
|
189
189
|
children: /*#__PURE__*/jsxs(ButtonGroup, {
|
|
190
190
|
vertical: true,
|
|
191
|
-
className: "outline overflow-hidden bg-
|
|
191
|
+
className: "outline overflow-hidden bg-default",
|
|
192
192
|
children: [/*#__PURE__*/jsx(Button, {
|
|
193
193
|
size: "sm",
|
|
194
194
|
variant: "link",
|
package/dist/esm/select/List.js
CHANGED
|
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { useFloating, autoUpdate, useListNavigation, useTypeahead, useInteractions, FloatingFocusManager } from '@floating-ui/react';
|
|
6
6
|
import { Chip } from '@react-fabric/core';
|
|
7
|
-
import { isArray, isEmpty } from '@react-fabric/utilities';
|
|
7
|
+
import { isArray, isEmpty, getByPath } from '@react-fabric/utilities';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { useMemo, Fragment, useId, useCallback, useLayoutEffect } from 'react';
|
|
10
10
|
import { FieldWrapper } from '../internal/FieldWrapper.js';
|
|
@@ -17,7 +17,7 @@ var _excluded = ["ref", "name", "value", "readOnly", "disabled", "required", "pl
|
|
|
17
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
19
|
var List = function List(_ref) {
|
|
20
|
-
var _state$query
|
|
20
|
+
var _state$query;
|
|
21
21
|
var ref = _ref.ref,
|
|
22
22
|
name = _ref.name,
|
|
23
23
|
value = _ref.value,
|
|
@@ -244,6 +244,7 @@ var List = function List(_ref) {
|
|
|
244
244
|
context: context,
|
|
245
245
|
initialFocus: -1,
|
|
246
246
|
visuallyHiddenDismiss: true,
|
|
247
|
+
closeOnFocusOut: true,
|
|
247
248
|
children: /*#__PURE__*/jsx(Options, _objectSpread(_objectSpread({
|
|
248
249
|
ref: refs.setFloating,
|
|
249
250
|
className: classNames("max-h-96 z-0 rounded-capped rounded-t-none outline", disabled && "pointer-events-none opacity-65"),
|
|
@@ -258,7 +259,7 @@ var List = function List(_ref) {
|
|
|
258
259
|
itemRef: setItemRef,
|
|
259
260
|
itemProps: makeItemProps,
|
|
260
261
|
empty: emptyDisplay,
|
|
261
|
-
info: (
|
|
262
|
+
info: getByPath(state.activeItem, infoProperty !== null && infoProperty !== void 0 ? infoProperty : "info"),
|
|
262
263
|
children: function children(item, label) {
|
|
263
264
|
var _renderer3;
|
|
264
265
|
return (_renderer3 = renderer === null || renderer === void 0 ? void 0 : renderer(item)) !== null && _renderer3 !== void 0 ? _renderer3 : label;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { EmptyContent } from '@react-fabric/core';
|
|
6
|
+
import { getByPath } from '@react-fabric/utilities';
|
|
6
7
|
import classNames from 'classnames';
|
|
7
8
|
import { Trans } from 'react-i18next';
|
|
8
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -27,7 +28,7 @@ var Options = function Options(_ref) {
|
|
|
27
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
29
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
29
30
|
ref: ref,
|
|
30
|
-
className: classNames("bg-
|
|
31
|
+
className: classNames("bg-default select-none flex flex-col", className),
|
|
31
32
|
style: style
|
|
32
33
|
}, rest), {}, {
|
|
33
34
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -37,9 +38,9 @@ var Options = function Options(_ref) {
|
|
|
37
38
|
i18nKey: "form:select.emptyList"
|
|
38
39
|
})
|
|
39
40
|
})), items.map(function (item, index) {
|
|
40
|
-
var _item$value,
|
|
41
|
+
var _item$value, _getByPath;
|
|
41
42
|
if (item.___group___) return /*#__PURE__*/jsx("p", {
|
|
42
|
-
className: "px-2 py-1 text-muted text-xs sticky -top-px z-2 bg-
|
|
43
|
+
className: "px-2 py-1 text-muted text-xs sticky -top-px z-2 bg-default border-t",
|
|
43
44
|
children: item.label
|
|
44
45
|
}, index);
|
|
45
46
|
if (item.___create___) return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
@@ -70,7 +71,7 @@ var Options = function Options(_ref) {
|
|
|
70
71
|
"data-active": active === index ? true : undefined,
|
|
71
72
|
className: classNames("block text-start truncate px-2 py-1 leading-normal cursor-pointer", "data-active:bg-primary-200 data-selected:bg-primary-600 data-selected:text-white data-active:data-selected:underline")
|
|
72
73
|
}, itemProps(item)), {}, {
|
|
73
|
-
children: children(item, (
|
|
74
|
+
children: children(item, (_getByPath = getByPath(item, labelProperty)) !== null && _getByPath !== void 0 ? _getByPath : "".concat(item))
|
|
74
75
|
}), index);
|
|
75
76
|
})]
|
|
76
77
|
}), info && /*#__PURE__*/jsx("div", {
|
|
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { useFloating, autoUpdate, shift, flip, offset, useClick, useDismiss, useListNavigation, useTypeahead, useInteractions, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
6
6
|
import { Chip, Icon } from '@react-fabric/core';
|
|
7
|
-
import { isArray, isEmpty } from '@react-fabric/utilities';
|
|
7
|
+
import { isArray, isEmpty, getByPath } from '@react-fabric/utilities';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { useId, useMemo, useCallback, useLayoutEffect } from 'react';
|
|
10
10
|
import { InputWrapper } from '../internal/InputWrapper.js';
|
|
@@ -16,7 +16,7 @@ var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "req
|
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
18
|
var Select = function Select(_ref) {
|
|
19
|
-
var _state$query, _refs$
|
|
19
|
+
var _state$query, _refs$domReference$cu3, _refs$domReference$cu4, _refs$reference$curre;
|
|
20
20
|
var ref = _ref.ref,
|
|
21
21
|
name = _ref.name,
|
|
22
22
|
value = _ref.value,
|
|
@@ -262,10 +262,12 @@ var Select = function Select(_ref) {
|
|
|
262
262
|
className: classNames("flex-content p-2 z-0 order-9 text-muted pointer-events-none"),
|
|
263
263
|
icon: "icon-[svg-spinners--eclipse]"
|
|
264
264
|
}), state.open && !state.loading && /*#__PURE__*/jsx(FloatingPortal, {
|
|
265
|
+
root: (_refs$domReference$cu3 = (_refs$domReference$cu4 = refs.domReference.current) === null || _refs$domReference$cu4 === void 0 ? void 0 : _refs$domReference$cu4.closest(".theme-base")) !== null && _refs$domReference$cu3 !== void 0 ? _refs$domReference$cu3 : undefined,
|
|
265
266
|
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
266
267
|
context: context,
|
|
267
268
|
initialFocus: -1,
|
|
268
269
|
visuallyHiddenDismiss: true,
|
|
270
|
+
closeOnFocusOut: true,
|
|
269
271
|
children: /*#__PURE__*/jsx(Options, _objectSpread(_objectSpread({
|
|
270
272
|
ref: refs.setFloating,
|
|
271
273
|
className: "outline shadow-lg max-h-[40vh] z-(--z-popover)",
|
|
@@ -280,7 +282,7 @@ var Select = function Select(_ref) {
|
|
|
280
282
|
itemRef: setItemRef,
|
|
281
283
|
itemProps: makeItemProps,
|
|
282
284
|
empty: emptyDisplay,
|
|
283
|
-
info: (
|
|
285
|
+
info: getByPath(state.activeItem, infoProperty !== null && infoProperty !== void 0 ? infoProperty : "info"),
|
|
284
286
|
children: function children(item, label) {
|
|
285
287
|
var _renderer3;
|
|
286
288
|
return (_renderer3 = renderer === null || renderer === void 0 ? void 0 : renderer(item)) !== null && _renderer3 !== void 0 ? _renderer3 : label;
|
|
@@ -176,19 +176,21 @@ var useSelect = function useSelect(_ref) {
|
|
|
176
176
|
return _newState;
|
|
177
177
|
}
|
|
178
178
|
return state;
|
|
179
|
-
}, {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
179
|
+
}, {}, function () {
|
|
180
|
+
return {
|
|
181
|
+
multiple: multiple,
|
|
182
|
+
emptyValue: emptyValue,
|
|
183
|
+
open: alwaysOpen || defaultOpen,
|
|
184
|
+
loading: false,
|
|
185
|
+
activeIndex: null,
|
|
186
|
+
activeItem: null,
|
|
187
|
+
selectedIndex: null,
|
|
188
|
+
value: emptyValue,
|
|
189
|
+
// filter
|
|
190
|
+
query: undefined,
|
|
191
|
+
// dropdown items
|
|
192
|
+
items: []
|
|
193
|
+
};
|
|
192
194
|
}),
|
|
193
195
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
194
196
|
state = _useReducer2[0],
|
|
@@ -4,6 +4,6 @@ import { type SchemaEditorProps } from "../types/schema";
|
|
|
4
4
|
* It provides a form interface to modify schema properties dynamically.
|
|
5
5
|
*
|
|
6
6
|
* @param {SchemaEditorProps} props - The properties for the SchemaEditor component.
|
|
7
|
-
* @returns {
|
|
7
|
+
* @returns {React.ReactElement} The rendered SchemaEditor component.
|
|
8
8
|
*/
|
|
9
9
|
export declare const SchemaEditor: ({ schemaDef, dynamic, acceptableTypes, optionLists, children, onSubmit, onChange, }: SchemaEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -43,7 +43,7 @@ export interface ControllerProps {
|
|
|
43
43
|
* to the child component, allowing for proper focus management and DOM access.
|
|
44
44
|
*
|
|
45
45
|
* @param {ControllerProps} props - The properties for the Controller component.
|
|
46
|
-
* @returns {
|
|
46
|
+
* @returns {React.ReactElement} The rendered Controller component.
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```jsx
|
|
@@ -43,7 +43,7 @@ export interface FormProps<K extends KeyValue = KeyValue> {
|
|
|
43
43
|
* It supports nested form structures and allows for custom validation schemas using Yup.
|
|
44
44
|
*
|
|
45
45
|
* @param {FormProps<K>} props - The properties for the Form component.
|
|
46
|
-
* @returns {
|
|
46
|
+
* @returns {React.ReactElement} The rendered Form component.
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```jsx
|
|
@@ -66,15 +66,4 @@ export interface FormProps<K extends KeyValue = KeyValue> {
|
|
|
66
66
|
* @see {@link https://github.com/jquense/yup} for more details on the Yup validation schema.
|
|
67
67
|
*/
|
|
68
68
|
export declare const Form: <K extends KeyValue>({ formRef, resolver, children, resetOnChange, defaultValues, onSubmit, onChange, ...rest }: PropsWithChildren<FormProps<K>>) => import("react/jsx-runtime").JSX.Element;
|
|
69
|
-
export declare const useForm: <K extends KeyValue = KeyValue>() => {
|
|
70
|
-
values: import("react-hook-form").DeepPartialSkipArrayKey<K> & K;
|
|
71
|
-
formState: FormState<K>;
|
|
72
|
-
getValues: import("react-hook-form").UseFormGetValues<K>;
|
|
73
|
-
setValue: import("react-hook-form").UseFormSetValue<K>;
|
|
74
|
-
watch: import("react-hook-form").UseFormWatch<K>;
|
|
75
|
-
reset: import("react-hook-form").UseFormReset<K>;
|
|
76
|
-
resetField: import("react-hook-form").UseFormResetField<K>;
|
|
77
|
-
setError: import("react-hook-form").UseFormSetError<K>;
|
|
78
|
-
setFocus: import("react-hook-form").UseFormSetFocus<K>;
|
|
79
|
-
};
|
|
80
69
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const useForm: <K extends KeyValue = KeyValue>() => {
|
|
2
|
+
values: import("react-hook-form").DeepPartialSkipArrayKey<K> & K;
|
|
3
|
+
formState: import("react-hook-form").FormState<K>;
|
|
4
|
+
getValues: import("react-hook-form").UseFormGetValues<K>;
|
|
5
|
+
setValue: import("react-hook-form").UseFormSetValue<K>;
|
|
6
|
+
watch: import("react-hook-form").UseFormWatch<K>;
|
|
7
|
+
reset: import("react-hook-form").UseFormReset<K>;
|
|
8
|
+
resetField: import("react-hook-form").UseFormResetField<K>;
|
|
9
|
+
setError: import("react-hook-form").UseFormSetError<K>;
|
|
10
|
+
setFocus: import("react-hook-form").UseFormSetFocus<K>;
|
|
11
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./i18n";
|
|
2
2
|
export { Controller } from "./form/Controller";
|
|
3
|
-
export { Form,
|
|
3
|
+
export { Form, type FormRef } from "./form/Form";
|
|
4
|
+
export { useForm } from "./form/useForm";
|
|
4
5
|
export { SchemaEditor } from "./builder/SchemaEditor";
|
|
5
6
|
export { useFileUploader } from "./hooks/useFileUploader";
|
|
6
7
|
export { useFormBuilder } from "./hooks/useFormBuilder";
|
|
7
|
-
export { DATA_TYPES, SCHEMA_CUSTOM_LIST, type FormSchema, type SchemaDef
|
|
8
|
+
export { DATA_TYPES, SCHEMA_CUSTOM_LIST, type FormSchema, type SchemaDef } from "./types/schema";
|
|
8
9
|
export { ArrayInput } from "./input/ArrayInput";
|
|
9
10
|
export { AvatarInput } from "./input/AvatarInput";
|
|
10
11
|
export { Checkbox } from "./input/Checkbox";
|
|
@@ -7,7 +7,7 @@ export interface ArrayInputProps<T extends AnyObject = string> {
|
|
|
7
7
|
/**
|
|
8
8
|
* append to label end
|
|
9
9
|
*/
|
|
10
|
-
appendLabel?:
|
|
10
|
+
appendLabel?: React.ReactElement | string | number | boolean;
|
|
11
11
|
/**
|
|
12
12
|
* info label at bottom
|
|
13
13
|
*/
|
|
@@ -48,6 +48,7 @@ export interface ArrayInputProps<T extends AnyObject = string> {
|
|
|
48
48
|
index: number;
|
|
49
49
|
name: string;
|
|
50
50
|
item: T;
|
|
51
|
+
onChange: (val: false | undefined | T) => void;
|
|
51
52
|
}) => React.ReactNode);
|
|
52
53
|
/**
|
|
53
54
|
* add item button label
|
|
@@ -55,13 +56,13 @@ export interface ArrayInputProps<T extends AnyObject = string> {
|
|
|
55
56
|
addLabel?: string;
|
|
56
57
|
buttonPosition?: "top" | "bottom" | "both";
|
|
57
58
|
arrayRef?: Ref<{
|
|
58
|
-
addItem: (item: T) => void;
|
|
59
|
+
addItem: (item: false | undefined | T | Promise<false | undefined | T>) => void;
|
|
59
60
|
removeItem: (idx: number) => void;
|
|
60
61
|
}>;
|
|
61
62
|
/**
|
|
62
63
|
* add new item
|
|
63
64
|
*/
|
|
64
|
-
onAdd?: () => T
|
|
65
|
+
onAdd?: () => false | undefined | T | Promise<false | undefined | T>;
|
|
65
66
|
/**
|
|
66
67
|
* on item remove
|
|
67
68
|
*/
|
|
@@ -103,7 +104,7 @@ export interface ArrayInputProps<T extends AnyObject = string> {
|
|
|
103
104
|
* It also supports drag-and-drop sorting using `@dnd-kit/core` and `@dnd-kit/sortable` for a better user experience when reordering items.
|
|
104
105
|
*
|
|
105
106
|
* @param {ArrayInputProps<T>} props - The properties for the ArrayInput component.
|
|
106
|
-
* @returns {
|
|
107
|
+
* @returns {React.ReactElement} The rendered ArrayInput component.
|
|
107
108
|
*
|
|
108
109
|
* @example
|
|
109
110
|
* ```jsx
|
|
@@ -46,6 +46,6 @@ export interface Props extends RefProp {
|
|
|
46
46
|
* It also provides a way to remove the uploaded file and shows upload progress.
|
|
47
47
|
*
|
|
48
48
|
* @param {Props} props - The properties for the AvatarInput component.
|
|
49
|
-
* @returns {
|
|
49
|
+
* @returns {React.ReactElement} - The rendered AvatarInput component.
|
|
50
50
|
*/
|
|
51
51
|
export declare const AvatarInput: ({ size, avatarName, avatarClassName, value, rounded, defaultValue, fallbackIcon, variant, fileUrl, uploadHandler, onChange, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ interface CheckboxProps extends RefProp<HTMLInputElement> {
|
|
|
3
3
|
/**
|
|
4
4
|
* checkbox label
|
|
5
5
|
*/
|
|
6
|
-
label?:
|
|
6
|
+
label?: React.ReactElement | string;
|
|
7
7
|
/**
|
|
8
8
|
* checked
|
|
9
9
|
*/
|
|
@@ -49,7 +49,7 @@ interface CheckboxProps extends RefProp<HTMLInputElement> {
|
|
|
49
49
|
* It also provides an error icon to indicate validation errors.
|
|
50
50
|
*
|
|
51
51
|
* @param {CheckboxProps} props - The properties for the Checkbox component.
|
|
52
|
-
* @returns {
|
|
52
|
+
* @returns {React.ReactElement} The rendered Checkbox component.
|
|
53
53
|
*/
|
|
54
54
|
export declare const Checkbox: ({ ref, label, value, name, checked, invalid, disabled, error, width, icon, iconChecked, required, onChange, ...rest }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
55
|
export {};
|
|
@@ -18,6 +18,6 @@ export interface ColorInputProps extends InputProps, Omit<ColorProps, "onChange"
|
|
|
18
18
|
* and handling the color selection state.
|
|
19
19
|
*
|
|
20
20
|
* @param {ColorInputProps} props - The properties for the ColorInput component.
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {React.ReactElement} - The rendered ColorInput component.
|
|
22
22
|
*/
|
|
23
23
|
export declare const ColorInput: ({ ref, required, disabled, readOnly, invalid, error, value, showPicker, defaultColor, onBlur, onFocus, onChange, noOutline, ...rest }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,6 +12,10 @@ export interface ColorProps {
|
|
|
12
12
|
* hide alpha value
|
|
13
13
|
*/
|
|
14
14
|
hideAlpha?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* show only swatches, hide the color picker
|
|
17
|
+
*/
|
|
18
|
+
picker?: "default" | "swatches";
|
|
15
19
|
/**
|
|
16
20
|
* color value
|
|
17
21
|
*/
|
|
@@ -27,7 +31,7 @@ export interface ColorProps {
|
|
|
27
31
|
* The component uses the `react-color` library for the color picker functionality.
|
|
28
32
|
*
|
|
29
33
|
* @param {ColorProps} props - The properties for the ColorPicker component.
|
|
30
|
-
* @returns {
|
|
34
|
+
* @returns {React.ReactElement} The rendered ColorPicker component.
|
|
31
35
|
*
|
|
32
36
|
* @see {@link https://react-color.github.io/react-color/} for more details on the color picker library.
|
|
33
37
|
*/
|
|
@@ -23,6 +23,6 @@ export interface DateProps extends InputProps<string>, RefProp<HTMLInputElement>
|
|
|
23
23
|
* The component supports both date and datetime types, with appropriate formatting.
|
|
24
24
|
*
|
|
25
25
|
* @param {DateProps} props - The properties for the DateInput component.
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {React.ReactElement} - The rendered DateInput component.
|
|
27
27
|
*/
|
|
28
28
|
export declare const DateInput: ({ ref, name, value, invalid, readOnly, disabled, required, placeholder, defaultValue, autoFocus, error, type, onBlur, onFocus, onChange, onEnterPressed, format, min, max, ...rest }: DateProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,6 +21,6 @@ export interface FileInputProps extends InputProps<AnyObject>, RefProp<HTMLInput
|
|
|
21
21
|
* It handles file changes, invalid states, and read-only or disabled states.
|
|
22
22
|
*
|
|
23
23
|
* @param {FileInputProps} props - The properties for the FileInput component.
|
|
24
|
-
* @returns {
|
|
24
|
+
* @returns {React.ReactElement} - The rendered FileInput component.
|
|
25
25
|
*/
|
|
26
26
|
export declare const FileInput: ({ ref, value, invalid, readOnly, disabled, required, placeholder, autoFocus, error, name, accept, showList, multiple, onChange, onEnterPressed, ...rest }: FileInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@ interface Props {
|
|
|
14
14
|
* This is useful for cases where you need to update the form state without user interaction.
|
|
15
15
|
*
|
|
16
16
|
* @param {Object} props - Component properties.
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {React.ReactElement} The rendered hidden input field and error icon.
|
|
18
18
|
*/
|
|
19
19
|
export declare const HiddenInput: ({ invalid, error, value, name, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -12,6 +12,6 @@ export interface TextInputProps extends InputProps, RefProp<HTMLInputElement> {
|
|
|
12
12
|
* The component uses a wrapper to handle the clear button and styling, and it supports deferred value updates to optimize performance.
|
|
13
13
|
*
|
|
14
14
|
* @param {TextInputProps} props - The properties for the text input component.
|
|
15
|
-
* @returns {
|
|
15
|
+
* @returns {React.ReactElement} - A JSX element representing the text input field.
|
|
16
16
|
*/
|
|
17
17
|
export declare const Input: ({ ref, name, value, invalid, readOnly, disabled, required, placeholder, defaultValue, autoFocus, error, monospace, type, onBlur, onFocus, onChange, onEnterPressed, ...rest }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,6 +20,6 @@ export interface NumberProps extends InputProps<number>, RefProp<HTMLInputElemen
|
|
|
20
20
|
* It also includes a clear button to reset the input value.
|
|
21
21
|
*
|
|
22
22
|
* @param {NumberProps} props - The properties for the Number input component.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered Number input component.
|
|
24
24
|
*/
|
|
25
25
|
export declare const Number: ({ ref, value, invalid, readOnly, disabled, required, placeholder, defaultValue, autoFocus, name, min, max, step, onBlur, onFocus, onChange, onEnterPressed, ...rest }: NumberProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,6 +14,6 @@ export interface PasswordProps extends InputProps, RefProp<HTMLInputElement> {
|
|
|
14
14
|
* Password input component with optional strength meter and toggle visibility.
|
|
15
15
|
*
|
|
16
16
|
* @param {PasswordProps} props - The properties for the Password component.
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {React.ReactElement} The rendered Password input component.
|
|
18
18
|
*/
|
|
19
19
|
export declare const Password: ({ ref, value, name, strength, invalid, readOnly, disabled, required, placeholder, defaultValue, autoFocus, showToggle, onBlur, onFocus, onChange, onEnterPressed, ...rest }: PasswordProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ export interface RadioProps extends RefProp<HTMLInputElement> {
|
|
|
4
4
|
/**
|
|
5
5
|
* radio label
|
|
6
6
|
*/
|
|
7
|
-
label?:
|
|
7
|
+
label?: React.ReactElement | string;
|
|
8
8
|
/**
|
|
9
9
|
* value
|
|
10
10
|
*/
|
|
@@ -45,6 +45,6 @@ export interface RadioProps extends RefProp<HTMLInputElement> {
|
|
|
45
45
|
* It supports disabled and invalid states, and allows for custom width.
|
|
46
46
|
*
|
|
47
47
|
* @param {RadioProps} props - The properties for the Radio component.
|
|
48
|
-
* @returns {
|
|
48
|
+
* @returns {React.ReactElement} The rendered Radio input component.
|
|
49
49
|
*/
|
|
50
50
|
export declare const Radio: ({ ref, name, label, value, invalid, disabled, error, width, icon, iconChecked, onChange, ...rest }: RadioProps) => import("react/jsx-runtime").JSX.Element;
|