genesys-spark-components 3.28.0 → 3.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/genesys-webcomponents.cjs.js +1 -1
- package/dist/cjs/gux-accordion-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-accordion.cjs.entry.js +1 -1
- package/dist/cjs/gux-action-button-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-action-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-action-list-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-action-toast.cjs.entry.js +1 -1
- package/dist/cjs/gux-advanced-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/gux-announce-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-badge-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-blank-state-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/gux-button-multi-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-button-multi.cjs.entry.js +1 -1
- package/dist/cjs/gux-button-slot-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-calendar.cjs.entry.js +1 -1
- package/dist/cjs/gux-card-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-column-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-line-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-command-palette-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-content-search.cjs.entry.js +1 -1
- package/dist/cjs/gux-copy-to-clipboard-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-date-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-date-time-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-datepicker.cjs.entry.js +69 -57
- package/dist/cjs/gux-disclosure-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-dismiss-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-dropdown-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-dropdown-multi-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-dropdown_3.cjs.entry.js +1 -1
- package/dist/cjs/gux-error-message-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-flyout-menu-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-color.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-input-clear-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-number.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-radio.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-range.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-search.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-select.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-text-like.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-textarea.cjs.entry.js +1 -1
- package/dist/cjs/gux-icon.cjs.entry.js +1 -1
- package/dist/cjs/gux-list-item-legacy_2.cjs.entry.js +1 -1
- package/dist/cjs/gux-list.cjs.entry.js +8 -51
- package/dist/cjs/gux-list.service-59f2b3e7.js +51 -0
- package/dist/cjs/gux-listbox-multi.cjs.entry.js +1 -1
- package/dist/cjs/gux-loading-message-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-modal.cjs.entry.js +1 -1
- package/dist/cjs/gux-month-calendar.cjs.entry.js +137 -0
- package/dist/cjs/gux-month-list_2.cjs.entry.js +89 -0
- package/dist/cjs/gux-month-picker-beta.cjs.entry.js +222 -0
- package/dist/cjs/gux-notification-toast.cjs.entry.js +1 -1
- package/dist/cjs/gux-page-loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/gux-pagination-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-pagination-cursor.cjs.entry.js +1 -1
- package/dist/cjs/gux-pagination.cjs.entry.js +1 -1
- package/dist/cjs/gux-panel-frame-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-popover-list.cjs.entry.js +1 -1
- package/dist/cjs/gux-popover.cjs.entry.js +1 -1
- package/dist/cjs/gux-radial-loading.cjs.entry.js +1 -1
- package/dist/cjs/gux-radial-progress.cjs.entry.js +1 -1
- package/dist/cjs/gux-rating.cjs.entry.js +1 -1
- package/dist/cjs/gux-side-panel-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-simple-toast.cjs.entry.js +1 -1
- package/dist/cjs/gux-skip-navigation-list-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-sort-control.cjs.entry.js +1 -1
- package/dist/cjs/gux-switch.cjs.entry.js +1 -1
- package/dist/cjs/gux-table-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-tabs-advanced.cjs.entry.js +1 -1
- package/dist/cjs/gux-tabs-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-tabs.cjs.entry.js +1 -1
- package/dist/cjs/gux-tag-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-text-highlight.cjs.entry.js +1 -1
- package/dist/cjs/gux-text-label-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-time-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-time-picker-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-toggle.cjs.entry.js +1 -1
- package/dist/cjs/gux-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/gux-visualization-beta.cjs.entry.js +1 -1
- package/dist/cjs/index-262c2e3a.js +16 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{usage-tracking-8a0a56ad.js → usage-tracking-a1b34de9.js} +1 -1
- package/dist/cjs/year-month-values-080373aa.js +24 -0
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-calendar.css +78 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-calendar.js +237 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-list/gux-month-list-item/gux-month-list-item.css +52 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-list/gux-month-list-item/gux-month-list-item.js +110 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-list/gux-month-list.css +8 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-list/gux-month-list.js +80 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-picker.css +58 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-picker.js +313 -0
- package/dist/collection/components/stable/gux-datepicker/gux-datepicker.css +5 -0
- package/dist/collection/components/stable/gux-datepicker/gux-datepicker.js +70 -76
- package/dist/collection/components/stable/gux-list/gux-list.js +6 -5
- package/dist/collection/components/stable/gux-list/gux-list.service.js +19 -20
- package/dist/collection/utils/date/year-month-values.js +13 -0
- package/dist/collection/utils/dom/after-render.js +3 -0
- package/dist/deploy-info.json +3 -3
- package/dist/esm/genesys-webcomponents.js +1 -1
- package/dist/esm/gux-accordion-legacy.entry.js +1 -1
- package/dist/esm/gux-accordion.entry.js +1 -1
- package/dist/esm/gux-action-button-legacy.entry.js +1 -1
- package/dist/esm/gux-action-button.entry.js +1 -1
- package/dist/esm/gux-action-list-legacy.entry.js +1 -1
- package/dist/esm/gux-action-toast.entry.js +1 -1
- package/dist/esm/gux-advanced-dropdown.entry.js +1 -1
- package/dist/esm/gux-announce-beta.entry.js +1 -1
- package/dist/esm/gux-badge-beta.entry.js +1 -1
- package/dist/esm/gux-blank-state-beta.entry.js +1 -1
- package/dist/esm/gux-breadcrumbs.entry.js +1 -1
- package/dist/esm/gux-button-multi-legacy.entry.js +1 -1
- package/dist/esm/gux-button-multi.entry.js +1 -1
- package/dist/esm/gux-button-slot-beta.entry.js +1 -1
- package/dist/esm/gux-button.entry.js +1 -1
- package/dist/esm/gux-calendar.entry.js +1 -1
- package/dist/esm/gux-card-beta.entry.js +1 -1
- package/dist/esm/gux-chart-column-beta.entry.js +1 -1
- package/dist/esm/gux-chart-donut-beta.entry.js +1 -1
- package/dist/esm/gux-chart-line-beta.entry.js +1 -1
- package/dist/esm/gux-chart-pie-beta.entry.js +1 -1
- package/dist/esm/gux-chart-scatter-plot-beta.entry.js +1 -1
- package/dist/esm/gux-command-palette-legacy.entry.js +1 -1
- package/dist/esm/gux-content-search.entry.js +1 -1
- package/dist/esm/gux-copy-to-clipboard-beta.entry.js +1 -1
- package/dist/esm/gux-date-beta.entry.js +1 -1
- package/dist/esm/gux-date-time-beta.entry.js +1 -1
- package/dist/esm/gux-datepicker.entry.js +69 -57
- package/dist/esm/gux-disclosure-button.entry.js +1 -1
- package/dist/esm/gux-dismiss-button.entry.js +1 -1
- package/dist/esm/gux-dropdown-legacy.entry.js +1 -1
- package/dist/esm/gux-dropdown-multi-beta.entry.js +1 -1
- package/dist/esm/gux-dropdown_3.entry.js +1 -1
- package/dist/esm/gux-error-message-beta.entry.js +1 -1
- package/dist/esm/gux-flyout-menu-beta.entry.js +1 -1
- package/dist/esm/gux-form-field-checkbox.entry.js +1 -1
- package/dist/esm/gux-form-field-color.entry.js +1 -1
- package/dist/esm/gux-form-field-dropdown.entry.js +1 -1
- package/dist/esm/gux-form-field-input-clear-button.entry.js +1 -1
- package/dist/esm/gux-form-field-legacy.entry.js +1 -1
- package/dist/esm/gux-form-field-number.entry.js +1 -1
- package/dist/esm/gux-form-field-radio.entry.js +1 -1
- package/dist/esm/gux-form-field-range.entry.js +1 -1
- package/dist/esm/gux-form-field-search.entry.js +1 -1
- package/dist/esm/gux-form-field-select.entry.js +1 -1
- package/dist/esm/gux-form-field-text-like.entry.js +1 -1
- package/dist/esm/gux-form-field-textarea.entry.js +1 -1
- package/dist/esm/gux-icon.entry.js +1 -1
- package/dist/esm/gux-list-item-legacy_2.entry.js +1 -1
- package/dist/esm/gux-list.entry.js +8 -51
- package/dist/esm/gux-list.service-66b8540f.js +45 -0
- package/dist/esm/gux-listbox-multi.entry.js +1 -1
- package/dist/esm/gux-loading-message-beta.entry.js +1 -1
- package/dist/esm/gux-modal.entry.js +1 -1
- package/dist/esm/gux-month-calendar.entry.js +133 -0
- package/dist/esm/gux-month-list_2.entry.js +84 -0
- package/dist/esm/gux-month-picker-beta.entry.js +218 -0
- package/dist/esm/gux-notification-toast.entry.js +1 -1
- package/dist/esm/gux-page-loading-spinner.entry.js +1 -1
- package/dist/esm/gux-pagination-beta.entry.js +1 -1
- package/dist/esm/gux-pagination-cursor.entry.js +1 -1
- package/dist/esm/gux-pagination.entry.js +1 -1
- package/dist/esm/gux-panel-frame-legacy.entry.js +1 -1
- package/dist/esm/gux-popover-list.entry.js +1 -1
- package/dist/esm/gux-popover.entry.js +1 -1
- package/dist/esm/gux-radial-loading.entry.js +1 -1
- package/dist/esm/gux-radial-progress.entry.js +1 -1
- package/dist/esm/gux-rating.entry.js +1 -1
- package/dist/esm/gux-side-panel-legacy.entry.js +1 -1
- package/dist/esm/gux-simple-toast.entry.js +1 -1
- package/dist/esm/gux-skip-navigation-list-beta.entry.js +1 -1
- package/dist/esm/gux-sort-control.entry.js +1 -1
- package/dist/esm/gux-switch.entry.js +1 -1
- package/dist/esm/gux-table-beta.entry.js +1 -1
- package/dist/esm/gux-tabs-advanced.entry.js +1 -1
- package/dist/esm/gux-tabs-legacy.entry.js +1 -1
- package/dist/esm/gux-tabs.entry.js +1 -1
- package/dist/esm/gux-tag-beta.entry.js +1 -1
- package/dist/esm/gux-text-highlight.entry.js +1 -1
- package/dist/esm/gux-text-label-legacy.entry.js +1 -1
- package/dist/esm/gux-time-beta.entry.js +1 -1
- package/dist/esm/gux-time-picker-beta.entry.js +1 -1
- package/dist/esm/gux-toggle.entry.js +1 -1
- package/dist/esm/gux-tooltip.entry.js +1 -1
- package/dist/esm/gux-visualization-beta.entry.js +1 -1
- package/dist/esm/index-74e605ae.js +16 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{usage-tracking-3d95bf43.js → usage-tracking-3a58b2cb.js} +1 -1
- package/dist/esm/year-month-values-8f78277c.js +19 -0
- package/dist/genesys-webcomponents/genesys-webcomponents.esm.js +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.ar.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.cs.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.da.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.de.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.en.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.es-es.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.es.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.fi.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.fr-ca.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.fr.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.he.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.it.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.ja.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.ko.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.nl.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.no.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.pl.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.pt-br.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.pt-pt.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.ru.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.sv.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.th.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.tr.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.zh-cn.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.zh-tw.json +1 -1
- package/dist/genesys-webcomponents/{p-c2f5b66a.entry.js → p-0309337a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-822f8307.entry.js → p-05d8867d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0e0fa72e.entry.js → p-097ebac8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-34781a4f.entry.js → p-0ac85f85.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8f9f2533.entry.js → p-0f3b197c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-6c1bcb81.entry.js → p-1193eea0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0ff9b746.entry.js → p-14252d82.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-810975bf.entry.js → p-147f5ce5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-837ea1c7.entry.js → p-155a7a20.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-62bcdee5.entry.js → p-1665f72d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1046fc7a.entry.js → p-1717f300.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d2146baf.entry.js → p-186ab617.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a058d86c.entry.js → p-1bab4f2d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-07ce561d.entry.js → p-22c9f5fc.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-25ea189a.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-1ab4904a.entry.js → p-26fd3d6f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3bc907d4.entry.js → p-3110951a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d2a740bf.entry.js → p-321ef965.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-3834e291.js +1 -0
- package/dist/genesys-webcomponents/{p-18ef9c4e.entry.js → p-41627e97.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8fdf5e4f.entry.js → p-43d4998c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8da6820a.entry.js → p-45b2e9ab.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-48ba3e1f.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-a8fe0379.entry.js → p-4a276707.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-60e959f5.entry.js → p-4aed9d1d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bc20e015.entry.js → p-4d0dfe2f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-993b8f68.entry.js → p-4d0fab65.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-74e58da4.entry.js → p-4f514bc3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-cb525f80.entry.js → p-50c1f2be.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-10b92544.entry.js → p-52c0ef2c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b94f03eb.entry.js → p-5563cdd3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3990f966.entry.js → p-5669156b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9466559c.entry.js → p-598a1c4b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-076be569.entry.js → p-5aab9b69.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2e7e448e.entry.js → p-5bd6e8e7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-15351905.entry.js → p-6029a142.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d7a43fbb.entry.js → p-669a61ca.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-70e587ff.entry.js → p-6bf45984.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3d0d3a6e.entry.js → p-6e435cd2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-56a38cf7.entry.js → p-6f42eb51.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-604af472.entry.js → p-6f4bd858.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7c1c3ea0.entry.js → p-714f65a0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f94f4dd9.entry.js → p-71ea36d7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-522c74ec.entry.js → p-74ee2e23.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ce593131.entry.js → p-76ea901a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1ba094ac.entry.js → p-7789513a.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-79a47484.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-ca461392.entry.js → p-7effb09b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ebff89b2.entry.js → p-8009fdc9.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-813cb992.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-f8c4e528.entry.js → p-83cc0e17.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e48d3310.entry.js → p-8b1a96cc.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-8d32b63a.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-49c15d86.entry.js → p-8da54237.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2d26c660.entry.js → p-8e106004.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2117da6e.js → p-967a5d2e.js} +1 -1
- package/dist/genesys-webcomponents/{p-2eec7bb3.entry.js → p-99898e32.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-86613e69.entry.js → p-9b2607c2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d85e0ef6.entry.js → p-a6466fec.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f338c957.entry.js → p-b0b469b7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bc813cdd.entry.js → p-b1a0e8f9.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a6b2b359.entry.js → p-b3fc31d2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b08472d5.entry.js → p-b5ff9be4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-30a2191b.entry.js → p-b6db9f14.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a512fad8.entry.js → p-b72ece98.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-6b418d99.entry.js → p-bd5c79d9.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-80b9fb4f.entry.js → p-c136bc23.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7e018abd.entry.js → p-c5ab5608.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ec64efaf.entry.js → p-cb53f5b2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-81e83db1.entry.js → p-cbad82d5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fe117b7f.entry.js → p-ccb85246.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-db4ad4a2.entry.js → p-cfc03ea4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5d8f6b2d.entry.js → p-d0d09c10.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bc6633ac.entry.js → p-d695f246.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5154e024.entry.js → p-de6ad54f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-64788936.entry.js → p-df4c45b5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3d517313.entry.js → p-e6eba280.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ed9247cf.entry.js → p-e84f7077.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-ea91ae27.js +1 -0
- package/dist/genesys-webcomponents/{p-797be44d.entry.js → p-eab68d2f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3da8813c.entry.js → p-eb9310a8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8facd0ec.entry.js → p-ee80c3b5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-31540340.entry.js → p-f0b4112d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5c64137d.entry.js → p-f4450927.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-97afe8f5.entry.js → p-f858d163.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-24b58841.entry.js → p-fb9ae052.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b5876605.entry.js → p-ffe85168.entry.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/components/beta/gux-month-picker/gux-month-calendar/gux-month-calendar.d.ts +45 -0
- package/dist/types/components/beta/gux-month-picker/gux-month-calendar/gux-month-list/gux-month-list-item/gux-month-list-item.d.ts +12 -0
- package/dist/types/components/beta/gux-month-picker/gux-month-calendar/gux-month-list/gux-month-list.d.ts +8 -0
- package/dist/types/components/beta/gux-month-picker/gux-month-picker.d.ts +49 -0
- package/dist/types/components/stable/gux-datepicker/gux-datepicker.d.ts +19 -9
- package/dist/types/components/stable/gux-list/gux-list.service.d.ts +5 -4
- package/dist/types/components.d.ts +116 -2
- package/dist/types/utils/date/year-month-values.d.ts +8 -0
- package/dist/types/utils/dom/after-render.d.ts +1 -0
- package/package.json +1 -1
- package/dist/genesys-webcomponents/p-559635b7.entry.js +0 -1
- package/dist/genesys-webcomponents/p-99374ffa.entry.js +0 -1
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
8
|
+
import { Component, Element, h, Listen, Prop, State, Watch } from '@stencil/core';
|
|
9
|
+
import { trackComponent } from '../../../usage-tracking';
|
|
10
|
+
import { OnClickOutside } from '../../../utils/decorator/on-click-outside';
|
|
11
|
+
import { buildI18nForComponent, getDesiredLocale } from '../../../i18n';
|
|
12
|
+
import simulateNativeEvent from '../../../utils/dom/simulate-native-event';
|
|
13
|
+
import { afterRender } from '../../../utils/dom/after-render';
|
|
14
|
+
import { getCurrentISOYearMonth, getISOYearMonth, getYearMonthObject } from '../../../utils/date/year-month-values';
|
|
15
|
+
import translationResources from './i18n/en.json';
|
|
16
|
+
const DateTimeFormats = { year: 'numeric', month: 'long' };
|
|
17
|
+
const YearFirstLocales = ['ar', 'he', 'ja', 'ko', 'zh-cn', 'zh-tw'];
|
|
18
|
+
export class GuxMonthPicker {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.disabled = false;
|
|
21
|
+
this.expanded = false;
|
|
22
|
+
}
|
|
23
|
+
onKeyDown(event) {
|
|
24
|
+
switch (event.key) {
|
|
25
|
+
case 'Escape':
|
|
26
|
+
this.expanded = false;
|
|
27
|
+
this.calendarToggleButtonElement.focus();
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
onValueUpdate(newValue) {
|
|
32
|
+
if (this.isOutOfBounds(newValue)) {
|
|
33
|
+
if (this.isBeforeMin(newValue)) {
|
|
34
|
+
this.value = this.min;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.value = this.max;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.value = newValue;
|
|
42
|
+
}
|
|
43
|
+
simulateNativeEvent(this.root, 'input');
|
|
44
|
+
simulateNativeEvent(this.root, 'change');
|
|
45
|
+
}
|
|
46
|
+
onClickOutside() {
|
|
47
|
+
this.expanded = false;
|
|
48
|
+
}
|
|
49
|
+
async componentWillLoad() {
|
|
50
|
+
trackComponent(this.root);
|
|
51
|
+
this.i18n = await buildI18nForComponent(this.root, translationResources);
|
|
52
|
+
this.locale = getDesiredLocale(this.root);
|
|
53
|
+
}
|
|
54
|
+
isOutOfBounds(value) {
|
|
55
|
+
return this.isBeforeMin(value) || this.isAfterMax(value);
|
|
56
|
+
}
|
|
57
|
+
isBeforeMin(value) {
|
|
58
|
+
return this.min && this.min > value;
|
|
59
|
+
}
|
|
60
|
+
isAfterMax(value) {
|
|
61
|
+
return this.max && this.max < value;
|
|
62
|
+
}
|
|
63
|
+
toggleCalendar() {
|
|
64
|
+
this.expanded = !this.expanded;
|
|
65
|
+
if (this.expanded) {
|
|
66
|
+
afterRender(() => {
|
|
67
|
+
void this.monthCalendarElement.guxFocus(this.value);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
onMonthCalendarInput() {
|
|
72
|
+
this.value = this.monthCalendarElement.value;
|
|
73
|
+
this.expanded = false;
|
|
74
|
+
this.calendarToggleButtonElement.focus();
|
|
75
|
+
}
|
|
76
|
+
incrementMonth(delta) {
|
|
77
|
+
if (this.value) {
|
|
78
|
+
const { year: currentYear, month: currentMonth } = getYearMonthObject(this.value);
|
|
79
|
+
const newMonth = (((parseInt(currentMonth) + 11 + delta) % 12) + 1)
|
|
80
|
+
.toString()
|
|
81
|
+
.padStart(2, '0');
|
|
82
|
+
this.value = getISOYearMonth(currentYear, newMonth);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.value = getCurrentISOYearMonth();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
incrementYear(delta) {
|
|
89
|
+
if (this.value) {
|
|
90
|
+
const { year: currentYear, month: currentMonth } = getYearMonthObject(this.value);
|
|
91
|
+
const newYear = Math.max(Number(currentYear) + delta, 0).toString();
|
|
92
|
+
this.value = getISOYearMonth(newYear, currentMonth);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.value = getCurrentISOYearMonth();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
onSpinnerKeyDown(event, incrementor, nextFocusElement) {
|
|
99
|
+
switch (event.key) {
|
|
100
|
+
case 'ArrowDown':
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
incrementor(-1);
|
|
103
|
+
break;
|
|
104
|
+
case 'ArrowUp':
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
incrementor(1);
|
|
107
|
+
break;
|
|
108
|
+
case 'ArrowLeft':
|
|
109
|
+
case 'ArrowRight':
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
nextFocusElement.focus();
|
|
112
|
+
break;
|
|
113
|
+
case 'Enter':
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
this.expanded = true;
|
|
116
|
+
afterRender(() => {
|
|
117
|
+
void this.monthCalendarElement.guxFocus(this.value);
|
|
118
|
+
});
|
|
119
|
+
break;
|
|
120
|
+
case ' ':
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
onSpinnerKeyUp(event) {
|
|
126
|
+
event.stopPropagation();
|
|
127
|
+
switch (event.key) {
|
|
128
|
+
case ' ':
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
this.expanded = true;
|
|
131
|
+
afterRender(() => {
|
|
132
|
+
void this.monthCalendarElement.guxFocus(this.value);
|
|
133
|
+
});
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
onSpinnerClick() {
|
|
138
|
+
console.log('onSpinnerClick');
|
|
139
|
+
this.expanded = true;
|
|
140
|
+
}
|
|
141
|
+
getSpinnerLabel(period) {
|
|
142
|
+
if (this.value) {
|
|
143
|
+
const { year, month } = getYearMonthObject(this.value);
|
|
144
|
+
return new Date(Number(year), Number(month) - 1).toLocaleDateString(this.locale, { [period]: DateTimeFormats[period] });
|
|
145
|
+
}
|
|
146
|
+
return this.i18n(period);
|
|
147
|
+
}
|
|
148
|
+
getSpinnerValueNow(period) {
|
|
149
|
+
return this.value ? getYearMonthObject(this.value)[period] : '0';
|
|
150
|
+
}
|
|
151
|
+
getSpinnerValueText() {
|
|
152
|
+
if (this.value) {
|
|
153
|
+
const { year, month } = getYearMonthObject(this.value);
|
|
154
|
+
return new Date(Number(year), Number(month) - 1).toLocaleDateString(this.locale, { year: 'numeric', month: 'long' });
|
|
155
|
+
}
|
|
156
|
+
return this.i18n('unset');
|
|
157
|
+
}
|
|
158
|
+
renderMonthSpinnerButton() {
|
|
159
|
+
return (h("div", { role: "spinbutton", class: {
|
|
160
|
+
'gux-spinner': true,
|
|
161
|
+
'gux-empty': Boolean(!this.value)
|
|
162
|
+
}, tabIndex: this.disabled ? -1 : 0, onKeyDown: (e) => this.onSpinnerKeyDown(e, d => this.incrementMonth(d), this.yearSpinnerElement), onKeyUp: (e) => this.onSpinnerKeyUp(e), onClick: () => this.onSpinnerClick(), ref: (el) => (this.monthSpinnerElement = el), "aria-valuenow": this.getSpinnerValueNow('month'), "aria-valuetext": this.getSpinnerValueText(), "aria-valuemin": "1", "aria-valuemax": "12", "aria-label": this.i18n('month') }, this.getSpinnerLabel('month')));
|
|
163
|
+
}
|
|
164
|
+
renderYearSpinnerButton() {
|
|
165
|
+
return (h("div", { role: "spinbutton", class: {
|
|
166
|
+
'gux-spinner': true,
|
|
167
|
+
'gux-empty': Boolean(!this.value)
|
|
168
|
+
}, tabIndex: this.disabled ? -1 : 0, onKeyDown: (e) => this.onSpinnerKeyDown(e, d => this.incrementYear(d), this.monthSpinnerElement), onKeyUp: (e) => this.onSpinnerKeyUp(e), onClick: () => this.onSpinnerClick(), ref: (el) => (this.yearSpinnerElement = el), "aria-valuenow": this.getSpinnerValueNow('year'), "aria-valuetext": this.getSpinnerValueText(), "aria-valuemin": "0", "aria-label": this.i18n('year') }, this.getSpinnerLabel('year')));
|
|
169
|
+
}
|
|
170
|
+
renderSpinnerButtons() {
|
|
171
|
+
if (YearFirstLocales.includes(this.locale)) {
|
|
172
|
+
return (h("span", { class: "gux-display" },
|
|
173
|
+
this.renderYearSpinnerButton(),
|
|
174
|
+
this.renderMonthSpinnerButton()));
|
|
175
|
+
}
|
|
176
|
+
return (h("span", { class: "gux-display" },
|
|
177
|
+
this.renderMonthSpinnerButton(),
|
|
178
|
+
this.renderYearSpinnerButton()));
|
|
179
|
+
}
|
|
180
|
+
renderCalendarToggleButton() {
|
|
181
|
+
return (h("button", { class: {
|
|
182
|
+
'gux-popup-toggle': true,
|
|
183
|
+
'gux-expanded': this.expanded
|
|
184
|
+
}, ref: (el) => (this.calendarToggleButtonElement = el), type: "button", onClick: () => this.toggleCalendar(), disabled: this.disabled },
|
|
185
|
+
h("gux-icon", { "icon-name": "calendar", "screenreader-text": this.i18n('toggleCalendar') })));
|
|
186
|
+
}
|
|
187
|
+
renderTarget() {
|
|
188
|
+
return (h("div", { class: "gux-target", slot: "target" },
|
|
189
|
+
this.renderSpinnerButtons(),
|
|
190
|
+
this.renderCalendarToggleButton()));
|
|
191
|
+
}
|
|
192
|
+
renderPopup() {
|
|
193
|
+
return (h("gux-month-calendar", { slot: "popup", ref: (el) => (this.monthCalendarElement = el), onInput: () => this.onMonthCalendarInput(), value: this.value, min: this.min, max: this.max }));
|
|
194
|
+
}
|
|
195
|
+
render() {
|
|
196
|
+
return (h("gux-popup", { expanded: this.expanded, disabled: this.disabled },
|
|
197
|
+
this.renderTarget(),
|
|
198
|
+
this.renderPopup()));
|
|
199
|
+
}
|
|
200
|
+
static get is() { return "gux-month-picker-beta"; }
|
|
201
|
+
static get encapsulation() { return "shadow"; }
|
|
202
|
+
static get originalStyleUrls() { return {
|
|
203
|
+
"$": ["gux-month-picker.less"]
|
|
204
|
+
}; }
|
|
205
|
+
static get styleUrls() { return {
|
|
206
|
+
"$": ["gux-month-picker.css"]
|
|
207
|
+
}; }
|
|
208
|
+
static get properties() { return {
|
|
209
|
+
"value": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"mutable": true,
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "GuxISOYearMonth",
|
|
214
|
+
"resolved": "`${string}-${string}`",
|
|
215
|
+
"references": {
|
|
216
|
+
"GuxISOYearMonth": {
|
|
217
|
+
"location": "import",
|
|
218
|
+
"path": "../../../utils/date/year-month-values"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"required": false,
|
|
223
|
+
"optional": false,
|
|
224
|
+
"docs": {
|
|
225
|
+
"tags": [],
|
|
226
|
+
"text": "The current selected year and month in ISO8601 format (yyyy-mm)"
|
|
227
|
+
},
|
|
228
|
+
"attribute": "value",
|
|
229
|
+
"reflect": false
|
|
230
|
+
},
|
|
231
|
+
"min": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"mutable": false,
|
|
234
|
+
"complexType": {
|
|
235
|
+
"original": "GuxISOYearMonth",
|
|
236
|
+
"resolved": "`${string}-${string}`",
|
|
237
|
+
"references": {
|
|
238
|
+
"GuxISOYearMonth": {
|
|
239
|
+
"location": "import",
|
|
240
|
+
"path": "../../../utils/date/year-month-values"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "The min year and month selectable in ISO8601 format (yyyy-mm)"
|
|
249
|
+
},
|
|
250
|
+
"attribute": "min",
|
|
251
|
+
"reflect": false
|
|
252
|
+
},
|
|
253
|
+
"max": {
|
|
254
|
+
"type": "string",
|
|
255
|
+
"mutable": false,
|
|
256
|
+
"complexType": {
|
|
257
|
+
"original": "GuxISOYearMonth",
|
|
258
|
+
"resolved": "`${string}-${string}`",
|
|
259
|
+
"references": {
|
|
260
|
+
"GuxISOYearMonth": {
|
|
261
|
+
"location": "import",
|
|
262
|
+
"path": "../../../utils/date/year-month-values"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"required": false,
|
|
267
|
+
"optional": false,
|
|
268
|
+
"docs": {
|
|
269
|
+
"tags": [],
|
|
270
|
+
"text": "The max year and month selectable in ISO8601 format (yyyy-mm)"
|
|
271
|
+
},
|
|
272
|
+
"attribute": "max",
|
|
273
|
+
"reflect": false
|
|
274
|
+
},
|
|
275
|
+
"disabled": {
|
|
276
|
+
"type": "boolean",
|
|
277
|
+
"mutable": false,
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "boolean",
|
|
280
|
+
"resolved": "boolean",
|
|
281
|
+
"references": {}
|
|
282
|
+
},
|
|
283
|
+
"required": false,
|
|
284
|
+
"optional": false,
|
|
285
|
+
"docs": {
|
|
286
|
+
"tags": [],
|
|
287
|
+
"text": ""
|
|
288
|
+
},
|
|
289
|
+
"attribute": "disabled",
|
|
290
|
+
"reflect": false,
|
|
291
|
+
"defaultValue": "false"
|
|
292
|
+
}
|
|
293
|
+
}; }
|
|
294
|
+
static get states() { return {
|
|
295
|
+
"expanded": {},
|
|
296
|
+
"locale": {}
|
|
297
|
+
}; }
|
|
298
|
+
static get elementRef() { return "root"; }
|
|
299
|
+
static get watchers() { return [{
|
|
300
|
+
"propName": "value",
|
|
301
|
+
"methodName": "onValueUpdate"
|
|
302
|
+
}]; }
|
|
303
|
+
static get listeners() { return [{
|
|
304
|
+
"name": "keydown",
|
|
305
|
+
"method": "onKeyDown",
|
|
306
|
+
"target": undefined,
|
|
307
|
+
"capture": false,
|
|
308
|
+
"passive": false
|
|
309
|
+
}]; }
|
|
310
|
+
}
|
|
311
|
+
__decorate([
|
|
312
|
+
OnClickOutside({ triggerEvents: 'mousedown' })
|
|
313
|
+
], GuxMonthPicker.prototype, "onClickOutside", null);
|
|
@@ -60,6 +60,11 @@
|
|
|
60
60
|
border-radius: 4px;
|
|
61
61
|
box-shadow: inset 0 0 4px rgba(32, 41, 55, 0.16);
|
|
62
62
|
}
|
|
63
|
+
.gux-datepicker .gux-datepicker-field .gux-datepicker-field-input .gux-datepicker-field-text-input:focus-within {
|
|
64
|
+
border-color: #2a60c8;
|
|
65
|
+
outline: none;
|
|
66
|
+
box-shadow: 0 0 0 1px #fdfdfd, 0 0 0 4px #aac9ff;
|
|
67
|
+
}
|
|
63
68
|
.gux-datepicker .gux-datepicker-field .gux-datepicker-field-input .gux-datepicker-field-text-input input {
|
|
64
69
|
flex: 1 1 auto;
|
|
65
70
|
align-self: auto;
|
|
@@ -16,13 +16,16 @@ import { createPopper } from '@popperjs/core';
|
|
|
16
16
|
export class GuxDatepicker {
|
|
17
17
|
constructor() {
|
|
18
18
|
this.yearFormat = 'yyyy';
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Indicates if the user is selecting the range with the mouse.
|
|
21
|
+
* This prevents other events from processing on the input range.
|
|
22
|
+
*/
|
|
23
|
+
this.isSelectingRangeWithMouse = false;
|
|
21
24
|
this.lastYear = new Date().getFullYear();
|
|
22
25
|
this.startInputId = randomHTMLId('gux-datepicker');
|
|
23
26
|
this.endInputId = randomHTMLId('gux-datepicker');
|
|
24
27
|
/**
|
|
25
|
-
* The datepicker label (can be a single label, or two
|
|
28
|
+
* The datepicker label (can be a single label, or two separated by a comma if it's a range datepicker)
|
|
26
29
|
*/
|
|
27
30
|
this.label = '';
|
|
28
31
|
/**
|
|
@@ -52,11 +55,14 @@ export class GuxDatepicker {
|
|
|
52
55
|
/**
|
|
53
56
|
* The datepicker current value
|
|
54
57
|
*/
|
|
55
|
-
this.
|
|
58
|
+
this.formattedValue = '';
|
|
56
59
|
/**
|
|
57
60
|
* The datepicker current value
|
|
58
61
|
*/
|
|
59
|
-
this.
|
|
62
|
+
this.toFormattedValue = '';
|
|
63
|
+
/**
|
|
64
|
+
* Uses styling to control visibility of the calendar element
|
|
65
|
+
*/
|
|
60
66
|
this.active = false;
|
|
61
67
|
}
|
|
62
68
|
watchValue() {
|
|
@@ -83,7 +89,7 @@ export class GuxDatepicker {
|
|
|
83
89
|
this.yearFormat = 'yy';
|
|
84
90
|
}
|
|
85
91
|
this.intervalOrder = getIntervalOrder(newFormat);
|
|
86
|
-
this.lastIntervalRange =
|
|
92
|
+
this.lastIntervalRange = this.initialIntervalRange;
|
|
87
93
|
}
|
|
88
94
|
watchActiveCalendar(active) {
|
|
89
95
|
if (active === true) {
|
|
@@ -93,7 +99,7 @@ export class GuxDatepicker {
|
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
onKeyDown(event) {
|
|
96
|
-
if (this.
|
|
102
|
+
if (this.isInputFieldEvent(event)) {
|
|
97
103
|
this.focusedField = this.getInputFieldFromEvent(event);
|
|
98
104
|
switch (event.key) {
|
|
99
105
|
case 'Enter':
|
|
@@ -102,8 +108,7 @@ export class GuxDatepicker {
|
|
|
102
108
|
this.active = false;
|
|
103
109
|
break;
|
|
104
110
|
case 'Tab':
|
|
105
|
-
|
|
106
|
-
this.setRange();
|
|
111
|
+
// Allow default behavior of tabbing to the next element - the calendar toggle button
|
|
107
112
|
break;
|
|
108
113
|
case 'ArrowDown':
|
|
109
114
|
event.preventDefault();
|
|
@@ -131,12 +136,14 @@ export class GuxDatepicker {
|
|
|
131
136
|
}
|
|
132
137
|
default:
|
|
133
138
|
event.preventDefault();
|
|
134
|
-
this.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
if (!this.isSelectingRangeWithMouse) {
|
|
140
|
+
this.setIntervalRange({
|
|
141
|
+
selectionStart: this.focusedField.selectionStart,
|
|
142
|
+
selectionEnd: this.focusedField.selectionEnd
|
|
143
|
+
});
|
|
144
|
+
this.updateIntervalValue(event);
|
|
145
|
+
this.setCursorRange();
|
|
146
|
+
}
|
|
140
147
|
break;
|
|
141
148
|
}
|
|
142
149
|
}
|
|
@@ -160,23 +167,9 @@ export class GuxDatepicker {
|
|
|
160
167
|
}
|
|
161
168
|
}
|
|
162
169
|
}
|
|
163
|
-
onFocusIn(event) {
|
|
164
|
-
if (this.isFocusedFieldEvent(event)) {
|
|
165
|
-
if (!this.isSelectingRange) {
|
|
166
|
-
this.focusedField = this.getInputFieldFromEvent(event);
|
|
167
|
-
this.setRange();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
onFocusOut(event) {
|
|
172
|
-
const composedPath = event.composedPath();
|
|
173
|
-
if (!composedPath.includes(this.root)) {
|
|
174
|
-
this.lastIntervalRange = getIntervalRange(this.format, getIntervalLetter(this.format, 0));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
170
|
onMouseDown(event) {
|
|
178
|
-
if (this.
|
|
179
|
-
this.
|
|
171
|
+
if (this.isInputFieldEvent(event)) {
|
|
172
|
+
this.isSelectingRangeWithMouse = true;
|
|
180
173
|
}
|
|
181
174
|
const composedPath = event.composedPath();
|
|
182
175
|
const inDatepicker = composedPath.includes(this.datepickerElement);
|
|
@@ -185,22 +178,35 @@ export class GuxDatepicker {
|
|
|
185
178
|
this.active = inDatepicker;
|
|
186
179
|
}
|
|
187
180
|
}
|
|
188
|
-
onMouseUp(event) {
|
|
189
|
-
event.preventDefault();
|
|
190
|
-
if (this.isSelectingRange && this.isFocusedFieldEvent(event)) {
|
|
191
|
-
this.focusedField = this.getInputFieldFromEvent(event);
|
|
192
|
-
this.lastIntervalRange = getIntervalRange(this.format, getIntervalLetter(this.format, this.focusedField.selectionStart));
|
|
193
|
-
this.setRange();
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
181
|
onClickOutside() {
|
|
197
182
|
this.active = false;
|
|
198
183
|
}
|
|
199
|
-
|
|
184
|
+
/********* Event Handlers **********/
|
|
185
|
+
onInputFocusIn(event) {
|
|
186
|
+
this.focusedField = this.getInputFieldFromEvent(event);
|
|
187
|
+
if (!this.isSelectingRangeWithMouse) {
|
|
188
|
+
// When focusing the input the Safari browser will fight for control of the cursor unless it is done asynchronously
|
|
189
|
+
setTimeout(() => this.setRange());
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
onInputFocusOut() {
|
|
193
|
+
this.lastIntervalRange = this.initialIntervalRange;
|
|
194
|
+
}
|
|
195
|
+
onInputMouseUp(event) {
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
this.lastIntervalRange = getIntervalRange(this.format, getIntervalLetter(this.format, this.focusedField.selectionStart));
|
|
198
|
+
this.setRange();
|
|
199
|
+
this.isSelectingRangeWithMouse = false;
|
|
200
|
+
}
|
|
201
|
+
/******** Other Methods **********/
|
|
202
|
+
isInputFieldEvent(event) {
|
|
200
203
|
const composedPath = event.composedPath();
|
|
201
204
|
return (composedPath.includes(this.inputElement) ||
|
|
202
205
|
composedPath.includes(this.toInputElement));
|
|
203
206
|
}
|
|
207
|
+
get initialIntervalRange() {
|
|
208
|
+
return getIntervalRange(this.format, getIntervalLetter(this.format, 0));
|
|
209
|
+
}
|
|
204
210
|
getInputFieldFromEvent(event) {
|
|
205
211
|
const composedPath = event.composedPath();
|
|
206
212
|
return composedPath[0];
|
|
@@ -240,9 +246,9 @@ export class GuxDatepicker {
|
|
|
240
246
|
]);
|
|
241
247
|
}
|
|
242
248
|
stringToDate(stringDate) {
|
|
243
|
-
const
|
|
244
|
-
const formatItems = this.format.toLowerCase().split(
|
|
245
|
-
const dateItems = stringDate.split(
|
|
249
|
+
const formatSeparator = getFormatSeparator(this.format);
|
|
250
|
+
const formatItems = this.format.toLowerCase().split(formatSeparator);
|
|
251
|
+
const dateItems = stringDate.split(formatSeparator);
|
|
246
252
|
const year = parseInt(dateItems[formatItems.indexOf(this.yearFormat)], 10);
|
|
247
253
|
const month = parseInt(dateItems[formatItems.indexOf('mm')], 10) - 1;
|
|
248
254
|
const day = parseInt(dateItems[formatItems.indexOf('dd')], 10);
|
|
@@ -260,9 +266,9 @@ export class GuxDatepicker {
|
|
|
260
266
|
inputEvent.stopPropagation(); // Don't let both events bubble.
|
|
261
267
|
this.input.emit(this.value);
|
|
262
268
|
this.updateDate();
|
|
263
|
-
this.inputElement.value = this.
|
|
269
|
+
this.inputElement.value = this.formattedValue;
|
|
264
270
|
if (this.mode === "range" /* Range */) {
|
|
265
|
-
this.toInputElement.value = this.
|
|
271
|
+
this.toInputElement.value = this.toFormattedValue;
|
|
266
272
|
}
|
|
267
273
|
if (document.activeElement !== this.inputElement ||
|
|
268
274
|
document.activeElement !== this.toInputElement) {
|
|
@@ -286,7 +292,6 @@ export class GuxDatepicker {
|
|
|
286
292
|
this.input.emit(this.value);
|
|
287
293
|
}
|
|
288
294
|
setRange() {
|
|
289
|
-
this.isSelectingRange = false;
|
|
290
295
|
this.setIntervalRange(this.lastIntervalRange);
|
|
291
296
|
this.setCursorRange();
|
|
292
297
|
}
|
|
@@ -348,24 +353,29 @@ export class GuxDatepicker {
|
|
|
348
353
|
if (this.mode === "range" /* Range */) {
|
|
349
354
|
const [from, to] = fromIsoDateRange(this.value);
|
|
350
355
|
const { map: map1, regexp: regexp1 } = this.getMapAndRegexFromField(from);
|
|
351
|
-
this.
|
|
356
|
+
this.formattedValue = this.format.replace(regexp1, match => {
|
|
352
357
|
return map1[match];
|
|
353
358
|
});
|
|
354
359
|
const { map: map2, regexp: regexp2 } = this.getMapAndRegexFromField(to);
|
|
355
|
-
this.
|
|
360
|
+
this.toFormattedValue = this.format.replace(regexp2, match => {
|
|
356
361
|
return map2[match];
|
|
357
362
|
});
|
|
358
363
|
}
|
|
359
364
|
else {
|
|
360
365
|
const dateValue = fromIsoDate(this.value);
|
|
361
366
|
const { map: map3, regexp: regexp3 } = this.getMapAndRegexFromField(dateValue);
|
|
362
|
-
this.
|
|
367
|
+
this.formattedValue = this.format.replace(regexp3, match => {
|
|
363
368
|
return map3[match];
|
|
364
369
|
});
|
|
365
370
|
}
|
|
366
371
|
}
|
|
372
|
+
/** Selects a range of the input text based on the intervalRange property. */
|
|
367
373
|
setCursorRange() {
|
|
368
374
|
if (this.intervalRange) {
|
|
375
|
+
// If the selection is the same as what you are trying to set, setSelectionRange will deselect it.
|
|
376
|
+
// To prevent this, the line below sets the selection to the full field before setting the range we actually want.
|
|
377
|
+
this.focusedField.setSelectionRange(0, 100);
|
|
378
|
+
// Select the range we want
|
|
369
379
|
this.focusedField.setSelectionRange(this.intervalRange.selectionStart, this.intervalRange.selectionEnd);
|
|
370
380
|
}
|
|
371
381
|
}
|
|
@@ -438,9 +448,9 @@ export class GuxDatepicker {
|
|
|
438
448
|
this.numberOfMonths = 2;
|
|
439
449
|
}
|
|
440
450
|
}
|
|
451
|
+
this.updateDate();
|
|
441
452
|
}
|
|
442
453
|
componentDidLoad() {
|
|
443
|
-
this.updateDate();
|
|
444
454
|
this.popperInstance = createPopper(this.datepickerElement, this.calendarElement, {
|
|
445
455
|
modifiers: [
|
|
446
456
|
{
|
|
@@ -454,17 +464,19 @@ export class GuxDatepicker {
|
|
|
454
464
|
});
|
|
455
465
|
}
|
|
456
466
|
componentDidUpdate() {
|
|
457
|
-
|
|
467
|
+
var _a;
|
|
468
|
+
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.forceUpdate();
|
|
458
469
|
}
|
|
459
470
|
disconnectedCallback() {
|
|
460
|
-
|
|
471
|
+
var _a;
|
|
472
|
+
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
461
473
|
}
|
|
462
474
|
renderCalendarToggleButton() {
|
|
463
475
|
return (h("button", { class: "gux-calendar-toggle-button", type: "button", onClick: () => this.toggleCalendar(), "aria-expanded": this.active.toString(), "aria-label": this.i18n('toggleCalendar'), disabled: this.disabled },
|
|
464
476
|
h("gux-icon", { decorative: true, "icon-name": "calendar" })));
|
|
465
477
|
}
|
|
466
478
|
renderCalendar() {
|
|
467
|
-
return (h("gux-calendar", { ref: (el) => (this.calendarElement = el), value: this.value, mode: this.mode, onInput: (event) => this.onCalendarSelect(event), minDate: this.minDate, maxDate: this.maxDate, numberOfMonths: this.numberOfMonths }));
|
|
479
|
+
return (h("gux-calendar", { tabIndex: -1, ref: (el) => (this.calendarElement = el), value: this.value, mode: this.mode, onInput: (event) => this.onCalendarSelect(event), minDate: this.minDate, maxDate: this.maxDate, numberOfMonths: this.numberOfMonths }));
|
|
468
480
|
}
|
|
469
481
|
renderStartDateField() {
|
|
470
482
|
return (h("div", { class: "gux-datepicker-field" },
|
|
@@ -474,7 +486,7 @@ export class GuxDatepicker {
|
|
|
474
486
|
} }, this.getCalendarLabels()[0]),
|
|
475
487
|
h("div", { class: "gux-datepicker-field-input" },
|
|
476
488
|
h("div", { class: "gux-datepicker-field-text-input" },
|
|
477
|
-
h("input", { id: this.startInputId, type: "text", ref: (el) => (this.inputElement = el), value: this.
|
|
489
|
+
h("input", { id: this.startInputId, type: "text", onClick: e => this.onInputMouseUp(e), onFocusin: e => this.onInputFocusIn(e), onFocusout: () => this.onInputFocusOut(), ref: (el) => (this.inputElement = el), value: this.formattedValue, disabled: this.disabled }),
|
|
478
490
|
this.renderCalendarToggleButton()),
|
|
479
491
|
this.renderCalendar())));
|
|
480
492
|
}
|
|
@@ -486,7 +498,7 @@ export class GuxDatepicker {
|
|
|
486
498
|
h("label", { htmlFor: this.endInputId, class: "gux-datepicker-field-label" }, this.getCalendarLabels()[1]),
|
|
487
499
|
h("div", { class: "gux-datepicker-field-input" },
|
|
488
500
|
h("div", { class: "gux-datepicker-field-text-input" },
|
|
489
|
-
h("input", { id: this.endInputId, type: "text", ref: (el) => (this.toInputElement = el), value: this.
|
|
501
|
+
h("input", { id: this.endInputId, type: "text", ref: (el) => (this.toInputElement = el), onMouseUp: e => this.onInputMouseUp(e), onFocusin: e => this.onInputFocusIn(e), onFocusout: () => this.onInputFocusOut(), value: this.toFormattedValue, disabled: this.disabled }),
|
|
490
502
|
this.renderCalendarToggleButton()))));
|
|
491
503
|
}
|
|
492
504
|
render() {
|
|
@@ -536,7 +548,7 @@ export class GuxDatepicker {
|
|
|
536
548
|
"optional": false,
|
|
537
549
|
"docs": {
|
|
538
550
|
"tags": [],
|
|
539
|
-
"text": "The datepicker label (can be a single label, or two
|
|
551
|
+
"text": "The datepicker label (can be a single label, or two separated by a comma if it's a range datepicker)"
|
|
540
552
|
},
|
|
541
553
|
"attribute": "label",
|
|
542
554
|
"reflect": false,
|
|
@@ -657,10 +669,10 @@ export class GuxDatepicker {
|
|
|
657
669
|
}
|
|
658
670
|
}; }
|
|
659
671
|
static get states() { return {
|
|
660
|
-
"
|
|
672
|
+
"formattedValue": {},
|
|
661
673
|
"minDateDate": {},
|
|
662
674
|
"maxDateDate": {},
|
|
663
|
-
"
|
|
675
|
+
"toFormattedValue": {},
|
|
664
676
|
"active": {}
|
|
665
677
|
}; }
|
|
666
678
|
static get events() { return [{
|
|
@@ -702,30 +714,12 @@ export class GuxDatepicker {
|
|
|
702
714
|
"target": undefined,
|
|
703
715
|
"capture": false,
|
|
704
716
|
"passive": false
|
|
705
|
-
}, {
|
|
706
|
-
"name": "focusin",
|
|
707
|
-
"method": "onFocusIn",
|
|
708
|
-
"target": undefined,
|
|
709
|
-
"capture": false,
|
|
710
|
-
"passive": false
|
|
711
|
-
}, {
|
|
712
|
-
"name": "focusout",
|
|
713
|
-
"method": "onFocusOut",
|
|
714
|
-
"target": undefined,
|
|
715
|
-
"capture": false,
|
|
716
|
-
"passive": false
|
|
717
717
|
}, {
|
|
718
718
|
"name": "mousedown",
|
|
719
719
|
"method": "onMouseDown",
|
|
720
720
|
"target": undefined,
|
|
721
721
|
"capture": false,
|
|
722
722
|
"passive": true
|
|
723
|
-
}, {
|
|
724
|
-
"name": "mouseup",
|
|
725
|
-
"method": "onMouseUp",
|
|
726
|
-
"target": undefined,
|
|
727
|
-
"capture": false,
|
|
728
|
-
"passive": false
|
|
729
723
|
}]; }
|
|
730
724
|
}
|
|
731
725
|
__decorate([
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, Element, h, Host, Listen, Method } from '@stencil/core';
|
|
2
2
|
import { first, last, next, previous } from './gux-list.service';
|
|
3
3
|
import { trackComponent } from '../../../usage-tracking';
|
|
4
|
+
const validFocusableItems = ['gux-list-item'];
|
|
4
5
|
export class GuxList {
|
|
5
6
|
componentWillLoad() {
|
|
6
7
|
trackComponent(this.root);
|
|
@@ -9,25 +10,25 @@ export class GuxList {
|
|
|
9
10
|
switch (event.key) {
|
|
10
11
|
case 'ArrowUp':
|
|
11
12
|
event.preventDefault();
|
|
12
|
-
previous(this.root);
|
|
13
|
+
previous(this.root, validFocusableItems);
|
|
13
14
|
break;
|
|
14
15
|
case 'Home':
|
|
15
16
|
event.preventDefault();
|
|
16
|
-
first(this.root);
|
|
17
|
+
first(this.root, validFocusableItems);
|
|
17
18
|
break;
|
|
18
19
|
case 'ArrowDown':
|
|
19
20
|
event.preventDefault();
|
|
20
|
-
next(this.root);
|
|
21
|
+
next(this.root, validFocusableItems);
|
|
21
22
|
break;
|
|
22
23
|
case 'End':
|
|
23
24
|
event.preventDefault();
|
|
24
|
-
last(this.root);
|
|
25
|
+
last(this.root, validFocusableItems);
|
|
25
26
|
break;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
29
30
|
async guxFocusFirstItem() {
|
|
30
|
-
first(this.root);
|
|
31
|
+
first(this.root, validFocusableItems);
|
|
31
32
|
}
|
|
32
33
|
renderFocusTarget() {
|
|
33
34
|
return (h("span", { tabindex: "-1" }));
|