@data-driven-forms/mui-component-mapper 4.1.12 → 4.1.14
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/.eslintrc.json +27 -0
- package/CHANGELOG.md +13 -2
- package/checkbox/checkbox.d.ts +29 -16
- package/checkbox/checkbox.js +44 -77
- package/checkbox/checkbox.js.map +1 -0
- package/checkbox/index.js +22 -24
- package/checkbox/index.js.map +1 -0
- package/component-mapper/component-mapper.d.ts +35 -40
- package/component-mapper/component-mapper.js +55 -40
- package/component-mapper/component-mapper.js.map +1 -0
- package/component-mapper/index.js +22 -24
- package/component-mapper/index.js.map +1 -0
- package/date-picker/date-picker.d.ts +10 -10
- package/date-picker/date-picker.js +52 -63
- package/date-picker/date-picker.js.map +1 -0
- package/date-picker/index.js +22 -24
- package/date-picker/index.js.map +1 -0
- package/dual-list-select/dual-list-select.d.ts +3 -111
- package/dual-list-select/dual-list-select.js +93 -412
- package/dual-list-select/dual-list-select.js.map +1 -0
- package/dual-list-select/index.js +22 -24
- package/dual-list-select/index.js.map +1 -0
- package/esm/checkbox/checkbox.d.ts +31 -0
- package/esm/checkbox/checkbox.js +25 -69
- package/esm/checkbox/checkbox.js.map +1 -0
- package/esm/checkbox/index.d.ts +2 -0
- package/esm/checkbox/index.js +2 -1
- package/esm/checkbox/index.js.map +1 -0
- package/esm/component-mapper/component-mapper.d.ts +36 -0
- package/esm/component-mapper/component-mapper.js +34 -19
- package/esm/component-mapper/component-mapper.js.map +1 -0
- package/esm/component-mapper/index.d.ts +2 -0
- package/esm/component-mapper/index.js +2 -1
- package/esm/component-mapper/index.js.map +1 -0
- package/esm/date-picker/date-picker.d.ts +12 -0
- package/esm/date-picker/date-picker.js +35 -55
- package/esm/date-picker/date-picker.js.map +1 -0
- package/esm/date-picker/index.d.ts +2 -0
- package/esm/date-picker/index.js +2 -1
- package/esm/date-picker/index.js.map +1 -0
- package/esm/dual-list-select/dual-list-select.d.ts +3 -0
- package/esm/dual-list-select/dual-list-select.js +59 -404
- package/esm/dual-list-select/dual-list-select.js.map +1 -0
- package/esm/dual-list-select/index.d.ts +2 -0
- package/esm/dual-list-select/index.js +2 -1
- package/esm/dual-list-select/index.js.map +1 -0
- package/esm/field-array/field-array.d.ts +56 -0
- package/esm/field-array/field-array.js +107 -296
- package/esm/field-array/field-array.js.map +1 -0
- package/esm/field-array/index.d.ts +2 -0
- package/esm/field-array/index.js +2 -1
- package/esm/field-array/index.js.map +1 -0
- package/esm/form-field-grid/form-field-grid.d.ts +8 -0
- package/esm/form-field-grid/form-field-grid.js +26 -22
- package/esm/form-field-grid/form-field-grid.js.map +1 -0
- package/esm/form-field-grid/index.d.ts +2 -0
- package/esm/form-field-grid/index.js +3 -1
- package/esm/form-field-grid/index.js.map +1 -0
- package/esm/form-template/form-template.d.ts +17 -0
- package/esm/form-template/form-template.js +57 -126
- package/esm/form-template/form-template.js.map +1 -0
- package/esm/form-template/index.d.ts +2 -0
- package/esm/form-template/index.js +2 -1
- package/esm/form-template/index.js.map +1 -0
- package/esm/index.d.ts +21 -0
- package/esm/index.js +3 -2
- package/esm/index.js.map +1 -0
- package/esm/multiple-choice-list/index.d.ts +2 -0
- package/esm/multiple-choice-list/index.js +2 -1
- package/esm/multiple-choice-list/index.js.map +1 -0
- package/esm/multiple-choice-list/multiple-choice-list.d.ts +14 -0
- package/esm/multiple-choice-list/multiple-choice-list.js +39 -93
- package/esm/multiple-choice-list/multiple-choice-list.js.map +1 -0
- package/esm/plain-text/index.d.ts +2 -0
- package/esm/plain-text/index.js +2 -1
- package/esm/plain-text/index.js.map +1 -0
- package/esm/plain-text/plain-text.d.ts +12 -0
- package/esm/plain-text/plain-text.js +18 -27
- package/esm/plain-text/plain-text.js.map +1 -0
- package/esm/radio/index.d.ts +2 -0
- package/esm/radio/index.js +2 -1
- package/esm/radio/index.js.map +1 -0
- package/esm/radio/radio.d.ts +19 -0
- package/esm/radio/radio.js +38 -110
- package/esm/radio/radio.js.map +1 -0
- package/esm/select/index.d.ts +2 -0
- package/esm/select/index.js +2 -1
- package/esm/select/index.js.map +1 -0
- package/esm/select/select.d.ts +44 -0
- package/esm/select/select.js +55 -162
- package/esm/select/select.js.map +1 -0
- package/esm/slider/index.d.ts +2 -0
- package/esm/slider/index.js +2 -1
- package/esm/slider/index.js.map +1 -0
- package/esm/slider/slider.d.ts +24 -0
- package/esm/slider/slider.js +22 -63
- package/esm/slider/slider.js.map +1 -0
- package/esm/sub-form/index.d.ts +2 -0
- package/esm/sub-form/index.js +2 -1
- package/esm/sub-form/index.js.map +1 -0
- package/esm/sub-form/sub-form.d.ts +16 -0
- package/esm/sub-form/sub-form.js +29 -52
- package/esm/sub-form/sub-form.js.map +1 -0
- package/esm/switch/index.d.ts +2 -0
- package/esm/switch/index.js +2 -1
- package/esm/switch/index.js.map +1 -0
- package/esm/switch/switch.d.ts +18 -0
- package/esm/switch/switch.js +21 -62
- package/esm/switch/switch.js.map +1 -0
- package/esm/tabs/index.d.ts +2 -0
- package/esm/tabs/index.js +2 -1
- package/esm/tabs/index.js.map +1 -0
- package/esm/tabs/tabs.d.ts +19 -0
- package/esm/tabs/tabs.js +9 -73
- package/esm/tabs/tabs.js.map +1 -0
- package/esm/text-field/index.d.ts +2 -0
- package/esm/text-field/index.js +2 -1
- package/esm/text-field/index.js.map +1 -0
- package/esm/text-field/text-field.d.ts +10 -0
- package/esm/text-field/text-field.js +20 -38
- package/esm/text-field/text-field.js.map +1 -0
- package/esm/textarea/index.d.ts +2 -0
- package/esm/textarea/index.js +2 -1
- package/esm/textarea/index.js.map +1 -0
- package/esm/textarea/textarea.d.ts +13 -0
- package/esm/textarea/textarea.js +20 -42
- package/esm/textarea/textarea.js.map +1 -0
- package/esm/time-picker/index.d.ts +2 -0
- package/esm/time-picker/index.js +2 -1
- package/esm/time-picker/index.js.map +1 -0
- package/esm/time-picker/time-picker.d.ts +13 -0
- package/esm/time-picker/time-picker.js +35 -57
- package/esm/time-picker/time-picker.js.map +1 -0
- package/esm/validation-error/index.d.ts +2 -0
- package/esm/validation-error/index.js +2 -1
- package/esm/validation-error/index.js.map +1 -0
- package/esm/validation-error/validation-error.d.ts +6 -0
- package/esm/validation-error/validation-error.js +7 -6
- package/esm/validation-error/validation-error.js.map +1 -0
- package/esm/wizard/index.d.ts +2 -0
- package/esm/wizard/index.js +2 -1
- package/esm/wizard/index.js.map +1 -0
- package/esm/wizard/step-buttons.d.ts +33 -0
- package/esm/wizard/step-buttons.js +49 -104
- package/esm/wizard/step-buttons.js.map +1 -0
- package/esm/wizard/wizard-nav.d.ts +15 -0
- package/esm/wizard/wizard-nav.js +15 -33
- package/esm/wizard/wizard-nav.js.map +1 -0
- package/esm/wizard/wizard.d.ts +4 -0
- package/esm/wizard/wizard.js +21 -70
- package/esm/wizard/wizard.js.map +1 -0
- package/field-array/field-array.d.ts +54 -38
- package/field-array/field-array.js +138 -306
- package/field-array/field-array.js.map +1 -0
- package/field-array/index.js +22 -24
- package/field-array/index.js.map +1 -0
- package/form-field-grid/form-field-grid.d.ts +7 -5
- package/form-field-grid/form-field-grid.js +42 -28
- package/form-field-grid/form-field-grid.js.map +1 -0
- package/form-field-grid/index.js +23 -12
- package/form-field-grid/index.js.map +1 -0
- package/form-template/form-template.d.ts +17 -5
- package/form-template/form-template.js +78 -132
- package/form-template/form-template.js.map +1 -0
- package/form-template/index.js +22 -24
- package/form-template/index.js.map +1 -0
- package/index.d.ts +10 -29
- package/index.js +45 -146
- package/index.js.map +1 -0
- package/multiple-choice-list/index.js +22 -24
- package/multiple-choice-list/index.js.map +1 -0
- package/multiple-choice-list/multiple-choice-list.d.ts +12 -24
- package/multiple-choice-list/multiple-choice-list.js +53 -101
- package/multiple-choice-list/multiple-choice-list.js.map +1 -0
- package/package.json +9 -11
- package/plain-text/index.js +22 -24
- package/plain-text/index.js.map +1 -0
- package/plain-text/plain-text.d.ts +10 -10
- package/plain-text/plain-text.js +30 -33
- package/plain-text/plain-text.js.map +1 -0
- package/radio/index.js +22 -24
- package/radio/index.js.map +1 -0
- package/radio/radio.d.ts +17 -25
- package/radio/radio.js +56 -116
- package/radio/radio.js.map +1 -0
- package/select/index.js +22 -24
- package/select/index.js.map +1 -0
- package/select/select.d.ts +42 -27
- package/select/select.js +78 -172
- package/select/select.js.map +1 -0
- package/slider/index.js +22 -24
- package/slider/index.js.map +1 -0
- package/slider/slider.d.ts +22 -28
- package/slider/slider.js +39 -71
- package/slider/slider.js.map +1 -0
- package/sub-form/index.js +22 -24
- package/sub-form/index.js.map +1 -0
- package/sub-form/sub-form.d.ts +14 -16
- package/sub-form/sub-form.js +42 -56
- package/sub-form/sub-form.js.map +1 -0
- package/switch/index.js +22 -24
- package/switch/index.js.map +1 -0
- package/switch/switch.d.ts +16 -26
- package/switch/switch.js +43 -70
- package/switch/switch.js.map +1 -0
- package/tabs/index.js +22 -24
- package/tabs/index.js.map +1 -0
- package/tabs/tabs.d.ts +18 -14
- package/tabs/tabs.js +33 -82
- package/tabs/tabs.js.map +1 -0
- package/text-field/index.js +22 -24
- package/text-field/index.js.map +1 -0
- package/text-field/text-field.d.ts +8 -16
- package/text-field/text-field.js +37 -46
- package/text-field/text-field.js.map +1 -0
- package/textarea/index.js +22 -24
- package/textarea/index.js.map +1 -0
- package/textarea/textarea.d.ts +11 -17
- package/textarea/textarea.js +37 -50
- package/textarea/textarea.js.map +1 -0
- package/time-picker/index.js +22 -24
- package/time-picker/index.js.map +1 -0
- package/time-picker/time-picker.d.ts +11 -16
- package/time-picker/time-picker.js +52 -65
- package/time-picker/time-picker.js.map +1 -0
- package/tsconfig.cjs.json +8 -0
- package/tsconfig.demo.json +31 -0
- package/tsconfig.esm.json +8 -0
- package/tsconfig.json +17 -9
- package/validation-error/index.js +22 -24
- package/validation-error/index.js.map +1 -0
- package/validation-error/validation-error.d.ts +5 -4
- package/validation-error/validation-error.js +10 -11
- package/validation-error/validation-error.js.map +1 -0
- package/wizard/index.js +22 -24
- package/wizard/index.js.map +1 -0
- package/wizard/step-buttons.d.ts +33 -0
- package/wizard/step-buttons.js +68 -110
- package/wizard/step-buttons.js.map +1 -0
- package/wizard/wizard-nav.d.ts +15 -0
- package/wizard/wizard-nav.js +37 -37
- package/wizard/wizard-nav.js.map +1 -0
- package/wizard/wizard.d.ts +4 -28
- package/wizard/wizard.js +41 -79
- package/wizard/wizard.js.map +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CheckboxProps as MUICheckboxProps, FormControlProps, FormControlLabelProps, FormHelperTextProps, FormGroupProps, FormLabelProps } from '@mui/material';
|
|
3
|
+
import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer';
|
|
4
|
+
import type { SelectOption, OptionValue } from '@data-driven-forms/common';
|
|
5
|
+
import type { FormFieldGridProps } from '../form-field-grid/form-field-grid';
|
|
6
|
+
export interface SingleCheckboxProps extends BaseFieldProps {
|
|
7
|
+
FormFieldGridProps?: FormFieldGridProps;
|
|
8
|
+
FormControlProps?: FormControlProps;
|
|
9
|
+
FormGroupProps?: FormGroupProps;
|
|
10
|
+
FormControlLabelProps?: FormControlLabelProps;
|
|
11
|
+
CheckboxProps?: MUICheckboxProps;
|
|
12
|
+
FormLabelProps?: FormLabelProps;
|
|
13
|
+
FormHelperTextProps?: FormHelperTextProps;
|
|
14
|
+
inputProps?: Record<string, any>;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
export interface CheckboxProps<T = OptionValue> extends BaseFieldProps {
|
|
18
|
+
options?: SelectOption<T>[];
|
|
19
|
+
FormFieldGridProps?: FormFieldGridProps;
|
|
20
|
+
FormControlProps?: FormControlProps;
|
|
21
|
+
FormGroupProps?: FormGroupProps;
|
|
22
|
+
FormControlLabelProps?: FormControlLabelProps;
|
|
23
|
+
CheckboxProps?: MUICheckboxProps;
|
|
24
|
+
FormLabelProps?: FormLabelProps;
|
|
25
|
+
FormHelperTextProps?: FormHelperTextProps;
|
|
26
|
+
inputProps?: Record<string, any>;
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export declare const SingleCheckbox: React.FC<SingleCheckboxProps>;
|
|
30
|
+
declare function Checkbox<T = OptionValue>({ options, ...props }: CheckboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export default Checkbox;
|
package/esm/checkbox/checkbox.js
CHANGED
|
@@ -1,73 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
import FormGroup from
|
|
14
|
-
import
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Checkbox as MUICheckbox, FormControl, FormControlLabel, FormHelperText, FormGroup, FormLabel } from '@mui/material';
|
|
14
|
+
import { useFieldApi } from '@data-driven-forms/react-form-renderer';
|
|
15
15
|
import FormFieldGrid from '../form-field-grid/form-field-grid';
|
|
16
16
|
import { validationError } from '../validation-error/validation-error';
|
|
17
17
|
import MultipleChoiceList from '../multiple-choice-list/multiple-choice-list';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})),
|
|
23
|
-
input = _useFieldApi.input,
|
|
24
|
-
isReadOnly = _useFieldApi.isReadOnly,
|
|
25
|
-
isDisabled = _useFieldApi.isDisabled,
|
|
26
|
-
isRequired = _useFieldApi.isRequired,
|
|
27
|
-
label = _useFieldApi.label,
|
|
28
|
-
helperText = _useFieldApi.helperText,
|
|
29
|
-
description = _useFieldApi.description,
|
|
30
|
-
validateOnMount = _useFieldApi.validateOnMount,
|
|
31
|
-
meta = _useFieldApi.meta,
|
|
32
|
-
_useFieldApi$FormFiel = _useFieldApi.FormFieldGridProps,
|
|
33
|
-
FormFieldGridProps = _useFieldApi$FormFiel === void 0 ? {} : _useFieldApi$FormFiel,
|
|
34
|
-
_useFieldApi$FormCont = _useFieldApi.FormControlProps,
|
|
35
|
-
FormControlProps = _useFieldApi$FormCont === void 0 ? {} : _useFieldApi$FormCont,
|
|
36
|
-
_useFieldApi$FormGrou = _useFieldApi.FormGroupProps,
|
|
37
|
-
FormGroupProps = _useFieldApi$FormGrou === void 0 ? {} : _useFieldApi$FormGrou,
|
|
38
|
-
_useFieldApi$FormCont2 = _useFieldApi.FormControlLabelProps,
|
|
39
|
-
FormControlLabelProps = _useFieldApi$FormCont2 === void 0 ? {} : _useFieldApi$FormCont2,
|
|
40
|
-
_useFieldApi$Checkbox = _useFieldApi.CheckboxProps,
|
|
41
|
-
CheckboxProps = _useFieldApi$Checkbox === void 0 ? {} : _useFieldApi$Checkbox,
|
|
42
|
-
_useFieldApi$FormLabe = _useFieldApi.FormLabelProps,
|
|
43
|
-
FormLabelProps = _useFieldApi$FormLabe === void 0 ? {} : _useFieldApi$FormLabe,
|
|
44
|
-
_useFieldApi$FormHelp = _useFieldApi.FormHelperTextProps,
|
|
45
|
-
FormHelperTextProps = _useFieldApi$FormHelp === void 0 ? {} : _useFieldApi$FormHelp,
|
|
46
|
-
inputProps = _useFieldApi.inputProps,
|
|
47
|
-
rest = _objectWithoutProperties(_useFieldApi, _excluded);
|
|
48
|
-
var invalid = validationError(meta, validateOnMount);
|
|
49
|
-
var text = invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description;
|
|
50
|
-
return /*#__PURE__*/React.createElement(FormFieldGrid, FormFieldGridProps, /*#__PURE__*/React.createElement(FormControl, _extends({
|
|
51
|
-
required: isRequired,
|
|
52
|
-
error: !!invalid,
|
|
53
|
-
component: "fieldset"
|
|
54
|
-
}, FormControlProps), /*#__PURE__*/React.createElement(FormGroup, FormGroupProps, /*#__PURE__*/React.createElement(FormControlLabel, _extends({}, FormControlLabelProps, {
|
|
55
|
-
control: /*#__PURE__*/React.createElement(MUICheckbox, _extends({}, input, CheckboxProps, {
|
|
56
|
-
disabled: isDisabled || isReadOnly,
|
|
57
|
-
value: input.name,
|
|
58
|
-
inputProps: _objectSpread({
|
|
59
|
-
readOnly: isReadOnly
|
|
60
|
-
}, inputProps)
|
|
61
|
-
}, rest)),
|
|
62
|
-
disabled: isDisabled || isReadOnly,
|
|
63
|
-
label: /*#__PURE__*/React.createElement(FormLabel, FormLabelProps, label)
|
|
64
|
-
})), text && /*#__PURE__*/React.createElement(FormHelperText, FormHelperTextProps, text))));
|
|
65
|
-
};
|
|
66
|
-
var Checkbox = function Checkbox(_ref) {
|
|
67
|
-
var options = _ref.options,
|
|
68
|
-
props = _objectWithoutProperties(_ref, _excluded2);
|
|
69
|
-
return options ? /*#__PURE__*/React.createElement(MultipleChoiceList, _extends({
|
|
70
|
-
options: options
|
|
71
|
-
}, props)) : /*#__PURE__*/React.createElement(SingleCheckbox, props);
|
|
18
|
+
export const SingleCheckbox = (props) => {
|
|
19
|
+
const _a = useFieldApi(Object.assign(Object.assign({}, props), { type: 'checkbox' })), { input, isReadOnly, isDisabled, isRequired, label, helperText, description, validateOnMount, meta, FormFieldGridProps = {}, FormControlProps = {}, FormGroupProps = {}, FormControlLabelProps = {}, CheckboxProps = {}, FormLabelProps = {}, FormHelperTextProps = {}, inputProps } = _a, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "FormFieldGridProps", "FormControlProps", "FormGroupProps", "FormControlLabelProps", "CheckboxProps", "FormLabelProps", "FormHelperTextProps", "inputProps"]);
|
|
20
|
+
const invalid = validationError(meta, validateOnMount);
|
|
21
|
+
const text = invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description;
|
|
22
|
+
return (_jsx(FormFieldGrid, Object.assign({}, FormFieldGridProps, { children: _jsx(FormControl, Object.assign({ required: isRequired, error: !!invalid, component: "fieldset" }, FormControlProps, { children: _jsxs(FormGroup, Object.assign({}, FormGroupProps, { children: [_jsx(FormControlLabel, Object.assign({}, FormControlLabelProps, { control: _jsx(MUICheckbox, Object.assign({}, input, CheckboxProps, { disabled: isDisabled || isReadOnly, value: input.name, inputProps: Object.assign({ readOnly: isReadOnly }, inputProps) }, rest)), disabled: isDisabled || isReadOnly, label: _jsx(FormLabel, Object.assign({}, FormLabelProps, { children: label })) })), text && _jsx(FormHelperText, Object.assign({}, FormHelperTextProps, { children: text }))] })) })) })));
|
|
72
23
|
};
|
|
73
|
-
|
|
24
|
+
function Checkbox(_a) {
|
|
25
|
+
var { options } = _a, props = __rest(_a, ["options"]);
|
|
26
|
+
return options ? _jsx(MultipleChoiceList, Object.assign({ options: options }, props)) : _jsx(SingleCheckbox, Object.assign({}, props));
|
|
27
|
+
}
|
|
28
|
+
export default Checkbox;
|
|
29
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/checkbox/checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAS7H,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAIrE,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AA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AAG,KAAK,IAAa,IACzD,EACD,IAAI,IAAI,KAAC,cAAc,oBAAK,mBAAmB,cAAG,IAAI,IAAkB,KAC/D,IACA,IACA,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,QAAQ,CAAkB,EAAuC;QAAvC,EAAE,OAAO,OAA8B,EAAzB,KAAK,cAAnB,WAAqB,CAAF;IACpD,OAAO,OAAO,CAAC,CAAC,CAAC,KAAC,kBAAkB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAI,CAAC,CAAC,CAAC,KAAC,cAAc,oBAAK,KAAK,EAAI,CAAC;AACvG,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
package/esm/checkbox/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Checkbox from '../checkbox';
|
|
2
|
+
import Select from '../select';
|
|
3
|
+
import Radio from '../radio';
|
|
4
|
+
export declare const components: {
|
|
5
|
+
readonly TextField: import("react").FC<import("../text-field").TextFieldProps>;
|
|
6
|
+
readonly Textarea: import("react").FC<import("../textarea").TextareaProps>;
|
|
7
|
+
readonly Select: typeof Select;
|
|
8
|
+
readonly Checkbox: typeof Checkbox;
|
|
9
|
+
readonly Radio: typeof Radio;
|
|
10
|
+
readonly Switch: import("react").FC<import("../switch").SwitchProps>;
|
|
11
|
+
readonly DatePicker: import("react").FC<import("../date-picker").DatePickerProps>;
|
|
12
|
+
readonly TimePicker: import("react").FC<import("../time-picker").TimePickerProps>;
|
|
13
|
+
readonly PlainText: import("react").FC<import("../plain-text").PlainTextProps>;
|
|
14
|
+
readonly SubForm: import("react").FC<import("../sub-form").SubFormProps>;
|
|
15
|
+
readonly Wizard: import("react").FC<import("@data-driven-forms/common").WizardProps>;
|
|
16
|
+
readonly DualListSelect: import("react").FC<any>;
|
|
17
|
+
readonly Slider: import("react").FC<import("../slider").SliderProps>;
|
|
18
|
+
};
|
|
19
|
+
declare const componentMapper: {
|
|
20
|
+
readonly "text-field": import("react").FC<import("../text-field").TextFieldProps>;
|
|
21
|
+
readonly textarea: import("react").FC<import("../textarea").TextareaProps>;
|
|
22
|
+
readonly select: typeof Select;
|
|
23
|
+
readonly checkbox: typeof Checkbox;
|
|
24
|
+
readonly "sub-form": import("react").FC<import("../sub-form").SubFormProps>;
|
|
25
|
+
readonly radio: typeof Radio;
|
|
26
|
+
readonly tabs: import("react").FC<import("../tabs").FormTabsProps>;
|
|
27
|
+
readonly "date-picker": import("react").FC<import("../date-picker").DatePickerProps>;
|
|
28
|
+
readonly "time-picker": import("react").FC<import("../time-picker").TimePickerProps>;
|
|
29
|
+
readonly switch: import("react").FC<import("../switch").SwitchProps>;
|
|
30
|
+
readonly "plain-text": import("react").FC<import("../plain-text").PlainTextProps>;
|
|
31
|
+
readonly wizard: import("react").FC<import("@data-driven-forms/common").WizardProps>;
|
|
32
|
+
readonly "field-array": import("react").FC<import("../field-array").DynamicArrayProps>;
|
|
33
|
+
readonly "dual-list-select": import("react").FC<any>;
|
|
34
|
+
readonly slider: import("react").FC<import("../slider").SliderProps>;
|
|
35
|
+
};
|
|
36
|
+
export default componentMapper;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
var _componentMapper;
|
|
3
|
-
import componentTypes from "@data-driven-forms/react-form-renderer/component-types";
|
|
1
|
+
import { componentTypes } from '@data-driven-forms/react-form-renderer';
|
|
4
2
|
import SubForm from '../sub-form';
|
|
5
3
|
import Tabs from '../tabs';
|
|
6
4
|
import TextField from '../text-field';
|
|
@@ -16,20 +14,37 @@ import Wizard from '../wizard';
|
|
|
16
14
|
import FieldArray from '../field-array';
|
|
17
15
|
import DualListSelect from '../dual-list-select';
|
|
18
16
|
import Slider from '../slider';
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
export const components = {
|
|
18
|
+
TextField,
|
|
19
|
+
Textarea,
|
|
20
|
+
Select,
|
|
21
|
+
Checkbox,
|
|
22
|
+
Radio,
|
|
23
|
+
Switch,
|
|
24
|
+
DatePicker,
|
|
25
|
+
TimePicker,
|
|
26
|
+
PlainText,
|
|
27
|
+
SubForm,
|
|
28
|
+
Wizard,
|
|
29
|
+
DualListSelect,
|
|
30
|
+
Slider,
|
|
33
31
|
};
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const componentMapper = {
|
|
33
|
+
[componentTypes.TEXT_FIELD]: TextField,
|
|
34
|
+
[componentTypes.TEXTAREA]: Textarea,
|
|
35
|
+
[componentTypes.SELECT]: Select,
|
|
36
|
+
[componentTypes.CHECKBOX]: Checkbox,
|
|
37
|
+
[componentTypes.SUB_FORM]: SubForm,
|
|
38
|
+
[componentTypes.RADIO]: Radio,
|
|
39
|
+
[componentTypes.TABS]: Tabs,
|
|
40
|
+
[componentTypes.DATE_PICKER]: DatePicker,
|
|
41
|
+
[componentTypes.TIME_PICKER]: TimePicker,
|
|
42
|
+
[componentTypes.SWITCH]: Switch,
|
|
43
|
+
[componentTypes.PLAIN_TEXT]: PlainText,
|
|
44
|
+
[componentTypes.WIZARD]: Wizard,
|
|
45
|
+
[componentTypes.FIELD_ARRAY]: FieldArray,
|
|
46
|
+
[componentTypes.DUAL_LIST_SELECT]: DualListSelect,
|
|
47
|
+
[componentTypes.SLIDER]: Slider,
|
|
48
|
+
};
|
|
49
|
+
export default componentMapper;
|
|
50
|
+
//# sourceMappingURL=component-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-mapper.js","sourceRoot":"","sources":["../../src/component-mapper/component-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EAAE,UAAU;IACxC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU;IACxC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM;IAC/B,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,SAAS;IACtC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM;IAC/B,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU;IACxC,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,cAAc;IACjD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM;CACvB,CAAC;AAEX,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/component-mapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DatePickerProps as MUIDatePickerProps } from '@mui/x-date-pickers';
|
|
3
|
+
import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer';
|
|
4
|
+
import type { FormFieldGridProps } from '../form-field-grid/form-field-grid';
|
|
5
|
+
export interface DatePickerProps extends BaseFieldProps {
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
FormFieldGridProps?: FormFieldGridProps;
|
|
8
|
+
DatePickerProps?: Omit<MUIDatePickerProps<Date>, 'value' | 'onChange' | 'disabled' | 'readOnly'>;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
declare const DatePicker: React.FC<DatePickerProps>;
|
|
12
|
+
export default DatePicker;
|
|
@@ -1,58 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { DatePicker as MUIDatePicker } from '@mui/x-date-pickers';
|
|
14
|
+
import { TextField } from '@mui/material';
|
|
15
|
+
import { useFieldApi } from '@data-driven-forms/react-form-renderer';
|
|
4
16
|
import FormFieldGrid from '../form-field-grid/form-field-grid';
|
|
5
17
|
import { validationError } from '../validation-error/validation-error';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var invalid = validationError(meta, validateOnMount);
|
|
25
|
-
return /*#__PURE__*/React.createElement(FormFieldGrid, FormFieldGridProps, /*#__PURE__*/React.createElement(MUIDatePicker, _extends({
|
|
26
|
-
slotProps: {
|
|
27
|
-
textField: {
|
|
28
|
-
fullWidth: true,
|
|
29
|
-
margin: 'normal',
|
|
30
|
-
label: label,
|
|
31
|
-
helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
|
|
32
|
-
placeholder: placeholder,
|
|
33
|
-
required: isRequired,
|
|
34
|
-
error: !!invalid,
|
|
35
|
-
onBlur: input.onBlur,
|
|
36
|
-
onFocus: input.onFocus
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// legacy version
|
|
40
|
-
,
|
|
41
|
-
renderInput: function renderInput(props) {
|
|
42
|
-
return /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
43
|
-
fullWidth: true,
|
|
44
|
-
margin: "normal",
|
|
45
|
-
label: label,
|
|
46
|
-
helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
|
|
47
|
-
placeholder: placeholder,
|
|
48
|
-
required: isRequired,
|
|
49
|
-
error: !!invalid
|
|
50
|
-
}));
|
|
51
|
-
},
|
|
52
|
-
disabled: isDisabled || isReadOnly,
|
|
53
|
-
readOnly: isReadOnly
|
|
54
|
-
}, input, {
|
|
55
|
-
value: input.value || null
|
|
56
|
-
}, DatePickerProps)));
|
|
18
|
+
const DatePicker = (props) => {
|
|
19
|
+
const _a = useFieldApi(props), { input, isReadOnly, isDisabled, placeholder, isRequired, label, helperText, description, validateOnMount, meta, FormFieldGridProps = {}, DatePickerProps = {} } = _a, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "FormFieldGridProps", "DatePickerProps"]);
|
|
20
|
+
const invalid = validationError(meta, validateOnMount);
|
|
21
|
+
return (_jsx(FormFieldGrid, Object.assign({}, FormFieldGridProps, { children: _jsx(MUIDatePicker, Object.assign({ slotProps: {
|
|
22
|
+
textField: {
|
|
23
|
+
fullWidth: true,
|
|
24
|
+
margin: 'normal',
|
|
25
|
+
label,
|
|
26
|
+
helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description,
|
|
27
|
+
placeholder,
|
|
28
|
+
required: isRequired,
|
|
29
|
+
error: !!invalid,
|
|
30
|
+
onBlur: input.onBlur,
|
|
31
|
+
onFocus: input.onFocus,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
// legacy version
|
|
35
|
+
renderInput: (props) => (_jsx(TextField, Object.assign({}, props, { fullWidth: true, margin: "normal", label: label, helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description, placeholder: placeholder, required: isRequired, error: !!invalid }))), disabled: isDisabled || isReadOnly, readOnly: isReadOnly }, input, { value: input.value || null }, DatePickerProps, rest)) })));
|
|
57
36
|
};
|
|
58
|
-
export default DatePicker;
|
|
37
|
+
export default DatePicker;
|
|
38
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../src/date-picker/date-picker.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAGrE,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAUvE,MAAM,UAAU,GAA8B,CAAC,KAAK,EAAE,EAAE;IACtD,MAAM,KAcF,WAAW,CAAC,KAAK,CAAC,EAdhB,EACJ,KAAK,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,IAAI,EACJ,kBAAkB,GAAG,EAAE,EACvB,eAAe,GAAG,EAAE,OAEA,EADjB,IAAI,cAbH,4KAcL,CAAqB,CAAC;IAEvB,MAAM,OAAO,GAAG,eAAe,CAAC,IAAyB,EAAE,eAAe,CAAC,CAAC;IAE5E,OAAO,CACL,KAAC,aAAa,oBAAK,kBAAkB,cACnC,KAAC,aAAa,kBACZ,SAAS,EAAE;gBACT,SAAS,EAAE;oBACT,SAAS,EAAE,IAAI;oBACf,MAAM,EAAE,QAAQ;oBAChB,KAAK;oBACL,UAAU,EAAE,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,IAAI,WAAW;oBACvG,WAAW;oBACX,QAAQ,EAAE,UAAU;oBACpB,KAAK,EAAE,CAAC,CAAC,OAAO;oBAChB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,OAAO,EAAE,KAAK,CAAC,OAAO;iBACL;aACpB;YACD,iBAAiB;YACjB,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,KAAC,SAAS,oBACJ,KAAK,IACT,SAAS,QACT,MAAM,EAAC,QAAQ,EACf,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,IAAI,WAAW,EACvG,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,CAAC,CAAC,OAAO,IAChB,CACH,EACD,QAAQ,EAAE,UAAU,IAAI,UAAU,EAClC,QAAQ,EAAE,UAAU,IAChB,KAAK,IACT,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,IACtB,eAAe,EACf,IAAI,EACR,IACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/esm/date-picker/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC"}
|