xmlui 0.7.27 → 0.7.29

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 (58) hide show
  1. package/dist/{apiInterceptorWorker-Ca5HMlfW.mjs → apiInterceptorWorker-BXh2BMZL.mjs} +1 -1
  2. package/dist/{index-BMOK5q0U.mjs → index-B3eDGXIR.mjs} +8488 -8166
  3. package/dist/scripts/src/components/APICall/APICall.js +31 -29
  4. package/dist/scripts/src/components/AppHeader/AppHeader.js +4 -4
  5. package/dist/scripts/src/components/Badge/Badge.js +2 -2
  6. package/dist/scripts/src/components/Bookmark/Bookmark.js +7 -7
  7. package/dist/scripts/src/components/Bookmark/BookmarkNative.js +2 -2
  8. package/dist/scripts/src/components/Button/Button.js +1 -7
  9. package/dist/scripts/src/components/Carousel/Carousel.js +3 -1
  10. package/dist/scripts/src/components/Checkbox/Checkbox.js +0 -1
  11. package/dist/scripts/src/components/ColorPicker/ColorPicker.js +1 -1
  12. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +2 -1
  13. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +13 -4
  14. package/dist/scripts/src/components/FlowLayout/FlowLayout.js +18 -8
  15. package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +5 -1
  16. package/dist/scripts/src/components/Form/Form.js +53 -17
  17. package/dist/scripts/src/components/Form/FormContext.js +103 -1
  18. package/dist/scripts/src/components/Form/FormNative.js +9 -1
  19. package/dist/scripts/src/components/FormItem/FormItem.js +113 -33
  20. package/dist/scripts/src/components/FormItem/FormItemNative.js +8 -2
  21. package/dist/scripts/src/components/FormItem/Validations.js +1 -1
  22. package/dist/scripts/src/components/Heading/Heading.js +23 -4
  23. package/dist/scripts/src/components/Heading/HeadingNative.js +9 -4
  24. package/dist/scripts/src/components/Icon/Icon.js +5 -2
  25. package/dist/scripts/src/components/Icon/IconNative.js +2 -2
  26. package/dist/scripts/src/components/Image/Image.js +5 -1
  27. package/dist/scripts/src/components/Items/Items.js +4 -2
  28. package/dist/scripts/src/components/Items/ItemsNative.js +1 -3
  29. package/dist/scripts/src/components/Link/Link.js +13 -4
  30. package/dist/scripts/src/components/List/List.js +22 -5
  31. package/dist/scripts/src/components/Markdown/Markdown.js +8 -4
  32. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +12 -6
  33. package/dist/scripts/src/components/NavLink/NavLink.js +28 -10
  34. package/dist/scripts/src/components/NoResult/NoResult.js +6 -2
  35. package/dist/scripts/src/components/NumberBox/NumberBox.js +22 -6
  36. package/dist/scripts/src/components/Option/Option.js +1 -1
  37. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +5 -1
  38. package/dist/scripts/src/components/Spinner/Spinner.js +10 -2
  39. package/dist/scripts/src/components/Splitter/Splitter.js +38 -13
  40. package/dist/scripts/src/components/Stack/Stack.js +39 -11
  41. package/dist/scripts/src/components/StickyBox/StickyBox.js +7 -2
  42. package/dist/scripts/src/components/Switch/Switch.js +0 -1
  43. package/dist/scripts/src/components/Table/Table.js +35 -18
  44. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +13 -4
  45. package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +15 -22
  46. package/dist/scripts/src/components/Tabs/Tabs.js +8 -3
  47. package/dist/scripts/src/components/Text/Text.js +20 -8
  48. package/dist/scripts/src/components/TextArea/TextArea.js +30 -13
  49. package/dist/scripts/src/components/Theme/Theme.js +6 -2
  50. package/dist/scripts/src/components/abstractions.js +14 -3
  51. package/dist/scripts/src/components-core/TableOfContentsContext.js +57 -17
  52. package/dist/scripts/src/components-core/utils/extractParam.js +3 -2
  53. package/dist/style.css +1 -1
  54. package/dist/xmlui-metadata.mjs +9307 -5528
  55. package/dist/xmlui-metadata.umd.js +17 -17
  56. package/dist/xmlui-standalone.umd.js +166 -166
  57. package/dist/xmlui.mjs +1 -1
  58. package/package.json +1 -1
