@data-driven-forms/mui-component-mapper 4.1.13 → 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.
Files changed (245) hide show
  1. package/.eslintrc.json +27 -0
  2. package/CHANGELOG.md +11 -3
  3. package/checkbox/checkbox.d.ts +29 -16
  4. package/checkbox/checkbox.js +44 -77
  5. package/checkbox/checkbox.js.map +1 -0
  6. package/checkbox/index.js +22 -24
  7. package/checkbox/index.js.map +1 -0
  8. package/component-mapper/component-mapper.d.ts +35 -40
  9. package/component-mapper/component-mapper.js +55 -40
  10. package/component-mapper/component-mapper.js.map +1 -0
  11. package/component-mapper/index.js +22 -24
  12. package/component-mapper/index.js.map +1 -0
  13. package/date-picker/date-picker.d.ts +10 -10
  14. package/date-picker/date-picker.js +52 -63
  15. package/date-picker/date-picker.js.map +1 -0
  16. package/date-picker/index.js +22 -24
  17. package/date-picker/index.js.map +1 -0
  18. package/dual-list-select/dual-list-select.d.ts +3 -111
  19. package/dual-list-select/dual-list-select.js +93 -412
  20. package/dual-list-select/dual-list-select.js.map +1 -0
  21. package/dual-list-select/index.js +22 -24
  22. package/dual-list-select/index.js.map +1 -0
  23. package/esm/checkbox/checkbox.d.ts +31 -0
  24. package/esm/checkbox/checkbox.js +25 -69
  25. package/esm/checkbox/checkbox.js.map +1 -0
  26. package/esm/checkbox/index.d.ts +2 -0
  27. package/esm/checkbox/index.js +2 -1
  28. package/esm/checkbox/index.js.map +1 -0
  29. package/esm/component-mapper/component-mapper.d.ts +36 -0
  30. package/esm/component-mapper/component-mapper.js +34 -19
  31. package/esm/component-mapper/component-mapper.js.map +1 -0
  32. package/esm/component-mapper/index.d.ts +2 -0
  33. package/esm/component-mapper/index.js +2 -1
  34. package/esm/component-mapper/index.js.map +1 -0
  35. package/esm/date-picker/date-picker.d.ts +12 -0
  36. package/esm/date-picker/date-picker.js +35 -55
  37. package/esm/date-picker/date-picker.js.map +1 -0
  38. package/esm/date-picker/index.d.ts +2 -0
  39. package/esm/date-picker/index.js +2 -1
  40. package/esm/date-picker/index.js.map +1 -0
  41. package/esm/dual-list-select/dual-list-select.d.ts +3 -0
  42. package/esm/dual-list-select/dual-list-select.js +59 -404
  43. package/esm/dual-list-select/dual-list-select.js.map +1 -0
  44. package/esm/dual-list-select/index.d.ts +2 -0
  45. package/esm/dual-list-select/index.js +2 -1
  46. package/esm/dual-list-select/index.js.map +1 -0
  47. package/esm/field-array/field-array.d.ts +56 -0
  48. package/esm/field-array/field-array.js +107 -296
  49. package/esm/field-array/field-array.js.map +1 -0
  50. package/esm/field-array/index.d.ts +2 -0
  51. package/esm/field-array/index.js +2 -1
  52. package/esm/field-array/index.js.map +1 -0
  53. package/esm/form-field-grid/form-field-grid.d.ts +8 -0
  54. package/esm/form-field-grid/form-field-grid.js +26 -22
  55. package/esm/form-field-grid/form-field-grid.js.map +1 -0
  56. package/esm/form-field-grid/index.d.ts +2 -0
  57. package/esm/form-field-grid/index.js +3 -1
  58. package/esm/form-field-grid/index.js.map +1 -0
  59. package/esm/form-template/form-template.d.ts +17 -0
  60. package/esm/form-template/form-template.js +57 -126
  61. package/esm/form-template/form-template.js.map +1 -0
  62. package/esm/form-template/index.d.ts +2 -0
  63. package/esm/form-template/index.js +2 -1
  64. package/esm/form-template/index.js.map +1 -0
  65. package/esm/index.d.ts +21 -0
  66. package/esm/index.js +3 -2
  67. package/esm/index.js.map +1 -0
  68. package/esm/multiple-choice-list/index.d.ts +2 -0
  69. package/esm/multiple-choice-list/index.js +2 -1
  70. package/esm/multiple-choice-list/index.js.map +1 -0
  71. package/esm/multiple-choice-list/multiple-choice-list.d.ts +14 -0
  72. package/esm/multiple-choice-list/multiple-choice-list.js +39 -93
  73. package/esm/multiple-choice-list/multiple-choice-list.js.map +1 -0
  74. package/esm/plain-text/index.d.ts +2 -0
  75. package/esm/plain-text/index.js +2 -1
  76. package/esm/plain-text/index.js.map +1 -0
  77. package/esm/plain-text/plain-text.d.ts +12 -0
  78. package/esm/plain-text/plain-text.js +18 -27
  79. package/esm/plain-text/plain-text.js.map +1 -0
  80. package/esm/radio/index.d.ts +2 -0
  81. package/esm/radio/index.js +2 -1
  82. package/esm/radio/index.js.map +1 -0
  83. package/esm/radio/radio.d.ts +19 -0
  84. package/esm/radio/radio.js +38 -110
  85. package/esm/radio/radio.js.map +1 -0
  86. package/esm/select/index.d.ts +2 -0
  87. package/esm/select/index.js +2 -1
  88. package/esm/select/index.js.map +1 -0
  89. package/esm/select/select.d.ts +44 -0
  90. package/esm/select/select.js +55 -162
  91. package/esm/select/select.js.map +1 -0
  92. package/esm/slider/index.d.ts +2 -0
  93. package/esm/slider/index.js +2 -1
  94. package/esm/slider/index.js.map +1 -0
  95. package/esm/slider/slider.d.ts +24 -0
  96. package/esm/slider/slider.js +22 -63
  97. package/esm/slider/slider.js.map +1 -0
  98. package/esm/sub-form/index.d.ts +2 -0
  99. package/esm/sub-form/index.js +2 -1
  100. package/esm/sub-form/index.js.map +1 -0
  101. package/esm/sub-form/sub-form.d.ts +16 -0
  102. package/esm/sub-form/sub-form.js +29 -52
  103. package/esm/sub-form/sub-form.js.map +1 -0
  104. package/esm/switch/index.d.ts +2 -0
  105. package/esm/switch/index.js +2 -1
  106. package/esm/switch/index.js.map +1 -0
  107. package/esm/switch/switch.d.ts +18 -0
  108. package/esm/switch/switch.js +21 -62
  109. package/esm/switch/switch.js.map +1 -0
  110. package/esm/tabs/index.d.ts +2 -0
  111. package/esm/tabs/index.js +2 -1
  112. package/esm/tabs/index.js.map +1 -0
  113. package/esm/tabs/tabs.d.ts +19 -0
  114. package/esm/tabs/tabs.js +9 -73
  115. package/esm/tabs/tabs.js.map +1 -0
  116. package/esm/text-field/index.d.ts +2 -0
  117. package/esm/text-field/index.js +2 -1
  118. package/esm/text-field/index.js.map +1 -0
  119. package/esm/text-field/text-field.d.ts +10 -0
  120. package/esm/text-field/text-field.js +20 -38
  121. package/esm/text-field/text-field.js.map +1 -0
  122. package/esm/textarea/index.d.ts +2 -0
  123. package/esm/textarea/index.js +2 -1
  124. package/esm/textarea/index.js.map +1 -0
  125. package/esm/textarea/textarea.d.ts +13 -0
  126. package/esm/textarea/textarea.js +20 -42
  127. package/esm/textarea/textarea.js.map +1 -0
  128. package/esm/time-picker/index.d.ts +2 -0
  129. package/esm/time-picker/index.js +2 -1
  130. package/esm/time-picker/index.js.map +1 -0
  131. package/esm/time-picker/time-picker.d.ts +13 -0
  132. package/esm/time-picker/time-picker.js +35 -57
  133. package/esm/time-picker/time-picker.js.map +1 -0
  134. package/esm/validation-error/index.d.ts +2 -0
  135. package/esm/validation-error/index.js +2 -1
  136. package/esm/validation-error/index.js.map +1 -0
  137. package/esm/validation-error/validation-error.d.ts +6 -0
  138. package/esm/validation-error/validation-error.js +7 -6
  139. package/esm/validation-error/validation-error.js.map +1 -0
  140. package/esm/wizard/index.d.ts +2 -0
  141. package/esm/wizard/index.js +2 -1
  142. package/esm/wizard/index.js.map +1 -0
  143. package/esm/wizard/step-buttons.d.ts +33 -0
  144. package/esm/wizard/step-buttons.js +49 -104
  145. package/esm/wizard/step-buttons.js.map +1 -0
  146. package/esm/wizard/wizard-nav.d.ts +15 -0
  147. package/esm/wizard/wizard-nav.js +15 -33
  148. package/esm/wizard/wizard-nav.js.map +1 -0
  149. package/esm/wizard/wizard.d.ts +4 -0
  150. package/esm/wizard/wizard.js +21 -70
  151. package/esm/wizard/wizard.js.map +1 -0
  152. package/field-array/field-array.d.ts +54 -38
  153. package/field-array/field-array.js +138 -306
  154. package/field-array/field-array.js.map +1 -0
  155. package/field-array/index.js +22 -24
  156. package/field-array/index.js.map +1 -0
  157. package/form-field-grid/form-field-grid.d.ts +7 -5
  158. package/form-field-grid/form-field-grid.js +42 -28
  159. package/form-field-grid/form-field-grid.js.map +1 -0
  160. package/form-field-grid/index.js +23 -12
  161. package/form-field-grid/index.js.map +1 -0
  162. package/form-template/form-template.d.ts +17 -5
  163. package/form-template/form-template.js +78 -132
  164. package/form-template/form-template.js.map +1 -0
  165. package/form-template/index.js +22 -24
  166. package/form-template/index.js.map +1 -0
  167. package/index.d.ts +10 -29
  168. package/index.js +45 -146
  169. package/index.js.map +1 -0
  170. package/multiple-choice-list/index.js +22 -24
  171. package/multiple-choice-list/index.js.map +1 -0
  172. package/multiple-choice-list/multiple-choice-list.d.ts +12 -24
  173. package/multiple-choice-list/multiple-choice-list.js +53 -101
  174. package/multiple-choice-list/multiple-choice-list.js.map +1 -0
  175. package/package.json +8 -10
  176. package/plain-text/index.js +22 -24
  177. package/plain-text/index.js.map +1 -0
  178. package/plain-text/plain-text.d.ts +10 -10
  179. package/plain-text/plain-text.js +30 -33
  180. package/plain-text/plain-text.js.map +1 -0
  181. package/radio/index.js +22 -24
  182. package/radio/index.js.map +1 -0
  183. package/radio/radio.d.ts +17 -25
  184. package/radio/radio.js +56 -116
  185. package/radio/radio.js.map +1 -0
  186. package/select/index.js +22 -24
  187. package/select/index.js.map +1 -0
  188. package/select/select.d.ts +42 -27
  189. package/select/select.js +78 -172
  190. package/select/select.js.map +1 -0
  191. package/slider/index.js +22 -24
  192. package/slider/index.js.map +1 -0
  193. package/slider/slider.d.ts +22 -28
  194. package/slider/slider.js +39 -71
  195. package/slider/slider.js.map +1 -0
  196. package/sub-form/index.js +22 -24
  197. package/sub-form/index.js.map +1 -0
  198. package/sub-form/sub-form.d.ts +14 -16
  199. package/sub-form/sub-form.js +42 -56
  200. package/sub-form/sub-form.js.map +1 -0
  201. package/switch/index.js +22 -24
  202. package/switch/index.js.map +1 -0
  203. package/switch/switch.d.ts +16 -26
  204. package/switch/switch.js +43 -70
  205. package/switch/switch.js.map +1 -0
  206. package/tabs/index.js +22 -24
  207. package/tabs/index.js.map +1 -0
  208. package/tabs/tabs.d.ts +18 -14
  209. package/tabs/tabs.js +33 -82
  210. package/tabs/tabs.js.map +1 -0
  211. package/text-field/index.js +22 -24
  212. package/text-field/index.js.map +1 -0
  213. package/text-field/text-field.d.ts +8 -16
  214. package/text-field/text-field.js +37 -46
  215. package/text-field/text-field.js.map +1 -0
  216. package/textarea/index.js +22 -24
  217. package/textarea/index.js.map +1 -0
  218. package/textarea/textarea.d.ts +11 -17
  219. package/textarea/textarea.js +37 -50
  220. package/textarea/textarea.js.map +1 -0
  221. package/time-picker/index.js +22 -24
  222. package/time-picker/index.js.map +1 -0
  223. package/time-picker/time-picker.d.ts +11 -16
  224. package/time-picker/time-picker.js +52 -65
  225. package/time-picker/time-picker.js.map +1 -0
  226. package/tsconfig.cjs.json +8 -0
  227. package/tsconfig.demo.json +31 -0
  228. package/tsconfig.esm.json +8 -0
  229. package/tsconfig.json +17 -9
  230. package/validation-error/index.js +22 -24
  231. package/validation-error/index.js.map +1 -0
  232. package/validation-error/validation-error.d.ts +5 -4
  233. package/validation-error/validation-error.js +10 -11
  234. package/validation-error/validation-error.js.map +1 -0
  235. package/wizard/index.js +22 -24
  236. package/wizard/index.js.map +1 -0
  237. package/wizard/step-buttons.d.ts +33 -0
  238. package/wizard/step-buttons.js +68 -110
  239. package/wizard/step-buttons.js.map +1 -0
  240. package/wizard/wizard-nav.d.ts +15 -0
  241. package/wizard/wizard-nav.js +37 -37
  242. package/wizard/wizard-nav.js.map +1 -0
  243. package/wizard/wizard.d.ts +4 -28
  244. package/wizard/wizard.js +41 -79
  245. package/wizard/wizard.js.map +1 -0
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { TypographyProps, GridProps } from '@mui/material';
3
+ import type { Field } from '@data-driven-forms/react-form-renderer';
4
+ export interface SubFormProps extends Omit<GridProps, 'component' | 'title'> {
5
+ fields: Field[];
6
+ title?: React.ReactNode;
7
+ description?: React.ReactNode;
8
+ component?: string;
9
+ TitleGridProps?: GridProps;
10
+ TitleProps?: TypographyProps;
11
+ DescriptionProps?: TypographyProps;
12
+ DescriptionGridProps?: GridProps;
13
+ ItemsGridProps?: GridProps;
14
+ }
15
+ declare const SubForm: React.FC<SubFormProps>;
16
+ export default SubForm;
@@ -1,55 +1,32 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["fields", "title", "description", "component", "TitleGridProps", "TitleProps", "DescriptionProps", "DescriptionGridProps", "ItemsGridProps"];
5
- import React from 'react';
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";
6
13
  import { styled } from '@mui/material/styles';
