@nova-design-system/nova-webcomponents 3.0.0-beta.41 → 3.0.0-beta.43
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/_commonjsHelpers-b3309d7b.js +12 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/dist/cjs/{constants-79d2cdfc.js → constants-bcd6b2e2.js} +100 -2
- package/dist/cjs/constants-bcd6b2e2.js.map +1 -0
- package/dist/cjs/{index-5910ba06.js → index-9bda5507.js} +1364 -1182
- package/dist/cjs/index-9bda5507.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/inputmask-76b7b93f.js +3763 -0
- package/dist/cjs/inputmask-76b7b93f.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/native.cjs.js +3 -3
- package/dist/cjs/native.cjs.js.map +1 -1
- package/dist/cjs/nv-alert.cjs.entry.js +3 -3
- package/dist/cjs/nv-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-avatar.cjs.entry.js +3 -3
- package/dist/cjs/nv-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-badge_2.cjs.entry.js +16 -5
- package/dist/cjs/nv-badge_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-base.cjs.entry.js +2 -2
- package/dist/cjs/nv-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/nv-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/nv-button.cjs.entry.js +3 -3
- package/dist/cjs/nv-calendar.cjs.entry.js +77 -22
- package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-col.cjs.entry.js +2 -2
- package/dist/cjs/nv-datagrid.cjs.entry.js +267 -5
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +2 -2
- package/dist/cjs/nv-dialog.cjs.entry.js +15 -10
- package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +4 -4
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +6 -6
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddate.cjs.entry.js +281 -0
- package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +358 -0
- package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +13 -24
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +22 -30
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +9 -6
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +5 -13
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +4 -4
- package/dist/cjs/nv-fieldradio.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldselect.cjs.entry.js +7 -7
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +5 -5
- package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +4 -4
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +12 -12
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +4 -4
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/{nv-iconbutton.cjs.entry.js → nv-iconbutton_2.cjs.entry.js} +44 -3
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-menu.cjs.entry.js +5 -5
- package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +5 -5
- package/dist/cjs/nv-menuitem.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +31 -18
- package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +2 -2
- package/dist/cjs/nv-stack.cjs.entry.js +2 -2
- package/dist/cjs/nv-table.cjs.entry.js +3 -3
- package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +3 -3
- package/dist/cjs/nv-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/collection-manifest.json +4 -2
- package/dist/collection/components/nv-alert/nv-alert.js +2 -2
- package/dist/collection/components/nv-alert/nv-alert.js.map +1 -1
- package/dist/collection/components/nv-avatar/nv-avatar.js +8 -8
- package/dist/collection/components/nv-avatar/nv-avatar.js.map +1 -1
- package/dist/collection/components/nv-badge/nv-badge.js +4 -4
- package/dist/collection/components/nv-badge/nv-badge.js.map +1 -1
- package/dist/collection/components/nv-base/nv-base.js +1 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js +1 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js +1 -1
- package/dist/collection/components/nv-button/nv-button.js +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.css +13 -8
- package/dist/collection/components/nv-calendar/nv-calendar.js +82 -24
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
- package/dist/collection/components/nv-col/nv-col.js +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +24 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +89 -6
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js +13 -8
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +1 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.css +56 -40
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +7 -7
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js.map +1 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js +335 -0
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js.map +1 -0
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +845 -0
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -0
- package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +165 -0
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js +284 -0
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +1 -0
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +988 -0
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -0
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +192 -0
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +11 -22
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +14 -16
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.css +1 -0
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +12 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.css +22 -24
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +1 -4
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +19 -48
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +17 -21
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +9 -6
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +9 -10
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +3 -11
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +5 -5
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js.map +1 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +30 -15
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +8 -8
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +15 -16
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +6 -6
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +5 -5
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +11 -11
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/{nv-fieldtime.css → styles/nv-fieldtime.css} +20 -32
- package/dist/collection/components/nv-icon/nv-icon.js +8 -8
- package/dist/collection/components/nv-icon/nv-icon.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +31 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js.map +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.css +3 -0
- package/dist/collection/components/nv-menu/nv-menu.docs.js +6 -6
- package/dist/collection/components/nv-menu/nv-menu.docs.js.map +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +11 -12
- package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.css +3 -0
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +27 -9
- package/dist/collection/components/nv-menuitem/nv-menuitem.js.map +1 -1
- package/dist/collection/components/nv-popover/nv-popover.css +5 -5
- package/dist/collection/components/nv-popover/nv-popover.docs.js +3 -3
- package/dist/collection/components/nv-popover/nv-popover.docs.js.map +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +38 -37
- package/dist/collection/components/nv-popover/nv-popover.js.map +1 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +2 -2
- package/dist/collection/components/nv-toggle/nv-toggle.js +9 -9
- package/dist/collection/components/nv-toggle/nv-toggle.js.map +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.css +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +4 -4
- package/dist/collection/components/nv-tooltip/nv-tooltip.js.map +1 -1
- package/dist/collection/utils/constants.js +94 -0
- package/dist/collection/utils/constants.js.map +1 -1
- package/dist/collection/utils/input.utils.js +20 -0
- package/dist/collection/utils/input.utils.js.map +1 -0
- package/dist/collection/utils/test/input.utils.test.js +42 -0
- package/dist/collection/utils/test/input.utils.test.js.map +1 -0
- package/dist/components/index.js +2 -2
- package/dist/components/nv-alert.js +5 -5
- package/dist/components/nv-alert.js.map +1 -1
- package/dist/components/nv-avatar.js +11 -11
- package/dist/components/nv-avatar.js.map +1 -1
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-base.js +2 -2
- package/dist/components/nv-breadcrumb.js +4 -4
- package/dist/components/nv-breadcrumbs.js +2 -2
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-calendar.js +1 -1039
- package/dist/components/nv-calendar.js.map +1 -1
- package/dist/components/nv-col.js +2 -2
- package/dist/components/nv-datagrid.js +272 -7
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-datagridcolumn.js +2 -2
- package/dist/components/nv-dialog.js +20 -15
- 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.d.ts +11 -0
- package/dist/components/nv-fielddate.js +359 -0
- package/dist/components/nv-fielddate.js.map +1 -0
- package/dist/components/nv-fielddaterange.d.ts +11 -0
- package/dist/components/nv-fielddaterange.js +440 -0
- package/dist/components/nv-fielddaterange.js.map +1 -0
- package/dist/components/nv-fielddropdown.js +18 -29
- 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 +30 -40
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +25 -10
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldpassword.js +8 -16
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +6 -6
- package/dist/components/nv-fieldradio.js.map +1 -1
- package/dist/components/nv-fieldselect.js +24 -12
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldtext.js +9 -9
- package/dist/components/nv-fieldtext.js.map +1 -1
- package/dist/components/nv-fieldtextarea.js +6 -6
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-fieldtime.js +16 -16
- 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 +12 -12
- package/dist/components/nv-menu.js.map +1 -1
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +2 -2
- package/dist/components/nv-stack.js +2 -2
- package/dist/components/nv-table.js +3 -3
- package/dist/components/nv-tablecolumn.js +1 -1
- package/dist/components/nv-toggle.js +10 -10
- package/dist/components/nv-toggle.js.map +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-d17558a8.js → p-057ae4f2.js} +41 -1201
- package/dist/components/p-057ae4f2.js.map +1 -0
- package/dist/components/{p-ba145f46.js → p-1a4f9c97.js} +5 -5
- package/dist/components/{p-ba145f46.js.map → p-1a4f9c97.js.map} +1 -1
- package/dist/components/{p-77d0fedc.js → p-1c45c0f2.js} +1283 -1208
- package/dist/components/p-1c45c0f2.js.map +1 -0
- package/dist/components/{p-11cc38e0.js → p-1e095bba.js} +21 -6
- package/dist/components/p-1e095bba.js.map +1 -0
- package/dist/components/{p-4bb5eb79.js → p-1fad2529.js} +16 -5
- package/dist/components/p-1fad2529.js.map +1 -0
- package/dist/components/{p-f201db34.js → p-3a3ba5b1.js} +3 -3
- package/dist/components/{p-f201db34.js.map → p-3a3ba5b1.js.map} +1 -1
- package/dist/components/p-3aa6f6dc.js +1104 -0
- package/dist/components/p-3aa6f6dc.js.map +1 -0
- package/dist/components/{p-69543282.js → p-4c6ba63c.js} +8 -7
- package/dist/components/p-4c6ba63c.js.map +1 -0
- package/dist/components/{p-a633892a.js → p-4c6d8df7.js} +3 -3
- package/dist/components/{p-a633892a.js.map → p-4c6d8df7.js.map} +1 -1
- package/dist/components/p-55202370.js +172 -0
- package/dist/components/p-55202370.js.map +1 -0
- package/dist/components/{p-1657eba4.js → p-56716b97.js} +7 -7
- package/dist/components/{p-1657eba4.js.map → p-56716b97.js.map} +1 -1
- package/dist/components/{p-33f9bdb1.js → p-7f142767.js} +7 -7
- package/dist/components/{p-33f9bdb1.js.map → p-7f142767.js.map} +1 -1
- package/dist/components/{p-b316c35d.js → p-8348db09.js} +99 -3
- package/dist/components/p-8348db09.js.map +1 -0
- package/dist/components/p-89fb308b.js +3761 -0
- package/dist/components/p-89fb308b.js.map +1 -0
- package/dist/components/{p-4b184820.js → p-9476354d.js} +4 -4
- package/dist/components/{p-4b184820.js.map → p-9476354d.js.map} +1 -1
- package/dist/components/{p-fad78896.js → p-a8b5969f.js} +8 -8
- package/dist/components/p-a8b5969f.js.map +1 -0
- package/dist/components/{p-f77c3072.js → p-ebf24fd0.js} +11 -11
- package/dist/components/p-ebf24fd0.js.map +1 -0
- package/dist/docs.json +1822 -151
- package/dist/esm/_commonjsHelpers-1789f0cf.js +9 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/dist/esm/{constants-75e6d7f0.js → constants-98e2dcc2.js} +99 -3
- package/dist/esm/constants-98e2dcc2.js.map +1 -0
- package/dist/esm/{index-fac2d5d2.js → index-1fb7a9a6.js} +1364 -1182
- package/dist/esm/index-1fb7a9a6.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/inputmask-edcad3c1.js +3761 -0
- package/dist/esm/inputmask-edcad3c1.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/native.js +4 -4
- package/dist/esm/native.js.map +1 -1
- package/dist/esm/nv-alert.entry.js +3 -3
- package/dist/esm/nv-alert.entry.js.map +1 -1
- package/dist/esm/nv-avatar.entry.js +3 -3
- package/dist/esm/nv-avatar.entry.js.map +1 -1
- package/dist/esm/nv-badge_2.entry.js +16 -5
- package/dist/esm/nv-badge_2.entry.js.map +1 -1
- package/dist/esm/nv-base.entry.js +2 -2
- package/dist/esm/nv-breadcrumb.entry.js +2 -2
- package/dist/esm/nv-breadcrumbs.entry.js +2 -2
- package/dist/esm/nv-button.entry.js +3 -3
- package/dist/esm/nv-calendar.entry.js +73 -18
- package/dist/esm/nv-calendar.entry.js.map +1 -1
- package/dist/esm/nv-col.entry.js +2 -2
- package/dist/esm/nv-datagrid.entry.js +267 -5
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-datagridcolumn.entry.js +2 -2
- package/dist/esm/nv-dialog.entry.js +15 -10
- package/dist/esm/nv-dialog.entry.js.map +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +4 -4
- package/dist/esm/nv-fieldcheckbox.entry.js +6 -6
- package/dist/esm/nv-fieldcheckbox.entry.js.map +1 -1
- package/dist/esm/nv-fielddate.entry.js +277 -0
- package/dist/esm/nv-fielddate.entry.js.map +1 -0
- package/dist/esm/nv-fielddaterange.entry.js +354 -0
- package/dist/esm/nv-fielddaterange.entry.js.map +1 -0
- package/dist/esm/nv-fielddropdown.entry.js +13 -24
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +2 -2
- package/dist/esm/nv-fieldmultiselect.entry.js +22 -30
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +9 -6
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +5 -13
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
- package/dist/esm/nv-fieldradio.entry.js +4 -4
- package/dist/esm/nv-fieldradio.entry.js.map +1 -1
- package/dist/esm/nv-fieldselect.entry.js +7 -7
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldtext.entry.js +5 -5
- package/dist/esm/nv-fieldtext.entry.js.map +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +4 -4
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-fieldtime.entry.js +12 -12
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +4 -4
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/{nv-iconbutton.entry.js → nv-iconbutton_2.entry.js} +44 -4
- package/dist/esm/nv-iconbutton_2.entry.js.map +1 -0
- package/dist/esm/nv-menu.entry.js +5 -5
- package/dist/esm/nv-menu.entry.js.map +1 -1
- package/dist/esm/nv-menuitem.entry.js +5 -5
- package/dist/esm/nv-menuitem.entry.js.map +1 -1
- package/dist/esm/nv-popover.entry.js +31 -18
- package/dist/esm/nv-popover.entry.js.map +1 -1
- package/dist/esm/nv-row.entry.js +2 -2
- package/dist/esm/nv-stack.entry.js +2 -2
- package/dist/esm/nv-table.entry.js +3 -3
- package/dist/esm/nv-tablecolumn.entry.js +1 -1
- package/dist/esm/nv-toggle.entry.js +3 -3
- package/dist/esm/nv-toggle.entry.js.map +1 -1
- package/dist/esm/nv-tooltip.entry.js +3 -3
- package/dist/esm/nv-tooltip.entry.js.map +1 -1
- package/dist/native/index.esm.js +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/p-0462f723.js +2 -0
- package/dist/native/p-0462f723.js.map +1 -0
- package/dist/native/{p-8664ab16.entry.js → p-048486e0.entry.js} +3 -3
- package/dist/native/p-048486e0.entry.js.map +1 -0
- package/dist/native/{p-fca807b4.entry.js → p-04c6048a.entry.js} +3 -3
- package/dist/native/{p-fca807b4.entry.js.map → p-04c6048a.entry.js.map} +1 -1
- package/dist/native/p-1a46cb52.entry.js +2 -0
- package/dist/native/p-2281d5ef.entry.js +2 -0
- package/dist/native/p-2281d5ef.entry.js.map +1 -0
- package/dist/native/p-22a45102.entry.js +2 -0
- package/dist/native/p-22a45102.entry.js.map +1 -0
- package/dist/native/p-2ed540e3.entry.js +2 -0
- package/dist/native/p-2ed540e3.entry.js.map +1 -0
- package/dist/native/p-31184fdd.entry.js +2 -0
- package/dist/native/p-31184fdd.entry.js.map +1 -0
- package/dist/native/p-314d2b34.entry.js +2 -0
- package/dist/native/p-314d2b34.entry.js.map +1 -0
- package/dist/native/p-332c5d6c.entry.js +2 -0
- package/dist/native/p-332c5d6c.entry.js.map +1 -0
- package/dist/native/p-3af5bcc1.entry.js +2 -0
- package/dist/native/p-3af5bcc1.entry.js.map +1 -0
- package/dist/native/{p-e36e956b.entry.js → p-442f04f9.entry.js} +2 -2
- package/dist/native/{p-af60740c.entry.js → p-45577c7f.entry.js} +2 -2
- package/dist/native/p-45577c7f.entry.js.map +1 -0
- package/dist/native/p-464ef88f.entry.js +2 -0
- package/dist/native/p-464ef88f.entry.js.map +1 -0
- package/dist/native/p-46aa1136.entry.js +2 -0
- package/dist/native/{p-27ad7af2.entry.js → p-4a440970.entry.js} +2 -2
- package/dist/native/p-4a440970.entry.js.map +1 -0
- package/dist/native/p-4dc1d036.entry.js +2 -0
- package/dist/native/{p-e9e77494.entry.js → p-514101d6.entry.js} +2 -2
- package/dist/native/p-514101d6.entry.js.map +1 -0
- package/dist/native/p-53aa81dd.js +10 -0
- package/dist/native/p-53aa81dd.js.map +1 -0
- package/dist/native/{p-1a3d2a74.entry.js → p-56e98443.entry.js} +2 -2
- package/dist/native/p-56e98443.entry.js.map +1 -0
- package/dist/native/{p-b316c35d.js → p-59768ee5.js} +2 -2
- package/dist/native/p-59768ee5.js.map +1 -0
- package/dist/native/{p-edee1c1f.entry.js → p-62df7dd4.entry.js} +2 -2
- package/dist/native/p-665db087.entry.js +2 -0
- package/dist/native/p-68b5a92c.entry.js +2 -0
- package/dist/native/{p-b58c661b.entry.js → p-6a629671.entry.js} +2 -2
- package/dist/native/p-7fade532.entry.js +2 -0
- package/dist/native/p-7fade532.entry.js.map +1 -0
- package/dist/native/p-913907fb.entry.js +2 -0
- package/dist/native/p-913907fb.entry.js.map +1 -0
- package/dist/native/p-942f8e92.entry.js +2 -0
- package/dist/native/p-942f8e92.entry.js.map +1 -0
- package/dist/native/p-9f5e4dfc.entry.js +2 -0
- package/dist/native/p-9f5e4dfc.entry.js.map +1 -0
- package/dist/native/p-ab002252.js +3 -0
- package/dist/native/p-ab002252.js.map +1 -0
- package/dist/native/{p-fde56f9c.entry.js → p-ab84ff42.entry.js} +2 -2
- package/dist/native/{p-fde56f9c.entry.js.map → p-ab84ff42.entry.js.map} +1 -1
- package/dist/native/{p-487b81bd.entry.js → p-b052f1cb.entry.js} +2 -2
- package/dist/native/{p-9795090f.entry.js → p-bdabd495.entry.js} +2 -2
- package/dist/native/p-bdabd495.entry.js.map +1 -0
- package/dist/native/p-be4fc827.entry.js +2 -0
- package/dist/native/p-be4fc827.entry.js.map +1 -0
- package/dist/native/{p-184cd119.entry.js → p-c10e5113.entry.js} +2 -2
- package/dist/native/{p-491f4605.entry.js → p-d5cbf5c8.entry.js} +2 -2
- package/dist/native/{p-491f4605.entry.js.map → p-d5cbf5c8.entry.js.map} +1 -1
- package/dist/native/{p-69fb1c9d.entry.js → p-db2902d6.entry.js} +2 -2
- package/dist/native/p-ecc28398.entry.js +2 -0
- package/dist/native/p-ecc28398.entry.js.map +1 -0
- package/dist/native/p-ed595c96.entry.js +2 -0
- package/dist/native/p-ed595c96.entry.js.map +1 -0
- package/dist/native/p-f5e0d5c5.entry.js +2 -0
- package/dist/native/p-f5e0d5c5.entry.js.map +1 -0
- package/dist/native/p-f89b7d06.entry.js +2 -0
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +7 -0
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +21 -0
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +1 -0
- package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +192 -0
- package/dist/types/components/nv-fielddate/nv-fielddate.docs.d.ts +4 -0
- package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +206 -0
- package/dist/types/components/nv-fielddaterange/nv-fielddaterange.docs.d.ts +4 -0
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +1 -3
- package/dist/types/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.d.ts +2 -0
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +1 -11
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +1 -0
- package/dist/types/components/nv-fieldpassword/nv-fieldpassword.d.ts +0 -1
- package/dist/types/components/nv-iconbutton/nv-iconbutton.d.ts +3 -0
- package/dist/types/components/nv-menu/nv-menu.d.ts +2 -3
- package/dist/types/components/nv-menuitem/nv-menuitem.d.ts +20 -16
- package/dist/types/components/nv-popover/nv-popover.d.ts +7 -4
- package/dist/types/components.d.ts +2344 -974
- package/dist/types/utils/constants.d.ts +6 -0
- package/dist/types/utils/input.utils.d.ts +8 -0
- package/dist/types/utils/test/input.utils.test.d.ts +1 -0
- package/hydrate/index.d.ts +22 -5
- package/hydrate/index.js +6403 -1242
- package/hydrate/index.mjs +6403 -1242
- package/package.json +7 -3
- package/dist/cjs/constants-79d2cdfc.js.map +0 -1
- package/dist/cjs/index-5910ba06.js.map +0 -1
- package/dist/cjs/nv-iconbutton.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-loader.cjs.entry.js +0 -35
- package/dist/cjs/nv-loader.cjs.entry.js.map +0 -1
- package/dist/components/p-11cc38e0.js.map +0 -1
- package/dist/components/p-4bb5eb79.js.map +0 -1
- package/dist/components/p-69543282.js.map +0 -1
- package/dist/components/p-77d0fedc.js.map +0 -1
- package/dist/components/p-96605453.js +0 -172
- package/dist/components/p-96605453.js.map +0 -1
- package/dist/components/p-b316c35d.js.map +0 -1
- package/dist/components/p-d17558a8.js.map +0 -1
- package/dist/components/p-f77c3072.js.map +0 -1
- package/dist/components/p-fad78896.js.map +0 -1
- package/dist/esm/constants-75e6d7f0.js.map +0 -1
- package/dist/esm/index-fac2d5d2.js.map +0 -1
- package/dist/esm/nv-iconbutton.entry.js.map +0 -1
- package/dist/esm/nv-loader.entry.js +0 -31
- package/dist/esm/nv-loader.entry.js.map +0 -1
- package/dist/native/p-0a2a9f8b.entry.js +0 -2
- package/dist/native/p-0a2a9f8b.entry.js.map +0 -1
- package/dist/native/p-12d08abc.entry.js +0 -2
- package/dist/native/p-12d08abc.entry.js.map +0 -1
- package/dist/native/p-15be3d96.entry.js +0 -2
- package/dist/native/p-15be3d96.entry.js.map +0 -1
- package/dist/native/p-1a3d2a74.entry.js.map +0 -1
- package/dist/native/p-27ad7af2.entry.js.map +0 -1
- package/dist/native/p-2b2a10f9.entry.js +0 -2
- package/dist/native/p-2b2a10f9.entry.js.map +0 -1
- package/dist/native/p-359f0f53.entry.js +0 -2
- package/dist/native/p-359f0f53.entry.js.map +0 -1
- package/dist/native/p-3b65037c.entry.js +0 -2
- package/dist/native/p-3be2c9a1.entry.js +0 -2
- package/dist/native/p-4283f375.entry.js +0 -2
- package/dist/native/p-5439afb8.js +0 -3
- package/dist/native/p-5439afb8.js.map +0 -1
- package/dist/native/p-554f7b44.entry.js +0 -2
- package/dist/native/p-554f7b44.entry.js.map +0 -1
- package/dist/native/p-729c9d45.entry.js +0 -2
- package/dist/native/p-729c9d45.entry.js.map +0 -1
- package/dist/native/p-78f08578.entry.js +0 -2
- package/dist/native/p-78f08578.entry.js.map +0 -1
- package/dist/native/p-8664ab16.entry.js.map +0 -1
- package/dist/native/p-87bd53df.entry.js +0 -2
- package/dist/native/p-87bd53df.entry.js.map +0 -1
- package/dist/native/p-8d6516a3.entry.js +0 -2
- package/dist/native/p-8d6516a3.entry.js.map +0 -1
- package/dist/native/p-951baf95.entry.js +0 -2
- package/dist/native/p-9795090f.entry.js.map +0 -1
- package/dist/native/p-af60740c.entry.js.map +0 -1
- package/dist/native/p-b316c35d.js.map +0 -1
- package/dist/native/p-b7bc918b.entry.js +0 -2
- package/dist/native/p-cda56476.entry.js +0 -2
- package/dist/native/p-cda56476.entry.js.map +0 -1
- package/dist/native/p-d1bf4d77.entry.js +0 -2
- package/dist/native/p-d7665a07.entry.js +0 -2
- package/dist/native/p-d7665a07.entry.js.map +0 -1
- package/dist/native/p-daeb7e22.entry.js +0 -2
- package/dist/native/p-daeb7e22.entry.js.map +0 -1
- package/dist/native/p-e9e77494.entry.js.map +0 -1
- package/dist/native/p-f1585fc2.entry.js +0 -2
- package/dist/native/p-f1585fc2.entry.js.map +0 -1
- package/dist/native/p-f3579407.entry.js +0 -2
- package/dist/native/p-f3579407.entry.js.map +0 -1
- /package/dist/native/{p-3be2c9a1.entry.js.map → p-1a46cb52.entry.js.map} +0 -0
- /package/dist/native/{p-e36e956b.entry.js.map → p-442f04f9.entry.js.map} +0 -0
- /package/dist/native/{p-d1bf4d77.entry.js.map → p-46aa1136.entry.js.map} +0 -0
- /package/dist/native/{p-4283f375.entry.js.map → p-4dc1d036.entry.js.map} +0 -0
- /package/dist/native/{p-edee1c1f.entry.js.map → p-62df7dd4.entry.js.map} +0 -0
- /package/dist/native/{p-951baf95.entry.js.map → p-665db087.entry.js.map} +0 -0
- /package/dist/native/{p-b7bc918b.entry.js.map → p-68b5a92c.entry.js.map} +0 -0
- /package/dist/native/{p-b58c661b.entry.js.map → p-6a629671.entry.js.map} +0 -0
- /package/dist/native/{p-487b81bd.entry.js.map → p-b052f1cb.entry.js.map} +0 -0
- /package/dist/native/{p-184cd119.entry.js.map → p-c10e5113.entry.js.map} +0 -0
- /package/dist/native/{p-69fb1c9d.entry.js.map → p-db2902d6.entry.js.map} +0 -0
- /package/dist/native/{p-3b65037c.entry.js.map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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import {\n Component,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n Listen,\n Host,\n Watch,\n} from '@stencil/core';\nimport Inputmask from 'inputmask';\nimport { v4 as uuidv4 } from 'uuid';\nimport { DateRange } from '../../interfaces/dateRange';\n\n/**\n * @slot default - Child content of the component.\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-fielddaterange',\n styleUrl: 'styles/nv-fielddaterange.scss',\n shadow: false,\n})\nexport class NvFielddaterange {\n @Element() el!: HTMLNvFielddaterangeElement;\n private popoverElement!: HTMLNvPopoverElement;\n private popoverId: string = uuidv4();\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the start input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated.\n */\n @Prop({ reflect: true })\n readonly startInputId: string = uuidv4();\n\n /**\n * Sets the ID for the end input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated.\n */\n @Prop({ reflect: true })\n readonly endInputId: string = uuidv4();\n\n /**\n * Text displayed as label. A slot label can override this prop.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Description displayed below the input. A slot description can override this prop.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Placeholder for the start input field.\n */\n @Prop({ reflect: true })\n readonly startPlaceholder: string;\n\n /**\n * Placeholder for the end input field.\n */\n @Prop({ reflect: true })\n readonly endPlaceholder: string;\n\n /**\n * Name attribute for the start input.\n */\n @Prop({ reflect: true })\n readonly startName: string;\n\n /**\n * Name attribute for the end input.\n */\n @Prop({ reflect: true })\n readonly endName: string;\n\n /**\n * Disables both input fields.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Sets both input fields as read-only.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks both input fields as required.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Indicates an error state.\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * Error description. A slot error-description can override this prop.\n */\n @Prop({ reflect: true })\n readonly errorDescription?: string;\n\n /**\n * Indicates a success state.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Autofocus the start input when the component is mounted.\n */\n @Prop({ reflect: true })\n readonly shouldAutoFocus: boolean = false;\n\n /**\n * The initial value of the date range (in string format).\n */\n @Prop({ reflect: true })\n readonly value: string = '';\n\n /**\n * The current value of the start date in string format.\n */\n @State()\n startValue: string = '';\n\n /**\n * The current value of the end date in string format.\n */\n @State()\n endValue: string = '';\n\n /**\n * Controls the opening of the popover.\n */\n @State()\n open: boolean = false;\n\n /**\n * First day of the week 0 = Sunday, 1 = Monday, etc.\n * @default 1\n */\n @Prop({ reflect: true })\n readonly firstDayOfWeek: number = 1;\n\n /**\n * Number of calendars to display\n * @default 2\n */\n @Prop({ reflect: true })\n readonly numberOfCalendars: number = 2;\n\n /**\n * Minimum date for selection ISO string format, ex: 2025-01-01\n */\n @Prop({ reflect: true })\n readonly min?: string = '';\n\n /**\n * Maximum date for selection ISO string format, ex: 2025-12-31\n */\n @Prop({ reflect: true })\n readonly max?: string = '';\n\n /** Locale for date formatting\n * @default 'en-BE'\n */\n @Prop({ reflect: true })\n readonly locale: string = 'en-BE';\n\n /** Date format ex: YYYY-MM-DD, DD-MM-YYYY, etc.\n * @default 'YYYY-MM-DD'\n */\n @Prop({ reflect: true })\n readonly dateFormat: string = 'YYYY-MM-DD';\n\n /**\n * Footer placement\n * @default 'bottom'\n */\n @Prop({ reflect: true })\n readonly shortcutsPlacement: 'bottom' | 'left' | 'right' = 'bottom';\n\n /**\n * Show action buttons\n * @default false\n */\n @Prop({ reflect: true })\n readonly showActions: boolean = false;\n\n /**\n * Custom actions to display in the footer\n * JSON array of objects with the following properties:\n * - label: string\n * - onClick: function\n * @default '[]'\n */\n @Prop({ reflect: true })\n readonly shortcuts: string = '[]';\n\n /**\n * Show week numbers\n * @default true\n */\n // eslint-disable-next-line @stencil-community/ban-default-true\n @Prop({ reflect: true })\n readonly showWeekNumbers: boolean = true;\n\n /**\n * Disabled dates ISO string array\n * @default '[]'\n */\n @Prop({ reflect: true })\n readonly disabledDates: string = '[]';\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Converts the nv-calendar date format to the format expected by Inputmask.\n * @param {string} format - The date format to convert\n * @returns {string} The converted format for Inputmask\n */\n private convertToInputmaskFormat(format: string): string {\n // Si le format n'est pas spécifié, utiliser le format par défaut YYYY-MM-DD\n if (!format) {\n return 'dd/mm/yyyy';\n }\n\n // Conversion des formats\n const formatMap = {\n 'YYYY-MM-DD': 'yyyy-mm-dd',\n 'DD/MM/YYYY': 'dd/mm/yyyy',\n 'MM/DD/YYYY': 'mm/dd/yyyy',\n 'DD.MM.YYYY': 'dd.mm.yyyy',\n 'YYYYMMDD': 'yyyymmdd',\n };\n\n return formatMap[format] || 'dd/mm/yyyy';\n }\n\n /**\n * Closes the popover when a click is detected outside the component.\n * @param {MouseEvent} event - The mouse event\n */\n private handleClickOutside = (event: MouseEvent) => {\n if (this.open && this.el && !this.el.contains(event.target as Node)) {\n this.open = false;\n }\n };\n\n /**\n * Handles the input event on the start input element.\n * @param {Event} event - The input event\n */\n private handleStartInput = (event: Event) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n const input = event.target as HTMLInputElement;\n this.startValue = input.value;\n this.dateRangeChange.emit({ start: input.value, end: this.endValue });\n };\n\n /**\n * Handles the input event on the end input element.\n * @param {Event} event - The input event\n */\n private handleEndInput = (event: Event) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n const input = event.target as HTMLInputElement;\n this.endValue = input.value;\n this.dateRangeChange.emit({ start: this.startValue, end: input.value });\n };\n\n /**\n * Handles focus events on the input elements.\n * @param {FocusEvent} event - The focus event\n */\n private handleFocus = (event: FocusEvent) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n (event.target as HTMLElement).blur();\n return;\n }\n\n // Open the popover when an input is focused\n this.open = true;\n };\n\n /**\n * Toggles the opening/closing of the popover.\n */\n private toggleCalendar = () => {\n if (this.readonly || this.disabled) {\n return;\n }\n this.open = !this.open;\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n connectedCallback() {\n document.addEventListener('click', this.handleClickOutside);\n }\n\n componentWillLoad() {\n if (this.value) {\n try {\n const range = JSON.parse(this.value) as DateRange;\n this.startValue = range.start || '';\n this.endValue = range.end || '';\n } catch (error) {\n console.error('Invalid JSON for value:');\n console.error(error);\n }\n }\n }\n\n componentDidLoad() {\n const inputs = this.el.querySelectorAll('.input-wrapper input');\n inputs.forEach((input: HTMLInputElement) => {\n const inputMask = new Inputmask({\n alias: 'datetime',\n inputFormat: this.convertToInputmaskFormat(this.dateFormat),\n placeholder: '_',\n clearIncomplete: false,\n showMaskOnHover: false,\n showMaskOnFocus: false,\n clearMaskOnLostFocus: false,\n insertMode: true,\n rightAlign: false,\n oncomplete: function (e) {\n const input = e.target as HTMLInputElement;\n const event = new CustomEvent('input', { bubbles: true });\n input.dispatchEvent(event);\n },\n });\n inputMask.mask(input);\n\n // Set the value after applying the mask\n if (input.name === this.startName && this.startValue) {\n requestAnimationFrame(() => {\n input.value = this.startValue;\n const event = new CustomEvent('input', { bubbles: true });\n input.dispatchEvent(event);\n });\n } else if (input.name === this.endName && this.endValue) {\n requestAnimationFrame(() => {\n input.value = this.endValue;\n const event = new CustomEvent('input', { bubbles: true });\n input.dispatchEvent(event);\n });\n }\n });\n }\n\n componentDidRender() {\n const inputs = this.el.querySelectorAll('.input-wrapper input');\n inputs.forEach((input: HTMLInputElement) => {\n const value =\n input.name === this.startName\n ? this.startValue\n : this.endName\n ? this.endValue\n : '';\n if (value) {\n // Make sure the value is defined both as a property and attribute\n requestAnimationFrame(() => {\n input.value = value;\n input.setAttribute('value', value);\n });\n }\n });\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside);\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emits an event when the date range changes.\n */\n @Event()\n dateRangeChange: EventEmitter<DateRange>;\n\n /**\n * Handles the range date selection event from nv-calendar.\n * @param {CustomEvent<DateRange>} event - The custom event\n */\n @Listen('rangeDateChange')\n handleRangeDateChange(event: CustomEvent<DateRange>) {\n const { start, end } = event.detail || {};\n\n // Check that both dates are defined\n if (start && end) {\n this.startValue = start;\n this.endValue = end;\n this.dateRangeChange.emit({\n start: this.startValue,\n end: this.endValue,\n });\n\n if (!this.showActions) {\n this.open = false;\n }\n }\n }\n\n @Listen('closePopover')\n handleClosePopover() {\n this.open = false;\n }\n\n @Listen('applyDateRange')\n handleApplyDateRange() {\n this.open = false;\n }\n\n /**\n * Handles keyboard events.\n * @param {KeyboardEvent} event - The keyboard event\n */\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n event.preventDefault();\n return;\n }\n return;\n }\n\n if (!this.popoverElement) {\n console.warn('nv-fielddaterange -> Popover element is not defined');\n return;\n }\n }\n\n @Watch('value')\n handleValueChange(newValue: string) {\n try {\n const range = JSON.parse(newValue) as DateRange;\n this.startValue = range.start || '';\n this.endValue = range.end || '';\n } catch (error) {\n console.error('Invalid JSON for value:', error);\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {((this.label && this.label.length > 0) ||\n this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.startInputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <nv-popover\n ref={el => (this.popoverElement = el as HTMLNvPopoverElement)}\n id={this.popoverId}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div slot=\"trigger\" class=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div class=\"input-container\">\n <slot name=\"leading-input\"></slot>\n\n <div class=\"range-inputs\">\n <input\n id={this.startInputId}\n type=\"text\"\n placeholder={this.startPlaceholder}\n name={this.startName}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n autofocus={this.shouldAutoFocus}\n value={this.startValue}\n onInput={this.handleStartInput}\n onFocus={this.handleFocus}\n />\n\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-arrows-move-horizontal\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18 9l3 3l-3 3\" />\n <path d=\"M15 12h6\" />\n <path d=\"M6 9l-3 3l3 3\" />\n <path d=\"M3 12h6\" />\n </svg>\n\n <input\n id={this.endInputId}\n type=\"text\"\n placeholder={this.endPlaceholder}\n name={this.endName}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n value={this.endValue}\n onInput={this.handleEndInput}\n onFocus={this.handleFocus}\n />\n </div>\n\n <nv-iconbutton\n class=\"toggle-calendar-icon\"\n name=\"calendar\"\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide calendar' : 'Show calendar'}\n aria-pressed={this.open.toString()}\n onClick={this.toggleCalendar}\n tabIndex={this.disabled ? -1 : 0}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div slot=\"content\">\n <nv-calendar\n dateFormat={this.dateFormat}\n rangeValue={\n this.startValue && this.endValue\n ? JSON.stringify({\n start: this.startValue,\n end: this.endValue,\n })\n : ''\n }\n firstDayOfWeek={this.firstDayOfWeek}\n numberOfCalendars={this.numberOfCalendars}\n min={this.min}\n max={this.max}\n locale={this.locale}\n shortcutsPlacement={this.shortcutsPlacement}\n showActions={this.showActions}\n shortcuts={this.shortcuts}\n showWeekNumbers={this.showWeekNumbers}\n disabledDates={this.disabledDates}\n selectionType=\"range\"\n ></nv-calendar>\n </div>\n </nv-popover>\n\n {((this.description && this.description.length > 0) ||\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 {this.el.querySelector('[slot=\"error-description\"]') ? (\n <slot name=\"error-description\"></slot>\n ) : (\n this.errorDescription\n )}\n </div>\n )}\n\n <slot></slot>\n </Host>\n );\n }\n //#endregion RENDER\n}\n"]}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
nv-fielddaterange {
|
|
2
|
+
--nv-field-border-default: var(--components-form-field-border-default);
|
|
3
|
+
--nv-field-border-hover: var(--components-form-field-border-hover);
|
|
4
|
+
--nv-field-border-focus: var(--components-form-field-border-focus);
|
|
5
|
+
--nv-field-border-disabled: var(--components-form-field-border-default);
|
|
6
|
+
--nv-field-border-readonly: var(--components-form-field-border-default);
|
|
7
|
+
--nv-field-focus-box-shadow: var(--color-focus-brand);
|
|
8
|
+
--nv-field-background: var(--components-form-field-background-default);
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
gap: var(--form-gap-y);
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
nv-fielddaterange[readonly]:not([readonly=false]) {
|
|
16
|
+
--nv-field-border-default: var(--components-form-field-border-readonly);
|
|
17
|
+
--nv-field-border-hover: var(--nv-field-border-default);
|
|
18
|
+
--nv-field-border-focus: var(--components-form-field-border-focus);
|
|
19
|
+
--nv-field-border-disabled: var(--nv-field-border-default);
|
|
20
|
+
--nv-field-border-readonly: var(--nv-field-border-default);
|
|
21
|
+
--nv-field-background: var(--components-form-field-background-readonly);
|
|
22
|
+
}
|
|
23
|
+
nv-fielddaterange[error]:not([error=false]) {
|
|
24
|
+
--nv-field-border-default: var(--components-form-field-border-error);
|
|
25
|
+
--nv-field-border-hover: var(--nv-field-border-default);
|
|
26
|
+
--nv-field-border-focus: var(--nv-field-border-default);
|
|
27
|
+
--nv-field-border-disabled: var(--nv-field-border-default);
|
|
28
|
+
--nv-field-border-readonly: var(--nv-field-border-default);
|
|
29
|
+
--nv-field-focus-box-shadow: var(--color-focus-destructive);
|
|
30
|
+
}
|
|
31
|
+
nv-fielddaterange[success]:not([success=false]) {
|
|
32
|
+
--nv-field-border-default: var(--components-form-field-border-success);
|
|
33
|
+
--nv-field-border-hover: var(--nv-field-border-default);
|
|
34
|
+
--nv-field-border-focus: var(--nv-field-border-default);
|
|
35
|
+
--nv-field-border-disabled: var(--nv-field-border-default);
|
|
36
|
+
--nv-field-border-readonly: var(--nv-field-border-default);
|
|
37
|
+
--nv-field-focus-box-shadow: var(--color-focus-success);
|
|
38
|
+
}
|
|
39
|
+
nv-fielddaterange[required]:not([required=false]) label::after {
|
|
40
|
+
content: "*";
|
|
41
|
+
color: var(--components-form-text-required);
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
}
|
|
44
|
+
nv-fielddaterange label {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: var(--form-label-gap);
|
|
48
|
+
align-self: stretch;
|
|
49
|
+
color: var(--components-form-text-label-default);
|
|
50
|
+
font-family: "TT Norms Pro", sans-serif;
|
|
51
|
+
font-size: var(--form-label-font-size);
|
|
52
|
+
font-style: normal;
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
line-height: var(--form-label-line-height);
|
|
55
|
+
}
|
|
56
|
+
nv-fielddaterange nv-popover {
|
|
57
|
+
width: 100%;
|
|
58
|
+
display: block;
|
|
59
|
+
}
|
|
60
|
+
nv-fielddaterange nv-popover [data-scope=popover] {
|
|
61
|
+
padding: 0;
|
|
62
|
+
background-color: var(--components-list-dropdown-background);
|
|
63
|
+
border: 1px solid var(--components-list-dropdown-border);
|
|
64
|
+
width: auto;
|
|
65
|
+
}
|
|
66
|
+
nv-fielddaterange nv-popover [slot=content] {
|
|
67
|
+
display: block;
|
|
68
|
+
width: 100%;
|
|
69
|
+
}
|
|
70
|
+
nv-fielddaterange .input-wrapper {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-wrap: wrap;
|
|
73
|
+
gap: var(--form-gap-x);
|
|
74
|
+
align-items: stretch;
|
|
75
|
+
align-self: stretch;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 8px;
|
|
79
|
+
}
|
|
80
|
+
nv-fielddaterange .input-wrapper .input-container {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-grow: 1;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
align-items: center;
|
|
85
|
+
align-self: stretch;
|
|
86
|
+
border-radius: var(--form-field-radius);
|
|
87
|
+
border-width: 1px;
|
|
88
|
+
border-style: solid;
|
|
89
|
+
border-color: var(--nv-field-border-default);
|
|
90
|
+
opacity: var(--components-form-opacity-default, 1);
|
|
91
|
+
background: var(--nv-field-background);
|
|
92
|
+
transition: all 150ms ease-out;
|
|
93
|
+
position: relative;
|
|
94
|
+
flex: 1;
|
|
95
|
+
min-width: 0;
|
|
96
|
+
padding-right: 32px;
|
|
97
|
+
}
|
|
98
|
+
nv-fielddaterange .input-wrapper .input-container:hover {
|
|
99
|
+
border-color: var(--nv-field-border-hover);
|
|
100
|
+
}
|
|
101
|
+
nv-fielddaterange .input-wrapper .input-container:focus-within, nv-fielddaterange .input-wrapper .input-container:focus-within:hover, nv-fielddaterange .input-wrapper .input-container:focus, nv-fielddaterange .input-wrapper .input-container:focus:hover {
|
|
102
|
+
border-color: var(--nv-field-border-focus);
|
|
103
|
+
box-shadow: 0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow);
|
|
104
|
+
}
|
|
105
|
+
nv-fielddaterange .input-wrapper .input-container:has(input:read-only) {
|
|
106
|
+
opacity: 0.5;
|
|
107
|
+
background-color: var(--components-form-field-background-readonly);
|
|
108
|
+
border-color: var(--nv-field-border-readonly);
|
|
109
|
+
}
|
|
110
|
+
nv-fielddaterange .input-wrapper .input-container:has(input:disabled) {
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
background-color: var(--components-form-field-background-disabled);
|
|
113
|
+
border-color: var(--nv-field-border-disabled);
|
|
114
|
+
}
|
|
115
|
+
nv-fielddaterange .input-wrapper .input-container input {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
flex: 1 0 0;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
background-color: transparent;
|
|
121
|
+
color: var(--components-form-field-content-text);
|
|
122
|
+
padding: var(--form-field-padding-y) var(--form-field-padding-x);
|
|
123
|
+
font-size: var(--form-field-font-size);
|
|
124
|
+
font-style: normal;
|
|
125
|
+
font-weight: 500;
|
|
126
|
+
line-height: var(--form-field-line-height);
|
|
127
|
+
width: 100%;
|
|
128
|
+
}
|
|
129
|
+
nv-fielddaterange .input-wrapper .input-container input:focus {
|
|
130
|
+
outline: none;
|
|
131
|
+
}
|
|
132
|
+
nv-fielddaterange .input-wrapper .input-container input::placeholder {
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
color: var(--components-form-field-content-placeholder);
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
font-family: "TT Norms Pro", sans-serif;
|
|
137
|
+
font-size: var(--form-field-font-size);
|
|
138
|
+
font-style: normal;
|
|
139
|
+
font-weight: 400;
|
|
140
|
+
line-height: var(--form-field-line-height);
|
|
141
|
+
}
|
|
142
|
+
nv-fielddaterange .input-wrapper .input-container nv-icon.validation {
|
|
143
|
+
color: var(--nv-field-border-default);
|
|
144
|
+
}
|
|
145
|
+
nv-fielddaterange .input-wrapper .input-container .toggle-calendar-icon {
|
|
146
|
+
position: absolute;
|
|
147
|
+
right: 0;
|
|
148
|
+
top: 50%;
|
|
149
|
+
transform: translateY(-50%);
|
|
150
|
+
}
|
|
151
|
+
nv-fielddaterange .description {
|
|
152
|
+
align-self: stretch;
|
|
153
|
+
color: var(--components-form-text-description-default);
|
|
154
|
+
font-family: "TT Norms Pro", sans-serif;
|
|
155
|
+
font-size: var(--form-description-font-size);
|
|
156
|
+
font-style: normal;
|
|
157
|
+
line-height: var(--form-description-line-height);
|
|
158
|
+
}
|
|
159
|
+
nv-fielddaterange .error-description {
|
|
160
|
+
align-self: stretch;
|
|
161
|
+
color: var(--components-form-text-description-default);
|
|
162
|
+
font-family: "TT Norms Pro", sans-serif;
|
|
163
|
+
font-size: var(--form-description-font-size);
|
|
164
|
+
font-style: normal;
|
|
165
|
+
line-height: var(--form-description-line-height);
|
|
166
|
+
color: var(--components-form-text-description-error);
|
|
167
|
+
}
|
|
168
|
+
nv-fielddaterange .range-inputs {
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
gap: 8px;
|
|
172
|
+
flex: 1;
|
|
173
|
+
}
|
|
174
|
+
nv-fielddaterange .range-inputs input {
|
|
175
|
+
flex: 1;
|
|
176
|
+
border: none;
|
|
177
|
+
outline: none;
|
|
178
|
+
padding: 0;
|
|
179
|
+
font-size: var(--form-field-font-size);
|
|
180
|
+
color: var(--components-form-field-content-text);
|
|
181
|
+
background: transparent;
|
|
182
|
+
min-width: 0;
|
|
183
|
+
text-align: center;
|
|
184
|
+
}
|
|
185
|
+
nv-fielddaterange .range-inputs input::placeholder {
|
|
186
|
+
color: var(--components-form-field-content-placeholder);
|
|
187
|
+
}
|
|
188
|
+
nv-fielddaterange .range-inputs input:disabled {
|
|
189
|
+
cursor: not-allowed;
|
|
190
|
+
color: var(--components-form-field-content-text);
|
|
191
|
+
background-color: var(--components-form-field-background-disabled);
|
|
192
|
+
}
|
|
@@ -109,13 +109,6 @@ export class NvFielddropdown {
|
|
|
109
109
|
this.filterText = input.value.toLowerCase();
|
|
110
110
|
this.filterItems();
|
|
111
111
|
};
|
|
112
|
-
this.handleClickOutside = (event) => {
|
|
113
|
-
if (this.el.contains(event.target) ||
|
|
114
|
-
(this.inputElement && this.inputElement.contains(event.target))) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
this.open = false;
|
|
118
|
-
};
|
|
119
112
|
this.handleInputFocus = () => {
|
|
120
113
|
if (this.disabled || this.readonly)
|
|
121
114
|
return;
|
|
@@ -137,6 +130,12 @@ export class NvFielddropdown {
|
|
|
137
130
|
? (_c = (_a = matchingItem.label) !== null && _a !== void 0 ? _a : (_b = matchingItem.textContent) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : matchingItem.value
|
|
138
131
|
: '';
|
|
139
132
|
};
|
|
133
|
+
this.clearFilter = () => {
|
|
134
|
+
this.filterText = '';
|
|
135
|
+
this.inputElement.value = '';
|
|
136
|
+
this.inputElement.focus();
|
|
137
|
+
this.filterItems();
|
|
138
|
+
};
|
|
140
139
|
}
|
|
141
140
|
handleDropdownItemSelected(event) {
|
|
142
141
|
if (this.disabled || this.readonly)
|
|
@@ -164,6 +163,7 @@ export class NvFielddropdown {
|
|
|
164
163
|
if (newValue) {
|
|
165
164
|
this.updateSelectedItem(newValue);
|
|
166
165
|
}
|
|
166
|
+
this.valueChanged.emit(newValue);
|
|
167
167
|
}
|
|
168
168
|
handleOptionsChange(newValue) {
|
|
169
169
|
if (newValue) {
|
|
@@ -226,9 +226,6 @@ export class NvFielddropdown {
|
|
|
226
226
|
else if (event.key === 'Escape') {
|
|
227
227
|
event.preventDefault();
|
|
228
228
|
this.open = false;
|
|
229
|
-
if (this.inputElement) {
|
|
230
|
-
this.inputElement.blur();
|
|
231
|
-
}
|
|
232
229
|
}
|
|
233
230
|
}
|
|
234
231
|
//#endregion EVENTS
|
|
@@ -354,15 +351,12 @@ export class NvFielddropdown {
|
|
|
354
351
|
//#endregion METHODS
|
|
355
352
|
/****************************************************************************/
|
|
356
353
|
//#region LIFECYCLE
|
|
357
|
-
|
|
358
|
-
document.addEventListener('click', this.handleClickOutside.bind(this));
|
|
354
|
+
componentWillLoad() {
|
|
359
355
|
this.resetFilter();
|
|
360
356
|
this.setInitialSelection();
|
|
361
357
|
if (this.filterable && this.filterText) {
|
|
362
358
|
this.filterItems();
|
|
363
359
|
}
|
|
364
|
-
}
|
|
365
|
-
componentWillLoad() {
|
|
366
360
|
if (this.options) {
|
|
367
361
|
this.handleOptionsChange(this.options);
|
|
368
362
|
}
|
|
@@ -371,22 +365,17 @@ export class NvFielddropdown {
|
|
|
371
365
|
}
|
|
372
366
|
}
|
|
373
367
|
componentDidLoad() {
|
|
374
|
-
document.addEventListener('click', this.handleClickOutside.bind(this));
|
|
375
|
-
// Check again after complete rendering
|
|
376
368
|
if (this.value) {
|
|
377
369
|
this.updateSelectedItem(this.value);
|
|
378
370
|
}
|
|
379
371
|
}
|
|
380
|
-
disconnectedCallback() {
|
|
381
|
-
document.removeEventListener('click', this.handleClickOutside.bind(this));
|
|
382
|
-
}
|
|
383
372
|
//#endregion LIFECYCLE
|
|
384
373
|
/****************************************************************************/
|
|
385
374
|
//#region RENDER
|
|
386
375
|
render() {
|
|
387
|
-
return (h(Host, { key: '
|
|
388
|
-
this.el.querySelector('[slot="description"]')) && (h("div", { key: '
|
|
389
|
-
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '
|
|
376
|
+
return (h(Host, { key: '189f41e526d7245f4d5fae078d2bea1528a9a8d1' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '91d5c635c4d37f5d6d3fef0e6dd3212009d1be35', htmlFor: this.inputId }, h("slot", { key: 'e749e641f077753464eaa21289ebf71c0b6f673b', name: "label" }, this.label))), h("nv-popover", { key: 'c3c0456e9937745b4784c7b858b9cfadcf4e7240', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: '1ad04f70880de711e371267859950d272f78902f', class: "input-wrapper", slot: "trigger" }, h("slot", { key: '99ff9d306c69aba7e5eb033feae1a05f7dcb01f6', name: "before-input" }), h("div", { key: '7afb87ecb3eacaf7510abd5b6b02645ba355f719', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: 'fe3749cdf9f25f0b7fd52949c955b1804fd65630', name: "leading-input" }), this.isFilterable || this.disabled || this.readonly ? (h("input", { 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, onKeyDown: this.handleKeyDown })) : (h("p", { id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClick, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocus }, h("span", null, this.getSelectedLabel() || this.value || this.placeholder))), this.isFilterable && this.filterText && this.open && (h("nv-iconbutton", { key: '9806da726e4dce22f0a73664b482a405cb7cc071', name: "x", size: "md", emphasis: "lower", class: "clear-button", onClick: this.clearFilter, "aria-label": "Clear input" })), this.error && (h("nv-icon", { key: '781fb90765533615737da8c294ce497f22dbd9c6', name: "alert-circle", class: "validation", size: "md" })), h("nv-iconbutton", { key: '1060f3a91606d26c3368299623b0d8211df5f6ec', "data-scope": "toggle-dropdown", name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide dropdown' : 'Show dropdown', "aria-pressed": this.open.toString(), onClick: this.togglePopover, tabIndex: this.disabled ? -1 : 0 })), h("slot", { key: 'b123b91bb2c09f77010bef649d11a27bf16cb3ab', name: "after-input" })), h("div", { key: '94234acfe1881c11b3e6fadda0f234d036ea47ef', slot: "content" }, this.parsedOptions.length > 0 ? (h("ul", null, this.parsedOptions.map(option => (h("nv-fielddropdownitem", { label: option.label, value: option.value, disabled: option.disabled, selected: option.value === this.value }))))) : (h("slot", { name: "content" })))), (this.description ||
|
|
377
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: '26de437b142f81e21145ac4f6a15c7e6aecfbfa7', class: "description" }, h("slot", { key: '6c95582790d276567ad9e1619a949419a72f54c1', name: "description" }, this.description))), (this.errorDescription ||
|
|
378
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '6ac20b9462e708a456e61c8e3721a585b03e696e', hidden: !this.error, class: "error-description" }, h("slot", { key: '1def9c4e17495a831ea9702ae121c64e812df9b6', name: "error-description" }, this.errorDescription)))));
|
|
390
379
|
}
|
|
391
380
|
static get is() { return "nv-fielddropdown"; }
|
|
392
381
|
static get formAssociated() { return true; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nv-fielddropdown.js","sourceRoot":"","sources":["../../../src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,KAAK,EACL,MAAM,EACN,KAAK,EAEL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAIpC;;;;;;;;GAQG;AAOH,MAAM,OAAO,eAAe;IAN5B;QAWE,8EAA8E;QAC9E,oBAAoB;QAEpB;;;;;WAKG;QAEM,YAAO,GAAW,MAAM,EAAE,CAAC;QAoCpC;;WAEG;QAEH,SAAI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n Method,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\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 /****************************************************************************/\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 * 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 * 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 * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\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 * 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 * 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 * 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, mutable: true })\n filterable: boolean = false;\n\n /**\n * List of options available in the dropdown. The options are passed as a JSON\n * string.\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: true })\n readonly options?: string;\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 //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n /** The text entered by the user for filtering dropdown items. */\n @State()\n filterText: string = '';\n\n @State()\n isFilterable: boolean = this.filterable;\n\n @State()\n selectedValues: Set<string> = new Set();\n\n /**\n * Options configuration for the dropdown items.\n */\n @State()\n parsedOptions: Array<{\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 //#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 @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.value = event.detail.value;\n this.open = false;\n }\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n this.open = event.detail; // Update `open` based on the popover state\n }\n\n @Watch('filterable')\n watchFilterableHandler(newValue: boolean) {\n this.isFilterable = newValue;\n this.filterable = newValue;\n }\n\n @Watch('value')\n watchValueHandler(newValue: string) {\n if (newValue) {\n this.updateSelectedItem(newValue);\n }\n }\n\n @Watch('options')\n handleOptionsChange(newValue: string) {\n if (newValue) {\n try {\n const parsedOpts = JSON.parse(newValue);\n this.parsedOptions = [...parsedOpts];\n const selectedOption = this.parsedOptions.find(opt => opt.selected);\n\n if (selectedOption) {\n this.value = selectedOption.value;\n requestAnimationFrame(() => {\n // Wait for items to be rendered\n this.updateSelectedItem(selectedOption.value);\n });\n }\n } catch (error) {\n console.error('nv-fielddropdown: error parsing options:', error);\n this.parsedOptions = [];\n }\n } else {\n this.parsedOptions = [];\n }\n }\n\n @Listen('blur', { capture: true })\n handleBlur(event: FocusEvent) {\n const target = event.relatedTarget;\n\n if (!(target instanceof Node) || !this.el.contains(target)) {\n this.open = false;\n }\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n if (!this.filterable) {\n // Focus on the first item if it is not filterable\n this.focusFirstItem();\n }\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem:not([data-empty])'),\n ) as HTMLNvFielddropdownitemElement[];\n\n if (items.length === 0) {\n console.warn('No dropdown items found to navigate');\n return;\n }\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 if (this.inputElement) {\n this.inputElement.blur();\n }\n }\n }\n\n //#endregion EVENTS\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 /**\n * Set the initial selection based on the current value and update the\n * inputElement value.\n */\n private setInitialSelection() {\n if (!this.value) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const selectedItem = items.find(\n item => item.getAttribute('value') === this.value,\n );\n\n items.forEach(item => {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n });\n\n if (selectedItem) {\n selectedItem.setAttribute('selected', 'true');\n selectedItem.classList.add('selected');\n this.value = selectedItem.getAttribute('value');\n if (this.inputElement) {\n this.inputElement.value = this.value;\n }\n } else {\n console.warn('No matching item found for value:', this.value);\n }\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.filterText = input.value.toLowerCase();\n this.filterItems();\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 item.style.display = shouldShow ? '' : 'none'; // Hide or show the item\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 handleClickOutside = (event: MouseEvent) => {\n if (\n this.el.contains(event.target as Node) ||\n (this.inputElement && this.inputElement.contains(event.target as Node))\n ) {\n return;\n }\n\n this.open = false;\n };\n\n private handleInputFocus = () => {\n if (this.disabled || this.readonly) return;\n\n this.open = true;\n };\n\n private togglePopover = () => {\n if (this.disabled || this.readonly) return;\n\n this.open = !this.open;\n\n if (this.open && !this.filterable) {\n this.focusFirstItem();\n }\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 focusFirstItem() {\n const firstItem = this.el.querySelector('nv-fielddropdownitem');\n if (firstItem) {\n (firstItem as HTMLElement).focus();\n this.updateHighlightedItem(\n Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[],\n 0,\n );\n } else {\n console.warn('nv-fielddropdown: no first item found to focus');\n }\n }\n\n private updateSelectedItem(value: string) {\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\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 if (matchingItem && this.inputElement) {\n this.inputElement.value = value;\n }\n }\n\n private getSelectedLabel = (): string => {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(\n item => item.getAttribute('value') === this.value,\n );\n return matchingItem\n ? matchingItem.label ??\n matchingItem.textContent?.trim() ??\n matchingItem.value\n : '';\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n connectedCallback() {\n document.addEventListener('click', this.handleClickOutside.bind(this));\n\n this.resetFilter();\n this.setInitialSelection();\n\n if (this.filterable && this.filterText) {\n this.filterItems();\n }\n }\n\n componentWillLoad() {\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n }\n\n componentDidLoad() {\n document.addEventListener('click', this.handleClickOutside.bind(this));\n\n // Check again after complete rendering\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside.bind(this));\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\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.isFilterable || this.disabled || this.readonly ? (\n <input\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 onKeyDown={this.handleKeyDown}\n />\n ) : (\n <p\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 <span>\n {this.getSelectedLabel() || this.value || this.placeholder}\n </span>\n </p>\n )}\n\n <nv-iconbutton\n class=\"toggle-dropdown-icon\"\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 slot=\"content\">\n {this.parsedOptions.length > 0 ? (\n <ul>\n {this.parsedOptions.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 //#endregion RENDER\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nv-fielddropdown.js","sourceRoot":"","sources":["../../../src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["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';\nimport { v4 as uuidv4 } from 'uuid';\n\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 /****************************************************************************/\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 * 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 * 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 * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\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 * 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 * 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 * 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, mutable: true })\n filterable: boolean = false;\n\n /**\n * List of options available in the dropdown. The options are passed as a JSON\n * string.\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: true })\n readonly options?: string;\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 //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n /** The text entered by the user for filtering dropdown items. */\n @State()\n filterText: string = '';\n\n @State()\n isFilterable: boolean = this.filterable;\n\n @State()\n selectedValues: Set<string> = new Set();\n\n /**\n * Options configuration for the dropdown items.\n */\n @State()\n parsedOptions: Array<{\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 //#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 @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.value = event.detail.value;\n this.open = false;\n }\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n this.open = event.detail; // Update `open` based on the popover state\n }\n\n @Watch('filterable')\n watchFilterableHandler(newValue: boolean) {\n this.isFilterable = newValue;\n this.filterable = newValue;\n }\n\n @Watch('value')\n watchValueHandler(newValue: string) {\n if (newValue) {\n this.updateSelectedItem(newValue);\n }\n this.valueChanged.emit(newValue);\n }\n\n @Watch('options')\n handleOptionsChange(newValue: string) {\n if (newValue) {\n try {\n const parsedOpts = JSON.parse(newValue);\n this.parsedOptions = [...parsedOpts];\n const selectedOption = this.parsedOptions.find(opt => opt.selected);\n\n if (selectedOption) {\n this.value = selectedOption.value;\n requestAnimationFrame(() => {\n // Wait for items to be rendered\n this.updateSelectedItem(selectedOption.value);\n });\n }\n } catch (error) {\n console.error('nv-fielddropdown: error parsing options:', error);\n this.parsedOptions = [];\n }\n } else {\n this.parsedOptions = [];\n }\n }\n\n @Listen('blur', { capture: true })\n handleBlur(event: FocusEvent) {\n const target = event.relatedTarget;\n\n if (!(target instanceof Node) || !this.el.contains(target)) {\n this.open = false;\n }\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n if (!this.filterable) {\n // Focus on the first item if it is not filterable\n this.focusFirstItem();\n }\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem:not([data-empty])'),\n ) as HTMLNvFielddropdownitemElement[];\n\n if (items.length === 0) {\n console.warn('No dropdown items found to navigate');\n return;\n }\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 EVENTS\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 /**\n * Set the initial selection based on the current value and update the\n * inputElement value.\n */\n private setInitialSelection() {\n if (!this.value) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const selectedItem = items.find(\n item => item.getAttribute('value') === this.value,\n );\n\n items.forEach(item => {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n });\n\n if (selectedItem) {\n selectedItem.setAttribute('selected', 'true');\n selectedItem.classList.add('selected');\n this.value = selectedItem.getAttribute('value');\n if (this.inputElement) {\n this.inputElement.value = this.value;\n }\n } else {\n console.warn('No matching item found for value:', this.value);\n }\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.filterText = input.value.toLowerCase();\n this.filterItems();\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 item.style.display = shouldShow ? '' : 'none'; // Hide or show the item\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\n this.open = true;\n };\n\n private togglePopover = () => {\n if (this.disabled || this.readonly) return;\n\n this.open = !this.open;\n\n if (this.open && !this.filterable) {\n this.focusFirstItem();\n }\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 focusFirstItem() {\n const firstItem = this.el.querySelector('nv-fielddropdownitem');\n if (firstItem) {\n (firstItem as HTMLElement).focus();\n this.updateHighlightedItem(\n Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[],\n 0,\n );\n } else {\n console.warn('nv-fielddropdown: no first item found to focus');\n }\n }\n\n private updateSelectedItem(value: string) {\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\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 if (matchingItem && this.inputElement) {\n this.inputElement.value = value;\n }\n }\n\n private getSelectedLabel = (): string => {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(\n item => item.getAttribute('value') === this.value,\n );\n return matchingItem\n ? matchingItem.label ??\n matchingItem.textContent?.trim() ??\n matchingItem.value\n : '';\n };\n\n private clearFilter = () => {\n this.filterText = '';\n this.inputElement.value = '';\n this.inputElement.focus();\n this.filterItems();\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.resetFilter();\n this.setInitialSelection();\n\n if (this.filterable && this.filterText) {\n this.filterItems();\n }\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n }\n\n componentDidLoad() {\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\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.isFilterable || this.disabled || this.readonly ? (\n <input\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 onKeyDown={this.handleKeyDown}\n />\n ) : (\n <p\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 <span>\n {this.getSelectedLabel() || this.value || this.placeholder}\n </span>\n </p>\n )}\n\n {this.isFilterable && 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 slot=\"content\">\n {this.parsedOptions.length > 0 ? (\n <ul>\n {this.parsedOptions.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 //#endregion RENDER\n}\n"]}
|
|
@@ -75,10 +75,8 @@ nv-fielddropdown .input-wrapper {
|
|
|
75
75
|
nv-fielddropdown .input-container {
|
|
76
76
|
display: flex;
|
|
77
77
|
flex-grow: 1;
|
|
78
|
-
padding: calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);
|
|
79
78
|
justify-content: center;
|
|
80
79
|
align-items: center;
|
|
81
|
-
gap: var(--form-field-gap);
|
|
82
80
|
align-self: stretch;
|
|
83
81
|
border-radius: var(--form-field-radius);
|
|
84
82
|
border-width: 1px;
|
|
@@ -108,6 +106,12 @@ nv-fielddropdown .input-container:has(input:disabled) {
|
|
|
108
106
|
background-color: var(--components-form-field-background-disabled);
|
|
109
107
|
border-color: var(--nv-field-border-disabled);
|
|
110
108
|
}
|
|
109
|
+
nv-fielddropdown .input-container input[type=search]::-webkit-search-decoration,
|
|
110
|
+
nv-fielddropdown .input-container input[type=search]::-webkit-search-cancel-button,
|
|
111
|
+
nv-fielddropdown .input-container input[type=search]::-webkit-search-results-button,
|
|
112
|
+
nv-fielddropdown .input-container input[type=search]::-webkit-search-results-decoration {
|
|
113
|
+
-webkit-appearance: none;
|
|
114
|
+
}
|
|
111
115
|
nv-fielddropdown .input-container input,
|
|
112
116
|
nv-fielddropdown .input-container p.non-filterable-text {
|
|
113
117
|
display: flex;
|
|
@@ -116,17 +120,11 @@ nv-fielddropdown .input-container p.non-filterable-text {
|
|
|
116
120
|
overflow: hidden;
|
|
117
121
|
background-color: transparent;
|
|
118
122
|
color: var(--components-form-field-content-text);
|
|
119
|
-
|
|
123
|
+
padding: var(--form-field-padding-y) var(--form-field-padding-x);
|
|
120
124
|
font-size: var(--form-field-font-size);
|
|
121
125
|
font-style: normal;
|
|
122
126
|
font-weight: 500;
|
|
123
127
|
line-height: var(--form-field-line-height);
|
|
124
|
-
width: 100%;
|
|
125
|
-
padding-right: 2rem;
|
|
126
|
-
flex-grow: 1;
|
|
127
|
-
margin: 0;
|
|
128
|
-
min-height: 100%;
|
|
129
|
-
box-sizing: border-box;
|
|
130
128
|
}
|
|
131
129
|
nv-fielddropdown .input-container input:focus,
|
|
132
130
|
nv-fielddropdown .input-container p.non-filterable-text:focus {
|
|
@@ -143,16 +141,16 @@ nv-fielddropdown .input-container p.non-filterable-text::placeholder {
|
|
|
143
141
|
font-weight: 400;
|
|
144
142
|
line-height: var(--form-field-line-height);
|
|
145
143
|
}
|
|
146
|
-
nv-fielddropdown .input-container
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
nv-fielddropdown .input-container > nv-iconbutton {
|
|
145
|
+
border: 0px;
|
|
146
|
+
border-radius: 0px;
|
|
147
|
+
}
|
|
148
|
+
nv-fielddropdown .input-container > nv-iconbutton:focus-visible {
|
|
149
|
+
border-radius: var(--button-md-border-radius);
|
|
150
|
+
outline-offset: -3px;
|
|
151
151
|
}
|
|
152
152
|
nv-fielddropdown .input-container nv-icon.validation {
|
|
153
153
|
color: var(--nv-field-border-default);
|
|
154
|
-
position: absolute;
|
|
155
|
-
right: 50px;
|
|
156
154
|
}
|
|
157
155
|
nv-fielddropdown .non-filterable-text {
|
|
158
156
|
display: block;
|
|
@@ -55,7 +55,7 @@ export class NvFielddropdownitem {
|
|
|
55
55
|
/****************************************************************************/
|
|
56
56
|
//#region RENDER
|
|
57
57
|
render() {
|
|
58
|
-
return (h(Host, { key: '
|
|
58
|
+
return (h(Host, { key: '00b69c6a38cf852643a7e239bf07d7a123c84dc7', role: "menuitem", tabindex: '-1', onClick: this.handleSelected }, h("slot", { key: '4bd9cc35162030b57de567de4b824728c6d3c031' }), !this.composed && (h("div", { key: '17fde413045c683a09467037a4513649deda8eeb', class: "text-wrapper" }, h("span", { key: 'e4ae14322a14725d142ce57da45e50edff416935', "data-scope": "text" }, this.label))), this.selected && (h("nv-icon", { key: '95536cced4b7abeca334eee13e38870cd642ebc5', name: "check", "aria-hidden": "true", "data-scope": "selected" }))));
|
|
59
59
|
}
|
|
60
60
|
static get is() { return "nv-fielddropdownitem"; }
|
|
61
61
|
static get originalStyleUrls() {
|