@aglyn/shared-ui-jsx-forms 1.0.0-beta.143

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 (150) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +52 -0
  4. package/src/index.d.ts +17 -0
  5. package/src/index.js +18 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/color-picker-tokens.d.ts +135 -0
  8. package/src/lib/components/color-picker-tokens.js +431 -0
  9. package/src/lib/components/color-picker-tokens.js.map +1 -0
  10. package/src/lib/components/color-picker.component.d.ts +64 -0
  11. package/src/lib/components/color-picker.component.js +322 -0
  12. package/src/lib/components/color-picker.component.js.map +1 -0
  13. package/src/lib/components/create-artifact-drawer.component.d.ts +100 -0
  14. package/src/lib/components/create-artifact-drawer.component.js +184 -0
  15. package/src/lib/components/create-artifact-drawer.component.js.map +1 -0
  16. package/src/lib/components/grid-form-template.component.d.ts +21 -0
  17. package/src/lib/components/grid-form-template.component.js +81 -0
  18. package/src/lib/components/grid-form-template.component.js.map +1 -0
  19. package/src/lib/components/icon-select.component.d.ts +52 -0
  20. package/src/lib/components/icon-select.component.js +453 -0
  21. package/src/lib/components/icon-select.component.js.map +1 -0
  22. package/src/lib/components/select.component.d.ts +58 -0
  23. package/src/lib/components/select.component.js +107 -0
  24. package/src/lib/components/select.component.js.map +1 -0
  25. package/src/lib/components/switch.component.d.ts +38 -0
  26. package/src/lib/components/switch.component.js +76 -0
  27. package/src/lib/components/switch.component.js.map +1 -0
  28. package/src/lib/components/text-field.component.d.ts +45 -0
  29. package/src/lib/components/text-field.component.js +77 -0
  30. package/src/lib/components/text-field.component.js.map +1 -0
  31. package/src/lib/components/textarea.component.d.ts +45 -0
  32. package/src/lib/components/textarea.component.js +61 -0
  33. package/src/lib/components/textarea.component.js.map +1 -0
  34. package/src/lib/components/toggle-button.component.d.ts +27 -0
  35. package/src/lib/components/toggle-button.component.js +116 -0
  36. package/src/lib/components/toggle-button.component.js.map +1 -0
  37. package/src/lib/constants/component-mappers.d.ts +42 -0
  38. package/src/lib/constants/component-mappers.js +70 -0
  39. package/src/lib/constants/component-mappers.js.map +1 -0
  40. package/src/lib/constants/dynamic-fields.d.ts +45 -0
  41. package/src/lib/constants/dynamic-fields.js +65 -0
  42. package/src/lib/constants/dynamic-fields.js.map +1 -0
  43. package/src/lib/constants/field-configurations.d.ts +53 -0
  44. package/src/lib/constants/field-configurations.js +121 -0
  45. package/src/lib/constants/field-configurations.js.map +1 -0
  46. package/src/lib/constants/flags.d.ts +72 -0
  47. package/src/lib/constants/flags.js +69 -0
  48. package/src/lib/constants/flags.js.map +1 -0
  49. package/src/lib/hocs/with-grid-item.d.ts +25 -0
  50. package/src/lib/hocs/with-grid-item.js +48 -0
  51. package/src/lib/hocs/with-grid-item.js.map +1 -0
  52. package/src/lib/jsx-forms.d.ts +41 -0
  53. package/src/lib/jsx-forms.js +42 -0
  54. package/src/lib/jsx-forms.js.map +1 -0
  55. package/src/lib/mapper/breakpoint-span.d.ts +73 -0
  56. package/src/lib/mapper/breakpoint-span.js +346 -0
  57. package/src/lib/mapper/breakpoint-span.js.map +1 -0
  58. package/src/lib/mapper/checkbox.d.ts +43 -0
  59. package/src/lib/mapper/checkbox.js +111 -0
  60. package/src/lib/mapper/checkbox.js.map +1 -0
  61. package/src/lib/mapper/css-border.d.ts +113 -0
  62. package/src/lib/mapper/css-border.js +410 -0
  63. package/src/lib/mapper/css-border.js.map +1 -0
  64. package/src/lib/mapper/css-dimension.d.ts +89 -0
  65. package/src/lib/mapper/css-dimension.js +327 -0
  66. package/src/lib/mapper/css-dimension.js.map +1 -0
  67. package/src/lib/mapper/css-gradient.d.ts +110 -0
  68. package/src/lib/mapper/css-gradient.js +720 -0
  69. package/src/lib/mapper/css-gradient.js.map +1 -0
  70. package/src/lib/mapper/data-table.d.ts +23 -0
  71. package/src/lib/mapper/data-table.js +296 -0
  72. package/src/lib/mapper/data-table.js.map +1 -0
  73. package/src/lib/mapper/date-picker.d.ts +26 -0
  74. package/src/lib/mapper/date-picker.js +69 -0
  75. package/src/lib/mapper/date-picker.js.map +1 -0
  76. package/src/lib/mapper/dual-list-select.d.ts +115 -0
  77. package/src/lib/mapper/dual-list-select.js +353 -0
  78. package/src/lib/mapper/dual-list-select.js.map +1 -0
  79. package/src/lib/mapper/field-array.d.ts +71 -0
  80. package/src/lib/mapper/field-array.js +326 -0
  81. package/src/lib/mapper/field-array.js.map +1 -0
  82. package/src/lib/mapper/form-field-grid.d.ts +155 -0
  83. package/src/lib/mapper/form-field-grid.js +194 -0
  84. package/src/lib/mapper/form-field-grid.js.map +1 -0
  85. package/src/lib/mapper/index.d.ts +50 -0
  86. package/src/lib/mapper/index.js +49 -0
  87. package/src/lib/mapper/index.js.map +1 -0
  88. package/src/lib/mapper/multiple-choice-list.d.ts +32 -0
  89. package/src/lib/mapper/multiple-choice-list.js +105 -0
  90. package/src/lib/mapper/multiple-choice-list.js.map +1 -0
  91. package/src/lib/mapper/plain-text.d.ts +31 -0
  92. package/src/lib/mapper/plain-text.js +48 -0
  93. package/src/lib/mapper/plain-text.js.map +1 -0
  94. package/src/lib/mapper/preset-choice.d.ts +106 -0
  95. package/src/lib/mapper/preset-choice.js +267 -0
  96. package/src/lib/mapper/preset-choice.js.map +1 -0
  97. package/src/lib/mapper/radio.d.ts +40 -0
  98. package/src/lib/mapper/radio.js +122 -0
  99. package/src/lib/mapper/radio.js.map +1 -0
  100. package/src/lib/mapper/select.d.ts +60 -0
  101. package/src/lib/mapper/select.js +203 -0
  102. package/src/lib/mapper/select.js.map +1 -0
  103. package/src/lib/mapper/slider.d.ts +45 -0
  104. package/src/lib/mapper/slider.js +119 -0
  105. package/src/lib/mapper/slider.js.map +1 -0
  106. package/src/lib/mapper/stored-field-value.d.ts +23 -0
  107. package/src/lib/mapper/stored-field-value.js +29 -0
  108. package/src/lib/mapper/stored-field-value.js.map +1 -0
  109. package/src/lib/mapper/sub-form.d.ts +39 -0
  110. package/src/lib/mapper/sub-form.js +108 -0
  111. package/src/lib/mapper/sub-form.js.map +1 -0
  112. package/src/lib/mapper/switch.d.ts +47 -0
  113. package/src/lib/mapper/switch.js +93 -0
  114. package/src/lib/mapper/switch.js.map +1 -0
  115. package/src/lib/mapper/tabs.d.ts +34 -0
  116. package/src/lib/mapper/tabs.js +64 -0
  117. package/src/lib/mapper/tabs.js.map +1 -0
  118. package/src/lib/mapper/text-field.d.ts +33 -0
  119. package/src/lib/mapper/text-field.js +88 -0
  120. package/src/lib/mapper/text-field.js.map +1 -0
  121. package/src/lib/mapper/textarea.d.ts +31 -0
  122. package/src/lib/mapper/textarea.js +68 -0
  123. package/src/lib/mapper/textarea.js.map +1 -0
  124. package/src/lib/mapper/theme-scale.d.ts +79 -0
  125. package/src/lib/mapper/theme-scale.js +162 -0
  126. package/src/lib/mapper/theme-scale.js.map +1 -0
  127. package/src/lib/mapper/time-picker.d.ts +26 -0
  128. package/src/lib/mapper/time-picker.js +69 -0
  129. package/src/lib/mapper/time-picker.js.map +1 -0
  130. package/src/lib/mapper/types.d.ts +43 -0
  131. package/src/lib/mapper/types.js +22 -0
  132. package/src/lib/mapper/types.js.map +1 -0
  133. package/src/lib/mapper/validation-error.d.ts +24 -0
  134. package/src/lib/mapper/validation-error.js +24 -0
  135. package/src/lib/mapper/validation-error.js.map +1 -0
  136. package/src/lib/mapper/wizard.d.ts +21 -0
  137. package/src/lib/mapper/wizard.js +203 -0
  138. package/src/lib/mapper/wizard.js.map +1 -0
  139. package/src/lib/types.d.ts +19 -0
  140. package/src/lib/types.js +18 -0
  141. package/src/lib/types.js.map +1 -0
  142. package/src/lib/utils/option-is-equal-to-value.d.ts +20 -0
  143. package/src/lib/utils/option-is-equal-to-value.js +21 -0
  144. package/src/lib/utils/option-is-equal-to-value.js.map +1 -0
  145. package/src/lib/utils/validation-message.d.ts +22 -0
  146. package/src/lib/utils/validation-message.js +24 -0
  147. package/src/lib/utils/validation-message.js.map +1 -0
  148. package/src/lib/vendor/data-driven-forms.d.ts +33 -0
  149. package/src/lib/vendor/data-driven-forms.js +29 -0
  150. package/src/lib/vendor/data-driven-forms.js.map +1 -0
