@nova-design-system/nova-webcomponents 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-9bda5507.js → index-108ddff0.js} +20 -4
- package/dist/cjs/index-108ddff0.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/native.cjs.js +2 -2
- package/dist/cjs/nv-alert.cjs.entry.js +1 -1
- package/dist/cjs/nv-avatar.cjs.entry.js +1 -1
- package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/nv-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/nv-button.cjs.entry.js +1 -1
- package/dist/cjs/nv-calendar.cjs.entry.js +16 -37
- package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-col.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +95 -103
- 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-datagridcolumn.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddate.cjs.entry.js +2 -2
- package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +73 -18
- package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +84 -60
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +116 -104
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldselect.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldslider.cjs.entry.js +663 -0
- package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -0
- 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 +5 -5
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +11 -11
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +3 -3
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +3 -3
- package/dist/cjs/nv-menu.cjs.entry.js +2 -2
- package/dist/cjs/nv-menuitem.cjs.entry.js +2 -2
- package/dist/cjs/nv-popover.cjs.entry.js +2 -2
- 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-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/nv-calendar/nv-calendar.css +6 -2
- package/dist/collection/components/nv-calendar/nv-calendar.js +14 -35
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +131 -48
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +94 -152
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +20 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +1 -1
- package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +7 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +85 -17
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +7 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +8 -0
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +173 -106
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +31 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +202 -190
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/{nv-fieldmultiselect.css → styles/nv-fieldmultiselect.css} +15 -4
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +7 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +7 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +7 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +264 -0
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +1035 -0
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +1 -0
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js +77 -0
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js.map +1 -0
- package/dist/collection/components/nv-fieldslider/partials/field-input.js +33 -0
- package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +1 -0
- package/dist/collection/components/nv-fieldslider/partials/range-thumb.js +34 -0
- package/dist/collection/components/nv-fieldslider/partials/range-thumb.js.map +1 -0
- package/dist/collection/components/nv-fieldslider/partials/single-thumb.js +18 -0
- package/dist/collection/components/nv-fieldslider/partials/single-thumb.js.map +1 -0
- package/dist/collection/components/nv-fieldslider/partials/tick-marks.js +18 -0
- package/dist/collection/components/nv-fieldslider/partials/tick-marks.js.map +1 -0
- package/dist/collection/components/nv-fieldslider/styles/nv-fieldslider.css +267 -0
- package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js +159 -0
- package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js.map +1 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +15 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +9 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +4 -3
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +7 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +9 -9
- package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +7 -1
- package/dist/collection/components/nv-icon/nv-icon.js +1 -1
- package/dist/collection/components/nv-icon/nv-icons.js +1 -0
- package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
- package/dist/collection/components/nv-popover/nv-popover.js +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 +2 -2
- package/dist/collection/components/nv-tooltip/nv-tooltip.css +1 -0
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/collection/interfaces/Column.js.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-alert.js +2 -2
- package/dist/components/nv-avatar.js +2 -2
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-breadcrumb.js +3 -3
- package/dist/components/nv-breadcrumbs.js +1 -1
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-calendar.js +1 -1
- package/dist/components/nv-col.js +1 -1
- package/dist/components/nv-datagrid.js +97 -109
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-datagridcolumn.js +4 -3
- package/dist/components/nv-datagridcolumn.js.map +1 -1
- package/dist/components/nv-dialog.js +6 -6
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-dialogheader.js +1 -1
- package/dist/components/nv-fieldcheckbox.js +1 -1
- package/dist/components/nv-fielddate.js +9 -9
- package/dist/components/nv-fielddate.js.map +1 -1
- package/dist/components/nv-fielddaterange.js +83 -27
- package/dist/components/nv-fielddaterange.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +98 -72
- 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 +132 -120
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +5 -5
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldpassword.js +5 -5
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +1 -1
- package/dist/components/nv-fieldselect.js +5 -5
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldslider.d.ts +11 -0
- package/dist/components/nv-fieldslider.js +726 -0
- package/dist/components/nv-fieldslider.js.map +1 -0
- package/dist/components/nv-fieldtext.js +1 -1
- package/dist/components/nv-fieldtextarea.js +5 -5
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-fieldtime.js +15 -15
- 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 +5 -5
- 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 +3 -3
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-10faa938.js → p-04cb3a6f.js} +5 -5
- package/dist/components/{p-10faa938.js.map → p-04cb3a6f.js.map} +1 -1
- package/dist/components/{p-0a0f6daf.js → p-07a89754.js} +3 -3
- package/dist/components/{p-0a0f6daf.js.map → p-07a89754.js.map} +1 -1
- package/dist/components/{p-10b37876.js → p-0ab80d95.js} +3 -3
- package/dist/components/{p-10b37876.js.map → p-0ab80d95.js.map} +1 -1
- package/dist/components/{p-02752770.js → p-33e231f4.js} +2 -2
- package/dist/components/{p-02752770.js.map → p-33e231f4.js.map} +1 -1
- package/dist/components/{p-854c32dc.js → p-4656efae.js} +21 -42
- package/dist/components/p-4656efae.js.map +1 -0
- package/dist/components/{p-35a70c5e.js → p-581e67cc.js} +3 -3
- package/dist/components/{p-35a70c5e.js.map → p-581e67cc.js.map} +1 -1
- package/dist/components/{p-1c45c0f2.js → p-679e0fa9.js} +16 -4
- package/dist/components/p-679e0fa9.js.map +1 -0
- package/dist/components/p-76a30bf1.js +88 -0
- package/dist/components/p-76a30bf1.js.map +1 -0
- package/dist/components/{p-f5cb0a63.js → p-83c8873a.js} +3 -3
- package/dist/components/{p-f5cb0a63.js.map → p-83c8873a.js.map} +1 -1
- package/dist/components/{p-f76bb0c3.js → p-c0a91091.js} +5 -5
- package/dist/components/p-c0a91091.js.map +1 -0
- package/dist/components/{p-41c56ddc.js → p-cbdc2c8b.js} +5 -5
- package/dist/components/{p-41c56ddc.js.map → p-cbdc2c8b.js.map} +1 -1
- package/dist/components/{p-a2527411.js → p-cbe9521f.js} +3 -3
- package/dist/components/{p-a2527411.js.map → p-cbe9521f.js.map} +1 -1
- package/dist/components/{p-608eb9da.js → p-d19b41d2.js} +2 -2
- package/dist/components/{p-608eb9da.js.map → p-d19b41d2.js.map} +1 -1
- package/dist/components/{p-eb632278.js → p-d63f1cbe.js} +3 -3
- package/dist/components/{p-eb632278.js.map → p-d63f1cbe.js.map} +1 -1
- package/dist/components/{p-e00cbb8a.js → p-dd2273a3.js} +2 -2
- package/dist/components/{p-e00cbb8a.js.map → p-dd2273a3.js.map} +1 -1
- package/dist/components/{p-9decffb6.js → p-f0a5e7e4.js} +7 -7
- package/dist/components/p-f0a5e7e4.js.map +1 -0
- package/dist/components/{p-b48d5a94.js → p-f1859ddc.js} +4 -4
- package/dist/components/{p-b48d5a94.js.map → p-f1859ddc.js.map} +1 -1
- package/dist/esm/{index-1fb7a9a6.js → index-8f0e5f19.js} +20 -4
- package/dist/esm/index-8f0e5f19.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/native.js +3 -3
- package/dist/esm/nv-alert.entry.js +1 -1
- package/dist/esm/nv-avatar.entry.js +1 -1
- package/dist/esm/nv-badge_2.entry.js +1 -1
- package/dist/esm/nv-breadcrumb.entry.js +1 -1
- package/dist/esm/nv-breadcrumbs.entry.js +1 -1
- package/dist/esm/nv-button.entry.js +1 -1
- package/dist/esm/nv-calendar.entry.js +16 -37
- package/dist/esm/nv-calendar.entry.js.map +1 -1
- package/dist/esm/nv-col.entry.js +1 -1
- package/dist/esm/nv-datagrid.entry.js +95 -103
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-datagridcolumn.entry.js +2 -2
- package/dist/esm/nv-datagridcolumn.entry.js.map +1 -1
- package/dist/esm/nv-dialog.entry.js +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +1 -1
- package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
- package/dist/esm/nv-fielddate.entry.js +2 -2
- package/dist/esm/nv-fielddate.entry.js.map +1 -1
- package/dist/esm/nv-fielddaterange.entry.js +73 -18
- package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +84 -60
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
- package/dist/esm/nv-fieldmultiselect.entry.js +116 -104
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +2 -2
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +2 -2
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
- package/dist/esm/nv-fieldradio.entry.js +1 -1
- package/dist/esm/nv-fieldselect.entry.js +2 -2
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldslider.entry.js +659 -0
- package/dist/esm/nv-fieldslider.entry.js.map +1 -0
- 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 +5 -5
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-fieldtime.entry.js +11 -11
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +3 -3
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton_2.entry.js +3 -3
- package/dist/esm/nv-menu.entry.js +2 -2
- package/dist/esm/nv-menuitem.entry.js +2 -2
- package/dist/esm/nv-popover.entry.js +2 -2
- 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-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/index.esm.js.map +1 -1
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-7fd4d13d.entry.js → p-0323daf6.entry.js} +2 -2
- package/dist/native/{p-14c07207.entry.js → p-05d95d4d.entry.js} +2 -2
- package/dist/native/{p-90e6d9dd.entry.js → p-0ec1e2e3.entry.js} +2 -2
- package/dist/native/{p-c7b201cd.entry.js → p-16a4cdf3.entry.js} +2 -2
- package/dist/native/{p-1da72182.entry.js → p-19fb0fd0.entry.js} +2 -2
- package/dist/native/p-1e3d3374.entry.js +2 -0
- package/dist/native/{p-9135fdf5.entry.js.map → p-1e3d3374.entry.js.map} +1 -1
- package/dist/native/p-21e7132f.entry.js +2 -0
- package/dist/native/{p-ae7ab110.entry.js.map → p-21e7132f.entry.js.map} +1 -1
- package/dist/native/{p-c0f79bac.entry.js → p-221b8f72.entry.js} +2 -2
- package/dist/native/p-2805f9f2.entry.js +2 -0
- package/dist/native/{p-5d21532a.entry.js.map → p-2805f9f2.entry.js.map} +1 -1
- package/dist/native/p-3f2b6a22.entry.js +2 -0
- package/dist/native/p-3f2b6a22.entry.js.map +1 -0
- package/dist/native/{p-0245863d.entry.js → p-407fc32d.entry.js} +2 -2
- package/dist/native/{p-3cd77d82.entry.js → p-4c0d81b0.entry.js} +2 -2
- package/dist/native/{p-615947e7.entry.js → p-519b4819.entry.js} +2 -2
- package/dist/native/{p-7042ba8a.entry.js → p-5382eab2.entry.js} +2 -2
- package/dist/native/p-5ba3fc3c.entry.js +2 -0
- package/dist/native/{p-b94d9f0b.entry.js.map → p-5ba3fc3c.entry.js.map} +1 -1
- package/dist/native/{p-656c56f0.entry.js → p-60b204ac.entry.js} +2 -2
- package/dist/native/p-7092a675.entry.js +2 -0
- package/dist/native/p-711a7778.js +3 -0
- package/dist/native/p-711a7778.js.map +1 -0
- package/dist/native/p-759c9ce4.entry.js +2 -0
- package/dist/native/p-759c9ce4.entry.js.map +1 -0
- package/dist/native/{p-efe6a46c.entry.js → p-7c676f2c.entry.js} +2 -2
- package/dist/native/p-7c6edd1c.entry.js +2 -0
- package/dist/native/p-7c6edd1c.entry.js.map +1 -0
- package/dist/native/p-987c79d8.entry.js +2 -0
- package/dist/native/p-987c79d8.entry.js.map +1 -0
- package/dist/native/{p-b8b6875d.entry.js → p-9fba8663.entry.js} +2 -2
- package/dist/native/{p-08a75cfa.entry.js → p-a2c0f1a7.entry.js} +2 -2
- package/dist/native/p-aa86af25.entry.js +2 -0
- package/dist/native/{p-49cac014.entry.js.map → p-aa86af25.entry.js.map} +1 -1
- package/dist/native/p-adc96c3a.entry.js +2 -0
- package/dist/native/{p-4d164ed6.entry.js.map → p-adc96c3a.entry.js.map} +1 -1
- package/dist/native/p-b0fc08e7.entry.js +2 -0
- package/dist/native/p-b0fc08e7.entry.js.map +1 -0
- package/dist/native/{p-c67186f8.entry.js → p-c930adb7.entry.js} +2 -2
- package/dist/native/{p-3b7ef609.entry.js → p-cfe0a6c6.entry.js} +2 -2
- package/dist/native/p-d07ab618.entry.js +2 -0
- package/dist/native/{p-7e154bfd.entry.js → p-dac0089b.entry.js} +2 -2
- package/dist/native/p-dac0089b.entry.js.map +1 -0
- package/dist/native/{p-470588c2.entry.js → p-de2c07a6.entry.js} +3 -3
- package/dist/native/p-de2c07a6.entry.js.map +1 -0
- package/dist/native/{p-3953464e.entry.js → p-ed488498.entry.js} +2 -2
- package/dist/native/p-ef76178b.entry.js +2 -0
- package/dist/native/p-ef76178b.entry.js.map +1 -0
- package/dist/native/{p-e5de64d5.entry.js → p-f0ddf60b.entry.js} +2 -2
- package/dist/native/p-f39803d9.entry.js +2 -0
- package/dist/native/p-f39803d9.entry.js.map +1 -0
- package/dist/native/p-fb897f7d.entry.js +2 -0
- package/dist/native/{p-fc97f071.entry.js.map → p-fb897f7d.entry.js.map} +1 -1
- package/dist/native/{p-244f56ac.entry.js → p-fc3bea07.entry.js} +2 -2
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +1 -5
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +0 -16
- package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.d.ts +4 -0
- package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +11 -1
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +47 -26
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +61 -55
- package/dist/types/components/nv-fieldslider/nv-fieldslider.d.ts +230 -0
- package/dist/types/components/nv-fieldslider/nv-fieldslider.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldslider/nv-fieldslider.utils.d.ts +46 -0
- package/dist/types/components/nv-fieldslider/partials/field-input.d.ts +45 -0
- package/dist/types/components/nv-fieldslider/partials/range-thumb.d.ts +37 -0
- package/dist/types/components/nv-fieldslider/partials/single-thumb.d.ts +35 -0
- package/dist/types/components/nv-fieldslider/partials/tick-marks.d.ts +28 -0
- package/dist/types/components/nv-fieldslider/test/nv-fieldslider.utils.test.d.ts +1 -0
- package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +1 -0
- package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
- package/dist/types/components.d.ts +387 -38
- package/dist/types/interfaces/Column.d.ts +5 -1
- package/dist/vscode-data.json +121 -9
- package/hydrate/index.js +1172 -393
- package/hydrate/index.mjs +1172 -393
- package/package.json +6 -2
- package/dist/cjs/index-9bda5507.js.map +0 -1
- package/dist/components/p-1c45c0f2.js.map +0 -1
- package/dist/components/p-76646ce9.js +0 -88
- package/dist/components/p-76646ce9.js.map +0 -1
- package/dist/components/p-854c32dc.js.map +0 -1
- package/dist/components/p-9decffb6.js.map +0 -1
- package/dist/components/p-f76bb0c3.js.map +0 -1
- package/dist/esm/index-1fb7a9a6.js.map +0 -1
- package/dist/native/p-2523eead.entry.js +0 -2
- package/dist/native/p-2523eead.entry.js.map +0 -1
- package/dist/native/p-470588c2.entry.js.map +0 -1
- package/dist/native/p-49cac014.entry.js +0 -2
- package/dist/native/p-4d164ed6.entry.js +0 -2
- package/dist/native/p-4dc1d036.entry.js +0 -2
- package/dist/native/p-4e635fa7.entry.js +0 -2
- package/dist/native/p-4e635fa7.entry.js.map +0 -1
- package/dist/native/p-5d21532a.entry.js +0 -2
- package/dist/native/p-7e154bfd.entry.js.map +0 -1
- package/dist/native/p-7eba904e.entry.js +0 -2
- package/dist/native/p-7eba904e.entry.js.map +0 -1
- package/dist/native/p-9135fdf5.entry.js +0 -2
- package/dist/native/p-ab002252.js +0 -3
- package/dist/native/p-ab002252.js.map +0 -1
- package/dist/native/p-ae7ab110.entry.js +0 -2
- package/dist/native/p-b94d9f0b.entry.js +0 -2
- package/dist/native/p-c71c6f23.entry.js +0 -2
- package/dist/native/p-c71c6f23.entry.js.map +0 -1
- package/dist/native/p-d9a52884.entry.js +0 -2
- package/dist/native/p-d9a52884.entry.js.map +0 -1
- package/dist/native/p-f2ef6771.entry.js +0 -2
- package/dist/native/p-f5f68992.entry.js +0 -2
- package/dist/native/p-f5f68992.entry.js.map +0 -1
- package/dist/native/p-fc97f071.entry.js +0 -2
- /package/dist/native/{p-7fd4d13d.entry.js.map → p-0323daf6.entry.js.map} +0 -0
- /package/dist/native/{p-14c07207.entry.js.map → p-05d95d4d.entry.js.map} +0 -0
- /package/dist/native/{p-90e6d9dd.entry.js.map → p-0ec1e2e3.entry.js.map} +0 -0
- /package/dist/native/{p-c7b201cd.entry.js.map → p-16a4cdf3.entry.js.map} +0 -0
- /package/dist/native/{p-1da72182.entry.js.map → p-19fb0fd0.entry.js.map} +0 -0
- /package/dist/native/{p-c0f79bac.entry.js.map → p-221b8f72.entry.js.map} +0 -0
- /package/dist/native/{p-0245863d.entry.js.map → p-407fc32d.entry.js.map} +0 -0
- /package/dist/native/{p-3cd77d82.entry.js.map → p-4c0d81b0.entry.js.map} +0 -0
- /package/dist/native/{p-615947e7.entry.js.map → p-519b4819.entry.js.map} +0 -0
- /package/dist/native/{p-7042ba8a.entry.js.map → p-5382eab2.entry.js.map} +0 -0
- /package/dist/native/{p-656c56f0.entry.js.map → p-60b204ac.entry.js.map} +0 -0
- /package/dist/native/{p-f2ef6771.entry.js.map → p-7092a675.entry.js.map} +0 -0
- /package/dist/native/{p-efe6a46c.entry.js.map → p-7c676f2c.entry.js.map} +0 -0
- /package/dist/native/{p-b8b6875d.entry.js.map → p-9fba8663.entry.js.map} +0 -0
- /package/dist/native/{p-08a75cfa.entry.js.map → p-a2c0f1a7.entry.js.map} +0 -0
- /package/dist/native/{p-c67186f8.entry.js.map → p-c930adb7.entry.js.map} +0 -0
- /package/dist/native/{p-3b7ef609.entry.js.map → p-cfe0a6c6.entry.js.map} +0 -0
- /package/dist/native/{p-4dc1d036.entry.js.map → p-d07ab618.entry.js.map} +0 -0
- /package/dist/native/{p-3953464e.entry.js.map → p-ed488498.entry.js.map} +0 -0
- /package/dist/native/{p-e5de64d5.entry.js.map → p-f0ddf60b.entry.js.map} +0 -0
- /package/dist/native/{p-244f56ac.entry.js.map → p-fc3bea07.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["nvFieldmultiselectCss","NvFieldmultiselectStyle0","NvFieldmultiselect","constructor","hostRef","this","inputId","uuidv4","autocomplete","required","readonly","disabled","error","maxHeight","open","emptyResult","filterable","debounceDelay","autofocus","fluid","badgeLabel","filterText","selectedValues","sortedOptions","isHandlingEscape","handleBadgeCloseOptions","multiselectChange","emit","items","Array","from","el","querySelectorAll","forEach","item","checked","style","display","options","filter","option","isDivider","reorderOptionsContent","handleBadgeCloseSlots","reorderSlotContent","handlePopoverClose","resetFilter","handleInputBlurOptions","setTimeout","contains","document","activeElement","handleInputContainerClickOptions","event","target","tagName","inputContainer","querySelector","classList","add","removeFocusWithin","remove","popoverElement","addEventListener","handleInputContainerClickSlots","handleInputOptions","input","value","valueChanged","debounceTimer","window","clearTimeout","toLowerCase","filterItemsOption","handleInputSlots","filterSlotsItems","handleInputFocusOptions","handleInputFocusSlots","handleInputBlurSlots","togglePopoverOptions","togglePopoverSlots","renderOptionsMode","h","Host","label","toString","htmlFor","name","ref","triggerMode","placement","class","slot","length","color","dismissible","onCloseClicked","type","id","e","inputElement","placeholder","readOnly","onInput","onFocus","onBlur","onKeyDown","handleKeyDown","onClick","tabIndex","role","size","emphasis","map","description","includes","renderDescriptions","renderSlotsMode","handleOptionsChange","newValue","watchValueHandler","setInitialSelection","handleOpenChanged","stopPropagation","detail","filterItems","handleItemChecked","undefined","newSelectedValues","valueIndex","indexOf","push","splice","JSON","stringify","requestAnimationFrame","console","warn","handleSlotChange","connectedCallback","handleClickOutside","bind","componentWillLoad","Promise","resolve","then","hasAttribute","getAttribute","_a","String","toLocaleLowerCase","componentDidLoad","disconnectedCallback","removeEventListener","getFilterText","selectedItem","find","textContent","trim","removeAttribute","setAttribute","ul","emptyMessage","selectedItems","unselectedItems","manageDivider","getSelectedValues","divider","hasEmptyMessage","appendChild","createElement","className","existingEmptyMessage","normalizedFilter","normalizeText","hasVisibleItems","opt","matchesFilter","visibleItems","visibleSelected","visibleUnselected","removeEmptyMessageOption","addEmptyMessageOption","visibleSelectedItems","text","normalize","replace","key","focusFirstItem","preventDefault","currentIndex","findIndex","updateHighlightedItem","isCurrentlyChecked","dispatchEvent","MouseEvent","view","bubbles","cancelable","handleEscape","async","blur","index","i","scrollIntoView","block","checkbox","focus","firstItem","existingMessage","shouldShowDivider","lastSelectedItem","after","errorDescription","hidden","render"],"sources":["src/components/nv-fieldmultiselect/styles/nv-fieldmultiselect.scss?tag=nv-fieldmultiselect","src/components/nv-fieldmultiselect/nv-fieldmultiselect.tsx"],"sourcesContent":["@import '../../../styles/form-field';\n@import '../../../styles/scrollbar';\n\nnv-fieldmultiselect {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid='false']) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[required]:not([required='false']) {\n > label {\n @include form-field-label-required();\n }\n }\n\n label {\n @include form-field-label();\n }\n\n nv-popover {\n @include form-field-popover();\n\n div[slot='content'] {\n @include scrollbar();\n max-height: calc(90vh - var(--list-dropdown-padding) * 2);\n overflow-y: auto;\n position: relative;\n }\n }\n\n .input-wrapper-multiselect {\n @include form-field-input-wrapper();\n width: 100%;\n }\n\n .input-container-multiselect {\n @include form-field-input-container();\n position: relative;\n width: 100%;\n min-height: 40px;\n\n > nv-badge {\n margin-left: var(--form-field-padding-x);\n }\n\n input,\n p.non-filterable-text {\n @include form-field-input();\n width: 100%;\n flex-grow: 1;\n margin: 0;\n min-height: 100%;\n box-sizing: border-box;\n }\n\n > nv-iconbutton {\n @include form-field-action();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n\n /* &:hover{\n border-color: var(--components-form-field-border-hover);\n }\n\n &:focus-visible,\n &:focus-within,\n &:focus,\n &.focus-within {\n border-color: var(--components-form-field-border-focus);\n box-shadow: 0px 0px 0px var(--focus-field-stroke)\n var(--nv-field-focus-box-shadow);\n } */\n }\n\n .non-filterable-text {\n display: block;\n border-radius: var(--form-field-radius);\n background-color: var(--nv-field-background);\n color: var(--components-form-field-content-text);\n font-size: var(--form-field-font-size);\n font-weight: 500;\n line-height: var(--form-field-line-height);\n box-sizing: border-box;\n cursor: pointer;\n height: 100%;\n min-height: 40px;\n\n span {\n display: inline-block;\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n\n.no-results-message {\n text-align: center;\n padding: 10px;\n color: var(--components-form-text-description-error);\n}\n\n.multiselect-divider {\n display: block;\n width: 100%;\n height: 1px;\n background-color: var(--components-list-dropdown-separator);\n margin: var(--list-dropdown-item-padding-y) 0;\n border: 0;\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\n\nimport { v4 as uuidv4 } from 'uuid';\nimport { TextInputAutocomplete } from '../../utils/constants';\n\n/**\n * @slot content - The content of the list.\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-fieldmultiselect',\n styleUrl: 'styles/nv-fieldmultiselect.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFieldmultiselect {\n @Element() el: HTMLNvFieldmultiselectElement;\n private inputElement!: HTMLInputElement;\n private popoverElement!: HTMLNvPopoverElement;\n /**\n * Timer for debouncing input events.\n * Private property preferred over @State as it:\n * - Doesn't need to trigger re-renders\n * - Is purely for internal logic\n * - Improves performance by avoiding Stencil's reactivity system\n */\n private debounceTimer: number;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input's data in form submissions. It should be\n * unique within the form to avoid conflicts.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It's a crucial element for making forms clear and 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.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Display temporary text inside the input field.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they've used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}` = 'off';\n\n /**\n * Specifies the value of the input field.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * Marks the input field as required.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Display the input field's content without allowing users to change it.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Disables the input field.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Alters the input field's appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the multiselect\n * field.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\n\n /**\n * Defines the maximum height of the multiselect list when open.\n */\n @Prop({ reflect: true })\n readonly maxHeight: string = '';\n\n /**\n * State of the multiselect popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * The text to display when no items match the filter.\n */\n @Prop({ reflect: true })\n readonly emptyResult: string = 'No results found';\n\n /**\n * Enables or disables the filtering feature for the multiselect items.\n */\n @Prop({ reflect: true })\n readonly filterable: boolean = false;\n\n /**\n * List of options used to automatically generate dropdown items. This\n * provides an alternative to using the slot manually.\n *\n * @example\n * options=[{\n * \"label\": \"Option 1\",\n * \"value\": \"option1\",\n * },\n * {\n * \"label\": \"Option 2\",\n * \"value\": \"option2\",\n * }]\n */\n @Prop({ reflect: false, mutable: true })\n options?: {\n /** Label to display for the option */\n label: string;\n /** Value associated with the option */\n value: string;\n /** Whether this option is a divider */\n isDivider?: boolean;\n /** Whether this option is disabled */\n disabled?: boolean;\n /** Additional description for the option */\n description?: string;\n /** Whether this option is pre-checked */\n checked?: boolean;\n }[];\n\n /**\n * Delay in milliseconds before the search is triggered when typing in the filter input.\n * @default 300\n */\n @Prop({ reflect: true })\n readonly debounceDelay: number = 300;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n /**\n * Text for the badge showing the number of selected items.\n */\n @Prop({ reflect: true })\n readonly badgeLabel: string = '';\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n /**\n * The text entered by the user for filtering multiselect items.\n */\n @State()\n filterText: string = '';\n\n /**\n * List of selected values in the multiselect.\n */\n @State()\n selectedValues: string[] = [];\n\n /**\n * Sorted options for display.\n */\n @State()\n sortedOptions: 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 a divider */\n isDivider?: boolean;\n }> = [];\n\n @State()\n private isHandlingEscape: boolean = false;\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 the selection changes in the multiselect.\n * Emits the current list of selected values.\n */\n @Event()\n multiselectChange: EventEmitter<string[]>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('options')\n handleOptionsChange(newValue: typeof this.options) {\n if (!newValue) return;\n\n this.selectedValues = newValue\n .filter(option => option.checked)\n .map(option => option.value);\n\n this.reorderOptionsContent();\n }\n\n /**\n * Emitted when the value changes.\n */\n @Watch('value')\n watchValueHandler() {\n // Handle value change and update the corresponding multiselect item if it exists\n this.setInitialSelection();\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LISTENERS\n\n /**\n * Emitted when the input loses focus.\n * @param {CustomEvent<boolean>} event - The event object containing the focus state.\n */\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n // Stop propagation to prevent the event from affecting parent components like dialogs\n event.stopPropagation();\n\n // Update `open` based on the popover state\n this.open = event.detail;\n\n if (this.open) {\n // Filter items only if there is filter text\n if (this.filterText) {\n this.filterItems();\n }\n } else {\n this.handlePopoverClose();\n }\n\n if (this.options) {\n this.reorderOptionsContent();\n } else {\n this.reorderSlotContent();\n }\n }\n\n /**\n * Listen for the `itemChecked` event emitted by child items.\n * @param {CustomEvent} event - The event object containing the selected value and its checked state.\n */\n @Listen('itemChecked')\n handleItemChecked(\n event: CustomEvent<{\n /** Value associated with the option */\n value: string;\n /** Whether this option is checked */\n checked: boolean;\n }>,\n ) {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const { value, checked } = event.detail;\n\n if (value !== undefined && value !== null) {\n const newSelectedValues = [...this.selectedValues];\n const valueIndex = newSelectedValues.indexOf(value);\n\n if (checked && valueIndex === -1) {\n newSelectedValues.push(value);\n } else if (!checked && valueIndex > -1) {\n newSelectedValues.splice(valueIndex, 1);\n }\n\n // Update the state and emit the event only if the selection has changed\n if (\n JSON.stringify(this.selectedValues) !==\n JSON.stringify(newSelectedValues)\n ) {\n this.selectedValues = newSelectedValues;\n\n // Use requestAnimationFrame to ensure the state is updated before emitting the event\n requestAnimationFrame(() => {\n this.multiselectChange.emit(this.selectedValues);\n });\n }\n } else {\n console.warn('Received itemChecked event with undefined or null value'); // Warning log\n }\n }\n\n // Add a listener for the slot content\n @Listen('slotchange')\n handleSlotChange(event: Event) {\n // Check: we only want to reorder if it's the \"content\" slot\n const slot = event.target as HTMLSlotElement;\n if (slot && slot.name === 'content') {\n // To give other platforms (VueJS, React, etc.) time to insert all their items,\n // we place the reorder in a requestAnimationFrame\n requestAnimationFrame(() => {\n this.reorderSlotContent();\n });\n }\n }\n\n //#endregion LISTENERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n /**\n * Subscribe to click outside event.\n */\n connectedCallback() {\n document.addEventListener('click', this.handleClickOutside.bind(this));\n }\n\n /**\n * Set the mode state and handle options change.\n */\n componentWillLoad() {\n // Don't call handleOptionsChange if we are in slots mode\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n\n // Specific initialization for slots mode\n if (!this.options) {\n Promise.resolve().then(() => {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n\n // Initialize selectedValues with checked items\n this.selectedValues = items\n .filter(item => item.hasAttribute('checked'))\n .map(item => item.getAttribute('value') || '');\n\n // Force a reorder after initialization\n requestAnimationFrame(() => {\n this.reorderSlotContent();\n });\n });\n }\n\n // Initialize the sorted options array with the parsed options for initial rendering\n if (this.options) {\n this.sortedOptions = [...(this.options ?? [])];\n }\n\n // Apply filtering if the multiselect is filterable and there is a value\n if (this.filterable && this.value) {\n this.filterText = String(this.value).toLocaleLowerCase();\n this.filterItems();\n } else {\n // Reset visibility state of all dropdown items\n this.resetFilter();\n }\n }\n\n /**\n * Force reorder if options mode in componentDidLoad because of the initial render not trigger @watch\n */\n componentDidLoad() {\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n /**\n * Unsubscribe from click outside event.\n */\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside.bind(this));\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Retrieves the current filter text entered by the user.\n * @returns {string} The filter text.\n */\n @Method()\n async getFilterText(): Promise<string> {\n return this.filterText;\n }\n\n /**\n * Set the initial selection based on the current value and update the inputElement value.\n */\n private setInitialSelection() {\n const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem'));\n\n const selectedItem = items.find(\n item =>\n item.getAttribute('label') === this.value ||\n item.getAttribute('value') === this.value ||\n item.textContent?.trim() === this.value,\n );\n\n // Remove 'selected' from all items first to reset the state\n items.forEach(item => {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n });\n\n if (selectedItem) {\n // Add the `selected` attribute and `selected` class for visual styling\n selectedItem.setAttribute('selected', 'true');\n selectedItem.classList.add('selected');\n\n // Update the value and inputElement value to reflect the pre-selected item\n this.value =\n selectedItem.getAttribute('label') ||\n selectedItem.getAttribute('value') ||\n selectedItem.textContent?.trim() ||\n '';\n if (this.inputElement) {\n this.inputElement.value = this.value;\n }\n }\n }\n\n /**\n * Reset the filter and make all items visible.\n */\n @Method()\n async resetFilter(): Promise<void> {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n\n // Reset visibility state of all dropdown items\n items.forEach(item => {\n item.style.display = '';\n });\n\n // Clean up filter-related UI elements\n const ul = this.el.querySelector('ul');\n if (ul) {\n const emptyMessage = ul.querySelector('[data-empty]');\n if (emptyMessage) emptyMessage.remove();\n\n // Reorder with divider if needed\n const selectedItems = items.filter(item =>\n this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n const unselectedItems = items.filter(\n item => !this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n\n if (selectedItems.length > 0) {\n this.manageDivider(ul as HTMLElement, selectedItems, unselectedItems);\n }\n }\n }\n\n /**\n * Returns the list of selected values.\n * @returns {string[]} The selected values.\n */\n @Method()\n async getSelectedValues(): Promise<string[]> {\n return this.selectedValues;\n }\n\n /**\n * Reorder the content of the slot.\n */\n private reorderSlotContent() {\n if (this.options) return;\n\n const ul = this.el.querySelector('ul');\n if (!ul) return;\n\n // Remove all existing <hr class=\"multiselect-divider\">\n ul.querySelectorAll('hr.multiselect-divider').forEach(divider =>\n divider.remove(),\n );\n\n // Retrieve all items (not hidden)\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n ).filter(item => item.style.display !== 'none');\n\n // If you possibly have a \"No results\" message:\n const hasEmptyMessage = ul.querySelector('[data-empty]');\n if (hasEmptyMessage) {\n // if there is a \"No results found\" message, do not reorder\n return;\n }\n\n // Separate checked vs unchecked\n const selectedItems = items.filter(item =>\n this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n const unselectedItems = items.filter(\n item => !this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n\n // Reinsert CHECKED items FIRST\n // appendChild() moves the element without recreating it\n // this is not trigger a re-rendering of the component in the platforms\n selectedItems.forEach(item => {\n ul.appendChild(item); // <-- The <li> (or <nv-fielddropdownitemcheck>) is just \"moved\" to the end of the list\n });\n\n // Add a divider if needed\n if (selectedItems.length > 0 && unselectedItems.length > 0) {\n const divider = document.createElement('hr');\n divider.className = 'multiselect-divider';\n ul.appendChild(divider);\n }\n\n // Reinsert UNCHECKED items at the end\n unselectedItems.forEach(item => {\n ul.appendChild(item);\n });\n }\n\n /**\n * Reorder the content for options mode with async handling\n */\n private reorderOptionsContent() {\n const ul = this.el.querySelector('ul[role=\"content\"]') as HTMLElement;\n if (!ul) return;\n\n const items = Array.from(\n ul.querySelectorAll('nv-fielddropdownitemcheck'),\n ).filter(item => item.style.display !== 'none');\n\n const selectedItems = items.filter(item =>\n this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n const unselectedItems = items.filter(\n item => !this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n\n // Reorder the elements\n selectedItems.forEach(item => ul.appendChild(item));\n unselectedItems.forEach(item => ul.appendChild(item));\n\n // Manage the divider after the reordering\n this.manageDivider(ul, selectedItems, unselectedItems);\n }\n\n /**\n * Filter multiselect items based on the text entered by the user.\n */\n private filterItems() {\n const ul = this.el.querySelector('ul');\n if (!ul) return;\n\n // Remove existing empty message if any\n const existingEmptyMessage = ul.querySelector('[data-empty]');\n if (existingEmptyMessage) {\n existingEmptyMessage.remove();\n }\n\n if (!this.filterText.trim()) {\n if (this.options && this.options.length > 0) {\n // Reset options display\n const items = Array.from(\n ul.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n items.forEach(item => {\n item.style.display = '';\n });\n } else {\n // Reset slot items display\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n items.forEach(item => {\n item.style.display = '';\n });\n }\n\n // Reorder with divider\n const items = Array.from(\n ul.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n const selectedItems = items.filter(item =>\n this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n const unselectedItems = items.filter(\n item => !this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n this.manageDivider(ul, selectedItems, unselectedItems);\n return;\n }\n\n const normalizedFilter = this.normalizeText(this.filterText);\n let hasVisibleItems = false;\n\n if (this.options && this.options.length > 0) {\n // Filter options mode\n const items = Array.from(\n ul.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n\n items.forEach(item => {\n const option = this.options.find(\n opt => opt.value === item.getAttribute('value'),\n );\n if (option && !option.isDivider) {\n const matchesFilter =\n this.normalizeText(option.label).includes(normalizedFilter) ||\n this.normalizeText(option.value).includes(normalizedFilter);\n\n item.style.display = matchesFilter ? '' : 'none';\n if (matchesFilter) hasVisibleItems = true;\n }\n });\n\n // Manage the divider with the visible items\n const visibleItems = items.filter(item => item.style.display !== 'none');\n const visibleSelected = visibleItems.filter(item =>\n this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n const visibleUnselected = visibleItems.filter(\n item => !this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n this.manageDivider(ul, visibleSelected, visibleUnselected);\n } else {\n // Filter slot items mode\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n\n items.forEach(item => {\n const label = item.getAttribute('label') || '';\n const value = item.getAttribute('value') || '';\n const textContent = item.textContent || '';\n\n const matchesFilter =\n this.normalizeText(label).includes(normalizedFilter) ||\n this.normalizeText(value).includes(normalizedFilter) ||\n this.normalizeText(textContent).includes(normalizedFilter);\n\n item.style.display = matchesFilter ? '' : 'none';\n if (matchesFilter) hasVisibleItems = true;\n });\n }\n\n // Add empty message if no items match the filter\n if (!hasVisibleItems) {\n const emptyMessage = document.createElement('li');\n emptyMessage.setAttribute('data-empty', 'true');\n emptyMessage.textContent = this.emptyResult;\n emptyMessage.classList.add('no-results-message');\n ul.appendChild(emptyMessage);\n }\n\n this.reorderSlotContent();\n }\n\n /**\n * Filter multiselect items in options mode.\n */\n private filterItemsOption() {\n const ul = this.el.querySelector('ul');\n if (!ul) return;\n\n const normalizedFilter = this.normalizeText(this.filterText);\n let hasVisibleItems = false;\n\n const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));\n\n // Reset items if the filter text is empty\n if (!this.filterText.trim()) {\n // Remove the empty message if it exists\n this.removeEmptyMessageOption(ul);\n items.forEach(item => (item.style.display = ''));\n this.reorderOptionsContent(); // Reorder after reset\n return;\n }\n\n // Filter the items\n items.forEach(item => {\n const label = item.getAttribute('label') || '';\n const value = item.getAttribute('value') || '';\n\n const matchesFilter =\n this.normalizeText(label).includes(normalizedFilter) ||\n this.normalizeText(value).includes(normalizedFilter);\n\n item.style.display = matchesFilter ? '' : 'none';\n if (matchesFilter) hasVisibleItems = true;\n });\n\n // Manage the divider with the visible items\n const visibleItems = items.filter(item => item.style.display !== 'none');\n const visibleSelected = visibleItems.filter(item =>\n this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n const visibleUnselected = visibleItems.filter(\n item => !this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n\n this.manageDivider(ul, visibleSelected, visibleUnselected);\n\n // Add or remove the empty message based on the case\n if (!hasVisibleItems) {\n this.addEmptyMessageOption(ul);\n } else {\n this.removeEmptyMessageOption(ul);\n }\n }\n\n /**\n * Filter multiselect items in slots mode\n */\n private filterSlotsItems() {\n if (this.options) return;\n\n const ul = this.el.querySelector('ul');\n if (!ul) return;\n\n // Remove existing empty message if any\n const existingEmptyMessage = ul.querySelector('[data-empty]');\n if (existingEmptyMessage) {\n existingEmptyMessage.remove();\n }\n\n // If filter text is empty, reset all items visibility\n if (!this.filterText.trim()) {\n this.resetFilter();\n return;\n }\n\n const normalizedFilter = this.normalizeText(this.filterText);\n let hasVisibleItems = false;\n\n // Get all items and preserve them in the DOM\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n\n // Instead of removing/reordering, just hide/show items\n items.forEach(item => {\n const label = item.getAttribute('label') || '';\n const value = item.getAttribute('value') || '';\n const textContent = item.textContent?.trim() || '';\n\n const matchesFilter =\n this.normalizeText(label).includes(normalizedFilter) ||\n this.normalizeText(value).includes(normalizedFilter) ||\n this.normalizeText(textContent).includes(normalizedFilter);\n\n item.style.display = matchesFilter ? '' : 'none';\n if (matchesFilter) hasVisibleItems = true;\n });\n\n // Get visible items after filtering\n const visibleItems = items.filter(item => item.style.display !== 'none');\n const visibleSelectedItems = visibleItems.filter(item =>\n this.selectedValues.includes(item.getAttribute('value') || ''),\n );\n\n this.manageDivider(\n ul,\n visibleSelectedItems,\n visibleItems.filter(\n item => !this.selectedValues.includes(item.getAttribute('value') || ''),\n ),\n );\n\n // Add empty message if no items match the filter\n if (!hasVisibleItems) {\n const emptyMessage = document.createElement('li');\n emptyMessage.setAttribute('data-empty', 'true');\n emptyMessage.textContent = this.emptyResult;\n emptyMessage.classList.add('no-results-message');\n ul.appendChild(emptyMessage);\n }\n }\n\n /**\n * Handle badge close for options mode.\n */\n private handleBadgeCloseOptions = (): void => {\n this.selectedValues = [];\n this.multiselectChange.emit(this.selectedValues);\n\n // Uncheck all elements\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n\n items.forEach(item => {\n item.checked = false;\n item.style.display = '';\n });\n\n // Reorder options without the divider since there are no selected elements\n this.options = this.options.filter(option => !option.isDivider);\n\n // Reorder options without the divider since there are no selected elements\n this.reorderOptionsContent();\n };\n\n /**\n * Handle badge close for slots mode.\n */\n private handleBadgeCloseSlots = (): void => {\n this.selectedValues = [];\n this.multiselectChange.emit(this.selectedValues);\n\n // Uncheck all elements\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitemcheck'),\n );\n\n items.forEach(item => {\n item.checked = false;\n item.style.display = '';\n });\n\n // Reorder slot content\n this.reorderSlotContent();\n };\n\n /**\n * Normalizes text by removing accents and converting to lowercase\n * @param {string} text - The text to normalize\n * @returns {string} The normalized text\n *\n * @example\n * normalizeText(\"Café Latte\") => \"cafe latte\"\n *\n * @description\n * This function performs text normalization in three steps:\n * 1. Decomposes characters into their base form and combining characters (NFD)\n * 2. Removes all diacritical marks (accents, umlauts, etc.)\n * 3. Converts to lowercase and trims whitespace\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize} - MDN documentation on String.normalize()\n * @see {@link https://en.wikipedia.org/wiki/Unicode_equivalence#Normal_forms} - More info about Unicode normalization forms\n */\n private normalizeText(text: string): string {\n return text\n .normalize('NFD') // Decompose characters into base + combining characters (e.g., é => e + ´)\n .replace(/[\\u0300-\\u036f]/g, '') // Remove all diacritical marks (Unicode range for combining characters)\n .toLowerCase() // Convert to lowercase\n .trim(); // Remove leading and trailing whitespace\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 this.open = false;\n }\n\n /**\n * Handle popover close\n */\n private handlePopoverClose = () => {\n // If we are handling Escape, ignore this event\n if (this.isHandlingEscape) {\n return;\n }\n\n this.filterText = '';\n\n // Reset filter if needed\n if (this.filterable) {\n this.resetFilter();\n }\n };\n\n /**\n * Handle input blur for options mode.\n */\n private handleInputBlurOptions = () => {\n setTimeout(() => {\n if (!this.el.contains(document.activeElement)) {\n // Close the popover without affecting the divider\n this.open = false;\n\n // Reset filter if needed\n if (this.filterable) {\n this.filterText = '';\n this.resetFilter();\n }\n }\n }, 150);\n };\n\n /**\n * Handle keyboard events & arrow key navigation.\n * If the multiselect is not open, opens it and focuses on the first item if the list is not filterable.\n * If the multiselect is open, handles arrow key navigation and closes it if the focus is outside the component.\n * @param {KeyboardEvent} event - The keyboard event.\n */\n @Listen('keydown', { passive: false })\n async handleKeyDown(event: KeyboardEvent) {\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n // Focus on the first item if the list is not filterable\n if (!this.filterable) {\n requestAnimationFrame(() => {\n this.focusFirstItem();\n });\n }\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll(\n 'nv-fielddropdownitemcheck:not([style*=\"display: none\"])',\n ),\n ) as HTMLNvFielddropdownitemcheckElement[];\n\n if (items.length === 0) {\n console.warn('No visible 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 =\n currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n currentIndex =\n currentIndex === -1\n ? items.length - 1\n : (currentIndex - 1 + items.length) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'Enter' && currentIndex >= 0) {\n event.preventDefault();\n const selectedItem = items[currentIndex];\n\n // Toggle the checked state\n const isCurrentlyChecked = selectedItem.hasAttribute('checked');\n selectedItem.checked = !isCurrentlyChecked;\n\n // Trigger a click event to ensure proper event handling\n selectedItem.dispatchEvent(\n new MouseEvent('click', {\n view: window,\n bubbles: true,\n cancelable: true,\n }),\n );\n } else if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation(); // Prevent the event from propagating to the popover\n\n // Do the reorder and wait a bit before closing\n const handleEscape = async () => {\n this.isHandlingEscape = true; // Disable the hide listener\n\n if (this.options) {\n this.reorderOptionsContent();\n } else {\n this.reorderSlotContent();\n }\n\n // Wait for the reorder to be applied\n await new Promise(resolve => setTimeout(resolve, 100));\n\n // Reactivate the hide listener after a short delay\n setTimeout(() => {\n this.isHandlingEscape = false;\n this.open = false;\n }, 150);\n\n if (this.inputElement) {\n this.inputElement.blur();\n }\n };\n\n await handleEscape();\n }\n }\n\n /**\n * Updates the highlighted item in the dropdown list.\n *\n * @param {(HTMLNvFielddropdownitemElement | HTMLNvFielddropdownitemcheckElement)[]} items - The items to update.\n * @param {number} index - The index of the item to highlight.\n */\n private updateHighlightedItem(\n items: (\n | HTMLNvFielddropdownitemElement\n | HTMLNvFielddropdownitemcheckElement\n )[],\n index: number,\n ) {\n items.forEach((item, i) => {\n if (i === index) {\n item.classList.add('highlighted');\n item.setAttribute('tabindex', '0');\n item.scrollIntoView({ block: 'nearest' });\n // Focus on the nv-fieldcheckbox inside\n const checkbox = item.querySelector('nv-fieldcheckbox');\n if (checkbox) {\n (checkbox as HTMLElement).focus();\n }\n } else {\n item.classList.remove('highlighted');\n item.setAttribute('tabindex', '-1');\n }\n });\n }\n\n /**\n * Focus on the first item in the dropdown list.\n */\n private focusFirstItem() {\n const firstItem = this.el.querySelector(\n 'nv-fielddropdownitemcheck:not([style*=\"display: none\"])',\n ) as HTMLNvFielddropdownitemcheckElement;\n\n if (firstItem) {\n firstItem.setAttribute('tabindex', '0');\n firstItem.classList.add('highlighted');\n firstItem.scrollIntoView({ block: 'nearest' });\n // Focus on the nv-fieldcheckbox inside\n const checkbox = firstItem.querySelector('nv-fieldcheckbox');\n if (checkbox) {\n (checkbox as HTMLElement).focus();\n }\n } else {\n console.warn('No visible first item found to focus');\n }\n }\n\n /**\n * Handle click on the input container for options mode.\n * @param {MouseEvent} event - The click event.\n */\n private handleInputContainerClickOptions = (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 const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n /**\n * Handle click on the input container for slots mode.\n * @param {MouseEvent} event - The click event.\n */\n private handleInputContainerClickSlots = (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 const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n /**\n * Handle input change for options mode.\n * @param {Event} event - The input event.\n */\n private readonly handleInputOptions = (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.value = input.value;\n this.valueChanged.emit(this.value);\n\n // Clear any existing timer\n if (this.debounceTimer) {\n window.clearTimeout(this.debounceTimer);\n }\n\n // Set a new timer for filtering\n this.debounceTimer = window.setTimeout(() => {\n this.filterText = input.value.toLowerCase();\n this.filterItemsOption();\n }, this.debounceDelay);\n };\n\n private addEmptyMessageOption(ul: HTMLElement) {\n const existingMessage = ul.querySelector('[data-empty]');\n if (existingMessage) return;\n\n const emptyMessage = document.createElement('li');\n emptyMessage.setAttribute('data-empty', 'true');\n emptyMessage.textContent = this.emptyResult;\n emptyMessage.classList.add('no-results-message');\n ul.appendChild(emptyMessage);\n }\n\n private removeEmptyMessageOption(ul: HTMLElement) {\n const existingMessage = ul.querySelector('[data-empty]');\n if (existingMessage) existingMessage.remove();\n }\n\n /**\n * Handle input change for slots mode\n * @param {Event} event - The input event.\n */\n private readonly handleInputSlots = (event: Event) => {\n if (!this.filterable) return;\n if (this.disabled || this.readonly) return;\n\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.valueChanged.emit(this.value);\n\n // Clear any existing timer\n if (this.debounceTimer) {\n window.clearTimeout(this.debounceTimer);\n }\n\n // Set a new timer for filtering\n this.debounceTimer = window.setTimeout(() => {\n this.filterText = input.value.toLowerCase();\n this.filterSlotsItems();\n }, this.debounceDelay);\n };\n\n /**\n * Handle input focus for options mode.\n */\n private handleInputFocusOptions = () => {\n if (this.disabled || this.readonly) {\n return;\n }\n this.open = true;\n };\n\n /**\n * Handle input focus for slots mode.\n */\n private handleInputFocusSlots = () => {\n if (this.disabled || this.readonly) {\n return;\n }\n this.open = true;\n };\n\n /**\n * Handle input blur for slots mode.\n */\n private handleInputBlurSlots = () => {\n setTimeout(() => {\n if (!this.el.contains(document.activeElement)) {\n // Close the popover without affecting the divider\n this.open = false;\n\n // Reset filter if needed\n if (this.filterable) {\n this.filterText = '';\n this.resetFilter();\n }\n }\n }, 150);\n };\n\n /**\n * Toggle the multiselect popover for options mode.\n */\n private togglePopoverOptions = (): void => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n this.open = !this.open;\n };\n\n /**\n * Toggle the multiselect popover for slots mode.\n */\n private togglePopoverSlots = (): void => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n this.open = !this.open;\n };\n\n private manageDivider(\n ul: HTMLElement,\n selectedItems: Element[],\n unselectedItems: Element[],\n ) {\n let divider = ul.querySelector('hr.multiselect-divider') as HTMLElement;\n if (!divider) {\n divider = document.createElement('hr');\n divider.className = 'multiselect-divider';\n ul.appendChild(divider);\n }\n\n const shouldShowDivider =\n selectedItems.length > 0 && unselectedItems.length > 0;\n\n if (shouldShowDivider) {\n // Place the divider after the last selected item\n const lastSelectedItem = selectedItems[selectedItems.length - 1];\n lastSelectedItem.after(divider);\n divider.style.display = '';\n } else {\n divider.style.display = 'none';\n }\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region RENDER\n\n /**\n * Renders the component in options mode\n * @returns {any} The JSX for options mode\n */\n private renderOptionsMode = () => {\n return (\n <Host aria-label={this.label} aria-expanded={this.open.toString()}>\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)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper-multiselect\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div class=\"input-container-multiselect\">\n <slot name=\"leading-input\"></slot>\n\n {this.selectedValues.length > 0 && (\n <nv-badge\n slot=\"leading-input\"\n prevent-auto-close\n color=\"10\"\n dismissible={this.selectedValues.length > 0}\n label={`${this.selectedValues.length} ${this.badgeLabel}`}\n aria-label={`Clear all ${this.selectedValues.length} ${this.badgeLabel} items`}\n onCloseClicked={this.handleBadgeCloseOptions}\n ></nv-badge>\n )}\n\n {this.filterable || this.disabled || this.readonly ? (\n <input\n type=\"text\"\n id={this.inputId}\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.value}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInputOptions}\n onFocus={this.handleInputFocusOptions}\n onBlur={this.handleInputBlurOptions}\n onKeyDown={this.handleKeyDown}\n data-scope=\"focusable\"\n />\n ) : (\n <p\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClickOptions}\n tabIndex={0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleInputFocusOptions}\n role=\"combobox\"\n aria-expanded={this.open}\n data-scope=\"focusable\"\n >\n <span>{this.value || this.placeholder}</span>\n </p>\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.togglePopoverOptions}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div\n slot=\"content\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n style={this.maxHeight ? { maxHeight: this.maxHeight } : {}}\n >\n <ul role=\"content\">\n {this.options.map(option => (\n <nv-fielddropdownitemcheck\n label={option.label}\n description={option.description}\n value={option.value}\n checked={this.selectedValues.includes(option.value)}\n disabled={option.disabled}\n ></nv-fielddropdownitemcheck>\n ))}\n <hr class=\"multiselect-divider\" style={{ display: 'none' }} />\n </ul>\n </div>\n </nv-popover>\n\n {this.renderDescriptions()}\n </Host>\n );\n };\n\n /**\n * Renders the component in slots mode\n * @returns {any} The JSX for slots mode\n */\n private renderSlotsMode = () => {\n return (\n <Host aria-label={this.label} aria-expanded={this.open.toString()}>\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)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper-multiselect\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container-multiselect\"\n onClick={this.handleInputContainerClickSlots}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.selectedValues.length > 0 && (\n <nv-badge\n slot=\"leading-input\"\n prevent-auto-close\n color=\"10\"\n dismissible={this.selectedValues.length > 0}\n label={`${this.selectedValues.length} ${this.badgeLabel}`}\n aria-label={`Clear all ${this.selectedValues.length} ${this.badgeLabel} items`}\n onCloseClicked={this.handleBadgeCloseSlots}\n ></nv-badge>\n )}\n\n {this.filterable || this.disabled || this.readonly ? (\n <input\n id={this.inputId}\n ref={e => (this.inputElement = e)}\n autocomplete={this.autocomplete}\n placeholder={this.placeholder}\n name={this.name}\n value={this.value}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInputSlots}\n onFocus={this.handleInputFocusSlots}\n onBlur={this.handleInputBlurSlots}\n onKeyDown={this.handleKeyDown}\n data-scope=\"focusable\"\n />\n ) : (\n <p\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClickSlots}\n tabIndex={0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleInputFocusSlots}\n role=\"combobox\"\n aria-expanded={this.open}\n data-scope=\"focusable\"\n >\n <span>{this.value || this.placeholder}</span>\n </p>\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.togglePopoverSlots}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div\n slot=\"content\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n style={this.maxHeight ? { maxHeight: this.maxHeight } : {}}\n >\n <slot name=\"content\"></slot>\n </div>\n </nv-popover>\n\n {this.renderDescriptions()}\n </Host>\n );\n };\n\n /**\n * Renders description and error description sections\n * @returns {any} The JSX for descriptions\n */\n private renderDescriptions() {\n return [\n (this.description || this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\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 ];\n }\n\n /**\n * Main render method that decides which mode to render\n * @returns {any} The JSX for the component\n */\n render() {\n return this.options ? this.renderOptionsMode() : this.renderSlotsMode();\n }\n\n //#endregion RENDER\n /****************************************************************************/\n}\n"],"mappings":"oGAAA,MAAMA,EAAwB,qoOAC9B,MAAAC,EAAeD,E,MC+BFE,EAAkB,MAN/B,WAAAC,CAAAC,G,0GA6BWC,KAAAC,QAAkBC,IAqClBF,KAAAG,aAA2C,MAY3CH,KAAAI,SAAoB,MAMpBJ,KAAAK,SAAoB,MAMpBL,KAAAM,SAAoB,MAQpBN,KAAAO,MAAiB,MAcjBP,KAAAQ,UAAoB,GAM7BR,KAAAS,KAAgB,MAMPT,KAAAU,YAAsB,mBAMtBV,KAAAW,WAAsB,MAqCtBX,KAAAY,cAAwB,IASxBZ,KAAAa,UAAqB,MAMrBb,KAAAc,MAAiB,MAMjBd,KAAAe,WAAqB,GAU9Bf,KAAAgB,WAAqB,GAMrBhB,KAAAiB,eAA2B,GAM3BjB,KAAAkB,cAOK,GAGGlB,KAAAmB,iBAA4B,MAqmB5BnB,KAAAoB,wBAA0B,KAChCpB,KAAKiB,eAAiB,GACtBjB,KAAKqB,kBAAkBC,KAAKtB,KAAKiB,gBAGjC,MAAMM,EAAQC,MAAMC,KAClBzB,KAAK0B,GAAGC,iBAAiB,8BAG3BJ,EAAMK,SAAQC,IACZA,EAAKC,QAAU,MACfD,EAAKE,MAAMC,QAAU,EAAE,IAIzBhC,KAAKiC,QAAUjC,KAAKiC,QAAQC,QAAOC,IAAWA,EAAOC,YAGrDpC,KAAKqC,uBAAuB,EAMtBrC,KAAAsC,sBAAwB,KAC9BtC,KAAKiB,eAAiB,GACtBjB,KAAKqB,kBAAkBC,KAAKtB,KAAKiB,gBAGjC,MAAMM,EAAQC,MAAMC,KAClBzB,KAAK0B,GAAGC,iBAAiB,8BAG3BJ,EAAMK,SAAQC,IACZA,EAAKC,QAAU,MACfD,EAAKE,MAAMC,QAAU,EAAE,IAIzBhC,KAAKuC,oBAAoB,EAyCnBv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A,OAAKS,MAAM,eACTT,EAAA,QAAMK,KAAK,eAAelF,KAAK6G,eAGlC7G,KAAKgN,kBACJhN,KAAK0B,GAAG0B,cAAc,gCACtByB,EAAA,OAAKoI,QAASjN,KAAKO,MAAO+E,MAAM,qBAC9BT,EAAA,QAAMK,KAAK,qBAAqBlF,KAAKgN,mB,CAU7C,MAAAE,GACE,OAAOlN,KAAKiC,QAAUjC,KAAK4E,oBAAsB5E,KAAKgH,iB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,h as t,a as e,g as n}from"./p-ab002252.js";import{c as r}from"./p-8a1a6e56.js";const i='nv-iconbutton.root{display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:500;font-family:"TT Norms Pro", sans-serif;transition:background-color 150ms ease-out;height:fit-content;width:fit-content}nv-iconbutton.size-xs{padding:var(--button-xs-icon-button-padding);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-iconbutton.size-sm{padding:var(--button-sm-icon-button-padding);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-iconbutton.size-md{padding:var(--button-md-icon-button-padding);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-iconbutton.size-lg{padding:var(--button-lg-icon-button-padding);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-iconbutton.emphasis-high{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-iconbutton.emphasis-high:hover{background:var(--components-button-high-background-hover);color:var(--components-button-high-text-hover)}nv-iconbutton.emphasis-high:focus,nv-iconbutton.emphasis-high:focus-within{outline:none}nv-iconbutton.emphasis-high:focus-visible,nv-iconbutton.emphasis-high:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-high:disabled{background:var(--components-button-high-background);color:var(--components-button-high-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-high nv-icon>svg{color:var(--components-button-high-icon)}nv-iconbutton.emphasis-medium{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-iconbutton.emphasis-medium:hover{background:var(--components-button-medium-background-hover);color:var(--components-button-medium-text-hover)}nv-iconbutton.emphasis-medium:focus,nv-iconbutton.emphasis-medium:focus-within{outline:none}nv-iconbutton.emphasis-medium:focus-visible,nv-iconbutton.emphasis-medium:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-medium:disabled{background:var(--components-button-medium-background);color:var(--components-button-medium-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-medium nv-icon>svg{color:var(--components-button-medium-icon)}nv-iconbutton.emphasis-low{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-iconbutton.emphasis-low:hover{background:var(--components-button-low-background-hover);color:var(--components-button-low-text-hover)}nv-iconbutton.emphasis-low:focus,nv-iconbutton.emphasis-low:focus-within{outline:none}nv-iconbutton.emphasis-low:focus-visible,nv-iconbutton.emphasis-low:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-low:disabled{background:var(--components-button-low-background);color:var(--components-button-low-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-low nv-icon>svg{color:var(--components-button-low-icon)}nv-iconbutton.emphasis-lower{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-iconbutton.emphasis-lower:hover{background:var(--components-button-lower-background-hover);color:var(--components-button-lower-text-hover)}nv-iconbutton.emphasis-lower:focus,nv-iconbutton.emphasis-lower:focus-within{outline:none}nv-iconbutton.emphasis-lower:focus-visible,nv-iconbutton.emphasis-lower:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-lower:disabled{background:var(--components-button-lower-background);color:var(--components-button-lower-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-lower nv-icon>svg{color:var(--components-button-lower-icon)}nv-iconbutton.loading [slot=leading-icon]{display:none}nv-iconbutton.shape-rounded{border-radius:var(--radius-rounded-full)}';const a=i;const s=class{constructor(t){o(this,t);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.size="md";this.emphasis="high";this.loading=false;this.disabled=false;this.active=false;this.type="button";this.shape="square";this.handleClick=o=>{var t,e,n,r;if(this.disabled){o.preventDefault();return}if(this.type==="submit"){(e=(t=this.internals)===null||t===void 0?void 0:t.form)===null||e===void 0?void 0:e.requestSubmit()}if(this.type==="reset"){(r=(n=this.internals)===null||n===void 0?void 0:n.form)===null||r===void 0?void 0:r.reset()}}}handleLoadingChange(o){this.loading=o;this.disabled=o}handleDisabledChange(o){if(this.loading){this.disabled=this.loading}else{this.disabled=o}}handleKeyDown(o){if(o.key==="Enter"||o.key===" "){o.preventDefault();this.el.click()}}handleTouchStart(o){if(o.touches.length>1)return;o.preventDefault();this.el.click()}componentWillLoad(){if(this.loading){this.disabled=this.loading}}render(){return t(e,{key:"d607268b6b446379c9a67a1cf0f42cb6115451a5",role:"button",type:this.type,tabindex:"0",disabled:this.disabled?true:undefined,class:r("root",`size-${this.size}`,`emphasis-${this.emphasis}`,this.loading&&"loading",`shape-${this.shape}`),onClick:this.handleClick},this.loading&&t("nv-loader",{key:"f9c224a0297f488e952052d61d801f03c1719287",size:this.size}),!this.loading&&t("nv-icon",{key:"e5b7ee1ef9ddd5b9769b7b508d00cfc58fb36419",name:this.name,size:this.size}),t("slot",{key:"22c0e6106cd508848d287a4ad5db0936e233784a"}))}static get formAssociated(){return true}get el(){return n(this)}static get watchers(){return{loading:["handleLoadingChange"],disabled:["handleDisabledChange"]}}};s.style=a;const l='@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}nv-loader{display:inline-block;position:relative;aspect-ratio:1/1;border-radius:9999px;color:inherit}nv-loader.size-xs{width:var(--loader-size-xs);height:var(--loader-size-xs)}nv-loader.size-xs::before,nv-loader.size-xs::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xs::before{content:" ";border:calc(var(--loader-size-xs) / 10) solid;opacity:0.3}nv-loader.size-xs::after{content:" ";border-top:calc(var(--loader-size-xs) / 10) solid transparent;border-left:calc(var(--loader-size-xs) / 10) solid transparent;border-right:calc(var(--loader-size-xs) / 10) solid transparent;border-bottom:calc(var(--loader-size-xs) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-sm{width:var(--loader-size-sm);height:var(--loader-size-sm)}nv-loader.size-sm::before,nv-loader.size-sm::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-sm::before{content:" ";border:calc(var(--loader-size-sm) / 10) solid;opacity:0.3}nv-loader.size-sm::after{content:" ";border-top:calc(var(--loader-size-sm) / 10) solid transparent;border-left:calc(var(--loader-size-sm) / 10) solid transparent;border-right:calc(var(--loader-size-sm) / 10) solid transparent;border-bottom:calc(var(--loader-size-sm) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-md{width:var(--loader-size-md);height:var(--loader-size-md)}nv-loader.size-md::before,nv-loader.size-md::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-md::before{content:" ";border:calc(var(--loader-size-md) / 10) solid;opacity:0.3}nv-loader.size-md::after{content:" ";border-top:calc(var(--loader-size-md) / 10) solid transparent;border-left:calc(var(--loader-size-md) / 10) solid transparent;border-right:calc(var(--loader-size-md) / 10) solid transparent;border-bottom:calc(var(--loader-size-md) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-lg{width:var(--loader-size-lg);height:var(--loader-size-lg)}nv-loader.size-lg::before,nv-loader.size-lg::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-lg::before{content:" ";border:calc(var(--loader-size-lg) / 10) solid;opacity:0.3}nv-loader.size-lg::after{content:" ";border-top:calc(var(--loader-size-lg) / 10) solid transparent;border-left:calc(var(--loader-size-lg) / 10) solid transparent;border-right:calc(var(--loader-size-lg) / 10) solid transparent;border-bottom:calc(var(--loader-size-lg) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-xl{width:var(--loader-size-xl);height:var(--loader-size-xl)}nv-loader.size-xl::before,nv-loader.size-xl::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xl::before{content:" ";border:calc(var(--loader-size-xl) / 10) solid;opacity:0.3}nv-loader.size-xl::after{content:" ";border-top:calc(var(--loader-size-xl) / 10) solid transparent;border-left:calc(var(--loader-size-xl) / 10) solid transparent;border-right:calc(var(--loader-size-xl) / 10) solid transparent;border-bottom:calc(var(--loader-size-xl) / 10) solid;animation:rotation 1s linear infinite}nv-loader.color-brand::before{border-color:var(--components-loader-brand-background);opacity:1}nv-loader.color-brand::after{border-bottom-color:var(--components-loader-brand-foreground)}nv-loader.color-white::before{border-color:var(--components-loader-white-background);opacity:1}nv-loader.color-white::after{border-bottom-color:var(--components-loader-white-foreground)}';const d=l;const c=class{constructor(t){o(this,t);this.size="md"}render(){return t(e,{key:"8150eaf06f3a49ba07e460ea9581148f294a3a95",class:r(this.size&&`size-${this.size}`,this.color&&`color-${this.color}`)})}};c.style=d;export{s as nv_iconbutton,c as nv_loader};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,h as t,a as e,g as n}from"./p-711a7778.js";import{c as r}from"./p-8a1a6e56.js";const i='nv-iconbutton.root{display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:500;font-family:"TT Norms Pro", sans-serif;transition:background-color 150ms ease-out;height:fit-content;width:fit-content}nv-iconbutton.size-xs{padding:var(--button-xs-icon-button-padding);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-iconbutton.size-sm{padding:var(--button-sm-icon-button-padding);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-iconbutton.size-md{padding:var(--button-md-icon-button-padding);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-iconbutton.size-lg{padding:var(--button-lg-icon-button-padding);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-iconbutton.emphasis-high{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-iconbutton.emphasis-high:hover{background:var(--components-button-high-background-hover);color:var(--components-button-high-text-hover)}nv-iconbutton.emphasis-high:focus,nv-iconbutton.emphasis-high:focus-within{outline:none}nv-iconbutton.emphasis-high:focus-visible,nv-iconbutton.emphasis-high:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-high:disabled{background:var(--components-button-high-background);color:var(--components-button-high-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-high nv-icon>svg{color:var(--components-button-high-icon)}nv-iconbutton.emphasis-medium{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-iconbutton.emphasis-medium:hover{background:var(--components-button-medium-background-hover);color:var(--components-button-medium-text-hover)}nv-iconbutton.emphasis-medium:focus,nv-iconbutton.emphasis-medium:focus-within{outline:none}nv-iconbutton.emphasis-medium:focus-visible,nv-iconbutton.emphasis-medium:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-medium:disabled{background:var(--components-button-medium-background);color:var(--components-button-medium-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-medium nv-icon>svg{color:var(--components-button-medium-icon)}nv-iconbutton.emphasis-low{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-iconbutton.emphasis-low:hover{background:var(--components-button-low-background-hover);color:var(--components-button-low-text-hover)}nv-iconbutton.emphasis-low:focus,nv-iconbutton.emphasis-low:focus-within{outline:none}nv-iconbutton.emphasis-low:focus-visible,nv-iconbutton.emphasis-low:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-low:disabled{background:var(--components-button-low-background);color:var(--components-button-low-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-low nv-icon>svg{color:var(--components-button-low-icon)}nv-iconbutton.emphasis-lower{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-iconbutton.emphasis-lower:hover{background:var(--components-button-lower-background-hover);color:var(--components-button-lower-text-hover)}nv-iconbutton.emphasis-lower:focus,nv-iconbutton.emphasis-lower:focus-within{outline:none}nv-iconbutton.emphasis-lower:focus-visible,nv-iconbutton.emphasis-lower:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-lower:disabled{background:var(--components-button-lower-background);color:var(--components-button-lower-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-lower nv-icon>svg{color:var(--components-button-lower-icon)}nv-iconbutton.loading [slot=leading-icon]{display:none}nv-iconbutton.shape-rounded{border-radius:var(--radius-rounded-full)}';const a=i;const s=class{constructor(t){o(this,t);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.size="md";this.emphasis="high";this.loading=false;this.disabled=false;this.active=false;this.type="button";this.shape="square";this.handleClick=o=>{var t,e,n,r;if(this.disabled){o.preventDefault();return}if(this.type==="submit"){(e=(t=this.internals)===null||t===void 0?void 0:t.form)===null||e===void 0?void 0:e.requestSubmit()}if(this.type==="reset"){(r=(n=this.internals)===null||n===void 0?void 0:n.form)===null||r===void 0?void 0:r.reset()}}}handleLoadingChange(o){this.loading=o;this.disabled=o}handleDisabledChange(o){if(this.loading){this.disabled=this.loading}else{this.disabled=o}}handleKeyDown(o){if(o.key==="Enter"||o.key===" "){o.preventDefault();this.el.click()}}handleTouchStart(o){if(o.touches.length>1)return;o.preventDefault();this.el.click()}componentWillLoad(){if(this.loading){this.disabled=this.loading}}render(){return t(e,{key:"eb27cfea5e30fa97e9950d76f3038dc9ff4f4116",role:"button",type:this.type,tabindex:"0",disabled:this.disabled?true:undefined,class:r("root",`size-${this.size}`,`emphasis-${this.emphasis}`,this.loading&&"loading",`shape-${this.shape}`),onClick:this.handleClick},this.loading&&t("nv-loader",{key:"6f24a71b7ecab3168567a76b67f0b226f3afa9c3",size:this.size}),!this.loading&&t("nv-icon",{key:"f4a0eb19d8bc08a0c8dbc8cedca249bf417eeb1b",name:this.name,size:this.size}),t("slot",{key:"2994118659b1ad184a42ea4b20ea754427dae279"}))}static get formAssociated(){return true}get el(){return n(this)}static get watchers(){return{loading:["handleLoadingChange"],disabled:["handleDisabledChange"]}}};s.style=a;const l='@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}nv-loader{display:inline-block;position:relative;aspect-ratio:1/1;border-radius:9999px;color:inherit}nv-loader.size-xs{width:var(--loader-size-xs);height:var(--loader-size-xs)}nv-loader.size-xs::before,nv-loader.size-xs::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xs::before{content:" ";border:calc(var(--loader-size-xs) / 10) solid;opacity:0.3}nv-loader.size-xs::after{content:" ";border-top:calc(var(--loader-size-xs) / 10) solid transparent;border-left:calc(var(--loader-size-xs) / 10) solid transparent;border-right:calc(var(--loader-size-xs) / 10) solid transparent;border-bottom:calc(var(--loader-size-xs) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-sm{width:var(--loader-size-sm);height:var(--loader-size-sm)}nv-loader.size-sm::before,nv-loader.size-sm::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-sm::before{content:" ";border:calc(var(--loader-size-sm) / 10) solid;opacity:0.3}nv-loader.size-sm::after{content:" ";border-top:calc(var(--loader-size-sm) / 10) solid transparent;border-left:calc(var(--loader-size-sm) / 10) solid transparent;border-right:calc(var(--loader-size-sm) / 10) solid transparent;border-bottom:calc(var(--loader-size-sm) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-md{width:var(--loader-size-md);height:var(--loader-size-md)}nv-loader.size-md::before,nv-loader.size-md::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-md::before{content:" ";border:calc(var(--loader-size-md) / 10) solid;opacity:0.3}nv-loader.size-md::after{content:" ";border-top:calc(var(--loader-size-md) / 10) solid transparent;border-left:calc(var(--loader-size-md) / 10) solid transparent;border-right:calc(var(--loader-size-md) / 10) solid transparent;border-bottom:calc(var(--loader-size-md) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-lg{width:var(--loader-size-lg);height:var(--loader-size-lg)}nv-loader.size-lg::before,nv-loader.size-lg::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-lg::before{content:" ";border:calc(var(--loader-size-lg) / 10) solid;opacity:0.3}nv-loader.size-lg::after{content:" ";border-top:calc(var(--loader-size-lg) / 10) solid transparent;border-left:calc(var(--loader-size-lg) / 10) solid transparent;border-right:calc(var(--loader-size-lg) / 10) solid transparent;border-bottom:calc(var(--loader-size-lg) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-xl{width:var(--loader-size-xl);height:var(--loader-size-xl)}nv-loader.size-xl::before,nv-loader.size-xl::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xl::before{content:" ";border:calc(var(--loader-size-xl) / 10) solid;opacity:0.3}nv-loader.size-xl::after{content:" ";border-top:calc(var(--loader-size-xl) / 10) solid transparent;border-left:calc(var(--loader-size-xl) / 10) solid transparent;border-right:calc(var(--loader-size-xl) / 10) solid transparent;border-bottom:calc(var(--loader-size-xl) / 10) solid;animation:rotation 1s linear infinite}nv-loader.color-brand::before{border-color:var(--components-loader-brand-background);opacity:1}nv-loader.color-brand::after{border-bottom-color:var(--components-loader-brand-foreground)}nv-loader.color-white::before{border-color:var(--components-loader-white-background);opacity:1}nv-loader.color-white::after{border-bottom-color:var(--components-loader-white-foreground)}';const d=l;const c=class{constructor(t){o(this,t);this.size="md"}render(){return t(e,{key:"0048566e92b54cf51ef761b8cce814aab1f78707",class:r(this.size&&`size-${this.size}`,this.color&&`color-${this.color}`)})}};c.style=d;export{s as nv_iconbutton,c as nv_loader};
|
|
2
|
+
//# sourceMappingURL=p-9fba8663.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as r,h as o,a as d,g as i}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as r,h as o,a as d,g as i}from"./p-711a7778.js";import{c as a}from"./p-8a1a6e56.js";import{v as t}from"./p-f5ff676c.js";const n='nv-fieldradio{--nv-fieldradio-border-default:var(--components-form-field-border-default);--nv-fieldradio-border-hover:var(--components-form-field-border-hover);--nv-fieldradio-border-focus:var(--components-form-field-border-default);--nv-fieldradio-background-default:var(--components-form-field-background-default);--nv-fieldradio-background-checked:var(--components-form-field-background-checked);--nv-fieldradio-background-disabled:var(--components-form-field-background-disabled);--nv-fieldradio-focus-box-shadow:var(--color-focus-brand);--nv-fieldradio-dot-color-checked:var(--components-form-shape-foreground-default);--nv-fieldradio-dot-color-disabled:var(--components-form-shape-foreground-disabled);--nv-fieldradio-outline-color:var(--color-focus-brand);display:inline-flex;align-items:flex-start;gap:var(--form-gap-x)}nv-fieldradio:not([disabled]) input,nv-fieldradio:not([disabled]) label,nv-fieldradio[disabled=false] input,nv-fieldradio[disabled=false] label{cursor:pointer}nv-fieldradio.error{--nv-fieldradio-border-default:var(--components-form-field-border-error);--nv-fieldradio-border-hover:var(--nv-fieldradio-border-default);--nv-fieldradio-border-focus:var(--components-form-field-border-error);--nv-fieldradio-background-checked:var(--components-form-field-background-error);--nv-fieldradio-focus-box-shadow:var(--color-focus-destructive);--nv-fieldradio-dot-color-checked:var(--components-form-shape-foreground-default);--nv-fieldradio-dot-color-disabled:var(--components-form-field-border-error);--nv-fieldradio-outline-color:var(--color-focus-destructive)}nv-fieldradio.label-placement-before{flex-direction:row-reverse}nv-fieldradio[disabled]{opacity:0.5}nv-fieldradio label{align-self:stretch;color:var(--components-form-text-label-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--form-label-font-weight);line-height:var(--form-label-line-height)}nv-fieldradio input[type=radio]{appearance:none;position:relative;display:flex;width:var(--form-radio-size);height:var(--form-radio-size);padding:var(--form-radio-inner-circle-padding);flex-direction:column;align-items:flex-start;border-radius:var(--radius-rounded-full);border-width:var(--form-radio-border-width);border-style:solid;border-color:var(--nv-fieldradio-border-default);background:var(--nv-fieldradio-background-default)}nv-fieldradio input[type=radio]:hover{border-color:var(--nv-fieldradio-border-hover)}nv-fieldradio input[type=radio]:focus{border-color:var(--nv-fieldradio-border-focus)}nv-fieldradio input[type=radio]:focus,nv-fieldradio input[type=radio]:focus-within{outline:none}nv-fieldradio input[type=radio]:focus-visible,nv-fieldradio input[type=radio]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--nv-fieldradio-outline-color);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-fieldradio input[type=radio]:checked{background:var(--nv-fieldradio-background-checked);border-color:var(--nv-fieldradio-background-checked)}nv-fieldradio input[type=radio]:checked:hover,nv-fieldradio input[type=radio]:checked:focus{border-color:var(--nv-fieldradio-background-checked);background:var(--nv-fieldradio-background-checked)}nv-fieldradio input[type=radio]:checked::before{content:"";position:absolute;top:50%;right:50%;transform:translate(50%, -50%);left:0;width:var(--form-radio-inner-circle-size);height:var(--form-radio-inner-circle-size);flex-shrink:0;border-radius:var(--radius-rounded-full);background:var(--nv-fieldradio-dot-color-checked)}nv-fieldradio input[type=radio]:disabled{border-radius:var(--radius-rounded-full);border-width:var(--form-radio-border-width);border-style:solid;border-color:var(--nv-fieldradio-border-default);background:var(--nv-fieldradio-background-disabled)}nv-fieldradio input[type=radio]:disabled:checked::before{background:var(--nv-fieldradio-dot-color-disabled)}nv-fieldradio input[type=radio]:disabled:hover{border-color:var(--nv-fieldradio-border-default);background:var(--nv-fieldradio-background-disabled)}nv-fieldradio .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:var(--form-description-font-weight);line-height:var(--form-description-line-height)}nv-fieldradio .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:var(--form-description-font-weight);line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-fieldradio .text-container{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}';const l=n;const f=class{constructor(o){e(this,o);this.checkedChanged=r(this,"checkedChanged",7);this.labelBefore=false;this.inputId=t();this.error=false;this.checked=false;this.disabled=false;this.autofocus=false}componentWillRender(){if(this.message){this.description=this.message}if(this.labelBefore){this.labelPlacement="before"}}handleCheckedChange(e){this.checkedChanged.emit(e)}handleChange(e){const r=e.target;if((r===null||r===void 0?void 0:r.type)==="radio"){Array.from(document.getElementsByTagName("nv-fieldradio")).forEach((e=>{if(e.name===this.name){e.checked=false}}));this.checked=r.checked}}render(){return o(d,{key:"544fc138c91a08a1359ec0d30e89a9bda07eae94",class:a(this.labelPlacement==="before"&&"label-placement-before",this.error&&"error")},o("input",{key:"479908232ade17970c3310f3fec173a86ccea67d",type:"radio",id:this.inputId,name:this.name,autofocus:this.autofocus,autocomplete:"off",value:this.value,checked:this.checked,disabled:this.disabled}),o("div",{key:"624094a1d3819f627bdd6f554ee07200ecd4d03f",class:"text-container"},(this.label||this.el.querySelector('[slot="label"]'))&&o("label",{key:"8df4721447e7de7d5c1c51880eb5b5a62041910d",htmlFor:this.inputId},o("slot",{key:"0e14392a7e6a87804d0975a38b6b011f519457ae",name:"label"},this.label)),(this.description||this.el.querySelector('[slot="description"]'))&&o("div",{key:"ad635756eb65ebaa6e939d6e1870d196d3bafe2c",class:"description"},o("slot",{key:"13f720591e43b8532dfc5367089c17dccd9c4e77",name:"description"},this.description)),(this.errorDescription||this.el.querySelector('[slot="error-description"]'))&&o("div",{key:"597cee5e36cd63c209b60b8a533b4c6de8d5ba0e",hidden:!this.error,class:"error-description"},o("slot",{key:"49e1f0deac817a5c49738110862a7b081672510f",name:"error-description"},this.errorDescription))))}static get formAssociated(){return true}get el(){return i(this)}static get watchers(){return{checked:["handleCheckedChange"]}}};f.style=l;export{f as nv_fieldradio};
|
|
2
|
+
//# sourceMappingURL=p-a2c0f1a7.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as r,a as i,g as o}from"./p-711a7778.js";import{v as s}from"./p-f5ff676c.js";const l='nv-fieldselect{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fieldselect[fluid]:not([fluid=false]){max-width:unset}nv-fieldselect[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldselect[display-value]:not([display-value=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldselect[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fieldselect[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldselect[required]:not([required=false]) label::after{content:"*";color:var(--components-form-text-required);font-weight:700}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>.select-icons{top:var(--form-field-padding-y);right:var(--form-field-padding-x)}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>select{height:100%;box-sizing:border-box}nv-fieldselect label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldselect .select-wrapper{display:flex;flex-wrap:wrap;align-items:stretch;align-self:stretch}nv-fieldselect .select-wrapper .select-container{position:relative;display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldselect .select-wrapper .select-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldselect .select-wrapper .select-container:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldselect .select-wrapper .select-container:has(select:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldselect .select-wrapper .select-container>.select-icons{position:absolute;right:0;top:0;pointer-events:none}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton{border:0px;border-radius:0px}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldselect .select-wrapper .select-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%}nv-fieldselect .select-wrapper .select-container input:focus{outline:none}nv-fieldselect .select-wrapper .select-container input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:"TT Norms Pro", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldselect .select-wrapper .select-container input:read-only{opacity:0.5;background-color:var(--components-form-field-background-readonly, rgba(0, 0, 0, 0.1));border-color:var(--nv-field-border-readonly)}nv-fieldselect .select-wrapper .select-container select{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);text-overflow:ellipsis;font-size:var(--form-field-font-size);font-style:normal;font-weight:500;height:var(--form-field-line-height);padding:var(--form-field-padding-y) var(--form-field-padding-x);box-sizing:content-box;-webkit-appearance:none;-moz-appearance:none;cursor:pointer}nv-fieldselect .select-wrapper .select-container select:focus{outline:none}nv-fieldselect .select-wrapper .select-container select::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:"TT Norms Pro", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldselect .select-wrapper .select-container select option{font-size:var(--form-field-font-size, 16px);font-style:normal;font-weight:500;line-height:var(--form-field-line-height, 24px)}nv-fieldselect .select-wrapper .select-container select.hidden{display:none}nv-fieldselect .select-wrapper .select-container nv-icon.readonly-icon{color:var(--nv-field-border-default)}nv-fieldselect .select-wrapper .select-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldselect .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldselect .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}';const n=l;const a=class{constructor(r){e(this,r);this.valueChanged=t(this,"valueChanged",7);this.computedDisplayValue="";this.internalReadonly=false;this.parsedOptions=[];this.inputId=s();this.disabled=false;this.readonly=false;this.required=false;this.error=false;this.success=false;this.multiple=false;this.value="";this.displayValue=false;this.autofocus=false;this.fluid=false;this.handleSelectChange=e=>{const t=e.target;let r=Array.from(t.selectedOptions).map((e=>e.value));if(!this.multiple){r=r.slice(0,1)}this.value=this.multiple?r.join(", "):r[0]||"";this.valueChanged.emit(this.value);this.setFormValue()};this.handleSelectContainerClick=()=>{if(!this.internalReadonly&&this.selectElement){this.selectElement.focus()}}}updateDisplayValueWatcher(e){this.updateDisplayValue();if(this.selectElement){const t=e.split(",").map((e=>e.trim()));const r=this.selectElement.options;if(r){Array.from(r).forEach((e=>{e.selected=this.multiple?t.includes(e.value):e.value===t[0]}));if(!this.multiple){this.selectElement.value=e}}else{this.selectElement.value=t[0]||""}}this.setFormValue()}handleDisplayValueChange(e){this.internalReadonly=e;if(this.readonly){this.internalReadonly=true}}handleReadonlyChange(e){this.internalReadonly=e;if(this.displayValue){this.internalReadonly=true}}handleOptionsChange(e){if(typeof e==="string"){try{const t=JSON.parse(e);this.parsedOptions=[...t];const r=t.find((e=>e.selected));if(r){this.value=r.value}}catch(e){console.error("Error parsing options:",e);this.parsedOptions=[]}}}updateDisplayValue(){if(this.internalReadonly&&!this.displayValue){if(this.multiple){const e=this.value.split(",").map((e=>e.trim())).map((e=>this.getLabelFromId(e)||"")).filter((e=>e!==""));this.computedDisplayValue=e.join(", ")||""}else{this.computedDisplayValue=this.getLabelFromId(this.value)||""}}else if(this.internalReadonly&&this.displayValue){this.computedDisplayValue=this.value||""}}getLabelFromId(e){this.ensureSelectElement();if(!this.selectElement){return""}const t=this.selectElement.options;if(t){const r=Array.from(t).find((t=>t.value===e));return r?r.textContent.trim()||"":""}else{return""}}setFormValue(){this.internals.setFormValue(this.value)}ensureSelectElement(){if(!this.selectElement){this.selectElement=this.el.querySelector("select")}}componentWillRender(){this.updateDisplayValue();if(this.message){this.description=this.message}if(this.validation){this.errorDescription=this.validation;this.error=true}}componentWillLoad(){this.internalReadonly=this.readonly;if(this.displayValue){this.internalReadonly=true}if("attachInternals"in this.el){this.internals=this.el.attachInternals()}else{this.internals={setFormValue:e=>{const t=this.el.closest("form");if(t){const r=document.createElement("input");r.type="hidden";r.name=this.name;r.value=e;t.appendChild(r)}}}}if(this.multiple&&typeof this.value!=="string"){this.value=""}if(this.options){this.handleOptionsChange(this.options)}}componentDidLoad(){this.updateDisplayValue();if(this.selectElement){if(!this.multiple){this.selectElement.value=this.value}const e=this.multiple?this.value.split(",").map((e=>e.trim())):[this.value];const t=this.selectElement.options;if(t){Array.from(t).forEach((t=>{t.selected=this.multiple?e.includes(t.value):t.value===e[0]}))}else{this.selectElement.value=e[0]||""}}this.setFormValue()}render(){return r(i,{key:"06d38dd360011d4310d1c63851dc254e8ae47411"},(this.label||this.el.querySelector('[slot="label"]'))&&r("label",{key:"a0e46209c73e704d8d0f630baace2b1ce0eaed9c",htmlFor:this.inputId},r("slot",{key:"6a43c979383647415044931d7a4e4d3a24f65921",name:"label"},this.label)),r("div",{key:"f2cee6021f85e64bd9d73d984e208903e3fda4c7",class:"select-wrapper"},r("slot",{key:"cae1c527e55c18f3e54d9c73390d6f17ccebce77",name:"before-input"}),r("div",{key:"acb5dcbea269eb7dca558942f36b05c552924cbc",class:"select-container",onClick:this.handleSelectContainerClick},r("slot",{key:"e5c2a508a1297796f2693c76338c5b5f8e3e149e",name:"leading-input"}),this.internalReadonly&&r("input",{key:"28c38079050912f7d3b744de66ed48351dd890c3",id:this.inputId+"-readonly",type:"text",value:this.computedDisplayValue,readonly:true,class:"readonly-input","aria-readonly":"true","aria-label":this.label,"aria-describedby":this.error?`${this.inputId}-error`:`${this.inputId}-description`}),r("select",{key:"c409a9e0a26797981640092eb67b949c7d8f0cff",id:this.inputId,ref:e=>this.selectElement=e,name:this.name,autofocus:this.autofocus,disabled:this.disabled,required:this.required,multiple:this.multiple,onChange:this.handleSelectChange,class:this.internalReadonly?"hidden":"","aria-label":this.label,"aria-describedby":this.error?`${this.inputId}-error`:`${this.inputId}-description`},this.parsedOptions.length>0?this.parsedOptions.map((e=>r("option",{value:e.value,selected:e.selected,disabled:e.disabled},e.label))):r("slot",null)),r("div",{key:"a2402ea8d832e5612510dce7a3f50148b4edf39f",class:"select-icons"},this.error&&r("nv-icon",{key:"e291bff25fa6f06d3b27c3aaa805b46f674e1614",name:"alert-circle",class:"validation",size:"md"}),this.success&&r("nv-icon",{key:"ce98cb12347722926677d9c3fc6f02e35a9c84e4",name:"circle-check",class:"validation",size:"md"}),!this.multiple&&r("nv-iconbutton",{key:"e7fe760a5fa84ab0548ebd736a44da04908a4c07",name:"chevron-down",size:"md",emphasis:"lower",tabindex:-1}))),r("slot",{key:"d6253e2d56d4095bbe9ab12ca34ff28e06bd6b6d",name:"after-input"})),(this.description||this.el.querySelector('[slot="description"]'))&&r("div",{key:"703ad3ad8538ceab3c9eb03ae90c3552e1b6bf23",class:"description",id:`${this.inputId}-description`},r("slot",{key:"010bbb23d2b947ed55c219ac64532f7dfd4f43cc",name:"description"},this.description)),(this.errorDescription||this.el.querySelector('[slot="error-description"]'))&&r("div",{key:"70b696ec8f8badd4e064506eeba268755c9f2c09",class:"error-description",id:`${this.inputId}-error`},r("slot",{key:"2ec5af60d2fca9a8f5baf59406a4661905aeab05",name:"error-description"},this.errorDescription)))}static get formAssociated(){return true}get el(){return o(this)}static get watchers(){return{value:["updateDisplayValueWatcher"],displayValue:["handleDisplayValueChange"],readonly:["handleReadonlyChange"],options:["handleOptionsChange"]}}};a.style=n;export{a as nv_fieldselect};
|
|
2
|
+
//# sourceMappingURL=p-aa86af25.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["nvFieldselectCss","NvFieldselectStyle0","NvFieldselect","constructor","hostRef","this","computedDisplayValue","internalReadonly","parsedOptions","inputId","uuidv4","disabled","readonly","required","error","success","multiple","value","displayValue","autofocus","fluid","handleSelectChange","event","select","target","selectedValues","Array","from","selectedOptions","map","option","slice","join","valueChanged","emit","setFormValue","handleSelectContainerClick","selectElement","focus","updateDisplayValueWatcher","newValue","updateDisplayValue","split","val","trim","options","forEach","selected","includes","handleDisplayValueChange","handleReadonlyChange","handleOptionsChange","parsedOpts","JSON","parse","selectedOption","find","opt","console","selectedLabels","key","getLabelFromId","filter","label","ensureSelectElement","textContent","internals","el","querySelector","componentWillRender","message","description","validation","errorDescription","componentWillLoad","attachInternals","formElement","closest","input","document","createElement","type","name","appendChild","componentDidLoad","v","render","h","Host","htmlFor","class","onClick","id","ref","onChange","length","size","emphasis","tabindex"],"sources":["src/components/nv-fieldselect/nv-fieldselect.scss?tag=nv-fieldselect","src/components/nv-fieldselect/nv-fieldselect.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\n@mixin form-field-select-wrapper() {\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-select-container() {\n position: relative;\n display: flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n\n &:has(select:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-select() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n height: var(--form-field-line-height);\n padding: var(--form-field-padding-y) var(--form-field-padding-x);\n box-sizing: content-box;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: 'TT Norms Pro', sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\n@mixin form-field-multi-select() {\n height: 100%;\n box-sizing: border-box;\n}\n\n@mixin form-field-select-icons() {\n position: absolute;\n right: 0;\n top: 0;\n pointer-events: none;\n}\n\nnv-fieldselect {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid=\"false\"]) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[display-value]:not([display-value='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success='false']) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n &[multiple]:not([multiple='false']) {\n .select-wrapper > .select-container {\n > .select-icons {\n top: var(--form-field-padding-y);\n right: var(--form-field-padding-x);\n }\n > select {\n @include form-field-multi-select();\n }\n }\n }\n\n label {\n @include form-field-label();\n }\n\n .select-wrapper {\n @include form-field-select-wrapper();\n\n .select-container {\n @include form-field-select-container();\n\n > .select-icons {\n @include form-field-select-icons();\n > nv-iconbutton {\n @include form-field-action();\n }\n }\n\n input {\n @include form-field-input();\n\n &:read-only {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(\n --components-form-field-background-readonly,\n rgb(0 0 0 / 10%)\n );\n border-color: var(--nv-field-border-readonly);\n }\n }\n\n select {\n @include form-field-select();\n\n & option {\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n }\n\n &.hidden {\n display: none;\n }\n }\n\n nv-icon.readonly-icon {\n @include form-field-icon();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Content to be placed inside the select element.\n * @slot leading-input - Content to be placed before the select input, within the select container.\n * @slot before-input - Content to be placed before the select input, outside the select container.\n * @slot after-input - Content to be placed after the select input, outside the select 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-fieldselect',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldselect.scss',\n})\nexport class NvFieldselect {\n @Element() el: HTMLNvFieldselectElement;\n private selectElement!: HTMLSelectElement;\n private internals: ElementInternals;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Select Field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated Use `errorDescription` and set the error prop instead.\n */\n @Prop({ reflect: true })\n readonly validation: string;\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region STATES\n\n @State()\n private computedDisplayValue: string = '';\n\n @State()\n private internalReadonly: boolean = false;\n\n /**\n * Options to display in the select. Can be passed as a JSON string.\n * Format: [{ label: string, value: string, selected?: boolean, disabled?: boolean }]\n */\n @Prop({ reflect: true })\n readonly options?: string;\n\n /**\n * Parsed options stored internally\n */\n @State()\n private parsedOptions: Array<{\n /**\n * The label of the option\n */\n label: string;\n /**\n * The value of the option\n */\n value: string;\n /**\n * Whether the option is selected\n */\n selected?: boolean;\n /**\n * Whether the option is disabled\n */\n disabled?: boolean;\n }> = [];\n\n //#endregion STATES\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the select 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 choose in the\n * select 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 select field. This is\n * where you can clarify what users should choose or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description?: string;\n\n /**\n * Defines the name attribute of the select 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 selected 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 * The disabled prop lets you turn off the select field so that users can’t\n * choose something. 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 * Display the select 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 change or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the select 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 select field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the select field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the select field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * When enabled, allows the select to handle multiple selections.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * The value of the select field.\n * - If `multiple` is `false`, it's a single string.\n * - If `multiple` is `true`, it's a comma-separated string of selected values.\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * When enabled, displays the value element instead of the label when readonly.\n * By default, the label is displayed in readonly mode. Also it automatically\n * sets the component to readonly.\n */\n @Prop({ reflect: true })\n readonly displayValue: boolean = false;\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 a <select>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the selected value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>; // Emit as a string\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Updates the display value when the value property changes. This watcher is\n * used to update the display value when the selected value changes. This is\n * necessary for readonly select fields to display the selected value.\n * @internal This watcher is not intended to be called outside of the component.\n * @param {string} newValue - The new value of the select field.\n */\n @Watch('value')\n updateDisplayValueWatcher(newValue: string) {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n const selectedValues = newValue.split(',').map(val => val.trim());\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n\n if (!this.multiple) {\n this.selectElement.value = newValue; // Only set when not multiple\n }\n } else {\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Update form value\n this.setFormValue();\n }\n\n /**\n * Watcher for the displayValue prop to ensure internalReadonly is true when displayValue is true.\n * @param {boolean} newValue - The new value of displayValue.\n */\n @Watch('displayValue')\n handleDisplayValueChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.readonly) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Watcher for the readonly prop to ensure internalReadonly is true when readonly is true.\n * @param {boolean} newValue - The new value of readonly.\n */\n @Watch('readonly')\n handleReadonlyChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Parse options and update the internal state\n * @param {string} newValue - The new value of options\n */\n @Watch('options')\n handleOptionsChange(newValue: string) {\n if (typeof newValue === 'string') {\n try {\n const parsedOpts = JSON.parse(newValue);\n this.parsedOptions = [...parsedOpts];\n\n // Update the value if an option is pre-selected\n const selectedOption = parsedOpts.find(opt => opt.selected);\n if (selectedOption) {\n this.value = selectedOption.value;\n }\n } catch (error) {\n console.error('Error parsing options:', error);\n this.parsedOptions = [];\n }\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the change event on the select element. This method is used to\n * update the value property when the selected options change. It is also\n * used to emit the selectChanged event when the selected value changes.\n * @param {Event} event - The change event on the select element.\n * @emits selectChanged\n */\n private readonly handleSelectChange = (event: Event) => {\n const select = event.target as HTMLSelectElement;\n let selectedValues: string[] = Array.from(select.selectedOptions).map(\n option => option.value,\n );\n\n if (!this.multiple) {\n selectedValues = selectedValues.slice(0, 1);\n }\n\n this.value = this.multiple\n ? selectedValues.join(', ')\n : selectedValues[0] || '';\n this.valueChanged.emit(this.value);\n\n // Update form value\n this.setFormValue();\n };\n\n /**\n * Handles focus when the select container is clicked.\n */\n private readonly handleSelectContainerClick = () => {\n if (!this.internalReadonly && this.selectElement) {\n this.selectElement.focus();\n }\n };\n\n /**\n * Updates the display value of the select field. This method is used to\n * update the display value when the selected value changes. This is necessary\n * for readonly select fields to display the selected value. This method is\n * called in the componentDidLoad lifecycle hook and the updateDisplayValueWatcher\n * watcher.\n * @internal This method is not intended to be called outside of the component.\n */\n private updateDisplayValue(): void {\n if (this.internalReadonly && !this.displayValue) {\n if (this.multiple) {\n const selectedLabels = this.value\n .split(',')\n .map(key => key.trim())\n .map(key => this.getLabelFromId(key) || '')\n .filter(label => label !== '');\n this.computedDisplayValue = selectedLabels.join(', ') || '';\n } else {\n this.computedDisplayValue = this.getLabelFromId(this.value) || '';\n }\n } else if (this.internalReadonly && this.displayValue) {\n this.computedDisplayValue = this.value || '';\n }\n }\n\n /**\n * Retrieves the label from the <option> elements based on the provided key (value).\n * This method uses the id or value attribute directly from the <select> options.\n * @param {string} key - The key (value) for which to find the corresponding label.\n * @returns {string} The label if found; otherwise, an empty string.\n */\n private getLabelFromId(key: string): string {\n this.ensureSelectElement();\n if (!this.selectElement) {\n return '';\n }\n\n // Cache the option list\n const options = this.selectElement.options;\n\n if (options) {\n const option = Array.from(options).find(option => option.value === key);\n return option ? option.textContent.trim() || '' : '';\n } else {\n return '';\n }\n }\n\n /**\n * Sets the value of the form element for form submission. This method is\n * called when the selected value changes or when the value property is set.\n * @internal This method is not intended to be called outside of the component.\n */\n private setFormValue(): void {\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Ensures the select element is available. This method is used to ensure\n * the select element is available before attempting to access it.\n * @internal This method is not intended to be called outside of the component.\n */\n private ensureSelectElement(): void {\n if (!this.selectElement) {\n this.selectElement = this.el.querySelector('select') as HTMLSelectElement;\n }\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillRender() {\n this.updateDisplayValue(); // Ensure display value is updated before render\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n /**\n * Lifecycle method that is called before the component is rendered. This is\n * where the internal state is set up before rendering occurs.\n */\n componentWillLoad() {\n // Set internalReadonly based on the readonly prop\n this.internalReadonly = this.readonly;\n\n // Ensure internalReadonly is true if displayValue is true during loading\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n\n if ('attachInternals' in this.el) {\n this.internals = (\n this.el as HTMLElement & {\n /**\n * Attach the element to the form internals.\n * @returns {ElementInternals} - The element internals object.\n */\n attachInternals: () => ElementInternals;\n }\n ).attachInternals();\n } else {\n // Fallback logic for browsers without attachInternals support\n this.internals = {\n setFormValue: (value: string) => {\n const formElement = this.el.closest('form');\n if (formElement) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = this.name;\n input.value = value;\n formElement.appendChild(input);\n }\n },\n } as ElementInternals;\n }\n\n // Initialize value as an empty string if multiple is true\n if (this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n\n // Parse initial options if present\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n /**\n * Lifecycle method that is called after the component has been rendered.\n * This is where the display value is updated and the initial select element's\n * state is set.\n */\n componentDidLoad() {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n // Only set the value for single selection, skip for multiple\n if (!this.multiple) {\n this.selectElement.value = this.value;\n }\n\n const selectedValues = this.multiple\n ? this.value.split(',').map(v => v.trim())\n : [this.value];\n\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n } else {\n // Handle case where there are no options\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Set the initial form value\n this.setFormValue();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDERING\n\n /**\n * The render method creates the HTML structure for the component, including\n * the label, select element, and any error or description messages. It also\n * applies the appropriate CSS classes based on the readonly state and\n * displayValue prop. This method is called when the component is rendered.\n * @returns {HTMLStencilElement} The HTML element to 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 <div class=\"select-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"select-container\"\n onClick={this.handleSelectContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.internalReadonly && (\n <input\n id={this.inputId + '-readonly'}\n type=\"text\"\n value={this.computedDisplayValue}\n readonly\n class=\"readonly-input\"\n aria-readonly=\"true\"\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n />\n )}\n\n <select\n id={this.inputId}\n ref={el => (this.selectElement = el)}\n name={this.name}\n autofocus={this.autofocus}\n disabled={this.disabled}\n required={this.required}\n multiple={this.multiple}\n onChange={this.handleSelectChange}\n class={this.internalReadonly ? 'hidden' : ''}\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n >\n {this.parsedOptions.length > 0 ? (\n this.parsedOptions.map(option => (\n <option\n value={option.value}\n selected={option.selected}\n disabled={option.disabled}\n >\n {option.label}\n </option>\n ))\n ) : (\n <slot />\n )}\n </select>\n <div class=\"select-icons\">\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n {!this.multiple && (\n <nv-iconbutton\n name=\"chevron-down\"\n size=\"md\"\n emphasis=\"lower\"\n tabindex={-1}\n />\n )}\n </div>\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\" id={`${this.inputId}-description`}>\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div class=\"error-description\" id={`${this.inputId}-error`}>\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDERING\n}\n"],"mappings":"oGAAA,MAAMA,EAAmB,gkOACzB,MAAAC,EAAeD,E,MC2BFE,EAAa,MAN1B,WAAAC,CAAAC,G,qDAiCUC,KAAAC,qBAA+B,GAG/BD,KAAAE,iBAA4B,MAa5BF,KAAAG,cAiBH,GAaIH,KAAAI,QAAkBC,IAiClBL,KAAAM,SAAoB,MAQpBN,KAAAO,SAAoB,MAOpBP,KAAAQ,SAAoB,MAQ7BR,KAAAS,MAAiB,MAgBRT,KAAAU,QAAmB,MAMnBV,KAAAW,SAAoB,MAQ7BX,KAAAY,MAAgB,GAQPZ,KAAAa,aAAwB,MAS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wE,EAAA,WAAA3B,IAAA,2CAASsB,KAAK,eAAeQ,MAAM,aAAaM,KAAK,QAGrD3F,KAAKW,UACLuE,EAAA,iBAAA3B,IAAA,2CACEsB,KAAK,eACLc,KAAK,KACLC,SAAS,QACTC,UAAW,MAMnBX,EAAA,QAAA3B,IAAA,2CAAMsB,KAAK,kBAGX7E,KAAKkE,aACLlE,KAAK8D,GAAGC,cAAc,0BACtBmB,EAAA,OAAA3B,IAAA,2CAAK8B,MAAM,cAAcE,GAAI,GAAGvF,KAAKI,uBACnC8E,EAAA,QAAA3B,IAAA,2CAAMsB,KAAK,eAAe7E,KAAKkE,eAIjClE,KAAKoE,kBACLpE,KAAK8D,GAAGC,cAAc,gCACtBmB,EAAA,OAAA3B,IAAA,2CAAK8B,MAAM,oBAAoBE,GAAI,GAAGvF,KAAKI,iBACzC8E,EAAA,QAAA3B,IAAA,2CAAMsB,KAAK,qBAAqB7E,KAAKoE,mB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["nvFieldselectCss","NvFieldselectStyle0","NvFieldselect","constructor","hostRef","this","computedDisplayValue","internalReadonly","parsedOptions","inputId","uuidv4","disabled","readonly","required","error","success","multiple","value","displayValue","autofocus","fluid","handleSelectChange","event","select","target","selectedValues","Array","from","selectedOptions","map","option","slice","join","valueChanged","emit","setFormValue","handleSelectContainerClick","selectElement","focus","updateDisplayValueWatcher","newValue","updateDisplayValue","split","val","trim","options","forEach","selected","includes","handleDisplayValueChange","handleReadonlyChange","handleOptionsChange","parsedOpts","JSON","parse","selectedOption","find","opt","console","selectedLabels","key","getLabelFromId","filter","label","ensureSelectElement","textContent","internals","el","querySelector","componentWillRender","message","description","validation","errorDescription","componentWillLoad","attachInternals","formElement","closest","input","document","createElement","type","name","appendChild","componentDidLoad","v","render","h","Host","htmlFor","class","onClick","id","ref","onChange","length","size","emphasis","tabindex"],"sources":["src/components/nv-fieldselect/nv-fieldselect.scss?tag=nv-fieldselect","src/components/nv-fieldselect/nv-fieldselect.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\n@mixin form-field-select-wrapper() {\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-select-container() {\n position: relative;\n display: flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n\n &:has(select:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-select() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n height: var(--form-field-line-height);\n padding: var(--form-field-padding-y) var(--form-field-padding-x);\n box-sizing: content-box;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: 'TT Norms Pro', sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\n@mixin form-field-multi-select() {\n height: 100%;\n box-sizing: border-box;\n}\n\n@mixin form-field-select-icons() {\n position: absolute;\n right: 0;\n top: 0;\n pointer-events: none;\n}\n\nnv-fieldselect {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid=\"false\"]) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[display-value]:not([display-value='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success='false']) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n &[multiple]:not([multiple='false']) {\n .select-wrapper > .select-container {\n > .select-icons {\n top: var(--form-field-padding-y);\n right: var(--form-field-padding-x);\n }\n > select {\n @include form-field-multi-select();\n }\n }\n }\n\n label {\n @include form-field-label();\n }\n\n .select-wrapper {\n @include form-field-select-wrapper();\n\n .select-container {\n @include form-field-select-container();\n\n > .select-icons {\n @include form-field-select-icons();\n > nv-iconbutton {\n @include form-field-action();\n }\n }\n\n input {\n @include form-field-input();\n\n &:read-only {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(\n --components-form-field-background-readonly,\n rgb(0 0 0 / 10%)\n );\n border-color: var(--nv-field-border-readonly);\n }\n }\n\n select {\n @include form-field-select();\n\n & option {\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n }\n\n &.hidden {\n display: none;\n }\n }\n\n nv-icon.readonly-icon {\n @include form-field-icon();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Content to be placed inside the select element.\n * @slot leading-input - Content to be placed before the select input, within the select container.\n * @slot before-input - Content to be placed before the select input, outside the select container.\n * @slot after-input - Content to be placed after the select input, outside the select 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-fieldselect',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldselect.scss',\n})\nexport class NvFieldselect {\n @Element() el: HTMLNvFieldselectElement;\n private selectElement!: HTMLSelectElement;\n private internals: ElementInternals;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Select Field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated Use `errorDescription` and set the error prop instead.\n */\n @Prop({ reflect: true })\n readonly validation: string;\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region STATES\n\n @State()\n private computedDisplayValue: string = '';\n\n @State()\n private internalReadonly: boolean = false;\n\n /**\n * Options to display in the select. Can be passed as a JSON string.\n * Format: [{ label: string, value: string, selected?: boolean, disabled?: boolean }]\n */\n @Prop({ reflect: true })\n readonly options?: string;\n\n /**\n * Parsed options stored internally\n */\n @State()\n private parsedOptions: Array<{\n /**\n * The label of the option\n */\n label: string;\n /**\n * The value of the option\n */\n value: string;\n /**\n * Whether the option is selected\n */\n selected?: boolean;\n /**\n * Whether the option is disabled\n */\n disabled?: boolean;\n }> = [];\n\n //#endregion STATES\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the select 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 choose in the\n * select 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 select field. This is\n * where you can clarify what users should choose or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description?: string;\n\n /**\n * Defines the name attribute of the select 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 selected 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 * The disabled prop lets you turn off the select field so that users can’t\n * choose something. 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 * Display the select 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 change or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the select 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 select field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the select field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the select field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * When enabled, allows the select to handle multiple selections.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * The value of the select field.\n * - If `multiple` is `false`, it's a single string.\n * - If `multiple` is `true`, it's a comma-separated string of selected values.\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * When enabled, displays the value element instead of the label when readonly.\n * By default, the label is displayed in readonly mode. Also it automatically\n * sets the component to readonly.\n */\n @Prop({ reflect: true })\n readonly displayValue: boolean = false;\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 a <select>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the selected value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>; // Emit as a string\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Updates the display value when the value property changes. This watcher is\n * used to update the display value when the selected value changes. This is\n * necessary for readonly select fields to display the selected value.\n * @internal This watcher is not intended to be called outside of the component.\n * @param {string} newValue - The new value of the select field.\n */\n @Watch('value')\n updateDisplayValueWatcher(newValue: string) {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n const selectedValues = newValue.split(',').map(val => val.trim());\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n\n if (!this.multiple) {\n this.selectElement.value = newValue; // Only set when not multiple\n }\n } else {\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Update form value\n this.setFormValue();\n }\n\n /**\n * Watcher for the displayValue prop to ensure internalReadonly is true when displayValue is true.\n * @param {boolean} newValue - The new value of displayValue.\n */\n @Watch('displayValue')\n handleDisplayValueChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.readonly) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Watcher for the readonly prop to ensure internalReadonly is true when readonly is true.\n * @param {boolean} newValue - The new value of readonly.\n */\n @Watch('readonly')\n handleReadonlyChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Parse options and update the internal state\n * @param {string} newValue - The new value of options\n */\n @Watch('options')\n handleOptionsChange(newValue: string) {\n if (typeof newValue === 'string') {\n try {\n const parsedOpts = JSON.parse(newValue);\n this.parsedOptions = [...parsedOpts];\n\n // Update the value if an option is pre-selected\n const selectedOption = parsedOpts.find(opt => opt.selected);\n if (selectedOption) {\n this.value = selectedOption.value;\n }\n } catch (error) {\n console.error('Error parsing options:', error);\n this.parsedOptions = [];\n }\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the change event on the select element. This method is used to\n * update the value property when the selected options change. It is also\n * used to emit the selectChanged event when the selected value changes.\n * @param {Event} event - The change event on the select element.\n * @emits selectChanged\n */\n private readonly handleSelectChange = (event: Event) => {\n const select = event.target as HTMLSelectElement;\n let selectedValues: string[] = Array.from(select.selectedOptions).map(\n option => option.value,\n );\n\n if (!this.multiple) {\n selectedValues = selectedValues.slice(0, 1);\n }\n\n this.value = this.multiple\n ? selectedValues.join(', ')\n : selectedValues[0] || '';\n this.valueChanged.emit(this.value);\n\n // Update form value\n this.setFormValue();\n };\n\n /**\n * Handles focus when the select container is clicked.\n */\n private readonly handleSelectContainerClick = () => {\n if (!this.internalReadonly && this.selectElement) {\n this.selectElement.focus();\n }\n };\n\n /**\n * Updates the display value of the select field. This method is used to\n * update the display value when the selected value changes. This is necessary\n * for readonly select fields to display the selected value. This method is\n * called in the componentDidLoad lifecycle hook and the updateDisplayValueWatcher\n * watcher.\n * @internal This method is not intended to be called outside of the component.\n */\n private updateDisplayValue(): void {\n if (this.internalReadonly && !this.displayValue) {\n if (this.multiple) {\n const selectedLabels = this.value\n .split(',')\n .map(key => key.trim())\n .map(key => this.getLabelFromId(key) || '')\n .filter(label => label !== '');\n this.computedDisplayValue = selectedLabels.join(', ') || '';\n } else {\n this.computedDisplayValue = this.getLabelFromId(this.value) || '';\n }\n } else if (this.internalReadonly && this.displayValue) {\n this.computedDisplayValue = this.value || '';\n }\n }\n\n /**\n * Retrieves the label from the <option> elements based on the provided key (value).\n * This method uses the id or value attribute directly from the <select> options.\n * @param {string} key - The key (value) for which to find the corresponding label.\n * @returns {string} The label if found; otherwise, an empty string.\n */\n private getLabelFromId(key: string): string {\n this.ensureSelectElement();\n if (!this.selectElement) {\n return '';\n }\n\n // Cache the option list\n const options = this.selectElement.options;\n\n if (options) {\n const option = Array.from(options).find(option => option.value === key);\n return option ? option.textContent.trim() || '' : '';\n } else {\n return '';\n }\n }\n\n /**\n * Sets the value of the form element for form submission. This method is\n * called when the selected value changes or when the value property is set.\n * @internal This method is not intended to be called outside of the component.\n */\n private setFormValue(): void {\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Ensures the select element is available. This method is used to ensure\n * the select element is available before attempting to access it.\n * @internal This method is not intended to be called outside of the component.\n */\n private ensureSelectElement(): void {\n if (!this.selectElement) {\n this.selectElement = this.el.querySelector('select') as HTMLSelectElement;\n }\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillRender() {\n this.updateDisplayValue(); // Ensure display value is updated before render\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n /**\n * Lifecycle method that is called before the component is rendered. This is\n * where the internal state is set up before rendering occurs.\n */\n componentWillLoad() {\n // Set internalReadonly based on the readonly prop\n this.internalReadonly = this.readonly;\n\n // Ensure internalReadonly is true if displayValue is true during loading\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n\n if ('attachInternals' in this.el) {\n this.internals = (\n this.el as HTMLElement & {\n /**\n * Attach the element to the form internals.\n * @returns {ElementInternals} - The element internals object.\n */\n attachInternals: () => ElementInternals;\n }\n ).attachInternals();\n } else {\n // Fallback logic for browsers without attachInternals support\n this.internals = {\n setFormValue: (value: string) => {\n const formElement = this.el.closest('form');\n if (formElement) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = this.name;\n input.value = value;\n formElement.appendChild(input);\n }\n },\n } as ElementInternals;\n }\n\n // Initialize value as an empty string if multiple is true\n if (this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n\n // Parse initial options if present\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n /**\n * Lifecycle method that is called after the component has been rendered.\n * This is where the display value is updated and the initial select element's\n * state is set.\n */\n componentDidLoad() {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n // Only set the value for single selection, skip for multiple\n if (!this.multiple) {\n this.selectElement.value = this.value;\n }\n\n const selectedValues = this.multiple\n ? this.value.split(',').map(v => v.trim())\n : [this.value];\n\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n } else {\n // Handle case where there are no options\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Set the initial form value\n this.setFormValue();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDERING\n\n /**\n * The render method creates the HTML structure for the component, including\n * the label, select element, and any error or description messages. It also\n * applies the appropriate CSS classes based on the readonly state and\n * displayValue prop. This method is called when the component is rendered.\n * @returns {HTMLStencilElement} The HTML element to 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 <div class=\"select-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"select-container\"\n onClick={this.handleSelectContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.internalReadonly && (\n <input\n id={this.inputId + '-readonly'}\n type=\"text\"\n value={this.computedDisplayValue}\n readonly\n class=\"readonly-input\"\n aria-readonly=\"true\"\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n />\n )}\n\n <select\n id={this.inputId}\n ref={el => (this.selectElement = el)}\n name={this.name}\n autofocus={this.autofocus}\n disabled={this.disabled}\n required={this.required}\n multiple={this.multiple}\n onChange={this.handleSelectChange}\n class={this.internalReadonly ? 'hidden' : ''}\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n >\n {this.parsedOptions.length > 0 ? (\n this.parsedOptions.map(option => (\n <option\n value={option.value}\n selected={option.selected}\n disabled={option.disabled}\n >\n {option.label}\n </option>\n ))\n ) : (\n <slot />\n )}\n </select>\n <div class=\"select-icons\">\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n {!this.multiple && (\n <nv-iconbutton\n name=\"chevron-down\"\n size=\"md\"\n emphasis=\"lower\"\n tabindex={-1}\n />\n )}\n </div>\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\" id={`${this.inputId}-description`}>\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div class=\"error-description\" id={`${this.inputId}-error`}>\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDERING\n}\n"],"mappings":"oGAAA,MAAMA,EAAmB,mrOACzB,MAAAC,EAAeD,E,MC2BFE,EAAa,MAN1B,WAAAC,CAAAC,G,qDAiCUC,KAAAC,qBAA+B,GAG/BD,KAAAE,iBAA4B,MAa5BF,KAAAG,cAiBH,GAaIH,KAAAI,QAAkBC,IAiClBL,KAAAM,SAAoB,MAQpBN,KAAAO,SAAoB,MAOpBP,KAAAQ,SAAoB,MAQ7BR,KAAAS,MAAiB,MAgBRT,KAAAU,QAAmB,MAMnBV,KAAAW,SAAoB,MAQ7BX,KAAAY,MAAgB,GAQPZ,KAAAa,aAAwB,MASxBb,KAAAc,UAAqB,MAMrBd,KAAAe,MAAiB,MA+GTf,KAAAgB,mBAAsBC,IACrC,MAAMC,EAASD,EAAME,OACrB,IAAIC,EAA2BC,MAAMC,KAAKJ,EAAOK,iBAAiBC,KAChEC,GAAUA,EAAOb,QAGnB,IAAKZ,KAAKW,SAAU,CAClBS,EAAiBA,EAAeM,MAAM,EAAG,E,CAG3C1B,KAAKY,MAAQZ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BmB,EAAA,OAAA3B,IAAA,2CAAK8B,MAAM,cAAcE,GAAI,GAAGvF,KAAKI,uBACnC8E,EAAA,QAAA3B,IAAA,2CAAMsB,KAAK,eAAe7E,KAAKkE,eAIjClE,KAAKoE,kBACLpE,KAAK8D,GAAGC,cAAc,gCACtBmB,EAAA,OAAA3B,IAAA,2CAAK8B,MAAM,oBAAoBE,GAAI,GAAGvF,KAAKI,iBACzC8E,EAAA,QAAA3B,IAAA,2CAAMsB,KAAK,qBAAqB7E,KAAKoE,mB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as i,a as s,g as n}from"./p-711a7778.js";import{a as o}from"./p-a5c8eee9.js";import{T as r}from"./p-f85c08f1.js";import{v as l}from"./p-f5ff676c.js";const a='nv-fieldtime{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fieldtime[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldtime[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fieldtime[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldtime[required]:not([required=false]) label::after{content:"*";color:var(--components-form-text-required);font-weight:700}nv-fieldtime label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldtime nv-popover{width:100%;display:block}nv-fieldtime nv-popover [data-scope=popover]{padding:var(--list-dropdown-padding);background-color:var(--components-list-dropdown-background);border:1px solid var(--components-list-dropdown-border);width:100%}nv-fieldtime .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fieldtime .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default, 1);background:var(--nv-field-background);transition:all 150ms ease-out;display:flex;justify-content:flex-start;align-items:center;position:relative;width:100%;min-height:40px;gap:0;padding-left:var(--form-field-padding-x)}nv-fieldtime .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldtime .input-container:focus-within,nv-fieldtime .input-container:focus-within:hover,nv-fieldtime .input-container:focus,nv-fieldtime .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldtime .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldtime .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldtime .input-container input.time-input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%;width:100%;min-width:24px;flex:0 0 24px;text-align:center;padding:0;margin:0}nv-fieldtime .input-container input.time-input:focus{outline:none}nv-fieldtime .input-container input.time-input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:"TT Norms Pro", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldtime .input-container input.time-input::-webkit-inner-spin-button,nv-fieldtime .input-container input.time-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}nv-fieldtime .input-container span{width:100%;text-align:center;min-width:24px;flex:0 0 24px;padding:0 4px;color:var(--components-form-field-content-text)}nv-fieldtime .input-container>nv-iconbutton{border:0px;border-radius:0px;margin-left:auto}nv-fieldtime .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldtime .input-container nv-icon.validation{color:var(--nv-field-border-default);position:absolute;right:50px;top:50%;transform:translateY(-50%)}nv-fieldtime .input-container:focus,nv-fieldtime .input-container:focus-within{border-color:var(--color-focus-brand);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--color-focus-brand)}nv-fieldtime .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldtime .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:"TT Norms Pro", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-fieldtime hr{border:none;border-top:1px solid var(--dropdown-divider-color, #ccc);margin:0.5rem 0}nv-fieldtime .time-dropdown{width:100%}nv-fieldtime .time-dropdown .time-columns{display:flex;justify-content:flex-start;align-items:center}nv-fieldtime .time-dropdown .time-columns .time-column{flex:1;text-align:center;padding-right:2px;max-height:200px;overflow-y:auto;scroll-behavior:smooth;scrollbar-gutter:stable both-edges}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar{width:6px;height:6px}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar-track{background-color:var(--color-level-10-background);border-radius:9999px}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar-thumb{background-color:var(--color-gray-200);border-radius:9999px}nv-fieldtime .time-dropdown .time-columns .time-column:last-child{border-right:none}nv-fieldtime .time-dropdown .time-columns .time-column .time-option{padding:var(--list-dropdown-item-padding-y) var(--list-dropdown-item-padding-x);text-align:center;cursor:pointer;transition:background-color 0.2s;height:40px;border-radius:var(--list-dropdown-item-radius);display:flex;justify-content:center;align-items:center}nv-fieldtime .time-dropdown .time-columns .time-column .time-option:hover{background-color:var(--components-list-dropdown-item-background-hover);color:var(--components-list-dropdown-item-label-hover)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option:focus,nv-fieldtime .time-dropdown .time-columns .time-column .time-option:focus-within{background-color:var(--components-list-dropdown-item-background-hover);color:var(--components-list-dropdown-item-label-hover)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.selected{background-color:var(--components-list-dropdown-item-background-active);color:var(--components-list-dropdown-item-label-active);border-width:1px;border-style:solid;border-color:var(--components-list-dropdown-item-border-active)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.highlighted{background-color:var(--components-list-dropdown-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}';const d=a;const f=class{constructor(i){e(this,i);this.valueChanged=t(this,"valueChanged",7);this.inputElements={};this.inputZeroAdded={};this.typeFocused=r.Hours;this.hours="00";this.minutes="00";this.seconds="00";this.inputId=l();this.readonly=false;this.disabled=false;this.required=false;this.success=false;this.error=false;this.format="HH:mm:ss";this.open=false;this.step=6e4;this.autofocus=false}handleOpenChanged(e){e.stopPropagation();this.open=e.detail}handleKeyDown(e){var t,i,s,n;if(!this.open){if(e.key==="ArrowDown"){this.open=true;e.preventDefault();return}return}if(!this.popoverElement){console.warn("nv-fieldtime -> Popover element is not defined");return}const o=`.time-column.time-column-${this.typeFocused} div`;const l=Array.from(this.el.querySelectorAll(o));if(l.length===0){console.warn("nv-fieldtime -> No dropdown items found to navigate");return}let a=l.findIndex((e=>e.classList.contains("highlighted")));if(e.key==="ArrowDown"){e.preventDefault();a=(a+1)%l.length;this.updateHighlightedItem(l,a)}else if(e.key==="ArrowUp"){e.preventDefault();a=(a-1+l.length)%l.length;this.updateHighlightedItem(l,a)}else if(e.key==="Enter"&&a>=0){e.preventDefault();l[a].click();if(this.typeFocused===r.Hours){(t=this.inputElements[r.Minutes])===null||t===void 0?void 0:t.focus();(i=this.inputElements[r.Minutes])===null||i===void 0?void 0:i.select()}else if(this.typeFocused===r.Minutes||this.typeFocused===r.Seconds){(s=this.inputElements[r.Seconds])===null||s===void 0?void 0:s.focus();(n=this.inputElements[r.Seconds])===null||n===void 0?void 0:n.select()}}else if(e.key==="Escape"){e.preventDefault();if(this.inputElements[r.Hours]){this.inputElements[r.Hours].blur()}}}handleValueChange(e){this.valueChanged.emit(e)}handleInputChange(e,t){const i=e.target;const s=i.value.replace(/[^0-9]/g,"");switch(t){case r.Hours:this.handleHoursChange(s,t);break;case r.Minutes:this.handleMinutesChange(s,t);break;case r.Seconds:this.handleSecondsChange(s,t);break}const n=this.reconstructTime();this.value=n}handleHoursChange(e,t){var i,s,n,o;const l=this.format.startsWith("HH");const a=l?24:12;let d=false;const f=this.parseHour(this.max,this.format)||(this.format.startsWith("hh")?"12":"24");const h=this.parseHour(this.min,this.format)||"00";if(e.length===1){this.inputZeroAdded[t]=true;const i=e.padStart(2,"0");if(f&&parseInt(i,10)>parseInt(f,10)){if(h&&parseInt(i,10)<parseInt(h,10)){this.hours=h}else{this.hours="00";d=true}}else{if(h&&parseInt(i,10)<parseInt(h,10)){this.hours=h}else{this.hours=i}}}else if(this.inputZeroAdded[t]){this.inputZeroAdded[t]=false;const i=e.slice(1,3).padStart(2,"0");const s=parseInt(i,10)||0;if(s>=a){if(h&&parseInt(i,10)<parseInt(h,10)){this.hours=h}else{this.hours="00";d=true}}else{if(f&&parseInt(i,10)>parseInt(f,10)){if(h&&parseInt(i,10)<parseInt(h,10)){this.hours=h}else{this.hours="00";d=true}}else{if(h&&parseInt(i,10)<parseInt(h,10)){this.hours=h}else{this.hours=i}}}}else if(e.length>2){if(e.startsWith("00")){this.inputZeroAdded[t]=true;const i=e.slice(1,3).padStart(2,"0");if(f&&parseInt(i,10)>parseInt(f,10)){if(h&&parseInt(i,10)<parseInt(h,10)){this.hours=h}else{this.hours="00";d=true}}else{if(h&&parseInt(i,10)<parseInt(h,10)){this.hours=h}else{this.hours=i}}}else{const t=e.slice(1,3).padStart(2,"0");const i=parseInt(t,10)||0;if(i>=a){if(h&&parseInt(t,10)<parseInt(h,10)){this.hours=h;d=true}else{this.hours="00";d=true}}else{if(f&&i>parseInt(f,10)){if(h&&parseInt(t,10)<parseInt(h,10)){this.hours=h}else{this.hours="00";d=true}}else{if(h&&i<parseInt(h,10)){this.hours=h}else{this.hours=i.toString()}}}}}else{const t=e.padStart(2,"0");const i=parseInt(t,10)||0;if(i>=a){if(h&&parseInt(t,10)<parseInt(h,10)){this.hours=h}else{this.hours="00";d=true}}else{if(f&&i>parseInt(f,10)){this.hours="00";d=true}else{if(h&&i<parseInt(h,10)){this.hours=h}else{this.hours=i.toString()}}}}if(this.hours.length===2&&!this.inputZeroAdded[t]&&!d){(i=this.inputElements[r.Minutes])===null||i===void 0?void 0:i.focus();(s=this.inputElements[r.Minutes])===null||s===void 0?void 0:s.select()}else if(d){(n=this.inputElements[r.Hours])===null||n===void 0?void 0:n.focus();(o=this.inputElements[r.Hours])===null||o===void 0?void 0:o.select()}}handleMinutesChange(e,t){var i,s,n,o,l,a;const d=60;let f=false;const h=(i=this.parseMinute(this.min))!==null&&i!==void 0?i:0;const c=(s=this.parseMinute(this.max))!==null&&s!==void 0?s:59;if(e.length===1){this.inputZeroAdded[t]=true;const i=e.padStart(2,"0");if(c&&parseInt(i,10)>c){if(h&&parseInt(i,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(h&&parseInt(i,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes=i}}}else if(this.inputZeroAdded[t]){this.inputZeroAdded[t]=false;const i=e.slice(1,3).padStart(2,"0");const s=parseInt(i,10)||0;if(s>=d){if(h&&parseInt(i,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(c&&s>c){if(h&&parseInt(i,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(h&&s<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes=i}}}}else if(e.length>2){if(e.startsWith("00")){this.inputZeroAdded[t]=true;const i=e.slice(1,3).padStart(2,"0");if(c&&parseInt(i,10)>c){if(h&&parseInt(i,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(h&&parseInt(i,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes=i}}}else{const t=e.slice(1,3).padStart(2,"0");const i=parseInt(t,10)||0;if(i>=d){if(h&&parseInt(t,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(c&&i>c){if(h&&parseInt(t,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(h&&i<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes=i.toString()}}}}}else{const t=e.padStart(2,"0");const i=parseInt(t,10)||0;if(i>=d){if(h&&parseInt(t,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(c&&i>c){if(h&&parseInt(t,10)<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes="00";f=true}}else{if(h&&i<h){this.minutes=h.toString().padStart(2,"0")}else{this.minutes=i.toString()}}}}if(this.minutes.length===2&&!this.inputZeroAdded[t]&&!f){(n=this.inputElements[r.Seconds])===null||n===void 0?void 0:n.focus();(o=this.inputElements[r.Seconds])===null||o===void 0?void 0:o.select()}else if(f){(l=this.inputElements[r.Minutes])===null||l===void 0?void 0:l.focus();(a=this.inputElements[r.Minutes])===null||a===void 0?void 0:a.select()}}handleSecondsChange(e,t){var i,s,n,o;const l=60;let a=false;const d=(i=this.parseSecond(this.min))!==null&&i!==void 0?i:0;const f=(s=this.parseSecond(this.max))!==null&&s!==void 0?s:59;if(e.length===1){this.inputZeroAdded[t]=true;const i=e.padStart(2,"0");if(f&&parseInt(i,10)>f){if(d&&parseInt(i,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds="00";a=true}}else{if(d&&parseInt(i,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds=i}}}else if(this.inputZeroAdded[t]){this.inputZeroAdded[t]=false;const i=e.slice(1,3).padStart(2,"0");const s=parseInt(i,10)||0;if(s>=l){if(d&&parseInt(i,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds="00";a=true}}else{if(f&&s>f){if(d&&parseInt(i,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds="00";a=true}}else{if(d&&s<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds=i}}}}else if(e.length>2){const t=e.slice(1,3).padStart(2,"0");const i=parseInt(t,10)||0;if(i>=l){if(d&&parseInt(t,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds="00";a=true}}else{if(f&&i>f){if(d&&parseInt(t,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds="00";a=true}}else{if(d&&i<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds=i.toString()}}}}else{const t=e.padStart(2,"0");const i=parseInt(t,10)||0;if(i>=l){if(d&&parseInt(t,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds="00";a=true}}else{if(f&&i>f){if(d&&parseInt(t,10)<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds="00";a=true}}else{if(d&&i<d){this.seconds=d.toString().padStart(2,"0")}else{this.seconds=i.toString()}}}}if(a){(n=this.inputElements[r.Seconds])===null||n===void 0?void 0:n.focus();(o=this.inputElements[r.Seconds])===null||o===void 0?void 0:o.select()}}parseTime(e){if(!e){return}const t=e.replace(/[^0-9]/g,"").padStart(6,"0");const i=t.slice(0,2);const s=t.slice(2,4);const n=t.slice(4,6);const o=this.parseHour(this.min,this.format)||i;const r=this.parseMinute(this.min)||s;const l=this.parseSecond(this.min)||n;this.hours=o.padStart(2,"0");this.minutes=r.toString().padStart(2,"0");this.seconds=l.toString().padStart(2,"0")}reconstructTime(){if(this.format==="HH"||this.format==="hh"){return this.hours}else if(this.format==="HH:mm"||this.format==="hh:mm"){return`${this.hours}:${this.minutes}`}else if(this.format==="HH:mm:ss"||this.format==="hh:mm:ss"){return`${this.hours}:${this.minutes}:${this.seconds}`}else{return`${this.hours}:${this.minutes}:${this.seconds}`}}handleFocus(e){var t,i,s,n;if(this.readonly||this.disabled){return}if(!this.open){this.open=true}if(((t=this.inputElements[e])===null||t===void 0?void 0:t.value.length)===0||((i=this.inputElements[e])===null||i===void 0?void 0:i.value)==="00"){(s=this.inputElements[e])===null||s===void 0?void 0:s.focus();(n=this.inputElements[e])===null||n===void 0?void 0:n.select()}this.typeFocused=e}HandleDropdownIconClick(){var e,t,i,s,n,o;if(this.disabled||this.readonly){return}if(this.open&&this.inputElements[r.Hours]){this.open=false}else if(this.open&&this.inputElements[r.Minutes]){this.open=false}else if(this.open&&this.inputElements[r.Seconds]){this.open=false}else if(!this.open&&this.inputElements[r.Hours]){(e=this.inputElements[r.Hours])===null||e===void 0?void 0:e.focus();(t=this.inputElements[r.Hours])===null||t===void 0?void 0:t.select()}else if(!this.open&&this.inputElements[r.Minutes]){(i=this.inputElements[r.Minutes])===null||i===void 0?void 0:i.focus();(s=this.inputElements[r.Minutes])===null||s===void 0?void 0:s.select()}else if(!this.open&&this.inputElements[r.Seconds]){(n=this.inputElements[r.Seconds])===null||n===void 0?void 0:n.focus();(o=this.inputElements[r.Seconds])===null||o===void 0?void 0:o.select()}else{console.warn("nv-fieldtime -> No input elements found to focus or to blur")}}updateHighlightedItem(e,t){e.forEach(((e,i)=>{if(i===t){e.classList.add("highlighted");e.setAttribute("tabindex","0");e.focus();e.scrollIntoView({block:"nearest"})}else{e.classList.remove("highlighted");e.setAttribute("tabindex","-1")}}))}handleTimeOptionClick(e,t){const i=parseInt(e.target.textContent||"0",10);if(t===r.Hours){this.hours=i.toString().padStart(2,"0")}else if(t===r.Minutes){this.minutes=i.toString().padStart(2,"0")}else if(t===r.Seconds){this.seconds=i.toString().padStart(2,"0")}const s=this.reconstructTime();this.value=s}handleInputBlur(){setTimeout((()=>{if(!this.el.contains(document.activeElement)){if(this.open){this.open=false}}}),150)}handleClickOutside(e){const t=e.target;if(this.el.contains(t)||Object.values(this.inputElements).some((e=>e.contains(t)))){return}if(this.open){this.open=false}}handleScroll(e,t){const i=e.target;const s=i.scrollTop;const n=i.clientHeight;const o=i.scrollHeight;const r=40;const l=this.generateTimeOptions(t);const a=l.length*r;if(s+n>=o-r||s<=0){i.scrollTop=a}}generateTimeOptions(e){const t=this.step/1e3;if(t===0){return["00"]}switch(e){case r.Hours:return this.generateHourOptions(t);case r.Minutes:return this.generateMinuteOptions(t);case r.Seconds:return this.generateSecondOptions(t);default:return[]}}generateHourOptions(e){const t=Math.max(1,Math.floor(e/3600));const i=this.parseHour(this.max,this.format)||(this.format.startsWith("hh")?"12":"24");const s=this.parseHour(this.min,this.format)||"00";const n=parseInt(i,10);const o=parseInt(s,10);const r=[];for(let e=o;e<n;e+=t){r.push(e.toString().padStart(2,"0"))}return r}parseHour(e,t){if(!e)return null;const[i]=e.split(":");const s=parseInt(i,10);if(isNaN(s))return null;if(t.startsWith("hh"))return s>0&&s<=12?i.padStart(2,"0"):null;return s>=0&&s<=24?i.padStart(2,"0"):null}generateMinuteOptions(e){var t,i;const s=Math.max(1,Math.floor(e%3600/60));const n=(t=this.parseMinute(this.min))!==null&&t!==void 0?t:0;const o=(i=this.parseMinute(this.max))!==null&&i!==void 0?i:59;if(n===0&&o===0)return["00"];const r=[];for(let e=n;e<=o;e+=s){r.push(e.toString().padStart(2,"0"))}return r}parseMinute(e){if(!e)return null;const t=e.split(":");if(t.length<2)return null;const i=parseInt(t[1],10);return isNaN(i)||i<0||i>=60?null:i}generateSecondOptions(e){var t,i;const s=Math.max(1,e%60);const n=(t=this.parseSecond(this.min))!==null&&t!==void 0?t:0;const o=(i=this.parseSecond(this.max))!==null&&i!==void 0?i:59;if(n===0&&o===0)return["00"];const r=[];for(let e=n;e<=o;e+=s){r.push(e.toString().padStart(2,"0"))}return r}parseSecond(e){if(!e)return null;const t=e.split(":");if(t.length<3)return null;const i=parseInt(t[2],10);return isNaN(i)||i<0||i>=60?null:i}generateInfiniteTimeOptions(e){const t=this.generateTimeOptions(e);const i=t.length;const s=Math.ceil(300/i);return Array(s).fill(t).flat()}getCurrentTime(){const e=new Date;return e.toLocaleTimeString()}updateColumnHighlight(e,t){const i=Array.from(this.el.querySelectorAll(e));const s=i.findIndex((e=>e.textContent===t));this.updateHighlightedItem(i,s)}handleHostClick(e){var t,i;if(this.disabled||this.readonly){return}const s=e.target;if(s.closest("nv-iconbutton")){return}if(!this.open){if(this.inputElements){(t=this.inputElements[r.Hours])===null||t===void 0?void 0:t.focus();(i=this.inputElements[r.Hours])===null||i===void 0?void 0:i.select()}e.preventDefault()}}componentWillLoad(){document.addEventListener("click",this.handleClickOutside.bind(this));if(this.value){this.parseTime(this.value)}else{const e=this.parseHour(this.min,this.format)||"00";const t=this.parseMinute(this.min)||0;const i=this.parseSecond(this.min)||0;this.hours=e.padStart(2,"0");this.minutes=t.toString().padStart(2,"0");this.seconds=i.toString().padStart(2,"0")}}connectedCallback(){document.addEventListener("click",this.handleClickOutside.bind(this))}disconnectedCallback(){document.removeEventListener("click",this.handleClickOutside.bind(this))}componentDidLoad(){if(!this.value){const e=this.getCurrentTime();let[t,i,s]=e.split(":");let n,o;if(s.includes(" ")){[n,o]=s.split(" ")}else{n=s}let r=parseInt(t,10);if(o){if(o==="PM"&&r<12){r+=12}else if(o==="AM"&&r===12){r=0}}if(this.format.startsWith("hh")){if(r===0){t="12"}else if(r>12){t=(r-12).toString()}else{t=r.toString()}}else{t=r.toString()}t=t.padStart(2,"0");i=i.padStart(2,"0");n=n.padStart(2,"0");const l=`.time-column.time-column-hours div`;this.updateColumnHighlight(l,t);const a=`.time-column.time-column-minutes div`;this.updateColumnHighlight(a,i);const d=`.time-column.time-column-seconds div`;this.updateColumnHighlight(d,n)}}RenderTimeOptionsColumn(e){return i("div",{class:`time-column time-column-${e}`,onScroll:t=>this.handleScroll(t,e)},this.generateInfiniteTimeOptions(e).map(((t,s)=>i("div",{class:{"time-option":true,selected:e===r.Hours&&t===this.hours||e===r.Minutes&&t===this.minutes||e===r.Seconds&&t===this.seconds},key:`${t}-${s}`,onClick:t=>this.handleTimeOptionClick(t,e)},t))))}render(){return i(s,{key:"f2e316b464ef324043fca47a25d7511fed662fe9",onclick:e=>this.handleHostClick(e)},(this.label||this.el.querySelector('[slot="label"]'))&&i("label",{key:"738dd3f9ba307a21ad7f16f77eb09f4f9fed8ccb",htmlFor:this.inputId},i("slot",{key:"8106132899c67bbc7e9ffb82caf575d599239b9a",name:"label"},this.label)),i("nv-popover",{key:"8306d0204039862466d83c7e5e2f42b87ea331c4",ref:e=>this.popoverElement=e,triggerMode:"controlled",placement:"bottom-start",open:this.open},i("div",{key:"0355aee332a5c5cd2492f22b7d820625273c74e6",class:"input-wrapper",slot:"trigger"},i("slot",{key:"a6aaeaba4901b4fe0b0266796c84531d57fbb719",name:"before-input"}),i("div",{key:"ae78ff8fc1a857a0da7be6e3c29464dbc0b80771",class:"input-container"},i("slot",{key:"6455a51b2f1edf565ac754e61ac773a920f319d4",name:"leading-input"}),o(this.format,"HH")&&[i("input",{key:"9a48b8ea04698b9443774a2e2bf41383144ba29a",ref:e=>this.inputElements[r.Hours]=e,type:"number",autofocus:this.autofocus,class:"time-input",pattern:"[0-9]*",maxlength:"3",value:this.hours,onInput:e=>this.handleInputChange(e,r.Hours),placeholder:this.format.includes("hh")?"hh":"HH",inputMode:"numeric",onFocus:()=>this.handleFocus(r.Hours),name:this.name?`${r.Hours}-${this.name}`:r.Hours,id:this.inputId,readonly:this.readonly,disabled:this.disabled,required:this.required,onKeyDown:e=>this.handleKeyDown(e),onBlur:()=>this.handleInputBlur()})],this.format.includes("mm")&&[i("span",{key:"5f75d09a90c0a8f6f106eb3e24f4f342fcc36d67"},":"),i("input",{key:"b3cc508705147ea07218a037f21f425deb9b94af",ref:e=>this.inputElements[r.Minutes]=e,type:"number",autofocus:this.autofocus,class:"time-input",pattern:"[0-9]*",maxlength:"3",value:this.minutes,onInput:e=>this.handleInputChange(e,r.Minutes),placeholder:"mm",inputMode:"numeric",onFocus:()=>this.handleFocus(r.Minutes),name:this.name?`${r.Minutes}-${this.name}`:r.Minutes,id:`${this.inputId}-minutes`,readonly:this.readonly,disabled:this.disabled,required:this.required,onKeyDown:e=>this.handleKeyDown(e),onBlur:()=>this.handleInputBlur()})],this.format.includes("ss")&&[i("span",{key:"00b9320c275b027f9b2fbbebc1f56431783c874e"},":"),i("input",{key:"3421fb11a4c9d9ba58bbf6f809070ce35d3d1ad6",ref:e=>this.inputElements[r.Seconds]=e,type:"number",autofocus:this.autofocus,class:"time-input",pattern:"[0-9]*",maxlength:"3",value:this.seconds,onInput:e=>this.handleInputChange(e,r.Seconds),placeholder:"ss",inputMode:"numeric",onFocus:()=>this.handleFocus(r.Seconds),name:this.name?`${r.Seconds}-${this.name}`:r.Seconds,id:`${this.inputId}-seconds`,readonly:this.readonly,disabled:this.disabled,required:this.required,onKeyDown:e=>this.handleKeyDown(e),onBlur:()=>this.handleInputBlur()})],i("nv-iconbutton",{key:"c61dc8780e1d668f2bf11ac2ace21b89ed460fdb",name:this.open?"chevron-top":"chevron-down",size:"md",emphasis:"lower","aria-label":this.open?"Hide time picker":"Show time picker","aria-pressed":this.open.toString(),onClick:()=>this.HandleDropdownIconClick()}),this.error&&i("nv-icon",{key:"5963651793c9c1ec5d47be2a8cea9fed22490bb9",name:"alert-circle",class:"validation",size:"sm"}),this.success&&i("nv-icon",{key:"79953118d4206363f97ffb8d69dd76545795e419",name:"circle-check",class:"validation",size:"sm"})),i("slot",{key:"d0a8c104a671f997e6a9da223baa2a37dd3bf349",name:"after-input"})),i("div",{key:"7dec8335599d59e116065bdb0053a9096acaae88",class:"time-dropdown",slot:"content"},i("div",{key:"be7d3a3fa7b4def66a7ebdf2f29b489540fa5802",class:"time-columns"},o(this.format,"HH")&&this.RenderTimeOptionsColumn(r.Hours),this.format.includes("mm")&&this.RenderTimeOptionsColumn(r.Minutes),this.format.includes("ss")&&this.RenderTimeOptionsColumn(r.Seconds)))),(this.description||this.el.querySelector('[slot="description"]'))&&i("div",{key:"ec98cc31482efab33ace4e0bf62c6d5d82890df5",class:"description"},i("slot",{key:"307b134933cca699d6f00d891a440281f2427d79",name:"description"},this.description)),(this.errorDescription||this.el.querySelector('[slot="error-description"]'))&&i("div",{key:"71763de75be4e9f14e1cd1788ca06f2265a46d7e",hidden:!this.error,class:"error-description"},i("slot",{key:"dbe05c00515a5ccf1b4ba4736b943cfd8cefaaa0",name:"error-description"},this.errorDescription)))}static get formAssociated(){return true}get el(){return n(this)}static get watchers(){return{value:["handleValueChange"]}}};f.style=d;export{f as nv_fieldtime};
|
|
2
|
+
//# sourceMappingURL=p-adc96c3a.entry.js.map
|