@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,60 @@
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, OptionValue, SelectOption } from './types';
19
+ export interface SelectProps<T = OptionValue> extends BaseFieldProps {
20
+ options?: SelectOption<T>[];
21
+ loadOptions?: (inputValue: string) => Promise<SelectOption<T>[]>;
22
+ isSearchable?: boolean;
23
+ isMulti?: boolean;
24
+ multiple?: boolean;
25
+ isClearable?: boolean;
26
+ disableClearable?: boolean;
27
+ hideSelectedOptions?: boolean;
28
+ closeMenuOnSelect?: boolean;
29
+ isFetching?: boolean;
30
+ noOptionsMessage?: () => string;
31
+ noOptionsText?: () => string;
32
+ loadingMessage?: string;
33
+ loadingText?: string;
34
+ placeholder?: string;
35
+ /** Offer the reset-to-unset affordance (AGL-2486). */
36
+ clearable?: boolean;
37
+ FormFieldGridProps?: FormFieldGridProps;
38
+ TextFieldProps?: Record<string, any>;
39
+ inputProps?: Record<string, any>;
40
+ onInputChange?: (value: string, reason?: string) => void;
41
+ /**
42
+ * A schema field's own hook on the search box, beside DDF's.
43
+ *
44
+ * `onInputChange` cannot be one. `@data-driven-forms/common/select` owns
45
+ * that prop for its `loadOptions` support and assigns it AFTER spreading the
46
+ * field's props, so a handler declared on a schema field is overwritten
47
+ * before it reaches this component — silently, since a dropdown with a
48
+ * dropped handler still opens, still filters and still selects. A field
49
+ * whose typing was supposed to fetch more simply fetches nothing.
50
+ *
51
+ * This name is not taken, so it survives the spread. Both are called.
52
+ */
53
+ onSearchInput?: (value: string, reason?: string) => void;
54
+ }
55
+ /** Returns label of the selected option. */
56
+ export declare function getOptionLabel<T = OptionValue>(option: T | SelectOption<T> | undefined, options: SelectOption<T>[]): string;
57
+ /** Creates the DDF select value format. */
58
+ export declare function createValue<T = OptionValue>(option: T | SelectOption<T> | (T | SelectOption<T>)[] | null, isMulti: boolean): T | SelectOption<T> | (T | SelectOption<T>)[] | null | undefined;
59
+ export declare function Select<T = OptionValue>(props: SelectProps<T>): import("react").JSX.Element;
60
+ export default Select;
@@ -0,0 +1,203 @@
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`-shaped Autocomplete
22
+ * `renderInput` params instead of `inputProps`).
23
+ */ import { useMemo } from "react";
24
+ import { Autocomplete, CircularProgress, TextField } from "@mui/material";
25
+ import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
26
+ import DDFSelectImport from "@data-driven-forms/common/select";
27
+ import parseInternalValue from "@data-driven-forms/common/select/parse-internal-value";
28
+ import { useFieldApi } from "../vendor/data-driven-forms.js";
29
+ import FormFieldGrid, { buildFieldClear } from "./form-field-grid.js";
30
+ import { validationError } from "./validation-error.js";
31
+ /** Returns label of the selected option. */ export function getOptionLabel(option, options) {
32
+ if (typeof option === 'undefined') {
33
+ return '';
34
+ }
35
+ if (option === '') {
36
+ return '';
37
+ }
38
+ if (Array.isArray(option) && option.length === 0) {
39
+ return '';
40
+ }
41
+ if (typeof option === 'object' && option !== null) {
42
+ return String(option.label);
43
+ }
44
+ const item = options.find(({ value })=>value === option);
45
+ return item && String(item.label) || '';
46
+ }
47
+ /** Creates the DDF select value format. */ export function createValue(option, isMulti) {
48
+ if (isMulti) {
49
+ return Array.isArray(option) ? option.map((item)=>typeof item === 'object' ? item : {
50
+ value: item
51
+ }) : option;
52
+ }
53
+ return option;
54
+ }
55
+ function InternalSelect(_0) {
56
+ let { value, options, label, helperText, validateOnMount, meta, isSearchable, description, isMulti, placeholder = 'Please choose', onInputChange, onSearchInput, isFetching, noOptionsMessage, hideSelectedOptions, closeMenuOnSelect: _closeMenuOnSelect, required, onChange, onFocus, onBlur, help, FormFieldGridProps = {}, TextFieldProps: _ref = {} } = _0, { inputProps: textFieldInputProps } = _ref, TextFieldProps = _object_without_properties_loose(_ref, [
57
+ "inputProps"
58
+ ]), { inputProps = {}, isClearable, isDisabled, clearable, loadingText = 'Loading...', // @data-driven-forms/common always injects classNamePrefix (a
59
+ // react-select concern) into its SelectComponent; keep it out of the
60
+ // Autocomplete spread so it never reaches the DOM (AGL-590).
61
+ classNamePrefix: _classNamePrefix } = _0, rest = _object_without_properties_loose(_0, [
62
+ "value",
63
+ "options",
64
+ "label",
65
+ "helperText",
66
+ "validateOnMount",
67
+ "meta",
68
+ "isSearchable",
69
+ "description",
70
+ "isMulti",
71
+ "placeholder",
72
+ "onInputChange",
73
+ "onSearchInput",
74
+ "isFetching",
75
+ "noOptionsMessage",
76
+ "hideSelectedOptions",
77
+ "closeMenuOnSelect",
78
+ "required",
79
+ "onChange",
80
+ "onFocus",
81
+ "onBlur",
82
+ "help",
83
+ "FormFieldGridProps",
84
+ "TextFieldProps",
85
+ "inputProps",
86
+ "isClearable",
87
+ "isDisabled",
88
+ "clearable",
89
+ "loadingText",
90
+ "classNamePrefix"
91
+ ]);
92
+ const invalid = validationError(meta, validateOnMount);
93
+ // When isMulti is true, parseInternalValue always creates a new array; keep
94
+ // the reference stable across renders.
95
+ const internalValue = useMemo(()=>parseInternalValue(value, isMulti), [
96
+ value,
97
+ isMulti
98
+ ]);
99
+ // Selects ship with `disableClearable` on by default here, so the
100
+ // Autocomplete's own ✕ never appears and a chosen option could not be
101
+ // taken back off (AGL-2486). One affordance for every field type beats
102
+ // flipping that default, which would move the control for some fields
103
+ // and not others.
104
+ const clear = buildFieldClear({
105
+ clearable,
106
+ label,
107
+ hasValue: Array.isArray(internalValue) ? internalValue.length > 0 : internalValue !== undefined && internalValue !== null && internalValue !== '',
108
+ locked: Boolean(isDisabled),
109
+ onClear: ()=>onChange(createValue(null, !!isMulti))
110
+ });
111
+ return /*#__PURE__*/ _jsx(FormFieldGrid, _extends({
112
+ help: help,
113
+ clear: clear
114
+ }, FormFieldGridProps, {
115
+ children: /*#__PURE__*/ _jsx(Autocomplete, _extends({
116
+ filterSelectedOptions: hideSelectedOptions,
117
+ disabled: isDisabled,
118
+ disableClearable: isClearable,
119
+ popupIcon: isFetching ? /*#__PURE__*/ _jsx(CircularProgress, {
120
+ size: 20,
121
+ color: "inherit"
122
+ }) : /*#__PURE__*/ _jsx(ArrowDropDownIcon, {}),
123
+ fullWidth: true,
124
+ loadingText: loadingText
125
+ }, rest, {
126
+ renderInput: (params)=>{
127
+ var _params_slotProps;
128
+ return /*#__PURE__*/ _jsx(TextField, _extends({
129
+ onFocus: onFocus,
130
+ onBlur: onBlur
131
+ }, params, {
132
+ required: required,
133
+ error: !!invalid,
134
+ helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
135
+ label: label,
136
+ margin: "normal"
137
+ }, TextFieldProps, {
138
+ slotProps: _extends({}, params.slotProps, TextFieldProps.slotProps, {
139
+ htmlInput: _extends({}, (_params_slotProps = params.slotProps) == null ? void 0 : _params_slotProps.htmlInput, textFieldInputProps, inputProps, {
140
+ readOnly: !isSearchable,
141
+ placeholder: !internalValue || internalValue.length === 0 ? placeholder : undefined
142
+ })
143
+ })
144
+ }));
145
+ },
146
+ noOptionsText: noOptionsMessage && noOptionsMessage(),
147
+ /*
148
+ * The REASON travels with the text.
149
+ *
150
+ * Autocomplete emits this for a typed character (`input`), for the
151
+ * field taking its own value back (`reset` — which fires on mount and
152
+ * again on every selection) and for the clear button (`clear`). A
153
+ * handler that treats all three alike cannot tell somebody searching
154
+ * from the field describing itself, and one that spends a read per
155
+ * query would spend one on simply opening the panel.
156
+ */ onInputChange: (_event, value, reason)=>{
157
+ onInputChange == null ? void 0 : onInputChange(value, reason);
158
+ onSearchInput == null ? void 0 : onSearchInput(value, reason);
159
+ },
160
+ options: options,
161
+ multiple: isMulti,
162
+ getOptionLabel: (option)=>getOptionLabel(option, options),
163
+ value: typeof internalValue === 'undefined' ? null : internalValue,
164
+ onChange: (_event, option)=>onChange(createValue(option, !!isMulti)),
165
+ loading: isFetching
166
+ }))
167
+ }));
168
+ }
169
+ // The common Select's prop types are renderer-version specific; pass through.
170
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
171
+ const DDFSelect = DDFSelectImport;
172
+ export function Select(props) {
173
+ const _useFieldApi = useFieldApi(props), { input, isRequired, isDisabled, isReadOnly, disabled, multiple, isMulti, isClearable, disableClearable, loadingMessage, loadingText, noOptionsMessage, noOptionsText, closeMenuOnSelect } = _useFieldApi, rest = _object_without_properties_loose(_useFieldApi, [
174
+ "input",
175
+ "isRequired",
176
+ "isDisabled",
177
+ "isReadOnly",
178
+ "disabled",
179
+ "multiple",
180
+ "isMulti",
181
+ "isClearable",
182
+ "disableClearable",
183
+ "loadingMessage",
184
+ "loadingText",
185
+ "noOptionsMessage",
186
+ "noOptionsText",
187
+ "closeMenuOnSelect"
188
+ ]);
189
+ return /*#__PURE__*/ _jsx(DDFSelect, _extends({}, input, {
190
+ isMulti: multiple || isMulti,
191
+ required: isRequired,
192
+ disabled: isDisabled || isReadOnly || disabled,
193
+ disableClearable: !isClearable || disableClearable,
194
+ loadingText: loadingMessage || loadingText,
195
+ noOptionsMessage: noOptionsMessage || noOptionsText,
196
+ closeMenuOnSelect: closeMenuOnSelect
197
+ }, rest, {
198
+ SelectComponent: InternalSelect
199
+ }));
200
+ }
201
+ export default Select;
202
+
203
+ //# sourceMappingURL=select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/select.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`-shaped Autocomplete\n * `renderInput` params instead of `inputProps`).\n */\n\nimport { useMemo } from 'react'\n\nimport {\n Autocomplete,\n CircularProgress,\n TextField,\n} from '@mui/material'\n\nimport ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'\n\nimport DDFSelectImport from '@data-driven-forms/common/select'\nimport parseInternalValue from '@data-driven-forms/common/select/parse-internal-value'\n\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, {\n buildFieldClear,\n type FormFieldGridProps,\n} from './form-field-grid'\nimport type { BaseFieldProps, OptionValue, SelectOption, SelectValue } from './types'\nimport { type ExtendedFieldMeta, validationError } from './validation-error'\n\nexport interface SelectProps<T = OptionValue> extends BaseFieldProps {\n options?: SelectOption<T>[]\n loadOptions?: (inputValue: string) => Promise<SelectOption<T>[]>\n isSearchable?: boolean\n isMulti?: boolean\n multiple?: boolean\n isClearable?: boolean\n disableClearable?: boolean\n hideSelectedOptions?: boolean\n closeMenuOnSelect?: boolean\n isFetching?: boolean\n noOptionsMessage?: () => string\n noOptionsText?: () => string\n loadingMessage?: string\n loadingText?: string\n placeholder?: string\n /** Offer the reset-to-unset affordance (AGL-2486). */\n clearable?: boolean\n FormFieldGridProps?: FormFieldGridProps\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TextFieldProps?: Record<string, any>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n inputProps?: Record<string, any>\n onInputChange?: (value: string, reason?: string) => void\n /**\n * A schema field's own hook on the search box, beside DDF's.\n *\n * `onInputChange` cannot be one. `@data-driven-forms/common/select` owns\n * that prop for its `loadOptions` support and assigns it AFTER spreading the\n * field's props, so a handler declared on a schema field is overwritten\n * before it reaches this component — silently, since a dropdown with a\n * dropped handler still opens, still filters and still selects. A field\n * whose typing was supposed to fetch more simply fetches nothing.\n *\n * This name is not taken, so it survives the spread. Both are called.\n */\n onSearchInput?: (value: string, reason?: string) => void\n}\n\n/** Returns label of the selected option. */\nexport function getOptionLabel<T = OptionValue>(\n option: T | SelectOption<T> | undefined,\n options: SelectOption<T>[],\n): string {\n if (typeof option === 'undefined') {\n return ''\n }\n\n if ((option as unknown) === '') {\n return ''\n }\n\n if (Array.isArray(option) && option.length === 0) {\n return ''\n }\n\n if (typeof option === 'object' && option !== null) {\n return String((option as SelectOption<T>).label)\n }\n\n const item = options.find(({ value }) => value === option)\n return (item && String(item.label)) || ''\n}\n\n/** Creates the DDF select value format. */\nexport function createValue<T = OptionValue>(\n option: T | SelectOption<T> | (T | SelectOption<T>)[] | null,\n isMulti: boolean,\n): T | SelectOption<T> | (T | SelectOption<T>)[] | null | undefined {\n if (isMulti) {\n return Array.isArray(option)\n ? option.map((item) =>\n typeof item === 'object' ? item : ({ value: item } as SelectOption<T>),\n )\n : option\n }\n\n return option\n}\n\ninterface InternalSelectProps<T = OptionValue> {\n value: SelectValue<T>\n options: SelectOption<T>[]\n label?: string\n helperText?: string\n validateOnMount?: boolean\n meta: ExtendedFieldMeta\n isSearchable?: boolean\n description?: string\n isMulti?: boolean\n placeholder?: string\n onInputChange?: (value: string, reason?: string) => void\n onSearchInput?: (value: string, reason?: string) => void\n isFetching?: boolean\n noOptionsMessage?: () => string\n hideSelectedOptions?: boolean\n closeMenuOnSelect?: boolean\n required?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (value: any) => void\n onFocus?: () => void\n onBlur?: () => void\n FormFieldGridProps?: FormFieldGridProps\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TextFieldProps?: Record<string, any>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n inputProps?: Record<string, any>\n isClearable?: boolean\n isDisabled?: boolean\n loadingText?: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any\n}\n\nfunction InternalSelect<T = OptionValue>({\n value,\n options,\n label,\n helperText,\n validateOnMount,\n meta,\n isSearchable,\n description,\n isMulti,\n placeholder = 'Please choose',\n onInputChange,\n onSearchInput,\n isFetching,\n noOptionsMessage,\n hideSelectedOptions,\n closeMenuOnSelect: _closeMenuOnSelect,\n required,\n onChange,\n onFocus,\n onBlur,\n help,\n FormFieldGridProps = {},\n TextFieldProps: { inputProps: textFieldInputProps, ...TextFieldProps } = {},\n inputProps = {},\n isClearable,\n isDisabled,\n clearable,\n loadingText = 'Loading...',\n // @data-driven-forms/common always injects classNamePrefix (a\n // react-select concern) into its SelectComponent; keep it out of the\n // Autocomplete spread so it never reaches the DOM (AGL-590).\n classNamePrefix: _classNamePrefix,\n ...rest\n}: InternalSelectProps<T>) {\n const invalid = validationError(meta, validateOnMount)\n // When isMulti is true, parseInternalValue always creates a new array; keep\n // the reference stable across renders.\n const internalValue = useMemo(\n () => parseInternalValue(value, isMulti),\n [value, isMulti],\n )\n\n // Selects ship with `disableClearable` on by default here, so the\n // Autocomplete's own ✕ never appears and a chosen option could not be\n // taken back off (AGL-2486). One affordance for every field type beats\n // flipping that default, which would move the control for some fields\n // and not others.\n const clear = buildFieldClear({\n clearable,\n label,\n hasValue: Array.isArray(internalValue)\n ? internalValue.length > 0\n : internalValue !== undefined &&\n internalValue !== null &&\n internalValue !== '',\n locked: Boolean(isDisabled),\n onClear: () => onChange(createValue(null, !!isMulti)),\n })\n\n return (\n <FormFieldGrid help={help} clear={clear} {...FormFieldGridProps}>\n <Autocomplete\n filterSelectedOptions={hideSelectedOptions}\n disabled={isDisabled}\n disableClearable={isClearable}\n popupIcon={\n isFetching ? (\n <CircularProgress size={20} color=\"inherit\" />\n ) : (\n <ArrowDropDownIcon />\n )\n }\n fullWidth\n loadingText={loadingText}\n {...rest}\n renderInput={(params) => (\n <TextField\n onFocus={onFocus}\n onBlur={onBlur}\n {...params}\n required={required}\n error={!!invalid}\n helperText={\n invalid ||\n ((meta.touched || validateOnMount) && meta.warning) ||\n helperText ||\n description\n }\n label={label}\n margin=\"normal\"\n {...TextFieldProps}\n slotProps={{\n ...params.slotProps,\n ...TextFieldProps.slotProps,\n htmlInput: {\n ...params.slotProps?.htmlInput,\n ...textFieldInputProps,\n ...inputProps,\n readOnly: !isSearchable,\n placeholder:\n !internalValue ||\n (internalValue as unknown[]).length === 0\n ? placeholder\n : undefined,\n },\n }}\n />\n )}\n noOptionsText={noOptionsMessage && noOptionsMessage()}\n /*\n * The REASON travels with the text.\n *\n * Autocomplete emits this for a typed character (`input`), for the\n * field taking its own value back (`reset` — which fires on mount and\n * again on every selection) and for the clear button (`clear`). A\n * handler that treats all three alike cannot tell somebody searching\n * from the field describing itself, and one that spends a read per\n * query would spend one on simply opening the panel.\n */\n onInputChange={(_event, value, reason) => {\n onInputChange?.(value, reason)\n onSearchInput?.(value, reason)\n }}\n options={options}\n multiple={isMulti}\n getOptionLabel={(option) =>\n getOptionLabel(option as T | SelectOption<T>, options)\n }\n value={typeof internalValue === 'undefined' ? null : internalValue}\n onChange={(_event, option) =>\n onChange(createValue(option as SelectOption<T> | null, !!isMulti))\n }\n loading={isFetching}\n />\n </FormFieldGrid>\n )\n}\n\n// The common Select's prop types are renderer-version specific; pass through.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst DDFSelect = DDFSelectImport as React.ComponentType<any>\n\nexport function Select<T = OptionValue>(props: SelectProps<T>) {\n const {\n input,\n isRequired,\n isDisabled,\n isReadOnly,\n disabled,\n multiple,\n isMulti,\n isClearable,\n disableClearable,\n loadingMessage,\n loadingText,\n noOptionsMessage,\n noOptionsText,\n closeMenuOnSelect,\n ...rest\n } = useFieldApi(props)\n\n return (\n <DDFSelect\n {...input}\n isMulti={multiple || isMulti}\n required={isRequired}\n disabled={isDisabled || isReadOnly || disabled}\n disableClearable={!isClearable || disableClearable}\n loadingText={loadingMessage || loadingText}\n noOptionsMessage={noOptionsMessage || noOptionsText}\n closeMenuOnSelect={closeMenuOnSelect}\n {...rest}\n SelectComponent={InternalSelect}\n />\n )\n}\n\nexport default Select\n"],"names":["useMemo","Autocomplete","CircularProgress","TextField","ArrowDropDownIcon","DDFSelectImport","parseInternalValue","useFieldApi","FormFieldGrid","buildFieldClear","validationError","getOptionLabel","option","options","Array","isArray","length","String","label","item","find","value","createValue","isMulti","map","InternalSelect","helperText","validateOnMount","meta","isSearchable","description","placeholder","onInputChange","onSearchInput","isFetching","noOptionsMessage","hideSelectedOptions","closeMenuOnSelect","_closeMenuOnSelect","required","onChange","onFocus","onBlur","help","FormFieldGridProps","TextFieldProps","inputProps","textFieldInputProps","isClearable","isDisabled","clearable","loadingText","classNamePrefix","_classNamePrefix","rest","invalid","internalValue","clear","hasValue","undefined","locked","Boolean","onClear","filterSelectedOptions","disabled","disableClearable","popupIcon","size","color","fullWidth","renderInput","params","error","touched","warning","margin","slotProps","htmlInput","readOnly","noOptionsText","_event","reason","multiple","loading","DDFSelect","Select","props","input","isRequired","isReadOnly","loadingMessage","SelectComponent"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;CAIC,GAED,SAASA,OAAO,QAAQ,QAAO;AAE/B,SACEC,YAAY,EACZC,gBAAgB,EAChBC,SAAS,QACJ,gBAAe;AAEtB,OAAOC,uBAAuB,oCAAmC;AAEjE,OAAOC,qBAAqB,mCAAkC;AAC9D,OAAOC,wBAAwB,wDAAuD;AAEtF,SAASC,WAAW,QAAQ,iCAA6B;AACzD,OAAOC,iBACLC,eAAe,QAEV,uBAAmB;AAE1B,SAAiCC,eAAe,QAAQ,wBAAoB;AAyC5E,0CAA0C,GAC1C,OAAO,SAASC,eACdC,MAAuC,EACvCC,OAA0B;IAE1B,IAAI,OAAOD,WAAW,aAAa;QACjC,OAAO;IACT;IAEA,IAAI,AAACA,WAAuB,IAAI;QAC9B,OAAO;IACT;IAEA,IAAIE,MAAMC,OAAO,CAACH,WAAWA,OAAOI,MAAM,KAAK,GAAG;QAChD,OAAO;IACT;IAEA,IAAI,OAAOJ,WAAW,YAAYA,WAAW,MAAM;QACjD,OAAOK,OAAO,AAACL,OAA2BM,KAAK;IACjD;IAEA,MAAMC,OAAON,QAAQO,IAAI,CAAC,CAAC,EAAEC,KAAK,EAAE,GAAKA,UAAUT;IACnD,OAAO,AAACO,QAAQF,OAAOE,KAAKD,KAAK,KAAM;AACzC;AAEA,yCAAyC,GACzC,OAAO,SAASI,YACdV,MAA4D,EAC5DW,OAAgB;IAEhB,IAAIA,SAAS;QACX,OAAOT,MAAMC,OAAO,CAACH,UACjBA,OAAOY,GAAG,CAAC,CAACL,OACV,OAAOA,SAAS,WAAWA,OAAQ;gBAAEE,OAAOF;YAAK,KAEnDP;IACN;IAEA,OAAOA;AACT;AAoCA,SAASa,eAAgC,EAkChB;QAlCgB,EACvCJ,KAAK,EACLR,OAAO,EACPK,KAAK,EACLQ,UAAU,EACVC,eAAe,EACfC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GAAG9B,cADC+C,wCACD/C;;;;;;;;;;;;;;;;IAEJ,qBACE,KAAC6E,wBACKG;QACJhE,SAAS2D,YAAY3D;QACrBgB,UAAUiD;QACVxB,UAAUf,cAAcwC,cAAczB;QACtCC,kBAAkB,CAACjB,eAAeiB;QAClCd,aAAauC,kBAAkBvC;QAC/BhB,kBAAkBA,oBAAoB4C;QACtC1C,mBAAmBA;OACfiB;QACJqC,iBAAiBlE;;AAGvB;AAEA,eAAe4D,OAAM"}
@@ -0,0 +1,45 @@
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 Grid API.
20
+ */
21
+ import type { ReactNode } from 'react';
22
+ import { type FormControlProps, type FormGroupProps, type FormHelperTextProps, type FormLabelProps, type GridProps, type SliderProps as MuiSliderProps } from '@mui/material';
23
+ import { type FormFieldGridProps } from './form-field-grid';
24
+ import type { BaseFieldProps } from './types';
25
+ export interface SliderProps extends BaseFieldProps {
26
+ FormFieldGridProps?: FormFieldGridProps;
27
+ FormControlProps?: FormControlProps;
28
+ FormGroupProps?: FormGroupProps;
29
+ FormLabelProps?: FormLabelProps;
30
+ FormHelperTextProps?: FormHelperTextProps;
31
+ before?: ReactNode;
32
+ after?: ReactNode;
33
+ InputGridProps?: GridProps;
34
+ BeforeGridProps?: GridProps;
35
+ SliderGridProps?: GridProps;
36
+ AfterGridProps?: GridProps;
37
+ min?: number;
38
+ max?: number;
39
+ step?: number;
40
+ /** Offer the reset-to-unset affordance (AGL-2486). */
41
+ clearable?: boolean;
42
+ SliderProps?: Omit<MuiSliderProps, 'name' | 'value' | 'onChange' | 'onBlur' | 'onFocus'>;
43
+ }
44
+ export declare const Slider: (props: SliderProps) => import("react").JSX.Element;
45
+ export default Slider;
@@ -0,0 +1,119 @@
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
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and
18
+ * updated for the current MUI Grid API.
19
+ */ import { _ as _extends } from "@swc/helpers/_/_extends";
20
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { FormControl, FormGroup, FormHelperText, FormLabel, Grid, Slider as MuiSlider } 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 Slider = (props)=>{
27
+ const _useFieldApi = useFieldApi(props), { input, isReadOnly, isDisabled, isRequired, label, helperText, description, validateOnMount, meta, help, FormFieldGridProps = {}, FormControlProps = {}, FormGroupProps = {}, FormLabelProps = {}, FormHelperTextProps = {}, before, after, InputGridProps = {}, BeforeGridProps = {}, SliderGridProps = {}, AfterGridProps = {}, min = 0, max = 100, clearable, SliderProps = {} } = _useFieldApi, rest = _object_without_properties_loose(_useFieldApi, [
28
+ "input",
29
+ "isReadOnly",
30
+ "isDisabled",
31
+ "isRequired",
32
+ "label",
33
+ "helperText",
34
+ "description",
35
+ "validateOnMount",
36
+ "meta",
37
+ "help",
38
+ "FormFieldGridProps",
39
+ "FormControlProps",
40
+ "FormGroupProps",
41
+ "FormLabelProps",
42
+ "FormHelperTextProps",
43
+ "before",
44
+ "after",
45
+ "InputGridProps",
46
+ "BeforeGridProps",
47
+ "SliderGridProps",
48
+ "AfterGridProps",
49
+ "min",
50
+ "max",
51
+ "clearable",
52
+ "SliderProps"
53
+ ]);
54
+ const invalid = validationError(meta, validateOnMount);
55
+ const text = invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description;
56
+ const defaultValue = (max + min) / 2;
57
+ // `0` is a position a slider can hold, so only nothing at all shows the
58
+ // midpoint — a falsy test drew a stored 0 in the middle of the track.
59
+ const unset = input.value === '' || input.value === undefined || input.value === null;
60
+ const clear = buildFieldClear({
61
+ clearable,
62
+ label,
63
+ hasValue: !unset,
64
+ locked: Boolean(isDisabled || isReadOnly),
65
+ onClear: ()=>input.onChange(undefined)
66
+ });
67
+ return /*#__PURE__*/ _jsx(FormFieldGrid, _extends({
68
+ help: help,
69
+ clear: clear
70
+ }, FormFieldGridProps, {
71
+ children: /*#__PURE__*/ _jsx(FormControl, _extends({
72
+ fullWidth: true,
73
+ required: isRequired,
74
+ error: !!invalid,
75
+ component: "fieldset"
76
+ }, FormControlProps, {
77
+ children: /*#__PURE__*/ _jsxs(FormGroup, _extends({}, FormGroupProps, {
78
+ children: [
79
+ /*#__PURE__*/ _jsx(FormLabel, _extends({
80
+ component: "legend"
81
+ }, FormLabelProps, {
82
+ children: label
83
+ })),
84
+ /*#__PURE__*/ _jsxs(Grid, _extends({
85
+ container: true,
86
+ spacing: 2,
87
+ alignItems: "center"
88
+ }, InputGridProps, {
89
+ children: [
90
+ before && /*#__PURE__*/ _jsx(Grid, _extends({}, BeforeGridProps, {
91
+ children: before
92
+ })),
93
+ /*#__PURE__*/ _jsx(Grid, _extends({
94
+ size: "grow"
95
+ }, SliderGridProps, {
96
+ children: /*#__PURE__*/ _jsx(MuiSlider, _extends({}, input, {
97
+ value: unset ? defaultValue : input.value,
98
+ min: min,
99
+ max: max,
100
+ disabled: isDisabled || isReadOnly,
101
+ onChange: (_e, value)=>input.onChange(value)
102
+ }, SliderProps, rest))
103
+ })),
104
+ after && /*#__PURE__*/ _jsx(Grid, _extends({}, AfterGridProps, {
105
+ children: after
106
+ }))
107
+ ]
108
+ })),
109
+ text && /*#__PURE__*/ _jsx(FormHelperText, _extends({}, FormHelperTextProps, {
110
+ children: text
111
+ }))
112
+ ]
113
+ }))
114
+ }))
115
+ }));
116
+ };
117
+ export default Slider;
118
+
119
+ //# sourceMappingURL=slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/slider.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 type { ReactNode } from 'react'\n\nimport {\n FormControl,\n type FormControlProps,\n FormGroup,\n type FormGroupProps,\n FormHelperText,\n type FormHelperTextProps,\n FormLabel,\n type FormLabelProps,\n Grid,\n type GridProps,\n Slider as MuiSlider,\n type SliderProps as MuiSliderProps,\n} 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 SliderProps extends BaseFieldProps {\n FormFieldGridProps?: FormFieldGridProps\n FormControlProps?: FormControlProps\n FormGroupProps?: FormGroupProps\n FormLabelProps?: FormLabelProps\n FormHelperTextProps?: FormHelperTextProps\n before?: ReactNode\n after?: ReactNode\n InputGridProps?: GridProps\n BeforeGridProps?: GridProps\n SliderGridProps?: GridProps\n AfterGridProps?: GridProps\n min?: number\n max?: number\n step?: number\n /** Offer the reset-to-unset affordance (AGL-2486). */\n clearable?: boolean\n SliderProps?: Omit<\n MuiSliderProps,\n 'name' | 'value' | 'onChange' | 'onBlur' | 'onFocus'\n >\n}\n\nexport const Slider = (props: SliderProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n isRequired,\n label,\n helperText,\n description,\n validateOnMount,\n meta,\n help,\n FormFieldGridProps = {},\n FormControlProps = {},\n FormGroupProps = {},\n FormLabelProps = {},\n FormHelperTextProps = {},\n before,\n after,\n InputGridProps = {},\n BeforeGridProps = {},\n SliderGridProps = {},\n AfterGridProps = {},\n min = 0,\n max = 100,\n clearable,\n SliderProps = {},\n ...rest\n } = useFieldApi(props)\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\n const defaultValue = (max + min) / 2\n // `0` is a position a slider can hold, so only nothing at all shows the\n // midpoint — a falsy test drew a stored 0 in the middle of the track.\n const unset =\n input.value === '' || input.value === undefined || input.value === null\n const clear = buildFieldClear({\n clearable,\n label,\n hasValue: !unset,\n locked: Boolean(isDisabled || isReadOnly),\n onClear: () => input.onChange(undefined),\n })\n\n return (\n <FormFieldGrid help={help} clear={clear} {...FormFieldGridProps}>\n <FormControl\n fullWidth\n required={isRequired}\n error={!!invalid}\n component=\"fieldset\"\n {...FormControlProps}\n >\n <FormGroup {...FormGroupProps}>\n <FormLabel component=\"legend\" {...FormLabelProps}>\n {label}\n </FormLabel>\n <Grid container spacing={2} alignItems=\"center\" {...InputGridProps}>\n {before && <Grid {...BeforeGridProps}>{before}</Grid>}\n <Grid size=\"grow\" {...SliderGridProps}>\n <MuiSlider\n {...input}\n value={unset ? defaultValue : input.value}\n min={min}\n max={max}\n disabled={isDisabled || isReadOnly}\n onChange={(_e, value) => input.onChange(value)}\n {...SliderProps}\n {...rest}\n />\n </Grid>\n {after && <Grid {...AfterGridProps}>{after}</Grid>}\n </Grid>\n {text && (\n <FormHelperText {...FormHelperTextProps}>{text}</FormHelperText>\n )}\n </FormGroup>\n </FormControl>\n </FormFieldGrid>\n )\n}\n\nexport default Slider\n"],"names":["FormControl","FormGroup","FormHelperText","FormLabel","Grid","Slider","MuiSlider","useFieldApi","FormFieldGrid","buildFieldClear","validationError","props","input","isReadOnly","isDisabled","isRequired","label","helperText","description","validateOnMount","meta","help","FormFieldGridProps","FormControlProps","FormGroupProps","FormLabelProps","FormHelperTextProps","before","after","InputGridProps","BeforeGridProps","SliderGridProps","AfterGridProps","min","max","clearable","SliderProps","rest","invalid","text","touched","warning","defaultValue","unset","value","undefined","clear","hasValue","locked","Boolean","onClear","onChange","fullWidth","required","error","component","container","spacing","alignItems","size","disabled","_e"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;CAGC;;;AAID,SACEA,WAAW,EAEXC,SAAS,EAETC,cAAc,EAEdC,SAAS,EAETC,IAAI,EAEJC,UAAUC,SAAS,QAEd,gBAAe;AAEtB,SAASC,WAAW,QAAQ,iCAA6B;AACzD,OAAOC,iBACLC,eAAe,QAEV,uBAAmB;AAE1B,SAAiCC,eAAe,QAAQ,wBAAoB;AAyB5E,OAAO,MAAML,SAAS,CAACM;IACrB,MA2BIJ,eAAAA,YAAYI,QA3BV,EACJC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,eAAe,EACfC,IAAI,EACJC,IAAI,EACJC,q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AACvB;gCAAKuD,MAAK;+BAAW5B;0CACpB,cAAA,KAACzB,wBACKM;oCACJgC,OAAOD,QAAQD,eAAe9B,MAAMgC,KAAK;oCACzCX,KAAKA;oCACLC,KAAKA;oCACL0B,UAAU9C,cAAcD;oCACxBsC,UAAU,CAACU,IAAIjB,QAAUhC,MAAMuC,QAAQ,CAACP;mCACpCR,aACAC;;4BAGPT,uBAAS,KAACxB,mBAAS4B;0CAAiBJ;;;;oBAEtCW,sBACC,KAACrC,6BAAmBwB;kCAAsBa;;;;;;AAMtD,EAAC;AAED,eAAelC,OAAM"}
@@ -0,0 +1,23 @@
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
+ * Whether a field holds a value of its own, read from the form rather than
19
+ * from `input`: final-form hands a checkbox or a radio group `checked`, and
20
+ * `input.value` there is the option's value, not the stored one. `false` is a
21
+ * value someone chose; only nothing at all is unset.
22
+ */
23
+ export declare function useStoredFieldHasValue(name: string): boolean;
@@ -0,0 +1,29 @@
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
+ */ import { useFormApi } from "../vendor/data-driven-forms.js";
17
+ /**
18
+ * Whether a field holds a value of its own, read from the form rather than
19
+ * from `input`: final-form hands a checkbox or a radio group `checked`, and
20
+ * `input.value` there is the option's value, not the stored one. `false` is a
21
+ * value someone chose; only nothing at all is unset.
22
+ */ export function useStoredFieldHasValue(name) {
23
+ var _formApi_getFieldState, _formApi_getFieldState1;
24
+ const formApi = useFormApi();
25
+ const stored = formApi == null ? void 0 : (_formApi_getFieldState1 = formApi.getFieldState) == null ? void 0 : (_formApi_getFieldState = _formApi_getFieldState1.call(formApi, name)) == null ? void 0 : _formApi_getFieldState.value;
26
+ return stored !== undefined && stored !== null && stored !== '';
27
+ }
28
+
29
+ //# sourceMappingURL=stored-field-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/stored-field-value.ts"],"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\nimport { useFormApi } from '../vendor/data-driven-forms'\n\n/**\n * Whether a field holds a value of its own, read from the form rather than\n * from `input`: final-form hands a checkbox or a radio group `checked`, and\n * `input.value` there is the option's value, not the stored one. `false` is a\n * value someone chose; only nothing at all is unset.\n */\nexport function useStoredFieldHasValue(name: string): boolean {\n const formApi = useFormApi()\n const stored = formApi?.getFieldState?.(name)?.value\n return stored !== undefined && stored !== null && stored !== ''\n}\n"],"names":["useFormApi","useStoredFieldHasValue","name","formApi","stored","getFieldState","value","undefined"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,UAAU,QAAQ,iCAA6B;AAExD;;;;;CAKC,GACD,OAAO,SAASC,uBAAuBC,IAAY;QAElCC,wBAAAA;IADf,MAAMA,UAAUH;IAChB,MAAMI,SAASD,4BAAAA,0BAAAA,QAASE,aAAa,sBAAtBF,yBAAAA,6BAAAA,SAAyBD,0BAAzBC,uBAAgCG,KAAK;IACpD,OAAOF,WAAWG,aAAaH,WAAW,QAAQA,WAAW;AAC/D"}
@@ -0,0 +1,39 @@
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 APIs (Grid `size`, no Typography `paragraph`).
20
+ */
21
+ import { type HelpTipContent } from '@aglyn/shared-ui-jsx';
22
+ import type { ReactNode } from 'react';
23
+ import { type GridProps, type TypographyProps } from '@mui/material';
24
+ import { type FieldSchema } from '../vendor/data-driven-forms';
25
+ export interface SubFormProps extends Omit<GridProps, 'component' | 'title'> {
26
+ fields: FieldSchema[];
27
+ title?: ReactNode;
28
+ description?: ReactNode;
29
+ component?: string;
30
+ /** Contextual help affordance rendered beside the section title (AGL-601). */
31
+ help?: HelpTipContent;
32
+ TitleGridProps?: GridProps;
33
+ TitleProps?: TypographyProps;
34
+ DescriptionProps?: TypographyProps;
35
+ DescriptionGridProps?: GridProps;
36
+ ItemsGridProps?: GridProps;
37
+ }
38
+ export declare const SubForm: ({ fields, title, description, component: _component, help, TitleGridProps, TitleProps, DescriptionProps, DescriptionGridProps, ItemsGridProps, ...rest }: SubFormProps) => import("react").JSX.Element;
39
+ export default SubForm;