@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,980 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-fac2d5d2.js';
|
|
2
|
+
import { W as WEEK_ABBREVIATIONS } from './constants-8243d2ea.js';
|
|
3
|
+
|
|
4
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
|
+
|
|
6
|
+
var dayjs_min = {exports: {}};
|
|
7
|
+
|
|
8
|
+
(function (module, exports) {
|
|
9
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
10
|
+
}(dayjs_min));
|
|
11
|
+
|
|
12
|
+
const dayjs = dayjs_min.exports;
|
|
13
|
+
|
|
14
|
+
var customParseFormat$1 = {exports: {}};
|
|
15
|
+
|
|
16
|
+
(function (module, exports) {
|
|
17
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,s={},a=function(e){return (e=+e)+(e>68?1900:2e3)};var f=function(e){return function(t){this[e]=+t;}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},c={A:[o,function(e){this.afternoon=d(e,!1);}],a:[o,function(e){this.afternoon=d(e,!0);}],Q:[n,function(e){this.month=3*(e-1)+1;}],S:[n,function(e){this.milliseconds=100*+e;}],SS:[r,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[i,f("seconds")],ss:[i,f("seconds")],m:[i,f("minutes")],mm:[i,f("minutes")],H:[i,f("hours")],h:[i,f("hours")],HH:[i,f("hours")],hh:[i,f("hours")],D:[i,f("day")],DD:[r,f("day")],Do:[o,function(e){var t=s.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],w:[i,f("week")],ww:[r,f("week")],M:[i,f("month")],MM:[r,f("month")],MMM:[o,function(e){var t=u("months"),n=(u("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[o,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,f("year")],YY:[r,function(e){this.year=a(e);}],YYYY:[/\d{4}/,f("year")],Z:h,ZZ:h};function l(n){var r,i;r=n,i=s&&s.formats;for(var o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=o.length,f=0;f<a;f+=1){var h=o[f],u=c[h],d=u&&u[0],l=u&&u[1];o[f]=l?{regex:d,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=o[n];if("string"==typeof i)r+=i.length;else {var s=i.regex,f=i.parser,h=e.slice(r),u=s.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var a=o[1];if("string"==typeof a){var f=!0===o[2],h=!0===o[3],u=f||h,d=o[2];h&&(d=o[2]),s=this.$locale(),!f&&d&&(s=n.Ls[d]),this.$d=function(e,t,n,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,a=i.day,f=i.hours,h=i.minutes,u=i.seconds,d=i.milliseconds,c=i.zone,m=i.week,M=new Date,Y=a||(o||s?1:M.getDate()),p=o||M.getFullYear(),v=0;o&&!s||(v=s>0?s-1:M.getMonth());var D,w=f||0,g=h||0,y=u||0,L=d||0;return c?new Date(Date.UTC(p,v,Y,w,g,y,L+60*c.offset*1e3)):n?new Date(Date.UTC(p,v,Y,w,g,y,L)):(D=new Date(p,v,Y,w,g,y,L),m&&(D=r(D).week(m).toDate()),D)}catch(e){return new Date("")}}(t,a,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),s={};}else if(a instanceof Array)for(var c=a.length,m=1;m<=c;m+=1){o[1]=a[m-1];var M=n.apply(this,o);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===c&&(this.$d=new Date(""));}else i.call(this,e);};}}));
|
|
18
|
+
}(customParseFormat$1));
|
|
19
|
+
|
|
20
|
+
const customParseFormat = customParseFormat$1.exports;
|
|
21
|
+
|
|
22
|
+
var utc$1 = {exports: {}};
|
|
23
|
+
|
|
24
|
+
(function (module, exports) {
|
|
25
|
+
!function(t,i){module.exports=i();}(commonjsGlobal,(function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return !!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return "s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)};}}));
|
|
26
|
+
}(utc$1));
|
|
27
|
+
|
|
28
|
+
const utc = utc$1.exports;
|
|
29
|
+
|
|
30
|
+
var weekOfYear$1 = {exports: {}};
|
|
31
|
+
|
|
32
|
+
(function (module, exports) {
|
|
33
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)};}}));
|
|
34
|
+
}(weekOfYear$1));
|
|
35
|
+
|
|
36
|
+
const weekOfYear = weekOfYear$1.exports;
|
|
37
|
+
|
|
38
|
+
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(--color-level-00-background);border-radius:var(--menu-contextual-radius);padding:0.25rem;box-shadow:0 2px 6px 1px solid var(--components-button-medium-border);border:1px solid var(--components-button-medium-border);width:auto;max-width:100%}.datepicker-container-single{width:300px}.datepicker-container-single .datepicker-wrapper:has(.shortcuts-placement-left),.datepicker-container-single .datepicker-wrapper:has(.shortcuts-placement-right){width:410px !important}.datepicker-container-single:has(.shortcuts-placement-left),.datepicker-container-single:has(.shortcuts-placement-right){width:410px !important}.datepicker-wrapper{display:flex;justify-content:center;align-items:flex-start;gap:0.5rem;width:auto;overflow-x:hidden}.datepicker-wrapper.single{justify-content:center}.calendar-container{display:flex;flex-direction:column;align-items:center;padding:0.25rem;width:auto;position:relative}.calendar-separator{width:1px;background:var(--components-button-medium-border);height:auto;min-height:100%;margin:0 10px}.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:0.25rem;width:100%}.nav-buttons{display:flex;gap:0.15rem;margin-left:auto}.nav-left{order:-1}.date-controls{display:flex;gap:0.25rem;align-items:center;min-height:34px;justify-content:center}.datepicker-container-single .date-controls{justify-content:flex-start !important}.datepicker-container:not(.datepicker-container-single) .date-controls{justify-content:center !important}.calendar-grid{display:grid;grid-template-columns:auto 1fr;gap:0.25rem;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:2rem repeat(6, 2rem);background:var(--color-level-30-background);border-radius:var(--menu-contextual-radius);width:2.5rem}.week-numbers .clickable{cursor:pointer}.week-numbers .clickable:hover{background:var(--components-button-high-background-hover);color:white;border-radius:var(--menu-contextual-radius)}.week-header,.week-number{display:grid;place-items:center;font-size:0.875rem}.week-header{font-weight:600;color:var(--components-form-text-label-default)}.week-number{color:var(--components-form-text-description-default)}.days-container{display:grid;grid-template-rows:auto 1fr}.days-header{display:grid;grid-template-columns:repeat(7, 2rem);height:2rem}.day-header{display:grid;place-items:center;font-size:0.875rem;color:var(--components-form-text-description-default)}.days-grid{display:grid;grid-template-columns:repeat(7, 2rem);grid-template-rows:repeat(6, 2rem);animation:fadeIn 0.2s ease-in}.day{display:grid;place-items:center;width:2rem;height:2rem;font-size:0.875rem;border-radius:var(--menu-contextual-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-button-high-background-hover);color:white}.day.selected,.day.selected:hover{background:var(--components-button-high-background);color:white}.day.disabled{color:color-mix(in srgb, var(--components-form-shape-background-selected) 50%, transparent);cursor:not-allowed}.day.outside-month{color:var(--components-form-text-description-default);opacity:0.6}.day.outside-month.selected,.day.outside-month.in-range{opacity:1 !important;color:inherit}.day.in-range{background:color-mix(in srgb, var(--components-form-shape-background-selected) 50%, transparent);color:white;border-radius:0;position:relative}.day.range-start,.day.range-end{background:var(--components-button-high-background);color:white;position:relative}.day.range-start{border-radius:var(--menu-contextual-radius) 0 0 var(--menu-contextual-radius)}.day.range-end{border-radius:0 var(--menu-contextual-radius) var(--menu-contextual-radius) 0}.day.outside-month.range-start,.day.outside-month.range-end{background:var(--components-button-high-background) !important;color:white;opacity:1 !important}.day.outside-month.in-range{background:color-mix(in srgb, var(--components-form-shape-background-selected) 50%, transparent);color:white}.day.is-today{font-weight:600;position:relative}.day.is-today::after{content:\"\";position:absolute;bottom:0.15rem;left:50%;transform:translateX(-50%);width:0.15rem;height:0.15rem;background-color:currentColor;border-radius:50%}.day.is-today.selected::after{background-color:white}.calendar-footer{display:flex;gap:0.25rem;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-actions{display:flex;justify-content:flex-end;gap:0.25rem}.calendar-footer+.datepicker-actions{margin-top:0}.datepicker-controls{display:flex;flex-direction:column;border-top:1px solid var(--components-button-medium-border);padding:1rem;gap:0.25rem}.shortcuts-placement-left,.shortcuts-placement-right{display:flex;flex-direction:column;gap:0.25rem;margin-top:1rem}.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)}}";
|
|
39
|
+
const NvCalendarStyle0 = nvCalendarCss;
|
|
40
|
+
|
|
41
|
+
// Extend dayjs with plugins
|
|
42
|
+
dayjs.extend(customParseFormat);
|
|
43
|
+
dayjs.extend(utc);
|
|
44
|
+
dayjs.extend(weekOfYear);
|
|
45
|
+
const NvCalendar = class {
|
|
46
|
+
constructor(hostRef) {
|
|
47
|
+
registerInstance(this, hostRef);
|
|
48
|
+
this.singleDateChange = createEvent(this, "singleDateChange", 7);
|
|
49
|
+
this.rangeDateChange = createEvent(this, "rangeDateChange", 7);
|
|
50
|
+
/****************************************************************************/
|
|
51
|
+
//#region PROPERTIES
|
|
52
|
+
/**
|
|
53
|
+
* First day of the week (0 = Sunday, 1 = Monday, etc.)
|
|
54
|
+
* @default 0
|
|
55
|
+
*/
|
|
56
|
+
this.firstDayOfWeek = 0;
|
|
57
|
+
/**
|
|
58
|
+
* Number of calendars to display
|
|
59
|
+
* @default 1
|
|
60
|
+
*/
|
|
61
|
+
this.numberOfCalendars = 1;
|
|
62
|
+
/**
|
|
63
|
+
* Selected date (ISO string format)
|
|
64
|
+
* ex: "2025-03-15"
|
|
65
|
+
*/
|
|
66
|
+
this.singleValue = '';
|
|
67
|
+
/**
|
|
68
|
+
* Selected date range
|
|
69
|
+
* format: { start: ISO string, end: ISO string }
|
|
70
|
+
* ex: { start: "2025-03-15", end: "2025-03-20" }
|
|
71
|
+
*/
|
|
72
|
+
this.rangeValue = '';
|
|
73
|
+
/**
|
|
74
|
+
* Minimum date for selection (ISO string format, ex: "2025-01-01")
|
|
75
|
+
*/
|
|
76
|
+
this.min = '';
|
|
77
|
+
/**
|
|
78
|
+
* Maximum date for selection (ISO string format, ex: "2025-12-31")
|
|
79
|
+
*/
|
|
80
|
+
this.max = '';
|
|
81
|
+
/** Disabled dates (ISO string array)
|
|
82
|
+
* @default '[]'
|
|
83
|
+
*/
|
|
84
|
+
this.disabledDates = '';
|
|
85
|
+
/** Locale for date formatting
|
|
86
|
+
* @default 'en-BE'
|
|
87
|
+
*/
|
|
88
|
+
this.locale = 'en-BE';
|
|
89
|
+
/** Date format (ex: 'YYYY-MM-DD', 'DD-MM-YYYY', etc.)
|
|
90
|
+
* @default 'YYYY-MM-DD'
|
|
91
|
+
* @note If the date format is in UTC mode, the date will be displayed in UTC time.
|
|
92
|
+
* @note If the date format is not in UTC mode, the date will be displayed in the local time.
|
|
93
|
+
*/
|
|
94
|
+
this.dateFormat = 'YYYY-MM-DD';
|
|
95
|
+
/**
|
|
96
|
+
* Footer placement
|
|
97
|
+
* @default 'bottom'
|
|
98
|
+
*/
|
|
99
|
+
this.shortcutsPlacement = 'bottom';
|
|
100
|
+
/**
|
|
101
|
+
* Selection type (single date or date range)
|
|
102
|
+
* @default 'single'
|
|
103
|
+
*/
|
|
104
|
+
this.selectionType = 'single';
|
|
105
|
+
/**
|
|
106
|
+
* Show action buttons
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
this.showActions = false;
|
|
110
|
+
/**
|
|
111
|
+
* Custom actions to display in the footer
|
|
112
|
+
* JSON array of objects with the following properties:
|
|
113
|
+
* - label: string
|
|
114
|
+
* - onClick: function
|
|
115
|
+
* @default '[]'
|
|
116
|
+
*/
|
|
117
|
+
this.shortcuts = '[]';
|
|
118
|
+
/** Cache for parsed disabled dates */
|
|
119
|
+
this.parsedDisabledDates = [];
|
|
120
|
+
/** Selected date */
|
|
121
|
+
this.selectedDate = null;
|
|
122
|
+
/** Start date */
|
|
123
|
+
this.startDate = null;
|
|
124
|
+
/** End date */
|
|
125
|
+
this.endDate = null;
|
|
126
|
+
/** List of formatted months for the selector */
|
|
127
|
+
this.months = [];
|
|
128
|
+
/**
|
|
129
|
+
* Resets the current selection
|
|
130
|
+
*/
|
|
131
|
+
this.resetSelection = () => {
|
|
132
|
+
if (this.selectionType === 'single') {
|
|
133
|
+
this.selectedDate = null;
|
|
134
|
+
this.singleValue = '';
|
|
135
|
+
this.singleDateChange.emit('');
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.startDate = null;
|
|
139
|
+
this.endDate = null;
|
|
140
|
+
this.rangeValue = '';
|
|
141
|
+
this.rangeDateChange.emit({ start: '', end: '' });
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Confirms the current selection
|
|
146
|
+
*/
|
|
147
|
+
this.confirmSelection = () => {
|
|
148
|
+
if (this.selectionType === 'single' && this.selectedDate) {
|
|
149
|
+
const dateStr = this.formatDate(this.selectedDate);
|
|
150
|
+
this.singleDateChange.emit(dateStr);
|
|
151
|
+
this.singleValue = dateStr;
|
|
152
|
+
}
|
|
153
|
+
else if (this.selectionType === 'range' &&
|
|
154
|
+
this.startDate &&
|
|
155
|
+
this.endDate) {
|
|
156
|
+
this.rangeDateChange.emit({
|
|
157
|
+
start: this.formatDate(this.startDate),
|
|
158
|
+
end: this.formatDate(this.endDate),
|
|
159
|
+
});
|
|
160
|
+
this.rangeValue = JSON.stringify({
|
|
161
|
+
start: this.formatDate(this.startDate),
|
|
162
|
+
end: this.formatDate(this.endDate),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
//#endregion EVENTS
|
|
168
|
+
/****************************************************************************/
|
|
169
|
+
//#region LIFECYCLE
|
|
170
|
+
componentWillLoad() {
|
|
171
|
+
this.parseDisabledDates();
|
|
172
|
+
if (this.selectionType === 'single' && this.singleValue) {
|
|
173
|
+
this.selectedDate = this.parseDate(this.singleValue);
|
|
174
|
+
this.currentDate = this.selectedDate;
|
|
175
|
+
}
|
|
176
|
+
else if (this.selectionType === 'range' && this.rangeValue) {
|
|
177
|
+
try {
|
|
178
|
+
let parsed;
|
|
179
|
+
if (typeof this.rangeValue === 'string') {
|
|
180
|
+
parsed = JSON.parse(this.rangeValue);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
parsed = this.rangeValue;
|
|
184
|
+
}
|
|
185
|
+
if (parsed.start && parsed.end) {
|
|
186
|
+
this.startDate = this.parseDate(parsed.start);
|
|
187
|
+
this.endDate = this.parseDate(parsed.end);
|
|
188
|
+
this.currentDate = this.startDate;
|
|
189
|
+
if (this.startDate && this.endDate && this.startDate > this.endDate) {
|
|
190
|
+
console.warn(`Warning: startDate (${this.formatDate(this.startDate)}) is after endDate (${this.formatDate(this.endDate)})`);
|
|
191
|
+
// [this.startDate, this.endDate] = [this.endDate, this.startDate];
|
|
192
|
+
throw new Error('startDate cannot be after endDate');
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
console.error('Invalid JSON for rangeValue:', error);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
this.currentDate = new Date();
|
|
202
|
+
}
|
|
203
|
+
this.initializeMonths();
|
|
204
|
+
}
|
|
205
|
+
// componentDidLoad() {
|
|
206
|
+
// if (this.rangeValue) {
|
|
207
|
+
// this.onRangeValueChange(this.rangeValue);
|
|
208
|
+
// }
|
|
209
|
+
// }
|
|
210
|
+
//#endregion LIFECYCLE
|
|
211
|
+
/****************************************************************************/
|
|
212
|
+
//#region METHODS
|
|
213
|
+
/**
|
|
214
|
+
* Change the displayed month
|
|
215
|
+
* @param {number} offset - Month offset (-1 for previous, 1 for next)
|
|
216
|
+
* @param {number} calendarOffset - Month offset for the calendar (0 by default)
|
|
217
|
+
*/
|
|
218
|
+
changeMonth(offset, calendarOffset = 0) {
|
|
219
|
+
const newDate = new Date(this.currentDate);
|
|
220
|
+
newDate.setUTCMonth(newDate.getUTCMonth() + offset + calendarOffset);
|
|
221
|
+
// Add the appropriate animation class
|
|
222
|
+
const containers = this.el.querySelectorAll('.calendar-grid');
|
|
223
|
+
containers.forEach(container => {
|
|
224
|
+
// Remove existing animation classes
|
|
225
|
+
container.classList.remove('slide-left', 'slide-right');
|
|
226
|
+
// Add the new animation class
|
|
227
|
+
const animationClass = offset > 0 ? 'slide-left' : 'slide-right';
|
|
228
|
+
container.classList.add(animationClass);
|
|
229
|
+
// Remove the class after the animation
|
|
230
|
+
setTimeout(() => {
|
|
231
|
+
container.classList.remove(animationClass);
|
|
232
|
+
}, 300); // 300ms corresponds to $slide-duration in the SCSS
|
|
233
|
+
});
|
|
234
|
+
this.currentDate = newDate;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Handles date selection based on the mode
|
|
238
|
+
* @param {Date} date - Selected date
|
|
239
|
+
*/
|
|
240
|
+
handleDateSelection(date) {
|
|
241
|
+
if (this.isDateDisabled(date)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (this.selectionType === 'single') {
|
|
245
|
+
this.handleSingleSelection(date);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
this.handleRangeSelection(date);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Handles single date selection
|
|
253
|
+
* @param {Date} date - Selected date
|
|
254
|
+
*/
|
|
255
|
+
handleSingleSelection(date) {
|
|
256
|
+
if (!date)
|
|
257
|
+
return;
|
|
258
|
+
const formattedDate = this.formatDate(date);
|
|
259
|
+
this.selectedDate = date;
|
|
260
|
+
this.selectedDate = date;
|
|
261
|
+
console.info('handleSingleSelection => selectedDate =', this.selectedDate);
|
|
262
|
+
console.info('📤 Emitting singleDateChange:', {
|
|
263
|
+
selectedDate: formattedDate,
|
|
264
|
+
});
|
|
265
|
+
this.singleDateChange.emit(formattedDate);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Handles range date selection
|
|
269
|
+
* @param {Date} date - Selected date
|
|
270
|
+
*/
|
|
271
|
+
handleRangeSelection(date) {
|
|
272
|
+
if (!this.startDate || (this.startDate && this.endDate)) {
|
|
273
|
+
this.startDate = date;
|
|
274
|
+
this.endDate = null;
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
this.endDate = date;
|
|
278
|
+
if (this.startDate > this.endDate) {
|
|
279
|
+
[this.startDate, this.endDate] = [this.endDate, this.startDate];
|
|
280
|
+
}
|
|
281
|
+
this.rangeDateChange.emit({
|
|
282
|
+
start: this.formatDate(this.startDate),
|
|
283
|
+
end: this.formatDate(this.endDate),
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Calculates the ISO week number
|
|
289
|
+
* @param {Date} date - Date to calculate
|
|
290
|
+
* @returns {number} Week number
|
|
291
|
+
*/
|
|
292
|
+
getWeekNumber(date) {
|
|
293
|
+
const startOfYear = new Date(date.getFullYear(), 0, 1);
|
|
294
|
+
const pastDaysOfYear = (date.getTime() - startOfYear.getTime()) / 86400000;
|
|
295
|
+
return Math.ceil((pastDaysOfYear + startOfYear.getDay() + 1) / 7);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Checks if a date is disabled.
|
|
299
|
+
* Disabled if:
|
|
300
|
+
* - The date is before min (if defined)
|
|
301
|
+
* - The date is after max (if defined)
|
|
302
|
+
* - The date is in the disabledDates array
|
|
303
|
+
* @param {Date} date - Date to check
|
|
304
|
+
* @returns {boolean} true if the date is disabled
|
|
305
|
+
*/
|
|
306
|
+
isDateDisabled(date) {
|
|
307
|
+
if (!date)
|
|
308
|
+
return true;
|
|
309
|
+
// Minimum bound check
|
|
310
|
+
if (this.min) {
|
|
311
|
+
const minDate = this.parseDate(this.min);
|
|
312
|
+
if (minDate && date < minDate) {
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// Maximum bound check
|
|
317
|
+
if (this.max) {
|
|
318
|
+
const maxDate = this.parseDate(this.max);
|
|
319
|
+
if (maxDate && date > maxDate) {
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
// Check disabled dates
|
|
324
|
+
return this.parsedDisabledDates.some(disabledDate => this.isSameDate(date, disabledDate));
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Checks if a date is in the selected range
|
|
328
|
+
* @param {Date} date - Date to check
|
|
329
|
+
* @returns {boolean} true if the date is in the range
|
|
330
|
+
*/
|
|
331
|
+
isDateInRange(date) {
|
|
332
|
+
if (!date || !this.startDate || !this.endDate)
|
|
333
|
+
return false;
|
|
334
|
+
const checkDate = this.parseDate(date);
|
|
335
|
+
const startDate = this.parseDate(this.startDate);
|
|
336
|
+
const endDate = this.parseDate(this.endDate);
|
|
337
|
+
// Verify if startDate and endDate are valid
|
|
338
|
+
if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
// Verify that startDate is before endDate (additional security)
|
|
342
|
+
if (startDate > endDate)
|
|
343
|
+
return false;
|
|
344
|
+
// Comparison based only on the date (year, month, day)
|
|
345
|
+
return (this.isSameOrAfter(checkDate, startDate) &&
|
|
346
|
+
this.isSameOrBefore(checkDate, endDate));
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Retrieves the localized day names
|
|
350
|
+
* @returns {string[]} Array of short day names
|
|
351
|
+
*/
|
|
352
|
+
getDayNames() {
|
|
353
|
+
const formatter = new Intl.DateTimeFormat(this.locale, {
|
|
354
|
+
weekday: 'short',
|
|
355
|
+
});
|
|
356
|
+
return [...Array(7)].map((_, i) => formatter.format(new Date(2023, 0, i + 1 + this.firstDayOfWeek)));
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Generates the days of the current month
|
|
360
|
+
* @param {number} offset - Month offset (0 by default)
|
|
361
|
+
* @param {number} totalCalendars - Number of calendars to display (1 by default)
|
|
362
|
+
* @returns {Array<{ dayOfMonth: number | null, date: Date | null, isSelected: boolean, isDisabled: boolean }>} Array of formatted days
|
|
363
|
+
*/
|
|
364
|
+
getDaysInMonth(offset = 0, totalCalendars = 1) {
|
|
365
|
+
const year = this.currentDate.getUTCFullYear();
|
|
366
|
+
const month = this.currentDate.getUTCMonth() + offset;
|
|
367
|
+
const firstDay = new Date(Date.UTC(year, month, 1));
|
|
368
|
+
const lastDay = new Date(Date.UTC(year, month + 1, 0));
|
|
369
|
+
const days = [];
|
|
370
|
+
// Calculate the offset to include the days of the previous month only for the first calendar
|
|
371
|
+
const offsetDays = offset === 0 ? (firstDay.getUTCDay() - this.firstDayOfWeek + 7) % 7 : 0;
|
|
372
|
+
// Add the days of the previous month for the first calendar
|
|
373
|
+
if (offset === 0) {
|
|
374
|
+
const prevMonthLastDay = new Date(Date.UTC(year, month, 0)).getUTCDate();
|
|
375
|
+
for (let i = offsetDays; i > 0; i--) {
|
|
376
|
+
const date = new Date(Date.UTC(year, month - 1, prevMonthLastDay - i + 1));
|
|
377
|
+
days.push({
|
|
378
|
+
dayOfMonth: date.getUTCDate(),
|
|
379
|
+
date,
|
|
380
|
+
isCurrentMonth: false,
|
|
381
|
+
isDisabled: this.isDateDisabled(date),
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
// Add the days of the current month
|
|
386
|
+
for (let i = 1; i <= lastDay.getUTCDate(); i++) {
|
|
387
|
+
const date = new Date(Date.UTC(year, month, i));
|
|
388
|
+
days.push({
|
|
389
|
+
dayOfMonth: i,
|
|
390
|
+
date,
|
|
391
|
+
isCurrentMonth: true,
|
|
392
|
+
isDisabled: this.isDateDisabled(date),
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
// Add the days of the next month only for the last calendar
|
|
396
|
+
if (offset === totalCalendars - 1) {
|
|
397
|
+
const nextMonthDaysNeeded = 7 - (days.length % 7 || 7);
|
|
398
|
+
for (let i = 1; i <= nextMonthDaysNeeded; i++) {
|
|
399
|
+
const date = new Date(Date.UTC(year, month + 1, i));
|
|
400
|
+
days.push({
|
|
401
|
+
dayOfMonth: i,
|
|
402
|
+
date,
|
|
403
|
+
isCurrentMonth: false,
|
|
404
|
+
isDisabled: this.isDateDisabled(date),
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return days;
|
|
409
|
+
}
|
|
410
|
+
/** Initializes the list of formatted months according to the locale */
|
|
411
|
+
initializeMonths() {
|
|
412
|
+
const formatter = new Intl.DateTimeFormat(this.locale, { month: 'long' });
|
|
413
|
+
this.months = Array.from({ length: 12 }, (_, i) => ({
|
|
414
|
+
value: i,
|
|
415
|
+
label: formatter.format(new Date(2000, i, 1)),
|
|
416
|
+
}));
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Retrieves the localized abbreviation for "week"
|
|
420
|
+
* @returns {string} Localized abbreviation for "week"
|
|
421
|
+
*/
|
|
422
|
+
getLocalizedWeekText() {
|
|
423
|
+
return WEEK_ABBREVIATIONS[this.locale] || 'W';
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Handles month change in the selector
|
|
427
|
+
* @param {Event} event - Month change event
|
|
428
|
+
* @param {number} calendarOffset - Calendar offset (0 by default)
|
|
429
|
+
*/
|
|
430
|
+
handleMonthChange(event, calendarOffset = 0) {
|
|
431
|
+
const select = event.target;
|
|
432
|
+
const selectedMonth = parseInt(select.value, 10);
|
|
433
|
+
const currentMonth = this.currentDate.getUTCMonth();
|
|
434
|
+
// Calculate the difference considering the calendar offset
|
|
435
|
+
const monthDiff = selectedMonth - ((currentMonth + calendarOffset) % 12);
|
|
436
|
+
const newDate = new Date(this.currentDate);
|
|
437
|
+
newDate.setUTCMonth(newDate.getUTCMonth() + monthDiff);
|
|
438
|
+
this.currentDate = newDate;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Handles year change in the numeric entry
|
|
442
|
+
* @param {Event} event - Year change event
|
|
443
|
+
* @param {number} calendarOffset - Calendar offset (0 by default)
|
|
444
|
+
*/
|
|
445
|
+
handleYearChange(event, calendarOffset = 0) {
|
|
446
|
+
const input = event.target;
|
|
447
|
+
const year = parseInt(input.value, 10);
|
|
448
|
+
if (!isNaN(year) && year >= 1900 && year <= 2100) {
|
|
449
|
+
const newDate = new Date(this.currentDate);
|
|
450
|
+
newDate.setUTCFullYear(year);
|
|
451
|
+
newDate.setUTCMonth(newDate.getUTCMonth() + calendarOffset);
|
|
452
|
+
this.currentDate = newDate;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Handles week selection
|
|
457
|
+
* @param {Date[]} weekDays - Selected week days
|
|
458
|
+
* @param {number} calendarIndex - Calendar index from which the selection is made
|
|
459
|
+
*/
|
|
460
|
+
handleWeekSelection(weekDays, calendarIndex) {
|
|
461
|
+
if (this.selectionType !== 'range')
|
|
462
|
+
return;
|
|
463
|
+
// Retrieves the days of the month adjusted according to the calendar index
|
|
464
|
+
const allDays = this.getDaysInMonth(calendarIndex, this.numberOfCalendars);
|
|
465
|
+
const weekStart = weekDays[0];
|
|
466
|
+
const weekEnd = weekDays[weekDays.length - 1];
|
|
467
|
+
if (!weekStart || !weekEnd)
|
|
468
|
+
return;
|
|
469
|
+
const selectedWeekDays = allDays.filter(day => day.date && day.date >= weekStart && day.date <= weekEnd);
|
|
470
|
+
const validDays = selectedWeekDays.filter(day => !this.isDateDisabled(day.date));
|
|
471
|
+
if (validDays.length > 0) {
|
|
472
|
+
this.startDate = validDays[0].date;
|
|
473
|
+
this.endDate = validDays[validDays.length - 1].date;
|
|
474
|
+
this.rangeDateChange.emit({
|
|
475
|
+
start: this.startDate.toISOString(),
|
|
476
|
+
end: this.endDate.toISOString(),
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Checks if a date corresponds to today
|
|
482
|
+
* @param {Date} date - Date to check
|
|
483
|
+
* @returns {boolean} true if the date is today
|
|
484
|
+
*/
|
|
485
|
+
isToday(date) {
|
|
486
|
+
const today = new Date();
|
|
487
|
+
return (date.getDate() === today.getDate() &&
|
|
488
|
+
date.getMonth() === today.getMonth() &&
|
|
489
|
+
date.getFullYear() === today.getFullYear());
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Watches the changes of the number of calendars
|
|
493
|
+
* @watch numberOfCalendars
|
|
494
|
+
* @param {number} newValue - New number of calendars
|
|
495
|
+
*/
|
|
496
|
+
validateNumberOfCalendars(newValue) {
|
|
497
|
+
if (newValue < 1 || newValue > 4) {
|
|
498
|
+
console.warn('numberOfCalendars must be between 1 and 4. Defaulting to 1.');
|
|
499
|
+
this.numberOfCalendars = 1;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Watches the changes of the selected date range
|
|
504
|
+
* @watch rangeValue
|
|
505
|
+
* @param {Object} newValue - New rangeValue value
|
|
506
|
+
* @param {string} newValue.start - Start date
|
|
507
|
+
* @param {string} newValue.end - End date
|
|
508
|
+
*/
|
|
509
|
+
onRangeValueChange(newValue) {
|
|
510
|
+
if (newValue) {
|
|
511
|
+
try {
|
|
512
|
+
const parsed = JSON.parse(newValue);
|
|
513
|
+
if (parsed.start && parsed.end) {
|
|
514
|
+
this.startDate = this.parseDate(parsed.start);
|
|
515
|
+
this.endDate = this.parseDate(parsed.end);
|
|
516
|
+
this.currentDate = this.parseDate(parsed.start);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
catch (error) {
|
|
520
|
+
console.error('Invalid JSON for rangeValue:', error);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Watches the changes of the disabled dates
|
|
526
|
+
* @watch disabledDates
|
|
527
|
+
* @description Watches the changes of the disabled dates
|
|
528
|
+
*/
|
|
529
|
+
handleDisabledDatesChange() {
|
|
530
|
+
this.parseDisabledDates();
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Convert a date string/Date to a Date without timezone offset
|
|
534
|
+
* @param {string | Date} dateInput - Date under string or Date object form
|
|
535
|
+
* @returns {Date} Date in Date form without timezone offset
|
|
536
|
+
*/
|
|
537
|
+
parseDate(dateInput) {
|
|
538
|
+
if (dateInput instanceof Date)
|
|
539
|
+
return dateInput;
|
|
540
|
+
// Handling Unix Seconds ("X") formats
|
|
541
|
+
if (this.dateFormat === 'X') {
|
|
542
|
+
const unixSeconds = Number(dateInput);
|
|
543
|
+
if (isNaN(unixSeconds))
|
|
544
|
+
return null;
|
|
545
|
+
return this.isUTCMode
|
|
546
|
+
? dayjs.unix(unixSeconds).utc().toDate()
|
|
547
|
+
: dayjs.unix(unixSeconds).toDate();
|
|
548
|
+
}
|
|
549
|
+
// Handling Unix Milliseconds ("x") formats
|
|
550
|
+
if (this.dateFormat === 'x') {
|
|
551
|
+
const unixMilliseconds = Number(dateInput);
|
|
552
|
+
if (isNaN(unixMilliseconds))
|
|
553
|
+
return null;
|
|
554
|
+
return this.isUTCMode
|
|
555
|
+
? dayjs(unixMilliseconds).utc().toDate()
|
|
556
|
+
: dayjs(unixMilliseconds).toDate();
|
|
557
|
+
}
|
|
558
|
+
// Handling C# Ticks format
|
|
559
|
+
if (this.dateFormat === 'Ticks') {
|
|
560
|
+
const ticks = Number(dateInput);
|
|
561
|
+
if (isNaN(ticks))
|
|
562
|
+
return null;
|
|
563
|
+
// Conversion of .NET ticks to milliseconds since Unix epoch
|
|
564
|
+
const unixMilliseconds = (ticks - 621355968000000000) / 10000;
|
|
565
|
+
return this.isUTCMode
|
|
566
|
+
? dayjs(unixMilliseconds).utc().toDate()
|
|
567
|
+
: dayjs(unixMilliseconds).toDate();
|
|
568
|
+
}
|
|
569
|
+
// For all other formats, use customParseFormat in strict mode
|
|
570
|
+
let parsed;
|
|
571
|
+
if (this.isUTCMode) {
|
|
572
|
+
parsed = dayjs.utc(dateInput, this.dateFormat, true);
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
parsed = dayjs(dateInput, this.dateFormat, true);
|
|
576
|
+
}
|
|
577
|
+
if (!parsed.isValid()) {
|
|
578
|
+
console.error(`Parsing error:`, {
|
|
579
|
+
dateInput,
|
|
580
|
+
dateFormat: this.dateFormat,
|
|
581
|
+
});
|
|
582
|
+
return null;
|
|
583
|
+
}
|
|
584
|
+
return parsed.toDate();
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Formats a date to a string according to the format
|
|
588
|
+
* @param {Date} date - Date to format
|
|
589
|
+
* @returns {string} Formatted date
|
|
590
|
+
*/
|
|
591
|
+
formatDate(date) {
|
|
592
|
+
if (!date)
|
|
593
|
+
return '';
|
|
594
|
+
// If the format is "Ticks", convert the time to C# ticks
|
|
595
|
+
if (this.dateFormat === 'Ticks') {
|
|
596
|
+
const ticks = date.getTime() * 10000 + 621355968000000000;
|
|
597
|
+
return ticks.toString();
|
|
598
|
+
}
|
|
599
|
+
// If the format is "X" (Unix Seconds)
|
|
600
|
+
if (this.dateFormat === 'X') {
|
|
601
|
+
return dayjs(date).unix().toString();
|
|
602
|
+
}
|
|
603
|
+
// If the format is "x" (Unix Milliseconds)
|
|
604
|
+
if (this.dateFormat === 'x') {
|
|
605
|
+
return date.getTime().toString();
|
|
606
|
+
}
|
|
607
|
+
// Otherwise, format according to the mode (UTC or local)
|
|
608
|
+
return this.isUTCMode
|
|
609
|
+
? dayjs(date).utc().format(this.dateFormat)
|
|
610
|
+
: dayjs(date).format(this.dateFormat);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Parse and cache the disabled dates
|
|
614
|
+
* @description Parse and cache the disabled dates
|
|
615
|
+
*/
|
|
616
|
+
parseDisabledDates() {
|
|
617
|
+
if (!this.disabledDates) {
|
|
618
|
+
this.parsedDisabledDates = [];
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
try {
|
|
622
|
+
const disabledDatesArray = JSON.parse(this.disabledDates);
|
|
623
|
+
this.parsedDisabledDates = disabledDatesArray
|
|
624
|
+
.map(date => this.parseDate(date))
|
|
625
|
+
.filter(date => date !== null);
|
|
626
|
+
}
|
|
627
|
+
catch (error) {
|
|
628
|
+
console.error('Error parsing disabled dates:', error);
|
|
629
|
+
this.parsedDisabledDates = [];
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Checks if two dates are identical
|
|
634
|
+
* @param {Date | null} date1 - First date
|
|
635
|
+
* @param {Date | null} date2 - Second date
|
|
636
|
+
* @returns {boolean} true if the dates are identical
|
|
637
|
+
*/
|
|
638
|
+
isSameDate(date1, date2) {
|
|
639
|
+
if (!date1 || !date2)
|
|
640
|
+
return false;
|
|
641
|
+
if (this.isUTCMode) {
|
|
642
|
+
return (date1.getUTCFullYear() === date2.getUTCFullYear() &&
|
|
643
|
+
date1.getUTCMonth() === date2.getUTCMonth() &&
|
|
644
|
+
date1.getUTCDate() === date2.getUTCDate());
|
|
645
|
+
}
|
|
646
|
+
else {
|
|
647
|
+
return (date1.getFullYear() === date2.getFullYear() &&
|
|
648
|
+
date1.getMonth() === date2.getMonth() &&
|
|
649
|
+
date1.getDate() === date2.getDate());
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Checks if a date is identical or after another date
|
|
654
|
+
* @param {Date} date - Date to check
|
|
655
|
+
* @param {Date} compareDate - Reference date
|
|
656
|
+
* @returns {boolean} true if `date` >= `compareDate`
|
|
657
|
+
*/
|
|
658
|
+
isSameOrAfter(date, compareDate) {
|
|
659
|
+
if (this.isUTCMode) {
|
|
660
|
+
return (date.getUTCFullYear() > compareDate.getUTCFullYear() ||
|
|
661
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
662
|
+
date.getUTCMonth() > compareDate.getUTCMonth()) ||
|
|
663
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
664
|
+
date.getUTCMonth() === compareDate.getUTCMonth() &&
|
|
665
|
+
date.getUTCDate() >= compareDate.getUTCDate()));
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
return (date.getFullYear() > compareDate.getFullYear() ||
|
|
669
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
670
|
+
date.getMonth() > compareDate.getMonth()) ||
|
|
671
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
672
|
+
date.getMonth() === compareDate.getMonth() &&
|
|
673
|
+
date.getDate() >= compareDate.getDate()));
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Checks if a date is identical or before another date
|
|
678
|
+
* @param {Date} date - Date to check
|
|
679
|
+
* @param {Date} compareDate - Reference date
|
|
680
|
+
* @returns {boolean} true if `date` <= `compareDate`
|
|
681
|
+
*/
|
|
682
|
+
isSameOrBefore(date, compareDate) {
|
|
683
|
+
if (this.isUTCMode) {
|
|
684
|
+
return (date.getUTCFullYear() < compareDate.getUTCFullYear() ||
|
|
685
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
686
|
+
date.getUTCMonth() < compareDate.getUTCMonth()) ||
|
|
687
|
+
(date.getUTCFullYear() === compareDate.getUTCFullYear() &&
|
|
688
|
+
date.getUTCMonth() === compareDate.getUTCMonth() &&
|
|
689
|
+
date.getUTCDate() <= compareDate.getUTCDate()));
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
return (date.getFullYear() < compareDate.getFullYear() ||
|
|
693
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
694
|
+
date.getMonth() < compareDate.getMonth()) ||
|
|
695
|
+
(date.getFullYear() === compareDate.getFullYear() &&
|
|
696
|
+
date.getMonth() === compareDate.getMonth() &&
|
|
697
|
+
date.getDate() <= compareDate.getDate()));
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Applies a shortcut selection
|
|
702
|
+
* @param {Object} shortcut - Shortcut to apply
|
|
703
|
+
* @param {string | Date} shortcut.singleValue - Selected date value
|
|
704
|
+
* @param {Object} shortcut.rangeValue - Start and end date values
|
|
705
|
+
* @param {string | Date} shortcut.rangeValue.start - Start date value
|
|
706
|
+
* @param {string | Date} shortcut.rangeValue.end - End date value
|
|
707
|
+
* @param {string} shortcut.label - Label
|
|
708
|
+
*/
|
|
709
|
+
applyShortcut(shortcut) {
|
|
710
|
+
this.selectedDate = null;
|
|
711
|
+
this.startDate = null;
|
|
712
|
+
this.endDate = null;
|
|
713
|
+
if (shortcut.singleValue) {
|
|
714
|
+
const newDate = this.parseDate(shortcut.singleValue);
|
|
715
|
+
this.selectedDate = newDate;
|
|
716
|
+
this.singleDateChange.emit(this.formatDate(newDate));
|
|
717
|
+
this.singleValue = this.formatDate(newDate);
|
|
718
|
+
this.forceCalendarUpdate(newDate);
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
const start = this.parseDate(shortcut.rangeValue.start);
|
|
722
|
+
const end = this.parseDate(shortcut.rangeValue.end);
|
|
723
|
+
this.startDate = start;
|
|
724
|
+
this.endDate = end;
|
|
725
|
+
this.rangeDateChange.emit({
|
|
726
|
+
start: this.formatDate(start),
|
|
727
|
+
end: this.formatDate(end),
|
|
728
|
+
});
|
|
729
|
+
this.rangeValue = JSON.stringify({
|
|
730
|
+
start: this.formatDate(start),
|
|
731
|
+
end: this.formatDate(end),
|
|
732
|
+
});
|
|
733
|
+
this.forceCalendarUpdate(end);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Method to force the complete calendar update (and fix the persistent hover problem)
|
|
738
|
+
* @param {Date} newDate - Date to force
|
|
739
|
+
*/
|
|
740
|
+
forceCalendarUpdate(newDate) {
|
|
741
|
+
this.currentDate = new Date(newDate);
|
|
742
|
+
this.currentDate = new Date(this.currentDate); // Force a re-render
|
|
743
|
+
// Reset visually the hover/touch effect
|
|
744
|
+
requestAnimationFrame(() => {
|
|
745
|
+
const days = document.querySelectorAll('.day');
|
|
746
|
+
days.forEach(el => {
|
|
747
|
+
el.classList.remove('hover', 'active', 'touched');
|
|
748
|
+
el.style.pointerEvents = 'none';
|
|
749
|
+
});
|
|
750
|
+
// Add specific touch handling (for mobile)
|
|
751
|
+
document.body.addEventListener('touchstart', this.clearTouchState, {
|
|
752
|
+
passive: true,
|
|
753
|
+
});
|
|
754
|
+
// Reset the touch state after 50ms
|
|
755
|
+
setTimeout(() => {
|
|
756
|
+
days.forEach(el => {
|
|
757
|
+
el.style.pointerEvents = '';
|
|
758
|
+
});
|
|
759
|
+
}, 50);
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Function to reset the touch effect (Mobile fix)
|
|
764
|
+
*/
|
|
765
|
+
clearTouchState() {
|
|
766
|
+
document.querySelectorAll('.day').forEach(el => {
|
|
767
|
+
el.classList.remove('touched');
|
|
768
|
+
});
|
|
769
|
+
// Remove the listener after the first interaction
|
|
770
|
+
document.body.removeEventListener('touchstart', this.clearTouchState);
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Handles month change with an offset
|
|
774
|
+
* @param {number} direction - Direction (-1 for previous, 1 for next)
|
|
775
|
+
* @param {number} offset - Month offset (0 by default)
|
|
776
|
+
* @returns {Function} Change month handler
|
|
777
|
+
*/
|
|
778
|
+
getChangeMonthHandler(direction, offset) {
|
|
779
|
+
return () => this.changeMonth(direction, offset);
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Handles month change from an event (ex: dropdown)
|
|
783
|
+
* @param {number} offset - Month offset (0 by default)
|
|
784
|
+
* @returns {Function} Change month handler
|
|
785
|
+
*/
|
|
786
|
+
getHandleMonthChange(offset) {
|
|
787
|
+
return (event) => this.handleMonthChange(event, offset);
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Handles year change from an event (ex: dropdown)
|
|
791
|
+
* @param {number} offset - Year offset (0 by default)
|
|
792
|
+
* @returns {Function} Change year handler
|
|
793
|
+
*/
|
|
794
|
+
getHandleYearChange(offset) {
|
|
795
|
+
return (event) => this.handleYearChange(event, offset);
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Handles day click
|
|
799
|
+
* @param {Date} date - Date to handle
|
|
800
|
+
* @param {boolean} isDisabled - Whether the date is disabled
|
|
801
|
+
* @returns {Function} Day click handler
|
|
802
|
+
*/
|
|
803
|
+
getDayClickHandler(date, isDisabled) {
|
|
804
|
+
return isDisabled ? undefined : () => this.handleDateSelection(date);
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Handles shortcut selection
|
|
808
|
+
* @param {Object} shortcut - Shortcut to handle
|
|
809
|
+
* @param {string | Date} shortcut.singleValue - Selected date value
|
|
810
|
+
* @param {Object} shortcut.rangeValue - Start and end date values
|
|
811
|
+
* @param {string | Date} shortcut.rangeValue.start - Start date value
|
|
812
|
+
* @param {string | Date} shortcut.rangeValue.end - End date value
|
|
813
|
+
* @param {string} shortcut.label - Label
|
|
814
|
+
* @returns {Function} Shortcut selection handler
|
|
815
|
+
*/
|
|
816
|
+
getShortcutHandler(shortcut) {
|
|
817
|
+
return () => this.applyShortcut(shortcut);
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Handles week selection
|
|
821
|
+
* @param {Date[]} dates - Dates to handle
|
|
822
|
+
* @param {number} index - Calendar index
|
|
823
|
+
* @returns {Function} Week selection handler
|
|
824
|
+
*/
|
|
825
|
+
getWeekSelectionHandler(dates, index) {
|
|
826
|
+
return () => {
|
|
827
|
+
if (this.selectionType === 'range') {
|
|
828
|
+
this.handleWeekSelection(dates, index);
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
parsedShortcuts() {
|
|
833
|
+
try {
|
|
834
|
+
return this.shortcuts ? JSON.parse(this.shortcuts) : [];
|
|
835
|
+
}
|
|
836
|
+
catch (error) {
|
|
837
|
+
console.error('Invalid JSON for shortcuts:', error);
|
|
838
|
+
return [];
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Checks if the date format is in UTC mode
|
|
843
|
+
* @returns {boolean} true if the date format is in UTC mode
|
|
844
|
+
*/
|
|
845
|
+
get isUTCMode() {
|
|
846
|
+
return this.dateFormat.includes('Z');
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Checks if shortcuts are visible
|
|
850
|
+
* @returns {boolean} true if shortcuts are visible
|
|
851
|
+
*/
|
|
852
|
+
get hasShortcuts() {
|
|
853
|
+
return (this.shortcutsPlacement === 'bottom' && this.parsedShortcuts().length > 0);
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Checks if actions are visible
|
|
857
|
+
* @returns {boolean} true if actions are visible
|
|
858
|
+
*/
|
|
859
|
+
get hasActions() {
|
|
860
|
+
return this.showActions;
|
|
861
|
+
}
|
|
862
|
+
//#endregion METHODS
|
|
863
|
+
/****************************************************************************/
|
|
864
|
+
//#region RENDER
|
|
865
|
+
/**
|
|
866
|
+
* Renders the header
|
|
867
|
+
* @param {number} offset - Month offset
|
|
868
|
+
* @param {number} index - Calendar index
|
|
869
|
+
* @returns {JSX.Element} Header
|
|
870
|
+
* @description Renders the header of the calendar
|
|
871
|
+
*/
|
|
872
|
+
renderHeader(offset, index) {
|
|
873
|
+
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() +
|
|
874
|
+
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" }))));
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Renders the week numbers
|
|
878
|
+
* @param {Array<{date: Date}>} weeks - Weeks to render
|
|
879
|
+
* @param {number} index - Calendar index
|
|
880
|
+
* @returns {JSX.Element} Week numbers
|
|
881
|
+
* @description Renders the week numbers of the calendar
|
|
882
|
+
*/
|
|
883
|
+
renderWeekNumbers(
|
|
884
|
+
/** Weeks to render */
|
|
885
|
+
weeks,
|
|
886
|
+
/** Calendar index */
|
|
887
|
+
index) {
|
|
888
|
+
return (h("div", { class: "week-numbers" }, h("div", { class: "week-header" }, this.getLocalizedWeekText()), weeks.map((week, weekIndex) => {
|
|
889
|
+
var _a;
|
|
890
|
+
const dates = week.map(d => d.date);
|
|
891
|
+
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())));
|
|
892
|
+
})));
|
|
893
|
+
}
|
|
894
|
+
renderDaysGrid(
|
|
895
|
+
/** Days to render */
|
|
896
|
+
days) {
|
|
897
|
+
return (h("div", { class: "days-grid" }, days.map(day => {
|
|
898
|
+
const date = day.date;
|
|
899
|
+
if (!date)
|
|
900
|
+
return null;
|
|
901
|
+
const isSelected = this.selectionType === 'single' &&
|
|
902
|
+
this.isSameDate(date, this.selectedDate);
|
|
903
|
+
const isInRange = this.isDateInRange(date);
|
|
904
|
+
const isStart = this.isSameDate(date, this.startDate);
|
|
905
|
+
const isEnd = this.isSameDate(date, this.endDate);
|
|
906
|
+
const isToday = this.isToday(date);
|
|
907
|
+
const isOutsideMonth = !day.isCurrentMonth;
|
|
908
|
+
const dayClasses = [
|
|
909
|
+
'day',
|
|
910
|
+
isSelected ? 'selected' : '',
|
|
911
|
+
isStart ? 'range-start' : '',
|
|
912
|
+
isEnd ? 'range-end' : '',
|
|
913
|
+
isInRange ? 'in-range' : '',
|
|
914
|
+
day.isDisabled ? 'disabled' : '',
|
|
915
|
+
isOutsideMonth ? 'outside-month' : '',
|
|
916
|
+
isToday ? 'is-today' : '',
|
|
917
|
+
];
|
|
918
|
+
return (h("div", { class: dayClasses.filter(Boolean).join(' '), onClick: this.getDayClickHandler(date, day.isDisabled), "aria-disabled": day.isDisabled, key: `day-${date.toISOString()}` }, day.dayOfMonth));
|
|
919
|
+
})));
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* Renders the calendar
|
|
923
|
+
* @param {number} index - Calendar index
|
|
924
|
+
* @param {number} offset - Month offset
|
|
925
|
+
* @returns {JSX.Element} Calendar
|
|
926
|
+
* @description Renders the calendar of the calendar
|
|
927
|
+
*/
|
|
928
|
+
renderCalendar(
|
|
929
|
+
/** Calendar index */
|
|
930
|
+
index,
|
|
931
|
+
/** Month offset */
|
|
932
|
+
offset) {
|
|
933
|
+
const days = this.getDaysInMonth(offset, this.numberOfCalendars);
|
|
934
|
+
const weeks = [];
|
|
935
|
+
for (let i = 0; i < days.length; i += 7) {
|
|
936
|
+
weeks.push(days.slice(i, i + 7));
|
|
937
|
+
}
|
|
938
|
+
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" }))));
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Renders the shortcuts
|
|
942
|
+
* @returns {JSX.Element} Shortcuts
|
|
943
|
+
* @description Renders the shortcuts of the calendar
|
|
944
|
+
*/
|
|
945
|
+
renderShortcuts() {
|
|
946
|
+
if (!this.parsedShortcuts().length) {
|
|
947
|
+
return null;
|
|
948
|
+
}
|
|
949
|
+
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)))));
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Renders the actions
|
|
953
|
+
* @returns {JSX.Element} Actions
|
|
954
|
+
* @description Renders the actions of the calendar
|
|
955
|
+
* @slot actions - Child content of the component.
|
|
956
|
+
*/
|
|
957
|
+
renderActions() {
|
|
958
|
+
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"))));
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Renders the datepicker
|
|
962
|
+
* @returns {JSX.Element} Datepicker
|
|
963
|
+
* @description Renders the datepicker of the calendar
|
|
964
|
+
* @slot default - Child content of the component.
|
|
965
|
+
*/
|
|
966
|
+
render() {
|
|
967
|
+
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' })));
|
|
968
|
+
}
|
|
969
|
+
get el() { return getElement(this); }
|
|
970
|
+
static get watchers() { return {
|
|
971
|
+
"numberOfCalendars": ["validateNumberOfCalendars"],
|
|
972
|
+
"rangeValue": ["onRangeValueChange"],
|
|
973
|
+
"disabledDates": ["handleDisabledDatesChange"]
|
|
974
|
+
}; }
|
|
975
|
+
};
|
|
976
|
+
NvCalendar.style = NvCalendarStyle0;
|
|
977
|
+
|
|
978
|
+
export { NvCalendar as nv_calendar };
|
|
979
|
+
|
|
980
|
+
//# sourceMappingURL=nv-calendar.entry.js.map
|