7
- import Typography from "@mui/material/Typography";
8
- import Grid from "@mui/material/Grid";
9
- import useFormApi from "@data-driven-forms/react-form-renderer/use-form-api";
10
- var PREFIX = 'SubForm';
11
- var classes = {
12
- grid: "".concat(PREFIX, "-grid")
14
+ import { Typography, Grid } from '@mui/material';
15
+ import { useFormApi } from '@data-driven-forms/react-form-renderer';
16
+ const PREFIX = 'SubForm';
17
+ const classes = {
18
+ grid: `${PREFIX}-grid`,
13
19
  };
14
- var StyledGrid = styled(Grid)(function () {
15
- return _defineProperty({}, "&.".concat(classes.grid), {
16
- paddingRight: 0,
17
- paddingLeft: 0
18
- });
19
- });
20
- var SubForm = function SubForm(_ref2) {
21
- var fields = _ref2.fields,
22
- title = _ref2.title,
23
- description = _ref2.description,
24
- component = _ref2.component,
25
- TitleGridProps = _ref2.TitleGridProps,
26
- TitleProps = _ref2.TitleProps,
27
- DescriptionProps = _ref2.DescriptionProps,
28
- DescriptionGridProps = _ref2.DescriptionGridProps,
29
- ItemsGridProps = _ref2.ItemsGridProps,
30
- rest = _objectWithoutProperties(_ref2, _excluded);
31
- var _useFormApi = useFormApi(),
32
- renderForm = _useFormApi.renderForm;
33
- return /*#__PURE__*/React.createElement(StyledGrid, _extends({
34
- item: true,
35
- xs: 12,
36
- container: true,
37
- className: classes.grid
38
- }, rest), title && /*#__PURE__*/React.createElement(Grid, _extends({
39
- item: true,
40
- xs: 12
41
- }, TitleGridProps), /*#__PURE__*/React.createElement(Typography, _extends({
42
- variant: "h5"
43
- }, TitleProps), title)), description && /*#__PURE__*/React.createElement(Grid, _extends({
44
- item: true,
45
- xs: 12
46
- }, DescriptionGridProps), /*#__PURE__*/React.createElement(Typography, _extends({
47
- paragraph: true
48
- }, DescriptionProps), description)), /*#__PURE__*/React.createElement(Grid, _extends({
49
- item: true,
50
- xs: 12,
51
- container: true,
52
- rowSpacing: 2
53
- }, ItemsGridProps), renderForm(fields)));
20
+ const StyledGrid = styled(Grid)(() => ({
21
+ [`&.${classes.grid}`]: {
22
+ paddingRight: 0,
23
+ paddingLeft: 0,
24
+ },
25
+ }));
26
+ const SubForm = (_a) => {
27
+ var { fields, title, description, component, TitleGridProps = {}, TitleProps = {}, DescriptionProps = {}, DescriptionGridProps = {}, ItemsGridProps = {} } = _a, rest = __rest(_a, ["fields", "title", "description", "component", "TitleGridProps", "TitleProps", "DescriptionProps", "DescriptionGridProps", "ItemsGridProps"]);
28
+ const { renderForm } = useFormApi();
29
+ return (_jsxs(StyledGrid, Object.assign({ item: true, xs: 12, container: true, className: classes.grid }, rest, { children: [title && (_jsx(Grid, Object.assign({ item: true, xs: 12 }, TitleGridProps, { children: _jsx(Typography, Object.assign({ variant: "h5" }, TitleProps, { children: title })) }))), description && (_jsx(Grid, Object.assign({ item: true, xs: 12 }, DescriptionGridProps, { children: _jsx(Typography, Object.assign({ paragraph: true }, DescriptionProps, { children: description })) }))), _jsx(Grid, Object.assign({ item: true, xs: 12, container: true, rowSpacing: 2 }, ItemsGridProps, { children: renderForm(fields) }))] })));
54
30
  };
55
- export default SubForm;
31
+ export default SubForm;
32
+ //# sourceMappingURL=sub-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-form.js","sourceRoot":"","sources":["../../src/sub-form/sub-form.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGpE,MAAM,MAAM,GAAG,SAAS,CAAC;AAEzB,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;CACvB,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACrC,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE;QACrB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC,CAAC;AAcJ,MAAM,OAAO,GAA2B,CAAC,EAWxC,EAAE,EAAE;QAXoC,EACvC,MAAM,EACN,KAAK,EACL,WAAW,EACX,SAAS,EACT,cAAc,GAAG,EAAE,EACnB,UAAU,GAAG,EAAE,EACf,gBAAgB,GAAG,EAAE,EACrB,oBAAoB,GAAG,EAAE,EACzB,cAAc,GAAG,EAAE,OAEpB,EADI,IAAI,cAVgC,6IAWxC,CADQ;IAEP,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC;IAEpC,OAAO,CACL,MAAC,UAAU,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,SAAS,QAAC,SAAS,EAAE,OAAO,CAAC,IAAI,IAAM,IAAI,eACjE,KAAK,IAAI,CACR,KAAC,IAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,IAAM,cAAc,cACnC,KAAC,UAAU,kBAAC,OAAO,EAAC,IAAI,IAAK,UAAU,cACpC,KAAK,IACK,IACR,CACR,EACA,WAAW,IAAI,CACd,KAAC,IAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,IAAM,oBAAoB,cACzC,KAAC,UAAU,kBAAC,SAAS,UAAK,gBAAgB,cACvC,WAAW,IACD,IACR,CACR,EACD,KAAC,IAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,SAAS,QAAC,UAAU,EAAE,CAAC,IAAM,cAAc,cAC3D,UAAU,CAAC,MAAM,CAAC,IACd,KACI,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './switch';
2
+ export * from './switch';
@@ -1,2 +1,3 @@
1
1
  export { default } from './switch';
2
- export * from './switch';
2
+ export * from './switch';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { FormControlLabelProps, FormHelperTextProps, FormControlProps, FormGroupProps, FormLabelProps, SwitchProps as MUISwitchProps } 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 SwitchProps extends BaseFieldProps {
6
+ onText?: string;
7
+ offText?: string;
8
+ FormFieldGridProps?: FormFieldGridProps;
9
+ FormControlProps?: FormControlProps;
10
+ FormGroupProps?: FormGroupProps;
11
+ FormControlLabelProps?: FormControlLabelProps;
12
+ SwitchProps?: MUISwitchProps;
13
+ FormLabelProps?: FormLabelProps;
14
+ FormHelperTextProps?: FormHelperTextProps;
15
+ [key: string]: any;
16
+ }
17
+ export declare const Switch: React.FC<SwitchProps>;
18
+ export default Switch;
@@ -1,65 +1,24 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["input", "isReadOnly", "isDisabled", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "onText", "offText", "FormFieldGridProps", "FormControlProps", "FormGroupProps", "FormControlLabelProps", "SwitchProps", "FormLabelProps", "FormHelperTextProps"];
5
- 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; }
6
- 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; }
7
- import React from 'react';
8
- import FormControlLabel from "@mui/material/FormControlLabel";
9
- import FormHelperText from "@mui/material/FormHelperText";
10
- import FormControl from "@mui/material/FormControl";
11
- import FormGroup from "@mui/material/FormGroup";
12
- import FormLabel from "@mui/material/FormLabel";
13
- import MUISwitch from "@mui/material/Switch";
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 { FormControlLabel, FormHelperText, FormControl, FormGroup, FormLabel, Switch as MUISwitch } from '@mui/material';
14
+ import { useFieldApi } from '@data-driven-forms/react-form-renderer';
14
15
  import FormFieldGrid from '../form-field-grid/form-field-grid';
