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,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.textComponentRenderer = exports.TextMd = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const Text_module_scss_1 = __importDefault(require("./Text.module.scss"));
|
|
20
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
21
|
+
const renderers_1 = require("@components-core/renderers");
|
|
22
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
23
|
+
const TextNative_1 = require("./TextNative");
|
|
24
|
+
const COMP = "Text";
|
|
25
|
+
exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
26
|
+
description: `The \`${COMP}\` component displays textual information in a number of optional ` +
|
|
27
|
+
`styles and variants.`,
|
|
28
|
+
props: {
|
|
29
|
+
value: (0, ComponentDefs_1.d)(`The text to be displayed. This value can also be set via nesting the text into ` +
|
|
30
|
+
`the \`${COMP}\` component.`),
|
|
31
|
+
variant: (0, ComponentDefs_1.d)(`Optional string value that provides named presets for text variants with a ` +
|
|
32
|
+
`unique combination of font style, weight, size, color and other parameters.`, TextNative_1.variantOptionsMd),
|
|
33
|
+
maxLines: (0, ComponentDefs_1.d)(`This property determines the maximum number of lines the component can wrap to. ` +
|
|
34
|
+
`If there is no space to display all the contents, the component displays up to ` +
|
|
35
|
+
`as many lines as specified in this property.`),
|
|
36
|
+
preserveLinebreaks: (0, ComponentDefs_1.d)(`This property indicates if linebreaks should be preserved when displaying text.`),
|
|
37
|
+
ellipses: (0, ComponentDefs_1.d)(`This property indicates whether ellipses should be displayed when the text is ` +
|
|
38
|
+
`cropped (\`true\`) or not (\`false\`).`),
|
|
39
|
+
},
|
|
40
|
+
themeVars: (0, themeVars_1.parseScssVar)(Text_module_scss_1.default.themeVars),
|
|
41
|
+
defaultThemeVars: {
|
|
42
|
+
[`border-radius-${COMP}`]: "$radius",
|
|
43
|
+
[`style-border-${COMP}`]: "solid",
|
|
44
|
+
[`font-size-${COMP}`]: "$font-size-small",
|
|
45
|
+
[`thickness-border-${COMP}`]: "$space-0",
|
|
46
|
+
[`font-weight-${COMP}-abbr`]: "$font-weight-bold",
|
|
47
|
+
[`transform-${COMP}-abbr`]: "uppercase",
|
|
48
|
+
[`font-size-${COMP}-secondary`]: "$font-size-small",
|
|
49
|
+
[`font-style-${COMP}-cite`]: "italic",
|
|
50
|
+
[`color-${COMP}`]: "$color-text-primary",
|
|
51
|
+
[`font-family-${COMP}`]: "$font-family",
|
|
52
|
+
[`font-weight-${COMP}`]: "$font-weight-normal",
|
|
53
|
+
[`font-family-${COMP}-code`]: "$font-family-monospace",
|
|
54
|
+
[`font-size-${COMP}-code`]: "$font-size-small",
|
|
55
|
+
[`thickness-border-${COMP}-code`]: "1px",
|
|
56
|
+
[`padding-horizontal-${COMP}-code`]: "$space-1",
|
|
57
|
+
[`line-decoration-${COMP}-deleted`]: "line-through",
|
|
58
|
+
[`line-decoration-${COMP}-inserted`]: "underline",
|
|
59
|
+
[`font-family-${COMP}-keyboard`]: "$font-family-monospace",
|
|
60
|
+
[`font-size-${COMP}-keyboard`]: "$font-size-small",
|
|
61
|
+
[`font-weight-${COMP}-keyboard`]: "$font-weight-bold",
|
|
62
|
+
[`thickness-border-${COMP}-keyboard`]: "1px",
|
|
63
|
+
[`padding-horizontal-${COMP}-keyboard`]: "$space-1",
|
|
64
|
+
[`font-family-${COMP}-sample`]: "$font-family-monospace",
|
|
65
|
+
[`font-size-${COMP}-sample`]: "$font-size-small",
|
|
66
|
+
[`font-size-${COMP}-sup`]: "$font-size-smaller",
|
|
67
|
+
[`align-vertical-${COMP}-sup`]: "super",
|
|
68
|
+
[`font-size-${COMP}-sub`]: "$font-size-smaller",
|
|
69
|
+
[`align-vertical-${COMP}-sub`]: "sub",
|
|
70
|
+
[`font-style-${COMP}-var`]: "italic",
|
|
71
|
+
[`font-family-${COMP}-mono`]: "$font-family-monospace",
|
|
72
|
+
[`font-size-${COMP}-title`]: "$font-size-large",
|
|
73
|
+
[`font-size-${COMP}-subtitle`]: "$font-size-medium",
|
|
74
|
+
[`font-size-${COMP}-small`]: "$font-size-small",
|
|
75
|
+
[`line-height-${COMP}-small`]: "$line-height-tight",
|
|
76
|
+
[`letter-spacing-${COMP}-caption`]: "0.05rem",
|
|
77
|
+
[`font-size-${COMP}-placeholder`]: "$font-size-small",
|
|
78
|
+
[`font-family-${COMP}-codefence`]: "$font-family-monospace",
|
|
79
|
+
[`padding-horizontal-${COMP}-codefence`]: "$space-3",
|
|
80
|
+
[`padding-vertical-${COMP}-codefence`]: "$space-2",
|
|
81
|
+
[`padding-vertical-${COMP}-paragraph`]: "$space-1",
|
|
82
|
+
[`font-size-${COMP}-subheading`]: "$font-size-H6",
|
|
83
|
+
[`font-weight-${COMP}-subheading`]: "$font-weight-bold",
|
|
84
|
+
[`letter-spacing-${COMP}-subheading`]: "0.04em",
|
|
85
|
+
[`transform-${COMP}-subheading`]: "uppercase",
|
|
86
|
+
[`margin-top-${COMP}-tableheading`]: "$space-1",
|
|
87
|
+
[`margin-bottom-${COMP}-tableheading`]: "$space-4",
|
|
88
|
+
[`padding-horizontal-${COMP}-tableheading`]: "$space-1",
|
|
89
|
+
[`font-weight-${COMP}-tableheading`]: "$font-weight-bold",
|
|
90
|
+
light: {
|
|
91
|
+
[`color-bg-${COMP}-code`]: "$color-surface-100",
|
|
92
|
+
[`color-border-${COMP}-code`]: "$color-surface-200",
|
|
93
|
+
[`color-bg-${COMP}-keyboard`]: "$color-surface-200",
|
|
94
|
+
[`color-border-${COMP}-keyboard`]: "$color-surface-300",
|
|
95
|
+
[`color-bg-${COMP}-marked`]: "yellow",
|
|
96
|
+
[`color-${COMP}-placeholder`]: "$color-surface-500",
|
|
97
|
+
[`color-bg-${COMP}-codefence`]: "$color-primary-100",
|
|
98
|
+
[`color-${COMP}-codefence`]: "$color-surface-900",
|
|
99
|
+
[`color-${COMP}-subheading`]: "$color-text-secondary",
|
|
100
|
+
[`color-${COMP}-secondary`]: "$color-text-secondary",
|
|
101
|
+
},
|
|
102
|
+
dark: {
|
|
103
|
+
[`color-bg-${COMP}-code`]: "$color-surface-800",
|
|
104
|
+
[`color-border-${COMP}-code`]: "$color-surface-700",
|
|
105
|
+
[`color-bg-${COMP}-keyboard`]: "$color-surface-800",
|
|
106
|
+
[`color-border-${COMP}-keyboard`]: "$color-surface-700",
|
|
107
|
+
[`color-bg-${COMP}-marked`]: "orange",
|
|
108
|
+
[`color-${COMP}-placeholder`]: "$color-surface-500",
|
|
109
|
+
[`color-bg-${COMP}-codefence`]: "$color-primary-800",
|
|
110
|
+
[`color-${COMP}-codefence`]: "$color-surface-200",
|
|
111
|
+
[`color-${COMP}-subheading`]: "$color-text-secondary",
|
|
112
|
+
[`color-${COMP}-secondary`]: "$color-text-secondary",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
exports.textComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextMd, ({ node, extractValue, layoutCss, renderChild }) => {
|
|
117
|
+
const _a = node.props, { variant, maxLines, preserveLinebreaks, ellipses, value } = _a, variantSpecific = __rest(_a, ["variant", "maxLines", "preserveLinebreaks", "ellipses", "value"]);
|
|
118
|
+
const variantSpecificProps = Object.fromEntries(Object.entries(variantSpecific)
|
|
119
|
+
.filter(([key, _]) => TextNative_1.VariantPropsKeys.includes(key))
|
|
120
|
+
.map(([key, value]) => [key, extractValue(value)]));
|
|
121
|
+
return ((0, jsx_runtime_1.jsx)(TextNative_1.Text, Object.assign({ variant: extractValue(variant), maxLines: extractValue.asOptionalNumber(maxLines), style: layoutCss, preserveLinebreaks: extractValue.asOptionalBoolean(preserveLinebreaks, false), ellipses: extractValue.asOptionalBoolean(ellipses, true) }, variantSpecificProps, { children: extractValue.asDisplayText(value) || renderChild(node.children) })));
|
|
122
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Text = exports.VariantPropsKeys = exports.variantOptionsMd = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
20
|
+
const react_2 = require("react");
|
|
21
|
+
const Text_module_scss_1 = __importDefault(require("./Text.module.scss"));
|
|
22
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
23
|
+
const css_utils_1 = require("@components-core/utils/css-utils");
|
|
24
|
+
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
25
|
+
const TextVariantKeys = [
|
|
26
|
+
"abbr", // use <abbr>
|
|
27
|
+
"cite", // use <cite>
|
|
28
|
+
"code", // use <code>
|
|
29
|
+
"codefence", // use uniquely styled <![CDATA[
|
|
30
|
+
"deleted", // use <del>
|
|
31
|
+
"inserted", // use <ins>
|
|
32
|
+
"keyboard", // use <kbd>,
|
|
33
|
+
"marked", // use <mark>
|
|
34
|
+
"sample", // use <samp>
|
|
35
|
+
"sub", // use <sub>
|
|
36
|
+
"sup", // use <sup>
|
|
37
|
+
"var", // use <var>
|
|
38
|
+
"strong", // use <strong> element for content that is of greater importance (used in Markdown)
|
|
39
|
+
"em", // use <em> element changes the meaning of a sentence - as spoken emphasis does (used in Markdown)
|
|
40
|
+
"mono", // use monospace font with <![CDATA[
|
|
41
|
+
"title", // Title text in the particular context
|
|
42
|
+
"subtitle", // Subtitle text in the particular context
|
|
43
|
+
"small", // Small text in the particular context
|
|
44
|
+
"caption", // Caption text in the particular context
|
|
45
|
+
"placeholder", // Placeholder text in the particular context
|
|
46
|
+
"paragraph", // use <p>
|
|
47
|
+
"subheading", // use a H6 with some specific defaults
|
|
48
|
+
"tableheading", // use a H3 with some specific defaults
|
|
49
|
+
"secondary", // use a secondary text style
|
|
50
|
+
];
|
|
51
|
+
const TextVariantElement = {
|
|
52
|
+
abbr: "abbr",
|
|
53
|
+
cite: "cite",
|
|
54
|
+
code: "code",
|
|
55
|
+
codefence: "pre",
|
|
56
|
+
deleted: "del",
|
|
57
|
+
inserted: "ins",
|
|
58
|
+
keyboard: "kbd",
|
|
59
|
+
marked: "mark",
|
|
60
|
+
sample: "samp",
|
|
61
|
+
sub: "sub",
|
|
62
|
+
sup: "sup",
|
|
63
|
+
var: "var",
|
|
64
|
+
mono: "pre",
|
|
65
|
+
strong: "strong",
|
|
66
|
+
em: "em",
|
|
67
|
+
title: "span",
|
|
68
|
+
subtitle: "span",
|
|
69
|
+
small: "span",
|
|
70
|
+
caption: "span",
|
|
71
|
+
placeholder: "span",
|
|
72
|
+
paragraph: "p",
|
|
73
|
+
subheading: "h6",
|
|
74
|
+
tableheading: "h6",
|
|
75
|
+
secondary: "span",
|
|
76
|
+
};
|
|
77
|
+
exports.variantOptionsMd = [
|
|
78
|
+
{ value: "abbr", description: "Represents an abbreviation or acronym" },
|
|
79
|
+
{ value: "caption", description: "Represents the caption (or title) of a table" },
|
|
80
|
+
{ value: "cite", description: "Is used to mark up the title of a cited work" },
|
|
81
|
+
{ value: "code", description: "Represents a line of code" },
|
|
82
|
+
{ value: "codefence", description: "Handles the display of code blocks if combined with a `code` variant" },
|
|
83
|
+
{ value: "deleted", description: "Represents text that has been deleted" },
|
|
84
|
+
{ value: "em", description: "Marks text to stress emphasis" },
|
|
85
|
+
{ value: "inserted", description: "Represents a range of text that has been added to a document" },
|
|
86
|
+
{ value: "keyboard", description: "Represents a span of text denoting textual user input from a keyboard or voice input" },
|
|
87
|
+
{ value: "marked", description: "Represents text which is marked or highlighted for reference or notation" },
|
|
88
|
+
{ value: "mono", description: "Text using a mono style font family" },
|
|
89
|
+
{ value: "paragraph", description: "Represents a paragraph" },
|
|
90
|
+
{ value: "placeholder", description: "Text that is mostly used as the placeholder style in input controls" },
|
|
91
|
+
{ value: "sample", description: "Represents sample (or quoted) output from a computer program" },
|
|
92
|
+
{ value: "secondary", description: "Represents a bit dimmed secondary text" },
|
|
93
|
+
{ value: "small", description: "Represents side-comments and small print" },
|
|
94
|
+
{ value: "sub", description: "Specifies inline text as subscript" },
|
|
95
|
+
{ value: "strong", description: "Contents have strong importance" },
|
|
96
|
+
{ value: "subheading", description: "Indicates that the text is the subtitle in a heading" },
|
|
97
|
+
{ value: "subtitle", description: "Indicates that the text is the subtitle of some other content" },
|
|
98
|
+
{ value: "sup", description: "Specifies inline text as superscript" },
|
|
99
|
+
{ value: "tableheading", description: "Indicates that the text is a table heading" },
|
|
100
|
+
{ value: "title", description: "Indicates that the text is the title of some other content" },
|
|
101
|
+
{ value: "var", description: "Represents the name of a variable in a mathematical expression" },
|
|
102
|
+
];
|
|
103
|
+
const AbbreviationKeys = ["title"];
|
|
104
|
+
const InsertedKeys = ["cite", "dateTime"];
|
|
105
|
+
exports.VariantPropsKeys = [...AbbreviationKeys, ...InsertedKeys];
|
|
106
|
+
exports.Text = (0, react_1.forwardRef)(function Text(_a, forwardedRef) {
|
|
107
|
+
var { uid, variant, maxLines = 0, style, children, preserveLinebreaks, ellipses = true } = _a, variantSpecificProps = __rest(_a, ["uid", "variant", "maxLines", "style", "children", "preserveLinebreaks", "ellipses"]);
|
|
108
|
+
const innerRef = (0, react_2.useRef)(null);
|
|
109
|
+
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(innerRef, forwardedRef) : innerRef;
|
|
110
|
+
const Element = (0, react_2.useMemo)(() => {
|
|
111
|
+
if (!variant || !TextVariantElement[variant])
|
|
112
|
+
return "div"; //todo illesg, could be a span?
|
|
113
|
+
return TextVariantElement[variant];
|
|
114
|
+
}, [variant]);
|
|
115
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Element, Object.assign({}, variantSpecificProps, { ref: ref, className: (0, classnames_1.default)([
|
|
116
|
+
Text_module_scss_1.default.text,
|
|
117
|
+
Text_module_scss_1.default[variant || "default"],
|
|
118
|
+
{
|
|
119
|
+
[Text_module_scss_1.default.truncateOverflow]: maxLines > 0,
|
|
120
|
+
[Text_module_scss_1.default.preserveLinebreaks]: preserveLinebreaks,
|
|
121
|
+
[Text_module_scss_1.default.noEllipsis]: !ellipses,
|
|
122
|
+
},
|
|
123
|
+
]), style: Object.assign(Object.assign({}, style), (0, css_utils_1.getMaxLinesStyle)(maxLines)), children: children })) }));
|
|
124
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
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.textAreaComponentRenderer = exports.TextAreaMd = exports.resizeOptionsMd = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const TextArea_module_scss_1 = __importDefault(require("./TextArea.module.scss"));
|
|
9
|
+
const renderers_1 = require("@components-core/renderers");
|
|
10
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
11
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
12
|
+
const TextAreaNative_1 = require("./TextAreaNative");
|
|
13
|
+
const metadata_helpers_1 = require("@components/metadata-helpers");
|
|
14
|
+
const COMP = "TextArea";
|
|
15
|
+
exports.resizeOptionsMd = [
|
|
16
|
+
{ value: "undefined", description: "No resizing" },
|
|
17
|
+
{ value: "horizontal", description: "Can only resize horizontally" },
|
|
18
|
+
{ value: "vertical", description: "Can only resize vertically" },
|
|
19
|
+
{ value: "both", description: "Can resize in both dimensions" },
|
|
20
|
+
];
|
|
21
|
+
exports.TextAreaMd = (0, ComponentDefs_1.createMetadata)({
|
|
22
|
+
status: "experimental",
|
|
23
|
+
description: `\`${COMP}\` is a component that provides a multiline text input area.`,
|
|
24
|
+
props: {
|
|
25
|
+
enterSubmits: (0, ComponentDefs_1.d)(`This optional boolean property indicates whether pressing the \`Enter\` key on the ` +
|
|
26
|
+
`keyboard prompts the parent \`Form\` component to submit. The default value is is \`true\`.`),
|
|
27
|
+
escResets: (0, ComponentDefs_1.d)(`This boolean property indicates whether the ${COMP} contents should be reset when pressing ` +
|
|
28
|
+
`the ESC key.`),
|
|
29
|
+
maxRows: (0, ComponentDefs_1.d)(`This optional number property maximizes the number of lines the \`${COMP}\` can grow to.`),
|
|
30
|
+
minRows: (0, ComponentDefs_1.d)(`This optional number property indicates the minimum number of lines the \`${COMP}\` ` +
|
|
31
|
+
`has and specifies its size accordingly.`),
|
|
32
|
+
rows: (0, ComponentDefs_1.d)(`Specifies the number of lines or rows (and thus, its size) the component has.`),
|
|
33
|
+
autoSize: (0, ComponentDefs_1.d)(`If set to \`true\`, this boolean property enables the \`${COMP}\` to resize ` +
|
|
34
|
+
`automatically based on the number of lines inside it.`, null, "boolean", false),
|
|
35
|
+
placeholder: (0, metadata_helpers_1.dPlaceholder)(),
|
|
36
|
+
initialValue: (0, metadata_helpers_1.dInitialValue)(),
|
|
37
|
+
label: (0, metadata_helpers_1.dLabel)(),
|
|
38
|
+
labelPosition: (0, metadata_helpers_1.dLabelPosition)("top"),
|
|
39
|
+
labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
|
|
40
|
+
labelBreak: (0, metadata_helpers_1.dLabelBreak)(COMP),
|
|
41
|
+
maxLength: (0, metadata_helpers_1.dMaxLength)(),
|
|
42
|
+
autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
|
|
43
|
+
required: (0, metadata_helpers_1.dRequired)(),
|
|
44
|
+
readOnly: (0, metadata_helpers_1.dReadonly)(),
|
|
45
|
+
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
46
|
+
validationStatus: (0, metadata_helpers_1.dValidationStatus)(),
|
|
47
|
+
resize: (0, ComponentDefs_1.d)(`This optional property specifies in which dimensions can the \`TextArea\` ` +
|
|
48
|
+
`be resized by the user.`, exports.resizeOptionsMd),
|
|
49
|
+
},
|
|
50
|
+
events: {
|
|
51
|
+
gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
|
|
52
|
+
lostFocus: (0, metadata_helpers_1.dLostFocus)(COMP),
|
|
53
|
+
didChange: (0, metadata_helpers_1.dDidChange)(COMP),
|
|
54
|
+
},
|
|
55
|
+
apis: {
|
|
56
|
+
focus: (0, metadata_helpers_1.dFocus)(COMP),
|
|
57
|
+
value: (0, ComponentDefs_1.d)(`You can query the component's value. If no value is set, it will retrieve \`undefined\`.`),
|
|
58
|
+
setValue: (0, metadata_helpers_1.dSetValueApi)(),
|
|
59
|
+
},
|
|
60
|
+
themeVars: (0, themeVars_1.parseScssVar)(TextArea_module_scss_1.default.themeVars),
|
|
61
|
+
});
|
|
62
|
+
exports.textAreaComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextAreaMd, ({ node, extractValue, state, updateState, layoutCss, registerComponentApi, lookupEventHandler, }) => {
|
|
63
|
+
const initialValue = extractValue(node.props.initialValue);
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(TextAreaNative_1.TextArea, { value: state === null || state === void 0 ? void 0 : state.value, initialValue: initialValue, updateState: updateState, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue(node.props.placeholder), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), resize: node.props.resize, enterSubmits: extractValue.asOptionalBoolean(node.props.enterSubmits), escResets: extractValue.asOptionalBoolean(node.props.escResets), style: layoutCss, registerComponentApi: registerComponentApi, maxRows: extractValue.asOptionalNumber(node.props.maxRows), minRows: extractValue.asOptionalNumber(node.props.minRows), maxLength: extractValue.asOptionalNumber(node.props.maxLength), rows: extractValue.asOptionalNumber(node.props.rows), autoSize: extractValue.asOptionalBoolean(node.props.autoSize), validationStatus: extractValue(node.props.validationStatus), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required) }, `${node.uid}-${initialValue}`));
|
|
65
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
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.TextArea = exports.resizeOptionKeys = void 0;
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const TextArea_module_scss_1 = __importDefault(require("./TextArea.module.scss"));
|
|
43
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
44
|
+
const constants_1 = require("@components-core/constants");
|
|
45
|
+
const TextAreaResizable_1 = __importDefault(require("./TextAreaResizable"));
|
|
46
|
+
const react_textarea_autosize_1 = __importDefault(require("react-textarea-autosize"));
|
|
47
|
+
const lodash_es_1 = require("lodash-es");
|
|
48
|
+
const misc_1 = require("@components-core/utils/misc");
|
|
49
|
+
const ItemWithLabel_1 = require("@components/FormItem/ItemWithLabel");
|
|
50
|
+
exports.resizeOptionKeys = ["horizontal", "vertical", "both"];
|
|
51
|
+
const resizeMap = {
|
|
52
|
+
horizontal: TextArea_module_scss_1.default.resizeHorizontal,
|
|
53
|
+
vertical: TextArea_module_scss_1.default.resizeVertical,
|
|
54
|
+
both: TextArea_module_scss_1.default.resizeBoth,
|
|
55
|
+
};
|
|
56
|
+
exports.TextArea = (0, react_1.forwardRef)(function TextArea({ id, value = "", placeholder = "", required = false, readOnly = false, allowCopy = true, updateState = constants_1.noop, validationStatus, autoFocus = false, initialValue = "", resize, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, controlled = true, enterSubmits = true, escResets, style, registerComponentApi, autoSize, maxRows, minRows, maxLength, rows = 2, enabled = true, label, labelPosition, labelWidth, labelBreak, }, forwardedRef) {
|
|
57
|
+
// --- The component is initially unfocused
|
|
58
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
59
|
+
const [cursorPosition, setCursorPosition] = (0, react_1.useState)(null);
|
|
60
|
+
const [focused, setFocused] = react_1.default.useState(false);
|
|
61
|
+
const updateValue = (0, react_1.useCallback)((value) => {
|
|
62
|
+
updateState({ value: value });
|
|
63
|
+
onDidChange(value);
|
|
64
|
+
}, [onDidChange, updateState]);
|
|
65
|
+
const onInputChange = (0, react_1.useCallback)((event) => {
|
|
66
|
+
updateValue(event.target.value);
|
|
67
|
+
}, [updateValue]);
|
|
68
|
+
(0, react_1.useEffect)(() => {
|
|
69
|
+
updateState({ value: initialValue }, { initial: true });
|
|
70
|
+
}, [initialValue, updateState]);
|
|
71
|
+
// --- Execute this function when the user copies the value
|
|
72
|
+
const handleCopy = (event) => {
|
|
73
|
+
if (allowCopy) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
// --- Manage obtaining and losing the focus
|
|
82
|
+
const handleOnFocus = () => {
|
|
83
|
+
setFocused(true);
|
|
84
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
85
|
+
};
|
|
86
|
+
const handleOnBlur = () => {
|
|
87
|
+
setFocused(false);
|
|
88
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
89
|
+
};
|
|
90
|
+
const focus = (0, react_1.useCallback)(() => {
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
var _a;
|
|
93
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
94
|
+
}, 0);
|
|
95
|
+
}, []);
|
|
96
|
+
const insert = (0, react_1.useCallback)((text) => {
|
|
97
|
+
const input = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current;
|
|
98
|
+
if (input && text) {
|
|
99
|
+
const start = input.selectionStart;
|
|
100
|
+
const value = input.value;
|
|
101
|
+
onInputChange({
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
target: {
|
|
104
|
+
value: value.substring(0, start) + text + value.substring(start),
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
setCursorPosition(start + text.length);
|
|
108
|
+
}
|
|
109
|
+
}, [inputRef, onInputChange]);
|
|
110
|
+
const setValue = (0, misc_1.useEvent)((val) => {
|
|
111
|
+
updateValue(val);
|
|
112
|
+
});
|
|
113
|
+
(0, react_1.useEffect)(() => {
|
|
114
|
+
if (cursorPosition) {
|
|
115
|
+
const input = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current;
|
|
116
|
+
if (input) {
|
|
117
|
+
input.setSelectionRange(cursorPosition, cursorPosition);
|
|
118
|
+
setCursorPosition(null);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, [value, cursorPosition, inputRef]);
|
|
122
|
+
(0, react_1.useEffect)(() => {
|
|
123
|
+
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
124
|
+
focus,
|
|
125
|
+
insert,
|
|
126
|
+
setValue,
|
|
127
|
+
});
|
|
128
|
+
}, [focus, insert, registerComponentApi, setValue]);
|
|
129
|
+
// --- Handle the Enter key press
|
|
130
|
+
const handleEnter = (0, react_1.useCallback)((e) => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
if (e.currentTarget.form && enterSubmits && e.key.toLowerCase() === "enter" && !e.shiftKey) {
|
|
133
|
+
// -- Do not generate a new line
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
(_a = e.currentTarget.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
|
|
136
|
+
}
|
|
137
|
+
if (e.currentTarget.form && escResets && e.key.toLowerCase() === "escape" && !e.shiftKey) {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
(_b = e.currentTarget.form) === null || _b === void 0 ? void 0 : _b.reset();
|
|
140
|
+
}
|
|
141
|
+
}, [enterSubmits, escResets]);
|
|
142
|
+
const textareaProps = {
|
|
143
|
+
className: (0, classnames_1.default)(TextArea_module_scss_1.default.textarea, resize ? resizeMap[resize] : "", {
|
|
144
|
+
[TextArea_module_scss_1.default.focused]: focused,
|
|
145
|
+
[TextArea_module_scss_1.default.disabled]: !enabled,
|
|
146
|
+
[TextArea_module_scss_1.default.error]: validationStatus === "error",
|
|
147
|
+
[TextArea_module_scss_1.default.warning]: validationStatus === "warning",
|
|
148
|
+
[TextArea_module_scss_1.default.valid]: validationStatus === "valid",
|
|
149
|
+
}),
|
|
150
|
+
ref: inputRef,
|
|
151
|
+
style: style,
|
|
152
|
+
value: controlled ? value || "" : undefined,
|
|
153
|
+
disabled: !enabled,
|
|
154
|
+
autoFocus,
|
|
155
|
+
name: id,
|
|
156
|
+
placeholder,
|
|
157
|
+
required,
|
|
158
|
+
maxLength,
|
|
159
|
+
"aria-multiline": true,
|
|
160
|
+
"aria-readonly": readOnly,
|
|
161
|
+
readOnly: readOnly,
|
|
162
|
+
onChange: onInputChange,
|
|
163
|
+
onCopy: handleCopy,
|
|
164
|
+
onFocus: handleOnFocus,
|
|
165
|
+
onBlur: handleOnBlur,
|
|
166
|
+
onKeyDown: handleEnter,
|
|
167
|
+
autoComplete: "off",
|
|
168
|
+
};
|
|
169
|
+
if (resize === "both" || resize === "horizontal" || resize === "vertical") {
|
|
170
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(TextAreaResizable_1.default, Object.assign({}, textareaProps, { style: style, maxRows: maxRows, minRows: minRows, rows: rows })) }));
|
|
171
|
+
}
|
|
172
|
+
if (autoSize || !(0, lodash_es_1.isNil)(maxRows) || !(0, lodash_es_1.isNil)(minRows)) {
|
|
173
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(react_textarea_autosize_1.default, Object.assign({}, textareaProps, { style: style, maxRows: maxRows, minRows: minRows, rows: rows })) }));
|
|
174
|
+
}
|
|
175
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)("textarea", Object.assign({}, textareaProps, { rows: rows })) }));
|
|
176
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
48
|
+
const React = __importStar(require("react"));
|
|
49
|
+
const react_1 = require("react");
|
|
50
|
+
const useComposedRef_1 = require("./useComposedRef");
|
|
51
|
+
const noop = () => { };
|
|
52
|
+
const TextAreaResizable = (_a, userRef) => {
|
|
53
|
+
var { maxRows, minRows, onChange = noop, style } = _a, props = __rest(_a, ["maxRows", "minRows", "onChange", "style"]);
|
|
54
|
+
const libRef = (0, react_1.useRef)(null);
|
|
55
|
+
const ref = (0, useComposedRef_1.useComposedRef)(libRef, userRef);
|
|
56
|
+
const [minCompHeight, setMinCompHeight] = React.useState();
|
|
57
|
+
const [maxCompHeight, setMaxCompHeight] = React.useState();
|
|
58
|
+
(0, react_1.useEffect)(() => {
|
|
59
|
+
if (!libRef.current)
|
|
60
|
+
return;
|
|
61
|
+
// --- Simple get the physical sizes of the component...
|
|
62
|
+
const style = getComputedStyle(libRef.current);
|
|
63
|
+
const lineHeight = parseFloat(style.lineHeight);
|
|
64
|
+
const paddingSize = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
|
|
65
|
+
const borderSize = parseFloat(style.borderTop) + parseFloat(style.borderBottom);
|
|
66
|
+
const extraSize = (style.boxSizing === "border-box" ? borderSize : 0) + paddingSize;
|
|
67
|
+
// --- ... and calculate the min and max heights based on the line height
|
|
68
|
+
setMinCompHeight(lineHeight * (minRows !== null && minRows !== void 0 ? minRows : 1) + extraSize);
|
|
69
|
+
setMaxCompHeight(lineHeight * (maxRows !== null && maxRows !== void 0 ? maxRows : 10000) + extraSize);
|
|
70
|
+
}, [libRef.current, maxRows, minRows]);
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)("textarea", Object.assign({ ref: ref }, props, { onChange: onChange, style: Object.assign(Object.assign({}, style), { minHeight: minCompHeight, maxHeight: maxCompHeight }) })));
|
|
72
|
+
};
|
|
73
|
+
exports.default = React.forwardRef(TextAreaResizable);
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.useComposedRef = void 0;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const updateRef = (ref, value) => {
|
|
39
|
+
if (typeof ref === 'function') {
|
|
40
|
+
ref(value);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
;
|
|
44
|
+
ref.current = value;
|
|
45
|
+
};
|
|
46
|
+
const useComposedRef = (libRef, userRef) => {
|
|
47
|
+
const prevUserRef = React.useRef();
|
|
48
|
+
return React.useCallback((instance) => {
|
|
49
|
+
libRef.current = instance;
|
|
50
|
+
if (prevUserRef.current) {
|
|
51
|
+
updateRef(prevUserRef.current, null);
|
|
52
|
+
}
|
|
53
|
+
prevUserRef.current = userRef;
|
|
54
|
+
if (!userRef) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
updateRef(userRef, instance);
|
|
58
|
+
}, [userRef]);
|
|
59
|
+
};
|
|
60
|
+
exports.useComposedRef = useComposedRef;
|