@nova-design-system/nova-webcomponents 3.0.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MD +157 -0
- package/dist/blazor-docs.json +9342 -0
- package/dist/cjs/app-globals-2ceecab2.js +11 -0
- package/dist/cjs/app-globals-2ceecab2.js.map +1 -0
- package/dist/cjs/clsx-fc789adc.js +7 -0
- package/dist/cjs/clsx-fc789adc.js.map +1 -0
- package/dist/cjs/constants-33057c89.js +140 -0
- package/dist/cjs/constants-33057c89.js.map +1 -0
- package/dist/cjs/fade.animation-0d33d198.js +1875 -0
- package/dist/cjs/fade.animation-0d33d198.js.map +1 -0
- package/dist/cjs/grow.animation-46e7ae4b.js +119 -0
- package/dist/cjs/grow.animation-46e7ae4b.js.map +1 -0
- package/dist/cjs/index-5d1f2412.js +1984 -0
- package/dist/cjs/index-5d1f2412.js.map +1 -0
- package/dist/cjs/index.cjs.js +494 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/native.cjs.js +48 -0
- package/dist/cjs/native.cjs.js.map +1 -0
- package/dist/cjs/nv-alert.cjs.entry.js +140 -0
- package/dist/cjs/nv-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-avatar.cjs.entry.js +73 -0
- package/dist/cjs/nv-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-badge.cjs.entry.js +119 -0
- package/dist/cjs/nv-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-base.cjs.entry.js +75 -0
- package/dist/cjs/nv-base.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-button.cjs.entry.js +91 -0
- package/dist/cjs/nv-button.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-col.cjs.entry.js +41 -0
- package/dist/cjs/nv-col.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +94 -0
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +94 -0
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +79 -0
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldradio.cjs.entry.js +81 -0
- package/dist/cjs/nv-fieldradio.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldselect.cjs.entry.js +290 -0
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldtext.cjs.entry.js +83 -0
- package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +151 -0
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldtoggle.cjs.entry.js +64 -0
- package/dist/cjs/nv-fieldtoggle.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-icon.cjs.entry.js +66 -0
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-iconbutton.cjs.entry.js +92 -0
- package/dist/cjs/nv-iconbutton.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-loader.cjs.entry.js +29 -0
- package/dist/cjs/nv-loader.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-menu.cjs.entry.js +189 -0
- package/dist/cjs/nv-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-menuitem.cjs.entry.js +30 -0
- package/dist/cjs/nv-menuitem.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-popover.cjs.entry.js +2327 -0
- package/dist/cjs/nv-popover.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-row.cjs.entry.js +24 -0
- package/dist/cjs/nv-row.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-stack.cjs.entry.js +31 -0
- package/dist/cjs/nv-stack.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-tooltip.cjs.entry.js +37 -0
- package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/timeline.animation-dbb9c5ea.js +107 -0
- package/dist/cjs/timeline.animation-dbb9c5ea.js.map +1 -0
- package/dist/cjs/v4-7014b8b0.js +67 -0
- package/dist/cjs/v4-7014b8b0.js.map +1 -0
- package/dist/collection/animations/collapse.animation.js +82 -0
- package/dist/collection/animations/collapse.animation.js.map +1 -0
- package/dist/collection/animations/fade.animation.js +66 -0
- package/dist/collection/animations/fade.animation.js.map +1 -0
- package/dist/collection/animations/grow.animation.js +87 -0
- package/dist/collection/animations/grow.animation.js.map +1 -0
- package/dist/collection/animations/index.js +5 -0
- package/dist/collection/animations/index.js.map +1 -0
- package/dist/collection/animations/timeline.animation.js +21 -0
- package/dist/collection/animations/timeline.animation.js.map +1 -0
- package/dist/collection/collection-manifest.json +35 -0
- package/dist/collection/components/nv-alert/nv-alert.css +113 -0
- package/dist/collection/components/nv-alert/nv-alert.docs.js +61 -0
- package/dist/collection/components/nv-alert/nv-alert.docs.js.map +1 -0
- package/dist/collection/components/nv-alert/nv-alert.js +355 -0
- package/dist/collection/components/nv-alert/nv-alert.js.map +1 -0
- package/dist/collection/components/nv-avatar/nv-avatar.css +154 -0
- package/dist/collection/components/nv-avatar/nv-avatar.docs.js +42 -0
- package/dist/collection/components/nv-avatar/nv-avatar.docs.js.map +1 -0
- package/dist/collection/components/nv-avatar/nv-avatar.js +311 -0
- package/dist/collection/components/nv-avatar/nv-avatar.js.map +1 -0
- package/dist/collection/components/nv-badge/nv-badge.css +174 -0
- package/dist/collection/components/nv-badge/nv-badge.docs.js +72 -0
- package/dist/collection/components/nv-badge/nv-badge.docs.js.map +1 -0
- package/dist/collection/components/nv-badge/nv-badge.js +354 -0
- package/dist/collection/components/nv-badge/nv-badge.js.map +1 -0
- package/dist/collection/components/nv-base/nv-base.docs.js +5 -0
- package/dist/collection/components/nv-base/nv-base.docs.js.map +1 -0
- package/dist/collection/components/nv-base/nv-base.js +69 -0
- package/dist/collection/components/nv-base/nv-base.js.map +1 -0
- package/dist/collection/components/nv-button/nv-button.css +259 -0
- package/dist/collection/components/nv-button/nv-button.docs.js +56 -0
- package/dist/collection/components/nv-button/nv-button.docs.js.map +1 -0
- package/dist/collection/components/nv-button/nv-button.js +241 -0
- package/dist/collection/components/nv-button/nv-button.js.map +1 -0
- package/dist/collection/components/nv-col/nv-col.css +45 -0
- package/dist/collection/components/nv-col/nv-col.docs.js +18 -0
- package/dist/collection/components/nv-col/nv-col.docs.js.map +1 -0
- package/dist/collection/components/nv-col/nv-col.js +63 -0
- package/dist/collection/components/nv-col/nv-col.js.map +1 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.css +136 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js +231 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +448 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js.map +1 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +183 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +180 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +435 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +149 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +189 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +465 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -0
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.css +133 -0
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js +121 -0
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +347 -0
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js.map +1 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +197 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +157 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +610 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +141 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +206 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +499 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +141 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +175 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +527 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -0
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.css +114 -0
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.docs.js +65 -0
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.js +283 -0
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.js.map +1 -0
- package/dist/collection/components/nv-icon/nv-icon.css +32 -0
- package/dist/collection/components/nv-icon/nv-icon.docs.js +31 -0
- package/dist/collection/components/nv-icon/nv-icon.docs.js.map +1 -0
- package/dist/collection/components/nv-icon/nv-icon.js +245 -0
- package/dist/collection/components/nv-icon/nv-icon.js.map +1 -0
- package/dist/collection/components/nv-icon/nv-icons.js +450 -0
- package/dist/collection/components/nv-icon/nv-icons.js.map +1 -0
- package/dist/collection/components/nv-icon/test/nv-icon.test.js +25 -0
- package/dist/collection/components/nv-icon/test/nv-icon.test.js.map +1 -0
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.css +152 -0
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.docs.js +61 -0
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.docs.js.map +1 -0
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +263 -0
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js.map +1 -0
- package/dist/collection/components/nv-loader/nv-loader.css +162 -0
- package/dist/collection/components/nv-loader/nv-loader.docs.js +27 -0
- package/dist/collection/components/nv-loader/nv-loader.docs.js.map +1 -0
- package/dist/collection/components/nv-loader/nv-loader.js +78 -0
- package/dist/collection/components/nv-loader/nv-loader.js.map +1 -0
- package/dist/collection/components/nv-menu/nv-menu.css +61 -0
- package/dist/collection/components/nv-menu/nv-menu.docs.js +40 -0
- package/dist/collection/components/nv-menu/nv-menu.docs.js.map +1 -0
- package/dist/collection/components/nv-menu/nv-menu.js +355 -0
- package/dist/collection/components/nv-menu/nv-menu.js.map +1 -0
- package/dist/collection/components/nv-menuitem/nv-menuitem.css +29 -0
- package/dist/collection/components/nv-menuitem/nv-menuitem.docs.js +6 -0
- package/dist/collection/components/nv-menuitem/nv-menuitem.docs.js.map +1 -0
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +111 -0
- package/dist/collection/components/nv-menuitem/nv-menuitem.js.map +1 -0
- package/dist/collection/components/nv-popover/nv-popover.css +42 -0
- package/dist/collection/components/nv-popover/nv-popover.docs.js +74 -0
- package/dist/collection/components/nv-popover/nv-popover.docs.js.map +1 -0
- package/dist/collection/components/nv-popover/nv-popover.js +587 -0
- package/dist/collection/components/nv-popover/nv-popover.js.map +1 -0
- package/dist/collection/components/nv-row/nv-row.css +7 -0
- package/dist/collection/components/nv-row/nv-row.docs.js +13 -0
- package/dist/collection/components/nv-row/nv-row.docs.js.map +1 -0
- package/dist/collection/components/nv-row/nv-row.js +23 -0
- package/dist/collection/components/nv-row/nv-row.js.map +1 -0
- package/dist/collection/components/nv-stack/nv-stack.css +61 -0
- package/dist/collection/components/nv-stack/nv-stack.docs.js +39 -0
- package/dist/collection/components/nv-stack/nv-stack.docs.js.map +1 -0
- package/dist/collection/components/nv-stack/nv-stack.js +123 -0
- package/dist/collection/components/nv-stack/nv-stack.js.map +1 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.css +22 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.docs.js +38 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.docs.js.map +1 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +102 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.js.map +1 -0
- package/dist/collection/dev/dev-components.js +3 -0
- package/dist/collection/dev/dev-components.js.map +1 -0
- package/dist/collection/dev/dev-forms.js +3 -0
- package/dist/collection/dev/dev-forms.js.map +1 -0
- package/dist/collection/dev/dev-root.js +23 -0
- package/dist/collection/dev/dev-root.js.map +1 -0
- package/dist/collection/dev/dev-utils.js +54 -0
- package/dist/collection/dev/dev-utils.js.map +1 -0
- package/dist/collection/fonts/TT_Norms_Pro_Bold.woff2 +0 -0
- package/dist/collection/fonts/TT_Norms_Pro_Medium.woff2 +0 -0
- package/dist/collection/fonts/TT_Norms_Pro_Mono_Bold.woff2 +0 -0
- package/dist/collection/fonts/TT_Norms_Pro_Mono_Medium.woff2 +0 -0
- package/dist/collection/fonts/TT_Norms_Pro_Mono_Regular.woff2 +0 -0
- package/dist/collection/fonts/TT_Norms_Pro_Regular.woff2 +0 -0
- package/dist/collection/global.js +6 -0
- package/dist/collection/global.js.map +1 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/class.utils.js +15 -0
- package/dist/collection/utils/class.utils.js.map +1 -0
- package/dist/collection/utils/constants.js +122 -0
- package/dist/collection/utils/constants.js.map +1 -0
- package/dist/collection/utils/events.utils.js +19 -0
- package/dist/collection/utils/events.utils.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +488 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/nv-alert.d.ts +11 -0
- package/dist/components/nv-alert.js +171 -0
- package/dist/components/nv-alert.js.map +1 -0
- package/dist/components/nv-avatar.d.ts +11 -0
- package/dist/components/nv-avatar.js +106 -0
- package/dist/components/nv-avatar.js.map +1 -0
- package/dist/components/nv-badge.d.ts +11 -0
- package/dist/components/nv-badge.js +154 -0
- package/dist/components/nv-badge.js.map +1 -0
- package/dist/components/nv-base.d.ts +11 -0
- package/dist/components/nv-base.js +89 -0
- package/dist/components/nv-base.js.map +1 -0
- package/dist/components/nv-button.d.ts +11 -0
- package/dist/components/nv-button.js +116 -0
- package/dist/components/nv-button.js.map +1 -0
- package/dist/components/nv-col.d.ts +11 -0
- package/dist/components/nv-col.js +57 -0
- package/dist/components/nv-col.js.map +1 -0
- package/dist/components/nv-fieldcheckbox.d.ts +11 -0
- package/dist/components/nv-fieldcheckbox.js +128 -0
- package/dist/components/nv-fieldcheckbox.js.map +1 -0
- package/dist/components/nv-fieldnumber.d.ts +11 -0
- package/dist/components/nv-fieldnumber.js +134 -0
- package/dist/components/nv-fieldnumber.js.map +1 -0
- package/dist/components/nv-fieldpassword.d.ts +11 -0
- package/dist/components/nv-fieldpassword.js +134 -0
- package/dist/components/nv-fieldpassword.js.map +1 -0
- package/dist/components/nv-fieldradio.d.ts +11 -0
- package/dist/components/nv-fieldradio.js +110 -0
- package/dist/components/nv-fieldradio.js.map +1 -0
- package/dist/components/nv-fieldselect.d.ts +11 -0
- package/dist/components/nv-fieldselect.js +332 -0
- package/dist/components/nv-fieldselect.js.map +1 -0
- package/dist/components/nv-fieldtext.d.ts +11 -0
- package/dist/components/nv-fieldtext.js +125 -0
- package/dist/components/nv-fieldtext.js.map +1 -0
- package/dist/components/nv-fieldtextarea.d.ts +11 -0
- package/dist/components/nv-fieldtextarea.js +188 -0
- package/dist/components/nv-fieldtextarea.js.map +1 -0
- package/dist/components/nv-fieldtoggle.d.ts +11 -0
- package/dist/components/nv-fieldtoggle.js +91 -0
- package/dist/components/nv-fieldtoggle.js.map +1 -0
- package/dist/components/nv-icon.d.ts +11 -0
- package/dist/components/nv-icon.js +8 -0
- package/dist/components/nv-icon.js.map +1 -0
- package/dist/components/nv-iconbutton.d.ts +11 -0
- package/dist/components/nv-iconbutton.js +8 -0
- package/dist/components/nv-iconbutton.js.map +1 -0
- package/dist/components/nv-loader.d.ts +11 -0
- package/dist/components/nv-loader.js +8 -0
- package/dist/components/nv-loader.js.map +1 -0
- package/dist/components/nv-menu.d.ts +11 -0
- package/dist/components/nv-menu.js +216 -0
- package/dist/components/nv-menu.js.map +1 -0
- package/dist/components/nv-menuitem.d.ts +11 -0
- package/dist/components/nv-menuitem.js +55 -0
- package/dist/components/nv-menuitem.js.map +1 -0
- package/dist/components/nv-popover.d.ts +11 -0
- package/dist/components/nv-popover.js +8 -0
- package/dist/components/nv-popover.js.map +1 -0
- package/dist/components/nv-row.d.ts +11 -0
- package/dist/components/nv-row.js +38 -0
- package/dist/components/nv-row.js.map +1 -0
- package/dist/components/nv-stack.d.ts +11 -0
- package/dist/components/nv-stack.js +51 -0
- package/dist/components/nv-stack.js.map +1 -0
- package/dist/components/nv-tooltip.d.ts +11 -0
- package/dist/components/nv-tooltip.js +61 -0
- package/dist/components/nv-tooltip.js.map +1 -0
- package/dist/components/p-1daca48a.js +1871 -0
- package/dist/components/p-1daca48a.js.map +1 -0
- package/dist/components/p-42301d8f.js +104 -0
- package/dist/components/p-42301d8f.js.map +1 -0
- package/dist/components/p-50bd2808.js +1198 -0
- package/dist/components/p-50bd2808.js.map +1 -0
- package/dist/components/p-6146d4b0.js +87 -0
- package/dist/components/p-6146d4b0.js.map +1 -0
- package/dist/components/p-632bedb8.js +1730 -0
- package/dist/components/p-632bedb8.js.map +1 -0
- package/dist/components/p-8a1a6e56.js +5 -0
- package/dist/components/p-8a1a6e56.js.map +1 -0
- package/dist/components/p-8da6d9a3.js +43 -0
- package/dist/components/p-8da6d9a3.js.map +1 -0
- package/dist/components/p-a15ddd42.js +138 -0
- package/dist/components/p-a15ddd42.js.map +1 -0
- package/dist/components/p-be79e7bc.js +121 -0
- package/dist/components/p-be79e7bc.js.map +1 -0
- package/dist/components/p-c711fe67.js +2355 -0
- package/dist/components/p-c711fe67.js.map +1 -0
- package/dist/components/p-f5ff676c.js +65 -0
- package/dist/components/p-f5ff676c.js.map +1 -0
- package/dist/docs.d.ts +435 -0
- package/dist/docs.json +9249 -0
- package/dist/esm/app-globals-df0a3c8d.js +9 -0
- package/dist/esm/app-globals-df0a3c8d.js.map +1 -0
- package/dist/esm/clsx-297c1ffe.js +5 -0
- package/dist/esm/clsx-297c1ffe.js.map +1 -0
- package/dist/esm/constants-e9bee611.js +138 -0
- package/dist/esm/constants-e9bee611.js.map +1 -0
- package/dist/esm/fade.animation-2a077983.js +1871 -0
- package/dist/esm/fade.animation-2a077983.js.map +1 -0
- package/dist/esm/grow.animation-88a8ee8f.js +114 -0
- package/dist/esm/grow.animation-88a8ee8f.js.map +1 -0
- package/dist/esm/index-179dfba2.js +1952 -0
- package/dist/esm/index-179dfba2.js.map +1 -0
- package/dist/esm/index.js +487 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/native.js +43 -0
- package/dist/esm/native.js.map +1 -0
- package/dist/esm/nv-alert.entry.js +136 -0
- package/dist/esm/nv-alert.entry.js.map +1 -0
- package/dist/esm/nv-avatar.entry.js +69 -0
- package/dist/esm/nv-avatar.entry.js.map +1 -0
- package/dist/esm/nv-badge.entry.js +115 -0
- package/dist/esm/nv-badge.entry.js.map +1 -0
- package/dist/esm/nv-base.entry.js +71 -0
- package/dist/esm/nv-base.entry.js.map +1 -0
- package/dist/esm/nv-button.entry.js +87 -0
- package/dist/esm/nv-button.entry.js.map +1 -0
- package/dist/esm/nv-col.entry.js +37 -0
- package/dist/esm/nv-col.entry.js.map +1 -0
- package/dist/esm/nv-fieldcheckbox.entry.js +90 -0
- package/dist/esm/nv-fieldcheckbox.entry.js.map +1 -0
- package/dist/esm/nv-fieldnumber.entry.js +90 -0
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -0
- package/dist/esm/nv-fieldpassword.entry.js +75 -0
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -0
- package/dist/esm/nv-fieldradio.entry.js +77 -0
- package/dist/esm/nv-fieldradio.entry.js.map +1 -0
- package/dist/esm/nv-fieldselect.entry.js +286 -0
- package/dist/esm/nv-fieldselect.entry.js.map +1 -0
- package/dist/esm/nv-fieldtext.entry.js +79 -0
- package/dist/esm/nv-fieldtext.entry.js.map +1 -0
- package/dist/esm/nv-fieldtextarea.entry.js +147 -0
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -0
- package/dist/esm/nv-fieldtoggle.entry.js +60 -0
- package/dist/esm/nv-fieldtoggle.entry.js.map +1 -0
- package/dist/esm/nv-icon.entry.js +62 -0
- package/dist/esm/nv-icon.entry.js.map +1 -0
- package/dist/esm/nv-iconbutton.entry.js +88 -0
- package/dist/esm/nv-iconbutton.entry.js.map +1 -0
- package/dist/esm/nv-loader.entry.js +25 -0
- package/dist/esm/nv-loader.entry.js.map +1 -0
- package/dist/esm/nv-menu.entry.js +185 -0
- package/dist/esm/nv-menu.entry.js.map +1 -0
- package/dist/esm/nv-menuitem.entry.js +26 -0
- package/dist/esm/nv-menuitem.entry.js.map +1 -0
- package/dist/esm/nv-popover.entry.js +2323 -0
- package/dist/esm/nv-popover.entry.js.map +1 -0
- package/dist/esm/nv-row.entry.js +20 -0
- package/dist/esm/nv-row.entry.js.map +1 -0
- package/dist/esm/nv-stack.entry.js +27 -0
- package/dist/esm/nv-stack.entry.js.map +1 -0
- package/dist/esm/nv-tooltip.entry.js +33 -0
- package/dist/esm/nv-tooltip.entry.js.map +1 -0
- package/dist/esm/timeline.animation-1b88f052.js +104 -0
- package/dist/esm/timeline.animation-1b88f052.js.map +1 -0
- package/dist/esm/v4-a79185f4.js +65 -0
- package/dist/esm/v4-a79185f4.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/native/fonts/TT_Norms_Pro_Bold.woff2 +0 -0
- package/dist/native/fonts/TT_Norms_Pro_Medium.woff2 +0 -0
- package/dist/native/fonts/TT_Norms_Pro_Mono_Bold.woff2 +0 -0
- package/dist/native/fonts/TT_Norms_Pro_Mono_Medium.woff2 +0 -0
- package/dist/native/fonts/TT_Norms_Pro_Mono_Regular.woff2 +0 -0
- package/dist/native/fonts/TT_Norms_Pro_Regular.woff2 +0 -0
- package/dist/native/index.esm.js +2 -0
- package/dist/native/index.esm.js.map +1 -0
- package/dist/native/native.css +1 -0
- package/dist/native/native.esm.js +2 -0
- package/dist/native/native.esm.js.map +1 -0
- package/dist/native/p-06f64d05.entry.js +2 -0
- package/dist/native/p-06f64d05.entry.js.map +1 -0
- package/dist/native/p-0aa0193b.entry.js +2 -0
- package/dist/native/p-0aa0193b.entry.js.map +1 -0
- package/dist/native/p-124a7067.entry.js +2 -0
- package/dist/native/p-124a7067.entry.js.map +1 -0
- package/dist/native/p-13d0ab5b.entry.js +2 -0
- package/dist/native/p-13d0ab5b.entry.js.map +1 -0
- package/dist/native/p-14c08510.entry.js +2 -0
- package/dist/native/p-14c08510.entry.js.map +1 -0
- package/dist/native/p-1ceee367.entry.js +2 -0
- package/dist/native/p-1ceee367.entry.js.map +1 -0
- package/dist/native/p-1daca48a.js +16 -0
- package/dist/native/p-1daca48a.js.map +1 -0
- package/dist/native/p-29d482cd.entry.js +2 -0
- package/dist/native/p-29d482cd.entry.js.map +1 -0
- package/dist/native/p-42301d8f.js +2 -0
- package/dist/native/p-42301d8f.js.map +1 -0
- package/dist/native/p-43cd42ca.entry.js +2 -0
- package/dist/native/p-43cd42ca.entry.js.map +1 -0
- package/dist/native/p-519e0f59.entry.js +2 -0
- package/dist/native/p-519e0f59.entry.js.map +1 -0
- package/dist/native/p-617d6a09.entry.js +2 -0
- package/dist/native/p-617d6a09.entry.js.map +1 -0
- package/dist/native/p-6f762ec2.entry.js +2 -0
- package/dist/native/p-6f762ec2.entry.js.map +1 -0
- package/dist/native/p-71d6aad8.entry.js +2 -0
- package/dist/native/p-71d6aad8.entry.js.map +1 -0
- package/dist/native/p-7ce1b712.entry.js +2 -0
- package/dist/native/p-7ce1b712.entry.js.map +1 -0
- package/dist/native/p-80788ddf.js +2 -0
- package/dist/native/p-80788ddf.js.map +1 -0
- package/dist/native/p-830ec54a.entry.js +2 -0
- package/dist/native/p-830ec54a.entry.js.map +1 -0
- package/dist/native/p-89accab1.entry.js +2 -0
- package/dist/native/p-89accab1.entry.js.map +1 -0
- package/dist/native/p-8a1a6e56.js +2 -0
- package/dist/native/p-8a1a6e56.js.map +1 -0
- package/dist/native/p-8b65b16f.entry.js +2 -0
- package/dist/native/p-8b65b16f.entry.js.map +1 -0
- package/dist/native/p-a15ddd42.js +2 -0
- package/dist/native/p-a15ddd42.js.map +1 -0
- package/dist/native/p-a37c2ac2.js +2 -0
- package/dist/native/p-a37c2ac2.js.map +1 -0
- package/dist/native/p-b5e4a9e7.entry.js +2 -0
- package/dist/native/p-b5e4a9e7.entry.js.map +1 -0
- package/dist/native/p-b8eb4c31.entry.js +2 -0
- package/dist/native/p-b8eb4c31.entry.js.map +1 -0
- package/dist/native/p-b99aa075.entry.js +2 -0
- package/dist/native/p-b99aa075.entry.js.map +1 -0
- package/dist/native/p-d5a8b6c4.entry.js +2 -0
- package/dist/native/p-d5a8b6c4.entry.js.map +1 -0
- package/dist/native/p-db2a68f3.js +3 -0
- package/dist/native/p-db2a68f3.js.map +1 -0
- package/dist/native/p-f5acea50.entry.js +2 -0
- package/dist/native/p-f5acea50.entry.js.map +1 -0
- package/dist/native/p-f5ff676c.js +2 -0
- package/dist/native/p-f5ff676c.js.map +1 -0
- package/dist/native/p-f9aac71a.entry.js +2 -0
- package/dist/native/p-f9aac71a.entry.js.map +1 -0
- package/dist/native/p-fb6f42b7.entry.js +2 -0
- package/dist/native/p-fb6f42b7.entry.js.map +1 -0
- package/dist/types/animations/collapse.animation.d.ts +11 -0
- package/dist/types/animations/fade.animation.d.ts +11 -0
- package/dist/types/animations/grow.animation.d.ts +15 -0
- package/dist/types/animations/index.d.ts +4 -0
- package/dist/types/animations/timeline.animation.d.ts +18 -0
- package/dist/types/components/nv-alert/nv-alert.d.ts +85 -0
- package/dist/types/components/nv-alert/nv-alert.docs.d.ts +4 -0
- package/dist/types/components/nv-avatar/nv-avatar.d.ts +75 -0
- package/dist/types/components/nv-avatar/nv-avatar.docs.d.ts +4 -0
- package/dist/types/components/nv-badge/nv-badge.d.ts +93 -0
- package/dist/types/components/nv-badge/nv-badge.docs.d.ts +4 -0
- package/dist/types/components/nv-base/nv-base.d.ts +17 -0
- package/dist/types/components/nv-base/nv-base.docs.d.ts +5 -0
- package/dist/types/components/nv-button/nv-button.d.ts +63 -0
- package/dist/types/components/nv-button/nv-button.docs.d.ts +4 -0
- package/dist/types/components/nv-col/nv-col.d.ts +18 -0
- package/dist/types/components/nv-col/nv-col.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldcheckbox/nv-fieldcheckbox.d.ts +119 -0
- package/dist/types/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +132 -0
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldpassword/nv-fieldpassword.d.ts +145 -0
- package/dist/types/components/nv-fieldpassword/nv-fieldpassword.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldradio/nv-fieldradio.d.ts +101 -0
- package/dist/types/components/nv-fieldradio/nv-fieldradio.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldselect/nv-fieldselect.d.ts +195 -0
- package/dist/types/components/nv-fieldselect/nv-fieldselect.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +162 -0
- package/dist/types/components/nv-fieldtext/nv-fieldtext.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +161 -0
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldtoggle/nv-fieldtoggle.d.ts +73 -0
- package/dist/types/components/nv-fieldtoggle/nv-fieldtoggle.docs.d.ts +4 -0
- package/dist/types/components/nv-icon/nv-icon.d.ts +51 -0
- package/dist/types/components/nv-icon/nv-icon.docs.d.ts +4 -0
- package/dist/types/components/nv-icon/nv-icons.d.ts +3 -0
- package/dist/types/components/nv-icon/test/nv-icon.test.d.ts +1 -0
- package/dist/types/components/nv-iconbutton/nv-iconbutton.d.ts +70 -0
- package/dist/types/components/nv-iconbutton/nv-iconbutton.docs.d.ts +4 -0
- package/dist/types/components/nv-loader/nv-loader.d.ts +18 -0
- package/dist/types/components/nv-loader/nv-loader.docs.d.ts +4 -0
- package/dist/types/components/nv-menu/nv-menu.d.ts +60 -0
- package/dist/types/components/nv-menu/nv-menu.docs.d.ts +4 -0
- package/dist/types/components/nv-menuitem/nv-menuitem.d.ts +31 -0
- package/dist/types/components/nv-menuitem/nv-menuitem.docs.d.ts +4 -0
- package/dist/types/components/nv-popover/nv-popover.d.ts +114 -0
- package/dist/types/components/nv-popover/nv-popover.docs.d.ts +4 -0
- package/dist/types/components/nv-row/nv-row.d.ts +7 -0
- package/dist/types/components/nv-row/nv-row.docs.d.ts +4 -0
- package/dist/types/components/nv-stack/nv-stack.d.ts +36 -0
- package/dist/types/components/nv-stack/nv-stack.docs.d.ts +4 -0
- package/dist/types/components/nv-tooltip/nv-tooltip.d.ts +32 -0
- package/dist/types/components/nv-tooltip/nv-tooltip.docs.d.ts +4 -0
- package/dist/types/components.d.ts +2412 -0
- package/dist/types/dev/dev-components.d.ts +2 -0
- package/dist/types/dev/dev-forms.d.ts +2 -0
- package/dist/types/dev/dev-root.d.ts +1 -0
- package/dist/types/dev/dev-utils.d.ts +17 -0
- package/dist/types/global.d.ts +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/nova-docs.d.ts +32 -0
- package/dist/types/stencil-public-runtime.d.ts +1678 -0
- package/dist/types/utils/class.utils.d.ts +6 -0
- package/dist/types/utils/constants.d.ts +112 -0
- package/dist/types/utils/events.utils.d.ts +15 -0
- package/dist/vscode-data.json +3179 -0
- package/hydrate/index.d.ts +242 -0
- package/hydrate/index.js +24827 -0
- package/hydrate/index.mjs +24819 -0
- package/hydrate/package.json +12 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +197 -0
- package/readme.md +67 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @slot trigger - Button to toggle the menu popover.
|
|
4
|
+
* @slot content - Use an <ul></ul> tag for the slot, and place <nv-menuitem> elements inside.
|
|
5
|
+
*/
|
|
6
|
+
export class NvMenu {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.isHandlingKeyDown = false;
|
|
9
|
+
this.isHandlingClick = false;
|
|
10
|
+
this.open = false;
|
|
11
|
+
this.nested = false;
|
|
12
|
+
this.disableCloseOnSelect = false;
|
|
13
|
+
this.placement = this.nested ? 'right-start' : 'bottom-end';
|
|
14
|
+
}
|
|
15
|
+
//#endregion PROPERTIES
|
|
16
|
+
/****************************************************************************/
|
|
17
|
+
//#region METHODS
|
|
18
|
+
/**
|
|
19
|
+
* Opens the menu.
|
|
20
|
+
*/
|
|
21
|
+
async show() {
|
|
22
|
+
this.open = true;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Closes the menu.
|
|
26
|
+
*/
|
|
27
|
+
async close() {
|
|
28
|
+
this.open = false;
|
|
29
|
+
}
|
|
30
|
+
handleMenuItemSelect(menuItem, event) {
|
|
31
|
+
// If the element is disabled, stop propagation
|
|
32
|
+
if (menuItem.hasAttribute('disabled')) {
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Emit the menuitemSelected event for the selected item
|
|
37
|
+
const itemId = menuItem.id;
|
|
38
|
+
if (itemId) {
|
|
39
|
+
this.menuitemSelected.emit({ itemId });
|
|
40
|
+
}
|
|
41
|
+
// Prevent event propagation to avoid multiple triggers
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
if (!this.disableCloseOnSelect) {
|
|
44
|
+
this.open = false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
handleMenuClick(event) {
|
|
48
|
+
if (this.isHandlingClick) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.isHandlingClick = true;
|
|
52
|
+
const target = event.target;
|
|
53
|
+
const menuItem = target.closest('nv-menuitem');
|
|
54
|
+
if (menuItem &&
|
|
55
|
+
menuItem.tagName === 'NV-MENUITEM' &&
|
|
56
|
+
!menuItem.hasAttribute('has-submenu')) {
|
|
57
|
+
this.handleMenuItemSelect(menuItem, event);
|
|
58
|
+
}
|
|
59
|
+
this.isHandlingClick = false;
|
|
60
|
+
}
|
|
61
|
+
handleKeydown(event) {
|
|
62
|
+
if (!this.open)
|
|
63
|
+
return;
|
|
64
|
+
if (this.isHandlingKeyDown) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.isHandlingKeyDown = true;
|
|
68
|
+
if (event.key === 'ArrowDown' ||
|
|
69
|
+
event.key === 'ArrowUp' ||
|
|
70
|
+
event.key === 'ArrowLeft' ||
|
|
71
|
+
event.key === 'ArrowRight' ||
|
|
72
|
+
event.key === 'Escape') {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
}
|
|
75
|
+
if (event.key === 'Escape' && !this.nested) {
|
|
76
|
+
this.close();
|
|
77
|
+
this.triggerElement.focus();
|
|
78
|
+
this.isHandlingKeyDown = false;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (event.key === 'Enter') {
|
|
82
|
+
const activeElement = document.activeElement;
|
|
83
|
+
if (activeElement &&
|
|
84
|
+
activeElement.tagName === 'NV-MENUITEM' &&
|
|
85
|
+
!activeElement.hasAttribute('has-submenu')) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
this.handleMenuItemSelect(activeElement, event);
|
|
88
|
+
}
|
|
89
|
+
this.isHandlingKeyDown = false;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const menuContent = this.el.querySelector('[slot="content"]');
|
|
93
|
+
const menuItems = Array.from(menuContent.childNodes).filter(item => { var _a; return (_a = item.matches) === null || _a === void 0 ? void 0 : _a.call(item, 'nv-menuitem, nv-menu'); });
|
|
94
|
+
let currentIndex = menuItems.indexOf(document.activeElement);
|
|
95
|
+
if (currentIndex === -1)
|
|
96
|
+
currentIndex = menuItems.indexOf(document.activeElement.parentElement);
|
|
97
|
+
if (currentIndex === -1 &&
|
|
98
|
+
menuItems.find(item => item.matches('nv-menu[open]'))) {
|
|
99
|
+
this.isHandlingKeyDown = false;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
103
|
+
menuItems.forEach(item => {
|
|
104
|
+
if (item.matches('nv-menu'))
|
|
105
|
+
item.close();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (event.key === 'ArrowDown') {
|
|
109
|
+
let nextIndex = (currentIndex + 1) % menuItems.length;
|
|
110
|
+
while (menuItems[nextIndex].matches('nv-menuitem[disabled]')) {
|
|
111
|
+
nextIndex = (nextIndex + 1) % menuItems.length;
|
|
112
|
+
}
|
|
113
|
+
const nextFocusable = menuItems[nextIndex];
|
|
114
|
+
if (nextFocusable.matches('nv-menuitem'))
|
|
115
|
+
nextFocusable.focus();
|
|
116
|
+
else if (nextFocusable.matches('nv-menu'))
|
|
117
|
+
nextFocusable.querySelector('nv-menuitem').focus();
|
|
118
|
+
}
|
|
119
|
+
if (event.key === 'ArrowUp') {
|
|
120
|
+
let prevIndex = (currentIndex - 1 + menuItems.length) % menuItems.length;
|
|
121
|
+
while (menuItems[prevIndex].matches('nv-menuitem[disabled]')) {
|
|
122
|
+
prevIndex = (prevIndex - 1 + menuItems.length) % menuItems.length;
|
|
123
|
+
}
|
|
124
|
+
const prevFocusable = menuItems[prevIndex];
|
|
125
|
+
if (prevFocusable.matches('nv-menuitem'))
|
|
126
|
+
prevFocusable.focus();
|
|
127
|
+
else if (prevFocusable.matches('nv-menu'))
|
|
128
|
+
prevFocusable.querySelector('nv-menuitem').focus();
|
|
129
|
+
}
|
|
130
|
+
if (event.key === 'ArrowRight') {
|
|
131
|
+
const submenu = menuItems[currentIndex];
|
|
132
|
+
if (!submenu.matches('nv-menu')) {
|
|
133
|
+
this.isHandlingKeyDown = false;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
submenu.show();
|
|
137
|
+
}
|
|
138
|
+
if (event.key === 'ArrowLeft' && this.nested) {
|
|
139
|
+
if (menuItems.find(item => item.matches('nv-menu[open]'))) {
|
|
140
|
+
this.isHandlingKeyDown = false;
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this.close();
|
|
144
|
+
this.triggerElement.focus();
|
|
145
|
+
}
|
|
146
|
+
this.isHandlingKeyDown = false;
|
|
147
|
+
}
|
|
148
|
+
handleOpenChanged(event) {
|
|
149
|
+
if (event.target === this.el.querySelector('nv-popover')) {
|
|
150
|
+
this.open = event.detail;
|
|
151
|
+
}
|
|
152
|
+
const triggerHasFocus = this.triggerElement === document.activeElement;
|
|
153
|
+
const triggerHasFocusVisible = this.triggerElement.matches(':focus-visible');
|
|
154
|
+
if (triggerHasFocus && triggerHasFocusVisible)
|
|
155
|
+
this.focusFirstItem();
|
|
156
|
+
}
|
|
157
|
+
focusFirstItem() {
|
|
158
|
+
const firstButton = this.popoverElement.querySelector('nv-menuitem');
|
|
159
|
+
if (firstButton) {
|
|
160
|
+
requestAnimationFrame(() => firstButton.focus());
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
//#endregion EVENTS
|
|
164
|
+
/****************************************************************************/
|
|
165
|
+
//#region LIFECYCLE
|
|
166
|
+
componentWillLoad() {
|
|
167
|
+
this.triggerElement = Array.from(this.el.children).find(child => {
|
|
168
|
+
return child.getAttribute('slot') === 'trigger';
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
//#endregion LIFECYCLE
|
|
172
|
+
/****************************************************************************/
|
|
173
|
+
//#region RENDER
|
|
174
|
+
render() {
|
|
175
|
+
return (h(Host, { key: '5a3a0645d952724b5c2ddd1f2578201568bf827b' }, h("slot", { key: '65506a9b7035ef645daa87079339ad7e7cd76377', name: "trigger" }), h("nv-popover", { key: 'f5998e3d878671d09ea684de2a54bca504513f48', ref: el => (this.popoverElement = el), triggerMode: "click", triggerElement: this.triggerElement, placement: this.placement, nested: this.nested, open: this.open }, h("slot", { key: '267e0e587177bdb8b6ce9b10f36c43158547d5b2', name: "content" }))));
|
|
176
|
+
}
|
|
177
|
+
static get is() { return "nv-menu"; }
|
|
178
|
+
static get originalStyleUrls() {
|
|
179
|
+
return {
|
|
180
|
+
"$": ["nv-menu.scss"]
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
static get styleUrls() {
|
|
184
|
+
return {
|
|
185
|
+
"$": ["nv-menu.css"]
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
static get properties() {
|
|
189
|
+
return {
|
|
190
|
+
"open": {
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"mutable": true,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "boolean",
|
|
195
|
+
"resolved": "boolean",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "Use this to toggle the initial visibility of the menu, by default the menu\nis hidden."
|
|
203
|
+
},
|
|
204
|
+
"attribute": "open",
|
|
205
|
+
"reflect": true,
|
|
206
|
+
"defaultValue": "false"
|
|
207
|
+
},
|
|
208
|
+
"nested": {
|
|
209
|
+
"type": "boolean",
|
|
210
|
+
"mutable": false,
|
|
211
|
+
"complexType": {
|
|
212
|
+
"original": "boolean",
|
|
213
|
+
"resolved": "boolean",
|
|
214
|
+
"references": {}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [],
|
|
220
|
+
"text": "Use this if the menu is nested inside another menu. This will prevent the\nparent menu from closing when the child menu is opened."
|
|
221
|
+
},
|
|
222
|
+
"attribute": "nested",
|
|
223
|
+
"reflect": false,
|
|
224
|
+
"defaultValue": "false"
|
|
225
|
+
},
|
|
226
|
+
"disableCloseOnSelect": {
|
|
227
|
+
"type": "boolean",
|
|
228
|
+
"mutable": false,
|
|
229
|
+
"complexType": {
|
|
230
|
+
"original": "boolean",
|
|
231
|
+
"resolved": "boolean",
|
|
232
|
+
"references": {}
|
|
233
|
+
},
|
|
234
|
+
"required": false,
|
|
235
|
+
"optional": false,
|
|
236
|
+
"docs": {
|
|
237
|
+
"tags": [],
|
|
238
|
+
"text": "Use this to disable the menu from closing automatically when a menu item is\nselected."
|
|
239
|
+
},
|
|
240
|
+
"attribute": "disable-close-on-select",
|
|
241
|
+
"reflect": false,
|
|
242
|
+
"defaultValue": "false"
|
|
243
|
+
},
|
|
244
|
+
"placement": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"mutable": false,
|
|
247
|
+
"complexType": {
|
|
248
|
+
"original": "Placement",
|
|
249
|
+
"resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
250
|
+
"references": {
|
|
251
|
+
"Placement": {
|
|
252
|
+
"location": "import",
|
|
253
|
+
"path": "@floating-ui/dom",
|
|
254
|
+
"id": "../../node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"required": false,
|
|
259
|
+
"optional": false,
|
|
260
|
+
"docs": {
|
|
261
|
+
"tags": [],
|
|
262
|
+
"text": "Decides where the menu shows up next to the button it\u2019s linked to (above,\nbelow, to the sides). If there isn\u2019t enough room, it will adjust its\nposition on the axis to fit on the screen, so users can always see it."
|
|
263
|
+
},
|
|
264
|
+
"attribute": "placement",
|
|
265
|
+
"reflect": false,
|
|
266
|
+
"defaultValue": "this.nested ? 'right-start' : 'bottom-end'"
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
static get events() {
|
|
271
|
+
return [{
|
|
272
|
+
"method": "menuitemSelected",
|
|
273
|
+
"name": "menuitemSelected",
|
|
274
|
+
"bubbles": true,
|
|
275
|
+
"cancelable": true,
|
|
276
|
+
"composed": true,
|
|
277
|
+
"docs": {
|
|
278
|
+
"tags": [],
|
|
279
|
+
"text": "Emitted from nv-menuitem elements with the corresponding id when the menu\nitem is selected."
|
|
280
|
+
},
|
|
281
|
+
"complexType": {
|
|
282
|
+
"original": "MenuitemSelectedEventDetail",
|
|
283
|
+
"resolved": "{ itemId?: string; }",
|
|
284
|
+
"references": {
|
|
285
|
+
"MenuitemSelectedEventDetail": {
|
|
286
|
+
"location": "import",
|
|
287
|
+
"path": "../nv-menuitem/nv-menuitem",
|
|
288
|
+
"id": "src/components/nv-menuitem/nv-menuitem.tsx::MenuitemSelectedEventDetail"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}];
|
|
293
|
+
}
|
|
294
|
+
static get methods() {
|
|
295
|
+
return {
|
|
296
|
+
"show": {
|
|
297
|
+
"complexType": {
|
|
298
|
+
"signature": "() => Promise<void>",
|
|
299
|
+
"parameters": [],
|
|
300
|
+
"references": {
|
|
301
|
+
"Promise": {
|
|
302
|
+
"location": "global",
|
|
303
|
+
"id": "global::Promise"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"return": "Promise<void>"
|
|
307
|
+
},
|
|
308
|
+
"docs": {
|
|
309
|
+
"text": "Opens the menu.",
|
|
310
|
+
"tags": []
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"close": {
|
|
314
|
+
"complexType": {
|
|
315
|
+
"signature": "() => Promise<void>",
|
|
316
|
+
"parameters": [],
|
|
317
|
+
"references": {
|
|
318
|
+
"Promise": {
|
|
319
|
+
"location": "global",
|
|
320
|
+
"id": "global::Promise"
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"return": "Promise<void>"
|
|
324
|
+
},
|
|
325
|
+
"docs": {
|
|
326
|
+
"text": "Closes the menu.",
|
|
327
|
+
"tags": []
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
static get elementRef() { return "el"; }
|
|
333
|
+
static get listeners() {
|
|
334
|
+
return [{
|
|
335
|
+
"name": "click",
|
|
336
|
+
"method": "handleMenuClick",
|
|
337
|
+
"target": undefined,
|
|
338
|
+
"capture": true,
|
|
339
|
+
"passive": false
|
|
340
|
+
}, {
|
|
341
|
+
"name": "keydown",
|
|
342
|
+
"method": "handleKeydown",
|
|
343
|
+
"target": undefined,
|
|
344
|
+
"capture": false,
|
|
345
|
+
"passive": false
|
|
346
|
+
}, {
|
|
347
|
+
"name": "openChanged",
|
|
348
|
+
"method": "handleOpenChanged",
|
|
349
|
+
"target": undefined,
|
|
350
|
+
"capture": false,
|
|
351
|
+
"passive": false
|
|
352
|
+
}];
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=nv-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nv-menu.js","sourceRoot":"","sources":["../../../src/components/nv-menu/nv-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,MAAM,EACN,KAAK,EAEL,MAAM,GACP,MAAM,eAAe,CAAC;AAIvB;;;GAGG;AAMH,MAAM,OAAO,MAAM;;QAIT,sBAAiB,GAAY,KAAK,CAAC;QACnC,oBAAe,GAAY,KAAK,CAAC;oBAUzB,KAAK;sBAOM,KAAK;oCAOS,KAAK;yBAQd,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY;;IAE1E,uBAAuB;IACvB,8EAA8E;IAC9E,iBAAiB;IAEjB;;OAEG;IAEH,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAaO,oBAAoB,CAAC,QAAqB,EAAE,KAAY;QAC9D,+CAA+C;QAC/C,IAAI,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;YACtC,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QAED,wDAAwD;QACxD,MAAM,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC;QAC3B,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,uDAAuD;QACvD,KAAK,CAAC,eAAe,EAAE,CAAC;QAExB,IAAI,CAAC,IAAI,C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element,\n Prop,\n Listen,\n Event,\n EventEmitter,\n Method,\n} from '@stencil/core';\nimport type { Placement } from '@floating-ui/dom';\nimport type { MenuitemSelectedEventDetail } from '../nv-menuitem/nv-menuitem';\n\n/**\n * @slot trigger - Button to toggle the menu popover.\n * @slot content - Use an <ul></ul> tag for the slot, and place <nv-menuitem> elements inside.\n */\n@Component({\n tag: 'nv-menu',\n styleUrl: 'nv-menu.scss',\n shadow: false,\n})\nexport class NvMenu {\n @Element() el: HTMLNvMenuElement;\n private triggerElement!: HTMLElement;\n private popoverElement!: HTMLNvPopoverElement;\n private isHandlingKeyDown: boolean = false;\n private isHandlingClick: boolean = false;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Use this to toggle the initial visibility of the menu, by default the menu\n * is hidden.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * Use this if the menu is nested inside another menu. This will prevent the\n * parent menu from closing when the child menu is opened.\n */\n @Prop()\n readonly nested: boolean = false;\n\n /**\n * Use this to disable the menu from closing automatically when a menu item is\n * selected.\n */\n @Prop()\n readonly disableCloseOnSelect: boolean = false;\n\n /**\n * Decides where the menu shows up next to the button it’s linked to (above,\n * below, to the sides). If there isn’t enough room, it will adjust its\n * position on the axis to fit on the screen, so users can always see it.\n */\n @Prop()\n readonly placement: Placement = this.nested ? 'right-start' : 'bottom-end';\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Opens the menu.\n */\n @Method()\n async show() {\n this.open = true;\n }\n\n /**\n * Closes the menu.\n */\n @Method()\n async close() {\n this.open = false;\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted from nv-menuitem elements with the corresponding id when the menu\n * item is selected.\n */\n @Event()\n menuitemSelected: EventEmitter<MenuitemSelectedEventDetail>;\n\n private handleMenuItemSelect(menuItem: HTMLElement, event: Event) {\n // If the element is disabled, stop propagation\n if (menuItem.hasAttribute('disabled')) {\n event.stopPropagation();\n return;\n }\n\n // Emit the menuitemSelected event for the selected item\n const itemId = menuItem.id;\n if (itemId) {\n this.menuitemSelected.emit({ itemId });\n }\n\n // Prevent event propagation to avoid multiple triggers\n event.stopPropagation();\n\n if (!this.disableCloseOnSelect) {\n this.open = false;\n }\n }\n\n @Listen('click', { capture: true })\n handleMenuClick(event: MouseEvent) {\n if (this.isHandlingClick) {\n return;\n }\n this.isHandlingClick = true;\n\n const target = event.target as HTMLElement;\n const menuItem = target.closest('nv-menuitem');\n if (\n menuItem &&\n menuItem.tagName === 'NV-MENUITEM' &&\n !menuItem.hasAttribute('has-submenu')\n ) {\n this.handleMenuItemSelect(menuItem, event);\n }\n\n this.isHandlingClick = false;\n }\n\n @Listen('keydown', { passive: false })\n handleKeydown(event: KeyboardEvent) {\n if (!this.open) return;\n\n if (this.isHandlingKeyDown) {\n return;\n }\n this.isHandlingKeyDown = true;\n\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' ||\n event.key === 'Escape'\n ) {\n event.preventDefault();\n }\n\n if (event.key === 'Escape' && !this.nested) {\n this.close();\n this.triggerElement.focus();\n this.isHandlingKeyDown = false;\n return;\n }\n\n if (event.key === 'Enter') {\n const activeElement = document.activeElement as HTMLNvMenuitemElement;\n if (\n activeElement &&\n activeElement.tagName === 'NV-MENUITEM' &&\n !activeElement.hasAttribute('has-submenu')\n ) {\n event.preventDefault();\n this.handleMenuItemSelect(activeElement, event);\n }\n this.isHandlingKeyDown = false;\n return;\n }\n\n const menuContent = this.el.querySelector('[slot=\"content\"]');\n const menuItems = (\n Array.from(menuContent.childNodes) as Array<\n HTMLNvMenuitemElement | HTMLNvMenuElement\n >\n ).filter(item => item.matches?.('nv-menuitem, nv-menu'));\n\n let currentIndex = menuItems.indexOf(\n document.activeElement as HTMLNvMenuitemElement,\n );\n if (currentIndex === -1)\n currentIndex = menuItems.indexOf(\n document.activeElement.parentElement as HTMLNvMenuitemElement,\n );\n if (\n currentIndex === -1 &&\n menuItems.find(item => item.matches('nv-menu[open]'))\n ) {\n this.isHandlingKeyDown = false;\n return;\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n menuItems.forEach(item => {\n if (item.matches('nv-menu')) (item as HTMLNvMenuElement).close();\n });\n }\n\n if (event.key === 'ArrowDown') {\n let nextIndex = (currentIndex + 1) % menuItems.length;\n while (menuItems[nextIndex].matches('nv-menuitem[disabled]')) {\n nextIndex = (nextIndex + 1) % menuItems.length;\n }\n const nextFocusable = menuItems[nextIndex];\n if (nextFocusable.matches('nv-menuitem')) nextFocusable.focus();\n else if (nextFocusable.matches('nv-menu'))\n nextFocusable.querySelector('nv-menuitem').focus();\n }\n\n if (event.key === 'ArrowUp') {\n let prevIndex = (currentIndex - 1 + menuItems.length) % menuItems.length;\n while (menuItems[prevIndex].matches('nv-menuitem[disabled]')) {\n prevIndex = (prevIndex - 1 + menuItems.length) % menuItems.length;\n }\n const prevFocusable = menuItems[prevIndex];\n if (prevFocusable.matches('nv-menuitem')) prevFocusable.focus();\n else if (prevFocusable.matches('nv-menu'))\n prevFocusable.querySelector('nv-menuitem').focus();\n }\n\n if (event.key === 'ArrowRight') {\n const submenu = menuItems[currentIndex];\n if (!submenu.matches('nv-menu')) {\n this.isHandlingKeyDown = false;\n return;\n }\n\n (submenu as HTMLNvMenuElement).show();\n }\n\n if (event.key === 'ArrowLeft' && this.nested) {\n if (menuItems.find(item => item.matches('nv-menu[open]'))) {\n this.isHandlingKeyDown = false;\n return;\n }\n this.close();\n this.triggerElement.focus();\n }\n\n this.isHandlingKeyDown = false;\n }\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n if (event.target === this.el.querySelector('nv-popover')) {\n this.open = event.detail;\n }\n\n const triggerHasFocus = this.triggerElement === document.activeElement;\n const triggerHasFocusVisible =\n this.triggerElement.matches(':focus-visible');\n\n if (triggerHasFocus && triggerHasFocusVisible) this.focusFirstItem();\n }\n\n private focusFirstItem() {\n const firstButton = this.popoverElement.querySelector('nv-menuitem');\n if (firstButton) {\n requestAnimationFrame(() => firstButton.focus());\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.triggerElement = Array.from(this.el.children).find(child => {\n return child.getAttribute('slot') === 'trigger';\n }) as HTMLElement;\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n <slot name=\"trigger\"></slot>\n\n <nv-popover\n ref={el => (this.popoverElement = el)}\n triggerMode=\"click\"\n triggerElement={this.triggerElement}\n placement={this.placement}\n nested={this.nested}\n open={this.open}\n >\n <slot name=\"content\"></slot>\n </nv-popover>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
nv-menuitem {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
max-width: 300px;
|
|
5
|
+
width: 100vw;
|
|
6
|
+
font-size: var(--menu-contextual-item-font-size);
|
|
7
|
+
font-weight: var(--menu-contextual-item-font-weight);
|
|
8
|
+
color: var(--components-menu-contextual-item-content);
|
|
9
|
+
border-radius: var(--menu-contextual-item-radius);
|
|
10
|
+
gap: var(--menu-contextual-item-gap-x);
|
|
11
|
+
padding: var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);
|
|
12
|
+
transition: background-color 150ms ease-out;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
nv-menuitem:hover, nv-menuitem:focus, nv-menuitem:focus-within {
|
|
16
|
+
background-color: var(--components-menu-contextual-item-background-hover);
|
|
17
|
+
color: var(--components-menu-contextual-item-content-hover);
|
|
18
|
+
}
|
|
19
|
+
nv-menuitem kbd {
|
|
20
|
+
color: var(--components-menu-contextual-item-shortcut);
|
|
21
|
+
}
|
|
22
|
+
nv-menuitem [data-scope=text] {
|
|
23
|
+
margin-right: auto;
|
|
24
|
+
}
|
|
25
|
+
nv-menuitem[disabled]:not([disabled=false]) {
|
|
26
|
+
cursor: unset;
|
|
27
|
+
background-color: unset;
|
|
28
|
+
color: var(--components-menu-contextual-item-content-disabled);
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nv-menuitem.docs.js","sourceRoot":"","sources":["../../../src/components/nv-menuitem/nv-menuitem.docs.tsx"],"names":[],"mappings":"AAGA,MAAM,cAAc,GAAoC;IACtD,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { NovaDocs } from '../../nova-docs';\nimport { Components } from '../../components';\n\nconst NvMenuitemDocs: NovaDocs<Components.NvMenuitem> = {\n component: 'nv-menuitem',\n skip: true,\n};\n\nexport default NvMenuitemDocs;\n"]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @slot default - The content to render, usually just text
|
|
4
|
+
*/
|
|
5
|
+
export class NvMenuitem {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.icon = undefined;
|
|
8
|
+
this.disabled = false;
|
|
9
|
+
this.shortcut = undefined;
|
|
10
|
+
this.hasSubmenu = false;
|
|
11
|
+
}
|
|
12
|
+
//#endregion PROPERTIES
|
|
13
|
+
/****************************************************************************/
|
|
14
|
+
//#region RENDER
|
|
15
|
+
render() {
|
|
16
|
+
return (h(Host, { key: '45f0235ad70e94c32498584b38da8528b76e7986', role: "menuitem", tabindex: this.disabled ? '-1' : '0' }, this.icon && h("nv-icon", { key: 'fb70b1d5249b850dc69fd777f75f17dec6d65a43', name: this.icon }), h("span", { key: '7d66467d43ee486a187b6da0559d28fe4db1aa8b', "data-scope": "text" }, h("slot", { key: '1525c465235670b1396a74d53244f54b6e8b400d' })), this.shortcut && !this.hasSubmenu && h("kbd", { key: 'cfc92cdc9ea84dec4494a4aab43f98fa1f92f2e7' }, this.shortcut), this.hasSubmenu && h("nv-icon", { key: '1002e887cc7a41858e36c1499aebe85cd320af2d', name: "chevron-right" })));
|
|
17
|
+
}
|
|
18
|
+
static get is() { return "nv-menuitem"; }
|
|
19
|
+
static get originalStyleUrls() {
|
|
20
|
+
return {
|
|
21
|
+
"$": ["nv-menuitem.scss"]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static get styleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["nv-menuitem.css"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get properties() {
|
|
30
|
+
return {
|
|
31
|
+
"icon": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"mutable": false,
|
|
34
|
+
"complexType": {
|
|
35
|
+
"original": "`${IconName}`",
|
|
36
|
+
"resolved": "\"home\" | \"photo\" | \"access-point-off\" | \"access-point\" | \"accessible\" | \"activity\" | \"address-book\" | \"adjustments-horizontal\" | \"adjustments-up\" | \"adjustments\" | \"affiliate\" | \"air-conditioning\" | \"alert-circle\" | \"align-center\" | \"align-left\" | \"align-right\" | \"app-window\" | \"apps\" | \"archive\" | \"areas\" | \"arrow-back-up\" | \"arrow-back\" | \"arrow-down-left\" | \"arrow-down-right\" | \"arrow-down\" | \"arrow-forward-up\" | \"arrow-forward\" | \"arrow-left\" | \"arrow-right\" | \"arrow-up-left\" | \"arrow-up-right\" | \"arrow-up\" | \"arrows-move\" | \"aspect-ratio\" | \"atom\" | \"basket\" | \"battery-1\" | \"battery-2\" | \"battery-3\" | \"battery-4\" | \"battery-automotive\" | \"battery-charging\" | \"battery-eco\" | \"battery-off\" | \"battery\" | \"bell-off\" | \"bell-ringing\" | \"bell\" | \"bike\" | \"bluetooth-connected\" | \"bluetooth-off\" | \"bluetooth\" | \"bolt\" | \"book\" | \"bookmark-off\" | \"bookmark\" | \"bookmarks\" | \"box-align-top\" | \"box-multiple\" | \"briefcase\" | \"brightness-down\" | \"brightness-up\" | \"browser-check\" | \"browser-plus\" | \"browser-x\" | \"browser\" | \"brush\" | \"building-bank\" | \"building-factory\" | \"building-lighthouse\" | \"building-store\" | \"building\" | \"bulb-off\" | \"bulb\" | \"cake\" | \"calendar-time\" | \"calendar\" | \"camera-off\" | \"camera\" | \"car-crane\" | \"car\" | \"caravan\" | \"cash-banknote\" | \"cash\" | \"cast\" | \"cell\" | \"charging-pile\" | \"chart-arcs\" | \"chart-area-line\" | \"chart-area\" | \"chart-arrows-vertical\" | \"chart-arrows\" | \"chart-bar\" | \"chart-bubble\" | \"chart-circles\" | \"chart-donut\" | \"chart-dots\" | \"chart-line\" | \"chart-pie\" | \"chart-radar\" | \"check\" | \"checkbox\" | \"checklist\" | \"checks\" | \"chevron-down\" | \"chevron-left\" | \"chevron-right\" | \"chevron-top\" | \"circle-caret-right\" | \"circle-check\" | \"circle-x\" | \"clipboard-check\" | \"clipboard-list\" | \"clipboard-plus\" | \"clipboard-text\" | \"clipboard-x\" | \"clipboard\" | \"clock-edit\" | \"clock\" | \"cloud-data-connection\" | \"cloud-download\" | \"cloud-rain\" | \"cloud-snow\" | \"cloud-upload\" | \"cloud\" | \"color-picker\" | \"color-swatch\" | \"compass\" | \"contract\" | \"copy\" | \"cpu\" | \"crane\" | \"credit-card\" | \"crop\" | \"cross\" | \"crown\" | \"currency-bitcoin\" | \"currency-dollar\" | \"currency-ethereum\" | \"currency-euro\" | \"cut\" | \"dashboard\" | \"database\" | \"device-desktop\" | \"device-floppy\" | \"device-gamepad\" | \"device-laptop\" | \"device-mobile-rotated\" | \"device-mobile\" | \"device-tablet\" | \"device-watch\" | \"devices\" | \"dialpad\" | \"direction-horizontal\" | \"direction-sign\" | \"direction\" | \"discount\" | \"door-enter\" | \"dots-vertical\" | \"dots\" | \"download\" | \"drone\" | \"droplet-filled\" | \"droplet-half\" | \"droplet\" | \"droplets\" | \"edit\" | \"engine\" | \"external-link\" | \"eye-off\" | \"eye\" | \"face-id\" | \"feather\" | \"file-alert\" | \"file-analytics\" | \"file-check\" | \"file-code\" | \"file-download\" | \"file-export\" | \"file-horizontal\" | \"file-import\" | \"file-plus\" | \"file-search\" | \"file-text-bookmark\" | \"file-text\" | \"file-type-bmp\" | \"file-type-css\" | \"file-type-csv\" | \"file-type-doc\" | \"file-type-html\" | \"file-type-jpg\" | \"file-type-js\" | \"file-type-pdf\" | \"file-type-png\" | \"file-type-ppt\" | \"file-type-xls\" | \"file-type-xml\" | \"file-type-zip\" | \"file-upload\" | \"file-x\" | \"file-zip\" | \"file\" | \"files-off\" | \"files\" | \"filter-off\" | \"filter\" | \"fingerprint\" | \"fire-extinguisher\" | \"flag\" | \"flame\" | \"flip-horizontal\" | \"flip-vertical\" | \"folder-minus\" | \"folder-off\" | \"folder-plus\" | \"folder-x\" | \"folder\" | \"folders\" | \"frame\" | \"gas-station\" | \"gauge\" | \"gift\" | \"gps\" | \"grid-dots\" | \"grip-horizontal\" | \"grip-vertical\" | \"hand-stop\" | \"hand-waving\" | \"hash\" | \"haze\" | \"headphones-off\" | \"headphones\" | \"headset\" | \"helicopter\" | \"help\" | \"history\" | \"hourglass-empty\" | \"hourglass-high\" | \"hourglass-low\" | \"hourglass-off\" | \"hourglass\" | \"inbox\" | \"info-circle\" | \"keyboard-hide\" | \"keyboard-show\" | \"keyboard\" | \"layout-board-split\" | \"layout-dashboard\" | \"layout-grid\" | \"layout-sidebar-left-collapse\" | \"layout-sidebar-left-expand\" | \"layout-sidebar-right-collapse\" | \"layout-sidebar-right-expand\" | \"layout\" | \"leaf\" | \"lifebuoy\" | \"link\" | \"list-search\" | \"list\" | \"loader\" | \"location\" | \"lock-off\" | \"lock-open\" | \"lock\" | \"login\" | \"logout\" | \"mail-forward\" | \"mail-opened\" | \"mail\" | \"map-pin-off\" | \"map-pin\" | \"map\" | \"menu\" | \"message-dots\" | \"message-off\" | \"message\" | \"messages\" | \"microphone-off\" | \"microphone\" | \"minus\" | \"mist\" | \"moon\" | \"motorbike\" | \"mouse\" | \"movie\" | \"network\" | \"news\" | \"note\" | \"notebook\" | \"notes\" | \"offshore-station\" | \"package\" | \"palette\" | \"paperclip\" | \"pencil\" | \"phone-call\" | \"phone-calling\" | \"phone-check\" | \"phone-incoming\" | \"phone-off\" | \"phone-outgoing\" | \"phone\" | \"photo-off\" | \"pig\" | \"pin\" | \"pinned-off\" | \"pinned\" | \"plane-off\" | \"plane\" | \"plant\" | \"player-pause\" | \"player-play\" | \"player-skip-back\" | \"player-skip-forward\" | \"player-track-next\" | \"player-track-prev\" | \"plug-connected\" | \"plug\" | \"plus\" | \"power-ac\" | \"power-dc\" | \"power\" | \"presentation-analytics\" | \"presentation\" | \"printer\" | \"propeller\" | \"puzzle-2\" | \"puzzle\" | \"pylon\" | \"qrcode\" | \"radar\" | \"radio\" | \"radioactive\" | \"receipt-dollar\" | \"receipt-euro\" | \"receipt\" | \"recharging\" | \"recycle\" | \"refresh-alert\" | \"refresh\" | \"repeat-once\" | \"repeat\" | \"replace\" | \"report-analytics\" | \"report-medical\" | \"report-search\" | \"report\" | \"ripple\" | \"rocket\" | \"rotate-2\" | \"rotate-clockwise-2\" | \"rotate-clockwise\" | \"rotate-dot\" | \"rotate\" | \"router\" | \"ruler-measure\" | \"satellite\" | \"scale\" | \"school\" | \"scissors\" | \"scooter-electric\" | \"screenshot\" | \"search\" | \"seeding\" | \"select\" | \"selector\" | \"send\" | \"server\" | \"settings\" | \"shape\" | \"share-2\" | \"share\" | \"shield-check\" | \"shield-lock\" | \"shield-off\" | \"shield-x\" | \"shield\" | \"ship\" | \"shopping-cart\" | \"slash\" | \"smart-home\" | \"snowflake\" | \"solar-panel\" | \"sort-ascending-letters\" | \"sort-ascending-numbers\" | \"sort-descending-letters\" | \"sort-descending-numbers\" | \"spacing-horizontal\" | \"spacing-vertical\" | \"speakerphone\" | \"stack\" | \"star\" | \"sun\" | \"sunrise\" | \"sunset\" | \"switch-horizontal\" | \"switch-vertical\" | \"table\" | \"tag\" | \"temperature\" | \"template\" | \"terminal\" | \"text-size\" | \"text\" | \"thumb-down\" | \"thumb-up\" | \"ticket\" | \"timeline\" | \"tir\" | \"tool\" | \"tools\" | \"train\" | \"trash-off\" | \"trash\" | \"tree\" | \"trees\" | \"truck-delivery\" | \"truck\" | \"umbrella\" | \"unlink\" | \"upload\" | \"user-circle\" | \"user-minus\" | \"user-plus\" | \"user\" | \"users\" | \"versions\" | \"video-minus\" | \"video-off\" | \"video-plus\" | \"video\" | \"volume-2\" | \"volume-3\" | \"volume\" | \"wallet\" | \"wand\" | \"waves\" | \"wifi-off\" | \"wifi\" | \"wind-direction\" | \"wind\" | \"windmill\" | \"wood\" | \"world\" | \"writing\" | \"x\"",
|
|
37
|
+
"references": {
|
|
38
|
+
"IconName": {
|
|
39
|
+
"location": "import",
|
|
40
|
+
"path": "../nv-icon/nv-icons",
|
|
41
|
+
"id": "src/components/nv-icon/nv-icons.ts::IconName"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": false,
|
|
46
|
+
"optional": false,
|
|
47
|
+
"docs": {
|
|
48
|
+
"tags": [],
|
|
49
|
+
"text": "Choose the icon you want to display. This also sets the aria-label for\nimproved accessibility, helping users who rely on screen readers.\nThe icon is not displayed when the button is loading."
|
|
50
|
+
},
|
|
51
|
+
"attribute": "icon",
|
|
52
|
+
"reflect": true
|
|
53
|
+
},
|
|
54
|
+
"disabled": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "boolean",
|
|
59
|
+
"resolved": "boolean",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": "Disables the item, preventing user interaction."
|
|
67
|
+
},
|
|
68
|
+
"attribute": "disabled",
|
|
69
|
+
"reflect": true,
|
|
70
|
+
"defaultValue": "false"
|
|
71
|
+
},
|
|
72
|
+
"shortcut": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "string",
|
|
77
|
+
"resolved": "string",
|
|
78
|
+
"references": {}
|
|
79
|
+
},
|
|
80
|
+
"required": false,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": "Show a shortcut key for the action represented in the menu item."
|
|
85
|
+
},
|
|
86
|
+
"attribute": "shortcut",
|
|
87
|
+
"reflect": true
|
|
88
|
+
},
|
|
89
|
+
"hasSubmenu": {
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "boolean",
|
|
94
|
+
"resolved": "boolean",
|
|
95
|
+
"references": {}
|
|
96
|
+
},
|
|
97
|
+
"required": false,
|
|
98
|
+
"optional": false,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": "If the menu item has a submenu, the a caret icon will be displayed."
|
|
102
|
+
},
|
|
103
|
+
"attribute": "has-submenu",
|
|
104
|
+
"reflect": true,
|
|
105
|
+
"defaultValue": "false"
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
static get elementRef() { return "el"; }
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=nv-menuitem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nv-menuitem.js","sourceRoot":"","sources":["../../../src/components/nv-menuitem/nv-menuitem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAMlE;;GAEG;AAMH,MAAM,OAAO,UAAU;;;wBAiBQ,KAAK;;0BAYH,KAAK;;IAEpC,uBAAuB;IACvB,8EAA8E;IAC9E,gBAAgB;IAEhB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,UAAU,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG;YACvD,IAAI,CAAC,IAAI,IAAI,gEAAS,IAAI,EAAE,IAAI,CAAC,IAAI,GAAY;YAClD,2EAAiB,MAAM;gBACrB,8DAAa,CACR;YACN,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,8DAAM,IAAI,CAAC,QAAQ,CAAO;YAC/D,IAAI,CAAC,UAAU,IAAI,gEAAS,IAAI,EAAC,eAAe,GAAW,CACvD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import { Component, Host, h, Prop, Element } from '@stencil/core';\n\nimport { IconName } from '../nv-icon/nv-icons';\n\nexport type MenuitemSelectedEventDetail = { itemId?: HTMLElement['id'] };\n\n/**\n * @slot default - The content to render, usually just text\n */\n@Component({\n tag: 'nv-menuitem',\n styleUrl: 'nv-menuitem.scss',\n shadow: false,\n})\nexport class NvMenuitem {\n @Element() el: HTMLNvMenuitemElement;\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Choose the icon you want to display. This also sets the aria-label for\n * improved accessibility, helping users who rely on screen readers.\n * The icon is not displayed when the button is loading.\n */\n @Prop({ reflect: true })\n readonly icon: `${IconName}`;\n\n /**\n * Disables the item, preventing user interaction.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Show a shortcut key for the action represented in the menu item.\n */\n @Prop({ reflect: true })\n readonly shortcut: string;\n\n /**\n * If the menu item has a submenu, the a caret icon will be displayed.\n */\n @Prop({ reflect: true })\n readonly hasSubmenu: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"menuitem\" tabindex={this.disabled ? '-1' : '0'}>\n {this.icon && <nv-icon name={this.icon}></nv-icon>}\n <span data-scope=\"text\">\n <slot></slot>\n </span>\n {this.shortcut && !this.hasSubmenu && <kbd>{this.shortcut}</kbd>}\n {this.hasSubmenu && <nv-icon name=\"chevron-right\"></nv-icon>}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
nv-popover {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
nv-popover:has([fluid]:not([fluid=false])) {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
nv-popover [data-scope=popover] {
|
|
9
|
+
width: max-content;
|
|
10
|
+
background-color: var(--components-popover-background);
|
|
11
|
+
border-color: var(--components-popover-border);
|
|
12
|
+
font-weight: var(--font-weight-medium-emphasis);
|
|
13
|
+
border-width: 1px;
|
|
14
|
+
border-style: solid;
|
|
15
|
+
border-radius: var(--popover-radius);
|
|
16
|
+
padding: var(--popover-padding-y) var(--popover-padding-x);
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
box-shadow: var(--popover-shadow-1-x) var(--popover-shadow-1-y) var(--popover-shadow-1-blur) -2px var(--popover-shadow-1-opacity), var(--popover-shadow-2-x) var(--popover-shadow-2-y) var(--popover-shadow-2-blur) var(--shadow-spread-lg-2) var(--popover-shadow-2-opacity);
|
|
22
|
+
}
|
|
23
|
+
nv-popover [data-scope=arrow] {
|
|
24
|
+
background-color: var(--components-popover-background);
|
|
25
|
+
position: absolute;
|
|
26
|
+
border-color: var(--components-popover-border);
|
|
27
|
+
border-width: 1px;
|
|
28
|
+
border-style: solid;
|
|
29
|
+
border-bottom-color: transparent;
|
|
30
|
+
border-right-color: transparent;
|
|
31
|
+
width: 8px;
|
|
32
|
+
height: 8px;
|
|
33
|
+
transform: rotate(45deg);
|
|
34
|
+
border-radius: 1px;
|
|
35
|
+
}
|
|
36
|
+
nv-popover [slot=content] {
|
|
37
|
+
position: relative;
|
|
38
|
+
z-index: 1;
|
|
39
|
+
}
|
|
40
|
+
nv-popover slot-fb {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|