xmlui 0.7.21 → 0.7.22
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-LRHkKnha.mjs → apiInterceptorWorker-D8M55a0M.mjs} +25 -10
- package/dist/{grammar.tmLanguage-DNepe_jP.mjs → grammar.tmLanguage-JAlHWPqw.mjs} +1 -1
- package/dist/{index-5NLXyjX0.mjs → index-BLoqesEB.mjs} +21343 -19576
- package/dist/index.css +1 -1
- package/dist/scripts/bin/build-lib.js +10 -4
- package/dist/scripts/bin/build.js +1 -4
- package/dist/scripts/bin/index.js +7 -7
- package/dist/scripts/bin/preview.js +19 -2
- package/dist/scripts/bin/start.js +2 -4
- package/dist/scripts/bin/viteConfig.js +2 -11
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -1
- package/dist/scripts/src/components/APICall/APICall.js +3 -3
- package/dist/scripts/src/components/APICall/APICallNative.js +2 -2
- package/dist/scripts/src/components/Accordion/Accordion.js +5 -5
- package/dist/scripts/src/components/Accordion/AccordionContext.js +1 -1
- package/dist/scripts/src/components/Accordion/AccordionItem.js +5 -5
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +3 -3
- package/dist/scripts/src/components/Accordion/AccordionNative.js +3 -3
- package/dist/scripts/src/components/Alert/Alert.js +4 -4
- package/dist/scripts/src/components/App/App.js +5 -5
- package/dist/scripts/src/components/App/AppNative.js +33 -34
- package/dist/scripts/src/components/App/Sheet.js +4 -4
- package/dist/scripts/src/components/AppHeader/AppHeader.js +6 -6
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +9 -9
- package/dist/scripts/src/components/AppState/AppState.js +2 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +2 -2
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +7 -7
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +29 -31
- package/dist/scripts/src/components/Avatar/Avatar.js +4 -4
- package/dist/scripts/src/components/Avatar/AvatarNative.js +1 -1
- package/dist/scripts/src/components/Backdrop/Backdrop.js +4 -4
- package/dist/scripts/src/components/Badge/Badge.js +3 -3
- package/dist/scripts/src/components/Badge/BadgeNative.js +2 -2
- package/dist/scripts/src/components/Bookmark/Bookmark.js +2 -2
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +1 -1
- package/dist/scripts/src/components/Breakout/Breakout.js +2 -2
- package/dist/scripts/src/components/Button/Button.js +6 -6
- package/dist/scripts/src/components/Button/ButtonNative.js +3 -3
- package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +5 -5
- package/dist/scripts/src/components/Card/Card.js +5 -5
- package/dist/scripts/src/components/Card/CardNative.js +7 -7
- package/dist/scripts/src/components/Carousel/Carousel.js +5 -5
- package/dist/scripts/src/components/Carousel/CarouselItem.js +3 -3
- package/dist/scripts/src/components/Carousel/CarouselItemNative.js +3 -3
- package/dist/scripts/src/components/Carousel/CarouselNative.js +6 -6
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +3 -3
- package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +1 -1
- package/dist/scripts/src/components/Chart/Chart.js +2 -2
- package/dist/scripts/src/components/Chart/ChartNative.js +5 -6
- package/dist/scripts/src/components/Checkbox/Checkbox.js +6 -6
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +43 -0
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +54 -0
- package/dist/scripts/src/components/Column/Column.js +2 -2
- package/dist/scripts/src/components/Column/ColumnNative.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +192 -94
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +4 -4
- package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +1 -1
- package/dist/scripts/src/components/DatePicker/DatePicker.js +4 -4
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +18 -19
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +6 -6
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +5 -5
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +4 -4
- package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +1 -1
- package/dist/scripts/src/components/FileInput/FileInput.js +6 -6
- package/dist/scripts/src/components/FileInput/FileInputNative.js +6 -6
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +3 -3
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +6 -7
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +8 -6
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +27 -16
- package/dist/scripts/src/components/Footer/Footer.js +4 -4
- package/dist/scripts/src/components/Footer/FooterNative.js +2 -2
- package/dist/scripts/src/components/Form/Form.js +5 -5
- package/dist/scripts/src/components/Form/FormNative.js +29 -29
- package/dist/scripts/src/components/FormItem/FormItem.js +4 -4
- package/dist/scripts/src/components/FormItem/FormItemNative.js +26 -16
- package/dist/scripts/src/components/FormItem/HelperText.js +3 -3
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +5 -6
- package/dist/scripts/src/components/FormItem/Validations.js +5 -5
- package/dist/scripts/src/components/FormSection/FormSection.js +2 -2
- package/dist/scripts/src/components/Heading/Heading.js +3 -3
- package/dist/scripts/src/components/Heading/HeadingNative.js +10 -11
- package/dist/scripts/src/components/HoverCard/HoverCard.js +3 -3
- package/dist/scripts/src/components/HoverCard/HovercardNative.js +1 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +1226 -19
- package/dist/scripts/src/components/Icon/Icon.js +3 -3
- package/dist/scripts/src/components/Icon/IconNative.js +3 -3
- package/dist/scripts/src/components/IconInfoCard/IconInfoCard.js +5 -4
- package/dist/scripts/src/components/IconProvider.js +49 -49
- package/dist/scripts/src/components/Image/Image.js +4 -4
- package/dist/scripts/src/components/Image/ImageNative.js +2 -2
- package/dist/scripts/src/components/Input/InputAdornment.js +3 -3
- package/dist/scripts/src/components/Items/Items.js +3 -3
- package/dist/scripts/src/components/Link/Link.js +6 -6
- package/dist/scripts/src/components/Link/LinkNative.js +29 -11
- package/dist/scripts/src/components/List/List.js +14 -16
- package/dist/scripts/src/components/List/ListNative.js +97 -218
- package/dist/scripts/src/components/Logo/Logo.js +2 -2
- package/dist/scripts/src/components/Logo/LogoNative.js +2 -2
- package/dist/scripts/src/components/Markdown/Markdown.js +3 -3
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +4 -4
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +5 -5
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +8 -8
- package/dist/scripts/src/components/NavGroup/NavGroup.js +6 -6
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +8 -8
- package/dist/scripts/src/components/NavLink/NavLink.js +5 -5
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +6 -6
- package/dist/scripts/src/components/NavPanel/NavPanel.js +5 -5
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +6 -6
- package/dist/scripts/src/components/NoResult/NoResult.js +4 -4
- package/dist/scripts/src/components/NoResult/NoResultNative.js +2 -2
- package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -4
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +7 -7
- package/dist/scripts/src/components/OffCanvas/OffCanvas.js +5 -5
- package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +2 -2
- package/dist/scripts/src/components/Option/Option.js +4 -4
- package/dist/scripts/src/components/PageHeader/PageHeader.js +2 -2
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +2 -2
- package/dist/scripts/src/components/Pages/Pages.js +3 -3
- package/dist/scripts/src/components/Pages/PagesNative.js +2 -2
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +3 -3
- package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +1 -1
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +3 -3
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +1 -1
- package/dist/scripts/src/components/Queue/Queue.js +3 -3
- package/dist/scripts/src/components/Queue/QueueNative.js +5 -5
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +4 -4
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +6 -6
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +2 -2
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +3 -3
- package/dist/scripts/src/components/Redirect/Redirect.js +2 -2
- package/dist/scripts/src/components/Select/Select.js +7 -7
- package/dist/scripts/src/components/Select/SelectNative.js +36 -37
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +2 -2
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +2 -2
- package/dist/scripts/src/components/Slider/Slider.js +39 -24
- package/dist/scripts/src/components/Slider/SliderNative.js +98 -3
- package/dist/scripts/src/components/SlotItem.js +2 -2
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +3 -3
- package/dist/scripts/src/components/Spinner/Spinner.js +3 -3
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +3 -4
- package/dist/scripts/src/components/Splitter/Splitter.js +6 -6
- package/dist/scripts/src/components/Splitter/SplitterNative.js +3 -3
- package/dist/scripts/src/components/Stack/Stack.js +6 -6
- package/dist/scripts/src/components/Stack/StackNative.js +3 -3
- package/dist/scripts/src/components/StickyBox/StickyBox.js +3 -3
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +1 -1
- package/dist/scripts/src/components/Switch/Switch.js +6 -6
- package/dist/scripts/src/components/Table/Table.js +9 -9
- package/dist/scripts/src/components/Table/TableNative.js +15 -15
- package/dist/scripts/src/components/Table/useRowSelection.js +4 -4
- package/dist/scripts/src/components/TableHeader/TableHeader.js +2 -2
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +3 -3
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +3 -3
- package/dist/scripts/src/components/Tabs/TabContext.js +1 -1
- package/dist/scripts/src/components/Tabs/TabItem.js +3 -3
- package/dist/scripts/src/components/Tabs/TabItemNative.js +2 -2
- package/dist/scripts/src/components/Tabs/Tabs.js +5 -5
- package/dist/scripts/src/components/Tabs/TabsNative.js +2 -2
- package/dist/scripts/src/components/Text/Text.js +4 -4
- package/dist/scripts/src/components/Text/TextNative.js +6 -7
- package/dist/scripts/src/components/TextArea/TextArea.js +4 -4
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +6 -6
- package/dist/scripts/src/components/TextBox/TextBox.js +4 -4
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +5 -5
- package/dist/scripts/src/components/Theme/Theme.js +2 -2
- package/dist/scripts/src/components/Theme/ThemeNative.js +7 -7
- package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +11 -11
- package/dist/scripts/src/components/ThemeChanger/ToneChangerButton.js +5 -5
- package/dist/scripts/src/components/Toggle/Toggle.js +4 -4
- package/dist/scripts/src/components/Toolbar/Toolbar.js +2 -2
- package/dist/scripts/src/components/ToolbarButton/ToolbarButton.js +2 -2
- package/dist/scripts/src/components/Tree/TreeComponent.js +4 -4
- package/dist/scripts/src/components/Tree/TreeNative.js +2 -2
- package/dist/scripts/src/components/TrendLabel/TrendLabel.js +2 -2
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +8 -8
- package/dist/scripts/src/components/abstractions.js +6 -2
- package/dist/scripts/src/components/container-helpers.js +2 -2
- package/dist/scripts/src/components-core/CompoundComponent.js +2 -2
- package/dist/scripts/src/components-core/Fragment.js +2 -2
- package/dist/scripts/src/components-core/InspectorContext.js +5 -5
- package/dist/scripts/src/components-core/LoaderComponent.js +3 -3
- package/dist/scripts/src/components-core/RestApiProxy.js +4 -4
- package/dist/scripts/src/components-core/Slot.js +2 -2
- package/dist/scripts/src/components-core/TableOfContentsContext.js +1 -1
- package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +2 -2
- package/dist/scripts/src/components-core/action/APICall.js +4 -4
- package/dist/scripts/src/components-core/action/FileDownloadAction.js +1 -1
- package/dist/scripts/src/components-core/action/FileUploadAction.js +3 -3
- package/dist/scripts/src/components-core/action/NavigateAction.js +1 -1
- package/dist/scripts/src/components-core/action/TimedAction.js +1 -1
- package/dist/scripts/src/components-core/component-hooks.js +2 -2
- package/dist/scripts/src/components-core/descriptorHelper.js +1 -0
- package/dist/scripts/src/components-core/loader/ApiLoader.js +5 -5
- package/dist/scripts/src/components-core/loader/DataLoader.js +18 -10
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +5 -5
- package/dist/scripts/src/components-core/loader/Loader.js +3 -3
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +5 -5
- package/dist/scripts/src/components-core/loader/PageableLoader.js +3 -3
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +21 -15
- package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +2 -2
- package/dist/scripts/src/components-core/rendering/Container.js +16 -16
- package/dist/scripts/src/components-core/rendering/ContainerWrapper.js +1 -1
- package/dist/scripts/src/components-core/rendering/InvalidComponent.js +1 -1
- package/dist/scripts/src/components-core/rendering/StateContainer.js +15 -15
- package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
- package/dist/scripts/src/components-core/rendering/renderChild.js +1 -1
- package/dist/scripts/src/components-core/rendering/valueExtractor.js +4 -4
- package/dist/scripts/src/components-core/script-runner/asyncProxy.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 +2 -2
- 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 +3 -3
- package/dist/scripts/src/components-core/script-runner/syncProxy.js +1 -1
- package/dist/scripts/src/components-core/script-runner/visitors.js +1 -1
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +10 -10
- package/dist/scripts/src/components-core/theming/extendThemeUtils.js +1 -1
- package/dist/scripts/src/components-core/theming/layout-resolver.js +356 -0
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +1 -1
- package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +9 -3
- package/dist/scripts/src/components-core/utils/actionUtils.js +3 -3
- package/dist/scripts/src/components-core/utils/compound-utils.js +1 -1
- package/dist/scripts/src/components-core/utils/css-utils.js +2 -2
- package/dist/scripts/src/components-core/utils/extractParam.js +3 -3
- package/dist/scripts/src/components-core/utils/hooks.js +3 -3
- package/dist/scripts/src/parsers/scripting/modules.js +1 -1
- package/dist/scripts/src/parsers/style-parser/style-compiler.js +6 -2
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +14 -15
- package/dist/scripts/src/syntax/grammar.tmLanguage.json +1 -1
- package/dist/scripts/src/syntax/textMate/xmlui.json +27 -93
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +4651 -3827
- package/dist/xmlui-metadata.umd.js +23 -18
- package/dist/xmlui-standalone.umd.js +194 -193
- package/dist/xmlui.d.ts +3 -2
- package/dist/xmlui.mjs +1 -1
- package/package.json +3 -3
- package/dist/scripts/package.json +0 -210
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +0 -116
- package/dist/scripts/src/components/ModalDialog/Dialog.js +0 -20
- package/dist/scripts/src/components/Range/Range.js +0 -56
- package/dist/scripts/src/components/Range/RangeNative.js +0 -8
- package/dist/scripts/src/components/RawHtml/RawHtml.js +0 -39
- package/dist/scripts/src/components/RawHtml/RawHtmlNative.js +0 -13
- package/dist/scripts/src/components-core/StandaloneApp.js +0 -589
- package/dist/scripts/src/components-core/abstractions/standalone.js +0 -2
- package/dist/scripts/src/components-core/appContext/date-functions.js +0 -19
- package/dist/scripts/src/components-core/appContext/math-function.js +0 -27
- package/dist/scripts/src/components-core/appContext/misc-utils.js +0 -13
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +0 -198
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +0 -94
- package/dist/scripts/src/components-core/interception/Backend.js +0 -129
- package/dist/scripts/src/components-core/interception/Errors.js +0 -129
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +0 -41
- package/dist/scripts/src/components-core/interception/IndexedDb.js +0 -205
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +0 -145
- package/dist/scripts/src/components-core/interception/abstractions.js +0 -2
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +0 -46
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +0 -9
- package/dist/scripts/src/components-core/markup-check.js +0 -279
- package/dist/scripts/src/components-core/rendering/AppContent.js +0 -339
- package/dist/scripts/src/components-core/rendering/AppRoot.js +0 -55
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +0 -44
- package/dist/scripts/src/components-core/utils/classnames.js +0 -58
- package/dist/scripts/src/components-core/utils/date-utils.js +0 -78
- package/dist/scripts/src/components-core/utils/request-params.js +0 -70
- package/dist/scripts/src/index.js +0 -66
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.THEME_VAR_PREFIX = void 0;
|
|
4
|
+
exports.resolveLayoutProps = resolveLayoutProps;
|
|
5
|
+
exports.toCssVar = toCssVar;
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const lodash_es_1 = require("lodash-es");
|
|
8
|
+
exports.THEME_VAR_PREFIX = "xmlui";
|
|
9
|
+
const themeVarCapturesRegex = /(\$[a-zA-Z][a-zA-Z0-9-_]*)/g;
|
|
10
|
+
const alignmentRegex = /^(start|end|center)$/;
|
|
11
|
+
const orientationRegex = /^(horizontal|vertical)$/;
|
|
12
|
+
const booleanRegex = /^(true|false)$/;
|
|
13
|
+
const starSizeRegex = /^\d*\*$/;
|
|
14
|
+
const defaultCompResult = {
|
|
15
|
+
cssProps: {},
|
|
16
|
+
nonCssProps: {},
|
|
17
|
+
issues: new Set(),
|
|
18
|
+
};
|
|
19
|
+
function resolveLayoutProps(layoutProps = constants_1.EMPTY_OBJECT, layoutContext) {
|
|
20
|
+
const result = {
|
|
21
|
+
cssProps: {},
|
|
22
|
+
nonCssProps: {},
|
|
23
|
+
issues: new Set(),
|
|
24
|
+
};
|
|
25
|
+
// --- Aligments & orientation
|
|
26
|
+
collectNonCss("horizontalAlignment");
|
|
27
|
+
collectNonCss("verticalAlignment");
|
|
28
|
+
collectNonCss("orientation");
|
|
29
|
+
// --- Adjust flex
|
|
30
|
+
if (!!getOrientation(layoutContext)) {
|
|
31
|
+
// --- In a container, we always use "flex-shrink: 0"
|
|
32
|
+
result.cssProps.flexShrink = 0;
|
|
33
|
+
}
|
|
34
|
+
// --- Dimensions
|
|
35
|
+
collectCss("width");
|
|
36
|
+
const horizontalStarSize = getHorizontalStartSize(result.cssProps.width, layoutContext);
|
|
37
|
+
if (horizontalStarSize !== null) {
|
|
38
|
+
// --- We use "flex" when width is in start-size and allow shrinking
|
|
39
|
+
result.cssProps.flex = horizontalStarSize;
|
|
40
|
+
result.cssProps.flexShrink = 1;
|
|
41
|
+
}
|
|
42
|
+
collectCss("minWidth");
|
|
43
|
+
collectCss("maxWidth");
|
|
44
|
+
collectCss("height");
|
|
45
|
+
const verticalStarSize = getVerticalStartSize(result.cssProps.height, layoutContext);
|
|
46
|
+
if (verticalStarSize !== null) {
|
|
47
|
+
// --- We use "flex" when width is in start-size and allow shrinking
|
|
48
|
+
result.cssProps.flex = verticalStarSize;
|
|
49
|
+
result.cssProps.flexShrink = 1;
|
|
50
|
+
}
|
|
51
|
+
collectCss("minHeight");
|
|
52
|
+
collectCss("maxHeight");
|
|
53
|
+
// --- Positions
|
|
54
|
+
collectCss("top");
|
|
55
|
+
collectCss("right");
|
|
56
|
+
collectCss("bottom");
|
|
57
|
+
collectCss("left");
|
|
58
|
+
// --- Paddings and gap
|
|
59
|
+
collectCss("gap");
|
|
60
|
+
collectCss("padding");
|
|
61
|
+
const horizontalPadding = transformLayoutValue("horizontalPadding");
|
|
62
|
+
if (horizontalPadding) {
|
|
63
|
+
result.cssProps.paddingLeft = horizontalPadding;
|
|
64
|
+
result.cssProps.paddingRight = horizontalPadding;
|
|
65
|
+
}
|
|
66
|
+
collectCss("paddingRight");
|
|
67
|
+
collectCss("paddingLeft");
|
|
68
|
+
const verticalPadding = transformLayoutValue("verticalPadding");
|
|
69
|
+
if (verticalPadding) {
|
|
70
|
+
result.cssProps.paddingTop = verticalPadding;
|
|
71
|
+
result.cssProps.paddingBottom = verticalPadding;
|
|
72
|
+
}
|
|
73
|
+
collectCss("paddingTop");
|
|
74
|
+
collectCss("paddingBottom");
|
|
75
|
+
// --- Margins
|
|
76
|
+
collectCss("margin");
|
|
77
|
+
const horizontalMargin = transformLayoutValue("horizontalMargin");
|
|
78
|
+
if (horizontalMargin) {
|
|
79
|
+
result.cssProps.marginLeft = horizontalMargin;
|
|
80
|
+
result.cssProps.marginRight = horizontalMargin;
|
|
81
|
+
}
|
|
82
|
+
collectCss("marginRight");
|
|
83
|
+
collectCss("marginLeft");
|
|
84
|
+
const verticalMargin = transformLayoutValue("verticalMargin");
|
|
85
|
+
if (verticalMargin) {
|
|
86
|
+
result.cssProps.marginTop = verticalMargin;
|
|
87
|
+
result.cssProps.marginBottom = verticalMargin;
|
|
88
|
+
}
|
|
89
|
+
collectCss("marginTop");
|
|
90
|
+
collectCss("marginBottom");
|
|
91
|
+
// --- Borders
|
|
92
|
+
collectCss("border");
|
|
93
|
+
collectCss("borderTop");
|
|
94
|
+
collectCss("borderRight");
|
|
95
|
+
collectCss("borderBottom");
|
|
96
|
+
collectCss("borderLeft");
|
|
97
|
+
collectCss("borderColor");
|
|
98
|
+
collectCss("borderStyle");
|
|
99
|
+
collectCss("borderThickness");
|
|
100
|
+
// --- Radius
|
|
101
|
+
collectCss("radius", "borderRadius");
|
|
102
|
+
collectCss("radiusTopLeft", "borderTopLeftRadius");
|
|
103
|
+
collectCss("radiusTopRight", "borderTopRightRadius");
|
|
104
|
+
collectCss("radiusBottomLeft", "borderBottomLeftRadius");
|
|
105
|
+
collectCss("radiusBottomRight", "borderBottomRightRadius");
|
|
106
|
+
// --- Typography
|
|
107
|
+
collectCss("color");
|
|
108
|
+
collectCss("fontFamily");
|
|
109
|
+
collectCss("fontSize");
|
|
110
|
+
collectCss("fontWeight");
|
|
111
|
+
collectCss("italic");
|
|
112
|
+
collectCss("textDecoration");
|
|
113
|
+
collectCss("userSelect");
|
|
114
|
+
collectCss("letterSpacing");
|
|
115
|
+
collectCss("textTransform");
|
|
116
|
+
collectCss("lineHeight");
|
|
117
|
+
collectCss("textAlign");
|
|
118
|
+
collectCss("textAlignLast");
|
|
119
|
+
collectCss("textWrap");
|
|
120
|
+
// --- Other
|
|
121
|
+
collectCss("backgroundColor");
|
|
122
|
+
collectCss("background");
|
|
123
|
+
collectCss("shadow", "boxShadow");
|
|
124
|
+
collectCss("direction");
|
|
125
|
+
collectCss("horizontalOverflow", "overflowX");
|
|
126
|
+
collectCss("verticalOverflow", "overflowY");
|
|
127
|
+
collectCss("zIndex");
|
|
128
|
+
collectCss("opacity");
|
|
129
|
+
collectCss("zoom");
|
|
130
|
+
collectCss("cursor");
|
|
131
|
+
collectCss("whiteSpace");
|
|
132
|
+
// --- Content rendering
|
|
133
|
+
const wrapContent = transformLayoutValue("wrapContent");
|
|
134
|
+
if (wrapContent) {
|
|
135
|
+
result.cssProps.flexWrap = wrapContent === "true" ? "wrap" : "nowrap";
|
|
136
|
+
}
|
|
137
|
+
collectCss("canShrink", "flexShrink");
|
|
138
|
+
const canShrink = transformLayoutValue("canShrink");
|
|
139
|
+
if (canShrink) {
|
|
140
|
+
result.cssProps.flexShrink = canShrink === "true" ? 1 : 0;
|
|
141
|
+
}
|
|
142
|
+
// --- If we didn't set any props, return a referentially stable result
|
|
143
|
+
if ((0, lodash_es_1.isEmpty)(result.cssProps) && (0, lodash_es_1.isEmpty)(result.nonCssProps) && (0, lodash_es_1.isEmpty)(result.issues)) {
|
|
144
|
+
return defaultCompResult;
|
|
145
|
+
}
|
|
146
|
+
// --- Done
|
|
147
|
+
return result;
|
|
148
|
+
// --- Replaces all variable occurrences in the input string with the result of toCssVar
|
|
149
|
+
function transformLayoutValue(prop) {
|
|
150
|
+
var _a, _b, _c, _d;
|
|
151
|
+
const defValue = resolveSingleValue();
|
|
152
|
+
if (((_a = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.mediaSize) === null || _a === void 0 ? void 0 : _a.sizeIndex) !== undefined) {
|
|
153
|
+
const sizeIndex = (_b = layoutContext.mediaSize) === null || _b === void 0 ? void 0 : _b.sizeIndex;
|
|
154
|
+
const xsValue = resolveSingleValue("xs");
|
|
155
|
+
const smValue = resolveSingleValue("sm");
|
|
156
|
+
const mdValue = resolveSingleValue("md");
|
|
157
|
+
const lgValue = resolveSingleValue("lg");
|
|
158
|
+
const xlValue = resolveSingleValue("xl");
|
|
159
|
+
const xxlValue = resolveSingleValue("xxl");
|
|
160
|
+
let mergedValue;
|
|
161
|
+
switch (sizeIndex) {
|
|
162
|
+
case 0: // xs
|
|
163
|
+
mergedValue = (_c = xsValue !== null && xsValue !== void 0 ? xsValue : smValue) !== null && _c !== void 0 ? _c : mdValue;
|
|
164
|
+
break;
|
|
165
|
+
case 1: // sm
|
|
166
|
+
mergedValue = smValue !== null && smValue !== void 0 ? smValue : mdValue;
|
|
167
|
+
break;
|
|
168
|
+
case 2: // md
|
|
169
|
+
mergedValue = mdValue;
|
|
170
|
+
break;
|
|
171
|
+
case 3: // lg
|
|
172
|
+
mergedValue = lgValue;
|
|
173
|
+
break;
|
|
174
|
+
case 4: // xl
|
|
175
|
+
mergedValue = xlValue !== null && xlValue !== void 0 ? xlValue : lgValue;
|
|
176
|
+
break;
|
|
177
|
+
case 5: // xxl
|
|
178
|
+
mergedValue = (_d = xxlValue !== null && xxlValue !== void 0 ? xxlValue : xlValue) !== null && _d !== void 0 ? _d : lgValue;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
return mergedValue !== null && mergedValue !== void 0 ? mergedValue : defValue;
|
|
182
|
+
}
|
|
183
|
+
return defValue;
|
|
184
|
+
function resolveSingleValue(sizeTag = "") {
|
|
185
|
+
if (prop === "shadow") {
|
|
186
|
+
let x = 1;
|
|
187
|
+
}
|
|
188
|
+
const fullProp = sizeTag ? `${prop}-${sizeTag}` : prop;
|
|
189
|
+
let singleInput = layoutProps[fullProp];
|
|
190
|
+
if (singleInput == undefined) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (typeof singleInput === "string") {
|
|
194
|
+
singleInput = singleInput.trim();
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
singleInput = singleInput.toString();
|
|
198
|
+
}
|
|
199
|
+
// --- Evaluate
|
|
200
|
+
const value = singleInput
|
|
201
|
+
? singleInput.replace(themeVarCapturesRegex, (match) => toCssVar(match.trim()))
|
|
202
|
+
: undefined;
|
|
203
|
+
if (singleInput !== value) {
|
|
204
|
+
// --- Theme variable replaced, do not check pattern validity
|
|
205
|
+
return value;
|
|
206
|
+
}
|
|
207
|
+
// --- Check value validity
|
|
208
|
+
const propPatterns = layoutPatterns[prop];
|
|
209
|
+
if (!propPatterns || propPatterns.length === 0) {
|
|
210
|
+
return value;
|
|
211
|
+
}
|
|
212
|
+
for (const pattern of propPatterns) {
|
|
213
|
+
if (pattern.test(value)) {
|
|
214
|
+
return value;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// --- Done
|
|
218
|
+
result.issues.add(fullProp);
|
|
219
|
+
return value;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function collectNonCss(prop) {
|
|
223
|
+
const value = transformLayoutValue(prop);
|
|
224
|
+
if (value) {
|
|
225
|
+
// --- Evaluate
|
|
226
|
+
result.nonCssProps[prop] = value;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function collectCss(prop, propCssName = "") {
|
|
230
|
+
const value = transformLayoutValue(prop);
|
|
231
|
+
if (value) {
|
|
232
|
+
result.cssProps[propCssName || prop] = value;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// --- Checks if the specified size is a star size and the orientation is horizontal
|
|
236
|
+
function getHorizontalStartSize(size, layoutContext) {
|
|
237
|
+
if (!size)
|
|
238
|
+
return null;
|
|
239
|
+
const orientation = getOrientation(layoutContext);
|
|
240
|
+
return orientation === "horizontal" && starSizeRegex.test(size.toString())
|
|
241
|
+
? getStarSizeNumber(size.toString())
|
|
242
|
+
: null;
|
|
243
|
+
}
|
|
244
|
+
// --- Checks if the specified size is a star size and the orientation is vertical
|
|
245
|
+
function getVerticalStartSize(size, layoutContext) {
|
|
246
|
+
if (!size)
|
|
247
|
+
return null;
|
|
248
|
+
const orientation = getOrientation(layoutContext);
|
|
249
|
+
return orientation === "vertical" && starSizeRegex.test(size.toString())
|
|
250
|
+
? getStarSizeNumber(size.toString())
|
|
251
|
+
: null;
|
|
252
|
+
}
|
|
253
|
+
// --- Obtains the integer number from a string that matches the starSizeRegex.
|
|
254
|
+
function getStarSizeNumber(input) {
|
|
255
|
+
if (starSizeRegex.test(input)) {
|
|
256
|
+
const numberPart = input.slice(0, -1); // Remove the trailing '*'
|
|
257
|
+
return numberPart === "" ? 1 : parseInt(numberPart, 10); // Default to 1 if no number is present
|
|
258
|
+
}
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
// --- Gets the current orientation from the layout context
|
|
262
|
+
function getOrientation(layoutContext) {
|
|
263
|
+
if (!layoutContext)
|
|
264
|
+
return;
|
|
265
|
+
let orientation = (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.type) === "Stack" && (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.orientation);
|
|
266
|
+
return orientation === null || orientation === void 0 ? void 0 : orientation.toString();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Converts the specified themeID to a CSS var string
|
|
271
|
+
* @param c segment to convert
|
|
272
|
+
*/
|
|
273
|
+
function toCssVar(c) {
|
|
274
|
+
return `var(--${exports.THEME_VAR_PREFIX}-${c.substring(1)})`;
|
|
275
|
+
}
|
|
276
|
+
// The properties constituting a component's layout
|
|
277
|
+
const layoutPatterns = {
|
|
278
|
+
// --- Context-dependent/non-CSS props
|
|
279
|
+
horizontalAlignment: [alignmentRegex],
|
|
280
|
+
verticalAlignment: [alignmentRegex],
|
|
281
|
+
orientation: [orientationRegex],
|
|
282
|
+
// --- Dimensions
|
|
283
|
+
width: [],
|
|
284
|
+
minWidth: [],
|
|
285
|
+
maxWidth: [],
|
|
286
|
+
height: [],
|
|
287
|
+
minHeight: [],
|
|
288
|
+
maxHeight: [],
|
|
289
|
+
gap: [],
|
|
290
|
+
// --- Positions
|
|
291
|
+
top: [],
|
|
292
|
+
right: [],
|
|
293
|
+
bottom: [],
|
|
294
|
+
left: [],
|
|
295
|
+
// --- Border
|
|
296
|
+
border: [],
|
|
297
|
+
borderTop: [],
|
|
298
|
+
borderRight: [],
|
|
299
|
+
borderBottom: [],
|
|
300
|
+
borderLeft: [],
|
|
301
|
+
borderColor: [],
|
|
302
|
+
borderStyle: [],
|
|
303
|
+
borderThickness: [],
|
|
304
|
+
// --- Border radius
|
|
305
|
+
radius: [],
|
|
306
|
+
radiusTopLeft: [],
|
|
307
|
+
radiusTopRight: [],
|
|
308
|
+
radiusBottomLeft: [],
|
|
309
|
+
radiusBottomRight: [],
|
|
310
|
+
// --- Padding
|
|
311
|
+
padding: [],
|
|
312
|
+
horizontalPadding: [],
|
|
313
|
+
verticalPadding: [],
|
|
314
|
+
paddingTop: [],
|
|
315
|
+
paddingRight: [],
|
|
316
|
+
paddingBottom: [],
|
|
317
|
+
paddingLeft: [],
|
|
318
|
+
// --- Margin
|
|
319
|
+
margin: [],
|
|
320
|
+
horizontalMargin: [],
|
|
321
|
+
verticalMargin: [],
|
|
322
|
+
marginTop: [],
|
|
323
|
+
marginRight: [],
|
|
324
|
+
marginBottom: [],
|
|
325
|
+
marginLeft: [],
|
|
326
|
+
// --- Other
|
|
327
|
+
backgroundColor: [],
|
|
328
|
+
background: [],
|
|
329
|
+
shadow: [],
|
|
330
|
+
direction: [],
|
|
331
|
+
horizontalOverflow: [],
|
|
332
|
+
verticalOverflow: [],
|
|
333
|
+
zIndex: [],
|
|
334
|
+
opacity: [],
|
|
335
|
+
// --- Typography
|
|
336
|
+
color: [],
|
|
337
|
+
fontFamily: [],
|
|
338
|
+
fontSize: [],
|
|
339
|
+
fontWeight: [],
|
|
340
|
+
italic: [booleanRegex],
|
|
341
|
+
textDecoration: [],
|
|
342
|
+
userSelect: [],
|
|
343
|
+
letterSpacing: [],
|
|
344
|
+
textTransform: [],
|
|
345
|
+
lineHeight: [],
|
|
346
|
+
textAlign: [],
|
|
347
|
+
textWrap: [],
|
|
348
|
+
textAlignLast: [],
|
|
349
|
+
// --- Content rendering
|
|
350
|
+
wrapContent: [],
|
|
351
|
+
canShrink: [],
|
|
352
|
+
// --- Other
|
|
353
|
+
cursor: [],
|
|
354
|
+
zoom: [],
|
|
355
|
+
whiteSpace: [],
|
|
356
|
+
};
|
|
@@ -10,7 +10,7 @@ exports.generateBaseSpacings = generateBaseSpacings;
|
|
|
10
10
|
exports.generateBaseFontSizes = generateBaseFontSizes;
|
|
11
11
|
exports.generateButtonTones = generateButtonTones;
|
|
12
12
|
const color_1 = __importDefault(require("color"));
|
|
13
|
-
const hvar_1 = require("
|
|
13
|
+
const hvar_1 = require("../theming/hvar");
|
|
14
14
|
function isThemeVarName(varName) {
|
|
15
15
|
return typeof varName === 'string' && (varName === null || varName === void 0 ? void 0 : varName.startsWith("$"));
|
|
16
16
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DataLoaderQueryKeyGenerator = void 0;
|
|
4
4
|
const lodash_es_1 = require("lodash-es");
|
|
5
5
|
class DataLoaderQueryKeyGenerator {
|
|
6
|
-
constructor(url, queryParams, apiUrl) {
|
|
6
|
+
constructor(url, queryParams, apiUrl, body, rawBody) {
|
|
7
7
|
this.url = url;
|
|
8
8
|
this.queryParams = queryParams;
|
|
9
9
|
this.key = [url];
|
|
@@ -13,6 +13,12 @@ class DataLoaderQueryKeyGenerator {
|
|
|
13
13
|
if (apiUrl) {
|
|
14
14
|
this.key.push(apiUrl);
|
|
15
15
|
}
|
|
16
|
+
if (body) {
|
|
17
|
+
this.key.push(body);
|
|
18
|
+
}
|
|
19
|
+
if (rawBody) {
|
|
20
|
+
this.key.push(rawBody);
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
asKey() {
|
|
18
24
|
if (!this.key) {
|
|
@@ -27,8 +33,8 @@ class DataLoaderQueryKeyGenerator {
|
|
|
27
33
|
return {
|
|
28
34
|
predicate: (query) => {
|
|
29
35
|
const queryKey = query.queryKey;
|
|
30
|
-
return queryKey[0] === this.url && (!this.queryParams || (0, lodash_es_1.isEqual)(queryKey[1], this.queryParams));
|
|
31
|
-
}
|
|
36
|
+
return (queryKey[0] === this.url && (!this.queryParams || (0, lodash_es_1.isEqual)(queryKey[1], this.queryParams)));
|
|
37
|
+
},
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
}
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.invalidateQueries = invalidateQueries;
|
|
13
|
-
const DataLoaderQueryKeyGenerator_1 = require("
|
|
14
|
-
const extractParam_1 = require("
|
|
13
|
+
const DataLoaderQueryKeyGenerator_1 = require("../utils/DataLoaderQueryKeyGenerator");
|
|
14
|
+
const extractParam_1 = require("../utils/extractParam");
|
|
15
15
|
function invalidateQueries(invalidates, appContext, state) {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
var _a;
|
|
@@ -22,7 +22,7 @@ function invalidateQueries(invalidates, appContext, state) {
|
|
|
22
22
|
}
|
|
23
23
|
arrayToInvalidate.forEach((invalidate) => {
|
|
24
24
|
var _a;
|
|
25
|
-
(_a = appContext.queryClient) === null || _a === void 0 ? void 0 : _a.invalidateQueries(new DataLoaderQueryKeyGenerator_1.DataLoaderQueryKeyGenerator((0, extractParam_1.extractParam)(state, invalidate, appContext), undefined, appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals.apiUrl).asPredicate());
|
|
25
|
+
(_a = appContext.queryClient) === null || _a === void 0 ? void 0 : _a.invalidateQueries(new DataLoaderQueryKeyGenerator_1.DataLoaderQueryKeyGenerator((0, extractParam_1.extractParam)(state, invalidate, appContext), undefined, appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals.apiUrl, undefined, undefined).asPredicate());
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.compoundComponentDefFromSource = compoundComponentDefFromSource;
|
|
4
|
-
const xmlui_parser_1 = require("
|
|
4
|
+
const xmlui_parser_1 = require("../xmlui-parser");
|
|
5
5
|
function compoundComponentDefFromSource(name, componentSource) {
|
|
6
6
|
const compoundComponentDef = (0, xmlui_parser_1.xmlUiMarkupToComponent)(componentSource).component;
|
|
7
7
|
if (!compoundComponentDef) {
|
|
@@ -13,8 +13,8 @@ exports.getMaxLinesStyle = getMaxLinesStyle;
|
|
|
13
13
|
exports.getSizeString = getSizeString;
|
|
14
14
|
const react_1 = require("react");
|
|
15
15
|
const color_1 = __importDefault(require("color"));
|
|
16
|
-
const themeVars_1 = require("
|
|
17
|
-
const constants_1 = require("
|
|
16
|
+
const themeVars_1 = require("../theming/themeVars");
|
|
17
|
+
const constants_1 = require("../constants");
|
|
18
18
|
/**
|
|
19
19
|
* Converts a string to its kebab-case representation
|
|
20
20
|
* @param str Input string
|
|
@@ -8,9 +8,9 @@ exports.withStableObjectReference = withStableObjectReference;
|
|
|
8
8
|
exports.shouldKeep = shouldKeep;
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
10
|
const lodash_es_1 = require("lodash-es");
|
|
11
|
-
const ParameterParser_1 = require("
|
|
12
|
-
const eval_tree_sync_1 = require("
|
|
13
|
-
const LruCache_1 = require("
|
|
11
|
+
const ParameterParser_1 = require("../script-runner/ParameterParser");
|
|
12
|
+
const eval_tree_sync_1 = require("../script-runner/eval-tree-sync");
|
|
13
|
+
const LruCache_1 = require("../utils/LruCache");
|
|
14
14
|
/**
|
|
15
15
|
* Extract the value of the specified parameter from the given view container state
|
|
16
16
|
* @param state The state of the view container
|
|
@@ -49,9 +49,9 @@ exports.useColors = useColors;
|
|
|
49
49
|
exports.useReferenceTrackedApi = useReferenceTrackedApi;
|
|
50
50
|
const react_1 = __importStar(require("react"));
|
|
51
51
|
const lodash_es_1 = require("lodash-es");
|
|
52
|
-
const misc_1 = require("
|
|
53
|
-
const ThemeContext_1 = require("
|
|
54
|
-
const constants_1 = require("
|
|
52
|
+
const misc_1 = require("../utils/misc");
|
|
53
|
+
const ThemeContext_1 = require("../theming/ThemeContext");
|
|
54
|
+
const constants_1 = require("../constants");
|
|
55
55
|
const color_1 = __importDefault(require("color"));
|
|
56
56
|
/**
|
|
57
57
|
* This hook invokes a callback when the size of the specified DOM element changes.
|
|
@@ -4,10 +4,10 @@ exports.isModuleErrors = isModuleErrors;
|
|
|
4
4
|
exports.parseScriptModule = parseScriptModule;
|
|
5
5
|
exports.obtainClosures = obtainClosures;
|
|
6
6
|
exports.visitLetConstDeclarations = visitLetConstDeclarations;
|
|
7
|
-
const Parser_1 = require("./Parser");
|
|
8
7
|
const Token_1 = require("../../abstractions/scripting/Token");
|
|
9
8
|
const tree_visitor_1 = require("./tree-visitor");
|
|
10
9
|
const ParserError_1 = require("./ParserError");
|
|
10
|
+
const Parser_1 = require("./Parser");
|
|
11
11
|
/**
|
|
12
12
|
* Checks if the result is a module error
|
|
13
13
|
* @param result Result to check
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.compileLayout = compileLayout;
|
|
4
4
|
const lodash_es_1 = require("lodash-es");
|
|
5
|
-
const constants_1 = require("
|
|
5
|
+
const constants_1 = require("../../components-core/constants");
|
|
6
6
|
const StyleParser_1 = require("./StyleParser");
|
|
7
7
|
const defaultCompResult = {
|
|
8
8
|
cssProps: {},
|
|
@@ -10,7 +10,7 @@ const defaultCompResult = {
|
|
|
10
10
|
};
|
|
11
11
|
// Compile style properties into an object that can be directly used as the "style" attribute of elements
|
|
12
12
|
function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layoutContext) {
|
|
13
|
-
var _a, _b, _c, _d, _e;
|
|
13
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14
14
|
const result = {
|
|
15
15
|
cssProps: {},
|
|
16
16
|
nonCssProps: {},
|
|
@@ -224,6 +224,10 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
|
|
|
224
224
|
const textWrap = (_e = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.textWrap) === null || _e === void 0 ? void 0 : _e.toString();
|
|
225
225
|
if (textWrap)
|
|
226
226
|
css.textWrap = textWrap;
|
|
227
|
+
const whiteSpace = (_f = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.whiteSpace) === null || _f === void 0 ? void 0 : _f.toString();
|
|
228
|
+
if (whiteSpace) {
|
|
229
|
+
css.whiteSpace = whiteSpace;
|
|
230
|
+
}
|
|
227
231
|
// --- Compile content rendering
|
|
228
232
|
const wrapContent = compileWrapContent("wrapContent", layoutProps);
|
|
229
233
|
if (wrapContent)
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onPrefixRegex = exports.UCRegex = exports.COMPOUND_COMP_ID = void 0;
|
|
4
4
|
exports.nodeToComponentDef = nodeToComponentDef;
|
|
5
|
+
const code_behind_collect_1 = require("../scripting/code-behind-collect");
|
|
5
6
|
const syntax_kind_1 = require("./syntax-kind");
|
|
6
7
|
const ParserError_1 = require("./ParserError");
|
|
7
8
|
const Parser_1 = require("../scripting/Parser");
|
|
8
|
-
const code_behind_collect_1 = require("../scripting/code-behind-collect");
|
|
9
9
|
const CharacterCodes_1 = require("./CharacterCodes");
|
|
10
10
|
exports.COMPOUND_COMP_ID = "Component";
|
|
11
11
|
exports.UCRegex = /^[A-Z]/;
|
|
@@ -18,17 +18,16 @@ const APP_NS_KEY = "app-ns";
|
|
|
18
18
|
const APP_NS_VALUE = "#app-ns";
|
|
19
19
|
const CORE_NS_KEY = "core-ns";
|
|
20
20
|
const CORE_NS_VALUE = "#xmlui-core-ns";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})(HelperNode || (HelperNode = {}));
|
|
21
|
+
const HelperNode = {
|
|
22
|
+
property: 'property',
|
|
23
|
+
event: 'event',
|
|
24
|
+
variable: 'variable',
|
|
25
|
+
loaders: 'loaders',
|
|
26
|
+
uses: 'uses',
|
|
27
|
+
method: 'method',
|
|
28
|
+
item: 'item',
|
|
29
|
+
field: 'field'
|
|
30
|
+
};
|
|
32
31
|
function nodeToComponentDef(node, originalGetText, fileId, moduleResolver = () => "") {
|
|
33
32
|
const getText = (node) => {
|
|
34
33
|
var _a;
|
|
@@ -96,7 +95,7 @@ function nodeToComponentDef(node, originalGetText, fileId, moduleResolver = () =
|
|
|
96
95
|
api[attr.name] = attr.value;
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
|
-
// --- Get
|
|
98
|
+
// --- Get var attributes
|
|
100
99
|
let vars;
|
|
101
100
|
const varsAttrs = attrs.filter((attr) => attr.startSegment === "var");
|
|
102
101
|
if (varsAttrs.length > 0) {
|
|
@@ -116,7 +115,7 @@ function nodeToComponentDef(node, originalGetText, fileId, moduleResolver = () =
|
|
|
116
115
|
for (let child of children) {
|
|
117
116
|
if (child.kind === syntax_kind_1.SyntaxKind.ElementNode) {
|
|
118
117
|
const childName = getComponentName(child, getText);
|
|
119
|
-
if (childName ===
|
|
118
|
+
if (childName === HelperNode.variable) {
|
|
120
119
|
nestedVars.push(child);
|
|
121
120
|
}
|
|
122
121
|
else if (childName in HelperNode) {
|
|
@@ -257,7 +256,7 @@ function nodeToComponentDef(node, originalGetText, fileId, moduleResolver = () =
|
|
|
257
256
|
}
|
|
258
257
|
});
|
|
259
258
|
return;
|
|
260
|
-
case
|
|
259
|
+
case HelperNode.variable:
|
|
261
260
|
collectElementHelper(usesStack, comp, child, (name) => { var _a; return (isComponent(comp) ? (_a = comp.vars) === null || _a === void 0 ? void 0 : _a[name] : undefined); }, (name, value) => {
|
|
262
261
|
var _a;
|
|
263
262
|
if (!isComponent(comp))
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
]
|
|
232
232
|
},
|
|
233
233
|
"propOrVarTag": {
|
|
234
|
-
"begin": "(</?)([a-zA-Z_][\\w\\.\\-]*?:)?((?:
|
|
234
|
+
"begin": "(</?)([a-zA-Z_][\\w\\.\\-]*?:)?((?:variable)|(?:property)|(?:prop))",
|
|
235
235
|
"beginCaptures": {
|
|
236
236
|
"1": { "name": "punctuation.definition.tag.xmlui" },
|
|
237
237
|
"2": { "name": "keyword.operator.namespace.xmlui" },
|