@nova-design-system/nova-webcomponents 3.2.0 → 3.4.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-108ddff0.js → index-c56424e5.js} +18 -186
- package/dist/cjs/index-c56424e5.js.map +1 -0
- 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 +391 -142
- 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 +45 -12
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +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 +98 -44
- package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +5 -5
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +5 -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 +7 -7
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldslider.cjs.entry.js +28 -23
- package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +5 -5
- package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +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 +2 -2
- 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 +3 -3
- package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +2 -2
- package/dist/cjs/nv-stack.cjs.entry.js +2 -2
- package/dist/cjs/nv-table.cjs.entry.js +3 -3
- package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +3 -3
- package/dist/cjs/nv-tooltip.cjs.entry.js +2 -2
- package/dist/collection/components/nv-calendar/nv-calendar.js +235 -136
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js +32 -7
- 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 +88 -2
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +89 -10
- package/dist/collection/components/nv-datagrid/nv-datagrid.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 +44 -0
- 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.docs.js +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +125 -42
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
- package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +44 -0
- 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/styles/nv-fielddropdown.css +46 -0
- package/dist/collection/components/nv-fieldmultiselect/styles/nv-fieldmultiselect.css +46 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +44 -0
- 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 +4 -3
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +44 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +3 -3
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +44 -0
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +22 -22
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +30 -29
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +1 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js +1 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +1 -1
- package/dist/collection/components/nv-fieldslider/styles/nv-fieldslider.css +99 -20
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +44 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +3 -3
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +38 -0
- 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 +44 -0
- package/dist/collection/components/nv-icon/nv-icon.js +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 +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +3 -3
- package/dist/collection/components/nv-popover/nv-popover.js.map +1 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +2 -2
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/collection/templates/navigation.docs.js +1 -1
- package/dist/collection/templates/navigation.docs.js.map +1 -1
- package/dist/components/index.js +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 +54 -19
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-datagridcolumn.js +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 +110 -62
- package/dist/components/nv-fielddaterange.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +7 -7
- 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 +9 -9
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +1 -180
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldpassword.js +8 -8
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +4 -4
- package/dist/components/nv-fieldselect.js +10 -10
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldslider.js +49 -26
- package/dist/components/nv-fieldslider.js.map +1 -1
- 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-0ab80d95.js → p-131e5140.js} +4 -4
- package/dist/components/{p-0ab80d95.js.map → p-131e5140.js.map} +1 -1
- package/dist/components/{p-cbdc2c8b.js → p-3f567fde.js} +5 -5
- package/dist/components/{p-cbdc2c8b.js.map → p-3f567fde.js.map} +1 -1
- package/dist/components/p-3f58525b.js +167 -0
- package/dist/components/{p-f0a5e7e4.js.map → p-3f58525b.js.map} +1 -1
- package/dist/components/{p-33e231f4.js → p-6277f746.js} +2 -2
- package/dist/components/{p-33e231f4.js.map → p-6277f746.js.map} +1 -1
- package/dist/components/{p-07a89754.js → p-953d8b4d.js} +3 -3
- package/dist/components/{p-07a89754.js.map → p-953d8b4d.js.map} +1 -1
- package/dist/components/{p-dd2273a3.js → p-9e6e26cb.js} +2 -2
- package/dist/components/{p-dd2273a3.js.map → p-9e6e26cb.js.map} +1 -1
- package/dist/components/{p-d19b41d2.js → p-9f1e8ef3.js} +2 -2
- package/dist/components/{p-d19b41d2.js.map → p-9f1e8ef3.js.map} +1 -1
- package/dist/components/{p-4656efae.js → p-a0d7e0cd.js} +396 -169
- package/dist/components/p-a0d7e0cd.js.map +1 -0
- package/dist/components/{p-f1859ddc.js → p-a1438b39.js} +4 -4
- package/dist/components/{p-f1859ddc.js.map → p-a1438b39.js.map} +1 -1
- package/dist/components/{p-04cb3a6f.js → p-a189d074.js} +5 -5
- package/dist/components/{p-04cb3a6f.js.map → p-a189d074.js.map} +1 -1
- package/dist/components/p-a29a9396.js +184 -0
- package/dist/components/p-a29a9396.js.map +1 -0
- package/dist/components/{p-679e0fa9.js → p-aff3ed68.js} +10 -175
- package/dist/components/p-aff3ed68.js.map +1 -0
- package/dist/components/{p-76a30bf1.js → p-b207be02.js} +3 -3
- package/dist/components/{p-76a30bf1.js.map → p-b207be02.js.map} +1 -1
- package/dist/components/{p-581e67cc.js → p-c07c32d2.js} +3 -3
- package/dist/components/{p-581e67cc.js.map → p-c07c32d2.js.map} +1 -1
- package/dist/components/{p-cbe9521f.js → p-dcaf9010.js} +3 -3
- package/dist/components/{p-cbe9521f.js.map → p-dcaf9010.js.map} +1 -1
- package/dist/components/{p-83c8873a.js → p-dec6fc68.js} +3 -3
- package/dist/components/{p-83c8873a.js.map → p-dec6fc68.js.map} +1 -1
- package/dist/components/{p-d63f1cbe.js → p-df465ef2.js} +3 -3
- package/dist/components/{p-d63f1cbe.js.map → p-df465ef2.js.map} +1 -1
- package/dist/components/{p-c0a91091.js → p-f7c7a406.js} +4 -4
- package/dist/components/{p-c0a91091.js.map → p-f7c7a406.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-8f0e5f19.js → index-a1936cd0.js} +19 -186
- package/dist/esm/index-a1936cd0.js.map +1 -0
- package/dist/esm/index.js +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 +392 -143
- 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 +46 -13
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-datagridcolumn.entry.js +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 +98 -44
- package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +5 -5
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +5 -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 +7 -7
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldslider.entry.js +28 -23
- package/dist/esm/nv-fieldslider.entry.js.map +1 -1
- package/dist/esm/nv-fieldtext.entry.js +5 -5
- package/dist/esm/nv-fieldtext.entry.js.map +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +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 +3 -3
- 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 +3 -3
- package/dist/esm/nv-popover.entry.js.map +1 -1
- package/dist/esm/nv-row.entry.js +2 -2
- package/dist/esm/nv-stack.entry.js +2 -2
- package/dist/esm/nv-table.entry.js +3 -3
- package/dist/esm/nv-tablecolumn.entry.js +1 -1
- package/dist/esm/nv-toggle.entry.js +3 -3
- package/dist/esm/nv-tooltip.entry.js +2 -2
- package/dist/native/index.esm.js +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-01164e86.entry.js +2 -0
- package/dist/native/{p-5382eab2.entry.js.map → p-01164e86.entry.js.map} +1 -1
- package/dist/native/p-0410facd.entry.js +2 -0
- package/dist/native/p-0410facd.entry.js.map +1 -0
- package/dist/native/{p-519b4819.entry.js → p-08ca678c.entry.js} +2 -2
- package/dist/native/{p-cfe0a6c6.entry.js → p-0ec2d430.entry.js} +2 -2
- package/dist/native/{p-cfe0a6c6.entry.js.map → p-0ec2d430.entry.js.map} +1 -1
- package/dist/native/p-14895e84.entry.js +2 -0
- package/dist/native/p-14895e84.entry.js.map +1 -0
- package/dist/native/p-1a5d3b87.entry.js +2 -0
- package/dist/native/{p-7c676f2c.entry.js.map → p-1a5d3b87.entry.js.map} +1 -1
- package/dist/native/{p-0323daf6.entry.js → p-1c1ecd38.entry.js} +2 -2
- package/dist/native/{p-16a4cdf3.entry.js → p-1d98477d.entry.js} +2 -2
- package/dist/native/{p-19fb0fd0.entry.js → p-2006f5d4.entry.js} +2 -2
- package/dist/native/p-24659a85.entry.js +2 -0
- package/dist/native/{p-ef76178b.entry.js.map → p-24659a85.entry.js.map} +1 -1
- package/dist/native/p-2b1e7675.entry.js +2 -0
- package/dist/native/{p-b0fc08e7.entry.js.map → p-2b1e7675.entry.js.map} +1 -1
- package/dist/native/{p-9fba8663.entry.js → p-2bc7d66a.entry.js} +2 -2
- package/dist/native/p-2c3fb8cc.entry.js +2 -0
- package/dist/native/p-2c3fb8cc.entry.js.map +1 -0
- package/dist/native/p-45cbe6e4.entry.js +2 -0
- package/dist/native/p-46428304.entry.js +2 -0
- package/dist/native/p-46428304.entry.js.map +1 -0
- package/dist/native/{p-c930adb7.entry.js → p-55df8bf9.entry.js} +2 -2
- package/dist/native/p-59b07b36.entry.js +2 -0
- package/dist/native/{p-987c79d8.entry.js.map → p-59b07b36.entry.js.map} +1 -1
- package/dist/native/p-6029e51b.entry.js +2 -0
- package/dist/native/{p-fc3bea07.entry.js.map → p-6029e51b.entry.js.map} +1 -1
- package/dist/native/{p-4c0d81b0.entry.js → p-7ba03c5d.entry.js} +2 -2
- package/dist/native/p-82c4bf56.entry.js +2 -0
- package/dist/native/p-82c4bf56.entry.js.map +1 -0
- package/dist/native/{p-407fc32d.entry.js → p-86ab23ea.entry.js} +2 -2
- package/dist/native/p-87784622.entry.js +2 -0
- package/dist/native/{p-05d95d4d.entry.js → p-914da1e1.entry.js} +2 -2
- package/dist/native/p-9850c1d7.entry.js +2 -0
- package/dist/native/{p-5ba3fc3c.entry.js.map → p-9850c1d7.entry.js.map} +1 -1
- package/dist/native/{p-de2c07a6.entry.js → p-a0505695.entry.js} +3 -3
- package/dist/native/p-a0505695.entry.js.map +1 -0
- package/dist/native/p-a30206c1.entry.js +2 -0
- package/dist/native/{p-aa86af25.entry.js.map → p-a30206c1.entry.js.map} +1 -1
- package/dist/native/p-abbe5d69.entry.js +2 -0
- package/dist/native/{p-7c6edd1c.entry.js.map → p-abbe5d69.entry.js.map} +1 -1
- package/dist/native/{p-221b8f72.entry.js → p-ad128108.entry.js} +2 -2
- package/dist/native/{p-f0ddf60b.entry.js → p-b5b9190a.entry.js} +2 -2
- package/dist/native/p-c7b8b7ba.entry.js +2 -0
- package/dist/native/{p-fb897f7d.entry.js.map → p-c7b8b7ba.entry.js.map} +1 -1
- package/dist/native/p-c92d55f9.entry.js +2 -0
- package/dist/native/{p-3f2b6a22.entry.js → p-c9d3de9c.entry.js} +2 -2
- package/dist/native/p-cbca9326.entry.js +2 -0
- package/dist/native/{p-60b204ac.entry.js.map → p-cbca9326.entry.js.map} +1 -1
- package/dist/native/p-d0a33e64.js +3 -0
- package/dist/native/p-d0a33e64.js.map +1 -0
- package/dist/native/{p-ed488498.entry.js → p-d21b2da2.entry.js} +3 -3
- package/dist/native/{p-f85c08f1.js → p-e2d0a77d.js} +2 -2
- package/dist/native/{p-a2c0f1a7.entry.js → p-ec87200a.entry.js} +2 -2
- package/dist/native/{p-0ec1e2e3.entry.js → p-f377b285.entry.js} +2 -2
- package/dist/native/p-ff0f3794.entry.js +2 -0
- package/dist/native/{p-adc96c3a.entry.js.map → p-ff0f3794.entry.js.map} +1 -1
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +25 -45
- 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 +106 -2
- 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 +19 -6
- package/dist/types/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.d.ts +1 -0
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +1 -0
- package/dist/types/components/nv-fieldslider/nv-fieldslider.d.ts +5 -6
- package/dist/types/components.d.ts +175 -38
- package/dist/vscode-data.json +4 -4
- package/hydrate/index.js +666 -291
- package/hydrate/index.mjs +666 -291
- package/package.json +10 -2
- package/dist/cjs/index-108ddff0.js.map +0 -1
- package/dist/components/p-4656efae.js.map +0 -1
- package/dist/components/p-679e0fa9.js.map +0 -1
- package/dist/components/p-f0a5e7e4.js +0 -167
- package/dist/esm/index-8f0e5f19.js.map +0 -1
- package/dist/native/p-1e3d3374.entry.js +0 -2
- package/dist/native/p-21e7132f.entry.js +0 -2
- package/dist/native/p-21e7132f.entry.js.map +0 -1
- package/dist/native/p-2805f9f2.entry.js +0 -2
- package/dist/native/p-2805f9f2.entry.js.map +0 -1
- package/dist/native/p-5382eab2.entry.js +0 -2
- package/dist/native/p-5ba3fc3c.entry.js +0 -2
- package/dist/native/p-60b204ac.entry.js +0 -2
- package/dist/native/p-7092a675.entry.js +0 -2
- package/dist/native/p-711a7778.js +0 -3
- package/dist/native/p-711a7778.js.map +0 -1
- package/dist/native/p-759c9ce4.entry.js +0 -2
- package/dist/native/p-759c9ce4.entry.js.map +0 -1
- package/dist/native/p-7c676f2c.entry.js +0 -2
- package/dist/native/p-7c6edd1c.entry.js +0 -2
- package/dist/native/p-987c79d8.entry.js +0 -2
- package/dist/native/p-aa86af25.entry.js +0 -2
- package/dist/native/p-adc96c3a.entry.js +0 -2
- package/dist/native/p-b0fc08e7.entry.js +0 -2
- package/dist/native/p-d07ab618.entry.js +0 -2
- package/dist/native/p-dac0089b.entry.js +0 -2
- package/dist/native/p-dac0089b.entry.js.map +0 -1
- package/dist/native/p-de2c07a6.entry.js.map +0 -1
- package/dist/native/p-ef76178b.entry.js +0 -2
- package/dist/native/p-f39803d9.entry.js +0 -2
- package/dist/native/p-f39803d9.entry.js.map +0 -1
- package/dist/native/p-fb897f7d.entry.js +0 -2
- package/dist/native/p-fc3bea07.entry.js +0 -2
- /package/dist/native/{p-519b4819.entry.js.map → p-08ca678c.entry.js.map} +0 -0
- /package/dist/native/{p-0323daf6.entry.js.map → p-1c1ecd38.entry.js.map} +0 -0
- /package/dist/native/{p-16a4cdf3.entry.js.map → p-1d98477d.entry.js.map} +0 -0
- /package/dist/native/{p-19fb0fd0.entry.js.map → p-2006f5d4.entry.js.map} +0 -0
- /package/dist/native/{p-9fba8663.entry.js.map → p-2bc7d66a.entry.js.map} +0 -0
- /package/dist/native/{p-1e3d3374.entry.js.map → p-45cbe6e4.entry.js.map} +0 -0
- /package/dist/native/{p-c930adb7.entry.js.map → p-55df8bf9.entry.js.map} +0 -0
- /package/dist/native/{p-4c0d81b0.entry.js.map → p-7ba03c5d.entry.js.map} +0 -0
- /package/dist/native/{p-407fc32d.entry.js.map → p-86ab23ea.entry.js.map} +0 -0
- /package/dist/native/{p-d07ab618.entry.js.map → p-87784622.entry.js.map} +0 -0
- /package/dist/native/{p-05d95d4d.entry.js.map → p-914da1e1.entry.js.map} +0 -0
- /package/dist/native/{p-221b8f72.entry.js.map → p-ad128108.entry.js.map} +0 -0
- /package/dist/native/{p-f0ddf60b.entry.js.map → p-b5b9190a.entry.js.map} +0 -0
- /package/dist/native/{p-7092a675.entry.js.map → p-c92d55f9.entry.js.map} +0 -0
- /package/dist/native/{p-3f2b6a22.entry.js.map → p-c9d3de9c.entry.js.map} +0 -0
- /package/dist/native/{p-ed488498.entry.js.map → p-d21b2da2.entry.js.map} +0 -0
- /package/dist/native/{p-f85c08f1.js.map → p-e2d0a77d.js.map} +0 -0
- /package/dist/native/{p-a2c0f1a7.entry.js.map → p-ec87200a.entry.js.map} +0 -0
- /package/dist/native/{p-0ec1e2e3.entry.js.map → p-f377b285.entry.js.map} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import { WEEK_ABBREVIATIONS, CUSTOM_DAY_NAMES, CUSTOM_MONTH_NAMES, } from "../../utils/constants";
|
|
3
|
-
import {
|
|
3
|
+
import { parseDate, isSameDate, formatDate, isSameOrAfter, isSameOrBefore, } from "./nv-calendar.utils";
|
|
4
|
+
// Import partials
|
|
5
|
+
import { CalendarHeader, CalendarGrid, WeekNumbers, CalendarShortcuts, CalendarActions, } from "./partials";
|
|
4
6
|
/**
|
|
5
7
|
* @slot default - Child content of the component.
|
|
6
8
|
* @slot actions - Child content of the component.
|
|
@@ -11,14 +13,23 @@ export class NvCalendar {
|
|
|
11
13
|
//#region PROPERTIES
|
|
12
14
|
/**
|
|
13
15
|
* First day of the week (0 = Sunday, 1 = Monday, etc.)
|
|
14
|
-
* @default
|
|
16
|
+
* @default 1
|
|
15
17
|
*/
|
|
16
|
-
this.firstDayOfWeek =
|
|
18
|
+
this.firstDayOfWeek = 1;
|
|
17
19
|
/**
|
|
18
20
|
* Number of calendars to display
|
|
19
21
|
* @default 1
|
|
20
22
|
*/
|
|
21
23
|
this.numberOfCalendars = 1;
|
|
24
|
+
/**
|
|
25
|
+
* Selected date value. For single mode: ISO date string. For range mode: comma-separated ISO date strings.
|
|
26
|
+
* Examples:
|
|
27
|
+
* - Single: "2025-03-15"
|
|
28
|
+
* - Range: "2025-03-15,2025-03-20"
|
|
29
|
+
* @default ""
|
|
30
|
+
*/
|
|
31
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
32
|
+
this.value = '';
|
|
22
33
|
/**
|
|
23
34
|
* Locale for date formatting
|
|
24
35
|
* @default 'en-BE'
|
|
@@ -56,6 +67,75 @@ export class NvCalendar {
|
|
|
56
67
|
this.endDate = null;
|
|
57
68
|
/** List of formatted months for the selector */
|
|
58
69
|
this.months = [];
|
|
70
|
+
/**
|
|
71
|
+
* Parses the unified value prop and synchronizes with internal state
|
|
72
|
+
* @param {string} value - Value to parse
|
|
73
|
+
*/
|
|
74
|
+
this.parseUnifiedValue = (value) => {
|
|
75
|
+
if (!value) {
|
|
76
|
+
// Reset all selections
|
|
77
|
+
this.selectedDate = null;
|
|
78
|
+
this.startDate = null;
|
|
79
|
+
this.endDate = null;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const values = value
|
|
83
|
+
.split(',')
|
|
84
|
+
.map(v => v.trim())
|
|
85
|
+
.filter(Boolean);
|
|
86
|
+
if (this.selectionType === 'single' && values.length >= 1) {
|
|
87
|
+
const parsedDate = parseDate(values[0], this.dateFormat);
|
|
88
|
+
if (parsedDate) {
|
|
89
|
+
this.selectedDate = parsedDate;
|
|
90
|
+
// Only sync with legacy prop if not using actions (immediate mode)
|
|
91
|
+
if (!this.showActions) {
|
|
92
|
+
this.singleValue = values[0];
|
|
93
|
+
}
|
|
94
|
+
// Navigate to the date if not prevented
|
|
95
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
96
|
+
if (!preventNavigation) {
|
|
97
|
+
this.currentDate = parsedDate;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// Handle malformed date gracefully - reset state
|
|
102
|
+
console.warn(`Invalid date format: ${values[0]}`);
|
|
103
|
+
this.selectedDate = null;
|
|
104
|
+
if (!this.showActions) {
|
|
105
|
+
this.singleValue = '';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else if (this.selectionType === 'range' && values.length >= 2) {
|
|
110
|
+
const startDate = parseDate(values[0], this.dateFormat);
|
|
111
|
+
const endDate = parseDate(values[1], this.dateFormat);
|
|
112
|
+
if (startDate && endDate) {
|
|
113
|
+
this.startDate = startDate;
|
|
114
|
+
this.endDate = endDate;
|
|
115
|
+
// Only sync with legacy prop if not using actions (immediate mode)
|
|
116
|
+
if (!this.showActions) {
|
|
117
|
+
this.rangeValue = {
|
|
118
|
+
start: values[0],
|
|
119
|
+
end: values[1],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
// Navigate to start date if not prevented
|
|
123
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
124
|
+
if (!preventNavigation) {
|
|
125
|
+
this.currentDate = startDate;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// Handle malformed dates gracefully - reset state
|
|
130
|
+
console.warn(`Invalid date range format: ${values[0]}, ${values[1]}`);
|
|
131
|
+
this.startDate = null;
|
|
132
|
+
this.endDate = null;
|
|
133
|
+
if (!this.showActions) {
|
|
134
|
+
this.rangeValue = { start: '', end: '' };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
59
139
|
/**
|
|
60
140
|
* Change the displayed month
|
|
61
141
|
* @param {number} offset - Month offset (-1 for previous, 1 for next)
|
|
@@ -103,7 +183,14 @@ export class NvCalendar {
|
|
|
103
183
|
return;
|
|
104
184
|
const formattedDate = formatDate(date, { dateFormat: this.dateFormat });
|
|
105
185
|
this.selectedDate = date;
|
|
106
|
-
|
|
186
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
187
|
+
this.value = formattedDate;
|
|
188
|
+
this.valueChanged.emit(formattedDate);
|
|
189
|
+
// Legacy support (deprecated) - only sync props if not using actions
|
|
190
|
+
if (!this.showActions) {
|
|
191
|
+
this.singleValue = formattedDate;
|
|
192
|
+
this.singleDateChange.emit(formattedDate);
|
|
193
|
+
}
|
|
107
194
|
};
|
|
108
195
|
/**
|
|
109
196
|
* Handles range date selection
|
|
@@ -111,18 +198,32 @@ export class NvCalendar {
|
|
|
111
198
|
*/
|
|
112
199
|
this.handleRangeSelection = (date) => {
|
|
113
200
|
if (!this.startDate || (this.startDate && this.endDate)) {
|
|
201
|
+
// Start new range selection
|
|
114
202
|
this.startDate = date;
|
|
115
203
|
this.endDate = null;
|
|
116
204
|
}
|
|
117
205
|
else {
|
|
206
|
+
// Complete range selection
|
|
118
207
|
this.endDate = date;
|
|
208
|
+
// Ensure correct order
|
|
119
209
|
if (this.startDate > this.endDate) {
|
|
120
210
|
[this.startDate, this.endDate] = [this.endDate, this.startDate];
|
|
121
211
|
}
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
212
|
+
const startFormatted = formatDate(this.startDate, {
|
|
213
|
+
dateFormat: this.dateFormat,
|
|
214
|
+
});
|
|
215
|
+
const endFormatted = formatDate(this.endDate, {
|
|
216
|
+
dateFormat: this.dateFormat,
|
|
125
217
|
});
|
|
218
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
219
|
+
this.value = `${startFormatted},${endFormatted}`;
|
|
220
|
+
this.valueChanged.emit(this.value);
|
|
221
|
+
// Legacy support (deprecated) - only sync props if not using actions
|
|
222
|
+
if (!this.showActions) {
|
|
223
|
+
const legacyRange = { start: startFormatted, end: endFormatted };
|
|
224
|
+
this.rangeDateChange.emit(legacyRange);
|
|
225
|
+
this.rangeValue = legacyRange;
|
|
226
|
+
}
|
|
126
227
|
}
|
|
127
228
|
};
|
|
128
229
|
/**
|
|
@@ -181,23 +282,35 @@ export class NvCalendar {
|
|
|
181
282
|
* @returns {string[]} Array of short day names
|
|
182
283
|
*/
|
|
183
284
|
this.getDayNames = () => {
|
|
285
|
+
let days;
|
|
184
286
|
// If we have custom day names for this locale
|
|
185
287
|
if (CUSTOM_DAY_NAMES[this.locale]) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
288
|
+
// Custom day names are expected to start with Monday (index 0 = Monday)
|
|
289
|
+
days = [...CUSTOM_DAY_NAMES[this.locale]];
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
// Generate days using Intl.DateTimeFormat, starting from Monday
|
|
293
|
+
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
294
|
+
weekday: 'short',
|
|
295
|
+
});
|
|
296
|
+
// Generate days starting from Monday (2023-01-02 was a Monday)
|
|
297
|
+
days = [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 2)).toUpperCase());
|
|
298
|
+
}
|
|
299
|
+
// Now reorganize based on firstDayOfWeek
|
|
300
|
+
// 0 = Sunday, 1 = Monday (default), 2 = Tuesday, etc.
|
|
301
|
+
if (this.firstDayOfWeek === 0) {
|
|
302
|
+
// If Sunday is first day, move Sunday (last element) to the beginning
|
|
303
|
+
return [days[6], ...days.slice(0, 6)];
|
|
304
|
+
}
|
|
305
|
+
else if (this.firstDayOfWeek === 1) {
|
|
306
|
+
// If Monday is first day, return as-is (since our array starts with Monday)
|
|
307
|
+
return days;
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
// For other first days (Tuesday=2, Wednesday=3, etc.)
|
|
311
|
+
const offset = this.firstDayOfWeek - 1; // Convert to 0-based offset from Monday
|
|
312
|
+
return [...days.slice(offset), ...days.slice(0, offset)];
|
|
191
313
|
}
|
|
192
|
-
// Otherwise, use the default behavior
|
|
193
|
-
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
194
|
-
weekday: 'short',
|
|
195
|
-
});
|
|
196
|
-
const days = [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 1)).toUpperCase());
|
|
197
|
-
// Reorganize the days based on the first day of the week
|
|
198
|
-
const firstDays = days.slice(0, this.firstDayOfWeek);
|
|
199
|
-
const remainingDays = days.slice(this.firstDayOfWeek);
|
|
200
|
-
return [...remainingDays, ...firstDays];
|
|
201
314
|
};
|
|
202
315
|
/**
|
|
203
316
|
* Generates the days of the current month
|
|
@@ -378,8 +491,15 @@ export class NvCalendar {
|
|
|
378
491
|
if (shortcut.singleValue) {
|
|
379
492
|
const newDate = parseDate(shortcut.singleValue, this.dateFormat);
|
|
380
493
|
this.selectedDate = newDate;
|
|
381
|
-
|
|
382
|
-
|
|
494
|
+
const formattedDate = formatDate(newDate, {
|
|
495
|
+
dateFormat: this.dateFormat,
|
|
496
|
+
});
|
|
497
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
498
|
+
this.value = formattedDate;
|
|
499
|
+
this.valueChanged.emit(formattedDate);
|
|
500
|
+
// Legacy support (deprecated) - sync props
|
|
501
|
+
this.singleValue = formattedDate;
|
|
502
|
+
this.singleDateChange.emit(formattedDate);
|
|
383
503
|
if (!this.showActions) {
|
|
384
504
|
const event = new CustomEvent('closePopover', {
|
|
385
505
|
bubbles: true,
|
|
@@ -394,14 +514,18 @@ export class NvCalendar {
|
|
|
394
514
|
const end = parseDate(shortcut.rangeValue.end, this.dateFormat);
|
|
395
515
|
this.startDate = start;
|
|
396
516
|
this.endDate = end;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
end: formatDate(end, { dateFormat: this.dateFormat }),
|
|
517
|
+
const startFormatted = formatDate(start, {
|
|
518
|
+
dateFormat: this.dateFormat,
|
|
400
519
|
});
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
520
|
+
const endFormatted = formatDate(end, { dateFormat: this.dateFormat });
|
|
521
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
522
|
+
this.value = `${startFormatted},${endFormatted}`;
|
|
523
|
+
this.valueChanged.emit(this.value);
|
|
524
|
+
// Legacy support (deprecated) - sync props
|
|
525
|
+
const legacyRange = { start: startFormatted, end: endFormatted };
|
|
526
|
+
this.rangeDateChange.emit(legacyRange);
|
|
527
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
528
|
+
this.rangeValue = legacyRange;
|
|
405
529
|
if (!this.showActions) {
|
|
406
530
|
const event = new CustomEvent('closePopover', {
|
|
407
531
|
bubbles: true,
|
|
@@ -419,79 +543,28 @@ export class NvCalendar {
|
|
|
419
543
|
this.forceCalendarUpdate = newDate => {
|
|
420
544
|
this.currentDate = new Date(newDate);
|
|
421
545
|
};
|
|
422
|
-
/**
|
|
423
|
-
* Handles month change with an offset
|
|
424
|
-
* @param {number} direction - Direction (-1 for previous, 1 for next)
|
|
425
|
-
* @returns {Function} Change month handler
|
|
426
|
-
*/
|
|
427
|
-
this.getChangeMonthHandler = (direction) => {
|
|
428
|
-
return () => this.changeMonth(direction);
|
|
429
|
-
};
|
|
430
|
-
/**
|
|
431
|
-
* Handles month change from an event (ex: dropdown)
|
|
432
|
-
* @param {number} offset - Month offset (0 by default)
|
|
433
|
-
* @returns {Function} Change month handler
|
|
434
|
-
*/
|
|
435
|
-
this.getHandleMonthChange = (offset) => {
|
|
436
|
-
return (event) => this.handleMonthChange(event, offset);
|
|
437
|
-
};
|
|
438
|
-
/**
|
|
439
|
-
* Handles year change from an event (ex: dropdown)
|
|
440
|
-
* @param {number} offset - Year offset (0 by default)
|
|
441
|
-
* @returns {Function} Change year handler
|
|
442
|
-
*/
|
|
443
|
-
this.getHandleYearChange = (offset) => {
|
|
444
|
-
return (event) => this.handleYearChange(event, offset);
|
|
445
|
-
};
|
|
446
|
-
/**
|
|
447
|
-
* Handles day click
|
|
448
|
-
* @param {Date} date - Date to handle
|
|
449
|
-
* @param {boolean} isDisabled - Whether the date is disabled
|
|
450
|
-
* @returns {Function} Day click handler
|
|
451
|
-
*/
|
|
452
|
-
this.getDayClickHandler = (date, isDisabled) => {
|
|
453
|
-
return isDisabled ? undefined : () => this.handleDateSelection(date);
|
|
454
|
-
};
|
|
455
|
-
/**
|
|
456
|
-
* Handles shortcut selection
|
|
457
|
-
* @param {Object} shortcut - Shortcut to handle
|
|
458
|
-
* @param {string | Date} shortcut.singleValue - Selected date value
|
|
459
|
-
* @param {Object} shortcut.rangeValue - Start and end date values
|
|
460
|
-
* @param {string | Date} shortcut.rangeValue.start - Start date value
|
|
461
|
-
* @param {string | Date} shortcut.rangeValue.end - End date value
|
|
462
|
-
* @param {string} shortcut.label - Label
|
|
463
|
-
* @returns {Function} Shortcut selection handler
|
|
464
|
-
*/
|
|
465
|
-
this.getShortcutHandler = (shortcut) => {
|
|
466
|
-
return () => this.applyShortcut(shortcut);
|
|
467
|
-
};
|
|
468
|
-
/**
|
|
469
|
-
* Handles week selection
|
|
470
|
-
* @param {Date[]} dates - Dates to handle
|
|
471
|
-
* @param {number} index - Calendar index
|
|
472
|
-
* @returns {Function} Week selection handler
|
|
473
|
-
*/
|
|
474
|
-
this.getWeekSelectionHandler = (dates, index) => {
|
|
475
|
-
return () => {
|
|
476
|
-
if (this.selectionType === 'range') {
|
|
477
|
-
this.handleWeekSelection(dates, index);
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
};
|
|
481
546
|
/**
|
|
482
547
|
* Resets the current selection
|
|
483
548
|
*/
|
|
484
549
|
this.resetSelection = () => {
|
|
485
550
|
if (this.selectionType === 'single') {
|
|
486
551
|
this.selectedDate = null;
|
|
552
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
487
553
|
this.singleValue = null;
|
|
554
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
555
|
+
this.value = '';
|
|
488
556
|
this.singleDateChange.emit('');
|
|
557
|
+
this.valueChanged.emit('');
|
|
489
558
|
}
|
|
490
559
|
else {
|
|
491
560
|
this.startDate = null;
|
|
492
561
|
this.endDate = null;
|
|
562
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
493
563
|
this.rangeValue = null;
|
|
564
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
565
|
+
this.value = '';
|
|
494
566
|
this.rangeDateChange.emit({ start: '', end: '' });
|
|
567
|
+
this.valueChanged.emit('');
|
|
495
568
|
}
|
|
496
569
|
};
|
|
497
570
|
/**
|
|
@@ -503,6 +576,7 @@ export class NvCalendar {
|
|
|
503
576
|
dateFormat: this.dateFormat,
|
|
504
577
|
});
|
|
505
578
|
this.singleDateChange.emit(dateStr);
|
|
579
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
506
580
|
this.singleValue = dateStr;
|
|
507
581
|
const event = new CustomEvent('closePopover', {
|
|
508
582
|
bubbles: true,
|
|
@@ -517,6 +591,7 @@ export class NvCalendar {
|
|
|
517
591
|
start: formatDate(this.startDate, { dateFormat: this.dateFormat }),
|
|
518
592
|
end: formatDate(this.endDate, { dateFormat: this.dateFormat }),
|
|
519
593
|
});
|
|
594
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
520
595
|
this.rangeValue = {
|
|
521
596
|
start: formatDate(this.startDate, { dateFormat: this.dateFormat }),
|
|
522
597
|
end: formatDate(this.endDate, { dateFormat: this.dateFormat }),
|
|
@@ -539,8 +614,7 @@ export class NvCalendar {
|
|
|
539
614
|
* @description Renders the header of the calendar
|
|
540
615
|
*/
|
|
541
616
|
this.renderHeader = (offset, index) => {
|
|
542
|
-
return (h(
|
|
543
|
-
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" }))));
|
|
617
|
+
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 }));
|
|
544
618
|
};
|
|
545
619
|
/**
|
|
546
620
|
* Renders the week numbers
|
|
@@ -554,42 +628,7 @@ export class NvCalendar {
|
|
|
554
628
|
weeks,
|
|
555
629
|
/** Calendar index */
|
|
556
630
|
index) => {
|
|
557
|
-
return (h(
|
|
558
|
-
var _a;
|
|
559
|
-
const dates = week.map(d => d.date);
|
|
560
|
-
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())));
|
|
561
|
-
})));
|
|
562
|
-
};
|
|
563
|
-
this.renderDaysGrid = (
|
|
564
|
-
/** Days to render */
|
|
565
|
-
days) => {
|
|
566
|
-
return (h("div", { class: "days-grid" }, days.map(day => {
|
|
567
|
-
const date = day.date;
|
|
568
|
-
if (!date)
|
|
569
|
-
return null;
|
|
570
|
-
const isSelected = this.selectionType === 'single' &&
|
|
571
|
-
isSameDate(date, this.selectedDate, { isUTCMode: this.isUTCMode });
|
|
572
|
-
const isInRange = this.isDateInRange(date);
|
|
573
|
-
const isStart = isSameDate(date, this.startDate, {
|
|
574
|
-
isUTCMode: this.isUTCMode,
|
|
575
|
-
});
|
|
576
|
-
const isEnd = isSameDate(date, this.endDate, {
|
|
577
|
-
isUTCMode: this.isUTCMode,
|
|
578
|
-
});
|
|
579
|
-
const isToday = this.isToday(date);
|
|
580
|
-
const isOutsideMonth = !day.isCurrentMonth;
|
|
581
|
-
const dayClasses = [
|
|
582
|
-
'day',
|
|
583
|
-
isSelected ? 'selected' : '',
|
|
584
|
-
isStart ? 'range-start' : '',
|
|
585
|
-
isEnd ? 'range-end' : '',
|
|
586
|
-
isInRange ? 'in-range' : '',
|
|
587
|
-
day.isDisabled ? 'disabled' : '',
|
|
588
|
-
isOutsideMonth ? 'outside-month' : '',
|
|
589
|
-
isToday ? 'is-today' : '',
|
|
590
|
-
];
|
|
591
|
-
return (h("div", { class: dayClasses.filter(Boolean).join(' '), onClick: this.getDayClickHandler(date, day.isDisabled), "aria-disabled": day.isDisabled, key: `day-${date.toISOString()}` }, day.dayOfMonth));
|
|
592
|
-
})));
|
|
631
|
+
return (h(WeekNumbers, { weeks: weeks, localizedWeekText: this.getLocalizedWeekText(), selectionType: this.selectionType, onWeekSelect: this.handleWeekSelection, calendarIndex: index }));
|
|
593
632
|
};
|
|
594
633
|
/**
|
|
595
634
|
* Renders the calendar
|
|
@@ -608,7 +647,7 @@ export class NvCalendar {
|
|
|
608
647
|
for (let i = 0; i < days.length; i += 7) {
|
|
609
648
|
weeks.push(days.slice(i, i + 7));
|
|
610
649
|
}
|
|
611
|
-
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(
|
|
650
|
+
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" }))));
|
|
612
651
|
};
|
|
613
652
|
/**
|
|
614
653
|
* Renders the shortcuts
|
|
@@ -619,7 +658,7 @@ export class NvCalendar {
|
|
|
619
658
|
if (!this.hasShortcuts) {
|
|
620
659
|
return null;
|
|
621
660
|
}
|
|
622
|
-
return (h(
|
|
661
|
+
return (h(CalendarShortcuts, { shortcuts: this.shortcuts, placement: this.shortcutsPlacement, onShortcutClick: this.applyShortcut }));
|
|
623
662
|
};
|
|
624
663
|
/**
|
|
625
664
|
* Renders the actions
|
|
@@ -628,7 +667,7 @@ export class NvCalendar {
|
|
|
628
667
|
* @slot actions - Child content of the component.
|
|
629
668
|
*/
|
|
630
669
|
this.renderActions = () => {
|
|
631
|
-
return (h("div", { class: "datepicker-actions" }, h("slot", { name: "actions" }, h(
|
|
670
|
+
return (h("div", { class: "datepicker-actions" }, h("slot", { name: "actions" }, h(CalendarActions, { onReset: this.resetSelection, onConfirm: this.confirmSelection, useSlot: false }))));
|
|
632
671
|
};
|
|
633
672
|
}
|
|
634
673
|
//#endregion EVENTS
|
|
@@ -692,12 +731,26 @@ export class NvCalendar {
|
|
|
692
731
|
}
|
|
693
732
|
}
|
|
694
733
|
}
|
|
734
|
+
/**
|
|
735
|
+
* Watches the changes of the unified value prop
|
|
736
|
+
* @param {string} newValue - New value
|
|
737
|
+
* @param {string} oldValue - Old value
|
|
738
|
+
*/
|
|
739
|
+
onValueChange(newValue, oldValue) {
|
|
740
|
+
if (newValue !== oldValue) {
|
|
741
|
+
this.parseUnifiedValue(newValue);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
695
744
|
//#endregion WATCHERS
|
|
696
745
|
/****************************************************************************/
|
|
697
746
|
//#region LIFECYCLE
|
|
698
747
|
componentWillLoad() {
|
|
699
748
|
this.parseDisabledDates();
|
|
700
|
-
|
|
749
|
+
// Initialize from unified value prop if provided
|
|
750
|
+
if (this.value) {
|
|
751
|
+
this.parseUnifiedValue(this.value);
|
|
752
|
+
}
|
|
753
|
+
else if (this.selectionType === 'single' && this.singleValue) {
|
|
701
754
|
this.selectedDate = parseDate(this.singleValue, this.dateFormat);
|
|
702
755
|
this.currentDate = this.selectedDate;
|
|
703
756
|
}
|
|
@@ -710,6 +763,7 @@ export class NvCalendar {
|
|
|
710
763
|
this.currentDate = startDate;
|
|
711
764
|
if (swapped) {
|
|
712
765
|
// If dates were swapped, update the rangeValue property
|
|
766
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
713
767
|
this.rangeValue = {
|
|
714
768
|
start: formatDate(startDate, { dateFormat: this.dateFormat }),
|
|
715
769
|
end: formatDate(endDate, { dateFormat: this.dateFormat }),
|
|
@@ -721,7 +775,8 @@ export class NvCalendar {
|
|
|
721
775
|
console.error('Invalid rangeValue:', error);
|
|
722
776
|
}
|
|
723
777
|
}
|
|
724
|
-
|
|
778
|
+
// Ensure currentDate is always initialized
|
|
779
|
+
if (!this.currentDate) {
|
|
725
780
|
this.currentDate = new Date();
|
|
726
781
|
}
|
|
727
782
|
this.initializeMonths();
|
|
@@ -791,8 +846,8 @@ export class NvCalendar {
|
|
|
791
846
|
* @slot default - Child content of the component.
|
|
792
847
|
*/
|
|
793
848
|
render() {
|
|
794
|
-
return (h(Host, { key: '
|
|
795
|
-
this.hasActions) && (h("div", { key: '
|
|
849
|
+
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') ||
|
|
850
|
+
this.hasActions) && (h("div", { key: '1765334bf15564bc9886b210c54bddba64c7042e', class: "datepicker-controls" }, this.shortcutsPlacement === 'bottom' && this.renderShortcuts(), this.hasActions && this.renderActions())))), h("slot", { key: '0ac3446394b8c23b859e5f0065370b95b6fd05d2' })));
|
|
796
851
|
}
|
|
797
852
|
static get is() { return "nv-calendar"; }
|
|
798
853
|
static get originalStyleUrls() {
|
|
@@ -820,7 +875,7 @@ export class NvCalendar {
|
|
|
820
875
|
"docs": {
|
|
821
876
|
"tags": [{
|
|
822
877
|
"name": "default",
|
|
823
|
-
"text": "
|
|
878
|
+
"text": "1"
|
|
824
879
|
}],
|
|
825
880
|
"text": "First day of the week (0 = Sunday, 1 = Monday, etc.)"
|
|
826
881
|
},
|
|
@@ -828,7 +883,7 @@ export class NvCalendar {
|
|
|
828
883
|
"setter": false,
|
|
829
884
|
"attribute": "first-day-of-week",
|
|
830
885
|
"reflect": true,
|
|
831
|
-
"defaultValue": "
|
|
886
|
+
"defaultValue": "1"
|
|
832
887
|
},
|
|
833
888
|
"numberOfCalendars": {
|
|
834
889
|
"type": "number",
|
|
@@ -853,6 +908,29 @@ export class NvCalendar {
|
|
|
853
908
|
"reflect": true,
|
|
854
909
|
"defaultValue": "1"
|
|
855
910
|
},
|
|
911
|
+
"value": {
|
|
912
|
+
"type": "string",
|
|
913
|
+
"mutable": true,
|
|
914
|
+
"complexType": {
|
|
915
|
+
"original": "string",
|
|
916
|
+
"resolved": "string",
|
|
917
|
+
"references": {}
|
|
918
|
+
},
|
|
919
|
+
"required": false,
|
|
920
|
+
"optional": false,
|
|
921
|
+
"docs": {
|
|
922
|
+
"tags": [{
|
|
923
|
+
"name": "default",
|
|
924
|
+
"text": "\"\""
|
|
925
|
+
}],
|
|
926
|
+
"text": "Selected date value. For single mode: ISO date string. For range mode: comma-separated ISO date strings.\nExamples:\n- Single: \"2025-03-15\"\n- Range: \"2025-03-15,2025-03-20\""
|
|
927
|
+
},
|
|
928
|
+
"getter": false,
|
|
929
|
+
"setter": false,
|
|
930
|
+
"attribute": "value",
|
|
931
|
+
"reflect": true,
|
|
932
|
+
"defaultValue": "''"
|
|
933
|
+
},
|
|
856
934
|
"singleValue": {
|
|
857
935
|
"type": "string",
|
|
858
936
|
"mutable": true,
|
|
@@ -1155,6 +1233,24 @@ export class NvCalendar {
|
|
|
1155
1233
|
}
|
|
1156
1234
|
}
|
|
1157
1235
|
}
|
|
1236
|
+
}, {
|
|
1237
|
+
"method": "valueChanged",
|
|
1238
|
+
"name": "valueChanged",
|
|
1239
|
+
"bubbles": true,
|
|
1240
|
+
"cancelable": true,
|
|
1241
|
+
"composed": true,
|
|
1242
|
+
"docs": {
|
|
1243
|
+
"tags": [{
|
|
1244
|
+
"name": "bind",
|
|
1245
|
+
"text": "value"
|
|
1246
|
+
}],
|
|
1247
|
+
"text": "Emitted when the unified value changes"
|
|
1248
|
+
},
|
|
1249
|
+
"complexType": {
|
|
1250
|
+
"original": "string",
|
|
1251
|
+
"resolved": "string",
|
|
1252
|
+
"references": {}
|
|
1253
|
+
}
|
|
1158
1254
|
}];
|
|
1159
1255
|
}
|
|
1160
1256
|
static get elementRef() { return "el"; }
|
|
@@ -1171,6 +1267,9 @@ export class NvCalendar {
|
|
|
1171
1267
|
}, {
|
|
1172
1268
|
"propName": "singleValue",
|
|
1173
1269
|
"methodName": "onSingleValueChange"
|
|
1270
|
+
}, {
|
|
1271
|
+
"propName": "value",
|
|
1272
|
+
"methodName": "onValueChange"
|
|
1174
1273
|
}];
|
|
1175
1274
|
}
|
|
1176
1275
|
}
|