@nuraly/lumenui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -0
- package/README.md +248 -0
- package/dist/nuralyui.bundle.js +29209 -0
- package/dist/nuralyui.bundle.js.gz +0 -0
- package/dist/src/components/alert/alert.component.d.ts +103 -0
- package/dist/src/components/alert/alert.component.js +225 -0
- package/dist/src/components/alert/alert.style.d.ts +14 -0
- package/dist/src/components/alert/alert.style.js +191 -0
- package/dist/src/components/alert/alert.types.d.ts +46 -0
- package/dist/src/components/alert/alert.types.js +7 -0
- package/dist/src/components/alert/bundle.js +231 -0
- package/dist/src/components/alert/bundle.js.gz +0 -0
- package/dist/src/components/alert/index.d.ts +8 -0
- package/dist/src/components/alert/index.js +8 -0
- package/dist/src/components/alert/react.d.ts +5 -0
- package/dist/src/components/alert/react.js +17 -0
- package/dist/src/components/badge/badge.component.d.ts +148 -0
- package/dist/src/components/badge/badge.component.js +270 -0
- package/dist/src/components/badge/badge.style.d.ts +14 -0
- package/dist/src/components/badge/badge.style.js +250 -0
- package/dist/src/components/badge/badge.types.d.ts +84 -0
- package/dist/src/components/badge/badge.types.js +7 -0
- package/dist/src/components/badge/bundle.js +277 -0
- package/dist/src/components/badge/bundle.js.gz +0 -0
- package/dist/src/components/badge/index.d.ts +2 -0
- package/dist/src/components/badge/index.js +2 -0
- package/dist/src/components/badge/react.d.ts +3 -0
- package/dist/src/components/badge/react.js +10 -0
- package/dist/src/components/breadcrumb/breadcrumb.component.d.ts +121 -0
- package/dist/src/components/breadcrumb/breadcrumb.component.js +257 -0
- package/dist/src/components/breadcrumb/breadcrumb.style.d.ts +14 -0
- package/dist/src/components/breadcrumb/breadcrumb.style.js +153 -0
- package/dist/src/components/breadcrumb/breadcrumb.types.d.ts +63 -0
- package/dist/src/components/breadcrumb/breadcrumb.types.js +7 -0
- package/dist/src/components/breadcrumb/bundle.js +213 -0
- package/dist/src/components/breadcrumb/bundle.js.gz +0 -0
- package/dist/src/components/breadcrumb/index.d.ts +2 -0
- package/dist/src/components/breadcrumb/index.js +2 -0
- package/dist/src/components/breadcrumb/react.d.ts +5 -0
- package/dist/src/components/breadcrumb/react.js +12 -0
- package/dist/src/components/button/bundle.js +606 -0
- package/dist/src/components/button/bundle.js.gz +0 -0
- package/dist/src/components/button/button.component.d.ts +96 -0
- package/dist/src/components/button/button.component.js +312 -0
- package/dist/src/components/button/button.style.d.ts +10 -0
- package/dist/src/components/button/button.style.js +535 -0
- package/dist/src/components/button/button.types.d.ts +57 -0
- package/dist/src/components/button/button.types.js +2 -0
- package/dist/src/components/button/index.d.ts +2 -0
- package/dist/src/components/button/index.js +2 -0
- package/dist/src/components/button/react.d.ts +5 -0
- package/dist/src/components/button/react.js +12 -0
- package/dist/src/components/canvas/base-canvas.component.d.ts +177 -0
- package/dist/src/components/canvas/base-canvas.component.js +865 -0
- package/dist/src/components/canvas/bundle.js +16664 -0
- package/dist/src/components/canvas/bundle.js.gz +0 -0
- package/dist/src/components/canvas/canvas.component.d.ts +2 -0
- package/dist/src/components/canvas/canvas.component.js +295 -0
- package/dist/src/components/canvas/canvas.constants.d.ts +66 -0
- package/dist/src/components/canvas/canvas.constants.js +61 -0
- package/dist/src/components/canvas/chatbot-panel.style.d.ts +11 -0
- package/dist/src/components/canvas/chatbot-panel.style.js +189 -0
- package/dist/src/components/canvas/index.d.ts +13 -0
- package/dist/src/components/canvas/index.js +21 -0
- package/dist/src/components/canvas/react.d.ts +354 -0
- package/dist/src/components/canvas/react.js +41 -0
- package/dist/src/components/canvas/whiteboard-canvas.component.d.ts +63 -0
- package/dist/src/components/canvas/whiteboard-canvas.component.js +356 -0
- package/dist/src/components/canvas/whiteboard-canvas.style.d.ts +7 -0
- package/dist/src/components/canvas/whiteboard-canvas.style.js +1011 -0
- package/dist/src/components/canvas/whiteboard-node.component.d.ts +87 -0
- package/dist/src/components/canvas/whiteboard-node.component.js +809 -0
- package/dist/src/components/canvas/whiteboard-node.style.d.ts +7 -0
- package/dist/src/components/canvas/whiteboard-node.style.js +775 -0
- package/dist/src/components/canvas/workflow-canvas.component.d.ts +150 -0
- package/dist/src/components/canvas/workflow-canvas.component.js +1468 -0
- package/dist/src/components/canvas/workflow-canvas.style.d.ts +8 -0
- package/dist/src/components/canvas/workflow-canvas.style.js +2903 -0
- package/dist/src/components/canvas/workflow-canvas.types.d.ts +710 -0
- package/dist/src/components/canvas/workflow-canvas.types.js +2305 -0
- package/dist/src/components/canvas/workflow-node.component.d.ts +96 -0
- package/dist/src/components/canvas/workflow-node.component.js +752 -0
- package/dist/src/components/canvas/workflow-node.style.d.ts +8 -0
- package/dist/src/components/canvas/workflow-node.style.js +1053 -0
- package/dist/src/components/card/bundle.js +69 -0
- package/dist/src/components/card/bundle.js.gz +0 -0
- package/dist/src/components/card/card.component.d.ts +30 -0
- package/dist/src/components/card/card.component.js +64 -0
- package/dist/src/components/card/card.style.d.ts +2 -0
- package/dist/src/components/card/card.style.js +62 -0
- package/dist/src/components/card/card.types.d.ts +17 -0
- package/dist/src/components/card/card.types.js +2 -0
- package/dist/src/components/card/index.d.ts +3 -0
- package/dist/src/components/card/index.js +3 -0
- package/dist/src/components/card/react.d.ts +5 -0
- package/dist/src/components/card/react.js +12 -0
- package/dist/src/components/carousel/bundle.js +96 -0
- package/dist/src/components/carousel/bundle.js.gz +0 -0
- package/dist/src/components/carousel/carousel.component.d.ts +19 -0
- package/dist/src/components/carousel/carousel.component.js +128 -0
- package/dist/src/components/carousel/carousel.style.d.ts +2 -0
- package/dist/src/components/carousel/carousel.style.js +68 -0
- package/dist/src/components/carousel/index.d.ts +2 -0
- package/dist/src/components/carousel/index.js +2 -0
- package/dist/src/components/carousel/react.d.ts +5 -0
- package/dist/src/components/carousel/react.js +12 -0
- package/dist/src/components/chatbot/bundle.js +2527 -0
- package/dist/src/components/chatbot/bundle.js.gz +0 -0
- package/dist/src/components/chatbot/chatbot.component.d.ts +215 -0
- package/dist/src/components/chatbot/chatbot.component.js +1097 -0
- package/dist/src/components/chatbot/chatbot.style.d.ts +3 -0
- package/dist/src/components/chatbot/chatbot.style.js +1638 -0
- package/dist/src/components/chatbot/chatbot.types.d.ts +246 -0
- package/dist/src/components/chatbot/chatbot.types.js +124 -0
- package/dist/src/components/chatbot/index.d.ts +13 -0
- package/dist/src/components/chatbot/index.js +20 -0
- package/dist/src/components/chatbot/react.d.ts +54 -0
- package/dist/src/components/chatbot/react.js +55 -0
- package/dist/src/components/checkbox/bundle.js +352 -0
- package/dist/src/components/checkbox/bundle.js.gz +0 -0
- package/dist/src/components/checkbox/checkbox.component.d.ts +62 -0
- package/dist/src/components/checkbox/checkbox.component.js +178 -0
- package/dist/src/components/checkbox/checkbox.style.d.ts +2 -0
- package/dist/src/components/checkbox/checkbox.style.js +323 -0
- package/dist/src/components/checkbox/checkbox.types.d.ts +6 -0
- package/dist/src/components/checkbox/checkbox.types.js +2 -0
- package/dist/src/components/checkbox/index.d.ts +2 -0
- package/dist/src/components/checkbox/index.js +2 -0
- package/dist/src/components/checkbox/react.d.ts +5 -0
- package/dist/src/components/checkbox/react.js +12 -0
- package/dist/src/components/code-editor/bundle.js +55 -0
- package/dist/src/components/code-editor/bundle.js.gz +0 -0
- package/dist/src/components/code-editor/code-editor.component.d.ts +119 -0
- package/dist/src/components/code-editor/code-editor.component.js +532 -0
- package/dist/src/components/code-editor/code-editor.style.d.ts +7 -0
- package/dist/src/components/code-editor/code-editor.style.js +39 -0
- package/dist/src/components/code-editor/code-editor.types.d.ts +39 -0
- package/dist/src/components/code-editor/code-editor.types.js +22 -0
- package/dist/src/components/code-editor/index.d.ts +9 -0
- package/dist/src/components/code-editor/index.js +9 -0
- package/dist/src/components/collapse/bundle.js +308 -0
- package/dist/src/components/collapse/bundle.js.gz +0 -0
- package/dist/src/components/collapse/collapse.component.d.ts +93 -0
- package/dist/src/components/collapse/collapse.component.js +322 -0
- package/dist/src/components/collapse/collapse.style.d.ts +11 -0
- package/dist/src/components/collapse/collapse.style.js +234 -0
- package/dist/src/components/collapse/collapse.type.d.ts +79 -0
- package/dist/src/components/collapse/collapse.type.js +11 -0
- package/dist/src/components/collapse/index.d.ts +2 -0
- package/dist/src/components/collapse/index.js +2 -0
- package/dist/src/components/collapse/react.d.ts +6 -0
- package/dist/src/components/collapse/react.js +13 -0
- package/dist/src/components/colorpicker/bundle.js +242 -0
- package/dist/src/components/colorpicker/bundle.js.gz +0 -0
- package/dist/src/components/colorpicker/color-holder.component.d.ts +50 -0
- package/dist/src/components/colorpicker/color-holder.component.js +116 -0
- package/dist/src/components/colorpicker/color-holder.style.d.ts +2 -0
- package/dist/src/components/colorpicker/color-holder.style.js +45 -0
- package/dist/src/components/colorpicker/color-picker.component.d.ts +178 -0
- package/dist/src/components/colorpicker/color-picker.component.js +374 -0
- package/dist/src/components/colorpicker/color-picker.style.d.ts +10 -0
- package/dist/src/components/colorpicker/color-picker.style.js +86 -0
- package/dist/src/components/colorpicker/color-picker.types.d.ts +60 -0
- package/dist/src/components/colorpicker/color-picker.types.js +2 -0
- package/dist/src/components/colorpicker/default-color-sets.component.d.ts +45 -0
- package/dist/src/components/colorpicker/default-color-sets.component.js +121 -0
- package/dist/src/components/colorpicker/default-color-sets.style.d.ts +2 -0
- package/dist/src/components/colorpicker/default-color-sets.style.js +34 -0
- package/dist/src/components/colorpicker/index.d.ts +3 -0
- package/dist/src/components/colorpicker/index.js +3 -0
- package/dist/src/components/colorpicker/react.d.ts +6 -0
- package/dist/src/components/colorpicker/react.js +13 -0
- package/dist/src/components/console/react.d.ts +340 -0
- package/dist/src/components/console/react.js +13 -0
- package/dist/src/components/container/bundle.js +161 -0
- package/dist/src/components/container/bundle.js.gz +0 -0
- package/dist/src/components/container/container.component.d.ts +85 -0
- package/dist/src/components/container/container.component.js +223 -0
- package/dist/src/components/container/container.style.d.ts +6 -0
- package/dist/src/components/container/container.style.js +146 -0
- package/dist/src/components/container/container.types.d.ts +67 -0
- package/dist/src/components/container/container.types.js +5 -0
- package/dist/src/components/container/index.d.ts +3 -0
- package/dist/src/components/container/index.js +3 -0
- package/dist/src/components/container/react.d.ts +3 -0
- package/dist/src/components/container/react.js +10 -0
- package/dist/src/components/datepicker/bundle.js +706 -0
- package/dist/src/components/datepicker/bundle.js.gz +0 -0
- package/dist/src/components/datepicker/datepicker.component.d.ts +190 -0
- package/dist/src/components/datepicker/datepicker.component.js +673 -0
- package/dist/src/components/datepicker/datepicker.constant.d.ts +60 -0
- package/dist/src/components/datepicker/datepicker.constant.js +60 -0
- package/dist/src/components/datepicker/datepicker.style.d.ts +17 -0
- package/dist/src/components/datepicker/datepicker.style.js +453 -0
- package/dist/src/components/datepicker/datepicker.style.variables.d.ts +2 -0
- package/dist/src/components/datepicker/datepicker.style.variables.js +119 -0
- package/dist/src/components/datepicker/datepicker.types.d.ts +142 -0
- package/dist/src/components/datepicker/datepicker.types.js +75 -0
- package/dist/src/components/datepicker/index.d.ts +4 -0
- package/dist/src/components/datepicker/index.js +4 -0
- package/dist/src/components/datepicker/react.d.ts +16 -0
- package/dist/src/components/datepicker/react.js +23 -0
- package/dist/src/components/db-connection-select/bundle.js +308 -0
- package/dist/src/components/db-connection-select/bundle.js.gz +0 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.d.ts +105 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.js +573 -0
- package/dist/src/components/db-connection-select/index.d.ts +7 -0
- package/dist/src/components/db-connection-select/index.js +7 -0
- package/dist/src/components/divider/bundle.js +143 -0
- package/dist/src/components/divider/bundle.js.gz +0 -0
- package/dist/src/components/divider/divider.component.d.ts +90 -0
- package/dist/src/components/divider/divider.component.js +168 -0
- package/dist/src/components/divider/divider.style.d.ts +3 -0
- package/dist/src/components/divider/divider.style.js +139 -0
- package/dist/src/components/divider/divider.types.d.ts +55 -0
- package/dist/src/components/divider/divider.types.js +6 -0
- package/dist/src/components/divider/index.d.ts +3 -0
- package/dist/src/components/divider/index.js +3 -0
- package/dist/src/components/divider/react.d.ts +3 -0
- package/dist/src/components/divider/react.js +10 -0
- package/dist/src/components/document/bundle.js +242 -0
- package/dist/src/components/document/bundle.js.gz +0 -0
- package/dist/src/components/document/document.component.d.ts +27 -0
- package/dist/src/components/document/document.component.js +136 -0
- package/dist/src/components/document/document.style.d.ts +3 -0
- package/dist/src/components/document/document.style.js +210 -0
- package/dist/src/components/document/document.types.d.ts +68 -0
- package/dist/src/components/document/document.types.js +7 -0
- package/dist/src/components/document/index.d.ts +3 -0
- package/dist/src/components/document/index.js +3 -0
- package/dist/src/components/document/react.d.ts +8 -0
- package/dist/src/components/document/react.js +15 -0
- package/dist/src/components/dropdown/bundle.js +528 -0
- package/dist/src/components/dropdown/bundle.js.gz +0 -0
- package/dist/src/components/dropdown/dropdown.component.d.ts +120 -0
- package/dist/src/components/dropdown/dropdown.component.js +390 -0
- package/dist/src/components/dropdown/dropdown.style.d.ts +2 -0
- package/dist/src/components/dropdown/dropdown.style.js +460 -0
- package/dist/src/components/dropdown/dropdown.types.d.ts +99 -0
- package/dist/src/components/dropdown/dropdown.types.js +2 -0
- package/dist/src/components/dropdown/index.d.ts +3 -0
- package/dist/src/components/dropdown/index.js +3 -0
- package/dist/src/components/dropdown/react.d.ts +7 -0
- package/dist/src/components/dropdown/react.js +14 -0
- package/dist/src/components/file-upload/bundle.js +472 -0
- package/dist/src/components/file-upload/bundle.js.gz +0 -0
- package/dist/src/components/file-upload/file-upload.component.d.ts +43 -0
- package/dist/src/components/file-upload/file-upload.component.js +398 -0
- package/dist/src/components/file-upload/index.d.ts +2 -0
- package/dist/src/components/file-upload/index.js +2 -0
- package/dist/src/components/file-upload/react.d.ts +7 -0
- package/dist/src/components/file-upload/react.js +14 -0
- package/dist/src/components/file-upload/styles.d.ts +2 -0
- package/dist/src/components/file-upload/styles.js +373 -0
- package/dist/src/components/file-upload/types.d.ts +11 -0
- package/dist/src/components/file-upload/types.js +2 -0
- package/dist/src/components/file-upload/utils.d.ts +6 -0
- package/dist/src/components/file-upload/utils.js +24 -0
- package/dist/src/components/flex/bundle.js +114 -0
- package/dist/src/components/flex/bundle.js.gz +0 -0
- package/dist/src/components/flex/flex.component.d.ts +89 -0
- package/dist/src/components/flex/flex.component.js +178 -0
- package/dist/src/components/flex/flex.style.d.ts +6 -0
- package/dist/src/components/flex/flex.style.js +101 -0
- package/dist/src/components/flex/flex.types.d.ts +63 -0
- package/dist/src/components/flex/flex.types.js +5 -0
- package/dist/src/components/flex/index.d.ts +3 -0
- package/dist/src/components/flex/index.js +3 -0
- package/dist/src/components/flex/react.d.ts +3 -0
- package/dist/src/components/flex/react.js +10 -0
- package/dist/src/components/form/bundle.js +98 -0
- package/dist/src/components/form/bundle.js.gz +0 -0
- package/dist/src/components/form/form.component.d.ts +279 -0
- package/dist/src/components/form/form.component.js +644 -0
- package/dist/src/components/form/form.style.d.ts +7 -0
- package/dist/src/components/form/form.style.js +68 -0
- package/dist/src/components/form/form.types.d.ts +92 -0
- package/dist/src/components/form/form.types.js +38 -0
- package/dist/src/components/form/index.d.ts +10 -0
- package/dist/src/components/form/index.js +13 -0
- package/dist/src/components/grid/bundle.js +202 -0
- package/dist/src/components/grid/bundle.js.gz +0 -0
- package/dist/src/components/grid/col.component.d.ts +103 -0
- package/dist/src/components/grid/col.component.js +253 -0
- package/dist/src/components/grid/col.style.d.ts +6 -0
- package/dist/src/components/grid/col.style.js +117 -0
- package/dist/src/components/grid/grid.types.d.ts +80 -0
- package/dist/src/components/grid/grid.types.js +16 -0
- package/dist/src/components/grid/index.d.ts +4 -0
- package/dist/src/components/grid/index.js +4 -0
- package/dist/src/components/grid/react.d.ts +5 -0
- package/dist/src/components/grid/react.js +17 -0
- package/dist/src/components/grid/row.component.d.ts +83 -0
- package/dist/src/components/grid/row.component.js +197 -0
- package/dist/src/components/grid/row.style.d.ts +6 -0
- package/dist/src/components/grid/row.style.js +68 -0
- package/dist/src/components/icon/bundle.js +340 -0
- package/dist/src/components/icon/bundle.js.gz +0 -0
- package/dist/src/components/icon/icon.component.d.ts +64 -0
- package/dist/src/components/icon/icon.component.js +207 -0
- package/dist/src/components/icon/icon.style.d.ts +2 -0
- package/dist/src/components/icon/icon.style.js +211 -0
- package/dist/src/components/icon/icon.types.d.ts +5 -0
- package/dist/src/components/icon/icon.types.js +2 -0
- package/dist/src/components/icon/icon.variables.d.ts +17 -0
- package/dist/src/components/icon/icon.variables.js +132 -0
- package/dist/src/components/icon/index.d.ts +2 -0
- package/dist/src/components/icon/index.js +2 -0
- package/dist/src/components/icon/react.d.ts +3 -0
- package/dist/src/components/icon/react.js +9 -0
- package/dist/src/components/iconpicker/bundle.js +2811 -0
- package/dist/src/components/iconpicker/bundle.js.gz +0 -0
- package/dist/src/components/iconpicker/icon-picker.component.d.ts +119 -0
- package/dist/src/components/iconpicker/icon-picker.component.js +337 -0
- package/dist/src/components/iconpicker/icon-picker.constant.d.ts +15 -0
- package/dist/src/components/iconpicker/icon-picker.constant.js +31 -0
- package/dist/src/components/iconpicker/icon-picker.style.d.ts +8 -0
- package/dist/src/components/iconpicker/icon-picker.style.js +216 -0
- package/dist/src/components/iconpicker/icon-picker.types.d.ts +49 -0
- package/dist/src/components/iconpicker/icon-picker.types.js +7 -0
- package/dist/src/components/iconpicker/index.d.ts +9 -0
- package/dist/src/components/iconpicker/index.js +9 -0
- package/dist/src/components/iconpicker/react.d.ts +14 -0
- package/dist/src/components/iconpicker/react.js +21 -0
- package/dist/src/components/image/bundle.js +98 -0
- package/dist/src/components/image/bundle.js.gz +0 -0
- package/dist/src/components/image/image.component.d.ts +31 -0
- package/dist/src/components/image/image.component.js +143 -0
- package/dist/src/components/image/image.style.d.ts +3 -0
- package/dist/src/components/image/image.style.js +83 -0
- package/dist/src/components/image/image.types.d.ts +68 -0
- package/dist/src/components/image/image.types.js +7 -0
- package/dist/src/components/image/index.d.ts +3 -0
- package/dist/src/components/image/index.js +3 -0
- package/dist/src/components/image/react.d.ts +8 -0
- package/dist/src/components/image/react.js +15 -0
- package/dist/src/components/input/bundle.js +930 -0
- package/dist/src/components/input/bundle.js.gz +0 -0
- package/dist/src/components/input/index.d.ts +3 -0
- package/dist/src/components/input/index.js +3 -0
- package/dist/src/components/input/input.component.d.ts +174 -0
- package/dist/src/components/input/input.component.js +490 -0
- package/dist/src/components/input/input.style.d.ts +2 -0
- package/dist/src/components/input/input.style.js +810 -0
- package/dist/src/components/input/input.types.d.ts +127 -0
- package/dist/src/components/input/input.types.js +75 -0
- package/dist/src/components/input/react.d.ts +9 -0
- package/dist/src/components/input/react.js +16 -0
- package/dist/src/components/input/validation.d.ts +3 -0
- package/dist/src/components/input/validation.js +3 -0
- package/dist/src/components/kv-secret-select/bundle.js +183 -0
- package/dist/src/components/kv-secret-select/bundle.js.gz +0 -0
- package/dist/src/components/kv-secret-select/index.d.ts +2 -0
- package/dist/src/components/kv-secret-select/index.js +2 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.d.ts +83 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.js +360 -0
- package/dist/src/components/label/bundle.js +104 -0
- package/dist/src/components/label/bundle.js.gz +0 -0
- package/dist/src/components/label/index.d.ts +2 -0
- package/dist/src/components/label/index.js +2 -0
- package/dist/src/components/label/label.component.d.ts +18 -0
- package/dist/src/components/label/label.component.js +64 -0
- package/dist/src/components/label/label.style.d.ts +3 -0
- package/dist/src/components/label/label.style.js +70 -0
- package/dist/src/components/label/label.style.variables.d.ts +2 -0
- package/dist/src/components/label/label.style.variables.js +35 -0
- package/dist/src/components/label/label.types.d.ts +42 -0
- package/dist/src/components/label/label.types.js +2 -0
- package/dist/src/components/label/react.d.ts +339 -0
- package/dist/src/components/label/react.js +12 -0
- package/dist/src/components/layout/bundle.js +220 -0
- package/dist/src/components/layout/bundle.js.gz +0 -0
- package/dist/src/components/layout/content.component.d.ts +35 -0
- package/dist/src/components/layout/content.component.js +47 -0
- package/dist/src/components/layout/content.style.d.ts +2 -0
- package/dist/src/components/layout/content.style.js +17 -0
- package/dist/src/components/layout/footer.component.d.ts +38 -0
- package/dist/src/components/layout/footer.component.js +60 -0
- package/dist/src/components/layout/footer.style.d.ts +2 -0
- package/dist/src/components/layout/footer.style.js +17 -0
- package/dist/src/components/layout/header.component.d.ts +39 -0
- package/dist/src/components/layout/header.component.js +61 -0
- package/dist/src/components/layout/header.style.d.ts +2 -0
- package/dist/src/components/layout/header.style.js +19 -0
- package/dist/src/components/layout/index.d.ts +8 -0
- package/dist/src/components/layout/index.js +7 -0
- package/dist/src/components/layout/layout.component.d.ts +50 -0
- package/dist/src/components/layout/layout.component.js +89 -0
- package/dist/src/components/layout/layout.style.d.ts +2 -0
- package/dist/src/components/layout/layout.style.js +23 -0
- package/dist/src/components/layout/layout.types.d.ts +75 -0
- package/dist/src/components/layout/layout.types.js +12 -0
- package/dist/src/components/layout/react.d.ts +14 -0
- package/dist/src/components/layout/react.js +37 -0
- package/dist/src/components/layout/sider.component.d.ts +116 -0
- package/dist/src/components/layout/sider.component.js +273 -0
- package/dist/src/components/layout/sider.style.d.ts +2 -0
- package/dist/src/components/layout/sider.style.js +104 -0
- package/dist/src/components/menu/bundle.js +520 -0
- package/dist/src/components/menu/bundle.js.gz +0 -0
- package/dist/src/components/menu/index.d.ts +4 -0
- package/dist/src/components/menu/index.js +2 -0
- package/dist/src/components/menu/menu.component.d.ts +87 -0
- package/dist/src/components/menu/menu.component.js +596 -0
- package/dist/src/components/menu/menu.constants.d.ts +12 -0
- package/dist/src/components/menu/menu.constants.js +14 -0
- package/dist/src/components/menu/menu.style.d.ts +2 -0
- package/dist/src/components/menu/menu.style.js +372 -0
- package/dist/src/components/menu/menu.types.d.ts +66 -0
- package/dist/src/components/menu/menu.types.js +7 -0
- package/dist/src/components/menu/react.d.ts +5 -0
- package/dist/src/components/menu/react.js +12 -0
- package/dist/src/components/modal/bundle.js +442 -0
- package/dist/src/components/modal/bundle.js.gz +0 -0
- package/dist/src/components/modal/index.d.ts +10 -0
- package/dist/src/components/modal/index.js +10 -0
- package/dist/src/components/modal/modal-manager.d.ts +72 -0
- package/dist/src/components/modal/modal-manager.js +170 -0
- package/dist/src/components/modal/modal.component.d.ts +121 -0
- package/dist/src/components/modal/modal.component.js +461 -0
- package/dist/src/components/modal/modal.style.d.ts +9 -0
- package/dist/src/components/modal/modal.style.js +369 -0
- package/dist/src/components/modal/modal.types.d.ts +105 -0
- package/dist/src/components/modal/modal.types.js +93 -0
- package/dist/src/components/modal/react.d.ts +9 -0
- package/dist/src/components/modal/react.js +16 -0
- package/dist/src/components/panel/bundle.js +1075 -0
- package/dist/src/components/panel/bundle.js.gz +0 -0
- package/dist/src/components/panel/index.d.ts +9 -0
- package/dist/src/components/panel/index.js +9 -0
- package/dist/src/components/panel/panel.component.d.ts +199 -0
- package/dist/src/components/panel/panel.component.js +720 -0
- package/dist/src/components/panel/panel.style.d.ts +7 -0
- package/dist/src/components/panel/panel.style.js +497 -0
- package/dist/src/components/panel/panel.types.d.ts +94 -0
- package/dist/src/components/panel/panel.types.js +50 -0
- package/dist/src/components/panel/react.d.ts +11 -0
- package/dist/src/components/panel/react.js +18 -0
- package/dist/src/components/popconfirm/bundle.js +438 -0
- package/dist/src/components/popconfirm/bundle.js.gz +0 -0
- package/dist/src/components/popconfirm/index.d.ts +4 -0
- package/dist/src/components/popconfirm/index.js +4 -0
- package/dist/src/components/popconfirm/popconfirm-manager.component.d.ts +129 -0
- package/dist/src/components/popconfirm/popconfirm-manager.component.js +372 -0
- package/dist/src/components/popconfirm/popconfirm-manager.style.d.ts +2 -0
- package/dist/src/components/popconfirm/popconfirm-manager.style.js +137 -0
- package/dist/src/components/popconfirm/popconfirm.component.d.ts +179 -0
- package/dist/src/components/popconfirm/popconfirm.component.js +409 -0
- package/dist/src/components/popconfirm/popconfirm.style.d.ts +2 -0
- package/dist/src/components/popconfirm/popconfirm.style.js +207 -0
- package/dist/src/components/popconfirm/popconfirm.types.d.ts +104 -0
- package/dist/src/components/popconfirm/popconfirm.types.js +2 -0
- package/dist/src/components/popconfirm/react.d.ts +7 -0
- package/dist/src/components/popconfirm/react.js +14 -0
- package/dist/src/components/radio/bundle.js +180 -0
- package/dist/src/components/radio/bundle.js.gz +0 -0
- package/dist/src/components/radio/index.d.ts +3 -0
- package/dist/src/components/radio/index.js +3 -0
- package/dist/src/components/radio/radio.component.d.ts +70 -0
- package/dist/src/components/radio/radio.component.js +187 -0
- package/dist/src/components/radio/radio.style.d.ts +7 -0
- package/dist/src/components/radio/radio.style.js +149 -0
- package/dist/src/components/radio/radio.types.d.ts +14 -0
- package/dist/src/components/radio/radio.types.js +15 -0
- package/dist/src/components/radio/react.d.ts +12 -0
- package/dist/src/components/radio/react.js +19 -0
- package/dist/src/components/radio-group/bundle.js +430 -0
- package/dist/src/components/radio-group/bundle.js.gz +0 -0
- package/dist/src/components/radio-group/index.d.ts +3 -0
- package/dist/src/components/radio-group/index.js +3 -0
- package/dist/src/components/radio-group/radio-group.component.d.ts +165 -0
- package/dist/src/components/radio-group/radio-group.component.js +437 -0
- package/dist/src/components/radio-group/radio-group.style.d.ts +7 -0
- package/dist/src/components/radio-group/radio-group.style.js +270 -0
- package/dist/src/components/radio-group/radio-group.types.d.ts +39 -0
- package/dist/src/components/radio-group/radio-group.types.js +29 -0
- package/dist/src/components/radio-group/radio.constant.d.ts +2 -0
- package/dist/src/components/radio-group/radio.constant.js +2 -0
- package/dist/src/components/radio-group/react.d.ts +10 -0
- package/dist/src/components/radio-group/react.js +17 -0
- package/dist/src/components/select/bundle.js +721 -0
- package/dist/src/components/select/bundle.js.gz +0 -0
- package/dist/src/components/select/index.d.ts +17 -0
- package/dist/src/components/select/index.js +20 -0
- package/dist/src/components/select/react.d.ts +19 -0
- package/dist/src/components/select/react.js +26 -0
- package/dist/src/components/select/select.component.d.ts +359 -0
- package/dist/src/components/select/select.component.js +775 -0
- package/dist/src/components/select/select.constant.d.ts +133 -0
- package/dist/src/components/select/select.constant.js +136 -0
- package/dist/src/components/select/select.style.d.ts +2 -0
- package/dist/src/components/select/select.style.js +533 -0
- package/dist/src/components/select/select.types.d.ts +100 -0
- package/dist/src/components/select/select.types.js +73 -0
- package/dist/src/components/skeleton/bundle.js +293 -0
- package/dist/src/components/skeleton/bundle.js.gz +0 -0
- package/dist/src/components/skeleton/index.d.ts +3 -0
- package/dist/src/components/skeleton/index.js +3 -0
- package/dist/src/components/skeleton/react.d.ts +3 -0
- package/dist/src/components/skeleton/react.js +10 -0
- package/dist/src/components/skeleton/skeleton.component.d.ts +165 -0
- package/dist/src/components/skeleton/skeleton.component.js +387 -0
- package/dist/src/components/skeleton/skeleton.style.d.ts +2 -0
- package/dist/src/components/skeleton/skeleton.style.js +224 -0
- package/dist/src/components/skeleton/skeleton.types.d.ts +82 -0
- package/dist/src/components/skeleton/skeleton.types.js +2 -0
- package/dist/src/components/slider-input/bundle.js +241 -0
- package/dist/src/components/slider-input/bundle.js.gz +0 -0
- package/dist/src/components/slider-input/index.d.ts +3 -0
- package/dist/src/components/slider-input/index.js +3 -0
- package/dist/src/components/slider-input/react.d.ts +340 -0
- package/dist/src/components/slider-input/react.js +13 -0
- package/dist/src/components/slider-input/slider-input.component.d.ts +38 -0
- package/dist/src/components/slider-input/slider-input.component.js +191 -0
- package/dist/src/components/slider-input/slider-input.style.d.ts +3 -0
- package/dist/src/components/slider-input/slider-input.style.js +171 -0
- package/dist/src/components/slider-input/slider-input.style.variables.d.ts +2 -0
- package/dist/src/components/slider-input/slider-input.style.variables.js +59 -0
- package/dist/src/components/slider-input/slider-input.types.d.ts +21 -0
- package/dist/src/components/slider-input/slider-input.types.js +6 -0
- package/dist/src/components/table/bundle.js +987 -0
- package/dist/src/components/table/bundle.js.gz +0 -0
- package/dist/src/components/table/index.d.ts +2 -0
- package/dist/src/components/table/index.js +2 -0
- package/dist/src/components/table/react.d.ts +7 -0
- package/dist/src/components/table/react.js +14 -0
- package/dist/src/components/table/table.component.d.ts +140 -0
- package/dist/src/components/table/table.component.js +433 -0
- package/dist/src/components/table/table.style.d.ts +3 -0
- package/dist/src/components/table/table.style.js +702 -0
- package/dist/src/components/table/table.types.d.ts +103 -0
- package/dist/src/components/table/table.types.js +2 -0
- package/dist/src/components/tabs/bundle.js +1782 -0
- package/dist/src/components/tabs/bundle.js.gz +0 -0
- package/dist/src/components/tabs/index.d.ts +9 -0
- package/dist/src/components/tabs/index.js +10 -0
- package/dist/src/components/tabs/react.d.ts +50 -0
- package/dist/src/components/tabs/react.js +50 -0
- package/dist/src/components/tabs/tabs.component.d.ts +100 -0
- package/dist/src/components/tabs/tabs.component.js +461 -0
- package/dist/src/components/tabs/tabs.constant.d.ts +20 -0
- package/dist/src/components/tabs/tabs.constant.js +21 -0
- package/dist/src/components/tabs/tabs.style.d.ts +9 -0
- package/dist/src/components/tabs/tabs.style.js +577 -0
- package/dist/src/components/tabs/tabs.types.d.ts +241 -0
- package/dist/src/components/tabs/tabs.types.js +13 -0
- package/dist/src/components/tag/bundle.js +108 -0
- package/dist/src/components/tag/bundle.js.gz +0 -0
- package/dist/src/components/tag/index.d.ts +2 -0
- package/dist/src/components/tag/index.js +2 -0
- package/dist/src/components/tag/react.d.ts +6 -0
- package/dist/src/components/tag/react.js +13 -0
- package/dist/src/components/tag/tag.component.d.ts +57 -0
- package/dist/src/components/tag/tag.component.js +157 -0
- package/dist/src/components/tag/tag.style.d.ts +7 -0
- package/dist/src/components/tag/tag.style.js +88 -0
- package/dist/src/components/tag/tag.types.d.ts +28 -0
- package/dist/src/components/tag/tag.types.js +7 -0
- package/dist/src/components/textarea/bundle.js +404 -0
- package/dist/src/components/textarea/bundle.js.gz +0 -0
- package/dist/src/components/textarea/index.d.ts +8 -0
- package/dist/src/components/textarea/index.js +7 -0
- package/dist/src/components/textarea/react.d.ts +9 -0
- package/dist/src/components/textarea/react.js +16 -0
- package/dist/src/components/textarea/textarea.component.d.ts +203 -0
- package/dist/src/components/textarea/textarea.component.js +657 -0
- package/dist/src/components/textarea/textarea.style.d.ts +59 -0
- package/dist/src/components/textarea/textarea.style.js +386 -0
- package/dist/src/components/textarea/textarea.types.d.ts +102 -0
- package/dist/src/components/textarea/textarea.types.js +14 -0
- package/dist/src/components/timeline/bundle.js +261 -0
- package/dist/src/components/timeline/bundle.js.gz +0 -0
- package/dist/src/components/timeline/index.d.ts +2 -0
- package/dist/src/components/timeline/index.js +2 -0
- package/dist/src/components/timeline/react.d.ts +3 -0
- package/dist/src/components/timeline/react.js +10 -0
- package/dist/src/components/timeline/timeline.component.d.ts +109 -0
- package/dist/src/components/timeline/timeline.component.js +214 -0
- package/dist/src/components/timeline/timeline.style.d.ts +14 -0
- package/dist/src/components/timeline/timeline.style.js +234 -0
- package/dist/src/components/timeline/timeline.types.d.ts +62 -0
- package/dist/src/components/timeline/timeline.types.js +7 -0
- package/dist/src/components/timepicker/bundle.js +810 -0
- package/dist/src/components/timepicker/bundle.js.gz +0 -0
- package/dist/src/components/timepicker/index.d.ts +12 -0
- package/dist/src/components/timepicker/index.js +12 -0
- package/dist/src/components/timepicker/timepicker.component.d.ts +115 -0
- package/dist/src/components/timepicker/timepicker.component.js +743 -0
- package/dist/src/components/timepicker/timepicker.constants.d.ts +85 -0
- package/dist/src/components/timepicker/timepicker.constants.js +85 -0
- package/dist/src/components/timepicker/timepicker.style.d.ts +7 -0
- package/dist/src/components/timepicker/timepicker.style.js +568 -0
- package/dist/src/components/timepicker/timepicker.style.variables.d.ts +2 -0
- package/dist/src/components/timepicker/timepicker.style.variables.js +122 -0
- package/dist/src/components/timepicker/timepicker.types.d.ts +161 -0
- package/dist/src/components/timepicker/timepicker.types.js +125 -0
- package/dist/src/components/toast/bundle.js +393 -0
- package/dist/src/components/toast/bundle.js.gz +0 -0
- package/dist/src/components/toast/index.d.ts +9 -0
- package/dist/src/components/toast/index.js +9 -0
- package/dist/src/components/toast/react.d.ts +7 -0
- package/dist/src/components/toast/react.js +19 -0
- package/dist/src/components/toast/toast.component.d.ts +152 -0
- package/dist/src/components/toast/toast.component.js +368 -0
- package/dist/src/components/toast/toast.style.d.ts +14 -0
- package/dist/src/components/toast/toast.style.js +338 -0
- package/dist/src/components/toast/toast.types.d.ts +124 -0
- package/dist/src/components/toast/toast.types.js +9 -0
- package/dist/src/components/tooltips/bundle.js +123 -0
- package/dist/src/components/tooltips/bundle.js.gz +0 -0
- package/dist/src/components/tooltips/index.d.ts +2 -0
- package/dist/src/components/tooltips/index.js +2 -0
- package/dist/src/components/tooltips/react.d.ts +1 -0
- package/dist/src/components/tooltips/react.js +2 -0
- package/dist/src/components/tooltips/tooltips.component.d.ts +33 -0
- package/dist/src/components/tooltips/tooltips.component.js +313 -0
- package/dist/src/components/tooltips/tooltips.constant.d.ts +13 -0
- package/dist/src/components/tooltips/tooltips.constant.js +15 -0
- package/dist/src/components/tooltips/tooltips.style.d.ts +2 -0
- package/dist/src/components/tooltips/tooltips.style.js +103 -0
- package/dist/src/components/tooltips/tooltips.variables.d.ts +2 -0
- package/dist/src/components/tooltips/tooltips.variables.js +14 -0
- package/dist/src/components/video/bundle.js +171 -0
- package/dist/src/components/video/bundle.js.gz +0 -0
- package/dist/src/components/video/index.d.ts +3 -0
- package/dist/src/components/video/index.js +3 -0
- package/dist/src/components/video/react.d.ts +10 -0
- package/dist/src/components/video/react.js +17 -0
- package/dist/src/components/video/video.component.d.ts +34 -0
- package/dist/src/components/video/video.component.js +184 -0
- package/dist/src/components/video/video.style.d.ts +3 -0
- package/dist/src/components/video/video.style.js +124 -0
- package/dist/src/components/video/video.types.d.ts +80 -0
- package/dist/src/components/video/video.types.js +7 -0
- package/package.json +215 -0
- package/packages/common/README.md +137 -0
- package/packages/common/dist/LICENSE +28 -0
- package/packages/common/dist/README.md +137 -0
- package/packages/common/dist/VERSIONS.md +4 -0
- package/packages/common/dist/constants/index.d.ts +2 -0
- package/packages/common/dist/constants/index.d.ts.map +1 -0
- package/packages/common/dist/constants/index.js +2 -0
- package/packages/common/dist/constants/index.js.map +1 -0
- package/packages/common/dist/constants.d.ts +17 -0
- package/packages/common/dist/constants.d.ts.map +1 -0
- package/packages/common/dist/constants.js +7 -0
- package/packages/common/dist/constants.js.map +1 -0
- package/packages/common/dist/controllers/index.d.ts +2 -0
- package/packages/common/dist/controllers/index.d.ts.map +1 -0
- package/packages/common/dist/controllers/index.js +2 -0
- package/packages/common/dist/controllers/index.js.map +1 -0
- package/packages/common/dist/controllers.d.ts +21 -0
- package/packages/common/dist/controllers.d.ts.map +1 -0
- package/packages/common/dist/controllers.js +22 -0
- package/packages/common/dist/controllers.js.map +1 -0
- package/packages/common/dist/index.d.ts +25 -0
- package/packages/common/dist/index.d.ts.map +1 -0
- package/packages/common/dist/index.js +27 -0
- package/packages/common/dist/index.js.map +1 -0
- package/packages/common/dist/mixins/index.d.ts +2 -0
- package/packages/common/dist/mixins/index.d.ts.map +1 -0
- package/packages/common/dist/mixins/index.js +3 -0
- package/packages/common/dist/mixins/index.js.map +1 -0
- package/packages/common/dist/mixins.d.ts +26 -0
- package/packages/common/dist/mixins.d.ts.map +1 -0
- package/packages/common/dist/mixins.js +29 -0
- package/packages/common/dist/mixins.js.map +1 -0
- package/packages/common/dist/shared/base-mixin.d.ts +42 -0
- package/packages/common/dist/shared/base-mixin.d.ts.map +1 -0
- package/packages/common/dist/shared/base-mixin.js +38 -0
- package/packages/common/dist/shared/base-mixin.js.map +1 -0
- package/packages/common/dist/shared/constants.d.ts +1 -0
- package/packages/common/dist/shared/constants.d.ts.map +1 -0
- package/packages/common/dist/shared/constants.js +2 -0
- package/packages/common/dist/shared/constants.js.map +1 -0
- package/packages/common/dist/shared/controllers/base-validation.controller.d.ts +81 -0
- package/packages/common/dist/shared/controllers/base-validation.controller.d.ts.map +1 -0
- package/packages/common/dist/shared/controllers/base-validation.controller.js +104 -0
- package/packages/common/dist/shared/controllers/base-validation.controller.js.map +1 -0
- package/packages/common/dist/shared/controllers/base.controller.d.ts +76 -0
- package/packages/common/dist/shared/controllers/base.controller.d.ts.map +1 -0
- package/packages/common/dist/shared/controllers/base.controller.js +129 -0
- package/packages/common/dist/shared/controllers/base.controller.js.map +1 -0
- package/packages/common/dist/shared/controllers/dropdown.controller.d.ts +77 -0
- package/packages/common/dist/shared/controllers/dropdown.controller.d.ts.map +1 -0
- package/packages/common/dist/shared/controllers/dropdown.controller.js +341 -0
- package/packages/common/dist/shared/controllers/dropdown.controller.js.map +1 -0
- package/packages/common/dist/shared/controllers/dropdown.interface.d.ts +37 -0
- package/packages/common/dist/shared/controllers/dropdown.interface.d.ts.map +1 -0
- package/packages/common/dist/shared/controllers/dropdown.interface.js +2 -0
- package/packages/common/dist/shared/controllers/dropdown.interface.js.map +1 -0
- package/packages/common/dist/shared/controllers/index.d.ts +6 -0
- package/packages/common/dist/shared/controllers/index.d.ts.map +1 -0
- package/packages/common/dist/shared/controllers/index.js +6 -0
- package/packages/common/dist/shared/controllers/index.js.map +1 -0
- package/packages/common/dist/shared/controllers/theme.controller.d.ts +48 -0
- package/packages/common/dist/shared/controllers/theme.controller.d.ts.map +1 -0
- package/packages/common/dist/shared/controllers/theme.controller.js +133 -0
- package/packages/common/dist/shared/controllers/theme.controller.js.map +1 -0
- package/packages/common/dist/shared/dependency-mixin.d.ts +37 -0
- package/packages/common/dist/shared/dependency-mixin.d.ts.map +1 -0
- package/packages/common/dist/shared/dependency-mixin.js +141 -0
- package/packages/common/dist/shared/dependency-mixin.js.map +1 -0
- package/packages/common/dist/shared/event-handler-mixin.d.ts +64 -0
- package/packages/common/dist/shared/event-handler-mixin.d.ts.map +1 -0
- package/packages/common/dist/shared/event-handler-mixin.js +95 -0
- package/packages/common/dist/shared/event-handler-mixin.js.map +1 -0
- package/packages/common/dist/shared/index.d.ts +13 -0
- package/packages/common/dist/shared/index.d.ts.map +1 -0
- package/packages/common/dist/shared/index.js +17 -0
- package/packages/common/dist/shared/index.js.map +1 -0
- package/packages/common/dist/shared/render-utils.d.ts +103 -0
- package/packages/common/dist/shared/render-utils.d.ts.map +1 -0
- package/packages/common/dist/shared/render-utils.js +132 -0
- package/packages/common/dist/shared/render-utils.js.map +1 -0
- package/packages/common/dist/shared/theme-mixin.d.ts +78 -0
- package/packages/common/dist/shared/theme-mixin.d.ts.map +1 -0
- package/packages/common/dist/shared/theme-mixin.js +194 -0
- package/packages/common/dist/shared/theme-mixin.js.map +1 -0
- package/packages/common/dist/shared/themes.d.ts +44 -0
- package/packages/common/dist/shared/themes.d.ts.map +1 -0
- package/packages/common/dist/shared/themes.js +85 -0
- package/packages/common/dist/shared/themes.js.map +1 -0
- package/packages/common/dist/shared/utils.d.ts +60 -0
- package/packages/common/dist/shared/utils.d.ts.map +1 -0
- package/packages/common/dist/shared/utils.js +85 -0
- package/packages/common/dist/shared/utils.js.map +1 -0
- package/packages/common/dist/shared/validation.types.d.ts +108 -0
- package/packages/common/dist/shared/validation.types.d.ts.map +1 -0
- package/packages/common/dist/shared/validation.types.js +17 -0
- package/packages/common/dist/shared/validation.types.js.map +1 -0
- package/packages/common/dist/themes/index.d.ts +2 -0
- package/packages/common/dist/themes/index.d.ts.map +1 -0
- package/packages/common/dist/themes/index.js +2 -0
- package/packages/common/dist/themes/index.js.map +1 -0
- package/packages/common/dist/themes.d.ts +22 -0
- package/packages/common/dist/themes.d.ts.map +1 -0
- package/packages/common/dist/themes.js +23 -0
- package/packages/common/dist/themes.js.map +1 -0
- package/packages/common/dist/utils/index.d.ts +2 -0
- package/packages/common/dist/utils/index.d.ts.map +1 -0
- package/packages/common/dist/utils/index.js +2 -0
- package/packages/common/dist/utils/index.js.map +1 -0
- package/packages/common/dist/utils.d.ts +22 -0
- package/packages/common/dist/utils.d.ts.map +1 -0
- package/packages/common/dist/utils.js +24 -0
- package/packages/common/dist/utils.js.map +1 -0
- package/packages/themes/README.md +146 -0
- package/packages/themes/dist/README.md +146 -0
- package/packages/themes/dist/carbon.css +2987 -0
- package/packages/themes/dist/default.css +2757 -0
- package/packages/themes/dist/editor.css +1063 -0
- package/packages/themes/dist/index.cjs +46 -0
- package/packages/themes/dist/index.js +46 -0
- package/packages/themes/dist/package.json +59 -0
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { LitElement, html } from 'lit';
|
|
22
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
23
|
+
import { styles } from './form.style.js';
|
|
24
|
+
import { FormValidationState, FormSubmissionState, FORM_EVENTS } from './form.types.js';
|
|
25
|
+
import { NuralyUIBaseMixin } from '@nuralyui/common/mixins';
|
|
26
|
+
import { FormValidationController } from './controllers/validation.controller.js';
|
|
27
|
+
import { FormSubmissionController } from './controllers/submission.controller.js';
|
|
28
|
+
/**
|
|
29
|
+
* Comprehensive form component with field management and validation API
|
|
30
|
+
*
|
|
31
|
+
* Key Features:
|
|
32
|
+
* - Coordinates validation across all form fields (does NOT validate itself)
|
|
33
|
+
* - Handles form submission with built-in validation checks
|
|
34
|
+
* - Provides form state management and events
|
|
35
|
+
* - Integrates with existing component validation controllers
|
|
36
|
+
* - Supports both programmatic and user-driven interactions
|
|
37
|
+
* - Comprehensive API for field manipulation and validation
|
|
38
|
+
*
|
|
39
|
+
* @example Basic Usage
|
|
40
|
+
* ```html
|
|
41
|
+
* <nr-form @nr-form-submit-success="${handleSuccess}" validate-on-change>
|
|
42
|
+
* <nr-input name="username" required></nr-input>
|
|
43
|
+
* <nr-input name="email" type="email" required></nr-input>
|
|
44
|
+
* <nr-button type="submit">Submit</nr-button>
|
|
45
|
+
* </nr-form>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Programmatic Usage
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const form = document.querySelector('nr-form');
|
|
51
|
+
*
|
|
52
|
+
* // Set field values
|
|
53
|
+
* form.setFieldsValue({ username: 'john', email: 'john@example.com' });
|
|
54
|
+
*
|
|
55
|
+
* // Get field values
|
|
56
|
+
* const values = form.getFieldsValue();
|
|
57
|
+
*
|
|
58
|
+
* // Validate and submit
|
|
59
|
+
* try {
|
|
60
|
+
* const values = await form.finish();
|
|
61
|
+
* console.log('Form submitted:', values);
|
|
62
|
+
* } catch (errors) {
|
|
63
|
+
* console.log('Validation failed:', errors);
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* // Reset specific fields
|
|
67
|
+
* form.resetFields(['username']);
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @fires nr-form-validation-changed - Validation state changes
|
|
71
|
+
* @fires nr-form-field-changed - Individual field changes
|
|
72
|
+
* @fires nr-form-submit-attempt - Form submission attempted
|
|
73
|
+
* @fires nr-form-submit-success - Form submitted successfully
|
|
74
|
+
* @fires nr-form-submit-error - Form submission failed
|
|
75
|
+
* @fires nr-form-reset - Form was reset
|
|
76
|
+
*
|
|
77
|
+
* @slot default - Form content (inputs, buttons, etc.)
|
|
78
|
+
*/
|
|
79
|
+
let NrFormElement = class NrFormElement extends NuralyUIBaseMixin(LitElement) {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
/** Form configuration */
|
|
83
|
+
this.config = {
|
|
84
|
+
validateOnChange: false, // Default to false - only validate on blur
|
|
85
|
+
validateOnBlur: true,
|
|
86
|
+
showErrorsImmediately: false,
|
|
87
|
+
preventInvalidSubmission: true,
|
|
88
|
+
resetOnSuccess: false,
|
|
89
|
+
validationDelay: 300
|
|
90
|
+
};
|
|
91
|
+
/** Enable real-time validation on field changes */
|
|
92
|
+
this.validateOnChange = false; // Default to false
|
|
93
|
+
/** Enable validation on field blur */
|
|
94
|
+
this.validateOnBlur = true;
|
|
95
|
+
/** Prevent form submission if validation fails */
|
|
96
|
+
this.preventInvalidSubmission = true;
|
|
97
|
+
/** Reset form after successful submission */
|
|
98
|
+
this.resetOnSuccess = false;
|
|
99
|
+
/** Form method for native submission */
|
|
100
|
+
this.method = 'POST';
|
|
101
|
+
/** Form encoding type */
|
|
102
|
+
this.enctype = 'multipart/form-data';
|
|
103
|
+
/** Disable the entire form */
|
|
104
|
+
this.disabled = false;
|
|
105
|
+
/** Form validation state */
|
|
106
|
+
this._validationState = FormValidationState.Pristine;
|
|
107
|
+
/** Form submission state */
|
|
108
|
+
this._submissionState = FormSubmissionState.Idle;
|
|
109
|
+
/** Validation controller */
|
|
110
|
+
this.validationController = new FormValidationController(this);
|
|
111
|
+
/** Submission controller */
|
|
112
|
+
this.submissionController = new FormSubmissionController(this);
|
|
113
|
+
/**
|
|
114
|
+
* Handle validation state changes
|
|
115
|
+
*/
|
|
116
|
+
this.handleValidationChanged = (event) => {
|
|
117
|
+
const customEvent = event;
|
|
118
|
+
const result = customEvent.detail.validationResult;
|
|
119
|
+
if (result) {
|
|
120
|
+
this._validationState = result.isValid ?
|
|
121
|
+
FormValidationState.Valid :
|
|
122
|
+
FormValidationState.Invalid;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Get current validation state */
|
|
127
|
+
get validationState() {
|
|
128
|
+
return this._validationState;
|
|
129
|
+
}
|
|
130
|
+
/** Get current submission state */
|
|
131
|
+
get submissionState() {
|
|
132
|
+
return this._submissionState;
|
|
133
|
+
}
|
|
134
|
+
connectedCallback() {
|
|
135
|
+
super.connectedCallback();
|
|
136
|
+
this.setupFormObserver();
|
|
137
|
+
}
|
|
138
|
+
disconnectedCallback() {
|
|
139
|
+
super.disconnectedCallback();
|
|
140
|
+
this.cleanupFormObserver();
|
|
141
|
+
}
|
|
142
|
+
willUpdate(changedProperties) {
|
|
143
|
+
super.willUpdate(changedProperties);
|
|
144
|
+
// Update config when properties change
|
|
145
|
+
if (changedProperties.has('validateOnChange') ||
|
|
146
|
+
changedProperties.has('validateOnBlur') ||
|
|
147
|
+
changedProperties.has('preventInvalidSubmission') ||
|
|
148
|
+
changedProperties.has('resetOnSuccess')) {
|
|
149
|
+
this.config = Object.assign(Object.assign({}, this.config), { validateOnChange: this.validateOnChange, validateOnBlur: this.validateOnBlur, preventInvalidSubmission: this.preventInvalidSubmission, resetOnSuccess: this.resetOnSuccess });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
firstUpdated() {
|
|
153
|
+
this.registerExistingFields();
|
|
154
|
+
this.setupFormEvents();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Setup mutation observer to detect new form fields
|
|
158
|
+
*/
|
|
159
|
+
setupFormObserver() {
|
|
160
|
+
// Implementation for observing DOM changes to register new fields
|
|
161
|
+
const observer = new MutationObserver((mutations) => {
|
|
162
|
+
mutations.forEach(mutation => {
|
|
163
|
+
mutation.addedNodes.forEach(node => {
|
|
164
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
165
|
+
this.registerFieldsInElement(node);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
observer.observe(this, {
|
|
171
|
+
childList: true,
|
|
172
|
+
subtree: true
|
|
173
|
+
});
|
|
174
|
+
this._formObserver = observer;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Cleanup mutation observer
|
|
178
|
+
*/
|
|
179
|
+
cleanupFormObserver() {
|
|
180
|
+
const observer = this._formObserver;
|
|
181
|
+
if (observer) {
|
|
182
|
+
observer.disconnect();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Register existing form fields
|
|
187
|
+
*/
|
|
188
|
+
registerExistingFields() {
|
|
189
|
+
this.registerFieldsInElement(this);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Register form fields in an element
|
|
193
|
+
*/
|
|
194
|
+
registerFieldsInElement(element) {
|
|
195
|
+
const selectors = [
|
|
196
|
+
'nr-input', 'nr-select', 'nr-radio', 'nr-checkbox',
|
|
197
|
+
'nr-textarea', 'nr-timepicker', 'nr-datepicker'
|
|
198
|
+
];
|
|
199
|
+
selectors.forEach(selector => {
|
|
200
|
+
const fields = element.querySelectorAll(selector);
|
|
201
|
+
fields.forEach(field => {
|
|
202
|
+
if (field.getAttribute('name')) {
|
|
203
|
+
this.validationController.registerField(field);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Setup form events
|
|
210
|
+
*/
|
|
211
|
+
setupFormEvents() {
|
|
212
|
+
// Listen for form submission
|
|
213
|
+
this.addEventListener('submit', this.handleFormSubmit);
|
|
214
|
+
// Listen for form reset
|
|
215
|
+
this.addEventListener('reset', this.handleFormReset);
|
|
216
|
+
// Listen for validation events
|
|
217
|
+
this.addEventListener(FORM_EVENTS.VALIDATION_CHANGED, this.handleValidationChanged);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Handle form submission
|
|
221
|
+
*/
|
|
222
|
+
handleFormSubmit(event) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
event.preventDefault();
|
|
225
|
+
if (this.disabled) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
const submissionData = yield this.submissionController.submitForm();
|
|
230
|
+
if (this.resetOnSuccess) {
|
|
231
|
+
this.reset();
|
|
232
|
+
}
|
|
233
|
+
// If action is specified, perform native submission
|
|
234
|
+
if (this.action) {
|
|
235
|
+
this.performNativeSubmission(submissionData.formData);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
console.error('Form submission failed:', error);
|
|
240
|
+
// Error events are already dispatched by submission controller
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Handle form reset
|
|
246
|
+
*/
|
|
247
|
+
handleFormReset(event) {
|
|
248
|
+
event.preventDefault();
|
|
249
|
+
this.reset();
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Perform native form submission
|
|
253
|
+
*/
|
|
254
|
+
performNativeSubmission(formData) {
|
|
255
|
+
const form = document.createElement('form');
|
|
256
|
+
form.action = this.action;
|
|
257
|
+
form.method = this.method;
|
|
258
|
+
form.enctype = this.enctype;
|
|
259
|
+
if (this.target)
|
|
260
|
+
form.target = this.target;
|
|
261
|
+
// Add form data as hidden inputs
|
|
262
|
+
for (const [name, value] of formData.entries()) {
|
|
263
|
+
const input = document.createElement('input');
|
|
264
|
+
input.type = 'hidden';
|
|
265
|
+
input.name = name;
|
|
266
|
+
input.value = value;
|
|
267
|
+
form.appendChild(input);
|
|
268
|
+
}
|
|
269
|
+
document.body.appendChild(form);
|
|
270
|
+
form.submit();
|
|
271
|
+
document.body.removeChild(form);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Validate the form
|
|
275
|
+
*/
|
|
276
|
+
validate() {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
const result = yield this.validationController.validateForm();
|
|
279
|
+
return result.isValid;
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Submit the form programmatically
|
|
284
|
+
*/
|
|
285
|
+
submit(customData) {
|
|
286
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
+
yield this.submissionController.submitForm(customData);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Reset the form
|
|
292
|
+
*/
|
|
293
|
+
reset() {
|
|
294
|
+
this.validationController.reset();
|
|
295
|
+
this.submissionController.resetSubmission();
|
|
296
|
+
this._validationState = FormValidationState.Pristine;
|
|
297
|
+
this._submissionState = FormSubmissionState.Idle;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Check if form is valid
|
|
301
|
+
*/
|
|
302
|
+
get isValid() {
|
|
303
|
+
return this.validationController.isValid();
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Check if form is submitting
|
|
307
|
+
*/
|
|
308
|
+
get isSubmitting() {
|
|
309
|
+
return this.submissionController.isSubmitting();
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Get form data
|
|
313
|
+
*/
|
|
314
|
+
getFormData() {
|
|
315
|
+
return this.submissionController.collectFormData();
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Get invalid fields
|
|
319
|
+
*/
|
|
320
|
+
getInvalidFields() {
|
|
321
|
+
return this.validationController.getInvalidFields();
|
|
322
|
+
}
|
|
323
|
+
// ============================================
|
|
324
|
+
// FORM API METHODS
|
|
325
|
+
// ============================================
|
|
326
|
+
/**
|
|
327
|
+
* Get values of all fields
|
|
328
|
+
* @returns Object containing all field values
|
|
329
|
+
*/
|
|
330
|
+
getFieldsValue(nameList) {
|
|
331
|
+
const formData = this.getFormData();
|
|
332
|
+
const values = formData.jsonData;
|
|
333
|
+
if (nameList && nameList.length > 0) {
|
|
334
|
+
const filteredValues = {};
|
|
335
|
+
nameList.forEach(name => {
|
|
336
|
+
if (name in values) {
|
|
337
|
+
filteredValues[name] = values[name];
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
return filteredValues;
|
|
341
|
+
}
|
|
342
|
+
return values;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Get value of specific field
|
|
346
|
+
* @param name Field name
|
|
347
|
+
* @returns Field value
|
|
348
|
+
*/
|
|
349
|
+
getFieldValue(name) {
|
|
350
|
+
const values = this.getFieldsValue();
|
|
351
|
+
return values[name];
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Set values of fields
|
|
355
|
+
* @param values Object containing field values to set
|
|
356
|
+
*/
|
|
357
|
+
setFieldsValue(values) {
|
|
358
|
+
Object.entries(values).forEach(([name, value]) => {
|
|
359
|
+
this.setFieldValue(name, value);
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Set value of specific field
|
|
364
|
+
* @param name Field name
|
|
365
|
+
* @param value Field value
|
|
366
|
+
*/
|
|
367
|
+
setFieldValue(name, value) {
|
|
368
|
+
const fields = this.validationController.getFields();
|
|
369
|
+
const field = fields.find(f => f.name === name);
|
|
370
|
+
if (field && field.element) {
|
|
371
|
+
field.element.value = value;
|
|
372
|
+
field.value = value;
|
|
373
|
+
// Trigger change event to update validation
|
|
374
|
+
field.element.dispatchEvent(new Event('change', { bubbles: true }));
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Validate specific fields
|
|
379
|
+
* @param nameList Array of field names to validate, if empty validates all
|
|
380
|
+
* @returns Promise with validation result
|
|
381
|
+
*/
|
|
382
|
+
validateFields(nameList) {
|
|
383
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
384
|
+
const result = yield this.validationController.validateForm();
|
|
385
|
+
if (nameList && nameList.length > 0) {
|
|
386
|
+
// Filter validation errors for specific fields
|
|
387
|
+
const filteredErrors = {};
|
|
388
|
+
nameList.forEach(name => {
|
|
389
|
+
if (result.validationErrors[name]) {
|
|
390
|
+
filteredErrors[name] = result.validationErrors[name];
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
if (Object.keys(filteredErrors).length > 0) {
|
|
394
|
+
throw new Error(JSON.stringify(filteredErrors));
|
|
395
|
+
}
|
|
396
|
+
return this.getFieldsValue(nameList);
|
|
397
|
+
}
|
|
398
|
+
if (!result.isValid) {
|
|
399
|
+
throw new Error(JSON.stringify(result.validationErrors));
|
|
400
|
+
}
|
|
401
|
+
return this.getFieldsValue();
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Reset specific fields
|
|
406
|
+
* @param nameList Array of field names to reset, if empty resets all
|
|
407
|
+
*/
|
|
408
|
+
resetFields(nameList) {
|
|
409
|
+
if (!nameList || nameList.length === 0) {
|
|
410
|
+
this.reset();
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
const fields = this.validationController.getFields();
|
|
414
|
+
nameList.forEach(name => {
|
|
415
|
+
const field = fields.find(f => f.name === name);
|
|
416
|
+
if (field && field.element) {
|
|
417
|
+
// Reset value
|
|
418
|
+
field.element.value = '';
|
|
419
|
+
field.value = '';
|
|
420
|
+
field.touched = false;
|
|
421
|
+
field.dirty = false;
|
|
422
|
+
field.isValid = true;
|
|
423
|
+
field.validationMessage = '';
|
|
424
|
+
// Trigger change event
|
|
425
|
+
field.element.dispatchEvent(new Event('change', { bubbles: true }));
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Get field error
|
|
431
|
+
* @param name Field name
|
|
432
|
+
* @returns Field error message or null
|
|
433
|
+
*/
|
|
434
|
+
getFieldError(name) {
|
|
435
|
+
const fields = this.validationController.getFields();
|
|
436
|
+
const field = fields.find(f => f.name === name);
|
|
437
|
+
return field && !field.isValid ? field.validationMessage : null;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Get all field errors
|
|
441
|
+
* @param nameList Array of field names, if empty returns all
|
|
442
|
+
* @returns Object containing field errors
|
|
443
|
+
*/
|
|
444
|
+
getFieldsError(nameList) {
|
|
445
|
+
const fields = this.validationController.getFields();
|
|
446
|
+
const errors = {};
|
|
447
|
+
const targetFields = nameList
|
|
448
|
+
? fields.filter(f => nameList.includes(f.name))
|
|
449
|
+
: fields;
|
|
450
|
+
targetFields.forEach(field => {
|
|
451
|
+
errors[field.name] = field.isValid ? null : field.validationMessage;
|
|
452
|
+
});
|
|
453
|
+
return errors;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Check if field has been touched
|
|
457
|
+
* @param name Field name
|
|
458
|
+
* @returns Whether field has been touched
|
|
459
|
+
*/
|
|
460
|
+
isFieldTouched(name) {
|
|
461
|
+
const fields = this.validationController.getFields();
|
|
462
|
+
const field = fields.find(f => f.name === name);
|
|
463
|
+
return field ? field.touched : false;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Check if any fields have been touched
|
|
467
|
+
* @param nameList Array of field names, if empty checks all
|
|
468
|
+
* @returns Whether any of the specified fields have been touched
|
|
469
|
+
*/
|
|
470
|
+
isFieldsTouched(nameList) {
|
|
471
|
+
const fields = this.validationController.getFields();
|
|
472
|
+
const targetFields = nameList
|
|
473
|
+
? fields.filter(f => nameList.includes(f.name))
|
|
474
|
+
: fields;
|
|
475
|
+
return targetFields.some(field => field.touched);
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Check if field value has been modified
|
|
479
|
+
* @param name Field name
|
|
480
|
+
* @returns Whether field has been modified
|
|
481
|
+
*/
|
|
482
|
+
isFieldDirty(name) {
|
|
483
|
+
const fields = this.validationController.getFields();
|
|
484
|
+
const field = fields.find(f => f.name === name);
|
|
485
|
+
return field ? field.dirty : false;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Check if any fields have been modified
|
|
489
|
+
* @param nameList Array of field names, if empty checks all
|
|
490
|
+
* @returns Whether any of the specified fields have been modified
|
|
491
|
+
*/
|
|
492
|
+
isFieldsDirty(nameList) {
|
|
493
|
+
const fields = this.validationController.getFields();
|
|
494
|
+
const targetFields = nameList
|
|
495
|
+
? fields.filter(f => nameList.includes(f.name))
|
|
496
|
+
: fields;
|
|
497
|
+
return targetFields.some(field => field.dirty);
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Get field instance
|
|
501
|
+
* @param name Field name
|
|
502
|
+
* @returns Field element or null
|
|
503
|
+
*/
|
|
504
|
+
getFieldInstance(name) {
|
|
505
|
+
const fields = this.validationController.getFields();
|
|
506
|
+
const field = fields.find(f => f.name === name);
|
|
507
|
+
return field ? field.element : null;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Scroll to first error field
|
|
511
|
+
* @returns Whether scrolled to a field
|
|
512
|
+
*/
|
|
513
|
+
scrollToField(name) {
|
|
514
|
+
if (name) {
|
|
515
|
+
const fieldElement = this.getFieldInstance(name);
|
|
516
|
+
if (fieldElement) {
|
|
517
|
+
fieldElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
518
|
+
if (typeof fieldElement.focus === 'function') {
|
|
519
|
+
fieldElement.focus();
|
|
520
|
+
}
|
|
521
|
+
return true;
|
|
522
|
+
}
|
|
523
|
+
return false;
|
|
524
|
+
}
|
|
525
|
+
// Scroll to first invalid field
|
|
526
|
+
return this.validationController.focusFirstInvalidField();
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Submit form and validate
|
|
530
|
+
* @returns Promise with form values
|
|
531
|
+
*/
|
|
532
|
+
finish() {
|
|
533
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
534
|
+
try {
|
|
535
|
+
const values = yield this.validateFields();
|
|
536
|
+
yield this.submit();
|
|
537
|
+
return values;
|
|
538
|
+
}
|
|
539
|
+
catch (error) {
|
|
540
|
+
this.scrollToField();
|
|
541
|
+
throw error;
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Get field names that have validation errors
|
|
547
|
+
* @returns Array of field names with errors
|
|
548
|
+
*/
|
|
549
|
+
getFieldsWithErrors() {
|
|
550
|
+
const fields = this.validationController.getFields();
|
|
551
|
+
return fields
|
|
552
|
+
.filter(field => !field.isValid)
|
|
553
|
+
.map(field => field.name);
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Check if form has any validation errors
|
|
557
|
+
* @returns Whether form has errors
|
|
558
|
+
*/
|
|
559
|
+
hasErrors() {
|
|
560
|
+
return this.getFieldsWithErrors().length > 0;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Get summary of form state
|
|
564
|
+
* @returns Object with form state information
|
|
565
|
+
*/
|
|
566
|
+
getFormState() {
|
|
567
|
+
const fields = this.validationController.getFields();
|
|
568
|
+
return {
|
|
569
|
+
isValid: this.isValid,
|
|
570
|
+
isSubmitting: this.isSubmitting,
|
|
571
|
+
hasErrors: this.hasErrors(),
|
|
572
|
+
errorCount: this.getFieldsWithErrors().length,
|
|
573
|
+
fieldCount: fields.length,
|
|
574
|
+
touchedFields: fields.filter(f => f.touched).map(f => f.name),
|
|
575
|
+
dirtyFields: fields.filter(f => f.dirty).map(f => f.name),
|
|
576
|
+
invalidFields: this.getFieldsWithErrors()
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Set form loading state (useful for async operations)
|
|
581
|
+
* @param loading Whether form is in loading state
|
|
582
|
+
*/
|
|
583
|
+
setLoading(loading) {
|
|
584
|
+
this.disabled = loading;
|
|
585
|
+
this.requestUpdate();
|
|
586
|
+
}
|
|
587
|
+
render() {
|
|
588
|
+
return html `
|
|
589
|
+
<form
|
|
590
|
+
action="${this.action || ''}"
|
|
591
|
+
method="${this.method.toLowerCase()}"
|
|
592
|
+
enctype="${this.enctype}"
|
|
593
|
+
target="${this.target || ''}"
|
|
594
|
+
class="form-wrapper"
|
|
595
|
+
data-disabled="${this.disabled}"
|
|
596
|
+
novalidate
|
|
597
|
+
>
|
|
598
|
+
<slot></slot>
|
|
599
|
+
</form>
|
|
600
|
+
`;
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
NrFormElement.styles = styles;
|
|
604
|
+
__decorate([
|
|
605
|
+
property({ type: Object })
|
|
606
|
+
], NrFormElement.prototype, "config", void 0);
|
|
607
|
+
__decorate([
|
|
608
|
+
property({ type: Boolean, attribute: 'validate-on-change' })
|
|
609
|
+
], NrFormElement.prototype, "validateOnChange", void 0);
|
|
610
|
+
__decorate([
|
|
611
|
+
property({ type: Boolean, attribute: 'validate-on-blur' })
|
|
612
|
+
], NrFormElement.prototype, "validateOnBlur", void 0);
|
|
613
|
+
__decorate([
|
|
614
|
+
property({ type: Boolean, attribute: 'prevent-invalid-submission' })
|
|
615
|
+
], NrFormElement.prototype, "preventInvalidSubmission", void 0);
|
|
616
|
+
__decorate([
|
|
617
|
+
property({ type: Boolean, attribute: 'reset-on-success' })
|
|
618
|
+
], NrFormElement.prototype, "resetOnSuccess", void 0);
|
|
619
|
+
__decorate([
|
|
620
|
+
property({ type: String })
|
|
621
|
+
], NrFormElement.prototype, "action", void 0);
|
|
622
|
+
__decorate([
|
|
623
|
+
property({ type: String })
|
|
624
|
+
], NrFormElement.prototype, "method", void 0);
|
|
625
|
+
__decorate([
|
|
626
|
+
property({ type: String, attribute: 'enctype' })
|
|
627
|
+
], NrFormElement.prototype, "enctype", void 0);
|
|
628
|
+
__decorate([
|
|
629
|
+
property({ type: String })
|
|
630
|
+
], NrFormElement.prototype, "target", void 0);
|
|
631
|
+
__decorate([
|
|
632
|
+
property({ type: Boolean, reflect: true })
|
|
633
|
+
], NrFormElement.prototype, "disabled", void 0);
|
|
634
|
+
__decorate([
|
|
635
|
+
state()
|
|
636
|
+
], NrFormElement.prototype, "_validationState", void 0);
|
|
637
|
+
__decorate([
|
|
638
|
+
state()
|
|
639
|
+
], NrFormElement.prototype, "_submissionState", void 0);
|
|
640
|
+
NrFormElement = __decorate([
|
|
641
|
+
customElement('nr-form')
|
|
642
|
+
], NrFormElement);
|
|
643
|
+
export { NrFormElement };
|
|
644
|
+
//# sourceMappingURL=form.component.js.map
|