xmlui 0.4.0

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 (308) hide show
  1. package/dist/Pdf-DeGhSMXe.mjs +19537 -0
  2. package/dist/Pdf.css +1 -0
  3. package/dist/apiInterceptorWorker-CwuUhYyc.mjs +9229 -0
  4. package/dist/array-USo-Szhp.mjs +12 -0
  5. package/dist/index-C24dkfpd.mjs +1434 -0
  6. package/dist/index-ao27SnVp.mjs +145185 -0
  7. package/dist/index.css +1 -0
  8. package/dist/nivo-bar.es-CWh0ZlxB.mjs +1666 -0
  9. package/dist/nivo-geo.es-BTqNt5Db.mjs +1579 -0
  10. package/dist/nivo-legends.es-BuIxHGSU.mjs +6916 -0
  11. package/dist/nivo-pie.es-BvCBFA0L.mjs +700 -0
  12. package/dist/react-apexcharts.min-DqWuDOyO.mjs +8881 -0
  13. package/dist/scripts/bin/bootstrap.js +11 -0
  14. package/dist/scripts/bin/build.js +256 -0
  15. package/dist/scripts/bin/index.js +88 -0
  16. package/dist/scripts/bin/preview.js +27 -0
  17. package/dist/scripts/bin/start.js +41 -0
  18. package/dist/scripts/bin/vite-ueml-plugin.js +113 -0
  19. package/dist/scripts/bin/viteConfig.js +112 -0
  20. package/dist/scripts/src/abstractions/ActionDefs.js +2 -0
  21. package/dist/scripts/src/abstractions/AppContextDefs.js +2 -0
  22. package/dist/scripts/src/abstractions/BlockScope.js +4 -0
  23. package/dist/scripts/src/abstractions/ComponentDefs.js +2 -0
  24. package/dist/scripts/src/abstractions/ComponentDescriptorDefs.js +2 -0
  25. package/dist/scripts/src/abstractions/ContainerDefs.js +2 -0
  26. package/dist/scripts/src/abstractions/FunctionDefs.js +2 -0
  27. package/dist/scripts/src/abstractions/RendererDefs.js +2 -0
  28. package/dist/scripts/src/abstractions/scripting/ScriptParserError.js +2 -0
  29. package/dist/scripts/src/abstractions/scripting/ScriptingSourceTree.js +2 -0
  30. package/dist/scripts/src/abstractions/scripting/Token.js +110 -0
  31. package/dist/scripts/src/components/App/App.js +253 -0
  32. package/dist/scripts/src/components/App/AppLayoutContext.js +9 -0
  33. package/dist/scripts/src/components/App/AppStateContext.js +9 -0
  34. package/dist/scripts/src/components/App/Sheet.js +89 -0
  35. package/dist/scripts/src/components/AppHeader/AppHeader.js +121 -0
  36. package/dist/scripts/src/components/AppState/AppState.js +29 -0
  37. package/dist/scripts/src/components/Avatar/Avatar.js +81 -0
  38. package/dist/scripts/src/components/Badge/Badge.js +56 -0
  39. package/dist/scripts/src/components/BarChart/BarChart.js +199 -0
  40. package/dist/scripts/src/components/Bookmark/Bookmark.js +11 -0
  41. package/dist/scripts/src/components/Button/Button.js +196 -0
  42. package/dist/scripts/src/components/Card/Card.js +65 -0
  43. package/dist/scripts/src/components/ChangeListener/ChangeListener.js +43 -0
  44. package/dist/scripts/src/components/Chart/Chart.js +158 -0
  45. package/dist/scripts/src/components/Checkbox/Checkbox.js +43 -0
  46. package/dist/scripts/src/components/Combobox/Combobox.js +145 -0
  47. package/dist/scripts/src/components/ComponentProvider.js +357 -0
  48. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +40 -0
  49. package/dist/scripts/src/components/DatePicker/DatePicker.js +196 -0
  50. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +175 -0
  51. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +56 -0
  52. package/dist/scripts/src/components/FileInput/FileInput.js +127 -0
  53. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +106 -0
  54. package/dist/scripts/src/components/FlowLayout/FlowLayout.js +139 -0
  55. package/dist/scripts/src/components/Footer/Footer.js +42 -0
  56. package/dist/scripts/src/components/Form/Form.js +320 -0
  57. package/dist/scripts/src/components/Form/FormContext.js +9 -0
  58. package/dist/scripts/src/components/Form/formActions.js +86 -0
  59. package/dist/scripts/src/components/FormItem/FormItem.js +204 -0
  60. package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
  61. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +39 -0
  62. package/dist/scripts/src/components/FormItem/Validations.js +346 -0
  63. package/dist/scripts/src/components/FormSection/FormSection.js +45 -0
  64. package/dist/scripts/src/components/Heading/Heading.js +206 -0
  65. package/dist/scripts/src/components/HoverCard/HoverCard.js +45 -0
  66. package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
  67. package/dist/scripts/src/components/Icon/Attach.js +10 -0
  68. package/dist/scripts/src/components/Icon/Binding.js +11 -0
  69. package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
  70. package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
  71. package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
  72. package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
  73. package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
  74. package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
  75. package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
  76. package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
  77. package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
  78. package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
  79. package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
  80. package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
  81. package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
  82. package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
  83. package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
  84. package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
  85. package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
  86. package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
  87. package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
  88. package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
  89. package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
  90. package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
  91. package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
  92. package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
  93. package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
  94. package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
  95. package/dist/scripts/src/components/Icon/Icon.js +101 -0
  96. package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
  97. package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
  98. package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
  99. package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
  100. package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
  101. package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
  102. package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
  103. package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
  104. package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
  105. package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
  106. package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
  107. package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
  108. package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
  109. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  110. package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
  111. package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
  112. package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
  113. package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
  114. package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
  115. package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
  116. package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
  117. package/dist/scripts/src/components/IconProvider.js +249 -0
  118. package/dist/scripts/src/components/IconRegistryContext.js +307 -0
  119. package/dist/scripts/src/components/Image/Image.js +34 -0
  120. package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
  121. package/dist/scripts/src/components/Input/input-abstractions.js +44 -0
  122. package/dist/scripts/src/components/Items/Items.js +48 -0
  123. package/dist/scripts/src/components/Link/Link.js +72 -0
  124. package/dist/scripts/src/components/List/List.js +442 -0
  125. package/dist/scripts/src/components/Logo/Logo.js +25 -0
  126. package/dist/scripts/src/components/Map/Map.js +60 -0
  127. package/dist/scripts/src/components/Map/world_countries.json +45307 -0
  128. package/dist/scripts/src/components/Markdown/Markdown.js +120 -0
  129. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +106 -0
  130. package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
  131. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +145 -0
  132. package/dist/scripts/src/components/MultiCombobox/MultiCombobox.js +249 -0
  133. package/dist/scripts/src/components/MultiSelect/MultiSelect.js +192 -0
  134. package/dist/scripts/src/components/NavGroup/NavGroup.js +113 -0
  135. package/dist/scripts/src/components/NavLink/NavLink.js +115 -0
  136. package/dist/scripts/src/components/NavPanel/NavPanel.js +101 -0
  137. package/dist/scripts/src/components/NoResult/NoResult.js +39 -0
  138. package/dist/scripts/src/components/NumberBox/NumberBox.js +373 -0
  139. package/dist/scripts/src/components/Option/Option.js +41 -0
  140. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +22 -0
  141. package/dist/scripts/src/components/Pages/Pages.js +74 -0
  142. package/dist/scripts/src/components/Pdf/LazyPdf.js +44 -0
  143. package/dist/scripts/src/components/Pdf/Pdf.js +19 -0
  144. package/dist/scripts/src/components/PieChart/PieChart.js +184 -0
  145. package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +29 -0
  146. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +38 -0
  147. package/dist/scripts/src/components/Queue/Queue.js +286 -0
  148. package/dist/scripts/src/components/Queue/queueActions.js +87 -0
  149. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +144 -0
  150. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +147 -0
  151. package/dist/scripts/src/components/Redirect/Redirect.js +10 -0
  152. package/dist/scripts/src/components/Select/Select.js +139 -0
  153. package/dist/scripts/src/components/Select/SelectContext.js +45 -0
  154. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +88 -0
  155. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +22 -0
  156. package/dist/scripts/src/components/Spinner/Spinner.js +59 -0
  157. package/dist/scripts/src/components/Splitter/Splitter.js +205 -0
  158. package/dist/scripts/src/components/Splitter/utils.js +17 -0
  159. package/dist/scripts/src/components/Stack/Stack.js +117 -0
  160. package/dist/scripts/src/components/StickyBox/StickyBox.js +33 -0
  161. package/dist/scripts/src/components/Switch/Switch.js +50 -0
  162. package/dist/scripts/src/components/Table/Table.js +499 -0
  163. package/dist/scripts/src/components/Table/useRowSelection.js +169 -0
  164. package/dist/scripts/src/components/TableColumnDef/TableColumnDef.js +44 -0
  165. package/dist/scripts/src/components/TableColumnDef/TableContext.js +12 -0
  166. package/dist/scripts/src/components/Tabs/Tabs.js +85 -0
  167. package/dist/scripts/src/components/Text/Text.js +175 -0
  168. package/dist/scripts/src/components/TextArea/TextArea.js +194 -0
  169. package/dist/scripts/src/components/TextArea/TextAreaResizable.js +63 -0
  170. package/dist/scripts/src/components/TextArea/useComposedRef.js +50 -0
  171. package/dist/scripts/src/components/TextBox/TextBox.js +145 -0
  172. package/dist/scripts/src/components/Theme/NotificationToast.js +39 -0
  173. package/dist/scripts/src/components/Theme/Theme.js +153 -0
  174. package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +125 -0
  175. package/dist/scripts/src/components/Toggle/Toggle.js +88 -0
  176. package/dist/scripts/src/components/Tree/TreeComponent.js +79 -0
  177. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
  178. package/dist/scripts/src/components/ViewComponentRegistryContext.js +34 -0
  179. package/dist/scripts/src/components/abstractions.js +2 -0
  180. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  181. package/dist/scripts/src/components/component-utils.js +32 -0
  182. package/dist/scripts/src/components/container-helpers.js +18 -0
  183. package/dist/scripts/src/components-core/ApiBoundComponent.js +189 -0
  184. package/dist/scripts/src/components-core/AppContext.js +17 -0
  185. package/dist/scripts/src/components-core/ChildrenSlot.js +10 -0
  186. package/dist/scripts/src/components-core/Component.js +280 -0
  187. package/dist/scripts/src/components-core/ComponentDecorator.js +63 -0
  188. package/dist/scripts/src/components-core/CompoundComponent.js +132 -0
  189. package/dist/scripts/src/components-core/EngineError.js +91 -0
  190. package/dist/scripts/src/components-core/ErrorBoundary.js +58 -0
  191. package/dist/scripts/src/components-core/Fragment.js +14 -0
  192. package/dist/scripts/src/components-core/InvalidComponent.js +15 -0
  193. package/dist/scripts/src/components-core/LoaderComponent.js +78 -0
  194. package/dist/scripts/src/components-core/RestApiProxy.js +341 -0
  195. package/dist/scripts/src/components-core/RootComponent.js +272 -0
  196. package/dist/scripts/src/components-core/RouteContext.js +45 -0
  197. package/dist/scripts/src/components-core/ScrollContext.js +9 -0
  198. package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
  199. package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
  200. package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
  201. package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
  202. package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
  203. package/dist/scripts/src/components-core/action/ApiAction.js +276 -0
  204. package/dist/scripts/src/components-core/action/DownloadFileAction.js +80 -0
  205. package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
  206. package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
  207. package/dist/scripts/src/components-core/action/UploadAction.js +88 -0
  208. package/dist/scripts/src/components-core/action/actions.js +15 -0
  209. package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
  210. package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
  211. package/dist/scripts/src/components-core/component-hooks.js +25 -0
  212. package/dist/scripts/src/components-core/constants.js +18 -0
  213. package/dist/scripts/src/components-core/container/Container.js +1110 -0
  214. package/dist/scripts/src/components-core/container/ContainerComponentDef.js +16 -0
  215. package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
  216. package/dist/scripts/src/components-core/container/collectFnVarDeps.js +26 -0
  217. package/dist/scripts/src/components-core/container/valueExtractor.js +195 -0
  218. package/dist/scripts/src/components-core/descriptorHelper.js +75 -0
  219. package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
  220. package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
  221. package/dist/scripts/src/components-core/loader/ApiLoader.js +46 -0
  222. package/dist/scripts/src/components-core/loader/DataLoader.js +160 -0
  223. package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +52 -0
  224. package/dist/scripts/src/components-core/loader/Loader.js +115 -0
  225. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +32 -0
  226. package/dist/scripts/src/components-core/loader/PageableLoader.js +240 -0
  227. package/dist/scripts/src/components-core/renderers.js +45 -0
  228. package/dist/scripts/src/components-core/reportEngineError.js +59 -0
  229. package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
  230. package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
  231. package/dist/scripts/src/components-core/script-runner/LogicalThread.js +2 -0
  232. package/dist/scripts/src/components-core/script-runner/LoopScope.js +2 -0
  233. package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
  234. package/dist/scripts/src/components-core/script-runner/TryScope.js +2 -0
  235. package/dist/scripts/src/components-core/script-runner/asyncProxy.js +96 -0
  236. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
  237. package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
  238. package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
  239. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +551 -0
  240. package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +498 -0
  241. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +434 -0
  242. package/dist/scripts/src/components-core/script-runner/modules.js +250 -0
  243. package/dist/scripts/src/components-core/script-runner/process-statement-async.js +818 -0
  244. package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
  245. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +740 -0
  246. package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
  247. package/dist/scripts/src/components-core/script-runner/visitors.js +352 -0
  248. package/dist/scripts/src/components-core/theming/ThemeContext.js +43 -0
  249. package/dist/scripts/src/components-core/theming/ThemeProvider.js +334 -0
  250. package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
  251. package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
  252. package/dist/scripts/src/components-core/theming/hvar.js +105 -0
  253. package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
  254. package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
  255. package/dist/scripts/src/components-core/theming/themes/palette.js +53 -0
  256. package/dist/scripts/src/components-core/theming/themes/root.js +257 -0
  257. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  258. package/dist/scripts/src/components-core/theming/themes/theme-colors.js +407 -0
  259. package/dist/scripts/src/components-core/theming/themes/xmlui.js +32 -0
  260. package/dist/scripts/src/components-core/theming/transformThemeVars.js +286 -0
  261. package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +34 -0
  262. package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
  263. package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
  264. package/dist/scripts/src/components-core/utils/classnames.js +58 -0
  265. package/dist/scripts/src/components-core/utils/css-utils.js +127 -0
  266. package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
  267. package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
  268. package/dist/scripts/src/components-core/utils/hooks.js +221 -0
  269. package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
  270. package/dist/scripts/src/components-core/utils/misc.js +460 -0
  271. package/dist/scripts/src/components-core/utils/statementUtils.js +205 -0
  272. package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
  273. package/dist/scripts/src/components-core/xmlui-parser.js +52 -0
  274. package/dist/scripts/src/parsers/scripting/InputStream.js +59 -0
  275. package/dist/scripts/src/parsers/scripting/Lexer.js +1028 -0
  276. package/dist/scripts/src/parsers/scripting/Parser.js +2647 -0
  277. package/dist/scripts/src/parsers/scripting/ParserError.js +46 -0
  278. package/dist/scripts/src/parsers/scripting/TokenTrait.js +109 -0
  279. package/dist/scripts/src/parsers/scripting/code-behind-collect.js +118 -0
  280. package/dist/scripts/src/parsers/scripting/tree-visitor.js +602 -0
  281. package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
  282. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +621 -0
  283. package/dist/scripts/src/parsers/style-parser/StyleParser.js +1000 -0
  284. package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
  285. package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
  286. package/dist/scripts/src/parsers/style-parser/style-compiler.js +513 -0
  287. package/dist/scripts/src/parsers/style-parser/tokens.js +42 -0
  288. package/dist/scripts/src/parsers/ueml/ParserError.js +54 -0
  289. package/dist/scripts/src/parsers/ueml/UemlHelper.js +579 -0
  290. package/dist/scripts/src/parsers/ueml/UemlInputStream.js +59 -0
  291. package/dist/scripts/src/parsers/ueml/UemlLexer.js +868 -0
  292. package/dist/scripts/src/parsers/ueml/UemlParser.js +1439 -0
  293. package/dist/scripts/src/parsers/ueml/UemlToken.js +24 -0
  294. package/dist/scripts/src/parsers/ueml/fileExtensions.js +6 -0
  295. package/dist/scripts/src/parsers/ueml/source-tree.js +2 -0
  296. package/dist/scripts/src/parsers/ueml/ueml-tree.js +2 -0
  297. package/dist/scripts/src/parsers/xmlui-parser/CharacterCodes.js +136 -0
  298. package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +100 -0
  299. package/dist/scripts/src/parsers/xmlui-parser/parser.js +476 -0
  300. package/dist/scripts/src/parsers/xmlui-parser/scanner.js +415 -0
  301. package/dist/scripts/src/parsers/xmlui-parser/syntax-kind.js +106 -0
  302. package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +2 -0
  303. package/dist/scripts/src/parsers/xmlui-parser/transform.js +922 -0
  304. package/dist/scripts/src/parsers/xmlui-parser/utils.js +83 -0
  305. package/dist/xmlui.es.d.ts +1667 -0
  306. package/dist/xmlui.es.js +17 -0
  307. package/dist/xmlui.umd.js +1589 -0
  308. package/package.json +175 -0