@@ -0,0 +1,108 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2026 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ /**
20
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and
21
+ * updated for the current MUI APIs (Grid `size`, no Typography `paragraph`).
22
+ */ import { HelpTip } from "@aglyn/shared-ui-jsx";
23
+ import { Grid, Typography } from "@mui/material";
24
+ import { styled } from "@mui/material/styles";
25
+ import { useFormApi } from "../vendor/data-driven-forms.js";
26
+ const PREFIX = 'SubForm';
27
+ const classes = {
28
+ grid: `${PREFIX}-grid`
29
+ };
30
+ const StyledGrid = styled(Grid)(()=>({
31
+ [`&.${classes.grid}`]: {
32
+ paddingRight: 0,
33
+ paddingLeft: 0
34
+ }
35
+ }));
36
+ export const SubForm = (_0)=>{
37
+ let { fields, title, description, component: _component, help, TitleGridProps = {}, TitleProps = {}, DescriptionProps = {}, DescriptionGridProps = {}, ItemsGridProps = {} } = _0, rest = _object_without_properties_loose(_0, [
38
+ "fields",
39
+ "title",
40
+ "description",
41
+ "component",
42
+ "help",
43
+ "TitleGridProps",
44
+ "TitleProps",
45
+ "DescriptionProps",
46
+ "DescriptionGridProps",
47
+ "ItemsGridProps"
48
+ ]);
49
+ const { renderForm } = useFormApi();
50
+ return /*#__PURE__*/ _jsxs(StyledGrid, _extends({
51
+ size: {
52
+ xs: 12
53
+ },
54
+ container: true,
55
+ className: classes.grid
56
+ }, rest, {
57
+ children: [
58
+ title && /*#__PURE__*/ _jsx(Grid, _extends({
59
+ size: {
60
+ xs: 12
61
+ }
62
+ }, TitleGridProps, {
63
+ children: /*#__PURE__*/ _jsxs(Typography, _extends({
64
+ variant: "h5",
65
+ sx: {
66
+ display: 'flex',
67
+ alignItems: 'center',
68
+ gap: 0.5
69
+ }
70
+ }, TitleProps, {
71
+ children: [
72
+ title,
73
+ help && /*#__PURE__*/ _jsx(HelpTip, _extends({}, help, {
74
+ sx: {
75
+ fontSize: '0.7em'
76
+ }
77
+ }))
78
+ ]
79
+ }))
80
+ })),
81
+ description && /*#__PURE__*/ _jsx(Grid, _extends({
82
+ size: {
83
+ xs: 12
84
+ }
85
+ }, DescriptionGridProps, {
86
+ children: /*#__PURE__*/ _jsx(Typography, _extends({
87
+ sx: {
88
+ mb: 2
89
+ }
90
+ }, DescriptionProps, {
91
+ children: description
92
+ }))
93
+ })),
94
+ /*#__PURE__*/ _jsx(Grid, _extends({
95
+ size: {
96
+ xs: 12
97
+ },
98
+ container: true,
99
+ rowSpacing: 2
100
+ }, ItemsGridProps, {
101
+ children: renderForm(fields)
102
+ }))
103
+ ]
104
+ }));
105
+ };
106
+ export default SubForm;
107
+
108
+ //# sourceMappingURL=sub-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/sub-form.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and\n * updated for the current MUI APIs (Grid `size`, no Typography `paragraph`).\n */\n\nimport { HelpTip, type HelpTipContent } from '@aglyn/shared-ui-jsx'\nimport type { ReactNode } from 'react'\n\nimport {\n Grid,\n type GridProps,\n Typography,\n type TypographyProps,\n} from '@mui/material'\nimport { styled } from '@mui/material/styles'\n\nimport { type FieldSchema, useFormApi } from '../vendor/data-driven-forms'\n\nconst PREFIX = 'SubForm'\n\nconst classes = {\n grid: `${PREFIX}-grid`,\n}\n\nconst StyledGrid = styled(Grid)(() => ({\n [`&.${classes.grid}`]: {\n paddingRight: 0,\n paddingLeft: 0,\n },\n}))\n\nexport interface SubFormProps extends Omit<GridProps, 'component' | 'title'> {\n fields: FieldSchema[]\n title?: ReactNode\n description?: ReactNode\n component?: string\n /** Contextual help affordance rendered beside the section title (AGL-601). */\n help?: HelpTipContent\n TitleGridProps?: GridProps\n TitleProps?: TypographyProps\n DescriptionProps?: TypographyProps\n DescriptionGridProps?: GridProps\n ItemsGridProps?: GridProps\n}\n\nexport const SubForm = ({\n fields,\n title,\n description,\n component: _component,\n help,\n TitleGridProps = {},\n TitleProps = {},\n DescriptionProps = {},\n DescriptionGridProps = {},\n ItemsGridProps = {},\n ...rest\n}: SubFormProps) => {\n const { renderForm } = useFormApi()\n\n return (\n <StyledGrid size={{ xs: 12 }} container className={classes.grid} {...rest}>\n {title && (\n <Grid size={{ xs: 12 }} {...TitleGridProps}>\n <Typography\n variant=\"h5\"\n sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}\n {...TitleProps}\n >\n {title}\n {help && <HelpTip {...help} sx={{ fontSize: '0.7em' }} />}\n </Typography>\n </Grid>\n )}\n {description && (\n <Grid size={{ xs: 12 }} {...DescriptionGridProps}>\n <Typography sx={{ mb: 2 }} {...DescriptionProps}>\n {description}\n </Typography>\n </Grid>\n )}\n <Grid size={{ xs: 12 }} container rowSpacing={2} {...ItemsGridProps}>\n {renderForm(fields)}\n </Grid>\n </StyledGrid>\n )\n}\n\nexport default SubForm\n"],"names":["HelpTip","Grid","Typography","styled","useFormApi","PREFIX","classes","grid","StyledGrid","paddingRight","paddingLeft","SubForm","fields","title","description","component","_component","help","TitleGridProps","TitleProps","DescriptionProps","DescriptionGridProps","ItemsGridProps","rest","renderForm","size","xs","container","className","variant","sx","display","alignItems","gap","fontSize","mb","rowSpacing"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;CAGC,GAED,SAASA,OAAO,QAA6B,uBAAsB;AAGnE,SACEC,IAAI,EAEJC,UAAU,QAEL,gBAAe;AACtB,SAASC,MAAM,QAAQ,uBAAsB;AAE7C,SAA2BC,UAAU,QAAQ,iCAA6B;AAE1E,MAAMC,SAAS;AAEf,MAAMC,UAAU;IACdC,MAAM,GAAGF,OAAO,KAAK,CAAC;AACxB;AAEA,MAAMG,aAAaL,OAAOF,MAAM,IAAO,CAAA;QACrC,CAAC,CAAC,EAAE,EAAEK,QAAQC,IAAI,EAAE,CAAC,EAAE;YACrBE,cAAc;YACdC,aAAa;QACf;IACF,CAAA;AAgBA,OAAO,MAAMC,UAAU;QAAC,EACtBC,MAAM,EACNC,KAAK,EACLC,WAAW,EACXC,WAAWC,UAAU,EACrBC,IAAI,EACJC,iBAAiB,CAAC,CAAC,EACnBC,aAAa,CAAC,CAAC,EACfC,mBAAmB,CAAC,CAAC,EACrBC,uBAAuB,CAAC,CAAC,EACzBC,iBAAiB,CAAC,CAAC,EAEN,OADVC;;;;;;;;;;;;IAEH,MAAM,EAAEC,UAAU,EAAE,GAAGpB;IAEvB,qBACE,MAACI;QAAWiB,MAAM;YAAEC,IAAI;QAAG;QAAGC,SAAS;QAACC,WAAWtB,QAAQC,IAAI;OAAMgB;;YAClEV,uBACC,KAACZ;gBAAKwB,MAAM;oBAAEC,IAAI;gBAAG;eAAOR;0BAC1B,cAAA,MAAChB;oBACC2B,SAAQ;oBACRC,IAAI;wBAAEC,SAAS;wBAAQC,YAAY;wBAAUC,KAAK;oBAAI;mBAClDd;;wBAEHN;wBACAI,sBAAQ,KAACjB,sBAAYiB;4BAAMa,IAAI;gCAAEI,UAAU;4BAAQ;;;;;YAIzDpB,6BACC,KAACb;gBAAKwB,MAAM;oBAAEC,IAAI;gBAAG;eAAOL;0BAC1B,cAAA,KAACnB;oBAAW4B,IAAI;wBAAEK,IAAI;oBAAE;mBAAOf;8BAC5BN;;;0BAIP,KAACb;gBAAKwB,MAAM;oBAAEC,IAAI;gBAAG;gBAAGC,SAAS;gBAACS,YAAY;eAAOd;0BAClDE,WAAWZ;;;;AAIpB,EAAC;AAED,eAAeD,QAAO"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0).
19
+ */
20
+ import { type FormControlLabelProps, type FormControlProps, type FormGroupProps, type FormHelperTextProps, type FormLabelProps, type SwitchProps as MuiSwitchProps } from '@mui/material';
21
+ import { type FormFieldGridProps } from './form-field-grid';
22
+ import type { BaseFieldProps } from './types';
23
+ export interface SwitchProps extends BaseFieldProps {
24
+ onText?: string;
25
+ offText?: string;
26
+ /**
27
+ * Offer the reset-to-unset affordance (AGL-2486). A switch can only be on or
28
+ * off, so without it a field whose unset state means something — a page
29
+ * handing the choice back to its component's default — has no way back.
30
+ */
31
+ clearable?: boolean;
32
+ /**
33
+ * The position shown while nothing is stored — the default a page falls
34
+ * back to. Without it an unset switch reads as off, which is wrong wherever
35
+ * the value that applies is on.
36
+ */
37
+ unsetChecked?: boolean;
38
+ FormFieldGridProps?: FormFieldGridProps;
39
+ FormControlProps?: FormControlProps;
40
+ FormGroupProps?: FormGroupProps;
41
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
42
+ SwitchProps?: MuiSwitchProps;
43
+ FormLabelProps?: FormLabelProps;
44
+ FormHelperTextProps?: FormHelperTextProps;
45
+ }
46
+ export declare const Switch: (props: SwitchProps) => import("react").JSX.Element;
47
+ export default Switch;
@@ -0,0 +1,93 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2026 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ /**
20
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0).
21
+ */ import { FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Switch as MuiSwitch } from "@mui/material";
22
+ import { useFieldApi } from "../vendor/data-driven-forms.js";
23
+ import { useStoredFieldHasValue } from "./stored-field-value.js";
24
+ import FormFieldGrid, { buildFieldClear } from "./form-field-grid.js";
25
+ import { validationError } from "./validation-error.js";
26
+ export const Switch = (props)=>{
27
+ const _useFieldApi = useFieldApi(_extends({}, props, {
28
+ type: 'checkbox'
29
+ })), { input, isReadOnly, isDisabled, isRequired, label, helperText, description, validateOnMount, meta, onText, offText, help, clearable, unsetChecked, FormFieldGridProps = {}, FormControlProps = {}, FormGroupProps = {}, FormControlLabelProps = {}, SwitchProps = {}, FormLabelProps = {}, FormHelperTextProps = {} } = _useFieldApi, rest = _object_without_properties_loose(_useFieldApi, [
30
+ "input",
31
+ "isReadOnly",
32
+ "isDisabled",
33
+ "isRequired",
34
+ "label",
35
+ "helperText",
36
+ "description",
37
+ "validateOnMount",
38
+ "meta",
39
+ "onText",
40
+ "offText",
41
+ "help",
42
+ "clearable",
43
+ "unsetChecked",
44
+ "FormFieldGridProps",
45
+ "FormControlProps",
46
+ "FormGroupProps",
47
+ "FormControlLabelProps",
48
+ "SwitchProps",
49
+ "FormLabelProps",
50
+ "FormHelperTextProps"
51
+ ]);
52
+ const invalid = validationError(meta, validateOnMount);
53
+ const text = invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description;
54
+ const hasValue = useStoredFieldHasValue(input.name);
55
+ const clear = buildFieldClear({
56
+ clearable,
57
+ label,
58
+ hasValue,
59
+ locked: Boolean(isDisabled || isReadOnly),
60
+ onClear: ()=>input.onChange(undefined)
61
+ });
62
+ return /*#__PURE__*/ _jsx(FormFieldGrid, _extends({
63
+ help: help,
64
+ clear: clear
65
+ }, FormFieldGridProps, {
66
+ children: /*#__PURE__*/ _jsx(FormControl, _extends({
67
+ required: isRequired,
68
+ error: !!invalid,
69
+ component: "fieldset"
70
+ }, FormControlProps, {
71
+ children: /*#__PURE__*/ _jsxs(FormGroup, _extends({}, FormGroupProps, {
72
+ children: [
73
+ /*#__PURE__*/ _jsx(FormControlLabel, _extends({
74
+ control: /*#__PURE__*/ _jsx(MuiSwitch, _extends({}, rest, input, {
75
+ checked: hasValue ? input.checked : Boolean(unsetChecked),
76
+ disabled: isDisabled || isReadOnly,
77
+ onChange: ({ target: { checked } })=>input.onChange(checked)
78
+ }, SwitchProps)),
79
+ label: /*#__PURE__*/ _jsx(FormLabel, _extends({}, FormLabelProps, {
80
+ children: (hasValue ? input.checked : unsetChecked) ? onText || label : offText || label
81
+ }))
82
+ }, FormControlLabelProps)),
83
+ text && /*#__PURE__*/ _jsx(FormHelperText, _extends({}, FormHelperTextProps, {
84
+ children: text
85
+ }))
86
+ ]
87
+ }))
88
+ }))
89
+ }));
90
+ };
91
+ export default Switch;
92
+
93
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/switch.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0).\n */\n\nimport {\n FormControl,\n type FormControlLabelProps,\n FormControlLabel,\n type FormControlProps,\n FormGroup,\n type FormGroupProps,\n FormHelperText,\n type FormHelperTextProps,\n FormLabel,\n type FormLabelProps,\n Switch as MuiSwitch,\n type SwitchProps as MuiSwitchProps,\n} from '@mui/material'\n\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport { useStoredFieldHasValue } from './stored-field-value'\nimport FormFieldGrid, {\n buildFieldClear,\n type FormFieldGridProps,\n} from './form-field-grid'\nimport type { BaseFieldProps } from './types'\nimport { type ExtendedFieldMeta, validationError } from './validation-error'\n\nexport interface SwitchProps extends BaseFieldProps {\n onText?: string\n offText?: string\n /**\n * Offer the reset-to-unset affordance (AGL-2486). A switch can only be on or\n * off, so without it a field whose unset state means something — a page\n * handing the choice back to its component's default — has no way back.\n */\n clearable?: boolean\n /**\n * The position shown while nothing is stored — the default a page falls\n * back to. Without it an unset switch reads as off, which is wrong wherever\n * the value that applies is on.\n */\n unsetChecked?: boolean\n FormFieldGridProps?: FormFieldGridProps\n FormControlProps?: FormControlProps\n FormGroupProps?: FormGroupProps\n FormControlLabelProps?: Partial<FormControlLabelProps>\n SwitchProps?: MuiSwitchProps\n FormLabelProps?: FormLabelProps\n FormHelperTextProps?: FormHelperTextProps\n}\n\nexport const Switch = (props: SwitchProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n isRequired,\n label,\n helperText,\n description,\n validateOnMount,\n meta,\n onText,\n offText,\n help,\n clearable,\n unsetChecked,\n FormFieldGridProps = {},\n FormControlProps = {},\n FormGroupProps = {},\n FormControlLabelProps = {},\n SwitchProps = {},\n FormLabelProps = {},\n FormHelperTextProps = {},\n ...rest\n } = useFieldApi({\n ...props,\n type: 'checkbox',\n })\n\n const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount)\n const text =\n invalid ||\n ((meta.touched || validateOnMount) && meta.warning) ||\n helperText ||\n description\n const hasValue = useStoredFieldHasValue(input.name)\n const clear = buildFieldClear({\n clearable,\n label,\n hasValue,\n locked: Boolean(isDisabled || isReadOnly),\n onClear: () => input.onChange(undefined),\n })\n\n return (\n <FormFieldGrid help={help} clear={clear} {...FormFieldGridProps}>\n <FormControl\n required={isRequired}\n error={!!invalid}\n component=\"fieldset\"\n {...FormControlProps}\n >\n <FormGroup {...FormGroupProps}>\n <FormControlLabel\n control={\n <MuiSwitch\n {...rest}\n {...input}\n checked={hasValue ? input.checked : Boolean(unsetChecked)}\n disabled={isDisabled || isReadOnly}\n onChange={({ target: { checked } }) => input.onChange(checked)}\n {...SwitchProps}\n />\n }\n label={\n <FormLabel {...FormLabelProps}>\n {(hasValue ? input.checked : unsetChecked)\n ? onText || label\n : offText || label}\n </FormLabel>\n }\n {...FormControlLabelProps}\n />\n {text && (\n <FormHelperText {...FormHelperTextProps}>{text}</FormHelperText>\n )}\n </FormGroup>\n </FormControl>\n </FormFieldGrid>\n )\n}\n\nexport default Switch\n"],"names":["FormControl","FormControlLabel","FormGroup","FormHelperText","FormLabel","Switch","MuiSwitch","useFieldApi","useStoredFieldHasValue","FormFieldGrid","buildFieldClear","validationError","props","type","input","isReadOnly","isDisabled","isRequired","label","helperText","description","validateOnMount","meta","onText","offText","help","clearable","unsetChecked","FormFieldGridProps","FormControlProps","FormGroupProps","FormControlLabelProps","SwitchProps","FormLabelProps","FormHelperTextProps","rest","invalid","text","touched","warning","hasValue","name","clear","locked","Boolean","onClear","onChange","undefined","required","error","component","control","checked","disabled","target"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;CAEC,GAED,SACEA,WAAW,EAEXC,gBAAgB,EAEhBC,SAAS,EAETC,cAAc,EAEdC,SAAS,EAETC,UAAUC,SAAS,QAEd,gBAAe;AAEtB,SAASC,WAAW,QAAQ,iCAA6B;AACzD,SAASC,sBAAsB,QAAQ,0BAAsB;AAC7D,OAAOC,iBACLC,eAAe,QAEV,uBAAmB;AAE1B,SAAiCC,eAAe,QAAQ,wBAAoB;AA0B5E,OAAO,MAAMN,SAAS,CAACO;IACrB,MAuBIL,eAAAA,YAAY,aACXK;QACHC,MAAM;SAzBF,EACJC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,eAAe,EACfC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,qBAAqB,CAAC,CAAC,EACvBC,mBAAmB,CAAC,CAAC,EACrBC,iBAAiB,CAAC,CAAC,EACnBC,wBAAwB,CAAC,CAAC,EAC1BC,cAAc,CAAC,CAAC,EAChBC,iBAAiB,CAAC,CAAC,EACnBC,sBAAsB,CAAC,CAAC,EAEzB,GAAG3B,cADC4B,wCACD5B;;;;;;;;;;;;;;;;;;;;;;;IAKJ,MAAM6B,UAAUzB,gBAAgBW,MAA2BD;IAC3D,MAAMgB,OACJD,WACC,AAACd,CAAAA,KAAKgB,OAAO,IAAIjB,eAAc,KAAMC,KAAKiB,OAAO,IAClDpB,cACAC;IACF,MAAMoB,WAAWhC,uBAAuBM,MAAM2B,IAAI;IAClD,MAAMC,QAAQhC,gBAAgB;QAC5BgB;QACAR;QACAsB;QACAG,QAAQC,QAAQ5B,cAAcD;QAC9B8B,SAAS,IAAM/B,MAAMgC,QAAQ,CAACC;IAChC;IAEA,qBACE,KAACtC;QAAcgB,MAAMA;QAAMiB,OAAOA;OAAWd;kBAC3C,cAAA,KAAC5B;YACCgD,UAAU/B;YACVgC,OAAO,CAAC,CAACb;YACTc,WAAU;WACNrB;sBAEJ,cAAA,MAAC3B,wBAAc4B;;kCACb,KAAC7B;wBACCkD,uBACE,KAAC7C,wBACK6B,MACArB;4BACJsC,SAASZ,WAAW1B,MAAMsC,OAAO,GAAGR,QAAQjB;4BAC5C0B,UAAUrC,cAAcD;4BACxB+B,UAAU,CAAC,EAAEQ,QAAQ,EAAEF,OAAO,EAAE,EAAE,GAAKtC,MAAMgC,QAAQ,CAACM;2BAClDpB;wBAGRd,qBACE,KAACd,wBAAc6B;sCACZ,AAACO,CAAAA,WAAW1B,MAAMsC,OAAO,GAAGzB,YAAW,IACpCJ,UAAUL,QACVM,WAAWN;;uBAGfa;oBAELM,sBACC,KAAClC,6BAAmB+B;kCAAsBG;;;;;;AAMtD,EAAC;AAED,eAAehC,OAAM"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type AppBarProps, type GridProps, type TabProps as MuiTabProps, type TabsProps } from '@mui/material';
18
+ import { type FieldSchema } from '../vendor/data-driven-forms';
19
+ import { type FormFieldGridProps } from './form-field-grid';
20
+ interface TabField {
21
+ fields: FieldSchema[];
22
+ title?: string;
23
+ name?: string;
24
+ }
25
+ export interface FormTabsProps {
26
+ fields: TabField[];
27
+ AppBarProps?: AppBarProps;
28
+ TabsProps?: TabsProps;
29
+ TabProps?: MuiTabProps;
30
+ FormFieldGridProps?: FormFieldGridProps;
31
+ GridItemProps?: GridProps;
32
+ }
33
+ export declare const FormTabs: ({ fields, AppBarProps, TabsProps, TabProps, FormFieldGridProps, GridItemProps, }: FormTabsProps) => import("react").JSX.Element;
34
+ export default FormTabs;
@@ -0,0 +1,64 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * @license
5
+ * Copyright 2026 Aglyn LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */ /**
19
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and
20
+ * updated for the current MUI Grid API.
21
+ */ import { useState } from "react";
22
+ import { AppBar, Grid, Tab, Tabs } from "@mui/material";
23
+ import { useFormApi } from "../vendor/data-driven-forms.js";
24
+ import FormFieldGrid from "./form-field-grid.js";
25
+ export const FormTabs = ({ fields, AppBarProps = {}, TabsProps = {}, TabProps = {}, FormFieldGridProps = {}, GridItemProps = {} })=>{
26
+ const formOptions = useFormApi();
27
+ const [activeTab, setActiveTab] = useState(0);
28
+ return /*#__PURE__*/ _jsxs(FormFieldGrid, _extends({
29
+ container: true
30
+ }, FormFieldGridProps, {
31
+ children: [
32
+ /*#__PURE__*/ _jsx(AppBar, _extends({
33
+ position: "static"
34
+ }, AppBarProps, {
35
+ children: /*#__PURE__*/ _jsx(Tabs, _extends({
36
+ textColor: "inherit",
37
+ value: activeTab,
38
+ onChange: (_e, tabIndex)=>setActiveTab(tabIndex)
39
+ }, TabsProps, {
40
+ children: fields.map(({ title, name }, index)=>/*#__PURE__*/ _jsx(Tab, _extends({
41
+ label: title
42
+ }, TabProps), name || index))
43
+ }))
44
+ })),
45
+ fields.map(({ fields, name }, index)=>/*#__PURE__*/ _jsx(Grid, _extends({
46
+ container: true,
47
+ size: {
48
+ xs: 12
49
+ },
50
+ rowSpacing: 2,
51
+ sx: _extends({
52
+ mt: 1
53
+ }, index !== activeTab && {
54
+ display: 'none'
55
+ })
56
+ }, GridItemProps, {
57
+ children: formOptions.renderForm(fields)
58
+ }), name || index))
59
+ ]
60
+ }));
61
+ };
62
+ export default FormTabs;
63
+
64
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/tabs.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and\n * updated for the current MUI Grid API.\n */\n\nimport { useState } from 'react'\n\nimport {\n AppBar,\n type AppBarProps,\n Grid,\n type GridProps,\n Tab,\n type TabProps as MuiTabProps,\n Tabs,\n type TabsProps,\n} from '@mui/material'\n\nimport { type FieldSchema, useFormApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, { type FormFieldGridProps } from './form-field-grid'\n\ninterface TabField {\n fields: FieldSchema[]\n title?: string\n name?: string\n}\n\nexport interface FormTabsProps {\n fields: TabField[]\n AppBarProps?: AppBarProps\n TabsProps?: TabsProps\n TabProps?: MuiTabProps\n FormFieldGridProps?: FormFieldGridProps\n GridItemProps?: GridProps\n}\n\nexport const FormTabs = ({\n fields,\n AppBarProps = {},\n TabsProps = {},\n TabProps = {},\n FormFieldGridProps = {},\n GridItemProps = {},\n}: FormTabsProps) => {\n const formOptions = useFormApi()\n const [activeTab, setActiveTab] = useState(0)\n\n return (\n <FormFieldGrid container {...FormFieldGridProps}>\n <AppBar position=\"static\" {...AppBarProps}>\n <Tabs\n textColor=\"inherit\"\n value={activeTab}\n onChange={(_e, tabIndex) => setActiveTab(tabIndex)}\n {...TabsProps}\n >\n {fields.map(({ title, name }, index) => (\n <Tab key={name || index} label={title} {...TabProps} />\n ))}\n </Tabs>\n </AppBar>\n {fields.map(({ fields, name }, index) => (\n <Grid\n key={name || index}\n container\n size={{ xs: 12 }}\n rowSpacing={2}\n sx={{ mt: 1, ...(index !== activeTab && { display: 'none' }) }}\n {...GridItemProps}\n >\n {formOptions.renderForm(fields)}\n </Grid>\n ))}\n </FormFieldGrid>\n )\n}\n\nexport default FormTabs\n"],"names":["useState","AppBar","Grid","Tab","Tabs","useFormApi","FormFieldGrid","FormTabs","fields","AppBarProps","TabsProps","TabProps","FormFieldGridProps","GridItemProps","formOptions","activeTab","setActiveTab","container","position","textColor","value","onChange","_e","tabIndex","map","title","name","index","label","size","xs","rowSpacing","sx","mt","display","renderForm"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;CAGC,GAED,SAASA,QAAQ,QAAQ,QAAO;AAEhC,SACEC,MAAM,EAENC,IAAI,EAEJC,GAAG,EAEHC,IAAI,QAEC,gBAAe;AAEtB,SAA2BC,UAAU,QAAQ,iCAA6B;AAC1E,OAAOC,mBAAgD,uBAAmB;AAiB1E,OAAO,MAAMC,WAAW,CAAC,EACvBC,MAAM,EACNC,cAAc,CAAC,CAAC,EAChBC,YAAY,CAAC,CAAC,EACdC,WAAW,CAAC,CAAC,EACbC,qBAAqB,CAAC,CAAC,EACvBC,gBAAgB,CAAC,CAAC,EACJ;IACd,MAAMC,cAAcT;IACpB,MAAM,CAACU,WAAWC,aAAa,GAAGhB,SAAS;IAE3C,qBACE,MAACM;QAAcW,SAAS;OAAKL;;0BAC3B,KAACX;gBAAOiB,UAAS;eAAaT;0BAC5B,cAAA,KAACL;oBACCe,WAAU;oBACVC,OAAOL;oBACPM,UAAU,CAACC,IAAIC,WAAaP,aAAaO;mBACrCb;8BAEHF,OAAOgB,GAAG,CAAC,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAEC,sBAC5B,KAACxB;4BAAwByB,OAAOH;2BAAWd,WAAjCe,QAAQC;;;YAIvBnB,OAAOgB,GAAG,CAAC,CAAC,EAAEhB,MAAM,EAAEkB,IAAI,EAAE,EAAEC,sBAC7B,KAACzB;oBAECe,SAAS;oBACTY,MAAM;wBAAEC,IAAI;oBAAG;oBACfC,YAAY;oBACZC,IAAI;wBAAEC,IAAI;uBAAON,UAAUZ,aAAa;wBAAEmB,SAAS;oBAAO;mBACtDrB;8BAEHC,YAAYqB,UAAU,CAAC3B;oBAPnBkB,QAAQC;;;AAYvB,EAAC;AAED,eAAepB,SAAQ"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type FormFieldGridProps } from './form-field-grid';
18
+ import type { BaseFieldProps } from './types';
19
+ export interface TextFieldProps extends BaseFieldProps {
20
+ placeholder?: string;
21
+ /** Offer the reset-to-unset affordance (AGL-2486). */
22
+ clearable?: boolean;
23
+ inputProps?: Record<string, any>;
24
+ /**
25
+ * Props for the MUI Input slot (adornments, etc.). Kept under the legacy
26
+ * `InputProps` name because schemas author it that way via `resolveProps`;
27
+ * routed into `slotProps.input` here so it never reaches the DOM.
28
+ */
29
+ InputProps?: Record<string, any>;
30
+ FormFieldGridProps?: FormFieldGridProps;
31
+ }
32
+ export declare const TextField: (props: TextFieldProps) => import("react").JSX.Element;
33
+ export default TextField;
@@ -0,0 +1,88 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2026 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ /**
20
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and
21
+ * updated for the current MUI API (`slotProps` instead of `inputProps`).
22
+ */ import { TextField as MuiTextField } from "@mui/material";
23
+ import { useFieldApi } from "../vendor/data-driven-forms.js";
24
+ import FormFieldGrid, { buildFieldClear } from "./form-field-grid.js";
25
+ import { validationError } from "./validation-error.js";
26
+ export const TextField = (props)=>{
27
+ const _useFieldApi = useFieldApi(props), { input, isReadOnly, isDisabled, placeholder, isRequired, label, helperText, description, validateOnMount, meta, inputProps, InputProps, help, clearable, FormFieldGridProps = {}, type } = _useFieldApi, rest = _object_without_properties_loose(_useFieldApi, [
28
+ "input",
29
+ "isReadOnly",
30
+ "isDisabled",
31
+ "placeholder",
32
+ "isRequired",
33
+ "label",
34
+ "helperText",
35
+ "description",
36
+ "validateOnMount",
37
+ "meta",
38
+ "inputProps",
39
+ "InputProps",
40
+ "help",
41
+ "clearable",
42
+ "FormFieldGridProps",
43
+ "type"
44
+ ]);
45
+ const invalid = validationError(meta, validateOnMount);
46
+ // A date, time or color input paints its own placeholder whether or not it
47
+ // holds a value, so a floating label would sit on top of `mm/dd/yyyy` — the
48
+ // same rule the classic text field applies (AGL-2486).
49
+ const alwaysFilled = type === 'date' || type === 'time' || type === 'datetime-local' || type === 'month' || type === 'week' || type === 'color';
50
+ // `!== ''` and friends spelled out: `0` is a value an author typed and
51
+ // this repo has `strictNullChecks` off, so a falsy test would hide the
52
+ // clear button on it (AGL-2486).
53
+ const clear = buildFieldClear({
54
+ clearable,
55
+ label,
56
+ hasValue: input.value !== '' && input.value !== undefined && input.value !== null,
57
+ locked: Boolean(isDisabled || isReadOnly),
58
+ onClear: ()=>input.onChange('')
59
+ });
60
+ return /*#__PURE__*/ _jsx(FormFieldGrid, _extends({
61
+ help: help,
62
+ clear: clear
63
+ }, FormFieldGridProps, {
64
+ children: /*#__PURE__*/ _jsx(MuiTextField, _extends({}, input, {
65
+ fullWidth: true,
66
+ error: !!invalid,
67
+ helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
68
+ disabled: isDisabled,
69
+ label: label,
70
+ placeholder: placeholder,
71
+ required: isRequired,
72
+ type: type,
73
+ slotProps: _extends({
74
+ input: _extends({
75
+ readOnly: isReadOnly
76
+ }, InputProps),
77
+ htmlInput: _extends({}, inputProps)
78
+ }, alwaysFilled ? {
79
+ inputLabel: {
80
+ shrink: true
81
+ }
82
+ } : {})
83
+ }, rest))
84
+ }));
85
+ };
86
+ export default TextField;
87
+
88
+ //# sourceMappingURL=text-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/text-field.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and\n * updated for the current MUI API (`slotProps` instead of `inputProps`).\n */\n\nimport { TextField as MuiTextField } from '@mui/material'\n\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, {\n buildFieldClear,\n type FormFieldGridProps,\n} from './form-field-grid'\nimport type { BaseFieldProps } from './types'\nimport { type ExtendedFieldMeta, validationError } from './validation-error'\n\nexport interface TextFieldProps extends BaseFieldProps {\n placeholder?: string\n /** Offer the reset-to-unset affordance (AGL-2486). */\n clearable?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n inputProps?: Record<string, any>\n /**\n * Props for the MUI Input slot (adornments, etc.). Kept under the legacy\n * `InputProps` name because schemas author it that way via `resolveProps`;\n * routed into `slotProps.input` here so it never reaches the DOM.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n InputProps?: Record<string, any>\n FormFieldGridProps?: FormFieldGridProps\n}\n\nexport const TextField = (props: TextFieldProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n placeholder,\n isRequired,\n label,\n helperText,\n description,\n validateOnMount,\n meta,\n inputProps,\n InputProps,\n help,\n clearable,\n FormFieldGridProps = {},\n type,\n ...rest\n } = useFieldApi(props)\n const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount)\n // A date, time or color input paints its own placeholder whether or not it\n // holds a value, so a floating label would sit on top of `mm/dd/yyyy` — the\n // same rule the classic text field applies (AGL-2486).\n const alwaysFilled =\n type === 'date' ||\n type === 'time' ||\n type === 'datetime-local' ||\n type === 'month' ||\n type === 'week' ||\n type === 'color'\n // `!== ''` and friends spelled out: `0` is a value an author typed and\n // this repo has `strictNullChecks` off, so a falsy test would hide the\n // clear button on it (AGL-2486).\n const clear = buildFieldClear({\n clearable,\n label,\n hasValue:\n input.value !== '' && input.value !== undefined && input.value !== null,\n locked: Boolean(isDisabled || isReadOnly),\n onClear: () => input.onChange(''),\n })\n\n return (\n <FormFieldGrid help={help} clear={clear} {...FormFieldGridProps}>\n <MuiTextField\n {...input}\n fullWidth\n error={!!invalid}\n helperText={\n invalid ||\n ((meta.touched || validateOnMount) && meta.warning) ||\n helperText ||\n description\n }\n disabled={isDisabled}\n label={label}\n placeholder={placeholder}\n required={isRequired}\n type={type}\n slotProps={{\n input: { readOnly: isReadOnly, ...InputProps },\n htmlInput: { ...inputProps },\n ...(alwaysFilled ? { inputLabel: { shrink: true } } : {}),\n }}\n {...rest}\n />\n </FormFieldGrid>\n )\n}\n\nexport default TextField\n"],"names":["TextField","MuiTextField","useFieldApi","FormFieldGrid","buildFieldClear","validationError","props","input","isReadOnly","isDisabled","placeholder","isRequired","label","helperText","description","validateOnMount","meta","inputProps","InputProps","help","clearable","FormFieldGridProps","type","rest","invalid","alwaysFilled","clear","hasValue","value","undefined","locked","Boolean","onClear","onChange","fullWidth","error","touched","warning","disabled","required","slotProps","readOnly","htmlInput","inputLabel","shrink"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;CAGC,GAED,SAASA,aAAaC,YAAY,QAAQ,gBAAe;AAEzD,SAASC,WAAW,QAAQ,iCAA6B;AACzD,OAAOC,iBACLC,eAAe,QAEV,uBAAmB;AAE1B,SAAiCC,eAAe,QAAQ,wBAAoB;AAkB5E,OAAO,MAAML,YAAY,CAACM;IACxB,MAkBIJ,eAAAA,YAAYI,QAlBV,EACJC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,eAAe,EACfC,IAAI,EACJC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,qBAAqB,CAAC,CAAC,EACvBC,IAAI,EAEL,GAAGpB,cADCqB,wCACDrB;;;;;;;;;;;;;;;;;;IACJ,MAAMsB,UAAUnB,gBAAgBW,MAA2BD;IAC3D,2EAA2E;IAC3E,4EAA4E;IAC5E,uDAAuD;IACvD,MAAMU,eACJH,SAAS,UACTA,SAAS,UACTA,SAAS,oBACTA,SAAS,WACTA,SAAS,UACTA,SAAS;IACX,uEAAuE;IACvE,uEAAuE;IACvE,iCAAiC;IACjC,MAAMI,QAAQtB,gBAAgB;QAC5BgB;QACAR;QACAe,UACEpB,MAAMqB,KAAK,KAAK,MAAMrB,MAAMqB,KAAK,KAAKC,aAAatB,MAAMqB,KAAK,KAAK;QACrEE,QAAQC,QAAQtB,cAAcD;QAC9BwB,SAAS,IAAMzB,MAAM0B,QAAQ,CAAC;IAChC;IAEA,qBACE,KAAC9B;QAAcgB,MAAMA;QAAMO,OAAOA;OAAWL;kBAC3C,cAAA,KAACpB,2BACKM;YACJ2B,SAAS;YACTC,OAAO,CAAC,CAACX;YACTX,YACEW,WACC,AAACR,CAAAA,KAAKoB,OAAO,IAAIrB,eAAc,KAAMC,KAAKqB,OAAO,IAClDxB,cACAC;YAEFwB,UAAU7B;YACVG,OAAOA;YACPF,aAAaA;YACb6B,UAAU5B;YACVW,MAAMA;YACNkB,WAAW;gBACTjC,OAAO;oBAAEkC,UAAUjC;mBAAeU;gBAClCwB,WAAW,aAAKzB;eACZQ,eAAe;gBAAEkB,YAAY;oBAAEC,QAAQ;gBAAK;YAAE,IAAI,CAAC;WAErDrB;;AAIZ,EAAC;AAED,eAAevB,UAAS"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and
19
+ * updated for the current MUI API (`slotProps` instead of `inputProps`).
20
+ */
21
+ import { type TextFieldProps as MuiTextFieldProps } from '@mui/material';
22
+ import { type FormFieldGridProps } from './form-field-grid';
23
+ import type { BaseFieldProps } from './types';
24
+ export interface TextareaProps extends BaseFieldProps {
25
+ placeholder?: string;
26
+ inputProps?: Record<string, any>;
27
+ FormFieldGridProps?: FormFieldGridProps;
28
+ TextFieldProps?: Omit<MuiTextFieldProps, 'name' | 'value' | 'onChange' | 'onBlur' | 'onFocus'>;
29
+ }
30
+ export declare const Textarea: (props: TextareaProps) => import("react").JSX.Element;
31
+ export default Textarea;
@@ -0,0 +1,68 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2026 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ /**
20
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and
21
+ * updated for the current MUI API (`slotProps` instead of `inputProps`).
22
+ */ import { TextField as MuiTextField } from "@mui/material";
23
+ import { useFieldApi } from "../vendor/data-driven-forms.js";
24
+ import FormFieldGrid from "./form-field-grid.js";
25
+ import { validationError } from "./validation-error.js";
26
+ export const Textarea = (props)=>{
27
+ const _useFieldApi = useFieldApi(props), { input, isReadOnly, isDisabled, placeholder, isRequired, label, helperText, description, validateOnMount, meta, help, FormFieldGridProps = {}, inputProps = {}, TextFieldProps = {} } = _useFieldApi, rest = _object_without_properties_loose(_useFieldApi, [
28
+ "input",
29
+ "isReadOnly",
30
+ "isDisabled",
31
+ "placeholder",
32
+ "isRequired",
33
+ "label",
34
+ "helperText",
35
+ "description",
36
+ "validateOnMount",
37
+ "meta",
38
+ "help",
39
+ "FormFieldGridProps",
40
+ "inputProps",
41
+ "TextFieldProps"
42
+ ]);
43
+ const invalid = validationError(meta, validateOnMount);
44
+ return /*#__PURE__*/ _jsx(FormFieldGrid, _extends({
45
+ help: help
46
+ }, FormFieldGridProps, {
47
+ children: /*#__PURE__*/ _jsx(MuiTextField, _extends({}, input, {
48
+ fullWidth: true,
49
+ error: !!invalid,
50
+ helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
51
+ disabled: isDisabled,
52
+ label: label,
53
+ placeholder: placeholder,
54
+ required: isRequired,
55
+ slotProps: {
56
+ input: {
57
+ readOnly: isReadOnly
58
+ },
59
+ htmlInput: _extends({}, inputProps)
60
+ }
61
+ }, TextFieldProps, rest, {
62
+ multiline: true
63
+ }))
64
+ }));
65
+ };
66
+ export default Textarea;
67
+
68
+ //# sourceMappingURL=textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/textarea.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and\n * updated for the current MUI API (`slotProps` instead of `inputProps`).\n */\n\nimport {\n TextField as MuiTextField,\n type TextFieldProps as MuiTextFieldProps,\n} from '@mui/material'\n\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, { type FormFieldGridProps } from './form-field-grid'\nimport type { BaseFieldProps } from './types'\nimport { type ExtendedFieldMeta, validationError } from './validation-error'\n\nexport interface TextareaProps extends BaseFieldProps {\n placeholder?: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n inputProps?: Record<string, any>\n FormFieldGridProps?: FormFieldGridProps\n TextFieldProps?: Omit<\n MuiTextFieldProps,\n 'name' | 'value' | 'onChange' | 'onBlur' | 'onFocus'\n >\n}\n\nexport const Textarea = (props: TextareaProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n placeholder,\n isRequired,\n label,\n helperText,\n description,\n validateOnMount,\n meta,\n help,\n FormFieldGridProps = {},\n inputProps = {},\n TextFieldProps = {},\n ...rest\n } = useFieldApi(props)\n\n const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount)\n\n return (\n <FormFieldGrid help={help} {...FormFieldGridProps}>\n <MuiTextField\n {...input}\n fullWidth\n error={!!invalid}\n helperText={\n invalid ||\n ((meta.touched || validateOnMount) && meta.warning) ||\n helperText ||\n description\n }\n disabled={isDisabled}\n label={label}\n placeholder={placeholder}\n required={isRequired}\n slotProps={{\n input: { readOnly: isReadOnly },\n htmlInput: { ...inputProps },\n }}\n {...TextFieldProps}\n {...rest}\n multiline\n />\n </FormFieldGrid>\n )\n}\n\nexport default Textarea\n"],"names":["TextField","MuiTextField","useFieldApi","FormFieldGrid","validationError","Textarea","props","input","isReadOnly","isDisabled","placeholder","isRequired","label","helperText","description","validateOnMount","meta","help","FormFieldGridProps","inputProps","TextFieldProps","rest","invalid","fullWidth","error","touched","warning","disabled","required","slotProps","readOnly","htmlInput","multiline"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;CAGC,GAED,SACEA,aAAaC,YAAY,QAEpB,gBAAe;AAEtB,SAASC,WAAW,QAAQ,iCAA6B;AACzD,OAAOC,mBAAgD,uBAAmB;AAE1E,SAAiCC,eAAe,QAAQ,wBAAoB;AAa5E,OAAO,MAAMC,WAAW,CAACC;IACvB,MAgBIJ,eAAAA,YAAYI,QAhBV,EACJC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,eAAe,EACfC,IAAI,EACJC,IAAI,EACJC,qBAAqB,CAAC,CAAC,EACvBC,aAAa,CAAC,CAAC,EACfC,iBAAiB,CAAC,CAAC,EAEpB,GAAGlB,cADCmB,wCACDnB;;;;;;;;;;;;;;;;IAEJ,MAAMoB,UAAUlB,gBAAgBY,MAA2BD;IAE3D,qBACE,KAACZ;QAAcc,MAAMA;OAAUC;kBAC7B,cAAA,KAACjB,2BACKM;YACJgB,SAAS;YACTC,OAAO,CAAC,CAACF;YACTT,YACES,WACC,AAACN,CAAAA,KAAKS,OAAO,IAAIV,eAAc,KAAMC,KAAKU,OAAO,IAClDb,cACAC;YAEFa,UAAUlB;YACVG,OAAOA;YACPF,aAAaA;YACbkB,UAAUjB;YACVkB,WAAW;gBACTtB,OAAO;oBAAEuB,UAAUtB;gBAAW;gBAC9BuB,WAAW,aAAKZ;YAClB;WACIC,gBACAC;YACJW,SAAS;;;AAIjB,EAAC;AAED,eAAe3B,SAAQ"}