@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
|
@@ -25,39 +25,39 @@ export class TextareaBlock extends BaseElementBlock {
|
|
|
25
25
|
|
|
26
26
|
renderComponent() {
|
|
27
27
|
const textareaStyles = this.component?.style || {};
|
|
28
|
-
|
|
29
|
-
// Get properties from input
|
|
30
|
-
const value = this.
|
|
31
|
-
const placeholder = this.
|
|
32
|
-
const label = this.
|
|
33
|
-
const helperText = this.
|
|
34
|
-
const disabled = this.
|
|
35
|
-
const readonly = this.
|
|
36
|
-
const required = this.
|
|
37
|
-
const allowClear = this.
|
|
38
|
-
const showCount = this.
|
|
39
|
-
const autoResize = this.
|
|
40
|
-
|
|
28
|
+
|
|
29
|
+
// Get properties from inputHandlersValue (evaluated handlers) - prioritize over raw input values
|
|
30
|
+
const value = this.inputHandlersValue?.value ?? '';
|
|
31
|
+
const placeholder = this.inputHandlersValue?.placeholder ?? '';
|
|
32
|
+
const label = this.inputHandlersValue?.label ?? '';
|
|
33
|
+
const helperText = this.inputHandlersValue?.helperText ?? this.inputHandlersValue?.helper ?? '';
|
|
34
|
+
const disabled = this.inputHandlersValue?.disabled ?? (this.inputHandlersValue?.state === 'disabled' || false);
|
|
35
|
+
const readonly = this.inputHandlersValue?.readonly ?? false;
|
|
36
|
+
const required = this.inputHandlersValue?.required ?? false;
|
|
37
|
+
const allowClear = this.inputHandlersValue?.allowClear ?? false;
|
|
38
|
+
const showCount = this.inputHandlersValue?.showCount ?? false;
|
|
39
|
+
const autoResize = this.inputHandlersValue?.autoResize ?? false;
|
|
40
|
+
|
|
41
41
|
// Get styling properties
|
|
42
|
-
const size = this.
|
|
43
|
-
const variant = this.
|
|
44
|
-
const state = this.
|
|
45
|
-
const resize = this.
|
|
46
|
-
|
|
42
|
+
const size = this.inputHandlersValue?.size ?? 'medium';
|
|
43
|
+
const variant = this.inputHandlersValue?.variant ?? '';
|
|
44
|
+
const state = this.inputHandlersValue?.state ?? 'default';
|
|
45
|
+
const resize = this.inputHandlersValue?.resize ?? 'vertical';
|
|
46
|
+
|
|
47
47
|
// Get numeric properties
|
|
48
|
-
const rows = this.
|
|
49
|
-
const cols = this.
|
|
50
|
-
const maxLength = this.
|
|
51
|
-
const minHeight = this.
|
|
52
|
-
const maxHeight = this.
|
|
53
|
-
|
|
48
|
+
const rows = this.inputHandlersValue?.rows ?? 4;
|
|
49
|
+
const cols = this.inputHandlersValue?.cols;
|
|
50
|
+
const maxLength = this.inputHandlersValue?.maxLength;
|
|
51
|
+
const minHeight = this.inputHandlersValue?.minHeight;
|
|
52
|
+
const maxHeight = this.inputHandlersValue?.maxHeight;
|
|
53
|
+
|
|
54
54
|
// Get validation rules and other properties
|
|
55
|
-
const rules = this.inputHandlersValue?.rules
|
|
56
|
-
const name = this.
|
|
57
|
-
const autocomplete = this.
|
|
58
|
-
const validateOnChange = this.
|
|
59
|
-
const validateOnBlur = this.
|
|
60
|
-
const hasFeedback = this.
|
|
55
|
+
const rules = this.inputHandlersValue?.rules ?? [];
|
|
56
|
+
const name = this.inputHandlersValue?.name;
|
|
57
|
+
const autocomplete = this.inputHandlersValue?.autocomplete ?? 'off';
|
|
58
|
+
const validateOnChange = this.inputHandlersValue?.validateOnChange ?? true;
|
|
59
|
+
const validateOnBlur = this.inputHandlersValue?.validateOnBlur ?? true;
|
|
60
|
+
const hasFeedback = this.inputHandlersValue?.hasFeedback ?? false;
|
|
61
61
|
|
|
62
62
|
return html`
|
|
63
63
|
<nr-textarea
|
|
@@ -23,7 +23,7 @@ export class UsersDropdownBlock extends BaseElementBlock {
|
|
|
23
23
|
<nr-dropdown
|
|
24
24
|
trigger=${this.inputHandlersValue?.trigger ?? nothing}
|
|
25
25
|
.options=${this.inputHandlersValue?.users ?? []}
|
|
26
|
-
@click-item=${(e: CustomEvent) =>
|
|
26
|
+
@click-item=${(e: CustomEvent) => this.executeEvent('onClickItem', e, { value: e.detail })}
|
|
27
27
|
>
|
|
28
28
|
<nr-image
|
|
29
29
|
.src="${this.inputHandlersValue?.userImage ?? nothing}"
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { css, html } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
1
|
+
import { css, html, nothing } from "lit";
|
|
2
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
3
3
|
import { styleMap } from "lit/directives/style-map.js";
|
|
4
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
4
5
|
import { type ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
|
|
6
|
+
import { $components } from '../../../../../redux/store/component/store.ts';
|
|
5
7
|
import { BaseElementBlock } from "../../base/BaseElement.ts";
|
|
6
8
|
import { ref } from "lit/directives/ref.js";
|
|
9
|
+
import { renderComponent } from '../../../../../utils/render-util';
|
|
10
|
+
import { setCurrentComponentIdAction } from '../../../../../redux/actions/component/setCurrentComponentIdAction.ts';
|
|
11
|
+
import { setContextMenuEvent } from '../../../../../redux/actions/page/setContextMenuEvent.ts';
|
|
12
|
+
import { RuntimeHelpers } from '../../../../../utils/runtime-helpers.ts';
|
|
7
13
|
|
|
8
|
-
// Safely import @nuralyui/card
|
|
9
14
|
try {
|
|
10
15
|
await import("@nuralyui/card");
|
|
11
16
|
} catch (error) {
|
|
@@ -23,7 +28,34 @@ export class CardBlock extends BaseElementBlock {
|
|
|
23
28
|
@property({ type: Object })
|
|
24
29
|
item: any;
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
@property({ type: Boolean })
|
|
32
|
+
isViewMode = false;
|
|
33
|
+
|
|
34
|
+
@state()
|
|
35
|
+
childrenComponents: ComponentElement[] = [];
|
|
36
|
+
|
|
37
|
+
@state()
|
|
38
|
+
dragOverSituation = false;
|
|
39
|
+
|
|
40
|
+
override connectedCallback() {
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
this.updateChildrenComponents();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override willUpdate(changedProperties: Map<string, any>) {
|
|
46
|
+
super.willUpdate(changedProperties);
|
|
47
|
+
if (changedProperties.has("component")) {
|
|
48
|
+
this.updateChildrenComponents();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private updateChildrenComponents(): void {
|
|
53
|
+
this.childrenComponents = this.component?.childrenIds?.map((id) => {
|
|
54
|
+
return $components.get()[this.component?.application_id]?.find((component) => component.uuid === id);
|
|
55
|
+
}) ?? [];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
renderView() {
|
|
27
59
|
const cardStyles = this.component?.style || {};
|
|
28
60
|
|
|
29
61
|
// Get properties from input or inputHandlers
|
|
@@ -35,19 +67,89 @@ export class CardBlock extends BaseElementBlock {
|
|
|
35
67
|
|
|
36
68
|
return html`
|
|
37
69
|
<nr-card
|
|
70
|
+
id=${this.inputHandlersValue.id ?? nothing}
|
|
38
71
|
${ref(this.inputRef)}
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
data-component-uuid=${this.component?.uuid}
|
|
73
|
+
data-component-name=${this.component?.name}
|
|
74
|
+
style=${styleMap({
|
|
75
|
+
"width": RuntimeHelpers.extractUnit(cardStyles?.width) === "%" ? "100%" : cardStyles?.width ?? "auto",
|
|
76
|
+
...cardStyles
|
|
77
|
+
})}
|
|
78
|
+
class=${classMap({
|
|
79
|
+
"drag-over": this.dragOverSituation,
|
|
80
|
+
})}
|
|
81
|
+
.header=${title}
|
|
41
82
|
.size=${size}
|
|
42
83
|
?bordered=${bordered}
|
|
43
84
|
?hoverable=${hoverable}
|
|
44
85
|
?loading=${loading}
|
|
45
|
-
@
|
|
46
|
-
|
|
47
|
-
}
|
|
86
|
+
@mouseenter="${(e: Event) => this.executeEvent("onMouseEnter", {...e, unique: this.uniqueUUID})}"
|
|
87
|
+
@mouseleave="${(e: Event) => this.executeEvent("onMouseLeave", {...e, unique: this.uniqueUUID})}"
|
|
88
|
+
@click=${(e: MouseEvent) => this.executeEvent('onClick', e)}
|
|
48
89
|
>
|
|
49
|
-
<slot
|
|
90
|
+
<div slot="content">
|
|
91
|
+
${this.childrenComponents.length
|
|
92
|
+
? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode, {...this.component, uniqueUUID: this.uniqueUUID})
|
|
93
|
+
: nothing}
|
|
94
|
+
</div>
|
|
50
95
|
</nr-card>
|
|
51
96
|
`;
|
|
52
97
|
}
|
|
98
|
+
|
|
99
|
+
override renderComponent() {
|
|
100
|
+
const cardStyles = this.component?.style || {};
|
|
101
|
+
|
|
102
|
+
// Get properties from input or inputHandlers
|
|
103
|
+
const title = this.component?.input?.title?.value || this.inputHandlersValue?.title || '';
|
|
104
|
+
const bordered = this.component?.input?.bordered?.value ?? this.inputHandlersValue?.bordered ?? true;
|
|
105
|
+
const hoverable = this.component?.input?.hoverable?.value ?? this.inputHandlersValue?.hoverable ?? false;
|
|
106
|
+
const loading = this.component?.input?.loading?.value ?? this.inputHandlersValue?.loading ?? false;
|
|
107
|
+
const size = this.component?.input?.size?.value || this.inputHandlersValue?.size || 'default';
|
|
108
|
+
|
|
109
|
+
return html`
|
|
110
|
+
${this.isViewMode
|
|
111
|
+
? this.renderView()
|
|
112
|
+
: html`
|
|
113
|
+
<nr-card
|
|
114
|
+
${ref(this.inputRef)}
|
|
115
|
+
data-component-uuid=${this.component?.uuid}
|
|
116
|
+
data-component-name=${this.component?.name}
|
|
117
|
+
style=${styleMap(cardStyles)}
|
|
118
|
+
class=${classMap({
|
|
119
|
+
"drag-over": this.dragOverSituation,
|
|
120
|
+
})}
|
|
121
|
+
.header=${title}
|
|
122
|
+
.size=${size}
|
|
123
|
+
?bordered=${bordered}
|
|
124
|
+
?hoverable=${hoverable}
|
|
125
|
+
?loading=${loading}
|
|
126
|
+
@click=${(e: MouseEvent) => {
|
|
127
|
+
setContextMenuEvent(null);
|
|
128
|
+
this.executeEvent('onClick', e);
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
<div slot="content" style=${styleMap({ "min-height": this.childrenComponents.length ? "auto" : "100px" })}>
|
|
132
|
+
${this.childrenComponents.length
|
|
133
|
+
? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode, {...this.component, uniqueUUID: this.uniqueUUID})
|
|
134
|
+
: html`
|
|
135
|
+
<div
|
|
136
|
+
style="padding: 20px; text-align: center; color: #999;"
|
|
137
|
+
@click="${() => setCurrentComponentIdAction(this.component?.uuid)}"
|
|
138
|
+
>
|
|
139
|
+
Add or Drag an item into this card
|
|
140
|
+
<drag-wrapper
|
|
141
|
+
.where=${"inside"}
|
|
142
|
+
.message=${"Drop inside"}
|
|
143
|
+
.component=${{ ...this.component }}
|
|
144
|
+
.inputRef=${this.inputRef}
|
|
145
|
+
.isDragInitiator=${this.isDragInitiator}
|
|
146
|
+
>
|
|
147
|
+
</drag-wrapper>
|
|
148
|
+
</div>
|
|
149
|
+
`}
|
|
150
|
+
</div>
|
|
151
|
+
</nr-card>
|
|
152
|
+
`}
|
|
153
|
+
`;
|
|
154
|
+
}
|
|
53
155
|
}
|
|
@@ -31,4 +31,22 @@ export default css`
|
|
|
31
31
|
width: 100%;
|
|
32
32
|
height:100%
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
.container-placeholder {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
color: #64748b;
|
|
41
|
+
min-height: 200px;
|
|
42
|
+
width: 100%;
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
border: 2px dashed #cbd5e1;
|
|
45
|
+
gap: 12px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.container-placeholder nr-icon {
|
|
50
|
+
--nuraly-icon-size: 48px;
|
|
51
|
+
}
|
|
34
52
|
`;
|
|
@@ -30,8 +30,8 @@ export class VerticalContainer extends BaseElementBlock {
|
|
|
30
30
|
|
|
31
31
|
isDragging: boolean;
|
|
32
32
|
|
|
33
|
-
override
|
|
34
|
-
|
|
33
|
+
override connectedCallback() {
|
|
34
|
+
super.connectedCallback();
|
|
35
35
|
this.updateChildrenComponents();
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -72,7 +72,12 @@ export class VerticalContainer extends BaseElementBlock {
|
|
|
72
72
|
>
|
|
73
73
|
${this.childrenComponents.length
|
|
74
74
|
? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode, {...this.component, uniqueUUID : this.uniqueUUID})
|
|
75
|
-
:
|
|
75
|
+
: html`
|
|
76
|
+
<div class="container-placeholder">
|
|
77
|
+
<nr-icon name="layout-grid"></nr-icon>
|
|
78
|
+
<nr-label>No content</nr-label>
|
|
79
|
+
</div>
|
|
80
|
+
`}
|
|
76
81
|
</div>
|
|
77
82
|
`;
|
|
78
83
|
}
|
|
@@ -106,10 +111,11 @@ export class VerticalContainer extends BaseElementBlock {
|
|
|
106
111
|
? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode, {...this.component, uniqueUUID : this.uniqueUUID})
|
|
107
112
|
: html`
|
|
108
113
|
<div
|
|
109
|
-
class="
|
|
114
|
+
class="container-placeholder"
|
|
110
115
|
@click="${() => setCurrentComponentIdAction(this.component?.uuid)}"
|
|
111
116
|
>
|
|
112
|
-
|
|
117
|
+
<nr-icon name="layout-grid"></nr-icon>
|
|
118
|
+
<nr-label>Add or drag an item into this container</nr-label>
|
|
113
119
|
<drag-wrapper
|
|
114
120
|
.where=${"inside"}
|
|
115
121
|
.message=${"Drop inside"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.grid-col {
|
|
9
|
+
position: relative;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-height: 1px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.empty-message {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
width: 100%;
|
|
20
|
+
min-height: 60px;
|
|
21
|
+
border: 1px dashed #ccc;
|
|
22
|
+
color: #999;
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
position: relative;
|
|
25
|
+
background: rgba(0, 0, 0, 0.02);
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Col.ts
|
|
3
|
+
* @description Grid Column component that wraps nr-col from @nuralyui/grid
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { type ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
|
|
7
|
+
import { $components } from '../../../../../redux/store/component/store.ts';
|
|
8
|
+
import { html, nothing } from "lit";
|
|
9
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
10
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
11
|
+
import { renderComponent } from '../../../../../utils/render-util';
|
|
12
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
13
|
+
import styles from "./Col.style.ts";
|
|
14
|
+
import { BaseElementBlock } from "../../base/BaseElement.ts";
|
|
15
|
+
import { setCurrentComponentIdAction } from '../../../../../redux/actions/component/setCurrentComponentIdAction.ts';
|
|
16
|
+
import { setContextMenuEvent } from '../../../../../redux/actions/page/setContextMenuEvent.ts';
|
|
17
|
+
|
|
18
|
+
// Import nr-col from nuralyui grid
|
|
19
|
+
import "@nuralyui/grid";
|
|
20
|
+
|
|
21
|
+
/** Input property names that trigger re-render */
|
|
22
|
+
const COL_INPUT_PROPS = ['span', 'offset', 'order', 'pull', 'push', 'flex', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'] as const;
|
|
23
|
+
|
|
24
|
+
/** Parsed column properties for rendering */
|
|
25
|
+
interface ColProps {
|
|
26
|
+
span: number | undefined;
|
|
27
|
+
offset: number;
|
|
28
|
+
order: number | undefined;
|
|
29
|
+
pull: number;
|
|
30
|
+
push: number;
|
|
31
|
+
flex: string;
|
|
32
|
+
xs: number | object | undefined;
|
|
33
|
+
sm: number | object | undefined;
|
|
34
|
+
md: number | object | undefined;
|
|
35
|
+
lg: number | object | undefined;
|
|
36
|
+
xl: number | object | undefined;
|
|
37
|
+
xxl: number | object | undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@customElement("grid-col-block")
|
|
41
|
+
export class GridCol extends BaseElementBlock {
|
|
42
|
+
static styles = styles;
|
|
43
|
+
|
|
44
|
+
@property({ type: Object }) component: ComponentElement;
|
|
45
|
+
@property({ type: Object }) item: any;
|
|
46
|
+
@property({ type: Boolean }) isViewMode = false;
|
|
47
|
+
|
|
48
|
+
@state() childrenComponents: ComponentElement[] = [];
|
|
49
|
+
@state() containerRef = createRef();
|
|
50
|
+
|
|
51
|
+
override connectedCallback() {
|
|
52
|
+
super.connectedCallback();
|
|
53
|
+
this.updateChildrenComponents();
|
|
54
|
+
|
|
55
|
+
// Register callbacks for input changes to trigger re-render
|
|
56
|
+
COL_INPUT_PROPS.forEach(prop => this.registerCallback(prop, () => this.requestUpdate()));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override willUpdate(changedProperties: Map<string, any>) {
|
|
60
|
+
super.willUpdate(changedProperties);
|
|
61
|
+
if (changedProperties.has("component")) {
|
|
62
|
+
this.updateChildrenComponents();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private updateChildrenComponents(): void {
|
|
67
|
+
this.childrenComponents = this.component?.childrenIds?.map((id) => {
|
|
68
|
+
return $components.get()[this.component?.application_id]?.find((component) => component.uuid === id);
|
|
69
|
+
}).filter(Boolean) ?? [];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Parse numeric value from input (handles string or number)
|
|
74
|
+
*/
|
|
75
|
+
private parseNumeric(value: any, defaultValue?: number): number | undefined {
|
|
76
|
+
if (value === undefined || value === null || value === '') return defaultValue;
|
|
77
|
+
const num = Number(value);
|
|
78
|
+
return isNaN(num) ? defaultValue : num;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Parse responsive breakpoint value
|
|
83
|
+
* Can be a number or an object { span, offset, order, pull, push }
|
|
84
|
+
*/
|
|
85
|
+
private parseBreakpoint(value: any): number | object | undefined {
|
|
86
|
+
if (value === undefined || value === null || value === '') return undefined;
|
|
87
|
+
if (typeof value === 'number') return value;
|
|
88
|
+
if (typeof value === 'string' && !isNaN(Number(value))) return Number(value);
|
|
89
|
+
if (typeof value === 'object') return value;
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get all column properties from input handlers
|
|
95
|
+
*/
|
|
96
|
+
private getColProps(): ColProps {
|
|
97
|
+
const input = this.inputHandlersValue;
|
|
98
|
+
return {
|
|
99
|
+
span: this.parseNumeric(input?.span),
|
|
100
|
+
offset: this.parseNumeric(input?.offset, 0)!,
|
|
101
|
+
order: this.parseNumeric(input?.order),
|
|
102
|
+
pull: this.parseNumeric(input?.pull, 0)!,
|
|
103
|
+
push: this.parseNumeric(input?.push, 0)!,
|
|
104
|
+
flex: input?.flex || '',
|
|
105
|
+
xs: this.parseBreakpoint(input?.xs),
|
|
106
|
+
sm: this.parseBreakpoint(input?.sm),
|
|
107
|
+
md: this.parseBreakpoint(input?.md),
|
|
108
|
+
lg: this.parseBreakpoint(input?.lg),
|
|
109
|
+
xl: this.parseBreakpoint(input?.xl),
|
|
110
|
+
xxl: this.parseBreakpoint(input?.xxl),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Render children components
|
|
116
|
+
*/
|
|
117
|
+
private renderChildren() {
|
|
118
|
+
return this.childrenComponents.length
|
|
119
|
+
? renderComponent(
|
|
120
|
+
this.childrenComponents.map((component) => ({ ...component, item: this.item })),
|
|
121
|
+
this.item,
|
|
122
|
+
this.isViewMode,
|
|
123
|
+
{ ...this.component, uniqueUUID: this.uniqueUUID }
|
|
124
|
+
)
|
|
125
|
+
: nothing;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Render empty state placeholder for editor mode
|
|
130
|
+
*/
|
|
131
|
+
private renderEmptyState() {
|
|
132
|
+
return html`
|
|
133
|
+
<div
|
|
134
|
+
class="empty-message"
|
|
135
|
+
@click="${() => setCurrentComponentIdAction(this.component?.uuid)}"
|
|
136
|
+
>
|
|
137
|
+
Drop content here
|
|
138
|
+
<drag-wrapper
|
|
139
|
+
.where=${"inside"}
|
|
140
|
+
.message=${"Drop inside"}
|
|
141
|
+
.component=${{ ...this.component }}
|
|
142
|
+
.inputRef=${this.inputRef}
|
|
143
|
+
.isDragInitiator=${this.isDragInitiator}
|
|
144
|
+
>
|
|
145
|
+
</drag-wrapper>
|
|
146
|
+
</div>
|
|
147
|
+
`;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
override renderComponent() {
|
|
151
|
+
const props = this.getColProps();
|
|
152
|
+
|
|
153
|
+
if (this.isViewMode) {
|
|
154
|
+
return html`
|
|
155
|
+
<nr-col
|
|
156
|
+
${ref(this.inputRef)}
|
|
157
|
+
data-component-uuid=${this.component?.uuid}
|
|
158
|
+
data-component-name=${this.component?.name}
|
|
159
|
+
style=${styleMap(this.getStyles())}
|
|
160
|
+
span=${props.span ?? nothing}
|
|
161
|
+
offset=${props.offset}
|
|
162
|
+
order=${props.order ?? nothing}
|
|
163
|
+
pull=${props.pull}
|
|
164
|
+
push=${props.push}
|
|
165
|
+
flex=${props.flex || nothing}
|
|
166
|
+
.xs=${props.xs}
|
|
167
|
+
.sm=${props.sm}
|
|
168
|
+
.md=${props.md}
|
|
169
|
+
.lg=${props.lg}
|
|
170
|
+
.xl=${props.xl}
|
|
171
|
+
.xxl=${props.xxl}
|
|
172
|
+
>
|
|
173
|
+
${this.renderChildren()}
|
|
174
|
+
</nr-col>
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return html`
|
|
179
|
+
<nr-col
|
|
180
|
+
${ref(this.inputRef)}
|
|
181
|
+
${ref(this.containerRef)}
|
|
182
|
+
data-component-uuid=${this.component?.uuid}
|
|
183
|
+
data-component-name=${this.component?.name}
|
|
184
|
+
@click="${(e: Event) => {
|
|
185
|
+
setContextMenuEvent(null);
|
|
186
|
+
this.executeEvent("onClick", e);
|
|
187
|
+
}}"
|
|
188
|
+
style=${styleMap({
|
|
189
|
+
...this.getStyles(),
|
|
190
|
+
"min-height": this.childrenComponents.length ? "auto" : "60px",
|
|
191
|
+
})}
|
|
192
|
+
span=${props.span ?? nothing}
|
|
193
|
+
offset=${props.offset}
|
|
194
|
+
order=${props.order ?? nothing}
|
|
195
|
+
pull=${props.pull}
|
|
196
|
+
push=${props.push}
|
|
197
|
+
flex=${props.flex || nothing}
|
|
198
|
+
.xs=${props.xs}
|
|
199
|
+
.sm=${props.sm}
|
|
200
|
+
.md=${props.md}
|
|
201
|
+
.lg=${props.lg}
|
|
202
|
+
.xl=${props.xl}
|
|
203
|
+
.xxl=${props.xxl}
|
|
204
|
+
>
|
|
205
|
+
${this.childrenComponents.length ? this.renderChildren() : this.renderEmptyState()}
|
|
206
|
+
</nr-col>
|
|
207
|
+
`;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.grid-row {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-flow: row wrap;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.grid-row.no-wrap {
|
|
17
|
+
flex-wrap: nowrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Alignment */
|
|
21
|
+
.grid-row.align-top {
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.grid-row.align-middle {
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.grid-row.align-bottom {
|
|
30
|
+
align-items: flex-end;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.grid-row.align-stretch {
|
|
34
|
+
align-items: stretch;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Justify */
|
|
38
|
+
.grid-row.justify-start {
|
|
39
|
+
justify-content: flex-start;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.grid-row.justify-end {
|
|
43
|
+
justify-content: flex-end;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.grid-row.justify-center {
|
|
47
|
+
justify-content: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.grid-row.justify-space-around {
|
|
51
|
+
justify-content: space-around;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.grid-row.justify-space-between {
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.grid-row.justify-space-evenly {
|
|
59
|
+
justify-content: space-evenly;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.empty-message {
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
width: 100%;
|
|
67
|
+
min-height: 100px;
|
|
68
|
+
border: 2px dashed #ccc;
|
|
69
|
+
color: #999;
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
`;
|