@nuraly/runtime 0.1.7 → 0.1.9

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 (349) hide show
  1. package/README.md +83 -765
  2. package/components/ui/components/Event/EventValue/EventValue.ts +13 -8
  3. package/components/ui/components/ToastContainer/ToastContainer.ts +1 -1
  4. package/components/ui/components/advanced/AIChat/AIChat.ts +1 -2
  5. package/components/ui/components/advanced/Collapse/Collapse.ts +5 -2
  6. package/components/ui/components/advanced/Collections/Collections.ts +2 -2
  7. package/components/ui/components/advanced/MicroApp/MicroApp.ts +3 -11
  8. package/components/ui/components/advanced/RefComponent/RefComponent.ts +2 -2
  9. package/components/ui/components/advanced/RichText/RichText.ts +5 -4
  10. package/components/ui/components/advanced/RichText/RichTextEditor.ts +0 -167
  11. package/components/ui/components/base/BaseElement/base-change-detection.ts +1 -5
  12. package/components/ui/components/base/BaseElement.ts +229 -610
  13. package/components/ui/components/base/FormRegisterable.ts +83 -0
  14. package/components/ui/components/base/controllers/DragDropController.ts +175 -0
  15. package/components/ui/components/base/controllers/ErrorController.ts +180 -0
  16. package/components/ui/components/base/controllers/EventController.ts +112 -0
  17. package/components/ui/components/base/controllers/InputHandlerController.ts +298 -0
  18. package/components/ui/components/base/controllers/SelectionController.ts +323 -0
  19. package/components/ui/components/base/controllers/StyleHandlerController.ts +286 -0
  20. package/components/ui/components/base/controllers/index.ts +11 -0
  21. package/components/ui/components/base/mixins/EditorModeMixin.ts +185 -0
  22. package/components/ui/components/base/mixins/index.ts +6 -0
  23. package/components/ui/components/base/types/base-element.types.ts +138 -0
  24. package/components/ui/components/base/types/index.ts +21 -0
  25. package/components/ui/components/base/utils/event-debouncer.ts +209 -0
  26. package/components/ui/components/base/utils/index.ts +11 -0
  27. package/components/ui/components/base/utils/style-cache.ts +94 -0
  28. package/components/ui/components/display/BoxModel/BoxModel.ts +177 -116
  29. package/components/ui/components/display/Code/Code.ts +40 -26
  30. package/components/ui/components/display/Divider/Divider.ts +2 -2
  31. package/components/ui/components/display/Icon/Icon.ts +2 -3
  32. package/components/ui/components/display/Image/Image.ts +72 -46
  33. package/components/ui/components/display/Tag/Tag.ts +2 -3
  34. package/components/ui/components/display/Video/Video.ts +91 -31
  35. package/components/ui/components/inputs/Button/Button.ts +2 -2
  36. package/components/ui/components/inputs/Checkbox/Checkbox.ts +14 -40
  37. package/components/ui/components/inputs/ColorPicker/colorpicker.ts +9 -4
  38. package/components/ui/components/inputs/DatePicker/DatePicker.ts +47 -25
  39. package/components/ui/components/inputs/Dropdown/Dropdown.ts +2 -2
  40. package/components/ui/components/inputs/Form/Form.style.ts +26 -0
  41. package/components/ui/components/inputs/Form/Form.ts +360 -0
  42. package/components/ui/components/inputs/IconPicker/IconPicker.ts +22 -18
  43. package/components/ui/components/inputs/InsertDropdown/InsertDropdown.ts +0 -20
  44. package/components/ui/components/inputs/NumberInput/NumberInput.ts +0 -4
  45. package/components/ui/components/inputs/RadioButton/Radio-button.ts +17 -13
  46. package/components/ui/components/inputs/Select/Select.ts +44 -24
  47. package/components/ui/components/inputs/TextInput/TextInput.ts +15 -9
  48. package/components/ui/components/inputs/Textarea/Textarea.ts +30 -30
  49. package/components/ui/components/inputs/UsersDropdown/UsersDropdown.ts +1 -1
  50. package/components/ui/components/layout/Card/Card.ts +112 -10
  51. package/components/ui/components/layout/Containers/Container.style.ts +18 -0
  52. package/components/ui/components/layout/Containers/Container.ts +11 -5
  53. package/components/ui/components/layout/Grid/Col.style.ts +27 -0
  54. package/components/ui/components/layout/Grid/Col.ts +213 -0
  55. package/components/ui/components/layout/Grid/Row.style.ts +73 -0
  56. package/components/ui/components/layout/Grid/Row.ts +170 -0
  57. package/components/ui/components/layout/Grid/index.ts +7 -0
  58. package/components/ui/components/layout/Panel/Panel.ts +2 -2
  59. package/components/ui/components/layout/Tabs/Tabs.ts +0 -1
  60. package/components/ui/components/navigation/EmbedURL/EmbedURL.ts +62 -26
  61. package/components/ui/components/navigation/Link/Link.ts +27 -16
  62. package/components/ui/components/navigation/Menu/Menu.ts +26 -48
  63. package/components/ui/components/runtime/MicroApp/MicroApp.ts +7 -147
  64. package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
  65. package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +484 -0
  66. package/components/ui/components/studio/FunctionsPanel/index.ts +1 -0
  67. package/components/ui/components/utility/AccessRoles/AccessRoles.style.ts +242 -0
  68. package/components/ui/components/utility/AccessRoles/AccessRoles.ts +476 -0
  69. package/components/ui/components/utility/Border/Border.ts +0 -14
  70. package/components/ui/components/utility/BorderManager/BorderManager.style.ts +237 -0
  71. package/components/ui/components/utility/BorderManager/BorderManager.ts +503 -0
  72. package/components/ui/components/utility/BoxShadow/BoxShadow.ts +0 -16
  73. package/components/ui/components/utility/Document/Document.ts +54 -25
  74. package/components/ui/components/utility/Export-Import/Export-Import.ts +8 -7
  75. package/components/ui/components/utility/Handlers/Handlers.ts +14 -17
  76. package/components/ui/components/utility/ValidationRules/ValidationRules.ts +440 -0
  77. package/components/ui/components/wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts +1 -0
  78. package/components/ui/components/wrappers/GenerikWrapper/GenerikWrapper.ts +1 -24
  79. package/components/ui/nuraly-ui/src/components/badge/badge.style.ts +4 -3
  80. package/components/ui/nuraly-ui/src/components/datepicker/datepicker.component.ts +2 -0
  81. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +12 -6
  82. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.style.ts +23 -0
  83. package/dist/{index-B4yIOSMd.js → BaseElement-BNBn_IJk.js} +2920 -267
  84. package/dist/{CodeEditor-YsOapSut.js → CodeEditor-B1gNuvPb.js} +84127 -76319
  85. package/dist/{CodeEditor-BiNku87K.js → CodeEditor-Cpph-xRc.js} +7 -7
  86. package/dist/{abap-B2diVmjb.js → abap-D0Neqhq6.js} +91 -1
  87. package/dist/{apex-3NuJ-nsI.js → apex-B5LhxkeG.js} +18 -1
  88. package/dist/assets/editor.worker-DcwbJ0PV.js +12 -0
  89. package/dist/assets/html.worker-BTMxskjR.js +461 -0
  90. package/dist/assets/json.worker-D3vTGdf_.js +49 -0
  91. package/dist/assets/ts.worker-BsM1BXac.js +51334 -0
  92. package/dist/{azcli-XGXuUsMB.js → azcli-BrBH0QTU.js} +1 -1
  93. package/dist/{bat-B8Vhm634.js → bat-BfzAov64.js} +12 -1
  94. package/dist/{bicep-Cc8X5S_k.js → bicep-C3bCSWel.js} +1 -1
  95. package/dist/{cameligo-Bo3wBh9T.js → cameligo-sFL5plcd.js} +13 -1
  96. package/dist/{clojure-CPoQlpIK.js → clojure-CfeExRz0.js} +14 -1
  97. package/dist/{coffee-BxvTGz39.js → coffee-Xws5K0WL.js} +11 -1
  98. package/dist/{cpp-5RpEV7vC.js → cpp-CqOUEpxN.js} +28 -23
  99. package/dist/{csharp-slXXP3fo.js → csharp-DVLiBOZb.js} +13 -1
  100. package/dist/{csp-B98p6-gH.js → csp-DVFp9bw5.js} +3 -1
  101. package/dist/{css-BDsDSAin.js → css-DwARn2R6.js} +8 -1
  102. package/dist/cssMode-D82-gS78.js +1577 -0
  103. package/dist/{cypher-Dc4IMouD.js → cypher-uY0Mffat.js} +8 -1
  104. package/dist/{dart-LhvE3yD2.js → dart-D27H-mX_.js} +18 -1
  105. package/dist/{dockerfile-CwzplJeZ.js → dockerfile-CmV85WZK.js} +5 -1
  106. package/dist/{ecl-DxW3FiJi.js → ecl--fKn7yzB.js} +9 -1
  107. package/dist/{elixir-BI40g7TU.js → elixir-DUhH17ON.js} +87 -1
  108. package/dist/{flow9-tR2v0bGz.js → flow9-B3Dx2LLe.js} +8 -1
  109. package/dist/{freemarker2-Bfqhwyij.js → freemarker2-CYRLpyjt.js} +359 -7
  110. package/dist/{fsharp-BLAma0OT.js → fsharp-SyqBfUAR.js} +14 -1
  111. package/dist/{go-nYcD3y4Z.js → go-BbMR2tdT.js} +17 -1
  112. package/dist/{graphql-Dp1cHWmP.js → graphql-DDJE6tIl.js} +17 -1
  113. package/dist/{handlebars-DCgKNBmn.js → handlebars-R8Efxi60.js} +38 -4
  114. package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
  115. package/dist/{html-C6wR7sMB.js → html-czhjovcp.js} +37 -4
  116. package/dist/htmlMode-DpyKDYYs.js +1587 -0
  117. package/dist/{ini-BZCOLrEc.js → ini-Ct73dBtM.js} +10 -1
  118. package/dist/{java-DAMcfJbX.js → java-C_jlkwoG.js} +18 -1
  119. package/dist/{javascript-D1L5MTmg.js → javascript-DwqkMEdb.js} +3 -2
  120. package/dist/jsonMode-Cmxxe0W9.js +2002 -0
  121. package/dist/{julia-CQ46G71H.js → julia-D8WE5U1e.js} +22 -1
  122. package/dist/{kotlin-CEjVo_6E.js → kotlin-Zy9aq5yB.js} +15 -1
  123. package/dist/{less-DreV99nP.js → less-sZ0iHtE8.js} +1 -1
  124. package/dist/{lexon-DBVJhqLb.js → lexon-CsdNL29A.js} +13 -1
  125. package/dist/{liquid-D_pDYIs1.js → liquid-2spuEcBh.js} +12 -4
  126. package/dist/{lua-Dcc_j6L-.js → lua-C2YJo0zw.js} +12 -1
  127. package/dist/{m3-B9SlZL4n.js → m3-CPLP40SG.js} +7 -1
  128. package/dist/{markdown-CuGw9_MP.js → markdown-B1mf5e0R.js} +34 -1
  129. package/dist/{mdx-CKsJ3cF4.js → mdx-BjBXyEeR.js} +2 -2
  130. package/dist/{micro-app-entry-xdTX5-ut.js → micro-app-entry-DYAnCRDo.js} +8132 -9649
  131. package/dist/micro-app.bundle.js +3 -3
  132. package/dist/micro-app.js +3565 -6710
  133. package/dist/{mips-BUWqP-OH.js → mips-DA33BZX1.js} +11 -1
  134. package/dist/{msdax-DtkouYCg.js → msdax-CCYFIQsP.js} +5 -1
  135. package/dist/{mysql-IkAsWSmF.js → mysql-hjmIjL-D.js} +11 -3
  136. package/dist/{objective-c-B2-ronfg.js → objective-c-RRCpEmqC.js} +2 -1
  137. package/dist/{pascal-Bsnz2eJA.js → pascal-CeV8XfxB.js} +13 -1
  138. package/dist/{pascaligo-D_sMUn0Q.js → pascaligo-IEEGVJAJ.js} +13 -1
  139. package/dist/{perl-BPzHt9SS.js → perl-B5-QbHq_.js} +34 -1
  140. package/dist/{pgsql-DlTJB0PD.js → pgsql-s6kqEJmi.js} +14 -4
  141. package/dist/{php-Dmq5OjwK.js → php-CWWqzOo8.js} +36 -1
  142. package/dist/{pla-HJcccrBy.js → pla-FSvb_YP_.js} +13 -1
  143. package/dist/{postiats-OQn6DKv-.js → postiats-DQdscQXO.js} +370 -1
  144. package/dist/{powerquery-DKaMYC8w.js → powerquery-CtA5JA1I.js} +7 -1
  145. package/dist/{powershell-DWeJHik1.js → powershell-DglEq96N.js} +13 -1
  146. package/dist/{protobuf-CBn_IseU.js → protobuf-BSepub3e.js} +5 -1
  147. package/dist/{pug-BoRpCINl.js → pug-B1847F4G.js} +16 -1
  148. package/dist/{python-zPpZYwLF.js → python-DLI1ji08.js} +59 -11
  149. package/dist/{qsharp-4rGyVZOw.js → qsharp-D4i0Nqg9.js} +28 -3
  150. package/dist/{r-DsgLhBOb.js → r-cdRigKxa.js} +5 -1
  151. package/dist/{razor-B_fCUeGX.js → razor-oAnIJsrL.js} +48 -4
  152. package/dist/{redis-B2fdL4Bg.js → redis-D9MFxvE8.js} +16 -6
  153. package/dist/{redshift-DoaeyCkH.js → redshift-CmCnsvL-.js} +13 -4
  154. package/dist/{restructuredtext-D-6OFBY9.js → restructuredtext-CWy8J51t.js} +19 -1
  155. package/dist/{ruby-D1DD6baV.js → ruby-WP-c36m5.js} +76 -3
  156. package/dist/runtime.js +34 -45
  157. package/dist/{rust-DssUV39M.js → rust-Q9FLdYpu.js} +13 -1
  158. package/dist/{sb-Dmb6tAdv.js → sb-C54-JBGT.js} +12 -1
  159. package/dist/{scala-Co3ETaym.js → scala-CzbFImc5.js} +24 -1
  160. package/dist/{scheme-CMrqXTty.js → scheme-BhfDmYN3.js} +1 -1
  161. package/dist/{scss-DkGudv8Q.js → scss-CEmiBXpS.js} +25 -1
  162. package/dist/{shell-BHN2BI4L.js → shell-Bmc1VhG0.js} +4 -1
  163. package/dist/{solidity-b-R-raGB.js → solidity-C9Q2I8Hh.js} +23 -1
  164. package/dist/{sophia-Y4GjyxNB.js → sophia-jWa1UyKz.js} +16 -1
  165. package/dist/{sparql-CDAPZb88.js → sparql-CM7jctbc.js} +15 -1
  166. package/dist/{sql-DkkpPiUq.js → sql-WzihTkbg.js} +42 -1
  167. package/dist/{st-CSPV91Ej.js → st-6y7_3aup.js} +8 -1
  168. package/dist/style.css +1 -1
  169. package/dist/{swift-DdSC5O48.js → swift-k-0zxG_D.js} +4 -1
  170. package/dist/{systemverilog-CI03XpAv.js → systemverilog-Pnr5_rIP.js} +29 -3
  171. package/dist/{tcl-B8DayMSI.js → tcl-fNPXval8.js} +7 -1
  172. package/dist/tsMode-D_PMsbjK.js +976 -0
  173. package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
  174. package/dist/{typescript-DrlYcCUn.js → typescript-Bu3ZbtQI.js} +23 -2
  175. package/dist/typespec-Cqqo-3Pt.js +123 -0
  176. package/dist/{vb-BIC7ccdG.js → vb-B5YC2xN9.js} +15 -1
  177. package/dist/{wgsl-C9yjop46.js → wgsl-D9BRtftY.js} +26 -1
  178. package/dist/{xml-BzP9D0eZ.js → xml-CNSSkPqy.js} +8 -2
  179. package/dist/{yaml-CT7GOvXu.js → yaml-5RF_PGNe.js} +30 -2
  180. package/handlers/compiler.ts +196 -16
  181. package/handlers/context-setup.ts +10 -5
  182. package/handlers/handler-api-factory.ts +358 -0
  183. package/handlers/handler-api.ts +379 -0
  184. package/handlers/handler-executor.ts +25 -5
  185. package/handlers/handler-scope.ts +398 -0
  186. package/handlers/index.ts +34 -2
  187. package/handlers/runtime-api/component-properties.ts +0 -8
  188. package/handlers/runtime-api/index.ts +1 -1
  189. package/handlers/runtime-api/toast.ts +1 -1
  190. package/index.ts +14 -115
  191. package/micro-app/README.md +10 -10
  192. package/micro-app/state/MicroAppRuntimeContext.ts +1 -28
  193. package/micro-app-entry.ts +0 -5
  194. package/package.json +22 -1
  195. package/redux/actions/application/index.ts +0 -1
  196. package/redux/actions/component/addComponentAction.ts +15 -4
  197. package/redux/actions/component/moveDraggedComponent.ts +1 -2
  198. package/redux/actions/component/update-component-name.ts +1 -1
  199. package/redux/actions/component/updateComponentAttributes.ts +7 -2
  200. package/redux/handlers/functions/build-function-handler.ts +11 -3
  201. package/redux/handlers/functions/deploy-function-handler.ts +11 -3
  202. package/redux/handlers/functions/invoke-function-handler.ts +11 -3
  203. package/redux/handlers/functions/load-functions-handler.ts +2 -1
  204. package/redux/handlers/functions/update-function-handler.ts +2 -1
  205. package/redux/store/component/component.interface.ts +8 -2
  206. package/redux/store/component/store.ts +1 -4
  207. package/state/runtime-context.ts +1 -23
  208. package/utils/RuntimeContextHelpers.ts +221 -90
  209. package/utils/change-detection.ts +125 -1
  210. package/utils/clipboard-utils.ts +18 -8
  211. package/utils/component-registry.ts +118 -0
  212. package/utils/index.ts +14 -1
  213. package/utils/naming-generator.ts +3 -1
  214. package/utils/randomness.ts +3 -1
  215. package/utils/register-components.ts +21 -29
  216. package/utils/render-util.ts +27 -48
  217. package/utils/toast.ts +97 -0
  218. package/vite.config.ts +29 -12
  219. package/components/ui/components/Event/EventAttribute/EventAttribute.style.ts +0 -11
  220. package/components/ui/components/Event/EventAttribute/EventAttribute.ts +0 -28
  221. package/components/ui/components/base/BaseElement/calculateStyles.ts +0 -31
  222. package/components/ui/components/base/BaseElement/drag-events.helpers.ts +0 -71
  223. package/components/ui/components/base/BaseElement/execute-event.helpers.ts +0 -45
  224. package/components/ui/components/base/BaseElement/interactions.helpers.ts +0 -14
  225. package/components/ui/components/wrappers/ComponentTitle/ComponentTitle.ts +0 -95
  226. package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.style.ts +0 -102
  227. package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.ts +0 -258
  228. package/components/ui/components/wrappers/PreviewWrapper.ts +0 -28
  229. package/components/ui/components/wrappers/RectangleSelection/RectangleSelection.ts +0 -154
  230. package/components/ui/nuraly-ui/packages/common/dist/constants/index.d.ts +0 -2
  231. package/components/ui/nuraly-ui/packages/common/dist/constants/index.js +0 -2
  232. package/components/ui/nuraly-ui/packages/common/dist/constants.d.ts +0 -17
  233. package/components/ui/nuraly-ui/packages/common/dist/constants.js +0 -7
  234. package/components/ui/nuraly-ui/packages/common/dist/controllers/index.d.ts +0 -2
  235. package/components/ui/nuraly-ui/packages/common/dist/controllers/index.js +0 -2
  236. package/components/ui/nuraly-ui/packages/common/dist/controllers.d.ts +0 -21
  237. package/components/ui/nuraly-ui/packages/common/dist/controllers.js +0 -22
  238. package/components/ui/nuraly-ui/packages/common/dist/index.d.ts +0 -25
  239. package/components/ui/nuraly-ui/packages/common/dist/index.js +0 -27
  240. package/components/ui/nuraly-ui/packages/common/dist/mixins/index.d.ts +0 -2
  241. package/components/ui/nuraly-ui/packages/common/dist/mixins/index.js +0 -3
  242. package/components/ui/nuraly-ui/packages/common/dist/mixins.d.ts +0 -26
  243. package/components/ui/nuraly-ui/packages/common/dist/mixins.js +0 -29
  244. package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.d.ts +0 -42
  245. package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.js +0 -38
  246. package/components/ui/nuraly-ui/packages/common/dist/shared/constants.d.ts +0 -1
  247. package/components/ui/nuraly-ui/packages/common/dist/shared/constants.js +0 -2
  248. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -77
  249. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.js +0 -341
  250. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -37
  251. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.js +0 -2
  252. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.d.ts +0 -4
  253. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.js +0 -4
  254. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -48
  255. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.js +0 -133
  256. package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.d.ts +0 -37
  257. package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.js +0 -141
  258. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -64
  259. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.js +0 -95
  260. package/components/ui/nuraly-ui/packages/common/dist/shared/index.d.ts +0 -13
  261. package/components/ui/nuraly-ui/packages/common/dist/shared/index.js +0 -17
  262. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -78
  263. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.js +0 -194
  264. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -44
  265. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.js +0 -85
  266. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +0 -60
  267. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.js +0 -85
  268. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +0 -108
  269. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.js +0 -17
  270. package/components/ui/nuraly-ui/packages/common/dist/themes/index.d.ts +0 -2
  271. package/components/ui/nuraly-ui/packages/common/dist/themes/index.js +0 -2
  272. package/components/ui/nuraly-ui/packages/common/dist/themes.d.ts +0 -22
  273. package/components/ui/nuraly-ui/packages/common/dist/themes.js +0 -23
  274. package/components/ui/nuraly-ui/packages/common/dist/utils/index.d.ts +0 -2
  275. package/components/ui/nuraly-ui/packages/common/dist/utils/index.js +0 -2
  276. package/components/ui/nuraly-ui/packages/common/dist/utils.d.ts +0 -21
  277. package/components/ui/nuraly-ui/packages/common/dist/utils.js +0 -22
  278. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/LICENSE +0 -15
  279. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/README.md +0 -294
  280. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
  281. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy.js +0 -175
  282. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/index.js +0 -7
  283. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/empty/index.js +0 -39
  284. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/file.js +0 -66
  285. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/index.js +0 -23
  286. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/link.js +0 -64
  287. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
  288. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
  289. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
  290. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/fs/index.js +0 -146
  291. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/index.js +0 -16
  292. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/index.js +0 -16
  293. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
  294. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
  295. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json.js +0 -12
  296. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
  297. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
  298. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
  299. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/index.js +0 -7
  300. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move-sync.js +0 -55
  301. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move.js +0 -59
  302. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/output-file/index.js +0 -31
  303. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/path-exists/index.js +0 -12
  304. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/remove/index.js +0 -17
  305. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/async.js +0 -29
  306. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/stat.js +0 -159
  307. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/utimes.js +0 -36
  308. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/LICENSE +0 -15
  309. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/README.md +0 -294
  310. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
  311. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy.js +0 -175
  312. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/index.js +0 -7
  313. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/empty/index.js +0 -39
  314. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/file.js +0 -66
  315. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/index.js +0 -23
  316. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/link.js +0 -64
  317. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
  318. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
  319. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
  320. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/fs/index.js +0 -146
  321. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/index.js +0 -16
  322. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/index.js +0 -16
  323. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
  324. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
  325. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json.js +0 -12
  326. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
  327. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
  328. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
  329. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/index.js +0 -7
  330. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move-sync.js +0 -55
  331. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move.js +0 -59
  332. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/output-file/index.js +0 -31
  333. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/path-exists/index.js +0 -12
  334. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/remove/index.js +0 -17
  335. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/async.js +0 -29
  336. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/stat.js +0 -159
  337. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/utimes.js +0 -36
  338. package/dist/SmartAttributeHandler-C4EliaG0.js +0 -153
  339. package/dist/SmartAttributeHandler-u-ZHGueR.js +0 -193
  340. package/dist/assets/editor.worker-C_S4Avdt.js +0 -11
  341. package/dist/assets/html.worker-DfuQASUV.js +0 -458
  342. package/dist/assets/json.worker-Cucz4wxY.js +0 -42
  343. package/dist/assets/ts.worker-Dme6S0YK.js +0 -37021
  344. package/dist/cssMode-CqMQ6Xsa.js +0 -1443
  345. package/dist/htmlMode-KglxyZXm.js +0 -1453
  346. package/dist/jsonMode-B3rqxD-b.js +0 -1863
  347. package/dist/tsMode-DEiq8fQ0.js +0 -800
  348. package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
  349. package/utils/styleUtil.ts +0 -7