@@ -18,11 +18,15 @@ exports.NoResultMd = (0, ComponentDefs_1.createMetadata)({
18
18
  props: {
19
19
  label: (0, metadata_helpers_1.dLabel)(),
20
20
  icon: (0, ComponentDefs_1.d)(`This property defines the icon to display with the component.`),
21
- hideIcon: (0, ComponentDefs_1.d)(`This boolean property indicates if the icon should be hidden.`),
21
+ hideIcon: {
22
+ description: `This boolean property indicates if the icon should be hidden.`,
23
+ valueType: "boolean",
24
+ defaultValue: "false",
25
+ },
22
26
  },
23
27
  themeVars: (0, themeVars_1.parseScssVar)(NoResult_module_scss_1.default.themeVars),
24
28
  defaultThemeVars: {
25
- [`border-${COMP}`]: '0px solid $color-border',
29
+ [`border-${COMP}`]: "0px solid $color-border",
26
30
  [`padding-vertical-${COMP}`]: "$space-2",
27
31
  [`gap-icon-${COMP}`]: "$space-2",
28
32
  [`size-icon-${COMP}`]: "$space-8",
@@ -33,12 +33,28 @@ exports.NumberBoxMd = (0, ComponentDefs_1.createMetadata)({
33
33
  startIcon: (0, metadata_helpers_1.dStartIcon)(),
34
34
  endText: (0, metadata_helpers_1.dEndText)(),
35
35
  endIcon: (0, metadata_helpers_1.dEndIcon)(),
36
- hasSpinBox: (0, ComponentDefs_1.d)(`This boolean prop shows (\`true\`) or hides (\`false\`) the spinner buttons for the input field.`, null, "boolean", true),
37
- step: (0, ComponentDefs_1.d)(`This prop governs how big the step when clicking on the spinner of the field.`, null, "number"),
38
- integersOnly: (0, ComponentDefs_1.d)(`This boolean property signs whether the input field accepts integers only (\`true\`) ` +
39
- `or not (\`false\`).`, null, "boolean", false),
40
- zeroOrPositive: (0, ComponentDefs_1.d)(`This boolean property determines whether the input value can only be 0 or positive numbers ` +
41
- `(\`true\`) or also negative (\`false\`).`, null, "boolean", false),
36
+ hasSpinBox: {
37
+ description: `This boolean prop shows (\`true\`) or hides (\`false\`) the spinner buttons for the input field.`,
38
+ valueType: "boolean",
39
+ defaultValue: true,
40
+ },
41
+ step: {
42
+ description: `This prop governs how big the step when clicking on the spinner of the field.`,
43
+ valueType: "number",
44
+ defaultValue: 1,
45
+ },
46
+ integersOnly: {
47
+ description: `This boolean property signs whether the input field accepts integers only (\`true\`) ` +
48
+ `or not (\`false\`).`,
49
+ valueType: "boolean",
50
+ defaultValue: false,
51
+ },
52
+ zeroOrPositive: {
53
+ description: `This boolean property determines whether the input value can only be 0 or positive numbers ` +
54
+ `(\`true\`) or also negative (\`false\`).`,
55
+ valueType: "boolean",
56
+ defaultValue: false,
57
+ },
42
58
  minValue: (0, ComponentDefs_1.d)(`The minimum value the input field allows. Can be a float or an integer if ` +
43
59
  `[\`integersOnly\`](#integersonly) is set to \`false\`, otherwise it can only be an integer.`),
44
60
  maxValue: (0, ComponentDefs_1.d)(`The maximum value the input field allows. Can be a float or an integer if ` +
@@ -11,7 +11,7 @@ const container_helpers_1 = require("../container-helpers");
11
11
  const COMP = "Option";
12
12
  exports.OptionMd = (0, ComponentDefs_1.createMetadata)({
13
13
  description: `\`${COMP}\` is a non-visual component describing a selection option. Other components ` +
14
- `(such as \`Select\`, \`Combobox\`, and others) may use nested \`Option\` instances ` +
14
+ `(such as \`Select\`, \`AutoComplete\`, and others) may use nested \`Option\` instances ` +
15
15
  `from which the user can select.`,
16
16
  props: {
17
17
  label: (0, ComponentDefs_1.d)(`This property defines the text to display for the option. If \`label\` is not defined, ` +
@@ -14,7 +14,11 @@ const COMP = "ProgressBar";
14
14
  exports.ProgressBarMd = (0, ComponentDefs_1.createMetadata)({
15
15
  description: `A \`${COMP}\` component visually represents the progress of a task or process.`,
16
16
  props: {
17
- value: (0, ComponentDefs_1.d)(`This property defines the progress value with a number between 0 and 1.`),
17
+ value: {
18
+ description: `This property defines the progress value with a number between 0 and 1.`,
19
+ valueType: "number",
20
+ defaultValue: 0,
21
+ },
18
22
  },
19
23
  themeVars: (0, themeVars_1.parseScssVar)(ProgressBar_module_scss_1.default.themeVars),
20
24
  defaultThemeVars: {
@@ -15,8 +15,16 @@ exports.SpinnerMd = (0, ComponentDefs_1.createMetadata)({
15
15
  description: `The \`${COMP}\` component is an animated indicator that represents a particular action ` +
16
16
  `in progress without a deterministic progress value.`,
17
17
  props: {
18
- delay: (0, ComponentDefs_1.d)(`The delay in milliseconds before the spinner is displayed.`),
19
- fullScreen: (0, ComponentDefs_1.d)(`If set to \`true\`, the component will be rendered in a full screen container.`),
18
+ delay: {
19
+ description: `The delay in milliseconds before the spinner is displayed.`,
20
+ valueType: "number",
21
+ defaultValue: 400,
22
+ },
23
+ fullScreen: {
24
+ description: `If set to \`true\`, the component will be rendered in a full screen container.`,
25
+ valueType: "boolean",
26
+ defaultValue: false,
27
+ },
20
28
  themeColor: (0, ComponentDefs_1.d)(`(**NOT IMPLEMENTED YET**) The theme color of the component.`),
21
29
  },
22
30
  themeVars: (0, themeVars_1.parseScssVar)(Spinner_module_scss_1.default.themeVars),
@@ -18,20 +18,45 @@ const baseSplitterMd = (0, ComponentDefs_1.createMetadata)({
18
18
  description: `The \`${COMP}\` component divides a container (such as a window, panel, pane, etc.) ` +
19
19
  `into two resizable sections.`,
20
20
  props: {
21
- swapped: (0, ComponentDefs_1.d)(`This optional booelan property indicates whether the \`${COMP}\` sections are layed out as ` +
22
- `primary and secondary (\`false\`) or secondary and primary (\`true\`) from left to right.`),
21
+ swapped: {
22
+ description: `This optional booelan property indicates whether the \`${COMP}\` sections are layed out as ` +
23
+ `primary and secondary (\`false\`) or secondary and primary (\`true\`) from left to right.`,
24
+ valueType: "boolean",
25
+ defaultValue: false,
26
+ },
23
27
  splitterTemplate: (0, metadata_helpers_1.dComponent)(`The divider can be customized using XMLUI components via this property.`),
24
- initialPrimarySize: (0, ComponentDefs_1.d)(`This optional number property sets the initial size of the primary section. The unit of ` +
25
- `the size value is in pixels or percentages.`),
26
- minPrimarySize: (0, ComponentDefs_1.d)(`This property sets the minimum size the primary section can have. The unit of the size ` +
27
- `value is in pixels or percentages.`),
28
- maxPrimarySize: (0, ComponentDefs_1.d)(`This property sets the maximum size the primary section can have. The unit of the size ` +
29
- `value is in pixels or percentages.`),
30
- floating: (0, ComponentDefs_1.d)(`Toggles whether the resizer is visible (\`false\`) or not (\`true\`) when not hovered ` +
31
- `or dragged. The default value is \`false\`, meaning the resizer is visible all the time.`),
32
- orientation: (0, ComponentDefs_1.d)(`Sets whether the \`Splitter\` divides the container horizontally and lays out the ` +
33
- `section on top of each other (\`vertical\`), or vertically by placing the sections ` +
34
- `next to each other (\`horizontal\`).`),
28
+ initialPrimarySize: {
29
+ description: `This optional number property sets the initial size of the primary section. The unit of ` +
30
+ `the size value is in pixels or percentages.`,
31
+ valueType: "string",
32
+ defaultValue: "50%",
33
+ },
34
+ minPrimarySize: {
35
+ description: `This property sets the minimum size the primary section can have. The unit of the size ` +
36
+ `value is in pixels or percentages.`,
37
+ valueType: "string",
38
+ defaultValue: "0%",
39
+ },
40
+ maxPrimarySize: {
41
+ description: `This property sets the maximum size the primary section can have. The unit of the size ` +
42
+ `value is in pixels or percentages.`,
43
+ valueType: "string",
44
+ defaultValue: "100%",
45
+ },
46
+ floating: {
47
+ description: `Toggles whether the resizer is visible (\`false\`) or not (\`true\`) when not hovered ` +
48
+ `or dragged. The default value is \`false\`, meaning the resizer is visible all the time.`,
49
+ valueType: "boolean",
50
+ defaultValue: false,
51
+ },
52
+ orientation: {
53
+ description: `Sets whether the \`Splitter\` divides the container horizontally and lays out the ` +
54
+ `section on top of each other (\`vertical\`), or vertically by placing the sections ` +
55
+ `next to each other (\`horizontal\`).`,
56
+ valueType: "string",
57
+ availableValues: ["horizontal", "vertical"],
58
+ defaultValue: "vertical",
59
+ },
35
60
  },
36
61
  events: {
37
62
  resize: (0, ComponentDefs_1.d)(`This event fires when the component is resized.`),
@@ -13,26 +13,54 @@ const EngineError_1 = require("../../components-core/EngineError");
13
13
  const themeVars_1 = require("../../components-core/theming/themeVars");
14
14
  const metadata_helpers_1 = require("../metadata-helpers");
15
15
  const StackNative_1 = require("./StackNative");
16
+ const abstractions_1 = require("../abstractions");
16
17
  const COMP = "Stack";
17
- const HORIZONTAL_ALIGNMENT = (0, ComponentDefs_1.d)(`Manages the horizontal content alignment for each child element in the Stack.`);
18
- const VERTICAL_ALIGNMENT = (0, ComponentDefs_1.d)(`Manages the vertical content alignment for each child element in the Stack.`);
18
+ const HORIZONTAL_ALIGNMENT = {
19
+ description: "Manages the horizontal content alignment for each child element in the Stack.",
20
+ availableValues: abstractions_1.alignmentOptionValues,
21
+ valueType: "string",
22
+ defaultValue: "start",
23
+ };
24
+ const VERTICAL_ALIGNMENT = {
25
+ description: "Manages the vertical content alignment for each child element in the Stack.",
26
+ availableValues: abstractions_1.alignmentOptionValues,
27
+ valueType: "string",
28
+ defaultValue: "start",
29
+ };
19
30
  const stackMd = (0, ComponentDefs_1.createMetadata)({
20
31
  description: `\`Stack\` is a layout container displaying children in a horizontal or vertical stack.`,
21
32
  props: {
22
- gap: (0, ComponentDefs_1.d)(`Optional size value indicating the gap between child elements.`),
23
- reverse: (0, ComponentDefs_1.d)(`Optional boolean property to reverse the order of child elements.`),
24
- wrapContent: (0, ComponentDefs_1.d)(`Optional boolean which wraps the content if set to true and the available space is not big ` +
25
- `enough. Works in all orientations.`),
26
- orientation: (0, ComponentDefs_1.d)(`An optional property that governs the Stack's orientation (whether the Stack lays out its ` +
27
- `children in a row or a column).`),
33
+ gap: {
34
+ description: "Optional size value indicating the gap between child elements.",
35
+ valueType: "string",
36
+ defaultValue: "$gap-normal",
37
+ },
38
+ reverse: {
39
+ description: "Optional boolean property to reverse the order of child elements.",
40
+ valueType: "boolean",
41
+ defaultValue: false,
42
+ },
43
+ wrapContent: {
44
+ description: "Optional boolean which wraps the content if set to true and the available " +
45
+ "space is not big enough. Works only with horizontal orientations.",
46
+ valueType: "boolean",
47
+ defaultValue: false,
48
+ },
49
+ orientation: {
50
+ description: "An optional property that governs the Stack's orientation (whether " +
51
+ "the Stack lays out its children in a row or a column).",
52
+ availableValues: ["horizontal", "vertical"],
53
+ valueType: "string",
54
+ defaultValue: StackNative_1.DEFAULT_ORIENTATION,
55
+ },
28
56
  horizontalAlignment: HORIZONTAL_ALIGNMENT,
29
57
  verticalAlignment: VERTICAL_ALIGNMENT,
30
- hoverContainer: (0, ComponentDefs_1.d)("Reserved for future use"),
31
- visibleOnHover: (0, ComponentDefs_1.d)("Reserved for future use"),
58
+ hoverContainer: (0, metadata_helpers_1.dInternal)("Reserved for future use"),
59
+ visibleOnHover: (0, metadata_helpers_1.dInternal)("Reserved for future use"),
32
60
  },
33
61
  events: {
34
62
  click: (0, metadata_helpers_1.dClick)(COMP),
35
- mounted: (0, ComponentDefs_1.d)("Reserved for future use"),
63
+ mounted: (0, metadata_helpers_1.dInternal)("Reserved for future use"),
36
64
  },
37
65
  themeVars: (0, themeVars_1.parseScssVar)(Stack_module_scss_1.default.themeVars),
38
66
  });
@@ -16,8 +16,13 @@ exports.StickyBoxMd = (0, ComponentDefs_1.createMetadata)({
16
16
  description: `The \`${COMP}\` is a component that "sticks" or remains fixed at the top or bottom ` +
17
17
  `position on the screen as the user scrolls.`,
18
18
  props: {
19
- to: (0, ComponentDefs_1.d)(`This property determines whether the StickyBox should be anchored to ` +
20
- `the \`top\` or \`bottom\`.`),
19
+ to: {
20
+ description: "This property determines whether the StickyBox should be anchored to " +
21
+ "the \`top\` or \`bottom\`.",
22
+ availableValues: ["top", "bottom"],
23
+ valueType: "string",
24
+ defaultValue: "top",
25
+ },
21
26
  },
22
27
  themeVars: (0, themeVars_1.parseScssVar)(StickyBox_module_scss_1.default.themeVars),
23
28
  defaultThemeVars: {
@@ -32,7 +32,6 @@ exports.SwitchMd = (0, ComponentDefs_1.createMetadata)({
32
32
  `of the ${COMP} besides its label.`),
33
33
  },
34
34
  events: {
35
- click: (0, metadata_helpers_1.dClick)(COMP),
36
35
  gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
37
36
  lostFocus: (0, metadata_helpers_1.dLostFocus)(COMP),
38
37
  didChange: (0, metadata_helpers_1.dDidChange)(COMP),
@@ -22,18 +22,25 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
22
22
  description: `\`${COMP}\` is a component that displays cells organized into rows and columns. The \`${COMP}\` ` +
23
23
  `component is virtualized so it only renders visible cells.`,
24
24
  props: {
25
- items: (0, ComponentDefs_1.d)(`You can use \`items\` as an alias for the \`data\` property. ` +
25
+ items: (0, metadata_helpers_1.dInternal)(`You can use \`items\` as an alias for the \`data\` property. ` +
26
26
  `When you bind the table to a data source (e.g. an API endpoint), ` +
27
27
  `the \`data\` acts as the property that accepts a URL to fetch information from an API. ` +
28
28
  `When both \`items\` and \`data\` are used, \`items\` has priority.`),
29
29
  data: (0, ComponentDefs_1.d)(`The component receives data via this property. The \`data\` property is a list of items ` +
30
30
  `that the \`Table\` can display.`),
31
- isPaginated: (0, ComponentDefs_1.d)(`This property adds pagination controls to the \`${COMP}\`.`),
31
+ isPaginated: {
32
+ description: `This property adds pagination controls to the \`${COMP}\`.`,
33
+ valueType: "boolean",
34
+ defaultValue: false,
35
+ },
32
36
  loading: (0, ComponentDefs_1.d)(`This boolean property indicates if the component is fetching (or processing) data. This ` +
33
37
  `property is useful when data is loaded conditionally or receiving it takes some time.`),
34
38
  headerHeight: (0, ComponentDefs_1.d)(`This optional property is used to specify the height of the table header.`),
35
39
  rowsSelectable: (0, ComponentDefs_1.d)(`Indicates whether the rows are selectable (\`true\`) or not (\`false\`).`),
36
- pageSizes: (0, ComponentDefs_1.d)(`Describes how big a page should be for pagination.`),
40
+ pageSizes: {
41
+ description: "This property holds an array of page sizes (numbers) the user can select for " +
42
+ "pagination. If this property is not defined, the component allows only a page size of 10 items.",
43
+ },
37
44
  rowDisabledPredicate: (0, ComponentDefs_1.d)(`This property defines a predicate function with a return value that determines if the ` +
38
45
  `row should be disabled. The function retrieves the item to display and should return ` +
39
46
  `a Boolean-like value.`),
@@ -42,21 +49,31 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
42
49
  sortDirection: (0, ComponentDefs_1.d)(`This property determines the sort order to be \`ascending\` or \`descending\`. This ` +
43
50
  `property only works if the [\`sortBy\`](#sortby) property is also set.`),
44
51
  autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
45
- hideHeader: (0, ComponentDefs_1.d)(`Set the header visibility using this property. Set it to \`true\` to hide the header.`),
46
- iconNoSort: (0, ComponentDefs_1.d)(`Allows the customization of the icon displayed in the ${COMP} column header when ` +
47
- `when sorting is enabled and sorting is not done according to the column.`),
48
- iconSortAsc: (0, ComponentDefs_1.d)(`Allows the customization of the icon displayed in the ${COMP} column header when sorting ` +
49
- `is enabled, sorting is done according to the column, and the column is sorted in ` +
50
- `ascending order.`),
51
- iconSortDesc: (0, ComponentDefs_1.d)(`Allows the customization of the icon displayed in the ${COMP} column header when sorting ` +
52
- `is enabled, sorting is done according to the column, and the column is sorted in ` +
53
- `descending order.`),
54
- enableMultiRowSelection: (0, ComponentDefs_1.d)(`This boolean property indicates whether you can select multiple rows in the table. ` +
55
- `This property only has an effect when the rowsSelectable property is set. Setting it ` +
56
- `to \`false\` limits selection to a single row.`),
57
- alwaysShowSelectionHeader: (0, ComponentDefs_1.d)("This property indicates when the row selection header is displayed. When the value is " +
58
- "`true,` the selection header is always visible. Otherwise, it is displayed only " +
59
- "when hovered.", null, "boolean", false),
52
+ hideHeader: {
53
+ description: "Set the header visibility using this property. Set it to \`true\` to hide the header.",
54
+ valueType: "boolean",
55
+ defaultValue: false,
56
+ },
57
+ iconNoSort: (0, ComponentDefs_1.d)(`Allows setting the icon displayed in the ${COMP} column header when sorting is ` +
58
+ `enabled, but the column remains unsorted.`),
59
+ iconSortAsc: (0, ComponentDefs_1.d)(`Allows setting the icon displayed in the ${COMP} column header when sorting is enabled, ` +
60
+ `and the column is sorted in ascending order.`),
61
+ iconSortDesc: (0, ComponentDefs_1.d)(`Allows setting the icon displayed in the ${COMP} column header when sorting is enabled, ` +
62
+ `and the column is sorted in descending order.`),
63
+ enableMultiRowSelection: {
64
+ description: `This boolean property indicates whether you can select multiple rows in the table. ` +
65
+ `This property only has an effect when the rowsSelectable property is set. Setting it ` +
66
+ `to \`false\` limits selection to a single row.`,
67
+ valueType: "boolean",
68
+ defaultValue: true,
69
+ },
70
+ alwaysShowSelectionHeader: {
71
+ description: "This property indicates when the row selection header is displayed. When the value is " +
72
+ "`true,` the selection header is always visible. Otherwise, it is displayed only " +
73
+ "when hovered.",
74
+ valueType: "boolean",
75
+ defaultValue: false,
76
+ },
60
77
  },
61
78
  events: {
62
79
  sortingDidChange: (0, ComponentDefs_1.d)(`This event is fired when the table data sorting has changed. It has two arguments: ` +
@@ -17,10 +17,19 @@ exports.TableOfContentsMd = (0, ComponentDefs_1.createMetadata)({
17
17
  `and displays them in a tree representing their hierarchy. When you select an item ` +
18
18
  `in this tree, the component navigates the page to the selected position.`,
19
19
  props: {
20
- smoothScrolling: (0, ComponentDefs_1.d)(`This property indicates that smooth scrolling is used while scrolling the selected table ` +
21
- `of contents items into view.`),
22
- maxHeadingLevel: (0, ComponentDefs_1.d)("Defines the maximum heading level to include in the table of contents. Headings " +
23
- "with a level greater than this value will be excluded."),
20
+ smoothScrolling: {
21
+ description: `This property indicates that smooth scrolling is used while scrolling the selected table ` +
22
+ `of contents items into view.`,
23
+ valueType: "boolean",
24
+ defaultValue: "false",
25
+ },
26
+ maxHeadingLevel: {
27
+ description: "Defines the maximum heading level (1 to 6) to include in the table of contents. " +
28
+ "For example, if it is 2, then `H1` and `H2` are displayed, but lower levels " +
29
+ "(`H3` to `H6`) are not.",
30
+ valueType: "number",
31
+ defaultValue: "6",
32
+ },
24
33
  },
25
34
  themeVars: (0, themeVars_1.parseScssVar)(TableOfContents_module_scss_1.default.themeVars),
26
35
  defaultThemeVars: {
@@ -12,15 +12,19 @@ const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
12
12
  const classnames_1 = __importDefault(require("classnames"));
13
13
  const TableOfContents_module_scss_1 = __importDefault(require("./TableOfContents.module.scss"));
14
14
  const TableOfContentsContext_1 = require("../../components-core/TableOfContentsContext");
15
- const react_router_dom_1 = require("react-router-dom");
16
15
  exports.TableOfContents = (0, react_1.forwardRef)(function TableOfContents({ style, smoothScrolling, maxHeadingLevel = 6 }, forwardedRef) {
17
16
  const tocRef = (0, react_1.useRef)(null);
18
- const { headings, setObserveIntersection, activeAnchorId, setActiveAnchorId } = (0, TableOfContentsContext_1.useTableOfContents)();
17
+ const [activeAnchorId, setActiveId] = (0, react_1.useState)(null);
18
+ const { headings, scrollToAnchor, subscribeToActiveAnchorChange } = (0, TableOfContentsContext_1.useTableOfContents)();
19
+ (0, react_1.useLayoutEffect)(() => {
20
+ return subscribeToActiveAnchorChange((id) => {
21
+ const foundHeading = headings.find((heading) => heading.id === id);
22
+ if (foundHeading.level <= maxHeadingLevel) {
23
+ setActiveId(id);
24
+ }
25
+ });
26
+ }, [headings, maxHeadingLevel, subscribeToActiveAnchorChange]);
19
27
  const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(tocRef, forwardedRef) : tocRef;
20
- const navigate = (0, react_router_dom_1.useNavigate)();
21
- (0, react_1.useEffect)(() => {
22
- setObserveIntersection(true);
23
- }, [setObserveIntersection]);
24
28
  (0, react_1.useEffect)(() => {
25
29
  if (activeAnchorId && (tocRef === null || tocRef === void 0 ? void 0 : tocRef.current)) {
26
30
  const activeAnchor = tocRef.current.querySelector(`#${activeAnchorId}`);
@@ -47,22 +51,11 @@ exports.TableOfContents = (0, react_1.forwardRef)(function TableOfContents({ sty
47
51
  [TableOfContents_module_scss_1.default.head_5]: value.level === 5,
48
52
  [TableOfContents_module_scss_1.default.head_6]: value.level === 6,
49
53
  }), to: `#${value.id}`, onClick: (event) => {
50
- event.preventDefault();
51
- value.anchor.scrollIntoView({
52
- block: "start",
53
- inline: "start",
54
- behavior: smoothScrolling ? "smooth" : "auto",
55
- });
56
- setActiveAnchorId(value.id);
57
- requestAnimationFrame(() => {
58
- navigate({
59
- hash: `#${value.id}`,
60
- }, {
61
- state: {
62
- preventHashScroll: true
63
- },
64
- });
65
- });
54
+ // cmd/ctrl + click - open in new tab, don't prevent that
55
+ if (!event.ctrlKey && !event.metaKey && !event.metaKey) {
56
+ event.preventDefault();
57
+ }
58
+ scrollToAnchor(value.id, smoothScrolling);
66
59
  }, id: value.id, children: value.text }) }, value.id));
67
60
  }
68
61
  return null;
@@ -19,9 +19,14 @@ exports.TabsMd = (0, ComponentDefs_1.createMetadata)({
19
19
  props: {
20
20
  activeTab: (0, ComponentDefs_1.d)(`This property indicates the index of the active tab. The indexing starts from 0, ` +
21
21
  `representing the starting (leftmost) tab.`),
22
- orientation: (0, ComponentDefs_1.d)(`This property indicates the orientation of the component. In horizontal orientation, ` +
23
- `the tab sections are laid out on the left side of the content panel, while in vertical ` +
24
- `orientation, the buttons are at the top.`),
22
+ orientation: {
23
+ description: `This property indicates the orientation of the component. In horizontal orientation, ` +
24
+ `the tab sections are laid out on the left side of the content panel, while in vertical ` +
25
+ `orientation, the buttons are at the top.`,
26
+ availableValues: ["horizontal", "vertical"],
27
+ defaultValue: "vertical",
28
+ valueType: "string",
29
+ },
25
30
  tabTemplate: (0, metadata_helpers_1.dComponent)(`This property declares the template for the clickable tab area.`),
26
31
  },
27
32
  apis: {
@@ -29,14 +29,26 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
29
29
  props: {
30
30
  value: (0, ComponentDefs_1.d)(`The text to be displayed. This value can also be set via nesting the text into ` +
31
31
  `the \`${COMP}\` component.`),
32
- variant: (0, ComponentDefs_1.d)(`Optional string value that provides named presets for text variants with a ` +
33
- `unique combination of font style, weight, size, color and other parameters.`, abstractions_1.variantOptionsMd),
34
- maxLines: (0, ComponentDefs_1.d)(`This property determines the maximum number of lines the component can wrap to. ` +
35
- `If there is no space to display all the contents, the component displays up to ` +
36
- `as many lines as specified in this property.`),
37
- preserveLinebreaks: (0, ComponentDefs_1.d)(`This property indicates if linebreaks should be preserved when displaying text.`),
38
- ellipses: (0, ComponentDefs_1.d)(`This property indicates whether ellipses should be displayed when the text is ` +
39
- `cropped (\`true\`) or not (\`false\`).`),
32
+ variant: {
33
+ description: "An optional string value that provides named presets for text variants with a " +
34
+ "unique combination of font style, weight, size, color, and other parameters. " +
35
+ "If not defined, the text uses the current style of its context.",
36
+ availableValues: abstractions_1.variantOptionsMd,
37
+ },
38
+ maxLines: (0, ComponentDefs_1.d)("This property determines the maximum number of lines the component can wrap to. " +
39
+ "If there is no space to display all the contents, the component displays up to as " +
40
+ "many lines as specified in this property. When the value is not defined, there is no limit on the displayed lines."),
41
+ preserveLinebreaks: {
42
+ description: `This property indicates if linebreaks should be preserved when displaying text.`,
43
+ valueType: "boolean",
44
+ defaultValue: "false",
45
+ },
46
+ ellipses: {
47
+ description: "This property indicates whether ellipses should be displayed when the text is " +
48
+ "cropped (\`true\`) or not (\`false\`).",
49
+ valueType: "boolean",
50
+ defaultValue: false,
51
+ },
40
52
  },
41
53
  themeVars: (0, themeVars_1.parseScssVar)(Text_module_scss_1.default.themeVars),
42
54
  defaultThemeVars: {
@@ -13,7 +13,7 @@ const metadata_helpers_1 = require("../metadata-helpers");
13
13
  const TextAreaNative_1 = require("./TextAreaNative");
14
14
  const COMP = "TextArea";
15
15
  exports.resizeOptionsMd = [
16
- { value: "undefined", description: "No resizing" },
16
+ { value: "(undefined)", description: "No resizing" },
17
17
  { value: "horizontal", description: "Can only resize horizontally" },
18
18
  { value: "vertical", description: "Can only resize vertically" },
19
19
  { value: "both", description: "Can resize in both dimensions" },
@@ -22,16 +22,31 @@ exports.TextAreaMd = (0, ComponentDefs_1.createMetadata)({
22
22
  status: "experimental",
23
23
  description: `\`${COMP}\` is a component that provides a multiline text input area.`,
24
24
  props: {
25
- enterSubmits: (0, ComponentDefs_1.d)(`This optional boolean property indicates whether pressing the \`Enter\` key on the ` +
26
- `keyboard prompts the parent \`Form\` component to submit. The default value is is \`true\`.`),
27
- escResets: (0, ComponentDefs_1.d)(`This boolean property indicates whether the ${COMP} contents should be reset when pressing ` +
28
- `the ESC key.`),
29
- maxRows: (0, ComponentDefs_1.d)(`This optional number property maximizes the number of lines the \`${COMP}\` can grow to.`),
30
- minRows: (0, ComponentDefs_1.d)(`This optional number property indicates the minimum number of lines the \`${COMP}\` ` +
31
- `has and specifies its size accordingly.`),
32
- rows: (0, ComponentDefs_1.d)(`Specifies the number of lines or rows (and thus, its size) the component has.`),
33
- autoSize: (0, ComponentDefs_1.d)(`If set to \`true\`, this boolean property enables the \`${COMP}\` to resize ` +
34
- `automatically based on the number of lines inside it.`, null, "boolean", false),
25
+ enterSubmits: {
26
+ description: "This optional boolean property indicates whether pressing the \`Enter\` key on the " +
27
+ "keyboard prompts the parent \`Form\` component to submit.",
28
+ valueType: "boolean",
29
+ defaultValue: true,
30
+ },
31
+ escResets: {
32
+ description: `This boolean property indicates whether the ${COMP} contents should be reset when pressing ` +
33
+ `the ESC key.`,
34
+ valueType: "boolean",
35
+ defaultValue: false,
36
+ },
37
+ maxRows: (0, ComponentDefs_1.d)(`This optional property sets the maximum number of text rows the \`${COMP}\` can grow.`),
38
+ minRows: (0, ComponentDefs_1.d)(`This optional property sets the minimum number of text rows the \`${COMP}\` can shrink.`),
39
+ rows: {
40
+ description: `Specifies the number of rows the component initially has.`,
41
+ valueType: "number",
42
+ defaultValue: 2,
43
+ },
44
+ autoSize: {
45
+ description: `If set to \`true\`, this boolean property enables the \`${COMP}\` to resize ` +
46
+ `automatically based on the number of lines inside it.`,
47
+ valueType: "boolean",
48
+ defaultValue: false,
49
+ },
35
50
  placeholder: (0, metadata_helpers_1.dPlaceholder)(),
36
51
  initialValue: (0, metadata_helpers_1.dInitialValue)(),
37
52
  label: (0, metadata_helpers_1.dLabel)(),
@@ -44,8 +59,10 @@ exports.TextAreaMd = (0, ComponentDefs_1.createMetadata)({
44
59
  readOnly: (0, metadata_helpers_1.dReadonly)(),
45
60
  enabled: (0, metadata_helpers_1.dEnabled)(),
46
61
  validationStatus: (0, metadata_helpers_1.dValidationStatus)(),
47
- resize: (0, ComponentDefs_1.d)(`This optional property specifies in which dimensions can the \`TextArea\` ` +
48
- `be resized by the user.`, exports.resizeOptionsMd),
62
+ resize: { description: `This optional property specifies in which dimensions can the \`TextArea\` ` +
63
+ `be resized by the user.`,
64
+ availableValues: exports.resizeOptionsMd,
65
+ },
49
66
  },
50
67
  events: {
51
68
  gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
@@ -25,8 +25,12 @@ exports.ThemeMd = (0, ComponentDefs_1.createMetadata)({
25
25
  allowArbitraryProps: true,
26
26
  props: {
27
27
  themeId: (0, ComponentDefs_1.d)(`This property specifies which theme to use by setting the theme's id.`),
28
- tone: (0, ComponentDefs_1.d)(`This property allows the setting of the current theme's tone. Tone is either ` +
29
- `\`light\` or \`dark\`.`),
28
+ tone: {
29
+ description: "This property allows the setting of the current theme's tone.",
30
+ availableValues: ["light", "dark"],
31
+ valueType: "string",
32
+ defaultValue: "light",
33
+ },
30
34
  root: (0, ComponentDefs_1.d)(`This property indicates whether the component is at the root of the application.`),
31
35
  },
32
36
  opaque: true,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionNames = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.sizeNames = exports.sizeMd = exports.viewportSizeNames = exports.viewportSizeMd = exports.LinkTargetMd = exports.LinkTargetNames = void 0;
3
+ exports.httpMethodNames = exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionNames = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.sizeNames = exports.sizeMd = exports.viewportSizeNames = exports.viewportSizeMd = exports.LinkTargetMd = exports.LinkTargetNames = void 0;
4
4
  exports.LinkTargetNames = ["_self", "_blank", "_parent", "_top", "_unfencedTop"];
5
5
  exports.LinkTargetMd = [
6
6
  {
@@ -21,8 +21,8 @@ exports.LinkTargetMd = [
21
21
  },
22
22
  {
23
23
  value: "_unfencedTop",
24
- description: "Allows embedded fenced frames to navigate the top-level frame, i.e. traversing beyond the root of the fenced frame."
25
- }
24
+ description: "Allows embedded fenced frames to navigate the top-level frame, i.e. traversing beyond the root of the fenced frame.",
25
+ },
26
26
  ];
27
27
  // --- Available view sizes
28
28
  exports.viewportSizeMd = [
@@ -291,3 +291,14 @@ exports.variantOptionsMd = [
291
291
  const AbbreviationKeys = ["title"];
292
292
  const InsertedKeys = ["cite", "dateTime"];
293
293
  exports.VariantPropsKeys = [...AbbreviationKeys, ...InsertedKeys];
294
+ exports.httpMethodNames = [
295
+ "get",
296
+ "post",
297
+ "put",
298
+ "delete",
299
+ "patch",
300
+ "head",
301
+ "options",
302
+ "trace",
303
+ "connect",
304
+ ];