@nova-design-system/nova-webcomponents 3.0.0-beta.37 → 3.0.0-beta.39
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/blazor-docs.json +996 -164
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/{constants-69b40456.js → constants-2ae3d9eb.js} +22 -2
- package/dist/cjs/constants-2ae3d9eb.js.map +1 -0
- package/dist/cjs/index-5910ba06.js +8 -4
- package/dist/cjs/index.cjs.js +24 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/native.cjs.js +2 -2
- package/dist/cjs/nv-alert.cjs.entry.js +1 -1
- package/dist/cjs/nv-avatar.cjs.entry.js +1 -1
- package/dist/cjs/nv-badge_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-badge_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-button.cjs.entry.js +1 -1
- package/dist/cjs/nv-calendar.cjs.entry.js +984 -0
- package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-col.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +2 -2
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagridbody.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagriddatacell.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagridhead.cjs.entry.js +1 -1
- package/dist/cjs/nv-datagridrow.cjs.entry.js +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js +17 -4
- package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +10 -4
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +146 -223
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +37 -32
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +12 -11
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +10 -4
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +10 -4
- package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +9 -3
- package/dist/cjs/nv-fieldradio.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldselect.cjs.entry.js +11 -5
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +10 -4
- package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +9 -3
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +20 -12
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +20 -13
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-iconbutton.cjs.entry.js +1 -1
- package/dist/cjs/nv-loader.cjs.entry.js +1 -1
- package/dist/cjs/nv-menu.cjs.entry.js +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +2 -2
- package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +1 -1
- package/dist/cjs/nv-stack.cjs.entry.js +1 -1
- package/dist/cjs/nv-table.cjs.entry.js +2 -2
- package/dist/cjs/nv-table.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-tablebody.cjs.entry.js +1 -1
- package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
- package/dist/cjs/nv-tabledatacell.cjs.entry.js +1 -1
- package/dist/cjs/nv-tablehead.cjs.entry.js +1 -1
- package/dist/cjs/nv-tablerow.cjs.entry.js +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/uri.utils-8523ad2b.js +26 -0
- package/dist/cjs/uri.utils-8523ad2b.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js +1 -0
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js.map +1 -1
- package/dist/collection/components/nv-calendar/nv-calendar.css +341 -0
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js +401 -0
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +1 -0
- package/dist/collection/components/nv-calendar/nv-calendar.js +1328 -0
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -0
- package/dist/collection/components/nv-col/nv-col.js +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +5 -2
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
- package/dist/collection/components/nv-datagridbody/nv-datagridbody.js +1 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +1 -1
- package/dist/collection/components/nv-datagriddatacell/nv-datagriddatacell.js +1 -1
- package/dist/collection/components/nv-datagridhead/nv-datagridhead.js +1 -1
- package/dist/collection/components/nv-datagridrow/nv-datagridrow.js +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.css +2 -0
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +6 -6
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js +16 -3
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +1 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js +8 -0
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +30 -4
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +11 -3
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +197 -252
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
- package/dist/collection/components/nv-fielddropdown/{nv-fielddropdown.css → styles/nv-fielddropdown.css} +10 -28
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +55 -47
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js.map +1 -1
- package/dist/collection/components/nv-fielddropdownitem/{nv-fielddropdownitem.css → styles/nv-fielddropdownitem.css} +12 -9
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.css +7 -7
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.css +34 -17
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +10 -2
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +34 -33
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +2 -2
- 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 +29 -3
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +2 -2
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +8 -0
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +30 -4
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js +8 -0
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +29 -3
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js.map +1 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +8 -19
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +31 -5
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +2 -2
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +8 -0
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +30 -4
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +8 -0
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +29 -3
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.css +27 -24
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js +9 -0
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +38 -10
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
- package/dist/collection/components/nv-icon/nv-icon.js +19 -17
- package/dist/collection/components/nv-icon/nv-icon.js.map +1 -1
- package/dist/collection/components/nv-icon/nv-icons.js +21 -0
- package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
- package/dist/collection/components/nv-popover/nv-popover.css +3 -0
- package/dist/collection/components/nv-popover/nv-popover.js +1 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +5 -2
- package/dist/collection/components/nv-table/nv-table.js.map +1 -1
- package/dist/collection/components/nv-tablebody/nv-tablebody.js +1 -1
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.js +1 -1
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.js +1 -1
- package/dist/collection/components/nv-tablehead/nv-tablehead.js +1 -1
- package/dist/collection/components/nv-tablerow/nv-tablerow.js +1 -1
- 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/index.js +2 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interfaces/calendarShortcut.js +2 -0
- package/dist/collection/interfaces/calendarShortcut.js.map +1 -0
- package/dist/collection/interfaces/dateRange.js +2 -0
- package/dist/collection/interfaces/dateRange.js.map +1 -0
- package/dist/collection/interfaces/localization.js +2 -0
- package/dist/collection/interfaces/localization.js.map +1 -0
- package/dist/collection/templates/navigation.docs.js +6 -0
- package/dist/collection/templates/navigation.docs.js.map +1 -1
- package/dist/collection/utils/constants.js +18 -0
- package/dist/collection/utils/constants.js.map +1 -1
- package/dist/collection/utils/test/uri.utils.test.js +21 -0
- package/dist/collection/utils/test/uri.utils.test.js.map +1 -0
- package/dist/collection/utils/uri.utils.js +15 -0
- package/dist/collection/utils/uri.utils.js.map +1 -0
- package/dist/components/index.js +24 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-alert.js +2 -2
- package/dist/components/nv-avatar.js +2 -2
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-breadcrumb.js +2 -2
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-calendar.d.ts +11 -0
- package/dist/components/nv-calendar.js +1046 -0
- package/dist/components/nv-calendar.js.map +1 -0
- package/dist/components/nv-col.js +1 -1
- package/dist/components/nv-datagrid.js +2 -2
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-datagridbody.js +1 -1
- package/dist/components/nv-datagridcolumn.js +1 -1
- package/dist/components/nv-datagriddatacell.js +1 -1
- package/dist/components/nv-datagridhead.js +1 -1
- package/dist/components/nv-datagridrow.js +1 -1
- package/dist/components/nv-dialog.js +22 -9
- package/dist/components/nv-dialog.js.map +1 -1
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-dialogheader.js +1 -1
- package/dist/components/nv-fieldcheckbox.js +1 -1
- package/dist/components/nv-fielddropdown.js +154 -230
- 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 +21 -19
- package/dist/components/nv-fieldmultiselect.js.map +1 -1
- package/dist/components/nv-fieldnumber.js +13 -6
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldpassword.js +14 -7
- package/dist/components/nv-fieldpassword.js.map +1 -1
- package/dist/components/nv-fieldradio.js +11 -4
- package/dist/components/nv-fieldradio.js.map +1 -1
- package/dist/components/nv-fieldselect.js +13 -6
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldtext.js +13 -6
- package/dist/components/nv-fieldtext.js.map +1 -1
- package/dist/components/nv-fieldtextarea.js +11 -4
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-fieldtime.js +25 -16
- 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 +4 -4
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +1 -1
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-table.js +2 -2
- package/dist/components/nv-table.js.map +1 -1
- package/dist/components/nv-tablebody.js +1 -1
- package/dist/components/nv-tablecolumn.js +1 -1
- package/dist/components/nv-tabledatacell.js +1 -1
- package/dist/components/nv-tablehead.js +1 -1
- package/dist/components/nv-tablerow.js +1 -1
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-de8411ee.js → p-17b6705f.js} +5 -5
- package/dist/components/{p-de8411ee.js.map → p-17b6705f.js.map} +1 -1
- package/dist/components/{p-2768d2c0.js → p-33e07c91.js} +2 -2
- package/dist/components/{p-2768d2c0.js.map → p-33e07c91.js.map} +1 -1
- package/dist/components/{p-3859dc5c.js → p-48317c2c.js} +4 -4
- package/dist/components/p-48317c2c.js.map +1 -0
- package/dist/components/{p-a9a52105.js → p-492ad81d.js} +1178 -5
- package/dist/components/p-492ad81d.js.map +1 -0
- package/dist/components/p-5f5e2bf2.js +88 -0
- package/dist/components/p-5f5e2bf2.js.map +1 -0
- package/dist/components/{p-e431a0ad.js → p-659a5ae4.js} +4 -4
- package/dist/components/{p-e431a0ad.js.map → p-659a5ae4.js.map} +1 -1
- package/dist/components/{p-18d221e3.js → p-73e703a1.js} +2 -2
- package/dist/components/{p-18d221e3.js.map → p-73e703a1.js.map} +1 -1
- package/dist/components/p-7e58e7d1.js +23 -0
- package/dist/components/p-7e58e7d1.js.map +1 -0
- package/dist/components/{p-16badb3b.js → p-83e1177b.js} +3 -3
- package/dist/components/{p-16badb3b.js.map → p-83e1177b.js.map} +1 -1
- package/dist/components/{p-2baea6ba.js → p-842afd9a.js} +3 -3
- package/dist/components/{p-2baea6ba.js.map → p-842afd9a.js.map} +1 -1
- package/dist/components/{p-4938572a.js → p-88165c0e.js} +2 -2
- package/dist/components/{p-4938572a.js.map → p-88165c0e.js.map} +1 -1
- package/dist/components/{p-91bf0cb6.js → p-8d7a57d1.js} +3 -3
- package/dist/components/{p-91bf0cb6.js.map → p-8d7a57d1.js.map} +1 -1
- package/dist/components/p-c1765831.js +89 -0
- package/dist/components/p-c1765831.js.map +1 -0
- package/dist/components/p-f40a7e2f.js +95 -0
- package/dist/components/p-f40a7e2f.js.map +1 -0
- package/dist/{esm/constants-0181211f.js → components/p-fd65c51f.js} +22 -3
- package/dist/components/p-fd65c51f.js.map +1 -0
- package/dist/components/{p-98ff0e5f.js → p-fdf57d25.js} +13 -6
- package/dist/components/p-fdf57d25.js.map +1 -0
- package/dist/docs.json +972 -147
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/{components/p-56f71851.js → esm/constants-8243d2ea.js} +22 -3
- package/dist/esm/constants-8243d2ea.js.map +1 -0
- package/dist/esm/index-fac2d5d2.js +8 -4
- package/dist/esm/index.js +23 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/native.js +2 -2
- package/dist/esm/nv-alert.entry.js +1 -1
- package/dist/esm/nv-avatar.entry.js +1 -1
- package/dist/esm/nv-badge_2.entry.js +2 -2
- package/dist/esm/nv-badge_2.entry.js.map +1 -1
- package/dist/esm/nv-button.entry.js +1 -1
- package/dist/esm/nv-calendar.entry.js +980 -0
- package/dist/esm/nv-calendar.entry.js.map +1 -0
- package/dist/esm/nv-col.entry.js +1 -1
- package/dist/esm/nv-datagrid.entry.js +2 -2
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-datagridbody.entry.js +1 -1
- package/dist/esm/nv-datagridcolumn.entry.js +1 -1
- package/dist/esm/nv-datagriddatacell.entry.js +1 -1
- package/dist/esm/nv-datagridhead.entry.js +1 -1
- package/dist/esm/nv-datagridrow.entry.js +1 -1
- package/dist/esm/nv-dialog.entry.js +17 -4
- package/dist/esm/nv-dialog.entry.js.map +1 -1
- package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
- package/dist/esm/nv-fieldcheckbox.entry.js +10 -4
- package/dist/esm/nv-fieldcheckbox.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +146 -223
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +37 -32
- package/dist/esm/nv-fielddropdownitem.entry.js.map +1 -1
- package/dist/esm/nv-fieldmultiselect.entry.js +12 -11
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +10 -4
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +10 -4
- package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
- package/dist/esm/nv-fieldradio.entry.js +9 -3
- package/dist/esm/nv-fieldradio.entry.js.map +1 -1
- package/dist/esm/nv-fieldselect.entry.js +11 -5
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldtext.entry.js +10 -4
- package/dist/esm/nv-fieldtext.entry.js.map +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +9 -3
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-fieldtime.entry.js +20 -12
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +20 -13
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton.entry.js +1 -1
- package/dist/esm/nv-loader.entry.js +1 -1
- package/dist/esm/nv-menu.entry.js +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js +2 -2
- package/dist/esm/nv-popover.entry.js.map +1 -1
- package/dist/esm/nv-row.entry.js +1 -1
- package/dist/esm/nv-stack.entry.js +1 -1
- package/dist/esm/nv-table.entry.js +2 -2
- package/dist/esm/nv-table.entry.js.map +1 -1
- package/dist/esm/nv-tablebody.entry.js +1 -1
- package/dist/esm/nv-tablecolumn.entry.js +1 -1
- package/dist/esm/nv-tabledatacell.entry.js +1 -1
- package/dist/esm/nv-tablehead.entry.js +1 -1
- package/dist/esm/nv-tablerow.entry.js +1 -1
- package/dist/esm/nv-toggle.entry.js +2 -2
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/esm/uri.utils-4c2a1e4c.js +23 -0
- package/dist/esm/uri.utils-4c2a1e4c.js.map +1 -0
- package/dist/native/index.esm.js +1 -1
- package/dist/native/index.esm.js.map +1 -1
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-4d0caf4a.entry.js → p-1bae8cdd.entry.js} +2 -2
- package/dist/native/{p-4d0caf4a.entry.js.map → p-1bae8cdd.entry.js.map} +1 -1
- package/dist/native/{p-8c1a6aa6.entry.js → p-1ca72f74.entry.js} +2 -2
- package/dist/native/{p-d67b7502.entry.js → p-2151f564.entry.js} +2 -2
- package/dist/native/{p-87083363.entry.js → p-2b99e720.entry.js} +2 -2
- package/dist/native/{p-87083363.entry.js.map → p-2b99e720.entry.js.map} +1 -1
- package/dist/native/p-3422397d.entry.js +2 -0
- package/dist/native/{p-e3827605.entry.js → p-39b4ec02.entry.js} +2 -2
- package/dist/native/p-39b4ec02.entry.js.map +1 -0
- package/dist/native/{p-9ac790b3.entry.js → p-3b2c7871.entry.js} +2 -2
- package/dist/native/{p-9ac790b3.entry.js.map → p-3b2c7871.entry.js.map} +1 -1
- package/dist/native/{p-51ad8bcd.entry.js → p-3bfd5a30.entry.js} +2 -2
- package/dist/native/p-3bfd5a30.entry.js.map +1 -0
- package/dist/native/p-44e7e3e8.entry.js +2 -0
- package/dist/native/p-44e7e3e8.entry.js.map +1 -0
- package/dist/native/p-46c9aa04.entry.js +2 -0
- package/dist/native/p-46c9aa04.entry.js.map +1 -0
- package/dist/native/p-4a7fa613.entry.js +2 -0
- package/dist/native/{p-96902bb3.entry.js.map → p-4a7fa613.entry.js.map} +1 -1
- package/dist/native/{p-e192c25c.entry.js → p-4db7add6.entry.js} +2 -2
- package/dist/native/{p-a998f8df.entry.js → p-4eacd598.entry.js} +2 -2
- package/dist/native/p-51e0c5d3.entry.js +2 -0
- package/dist/native/{p-2aebf31b.entry.js.map → p-51e0c5d3.entry.js.map} +1 -1
- package/dist/native/p-57513eb0.entry.js +2 -0
- package/dist/native/{p-ab5a8ce5.entry.js.map → p-57513eb0.entry.js.map} +1 -1
- package/dist/native/p-5851fbed.entry.js +2 -0
- package/dist/native/{p-61d2cb2e.entry.js → p-634b49fe.entry.js} +2 -2
- package/dist/native/{p-211f7b19.entry.js → p-63c894f0.entry.js} +2 -2
- package/dist/native/p-6acbf729.entry.js +2 -0
- package/dist/native/p-6acbf729.entry.js.map +1 -0
- package/dist/native/p-7211a3cb.entry.js +7 -0
- package/dist/native/p-7211a3cb.entry.js.map +1 -0
- package/dist/native/p-79765c7d.entry.js +2 -0
- package/dist/native/p-7e58e7d1.js +2 -0
- package/dist/native/p-7e58e7d1.js.map +1 -0
- package/dist/native/{p-3c004551.entry.js → p-833af1bf.entry.js} +2 -2
- package/dist/native/p-833af1bf.entry.js.map +1 -0
- package/dist/native/p-87bd53df.entry.js +2 -0
- package/dist/native/p-87bd53df.entry.js.map +1 -0
- package/dist/native/p-8b323a15.entry.js +2 -0
- package/dist/native/{p-10ba289c.entry.js.map → p-8b323a15.entry.js.map} +1 -1
- package/dist/native/p-943a19a5.entry.js +2 -0
- package/dist/native/{p-8ee30013.entry.js.map → p-943a19a5.entry.js.map} +1 -1
- package/dist/native/{p-6d68f133.entry.js → p-9c8eadde.entry.js} +2 -2
- package/dist/native/p-9c8eadde.entry.js.map +1 -0
- package/dist/native/p-ac81e143.entry.js +2 -0
- package/dist/native/p-ac81e143.entry.js.map +1 -0
- package/dist/native/{p-99e7a452.entry.js → p-afc16010.entry.js} +2 -2
- package/dist/native/p-afc16010.entry.js.map +1 -0
- package/dist/native/p-b13b2663.entry.js +2 -0
- package/dist/native/p-b13b2663.entry.js.map +1 -0
- package/dist/native/p-b2ace8e9.entry.js +2 -0
- package/dist/native/p-b2ace8e9.entry.js.map +1 -0
- package/dist/native/{p-4f11286d.entry.js → p-bac62e20.entry.js} +2 -2
- package/dist/native/{p-46553ffd.entry.js → p-bfb6e22c.entry.js} +2 -2
- package/dist/native/p-c29be15d.entry.js +2 -0
- package/dist/native/{p-aa2834e2.entry.js.map → p-c29be15d.entry.js.map} +1 -1
- package/dist/native/p-cba14168.entry.js +2 -0
- package/dist/native/p-cba14168.entry.js.map +1 -0
- package/dist/native/p-dbb89408.entry.js +2 -0
- package/dist/native/p-e1255160.js +2 -0
- package/dist/native/p-e1255160.js.map +1 -0
- package/dist/native/p-e1b22ca7.entry.js +2 -0
- package/dist/native/p-e1b22ca7.entry.js.map +1 -0
- package/dist/native/{p-d776ed48.entry.js → p-ef9b66d4.entry.js} +2 -2
- package/dist/native/p-f867541d.entry.js +2 -0
- package/dist/native/p-f954a077.entry.js +2 -0
- package/dist/native/{p-f30ce086.entry.js.map → p-f954a077.entry.js.map} +1 -1
- package/dist/native/{p-d24586ed.entry.js → p-fa33ec18.entry.js} +2 -2
- package/dist/native/{p-56f71851.js → p-fd65c51f.js} +2 -2
- package/dist/native/p-fd65c51f.js.map +1 -0
- package/dist/native/p-ff7eea0e.entry.js +2 -0
- package/dist/types/components/nv-calendar/nv-calendar.d.ts +383 -0
- package/dist/types/components/nv-calendar/nv-calendar.docs.d.ts +4 -0
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +3 -0
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +8 -0
- package/dist/types/components/nv-fieldcheckbox/nv-fieldcheckbox.d.ts +6 -0
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +45 -62
- package/dist/types/components/nv-fielddropdownitem/nv-fielddropdownitem.d.ts +27 -13
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +7 -10
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +6 -0
- package/dist/types/components/nv-fieldpassword/nv-fieldpassword.d.ts +6 -0
- package/dist/types/components/nv-fieldradio/nv-fieldradio.d.ts +6 -0
- package/dist/types/components/nv-fieldselect/nv-fieldselect.d.ts +6 -0
- package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +6 -0
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +6 -0
- package/dist/types/components/nv-fieldtime/nv-fieldtime.d.ts +6 -0
- package/dist/types/components/nv-icon/nv-icon.d.ts +6 -4
- package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
- package/dist/types/components/nv-table/nv-table.d.ts +3 -0
- package/dist/types/components.d.ts +316 -28
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interfaces/calendarShortcut.d.ts +17 -0
- package/dist/types/interfaces/dateRange.d.ts +13 -0
- package/dist/types/interfaces/localization.d.ts +9 -0
- package/dist/types/nova-docs.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +2 -0
- package/dist/types/utils/uri.utils.d.ts +6 -0
- package/dist/vscode-data.json +243 -56
- package/hydrate/index.js +2545 -1507
- package/hydrate/index.mjs +2545 -1507
- package/package.json +11 -3
- package/dist/cjs/app-globals-bd4d701e.js +0 -11
- package/dist/cjs/app-globals-bd4d701e.js.map +0 -1
- package/dist/cjs/constants-69b40456.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitem/DropdownItemSelectedEventDetail.js +0 -2
- package/dist/collection/components/nv-fielddropdownitem/DropdownItemSelectedEventDetail.js.map +0 -1
- package/dist/collection/dev/dev-components.js +0 -3
- package/dist/collection/dev/dev-components.js.map +0 -1
- package/dist/collection/dev/dev-forms.js +0 -3
- package/dist/collection/dev/dev-forms.js.map +0 -1
- package/dist/collection/dev/dev-root.js +0 -23
- package/dist/collection/dev/dev-root.js.map +0 -1
- package/dist/collection/dev/dev-utils.js +0 -54
- package/dist/collection/dev/dev-utils.js.map +0 -1
- package/dist/collection/global.js +0 -6
- package/dist/collection/global.js.map +0 -1
- package/dist/components/p-11fcdad9.js +0 -90
- package/dist/components/p-11fcdad9.js.map +0 -1
- package/dist/components/p-17714233.js +0 -1263
- package/dist/components/p-17714233.js.map +0 -1
- package/dist/components/p-3859dc5c.js.map +0 -1
- package/dist/components/p-56f71851.js.map +0 -1
- package/dist/components/p-98ff0e5f.js.map +0 -1
- package/dist/components/p-a01bdf02.js +0 -82
- package/dist/components/p-a01bdf02.js.map +0 -1
- package/dist/components/p-a9a52105.js.map +0 -1
- package/dist/esm/app-globals-0a94217b.js +0 -9
- package/dist/esm/app-globals-0a94217b.js.map +0 -1
- package/dist/esm/constants-0181211f.js.map +0 -1
- package/dist/native/p-02bb8184.entry.js +0 -2
- package/dist/native/p-10ba289c.entry.js +0 -2
- package/dist/native/p-208accf0.entry.js +0 -2
- package/dist/native/p-208accf0.entry.js.map +0 -1
- package/dist/native/p-2aebf31b.entry.js +0 -2
- package/dist/native/p-3a8a9371.entry.js +0 -2
- package/dist/native/p-3a8a9371.entry.js.map +0 -1
- package/dist/native/p-3c004551.entry.js.map +0 -1
- package/dist/native/p-51ad8bcd.entry.js.map +0 -1
- package/dist/native/p-56f71851.js.map +0 -1
- package/dist/native/p-6d68f133.entry.js.map +0 -1
- package/dist/native/p-724ed8d7.entry.js +0 -7
- package/dist/native/p-724ed8d7.entry.js.map +0 -1
- package/dist/native/p-75b1ea9f.entry.js +0 -2
- package/dist/native/p-75b1ea9f.entry.js.map +0 -1
- package/dist/native/p-892052c2.entry.js +0 -2
- package/dist/native/p-8ee30013.entry.js +0 -2
- package/dist/native/p-96902bb3.entry.js +0 -2
- package/dist/native/p-99e7a452.entry.js.map +0 -1
- package/dist/native/p-9fb5db20.entry.js +0 -2
- package/dist/native/p-9fb5db20.entry.js.map +0 -1
- package/dist/native/p-aa2834e2.entry.js +0 -2
- package/dist/native/p-ab5a8ce5.entry.js +0 -2
- package/dist/native/p-bfeda21c.entry.js +0 -2
- package/dist/native/p-bfeda21c.entry.js.map +0 -1
- package/dist/native/p-c51ee6dc.entry.js +0 -2
- package/dist/native/p-c51ee6dc.entry.js.map +0 -1
- package/dist/native/p-d4e56727.entry.js +0 -2
- package/dist/native/p-d4e56727.entry.js.map +0 -1
- package/dist/native/p-dc9dd5a7.entry.js +0 -2
- package/dist/native/p-e3827605.entry.js.map +0 -1
- package/dist/native/p-e5a7596b.entry.js +0 -2
- package/dist/native/p-e6f45df2.entry.js +0 -2
- package/dist/native/p-ed47a702.entry.js +0 -2
- package/dist/native/p-f30ce086.entry.js +0 -2
- package/dist/native/p-f3fbdea6.js +0 -2
- package/dist/native/p-f3fbdea6.js.map +0 -1
- package/dist/native/p-fd2955dd.entry.js +0 -2
- package/dist/native/p-fd2955dd.entry.js.map +0 -1
- package/dist/types/components/nv-fielddropdownitem/DropdownItemSelectedEventDetail.d.ts +0 -21
- package/dist/types/dev/dev-components.d.ts +0 -2
- package/dist/types/dev/dev-forms.d.ts +0 -2
- package/dist/types/dev/dev-utils.d.ts +0 -17
- package/dist/types/global.d.ts +0 -1
- /package/dist/native/{p-8c1a6aa6.entry.js.map → p-1ca72f74.entry.js.map} +0 -0
- /package/dist/native/{p-d67b7502.entry.js.map → p-2151f564.entry.js.map} +0 -0
- /package/dist/native/{p-dc9dd5a7.entry.js.map → p-3422397d.entry.js.map} +0 -0
- /package/dist/native/{p-e192c25c.entry.js.map → p-4db7add6.entry.js.map} +0 -0
- /package/dist/native/{p-a998f8df.entry.js.map → p-4eacd598.entry.js.map} +0 -0
- /package/dist/native/{p-e5a7596b.entry.js.map → p-5851fbed.entry.js.map} +0 -0
- /package/dist/native/{p-61d2cb2e.entry.js.map → p-634b49fe.entry.js.map} +0 -0
- /package/dist/native/{p-211f7b19.entry.js.map → p-63c894f0.entry.js.map} +0 -0
- /package/dist/native/{p-e6f45df2.entry.js.map → p-79765c7d.entry.js.map} +0 -0
- /package/dist/native/{p-4f11286d.entry.js.map → p-bac62e20.entry.js.map} +0 -0
- /package/dist/native/{p-46553ffd.entry.js.map → p-bfb6e22c.entry.js.map} +0 -0
- /package/dist/native/{p-02bb8184.entry.js.map → p-dbb89408.entry.js.map} +0 -0
- /package/dist/native/{p-d776ed48.entry.js.map → p-ef9b66d4.entry.js.map} +0 -0
- /package/dist/native/{p-ed47a702.entry.js.map → p-f867541d.entry.js.map} +0 -0
- /package/dist/native/{p-d24586ed.entry.js.map → p-fa33ec18.entry.js.map} +0 -0
- /package/dist/native/{p-892052c2.entry.js.map → p-ff7eea0e.entry.js.map} +0 -0
- /package/dist/types/{dev/dev-root.d.ts → utils/test/uri.utils.test.d.ts} +0 -0
|
@@ -0,0 +1,1328 @@
|
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
4
|
+
import utc from "dayjs/plugin/utc";
|
|
5
|
+
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
6
|
+
import { WEEK_ABBREVIATIONS } from "../../utils/constants";
|
|
7
|
+
// Extend dayjs with plugins
|
|
8
|
+
dayjs.extend(customParseFormat);
|
|
9
|
+
dayjs.extend(utc);
|
|
10
|
+
dayjs.extend(weekOfYear);
|
|
11
|
+
/**
|
|
12
|
+
* @slot default - Child content of the component.
|
|
13
|
+
* @slot actions - Child content of the component.
|
|
14
|
+
*/
|
|
15
|
+
export class NvCalendar {
|
|
16
|
+
constructor() {
|
|
17
|
+
/****************************************************************************/
|
|
18
|
+
//#region PROPERTIES
|
|
19
|
+
/**
|
|
20
|
+
* First day of the week (0 = Sunday, 1 = Monday, etc.)
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
this.firstDayOfWeek = 0;
|
|
24
|
+
/**
|
|
25
|
+
* Number of calendars to display
|
|
26
|
+
* @default 1
|
|
27
|
+
*/
|
|
28
|
+
this.numberOfCalendars = 1;
|
|
29
|
+
/**
|
|
30
|
+
* Selected date (ISO string format)
|
|
31
|
+
* ex: "2025-03-15"
|
|
32
|
+
*/
|
|
33
|
+
this.singleValue = '';
|
|
34
|
+
/**
|
|
35
|
+
* Selected date range
|
|
36
|
+
* format: { start: ISO string, end: ISO string }
|
|
37
|
+
* ex: { start: "2025-03-15", end: "2025-03-20" }
|
|
38
|
+
*/
|
|
39
|
+
this.rangeValue = '';
|
|
40
|
+
/**
|
|
41
|
+
* Minimum date for selection (ISO string format, ex: "2025-01-01")
|
|
42
|
+
*/
|
|
43
|
+
this.min = '';
|
|
44
|
+
/**
|
|
45
|
+
* Maximum date for selection (ISO string format, ex: "2025-12-31")
|
|
46
|
+
*/
|
|
47
|
+
this.max = '';
|
|
48
|
+
/** Disabled dates (ISO string array)
|
|
49
|
+
* @default '[]'
|
|
50
|
+
*/
|
|
51
|
+
this.disabledDates = '';
|
|
52
|
+
/** Locale for date formatting
|
|
53
|
+
* @default 'en-BE'
|
|
54
|
+
*/
|
|
55
|
+
this.locale = 'en-BE';
|
|
56
|
+
/** Date format (ex: 'YYYY-MM-DD', 'DD-MM-YYYY', etc.)
|
|
57
|
+
* @default 'YYYY-MM-DD'
|
|
58
|
+
* @note If the date format is in UTC mode, the date will be displayed in UTC time.
|
|
59
|
+
* @note If the date format is not in UTC mode, the date will be displayed in the local time.
|
|
60
|
+
*/
|
|
61
|
+
this.dateFormat = 'YYYY-MM-DD';
|
|
62
|
+
/**
|
|
63
|
+
* Footer placement
|
|
64
|
+
* @default 'bottom'
|
|
65
|
+
*/
|
|
66
|
+
this.shortcutsPlacement = 'bottom';
|
|
67
|
+
/**
|
|
68
|
+
* Selection type (single date or date range)
|
|
69
|
+
* @default 'single'
|
|
70
|
+
*/
|
|
71
|
+
this.selectionType = 'single';
|
|
72
|
+
/**
|
|
73
|
+
* Show action buttons
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
this.showActions = false;
|
|
77
|
+
/**
|
|
78
|
+
* Custom actions to display in the footer
|
|
79
|
+
* JSON array of objects with the following properties:
|
|
80
|
+
* - label: string
|
|
81
|
+
* - onClick: function
|
|
82
|
+
* @default '[]'
|
|
83
|
+
*/
|
|
84
|
+
this.shortcuts = '[]';
|
|
85
|
+
/** Cache for parsed disabled dates */
|
|
86
|
+
this.parsedDisabledDates = [];
|
|
87
|
+
/** Selected date */
|
|
88
|
+
this.selectedDate = null;
|
|
89
|
+
/** Start date */
|
|
90
|
+
this.startDate = null;
|
|
91
|
+
/** End date */
|
|
92
|
+
this.endDate = null;
|
|
93
|
+
/** List of formatted months for the selector */
|
|
94
|
+
this.months = [];
|
|
95
|
+
/**
|
|
96
|
+
* Resets the current selection
|
|
97
|
+
*/
|
|
98
|
+
this.resetSelection = () => {
|
|
99
|
+
if (this.selectionType === 'single') {
|
|
100
|
+
this.selectedDate = null;
|
|
101
|
+
this.singleValue = '';
|
|
102
|
+
this.singleDateChange.emit('');
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.startDate = null;
|
|
106
|
+
this.endDate = null;
|
|
107
|
+
this.rangeValue = '';
|
|
108
|
+
this.rangeDateChange.emit({ start: '', end: '' });
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Confirms the current selection
|
|
113
|
+
*/
|
|
114
|
+
this.confirmSelection = () => {
|
|
115
|
+
if (this.selectionType === 'single' && this.selectedDate) {
|
|
116
|
+
const dateStr = this.formatDate(this.selectedDate);
|
|
117
|
+
this.singleDateChange.emit(dateStr);
|
|
118
|
+
this.singleValue = dateStr;
|
|
119
|
+
}
|
|
120
|
+
else if (this.selectionType === 'range' &&
|
|
121
|
+
this.startDate &&
|
|
122
|
+
this.endDate) {
|
|
123
|
+
this.rangeDateChange.emit({
|
|
124
|
+
start: this.formatDate(this.startDate),
|
|
125
|
+
end: this.formatDate(this.endDate),
|
|
126
|
+
});
|
|
127
|
+
this.rangeValue = JSON.stringify({
|
|
128
|
+
start: this.formatDate(this.startDate),
|
|
129
|
+
end: this.formatDate(this.endDate),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//#endregion EVENTS
|
|
135
|
+
/****************************************************************************/
|
|
136
|
+
//#region LIFECYCLE
|
|
137
|
+
componentWillLoad() {
|
|
138
|
+
this.parseDisabledDates();
|
|
139
|
+
if (this.selectionType === 'single' && this.singleValue) {
|
|
140
|
+
this.selectedDate = this.parseDate(this.singleValue);
|
|
141
|
+
this.currentDate = this.selectedDate;
|
|
142
|
+
}
|
|
143
|
+
else if (this.selectionType === 'range' && this.rangeValue) {
|
|
144
|
+
try {
|
|
145
|
+
let parsed;
|
|
146
|
+
if (typeof this.rangeValue === 'string') {
|
|
147
|
+
parsed = JSON.parse(this.rangeValue);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
parsed = this.rangeValue;
|
|
151
|
+
}
|
|
152
|
+
if (parsed.start && parsed.end) {
|
|
153
|
+
this.startDate = this.parseDate(parsed.start);
|
|
154
|
+
this.endDate = this.parseDate(parsed.end);
|
|
155
|
+
this.currentDate = this.startDate;
|
|
156
|
+
if (this.startDate && this.endDate && this.startDate > this.endDate) {
|
|
157
|
+
console.warn(`Warning: startDate (${this.formatDate(this.startDate)}) is after endDate (${this.formatDate(this.endDate)})`);
|
|
158
|
+
// [this.startDate, this.endDate] = [this.endDate, this.startDate];
|
|
159
|
+
throw new Error('startDate cannot be after endDate');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
console.error('Invalid JSON for rangeValue:', error);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this.currentDate = new Date();
|
|
169
|
+
}
|
|
170
|
+
this.initializeMonths();
|
|
171
|
+
}
|
|
172
|
+
// componentDidLoad() {
|
|
173
|
+
// if (this.rangeValue) {
|
|
174
|
+
// this.onRangeValueChange(this.rangeValue);
|
|
175
|
+
// }
|
|
176
|
+
// }
|
|
177
|
+
//#endregion LIFECYCLE
|
|
178
|
+
/****************************************************************************/
|
|
179
|
+
//#region METHODS
|
|
180
|
+
/**
|
|
181
|
+
* Change the displayed month
|
|
182
|
+
* @param {number} offset - Month offset (-1 for previous, 1 for next)
|
|
183
|
+
* @param {number} calendarOffset - Month offset for the calendar (0 by default)
|
|
184
|
+
*/
|
|
185
|
+
changeMonth(offset, calendarOffset = 0) {
|
|
186
|
+
const newDate = new Date(this.currentDate);
|
|
187
|
+
newDate.setUTCMonth(newDate.getUTCMonth() + offset + calendarOffset);
|
|
188
|
+
// Add the appropriate animation class
|
|
189
|
+
const containers = this.el.querySelectorAll('.calendar-grid');
|
|
190
|
+
containers.forEach(container => {
|
|
191
|
+
// Remove existing animation classes
|
|
192
|
+
container.classList.remove('slide-left', 'slide-right');
|
|
193
|
+
// Add the new animation class
|
|
194
|
+
const animationClass = offset > 0 ? 'slide-left' : 'slide-right';
|
|
195
|
+
container.classList.add(animationClass);
|
|
196
|
+
// Remove the class after the animation
|
|
197
|
+
setTimeout(() => {
|
|
198
|
+
container.classList.remove(animationClass);
|
|
199
|
+
}, 300); // 300ms corresponds to $slide-duration in the SCSS
|
|
200
|
+
});
|
|
201
|
+
this.currentDate = newDate;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Handles date selection based on the mode
|
|
205
|
+
* @param {Date} date - Selected date
|
|
206
|
+
*/
|
|
207
|
+
handleDateSelection(date) {
|
|
208
|
+
if (this.isDateDisabled(date)) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (this.selectionType === 'single') {
|
|
212
|
+
this.handleSingleSelection(date);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.handleRangeSelection(date);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Handles single date selection
|
|
220
|
+
* @param {Date} date - Selected date
|
|
221
|
+
*/
|
|
222
|
+
handleSingleSelection(date) {
|
|
223
|
+
if (!date)
|
|
224
|
+
return;
|
|
225
|
+
const formattedDate = this.formatDate(date);
|
|
226
|
+
this.selectedDate = date;
|
|
227
|
+
this.selectedDate = date;
|
|
228
|
+
console.info('handleSingleSelection => selectedDate =', this.selectedDate);
|
|
229
|
+
console.info('📤 Emitting singleDateChange:', {
|
|
230
|
+
selectedDate: formattedDate,
|
|
231
|
+
});
|
|
232
|
+
this.singleDateChange.emit(formattedDate);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Handles range date selection
|
|
236
|
+
* @param {Date} date - Selected date
|
|
237
|
+
*/
|
|
238
|
+
handleRangeSelection(date) {
|
|
239
|
+
if (!this.startDate || (this.startDate && this.endDate)) {
|
|
240
|
+
this.startDate = date;
|
|
241
|
+
this.endDate = null;
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
this.endDate = date;
|
|
245
|
+
if (this.startDate > this.endDate) {
|
|
246
|
+
[this.startDate, this.endDate] = [this.endDate, this.startDate];
|
|
247
|
+
}
|
|
248
|
+
this.rangeDateChange.emit({
|
|
249
|
+
start: this.formatDate(this.startDate),
|
|
250
|
+
end: this.formatDate(this.endDate),
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Calculates the ISO week number
|
|
256
|
+
* @param {Date} date - Date to calculate
|
|
257
|
+
* @returns {number} Week number
|
|
258
|
+
*/
|
|
259
|
+
getWeekNumber(date) {
|
|
260
|
+
const startOfYear = new Date(date.getFullYear(), 0, 1);
|
|
261
|
+
const pastDaysOfYear = (date.getTime() - startOfYear.getTime()) / 86400000;
|
|
262
|
+
return Math.ceil((pastDaysOfYear + startOfYear.getDay() + 1) / 7);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Checks if a date is disabled.
|
|
266
|
+
* Disabled if:
|
|
267
|
+
* - The date is before min (if defined)
|
|
268
|
+
* - The date is after max (if defined)
|
|
269
|
+
* - The date is in the disabledDates array
|
|
270
|
+
* @param {Date} date - Date to check
|
|
271
|
+
* @returns {boolean} true if the date is disabled
|
|
272
|
+
*/
|
|
273
|
+
isDateDisabled(date) {
|
|
274
|
+
if (!date)
|
|
275
|
+
return true;
|
|
276
|
+
// Minimum bound check
|
|
277
|
+
if (this.min) {
|
|
278
|
+
const minDate = this.parseDate(this.min);
|
|
279
|
+
if (minDate && date < minDate) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// Maximum bound check
|
|
284
|
+
if (this.max) {
|
|
285
|
+
const maxDate = this.parseDate(this.max);
|
|
286
|
+
if (maxDate && date > maxDate) {
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// Check disabled dates
|
|
291
|
+
return this.parsedDisabledDates.some(disabledDate => this.isSameDate(date, disabledDate));
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Checks if a date is in the selected range
|
|
295
|
+
* @param {Date} date - Date to check
|
|
296
|
+
* @returns {boolean} true if the date is in the range
|
|
297
|
+
*/
|
|
298
|
+
isDateInRange(date) {
|
|
299
|
+
if (!date || !this.startDate || !this.endDate)
|
|
300
|
+
return false;
|
|
301
|
+
const checkDate = this.parseDate(date);
|
|
302
|
+
const startDate = this.parseDate(this.startDate);
|
|
303
|
+
const endDate = this.parseDate(this.endDate);
|
|
304
|
+
// Verify if startDate and endDate are valid
|
|
305
|
+
if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
// Verify that startDate is before endDate (additional security)
|
|
309
|
+
if (startDate > endDate)
|
|
310
|
+
return false;
|
|
311
|
+
// Comparison based only on the date (year, month, day)
|
|
312
|
+
return (this.isSameOrAfter(checkDate, startDate) &&
|
|
313
|
+
this.isSameOrBefore(checkDate, endDate));
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Retrieves the localized day names
|
|
317
|
+
* @returns {string[]} Array of short day names
|
|
318
|
+
*/
|
|
319
|
+
getDayNames() {
|
|
320
|
+
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
321
|
+
weekday: 'short',
|
|
322
|
+
});
|
|
323
|
+
return [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 1 + this.firstDayOfWeek)));
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Generates the days of the current month
|
|
327
|
+
* @param {number} offset - Month offset (0 by default)
|
|
328
|
+
* @param {number} totalCalendars - Number of calendars to display (1 by default)
|
|
329
|
+
* @returns {Array<{ dayOfMonth: number | null, date: Date | null, isSelected: boolean, isDisabled: boolean }>} Array of formatted days
|
|
330
|
+
*/
|
|
331
|
+
getDaysInMonth(offset = 0, totalCalendars = 1) {
|
|
332
|
+
const year = this.currentDate.getUTCFullYear();
|
|
333
|
+
const month = this.currentDate.getUTCMonth() + offset;
|
|
334
|
+
const firstDay = new Date(Date.UTC(year, month, 1));
|
|
335
|
+
const lastDay = new Date(Date.UTC(year, month + 1, 0));
|
|
336
|
+
const days = [];
|
|
337
|
+
// Calculate the offset to include the days of the previous month only for the first calendar
|
|
338
|
+
const offsetDays = offset === 0 ? (firstDay.getUTCDay() - this.firstDayOfWeek + 7) % 7 : 0;
|
|
339
|
+
// Add the days of the previous month for the first calendar
|
|
340
|
+
if (offset === 0) {
|
|
341
|
+
const prevMonthLastDay = new Date(Date.UTC(year, month, 0)).getUTCDate();
|
|
342
|
+
for (let i = offsetDays; i > 0; i--) {
|
|
343
|
+
const date = new Date(Date.UTC(year, month - 1, prevMonthLastDay - i + 1));
|
|
344
|
+
days.push({
|
|
345
|
+
dayOfMonth: date.getUTCDate(),
|
|
346
|
+
date,
|
|
347
|
+
isCurrentMonth: false,
|
|
348
|
+
isDisabled: this.isDateDisabled(date),
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
// Add the days of the current month
|
|
353
|
+
for (let i = 1; i <= lastDay.getUTCDate(); i++) {
|
|
354
|
+
const date = new Date(Date.UTC(year, month, i));
|
|
355
|
+
days.push({
|
|
356
|
+
dayOfMonth: i,
|
|
357
|
+
date,
|
|
358
|
+
isCurrentMonth: true,
|
|
359
|
+
isDisabled: this.isDateDisabled(date),
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
// Add the days of the next month only for the last calendar
|
|
363
|
+
if (offset === totalCalendars - 1) {
|
|
364
|
+
const nextMonthDaysNeeded = 7 - (days.length % 7 || 7);
|
|
365
|
+
for (let i = 1; i <= nextMonthDaysNeeded; i++) {
|
|
366
|
+
const date = new Date(Date.UTC(year, month + 1, i));
|
|
367
|
+
days.push({
|
|
368
|
+
dayOfMonth: i,
|
|
369
|
+
date,
|
|
370
|
+
isCurrentMonth: false,
|
|
371
|
+
isDisabled: this.isDateDisabled(date),
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return days;
|
|
376
|
+
}
|
|
377
|
+
/** Initializes the list of formatted months according to the locale */
|
|
378
|
+
initializeMonths() {
|
|
379
|
+
const formatter = new Intl.DateTimeFormat(this.locale, { month: 'long' });
|
|
380
|
+
this.months = Array.from({ length: 12 }, (_, i) => ({
|
|
381
|
+
value: i,
|
|
382
|
+
label: formatter.format(new Date(2000, i, 1)),
|
|
383
|
+
}));
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Retrieves the localized abbreviation for "week"
|
|
387
|
+
* @returns {string} Localized abbreviation for "week"
|
|
388
|
+
*/
|
|
389
|
+
getLocalizedWeekText() {
|
|
390
|
+
return WEEK_ABBREVIATIONS[this.locale] || 'W';
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Handles month change in the selector
|
|
394
|
+
* @param {Event} event - Month change event
|
|
395
|
+
* @param {number} calendarOffset - Calendar offset (0 by default)
|
|
396
|
+
*/
|
|
397
|
+
handleMonthChange(event, calendarOffset = 0) {
|
|
398
|
+
const select = event.target;
|
|
399
|
+
const selectedMonth = parseInt(select.value, 10);
|
|
400
|
+
const currentMonth = this.currentDate.getUTCMonth();
|
|
401
|
+
// Calculate the difference considering the calendar offset
|
|
402
|
+
const monthDiff = selectedMonth - ((currentMonth + calendarOffset) % 12);
|
|
403
|
+
const newDate = new Date(this.currentDate);
|
|
404
|
+
newDate.setUTCMonth(newDate.getUTCMonth() + monthDiff);
|
|
405
|
+
this.currentDate = newDate;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Handles year change in the numeric entry
|
|
409
|
+
* @param {Event} event - Year change event
|
|
410
|
+
* @param {number} calendarOffset - Calendar offset (0 by default)
|
|
411
|
+
*/
|
|
412
|
+
handleYearChange(event, calendarOffset = 0) {
|
|
413
|
+
const input = event.target;
|
|
414
|
+
const year = parseInt(input.value, 10);
|
|
415
|
+
if (!isNaN(year) && year >= 1900 && year <= 2100) {
|
|
416
|
+
const newDate = new Date(this.currentDate);
|
|
417
|
+
newDate.setUTCFullYear(year);
|
|
418
|
+
newDate.setUTCMonth(newDate.getUTCMonth() + calendarOffset);
|
|
419
|
+
this.currentDate = newDate;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Handles week selection
|
|
424
|
+
* @param {Date[]} weekDays - Selected week days
|
|
425
|
+
* @param {number} calendarIndex - Calendar index from which the selection is made
|
|
426
|
+
*/
|
|
427
|
+
handleWeekSelection(weekDays, calendarIndex) {
|
|
428
|
+
if (this.selectionType !== 'range')
|
|
429
|
+
return;
|
|
430
|
+
// Retrieves the days of the month adjusted according to the calendar index
|
|
431
|
+
const allDays = this.getDaysInMonth(calendarIndex, this.numberOfCalendars);
|
|
432
|
+
const weekStart = weekDays[0];
|
|
433
|
+
const weekEnd = weekDays[weekDays.length - 1];
|
|
434
|
+
if (!weekStart || !weekEnd)
|
|
435
|
+
return;
|
|
436
|
+
const selectedWeekDays = allDays.filter(day => day.date && day.date >= weekStart && day.date <= weekEnd);
|
|
437
|
+
const validDays = selectedWeekDays.filter(day => !this.isDateDisabled(day.date));
|
|
438
|
+
if (validDays.length > 0) {
|
|
439
|
+
this.startDate = validDays[0].date;
|
|
440
|
+
this.endDate = validDays[validDays.length - 1].date;
|
|
441
|
+
this.rangeDateChange.emit({
|
|
442
|
+
start: this.startDate.toISOString(),
|
|
443
|
+
end: this.endDate.toISOString(),
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Checks if a date corresponds to today
|
|
449
|
+
* @param {Date} date - Date to check
|
|
450
|
+
* @returns {boolean} true if the date is today
|
|
451
|
+
*/
|
|
452
|
+
isToday(date) {
|
|
453
|
+
const today = new Date();
|
|
454
|
+
return (date.getDate() === today.getDate() &&
|
|
455
|
+
date.getMonth() === today.getMonth() &&
|
|
456
|
+
date.getFullYear() === today.getFullYear());
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Watches the changes of the number of calendars
|
|
460
|
+
* @watch numberOfCalendars
|
|
461
|
+
* @param {number} newValue - New number of calendars
|
|
462
|
+
*/
|
|
463
|
+
validateNumberOfCalendars(newValue) {
|
|
464
|
+
if (newValue < 1 || newValue > 4) {
|
|
465
|
+
console.warn('numberOfCalendars must be between 1 and 4. Defaulting to 1.');
|
|
466
|
+
this.numberOfCalendars = 1;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Watches the changes of the selected date range
|
|
471
|
+
* @watch rangeValue
|
|
472
|
+
* @param {Object} newValue - New rangeValue value
|
|
473
|
+
* @param {string} newValue.start - Start date
|
|
474
|
+
* @param {string} newValue.end - End date
|
|
475
|
+
*/
|
|
476
|
+
onRangeValueChange(newValue) {
|
|
477
|
+
if (newValue) {
|
|
478
|
+
try {
|
|
479
|
+
const parsed = JSON.parse(newValue);
|
|
480
|
+
if (parsed.start && parsed.end) {
|
|
481
|
+
this.startDate = this.parseDate(parsed.start);
|
|
482
|
+
this.endDate = this.parseDate(parsed.end);
|
|
483
|
+
this.currentDate = this.parseDate(parsed.start);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
catch (error) {
|
|
487
|
+
console.error('Invalid JSON for rangeValue:', error);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Watches the changes of the disabled dates
|
|
493
|
+
* @watch disabledDates
|
|
494
|
+
* @description Watches the changes of the disabled dates
|
|
495
|
+
*/
|
|
496
|
+
handleDisabledDatesChange() {
|
|
497
|
+
this.parseDisabledDates();
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Convert a date string/Date to a Date without timezone offset
|
|
501
|
+
* @param {string | Date} dateInput - Date under string or Date object form
|
|
502
|
+
* @returns {Date} Date in Date form without timezone offset
|
|
503
|
+
*/
|
|
504
|
+
parseDate(dateInput) {
|
|
505
|
+
if (dateInput instanceof Date)
|
|
506
|
+
return dateInput;
|
|
507
|
+
// Handling Unix Seconds ("X") formats
|
|
508
|
+
if (this.dateFormat === 'X') {
|
|
509
|
+
const unixSeconds = Number(dateInput);
|
|
510
|
+
if (isNaN(unixSeconds))
|
|
511
|
+
return null;
|
|
512
|
+
return this.isUTCMode
|
|
513
|
+
? dayjs.unix(unixSeconds).utc().toDate()
|
|
514
|
+
: dayjs.unix(unixSeconds).toDate();
|
|
515
|
+
}
|
|
516
|
+
// Handling Unix Milliseconds ("x") formats
|
|
517
|
+
if (this.dateFormat === 'x') {
|
|
518
|
+
const unixMilliseconds = Number(dateInput);
|
|
519
|
+
if (isNaN(unixMilliseconds))
|
|
520
|
+
return null;
|
|
521
|
+
return this.isUTCMode
|
|
522
|
+
? dayjs(unixMilliseconds).utc().toDate()
|
|
523
|
+
: dayjs(unixMilliseconds).toDate();
|
|
524
|
+
}
|
|
525
|
+
// Handling C# Ticks format
|
|
526
|
+
if (this.dateFormat === 'Ticks') {
|
|
527
|
+
const ticks = Number(dateInput);
|
|
528
|
+
if (isNaN(ticks))
|
|
529
|
+
return null;
|
|
530
|
+
// Conversion of .NET ticks to milliseconds since Unix epoch
|
|
531
|
+
const unixMilliseconds = (ticks - 621355968000000000) / 10000;
|
|
532
|
+
return this.isUTCMode
|
|
533
|
+
? dayjs(unixMilliseconds).utc().toDate()
|
|
534
|
+
: dayjs(unixMilliseconds).toDate();
|
|
535
|
+
}
|
|
536
|
+
// For all other formats, use customParseFormat in strict mode
|
|
537
|
+
let parsed;
|
|
538
|
+
if (this.isUTCMode) {
|
|
539
|
+
parsed = dayjs.utc(dateInput, this.dateFormat, true);
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
parsed = dayjs(dateInput, this.dateFormat, true);
|
|
543
|
+
}
|
|
544
|
+
if (!parsed.isValid()) {
|
|
545
|
+
console.error(`Parsing error:`, {
|
|
546
|
+
dateInput,
|
|
547
|
+
dateFormat: this.dateFormat,
|
|
548
|
+
});
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
return parsed.toDate();
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Formats a date to a string according to the format
|
|
555
|
+
* @param {Date} date - Date to format
|
|
556
|
+
* @returns {string} Formatted date
|
|
557
|
+
*/
|
|
558
|
+
formatDate(date) {
|
|
559
|
+
if (!date)
|
|
560
|
+
return '';
|
|
561
|
+
// If the format is "Ticks", convert the time to C# ticks
|
|
562
|
+
if (this.dateFormat === 'Ticks') {
|
|
563
|
+
const ticks = date.getTime() * 10000 + 621355968000000000;
|
|
564
|
+
return ticks.toString();
|
|
565
|
+
}
|
|
566
|
+
// If the format is "X" (Unix Seconds)
|
|
567
|
+
if (this.dateFormat === 'X') {
|
|
568
|
+
return dayjs(date).unix().toString();
|
|
569
|
+
}
|
|
570
|
+
// If the format is "x" (Unix Milliseconds)
|
|
571
|
+
if (this.dateFormat === 'x') {
|
|
572
|
+
return date.getTime().toString();
|
|
573
|
+
}
|
|
574
|
+
// Otherwise, format according to the mode (UTC or local)
|
|
575
|
+
return this.isUTCMode
|
|
576
|
+
? dayjs(date).utc().format(this.dateFormat)
|
|
577
|
+
: dayjs(date).format(this.dateFormat);
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Parse and cache the disabled dates
|
|
581
|
+
* @description Parse and cache the disabled dates
|
|
582
|
+
*/
|
|
583
|
+
parseDisabledDates() {
|
|
584
|
+
if (!this.disabledDates) {
|
|
585
|
+
this.parsedDisabledDates = [];
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
try {
|
|
589
|
+
const disabledDatesArray = JSON.parse(this.disabledDates);
|
|
590
|
+
this.parsedDisabledDates = disabledDatesArray
|
|
591
|
+
.map(date => this.parseDate(date))
|
|
592
|
+
.filter(date => date !== null);
|
|
593
|
+
}
|
|
594
|
+
catch (error) {
|
|
595
|
+
console.error('Error parsing disabled dates:', error);
|
|
596
|
+
this.parsedDisabledDates = [];
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Checks if two dates are identical
|
|
601
|
+
* @param {Date | null} date1 - First date
|
|
602
|
+
* @param {Date | null} date2 - Second date
|
|
603
|
+
* @returns {boolean} true if the dates are identical
|
|
604
|
+
*/
|
|
605
|
+
isSameDate(date1, date2) {
|
|
606
|
+
if (!date1 || !date2)
|
|
607
|
+
return false;
|
|
608
|
+
if (this.isUTCMode) {
|
|
609
|
+
return (date1.getUTCFullYear() === date2.getUTCFullYear() &&
|
|
610
|
+
date1.getUTCMonth() === date2.getUTCMonth() &&
|
|
611
|
+
date1.getUTCDate() === date2.getUTCDate());
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
return (date1.getFullYear() === date2.getFullYear() &&
|
|
615
|
+
date1.getMonth() === date2.getMonth() &&
|
|
616
|
+
date1.getDate() === date2.getDate());
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Checks if a date is identical or after another date
|
|
621
|
+
* @param {Date} date - Date to check
|
|
622
|
+
* @param {Date} compareDate - Reference date
|
|
623
|
+
* @returns {boolean} true if `date` >= `compareDate`
|
|
624
|
+
*/
|
|
625
|
+
isSameOrAfter(date, compareDate) {
|
|
626
|
+
if (this.isUTCMode) {
|
|
627
|
+
return (date.getUTCFullYear() > compareDate.getUTCFullYear() ||
|
|
628
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
629
|
+
date.getUTCMonth() > compareDate.getUTCMonth()) ||
|
|
630
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
631
|
+
date.getUTCMonth() === compareDate.getUTCMonth() &&
|
|
632
|
+
date.getUTCDate() >= compareDate.getUTCDate()));
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
return (date.getFullYear() > compareDate.getFullYear() ||
|
|
636
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
637
|
+
date.getMonth() > compareDate.getMonth()) ||
|
|
638
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
639
|
+
date.getMonth() === compareDate.getMonth() &&
|
|
640
|
+
date.getDate() >= compareDate.getDate()));
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Checks if a date is identical or before another date
|
|
645
|
+
* @param {Date} date - Date to check
|
|
646
|
+
* @param {Date} compareDate - Reference date
|
|
647
|
+
* @returns {boolean} true if `date` <= `compareDate`
|
|
648
|
+
*/
|
|
649
|
+
isSameOrBefore(date, compareDate) {
|
|
650
|
+
if (this.isUTCMode) {
|
|
651
|
+
return (date.getUTCFullYear() < compareDate.getUTCFullYear() ||
|
|
652
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
653
|
+
date.getUTCMonth() < compareDate.getUTCMonth()) ||
|
|
654
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
655
|
+
date.getUTCMonth() === compareDate.getUTCMonth() &&
|
|
656
|
+
date.getUTCDate() <= compareDate.getUTCDate()));
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
return (date.getFullYear() < compareDate.getFullYear() ||
|
|
660
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
661
|
+
date.getMonth() < compareDate.getMonth()) ||
|
|
662
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
663
|
+
date.getMonth() === compareDate.getMonth() &&
|
|
664
|
+
date.getDate() <= compareDate.getDate()));
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Applies a shortcut selection
|
|
669
|
+
* @param {Object} shortcut - Shortcut to apply
|
|
670
|
+
* @param {string | Date} shortcut.singleValue - Selected date value
|
|
671
|
+
* @param {Object} shortcut.rangeValue - Start and end date values
|
|
672
|
+
* @param {string | Date} shortcut.rangeValue.start - Start date value
|
|
673
|
+
* @param {string | Date} shortcut.rangeValue.end - End date value
|
|
674
|
+
* @param {string} shortcut.label - Label
|
|
675
|
+
*/
|
|
676
|
+
applyShortcut(shortcut) {
|
|
677
|
+
this.selectedDate = null;
|
|
678
|
+
this.startDate = null;
|
|
679
|
+
this.endDate = null;
|
|
680
|
+
if (shortcut.singleValue) {
|
|
681
|
+
const newDate = this.parseDate(shortcut.singleValue);
|
|
682
|
+
this.selectedDate = newDate;
|
|
683
|
+
this.singleDateChange.emit(this.formatDate(newDate));
|
|
684
|
+
this.singleValue = this.formatDate(newDate);
|
|
685
|
+
this.forceCalendarUpdate(newDate);
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
const start = this.parseDate(shortcut.rangeValue.start);
|
|
689
|
+
const end = this.parseDate(shortcut.rangeValue.end);
|
|
690
|
+
this.startDate = start;
|
|
691
|
+
this.endDate = end;
|
|
692
|
+
this.rangeDateChange.emit({
|
|
693
|
+
start: this.formatDate(start),
|
|
694
|
+
end: this.formatDate(end),
|
|
695
|
+
});
|
|
696
|
+
this.rangeValue = JSON.stringify({
|
|
697
|
+
start: this.formatDate(start),
|
|
698
|
+
end: this.formatDate(end),
|
|
699
|
+
});
|
|
700
|
+
this.forceCalendarUpdate(end);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Method to force the complete calendar update (and fix the persistent hover problem)
|
|
705
|
+
* @param {Date} newDate - Date to force
|
|
706
|
+
*/
|
|
707
|
+
forceCalendarUpdate(newDate) {
|
|
708
|
+
this.currentDate = new Date(newDate);
|
|
709
|
+
this.currentDate = new Date(this.currentDate); // Force a re-render
|
|
710
|
+
// Reset visually the hover/touch effect
|
|
711
|
+
requestAnimationFrame(() => {
|
|
712
|
+
const days = document.querySelectorAll('.day');
|
|
713
|
+
days.forEach(el => {
|
|
714
|
+
el.classList.remove('hover', 'active', 'touched');
|
|
715
|
+
el.style.pointerEvents = 'none';
|
|
716
|
+
});
|
|
717
|
+
// Add specific touch handling (for mobile)
|
|
718
|
+
document.body.addEventListener('touchstart', this.clearTouchState, {
|
|
719
|
+
passive: true,
|
|
720
|
+
});
|
|
721
|
+
// Reset the touch state after 50ms
|
|
722
|
+
setTimeout(() => {
|
|
723
|
+
days.forEach(el => {
|
|
724
|
+
el.style.pointerEvents = '';
|
|
725
|
+
});
|
|
726
|
+
}, 50);
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Function to reset the touch effect (Mobile fix)
|
|
731
|
+
*/
|
|
732
|
+
clearTouchState() {
|
|
733
|
+
document.querySelectorAll('.day').forEach(el => {
|
|
734
|
+
el.classList.remove('touched');
|
|
735
|
+
});
|
|
736
|
+
// Remove the listener after the first interaction
|
|
737
|
+
document.body.removeEventListener('touchstart', this.clearTouchState);
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Handles month change with an offset
|
|
741
|
+
* @param {number} direction - Direction (-1 for previous, 1 for next)
|
|
742
|
+
* @param {number} offset - Month offset (0 by default)
|
|
743
|
+
* @returns {Function} Change month handler
|
|
744
|
+
*/
|
|
745
|
+
getChangeMonthHandler(direction, offset) {
|
|
746
|
+
return () => this.changeMonth(direction, offset);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Handles month change from an event (ex: dropdown)
|
|
750
|
+
* @param {number} offset - Month offset (0 by default)
|
|
751
|
+
* @returns {Function} Change month handler
|
|
752
|
+
*/
|
|
753
|
+
getHandleMonthChange(offset) {
|
|
754
|
+
return (event) => this.handleMonthChange(event, offset);
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Handles year change from an event (ex: dropdown)
|
|
758
|
+
* @param {number} offset - Year offset (0 by default)
|
|
759
|
+
* @returns {Function} Change year handler
|
|
760
|
+
*/
|
|
761
|
+
getHandleYearChange(offset) {
|
|
762
|
+
return (event) => this.handleYearChange(event, offset);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Handles day click
|
|
766
|
+
* @param {Date} date - Date to handle
|
|
767
|
+
* @param {boolean} isDisabled - Whether the date is disabled
|
|
768
|
+
* @returns {Function} Day click handler
|
|
769
|
+
*/
|
|
770
|
+
getDayClickHandler(date, isDisabled) {
|
|
771
|
+
return isDisabled ? undefined : () => this.handleDateSelection(date);
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Handles shortcut selection
|
|
775
|
+
* @param {Object} shortcut - Shortcut to handle
|
|
776
|
+
* @param {string | Date} shortcut.singleValue - Selected date value
|
|
777
|
+
* @param {Object} shortcut.rangeValue - Start and end date values
|
|
778
|
+
* @param {string | Date} shortcut.rangeValue.start - Start date value
|
|
779
|
+
* @param {string | Date} shortcut.rangeValue.end - End date value
|
|
780
|
+
* @param {string} shortcut.label - Label
|
|
781
|
+
* @returns {Function} Shortcut selection handler
|
|
782
|
+
*/
|
|
783
|
+
getShortcutHandler(shortcut) {
|
|
784
|
+
return () => this.applyShortcut(shortcut);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Handles week selection
|
|
788
|
+
* @param {Date[]} dates - Dates to handle
|
|
789
|
+
* @param {number} index - Calendar index
|
|
790
|
+
* @returns {Function} Week selection handler
|
|
791
|
+
*/
|
|
792
|
+
getWeekSelectionHandler(dates, index) {
|
|
793
|
+
return () => {
|
|
794
|
+
if (this.selectionType === 'range') {
|
|
795
|
+
this.handleWeekSelection(dates, index);
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
parsedShortcuts() {
|
|
800
|
+
try {
|
|
801
|
+
return this.shortcuts ? JSON.parse(this.shortcuts) : [];
|
|
802
|
+
}
|
|
803
|
+
catch (error) {
|
|
804
|
+
console.error('Invalid JSON for shortcuts:', error);
|
|
805
|
+
return [];
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Checks if the date format is in UTC mode
|
|
810
|
+
* @returns {boolean} true if the date format is in UTC mode
|
|
811
|
+
*/
|
|
812
|
+
get isUTCMode() {
|
|
813
|
+
return this.dateFormat.includes('Z');
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Checks if shortcuts are visible
|
|
817
|
+
* @returns {boolean} true if shortcuts are visible
|
|
818
|
+
*/
|
|
819
|
+
get hasShortcuts() {
|
|
820
|
+
return (this.shortcutsPlacement === 'bottom' && this.parsedShortcuts().length > 0);
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Checks if actions are visible
|
|
824
|
+
* @returns {boolean} true if actions are visible
|
|
825
|
+
*/
|
|
826
|
+
get hasActions() {
|
|
827
|
+
return this.showActions;
|
|
828
|
+
}
|
|
829
|
+
//#endregion METHODS
|
|
830
|
+
/****************************************************************************/
|
|
831
|
+
//#region RENDER
|
|
832
|
+
/**
|
|
833
|
+
* Renders the header
|
|
834
|
+
* @param {number} offset - Month offset
|
|
835
|
+
* @param {number} index - Calendar index
|
|
836
|
+
* @returns {JSX.Element} Header
|
|
837
|
+
* @description Renders the header of the calendar
|
|
838
|
+
*/
|
|
839
|
+
renderHeader(offset, index) {
|
|
840
|
+
return (h("div", { class: "header" }, this.numberOfCalendars > 1 && index === 0 && (h("nv-iconbutton", { class: "nav-left", emphasis: "low", name: "chevron-left", size: "sm", onClick: this.getChangeMonthHandler(-1, offset) })), h("div", { class: "date-controls" }, h("select", { class: "month-select mr-4", onChange: this.getHandleMonthChange(offset) }, this.months.map(month => (h("option", { key: month.value, value: month.value, selected: month.value === (this.currentDate.getUTCMonth() + offset) % 12 }, month.label)))), h("input", { type: "number", class: "year-input", min: "1950", max: "2100", value: this.currentDate.getUTCFullYear() +
|
|
841
|
+
Math.floor((this.currentDate.getUTCMonth() + offset) / 12), onChange: this.getHandleYearChange(offset) })), this.numberOfCalendars === 1 && (h("div", { class: "nav-buttons" }, h("nv-iconbutton", { emphasis: "low", name: "chevron-left", onClick: this.getChangeMonthHandler(-1, offset) }), h("nv-iconbutton", { emphasis: "low", name: "chevron-right", onClick: this.getChangeMonthHandler(1, offset) }))), this.numberOfCalendars > 1 && index === this.numberOfCalendars - 1 && (h("nv-iconbutton", { emphasis: "low", name: "chevron-right", size: "sm", onClick: this.getChangeMonthHandler(1, offset), class: "nav-right" }))));
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Renders the week numbers
|
|
845
|
+
* @param {Array<{date: Date}>} weeks - Weeks to render
|
|
846
|
+
* @param {number} index - Calendar index
|
|
847
|
+
* @returns {JSX.Element} Week numbers
|
|
848
|
+
* @description Renders the week numbers of the calendar
|
|
849
|
+
*/
|
|
850
|
+
renderWeekNumbers(
|
|
851
|
+
/** Weeks to render */
|
|
852
|
+
weeks,
|
|
853
|
+
/** Calendar index */
|
|
854
|
+
index) {
|
|
855
|
+
return (h("div", { class: "week-numbers" }, h("div", { class: "week-header" }, this.getLocalizedWeekText()), weeks.map((week, weekIndex) => {
|
|
856
|
+
var _a;
|
|
857
|
+
const dates = week.map(d => d.date);
|
|
858
|
+
return (h("div", { class: `week-number ${this.selectionType === 'range' ? 'clickable' : ''}`, onClick: this.getWeekSelectionHandler(dates, index), key: `week-${weekIndex}` }, this.getWeekNumber(((_a = week.find(d => d.date)) === null || _a === void 0 ? void 0 : _a.date) || new Date())));
|
|
859
|
+
})));
|
|
860
|
+
}
|
|
861
|
+
renderDaysGrid(
|
|
862
|
+
/** Days to render */
|
|
863
|
+
days) {
|
|
864
|
+
return (h("div", { class: "days-grid" }, days.map(day => {
|
|
865
|
+
const date = day.date;
|
|
866
|
+
if (!date)
|
|
867
|
+
return null;
|
|
868
|
+
const isSelected = this.selectionType === 'single' &&
|
|
869
|
+
this.isSameDate(date, this.selectedDate);
|
|
870
|
+
const isInRange = this.isDateInRange(date);
|
|
871
|
+
const isStart = this.isSameDate(date, this.startDate);
|
|
872
|
+
const isEnd = this.isSameDate(date, this.endDate);
|
|
873
|
+
const isToday = this.isToday(date);
|
|
874
|
+
const isOutsideMonth = !day.isCurrentMonth;
|
|
875
|
+
const dayClasses = [
|
|
876
|
+
'day',
|
|
877
|
+
isSelected ? 'selected' : '',
|
|
878
|
+
isStart ? 'range-start' : '',
|
|
879
|
+
isEnd ? 'range-end' : '',
|
|
880
|
+
isInRange ? 'in-range' : '',
|
|
881
|
+
day.isDisabled ? 'disabled' : '',
|
|
882
|
+
isOutsideMonth ? 'outside-month' : '',
|
|
883
|
+
isToday ? 'is-today' : '',
|
|
884
|
+
];
|
|
885
|
+
return (h("div", { class: dayClasses.filter(Boolean).join(' '), onClick: this.getDayClickHandler(date, day.isDisabled), "aria-disabled": day.isDisabled, key: `day-${date.toISOString()}` }, day.dayOfMonth));
|
|
886
|
+
})));
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Renders the calendar
|
|
890
|
+
* @param {number} index - Calendar index
|
|
891
|
+
* @param {number} offset - Month offset
|
|
892
|
+
* @returns {JSX.Element} Calendar
|
|
893
|
+
* @description Renders the calendar of the calendar
|
|
894
|
+
*/
|
|
895
|
+
renderCalendar(
|
|
896
|
+
/** Calendar index */
|
|
897
|
+
index,
|
|
898
|
+
/** Month offset */
|
|
899
|
+
offset) {
|
|
900
|
+
const days = this.getDaysInMonth(offset, this.numberOfCalendars);
|
|
901
|
+
const weeks = [];
|
|
902
|
+
for (let i = 0; i < days.length; i += 7) {
|
|
903
|
+
weeks.push(days.slice(i, i + 7));
|
|
904
|
+
}
|
|
905
|
+
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("div", { class: "days-container" }, h("div", { class: "days-header" }, this.getDayNames().map(day => (h("div", { class: "day-header" }, day)))), this.renderDaysGrid(days)))), index < this.numberOfCalendars - 1 && (h("div", { class: "calendar-separator" }))));
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Renders the shortcuts
|
|
909
|
+
* @returns {JSX.Element} Shortcuts
|
|
910
|
+
* @description Renders the shortcuts of the calendar
|
|
911
|
+
*/
|
|
912
|
+
renderShortcuts() {
|
|
913
|
+
if (!this.parsedShortcuts().length) {
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
return (h("div", { class: `shortcuts-container shortcuts-placement-${this.shortcutsPlacement}` }, this.parsedShortcuts().map(shortcut => (h("nv-button", { emphasis: "lower", size: "xs", "aria-label": shortcut.label, onClick: this.getShortcutHandler(shortcut) }, shortcut.label)))));
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Renders the actions
|
|
920
|
+
* @returns {JSX.Element} Actions
|
|
921
|
+
* @description Renders the actions of the calendar
|
|
922
|
+
* @slot actions - Child content of the component.
|
|
923
|
+
*/
|
|
924
|
+
renderActions() {
|
|
925
|
+
return (h("div", { class: "datepicker-actions" }, h("slot", { name: "actions" }, h("nv-button", { emphasis: "low", size: "sm", onClick: this.resetSelection }, "Cancel"), h("nv-button", { size: "sm", onClick: this.confirmSelection }, "OK"))));
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Renders the datepicker
|
|
929
|
+
* @returns {JSX.Element} Datepicker
|
|
930
|
+
* @description Renders the datepicker of the calendar
|
|
931
|
+
* @slot default - Child content of the component.
|
|
932
|
+
*/
|
|
933
|
+
render() {
|
|
934
|
+
return (h(Host, { key: 'fd0e3e0d88dd281cdfcc6557d822f137fe8da38e' }, h("div", { key: '04f15a9e7404b5c39dfdaa0f143b0c659a1a9cb3', class: "datepicker-root" }, h("div", { key: 'c42882624dfdb116faae2af1b3b6a1aa05192d18', class: `datepicker-container ${this.numberOfCalendars === 1 ? 'datepicker-container-single' : ''}` }, h("div", { key: 'd0b1d476b3362e9f9073f02586a77e21b4370f32', 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.hasActions) && (h("div", { key: 'f61fb6827fcaee0920998e75f6bfb767d3cb4fc6', class: "datepicker-controls" }, this.hasShortcuts && this.renderShortcuts(), this.hasActions && this.renderActions())))), h("slot", { key: '436d448bf9e5ec0aa153b3452ef9435d36957ce6' })));
|
|
935
|
+
}
|
|
936
|
+
static get is() { return "nv-calendar"; }
|
|
937
|
+
static get originalStyleUrls() {
|
|
938
|
+
return {
|
|
939
|
+
"$": ["nv-calendar.scss"]
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
static get styleUrls() {
|
|
943
|
+
return {
|
|
944
|
+
"$": ["nv-calendar.css"]
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
static get properties() {
|
|
948
|
+
return {
|
|
949
|
+
"firstDayOfWeek": {
|
|
950
|
+
"type": "number",
|
|
951
|
+
"mutable": false,
|
|
952
|
+
"complexType": {
|
|
953
|
+
"original": "number",
|
|
954
|
+
"resolved": "number",
|
|
955
|
+
"references": {}
|
|
956
|
+
},
|
|
957
|
+
"required": false,
|
|
958
|
+
"optional": false,
|
|
959
|
+
"docs": {
|
|
960
|
+
"tags": [{
|
|
961
|
+
"name": "default",
|
|
962
|
+
"text": "0"
|
|
963
|
+
}],
|
|
964
|
+
"text": "First day of the week (0 = Sunday, 1 = Monday, etc.)"
|
|
965
|
+
},
|
|
966
|
+
"getter": false,
|
|
967
|
+
"setter": false,
|
|
968
|
+
"attribute": "first-day-of-week",
|
|
969
|
+
"reflect": false,
|
|
970
|
+
"defaultValue": "0"
|
|
971
|
+
},
|
|
972
|
+
"numberOfCalendars": {
|
|
973
|
+
"type": "number",
|
|
974
|
+
"mutable": true,
|
|
975
|
+
"complexType": {
|
|
976
|
+
"original": "number",
|
|
977
|
+
"resolved": "number",
|
|
978
|
+
"references": {}
|
|
979
|
+
},
|
|
980
|
+
"required": false,
|
|
981
|
+
"optional": false,
|
|
982
|
+
"docs": {
|
|
983
|
+
"tags": [{
|
|
984
|
+
"name": "default",
|
|
985
|
+
"text": "1"
|
|
986
|
+
}],
|
|
987
|
+
"text": "Number of calendars to display"
|
|
988
|
+
},
|
|
989
|
+
"getter": false,
|
|
990
|
+
"setter": false,
|
|
991
|
+
"attribute": "number-of-calendars",
|
|
992
|
+
"reflect": true,
|
|
993
|
+
"defaultValue": "1"
|
|
994
|
+
},
|
|
995
|
+
"singleValue": {
|
|
996
|
+
"type": "string",
|
|
997
|
+
"mutable": true,
|
|
998
|
+
"complexType": {
|
|
999
|
+
"original": "string",
|
|
1000
|
+
"resolved": "string",
|
|
1001
|
+
"references": {}
|
|
1002
|
+
},
|
|
1003
|
+
"required": false,
|
|
1004
|
+
"optional": false,
|
|
1005
|
+
"docs": {
|
|
1006
|
+
"tags": [],
|
|
1007
|
+
"text": "Selected date (ISO string format)\nex: \"2025-03-15\""
|
|
1008
|
+
},
|
|
1009
|
+
"getter": false,
|
|
1010
|
+
"setter": false,
|
|
1011
|
+
"attribute": "single-value",
|
|
1012
|
+
"reflect": true,
|
|
1013
|
+
"defaultValue": "''"
|
|
1014
|
+
},
|
|
1015
|
+
"rangeValue": {
|
|
1016
|
+
"type": "string",
|
|
1017
|
+
"mutable": true,
|
|
1018
|
+
"complexType": {
|
|
1019
|
+
"original": "string",
|
|
1020
|
+
"resolved": "string",
|
|
1021
|
+
"references": {}
|
|
1022
|
+
},
|
|
1023
|
+
"required": false,
|
|
1024
|
+
"optional": false,
|
|
1025
|
+
"docs": {
|
|
1026
|
+
"tags": [],
|
|
1027
|
+
"text": "Selected date range\nformat: { start: ISO string, end: ISO string }\nex: { start: \"2025-03-15\", end: \"2025-03-20\" }"
|
|
1028
|
+
},
|
|
1029
|
+
"getter": false,
|
|
1030
|
+
"setter": false,
|
|
1031
|
+
"attribute": "range-value",
|
|
1032
|
+
"reflect": true,
|
|
1033
|
+
"defaultValue": "''"
|
|
1034
|
+
},
|
|
1035
|
+
"min": {
|
|
1036
|
+
"type": "string",
|
|
1037
|
+
"mutable": false,
|
|
1038
|
+
"complexType": {
|
|
1039
|
+
"original": "string",
|
|
1040
|
+
"resolved": "string",
|
|
1041
|
+
"references": {}
|
|
1042
|
+
},
|
|
1043
|
+
"required": false,
|
|
1044
|
+
"optional": true,
|
|
1045
|
+
"docs": {
|
|
1046
|
+
"tags": [],
|
|
1047
|
+
"text": "Minimum date for selection (ISO string format, ex: \"2025-01-01\")"
|
|
1048
|
+
},
|
|
1049
|
+
"getter": false,
|
|
1050
|
+
"setter": false,
|
|
1051
|
+
"attribute": "min",
|
|
1052
|
+
"reflect": false,
|
|
1053
|
+
"defaultValue": "''"
|
|
1054
|
+
},
|
|
1055
|
+
"max": {
|
|
1056
|
+
"type": "string",
|
|
1057
|
+
"mutable": false,
|
|
1058
|
+
"complexType": {
|
|
1059
|
+
"original": "string",
|
|
1060
|
+
"resolved": "string",
|
|
1061
|
+
"references": {}
|
|
1062
|
+
},
|
|
1063
|
+
"required": false,
|
|
1064
|
+
"optional": true,
|
|
1065
|
+
"docs": {
|
|
1066
|
+
"tags": [],
|
|
1067
|
+
"text": "Maximum date for selection (ISO string format, ex: \"2025-12-31\")"
|
|
1068
|
+
},
|
|
1069
|
+
"getter": false,
|
|
1070
|
+
"setter": false,
|
|
1071
|
+
"attribute": "max",
|
|
1072
|
+
"reflect": false,
|
|
1073
|
+
"defaultValue": "''"
|
|
1074
|
+
},
|
|
1075
|
+
"disabledDates": {
|
|
1076
|
+
"type": "string",
|
|
1077
|
+
"mutable": false,
|
|
1078
|
+
"complexType": {
|
|
1079
|
+
"original": "string",
|
|
1080
|
+
"resolved": "string",
|
|
1081
|
+
"references": {}
|
|
1082
|
+
},
|
|
1083
|
+
"required": false,
|
|
1084
|
+
"optional": false,
|
|
1085
|
+
"docs": {
|
|
1086
|
+
"tags": [{
|
|
1087
|
+
"name": "default",
|
|
1088
|
+
"text": "'[]'"
|
|
1089
|
+
}],
|
|
1090
|
+
"text": "Disabled dates (ISO string array)"
|
|
1091
|
+
},
|
|
1092
|
+
"getter": false,
|
|
1093
|
+
"setter": false,
|
|
1094
|
+
"attribute": "disabled-dates",
|
|
1095
|
+
"reflect": false,
|
|
1096
|
+
"defaultValue": "''"
|
|
1097
|
+
},
|
|
1098
|
+
"locale": {
|
|
1099
|
+
"type": "string",
|
|
1100
|
+
"mutable": false,
|
|
1101
|
+
"complexType": {
|
|
1102
|
+
"original": "string",
|
|
1103
|
+
"resolved": "string",
|
|
1104
|
+
"references": {}
|
|
1105
|
+
},
|
|
1106
|
+
"required": false,
|
|
1107
|
+
"optional": false,
|
|
1108
|
+
"docs": {
|
|
1109
|
+
"tags": [{
|
|
1110
|
+
"name": "default",
|
|
1111
|
+
"text": "'en-BE'"
|
|
1112
|
+
}],
|
|
1113
|
+
"text": "Locale for date formatting"
|
|
1114
|
+
},
|
|
1115
|
+
"getter": false,
|
|
1116
|
+
"setter": false,
|
|
1117
|
+
"attribute": "locale",
|
|
1118
|
+
"reflect": false,
|
|
1119
|
+
"defaultValue": "'en-BE'"
|
|
1120
|
+
},
|
|
1121
|
+
"dateFormat": {
|
|
1122
|
+
"type": "string",
|
|
1123
|
+
"mutable": false,
|
|
1124
|
+
"complexType": {
|
|
1125
|
+
"original": "string",
|
|
1126
|
+
"resolved": "string",
|
|
1127
|
+
"references": {}
|
|
1128
|
+
},
|
|
1129
|
+
"required": false,
|
|
1130
|
+
"optional": false,
|
|
1131
|
+
"docs": {
|
|
1132
|
+
"tags": [{
|
|
1133
|
+
"name": "default",
|
|
1134
|
+
"text": "'YYYY-MM-DD'"
|
|
1135
|
+
}, {
|
|
1136
|
+
"name": "note",
|
|
1137
|
+
"text": "If the date format is in UTC mode, the date will be displayed in UTC time."
|
|
1138
|
+
}, {
|
|
1139
|
+
"name": "note",
|
|
1140
|
+
"text": "If the date format is not in UTC mode, the date will be displayed in the local time."
|
|
1141
|
+
}],
|
|
1142
|
+
"text": "Date format (ex: 'YYYY-MM-DD', 'DD-MM-YYYY', etc.)"
|
|
1143
|
+
},
|
|
1144
|
+
"getter": false,
|
|
1145
|
+
"setter": false,
|
|
1146
|
+
"attribute": "date-format",
|
|
1147
|
+
"reflect": false,
|
|
1148
|
+
"defaultValue": "'YYYY-MM-DD'"
|
|
1149
|
+
},
|
|
1150
|
+
"shortcutsPlacement": {
|
|
1151
|
+
"type": "string",
|
|
1152
|
+
"mutable": false,
|
|
1153
|
+
"complexType": {
|
|
1154
|
+
"original": "'bottom' | 'left' | 'right'",
|
|
1155
|
+
"resolved": "\"bottom\" | \"left\" | \"right\"",
|
|
1156
|
+
"references": {}
|
|
1157
|
+
},
|
|
1158
|
+
"required": false,
|
|
1159
|
+
"optional": false,
|
|
1160
|
+
"docs": {
|
|
1161
|
+
"tags": [{
|
|
1162
|
+
"name": "default",
|
|
1163
|
+
"text": "'bottom'"
|
|
1164
|
+
}],
|
|
1165
|
+
"text": "Footer placement"
|
|
1166
|
+
},
|
|
1167
|
+
"getter": false,
|
|
1168
|
+
"setter": false,
|
|
1169
|
+
"attribute": "shortcuts-placement",
|
|
1170
|
+
"reflect": false,
|
|
1171
|
+
"defaultValue": "'bottom'"
|
|
1172
|
+
},
|
|
1173
|
+
"selectionType": {
|
|
1174
|
+
"type": "string",
|
|
1175
|
+
"mutable": false,
|
|
1176
|
+
"complexType": {
|
|
1177
|
+
"original": "'single' | 'range'",
|
|
1178
|
+
"resolved": "\"range\" | \"single\"",
|
|
1179
|
+
"references": {}
|
|
1180
|
+
},
|
|
1181
|
+
"required": false,
|
|
1182
|
+
"optional": false,
|
|
1183
|
+
"docs": {
|
|
1184
|
+
"tags": [{
|
|
1185
|
+
"name": "default",
|
|
1186
|
+
"text": "'single'"
|
|
1187
|
+
}],
|
|
1188
|
+
"text": "Selection type (single date or date range)"
|
|
1189
|
+
},
|
|
1190
|
+
"getter": false,
|
|
1191
|
+
"setter": false,
|
|
1192
|
+
"attribute": "selection-type",
|
|
1193
|
+
"reflect": false,
|
|
1194
|
+
"defaultValue": "'single'"
|
|
1195
|
+
},
|
|
1196
|
+
"showActions": {
|
|
1197
|
+
"type": "boolean",
|
|
1198
|
+
"mutable": false,
|
|
1199
|
+
"complexType": {
|
|
1200
|
+
"original": "boolean",
|
|
1201
|
+
"resolved": "boolean",
|
|
1202
|
+
"references": {}
|
|
1203
|
+
},
|
|
1204
|
+
"required": false,
|
|
1205
|
+
"optional": false,
|
|
1206
|
+
"docs": {
|
|
1207
|
+
"tags": [{
|
|
1208
|
+
"name": "default",
|
|
1209
|
+
"text": "false"
|
|
1210
|
+
}],
|
|
1211
|
+
"text": "Show action buttons"
|
|
1212
|
+
},
|
|
1213
|
+
"getter": false,
|
|
1214
|
+
"setter": false,
|
|
1215
|
+
"attribute": "show-actions",
|
|
1216
|
+
"reflect": false,
|
|
1217
|
+
"defaultValue": "false"
|
|
1218
|
+
},
|
|
1219
|
+
"shortcuts": {
|
|
1220
|
+
"type": "string",
|
|
1221
|
+
"mutable": false,
|
|
1222
|
+
"complexType": {
|
|
1223
|
+
"original": "string",
|
|
1224
|
+
"resolved": "string",
|
|
1225
|
+
"references": {}
|
|
1226
|
+
},
|
|
1227
|
+
"required": false,
|
|
1228
|
+
"optional": false,
|
|
1229
|
+
"docs": {
|
|
1230
|
+
"tags": [{
|
|
1231
|
+
"name": "default",
|
|
1232
|
+
"text": "'[]'"
|
|
1233
|
+
}],
|
|
1234
|
+
"text": "Custom actions to display in the footer\nJSON array of objects with the following properties:\n- label: string\n- onClick: function"
|
|
1235
|
+
},
|
|
1236
|
+
"getter": false,
|
|
1237
|
+
"setter": false,
|
|
1238
|
+
"attribute": "shortcuts",
|
|
1239
|
+
"reflect": false,
|
|
1240
|
+
"defaultValue": "'[]'"
|
|
1241
|
+
},
|
|
1242
|
+
"showWeekNumbers": {
|
|
1243
|
+
"type": "boolean",
|
|
1244
|
+
"mutable": false,
|
|
1245
|
+
"complexType": {
|
|
1246
|
+
"original": "boolean",
|
|
1247
|
+
"resolved": "boolean",
|
|
1248
|
+
"references": {}
|
|
1249
|
+
},
|
|
1250
|
+
"required": false,
|
|
1251
|
+
"optional": false,
|
|
1252
|
+
"docs": {
|
|
1253
|
+
"tags": [{
|
|
1254
|
+
"name": "default",
|
|
1255
|
+
"text": "true"
|
|
1256
|
+
}],
|
|
1257
|
+
"text": "Show week numbers"
|
|
1258
|
+
},
|
|
1259
|
+
"getter": false,
|
|
1260
|
+
"setter": false,
|
|
1261
|
+
"attribute": "show-week-numbers",
|
|
1262
|
+
"reflect": false
|
|
1263
|
+
}
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
static get states() {
|
|
1267
|
+
return {
|
|
1268
|
+
"currentDate": {},
|
|
1269
|
+
"selectedDate": {},
|
|
1270
|
+
"startDate": {},
|
|
1271
|
+
"endDate": {},
|
|
1272
|
+
"months": {}
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
static get events() {
|
|
1276
|
+
return [{
|
|
1277
|
+
"method": "singleDateChange",
|
|
1278
|
+
"name": "singleDateChange",
|
|
1279
|
+
"bubbles": true,
|
|
1280
|
+
"cancelable": true,
|
|
1281
|
+
"composed": true,
|
|
1282
|
+
"docs": {
|
|
1283
|
+
"tags": [],
|
|
1284
|
+
"text": "Emitted when a single date is selected"
|
|
1285
|
+
},
|
|
1286
|
+
"complexType": {
|
|
1287
|
+
"original": "string",
|
|
1288
|
+
"resolved": "string",
|
|
1289
|
+
"references": {}
|
|
1290
|
+
}
|
|
1291
|
+
}, {
|
|
1292
|
+
"method": "rangeDateChange",
|
|
1293
|
+
"name": "rangeDateChange",
|
|
1294
|
+
"bubbles": true,
|
|
1295
|
+
"cancelable": true,
|
|
1296
|
+
"composed": true,
|
|
1297
|
+
"docs": {
|
|
1298
|
+
"tags": [],
|
|
1299
|
+
"text": "Emitted when a date range is selected"
|
|
1300
|
+
},
|
|
1301
|
+
"complexType": {
|
|
1302
|
+
"original": "DateRange",
|
|
1303
|
+
"resolved": "DateRange",
|
|
1304
|
+
"references": {
|
|
1305
|
+
"DateRange": {
|
|
1306
|
+
"location": "import",
|
|
1307
|
+
"path": "../../interfaces/dateRange",
|
|
1308
|
+
"id": "src/interfaces/dateRange.tsx::DateRange"
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}];
|
|
1313
|
+
}
|
|
1314
|
+
static get elementRef() { return "el"; }
|
|
1315
|
+
static get watchers() {
|
|
1316
|
+
return [{
|
|
1317
|
+
"propName": "numberOfCalendars",
|
|
1318
|
+
"methodName": "validateNumberOfCalendars"
|
|
1319
|
+
}, {
|
|
1320
|
+
"propName": "rangeValue",
|
|
1321
|
+
"methodName": "onRangeValueChange"
|
|
1322
|
+
}, {
|
|
1323
|
+
"propName": "disabledDates",
|
|
1324
|
+
"methodName": "handleDisabledDatesChange"
|
|
1325
|
+
}];
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
//# sourceMappingURL=nv-calendar.js.map
|