xmlui 0.7.13 → 0.7.15
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-BuZoKCP8.mjs → apiInterceptorWorker-yKpXImCG.mjs} +1 -1
- package/dist/{index-C8kHu1Bs.mjs → index-XNGGyvQ0.mjs} +9904 -9653
- package/dist/index.css +1 -1
- package/dist/scripts/bin/build.js +17 -7
- package/dist/scripts/bin/vite-ueml-plugin.js +17 -7
- package/dist/scripts/bin/viteConfig.js +17 -7
- package/dist/scripts/package.json +209 -0
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +51 -0
- package/dist/scripts/src/components/APICall/APICall.js +74 -0
- package/dist/scripts/src/components/APICall/APICallNative.js +31 -0
- package/dist/scripts/src/components/Accordion/Accordion.js +78 -0
- package/dist/scripts/src/components/Accordion/AccordionContext.js +20 -0
- package/dist/scripts/src/components/Accordion/AccordionItem.js +28 -0
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +79 -0
- package/dist/scripts/src/components/Accordion/AccordionNative.js +122 -0
- package/dist/scripts/src/components/Alert/Alert.js +42 -0
- package/dist/scripts/src/components/Alert/AlertNative.js +8 -0
- package/dist/scripts/src/components/Animation/Animation.js +59 -0
- package/dist/scripts/src/components/Animation/AnimationNative.js +75 -0
- package/dist/scripts/src/components/App/App.js +76 -0
- package/dist/scripts/src/components/App/AppLayoutContext.js +49 -0
- package/dist/scripts/src/components/App/AppNative.js +204 -0
- package/dist/scripts/src/components/App/AppStateContext.js +9 -0
- package/dist/scripts/src/components/App/Sheet.js +99 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.js +59 -0
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +58 -0
- package/dist/scripts/src/components/AppState/AppState.js +26 -0
- package/dist/scripts/src/components/AppState/AppStateNative.js +24 -0
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +83 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +16 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +225 -0
- package/dist/scripts/src/components/Avatar/Avatar.js +47 -0
- package/dist/scripts/src/components/Avatar/AvatarNative.js +40 -0
- package/dist/scripts/src/components/Backdrop/Backdrop.js +31 -0
- package/dist/scripts/src/components/Backdrop/BackdropNative.js +14 -0
- package/dist/scripts/src/components/Badge/Badge.js +58 -0
- package/dist/scripts/src/components/Badge/BadgeNative.js +22 -0
- package/dist/scripts/src/components/BarChart/BarChart.js +49 -0
- package/dist/scripts/src/components/BarChart/BarChartNative.js +176 -0
- package/dist/scripts/src/components/Bookmark/Bookmark.js +23 -0
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +24 -0
- package/dist/scripts/src/components/Breakout/Breakout.js +16 -0
- package/dist/scripts/src/components/Breakout/BreakoutNative.js +12 -0
- package/dist/scripts/src/components/Button/Button.js +142 -0
- package/dist/scripts/src/components/Button/ButtonNative.js +88 -0
- package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +41 -0
- package/dist/scripts/src/components/ButtonGroup/ButtonGroupNative.js +8 -0
- package/dist/scripts/src/components/Card/Card.js +57 -0
- package/dist/scripts/src/components/Card/CardNative.js +26 -0
- package/dist/scripts/src/components/Carousel/Carousel.js +68 -0
- package/dist/scripts/src/components/Carousel/CarouselItem.js +16 -0
- package/dist/scripts/src/components/Carousel/CarouselItemNative.js +13 -0
- package/dist/scripts/src/components/Carousel/CarouselNative.js +163 -0
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +24 -0
- package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +26 -0
- package/dist/scripts/src/components/Chart/Chart.js +24 -0
- package/dist/scripts/src/components/Chart/ChartNative.js +165 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.js +68 -0
- package/dist/scripts/src/components/Column/Column.js +34 -0
- package/dist/scripts/src/components/Column/ColumnNative.js +38 -0
- package/dist/scripts/src/components/Column/TableContext.js +12 -0
- package/dist/scripts/src/components/ComponentProvider.js +503 -0
- package/dist/scripts/src/components/ComponentRegistryContext.js +44 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +38 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +16 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.js +62 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +196 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +125 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +95 -0
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +26 -0
- package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +52 -0
- package/dist/scripts/src/components/FileInput/FileInput.js +64 -0
- package/dist/scripts/src/components/FileInput/FileInputNative.js +128 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +46 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +112 -0
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +53 -0
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +108 -0
- package/dist/scripts/src/components/Footer/Footer.js +35 -0
- package/dist/scripts/src/components/Footer/FooterNative.js +20 -0
- package/dist/scripts/src/components/Form/Form.js +89 -0
- package/dist/scripts/src/components/Form/FormContext.js +9 -0
- package/dist/scripts/src/components/Form/FormNative.js +317 -0
- package/dist/scripts/src/components/Form/formActions.js +114 -0
- package/dist/scripts/src/components/FormItem/FormItem.js +125 -0
- package/dist/scripts/src/components/FormItem/FormItemNative.js +157 -0
- package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +40 -0
- package/dist/scripts/src/components/FormItem/Validations.js +351 -0
- package/dist/scripts/src/components/FormSection/FormSection.js +41 -0
- package/dist/scripts/src/components/Heading/Heading.js +258 -0
- package/dist/scripts/src/components/Heading/HeadingNative.js +45 -0
- package/dist/scripts/src/components/HoverCard/HoverCard.js +19 -0
- package/dist/scripts/src/components/HoverCard/HovercardNative.js +44 -0
- package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
- package/dist/scripts/src/components/Icon/Attach.js +10 -0
- package/dist/scripts/src/components/Icon/Binding.js +11 -0
- package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
- package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
- package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
- package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
- package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
- package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.js +32 -0
- package/dist/scripts/src/components/Icon/IconNative.js +102 -0
- package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
- package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
- package/dist/scripts/src/components/Icon/NoSortIcon.js +8 -0
- package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
- package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
- package/dist/scripts/src/components/Icon/SortAscendingIcon.js +8 -0
- package/dist/scripts/src/components/Icon/SortDescendingIcon.js +8 -0
- package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
- package/dist/scripts/src/components/Icon/TrendingDownIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrendingLevelIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrendingUpIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
- package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
- package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
- package/dist/scripts/src/components/IconInfoCard/IconInfoCard.js +39 -0
- package/dist/scripts/src/components/IconProvider.js +264 -0
- package/dist/scripts/src/components/IconRegistryContext.js +317 -0
- package/dist/scripts/src/components/Image/Image.js +35 -0
- package/dist/scripts/src/components/Image/ImageNative.js +15 -0
- package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
- package/dist/scripts/src/components/Items/Items.js +33 -0
- package/dist/scripts/src/components/Items/ItemsNative.js +29 -0
- package/dist/scripts/src/components/Link/Link.js +64 -0
- package/dist/scripts/src/components/Link/LinkNative.js +26 -0
- package/dist/scripts/src/components/List/List.js +81 -0
- package/dist/scripts/src/components/List/ListNative.js +425 -0
- package/dist/scripts/src/components/Logo/Logo.js +16 -0
- package/dist/scripts/src/components/Logo/LogoNative.js +15 -0
- package/dist/scripts/src/components/Map/Map.js +75 -0
- package/dist/scripts/src/components/Map/world_countries.json +45307 -0
- package/dist/scripts/src/components/Markdown/Markdown.js +45 -0
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +107 -0
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
- package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +64 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +167 -0
- package/dist/scripts/src/components/ModalDialog/ModalVisibilityContext.js +60 -0
- package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +91 -0
- package/dist/scripts/src/components/NavLink/NavLink.js +71 -0
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +61 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.js +31 -0
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +74 -0
- package/dist/scripts/src/components/NoResult/NoResult.js +38 -0
- package/dist/scripts/src/components/NoResult/NoResultNative.js +13 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.js +61 -0
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +337 -0
- package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +74 -0
- package/dist/scripts/src/components/OffCanvas/OffCanvas.js +57 -0
- package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +48 -0
- package/dist/scripts/src/components/Option/Option.js +33 -0
- package/dist/scripts/src/components/Option/OptionTypeProvider.js +16 -0
- package/dist/scripts/src/components/PageHeader/PageHeader.js +36 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +9 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +18 -0
- package/dist/scripts/src/components/Pages/Pages.js +33 -0
- package/dist/scripts/src/components/Pages/PagesNative.js +69 -0
- package/dist/scripts/src/components/PieChart/PieChart.js +45 -0
- package/dist/scripts/src/components/PieChart/PieChartNative.js +165 -0
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +24 -0
- package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +14 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +36 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +12 -0
- package/dist/scripts/src/components/Queue/Queue.js +71 -0
- package/dist/scripts/src/components/Queue/QueueNative.js +278 -0
- package/dist/scripts/src/components/Queue/queueActions.js +87 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +68 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +104 -0
- package/dist/scripts/src/components/Range/Range.js +56 -0
- package/dist/scripts/src/components/Range/RangeNative.js +8 -0
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +21 -0
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +131 -0
- package/dist/scripts/src/components/Redirect/Redirect.js +20 -0
- package/dist/scripts/src/components/Select/OptionContext.js +12 -0
- package/dist/scripts/src/components/Select/Select.js +98 -0
- package/dist/scripts/src/components/Select/SelectContext.js +9 -0
- package/dist/scripts/src/components/Select/SelectNative.js +214 -0
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +22 -0
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +94 -0
- package/dist/scripts/src/components/Slider/Slider.js +54 -0
- package/dist/scripts/src/components/Slider/SliderNative.js +8 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +19 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFillerNative.js +10 -0
- package/dist/scripts/src/components/Spinner/Spinner.js +42 -0
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +31 -0
- package/dist/scripts/src/components/Splitter/Splitter.js +89 -0
- package/dist/scripts/src/components/Splitter/SplitterNative.js +159 -0
- package/dist/scripts/src/components/Splitter/utils.js +17 -0
- package/dist/scripts/src/components/Stack/Stack.js +110 -0
- package/dist/scripts/src/components/Stack/StackNative.js +39 -0
- package/dist/scripts/src/components/StateViewer/StateViewerNative.js +19 -0
- package/dist/scripts/src/components/StickyBox/StickyBox.js +30 -0
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +15 -0
- package/dist/scripts/src/components/Switch/Switch.js +72 -0
- package/dist/scripts/src/components/Table/Table.js +184 -0
- package/dist/scripts/src/components/Table/TableNative.js +470 -0
- package/dist/scripts/src/components/Table/useRowSelection.js +245 -0
- package/dist/scripts/src/components/TableHeader/TableHeader.js +34 -0
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +74 -0
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +55 -0
- package/dist/scripts/src/components/Tabs/TabContext.js +45 -0
- package/dist/scripts/src/components/Tabs/TabItem.js +20 -0
- package/dist/scripts/src/components/Tabs/TabItemNative.js +24 -0
- package/dist/scripts/src/components/Tabs/Tabs.js +55 -0
- package/dist/scripts/src/components/Tabs/TabsNative.js +72 -0
- package/dist/scripts/src/components/Text/Text.js +122 -0
- package/dist/scripts/src/components/Text/TextNative.js +124 -0
- package/dist/scripts/src/components/TextArea/TextArea.js +65 -0
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +176 -0
- package/dist/scripts/src/components/TextArea/TextAreaResizable.js +73 -0
- package/dist/scripts/src/components/TextArea/useComposedRef.js +60 -0
- package/dist/scripts/src/components/TextBox/TextBox.js +85 -0
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +109 -0
- package/dist/scripts/src/components/Theme/NotificationToast.js +50 -0
- package/dist/scripts/src/components/Theme/Theme.js +43 -0
- package/dist/scripts/src/components/Theme/ThemeNative.js +126 -0
- package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +115 -0
- package/dist/scripts/src/components/ThemeChanger/ToneChangerButton.js +28 -0
- package/dist/scripts/src/components/Toggle/Toggle.js +99 -0
- package/dist/scripts/src/components/Toolbar/Toolbar.js +32 -0
- package/dist/scripts/src/components/ToolbarButton/ToolbarButton.js +38 -0
- package/dist/scripts/src/components/Tree/TreeComponent.js +32 -0
- package/dist/scripts/src/components/Tree/TreeNative.js +69 -0
- package/dist/scripts/src/components/TrendLabel/TrendLabel.js +37 -0
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
- package/dist/scripts/src/components/abstractions.js +151 -0
- package/dist/scripts/src/components/chart-color-schemes.js +43 -0
- package/dist/scripts/src/components/component-utils.js +17 -0
- package/dist/scripts/src/components/container-helpers.js +25 -0
- package/dist/scripts/src/components/metadata-helpers.js +245 -0
- package/dist/scripts/src/components/slot-helpers.js +22 -0
- package/dist/scripts/src/components-core/ApiBoundComponent.js +194 -0
- package/dist/scripts/src/components-core/AppContext.js +16 -0
- package/dist/scripts/src/components-core/AppRoot.js +424 -0
- package/dist/scripts/src/components-core/ComponentBed.js +325 -0
- package/dist/scripts/src/components-core/ComponentDecorator.js +90 -0
- package/dist/scripts/src/components-core/CompoundComponent.js +144 -0
- package/dist/scripts/src/components-core/DebugViewProvider.js +43 -0
- package/dist/scripts/src/components-core/EngineError.js +91 -0
- package/dist/scripts/src/components-core/ErrorBoundary.js +59 -0
- package/dist/scripts/src/components-core/Fragment.js +15 -0
- package/dist/scripts/src/components-core/InspectorContext.js +176 -0
- package/dist/scripts/src/components-core/InvalidComponent.js +17 -0
- package/dist/scripts/src/components-core/LoaderComponent.js +92 -0
- package/dist/scripts/src/components-core/RestApiProxy.js +354 -0
- package/dist/scripts/src/components-core/ScrollContext.js +11 -0
- package/dist/scripts/src/components-core/Slot.js +17 -0
- package/dist/scripts/src/components-core/StandaloneApp.js +589 -0
- package/dist/scripts/src/components-core/StandaloneComponentManager.js +51 -0
- package/dist/scripts/src/components-core/TableOfContentsContext.js +110 -0
- package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
- package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +110 -0
- package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
- package/dist/scripts/src/components-core/abstractions/standalone.js +2 -0
- package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
- package/dist/scripts/src/components-core/action/APICall.js +283 -0
- package/dist/scripts/src/components-core/action/FileDownloadAction.js +80 -0
- package/dist/scripts/src/components-core/action/FileUploadAction.js +88 -0
- package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
- package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
- package/dist/scripts/src/components-core/action/actions.js +15 -0
- package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
- package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
- package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
- package/dist/scripts/src/components-core/component-hooks.js +25 -0
- package/dist/scripts/src/components-core/constants.js +18 -0
- package/dist/scripts/src/components-core/container/Container.js +1241 -0
- package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
- package/dist/scripts/src/components-core/container/collectFnVarDeps.js +49 -0
- package/dist/scripts/src/components-core/container/valueExtractor.js +205 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +72 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +198 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
- package/dist/scripts/src/components-core/interception/Backend.js +129 -0
- package/dist/scripts/src/components-core/interception/Errors.js +129 -0
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
- package/dist/scripts/src/components-core/interception/IndexedDb.js +205 -0
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
- package/dist/scripts/src/components-core/loader/ApiLoader.js +54 -0
- package/dist/scripts/src/components-core/loader/DataLoader.js +149 -0
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +62 -0
- package/dist/scripts/src/components-core/loader/Loader.js +126 -0
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +40 -0
- package/dist/scripts/src/components-core/loader/PageableLoader.js +262 -0
- package/dist/scripts/src/components-core/markup-check.js +279 -0
- package/dist/scripts/src/components-core/renderers.js +45 -0
- package/dist/scripts/src/components-core/reportEngineError.js +62 -0
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
- package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +149 -0
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
- package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
- package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +593 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +497 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +482 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +766 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +752 -0
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
- package/dist/scripts/src/components-core/script-runner/syncProxy.js +31 -0
- package/dist/scripts/src/components-core/script-runner/visitors.js +361 -0
- package/dist/scripts/src/components-core/theming/ThemeContext.js +53 -0
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +335 -0
- package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
- package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
- package/dist/scripts/src/components-core/theming/hvar.js +105 -0
- package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
- package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
- package/dist/scripts/src/components-core/theming/themes/palette.js +55 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +287 -0
- package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +561 -0
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +58 -0
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +300 -0
- package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +35 -0
- package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
- package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
- package/dist/scripts/src/components-core/utils/classnames.js +58 -0
- package/dist/scripts/src/components-core/utils/compound-utils.js +11 -0
- package/dist/scripts/src/components-core/utils/css-utils.js +163 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
- package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
- package/dist/scripts/src/components-core/utils/hooks.js +249 -0
- package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
- package/dist/scripts/src/components-core/utils/misc.js +472 -0
- package/dist/scripts/src/components-core/utils/request-params.js +70 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +221 -0
- package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
- package/dist/scripts/src/index.js +69 -0
- package/dist/scripts/src/parsers/common/GenericToken.js +2 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenType.js +112 -0
- package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +623 -0
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +1036 -0
- package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
- package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
- package/dist/scripts/src/parsers/style-parser/style-compiler.js +558 -0
- package/dist/scripts/src/parsers/style-parser/tokens.js +43 -0
- package/dist/scripts/src/parsers/xmlui-parser/ParserError.js +7 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +80 -32
- package/dist/scripts/src/syntax/grammar.tmLanguage.json +328 -0
- package/dist/scripts/src/syntax/textMate/xmlui.json +630 -0
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +2676 -2608
- package/dist/xmlui-metadata.umd.js +16 -16
- package/dist/xmlui-standalone.umd.js +186 -186
- package/dist/xmlui.d.ts +1868 -13
- package/dist/xmlui.mjs +1 -1
- package/package.json +5 -5
- package/dist/xmlui.umd.js +0 -293
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Toggle = void 0;
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
43
|
+
const Toggle_module_scss_1 = __importDefault(require("./Toggle.module.scss"));
|
|
44
|
+
const constants_1 = require("@components-core/constants");
|
|
45
|
+
const ItemWithLabel_1 = require("@components/FormItem/ItemWithLabel");
|
|
46
|
+
const misc_1 = require("@components-core/utils/misc");
|
|
47
|
+
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
48
|
+
exports.Toggle = (0, react_1.forwardRef)(function Toggle({ id, initialValue = false, value = false, enabled = true, style, readOnly, validationStatus = "none", updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, variant = "checkbox", indeterminate = false, className, label, labelPosition = "start", labelWidth, labelBreak, required, registerComponentApi }, forwardedRef) {
|
|
49
|
+
const innerRef = react_1.default.useRef(null);
|
|
50
|
+
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(innerRef, forwardedRef) : innerRef;
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
|
+
updateState({ value: initialValue }, { initial: true });
|
|
53
|
+
}, [initialValue, updateState]);
|
|
54
|
+
const updateValue = (0, react_1.useCallback)((value) => {
|
|
55
|
+
var _a;
|
|
56
|
+
if (((_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.checked) === value)
|
|
57
|
+
return;
|
|
58
|
+
updateState({ value });
|
|
59
|
+
onDidChange(value);
|
|
60
|
+
}, [onDidChange, updateState]);
|
|
61
|
+
const onInputChange = (0, react_1.useCallback)((event) => {
|
|
62
|
+
if (readOnly) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
updateState({ value: event.target.checked });
|
|
66
|
+
onDidChange(event.target.checked);
|
|
67
|
+
}, [onDidChange, readOnly, updateState]);
|
|
68
|
+
const handleOnFocus = (0, react_1.useCallback)(() => {
|
|
69
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
70
|
+
}, [onFocus]);
|
|
71
|
+
const handleOnBlur = (0, react_1.useCallback)(() => {
|
|
72
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
73
|
+
}, [onBlur]);
|
|
74
|
+
(0, react_1.useEffect)(() => {
|
|
75
|
+
if (typeof indeterminate === "boolean" && innerRef.current) {
|
|
76
|
+
innerRef.current.indeterminate = indeterminate;
|
|
77
|
+
}
|
|
78
|
+
}, [indeterminate]);
|
|
79
|
+
const focus = (0, react_1.useCallback)(() => {
|
|
80
|
+
var _a;
|
|
81
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
82
|
+
}, []);
|
|
83
|
+
const setValue = (0, misc_1.useEvent)((newValue) => {
|
|
84
|
+
updateValue(newValue);
|
|
85
|
+
});
|
|
86
|
+
(0, react_1.useEffect)(() => {
|
|
87
|
+
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
88
|
+
focus,
|
|
89
|
+
setValue
|
|
90
|
+
});
|
|
91
|
+
}, [focus, registerComponentApi, setValue]);
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { id: id, label: label, style: style, labelPosition: labelPosition, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, shrinkToLabel: true, labelStyle: { pointerEvents: readOnly ? "none" : undefined }, children: (0, jsx_runtime_1.jsx)("input", { ref: ref, type: "checkbox", role: variant, checked: value, disabled: !enabled, readOnly: readOnly, "aria-readonly": readOnly, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, className: (0, classnames_1.default)(Toggle_module_scss_1.default.resetAppearance, className, {
|
|
93
|
+
[Toggle_module_scss_1.default.checkbox]: variant === "checkbox",
|
|
94
|
+
[Toggle_module_scss_1.default.switch]: variant === "switch",
|
|
95
|
+
[Toggle_module_scss_1.default.error]: validationStatus === "error",
|
|
96
|
+
[Toggle_module_scss_1.default.warning]: validationStatus === "warning",
|
|
97
|
+
[Toggle_module_scss_1.default.valid]: validationStatus === "valid",
|
|
98
|
+
}), "aria-checked": value }) }));
|
|
99
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toolbarRenderer = exports.ToolbarMd = void 0;
|
|
4
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
5
|
+
const compound_utils_1 = require("@components-core/utils/compound-utils");
|
|
6
|
+
// --- We cannot use this with nextra
|
|
7
|
+
// import componentSource from "./Toolbar.xmlui?raw";
|
|
8
|
+
const COMP = "Toolbar";
|
|
9
|
+
exports.ToolbarMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
+
status: "experimental",
|
|
11
|
+
description: "This component is a container for a toolbar.",
|
|
12
|
+
props: {
|
|
13
|
+
alignment: (0, ComponentDefs_1.d)("The alignment of the toolbar."),
|
|
14
|
+
},
|
|
15
|
+
defaultThemeVars: {
|
|
16
|
+
"gap-Toolbar": "$space-2",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const componentSource = `
|
|
20
|
+
<Component name="Toolbar">
|
|
21
|
+
<HStack
|
|
22
|
+
gap="$gap-Toolbar"
|
|
23
|
+
verticalAlignment="center"
|
|
24
|
+
horizontalAlignment="{$props.alignment ?? 'end' }">
|
|
25
|
+
<Slot />
|
|
26
|
+
</HStack>
|
|
27
|
+
</Component>
|
|
28
|
+
`;
|
|
29
|
+
exports.toolbarRenderer = {
|
|
30
|
+
compoundComponentDef: (0, compound_utils_1.compoundComponentDefFromSource)(COMP, componentSource),
|
|
31
|
+
metadata: exports.ToolbarMd,
|
|
32
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toolbarButtonRenderer = exports.ToolbarButtonMd = void 0;
|
|
4
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
5
|
+
const compound_utils_1 = require("@components-core/utils/compound-utils");
|
|
6
|
+
// --- We cannot use this with nextra
|
|
7
|
+
// import componentSource from "./ToolbarButton.xmlui?raw";
|
|
8
|
+
const COMP = "ToolbarButton";
|
|
9
|
+
exports.ToolbarButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
+
status: "experimental",
|
|
11
|
+
description: "This component is a button that is used in a toolbar.",
|
|
12
|
+
props: {
|
|
13
|
+
label: (0, ComponentDefs_1.d)("The label to display on the button."),
|
|
14
|
+
icon: (0, ComponentDefs_1.d)("The icon to display on the button."),
|
|
15
|
+
},
|
|
16
|
+
defaultThemeVars: {
|
|
17
|
+
"padding-horizontal-ToolbarButton": "$space-1",
|
|
18
|
+
"padding-vertical-ToolbarButton": "$space-1",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const componentSource = `
|
|
22
|
+
<Component name="ToolbarButton">
|
|
23
|
+
<Button
|
|
24
|
+
variant="ghost"
|
|
25
|
+
themeColor="secondary"
|
|
26
|
+
horizontalPadding="$padding-horizontal-ToolbarButton"
|
|
27
|
+
verticalPadding="$padding-vertical-ToolbarButton"
|
|
28
|
+
icon="{$props.icon}"
|
|
29
|
+
label="{$props.label}"
|
|
30
|
+
onClick="e => emitEvent('click', e)">
|
|
31
|
+
<Slot />
|
|
32
|
+
</Button>
|
|
33
|
+
</Component>
|
|
34
|
+
`;
|
|
35
|
+
exports.toolbarButtonRenderer = {
|
|
36
|
+
compoundComponentDef: (0, compound_utils_1.compoundComponentDefFromSource)(COMP, componentSource),
|
|
37
|
+
metadata: exports.ToolbarButtonMd,
|
|
38
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.treeComponentRenderer = exports.TreeMd = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const container_helpers_1 = require("@components/container-helpers");
|
|
6
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
7
|
+
const renderers_1 = require("@components-core/renderers");
|
|
8
|
+
const TreeNative_1 = require("./TreeNative");
|
|
9
|
+
const metadata_helpers_1 = require("@components/metadata-helpers");
|
|
10
|
+
const COMP = "Tree";
|
|
11
|
+
exports.TreeMd = (0, ComponentDefs_1.createMetadata)({
|
|
12
|
+
status: "in progress",
|
|
13
|
+
description: `The \`${COMP}\` component is a virtualized tree component that displays hierarchical data.`,
|
|
14
|
+
props: {
|
|
15
|
+
data: {
|
|
16
|
+
description: `The data source of the tree.`,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
selectedUid: {
|
|
20
|
+
description: `The ID (optional) of the selected tree row.`,
|
|
21
|
+
},
|
|
22
|
+
itemTemplate: (0, metadata_helpers_1.dComponent)("The template for each item in the tree."),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* This function defines the renderer for the Tree component.
|
|
27
|
+
*/
|
|
28
|
+
exports.treeComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TreeMd, ({ node, extractValue, renderChild }) => {
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(TreeNative_1.TreeComponent, { data: extractValue(node.props.data), selectedUid: extractValue(node.props.selectedUid), itemRenderer: (item) => {
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.itemTemplate, item: item, renderChild: renderChild }));
|
|
31
|
+
} }));
|
|
32
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TreeComponent = TreeComponent;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const react_window_1 = require("react-window");
|
|
10
|
+
const react_virtualized_auto_sizer_1 = __importDefault(require("react-virtualized-auto-sizer"));
|
|
11
|
+
const TreeComponent_module_scss_1 = __importDefault(require("./TreeComponent.module.scss"));
|
|
12
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
13
|
+
const treeUtils_1 = require("@components-core/utils/treeUtils");
|
|
14
|
+
const TreeRow = (0, react_1.memo)(function TreeRow({ index, style, data }) {
|
|
15
|
+
const { nodes, toggleNode, selectedUid, itemRenderer } = data;
|
|
16
|
+
const treeItem = nodes[index];
|
|
17
|
+
const onToggleNode = (0, react_1.useCallback)((event) => {
|
|
18
|
+
if (event.defaultPrevented) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
toggleNode(treeItem);
|
|
22
|
+
}, [toggleNode, treeItem]);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: Object.assign(Object.assign({}, style), { width: "auto", minWidth: "100%", display: "flex" }), children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(TreeComponent_module_scss_1.default.rowWrapper, {
|
|
24
|
+
[TreeComponent_module_scss_1.default.selected]: selectedUid === treeItem.key,
|
|
25
|
+
}), children: [(0, jsx_runtime_1.jsxs)("div", { onClick: onToggleNode, className: TreeComponent_module_scss_1.default.gutter, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: treeItem.depth * 10 }, className: TreeComponent_module_scss_1.default.depthPlaceholder }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(TreeComponent_module_scss_1.default.toggleWrapper, {
|
|
26
|
+
[TreeComponent_module_scss_1.default.expanded]: treeItem.isExpanded,
|
|
27
|
+
[TreeComponent_module_scss_1.default.hidden]: !treeItem.hasChildren,
|
|
28
|
+
}) })] }), (0, jsx_runtime_1.jsx)("div", { className: TreeComponent_module_scss_1.default.labelWrapper, onClick: treeItem.selectable ? undefined : onToggleNode, style: { cursor: treeItem.selectable ? undefined : "pointer" }, children: itemRenderer(treeItem) })] }) }));
|
|
29
|
+
});
|
|
30
|
+
const emptyTreeData = {
|
|
31
|
+
treeData: [],
|
|
32
|
+
treeItemsById: {},
|
|
33
|
+
};
|
|
34
|
+
function TreeComponent({ data = emptyTreeData, selectedUid, itemRenderer, }) {
|
|
35
|
+
const { treeData, treeItemsById } = data;
|
|
36
|
+
const [expandedIds, setExpandedIds] = (0, react_1.useState)([]);
|
|
37
|
+
const flatTreeData = (0, react_1.useMemo)(() => (0, treeUtils_1.toFlatTree)(treeData, expandedIds), [expandedIds, treeData]);
|
|
38
|
+
/**
|
|
39
|
+
* ensure the selected item's parents are expanded on route change
|
|
40
|
+
*/
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
if (selectedUid) {
|
|
43
|
+
const treeItem = treeItemsById[selectedUid];
|
|
44
|
+
if (treeItem) {
|
|
45
|
+
setExpandedIds((prev) => [...prev, ...treeItem.parentIds]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, [selectedUid, treeItemsById]);
|
|
49
|
+
const toggleNode = (0, react_1.useCallback)((node) => {
|
|
50
|
+
if (!node.isExpanded) {
|
|
51
|
+
setExpandedIds((prev) => [...prev, node.key]);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
setExpandedIds((prev) => prev.filter((id) => id !== node.key));
|
|
55
|
+
}
|
|
56
|
+
}, []);
|
|
57
|
+
const itemData = (0, react_1.useMemo)(() => {
|
|
58
|
+
return {
|
|
59
|
+
nodes: flatTreeData,
|
|
60
|
+
toggleNode,
|
|
61
|
+
selectedUid,
|
|
62
|
+
itemRenderer,
|
|
63
|
+
};
|
|
64
|
+
}, [flatTreeData, toggleNode, selectedUid, itemRenderer]);
|
|
65
|
+
const getItemKey = (0, react_1.useCallback)((index, data) => {
|
|
66
|
+
return data.nodes[index].key;
|
|
67
|
+
}, []);
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: TreeComponent_module_scss_1.default.wrapper, children: (0, jsx_runtime_1.jsx)(react_virtualized_auto_sizer_1.default, { children: ({ width, height }) => ((0, jsx_runtime_1.jsx)(react_window_1.FixedSizeList, { height: height, itemCount: itemData.nodes.length, itemData: itemData, itemSize: 35, itemKey: getItemKey, width: width, children: TreeRow })) }) }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.trendLabelRenderer = exports.TrendLabelMd = void 0;
|
|
4
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
5
|
+
const compound_utils_1 = require("@components-core/utils/compound-utils");
|
|
6
|
+
// --- We cannot use this with nextra
|
|
7
|
+
//import componentSource from "./TrendLabel.xmlui?raw";
|
|
8
|
+
const COMP = "TrendLabel";
|
|
9
|
+
exports.TrendLabelMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
+
status: "experimental",
|
|
11
|
+
description: "This component displays a trend label.",
|
|
12
|
+
props: {
|
|
13
|
+
change: (0, ComponentDefs_1.d)("The change percentage."),
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const componentSource = `
|
|
17
|
+
<Component name="TrendLabel">
|
|
18
|
+
<Fragment>
|
|
19
|
+
<Text when="{$props.change > 0}" marginLeft="$space-tight" color="$color-valid">
|
|
20
|
+
{Math.floor($props.change * 100)}%
|
|
21
|
+
<Icon name="trending-up" />
|
|
22
|
+
</Text>
|
|
23
|
+
<Text when="{$props.change === 0}" marginLeft="$space-tight" color="$color-warning">
|
|
24
|
+
{Math.floor($props.change * 100)}%
|
|
25
|
+
<Icon name="trending-level" />
|
|
26
|
+
</Text>
|
|
27
|
+
<Text when="{$props.change < 0}" marginLeft="$space-tight" color="$color-error">
|
|
28
|
+
{Math.floor($props.change * 100)}%
|
|
29
|
+
<Icon name="trending-down" />
|
|
30
|
+
</Text>
|
|
31
|
+
</Fragment>
|
|
32
|
+
</Component>
|
|
33
|
+
`;
|
|
34
|
+
exports.trendLabelRenderer = {
|
|
35
|
+
compoundComponentDef: (0, compound_utils_1.compoundComponentDefFromSource)(COMP, componentSource),
|
|
36
|
+
metadata: exports.TrendLabelMd,
|
|
37
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ValidationSummary = ValidationSummary;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const StackNative_1 = require("@components/Stack/StackNative");
|
|
10
|
+
const IconNative_1 = require("@components/Icon/IconNative");
|
|
11
|
+
const TextNative_1 = require("@components/Text/TextNative");
|
|
12
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
13
|
+
const ValidationSummary_module_scss_1 = __importDefault(require("./ValidationSummary.module.scss"));
|
|
14
|
+
const SpaceFillerNative_1 = require("@components/SpaceFiller/SpaceFillerNative");
|
|
15
|
+
const ButtonNative_1 = require("@components/Button/ButtonNative");
|
|
16
|
+
const constants_1 = require("@components-core/constants");
|
|
17
|
+
const react_2 = require("@formkit/auto-animate/react");
|
|
18
|
+
function ValidationSummary({ fieldValidationResults = constants_1.EMPTY_OBJECT, generalValidationResults = constants_1.EMPTY_ARRAY, }) {
|
|
19
|
+
const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
|
|
20
|
+
const groupedInvalidResults = (0, react_1.useMemo)(() => {
|
|
21
|
+
const ret = {};
|
|
22
|
+
Object.entries(fieldValidationResults).forEach(([field, validationResult]) => {
|
|
23
|
+
validationResult.validations.forEach((singleValidationResult) => {
|
|
24
|
+
if (!singleValidationResult.isValid) {
|
|
25
|
+
ret[singleValidationResult.severity] = ret[singleValidationResult.severity] || [];
|
|
26
|
+
ret[singleValidationResult.severity].push({
|
|
27
|
+
field,
|
|
28
|
+
message: singleValidationResult.invalidMessage || "",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
generalValidationResults.forEach((singleValidationResult) => {
|
|
34
|
+
ret[singleValidationResult.severity] = ret[singleValidationResult.severity] || [];
|
|
35
|
+
ret[singleValidationResult.severity].push({
|
|
36
|
+
message: singleValidationResult.invalidMessage || "",
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return ret;
|
|
40
|
+
}, [fieldValidationResults, generalValidationResults]);
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: animateContainerRef, className: ValidationSummary_module_scss_1.default.summaryContainer, children: [(0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.warning, severity: "warning", heading: "Validation warnings" }), (0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.error, severity: "error", heading: "Validation errors" })] }));
|
|
42
|
+
}
|
|
43
|
+
const ValidationDisplay = ({ heading, issues = constants_1.EMPTY_ARRAY, severity = "error", onClose }) => {
|
|
44
|
+
const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
|
|
45
|
+
if (issues.length === 0) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(ValidationSummary_module_scss_1.default.validationContainer, {
|
|
49
|
+
[ValidationSummary_module_scss_1.default.valid]: severity === "valid",
|
|
50
|
+
[ValidationSummary_module_scss_1.default.info]: severity === "info",
|
|
51
|
+
[ValidationSummary_module_scss_1.default.warning]: severity === "warning",
|
|
52
|
+
[ValidationSummary_module_scss_1.default.error]: severity === "error",
|
|
53
|
+
}), style: { paddingTop: !onClose ? "0.5rem" : undefined }, children: [(0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", verticalAlignment: "center", layout: { gap: "0.5rem" }, children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { className: ValidationSummary_module_scss_1.default.heading, name: severity, size: "md" }), (0, jsx_runtime_1.jsx)("div", { className: ValidationSummary_module_scss_1.default.heading, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { children: heading }) }), !!onClose && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SpaceFillerNative_1.SpaceFiller, {}), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: onClose, variant: "ghost", themeColor: "secondary", icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "close", size: "sm" }), orientation: "vertical" })] }))] }), (0, jsx_runtime_1.jsx)("ul", { ref: animateContainerRef, children: issues.map((issue, i) => ((0, jsx_runtime_1.jsx)(ValidationEntry, { issue: issue }, i))) })] }));
|
|
54
|
+
};
|
|
55
|
+
// --- ValidationEntry
|
|
56
|
+
const ValidationEntry = ({ issue }) => {
|
|
57
|
+
const { field, message } = issue;
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("span", { style: { display: "inline-flex", gap: field ? "0.25rem" : undefined }, children: [field && (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "small", fontWeight: "bold", children: `${field}:` }), (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "small", preserveLinebreaks: true, children: message })] }) }));
|
|
59
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionNames = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.defaultButtonType = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.sizeNames = exports.sizeMd = exports.viewportSizeNames = exports.viewportSizeMd = exports.LinkTargetMd = exports.LinkTargetNames = void 0;
|
|
4
|
+
exports.LinkTargetNames = ["_self", "_blank", "_parent", "_top"];
|
|
5
|
+
exports.LinkTargetMd = [
|
|
6
|
+
{
|
|
7
|
+
value: "_self",
|
|
8
|
+
description: "The link will open in the same frame as it was clicked.",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
value: "_blank",
|
|
12
|
+
description: "The link will open in a new window or tab.",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: "_parent",
|
|
16
|
+
description: "The link will open in the parent frame. If no parent, behaves as _self.",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "_top",
|
|
20
|
+
description: "The topmost browsing context. The link will open in the full body of the window. If no ancestors, behaves as _self.",
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
// --- Available view sizes
|
|
24
|
+
exports.viewportSizeMd = [
|
|
25
|
+
{
|
|
26
|
+
value: "xs",
|
|
27
|
+
description: "Extra small devices (e.g., a small smartphone with low screen resolution)",
|
|
28
|
+
},
|
|
29
|
+
{ value: "sm", description: "Small devices (e.g., a smartphone in landscape view)" },
|
|
30
|
+
{ value: "md", description: "Medium devices (e.g., a tablet)" },
|
|
31
|
+
{ value: "lg", description: "Large devices (e.g., a laptop)" },
|
|
32
|
+
{ value: "xl", description: 'Extra large devices (e.g., a standard 20" monitor)' },
|
|
33
|
+
{ value: "xxl", description: 'Extra extra large devices (e.g., a large 29" monitor)' },
|
|
34
|
+
];
|
|
35
|
+
exports.viewportSizeNames = Object.keys(exports.viewportSizeMd);
|
|
36
|
+
// --- Available button sizes
|
|
37
|
+
exports.sizeMd = [
|
|
38
|
+
{ value: "xs", description: "Extra small button" },
|
|
39
|
+
{ value: "sm", description: "Small button" },
|
|
40
|
+
{ value: "md", description: "Medium button" },
|
|
41
|
+
{ value: "lg", description: "Large button" },
|
|
42
|
+
];
|
|
43
|
+
const sizeValues = Object.keys(exports.sizeMd);
|
|
44
|
+
exports.sizeNames = [...sizeValues];
|
|
45
|
+
// --- Available button themes
|
|
46
|
+
const buttonThemeValues = ["attention", "primary", "secondary"];
|
|
47
|
+
exports.buttonThemeNames = [...buttonThemeValues];
|
|
48
|
+
exports.buttonThemeMd = [
|
|
49
|
+
{ value: "attention", description: "Attention state theme color" },
|
|
50
|
+
{ value: "primary", description: "Primary theme color" },
|
|
51
|
+
{ value: "secondary", description: "Secondary theme color" },
|
|
52
|
+
];
|
|
53
|
+
// --- Available button types
|
|
54
|
+
exports.buttonTypeValues = ["button", "submit", "reset"];
|
|
55
|
+
exports.buttonTypeNames = [...exports.buttonTypeValues];
|
|
56
|
+
exports.buttonTypesMd = [
|
|
57
|
+
{ value: "button", description: "Regular behavior that only executes logic if explicitly determined." },
|
|
58
|
+
{ value: "submit", description: "The button submits the form data to the server. This is the default for buttons in a Form or NativeForm component." },
|
|
59
|
+
{ value: "reset", description: "Resets all the controls to their initial values. Using it is ill advised for UX reasons." },
|
|
60
|
+
];
|
|
61
|
+
exports.defaultButtonType = "button";
|
|
62
|
+
// --- Available button variants
|
|
63
|
+
const buttonVariantValues = ["solid", "outlined", "ghost"];
|
|
64
|
+
exports.buttonVariantNames = [...buttonVariantValues];
|
|
65
|
+
exports.buttonVariantMd = [
|
|
66
|
+
{ value: "solid", description: "A button with a border and a filled background." },
|
|
67
|
+
{ value: "outlined", description: "The button is displayed with a border and a transparent background." },
|
|
68
|
+
{ value: "ghost", description: "A button with no border and fill. Only the label is visible; the background is colored when hovered or clicked." },
|
|
69
|
+
];
|
|
70
|
+
// --- Available button aria attributes
|
|
71
|
+
const buttonAriaValues = ["aria-controls", "aria-expanded", "aria-disabled", "aria-label"];
|
|
72
|
+
exports.buttonAriaNames = [...buttonAriaValues];
|
|
73
|
+
// --- Available alignment options
|
|
74
|
+
exports.alignmentOptionValues = ["start", "center", "end"];
|
|
75
|
+
exports.alignmentOptionNames = [...exports.alignmentOptionValues];
|
|
76
|
+
exports.alignmentOptionMd = [
|
|
77
|
+
{ value: "center", description: "Place the content in the middle" },
|
|
78
|
+
{ value: "start", description: "Justify the content to the left (to the right if in right-to-left)" },
|
|
79
|
+
{ value: "end", description: "Justify the content to the right (to the left if in right-to-left)" },
|
|
80
|
+
];
|
|
81
|
+
// --- Available orientation options
|
|
82
|
+
const orientationOptionValues = ["horizontal", "vertical"];
|
|
83
|
+
exports.orientationOptionNames = [...orientationOptionValues];
|
|
84
|
+
exports.orientationOptionMd = [
|
|
85
|
+
{ value: "horizontal", description: "The component will fill the available space horizontally" },
|
|
86
|
+
{ value: "vertical", description: "The component will fill the available space vertically" },
|
|
87
|
+
];
|
|
88
|
+
// --- Available icon positions
|
|
89
|
+
exports.iconPositionValues = ["start", "end"];
|
|
90
|
+
exports.iconPositionNames = [...exports.iconPositionValues];
|
|
91
|
+
exports.iconPositionMd = [
|
|
92
|
+
{ value: "start", description: "The icon will appear at the start (left side when the left-to-right direction is set)" },
|
|
93
|
+
{ value: "end", description: "The icon will appear at the end (right side when the left-to-right direction is set)" },
|
|
94
|
+
];
|
|
95
|
+
// --- Available status colors
|
|
96
|
+
const statusColorValues = [
|
|
97
|
+
"primary",
|
|
98
|
+
"secondary",
|
|
99
|
+
"success",
|
|
100
|
+
"danger",
|
|
101
|
+
"warning",
|
|
102
|
+
"info",
|
|
103
|
+
"light",
|
|
104
|
+
"dark",
|
|
105
|
+
];
|
|
106
|
+
exports.statusColorNames = [...statusColorValues];
|
|
107
|
+
exports.statusColorMd = [
|
|
108
|
+
{ value: "primary", description: "Primary theme color, no default icon" },
|
|
109
|
+
{ value: "secondary", description: "Secondary theme color, no default icon" },
|
|
110
|
+
{ value: "success", description: "Success theme color, \"success\" icon" },
|
|
111
|
+
{ value: "danger", description: "Warning theme color, \"warning\" icon" },
|
|
112
|
+
{ value: "warning", description: "Danger theme color, \"danger\" icon" },
|
|
113
|
+
{ value: "info", description: "Info theme color, \"info\" icon" },
|
|
114
|
+
{ value: "light", description: "Light theme color, no default icon" },
|
|
115
|
+
{ value: "dark", description: "Dark theme color, no default icon" },
|
|
116
|
+
];
|
|
117
|
+
// --- Available placements
|
|
118
|
+
const placementValues = ["start", "end", "top", "bottom"];
|
|
119
|
+
exports.placementNames = [...placementValues];
|
|
120
|
+
exports.placementMd = [
|
|
121
|
+
{ value: "start", description: "The left side of the window (left-to-right) or the right side of the window (right-to-left)" },
|
|
122
|
+
{ value: "end", description: "The right side of the window (left-to-right) or the left side of the window (right-to-left)" },
|
|
123
|
+
{ value: "top", description: "The top of the window" },
|
|
124
|
+
{ value: "bottom", description: "The bottom of the window" },
|
|
125
|
+
];
|
|
126
|
+
// --- Available label positions
|
|
127
|
+
exports.labelPositionValues = ["top", "start", "end", "bottom"];
|
|
128
|
+
exports.labelPositionNames = [...exports.labelPositionValues];
|
|
129
|
+
exports.labelPositionMd = [
|
|
130
|
+
{ value: "start", description: "The left side of the input (left-to-right) or the right side of the input (right-to-left)" },
|
|
131
|
+
{ value: "end", description: "The right side of the input (left-to-right) or the left side of the input (right-to-left)" },
|
|
132
|
+
{ value: "top", description: "The top of the input" },
|
|
133
|
+
{ value: "bottom", description: "The bottom of the input" },
|
|
134
|
+
];
|
|
135
|
+
// --- Available trigger positions
|
|
136
|
+
const triggerPositionValues = ["start", "end"];
|
|
137
|
+
exports.triggerPositionNames = [...triggerPositionValues];
|
|
138
|
+
// --- The state of a validated UI element
|
|
139
|
+
exports.validationStatusValues = ["none", "error", "warning", "valid"];
|
|
140
|
+
exports.validationStatusNames = [...exports.validationStatusValues];
|
|
141
|
+
exports.validationStatusMd = [
|
|
142
|
+
// { value: "none", description: "No indicator" },
|
|
143
|
+
{ value: "valid", description: "Visual indicator for an input that is accepted" },
|
|
144
|
+
{ value: "warning", description: "Visual indicator for an input that produced a warning" },
|
|
145
|
+
{ value: "error", description: "Visual indicator for an input that produced an error" },
|
|
146
|
+
];
|
|
147
|
+
// --- scroll anchoring
|
|
148
|
+
exports.scrollAnchoringValues = ["top", "bottom"];
|
|
149
|
+
exports.scrollAnchoringNames = [...exports.scrollAnchoringValues];
|
|
150
|
+
// --- ordering
|
|
151
|
+
exports.orderingValues = ["asc", "desc"];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const colorSchemes = {
|
|
4
|
+
"set3": "set3",
|
|
5
|
+
"tableau10": "tableau10",
|
|
6
|
+
"brown_blueGreen": "brown_blueGreen",
|
|
7
|
+
"purpleRed_green": "purpleRed_green",
|
|
8
|
+
"pink_yellowGreen": "pink_yellowGreen",
|
|
9
|
+
"purple_orange": "purple_orange",
|
|
10
|
+
"red_blue": "red_blue",
|
|
11
|
+
"red_grey": "red_grey",
|
|
12
|
+
"red_yellow_blue": "red_yellow_blue",
|
|
13
|
+
"red_yellow_green": "red_yellow_green",
|
|
14
|
+
"spectral": "spectral",
|
|
15
|
+
"blues": "blues",
|
|
16
|
+
"greens": "greens",
|
|
17
|
+
"greys": "greys",
|
|
18
|
+
"oranges": "oranges",
|
|
19
|
+
"purples": "purples",
|
|
20
|
+
"reds": "reds",
|
|
21
|
+
"blue_green": "blue_green",
|
|
22
|
+
"blue_purple": "blue_purple",
|
|
23
|
+
"green_blue": "green_blue",
|
|
24
|
+
"orange_red": "orange_red",
|
|
25
|
+
"purple_blue_green": "purple_blue_green",
|
|
26
|
+
"purple_blue": "purple_blue",
|
|
27
|
+
"purple_red": "purple_red",
|
|
28
|
+
"red_purple": "red_purple",
|
|
29
|
+
"yellow_green_blue": "yellow_green_blue",
|
|
30
|
+
"yellow_green": "yellow_green",
|
|
31
|
+
"yellow_orange_brown": "yellow_orange_brown",
|
|
32
|
+
"yellow_orange_red": "yellow_orange_red",
|
|
33
|
+
"nivo": "nivo",
|
|
34
|
+
"category10": "category10",
|
|
35
|
+
"accent": "accent",
|
|
36
|
+
"dark2": "dark2",
|
|
37
|
+
"paired": "paired",
|
|
38
|
+
"pastel1": "pastel1",
|
|
39
|
+
"pastel2": "pastel2",
|
|
40
|
+
"set1": "set1",
|
|
41
|
+
"set2": "set2"
|
|
42
|
+
};
|
|
43
|
+
exports.default = colorSchemes;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createUrlWithQueryParams = createUrlWithQueryParams;
|
|
4
|
+
const lodash_es_1 = require("lodash-es");
|
|
5
|
+
/**
|
|
6
|
+
* Maps a record of query params to a usable local URL path with the params appended at the end
|
|
7
|
+
* @param to Either a simple URL endpoint or a URL path with query params (corresponds to a href)
|
|
8
|
+
*/
|
|
9
|
+
function createUrlWithQueryParams(to) {
|
|
10
|
+
if (!to || typeof to === "string" || typeof to === "number") {
|
|
11
|
+
return to;
|
|
12
|
+
}
|
|
13
|
+
if (to.queryParams !== undefined) {
|
|
14
|
+
return Object.assign(Object.assign({}, to), { search: new URLSearchParams((0, lodash_es_1.omitBy)(to.queryParams, lodash_es_1.isUndefined)).toString() });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedItem = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const constants_1 = require("@components-core/constants");
|
|
7
|
+
const hooks_1 = require("@components-core/utils/hooks");
|
|
8
|
+
exports.MemoizedItem = (0, react_1.memo)(({ node, item, context, renderChild, layoutContext, contextVars = constants_1.EMPTY_OBJECT, itemKey = "$item", contextKey = "$context", }) => {
|
|
9
|
+
const shallowMemoedContextVars = (0, hooks_1.useShallowCompareMemoize)(contextVars);
|
|
10
|
+
const nodeWithItem = (0, react_1.useMemo)(() => {
|
|
11
|
+
if (itemKey === contextKey) {
|
|
12
|
+
return {
|
|
13
|
+
type: "Container",
|
|
14
|
+
contextVars: Object.assign({ [itemKey]: Object.assign(Object.assign({}, item), context) }, shallowMemoedContextVars),
|
|
15
|
+
children: Array.isArray(node) ? node : [node],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
type: "Container",
|
|
20
|
+
contextVars: Object.assign({ [itemKey]: item, [contextKey]: context }, shallowMemoedContextVars),
|
|
21
|
+
children: Array.isArray(node) ? node : [node],
|
|
22
|
+
};
|
|
23
|
+
}, [context, item, node, shallowMemoedContextVars]);
|
|
24
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderChild(nodeWithItem, layoutContext) });
|
|
25
|
+
});
|