@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,659 @@
|
|
|
1
|
+
import { h, r as registerInstance, c as createEvent, a as Host, g as getElement } from './index-8f0e5f19.js';
|
|
2
|
+
import { v as v4 } from './v4-a79185f4.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Utility functions for nv-fieldslider.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Clamp a value between min and max.
|
|
9
|
+
* @param {number} value - The value to clamp
|
|
10
|
+
* @param {number} min - The minimum boundary
|
|
11
|
+
* @param {number} max - The maximum boundary
|
|
12
|
+
* @returns {number} The clamped value
|
|
13
|
+
*/
|
|
14
|
+
function clamp(value, min, max) {
|
|
15
|
+
return Math.max(min, Math.min(max, value));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Calculate the percentage position of a value within a range.
|
|
19
|
+
* @param {number} value - The value to convert to percentage
|
|
20
|
+
* @param {number} min - The minimum value of the range
|
|
21
|
+
* @param {number} max - The maximum value of the range
|
|
22
|
+
* @returns {number} The percentage (0-100)
|
|
23
|
+
*/
|
|
24
|
+
function valueToPercent(value, min, max) {
|
|
25
|
+
if (max === min)
|
|
26
|
+
return 0;
|
|
27
|
+
return ((value - min) / (max - min)) * 100;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Snap a value to the nearest step.
|
|
31
|
+
* @param {number} value - The value to snap
|
|
32
|
+
* @param {number} min - The minimum boundary
|
|
33
|
+
* @param {number} max - The maximum boundary
|
|
34
|
+
* @param {number} step - The step size
|
|
35
|
+
* @returns {number} The snapped value
|
|
36
|
+
*/
|
|
37
|
+
function snapToStep(value, min, max, step) {
|
|
38
|
+
const clamped = clamp(value, min, max);
|
|
39
|
+
const snapped = Math.round((clamped - min) / step) * step + min;
|
|
40
|
+
return clamp(snapped, min, max);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Generate tick values for the slider.
|
|
44
|
+
* @param {number} min - The minimum value
|
|
45
|
+
* @param {number} max - The maximum value
|
|
46
|
+
* @param {number} step - The step size
|
|
47
|
+
* @returns {number[]} Array of tick values
|
|
48
|
+
*/
|
|
49
|
+
function generateTicks(min, max, step) {
|
|
50
|
+
const ticks = [];
|
|
51
|
+
for (let v = min; v <= max; v += step) {
|
|
52
|
+
ticks.push(Number(v.toFixed(10))); // avoid floating point issues
|
|
53
|
+
}
|
|
54
|
+
if (ticks[ticks.length - 1] !== max) {
|
|
55
|
+
ticks.push(max);
|
|
56
|
+
}
|
|
57
|
+
return ticks;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Snap a value to the nearest tick mark.
|
|
61
|
+
* @param {number} value - The value to snap
|
|
62
|
+
* @param {object[]} ticks - Array of tick objects
|
|
63
|
+
* @returns {number} The value of the closest tick
|
|
64
|
+
*/
|
|
65
|
+
function snapToTicks(value, ticks) {
|
|
66
|
+
if (!ticks || ticks.length === 0)
|
|
67
|
+
return value;
|
|
68
|
+
// Find the closest tick
|
|
69
|
+
let closestTick = ticks[0].value;
|
|
70
|
+
let minDistance = Math.abs(value - closestTick);
|
|
71
|
+
for (const tick of ticks) {
|
|
72
|
+
const distance = Math.abs(value - tick.value);
|
|
73
|
+
if (distance < minDistance) {
|
|
74
|
+
minDistance = distance;
|
|
75
|
+
closestTick = tick.value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return closestTick;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Renders single thumb in standard mode.
|
|
83
|
+
* @param {SingleThumbProps} props - Component properties
|
|
84
|
+
* @returns {JSX.Element} JSX element representing the thumb
|
|
85
|
+
*/
|
|
86
|
+
const SingleThumb = props => {
|
|
87
|
+
const { value, min, max, rawPosition, isDragging, snap, disabled, readonly, onKeyDown, labelBeforeValue, labelAfterValue, } = props;
|
|
88
|
+
// Use raw position for visual display during dragging, but the snapped value otherwise
|
|
89
|
+
let displayPosition = value;
|
|
90
|
+
if (isDragging && !snap) {
|
|
91
|
+
displayPosition = clamp(rawPosition, min, max);
|
|
92
|
+
}
|
|
93
|
+
const percent = valueToPercent(displayPosition, min, max);
|
|
94
|
+
return (h("div", { class: "thumb", style: { left: `${percent}%` }, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, "aria-disabled": disabled ? 'true' : undefined, "aria-readonly": readonly ? 'true' : undefined, tabindex: disabled ? -1 : 0, onKeyDown: onKeyDown },
|
|
95
|
+
h("div", { class: "thumb-tooltip" },
|
|
96
|
+
labelBeforeValue && (h("span", { class: "label-before" }, labelBeforeValue)),
|
|
97
|
+
String(value),
|
|
98
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))));
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Renders dual thumbs in range mode.
|
|
103
|
+
* @param {RangeThumbProps} props - Component properties
|
|
104
|
+
* @returns {JSX.Element[]} Array of JSX elements representing the range slider thumbs
|
|
105
|
+
*/
|
|
106
|
+
const RangeThumb = props => {
|
|
107
|
+
const { rangeValue, rawRangePosition, activeDragThumb, isDragging, snap, min, max, disabled, readonly, onKeyDown, labelBeforeValue, labelAfterValue, } = props;
|
|
108
|
+
const [leftValue, rightValue] = rangeValue;
|
|
109
|
+
// Use raw positions for visual display during dragging, but the snapped values otherwise
|
|
110
|
+
let displayLeftPosition = leftValue;
|
|
111
|
+
let displayRightPosition = rightValue;
|
|
112
|
+
if (isDragging && !snap) {
|
|
113
|
+
const [rawLeft, rawRight] = rawRangePosition;
|
|
114
|
+
if (activeDragThumb === 'left') {
|
|
115
|
+
displayLeftPosition = clamp(rawLeft, min, Math.min(rightValue, max));
|
|
116
|
+
}
|
|
117
|
+
else if (activeDragThumb === 'right') {
|
|
118
|
+
displayRightPosition = clamp(rawRight, Math.max(leftValue, min), max);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const leftPercent = valueToPercent(displayLeftPosition, min, max);
|
|
122
|
+
const rightPercent = valueToPercent(displayRightPosition, min, max);
|
|
123
|
+
return [
|
|
124
|
+
h("div", { class: "track-range", style: {
|
|
125
|
+
left: `${leftPercent}%`,
|
|
126
|
+
width: `${rightPercent - leftPercent}%`,
|
|
127
|
+
} }),
|
|
128
|
+
h("div", { class: "thumb thumb-left", style: { left: `${leftPercent}%` }, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": leftValue, "aria-disabled": disabled ? 'true' : undefined, "aria-readonly": readonly ? 'true' : undefined, "data-thumb": "left", tabindex: disabled ? -1 : 0, onKeyDown: onKeyDown },
|
|
129
|
+
h("div", { class: "thumb-tooltip" },
|
|
130
|
+
labelBeforeValue && (h("span", { class: "label-before" }, labelBeforeValue)),
|
|
131
|
+
String(leftValue),
|
|
132
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))),
|
|
133
|
+
h("div", { class: "thumb thumb-right", style: { left: `${rightPercent}%` }, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": rightValue, "aria-disabled": disabled ? 'true' : undefined, "aria-readonly": readonly ? 'true' : undefined, "data-thumb": "right", tabindex: disabled ? -1 : 0, onKeyDown: onKeyDown },
|
|
134
|
+
h("div", { class: "thumb-tooltip" },
|
|
135
|
+
labelBeforeValue && (h("span", { class: "label-before" }, labelBeforeValue)),
|
|
136
|
+
String(rightValue),
|
|
137
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))),
|
|
138
|
+
];
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Renders tick marks along the slider track.
|
|
143
|
+
* @param {TickMarksProps} props - Component properties
|
|
144
|
+
* @returns {JSX.Element | null} JSX element representing the tick marks or null if no ticks
|
|
145
|
+
*/
|
|
146
|
+
const TickMarks = props => {
|
|
147
|
+
const { ticks, min, max } = props;
|
|
148
|
+
if (ticks.length === 0) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
return (h("div", { class: "track-ticks" }, ticks.map(tick => {
|
|
152
|
+
const percent = valueToPercent(tick.value, min, max);
|
|
153
|
+
return (h("div", { class: "track-tick", style: { left: `${percent}%` } }, tick.label && h("div", { class: "tick-label" }, tick.label)));
|
|
154
|
+
})));
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Renders field input for direct value entry
|
|
159
|
+
* @param {FieldInputProps} props - Component properties
|
|
160
|
+
* @returns {JSX.Element} JSX element representing the field input
|
|
161
|
+
*/
|
|
162
|
+
const FieldInput = props => {
|
|
163
|
+
const { range, hasField, value, rangeValue, index, inputId, min, max, step, disabled, readonly, onInput, labelBeforeValue, labelAfterValue, name, endName, } = props;
|
|
164
|
+
// Determine the appropriate value based on mode and index
|
|
165
|
+
const fieldValue = range ? rangeValue[index] : value;
|
|
166
|
+
// In range mode, we need data-index for event handling
|
|
167
|
+
const dataAttrs = range ? { 'data-index': index.toString() } : {};
|
|
168
|
+
// Determine the appropriate name based on mode and index
|
|
169
|
+
let inputName;
|
|
170
|
+
if (range) {
|
|
171
|
+
if (index === 0) {
|
|
172
|
+
inputName = name || '';
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// Use endName if provided, otherwise append "-end" to the name
|
|
176
|
+
inputName = endName || (name ? `${name}-end` : '');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
inputName = name || '';
|
|
181
|
+
}
|
|
182
|
+
// If hasField is false, only the containers are visible, not the input fields
|
|
183
|
+
const containerClass = hasField
|
|
184
|
+
? 'input-container'
|
|
185
|
+
: 'input-container hidden-input';
|
|
186
|
+
return hasField ? (h("div", { class: containerClass },
|
|
187
|
+
labelBeforeValue && h("span", { class: "label-before" }, labelBeforeValue),
|
|
188
|
+
h("input", Object.assign({ id: inputId, type: "number", value: fieldValue, min: min, max: max, step: step, disabled: disabled, readonly: readonly, name: inputName }, dataAttrs, { onInput: onInput })),
|
|
189
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))) : (h("input", { id: inputId, type: "hidden", value: fieldValue, disabled: disabled, readonly: readonly, name: inputName }));
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const nvFieldsliderCss = "nv-fieldslider{--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-fieldslider .slider-container{width:100%;display:flex;flex-direction:row;align-items:center;gap:var(--form-gap-x)}nv-fieldslider .slider-container .track-container{position:relative;flex:1;height:calc(16px + 0.25rem);padding:calc(16px / 2) 0}nv-fieldslider .slider-container .track-container .track{position:relative;height:4px;background:#e5e7eb;border-radius:4px;cursor:pointer}nv-fieldslider .slider-container .track-container .track .track-range{position:absolute;top:0;height:4px;background:var(--nv-field-border-focus);border-radius:4px;pointer-events:none}nv-fieldslider .slider-container .track-container .track .thumb{position:absolute;top:50%;width:16px;height:16px;background:#ffffff;border:2px solid var(--nv-field-border-focus);border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);transform:translate(-50%, -50%);z-index:1;cursor:grab;transition:box-shadow 0.2s, background-color 0.2s}nv-fieldslider .slider-container .track-container .track .thumb:focus{box-shadow:0 4px 6px rgba(0, 0, 0, 0.15);outline:6px solid color-mix(in srgb, var(--nv-field-border-focus) 50%, transparent);transition:outline}nv-fieldslider .slider-container .track-container .track .thumb:active{cursor:grabbing;background-color:#e6f7ff}nv-fieldslider .slider-container .track-container .track .thumb .thumb-tooltip{position:absolute;top:25px;left:50%;background-color:var(--components-tooltip-background);color:var(--components-tooltip-text);padding:5px;border-radius:var(--tooltip-radius);font-size:var(--tooltip-font-size);z-index:10;pointer-events:none;user-select:none;opacity:0;transition:opacity 0.3s ease-in-out;transform:translateX(-50%)}nv-fieldslider .slider-container .track-container .track .thumb .thumb-tooltip:after{content:\"\";background:var(--components-tooltip-background);box-shadow:none;border:none;position:absolute;border-bottom-color:transparent;border-right-color:transparent;width:6px;height:6px;transform:rotate(45deg);border-radius:1px;top:-3px;left:50%;margin-left:-3px}nv-fieldslider .slider-container .track-container .track .thumb:hover .thumb-tooltip,nv-fieldslider .slider-container .track-container .track .thumb:active .thumb-tooltip,nv-fieldslider .slider-container .track-container .track .thumb:focus .thumb-tooltip{opacity:1}nv-fieldslider .slider-container .track-container .track-ticks{position:relative;height:1rem;margin-top:0.25rem}nv-fieldslider .slider-container .track-container .track-ticks .track-tick{position:absolute;top:0;width:6px;height:6px;background:var(--components-form-field-border-default);border-radius:50%;transform:translate(-50%, 0);pointer-events:none}nv-fieldslider .slider-container .track-container .track-ticks .track-tick .tick-label{position:absolute;top:calc(6px + 0.25rem);left:50%;color:var(--components-form-field-border-default);transform:translateX(-50%);white-space:nowrap}nv-fieldslider .slider-container .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;width:64px;flex-grow:unset}nv-fieldslider .slider-container .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldslider .slider-container .input-container:focus-within,nv-fieldslider .slider-container .input-container:focus-within:hover,nv-fieldslider .slider-container .input-container:focus,nv-fieldslider .slider-container .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-fieldslider .slider-container .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-fieldslider .slider-container .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldslider .slider-container .input-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-fieldslider .slider-container .input-container input:focus{outline:none}nv-fieldslider .slider-container .input-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-fieldslider[fluid]:not([fluid=false]){max-width:unset}nv-fieldslider[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-fieldslider[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-fieldslider[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-fieldslider[readonly]:not([readonly=false]) .track,nv-fieldslider[readonly]:not([readonly=false]) .thumb{cursor:default}nv-fieldslider 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-fieldslider[hide-label]:not([hide-label=false]) label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}nv-fieldslider[has-field]:not([has-field=false]) .thumb-tooltip{display:none}nv-fieldslider>.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-fieldslider>.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-fieldslider>.error-description[hidden]{display:none}";
|
|
193
|
+
const NvFieldsliderStyle0 = nvFieldsliderCss;
|
|
194
|
+
|
|
195
|
+
const NvFieldslider = class {
|
|
196
|
+
constructor(hostRef) {
|
|
197
|
+
registerInstance(this, hostRef);
|
|
198
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
199
|
+
/****************************************************************************/
|
|
200
|
+
//#region PROPERTIES
|
|
201
|
+
/**
|
|
202
|
+
* Sets the ID for the start input element and the for attribute of the associated
|
|
203
|
+
* label. If no ID is provided, a random one will be automatically generated.
|
|
204
|
+
*/
|
|
205
|
+
this.startInputId = v4();
|
|
206
|
+
/**
|
|
207
|
+
* Sets the ID for the end input element and the for attribute of the associated
|
|
208
|
+
* label. If no ID is provided, a random one will be automatically generated.
|
|
209
|
+
*/
|
|
210
|
+
this.endInputId = v4();
|
|
211
|
+
/**
|
|
212
|
+
* Keeps the interface clean by removing visible labels, but still announces
|
|
213
|
+
* the label to screen readers so users relying on assistive tech aren't left
|
|
214
|
+
* guessing.
|
|
215
|
+
*/
|
|
216
|
+
this.hideLabel = false;
|
|
217
|
+
/**
|
|
218
|
+
* Enables an optional numeric input field alongside the slider, allowing
|
|
219
|
+
* users to type a value directly instead of—or in addition to—using the
|
|
220
|
+
* slider handle.
|
|
221
|
+
*/
|
|
222
|
+
this.hasField = false;
|
|
223
|
+
/**
|
|
224
|
+
* Allows the slider to display two thumbs, enabling users to select a
|
|
225
|
+
* continuous range between a minimum and maximum value. Ideal for use cases
|
|
226
|
+
* like filtering by price or time.
|
|
227
|
+
*/
|
|
228
|
+
this.range = false;
|
|
229
|
+
/**
|
|
230
|
+
* Disables user interaction with the slider and its associated input fields.
|
|
231
|
+
*/
|
|
232
|
+
this.disabled = false;
|
|
233
|
+
/**
|
|
234
|
+
* Makes the slider and input non-editable while keeping them focusable and
|
|
235
|
+
* included in form submissions.
|
|
236
|
+
*/
|
|
237
|
+
this.readonly = false;
|
|
238
|
+
/**
|
|
239
|
+
* Alters the slider's appearance to indicate an error, helping users
|
|
240
|
+
* identify fields that need correction.
|
|
241
|
+
* @validator error
|
|
242
|
+
*/
|
|
243
|
+
this.error = false;
|
|
244
|
+
/**
|
|
245
|
+
* Changes the slider's appearance to indicate successful input or validation.
|
|
246
|
+
*/
|
|
247
|
+
this.success = false;
|
|
248
|
+
/**
|
|
249
|
+
* Numeric value of the slider as a string, if range mode is on, the values
|
|
250
|
+
* will be a comma-separated string.
|
|
251
|
+
*/
|
|
252
|
+
this.value = '0';
|
|
253
|
+
/**
|
|
254
|
+
* Defines the interval between selectable values on the slider. Controls how
|
|
255
|
+
* much the value increases or decreases with each keyboard interaction, drag
|
|
256
|
+
* movement, or direct input.
|
|
257
|
+
*/
|
|
258
|
+
this.step = 1;
|
|
259
|
+
/**
|
|
260
|
+
* Controls whether the slider handle should visually snap to step values
|
|
261
|
+
* during dragging. When false, the handle can be positioned at any point
|
|
262
|
+
* along the track while dragging, but the actual value will still snap to the
|
|
263
|
+
* nearest step value. When true, the handle will visually snap to the nearest
|
|
264
|
+
* step value during dragging.
|
|
265
|
+
*/
|
|
266
|
+
this.snap = false;
|
|
267
|
+
/**
|
|
268
|
+
* When true and custom ticks are provided, the slider will snap to the nearest
|
|
269
|
+
* tick value during dragging, instead of using the step value. This is useful
|
|
270
|
+
* when you have custom ticks at specific values that don't align with regular step intervals.
|
|
271
|
+
*/
|
|
272
|
+
this.snapTicks = false;
|
|
273
|
+
/**
|
|
274
|
+
* Defines the minimum allowed value for the slider. The thumb cannot move
|
|
275
|
+
* below this value, and manual input is also constrained accordingly.
|
|
276
|
+
*/
|
|
277
|
+
this.min = 0;
|
|
278
|
+
/**
|
|
279
|
+
* Defines the maximum allowed value for the slider. The thumb cannot move
|
|
280
|
+
* above this value, and manual input is also constrained accordingly.
|
|
281
|
+
*/
|
|
282
|
+
this.max = 100;
|
|
283
|
+
/**
|
|
284
|
+
* Controls the visibility of tick marks on the slider. When enabled, all
|
|
285
|
+
* visual ticks that indicate step points along the track are shown. If custom
|
|
286
|
+
* ticks are provided, they are always shown regardless of this setting.
|
|
287
|
+
*/
|
|
288
|
+
this.showTicks = false;
|
|
289
|
+
/**
|
|
290
|
+
* Allows the field to stretch and fill the entire width of its container.
|
|
291
|
+
*/
|
|
292
|
+
this.fluid = false;
|
|
293
|
+
//#endregion PROPERTIES
|
|
294
|
+
/****************************************************************************/
|
|
295
|
+
//#region STATE
|
|
296
|
+
this.isDragging = false;
|
|
297
|
+
this.activeDragThumb = 'single';
|
|
298
|
+
this.internalTicks = [];
|
|
299
|
+
// These track the raw slider positions for visual display
|
|
300
|
+
this.rawPosition = 0;
|
|
301
|
+
this.rawRangePosition = [0, 0];
|
|
302
|
+
this.valueInternal = 0;
|
|
303
|
+
this.rangeValueInternal = [0, 0];
|
|
304
|
+
/**
|
|
305
|
+
* Parses the value string into a number or array of numbers for internal use.
|
|
306
|
+
*/
|
|
307
|
+
this.parseValue = () => {
|
|
308
|
+
const values = this.value.replace(/\s/g, '').split(',');
|
|
309
|
+
if (values.length === 1) {
|
|
310
|
+
this.valueInternal = parseFloat(values[0]);
|
|
311
|
+
}
|
|
312
|
+
else if (values.length === 2) {
|
|
313
|
+
values.forEach((value, index) => {
|
|
314
|
+
this.valueInternal = parseFloat(value);
|
|
315
|
+
this.rangeValueInternal[index] = this.valueInternal;
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Handles pointer events on the track.
|
|
321
|
+
* @param {PointerEvent} event - The pointer event
|
|
322
|
+
*/
|
|
323
|
+
this.onTrackInteraction = (event) => {
|
|
324
|
+
if (this.disabled || this.readonly) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const trackRect = event.currentTarget.getBoundingClientRect();
|
|
328
|
+
const percentage = clamp(((event.clientX - trackRect.left) / trackRect.width) * 100, 0, 100);
|
|
329
|
+
const newValue = this.min + (percentage / 100) * (this.max - this.min);
|
|
330
|
+
// Store raw position for visual display
|
|
331
|
+
this.rawPosition = newValue;
|
|
332
|
+
if (this.range) {
|
|
333
|
+
// In range mode, determine which thumb to move based on proximity
|
|
334
|
+
const leftPct = valueToPercent(this.rangeValueInternal[0], this.min, this.max);
|
|
335
|
+
const rightPct = valueToPercent(this.rangeValueInternal[1], this.min, this.max);
|
|
336
|
+
const distanceToLeft = Math.abs(percentage - leftPct);
|
|
337
|
+
const distanceToRight = Math.abs(percentage - rightPct);
|
|
338
|
+
if (distanceToLeft <= distanceToRight) {
|
|
339
|
+
this.activeDragThumb = 'left';
|
|
340
|
+
this.rawRangePosition = [newValue, this.rawRangePosition[1]];
|
|
341
|
+
this.handleValueChange([newValue, this.rangeValueInternal[1]]);
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
this.activeDragThumb = 'right';
|
|
345
|
+
this.rawRangePosition = [this.rawRangePosition[0], newValue];
|
|
346
|
+
this.handleValueChange([this.rangeValueInternal[0], newValue]);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
this.activeDragThumb = 'single';
|
|
351
|
+
this.rawPosition = newValue;
|
|
352
|
+
this.handleValueChange(newValue);
|
|
353
|
+
}
|
|
354
|
+
this.isDragging = true;
|
|
355
|
+
this.registerGlobalEvents();
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Handles pointer move events during drag.
|
|
359
|
+
* @param {PointerEvent} event - The pointer event
|
|
360
|
+
*/
|
|
361
|
+
this.onPointerMove = (event) => {
|
|
362
|
+
if (!this.isDragging || this.disabled || this.readonly) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
const trackElement = this.el.querySelector('.track');
|
|
366
|
+
if (!trackElement)
|
|
367
|
+
return;
|
|
368
|
+
const trackRect = trackElement.getBoundingClientRect();
|
|
369
|
+
const percentage = clamp(((event.clientX - trackRect.left) / trackRect.width) * 100, 0, 100);
|
|
370
|
+
const newValue = this.min + (percentage / 100) * (this.max - this.min);
|
|
371
|
+
// Update visual position
|
|
372
|
+
if (this.range) {
|
|
373
|
+
if (this.activeDragThumb === 'left') {
|
|
374
|
+
this.rawRangePosition = [newValue, this.rawRangePosition[1]];
|
|
375
|
+
this.handleValueChange([newValue, this.rangeValueInternal[1]]);
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
this.rawRangePosition = [this.rawRangePosition[0], newValue];
|
|
379
|
+
this.handleValueChange([this.rangeValueInternal[0], newValue]);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
this.rawPosition = newValue;
|
|
384
|
+
this.handleValueChange(newValue);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* Handles the end of a drag operation.
|
|
389
|
+
*/
|
|
390
|
+
this.onPointerUp = () => {
|
|
391
|
+
this.isDragging = false;
|
|
392
|
+
this.removeGlobalEvents();
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* Handles keydown events for keyboard accessibility.
|
|
396
|
+
* @param {KeyboardEvent} event - The keyboard event
|
|
397
|
+
*/
|
|
398
|
+
this.onKeyDown = (event) => {
|
|
399
|
+
if (this.disabled || this.readonly) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
let newValue;
|
|
403
|
+
const stepMultiplier = event.shiftKey ? 10 : 1;
|
|
404
|
+
const singleStep = this.step * stepMultiplier;
|
|
405
|
+
if (this.range) {
|
|
406
|
+
const focusedThumb = event.target.getAttribute('data-thumb');
|
|
407
|
+
const idx = focusedThumb === 'left' ? 0 : 1;
|
|
408
|
+
const currentValue = [...this.rangeValueInternal];
|
|
409
|
+
switch (event.key) {
|
|
410
|
+
case 'ArrowRight':
|
|
411
|
+
case 'ArrowUp':
|
|
412
|
+
currentValue[idx] += singleStep;
|
|
413
|
+
break;
|
|
414
|
+
case 'ArrowLeft':
|
|
415
|
+
case 'ArrowDown':
|
|
416
|
+
currentValue[idx] -= singleStep;
|
|
417
|
+
break;
|
|
418
|
+
case 'Home':
|
|
419
|
+
currentValue[idx] = this.min;
|
|
420
|
+
break;
|
|
421
|
+
case 'End':
|
|
422
|
+
currentValue[idx] = this.max;
|
|
423
|
+
break;
|
|
424
|
+
case 'PageUp':
|
|
425
|
+
currentValue[idx] += singleStep * 10;
|
|
426
|
+
break;
|
|
427
|
+
case 'PageDown':
|
|
428
|
+
currentValue[idx] -= singleStep * 10;
|
|
429
|
+
break;
|
|
430
|
+
default:
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
newValue = currentValue;
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
switch (event.key) {
|
|
437
|
+
case 'ArrowRight':
|
|
438
|
+
case 'ArrowUp':
|
|
439
|
+
newValue = this.valueInternal + singleStep;
|
|
440
|
+
break;
|
|
441
|
+
case 'ArrowLeft':
|
|
442
|
+
case 'ArrowDown':
|
|
443
|
+
newValue = this.valueInternal - singleStep;
|
|
444
|
+
break;
|
|
445
|
+
case 'Home':
|
|
446
|
+
newValue = this.min;
|
|
447
|
+
break;
|
|
448
|
+
case 'End':
|
|
449
|
+
newValue = this.max;
|
|
450
|
+
break;
|
|
451
|
+
case 'PageUp':
|
|
452
|
+
newValue = this.valueInternal + singleStep * 10;
|
|
453
|
+
break;
|
|
454
|
+
case 'PageDown':
|
|
455
|
+
newValue = this.valueInternal - singleStep * 10;
|
|
456
|
+
break;
|
|
457
|
+
default:
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
event.preventDefault();
|
|
462
|
+
this.handleValueChange(newValue);
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* Handles field input value changes.
|
|
466
|
+
* @param {Event} event - The input event
|
|
467
|
+
*/
|
|
468
|
+
this.handleFieldChange = (event) => {
|
|
469
|
+
const input = event.target;
|
|
470
|
+
const newValue = parseFloat(input.value);
|
|
471
|
+
if (isNaN(newValue)) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (this.range) {
|
|
475
|
+
const fieldIndex = input.getAttribute('data-index') === '0' ? 0 : 1;
|
|
476
|
+
const updatedRange = [...this.rangeValueInternal];
|
|
477
|
+
updatedRange[fieldIndex] = newValue;
|
|
478
|
+
this.handleValueChange(updatedRange);
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
this.handleValueChange(newValue);
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
//#endregion STATE
|
|
486
|
+
/****************************************************************************/
|
|
487
|
+
//#region METHODS
|
|
488
|
+
/**
|
|
489
|
+
* Ensures value is valid and within bounds.
|
|
490
|
+
* @param {number} val - The value to validate
|
|
491
|
+
* @returns {number} The validated and snapped value
|
|
492
|
+
*/
|
|
493
|
+
validateValue(val) {
|
|
494
|
+
// First ensure the value is within bounds
|
|
495
|
+
const clampedValue = clamp(val, this.min, this.max);
|
|
496
|
+
// If snapTicks is true and we have custom ticks, snap to the nearest tick
|
|
497
|
+
if (this.snapTicks && this.internalTicks && this.internalTicks.length > 0) {
|
|
498
|
+
return snapToTicks(clampedValue, this.internalTicks);
|
|
499
|
+
}
|
|
500
|
+
// Otherwise snap to step values
|
|
501
|
+
return snapToStep(clampedValue, this.min, this.max, this.step);
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Handles value changes from slider interaction.
|
|
505
|
+
* @param {number | number[]} newValue - The new value or range values
|
|
506
|
+
*/
|
|
507
|
+
handleValueChange(newValue) {
|
|
508
|
+
if (this.disabled || this.readonly) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
if (this.range) {
|
|
512
|
+
// Handle range values
|
|
513
|
+
if (Array.isArray(newValue) && newValue.length === 2) {
|
|
514
|
+
// Ensure values are in order (left ≤ right)
|
|
515
|
+
const orderedValues = [
|
|
516
|
+
Math.min(newValue[0], newValue[1]),
|
|
517
|
+
Math.max(newValue[0], newValue[1]),
|
|
518
|
+
];
|
|
519
|
+
// Snap to steps and clamp
|
|
520
|
+
const validatedValues = [
|
|
521
|
+
this.validateValue(orderedValues[0]),
|
|
522
|
+
this.validateValue(orderedValues[1]),
|
|
523
|
+
];
|
|
524
|
+
if (validatedValues[0] !== this.rangeValueInternal[0] ||
|
|
525
|
+
validatedValues[1] !== this.rangeValueInternal[1]) {
|
|
526
|
+
this.rangeValueInternal = validatedValues;
|
|
527
|
+
this.value = this.rangeValueInternal.join(',');
|
|
528
|
+
this.valueChanged.emit(this.rangeValueInternal.join(','));
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
// Handle single value
|
|
534
|
+
if (typeof newValue === 'number') {
|
|
535
|
+
const validatedValue = this.validateValue(newValue);
|
|
536
|
+
if (validatedValue !== this.valueInternal) {
|
|
537
|
+
this.valueInternal = validatedValue;
|
|
538
|
+
this.value = String(this.valueInternal);
|
|
539
|
+
this.valueChanged.emit(String(this.valueInternal));
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Generates the ticks to display based on props and state.
|
|
546
|
+
*/
|
|
547
|
+
generateDisplayTicks() {
|
|
548
|
+
// If custom ticks are provided, always use them regardless of showTicks setting
|
|
549
|
+
if (this.ticks && this.ticks.length > 0) {
|
|
550
|
+
this.internalTicks = [...this.ticks].sort((a, b) => a.value - b.value);
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
// If showTicks is false and there are no custom ticks, hide all ticks
|
|
554
|
+
if (!this.showTicks) {
|
|
555
|
+
this.internalTicks = [];
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
// Generate all ticks at each step point
|
|
559
|
+
const autoTicks = generateTicks(this.min, this.max, this.step);
|
|
560
|
+
this.internalTicks = autoTicks.map(value => ({ value }));
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Registers global events for tracking pointer movement.
|
|
564
|
+
*/
|
|
565
|
+
registerGlobalEvents() {
|
|
566
|
+
document.addEventListener('pointermove', this.onPointerMove);
|
|
567
|
+
document.addEventListener('pointerup', this.onPointerUp);
|
|
568
|
+
document.addEventListener('pointercancel', this.onPointerUp);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Removes global events when tracking ends.
|
|
572
|
+
*/
|
|
573
|
+
removeGlobalEvents() {
|
|
574
|
+
document.removeEventListener('pointermove', this.onPointerMove);
|
|
575
|
+
document.removeEventListener('pointerup', this.onPointerUp);
|
|
576
|
+
document.removeEventListener('pointercancel', this.onPointerUp);
|
|
577
|
+
}
|
|
578
|
+
//#endregion METHODS
|
|
579
|
+
/****************************************************************************/
|
|
580
|
+
//#region WATCHERS
|
|
581
|
+
onValueChange() {
|
|
582
|
+
this.parseValue();
|
|
583
|
+
}
|
|
584
|
+
onConfigChange() {
|
|
585
|
+
this.generateDisplayTicks();
|
|
586
|
+
if (this.range) {
|
|
587
|
+
this.handleValueChange(this.rangeValueInternal);
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
this.handleValueChange(this.valueInternal);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
onRangeChange(newValue) {
|
|
594
|
+
if (newValue) {
|
|
595
|
+
// Switching to range mode
|
|
596
|
+
this.rangeValueInternal = [this.min, this.valueInternal];
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
// Switching to single mode, take the higher value
|
|
600
|
+
this.valueInternal = this.rangeValueInternal[1];
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
//#endregion WATCHERS
|
|
604
|
+
/****************************************************************************/
|
|
605
|
+
//#region LIFECYCLE
|
|
606
|
+
connectedCallback() {
|
|
607
|
+
this.parseValue();
|
|
608
|
+
this.generateDisplayTicks();
|
|
609
|
+
// Initialize values and make sure they're valid
|
|
610
|
+
if (this.range) {
|
|
611
|
+
if (!Array.isArray(this.rangeValueInternal) ||
|
|
612
|
+
this.rangeValueInternal.length !== 2) {
|
|
613
|
+
this.rangeValueInternal = [this.min, this.max];
|
|
614
|
+
}
|
|
615
|
+
this.handleValueChange(this.rangeValueInternal);
|
|
616
|
+
// Initialize raw range position to match actual values
|
|
617
|
+
this.rawRangePosition = [
|
|
618
|
+
this.rangeValueInternal[0],
|
|
619
|
+
this.rangeValueInternal[1],
|
|
620
|
+
];
|
|
621
|
+
}
|
|
622
|
+
else {
|
|
623
|
+
this.handleValueChange(this.valueInternal);
|
|
624
|
+
// Initialize raw position to match actual value
|
|
625
|
+
this.rawPosition = this.valueInternal;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
disconnectedCallback() {
|
|
629
|
+
this.removeGlobalEvents();
|
|
630
|
+
}
|
|
631
|
+
//#endregion EVENTS
|
|
632
|
+
/****************************************************************************/
|
|
633
|
+
//#region RENDER
|
|
634
|
+
render() {
|
|
635
|
+
return (h(Host, { key: '69cded86eeaff3470f970d8c5e359d467cea1762' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'd6725108d8cfc35d4722e5761592b08f20c390b2', htmlFor: this.startInputId }, h("slot", { key: 'a13207c702baa4ea95073da3db56419c50114de2', name: "label" }, this.label))), h("div", { key: 'a771db3df06edf4ca150db4f66f42a6816e32bc8', class: "slider-container" }, this.range ? (h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, index: 0, inputId: this.startInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name, endName: this.endName })) : null, h("div", { key: '705fe70c9d5ebba5dc9b877532936d301df0baf6', class: "track-container" }, h("div", { key: '1f9a691c278e88160319699ff91d925dfd8184c2', class: "track", onPointerDown: this.onTrackInteraction }, this.range ? (h(RangeThumb, { rangeValue: this.rangeValueInternal, rawRangePosition: this.rawRangePosition, activeDragThumb: this.activeDragThumb, isDragging: this.isDragging, snap: this.snap, min: this.min, max: this.max, disabled: this.disabled, readonly: this.readonly, onKeyDown: this.onKeyDown, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue })) : (h(SingleThumb, { value: this.valueInternal, min: this.min, max: this.max, rawPosition: this.rawPosition, isDragging: this.isDragging, snap: this.snap, disabled: this.disabled, readonly: this.readonly, onKeyDown: this.onKeyDown, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue }))), h(TickMarks, { key: 'b80cf4eeb492587ca44ebc6512ded331ec5619ef', ticks: this.internalTicks, min: this.min, max: this.max })), this.range ? (h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, index: 1, inputId: this.endInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name, endName: this.endName })) : (h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, inputId: this.startInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name }))), (this.success ||
|
|
636
|
+
this.description ||
|
|
637
|
+
this.el.querySelector('[slot="description"]')) && (h("div", { key: '97a111d5b194aeb4f1fcf1049489ddcf30527157', class: "description" }, this.success && (h("nv-icon", { key: 'cc549945c9a330892c69826867f4279e039944e8', name: "circle-check", class: "validation", size: "md" })), h("slot", { key: '54b3e872439763a15595d6bf4f9c5e129aeae386', name: "description" }, this.description))), (this.error ||
|
|
638
|
+
this.errorDescription ||
|
|
639
|
+
this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'cd5702e6819a11782a634d522a2dccd992af00f3', class: "error-description", hidden: !this.error }, this.error && (h("nv-icon", { key: '1641a68da28b0963d61b74e69c2c32f566ffeff3', name: "alert-circle", class: "validation", size: "md" })), h("slot", { key: 'a969cc7e37c4a21024790a5603a44365e135693d', name: "error-description" }, this.errorDescription)))));
|
|
640
|
+
}
|
|
641
|
+
static get formAssociated() { return true; }
|
|
642
|
+
get el() { return getElement(this); }
|
|
643
|
+
static get watchers() { return {
|
|
644
|
+
"value": ["onValueChange"],
|
|
645
|
+
"min": ["onConfigChange"],
|
|
646
|
+
"max": ["onConfigChange"],
|
|
647
|
+
"step": ["onConfigChange"],
|
|
648
|
+
"ticks": ["onConfigChange"],
|
|
649
|
+
"showTicks": ["onConfigChange"],
|
|
650
|
+
"snap": ["onConfigChange"],
|
|
651
|
+
"snapTicks": ["onConfigChange"],
|
|
652
|
+
"range": ["onRangeChange"]
|
|
653
|
+
}; }
|
|
654
|
+
};
|
|
655
|
+
NvFieldslider.style = NvFieldsliderStyle0;
|
|
656
|
+
|
|
657
|
+
export { NvFieldslider as nv_fieldslider };
|
|
658
|
+
|
|
659
|
+
//# sourceMappingURL=nv-fieldslider.entry.js.map
|