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.
Files changed (392) hide show
  1. package/dist/{apiInterceptorWorker-BuZoKCP8.mjs → apiInterceptorWorker-yKpXImCG.mjs} +1 -1
  2. package/dist/{index-C8kHu1Bs.mjs → index-XNGGyvQ0.mjs} +9904 -9653
  3. package/dist/index.css +1 -1
  4. package/dist/scripts/bin/build.js +17 -7
  5. package/dist/scripts/bin/vite-ueml-plugin.js +17 -7
  6. package/dist/scripts/bin/viteConfig.js +17 -7
  7. package/dist/scripts/package.json +209 -0
  8. package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +51 -0
  9. package/dist/scripts/src/components/APICall/APICall.js +74 -0
  10. package/dist/scripts/src/components/APICall/APICallNative.js +31 -0
  11. package/dist/scripts/src/components/Accordion/Accordion.js +78 -0
  12. package/dist/scripts/src/components/Accordion/AccordionContext.js +20 -0
  13. package/dist/scripts/src/components/Accordion/AccordionItem.js +28 -0
  14. package/dist/scripts/src/components/Accordion/AccordionItemNative.js +79 -0
  15. package/dist/scripts/src/components/Accordion/AccordionNative.js +122 -0
  16. package/dist/scripts/src/components/Alert/Alert.js +42 -0
  17. package/dist/scripts/src/components/Alert/AlertNative.js +8 -0
  18. package/dist/scripts/src/components/Animation/Animation.js +59 -0
  19. package/dist/scripts/src/components/Animation/AnimationNative.js +75 -0
  20. package/dist/scripts/src/components/App/App.js +76 -0
  21. package/dist/scripts/src/components/App/AppLayoutContext.js +49 -0
  22. package/dist/scripts/src/components/App/AppNative.js +204 -0
  23. package/dist/scripts/src/components/App/AppStateContext.js +9 -0
  24. package/dist/scripts/src/components/App/Sheet.js +99 -0
  25. package/dist/scripts/src/components/AppHeader/AppHeader.js +59 -0
  26. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +58 -0
  27. package/dist/scripts/src/components/AppState/AppState.js +26 -0
  28. package/dist/scripts/src/components/AppState/AppStateNative.js +24 -0
  29. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +83 -0
  30. package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +16 -0
  31. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +225 -0
  32. package/dist/scripts/src/components/Avatar/Avatar.js +47 -0
  33. package/dist/scripts/src/components/Avatar/AvatarNative.js +40 -0
  34. package/dist/scripts/src/components/Backdrop/Backdrop.js +31 -0
  35. package/dist/scripts/src/components/Backdrop/BackdropNative.js +14 -0
  36. package/dist/scripts/src/components/Badge/Badge.js +58 -0
  37. package/dist/scripts/src/components/Badge/BadgeNative.js +22 -0
  38. package/dist/scripts/src/components/BarChart/BarChart.js +49 -0
  39. package/dist/scripts/src/components/BarChart/BarChartNative.js +176 -0
  40. package/dist/scripts/src/components/Bookmark/Bookmark.js +23 -0
  41. package/dist/scripts/src/components/Bookmark/BookmarkNative.js +24 -0
  42. package/dist/scripts/src/components/Breakout/Breakout.js +16 -0
  43. package/dist/scripts/src/components/Breakout/BreakoutNative.js +12 -0
  44. package/dist/scripts/src/components/Button/Button.js +142 -0
  45. package/dist/scripts/src/components/Button/ButtonNative.js +88 -0
  46. package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +41 -0
  47. package/dist/scripts/src/components/ButtonGroup/ButtonGroupNative.js +8 -0
  48. package/dist/scripts/src/components/Card/Card.js +57 -0
  49. package/dist/scripts/src/components/Card/CardNative.js +26 -0
  50. package/dist/scripts/src/components/Carousel/Carousel.js +68 -0
  51. package/dist/scripts/src/components/Carousel/CarouselItem.js +16 -0
  52. package/dist/scripts/src/components/Carousel/CarouselItemNative.js +13 -0
  53. package/dist/scripts/src/components/Carousel/CarouselNative.js +163 -0
  54. package/dist/scripts/src/components/ChangeListener/ChangeListener.js +24 -0
  55. package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +26 -0
  56. package/dist/scripts/src/components/Chart/Chart.js +24 -0
  57. package/dist/scripts/src/components/Chart/ChartNative.js +165 -0
  58. package/dist/scripts/src/components/Checkbox/Checkbox.js +68 -0
  59. package/dist/scripts/src/components/Column/Column.js +34 -0
  60. package/dist/scripts/src/components/Column/ColumnNative.js +38 -0
  61. package/dist/scripts/src/components/Column/TableContext.js +12 -0
  62. package/dist/scripts/src/components/ComponentProvider.js +503 -0
  63. package/dist/scripts/src/components/ComponentRegistryContext.js +44 -0
  64. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +38 -0
  65. package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +16 -0
  66. package/dist/scripts/src/components/DatePicker/DatePicker.js +62 -0
  67. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +196 -0
  68. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +125 -0
  69. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +95 -0
  70. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +26 -0
  71. package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +52 -0
  72. package/dist/scripts/src/components/FileInput/FileInput.js +64 -0
  73. package/dist/scripts/src/components/FileInput/FileInputNative.js +128 -0
  74. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +46 -0
  75. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +112 -0
  76. package/dist/scripts/src/components/FlowLayout/FlowLayout.js +53 -0
  77. package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +108 -0
  78. package/dist/scripts/src/components/Footer/Footer.js +35 -0
  79. package/dist/scripts/src/components/Footer/FooterNative.js +20 -0
  80. package/dist/scripts/src/components/Form/Form.js +89 -0
  81. package/dist/scripts/src/components/Form/FormContext.js +9 -0
  82. package/dist/scripts/src/components/Form/FormNative.js +317 -0
  83. package/dist/scripts/src/components/Form/formActions.js +114 -0
  84. package/dist/scripts/src/components/FormItem/FormItem.js +125 -0
  85. package/dist/scripts/src/components/FormItem/FormItemNative.js +157 -0
  86. package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
  87. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +40 -0
  88. package/dist/scripts/src/components/FormItem/Validations.js +351 -0
  89. package/dist/scripts/src/components/FormSection/FormSection.js +41 -0
  90. package/dist/scripts/src/components/Heading/Heading.js +258 -0
  91. package/dist/scripts/src/components/Heading/HeadingNative.js +45 -0
  92. package/dist/scripts/src/components/HoverCard/HoverCard.js +19 -0
  93. package/dist/scripts/src/components/HoverCard/HovercardNative.js +44 -0
  94. package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
  95. package/dist/scripts/src/components/Icon/Attach.js +10 -0
  96. package/dist/scripts/src/components/Icon/Binding.js +11 -0
  97. package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
  98. package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
  99. package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
  100. package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
  101. package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
  102. package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
  103. package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
  104. package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
  105. package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
  106. package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
  107. package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
  108. package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
  109. package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
  110. package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
  111. package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
  112. package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
  113. package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
  114. package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
  115. package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
  116. package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
  117. package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
  118. package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
  119. package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
  120. package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
  121. package/dist/scripts/src/components/Icon/Icon.js +32 -0
  122. package/dist/scripts/src/components/Icon/IconNative.js +102 -0
  123. package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
  124. package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
  125. package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
  126. package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
  127. package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
  128. package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
  129. package/dist/scripts/src/components/Icon/NoSortIcon.js +8 -0
  130. package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
  131. package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
  132. package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
  133. package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
  134. package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
  135. package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
  136. package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
  137. package/dist/scripts/src/components/Icon/SortAscendingIcon.js +8 -0
  138. package/dist/scripts/src/components/Icon/SortDescendingIcon.js +8 -0
  139. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  140. package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
  141. package/dist/scripts/src/components/Icon/TrendingDownIcon.js +10 -0
  142. package/dist/scripts/src/components/Icon/TrendingLevelIcon.js +10 -0
  143. package/dist/scripts/src/components/Icon/TrendingUpIcon.js +10 -0
  144. package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
  145. package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
  146. package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
  147. package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
  148. package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
  149. package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
  150. package/dist/scripts/src/components/IconInfoCard/IconInfoCard.js +39 -0
  151. package/dist/scripts/src/components/IconProvider.js +264 -0
  152. package/dist/scripts/src/components/IconRegistryContext.js +317 -0
  153. package/dist/scripts/src/components/Image/Image.js +35 -0
  154. package/dist/scripts/src/components/Image/ImageNative.js +15 -0
  155. package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
  156. package/dist/scripts/src/components/Items/Items.js +33 -0
  157. package/dist/scripts/src/components/Items/ItemsNative.js +29 -0
  158. package/dist/scripts/src/components/Link/Link.js +64 -0
  159. package/dist/scripts/src/components/Link/LinkNative.js +26 -0
  160. package/dist/scripts/src/components/List/List.js +81 -0
  161. package/dist/scripts/src/components/List/ListNative.js +425 -0
  162. package/dist/scripts/src/components/Logo/Logo.js +16 -0
  163. package/dist/scripts/src/components/Logo/LogoNative.js +15 -0
  164. package/dist/scripts/src/components/Map/Map.js +75 -0
  165. package/dist/scripts/src/components/Map/world_countries.json +45307 -0
  166. package/dist/scripts/src/components/Markdown/Markdown.js +45 -0
  167. package/dist/scripts/src/components/Markdown/MarkdownNative.js +107 -0
  168. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
  169. package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
  170. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +64 -0
  171. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +167 -0
  172. package/dist/scripts/src/components/ModalDialog/ModalVisibilityContext.js +60 -0
  173. package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -0
  174. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +91 -0
  175. package/dist/scripts/src/components/NavLink/NavLink.js +71 -0
  176. package/dist/scripts/src/components/NavLink/NavLinkNative.js +61 -0
  177. package/dist/scripts/src/components/NavPanel/NavPanel.js +31 -0
  178. package/dist/scripts/src/components/NavPanel/NavPanelNative.js +74 -0
  179. package/dist/scripts/src/components/NoResult/NoResult.js +38 -0
  180. package/dist/scripts/src/components/NoResult/NoResultNative.js +13 -0
  181. package/dist/scripts/src/components/NumberBox/NumberBox.js +61 -0
  182. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +337 -0
  183. package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +74 -0
  184. package/dist/scripts/src/components/OffCanvas/OffCanvas.js +57 -0
  185. package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +48 -0
  186. package/dist/scripts/src/components/Option/Option.js +33 -0
  187. package/dist/scripts/src/components/Option/OptionTypeProvider.js +16 -0
  188. package/dist/scripts/src/components/PageHeader/PageHeader.js +36 -0
  189. package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +9 -0
  190. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +18 -0
  191. package/dist/scripts/src/components/Pages/Pages.js +33 -0
  192. package/dist/scripts/src/components/Pages/PagesNative.js +69 -0
  193. package/dist/scripts/src/components/PieChart/PieChart.js +45 -0
  194. package/dist/scripts/src/components/PieChart/PieChartNative.js +165 -0
  195. package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +24 -0
  196. package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +14 -0
  197. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +36 -0
  198. package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +12 -0
  199. package/dist/scripts/src/components/Queue/Queue.js +71 -0
  200. package/dist/scripts/src/components/Queue/QueueNative.js +278 -0
  201. package/dist/scripts/src/components/Queue/queueActions.js +87 -0
  202. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +68 -0
  203. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +104 -0
  204. package/dist/scripts/src/components/Range/Range.js +56 -0
  205. package/dist/scripts/src/components/Range/RangeNative.js +8 -0
  206. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +21 -0
  207. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +131 -0
  208. package/dist/scripts/src/components/Redirect/Redirect.js +20 -0
  209. package/dist/scripts/src/components/Select/OptionContext.js +12 -0
  210. package/dist/scripts/src/components/Select/Select.js +98 -0
  211. package/dist/scripts/src/components/Select/SelectContext.js +9 -0
  212. package/dist/scripts/src/components/Select/SelectNative.js +214 -0
  213. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +22 -0
  214. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +94 -0
  215. package/dist/scripts/src/components/Slider/Slider.js +54 -0
  216. package/dist/scripts/src/components/Slider/SliderNative.js +8 -0
  217. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +19 -0
  218. package/dist/scripts/src/components/SpaceFiller/SpaceFillerNative.js +10 -0
  219. package/dist/scripts/src/components/Spinner/Spinner.js +42 -0
  220. package/dist/scripts/src/components/Spinner/SpinnerNative.js +31 -0
  221. package/dist/scripts/src/components/Splitter/Splitter.js +89 -0
  222. package/dist/scripts/src/components/Splitter/SplitterNative.js +159 -0
  223. package/dist/scripts/src/components/Splitter/utils.js +17 -0
  224. package/dist/scripts/src/components/Stack/Stack.js +110 -0
  225. package/dist/scripts/src/components/Stack/StackNative.js +39 -0
  226. package/dist/scripts/src/components/StateViewer/StateViewerNative.js +19 -0
  227. package/dist/scripts/src/components/StickyBox/StickyBox.js +30 -0
  228. package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +15 -0
  229. package/dist/scripts/src/components/Switch/Switch.js +72 -0
  230. package/dist/scripts/src/components/Table/Table.js +184 -0
  231. package/dist/scripts/src/components/Table/TableNative.js +470 -0
  232. package/dist/scripts/src/components/Table/useRowSelection.js +245 -0
  233. package/dist/scripts/src/components/TableHeader/TableHeader.js +34 -0
  234. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +74 -0
  235. package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +55 -0
  236. package/dist/scripts/src/components/Tabs/TabContext.js +45 -0
  237. package/dist/scripts/src/components/Tabs/TabItem.js +20 -0
  238. package/dist/scripts/src/components/Tabs/TabItemNative.js +24 -0
  239. package/dist/scripts/src/components/Tabs/Tabs.js +55 -0
  240. package/dist/scripts/src/components/Tabs/TabsNative.js +72 -0
  241. package/dist/scripts/src/components/Text/Text.js +122 -0
  242. package/dist/scripts/src/components/Text/TextNative.js +124 -0
  243. package/dist/scripts/src/components/TextArea/TextArea.js +65 -0
  244. package/dist/scripts/src/components/TextArea/TextAreaNative.js +176 -0
  245. package/dist/scripts/src/components/TextArea/TextAreaResizable.js +73 -0
  246. package/dist/scripts/src/components/TextArea/useComposedRef.js +60 -0
  247. package/dist/scripts/src/components/TextBox/TextBox.js +85 -0
  248. package/dist/scripts/src/components/TextBox/TextBoxNative.js +109 -0
  249. package/dist/scripts/src/components/Theme/NotificationToast.js +50 -0
  250. package/dist/scripts/src/components/Theme/Theme.js +43 -0
  251. package/dist/scripts/src/components/Theme/ThemeNative.js +126 -0
  252. package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +115 -0
  253. package/dist/scripts/src/components/ThemeChanger/ToneChangerButton.js +28 -0
  254. package/dist/scripts/src/components/Toggle/Toggle.js +99 -0
  255. package/dist/scripts/src/components/Toolbar/Toolbar.js +32 -0
  256. package/dist/scripts/src/components/ToolbarButton/ToolbarButton.js +38 -0
  257. package/dist/scripts/src/components/Tree/TreeComponent.js +32 -0
  258. package/dist/scripts/src/components/Tree/TreeNative.js +69 -0
  259. package/dist/scripts/src/components/TrendLabel/TrendLabel.js +37 -0
  260. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
  261. package/dist/scripts/src/components/abstractions.js +151 -0
  262. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  263. package/dist/scripts/src/components/component-utils.js +17 -0
  264. package/dist/scripts/src/components/container-helpers.js +25 -0
  265. package/dist/scripts/src/components/metadata-helpers.js +245 -0
  266. package/dist/scripts/src/components/slot-helpers.js +22 -0
  267. package/dist/scripts/src/components-core/ApiBoundComponent.js +194 -0
  268. package/dist/scripts/src/components-core/AppContext.js +16 -0
  269. package/dist/scripts/src/components-core/AppRoot.js +424 -0
  270. package/dist/scripts/src/components-core/ComponentBed.js +325 -0
  271. package/dist/scripts/src/components-core/ComponentDecorator.js +90 -0
  272. package/dist/scripts/src/components-core/CompoundComponent.js +144 -0
  273. package/dist/scripts/src/components-core/DebugViewProvider.js +43 -0
  274. package/dist/scripts/src/components-core/EngineError.js +91 -0
  275. package/dist/scripts/src/components-core/ErrorBoundary.js +59 -0
  276. package/dist/scripts/src/components-core/Fragment.js +15 -0
  277. package/dist/scripts/src/components-core/InspectorContext.js +176 -0
  278. package/dist/scripts/src/components-core/InvalidComponent.js +17 -0
  279. package/dist/scripts/src/components-core/LoaderComponent.js +92 -0
  280. package/dist/scripts/src/components-core/RestApiProxy.js +354 -0
  281. package/dist/scripts/src/components-core/ScrollContext.js +11 -0
  282. package/dist/scripts/src/components-core/Slot.js +17 -0
  283. package/dist/scripts/src/components-core/StandaloneApp.js +589 -0
  284. package/dist/scripts/src/components-core/StandaloneComponentManager.js +51 -0
  285. package/dist/scripts/src/components-core/TableOfContentsContext.js +110 -0
  286. package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
  287. package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +110 -0
  288. package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
  289. package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
  290. package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
  291. package/dist/scripts/src/components-core/abstractions/standalone.js +2 -0
  292. package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
  293. package/dist/scripts/src/components-core/action/APICall.js +283 -0
  294. package/dist/scripts/src/components-core/action/FileDownloadAction.js +80 -0
  295. package/dist/scripts/src/components-core/action/FileUploadAction.js +88 -0
  296. package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
  297. package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
  298. package/dist/scripts/src/components-core/action/actions.js +15 -0
  299. package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
  300. package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
  301. package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
  302. package/dist/scripts/src/components-core/component-hooks.js +25 -0
  303. package/dist/scripts/src/components-core/constants.js +18 -0
  304. package/dist/scripts/src/components-core/container/Container.js +1241 -0
  305. package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
  306. package/dist/scripts/src/components-core/container/collectFnVarDeps.js +49 -0
  307. package/dist/scripts/src/components-core/container/valueExtractor.js +205 -0
  308. package/dist/scripts/src/components-core/descriptorHelper.js +72 -0
  309. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +198 -0
  310. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
  311. package/dist/scripts/src/components-core/interception/Backend.js +129 -0
  312. package/dist/scripts/src/components-core/interception/Errors.js +129 -0
  313. package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
  314. package/dist/scripts/src/components-core/interception/IndexedDb.js +205 -0
  315. package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
  316. package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
  317. package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
  318. package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
  319. package/dist/scripts/src/components-core/loader/ApiLoader.js +54 -0
  320. package/dist/scripts/src/components-core/loader/DataLoader.js +149 -0
  321. package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +62 -0
  322. package/dist/scripts/src/components-core/loader/Loader.js +126 -0
  323. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +40 -0
  324. package/dist/scripts/src/components-core/loader/PageableLoader.js +262 -0
  325. package/dist/scripts/src/components-core/markup-check.js +279 -0
  326. package/dist/scripts/src/components-core/renderers.js +45 -0
  327. package/dist/scripts/src/components-core/reportEngineError.js +62 -0
  328. package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
  329. package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
  330. package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
  331. package/dist/scripts/src/components-core/script-runner/asyncProxy.js +149 -0
  332. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
  333. package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
  334. package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
  335. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +593 -0
  336. package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +497 -0
  337. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +482 -0
  338. package/dist/scripts/src/components-core/script-runner/process-statement-async.js +766 -0
  339. package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
  340. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +752 -0
  341. package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
  342. package/dist/scripts/src/components-core/script-runner/syncProxy.js +31 -0
  343. package/dist/scripts/src/components-core/script-runner/visitors.js +361 -0
  344. package/dist/scripts/src/components-core/theming/ThemeContext.js +53 -0
  345. package/dist/scripts/src/components-core/theming/ThemeProvider.js +335 -0
  346. package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
  347. package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
  348. package/dist/scripts/src/components-core/theming/hvar.js +105 -0
  349. package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
  350. package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
  351. package/dist/scripts/src/components-core/theming/themes/palette.js +55 -0
  352. package/dist/scripts/src/components-core/theming/themes/root.js +287 -0
  353. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  354. package/dist/scripts/src/components-core/theming/themes/theme-colors.js +561 -0
  355. package/dist/scripts/src/components-core/theming/themes/xmlui.js +58 -0
  356. package/dist/scripts/src/components-core/theming/transformThemeVars.js +300 -0
  357. package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +35 -0
  358. package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
  359. package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
  360. package/dist/scripts/src/components-core/utils/classnames.js +58 -0
  361. package/dist/scripts/src/components-core/utils/compound-utils.js +11 -0
  362. package/dist/scripts/src/components-core/utils/css-utils.js +163 -0
  363. package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
  364. package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
  365. package/dist/scripts/src/components-core/utils/hooks.js +249 -0
  366. package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
  367. package/dist/scripts/src/components-core/utils/misc.js +472 -0
  368. package/dist/scripts/src/components-core/utils/request-params.js +70 -0
  369. package/dist/scripts/src/components-core/utils/statementUtils.js +221 -0
  370. package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
  371. package/dist/scripts/src/index.js +69 -0
  372. package/dist/scripts/src/parsers/common/GenericToken.js +2 -0
  373. package/dist/scripts/src/parsers/scripting-exp/TokenType.js +112 -0
  374. package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
  375. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +623 -0
  376. package/dist/scripts/src/parsers/style-parser/StyleParser.js +1036 -0
  377. package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
  378. package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
  379. package/dist/scripts/src/parsers/style-parser/style-compiler.js +558 -0
  380. package/dist/scripts/src/parsers/style-parser/tokens.js +43 -0
  381. package/dist/scripts/src/parsers/xmlui-parser/ParserError.js +7 -0
  382. package/dist/scripts/src/parsers/xmlui-parser/transform.js +80 -32
  383. package/dist/scripts/src/syntax/grammar.tmLanguage.json +328 -0
  384. package/dist/scripts/src/syntax/textMate/xmlui.json +630 -0
  385. package/dist/style.css +1 -1
  386. package/dist/xmlui-metadata.mjs +2676 -2608
  387. package/dist/xmlui-metadata.umd.js +16 -16
  388. package/dist/xmlui-standalone.umd.js +186 -186
  389. package/dist/xmlui.d.ts +1868 -13
  390. package/dist/xmlui.mjs +1 -1
  391. package/package.json +5 -5
  392. package/dist/xmlui.umd.js +0 -293