15
16
  import { validationError } from '../validation-error/validation-error';
16
- import useFieldApi from "@data-driven-forms/react-form-renderer/use-field-api";
17
- export var Switch = function Switch(props) {
18
- var _useFieldApi = useFieldApi(_objectSpread(_objectSpread({}, props), {}, {
19
- type: 'checkbox'
20
- })),
21
- input = _useFieldApi.input,
22
- isReadOnly = _useFieldApi.isReadOnly,
23
- isDisabled = _useFieldApi.isDisabled,
24
- isRequired = _useFieldApi.isRequired,
25
- label = _useFieldApi.label,
26
- helperText = _useFieldApi.helperText,
27
- description = _useFieldApi.description,
28
- validateOnMount = _useFieldApi.validateOnMount,
29
- meta = _useFieldApi.meta,
30
- onText = _useFieldApi.onText,
31
- offText = _useFieldApi.offText,
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$SwitchPr = _useFieldApi.SwitchProps,
41
- SwitchProps = _useFieldApi$SwitchPr === void 0 ? {} : _useFieldApi$SwitchPr,
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
- rest = _objectWithoutProperties(_useFieldApi, _excluded);
47
- var invalid = validationError(meta, validateOnMount);
48
- var text = invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description;
49
- return /*#__PURE__*/React.createElement(FormFieldGrid, FormFieldGridProps, /*#__PURE__*/React.createElement(FormControl, _extends({
50
- required: isRequired,
51
- error: !!invalid,
52
- component: "fieldset"
53
- }, FormControlProps), /*#__PURE__*/React.createElement(FormGroup, FormGroupProps, /*#__PURE__*/React.createElement(FormControlLabel, _extends({
54
- control: /*#__PURE__*/React.createElement(MUISwitch, _extends({}, rest, input, {
55
- readOnly: isReadOnly,
56
- disabled: isDisabled || isReadOnly,
57
- onChange: function onChange(_ref) {
58
- var checked = _ref.target.checked;
59
- return input.onChange(checked);
60
- }
61
- }, SwitchProps)),
62
- label: /*#__PURE__*/React.createElement(FormLabel, FormLabelProps, input.checked ? onText || label : offText || label)
63
- }, FormControlLabelProps)), text && /*#__PURE__*/React.createElement(FormHelperText, FormHelperTextProps, text))));
17
+ export const Switch = (props) => {
18
+ const _a = useFieldApi(Object.assign(Object.assign({}, props), { type: 'checkbox' })), { input, isReadOnly, isDisabled, isRequired, label, helperText, description, validateOnMount, meta, onText, offText, FormFieldGridProps = {}, FormControlProps = {}, FormGroupProps = {}, FormControlLabelProps = {}, SwitchProps = {}, FormLabelProps = {}, FormHelperTextProps = {} } = _a, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "onText", "offText", "FormFieldGridProps", "FormControlProps", "FormGroupProps", "FormControlLabelProps", "SwitchProps", "FormLabelProps", "FormHelperTextProps"]);
19
+ const invalid = validationError(meta, validateOnMount);
20
+ const text = invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description;
21
+ 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({ control: _jsx(MUISwitch, Object.assign({}, rest, input, { readOnly: isReadOnly, disabled: isDisabled || isReadOnly, onChange: ({ target: { checked } }) => input.onChange(checked) }, SwitchProps)), label: _jsx(FormLabel, Object.assign({}, FormLabelProps, { children: input.checked ? onText || label : offText || label })) }, FormControlLabelProps)), text && _jsx(FormHelperText, Object.assign({}, FormHelperTextProps, { children: text }))] })) })) })));
64
22
  };
