xmlui 0.7.14 → 0.7.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/dist/{apiInterceptorWorker-FBzCR_-x.mjs → apiInterceptorWorker-yKpXImCG.mjs} +1 -1
  2. package/dist/{index-rxu3P0l4.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 +2669 -2601
  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,470 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Table = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = require("react");
29
+ const fi_1 = require("react-icons/fi");
30
+ const react_table_1 = require("@tanstack/react-table");
31
+ const Table_module_scss_1 = __importDefault(require("./Table.module.scss"));
32
+ require("./react-table-config.d.ts");
33
+ const ButtonNative_1 = require("@components/Button/ButtonNative");
34
+ const SpinnerNative_1 = require("@components/Spinner/SpinnerNative");
35
+ const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
36
+ const useRowSelection_1 = __importDefault(require("./useRowSelection"));
37
+ const Toggle_1 = require("@components/Toggle/Toggle");
38
+ const IconNative_1 = require("@components/Icon/IconNative");
39
+ const react_virtual_1 = require("@tanstack/react-virtual");
40
+ const lodash_es_1 = require("lodash-es");
41
+ const constants_1 = require("@components-core/constants");
42
+ const ScrollContext_1 = require("@components-core/ScrollContext");
43
+ const misc_1 = require("@components-core/utils/misc");
44
+ const react_dom_1 = require("react-dom");
45
+ const hooks_1 = require("@components-core/utils/hooks");
46
+ const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
47
+ const ThemeContext_1 = require("@components-core/theming/ThemeContext");
48
+ const transformThemeVars_1 = require("@components-core/theming/transformThemeVars");
49
+ function defaultIsRowDisabled(_) {
50
+ return false;
51
+ }
52
+ const SELECT_COLUMN_WIDTH = 42;
53
+ const DEFAULT_PAGE_SIZES = [10];
54
+ //These are the important styles to make sticky column pinning work!
55
+ //Apply styles like this using your CSS strategy of choice with this kind of logic to head cells, data cells, footer cells, etc.
56
+ //View the index.css file for more needed styles such as border-collapse: separate
57
+ const getCommonPinningStyles = (column) => {
58
+ const isPinned = column.getIsPinned();
59
+ // const isLastLeftPinnedColumn = isPinned === "left" && column.getIsLastColumn("left");
60
+ // const isFirstRightPinnedColumn = isPinned === "right" && column.getIsFirstColumn("right");
61
+ return {
62
+ // boxShadow: isLastLeftPinnedColumn
63
+ // ? "-4px 0 4px -4px gray inset"
64
+ // : isFirstRightPinnedColumn
65
+ // ? "4px 0 4px -4px gray inset"
66
+ // : undefined,
67
+ left: isPinned === "left" ? `${column.getStart("left")}px` : undefined,
68
+ right: isPinned === "right" ? `${column.getAfter("right")}px` : undefined,
69
+ opacity: isPinned ? 0.95 : undefined,
70
+ position: isPinned ? "sticky" : "relative",
71
+ backgroundColor: isPinned ? "inherit" : undefined,
72
+ zIndex: isPinned ? 1 : undefined,
73
+ };
74
+ };
75
+ // eslint-disable-next-line react/display-name
76
+ exports.Table = (0, react_1.forwardRef)(({ data = constants_1.EMPTY_ARRAY, columns = constants_1.EMPTY_ARRAY, isPaginated = false, loading = false, headerHeight, rowsSelectable = false, enableMultiRowSelection = true, pageSizes = DEFAULT_PAGE_SIZES, rowDisabledPredicate = defaultIsRowDisabled, sortBy, sortingDirection = "ascending", iconSortAsc, iconSortDesc, iconNoSort, sortingDidChange, willSort, style, noDataRenderer, autoFocus = false, hideHeader = false, hideNoDataView = false, alwaysShowSelectionHeader = false, registerComponentApi, onSelectionDidChange,
77
+ // cols
78
+ }, forwardedRef) => {
79
+ var _a, _b, _c, _d;
80
+ const { getThemeVar } = (0, ThemeContext_1.useTheme)();
81
+ const safeData = Array.isArray(data) ? data : constants_1.EMPTY_ARRAY;
82
+ const wrapperRef = (0, react_1.useRef)(null);
83
+ const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(wrapperRef, forwardedRef) : wrapperRef;
84
+ const tableRef = (0, react_1.useRef)(null);
85
+ const estimatedHeightRef = (0, react_1.useRef)(null);
86
+ const isSortControlled = sortBy !== undefined;
87
+ const safeColumns = (0, react_1.useMemo)(() => {
88
+ if (columns) {
89
+ return columns;
90
+ }
91
+ if (!safeData.length) {
92
+ return constants_1.EMPTY_ARRAY;
93
+ }
94
+ return Object.keys(safeData[0]).map((key) => ({ header: key, accessorKey: key }));
95
+ }, [columns, safeData]);
96
+ (0, react_1.useEffect)(() => {
97
+ if (autoFocus) {
98
+ wrapperRef.current.focus();
99
+ }
100
+ }, [autoFocus]);
101
+ // --- Keep track of visible table rows
102
+ const [visibleItems, setVisibleItems] = (0, react_1.useState)(constants_1.EMPTY_ARRAY);
103
+ // --- Get the operations to manage selected rows in a table
104
+ const { toggleRow, checkAllRows, focusedIndex, onKeyDown, selectedRowIdMap, idKey, selectionApi, } = (0, useRowSelection_1.default)({
105
+ items: safeData,
106
+ visibleItems,
107
+ rowsSelectable,
108
+ enableMultiRowSelection,
109
+ onSelectionDidChange,
110
+ });
111
+ // --- Create data with order information whenever the items in the table change
112
+ const dataWithOrder = (0, react_1.useMemo)(() => {
113
+ return safeData.map((item, index) => {
114
+ return Object.assign(Object.assign({}, item), { order: index + 1 });
115
+ });
116
+ }, [safeData]);
117
+ // --- Local or external sorting of data
118
+ const [_sortBy, _setSortBy] = (0, react_1.useState)(sortBy);
119
+ const [_sortingDirection, _setSortingDirection] = (0, react_1.useState)(sortingDirection);
120
+ (0, react_1.useLayoutEffect)(() => {
121
+ _setSortBy(sortBy);
122
+ }, [sortBy]);
123
+ (0, react_1.useLayoutEffect)(() => {
124
+ _setSortingDirection(sortingDirection);
125
+ }, [sortingDirection]);
126
+ const sortedData = (0, react_1.useMemo)(() => {
127
+ if (!_sortBy || isSortControlled) {
128
+ return dataWithOrder;
129
+ }
130
+ return (0, lodash_es_1.orderBy)(dataWithOrder, _sortBy, _sortingDirection === "ascending" ? "asc" : "desc");
131
+ }, [_sortBy, _sortingDirection, dataWithOrder, isSortControlled]);
132
+ const _updateSorting = (0, react_1.useCallback)((accessorKey) => __awaiter(void 0, void 0, void 0, function* () {
133
+ let newDirection = "ascending";
134
+ let newSortBy = accessorKey;
135
+ // The current key is the same as the last -> the user clicked on the same header twice
136
+ if (_sortBy === accessorKey) {
137
+ // The last sorting direction was ascending -> make it descending
138
+ if (_sortingDirection === "ascending") {
139
+ newDirection = "descending";
140
+ // The last sorting direction was descending -> remove the sorting from the current key
141
+ }
142
+ else {
143
+ newSortBy = undefined;
144
+ }
145
+ }
146
+ // --- Check if sorting is allowed
147
+ const result = yield (willSort === null || willSort === void 0 ? void 0 : willSort(newSortBy, newDirection));
148
+ if (result === false) {
149
+ return;
150
+ }
151
+ _setSortingDirection(newDirection);
152
+ _setSortBy(newSortBy);
153
+ // External callback function is always called.
154
+ // Even if sorting is internal, we can notify other components through this callback
155
+ sortingDidChange === null || sortingDidChange === void 0 ? void 0 : sortingDidChange(newSortBy, newDirection);
156
+ }), [_sortBy, willSort, sortingDidChange, _sortingDirection]);
157
+ // --- Prepare column renderers according to columns defined in the table
158
+ const columnsWithCustomCell = (0, react_1.useMemo)(() => {
159
+ return safeColumns.map((col, idx) => {
160
+ var _a, _b;
161
+ // --- Obtain column width information
162
+ const { width, starSizedWidth } = getColumnWidth(col.width, true, "width");
163
+ const { width: minWidth } = getColumnWidth(col.minWidth, false, "minWidth");
164
+ const { width: maxWidth } = getColumnWidth(col.maxWidth, false, "maxWidth");
165
+ const customColumn = Object.assign(Object.assign({}, col), { header: (_b = (_a = col.header) !== null && _a !== void 0 ? _a : col.accessorKey) !== null && _b !== void 0 ? _b : " ", id: 'col_' + idx, size: width, minSize: minWidth, maxSize: maxWidth, enableResizing: col.canResize, enableSorting: col.canSort, enablePinning: col.pinTo !== undefined, meta: {
166
+ starSizedWidth,
167
+ pinTo: col.pinTo,
168
+ style: col.style,
169
+ accessorKey: col.accessorKey,
170
+ cellRenderer: col.cellRenderer,
171
+ } });
172
+ return customColumn;
173
+ function getColumnWidth(colWidth, allowStarSize, propName) {
174
+ let starSizedWidth;
175
+ let width;
176
+ const resolvedWidth = (0, transformThemeVars_1.isThemeVarName)(colWidth) ? getThemeVar(colWidth) : colWidth;
177
+ if (typeof resolvedWidth === "number") {
178
+ width = resolvedWidth;
179
+ }
180
+ else if (typeof resolvedWidth === "string") {
181
+ const oneStarSizedWidthMatch = resolvedWidth.match(/^\s*\*\s*$/);
182
+ if (allowStarSize && oneStarSizedWidthMatch) {
183
+ starSizedWidth = "1*";
184
+ }
185
+ else {
186
+ const starSizedWidthMatch = resolvedWidth.match(/^\s*(\d+)\s*\*\s*$/);
187
+ if (allowStarSize && starSizedWidthMatch) {
188
+ starSizedWidth = starSizedWidthMatch[1] + "*";
189
+ }
190
+ else {
191
+ const pixelWidthMatch = resolvedWidth.match(/^\s*(\d+)\s*(px)?\s*$/);
192
+ if (pixelWidthMatch) {
193
+ width = Number(pixelWidthMatch[1]);
194
+ }
195
+ else {
196
+ throw new Error(`Invalid TableColumnDef '${propName}' value: ${resolvedWidth}`);
197
+ }
198
+ }
199
+ }
200
+ }
201
+ if (width === undefined && starSizedWidth === undefined && allowStarSize) {
202
+ starSizedWidth = "1*";
203
+ }
204
+ return { width, starSizedWidth };
205
+ }
206
+ });
207
+ }, [getThemeVar, safeColumns]);
208
+ // --- Prepare column renderers according to columns defined in the table supporting optional row selection
209
+ const columnsWithSelectColumn = (0, react_1.useMemo)(() => {
210
+ // --- Extend the columns with a selection checkbox (indeterminate)
211
+ const selectColumn = {
212
+ id: "select",
213
+ size: SELECT_COLUMN_WIDTH,
214
+ enableResizing: false,
215
+ enablePinning: true,
216
+ meta: {
217
+ pinTo: "left",
218
+ },
219
+ header: ({ table }) => enableMultiRowSelection ? ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { className: (0, classnames_1.default)(Table_module_scss_1.default.checkBoxWrapper, {
220
+ [Table_module_scss_1.default.showInHeader]: alwaysShowSelectionHeader,
221
+ }),
222
+ value: table.getIsAllRowsSelected(),
223
+ indeterminate: table.getIsSomeRowsSelected(),
224
+ onDidChange: (checked) => {
225
+ checkAllRows(checked);
226
+ } })) : null,
227
+ cell: ({ row }) => ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { className: Table_module_scss_1.default.checkBoxWrapper,
228
+ value: row.getIsSelected(),
229
+ indeterminate: row.getIsSomeSelected(),
230
+ onDidChange: () => {
231
+ toggleRow(row.original, { metaKey: true });
232
+ } })),
233
+ };
234
+ return rowsSelectable ? [selectColumn, ...columnsWithCustomCell] : columnsWithCustomCell;
235
+ }, [
236
+ rowsSelectable,
237
+ columnsWithCustomCell,
238
+ enableMultiRowSelection,
239
+ alwaysShowSelectionHeader,
240
+ checkAllRows,
241
+ toggleRow,
242
+ ]);
243
+ // --- Set up page information (using the first page size option)
244
+ // const [pagination, setPagination] = useState<PaginationState>();
245
+ const [pagination, setPagination] = (0, react_1.useState)({
246
+ pageSize: isPaginated ? pageSizes[0] : Number.MAX_VALUE,
247
+ pageIndex: 0,
248
+ });
249
+ const prevIsPaginated = (0, hooks_1.usePrevious)(isPaginated);
250
+ (0, react_1.useEffect)(() => {
251
+ if (!prevIsPaginated && isPaginated) {
252
+ setPagination((prev) => {
253
+ return Object.assign(Object.assign({}, prev), { pageSize: pageSizes[0] });
254
+ });
255
+ }
256
+ if (prevIsPaginated && !isPaginated) {
257
+ setPagination((prev) => {
258
+ return {
259
+ pageIndex: 0,
260
+ pageSize: Number.MAX_VALUE,
261
+ };
262
+ });
263
+ }
264
+ }, [isPaginated, pageSizes, prevIsPaginated]);
265
+ const [columnSizing, setColumnSizing] = (0, react_1.useState)({});
266
+ const columnPinning = (0, react_1.useMemo)(() => {
267
+ const left = [];
268
+ const right = [];
269
+ columnsWithSelectColumn.forEach((col) => {
270
+ var _a, _b;
271
+ if (((_a = col.meta) === null || _a === void 0 ? void 0 : _a.pinTo) === "right") {
272
+ right.push(col.id);
273
+ }
274
+ if (((_b = col.meta) === null || _b === void 0 ? void 0 : _b.pinTo) === "left") {
275
+ left.push(col.id);
276
+ }
277
+ });
278
+ return {
279
+ left,
280
+ right,
281
+ };
282
+ }, [columnsWithSelectColumn]);
283
+ // --- Use the @tanstack/core-table component that manages a table
284
+ const table = (0, react_table_1.useReactTable)({
285
+ columns: columnsWithSelectColumn,
286
+ data: sortedData,
287
+ getCoreRowModel: (0, react_table_1.getCoreRowModel)(),
288
+ getPaginationRowModel: isPaginated ? (0, react_table_1.getPaginationRowModel)() : undefined,
289
+ enableRowSelection: rowsSelectable,
290
+ enableMultiRowSelection,
291
+ columnResizeMode: "onChange",
292
+ getRowId: (0, react_1.useCallback)((originalRow) => {
293
+ return originalRow[idKey] + "";
294
+ }, [idKey]),
295
+ state: (0, react_1.useMemo)(() => ({
296
+ pagination,
297
+ rowSelection: selectedRowIdMap,
298
+ columnSizing,
299
+ columnPinning,
300
+ }), [columnPinning, columnSizing, pagination, selectedRowIdMap]),
301
+ onColumnSizingChange: setColumnSizing,
302
+ onPaginationChange: setPagination,
303
+ });
304
+ // --- Select the set of visible rows whenever the table rows change
305
+ const rows = table.getRowModel().rows;
306
+ (0, react_1.useEffect)(() => {
307
+ setVisibleItems(rows.map((row) => row.original));
308
+ }, [rows]);
309
+ const scrollRef = (0, react_1.useContext)(ScrollContext_1.ScrollContext);
310
+ const hasOutsideScroll = scrollRef &&
311
+ (style === null || style === void 0 ? void 0 : style.maxHeight) === undefined &&
312
+ (style === null || style === void 0 ? void 0 : style.height) === undefined &&
313
+ (style === null || style === void 0 ? void 0 : style.flex) === undefined;
314
+ const myObserveElementOffset = (0, react_1.useCallback)((instance, cb) => {
315
+ return (0, react_virtual_1.observeElementOffset)(instance, (offset, isScrolling) => {
316
+ var _a;
317
+ //based on this: https://github.com/TanStack/virtual/issues/387
318
+ const parentContainerOffset = !hasOutsideScroll ? 0 : ((_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.offsetTop) || 0;
319
+ cb(offset - parentContainerOffset, isScrolling);
320
+ });
321
+ }, [hasOutsideScroll]);
322
+ const rowVirtualizer = (0, react_virtual_1.useVirtualizer)({
323
+ count: rows.length,
324
+ getScrollElement: (0, react_1.useCallback)(() => {
325
+ return hasOutsideScroll && (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) ? scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current : wrapperRef.current;
326
+ }, [scrollRef, hasOutsideScroll]),
327
+ observeElementOffset: myObserveElementOffset,
328
+ estimateSize: (0, react_1.useCallback)(() => {
329
+ return estimatedHeightRef.current || 30;
330
+ }, []),
331
+ overscan: 5,
332
+ });
333
+ const paddingTop = rowVirtualizer.getVirtualItems().length > 0
334
+ ? ((_b = (_a = rowVirtualizer.getVirtualItems()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.start) || 0
335
+ : 0;
336
+ const paddingBottom = rowVirtualizer.getVirtualItems().length > 0
337
+ ? rowVirtualizer.getTotalSize() -
338
+ (((_d = (_c = rowVirtualizer.getVirtualItems()) === null || _c === void 0 ? void 0 : _c[rowVirtualizer.getVirtualItems().length - 1]) === null || _d === void 0 ? void 0 : _d.end) ||
339
+ 0)
340
+ : 0;
341
+ const hasData = safeData.length !== 0;
342
+ const touchedSizesRef = (0, react_1.useRef)({});
343
+ const columnSizeTouched = (0, react_1.useCallback)((id) => {
344
+ touchedSizesRef.current[id] = true;
345
+ }, []);
346
+ const recalculateStarSizes = (0, misc_1.useEvent)(() => {
347
+ if (!tableRef.current) {
348
+ return;
349
+ }
350
+ let availableWidth = tableRef.current.clientWidth - 1;
351
+ // -1 to prevent horizontal scroll in scaled browsers (when you zoom in)
352
+ const widths = {};
353
+ const columnsWithoutSize = [];
354
+ const numberOfUnitsById = {};
355
+ table.getAllColumns().forEach((column) => {
356
+ var _a, _b;
357
+ if (column.columnDef.size !== undefined || touchedSizesRef.current[column.id]) {
358
+ availableWidth -= columnSizing[column.id] || column.columnDef.size || 0;
359
+ }
360
+ else {
361
+ columnsWithoutSize.push(column);
362
+ let units;
363
+ if ((_a = column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.starSizedWidth) {
364
+ units = Number((_b = column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.starSizedWidth.replace("*", "").trim()) || 1;
365
+ }
366
+ else {
367
+ units = 1;
368
+ }
369
+ numberOfUnitsById[column.id] = units;
370
+ }
371
+ });
372
+ const numberOfAllUnits = Object.values(numberOfUnitsById).reduce((acc, val) => acc + val, 0);
373
+ columnsWithoutSize.forEach((column) => {
374
+ widths[column.id] = Math.floor(availableWidth * (numberOfUnitsById[column.id] / numberOfAllUnits));
375
+ });
376
+ (0, react_dom_1.flushSync)(() => {
377
+ setColumnSizing((prev) => {
378
+ return Object.assign(Object.assign({}, prev), widths);
379
+ });
380
+ });
381
+ });
382
+ (0, hooks_1.useResizeObserver)(tableRef, recalculateStarSizes);
383
+ (0, hooks_1.useIsomorphicLayoutEffect)(() => {
384
+ queueMicrotask(() => {
385
+ recalculateStarSizes();
386
+ });
387
+ }, [recalculateStarSizes, safeColumns]);
388
+ (0, hooks_1.useIsomorphicLayoutEffect)(() => {
389
+ registerComponentApi(selectionApi);
390
+ }, [registerComponentApi, selectionApi]);
391
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(Table_module_scss_1.default.wrapper, { [Table_module_scss_1.default.noScroll]: hasOutsideScroll }), tabIndex: -1, onKeyDown: onKeyDown, ref: ref, style: style, children: [(0, jsx_runtime_1.jsxs)("table", { className: Table_module_scss_1.default.table, ref: tableRef, style: { borderRight: "1px solid transparent" }, children: [!hideHeader && ((0, jsx_runtime_1.jsx)("thead", { style: { height: headerHeight }, className: Table_module_scss_1.default.headerWrapper, children: table.getHeaderGroups().map((headerGroup, headerGroupIndex) => ((0, jsx_runtime_1.jsx)("tr", { className: (0, classnames_1.default)(Table_module_scss_1.default.headerRow, {
392
+ [Table_module_scss_1.default.allSelected]: table.getIsAllRowsSelected(),
393
+ }), children: headerGroup.headers.map((header, headerIndex) => {
394
+ var _a, _b;
395
+ const _c = ((_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.style) || {}, { width } = _c, style = __rest(_c, ["width"]);
396
+ const size = header.getSize();
397
+ return ((0, jsx_runtime_1.jsxs)("th", { className: Table_module_scss_1.default.columnCell, colSpan: header.colSpan, style: Object.assign({ position: "relative", width: size }, getCommonPinningStyles(header.column)), children: [(0, jsx_runtime_1.jsx)(ClickableHeader, { hasSorting: header.column.columnDef.enableSorting, updateSorting: () => { var _a; return _updateSorting((_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.accessorKey); }, children: (0, jsx_runtime_1.jsxs)("div", { className: Table_module_scss_1.default.headerContent, style: style, children: [(0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext()), (0, jsx_runtime_1.jsx)("span", { style: { display: "inline-flex", maxWidth: 16 }, children: header.column.columnDef.enableSorting && ((0, jsx_runtime_1.jsx)(ColumnOrderingIndicator, { iconSortAsc: iconSortAsc, iconSortDesc: iconSortDesc, iconNoSort: iconNoSort, direction: ((_b = header.column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.accessorKey) === _sortBy
398
+ ? _sortingDirection
399
+ : undefined })) })] }) }), header.column.getCanResize() && ((0, jsx_runtime_1.jsx)("div", { onDoubleClick: () => {
400
+ touchedSizesRef.current[header.column.id] = false;
401
+ if (header.column.columnDef.size !== undefined) {
402
+ header.column.resetSize();
403
+ }
404
+ else {
405
+ recalculateStarSizes();
406
+ }
407
+ },
408
+ onMouseDown: (event) => {
409
+ columnSizeTouched(header.column.id);
410
+ header.getResizeHandler()(event);
411
+ },
412
+ onTouchStart: (event) => {
413
+ columnSizeTouched(header.column.id);
414
+ header.getResizeHandler()(event);
415
+ },
416
+ className: (0, classnames_1.default)(Table_module_scss_1.default.resizer, {
417
+ [Table_module_scss_1.default.isResizing]: header.column.getIsResizing(),
418
+ }) }))] }, `${header.id}-${headerIndex}`));
419
+ }) }, `${headerGroup.id}-${headerGroupIndex}`))) })), hasData && (0, jsx_runtime_1.jsxs)("tbody", { className: Table_module_scss_1.default.tableBody, children: [paddingTop > 0 && ((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", { style: { height: `${paddingTop}px` } }) })), rowVirtualizer.getVirtualItems().map((virtualRow) => {
420
+ const rowIndex = virtualRow.index;
421
+ const row = rows[rowIndex];
422
+ return ((0, jsx_runtime_1.jsx)("tr", { "data-index": rowIndex, className: (0, classnames_1.default)(Table_module_scss_1.default.row, {
423
+ [Table_module_scss_1.default.selected]: row.getIsSelected(),
424
+ [Table_module_scss_1.default.focused]: focusedIndex === rowIndex,
425
+ [Table_module_scss_1.default.disabled]: rowDisabledPredicate(row.original),
426
+ }), ref: (el) => {
427
+ if (el && estimatedHeightRef.current === null) {
428
+ estimatedHeightRef.current = Math.round(el.getBoundingClientRect().height);
429
+ }
430
+ rowVirtualizer.measureElement(el);
431
+ }, onClick: (event) => {
432
+ if (event.defaultPrevented) {
433
+ return;
434
+ }
435
+ const target = event.target;
436
+ if (target.tagName.toLowerCase() === "input") {
437
+ return;
438
+ }
439
+ toggleRow(row.original, event);
440
+ }, children: row.getVisibleCells().map((cell, i) => {
441
+ var _a, _b;
442
+ const cellRenderer = (_b = (_a = cell.column.columnDef) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.cellRenderer;
443
+ const size = cell.column.getSize();
444
+ return ((0, jsx_runtime_1.jsx)("td", { className: Table_module_scss_1.default.cell, style: Object.assign({
445
+ // width: size,
446
+ width: size }, getCommonPinningStyles(cell.column)), children: cellRenderer
447
+ ? cellRenderer(cell.row.original)
448
+ : (0, react_table_1.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, `${cell.id}-${i}`));
449
+ }) }, `${row.id}-${rowIndex}`));
450
+ }), paddingBottom > 0 && ((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", { style: { height: `${paddingBottom}px` } }) }))] })] }), loading && !hasData && ((0, jsx_runtime_1.jsx)("div", { className: Table_module_scss_1.default.loadingWrapper, children: (0, jsx_runtime_1.jsx)(SpinnerNative_1.Spinner, {}) })), !hideNoDataView &&
451
+ !loading &&
452
+ !hasData &&
453
+ (noDataRenderer ? (noDataRenderer()) : ((0, jsx_runtime_1.jsx)("div", { className: Table_module_scss_1.default.noRows, children: "No data available" }))), isPaginated && hasData && rows.length > 0 && pagination && (
454
+ // --- Render the pagination controls
455
+ (0, jsx_runtime_1.jsxs)("div", { className: Table_module_scss_1.default.pagination, children: [(0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)("span", { className: Table_module_scss_1.default.paginationLabel, children: ["Showing ", rows[0].original.order, " to ", rows[rows.length - 1].original.order, " of", " ", safeData.length, " entries"] }) }), pageSizes.length > 1 && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: Table_module_scss_1.default.paginationLabel, children: "Rows per page" }), (0, jsx_runtime_1.jsx)("select", { className: Table_module_scss_1.default.paginationSelect, value: pagination.pageSize, onChange: (e) => {
456
+ table.setPageSize(Number(e.target.value));
457
+ }, children: pageSizes.map((pageSize) => ((0, jsx_runtime_1.jsx)("option", { value: pageSize, children: pageSize }, pageSize))) })] })), (0, jsx_runtime_1.jsxs)("div", { className: Table_module_scss_1.default.paginationButtons, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => table.setPageIndex(0), disabled: !table.getCanPreviousPage(), type: "button", variant: "ghost", children: (0, jsx_runtime_1.jsx)(fi_1.FiChevronsLeft, {}) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), type: "button", variant: "ghost", children: (0, jsx_runtime_1.jsx)(fi_1.FiChevronLeft, {}) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), type: "button", variant: "ghost", children: (0, jsx_runtime_1.jsx)(fi_1.FiChevronRight, {}) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => table.setPageIndex(table.getPageCount() - 1), disabled: !table.getCanNextPage(), type: "button", variant: "ghost", children: (0, jsx_runtime_1.jsx)(fi_1.FiChevronsRight, {}) })] })] }))] }));
458
+ });
459
+ function ClickableHeader({ hasSorting, updateSorting, children }) {
460
+ return hasSorting ? ((0, jsx_runtime_1.jsx)("button", { className: Table_module_scss_1.default.clickableHeader, onClick: updateSorting, children: children })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
461
+ }
462
+ function ColumnOrderingIndicator({ direction, iconSortAsc = "sortasc:Table", iconSortDesc = "sortdesc:Table", iconNoSort = "nosort:Table", }) {
463
+ if (direction === "ascending") {
464
+ return (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconSortAsc, fallback: "sortasc", size: "12" }); //sortasc
465
+ }
466
+ else if (direction === "descending") {
467
+ return (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconSortDesc, fallback: "sortdesc", size: "12" }); //sortdesc
468
+ }
469
+ return iconNoSort !== "-" ? ((0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconNoSort, fallback: "nosort", size: "12" })) : ((0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconNoSort, size: "12" })); //nosort
470
+ }