@nova-design-system/nova-webcomponents 3.0.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/{constants-bcd6b2e2.js → constants-8fb8ccc0.js} +14 -1
- package/dist/cjs/constants-8fb8ccc0.js.map +1 -0
- package/dist/cjs/{index-9bda5507.js → index-108ddff0.js} +22 -6
- package/dist/cjs/index-108ddff0.js.map +1 -0
- package/dist/cjs/index.cjs.js +5 -471
- 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 +6 -6
- package/dist/cjs/nv-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-avatar.cjs.entry.js +2 -2
- package/dist/cjs/nv-badge_2.cjs.entry.js +18 -9
- package/dist/cjs/nv-badge_2.cjs.entry.js.map +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 +2 -2
- package/dist/cjs/nv-calendar.cjs.entry.js +821 -843
- 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 +423 -94
- 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 +19 -13
- package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddate.cjs.entry.js +9 -18
- package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +85 -32
- package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +88 -57
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +122 -104
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +9 -5
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +9 -5
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +4 -4
- package/dist/cjs/nv-fieldselect.cjs.entry.js +11 -7
- 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 +9 -5
- package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +9 -5
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +16 -13
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +4 -4
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +3 -3
- package/dist/cjs/nv-menu.cjs.entry.js +4 -2
- package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
- 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-table.cjs.entry.js.map +1 -1
- 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-alert/nv-alert.css +3 -0
- package/dist/collection/components/nv-alert/nv-alert.js +6 -11
- package/dist/collection/components/nv-alert/nv-alert.js.map +1 -1
- package/dist/collection/components/nv-badge/nv-badge.css +181 -1
- package/dist/collection/components/nv-badge/nv-badge.docs.js +20 -1
- package/dist/collection/components/nv-badge/nv-badge.docs.js.map +1 -1
- package/dist/collection/components/nv-badge/nv-badge.js +39 -15
- package/dist/collection/components/nv-badge/nv-badge.js.map +1 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.css +25 -2
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js +33 -38
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js +659 -897
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js +202 -0
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +667 -0
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +1 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.css +98 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +232 -51
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +437 -160
- 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-dialog/nv-dialog.css +29 -5
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +0 -1
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js +16 -10
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js +16 -8
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +48 -39
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
- package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +14 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js +12 -15
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +147 -68
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +20 -12
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +16 -0
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +197 -103
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +36 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +8 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +228 -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} +36 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +12 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +8 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +27 -3
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +12 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +8 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +27 -3
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +12 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +8 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +29 -5
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -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 +20 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +17 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +28 -3
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +30 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +8 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +27 -3
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +13 -10
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +26 -3
- package/dist/collection/components/nv-icon/nv-icon.js +1 -1
- package/dist/collection/components/nv-icon/nv-icons.js +4 -470
- 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 +3 -1
- package/dist/collection/components/nv-menu/nv-menu.js.map +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 +8 -11
- package/dist/collection/components/nv-table/nv-table.js.map +1 -1
- 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/index.js.map +1 -1
- package/dist/collection/interfaces/Column.js.map +1 -1
- package/dist/collection/templates/navigation.docs.js +0 -1
- package/dist/collection/templates/navigation.docs.js.map +1 -1
- package/dist/collection/utils/constants.js +11 -0
- package/dist/collection/utils/constants.js.map +1 -1
- package/dist/components/index.js +6 -472
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-alert.js +7 -7
- package/dist/components/nv-alert.js.map +1 -1
- package/dist/components/nv-avatar.js +3 -3
- 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 +447 -102
- 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 +24 -18
- package/dist/components/nv-dialog.js.map +1 -1
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-dialogheader.js +1 -1
- package/dist/components/nv-fieldcheckbox.js +1 -1
- package/dist/components/nv-fielddate.js +19 -27
- package/dist/components/nv-fielddate.js.map +1 -1
- package/dist/components/nv-fielddaterange.js +99 -44
- package/dist/components/nv-fielddaterange.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +103 -69
- 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 +139 -120
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +14 -9
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldpassword.js +13 -8
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +4 -4
- package/dist/components/nv-fieldselect.js +15 -10
- 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 -158
- package/dist/components/nv-fieldtext.js.map +1 -1
- package/dist/components/nv-fieldtextarea.js +11 -6
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-fieldtime.js +20 -17
- package/dist/components/nv-fieldtime.js.map +1 -1
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-loader.js +1 -1
- package/dist/components/nv-menu.js +7 -5
- package/dist/components/nv-menu.js.map +1 -1
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +2 -2
- package/dist/components/nv-stack.js +2 -2
- package/dist/components/nv-table.js +3 -3
- package/dist/components/nv-table.js.map +1 -1
- 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-dc3faba3.js → p-04cb3a6f.js} +5 -5
- package/dist/components/{p-dc3faba3.js.map → p-04cb3a6f.js.map} +1 -1
- package/dist/components/p-07a89754.js +187 -0
- package/dist/components/p-07a89754.js.map +1 -0
- package/dist/components/{p-b7b78e64.js → p-0ab80d95.js} +3 -3
- package/dist/components/{p-b7b78e64.js.map → p-0ab80d95.js.map} +1 -1
- package/dist/components/{p-8348db09.js → p-1f505531.js} +15 -2
- package/dist/components/p-1f505531.js.map +1 -0
- 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-4656efae.js +1111 -0
- package/dist/components/p-4656efae.js.map +1 -0
- package/dist/components/{p-2012b8ba.js → p-581e67cc.js} +4 -4
- package/dist/components/{p-2012b8ba.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-150daf68.js → p-83c8873a.js} +3 -3
- package/dist/components/{p-150daf68.js.map → p-83c8873a.js.map} +1 -1
- package/dist/components/{p-c14f6b8e.js → p-c0a91091.js} +5 -5
- package/dist/components/p-c0a91091.js.map +1 -0
- package/dist/components/{p-6c364a23.js → p-cbdc2c8b.js} +6 -6
- package/dist/components/{p-6c364a23.js.map → p-cbdc2c8b.js.map} +1 -1
- package/dist/components/{p-2d9ba7d3.js → p-cbe9521f.js} +4 -4
- package/dist/components/{p-2d9ba7d3.js.map → p-cbe9521f.js.map} +1 -1
- package/dist/components/{p-a30b55fc.js → p-d19b41d2.js} +2 -2
- package/dist/components/{p-a30b55fc.js.map → p-d19b41d2.js.map} +1 -1
- package/dist/components/{p-4d3ec142.js → p-d63f1cbe.js} +4 -4
- package/dist/components/{p-4d3ec142.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-f0a5e7e4.js +167 -0
- package/dist/components/p-f0a5e7e4.js.map +1 -0
- package/dist/components/{p-f4d86795.js → p-f1859ddc.js} +4 -4
- package/dist/components/{p-f4d86795.js.map → p-f1859ddc.js.map} +1 -1
- package/dist/esm/{constants-98e2dcc2.js → constants-b97e736d.js} +15 -2
- package/dist/esm/constants-b97e736d.js.map +1 -0
- package/dist/esm/{index-1fb7a9a6.js → index-8f0e5f19.js} +22 -6
- package/dist/esm/index-8f0e5f19.js.map +1 -0
- package/dist/esm/index.js +5 -471
- 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 +6 -6
- package/dist/esm/nv-alert.entry.js.map +1 -1
- package/dist/esm/nv-avatar.entry.js +2 -2
- package/dist/esm/nv-badge_2.entry.js +18 -9
- package/dist/esm/nv-badge_2.entry.js.map +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 +2 -2
- package/dist/esm/nv-calendar.entry.js +821 -843
- 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 +423 -94
- 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 +19 -13
- package/dist/esm/nv-dialog.entry.js.map +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
- package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
- package/dist/esm/nv-fielddate.entry.js +9 -18
- package/dist/esm/nv-fielddate.entry.js.map +1 -1
- package/dist/esm/nv-fielddaterange.entry.js +85 -32
- package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +88 -57
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +2 -2
- package/dist/esm/nv-fieldmultiselect.entry.js +122 -104
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +9 -5
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +9 -5
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
- package/dist/esm/nv-fieldradio.entry.js +4 -4
- package/dist/esm/nv-fieldselect.entry.js +11 -7
- 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 +9 -5
- package/dist/esm/nv-fieldtext.entry.js.map +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +9 -5
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-fieldtime.entry.js +16 -13
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +4 -4
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton_2.entry.js +3 -3
- package/dist/esm/nv-menu.entry.js +4 -2
- package/dist/esm/nv-menu.entry.js.map +1 -1
- 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-table.entry.js.map +1 -1
- 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-6b348684.entry.js → p-0323daf6.entry.js} +2 -2
- package/dist/native/{p-d5cbf5c8.entry.js → p-05d95d4d.entry.js} +2 -2
- package/dist/native/{p-fb5bddba.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-19fb0fd0.entry.js +2 -0
- package/dist/native/p-19fb0fd0.entry.js.map +1 -0
- 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-21e7132f.entry.js.map +1 -0
- package/dist/native/p-221b8f72.entry.js +2 -0
- package/dist/native/p-221b8f72.entry.js.map +1 -0
- package/dist/native/p-2805f9f2.entry.js +2 -0
- package/dist/native/p-2805f9f2.entry.js.map +1 -0
- 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-63e6aed3.entry.js → p-4c0d81b0.entry.js} +2 -2
- package/dist/native/p-4c0d81b0.entry.js.map +1 -0
- package/dist/native/{p-39bb95ff.entry.js → p-519b4819.entry.js} +2 -2
- package/dist/native/{p-fa77a591.entry.js → p-5382eab2.entry.js} +2 -2
- package/dist/native/p-5ba3fc3c.entry.js +2 -0
- package/dist/native/p-5ba3fc3c.entry.js.map +1 -0
- package/dist/native/{p-bad11367.entry.js → p-60b204ac.entry.js} +2 -2
- package/dist/native/p-60b204ac.entry.js.map +1 -0
- 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-d7a76400.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-f85aca27.entry.js → p-9fba8663.entry.js} +2 -2
- package/dist/native/{p-b094296d.entry.js → p-a2c0f1a7.entry.js} +2 -2
- package/dist/native/p-aa86af25.entry.js +2 -0
- package/dist/native/p-aa86af25.entry.js.map +1 -0
- package/dist/native/p-adc96c3a.entry.js +2 -0
- package/dist/native/p-adc96c3a.entry.js.map +1 -0
- package/dist/native/p-b0fc08e7.entry.js +2 -0
- package/dist/native/p-b0fc08e7.entry.js.map +1 -0
- package/dist/native/{p-6ff228da.entry.js → p-c930adb7.entry.js} +2 -2
- package/dist/native/{p-701b5557.entry.js → p-cfe0a6c6.entry.js} +2 -2
- package/dist/native/p-d07ab618.entry.js +2 -0
- package/dist/native/p-dac0089b.entry.js +2 -0
- package/dist/native/p-dac0089b.entry.js.map +1 -0
- package/dist/native/p-de2c07a6.entry.js +13 -0
- package/dist/native/p-de2c07a6.entry.js.map +1 -0
- package/dist/native/p-ed488498.entry.js +7 -0
- package/dist/native/p-ed488498.entry.js.map +1 -0
- 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-59768ee5.js → p-f85c08f1.js} +2 -2
- package/dist/native/p-f85c08f1.js.map +1 -0
- package/dist/native/p-fb897f7d.entry.js +2 -0
- package/dist/native/p-fb897f7d.entry.js.map +1 -0
- package/dist/native/{p-244f56ac.entry.js → p-fc3bea07.entry.js} +2 -2
- package/dist/types/components/nv-alert/nv-alert.d.ts +1 -1
- package/dist/types/components/nv-badge/nv-badge.d.ts +11 -3
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +70 -112
- package/dist/types/components/nv-calendar/nv-calendar.utils.d.ts +60 -0
- package/dist/types/components/nv-calendar/test/nv-calendar.utils.test.d.ts +1 -0
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +47 -26
- package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.d.ts +4 -0
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +4 -0
- package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +6 -7
- package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +23 -12
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +51 -26
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +65 -55
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +4 -0
- package/dist/types/components/nv-fieldpassword/nv-fieldpassword.d.ts +4 -0
- package/dist/types/components/nv-fieldselect/nv-fieldselect.d.ts +4 -0
- 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 +5 -0
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +4 -0
- package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
- package/dist/types/components/nv-table/nv-table.d.ts +13 -2
- package/dist/types/components.d.ts +656 -154
- package/dist/types/index.d.ts +0 -2
- package/dist/types/interfaces/Column.d.ts +5 -1
- package/dist/types/utils/constants.d.ts +9 -0
- package/dist/vscode-data.json +292 -1546
- package/hydrate/index.js +2715 -1533
- package/hydrate/index.mjs +2715 -1533
- package/package.json +6 -2
- package/dist/cjs/constants-bcd6b2e2.js.map +0 -1
- package/dist/cjs/index-9bda5507.js.map +0 -1
- package/dist/collection/interfaces/actionEvent.js +0 -2
- package/dist/collection/interfaces/actionEvent.js.map +0 -1
- package/dist/collection/interfaces/calendarShortcut.js +0 -2
- package/dist/collection/interfaces/calendarShortcut.js.map +0 -1
- package/dist/collection/interfaces/dateRange.js +0 -2
- package/dist/collection/interfaces/dateRange.js.map +0 -1
- package/dist/components/p-1c45c0f2.js.map +0 -1
- package/dist/components/p-373926aa.js +0 -177
- package/dist/components/p-373926aa.js.map +0 -1
- package/dist/components/p-591730e7.js +0 -88
- package/dist/components/p-591730e7.js.map +0 -1
- package/dist/components/p-8348db09.js.map +0 -1
- package/dist/components/p-c14f6b8e.js.map +0 -1
- package/dist/components/p-f331117c.js +0 -1133
- package/dist/components/p-f331117c.js.map +0 -1
- package/dist/esm/constants-98e2dcc2.js.map +0 -1
- package/dist/esm/index-1fb7a9a6.js.map +0 -1
- package/dist/native/p-0ee428d5.entry.js +0 -2
- package/dist/native/p-0ee428d5.entry.js.map +0 -1
- package/dist/native/p-2691e02d.entry.js +0 -2
- package/dist/native/p-37f0210e.entry.js +0 -2
- package/dist/native/p-37f0210e.entry.js.map +0 -1
- package/dist/native/p-4a440970.entry.js +0 -2
- package/dist/native/p-4a440970.entry.js.map +0 -1
- package/dist/native/p-4ae26462.entry.js +0 -7
- package/dist/native/p-4ae26462.entry.js.map +0 -1
- package/dist/native/p-4d9c4618.entry.js +0 -2
- package/dist/native/p-4d9c4618.entry.js.map +0 -1
- package/dist/native/p-4dc1d036.entry.js +0 -2
- package/dist/native/p-59768ee5.js.map +0 -1
- package/dist/native/p-59e0bd2b.entry.js +0 -2
- package/dist/native/p-59e0bd2b.entry.js.map +0 -1
- package/dist/native/p-5c00f092.entry.js +0 -2
- package/dist/native/p-5c00f092.entry.js.map +0 -1
- package/dist/native/p-63e6aed3.entry.js.map +0 -1
- package/dist/native/p-7f5eb2ac.entry.js +0 -2
- package/dist/native/p-7f5eb2ac.entry.js.map +0 -1
- package/dist/native/p-84a73e2a.entry.js +0 -2
- package/dist/native/p-84a73e2a.entry.js.map +0 -1
- package/dist/native/p-9135fdf5.entry.js +0 -2
- package/dist/native/p-93dc2f47.entry.js +0 -2
- package/dist/native/p-93dc2f47.entry.js.map +0 -1
- package/dist/native/p-9a267f16.entry.js +0 -13
- package/dist/native/p-9a267f16.entry.js.map +0 -1
- package/dist/native/p-9d6431c7.entry.js +0 -2
- package/dist/native/p-9d6431c7.entry.js.map +0 -1
- package/dist/native/p-ab002252.js +0 -3
- package/dist/native/p-ab002252.js.map +0 -1
- package/dist/native/p-b2ce83ad.entry.js +0 -2
- package/dist/native/p-b2ce83ad.entry.js.map +0 -1
- package/dist/native/p-bad11367.entry.js.map +0 -1
- package/dist/native/p-e1a4f776.entry.js +0 -2
- package/dist/native/p-e1a4f776.entry.js.map +0 -1
- package/dist/native/p-e49bbd02.entry.js +0 -2
- package/dist/native/p-e49bbd02.entry.js.map +0 -1
- package/dist/native/p-eee01062.entry.js +0 -2
- package/dist/native/p-eee01062.entry.js.map +0 -1
- package/dist/native/p-f6bdc270.entry.js +0 -2
- package/dist/native/p-f6bdc270.entry.js.map +0 -1
- package/dist/types/interfaces/actionEvent.d.ts +0 -13
- package/dist/types/interfaces/calendarShortcut.d.ts +0 -17
- package/dist/types/interfaces/dateRange.d.ts +0 -13
- /package/dist/native/{p-6b348684.entry.js.map → p-0323daf6.entry.js.map} +0 -0
- /package/dist/native/{p-d5cbf5c8.entry.js.map → p-05d95d4d.entry.js.map} +0 -0
- /package/dist/native/{p-fb5bddba.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-0245863d.entry.js.map → p-407fc32d.entry.js.map} +0 -0
- /package/dist/native/{p-39bb95ff.entry.js.map → p-519b4819.entry.js.map} +0 -0
- /package/dist/native/{p-fa77a591.entry.js.map → p-5382eab2.entry.js.map} +0 -0
- /package/dist/native/{p-2691e02d.entry.js.map → p-7092a675.entry.js.map} +0 -0
- /package/dist/native/{p-d7a76400.entry.js.map → p-7c676f2c.entry.js.map} +0 -0
- /package/dist/native/{p-f85aca27.entry.js.map → p-9fba8663.entry.js.map} +0 -0
- /package/dist/native/{p-b094296d.entry.js.map → p-a2c0f1a7.entry.js.map} +0 -0
- /package/dist/native/{p-6ff228da.entry.js.map → p-c930adb7.entry.js.map} +0 -0
- /package/dist/native/{p-701b5557.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-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,726 @@
|
|
|
1
|
+
import { h, p as proxyCustomElement, H, c as createEvent, d as Host } from './p-679e0fa9.js';
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-76a30bf1.js';
|
|
3
|
+
import { v as v4 } from './p-f5ff676c.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Utility functions for nv-fieldslider.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Clamp a value between min and max.
|
|
10
|
+
* @param {number} value - The value to clamp
|
|
11
|
+
* @param {number} min - The minimum boundary
|
|
12
|
+
* @param {number} max - The maximum boundary
|
|
13
|
+
* @returns {number} The clamped value
|
|
14
|
+
*/
|
|
15
|
+
function clamp(value, min, max) {
|
|
16
|
+
return Math.max(min, Math.min(max, value));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Calculate the percentage position of a value within a range.
|
|
20
|
+
* @param {number} value - The value to convert to percentage
|
|
21
|
+
* @param {number} min - The minimum value of the range
|
|
22
|
+
* @param {number} max - The maximum value of the range
|
|
23
|
+
* @returns {number} The percentage (0-100)
|
|
24
|
+
*/
|
|
25
|
+
function valueToPercent(value, min, max) {
|
|
26
|
+
if (max === min)
|
|
27
|
+
return 0;
|
|
28
|
+
return ((value - min) / (max - min)) * 100;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Snap a value to the nearest step.
|
|
32
|
+
* @param {number} value - The value to snap
|
|
33
|
+
* @param {number} min - The minimum boundary
|
|
34
|
+
* @param {number} max - The maximum boundary
|
|
35
|
+
* @param {number} step - The step size
|
|
36
|
+
* @returns {number} The snapped value
|
|
37
|
+
*/
|
|
38
|
+
function snapToStep(value, min, max, step) {
|
|
39
|
+
const clamped = clamp(value, min, max);
|
|
40
|
+
const snapped = Math.round((clamped - min) / step) * step + min;
|
|
41
|
+
return clamp(snapped, min, max);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Generate tick values for the slider.
|
|
45
|
+
* @param {number} min - The minimum value
|
|
46
|
+
* @param {number} max - The maximum value
|
|
47
|
+
* @param {number} step - The step size
|
|
48
|
+
* @returns {number[]} Array of tick values
|
|
49
|
+
*/
|
|
50
|
+
function generateTicks(min, max, step) {
|
|
51
|
+
const ticks = [];
|
|
52
|
+
for (let v = min; v <= max; v += step) {
|
|
53
|
+
ticks.push(Number(v.toFixed(10))); // avoid floating point issues
|
|
54
|
+
}
|
|
55
|
+
if (ticks[ticks.length - 1] !== max) {
|
|
56
|
+
ticks.push(max);
|
|
57
|
+
}
|
|
58
|
+
return ticks;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Snap a value to the nearest tick mark.
|
|
62
|
+
* @param {number} value - The value to snap
|
|
63
|
+
* @param {object[]} ticks - Array of tick objects
|
|
64
|
+
* @returns {number} The value of the closest tick
|
|
65
|
+
*/
|
|
66
|
+
function snapToTicks(value, ticks) {
|
|
67
|
+
if (!ticks || ticks.length === 0)
|
|
68
|
+
return value;
|
|
69
|
+
// Find the closest tick
|
|
70
|
+
let closestTick = ticks[0].value;
|
|
71
|
+
let minDistance = Math.abs(value - closestTick);
|
|
72
|
+
for (const tick of ticks) {
|
|
73
|
+
const distance = Math.abs(value - tick.value);
|
|
74
|
+
if (distance < minDistance) {
|
|
75
|
+
minDistance = distance;
|
|
76
|
+
closestTick = tick.value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return closestTick;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Renders single thumb in standard mode.
|
|
84
|
+
* @param {SingleThumbProps} props - Component properties
|
|
85
|
+
* @returns {JSX.Element} JSX element representing the thumb
|
|
86
|
+
*/
|
|
87
|
+
const SingleThumb = props => {
|
|
88
|
+
const { value, min, max, rawPosition, isDragging, snap, disabled, readonly, onKeyDown, labelBeforeValue, labelAfterValue, } = props;
|
|
89
|
+
// Use raw position for visual display during dragging, but the snapped value otherwise
|
|
90
|
+
let displayPosition = value;
|
|
91
|
+
if (isDragging && !snap) {
|
|
92
|
+
displayPosition = clamp(rawPosition, min, max);
|
|
93
|
+
}
|
|
94
|
+
const percent = valueToPercent(displayPosition, min, max);
|
|
95
|
+
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 },
|
|
96
|
+
h("div", { class: "thumb-tooltip" },
|
|
97
|
+
labelBeforeValue && (h("span", { class: "label-before" }, labelBeforeValue)),
|
|
98
|
+
String(value),
|
|
99
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Renders dual thumbs in range mode.
|
|
104
|
+
* @param {RangeThumbProps} props - Component properties
|
|
105
|
+
* @returns {JSX.Element[]} Array of JSX elements representing the range slider thumbs
|
|
106
|
+
*/
|
|
107
|
+
const RangeThumb = props => {
|
|
108
|
+
const { rangeValue, rawRangePosition, activeDragThumb, isDragging, snap, min, max, disabled, readonly, onKeyDown, labelBeforeValue, labelAfterValue, } = props;
|
|
109
|
+
const [leftValue, rightValue] = rangeValue;
|
|
110
|
+
// Use raw positions for visual display during dragging, but the snapped values otherwise
|
|
111
|
+
let displayLeftPosition = leftValue;
|
|
112
|
+
let displayRightPosition = rightValue;
|
|
113
|
+
if (isDragging && !snap) {
|
|
114
|
+
const [rawLeft, rawRight] = rawRangePosition;
|
|
115
|
+
if (activeDragThumb === 'left') {
|
|
116
|
+
displayLeftPosition = clamp(rawLeft, min, Math.min(rightValue, max));
|
|
117
|
+
}
|
|
118
|
+
else if (activeDragThumb === 'right') {
|
|
119
|
+
displayRightPosition = clamp(rawRight, Math.max(leftValue, min), max);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const leftPercent = valueToPercent(displayLeftPosition, min, max);
|
|
123
|
+
const rightPercent = valueToPercent(displayRightPosition, min, max);
|
|
124
|
+
return [
|
|
125
|
+
h("div", { class: "track-range", style: {
|
|
126
|
+
left: `${leftPercent}%`,
|
|
127
|
+
width: `${rightPercent - leftPercent}%`,
|
|
128
|
+
} }),
|
|
129
|
+
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 },
|
|
130
|
+
h("div", { class: "thumb-tooltip" },
|
|
131
|
+
labelBeforeValue && (h("span", { class: "label-before" }, labelBeforeValue)),
|
|
132
|
+
String(leftValue),
|
|
133
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))),
|
|
134
|
+
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 },
|
|
135
|
+
h("div", { class: "thumb-tooltip" },
|
|
136
|
+
labelBeforeValue && (h("span", { class: "label-before" }, labelBeforeValue)),
|
|
137
|
+
String(rightValue),
|
|
138
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))),
|
|
139
|
+
];
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Renders tick marks along the slider track.
|
|
144
|
+
* @param {TickMarksProps} props - Component properties
|
|
145
|
+
* @returns {JSX.Element | null} JSX element representing the tick marks or null if no ticks
|
|
146
|
+
*/
|
|
147
|
+
const TickMarks = props => {
|
|
148
|
+
const { ticks, min, max } = props;
|
|
149
|
+
if (ticks.length === 0) {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
return (h("div", { class: "track-ticks" }, ticks.map(tick => {
|
|
153
|
+
const percent = valueToPercent(tick.value, min, max);
|
|
154
|
+
return (h("div", { class: "track-tick", style: { left: `${percent}%` } }, tick.label && h("div", { class: "tick-label" }, tick.label)));
|
|
155
|
+
})));
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Renders field input for direct value entry
|
|
160
|
+
* @param {FieldInputProps} props - Component properties
|
|
161
|
+
* @returns {JSX.Element} JSX element representing the field input
|
|
162
|
+
*/
|
|
163
|
+
const FieldInput = props => {
|
|
164
|
+
const { range, hasField, value, rangeValue, index, inputId, min, max, step, disabled, readonly, onInput, labelBeforeValue, labelAfterValue, name, endName, } = props;
|
|
165
|
+
// Determine the appropriate value based on mode and index
|
|
166
|
+
const fieldValue = range ? rangeValue[index] : value;
|
|
167
|
+
// In range mode, we need data-index for event handling
|
|
168
|
+
const dataAttrs = range ? { 'data-index': index.toString() } : {};
|
|
169
|
+
// Determine the appropriate name based on mode and index
|
|
170
|
+
let inputName;
|
|
171
|
+
if (range) {
|
|
172
|
+
if (index === 0) {
|
|
173
|
+
inputName = name || '';
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
// Use endName if provided, otherwise append "-end" to the name
|
|
177
|
+
inputName = endName || (name ? `${name}-end` : '');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
inputName = name || '';
|
|
182
|
+
}
|
|
183
|
+
// If hasField is false, only the containers are visible, not the input fields
|
|
184
|
+
const containerClass = hasField
|
|
185
|
+
? 'input-container'
|
|
186
|
+
: 'input-container hidden-input';
|
|
187
|
+
return hasField ? (h("div", { class: containerClass },
|
|
188
|
+
labelBeforeValue && h("span", { class: "label-before" }, labelBeforeValue),
|
|
189
|
+
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 })),
|
|
190
|
+
labelAfterValue && h("span", { class: "label-after" }, labelAfterValue))) : (h("input", { id: inputId, type: "hidden", value: fieldValue, disabled: disabled, readonly: readonly, name: inputName }));
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
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}";
|
|
194
|
+
const NvFieldsliderStyle0 = nvFieldsliderCss;
|
|
195
|
+
|
|
196
|
+
const NvFieldslider$1 = /*@__PURE__*/ proxyCustomElement(class NvFieldslider extends H {
|
|
197
|
+
constructor() {
|
|
198
|
+
super();
|
|
199
|
+
this.__registerHost();
|
|
200
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
201
|
+
/****************************************************************************/
|
|
202
|
+
//#region PROPERTIES
|
|
203
|
+
/**
|
|
204
|
+
* Sets the ID for the start input element and the for attribute of the associated
|
|
205
|
+
* label. If no ID is provided, a random one will be automatically generated.
|
|
206
|
+
*/
|
|
207
|
+
this.startInputId = v4();
|
|
208
|
+
/**
|
|
209
|
+
* Sets the ID for the end input element and the for attribute of the associated
|
|
210
|
+
* label. If no ID is provided, a random one will be automatically generated.
|
|
211
|
+
*/
|
|
212
|
+
this.endInputId = v4();
|
|
213
|
+
/**
|
|
214
|
+
* Keeps the interface clean by removing visible labels, but still announces
|
|
215
|
+
* the label to screen readers so users relying on assistive tech aren't left
|
|
216
|
+
* guessing.
|
|
217
|
+
*/
|
|
218
|
+
this.hideLabel = false;
|
|
219
|
+
/**
|
|
220
|
+
* Enables an optional numeric input field alongside the slider, allowing
|
|
221
|
+
* users to type a value directly instead of—or in addition to—using the
|
|
222
|
+
* slider handle.
|
|
223
|
+
*/
|
|
224
|
+
this.hasField = false;
|
|
225
|
+
/**
|
|
226
|
+
* Allows the slider to display two thumbs, enabling users to select a
|
|
227
|
+
* continuous range between a minimum and maximum value. Ideal for use cases
|
|
228
|
+
* like filtering by price or time.
|
|
229
|
+
*/
|
|
230
|
+
this.range = false;
|
|
231
|
+
/**
|
|
232
|
+
* Disables user interaction with the slider and its associated input fields.
|
|
233
|
+
*/
|
|
234
|
+
this.disabled = false;
|
|
235
|
+
/**
|
|
236
|
+
* Makes the slider and input non-editable while keeping them focusable and
|
|
237
|
+
* included in form submissions.
|
|
238
|
+
*/
|
|
239
|
+
this.readonly = false;
|
|
240
|
+
/**
|
|
241
|
+
* Alters the slider's appearance to indicate an error, helping users
|
|
242
|
+
* identify fields that need correction.
|
|
243
|
+
* @validator error
|
|
244
|
+
*/
|
|
245
|
+
this.error = false;
|
|
246
|
+
/**
|
|
247
|
+
* Changes the slider's appearance to indicate successful input or validation.
|
|
248
|
+
*/
|
|
249
|
+
this.success = false;
|
|
250
|
+
/**
|
|
251
|
+
* Numeric value of the slider as a string, if range mode is on, the values
|
|
252
|
+
* will be a comma-separated string.
|
|
253
|
+
*/
|
|
254
|
+
this.value = '0';
|
|
255
|
+
/**
|
|
256
|
+
* Defines the interval between selectable values on the slider. Controls how
|
|
257
|
+
* much the value increases or decreases with each keyboard interaction, drag
|
|
258
|
+
* movement, or direct input.
|
|
259
|
+
*/
|
|
260
|
+
this.step = 1;
|
|
261
|
+
/**
|
|
262
|
+
* Controls whether the slider handle should visually snap to step values
|
|
263
|
+
* during dragging. When false, the handle can be positioned at any point
|
|
264
|
+
* along the track while dragging, but the actual value will still snap to the
|
|
265
|
+
* nearest step value. When true, the handle will visually snap to the nearest
|
|
266
|
+
* step value during dragging.
|
|
267
|
+
*/
|
|
268
|
+
this.snap = false;
|
|
269
|
+
/**
|
|
270
|
+
* When true and custom ticks are provided, the slider will snap to the nearest
|
|
271
|
+
* tick value during dragging, instead of using the step value. This is useful
|
|
272
|
+
* when you have custom ticks at specific values that don't align with regular step intervals.
|
|
273
|
+
*/
|
|
274
|
+
this.snapTicks = false;
|
|
275
|
+
/**
|
|
276
|
+
* Defines the minimum allowed value for the slider. The thumb cannot move
|
|
277
|
+
* below this value, and manual input is also constrained accordingly.
|
|
278
|
+
*/
|
|
279
|
+
this.min = 0;
|
|
280
|
+
/**
|
|
281
|
+
* Defines the maximum allowed value for the slider. The thumb cannot move
|
|
282
|
+
* above this value, and manual input is also constrained accordingly.
|
|
283
|
+
*/
|
|
284
|
+
this.max = 100;
|
|
285
|
+
/**
|
|
286
|
+
* Controls the visibility of tick marks on the slider. When enabled, all
|
|
287
|
+
* visual ticks that indicate step points along the track are shown. If custom
|
|
288
|
+
* ticks are provided, they are always shown regardless of this setting.
|
|
289
|
+
*/
|
|
290
|
+
this.showTicks = false;
|
|
291
|
+
/**
|
|
292
|
+
* Allows the field to stretch and fill the entire width of its container.
|
|
293
|
+
*/
|
|
294
|
+
this.fluid = false;
|
|
295
|
+
//#endregion PROPERTIES
|
|
296
|
+
/****************************************************************************/
|
|
297
|
+
//#region STATE
|
|
298
|
+
this.isDragging = false;
|
|
299
|
+
this.activeDragThumb = 'single';
|
|
300
|
+
this.internalTicks = [];
|
|
301
|
+
// These track the raw slider positions for visual display
|
|
302
|
+
this.rawPosition = 0;
|
|
303
|
+
this.rawRangePosition = [0, 0];
|
|
304
|
+
this.valueInternal = 0;
|
|
305
|
+
this.rangeValueInternal = [0, 0];
|
|
306
|
+
/**
|
|
307
|
+
* Parses the value string into a number or array of numbers for internal use.
|
|
308
|
+
*/
|
|
309
|
+
this.parseValue = () => {
|
|
310
|
+
const values = this.value.replace(/\s/g, '').split(',');
|
|
311
|
+
if (values.length === 1) {
|
|
312
|
+
this.valueInternal = parseFloat(values[0]);
|
|
313
|
+
}
|
|
314
|
+
else if (values.length === 2) {
|
|
315
|
+
values.forEach((value, index) => {
|
|
316
|
+
this.valueInternal = parseFloat(value);
|
|
317
|
+
this.rangeValueInternal[index] = this.valueInternal;
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Handles pointer events on the track.
|
|
323
|
+
* @param {PointerEvent} event - The pointer event
|
|
324
|
+
*/
|
|
325
|
+
this.onTrackInteraction = (event) => {
|
|
326
|
+
if (this.disabled || this.readonly) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const trackRect = event.currentTarget.getBoundingClientRect();
|
|
330
|
+
const percentage = clamp(((event.clientX - trackRect.left) / trackRect.width) * 100, 0, 100);
|
|
331
|
+
const newValue = this.min + (percentage / 100) * (this.max - this.min);
|
|
332
|
+
// Store raw position for visual display
|
|
333
|
+
this.rawPosition = newValue;
|
|
334
|
+
if (this.range) {
|
|
335
|
+
// In range mode, determine which thumb to move based on proximity
|
|
336
|
+
const leftPct = valueToPercent(this.rangeValueInternal[0], this.min, this.max);
|
|
337
|
+
const rightPct = valueToPercent(this.rangeValueInternal[1], this.min, this.max);
|
|
338
|
+
const distanceToLeft = Math.abs(percentage - leftPct);
|
|
339
|
+
const distanceToRight = Math.abs(percentage - rightPct);
|
|
340
|
+
if (distanceToLeft <= distanceToRight) {
|
|
341
|
+
this.activeDragThumb = 'left';
|
|
342
|
+
this.rawRangePosition = [newValue, this.rawRangePosition[1]];
|
|
343
|
+
this.handleValueChange([newValue, this.rangeValueInternal[1]]);
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
this.activeDragThumb = 'right';
|
|
347
|
+
this.rawRangePosition = [this.rawRangePosition[0], newValue];
|
|
348
|
+
this.handleValueChange([this.rangeValueInternal[0], newValue]);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
this.activeDragThumb = 'single';
|
|
353
|
+
this.rawPosition = newValue;
|
|
354
|
+
this.handleValueChange(newValue);
|
|
355
|
+
}
|
|
356
|
+
this.isDragging = true;
|
|
357
|
+
this.registerGlobalEvents();
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* Handles pointer move events during drag.
|
|
361
|
+
* @param {PointerEvent} event - The pointer event
|
|
362
|
+
*/
|
|
363
|
+
this.onPointerMove = (event) => {
|
|
364
|
+
if (!this.isDragging || this.disabled || this.readonly) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const trackElement = this.el.querySelector('.track');
|
|
368
|
+
if (!trackElement)
|
|
369
|
+
return;
|
|
370
|
+
const trackRect = trackElement.getBoundingClientRect();
|
|
371
|
+
const percentage = clamp(((event.clientX - trackRect.left) / trackRect.width) * 100, 0, 100);
|
|
372
|
+
const newValue = this.min + (percentage / 100) * (this.max - this.min);
|
|
373
|
+
// Update visual position
|
|
374
|
+
if (this.range) {
|
|
375
|
+
if (this.activeDragThumb === 'left') {
|
|
376
|
+
this.rawRangePosition = [newValue, this.rawRangePosition[1]];
|
|
377
|
+
this.handleValueChange([newValue, this.rangeValueInternal[1]]);
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
this.rawRangePosition = [this.rawRangePosition[0], newValue];
|
|
381
|
+
this.handleValueChange([this.rangeValueInternal[0], newValue]);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
this.rawPosition = newValue;
|
|
386
|
+
this.handleValueChange(newValue);
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Handles the end of a drag operation.
|
|
391
|
+
*/
|
|
392
|
+
this.onPointerUp = () => {
|
|
393
|
+
this.isDragging = false;
|
|
394
|
+
this.removeGlobalEvents();
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Handles keydown events for keyboard accessibility.
|
|
398
|
+
* @param {KeyboardEvent} event - The keyboard event
|
|
399
|
+
*/
|
|
400
|
+
this.onKeyDown = (event) => {
|
|
401
|
+
if (this.disabled || this.readonly) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
let newValue;
|
|
405
|
+
const stepMultiplier = event.shiftKey ? 10 : 1;
|
|
406
|
+
const singleStep = this.step * stepMultiplier;
|
|
407
|
+
if (this.range) {
|
|
408
|
+
const focusedThumb = event.target.getAttribute('data-thumb');
|
|
409
|
+
const idx = focusedThumb === 'left' ? 0 : 1;
|
|
410
|
+
const currentValue = [...this.rangeValueInternal];
|
|
411
|
+
switch (event.key) {
|
|
412
|
+
case 'ArrowRight':
|
|
413
|
+
case 'ArrowUp':
|
|
414
|
+
currentValue[idx] += singleStep;
|
|
415
|
+
break;
|
|
416
|
+
case 'ArrowLeft':
|
|
417
|
+
case 'ArrowDown':
|
|
418
|
+
currentValue[idx] -= singleStep;
|
|
419
|
+
break;
|
|
420
|
+
case 'Home':
|
|
421
|
+
currentValue[idx] = this.min;
|
|
422
|
+
break;
|
|
423
|
+
case 'End':
|
|
424
|
+
currentValue[idx] = this.max;
|
|
425
|
+
break;
|
|
426
|
+
case 'PageUp':
|
|
427
|
+
currentValue[idx] += singleStep * 10;
|
|
428
|
+
break;
|
|
429
|
+
case 'PageDown':
|
|
430
|
+
currentValue[idx] -= singleStep * 10;
|
|
431
|
+
break;
|
|
432
|
+
default:
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
newValue = currentValue;
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
switch (event.key) {
|
|
439
|
+
case 'ArrowRight':
|
|
440
|
+
case 'ArrowUp':
|
|
441
|
+
newValue = this.valueInternal + singleStep;
|
|
442
|
+
break;
|
|
443
|
+
case 'ArrowLeft':
|
|
444
|
+
case 'ArrowDown':
|
|
445
|
+
newValue = this.valueInternal - singleStep;
|
|
446
|
+
break;
|
|
447
|
+
case 'Home':
|
|
448
|
+
newValue = this.min;
|
|
449
|
+
break;
|
|
450
|
+
case 'End':
|
|
451
|
+
newValue = this.max;
|
|
452
|
+
break;
|
|
453
|
+
case 'PageUp':
|
|
454
|
+
newValue = this.valueInternal + singleStep * 10;
|
|
455
|
+
break;
|
|
456
|
+
case 'PageDown':
|
|
457
|
+
newValue = this.valueInternal - singleStep * 10;
|
|
458
|
+
break;
|
|
459
|
+
default:
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
this.handleValueChange(newValue);
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* Handles field input value changes.
|
|
468
|
+
* @param {Event} event - The input event
|
|
469
|
+
*/
|
|
470
|
+
this.handleFieldChange = (event) => {
|
|
471
|
+
const input = event.target;
|
|
472
|
+
const newValue = parseFloat(input.value);
|
|
473
|
+
if (isNaN(newValue)) {
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (this.range) {
|
|
477
|
+
const fieldIndex = input.getAttribute('data-index') === '0' ? 0 : 1;
|
|
478
|
+
const updatedRange = [...this.rangeValueInternal];
|
|
479
|
+
updatedRange[fieldIndex] = newValue;
|
|
480
|
+
this.handleValueChange(updatedRange);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
this.handleValueChange(newValue);
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
//#endregion STATE
|
|
488
|
+
/****************************************************************************/
|
|
489
|
+
//#region METHODS
|
|
490
|
+
/**
|
|
491
|
+
* Ensures value is valid and within bounds.
|
|
492
|
+
* @param {number} val - The value to validate
|
|
493
|
+
* @returns {number} The validated and snapped value
|
|
494
|
+
*/
|
|
495
|
+
validateValue(val) {
|
|
496
|
+
// First ensure the value is within bounds
|
|
497
|
+
const clampedValue = clamp(val, this.min, this.max);
|
|
498
|
+
// If snapTicks is true and we have custom ticks, snap to the nearest tick
|
|
499
|
+
if (this.snapTicks && this.internalTicks && this.internalTicks.length > 0) {
|
|
500
|
+
return snapToTicks(clampedValue, this.internalTicks);
|
|
501
|
+
}
|
|
502
|
+
// Otherwise snap to step values
|
|
503
|
+
return snapToStep(clampedValue, this.min, this.max, this.step);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Handles value changes from slider interaction.
|
|
507
|
+
* @param {number | number[]} newValue - The new value or range values
|
|
508
|
+
*/
|
|
509
|
+
handleValueChange(newValue) {
|
|
510
|
+
if (this.disabled || this.readonly) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if (this.range) {
|
|
514
|
+
// Handle range values
|
|
515
|
+
if (Array.isArray(newValue) && newValue.length === 2) {
|
|
516
|
+
// Ensure values are in order (left ≤ right)
|
|
517
|
+
const orderedValues = [
|
|
518
|
+
Math.min(newValue[0], newValue[1]),
|
|
519
|
+
Math.max(newValue[0], newValue[1]),
|
|
520
|
+
];
|
|
521
|
+
// Snap to steps and clamp
|
|
522
|
+
const validatedValues = [
|
|
523
|
+
this.validateValue(orderedValues[0]),
|
|
524
|
+
this.validateValue(orderedValues[1]),
|
|
525
|
+
];
|
|
526
|
+
if (validatedValues[0] !== this.rangeValueInternal[0] ||
|
|
527
|
+
validatedValues[1] !== this.rangeValueInternal[1]) {
|
|
528
|
+
this.rangeValueInternal = validatedValues;
|
|
529
|
+
this.value = this.rangeValueInternal.join(',');
|
|
530
|
+
this.valueChanged.emit(this.rangeValueInternal.join(','));
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
// Handle single value
|
|
536
|
+
if (typeof newValue === 'number') {
|
|
537
|
+
const validatedValue = this.validateValue(newValue);
|
|
538
|
+
if (validatedValue !== this.valueInternal) {
|
|
539
|
+
this.valueInternal = validatedValue;
|
|
540
|
+
this.value = String(this.valueInternal);
|
|
541
|
+
this.valueChanged.emit(String(this.valueInternal));
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Generates the ticks to display based on props and state.
|
|
548
|
+
*/
|
|
549
|
+
generateDisplayTicks() {
|
|
550
|
+
// If custom ticks are provided, always use them regardless of showTicks setting
|
|
551
|
+
if (this.ticks && this.ticks.length > 0) {
|
|
552
|
+
this.internalTicks = [...this.ticks].sort((a, b) => a.value - b.value);
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
// If showTicks is false and there are no custom ticks, hide all ticks
|
|
556
|
+
if (!this.showTicks) {
|
|
557
|
+
this.internalTicks = [];
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
// Generate all ticks at each step point
|
|
561
|
+
const autoTicks = generateTicks(this.min, this.max, this.step);
|
|
562
|
+
this.internalTicks = autoTicks.map(value => ({ value }));
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Registers global events for tracking pointer movement.
|
|
566
|
+
*/
|
|
567
|
+
registerGlobalEvents() {
|
|
568
|
+
document.addEventListener('pointermove', this.onPointerMove);
|
|
569
|
+
document.addEventListener('pointerup', this.onPointerUp);
|
|
570
|
+
document.addEventListener('pointercancel', this.onPointerUp);
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Removes global events when tracking ends.
|
|
574
|
+
*/
|
|
575
|
+
removeGlobalEvents() {
|
|
576
|
+
document.removeEventListener('pointermove', this.onPointerMove);
|
|
577
|
+
document.removeEventListener('pointerup', this.onPointerUp);
|
|
578
|
+
document.removeEventListener('pointercancel', this.onPointerUp);
|
|
579
|
+
}
|
|
580
|
+
//#endregion METHODS
|
|
581
|
+
/****************************************************************************/
|
|
582
|
+
//#region WATCHERS
|
|
583
|
+
onValueChange() {
|
|
584
|
+
this.parseValue();
|
|
585
|
+
}
|
|
586
|
+
onConfigChange() {
|
|
587
|
+
this.generateDisplayTicks();
|
|
588
|
+
if (this.range) {
|
|
589
|
+
this.handleValueChange(this.rangeValueInternal);
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
this.handleValueChange(this.valueInternal);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
onRangeChange(newValue) {
|
|
596
|
+
if (newValue) {
|
|
597
|
+
// Switching to range mode
|
|
598
|
+
this.rangeValueInternal = [this.min, this.valueInternal];
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
// Switching to single mode, take the higher value
|
|
602
|
+
this.valueInternal = this.rangeValueInternal[1];
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
//#endregion WATCHERS
|
|
606
|
+
/****************************************************************************/
|
|
607
|
+
//#region LIFECYCLE
|
|
608
|
+
connectedCallback() {
|
|
609
|
+
this.parseValue();
|
|
610
|
+
this.generateDisplayTicks();
|
|
611
|
+
// Initialize values and make sure they're valid
|
|
612
|
+
if (this.range) {
|
|
613
|
+
if (!Array.isArray(this.rangeValueInternal) ||
|
|
614
|
+
this.rangeValueInternal.length !== 2) {
|
|
615
|
+
this.rangeValueInternal = [this.min, this.max];
|
|
616
|
+
}
|
|
617
|
+
this.handleValueChange(this.rangeValueInternal);
|
|
618
|
+
// Initialize raw range position to match actual values
|
|
619
|
+
this.rawRangePosition = [
|
|
620
|
+
this.rangeValueInternal[0],
|
|
621
|
+
this.rangeValueInternal[1],
|
|
622
|
+
];
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
this.handleValueChange(this.valueInternal);
|
|
626
|
+
// Initialize raw position to match actual value
|
|
627
|
+
this.rawPosition = this.valueInternal;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
disconnectedCallback() {
|
|
631
|
+
this.removeGlobalEvents();
|
|
632
|
+
}
|
|
633
|
+
//#endregion EVENTS
|
|
634
|
+
/****************************************************************************/
|
|
635
|
+
//#region RENDER
|
|
636
|
+
render() {
|
|
637
|
+
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 ||
|
|
638
|
+
this.description ||
|
|
639
|
+
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 ||
|
|
640
|
+
this.errorDescription ||
|
|
641
|
+
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)))));
|
|
642
|
+
}
|
|
643
|
+
static get formAssociated() { return true; }
|
|
644
|
+
get el() { return this; }
|
|
645
|
+
static get watchers() { return {
|
|
646
|
+
"value": ["onValueChange"],
|
|
647
|
+
"min": ["onConfigChange"],
|
|
648
|
+
"max": ["onConfigChange"],
|
|
649
|
+
"step": ["onConfigChange"],
|
|
650
|
+
"ticks": ["onConfigChange"],
|
|
651
|
+
"showTicks": ["onConfigChange"],
|
|
652
|
+
"snap": ["onConfigChange"],
|
|
653
|
+
"snapTicks": ["onConfigChange"],
|
|
654
|
+
"range": ["onRangeChange"]
|
|
655
|
+
}; }
|
|
656
|
+
static get style() { return NvFieldsliderStyle0; }
|
|
657
|
+
}, [68, "nv-fieldslider", {
|
|
658
|
+
"startInputId": [513, "start-input-id"],
|
|
659
|
+
"endInputId": [513, "end-input-id"],
|
|
660
|
+
"label": [513],
|
|
661
|
+
"hideLabel": [516, "hide-label"],
|
|
662
|
+
"description": [513],
|
|
663
|
+
"hasField": [516, "has-field"],
|
|
664
|
+
"range": [516],
|
|
665
|
+
"disabled": [516],
|
|
666
|
+
"readonly": [516],
|
|
667
|
+
"error": [516],
|
|
668
|
+
"errorDescription": [513, "error-description"],
|
|
669
|
+
"success": [516],
|
|
670
|
+
"value": [1537],
|
|
671
|
+
"step": [514],
|
|
672
|
+
"snap": [516],
|
|
673
|
+
"snapTicks": [516, "snap-ticks"],
|
|
674
|
+
"name": [513],
|
|
675
|
+
"endName": [513, "end-name"],
|
|
676
|
+
"min": [514],
|
|
677
|
+
"max": [514],
|
|
678
|
+
"showTicks": [516, "show-ticks"],
|
|
679
|
+
"ticks": [16],
|
|
680
|
+
"fluid": [516],
|
|
681
|
+
"labelBeforeValue": [513, "label-before-value"],
|
|
682
|
+
"labelAfterValue": [513, "label-after-value"],
|
|
683
|
+
"isDragging": [32],
|
|
684
|
+
"activeDragThumb": [32],
|
|
685
|
+
"internalTicks": [32],
|
|
686
|
+
"rawPosition": [32],
|
|
687
|
+
"rawRangePosition": [32],
|
|
688
|
+
"valueInternal": [32],
|
|
689
|
+
"rangeValueInternal": [32]
|
|
690
|
+
}, undefined, {
|
|
691
|
+
"value": ["onValueChange"],
|
|
692
|
+
"min": ["onConfigChange"],
|
|
693
|
+
"max": ["onConfigChange"],
|
|
694
|
+
"step": ["onConfigChange"],
|
|
695
|
+
"ticks": ["onConfigChange"],
|
|
696
|
+
"showTicks": ["onConfigChange"],
|
|
697
|
+
"snap": ["onConfigChange"],
|
|
698
|
+
"snapTicks": ["onConfigChange"],
|
|
699
|
+
"range": ["onRangeChange"]
|
|
700
|
+
}]);
|
|
701
|
+
function defineCustomElement$1() {
|
|
702
|
+
if (typeof customElements === "undefined") {
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
const components = ["nv-fieldslider", "nv-icon"];
|
|
706
|
+
components.forEach(tagName => { switch (tagName) {
|
|
707
|
+
case "nv-fieldslider":
|
|
708
|
+
if (!customElements.get(tagName)) {
|
|
709
|
+
customElements.define(tagName, NvFieldslider$1);
|
|
710
|
+
}
|
|
711
|
+
break;
|
|
712
|
+
case "nv-icon":
|
|
713
|
+
if (!customElements.get(tagName)) {
|
|
714
|
+
defineCustomElement$2();
|
|
715
|
+
}
|
|
716
|
+
break;
|
|
717
|
+
} });
|
|
718
|
+
}
|
|
719
|
+
defineCustomElement$1();
|
|
720
|
+
|
|
721
|
+
const NvFieldslider = NvFieldslider$1;
|
|
722
|
+
const defineCustomElement = defineCustomElement$1;
|
|
723
|
+
|
|
724
|
+
export { NvFieldslider, defineCustomElement };
|
|
725
|
+
|
|
726
|
+
//# sourceMappingURL=nv-fieldslider.js.map
|