65
- export default Switch;
23
+ export default Switch;
24
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/switch/switch.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AASzH,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAGrE,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAgBvE,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,KAAK,EAAE,EAAE;IACrD,MAAM,KAoBF,WAAW,iCACV,KAAK,KACR,IAAI,EAAE,UAAU,IAChB,EAvBI,EACJ,KAAK,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,IAAI,EACJ,MAAM,EACN,OAAO,EACP,kBAAkB,GAAG,EAAE,EACvB,gBAAgB,GAAG,EAAE,EACrB,cAAc,GAAG,EAAE,EACnB,qBAAqB,GAAG,EAAE,EAC1B,WAAW,GAAG,EAAE,EAChB,cAAc,GAAG,EAAE,EACnB,mBAAmB,GAAG,EAAE,OAKxB,EAJG,IAAI,cAnBH,sRAoBL,CAGC,CAAC;IAEH,MAAM,OAAO,GAAG,eAAe,CAAC,IAAyB,EAAE,eAAe,CAAC,CAAC;IAC5E,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,IAAI,WAAW,CAAC;IAEzG,OAAO,CACL,KAAC,aAAa,oBAAK,kBAAkB,cACnC,KAAC,WAAW,kBAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAC,UAAU,IAAK,gBAAgB,cAC5F,MAAC,SAAS,oBAAK,cAAc,eAC3B,KAAC,gBAAgB,kBACf,OAAO,EACL,KAAC,SAAS,oBACJ,IAAI,EACJ,KAAK,IACT,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,IAAI,UAAU,EAClC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAC1D,WAAW,EACf,EAEJ,KAAK,EAAE,KAAC,SAAS,oBAAK,cAAc,cAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,IAAa,IAClG,qBAAqB,EACzB,EACD,IAAI,IAAI,KAAC,cAAc,oBAAK,mBAAmB,cAAG,IAAI,IAAkB,KAC/D,IACA,IACA,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './tabs';
2
+ export * from './tabs';
package/esm/tabs/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default } from './tabs';
2
- export * from './tabs';
2
+ export * from './tabs';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { AppBarProps, GridProps, TabProps as MUITabProps, TabsProps } from '@mui/material';
3
+ import type { FormFieldGridProps } from '../form-field-grid/form-field-grid';
4
+ import type { Field } from '@data-driven-forms/react-form-renderer';
5
+ interface TabField {
6
+ fields: Field[];
7
+ title?: string;
8
+ name?: string;
9
+ }
10
+ export interface FormTabsProps {
11
+ fields: TabField[];
12
+ AppBarProps?: AppBarProps;
13
+ TabsProps?: TabsProps;
14
+ TabProps?: MUITabProps;
15
+ FormFieldGridProps?: FormFieldGridProps;
16
+ GridItemProps?: GridProps;
17
+ }
18
+ declare const FormTabs: React.FC<FormTabsProps>;
19
+ export default FormTabs;
package/esm/tabs/tabs.js CHANGED
@@ -1,76 +1,12 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- 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; }
5
- 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; }
6
- import React, { useState } from 'react';
7
- import AppBar from "@mui/material/AppBar";
8
- import Grid from "@mui/material/Grid";
9
- import Tab from "@mui/material/Tab";
10
- import Tabs from "@mui/material/Tabs";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { AppBar, Grid, Tab, Tabs } from '@mui/material';
11
4
  import FormFieldGrid from '../form-field-grid';
