@react-fabric/form 1.0.0-beta.5 → 1.0.0-beta.52
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 +65 -0
- package/{src/internal/Field.module.css → css/_field.css} +64 -29
- package/{src/input/File.module.css → css/_file.css} +21 -6
- package/css/styles.css +27 -0
- package/dist/cjs/builder/FileField.js +37 -25
- package/dist/cjs/builder/FormField.js +50 -34
- package/dist/cjs/builder/SchemaEditor.js +72 -0
- package/dist/cjs/builder/components/AddSchemaFields.js +62 -0
- package/dist/cjs/builder/components/SchemaArrayForm.js +143 -0
- package/dist/cjs/builder/components/SchemaField.js +414 -0
- package/dist/cjs/form/Controller.js +46 -1
- package/dist/cjs/form/Form.js +43 -6
- package/dist/cjs/hooks/useFileUploader.js +16 -0
- package/dist/cjs/hooks/useFormBuilder.js +57 -15
- package/dist/cjs/i18n/ar.json.js +5 -4
- package/dist/cjs/i18n/en.json.js +5 -5
- package/dist/cjs/index.js +11 -2
- package/dist/cjs/input/ArrayInput.js +100 -33
- package/dist/cjs/input/AvatarInput.js +17 -8
- package/dist/cjs/input/Checkbox.js +15 -5
- package/dist/cjs/input/ColorInput.js +108 -56
- package/dist/cjs/input/ColorPicker.js +11 -35
- package/dist/cjs/input/DateInput.js +195 -0
- package/dist/cjs/input/Field.js +10 -4
- package/dist/cjs/input/File.js +14 -7
- package/dist/cjs/input/Hidden.js +11 -1
- package/dist/cjs/input/Input.js +19 -7
- package/dist/cjs/input/Number.js +17 -7
- package/dist/cjs/input/Password.js +16 -8
- package/dist/cjs/input/Radio.js +11 -2
- package/dist/cjs/input/RadioGroup.js +14 -3
- package/dist/cjs/input/{Range.js → RangeSlider.js} +14 -6
- package/dist/cjs/input/Search.js +25 -16
- package/dist/cjs/input/Slider.js +10 -4
- package/dist/cjs/input/Switch.js +39 -7
- package/dist/cjs/input/Textarea.js +23 -4
- package/dist/cjs/internal/ErrorIcon.js +1 -1
- package/dist/cjs/internal/FieldWrapper.js +11 -4
- package/dist/cjs/internal/InputWrapper.js +19 -16
- package/dist/cjs/select/AutoComplete.js +19 -8
- package/dist/cjs/select/DualList.js +15 -1
- package/dist/cjs/select/List.js +45 -20
- package/dist/cjs/select/Options.js +2 -2
- package/dist/cjs/select/Select.js +14 -4
- package/dist/cjs/select/useSelect.js +10 -6
- package/dist/cjs/types/schema.js +43 -0
- package/dist/cjs/utils/eventHandlers.js +11 -5
- package/dist/cjs/utils/getColor.js +6 -0
- package/dist/esm/builder/FileField.js +39 -27
- package/dist/esm/builder/FormField.js +50 -34
- package/dist/esm/builder/SchemaEditor.js +72 -0
- package/dist/esm/builder/components/AddSchemaFields.js +62 -0
- package/dist/esm/builder/components/SchemaArrayForm.js +143 -0
- package/dist/esm/builder/components/SchemaField.js +414 -0
- package/dist/esm/form/Controller.js +46 -1
- package/dist/esm/form/Form.js +43 -6
- package/dist/esm/hooks/useFileUploader.js +16 -0
- package/dist/esm/hooks/useFormBuilder.js +55 -13
- package/dist/esm/i18n/ar.json.js +5 -4
- package/dist/esm/i18n/en.json.js +5 -5
- package/dist/esm/index.js +5 -1
- package/dist/esm/input/ArrayInput.js +100 -33
- package/dist/esm/input/AvatarInput.js +17 -8
- package/dist/esm/input/Checkbox.js +15 -5
- package/dist/esm/input/ColorInput.js +110 -58
- package/dist/esm/input/ColorPicker.js +11 -35
- package/dist/esm/input/DateInput.js +195 -0
- package/dist/esm/input/Field.js +11 -5
- package/dist/esm/input/File.js +16 -9
- package/dist/esm/input/Hidden.js +11 -1
- package/dist/esm/input/Input.js +21 -9
- package/dist/esm/input/Number.js +19 -9
- package/dist/esm/input/Password.js +18 -10
- package/dist/esm/input/Radio.js +11 -2
- package/dist/esm/input/RadioGroup.js +15 -4
- package/dist/esm/input/{Range.js → RangeSlider.js} +14 -6
- package/dist/esm/input/Search.js +27 -18
- package/dist/esm/input/Slider.js +10 -4
- package/dist/esm/input/Switch.js +41 -9
- package/dist/esm/input/Textarea.js +24 -5
- package/dist/esm/internal/ErrorIcon.js +1 -1
- package/dist/esm/internal/FieldWrapper.js +11 -4
- package/dist/esm/internal/InputWrapper.js +19 -16
- package/dist/esm/select/AutoComplete.js +19 -8
- package/dist/esm/select/DualList.js +15 -1
- package/dist/esm/select/List.js +46 -21
- package/dist/esm/select/Options.js +2 -2
- package/dist/esm/select/Select.js +14 -4
- package/dist/esm/select/useSelect.js +11 -7
- package/{src/input/ColorPicker.module.css → dist/esm/types/schema.js} +18 -27
- package/dist/esm/utils/eventHandlers.js +11 -5
- package/dist/esm/utils/getColor.js +6 -1
- package/dist/types/builder/FileField.d.ts +4 -2
- package/dist/types/builder/FormField.d.ts +3 -1
- package/dist/types/builder/SchemaEditor.d.ts +9 -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 +10 -0
- package/dist/types/form/Controller.d.ts +47 -2
- package/dist/types/form/Form.d.ts +37 -2
- package/dist/types/hooks/useFileUploader.d.ts +16 -0
- package/dist/types/hooks/useFormBuilder.d.ts +32 -1
- package/dist/types/index.d.ts +5 -2
- package/dist/types/input/ArrayInput.d.ts +78 -6
- package/dist/types/input/AvatarInput.d.ts +14 -3
- package/dist/types/input/Checkbox.d.ts +13 -4
- package/dist/types/input/ColorInput.d.ts +15 -2
- package/dist/types/input/ColorPicker.d.ts +11 -1
- package/dist/types/input/DateInput.d.ts +28 -0
- package/dist/types/input/Field.d.ts +5 -1
- package/dist/types/input/File.d.ts +9 -0
- package/dist/types/input/Hidden.d.ts +8 -0
- package/dist/types/input/Input.d.ts +9 -1
- package/dist/types/input/Number.d.ts +9 -1
- package/dist/types/input/Password.d.ts +7 -1
- package/dist/types/input/Radio.d.ts +9 -1
- package/dist/types/input/RadioGroup.d.ts +26 -3
- package/dist/types/input/{Range.d.ts → RangeSlider.d.ts} +10 -2
- package/dist/types/input/Search.d.ts +14 -1
- package/dist/types/input/Slider.d.ts +7 -1
- package/dist/types/input/Switch.d.ts +16 -4
- package/dist/types/input/Textarea.d.ts +15 -1
- package/dist/types/internal/FieldWrapper.d.ts +1 -1
- package/dist/types/internal/InputWrapper.d.ts +1 -1
- package/dist/types/ranger/index.d.ts +2 -2
- package/dist/types/select/AutoComplete.d.ts +8 -1
- package/dist/types/select/DualList.d.ts +17 -2
- package/dist/types/select/List.d.ts +9 -1
- package/dist/types/select/Select.d.ts +9 -1
- package/dist/types/select/useSelect.d.ts +7 -6
- package/dist/types/types/index.d.ts +28 -7
- package/dist/types/types/schema.d.ts +78 -33
- package/dist/types/utils/eventHandlers.d.ts +1 -1
- package/package.json +15 -12
- package/src/builder/FileField.tsx +53 -27
- package/src/builder/FormField.tsx +52 -32
- package/src/builder/SchemaEditor.tsx +79 -0
- package/src/builder/components/AddSchemaFields.tsx +74 -0
- package/src/builder/components/SchemaArrayForm.tsx +158 -0
- package/src/builder/components/SchemaField.tsx +436 -0
- package/src/form/Controller.tsx +48 -3
- package/src/form/Form.tsx +45 -5
- package/src/hooks/useFileUploader.ts +16 -0
- package/src/hooks/useFormBuilder.tsx +58 -15
- package/src/i18n/ar.json +5 -4
- package/src/i18n/en.json +5 -5
- package/src/index.ts +11 -2
- package/src/input/ArrayInput.tsx +169 -54
- package/src/input/AvatarInput.tsx +20 -8
- package/src/input/Checkbox.tsx +15 -5
- package/src/input/ColorInput.tsx +126 -69
- package/src/input/ColorPicker.tsx +12 -36
- package/src/input/DateInput.tsx +259 -0
- package/src/input/Field.tsx +15 -11
- package/src/input/File.tsx +16 -14
- package/src/input/Hidden.tsx +12 -1
- package/src/input/Input.tsx +23 -10
- package/src/input/Number.tsx +18 -10
- package/src/input/Password.tsx +19 -12
- package/src/input/Radio.tsx +11 -2
- package/src/input/RadioGroup.tsx +35 -4
- package/src/input/{Range.tsx → RangeSlider.tsx} +13 -5
- package/src/input/Search.tsx +29 -19
- package/src/input/Slider.tsx +10 -4
- package/src/input/Switch.tsx +52 -7
- package/src/input/Textarea.tsx +29 -5
- package/src/internal/ErrorIcon.tsx +1 -1
- package/src/internal/FieldWrapper.tsx +8 -4
- package/src/internal/InputWrapper.tsx +36 -20
- package/src/select/AutoComplete.tsx +12 -1
- package/src/select/DualList.tsx +19 -0
- package/src/select/List.tsx +49 -8
- package/src/select/Options.tsx +1 -1
- package/src/select/Select.tsx +21 -3
- package/src/select/useSelect.tsx +13 -5
- package/src/types/index.ts +34 -8
- package/src/types/schema.ts +96 -41
- package/src/utils/eventHandlers.ts +9 -3
- 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
|
@@ -14,6 +14,8 @@ var useSelect = function useSelect(_ref) {
|
|
|
14
14
|
var _ref$options = _ref.options,
|
|
15
15
|
options = _ref$options === void 0 ? utilities.EMPTY_ARRAY : _ref$options,
|
|
16
16
|
value = _ref.value,
|
|
17
|
+
_ref$defaultOpen = _ref.defaultOpen,
|
|
18
|
+
defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,
|
|
17
19
|
autoComplete = _ref.autoComplete,
|
|
18
20
|
_ref$multiple = _ref.multiple,
|
|
19
21
|
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
@@ -25,6 +27,7 @@ var useSelect = function useSelect(_ref) {
|
|
|
25
27
|
valueProperty = _ref$valueProperty === void 0 ? "id" : _ref$valueProperty,
|
|
26
28
|
_ref$labelProperty = _ref.labelProperty,
|
|
27
29
|
labelProperty = _ref$labelProperty === void 0 ? "label" : _ref$labelProperty,
|
|
30
|
+
sortProperty = _ref.sortProperty,
|
|
28
31
|
_ref$createOption = _ref.createOption,
|
|
29
32
|
createOption = _ref$createOption === void 0 ? helpers.makeOption : _ref$createOption,
|
|
30
33
|
matcher = _ref.matcher,
|
|
@@ -133,13 +136,14 @@ var useSelect = function useSelect(_ref) {
|
|
|
133
136
|
if (autoComplete && action.query !== undefined) {
|
|
134
137
|
optionList = utilities.dedupe([action.query].concat(_toConsumableArray(optionList)));
|
|
135
138
|
}
|
|
139
|
+
if (sortProperty) optionList = optionList.sort(utilities.compareValues("asc", sortProperty));
|
|
136
140
|
var grouped = utilities.groupBy(optionList, groupProperty, "");
|
|
137
141
|
if (action.open) _newState.open = true;
|
|
138
142
|
_newState.items = [];
|
|
139
143
|
// add new item if allowCreate
|
|
140
144
|
if (allowCreate && action.query) _newState.items.push({
|
|
141
145
|
___create___: true,
|
|
142
|
-
value:
|
|
146
|
+
value: action.query
|
|
143
147
|
});
|
|
144
148
|
Object.entries(grouped).forEach(function (_ref2) {
|
|
145
149
|
var _newState$items;
|
|
@@ -169,7 +173,7 @@ var useSelect = function useSelect(_ref) {
|
|
|
169
173
|
}, {
|
|
170
174
|
multiple: multiple,
|
|
171
175
|
emptyValue: emptyValue,
|
|
172
|
-
open:
|
|
176
|
+
open: defaultOpen,
|
|
173
177
|
loading: false,
|
|
174
178
|
activeIndex: null,
|
|
175
179
|
selectedIndex: null,
|
|
@@ -201,7 +205,7 @@ var useSelect = function useSelect(_ref) {
|
|
|
201
205
|
});
|
|
202
206
|
dispatch({
|
|
203
207
|
type: "setValue",
|
|
204
|
-
value: (_ref4 = hasValue !== null && hasValue !== void 0 ? hasValue : newOption) !== null && _ref4 !== void 0 ? _ref4 :
|
|
208
|
+
value: (_ref4 = hasValue !== null && hasValue !== void 0 ? hasValue : newOption) !== null && _ref4 !== void 0 ? _ref4 : deferred
|
|
205
209
|
});
|
|
206
210
|
}
|
|
207
211
|
if (multiple) {
|
|
@@ -211,12 +215,12 @@ var useSelect = function useSelect(_ref) {
|
|
|
211
215
|
var newOption = (allowCreate || autoComplete) && item ? createOption(item) : undefined;
|
|
212
216
|
var hasValue = options.find(function (opt) {
|
|
213
217
|
var _opt$valueProperty2;
|
|
214
|
-
return ((_opt$valueProperty2 = opt[valueProperty]) !== null && _opt$valueProperty2 !== void 0 ? _opt$valueProperty2 : opt) ===
|
|
218
|
+
return ((_opt$valueProperty2 = opt[valueProperty]) !== null && _opt$valueProperty2 !== void 0 ? _opt$valueProperty2 : opt) === item;
|
|
215
219
|
});
|
|
216
220
|
if (!hasValue && newOption) {
|
|
217
221
|
optionsRef.current.push(newOption);
|
|
218
222
|
}
|
|
219
|
-
return (_ref5 = hasValue !== null && hasValue !== void 0 ? hasValue : newOption) !== null && _ref5 !== void 0 ? _ref5 :
|
|
223
|
+
return (_ref5 = hasValue !== null && hasValue !== void 0 ? hasValue : newOption) !== null && _ref5 !== void 0 ? _ref5 : item;
|
|
220
224
|
});
|
|
221
225
|
optionsRef.current = [].concat(_toConsumableArray(optionsRef.current), _toConsumableArray(options !== null && options !== void 0 ? options : []));
|
|
222
226
|
dispatch({
|
|
@@ -246,7 +250,7 @@ var useSelect = function useSelect(_ref) {
|
|
|
246
250
|
setActive: true
|
|
247
251
|
});
|
|
248
252
|
});
|
|
249
|
-
}, [onQuery]);
|
|
253
|
+
}, [onQuery], 300);
|
|
250
254
|
|
|
251
255
|
// handlers
|
|
252
256
|
var handleQuery = react.useCallback(function (query) {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* React Fabric
|
|
5
|
+
* @version: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
10
|
+
*
|
|
11
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
12
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
13
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
14
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
+
* subject to the following conditions:
|
|
16
|
+
*
|
|
17
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
18
|
+
* portions of the Software.
|
|
19
|
+
*
|
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
21
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
22
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
23
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var DATA_TYPES = /*#__PURE__*/function (DATA_TYPES) {
|
|
27
|
+
DATA_TYPES["TEXT"] = "text";
|
|
28
|
+
DATA_TYPES["COLOR"] = "color";
|
|
29
|
+
DATA_TYPES["BOOL"] = "bool";
|
|
30
|
+
DATA_TYPES["DATE"] = "date";
|
|
31
|
+
DATA_TYPES["DATETIME"] = "datetime";
|
|
32
|
+
DATA_TYPES["STRING"] = "string";
|
|
33
|
+
DATA_TYPES["NUMBER"] = "number";
|
|
34
|
+
DATA_TYPES["RANGE"] = "range";
|
|
35
|
+
DATA_TYPES["FILE"] = "file";
|
|
36
|
+
DATA_TYPES["AVATAR"] = "avatar";
|
|
37
|
+
DATA_TYPES["SCHEMA"] = "schema";
|
|
38
|
+
return DATA_TYPES;
|
|
39
|
+
}({});
|
|
40
|
+
var SCHEMA_CUSTOM_LIST = "--CUSTOM--";
|
|
41
|
+
|
|
42
|
+
exports.DATA_TYPES = DATA_TYPES;
|
|
43
|
+
exports.SCHEMA_CUSTOM_LIST = SCHEMA_CUSTOM_LIST;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var react = require('@floating-ui/react');
|
|
4
|
+
var core = require('@react-fabric/core');
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
* React Fabric
|
|
@@ -26,16 +27,21 @@ var utilities = require('@react-fabric/utilities');
|
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
/** ***************** common handler for enter press *******************/
|
|
29
|
-
var
|
|
30
|
+
var useHandleEnter = function useHandleEnter(callback) {
|
|
30
31
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
31
32
|
_ref$stopPropagation = _ref.stopPropagation,
|
|
32
33
|
stopPropagation = _ref$stopPropagation === void 0 ? false : _ref$stopPropagation,
|
|
33
34
|
_ref$preventDefault = _ref.preventDefault,
|
|
34
35
|
preventDefault = _ref$preventDefault === void 0 ? false : _ref$preventDefault;
|
|
35
|
-
var cbHandle =
|
|
36
|
+
var cbHandle = core.useDebounce(callback !== null && callback !== void 0 ? callback : function () {
|
|
36
37
|
return undefined;
|
|
37
|
-
}, 100);
|
|
38
|
+
}, [callback], 100);
|
|
39
|
+
var tree = react.useFloatingTree();
|
|
38
40
|
return function (e) {
|
|
41
|
+
// prevent propagation of event if input within dropdown (work around for floating-ui typeahead)
|
|
42
|
+
if (tree && e.key !== "Escape") {
|
|
43
|
+
e === null || e === void 0 || e.stopPropagation();
|
|
44
|
+
}
|
|
39
45
|
if (!e.shiftKey && !e.altKey && !e.metaKey && e.key === "Enter" && callback) {
|
|
40
46
|
if (stopPropagation) e === null || e === void 0 || e.stopPropagation();
|
|
41
47
|
cbHandle(e);
|
|
@@ -47,4 +53,4 @@ var handleEnter = function handleEnter(callback) {
|
|
|
47
53
|
};
|
|
48
54
|
};
|
|
49
55
|
|
|
50
|
-
exports.
|
|
56
|
+
exports.useHandleEnter = useHandleEnter;
|
|
@@ -35,6 +35,12 @@ var getBgClass = function getBgClass(bg) {
|
|
|
35
35
|
return "bg-".concat(bg);
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var getColorClass = function getColorClass(color) {
|
|
39
|
+
if (color && !utilities.isColor(color)) {
|
|
40
|
+
return "text-".concat(color);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
38
43
|
|
|
39
44
|
exports.getBgClass = getBgClass;
|
|
40
45
|
exports.getColor = getColor;
|
|
46
|
+
exports.getColorClass = getColorClass;
|
|
@@ -4,26 +4,32 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
7
|
-
import { Button, Icon, ProgressBar } from '@react-fabric/core';
|
|
8
|
-
import { FileUtil, Format } from '@react-fabric/utilities';
|
|
7
|
+
import { Tooltip, Button, Icon, ProgressBar } from '@react-fabric/core';
|
|
8
|
+
import { isString, FileUtil, Format } from '@react-fabric/utilities';
|
|
9
9
|
import { Fragment } from 'react';
|
|
10
|
+
import { useTranslation } from 'react-i18next';
|
|
10
11
|
import { useFileUploader } from '../hooks/useFileUploader.js';
|
|
11
12
|
import { Field } from '../input/Field.js';
|
|
12
13
|
import { HiddenInput } from '../input/Hidden.js';
|
|
13
14
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
15
|
|
|
15
|
-
var _excluded = ["uploadHandler", "inline", "label", "accept", "multiple", "
|
|
16
|
+
var _excluded = ["uploadHandler", "inline", "label", "accept", "value", "fileUrl", "multiple", "invalid", "error"];
|
|
16
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; }
|
|
17
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; }
|
|
18
19
|
var FileField = function FileField(_ref) {
|
|
20
|
+
var _error$values$label, _error$values, _error$values2;
|
|
19
21
|
var uploadHandler = _ref.uploadHandler,
|
|
20
22
|
inline = _ref.inline,
|
|
21
23
|
label = _ref.label,
|
|
22
24
|
accept = _ref.accept,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
value = _ref.value;
|
|
26
|
+
_ref.fileUrl;
|
|
27
|
+
var multiple = _ref.multiple;
|
|
28
|
+
_ref.invalid;
|
|
29
|
+
var error = _ref.error,
|
|
26
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
var _useTranslation = useTranslation(),
|
|
32
|
+
t = _useTranslation.t;
|
|
27
33
|
var _useFileUploader = useFileUploader( /*#__PURE__*/function () {
|
|
28
34
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data, config) {
|
|
29
35
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -49,32 +55,38 @@ var FileField = function FileField(_ref) {
|
|
|
49
55
|
upload = _useFileUploader.upload,
|
|
50
56
|
remove = _useFileUploader.remove;
|
|
51
57
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
52
|
-
children: [/*#__PURE__*/
|
|
58
|
+
children: [/*#__PURE__*/jsx(Field, {
|
|
53
59
|
plain: true,
|
|
54
60
|
inline: inline,
|
|
55
61
|
label: label,
|
|
56
|
-
|
|
57
|
-
children: [/*#__PURE__*/jsx(HiddenInput, _objectSpread({
|
|
62
|
+
children: /*#__PURE__*/jsx(HiddenInput, _objectSpread({
|
|
58
63
|
hiddenValue: multiple ? list : list === null || list === void 0 ? void 0 : list[0]
|
|
59
|
-
}, rest))
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
}, rest))
|
|
65
|
+
}), /*#__PURE__*/jsx(Tooltip, {
|
|
66
|
+
color: "danger-200",
|
|
67
|
+
content: isString(error) ? "".concat(error) : error && t(error === null || error === void 0 ? void 0 : error.key, error.values ? _objectSpread(_objectSpread({}, error === null || error === void 0 ? void 0 : error.values), {}, {
|
|
68
|
+
label: t((_error$values$label = (_error$values = error.values) === null || _error$values === void 0 ? void 0 : _error$values.label) !== null && _error$values$label !== void 0 ? _error$values$label : "form:badkey", (_error$values2 = error.values) === null || _error$values2 === void 0 ? void 0 : _error$values2.path)
|
|
69
|
+
}) : {}),
|
|
70
|
+
disabled: !error,
|
|
71
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
72
|
+
badge: pending > 0 ? "".concat(pending) : undefined,
|
|
73
|
+
color: error ? "danger" : undefined,
|
|
74
|
+
variant: error ? "soft" : undefined,
|
|
75
|
+
"data-ref": "filebtn",
|
|
76
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
77
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
78
|
+
children: "Add file"
|
|
79
|
+
}), /*#__PURE__*/jsx("input", {
|
|
80
|
+
type: "file",
|
|
81
|
+
accept: accept,
|
|
82
|
+
multiple: multiple,
|
|
83
|
+
className: "absolute inset-0 opacity-0 z-5",
|
|
84
|
+
onChange: function onChange(e) {
|
|
85
|
+
return [upload(e.target.files), e.target.value = ""];
|
|
86
|
+
}
|
|
87
|
+
})]
|
|
76
88
|
})
|
|
77
|
-
})
|
|
89
|
+
})
|
|
78
90
|
}), /*#__PURE__*/jsx("br", {}), /*#__PURE__*/jsx("div", {
|
|
79
91
|
className: "bg-alternate",
|
|
80
92
|
children: files.map(function (file, idx) {
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import { isEmpty } from '@react-fabric/utilities';
|
|
5
6
|
import { useMemo } from 'react';
|
|
6
7
|
import { useTranslation } from 'react-i18next';
|
|
7
8
|
import { Controller } from '../form/Controller.js';
|
|
8
9
|
import { ArrayInput } from '../input/ArrayInput.js';
|
|
9
10
|
import { AvatarInput } from '../input/AvatarInput.js';
|
|
10
11
|
import { ColorInput } from '../input/ColorInput.js';
|
|
12
|
+
import { DateInput } from '../input/DateInput.js';
|
|
11
13
|
import { Input } from '../input/Input.js';
|
|
12
14
|
import { Number } from '../input/Number.js';
|
|
13
|
-
import {
|
|
15
|
+
import { RangeSlider } from '../input/RangeSlider.js';
|
|
14
16
|
import { Switch } from '../input/Switch.js';
|
|
15
17
|
import { Textarea } from '../input/Textarea.js';
|
|
16
18
|
import { Select } from '../select/Select.js';
|
|
19
|
+
import { DATA_TYPES } from '../types/schema.js';
|
|
17
20
|
import { FileField } from './FileField.js';
|
|
18
21
|
import { jsx } from 'react/jsx-runtime';
|
|
19
22
|
|
|
20
|
-
var _excluded = ["id", "label", "required", "inline", "prefix", "autoFocus", "
|
|
23
|
+
var _excluded = ["id", "label", "required", "inline", "prefix", "autoFocus", "optionLists", "fileUrl", "uploadHandler"];
|
|
21
24
|
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; }
|
|
22
25
|
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; }
|
|
23
26
|
var FormField = function FormField(_ref) {
|
|
@@ -26,9 +29,9 @@ var FormField = function FormField(_ref) {
|
|
|
26
29
|
required = _ref.required,
|
|
27
30
|
inline = _ref.inline,
|
|
28
31
|
prefix = _ref.prefix,
|
|
29
|
-
autoFocus = _ref.autoFocus
|
|
30
|
-
_ref.
|
|
31
|
-
|
|
32
|
+
autoFocus = _ref.autoFocus,
|
|
33
|
+
optionLists = _ref.optionLists,
|
|
34
|
+
fileUrl = _ref.fileUrl,
|
|
32
35
|
uploadHandler = _ref.uploadHandler,
|
|
33
36
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
37
|
var _useTranslation = useTranslation(),
|
|
@@ -36,48 +39,61 @@ var FormField = function FormField(_ref) {
|
|
|
36
39
|
var fieldName = useMemo(function () {
|
|
37
40
|
return [prefix, id].filter(Boolean).join(".");
|
|
38
41
|
}, [id, prefix]);
|
|
42
|
+
var hasOptions = useMemo(function () {
|
|
43
|
+
var _rest$optionList;
|
|
44
|
+
return rest.datatype === DATA_TYPES.STRING && (rest.optionList === "--CUSTOM--" && !isEmpty(rest.options) || !isEmpty(optionLists === null || optionLists === void 0 ? void 0 : optionLists[(_rest$optionList = rest.optionList) !== null && _rest$optionList !== void 0 ? _rest$optionList : ""]));
|
|
45
|
+
}, [rest]);
|
|
39
46
|
var E = useMemo(function () {
|
|
40
|
-
if (rest.datatype ===
|
|
41
|
-
if (rest.datatype ===
|
|
42
|
-
if (rest.datatype ===
|
|
43
|
-
if (rest.datatype ===
|
|
44
|
-
if (rest.datatype ===
|
|
45
|
-
if (rest.datatype ===
|
|
47
|
+
if (rest.datatype === DATA_TYPES.NUMBER) return Number;
|
|
48
|
+
if (rest.datatype === DATA_TYPES.RANGE) return RangeSlider;
|
|
49
|
+
if (rest.datatype === DATA_TYPES.BOOL) return Switch;
|
|
50
|
+
if (rest.datatype === DATA_TYPES.TEXT) return Textarea;
|
|
51
|
+
if (rest.datatype === DATA_TYPES.DATE) return DateInput;
|
|
52
|
+
if (rest.datatype === DATA_TYPES.DATETIME) return DateInput;
|
|
53
|
+
if (rest.datatype === DATA_TYPES.COLOR) return ColorInput;
|
|
54
|
+
if (hasOptions) return Select;
|
|
46
55
|
return Input;
|
|
47
|
-
}, [rest.datatype]);
|
|
56
|
+
}, [rest.datatype, hasOptions]);
|
|
48
57
|
var props = useMemo(function () {
|
|
49
|
-
var _rest$step, _rest$
|
|
50
|
-
if (rest.datatype ===
|
|
58
|
+
var _rest$step, _rest$min, _rest$max, _rest$step2, _optionLists, _rest$optionList2;
|
|
59
|
+
if (rest.datatype === DATA_TYPES.NUMBER) return {
|
|
51
60
|
min: rest.min,
|
|
52
61
|
max: rest.max,
|
|
53
62
|
step: (_rest$step = rest.step) !== null && _rest$step !== void 0 ? _rest$step : 1
|
|
54
63
|
};
|
|
55
|
-
if (rest.datatype ===
|
|
56
|
-
min: rest.min,
|
|
57
|
-
max: rest.max,
|
|
58
|
-
step: (_rest$step2 = rest.step) !== null && _rest$step2 !== void 0 ? _rest$step2 : 0.1
|
|
59
|
-
};
|
|
60
|
-
if (rest.datatype === "range") return {
|
|
64
|
+
if (rest.datatype === DATA_TYPES.RANGE) return {
|
|
61
65
|
min: (_rest$min = rest.min) !== null && _rest$min !== void 0 ? _rest$min : 1,
|
|
62
66
|
max: (_rest$max = rest.max) !== null && _rest$max !== void 0 ? _rest$max : 99,
|
|
63
|
-
step: (_rest$
|
|
67
|
+
step: (_rest$step2 = rest.step) !== null && _rest$step2 !== void 0 ? _rest$step2 : 1,
|
|
64
68
|
showValue: true,
|
|
65
69
|
showLabels: true
|
|
66
70
|
};
|
|
67
|
-
if (rest.datatype ===
|
|
71
|
+
if (rest.datatype === DATA_TYPES.DATE) return {
|
|
72
|
+
min: rest.min,
|
|
73
|
+
max: rest.max,
|
|
74
|
+
type: "date"
|
|
75
|
+
};
|
|
76
|
+
if (rest.datatype === DATA_TYPES.DATETIME) return {
|
|
77
|
+
min: rest.min,
|
|
78
|
+
max: rest.max,
|
|
79
|
+
type: "datetime"
|
|
80
|
+
};
|
|
81
|
+
if (rest.datatype === DATA_TYPES.TEXT) return {
|
|
68
82
|
rows: 3
|
|
69
83
|
};
|
|
70
|
-
if (rest.datatype ===
|
|
84
|
+
if (rest.datatype === DATA_TYPES.COLOR) return {
|
|
71
85
|
showPicker: true
|
|
72
86
|
};
|
|
73
|
-
if (rest.datatype ===
|
|
74
|
-
options: rest.options,
|
|
87
|
+
if (rest.datatype === DATA_TYPES.STRING && hasOptions) return _objectSpread({
|
|
75
88
|
multiple: rest.multiple,
|
|
89
|
+
allowCreate: rest.allowCustom,
|
|
76
90
|
searchable: true
|
|
77
|
-
}
|
|
91
|
+
}, (_optionLists = optionLists === null || optionLists === void 0 ? void 0 : optionLists[(_rest$optionList2 = rest.optionList) !== null && _rest$optionList2 !== void 0 ? _rest$optionList2 : ""]) !== null && _optionLists !== void 0 ? _optionLists : {
|
|
92
|
+
options: rest.options
|
|
93
|
+
});
|
|
78
94
|
return {};
|
|
79
|
-
}, [rest]);
|
|
80
|
-
if (rest.datatype ===
|
|
95
|
+
}, [rest, hasOptions, optionLists]);
|
|
96
|
+
if (rest.datatype === DATA_TYPES.AVATAR) return uploadHandler && /*#__PURE__*/jsx(Controller, {
|
|
81
97
|
name: fieldName,
|
|
82
98
|
children: /*#__PURE__*/jsx(AvatarInput, {
|
|
83
99
|
uploadHandler: uploadHandler,
|
|
@@ -85,7 +101,7 @@ var FormField = function FormField(_ref) {
|
|
|
85
101
|
name: fieldName
|
|
86
102
|
})
|
|
87
103
|
});
|
|
88
|
-
if (rest.datatype ===
|
|
104
|
+
if (rest.datatype === DATA_TYPES.FILE) return uploadHandler && /*#__PURE__*/jsx(Controller, {
|
|
89
105
|
name: fieldName,
|
|
90
106
|
children: /*#__PURE__*/jsx(FileField, _objectSpread({
|
|
91
107
|
uploadHandler: uploadHandler,
|
|
@@ -94,12 +110,12 @@ var FormField = function FormField(_ref) {
|
|
|
94
110
|
id: id
|
|
95
111
|
}, rest))
|
|
96
112
|
});
|
|
97
|
-
return rest.multiple && !
|
|
113
|
+
return rest.multiple && !hasOptions ? /*#__PURE__*/jsx(ArrayInput, {
|
|
98
114
|
name: fieldName,
|
|
99
|
-
label: t(
|
|
115
|
+
label: t("fb.".concat(id), label || id),
|
|
100
116
|
required: required,
|
|
101
117
|
onAdd: function onAdd() {
|
|
102
|
-
return "";
|
|
118
|
+
return String("");
|
|
103
119
|
},
|
|
104
120
|
children: /*#__PURE__*/jsx(Controller, {
|
|
105
121
|
children: /*#__PURE__*/jsx(E, _objectSpread({}, props))
|
|
@@ -108,8 +124,8 @@ var FormField = function FormField(_ref) {
|
|
|
108
124
|
name: fieldName,
|
|
109
125
|
children: /*#__PURE__*/jsx(E, _objectSpread(_objectSpread({}, props), {}, {
|
|
110
126
|
autoFocus: autoFocus,
|
|
111
|
-
label: t(
|
|
112
|
-
placeholder: t(
|
|
127
|
+
label: t("fb.".concat(id), label || id),
|
|
128
|
+
placeholder: t("fb.".concat(id), label || id),
|
|
113
129
|
required: required,
|
|
114
130
|
inline: inline
|
|
115
131
|
}))
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Footer } from '@react-fabric/core';
|
|
4
|
+
import { EMPTY_ARRAY } from '@react-fabric/utilities';
|
|
5
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
6
|
+
import { Form } from '../form/Form.js';
|
|
7
|
+
import { DATA_TYPES } from '../types/schema.js';
|
|
8
|
+
import { SchemaArrayForm } from './components/SchemaArrayForm.js';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* React Fabric
|
|
13
|
+
* @version: 1.0.0
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* The MIT License (MIT)
|
|
17
|
+
* Copyright (c) 2025 Adarsh Pastakia
|
|
18
|
+
*
|
|
19
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
20
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
21
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
22
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
23
|
+
* subject to the following conditions:
|
|
24
|
+
*
|
|
25
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
26
|
+
* portions of the Software.
|
|
27
|
+
*
|
|
28
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
29
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
30
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
31
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
var SchemaEditor = function SchemaEditor(_ref) {
|
|
35
|
+
var schemaDef = _ref.schemaDef,
|
|
36
|
+
dynamic = _ref.dynamic,
|
|
37
|
+
acceptableTypes = _ref.acceptableTypes,
|
|
38
|
+
_ref$optionLists = _ref.optionLists,
|
|
39
|
+
optionLists = _ref$optionLists === void 0 ? EMPTY_ARRAY : _ref$optionLists,
|
|
40
|
+
children = _ref.children,
|
|
41
|
+
onSubmit = _ref.onSubmit,
|
|
42
|
+
onChange = _ref.onChange;
|
|
43
|
+
var formRef = useRef(null);
|
|
44
|
+
var handleChange = useCallback(function (model) {
|
|
45
|
+
onChange === null || onChange === void 0 || onChange(model.schema);
|
|
46
|
+
}, []);
|
|
47
|
+
var handleSubmit = useCallback(function (model) {
|
|
48
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(model.schema);
|
|
49
|
+
}, []);
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
var _formRef$current;
|
|
52
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.setValues({
|
|
53
|
+
schema: schemaDef
|
|
54
|
+
});
|
|
55
|
+
}, [schemaDef]);
|
|
56
|
+
return /*#__PURE__*/jsxs(Form, {
|
|
57
|
+
formRef: formRef,
|
|
58
|
+
onChange: handleChange,
|
|
59
|
+
onSubmit: handleSubmit,
|
|
60
|
+
children: [/*#__PURE__*/jsx(SchemaArrayForm, {
|
|
61
|
+
dynamic: dynamic,
|
|
62
|
+
optionLists: optionLists,
|
|
63
|
+
acceptableTypes: acceptableTypes !== null && acceptableTypes !== void 0 ? acceptableTypes : Object.values(DATA_TYPES)
|
|
64
|
+
}), children && /*#__PURE__*/jsx(Footer, {
|
|
65
|
+
flex: true,
|
|
66
|
+
className: "border-t bg-base px-6 py-2",
|
|
67
|
+
children: children
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { SchemaEditor };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import { Modal, Content, Footer, Button } from '@react-fabric/core';
|
|
5
|
+
import { yup } from '@react-fabric/utilities';
|
|
6
|
+
import { useCallback } from 'react';
|
|
7
|
+
import { Controller } from '../../form/Controller.js';
|
|
8
|
+
import { Form } from '../../form/Form.js';
|
|
9
|
+
import { ArrayInput } from '../../input/ArrayInput.js';
|
|
10
|
+
import { Input } from '../../input/Input.js';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
var fieldSchema = yup.object({
|
|
16
|
+
fields: yup.array(yup.string().trim().required()).required().min(1)
|
|
17
|
+
});
|
|
18
|
+
var AddSchemaFields = function AddSchemaFields(props) {
|
|
19
|
+
var handleSubmit = useCallback(function (model) {
|
|
20
|
+
props.onClose(model.fields.map(function (f) {
|
|
21
|
+
return f.split(",").map(function (ff) {
|
|
22
|
+
return ff.trim();
|
|
23
|
+
});
|
|
24
|
+
}).flat(2));
|
|
25
|
+
}, []);
|
|
26
|
+
return /*#__PURE__*/jsx(Modal, _objectSpread(_objectSpread({}, props), {}, {
|
|
27
|
+
children: /*#__PURE__*/jsxs(Form, {
|
|
28
|
+
schema: fieldSchema,
|
|
29
|
+
defaultValues: {
|
|
30
|
+
fields: [" "]
|
|
31
|
+
},
|
|
32
|
+
onSubmit: handleSubmit,
|
|
33
|
+
children: [/*#__PURE__*/jsxs(Content, {
|
|
34
|
+
children: [/*#__PURE__*/jsx(ArrayInput, {
|
|
35
|
+
minItems: 1,
|
|
36
|
+
name: "fields",
|
|
37
|
+
onAdd: function onAdd() {
|
|
38
|
+
return String("");
|
|
39
|
+
},
|
|
40
|
+
children: /*#__PURE__*/jsx(Controller, {
|
|
41
|
+
children: /*#__PURE__*/jsx(Input, {
|
|
42
|
+
autoFocus: true
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}), /*#__PURE__*/jsx("p", {
|
|
46
|
+
className: "text-sm text-muted",
|
|
47
|
+
children: "Provide list of fields or comma-separated value"
|
|
48
|
+
})]
|
|
49
|
+
}), /*#__PURE__*/jsx(Footer, {
|
|
50
|
+
flex: true,
|
|
51
|
+
justify: "end",
|
|
52
|
+
className: "px-2 py-1",
|
|
53
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
54
|
+
type: "submit",
|
|
55
|
+
children: "Add"
|
|
56
|
+
})
|
|
57
|
+
})]
|
|
58
|
+
})
|
|
59
|
+
}));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { AddSchemaFields };
|