@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
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
isRequired?: boolean;
|
|
9
|
-
description?: ReactNode;
|
|
10
|
-
validateOnMount?: boolean;
|
|
11
|
-
FormFieldGridProps?: GridProps;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer';
|
|
3
|
+
export interface TextFieldProps extends BaseFieldProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
inputProps?: Record<string, any>;
|
|
6
|
+
FormFieldGridProps?: Record<string, any>;
|
|
7
|
+
[key: string]: any;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
export type TextFieldProps = InternalTextFieldProps & MuiTextFieldProps & UseFieldApiComponentConfig;
|
|
15
|
-
|
|
16
|
-
declare const TextField: React.ComponentType<TextFieldProps>;
|
|
17
|
-
|
|
9
|
+
declare const TextField: React.FC<TextFieldProps>;
|
|
18
10
|
export default TextField;
|
package/text-field/text-field.js
CHANGED
|
@@ -1,48 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
13
|
-
var _formFieldGrid = _interopRequireDefault(require("../form-field-grid/form-field-grid"));
|
|
14
|
-
var _validationError = require("../validation-error/validation-error");
|
|
15
|
-
var _useFieldApi2 = _interopRequireDefault(require("@data-driven-forms/react-form-renderer/use-field-api"));
|
|
16
|
-
var _excluded = ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "inputProps", "FormFieldGridProps"];
|
|
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
|
-
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) { (0, _defineProperty2["default"])(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
|
-
var TextField = function TextField(props) {
|
|
20
|
-
var _useFieldApi = (0, _useFieldApi2["default"])(props),
|
|
21
|
-
input = _useFieldApi.input,
|
|
22
|
-
isReadOnly = _useFieldApi.isReadOnly,
|
|
23
|
-
isDisabled = _useFieldApi.isDisabled,
|
|
24
|
-
placeholder = _useFieldApi.placeholder,
|
|
25
|
-
isRequired = _useFieldApi.isRequired,
|
|
26
|
-
label = _useFieldApi.label,
|
|
27
|
-
helperText = _useFieldApi.helperText,
|
|
28
|
-
description = _useFieldApi.description,
|
|
29
|
-
validateOnMount = _useFieldApi.validateOnMount,
|
|
30
|
-
meta = _useFieldApi.meta,
|
|
31
|
-
inputProps = _useFieldApi.inputProps,
|
|
32
|
-
FormFieldGridProps = _useFieldApi.FormFieldGridProps,
|
|
33
|
-
rest = (0, _objectWithoutProperties2["default"])(_useFieldApi, _excluded);
|
|
34
|
-
var invalid = (0, _validationError.validationError)(meta, validateOnMount);
|
|
35
|
-
return /*#__PURE__*/_react["default"].createElement(_formFieldGrid["default"], FormFieldGridProps, /*#__PURE__*/_react["default"].createElement(_TextField["default"], (0, _extends2["default"])({}, input, {
|
|
36
|
-
fullWidth: true,
|
|
37
|
-
error: !!invalid,
|
|
38
|
-
helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
|
|
39
|
-
disabled: isDisabled,
|
|
40
|
-
label: label,
|
|
41
|
-
placeholder: placeholder,
|
|
42
|
-
required: isRequired,
|
|
43
|
-
inputProps: _objectSpread({
|
|
44
|
-
readOnly: isReadOnly
|
|
45
|
-
}, inputProps)
|
|
46
|
-
}, rest)));
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
47
12
|
};
|
|
48
|
-
var
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var material_1 = require("@mui/material");
|
|
30
|
+
var react_form_renderer_1 = require("@data-driven-forms/react-form-renderer");
|
|
31
|
+
var form_field_grid_1 = __importDefault(require("../form-field-grid/form-field-grid"));
|
|
32
|
+
var validation_error_1 = require("../validation-error/validation-error");
|
|
33
|
+
var TextField = function (props) {
|
|
34
|
+
var _a = (0, react_form_renderer_1.useFieldApi)(props), input = _a.input, isReadOnly = _a.isReadOnly, isDisabled = _a.isDisabled, placeholder = _a.placeholder, isRequired = _a.isRequired, label = _a.label, helperText = _a.helperText, description = _a.description, validateOnMount = _a.validateOnMount, meta = _a.meta, inputProps = _a.inputProps, FormFieldGridProps = _a.FormFieldGridProps, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "inputProps", "FormFieldGridProps"]);
|
|
35
|
+
var invalid = (0, validation_error_1.validationError)(meta, validateOnMount);
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(form_field_grid_1.default, __assign({}, FormFieldGridProps, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, input, { fullWidth: true, error: !!invalid, helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description, disabled: isDisabled, label: label, placeholder: placeholder, required: isRequired, inputProps: __assign({ readOnly: isReadOnly }, inputProps) }, rest)) })));
|
|
37
|
+
};
|
|
38
|
+
exports.default = TextField;
|
|
39
|
+
//# sourceMappingURL=text-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../src/text-field/text-field.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA0D;AAC1D,8EAAqE;AAGrE,uFAA+D;AAC/D,yEAAuE;AAWvE,IAAM,SAAS,GAA6B,UAAC,KAAK;IAChD,IAAM,KAcF,IAAA,iCAAW,EAAC,KAAK,CAAC,EAbpB,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,eAAe,qBAAA,EACf,IAAI,UAAA,EACJ,UAAU,gBAAA,EACV,kBAAkB,wBAAA,EACf,IAAI,cAbH,uKAcL,CAAqB,CAAC;IACvB,IAAM,OAAO,GAAG,IAAA,kCAAe,EAAC,IAAyB,EAAE,eAAe,CAAC,CAAC;IAE5E,OAAO,CACL,uBAAC,yBAAa,eAAK,kBAAkB,cACnC,uBAAC,oBAAY,eACP,KAAK,IACT,SAAS,QACT,KAAK,EAAE,CAAC,CAAC,OAAO,EAChB,UAAU,EAAE,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,IAAI,WAAW,EACvG,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,UAAU,EACpB,UAAU,aACR,QAAQ,EAAE,UAAU,IACjB,UAAU,KAEX,IAAI,EACR,IACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
package/textarea/index.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _exportNames = {};
|
|
8
|
-
Object.defineProperty(exports, "default", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _textarea["default"];
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var _textarea = _interopRequireWildcard(require("./textarea"));
|
|
15
|
-
Object.keys(_textarea).forEach(function (key) {
|
|
16
|
-
if (key === "default" || key === "__esModule") return;
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
-
if (key in exports && exports[key] === _textarea[key]) return;
|
|
19
|
-
Object.defineProperty(exports, key, {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _textarea[key];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
7
|
}
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.default = void 0;
|
|
21
|
+
var textarea_1 = require("./textarea");
|
|
22
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(textarea_1).default; } });
|
|
23
|
+
__exportStar(require("./textarea"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/textarea/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,uCAAqC;AAA5B,oHAAA,OAAO,OAAA;AAChB,6CAA2B"}
|
package/textarea/textarea.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TextFieldProps
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
FormFieldGridProps?: GridProps;
|
|
12
|
-
inputProps?: InputProps;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
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 TextareaProps extends BaseFieldProps {
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
inputProps?: Record<string, any>;
|
|
8
|
+
FormFieldGridProps?: FormFieldGridProps;
|
|
9
|
+
TextFieldProps?: Omit<MuiTextFieldProps, 'name' | 'value' | 'onChange' | 'onBlur' | 'onFocus'>;
|
|
10
|
+
[key: string]: any;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
export type TextareaProps = InternalTextareaProps & TextFieldProps & UseFieldApiComponentConfig;
|
|
16
|
-
|
|
17
|
-
declare const Textarea: React.ComponentType<TextareaProps>;
|
|
18
|
-
|
|
12
|
+
declare const Textarea: React.FC<TextareaProps>;
|
|
19
13
|
export default Textarea;
|
package/textarea/textarea.js
CHANGED
|
@@ -1,52 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
13
|
-
var _formFieldGrid = _interopRequireDefault(require("../form-field-grid/form-field-grid"));
|
|
14
|
-
var _validationError = require("../validation-error/validation-error");
|
|
15
|
-
var _useFieldApi2 = _interopRequireDefault(require("@data-driven-forms/react-form-renderer/use-field-api"));
|
|
16
|
-
var _excluded = ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "FormFieldGridProps", "inputProps"];
|
|
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
|
-
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) { (0, _defineProperty2["default"])(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
|
-
var Textarea = function Textarea(props) {
|
|
20
|
-
var _useFieldApi = (0, _useFieldApi2["default"])(props),
|
|
21
|
-
input = _useFieldApi.input,
|
|
22
|
-
isReadOnly = _useFieldApi.isReadOnly,
|
|
23
|
-
isDisabled = _useFieldApi.isDisabled,
|
|
24
|
-
placeholder = _useFieldApi.placeholder,
|
|
25
|
-
isRequired = _useFieldApi.isRequired,
|
|
26
|
-
label = _useFieldApi.label,
|
|
27
|
-
helperText = _useFieldApi.helperText,
|
|
28
|
-
description = _useFieldApi.description,
|
|
29
|
-
validateOnMount = _useFieldApi.validateOnMount,
|
|
30
|
-
meta = _useFieldApi.meta,
|
|
31
|
-
_useFieldApi$FormFiel = _useFieldApi.FormFieldGridProps,
|
|
32
|
-
FormFieldGridProps = _useFieldApi$FormFiel === void 0 ? {} : _useFieldApi$FormFiel,
|
|
33
|
-
_useFieldApi$inputPro = _useFieldApi.inputProps,
|
|
34
|
-
inputProps = _useFieldApi$inputPro === void 0 ? {} : _useFieldApi$inputPro,
|
|
35
|
-
rest = (0, _objectWithoutProperties2["default"])(_useFieldApi, _excluded);
|
|
36
|
-
var invalid = (0, _validationError.validationError)(meta, validateOnMount);
|
|
37
|
-
return /*#__PURE__*/_react["default"].createElement(_formFieldGrid["default"], FormFieldGridProps, /*#__PURE__*/_react["default"].createElement(_TextField["default"], (0, _extends2["default"])({}, input, {
|
|
38
|
-
fullWidth: true,
|
|
39
|
-
error: !!invalid,
|
|
40
|
-
helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
|
|
41
|
-
disabled: isDisabled,
|
|
42
|
-
label: label,
|
|
43
|
-
placeholder: placeholder,
|
|
44
|
-
required: isRequired,
|
|
45
|
-
inputProps: _objectSpread({
|
|
46
|
-
readOnly: isReadOnly
|
|
47
|
-
}, inputProps)
|
|
48
|
-
}, rest, {
|
|
49
|
-
multiline: true
|
|
50
|
-
})));
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
51
12
|
};
|
|
52
|
-
var
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var material_1 = require("@mui/material");
|
|
30
|
+
var react_form_renderer_1 = require("@data-driven-forms/react-form-renderer");
|
|
31
|
+
var form_field_grid_1 = __importDefault(require("../form-field-grid/form-field-grid"));
|
|
32
|
+
var validation_error_1 = require("../validation-error/validation-error");
|
|
33
|
+
var Textarea = function (props) {
|
|
34
|
+
var _a = (0, react_form_renderer_1.useFieldApi)(props), input = _a.input, isReadOnly = _a.isReadOnly, isDisabled = _a.isDisabled, placeholder = _a.placeholder, isRequired = _a.isRequired, label = _a.label, helperText = _a.helperText, description = _a.description, validateOnMount = _a.validateOnMount, meta = _a.meta, _b = _a.FormFieldGridProps, FormFieldGridProps = _b === void 0 ? {} : _b, _c = _a.inputProps, inputProps = _c === void 0 ? {} : _c, _d = _a.TextFieldProps, TextFieldProps = _d === void 0 ? {} : _d, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "FormFieldGridProps", "inputProps", "TextFieldProps"]);
|
|
35
|
+
var invalid = (0, validation_error_1.validationError)(meta, validateOnMount);
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(form_field_grid_1.default, __assign({}, FormFieldGridProps, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, input, { fullWidth: true, error: !!invalid, helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description, disabled: isDisabled, label: label, placeholder: placeholder, required: isRequired, inputProps: __assign({ readOnly: isReadOnly }, inputProps) }, TextFieldProps, rest, { multiline: true })) })));
|
|
37
|
+
};
|
|
38
|
+
exports.default = Textarea;
|
|
39
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../src/textarea/textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA0D;AAE1D,8EAAqE;AAGrE,uFAA+D;AAE/D,yEAAuE;AAWvE,IAAM,QAAQ,GAA4B,UAAC,KAAK;IAC9C,IAAM,KAeF,IAAA,iCAAW,EAAC,KAAK,CAAC,EAdpB,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,eAAe,qBAAA,EACf,IAAI,UAAA,EACJ,0BAAuB,EAAvB,kBAAkB,mBAAG,EAAE,KAAA,EACvB,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EACf,sBAAmB,EAAnB,cAAc,mBAAG,EAAE,KAAA,EAChB,IAAI,cAdH,yLAeL,CAAqB,CAAC;IAEvB,IAAM,OAAO,GAAG,IAAA,kCAAe,EAAC,IAAyB,EAAE,eAAe,CAAC,CAAC;IAE5E,OAAO,CACL,uBAAC,yBAAa,eAAK,kBAAkB,cACnC,uBAAC,oBAAY,eACP,KAAK,IACT,SAAS,QACT,KAAK,EAAE,CAAC,CAAC,OAAO,EAChB,UAAU,EAAE,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,IAAI,WAAW,EACvG,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,UAAU,EACpB,UAAU,aACR,QAAQ,EAAE,UAAU,IACjB,UAAU,KAEX,cAAc,EACd,IAAI,IACR,SAAS,UACT,IACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
package/time-picker/index.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _exportNames = {};
|
|
8
|
-
Object.defineProperty(exports, "default", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _timePicker["default"];
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var _timePicker = _interopRequireWildcard(require("./time-picker"));
|
|
15
|
-
Object.keys(_timePicker).forEach(function (key) {
|
|
16
|
-
if (key === "default" || key === "__esModule") return;
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
-
if (key in exports && exports[key] === _timePicker[key]) return;
|
|
19
|
-
Object.defineProperty(exports, key, {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _timePicker[key];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
7
|
}
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.default = void 0;
|
|
21
|
+
var time_picker_1 = require("./time-picker");
|
|
22
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(time_picker_1).default; } });
|
|
23
|
+
__exportStar(require("./time-picker"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/time-picker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAA/B,uHAAA,OAAO,OAAA;AAChB,gDAA8B"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TimePickerProps as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
FormFieldGridProps?: GridProps;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TimePickerProps as MUITimePickerProps } 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 TimePickerProps extends BaseFieldProps {
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
FormFieldGridProps?: FormFieldGridProps;
|
|
8
|
+
TimePickerProps?: Omit<MUITimePickerProps<Date>, 'value' | 'onChange' | 'disabled' | 'readOnly'>;
|
|
9
|
+
MuiPickersUtilsProviderProps?: any;
|
|
10
|
+
[key: string]: any;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
export type TimePickerProps = InternalTimePickerProps & UseFieldApiComponentConfig;
|
|
15
|
-
|
|
16
|
-
declare const TimePicker: React.ComponentType<TimePickerProps>;
|
|
17
|
-
|
|
12
|
+
declare const TimePicker: React.FC<TimePickerProps>;
|
|
18
13
|
export default TimePicker;
|
|
@@ -1,67 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _formFieldGrid = _interopRequireDefault(require("../form-field-grid/form-field-grid"));
|
|
13
|
-
var _validationError = require("../validation-error/validation-error");
|
|
14
|
-
var _useFieldApi2 = _interopRequireDefault(require("@data-driven-forms/react-form-renderer/use-field-api"));
|
|
15
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
16
|
-
var _excluded = ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "MuiPickersUtilsProviderProps", "FormFieldGridProps"];
|
|
17
|
-
var TimePicker = function TimePicker(props) {
|
|
18
|
-
var _useFieldApi = (0, _useFieldApi2["default"])(props),
|
|
19
|
-
input = _useFieldApi.input,
|
|
20
|
-
isReadOnly = _useFieldApi.isReadOnly,
|
|
21
|
-
isDisabled = _useFieldApi.isDisabled,
|
|
22
|
-
placeholder = _useFieldApi.placeholder,
|
|
23
|
-
isRequired = _useFieldApi.isRequired,
|
|
24
|
-
label = _useFieldApi.label,
|
|
25
|
-
helperText = _useFieldApi.helperText,
|
|
26
|
-
description = _useFieldApi.description,
|
|
27
|
-
validateOnMount = _useFieldApi.validateOnMount,
|
|
28
|
-
meta = _useFieldApi.meta,
|
|
29
|
-
MuiPickersUtilsProviderProps = _useFieldApi.MuiPickersUtilsProviderProps,
|
|
30
|
-
_useFieldApi$FormFiel = _useFieldApi.FormFieldGridProps,
|
|
31
|
-
FormFieldGridProps = _useFieldApi$FormFiel === void 0 ? {} : _useFieldApi$FormFiel,
|
|
32
|
-
rest = (0, _objectWithoutProperties2["default"])(_useFieldApi, _excluded);
|
|
33
|
-
var invalid = (0, _validationError.validationError)(meta, validateOnMount);
|
|
34
|
-
return /*#__PURE__*/_react["default"].createElement(_formFieldGrid["default"], FormFieldGridProps, /*#__PURE__*/_react["default"].createElement(_TimePicker.TimePicker, (0, _extends2["default"])({
|
|
35
|
-
slotProps: {
|
|
36
|
-
textField: {
|
|
37
|
-
fullWidth: true,
|
|
38
|
-
margin: 'normal',
|
|
39
|
-
label: label,
|
|
40
|
-
helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
|
|
41
|
-
placeholder: placeholder,
|
|
42
|
-
required: isRequired,
|
|
43
|
-
error: !!invalid,
|
|
44
|
-
onBlur: input.onBlur,
|
|
45
|
-
onFocus: input.onFocus
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
// legacy version
|
|
49
|
-
,
|
|
50
|
-
renderInput: function renderInput(props) {
|
|
51
|
-
return /*#__PURE__*/_react["default"].createElement(_TextField["default"], (0, _extends2["default"])({}, props, {
|
|
52
|
-
fullWidth: true,
|
|
53
|
-
margin: "normal",
|
|
54
|
-
label: label,
|
|
55
|
-
helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
|
|
56
|
-
placeholder: placeholder,
|
|
57
|
-
required: isRequired,
|
|
58
|
-
error: !!invalid
|
|
59
|
-
}));
|
|
60
|
-
},
|
|
61
|
-
readOnly: isReadOnly,
|
|
62
|
-
disabled: isDisabled || isReadOnly
|
|
63
|
-
}, input, {
|
|
64
|
-
value: input.value || null
|
|
65
|
-
}, rest)));
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
66
12
|
};
|
|
67
|
-
var
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var x_date_pickers_1 = require("@mui/x-date-pickers");
|
|
30
|
+
var material_1 = require("@mui/material");
|
|
31
|
+
var react_form_renderer_1 = require("@data-driven-forms/react-form-renderer");
|
|
32
|
+
var form_field_grid_1 = __importDefault(require("../form-field-grid/form-field-grid"));
|
|
33
|
+
var validation_error_1 = require("../validation-error/validation-error");
|
|
34
|
+
var TimePicker = function (props) {
|
|
35
|
+
var _a = (0, react_form_renderer_1.useFieldApi)(props), input = _a.input, isReadOnly = _a.isReadOnly, isDisabled = _a.isDisabled, placeholder = _a.placeholder, isRequired = _a.isRequired, label = _a.label, helperText = _a.helperText, description = _a.description, validateOnMount = _a.validateOnMount, meta = _a.meta, MuiPickersUtilsProviderProps = _a.MuiPickersUtilsProviderProps, _b = _a.FormFieldGridProps, FormFieldGridProps = _b === void 0 ? {} : _b, _c = _a.TimePickerProps, TimePickerProps = _c === void 0 ? {} : _c, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "MuiPickersUtilsProviderProps", "FormFieldGridProps", "TimePickerProps"]);
|
|
36
|
+
var invalid = (0, validation_error_1.validationError)(meta, validateOnMount);
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(form_field_grid_1.default, __assign({}, FormFieldGridProps, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.TimePicker, __assign({ slotProps: {
|
|
38
|
+
textField: {
|
|
39
|
+
fullWidth: true,
|
|
40
|
+
margin: 'normal',
|
|
41
|
+
label: label,
|
|
42
|
+
helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description,
|
|
43
|
+
placeholder: placeholder,
|
|
44
|
+
required: isRequired,
|
|
45
|
+
error: !!invalid,
|
|
46
|
+
onBlur: input.onBlur,
|
|
47
|
+
onFocus: input.onFocus,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
// legacy version
|
|
51
|
+
renderInput: function (props) { return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, props, { fullWidth: true, margin: "normal", label: label, helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description, placeholder: placeholder, required: isRequired, error: !!invalid }))); }, readOnly: isReadOnly, disabled: isDisabled || isReadOnly }, input, { value: input.value || null }, TimePickerProps, rest)) })));
|
|
52
|
+
};
|
|
53
|
+
exports.default = TimePicker;
|
|
54
|
+
//# sourceMappingURL=time-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-picker.js","sourceRoot":"","sources":["../src/time-picker/time-picker.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sDAAkE;AAElE,0CAA0C;AAE1C,8EAAqE;AAGrE,uFAA+D;AAE/D,yEAAuE;AAWvE,IAAM,UAAU,GAA8B,UAAC,KAAK;IAClD,IAAM,KAeF,IAAA,iCAAW,EAAC,KAAK,CAAC,EAdpB,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,eAAe,qBAAA,EACf,IAAI,UAAA,EACJ,4BAA4B,kCAAA,EAC5B,0BAAuB,EAAvB,kBAAkB,mBAAG,EAAE,KAAA,EACvB,uBAAoB,EAApB,eAAe,mBAAG,EAAE,KAAA,EACjB,IAAI,cAdH,4MAeL,CAAqB,CAAC;IAEvB,IAAM,OAAO,GAAG,IAAA,kCAAe,EAAC,IAAyB,EAAE,eAAe,CAAC,CAAC;IAE5E,OAAO,CACL,uBAAC,yBAAa,eAAK,kBAAkB,cACnC,uBAAC,2BAAa,aACZ,SAAS,EAAE;gBACT,SAAS,EAAE;oBACT,SAAS,EAAE,IAAI;oBACf,MAAM,EAAE,QAAQ;oBAChB,KAAK,OAAA;oBACL,UAAU,EAAE,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,IAAI,WAAW;oBACvG,WAAW,aAAA;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,UAAC,KAAK,IAAK,OAAA,CACtB,uBAAC,oBAAS,eACJ,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,EAXuB,CAWvB,EACD,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,IAAI,UAAU,IAC9B,KAAK,IACT,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,IACtB,eAAe,EACf,IAAI,EACR,IACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"sourceMap": true,
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"target": "es5",
|
|
7
|
+
"lib": ["es6", "dom"],
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"noErrorTruncation": true,
|
|
11
|
+
"allowJs": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"strict": false,
|
|
15
|
+
"noEmit": false,
|
|
16
|
+
"isolatedModules": false,
|
|
17
|
+
"forceConsistentCasingInFileNames": true,
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"noImplicitAny": false,
|
|
20
|
+
"noImplicitReturns": false,
|
|
21
|
+
"noImplicitThis": false,
|
|
22
|
+
"rootDir": "."
|
|
23
|
+
},
|
|
24
|
+
"include": [
|
|
25
|
+
"./demo/**/*",
|
|
26
|
+
"./src/**/*"
|
|
27
|
+
],
|
|
28
|
+
"exclude": [
|
|
29
|
+
"node_modules"
|
|
30
|
+
]
|
|
31
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"sourceMap": true,
|
|
4
|
-
"module": "
|
|
4
|
+
"module": "esnext",
|
|
5
5
|
"moduleResolution": "node",
|
|
6
6
|
"target": "es5",
|
|
7
|
-
"lib": ["
|
|
8
|
-
"jsx": "
|
|
7
|
+
"lib": ["es6", "dom"],
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
9
|
"allowSyntheticDefaultImports": true,
|
|
10
10
|
"noErrorTruncation": true,
|
|
11
|
-
"allowJs":
|
|
12
|
-
"strict":
|
|
13
|
-
"
|
|
11
|
+
"allowJs": false,
|
|
12
|
+
"strict": false,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"emitDeclarationOnly": false,
|
|
15
|
+
"outDir": "./dist",
|
|
16
|
+
"rootDir": "./src",
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"esModuleInterop": true,
|
|
19
|
+
"noImplicitAny": false,
|
|
20
|
+
"noImplicitReturns": false,
|
|
21
|
+
"noImplicitThis": false,
|
|
14
22
|
},
|
|
15
|
-
"include": ["./src/**/*.ts", "./src/**/*.tsx"
|
|
16
|
-
"exclude": ["./dist"]
|
|
17
|
-
}
|
|
23
|
+
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
|
|
24
|
+
"exclude": ["./dist", "./src/tests/**/*", "./node_modules", "../*/node_modules", "../../node_modules"]
|
|
25
|
+
}
|