xmlui 0.8.6 → 0.9.1
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/{apiInterceptorWorker-fLBfPj2T.mjs → apiInterceptorWorker-230V_-Ds.mjs} +1 -1
- package/dist/{index-wd8FRzuM.mjs → index-DUwwx3L4.mjs} +5864 -6108
- package/dist/index.css +274 -301
- package/dist/language-server.mjs +25 -1
- package/dist/{lint-B18Ko6Sy.mjs → lint-gX2osbkz.mjs} +920 -1120
- package/dist/scripts/bin/build.js +2 -2
- package/dist/scripts/bin/start.js +3 -9
- package/dist/scripts/bin/vite-xmlui-plugin.js +2 -2
- package/dist/scripts/bin/viteConfig.js +89 -63
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +1 -2
- package/dist/scripts/src/components/Accordion/Accordion.js +6 -16
- package/dist/scripts/src/components/App/AppNative.js +8 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -5
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +10 -4
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +13 -19
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +2 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +7 -3
- package/dist/scripts/src/components/Avatar/Avatar.js +2 -9
- package/dist/scripts/src/components/Badge/Badge.js +2 -8
- package/dist/scripts/src/components/Button/Button.js +28 -60
- package/dist/scripts/src/components/Card/Card.js +1 -6
- package/dist/scripts/src/components/Checkbox/Checkbox.js +4 -12
- package/dist/scripts/src/components/ComponentProvider.js +4 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.js +3 -10
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/scripts/src/components/Form/Form.js +12 -28
- package/dist/scripts/src/components/Form/FormNative.js +9 -0
- package/dist/scripts/src/components/FormItem/HelperText.js +1 -1
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
- package/dist/scripts/src/components/Heading/HeadingNative.js +0 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +4 -19
- package/dist/scripts/src/components/IconProvider.js +2 -2
- package/dist/scripts/src/components/Link/Link.js +2 -8
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +4 -4
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -3
- package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -3
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +24 -12
- package/dist/scripts/src/components/NavLink/NavLink.js +4 -11
- package/dist/scripts/src/components/NavPanel/NavPanel.js +1 -6
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -8
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +4 -12
- package/dist/scripts/src/components/Select/Select.js +5 -13
- package/dist/scripts/src/components/Select/SelectNative.js +7 -3
- package/dist/scripts/src/components/Slider/Slider.js +2 -8
- package/dist/scripts/src/components/Spinner/Spinner.js +1 -6
- package/dist/scripts/src/components/SubNavPanel/SubNavPanel.js +22 -0
- package/dist/scripts/src/components/SubNavPanel/SubNavPanelNative.js +9 -0
- package/dist/scripts/src/components/Switch/Switch.js +6 -16
- package/dist/scripts/src/components/Table/Table.js +8 -17
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +4 -12
- package/dist/scripts/src/components/Tabs/Tabs.js +3 -10
- package/dist/scripts/src/components/Text/Text.js +10 -24
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +1 -1
- package/dist/scripts/src/components/Theme/ThemeNative.js +1 -1
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -3
- package/dist/scripts/src/components-core/DevTools.js +5 -4
- package/dist/scripts/src/components-core/RestApiProxy.js +7 -3
- package/dist/scripts/src/components-core/action/APICall.js +2 -1
- package/dist/scripts/src/components-core/rendering/Container.js +15 -11
- package/dist/scripts/src/components-core/rendering/StateContainer.js +3 -2
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +0 -2
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +1 -1
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +11 -64
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +196 -175
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +173 -231
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +129 -100
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +170 -175
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +48 -33
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +164 -170
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +5 -4
- package/dist/scripts/src/components-core/script-runner/visitors.js +124 -116
- package/dist/scripts/src/components-core/theming/themes/palette.js +1 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +300 -154
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +510 -510
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +0 -1
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +11 -11
- package/dist/scripts/src/components-core/utils/misc.js +13 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +56 -53
- package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
- package/dist/scripts/src/parsers/scripting-exp/Lexer.js +1092 -0
- package/dist/scripts/src/parsers/scripting-exp/Parser.js +2635 -0
- package/dist/scripts/src/parsers/scripting-exp/ParserError.js +47 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenTrait.js +109 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenType.js +2 -4
- package/dist/scripts/src/parsers/scripting-exp/code-behind-collect.js +101 -0
- package/dist/scripts/src/parsers/scripting-exp/modules.js +107 -0
- package/dist/scripts/src/parsers/{scripting → scripting-exp}/tree-visitor.js +103 -107
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +12 -12
- package/dist/style.css +245 -286
- package/dist/xmlui-metadata.mjs +2741 -2211
- package/dist/xmlui-metadata.umd.js +2740 -2212
- package/dist/xmlui-parser.d.ts +320 -232
- package/dist/xmlui-parser.mjs +19 -19
- package/dist/xmlui-standalone.umd.js +6770 -7220
- package/dist/xmlui.d.ts +322 -230
- package/dist/xmlui.mjs +1 -1
- package/package.json +10 -6
- package/dist/_commonjsHelpers-CcAunmGO.mjs +0 -33
- package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +0 -34
- package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +0 -40
- package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +0 -40
- package/dist/scripts/src/components-core/script-runner/syncProxy.js +0 -31
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +0 -153
- package/dist/scripts/src/parsers/scripting/modules.js +0 -284
- /package/dist/scripts/src/abstractions/scripting/{LogicalThread.js → LogicalThreadExp.js} +0 -0
- /package/dist/scripts/src/abstractions/scripting/{TryScope.js → TryScopeExp.js} +0 -0
|
@@ -118,66 +118,34 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
118
118
|
[`paddingVertical-${COMP}-md`]: "$space-3",
|
|
119
119
|
[`paddingHorizontal-${COMP}-lg`]: "$space-5",
|
|
120
120
|
[`paddingVertical-${COMP}-lg`]: "$space-4",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
[`backgroundColor-${COMP}-attention-ghost--active`]: "$color-danger-100",
|
|
150
|
-
},
|
|
151
|
-
dark: {
|
|
152
|
-
[`textColor-${COMP}`]: "$color-surface-50",
|
|
153
|
-
[`textColor-${COMP}-solid`]: "$color-surface-50",
|
|
154
|
-
[`borderColor-${COMP}-primary`]: "$color-primary-500",
|
|
155
|
-
[`backgroundColor-${COMP}-primary--hover`]: "$color-primary-600",
|
|
156
|
-
[`backgroundColor-${COMP}-primary--active`]: "$color-primary-500",
|
|
157
|
-
[`backgroundColor-${COMP}-primary-outlined--hover`]: "$color-primary-900",
|
|
158
|
-
[`backgroundColor-${COMP}-primary-outlined--active`]: "$color-primary-950",
|
|
159
|
-
[`borderColor-${COMP}-primary-outlined`]: "$color-primary-600",
|
|
160
|
-
[`borderColor-${COMP}-primary-outlined--hover`]: "$color-primary-500",
|
|
161
|
-
[`textColor-${COMP}-primary-outlined`]: "$color-primary-100",
|
|
162
|
-
[`textColor-${COMP}-primary-outlined--hover`]: "$color-primary-50",
|
|
163
|
-
[`textColor-${COMP}-primary-outlined--active`]: "$color-primary-100",
|
|
164
|
-
[`backgroundColor-${COMP}-primary-ghost--hover`]: "$color-primary-900",
|
|
165
|
-
[`backgroundColor-${COMP}-primary-ghost--active`]: "$color-primary-950",
|
|
166
|
-
[`borderColor-${COMP}-secondary`]: "$color-secondary-500",
|
|
167
|
-
[`backgroundColor-${COMP}-secondary`]: "$color-secondary-500",
|
|
168
|
-
[`backgroundColor-${COMP}-secondary--hover`]: "$color-secondary-400",
|
|
169
|
-
[`backgroundColor-${COMP}-secondary--active`]: "$color-secondary-500",
|
|
170
|
-
[`backgroundColor-${COMP}-secondary-outlined--hover`]: "$color-secondary-600",
|
|
171
|
-
[`backgroundColor-${COMP}-secondary-outlined--active`]: "$color-secondary-500",
|
|
172
|
-
[`backgroundColor-${COMP}-secondary-ghost--hover`]: "$color-secondary-900",
|
|
173
|
-
[`backgroundColor-${COMP}-secondary-ghost--active`]: "$color-secondary-950",
|
|
174
|
-
[`backgroundColor-${COMP}-attention--hover`]: "$color-danger-400",
|
|
175
|
-
[`backgroundColor-${COMP}-attention--active`]: "$color-danger-500",
|
|
176
|
-
[`backgroundColor-${COMP}-attention-outlined--hover`]: "$color-danger-900",
|
|
177
|
-
[`backgroundColor-${COMP}-attention-outlined--active`]: "$color-danger-950",
|
|
178
|
-
[`backgroundColor-${COMP}-attention-ghost--hover`]: "$color-danger-900",
|
|
179
|
-
[`backgroundColor-${COMP}-attention-ghost--active`]: "$color-danger-950",
|
|
180
|
-
},
|
|
121
|
+
[`textColor-${COMP}`]: "$color-surface-950",
|
|
122
|
+
[`textColor-${COMP}-solid`]: "$const-color-surface-50",
|
|
123
|
+
[`borderColor-${COMP}-primary`]: "$color-primary-500",
|
|
124
|
+
[`backgroundColor-${COMP}-primary--hover`]: "$color-primary-400",
|
|
125
|
+
[`backgroundColor-${COMP}-primary--active`]: "$color-primary-500",
|
|
126
|
+
[`backgroundColor-${COMP}-primary-outlined--hover`]: "$color-primary-50",
|
|
127
|
+
[`backgroundColor-${COMP}-primary-outlined--active`]: "$color-primary-100",
|
|
128
|
+
[`borderColor-${COMP}-primary-outlined`]: "$color-primary-600",
|
|
129
|
+
[`borderColor-${COMP}-primary-outlined--hover`]: "$color-primary-500",
|
|
130
|
+
[`textColor-${COMP}-primary-outlined`]: "$color-primary-900",
|
|
131
|
+
[`textColor-${COMP}-primary-outlined--hover`]: "$color-primary-950",
|
|
132
|
+
[`textColor-${COMP}-primary-outlined--active`]: "$color-primary-900",
|
|
133
|
+
[`backgroundColor-${COMP}-primary-ghost--hover`]: "$color-primary-50",
|
|
134
|
+
[`backgroundColor-${COMP}-primary-ghost--active`]: "$color-primary-100",
|
|
135
|
+
[`borderColor-${COMP}-secondary`]: "$color-secondary-100",
|
|
136
|
+
[`backgroundColor-${COMP}-secondary`]: "$color-secondary-500",
|
|
137
|
+
[`backgroundColor-${COMP}-secondary--hover`]: "$color-secondary-400",
|
|
138
|
+
[`backgroundColor-${COMP}-secondary--active`]: "$color-secondary-500",
|
|
139
|
+
[`backgroundColor-${COMP}-secondary-outlined--hover`]: "$color-secondary-50",
|
|
140
|
+
[`backgroundColor-${COMP}-secondary-outlined--active`]: "$color-secondary-100",
|
|
141
|
+
[`backgroundColor-${COMP}-secondary-ghost--hover`]: "$color-secondary-100",
|
|
142
|
+
[`backgroundColor-${COMP}-secondary-ghost--active`]: "$color-secondary-100",
|
|
143
|
+
[`backgroundColor-${COMP}-attention--hover`]: "$color-danger-400",
|
|
144
|
+
[`backgroundColor-${COMP}-attention--active`]: "$color-danger-500",
|
|
145
|
+
[`backgroundColor-${COMP}-attention-outlined--hover`]: "$color-danger-50",
|
|
146
|
+
[`backgroundColor-${COMP}-attention-outlined--active`]: "$color-danger-100",
|
|
147
|
+
[`backgroundColor-${COMP}-attention-ghost--hover`]: "$color-danger-50",
|
|
148
|
+
[`backgroundColor-${COMP}-attention-ghost--active`]: "$color-danger-100",
|
|
181
149
|
},
|
|
182
150
|
});
|
|
183
151
|
exports.buttonComponentRenderer = (0, renderers_1.createComponentRenderer)("Button", exports.ButtonMd, ({ node, extractValue, renderChild, lookupEventHandler, layoutCss }) => {
|
|
@@ -57,12 +57,7 @@ exports.CardMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
57
57
|
[`border-${COMP}`]: "1px solid $borderColor",
|
|
58
58
|
[`borderRadius-${COMP}`]: "$borderRadius",
|
|
59
59
|
[`boxShadow-${COMP}`]: "none",
|
|
60
|
-
|
|
61
|
-
[`backgroundColor-${COMP}`]: "white",
|
|
62
|
-
},
|
|
63
|
-
dark: {
|
|
64
|
-
[`backgroundColor-${COMP}`]: "$color-surface-900",
|
|
65
|
-
},
|
|
60
|
+
[`backgroundColor-${COMP}`]: "$color-surface-raised",
|
|
66
61
|
},
|
|
67
62
|
});
|
|
68
63
|
exports.cardComponentRenderer = (0, renderers_1.createComponentRenderer)("Card", exports.CardMd, ({ node, extractValue, renderChild, layoutCss }) => {
|
|
@@ -52,18 +52,10 @@ exports.CheckboxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
52
52
|
[`backgroundColor-checked-${COMP}-warning`]: `$borderColor-${COMP}-warning`,
|
|
53
53
|
[`borderColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
54
54
|
[`backgroundColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[`backgroundColor-${COMP}--disabled`]: "$color-surface-200",
|
|
60
|
-
},
|
|
61
|
-
dark: {
|
|
62
|
-
[`backgroundColor-indicator-${COMP}`]: "$backgroundColor-primary",
|
|
63
|
-
[`borderColor-checked-${COMP}`]: "$color-primary-400",
|
|
64
|
-
[`backgroundColor-checked-${COMP}`]: "$color-primary-400",
|
|
65
|
-
[`backgroundColor-${COMP}--disabled`]: "$color-surface-800",
|
|
66
|
-
},
|
|
55
|
+
[`backgroundColor-indicator-${COMP}`]: "$backgroundColor-primary",
|
|
56
|
+
[`borderColor-checked-${COMP}`]: "$color-primary-500",
|
|
57
|
+
[`backgroundColor-checked-${COMP}`]: "$color-primary-500",
|
|
58
|
+
[`backgroundColor-${COMP}--disabled`]: "$color-surface-200",
|
|
67
59
|
},
|
|
68
60
|
});
|
|
69
61
|
exports.checkboxComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.CheckboxMd, ({ node, extractValue, layoutCss, updateState, lookupEventHandler, state, registerComponentApi, renderChild, layoutContext, }) => {
|
|
@@ -99,6 +99,7 @@ const Backdrop_1 = require("./Backdrop/Backdrop");
|
|
|
99
99
|
const HtmlTags_1 = require("./HtmlTags/HtmlTags");
|
|
100
100
|
const ColorPicker_1 = require("./ColorPicker/ColorPicker");
|
|
101
101
|
const RadioItem_1 = require("./RadioGroup/RadioItem");
|
|
102
|
+
const SubNavPanel_1 = require("./SubNavPanel/SubNavPanel");
|
|
102
103
|
/**
|
|
103
104
|
* The framework has a specialized component concept, the "property holder
|
|
104
105
|
* component." These components only hold property values but do not render
|
|
@@ -272,6 +273,9 @@ class ComponentRegistry {
|
|
|
272
273
|
if (process.env.VITE_USED_COMPONENTS_NavPanel !== "false") {
|
|
273
274
|
this.registerCoreComponent(NavPanel_1.navPanelRenderer);
|
|
274
275
|
}
|
|
276
|
+
if (process.env.VITE_USED_COMPONENTS_SubNavPanel !== "false") {
|
|
277
|
+
this.registerCoreComponent(SubNavPanel_1.subNavPanelRenderer);
|
|
278
|
+
}
|
|
275
279
|
if (process.env.VITE_USED_COMPONENTS_Pages !== "false") {
|
|
276
280
|
this.registerCoreComponent(Pages_1.pagesRenderer);
|
|
277
281
|
this.registerCoreComponent(Pages_1.pageRenderer);
|
|
@@ -111,16 +111,9 @@ exports.DatePickerMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
111
111
|
[`boxShadow-menu-${COMP}`]: "$boxShadow-md",
|
|
112
112
|
[`borderRadius-menu-${COMP}`]: "$borderRadius",
|
|
113
113
|
[`textColor-value-${COMP}`]: "$textColor-primary",
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
[`backgroundColor-item-${COMP}--active`]: "$color-surface-200",
|
|
118
|
-
},
|
|
119
|
-
dark: {
|
|
120
|
-
[`backgroundColor-menu-${COMP}`]: "$color-surface-950",
|
|
121
|
-
[`backgroundColor-item-${COMP}--hover`]: "$color-surface-600",
|
|
122
|
-
[`backgroundColor-item-${COMP}--active`]: "$color-surface-700",
|
|
123
|
-
},
|
|
114
|
+
[`backgroundColor-menu-${COMP}`]: "$color-surface-50",
|
|
115
|
+
[`backgroundColor-item-${COMP}--hover`]: "$color-surface-100",
|
|
116
|
+
[`backgroundColor-item-${COMP}--active`]: "$color-surface-200",
|
|
124
117
|
},
|
|
125
118
|
});
|
|
126
119
|
exports.datePickerComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.DatePickerMd, ({ node, state, updateState, extractValue, layoutCss, lookupEventHandler, registerComponentApi, }) => {
|
|
@@ -62,7 +62,7 @@ exports.DropdownMenuMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
62
62
|
},
|
|
63
63
|
themeVars: (0, themeVars_1.parseScssVar)(DropdownMenu_module_scss_1.default.themeVars),
|
|
64
64
|
defaultThemeVars: {
|
|
65
|
-
[`backgroundColor-${DDMCOMP}`]: "$
|
|
65
|
+
[`backgroundColor-${DDMCOMP}`]: "$color-surface-raised",
|
|
66
66
|
[`minWidth-${DDMCOMP}`]: "160px",
|
|
67
67
|
[`boxShadow-${DDMCOMP}`]: "$boxShadow-xl",
|
|
68
68
|
[`borderStyle-${DDMCOMP}-content`]: "solid",
|
|
@@ -96,34 +96,18 @@ exports.FormMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
96
96
|
defaultThemeVars: {
|
|
97
97
|
"gap-Form": "$space-4",
|
|
98
98
|
"gap-buttonRow-Form": "$space-4",
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"textColor-ValidationDisplay-valid": "$color-valid",
|
|
112
|
-
},
|
|
113
|
-
dark: {
|
|
114
|
-
"backgroundColor-ValidationDisplay-error": "$color-danger-900",
|
|
115
|
-
"backgroundColor-ValidationDisplay-warning": "$color-warn-900",
|
|
116
|
-
"backgroundColor-ValidationDisplay-info": "$color-secondary-800",
|
|
117
|
-
"backgroundColor-ValidationDisplay-valid": "$color-success-900",
|
|
118
|
-
"color-accent-ValidationDisplay-error": "$color-danger-500",
|
|
119
|
-
"color-accent-ValidationDisplay-warning": "$color-warn-700",
|
|
120
|
-
"color-accent-ValidationDisplay-info": "$color-surface-200",
|
|
121
|
-
"color-accent-ValidationDisplay-valid": "$color-success-600",
|
|
122
|
-
"textColor-ValidationDisplay-error": "$color-danger-500",
|
|
123
|
-
"textColor-ValidationDisplay-warning": "$color-warn-700",
|
|
124
|
-
"textColor-ValidationDisplay-info": "$color-secondary-200",
|
|
125
|
-
"textColor-ValidationDisplay-valid": "$color-success-600",
|
|
126
|
-
},
|
|
99
|
+
"backgroundColor-ValidationDisplay-error": "$color-danger-100",
|
|
100
|
+
"backgroundColor-ValidationDisplay-warning": "$color-warn-100",
|
|
101
|
+
"backgroundColor-ValidationDisplay-info": "$color-primary-100",
|
|
102
|
+
"backgroundColor-ValidationDisplay-valid": "$color-success-100",
|
|
103
|
+
"color-accent-ValidationDisplay-error": "$color-error",
|
|
104
|
+
"color-accent-ValidationDisplay-warning": "$color-warning",
|
|
105
|
+
"color-accent-ValidationDisplay-info": "$color-info",
|
|
106
|
+
"color-accent-ValidationDisplay-valid": "$color-valid",
|
|
107
|
+
"textColor-ValidationDisplay-error": "$color-error",
|
|
108
|
+
"textColor-ValidationDisplay-warning": "$color-warning",
|
|
109
|
+
"textColor-ValidationDisplay-info": "$color-info",
|
|
110
|
+
"textColor-ValidationDisplay-valid": "$color-valid",
|
|
127
111
|
},
|
|
128
112
|
});
|
|
129
113
|
exports.formComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.FormMd, ({ node, renderChild, extractValue, layoutCss, lookupEventHandler, registerComponentApi }) => {
|
|
@@ -140,6 +140,7 @@ const formReducer = (0, immer_1.default)((state, action) => {
|
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
case formActions_1.FormActionKind.BACKEND_VALIDATION_ARRIVED: {
|
|
143
|
+
//console.log(state.validationResults[field]) //action.payload.fieldValidationResults
|
|
143
144
|
state.submitInProgress = false;
|
|
144
145
|
state.generalValidationResults = action.payload.generalValidationResults;
|
|
145
146
|
Object.keys(state.validationResults).forEach((key) => {
|
|
@@ -148,6 +149,14 @@ const formReducer = (0, immer_1.default)((state, action) => {
|
|
|
148
149
|
});
|
|
149
150
|
Object.entries(action.payload.fieldValidationResults).forEach(([field, singleValidationResults]) => {
|
|
150
151
|
var _a;
|
|
152
|
+
if (!state.validationResults[field]) {
|
|
153
|
+
state.validationResults[field] = {
|
|
154
|
+
isValid: false,
|
|
155
|
+
validations: [],
|
|
156
|
+
partial: false,
|
|
157
|
+
validatedValue: state.subject[field],
|
|
158
|
+
};
|
|
159
|
+
}
|
|
151
160
|
state.validationResults[field].validations = [
|
|
152
161
|
...(((_a = state.validationResults[field]) === null || _a === void 0 ? void 0 : _a.validations) || []),
|
|
153
162
|
...(singleValidationResults || []),
|
|
@@ -18,7 +18,7 @@ const HelperText = ({ text = "", status, style }) => {
|
|
|
18
18
|
return (0, jsx_runtime_1.jsx)(ErrorIcon_1.ErrorIcon, { color: "var(--xmlui-color-error)" });
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: style, className: (0, classnames_1.default)(HelperText_module_scss_1.default.helper, {
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", { "data-validation-status": status, style: style, className: (0, classnames_1.default)(HelperText_module_scss_1.default.helper, {
|
|
22
22
|
[HelperText_module_scss_1.default.valid]: status === "valid",
|
|
23
23
|
[HelperText_module_scss_1.default.warning]: status === "warning",
|
|
24
24
|
[HelperText_module_scss_1.default.error]: status === "error",
|
|
@@ -15,7 +15,7 @@ exports.ItemWithLabel = (0, react_1.forwardRef)(function ItemWithLabel({ id, lab
|
|
|
15
15
|
const generatedId = (0, react_1.useId)();
|
|
16
16
|
const inputId = id || generatedId;
|
|
17
17
|
if (label === undefined) {
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(react_slot_1.Slot, { style: style, id: inputId,
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_slot_1.Slot, { style: style, id: inputId, ref: ref, children: children }));
|
|
19
19
|
// return cloneElement(children as ReactElement, {
|
|
20
20
|
// ...mergeProps((children as ReactElement).props, {
|
|
21
21
|
// style,
|
|
@@ -31,7 +31,7 @@ exports.ItemWithLabel = (0, react_1.forwardRef)(function ItemWithLabel({ id, lab
|
|
|
31
31
|
[FormItem_module_scss_1.default.start]: labelPosition === "start",
|
|
32
32
|
[FormItem_module_scss_1.default.end]: labelPosition === "end",
|
|
33
33
|
[FormItem_module_scss_1.default.shrinkToLabel]: shrinkToLabel,
|
|
34
|
-
}),
|
|
34
|
+
}), children: [label && ((0, jsx_runtime_1.jsxs)("label", { htmlFor: inputId, onClick: () => document.getElementById(inputId).focus(), style: Object.assign(Object.assign({}, labelStyle), { width: labelWidth && numberRegex.test(labelWidth) ? `${labelWidth}px` : labelWidth, flexShrink: labelWidth !== undefined ? 0 : undefined }), className: (0, classnames_1.default)(FormItem_module_scss_1.default.inputLabel, {
|
|
35
35
|
[FormItem_module_scss_1.default.required]: required,
|
|
36
36
|
[FormItem_module_scss_1.default.disabled]: !enabled,
|
|
37
37
|
[FormItem_module_scss_1.default.labelBreak]: labelBreak,
|
|
@@ -47,7 +47,6 @@ exports.Heading = (0, react_1.forwardRef)(function Heading(_a, forwardedRef) {
|
|
|
47
47
|
}, []);
|
|
48
48
|
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
49
49
|
if (elementRef.current && anchorId && !omitFromToc) {
|
|
50
|
-
console.log("HERE", { anchorId, registerHeading, level, omitFromToc });
|
|
51
50
|
return registerHeading === null || registerHeading === void 0 ? void 0 : registerHeading({
|
|
52
51
|
id: anchorId,
|
|
53
52
|
level: parseInt(level.replace("h", "")),
|
|
@@ -1269,12 +1269,7 @@ exports.HtmlThMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
1269
1269
|
"padding-HtmlTh": "$space-2",
|
|
1270
1270
|
"fontSize-HtmlTh": "$fontSize-tiny",
|
|
1271
1271
|
"fontWeight-HtmlTh": "$fontWeight-bold",
|
|
1272
|
-
|
|
1273
|
-
"backgroundColor-HtmlTh--hover": "$color-surface-200",
|
|
1274
|
-
},
|
|
1275
|
-
dark: {
|
|
1276
|
-
"backgroundColor-HtmlTh--hover": "$color-surface-800",
|
|
1277
|
-
},
|
|
1272
|
+
"backgroundColor-HtmlTh--hover": "$color-surface-200",
|
|
1278
1273
|
},
|
|
1279
1274
|
});
|
|
1280
1275
|
exports.htmlThTagRenderer = (0, renderers_1.createComponentRenderer)("th", exports.HtmlThMd, ({ node, renderChild, extractValue, extractResourceUrl, layoutCss }) => {
|
|
@@ -1289,13 +1284,8 @@ exports.HtmlTheadMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
1289
1284
|
themeVars: (0, themeVars_1.parseScssVar)(HtmlTags_module_scss_1.default.themeVarsThead),
|
|
1290
1285
|
defaultThemeVars: {
|
|
1291
1286
|
"textTransform-HtmlThead": "uppercase",
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
"textColor-HtmlThead": "$color-surface-500",
|
|
1295
|
-
},
|
|
1296
|
-
dark: {
|
|
1297
|
-
"backgroundColor-HtmlThead": "$color-surface-950",
|
|
1298
|
-
},
|
|
1287
|
+
"backgroundColor-HtmlThead": "$color-surface-100",
|
|
1288
|
+
"textColor-HtmlThead": "$color-surface-500",
|
|
1299
1289
|
},
|
|
1300
1290
|
});
|
|
1301
1291
|
exports.htmlTheadTagRenderer = (0, renderers_1.createComponentRenderer)("thead", exports.HtmlTheadMd, ({ node, renderChild, extractValue, extractResourceUrl, layoutCss }) => {
|
|
@@ -1324,12 +1314,7 @@ exports.HtmlTrMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
1324
1314
|
defaultThemeVars: {
|
|
1325
1315
|
"fontSize-HtmlTr": "$fontSize-small",
|
|
1326
1316
|
"backgroundColor-row-HtmlTr": "inherit",
|
|
1327
|
-
|
|
1328
|
-
"backgroundColor-HtmlTr--hover": "$color-primary-50",
|
|
1329
|
-
},
|
|
1330
|
-
dark: {
|
|
1331
|
-
"backgroundColor-HtmlTr--hover": "$color-primary-900",
|
|
1332
|
-
},
|
|
1317
|
+
"backgroundColor-HtmlTr--hover": "$color-primary-50",
|
|
1333
1318
|
},
|
|
1334
1319
|
});
|
|
1335
1320
|
exports.htmlTrTagRenderer = (0, renderers_1.createComponentRenderer)("tr", exports.HtmlTrMd, ({ node, renderChild, extractValue, extractResourceUrl, layoutCss }) => {
|
|
@@ -103,6 +103,8 @@ registerIconRenderer("users", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiUsers, Ob
|
|
|
103
103
|
registerIconRenderer("refresh", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiRefreshCcw, Object.assign({}, props)));
|
|
104
104
|
registerIconRenderer("chevrondown", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiChevronDown, Object.assign({}, props)));
|
|
105
105
|
registerIconRenderer("chevronup", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiChevronUp, Object.assign({}, props)));
|
|
106
|
+
registerIconRenderer("chevronright", (props) => (0, jsx_runtime_1.jsx)(ChevronRight_1.ChevronRightIcon, Object.assign({}, props)));
|
|
107
|
+
registerIconRenderer("chevronleft", (props) => (0, jsx_runtime_1.jsx)(ChevronLeft_1.ChevronLeftIcon, Object.assign({}, props)));
|
|
106
108
|
registerIconRenderer("dotmenu", (props) => (0, jsx_runtime_1.jsx)(DotMenuIcon_1.DotMenuIcon, Object.assign({}, props)));
|
|
107
109
|
registerIconRenderer("dotmenuhorizontal", (props) => ((0, jsx_runtime_1.jsx)(DotMenuHorizontalIcon_1.DotMenuHorizontalIcon, Object.assign({}, props))));
|
|
108
110
|
registerIconRenderer("noresult", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiSlash, Object.assign({}, props)));
|
|
@@ -139,8 +141,6 @@ registerIconRenderer("plus", (props) => (0, jsx_runtime_1.jsx)(PlusIcon_1.PlusIc
|
|
|
139
141
|
registerIconRenderer("inspect", (props) => (0, jsx_runtime_1.jsx)(Inspect_1.InspectIcon, Object.assign({}, props)));
|
|
140
142
|
registerIconRenderer("plus-circle", (props) => (0, jsx_runtime_1.jsx)(ai_1.AiOutlinePlusCircle, Object.assign({}, props)));
|
|
141
143
|
registerIconRenderer("filledplus", (props) => (0, jsx_runtime_1.jsx)(FillPlusCricleIcon_1.FillPlusCircleIcon, Object.assign({}, props)));
|
|
142
|
-
registerIconRenderer("chevronright", (props) => (0, jsx_runtime_1.jsx)(ChevronRight_1.ChevronRightIcon, Object.assign({}, props)));
|
|
143
|
-
registerIconRenderer("chevronleft", (props) => (0, jsx_runtime_1.jsx)(ChevronLeft_1.ChevronLeftIcon, Object.assign({}, props)));
|
|
144
144
|
registerIconRenderer("checkmark", (props) => (0, jsx_runtime_1.jsx)(CheckIcon_1.CheckIcon, Object.assign({}, props)));
|
|
145
145
|
registerIconRenderer("valid", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiCheckCircle, Object.assign({}, props)));
|
|
146
146
|
registerIconRenderer("info", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiAlertOctagon, Object.assign({}, props)));
|
|
@@ -56,14 +56,8 @@ exports.LinkMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
56
56
|
[`fontSize-${COMP}`]: "inherit",
|
|
57
57
|
[`gap-icon-${COMP}`]: "$gap-tight",
|
|
58
58
|
[`padding-icon-${COMP}`]: "$space-0_5",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
[`textColor-${COMP}--active`]: "$color-primary-500",
|
|
62
|
-
},
|
|
63
|
-
dark: {
|
|
64
|
-
[`textColor-${COMP}`]: "$color-primary-500",
|
|
65
|
-
[`textColor-${COMP}--active`]: "$color-primary-500",
|
|
66
|
-
},
|
|
59
|
+
[`textColor-${COMP}`]: "$color-primary-500",
|
|
60
|
+
[`textColor-${COMP}--active`]: "$color-primary-500",
|
|
67
61
|
},
|
|
68
62
|
});
|
|
69
63
|
/**
|
|
@@ -16,6 +16,7 @@ const TextNative_1 = require("../Text/TextNative");
|
|
|
16
16
|
const LinkNative_1 = require("../Link/LinkNative");
|
|
17
17
|
const ImageNative_1 = require("../Image/ImageNative");
|
|
18
18
|
const Toggle_1 = require("../Toggle/Toggle");
|
|
19
|
+
const ScriptingSourceTreeExp_1 = require("../../abstractions/scripting/ScriptingSourceTreeExp");
|
|
19
20
|
exports.defaultProps = {
|
|
20
21
|
removeIndents: true,
|
|
21
22
|
};
|
|
@@ -252,10 +253,9 @@ function bindingExpression({ extractValue }) {
|
|
|
252
253
|
}
|
|
253
254
|
function parseArrowFunc(extracted) {
|
|
254
255
|
if (extracted.hasOwnProperty("type") &&
|
|
255
|
-
extracted.type ===
|
|
256
|
-
(extracted === null || extracted === void 0 ? void 0 : extracted._ARROW_EXPR_)
|
|
257
|
-
|
|
258
|
-
return extracted.source;
|
|
256
|
+
extracted.type === ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION &&
|
|
257
|
+
(extracted === null || extracted === void 0 ? void 0 : extracted._ARROW_EXPR_)) {
|
|
258
|
+
return "[xmlui function]";
|
|
259
259
|
}
|
|
260
260
|
return "";
|
|
261
261
|
}
|
|
@@ -51,9 +51,7 @@ exports.ModalDialogMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
51
51
|
"second (and so on) parameters. \`$param\` is the same as \`$params[0]\`."),
|
|
52
52
|
},
|
|
53
53
|
themeVars: (0, themeVars_1.parseScssVar)(ModalDialog_module_scss_1.default.themeVars),
|
|
54
|
-
defaultThemeVars: Object.assign(Object.assign({}, (0, base_utils_1.paddingSubject)(COMP, { all: "$space-7" })), { [`backgroundColor-${COMP}`]: "$backgroundColor-primary", [`backgroundColor-overlay-${COMP}`]: "$backgroundColor-overlay", [`textColor-${COMP}`]: "$textColor-primary", [`borderRadius-${COMP}`]: "$borderRadius", [`fontFamily-${COMP}`]: "$fontFamily", [`maxWidth-${COMP}`]: "450px", [`marginBottom-title-${COMP}`]: "0",
|
|
55
|
-
[`backgroundColor-${COMP}`]: "$backgroundColor-primary",
|
|
56
|
-
} }),
|
|
54
|
+
defaultThemeVars: Object.assign(Object.assign({}, (0, base_utils_1.paddingSubject)(COMP, { all: "$space-7" })), { [`backgroundColor-${COMP}`]: "$backgroundColor-primary", [`backgroundColor-overlay-${COMP}`]: "$backgroundColor-overlay", [`textColor-${COMP}`]: "$textColor-primary", [`borderRadius-${COMP}`]: "$borderRadius", [`fontFamily-${COMP}`]: "$fontFamily", [`maxWidth-${COMP}`]: "450px", [`marginBottom-title-${COMP}`]: "0" }),
|
|
57
55
|
});
|
|
58
56
|
exports.modalViewComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.ModalDialogMd, ({ node, extractValue, layoutCss, renderChild, lookupEventHandler, registerComponentApi, layoutContext, }) => {
|
|
59
57
|
var _a, _b;
|
|
@@ -19,8 +19,39 @@ exports.NavGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
19
19
|
`(\`NavLink\` components). It can be displayed as a submenu in the App's UI.`,
|
|
20
20
|
props: {
|
|
21
21
|
label: (0, metadata_helpers_1.dLabel)(),
|
|
22
|
-
|
|
23
|
-
to:
|
|
22
|
+
initiallyExpanded: (0, ComponentDefs_1.d)('This property defines whether the group is initially expanded or collapsed.'),
|
|
23
|
+
to: {
|
|
24
|
+
description: `This property defines an optional navigation link.`,
|
|
25
|
+
valueType: "string",
|
|
26
|
+
},
|
|
27
|
+
icon: {
|
|
28
|
+
description: `This property defines an optional icon to display along with the \`${COMP}\` label.`,
|
|
29
|
+
valueType: "string",
|
|
30
|
+
},
|
|
31
|
+
iconHorizontalExpanded: {
|
|
32
|
+
description: "Set a custom icon to display when the navigation menu is expanded, " +
|
|
33
|
+
"is in a **horizontal** app layout, and is in a navigation submenu.",
|
|
34
|
+
valueType: "string",
|
|
35
|
+
defaultValue: NavGroupNative_1.defaultProps.iconHorizontalExpanded,
|
|
36
|
+
},
|
|
37
|
+
iconVerticalExpanded: {
|
|
38
|
+
description: "Set a custom icon to display when the navigation menu is expanded, " +
|
|
39
|
+
"is in a **vertical** app layout, or is in a **horizontal** layout and is the top-level navigation item in the menu.",
|
|
40
|
+
valueType: "string",
|
|
41
|
+
defaultValue: NavGroupNative_1.defaultProps.iconVerticalExpanded,
|
|
42
|
+
},
|
|
43
|
+
iconHorizontalCollapsed: {
|
|
44
|
+
description: "Set a custom icon to display when the navigation menu is collapsed, " +
|
|
45
|
+
"is in a **horizontal** app layout, and is in a navigation submenu.",
|
|
46
|
+
valueType: "string",
|
|
47
|
+
defaultValue: NavGroupNative_1.defaultProps.iconHorizontalCollapsed,
|
|
48
|
+
},
|
|
49
|
+
iconVerticalCollapsed: {
|
|
50
|
+
description: "Set a custom icon to display when the navigation menu is collapsed, " +
|
|
51
|
+
"is in a **vertical** app layout, or is in a **horizontal** layout and is the top-level navigation item in the menu.",
|
|
52
|
+
valueType: "string",
|
|
53
|
+
defaultValue: NavGroupNative_1.defaultProps.iconVerticalCollapsed,
|
|
54
|
+
},
|
|
24
55
|
},
|
|
25
56
|
themeVars: (0, themeVars_1.parseScssVar)(NavGroup_module_scss_1.default.themeVars),
|
|
26
57
|
defaultThemeVars: {
|
|
@@ -30,5 +61,5 @@ exports.NavGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
30
61
|
},
|
|
31
62
|
});
|
|
32
63
|
exports.navGroupComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.NavGroupMd, ({ node, extractValue, renderChild }) => {
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(NavGroupNative_1.NavGroup, { label: extractValue.asDisplayText(node.props.label), to: extractValue.asOptionalString(node.props.to), icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: extractValue.asString(node.props.icon), className: NavLink_module_scss_1.default.icon }), node: node, renderChild: renderChild }));
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(NavGroupNative_1.NavGroup, { label: extractValue.asDisplayText(node.props.label), to: extractValue.asOptionalString(node.props.to), icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: extractValue.asString(node.props.icon), className: NavLink_module_scss_1.default.icon }), node: node, initiallyExpanded: extractValue.asBoolean(node.props.initiallyExpanded), renderChild: renderChild, iconHorizontalExpanded: extractValue.asOptionalString(node.props.iconHorizontalExpanded), iconVerticalExpanded: extractValue.asOptionalString(node.props.iconVerticalExpanded), iconHorizontalCollapsed: extractValue.asOptionalString(node.props.iconHorizontalCollapsed), iconVerticalCollapsed: extractValue.asOptionalString(node.props.iconVerticalCollapsed) }));
|
|
34
65
|
});
|
|
@@ -3,11 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NavGroup = void 0;
|
|
6
|
+
exports.NavGroup = exports.defaultProps = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const react_dropdown_menu_1 = require("@radix-ui/react-dropdown-menu");
|
|
10
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
11
10
|
const NavGroup_module_scss_1 = __importDefault(require("./NavGroup.module.scss"));
|
|
12
11
|
const constants_1 = require("../../components-core/constants");
|
|
13
12
|
const mergeProps_1 = require("../../components-core/utils/mergeProps");
|
|
@@ -16,10 +15,20 @@ const IconNative_1 = require("../Icon/IconNative");
|
|
|
16
15
|
const NavLinkNative_1 = require("../NavLink/NavLinkNative");
|
|
17
16
|
const AppLayoutContext_1 = require("../App/AppLayoutContext");
|
|
18
17
|
const NavPanelNative_1 = require("../NavPanel/NavPanelNative");
|
|
18
|
+
exports.defaultProps = {
|
|
19
|
+
iconHorizontalExpanded: "chevronleft",
|
|
20
|
+
iconHorizontalCollapsed: "chevronright",
|
|
21
|
+
iconVerticalExpanded: "chevronup",
|
|
22
|
+
iconVerticalCollapsed: "chevrondown",
|
|
23
|
+
};
|
|
19
24
|
const NavGroupContext = (0, react_1.createContext)({
|
|
20
25
|
level: -1,
|
|
26
|
+
iconHorizontalCollapsed: exports.defaultProps.iconHorizontalCollapsed,
|
|
27
|
+
iconHorizontalExpanded: exports.defaultProps.iconHorizontalExpanded,
|
|
28
|
+
iconVerticalCollapsed: exports.defaultProps.iconVerticalCollapsed,
|
|
29
|
+
iconVerticalExpanded: exports.defaultProps.iconVerticalExpanded,
|
|
21
30
|
});
|
|
22
|
-
exports.NavGroup = (0, react_1.forwardRef)(function NavGroup({ node, style, label, icon, renderChild, to }, ref) {
|
|
31
|
+
exports.NavGroup = (0, react_1.forwardRef)(function NavGroup({ node, style, label, icon, renderChild, to, initiallyExpanded, iconHorizontalCollapsed, iconHorizontalExpanded, iconVerticalCollapsed, iconVerticalExpanded, }, ref) {
|
|
23
32
|
const { level } = (0, react_1.useContext)(NavGroupContext);
|
|
24
33
|
const appLayoutContext = (0, AppLayoutContext_1.useAppLayoutContext)();
|
|
25
34
|
const navPanelContext = (0, react_1.useContext)(NavPanelNative_1.NavPanelContext);
|
|
@@ -32,15 +41,19 @@ exports.NavGroup = (0, react_1.forwardRef)(function NavGroup({ node, style, labe
|
|
|
32
41
|
const navGroupContextValue = (0, react_1.useMemo)(() => {
|
|
33
42
|
return {
|
|
34
43
|
level: level + 1,
|
|
44
|
+
iconHorizontalCollapsed: iconHorizontalCollapsed !== null && iconHorizontalCollapsed !== void 0 ? iconHorizontalCollapsed : exports.defaultProps.iconHorizontalCollapsed,
|
|
45
|
+
iconHorizontalExpanded: iconHorizontalExpanded !== null && iconHorizontalExpanded !== void 0 ? iconHorizontalExpanded : exports.defaultProps.iconHorizontalExpanded,
|
|
46
|
+
iconVerticalCollapsed: iconVerticalCollapsed !== null && iconVerticalCollapsed !== void 0 ? iconVerticalCollapsed : exports.defaultProps.iconVerticalCollapsed,
|
|
47
|
+
iconVerticalExpanded: iconVerticalExpanded !== null && iconVerticalExpanded !== void 0 ? iconVerticalExpanded : exports.defaultProps.iconVerticalExpanded,
|
|
35
48
|
};
|
|
36
49
|
}, [level]);
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)(NavGroupContext.Provider, { value: navGroupContextValue, children: inline ? ((0, jsx_runtime_1.jsx)(ExpandableNavGroup, { to: to, style: style, label: label, icon: icon, node: node, renderChild: renderChild, ref: ref })) : ((0, jsx_runtime_1.jsx)(DropDownNavGroup, { label: label, icon: icon, node: node, renderChild: renderChild, ref: ref, to: to })) }));
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(NavGroupContext.Provider, { value: navGroupContextValue, children: inline ? ((0, jsx_runtime_1.jsx)(ExpandableNavGroup, { to: to, style: style, label: label, icon: icon, node: node, renderChild: renderChild, ref: ref, initiallyExpanded: initiallyExpanded })) : ((0, jsx_runtime_1.jsx)(DropDownNavGroup, { label: label, icon: icon, node: node, renderChild: renderChild, ref: ref, to: to })) }));
|
|
38
51
|
});
|
|
39
|
-
const ExpandableNavGroup = (0, react_1.forwardRef)(function ExpandableNavGroup({ style = constants_1.EMPTY_OBJECT, label, icon, renderChild, node, to, }, ref) {
|
|
40
|
-
const { level } = (0, react_1.useContext)(NavGroupContext);
|
|
41
|
-
const [expanded, setExpanded] = (0, react_1.useState)(
|
|
52
|
+
const ExpandableNavGroup = (0, react_1.forwardRef)(function ExpandableNavGroup({ style = constants_1.EMPTY_OBJECT, label, icon, renderChild, node, to, initiallyExpanded = false, }, ref) {
|
|
53
|
+
const { level, iconVerticalCollapsed, iconVerticalExpanded } = (0, react_1.useContext)(NavGroupContext);
|
|
54
|
+
const [expanded, setExpanded] = (0, react_1.useState)(initiallyExpanded);
|
|
42
55
|
const toggleStyle = Object.assign(Object.assign({}, style), { paddingLeft: level >= 1 ? level * 2 + "em" : undefined });
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(NavLinkNative_1.NavLink, { style: toggleStyle, onClick: () => setExpanded((prev) => !prev), icon: icon, to: to, children: [label, (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } }), (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: expanded ?
|
|
56
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(NavLinkNative_1.NavLink, { style: toggleStyle, onClick: () => setExpanded((prev) => !prev), icon: icon, to: to, children: [label, (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } }), (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: expanded ? iconVerticalExpanded : iconVerticalCollapsed })] }), expanded &&
|
|
44
57
|
renderChild(node.children, {
|
|
45
58
|
wrapChild: ({ node }, renderedChild) => {
|
|
46
59
|
if (node.type === "NavLink") {
|
|
@@ -56,7 +69,7 @@ const ExpandableNavGroup = (0, react_1.forwardRef)(function ExpandableNavGroup({
|
|
|
56
69
|
})] }));
|
|
57
70
|
});
|
|
58
71
|
const DropDownNavGroup = (0, react_1.forwardRef)(function DropDownNavGroup({ style, label, icon, renderChild, node, to, }, ref) {
|
|
59
|
-
const { level } = (0, react_1.useContext)(NavGroupContext);
|
|
72
|
+
const { level, iconHorizontalCollapsed, iconHorizontalExpanded, iconVerticalCollapsed, iconVerticalExpanded, } = (0, react_1.useContext)(NavGroupContext);
|
|
60
73
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
61
74
|
let Wrapper = react_dropdown_menu_1.DropdownMenu;
|
|
62
75
|
let Trigger = react_dropdown_menu_1.DropdownMenuTrigger;
|
|
@@ -66,9 +79,8 @@ const DropDownNavGroup = (0, react_1.forwardRef)(function DropDownNavGroup({ sty
|
|
|
66
79
|
Trigger = react_dropdown_menu_1.DropdownMenuSubTrigger;
|
|
67
80
|
Content = react_dropdown_menu_1.DropdownMenuSubContent;
|
|
68
81
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}), children: label }) }) }), (0, jsx_runtime_1.jsx)(react_dropdown_menu_1.DropdownMenuPortal, { container: root, children: (0, jsx_runtime_1.jsx)(Content, { className: NavGroup_module_scss_1.default.dropdownList, style: { display: "flex", flexDirection: "column" }, side: "bottom", align: "start", children: renderChild(node.children, {
|
|
82
|
+
const [expanded, setExpanded] = (0, react_1.useState)(false);
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, { onOpenChange: (open) => setExpanded(open), children: [(0, jsx_runtime_1.jsx)(Trigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(NavLinkNative_1.NavLink, { icon: icon, style: { flexShrink: 0 }, vertical: level >= 1, to: to, children: [label, (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } }), level === 0 && (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: expanded ? iconVerticalExpanded : iconVerticalCollapsed }), level >= 1 && ((0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: expanded ? iconHorizontalExpanded : iconHorizontalCollapsed }))] }) }), (0, jsx_runtime_1.jsx)(react_dropdown_menu_1.DropdownMenuPortal, { container: root, children: (0, jsx_runtime_1.jsx)(Content, { className: NavGroup_module_scss_1.default.dropdownList, style: { display: "flex", flexDirection: "column" }, side: "bottom", align: "start", children: renderChild(node.children, {
|
|
72
84
|
wrapChild: ({ node }, renderedChild, hints) => {
|
|
73
85
|
if (hints === null || hints === void 0 ? void 0 : hints.opaque) {
|
|
74
86
|
return renderedChild;
|
|
@@ -73,17 +73,10 @@ exports.NavLinkMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
73
73
|
[`outlineStyle-${COMP}--focus`]: "$outlineStyle--focus",
|
|
74
74
|
[`outlineOffset-${COMP}--focus`]: "-1px",
|
|
75
75
|
[`borderRadius-indicator-${COMP}`]: "$borderRadius",
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
[`color-indicator-${COMP}--hover`]: "$color-primary-600",
|
|
81
|
-
},
|
|
82
|
-
dark: {
|
|
83
|
-
[`color-indicator-${COMP}--active`]: "$color-primary-500",
|
|
84
|
-
[`color-indicator-${COMP}--pressed`]: "$color-primary-500",
|
|
85
|
-
[`color-indicator-${COMP}--hover`]: "$color-primary-400",
|
|
86
|
-
},
|
|
76
|
+
[`color-icon-${COMP}`]: "$color-surface-500",
|
|
77
|
+
[`color-indicator-${COMP}--active`]: "$color-primary-500",
|
|
78
|
+
[`color-indicator-${COMP}--pressed`]: "$color-primary-500",
|
|
79
|
+
[`color-indicator-${COMP}--hover`]: "$color-primary-600",
|
|
87
80
|
},
|
|
88
81
|
});
|
|
89
82
|
exports.navLinkComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.NavLinkMd, ({ node, extractValue, renderChild, layoutCss }) => {
|
|
@@ -26,12 +26,7 @@ exports.NavPanelMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
26
26
|
[`paddingVertical-logo-${COMP}`]: "$space-4",
|
|
27
27
|
[`paddingHorizontal-logo-${COMP}`]: "$space-4",
|
|
28
28
|
[`marginBottom-logo-${COMP}`]: "$space-4",
|
|
29
|
-
|
|
30
|
-
[`boxShadow-${COMP}-vertical`]: "4px 0 4px 0 rgb(0 0 0 / 10%)",
|
|
31
|
-
},
|
|
32
|
-
dark: {
|
|
33
|
-
[`boxShadow-${COMP}-vertical`]: "4px 0 6px 0 rgba(0, 0, 0, 0.2)",
|
|
34
|
-
},
|
|
29
|
+
[`boxShadow-${COMP}-vertical`]: "4px 0 4px 0 rgb(0 0 0 / 10%)",
|
|
35
30
|
},
|
|
36
31
|
});
|
|
37
32
|
exports.navPanelRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.NavPanelMd, ({ node, renderChild, layoutCss, layoutContext }) => {
|
|
@@ -25,14 +25,8 @@ exports.ProgressBarMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
25
25
|
[`borderRadius-${COMP}`]: "$borderRadius",
|
|
26
26
|
[`borderRadius-indicator-${COMP}`]: "0px",
|
|
27
27
|
[`thickness-${COMP}`]: "$space-2",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[`color-indicator-${COMP}`]: "$color-primary-500",
|
|
31
|
-
},
|
|
32
|
-
dark: {
|
|
33
|
-
[`backgroundColor-${COMP}`]: "$color-surface-700",
|
|
34
|
-
[`color-indicator-${COMP}`]: "$color-primary-500",
|
|
35
|
-
},
|
|
28
|
+
[`backgroundColor-${COMP}`]: "$color-surface-200",
|
|
29
|
+
[`color-indicator-${COMP}`]: "$color-primary-500",
|
|
36
30
|
},
|
|
37
31
|
});
|
|
38
32
|
exports.progressBarComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.ProgressBarMd, ({ node, extractValue, layoutCss }) => {
|