xmlui 0.9.60 → 0.9.61
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.
- package/dist/lib/{apiInterceptorWorker-CNiXy9XE.mjs → apiInterceptorWorker-DBv1IaN7.mjs} +1 -1
- package/dist/lib/{index-B1V2vJWh.mjs → index-C9AUt7Ay.mjs} +13543 -12979
- package/dist/lib/index.css +1 -1
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-4EQ6kQIM.mjs → metadata-utils-DJM8orNd.mjs} +40 -31
- package/dist/lib/{server-common-SNl_47nE.mjs → server-common-D0VA8gIv.mjs} +1450 -858
- package/dist/lib/{transform-CgRMkbb0.mjs → transform-BdB0APqE.mjs} +1543 -1384
- package/dist/lib/xmlui-parser.d.ts +76 -253
- package/dist/lib/xmlui-parser.mjs +49 -42
- package/dist/lib/{xmlui-serializer-EDw51UFN.mjs → xmlui-serializer-COAfRndx.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +88 -670
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{apiInterceptorWorker-DsjW46f_.mjs → apiInterceptorWorker-Bu81HvQB.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-CBiI_eDf.mjs → collectedComponentMetadata-Dzn97vOS.mjs} +13619 -12876
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +117 -120
- package/dist/scripts/package.json +5 -5
- package/dist/scripts/src/abstractions/ComponentDefs.js +0 -8
- package/dist/scripts/src/abstractions/ThemingDefs.js +0 -9
- package/dist/scripts/src/components/APICall/APICall.js +30 -18
- package/dist/scripts/src/components/Accordion/Accordion.js +5 -4
- package/dist/scripts/src/components/Accordion/AccordionItem.js +10 -4
- package/dist/scripts/src/components/App/App.js +9 -4
- package/dist/scripts/src/components/App/AppNative.js +11 -1
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -2
- package/dist/scripts/src/components/AppState/AppState.js +3 -3
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +6 -7
- package/dist/scripts/src/components/Avatar/Avatar.js +3 -3
- package/dist/scripts/src/components/Backdrop/Backdrop.js +1 -2
- package/dist/scripts/src/components/Badge/Badge.js +1 -2
- package/dist/scripts/src/components/Bookmark/Bookmark.js +2 -2
- package/dist/scripts/src/components/Breakout/Breakout.js +2 -2
- package/dist/scripts/src/components/Button/Button.js +1 -2
- package/dist/scripts/src/components/Card/Card.js +2 -3
- package/dist/scripts/src/components/Card/CardNative.js +2 -1
- package/dist/scripts/src/components/Carousel/Carousel.js +6 -7
- package/dist/scripts/src/components/Carousel/CarouselItem.js +2 -2
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +1 -2
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +2 -2
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +8 -7
- package/dist/scripts/src/components/Charts/LabelList/LabelList.js +2 -2
- package/dist/scripts/src/components/Charts/Legend/Legend.js +2 -2
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +6 -6
- package/dist/scripts/src/components/Charts/PieChart/PieChart.js +14 -10
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +9 -4
- package/dist/scripts/src/components/Checkbox/Checkbox.js +1 -2
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +6 -3
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +1 -2
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +2 -2
- package/dist/scripts/src/components/Column/Column.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +4 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -2
- package/dist/scripts/src/components/DatePicker/DatePicker.js +2 -3
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +6 -7
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +2 -3
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +9 -10
- package/dist/scripts/src/components/FileInput/FileInput.js +14 -15
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +4 -4
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +2 -2
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +35 -6
- package/dist/scripts/src/components/Footer/Footer.js +4 -3
- package/dist/scripts/src/components/Form/Form.js +12 -9
- package/dist/scripts/src/components/Form/FormNative.js +12 -4
- package/dist/scripts/src/components/FormItem/FormItem.js +7 -8
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +1 -1
- package/dist/scripts/src/components/FormSection/FormSection.js +7 -29
- package/dist/scripts/src/components/Heading/Heading.js +11 -11
- package/dist/scripts/src/components/HelloWorld/HelloWorld.js +102 -0
- package/dist/scripts/src/components/HelloWorld/HelloWorldNative.js +92 -0
- package/dist/scripts/src/components/HoverCard/HoverCard.js +1 -2
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +297 -297
- package/dist/scripts/src/components/Icon/Icon.js +5 -5
- package/dist/scripts/src/components/Image/Image.js +4 -5
- package/dist/scripts/src/components/InspectButton/InspectButton.js +2 -2
- package/dist/scripts/src/components/Items/Items.js +2 -3
- package/dist/scripts/src/components/Link/Link.js +3 -4
- package/dist/scripts/src/components/Link/LinkNative.js +46 -1
- package/dist/scripts/src/components/List/List.js +15 -16
- package/dist/scripts/src/components/Logo/Logo.js +2 -2
- package/dist/scripts/src/components/Markdown/Markdown.js +6 -6
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +2 -4
- package/dist/scripts/src/components/Markdown/parse-binding-expr.js +1 -1
- package/dist/scripts/src/components/Markdown/utils.js +32 -13
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +9 -9
- package/dist/scripts/src/components/NavGroup/NavGroup.js +2 -3
- package/dist/scripts/src/components/NavGroup/NavGroupContext.js +1 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +6 -2
- package/dist/scripts/src/components/NavLink/NavLink.js +3 -4
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +10 -9
- package/dist/scripts/src/components/NavPanel/NavPanel.js +4 -4
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +132 -3
- package/dist/scripts/src/components/NestedApp/AppWithCodeView.js +24 -5
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +64 -7
- package/dist/scripts/src/components/NestedApp/NestedApp.js +19 -9
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +11 -7
- package/dist/scripts/src/components/NoResult/NoResult.js +1 -2
- package/dist/scripts/src/components/NumberBox/NumberBox.js +5 -6
- package/dist/scripts/src/components/NumberBox/NumberBox2.js +5 -6
- package/dist/scripts/src/components/Option/Option.js +5 -5
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +2 -2
- package/dist/scripts/src/components/Pages/Pages.js +7 -8
- package/dist/scripts/src/components/Pages/PagesNative.js +8 -3
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +3 -3
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -2
- package/dist/scripts/src/components/Queue/Queue.js +16 -16
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +13 -13
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +13 -28
- package/dist/scripts/src/components/RadioGroup/RadioItem.js +2 -2
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +3 -3
- package/dist/scripts/src/components/Redirect/Redirect.js +2 -2
- package/dist/scripts/src/components/Select/Select.js +8 -8
- package/dist/scripts/src/components/Select/SelectNative.js +1 -1
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +2 -2
- package/dist/scripts/src/components/Slider/Slider.js +4 -5
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +2 -2
- package/dist/scripts/src/components/Spinner/Spinner.js +2 -2
- package/dist/scripts/src/components/Splitter/Splitter.js +2 -3
- package/dist/scripts/src/components/Stack/Stack.js +1 -2
- package/dist/scripts/src/components/StickyBox/StickyBox.js +2 -2
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +2 -0
- package/dist/scripts/src/components/Switch/Switch.js +7 -4
- package/dist/scripts/src/components/Table/Table.js +19 -20
- package/dist/scripts/src/components/Table/TableNative.js +6 -2
- package/dist/scripts/src/components/Table/useRowSelection.js +6 -2
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +2 -2
- package/dist/scripts/src/components/Tabs/TabItem.js +1 -2
- package/dist/scripts/src/components/Tabs/Tabs.js +9 -6
- package/dist/scripts/src/components/Text/Text.js +6 -6
- package/dist/scripts/src/components/TextArea/TextArea.js +4 -5
- package/dist/scripts/src/components/TextBox/TextBox.js +4 -5
- package/dist/scripts/src/components/Theme/NotificationToast.js +11 -0
- package/dist/scripts/src/components/Theme/Theme.js +4 -4
- package/dist/scripts/src/components/Theme/ThemeNative.js +4 -4
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +2 -2
- package/dist/scripts/src/components/Tree/TreeComponent.js +1 -2
- package/dist/scripts/src/components/TreeDisplay/TreeDisplay.js +4 -2
- package/dist/scripts/src/components/metadata-helpers.js +8 -0
- package/dist/scripts/src/components-core/Fragment.js +7 -4
- package/dist/scripts/src/components-core/LoaderComponent.js +1 -1
- package/dist/scripts/src/components-core/RestApiProxy.js +11 -8
- package/dist/scripts/src/components-core/Slot.js +3 -3
- package/dist/scripts/src/components-core/appContext/date-functions.js +1 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +9 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +2 -2
- package/dist/scripts/src/components-core/loader/ApiLoader.js +4 -4
- package/dist/scripts/src/components-core/loader/DataLoader.js +20 -20
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +6 -6
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -4
- package/dist/scripts/src/components-core/rendering/AppContent.js +8 -4
- package/dist/scripts/src/components-core/rendering/AppRoot.js +4 -2
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +1 -1
- package/dist/scripts/src/components-core/rendering/Container.js +2 -2
- package/dist/scripts/src/components-core/rendering/StateContainer.js +8 -2
- package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
- package/dist/scripts/src/components-core/script-runner/ScriptingSourceTree.js +45 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +1 -1
- package/dist/scripts/src/components-core/script-runner/visitors.js +1 -1
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +2 -2
- package/dist/scripts/src/components-core/theming/layout-resolver.js +18 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +3 -0
- package/dist/scripts/src/components-core/theming/utils.js +31 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +60 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +1 -1
- package/dist/scripts/src/parsers/scripting/Parser.js +1 -1
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +1 -1
- package/dist/scripts/src/parsers/scripting/modules.js +1 -1
- package/dist/scripts/src/parsers/scripting/tree-visitor.js +1 -1
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +42 -39
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +65 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +10 -8
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +1 -2
- package/dist/standalone/xmlui-standalone.es.d.ts +88 -670
- package/dist/standalone/xmlui-standalone.umd.js +258 -261
- package/package.json +5 -5
- /package/dist/scripts/src/components-core/{abstractions → rendering}/containers.js +0 -0
- /package/dist/scripts/src/{abstractions/scripting/ScriptingSourceTree.js → parsers/scripting/ScriptingNodeTypes.js} +0 -0
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.numberBoxComponentRenderer = exports.NumberBoxMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const NumberBox_module_scss_1 = __importDefault(require("./NumberBox.module.scss"));
|
|
9
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
11
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
13
12
|
const NumberBoxNative_1 = require("./NumberBoxNative");
|
|
14
13
|
const COMP = "NumberBox";
|
|
15
|
-
exports.NumberBoxMd = (0,
|
|
14
|
+
exports.NumberBoxMd = (0, metadata_helpers_1.createMetadata)({
|
|
16
15
|
status: "stable",
|
|
17
16
|
description: "`NumberBox` provides a specialized input field for numeric values with built-in " +
|
|
18
17
|
"validation, spinner buttons, and flexible formatting options. It supports both " +
|
|
@@ -43,10 +42,10 @@ exports.NumberBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
43
42
|
valueType: "boolean",
|
|
44
43
|
defaultValue: true,
|
|
45
44
|
},
|
|
46
|
-
spinnerUpIcon: (0,
|
|
45
|
+
spinnerUpIcon: (0, metadata_helpers_1.d)(`Allows setting an alternate icon displayed in the ${COMP} spinner for incrementing values. You can change ` +
|
|
47
46
|
`the default icon for all ${COMP} instances with the "icon.spinnerUp:NumberBox" declaration in the ` +
|
|
48
47
|
`app configuration file.`),
|
|
49
|
-
spinnerDownIcon: (0,
|
|
48
|
+
spinnerDownIcon: (0, metadata_helpers_1.d)(`Allows setting an alternate icon displayed in the ${COMP} spinner for decrementing values. You can change ` +
|
|
50
49
|
`the default icon for all ${COMP} instances with the "icon.spinnerDown:NumberBox" declaration in the ` +
|
|
51
50
|
`app configuration file.`),
|
|
52
51
|
step: {
|
|
@@ -66,10 +65,10 @@ exports.NumberBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
66
65
|
valueType: "boolean",
|
|
67
66
|
defaultValue: false,
|
|
68
67
|
},
|
|
69
|
-
minValue: (0,
|
|
68
|
+
minValue: (0, metadata_helpers_1.d)("The minimum value the input field allows. Can be a float or an integer if " +
|
|
70
69
|
"[\`integersOnly\`](#integersonly) is set to \`false\`, otherwise it can only be an integer." +
|
|
71
70
|
"If not set, no minimum value check is done."),
|
|
72
|
-
maxValue: (0,
|
|
71
|
+
maxValue: (0, metadata_helpers_1.d)("The maximum value the input field allows. Can be a float or an integer if " +
|
|
73
72
|
"[\`integersOnly\`](#integersonly) is set to \`false\`, otherwise it can only be an integer." +
|
|
74
73
|
"If not set, no maximum value check is done."),
|
|
75
74
|
},
|
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.numberBox2ComponentRenderer = exports.NumberBoxMd2 = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const NumberBox_module_scss_1 = __importDefault(require("./NumberBox.module.scss"));
|
|
9
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
11
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
13
12
|
const NumberBox2Native_1 = require("./NumberBox2Native");
|
|
14
13
|
const COMP = "NumberBox2";
|
|
15
|
-
exports.NumberBoxMd2 = (0,
|
|
14
|
+
exports.NumberBoxMd2 = (0, metadata_helpers_1.createMetadata)({
|
|
16
15
|
status: "experimental",
|
|
17
16
|
description: `A \`${COMP}\` component allows users to input numeric values: either integer or floating ` +
|
|
18
17
|
`point numbers. It also accepts empty values, where the stored value will be of type \`null\`.`,
|
|
@@ -38,10 +37,10 @@ exports.NumberBoxMd2 = (0, ComponentDefs_1.createMetadata)({
|
|
|
38
37
|
valueType: "boolean",
|
|
39
38
|
defaultValue: NumberBox2Native_1.defaultProps.hasSpinBox,
|
|
40
39
|
},
|
|
41
|
-
spinnerUpIcon: (0,
|
|
40
|
+
spinnerUpIcon: (0, metadata_helpers_1.d)(`Allows setting the icon displayed in the ${COMP} spinner for incrementing values. You can change ` +
|
|
42
41
|
`the default icon for all ${COMP} instances with the "icon.spinnerUp:NumberBox" declaration in the ` +
|
|
43
42
|
`app configuration file.`),
|
|
44
|
-
spinnerDownIcon: (0,
|
|
43
|
+
spinnerDownIcon: (0, metadata_helpers_1.d)(`Allows setting the icon displayed in the ${COMP} spinner for decrementing values. You can change ` +
|
|
45
44
|
`the default icon for all ${COMP} instances with the "icon.spinnerDown:NumberBox" declaration in the ` +
|
|
46
45
|
`app configuration file.`),
|
|
47
46
|
step: {
|
|
@@ -67,9 +66,9 @@ exports.NumberBoxMd2 = (0, ComponentDefs_1.createMetadata)({
|
|
|
67
66
|
valueType: "boolean",
|
|
68
67
|
defaultValue: NumberBox2Native_1.defaultProps.zeroOrPositive,
|
|
69
68
|
},
|
|
70
|
-
minValue: (0,
|
|
69
|
+
minValue: (0, metadata_helpers_1.d)(`The minimum value the input field allows. Can be a float or an integer if ` +
|
|
71
70
|
`[\`integersOnly\`](#integersonly) is set to \`false\`, otherwise it can only be an integer.`),
|
|
72
|
-
maxValue: (0,
|
|
71
|
+
maxValue: (0, metadata_helpers_1.d)(`The maximum value the input field allows. Can be a float or an integer if ` +
|
|
73
72
|
`[\`integersOnly\`](#integersonly) is set to \`false\`, otherwise it can only be an integer.`),
|
|
74
73
|
},
|
|
75
74
|
events: {
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.optionComponentRenderer = exports.OptionMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
7
6
|
const container_helpers_1 = require("../container-helpers");
|
|
7
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
8
8
|
const OptionNative_1 = require("./OptionNative");
|
|
9
9
|
const COMP = "Option";
|
|
10
|
-
exports.OptionMd = (0,
|
|
10
|
+
exports.OptionMd = (0, metadata_helpers_1.createMetadata)({
|
|
11
11
|
description: "`Option` defines selectable items for choice-based components, providing both " +
|
|
12
12
|
"the underlying value and display text for selection interfaces. It serves as " +
|
|
13
13
|
"a non-visual data structure that describes individual choices within " +
|
|
14
14
|
"[Select](/components/Select), [AutoComplete](/components/AutoComplete), " +
|
|
15
15
|
"and other selection components.",
|
|
16
16
|
props: {
|
|
17
|
-
label: (0,
|
|
17
|
+
label: (0, metadata_helpers_1.d)(`This property defines the text to display for the option. If \`label\` is not defined, ` +
|
|
18
18
|
`\`Option\` will use the \`value\` as the label.`),
|
|
19
|
-
value: (0,
|
|
19
|
+
value: (0, metadata_helpers_1.d)("This property defines the value of the option. If \`value\` is not defined, " +
|
|
20
20
|
"\`Option\` will use the \`label\` as the value. If neither is defined, " +
|
|
21
21
|
"the option is not displayed."),
|
|
22
22
|
enabled: {
|
|
@@ -24,7 +24,7 @@ exports.OptionMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
24
24
|
valueType: "boolean",
|
|
25
25
|
defaultValue: OptionNative_1.defaultProps.enabled,
|
|
26
26
|
},
|
|
27
|
-
optionTemplate: (0,
|
|
27
|
+
optionTemplate: (0, metadata_helpers_1.d)("This property is used to define a custom option template"),
|
|
28
28
|
},
|
|
29
29
|
childrenAsTemplate: "optionTemplate",
|
|
30
30
|
});
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pageMetaTitleComponentRenderer = exports.PageMetaTitleMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
6
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
7
7
|
const PageMetaTilteNative_1 = require("./PageMetaTilteNative");
|
|
8
8
|
const COMP = "PageMetaTitle";
|
|
9
|
-
exports.PageMetaTitleMd = (0,
|
|
9
|
+
exports.PageMetaTitleMd = (0, metadata_helpers_1.createMetadata)({
|
|
10
10
|
description: "`PageMetaTitle` dynamically sets or updates the browser tab title, enabling " +
|
|
11
11
|
"pages and components to override the default application name with context-specific titles.",
|
|
12
12
|
props: {
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pagesRenderer = exports.PagesMd = exports.pageRenderer = exports.PageMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
7
6
|
const TableOfContentsContext_1 = require("../../components-core/TableOfContentsContext");
|
|
8
7
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
9
8
|
const PagesNative_1 = require("./PagesNative");
|
|
10
9
|
const PAGE = "Page";
|
|
11
|
-
exports.PageMd = (0,
|
|
10
|
+
exports.PageMd = (0, metadata_helpers_1.createMetadata)({
|
|
12
11
|
status: "stable",
|
|
13
12
|
docFolder: "Pages",
|
|
14
13
|
description: "`Page` defines route endpoints within an application, mapping specific URL " +
|
|
@@ -17,7 +16,7 @@ exports.PageMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
17
16
|
"routing system.",
|
|
18
17
|
props: {
|
|
19
18
|
//TODO illesg rename to path
|
|
20
|
-
url: (0,
|
|
19
|
+
url: (0, metadata_helpers_1.d)(`The URL of the route associated with the content. If not set, the page is not available.`),
|
|
21
20
|
navLabel: (0, metadata_helpers_1.dInternal)("The label of the page that is displayed in the navigation panel. If provided, the " +
|
|
22
21
|
"a new entry will be added to the navigation panel."),
|
|
23
22
|
},
|
|
@@ -26,16 +25,16 @@ exports.pageRenderer = (0, renderers_1.createComponentRenderer)(PAGE, exports.Pa
|
|
|
26
25
|
return ((0, jsx_runtime_1.jsx)(TableOfContentsContext_1.TableOfContentsProvider, { children: (0, jsx_runtime_1.jsx)(PagesNative_1.RouteWrapper, { childRoute: node.children, uid: node.uid, renderChild: renderChild, style: layoutCss }, extractValue(node.props.url)) }));
|
|
27
26
|
});
|
|
28
27
|
const COMP = "Pages";
|
|
29
|
-
exports.PagesMd = (0,
|
|
28
|
+
exports.PagesMd = (0, metadata_helpers_1.createMetadata)({
|
|
30
29
|
description: "`Pages` serves as the routing coordinator within an [App](/components/App), " +
|
|
31
30
|
"managing which [Page](/components/Page) displays based on the current URL.",
|
|
32
31
|
props: {
|
|
33
|
-
|
|
34
|
-
description: `The
|
|
35
|
-
defaultValue: PagesNative_1.defaultProps.
|
|
32
|
+
fallbackPath: {
|
|
33
|
+
description: `The fallback path when the current URL does not match any of the paths of the pages.`,
|
|
34
|
+
defaultValue: PagesNative_1.defaultProps.fallbackPath,
|
|
36
35
|
},
|
|
37
36
|
},
|
|
38
37
|
});
|
|
39
38
|
exports.pagesRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.PagesMd, ({ node, extractValue, renderChild }) => {
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)(PagesNative_1.Pages, {
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(PagesNative_1.Pages, { fallbackPath: extractValue(node.props.fallbackPath), node: node, renderChild: renderChild, extractValue: extractValue }));
|
|
41
40
|
});
|
|
@@ -23,12 +23,17 @@ const react_2 = require("@remix-run/react");
|
|
|
23
23
|
const classnames_1 = __importDefault(require("classnames"));
|
|
24
24
|
const constants_1 = require("../../components-core/constants");
|
|
25
25
|
const Pages_module_scss_1 = __importDefault(require("./Pages.module.scss"));
|
|
26
|
+
const AppLayoutContext_1 = require("../App/AppLayoutContext");
|
|
26
27
|
// Default props for Pages component
|
|
27
28
|
exports.defaultProps = {
|
|
28
|
-
|
|
29
|
+
fallbackPath: "/",
|
|
29
30
|
};
|
|
30
31
|
function RouteWrapper({ childRoute = constants_1.EMPTY_ARRAY, renderChild, layoutContext, style, uid, }) {
|
|
32
|
+
var _a;
|
|
31
33
|
const params = (0, react_2.useParams)();
|
|
34
|
+
const location = (0, react_2.useLocation)();
|
|
35
|
+
const appLayoutContext = (0, AppLayoutContext_1.useAppLayoutContext)();
|
|
36
|
+
const linkInfo = ((_a = appLayoutContext === null || appLayoutContext === void 0 ? void 0 : appLayoutContext.linkMap) === null || _a === void 0 ? void 0 : _a.get(location.pathname)) || {};
|
|
32
37
|
//we need to wrap the child route in a container to make sure the route params are available.
|
|
33
38
|
// we do this wrapping by providing an empty object to vars.
|
|
34
39
|
// this way it becomes an 'implicit' container (vars/state inside this container is propagated to the parent)
|
|
@@ -54,7 +59,7 @@ function RouteWrapper({ childRoute = constants_1.EMPTY_ARRAY, renderChild, layou
|
|
|
54
59
|
}, [style]);
|
|
55
60
|
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Pages_module_scss_1.default.wrapper, "xmlui-page-root"), style: wrapperStyle, children: renderChild(wrappedWithContainer, layoutContext) }, JSON.stringify(params)));
|
|
56
61
|
}
|
|
57
|
-
function Pages({ node, renderChild, extractValue,
|
|
62
|
+
function Pages({ node, renderChild, extractValue, fallbackPath }) {
|
|
58
63
|
var _a;
|
|
59
64
|
const routes = [];
|
|
60
65
|
const restChildren = [];
|
|
@@ -68,5 +73,5 @@ function Pages({ node, renderChild, extractValue, defaultRoute }) {
|
|
|
68
73
|
});
|
|
69
74
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Routes, { children: [routes.map((child, i) => {
|
|
70
75
|
return ((0, jsx_runtime_1.jsx)(react_2.Route, { path: extractValue(child.props.url), element: renderChild(child) }, i));
|
|
71
|
-
}), !!
|
|
76
|
+
}), !!fallbackPath && (0, jsx_runtime_1.jsx)(react_2.Route, { path: "*", element: (0, jsx_runtime_1.jsx)(react_2.Navigate, { to: fallbackPath, replace: true }) })] }), renderChild(restChildren)] }));
|
|
72
77
|
}
|
|
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.positionedContainerComponentRenderer = exports.PositionedContainerMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const PositionedContainer_module_scss_1 = __importDefault(require("./PositionedContainer.module.scss"));
|
|
9
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
11
|
const PositionedContainerNative_1 = require("./PositionedContainerNative");
|
|
12
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
13
13
|
const COMP = "PositionedContainer";
|
|
14
|
-
exports.PositionedContainerMd = (0,
|
|
14
|
+
exports.PositionedContainerMd = (0, metadata_helpers_1.createMetadata)({
|
|
15
15
|
status: "deprecated",
|
|
16
16
|
description: "(**OBSOLETE**) This component was created for the ChatEngine app.",
|
|
17
17
|
props: {
|
|
18
|
-
visibleOnHover: (0,
|
|
18
|
+
visibleOnHover: (0, metadata_helpers_1.d)("No description"),
|
|
19
19
|
},
|
|
20
20
|
themeVars: (0, themeVars_1.parseScssVar)(PositionedContainer_module_scss_1.default.themeVars),
|
|
21
21
|
});
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.progressBarComponentRenderer = exports.ProgressBarMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const ProgressBar_module_scss_1 = __importDefault(require("./ProgressBar.module.scss"));
|
|
9
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
11
|
const ProgressBarNative_1 = require("./ProgressBarNative");
|
|
12
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
13
13
|
const COMP = "ProgressBar";
|
|
14
|
-
exports.ProgressBarMd = (0,
|
|
14
|
+
exports.ProgressBarMd = (0, metadata_helpers_1.createMetadata)({
|
|
15
15
|
description: "`ProgressBar` provides a visual indicator showing the completion percentage " +
|
|
16
16
|
"of tasks, processes, or any measurable progress. It displays as a horizontal " +
|
|
17
17
|
"bar that fills from left to right based on the provided value between 0 " +
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.queueComponentRenderer = exports.QueueMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
7
6
|
const container_helpers_1 = require("../container-helpers");
|
|
7
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
8
8
|
const QueueNative_1 = require("./QueueNative");
|
|
9
9
|
const COMP = "Queue";
|
|
10
|
-
exports.QueueMd = (0,
|
|
10
|
+
exports.QueueMd = (0, metadata_helpers_1.createMetadata)({
|
|
11
11
|
description: "`Queue` manages sequential processing of items in FIFO (first-in, first-out) " +
|
|
12
12
|
"order. It is a non-visual component but provides UI progress reporting and result display.",
|
|
13
13
|
props: {
|
|
14
|
-
progressFeedback: (0,
|
|
14
|
+
progressFeedback: (0, metadata_helpers_1.d)("This property defines the component template of the UI that displays " +
|
|
15
15
|
"progress information whenever, the queue's \`progressReport\` function " +
|
|
16
16
|
"in invoked. If not set, no progress feedback is displayed."),
|
|
17
|
-
resultFeedback: (0,
|
|
17
|
+
resultFeedback: (0, metadata_helpers_1.d)("This property defines the component template of the UI that displays result " +
|
|
18
18
|
"information when the queue becomes empty after processing all queued items. If not set, " +
|
|
19
19
|
"no result feedback is displayed."),
|
|
20
20
|
clearAfterFinish: {
|
|
@@ -25,36 +25,36 @@ exports.QueueMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
25
25
|
},
|
|
26
26
|
nonVisual: true,
|
|
27
27
|
events: {
|
|
28
|
-
willProcess: (0,
|
|
29
|
-
process: (0,
|
|
28
|
+
willProcess: (0, metadata_helpers_1.d)(`This event is triggered to process a particular item.`),
|
|
29
|
+
process: (0, metadata_helpers_1.d)(`This event is fired to process the next item in the queue. If the processing cannot ` +
|
|
30
30
|
`proceed because of some error, raise an exception, and the queue will handle that.`),
|
|
31
|
-
didProcess: (0,
|
|
32
|
-
processError: (0,
|
|
31
|
+
didProcess: (0, metadata_helpers_1.d)(`This event is fired when the processing of a queued item has been successfully processed.`),
|
|
32
|
+
processError: (0, metadata_helpers_1.d)(`This event is fired when processing an item raises an error. The event handler method ` +
|
|
33
33
|
`receives two parameters. The first is the error raised during the processing of the ` +
|
|
34
34
|
`item; the second is an object with these properties:`),
|
|
35
|
-
complete: (0,
|
|
35
|
+
complete: (0, metadata_helpers_1.d)(`The queue fires this event when the queue gets empty after processing all items. ` +
|
|
36
36
|
`The event handler has no arguments.`),
|
|
37
37
|
},
|
|
38
38
|
apis: {
|
|
39
|
-
enqueueItem: (0,
|
|
39
|
+
enqueueItem: (0, metadata_helpers_1.d)(`This method enqueues the item passed in the method parameter. The new item will be ` +
|
|
40
40
|
`processed after the current queue items have been handled. The method retrieves the ` +
|
|
41
41
|
`unique ID of the newly added item; this ID can be used later in other methods, ` +
|
|
42
42
|
`such as \`remove\`.`),
|
|
43
|
-
enqueueItems: (0,
|
|
43
|
+
enqueueItems: (0, metadata_helpers_1.d)(`This method enqueues the array of items passed in the method parameter. The new items ` +
|
|
44
44
|
`will be processed after the current queue items have been handled. The method ` +
|
|
45
45
|
`retrieves an array of unique IDs, one for each new item. An item ID can be used later ` +
|
|
46
46
|
`in other methods, such as \`remove\`.`),
|
|
47
|
-
getQueuedItems: (0,
|
|
47
|
+
getQueuedItems: (0, metadata_helpers_1.d)(`You can use this method to return the items in the queue. These items contain all ` +
|
|
48
48
|
`entries not removed from the queue yet, including pending, in-progress, and ` +
|
|
49
49
|
`completed items.`),
|
|
50
|
-
getQueueLength: (0,
|
|
50
|
+
getQueueLength: (0, metadata_helpers_1.d)(`This method retrieves the current queue length. The queue contains only those items ` +
|
|
51
51
|
`that are not fully processed yet.`),
|
|
52
|
-
remove: (0,
|
|
52
|
+
remove: (0, metadata_helpers_1.d)(`This method retrieves the current queue length. The queue contains only those items ` +
|
|
53
53
|
`that are not fully processed yet.`),
|
|
54
54
|
},
|
|
55
55
|
contextVars: {
|
|
56
|
-
$completedItems: (0,
|
|
57
|
-
$queuedItems: (0,
|
|
56
|
+
$completedItems: (0, metadata_helpers_1.d)(`A list containing the queue items that have been completed (fully processed).`),
|
|
57
|
+
$queuedItems: (0, metadata_helpers_1.d)(`A list containing the items waiting in the queue, icluding the completed items.`),
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
exports.queueComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.QueueMd, ({ node, registerComponentApi, lookupEventHandler, renderChild, extractValue }) => {
|
|
@@ -6,14 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.radioGroupRenderer = exports.RadioGroupMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const RadioGroup_module_scss_1 = __importDefault(require("./RadioGroup.module.scss"));
|
|
9
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
11
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
13
12
|
const RadioGroupNative_1 = require("./RadioGroupNative");
|
|
14
13
|
const COMP = "RadioGroup";
|
|
15
14
|
const RGOption = `RadioGroupOption`;
|
|
16
|
-
exports.RadioGroupMd = (0,
|
|
15
|
+
exports.RadioGroupMd = (0, metadata_helpers_1.createMetadata)({
|
|
17
16
|
description: "`RadioGroup` creates a mutually exclusive selection interface where users can " +
|
|
18
17
|
"choose only one option from a group of radio buttons. It manages the selection " +
|
|
19
18
|
"state and ensures that selecting one option automatically deselects all others in " +
|
|
@@ -41,20 +40,21 @@ exports.RadioGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
41
40
|
defaultThemeVars: {
|
|
42
41
|
[`gap-${RGOption}`]: "$space-1_5",
|
|
43
42
|
[`borderWidth-${RGOption}`]: "1px",
|
|
44
|
-
[`
|
|
45
|
-
[`backgroundColor-checked-${RGOption}--disabled]`]: `$borderColor-${RGOption}--disabled`,
|
|
46
|
-
[`backgroundColor-checked-${RGOption}-error`]: `$borderColor-${RGOption}-error`,
|
|
47
|
-
[`backgroundColor-checked-${RGOption}-warning`]: `$borderColor-${RGOption}-warning`,
|
|
48
|
-
[`backgroundColor-checked-${RGOption}-success`]: `$borderColor-${RGOption}-success`,
|
|
49
|
-
[`fontSize-${RGOption}`]: "$fontSize-small",
|
|
50
|
-
[`fontWeight-${RGOption}`]: "$fontWeight-bold",
|
|
51
|
-
[`textColor-${RGOption}-error`]: `$borderColor-${RGOption}-error`,
|
|
52
|
-
[`textColor-${RGOption}-warning`]: `$borderColor-${RGOption}-warning`,
|
|
53
|
-
[`textColor-${RGOption}-success`]: `$borderColor-${RGOption}-success`,
|
|
54
|
-
[`backgroundColor-checked-${RGOption}-default`]: "$color-primary-500",
|
|
43
|
+
[`borderWidth-${RGOption}-validation`]: `2px`,
|
|
55
44
|
[`borderColor-${RGOption}-default`]: "$color-surface-500",
|
|
45
|
+
[`borderColor-checked-${RGOption}`]: "$color-primary-500",
|
|
56
46
|
[`borderColor-${RGOption}-default--hover`]: "$color-surface-700",
|
|
57
47
|
[`borderColor-${RGOption}-default--active`]: "$color-primary-500",
|
|
48
|
+
[`backgroundColor-${RGOption}--disabled`]: "$backgroundColor--disabled",
|
|
49
|
+
[`backgroundColor-checked-${RGOption}`]: "$color-primary-500",
|
|
50
|
+
[`backgroundColor-${RGOption}-checked--disabled`]: `$textColor--disabled`,
|
|
51
|
+
[`backgroundColor-checked-indicator-${RGOption}`]: `transparent`,
|
|
52
|
+
[`backgroundColor-${RGOption}-checked-indicator--disabled`]: `transparent`,
|
|
53
|
+
[`backgroundColor-checked-${RGOption}-error`]: `$borderColor-error`,
|
|
54
|
+
[`backgroundColor-checked-${RGOption}-warning`]: `$borderColor-warning`,
|
|
55
|
+
[`backgroundColor-checked-${RGOption}-success`]: `$borderColor-success`,
|
|
56
|
+
[`fontSize-${RGOption}`]: "$fontSize-small",
|
|
57
|
+
[`fontWeight-${RGOption}`]: "$fontWeight-bold",
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
exports.radioGroupRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.RadioGroupMd, ({ node, extractValue, layoutCss, state, updateState, lookupEventHandler, renderChild, registerComponentApi, }) => {
|
|
@@ -37,7 +37,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.RadioGroupOption = exports.RadioGroup = exports.defaultProps = void 0;
|
|
40
|
-
exports.useRadioGroupValue = useRadioGroupValue;
|
|
41
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
41
|
const react_1 = __importStar(require("react"));
|
|
43
42
|
const InnerRadioGroup = __importStar(require("@radix-ui/react-radio-group"));
|
|
@@ -54,8 +53,9 @@ exports.defaultProps = {
|
|
|
54
53
|
validationStatus: "none",
|
|
55
54
|
required: false,
|
|
56
55
|
};
|
|
57
|
-
const
|
|
56
|
+
const RadioGroupStatusContext = (0, react_1.createContext)({
|
|
58
57
|
status: "none",
|
|
58
|
+
enabled: exports.defaultProps.enabled,
|
|
59
59
|
});
|
|
60
60
|
exports.RadioGroup = (0, react_1.forwardRef)(function RadioGroup({ id, value = exports.defaultProps.value, initialValue = exports.defaultProps.initialValue, enabled = exports.defaultProps.enabled, validationStatus = exports.defaultProps.validationStatus, label, labelPosition, labelWidth, labelBreak, required = exports.defaultProps.required, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, children, registerComponentApi, style, }, forwardedRef) {
|
|
61
61
|
const [focused, setFocused] = react_1.default.useState(false);
|
|
@@ -90,40 +90,25 @@ exports.RadioGroup = (0, react_1.forwardRef)(function RadioGroup({ id, value = e
|
|
|
90
90
|
});
|
|
91
91
|
}, [/* focus, */ registerComponentApi, setValue]);
|
|
92
92
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
93
|
-
return { value, status: validationStatus };
|
|
94
|
-
}, [value, validationStatus]);
|
|
95
|
-
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: exports.RadioGroupOption, children: (0, jsx_runtime_1.jsx)(
|
|
93
|
+
return { value, status: validationStatus, enabled };
|
|
94
|
+
}, [value, validationStatus, enabled]);
|
|
95
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: exports.RadioGroupOption, children: (0, jsx_runtime_1.jsx)(RadioGroupStatusContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Root, { id: id, onBlur: handleOnBlur, onFocus: handleOnFocus, onValueChange: onInputChange, value: value, disabled: !enabled, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioGroupContainer, {
|
|
96
96
|
[RadioGroup_module_scss_1.default.focused]: focused,
|
|
97
97
|
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
98
98
|
}), children: children }) }) }) }));
|
|
99
99
|
});
|
|
100
|
-
function useRadioGroupValue() {
|
|
101
|
-
const context = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
102
|
-
if (!context) {
|
|
103
|
-
throw new Error("useRadioGroupValue must be used within a RadioGroup");
|
|
104
|
-
}
|
|
105
|
-
const { value } = context;
|
|
106
|
-
const isChecked = (0, react_1.useCallback)((optionValue) => value === optionValue, [value]);
|
|
107
|
-
return {
|
|
108
|
-
value,
|
|
109
|
-
isChecked,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
100
|
const RadioGroupOption = ({ value, label, enabled = true, optionRenderer, style, }) => {
|
|
113
101
|
const id = (0, react_1.useId)();
|
|
114
|
-
const
|
|
115
|
-
const { isChecked } = useRadioGroupValue();
|
|
102
|
+
const radioGroupContext = (0, react_1.useContext)(RadioGroupStatusContext);
|
|
116
103
|
const statusStyles = (0, react_1.useMemo)(() => ({
|
|
117
|
-
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
118
|
-
[RadioGroup_module_scss_1.default.error]: value ===
|
|
119
|
-
[RadioGroup_module_scss_1.default.warning]: value ===
|
|
120
|
-
[RadioGroup_module_scss_1.default.valid]: value ===
|
|
121
|
-
}), [enabled,
|
|
122
|
-
const item = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InnerRadioGroup.Item, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioOption, statusStyles, {
|
|
123
|
-
[RadioGroup_module_scss_1.default.checked]: isChecked(value),
|
|
124
|
-
}), value: value, disabled: !enabled, id: id, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Indicator, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.indicator, statusStyles) }) }), (0, jsx_runtime_1.jsx)("label", { htmlFor: id, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.label, statusStyles), children: label !== null && label !== void 0 ? label : value })] })), [enabled, id, label, statusStyles, value]);
|
|
104
|
+
[RadioGroup_module_scss_1.default.disabled]: radioGroupContext.enabled === false ? true : !enabled,
|
|
105
|
+
[RadioGroup_module_scss_1.default.error]: value === radioGroupContext.value && radioGroupContext.status === "error",
|
|
106
|
+
[RadioGroup_module_scss_1.default.warning]: value === radioGroupContext.value && radioGroupContext.status === "warning",
|
|
107
|
+
[RadioGroup_module_scss_1.default.valid]: value === radioGroupContext.value && radioGroupContext.status === "valid",
|
|
108
|
+
}), [enabled, radioGroupContext, value]);
|
|
109
|
+
const item = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InnerRadioGroup.Item, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioOption, statusStyles), value: value, disabled: !enabled, id: id, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Indicator, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.indicator, statusStyles) }) }), (0, jsx_runtime_1.jsx)("label", { htmlFor: id, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.label, statusStyles), children: label !== null && label !== void 0 ? label : value })] })), [enabled, id, label, statusStyles, value]);
|
|
125
110
|
return ((0, jsx_runtime_1.jsx)("div", { className: RadioGroup_module_scss_1.default.radioOptionContainer, style: style, children: optionRenderer ? ((0, jsx_runtime_1.jsxs)("label", { className: RadioGroup_module_scss_1.default.optionLabel, children: [(0, jsx_runtime_1.jsx)("div", { className: RadioGroup_module_scss_1.default.itemContainer, children: item }), optionRenderer({
|
|
126
|
-
$checked: value ===
|
|
111
|
+
$checked: value === radioGroupContext.value,
|
|
127
112
|
})] })) : (item) }, id));
|
|
128
113
|
};
|
|
129
114
|
exports.RadioGroupOption = RadioGroupOption;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.radioItemComponentRenderer = exports.RadioItemMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
6
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
7
7
|
const RadioItemNative_1 = require("./RadioItemNative");
|
|
8
8
|
const COMP = "RadioItem";
|
|
9
|
-
exports.RadioItemMd = (0,
|
|
9
|
+
exports.RadioItemMd = (0, metadata_helpers_1.createMetadata)({
|
|
10
10
|
status: "experimental",
|
|
11
11
|
description: `The \`${COMP}\` component is a radio button that is part of a group of radio buttons.`,
|
|
12
12
|
props: {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.realTimeAdapterComponentRenderer = exports.RealTimeAdapterMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
6
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
7
7
|
const RealTimeAdapterNative_1 = require("./RealTimeAdapterNative");
|
|
8
8
|
const COMP = "RealTimeAdapter";
|
|
9
|
-
exports.RealTimeAdapterMd = (0,
|
|
9
|
+
exports.RealTimeAdapterMd = (0, metadata_helpers_1.createMetadata)({
|
|
10
10
|
status: "experimental",
|
|
11
11
|
description: "`RealTimeAdapter` is a non-visual component that listens to real-time events.",
|
|
12
12
|
props: {
|
|
@@ -16,7 +16,7 @@ exports.RealTimeAdapterMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
events: {
|
|
19
|
-
eventArrived: (0,
|
|
19
|
+
eventArrived: (0, metadata_helpers_1.d)(`This event is raised when data arrives from the backend using long-polling.`),
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
exports.realTimeAdapterComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.RealTimeAdapterMd, ({ node, lookupEventHandler, extractValue }) => {
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.redirectRenderer = exports.RedirectMd = exports.defaultProps = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@remix-run/react");
|
|
6
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
7
6
|
const renderers_1 = require("../../components-core/renderers");
|
|
8
7
|
const component_utils_1 = require("../component-utils");
|
|
8
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
9
9
|
const COMP = "Redirect";
|
|
10
10
|
exports.defaultProps = {
|
|
11
11
|
to: "",
|
|
12
12
|
};
|
|
13
|
-
exports.RedirectMd = (0,
|
|
13
|
+
exports.RedirectMd = (0, metadata_helpers_1.createMetadata)({
|
|
14
14
|
description: "`Redirect` immediately redirects the browser to the URL in its `to` property when " +
|
|
15
15
|
"it gets visible (its `when` property gets `true`). It works only within " +
|
|
16
16
|
"[App](/components/App), not externally.",
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.selectComponentRenderer = exports.SelectMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const Select_module_scss_1 = __importDefault(require("../Select/Select.module.scss"));
|
|
9
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
11
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
@@ -14,7 +13,7 @@ const container_helpers_1 = require("../container-helpers");
|
|
|
14
13
|
const SelectNative_1 = require("./SelectNative");
|
|
15
14
|
const react_select_1 = require("@radix-ui/react-select");
|
|
16
15
|
const COMP = "Select";
|
|
17
|
-
exports.SelectMd = (0,
|
|
16
|
+
exports.SelectMd = (0, metadata_helpers_1.createMetadata)({
|
|
18
17
|
description: "`Select` provides a dropdown interface for choosing from a list of options, " +
|
|
19
18
|
"supporting both single and multiple selection modes. It offers extensive " +
|
|
20
19
|
"customization capabilities including search functionality, custom templates, " +
|
|
@@ -36,8 +35,8 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
36
35
|
optionTemplate: (0, metadata_helpers_1.dComponent)(`This property allows replacing the default template to display an option in the dropdown list.`),
|
|
37
36
|
valueTemplate: (0, metadata_helpers_1.dComponent)(`This property allows replacing the default template to display a selected value when ` +
|
|
38
37
|
`multiple selections (\`multiSelect\` is \`true\`) are enabled.`),
|
|
39
|
-
dropdownHeight: (0,
|
|
40
|
-
emptyListTemplate: (0,
|
|
38
|
+
dropdownHeight: (0, metadata_helpers_1.d)("This property sets the height of the dropdown list. If not set, the height is determined automatically."),
|
|
39
|
+
emptyListTemplate: (0, metadata_helpers_1.d)(`This optional property provides the ability to customize what is displayed when the ` +
|
|
41
40
|
`list of options is empty.`),
|
|
42
41
|
multiSelect: Object.assign(Object.assign({}, (0, metadata_helpers_1.dMulti)()), { defaultValue: SelectNative_1.defaultProps.multiSelect }),
|
|
43
42
|
searchable: {
|
|
@@ -62,11 +61,11 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
62
61
|
focus: (0, metadata_helpers_1.dFocus)(COMP),
|
|
63
62
|
setValue: (0, metadata_helpers_1.dSetValueApi)(),
|
|
64
63
|
value: (0, metadata_helpers_1.dValue)(),
|
|
65
|
-
reset: (0,
|
|
64
|
+
reset: (0, metadata_helpers_1.d)(`This method resets the component to its initial value, or clears the selection if no initial value was provided.`),
|
|
66
65
|
},
|
|
67
66
|
contextVars: {
|
|
68
|
-
$item: (0,
|
|
69
|
-
$itemContext: (0,
|
|
67
|
+
$item: (0, metadata_helpers_1.d)("Represents the current option's data (label and value properties)"),
|
|
68
|
+
$itemContext: (0, metadata_helpers_1.d)("Provides utility methods like `removeItem()` for multi-select scenarios"),
|
|
70
69
|
},
|
|
71
70
|
themeVars: (0, themeVars_1.parseScssVar)(Select_module_scss_1.default.themeVars),
|
|
72
71
|
defaultThemeVars: {
|
|
@@ -75,7 +74,6 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
75
74
|
[`borderRadius-menu-${COMP}`]: "$borderRadius",
|
|
76
75
|
[`borderWidth-menu-${COMP}`]: "1px",
|
|
77
76
|
[`borderColor-menu-${COMP}`]: "$borderColor",
|
|
78
|
-
[`minHeight-Input`]: "39px",
|
|
79
77
|
[`backgroundColor-${COMP}-badge`]: "$color-primary-500",
|
|
80
78
|
[`fontSize-${COMP}-badge`]: "$fontSize-small",
|
|
81
79
|
[`paddingHorizontal-${COMP}-badge`]: "$space-1",
|
|
@@ -91,6 +89,8 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
91
89
|
[`backgroundColor-item-${COMP}`]: "$backgroundColor-dropdown-item",
|
|
92
90
|
[`backgroundColor-item-${COMP}--hover`]: "$backgroundColor-dropdown-item--hover",
|
|
93
91
|
[`backgroundColor-item-${COMP}--active`]: "$backgroundColor-dropdown-item--active",
|
|
92
|
+
// Default borderColor-Input--disabled is too light so the disabled component is barely visible
|
|
93
|
+
[`borderColor-${COMP}--disabled`]: "initial",
|
|
94
94
|
},
|
|
95
95
|
});
|
|
96
96
|
exports.selectComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SelectMd, ({ node, state, updateState, extractValue, renderChild, lookupEventHandler, layoutCss, registerComponentApi, }) => {
|
|
@@ -212,7 +212,7 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
212
212
|
}, children: [searchable ? ((0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.commandInputContainer, children: [(0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "search" }), (0, jsx_runtime_1.jsx)(cmdk_1.CommandInput, { className: (0, classnames_1.default)(Select_module_scss_1.default.commandInput), placeholder: "Search..." })] })) : (
|
|
213
213
|
// https://github.com/pacocoursey/cmdk/issues/322#issuecomment-2444703817
|
|
214
214
|
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [inProgress && ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.loading, children: inProgressNotificationMessage })), Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { readOnly: readOnly, value: value, label: label, enabled: enabled, keywords: keywords }, value))), !inProgress && (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) }) }))] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { readOnly: !!readOnly, ref: ref, value: value, options: options, onValueChange: toggleOption, id: inputId, style: style, onFocus: onFocus, onBlur: onBlur, enabled: enabled, validationStatus: validationStatus, triggerRef: setReferenceElement, autoFocus: autoFocus, placeholder: placeholder, height: dropdownHeight, children: options.size > 0
|
|
215
|
-
? Array.from(options).map((option) => ((0, jsx_runtime_1.jsx)(SelectOption, { value: option.value, label: option.label, enabled: option.enabled }, option.value)))
|
|
215
|
+
? Array.from(options).map((option, idx) => ((0, jsx_runtime_1.jsx)(SelectOption, { value: option.value, label: option.label, enabled: option.enabled }, `${option.value}-${idx}`)))
|
|
216
216
|
: emptyListNode })) }), children] }) }) }));
|
|
217
217
|
});
|
|
218
218
|
exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwardedRef) {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.selectionStoreComponentRenderer = exports.SelectionStoreMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
6
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
7
7
|
const SelectionStoreNative_1 = require("./SelectionStoreNative");
|
|
8
8
|
const COMP = "SelectionStore";
|
|
9
|
-
exports.SelectionStoreMd = (0,
|
|
9
|
+
exports.SelectionStoreMd = (0, metadata_helpers_1.createMetadata)({
|
|
10
10
|
status: "deprecated",
|
|
11
11
|
description: `The \`${COMP}\` is a non-visual component that may wrap components (items) and manage ` +
|
|
12
12
|
`their selection state to accommodate the usage of other actions.`,
|