@nova-design-system/nova-webcomponents 3.15.0 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-c56424e5.js → index-93d3b2f8.js} +5 -6
- package/dist/cjs/index-93d3b2f8.js.map +1 -0
- package/dist/cjs/index.cjs.js +6 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/native.cjs.js +2 -2
- package/dist/cjs/nv-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/nv-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-accordion.cjs.entry.js +6 -6
- package/dist/cjs/nv-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-alert.cjs.entry.js +2 -2
- package/dist/cjs/nv-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-avatar.cjs.entry.js +2 -2
- package/dist/cjs/nv-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/nv-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/nv-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/nv-button.cjs.entry.js +2 -2
- package/dist/cjs/nv-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-buttongroup.cjs.entry.js +1 -1
- package/dist/cjs/nv-calendar.cjs.entry.js +1 -1
- package/dist/cjs/nv-col.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +177 -10
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js +32 -29
- package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddate.cjs.entry.js +51 -26
- package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +68 -42
- package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +33 -7
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +187 -156
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldradio.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldselect.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldslider.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +25 -12
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +2 -2
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-menu.cjs.entry.js +24 -9
- package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-notification.cjs.entry.js +2 -2
- package/dist/cjs/nv-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-notificationcontainer.cjs.entry.js +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +67 -61
- package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +1 -1
- package/dist/cjs/nv-stack.cjs.entry.js +1 -1
- package/dist/cjs/nv-table.cjs.entry.js +216 -310
- package/dist/cjs/nv-table.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +4 -4
- package/dist/cjs/nv-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-togglebutton.cjs.entry.js +2 -2
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +2 -2
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/nv-accordion/nv-accordion.js +12 -9
- package/dist/collection/components/nv-accordion/nv-accordion.js.map +1 -1
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.js.map +1 -1
- package/dist/collection/components/nv-accordion-item/styles/nv-accordion-item.css +1 -1
- package/dist/collection/components/nv-alert/nv-alert.css +1 -1
- package/dist/collection/components/nv-avatar/nv-avatar.css +1 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.css +1 -1
- package/dist/collection/components/nv-button/styles/nv-button.css +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.css +2 -2
- package/dist/collection/components/nv-dialog/nv-dialog.css +2 -2
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +13 -0
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js +30 -27
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.css +4 -4
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.css +3 -3
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +49 -24
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
- package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +8 -8
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +66 -43
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +8 -8
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +26 -4
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +32 -4
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +9 -9
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +186 -153
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/styles/nv-fieldmultiselect.css +9 -9
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +8 -8
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +8 -8
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.css +3 -3
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +12 -12
- package/dist/collection/components/nv-fieldslider/styles/nv-fieldslider.css +7 -7
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +8 -8
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +9 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +8 -8
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js +22 -0
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +24 -9
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +8 -8
- package/dist/collection/components/nv-icon/nv-icons.js +6 -1
- package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.css +2 -2
- package/dist/collection/components/nv-menu/nv-menu.docs.js +7 -0
- package/dist/collection/components/nv-menu/nv-menu.docs.js.map +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +26 -8
- package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +1 -1
- package/dist/collection/components/nv-notification/styles/nv-notification.css +2 -2
- package/dist/collection/components/nv-popover/nv-popover.docs.js +11 -0
- package/dist/collection/components/nv-popover/nv-popover.docs.js.map +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +66 -60
- package/dist/collection/components/nv-popover/nv-popover.js.map +1 -1
- package/dist/collection/components/nv-table/nv-table.docs.js +16 -155
- package/dist/collection/components/nv-table/nv-table.docs.js.map +1 -1
- package/dist/collection/components/nv-table/nv-table.js +68 -496
- package/dist/collection/components/nv-table/nv-table.js.map +1 -1
- package/dist/collection/components/nv-table/nv-table.utils.js +175 -0
- package/dist/collection/components/nv-table/nv-table.utils.js.map +1 -0
- package/dist/collection/components/nv-table/styles/nv-table.css +84 -0
- package/dist/collection/components/nv-table/test/nv-table.utils.test.js +604 -0
- package/dist/collection/components/nv-table/test/nv-table.utils.test.js.map +1 -0
- package/dist/collection/components/nv-toggle/nv-toggle.css +3 -3
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +1 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.docs.js +1 -0
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.docs.js.map +1 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +1 -3
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js.map +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/components/index.js +7 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-accordion-item.js +1 -1
- package/dist/components/nv-accordion.js +10 -10
- package/dist/components/nv-accordion.js.map +1 -1
- package/dist/components/nv-alert.js +3 -3
- package/dist/components/nv-alert.js.map +1 -1
- package/dist/components/nv-avatar.js +3 -3
- package/dist/components/nv-avatar.js.map +1 -1
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-breadcrumb.js +4 -4
- package/dist/components/nv-breadcrumb.js.map +1 -1
- package/dist/components/nv-breadcrumbs.js +1 -1
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-buttongroup.js +1 -1
- package/dist/components/nv-calendar.js +1 -1
- package/dist/components/nv-col.js +1 -1
- package/dist/components/nv-datagrid.js +174 -7
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-datagridcolumn.js +1 -1
- package/dist/components/nv-dialog.js +37 -34
- package/dist/components/nv-dialog.js.map +1 -1
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-dialogheader.js +1 -1
- package/dist/components/nv-fieldcheckbox.js +1 -1
- package/dist/components/nv-fielddate.js +57 -32
- package/dist/components/nv-fielddate.js.map +1 -1
- package/dist/components/nv-fielddaterange.js +74 -48
- package/dist/components/nv-fielddaterange.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +40 -13
- package/dist/components/nv-fielddropdown.js.map +1 -1
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fielddropdownitemcheck.js +1 -1
- package/dist/components/nv-fieldmultiselect.js +196 -164
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +1 -1
- package/dist/components/nv-fieldpassword.js +5 -5
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +2 -2
- package/dist/components/nv-fieldradio.js.map +1 -1
- package/dist/components/nv-fieldselect.js +5 -5
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldslider.js +6 -6
- package/dist/components/nv-fieldslider.js.map +1 -1
- package/dist/components/nv-fieldtext.js +1 -1
- package/dist/components/nv-fieldtextarea.js +2 -2
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-fieldtime.js +31 -17
- package/dist/components/nv-fieldtime.js.map +1 -1
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-loader.js +1 -1
- package/dist/components/nv-menu.js +30 -13
- package/dist/components/nv-menu.js.map +1 -1
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-notification.js +3 -3
- package/dist/components/nv-notification.js.map +1 -1
- package/dist/components/nv-notificationcontainer.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +1 -1
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-table.js +216 -328
- package/dist/components/nv-table.js.map +1 -1
- package/dist/components/nv-toggle.js +4 -4
- package/dist/components/nv-toggle.js.map +1 -1
- package/dist/components/nv-togglebutton.js +2 -2
- package/dist/components/nv-togglebuttongroup.js +2 -2
- package/dist/components/nv-togglebuttongroup.js.map +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-00cbf2a1.js → p-0d5ed1d7.js} +3 -3
- package/dist/components/p-0d5ed1d7.js.map +1 -0
- package/dist/components/{p-54161bad.js → p-0e6f41c7.js} +2 -2
- package/dist/components/{p-54161bad.js.map → p-0e6f41c7.js.map} +1 -1
- package/dist/components/{p-0c42fafb.js → p-0fd23531.js} +6 -6
- package/dist/components/{p-0c42fafb.js.map → p-0fd23531.js.map} +1 -1
- package/dist/components/{p-a823b8e9.js → p-1639703f.js} +2 -2
- package/dist/components/{p-a823b8e9.js.map → p-1639703f.js.map} +1 -1
- package/dist/components/{p-e5c62ea8.js → p-2cc83e0c.js} +3 -3
- package/dist/components/{p-e5c62ea8.js.map → p-2cc83e0c.js.map} +1 -1
- package/dist/components/p-2d64749f.js +191 -0
- package/dist/components/{p-95857e4f.js.map → p-2d64749f.js.map} +1 -1
- package/dist/components/{p-3763c9c4.js → p-31478080.js} +3 -3
- package/dist/components/{p-3763c9c4.js.map → p-31478080.js.map} +1 -1
- package/dist/components/{p-178fa27e.js → p-378e3127.js} +6 -6
- package/dist/components/{p-178fa27e.js.map → p-378e3127.js.map} +1 -1
- package/dist/components/{p-51876ca1.js → p-429e01f3.js} +3 -3
- package/dist/components/p-429e01f3.js.map +1 -0
- package/dist/components/p-47d499b4.js +88 -0
- package/dist/components/p-47d499b4.js.map +1 -0
- package/dist/components/{p-aff3ed68.js → p-5829b9f7.js} +5 -2
- package/dist/components/p-5829b9f7.js.map +1 -0
- package/dist/components/{p-ee8944f3.js → p-63595ea1.js} +68 -62
- package/dist/components/p-63595ea1.js.map +1 -0
- package/dist/components/{p-4fc01a78.js → p-7112612c.js} +5 -5
- package/dist/components/p-7112612c.js.map +1 -0
- package/dist/components/{p-7426b20f.js → p-715e5235.js} +3 -3
- package/dist/components/{p-7426b20f.js.map → p-715e5235.js.map} +1 -1
- package/dist/components/{p-1af3591a.js → p-9707528d.js} +4 -4
- package/dist/components/{p-1af3591a.js.map → p-9707528d.js.map} +1 -1
- package/dist/components/{p-fda58a76.js → p-98429fd7.js} +2 -2
- package/dist/components/{p-fda58a76.js.map → p-98429fd7.js.map} +1 -1
- package/dist/components/{p-31e262bd.js → p-a1ef5e37.js} +5 -5
- package/dist/components/{p-31e262bd.js.map → p-a1ef5e37.js.map} +1 -1
- package/dist/components/{p-75200cc0.js → p-df5d76a5.js} +3 -3
- package/dist/components/{p-75200cc0.js.map → p-df5d76a5.js.map} +1 -1
- package/dist/components/{p-51459a44.js → p-f2bac2aa.js} +4 -4
- package/dist/components/{p-51459a44.js.map → p-f2bac2aa.js.map} +1 -1
- package/dist/esm/{index-a1936cd0.js → index-dc2723f3.js} +5 -6
- package/dist/esm/index-dc2723f3.js.map +1 -0
- package/dist/esm/index.js +6 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/native.js +3 -3
- package/dist/esm/nv-accordion-item.entry.js +2 -2
- package/dist/esm/nv-accordion-item.entry.js.map +1 -1
- package/dist/esm/nv-accordion.entry.js +6 -6
- package/dist/esm/nv-accordion.entry.js.map +1 -1
- package/dist/esm/nv-alert.entry.js +2 -2
- package/dist/esm/nv-alert.entry.js.map +1 -1
- package/dist/esm/nv-avatar.entry.js +2 -2
- package/dist/esm/nv-avatar.entry.js.map +1 -1
- package/dist/esm/nv-badge_2.entry.js +1 -1
- package/dist/esm/nv-breadcrumb.entry.js +2 -2
- package/dist/esm/nv-breadcrumb.entry.js.map +1 -1
- package/dist/esm/nv-breadcrumbs.entry.js +1 -1
- package/dist/esm/nv-button.entry.js +2 -2
- package/dist/esm/nv-button.entry.js.map +1 -1
- package/dist/esm/nv-buttongroup.entry.js +1 -1
- package/dist/esm/nv-calendar.entry.js +1 -1
- package/dist/esm/nv-col.entry.js +1 -1
- package/dist/esm/nv-datagrid.entry.js +172 -5
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-datagridcolumn.entry.js +1 -1
- package/dist/esm/nv-dialog.entry.js +32 -29
- package/dist/esm/nv-dialog.entry.js.map +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
- package/dist/esm/nv-dialogfooter_2.entry.js.map +1 -1
- package/dist/esm/nv-fieldcheckbox.entry.js +2 -2
- package/dist/esm/nv-fieldcheckbox.entry.js.map +1 -1
- package/dist/esm/nv-fielddate.entry.js +51 -26
- package/dist/esm/nv-fielddate.entry.js.map +1 -1
- package/dist/esm/nv-fielddaterange.entry.js +68 -42
- package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +33 -7
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
- package/dist/esm/nv-fieldmultiselect.entry.js +187 -156
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +2 -2
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +2 -2
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
- package/dist/esm/nv-fieldradio.entry.js +2 -2
- package/dist/esm/nv-fieldradio.entry.js.map +1 -1
- package/dist/esm/nv-fieldselect.entry.js +2 -2
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldslider.entry.js +2 -2
- package/dist/esm/nv-fieldslider.entry.js.map +1 -1
- package/dist/esm/nv-fieldtext.entry.js +2 -2
- package/dist/esm/nv-fieldtext.entry.js.map +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +2 -2
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-fieldtime.entry.js +25 -12
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +2 -2
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton_2.entry.js +2 -2
- package/dist/esm/nv-iconbutton_2.entry.js.map +1 -1
- package/dist/esm/nv-menu.entry.js +24 -9
- package/dist/esm/nv-menu.entry.js.map +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-notification.entry.js +2 -2
- package/dist/esm/nv-notification.entry.js.map +1 -1
- package/dist/esm/nv-notificationcontainer.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js +67 -61
- package/dist/esm/nv-popover.entry.js.map +1 -1
- package/dist/esm/nv-row.entry.js +1 -1
- package/dist/esm/nv-stack.entry.js +1 -1
- package/dist/esm/nv-table.entry.js +216 -310
- package/dist/esm/nv-table.entry.js.map +1 -1
- package/dist/esm/nv-toggle.entry.js +4 -4
- package/dist/esm/nv-toggle.entry.js.map +1 -1
- package/dist/esm/nv-togglebutton.entry.js +2 -2
- package/dist/esm/nv-togglebuttongroup.entry.js +2 -2
- package/dist/esm/nv-togglebuttongroup.entry.js.map +1 -1
- package/dist/esm/nv-tooltip.entry.js +2 -2
- package/dist/native/index.esm.js +1 -1
- package/dist/native/index.esm.js.map +1 -1
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-d882f417.entry.js → p-075d231e.entry.js} +2 -2
- package/dist/native/p-075d231e.entry.js.map +1 -0
- package/dist/native/p-107e80c6.entry.js +2 -0
- package/dist/native/p-107e80c6.entry.js.map +1 -0
- package/dist/native/{p-5c697133.entry.js → p-112d096c.entry.js} +2 -2
- package/dist/native/p-217de553.entry.js +2 -0
- package/dist/native/p-217de553.entry.js.map +1 -0
- package/dist/native/{p-85f8f11a.entry.js → p-230af58a.entry.js} +2 -2
- package/dist/native/p-23ee0384.entry.js +2 -0
- package/dist/native/{p-29f68e07.entry.js.map → p-23ee0384.entry.js.map} +1 -1
- package/dist/native/p-26513cbd.entry.js +2 -0
- package/dist/native/p-26513cbd.entry.js.map +1 -0
- package/dist/native/p-278613a3.entry.js +2 -0
- package/dist/native/{p-6cb6679b.entry.js.map → p-278613a3.entry.js.map} +1 -1
- package/dist/native/p-2dfd786f.entry.js +2 -0
- package/dist/native/{p-29df974e.entry.js.map → p-2dfd786f.entry.js.map} +1 -1
- package/dist/native/{p-d0a33e64.js → p-3060df80.js} +3 -3
- package/dist/native/p-3060df80.js.map +1 -0
- package/dist/native/p-445221dc.entry.js +2 -0
- package/dist/native/p-445221dc.entry.js.map +1 -0
- package/dist/native/{p-08322093.entry.js → p-44a78545.entry.js} +2 -2
- package/dist/native/p-4dc7483d.entry.js +2 -0
- package/dist/native/{p-c7b7ffaf.entry.js.map → p-4dc7483d.entry.js.map} +1 -1
- package/dist/native/p-4eaf417d.entry.js +13 -0
- package/dist/native/p-4eaf417d.entry.js.map +1 -0
- package/dist/native/p-5039ceb8.entry.js +2 -0
- package/dist/native/p-5039ceb8.entry.js.map +1 -0
- package/dist/native/{p-19090193.entry.js → p-647a0765.entry.js} +2 -2
- package/dist/native/p-68dc02be.entry.js +2 -0
- package/dist/native/p-68dc02be.entry.js.map +1 -0
- package/dist/native/p-6d427897.entry.js +2 -0
- package/dist/native/{p-92931ab8.entry.js.map → p-6d427897.entry.js.map} +1 -1
- package/dist/native/{p-1504e28b.entry.js → p-701b48a4.entry.js} +2 -2
- package/dist/native/p-7c9bf981.entry.js +2 -0
- package/dist/native/p-835abdb9.entry.js +2 -0
- package/dist/native/{p-f5120223.entry.js.map → p-835abdb9.entry.js.map} +1 -1
- package/dist/native/{p-464bb197.entry.js → p-83765537.entry.js} +2 -2
- package/dist/native/p-88f9fca5.entry.js +2 -0
- package/dist/native/p-88f9fca5.entry.js.map +1 -0
- package/dist/native/{p-d2c9247b.entry.js → p-8e423742.entry.js} +3 -3
- package/dist/native/{p-d2c9247b.entry.js.map → p-8e423742.entry.js.map} +1 -1
- package/dist/native/p-95184ea2.entry.js +2 -0
- package/dist/native/p-95184ea2.entry.js.map +1 -0
- package/dist/native/p-9613087c.entry.js +2 -0
- package/dist/native/{p-2781637d.entry.js.map → p-9613087c.entry.js.map} +1 -1
- package/dist/native/{p-94dc9c41.entry.js → p-9d7e099f.entry.js} +2 -2
- package/dist/native/p-a2f58133.entry.js +2 -0
- package/dist/native/p-a2f58133.entry.js.map +1 -0
- package/dist/native/{p-1235c007.entry.js → p-acabac31.entry.js} +2 -2
- package/dist/native/p-acada158.entry.js +2 -0
- package/dist/native/p-acada158.entry.js.map +1 -0
- package/dist/native/{p-e2c99ce2.entry.js → p-b02c896a.entry.js} +2 -2
- package/dist/native/p-b06f0e61.entry.js +2 -0
- package/dist/native/p-b06f0e61.entry.js.map +1 -0
- package/dist/native/p-b4c15f25.entry.js +2 -0
- package/dist/native/p-b4c15f25.entry.js.map +1 -0
- package/dist/native/{p-74b129e9.entry.js → p-bcf41cd0.entry.js} +2 -2
- package/dist/native/p-ce97ce24.entry.js +2 -0
- package/dist/native/p-ce97ce24.entry.js.map +1 -0
- package/dist/native/p-d0db5e72.entry.js +2 -0
- package/dist/native/p-d0db5e72.entry.js.map +1 -0
- package/dist/native/p-d45ee8e5.entry.js +2 -0
- package/dist/native/{p-6d13a851.entry.js.map → p-d45ee8e5.entry.js.map} +1 -1
- package/dist/native/p-d7f444fb.entry.js +2 -0
- package/dist/native/p-d7f444fb.entry.js.map +1 -0
- package/dist/native/p-d878e90a.entry.js +2 -0
- package/dist/native/p-d878e90a.entry.js.map +1 -0
- package/dist/native/p-ddc41f1f.entry.js +2 -0
- package/dist/native/p-ddc41f1f.entry.js.map +1 -0
- package/dist/native/{p-c66565f8.entry.js → p-dfb6b65e.entry.js} +2 -2
- package/dist/native/p-f30e0be6.entry.js +2 -0
- package/dist/native/p-f30e0be6.entry.js.map +1 -0
- package/dist/native/p-f3c73492.entry.js +2 -0
- package/dist/native/{p-b32d0a5a.entry.js.map → p-f3c73492.entry.js.map} +1 -1
- package/dist/native/{p-9c5d6827.entry.js → p-fa78d8eb.entry.js} +2 -2
- package/dist/types/components/nv-accordion/nv-accordion.d.ts +2 -4
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +9 -8
- package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +6 -3
- package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +5 -4
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +3 -1
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +12 -11
- package/dist/types/components/nv-fieldtime/nv-fieldtime.d.ts +1 -0
- package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
- package/dist/types/components/nv-menu/nv-menu.d.ts +4 -1
- package/dist/types/components/nv-popover/nv-popover.d.ts +10 -8
- package/dist/types/components/nv-table/nv-table.d.ts +6 -87
- package/dist/types/components/nv-table/nv-table.utils.d.ts +129 -0
- package/dist/types/components/nv-table/test/nv-table.utils.test.d.ts +1 -0
- package/dist/types/components/nv-togglebuttongroup/nv-togglebuttongroup.d.ts +0 -2
- package/dist/types/components.d.ts +3 -208
- package/dist/vscode-data.json +18 -41
- package/hydrate/index.js +800 -783
- package/hydrate/index.mjs +800 -783
- package/package.json +6 -10
- package/dist/cjs/dom.utils-4d43f69a.js +0 -170
- package/dist/cjs/dom.utils-4d43f69a.js.map +0 -1
- package/dist/cjs/index-c56424e5.js.map +0 -1
- package/dist/cjs/nv-tablecolumn.cjs.entry.js +0 -21
- package/dist/cjs/nv-tablecolumn.cjs.entry.js.map +0 -1
- package/dist/collection/components/nv-table/nv-table.css +0 -35
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.docs.js +0 -6
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.docs.js.map +0 -1
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.js +0 -52
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.js.map +0 -1
- package/dist/components/nv-tablecolumn.d.ts +0 -11
- package/dist/components/nv-tablecolumn.js +0 -38
- package/dist/components/nv-tablecolumn.js.map +0 -1
- package/dist/components/p-00cbf2a1.js.map +0 -1
- package/dist/components/p-4fc01a78.js.map +0 -1
- package/dist/components/p-51876ca1.js.map +0 -1
- package/dist/components/p-5d14ba3f.js +0 -88
- package/dist/components/p-5d14ba3f.js.map +0 -1
- package/dist/components/p-95857e4f.js +0 -191
- package/dist/components/p-aff3ed68.js.map +0 -1
- package/dist/components/p-cb34aa4f.js +0 -167
- package/dist/components/p-cb34aa4f.js.map +0 -1
- package/dist/components/p-ee8944f3.js.map +0 -1
- package/dist/esm/dom.utils-ac71e0ef.js +0 -167
- package/dist/esm/dom.utils-ac71e0ef.js.map +0 -1
- package/dist/esm/index-a1936cd0.js.map +0 -1
- package/dist/esm/nv-tablecolumn.entry.js +0 -17
- package/dist/esm/nv-tablecolumn.entry.js.map +0 -1
- package/dist/native/p-0a99c6fb.entry.js +0 -2
- package/dist/native/p-0a99c6fb.entry.js.map +0 -1
- package/dist/native/p-1ad1bff9.entry.js +0 -2
- package/dist/native/p-1ad1bff9.entry.js.map +0 -1
- package/dist/native/p-1c83f540.entry.js +0 -2
- package/dist/native/p-1c83f540.entry.js.map +0 -1
- package/dist/native/p-224b1a01.entry.js +0 -2
- package/dist/native/p-224b1a01.entry.js.map +0 -1
- package/dist/native/p-234cfa2e.entry.js +0 -2
- package/dist/native/p-2781637d.entry.js +0 -2
- package/dist/native/p-29df974e.entry.js +0 -2
- package/dist/native/p-29f68e07.entry.js +0 -2
- package/dist/native/p-45506c37.entry.js +0 -2
- package/dist/native/p-45506c37.entry.js.map +0 -1
- package/dist/native/p-48774d0c.entry.js +0 -13
- package/dist/native/p-48774d0c.entry.js.map +0 -1
- package/dist/native/p-4ec61dec.entry.js +0 -2
- package/dist/native/p-4ec61dec.entry.js.map +0 -1
- package/dist/native/p-5f0776cb.entry.js +0 -2
- package/dist/native/p-5f0776cb.entry.js.map +0 -1
- package/dist/native/p-6c7a9a21.entry.js +0 -2
- package/dist/native/p-6c7a9a21.entry.js.map +0 -1
- package/dist/native/p-6cb6679b.entry.js +0 -2
- package/dist/native/p-6d13a851.entry.js +0 -2
- package/dist/native/p-87784622.entry.js +0 -2
- package/dist/native/p-87784622.entry.js.map +0 -1
- package/dist/native/p-92931ab8.entry.js +0 -2
- package/dist/native/p-9a46baa9.entry.js +0 -2
- package/dist/native/p-9a46baa9.entry.js.map +0 -1
- package/dist/native/p-a34beedf.entry.js +0 -2
- package/dist/native/p-a34beedf.entry.js.map +0 -1
- package/dist/native/p-a69dbcef.entry.js +0 -2
- package/dist/native/p-a69dbcef.entry.js.map +0 -1
- package/dist/native/p-b32d0a5a.entry.js +0 -2
- package/dist/native/p-bc01787b.entry.js +0 -2
- package/dist/native/p-bc01787b.entry.js.map +0 -1
- package/dist/native/p-c7b7ffaf.entry.js +0 -2
- package/dist/native/p-cb34aa4f.js +0 -2
- package/dist/native/p-cb34aa4f.js.map +0 -1
- package/dist/native/p-cea942b9.entry.js +0 -2
- package/dist/native/p-cea942b9.entry.js.map +0 -1
- package/dist/native/p-d0a33e64.js.map +0 -1
- package/dist/native/p-d0ef1bbb.entry.js +0 -2
- package/dist/native/p-d0ef1bbb.entry.js.map +0 -1
- package/dist/native/p-d882f417.entry.js.map +0 -1
- package/dist/native/p-dd023fd6.entry.js +0 -2
- package/dist/native/p-dd023fd6.entry.js.map +0 -1
- package/dist/native/p-e765a624.entry.js +0 -2
- package/dist/native/p-e765a624.entry.js.map +0 -1
- package/dist/native/p-f0cbfb3d.entry.js +0 -2
- package/dist/native/p-f0cbfb3d.entry.js.map +0 -1
- package/dist/native/p-f5120223.entry.js +0 -2
- package/dist/native/p-fa177c39.entry.js +0 -2
- package/dist/native/p-fa177c39.entry.js.map +0 -1
- package/dist/types/components/nv-tablecolumn/nv-tablecolumn.d.ts +0 -13
- package/dist/types/components/nv-tablecolumn/nv-tablecolumn.docs.d.ts +0 -4
- /package/dist/native/{p-5c697133.entry.js.map → p-112d096c.entry.js.map} +0 -0
- /package/dist/native/{p-85f8f11a.entry.js.map → p-230af58a.entry.js.map} +0 -0
- /package/dist/native/{p-08322093.entry.js.map → p-44a78545.entry.js.map} +0 -0
- /package/dist/native/{p-19090193.entry.js.map → p-647a0765.entry.js.map} +0 -0
- /package/dist/native/{p-1504e28b.entry.js.map → p-701b48a4.entry.js.map} +0 -0
- /package/dist/native/{p-234cfa2e.entry.js.map → p-7c9bf981.entry.js.map} +0 -0
- /package/dist/native/{p-464bb197.entry.js.map → p-83765537.entry.js.map} +0 -0
- /package/dist/native/{p-94dc9c41.entry.js.map → p-9d7e099f.entry.js.map} +0 -0
- /package/dist/native/{p-1235c007.entry.js.map → p-acabac31.entry.js.map} +0 -0
- /package/dist/native/{p-e2c99ce2.entry.js.map → p-b02c896a.entry.js.map} +0 -0
- /package/dist/native/{p-74b129e9.entry.js.map → p-bcf41cd0.entry.js.map} +0 -0
- /package/dist/native/{p-c66565f8.entry.js.map → p-dfb6b65e.entry.js.map} +0 -0
- /package/dist/native/{p-9c5d6827.entry.js.map → p-fa78d8eb.entry.js.map} +0 -0
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-93d3b2f8.js');
|
|
6
6
|
const v4 = require('./v4-7014b8b0.js');
|
|
7
7
|
|
|
8
|
-
const nvFielddropdownCss = "nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fielddropdown{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fielddropdown[fluid]:not([fluid=false]){max-width:unset}nv-fielddropdown[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fielddropdown[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fielddropdown[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:
|
|
8
|
+
const nvFielddropdownCss = "nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fielddropdown{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fielddropdown[fluid]:not([fluid=false]){max-width:unset}nv-fielddropdown[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fielddropdown[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fielddropdown[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:var(--font-weight-high-emphasis)}nv-fielddropdown[hidden]:not([hidden=false]) label{display:none}nv-fielddropdown label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-label-line-height)}nv-fielddropdown nv-popover{width:100%;display:block}nv-fielddropdown nv-popover [data-scope=popover]{width:100%;padding:var(--list-dropdown-padding);border-radius:var(--list-dropdown-radius);background-color:var(--components-list-dropdown-background);border:1px solid var(--components-list-dropdown-border)}nv-fielddropdown nv-popover [slot=content]{gap:var(--list-dropdown-gap-y);display:flex;flex-direction:column}nv-fielddropdown nv-popover hr{color:var(--components-list-dropdown-separator)}nv-fielddropdown nv-popover div[slot=content]{max-height:calc(90vh - var(--list-dropdown-padding) * 2);overflow-y:auto;position:relative}nv-fielddropdown nv-popover div[slot=content]::-webkit-scrollbar{width:6px;height:6px}nv-fielddropdown nv-popover div[slot=content]::-webkit-scrollbar-track{background-color:var(--color-level-10-background);border-radius:9999px}nv-fielddropdown nv-popover div[slot=content]::-webkit-scrollbar-thumb{background-color:var(--color-gray-200);border-radius:9999px}nv-fielddropdown .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fielddropdown .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default, 1);background:var(--nv-field-background);transition:all 150ms ease-out;position:relative;width:100%;min-height:40px}nv-fielddropdown .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fielddropdown .input-container:focus-within,nv-fielddropdown .input-container:focus-within:hover,nv-fielddropdown .input-container:focus,nv-fielddropdown .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fielddropdown .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fielddropdown .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fielddropdown .input-container input[type=search]::-webkit-search-decoration,nv-fielddropdown .input-container input[type=search]::-webkit-search-cancel-button,nv-fielddropdown .input-container input[type=search]::-webkit-search-results-button,nv-fielddropdown .input-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}nv-fielddropdown .input-container input,nv-fielddropdown .input-container p.non-filterable-text{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-field-line-height);width:100%;}nv-fielddropdown .input-container input:focus,nv-fielddropdown .input-container p.non-filterable-text:focus{outline:none}nv-fielddropdown .input-container input::placeholder,nv-fielddropdown .input-container p.non-filterable-text::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--form-field-line-height)}nv-fielddropdown .input-container input[type=password]::-ms-clear,nv-fielddropdown .input-container input[type=password]::-ms-reveal,nv-fielddropdown .input-container p.non-filterable-text[type=password]::-ms-clear,nv-fielddropdown .input-container p.non-filterable-text[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fielddropdown .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fielddropdown .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fielddropdown .input-container>nv-iconbutton:last-of-type{border-top-right-radius:var(--form-field-radius);border-bottom-right-radius:var(--form-field-radius)}nv-fielddropdown .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fielddropdown .non-filterable-text{display:block;border-radius:var(--form-field-radius);background-color:var(--nv-field-background);color:var(--components-form-field-content-text);font-size:var(--form-field-font-size);font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-field-line-height);box-sizing:border-box;cursor:pointer;height:100%;min-height:40px}nv-fielddropdown .non-filterable-text span{display:inline-block;width:100%;overflow:hidden;text-overflow:ellipsis}nv-fielddropdown .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fielddropdown .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}";
|
|
9
9
|
const NvFielddropdownStyle0 = nvFielddropdownCss;
|
|
10
10
|
|
|
11
11
|
const NvFielddropdown = class {
|
|
@@ -162,6 +162,17 @@ const NvFielddropdown = class {
|
|
|
162
162
|
this.inputElement.focus();
|
|
163
163
|
this.filterItems();
|
|
164
164
|
};
|
|
165
|
+
this.handleBlurInput = (event) => {
|
|
166
|
+
var _a;
|
|
167
|
+
const relatedTarget = event.relatedTarget;
|
|
168
|
+
if (!this.el.contains(relatedTarget) &&
|
|
169
|
+
!((_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.contains(relatedTarget))) {
|
|
170
|
+
this.open = false;
|
|
171
|
+
if (this.filterable) {
|
|
172
|
+
this.clearFilter(); // Resets input to selected label, clears filterText
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
165
176
|
}
|
|
166
177
|
//#endregion EVENTS
|
|
167
178
|
/****************************************************************************/
|
|
@@ -179,6 +190,15 @@ const NvFielddropdown = class {
|
|
|
179
190
|
watchValueHandler(newValue) {
|
|
180
191
|
this.valueChanged.emit(newValue);
|
|
181
192
|
}
|
|
193
|
+
handleOpenChange(newOpen) {
|
|
194
|
+
// React to external changes, e.g., clear filter or refilter on open
|
|
195
|
+
if (newOpen && this.filterable) {
|
|
196
|
+
this.filterItems(); // Ensure items are filtered if filterText exists
|
|
197
|
+
}
|
|
198
|
+
else if (!newOpen) {
|
|
199
|
+
this.clearFilter(); // Clear on external close
|
|
200
|
+
}
|
|
201
|
+
}
|
|
182
202
|
//#endregion WATCHERS
|
|
183
203
|
/****************************************************************************/
|
|
184
204
|
//#region LISTENERS
|
|
@@ -186,7 +206,12 @@ const NvFielddropdown = class {
|
|
|
186
206
|
// Stop propagation to prevent the event from affecting parent components like dialogs
|
|
187
207
|
event.stopPropagation();
|
|
188
208
|
// Update `open` based on the popover state
|
|
189
|
-
|
|
209
|
+
if (event.target === this.popoverElement) {
|
|
210
|
+
this.open = event.detail;
|
|
211
|
+
}
|
|
212
|
+
if (!event.detail && this.filterable) {
|
|
213
|
+
this.clearFilter();
|
|
214
|
+
}
|
|
190
215
|
}
|
|
191
216
|
handleDropdownItemSelected(event) {
|
|
192
217
|
if (this.disabled || this.readonly)
|
|
@@ -357,15 +382,16 @@ const NvFielddropdown = class {
|
|
|
357
382
|
//#region RENDER
|
|
358
383
|
render() {
|
|
359
384
|
var _a;
|
|
360
|
-
return (index.h(index.Host, { key: '
|
|
361
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
362
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
385
|
+
return (index.h(index.Host, { key: '1d5a87b2a5e9d9ca0be659ba5706b1db068d1d2d', role: "combobox", "aria-expanded": this.open.toString(), "aria-haspopup": "listbox", "aria-label": this.label }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'b07ca241c89f45292e479de79de618c6444a9c42', htmlFor: this.inputId }, index.h("slot", { key: '0dd6ac2799e187e7233a5a5651ef18d59e4507e8', name: "label" }, this.label))), index.h("nv-popover", { key: 'b06d107776724937816dc4b98a035b282ed6c1f3', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: 'ab755801a0f2a732ea895e04d6c3a85261422f17', class: "input-wrapper", slot: "trigger" }, index.h("slot", { key: 'b78c41d4064cf067d69fa20ae583c1be29d1f620', name: "before-input" }), index.h("div", { key: 'b46f6440660056ff71b9debf503f15ca7046ca02', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '36069ce529fba771c9339a3cb6c9c5c838f441c4', name: "leading-input" }), this.filterable || this.disabled || this.readonly ? (index.h("input", { "data-scope": "focusable", id: this.inputId, type: "search", ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.getSelectedLabel(), required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput, onFocus: this.handleInputFocus, onClick: this.handleInputFocus, onKeyDown: this.handleKeyDown, onBlur: this.handleBlurInput })) : (index.h("p", { "data-scope": "focusable", id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClick, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocus, onBlur: this.handleBlurInput }, this.getSelectedLabel() || this.value || this.placeholder)), this.filterable && this.filterText && this.open && (index.h("nv-iconbutton", { key: '36f76135c0e3e1e6750c95116aae6ddd397eec1f', name: "x", size: "md", emphasis: "lower", class: "clear-button", onClick: this.clearFilter, "aria-label": "Clear input" })), this.error && (index.h("nv-icon", { key: 'bd73c43ffae11897359adfae69572ee490f0f5c2', name: "alert-circle", class: "validation", size: "md" })), index.h("nv-iconbutton", { key: 'a0f237814e9f58aa9e4d72e73a1747248911ade8', "data-scope": "toggle-dropdown", name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide dropdown' : 'Show dropdown', onClick: this.togglePopover, tabIndex: this.disabled ? -1 : 0 })), index.h("slot", { key: '66d2b27cfcf7ef97df493accaa333e0694234344', name: "after-input" })), index.h("div", { key: 'de6d7e18d676788cf0c7bfebd25f22b5cd2067ce', slot: "content", style: this.maxHeight ? { maxHeight: this.maxHeight } : {} }, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0 ? (index.h("ul", null, this.options.map(option => (index.h("nv-fielddropdownitem", { label: option.label, value: option.value, disabled: option.disabled, selected: option.value === this.value }))))) : (index.h("slot", { name: "content" })))), (this.description ||
|
|
386
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'ea889c8ecdcfad160010374541b73f548322a0ad', class: "description" }, index.h("slot", { key: 'b69f67d3a03bf1839edd912ea369cfd87395ae51', name: "description" }, this.description))), (this.errorDescription ||
|
|
387
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '6ecd397cb41aab81173992c90e42f593f1227730', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '3dff83b119d3cbbf2d00bc8641882326d08f939d', name: "error-description" }, this.errorDescription)))));
|
|
363
388
|
}
|
|
364
389
|
static get formAssociated() { return true; }
|
|
365
390
|
get el() { return index.getElement(this); }
|
|
366
391
|
static get watchers() { return {
|
|
367
392
|
"options": ["handleOptionsChange"],
|
|
368
|
-
"value": ["watchValueHandler"]
|
|
393
|
+
"value": ["watchValueHandler"],
|
|
394
|
+
"open": ["handleOpenChange"]
|
|
369
395
|
}; }
|
|
370
396
|
};
|
|
371
397
|
NvFielddropdown.style = NvFielddropdownStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-fielddropdown.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,8gSAA8gS,CAAC;AAC1iS,8BAAe,kBAAkB;;MC+BpB,eAAe;IAN5B;;;;;;;;;;;;QA6BW,YAAO,GAAWA,KAAM,EAAE,CAAC;;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AS,GAAQ,CAC7B,CACG,CACK,EAEZ,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7CA,kEAAK,KAAK,EAAC,aAAa,IACtBA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fielddropdown/styles/nv-fielddropdown.scss?tag=nv-fielddropdown","src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"sourcesContent":["@use './mixins' as *;\n@import '../../../styles/form-field';\n@import '../../../styles/scrollbar';\n\nnv-fielddropdown {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid='false']) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n &[hidden]:not([hidden='false']) label {\n display: none;\n }\n\n label {\n @include form-field-label();\n }\n\n nv-popover {\n @include form-field-popover();\n\n div[slot='content'] {\n @include scrollbar();\n max-height: calc(90vh - var(--list-dropdown-padding) * 2);\n overflow-y: auto;\n position: relative;\n }\n }\n\n .input-wrapper {\n @include form-field-input-wrapper();\n @include input-wrapper-styles();\n }\n\n .input-container {\n @include form-field-input-container();\n @include input-container-styles();\n\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n input,\n p.non-filterable-text {\n @include form-field-input();\n }\n\n > nv-iconbutton {\n @include form-field-action();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n\n .non-filterable-text {\n @include non-filterable-text-styles();\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\n\nimport { v4 as uuidv4 } from 'uuid';\nimport { TextInputAutocomplete } from '../../utils/constants';\n\n/**\n * @slot content - Use a <ul></ul> tag for the slot, and place <nv-dropdownitem> elements inside.\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fielddropdown',\n styleUrl: 'styles/nv-fielddropdown.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFielddropdown {\n @Element() el: HTMLNvFielddropdownElement;\n private inputElement!: HTMLInputElement;\n private popoverElement!: HTMLNvPopoverElement;\n /**\n * Timer for debouncing input events.\n * Private property preferred over @State as it:\n * - Doesn't need to trigger re-renders\n * - Is purely for internal logic\n * - Improves performance by avoiding Stencil's reactivity system\n */\n private debounceTimer: number;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input's data in form submissions. It should be\n * unique within the form to avoid conflicts.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It's a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text input field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Display temporary text inside the input field to give users a hint about\n * what to type. It's a great way to provide examples or suggestions directly\n * in the field before they start typing.\n * The placeholder is displayed only when the filterable option is enabled.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they've used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}` = 'off';\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input's value is managed by the component's state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * Marks the input field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Display the input field's content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won't be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * The disabled prop lets you turn off the input field so that users can't\n * type in it. When disabled, the field is grayed out and won't respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Alters the input field's appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the dropdown\n * field.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\n\n /**\n * Defines the maximum height of the multiselect list when open.\n */\n @Prop({ reflect: true })\n readonly maxHeight: string = '';\n\n /**\n * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * The text to display when no items match the filter.\n */\n @Prop({ reflect: true })\n readonly emptyResult: string = 'No results found';\n\n /**\n * Enables or disables the filtering feature for the dropdown items.\n */\n @Prop({ reflect: true })\n readonly filterable: boolean = false;\n\n /**\n * List of options used to automatically generate dropdown items. This\n * provides an alternative to using the slot manually.\n *\n * @example\n * options=[{\n * \"label\": \"Option 1\",\n * \"value\": \"option1\",\n * \"selected\": true,\n * },\n * {\n * \"label\": \"Option 2\",\n * \"value\": \"option2\",\n * }]\n */\n @Prop({ reflect: false })\n readonly options?: {\n /** Label to display for the option */\n label: string;\n /** Value associated with the option */\n value: string;\n /** Whether this option is disabled */\n disabled?: boolean;\n /** Whether this option is pre-selected */\n selected?: boolean;\n }[];\n\n /**\n * Delay in milliseconds before the search is triggered when typing in the filter input.\n * @default 300\n */\n @Prop({ reflect: true })\n readonly debounceDelay: number = 300;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n /**\n * The text entered by the user for filtering dropdown items.\n */\n @State()\n filterText: string = '';\n\n @State()\n selectedValues: Set<string> = new Set();\n\n //#endregion STATE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when an item is clicked.\n */\n @Event()\n dropdownItemSelected: EventEmitter<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('options')\n handleOptionsChange(newValue: typeof this.options) {\n if (!newValue) return;\n\n if (!this.value) {\n const defaultValue = newValue.find(option => option.selected);\n this.value = defaultValue?.value ?? '';\n this.updateSelectedItem(this.value);\n }\n }\n\n @Watch('value')\n watchValueHandler(newValue: typeof this.value) {\n this.valueChanged.emit(newValue);\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LISTENERS\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n // Stop propagation to prevent the event from affecting parent components like dialogs\n event.stopPropagation();\n\n // Update `open` based on the popover state\n this.open = event.detail;\n }\n\n @Listen('dropdownItemSelected')\n handleDropdownItemSelected(\n event: CustomEvent<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >,\n ) {\n if (this.disabled || this.readonly) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n if (item !== event.target) {\n item.removeAttribute('selected');\n } else {\n item.setAttribute('selected', 'true');\n }\n });\n\n this.clearFilter();\n this.value = event.detail.value;\n this.open = false;\n }\n\n @Listen('blur', { capture: true })\n handleBlur(event: FocusEvent) {\n const target = event.relatedTarget;\n if (!(target instanceof Node) || !this.el.contains(target)) {\n this.open = false;\n\n if (this.inputElement) {\n this.filterText = '';\n this.inputElement.value = this.getSelectedLabel();\n setTimeout(() => {\n this.filterItems();\n }, 200);\n }\n }\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.el) return;\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll(\n 'nv-fielddropdownitem:not([disabled]):not([hidden])',\n ),\n ) as HTMLNvFielddropdownitemElement[];\n\n let currentIndex = items.findIndex(item =>\n item.classList.contains('highlighted'),\n );\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n currentIndex = (currentIndex + 1) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n currentIndex = (currentIndex - 1 + items.length) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.open = false;\n }\n }\n\n //#endregion LISTENERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.resetFilter();\n\n if (this.filterable && this.filterText) {\n this.filterItems();\n }\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n componentDidLoad() {\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n if (this.inputElement) {\n this.inputElement.value = this.getSelectedLabel();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Retrieves the current filter text entered by the user.\n * @returns {string} The filter text.\n */\n @Method()\n async getFilterText(): Promise<string> {\n return this.filterText;\n }\n\n private handleInputContainerClick = (event: MouseEvent) => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'P' || target.tagName === 'SPAN') {\n this.open = true;\n\n // Simulate focus to trigger \"focus-within\" style\n const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n // Remove the \"focus-within\" class after a delay or when the popover is closed\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n // Or remove the class when the popover is closed\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n private handleInput = (event: Event) => {\n if (!this.filterable) return;\n if (this.disabled || this.readonly) {\n return;\n }\n\n const input = event.target as HTMLInputElement;\n this.open = true;\n\n // Clear any existing timer\n if (this.debounceTimer) {\n window.clearTimeout(this.debounceTimer);\n }\n\n // Set a new timer for filtering\n this.debounceTimer = window.setTimeout(() => {\n this.filterText = input.value.toLowerCase();\n this.filterItems();\n }, this.debounceDelay);\n };\n\n /**\n * Filter dropdown items based on the text entered by the user.\n * If no items are found, display a message indicating no results.\n */\n private filterItems() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Remove the \"no results found\" item if it exists\n const existingEmptyItem = this.el.querySelector(\n 'nv-fielddropdownitem[data-empty]',\n );\n if (existingEmptyItem) {\n existingEmptyItem.remove();\n }\n\n let hasVisibleItems = false;\n\n // Iterate over all items and adjust their visibility\n items.forEach(item => {\n const textContent = item.textContent?.toLowerCase() || ''; // Get the textual content of the slot\n const value = item.value?.toLowerCase() || ''; // Get the value of the `value` attribute\n\n // Check if the filtered text is present either in the value or in the textual content\n const shouldShow =\n value.includes(this.filterText) ||\n textContent.includes(this.filterText);\n\n if (shouldShow) item.removeAttribute('hidden');\n else item.setAttribute('hidden', '');\n\n if (shouldShow) {\n hasVisibleItems = true;\n }\n });\n\n // If no items are visible, add the \"no results found\" item\n if (!hasVisibleItems) {\n const emptyItem = document.createElement('nv-fielddropdownitem');\n emptyItem.setAttribute('data-empty', 'true');\n emptyItem.setAttribute('disabled', 'true');\n emptyItem.textContent = this.emptyResult;\n this.el.querySelector('ul[slot=\"content\"]')?.appendChild(emptyItem);\n }\n }\n\n /** Reset the filter and make all items visible. */\n private resetFilter() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n item.style.display = '';\n });\n }\n\n private handleInputFocus = () => {\n if (this.disabled || this.readonly) return;\n this.open = true;\n };\n\n private togglePopover = () => {\n if (this.disabled || this.readonly) return;\n this.open = !this.open;\n };\n\n private updateHighlightedItem(\n items: HTMLNvFielddropdownitemElement[],\n index: number,\n ) {\n items.forEach((item, i) => {\n if (i === index) {\n item.classList.add('highlighted');\n item.focus();\n item.scrollIntoView({ block: 'nearest' });\n } else {\n item.classList.remove('highlighted');\n }\n });\n }\n\n private getSelectedLabel = (): string => {\n if (!this.value) return '';\n\n if (this.options?.length > 1) {\n const matchingItem = this.options.find(\n option => option.value === this.value,\n );\n return matchingItem?.label ?? matchingItem?.value ?? this.value;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(item => item.value === this.value);\n\n const selectedLabel = matchingItem\n ? matchingItem.label ??\n matchingItem.textContent?.trim() ??\n matchingItem.value\n : '';\n\n return selectedLabel;\n };\n\n private clearFilter = () => {\n if (!this.filterable) return;\n\n this.filterText = '';\n this.inputElement.value = this.getSelectedLabel();\n this.inputElement.focus();\n this.filterItems();\n };\n\n private updateSelectedItem(value: string) {\n if (!value) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(item => {\n const itemLabel = item.getAttribute('label');\n const itemValue = item.getAttribute('value');\n const itemText = item.textContent?.trim();\n return itemLabel === value || itemValue === value || itemText === value;\n });\n\n items.forEach(item => {\n if (item === matchingItem) {\n item.setAttribute('selected', '');\n } else {\n item.removeAttribute('selected');\n }\n });\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n role=\"combobox\"\n aria-expanded={this.open.toString()}\n aria-haspopup=\"listbox\"\n aria-label={this.label}\n >\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n <nv-popover\n ref={el => (this.popoverElement = el as HTMLNvPopoverElement)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.filterable || this.disabled || this.readonly ? (\n <input\n data-scope=\"focusable\"\n id={this.inputId}\n type=\"search\"\n ref={e => (this.inputElement = e)}\n autofocus={this.autofocus}\n autocomplete={this.autocomplete}\n placeholder={this.placeholder}\n name={this.name}\n value={this.getSelectedLabel()}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n onFocus={this.handleInputFocus}\n onClick={this.handleInputFocus}\n onKeyDown={this.handleKeyDown}\n />\n ) : (\n <p\n data-scope=\"focusable\"\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClick}\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleInputFocus}\n >\n {this.getSelectedLabel() || this.value || this.placeholder}\n </p>\n )}\n\n {this.filterable && this.filterText && this.open && (\n <nv-iconbutton\n name=\"x\"\n size=\"md\"\n emphasis=\"lower\"\n class=\"clear-button\"\n onClick={this.clearFilter}\n aria-label=\"Clear input\"\n />\n )}\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n\n <nv-iconbutton\n data-scope=\"toggle-dropdown\"\n name={this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide dropdown' : 'Show dropdown'}\n aria-pressed={this.open.toString()}\n onClick={this.togglePopover}\n tabIndex={this.disabled ? -1 : 0}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div\n slot=\"content\"\n style={this.maxHeight ? { maxHeight: this.maxHeight } : {}}\n >\n {this.options?.length > 0 ? (\n <ul>\n {this.options.map(option => (\n <nv-fielddropdownitem\n label={option.label}\n value={option.value}\n disabled={option.disabled}\n selected={option.value === this.value}\n />\n ))}\n </ul>\n ) : (\n <slot name=\"content\"></slot>\n )}\n </div>\n </nv-popover>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n /****************************************************************************/\n}\n"],"version":3}
|
|
1
|
+
{"file":"nv-fielddropdown.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,g0SAAg0S,CAAC;AAC51S,8BAAe,kBAAkB;;MC+BpB,eAAe;IAN5B;;;;;;;;;;;;QA6BW,YAAO,GAAWA,KAAM,EAAE,CAAC;;;;;;;QA2C3B,iBAAY,GAA+B,KAAK,CAAC;;;;;QAejD,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQ1B,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQ1B,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQ1B,UAAK,GAAY,KAAK,CAAC;;;;QAcvB,cAAS,GAAW,EAAE,CAAC;;;;QAMhC,SAAI,GAAY,KAAK,CAAC;;;;QAMb,gBAAW,GAAW,kBAAkB,CAAC;;;;QAMzC,eAAU,GAAY,KAAK,CAAC;;;;;QAkC5B,kBAAa,GAAW,GAAG,CAAC;;;;;;QAS5B,cAAS,GAAY,KAAK,CAAC;;;;QAM3B,UAAK,GAAY,KAAK,CAAC;;;;;;;QAUhC,eAAU,GAAW,EAAE,CAAC;QAGxB,mBAAc,GAAgB,IAAI,GAAG,EAAE,CAAC;QA2LhC,8BAAyB,GAAG,CAAC,KAAiB;YACpD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAClC,OAAO;aACR;YAED,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;YAE3C,IAAI,MAAM,CAAC,OAAO,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,EAAE;gBACvD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;gBAGjB,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAC1C,kBAAkB,CACJ,CAAC;gBACjB,IAAI,cAAc,EAAE;oBAClB,cAAc,CAAC,SAAS,CAAC,GA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AAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fielddropdown/styles/nv-fielddropdown.scss?tag=nv-fielddropdown","src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"sourcesContent":["@use './mixins' as *;\n@import '../../../styles/form-field';\n@import '../../../styles/scrollbar';\n\nnv-fielddropdown {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid='false']) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n &[hidden]:not([hidden='false']) label {\n display: none;\n }\n\n label {\n @include form-field-label();\n }\n\n nv-popover {\n @include form-field-popover();\n\n div[slot='content'] {\n @include scrollbar();\n max-height: calc(90vh - var(--list-dropdown-padding) * 2);\n overflow-y: auto;\n position: relative;\n }\n }\n\n .input-wrapper {\n @include form-field-input-wrapper();\n @include input-wrapper-styles();\n }\n\n .input-container {\n @include form-field-input-container();\n @include input-container-styles();\n\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n input,\n p.non-filterable-text {\n @include form-field-input();\n }\n\n > nv-iconbutton {\n @include form-field-action();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n\n .non-filterable-text {\n @include non-filterable-text-styles();\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\n\nimport { v4 as uuidv4 } from 'uuid';\nimport { TextInputAutocomplete } from '../../utils/constants';\n\n/**\n * @slot content - Use a <ul></ul> tag for the slot, and place <nv-dropdownitem> elements inside.\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fielddropdown',\n styleUrl: 'styles/nv-fielddropdown.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFielddropdown {\n @Element() el: HTMLNvFielddropdownElement;\n private inputElement!: HTMLInputElement;\n private popoverElement!: HTMLNvPopoverElement;\n /**\n * Timer for debouncing input events.\n * Private property preferred over @State as it:\n * - Doesn't need to trigger re-renders\n * - Is purely for internal logic\n * - Improves performance by avoiding Stencil's reactivity system\n */\n private debounceTimer: number;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input's data in form submissions. It should be\n * unique within the form to avoid conflicts.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It's a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text input field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Display temporary text inside the input field to give users a hint about\n * what to type. It's a great way to provide examples or suggestions directly\n * in the field before they start typing.\n * The placeholder is displayed only when the filterable option is enabled.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they've used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}` = 'off';\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input's value is managed by the component's state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * Marks the input field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Display the input field's content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won't be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * The disabled prop lets you turn off the input field so that users can't\n * type in it. When disabled, the field is grayed out and won't respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Alters the input field's appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the dropdown\n * field.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\n\n /**\n * Defines the maximum height of the multiselect list when open.\n */\n @Prop({ reflect: true })\n readonly maxHeight: string = '';\n\n /**\n * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * The text to display when no items match the filter.\n */\n @Prop({ reflect: true })\n readonly emptyResult: string = 'No results found';\n\n /**\n * Enables or disables the filtering feature for the dropdown items.\n */\n @Prop({ reflect: true })\n readonly filterable: boolean = false;\n\n /**\n * List of options used to automatically generate dropdown items. This\n * provides an alternative to using the slot manually.\n *\n * @example\n * options=[{\n * \"label\": \"Option 1\",\n * \"value\": \"option1\",\n * \"selected\": true,\n * },\n * {\n * \"label\": \"Option 2\",\n * \"value\": \"option2\",\n * }]\n */\n @Prop({ reflect: false })\n readonly options?: {\n /** Label to display for the option */\n label: string;\n /** Value associated with the option */\n value: string;\n /** Whether this option is disabled */\n disabled?: boolean;\n /** Whether this option is pre-selected */\n selected?: boolean;\n }[];\n\n /**\n * Delay in milliseconds before the search is triggered when typing in the filter input.\n * @default 300\n */\n @Prop({ reflect: true })\n readonly debounceDelay: number = 300;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n /**\n * The text entered by the user for filtering dropdown items.\n */\n @State()\n filterText: string = '';\n\n @State()\n selectedValues: Set<string> = new Set();\n\n //#endregion STATE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when an item is clicked.\n */\n @Event()\n dropdownItemSelected: EventEmitter<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('options')\n handleOptionsChange(newValue: typeof this.options) {\n if (!newValue) return;\n\n if (!this.value) {\n const defaultValue = newValue.find(option => option.selected);\n this.value = defaultValue?.value ?? '';\n this.updateSelectedItem(this.value);\n }\n }\n\n @Watch('value')\n watchValueHandler(newValue: typeof this.value) {\n this.valueChanged.emit(newValue);\n }\n\n @Watch('open')\n handleOpenChange(newOpen: boolean) {\n // React to external changes, e.g., clear filter or refilter on open\n if (newOpen && this.filterable) {\n this.filterItems(); // Ensure items are filtered if filterText exists\n } else if (!newOpen) {\n this.clearFilter(); // Clear on external close\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LISTENERS\n\n @Listen('openChanged')\n handleOpenChanged(\n event: CustomEvent<HTMLNvPopoverElementEventMap['openChanged']>,\n ) {\n // Stop propagation to prevent the event from affecting parent components like dialogs\n event.stopPropagation();\n\n // Update `open` based on the popover state\n if (event.target === this.popoverElement) {\n this.open = event.detail;\n }\n\n if (!event.detail && this.filterable) {\n this.clearFilter();\n }\n }\n\n @Listen('dropdownItemSelected')\n handleDropdownItemSelected(\n event: CustomEvent<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >,\n ) {\n if (this.disabled || this.readonly) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n if (item !== event.target) {\n item.removeAttribute('selected');\n } else {\n item.setAttribute('selected', 'true');\n }\n });\n\n this.clearFilter();\n this.value = event.detail.value;\n this.open = false;\n }\n\n @Listen('blur', { capture: true })\n handleBlur(event: FocusEvent) {\n const target = event.relatedTarget;\n if (!(target instanceof Node) || !this.el.contains(target)) {\n this.open = false;\n\n if (this.inputElement) {\n this.filterText = '';\n this.inputElement.value = this.getSelectedLabel();\n setTimeout(() => {\n this.filterItems();\n }, 200);\n }\n }\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.el) return;\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll(\n 'nv-fielddropdownitem:not([disabled]):not([hidden])',\n ),\n ) as HTMLNvFielddropdownitemElement[];\n\n let currentIndex = items.findIndex(item =>\n item.classList.contains('highlighted'),\n );\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n currentIndex = (currentIndex + 1) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n currentIndex = (currentIndex - 1 + items.length) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.open = false;\n }\n }\n\n //#endregion LISTENERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.resetFilter();\n\n if (this.filterable && this.filterText) {\n this.filterItems();\n }\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n componentDidLoad() {\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n if (this.inputElement) {\n this.inputElement.value = this.getSelectedLabel();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Retrieves the current filter text entered by the user.\n * @returns {string} The filter text.\n */\n @Method()\n async getFilterText(): Promise<string> {\n return this.filterText;\n }\n\n private handleInputContainerClick = (event: MouseEvent) => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'P' || target.tagName === 'SPAN') {\n this.open = true;\n\n // Simulate focus to trigger \"focus-within\" style\n const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n // Remove the \"focus-within\" class after a delay or when the popover is closed\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n // Or remove the class when the popover is closed\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n private handleInput = (event: Event) => {\n if (!this.filterable) return;\n if (this.disabled || this.readonly) {\n return;\n }\n\n const input = event.target as HTMLInputElement;\n this.open = true;\n\n // Clear any existing timer\n if (this.debounceTimer) {\n window.clearTimeout(this.debounceTimer);\n }\n\n // Set a new timer for filtering\n this.debounceTimer = window.setTimeout(() => {\n this.filterText = input.value.toLowerCase();\n this.filterItems();\n }, this.debounceDelay);\n };\n\n /**\n * Filter dropdown items based on the text entered by the user.\n * If no items are found, display a message indicating no results.\n */\n private filterItems() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Remove the \"no results found\" item if it exists\n const existingEmptyItem = this.el.querySelector(\n 'nv-fielddropdownitem[data-empty]',\n );\n if (existingEmptyItem) {\n existingEmptyItem.remove();\n }\n\n let hasVisibleItems = false;\n\n // Iterate over all items and adjust their visibility\n items.forEach(item => {\n const textContent = item.textContent?.toLowerCase() || ''; // Get the textual content of the slot\n const value = item.value?.toLowerCase() || ''; // Get the value of the `value` attribute\n\n // Check if the filtered text is present either in the value or in the textual content\n const shouldShow =\n value.includes(this.filterText) ||\n textContent.includes(this.filterText);\n\n if (shouldShow) item.removeAttribute('hidden');\n else item.setAttribute('hidden', '');\n\n if (shouldShow) {\n hasVisibleItems = true;\n }\n });\n\n // If no items are visible, add the \"no results found\" item\n if (!hasVisibleItems) {\n const emptyItem = document.createElement('nv-fielddropdownitem');\n emptyItem.setAttribute('data-empty', 'true');\n emptyItem.setAttribute('disabled', 'true');\n emptyItem.textContent = this.emptyResult;\n this.el.querySelector('ul[slot=\"content\"]')?.appendChild(emptyItem);\n }\n }\n\n /** Reset the filter and make all items visible. */\n private resetFilter() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n item.style.display = '';\n });\n }\n\n private handleInputFocus = () => {\n if (this.disabled || this.readonly) return;\n this.open = true;\n };\n\n private togglePopover = () => {\n if (this.disabled || this.readonly) return;\n this.open = !this.open;\n };\n\n private updateHighlightedItem(\n items: HTMLNvFielddropdownitemElement[],\n index: number,\n ) {\n items.forEach((item, i) => {\n if (i === index) {\n item.classList.add('highlighted');\n item.focus();\n item.scrollIntoView({ block: 'nearest' });\n } else {\n item.classList.remove('highlighted');\n }\n });\n }\n\n private getSelectedLabel = (): string => {\n if (!this.value) return '';\n\n if (this.options?.length > 1) {\n const matchingItem = this.options.find(\n option => option.value === this.value,\n );\n return matchingItem?.label ?? matchingItem?.value ?? this.value;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(item => item.value === this.value);\n\n const selectedLabel = matchingItem\n ? matchingItem.label ??\n matchingItem.textContent?.trim() ??\n matchingItem.value\n : '';\n\n return selectedLabel;\n };\n\n private clearFilter = () => {\n if (!this.filterable) return;\n\n this.filterText = '';\n this.inputElement.value = this.getSelectedLabel();\n this.inputElement.focus();\n this.filterItems();\n };\n\n private updateSelectedItem(value: string) {\n if (!value) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(item => {\n const itemLabel = item.getAttribute('label');\n const itemValue = item.getAttribute('value');\n const itemText = item.textContent?.trim();\n return itemLabel === value || itemValue === value || itemText === value;\n });\n\n items.forEach(item => {\n if (item === matchingItem) {\n item.setAttribute('selected', '');\n } else {\n item.removeAttribute('selected');\n }\n });\n }\n\n private handleBlurInput = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n if (\n !this.el.contains(relatedTarget) &&\n !this.popoverElement?.contains(relatedTarget)\n ) {\n this.open = false;\n if (this.filterable) {\n this.clearFilter(); // Resets input to selected label, clears filterText\n }\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n role=\"combobox\"\n aria-expanded={this.open.toString()}\n aria-haspopup=\"listbox\"\n aria-label={this.label}\n >\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n <nv-popover\n ref={el => (this.popoverElement = el as HTMLNvPopoverElement)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.filterable || this.disabled || this.readonly ? (\n <input\n data-scope=\"focusable\"\n id={this.inputId}\n type=\"search\"\n ref={e => (this.inputElement = e)}\n autofocus={this.autofocus}\n autocomplete={this.autocomplete}\n placeholder={this.placeholder}\n name={this.name}\n value={this.getSelectedLabel()}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n onFocus={this.handleInputFocus}\n onClick={this.handleInputFocus}\n onKeyDown={this.handleKeyDown}\n onBlur={this.handleBlurInput}\n />\n ) : (\n <p\n data-scope=\"focusable\"\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClick}\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleInputFocus}\n onBlur={this.handleBlurInput}\n >\n {this.getSelectedLabel() || this.value || this.placeholder}\n </p>\n )}\n\n {this.filterable && this.filterText && this.open && (\n <nv-iconbutton\n name=\"x\"\n size=\"md\"\n emphasis=\"lower\"\n class=\"clear-button\"\n onClick={this.clearFilter}\n aria-label=\"Clear input\"\n />\n )}\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n\n <nv-iconbutton\n data-scope=\"toggle-dropdown\"\n name={this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide dropdown' : 'Show dropdown'}\n onClick={this.togglePopover}\n tabIndex={this.disabled ? -1 : 0}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div\n slot=\"content\"\n style={this.maxHeight ? { maxHeight: this.maxHeight } : {}}\n >\n {this.options?.length > 0 ? (\n <ul>\n {this.options.map(option => (\n <nv-fielddropdownitem\n label={option.label}\n value={option.value}\n disabled={option.disabled}\n selected={option.value === this.value}\n />\n ))}\n </ul>\n ) : (\n <slot name=\"content\"></slot>\n )}\n </div>\n </nv-popover>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n /****************************************************************************/\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-93d3b2f8.js');
|
|
6
6
|
|
|
7
7
|
const nvFielddropdownitemCss = "nv-fielddropdownitem{display:flex;gap:var(--spacing-2);flex-wrap:wrap;align-items:center;width:100%;padding:var(--list-dropdown-item-padding-y) var(--list-dropdown-item-padding-x);font-weight:var(--menu-contextual-item-font-weight);font-size:var(--list-dropdown-font-size);line-height:var(--list-dropdown-line-height);color:var(--components-list-dropdown-item-label-default);border-radius:var(--list-dropdown-item-radius);transition:background-color 150ms ease-out, color 150ms ease-out;cursor:pointer}nv-fielddropdownitem:hover,nv-fielddropdownitem:focus,nv-fielddropdownitem:focus-within{background-color:var(--components-list-dropdown-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-fielddropdownitem[disabled]:not([disabled=false]){cursor:not-allowed;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}nv-fielddropdownitem .text-wrapper{display:flex;flex-grow:1;align-items:center;justify-content:space-between}nv-fielddropdownitem [data-scope=text]{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nv-fielddropdownitem nv-icon[data-scope=selected]{color:var(--components-list-dropdown-item-label-default);align-self:center;margin-left:auto}";
|
|
8
8
|
const NvFielddropdownitemStyle0 = nvFielddropdownitemCss;
|