@@ -0,0 +1,194 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.textAreaComponentRenderer = exports.TextArea = void 0;
30
+ const jsx_runtime_1 = require("react/jsx-runtime");
31
+ const react_1 = __importStar(require("react"));
32
+ const TextArea_module_scss_1 = __importDefault(require("./TextArea.module.scss"));
33
+ const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
34
+ const renderers_1 = require("@components-core/renderers");
35
+ const constants_1 = require("@components-core/constants");
36
+ const TextAreaResizable_1 = __importDefault(require("./TextAreaResizable"));
37
+ const react_textarea_autosize_1 = __importDefault(require("react-textarea-autosize"));
38
+ const lodash_es_1 = require("lodash-es");
39
+ const themeVars_1 = require("@components-core/theming/themeVars");
40
+ const misc_1 = require("@components-core/utils/misc");
41
+ // =====================================================================================================================
42
+ // Helper types
43
+ const ResizeOptionKeys = ["horizontal", "vertical", "both"];
44
+ const isResizeOption = (str) => ResizeOptionKeys.indexOf(str) !== -1;
45
+ const resizeMap = {
46
+ horizontal: TextArea_module_scss_1.default.resizeHorizontal,
47
+ vertical: TextArea_module_scss_1.default.resizeVertical,
48
+ both: TextArea_module_scss_1.default.resizeBoth,
49
+ };
50
+ const TextArea = ({ id, value = "", placeholder = "", required = false, readOnly = false, allowCopy = true, updateState = constants_1.noop, validationStatus, autoFocus = false, initialValue = "", resize, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, controlled = true, enterSubmits = true, escResets, style, registerComponentApi, autoSize, maxRows, minRows, maxLength, rows = 2, enabled = true, }) => {
51
+ // --- The component is initially unfocused
52
+ const inputRef = (0, react_1.useRef)(null);
53
+ const [cursorPosition, setCursorPosition] = (0, react_1.useState)(null);
54
+ const [focused, setFocused] = react_1.default.useState(false);
55
+ const updateValue = (0, react_1.useCallback)((value) => {
56
+ updateState({ value: value });
57
+ onDidChange(value);
58
+ }, [onDidChange, updateState]);
59
+ const onInputChange = (0, react_1.useCallback)((event) => {
60
+ updateValue(event.target.value);
61
+ }, [updateValue]);
62
+ (0, react_1.useEffect)(() => {
63
+ updateState({ value: initialValue });
64
+ }, [initialValue, updateState]);
65
+ // --- Execute this function when the user copies the value
66
+ const handleCopy = (event) => {
67
+ if (allowCopy) {
68
+ return true;
69
+ }
70
+ else {
71
+ event.preventDefault();
72
+ return false;
73
+ }
74
+ };
75
+ // --- Manage obtaining and losing the focus
76
+ const handleOnFocus = () => {
77
+ setFocused(true);
78
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus();
79
+ };
80
+ const handleOnBlur = () => {
81
+ setFocused(false);
82
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur();
83
+ };
84
+ const focus = (0, react_1.useCallback)(() => {
85
+ setTimeout(() => {
86
+ var _a;
87
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
88
+ }, 0);
89
+ }, []);
90
+ const insert = (0, react_1.useCallback)((text) => {
91
+ const input = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current;
92
+ if (input && text) {
93
+ const start = input.selectionStart;
94
+ const value = input.value;
95
+ onInputChange({
96
+ // @ts-ignore
97
+ target: {
98
+ value: value.substring(0, start) + text + value.substring(start),
99
+ },
100
+ });
101
+ setCursorPosition(start + text.length);
102
+ }
103
+ }, [inputRef, onInputChange]);
104
+ const setValue = (0, misc_1.useEvent)((val) => {
105
+ updateValue(val);
106
+ });
107
+ (0, react_1.useEffect)(() => {
108
+ if (cursorPosition) {
109
+ const input = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current;
110
+ if (input) {
111
+ input.setSelectionRange(cursorPosition, cursorPosition);
112
+ setCursorPosition(null);
113
+ }
114
+ }
115
+ }, [value, cursorPosition, inputRef]);
116
+ (0, react_1.useEffect)(() => {
117
+ registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
118
+ focus,
119
+ insert,
120
+ setValue,
121
+ });
122
+ }, [focus, insert, registerComponentApi, setValue]);
123
+ // --- Handle the Enter key press
124
+ const handleEnter = (0, react_1.useCallback)((e) => {
125
+ var _a, _b;
126
+ if (enterSubmits && e.key.toLowerCase() === "enter" && !e.shiftKey) {
127
+ // -- Do not generate a new line
128
+ e.preventDefault();
129
+ (_a = e.currentTarget.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
130
+ }
131
+ if (escResets && e.key.toLowerCase() === "escape" && !e.shiftKey) {
132
+ e.preventDefault();
133
+ (_b = e.currentTarget.form) === null || _b === void 0 ? void 0 : _b.reset();
134
+ }
135
+ }, [enterSubmits, escResets]);
136
+ const textareaProps = {
137
+ className: (0, classnames_1.default)(TextArea_module_scss_1.default.textarea, resize ? resizeMap[resize] : "", {
138
+ [TextArea_module_scss_1.default.focused]: focused,
139
+ [TextArea_module_scss_1.default.disabled]: !enabled,
140
+ [TextArea_module_scss_1.default.error]: validationStatus === "error",
141
+ [TextArea_module_scss_1.default.warning]: validationStatus === "warning",
142
+ [TextArea_module_scss_1.default.valid]: validationStatus === "valid",
143
+ }),
144
+ ref: inputRef,
145
+ style: style,
146
+ value: controlled ? value || "" : undefined,
147
+ disabled: !enabled,
148
+ autoFocus,
149
+ id: id,
150
+ name: id,
151
+ placeholder,
152
+ required,
153
+ maxLength,
154
+ "aria-multiline": true,
155
+ "aria-readonly": readOnly,
156
+ readOnly: readOnly,
157
+ onChange: onInputChange,
158
+ onCopy: handleCopy,
159
+ onFocus: handleOnFocus,
160
+ onBlur: handleOnBlur,
161
+ onKeyDown: handleEnter,
162
+ autoComplete: "off",
163
+ };
164
+ if (resize === "both" || resize === "horizontal" || resize === "vertical") {
165
+ return ((0, jsx_runtime_1.jsx)(TextAreaResizable_1.default, Object.assign({}, textareaProps, { style: style, maxRows: maxRows, minRows: minRows, rows: rows })));
166
+ }
167
+ if (autoSize || !(0, lodash_es_1.isNil)(maxRows) || !(0, lodash_es_1.isNil)(minRows)) {
168
+ return (0, jsx_runtime_1.jsx)(react_textarea_autosize_1.default, Object.assign({}, textareaProps, { style: style, maxRows: maxRows, minRows: minRows, rows: rows }));
169
+ }
170
+ return (0, jsx_runtime_1.jsx)("textarea", Object.assign({}, textareaProps, { rows: rows }));
171
+ };
172
+ exports.TextArea = TextArea;
173
+ /**
174
+ * This object defines the hints for TextArea
175
+ */
176
+ const metadata = {
177
+ displayName: "Text Area",
178
+ description: "Provide a multiple-line text editing area for plain text content",
179
+ themeVars: (0, themeVars_1.parseScssVar)(TextArea_module_scss_1.default.themeVars),
180
+ props: {
181
+ resize: {
182
+ isValid: (p) => isResizeOption(p)
183
+ ? null
184
+ : `Resize option must be one of these values: ${[...ResizeOptionKeys].join(", ")}. Current value: '${p}'`,
185
+ },
186
+ },
187
+ };
188
+ /**
189
+ * This function defines the renderer for the TextArea component.
190
+ */
191
+ exports.textAreaComponentRenderer = (0, renderers_1.createComponentRenderer)("TextArea", ({ node, extractValue, state, updateState, layoutCss, registerComponentApi, lookupEventHandler }) => {
192
+ const initialValue = extractValue(node.props.initialValue);
193
+ return ((0, jsx_runtime_1.jsx)(exports.TextArea, { value: state === null || state === void 0 ? void 0 : state.value, initialValue: initialValue, updateState: updateState, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue(node.props.placeholder), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), resize: node.props.resize, enterSubmits: extractValue.asOptionalBoolean(node.props.enterSubmits), escResets: extractValue.asOptionalBoolean(node.props.escResets), style: layoutCss, registerComponentApi: registerComponentApi, maxRows: extractValue.asOptionalNumber(node.props.maxRows), minRows: extractValue.asOptionalNumber(node.props.minRows), maxLength: extractValue.asOptionalNumber(node.props.maxLength), rows: extractValue.asOptionalNumber(node.props.rows), autoSize: extractValue.asOptionalBoolean(node.props.autoSize), validationStatus: extractValue(node.props.validationStatus) }, `${node.uid}-${initialValue}`));
194
+ }, metadata);
@@ -0,0 +1,63 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __rest = (this && this.__rest) || function (s, e) {
26
+ var t = {};
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
+ t[p] = s[p];
29
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
+ t[p[i]] = s[p[i]];
33
+ }
34
+ return t;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const React = __importStar(require("react"));
39
+ const react_1 = require("react");
40
+ const useComposedRef_1 = require("./useComposedRef");
41
+ const noop = () => { };
42
+ const TextAreaResizable = (_a, userRef) => {
43
+ var { maxRows, minRows, onChange = noop, style } = _a, props = __rest(_a, ["maxRows", "minRows", "onChange", "style"]);
44
+ const libRef = (0, react_1.useRef)(null);
45
+ const ref = (0, useComposedRef_1.useComposedRef)(libRef, userRef);
46
+ const [minCompHeight, setMinCompHeight] = React.useState();
47
+ const [maxCompHeight, setMaxCompHeight] = React.useState();
48
+ (0, react_1.useEffect)(() => {
49
+ if (!libRef.current)
50
+ return;
51
+ // --- Simple get the physical sizes of the component...
52
+ const style = getComputedStyle(libRef.current);
53
+ const lineHeight = parseFloat(style.lineHeight);
54
+ const paddingSize = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
55
+ const borderSize = parseFloat(style.borderTop) + parseFloat(style.borderBottom);
56
+ const extraSize = (style.boxSizing === "border-box" ? borderSize : 0) + paddingSize;
57
+ // --- ... and calculate the min and max heights based on the line height
58
+ setMinCompHeight(lineHeight * (minRows !== null && minRows !== void 0 ? minRows : 1) + extraSize);
59
+ setMaxCompHeight(lineHeight * (maxRows !== null && maxRows !== void 0 ? maxRows : 10000) + extraSize);
60
+ }, [libRef.current, maxRows, minRows]);
61
+ return ((0, jsx_runtime_1.jsx)("textarea", Object.assign({ ref: ref }, props, { onChange: onChange, style: Object.assign(Object.assign({}, style), { minHeight: minCompHeight, maxHeight: maxCompHeight }) })));
62
+ };
63
+ exports.default = React.forwardRef(TextAreaResizable);
@@ -0,0 +1,50 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.useComposedRef = void 0;
27
+ const React = __importStar(require("react"));
28
+ const updateRef = (ref, value) => {
29
+ if (typeof ref === 'function') {
30
+ ref(value);
31
+ return;
32
+ }
33
+ ;
34
+ ref.current = value;
35
+ };
36
+ const useComposedRef = (libRef, userRef) => {
37
+ const prevUserRef = React.useRef();
38
+ return React.useCallback((instance) => {
39
+ libRef.current = instance;
40
+ if (prevUserRef.current) {
41
+ updateRef(prevUserRef.current, null);
42
+ }
43
+ prevUserRef.current = userRef;
44
+ if (!userRef) {
45
+ return;
46
+ }
47
+ updateRef(userRef, instance);
48
+ }, [userRef]);
49
+ };
50
+ exports.useComposedRef = useComposedRef;
@@ -0,0 +1,145 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.passwordInputComponentRenderer = exports.textBoxComponentRenderer = exports.TextBox = void 0;
30
+ const jsx_runtime_1 = require("react/jsx-runtime");
31
+ const input_abstractions_1 = require("@components/Input/input-abstractions");
32
+ const renderers_1 = require("@components-core/renderers");
33
+ const react_1 = __importStar(require("react"));
34
+ const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
35
+ const TextBox_module_scss_1 = __importDefault(require("./TextBox.module.scss"));
36
+ const constants_1 = require("@components-core/constants");
37
+ const InputAdornment_1 = require("@components/Input/InputAdornment");
38
+ const themeVars_1 = require("@components-core/theming/themeVars");
39
+ const misc_1 = require("@components-core/utils/misc");
40
+ const TextBox = ({ id, type = "text", value = "", updateState = constants_1.noop, initialValue = "", style, maxLength, enabled = true, placeholder, validationStatus = "none", onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, startText, startIcon, endText, endIcon, autoFocus, readOnly, tabIndex, }) => {
41
+ const inputRef = (0, react_1.useRef)(null);
42
+ (0, react_1.useEffect)(() => {
43
+ if (autoFocus) {
44
+ setTimeout(() => {
45
+ var _a;
46
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
47
+ }, 0);
48
+ }
49
+ }, [autoFocus]);
50
+ // --- NOTE: This is a workaround for the jumping caret issue.
51
+ // --- Local state can sync up values that can get set asynchronously outside the component.
52
+ const [localValue, setLocalValue] = react_1.default.useState(value);
53
+ (0, react_1.useEffect)(() => {
54
+ setLocalValue(value);
55
+ }, [value]);
56
+ // --- End NOTE
57
+ // --- Initialize the related field with the input's initial value
58
+ (0, react_1.useEffect)(() => {
59
+ updateState({ value: initialValue });
60
+ }, [initialValue, updateState]);
61
+ const updateValue = (0, react_1.useCallback)((value) => {
62
+ setLocalValue(value);
63
+ updateState({ value });
64
+ onDidChange(value);
65
+ }, [onDidChange, updateState]);
66
+ // --- Handle the value change events for this input
67
+ const onInputChange = (0, react_1.useCallback)((event) => {
68
+ updateValue(event.target.value);
69
+ }, [updateValue]);
70
+ // --- Manage obtaining and losing the focus
71
+ const handleOnFocus = (0, react_1.useCallback)(() => {
72
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus();
73
+ }, [onFocus]);
74
+ const handleOnBlur = (0, react_1.useCallback)(() => {
75
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur();
76
+ }, [onBlur]);
77
+ const focus = (0, react_1.useCallback)(() => {
78
+ var _a;
79
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
80
+ }, []);
81
+ const setValue = (0, misc_1.useEvent)((newValue) => {
82
+ updateValue(newValue);
83
+ });
84
+ (0, react_1.useEffect)(() => {
85
+ registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
86
+ focus,
87
+ setValue,
88
+ });
89
+ }, [focus, registerComponentApi, setValue]);
90
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(TextBox_module_scss_1.default.inputRoot, {
91
+ [TextBox_module_scss_1.default.disabled]: !enabled,
92
+ [TextBox_module_scss_1.default.readOnly]: readOnly,
93
+ [TextBox_module_scss_1.default.error]: validationStatus === "error",
94
+ [TextBox_module_scss_1.default.warning]: validationStatus === "warning",
95
+ [TextBox_module_scss_1.default.valid]: validationStatus === "valid",
96
+ }), tabIndex: -1, onFocus: () => {
97
+ var _a;
98
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
99
+ }, style: style, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: TextBox_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("input", { id: id, type: type, className: (0, classnames_1.default)(TextBox_module_scss_1.default.input, { [TextBox_module_scss_1.default.readOnly]: readOnly }), disabled: !enabled, value: localValue, maxLength: maxLength, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, ref: inputRef, readOnly: readOnly, autoFocus: autoFocus, tabIndex: tabIndex }), (0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: TextBox_module_scss_1.default.adornment })] }));
100
+ };
101
+ exports.TextBox = TextBox;
102
+ const metadata = {
103
+ displayName: "TextBox",
104
+ description: "Represents an input component for textual data entry",
105
+ props: input_abstractions_1.inputComponentPropertyDescriptors,
106
+ events: input_abstractions_1.inputComponentEventDescriptors,
107
+ themeVars: (0, themeVars_1.parseScssVar)(TextBox_module_scss_1.default.themeVars),
108
+ defaultThemeVars: {
109
+ // TODO: When FormItem is themed, move these defaults there
110
+ "radius-Input": "$radius",
111
+ "color-text-Input": "$color-text-primary",
112
+ "color-bg-Input--disabled": "$color-bg--disabled",
113
+ "thickness-border-Input": "1px",
114
+ "min-height-Input": "39px",
115
+ "style-border-Input": "solid",
116
+ "color-border-Input--disabled": "$color-border--disabled",
117
+ "color-text-Input--disabled": "$color-text--disabled",
118
+ "color-border-Input-error": "$color-border-Input-default--error",
119
+ "color-border-Input-warning": "$color-border-Input-default--warning",
120
+ "color-border-Input-success": "$color-border-Input-default--success",
121
+ "color-placeholder-Input": "$color-text-subtitle",
122
+ "color-adornment-Input": "$color-text-subtitle",
123
+ "color-outline-Input--focus": "$color-outline--focus",
124
+ "thickness-outline-Input--focus": "$thickness-outline--focus",
125
+ "style-outline-Input--focus": "$style-outline--focus",
126
+ "offset-outline-Input--focus": "$offset-outline--focus",
127
+ light: {
128
+ // --- No light-specific theme vars
129
+ },
130
+ dark: {
131
+ // --- No dark-specific theme vars
132
+ },
133
+ },
134
+ };
135
+ function renderTextBox(layoutCss, state, updateState, extractValue, node, lookupEventHandler, registerComponentApi, type = "text") {
136
+ //if we provide a value through props, we don't sync the textbox value to it's container's state,
137
+ // but handle it like a 'controlled' input (use the value from the prop as the current value, assume that the user sets the value prop in response to input changes).
138
+ return ((0, jsx_runtime_1.jsx)(exports.TextBox, { type: type, style: layoutCss, value: state.value, updateState: updateState, initialValue: extractValue(node.props.initialValue), maxLength: extractValue(node.props.maxLength), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue.asOptionalString(node.props.placeholder), validationStatus: extractValue(node.props.validationStatus), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), endIcon: extractValue.asOptionalString(node.props.endIcon), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly) }));
139
+ }
140
+ exports.textBoxComponentRenderer = (0, renderers_1.createComponentRenderer)("TextBox", ({ node, state, updateState, lookupEventHandler, extractValue, layoutCss, registerComponentApi }) => {
141
+ return renderTextBox(layoutCss, state, updateState, extractValue, node, lookupEventHandler, registerComponentApi);
142
+ }, metadata);
143
+ exports.passwordInputComponentRenderer = (0, renderers_1.createComponentRenderer)("PasswordInput", ({ node, state, updateState, lookupEventHandler, extractValue, layoutCss, registerComponentApi }) => {
144
+ return renderTextBox(layoutCss, state, updateState, extractValue, node, lookupEventHandler, registerComponentApi, "password");
145
+ }, metadata);
@@ -0,0 +1,39 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.NotificationToast = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_hot_toast_1 = __importStar(require("react-hot-toast"));
29
+ const TOASTER_CONTAINER_STYLE = {
30
+ top: 40,
31
+ right: 40,
32
+ bottom: 40,
33
+ left: 40,
34
+ position: "absolute",
35
+ };
36
+ const NotificationToast = ({ toastDuration }) => {
37
+ return ((0, jsx_runtime_1.jsx)(react_hot_toast_1.Toaster, { position: "top-right", containerStyle: TOASTER_CONTAINER_STYLE, toastOptions: { style: { padding: "12px 16px" }, duration: toastDuration }, children: (t) => ((0, jsx_runtime_1.jsx)("div", { onClick: () => react_hot_toast_1.default.dismiss(t.id), children: (0, jsx_runtime_1.jsx)(react_hot_toast_1.ToastBar, { position: t.position, toast: t, style: { wordBreak: "break-word" }, children: ({ icon, message }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [icon, message] })) }) })) }));
38
+ };
39
+ exports.NotificationToast = NotificationToast;
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.themeComponentRenderer = void 0;
18
+ exports.Theme = Theme;
19
+ const jsx_runtime_1 = require("react/jsx-runtime");
20
+ const renderers_1 = require("@components-core/renderers");
21
+ const react_1 = require("react");
22
+ const Theme_module_scss_1 = __importDefault(require("./Theme.module.scss"));
23
+ const ThemeProvider_1 = require("@components-core/theming/ThemeProvider");
24
+ const ThemeContext_1 = require("@components-core/theming/ThemeContext");
25
+ const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
26
+ const react_helmet_async_1 = require("react-helmet-async");
27
+ const react_dom_1 = require("react-dom");
28
+ const constants_1 = require("@components-core/constants");
29
+ const descriptorHelper_1 = require("@components-core/descriptorHelper");
30
+ const ErrorBoundary_1 = require("@components-core/ErrorBoundary");
31
+ const NotificationToast_1 = require("./NotificationToast");
32
+ function getClassName(css) {
33
+ return `theme-${calculateHash(css)}`;
34
+ }
35
+ function calculateHash(str) {
36
+ let hash = 0, i, chr;
37
+ if (str.length === 0)
38
+ return hash;
39
+ for (i = 0; i < str.length; i++) {
40
+ chr = str.charCodeAt(i);
41
+ hash = (hash << 5) - hash + chr;
42
+ hash |= 0; // Convert to 32bit integer
43
+ }
44
+ return hash;
45
+ }
46
+ function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 5000, themeVars = constants_1.EMPTY_OBJECT, layoutContext, }) {
47
+ const generatedId = (0, react_1.useId)();
48
+ const { themes, resources, resourceMap, activeThemeId, setRoot, root } = (0, ThemeContext_1.useThemes)();
49
+ const { activeTheme, activeThemeTone } = (0, ThemeContext_1.useTheme)();
50
+ const themeTone = tone || activeThemeTone;
51
+ const currentTheme = (0, react_1.useMemo)(() => {
52
+ var _a, _b, _c;
53
+ const themeToExtend = id ? themes.find((theme) => theme.id === id) : activeTheme;
54
+ if (!themeToExtend) {
55
+ throw new Error("Theme not found");
56
+ }
57
+ const foundTheme = Object.assign(Object.assign({}, themeToExtend), { id: generatedId, tones: Object.assign(Object.assign({}, themeToExtend.tones), { [themeTone]: Object.assign(Object.assign({}, (_a = themeToExtend.tones) === null || _a === void 0 ? void 0 : _a[themeTone]), { themeVars: Object.assign(Object.assign({}, (_c = (_b = themeToExtend.tones) === null || _b === void 0 ? void 0 : _b[themeTone]) === null || _c === void 0 ? void 0 : _c.themeVars), themeVars) }) }) });
58
+ return foundTheme;
59
+ }, [activeTheme, generatedId, id, themeTone, themeVars, themes]);
60
+ const { themeCssVars, getResourceUrl, fontLinks, allThemeVarsWithResolvedHierarchicalVars, getThemeVar } = (0, ThemeProvider_1.useCompiledTheme)(currentTheme, themeTone, themes, resources, resourceMap);
61
+ const { css, className, rangeClassName, fromClass, toClass } = (0, react_1.useMemo)(() => {
62
+ const vars = Object.assign(Object.assign({}, themeCssVars), { "color-scheme": themeTone });
63
+ // const vars = themeCssVars;
64
+ const css = Object.entries(vars)
65
+ .map(([key, value]) => {
66
+ return key + ":" + value + ";";
67
+ })
68
+ .join(" ");
69
+ const className = getClassName(css);
70
+ const fromClass = `${className}-from`;
71
+ const toClass = `${className}-to`;
72
+ let rangeClassName;
73
+ if (!isRoot) {
74
+ rangeClassName = `${fromClass} ~ *:has(~ .${toClass})`;
75
+ }
76
+ return {
77
+ className,
78
+ rangeClassName,
79
+ fromClass,
80
+ toClass,
81
+ css,
82
+ };
83
+ }, [getThemeVar, isRoot, themeCssVars, themeTone]);
84
+ // useInsertionEffect(() => {
85
+ // //PERF OPT IDEA: don't inject the css content that we already have
86
+ // // (e.g. in Items component we inject and generate classes for all items if we use a theme for an item, but they have the same content.
87
+ // // We could inject one class, and use that instead. The harder part is keeping track of them, and remove when nobody uses them)
88
+ // injectCSS(`.${className} {${css}}`, className);
89
+ // if (rangeClassName) {
90
+ // injectCSS(`.${rangeClassName} {${css}}`, rangeClassName);
91
+ // }
92
+ // let injectedClassNames = [className, rangeClassName];
93
+ // return () => {
94
+ // injectedClassNames.forEach(injectedClassName => {
95
+ // if (injectedClassName) {
96
+ // cleanupCss(injectedClassName);
97
+ // }
98
+ // });
99
+ // };
100
+ // }, [className, css]);
101
+ const [themeRoot, setThemeRoot] = (0, react_1.useState)(root);
102
+ const currentThemeContextValue = (0, react_1.useMemo)(() => {
103
+ const themeVal = {
104
+ root: themeRoot,
105
+ activeThemeId,
106
+ activeThemeTone: themeTone,
107
+ activeTheme: currentTheme,
108
+ themeStyles: themeCssVars,
109
+ themeVars: allThemeVarsWithResolvedHierarchicalVars,
110
+ getResourceUrl,
111
+ getThemeVar,
112
+ };
113
+ return themeVal;
114
+ }, [
115
+ themeRoot,
116
+ activeThemeId,
117
+ themeTone,
118
+ currentTheme,
119
+ themeCssVars,
120
+ allThemeVarsWithResolvedHierarchicalVars,
121
+ getResourceUrl,
122
+ getThemeVar,
123
+ ]);
124
+ if (isRoot) {
125
+ const faviconUrl = getResourceUrl("resource:favicon");
126
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_async_1.Helmet, { children: [!!faviconUrl && (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: faviconUrl }), fontLinks === null || fontLinks === void 0 ? void 0 : fontLinks.map((fontLink) => ((0, jsx_runtime_1.jsx)("link", { href: fontLink, rel: "stylesheet" }, fontLink)))] }), (0, jsx_runtime_1.jsx)("style", { children: `.${className} {${css}}` }), (0, jsx_runtime_1.jsxs)("div", { id: "_ui-engine-theme-root", className: (0, classnames_1.default)(Theme_module_scss_1.default.baseRootComponent, className), ref: (el) => {
127
+ if (el) {
128
+ setRoot(el);
129
+ }
130
+ }, children: [(0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "theme-root", children: renderChild(node.children) }), (0, jsx_runtime_1.jsx)(NotificationToast_1.NotificationToast, { toastDuration: toastDuration })] })] }));
131
+ }
132
+ return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, { value: currentThemeContextValue, children: [(0, jsx_runtime_1.jsx)("style", { children: `.${rangeClassName} {${css}}` }), (0, jsx_runtime_1.jsx)("style", { children: `.${className} {${css}}` }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Theme_module_scss_1.default.from, fromClass) }), renderChild(node.children, Object.assign(Object.assign({}, layoutContext), { themeClassName: className })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Theme_module_scss_1.default.to, toClass) }), root &&
133
+ (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className), ref: (el) => {
134
+ if (el) {
135
+ setThemeRoot(el);
136
+ }
137
+ } }), root)] }));
138
+ }
139
+ const metadata = {
140
+ displayName: "Theme",
141
+ description: "This component allows defining a particular theming context for its nested components",
142
+ props: {
143
+ themeId: (0, descriptorHelper_1.desc)("The id of the theme to use"),
144
+ tone: (0, descriptorHelper_1.desc)("The tone to use in the theming context"),
145
+ },
146
+ opaque: true,
147
+ };
148
+ exports.themeComponentRenderer = (0, renderers_1.createComponentRenderer)("Theme", ({ node, extractValue, renderChild, layoutContext, appContext }) => {
149
+ var _a, _b;
150
+ const _c = node.props, { tone } = _c, restProps = __rest(_c, ["tone"]);
151
+ const toastDuration = (_b = (_a = appContext === null || appContext === void 0 ? void 0 : appContext.globals) === null || _a === void 0 ? void 0 : _a.notifications) === null || _b === void 0 ? void 0 : _b.duration;
152
+ return ((0, jsx_runtime_1.jsx)(Theme, { id: extractValue.asOptionalString(node.props.themeId), isRoot: extractValue.asOptionalBoolean(node.props.root), layoutContext: layoutContext, renderChild: renderChild, tone: extractValue.asOptionalString(tone), toastDuration: toastDuration, themeVars: extractValue(restProps), node: node }));
153
+ }, metadata);