12
- import useFormApi from "@data-driven-forms/react-form-renderer/use-form-api";
13
- var FormTabs = function FormTabs(_ref) {
14
- var fields = _ref.fields,
15
- _ref$AppBarProps = _ref.AppBarProps,
16
- AppBarProps = _ref$AppBarProps === void 0 ? {} : _ref$AppBarProps,
17
- _ref$TabsProps = _ref.TabsProps,
18
- TabsProps = _ref$TabsProps === void 0 ? {} : _ref$TabsProps,
19
- _ref$TabProps = _ref.TabProps,
20
- TabProps = _ref$TabProps === void 0 ? {} : _ref$TabProps,
21
- _ref$FormFieldGridPro = _ref.FormFieldGridProps,
22
- FormFieldGridProps = _ref$FormFieldGridPro === void 0 ? {} : _ref$FormFieldGridPro,
23
- _ref$GridItemProps = _ref.GridItemProps,
24
- GridItemProps = _ref$GridItemProps === void 0 ? {} : _ref$GridItemProps;
25
- var formOptions = useFormApi();
26
- var _useState = useState(0),
27
- _useState2 = _slicedToArray(_useState, 2),
28
- activeTab = _useState2[0],
29
- setActiveTab = _useState2[1];
30
- return /*#__PURE__*/React.createElement(FormFieldGrid, _extends({
31
- container: true
32
- }, FormFieldGridProps), /*#__PURE__*/React.createElement(AppBar, _extends({
33
- position: "static"
34
- }, AppBarProps), /*#__PURE__*/React.createElement(Tabs, _extends({
35
- textColor: "inherit",
36
- value: activeTab,
37
- onChange: function onChange(_e, tabIndex) {
38
- return setActiveTab(tabIndex);
39
- }
40
- }, TabsProps), fields.map(function (_ref2) {
41
- var title = _ref2.title,
42
- name = _ref2.name;
43
- return /*#__PURE__*/React.createElement(Tab, _extends({
44
- key: name,
45
- label: title
46
- }, TabProps));
47
- }))), fields.map(function (_ref3, index) {
48
- var fields = _ref3.fields,
49
- name = _ref3.name;
50
- return /*#__PURE__*/React.createElement(Grid, _extends({
51
- key: name || index,
52
- container: true,
53
- item: true,
54
- xs: 12,
55
- rowSpacing: 2,
56
- sx: _objectSpread({
57
- mt: 1
58
- }, index !== activeTab && {
59
- display: 'none'
60
- })
61
- }, GridItemProps), formOptions.renderForm(fields));
62
- }));
5
+ import { useFormApi } from '@data-driven-forms/react-form-renderer';
6
+ const FormTabs = ({ fields, AppBarProps = {}, TabsProps = {}, TabProps = {}, FormFieldGridProps = {}, GridItemProps = {}, }) => {
7
+ const formOptions = useFormApi();
8
+ const [activeTab, setActiveTab] = useState(0);
9
+ return (_jsxs(FormFieldGrid, Object.assign({ container: true }, FormFieldGridProps, { children: [_jsx(AppBar, Object.assign({ position: "static" }, AppBarProps, { children: _jsx(Tabs, Object.assign({ textColor: "inherit", value: activeTab, onChange: (_e, tabIndex) => setActiveTab(tabIndex) }, TabsProps, { children: fields.map(({ title, name }, index) => (_jsx(Tab, Object.assign({ label: title }, TabProps), name || index))) })) })), fields.map(({ fields, name }, index) => (_jsx(Grid, Object.assign({ container: true, item: true, xs: 12, rowSpacing: 2, sx: Object.assign({ mt: 1 }, (index !== activeTab && { display: 'none' })) }, GridItemProps, { children: formOptions.renderForm(fields) }), name || index)))] })));
63
10
  };
64
11
  export default FormTabs;
65
-
66
- /*
67
- {fields.map(({ fields }, index) =>
68
- index === activeTab ? (
69
- formOptions.renderForm(fields)
70
- ) : (
71
- <Grid container item xs={12} sx={{ display: 'none' }}>
72
- {formOptions.renderForm(fields)}
73
- </Grid>
74
- )
75
- )}
76
- */
12
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/tabs/tabs.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGxD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAkBpE,MAAM,QAAQ,GAA4B,CAAC,EACzC,MAAM,EACN,WAAW,GAAG,EAAE,EAChB,SAAS,GAAG,EAAE,EACd,QAAQ,GAAG,EAAE,EACb,kBAAkB,GAAG,EAAE,EACvB,aAAa,GAAG,EAAE,GACnB,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,UAAU,EAAE,CAAC;IACjC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE9C,OAAO,CACL,MAAC,aAAa,kBAAC,SAAS,UAAK,kBAAkB,eAC7C,KAAC,MAAM,kBAAC,QAAQ,EAAC,QAAQ,IAAK,WAAW,cACvC,KAAC,IAAI,kBAAC,SAAS,EAAC,SAAS,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAM,SAAS,cAC1G,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CACtC,KAAC,GAAG,kBAAqB,KAAK,EAAE,KAAK,IAAM,QAAQ,GAAzC,IAAI,IAAI,KAAK,CAAgC,CACxD,CAAC,IACG,IACA,EACR,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CACvC,KAAC,IAAI,kBAEH,SAAS,QACT,IAAI,QACJ,EAAE,EAAE,EAAE,EACN,UAAU,EAAE,CAAC,EACb,EAAE,kBAAI,EAAE,EAAE,CAAC,IAAK,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,KACxD,aAAa,cAEhB,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,KAR1B,IAAI,IAAI,KAAK,CASb,CACR,CAAC,KACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './text-field';
2
+ export * from './text-field';
@@ -1,2 +1,3 @@
1
1
  export { default } from './text-field';
2
- export * from './text-field';
2
+ export * from './text-field';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text-field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,10 @@
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;
8
+ }
9
+ declare const TextField: React.FC<TextFieldProps>;
10
+ export default TextField;
@@ -1,41 +1,23 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "inputProps", "FormFieldGridProps"];
5
- 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; }
6
- 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; }
7
- import React from 'react';
8
- import MuiTextField from "@mui/material/TextField";
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 { TextField as MuiTextField } from '@mui/material';
14
+ import { useFieldApi } from '@data-driven-forms/react-form-renderer';
9
15
  import FormFieldGrid from '../form-field-grid/form-field-grid';