@@ -0,0 +1,163 @@
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.useScrollbarWidth = exports.getStyleObjectFromString = void 0;
7
+ exports.kebabCase = kebabCase;
8
+ exports.toStyleString = toStyleString;
9
+ exports.normalizeCssValueForCalc = normalizeCssValueForCalc;
10
+ exports.getColor = getColor;
11
+ exports.getColors = getColors;
12
+ exports.getMaxLinesStyle = getMaxLinesStyle;
13
+ exports.getSizeString = getSizeString;
14
+ const react_1 = require("react");
15
+ const color_1 = __importDefault(require("color"));
16
+ const themeVars_1 = require("@components-core/theming/themeVars");
17
+ const constants_1 = require("@components-core/constants");
18
+ /**
19
+ * Converts a string to its kebab-case representation
20
+ * @param str Input string
21
+ * @returns Kebab-case representation
22
+ */
23
+ function kebabCase(str) {
24
+ return str.replace(/[A-Z]/g, (v) => `-${v.toLowerCase()}`);
25
+ }
26
+ /**
27
+ * Converts the set of style properties to a string
28
+ * @param style Style properties
29
+ * @returns Style string representation
30
+ */
31
+ function toStyleString(style) {
32
+ return Object.keys(style).reduce((accumulator, key) => {
33
+ // remove ' in value
34
+ const cssValue = style[key].toString().replace("'", "");
35
+ // build the result
36
+ // you can break the line, add indent for it if you need
37
+ return `${accumulator}${key}:${cssValue};`;
38
+ }, "");
39
+ }
40
+ const formatStringToCamelCase = (str) => {
41
+ const splitted = str.split("-");
42
+ if (splitted.length === 1)
43
+ return splitted[0];
44
+ return (splitted[0] +
45
+ splitted
46
+ .slice(1)
47
+ .map((word) => word[0].toUpperCase() + word.slice(1))
48
+ .join(""));
49
+ };
50
+ const getStyleObjectFromString = (str) => {
51
+ const style = {};
52
+ str.split(";").forEach((el) => {
53
+ const [property, value] = el.split(":");
54
+ if (!property || !value)
55
+ return;
56
+ const formattedProperty = formatStringToCamelCase(property.trim());
57
+ // @ts-ignore
58
+ style[formattedProperty] = value.trim();
59
+ });
60
+ return style;
61
+ };
62
+ exports.getStyleObjectFromString = getStyleObjectFromString;
63
+ function normalizeCssValueForCalc(cssValue) {
64
+ // 1. number -> append "px"
65
+ if (typeof cssValue === "number")
66
+ return cssValue + "px";
67
+ // 2. string
68
+ const cssTrimmed = cssValue.trim();
69
+ if (cssTrimmed.startsWith("var(")) {
70
+ return cssTrimmed;
71
+ }
72
+ const value = parseFloat(cssTrimmed);
73
+ const valueStr = value.toString();
74
+ const unit = cssTrimmed.replace(valueStr, "");
75
+ // a) non-value -> "0px"
76
+ if (Number.isNaN(value))
77
+ return "0px";
78
+ // b) value without unit -> append "px"
79
+ if (unit === "")
80
+ return valueStr + "px";
81
+ // c) value with unit -> do nothing
82
+ return cssTrimmed;
83
+ }
84
+ function getColor(varName, format) {
85
+ const varValue = getComputedStyle(document.getElementById("_ui-engine-theme-root")).getPropertyValue((0, themeVars_1.getVarKey)(varName));
86
+ if (format === "hex") {
87
+ return (0, color_1.default)(varValue).hex().toString();
88
+ }
89
+ return (0, color_1.default)(varValue).toString();
90
+ }
91
+ function getColors(...colors) {
92
+ const ret = {};
93
+ for (const color of colors) {
94
+ if (typeof color === "string") {
95
+ ret[color] = getColor(color);
96
+ }
97
+ else {
98
+ ret[color.name] = getColor(color.name, color.format);
99
+ }
100
+ }
101
+ return ret;
102
+ }
103
+ function getMaxLinesStyle(maxLines) {
104
+ const _maxLines = maxLines && maxLines > 0 ? maxLines : 0;
105
+ const maxLinesStyles = _maxLines > 1
106
+ ? {
107
+ WebkitLineClamp: _maxLines,
108
+ lineClamp: _maxLines,
109
+ display: "-webkit-box",
110
+ WebkitBoxOrient: "vertical",
111
+ boxOrient: "vertical",
112
+ whiteSpace: "initial",
113
+ }
114
+ : constants_1.EMPTY_OBJECT;
115
+ return maxLinesStyles;
116
+ }
117
+ function getSizeString(size) {
118
+ if (typeof size === "number") {
119
+ return size + "px";
120
+ }
121
+ if (typeof size === "string" && /^\d+$/.test(size.trim())) {
122
+ const rowGapValue = parseInt(size, 10);
123
+ if (!isNaN(rowGapValue)) {
124
+ return rowGapValue + "px";
125
+ }
126
+ }
127
+ return size === null || size === void 0 ? void 0 : size.toString();
128
+ }
129
+ const useScrollbarWidth = () => {
130
+ const didCompute = (0, react_1.useRef)(false);
131
+ const widthRef = (0, react_1.useRef)(0);
132
+ (0, react_1.useEffect)(() => {
133
+ function handleResize() {
134
+ didCompute.current = false;
135
+ }
136
+ window.addEventListener("resize", handleResize);
137
+ return () => {
138
+ window.removeEventListener("resize", handleResize);
139
+ };
140
+ }, []);
141
+ if (didCompute.current)
142
+ return widthRef.current;
143
+ // Creating invisible container
144
+ if (typeof document === 'undefined') {
145
+ return 0;
146
+ }
147
+ const outer = document.createElement('div');
148
+ outer.style.visibility = 'hidden';
149
+ outer.style.overflow = 'scroll'; // forcing scrollbar to appear
150
+ document.body.appendChild(outer);
151
+ // Calculating difference between container's full width and the child width
152
+ const scrollbarWidth = outer.offsetWidth - outer.clientWidth;
153
+ // Removing temporary elements from the DOM
154
+ outer.parentNode.removeChild(outer);
155
+ didCompute.current = true;
156
+ widthRef.current = scrollbarWidth;
157
+ if (window.devicePixelRatio !== Math.round(window.devicePixelRatio)) {
158
+ //zoomed in a weird ratio, sometimes shows a horizontal scrollbar
159
+ widthRef.current = scrollbarWidth - 0.5;
160
+ }
161
+ return widthRef.current;
162
+ };
163
+ exports.useScrollbarWidth = useScrollbarWidth;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isoDateString = isoDateString;
4
+ exports.formatDate = formatDate;
5
+ exports.formatDateTime = formatDateTime;
6
+ exports.formatTime = formatTime;
7
+ exports.formatTimeWithoutSeconds = formatTimeWithoutSeconds;
8
+ exports.formatDateWithoutYear = formatDateWithoutYear;
9
+ exports.getDate = getDate;
10
+ exports.getDateUntilNow = getDateUntilNow;
11
+ exports.smartFormatDateTime = smartFormatDateTime;
12
+ exports.smartFormatDate = smartFormatDate;
13
+ exports.isDateToday = isDateToday;
14
+ exports.isDateYesterday = isDateYesterday;
15
+ exports.isDateTomorrow = isDateTomorrow;
16
+ const date_fns_1 = require("date-fns");
17
+ const misc_1 = require("@components-core/utils/misc");
18
+ function isoDateString(date) {
19
+ return (!date ? new Date() : new Date(date)).toJSON();
20
+ }
21
+ function formatDate(date) {
22
+ return new Date(date).toLocaleDateString();
23
+ }
24
+ function formatDateTime(date) {
25
+ return new Date(date).toLocaleString();
26
+ }
27
+ function formatTime(date) {
28
+ return new Date(date).toLocaleTimeString();
29
+ }
30
+ function formatTimeWithoutSeconds(date) {
31
+ return (0, date_fns_1.format)(new Date(date), "H:m");
32
+ }
33
+ function formatDateWithoutYear(date) {
34
+ return new Date(date).toLocaleDateString([], {
35
+ month: "numeric",
36
+ day: "2-digit"
37
+ });
38
+ }
39
+ function getDate(date) {
40
+ return date ? new Date(date) : new Date();
41
+ }
42
+ function getDateUntilNow(date, nowLabel, time) {
43
+ return date ? (0, misc_1.humanReadableDateTimeTillNow)(date, nowLabel, time) : "-";
44
+ }
45
+ function smartFormatDateTime(date) {
46
+ if (!date) {
47
+ return "-";
48
+ }
49
+ if ((0, date_fns_1.isToday)(new Date(date))) {
50
+ return new Date(date).toLocaleTimeString();
51
+ }
52
+ if ((0, date_fns_1.isThisWeek)(new Date(date))) {
53
+ return `${(0, date_fns_1.formatRelative)(new Date(date), new Date())}`;
54
+ }
55
+ return new Date(date).toLocaleString();
56
+ }
57
+ function smartFormatDate(date) {
58
+ if (!date) {
59
+ return "-";
60
+ }
61
+ //TODO we could use formatRelative when they implement this: https://github.com/date-fns/date-fns/issues/1218
62
+ if ((0, date_fns_1.isToday)(new Date(date))) {
63
+ return "Today";
64
+ }
65
+ if ((0, date_fns_1.isYesterday)(new Date(date))) {
66
+ return "Yesterday";
67
+ }
68
+ return new Date(date).toLocaleDateString();
69
+ }
70
+ function isDateToday(date) {
71
+ return (0, date_fns_1.isToday)(new Date(date));
72
+ }
73
+ function isDateYesterday(date) {
74
+ return (0, date_fns_1.isYesterday)(new Date(date));
75
+ }
76
+ function isDateTomorrow(date) {
77
+ return (0, date_fns_1.isTomorrow)(new Date(date));
78
+ }
@@ -0,0 +1,148 @@
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.extractParam = extractParam;
7
+ exports.withStableObjectReference = withStableObjectReference;
8
+ exports.shouldKeep = shouldKeep;
9
+ const react_1 = __importDefault(require("react"));
10
+ const lodash_es_1 = require("lodash-es");
11
+ const ParameterParser_1 = require("@components-core/script-runner/ParameterParser");
12
+ const eval_tree_sync_1 = require("@components-core/script-runner/eval-tree-sync");
13
+ const LruCache_1 = require("@components-core/utils/LruCache");
14
+ /**
15
+ * Extract the value of the specified parameter from the given view container state
16
+ * @param state The state of the view container
17
+ * @param param Parameter to extract
18
+ * @param appContext Application context to use
19
+ * @param strict Strict evaluation?
20
+ * @param extractContext
21
+ * @returns
22
+ */
23
+ function extractParam(state, param, appContext = undefined, strict = false, // --- In this case we only allow string binding expression
24
+ extractContext = { didResolve: false }) {
25
+ if (typeof param === "string") {
26
+ const paramSegments = (0, ParameterParser_1.parseParameterString)(param);
27
+ if (paramSegments.length === 0) {
28
+ // --- The param is an empty string, retrieve it
29
+ return param;
30
+ }
31
+ if (paramSegments.length === 1) {
32
+ // --- We have a single string literal or expression
33
+ if (paramSegments[0].type === "literal") {
34
+ // --- No expression to evaluate
35
+ return paramSegments[0].value;
36
+ }
37
+ else {
38
+ // --- We have a single expression to evaluate
39
+ extractContext.didResolve = true;
40
+ return (0, eval_tree_sync_1.evalBinding)(paramSegments[0].value, {
41
+ localContext: state,
42
+ appContext,
43
+ options: {
44
+ defaultToOptionalMemberAccess: true,
45
+ },
46
+ });
47
+ }
48
+ }
49
+ // --- At this point, we have multiple segments. Evaluate all expressions and convert them to strings
50
+ let result = "";
51
+ paramSegments.forEach((ps) => {
52
+ if (ps.type === "literal") {
53
+ result += ps.value;
54
+ }
55
+ else {
56
+ extractContext.didResolve = true;
57
+ const exprValue = (0, eval_tree_sync_1.evalBinding)(ps.value, {
58
+ localContext: state,
59
+ appContext,
60
+ options: {
61
+ defaultToOptionalMemberAccess: true,
62
+ },
63
+ });
64
+ if (exprValue === null) {
65
+ result += "null";
66
+ }
67
+ else if (exprValue === undefined) {
68
+ result += "undefined";
69
+ }
70
+ else if (exprValue === null || exprValue === void 0 ? void 0 : exprValue.toString) {
71
+ result += exprValue.toString();
72
+ }
73
+ }
74
+ });
75
+ return result;
76
+ }
77
+ if (strict) {
78
+ // --- As we allow only string parameters as binding expressions, we return with the provided
79
+ // --- *not string* parameter without transforming it
80
+ return param;
81
+ }
82
+ // --- Resolve each array item
83
+ if (Array.isArray(param)) {
84
+ const arrayExtractContext = { didResolve: false };
85
+ let resolvedChildren = param.map((childParam) => extractParam(state, childParam, appContext, false, arrayExtractContext));
86
+ if (arrayExtractContext.didResolve) {
87
+ extractContext.didResolve = true;
88
+ return resolvedChildren;
89
+ }
90
+ return param;
91
+ }
92
+ // --- Resolve each object property
93
+ if ((0, lodash_es_1.isPlainObject)(param)) {
94
+ const objectExtractContext = { didResolve: false };
95
+ const substitutedObject = {};
96
+ Object.entries(param).forEach(([key, value]) => {
97
+ substitutedObject[key] = extractParam(state, value, appContext, false, objectExtractContext);
98
+ });
99
+ if (objectExtractContext.didResolve) {
100
+ extractContext.didResolve = true;
101
+ return substitutedObject;
102
+ }
103
+ return param;
104
+ }
105
+ // --- The param itself is the extracted value
106
+ return param;
107
+ }
108
+ // --- Store stable object references for extracted parameter values
109
+ const extractedObjectCache = new LruCache_1.LRUCache(1024 * 10);
110
+ /**
111
+ * Get a stable object reference from an LRU cache
112
+ * @param object Object to get the stable reference for
113
+ *
114
+ * We are doing this to prevent creating new objects with new references when the data hasn't changed this way we
115
+ * can use these as dependencies for useEffect
116
+ */
117
+ function withStableObjectReference(object) {
118
+ if (typeof object === "function") {
119
+ return object;
120
+ }
121
+ if (react_1.default.isValidElement(object) || (Array.isArray(object) && react_1.default.isValidElement(object[0]))) {
122
+ //here could be some gnarly circular object references, JSON.stringify would blow up
123
+ return object;
124
+ }
125
+ if (object === null || object === void 0 ? void 0 : object._ARROW_EXPR_) {
126
+ //here could be some gnarly circular object references, JSON.stringify would blow up
127
+ return object;
128
+ }
129
+ try {
130
+ const stringObject = JSON.stringify(object);
131
+ const cachedObject = extractedObjectCache.get(stringObject);
132
+ if (cachedObject) {
133
+ return cachedObject;
134
+ }
135
+ extractedObjectCache.set(stringObject, object);
136
+ }
137
+ catch (e) {
138
+ console.log(object);
139
+ console.warn("couldn't cache result", e);
140
+ }
141
+ return object;
142
+ }
143
+ function shouldKeep(when, componentState, appContext) {
144
+ if (when === undefined) {
145
+ return true;
146
+ }
147
+ return extractParam(componentState, when, appContext, true);
148
+ }
@@ -0,0 +1,249 @@
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.useIsomorphicLayoutEffect = exports.useResizeObserver = void 0;
40
+ exports.usePrevious = usePrevious;
41
+ exports.useIsInIFrame = useIsInIFrame;
42
+ exports.useIsWindowFocused = useIsWindowFocused;
43
+ exports.useMediaQuery = useMediaQuery;
44
+ exports.useDocumentKeydown = useDocumentKeydown;
45
+ exports.useOnMount = useOnMount;
46
+ exports.useShallowCompareMemoize = useShallowCompareMemoize;
47
+ exports.useDeepCompareMemoize = useDeepCompareMemoize;
48
+ exports.useColors = useColors;
49
+ exports.useReferenceTrackedApi = useReferenceTrackedApi;
50
+ const react_1 = __importStar(require("react"));
51
+ const lodash_es_1 = require("lodash-es");
52
+ const misc_1 = require("@components-core/utils/misc");
53
+ const ThemeContext_1 = require("@components-core/theming/ThemeContext");
54
+ const constants_1 = require("@components-core/constants");
55
+ const color_1 = __importDefault(require("color"));
56
+ /**
57
+ * This hook invokes a callback when the size of the specified DOM element changes.
58
+ * @param element A DOM element to watch for size changes
59
+ * @param callback The callback function to invoke on size changes
60
+ */
61
+ const useResizeObserver = (element, callback) => {
62
+ const current = element === null || element === void 0 ? void 0 : element.current;
63
+ const observer = (0, react_1.useRef)();
64
+ (0, react_1.useEffect)(() => {
65
+ // --- We are already observing old element
66
+ if ((observer === null || observer === void 0 ? void 0 : observer.current) && current) {
67
+ observer.current.unobserve(current);
68
+ }
69
+ observer.current = new ResizeObserver(callback);
70
+ if (element && element.current && observer.current) {
71
+ observer.current.observe(element.current);
72
+ }
73
+ }, [callback, current, element]);
74
+ };
75
+ exports.useResizeObserver = useResizeObserver;
76
+ /**
77
+ * This hook gets the previous state of the specified value (props, variable used in a React
78
+ * function).
79
+ *
80
+ * @see {@link https://blog.logrocket.com/accessing-previous-props-state-react-hooks/}
81
+ */
82
+ function usePrevious(value) {
83
+ const ref = (0, react_1.useRef)();
84
+ (0, react_1.useEffect)(() => {
85
+ ref.current = value;
86
+ }, [value]);
87
+ return ref.current;
88
+ }
89
+ /**
90
+ * This hook tests if the component is used within an iframe.
91
+ * @returns True, if the component is used within an iframe; otherwise, false.
92
+ */
93
+ function useIsInIFrame() {
94
+ return (0, react_1.useMemo)(() => {
95
+ try {
96
+ return window.self !== window.top;
97
+ }
98
+ catch (e) {
99
+ return true;
100
+ }
101
+ }, []);
102
+ }
103
+ // --- Tests if the document has the focus
104
+ const hasFocus = () => typeof document !== "undefined" && document.hasFocus();
105
+ /**
106
+ * This hook tests if the window has the focus.
107
+ * @returns True, if the window has the focus; otherwise, false.
108
+ */
109
+ function useIsWindowFocused() {
110
+ const [focused, setFocused] = (0, react_1.useState)(hasFocus); // Focus for first render
111
+ (0, react_1.useEffect)(() => {
112
+ setFocused(hasFocus()); // Focus for additional renders
113
+ const onFocus = () => setFocused(true);
114
+ const onBlur = () => setFocused(false);
115
+ window.addEventListener("focus", onFocus);
116
+ window.addEventListener("blur", onBlur);
117
+ return () => {
118
+ window.removeEventListener("focus", onFocus);
119
+ window.removeEventListener("blur", onBlur);
120
+ };
121
+ }, []);
122
+ return focused;
123
+ }
124
+ /**
125
+ * This hook allows running media queries.
126
+ * @param query Media query to run
127
+ */
128
+ function useMediaQuery(query) {
129
+ const [matches, setMatches] = (0, react_1.useState)(false);
130
+ (0, react_1.useEffect)(() => {
131
+ if (!window) {
132
+ setMatches(false);
133
+ return;
134
+ }
135
+ const matchMedia = window.matchMedia(query);
136
+ // Triggered at the first client-side load and if query changes
137
+ handleChange();
138
+ matchMedia.addEventListener("change", handleChange);
139
+ return () => {
140
+ matchMedia.removeEventListener("change", handleChange);
141
+ };
142
+ function handleChange() {
143
+ setMatches(matchMedia.matches);
144
+ }
145
+ }, [query]);
146
+ return matches;
147
+ }
148
+ /**
149
+ * This hook runs a callback function when a key is pressed in the document window.
150
+ * @param onDocumentKeydown Callback function to run
151
+ */
152
+ function useDocumentKeydown(onDocumentKeydown) {
153
+ const onKeyDown = (0, misc_1.useEvent)(onDocumentKeydown);
154
+ (0, react_1.useEffect)(() => {
155
+ document.addEventListener("keydown", onKeyDown);
156
+ return () => {
157
+ document.removeEventListener("keydown", onKeyDown);
158
+ };
159
+ }, [onKeyDown]);
160
+ }
161
+ /**
162
+ * This hook runs a function when the corresponding component has been mounted.
163
+ * @param onMount
164
+ */
165
+ function useOnMount(onMount) {
166
+ const thizRef = (0, react_1.useRef)({ mountedFired: false });
167
+ (0, react_1.useEffect)(() => {
168
+ if (!thizRef.current.mountedFired) {
169
+ thizRef.current.mountedFired = true;
170
+ onMount === null || onMount === void 0 ? void 0 : onMount();
171
+ }
172
+ }, [onMount]);
173
+ }
174
+ /**
175
+ * This hook memoizes the specified value. It uses a shallow comparison with the previously
176
+ * stored value when checking for changes. So, while a shallow comparison shows equality,
177
+ * it returns with the memoized value.
178
+ * @param value Value to memoize
179
+ */
180
+ function useShallowCompareMemoize(value) {
181
+ const ref = react_1.default.useRef(value);
182
+ const signalRef = react_1.default.useRef(0);
183
+ if (!(0, misc_1.shallowCompare)(value, ref.current)) {
184
+ ref.current = value;
185
+ signalRef.current++;
186
+ }
187
+ // eslint-disable-next-line react-hooks/exhaustive-deps
188
+ return react_1.default.useMemo(() => ref.current, [signalRef.current]);
189
+ }
190
+ /**
191
+ * This hook memoizes the specified value. When checking for changes, it uses a deep comparison
192
+ * with the previously stored value. So, while a deep comparison shows equality, it returns with
193
+ * the memoized value, even if value references differ.
194
+ * @param value Value to memoize
195
+ */
196
+ function useDeepCompareMemoize(value) {
197
+ const ref = react_1.default.useRef(value);
198
+ const signalRef = react_1.default.useRef(0);
199
+ if (!(0, lodash_es_1.isEqual)(value, ref.current)) {
200
+ ref.current = value;
201
+ signalRef.current += 1;
202
+ }
203
+ // eslint-disable-next-line react-hooks/exhaustive-deps
204
+ return react_1.default.useMemo(() => ref.current, [signalRef.current]);
205
+ }
206
+ function useColors(...colorNames) {
207
+ const { getThemeVar } = (0, ThemeContext_1.useTheme)();
208
+ // const paramsRef = useRef(colorNames);
209
+ // const { themeStyles } = useTheme();
210
+ const colors = (0, react_1.useMemo)(() => {
211
+ const ret = {};
212
+ for (const color of colorNames) {
213
+ if (typeof color === "string") {
214
+ const col = getThemeVar(color);
215
+ ret[color] = (0, color_1.default)(col).toString();
216
+ }
217
+ else {
218
+ const col = getThemeVar(color.name);
219
+ ret[color.name] = (0, color_1.default)(col).hex().toString();
220
+ }
221
+ }
222
+ return ret;
223
+ }, [colorNames, getThemeVar]);
224
+ // useEffect(() => {
225
+ // setColors(getColors(...paramsRef.current));
226
+ // }, [themeStyles]);
227
+ return colors;
228
+ }
229
+ function useReferenceTrackedApi(componentState) {
230
+ return useShallowCompareMemoize((0, react_1.useMemo)(() => {
231
+ const ret = {};
232
+ if (Reflect.ownKeys(componentState).length === 0) {
233
+ //skip containers with no registered apis
234
+ return constants_1.EMPTY_OBJECT;
235
+ }
236
+ for (const componentApiKey of Object.getOwnPropertySymbols(componentState)) {
237
+ const value = componentState[componentApiKey];
238
+ if (componentApiKey.description) {
239
+ ret[componentApiKey.description] = value;
240
+ }
241
+ }
242
+ return ret;
243
+ }, [componentState]));
244
+ }
245
+ /**
246
+ * This hook uses either useLayoutEffect or useEffect based on the environment
247
+ * (client-side or server-side).
248
+ */
249
+ exports.useIsomorphicLayoutEffect = typeof document !== "undefined" ? react_1.useLayoutEffect : react_1.useEffect;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeProps = mergeProps;
4
+ /**
5
+ * Merges child component props with rest props.
6
+ * @param childProps Child component props
7
+ * @param restProps Rest props
8
+ * @returns
9
+ *
10
+ * The origin of this method is:
11
+ * https://github.com/radix-ui/primitives/blob/c31c97274ff357aea99afe6c01c1c8c58b6356e0/packages/react/slot/src/Slot.tsx#L91
12
+ */
13
+ function mergeProps(childProps, restProps) {
14
+ // --- All child props should override
15
+ const overrideProps = Object.assign({}, restProps);
16
+ for (const propName in restProps) {
17
+ const childPropValue = childProps[propName];
18
+ const restPropValue = restProps[propName];
19
+ const isHandler = /^on[A-Z]/.test(propName);
20
+ if (isHandler) {
21
+ // --- If the handler exists on both, we compose them...
22
+ if (childPropValue && restPropValue) {
23
+ overrideProps[propName] = (...args) => {
24
+ restPropValue(...args);
25
+ childPropValue(...args);
26
+ };
27
+ }
28
+ // --- ...but if it exists only on the original, we use only this one
29
+ else if (childPropValue) {
30
+ overrideProps[propName] = childPropValue;
31
+ }
32
+ }
33
+ else if (propName === "style") {
34
+ // --- We merge `style`
35
+ overrideProps[propName] = restPropValue ? Object.assign(Object.assign({}, restPropValue), childPropValue) : childPropValue;
36
+ }
37
+ else if (propName === "className") {
38
+ // --- We merge `className`
39
+ overrideProps[propName] = restPropValue
40
+ ? [restPropValue, childPropValue].filter(Boolean).join(" ")
41
+ : childPropValue;
42
+ }
43
+ }
44
+ return Object.assign(Object.assign({}, childProps), overrideProps);
45
+ }