@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.
- 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 +9 -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 +360 -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 +17 -13
- package/components/ui/components/inputs/Select/Select.ts +44 -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 +213 -0
- package/components/ui/components/layout/Grid/Row.style.ts +73 -0
- package/components/ui/components/layout/Grid/Row.ts +170 -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 +7 -147
- package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
- package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +484 -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-YsOapSut.js → CodeEditor-B1gNuvPb.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-D82-gS78.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-Bfqhwyij.js → freemarker2-CYRLpyjt.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-DCgKNBmn.js → handlebars-R8Efxi60.js} +38 -4
- package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
- package/dist/{html-C6wR7sMB.js → html-czhjovcp.js} +37 -4
- package/dist/htmlMode-DpyKDYYs.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-D1L5MTmg.js → javascript-DwqkMEdb.js} +3 -2
- package/dist/jsonMode-Cmxxe0W9.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-D_pDYIs1.js → liquid-2spuEcBh.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-CKsJ3cF4.js → mdx-BjBXyEeR.js} +2 -2
- package/dist/{micro-app-entry-xdTX5-ut.js → micro-app-entry-DYAnCRDo.js} +8132 -9649
- package/dist/micro-app.bundle.js +3 -3
- package/dist/micro-app.js +3565 -6710
- 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-zPpZYwLF.js → python-DLI1ji08.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-B_fCUeGX.js → razor-oAnIJsrL.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-D_PMsbjK.js +976 -0
- package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
- package/dist/{typescript-DrlYcCUn.js → typescript-Bu3ZbtQI.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-BzP9D0eZ.js → xml-CNSSkPqy.js} +8 -2
- package/dist/{yaml-CT7GOvXu.js → yaml-5RF_PGNe.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 +22 -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-C4EliaG0.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-CqMQ6Xsa.js +0 -1443
- package/dist/htmlMode-KglxyZXm.js +0 -1453
- package/dist/jsonMode-B3rqxD-b.js +0 -1863
- package/dist/tsMode-DEiq8fQ0.js +0 -800
- package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
- package/utils/styleUtil.ts +0 -7
|
@@ -6,14 +6,6 @@ import { styleMap } from "lit/directives/style-map.js";
|
|
|
6
6
|
import { executeHandler } from '../../../../../state/runtime-context.ts';
|
|
7
7
|
import { eventDispatcher } from '../../../../../utils/change-detection.ts';
|
|
8
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
|
-
|
|
16
|
-
|
|
17
9
|
@customElement("handler-block")
|
|
18
10
|
export class HandlerBlock extends BaseElementBlock {
|
|
19
11
|
static styles = [
|
|
@@ -31,16 +23,16 @@ constructor() {
|
|
|
31
23
|
super();
|
|
32
24
|
|
|
33
25
|
eventDispatcher.onAny( ()=>{
|
|
34
|
-
this.
|
|
26
|
+
this.refreshInputs()
|
|
35
27
|
} );
|
|
36
|
-
|
|
28
|
+
|
|
37
29
|
}
|
|
38
30
|
|
|
39
31
|
|
|
40
32
|
handleCodeChange = (e: CustomEvent, eventName: string) => {
|
|
41
33
|
executeHandler(this.component,
|
|
42
34
|
/* js */`
|
|
43
|
-
const selectedComponent = Utils.first(
|
|
35
|
+
const selectedComponent = Utils.first($selectedComponents);
|
|
44
36
|
updateEvent(selectedComponent, "${eventName}", EventData.value )
|
|
45
37
|
|
|
46
38
|
`, {
|
|
@@ -52,12 +44,12 @@ constructor() {
|
|
|
52
44
|
|
|
53
45
|
executeHandler(this.component,
|
|
54
46
|
/* js */ `
|
|
55
|
-
const selectedComponent = Utils.first(
|
|
47
|
+
const selectedComponent = Utils.first($selectedComponents);
|
|
56
48
|
updateEvent(selectedComponent, "${eventName}", "" )
|
|
57
49
|
`, {
|
|
58
50
|
value: ""
|
|
59
51
|
});
|
|
60
|
-
this.
|
|
52
|
+
this.refreshInputs();
|
|
61
53
|
this.requestUpdate( )
|
|
62
54
|
};
|
|
63
55
|
|
|
@@ -65,10 +57,10 @@ constructor() {
|
|
|
65
57
|
executeHandler(this.component,
|
|
66
58
|
/* js */ `
|
|
67
59
|
try{
|
|
68
|
-
const selectedComponent = Utils.first(
|
|
60
|
+
const selectedComponent = Utils.first($selectedComponents);
|
|
69
61
|
updateEvent(selectedComponent, "${eventName}", null )
|
|
70
62
|
}catch(error){
|
|
71
|
-
console.
|
|
63
|
+
console.error(error);
|
|
72
64
|
}
|
|
73
65
|
`, {});
|
|
74
66
|
};
|
|
@@ -89,7 +81,9 @@ constructor() {
|
|
|
89
81
|
return html`
|
|
90
82
|
<nr-dropdown
|
|
91
83
|
placement="bottom-start"
|
|
92
|
-
trigger="click"
|
|
84
|
+
trigger="click"
|
|
85
|
+
position-strategy="fixed"
|
|
86
|
+
min-width="624px">
|
|
93
87
|
<nr-button
|
|
94
88
|
slot="trigger"
|
|
95
89
|
style=${styleMap({
|
|
@@ -107,7 +101,7 @@ constructor() {
|
|
|
107
101
|
iconPosition=${!this.inputHandlersValue?.triggerText ? "left" : "right"}
|
|
108
102
|
>${this.inputHandlersValue?.triggerText ?? ""}
|
|
109
103
|
</nr-button>
|
|
110
|
-
<div slot="content" style="padding: 12px; min-width:
|
|
104
|
+
<div slot="content" style="padding: 12px; min-width: 700px;">
|
|
111
105
|
${this.renderCodeEditorTemplate(eventName, eventValue)}
|
|
112
106
|
</div>
|
|
113
107
|
</nr-dropdown>
|
|
@@ -145,6 +139,7 @@ constructor() {
|
|
|
145
139
|
"--nuraly-button-border-bottom": "none"
|
|
146
140
|
})}
|
|
147
141
|
.icon=${["plus"]}
|
|
142
|
+
size="small"
|
|
148
143
|
class="unit"
|
|
149
144
|
>${this.inputHandlersValue?.triggerText ?? ""}
|
|
150
145
|
</nr-button>
|
|
@@ -177,6 +172,7 @@ constructor() {
|
|
|
177
172
|
<nr-label>${eventName}</nr-label>
|
|
178
173
|
<div style="display: flex; align-items: center; gap: 8px;">
|
|
179
174
|
<nr-button
|
|
175
|
+
class="unit"
|
|
180
176
|
style=${styleMap({
|
|
181
177
|
"--nuraly-button-text-color": "#b8b8b8",
|
|
182
178
|
"--nuraly-button-height": "39px",
|
|
@@ -189,6 +185,7 @@ constructor() {
|
|
|
189
185
|
})}
|
|
190
186
|
.icon=${["trash"]}
|
|
191
187
|
class="unit"
|
|
188
|
+
class="unit"
|
|
192
189
|
@click=${() => {
|
|
193
190
|
this.removeHandler(eventName);
|
|
194
191
|
this.requestUpdate();
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import type { ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
|
|
2
|
+
import { BaseElementBlock } from '../../base/BaseElement';
|
|
3
|
+
import { css, html, nothing } from "lit";
|
|
4
|
+
import { customElement, property } from "lit/decorators.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// ValidationRule interface matching nr-input's expected format
|
|
8
|
+
interface ValidationRule {
|
|
9
|
+
name?: string; // Custom name for the rule
|
|
10
|
+
type?: 'string' | 'number' | 'boolean' | 'method' | 'regexp' | 'integer' | 'float' | 'array' | 'object' | 'enum' | 'date' | 'url' | 'hex' | 'email';
|
|
11
|
+
required?: boolean;
|
|
12
|
+
pattern?: string;
|
|
13
|
+
minLength?: number;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
min?: number;
|
|
16
|
+
max?: number;
|
|
17
|
+
message?: string;
|
|
18
|
+
warningOnly?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Rule presets matching nr-input's VALIDATION_RULES
|
|
22
|
+
const RULE_PRESETS = {
|
|
23
|
+
required: (): ValidationRule => ({
|
|
24
|
+
required: true,
|
|
25
|
+
message: 'This field is required'
|
|
26
|
+
}),
|
|
27
|
+
email: (): ValidationRule => ({
|
|
28
|
+
type: 'email',
|
|
29
|
+
message: 'Please enter a valid email address'
|
|
30
|
+
}),
|
|
31
|
+
url: (): ValidationRule => ({
|
|
32
|
+
type: 'url',
|
|
33
|
+
message: 'Please enter a valid URL'
|
|
34
|
+
}),
|
|
35
|
+
phone: (): ValidationRule => ({
|
|
36
|
+
pattern: '^[\\+]?[1-9][\\d]{0,15}$',
|
|
37
|
+
message: 'Please enter a valid phone number'
|
|
38
|
+
}),
|
|
39
|
+
minLength: (value: number = 1): ValidationRule => ({
|
|
40
|
+
minLength: value,
|
|
41
|
+
message: `Minimum length is ${value} characters`
|
|
42
|
+
}),
|
|
43
|
+
maxLength: (value: number = 100): ValidationRule => ({
|
|
44
|
+
maxLength: value,
|
|
45
|
+
message: `Maximum length is ${value} characters`
|
|
46
|
+
}),
|
|
47
|
+
min: (value: number = 0): ValidationRule => ({
|
|
48
|
+
type: 'number',
|
|
49
|
+
min: value,
|
|
50
|
+
message: `Minimum value is ${value}`
|
|
51
|
+
}),
|
|
52
|
+
max: (value: number = 100): ValidationRule => ({
|
|
53
|
+
type: 'number',
|
|
54
|
+
max: value,
|
|
55
|
+
message: `Maximum value is ${value}`
|
|
56
|
+
}),
|
|
57
|
+
alphanumeric: (): ValidationRule => ({
|
|
58
|
+
pattern: '^[a-zA-Z0-9]+$',
|
|
59
|
+
message: 'Only letters and numbers allowed'
|
|
60
|
+
}),
|
|
61
|
+
numeric: (): ValidationRule => ({
|
|
62
|
+
pattern: '^\\d+$',
|
|
63
|
+
message: 'Only numbers allowed'
|
|
64
|
+
}),
|
|
65
|
+
strongPassword: (): ValidationRule => ({
|
|
66
|
+
pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$',
|
|
67
|
+
message: 'Password must contain at least 8 characters, including uppercase, lowercase, number and special character'
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type RulePresetKey = keyof typeof RULE_PRESETS;
|
|
72
|
+
|
|
73
|
+
@customElement("validation-rules-display")
|
|
74
|
+
export class ValidationRulesDisplay extends BaseElementBlock {
|
|
75
|
+
static override styles = [
|
|
76
|
+
css`
|
|
77
|
+
:host {
|
|
78
|
+
display: block;
|
|
79
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
80
|
+
font-size: 12px;
|
|
81
|
+
min-height: 0;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.validation-container {
|
|
86
|
+
padding: 8px;
|
|
87
|
+
width: 100%;
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.section {
|
|
92
|
+
margin-bottom: 12px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.section-title {
|
|
96
|
+
font-size: 10px;
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
color: var(--nuraly-text-secondary, #888);
|
|
99
|
+
text-transform: uppercase;
|
|
100
|
+
margin-bottom: 8px;
|
|
101
|
+
letter-spacing: 0.5px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.preset-buttons {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
gap: 4px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.preset-buttons nr-button {
|
|
111
|
+
--nuraly-button-height: 24px;
|
|
112
|
+
--nuraly-button-font-size: 10px;
|
|
113
|
+
--nuraly-button-padding-horizontal: 8px;
|
|
114
|
+
--nuraly-button-padding-small: 5px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.rules-list {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
gap: 8px;
|
|
121
|
+
margin-bottom: 12px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.rule-item {
|
|
125
|
+
padding: 10px;
|
|
126
|
+
background: var(--nuraly-bg-secondary, #f5f5f5);
|
|
127
|
+
border-radius: 6px;
|
|
128
|
+
border: 1px solid var(--nuraly-border, #e0e0e0);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rule-header {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: space-between;
|
|
135
|
+
margin-bottom: 8px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.rule-type-badge {
|
|
139
|
+
font-size: 11px;
|
|
140
|
+
font-weight: 600;
|
|
141
|
+
color: var(--nuraly-primary, #4a9eff);
|
|
142
|
+
background: var(--nuraly-primary-light, #e6f0ff);
|
|
143
|
+
padding: 3px 8px;
|
|
144
|
+
border-radius: 4px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.rule-actions {
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
gap: 4px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.warning-toggle {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: 4px;
|
|
157
|
+
font-size: 10px;
|
|
158
|
+
color: var(--nuraly-text-tertiary, #888);
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.warning-toggle input {
|
|
163
|
+
width: 14px;
|
|
164
|
+
height: 14px;
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.delete-btn {
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.rule-fields {
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-direction: column;
|
|
174
|
+
gap: 6px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.rule-field {
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
gap: 8px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.rule-field-label {
|
|
184
|
+
font-size: 10px;
|
|
185
|
+
color: var(--nuraly-text-tertiary, #888);
|
|
186
|
+
min-width: 50px;
|
|
187
|
+
text-transform: uppercase;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
nr-input {
|
|
191
|
+
flex: 1;
|
|
192
|
+
--nuraly-spacing-input-height: 24px;
|
|
193
|
+
--nuraly-font-size-input: 10px;
|
|
194
|
+
--nuraly-font-size-input-placeholder: 10px;
|
|
195
|
+
--nuraly-color-input-background: var(--validation-input-bg, white);
|
|
196
|
+
--nuraly-color-input-inner-background: var(--validation-input-bg, white);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
nr-input.small {
|
|
200
|
+
width: 70px;
|
|
201
|
+
flex: none;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
nr-checkbox {
|
|
205
|
+
--nuraly-checkbox-size: 14px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.empty-state {
|
|
209
|
+
text-align: center;
|
|
210
|
+
padding: 16px;
|
|
211
|
+
color: var(--nuraly-text-tertiary, #888);
|
|
212
|
+
font-size: 11px;
|
|
213
|
+
background: var(--nuraly-bg-secondary, #f5f5f5);
|
|
214
|
+
border-radius: 4px;
|
|
215
|
+
margin-bottom: 12px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.divider {
|
|
219
|
+
height: 1px;
|
|
220
|
+
background: var(--nuraly-border, #e0e0e0);
|
|
221
|
+
margin: 12px 0;
|
|
222
|
+
}
|
|
223
|
+
`,
|
|
224
|
+
];
|
|
225
|
+
|
|
226
|
+
@property({ type: Object })
|
|
227
|
+
component: ComponentElement;
|
|
228
|
+
|
|
229
|
+
private emitRulesChange(rules: ValidationRule[]) {
|
|
230
|
+
this.executeEvent("onChange", new CustomEvent('change'), {
|
|
231
|
+
property: 'rules',
|
|
232
|
+
type: 'array',
|
|
233
|
+
value: rules,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
// Optimistically update local state for immediate UI feedback
|
|
237
|
+
if (this.inputHandlersValue?.value) {
|
|
238
|
+
this.inputHandlersValue = {
|
|
239
|
+
...this.inputHandlersValue,
|
|
240
|
+
value: { ...this.inputHandlersValue.value, rules }
|
|
241
|
+
};
|
|
242
|
+
} else {
|
|
243
|
+
this.inputHandlersValue = { ...this.inputHandlersValue, rules };
|
|
244
|
+
}
|
|
245
|
+
this.requestUpdate();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
private getRulesFromHandlers(): ValidationRule[] {
|
|
249
|
+
const handlers = this.inputHandlersValue;
|
|
250
|
+
if (handlers?.value?.rules) {
|
|
251
|
+
return handlers.value.rules;
|
|
252
|
+
}
|
|
253
|
+
if (handlers?.rules) {
|
|
254
|
+
return handlers.rules;
|
|
255
|
+
}
|
|
256
|
+
return [];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
private addRule(presetKey: RulePresetKey) {
|
|
260
|
+
const currentRules = this.getRulesFromHandlers();
|
|
261
|
+
const presetFn = RULE_PRESETS[presetKey];
|
|
262
|
+
const newRule = presetFn();
|
|
263
|
+
this.emitRulesChange([...currentRules, newRule]);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
private addCustomPattern() {
|
|
267
|
+
const currentRules = this.getRulesFromHandlers();
|
|
268
|
+
const newRule: ValidationRule = {
|
|
269
|
+
name: 'custom',
|
|
270
|
+
pattern: '',
|
|
271
|
+
message: 'Invalid format'
|
|
272
|
+
};
|
|
273
|
+
this.emitRulesChange([...currentRules, newRule]);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private handleNameChange(index: number, name: string) {
|
|
277
|
+
this.updateRule(index, { name });
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
private removeRule(index: number) {
|
|
281
|
+
const currentRules = [...this.getRulesFromHandlers()];
|
|
282
|
+
currentRules.splice(index, 1);
|
|
283
|
+
this.emitRulesChange(currentRules);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
private updateRule(index: number, updates: Partial<ValidationRule>) {
|
|
287
|
+
const currentRules = [...this.getRulesFromHandlers()];
|
|
288
|
+
currentRules[index] = { ...currentRules[index], ...updates };
|
|
289
|
+
this.emitRulesChange(currentRules);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
private getRuleType(rule: ValidationRule): string {
|
|
293
|
+
// Use custom name if available
|
|
294
|
+
if (rule.name) return rule.name;
|
|
295
|
+
if (rule.required) return 'required';
|
|
296
|
+
if (rule.type === 'email') return 'email';
|
|
297
|
+
if (rule.type === 'url') return 'url';
|
|
298
|
+
if (rule.minLength !== undefined) return 'minLength';
|
|
299
|
+
if (rule.maxLength !== undefined) return 'maxLength';
|
|
300
|
+
if (rule.min !== undefined) return 'min';
|
|
301
|
+
if (rule.max !== undefined) return 'max';
|
|
302
|
+
if (rule.pattern) return 'pattern';
|
|
303
|
+
return 'custom';
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
private isCustomPatternRule(rule: ValidationRule): boolean {
|
|
307
|
+
// A rule is a custom pattern if it has a name and pattern fields
|
|
308
|
+
return rule.name !== undefined && rule.pattern !== undefined;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
private getEditableValue(rule: ValidationRule): { key: string; value: any; type: 'number' | 'text' } | null {
|
|
312
|
+
if (rule.minLength !== undefined) return { key: 'minLength', value: rule.minLength, type: 'number' };
|
|
313
|
+
if (rule.maxLength !== undefined) return { key: 'maxLength', value: rule.maxLength, type: 'number' };
|
|
314
|
+
if (rule.min !== undefined) return { key: 'min', value: rule.min, type: 'number' };
|
|
315
|
+
if (rule.max !== undefined) return { key: 'max', value: rule.max, type: 'number' };
|
|
316
|
+
if (rule.pattern !== undefined) return { key: 'pattern', value: rule.pattern, type: 'text' };
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
private handleValueChange(index: number, key: string, value: string, type: 'number' | 'text') {
|
|
321
|
+
const parsedValue = type === 'number' ? (value ? parseInt(value, 10) : 0) : value;
|
|
322
|
+
this.updateRule(index, { [key]: parsedValue });
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
private handleMessageChange(index: number, message: string) {
|
|
326
|
+
this.updateRule(index, { message });
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
private handleWarningToggle(index: number, warningOnly: boolean) {
|
|
330
|
+
this.updateRule(index, { warningOnly });
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
private renderRuleItem(rule: ValidationRule, index: number) {
|
|
334
|
+
const ruleType = this.getRuleType(rule);
|
|
335
|
+
const editableValue = this.getEditableValue(rule);
|
|
336
|
+
const isCustomPattern = this.isCustomPatternRule(rule);
|
|
337
|
+
|
|
338
|
+
return html`
|
|
339
|
+
<div class="rule-item">
|
|
340
|
+
<div class="rule-header">
|
|
341
|
+
<span class="rule-type-badge">${ruleType}</span>
|
|
342
|
+
<div class="rule-actions">
|
|
343
|
+
<label class="warning-toggle">
|
|
344
|
+
<nr-checkbox
|
|
345
|
+
size="small"
|
|
346
|
+
.checked=${rule.warningOnly || false}
|
|
347
|
+
@nr-change=${(e: CustomEvent) => this.handleWarningToggle(index, e.detail?.checked || false)}
|
|
348
|
+
></nr-checkbox>
|
|
349
|
+
Warning only
|
|
350
|
+
</label>
|
|
351
|
+
<nr-button class="delete-btn" type="text" size="small" @click=${() => this.removeRule(index)}>×</nr-button>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
<div class="rule-fields">
|
|
355
|
+
${isCustomPattern ? html`
|
|
356
|
+
<div class="rule-field">
|
|
357
|
+
<span class="rule-field-label">Name</span>
|
|
358
|
+
<nr-input
|
|
359
|
+
size="small"
|
|
360
|
+
.value=${rule.name || ''}
|
|
361
|
+
placeholder="Rule name"
|
|
362
|
+
@nr-input=${(e: CustomEvent) => this.handleNameChange(index, e.detail?.value || '')}
|
|
363
|
+
></nr-input>
|
|
364
|
+
</div>
|
|
365
|
+
<div class="rule-field">
|
|
366
|
+
<span class="rule-field-label">Pattern</span>
|
|
367
|
+
<nr-input
|
|
368
|
+
size="small"
|
|
369
|
+
.value=${rule.pattern || ''}
|
|
370
|
+
placeholder="^[a-z]+$"
|
|
371
|
+
@nr-input=${(e: CustomEvent) => this.handleValueChange(index, 'pattern', e.detail?.value || '', 'text')}
|
|
372
|
+
></nr-input>
|
|
373
|
+
</div>
|
|
374
|
+
` : editableValue ? html`
|
|
375
|
+
<div class="rule-field">
|
|
376
|
+
<span class="rule-field-label">Value</span>
|
|
377
|
+
<nr-input
|
|
378
|
+
type=${editableValue.type}
|
|
379
|
+
size="small"
|
|
380
|
+
class=${editableValue.type === 'text' ? '' : 'small'}
|
|
381
|
+
.value=${String(editableValue.value)}
|
|
382
|
+
@nr-input=${(e: CustomEvent) => this.handleValueChange(index, editableValue.key, e.detail?.value || '', editableValue.type)}
|
|
383
|
+
></nr-input>
|
|
384
|
+
</div>
|
|
385
|
+
` : nothing}
|
|
386
|
+
<div class="rule-field">
|
|
387
|
+
<span class="rule-field-label">Message</span>
|
|
388
|
+
<nr-input
|
|
389
|
+
size="small"
|
|
390
|
+
.value=${rule.message || ''}
|
|
391
|
+
placeholder="Validation message"
|
|
392
|
+
@nr-input=${(e: CustomEvent) => this.handleMessageChange(index, e.detail?.value || '')}
|
|
393
|
+
></nr-input>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
`;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
override renderComponent() {
|
|
401
|
+
const rules: ValidationRule[] = this.getRulesFromHandlers();
|
|
402
|
+
|
|
403
|
+
return html`
|
|
404
|
+
<div class="validation-container">
|
|
405
|
+
<!-- Current Rules -->
|
|
406
|
+
<div class="section">
|
|
407
|
+
<div class="section-title">Validation Rules</div>
|
|
408
|
+
${rules.length > 0 ? html`
|
|
409
|
+
<div class="rules-list">
|
|
410
|
+
${rules.map((rule, index) => this.renderRuleItem(rule, index))}
|
|
411
|
+
</div>
|
|
412
|
+
` : html`
|
|
413
|
+
<div class="empty-state">No validation rules configured</div>
|
|
414
|
+
`}
|
|
415
|
+
</div>
|
|
416
|
+
|
|
417
|
+
<div class="divider"></div>
|
|
418
|
+
|
|
419
|
+
<!-- Add Rules -->
|
|
420
|
+
<div class="section">
|
|
421
|
+
<div class="section-title">Add Rule</div>
|
|
422
|
+
<div class="preset-buttons">
|
|
423
|
+
<nr-button dashed size="small" @click=${() => this.addRule('required')}>+ required</nr-button>
|
|
424
|
+
<nr-button dashed size="small" @click=${() => this.addRule('email')}>+ email</nr-button>
|
|
425
|
+
<nr-button dashed size="small" @click=${() => this.addRule('url')}>+ url</nr-button>
|
|
426
|
+
<nr-button dashed size="small" @click=${() => this.addRule('phone')}>+ phone</nr-button>
|
|
427
|
+
<nr-button dashed size="small" @click=${() => this.addRule('minLength')}>+ minLength</nr-button>
|
|
428
|
+
<nr-button dashed size="small" @click=${() => this.addRule('maxLength')}>+ maxLength</nr-button>
|
|
429
|
+
<nr-button dashed size="small" @click=${() => this.addRule('min')}>+ min</nr-button>
|
|
430
|
+
<nr-button dashed size="small" @click=${() => this.addRule('max')}>+ max</nr-button>
|
|
431
|
+
<nr-button dashed size="small" @click=${() => this.addRule('alphanumeric')}>+ alphanumeric</nr-button>
|
|
432
|
+
<nr-button dashed size="small" @click=${() => this.addRule('numeric')}>+ numeric</nr-button>
|
|
433
|
+
<nr-button dashed size="small" @click=${() => this.addRule('strongPassword')}>+ strongPassword</nr-button>
|
|
434
|
+
<nr-button dashed size="small" @click=${() => this.addCustomPattern()}>+ custom pattern</nr-button>
|
|
435
|
+
</div>
|
|
436
|
+
</div>
|
|
437
|
+
</div>
|
|
438
|
+
`;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
@@ -10,9 +10,7 @@ import { $context, getVar, setVar } from '../../../../../redux/store/context.ts'
|
|
|
10
10
|
import styles from "./GenerikWrapper.style.ts";
|
|
11
11
|
|
|
12
12
|
import "./DragWrapper/DragWrapper.ts";
|
|
13
|
-
import "./ResizeWrapper/ResizeWrapper.ts";
|
|
14
13
|
import "./QuickActionWrapper/QuickActionWrapper.ts";
|
|
15
|
-
import "../ComponentTitle/ComponentTitle.ts";
|
|
16
14
|
import { setDraggingComponentInfo } from '../../../../../redux/actions/component/setDraggingComponentInfo.ts';
|
|
17
15
|
import { updateComponentAttributes } from '../../../../../redux/actions/component/updateComponentAttributes.ts';
|
|
18
16
|
import { setCurrentComponentIdAction } from '../../../../../redux/actions/component/setCurrentComponentIdAction.ts';
|
|
@@ -54,8 +52,6 @@ export class GenerikComponentWrapper extends LitElement {
|
|
|
54
52
|
|
|
55
53
|
$environment.subscribe((environment: Environment) => {
|
|
56
54
|
this.environmentMode = environment.mode;
|
|
57
|
-
this.wrapperStyle =
|
|
58
|
-
environment.mode === ViewMode.Edit ? { } : {};
|
|
59
55
|
});
|
|
60
56
|
$hoveredComponent.subscribe((hoveredComponent: ComponentElement) => {
|
|
61
57
|
this.hoveredComponent = hoveredComponent;
|
|
@@ -113,11 +109,6 @@ export class GenerikComponentWrapper extends LitElement {
|
|
|
113
109
|
|
|
114
110
|
override connectedCallback() {
|
|
115
111
|
super.connectedCallback();
|
|
116
|
-
// Find the closest parent "generik-component-wrapper"
|
|
117
|
-
const closestWrapper = this.closest("generik-component-wrapper");
|
|
118
|
-
if (closestWrapper) {
|
|
119
|
-
} else {
|
|
120
|
-
}
|
|
121
112
|
}
|
|
122
113
|
|
|
123
114
|
render() {
|
|
@@ -127,14 +118,6 @@ export class GenerikComponentWrapper extends LitElement {
|
|
|
127
118
|
|
|
128
119
|
}
|
|
129
120
|
</style>
|
|
130
|
-
<resize-wrapper
|
|
131
|
-
.isSelected=${this.currentSelection.includes(this.component.uuid)}
|
|
132
|
-
.component=${{ ...this.component }}
|
|
133
|
-
.selectedComponent=${{ ...this.selectedComponent }}
|
|
134
|
-
.hoveredComponent=${{ ...this.hoveredComponent }}
|
|
135
|
-
.inputRef=${this.inputRef}
|
|
136
|
-
>
|
|
137
|
-
</resize-wrapper>
|
|
138
121
|
|
|
139
122
|
<drag-wrapper
|
|
140
123
|
.component=${{ ...this.component }}
|
|
@@ -169,13 +152,7 @@ export class GenerikComponentWrapper extends LitElement {
|
|
|
169
152
|
</div>
|
|
170
153
|
<slot></slot>
|
|
171
154
|
</div>
|
|
172
|
-
|
|
173
|
-
@dragInit=${(e) => (this.isDragInitiator = e.detail.value)}
|
|
174
|
-
.component=${{ ...this.component }}
|
|
175
|
-
.selectedComponent=${{ ...this.selectedComponent }}
|
|
176
|
-
.hoveredComponent=${{ ...this.hoveredComponent }}
|
|
177
|
-
|
|
178
|
-
></component-title>
|
|
155
|
+
|
|
179
156
|
</span>
|
|
180
157
|
</drag-wrapper>
|
|
181
158
|
`;
|
|
@@ -31,11 +31,12 @@ export const styles = css`
|
|
|
31
31
|
|
|
32
32
|
/* Main badge indicator (count or dot) */
|
|
33
33
|
.badge-indicator {
|
|
34
|
-
position: absolute;
|
|
34
|
+
/* position: absolute; */
|
|
35
35
|
top: 0;
|
|
36
36
|
right: 0;
|
|
37
|
-
|
|
38
|
-
transform
|
|
37
|
+
/* Temporarily disabled for demo - positions badge at exact corner */
|
|
38
|
+
/* transform: translate(50%, -50%); */
|
|
39
|
+
/* transform-origin: 100% 0%; */
|
|
39
40
|
z-index: var(--nuraly-badge-indicator-z-index, auto);
|
|
40
41
|
display: inline-flex;
|
|
41
42
|
align-items: center;
|
|
@@ -122,6 +122,7 @@ export class HyDatePickerElement extends NuralyUIBaseMixin(LitElement) implement
|
|
|
122
122
|
@property({ type: String }) placement: DatePickerPlacement = DatePickerPlacement.Auto;
|
|
123
123
|
@property({ type: String }) label = '';
|
|
124
124
|
@property({ type: String }) helper = '';
|
|
125
|
+
@property({ type: String }) placeholder = '';
|
|
125
126
|
@property({ type: String }) state: DatePickerState | INPUT_STATE = INPUT_STATE.Default;
|
|
126
127
|
@property({ type: Boolean, attribute: 'use-select-dropdowns' }) useSelectDropdowns = false;
|
|
127
128
|
|
|
@@ -482,6 +483,7 @@ export class HyDatePickerElement extends NuralyUIBaseMixin(LitElement) implement
|
|
|
482
483
|
id="${INPUT_FIELD_ID}"
|
|
483
484
|
.type="${this.INPUT_TYPE}"
|
|
484
485
|
.value="${this.inputFieldValue}"
|
|
486
|
+
.placeholder="${this.placeholder}"
|
|
485
487
|
.size="${this.size}"
|
|
486
488
|
.state="${this.state}"
|
|
487
489
|
.disabled="${this.disabled}"
|
|
@@ -61,6 +61,8 @@ import { ButtonType } from '../button/button.types.js';
|
|
|
61
61
|
* ```
|
|
62
62
|
*
|
|
63
63
|
* @fires nr-change - Dispatched when the selected option changes
|
|
64
|
+
*
|
|
65
|
+
* @slot helper-text - Helper text displayed below the radio group
|
|
64
66
|
*/
|
|
65
67
|
@customElement('nr-radio-group')
|
|
66
68
|
export class NrRadioGroupElement extends NuralyUIBaseMixin(LitElement) {
|
|
@@ -80,6 +82,7 @@ export class NrRadioGroupElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
80
82
|
@property({ type: String }) size: 'small' | 'medium' | 'large' = 'medium';
|
|
81
83
|
@property({ type: String }) position: 'left' | 'right' = 'left';
|
|
82
84
|
@property({ type: Boolean, attribute: 'auto-width' }) autoWidth: boolean = false;
|
|
85
|
+
@property({ type: String }) helper: string = '';
|
|
83
86
|
|
|
84
87
|
// Reactive Controllers - PROPERLY implemented now
|
|
85
88
|
private groupController = new RadioGroupController(this);
|
|
@@ -416,11 +419,14 @@ export class NrRadioGroupElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
416
419
|
}
|
|
417
420
|
|
|
418
421
|
protected override render() {
|
|
419
|
-
return html
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
422
|
+
return html`
|
|
423
|
+
${choose(this.type, [
|
|
424
|
+
[RadioButtonType.Default, () => this.renderOptionDefault()],
|
|
425
|
+
[RadioButtonType.Button, () => this.renderOptionsWithButtons()],
|
|
426
|
+
[RadioButtonType.Slot, () => this.renderOptionsWithSlots()],
|
|
427
|
+
[RadioButtonType.ButtonSlot, () => this.renderButtonsWithSlots()], // Special case for button with slots
|
|
428
|
+
])}
|
|
429
|
+
<slot name="helper-text"></slot>
|
|
430
|
+
`;
|
|
425
431
|
}
|
|
426
432
|
}
|