10
16
  import { validationError } from '../validation-error/validation-error';
11
- import useFieldApi from "@data-driven-forms/react-form-renderer/use-field-api";
12
- var TextField = function TextField(props) {
13
- var _useFieldApi = useFieldApi(props),
14
- input = _useFieldApi.input,
15
- isReadOnly = _useFieldApi.isReadOnly,
16
- isDisabled = _useFieldApi.isDisabled,
17
- placeholder = _useFieldApi.placeholder,
18
- isRequired = _useFieldApi.isRequired,
19
- label = _useFieldApi.label,
20
- helperText = _useFieldApi.helperText,
21
- description = _useFieldApi.description,
22
- validateOnMount = _useFieldApi.validateOnMount,
23
- meta = _useFieldApi.meta,
24
- inputProps = _useFieldApi.inputProps,
25
- FormFieldGridProps = _useFieldApi.FormFieldGridProps,
26
- rest = _objectWithoutProperties(_useFieldApi, _excluded);
27
- var invalid = validationError(meta, validateOnMount);
28
- return /*#__PURE__*/React.createElement(FormFieldGrid, FormFieldGridProps, /*#__PURE__*/React.createElement(MuiTextField, _extends({}, input, {
29
- fullWidth: true,
30
- error: !!invalid,
31
- helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
32
- disabled: isDisabled,
33
- label: label,
34
- placeholder: placeholder,
35
- required: isRequired,
36
- inputProps: _objectSpread({
37
- readOnly: isReadOnly
38
- }, inputProps)
39
- }, rest)));
17
+ const TextField = (props) => {
18
+ const _a = useFieldApi(props), { input, isReadOnly, isDisabled, placeholder, isRequired, label, helperText, description, validateOnMount, meta, inputProps, FormFieldGridProps } = _a, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "inputProps", "FormFieldGridProps"]);
19
+ const invalid = validationError(meta, validateOnMount);
20
+ return (_jsx(FormFieldGrid, Object.assign({}, FormFieldGridProps, { children: _jsx(MuiTextField, Object.assign({}, input, { fullWidth: true, error: !!invalid, helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description, disabled: isDisabled, label: label, placeholder: placeholder, required: isRequired, inputProps: Object.assign({ readOnly: isReadOnly }, inputProps) }, rest)) })));
40
21
  };