@@ -0,0 +1,360 @@
1
+ import { html, nothing, type PropertyValues } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { type ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
4
+ import { $components } from '../../../../../redux/store/component/store.ts';
5
+ import { BaseElementBlock } from "../../base/BaseElement.ts";
6
+ import { ref } from "lit/directives/ref.js";
7
+ import { formStyles } from "./Form.style.ts";
8
+ import { setCurrentComponentIdAction } from '../../../../../redux/actions/component/setCurrentComponentIdAction.ts';
9
+ import { renderComponent } from '../../../../../utils/render-util.ts';
10
+
11
+ // Safely import @nuralyui/forms
12
+ try {
13
+ await import("@nuralyui/forms");
14
+ } catch (error) {
15
+ console.warn('[@nuralyui/forms] Package not found or failed to load.');
16
+ }
17
+
18
+ // Safely import icon and label for placeholder
19
+ try {
20
+ await import("@nuralyui/icon");
21
+ } catch (error) {
22
+ console.warn('[@nuralyui/icon] Package not found or failed to load.');
23
+ }
24
+ try {
25
+ await import("@nuralyui/label");
26
+ } catch (error) {
27
+ console.warn('[@nuralyui/label] Package not found or failed to load.');
28
+ }
29
+
30
+ /**
31
+ * Form block component that wraps nr-form and handles field registration
32
+ * across Shadow DOM boundaries using event-based communication.
33
+ */
34
+ @customElement("form-block")
35
+ export class FormBlock extends BaseElementBlock {
36
+ static styles = [formStyles];
37
+
38
+ @property({ type: Object })
39
+ component: ComponentElement;
40
+
41
+ @property({ type: Object })
42
+ item: any;
43
+
44
+ @state()
45
+ private _formElement: any = null;
46
+
47
+ @state()
48
+ private _registeredFields: Map<string, any> = new Map();
49
+
50
+ @state()
51
+ childrenComponents: ComponentElement[] = [];
52
+
53
+ private _fieldRegisterHandler = this._handleFieldRegister.bind(this);
54
+ private _fieldUnregisterHandler = this._handleFieldUnregister.bind(this);
55
+ private _fieldValueChangeHandler = this._handleFieldValueChange.bind(this);
56
+
57
+ constructor() {
58
+ super();
59
+ }
60
+
61
+ override connectedCallback() {
62
+ super.connectedCallback();
63
+ this.updateChildrenComponents();
64
+
65
+ // Listen for field registration events from child input blocks
66
+ this.addEventListener('nr-field-register', this._fieldRegisterHandler as EventListener);
67
+ this.addEventListener('nr-field-unregister', this._fieldUnregisterHandler as EventListener);
68
+ this.addEventListener('nr-field-value-change', this._fieldValueChangeHandler as EventListener);
69
+ }
70
+
71
+ override willUpdate(changedProperties: Map<string, any>) {
72
+ super.willUpdate(changedProperties);
73
+ if (changedProperties.has("component")) {
74
+ this.updateChildrenComponents();
75
+ }
76
+ }
77
+
78
+ private updateChildrenComponents(): void {
79
+ this.childrenComponents = this.component?.childrenIds?.map((id) => {
80
+ return $components.get()[this.component?.application_id]?.find((component) => component.uuid === id);
81
+ }).filter(Boolean) ?? [];
82
+ }
83
+
84
+ override disconnectedCallback() {
85
+ super.disconnectedCallback();
86
+ this.removeEventListener('nr-field-register', this._fieldRegisterHandler as EventListener);
87
+ this.removeEventListener('nr-field-unregister', this._fieldUnregisterHandler as EventListener);
88
+ this.removeEventListener('nr-field-value-change', this._fieldValueChangeHandler as EventListener);
89
+ this._registeredFields.clear();
90
+ }
91
+
92
+ protected override firstUpdated(_changedProperties: PropertyValues) {
93
+ super.firstUpdated(_changedProperties);
94
+
95
+ // Get reference to the nr-form element
96
+ this._formElement = this.renderRoot.querySelector("nr-form");
97
+
98
+ // Register callbacks for input handlers
99
+ this.registerCallback("disabled", (value) => {
100
+ if (this._formElement) {
101
+ this._formElement.disabled = value;
102
+ }
103
+ });
104
+ }
105
+
106
+ /**
107
+ * Handle field registration from child input blocks
108
+ */
109
+ private _handleFieldRegister(event: CustomEvent) {
110
+ event.stopPropagation();
111
+
112
+ const { element, name, blockElement } = event.detail;
113
+
114
+ if (!name || !element) {
115
+ console.warn('[FormBlock] Field registration missing name or element');
116
+ return;
117
+ }
118
+
119
+ // Store the registration
120
+ this._registeredFields.set(name, { element, blockElement });
121
+
122
+ // Register with nr-form's validation controller if available
123
+ if (this._formElement?.validationController) {
124
+ try {
125
+ this._formElement.validationController.registerField(element);
126
+ } catch (error) {
127
+ console.warn('[FormBlock] Failed to register field with validation controller:', error);
128
+ }
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Handle field unregistration when child input blocks are removed
134
+ */
135
+ private _handleFieldUnregister(event: CustomEvent) {
136
+ event.stopPropagation();
137
+
138
+ const { name } = event.detail;
139
+
140
+ if (name && this._registeredFields.has(name)) {
141
+ // Unregister from nr-form's validation controller
142
+ if (this._formElement?.validationController) {
143
+ try {
144
+ this._formElement.validationController.unregisterField(name);
145
+ } catch (error) {
146
+ console.warn('[FormBlock] Failed to unregister field:', error);
147
+ }
148
+ }
149
+ this._registeredFields.delete(name);
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Handle field value changes for form data collection
155
+ */
156
+ private _handleFieldValueChange(event: CustomEvent) {
157
+ // Allow the event to propagate for potential parent handling
158
+ const { name, value } = event.detail;
159
+
160
+ if (name && this._registeredFields.has(name)) {
161
+ const fieldInfo = this._registeredFields.get(name);
162
+ fieldInfo.value = value;
163
+ }
164
+ }
165
+
166
+ /**
167
+ * Get all form field values
168
+ */
169
+ public getFieldsValue(): Record<string, any> {
170
+ if (this._formElement?.getFieldsValue) {
171
+ return this._formElement.getFieldsValue();
172
+ }
173
+
174
+ // Fallback: collect from registered fields
175
+ const values: Record<string, any> = {};
176
+ for (const [name, fieldInfo] of this._registeredFields) {
177
+ values[name] = fieldInfo.element?.value ?? fieldInfo.value;
178
+ }
179
+ return values;
180
+ }
181
+
182
+ /**
183
+ * Set form field values
184
+ */
185
+ public setFieldsValue(values: Record<string, any>): void {
186
+ if (this._formElement?.setFieldsValue) {
187
+ this._formElement.setFieldsValue(values);
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Validate all form fields
193
+ */
194
+ public async validate(): Promise<boolean> {
195
+ if (this._formElement?.validate) {
196
+ return this._formElement.validate();
197
+ }
198
+ return true;
199
+ }
200
+
201
+ /**
202
+ * Submit the form programmatically
203
+ */
204
+ public async submit(customData?: Record<string, any>): Promise<void> {
205
+ if (this._formElement?.submit) {
206
+ await this._formElement.submit(customData);
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Reset the form
212
+ */
213
+ public reset(): void {
214
+ if (this._formElement?.reset) {
215
+ this._formElement.reset();
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Get form state summary
221
+ */
222
+ public getFormState(): any {
223
+ if (this._formElement?.getFormState) {
224
+ return this._formElement.getFormState();
225
+ }
226
+ return {
227
+ isValid: true,
228
+ isSubmitting: false,
229
+ hasErrors: false,
230
+ errorCount: 0,
231
+ fieldCount: this._registeredFields.size
232
+ };
233
+ }
234
+
235
+ /**
236
+ * Render placeholder when form is empty in editor mode
237
+ */
238
+ private renderPlaceholder() {
239
+ return html`
240
+ <div
241
+ class="form-placeholder"
242
+ @click="${() => setCurrentComponentIdAction(this.component?.uuid)}"
243
+ >
244
+ <nr-icon name="file-text"></nr-icon>
245
+ <nr-label>Add form fields to this form</nr-label>
246
+ <drag-wrapper
247
+ .where=${"inside"}
248
+ .message=${"Drop inside"}
249
+ .component=${{ ...this.component }}
250
+ .inputRef=${this.inputRef}
251
+ .isDragInitiator=${this.isDragInitiator}
252
+ >
253
+ </drag-wrapper>
254
+ </div>
255
+ `;
256
+ }
257
+
258
+ /**
259
+ * Render children components
260
+ */
261
+ private renderChildren() {
262
+ return renderComponent(
263
+ this.childrenComponents.map((component) => ({ ...component, item: this.item })),
264
+ this.item,
265
+ this.isViewMode,
266
+ { ...this.component, uniqueUUID: this.uniqueUUID }
267
+ );
268
+ }
269
+
270
+ override renderComponent() {
271
+ const inputStyles = this.getStyles();
272
+ const hasChildren = this.childrenComponents.length > 0;
273
+
274
+ // In view mode, always render the form with children (or empty)
275
+ if (this.isViewMode) {
276
+ return html`
277
+ <nr-form
278
+ ${ref(this.inputRef)}
279
+ class="${`drop-${this.component.uuid}`}"
280
+ style=${Object.entries(inputStyles).map(([k, v]) => `${k}:${v}`).join(';')}
281
+ .disabled=${this.inputHandlersValue?.disabled || false}
282
+ .validateOnChange=${this.inputHandlersValue?.validateOnChange ?? false}
283
+ .validateOnBlur=${this.inputHandlersValue?.validateOnBlur ?? true}
284
+ .preventInvalidSubmission=${this.inputHandlersValue?.preventInvalidSubmission ?? true}
285
+ .resetOnSuccess=${this.inputHandlersValue?.resetOnSuccess ?? false}
286
+ .action=${this.inputHandlersValue?.action ?? nothing}
287
+ .method=${this.inputHandlersValue?.method ?? 'POST'}
288
+ @nr-form-submit-success=${(e: CustomEvent) => {
289
+ this.executeEvent('onSubmitSuccess', e, {
290
+ formData: e.detail?.formData,
291
+ values: this.getFieldsValue()
292
+ });
293
+ }}
294
+ @nr-form-submit-error=${(e: CustomEvent) => {
295
+ this.executeEvent('onSubmitError', e, {
296
+ error: e.detail?.error
297
+ });
298
+ }}
299
+ @nr-form-validation-changed=${(e: CustomEvent) => {
300
+ this.executeEvent('onValidationChange', e, {
301
+ validationResult: e.detail?.validationResult
302
+ });
303
+ }}
304
+ @nr-form-field-changed=${(e: CustomEvent) => {
305
+ this.executeEvent('onFieldChange', e, {
306
+ field: e.detail?.field
307
+ });
308
+ }}
309
+ @nr-form-reset=${(e: CustomEvent) => {
310
+ this.executeEvent('onReset', e, {});
311
+ }}
312
+ >
313
+ ${hasChildren ? this.renderChildren() : nothing}
314
+ </nr-form>
315
+ `;
316
+ }
317
+
318
+ // In editor mode, show placeholder if empty
319
+ return html`
320
+ <nr-form
321
+ ${ref(this.inputRef)}
322
+ class="${`drop-${this.component.uuid}`}"
323
+ style=${Object.entries(inputStyles).map(([k, v]) => `${k}:${v}`).join(';')}
324
+ .disabled=${this.inputHandlersValue?.disabled || false}
325
+ .validateOnChange=${this.inputHandlersValue?.validateOnChange ?? false}
326
+ .validateOnBlur=${this.inputHandlersValue?.validateOnBlur ?? true}
327
+ .preventInvalidSubmission=${this.inputHandlersValue?.preventInvalidSubmission ?? true}
328
+ .resetOnSuccess=${this.inputHandlersValue?.resetOnSuccess ?? false}
329
+ .action=${this.inputHandlersValue?.action ?? nothing}
330
+ .method=${this.inputHandlersValue?.method ?? 'POST'}
331
+ @nr-form-submit-success=${(e: CustomEvent) => {
332
+ this.executeEvent('onSubmitSuccess', e, {
333
+ formData: e.detail?.formData,
334
+ values: this.getFieldsValue()
335
+ });
336
+ }}
337
+ @nr-form-submit-error=${(e: CustomEvent) => {
338
+ this.executeEvent('onSubmitError', e, {
339
+ error: e.detail?.error
340
+ });
341
+ }}
342
+ @nr-form-validation-changed=${(e: CustomEvent) => {
343
+ this.executeEvent('onValidationChange', e, {
344
+ validationResult: e.detail?.validationResult
345
+ });
346
+ }}
347
+ @nr-form-field-changed=${(e: CustomEvent) => {
348
+ this.executeEvent('onFieldChange', e, {
349
+ field: e.detail?.field
350
+ });
351
+ }}
352
+ @nr-form-reset=${(e: CustomEvent) => {
353
+ this.executeEvent('onReset', e, {});
354
+ }}
355
+ >
356
+ ${hasChildren ? this.renderChildren() : this.renderPlaceholder()}
357
+ </nr-form>
358
+ `;
359
+ }
360
+ }
@@ -4,9 +4,8 @@ import { customElement, property } from "lit/decorators.js";
4
4
  import { BaseElementBlock } from '../../base/BaseElement';
5
5
  import { styles } from "./IconPicker.style.ts";
6
6
  import { EMPTY_STRING } from '../../../../../utils/constants.ts';
7
- import { styleMap } from "lit/directives/style-map.js";
8
7
  import { ref } from "lit/directives/ref.js";
9
- // import "@nuralyui/iconpicker"; // TODO: Package doesn't exist, needs to be created or removed
8
+ import "@nuralyui/iconpicker"; // TODO: Package doesn't exist, needs to be created or removed
10
9
 
11
10
  @customElement("icon-picker-block")
12
11
  export class IconPicker extends BaseElementBlock {
@@ -15,31 +14,36 @@ export class IconPicker extends BaseElementBlock {
15
14
  @property({ type: Object })
16
15
  component: ComponentElement;
17
16
 
18
- override async connectedCallback() {
19
- await super.connectedCallback();
17
+ override connectedCallback() {
18
+ super.connectedCallback();
20
19
  this.registerCallback("value", () => {});
21
20
  }
22
21
 
23
22
  renderComponent() {
24
- const iconPickerStyles = this.component?.style || {};
25
- const size = (iconPickerStyles.size as 'small' | 'medium' | 'large') || 'medium';
23
+ const inputValue = this.inputHandlersValue.value ?? EMPTY_STRING;
24
+ const size = this.inputHandlersValue?.size || 'small';
25
+ const placement = this.inputHandlersValue?.placement || 'auto';
26
+ const trigger = this.inputHandlersValue?.trigger || 'manual';
27
+ const disabled = this.inputHandlersValue?.disable === 'disabled' || this.inputHandlersValue?.disable === true;
28
+ const readonly = this.inputHandlersValue?.readonly || false;
29
+ const placeholder = this.inputHandlersValue?.placeholder || 'Select icon';
30
+ const showSearch = this.inputHandlersValue?.showSearch !== false;
31
+ const showClear = this.inputHandlersValue?.showClear !== false;
32
+ const maxVisible = this.inputHandlersValue?.maxVisible || 500;
26
33
 
27
34
  return html`
28
35
  <nr-icon-picker
29
36
  ${ref(this.inputRef)}
30
- style=${styleMap({
31
- ...this.getStyles(),
32
- })}
33
- .value=${this.inputHandlersValue.value ?? EMPTY_STRING}
34
- .disabled=${this.inputHandlersValue?.state === "disabled"}
35
- .readonly=${this.inputHandlersValue?.readonly || false}
37
+ .value=${inputValue}
36
38
  .size=${size}
37
- .placement=${this.inputHandlersValue?.placement || 'auto'}
38
- .trigger=${this.inputHandlersValue?.trigger || 'manual'}
39
- .placeholder=${this.inputHandlersValue?.placeholder || 'Select icon'}
40
- .showSearch=${this.inputHandlersValue?.showSearch !== false}
41
- .showClear=${this.inputHandlersValue?.showClear !== false}
42
- .maxVisible=${this.inputHandlersValue?.maxVisible || 500}
39
+ .placement=${placement}
40
+ .trigger=${trigger}
41
+ .disabled=${disabled}
42
+ .readonly=${readonly}
43
+ .placeholder=${placeholder}
44
+ .showSearch=${showSearch}
45
+ .showClear=${showClear}
46
+ .maxVisible=${maxVisible}
43
47
  @nr-icon-picker-change=${(e: CustomEvent) => {
44
48
  this.executeEvent('onChange', e, { value: e.detail.value, icon: e.detail.icon });
45
49
  }}
@@ -1,25 +1,5 @@
1
1
  import { css, html, nothing } from "lit";
2
2
  import { customElement, property } from "lit/decorators.js";
3
-
4
- // Safely import @nuralyui/button
5
- try {
6
- await import("@nuralyui/button");
7
- } catch (error) {
8
- console.warn('[@nuralyui/button] Package not found or failed to load.');
9
- }
10
- // Safely import @nuralyui/dropdown
11
- try {
12
- await import("@nuralyui/dropdown");
13
- } catch (error) {
14
- console.warn('[@nuralyui/dropdown] Package not found or failed to load.');
15
- }
16
- // Safely import @nuralyui/label
17
- try {
18
- await import("@nuralyui/label");
19
- } catch (error) {
20
- console.warn('[@nuralyui/label] Package not found or failed to load.');
21
- }
22
-
23
3
  import { type ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
24
4
  import { BaseElementBlock } from "../../base/BaseElement.ts";
25
5
  import { styleMap } from "lit/directives/style-map.js";
@@ -59,10 +59,6 @@ export class NumberInputBlock extends BaseElementBlock {
59
59
  .validateOnBlurInput=${this.inputHandlersValue?.validateOnBlur !== false}
60
60
  .hasFeedback=${this.inputHandlersValue?.hasFeedback || false}
61
61
  @nr-input=${(e) => {
62
- console.log('[NumberInput] nr-input event:', {
63
- value: e.detail.value,
64
- oldValue: e.detail.oldValue
65
- });
66
62
  this.executeEvent('onChange', e, {
67
63
  value: e.detail.value,
68
64
  oldValue: e.detail.oldValue
@@ -3,7 +3,13 @@ import { BaseElementBlock } from "../../base/BaseElement.ts";
3
3
  import type { ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
4
4
  import { html } from "lit";
5
5
  import { styleMap } from "lit/directives/style-map.js";
6
- // import "@nuralyui/radio-group";
6
+
7
+ // Safely import @nuralyui/radio-group
8
+ try {
9
+ await import("@nuralyui/radio-group");
10
+ } catch (error) {
11
+ console.warn('[@nuralyui/radio-group] Package not found or failed to load.');
12
+ }
7
13
 
8
14
  @customElement("radio-button-block")
9
15
  export class RadioButtonBlock extends BaseElementBlock {
@@ -17,10 +23,10 @@ export class RadioButtonBlock extends BaseElementBlock {
17
23
  renderComponent() {
18
24
  const radioStyles = this.component?.style || {};
19
25
 
20
- // Extract values from the handler structure [options, defaultValue, type]
21
- const options = this.inputHandlersValue?.value?.[0] || [];
22
- const defaultValue = this.inputHandlersValue?.value?.[1] || '';
23
- const type = this.inputHandlersValue?.value?.[2] || 'default';
26
+ // Extract values from the handler structure (object format)
27
+ const options = this.inputHandlersValue?.value?.options || [];
28
+ const defaultValue = this.inputHandlersValue?.value?.currentValue ?? '';
29
+ const type = this.inputHandlersValue?.value?.type || 'default';
24
30
 
25
31
  // Get other properties
26
32
  const direction = this.inputHandlersValue?.direction || 'vertical';
@@ -49,19 +55,17 @@ export class RadioButtonBlock extends BaseElementBlock {
49
55
  ?required=${required}
50
56
  ?auto-width=${autoWidth}
51
57
  @nr-change=${(e: CustomEvent) => {
52
- console.log('[RadioButton] nr-change event:', {
53
- detail: e.detail,
54
- value: e.detail.value,
55
- option: e.detail.option,
56
- oldValue: e.detail.oldValue
57
- });
58
- this.executeEvent('onChange', e, {
58
+ this.executeEvent('onChange', e, {
59
59
  value: e.detail.value,
60
60
  option: e.detail.option,
61
61
  oldValue: e.detail.oldValue
62
62
  });
63
63
  }}
64
- ></nr-radio-group>
64
+ >
65
+ <span slot="helper-text" style="display: block; margin-top: 4px;">
66
+ ${this.inputHandlersValue?.helper ?? ""}
67
+ </span>
68
+ </nr-radio-group>
65
69
  </span>
66
70
  `;
67
71
  }
@@ -3,11 +3,16 @@ import { customElement, property } from "lit/decorators.js";
3
3
  import { styleMap } from "lit/directives/style-map.js";
4
4
  import { type ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
5
5
  import { BaseElementBlock } from "../../base/BaseElement.ts";
6
- import { executeHandler } from '../../../../../state/runtime-context.ts';
7
- import { getNestedAttribute } from '../../../../../utils/object.utils.ts';
8
6
  import { EMPTY_STRING } from '../../../../../utils/constants.ts';
9
7
  import { ref } from "lit/directives/ref.js";
10
8
 
9
+ // Safely import @nuralyui/select
10
+ try {
11
+ await import("@nuralyui/select");
12
+ } catch (error) {
13
+ console.warn('[@nuralyui/select] Package not found or failed to load.');
14
+ }
15
+
11
16
 
12
17
  @customElement("select-block")
13
18
  export class SelectBlock extends BaseElementBlock {
@@ -19,47 +24,62 @@ export class SelectBlock extends BaseElementBlock {
19
24
 
20
25
  }
21
26
 
22
- override async connectedCallback() {
23
- await super.connectedCallback();
27
+ override connectedCallback() {
28
+ super.connectedCallback();
24
29
  this.registerCallback("value", (v) => {
25
30
  this.requestUpdate();
26
31
  });
27
32
  }
28
33
 
29
- handleValueChange = (customEvent: CustomEvent) => {
30
- if (this.component.event.changed) {
31
- const optionValue = customEvent.detail.value ?? EMPTY_STRING;
32
- executeHandler(this.component, getNestedAttribute(this.component, `event.changed`), {
33
- value: optionValue
34
- });
35
- }
36
- };
37
-
38
34
  override renderComponent() {
39
35
 
40
36
  return html`
41
- <span>
42
- <nr-select
37
+ <nr-select
43
38
  ${ref(this.inputRef)}
44
- style=${styleMap({...this.getStyles(),
45
- "--nuraly-select-width" : this.getStyles()['--nuraly-select-width'] ?? this.getStyles().width
46
- })}
39
+ style=${styleMap({
40
+ ...this.getStyles(),
41
+ "--nuraly-select-width": (this.getStyles() as any)['--nuraly-select-width'] ?? this.getStyles().width
42
+ })}
47
43
  ?multiple=${this.inputHandlersValue?.selectionMode === "multiple"}
48
44
  ?searchable=${this.inputHandlersValue?.searchable ?? false}
45
+ ?clearable=${this.inputHandlersValue?.clearable ?? false}
46
+ ?required=${this.inputHandlersValue?.required ?? false}
47
+ ?block=${this.inputHandlersValue?.block ?? false}
49
48
  .options=${this.inputHandlersValue?.options ?? []}
50
49
  .value=${this.inputHandlersValue?.value ?? EMPTY_STRING}
51
- .placeholder=${this.inputHandlersValue.placeholder || "Select an option"}
52
- search-placeholder=${this.inputHandlersValue?.searchPlaceholder || "Search options..."}
50
+ .placeholder=${this.inputHandlersValue?.placeholder || "Select an option"}
51
+ .searchPlaceholder=${this.inputHandlersValue?.searchPlaceholder || "Search options..."}
53
52
  .status=${this.inputHandlersValue?.state ?? nothing}
54
53
  .size=${this.inputHandlersValue?.size ?? nothing}
55
- .disabled=${(this.inputHandlersValue.state == "disabled")}
56
- .type=${this.inputHandlersValue.type == "inline" ? "inline" : nothing}
57
- @nr-change=${this.handleValueChange}
54
+ .disabled=${this.inputHandlersValue?.disabled ?? (this.inputHandlersValue.state == "disabled")}
55
+ .type=${this.inputHandlersValue?.type || "default"}
56
+ @nr-change=${(e: CustomEvent) => {
57
+ this.executeEvent('onChange', e, {
58
+ value: e.detail.value ?? EMPTY_STRING
59
+ });
60
+ }}
61
+ @nr-focus=${(e: CustomEvent) => {
62
+ this.executeEvent('onFocus', e);
63
+ }}
64
+ @nr-blur=${(e: CustomEvent) => {
65
+ this.executeEvent('onBlur', e);
66
+ }}
67
+ @nr-dropdown-open=${(e: CustomEvent) => {
68
+ this.executeEvent('onDropdownOpen', e);
69
+ }}
70
+ @nr-dropdown-close=${(e: CustomEvent) => {
71
+ this.executeEvent('onDropdownClose', e);
72
+ }}
73
+ @nr-validation=${(e: CustomEvent) => {
74
+ this.executeEvent('onValidation', e, {
75
+ isValid: e.detail.isValid,
76
+ message: e.detail.message
77
+ });
78
+ }}
58
79
  >
59
80
  <span slot="label">${this.inputHandlersValue.label ?? nothing}</span>
60
81
  <span slot="helper-text">${this.inputHandlersValue.helper ?? nothing}</span>
61
82
  </nr-select>
62
- </span>
63
83
  `;
64
84
  }
65
85
  }
@@ -1,9 +1,9 @@
1
1
  import { css, html, nothing, type PropertyValues } from "lit";
2
2
  import { customElement, property, state } from "lit/decorators.js";
3
- import { styleMap } from "lit/directives/style-map.js";
4
3
  import { type ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
5
4
  import { BaseElementBlock } from "../../base/BaseElement.ts";
6
5
  import { ref } from "lit/directives/ref.js";
6
+ import { registerWithParentForm, unregisterFromParentForm, notifyFieldValueChange } from "../../base/FormRegisterable.ts";
7
7
 
8
8
  // Safely import @nuralyui/input
9
9
  try {
@@ -47,14 +47,24 @@ export class TextInputBlock extends BaseElementBlock {
47
47
  }
48
48
  });
49
49
 
50
- // Récupération de l'élément input
50
+ // Get reference to the nr-input element
51
51
  this._inputElement = this.renderRoot.querySelector("nr-input");
52
+
53
+ // Register with parent form if this input has a name
54
+ if (this._inputElement && this.inputHandlersValue?.name) {
55
+ registerWithParentForm(this, this._inputElement);
56
+ }
52
57
  }
53
58
 
54
59
  override disconnectedCallback() {
55
60
  super.disconnectedCallback();
56
61
  if (this.unsubscribe) this.unsubscribe();
57
62
  if (this._focusResetTimeout) clearTimeout(this._focusResetTimeout);
63
+
64
+ // Unregister from parent form
65
+ if (this.inputHandlersValue?.name) {
66
+ unregisterFromParentForm(this);
67
+ }
58
68
  }
59
69
 
60
70
  private resetFocusAfterInactivity() {
@@ -74,14 +84,10 @@ export class TextInputBlock extends BaseElementBlock {
74
84
  return html`
75
85
  <nr-input
76
86
  ${ref(this.inputRef)}
77
- style=${styleMap({...this.getStyles(),
78
- "--nuraly-input-local-border-top-left-radius": inputStyles?.["border-top-left-radius"] ?? "",
79
- "--nuraly-input-local-border-top-right-radius": inputStyles?.["border-top-right-radius"] ?? "",
80
- "--nuraly-input-local-border-bottom-left-radius": inputStyles?.["border-bottom-left-radius"] ?? "",
81
- "--nuraly-input-local-border-bottom-right-radius": inputStyles?.["border-bottom-right-radius"] ?? "",
82
- })}
87
+ class="${`drop-${this.component.uuid}`}"
88
+
83
89
  .value=${this.inputHandlersValue?.value ?? nothing}
84
- .size=${size}
90
+ .size=${this.inputHandlersValue?.size ?? "medium"}
85
91
  .state=${this.inputHandlersValue.status ?? nothing}
86
92
  .type=${this.inputHandlersValue.type ?? nothing}
87
93
  .variant=${this.inputHandlersValue.variant ?? nothing}