@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,9 +1,5 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent,
|
|
1
|
+
import { h, p as proxyCustomElement, H, c as createEvent, d as Host } from './p-aff3ed68.js';
|
|
2
2
|
import { C as CUSTOM_DAY_NAMES, b as CUSTOM_MONTH_NAMES, W as WEEK_ABBREVIATIONS } from './p-1f505531.js';
|
|
3
|
-
import { d as defineCustomElement$4 } from './p-cbe9521f.js';
|
|
4
|
-
import { d as defineCustomElement$3 } from './p-76a30bf1.js';
|
|
5
|
-
import { d as defineCustomElement$2 } from './p-04cb3a6f.js';
|
|
6
|
-
import { d as defineCustomElement$1 } from './p-83c8873a.js';
|
|
7
3
|
|
|
8
4
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
9
5
|
|
|
@@ -165,9 +161,18 @@ function isSameOrAfter(date, compareDate, options) {
|
|
|
165
161
|
* @returns {number} Week number
|
|
166
162
|
*/
|
|
167
163
|
function getWeekNumber(date) {
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
164
|
+
// Create a copy of the date to avoid modifying the original
|
|
165
|
+
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
166
|
+
// Adjust to the same week Thursday (ISO 8601)
|
|
167
|
+
d.setUTCDate(d.getUTCDate() + 3 - ((d.getUTCDay() + 6) % 7));
|
|
168
|
+
// Calculate the first Thursday of the year
|
|
169
|
+
const week1 = new Date(Date.UTC(d.getUTCFullYear(), 0, 4));
|
|
170
|
+
// Calculate the week number
|
|
171
|
+
return (1 +
|
|
172
|
+
Math.round(((d.getTime() - week1.getTime()) / 86400000 -
|
|
173
|
+
3 +
|
|
174
|
+
((week1.getUTCDay() + 6) % 7)) /
|
|
175
|
+
7));
|
|
171
176
|
}
|
|
172
177
|
/**
|
|
173
178
|
* Convert a date string/Date to a Date without timezone offset
|
|
@@ -232,15 +237,200 @@ function parseDate(dateInput, dateFormat) {
|
|
|
232
237
|
parsed = dayjs(dateInput, dateFormat, true);
|
|
233
238
|
}
|
|
234
239
|
if (!parsed.isValid()) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
240
|
+
// Check if the date input contains placeholder characters (incomplete input from Inputmask)
|
|
241
|
+
// This specifically targets partial dates being typed with placeholder characters
|
|
242
|
+
const hasPlaceholderChars = typeof dateInput === 'string' &&
|
|
243
|
+
(dateInput.includes('_') ||
|
|
244
|
+
dateInput.includes('-_') ||
|
|
245
|
+
dateInput.includes('/_') ||
|
|
246
|
+
dateInput.includes('._'));
|
|
247
|
+
// Check if it looks like a partial date being typed (starts with valid pattern)
|
|
248
|
+
const looksLikePartialDate = typeof dateInput === 'string' &&
|
|
249
|
+
dateInput.length < dateFormat.length &&
|
|
250
|
+
/^[\d\-/.]*$/.test(dateInput) && // Only contains digits and date separators
|
|
251
|
+
dateInput.length > 0;
|
|
252
|
+
const isIncompleteInput = hasPlaceholderChars || looksLikePartialDate;
|
|
253
|
+
// Only log error if it's not an incomplete input (to avoid spam during typing)
|
|
254
|
+
if (!isIncompleteInput) {
|
|
255
|
+
console.error(`Parsing error:`, {
|
|
256
|
+
dateInput,
|
|
257
|
+
dateFormat: dateFormat,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
239
260
|
return null;
|
|
240
261
|
}
|
|
241
262
|
return parsed.toDate();
|
|
242
263
|
}
|
|
243
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Renders a single day cell in the calendar grid
|
|
267
|
+
* @param {DayCellProps} props - Component properties
|
|
268
|
+
* @returns {JSX.Element} JSX element representing a day cell
|
|
269
|
+
*/
|
|
270
|
+
const DayCell = props => {
|
|
271
|
+
const { date, dayOfMonth, isCurrentMonth, isSelected, isInRange, isStart, isEnd, isToday, isDisabled, onClick, } = props;
|
|
272
|
+
// Build CSS classes for the day cell
|
|
273
|
+
const dayClasses = [
|
|
274
|
+
'day',
|
|
275
|
+
isSelected ? 'selected' : '',
|
|
276
|
+
isStart ? 'range-start' : '',
|
|
277
|
+
isEnd ? 'range-end' : '',
|
|
278
|
+
isInRange ? 'in-range' : '',
|
|
279
|
+
isDisabled ? 'disabled' : '',
|
|
280
|
+
!isCurrentMonth ? 'outside-month' : '',
|
|
281
|
+
isToday ? 'is-today' : '',
|
|
282
|
+
]
|
|
283
|
+
.filter(Boolean)
|
|
284
|
+
.join(' ');
|
|
285
|
+
const handleClick = () => {
|
|
286
|
+
if (!isDisabled && onClick) {
|
|
287
|
+
onClick(date);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
return (
|
|
291
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
292
|
+
h("div", { class: dayClasses, onClick: handleClick, "aria-disabled": isDisabled }, dayOfMonth));
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Renders the action buttons for the calendar (Cancel/OK)
|
|
297
|
+
* @param {CalendarActionsProps} props - Component properties
|
|
298
|
+
* @returns {JSX.Element} JSX element representing the action buttons
|
|
299
|
+
*/
|
|
300
|
+
const CalendarActions = props => {
|
|
301
|
+
const { onReset, onConfirm, useSlot = false } = props;
|
|
302
|
+
return (h("div", { class: "datepicker-actions" }, useSlot ? (h("slot", { name: "actions" },
|
|
303
|
+
h("nv-button", { emphasis: "low", size: "xs", onClick: onReset }, "Cancel"),
|
|
304
|
+
h("nv-button", { size: "xs", onClick: onConfirm }, "OK"))) : (h("div", null,
|
|
305
|
+
h("nv-button", { emphasis: "low", size: "xs", onClick: onReset }, "Cancel"),
|
|
306
|
+
h("nv-button", { size: "xs", onClick: onConfirm }, "OK")))));
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Renders the week numbers column for the calendar
|
|
311
|
+
* @param {WeekNumbersProps} props - Component properties
|
|
312
|
+
* @returns {JSX.Element} JSX element representing the week numbers
|
|
313
|
+
*/
|
|
314
|
+
const WeekNumbers = props => {
|
|
315
|
+
const { weeks, localizedWeekText, selectionType, onWeekSelect, calendarIndex, } = props;
|
|
316
|
+
/**
|
|
317
|
+
* Handles click on a week number for range selection
|
|
318
|
+
* @param {Array<WeekData>} week - Week data
|
|
319
|
+
*/
|
|
320
|
+
const handleWeekClick = (week) => {
|
|
321
|
+
if (selectionType === 'range') {
|
|
322
|
+
const dates = week.map(d => d.date);
|
|
323
|
+
onWeekSelect(dates, calendarIndex);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* Creates a click handler for a specific week
|
|
328
|
+
* @param {Array<WeekData>} week - Week data
|
|
329
|
+
* @returns {() => void} Click handler function
|
|
330
|
+
*/
|
|
331
|
+
const createWeekHandler = (week) => {
|
|
332
|
+
return () => handleWeekClick(week);
|
|
333
|
+
};
|
|
334
|
+
return (h("div", { class: "week-numbers" },
|
|
335
|
+
h("div", { class: "week-header" }, localizedWeekText),
|
|
336
|
+
weeks.map((week, weekIndex) => {
|
|
337
|
+
var _a;
|
|
338
|
+
const firstDayWithDate = ((_a = week.find(d => d.date)) === null || _a === void 0 ? void 0 : _a.date) || new Date();
|
|
339
|
+
const weekNumber = getWeekNumber(firstDayWithDate);
|
|
340
|
+
const isClickable = selectionType === 'range';
|
|
341
|
+
return (h("div", { class: `week-number ${isClickable ? 'clickable' : ''}`, onClick: createWeekHandler(week), key: `week-${weekIndex}`, role: isClickable ? 'button' : undefined, tabindex: isClickable ? 0 : undefined }, weekNumber));
|
|
342
|
+
})));
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Renders the shortcuts for quick date selection
|
|
347
|
+
* @param {CalendarShortcutsProps} props - Component properties
|
|
348
|
+
* @returns {JSX.Element | null} JSX element representing the shortcuts or null if no shortcuts
|
|
349
|
+
*/
|
|
350
|
+
const CalendarShortcuts = props => {
|
|
351
|
+
const { shortcuts, placement, onShortcutClick } = props;
|
|
352
|
+
if (!shortcuts || shortcuts.length === 0) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Creates a click handler for a specific shortcut
|
|
357
|
+
* @param {ShortcutData} shortcut - The shortcut data
|
|
358
|
+
* @returns {() => void} Click handler function
|
|
359
|
+
*/
|
|
360
|
+
const createShortcutHandler = (shortcut) => {
|
|
361
|
+
return () => onShortcutClick(shortcut);
|
|
362
|
+
};
|
|
363
|
+
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)))));
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Renders the calendar header with navigation and date controls
|
|
368
|
+
* @param {CalendarHeaderProps} props - Component properties
|
|
369
|
+
* @returns {JSX.Element} JSX element representing the calendar header
|
|
370
|
+
*/
|
|
371
|
+
const CalendarHeader = props => {
|
|
372
|
+
const { currentDate, months, numberOfCalendars, calendarIndex, monthOffset, onMonthChange, onMonthSelect, onYearChange, } = props;
|
|
373
|
+
/**
|
|
374
|
+
* Creates navigation handler for month change
|
|
375
|
+
* @param {number} direction - Direction of navigation (-1 or 1)
|
|
376
|
+
* @returns {() => void} Navigation handler function
|
|
377
|
+
*/
|
|
378
|
+
const createNavigationHandler = (direction) => {
|
|
379
|
+
return () => onMonthChange(direction);
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Creates month selection handler
|
|
383
|
+
* @param {number} offset - Month offset
|
|
384
|
+
* @returns {(event: Event) => void} Month selection handler function
|
|
385
|
+
*/
|
|
386
|
+
const createMonthSelectHandler = (offset) => {
|
|
387
|
+
return (event) => onMonthSelect(event, offset);
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Creates year change handler
|
|
391
|
+
* @param {number} offset - Month offset
|
|
392
|
+
* @returns {(event: Event) => void} Year change handler function
|
|
393
|
+
*/
|
|
394
|
+
const createYearChangeHandler = (offset) => {
|
|
395
|
+
return (event) => onYearChange(event, offset);
|
|
396
|
+
};
|
|
397
|
+
const currentMonth = (currentDate.getUTCMonth() + monthOffset) % 12;
|
|
398
|
+
const currentYear = currentDate.getUTCFullYear() +
|
|
399
|
+
Math.floor((currentDate.getUTCMonth() + monthOffset) / 12);
|
|
400
|
+
return (h("div", { class: "header" },
|
|
401
|
+
numberOfCalendars > 1 && calendarIndex === 0 && (h("nv-iconbutton", { class: "nav-left", emphasis: "lower", name: "chevron-left", onClick: createNavigationHandler(-1) })),
|
|
402
|
+
h("div", { class: "date-controls" },
|
|
403
|
+
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)))),
|
|
404
|
+
h("input", { type: "number", class: "year-input", min: "1950", max: "2100", value: currentYear, onChange: createYearChangeHandler(monthOffset) })),
|
|
405
|
+
numberOfCalendars === 1 && (h("div", { class: "nav-buttons" },
|
|
406
|
+
h("nv-iconbutton", { emphasis: "lower", name: "chevron-left", onClick: createNavigationHandler(-1) }),
|
|
407
|
+
h("nv-iconbutton", { emphasis: "lower", name: "chevron-right", onClick: createNavigationHandler(1) }))),
|
|
408
|
+
numberOfCalendars > 1 && calendarIndex === numberOfCalendars - 1 && (h("nv-iconbutton", { emphasis: "lower", name: "chevron-right", onClick: createNavigationHandler(1), class: "nav-right" }))));
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Renders the calendar grid with day headers and day cells
|
|
413
|
+
* @param {CalendarGridProps} props - Component properties
|
|
414
|
+
* @returns {JSX.Element} JSX element representing the calendar grid
|
|
415
|
+
*/
|
|
416
|
+
const CalendarGrid = props => {
|
|
417
|
+
const { days, dayNames, selectionType, selectedDate, startDate, endDate, isUTCMode, onDayClick, isDateInRange, isToday, } = props;
|
|
418
|
+
return (h("div", { class: "days-container" },
|
|
419
|
+
h("div", { class: "days-header" }, dayNames.map((day, index) => (h("div", { class: "day-header", key: `day-header-${index}` }, day)))),
|
|
420
|
+
h("div", { class: "days-grid" }, days.map(day => {
|
|
421
|
+
const date = day.date;
|
|
422
|
+
if (!date)
|
|
423
|
+
return null;
|
|
424
|
+
const isSelected = selectionType === 'single' &&
|
|
425
|
+
isSameDate(date, selectedDate, { isUTCMode });
|
|
426
|
+
const isInRange = isDateInRange(date);
|
|
427
|
+
const isStart = isSameDate(date, startDate, { isUTCMode });
|
|
428
|
+
const isEnd = isSameDate(date, endDate, { isUTCMode });
|
|
429
|
+
const isTodayDate = isToday(date);
|
|
430
|
+
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 }));
|
|
431
|
+
}))));
|
|
432
|
+
};
|
|
433
|
+
|
|
244
434
|
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)}}";
|
|
245
435
|
const NvCalendarStyle0 = nvCalendarCss;
|
|
246
436
|
|
|
@@ -250,18 +440,28 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
250
440
|
this.__registerHost();
|
|
251
441
|
this.singleDateChange = createEvent(this, "singleDateChange", 7);
|
|
252
442
|
this.rangeDateChange = createEvent(this, "rangeDateChange", 7);
|
|
443
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
253
444
|
/****************************************************************************/
|
|
254
445
|
//#region PROPERTIES
|
|
255
446
|
/**
|
|
256
447
|
* First day of the week (0 = Sunday, 1 = Monday, etc.)
|
|
257
|
-
* @default
|
|
448
|
+
* @default 1
|
|
258
449
|
*/
|
|
259
|
-
this.firstDayOfWeek =
|
|
450
|
+
this.firstDayOfWeek = 1;
|
|
260
451
|
/**
|
|
261
452
|
* Number of calendars to display
|
|
262
453
|
* @default 1
|
|
263
454
|
*/
|
|
264
455
|
this.numberOfCalendars = 1;
|
|
456
|
+
/**
|
|
457
|
+
* Selected date value. For single mode: ISO date string. For range mode: comma-separated ISO date strings.
|
|
458
|
+
* Examples:
|
|
459
|
+
* - Single: "2025-03-15"
|
|
460
|
+
* - Range: "2025-03-15,2025-03-20"
|
|
461
|
+
* @default ""
|
|
462
|
+
*/
|
|
463
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
464
|
+
this.value = '';
|
|
265
465
|
/**
|
|
266
466
|
* Locale for date formatting
|
|
267
467
|
* @default 'en-BE'
|
|
@@ -299,6 +499,75 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
299
499
|
this.endDate = null;
|
|
300
500
|
/** List of formatted months for the selector */
|
|
301
501
|
this.months = [];
|
|
502
|
+
/**
|
|
503
|
+
* Parses the unified value prop and synchronizes with internal state
|
|
504
|
+
* @param {string} value - Value to parse
|
|
505
|
+
*/
|
|
506
|
+
this.parseUnifiedValue = (value) => {
|
|
507
|
+
if (!value) {
|
|
508
|
+
// Reset all selections
|
|
509
|
+
this.selectedDate = null;
|
|
510
|
+
this.startDate = null;
|
|
511
|
+
this.endDate = null;
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
const values = value
|
|
515
|
+
.split(',')
|
|
516
|
+
.map(v => v.trim())
|
|
517
|
+
.filter(Boolean);
|
|
518
|
+
if (this.selectionType === 'single' && values.length >= 1) {
|
|
519
|
+
const parsedDate = parseDate(values[0], this.dateFormat);
|
|
520
|
+
if (parsedDate) {
|
|
521
|
+
this.selectedDate = parsedDate;
|
|
522
|
+
// Only sync with legacy prop if not using actions (immediate mode)
|
|
523
|
+
if (!this.showActions) {
|
|
524
|
+
this.singleValue = values[0];
|
|
525
|
+
}
|
|
526
|
+
// Navigate to the date if not prevented
|
|
527
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
528
|
+
if (!preventNavigation) {
|
|
529
|
+
this.currentDate = parsedDate;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
// Handle malformed date gracefully - reset state
|
|
534
|
+
console.warn(`Invalid date format: ${values[0]}`);
|
|
535
|
+
this.selectedDate = null;
|
|
536
|
+
if (!this.showActions) {
|
|
537
|
+
this.singleValue = '';
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
else if (this.selectionType === 'range' && values.length >= 2) {
|
|
542
|
+
const startDate = parseDate(values[0], this.dateFormat);
|
|
543
|
+
const endDate = parseDate(values[1], this.dateFormat);
|
|
544
|
+
if (startDate && endDate) {
|
|
545
|
+
this.startDate = startDate;
|
|
546
|
+
this.endDate = endDate;
|
|
547
|
+
// Only sync with legacy prop if not using actions (immediate mode)
|
|
548
|
+
if (!this.showActions) {
|
|
549
|
+
this.rangeValue = {
|
|
550
|
+
start: values[0],
|
|
551
|
+
end: values[1],
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
// Navigate to start date if not prevented
|
|
555
|
+
const preventNavigation = this.el.getAttribute('data-prevent-navigation') === 'true';
|
|
556
|
+
if (!preventNavigation) {
|
|
557
|
+
this.currentDate = startDate;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
// Handle malformed dates gracefully - reset state
|
|
562
|
+
console.warn(`Invalid date range format: ${values[0]}, ${values[1]}`);
|
|
563
|
+
this.startDate = null;
|
|
564
|
+
this.endDate = null;
|
|
565
|
+
if (!this.showActions) {
|
|
566
|
+
this.rangeValue = { start: '', end: '' };
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
};
|
|
302
571
|
/**
|
|
303
572
|
* Change the displayed month
|
|
304
573
|
* @param {number} offset - Month offset (-1 for previous, 1 for next)
|
|
@@ -346,7 +615,14 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
346
615
|
return;
|
|
347
616
|
const formattedDate = formatDate(date, { dateFormat: this.dateFormat });
|
|
348
617
|
this.selectedDate = date;
|
|
349
|
-
|
|
618
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
619
|
+
this.value = formattedDate;
|
|
620
|
+
this.valueChanged.emit(formattedDate);
|
|
621
|
+
// Legacy support (deprecated) - only sync props if not using actions
|
|
622
|
+
if (!this.showActions) {
|
|
623
|
+
this.singleValue = formattedDate;
|
|
624
|
+
this.singleDateChange.emit(formattedDate);
|
|
625
|
+
}
|
|
350
626
|
};
|
|
351
627
|
/**
|
|
352
628
|
* Handles range date selection
|
|
@@ -354,18 +630,32 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
354
630
|
*/
|
|
355
631
|
this.handleRangeSelection = (date) => {
|
|
356
632
|
if (!this.startDate || (this.startDate && this.endDate)) {
|
|
633
|
+
// Start new range selection
|
|
357
634
|
this.startDate = date;
|
|
358
635
|
this.endDate = null;
|
|
359
636
|
}
|
|
360
637
|
else {
|
|
638
|
+
// Complete range selection
|
|
361
639
|
this.endDate = date;
|
|
640
|
+
// Ensure correct order
|
|
362
641
|
if (this.startDate > this.endDate) {
|
|
363
642
|
[this.startDate, this.endDate] = [this.endDate, this.startDate];
|
|
364
643
|
}
|
|
365
|
-
this.
|
|
366
|
-
|
|
367
|
-
|
|
644
|
+
const startFormatted = formatDate(this.startDate, {
|
|
645
|
+
dateFormat: this.dateFormat,
|
|
646
|
+
});
|
|
647
|
+
const endFormatted = formatDate(this.endDate, {
|
|
648
|
+
dateFormat: this.dateFormat,
|
|
368
649
|
});
|
|
650
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
651
|
+
this.value = `${startFormatted},${endFormatted}`;
|
|
652
|
+
this.valueChanged.emit(this.value);
|
|
653
|
+
// Legacy support (deprecated) - only sync props if not using actions
|
|
654
|
+
if (!this.showActions) {
|
|
655
|
+
const legacyRange = { start: startFormatted, end: endFormatted };
|
|
656
|
+
this.rangeDateChange.emit(legacyRange);
|
|
657
|
+
this.rangeValue = legacyRange;
|
|
658
|
+
}
|
|
369
659
|
}
|
|
370
660
|
};
|
|
371
661
|
/**
|
|
@@ -424,23 +714,35 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
424
714
|
* @returns {string[]} Array of short day names
|
|
425
715
|
*/
|
|
426
716
|
this.getDayNames = () => {
|
|
717
|
+
let days;
|
|
427
718
|
// If we have custom day names for this locale
|
|
428
719
|
if (CUSTOM_DAY_NAMES[this.locale]) {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
720
|
+
// Custom day names are expected to start with Monday (index 0 = Monday)
|
|
721
|
+
days = [...CUSTOM_DAY_NAMES[this.locale]];
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
// Generate days using Intl.DateTimeFormat, starting from Monday
|
|
725
|
+
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
726
|
+
weekday: 'short',
|
|
727
|
+
});
|
|
728
|
+
// Generate days starting from Monday (2023-01-02 was a Monday)
|
|
729
|
+
days = [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 2)).toUpperCase());
|
|
730
|
+
}
|
|
731
|
+
// Now reorganize based on firstDayOfWeek
|
|
732
|
+
// 0 = Sunday, 1 = Monday (default), 2 = Tuesday, etc.
|
|
733
|
+
if (this.firstDayOfWeek === 0) {
|
|
734
|
+
// If Sunday is first day, move Sunday (last element) to the beginning
|
|
735
|
+
return [days[6], ...days.slice(0, 6)];
|
|
736
|
+
}
|
|
737
|
+
else if (this.firstDayOfWeek === 1) {
|
|
738
|
+
// If Monday is first day, return as-is (since our array starts with Monday)
|
|
739
|
+
return days;
|
|
740
|
+
}
|
|
741
|
+
else {
|
|
742
|
+
// For other first days (Tuesday=2, Wednesday=3, etc.)
|
|
743
|
+
const offset = this.firstDayOfWeek - 1; // Convert to 0-based offset from Monday
|
|
744
|
+
return [...days.slice(offset), ...days.slice(0, offset)];
|
|
434
745
|
}
|
|
435
|
-
// Otherwise, use the default behavior
|
|
436
|
-
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
437
|
-
weekday: 'short',
|
|
438
|
-
});
|
|
439
|
-
const days = [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 1)).toUpperCase());
|
|
440
|
-
// Reorganize the days based on the first day of the week
|
|
441
|
-
const firstDays = days.slice(0, this.firstDayOfWeek);
|
|
442
|
-
const remainingDays = days.slice(this.firstDayOfWeek);
|
|
443
|
-
return [...remainingDays, ...firstDays];
|
|
444
746
|
};
|
|
445
747
|
/**
|
|
446
748
|
* Generates the days of the current month
|
|
@@ -621,8 +923,15 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
621
923
|
if (shortcut.singleValue) {
|
|
622
924
|
const newDate = parseDate(shortcut.singleValue, this.dateFormat);
|
|
623
925
|
this.selectedDate = newDate;
|
|
624
|
-
|
|
625
|
-
|
|
926
|
+
const formattedDate = formatDate(newDate, {
|
|
927
|
+
dateFormat: this.dateFormat,
|
|
928
|
+
});
|
|
929
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
930
|
+
this.value = formattedDate;
|
|
931
|
+
this.valueChanged.emit(formattedDate);
|
|
932
|
+
// Legacy support (deprecated) - sync props
|
|
933
|
+
this.singleValue = formattedDate;
|
|
934
|
+
this.singleDateChange.emit(formattedDate);
|
|
626
935
|
if (!this.showActions) {
|
|
627
936
|
const event = new CustomEvent('closePopover', {
|
|
628
937
|
bubbles: true,
|
|
@@ -637,14 +946,18 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
637
946
|
const end = parseDate(shortcut.rangeValue.end, this.dateFormat);
|
|
638
947
|
this.startDate = start;
|
|
639
948
|
this.endDate = end;
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
end: formatDate(end, { dateFormat: this.dateFormat }),
|
|
949
|
+
const startFormatted = formatDate(start, {
|
|
950
|
+
dateFormat: this.dateFormat,
|
|
643
951
|
});
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
952
|
+
const endFormatted = formatDate(end, { dateFormat: this.dateFormat });
|
|
953
|
+
// Update the unified value prop (like nv-fieldslider)
|
|
954
|
+
this.value = `${startFormatted},${endFormatted}`;
|
|
955
|
+
this.valueChanged.emit(this.value);
|
|
956
|
+
// Legacy support (deprecated) - sync props
|
|
957
|
+
const legacyRange = { start: startFormatted, end: endFormatted };
|
|
958
|
+
this.rangeDateChange.emit(legacyRange);
|
|
959
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
960
|
+
this.rangeValue = legacyRange;
|
|
648
961
|
if (!this.showActions) {
|
|
649
962
|
const event = new CustomEvent('closePopover', {
|
|
650
963
|
bubbles: true,
|
|
@@ -662,79 +975,28 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
662
975
|
this.forceCalendarUpdate = newDate => {
|
|
663
976
|
this.currentDate = new Date(newDate);
|
|
664
977
|
};
|
|
665
|
-
/**
|
|
666
|
-
* Handles month change with an offset
|
|
667
|
-
* @param {number} direction - Direction (-1 for previous, 1 for next)
|
|
668
|
-
* @returns {Function} Change month handler
|
|
669
|
-
*/
|
|
670
|
-
this.getChangeMonthHandler = (direction) => {
|
|
671
|
-
return () => this.changeMonth(direction);
|
|
672
|
-
};
|
|
673
|
-
/**
|
|
674
|
-
* Handles month change from an event (ex: dropdown)
|
|
675
|
-
* @param {number} offset - Month offset (0 by default)
|
|
676
|
-
* @returns {Function} Change month handler
|
|
677
|
-
*/
|
|
678
|
-
this.getHandleMonthChange = (offset) => {
|
|
679
|
-
return (event) => this.handleMonthChange(event, offset);
|
|
680
|
-
};
|
|
681
|
-
/**
|
|
682
|
-
* Handles year change from an event (ex: dropdown)
|
|
683
|
-
* @param {number} offset - Year offset (0 by default)
|
|
684
|
-
* @returns {Function} Change year handler
|
|
685
|
-
*/
|
|
686
|
-
this.getHandleYearChange = (offset) => {
|
|
687
|
-
return (event) => this.handleYearChange(event, offset);
|
|
688
|
-
};
|
|
689
|
-
/**
|
|
690
|
-
* Handles day click
|
|
691
|
-
* @param {Date} date - Date to handle
|
|
692
|
-
* @param {boolean} isDisabled - Whether the date is disabled
|
|
693
|
-
* @returns {Function} Day click handler
|
|
694
|
-
*/
|
|
695
|
-
this.getDayClickHandler = (date, isDisabled) => {
|
|
696
|
-
return isDisabled ? undefined : () => this.handleDateSelection(date);
|
|
697
|
-
};
|
|
698
|
-
/**
|
|
699
|
-
* Handles shortcut selection
|
|
700
|
-
* @param {Object} shortcut - Shortcut to handle
|
|
701
|
-
* @param {string | Date} shortcut.singleValue - Selected date value
|
|
702
|
-
* @param {Object} shortcut.rangeValue - Start and end date values
|
|
703
|
-
* @param {string | Date} shortcut.rangeValue.start - Start date value
|
|
704
|
-
* @param {string | Date} shortcut.rangeValue.end - End date value
|
|
705
|
-
* @param {string} shortcut.label - Label
|
|
706
|
-
* @returns {Function} Shortcut selection handler
|
|
707
|
-
*/
|
|
708
|
-
this.getShortcutHandler = (shortcut) => {
|
|
709
|
-
return () => this.applyShortcut(shortcut);
|
|
710
|
-
};
|
|
711
|
-
/**
|
|
712
|
-
* Handles week selection
|
|
713
|
-
* @param {Date[]} dates - Dates to handle
|
|
714
|
-
* @param {number} index - Calendar index
|
|
715
|
-
* @returns {Function} Week selection handler
|
|
716
|
-
*/
|
|
717
|
-
this.getWeekSelectionHandler = (dates, index) => {
|
|
718
|
-
return () => {
|
|
719
|
-
if (this.selectionType === 'range') {
|
|
720
|
-
this.handleWeekSelection(dates, index);
|
|
721
|
-
}
|
|
722
|
-
};
|
|
723
|
-
};
|
|
724
978
|
/**
|
|
725
979
|
* Resets the current selection
|
|
726
980
|
*/
|
|
727
981
|
this.resetSelection = () => {
|
|
728
982
|
if (this.selectionType === 'single') {
|
|
729
983
|
this.selectedDate = null;
|
|
984
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
730
985
|
this.singleValue = null;
|
|
986
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
987
|
+
this.value = '';
|
|
731
988
|
this.singleDateChange.emit('');
|
|
989
|
+
this.valueChanged.emit('');
|
|
732
990
|
}
|
|
733
991
|
else {
|
|
734
992
|
this.startDate = null;
|
|
735
993
|
this.endDate = null;
|
|
994
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
736
995
|
this.rangeValue = null;
|
|
996
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
997
|
+
this.value = '';
|
|
737
998
|
this.rangeDateChange.emit({ start: '', end: '' });
|
|
999
|
+
this.valueChanged.emit('');
|
|
738
1000
|
}
|
|
739
1001
|
};
|
|
740
1002
|
/**
|
|
@@ -746,6 +1008,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
746
1008
|
dateFormat: this.dateFormat,
|
|
747
1009
|
});
|
|
748
1010
|
this.singleDateChange.emit(dateStr);
|
|
1011
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
749
1012
|
this.singleValue = dateStr;
|
|
750
1013
|
const event = new CustomEvent('closePopover', {
|
|
751
1014
|
bubbles: true,
|
|
@@ -760,6 +1023,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
760
1023
|
start: formatDate(this.startDate, { dateFormat: this.dateFormat }),
|
|
761
1024
|
end: formatDate(this.endDate, { dateFormat: this.dateFormat }),
|
|
762
1025
|
});
|
|
1026
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
763
1027
|
this.rangeValue = {
|
|
764
1028
|
start: formatDate(this.startDate, { dateFormat: this.dateFormat }),
|
|
765
1029
|
end: formatDate(this.endDate, { dateFormat: this.dateFormat }),
|
|
@@ -782,8 +1046,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
782
1046
|
* @description Renders the header of the calendar
|
|
783
1047
|
*/
|
|
784
1048
|
this.renderHeader = (offset, index) => {
|
|
785
|
-
return (h(
|
|
786
|
-
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" }))));
|
|
1049
|
+
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 }));
|
|
787
1050
|
};
|
|
788
1051
|
/**
|
|
789
1052
|
* Renders the week numbers
|
|
@@ -797,42 +1060,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
797
1060
|
weeks,
|
|
798
1061
|
/** Calendar index */
|
|
799
1062
|
index) => {
|
|
800
|
-
return (h(
|
|
801
|
-
var _a;
|
|
802
|
-
const dates = week.map(d => d.date);
|
|
803
|
-
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())));
|
|
804
|
-
})));
|
|
805
|
-
};
|
|
806
|
-
this.renderDaysGrid = (
|
|
807
|
-
/** Days to render */
|
|
808
|
-
days) => {
|
|
809
|
-
return (h("div", { class: "days-grid" }, days.map(day => {
|
|
810
|
-
const date = day.date;
|
|
811
|
-
if (!date)
|
|
812
|
-
return null;
|
|
813
|
-
const isSelected = this.selectionType === 'single' &&
|
|
814
|
-
isSameDate(date, this.selectedDate, { isUTCMode: this.isUTCMode });
|
|
815
|
-
const isInRange = this.isDateInRange(date);
|
|
816
|
-
const isStart = isSameDate(date, this.startDate, {
|
|
817
|
-
isUTCMode: this.isUTCMode,
|
|
818
|
-
});
|
|
819
|
-
const isEnd = isSameDate(date, this.endDate, {
|
|
820
|
-
isUTCMode: this.isUTCMode,
|
|
821
|
-
});
|
|
822
|
-
const isToday = this.isToday(date);
|
|
823
|
-
const isOutsideMonth = !day.isCurrentMonth;
|
|
824
|
-
const dayClasses = [
|
|
825
|
-
'day',
|
|
826
|
-
isSelected ? 'selected' : '',
|
|
827
|
-
isStart ? 'range-start' : '',
|
|
828
|
-
isEnd ? 'range-end' : '',
|
|
829
|
-
isInRange ? 'in-range' : '',
|
|
830
|
-
day.isDisabled ? 'disabled' : '',
|
|
831
|
-
isOutsideMonth ? 'outside-month' : '',
|
|
832
|
-
isToday ? 'is-today' : '',
|
|
833
|
-
];
|
|
834
|
-
return (h("div", { class: dayClasses.filter(Boolean).join(' '), onClick: this.getDayClickHandler(date, day.isDisabled), "aria-disabled": day.isDisabled, key: `day-${date.toISOString()}` }, day.dayOfMonth));
|
|
835
|
-
})));
|
|
1063
|
+
return (h(WeekNumbers, { weeks: weeks, localizedWeekText: this.getLocalizedWeekText(), selectionType: this.selectionType, onWeekSelect: this.handleWeekSelection, calendarIndex: index }));
|
|
836
1064
|
};
|
|
837
1065
|
/**
|
|
838
1066
|
* Renders the calendar
|
|
@@ -851,7 +1079,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
851
1079
|
for (let i = 0; i < days.length; i += 7) {
|
|
852
1080
|
weeks.push(days.slice(i, i + 7));
|
|
853
1081
|
}
|
|
854
|
-
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(
|
|
1082
|
+
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" }))));
|
|
855
1083
|
};
|
|
856
1084
|
/**
|
|
857
1085
|
* Renders the shortcuts
|
|
@@ -862,7 +1090,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
862
1090
|
if (!this.hasShortcuts) {
|
|
863
1091
|
return null;
|
|
864
1092
|
}
|
|
865
|
-
return (h(
|
|
1093
|
+
return (h(CalendarShortcuts, { shortcuts: this.shortcuts, placement: this.shortcutsPlacement, onShortcutClick: this.applyShortcut }));
|
|
866
1094
|
};
|
|
867
1095
|
/**
|
|
868
1096
|
* Renders the actions
|
|
@@ -871,7 +1099,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
871
1099
|
* @slot actions - Child content of the component.
|
|
872
1100
|
*/
|
|
873
1101
|
this.renderActions = () => {
|
|
874
|
-
return (h("div", { class: "datepicker-actions" }, h("slot", { name: "actions" }, h(
|
|
1102
|
+
return (h("div", { class: "datepicker-actions" }, h("slot", { name: "actions" }, h(CalendarActions, { onReset: this.resetSelection, onConfirm: this.confirmSelection, useSlot: false }))));
|
|
875
1103
|
};
|
|
876
1104
|
}
|
|
877
1105
|
//#endregion EVENTS
|
|
@@ -935,12 +1163,26 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
935
1163
|
}
|
|
936
1164
|
}
|
|
937
1165
|
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Watches the changes of the unified value prop
|
|
1168
|
+
* @param {string} newValue - New value
|
|
1169
|
+
* @param {string} oldValue - Old value
|
|
1170
|
+
*/
|
|
1171
|
+
onValueChange(newValue, oldValue) {
|
|
1172
|
+
if (newValue !== oldValue) {
|
|
1173
|
+
this.parseUnifiedValue(newValue);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
938
1176
|
//#endregion WATCHERS
|
|
939
1177
|
/****************************************************************************/
|
|
940
1178
|
//#region LIFECYCLE
|
|
941
1179
|
componentWillLoad() {
|
|
942
1180
|
this.parseDisabledDates();
|
|
943
|
-
|
|
1181
|
+
// Initialize from unified value prop if provided
|
|
1182
|
+
if (this.value) {
|
|
1183
|
+
this.parseUnifiedValue(this.value);
|
|
1184
|
+
}
|
|
1185
|
+
else if (this.selectionType === 'single' && this.singleValue) {
|
|
944
1186
|
this.selectedDate = parseDate(this.singleValue, this.dateFormat);
|
|
945
1187
|
this.currentDate = this.selectedDate;
|
|
946
1188
|
}
|
|
@@ -953,6 +1195,7 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
953
1195
|
this.currentDate = startDate;
|
|
954
1196
|
if (swapped) {
|
|
955
1197
|
// If dates were swapped, update the rangeValue property
|
|
1198
|
+
// eslint-disable-next-line @stencil-community/strict-mutable
|
|
956
1199
|
this.rangeValue = {
|
|
957
1200
|
start: formatDate(startDate, { dateFormat: this.dateFormat }),
|
|
958
1201
|
end: formatDate(endDate, { dateFormat: this.dateFormat }),
|
|
@@ -964,7 +1207,8 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
964
1207
|
console.error('Invalid rangeValue:', error);
|
|
965
1208
|
}
|
|
966
1209
|
}
|
|
967
|
-
|
|
1210
|
+
// Ensure currentDate is always initialized
|
|
1211
|
+
if (!this.currentDate) {
|
|
968
1212
|
this.currentDate = new Date();
|
|
969
1213
|
}
|
|
970
1214
|
this.initializeMonths();
|
|
@@ -1034,20 +1278,22 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
1034
1278
|
* @slot default - Child content of the component.
|
|
1035
1279
|
*/
|
|
1036
1280
|
render() {
|
|
1037
|
-
return (h(Host, { key: '
|
|
1038
|
-
this.hasActions) && (h("div", { key: '
|
|
1281
|
+
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') ||
|
|
1282
|
+
this.hasActions) && (h("div", { key: '1765334bf15564bc9886b210c54bddba64c7042e', class: "datepicker-controls" }, this.shortcutsPlacement === 'bottom' && this.renderShortcuts(), this.hasActions && this.renderActions())))), h("slot", { key: '0ac3446394b8c23b859e5f0065370b95b6fd05d2' })));
|
|
1039
1283
|
}
|
|
1040
1284
|
get el() { return this; }
|
|
1041
1285
|
static get watchers() { return {
|
|
1042
1286
|
"numberOfCalendars": ["validateNumberOfCalendars"],
|
|
1043
1287
|
"rangeValue": ["onRangeValueChange"],
|
|
1044
1288
|
"disabledDates": ["handleDisabledDatesChange"],
|
|
1045
|
-
"singleValue": ["onSingleValueChange"]
|
|
1289
|
+
"singleValue": ["onSingleValueChange"],
|
|
1290
|
+
"value": ["onValueChange"]
|
|
1046
1291
|
}; }
|
|
1047
1292
|
static get style() { return NvCalendarStyle0; }
|
|
1048
1293
|
}, [4, "nv-calendar", {
|
|
1049
1294
|
"firstDayOfWeek": [514, "first-day-of-week"],
|
|
1050
1295
|
"numberOfCalendars": [1538, "number-of-calendars"],
|
|
1296
|
+
"value": [1537],
|
|
1051
1297
|
"singleValue": [1537, "single-value"],
|
|
1052
1298
|
"rangeValue": [1040],
|
|
1053
1299
|
"min": [513],
|
|
@@ -1069,43 +1315,24 @@ const NvCalendar = /*@__PURE__*/ proxyCustomElement(class NvCalendar extends H {
|
|
|
1069
1315
|
"numberOfCalendars": ["validateNumberOfCalendars"],
|
|
1070
1316
|
"rangeValue": ["onRangeValueChange"],
|
|
1071
1317
|
"disabledDates": ["handleDisabledDatesChange"],
|
|
1072
|
-
"singleValue": ["onSingleValueChange"]
|
|
1318
|
+
"singleValue": ["onSingleValueChange"],
|
|
1319
|
+
"value": ["onValueChange"]
|
|
1073
1320
|
}]);
|
|
1074
1321
|
function defineCustomElement() {
|
|
1075
1322
|
if (typeof customElements === "undefined") {
|
|
1076
1323
|
return;
|
|
1077
1324
|
}
|
|
1078
|
-
const components = ["nv-calendar"
|
|
1325
|
+
const components = ["nv-calendar"];
|
|
1079
1326
|
components.forEach(tagName => { switch (tagName) {
|
|
1080
1327
|
case "nv-calendar":
|
|
1081
1328
|
if (!customElements.get(tagName)) {
|
|
1082
1329
|
customElements.define(tagName, NvCalendar);
|
|
1083
1330
|
}
|
|
1084
1331
|
break;
|
|
1085
|
-
case "nv-button":
|
|
1086
|
-
if (!customElements.get(tagName)) {
|
|
1087
|
-
defineCustomElement$4();
|
|
1088
|
-
}
|
|
1089
|
-
break;
|
|
1090
|
-
case "nv-icon":
|
|
1091
|
-
if (!customElements.get(tagName)) {
|
|
1092
|
-
defineCustomElement$3();
|
|
1093
|
-
}
|
|
1094
|
-
break;
|
|
1095
|
-
case "nv-iconbutton":
|
|
1096
|
-
if (!customElements.get(tagName)) {
|
|
1097
|
-
defineCustomElement$2();
|
|
1098
|
-
}
|
|
1099
|
-
break;
|
|
1100
|
-
case "nv-loader":
|
|
1101
|
-
if (!customElements.get(tagName)) {
|
|
1102
|
-
defineCustomElement$1();
|
|
1103
|
-
}
|
|
1104
|
-
break;
|
|
1105
1332
|
} });
|
|
1106
1333
|
}
|
|
1107
1334
|
defineCustomElement();
|
|
1108
1335
|
|
|
1109
1336
|
export { NvCalendar as N, commonjsGlobal as c, defineCustomElement as d, getDefaultExportFromCjs as g };
|
|
1110
1337
|
|
|
1111
|
-
//# sourceMappingURL=p-
|
|
1338
|
+
//# sourceMappingURL=p-a0d7e0cd.js.map
|