xmlui 0.9.51 → 0.9.53

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 (171) hide show
  1. package/dist/lib/{apiInterceptorWorker-BtGYrMWj.mjs → apiInterceptorWorker-CZW6DSTB.mjs} +3 -3
  2. package/dist/lib/{index-hS5S81ba.mjs → index-qpGKk07J.mjs} +13827 -12206
  3. package/dist/lib/index.css +1 -1
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/{metadata-utils-QekhOD-W.mjs → metadata-utils-4EQ6kQIM.mjs} +7 -7
  7. package/dist/lib/{server-common-CtY73qos.mjs → server-common-SNl_47nE.mjs} +2 -2
  8. package/dist/lib/{transform-DXcw0gGl.mjs → transform-CgRMkbb0.mjs} +1472 -1440
  9. package/dist/lib/xmlui-parser.d.ts +84 -62
  10. package/dist/lib/xmlui-parser.mjs +41 -49
  11. package/dist/lib/{xmlui-serializer-CAZCkpXP.mjs → xmlui-serializer-EDw51UFN.mjs} +10 -10
  12. package/dist/lib/xmlui.d.ts +17 -7
  13. package/dist/lib/xmlui.mjs +19 -18
  14. package/dist/metadata/apiInterceptorWorker-CC40OeUC.mjs +15414 -0
  15. package/dist/metadata/collectedComponentMetadata-C5DVNC6p.mjs +41262 -0
  16. package/dist/metadata/core-D3puiNN6.mjs +5771 -0
  17. package/dist/metadata/style.css +1 -1
  18. package/dist/metadata/wasm-DQxwEHae.mjs +7 -0
  19. package/dist/metadata/xmlui-metadata.mjs +3 -18398
  20. package/dist/metadata/xmlui-metadata.umd.js +549 -10
  21. package/dist/scripts/package.json +5 -6
  22. package/dist/scripts/src/components/APICall/APICall.js +13 -12
  23. package/dist/scripts/src/components/APICall/APICallNative.js +5 -0
  24. package/dist/scripts/src/components/Accordion/Accordion.js +4 -2
  25. package/dist/scripts/src/components/Accordion/AccordionItem.js +2 -2
  26. package/dist/scripts/src/components/Accordion/AccordionItemNative.js +6 -2
  27. package/dist/scripts/src/components/App/App.js +22 -9
  28. package/dist/scripts/src/components/App/AppNative.js +9 -1
  29. package/dist/scripts/src/components/AppHeader/AppHeader.js +2 -2
  30. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +5 -2
  31. package/dist/scripts/src/components/AppState/AppState.js +2 -2
  32. package/dist/scripts/src/components/AppState/AppStateNative.js +5 -1
  33. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +8 -8
  34. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +16 -2
  35. package/dist/scripts/src/components/Avatar/Avatar.js +4 -2
  36. package/dist/scripts/src/components/Backdrop/Backdrop.js +2 -2
  37. package/dist/scripts/src/components/Badge/Badge.js +7 -5
  38. package/dist/scripts/src/components/Bookmark/Bookmark.js +5 -4
  39. package/dist/scripts/src/components/Card/Card.js +6 -4
  40. package/dist/scripts/src/components/ChangeListener/ChangeListener.js +2 -1
  41. package/dist/scripts/src/components/Charts/BarChart/BarChart.js +76 -0
  42. package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +108 -0
  43. package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +59 -0
  44. package/dist/scripts/src/components/Charts/LabelList/LabelList.js +38 -0
  45. package/dist/scripts/src/components/Charts/LabelList/LabelListNative.js +24 -0
  46. package/dist/scripts/src/components/Charts/Legend/Legend.js +30 -0
  47. package/dist/scripts/src/components/Charts/Legend/LegendNative.js +64 -0
  48. package/dist/scripts/src/components/Charts/LineChart/LineChart.js +53 -0
  49. package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +103 -0
  50. package/dist/scripts/src/components/Charts/PieChart/PieChart.js +58 -0
  51. package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +127 -0
  52. package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.js +27 -0
  53. package/dist/scripts/src/components/Charts/utils/ChartProvider.js +65 -0
  54. package/dist/scripts/src/components/Charts/utils/abstractions.js +26 -0
  55. package/dist/scripts/src/components/CodeBlock/CodeBlock.js +4 -4
  56. package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +5 -1
  57. package/dist/scripts/src/components/Column/Column.js +15 -9
  58. package/dist/scripts/src/components/Column/ColumnNative.js +5 -0
  59. package/dist/scripts/src/components/ComponentProvider.js +14 -6
  60. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +4 -3
  61. package/dist/scripts/src/components/DatePicker/DatePicker.js +5 -3
  62. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +1 -1
  63. package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +7 -2
  64. package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +88 -0
  65. package/dist/scripts/src/components/ExpandableItem/ExpandableItemNative.js +91 -0
  66. package/dist/scripts/src/components/FileInput/FileInput.js +8 -9
  67. package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -2
  68. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +2 -2
  69. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +9 -2
  70. package/dist/scripts/src/components/Footer/Footer.js +1 -0
  71. package/dist/scripts/src/components/Footer/FooterNative.js +4 -1
  72. package/dist/scripts/src/components/Form/Form.js +9 -5
  73. package/dist/scripts/src/components/Form/FormNative.js +2 -1
  74. package/dist/scripts/src/components/FormItem/FormItem.js +25 -15
  75. package/dist/scripts/src/components/FormItem/FormItemNative.js +1 -0
  76. package/dist/scripts/src/components/Heading/Heading.js +12 -6
  77. package/dist/scripts/src/components/Heading/HeadingNative.js +7 -0
  78. package/dist/scripts/src/components/Icon/Icon.js +7 -5
  79. package/dist/scripts/src/components/Image/Image.js +19 -9
  80. package/dist/scripts/src/components/Image/ImageNative.js +7 -2
  81. package/dist/scripts/src/components/Items/Items.js +2 -0
  82. package/dist/scripts/src/components/Items/ItemsNative.js +5 -1
  83. package/dist/scripts/src/components/Link/Link.js +3 -4
  84. package/dist/scripts/src/components/Link/LinkNative.js +6 -2
  85. package/dist/scripts/src/components/List/List.js +12 -11
  86. package/dist/scripts/src/components/List/ListNative.js +10 -2
  87. package/dist/scripts/src/components/Logo/Logo.js +7 -0
  88. package/dist/scripts/src/components/Logo/LogoNative.js +6 -2
  89. package/dist/scripts/src/components/Markdown/Markdown.js +5 -4
  90. package/dist/scripts/src/components/Markdown/MarkdownNative.js +64 -21
  91. package/dist/scripts/src/components/Markdown/utils.js +23 -1
  92. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
  93. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +7 -2
  94. package/dist/scripts/src/components/NavGroup/NavGroup.js +2 -1
  95. package/dist/scripts/src/components/NavLink/NavLink.js +5 -7
  96. package/dist/scripts/src/components/NavLink/NavLinkNative.js +7 -2
  97. package/dist/scripts/src/components/NavPanel/NavPanel.js +6 -0
  98. package/dist/scripts/src/components/NavPanel/NavPanelNative.js +6 -2
  99. package/dist/scripts/src/components/NestedApp/NestedApp.js +16 -4
  100. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +37 -34
  101. package/dist/scripts/src/components/NestedApp/defaultProps.js +10 -0
  102. package/dist/scripts/src/components/NoResult/NoResult.js +6 -2
  103. package/dist/scripts/src/components/NoResult/NoResultNative.js +8 -3
  104. package/dist/scripts/src/components/NumberBox/NumberBox.js +8 -6
  105. package/dist/scripts/src/components/NumberBox/NumberBox2.js +6 -6
  106. package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +15 -2
  107. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +16 -2
  108. package/dist/scripts/src/components/Option/Option.js +10 -15
  109. package/dist/scripts/src/components/Option/OptionNative.js +18 -0
  110. package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +6 -2
  111. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +4 -1
  112. package/dist/scripts/src/components/Pages/Pages.js +7 -3
  113. package/dist/scripts/src/components/Pages/PagesNative.js +5 -0
  114. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +1 -1
  115. package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +5 -2
  116. package/dist/scripts/src/components/Queue/Queue.js +11 -6
  117. package/dist/scripts/src/components/Queue/QueueNative.js +7 -1
  118. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +5 -5
  119. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +9 -2
  120. package/dist/scripts/src/components/RadioGroup/RadioItem.js +8 -2
  121. package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +6 -2
  122. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +4 -1
  123. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +4 -0
  124. package/dist/scripts/src/components/Redirect/Redirect.js +8 -2
  125. package/dist/scripts/src/components/Select/Select.js +21 -12
  126. package/dist/scripts/src/components/Select/SelectNative.js +15 -2
  127. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +6 -3
  128. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +6 -2
  129. package/dist/scripts/src/components/Slider/Slider.js +28 -9
  130. package/dist/scripts/src/components/Slider/SliderNative.js +14 -3
  131. package/dist/scripts/src/components/Spinner/Spinner.js +2 -2
  132. package/dist/scripts/src/components/Spinner/SpinnerNative.js +6 -2
  133. package/dist/scripts/src/components/Splitter/Splitter.js +6 -6
  134. package/dist/scripts/src/components/Splitter/SplitterNative.js +10 -2
  135. package/dist/scripts/src/components/Stack/Stack.js +4 -4
  136. package/dist/scripts/src/components/Stack/StackNative.js +8 -2
  137. package/dist/scripts/src/components/StickyBox/StickyBox.js +1 -1
  138. package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +7 -1
  139. package/dist/scripts/src/components/Table/Table.js +15 -14
  140. package/dist/scripts/src/components/Table/TableNative.js +25 -9
  141. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +12 -3
  142. package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +6 -2
  143. package/dist/scripts/src/components/Tabs/Tabs.js +2 -2
  144. package/dist/scripts/src/components/Tabs/TabsNative.js +7 -2
  145. package/dist/scripts/src/components/Text/Text.js +14 -13
  146. package/dist/scripts/src/components/Text/TextNative.js +7 -2
  147. package/dist/scripts/src/components/TextArea/TextArea.js +8 -5
  148. package/dist/scripts/src/components/TextArea/TextAreaNative.js +19 -2
  149. package/dist/scripts/src/components/TextBox/TextBox.js +5 -4
  150. package/dist/scripts/src/components/TextBox/TextBoxNative.js +14 -2
  151. package/dist/scripts/src/components/Theme/Theme.js +1 -1
  152. package/dist/scripts/src/components/Theme/ThemeNative.js +10 -14
  153. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +18 -8
  154. package/dist/scripts/src/components/TreeDisplay/TreeDisplay.js +1 -1
  155. package/dist/scripts/src/components/TreeDisplay/TreeDisplayNative.js +2 -1
  156. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -57
  157. package/dist/scripts/src/components/ValidationSummary/ValidationSummaryNative.js +64 -0
  158. package/dist/scripts/src/components/metadata-helpers.js +11 -8
  159. package/dist/scripts/src/components-core/InspectorContext.js +2 -7
  160. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +1 -1
  161. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +6 -2
  162. package/dist/scripts/src/components-core/loader/DataLoader.js +1 -1
  163. package/dist/scripts/src/components-core/loader/Loader.js +7 -3
  164. package/dist/scripts/src/components-core/theming/themes/palette.js +5 -4
  165. package/dist/scripts/src/components-core/theming/themes/root.js +5 -4
  166. package/dist/scripts/src/components-core/theming/transformThemeVars.js +1 -17
  167. package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +92 -48
  168. package/dist/scripts/src/parsers/xmlui-parser/parser.js +179 -189
  169. package/dist/standalone/xmlui-standalone.es.d.ts +235 -223
  170. package/dist/standalone/xmlui-standalone.umd.js +288 -316
  171. package/package.json +5 -6
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ExpandableItem = exports.defaultExpandableItemProps = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const react_2 = require("react");
10
+ const classnames_1 = __importDefault(require("classnames"));
11
+ const ExpandableItem_module_scss_1 = __importDefault(require("./ExpandableItem.module.scss"));
12
+ const IconNative_1 = require("../Icon/IconNative");
13
+ const Toggle_1 = require("../Toggle/Toggle");
14
+ exports.defaultExpandableItemProps = {
15
+ initiallyExpanded: false,
16
+ enabled: true,
17
+ iconExpanded: "chevrondown",
18
+ iconCollapsed: "chevronright",
19
+ iconPosition: "end",
20
+ withSwitch: false,
21
+ };
22
+ exports.ExpandableItem = (0, react_1.forwardRef)(function ExpandableItem({ summary, children, className, style, initiallyExpanded = exports.defaultExpandableItemProps.initiallyExpanded, enabled = exports.defaultExpandableItemProps.enabled, iconExpanded = exports.defaultExpandableItemProps.iconExpanded, iconCollapsed = exports.defaultExpandableItemProps.iconCollapsed, iconPosition = exports.defaultExpandableItemProps.iconPosition, withSwitch = exports.defaultExpandableItemProps.withSwitch, onExpandedChange, registerComponentApi, }, ref) {
23
+ const [isOpen, setIsOpen] = (0, react_2.useState)(initiallyExpanded);
24
+ const toggleOpen = (0, react_1.useCallback)(() => {
25
+ if (!enabled)
26
+ return;
27
+ const newValue = !isOpen;
28
+ setIsOpen(newValue);
29
+ onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(newValue);
30
+ }, [enabled, isOpen, onExpandedChange]);
31
+ // Register component API
32
+ const expand = (0, react_1.useCallback)(() => {
33
+ if (!isOpen && enabled) {
34
+ setIsOpen(true);
35
+ onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(true);
36
+ }
37
+ }, [enabled, isOpen, onExpandedChange]);
38
+ const collapse = (0, react_1.useCallback)(() => {
39
+ if (isOpen && enabled) {
40
+ setIsOpen(false);
41
+ onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(false);
42
+ }
43
+ }, [enabled, isOpen, onExpandedChange]);
44
+ const toggle = (0, react_1.useCallback)(() => {
45
+ toggleOpen();
46
+ }, [toggleOpen]);
47
+ const getIsExpanded = (0, react_1.useCallback)(() => isOpen, [isOpen]);
48
+ // Handle switch value change
49
+ const handleSwitchChange = (0, react_1.useCallback)((value) => {
50
+ if (!enabled)
51
+ return;
52
+ setIsOpen(value);
53
+ onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(value);
54
+ }, [enabled, onExpandedChange]);
55
+ // Register these functions with the component API using useEffect
56
+ (0, react_1.useEffect)(() => {
57
+ registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
58
+ expand,
59
+ collapse,
60
+ toggle,
61
+ isExpanded: getIsExpanded,
62
+ });
63
+ }, [registerComponentApi, expand, collapse, toggle, getIsExpanded]);
64
+ // Create refs for the Toggle components
65
+ const toggleStartRef = (0, react_1.useRef)();
66
+ const toggleEndRef = (0, react_1.useRef)();
67
+ // Handler for clicking on the summary when using a switch
68
+ const handleSummaryClick = (0, react_1.useCallback)(() => {
69
+ var _a, _b;
70
+ if (!enabled || !withSwitch)
71
+ return;
72
+ const newValue = !isOpen;
73
+ setIsOpen(newValue);
74
+ onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(newValue);
75
+ // Update the toggle switch UI state too
76
+ if (iconPosition === "start" && ((_a = toggleStartRef.current) === null || _a === void 0 ? void 0 : _a.setValue)) {
77
+ toggleStartRef.current.setValue(newValue);
78
+ }
79
+ else if (iconPosition === "end" && ((_b = toggleEndRef.current) === null || _b === void 0 ? void 0 : _b.setValue)) {
80
+ toggleEndRef.current.setValue(newValue);
81
+ }
82
+ }, [enabled, withSwitch, isOpen, onExpandedChange, iconPosition]);
83
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(ExpandableItem_module_scss_1.default.expandableItem, className, {
84
+ [ExpandableItem_module_scss_1.default.open]: isOpen,
85
+ [ExpandableItem_module_scss_1.default.disabled]: !enabled,
86
+ [ExpandableItem_module_scss_1.default.withSwitch]: withSwitch,
87
+ }), style: style, ref: ref, children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(ExpandableItem_module_scss_1.default.summary, {
88
+ [ExpandableItem_module_scss_1.default.iconStart]: iconPosition === "start",
89
+ [ExpandableItem_module_scss_1.default.iconEnd]: iconPosition === "end",
90
+ }), onClick: enabled ? (withSwitch ? handleSummaryClick : toggleOpen) : undefined, children: [(0, jsx_runtime_1.jsx)("div", { className: withSwitch ? ExpandableItem_module_scss_1.default.switch : ExpandableItem_module_scss_1.default.icon, children: withSwitch ? ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { variant: "switch", value: isOpen, enabled: enabled, onDidChange: handleSwitchChange })) : ((0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: isOpen ? iconExpanded : iconCollapsed, fallback: isOpen ? "chevrondown" : "chevronright" })) }), (0, jsx_runtime_1.jsx)("div", { className: ExpandableItem_module_scss_1.default.summaryContent, children: summary })] }), isOpen && (0, jsx_runtime_1.jsx)("div", { className: ExpandableItem_module_scss_1.default.content, children: children })] }));
91
+ });
@@ -35,17 +35,16 @@ exports.FileInputMd = (0, ComponentDefs_1.createMetadata)({
35
35
  buttonLabel: (0, ComponentDefs_1.d)(`This property is an optional string to set a label for the button part.`),
36
36
  buttonIcon: (0, ComponentDefs_1.d)(`The ID of the icon to display in the button. You can change the default icon for all ${COMP} ` +
37
37
  `instances with the "icon.browse:FileInput" declaration in the app configuration file.`),
38
- buttonIconPosition: (0, ComponentDefs_1.d)(`This optional string determines the location of the button icon.`, abstractions_1.iconPositionNames),
39
- acceptsFileType: (0, ComponentDefs_1.d)(`A list of file types the input controls accepts provided as a string array.`),
40
- multiple: (0, ComponentDefs_1.d)(`This boolean property enables to add not just one (\`false\`), but multiple files to the field ` +
38
+ buttonIconPosition: (0, ComponentDefs_1.d)(`This optional string determines the location of the button icon.`, abstractions_1.iconPositionNames, "string", "start"),
39
+ acceptsFileType: (0, ComponentDefs_1.d)(`An optional list of file types the input controls accepts provided as a string array.`),
40
+ multiple: Object.assign(Object.assign({}, (0, ComponentDefs_1.d)(`This boolean property enables to add not just one (\`false\`), but multiple files to the field ` +
41
41
  `(\`true\`). This is done either by dragging onto the field or by selecting multiple files ` +
42
- `in the browser menu after clicking the input field button.`, null, "boolean", false),
43
- directory: (0, ComponentDefs_1.d)(`This boolean property indicates whether the component allows selecting directories (\`true\`) ` +
44
- `or files only (\`false\`).`, null, "boolean", false),
45
- buttonPosition: (0, ComponentDefs_1.d)(`This property determines the position of the button relative to the input field. ` +
46
- `The default is "end".`, ["start", "end"]),
42
+ `in the browser menu after clicking the input field button.`, null, "boolean")), { defaultValue: FileInputNative_1.defaultProps.multiple }),
43
+ directory: Object.assign(Object.assign({}, (0, ComponentDefs_1.d)(`This boolean property indicates whether the component allows selecting directories (\`true\`) ` +
44
+ `or files only (\`false\`).`, null, "boolean")), { defaultValue: FileInputNative_1.defaultProps.directory }),
45
+ buttonPosition: Object.assign(Object.assign({}, (0, ComponentDefs_1.d)(`This property determines the position of the button relative to the input field.`, ["start", "end"])), { defaultValue: FileInputNative_1.defaultProps.buttonPosition }),
47
46
  buttonSize: (0, ComponentDefs_1.d)("The size of the button (small, medium, large)", abstractions_1.sizeMd),
48
- buttonThemeColor: (0, ComponentDefs_1.d)("The button color scheme (primary, secondary, attention)", abstractions_1.buttonThemeNames),
47
+ buttonThemeColor: (0, ComponentDefs_1.d)("The button color scheme (primary, secondary, attention)", abstractions_1.buttonThemeNames, "string", FileInputNative_1.defaultProps.buttonThemeColor),
49
48
  },
50
49
  events: {
51
50
  didChange: (0, metadata_helpers_1.dDidChange)(COMP),
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.FileInput = void 0;
39
+ exports.FileInput = exports.defaultProps = void 0;
40
40
  exports.isFile = isFile;
41
41
  exports.isFileArray = isFileArray;
42
42
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -52,7 +52,19 @@ const TextBoxNative_1 = require("../TextBox/TextBoxNative");
52
52
  const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
53
53
  // https://github.com/react-dropzone/react-dropzone/issues/1259
54
54
  const { useDropzone } = dropzone;
55
- const FileInput = ({ id, enabled = true, style, placeholder, buttonPosition = "end", buttonLabel = "Browse", buttonIcon, buttonIconPosition, variant, buttonThemeColor, buttonSize, autoFocus, validationStatus, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, value, initialValue, acceptsFileType, multiple = false, directory = false, label, labelPosition, labelWidth, labelBreak, required, }) => {
55
+ exports.defaultProps = {
56
+ enabled: true,
57
+ buttonPosition: "end",
58
+ buttonLabel: "Browse",
59
+ multiple: false,
60
+ directory: false,
61
+ buttonThemeColor: "primary",
62
+ updateState: constants_1.noop,
63
+ onDidChange: constants_1.noop,
64
+ onFocus: constants_1.noop,
65
+ onBlur: constants_1.noop,
66
+ };
67
+ const FileInput = ({ id, enabled = exports.defaultProps.enabled, style, placeholder, buttonPosition = exports.defaultProps.buttonPosition, buttonLabel = exports.defaultProps.buttonLabel, buttonIcon, buttonIconPosition, variant, buttonThemeColor, buttonSize, autoFocus, validationStatus, updateState = exports.defaultProps.updateState, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, registerComponentApi, value, initialValue, acceptsFileType, multiple = exports.defaultProps.multiple, directory = exports.defaultProps.directory, label, labelPosition, labelWidth, labelBreak, required, }) => {
56
68
  // Don't accept any (initial) value if it is not a File array explicitly
57
69
  const _initialValue = isFileArray(initialValue) ? initialValue : undefined;
58
70
  const _value = isFileArray(value) ? value : undefined;
@@ -18,7 +18,7 @@ exports.FileUploadDropZoneMd = (0, ComponentDefs_1.createMetadata)({
18
18
  text: {
19
19
  description: "With this property, you can change the default text to display when files " +
20
20
  "are dragged over the drop zone.",
21
- defaultValue: "Drop files here",
21
+ defaultValue: FileUploadDropZoneNative_1.defaultProps.text,
22
22
  type: "string",
23
23
  },
24
24
  allowPaste: {
@@ -26,7 +26,7 @@ exports.FileUploadDropZoneMd = (0, ComponentDefs_1.createMetadata)({
26
26
  "clipboard (\`true\`) or " +
27
27
  "only dragged files (\`false\`).",
28
28
  type: "boolean",
29
- defaultValue: true,
29
+ defaultValue: FileUploadDropZoneNative_1.defaultProps.allowPaste,
30
30
  },
31
31
  enabled: (0, ComponentDefs_1.d)(`If set to \`false\`, the drop zone will be disabled and users will not be able to upload files.`, null, "boolean", true),
32
32
  },
@@ -45,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.FileUploadDropZone = void 0;
48
+ exports.FileUploadDropZone = exports.defaultProps = void 0;
49
49
  const jsx_runtime_1 = require("react/jsx-runtime");
50
50
  const react_1 = require("react");
51
51
  const dropzone = __importStar(require("react-dropzone"));
@@ -55,7 +55,14 @@ const constants_1 = require("../../components-core/constants");
55
55
  const IconNative_1 = require("../Icon/IconNative");
56
56
  // https://github.com/react-dropzone/react-dropzone/issues/1259
57
57
  const { useDropzone } = dropzone;
58
- exports.FileUploadDropZone = (0, react_1.forwardRef)(function FileUploadDropZone({ children, onUpload = constants_1.asyncNoop, uid = "fileUploadDialog", registerComponentApi, style, allowPaste = true, text = "Drop files here", disabled = false, }, forwardedRef) {
58
+ exports.defaultProps = {
59
+ onUpload: constants_1.asyncNoop,
60
+ uid: "fileUploadDialog",
61
+ allowPaste: true,
62
+ text: "Drop files here",
63
+ disabled: false,
64
+ };
65
+ exports.FileUploadDropZone = (0, react_1.forwardRef)(function FileUploadDropZone({ children, onUpload = exports.defaultProps.onUpload, uid = exports.defaultProps.uid, registerComponentApi, style, allowPaste = exports.defaultProps.allowPaste, text = exports.defaultProps.text, disabled = exports.defaultProps.disabled, }, forwardedRef) {
59
66
  const onDrop = (0, react_1.useCallback)((acceptedFiles) => __awaiter(this, void 0, void 0, function* () {
60
67
  if (!acceptedFiles.length) {
61
68
  return;
@@ -23,6 +23,7 @@ exports.FooterMd = (0, ComponentDefs_1.createMetadata)({
23
23
  [`maxWidth-content-${COMP}`]: "$maxWidth-content",
24
24
  [`borderTop-${COMP}`]: `1px solid $borderColor`,
25
25
  [`padding-${COMP}`]: "$space-2 $space-4",
26
+ [`gap-${COMP}`]: "$space-normal",
26
27
  light: {
27
28
  // --- No light-specific theme vars
28
29
  },
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Footer = void 0;
6
+ exports.Footer = exports.defaultProps = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const classnames_1 = __importDefault(require("classnames"));
@@ -11,6 +11,9 @@ const Footer_module_scss_1 = __importDefault(require("./Footer.module.scss"));
11
11
  const AppLayoutContext_1 = require("../App/AppLayoutContext");
12
12
  // =====================================================================================================================
13
13
  // React Footer component implementation
14
+ exports.defaultProps = {
15
+ // No default props needed currently, but adding object for consistency
16
+ };
14
17
  exports.Footer = (0, react_1.forwardRef)(function Footer({ children, style, className, }, forwardedRef) {
15
18
  const { layout } = (0, AppLayoutContext_1.useAppLayoutContext)() || {};
16
19
  const canRestrictContentWidth = layout !== "vertical-full-header";
@@ -27,8 +27,10 @@ exports.FormMd = (0, ComponentDefs_1.createMetadata)({
27
27
  defaultValue: FormNative_1.defaultProps.itemLabelPosition,
28
28
  },
29
29
  itemLabelWidth: {
30
- description: `This property sets the width of the item labels within the form. Individual ` +
31
- `\`FormItem\` instances can override this property.`,
30
+ description: "This property sets the width of the item labels within the form. Individual " +
31
+ "\`FormItem\` instances can override this property. If this property is not set, " +
32
+ "each form item nested in the form uses its calculated label width. These widths " +
33
+ "may be different for each item.",
32
34
  type: "string",
33
35
  },
34
36
  itemLabelBreak: {
@@ -44,8 +46,9 @@ exports.FormMd = (0, ComponentDefs_1.createMetadata)({
44
46
  defaultValue: FormNative_1.defaultProps.keepModalOpenOnSubmit,
45
47
  },
46
48
  data: {
47
- description: `This property sets the initial value of the form's data structure. The form infrastructure ` +
48
- `uses this value to set the initial state of form items within the form.`,
49
+ description: "This property sets the initial value of the form's data structure. The form infrastructure " +
50
+ "uses this value to set the initial state of form items within the form. If this property is" +
51
+ "not set, the form does not have an initial value.",
49
52
  },
50
53
  cancelLabel: {
51
54
  description: "This property defines the label of the Cancel button.",
@@ -67,13 +70,14 @@ exports.FormMd = (0, ComponentDefs_1.createMetadata)({
67
70
  description: `By default, the Cancel button is to the left of the Save button. Set this property to ` +
68
71
  `\`true\` to swap them or \`false\` to keep their original location.`,
69
72
  type: "boolean",
73
+ defaultValue: FormNative_1.defaultProps.swapCancelAndSave,
70
74
  },
71
75
  submitUrl: (0, ComponentDefs_1.d)(`URL to submit the form data.`),
72
76
  submitMethod: {
73
77
  description: "This property sets the HTTP method to use when submitting the form data. If not " +
74
78
  "defined, `put` is used when the form has initial data; otherwise, `post`.",
75
79
  },
76
- enabled: (0, ComponentDefs_1.d)(`Whether the form is enabled or not. The default value is \`true\`.`),
80
+ enabled: (0, metadata_helpers_1.dEnabled)(),
77
81
  _data_url: (0, metadata_helpers_1.dInternal)("when we have an api bound data prop, we inject the url here"),
78
82
  },
79
83
  events: {
@@ -170,6 +170,7 @@ exports.defaultProps = {
170
170
  itemLabelPosition: "top",
171
171
  itemLabelBreak: true,
172
172
  keepModalOpenOnSubmit: false,
173
+ swapCancelAndSave: false,
173
174
  };
174
175
  // --- Remove the properties from formState.subject where the property name ends with UNBOUND_FIELD_SUFFIX
175
176
  function cleanUpSubject(subject) {
@@ -180,7 +181,7 @@ function cleanUpSubject(subject) {
180
181
  return acc;
181
182
  }, {});
182
183
  }
183
- const Form = (0, react_1.forwardRef)(function ({ formState, dispatch, initialValue = constants_1.EMPTY_OBJECT, children, style, enabled = true, cancelLabel = "Cancel", saveLabel = "Save", saveInProgressLabel = "Saving...", swapCancelAndSave, onSubmit, onCancel, onReset, buttonRow, id, registerComponentApi, itemLabelBreak = true, itemLabelWidth, itemLabelPosition = "top", keepModalOpenOnSubmit = false, }, ref) {
184
+ const Form = (0, react_1.forwardRef)(function ({ formState, dispatch, initialValue = constants_1.EMPTY_OBJECT, children, style, enabled = true, cancelLabel = exports.defaultProps.cancelLabel, saveLabel = exports.defaultProps.saveLabel, saveInProgressLabel = exports.defaultProps.saveInProgressLabel, swapCancelAndSave, onSubmit, onCancel, onReset, buttonRow, id, registerComponentApi, itemLabelBreak = exports.defaultProps.itemLabelBreak, itemLabelWidth, itemLabelPosition = exports.defaultProps.itemLabelPosition, keepModalOpenOnSubmit = exports.defaultProps.keepModalOpenOnSubmit, }, ref) {
184
185
  const formRef = (0, react_1.useRef)(null);
185
186
  (0, react_1.useImperativeHandle)(ref, () => formRef.current);
186
187
  const [confirmSubmitModalVisible, setConfirmSubmitModalVisible] = (0, react_1.useState)(false);
@@ -35,14 +35,15 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
35
35
  `component's data.`,
36
36
  props: {
37
37
  bindTo: {
38
- description: `This property binds a particular input field to one of the attributes of the \`Form\` data. ` +
39
- `It names the property of the form's \`data\` data to get the input's initial value.` +
40
- `When the field is saved, its value will be stored in the \`data\` property with this name.`,
38
+ description: "This property binds a particular input field to one of the attributes of the \`Form\` data. " +
39
+ "It names the property of the form's \`data\` data to get the input's initial value." +
40
+ "When the field is saved, its value will be stored in the \`data\` property with this name. " +
41
+ "If the property is not set, the input will be bound to an internal data field but not submitted.",
41
42
  },
42
43
  autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
43
44
  label: (0, metadata_helpers_1.dLabel)(),
44
45
  labelPosition: (0, metadata_helpers_1.dLabelPosition)(),
45
- labelWidth: (0, ComponentDefs_1.d)(`This property sets the width of the item label.`),
46
+ labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
46
47
  labelBreak: {
47
48
  description: `This boolean value indicates if the label can be split into multiple lines if it would ` +
48
49
  `overflow the available label width.`,
@@ -72,25 +73,28 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
72
73
  initialValue: (0, metadata_helpers_1.dInitialValue)(),
73
74
  required: (0, metadata_helpers_1.dRequired)(),
74
75
  requiredInvalidMessage: {
75
- description: `This optional string property is used to customize the message that is displayed if the ` +
76
- `field is not filled in.`,
76
+ description: "This optional string property is used to customize the message that is displayed if the " +
77
+ "field is not filled in. If not defined, the default message is used.",
77
78
  valueType: "string",
78
79
  },
79
80
  minLength: {
80
- description: `Checks whether the input has a minimum length of a specified value.`,
81
+ description: "This property sets the minimum length of the input value. If the value is not set, " +
82
+ "no minimum length check is done.",
81
83
  valueType: "number",
82
84
  },
83
85
  maxLength: {
84
- description: `Checks whether the input has a maximum length of a specified value.`,
86
+ description: "This property sets the maximum length of the input value. If the value is not set, " +
87
+ "no maximum length check is done.",
85
88
  valueType: "number",
86
89
  },
87
90
  maxTextLength: {
88
- description: `The maximum length of the text in the input field`,
91
+ description: "The maximum length of the text in the input field. If this value is not set, " +
92
+ "no maximum length constraint is set for the input field.",
89
93
  valueType: "number",
90
94
  },
91
95
  lengthInvalidMessage: {
92
- description: `This optional string property is used to customize the message that is displayed on a failed ` +
93
- `length check: [minLength](#minlength) or [maxLength](#maxlength).`,
96
+ description: "This optional string property is used to customize the message that is displayed on a failed " +
97
+ "length check: [minLength](#minlength) or [maxLength](#maxlength).",
94
98
  valueType: "string",
95
99
  },
96
100
  lengthInvalidSeverity: {
@@ -100,11 +104,13 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
100
104
  defaultValue: "error",
101
105
  },
102
106
  minValue: {
103
- description: `Checks whether the input has the minimum specified value.`,
107
+ description: "The minimum value of the input. If this value is not specified, no minimum " +
108
+ "value check is done.",
104
109
  valueType: "number",
105
110
  },
106
111
  maxValue: {
107
- description: `Checks whether the input has the maximum specified value.`,
112
+ description: "The maximum value of the input. If this value is not specified, no maximum " +
113
+ "value check is done.",
108
114
  valueType: "number",
109
115
  },
110
116
  rangeInvalidMessage: {
@@ -119,7 +125,8 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
119
125
  defaultValue: "error",
120
126
  },
121
127
  pattern: {
122
- description: `Checks whether the input fits a predefined regular expression.`,
128
+ description: "This value specifies a predefined regular expression to test the input value. " +
129
+ "If this value is not set, no pattern check is done.",
123
130
  valueType: "string",
124
131
  },
125
132
  patternInvalidMessage: {
@@ -134,7 +141,8 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
134
141
  defaultValue: "error",
135
142
  },
136
143
  regex: {
137
- description: `Checks whether the input fits the provided regular expression.`,
144
+ description: "This value specifies a custom regular expression to test the input value. If this value " +
145
+ "is not set, no regular expression pattern check is done.",
138
146
  valueType: "string",
139
147
  },
140
148
  regexInvalidMessage: {
@@ -153,6 +161,8 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
153
161
  },
154
162
  gap: {
155
163
  description: "This property defines the gap between the adornments and the input area.",
164
+ valueType: "string",
165
+ defaultValue: FormItemNative_1.defaultProps.gap,
156
166
  },
157
167
  },
158
168
  events: {
@@ -46,6 +46,7 @@ exports.defaultProps = {
46
46
  labelBreak: true,
47
47
  enabled: true,
48
48
  customValidationsDebounce: 0,
49
+ gap: "0",
49
50
  };
50
51
  const FormItemContext = (0, react_1.createContext)({ parentFormItemId: null });
51
52
  function ArrayLikeFormItem({ children, formItemId, registerComponentApi, value = constants_1.EMPTY_ARRAY, updateState, }) {
@@ -26,16 +26,17 @@ const COMP = "Heading";
26
26
  const VALUE_DESC = (0, ComponentDefs_1.d)(`This property determines the text displayed in the heading. \`${COMP}\` also accepts nested ` +
27
27
  `text instead of specifying the \`value\`. If both \`value\` and a nested text are used, ` +
28
28
  `the \`value\` will be displayed.`);
29
- const MAX_LINES_DESC = (0, ComponentDefs_1.d)(`This property determines the maximum number of lines the component can wrap to. If there is ` +
30
- `not enough space for all of the text, the component wraps the text up to as many ` +
31
- `lines as specified.`);
29
+ const MAX_LINES_DESC = (0, ComponentDefs_1.d)("This optional property determines the maximum number of lines the component can wrap to. " +
30
+ "If there is not enough space for all of the text, the component wraps the text up to as many " +
31
+ "lines as specified. If the value is not specified, there is no limit on the number of " +
32
+ "displayed lines.");
32
33
  const ELLIPSES_DESC = {
33
34
  description: `This property indicates whether ellipses should be displayed (\`true\`) when the heading ` +
34
35
  `text is cropped or not (\`false\`).`,
35
36
  type: "boolean",
36
37
  defaultValue: HeadingNative_1.defaultProps.ellipses,
37
38
  };
38
- const PRESERVE_DESC = (0, ComponentDefs_1.d)(`This property indicates whether linebreaks should be preserved when ` + `displaying text.`);
39
+ const PRESERVE_DESC = (0, ComponentDefs_1.d)(`This property indicates whether linebreaks should be preserved when ` + `displaying text.`, undefined, "boolean", HeadingNative_1.defaultProps.preserveLinebreaks);
39
40
  const LEVEL_DESC = (level) => `Represents a heading level ${level} text`;
40
41
  const OMIT_FROM_TOC_DESC = {
41
42
  description: "If true, this heading will be excluded from the table of contents.",
@@ -55,6 +56,11 @@ exports.HeadingMd = (0, ComponentDefs_1.createMetadata)({
55
56
  ellipses: ELLIPSES_DESC,
56
57
  preserveLinebreaks: PRESERVE_DESC,
57
58
  omitFromToc: OMIT_FROM_TOC_DESC,
59
+ showAnchor: {
60
+ description: "This property indicates whether an anchor link should be displayed next to the heading. " +
61
+ "If set to `true`, an anchor link will be displayed on hover next to the heading.",
62
+ type: "boolean",
63
+ }
58
64
  },
59
65
  themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
60
66
  limitThemeVarsToComponent: true,
@@ -219,10 +225,10 @@ exports.H6Md = (0, ComponentDefs_1.createMetadata)({
219
225
  },
220
226
  },
221
227
  });
222
- function renderHeading({ node, extractValue, layoutCss, level, renderChild }) {
228
+ function renderHeading({ node, extractValue, layoutCss, level, showAnchor, renderChild }) {
223
229
  var _a, _b;
224
230
  const _c = node.props, { maxLines, preserveLinebreaks, ellipses } = _c, restProps = __rest(_c, ["maxLines", "preserveLinebreaks", "ellipses"]);
225
- return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, Object.assign({ uid: node.uid, level: ((_a = extractValue.asOptionalString(level)) !== null && _a !== void 0 ? _a : "h1"), maxLines: extractValue.asOptionalNumber(maxLines), preserveLinebreaks: extractValue.asOptionalBoolean(preserveLinebreaks, false), ellipses: extractValue.asOptionalBoolean(ellipses, true), style: layoutCss, omitFromToc: extractValue.asOptionalBoolean((_b = node.props) === null || _b === void 0 ? void 0 : _b.omitFromToc) }, (0, extractParam_1.resolveAndCleanProps)(restProps, extractValue, layoutCss), { children: extractValue.asDisplayText(node.props.value) || renderChild(node.children) })));
231
+ return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, Object.assign({ uid: node.uid, level: ((_a = extractValue.asOptionalString(level)) !== null && _a !== void 0 ? _a : "h1"), maxLines: extractValue.asOptionalNumber(maxLines), preserveLinebreaks: extractValue.asOptionalBoolean(preserveLinebreaks, false), ellipses: extractValue.asOptionalBoolean(ellipses, true), showAnchor: extractValue.asOptionalBoolean(showAnchor), style: layoutCss, omitFromToc: extractValue.asOptionalBoolean((_b = node.props) === null || _b === void 0 ? void 0 : _b.omitFromToc) }, (0, extractParam_1.resolveAndCleanProps)(restProps, extractValue, layoutCss), { children: extractValue.asDisplayText(node.props.value) || renderChild(node.children) })));
226
232
  }
227
233
  exports.headingComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.HeadingMd, ({ node, extractValue, layoutCss, renderChild }) => {
228
234
  return renderHeading({
@@ -24,13 +24,16 @@ const css_utils_1 = require("../../components-core/utils/css-utils");
24
24
  const TableOfContentsContext_1 = require("../../components-core/TableOfContentsContext");
25
25
  const hooks_1 = require("../../components-core/utils/hooks");
26
26
  const react_2 = require("@remix-run/react");
27
+ const AppContext_1 = require("../../components-core/AppContext");
27
28
  exports.defaultProps = {
28
29
  level: "h1",
29
30
  ellipses: true,
30
31
  omitFromToc: false,
31
32
  maxLines: 0,
33
+ preserveLinebreaks: false,
32
34
  };
33
35
  exports.Heading = (0, react_1.forwardRef)(function Heading(_a, forwardedRef) {
36
+ var _b, _c;
34
37
  var { uid, level = exports.defaultProps.level, children, sx, style, title, maxLines = exports.defaultProps.maxLines, preserveLinebreaks, ellipses = exports.defaultProps.ellipses, className, omitFromToc = exports.defaultProps.omitFromToc, showAnchor } = _a, furtherProps = __rest(_a, ["uid", "level", "children", "sx", "style", "title", "maxLines", "preserveLinebreaks", "ellipses", "className", "omitFromToc", "showAnchor"]);
35
38
  const Element = level === null || level === void 0 ? void 0 : level.toLowerCase();
36
39
  const elementRef = (0, react_1.useRef)(null);
@@ -38,6 +41,10 @@ exports.Heading = (0, react_1.forwardRef)(function Heading(_a, forwardedRef) {
38
41
  const anchorRef = (0, react_1.useRef)(null);
39
42
  const tableOfContentsContext = (0, react_1.useContext)(TableOfContentsContext_1.TableOfContentsContext);
40
43
  const registerHeading = tableOfContentsContext === null || tableOfContentsContext === void 0 ? void 0 : tableOfContentsContext.registerHeading;
44
+ const appContext = (0, AppContext_1.useAppContext)();
45
+ if (showAnchor === undefined) {
46
+ showAnchor = (_c = (_b = appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals) === null || _b === void 0 ? void 0 : _b.showHeadingAnchors) !== null && _c !== void 0 ? _c : false;
47
+ }
41
48
  const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(elementRef, forwardedRef) : elementRef;
42
49
  (0, react_1.useEffect)(() => {
43
50
  var _a, _b, _c, _d;
@@ -15,15 +15,17 @@ exports.IconMd = (0, ComponentDefs_1.createMetadata)({
15
15
  status: "experimental",
16
16
  description: `This component is the representation of an icon.`,
17
17
  props: {
18
- name: (0, ComponentDefs_1.d)(`This string property specifies the name of the icon to display. All icons have unique names ` +
19
- `and identifying the name is case-sensitive.`),
18
+ name: (0, ComponentDefs_1.d)("This string property specifies the name of the icon to display. All icons have " +
19
+ "unique, case-sensitive names identifying them. If the icon name is not set, the " +
20
+ "`fallback` value is used."),
20
21
  size: {
21
22
  description: `This property defines the size of the \`${COMP}\`. Note that setting the \`height\` and/or ` +
22
- `the \`width\` of the component will override this property.`,
23
+ `the \`width\` of the component will override this property. You can use az explicit size ` +
24
+ "value (e.g., 32px) or one of these predefined values: `xs`, `sm`, `md`, `lg`.",
23
25
  availableValues: ["xs", "sm", "md", "lg"],
24
26
  },
25
- fallback: (0, ComponentDefs_1.d)(`This optional property provides a way to handle situations when the provided ` +
26
- `[icon name](#name) is not found in the registry.`),
27
+ fallback: (0, ComponentDefs_1.d)("This optional property provides a way to handle situations when the icon with the provided " +
28
+ "[icon name](#name) name does not exist. If the icon cannot be found, no icon is displayed."),
27
29
  },
28
30
  events: {
29
31
  click: (0, ComponentDefs_1.d)("This event is triggered when the icon is clicked."),
@@ -16,19 +16,29 @@ exports.ImageMd = (0, ComponentDefs_1.createMetadata)({
16
16
  description: `The \`${COMP}\` component represents or depicts an object, scene, idea, or other concept ` +
17
17
  `with a picture.`,
18
18
  props: {
19
- src: (0, ComponentDefs_1.d)(`This property is used to indicate the source (path) of the image to display.`),
20
- alt: (0, ComponentDefs_1.d)(`This property specifies an alternate text for the image.`),
19
+ src: (0, ComponentDefs_1.d)("This property is used to indicate the source (path) of the image to display. " +
20
+ "When not defined, no image is displayed."),
21
+ alt: (0, ComponentDefs_1.d)(`This optional property specifies an alternate text for the image.`),
21
22
  fit: {
22
23
  description: "This property sets how the image content should be resized to fit its container.",
23
24
  type: "string",
24
- defaultValue: "contain",
25
+ defaultValue: ImageNative_1.defaultProps.fit,
25
26
  },
26
- lazyLoad: (0, ComponentDefs_1.d)(`Lazy loading instructs the browser to load the image only when it is imminently needed ` +
27
- `(e.g. user scrolls to it). The default value is eager (\`false\`).`),
28
- aspectRatio: (0, ComponentDefs_1.d)(`This property sets a preferred aspect ratio for the image, which will be used in the ` +
29
- `calculation of auto sizes and some other layout functions.`),
30
- inline: (0, ComponentDefs_1.d)(`When set to true, the image will be displayed as an inline element instead of a block element.`),
31
- animation: (0, ComponentDefs_1.d)(`The animation object to be applied to the component`),
27
+ lazyLoad: {
28
+ description: `Lazy loading instructs the browser to load the image only when it is imminently needed ` +
29
+ `(e.g. user scrolls to it).`,
30
+ type: "boolean",
31
+ defaultValue: ImageNative_1.defaultProps.lazyLoad,
32
+ },
33
+ aspectRatio: (0, ComponentDefs_1.d)("This property sets a preferred aspect ratio for the image, which will be used in " +
34
+ "calculating auto sizes and other layout functions. If this value is not used, the " +
35
+ 'original aspect ratio is kept. The value can be a number of a string (such as "16/9").'),
36
+ inline: {
37
+ description: `When set to true, the image will be displayed as an inline element instead of a block element.`,
38
+ type: "boolean",
39
+ defaultValue: ImageNative_1.defaultProps.inline,
40
+ },
41
+ animation: (0, metadata_helpers_1.dInternal)(`The optional animation object to be applied to the component`),
32
42
  },
33
43
  events: {
34
44
  click: (0, metadata_helpers_1.dClick)(COMP),
@@ -3,12 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Image = void 0;
6
+ exports.Image = exports.defaultProps = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const classnames_1 = __importDefault(require("classnames"));
10
10
  const Image_module_scss_1 = __importDefault(require("./Image.module.scss"));
11
- exports.Image = (0, react_1.forwardRef)(function Img({ src, alt, fit = "contain", style, onClick, aspectRatio, lazyLoad, inline }, ref) {
11
+ exports.defaultProps = {
12
+ fit: "contain",
13
+ lazyLoad: false,
14
+ inline: false,
15
+ };
16
+ exports.Image = (0, react_1.forwardRef)(function Img({ src, alt, fit = exports.defaultProps.fit, style, onClick, aspectRatio, lazyLoad = exports.defaultProps.lazyLoad, inline = exports.defaultProps.inline }, ref) {
12
17
  return ((0, jsx_runtime_1.jsx)("img", { src: src, ref: ref, alt: alt, loading: lazyLoad ? "lazy" : "eager", className: (0, classnames_1.default)(Image_module_scss_1.default.img, {
13
18
  [Image_module_scss_1.default.clickable]: !!onClick,
14
19
  }), style: Object.assign(Object.assign(Object.assign({ objectFit: fit, boxShadow: "none" }, style), { flexShrink: 1, aspectRatio: aspectRatio }), (inline ? { display: 'inline' } : {})), onClick: onClick }));
@@ -16,6 +16,8 @@ exports.ItemsMd = (0, ComponentDefs_1.createMetadata)({
16
16
  data: (0, ComponentDefs_1.d)(`This property contains the list of data items (obtained from a data source) this component renders.`),
17
17
  reverse: {
18
18
  description: "This property reverses the order in which data is mapped to template components.",
19
+ type: "boolean",
20
+ defaultValue: ItemsNative_1.defaultProps.reverse,
19
21
  },
20
22
  itemTemplate: (0, metadata_helpers_1.dComponent)("The component template to display a single item"),
21
23
  },
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultProps = void 0;
3
4
  exports.Items = Items;
4
5
  const jsx_runtime_1 = require("react/jsx-runtime");
5
6
  const react_1 = require("react");
6
7
  const lodash_es_1 = require("lodash-es");
7
- function Items({ items, renderItem, reverse = false }) {
8
+ exports.defaultProps = {
9
+ reverse: false,
10
+ };
11
+ function Items({ items, renderItem, reverse = exports.defaultProps.reverse }) {
8
12
  const itemsToRender = (0, react_1.useMemo)(() => {
9
13
  if (!items) {
10
14
  return [];
@@ -17,22 +17,21 @@ exports.LinkMd = (0, ComponentDefs_1.createMetadata)({
17
17
  description: `A \`${COMP}\` component represents a navigation target within the app or a ` +
18
18
  `reference to an external web URL.`,
19
19
  props: {
20
- to: (0, ComponentDefs_1.d)(`This property defines the URL of the link.`),
20
+ to: (0, ComponentDefs_1.d)("This property defines the URL of the link. If the value is not defined, the link cannot be activated."),
21
21
  enabled: (0, metadata_helpers_1.dEnabled)(),
22
22
  active: {
23
23
  description: `Indicates whether this link is active or not. If so, it will have a distinct visual appearance.`,
24
24
  type: "boolean",
25
- defaultValue: false,
25
+ defaultValue: LinkNative_1.defaultProps.active,
26
26
  },
27
27
  target: {
28
28
  description: `This property specifies where to open the link represented by the \`${COMP}\`. This ` +
29
29
  `property accepts the following values (in accordance with the HTML standard):`,
30
30
  availableValues: abstractions_1.LinkTargetMd,
31
31
  type: "string",
32
- defaultValue: "_self",
33
32
  },
34
33
  label: (0, metadata_helpers_1.dLabel)(),
35
- icon: (0, ComponentDefs_1.d)(`This property allows you to add an icon (specify the icon's name) to the link.`),
34
+ icon: (0, ComponentDefs_1.d)(`This property allows you to add an optional icon (specify the icon's name) to the link.`),
36
35
  },
37
36
  themeVars: (0, themeVars_1.parseScssVar)(Link_module_scss_1.default.themeVars),
38
37
  themeVarDescriptions: {