41
- export default TextField;
22
+ export default TextField;
23
+ //# 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,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAGrE,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAWvE,MAAM,SAAS,GAA6B,CAAC,KAAK,EAAE,EAAE;IACpD,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,UAAU,EACV,kBAAkB,OAEE,EADjB,IAAI,cAbH,uKAcL,CAAqB,CAAC;IACvB,MAAM,OAAO,GAAG,eAAe,CAAC,IAAyB,EAAE,eAAe,CAAC,CAAC;IAE5E,OAAO,CACL,KAAC,aAAa,oBAAK,kBAAkB,cACnC,KAAC,YAAY,oBACP,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,kBACR,QAAQ,EAAE,UAAU,IACjB,UAAU,KAEX,IAAI,EACR,IACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './textarea';
2
+ export * from './textarea';
@@ -1,2 +1,3 @@
1
1
  export { default } from './textarea';
2
- export * from './textarea';
2
+ export * from './textarea';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/textarea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,13 @@
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;
11
+ }
12
+ declare const Textarea: React.FC<TextareaProps>;
13
+ export default Textarea;
@@ -1,45 +1,23 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "FormFieldGridProps", "inputProps"];
5
- 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; }
6
- 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; }
7
- import React from 'react';
8
- import MuiTextField from "@mui/material/TextField";
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 { TextField as MuiTextField } from '@mui/material';
14
+ import { useFieldApi } from '@data-driven-forms/react-form-renderer';
9
15
  import FormFieldGrid from '../form-field-grid/form-field-grid';
