xmlui 0.7.14 → 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-FBzCR_-x.mjs → apiInterceptorWorker-yKpXImCG.mjs} +1 -1
- package/dist/{index-rxu3P0l4.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 +2669 -2601
- 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,337 @@
|
|
|
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.NumberBox = 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 NumberBox_module_scss_1 = __importDefault(require("./NumberBox.module.scss"));
|
|
44
|
+
const constants_1 = require("@components-core/constants");
|
|
45
|
+
const IconNative_1 = require("@components/Icon/IconNative");
|
|
46
|
+
const InputAdornment_1 = require("@components/Input/InputAdornment");
|
|
47
|
+
const ButtonNative_1 = require("@components/Button/ButtonNative");
|
|
48
|
+
const misc_1 = require("@components-core/utils/misc");
|
|
49
|
+
const ItemWithLabel_1 = require("@components/FormItem/ItemWithLabel");
|
|
50
|
+
const numberbox_abstractions_1 = require("./numberbox-abstractions");
|
|
51
|
+
const NumberBox = ({ id, value, initialValue, style, enabled = true, placeholder, validationStatus = "none", hasSpinBox = true, step, integersOnly = false, zeroOrPositive = false, min = zeroOrPositive ? 0 : -numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, max = numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, maxLength, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, startText, startIcon, endText, endIcon, autoFocus, readOnly, required, label, labelPosition, labelWidth, labelBreak, }) => {
|
|
52
|
+
var _a;
|
|
53
|
+
// Ensure the provided minimum is not smaller than the 0 if zeroOrPositive is set to true
|
|
54
|
+
min = Math.max(zeroOrPositive ? 0 : -numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, min);
|
|
55
|
+
// Step must be an integer since floating point arithmetic needs a deeper dive.
|
|
56
|
+
const _step = (_a = (0, numberbox_abstractions_1.toUsableNumber)(step, true)) !== null && _a !== void 0 ? _a : numberbox_abstractions_1.DEFAULT_STEP;
|
|
57
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
58
|
+
const upButton = (0, react_1.useRef)(null);
|
|
59
|
+
const downButton = (0, react_1.useRef)(null);
|
|
60
|
+
(0, react_1.useEffect)(() => {
|
|
61
|
+
if (autoFocus) {
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
var _a;
|
|
64
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
65
|
+
}, 0);
|
|
66
|
+
}
|
|
67
|
+
}, [autoFocus]);
|
|
68
|
+
// --- Convert to representable string value (from number | null | undefined)
|
|
69
|
+
const [valueStrRep, setValueStrRep] = react_1.default.useState((0, numberbox_abstractions_1.mapToRepresentation)(value));
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
setValueStrRep((0, numberbox_abstractions_1.mapToRepresentation)(value));
|
|
72
|
+
}, [value]);
|
|
73
|
+
// --- Initialize the related field with the input's initial value
|
|
74
|
+
(0, react_1.useEffect)(() => {
|
|
75
|
+
updateState({ value: initialValue }, { initial: true });
|
|
76
|
+
}, [initialValue, updateState]);
|
|
77
|
+
// --- Handle the value change events for this input
|
|
78
|
+
const updateValue = (0, react_1.useCallback)((newValue, rep) => {
|
|
79
|
+
setValueStrRep(rep);
|
|
80
|
+
updateState({ value: newValue });
|
|
81
|
+
onDidChange(newValue);
|
|
82
|
+
}, [onDidChange, updateState]);
|
|
83
|
+
// --- Keypress
|
|
84
|
+
const onInputChange = (0, react_1.useCallback)((event) => {
|
|
85
|
+
// const newValue = sanitizeInput(event.target.value.trim(), value, integersOnly, zeroOrPositive, min, max);
|
|
86
|
+
// if (!newValue) return;
|
|
87
|
+
// updateValue(newValue[0], newValue[1]);
|
|
88
|
+
const value = event.target.value;
|
|
89
|
+
const repr = value;
|
|
90
|
+
updateValue(value, repr);
|
|
91
|
+
}, [updateValue]);
|
|
92
|
+
// --- Stepper logic
|
|
93
|
+
const handleIncStep = (0, react_1.useCallback)(() => {
|
|
94
|
+
if (readOnly)
|
|
95
|
+
return;
|
|
96
|
+
const newValue = applyStep(valueStrRep, _step, min, max, integersOnly);
|
|
97
|
+
if (newValue === undefined)
|
|
98
|
+
return;
|
|
99
|
+
updateValue(newValue, newValue.toString());
|
|
100
|
+
}, [valueStrRep, _step, min, max, integersOnly, updateValue, readOnly]);
|
|
101
|
+
const handleDecStep = (0, react_1.useCallback)(() => {
|
|
102
|
+
if (readOnly)
|
|
103
|
+
return;
|
|
104
|
+
const newValue = applyStep(valueStrRep, -_step, min, max, integersOnly);
|
|
105
|
+
if (newValue === undefined)
|
|
106
|
+
return;
|
|
107
|
+
updateValue(newValue, newValue.toString());
|
|
108
|
+
}, [valueStrRep, _step, min, max, integersOnly, updateValue, readOnly]);
|
|
109
|
+
// --- Register stepper logic to buttons
|
|
110
|
+
useLongPress(upButton.current, handleIncStep);
|
|
111
|
+
useLongPress(downButton.current, handleDecStep);
|
|
112
|
+
// --- This logic prevenst the user from typing invalid characters (in the current typing context)
|
|
113
|
+
const handleOnBeforeInput = (event) => {
|
|
114
|
+
var _a, _b;
|
|
115
|
+
// --- Prevent the default behavior for some characters
|
|
116
|
+
let shouldPreventDefault = false;
|
|
117
|
+
const currentValue = (_a = event.target.value) !== null && _a !== void 0 ? _a : "";
|
|
118
|
+
const currentPos = event.target.selectionStart;
|
|
119
|
+
// --- Are the caret after the exponential separator?
|
|
120
|
+
const beforeCaret = currentValue.substring(0, event.target.selectionStart);
|
|
121
|
+
// --- If "expPos" is -1, the caret is not after the exponential separator
|
|
122
|
+
const expPos = beforeCaret.indexOf(numberbox_abstractions_1.EXPONENTIAL_SEPARATOR);
|
|
123
|
+
switch (event.data) {
|
|
124
|
+
case "-":
|
|
125
|
+
shouldPreventDefault = true;
|
|
126
|
+
if (expPos === -1) {
|
|
127
|
+
// --- Change the first char to "-" if we are before the exponential separator and it's not already there
|
|
128
|
+
if (!currentValue.startsWith("-")) {
|
|
129
|
+
setNewValue("-" + currentValue, currentPos + 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// --- Change the char after the exponential separator to "-" if it's not already there
|
|
134
|
+
if (currentValue[expPos + 1] !== "-") {
|
|
135
|
+
setNewValue(currentValue.substring(0, expPos + 1) + "-" + currentValue.substring(expPos + 1), currentPos + 1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
case "+":
|
|
140
|
+
shouldPreventDefault = true;
|
|
141
|
+
if (expPos === -1) {
|
|
142
|
+
// --- Remove the first char if it's "-" and we are before the exponential separator
|
|
143
|
+
if (currentValue.startsWith("-")) {
|
|
144
|
+
setNewValue(currentValue.substring(1), currentPos - 1);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
// --- Remove the char after the exponential separator if it's "-"
|
|
149
|
+
if (currentValue[expPos + 1] === "-") {
|
|
150
|
+
setNewValue(currentValue.substring(0, expPos + 1) + currentValue.substring(expPos + 2), currentPos - 1);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
case numberbox_abstractions_1.DECIMAL_SEPARATOR:
|
|
155
|
+
// --- Prevent multiple decimal separators (integers only),
|
|
156
|
+
// --- or decimal separator after the exponential separator
|
|
157
|
+
if (integersOnly || currentValue.includes(numberbox_abstractions_1.DECIMAL_SEPARATOR) || expPos !== -1) {
|
|
158
|
+
shouldPreventDefault = true;
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
case numberbox_abstractions_1.EXPONENTIAL_SEPARATOR:
|
|
162
|
+
// --- Prevent exponential notation for integers
|
|
163
|
+
if (integersOnly) {
|
|
164
|
+
shouldPreventDefault = true;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
// --- Prevent multiple exponential separators (and too many digits after it)
|
|
168
|
+
if (currentValue.includes(numberbox_abstractions_1.EXPONENTIAL_SEPARATOR) ||
|
|
169
|
+
tooManyDigitsAfterExponentialSeparator(currentPos, 2)) {
|
|
170
|
+
shouldPreventDefault = true;
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
default:
|
|
174
|
+
let newInput = event.data;
|
|
175
|
+
const selectionStart = event.target.selectionStart;
|
|
176
|
+
// --- Test for multi-character input (perhaps paste)
|
|
177
|
+
if (((_b = event.data) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
178
|
+
// --- Decide whether to accept the optional sign character
|
|
179
|
+
if (newInput.startsWith("-")) {
|
|
180
|
+
if (selectionStart > 0) {
|
|
181
|
+
shouldPreventDefault = true;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else if (newInput.startsWith("+")) {
|
|
186
|
+
shouldPreventDefault = true;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
// --- Replace the selection with the new input
|
|
190
|
+
const newValue = currentValue.substring(0, selectionStart) +
|
|
191
|
+
newInput +
|
|
192
|
+
currentValue.substring(event.target.selectionEnd);
|
|
193
|
+
// --- Check for integers
|
|
194
|
+
if (integersOnly && !numberbox_abstractions_1.INT_REGEXP.test(newValue)) {
|
|
195
|
+
// --- The result is not an integer, drop the pasted input
|
|
196
|
+
shouldPreventDefault = true;
|
|
197
|
+
}
|
|
198
|
+
else if (!numberbox_abstractions_1.FLOAT_REGEXP.test(newValue)) {
|
|
199
|
+
// --- The result is not a loat, drop the pasted input
|
|
200
|
+
shouldPreventDefault = true;
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
// --- Single character input
|
|
205
|
+
// --- Prevent non-digit characters
|
|
206
|
+
if (event.data < "0" || event.data > "9") {
|
|
207
|
+
shouldPreventDefault = true;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
// --- Prevent digits before minus sign
|
|
211
|
+
if (currentValue.startsWith("-") && selectionStart === 0) {
|
|
212
|
+
shouldPreventDefault = true;
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
// --- Prevent too many digits after the exponential separator
|
|
216
|
+
if (expPos !== -1 && tooManyDigitsAfterExponentialSeparator(expPos + 1, 1)) {
|
|
217
|
+
// --- Caret after the exponential separator
|
|
218
|
+
// --- Prevent typing a digi if more than 2 digits after the exponential separator
|
|
219
|
+
shouldPreventDefault = true;
|
|
220
|
+
}
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
// --- Done.
|
|
224
|
+
if (shouldPreventDefault) {
|
|
225
|
+
event.preventDefault();
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
// --- Helpers
|
|
229
|
+
function tooManyDigitsAfterExponentialSeparator(pos, maxDigits) {
|
|
230
|
+
let numDigitsAfter = 0;
|
|
231
|
+
while (pos < currentValue.length) {
|
|
232
|
+
if (/\d/.test(currentValue[pos++])) {
|
|
233
|
+
numDigitsAfter++;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
numDigitsAfter = maxDigits + 1;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return numDigitsAfter > maxDigits;
|
|
241
|
+
}
|
|
242
|
+
function setNewValue(newValue, pos) {
|
|
243
|
+
var _a;
|
|
244
|
+
event.target.value = newValue;
|
|
245
|
+
updateValue(newValue, newValue);
|
|
246
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange(pos, pos);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
// --- Setting steppers with keyboard
|
|
250
|
+
const handleOnKey = (0, react_1.useCallback)((event) => {
|
|
251
|
+
if (event.code === "ArrowUp") {
|
|
252
|
+
event.preventDefault();
|
|
253
|
+
handleIncStep();
|
|
254
|
+
}
|
|
255
|
+
if (event.code === "ArrowDown") {
|
|
256
|
+
event.preventDefault();
|
|
257
|
+
handleDecStep();
|
|
258
|
+
}
|
|
259
|
+
}, [handleIncStep, handleDecStep]);
|
|
260
|
+
// --- Manage obtaining and losing focus & blur
|
|
261
|
+
const handleOnFocus = (0, react_1.useCallback)(() => {
|
|
262
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
263
|
+
}, [onFocus]);
|
|
264
|
+
const handleOnBlur = (0, react_1.useCallback)(() => {
|
|
265
|
+
setValueStrRep((0, numberbox_abstractions_1.mapToRepresentation)(value));
|
|
266
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
267
|
+
}, [value, onBlur]);
|
|
268
|
+
const focus = (0, react_1.useCallback)(() => {
|
|
269
|
+
var _a;
|
|
270
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
271
|
+
}, []);
|
|
272
|
+
const setValue = (0, misc_1.useEvent)((newValue) => {
|
|
273
|
+
updateValue(newValue, (0, numberbox_abstractions_1.isEmptyLike)(newValue) ? "" : String(newValue));
|
|
274
|
+
});
|
|
275
|
+
(0, react_1.useEffect)(() => {
|
|
276
|
+
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
277
|
+
focus,
|
|
278
|
+
setValue,
|
|
279
|
+
});
|
|
280
|
+
}, [focus, registerComponentApi, setValue]);
|
|
281
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(NumberBox_module_scss_1.default.inputRoot, {
|
|
282
|
+
[NumberBox_module_scss_1.default.readOnly]: readOnly,
|
|
283
|
+
[NumberBox_module_scss_1.default.disabled]: !enabled,
|
|
284
|
+
[NumberBox_module_scss_1.default.noSpinBox]: !hasSpinBox,
|
|
285
|
+
[NumberBox_module_scss_1.default.error]: validationStatus === "error",
|
|
286
|
+
[NumberBox_module_scss_1.default.warning]: validationStatus === "warning",
|
|
287
|
+
[NumberBox_module_scss_1.default.valid]: validationStatus === "valid",
|
|
288
|
+
}), tabIndex: -1, onFocus: () => {
|
|
289
|
+
var _a;
|
|
290
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
291
|
+
}, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: NumberBox_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("input", { id: id, type: "text", inputMode: "numeric", className: (0, classnames_1.default)(NumberBox_module_scss_1.default.input, { [NumberBox_module_scss_1.default.readOnly]: readOnly }), disabled: !enabled, value: valueStrRep, step: step, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onBeforeInput: handleOnBeforeInput, onKeyDown: handleOnKey, readOnly: readOnly, ref: inputRef, autoFocus: autoFocus, maxLength: maxLength, required: required, "aria-required": required }), (0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: NumberBox_module_scss_1.default.adornment }), hasSpinBox && ((0, jsx_runtime_1.jsxs)("div", { className: NumberBox_module_scss_1.default.spinnerBox, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "up", type: "button", variant: "ghost", themeColor: "secondary", tabIndex: -1, className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: upButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevronup", size: "sm" }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "down", type: "button", tabIndex: -1, variant: "ghost", themeColor: "secondary", className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: downButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevrondown", size: "sm" }) })] }))] }) }));
|
|
292
|
+
};
|
|
293
|
+
exports.NumberBox = NumberBox;
|
|
294
|
+
function applyStep(valueStrRep, step, min, max, integersOnly) {
|
|
295
|
+
const currentValue = (0, numberbox_abstractions_1.toUsableNumber)(valueStrRep, integersOnly);
|
|
296
|
+
if ((0, numberbox_abstractions_1.isEmptyLike)(currentValue)) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
return (0, numberbox_abstractions_1.clamp)(currentValue + step, min, max);
|
|
300
|
+
}
|
|
301
|
+
function useLongPress(elementRef, action, delay = 500) {
|
|
302
|
+
const timeoutId = (0, react_1.useRef)(0);
|
|
303
|
+
const intervalId = (0, react_1.useRef)(0);
|
|
304
|
+
const savedAction = (0, react_1.useRef)(action);
|
|
305
|
+
// Remember the latest action callback, since it is different every render
|
|
306
|
+
(0, react_1.useEffect)(() => {
|
|
307
|
+
savedAction.current = action;
|
|
308
|
+
}, [action]);
|
|
309
|
+
(0, react_1.useEffect)(() => {
|
|
310
|
+
const onMouseDown = () => {
|
|
311
|
+
var _a;
|
|
312
|
+
(_a = savedAction.current) === null || _a === void 0 ? void 0 : _a.call(savedAction);
|
|
313
|
+
timeoutId.current = window.setTimeout(() => {
|
|
314
|
+
intervalId.current = window.setInterval(() => {
|
|
315
|
+
var _a;
|
|
316
|
+
(_a = savedAction.current) === null || _a === void 0 ? void 0 : _a.call(savedAction);
|
|
317
|
+
}, 100);
|
|
318
|
+
}, delay);
|
|
319
|
+
};
|
|
320
|
+
const onMouseUp = () => {
|
|
321
|
+
clearTimeout(timeoutId.current);
|
|
322
|
+
clearInterval(intervalId.current);
|
|
323
|
+
};
|
|
324
|
+
const onMouseOut = () => {
|
|
325
|
+
clearTimeout(timeoutId.current);
|
|
326
|
+
clearInterval(intervalId.current);
|
|
327
|
+
};
|
|
328
|
+
elementRef === null || elementRef === void 0 ? void 0 : elementRef.addEventListener("mousedown", onMouseDown);
|
|
329
|
+
elementRef === null || elementRef === void 0 ? void 0 : elementRef.addEventListener("mouseup", onMouseUp);
|
|
330
|
+
elementRef === null || elementRef === void 0 ? void 0 : elementRef.addEventListener("mouseout", onMouseOut);
|
|
331
|
+
return () => {
|
|
332
|
+
elementRef === null || elementRef === void 0 ? void 0 : elementRef.removeEventListener("mousedown", onMouseDown);
|
|
333
|
+
elementRef === null || elementRef === void 0 ? void 0 : elementRef.removeEventListener("mouseup", onMouseUp);
|
|
334
|
+
elementRef === null || elementRef === void 0 ? void 0 : elementRef.removeEventListener("mouseout", onMouseOut);
|
|
335
|
+
};
|
|
336
|
+
}, [elementRef, action, delay]);
|
|
337
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_STEP = exports.FLOAT_REGEXP = exports.INT_REGEXP = exports.EXPONENTIAL_SEPARATOR = exports.DECIMAL_SEPARATOR = exports.NUMBERBOX_MAX_VALUE = void 0;
|
|
4
|
+
exports.isEmptyLike = isEmptyLike;
|
|
5
|
+
exports.mapToRepresentation = mapToRepresentation;
|
|
6
|
+
exports.clamp = clamp;
|
|
7
|
+
exports.toUsableNumber = toUsableNumber;
|
|
8
|
+
exports.NUMBERBOX_MAX_VALUE = 999999999999999;
|
|
9
|
+
exports.DECIMAL_SEPARATOR = ".";
|
|
10
|
+
exports.EXPONENTIAL_SEPARATOR = "e";
|
|
11
|
+
exports.INT_REGEXP = /^-?\d+$/;
|
|
12
|
+
exports.FLOAT_REGEXP = /^-?\d+(\.\d+)?([eE][+-]?\d+)?$/;
|
|
13
|
+
exports.DEFAULT_STEP = 1;
|
|
14
|
+
function isEmptyLike(value) {
|
|
15
|
+
return typeof value === "undefined" || value === null || value === "";
|
|
16
|
+
}
|
|
17
|
+
function mapToRepresentation(value) {
|
|
18
|
+
if (typeof value === "string")
|
|
19
|
+
return value;
|
|
20
|
+
if (typeof value === "number")
|
|
21
|
+
return value.toString();
|
|
22
|
+
return "";
|
|
23
|
+
}
|
|
24
|
+
function clamp(value, min, max) {
|
|
25
|
+
let clamped = value;
|
|
26
|
+
if (value < min)
|
|
27
|
+
clamped = min;
|
|
28
|
+
if (value > max)
|
|
29
|
+
clamped = max;
|
|
30
|
+
return clamped;
|
|
31
|
+
}
|
|
32
|
+
function toUsableNumber(value, isInteger = false) {
|
|
33
|
+
const isUsable = isInteger ? isUsableInteger : isUsableFloat;
|
|
34
|
+
if (!isUsable(value))
|
|
35
|
+
return null;
|
|
36
|
+
if (typeof value === "string") {
|
|
37
|
+
value = isInteger ? Number.parseInt(value) : +value;
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Check whether the input value is a usable number for operations.
|
|
43
|
+
* Passes if it's of type number or a non-empty string that evaluates to a number.
|
|
44
|
+
*/
|
|
45
|
+
function isUsableFloat(value) {
|
|
46
|
+
if (typeof value === "string" && value.length > 0) {
|
|
47
|
+
return !Number.isNaN(+value) && naiveFloatBounding(value);
|
|
48
|
+
}
|
|
49
|
+
return typeof value === "number";
|
|
50
|
+
}
|
|
51
|
+
// TEMP
|
|
52
|
+
// Rounding and arithmetic with large floats is a hassle if loss of precision is apparent.
|
|
53
|
+
// Just bound the incoming floating point value to the max value available.
|
|
54
|
+
// This is an edge case but makes it so that we stay consistent and can do arithmetic with the spinner box.
|
|
55
|
+
function naiveFloatBounding(value) {
|
|
56
|
+
const integerPart = value.split(".")[0];
|
|
57
|
+
return Math.abs(Number.parseInt(integerPart)) <= exports.NUMBERBOX_MAX_VALUE;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Check whether the input value is a usable integer for operations.
|
|
61
|
+
* Passes if it's of type number and is an integer
|
|
62
|
+
* or a non-empty string that evaluates to an integer.
|
|
63
|
+
*/
|
|
64
|
+
function isUsableInteger(value) {
|
|
65
|
+
if (typeof value === "string" &&
|
|
66
|
+
value.length > 0 &&
|
|
67
|
+
![exports.EXPONENTIAL_SEPARATOR, exports.DECIMAL_SEPARATOR].some((item) => value.includes(item))) {
|
|
68
|
+
return Number.isSafeInteger(+value);
|
|
69
|
+
}
|
|
70
|
+
else if (typeof value === "number") {
|
|
71
|
+
return Number.isSafeInteger(value);
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.offCanvasComponentRenderer = exports.OffCanvasMd = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
9
|
+
const OffCanvas_module_scss_1 = __importDefault(require("./OffCanvas.module.scss"));
|
|
10
|
+
const renderers_1 = require("@components-core/renderers");
|
|
11
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
12
|
+
const OffCanvasNative_1 = require("./OffCanvasNative");
|
|
13
|
+
const abstractions_1 = require("@components/abstractions");
|
|
14
|
+
const metadata_helpers_1 = require("@components/metadata-helpers");
|
|
15
|
+
const COMP = "OffCanvas";
|
|
16
|
+
// See reference implementation here: https://getbootstrap.com/docs/5.3/components/alerts/
|
|
17
|
+
exports.OffCanvasMd = (0, ComponentDefs_1.createMetadata)({
|
|
18
|
+
status: "in progress",
|
|
19
|
+
description: `(**NOT IMPLEMENTED YET**) The \`OffCanvas\` component is a hidden panel that slides into view ` +
|
|
20
|
+
`from the side of the screen. It helps display additional content or navigation without disrupting ` +
|
|
21
|
+
`the main interface.`,
|
|
22
|
+
props: {
|
|
23
|
+
title: (0, ComponentDefs_1.d)("This property sets the title of the component.", null, "string"),
|
|
24
|
+
isInitiallyOpen: (0, ComponentDefs_1.d)("This property indicates if the component is initially open.", null, "boolean", false),
|
|
25
|
+
enableBackdrop: (0, ComponentDefs_1.d)(`This property indicates if the backdrop is enabled when the component is displayed. When the ` +
|
|
26
|
+
`backdrop is not enabled, clicking outside \`OffCanvas\` will not close it.`, null, "boolean", true),
|
|
27
|
+
enableBodyScroll: (0, ComponentDefs_1.d)(`This property indicates if the body scroll is enabled when the component is displayed.`, null, "boolean", false),
|
|
28
|
+
noCloseOnBackdropClick: (0, ComponentDefs_1.d)(`When this property is set to \`true\`, the ${COMP} does not close when the user clicks on its backdrop.`, null, "boolean", false),
|
|
29
|
+
placement: (0, ComponentDefs_1.d)(`This property indicates the position where the ${COMP} should be docked to.`, abstractions_1.placementMd),
|
|
30
|
+
autoCloseInMs: (0, ComponentDefs_1.d)(`This property sets a timeout. When the timeout expires, the component gets hidden.`),
|
|
31
|
+
},
|
|
32
|
+
events: {
|
|
33
|
+
didOpen: (0, metadata_helpers_1.dDidOpen)(COMP),
|
|
34
|
+
didClose: (0, metadata_helpers_1.dDidClose)(COMP),
|
|
35
|
+
},
|
|
36
|
+
apis: {
|
|
37
|
+
open: (0, ComponentDefs_1.d)(`This method opens the component. It triggers the \`didOpen\` event with the argument ` +
|
|
38
|
+
`set to \`false\`.`),
|
|
39
|
+
close: (0, ComponentDefs_1.d)(`This method closes the component. It triggers the \`didClose\` event with the argument ` +
|
|
40
|
+
`set to \`false\`.`),
|
|
41
|
+
},
|
|
42
|
+
themeVars: (0, themeVars_1.parseScssVar)(OffCanvas_module_scss_1.default.themeVars),
|
|
43
|
+
defaultThemeVars: {
|
|
44
|
+
"width-OffCanvas": "600px",
|
|
45
|
+
"padding-OffCanvas": "$padding-tight",
|
|
46
|
+
"padding-vertical-OffCanvas": "$padding-tight",
|
|
47
|
+
"padding-horizontal-OffCanvas": "$padding-normal",
|
|
48
|
+
"color-bg-OffCanvas": "$color-bg",
|
|
49
|
+
"shadow-horizontal-OffCanvas": "0 2px 10px rgba(0, 0, 0, 0.2)",
|
|
50
|
+
"shadow-vertical-OffCanvas": "0 2px 10px rgba(0, 0, 0, 0.2)",
|
|
51
|
+
light: {},
|
|
52
|
+
dark: {},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
exports.offCanvasComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.OffCanvasMd, ({ node, extractValue, lookupEventHandler, renderChild, layoutCss }) => {
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(OffCanvasNative_1.OffCanvas, { style: layoutCss, title: extractValue(node.props.title), isInitiallyOpen: extractValue.asOptionalBoolean(node.props.isInitiallyOpen, false), placement: extractValue(node.props.placement), children: renderChild(node.children) }));
|
|
57
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
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.OffCanvas = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
9
|
+
const OffCanvas_module_scss_1 = __importDefault(require("./OffCanvas.module.scss"));
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const OffCanvas = ({ title, isInitiallyOpen, onClose, placement = "right", showCloseButton = true, children, allowScroll = true, showBackdrop = false, style, }) => {
|
|
12
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(isInitiallyOpen);
|
|
13
|
+
const [place, setPlace] = (0, react_1.useState)(placement);
|
|
14
|
+
// Control body scrolling
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
if (isOpen && !allowScroll) {
|
|
17
|
+
document.body.style.overflow = "hidden";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
document.body.style.overflow = "";
|
|
21
|
+
}
|
|
22
|
+
// Cleanup when unmounted or isOpen changes
|
|
23
|
+
return () => {
|
|
24
|
+
document.body.style.overflow = "";
|
|
25
|
+
};
|
|
26
|
+
}, [isOpen, allowScroll]);
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showBackdrop && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(OffCanvas_module_scss_1.default.overlay, {
|
|
28
|
+
[OffCanvas_module_scss_1.default.overlayVisible]: isOpen,
|
|
29
|
+
}), onClick: onClose })), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(OffCanvas_module_scss_1.default.offCanvas, {
|
|
30
|
+
[OffCanvas_module_scss_1.default.open]: isOpen,
|
|
31
|
+
[OffCanvas_module_scss_1.default.left]: place === "left",
|
|
32
|
+
[OffCanvas_module_scss_1.default.right]: place === "right",
|
|
33
|
+
[OffCanvas_module_scss_1.default.top]: place === "top",
|
|
34
|
+
[OffCanvas_module_scss_1.default.bottom]: place === "bottom",
|
|
35
|
+
}), style: style, children: [(0, jsx_runtime_1.jsxs)("header", { className: OffCanvas_module_scss_1.default.offCanvasHeader, children: [!!title && (0, jsx_runtime_1.jsx)("span", { className: OffCanvas_module_scss_1.default.offCanvasTitle, children: title }), (0, jsx_runtime_1.jsx)("div", { className: OffCanvas_module_scss_1.default.spacer }), showCloseButton && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [place !== "left" && ((0, jsx_runtime_1.jsx)("button", { className: OffCanvas_module_scss_1.default.button, onClick: () => {
|
|
36
|
+
setPlace("left");
|
|
37
|
+
}, children: "\u2190" })), place !== "right" && ((0, jsx_runtime_1.jsx)("button", { className: OffCanvas_module_scss_1.default.button, onClick: () => {
|
|
38
|
+
setPlace("right");
|
|
39
|
+
}, children: "\u2192" })), place !== "top" && ((0, jsx_runtime_1.jsx)("button", { className: OffCanvas_module_scss_1.default.button, onClick: () => {
|
|
40
|
+
setPlace("top");
|
|
41
|
+
}, children: "\u2191" })), place !== "bottom" && ((0, jsx_runtime_1.jsx)("button", { className: OffCanvas_module_scss_1.default.button, onClick: () => {
|
|
42
|
+
setPlace("bottom");
|
|
43
|
+
}, children: "\u2193" })), (0, jsx_runtime_1.jsx)("div", { className: OffCanvas_module_scss_1.default.offCanvasButtonSpace }), (0, jsx_runtime_1.jsx)("button", { className: OffCanvas_module_scss_1.default.button, onClick: () => {
|
|
44
|
+
setIsOpen(false);
|
|
45
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
46
|
+
}, children: "\u00D7" })] }))] }), children] })] }));
|
|
47
|
+
};
|
|
48
|
+
exports.OffCanvas = OffCanvas;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optionComponentRenderer = exports.OptionMd = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
6
|
+
const renderers_1 = require("@components-core/renderers");
|
|
7
|
+
const OptionTypeProvider_1 = require("@components/Option/OptionTypeProvider");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const metadata_helpers_1 = require("@components/metadata-helpers");
|
|
10
|
+
const COMP = "Option";
|
|
11
|
+
exports.OptionMd = (0, ComponentDefs_1.createMetadata)({
|
|
12
|
+
description: `\`${COMP}\` is a non-visual component describing a selection option. Other components ` +
|
|
13
|
+
`(such as \`Select\`, \`Combobox\`, and others) may use nested \`Option\` instances ` +
|
|
14
|
+
`from which the user can select.`,
|
|
15
|
+
props: {
|
|
16
|
+
label: (0, ComponentDefs_1.d)(`This property defines the text to display for the option. If \`label\` is not defined, ` +
|
|
17
|
+
`\`Option\` will use the \`value\` as the label.`),
|
|
18
|
+
value: (0, ComponentDefs_1.d)(`This property defines the value of the option. If \`value\` is not defined, ` +
|
|
19
|
+
`\`Option\` will use the \`label\` as the value.`),
|
|
20
|
+
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const OptionNative = (0, react_1.memo)((props) => {
|
|
24
|
+
const OptionType = (0, OptionTypeProvider_1.useOptionType)();
|
|
25
|
+
if (!OptionType) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (0, jsx_runtime_1.jsx)(OptionType, Object.assign({}, props));
|
|
29
|
+
});
|
|
30
|
+
OptionNative.displayName = "OptionNative";
|
|
31
|
+
exports.optionComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.OptionMd, ({ node, extractValue, layoutCss, renderChild }) => {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(OptionNative, { value: extractValue(node.props.value), label: extractValue.asOptionalString(node.props.label) || renderChild(node.children), enabled: extractValue.asOptionalBoolean(node.props.enabled), style: layoutCss }));
|
|
33
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
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.useOptionType = useOptionType;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const OptionTypeContext = react_1.default.createContext(null);
|
|
10
|
+
function useOptionType() {
|
|
11
|
+
return react_1.default.useContext(OptionTypeContext);
|
|
12
|
+
}
|
|
13
|
+
function OptionTypeProvider({ children, Component, }) {
|
|
14
|
+
return (0, jsx_runtime_1.jsx)(OptionTypeContext.Provider, { value: Component, children: children });
|
|
15
|
+
}
|
|
16
|
+
exports.default = OptionTypeProvider;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pageHeaderRenderer = exports.PageHeaderMd = 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 "./PageHeader.xmlui?raw";
|
|
8
|
+
const COMP = "PageHeader";
|
|
9
|
+
exports.PageHeaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
+
status: "experimental",
|
|
11
|
+
description: `The \`${COMP}\` component is a component that displays a title and an ` +
|
|
12
|
+
`optional pre-title. The pre-title is displayed above the title.`,
|
|
13
|
+
props: {
|
|
14
|
+
preTitle: (0, ComponentDefs_1.d)("The pre-title to display above the title."),
|
|
15
|
+
title: (0, ComponentDefs_1.d)("The title to display."),
|
|
16
|
+
},
|
|
17
|
+
defaultThemeVars: {
|
|
18
|
+
"gap-PageHeader": "$space-2",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const componentSource = `
|
|
22
|
+
<Component name="PageHeader">
|
|
23
|
+
<HStack gap="$gap-PageHeader" verticalAlignment="center">
|
|
24
|
+
<VStack gap="$space-tight">
|
|
25
|
+
<Text when="{$props.preTitle !== undefined}" variant="subheading" value="{$props.preTitle}" />
|
|
26
|
+
<H2 value="{$props.title}" />
|
|
27
|
+
</VStack>
|
|
28
|
+
<SpaceFiller />
|
|
29
|
+
<Slot />
|
|
30
|
+
</HStack>
|
|
31
|
+
</Component>
|
|
32
|
+
`;
|
|
33
|
+
exports.pageHeaderRenderer = {
|
|
34
|
+
compoundComponentDef: (0, compound_utils_1.compoundComponentDefFromSource)(COMP, componentSource),
|
|
35
|
+
metadata: exports.PageHeaderMd,
|
|
36
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageMetaTitle = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_helmet_async_1 = require("react-helmet-async");
|
|
6
|
+
const PageMetaTitle = ({ title }) => {
|
|
7
|
+
return (0, jsx_runtime_1.jsx)(react_helmet_async_1.Helmet, { title: title });
|
|
8
|
+
};
|
|
9
|
+
exports.PageMetaTitle = PageMetaTitle;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pageMetaTitleComponentRenderer = exports.PageMetaTitleMd = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
6
|
+
const renderers_1 = require("@components-core/renderers");
|
|
7
|
+
const PageMetaTilteNative_1 = require("./PageMetaTilteNative");
|
|
8
|
+
const COMP = "PageMetaTitle";
|
|
9
|
+
exports.PageMetaTitleMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
+
description: `A PageMetaTitle component allows setting up (or changing) the app title to display with the ` +
|
|
11
|
+
`current browser tab.`,
|
|
12
|
+
props: {
|
|
13
|
+
value: (0, ComponentDefs_1.d)(`This property sets the page's title to display in the browser tab.`),
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
exports.pageMetaTitleComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.PageMetaTitleMd, ({ node, extractValue, renderChild }) => {
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(PageMetaTilteNative_1.PageMetaTitle, { title: extractValue(node.props.value) || renderChild(node.children) });
|
|
18
|
+
});
|