@nuraly/lumenui 0.1.0 → 0.2.2
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/dist/nuralyui.bundle.js +23283 -16875
- package/dist/nuralyui.bundle.js.gz +0 -0
- package/dist/src/components/alert/alert.component.d.ts +8 -5
- package/dist/src/components/alert/alert.component.js +24 -20
- package/dist/src/components/alert/alert.style.d.ts +0 -7
- package/dist/src/components/alert/alert.style.js +48 -90
- package/dist/src/components/alert/bundle.js +82 -108
- package/dist/src/components/alert/bundle.js.gz +0 -0
- package/dist/src/components/badge/badge.component.d.ts +9 -8
- package/dist/src/components/badge/badge.component.js +17 -14
- package/dist/src/components/badge/badge.style.d.ts +0 -7
- package/dist/src/components/badge/badge.style.js +49 -107
- package/dist/src/components/badge/bundle.js +81 -119
- package/dist/src/components/badge/bundle.js.gz +0 -0
- package/dist/src/components/breadcrumb/breadcrumb.component.d.ts +8 -10
- package/dist/src/components/breadcrumb/breadcrumb.component.js +16 -15
- package/dist/src/components/breadcrumb/breadcrumb.style.d.ts +0 -7
- package/dist/src/components/breadcrumb/breadcrumb.style.js +42 -60
- package/dist/src/components/breadcrumb/bundle.js +96 -93
- package/dist/src/components/breadcrumb/bundle.js.gz +0 -0
- package/dist/src/components/button/bundle.js +221 -470
- package/dist/src/components/button/bundle.js.gz +0 -0
- package/dist/src/components/button/button.component.d.ts +2 -1
- package/dist/src/components/button/button.component.js +6 -6
- package/dist/src/components/button/button.style.d.ts +0 -7
- package/dist/src/components/button/button.style.js +167 -433
- package/dist/src/components/button/controllers/base.controller.d.ts +15 -0
- package/dist/src/components/button/controllers/base.controller.js +13 -0
- package/dist/src/components/button/controllers/index.d.ts +10 -0
- package/dist/src/components/button/controllers/index.js +10 -0
- package/dist/src/components/button/controllers/keyboard.controller.d.ts +32 -0
- package/dist/src/components/button/controllers/keyboard.controller.js +78 -0
- package/dist/src/components/button/controllers/link.controller.d.ts +30 -0
- package/dist/src/components/button/controllers/link.controller.js +75 -0
- package/dist/src/components/button/controllers/ripple.controller.d.ts +23 -0
- package/dist/src/components/button/controllers/ripple.controller.js +69 -0
- package/dist/src/components/button/interfaces/base-controller.interface.d.ts +61 -0
- package/dist/src/components/button/interfaces/base-controller.interface.js +7 -0
- package/dist/src/components/button/interfaces/index.d.ts +2 -0
- package/dist/src/components/button/interfaces/index.js +2 -0
- package/dist/src/components/button/test/nr-button_test.d.ts +2 -0
- package/dist/src/components/button/test/nr-button_test.js +91 -0
- package/dist/src/components/canvas/base-canvas.component.d.ts +4 -2
- package/dist/src/components/canvas/base-canvas.component.js +7 -0
- package/dist/src/components/canvas/bundle.js +17218 -9667
- package/dist/src/components/canvas/bundle.js.gz +0 -0
- package/dist/src/components/canvas/canvas.constants.d.ts +1 -1
- package/dist/src/components/canvas/canvas.constants.js +1 -1
- package/dist/src/components/canvas/chatbot-panel.style.js +54 -63
- package/dist/src/components/canvas/chatbot-trigger/chatbot-trigger-fields.component.d.ts +115 -0
- package/dist/src/components/canvas/chatbot-trigger/chatbot-trigger-fields.component.js +480 -0
- package/dist/src/components/canvas/chatbot-trigger/chatbot-trigger-fields.style.d.ts +7 -0
- package/dist/src/components/canvas/chatbot-trigger/chatbot-trigger-fields.style.js +323 -0
- package/dist/src/components/canvas/chatbot-trigger/chatbot-trigger.types.d.ts +162 -0
- package/dist/src/components/canvas/chatbot-trigger/chatbot-trigger.types.js +88 -0
- package/dist/src/components/canvas/chatbot-trigger/index.d.ts +9 -0
- package/dist/src/components/canvas/chatbot-trigger/index.js +12 -0
- package/dist/src/components/canvas/controllers/base.controller.d.ts +53 -0
- package/dist/src/components/canvas/controllers/base.controller.js +80 -0
- package/dist/src/components/canvas/controllers/clipboard.controller.d.ts +80 -0
- package/dist/src/components/canvas/controllers/clipboard.controller.js +300 -0
- package/dist/src/components/canvas/controllers/collaboration.controller.d.ts +54 -0
- package/dist/src/components/canvas/controllers/collaboration.controller.js +425 -0
- package/dist/src/components/canvas/controllers/config.controller.d.ts +61 -0
- package/dist/src/components/canvas/controllers/config.controller.js +118 -0
- package/dist/src/components/canvas/controllers/connection.controller.d.ts +69 -0
- package/dist/src/components/canvas/controllers/connection.controller.js +183 -0
- package/dist/src/components/canvas/controllers/drag.controller.d.ts +56 -0
- package/dist/src/components/canvas/controllers/drag.controller.js +195 -0
- package/dist/src/components/canvas/controllers/frame.controller.d.ts +94 -0
- package/dist/src/components/canvas/controllers/frame.controller.js +456 -0
- package/dist/src/components/canvas/controllers/index.d.ts +19 -0
- package/dist/src/components/canvas/controllers/index.js +32 -0
- package/dist/src/components/canvas/controllers/keyboard.controller.d.ts +44 -0
- package/dist/src/components/canvas/controllers/keyboard.controller.js +275 -0
- package/dist/src/components/canvas/controllers/marquee.controller.d.ts +71 -0
- package/dist/src/components/canvas/controllers/marquee.controller.js +128 -0
- package/dist/src/components/canvas/controllers/selection.controller.d.ts +85 -0
- package/dist/src/components/canvas/controllers/selection.controller.js +202 -0
- package/dist/src/components/canvas/controllers/touch.controller.d.ts +55 -0
- package/dist/src/components/canvas/controllers/touch.controller.js +299 -0
- package/dist/src/components/canvas/controllers/undo.controller.d.ts +100 -0
- package/dist/src/components/canvas/controllers/undo.controller.js +218 -0
- package/dist/src/components/canvas/controllers/viewport.controller.d.ts +91 -0
- package/dist/src/components/canvas/controllers/viewport.controller.js +287 -0
- package/dist/src/components/canvas/data-node/data-node-config.component.d.ts +67 -0
- package/dist/src/components/canvas/data-node/data-node-config.component.js +496 -0
- package/dist/src/components/canvas/data-node/data-node-fields.component.d.ts +198 -0
- package/dist/src/components/canvas/data-node/data-node-fields.component.js +931 -0
- package/dist/src/components/canvas/data-node/data-node-fields.style.d.ts +7 -0
- package/dist/src/components/canvas/data-node/data-node-fields.style.js +448 -0
- package/dist/src/components/canvas/data-node/data-node.types.d.ts +245 -0
- package/dist/src/components/canvas/data-node/data-node.types.js +158 -0
- package/dist/src/components/canvas/data-node/index.d.ts +9 -0
- package/dist/src/components/canvas/data-node/index.js +12 -0
- package/dist/src/components/canvas/data-node/schema-select.component.d.ts +36 -0
- package/dist/src/components/canvas/data-node/schema-select.component.js +196 -0
- package/dist/src/components/canvas/data-node/table-select.component.d.ts +38 -0
- package/dist/src/components/canvas/data-node/table-select.component.js +199 -0
- package/dist/src/components/canvas/index.d.ts +2 -0
- package/dist/src/components/canvas/index.js +3 -0
- package/dist/src/components/canvas/interfaces/canvas-host.interface.d.ts +91 -0
- package/dist/src/components/canvas/interfaces/canvas-host.interface.js +7 -0
- package/dist/src/components/canvas/interfaces/collaboration.interface.d.ts +58 -0
- package/dist/src/components/canvas/interfaces/collaboration.interface.js +10 -0
- package/dist/src/components/canvas/interfaces/index.d.ts +8 -0
- package/dist/src/components/canvas/interfaces/index.js +7 -0
- package/dist/src/components/canvas/templates/chatbot-panel.template.d.ts +28 -0
- package/dist/src/components/canvas/templates/chatbot-panel.template.js +49 -0
- package/dist/src/components/canvas/templates/config-panel.template.d.ts +22 -0
- package/dist/src/components/canvas/templates/config-panel.template.js +22 -0
- package/dist/src/components/canvas/templates/context-menu.template.d.ts +30 -0
- package/dist/src/components/canvas/templates/context-menu.template.js +80 -0
- package/dist/src/components/canvas/templates/edges.template.d.ts +41 -0
- package/dist/src/components/canvas/templates/edges.template.js +243 -0
- package/dist/src/components/canvas/templates/empty-state.template.d.ts +17 -0
- package/dist/src/components/canvas/templates/empty-state.template.js +25 -0
- package/dist/src/components/canvas/templates/frame.template.d.ts +24 -0
- package/dist/src/components/canvas/templates/frame.template.js +74 -0
- package/dist/src/components/canvas/templates/index.d.ts +18 -0
- package/dist/src/components/canvas/templates/index.js +30 -0
- package/dist/src/components/canvas/templates/palette.template.d.ts +27 -0
- package/dist/src/components/canvas/templates/palette.template.js +110 -0
- package/dist/src/components/canvas/templates/presence-bar.template.d.ts +18 -0
- package/dist/src/components/canvas/templates/presence-bar.template.js +60 -0
- package/dist/src/components/canvas/templates/remote-cursors.template.d.ts +19 -0
- package/dist/src/components/canvas/templates/remote-cursors.template.js +43 -0
- package/dist/src/components/canvas/templates/toolbar.template.d.ts +52 -0
- package/dist/src/components/canvas/templates/toolbar.template.js +118 -0
- package/dist/src/components/canvas/templates/wb-floating-toolbar.template.d.ts +30 -0
- package/dist/src/components/canvas/templates/wb-floating-toolbar.template.js +219 -0
- package/dist/src/components/canvas/templates/wb-sidebar.template.d.ts +23 -0
- package/dist/src/components/canvas/templates/wb-sidebar.template.js +152 -0
- package/dist/src/components/canvas/utils/variable-resolver.d.ts +71 -0
- package/dist/src/components/canvas/utils/variable-resolver.js +280 -0
- package/dist/src/components/canvas/whiteboard-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/whiteboard-canvas.component.js +19 -1
- package/dist/src/components/canvas/whiteboard-canvas.style.js +159 -138
- package/dist/src/components/canvas/whiteboard-node.component.d.ts +2 -1
- package/dist/src/components/canvas/whiteboard-node.component.js +2 -1
- package/dist/src/components/canvas/whiteboard-node.style.js +44 -44
- package/dist/src/components/canvas/workflow-canvas-only.d.ts +4 -0
- package/dist/src/components/canvas/workflow-canvas-only.js +5 -0
- package/dist/src/components/canvas/workflow-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/workflow-canvas.component.js +30 -2
- package/dist/src/components/canvas/workflow-canvas.style.js +794 -675
- package/dist/src/components/canvas/workflow-canvas.types.d.ts +113 -4
- package/dist/src/components/canvas/workflow-canvas.types.js +646 -3
- package/dist/src/components/canvas/workflow-node.component.d.ts +3 -2
- package/dist/src/components/canvas/workflow-node.component.js +5 -5
- package/dist/src/components/canvas/workflow-node.style.js +183 -181
- package/dist/src/components/card/bundle.js +43 -35
- package/dist/src/components/card/bundle.js.gz +0 -0
- package/dist/src/components/card/card.component.d.ts +6 -1
- package/dist/src/components/card/card.component.js +8 -2
- package/dist/src/components/card/card.style.js +26 -30
- package/dist/src/components/carousel/bundle.js +8 -8
- package/dist/src/components/carousel/bundle.js.gz +0 -0
- package/dist/src/components/carousel/carousel.component.d.ts +12 -0
- package/dist/src/components/carousel/carousel.component.js +16 -4
- package/dist/src/components/carousel/demo/carousel-demo.d.ts +6 -0
- package/dist/src/components/carousel/demo/carousel-demo.js +68 -0
- package/dist/src/components/chatbot/audio-compress.d.ts +26 -0
- package/dist/src/components/chatbot/audio-compress.js +84 -0
- package/dist/src/components/chatbot/bundle.js +690 -430
- package/dist/src/components/chatbot/bundle.js.gz +0 -0
- package/dist/src/components/chatbot/chatbot-audio.controller.d.ts +35 -0
- package/dist/src/components/chatbot/chatbot-audio.controller.js +160 -0
- package/dist/src/components/chatbot/chatbot.component.d.ts +14 -1
- package/dist/src/components/chatbot/chatbot.component.js +42 -2
- package/dist/src/components/chatbot/chatbot.style.js +418 -277
- package/dist/src/components/chatbot/chatbot.types.d.ts +8 -0
- package/dist/src/components/chatbot/controllers/index.d.ts +8 -0
- package/dist/src/components/chatbot/controllers/index.js +8 -0
- package/dist/src/components/chatbot/controllers/scroll.controller.d.ts +34 -0
- package/dist/src/components/chatbot/controllers/scroll.controller.js +43 -0
- package/dist/src/components/chatbot/core/chatbot-core.controller.d.ts +283 -0
- package/dist/src/components/chatbot/core/chatbot-core.controller.js +824 -0
- package/dist/src/components/chatbot/core/event-bus.d.ts +54 -0
- package/dist/src/components/chatbot/core/event-bus.js +102 -0
- package/dist/src/components/chatbot/core/index.d.ts +12 -0
- package/dist/src/components/chatbot/core/index.js +15 -0
- package/dist/src/components/chatbot/core/types.d.ts +403 -0
- package/dist/src/components/chatbot/core/types.js +16 -0
- package/dist/src/components/chatbot/locales/locale-codes.d.ts +14 -0
- package/dist/src/components/chatbot/locales/locale-codes.js +23 -0
- package/dist/src/components/chatbot/plugins/analytics-plugin.d.ts +23 -0
- package/dist/src/components/chatbot/plugins/analytics-plugin.js +52 -0
- package/dist/src/components/chatbot/plugins/artifact-plugin.d.ts +71 -0
- package/dist/src/components/chatbot/plugins/artifact-plugin.js +313 -0
- package/dist/src/components/chatbot/plugins/chat-plugin.d.ts +44 -0
- package/dist/src/components/chatbot/plugins/chat-plugin.js +58 -0
- package/dist/src/components/chatbot/plugins/flight-card-plugin.d.ts +116 -0
- package/dist/src/components/chatbot/plugins/flight-card-plugin.js +594 -0
- package/dist/src/components/chatbot/plugins/flow-diagram-plugin.d.ts +23 -0
- package/dist/src/components/chatbot/plugins/flow-diagram-plugin.js +495 -0
- package/dist/src/components/chatbot/plugins/index.d.ts +16 -0
- package/dist/src/components/chatbot/plugins/index.js +17 -0
- package/dist/src/components/chatbot/plugins/json-graph-renderer-plugin.d.ts +43 -0
- package/dist/src/components/chatbot/plugins/json-graph-renderer-plugin.js +166 -0
- package/dist/src/components/chatbot/plugins/markdown-plugin.d.ts +26 -0
- package/dist/src/components/chatbot/plugins/markdown-plugin.js +68 -0
- package/dist/src/components/chatbot/plugins/persistence-plugin.d.ts +30 -0
- package/dist/src/components/chatbot/plugins/persistence-plugin.js +91 -0
- package/dist/src/components/chatbot/plugins/print-job-card-plugin.d.ts +110 -0
- package/dist/src/components/chatbot/plugins/print-job-card-plugin.js +505 -0
- package/dist/src/components/chatbot/plugins/selection-card-plugin.d.ts +111 -0
- package/dist/src/components/chatbot/plugins/selection-card-plugin.js +318 -0
- package/dist/src/components/chatbot/providers/custom-api-provider.d.ts +63 -0
- package/dist/src/components/chatbot/providers/custom-api-provider.js +240 -0
- package/dist/src/components/chatbot/providers/index.d.ts +16 -0
- package/dist/src/components/chatbot/providers/index.js +13 -0
- package/dist/src/components/chatbot/providers/mock-provider.d.ts +154 -0
- package/dist/src/components/chatbot/providers/mock-provider.js +411 -0
- package/dist/src/components/chatbot/providers/native-ws-provider.d.ts +184 -0
- package/dist/src/components/chatbot/providers/native-ws-provider.js +544 -0
- package/dist/src/components/chatbot/providers/openai-provider.d.ts +32 -0
- package/dist/src/components/chatbot/providers/openai-provider.js +246 -0
- package/dist/src/components/chatbot/providers/socket-provider.d.ts +159 -0
- package/dist/src/components/chatbot/providers/socket-provider.js +390 -0
- package/dist/src/components/chatbot/providers/workflow-socket-provider.d.ts +116 -0
- package/dist/src/components/chatbot/providers/workflow-socket-provider.js +484 -0
- package/dist/src/components/chatbot/storage/index.d.ts +7 -0
- package/dist/src/components/chatbot/storage/index.js +8 -0
- package/dist/src/components/chatbot/storage/storage-implementations.d.ts +43 -0
- package/dist/src/components/chatbot/storage/storage-implementations.js +179 -0
- package/dist/src/components/chatbot/templates/artifact-panel.template.d.ts +22 -0
- package/dist/src/components/chatbot/templates/artifact-panel.template.js +81 -0
- package/dist/src/components/chatbot/templates/chatbot-main.template.d.ts +49 -0
- package/dist/src/components/chatbot/templates/chatbot-main.template.js +115 -0
- package/dist/src/components/chatbot/templates/file-preview-modal.template.d.ts +19 -0
- package/dist/src/components/chatbot/templates/file-preview-modal.template.js +74 -0
- package/dist/src/components/chatbot/templates/file-upload-area.template.d.ts +19 -0
- package/dist/src/components/chatbot/templates/file-upload-area.template.js +29 -0
- package/dist/src/components/chatbot/templates/index.d.ts +15 -0
- package/dist/src/components/chatbot/templates/index.js +15 -0
- package/dist/src/components/chatbot/templates/input-box.template.d.ts +49 -0
- package/dist/src/components/chatbot/templates/input-box.template.js +317 -0
- package/dist/src/components/chatbot/templates/message.template.d.ts +31 -0
- package/dist/src/components/chatbot/templates/message.template.js +214 -0
- package/dist/src/components/chatbot/templates/suggestion.template.d.ts +20 -0
- package/dist/src/components/chatbot/templates/suggestion.template.js +40 -0
- package/dist/src/components/chatbot/templates/thread-sidebar.template.d.ts +24 -0
- package/dist/src/components/chatbot/templates/thread-sidebar.template.js +160 -0
- package/dist/src/components/chatbot/templates/url-modal.template.d.ts +25 -0
- package/dist/src/components/chatbot/templates/url-modal.template.js +100 -0
- package/dist/src/components/chatbot/utils/format.d.ts +23 -0
- package/dist/src/components/chatbot/utils/format.js +84 -0
- package/dist/src/components/chatbot/utils/index.d.ts +7 -0
- package/dist/src/components/chatbot/utils/index.js +7 -0
- package/dist/src/components/checkbox/bundle.js +86 -245
- package/dist/src/components/checkbox/bundle.js.gz +0 -0
- package/dist/src/components/checkbox/checkbox.component.d.ts +5 -2
- package/dist/src/components/checkbox/checkbox.component.js +11 -13
- package/dist/src/components/checkbox/checkbox.style.js +56 -231
- package/dist/src/components/checkbox/mixins/checkbox-event-mixin.d.ts +87 -0
- package/dist/src/components/checkbox/mixins/checkbox-event-mixin.js +94 -0
- package/dist/src/components/checkbox/mixins/checkbox-focus-mixin.d.ts +55 -0
- package/dist/src/components/checkbox/mixins/checkbox-focus-mixin.js +57 -0
- package/dist/src/components/checkbox/mixins/index.d.ts +10 -0
- package/dist/src/components/checkbox/mixins/index.js +8 -0
- package/dist/src/components/checkbox/test/checkbox_test.d.ts +2 -0
- package/dist/src/components/checkbox/test/checkbox_test.js +88 -0
- package/dist/src/components/code-editor/bundle.js +151 -25
- package/dist/src/components/code-editor/bundle.js.gz +0 -0
- package/dist/src/components/code-editor/code-editor.component.d.ts +18 -56
- package/dist/src/components/code-editor/code-editor.component.js +141 -394
- package/dist/src/components/code-editor/code-editor.style.js +139 -15
- package/dist/src/components/collapse/bundle.js +97 -84
- package/dist/src/components/collapse/bundle.js.gz +0 -0
- package/dist/src/components/collapse/collapse.component.d.ts +7 -1
- package/dist/src/components/collapse/collapse.component.js +11 -2
- package/dist/src/components/collapse/collapse.style.js +60 -60
- package/dist/src/components/collapse/controllers/accordion.controller.d.ts +60 -0
- package/dist/src/components/collapse/controllers/accordion.controller.js +132 -0
- package/dist/src/components/collapse/controllers/animation.controller.d.ts +40 -0
- package/dist/src/components/collapse/controllers/animation.controller.js +125 -0
- package/dist/src/components/collapse/controllers/base.controller.d.ts +48 -0
- package/dist/src/components/collapse/controllers/base.controller.js +69 -0
- package/dist/src/components/collapse/controllers/index.d.ts +12 -0
- package/dist/src/components/collapse/controllers/index.js +11 -0
- package/dist/src/components/collapse/controllers/keyboard.controller.d.ts +73 -0
- package/dist/src/components/collapse/controllers/keyboard.controller.js +186 -0
- package/dist/src/components/colorpicker/bundle.js +85 -48
- package/dist/src/components/colorpicker/bundle.js.gz +0 -0
- package/dist/src/components/colorpicker/color-holder.component.d.ts +2 -4
- package/dist/src/components/colorpicker/color-holder.component.js +5 -6
- package/dist/src/components/colorpicker/color-holder.style.js +11 -11
- package/dist/src/components/colorpicker/color-picker.component.d.ts +2 -1
- package/dist/src/components/colorpicker/color-picker.component.js +1 -0
- package/dist/src/components/colorpicker/color-picker.style.js +12 -12
- package/dist/src/components/colorpicker/controllers/base.controller.d.ts +14 -0
- package/dist/src/components/colorpicker/controllers/base.controller.js +15 -0
- package/dist/src/components/colorpicker/controllers/dropdown.controller.d.ts +60 -0
- package/dist/src/components/colorpicker/controllers/dropdown.controller.js +243 -0
- package/dist/src/components/colorpicker/controllers/event.controller.d.ts +46 -0
- package/dist/src/components/colorpicker/controllers/event.controller.js +130 -0
- package/dist/src/components/colorpicker/controllers/index.d.ts +4 -0
- package/dist/src/components/colorpicker/controllers/index.js +4 -0
- package/dist/src/components/colorpicker/default-color-sets.component.d.ts +2 -2
- package/dist/src/components/colorpicker/default-color-sets.component.js +4 -3
- package/dist/src/components/colorpicker/default-color-sets.style.js +5 -5
- package/dist/src/components/colorpicker/interfaces/index.d.ts +60 -0
- package/dist/src/components/colorpicker/interfaces/index.js +2 -0
- package/dist/src/components/container/bundle.js +24 -14
- package/dist/src/components/container/bundle.js.gz +0 -0
- package/dist/src/components/container/container.component.d.ts +4 -1
- package/dist/src/components/container/container.component.js +7 -5
- package/dist/src/components/container/container.style.js +9 -9
- package/dist/src/components/datepicker/bundle.js +193 -177
- package/dist/src/components/datepicker/bundle.js.gz +0 -0
- package/dist/src/components/datepicker/controllers/calendar.controller.d.ts +78 -0
- package/dist/src/components/datepicker/controllers/calendar.controller.js +225 -0
- package/dist/src/components/datepicker/controllers/index.d.ts +11 -0
- package/dist/src/components/datepicker/controllers/index.js +11 -0
- package/dist/src/components/datepicker/controllers/keyboard.controller.d.ts +96 -0
- package/dist/src/components/datepicker/controllers/keyboard.controller.js +246 -0
- package/dist/src/components/datepicker/controllers/month-year-dropdown.controller.d.ts +48 -0
- package/dist/src/components/datepicker/controllers/month-year-dropdown.controller.js +92 -0
- package/dist/src/components/datepicker/controllers/positioning.controller.d.ts +82 -0
- package/dist/src/components/datepicker/controllers/positioning.controller.js +247 -0
- package/dist/src/components/datepicker/controllers/selection.controller.d.ts +92 -0
- package/dist/src/components/datepicker/controllers/selection.controller.js +267 -0
- package/dist/src/components/datepicker/datepicker.component.d.ts +2 -1
- package/dist/src/components/datepicker/datepicker.component.js +1 -0
- package/dist/src/components/datepicker/datepicker.style.js +65 -65
- package/dist/src/components/datepicker/datepicker.style.variables.js +91 -91
- package/dist/src/components/datepicker/interfaces/base-controller.interface.d.ts +40 -0
- package/dist/src/components/datepicker/interfaces/base-controller.interface.js +7 -0
- package/dist/src/components/datepicker/interfaces/datepicker-controllers.interface.d.ts +112 -0
- package/dist/src/components/datepicker/interfaces/datepicker-controllers.interface.js +7 -0
- package/dist/src/components/datepicker/interfaces/index.d.ts +8 -0
- package/dist/src/components/datepicker/interfaces/index.js +7 -0
- package/dist/src/components/datepicker/templates/days.template.d.ts +4 -0
- package/dist/src/components/datepicker/templates/days.template.js +40 -0
- package/dist/src/components/datepicker/templates/dropdown.template.d.ts +10 -0
- package/dist/src/components/datepicker/templates/dropdown.template.js +50 -0
- package/dist/src/components/datepicker/templates/headers.template.d.ts +2 -0
- package/dist/src/components/datepicker/templates/headers.template.js +5 -0
- package/dist/src/components/datepicker/templates/months.template.d.ts +6 -0
- package/dist/src/components/datepicker/templates/months.template.js +10 -0
- package/dist/src/components/datepicker/templates/years.template.d.ts +6 -0
- package/dist/src/components/datepicker/templates/years.template.js +11 -0
- package/dist/src/components/datepicker/test/datepicker_test.d.ts +2 -0
- package/dist/src/components/datepicker/test/datepicker_test.js +134 -0
- package/dist/src/components/datepicker/utils/day.helper.d.ts +5 -0
- package/dist/src/components/datepicker/utils/day.helper.js +53 -0
- package/dist/src/components/datepicker/utils/formatter.d.ts +2 -0
- package/dist/src/components/datepicker/utils/formatter.js +9 -0
- package/dist/src/components/datepicker/utils/index.d.ts +11 -0
- package/dist/src/components/datepicker/utils/index.js +11 -0
- package/dist/src/components/datepicker/utils/locale.helper.d.ts +144 -0
- package/dist/src/components/datepicker/utils/locale.helper.js +151 -0
- package/dist/src/components/datepicker/utils/month.helper.d.ts +3 -0
- package/dist/src/components/datepicker/utils/month.helper.js +24 -0
- package/dist/src/components/datepicker/utils/string.helper.d.ts +2 -0
- package/dist/src/components/datepicker/utils/string.helper.js +4 -0
- package/dist/src/components/db-connection-select/bundle.js +7 -6
- 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 +3 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.js +4 -0
- package/dist/src/components/divider/bundle.js +61 -35
- package/dist/src/components/divider/bundle.js.gz +0 -0
- package/dist/src/components/divider/divider.component.d.ts +4 -6
- package/dist/src/components/divider/divider.component.js +10 -14
- package/dist/src/components/divider/divider.style.js +41 -31
- package/dist/src/components/document/bundle.js +50 -48
- package/dist/src/components/document/bundle.js.gz +0 -0
- package/dist/src/components/document/demo/document-demo.d.ts +12 -0
- package/dist/src/components/document/demo/document-demo.js +40 -0
- package/dist/src/components/document/document.component.d.ts +12 -1
- package/dist/src/components/document/document.component.js +18 -6
- package/dist/src/components/document/document.style.js +21 -36
- package/dist/src/components/dropdown/bundle.js +117 -101
- package/dist/src/components/dropdown/bundle.js.gz +0 -0
- package/dist/src/components/dropdown/controllers/base.controller.d.ts +18 -0
- package/dist/src/components/dropdown/controllers/base.controller.js +22 -0
- package/dist/src/components/dropdown/controllers/dropdown.controller.d.ts +50 -0
- package/dist/src/components/dropdown/controllers/dropdown.controller.js +408 -0
- package/dist/src/components/dropdown/controllers/index.d.ts +3 -0
- package/dist/src/components/dropdown/controllers/index.js +3 -0
- package/dist/src/components/dropdown/dropdown.component.d.ts +2 -1
- package/dist/src/components/dropdown/dropdown.component.js +1 -0
- package/dist/src/components/dropdown/dropdown.style.js +68 -68
- package/dist/src/components/dropdown/interfaces/controller-interfaces.d.ts +79 -0
- package/dist/src/components/dropdown/interfaces/controller-interfaces.js +2 -0
- package/dist/src/components/dropdown/interfaces/index.d.ts +2 -0
- package/dist/src/components/dropdown/interfaces/index.js +2 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-item.d.ts +12 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-item.js +55 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-item.style.d.ts +2 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-item.style.js +34 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-menu.d.ts +18 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-menu.js +70 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-menu.style.d.ts +2 -0
- package/dist/src/components/dropdown/templates/nr-dropdown-menu.style.js +49 -0
- package/dist/src/components/file-upload/bundle.js +82 -76
- package/dist/src/components/file-upload/bundle.js.gz +0 -0
- package/dist/src/components/file-upload/demo/file-upload-demo.d.ts +18 -0
- package/dist/src/components/file-upload/demo/file-upload-demo.js +156 -0
- package/dist/src/components/file-upload/file-upload.component.d.ts +2 -1
- package/dist/src/components/file-upload/file-upload.component.js +1 -0
- package/dist/src/components/file-upload/styles.js +59 -59
- package/dist/src/components/flex/bundle.js +18 -8
- package/dist/src/components/flex/bundle.js.gz +0 -0
- package/dist/src/components/flex/flex.component.d.ts +4 -1
- package/dist/src/components/flex/flex.component.js +7 -4
- package/dist/src/components/flex/flex.style.js +2 -2
- package/dist/src/components/form/bundle.js +22 -10
- package/dist/src/components/form/bundle.js.gz +0 -0
- package/dist/src/components/form/controllers/submission.controller.d.ts +60 -0
- package/dist/src/components/form/controllers/submission.controller.js +220 -0
- package/dist/src/components/form/controllers/validation.controller.d.ts +87 -0
- package/dist/src/components/form/controllers/validation.controller.js +236 -0
- package/dist/src/components/form/form.component.d.ts +4 -1
- package/dist/src/components/form/form.component.js +5 -1
- package/dist/src/components/form/form.style.js +2 -2
- package/dist/src/components/form/interfaces/validation.interface.d.ts +118 -0
- package/dist/src/components/form/interfaces/validation.interface.js +7 -0
- package/dist/src/components/grid/bundle.js +26 -14
- package/dist/src/components/grid/bundle.js.gz +0 -0
- package/dist/src/components/grid/col.component.d.ts +4 -1
- package/dist/src/components/grid/col.component.js +4 -1
- package/dist/src/components/grid/col.style.js +2 -2
- package/dist/src/components/grid/row.component.d.ts +4 -1
- package/dist/src/components/grid/row.component.js +4 -1
- package/dist/src/components/grid/row.style.js +2 -2
- package/dist/src/components/icon/bundle.js +78 -252
- package/dist/src/components/icon/bundle.js.gz +0 -0
- package/dist/src/components/icon/icon-paths.d.ts +2 -0
- package/dist/src/components/icon/icon-paths.js +141 -0
- package/dist/src/components/icon/icon.component.d.ts +10 -12
- package/dist/src/components/icon/icon.component.js +42 -93
- package/dist/src/components/icon/icon.style.js +42 -130
- package/dist/src/components/icon/icon.variables.js +9 -9
- package/dist/src/components/icon/mixins/clickable-mixin.d.ts +57 -0
- package/dist/src/components/icon/mixins/clickable-mixin.js +111 -0
- package/dist/src/components/icon/mixins/index.d.ts +7 -0
- package/dist/src/components/icon/mixins/index.js +7 -0
- package/dist/src/components/iconpicker/bundle.js +859 -1511
- package/dist/src/components/iconpicker/bundle.js.gz +0 -0
- package/dist/src/components/iconpicker/controllers/event.controller.d.ts +38 -0
- package/dist/src/components/iconpicker/controllers/event.controller.js +68 -0
- package/dist/src/components/iconpicker/controllers/index.d.ts +9 -0
- package/dist/src/components/iconpicker/controllers/index.js +9 -0
- package/dist/src/components/iconpicker/controllers/search.controller.d.ts +34 -0
- package/dist/src/components/iconpicker/controllers/search.controller.js +55 -0
- package/dist/src/components/iconpicker/controllers/selection.controller.d.ts +27 -0
- package/dist/src/components/iconpicker/controllers/selection.controller.js +39 -0
- package/dist/src/components/iconpicker/icon-picker.component.d.ts +2 -1
- package/dist/src/components/iconpicker/icon-picker.component.js +1 -0
- package/dist/src/components/iconpicker/icon-picker.style.js +13 -13
- package/dist/src/components/iconpicker/interfaces/icon-picker.interface.d.ts +13 -0
- package/dist/src/components/iconpicker/interfaces/icon-picker.interface.js +7 -0
- package/dist/src/components/iconpicker/interfaces/index.d.ts +7 -0
- package/dist/src/components/iconpicker/interfaces/index.js +7 -0
- package/dist/src/components/iconpicker/utils/icon-filter.utils.d.ts +29 -0
- package/dist/src/components/iconpicker/utils/icon-filter.utils.js +96 -0
- package/dist/src/components/iconpicker/utils/icon-loader.utils.d.ts +39 -0
- package/dist/src/components/iconpicker/utils/icon-loader.utils.js +115 -0
- package/dist/src/components/iconpicker/utils/index.d.ts +8 -0
- package/dist/src/components/iconpicker/utils/index.js +8 -0
- package/dist/src/components/iconpicker/utils/lucide-icons.d.ts +10 -0
- package/dist/src/components/iconpicker/utils/lucide-icons.js +1624 -0
- package/dist/src/components/image/bundle.js +43 -33
- package/dist/src/components/image/bundle.js.gz +0 -0
- package/dist/src/components/image/image.component.d.ts +10 -1
- package/dist/src/components/image/image.component.js +13 -3
- package/dist/src/components/image/image.style.js +19 -26
- package/dist/src/components/input/bundle.js +420 -644
- package/dist/src/components/input/bundle.js.gz +0 -0
- package/dist/src/components/input/controllers/base.controller.d.ts +35 -0
- package/dist/src/components/input/controllers/base.controller.js +13 -0
- package/dist/src/components/input/controllers/event.controller.d.ts +111 -0
- package/dist/src/components/input/controllers/event.controller.js +355 -0
- package/dist/src/components/input/controllers/index.d.ts +14 -0
- package/dist/src/components/input/controllers/index.js +10 -0
- package/dist/src/components/input/controllers/state.controller.d.ts +153 -0
- package/dist/src/components/input/controllers/state.controller.js +245 -0
- package/dist/src/components/input/controllers/validation.controller.d.ts +205 -0
- package/dist/src/components/input/controllers/validation.controller.js +698 -0
- package/dist/src/components/input/input.component.d.ts +16 -3
- package/dist/src/components/input/input.component.js +43 -27
- package/dist/src/components/input/input.style.d.ts +1 -1
- package/dist/src/components/input/input.style.js +331 -634
- package/dist/src/components/input/mixins/focus-mixin.d.ts +60 -0
- package/dist/src/components/input/mixins/focus-mixin.js +65 -0
- package/dist/src/components/input/mixins/index.d.ts +12 -0
- package/dist/src/components/input/mixins/index.js +9 -0
- package/dist/src/components/input/mixins/number-mixin.d.ts +51 -0
- package/dist/src/components/input/mixins/number-mixin.js +128 -0
- package/dist/src/components/input/mixins/selection-mixin.d.ts +57 -0
- package/dist/src/components/input/mixins/selection-mixin.js +80 -0
- package/dist/src/components/input/test/nr-input_test.d.ts +2 -0
- package/dist/src/components/input/test/nr-input_test.js +159 -0
- package/dist/src/components/input/utils/index.d.ts +8 -0
- package/dist/src/components/input/utils/index.js +8 -0
- package/dist/src/components/input/utils/input-renderers.d.ts +54 -0
- package/dist/src/components/input/utils/input-renderers.js +178 -0
- package/dist/src/components/input/utils/input-validation.utils.d.ts +26 -0
- package/dist/src/components/input/utils/input-validation.utils.js +103 -0
- package/dist/src/components/kv-secret-select/bundle.js +2 -1
- package/dist/src/components/kv-secret-select/bundle.js.gz +0 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.d.ts +3 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.js +4 -0
- package/dist/src/components/label/bundle.js +37 -60
- package/dist/src/components/label/bundle.js.gz +0 -0
- package/dist/src/components/label/label.component.d.ts +8 -4
- package/dist/src/components/label/label.component.js +9 -14
- package/dist/src/components/label/label.style.js +17 -25
- package/dist/src/components/label/label.style.variables.js +18 -18
- package/dist/src/components/layout/bundle.js +86 -70
- package/dist/src/components/layout/bundle.js.gz +0 -0
- package/dist/src/components/layout/content.component.d.ts +2 -1
- package/dist/src/components/layout/content.component.js +2 -1
- package/dist/src/components/layout/content.style.js +3 -3
- package/dist/src/components/layout/footer.component.d.ts +2 -1
- package/dist/src/components/layout/footer.component.js +3 -2
- package/dist/src/components/layout/footer.style.js +7 -7
- package/dist/src/components/layout/header.component.d.ts +2 -1
- package/dist/src/components/layout/header.component.js +3 -2
- package/dist/src/components/layout/header.style.js +7 -7
- package/dist/src/components/layout/layout.component.d.ts +4 -7
- package/dist/src/components/layout/layout.component.js +9 -22
- package/dist/src/components/layout/layout.style.js +1 -1
- package/dist/src/components/layout/sider.component.d.ts +3 -1
- package/dist/src/components/layout/sider.component.js +3 -1
- package/dist/src/components/layout/sider.style.js +29 -29
- package/dist/src/components/menu/bundle.js +135 -125
- package/dist/src/components/menu/bundle.js.gz +0 -0
- package/dist/src/components/menu/controllers/accessibility.controller.d.ts +86 -0
- package/dist/src/components/menu/controllers/accessibility.controller.js +235 -0
- package/dist/src/components/menu/controllers/base.controller.d.ts +41 -0
- package/dist/src/components/menu/controllers/base.controller.js +61 -0
- package/dist/src/components/menu/controllers/index.d.ts +10 -0
- package/dist/src/components/menu/controllers/index.js +10 -0
- package/dist/src/components/menu/controllers/keyboard.controller.d.ts +84 -0
- package/dist/src/components/menu/controllers/keyboard.controller.js +328 -0
- package/dist/src/components/menu/controllers/state.controller.d.ts +106 -0
- package/dist/src/components/menu/controllers/state.controller.js +249 -0
- package/dist/src/components/menu/interfaces/controller.interface.d.ts +51 -0
- package/dist/src/components/menu/interfaces/controller.interface.js +7 -0
- package/dist/src/components/menu/interfaces/index.d.ts +7 -0
- package/dist/src/components/menu/interfaces/index.js +7 -0
- package/dist/src/components/menu/menu.component.d.ts +2 -1
- package/dist/src/components/menu/menu.component.js +1 -0
- package/dist/src/components/menu/menu.style.js +87 -87
- package/dist/src/components/modal/bundle.js +105 -96
- package/dist/src/components/modal/bundle.js.gz +0 -0
- package/dist/src/components/modal/controllers/index.d.ts +8 -0
- package/dist/src/components/modal/controllers/index.js +8 -0
- package/dist/src/components/modal/controllers/modal-drag-controller.d.ts +39 -0
- package/dist/src/components/modal/controllers/modal-drag-controller.js +108 -0
- package/dist/src/components/modal/controllers/modal-keyboard-controller.d.ts +36 -0
- package/dist/src/components/modal/controllers/modal-keyboard-controller.js +128 -0
- package/dist/src/components/modal/modal.component.d.ts +2 -1
- package/dist/src/components/modal/modal.component.js +1 -0
- package/dist/src/components/modal/modal.style.js +69 -71
- package/dist/src/components/panel/bundle.js +190 -391
- package/dist/src/components/panel/bundle.js.gz +0 -0
- package/dist/src/components/panel/controllers/index.d.ts +8 -0
- package/dist/src/components/panel/controllers/index.js +8 -0
- package/dist/src/components/panel/controllers/panel-drag-controller.d.ts +40 -0
- package/dist/src/components/panel/controllers/panel-drag-controller.js +118 -0
- package/dist/src/components/panel/controllers/panel-resize-controller.d.ts +37 -0
- package/dist/src/components/panel/controllers/panel-resize-controller.js +124 -0
- package/dist/src/components/panel/panel.component.d.ts +2 -1
- package/dist/src/components/panel/panel.component.js +1 -0
- package/dist/src/components/panel/panel.style.js +65 -65
- package/dist/src/components/popconfirm/bundle.js +107 -93
- package/dist/src/components/popconfirm/bundle.js.gz +0 -0
- package/dist/src/components/popconfirm/popconfirm-manager.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm-manager.component.js +1 -0
- package/dist/src/components/popconfirm/popconfirm-manager.style.js +16 -16
- package/dist/src/components/popconfirm/popconfirm.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm.component.js +9 -5
- package/dist/src/components/popconfirm/popconfirm.style.js +43 -43
- package/dist/src/components/presence/bundle.js +528 -0
- package/dist/src/components/presence/bundle.js.gz +0 -0
- package/dist/src/components/presence/index.d.ts +10 -0
- package/dist/src/components/presence/index.js +10 -0
- package/dist/src/components/presence/presence-avatars.component.d.ts +40 -0
- package/dist/src/components/presence/presence-avatars.component.js +83 -0
- package/dist/src/components/presence/presence-avatars.style.d.ts +7 -0
- package/dist/src/components/presence/presence-avatars.style.js +105 -0
- package/dist/src/components/presence/presence-chat.component.d.ts +53 -0
- package/dist/src/components/presence/presence-chat.component.js +228 -0
- package/dist/src/components/presence/presence-chat.style.d.ts +7 -0
- package/dist/src/components/presence/presence-chat.style.js +248 -0
- package/dist/src/components/presence/presence.component.d.ts +71 -0
- package/dist/src/components/presence/presence.component.js +263 -0
- package/dist/src/components/presence/presence.style.d.ts +7 -0
- package/dist/src/components/presence/presence.style.js +12 -0
- package/dist/src/components/presence/presence.types.d.ts +31 -0
- package/dist/src/components/presence/presence.types.js +7 -0
- package/dist/src/components/presence/react.d.ts +24 -0
- package/dist/src/components/presence/react.js +41 -0
- package/dist/src/components/radio/bundle.js +56 -86
- package/dist/src/components/radio/bundle.js.gz +0 -0
- package/dist/src/components/radio/radio.component.d.ts +8 -2
- package/dist/src/components/radio/radio.component.js +17 -9
- package/dist/src/components/radio/radio.style.js +30 -77
- package/dist/src/components/radio-group/bundle.js +125 -89
- package/dist/src/components/radio-group/bundle.js.gz +0 -0
- package/dist/src/components/radio-group/controllers/focus.controller.d.ts +98 -0
- package/dist/src/components/radio-group/controllers/focus.controller.js +216 -0
- package/dist/src/components/radio-group/controllers/group.controller.d.ts +140 -0
- package/dist/src/components/radio-group/controllers/group.controller.js +179 -0
- package/dist/src/components/radio-group/controllers/index.d.ts +11 -0
- package/dist/src/components/radio-group/controllers/index.js +11 -0
- package/dist/src/components/radio-group/controllers/keyboard.controller.d.ts +24 -0
- package/dist/src/components/radio-group/controllers/keyboard.controller.js +93 -0
- package/dist/src/components/radio-group/controllers/ripple.controller.d.ts +59 -0
- package/dist/src/components/radio-group/controllers/ripple.controller.js +208 -0
- package/dist/src/components/radio-group/controllers/validation.controller.d.ts +73 -0
- package/dist/src/components/radio-group/controllers/validation.controller.js +108 -0
- package/dist/src/components/radio-group/interfaces/base-controller.interface.d.ts +75 -0
- package/dist/src/components/radio-group/interfaces/base-controller.interface.js +7 -0
- package/dist/src/components/radio-group/interfaces/focus-controller.interface.d.ts +40 -0
- package/dist/src/components/radio-group/interfaces/focus-controller.interface.js +7 -0
- package/dist/src/components/radio-group/interfaces/index.d.ts +11 -0
- package/dist/src/components/radio-group/interfaces/index.js +7 -0
- package/dist/src/components/radio-group/interfaces/ripple-controller.interface.d.ts +31 -0
- package/dist/src/components/radio-group/interfaces/ripple-controller.interface.js +7 -0
- package/dist/src/components/radio-group/interfaces/selection-controller.interface.d.ts +45 -0
- package/dist/src/components/radio-group/interfaces/selection-controller.interface.js +7 -0
- package/dist/src/components/radio-group/interfaces/validation-controller.interface.d.ts +48 -0
- package/dist/src/components/radio-group/interfaces/validation-controller.interface.js +7 -0
- package/dist/src/components/radio-group/radio-group.component.d.ts +5 -1
- package/dist/src/components/radio-group/radio-group.component.js +18 -10
- package/dist/src/components/radio-group/radio-group.style.js +44 -44
- package/dist/src/components/radio-group/test/radio_test.d.ts +2 -0
- package/dist/src/components/radio-group/test/radio_test.js +79 -0
- package/dist/src/components/select/bundle.js +260 -367
- package/dist/src/components/select/bundle.js.gz +0 -0
- package/dist/src/components/select/controllers/base.controller.d.ts +10 -0
- package/dist/src/components/select/controllers/base.controller.js +8 -0
- package/dist/src/components/select/controllers/dropdown.controller.d.ts +76 -0
- package/dist/src/components/select/controllers/dropdown.controller.js +281 -0
- package/dist/src/components/select/controllers/event.controller.d.ts +54 -0
- package/dist/src/components/select/controllers/event.controller.js +113 -0
- package/dist/src/components/select/controllers/focus.controller.d.ts +79 -0
- package/dist/src/components/select/controllers/focus.controller.js +230 -0
- package/dist/src/components/select/controllers/index.d.ts +9 -0
- package/dist/src/components/select/controllers/index.js +9 -0
- package/dist/src/components/select/controllers/keyboard.controller.d.ts +75 -0
- package/dist/src/components/select/controllers/keyboard.controller.js +369 -0
- package/dist/src/components/select/controllers/search.controller.d.ts +71 -0
- package/dist/src/components/select/controllers/search.controller.js +167 -0
- package/dist/src/components/select/controllers/selection.controller.d.ts +67 -0
- package/dist/src/components/select/controllers/selection.controller.js +217 -0
- package/dist/src/components/select/controllers/validation.controller.d.ts +66 -0
- package/dist/src/components/select/controllers/validation.controller.js +189 -0
- package/dist/src/components/select/interfaces/base-controller.interface.d.ts +147 -0
- package/dist/src/components/select/interfaces/base-controller.interface.js +2 -0
- package/dist/src/components/select/interfaces/controller-interfaces.d.ts +94 -0
- package/dist/src/components/select/interfaces/controller-interfaces.js +11 -0
- package/dist/src/components/select/interfaces/index.d.ts +3 -0
- package/dist/src/components/select/interfaces/index.js +3 -0
- package/dist/src/components/select/select.component.d.ts +12 -17
- package/dist/src/components/select/select.component.js +35 -35
- package/dist/src/components/select/select.style.js +184 -324
- package/dist/src/components/skeleton/bundle.js +82 -162
- package/dist/src/components/skeleton/bundle.js.gz +0 -0
- package/dist/src/components/skeleton/skeleton.component.d.ts +10 -5
- package/dist/src/components/skeleton/skeleton.component.js +20 -7
- package/dist/src/components/skeleton/skeleton.style.js +34 -133
- package/dist/src/components/slider-input/bundle.js +89 -88
- package/dist/src/components/slider-input/bundle.js.gz +0 -0
- package/dist/src/components/slider-input/slider-input.component.d.ts +11 -0
- package/dist/src/components/slider-input/slider-input.component.js +20 -8
- package/dist/src/components/slider-input/slider-input.style.js +47 -47
- package/dist/src/components/slider-input/slider-input.style.variables.js +32 -32
- package/dist/src/components/slider-input/utils/debounce.d.ts +2 -0
- package/dist/src/components/slider-input/utils/debounce.js +8 -0
- package/dist/src/components/slider-input/utils/index.d.ts +2 -0
- package/dist/src/components/slider-input/utils/index.js +2 -0
- package/dist/src/components/table/bundle.js +149 -128
- package/dist/src/components/table/bundle.js.gz +0 -0
- package/dist/src/components/table/controllers/base.controller.d.ts +15 -0
- package/dist/src/components/table/controllers/base.controller.js +13 -0
- package/dist/src/components/table/controllers/filter.controller.d.ts +48 -0
- package/dist/src/components/table/controllers/filter.controller.js +152 -0
- package/dist/src/components/table/controllers/index.d.ts +11 -0
- package/dist/src/components/table/controllers/index.js +11 -0
- package/dist/src/components/table/controllers/pagination.controller.d.ts +36 -0
- package/dist/src/components/table/controllers/pagination.controller.js +110 -0
- package/dist/src/components/table/controllers/selection.controller.d.ts +40 -0
- package/dist/src/components/table/controllers/selection.controller.js +120 -0
- package/dist/src/components/table/controllers/sort.controller.d.ts +32 -0
- package/dist/src/components/table/controllers/sort.controller.js +102 -0
- package/dist/src/components/table/interfaces/index.d.ts +7 -0
- package/dist/src/components/table/interfaces/index.js +7 -0
- package/dist/src/components/table/interfaces/table-host.interface.d.ts +48 -0
- package/dist/src/components/table/interfaces/table-host.interface.js +7 -0
- package/dist/src/components/table/table.component.d.ts +2 -1
- package/dist/src/components/table/table.component.js +1 -0
- package/dist/src/components/table/table.style.js +79 -79
- package/dist/src/components/table/templates/actions.template.d.ts +14 -0
- package/dist/src/components/table/templates/actions.template.js +15 -0
- package/dist/src/components/table/templates/column-filter.template.d.ts +24 -0
- package/dist/src/components/table/templates/column-filter.template.js +76 -0
- package/dist/src/components/table/templates/content.template.d.ts +37 -0
- package/dist/src/components/table/templates/content.template.js +208 -0
- package/dist/src/components/table/templates/empty.template.d.ts +8 -0
- package/dist/src/components/table/templates/empty.template.js +47 -0
- package/dist/src/components/table/templates/filter.template.d.ts +14 -0
- package/dist/src/components/table/templates/filter.template.js +28 -0
- package/dist/src/components/table/templates/index.d.ts +8 -0
- package/dist/src/components/table/templates/index.js +8 -0
- package/dist/src/components/table/templates/loading.template.d.ts +21 -0
- package/dist/src/components/table/templates/loading.template.js +51 -0
- package/dist/src/components/table/templates/pagination.template.d.ts +24 -0
- package/dist/src/components/table/templates/pagination.template.js +52 -0
- package/dist/src/components/tabs/bundle.js +462 -663
- package/dist/src/components/tabs/bundle.js.gz +0 -0
- package/dist/src/components/tabs/controllers/base.controller.d.ts +49 -0
- package/dist/src/components/tabs/controllers/base.controller.js +26 -0
- package/dist/src/components/tabs/controllers/dragdrop.controller.d.ts +84 -0
- package/dist/src/components/tabs/controllers/dragdrop.controller.js +202 -0
- package/dist/src/components/tabs/controllers/editable.controller.d.ts +100 -0
- package/dist/src/components/tabs/controllers/editable.controller.js +242 -0
- package/dist/src/components/tabs/controllers/event.controller.d.ts +104 -0
- package/dist/src/components/tabs/controllers/event.controller.js +239 -0
- package/dist/src/components/tabs/controllers/index.d.ts +12 -0
- package/dist/src/components/tabs/controllers/index.js +18 -0
- package/dist/src/components/tabs/controllers/keyboard.controller.d.ts +85 -0
- package/dist/src/components/tabs/controllers/keyboard.controller.js +233 -0
- package/dist/src/components/tabs/controllers/popout.controller.d.ts +96 -0
- package/dist/src/components/tabs/controllers/popout.controller.js +441 -0
- package/dist/src/components/tabs/tabs.component.d.ts +6 -1
- package/dist/src/components/tabs/tabs.component.js +8 -1
- package/dist/src/components/tabs/tabs.style.js +200 -201
- package/dist/src/components/tag/bundle.js +44 -36
- package/dist/src/components/tag/bundle.js.gz +0 -0
- package/dist/src/components/tag/tag.component.d.ts +7 -6
- package/dist/src/components/tag/tag.component.js +10 -19
- package/dist/src/components/tag/tag.style.js +20 -24
- package/dist/src/components/textarea/bundle.js +131 -94
- package/dist/src/components/textarea/bundle.js.gz +0 -0
- package/dist/src/components/textarea/controllers/base.controller.d.ts +43 -0
- package/dist/src/components/textarea/controllers/base.controller.js +19 -0
- package/dist/src/components/textarea/controllers/event.controller.d.ts +169 -0
- package/dist/src/components/textarea/controllers/event.controller.js +408 -0
- package/dist/src/components/textarea/controllers/index.d.ts +9 -0
- package/dist/src/components/textarea/controllers/index.js +9 -0
- package/dist/src/components/textarea/controllers/validation.controller.d.ts +133 -0
- package/dist/src/components/textarea/controllers/validation.controller.js +315 -0
- package/dist/src/components/textarea/textarea.component.d.ts +7 -1
- package/dist/src/components/textarea/textarea.component.js +10 -3
- package/dist/src/components/textarea/textarea.style.d.ts +1 -13
- package/dist/src/components/textarea/textarea.style.js +79 -91
- package/dist/src/components/timeline/bundle.js +71 -134
- package/dist/src/components/timeline/bundle.js.gz +0 -0
- package/dist/src/components/timeline/timeline.component.d.ts +9 -6
- package/dist/src/components/timeline/timeline.component.js +16 -13
- package/dist/src/components/timeline/timeline.style.d.ts +0 -7
- package/dist/src/components/timeline/timeline.style.js +41 -122
- package/dist/src/components/timepicker/bundle.js +196 -166
- package/dist/src/components/timepicker/bundle.js.gz +0 -0
- package/dist/src/components/timepicker/controllers/formatting.controller.d.ts +93 -0
- package/dist/src/components/timepicker/controllers/formatting.controller.js +195 -0
- package/dist/src/components/timepicker/controllers/index.d.ts +9 -0
- package/dist/src/components/timepicker/controllers/index.js +9 -0
- package/dist/src/components/timepicker/controllers/selection.controller.d.ts +72 -0
- package/dist/src/components/timepicker/controllers/selection.controller.js +175 -0
- package/dist/src/components/timepicker/controllers/validation.controller.d.ts +88 -0
- package/dist/src/components/timepicker/controllers/validation.controller.js +200 -0
- package/dist/src/components/timepicker/interfaces/timepicker.interface.d.ts +103 -0
- package/dist/src/components/timepicker/interfaces/timepicker.interface.js +7 -0
- package/dist/src/components/timepicker/test/timepicker_test.d.ts +7 -0
- package/dist/src/components/timepicker/test/timepicker_test.js +218 -0
- package/dist/src/components/timepicker/timepicker.component.d.ts +2 -1
- package/dist/src/components/timepicker/timepicker.component.js +1 -0
- package/dist/src/components/timepicker/timepicker.style.js +42 -42
- package/dist/src/components/timepicker/timepicker.style.variables.js +91 -91
- package/dist/src/components/timepicker/utils/time.utils.d.ts +87 -0
- package/dist/src/components/timepicker/utils/time.utils.js +235 -0
- package/dist/src/components/toast/bundle.js +97 -81
- package/dist/src/components/toast/bundle.js.gz +0 -0
- package/dist/src/components/toast/controllers/base.controller.d.ts +20 -0
- package/dist/src/components/toast/controllers/base.controller.js +12 -0
- package/dist/src/components/toast/controllers/index.d.ts +8 -0
- package/dist/src/components/toast/controllers/index.js +7 -0
- package/dist/src/components/toast/toast.component.d.ts +2 -1
- package/dist/src/components/toast/toast.component.js +1 -0
- package/dist/src/components/toast/toast.style.js +62 -62
- package/dist/src/components/tooltips/bundle.js +10 -10
- package/dist/src/components/tooltips/bundle.js.gz +0 -0
- package/dist/src/components/tooltips/demo/tooltips-demo.d.ts +18 -0
- package/dist/src/components/tooltips/demo/tooltips-demo.js +132 -0
- package/dist/src/components/tooltips/test/tooltips_test.d.ts +2 -0
- package/dist/src/components/tooltips/test/tooltips_test.js +145 -0
- package/dist/src/components/tooltips/tooltips.component.d.ts +8 -0
- package/dist/src/components/tooltips/tooltips.component.js +9 -1
- package/dist/src/components/tooltips/tooltips.style.js +6 -6
- package/dist/src/components/video/bundle.js +47 -36
- package/dist/src/components/video/bundle.js.gz +0 -0
- package/dist/src/components/video/video.component.d.ts +12 -1
- package/dist/src/components/video/video.component.js +18 -6
- package/dist/src/components/video/video.style.js +18 -24
- package/package.json +51 -12
- package/packages/common/dist/VERSIONS.md +2 -2
- package/packages/common/dist/shared/base-mixin.d.ts +21 -19
- package/packages/common/dist/shared/base-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/base-mixin.js +102 -18
- package/packages/common/dist/shared/base-mixin.js.map +1 -1
- package/packages/common/dist/shared/index.d.ts +1 -0
- package/packages/common/dist/shared/index.d.ts.map +1 -1
- package/packages/common/dist/shared/index.js +2 -0
- package/packages/common/dist/shared/index.js.map +1 -1
- package/packages/common/dist/shared/style-injector.d.ts +11 -0
- package/packages/common/dist/shared/style-injector.d.ts.map +1 -0
- package/packages/common/dist/shared/style-injector.js +53 -0
- package/packages/common/dist/shared/style-injector.js.map +1 -0
- package/packages/common/dist/shared/theme-mixin.d.ts +2 -24
- package/packages/common/dist/shared/theme-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/theme-mixin.js +5 -38
- package/packages/common/dist/shared/theme-mixin.js.map +1 -1
- package/packages/themes/dist/default.css +0 -10
- package/packages/themes/dist/package.json +1 -1
|
@@ -1,672 +1,478 @@
|
|
|
1
|
-
import{css as t,
|
|
2
|
-
/*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
1
|
+
import{css as t,nothing as i,html as e,LitElement as r}from"lit";import{property as n,state as s,customElement as a}from"lit/decorators.js";const o=t`
|
|
2
|
+
/* ========================================
|
|
3
|
+
* HOST ELEMENT
|
|
4
|
+
* ======================================== */
|
|
6
5
|
:host {
|
|
7
6
|
display: flex;
|
|
8
7
|
flex-direction: column;
|
|
9
|
-
font-family:
|
|
8
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
9
|
+
font-size: 13px;
|
|
10
|
+
line-height: 1.4;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
/*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* Uses theme CSS custom properties for comprehensive theming support
|
|
16
|
-
*/
|
|
13
|
+
/* ========================================
|
|
14
|
+
* INPUT WRAPPER
|
|
15
|
+
* ======================================== */
|
|
17
16
|
.input-wrapper {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
#input-container > input {
|
|
23
|
-
background-color: transparent;
|
|
24
|
-
border: var(--nuraly-input-border, none);
|
|
25
|
-
outline: var(--nuraly-input-outline, none);
|
|
26
|
-
flex: 1;
|
|
27
|
-
min-width: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: stretch;
|
|
28
19
|
width: 100%;
|
|
29
|
-
|
|
30
|
-
/* Typography from theme */
|
|
31
|
-
font-family: var(--nuraly-font-family-input, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto);
|
|
32
|
-
font-size: var(--nuraly-font-size-input, 14px);
|
|
33
|
-
color: var(--nuraly-color-input-text, var(--nuraly-color-input-text-fallback, rgba(0, 0, 0, 0.88)));
|
|
34
|
-
|
|
35
|
-
/* Padding from theme */
|
|
36
|
-
padding: var(--nuraly-spacing-input-medium-vertical, 4px) var(--nuraly-spacing-input-medium-horizontal, 11px);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/*
|
|
40
|
-
* Disabled state styles for wrapper and input
|
|
41
|
-
* Applied when input is disabled - removes interactivity and applies muted colors
|
|
42
|
-
*/
|
|
43
|
-
:host([disabled]) .input-wrapper {
|
|
44
|
-
background-color: var(--nuraly-color-input-disabled-background, var(--nuraly-color-input-disabled-background-fallback, #f4f4f4));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host([disabled]) #input-container > input {
|
|
48
20
|
background-color: transparent;
|
|
49
|
-
cursor: var(--nuraly-cursor-disabled, not-allowed);
|
|
50
|
-
color: var(--nuraly-color-input-disabled-text, var(--nuraly-color-input-disabled-text-fallback, rgba(0, 0, 0, 0.25)));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/*
|
|
54
|
-
* Icon base styles
|
|
55
|
-
* Common styling for all icons within the input component
|
|
56
|
-
* Provides comprehensive CSS variable override system
|
|
57
|
-
*/
|
|
58
|
-
nr-icon {
|
|
59
|
-
display: flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
|
|
62
|
-
/* Global icon color override - applies to all icons in input */
|
|
63
|
-
--nuraly-color-icon: var(--nuraly-color-input-icon, var(--nuraly-color-icon, var(--nuraly-color-icon-fallback, #161616)));
|
|
64
|
-
|
|
65
|
-
/* Size override for input icons */
|
|
66
|
-
--nuraly-icon-size: var(--nuraly-size-input-icon, var(--nuraly-icon-size, var(--nuraly-icon-size-fallback, 18px)));
|
|
67
|
-
|
|
68
|
-
/* Interactive state overrides */
|
|
69
|
-
--nuraly-color-icon-hover: var(--nuraly-color-input-icon-hover, var(--nuraly-color-icon-hover, var(--nuraly-color-icon-hover-fallback, #0f62fe)));
|
|
70
|
-
--nuraly-color-icon-active: var(--nuraly-color-input-icon-active, var(--nuraly-color-icon-active, var(--nuraly-color-icon-active-fallback, #054ada)));
|
|
71
|
-
--nuraly-color-icon-disabled: var(--nuraly-color-input-icon-disabled, var(--nuraly-color-icon-disabled, var(--nuraly-color-icon-disabled-fallback, #c6c6c6)));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/*
|
|
75
|
-
* Placeholder styling
|
|
76
|
-
* Customizable placeholder text appearance
|
|
77
|
-
*/
|
|
78
|
-
::placeholder {
|
|
79
|
-
color: var(--nuraly-color-input-placeholder, var(--nuraly-color-input-placeholder-fallback, #a8a8a8));
|
|
80
|
-
font-size: var(--nuraly-font-size-input-placeholder, 14px);
|
|
81
|
-
font-family: var(--nuraly-font-family-input, 'IBM Plex Sans', ui-sans-serif, system-ui);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/*
|
|
85
|
-
* Disabled placeholder styling
|
|
86
|
-
* Applied when input is disabled
|
|
87
|
-
*/
|
|
88
|
-
:host([disabled]) ::placeholder {
|
|
89
|
-
color: var(--nuraly-color-input-disabled-placeholder, var(--nuraly-color-input-disabled-placeholder-fallback, #c6c6c6));
|
|
90
21
|
}
|
|
91
22
|
|
|
92
23
|
/* ========================================
|
|
93
|
-
*
|
|
24
|
+
* INPUT CONTAINER
|
|
94
25
|
* ======================================== */
|
|
95
|
-
|
|
96
|
-
/* Warning state icon */
|
|
97
|
-
#warning-icon {
|
|
98
|
-
--nuraly-color-icon: var(--nuraly-color-input-warning-icon, #f1c21b);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* Error state icon */
|
|
102
|
-
#error-icon {
|
|
103
|
-
--nuraly-color-icon: var(--nuraly-color-input-error-icon, #da1e28);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* Calendar input type icon */
|
|
107
|
-
#calendar-icon {
|
|
108
|
-
--nuraly-color-icon: var(--nuraly-color-input-calendar-icon, #161616);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* Password toggle icon */
|
|
112
|
-
#password-icon {
|
|
113
|
-
padding-left: var(--nuraly-input-password-icon-padding-left, var(--nuraly-password-icon-padding-left, 8px));
|
|
114
|
-
padding-right: var(--nuraly-input-password-icon-padding-right, var(--nuraly-password-icon-padding-right, 8px));
|
|
115
|
-
cursor: var(--nuraly-cursor-interactive, pointer);
|
|
116
|
-
--nuraly-color-icon: var(--nuraly-color-input-password-icon, #161616);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* Copy functionality icon */
|
|
120
|
-
#copy-icon {
|
|
121
|
-
padding-right: var(--nuraly-input-copy-icon-padding-right, var(--nuraly-copy-icon-padding-right, 8px));
|
|
122
|
-
--nuraly-color-icon: var(--nuraly-color-input-copy-icon, #161616);
|
|
123
|
-
cursor: var(--nuraly-cursor-interactive, pointer);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Clear functionality icon */
|
|
127
|
-
#clear-icon {
|
|
128
|
-
padding-right: var(--nuraly-input-clear-icon-padding-right, var(--nuraly-clear-icon-padding-right, 8px));
|
|
129
|
-
--nuraly-color-icon: var(--nuraly-color-input-clear-icon, #161616);
|
|
130
|
-
cursor: var(--nuraly-cursor-interactive, pointer);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/*
|
|
134
|
-
* Number input increment/decrement icons container
|
|
135
|
-
* Positioned absolutely for overlay on input
|
|
136
|
-
*/
|
|
137
|
-
#number-icons {
|
|
26
|
+
#input-container {
|
|
138
27
|
display: flex;
|
|
139
|
-
justify-content: space-between;
|
|
140
28
|
align-items: center;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
--nuraly-color-icon: var(--nuraly-color-input-number-icons, #161616);
|
|
153
|
-
padding-left: var(--nuraly-input-number-icons-padding-left, var(--nuraly-number-icons-padding-left, 4px));
|
|
154
|
-
padding-right: var(--nuraly-input-number-icons-padding-right, var(--nuraly-number-icons-padding-right, 4px));
|
|
155
|
-
width: var(--nuraly-input-number-icons-width, var(--nuraly-number-icons-width, 24px));
|
|
156
|
-
height: var(--nuraly-input-number-icons-height, var(--nuraly-number-icons-height, 24px));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/* Number icons separator styling */
|
|
160
|
-
#icons-separator {
|
|
161
|
-
color: var(--nuraly-input-number-icons-separator-color, var(--nuraly-number-icons-separator-color));
|
|
162
|
-
padding-bottom: var(--nuraly-input-number-icons-separator-padding-bottom, var(--nuraly-number-icons-separator-padding-bottom));
|
|
163
|
-
padding-left: var(--nuraly-input-number-icons-separator-padding-left, var(--nuraly-number-icons-separator-padding-left));
|
|
164
|
-
padding-right: var(--nuraly-input-number-icons-separator-padding-right, var(--nuraly-number-icons-separator-padding-right));
|
|
29
|
+
position: relative;
|
|
30
|
+
flex: 1;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
border: 1px solid var(--nr-border, #d9d9d9);
|
|
33
|
+
border-radius: 8px;
|
|
34
|
+
background-color: var(--nr-bg, #ffffff);
|
|
35
|
+
color: var(--nr-text, rgba(0, 0, 0, 0.88));
|
|
36
|
+
font-family: inherit;
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
165
40
|
}
|
|
166
41
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
* Applied when input is disabled - reduces opacity and disables interaction
|
|
170
|
-
*/
|
|
171
|
-
:host([disabled]) #password-icon,
|
|
172
|
-
:host([disabled]) #error-icon,
|
|
173
|
-
:host([disabled]) #warning-icon,
|
|
174
|
-
:host([disabled]) #number-icons,
|
|
175
|
-
:host([disabled]) #calendar-icon,
|
|
176
|
-
:host([disabled]) #copy-icon,
|
|
177
|
-
:host([disabled]) #clear-icon {
|
|
178
|
-
opacity: var(--nuraly-input-disabled-icon-opacity, var(--nuraly-disabled-icon-opacity));
|
|
42
|
+
:host(:not([disabled])) #input-container:hover {
|
|
43
|
+
border-color: var(--nr-primary, #7c3aed);
|
|
179
44
|
}
|
|
180
45
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
:host([disabled]) #clear-icon {
|
|
186
|
-
cursor: not-allowed;
|
|
46
|
+
:host(:not([disabled])) #input-container:focus-within {
|
|
47
|
+
border-color: var(--nr-primary, #7c3aed);
|
|
48
|
+
box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.15);
|
|
49
|
+
outline: none;
|
|
187
50
|
}
|
|
188
51
|
|
|
189
52
|
/* ========================================
|
|
190
|
-
* INPUT
|
|
53
|
+
* INPUT ELEMENT
|
|
191
54
|
* ======================================== */
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
55
|
+
#input-container > input {
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
border: none;
|
|
58
|
+
border-radius: 0;
|
|
59
|
+
outline: none;
|
|
60
|
+
box-shadow: none;
|
|
61
|
+
-webkit-appearance: none;
|
|
62
|
+
appearance: none;
|
|
63
|
+
flex: 1;
|
|
64
|
+
min-width: 0;
|
|
200
65
|
width: 100%;
|
|
66
|
+
font-family: inherit;
|
|
67
|
+
font-size: 13px;
|
|
68
|
+
color: var(--nr-text, rgba(0, 0, 0, 0.88));
|
|
69
|
+
padding: 6px 10px;
|
|
201
70
|
}
|
|
202
71
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
.input-addon-before {
|
|
208
|
-
background-color: var(--nuraly-input-addon-background-color, var(--nuraly-addon-background-color));
|
|
209
|
-
border: var(--nuraly-input-border, var(--nuraly-border));
|
|
210
|
-
border-right: none;
|
|
211
|
-
border-top-left-radius: var(--nuraly-input-border-radius, var(--nuraly-border-radius));
|
|
212
|
-
border-bottom-left-radius: var(--nuraly-input-border-radius, var(--nuraly-border-radius));
|
|
213
|
-
padding: var(--nuraly-input-addon-padding, var(--nuraly-addon-padding));
|
|
214
|
-
display: flex;
|
|
215
|
-
align-items: center;
|
|
216
|
-
color: var(--nuraly-input-addon-color, var(--nuraly-addon-color));
|
|
217
|
-
font-size: var(--nuraly-input-font-size, var(--nuraly-font-size));
|
|
218
|
-
white-space: nowrap;
|
|
219
|
-
min-width: 0; /* Allow shrinking */
|
|
220
|
-
flex-shrink: 0; /* Prevent shrinking */
|
|
72
|
+
::placeholder {
|
|
73
|
+
color: var(--nr-placeholder, #a8a8a8);
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
font-family: inherit;
|
|
221
76
|
}
|
|
222
77
|
|
|
223
|
-
/*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.input-addon-after {
|
|
228
|
-
background-color: var(--nuraly-input-addon-background-color, var(--nuraly-addon-background-color));
|
|
229
|
-
border: var(--nuraly-input-border, var(--nuraly-border));
|
|
230
|
-
border-left: none;
|
|
231
|
-
border-top-right-radius: var(--nuraly-input-border-radius, var(--nuraly-border-radius));
|
|
232
|
-
border-bottom-right-radius: var(--nuraly-input-border-radius, var(--nuraly-border-radius));
|
|
233
|
-
padding: var(--nuraly-input-addon-padding, var(--nuraly-addon-padding));
|
|
234
|
-
display: flex;
|
|
235
|
-
align-items: center;
|
|
236
|
-
color: var(--nuraly-input-addon-color, var(--nuraly-addon-color));
|
|
237
|
-
font-size: var(--nuraly-input-font-size, var(--nuraly-font-size));
|
|
238
|
-
white-space: nowrap;
|
|
239
|
-
min-width: 0; /* Allow shrinking */
|
|
240
|
-
flex-shrink: 0; /* Prevent shrinking */
|
|
78
|
+
/* Remove default number spinners */
|
|
79
|
+
input::-webkit-outer-spin-button,
|
|
80
|
+
input::-webkit-inner-spin-button {
|
|
81
|
+
-webkit-appearance: none;
|
|
241
82
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
* Input container border radius adjustments when addons are present
|
|
245
|
-
* Removes border radius on sides where addons are attached
|
|
246
|
-
*/
|
|
247
|
-
.input-wrapper:has(.input-addon-before) #input-container {
|
|
248
|
-
border-top-left-radius: 0;
|
|
249
|
-
border-bottom-left-radius: 0;
|
|
250
|
-
border-left: none;
|
|
83
|
+
input[type='number'] {
|
|
84
|
+
-moz-appearance: textfield;
|
|
251
85
|
}
|
|
252
86
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
border-right: none;
|
|
257
|
-
}
|
|
87
|
+
/* ========================================
|
|
88
|
+
* SIZE VARIATIONS
|
|
89
|
+
* ======================================== */
|
|
258
90
|
|
|
259
|
-
/*
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
border-radius: var(--nuraly-border-radius-input, 6px);
|
|
267
|
-
|
|
268
|
-
/* Background and text styling */
|
|
269
|
-
background-color: var(--nuraly-color-input-background, #ffffff);
|
|
270
|
-
color: var(--nuraly-color-input-text, rgba(0, 0, 0, 0.88));
|
|
271
|
-
font-family: var(--nuraly-font-family-input, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto);
|
|
272
|
-
font-size: var(--nuraly-font-size-input, 14px);
|
|
273
|
-
|
|
274
|
-
/* Layout */
|
|
275
|
-
display: flex;
|
|
276
|
-
position: relative;
|
|
277
|
-
flex: 1; /* Take available space in wrapper */
|
|
278
|
-
min-width: 0; /* Allow shrinking below content size */
|
|
279
|
-
|
|
280
|
-
/* Transitions for smooth theme changes */
|
|
281
|
-
transition: var(--nuraly-transition-input, border-color 0.2s, box-shadow 0.2s);
|
|
91
|
+
/* Small */
|
|
92
|
+
div[data-size='small'] {
|
|
93
|
+
min-height: 28px;
|
|
94
|
+
}
|
|
95
|
+
div[data-size='small'] > input {
|
|
96
|
+
padding: 4px 8px;
|
|
97
|
+
font-size: 12px;
|
|
282
98
|
}
|
|
283
99
|
|
|
284
|
-
/*
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
100
|
+
/* Medium (default) */
|
|
101
|
+
div[data-size='medium'] {
|
|
102
|
+
min-height: 32px;
|
|
103
|
+
}
|
|
104
|
+
div[data-size='medium'] > input {
|
|
105
|
+
padding: 6px 10px;
|
|
106
|
+
font-size: 13px;
|
|
289
107
|
}
|
|
290
108
|
|
|
291
|
-
/*
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
color: var(--nuraly-color-input-disabled-text, rgba(0, 0, 0, 0.25));
|
|
299
|
-
cursor: not-allowed;
|
|
109
|
+
/* Large */
|
|
110
|
+
div[data-size='large'] {
|
|
111
|
+
min-height: 38px;
|
|
112
|
+
}
|
|
113
|
+
div[data-size='large'] > input {
|
|
114
|
+
padding: 8px 12px;
|
|
115
|
+
font-size: 14px;
|
|
300
116
|
}
|
|
301
117
|
|
|
302
118
|
/* ========================================
|
|
303
|
-
*
|
|
119
|
+
* VARIANT STYLES
|
|
304
120
|
* ======================================== */
|
|
305
121
|
|
|
306
|
-
/*
|
|
307
|
-
* Outlined variant - full border around input
|
|
308
|
-
* Default: light border, focus: blue border
|
|
309
|
-
*/
|
|
122
|
+
/* Outlined (default) */
|
|
310
123
|
:host([variant='outlined']) #input-container {
|
|
311
|
-
border:
|
|
312
|
-
border-radius:
|
|
313
|
-
background-color:
|
|
124
|
+
border: 1px solid var(--nr-border, #d1d5db);
|
|
125
|
+
border-radius: 8px;
|
|
126
|
+
background-color: transparent;
|
|
314
127
|
}
|
|
315
|
-
|
|
316
128
|
:host([variant='outlined']) .input-wrapper {
|
|
317
129
|
background-color: transparent;
|
|
318
130
|
}
|
|
319
|
-
|
|
131
|
+
:host([variant='outlined']:not([state='error']):not([disabled])) #input-container:hover {
|
|
132
|
+
border-color: var(--nr-primary, #7c3aed);
|
|
133
|
+
}
|
|
320
134
|
:host([variant='outlined']:not([state='error'])) #input-container:focus-within {
|
|
321
|
-
border-color: var(--
|
|
322
|
-
box-shadow:
|
|
135
|
+
border-color: var(--nr-primary, #7c3aed);
|
|
136
|
+
box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.15);
|
|
323
137
|
}
|
|
324
138
|
|
|
325
|
-
/*
|
|
326
|
-
* Filled variant - background with bottom border only
|
|
327
|
-
* Subtle background with bottom border indication
|
|
328
|
-
*/
|
|
139
|
+
/* Filled */
|
|
329
140
|
:host([variant='filled']) #input-container {
|
|
330
|
-
background-color: var(--
|
|
331
|
-
border-radius:
|
|
332
|
-
border-bottom: var(--
|
|
141
|
+
background-color: var(--nr-bg-subtle, #f5f5f5);
|
|
142
|
+
border-radius: 8px;
|
|
143
|
+
border-bottom: 1px solid var(--nr-border, #d9d9d9);
|
|
333
144
|
border-top: none;
|
|
334
145
|
border-left: none;
|
|
335
146
|
border-right: none;
|
|
336
147
|
}
|
|
337
|
-
|
|
338
148
|
:host([variant='filled']) .input-wrapper {
|
|
339
149
|
background-color: transparent;
|
|
340
150
|
}
|
|
341
|
-
|
|
342
151
|
:host([variant='filled']:not([state='error'])) #input-container:focus-within {
|
|
343
|
-
border-bottom: var(--
|
|
152
|
+
border-bottom-color: var(--nr-primary, #7c3aed);
|
|
344
153
|
border-top: none;
|
|
345
154
|
border-left: none;
|
|
346
155
|
border-right: none;
|
|
347
156
|
}
|
|
348
157
|
|
|
349
|
-
/*
|
|
350
|
-
* Borderless variant - no borders, focus with outline
|
|
351
|
-
* Clean appearance with focus indication via outline
|
|
352
|
-
*/
|
|
158
|
+
/* Borderless */
|
|
353
159
|
:host([variant='borderless']) #input-container {
|
|
354
|
-
background-color:
|
|
160
|
+
background-color: transparent;
|
|
355
161
|
border: none;
|
|
356
|
-
border-radius:
|
|
162
|
+
border-radius: 8px;
|
|
357
163
|
}
|
|
358
|
-
|
|
359
164
|
:host([variant='borderless']) .input-wrapper {
|
|
360
165
|
background-color: transparent;
|
|
361
166
|
}
|
|
362
|
-
|
|
363
167
|
:host([variant='borderless']:not([state='error'])) #input-container:focus-within {
|
|
364
|
-
outline: var(--
|
|
168
|
+
outline: 1px solid var(--nr-primary, #7c3aed);
|
|
365
169
|
border: none;
|
|
366
170
|
}
|
|
367
171
|
|
|
368
|
-
/*
|
|
369
|
-
* Underlined variant - bottom border only (default/current behavior)
|
|
370
|
-
* Maintains existing behavior as default
|
|
371
|
-
*/
|
|
172
|
+
/* Underlined */
|
|
372
173
|
:host([variant='underlined']) #input-container {
|
|
373
|
-
border-bottom: var(--
|
|
174
|
+
border-bottom: 1px solid var(--nr-border, #d9d9d9);
|
|
374
175
|
border-top: none;
|
|
375
176
|
border-left: none;
|
|
376
177
|
border-right: none;
|
|
377
|
-
border-radius:
|
|
178
|
+
border-radius: 0;
|
|
378
179
|
}
|
|
379
|
-
|
|
380
180
|
:host([variant='underlined']:not([state='error'])) #input-container:focus-within {
|
|
381
|
-
border-bottom: var(--
|
|
181
|
+
border-bottom-color: var(--nr-primary, #7c3aed);
|
|
382
182
|
border-top: none;
|
|
383
183
|
border-left: none;
|
|
384
184
|
border-right: none;
|
|
385
185
|
}
|
|
386
186
|
|
|
387
|
-
/* ========================================
|
|
388
|
-
* INPUT ELEMENT STYLES
|
|
389
|
-
* ======================================== */
|
|
390
|
-
|
|
391
|
-
/*
|
|
392
|
-
* Base input element styling
|
|
393
|
-
* Full width with no default borders, using container for styling
|
|
394
|
-
*/
|
|
395
|
-
input {
|
|
396
|
-
width: 100%;
|
|
397
|
-
border: none;
|
|
398
|
-
outline: none;
|
|
399
|
-
color: var(--nuraly-input-text-color, var(--nuraly-text-color));
|
|
400
|
-
font-family: var(--nuraly-input-font-family, var(--nuraly-font-family));
|
|
401
|
-
font-size: var(--nuraly-input-font-size, var(--nuraly-font-size));
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
/* Remove default number input spinners */
|
|
405
|
-
/* Chrome, Safari, Edge, Opera */
|
|
406
|
-
input::-webkit-outer-spin-button,
|
|
407
|
-
input::-webkit-inner-spin-button {
|
|
408
|
-
-webkit-appearance: none;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/* Firefox */
|
|
412
|
-
input[type='number'] {
|
|
413
|
-
-moz-appearance: textfield;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
187
|
/* ========================================
|
|
417
188
|
* STATE STYLES
|
|
418
189
|
* ======================================== */
|
|
419
190
|
|
|
420
|
-
/*
|
|
421
|
-
* Error state styling - works with all variants
|
|
422
|
-
* Applied when state='error' and not disabled
|
|
423
|
-
*/
|
|
191
|
+
/* Error */
|
|
424
192
|
:host(:not([disabled])[state='error']) #input-container {
|
|
425
|
-
border: var(--
|
|
426
|
-
outline: none !important;
|
|
193
|
+
border-color: var(--nr-danger, #dc2626) !important;
|
|
427
194
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
border: var(--nuraly-input-error-border, var(--nuraly-error-border)) !important;
|
|
432
|
-
outline: none !important;
|
|
195
|
+
:host(:not([disabled])[state='error']) #input-container:focus-within {
|
|
196
|
+
border-color: var(--nr-danger, #dc2626) !important;
|
|
197
|
+
box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15) !important;
|
|
433
198
|
}
|
|
434
|
-
|
|
435
199
|
:host([variant='underlined'][state='error']) #input-container,
|
|
436
200
|
:host([variant='filled'][state='error']) #input-container {
|
|
437
201
|
border-top: none !important;
|
|
438
202
|
border-left: none !important;
|
|
439
203
|
border-right: none !important;
|
|
440
|
-
border-bottom: var(--
|
|
204
|
+
border-bottom-color: var(--nr-danger, #dc2626) !important;
|
|
205
|
+
}
|
|
206
|
+
:host([variant='borderless'][state='error']) #input-container {
|
|
207
|
+
border: 1px solid var(--nr-danger, #dc2626) !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Warning */
|
|
211
|
+
:host(:not([disabled])[state='warning']) #input-container {
|
|
212
|
+
border-color: var(--nr-warning, #d97706) !important;
|
|
213
|
+
}
|
|
214
|
+
:host(:not([disabled])[state='warning']) #input-container:focus-within {
|
|
215
|
+
border-color: var(--nr-warning, #d97706) !important;
|
|
216
|
+
box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.15) !important;
|
|
441
217
|
}
|
|
442
218
|
|
|
443
|
-
/*
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
219
|
+
/* Success */
|
|
220
|
+
:host(:not([disabled])[state='success']) #input-container {
|
|
221
|
+
border-color: var(--nr-success, #16a34a) !important;
|
|
222
|
+
}
|
|
223
|
+
:host(:not([disabled])[state='success']) #input-container:focus-within {
|
|
224
|
+
border-color: var(--nr-success, #16a34a) !important;
|
|
225
|
+
box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15) !important;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Warning/error — number icon position */
|
|
447
229
|
:host([state='error']) input[type='number'] ~ #number-icons,
|
|
448
230
|
:host([state='warning']) input[type='number'] ~ #number-icons {
|
|
449
231
|
position: static;
|
|
450
|
-
padding-left:
|
|
232
|
+
padding-left: 4px;
|
|
451
233
|
}
|
|
452
234
|
|
|
453
235
|
/* ========================================
|
|
454
|
-
*
|
|
236
|
+
* DISABLED
|
|
455
237
|
* ======================================== */
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
* Applied to slotted label elements
|
|
460
|
-
*/
|
|
461
|
-
::slotted([slot='label']) {
|
|
462
|
-
color: var(--nuraly-input-label-color, var(--nuraly-label-color));
|
|
463
|
-
font-size: var(--nuraly-input-label-font-size, var(--nuraly-label-font-size));
|
|
464
|
-
padding-bottom: var(--nuraly-input-label-padding-bottom, var(--nuraly-label-padding-bottom));
|
|
238
|
+
:host([disabled]) {
|
|
239
|
+
opacity: 0.5;
|
|
240
|
+
pointer-events: none;
|
|
465
241
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
242
|
+
:host([disabled]) .input-wrapper {
|
|
243
|
+
background-color: #f4f4f4;
|
|
244
|
+
}
|
|
245
|
+
:host([disabled]) #input-container {
|
|
246
|
+
background-color: #f5f5f5;
|
|
247
|
+
border-color: var(--nr-border, #d9d9d9);
|
|
248
|
+
cursor: not-allowed;
|
|
249
|
+
}
|
|
250
|
+
:host([disabled]) #input-container > input {
|
|
251
|
+
background-color: transparent;
|
|
252
|
+
cursor: not-allowed;
|
|
253
|
+
color: var(--nr-disabled, rgba(0, 0, 0, 0.25));
|
|
254
|
+
}
|
|
255
|
+
:host([disabled]) ::placeholder {
|
|
256
|
+
color: var(--nr-disabled, #c6c6c6);
|
|
257
|
+
}
|
|
258
|
+
:host([disabled]) #password-icon,
|
|
259
|
+
:host([disabled]) #error-icon,
|
|
260
|
+
:host([disabled]) #warning-icon,
|
|
261
|
+
:host([disabled]) #number-icons,
|
|
262
|
+
:host([disabled]) #calendar-icon,
|
|
263
|
+
:host([disabled]) #copy-icon,
|
|
264
|
+
:host([disabled]) #clear-icon {
|
|
265
|
+
opacity: 0.5;
|
|
266
|
+
}
|
|
267
|
+
:host([disabled]) #password-icon,
|
|
268
|
+
:host([disabled]) #number-icons,
|
|
269
|
+
:host([disabled]) #copy-icon,
|
|
270
|
+
:host([disabled]) #clear-icon {
|
|
271
|
+
cursor: not-allowed;
|
|
487
272
|
}
|
|
488
273
|
|
|
489
|
-
/*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
274
|
+
/* ========================================
|
|
275
|
+
* ICON STYLES
|
|
276
|
+
* ======================================== */
|
|
277
|
+
#input-container nr-icon {
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
flex-shrink: 0;
|
|
281
|
+
height: 100%;
|
|
282
|
+
max-height: 100%;
|
|
495
283
|
}
|
|
496
284
|
|
|
497
|
-
|
|
498
|
-
color: var(--
|
|
285
|
+
#warning-icon {
|
|
286
|
+
--nuraly-color-icon: var(--nr-warning, #f1c21b);
|
|
499
287
|
}
|
|
288
|
+
#error-icon {
|
|
289
|
+
--nuraly-color-icon: var(--nr-danger, #da1e28);
|
|
290
|
+
}
|
|
291
|
+
#calendar-icon {
|
|
292
|
+
--nuraly-color-icon: var(--nr-text, #161616);
|
|
293
|
+
}
|
|
294
|
+
#password-icon {
|
|
295
|
+
padding-left: 8px;
|
|
296
|
+
padding-right: 8px;
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
color: var(--nr-text-secondary, #6b7280);
|
|
299
|
+
transition: color 0.15s;
|
|
300
|
+
}
|
|
301
|
+
#password-icon:hover { color: var(--nr-primary, #7c3aed); }
|
|
500
302
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
color: var(--nuraly-input-disabled-helper-text-color, var(--nuraly-disabled-helper-text-color));
|
|
303
|
+
#copy-icon {
|
|
304
|
+
padding-right: 8px;
|
|
305
|
+
cursor: pointer;
|
|
306
|
+
color: var(--nr-text-secondary, #6b7280);
|
|
307
|
+
transition: color 0.15s;
|
|
507
308
|
}
|
|
309
|
+
#copy-icon:hover { color: var(--nr-primary, #7c3aed); }
|
|
508
310
|
|
|
509
|
-
|
|
510
|
-
|
|
311
|
+
#clear-icon {
|
|
312
|
+
padding-right: 8px;
|
|
313
|
+
cursor: pointer;
|
|
314
|
+
color: var(--nr-text-secondary, #6b7280);
|
|
315
|
+
transition: color 0.15s;
|
|
511
316
|
}
|
|
317
|
+
#clear-icon:hover { color: var(--nr-danger, #dc2626); }
|
|
512
318
|
|
|
513
|
-
/*
|
|
514
|
-
|
|
515
|
-
* Centers the prefix content vertically and horizontally
|
|
516
|
-
*/
|
|
517
|
-
.input-prefix {
|
|
319
|
+
/* Number icons */
|
|
320
|
+
#number-icons {
|
|
518
321
|
display: flex;
|
|
322
|
+
justify-content: space-between;
|
|
519
323
|
align-items: center;
|
|
520
|
-
|
|
324
|
+
cursor: pointer;
|
|
325
|
+
position: absolute;
|
|
326
|
+
right: 0;
|
|
327
|
+
top: 0;
|
|
328
|
+
height: 100%;
|
|
329
|
+
width: 50px;
|
|
330
|
+
padding-right: 8px;
|
|
331
|
+
}
|
|
332
|
+
#number-icons nr-icon {
|
|
333
|
+
color: var(--nr-text-secondary, #6b7280);
|
|
334
|
+
padding-left: 4px;
|
|
335
|
+
padding-right: 4px;
|
|
336
|
+
width: 24px;
|
|
337
|
+
height: 24px;
|
|
338
|
+
transition: color 0.15s;
|
|
339
|
+
}
|
|
340
|
+
#number-icons nr-icon:hover {
|
|
341
|
+
color: var(--nr-primary, #7c3aed);
|
|
342
|
+
}
|
|
343
|
+
#icons-separator {
|
|
344
|
+
color: var(--nr-border, #d9d9d9);
|
|
521
345
|
}
|
|
522
346
|
|
|
523
|
-
/*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
|
|
527
|
-
|
|
347
|
+
/* ========================================
|
|
348
|
+
* ADDON STYLES
|
|
349
|
+
* ======================================== */
|
|
350
|
+
.input-addon-before {
|
|
351
|
+
background-color: var(--nr-bg-subtle, #fafafa);
|
|
352
|
+
border: 1px solid var(--nr-border, #d9d9d9);
|
|
353
|
+
border-right: none;
|
|
354
|
+
border-top-left-radius: 8px;
|
|
355
|
+
border-bottom-left-radius: 8px;
|
|
356
|
+
padding: 0 10px;
|
|
357
|
+
display: flex;
|
|
358
|
+
align-items: center;
|
|
359
|
+
color: var(--nr-text-secondary, #666);
|
|
360
|
+
font-size: 13px;
|
|
361
|
+
white-space: nowrap;
|
|
362
|
+
flex-shrink: 0;
|
|
363
|
+
}
|
|
364
|
+
.input-addon-after {
|
|
365
|
+
background-color: var(--nr-bg-subtle, #fafafa);
|
|
366
|
+
border: 1px solid var(--nr-border, #d9d9d9);
|
|
367
|
+
border-left: none;
|
|
368
|
+
border-top-right-radius: 8px;
|
|
369
|
+
border-bottom-right-radius: 8px;
|
|
370
|
+
padding: 0 10px;
|
|
528
371
|
display: flex;
|
|
529
372
|
align-items: center;
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
373
|
+
color: var(--nr-text-secondary, #666);
|
|
374
|
+
font-size: 13px;
|
|
375
|
+
white-space: nowrap;
|
|
533
376
|
flex-shrink: 0;
|
|
534
377
|
}
|
|
535
378
|
|
|
536
|
-
/*
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
379
|
+
/* Border radius adjustments when addons are present */
|
|
380
|
+
.input-wrapper:has(.input-addon-before) #input-container {
|
|
381
|
+
border-top-left-radius: 0;
|
|
382
|
+
border-bottom-left-radius: 0;
|
|
383
|
+
border-left: none;
|
|
384
|
+
}
|
|
385
|
+
.input-wrapper:has(.input-addon-after) #input-container {
|
|
386
|
+
border-top-right-radius: 0;
|
|
387
|
+
border-bottom-right-radius: 0;
|
|
388
|
+
border-right: none;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* ========================================
|
|
392
|
+
* PREFIX / SUFFIX
|
|
393
|
+
* ======================================== */
|
|
394
|
+
.input-prefix {
|
|
541
395
|
display: flex;
|
|
542
396
|
align-items: center;
|
|
543
397
|
justify-content: center;
|
|
544
398
|
}
|
|
545
|
-
|
|
546
|
-
/*
|
|
547
|
-
* Suffix slot styling
|
|
548
|
-
* Applied to slotted suffix content (icons, text, etc.)
|
|
549
|
-
*/
|
|
550
|
-
::slotted([slot='suffix']) {
|
|
399
|
+
.input-suffix {
|
|
551
400
|
display: flex;
|
|
552
401
|
align-items: center;
|
|
553
|
-
|
|
554
|
-
color: var(--nuraly-input-suffix-color, var(--nuraly-suffix-color));
|
|
555
|
-
font-size: var(--nuraly-input-suffix-font-size, var(--nuraly-suffix-font-size));
|
|
556
|
-
flex-shrink: 0;
|
|
402
|
+
justify-content: center;
|
|
557
403
|
}
|
|
558
404
|
|
|
559
|
-
/*
|
|
560
|
-
* Disabled state for prefix and suffix slots
|
|
561
|
-
* Applied when input is disabled
|
|
562
|
-
*/
|
|
563
|
-
:host([disabled]) ::slotted([slot='prefix']),
|
|
564
|
-
:host([disabled]) ::slotted([slot='suffix']) {
|
|
565
|
-
opacity: var(--nuraly-input-disabled-icon-opacity, var(--nuraly-disabled-icon-opacity));
|
|
566
|
-
color: var(--nuraly-input-disabled-prefix-suffix-color, var(--nuraly-disabled-prefix-suffix-color));
|
|
567
|
-
}
|
|
568
|
-
`,t`
|
|
569
405
|
/* ========================================
|
|
570
|
-
*
|
|
406
|
+
* LABEL STYLES
|
|
571
407
|
* ======================================== */
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
padding-
|
|
576
|
-
|
|
577
|
-
padding-left: var(--nuraly-input-large-padding-left, var(--nuraly-large-padding-left));
|
|
578
|
-
padding-right: var(--nuraly-input-large-padding-right, var(--nuraly-large-padding-right));
|
|
408
|
+
::slotted([slot='label']) {
|
|
409
|
+
color: var(--nr-text-secondary, #374151);
|
|
410
|
+
font-size: 13px;
|
|
411
|
+
padding-bottom: 4px;
|
|
412
|
+
font-weight: 500;
|
|
579
413
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
div[data-size='medium'] {
|
|
583
|
-
padding-top: var(--nuraly-input-medium-padding-top, var(--nuraly-medium-padding-top));
|
|
584
|
-
padding-bottom: var(--nuraly-input-medium-padding-bottom, var(--nuraly-medium-padding-bottom));
|
|
585
|
-
padding-left: var(--nuraly-input-medium-padding-left, var(--nuraly-medium-padding-left));
|
|
586
|
-
padding-right: var(--nuraly-input-medium-padding-right, var(--nuraly-medium-padding-right));
|
|
414
|
+
:host([disabled]) ::slotted([slot='label']) {
|
|
415
|
+
color: var(--nr-disabled, #9ca3af);
|
|
587
416
|
}
|
|
588
417
|
|
|
589
|
-
/*
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
418
|
+
/* ========================================
|
|
419
|
+
* HELPER TEXT STYLES
|
|
420
|
+
* ======================================== */
|
|
421
|
+
::slotted([slot='helper-text']) {
|
|
422
|
+
color: var(--nr-text-secondary, #6b7280);
|
|
423
|
+
font-size: 12px;
|
|
424
|
+
padding-top: 4px;
|
|
425
|
+
word-wrap: break-word;
|
|
426
|
+
overflow-wrap: break-word;
|
|
427
|
+
line-height: 1.4;
|
|
428
|
+
}
|
|
429
|
+
:host([state='error']) ::slotted([slot='helper-text']) {
|
|
430
|
+
color: var(--nr-danger, #dc2626);
|
|
431
|
+
}
|
|
432
|
+
:host([state='warning']) ::slotted([slot='helper-text']) {
|
|
433
|
+
color: var(--nr-warning, #d97706);
|
|
434
|
+
}
|
|
435
|
+
:host([disabled]) ::slotted([slot='helper-text']) {
|
|
436
|
+
color: var(--nr-disabled, #9ca3af);
|
|
595
437
|
}
|
|
596
438
|
|
|
597
|
-
/*
|
|
598
|
-
*
|
|
599
|
-
*
|
|
600
|
-
*/
|
|
439
|
+
/* ========================================
|
|
440
|
+
* CHARACTER COUNT
|
|
441
|
+
* ======================================== */
|
|
601
442
|
.character-count {
|
|
602
|
-
font-size:
|
|
603
|
-
color: var(--
|
|
443
|
+
font-size: 12px;
|
|
444
|
+
color: var(--nr-text-secondary, #6b7280);
|
|
604
445
|
text-align: right;
|
|
605
|
-
margin-top:
|
|
606
|
-
font-family:
|
|
446
|
+
margin-top: 4px;
|
|
447
|
+
font-family: inherit;
|
|
607
448
|
}
|
|
608
|
-
|
|
609
|
-
/* Character count over limit styling */
|
|
610
449
|
.character-count[data-over-limit] {
|
|
611
|
-
color: var(--
|
|
450
|
+
color: var(--nr-danger, #dc2626);
|
|
612
451
|
}
|
|
613
452
|
|
|
614
453
|
/* ========================================
|
|
615
454
|
* VALIDATION MESSAGE STYLES
|
|
616
455
|
* ======================================== */
|
|
617
|
-
|
|
618
|
-
/*
|
|
619
|
-
* Base validation message styling
|
|
620
|
-
* Common styles for error and warning messages
|
|
621
|
-
*/
|
|
622
456
|
.validation-message {
|
|
623
|
-
font-size:
|
|
624
|
-
font-family:
|
|
625
|
-
margin-top:
|
|
626
|
-
padding:
|
|
627
|
-
|
|
628
|
-
/* Prevent text overflow and ensure proper wrapping without affecting parent width */
|
|
457
|
+
font-size: 12px;
|
|
458
|
+
font-family: inherit;
|
|
459
|
+
margin-top: 4px;
|
|
460
|
+
padding: 0;
|
|
629
461
|
word-wrap: break-word;
|
|
630
|
-
word-break: break-word;
|
|
631
462
|
overflow-wrap: break-word;
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
max-width: 100%;
|
|
635
|
-
width: 0;
|
|
636
|
-
min-width: 100%;
|
|
637
|
-
box-sizing: border-box;
|
|
638
|
-
line-height: var(--nuraly-input-validation-message-line-height, var(--nuraly-validation-message-line-height, 1.4));
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
/*
|
|
642
|
-
* Error validation message styling
|
|
643
|
-
* Applied when validation message has error class
|
|
644
|
-
*/
|
|
463
|
+
line-height: 1.4;
|
|
464
|
+
}
|
|
645
465
|
.validation-message.error {
|
|
646
|
-
color: var(--
|
|
466
|
+
color: var(--nr-danger, #dc2626);
|
|
647
467
|
}
|
|
648
|
-
|
|
649
|
-
/*
|
|
650
|
-
* Warning validation message styling
|
|
651
|
-
* Applied when validation message has warning class
|
|
652
|
-
*/
|
|
653
468
|
.validation-message.warning {
|
|
654
|
-
color: var(--
|
|
469
|
+
color: var(--nr-warning, #d97706);
|
|
655
470
|
}
|
|
656
|
-
|
|
657
|
-
/*
|
|
658
|
-
* Disabled state for validation messages
|
|
659
|
-
* Applied when input is disabled
|
|
660
|
-
*/
|
|
661
471
|
:host([disabled]) .validation-message {
|
|
662
|
-
opacity:
|
|
663
|
-
color: var(--nuraly-input-disabled-validation-message-color, var(--nuraly-disabled-validation-message-color));
|
|
472
|
+
opacity: 0.6;
|
|
664
473
|
}
|
|
665
474
|
|
|
666
|
-
/*
|
|
667
|
-
* Validation icon styles
|
|
668
|
-
* Base styles for validation feedback icons
|
|
669
|
-
*/
|
|
475
|
+
/* Validation icon */
|
|
670
476
|
.validation-icon {
|
|
671
477
|
width: 16px;
|
|
672
478
|
height: 16px;
|
|
@@ -674,166 +480,115 @@ import{css as t,html as i,nothing as r,LitElement as n}from"lit";import{property
|
|
|
674
480
|
align-items: center;
|
|
675
481
|
justify-content: center;
|
|
676
482
|
}
|
|
677
|
-
|
|
678
|
-
/*
|
|
679
|
-
* Loading validation icon with hourglass animation
|
|
680
|
-
* Applied when async validation is in progress
|
|
681
|
-
*/
|
|
682
483
|
.validation-icon.validation-loading {
|
|
683
|
-
color: var(--
|
|
684
|
-
animation:
|
|
484
|
+
color: var(--nr-primary, #7c3aed);
|
|
485
|
+
animation: nr-input-hourglass 2s ease-in-out infinite;
|
|
685
486
|
transform-origin: center;
|
|
686
487
|
}
|
|
687
|
-
|
|
688
|
-
/*
|
|
689
|
-
* Error validation icon styling
|
|
690
|
-
* Applied when validation fails
|
|
691
|
-
*/
|
|
692
488
|
.validation-icon.validation-error {
|
|
693
|
-
color: var(--
|
|
489
|
+
color: var(--nr-danger, #dc2626);
|
|
694
490
|
}
|
|
695
|
-
|
|
696
|
-
/*
|
|
697
|
-
* Warning validation icon styling
|
|
698
|
-
* Applied when validation has warnings
|
|
699
|
-
*/
|
|
700
491
|
.validation-icon.validation-warning {
|
|
701
|
-
color: var(--
|
|
492
|
+
color: var(--nr-warning, #d97706);
|
|
702
493
|
}
|
|
703
|
-
|
|
704
|
-
/*
|
|
705
|
-
* Success validation icon styling
|
|
706
|
-
* Applied when validation passes
|
|
707
|
-
*/
|
|
708
494
|
.validation-icon.validation-success {
|
|
709
|
-
color: var(--
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
25% {
|
|
722
|
-
opacity: 1;
|
|
723
|
-
transform: scale(1.03);
|
|
724
|
-
}
|
|
725
|
-
50% {
|
|
726
|
-
opacity: 0.8;
|
|
727
|
-
transform: scale(1);
|
|
728
|
-
}
|
|
729
|
-
75% {
|
|
730
|
-
opacity: 1;
|
|
731
|
-
transform: scale(1.03);
|
|
732
|
-
}
|
|
733
|
-
100% {
|
|
734
|
-
opacity: 0.7;
|
|
735
|
-
transform: scale(1);
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
/*
|
|
740
|
-
* Alternative pulse animation option
|
|
741
|
-
* Uncomment this and change animation above to use pulse instead of hourglass
|
|
742
|
-
*/
|
|
743
|
-
/*
|
|
744
|
-
@keyframes validation-pulse {
|
|
745
|
-
0%, 100% {
|
|
746
|
-
opacity: 1;
|
|
747
|
-
transform: scale(1);
|
|
748
|
-
}
|
|
749
|
-
50% {
|
|
750
|
-
opacity: 0.7;
|
|
751
|
-
transform: scale(1.1);
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
*/
|
|
755
|
-
`],c={EMAIL:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,URL:/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/,PHONE:/^[\+]?[1-9][\d]{0,15}$/,PASSWORD_STRONG:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,ALPHANUMERIC:/^[a-zA-Z0-9]+$/,NUMERIC:/^\d+$/,ALPHA:/^[a-zA-Z]+$/,USERNAME:/^[a-zA-Z0-9_-]{3,16}$/,HEX_COLOR:/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,IPV4:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,CREDIT_CARD:/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3[0-9]{13}|6(?:011|5[0-9]{2})[0-9]{12})$/},h=t=>({required:!0,message:t||"This field is required"}),p=t=>({type:"email",pattern:c.EMAIL,message:t||"Please enter a valid email address"}),v=t=>({type:"url",pattern:c.URL,message:t||"Please enter a valid URL"}),g=(t,i)=>({maxLength:t,message:i||`Maximum length is ${t} characters`}),y=(t,i)=>({type:"number",min:t,message:i||`Minimum value is ${t}`}),b=(t,i)=>({type:"number",max:t,message:i||`Maximum value is ${t}`});
|
|
495
|
+
color: var(--nr-success, #16a34a);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
@keyframes nr-input-hourglass {
|
|
499
|
+
0% { opacity: 0.7; transform: scale(1); }
|
|
500
|
+
25% { opacity: 1; transform: scale(1.03); }
|
|
501
|
+
50% { opacity: 0.8; transform: scale(1); }
|
|
502
|
+
75% { opacity: 1; transform: scale(1.03); }
|
|
503
|
+
100% { opacity: 0.7; transform: scale(1); }
|
|
504
|
+
}
|
|
505
|
+
`,d={EMAIL:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,URL:/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/,PHONE:/^[\+]?[1-9][\d]{0,15}$/,PASSWORD_STRONG:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,ALPHANUMERIC:/^[a-zA-Z0-9]+$/,NUMERIC:/^\d+$/,ALPHA:/^[a-zA-Z]+$/,USERNAME:/^[a-zA-Z0-9_-]{3,16}$/,HEX_COLOR:/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,IPV4:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,CREDIT_CARD:/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3[0-9]{13}|6(?:011|5[0-9]{2})[0-9]{12})$/},l=t=>({required:!0,message:t||"This field is required"}),h=t=>({type:"email",pattern:d.EMAIL,message:t||"Please enter a valid email address"}),c=t=>({type:"url",pattern:d.URL,message:t||"Please enter a valid URL"}),u=(t,i)=>({maxLength:t,message:i||`Maximum length is ${t} characters`}),p=(t,i)=>({type:"number",min:t,message:i||`Minimum value is ${t}`}),v=(t,i)=>({type:"number",max:t,message:i||`Maximum value is ${t}`}),m=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,i,e;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.designSystemObserver)||void 0===i||i.disconnect(),null===(e=this.mediaQuery)||void 0===e||e.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const e=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return e||((null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const i=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===i?i:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver(()=>{this.requestUpdate()}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver(()=>{this.requestUpdate()}),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},b=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},g=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(b())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!b())return!0;let i=!0;for(const e of this.requiredComponents)if(!this.isComponentAvailable(e)){i=!1;const r=new Error(`Required component "${e}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(e,r):console.error(r.message)}return i}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter(t=>!this.isComponentAvailable(t))}areDependenciesAvailable(){return this.requiredComponents.every(t=>this.isComponentAvailable(t))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const i=this.requiredComponents.indexOf(t);i>-1&&this.requiredComponents.splice(i,1)}},f=t=>class extends t{dispatchCustomEvent(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,i){var e;const r=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(e=this.tagName)||void 0===e?void 0:e.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,r)}dispatchInputEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,e)}dispatchFocusEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,e)}dispatchValidationEvent(t,i){var e;const r=Object.assign({target:i.target||this,value:i.value,isValid:null!==(e=i.isValid)&&void 0!==e&&e,error:i.error},i);this.dispatchCustomEvent(t,r)}dispatchActionEvent(t,i){const e=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,e)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}},w=new Set,y=new Map;
|
|
756
506
|
/**
|
|
757
507
|
* @license
|
|
758
|
-
* Copyright 2023
|
|
508
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
759
509
|
* SPDX-License-Identifier: MIT
|
|
760
510
|
*/
|
|
761
|
-
class
|
|
511
|
+
const x=t=>{class i extends t{constructor(){super(...arguments),this.t=null}createRenderRoot(){return this.constructor.useShadowDom?super.createRenderRoot():this}connectedCallback(){const t=this.constructor.useShadowDom;if(!t&&null===this.t)for(this.t=[];this.firstChild;)this.t.push(this.removeChild(this.firstChild));if(super.connectedCallback(),!t){const t=this.constructor,i=this.tagName.toLowerCase(),e=t.styles;if(e){const t=V(e);t&&function(t,i,e){var r;if(!y.has(t)){const e=new CSSStyleSheet;e.replaceSync(i),y.set(t,e)}const n=y.get(t),s=`doc:${t}`;if(w.has(s)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],w.add(s)),e){let i=e;for(;i;){const e=i.getRootNode();if(!(e instanceof ShadowRoot))break;{const s=`shadow:${((null===(r=e.host)||void 0===r?void 0:r.tagName)||"").toLowerCase()}:${t}`;w.has(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],w.add(s)),i=e.host}}}}(i,t,this)}}}get lightChildren(){return this.t?this.t.filter(t=>!(t instanceof Element&&t.hasAttribute("slot"))):[]}lightChildrenNamed(t){return this.t?this.t.filter(i=>i instanceof Element&&i.getAttribute("slot")===t):[]}}return i.useShadowDom=!1,i};function V(t){return Array.isArray(t)?t.map(t=>V(t)).filter(Boolean).join("\n"):t&&"string"==typeof t.cssText?t.cssText:"string"==typeof t?t:""}
|
|
762
512
|
/**
|
|
763
513
|
* @license
|
|
764
514
|
* Copyright 2023 Google Laabidi Aymen
|
|
765
515
|
* SPDX-License-Identifier: MIT
|
|
766
|
-
*/class
|
|
516
|
+
*/class E{static validateNumericProperties(t,i,e,r){"number"===t&&(i&&Number.isNaN(Number(i))&&console.warn(`Invalid min value: "${i}" is not a valid number`),e&&Number.isNaN(Number(e))&&console.warn(`Invalid max value: "${e}" is not a valid number`),r&&Number.isNaN(Number(r))&&console.warn(`Invalid step value: "${r}" is not a valid number`),i&&e&&Number(i)>=Number(e)&&console.warn(`Invalid range: min value (${i}) should be less than max value (${e})`))}static preventNonNumericInput(t,i){const e=t.key,r=t.target,n=r.value,s=r.selectionStart||0;if(!(t.ctrlKey||t.metaKey||["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e)||/^\d$/.test(e))){if("."===e||","===e){if(!(n.includes(".")||n.includes(",")))return}if("-"===e){const t=n.includes("-"),e=!i||Number(i)<0;if(!t&&0===s&&e)return}if("+"===e){if(!n.includes("+")&&0===s)return}t.preventDefault()}}static validateNumericValue(t,i,e){const r=[];if(!t)return{isValid:!0,warnings:r};const n=Number(t);return Number.isNaN(n)?{isValid:!1,warnings:[`Invalid numeric value: "${t}"`]}:(i&&n<Number(i)&&r.push(`Value ${n} is below minimum ${i}`),e&&n>Number(e)&&r.push(`Value ${n} is above maximum ${e}`),{isValid:!0,warnings:r})}}
|
|
517
|
+
/**
|
|
518
|
+
* @license
|
|
519
|
+
* Copyright 2023 Google Laabidi Aymen
|
|
520
|
+
* SPDX-License-Identifier: MIT
|
|
521
|
+
*/class ${static renderPrefix(t=[]){return 0===t.length?i:e`
|
|
767
522
|
<div class="input-prefix">
|
|
768
|
-
|
|
523
|
+
${t}
|
|
769
524
|
</div>
|
|
770
|
-
`}static renderSuffix(){return i`
|
|
525
|
+
`}static renderSuffix(t=[]){return 0===t.length?i:e`
|
|
771
526
|
<div class="input-suffix">
|
|
772
|
-
|
|
527
|
+
${t}
|
|
773
528
|
</div>
|
|
774
|
-
`}static renderAddonBefore(t,
|
|
529
|
+
`}static renderAddonBefore(t,r=[]){return t?e`
|
|
775
530
|
<div class="input-addon-before">
|
|
776
|
-
|
|
531
|
+
${r}
|
|
777
532
|
</div>
|
|
778
|
-
`:
|
|
533
|
+
`:i}static renderAddonAfter(t,r=[]){return t?e`
|
|
779
534
|
<div class="input-addon-after">
|
|
780
|
-
|
|
535
|
+
${r}
|
|
781
536
|
</div>
|
|
782
|
-
`:
|
|
537
|
+
`:i}static renderCopyIcon(t,r,n,s,a){return t?e`<nr-icon
|
|
783
538
|
name="copy"
|
|
784
539
|
type="regular"
|
|
785
540
|
id="copy-icon"
|
|
786
541
|
role="button"
|
|
787
542
|
aria-label="Copy input value"
|
|
788
543
|
tabindex="0"
|
|
789
|
-
@click=${n
|
|
790
|
-
@keydown=${
|
|
791
|
-
></nr-icon>`:
|
|
544
|
+
@click=${r||n?i:s}
|
|
545
|
+
@keydown=${a}
|
|
546
|
+
></nr-icon>`:i}static renderClearIcon(t,r,n,s,a,o){return!t||!r||n||s?i:e`<nr-icon
|
|
792
547
|
name="times-circle"
|
|
793
548
|
type="regular"
|
|
794
549
|
id="clear-icon"
|
|
795
550
|
role="button"
|
|
796
551
|
aria-label="Clear input value"
|
|
797
552
|
tabindex="0"
|
|
798
|
-
@click=${
|
|
799
|
-
@keydown=${
|
|
800
|
-
></nr-icon>`}static renderStateIcon(t){switch(t){case"warning":return
|
|
553
|
+
@click=${a}
|
|
554
|
+
@keydown=${o}
|
|
555
|
+
></nr-icon>`}static renderStateIcon(t){switch(t){case"warning":return e`<nr-icon name="warning" id="warning-icon"></nr-icon>`;case"error":return e`<nr-icon name="exclamation-circle" id="error-icon"></nr-icon>`;default:return i}}static renderCalendarIcon(t,r){return"default"!==t||"calendar"!==r?i:e`<nr-icon name="calendar" type="regular" id="calendar-icon"></nr-icon>`}static renderPasswordIcon(t,r,n,s,a,o){return"password"!==t?i:"text"===r?e`<nr-icon
|
|
801
556
|
name="eye-slash"
|
|
802
557
|
type="regular"
|
|
803
558
|
id="password-icon"
|
|
804
559
|
role="button"
|
|
805
560
|
aria-label="Hide password"
|
|
806
561
|
tabindex="0"
|
|
807
|
-
@click=${
|
|
808
|
-
@keydown=${
|
|
809
|
-
></nr-icon>`:
|
|
562
|
+
@click=${n||s?i:a}
|
|
563
|
+
@keydown=${o}
|
|
564
|
+
></nr-icon>`:e`<nr-icon
|
|
810
565
|
name="eye"
|
|
811
566
|
type="regular"
|
|
812
567
|
id="password-icon"
|
|
813
568
|
role="button"
|
|
814
569
|
aria-label="Show password"
|
|
815
570
|
tabindex="0"
|
|
816
|
-
@click=${
|
|
817
|
-
@keydown=${
|
|
818
|
-
></nr-icon>`}static renderNumberIcons(t,n,
|
|
571
|
+
@click=${n||s?i:a}
|
|
572
|
+
@keydown=${o}
|
|
573
|
+
></nr-icon>`}static renderNumberIcons(t,r,n,s,a,o,d){return"number"!==t?i:e`
|
|
819
574
|
<div id="number-icons">
|
|
820
|
-
${"default"!==
|
|
821
|
-
<nr-icon
|
|
822
|
-
name="minus"
|
|
575
|
+
${"default"!==r?e`<span id="icons-separator">|</span>`:i}
|
|
576
|
+
<nr-icon
|
|
577
|
+
name="minus"
|
|
823
578
|
aria-label="Decrease value"
|
|
824
579
|
role="button"
|
|
825
580
|
tabindex="0"
|
|
826
|
-
@click=${
|
|
827
|
-
@keydown=${
|
|
581
|
+
@click=${n||s?i:o}
|
|
582
|
+
@keydown=${d}
|
|
828
583
|
></nr-icon>
|
|
829
584
|
<span id="icons-separator">|</span>
|
|
830
|
-
<nr-icon
|
|
831
|
-
name="plus"
|
|
585
|
+
<nr-icon
|
|
586
|
+
name="plus"
|
|
832
587
|
aria-label="Increase value"
|
|
833
588
|
role="button"
|
|
834
589
|
tabindex="0"
|
|
835
|
-
@click=${
|
|
836
|
-
@keydown=${
|
|
590
|
+
@click=${n||s?i:a}
|
|
591
|
+
@keydown=${d}
|
|
837
592
|
></nr-icon>
|
|
838
593
|
</div>
|
|
839
594
|
`}}
|
|
@@ -841,7 +596,7 @@ class m{static validateNumericProperties(t,i,r,n){"number"===t&&(i&&Number.isNaN
|
|
|
841
596
|
* @license
|
|
842
597
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
843
598
|
* SPDX-License-Identifier: MIT
|
|
844
|
-
*/const
|
|
599
|
+
*/const S=t=>class extends t{get inputElement(){var t;const i=this.querySelector("#input, input, textarea");if(i)return i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#input, input, textarea");if(e)return e;throw new Error("SelectionMixin requires an input or textarea element")}selectAll(){const t=this.inputElement;t&&t.select()}selectRange(t,i){const e=this.inputElement;e&&e.setSelectionRange&&(e.focus(),e.setSelectionRange(t,i))}getCursorPosition(){const t=this.inputElement;return t&&"number"==typeof t.selectionStart?t.selectionStart:null}setCursorPosition(t){const i=this.inputElement;i&&i.setSelectionRange&&(i.focus(),i.setSelectionRange(t,t))}getSelectedText(){const t=this.inputElement;return t&&null!==t.selectionStart&&null!==t.selectionEnd?t.value.substring(t.selectionStart,t.selectionEnd):""}},A=t=>class extends t{get inputElement(){var t;const i=this.querySelector("#input, input, textarea");if(i)return i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#input, input, textarea");if(e)return e;throw new Error("FocusMixin requires an input or textarea element")}focus(t={}){const i=this.inputElement;i&&(i.focus({preventScroll:t.preventScroll}),t.selectText&&i.select())}blur(){const t=this.inputElement;t&&t.blur()}isFocused(){const t=this.inputElement;return!!t&&document.activeElement===t}},k=t=>class extends t{get inputElement(){var t;const i=this.querySelector("#input, input");if(i)return i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#input, input");if(e)return e;throw new Error("NumberMixin requires an input element")}dispatchInputEvent(t,i){"_dispatchInputEvent"in this&&"function"==typeof this._dispatchInputEvent?this._dispatchInputEvent(t,i):this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}increment(){try{const t=this.inputElement;if(!t.value){const i=t.getAttribute("min");t.value=i||"0"}t.stepUp();const i=t.value;this.dispatchInputEvent("nr-input",{value:i,target:t,action:"increment"}),"value"in this&&(this.value=i)}catch(t){console.warn("Failed to increment value:",t),this.dispatchInputEvent("nr-increment-error",{error:t,value:this.inputElement.value,target:this.inputElement})}}decrement(){try{const t=this.inputElement;t.stepDown();const i=t.value;this.dispatchInputEvent("nr-input",{value:i,target:t,action:"decrement"}),"value"in this&&(this.value=i)}catch(t){console.warn("Failed to decrement value:",t),this.dispatchInputEvent("nr-decrement-error",{error:t,value:this.inputElement.value,target:this.inputElement})}}setStep(t){const i=this.inputElement;t&&this.isValidStep(t)?i.setAttribute("step",t):i.removeAttribute("step")}isValidStep(t){if(!t)return!0;const i=Number.parseFloat(t);return!Number.isNaN(i)&&i>0}};
|
|
845
600
|
/**
|
|
846
601
|
* @license
|
|
847
602
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
@@ -852,48 +607,63 @@ class m{static validateNumericProperties(t,i,r,n){"number"===t&&(i&&Number.isNaN
|
|
|
852
607
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
853
608
|
* SPDX-License-Identifier: MIT
|
|
854
609
|
*/
|
|
855
|
-
class
|
|
610
|
+
class N{constructor(t){this._host=t,t.addController(this)}get host(){return this._host}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}requestUpdate(){try{this._host.requestUpdate()}catch(t){this.handleError(t,"requestUpdate")}}dispatchEvent(t){try{return this._host.dispatchEvent(t)}catch(t){return this.handleError(t,"dispatchEvent"),!1}}handleError(t,i){console.error(`[${this.constructor.name}] Error in ${i}:`,t);try{this._host.dispatchEvent(new CustomEvent("nr-controller-error",{detail:{error:t.message,context:i,controller:this.constructor.name},bubbles:!0,composed:!0}))}catch(t){}}safeExecute(t,i,e){try{return t()}catch(t){return this.handleError(t,i),e}}debounce(t,i){let e;const r=(...r)=>{void 0!==e&&clearTimeout(e),e=setTimeout(()=>{e=void 0,t.apply(this,r)},i)};return r.cancel=()=>{void 0!==e&&(clearTimeout(e),e=void 0)},r}}
|
|
611
|
+
/**
|
|
612
|
+
* @license
|
|
613
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
614
|
+
* SPDX-License-Identifier: MIT
|
|
615
|
+
*/class R extends N{constructor(){super(...arguments),this._isValid=!0,this._validationMessage="",this._validationState="pristine",this._rules=[]}get isValid(){return this._isValid}get validationMessage(){return this._validationMessage}get validationState(){return this._validationState}addRule(t){this._rules.push(t),this.requestUpdate()}removeRule(t){this._rules=this._rules.filter(i=>!t(i)),this.requestUpdate()}clearRules(){this._rules=[],this.clearValidation()}clearValidation(){this._isValid=!0,this._validationMessage="",this._validationState="pristine",this.requestUpdate(),this.dispatchValidationEvent()}checkValidity(){return this.validate()}reportValidity(){const t=this.checkValidity();return t||this.dispatchValidationEvent(),t}dispatchValidationEvent(){this.dispatchEvent(new CustomEvent("nr-validation",{detail:{isValid:this._isValid,validationMessage:this._validationMessage,validationState:this._validationState},bubbles:!0,composed:!0}))}}
|
|
616
|
+
/**
|
|
617
|
+
* @license
|
|
618
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
619
|
+
* SPDX-License-Identifier: MIT
|
|
620
|
+
*/class T extends N{}
|
|
856
621
|
/**
|
|
857
622
|
* @license
|
|
858
623
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
859
624
|
* SPDX-License-Identifier: MIT
|
|
860
|
-
*/var
|
|
625
|
+
*/var C;!function(t){t.Pristine="pristine",t.Pending="pending",t.Valid="valid",t.Invalid="invalid",t.Warning="warning"}(C||(C={}));class I extends T{constructor(){super(...arguments),this._validationState=C.Pristine,this._isValidating=!1,this._isValid=!0,this._validationMessage="",this._validationResult={isValid:!0,errors:[],warnings:[],hasError:!1,hasWarning:!1},this._debounceTimer=null}get stateHost(){return this.host}get validationState(){return this._validationState}get isValidating(){return this._isValidating}get isValid(){return this._isValid}get validationMessage(){return this._validationMessage}get validationResult(){return this._validationResult}setValidationState(t){if(this._validationState!==t){const i=this._validationState;this._validationState=t,this.dispatchStateChangeEvent(i,t),this.requestUpdate()}}setValidationResult(t){this._validationResult=t,this._isValid=t.isValid,this._validationMessage=t.hasError?t.errorMessage||"":t.hasWarning&&t.warningMessage||"";let i=C.Valid;t.hasError?i=C.Invalid:t.hasWarning&&this.stateHost.allowWarnings&&(i=C.Warning),this.setValidationState(i)}setValidating(t){this._isValidating!==t&&(this._isValidating=t,t&&this.setValidationState(C.Pending),this.requestUpdate())}shouldValidateOnChange(){return this.stateHost.validateOnChangeInput&&("change"===this.stateHost.validationTrigger||this._validationState!==C.Pristine)}shouldValidateOnBlur(){return this.stateHost.validateOnBlurInput&&("blur"===this.stateHost.validationTrigger||"change"===this.stateHost.validationTrigger)}clearDebounceTimer(){null!==this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}debounceValidation(t){this.clearDebounceTimer();const i=this.stateHost.validationDebounce;i&&i>0?this._debounceTimer=window.setTimeout(()=>{this._debounceTimer=null,t()},i):t()}resetValidationState(){this.clearDebounceTimer(),this._validationState=C.Pristine,this._isValidating=!1,this._isValid=!0,this._validationMessage="",this._validationResult={isValid:!0,errors:[],warnings:[],hasError:!1,hasWarning:!1},this.requestUpdate()}markAsTouched(){this._validationState===C.Pristine&&this.setValidationState(C.Valid)}isPristine(){return this._validationState===C.Pristine}hasError(){return this._validationState===C.Invalid}hasWarning(){return this._validationState===C.Warning}isPending(){return this._validationState===C.Pending}getStateSummary(){return{state:this._validationState,isValidating:this._isValidating,isValid:this._isValid,message:this._validationMessage,result:this._validationResult,isPristine:this.isPristine(),hasError:this.hasError(),hasWarning:this.hasWarning(),shouldValidateOnChange:this.shouldValidateOnChange(),shouldValidateOnBlur:this.shouldValidateOnBlur()}}hostDisconnected(){super.hostDisconnected(),this.clearDebounceTimer()}dispatchStateChangeEvent(t,i){this.dispatchEvent(new CustomEvent("nr-validation-state-change",{detail:{previousState:t,newState:i,isValidating:this._isValidating,isValid:this._isValid,validationResult:this._validationResult},bubbles:!0,composed:!0}))}}
|
|
861
626
|
/**
|
|
862
627
|
* @license
|
|
863
628
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
864
629
|
* SPDX-License-Identifier: MIT
|
|
865
|
-
*/var $=function(t,i,r,n){return new(r||(r=Promise))(function(e,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof r?i:new r(function(t){t(i)})).then(o,s)}l((n=n.apply(t,i||[])).next())})};class E extends d{constructor(){super(...arguments),this.stateController=new A(this._host)}get validationHost(){return this._host}get isValid(){return this.stateController.isValid}get validationMessage(){return this.stateController.validationMessage}get validationState(){return this.stateController.validationState}get validationResult(){return this.stateController.validationResult}get isValidating(){return this.stateController.isValidating}hostConnected(){this.setupValidationRules()}hostUpdated(){}setupValidationRules(){const t=[],i=this.validationHost;"email"===i.type&&t.push(p()),"url"===i.type&&t.push(v()),i.required&&t.push(h(i.label?`${i.label} is required`:void 0)),i.maxLength&&t.push(g(i.maxLength)),"number"===i.type&&(void 0!==i.min&&t.push(y(Number(i.min))),void 0!==i.max&&t.push(b(Number(i.max))));const r=i.rules||[],n=[...t.filter(t=>!r.some(i=>this.isSameRuleType(t,i))),...r];JSON.stringify(i.rules)!==JSON.stringify(n)&&(i.rules=n,this.requestUpdate())}validate(){try{this.stateController.setValidationState(S.Pending),this.stateController.setValidating(!0),this.dispatchInputValidationEvent();if(this.hasAsyncValidators())return this.performAsyncValidation(this.validationHost.value),!0;const t=this.performDetailedValidation(this.validationHost.value);return this.stateController.setValidationResult(t),t.hasError?this.setValidationResult(!1,this.stateController.validationMessage,S.Invalid):t.hasWarning&&this.validationHost.allowWarnings?this.setValidationResult(!0,this.stateController.validationMessage,S.Warning):this.setValidationResult(!0,"",S.Valid),this.stateController.setValidating(!1),this.updateHostValidationState(),t.isValid}catch(t){return this.handleError(t,"validate"),this.stateController.setValidating(!1),this.setValidationResult(!1,"Validation error occurred",S.Invalid),this.updateHostValidationState(),!1}}validateOnChange(){this.stateController.shouldValidateOnChange()&&this.stateController.debounceValidation(()=>{this.validate()})}validateOnBlur(){this.stateController.shouldValidateOnBlur()&&(this.stateController.clearDebounceTimer(),this.validate())}addInputRule(t){const i=this.validationHost.rules||[];this.validationHost.rules=[...i,t],this.requestUpdate()}removeInputRule(t){const i=this.validationHost.rules||[];this.validationHost.rules=i.filter(i=>!t(i)),this.requestUpdate()}clearInputRules(){this.validationHost.rules=[],this.reset()}hasAsyncValidators(){return(this.validationHost.rules||[]).some(t=>t.asyncValidator||t.validator&&this.isValidatorAsync(t.validator))}isValidatorAsync(t){const i=t.toString();return i.includes("Promise")||i.includes("async")||i.includes("setTimeout")||i.includes("new Promise")}performAsyncValidation(t){return $(this,void 0,void 0,function*(){try{this.stateController.setValidating(!0),this.updateHostValidationState();const i=[],r=[],n=this.validationHost.rules||[];for(const e of n)if(!(e.asyncValidator||e.validator&&this.isValidatorAsync(e.validator))){const n=this.validateRule(e,t);n.isValid||(e.warningOnly&&this.validationHost.allowWarnings?r.push(n.message):i.push(n.message))}if(i.length>0)return this.stateController.setValidationResult({isValid:!1,errors:i,warnings:r,hasError:!0,hasWarning:r.length>0,errorMessage:i[0],warningMessage:r[0]}),this.setValidationResult(!1,this.stateController.validationMessage,S.Invalid),this.stateController.setValidating(!1),void this.updateHostValidationState();for(const e of n)if(e.asyncValidator||e.validator&&this.isValidatorAsync(e.validator))try{yield this.validateAsyncRule(e,t)}catch(t){const n=t.message||e.message||"Validation failed";e.warningOnly&&this.validationHost.allowWarnings?r.push(n):i.push(n)}const e=i.length>0,a=r.length>0;this.stateController.setValidationResult({isValid:!e,errors:i,warnings:r,hasError:e,hasWarning:a,errorMessage:i[0],warningMessage:r[0]}),e?this.setValidationResult(!1,this.stateController.validationMessage,S.Invalid):a&&this.validationHost.allowWarnings?this.setValidationResult(!0,this.stateController.validationMessage,S.Warning):this.setValidationResult(!0,"",S.Valid),this.stateController.setValidating(!1),this.updateHostValidationState()}catch(t){this.handleError(t,"performAsyncValidation"),this.stateController.setValidating(!1),this.setValidationResult(!1,"Async validation error occurred",S.Invalid),this.updateHostValidationState()}})}validateAsyncRule(t,i){return $(this,void 0,void 0,function*(){if(t.asyncValidator)yield t.asyncValidator(t,i);else if(t.validator){const r=t.validator(t,i);r&&"object"==typeof r&&"then"in r&&(yield r)}})}reset(){this.stateController.setValidationResult({isValid:!0,errors:[],warnings:[],hasError:!1,hasWarning:!1}),this.stateController.setValidationState(S.Pristine),this.stateController.setValidating(!1),this.updateHostValidationState(),this.dispatchInputValidationEvent()}getValidationStatus(){return{isValid:this.stateController.validationResult.isValid,isValidating:this.stateController.isValidating,errors:this.stateController.validationResult.errors,warnings:this.stateController.validationResult.warnings,validationResult:this.stateController.validationResult}}setValidationStatus(t){this.stateController.setValidationResult(t),t.hasError?this.setValidationResult(!1,this.stateController.validationMessage,S.Invalid):t.hasWarning?this.setValidationResult(!0,this.stateController.validationMessage,S.Warning):t.isValid?this.setValidationResult(!0,"",S.Valid):this.setValidationResult(!0,"",S.Pristine),this.updateHostValidationState()}performDetailedValidation(t){const i=[],r=[],n=this.validationHost.rules||[];for(const e of n){const n=this.validateRule(e,t);n.isValid||(e.warningOnly&&this.validationHost.allowWarnings?r.push(n.message):i.push(n.message))}const e=i.length>0;return{isValid:!e,errors:i,warnings:r,hasError:e,hasWarning:r.length>0,errorMessage:i[0],warningMessage:r[0]}}validateRule(t,i){if(t.asyncValidator||t.validator&&this.isValidatorAsync(t.validator))return{isValid:!0,message:""};const r=t.transform?t.transform(i):i;if(t.required&&this.isValueEmpty(i))return{isValid:!1,message:t.message||`${this.validationHost.label||"This field"} is required`};if(this.isValueEmpty(i)&&!t.required)return{isValid:!0,message:""};if(t.type){const i=this.validateType(t.type,r);if(!i.isValid)return{isValid:!1,message:t.message||i.message}}if(t.pattern&&!t.pattern.test(r))return{isValid:!1,message:t.message||"Invalid format"};if(void 0!==t.minLength&&r.length<t.minLength)return{isValid:!1,message:t.message||`Minimum length is ${t.minLength} characters`};if(void 0!==t.maxLength&&r.length>t.maxLength)return{isValid:!1,message:t.message||`Maximum length is ${t.maxLength} characters`};if("number"===t.type||"number"===this.validationHost.type){const i=Number(r);if(void 0!==t.min&&i<t.min)return{isValid:!1,message:t.message||`Minimum value is ${t.min}`};if(void 0!==t.max&&i>t.max)return{isValid:!1,message:t.message||`Maximum value is ${t.max}`}}if(t.enum&&!t.enum.includes(r))return{isValid:!1,message:t.message||`Value must be one of: ${t.enum.join(", ")}`};if(t.validator)try{const i=t.validator(t,r);return i&&"object"==typeof i&&"isValid"in i?{isValid:i.isValid,message:i.isValid?"":i.message||t.message||"Validation failed"}:{isValid:!0,message:""}}catch(i){return{isValid:!1,message:t.message||i.message||"Validation failed"}}return{isValid:!0,message:""}}validateType(t,i){switch(t){case"email":return{isValid:c.EMAIL.test(i),message:"Please enter a valid email address"};case"url":return{isValid:c.URL.test(i),message:"Please enter a valid URL"};case"number":case"integer":return{isValid:!Number.isNaN(Number(i))&&("number"===t||Number.isInteger(Number(i))),message:`Please enter a valid ${t}`};case"float":return{isValid:!Number.isNaN(Number.parseFloat(i)),message:"Please enter a valid number"};default:return{isValid:!0,message:""}}}isValueEmpty(t){return null==t||""===t}isSameRuleType(t,i){return t.type===i.type&&t.required===i.required&&!!t.pattern==!!i.pattern}setValidationResult(t,i,r){const n=this.stateController.isValid!==t||this.stateController.validationMessage!==i||this.stateController.validationState!==r;this.stateController.setValidationState(r),this.stateController.setValidationResult({isValid:t,errors:t?[]:[i],warnings:[],hasError:!t,hasWarning:!1,errorMessage:t?"":i,warningMessage:""}),this._isValid=t,this._validationMessage=i,this._validationState=r,n&&this.dispatchInputValidationEvent()}updateHostValidationState(){this.dispatchInputValidationEvent()}dispatchInputValidationEvent(){const t={isValid:this.stateController.isValid,validationMessage:this.stateController.validationMessage,validationState:this.stateController.validationState,errors:this.stateController.validationResult.errors,warnings:this.stateController.validationResult.warnings,validationResult:this.stateController.validationResult};this.dispatchEvent(new CustomEvent("nr-validation",{detail:t,bubbles:!0,composed:!0}))}getValidationClasses(){const t=this.host,i=this.host;return{valid:this.stateController.validationResult.isValid&&!this.stateController.validationResult.hasWarning,invalid:this.stateController.validationResult.hasError,warning:this.stateController.validationResult.hasWarning&&!this.stateController.validationResult.hasError,validating:this.stateController.isValidating,"has-feedback":i.hasFeedback||!1,touched:t.isTouched||!1,dirty:t.isDirty||!1,required:this.host.required||!1}}hasValidationFeedback(){const t=this.host;return!!t.hasFeedback&&(this.stateController.isValidating||this.stateController.validationResult.hasError||this.stateController.validationResult.hasWarning||this.stateController.validationResult.isValid&&t.value&&""!==t.value.trim()&&this.stateController.validationState!==S.Pristine)}renderValidationIcon(){const t=this.host;if(!t.hasFeedback)return"";let r="",n="";return this.stateController.isValidating?(r="hourglass-half",n="validation-loading"):this.stateController.validationResult.hasError?(r="exclamation-circle",n="validation-error"):this.stateController.validationResult.hasWarning?(r="exclamation-triangle",n="validation-warning"):this.stateController.validationResult.isValid&&t.value&&""!==t.value.trim()&&this.stateController.validationState!==S.Pristine&&(r="check-circle",n="validation-success"),r?i`
|
|
630
|
+
*/var P=function(t,i,e,r){return new(e||(e=Promise))(function(n,s){function a(t){try{d(r.next(t))}catch(t){s(t)}}function o(t){try{d(r.throw(t))}catch(t){s(t)}}function d(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(a,o)}d((r=r.apply(t,i||[])).next())})};class O extends R{constructor(){super(...arguments),this.stateController=new I(this._host)}get validationHost(){return this._host}get isValid(){return this.stateController.isValid}get validationMessage(){return this.stateController.validationMessage}get validationState(){return this.stateController.validationState}get validationResult(){return this.stateController.validationResult}get isValidating(){return this.stateController.isValidating}hostConnected(){this.setupValidationRules()}hostUpdated(){}setupValidationRules(){const t=[],i=this.validationHost;"email"===i.type&&t.push(h()),"url"===i.type&&t.push(c()),i.required&&t.push(l(i.label?`${i.label} is required`:void 0)),i.maxLength&&t.push(u(i.maxLength)),"number"===i.type&&(void 0!==i.min&&t.push(p(Number(i.min))),void 0!==i.max&&t.push(v(Number(i.max))));const e=i.rules||[],r=[...t.filter(t=>!e.some(i=>this.isSameRuleType(t,i))),...e];JSON.stringify(i.rules)!==JSON.stringify(r)&&(i.rules=r,this.requestUpdate())}validate(){try{this.stateController.setValidationState(C.Pending),this.stateController.setValidating(!0),this.dispatchInputValidationEvent();if(this.hasAsyncValidators())return this.performAsyncValidation(this.validationHost.value),!0;const t=this.performDetailedValidation(this.validationHost.value);return this.stateController.setValidationResult(t),t.hasError?this.setValidationResult(!1,this.stateController.validationMessage,C.Invalid):t.hasWarning&&this.validationHost.allowWarnings?this.setValidationResult(!0,this.stateController.validationMessage,C.Warning):this.setValidationResult(!0,"",C.Valid),this.stateController.setValidating(!1),this.updateHostValidationState(),t.isValid}catch(t){return this.handleError(t,"validate"),this.stateController.setValidating(!1),this.setValidationResult(!1,"Validation error occurred",C.Invalid),this.updateHostValidationState(),!1}}validateOnChange(){this.stateController.shouldValidateOnChange()&&this.stateController.debounceValidation(()=>{this.validate()})}validateOnBlur(){this.stateController.shouldValidateOnBlur()&&(this.stateController.clearDebounceTimer(),this.validate())}addInputRule(t){const i=this.validationHost.rules||[];this.validationHost.rules=[...i,t],this.requestUpdate()}removeInputRule(t){const i=this.validationHost.rules||[];this.validationHost.rules=i.filter(i=>!t(i)),this.requestUpdate()}clearInputRules(){this.validationHost.rules=[],this.reset()}hasAsyncValidators(){return(this.validationHost.rules||[]).some(t=>t.asyncValidator||t.validator&&this.isValidatorAsync(t.validator))}isValidatorAsync(t){const i=t.toString();return i.includes("Promise")||i.includes("async")||i.includes("setTimeout")||i.includes("new Promise")}performAsyncValidation(t){return P(this,void 0,void 0,function*(){try{this.stateController.setValidating(!0),this.updateHostValidationState();const i=[],e=[],r=this.validationHost.rules||[];for(const n of r)if(!(n.asyncValidator||n.validator&&this.isValidatorAsync(n.validator))){const r=this.validateRule(n,t);r.isValid||(n.warningOnly&&this.validationHost.allowWarnings?e.push(r.message):i.push(r.message))}if(i.length>0)return this.stateController.setValidationResult({isValid:!1,errors:i,warnings:e,hasError:!0,hasWarning:e.length>0,errorMessage:i[0],warningMessage:e[0]}),this.setValidationResult(!1,this.stateController.validationMessage,C.Invalid),this.stateController.setValidating(!1),void this.updateHostValidationState();for(const n of r)if(n.asyncValidator||n.validator&&this.isValidatorAsync(n.validator))try{yield this.validateAsyncRule(n,t)}catch(t){const r=t.message||n.message||"Validation failed";n.warningOnly&&this.validationHost.allowWarnings?e.push(r):i.push(r)}const n=i.length>0,s=e.length>0;this.stateController.setValidationResult({isValid:!n,errors:i,warnings:e,hasError:n,hasWarning:s,errorMessage:i[0],warningMessage:e[0]}),n?this.setValidationResult(!1,this.stateController.validationMessage,C.Invalid):s&&this.validationHost.allowWarnings?this.setValidationResult(!0,this.stateController.validationMessage,C.Warning):this.setValidationResult(!0,"",C.Valid),this.stateController.setValidating(!1),this.updateHostValidationState()}catch(t){this.handleError(t,"performAsyncValidation"),this.stateController.setValidating(!1),this.setValidationResult(!1,"Async validation error occurred",C.Invalid),this.updateHostValidationState()}})}validateAsyncRule(t,i){return P(this,void 0,void 0,function*(){if(t.asyncValidator)yield t.asyncValidator(t,i);else if(t.validator){const e=t.validator(t,i);e&&"object"==typeof e&&"then"in e&&(yield e)}})}reset(){this.stateController.setValidationResult({isValid:!0,errors:[],warnings:[],hasError:!1,hasWarning:!1}),this.stateController.setValidationState(C.Pristine),this.stateController.setValidating(!1),this.updateHostValidationState(),this.dispatchInputValidationEvent()}getValidationStatus(){return{isValid:this.stateController.validationResult.isValid,isValidating:this.stateController.isValidating,errors:this.stateController.validationResult.errors,warnings:this.stateController.validationResult.warnings,validationResult:this.stateController.validationResult}}setValidationStatus(t){this.stateController.setValidationResult(t),t.hasError?this.setValidationResult(!1,this.stateController.validationMessage,C.Invalid):t.hasWarning?this.setValidationResult(!0,this.stateController.validationMessage,C.Warning):t.isValid?this.setValidationResult(!0,"",C.Valid):this.setValidationResult(!0,"",C.Pristine),this.updateHostValidationState()}performDetailedValidation(t){const i=[],e=[],r=this.validationHost.rules||[];for(const n of r){const r=this.validateRule(n,t);r.isValid||(n.warningOnly&&this.validationHost.allowWarnings?e.push(r.message):i.push(r.message))}const n=i.length>0;return{isValid:!n,errors:i,warnings:e,hasError:n,hasWarning:e.length>0,errorMessage:i[0],warningMessage:e[0]}}validateRule(t,i){if(t.asyncValidator||t.validator&&this.isValidatorAsync(t.validator))return{isValid:!0,message:""};const e=t.transform?t.transform(i):i;if(t.required&&this.isValueEmpty(i))return{isValid:!1,message:t.message||`${this.validationHost.label||"This field"} is required`};if(this.isValueEmpty(i)&&!t.required)return{isValid:!0,message:""};if(t.type){const i=this.validateType(t.type,e);if(!i.isValid)return{isValid:!1,message:t.message||i.message}}if(t.pattern&&!t.pattern.test(e))return{isValid:!1,message:t.message||"Invalid format"};if(void 0!==t.minLength&&e.length<t.minLength)return{isValid:!1,message:t.message||`Minimum length is ${t.minLength} characters`};if(void 0!==t.maxLength&&e.length>t.maxLength)return{isValid:!1,message:t.message||`Maximum length is ${t.maxLength} characters`};if("number"===t.type||"number"===this.validationHost.type){const i=Number(e);if(void 0!==t.min&&i<t.min)return{isValid:!1,message:t.message||`Minimum value is ${t.min}`};if(void 0!==t.max&&i>t.max)return{isValid:!1,message:t.message||`Maximum value is ${t.max}`}}if(t.enum&&!t.enum.includes(e))return{isValid:!1,message:t.message||`Value must be one of: ${t.enum.join(", ")}`};if(t.validator)try{const i=t.validator(t,e);return i&&"object"==typeof i&&"isValid"in i?{isValid:i.isValid,message:i.isValid?"":i.message||t.message||"Validation failed"}:{isValid:!0,message:""}}catch(i){return{isValid:!1,message:t.message||i.message||"Validation failed"}}return{isValid:!0,message:""}}validateType(t,i){switch(t){case"email":return{isValid:d.EMAIL.test(i),message:"Please enter a valid email address"};case"url":return{isValid:d.URL.test(i),message:"Please enter a valid URL"};case"number":case"integer":return{isValid:!Number.isNaN(Number(i))&&("number"===t||Number.isInteger(Number(i))),message:`Please enter a valid ${t}`};case"float":return{isValid:!Number.isNaN(Number.parseFloat(i)),message:"Please enter a valid number"};default:return{isValid:!0,message:""}}}isValueEmpty(t){return null==t||""===t}isSameRuleType(t,i){return t.type===i.type&&t.required===i.required&&!!t.pattern==!!i.pattern}setValidationResult(t,i,e){const r=this.stateController.isValid!==t||this.stateController.validationMessage!==i||this.stateController.validationState!==e;this.stateController.setValidationState(e),this.stateController.setValidationResult({isValid:t,errors:t?[]:[i],warnings:[],hasError:!t,hasWarning:!1,errorMessage:t?"":i,warningMessage:""}),this._isValid=t,this._validationMessage=i,this._validationState=e,r&&this.dispatchInputValidationEvent()}updateHostValidationState(){this.dispatchInputValidationEvent()}dispatchInputValidationEvent(){const t={isValid:this.stateController.isValid,validationMessage:this.stateController.validationMessage,validationState:this.stateController.validationState,errors:this.stateController.validationResult.errors,warnings:this.stateController.validationResult.warnings,validationResult:this.stateController.validationResult};this.dispatchEvent(new CustomEvent("nr-validation",{detail:t,bubbles:!0,composed:!0}))}getValidationClasses(){const t=this.host,i=this.host;return{valid:this.stateController.validationResult.isValid&&!this.stateController.validationResult.hasWarning,invalid:this.stateController.validationResult.hasError,warning:this.stateController.validationResult.hasWarning&&!this.stateController.validationResult.hasError,validating:this.stateController.isValidating,"has-feedback":i.hasFeedback||!1,touched:t.isTouched||!1,dirty:t.isDirty||!1,required:this.host.required||!1}}hasValidationFeedback(){const t=this.host;return!!t.hasFeedback&&(this.stateController.isValidating||this.stateController.validationResult.hasError||this.stateController.validationResult.hasWarning||this.stateController.validationResult.isValid&&t.value&&""!==t.value.trim()&&this.stateController.validationState!==C.Pristine)}renderValidationIcon(){const t=this.host;if(!t.hasFeedback)return"";let i="",r="";return this.stateController.isValidating?(i="hourglass-half",r="validation-loading"):this.stateController.validationResult.hasError?(i="exclamation-circle",r="validation-error"):this.stateController.validationResult.hasWarning?(i="exclamation-triangle",r="validation-warning"):this.stateController.validationResult.isValid&&t.value&&""!==t.value.trim()&&this.stateController.validationState!==C.Pristine&&(i="check-circle",r="validation-success"),i?e`
|
|
866
631
|
<nr-icon
|
|
867
|
-
name="${
|
|
868
|
-
class="validation-icon ${
|
|
632
|
+
name="${i}"
|
|
633
|
+
class="validation-icon ${r}"
|
|
869
634
|
part="validation-icon">
|
|
870
635
|
</nr-icon>
|
|
871
|
-
`:""}renderValidationMessage(){const t=this.stateController.validationResult.hasError,
|
|
636
|
+
`:""}renderValidationMessage(){const t=this.stateController.validationResult.hasError,i=this.stateController.validationResult.hasWarning&&!t,r=t?this.stateController.validationResult.errorMessage:i?this.stateController.validationResult.warningMessage:"";return r?e`
|
|
872
637
|
<div class="validation-message ${t?"error":"warning"}"
|
|
873
638
|
part="validation-message"
|
|
874
639
|
role="alert"
|
|
875
640
|
aria-live="polite">
|
|
876
|
-
${
|
|
641
|
+
${r}
|
|
877
642
|
</div>
|
|
878
643
|
`:""}clearDebounceTimer(){this.stateController.clearDebounceTimer()}getValidationRenderState(){return{classes:this.getValidationClasses(),hasValidationFeedback:this.hasValidationFeedback(),isValidating:this.stateController.isValidating,validationResult:this.stateController.validationResult,validationState:this.stateController.validationState}}}
|
|
879
644
|
/**
|
|
880
645
|
* @license
|
|
881
646
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
882
647
|
* SPDX-License-Identifier: MIT
|
|
883
|
-
*/var
|
|
648
|
+
*/var M=function(t,i,e,r){return new(e||(e=Promise))(function(n,s){function a(t){try{d(r.next(t))}catch(t){s(t)}}function o(t){try{d(r.throw(t))}catch(t){s(t)}}function d(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(a,o)}d((r=r.apply(t,i||[])).next())})};class D extends T{constructor(){super(...arguments),this.debounceTimer=null,this.handleKeyDown=t=>{!this.eventHost.readonly||this.isReadonlyKeyAllowed(t)?"Enter"!==t.key?"number"===this.eventHost.type&&this.handleNumericKeyDown(t):this.dispatchEnterEvent(t):t.preventDefault()},this.handleValueChange=t=>{if(this.eventHost.readonly)return void t.preventDefault();const i=t.target,e=i.value;if(this.eventHost.maxLength&&e.length>this.eventHost.maxLength)return void t.preventDefault();"number"===this.eventHost.type&&e&&this.validateNumericValue(e,t),this.eventHost.value=e;const r=this.eventHost;r.validationController&&"function"==typeof r.validationController.validateOnChange&&r.validationController.validateOnChange();const n=this.eventHost.debounce||0;n>0?(this.clearDebounceTimer(),this.debounceTimer=setTimeout(()=>{this.eventHost.dispatchInputEvent("nr-input",{value:this.eventHost.value,target:i,originalEvent:t})},n)):this.eventHost.dispatchInputEvent("nr-input",{value:this.eventHost.value,target:i,originalEvent:t})},this.handleFocus=t=>{var i;this.setFocusState(!0);const e=t.target;this.restoreCursorPosition(e);const r={focused:!0,cursorPosition:null!==(i=this.getCursorPosition())&&void 0!==i?i:void 0,selectedText:this.getSelectedText()};this.eventHost.dispatchFocusEvent("nr-focus",Object.assign({target:t.target,value:this.eventHost.value},r)),this.eventHost.dispatchFocusEvent("nr-focus-change",r)},this.handleBlur=t=>{var i;this.setFocusState(!1);const e={focused:!1,cursorPosition:null!==(i=this.getCursorPosition())&&void 0!==i?i:void 0,selectedText:this.getSelectedText()},r=this.eventHost;r.validationController&&"function"==typeof r.validationController.validateOnBlur&&r.validationController.validateOnBlur(),this.eventHost.dispatchFocusEvent("nr-blur",Object.assign({target:t.target,value:this.eventHost.value},e)),this.eventHost.dispatchFocusEvent("nr-focus-change",e)},this.handleIconKeydown=t=>{if(!this.isActivationKey(t))return;t.preventDefault();const i=t.target;switch(i.id){case"copy-icon":this.handleCopy();break;case"clear-icon":this.handleClear();break;case"password-icon":this.handleTogglePassword();break;default:i.closest("#number-icons")&&this.handleNumberIconAction(i)}},this.handleCopy=()=>M(this,void 0,void 0,function*(){if(this.eventHost.withCopy&&!this.eventHost.disabled)try{const t=this.inputElement;if(!t)return;t.select(),yield navigator.clipboard.writeText(t.value),this.eventHost.dispatchActionEvent("nr-copy-success",{value:t.value,action:"copy"})}catch(t){this.handleError(t,"copy"),this.eventHost.dispatchActionEvent("nr-copy-error",{error:t,action:"copy"})}}),this.handleClear=()=>{if(this.eventHost.disabled||this.eventHost.readonly||!this.eventHost.allowClear)return;const t=this.eventHost.value;this.eventHost.value="";const i=this.inputElement;i&&(i.value="",i.focus()),this.eventHost.dispatchActionEvent("nr-clear",{previousValue:t,newValue:this.eventHost.value,target:i,action:"clear"}),this.eventHost.dispatchInputEvent("nr-input",{value:this.eventHost.value,target:i,action:"clear"})},this.handleTogglePassword=()=>{if("password"!==this.eventHost.type)return;const t="password"===this.eventHost.inputType?"text":"password";this.eventHost.inputType=t,this.requestUpdate(),this.eventHost.dispatchActionEvent("nr-password-toggle",{visible:"text"===t,action:"password-toggle"})},this.handleIncrement=()=>{"number"===this.eventHost.type&&this.eventHost.increment&&this.eventHost.increment()},this.handleDecrement=()=>{"number"===this.eventHost.type&&this.eventHost.decrement&&this.eventHost.decrement()}}get eventHost(){return this.host}get inputElement(){var t,i;return(null===(i=(t=this.eventHost).querySelector)||void 0===i?void 0:i.call(t,"#input"))||null}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}handleNumericKeyDown(t){["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)||t.ctrlKey||t.metaKey||"."!==t.key&&"-"!==t.key&&(/^\d$/.test(t.key)||t.preventDefault())}handleNumberIconAction(t){const i=t.classList.contains("increment")||t.closest(".increment"),e=t.classList.contains("decrement")||t.closest(".decrement");i?this.handleIncrement():e&&this.handleDecrement()}dispatchEnterEvent(t){this.eventHost.dispatchInputEvent("nr-enter",{value:this.eventHost.value,target:t.target,originalEvent:t})}validateNumericValue(t,i){}restoreCursorPosition(t){if(t.dataset.restoreCursor){const i=Number.parseInt(t.dataset.restoreCursor,10);Number.isNaN(i)||t.setSelectionRange(i,i),delete t.dataset.restoreCursor}}setFocusState(t){this.eventHost.hasOwnProperty("focused")&&(this.eventHost.focused=t,this.requestUpdate())}getCursorPosition(){if(this.eventHost.getCursorPosition)return this.eventHost.getCursorPosition();const t=this.inputElement;return t?t.selectionStart:null}getSelectedText(){if(this.eventHost.getSelectedText)return this.eventHost.getSelectedText();const t=this.inputElement;return t&&null!==t.selectionStart&&null!==t.selectionEnd?t.value.substring(t.selectionStart,t.selectionEnd):""}isReadonlyKeyAllowed(t){if(this.eventHost.isReadonlyKeyAllowed)return this.eventHost.isReadonlyKeyAllowed(t);return t.ctrlKey||t.metaKey?["KeyA","KeyC"].includes(t.code):["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return this.eventHost.isActivationKey?this.eventHost.isActivationKey(t):"Enter"===t.key||" "===t.key}}
|
|
884
649
|
/**
|
|
885
650
|
* @license
|
|
886
651
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
887
652
|
* SPDX-License-Identifier: MIT
|
|
888
|
-
*/var
|
|
889
|
-
<slot name="label"></slot>
|
|
890
|
-
<div class="input-wrapper ${Object.entries(t).filter(([,t])=>t).map(([t])=>t).join(" ")}"
|
|
891
|
-
part="input-wrapper"
|
|
892
|
-
data-
|
|
893
|
-
|
|
894
|
-
|
|
653
|
+
*/var z=function(t,i,e,r){for(var n,s=arguments.length,a=s<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,e):r,o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(i,e,a):n(i,e))||a);return s>3&&a&&Object.defineProperty(i,e,a),a},L=function(t,i,e,r){return new(e||(e=Promise))(function(n,s){function a(t){try{d(r.next(t))}catch(t){s(t)}}function o(t){try{d(r.throw(t))}catch(t){s(t)}}function d(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(a,o)}d((r=r.apply(t,i||[])).next())})};let U=class extends(k(A(S((t=>g(m(f(x(t)))))(r))))){constructor(){super(...arguments),this.validationController=new O(this),this.eventController=new D(this),this.disabled=!1,this.readonly=!1,this.state="default",this.value="",this.size="medium",this.variant="outlined",this.type="text",this.placeholder="",this.autocomplete="off",this.withCopy=!1,this.allowClear=!1,this.showCount=!1,this.rules=[],this.validateOnChangeInput=!0,this.validateOnBlurInput=!0,this.hasFeedback=!1,this.allowWarnings=!1,this.validationTrigger="change",this.debounce=0,this.inputType="",this.hasAddonBefore=!1,this.hasAddonAfter=!1,this.focused=!1,this.requiredComponents=["nr-icon"],this._handleValidationEvent=t=>{const i=t.detail;this.validationMessage=i.validationMessage||"";let e="default";i.validationResult.hasError?e="error":i.validationResult.hasWarning&&this.allowWarnings?e="warning":i.validationResult.isValid&&this.value&&this.hasFeedback&&(e="success"),this.state!==e&&(this.state=e),this.requestUpdate()},this._handleKeyDown=t=>{this.eventController.handleKeyDown(t)},this._valueChange=t=>{this.eventController.handleValueChange(t)},this._focusEvent=t=>{this.eventController.handleFocus(t)},this._blurEvent=t=>{this.eventController.handleBlur(t)},this._handleIconKeydown=t=>{this.eventController.handleIconKeydown(t)}}get _input(){return this.renderRoot.querySelector("#input")}get characterCountDisplay(){const t=this.value.length;return this.maxLength?`${t}/${this.maxLength}`:`${t}`}get isOverCharacterLimit(){return!!this.maxLength&&this.value.length>this.maxLength}get input(){return this._input}get inputElement(){return this._input}connectedCallback(){super.connectedCallback(),this.addEventListener("nr-validation",this._handleValidationEvent)}disconnectedCallback(){var t,i,e,r;super.disconnectedCallback(),this.removeEventListener("nr-validation",this._handleValidationEvent),null===(i=(t=this.validationController).clearDebounceTimer)||void 0===i||i.call(t),null===(r=(e=this.eventController).clearDebounceTimer)||void 0===r||r.call(e)}willUpdate(t){super.willUpdate(t),!t.has("type")&&this.inputType||(this.inputType=this.type),(t.has("type")||t.has("min"))&&"number"===this.type&&this.min&&!this.value&&(this.value=this.min),(t.has("type")||t.has("min")||t.has("max")||t.has("step"))&&E.validateNumericProperties(this.type,this.min,this.max,this.step),(t.has("type")||t.has("required")||t.has("maxLength")||t.has("min")||t.has("max"))&&this.validationController.setupValidationRules()}updated(t){if(t.has("step")||t.has("min")||t.has("max")||t.has("maxLength")){const t=this.input;t&&(this.setStep(this.step),this.min?t.setAttribute("min",this.min):t.removeAttribute("min"),this.max?t.setAttribute("max",this.max):t.removeAttribute("max"),this.maxLength?t.setAttribute("maxlength",this.maxLength.toString()):t.removeAttribute("maxlength"))}if(t.has("value")){const t=this.input;t&&t.value!==this.value&&(t.value=this.value)}}firstUpdated(){this._checkInitialSlotContent()}_checkInitialSlotContent(){var t,i;const e=this.renderRoot.querySelector('slot[name="addon-before"]');this.hasAddonBefore=(null!==(t=null==e?void 0:e.assignedElements())&&void 0!==t?t:[]).length>0;const r=this.renderRoot.querySelector('slot[name="addon-after"]');this.hasAddonAfter=(null!==(i=null==r?void 0:r.assignedElements())&&void 0!==i?i:[]).length>0}_onCopy(){return L(this,void 0,void 0,function*(){yield this.eventController.handleCopy()})}_onClear(){this.eventController.handleClear()}_increment(){this.eventController.handleIncrement()}_decrement(){this.eventController.handleDecrement()}_togglePasswordIcon(){this.eventController.handleTogglePassword()}_getAriaDescribedBy(){var t;const i=[],e=this.renderRoot.querySelector('slot[name="helper-text"]');return(null!==(t=null==e?void 0:e.assignedElements())&&void 0!==t?t:[]).length>0&&i.push("helper-text"),i.join(" ")||""}validateValue(t){return this.validationController.validate()}addRule(t){this.validationController.addInputRule(t)}removeRule(t){this.validationController.removeInputRule(t)}clearRules(){this.validationController.clearInputRules()}getValidationStatus(){return this.validationController.getValidationStatus()}validateInput(){return L(this,void 0,void 0,function*(){const t=this.validationController.validate();return this.validationController.isValidating?new Promise(t=>{const i=()=>{this.validationController.isValidating?setTimeout(i,50):t(this.validationController.isValid)};i()}):t})}setValidationStatus(t){this.validationController.setValidationStatus(t)}getValidationClasses(){return this.validationController.getValidationClasses()}renderValidationIcon(){return this.validationController.renderValidationIcon()}renderValidationMessage(){return this.validationController.renderValidationMessage()}render(){const t=this.getValidationClasses(),i=this.validationController.getValidationRenderState();return e`
|
|
654
|
+
<slot name="label" part="label"></slot>
|
|
655
|
+
<div class="input-wrapper ${Object.entries(t).filter(([,t])=>t).map(([t])=>t).join(" ")}"
|
|
656
|
+
part="input-wrapper"
|
|
657
|
+
?data-validating="${i.isValidating}">
|
|
658
|
+
${this.hasAddonBefore?e`
|
|
659
|
+
<div class="input-addon-before" part="addon-before">
|
|
660
|
+
<slot name="addon-before"></slot>
|
|
661
|
+
</div>
|
|
662
|
+
`:""}
|
|
895
663
|
<div data-size=${this.size} id="input-container" part="input-container">
|
|
896
|
-
|
|
664
|
+
<div class="input-prefix" part="prefix" style="display: contents;">
|
|
665
|
+
<slot name="prefix"></slot>
|
|
666
|
+
</div>
|
|
897
667
|
<input
|
|
898
668
|
id="input"
|
|
899
669
|
part="input"
|
|
@@ -903,28 +673,34 @@ class V extends l{}
|
|
|
903
673
|
.placeholder=${this.placeholder}
|
|
904
674
|
.type="${this.inputType}"
|
|
905
675
|
.autocomplete=${this.autocomplete}
|
|
906
|
-
aria-invalid=${
|
|
676
|
+
aria-invalid=${i.validationResult.hasError?"true":"false"}
|
|
907
677
|
aria-describedby=${this._getAriaDescribedBy()}
|
|
908
678
|
@input=${this._valueChange}
|
|
909
679
|
@focus=${this._focusEvent}
|
|
910
680
|
@blur=${this._blurEvent}
|
|
911
681
|
@keydown=${this._handleKeyDown}
|
|
912
682
|
/>
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
${
|
|
917
|
-
${
|
|
918
|
-
${
|
|
919
|
-
${
|
|
683
|
+
<div class="input-suffix" part="suffix" style="display: contents;">
|
|
684
|
+
<slot name="suffix"></slot>
|
|
685
|
+
</div>
|
|
686
|
+
${$.renderCopyIcon(this.withCopy,this.disabled,this.readonly,()=>this._onCopy(),t=>this._handleIconKeydown(t))}
|
|
687
|
+
${$.renderClearIcon(this.allowClear,this.value,this.disabled,this.readonly,()=>this._onClear(),t=>this._handleIconKeydown(t))}
|
|
688
|
+
${i.hasValidationFeedback?this.renderValidationIcon():$.renderStateIcon(this.state)}
|
|
689
|
+
${$.renderCalendarIcon(this.state,this.type)}
|
|
690
|
+
${$.renderPasswordIcon(this.type,this.inputType,this.disabled,this.readonly,()=>this._togglePasswordIcon(),t=>this._handleIconKeydown(t))}
|
|
691
|
+
${$.renderNumberIcons(this.type,this.state,this.disabled,this.readonly,()=>this._increment(),()=>this._decrement(),t=>this._handleIconKeydown(t))}
|
|
920
692
|
</div>
|
|
921
|
-
${
|
|
693
|
+
${this.hasAddonAfter?e`
|
|
694
|
+
<div class="input-addon-after" part="addon-after">
|
|
695
|
+
<slot name="addon-after"></slot>
|
|
696
|
+
</div>
|
|
697
|
+
`:""}
|
|
922
698
|
</div>
|
|
923
|
-
<slot name="helper-text"></slot>
|
|
699
|
+
<slot name="helper-text" part="helper-text"></slot>
|
|
924
700
|
${this.renderValidationMessage()}
|
|
925
|
-
${this.showCount?
|
|
926
|
-
<div class="character-count"
|
|
701
|
+
${this.showCount?e`
|
|
702
|
+
<div class="character-count" ?data-over-limit=${this.isOverCharacterLimit}>
|
|
927
703
|
${this.characterCountDisplay}
|
|
928
704
|
</div>
|
|
929
705
|
`:""}
|
|
930
|
-
`}};
|
|
706
|
+
`}};U.styles=o,U.useShadowDom=!0,z([n({type:Boolean,reflect:!0})],U.prototype,"disabled",void 0),z([n({type:Boolean,reflect:!0})],U.prototype,"readonly",void 0),z([n({type:String,reflect:!0})],U.prototype,"state",void 0),z([n({type:String,reflect:!0})],U.prototype,"value",void 0),z([n({type:String})],U.prototype,"size",void 0),z([n({type:String,reflect:!0})],U.prototype,"variant",void 0),z([n({reflect:!0})],U.prototype,"type",void 0),z([n({type:String})],U.prototype,"step",void 0),z([n({type:String})],U.prototype,"min",void 0),z([n({type:String})],U.prototype,"max",void 0),z([n({type:String})],U.prototype,"placeholder",void 0),z([n({type:String})],U.prototype,"autocomplete",void 0),z([n({type:String})],U.prototype,"name",void 0),z([n({type:Boolean})],U.prototype,"required",void 0),z([n({type:Boolean,reflect:!0})],U.prototype,"withCopy",void 0),z([n({type:Boolean,reflect:!0})],U.prototype,"allowClear",void 0),z([n({type:Boolean,reflect:!0})],U.prototype,"showCount",void 0),z([n({type:Number})],U.prototype,"maxLength",void 0),z([n({type:Array})],U.prototype,"rules",void 0),z([n({type:Boolean,attribute:"validate-on-change"})],U.prototype,"validateOnChangeInput",void 0),z([n({type:Boolean,attribute:"validate-on-blur"})],U.prototype,"validateOnBlurInput",void 0),z([n({type:Boolean,attribute:"has-feedback"})],U.prototype,"hasFeedback",void 0),z([n({type:Boolean,attribute:"allow-warnings"})],U.prototype,"allowWarnings",void 0),z([n({type:String,attribute:"validation-trigger"})],U.prototype,"validationTrigger",void 0),z([n({type:Number,attribute:"validation-debounce"})],U.prototype,"validationDebounce",void 0),z([n({type:String})],U.prototype,"label",void 0),z([n({type:Number})],U.prototype,"debounce",void 0),z([s()],U.prototype,"validationMessage",void 0),z([s()],U.prototype,"inputType",void 0),z([s()],U.prototype,"hasAddonBefore",void 0),z([s()],U.prototype,"hasAddonAfter",void 0),z([s()],U.prototype,"focused",void 0),U=z([a("nr-input")],U);var B=Object.freeze({__proto__:null,PORT:/^(?:[1-9]\d{0,4}|[1-5]\d{5}|6[0-4]\d{4}|65[0-4]\d{3}|655[0-2]\d{2}|6553[0-5])$/,NOT_EMPTY:/^.+$/});export{U as NrInputElement,B as Validations};
|