@nova-design-system/nova-webcomponents 3.1.0 → 3.3.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-c56424e5.js} +34 -186
- package/dist/cjs/index-c56424e5.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 -23
- package/dist/cjs/native.cjs.js.map +1 -1
- 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 +384 -172
- 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 +45 -11
- package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +128 -42
- 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 +668 -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 +247 -169
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js +12 -3
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +1 -1
- package/dist/collection/components/nv-calendar/partials/calendar-actions.js +11 -0
- package/dist/collection/components/nv-calendar/partials/calendar-actions.js.map +1 -0
- package/dist/collection/components/nv-calendar/partials/calendar-grid.js +24 -0
- package/dist/collection/components/nv-calendar/partials/calendar-grid.js.map +1 -0
- package/dist/collection/components/nv-calendar/partials/calendar-header.js +38 -0
- package/dist/collection/components/nv-calendar/partials/calendar-header.js.map +1 -0
- package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js +22 -0
- package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js.map +1 -0
- package/dist/collection/components/nv-calendar/partials/day-cell.js +31 -0
- package/dist/collection/components/nv-calendar/partials/day-cell.js.map +1 -0
- package/dist/collection/components/nv-calendar/partials/index.js +7 -0
- package/dist/collection/components/nv-calendar/partials/index.js.map +1 -0
- package/dist/collection/components/nv-calendar/partials/week-numbers.js +36 -0
- package/dist/collection/components/nv-calendar/partials/week-numbers.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +692 -651
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +1 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js +169 -0
- package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js +262 -0
- package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js +208 -0
- package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js +355 -0
- package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js +250 -0
- package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js.map +1 -0
- package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js +217 -0
- package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js.map +1 -0
- 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/nv-fielddate.js +56 -16
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
- package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +51 -1
- package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js +196 -0
- package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js.map +1 -0
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +165 -41
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +51 -1
- package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js +137 -0
- package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js.map +1 -0
- 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 +77 -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} +61 -4
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +51 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +51 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +51 -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 +1036 -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 +338 -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 +59 -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 +45 -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 +51 -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 +53 -25
- package/dist/components/nv-fielddate.js.map +1 -1
- package/dist/components/nv-fielddaterange.js +137 -57
- 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 +731 -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-eb632278.js → p-2ae214d2.js} +3 -3
- package/dist/components/{p-eb632278.js.map → p-2ae214d2.js.map} +1 -1
- package/dist/components/{p-f76bb0c3.js → p-3e32b5a1.js} +5 -5
- package/dist/components/p-3e32b5a1.js.map +1 -0
- package/dist/components/{p-854c32dc.js → p-5e90b9b8.js} +389 -199
- package/dist/components/p-5e90b9b8.js.map +1 -0
- package/dist/components/{p-a2527411.js → p-5ee4015d.js} +3 -3
- package/dist/components/{p-a2527411.js.map → p-5ee4015d.js.map} +1 -1
- package/dist/components/{p-02752770.js → p-6277f746.js} +2 -2
- package/dist/components/{p-02752770.js.map → p-6277f746.js.map} +1 -1
- package/dist/components/p-7935c1cb.js +167 -0
- package/dist/components/p-7935c1cb.js.map +1 -0
- package/dist/components/{p-b48d5a94.js → p-8d92f0e1.js} +4 -4
- package/dist/components/{p-b48d5a94.js.map → p-8d92f0e1.js.map} +1 -1
- package/dist/components/{p-41c56ddc.js → p-95a7581c.js} +5 -5
- package/dist/components/{p-41c56ddc.js.map → p-95a7581c.js.map} +1 -1
- package/dist/components/{p-e00cbb8a.js → p-9e6e26cb.js} +2 -2
- package/dist/components/{p-e00cbb8a.js.map → p-9e6e26cb.js.map} +1 -1
- package/dist/components/p-9fa0de38.js +88 -0
- package/dist/components/p-9fa0de38.js.map +1 -0
- package/dist/components/{p-1c45c0f2.js → p-aff3ed68.js} +24 -177
- package/dist/components/p-aff3ed68.js.map +1 -0
- package/dist/components/{p-608eb9da.js → p-b6d858b2.js} +2 -2
- package/dist/components/{p-608eb9da.js.map → p-b6d858b2.js.map} +1 -1
- package/dist/components/{p-f5cb0a63.js → p-bb6d1e4e.js} +3 -3
- package/dist/components/{p-f5cb0a63.js.map → p-bb6d1e4e.js.map} +1 -1
- package/dist/components/{p-35a70c5e.js → p-c07c32d2.js} +3 -3
- package/dist/components/{p-35a70c5e.js.map → p-c07c32d2.js.map} +1 -1
- package/dist/components/{p-10faa938.js → p-c9006520.js} +5 -5
- package/dist/components/{p-10faa938.js.map → p-c9006520.js.map} +1 -1
- package/dist/components/{p-0a0f6daf.js → p-e28c4707.js} +3 -3
- package/dist/components/{p-0a0f6daf.js.map → p-e28c4707.js.map} +1 -1
- package/dist/components/{p-10b37876.js → p-eabbc885.js} +3 -3
- package/dist/components/{p-10b37876.js.map → p-eabbc885.js.map} +1 -1
- package/dist/esm/{constants-b97e736d.js → constants-4faa1fae.js} +2 -2
- package/dist/esm/{constants-b97e736d.js.map → constants-4faa1fae.js.map} +1 -1
- package/dist/esm/{index-1fb7a9a6.js → index-a1936cd0.js} +35 -186
- package/dist/esm/index-a1936cd0.js.map +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/native.js +3 -24
- package/dist/esm/native.js.map +1 -1
- package/dist/esm/nv-alert.entry.js +2 -2
- package/dist/esm/nv-avatar.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/nv-calendar.entry.js +385 -173
- 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 +96 -104
- 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 +2 -2
- 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 +45 -11
- package/dist/esm/nv-fielddate.entry.js.map +1 -1
- package/dist/esm/nv-fielddaterange.entry.js +128 -42
- 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 +664 -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 +12 -12
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +4 -4
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton_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-050d6c6c.entry.js +2 -0
- package/dist/native/{p-4d164ed6.entry.js.map → p-050d6c6c.entry.js.map} +1 -1
- package/dist/native/{p-615947e7.entry.js → p-08ca678c.entry.js} +2 -2
- package/dist/native/p-1a5d3b87.entry.js +2 -0
- package/dist/native/{p-efe6a46c.entry.js.map → p-1a5d3b87.entry.js.map} +1 -1
- package/dist/native/{p-7fd4d13d.entry.js → p-1c1ecd38.entry.js} +2 -2
- package/dist/native/{p-c7b201cd.entry.js → p-1d98477d.entry.js} +2 -2
- package/dist/native/{p-1da72182.entry.js → p-2006f5d4.entry.js} +2 -2
- package/dist/native/p-26cf4938.entry.js +2 -0
- package/dist/native/p-26cf4938.entry.js.map +1 -0
- package/dist/native/p-3817efb2.entry.js +2 -0
- package/dist/native/{p-fc97f071.entry.js.map → p-3817efb2.entry.js.map} +1 -1
- package/dist/native/p-45459dbb.entry.js +2 -0
- package/dist/native/{p-7042ba8a.entry.js.map → p-45459dbb.entry.js.map} +1 -1
- package/dist/native/p-45cbe6e4.entry.js +2 -0
- package/dist/native/{p-9135fdf5.entry.js.map → p-45cbe6e4.entry.js.map} +1 -1
- package/dist/native/p-46428304.entry.js +2 -0
- package/dist/native/p-46428304.entry.js.map +1 -0
- package/dist/native/p-4f9cdf0b.entry.js +2 -0
- package/dist/native/{p-3b7ef609.entry.js → p-58bb90ad.entry.js} +2 -2
- package/dist/native/p-59b07b36.entry.js +2 -0
- package/dist/native/p-59b07b36.entry.js.map +1 -0
- package/dist/native/{p-3cd77d82.entry.js → p-5b6c59e0.entry.js} +2 -2
- package/dist/native/p-6029e51b.entry.js +2 -0
- package/dist/native/{p-244f56ac.entry.js.map → p-6029e51b.entry.js.map} +1 -1
- package/dist/native/{p-08a75cfa.entry.js → p-60c64f2b.entry.js} +2 -2
- package/dist/native/p-64a76565.entry.js +2 -0
- package/dist/native/p-64a76565.entry.js.map +1 -0
- package/dist/native/{p-c67186f8.entry.js → p-83288db0.entry.js} +2 -2
- package/dist/native/p-838f7842.entry.js +2 -0
- package/dist/native/p-838f7842.entry.js.map +1 -0
- package/dist/native/{p-0245863d.entry.js → p-86ab23ea.entry.js} +2 -2
- package/dist/native/p-87784622.entry.js +2 -0
- package/dist/native/p-8fb4e5c0.entry.js +2 -0
- package/dist/native/{p-b94d9f0b.entry.js.map → p-8fb4e5c0.entry.js.map} +1 -1
- package/dist/native/{p-14c07207.entry.js → p-914da1e1.entry.js} +2 -2
- package/dist/native/p-abbe5d69.entry.js +2 -0
- package/dist/native/p-abbe5d69.entry.js.map +1 -0
- package/dist/native/p-abc251aa.entry.js +2 -0
- package/dist/native/p-abc251aa.entry.js.map +1 -0
- package/dist/native/{p-c0f79bac.entry.js → p-ad128108.entry.js} +2 -2
- package/dist/native/{p-e5de64d5.entry.js → p-b5b9190a.entry.js} +2 -2
- package/dist/native/{p-470588c2.entry.js → p-b8f2c1e7.entry.js} +3 -3
- package/dist/native/p-b8f2c1e7.entry.js.map +1 -0
- package/dist/native/{p-b8b6875d.entry.js → p-d040bd61.entry.js} +2 -2
- package/dist/native/p-d0a33e64.js +3 -0
- package/dist/native/p-d0a33e64.js.map +1 -0
- package/dist/native/{p-3953464e.entry.js → p-d21b2da2.entry.js} +3 -3
- package/dist/native/{p-90e6d9dd.entry.js → p-d53e8795.entry.js} +2 -2
- package/dist/native/p-dc7dd7f3.entry.js +2 -0
- package/dist/native/{p-ae7ab110.entry.js.map → p-dc7dd7f3.entry.js.map} +1 -1
- package/dist/native/p-e2c1992e.entry.js +2 -0
- package/dist/native/{p-656c56f0.entry.js.map → p-e2c1992e.entry.js.map} +1 -1
- package/dist/native/{p-f85c08f1.js → p-e2d0a77d.js} +2 -2
- package/dist/native/p-ed6019fe.entry.js +2 -0
- package/dist/native/p-ed6019fe.entry.js.map +1 -0
- package/dist/native/p-f94d7054.entry.js +2 -0
- package/dist/native/{p-49cac014.entry.js.map → p-f94d7054.entry.js.map} +1 -1
- package/dist/native/p-fdea17ce.entry.js +2 -0
- package/dist/native/p-fdea17ce.entry.js.map +1 -0
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +26 -50
- package/dist/types/components/nv-calendar/partials/calendar-actions.d.ts +19 -0
- package/dist/types/components/nv-calendar/partials/calendar-grid.d.ts +46 -0
- package/dist/types/components/nv-calendar/partials/calendar-header.d.ts +38 -0
- package/dist/types/components/nv-calendar/partials/calendar-shortcuts.d.ts +35 -0
- package/dist/types/components/nv-calendar/partials/day-cell.d.ts +35 -0
- package/dist/types/components/nv-calendar/partials/index.d.ts +6 -0
- package/dist/types/components/nv-calendar/partials/week-numbers.d.ts +30 -0
- package/dist/types/components/nv-calendar/test/partials/calendar-actions.logic.test.d.ts +1 -0
- package/dist/types/components/nv-calendar/test/partials/calendar-grid.logic.test.d.ts +1 -0
- package/dist/types/components/nv-calendar/test/partials/calendar-header.logic.test.d.ts +1 -0
- package/dist/types/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.d.ts +1 -0
- package/dist/types/components/nv-calendar/test/partials/day-cell.logic.test.d.ts +1 -0
- package/dist/types/components/nv-calendar/test/partials/week-numbers.logic.test.d.ts +1 -0
- 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-fielddate/nv-fielddate.d.ts +21 -9
- package/dist/types/components/nv-fielddate/test/nv-fielddate.logic.test.d.ts +1 -0
- package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +24 -3
- package/dist/types/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.d.ts +1 -0
- 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 +229 -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 +402 -54
- package/dist/types/interfaces/Column.d.ts +5 -1
- package/dist/vscode-data.json +121 -9
- package/hydrate/index.js +1664 -584
- package/hydrate/index.mjs +1664 -584
- 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 +0 -167
- 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-244f56ac.entry.js +0 -2
- 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-5d21532a.entry.js.map +0 -1
- package/dist/native/p-656c56f0.entry.js +0 -2
- package/dist/native/p-7042ba8a.entry.js +0 -2
- package/dist/native/p-7e154bfd.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-efe6a46c.entry.js +0 -2
- 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-615947e7.entry.js.map → p-08ca678c.entry.js.map} +0 -0
- /package/dist/native/{p-7fd4d13d.entry.js.map → p-1c1ecd38.entry.js.map} +0 -0
- /package/dist/native/{p-c7b201cd.entry.js.map → p-1d98477d.entry.js.map} +0 -0
- /package/dist/native/{p-1da72182.entry.js.map → p-2006f5d4.entry.js.map} +0 -0
- /package/dist/native/{p-f2ef6771.entry.js.map → p-4f9cdf0b.entry.js.map} +0 -0
- /package/dist/native/{p-3b7ef609.entry.js.map → p-58bb90ad.entry.js.map} +0 -0
- /package/dist/native/{p-3cd77d82.entry.js.map → p-5b6c59e0.entry.js.map} +0 -0
- /package/dist/native/{p-08a75cfa.entry.js.map → p-60c64f2b.entry.js.map} +0 -0
- /package/dist/native/{p-c67186f8.entry.js.map → p-83288db0.entry.js.map} +0 -0
- /package/dist/native/{p-0245863d.entry.js.map → p-86ab23ea.entry.js.map} +0 -0
- /package/dist/native/{p-4dc1d036.entry.js.map → p-87784622.entry.js.map} +0 -0
- /package/dist/native/{p-14c07207.entry.js.map → p-914da1e1.entry.js.map} +0 -0
- /package/dist/native/{p-c0f79bac.entry.js.map → p-ad128108.entry.js.map} +0 -0
- /package/dist/native/{p-e5de64d5.entry.js.map → p-b5b9190a.entry.js.map} +0 -0
- /package/dist/native/{p-b8b6875d.entry.js.map → p-d040bd61.entry.js.map} +0 -0
- /package/dist/native/{p-3953464e.entry.js.map → p-d21b2da2.entry.js.map} +0 -0
- /package/dist/native/{p-90e6d9dd.entry.js.map → p-d53e8795.entry.js.map} +0 -0
- /package/dist/native/{p-f85c08f1.js.map → p-e2d0a77d.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent,
|
|
2
|
-
import { C as CUSTOM_DAY_NAMES,
|
|
1
|
+
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-a1936cd0.js';
|
|
2
|
+
import { C as CUSTOM_DAY_NAMES, d as CUSTOM_MONTH_NAMES, W as WEEK_ABBREVIATIONS } from './constants-4faa1fae.js';
|
|
3
3
|
import { c as commonjsGlobal } from './_commonjsHelpers-1789f0cf.js';
|
|
4
4
|
|
|
5
5
|
var dayjs_min = {exports: {}};
|
|
@@ -156,9 +156,18 @@ function isSameOrAfter(date, compareDate, options) {
|
|
|
156
156
|
* @returns {number} Week number
|
|
157
157
|
*/
|
|
158
158
|
function getWeekNumber(date) {
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
159
|
+
// Create a copy of the date to avoid modifying the original
|
|
160
|
+
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
161
|
+
// Adjust to the same week Thursday (ISO 8601)
|
|
162
|
+
d.setUTCDate(d.getUTCDate() + 3 - ((d.getUTCDay() + 6) % 7));
|
|
163
|
+
// Calculate the first Thursday of the year
|
|
164
|
+
const week1 = new Date(Date.UTC(d.getUTCFullYear(), 0, 4));
|
|
165
|
+
// Calculate the week number
|
|
166
|
+
return (1 +
|
|
167
|
+
Math.round(((d.getTime() - week1.getTime()) / 86400000 -
|
|
168
|
+
3 +
|
|
169
|
+
((week1.getUTCDay() + 6) % 7)) /
|
|
170
|
+
7));
|
|
162
171
|
}
|
|
163
172
|
/**
|
|
164
173
|
* Convert a date string/Date to a Date without timezone offset
|
|
@@ -232,7 +241,176 @@ function parseDate(dateInput, dateFormat) {
|
|
|
232
241
|
return parsed.toDate();
|
|
233
242
|
}
|
|
234
243
|
|
|
235
|
-
|
|
244
|
+
/**
|
|
245
|
+
* Renders a single day cell in the calendar grid
|
|
246
|
+
* @param {DayCellProps} props - Component properties
|
|
247
|
+
* @returns {JSX.Element} JSX element representing a day cell
|
|
248
|
+
*/
|
|
249
|
+
const DayCell = props => {
|
|
250
|
+
const { date, dayOfMonth, isCurrentMonth, isSelected, isInRange, isStart, isEnd, isToday, isDisabled, onClick, } = props;
|
|
251
|
+
// Build CSS classes for the day cell
|
|
252
|
+
const dayClasses = [
|
|
253
|
+
'day',
|
|
254
|
+
isSelected ? 'selected' : '',
|
|
255
|
+
isStart ? 'range-start' : '',
|
|
256
|
+
isEnd ? 'range-end' : '',
|
|
257
|
+
isInRange ? 'in-range' : '',
|
|
258
|
+
isDisabled ? 'disabled' : '',
|
|
259
|
+
!isCurrentMonth ? 'outside-month' : '',
|
|
260
|
+
isToday ? 'is-today' : '',
|
|
261
|
+
]
|
|
262
|
+
.filter(Boolean)
|
|
263
|
+
.join(' ');
|
|
264
|
+
const handleClick = () => {
|
|
265
|
+
if (!isDisabled && onClick) {
|
|
266
|
+
onClick(date);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
return (
|
|
270
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
271
|
+
h("div", { class: dayClasses, onClick: handleClick, "aria-disabled": isDisabled }, dayOfMonth));
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Renders the action buttons for the calendar (Cancel/OK)
|
|
276
|
+
* @param {CalendarActionsProps} props - Component properties
|
|
277
|
+
* @returns {JSX.Element} JSX element representing the action buttons
|
|
278
|
+
*/
|
|
279
|
+
const CalendarActions = props => {
|
|
280
|
+
const { onReset, onConfirm, useSlot = false } = props;
|
|
281
|
+
return (h("div", { class: "datepicker-actions" }, useSlot ? (h("slot", { name: "actions" },
|
|
282
|
+
h("nv-button", { emphasis: "low", size: "xs", onClick: onReset }, "Cancel"),
|
|
283
|
+
h("nv-button", { size: "xs", onClick: onConfirm }, "OK"))) : (h("div", null,
|
|
284
|
+
h("nv-button", { emphasis: "low", size: "xs", onClick: onReset }, "Cancel"),
|
|
285
|
+
h("nv-button", { size: "xs", onClick: onConfirm }, "OK")))));
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Renders the week numbers column for the calendar
|
|
290
|
+
* @param {WeekNumbersProps} props - Component properties
|
|
291
|
+
* @returns {JSX.Element} JSX element representing the week numbers
|
|
292
|
+
*/
|
|
293
|
+
const WeekNumbers = props => {
|
|
294
|
+
const { weeks, localizedWeekText, selectionType, onWeekSelect, calendarIndex, } = props;
|
|
295
|
+
/**
|
|
296
|
+
* Handles click on a week number for range selection
|
|
297
|
+
* @param {Array<WeekData>} week - Week data
|
|
298
|
+
*/
|
|
299
|
+
const handleWeekClick = (week) => {
|
|
300
|
+
if (selectionType === 'range') {
|
|
301
|
+
const dates = week.map(d => d.date);
|
|
302
|
+
onWeekSelect(dates, calendarIndex);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* Creates a click handler for a specific week
|
|
307
|
+
* @param {Array<WeekData>} week - Week data
|
|
308
|
+
* @returns {() => void} Click handler function
|
|
309
|
+
*/
|
|
310
|
+
const createWeekHandler = (week) => {
|
|
311
|
+
return () => handleWeekClick(week);
|
|
312
|
+
};
|
|
313
|
+
return (h("div", { class: "week-numbers" },
|
|
314
|
+
h("div", { class: "week-header" }, localizedWeekText),
|
|
315
|
+
weeks.map((week, weekIndex) => {
|
|
316
|
+
var _a;
|
|
317
|
+
const firstDayWithDate = ((_a = week.find(d => d.date)) === null || _a === void 0 ? void 0 : _a.date) || new Date();
|
|
318
|
+
const weekNumber = getWeekNumber(firstDayWithDate);
|
|
319
|
+
const isClickable = selectionType === 'range';
|
|
320
|
+
return (h("div", { class: `week-number ${isClickable ? 'clickable' : ''}`, onClick: createWeekHandler(week), key: `week-${weekIndex}`, role: isClickable ? 'button' : undefined, tabindex: isClickable ? 0 : undefined }, weekNumber));
|
|
321
|
+
})));
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Renders the shortcuts for quick date selection
|
|
326
|
+
* @param {CalendarShortcutsProps} props - Component properties
|
|
327
|
+
* @returns {JSX.Element | null} JSX element representing the shortcuts or null if no shortcuts
|
|
328
|
+
*/
|
|
329
|
+
const CalendarShortcuts = props => {
|
|
330
|
+
const { shortcuts, placement, onShortcutClick } = props;
|
|
331
|
+
if (!shortcuts || shortcuts.length === 0) {
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Creates a click handler for a specific shortcut
|
|
336
|
+
* @param {ShortcutData} shortcut - The shortcut data
|
|
337
|
+
* @returns {() => void} Click handler function
|
|
338
|
+
*/
|
|
339
|
+
const createShortcutHandler = (shortcut) => {
|
|
340
|
+
return () => onShortcutClick(shortcut);
|
|
341
|
+
};
|
|
342
|
+
return (h("div", { class: `shortcuts-container shortcuts-placement-${placement}` }, shortcuts.map((shortcut, index) => (h("nv-button", { key: `shortcut-${index}`, emphasis: "lower", size: "xs", "aria-label": shortcut.label, onClick: createShortcutHandler(shortcut) }, shortcut.label)))));
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Renders the calendar header with navigation and date controls
|
|
347
|
+
* @param {CalendarHeaderProps} props - Component properties
|
|
348
|
+
* @returns {JSX.Element} JSX element representing the calendar header
|
|
349
|
+
*/
|
|
350
|
+
const CalendarHeader = props => {
|
|
351
|
+
const { currentDate, months, numberOfCalendars, calendarIndex, monthOffset, onMonthChange, onMonthSelect, onYearChange, } = props;
|
|
352
|
+
/**
|
|
353
|
+
* Creates navigation handler for month change
|
|
354
|
+
* @param {number} direction - Direction of navigation (-1 or 1)
|
|
355
|
+
* @returns {() => void} Navigation handler function
|
|
356
|
+
*/
|
|
357
|
+
const createNavigationHandler = (direction) => {
|
|
358
|
+
return () => onMonthChange(direction);
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Creates month selection handler
|
|
362
|
+
* @param {number} offset - Month offset
|
|
363
|
+
* @returns {(event: Event) => void} Month selection handler function
|
|
364
|
+
*/
|
|
365
|
+
const createMonthSelectHandler = (offset) => {
|
|
366
|
+
return (event) => onMonthSelect(event, offset);
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Creates year change handler
|
|
370
|
+
* @param {number} offset - Month offset
|
|
371
|
+
* @returns {(event: Event) => void} Year change handler function
|
|
372
|
+
*/
|
|
373
|
+
const createYearChangeHandler = (offset) => {
|
|
374
|
+
return (event) => onYearChange(event, offset);
|
|
375
|
+
};
|
|
376
|
+
const currentMonth = (currentDate.getUTCMonth() + monthOffset) % 12;
|
|
377
|
+
const currentYear = currentDate.getUTCFullYear() +
|
|
378
|
+
Math.floor((currentDate.getUTCMonth() + monthOffset) / 12);
|
|
379
|
+
return (h("div", { class: "header" },
|
|
380
|
+
numberOfCalendars > 1 && calendarIndex === 0 && (h("nv-iconbutton", { class: "nav-left", emphasis: "lower", name: "chevron-left", onClick: createNavigationHandler(-1) })),
|
|
381
|
+
h("div", { class: "date-controls" },
|
|
382
|
+
h("select", { class: "month-select mr-4", onChange: createMonthSelectHandler(monthOffset) }, months.map(month => (h("option", { key: month.value, value: month.value, selected: month.value === currentMonth }, month.label)))),
|
|
383
|
+
h("input", { type: "number", class: "year-input", min: "1950", max: "2100", value: currentYear, onChange: createYearChangeHandler(monthOffset) })),
|
|
384
|
+
numberOfCalendars === 1 && (h("div", { class: "nav-buttons" },
|
|
385
|
+
h("nv-iconbutton", { emphasis: "lower", name: "chevron-left", onClick: createNavigationHandler(-1) }),
|
|
386
|
+
h("nv-iconbutton", { emphasis: "lower", name: "chevron-right", onClick: createNavigationHandler(1) }))),
|
|
387
|
+
numberOfCalendars > 1 && calendarIndex === numberOfCalendars - 1 && (h("nv-iconbutton", { emphasis: "lower", name: "chevron-right", onClick: createNavigationHandler(1), class: "nav-right" }))));
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Renders the calendar grid with day headers and day cells
|
|
392
|
+
* @param {CalendarGridProps} props - Component properties
|
|
393
|
+
* @returns {JSX.Element} JSX element representing the calendar grid
|
|
394
|
+
*/
|
|
395
|
+
const CalendarGrid = props => {
|
|
396
|
+
const { days, dayNames, selectionType, selectedDate, startDate, endDate, isUTCMode, onDayClick, isDateInRange, isToday, } = props;
|
|
397
|
+
return (h("div", { class: "days-container" },
|
|
398
|
+
h("div", { class: "days-header" }, dayNames.map((day, index) => (h("div", { class: "day-header", key: `day-header-${index}` }, day)))),
|
|
399
|
+
h("div", { class: "days-grid" }, days.map(day => {
|
|
400
|
+
const date = day.date;
|
|
401
|
+
if (!date)
|
|
402
|
+
return null;
|
|
403
|
+
const isSelected = selectionType === 'single' &&
|
|
404
|
+
isSameDate(date, selectedDate, { isUTCMode });
|
|
405
|
+
const isInRange = isDateInRange(date);
|
|
406
|
+
const isStart = isSameDate(date, startDate, { isUTCMode });
|
|
407
|
+
const isEnd = isSameDate(date, endDate, { isUTCMode });
|
|
408
|
+
const isTodayDate = isToday(date);
|
|
409
|
+
return (h(DayCell, { date: date, dayOfMonth: day.dayOfMonth, isCurrentMonth: day.isCurrentMonth, isSelected: isSelected, isInRange: isInRange, isStart: isStart, isEnd: isEnd, isToday: isTodayDate, isDisabled: day.isDisabled, selectionType: selectionType, onClick: onDayClick }));
|
|
410
|
+
}))));
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
const nvCalendarCss = "nv-calendar{display:block}.datepicker-root{display:flex;justify-content:center;align-items:flex-start;width:auto}.datepicker-container{font-family:system-ui, sans-serif;display:flex;flex-direction:column;align-items:stretch;background:var(--components-calendar-background);border-radius:var(--calendar-radius);padding:var(--calendar-padding);box-shadow:0px var(--shadow-y-axis-md-1) var(--shadow-blur-md-1) var(--shadow-spread-md, 0) var(--shadow-color-opacity-0), 0px var(--shadow-y-axis-md-2) var(--shadow-blur-md-2) var(--shadow-spread-md, 0) var(--shadow-color-opacity-2);border:1px solid var(--components-calendar-border);width:auto;max-width:100%}.datepicker-container-single{max-width:300px}.datepicker-container-single .datepicker-wrapper:has(.shortcuts-placement-left),.datepicker-container-single .datepicker-wrapper:has(.shortcuts-placement-right){max-width:410px !important}.datepicker-container-single:has(.shortcuts-placement-left),.datepicker-container-single:has(.shortcuts-placement-right){max-width:410px !important}.datepicker-wrapper{display:flex;justify-content:center;align-items:flex-start;gap:var(--calendar-gap-x);width:auto;overflow-x:hidden}.datepicker-wrapper::-webkit-scrollbar{width:6px;height:6px}.datepicker-wrapper::-webkit-scrollbar-track{background-color:var(--color-level-10-background);border-radius:9999px}.datepicker-wrapper::-webkit-scrollbar-thumb{background-color:var(--color-gray-200);border-radius:9999px}.datepicker-wrapper.single{justify-content:center}.calendar-container{display:flex;flex-direction:column;align-items:center;padding:var(--calendar-padding);width:auto;position:relative}.calendar-separator{width:1px;background:var(--components-calendar-border);height:auto;min-height:100%;margin:0 10px}.header{display:flex;justify-content:start;align-items:center;margin-bottom:var(--calendar-header-margin-bottom);width:100%}.header nv-iconbutton{width:var(--calendar-header-button-size);height:var(--calendar-header-button-size)}.nav-buttons{display:flex;gap:var(--spacing-0);margin-left:auto}.nav-left{order:-1}.date-controls{display:flex;gap:var(--spacing-1);align-items:center;min-height:34px;justify-content:center}.datepicker-container-single .date-controls{justify-content:flex-start}.datepicker-container:not(.datepicker-container-single) .date-controls{justify-content:start;flex-grow:1}.date-controls .month-select,.date-controls .year-input{background:transparent !important}.calendar-wrapper:nth-child(n+2) .datepicker-container{margin-left:42px}.calendar-grid{display:grid;grid-template-columns:auto 1fr;column-gap:var(--calendar-weeks-calendar-gap-x);position:relative}.calendar-grid.slide-left{animation:slideLeft 0.3s ease-out}.calendar-grid.slide-right{animation:slideRight 0.3s ease-out}.week-numbers{display:grid;grid-template-rows:var(--calendar-cell-size) repeat(6, var(--calendar-cell-size));background:var(--components-calendar-weeks-background);color:var(--components-calendar-weeks-text);border-radius:var(--calendar-weeks-radius);width:var(--calendar-weeks-size);row-gap:var(--calendar-grid-gap-y)}.week-numbers .clickable{cursor:pointer}.week-numbers .clickable:hover{background-color:var(--components-calendar-weeks-background-hover);color:var(--components-calendar-weeks-text-hover);border-radius:var(--calendar-radius)}.week-header,.week-number{display:grid;place-items:center;font-size:var(--calendar-cell-font-size)}.week-header{font-weight:700;color:var(--components-calendar-weeks-text)}.week-number{color:var(--components-calendar-cell-text)}.days-container{display:grid;grid-template-rows:auto 1fr;row-gap:var(--calendar-grid-gap-y)}.days-header{display:grid;grid-template-columns:repeat(7, var(--calendar-cell-size));height:var(--calendar-cell-size)}.day-header{display:grid;place-items:center;font-size:var(--calendar-cell-font-size);color:var(--components-calendar-cell-text)}.days-grid{display:grid;grid-template-columns:repeat(7, var(--calendar-cell-size));grid-template-rows:repeat(6, var(--calendar-cell-size));animation:fadeIn 0.2s ease-in;row-gap:var(--calendar-grid-gap-y);z-index:0}.day{display:grid;place-items:center;width:var(--calendar-cell-size);height:var(--calendar-cell-size);font-size:var(--calendar-cell-font-size);border-radius:var(--calendar-cell-radius);cursor:pointer;border:none;background:transparent;transition:all 0.2s ease;text-align:center;animation:scaleIn 0.2s ease-out}.day:hover:not(.disabled,.empty,.selected){background:var(--components-calendar-cell-background-hover);color:var(--components-calendar-cell-text-hover)}.day.selected,.day.selected:hover .day.is-today.selected,.day.is-today.selected:hover{background:var(--components-calendar-cell-background-selected);color:var(--components-calendar-cell-text-selected) !important}.day.disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.day.outside-month{color:var(--components-calendar-cell-text);opacity:var(--opacity-disabled)}.day.outside-month.selected{opacity:1 !important;color:var(--components-calendar-cell-text-selected)}.day.outside-month.in-range{opacity:0.5 !important;background-color:var(--components-calendar-cell-background-in-range);color:var(--components-calendar-cell-text-in-range)}.day.outside-month.in-range:hover{opacity:0.7 !important;background-color:var(--components-calendar-cell-background-in-range)}.day.in-range{background:var(--components-calendar-cell-background-in-range);color:var(--components-calendar-cell-text-in-range);border-radius:0;position:relative}.day.range-start,.day.range-start:focus,.day.range-start:hover,.day.range-end,.day.range-end:focus,.day.range-end:hover{background-color:var(--components-calendar-cell-background-selected) !important;color:var(--components-calendar-cell-text-selected) !important}.day.range-start,.day.range-end,.day.range-start.is-today,.day.range-end.is-today{background:var(--components-calendar-cell-background-selected);color:var(--components-calendar-cell-text-selected);position:relative;border-radius:var(--radius-rounded-full)}.day.range-start:hover,.day.range-end:hover,.day.range-start.is-today:hover,.day.range-end.is-today:hover{color:var(--components-calendar-cell-text-today)}.day.range-start:before,.day.range-end:before,.day.range-start.is-today:before,.day.range-end.is-today:before{content:\"\";position:absolute;bottom:0;left:0;right:0;top:0;z-index:-1;background-color:var(--components-calendar-cell-background-in-range);border-radius:var(--radius-rounded-full);width:auto;height:auto}.day.range-start:has(~.range-end):before,.day.range-start:has(+.in-range):before{border-top-right-radius:0;border-bottom-right-radius:0}.day.range-end:before{border-top-left-radius:0 !important;border-bottom-left-radius:0 !important}.day.outside-month.range-start,.day.outside-month.range-end{opacity:1 !important;background:var(--components-calendar-cell-background-selected) !important;color:var(--components-calendar-cell-text-selected)}.day.is-today{font-weight:700;position:relative;color:var(--components-calendar-cell-text-today)}.day.is-today.range-start,.day.is-today.range-end{color:var(--components-calendar-cell-text-selected)}.day.is-today.range-start:hover,.day.is-today.range-end:hover{color:var(--components-calendar-cell-text-today)}.day.is-today::after{content:\"\";position:absolute;bottom:var(--spacing-1);left:50%;transform:translateX(-50%);width:var(--calendar-cell-dot-size);height:var(--calendar-cell-dot-size);background-color:currentColor;border-radius:50%}.day.is-today.selected::after{color:var(--components-calendar-cell-text-selected)}.day.is-today.selected::after::after{background-color:var(--components-calendar-cell-dot-selected)}.calendar-footer{display:flex;gap:var(--spacing-1);justify-content:flex-start;width:100%;flex-wrap:wrap}.footer-placement-left{justify-content:flex-start}.footer-placement-right{justify-content:flex-end}.footer-placement-center{justify-content:center}.datepicker-controls{display:flex;flex-direction:column;border-top:1px solid var(--components-calendar-border);padding:var(--calendar-controls-padding-top) var(--calendar-padding) var(--calendar-padding);gap:var(--calendar-grid-gap-y);margin-top:var(--calendar-controls-margin-top)}.datepicker-actions{display:flex;justify-content:flex-end;gap:var(--spacing-1);width:100%}.datepicker-actions slot-fb{display:contents !important}.calendar-footer+.datepicker-actions{margin-top:0}.shortcuts-placement-left,.shortcuts-placement-right{display:flex;flex-direction:column;gap:var(--spacing-1);margin-top:var(--spacing-4)}.shortcuts-placement-left{align-items:flex-end}.shortcuts-placement-right{align-items:flex-start}@keyframes slideLeft{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}@keyframes slideRight{from{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:translateX(0)}}@keyframes fadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes scaleIn{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}";
|
|
236
414
|
const NvCalendarStyle0 = nvCalendarCss;
|
|
237
415
|
|
|
238
416
|
const NvCalendar = class {
|
|
@@ -240,18 +418,28 @@ const NvCalendar = class {
|
|
|
240
418
|
registerInstance(this, hostRef);
|
|
241
419
|
this.singleDateChange = createEvent(this, "singleDateChange", 7);
|
|
242
420
|
this.rangeDateChange = createEvent(this, "rangeDateChange", 7);
|
|
421
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
243
422
|
/****************************************************************************/
|
|
244
423
|
//#region PROPERTIES
|
|
245
424
|
/**
|
|
246
425
|
* First day of the week (0 = Sunday, 1 = Monday, etc.)
|
|
247
|
-
* @default
|
|
426
|
+
* @default 1
|
|
248
427
|
*/
|
|
249
|
-
this.firstDayOfWeek =
|
|
428
|
+
this.firstDayOfWeek = 1;
|
|
250
429
|
/**
|
|
251
430
|
* Number of calendars to display
|
|
252
431
|
* @default 1
|
|
253
432
|
*/
|
|
254
433
|
this.numberOfCalendars = 1;
|
|
434
|
+
/**
|
|
435
|
+
* Selected date value. For single mode: ISO date string. For range mode: comma-separated ISO date strings.
|
|
436
|
+
* Examples:
|
|
437
|
+
* - Single: "2025-03-15"
|
|
438
|
+
* - Range: "2025-03-15,2025-03-20"
|
|
439
|
+
* @default ""
|
|
440
|
+
*/
|
|
441
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
442
|
+
this.value = '';
|
|
255
443
|
/**
|
|
256
444
|
* Locale for date formatting
|
|
257
445
|
* @default 'en-BE'
|
|
@@ -289,6 +477,75 @@ const NvCalendar = class {
|
|
|
289
477
|
this.endDate = null;
|
|
290
478
|
/** List of formatted months for the selector */
|
|
291
479
|
this.months = [];
|
|
480
|
+
/**
|
|
481
|
+
* Parses the unified value prop and synchronizes with internal state
|
|
482
|
+
* @param {string} value - Value to parse
|
|
483
|
+
*/
|
|
484
|
+
this.parseUnifiedValue = (value) => {
|
|
485
|
+
if (!value) {
|
|
486
|
+
// Reset all selections
|
|
487
|
+
this.selectedDate = null;
|
|
488
|
+
this.startDate = null;
|
|
489
|
+
this.endDate = null;
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
const values = value
|
|
493
|
+
.split(',')
|
|
494
|
+
.map(v => v.trim())
|
|
495
|
+
.filter(Boolean);
|
|
496
|
+
if (this.selectionType === 'single' && values.length >= 1) {
|
|
497
|
+
const parsedDate = parseDate(values[0], this.dateFormat);
|
|
498
|
+
if (parsedDate) {
|
|
499
|
+
this.selectedDate = parsedDate;
|
|
500
|
+
// Only sync with legacy prop if not using actions (immediate mode)
|
|
501
|
+
if (!this.showActions) {
|
|
502
|
+
this.singleValue = values[0];
|
|
503
|
+
}
|
|
504
|
+
// Navigate to the date if not prevented
|
|
505
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
506
|
+
if (!preventNavigation) {
|
|
507
|
+
this.currentDate = parsedDate;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
// Handle malformed date gracefully - reset state
|
|
512
|
+
console.warn(`Invalid date format: ${values[0]}`);
|
|
513
|
+
this.selectedDate = null;
|
|
514
|
+
if (!this.showActions) {
|
|
515
|
+
this.singleValue = '';
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
else if (this.selectionType === 'range' && values.length >= 2) {
|
|
520
|
+
const startDate = parseDate(values[0], this.dateFormat);
|
|
521
|
+
const endDate = parseDate(values[1], this.dateFormat);
|
|
522
|
+
if (startDate && endDate) {
|
|
523
|
+
this.startDate = startDate;
|
|
524
|
+
this.endDate = endDate;
|
|
525
|
+
// Only sync with legacy prop if not using actions (immediate mode)
|
|
526
|
+
if (!this.showActions) {
|
|
527
|
+
this.rangeValue = {
|
|
528
|
+
start: values[0],
|
|
529
|
+
end: values[1],
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
// Navigate to start date if not prevented
|
|
533
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
534
|
+
if (!preventNavigation) {
|
|
535
|
+
this.currentDate = startDate;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
// Handle malformed dates gracefully - reset state
|
|
540
|
+
console.warn(`Invalid date range format: ${values[0]}, ${values[1]}`);
|
|
541
|
+
this.startDate = null;
|
|
542
|
+
this.endDate = null;
|
|
543
|
+
if (!this.showActions) {
|
|
544
|
+
this.rangeValue = { start: '', end: '' };
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
};
|
|
292
549
|
/**
|
|
293
550
|
* Change the displayed month
|
|
294
551
|
* @param {number} offset - Month offset (-1 for previous, 1 for next)
|
|
@@ -336,7 +593,14 @@ const NvCalendar = class {
|
|
|
336
593
|
return;
|
|
337
594
|
const formattedDate = formatDate(date, { dateFormat: this.dateFormat });
|
|
338
595
|
this.selectedDate = date;
|
|
339
|
-
|
|
596
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
597
|
+
this.value = formattedDate;
|
|
598
|
+
this.valueChanged.emit(formattedDate);
|
|
599
|
+
// Legacy support (deprecated) - only sync props if not using actions
|
|
600
|
+
if (!this.showActions) {
|
|
601
|
+
this.singleValue = formattedDate;
|
|
602
|
+
this.singleDateChange.emit(formattedDate);
|
|
603
|
+
}
|
|
340
604
|
};
|
|
341
605
|
/**
|
|
342
606
|
* Handles range date selection
|
|
@@ -344,18 +608,32 @@ const NvCalendar = class {
|
|
|
344
608
|
*/
|
|
345
609
|
this.handleRangeSelection = (date) => {
|
|
346
610
|
if (!this.startDate || (this.startDate && this.endDate)) {
|
|
611
|
+
// Start new range selection
|
|
347
612
|
this.startDate = date;
|
|
348
613
|
this.endDate = null;
|
|
349
614
|
}
|
|
350
615
|
else {
|
|
616
|
+
// Complete range selection
|
|
351
617
|
this.endDate = date;
|
|
618
|
+
// Ensure correct order
|
|
352
619
|
if (this.startDate > this.endDate) {
|
|
353
620
|
[this.startDate, this.endDate] = [this.endDate, this.startDate];
|
|
354
621
|
}
|
|
355
|
-
this.
|
|
356
|
-
|
|
357
|
-
|
|
622
|
+
const startFormatted = formatDate(this.startDate, {
|
|
623
|
+
dateFormat: this.dateFormat,
|
|
624
|
+
});
|
|
625
|
+
const endFormatted = formatDate(this.endDate, {
|
|
626
|
+
dateFormat: this.dateFormat,
|
|
358
627
|
});
|
|
628
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
629
|
+
this.value = `${startFormatted},${endFormatted}`;
|
|
630
|
+
this.valueChanged.emit(this.value);
|
|
631
|
+
// Legacy support (deprecated) - only sync props if not using actions
|
|
632
|
+
if (!this.showActions) {
|
|
633
|
+
const legacyRange = { start: startFormatted, end: endFormatted };
|
|
634
|
+
this.rangeDateChange.emit(legacyRange);
|
|
635
|
+
this.rangeValue = legacyRange;
|
|
636
|
+
}
|
|
359
637
|
}
|
|
360
638
|
};
|
|
361
639
|
/**
|
|
@@ -414,23 +692,35 @@ const NvCalendar = class {
|
|
|
414
692
|
* @returns {string[]} Array of short day names
|
|
415
693
|
*/
|
|
416
694
|
this.getDayNames = () => {
|
|
695
|
+
let days;
|
|
417
696
|
// If we have custom day names for this locale
|
|
418
697
|
if (CUSTOM_DAY_NAMES[this.locale]) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
698
|
+
// Custom day names are expected to start with Monday (index 0 = Monday)
|
|
699
|
+
days = [...CUSTOM_DAY_NAMES[this.locale]];
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
// Generate days using Intl.DateTimeFormat, starting from Monday
|
|
703
|
+
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
704
|
+
weekday: 'short',
|
|
705
|
+
});
|
|
706
|
+
// Generate days starting from Monday (2023-01-02 was a Monday)
|
|
707
|
+
days = [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 2)).toUpperCase());
|
|
708
|
+
}
|
|
709
|
+
// Now reorganize based on firstDayOfWeek
|
|
710
|
+
// 0 = Sunday, 1 = Monday (default), 2 = Tuesday, etc.
|
|
711
|
+
if (this.firstDayOfWeek === 0) {
|
|
712
|
+
// If Sunday is first day, move Sunday (last element) to the beginning
|
|
713
|
+
return [days[6], ...days.slice(0, 6)];
|
|
714
|
+
}
|
|
715
|
+
else if (this.firstDayOfWeek === 1) {
|
|
716
|
+
// If Monday is first day, return as-is (since our array starts with Monday)
|
|
717
|
+
return days;
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
// For other first days (Tuesday=2, Wednesday=3, etc.)
|
|
721
|
+
const offset = this.firstDayOfWeek - 1; // Convert to 0-based offset from Monday
|
|
722
|
+
return [...days.slice(offset), ...days.slice(0, offset)];
|
|
424
723
|
}
|
|
425
|
-
// Otherwise, use the default behavior
|
|
426
|
-
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
427
|
-
weekday: 'short',
|
|
428
|
-
});
|
|
429
|
-
const days = [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 1)).toUpperCase());
|
|
430
|
-
// Reorganize the days based on the first day of the week
|
|
431
|
-
const firstDays = days.slice(0, this.firstDayOfWeek);
|
|
432
|
-
const remainingDays = days.slice(this.firstDayOfWeek);
|
|
433
|
-
return [...remainingDays, ...firstDays];
|
|
434
724
|
};
|
|
435
725
|
/**
|
|
436
726
|
* Generates the days of the current month
|
|
@@ -611,8 +901,15 @@ const NvCalendar = class {
|
|
|
611
901
|
if (shortcut.singleValue) {
|
|
612
902
|
const newDate = parseDate(shortcut.singleValue, this.dateFormat);
|
|
613
903
|
this.selectedDate = newDate;
|
|
614
|
-
|
|
615
|
-
|
|
904
|
+
const formattedDate = formatDate(newDate, {
|
|
905
|
+
dateFormat: this.dateFormat,
|
|
906
|
+
});
|
|
907
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
908
|
+
this.value = formattedDate;
|
|
909
|
+
this.valueChanged.emit(formattedDate);
|
|
910
|
+
// Legacy support (deprecated) - sync props
|
|
911
|
+
this.singleValue = formattedDate;
|
|
912
|
+
this.singleDateChange.emit(formattedDate);
|
|
616
913
|
if (!this.showActions) {
|
|
617
914
|
const event = new CustomEvent('closePopover', {
|
|
618
915
|
bubbles: true,
|
|
@@ -627,14 +924,18 @@ const NvCalendar = class {
|
|
|
627
924
|
const end = parseDate(shortcut.rangeValue.end, this.dateFormat);
|
|
628
925
|
this.startDate = start;
|
|
629
926
|
this.endDate = end;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
end: formatDate(end, { dateFormat: this.dateFormat }),
|
|
927
|
+
const startFormatted = formatDate(start, {
|
|
928
|
+
dateFormat: this.dateFormat,
|
|
633
929
|
});
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
930
|
+
const endFormatted = formatDate(end, { dateFormat: this.dateFormat });
|
|
931
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
932
|
+
this.value = `${startFormatted},${endFormatted}`;
|
|
933
|
+
this.valueChanged.emit(this.value);
|
|
934
|
+
// Legacy support (deprecated) - sync props
|
|
935
|
+
const legacyRange = { start: startFormatted, end: endFormatted };
|
|
936
|
+
this.rangeDateChange.emit(legacyRange);
|
|
937
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
938
|
+
this.rangeValue = legacyRange;
|
|
638
939
|
if (!this.showActions) {
|
|
639
940
|
const event = new CustomEvent('closePopover', {
|
|
640
941
|
bubbles: true,
|
|
@@ -642,103 +943,15 @@ const NvCalendar = class {
|
|
|
642
943
|
});
|
|
643
944
|
this.el.dispatchEvent(event);
|
|
644
945
|
}
|
|
645
|
-
this.
|
|
946
|
+
this.currentDate = start;
|
|
646
947
|
}
|
|
647
948
|
};
|
|
648
949
|
/**
|
|
649
|
-
* Method to force the complete calendar update
|
|
950
|
+
* Method to force the complete calendar update
|
|
650
951
|
* @param {Date} newDate - Date to force
|
|
651
952
|
*/
|
|
652
953
|
this.forceCalendarUpdate = newDate => {
|
|
653
954
|
this.currentDate = new Date(newDate);
|
|
654
|
-
this.currentDate = new Date(this.currentDate); // Force a re-render
|
|
655
|
-
// Reset visually the hover/touch effect
|
|
656
|
-
requestAnimationFrame(() => {
|
|
657
|
-
const days = document.querySelectorAll('.day');
|
|
658
|
-
days.forEach(el => {
|
|
659
|
-
el.classList.remove('hover', 'active', 'touched');
|
|
660
|
-
el.style.pointerEvents = 'none';
|
|
661
|
-
});
|
|
662
|
-
// Add specific touch handling (for mobile)
|
|
663
|
-
document.body.addEventListener('touchstart', this.clearTouchState, {
|
|
664
|
-
passive: true,
|
|
665
|
-
});
|
|
666
|
-
// Reset the touch state after 50ms
|
|
667
|
-
setTimeout(() => {
|
|
668
|
-
days.forEach(el => {
|
|
669
|
-
el.style.pointerEvents = '';
|
|
670
|
-
});
|
|
671
|
-
}, 50);
|
|
672
|
-
});
|
|
673
|
-
};
|
|
674
|
-
/**
|
|
675
|
-
* Function to reset the touch effect (Mobile fix)
|
|
676
|
-
*/
|
|
677
|
-
this.clearTouchState = () => {
|
|
678
|
-
document.querySelectorAll('.day').forEach(el => {
|
|
679
|
-
el.classList.remove('touched');
|
|
680
|
-
});
|
|
681
|
-
// Remove the listener after the first interaction
|
|
682
|
-
document.body.removeEventListener('touchstart', this.clearTouchState);
|
|
683
|
-
};
|
|
684
|
-
/**
|
|
685
|
-
* Handles month change with an offset
|
|
686
|
-
* @param {number} direction - Direction (-1 for previous, 1 for next)
|
|
687
|
-
* @returns {Function} Change month handler
|
|
688
|
-
*/
|
|
689
|
-
this.getChangeMonthHandler = (direction) => {
|
|
690
|
-
return () => this.changeMonth(direction);
|
|
691
|
-
};
|
|
692
|
-
/**
|
|
693
|
-
* Handles month change from an event (ex: dropdown)
|
|
694
|
-
* @param {number} offset - Month offset (0 by default)
|
|
695
|
-
* @returns {Function} Change month handler
|
|
696
|
-
*/
|
|
697
|
-
this.getHandleMonthChange = (offset) => {
|
|
698
|
-
return (event) => this.handleMonthChange(event, offset);
|
|
699
|
-
};
|
|
700
|
-
/**
|
|
701
|
-
* Handles year change from an event (ex: dropdown)
|
|
702
|
-
* @param {number} offset - Year offset (0 by default)
|
|
703
|
-
* @returns {Function} Change year handler
|
|
704
|
-
*/
|
|
705
|
-
this.getHandleYearChange = (offset) => {
|
|
706
|
-
return (event) => this.handleYearChange(event, offset);
|
|
707
|
-
};
|
|
708
|
-
/**
|
|
709
|
-
* Handles day click
|
|
710
|
-
* @param {Date} date - Date to handle
|
|
711
|
-
* @param {boolean} isDisabled - Whether the date is disabled
|
|
712
|
-
* @returns {Function} Day click handler
|
|
713
|
-
*/
|
|
714
|
-
this.getDayClickHandler = (date, isDisabled) => {
|
|
715
|
-
return isDisabled ? undefined : () => this.handleDateSelection(date);
|
|
716
|
-
};
|
|
717
|
-
/**
|
|
718
|
-
* Handles shortcut selection
|
|
719
|
-
* @param {Object} shortcut - Shortcut to handle
|
|
720
|
-
* @param {string | Date} shortcut.singleValue - Selected date value
|
|
721
|
-
* @param {Object} shortcut.rangeValue - Start and end date values
|
|
722
|
-
* @param {string | Date} shortcut.rangeValue.start - Start date value
|
|
723
|
-
* @param {string | Date} shortcut.rangeValue.end - End date value
|
|
724
|
-
* @param {string} shortcut.label - Label
|
|
725
|
-
* @returns {Function} Shortcut selection handler
|
|
726
|
-
*/
|
|
727
|
-
this.getShortcutHandler = (shortcut) => {
|
|
728
|
-
return () => this.applyShortcut(shortcut);
|
|
729
|
-
};
|
|
730
|
-
/**
|
|
731
|
-
* Handles week selection
|
|
732
|
-
* @param {Date[]} dates - Dates to handle
|
|
733
|
-
* @param {number} index - Calendar index
|
|
734
|
-
* @returns {Function} Week selection handler
|
|
735
|
-
*/
|
|
736
|
-
this.getWeekSelectionHandler = (dates, index) => {
|
|
737
|
-
return () => {
|
|
738
|
-
if (this.selectionType === 'range') {
|
|
739
|
-
this.handleWeekSelection(dates, index);
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
955
|
};
|
|
743
956
|
/**
|
|
744
957
|
* Resets the current selection
|
|
@@ -746,14 +959,22 @@ const NvCalendar = class {
|
|
|
746
959
|
this.resetSelection = () => {
|
|
747
960
|
if (this.selectionType === 'single') {
|
|
748
961
|
this.selectedDate = null;
|
|
962
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
749
963
|
this.singleValue = null;
|
|
964
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
965
|
+
this.value = '';
|
|
750
966
|
this.singleDateChange.emit('');
|
|
967
|
+
this.valueChanged.emit('');
|
|
751
968
|
}
|
|
752
969
|
else {
|
|
753
970
|
this.startDate = null;
|
|
754
971
|
this.endDate = null;
|
|
972
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
755
973
|
this.rangeValue = null;
|
|
974
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
975
|
+
this.value = '';
|
|
756
976
|
this.rangeDateChange.emit({ start: '', end: '' });
|
|
977
|
+
this.valueChanged.emit('');
|
|
757
978
|
}
|
|
758
979
|
};
|
|
759
980
|
/**
|
|
@@ -765,6 +986,7 @@ const NvCalendar = class {
|
|
|
765
986
|
dateFormat: this.dateFormat,
|
|
766
987
|
});
|
|
767
988
|
this.singleDateChange.emit(dateStr);
|
|
989
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
768
990
|
this.singleValue = dateStr;
|
|
769
991
|
const event = new CustomEvent('closePopover', {
|
|
770
992
|
bubbles: true,
|
|
@@ -779,6 +1001,7 @@ const NvCalendar = class {
|
|
|
779
1001
|
start: formatDate(this.startDate, { dateFormat: this.dateFormat }),
|
|
780
1002
|
end: formatDate(this.endDate, { dateFormat: this.dateFormat }),
|
|
781
1003
|
});
|
|
1004
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
782
1005
|
this.rangeValue = {
|
|
783
1006
|
start: formatDate(this.startDate, { dateFormat: this.dateFormat }),
|
|
784
1007
|
end: formatDate(this.endDate, { dateFormat: this.dateFormat }),
|
|
@@ -801,8 +1024,7 @@ const NvCalendar = class {
|
|
|
801
1024
|
* @description Renders the header of the calendar
|
|
802
1025
|
*/
|
|
803
1026
|
this.renderHeader = (offset, index) => {
|
|
804
|
-
return (h(
|
|
805
|
-
Math.floor((this.currentDate.getUTCMonth() + offset) / 12), onChange: this.getHandleYearChange(offset) })), this.numberOfCalendars === 1 && (h("div", { class: "nav-buttons" }, h("nv-iconbutton", { emphasis: "lower", name: "chevron-left", onClick: this.getChangeMonthHandler(-1) }), h("nv-iconbutton", { emphasis: "lower", name: "chevron-right", onClick: this.getChangeMonthHandler(1) }))), this.numberOfCalendars > 1 && index === this.numberOfCalendars - 1 && (h("nv-iconbutton", { emphasis: "lower", name: "chevron-right", onClick: this.getChangeMonthHandler(1), class: "nav-right" }))));
|
|
1027
|
+
return (h(CalendarHeader, { currentDate: this.currentDate, months: this.months, numberOfCalendars: this.numberOfCalendars, calendarIndex: index, monthOffset: offset, onMonthChange: this.changeMonth, onMonthSelect: this.handleMonthChange, onYearChange: this.handleYearChange }));
|
|
806
1028
|
};
|
|
807
1029
|
/**
|
|
808
1030
|
* Renders the week numbers
|
|
@@ -816,42 +1038,7 @@ const NvCalendar = class {
|
|
|
816
1038
|
weeks,
|
|
817
1039
|
/** Calendar index */
|
|
818
1040
|
index) => {
|
|
819
|
-
return (h(
|
|
820
|
-
var _a;
|
|
821
|
-
const dates = week.map(d => d.date);
|
|
822
|
-
return (h("div", { class: `week-number ${this.selectionType === 'range' ? 'clickable' : ''}`, onClick: this.getWeekSelectionHandler(dates, index), key: `week-${weekIndex}` }, getWeekNumber(((_a = week.find(d => d.date)) === null || _a === void 0 ? void 0 : _a.date) || new Date())));
|
|
823
|
-
})));
|
|
824
|
-
};
|
|
825
|
-
this.renderDaysGrid = (
|
|
826
|
-
/** Days to render */
|
|
827
|
-
days) => {
|
|
828
|
-
return (h("div", { class: "days-grid" }, days.map(day => {
|
|
829
|
-
const date = day.date;
|
|
830
|
-
if (!date)
|
|
831
|
-
return null;
|
|
832
|
-
const isSelected = this.selectionType === 'single' &&
|
|
833
|
-
isSameDate(date, this.selectedDate, { isUTCMode: this.isUTCMode });
|
|
834
|
-
const isInRange = this.isDateInRange(date);
|
|
835
|
-
const isStart = isSameDate(date, this.startDate, {
|
|
836
|
-
isUTCMode: this.isUTCMode,
|
|
837
|
-
});
|
|
838
|
-
const isEnd = isSameDate(date, this.endDate, {
|
|
839
|
-
isUTCMode: this.isUTCMode,
|
|
840
|
-
});
|
|
841
|
-
const isToday = this.isToday(date);
|
|
842
|
-
const isOutsideMonth = !day.isCurrentMonth;
|
|
843
|
-
const dayClasses = [
|
|
844
|
-
'day',
|
|
845
|
-
isSelected ? 'selected' : '',
|
|
846
|
-
isStart ? 'range-start' : '',
|
|
847
|
-
isEnd ? 'range-end' : '',
|
|
848
|
-
isInRange ? 'in-range' : '',
|
|
849
|
-
day.isDisabled ? 'disabled' : '',
|
|
850
|
-
isOutsideMonth ? 'outside-month' : '',
|
|
851
|
-
isToday ? 'is-today' : '',
|
|
852
|
-
];
|
|
853
|
-
return (h("div", { class: dayClasses.filter(Boolean).join(' '), onClick: this.getDayClickHandler(date, day.isDisabled), "aria-disabled": day.isDisabled, key: `day-${date.toISOString()}` }, day.dayOfMonth));
|
|
854
|
-
})));
|
|
1041
|
+
return (h(WeekNumbers, { weeks: weeks, localizedWeekText: this.getLocalizedWeekText(), selectionType: this.selectionType, onWeekSelect: this.handleWeekSelection, calendarIndex: index }));
|
|
855
1042
|
};
|
|
856
1043
|
/**
|
|
857
1044
|
* Renders the calendar
|
|
@@ -870,7 +1057,7 @@ const NvCalendar = class {
|
|
|
870
1057
|
for (let i = 0; i < days.length; i += 7) {
|
|
871
1058
|
weeks.push(days.slice(i, i + 7));
|
|
872
1059
|
}
|
|
873
|
-
return (h("div", { class: "calendar-wrapper" }, h("div", { class: "calendar-container", key: `calendar-${index}` }, this.renderHeader(offset, index), h("div", { class: "calendar-grid" }, this.showWeekNumbers && this.renderWeekNumbers(weeks, index), h(
|
|
1060
|
+
return (h("div", { class: "calendar-wrapper" }, h("div", { class: "calendar-container", key: `calendar-${index}` }, this.renderHeader(offset, index), h("div", { class: "calendar-grid" }, this.showWeekNumbers && this.renderWeekNumbers(weeks, index), h(CalendarGrid, { days: days, dayNames: this.getDayNames(), selectionType: this.selectionType, selectedDate: this.selectedDate, startDate: this.startDate, endDate: this.endDate, isUTCMode: this.isUTCMode, onDayClick: this.handleDateSelection, isDateInRange: this.isDateInRange, isToday: this.isToday }))), index < this.numberOfCalendars - 1 && (h("div", { class: "calendar-separator" }))));
|
|
874
1061
|
};
|
|
875
1062
|
/**
|
|
876
1063
|
* Renders the shortcuts
|
|
@@ -881,7 +1068,7 @@ const NvCalendar = class {
|
|
|
881
1068
|
if (!this.hasShortcuts) {
|
|
882
1069
|
return null;
|
|
883
1070
|
}
|
|
884
|
-
return (h(
|
|
1071
|
+
return (h(CalendarShortcuts, { shortcuts: this.shortcuts, placement: this.shortcutsPlacement, onShortcutClick: this.applyShortcut }));
|
|
885
1072
|
};
|
|
886
1073
|
/**
|
|
887
1074
|
* Renders the actions
|
|
@@ -890,7 +1077,7 @@ const NvCalendar = class {
|
|
|
890
1077
|
* @slot actions - Child content of the component.
|
|
891
1078
|
*/
|
|
892
1079
|
this.renderActions = () => {
|
|
893
|
-
return (h("div", { class: "datepicker-actions" }, h("slot", { name: "actions" }, h(
|
|
1080
|
+
return (h("div", { class: "datepicker-actions" }, h("slot", { name: "actions" }, h(CalendarActions, { onReset: this.resetSelection, onConfirm: this.confirmSelection, useSlot: false }))));
|
|
894
1081
|
};
|
|
895
1082
|
}
|
|
896
1083
|
//#endregion EVENTS
|
|
@@ -918,7 +1105,11 @@ const NvCalendar = class {
|
|
|
918
1105
|
const { startDate, endDate } = this.validateDateRange(newValue.start, newValue.end);
|
|
919
1106
|
this.startDate = startDate;
|
|
920
1107
|
this.endDate = endDate;
|
|
921
|
-
|
|
1108
|
+
// Do not navigate to the start date if data-prevent-navigation attribute is present
|
|
1109
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
1110
|
+
if (!preventNavigation) {
|
|
1111
|
+
this.currentDate = startDate;
|
|
1112
|
+
}
|
|
922
1113
|
}
|
|
923
1114
|
catch (error) {
|
|
924
1115
|
console.error('Invalid rangeValue:', error);
|
|
@@ -942,16 +1133,34 @@ const NvCalendar = class {
|
|
|
942
1133
|
const parsedDate = parseDate(newValue, this.dateFormat);
|
|
943
1134
|
if (parsedDate) {
|
|
944
1135
|
this.selectedDate = parsedDate;
|
|
945
|
-
|
|
1136
|
+
// Do not navigate to the selected date if data-prevent-navigation attribute is present
|
|
1137
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
1138
|
+
if (!preventNavigation) {
|
|
1139
|
+
this.currentDate = parsedDate;
|
|
1140
|
+
}
|
|
946
1141
|
}
|
|
947
1142
|
}
|
|
948
1143
|
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Watches the changes of the unified value prop
|
|
1146
|
+
* @param {string} newValue - New value
|
|
1147
|
+
* @param {string} oldValue - Old value
|
|
1148
|
+
*/
|
|
1149
|
+
onValueChange(newValue, oldValue) {
|
|
1150
|
+
if (newValue !== oldValue) {
|
|
1151
|
+
this.parseUnifiedValue(newValue);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
949
1154
|
//#endregion WATCHERS
|
|
950
1155
|
/****************************************************************************/
|
|
951
1156
|
//#region LIFECYCLE
|
|
952
1157
|
componentWillLoad() {
|
|
953
1158
|
this.parseDisabledDates();
|
|
954
|
-
|
|
1159
|
+
// Initialize from unified value prop if provided
|
|
1160
|
+
if (this.value) {
|
|
1161
|
+
this.parseUnifiedValue(this.value);
|
|
1162
|
+
}
|
|
1163
|
+
else if (this.selectionType === 'single' && this.singleValue) {
|
|
955
1164
|
this.selectedDate = parseDate(this.singleValue, this.dateFormat);
|
|
956
1165
|
this.currentDate = this.selectedDate;
|
|
957
1166
|
}
|
|
@@ -964,6 +1173,7 @@ const NvCalendar = class {
|
|
|
964
1173
|
this.currentDate = startDate;
|
|
965
1174
|
if (swapped) {
|
|
966
1175
|
// If dates were swapped, update the rangeValue property
|
|
1176
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
967
1177
|
this.rangeValue = {
|
|
968
1178
|
start: formatDate(startDate, { dateFormat: this.dateFormat }),
|
|
969
1179
|
end: formatDate(endDate, { dateFormat: this.dateFormat }),
|
|
@@ -975,7 +1185,8 @@ const NvCalendar = class {
|
|
|
975
1185
|
console.error('Invalid rangeValue:', error);
|
|
976
1186
|
}
|
|
977
1187
|
}
|
|
978
|
-
|
|
1188
|
+
// Ensure currentDate is always initialized
|
|
1189
|
+
if (!this.currentDate) {
|
|
979
1190
|
this.currentDate = new Date();
|
|
980
1191
|
}
|
|
981
1192
|
this.initializeMonths();
|
|
@@ -1045,15 +1256,16 @@ const NvCalendar = class {
|
|
|
1045
1256
|
* @slot default - Child content of the component.
|
|
1046
1257
|
*/
|
|
1047
1258
|
render() {
|
|
1048
|
-
return (h(Host, { key: '
|
|
1049
|
-
this.hasActions) && (h("div", { key: '
|
|
1259
|
+
return (h(Host, { key: '43d4f3ab9199e9c5f15e853f15283fa59e4a436d' }, h("div", { key: 'b9956225cb2c16d997aa44266af8f8c8222ea968', class: "datepicker-root" }, h("div", { key: '05b63935bc5ebf500bb52d10688385f994b47fb4', class: `datepicker-container ${this.numberOfCalendars === 1 ? 'datepicker-container-single' : ''}` }, h("div", { key: 'd7af15b9ce051026cf841b3be361b32d8db41fc1', class: `datepicker-wrapper ${this.numberOfCalendars === 1 ? 'single' : ''}` }, this.shortcutsPlacement === 'left' && this.renderShortcuts(), Array.from({ length: this.numberOfCalendars }, (_, index) => this.renderCalendar(index, index)), this.shortcutsPlacement === 'right' && this.renderShortcuts()), ((this.hasShortcuts && this.shortcutsPlacement === 'bottom') ||
|
|
1260
|
+
this.hasActions) && (h("div", { key: '1765334bf15564bc9886b210c54bddba64c7042e', class: "datepicker-controls" }, this.shortcutsPlacement === 'bottom' && this.renderShortcuts(), this.hasActions && this.renderActions())))), h("slot", { key: '0ac3446394b8c23b859e5f0065370b95b6fd05d2' })));
|
|
1050
1261
|
}
|
|
1051
1262
|
get el() { return getElement(this); }
|
|
1052
1263
|
static get watchers() { return {
|
|
1053
1264
|
"numberOfCalendars": ["validateNumberOfCalendars"],
|
|
1054
1265
|
"rangeValue": ["onRangeValueChange"],
|
|
1055
1266
|
"disabledDates": ["handleDisabledDatesChange"],
|
|
1056
|
-
"singleValue": ["onSingleValueChange"]
|
|
1267
|
+
"singleValue": ["onSingleValueChange"],
|
|
1268
|
+
"value": ["onValueChange"]
|
|
1057
1269
|
}; }
|
|
1058
1270
|
};
|
|
1059
1271
|
NvCalendar.style = NvCalendarStyle0;
|