@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,72 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 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
+ export declare enum FieldComponentType {
18
+ /** Per-breakpoint span/offset row; persists one string (AGL-2486). */
19
+ BREAKPOINT_SPAN = "breakpoint-span",
20
+ BUTTON = "button",
21
+ CHECKBOX = "checkbox",
22
+ COLOR_PICKER = "color-picker",
23
+ /** Thickness + line style for a border shorthand; one string (AGL-2486). */
24
+ CSS_BORDER = "css-border",
25
+ /** Number + unit editor for a CSS length; persists one string (AGL-1219). */
26
+ CSS_DIMENSION = "css-dimension",
27
+ /** Fill type + angle + colour stops; persists one CSS string (AGL-1331). */
28
+ CSS_GRADIENT = "css-gradient",
29
+ /** Row-and-column grid for the Table element (AGL-2543). */
30
+ DATA_TABLE = "data-table",
31
+ DATE_PICKER = "date-picker",
32
+ DUAL_LIST_SELECT = "dual-list-select",
33
+ FIELD_ARRAY = "field-array",
34
+ ICON_PICKER = "icon-picker",
35
+ INPUT_ADDON_BUTTON_GROUP = "input-addon-button-group",
36
+ INPUT_ADDON_GROUP = "input-addon-group",
37
+ PLAIN_TEXT = "plain-text",
38
+ /** Named presets with a raw escape hatch (AGL-2486). */
39
+ PRESET_CHOICE = "preset-choice",
40
+ RADIO = "radio",
41
+ SELECT = "select",
42
+ SLIDER = "slider",
43
+ SUB_FORM = "sub-form",
44
+ SWITCH = "switch",
45
+ TAB_ITEM = "tab-item",
46
+ TABS = "tabs",
47
+ TEXT_FIELD = "text-field",
48
+ TEXTAREA = "textarea",
49
+ /** Theme-scale combo box that still accepts a raw value (AGL-2486). */
50
+ THEME_SCALE = "theme-scale",
51
+ TIME_PICKER = "time-picker",
52
+ TOGGLE_BUTTON = "toggle-button",
53
+ WIZARD = "wizard"
54
+ }
55
+ export declare enum FieldValidatorType {
56
+ EXACT_LENGTH = "exact-length",
57
+ MAX_LENGTH = "max-length",
58
+ MAX_NUMBER_VALUE = "max-number-value",
59
+ MIN_ITEMS = "min-items",
60
+ MIN_LENGTH = "min-length",
61
+ MIN_NUMBER_VALUE = "min-number-value",
62
+ PATTERN = "pattern",
63
+ REQUIRED = "required",
64
+ URL = "url"
65
+ }
66
+ export declare enum FieldDataType {
67
+ BOOLEAN = "boolean",
68
+ FLOAT = "float",
69
+ INTEGER = "integer",
70
+ NUMBER = "number",
71
+ STRING = "string"
72
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 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
+ */ export var FieldComponentType = /*#__PURE__*/ function(FieldComponentType) {
17
+ /** Per-breakpoint span/offset row; persists one string (AGL-2486). */ FieldComponentType["BREAKPOINT_SPAN"] = "breakpoint-span";
18
+ FieldComponentType["BUTTON"] = "button";
19
+ FieldComponentType["CHECKBOX"] = "checkbox";
20
+ FieldComponentType["COLOR_PICKER"] = "color-picker";
21
+ /** Thickness + line style for a border shorthand; one string (AGL-2486). */ FieldComponentType["CSS_BORDER"] = "css-border";
22
+ /** Number + unit editor for a CSS length; persists one string (AGL-1219). */ FieldComponentType["CSS_DIMENSION"] = "css-dimension";
23
+ /** Fill type + angle + colour stops; persists one CSS string (AGL-1331). */ FieldComponentType["CSS_GRADIENT"] = "css-gradient";
24
+ /** Row-and-column grid for the Table element (AGL-2543). */ FieldComponentType["DATA_TABLE"] = "data-table";
25
+ FieldComponentType["DATE_PICKER"] = "date-picker";
26
+ FieldComponentType["DUAL_LIST_SELECT"] = "dual-list-select";
27
+ FieldComponentType["FIELD_ARRAY"] = "field-array";
28
+ FieldComponentType["ICON_PICKER"] = "icon-picker";
29
+ FieldComponentType["INPUT_ADDON_BUTTON_GROUP"] = "input-addon-button-group";
30
+ FieldComponentType["INPUT_ADDON_GROUP"] = "input-addon-group";
31
+ FieldComponentType["PLAIN_TEXT"] = "plain-text";
32
+ /** Named presets with a raw escape hatch (AGL-2486). */ FieldComponentType["PRESET_CHOICE"] = "preset-choice";
33
+ FieldComponentType["RADIO"] = "radio";
34
+ FieldComponentType["SELECT"] = "select";
35
+ FieldComponentType["SLIDER"] = "slider";
36
+ FieldComponentType["SUB_FORM"] = "sub-form";
37
+ FieldComponentType["SWITCH"] = "switch";
38
+ FieldComponentType["TAB_ITEM"] = "tab-item";
39
+ FieldComponentType["TABS"] = "tabs";
40
+ FieldComponentType["TEXT_FIELD"] = "text-field";
41
+ FieldComponentType["TEXTAREA"] = "textarea";
42
+ /** Theme-scale combo box that still accepts a raw value (AGL-2486). */ FieldComponentType["THEME_SCALE"] = "theme-scale";
43
+ FieldComponentType["TIME_PICKER"] = "time-picker";
44
+ FieldComponentType["TOGGLE_BUTTON"] = "toggle-button";
45
+ FieldComponentType["WIZARD"] = "wizard";
46
+ return FieldComponentType;
47
+ }({});
48
+ export var FieldValidatorType = /*#__PURE__*/ function(FieldValidatorType) {
49
+ FieldValidatorType["EXACT_LENGTH"] = "exact-length";
50
+ FieldValidatorType["MAX_LENGTH"] = "max-length";
51
+ FieldValidatorType["MAX_NUMBER_VALUE"] = "max-number-value";
52
+ FieldValidatorType["MIN_ITEMS"] = "min-items";
53
+ FieldValidatorType["MIN_LENGTH"] = "min-length";
54
+ FieldValidatorType["MIN_NUMBER_VALUE"] = "min-number-value";
55
+ FieldValidatorType["PATTERN"] = "pattern";
56
+ FieldValidatorType["REQUIRED"] = "required";
57
+ FieldValidatorType["URL"] = "url";
58
+ return FieldValidatorType;
59
+ }({});
60
+ export var FieldDataType = /*#__PURE__*/ function(FieldDataType) {
61
+ FieldDataType["BOOLEAN"] = "boolean";
62
+ FieldDataType["FLOAT"] = "float";
63
+ FieldDataType["INTEGER"] = "integer";
64
+ FieldDataType["NUMBER"] = "number";
65
+ FieldDataType["STRING"] = "string";
66
+ return FieldDataType;
67
+ }({});
68
+
69
+ //# sourceMappingURL=flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/constants/flags.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 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\nexport enum FieldComponentType {\n /** Per-breakpoint span/offset row; persists one string (AGL-2486). */\n BREAKPOINT_SPAN = 'breakpoint-span',\n BUTTON = 'button',\n CHECKBOX = 'checkbox',\n COLOR_PICKER = 'color-picker',\n /** Thickness + line style for a border shorthand; one string (AGL-2486). */\n CSS_BORDER = 'css-border',\n /** Number + unit editor for a CSS length; persists one string (AGL-1219). */\n CSS_DIMENSION = 'css-dimension',\n /** Fill type + angle + colour stops; persists one CSS string (AGL-1331). */\n CSS_GRADIENT = 'css-gradient',\n /** Row-and-column grid for the Table element (AGL-2543). */\n DATA_TABLE = 'data-table',\n DATE_PICKER = 'date-picker',\n DUAL_LIST_SELECT = 'dual-list-select',\n FIELD_ARRAY = 'field-array',\n ICON_PICKER = 'icon-picker',\n INPUT_ADDON_BUTTON_GROUP = 'input-addon-button-group',\n INPUT_ADDON_GROUP = 'input-addon-group',\n PLAIN_TEXT = 'plain-text',\n /** Named presets with a raw escape hatch (AGL-2486). */\n PRESET_CHOICE = 'preset-choice',\n RADIO = 'radio',\n SELECT = 'select',\n SLIDER = 'slider',\n SUB_FORM = 'sub-form',\n SWITCH = 'switch',\n TAB_ITEM = 'tab-item',\n TABS = 'tabs',\n TEXT_FIELD = 'text-field',\n TEXTAREA = 'textarea',\n /** Theme-scale combo box that still accepts a raw value (AGL-2486). */\n THEME_SCALE = 'theme-scale',\n TIME_PICKER = 'time-picker',\n TOGGLE_BUTTON = 'toggle-button',\n WIZARD = 'wizard',\n}\n\nexport enum FieldValidatorType {\n EXACT_LENGTH = 'exact-length',\n MAX_LENGTH = 'max-length',\n MAX_NUMBER_VALUE = 'max-number-value',\n MIN_ITEMS = 'min-items',\n MIN_LENGTH = 'min-length',\n MIN_NUMBER_VALUE = 'min-number-value',\n PATTERN = 'pattern',\n REQUIRED = 'required',\n URL = 'url',\n}\n\nexport enum FieldDataType {\n BOOLEAN = 'boolean',\n FLOAT = 'float',\n INTEGER = 'integer',\n NUMBER = 'number',\n STRING = 'string',\n}\n"],"names":["FieldComponentType","FieldValidatorType","FieldDataType"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAO,IAAA,AAAKA,4CAAAA;IACV,oEAAoE;;;;IAKpE,0EAA0E;IAE1E,2EAA2E;IAE3E,0EAA0E;IAE1E,0DAA0D;;;;;;;;IAS1D,sDAAsD;;;;;;;;;;IAWtD,qEAAqE;;;;WAhC3DA;MAqCX;AAED,OAAO,IAAA,AAAKC,4CAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,uCAAAA;;;;;;WAAAA;MAMX"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 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 GridProps as MuiGridProps } from '@mui/material';
18
+ import { type ComponentType, type ElementType, type ForwardRefExoticComponent, type PropsWithoutRef, type RefAttributes } from 'react';
19
+ export interface GridWrappedMergeProps {
20
+ FieldGridProps?: Partial<MuiGridProps>;
21
+ }
22
+ export type GridWrappedComponentProps<D extends ElementType = any, P = EmptyObj> = PropsWithoutRef<P & GridWrappedMergeProps> & RefAttributes<D>;
23
+ export interface GridWrappedExoticComponent<D extends ElementType = any, P = EmptyObj> extends ForwardRefExoticComponent<GridWrappedComponentProps<D, P>> {
24
+ }
25
+ export declare function withGridItem<P>(WrappedComponent: ComponentType<P>): GridWrappedExoticComponent<any, P>;
@@ -0,0 +1,48 @@
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 2023 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
+ */ // eslint-disable-next-line @nx/enforce-module-boundaries
20
+ import { mergeSxProps } from "@aglyn/shared-ui-theme";
21
+ import { getDisplayName } from "@aglyn/shared-util-tools";
22
+ import { hoistNonReactStatics } from "@aglyn/shared-util-vendor";
23
+ import { Grid as MuiGrid } from "@mui/material";
24
+ import { forwardRef } from "react";
25
+ export function withGridItem(WrappedComponent) {
26
+ const displayName = getDisplayName(WrappedComponent);
27
+ const WithGridItem = /*#__PURE__*/ forwardRef((props, ref)=>{
28
+ const { FieldGridProps } = props, rest = _object_without_properties_loose(props, [
29
+ "FieldGridProps"
30
+ ]);
31
+ const _ref = FieldGridProps || {}, { sx } = _ref, gridProps = _object_without_properties_loose(_ref, [
32
+ "sx"
33
+ ]);
34
+ return /*#__PURE__*/ _jsx(MuiGrid, _extends({
35
+ ref: ref,
36
+ sx: mergeSxProps({
37
+ position: 'relative'
38
+ }, sx)
39
+ }, gridProps, {
40
+ children: /*#__PURE__*/ _jsx(WrappedComponent, _extends({}, rest))
41
+ }));
42
+ });
43
+ WithGridItem.displayName = `WithGridItem(${displayName})`;
44
+ hoistNonReactStatics(WithGridItem, WrappedComponent);
45
+ return WithGridItem;
46
+ }
47
+
48
+ //# sourceMappingURL=with-grid-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/hocs/with-grid-item.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { mergeSxProps } from '@aglyn/shared-ui-theme'\nimport { getDisplayName } from '@aglyn/shared-util-tools'\nimport { hoistNonReactStatics } from '@aglyn/shared-util-vendor'\nimport { Grid as MuiGrid, type GridProps as MuiGridProps } from '@mui/material'\nimport {\n type ComponentType,\n type ElementType,\n forwardRef,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n type RefAttributes,\n} from 'react'\n\n\nexport interface GridWrappedMergeProps {\n FieldGridProps?: Partial<MuiGridProps>\n}\n\nexport type GridWrappedComponentProps<\n D extends ElementType = any,\n P = EmptyObj,\n> = PropsWithoutRef<P & GridWrappedMergeProps> & RefAttributes<D>\n\nexport interface GridWrappedExoticComponent<\n D extends ElementType = any,\n P = EmptyObj,\n> extends ForwardRefExoticComponent<GridWrappedComponentProps<D, P>> {}\n\nexport function withGridItem<P>(\n WrappedComponent: ComponentType<P>,\n): GridWrappedExoticComponent<any, P> {\n const displayName = getDisplayName(WrappedComponent)\n const WithGridItem = forwardRef<any, P & GridWrappedMergeProps>(\n (props, ref) => {\n const { FieldGridProps, ...rest } = props\n const { sx, ...gridProps } = FieldGridProps || ({} as MuiGridProps)\n\n return (\n <MuiGrid\n ref={ref}\n sx={mergeSxProps({ position: 'relative' }, sx)}\n {...gridProps}\n >\n <WrappedComponent {...(rest as P)} />\n </MuiGrid>\n )\n },\n )\n WithGridItem.displayName = `WithGridItem(${displayName})`\n hoistNonReactStatics(WithGridItem, WrappedComponent)\n return WithGridItem\n}\n"],"names":["mergeSxProps","getDisplayName","hoistNonReactStatics","Grid","MuiGrid","forwardRef","withGridItem","WrappedComponent","displayName","WithGridItem","props","ref","FieldGridProps","rest","sx","gridProps","position"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,yDAAyD;AACzD,SAASA,YAAY,QAAQ,yBAAwB;AACrD,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,QAAQC,OAAO,QAAwC,gBAAe;AAC/E,SAGEC,UAAU,QAIL,QAAO;AAiBd,OAAO,SAASC,aACdC,gBAAkC;IAElC,MAAMC,cAAcP,eAAeM;IACnC,MAAME,6BAAeJ,WACnB,CAACK,OAAOC;QACN,MAAM,EAAEC,cAAc,EAAW,GAAGF,OAATG,wCAASH;;;QACpC,MAA6BE,OAAAA,kBAAmB,CAAC,GAA3C,EAAEE,EAAE,EAAgB,GAAGF,MAAdG,6CAAcH;;;QAE7B,qBACE,KAACR;YACCO,KAAKA;YACLG,IAAId,aAAa;gBAAEgB,UAAU;YAAW,GAAGF;WACvCC;sBAEJ,cAAA,KAACR,+BAAsBM;;IAG7B;IAEFJ,aAAaD,WAAW,GAAG,CAAC,aAAa,EAAEA,YAAY,CAAC,CAAC;IACzDN,qBAAqBO,cAAcF;IACnC,OAAOE;AACT"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 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
+ export * from './types';
18
+ export * from './components/color-picker.component';
19
+ export * from './components/color-picker-tokens';
20
+ export * from './components/icon-select.component';
21
+ export * from './components/select.component';
22
+ export * from './components/switch.component';
23
+ export * from './components/text-field.component';
24
+ export * from './components/textarea.component';
25
+ export * from './components/grid-form-template.component';
26
+ export * from './components/create-artifact-drawer.component';
27
+ export * from './components/toggle-button.component';
28
+ export * from './mapper';
29
+ export * from './constants/component-mappers';
30
+ export * from './constants/dynamic-fields';
31
+ export * from './constants/field-configurations';
32
+ export * from './constants/flags';
33
+ export * from './hocs/with-grid-item';
34
+ export * from './utils/option-is-equal-to-value';
35
+ export * from './utils/validation-message';
36
+ export * from './vendor/data-driven-forms';
37
+ export { type SelectProps } from './components/select.component';
38
+ export { type SwitchProps } from './components/switch.component';
39
+ export { type TextFieldProps } from './components/text-field.component';
40
+ export { type TextareaProps } from './components/textarea.component';
41
+ export { FieldArray } from './vendor/data-driven-forms';
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 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
+ */ export * from "./types.js";
17
+ export * from "./components/color-picker.component.js";
18
+ export * from "./components/color-picker-tokens.js";
19
+ export * from "./components/icon-select.component.js";
20
+ export * from "./components/select.component.js";
21
+ export * from "./components/switch.component.js";
22
+ export * from "./components/text-field.component.js";
23
+ export * from "./components/textarea.component.js";
24
+ export * from "./components/grid-form-template.component.js";
25
+ // The shared create drawer (AGL-700). Exported from the library rather than
26
+ // living in `apps/console` so that the console pages a PLUGIN ships can create
27
+ // a record the same way the app's own list pages do — a plugin card cannot
28
+ // import from the app that renders it.
29
+ export * from "./components/create-artifact-drawer.component.js";
30
+ export * from "./components/toggle-button.component.js";
31
+ export * from "./mapper/index.js";
32
+ export * from "./constants/component-mappers.js";
33
+ export * from "./constants/dynamic-fields.js";
34
+ export * from "./constants/field-configurations.js";
35
+ export * from "./constants/flags.js";
36
+ export * from "./hocs/with-grid-item.js";
37
+ export * from "./utils/option-is-equal-to-value.js";
38
+ export * from "./utils/validation-message.js";
39
+ export * from "./vendor/data-driven-forms.js";
40
+ export { FieldArray } from "./vendor/data-driven-forms.js";
41
+
42
+ //# sourceMappingURL=jsx-forms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/shared/ui/jsx-forms/src/lib/jsx-forms.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 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\nexport * from './types'\n\nexport * from './components/color-picker.component'\nexport * from './components/color-picker-tokens'\nexport * from './components/icon-select.component'\nexport * from './components/select.component'\nexport * from './components/switch.component'\nexport * from './components/text-field.component'\nexport * from './components/textarea.component'\nexport * from './components/grid-form-template.component'\n// The shared create drawer (AGL-700). Exported from the library rather than\n// living in `apps/console` so that the console pages a PLUGIN ships can create\n// a record the same way the app's own list pages do — a plugin card cannot\n// import from the app that renders it.\nexport * from './components/create-artifact-drawer.component'\nexport * from './components/toggle-button.component'\n\nexport * from './mapper'\n\nexport * from './constants/component-mappers'\nexport * from './constants/dynamic-fields'\nexport * from './constants/field-configurations'\nexport * from './constants/flags'\n\nexport * from './hocs/with-grid-item'\n\nexport * from './utils/option-is-equal-to-value'\nexport * from './utils/validation-message'\n\nexport * from './vendor/data-driven-forms'\n\n// Explicit winners for names exported by both the classic components and\n// the MUI-native mapper (or the ddf vendor barrel) — TS2308 otherwise.\nexport { type SelectProps } from './components/select.component'\nexport { type SwitchProps } from './components/switch.component'\nexport { type TextFieldProps } from './components/text-field.component'\nexport { type TextareaProps } from './components/textarea.component'\nexport { FieldArray } from './vendor/data-driven-forms'\n"],"names":["FieldArray"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,aAAS;AAEvB,cAAc,yCAAqC;AACnD,cAAc,sCAAkC;AAChD,cAAc,wCAAoC;AAClD,cAAc,mCAA+B;AAC7C,cAAc,mCAA+B;AAC7C,cAAc,uCAAmC;AACjD,cAAc,qCAAiC;AAC/C,cAAc,+CAA2C;AACzD,4EAA4E;AAC5E,+EAA+E;AAC/E,2EAA2E;AAC3E,uCAAuC;AACvC,cAAc,mDAA+C;AAC7D,cAAc,0CAAsC;AAEpD,cAAc,oBAAU;AAExB,cAAc,mCAA+B;AAC7C,cAAc,gCAA4B;AAC1C,cAAc,sCAAkC;AAChD,cAAc,uBAAmB;AAEjC,cAAc,2BAAuB;AAErC,cAAc,sCAAkC;AAChD,cAAc,gCAA4B;AAE1C,cAAc,gCAA4B;AAQ1C,SAASA,UAAU,QAAQ,gCAA4B"}
@@ -0,0 +1,73 @@
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 SpanBreakpoint } from '@aglyn/shared-data-enums';
18
+ import { type FormFieldGridProps } from './form-field-grid';
19
+ import type { BaseFieldProps } from './types';
20
+ /**
21
+ * BreakpointSpan (AGL-2486): the per-breakpoint editor for a MUI Grid cell's
22
+ * **Span** and **Offset**.
23
+ *
24
+ * Both were free-text boxes taking a developer syntax — `xs:12 md:2` — with
25
+ * the syntax explained only in a tooltip. Aglyn's authors are not reading the
26
+ * MUI Grid docs, so the capability was there and unreachable: in practice a
27
+ * cell got one number and never became responsive.
28
+ *
29
+ * The PERSISTED value is unchanged: still ONE string, still the same syntax,
30
+ * parsed by the same shared pair the Grid element itself uses
31
+ * (`parseBreakpointSpan`/`buildBreakpointSpan` in `@aglyn/shared-data-enums`).
32
+ * This is an input affordance, not a shape change, so renderers, published
33
+ * documents and existing nodes stay untouched — the same rule
34
+ * {@link CssDimensionField} follows for CSS lengths.
35
+ *
36
+ * Two things the layout of this editor has to get right:
37
+ *
38
+ * - A value authored with NO breakpoint (`"6"`) is a scalar and applies at
39
+ * every size. It is NOT the same string as `xs:6`, and MUI's prop is
40
+ * either a scalar or an object — never both. So the row leads with an
41
+ * **All** cell, and picking a breakpoint disables it (and vice versa)
42
+ * rather than silently dropping one of the two.
43
+ * - Anything this editor cannot model — a `{{token}}`, an unknown
44
+ * breakpoint, a span wider than the offered list — must NOT be clobbered.
45
+ * It falls back to a raw text box holding the string verbatim, and flips
46
+ * back to the controls the moment the text becomes modellable again. The
47
+ * same escape hatch is reachable on purpose (**Edit as text**) so the full
48
+ * syntax stays available to anyone who wants it.
49
+ */
50
+ /** Draft state: what the row of controls shows, before serialization. */
51
+ export interface SpanDraft {
52
+ /** The value is not modellable — the text box holds it verbatim. */
53
+ custom: boolean;
54
+ /** Raw string, in custom mode only. */
55
+ text: string;
56
+ /** The breakpoint-less value; `''` when unset. */
57
+ base: string;
58
+ /** Per-breakpoint values as option strings; `''` when unset. */
59
+ values: Record<SpanBreakpoint, string>;
60
+ }
61
+ export declare const seedSpanDraft: (value: unknown) => SpanDraft;
62
+ export declare const serializeSpanDraft: (draft: SpanDraft) => string;
63
+ export interface BreakpointSpanProps extends BaseFieldProps {
64
+ /** Offer MUI's `grow` keyword. False for Offset, which has no `grow`. */
65
+ allowGrow?: boolean;
66
+ /** Lowest column count offered. 0 for Offset, 1 for Span. */
67
+ minSpan?: number;
68
+ /** Highest column count offered; the container's `columns` default. */
69
+ maxSpan?: number;
70
+ FormFieldGridProps?: FormFieldGridProps;
71
+ }
72
+ export declare const BreakpointSpanField: (props: BreakpointSpanProps) => import("react").JSX.Element;
73
+ export default BreakpointSpanField;