10
16
  import { validationError } from '../validation-error/validation-error';
11
- import useFieldApi from "@data-driven-forms/react-form-renderer/use-field-api";
12
- var Textarea = function Textarea(props) {
13
- var _useFieldApi = useFieldApi(props),
14
- input = _useFieldApi.input,
15
- isReadOnly = _useFieldApi.isReadOnly,
16
- isDisabled = _useFieldApi.isDisabled,
17
- placeholder = _useFieldApi.placeholder,
18
- isRequired = _useFieldApi.isRequired,
19
- label = _useFieldApi.label,
20
- helperText = _useFieldApi.helperText,
21
- description = _useFieldApi.description,
22
- validateOnMount = _useFieldApi.validateOnMount,
23
- meta = _useFieldApi.meta,
24
- _useFieldApi$FormFiel = _useFieldApi.FormFieldGridProps,
25
- FormFieldGridProps = _useFieldApi$FormFiel === void 0 ? {} : _useFieldApi$FormFiel,
26
- _useFieldApi$inputPro = _useFieldApi.inputProps,
27
- inputProps = _useFieldApi$inputPro === void 0 ? {} : _useFieldApi$inputPro,
28
- rest = _objectWithoutProperties(_useFieldApi, _excluded);
29
- var invalid = validationError(meta, validateOnMount);
30
- return /*#__PURE__*/React.createElement(FormFieldGrid, FormFieldGridProps, /*#__PURE__*/React.createElement(MuiTextField, _extends({}, input, {
31
- fullWidth: true,
32
- error: !!invalid,
33
- helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
34
- disabled: isDisabled,
35
- label: label,
36
- placeholder: placeholder,
37
- required: isRequired,
38
- inputProps: _objectSpread({
39
- readOnly: isReadOnly
40
- }, inputProps)
41
- }, rest, {
42
- multiline: true
43
- })));
17
+ const Textarea = (props) => {
18
+ const _a = useFieldApi(props), { input, isReadOnly, isDisabled, placeholder, isRequired, label, helperText, description, validateOnMount, meta, FormFieldGridProps = {}, inputProps = {}, TextFieldProps = {} } = _a, rest = __rest(_a, ["input", "isReadOnly", "isDisabled", "placeholder", "isRequired", "label", "helperText", "description", "validateOnMount", "meta", "FormFieldGridProps", "inputProps", "TextFieldProps"]);
19
+ const invalid = validationError(meta, validateOnMount);
20
+ return (_jsx(FormFieldGrid, Object.assign({}, FormFieldGridProps, { children: _jsx(MuiTextField, Object.assign({}, input, { fullWidth: true, error: !!invalid, helperText: invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description, disabled: isDisabled, label: label, placeholder: placeholder, required: isRequired, inputProps: Object.assign({ readOnly: isReadOnly }, inputProps) }, TextFieldProps, rest, { multiline: true })) })));
44
21
  };
45
- export default Textarea;
22
+ export default Textarea;
23
+ //# sourceMappingURL=textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/textarea/textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAGrE,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAWvE,MAAM,QAAQ,GAA4B,CAAC,KAAK,EAAE,EAAE;IAClD,MAAM,KAeF,WAAW,CAAC,KAAK,CAAC,EAfhB,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,UAAU,GAAG,EAAE,EACf,cAAc,GAAG,EAAE,OAEC,EADjB,IAAI,cAdH,yLAeL,CAAqB,CAAC;IAEvB,MAAM,OAAO,GAAG,eAAe,CAAC,IAAyB,EAAE,eAAe,CAAC,CAAC;IAE5E,OAAO,CACL,KAAC,aAAa,oBAAK,kBAAkB,cACnC,KAAC,YAAY,oBACP,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,kBACR,QAAQ,EAAE,UAAU,IACjB,UAAU,KAEX,cAAc,EACd,IAAI,IACR,SAAS,UACT,IACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './time-picker';
2
+ export * from './time-picker';
@@ -1,2 +1,3 @@
1
1
  export { default } from './time-picker';
2
- export * from './time-picker';
2
+ export * from './time-picker';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/time-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,13 @@
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;
11
+ }
12
+ declare const TimePicker: React.FC<TimePickerProps>;
13
+ export default TimePicker;