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