q2-tecton-elements 1.49.2 → 1.49.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/click-elsewhere_2.cjs.entry.js +137 -139
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-a93362ed.js → index-83b024c4.js} +1 -21
- package/dist/cjs/index-83b024c4.js.map +1 -0
- package/dist/cjs/{index-42fcd170.js → index-f69742cf.js} +1 -1
- package/dist/cjs/{index-42fcd170.js.map → index-f69742cf.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +2 -2
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +3 -3
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
- package/dist/cjs/q2-carousel.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/q2-currency.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +2 -2
- package/dist/cjs/q2-detail.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/q2-editable-field.cjs.entry.js +2 -2
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-input.cjs.entry.js +2 -2
- package/dist/cjs/q2-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-legend.cjs.entry.js +1 -1
- package/dist/cjs/q2-list.cjs.entry.js +2 -2
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +2 -2
- package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
- package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/q2-option-list.cjs.entry.js +13 -11
- package/dist/cjs/q2-option-list.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +3 -3
- package/dist/cjs/q2-pill.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio.cjs.entry.js +2 -2
- package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
- package/dist/cjs/q2-section.cjs.entry.js +3 -3
- package/dist/cjs/q2-select.cjs.entry.js +108 -29
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
- package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +2 -2
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +5 -5
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
- package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar.js +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
- package/dist/collection/components/q2-carousel/q2-carousel.js +1 -1
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
- package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
- package/dist/collection/components/q2-checkbox/q2-checkbox.js +1 -1
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js +7 -7
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +1 -1
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +1 -1
- package/dist/collection/components/q2-input/q2-input.js +2 -2
- package/dist/collection/components/q2-item/q2-item.js +1 -1
- package/dist/collection/components/q2-legend/q2-legend.js +1 -1
- package/dist/collection/components/q2-list/q2-list.js +1 -1
- package/dist/collection/components/q2-loc/q2-loc.js +1 -1
- package/dist/collection/components/q2-message/q2-message.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
- package/dist/collection/components/q2-option/q2-option.js +1 -1
- package/dist/collection/components/q2-option-list/q2-option-list.js +15 -13
- package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
- package/dist/collection/components/q2-pagination/q2-pagination.js +2 -2
- package/dist/collection/components/q2-pill/q2-pill.js +1 -1
- package/dist/collection/components/q2-popover/q2-popover.css +18 -10
- package/dist/collection/components/q2-popover/q2-popover.js +192 -193
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-section/q2-section.js +2 -2
- package/dist/collection/components/q2-select/q2-select.js +146 -31
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +3 -3
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +1 -1
- package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/components/index2.js +1 -20
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-action-sheet.js +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-calendar.js +1 -1
- package/dist/components/q2-carousel-pane.js +2 -2
- package/dist/components/q2-carousel.js +1 -1
- package/dist/components/q2-chart-area.js +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +1 -1
- package/dist/components/q2-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox2.js +1 -1
- package/dist/components/q2-currency.js +1 -1
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-detail.js +1 -1
- package/dist/components/q2-dropdown.js +1 -1
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-input2.js +1 -1
- package/dist/components/q2-item.js +1 -1
- package/dist/components/q2-legend2.js +1 -1
- package/dist/components/q2-list.js +1 -1
- package/dist/components/q2-loc.js +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-month-picker.js +2 -2
- package/dist/components/q2-optgroup2.js +1 -1
- package/dist/components/q2-option-list2.js +12 -10
- package/dist/components/q2-option-list2.js.map +1 -1
- package/dist/components/q2-option2.js +1 -1
- package/dist/components/q2-pagination.js +2 -2
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +143 -145
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio.js +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-section.js +2 -2
- package/dist/components/q2-select2.js +112 -32
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tab-pane.js +1 -1
- package/dist/components/q2-tag.js +1 -1
- package/dist/components/q2-textarea.js +1 -1
- package/dist/components/tecton-tab-pane.js +2 -2
- package/dist/esm/click-elsewhere_2.entry.js +137 -139
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/{index-1c019b24.js → index-3184c760.js} +1 -1
- package/dist/esm/{index-1c019b24.js.map → index-3184c760.js.map} +1 -1
- package/dist/esm/{index-3c5cd75e.js → index-e5ac05c3.js} +2 -21
- package/dist/esm/index-e5ac05c3.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +2 -2
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-btn_2.entry.js +1 -1
- package/dist/esm/q2-calendar.entry.js +3 -3
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +3 -3
- package/dist/esm/q2-carousel.entry.js +2 -2
- package/dist/esm/q2-chart-area.entry.js +2 -2
- package/dist/esm/q2-chart-bar.entry.js +2 -2
- package/dist/esm/q2-chart-donut.entry.js +2 -2
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox.entry.js +2 -2
- package/dist/esm/q2-currency.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +2 -2
- package/dist/esm/q2-detail.entry.js +2 -2
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +2 -2
- package/dist/esm/q2-editable-field.entry.js +2 -2
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-input.entry.js +2 -2
- package/dist/esm/q2-item.entry.js +2 -2
- package/dist/esm/q2-legend.entry.js +1 -1
- package/dist/esm/q2-list.entry.js +2 -2
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +2 -2
- package/dist/esm/q2-month-picker.entry.js +3 -3
- package/dist/esm/q2-optgroup.entry.js +2 -2
- package/dist/esm/q2-option-list.entry.js +13 -11
- package/dist/esm/q2-option-list.entry.js.map +1 -1
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +3 -3
- package/dist/esm/q2-pill.entry.js +2 -2
- package/dist/esm/q2-radio-group.entry.js +2 -2
- package/dist/esm/q2-radio.entry.js +2 -2
- package/dist/esm/q2-relative-time.entry.js +3 -3
- package/dist/esm/q2-section.entry.js +3 -3
- package/dist/esm/q2-select.entry.js +109 -30
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper-pane.entry.js +2 -2
- package/dist/esm/q2-stepper-vertical.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js +2 -2
- package/dist/esm/q2-tab-container.entry.js +2 -2
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +2 -2
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +2 -2
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +2 -2
- package/dist/jest.setup.js +22 -0
- package/dist/jest.setup.js.map +1 -0
- package/dist/q2-tecton-elements/{p-40df4468.entry.js → p-04dd9b90.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-d78669df.entry.js → p-0c1e2b0d.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-0852e6fe.entry.js → p-11883a2d.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-5775b02b.entry.js → p-2154fd27.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-dbfab45b.entry.js → p-23638c08.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-f6358905.entry.js → p-24c2cc43.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-a8e7e591.entry.js → p-26a7f68d.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-da711c59.entry.js → p-2a21bb2a.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-25bfe0b2.entry.js → p-33a16719.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-db79c056.entry.js → p-36e541b9.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-7b9a6bb7.entry.js → p-38a2862e.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-3fe148c2.entry.js +2 -0
- package/dist/q2-tecton-elements/{p-a657277b.entry.js.map → p-3fe148c2.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/{p-ec8a0b64.entry.js → p-436b9b84.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-ea7876eb.entry.js → p-45cf9f0b.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-9ecabc7a.entry.js → p-48181bc2.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-48a45547.entry.js +2 -0
- package/dist/q2-tecton-elements/p-48a45547.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-333a41ca.entry.js → p-4f6eebbf.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-08176bd0.entry.js → p-60940069.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-93680d12.entry.js → p-631226a9.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-4388e521.entry.js → p-6c64c5e9.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-793a453e.entry.js → p-6e4b1bfe.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-a177d812.entry.js → p-70e8ddbe.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-d8d9ba1f.entry.js → p-73c6ecee.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-76bd33da.entry.js +2 -0
- package/dist/q2-tecton-elements/p-76bd33da.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-76b98623.entry.js → p-85ddbe4f.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-e3ad770b.entry.js → p-85eff820.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-e0a6baea.entry.js → p-88ae4e26.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-05b30f98.entry.js → p-8b032c77.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-6c933b14.entry.js → p-960ee73c.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-baa2eaa9.entry.js → p-99a8fdc4.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-bbf9d36d.entry.js → p-a4294b4d.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-a6ca739a.entry.js +2 -0
- package/dist/q2-tecton-elements/{p-4da4cb5d.entry.js.map → p-a6ca739a.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/p-ac6c467f.entry.js +2 -0
- package/dist/q2-tecton-elements/p-ac6c467f.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-1e7fa870.entry.js → p-b45b6a3e.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-2810ba28.entry.js → p-ba7ffb2f.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-9c589ab3.entry.js → p-bd4c5570.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-c5aac064.entry.js → p-bf4a9be3.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-cb4d177a.entry.js +2 -0
- package/dist/q2-tecton-elements/{p-9e90a38a.entry.js.map → p-cb4d177a.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/{p-630613c7.entry.js → p-d1ba78ec.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-d24bb23e.js +2 -0
- package/dist/q2-tecton-elements/p-d24bb23e.js.map +1 -0
- package/dist/q2-tecton-elements/{p-2bcb7e89.entry.js → p-d63cb875.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-e4b8f4b3.entry.js → p-d950ae4c.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-5037fa67.entry.js → p-dba6c931.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-e44560d9.entry.js → p-de4bce7e.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-c8b4f5f7.entry.js → p-e098f6c5.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-be518818.js → p-f1e887f5.js} +1 -1
- package/dist/q2-tecton-elements/{p-77a763eb.entry.js → p-f6901c57.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-da0cacef.entry.js → p-ff5f28fb.entry.js} +2 -2
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
- package/dist/test/elements/q2-calendar-test.e2e.js +2 -2
- package/dist/test/elements/q2-calendar-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-dropdown-test.e2e.js +2 -14
- package/dist/test/elements/q2-dropdown-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-pagination-test.e2e.js +1 -0
- package/dist/test/elements/q2-pagination-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-pill-test.e2e.js +1 -1
- package/dist/test/elements/q2-pill-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-popover-test.e2e.js +1 -34
- package/dist/test/elements/q2-popover-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-popover-test.spec.js +743 -435
- package/dist/test/elements/q2-popover-test.spec.js.map +1 -1
- package/dist/test/elements/q2-select-test.e2e.js +1 -15
- package/dist/test/elements/q2-select-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-select-test.spec.js +412 -0
- package/dist/test/elements/q2-select-test.spec.js.map +1 -0
- package/dist/test/elements/q2-tag-test.e2e.js +1 -1
- package/dist/test/elements/q2-tag-test.e2e.js.map +1 -1
- package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +1 -0
- package/dist/types/components/q2-action-sheet/q2-action-sheet.d.ts +60 -0
- package/dist/types/components/q2-calendar/q2-calendar.d.ts +324 -0
- package/dist/types/components/q2-carousel/q2-carousel.d.ts +2 -2
- package/dist/types/components/q2-data-table/q2-data-table.d.ts +223 -0
- package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +130 -0
- package/dist/types/components/q2-dropdown-item/q2-dropdown-item.d.ts +50 -0
- package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +140 -0
- package/dist/types/components/q2-loading/skeleton/shapes.d.ts +1 -0
- package/dist/types/components/q2-optgroup/q2-optgroup.d.ts +1 -1
- package/dist/types/components/q2-option-list/q2-option-list.d.ts +99 -0
- package/dist/types/components/q2-pagination/q2-pagination.d.ts +60 -0
- package/dist/types/components/q2-pill/q2-pill.d.ts +102 -0
- package/dist/types/components/q2-popover/q2-popover.d.ts +31 -31
- package/dist/types/components/q2-select/q2-select.d.ts +256 -0
- package/dist/types/components/q2-stepper/q2-stepper.d.ts +52 -0
- package/dist/types/components/q2-stepper-vertical/q2-stepper-vertical.d.ts +62 -0
- package/dist/types/components/q2-tab-container/q2-tab-container.d.ts +2 -2
- package/dist/types/components/q2-tag/q2-tag.d.ts +59 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/utils/action-sheet.d.ts +12 -0
- package/package.json +3 -3
- package/dist/cjs/index-a93362ed.js.map +0 -1
- package/dist/esm/index-3c5cd75e.js.map +0 -1
- package/dist/q2-tecton-elements/p-089a7a1e.entry.js +0 -2
- package/dist/q2-tecton-elements/p-089a7a1e.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-2e6669a7.entry.js +0 -2
- package/dist/q2-tecton-elements/p-2e6669a7.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-4da4cb5d.entry.js +0 -2
- package/dist/q2-tecton-elements/p-84190698.js +0 -2
- package/dist/q2-tecton-elements/p-84190698.js.map +0 -1
- package/dist/q2-tecton-elements/p-9e90a38a.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a657277b.entry.js +0 -2
- package/dist/q2-tecton-elements/p-d2d3d95b.entry.js +0 -2
- package/dist/q2-tecton-elements/p-d2d3d95b.entry.js.map +0 -1
- /package/dist/q2-tecton-elements/{p-40df4468.entry.js.map → p-04dd9b90.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-d78669df.entry.js.map → p-0c1e2b0d.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-0852e6fe.entry.js.map → p-11883a2d.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-5775b02b.entry.js.map → p-2154fd27.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-dbfab45b.entry.js.map → p-23638c08.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-f6358905.entry.js.map → p-24c2cc43.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-a8e7e591.entry.js.map → p-26a7f68d.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-da711c59.entry.js.map → p-2a21bb2a.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-25bfe0b2.entry.js.map → p-33a16719.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-db79c056.entry.js.map → p-36e541b9.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-7b9a6bb7.entry.js.map → p-38a2862e.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-ec8a0b64.entry.js.map → p-436b9b84.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-ea7876eb.entry.js.map → p-45cf9f0b.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-9ecabc7a.entry.js.map → p-48181bc2.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-333a41ca.entry.js.map → p-4f6eebbf.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-08176bd0.entry.js.map → p-60940069.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-93680d12.entry.js.map → p-631226a9.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-4388e521.entry.js.map → p-6c64c5e9.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-793a453e.entry.js.map → p-6e4b1bfe.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-a177d812.entry.js.map → p-70e8ddbe.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-d8d9ba1f.entry.js.map → p-73c6ecee.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-76b98623.entry.js.map → p-85ddbe4f.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-e3ad770b.entry.js.map → p-85eff820.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-e0a6baea.entry.js.map → p-88ae4e26.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-05b30f98.entry.js.map → p-8b032c77.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-6c933b14.entry.js.map → p-960ee73c.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-baa2eaa9.entry.js.map → p-99a8fdc4.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-bbf9d36d.entry.js.map → p-a4294b4d.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-1e7fa870.entry.js.map → p-b45b6a3e.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-2810ba28.entry.js.map → p-ba7ffb2f.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-9c589ab3.entry.js.map → p-bd4c5570.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-c5aac064.entry.js.map → p-bf4a9be3.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-630613c7.entry.js.map → p-d1ba78ec.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-2bcb7e89.entry.js.map → p-d63cb875.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-e4b8f4b3.entry.js.map → p-d950ae4c.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-5037fa67.entry.js.map → p-dba6c931.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-e44560d9.entry.js.map → p-de4bce7e.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-c8b4f5f7.entry.js.map → p-e098f6c5.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-be518818.js.map → p-f1e887f5.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-77a763eb.entry.js.map → p-f6901c57.entry.js.map} +0 -0
- /package/dist/q2-tecton-elements/{p-da0cacef.entry.js.map → p-ff5f28fb.entry.js.map} +0 -0
- /package/dist/types/{workspace/workspace/tecton-production_release_1.49.x → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/test/elements/q2-detail/slot-component.d.ts +0 -0
- /package/dist/types/{workspace/workspace/tecton-production_release_1.49.x → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class Q2Tag implements ComponentInterface {
|
|
3
|
+
dropdownBtn: HTMLButtonElement;
|
|
4
|
+
mutationObserver: MutationObserver;
|
|
5
|
+
optionList: HTMLQ2OptionListElement;
|
|
6
|
+
popoverElement: HTMLQ2PopoverElement;
|
|
7
|
+
hostElement: HTMLElement;
|
|
8
|
+
optionCount: number;
|
|
9
|
+
/**
|
|
10
|
+
* Instructs the component to use the action sheet workflow for displaying its options.
|
|
11
|
+
*
|
|
12
|
+
* For more information, see [Action Sheets](https://tecton.q2developer.com/guides/action-sheets/).
|
|
13
|
+
*/
|
|
14
|
+
hoist: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The text that populates the label.
|
|
17
|
+
* @localizable
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/** Determine whether the popover is open or closed. */
|
|
21
|
+
open: boolean;
|
|
22
|
+
/** Determines the label that is applied to the option list for accessibility purposes. */
|
|
23
|
+
optionListLabel: string;
|
|
24
|
+
/** Aligns the popover dropdown to the left or right side of the input field. */
|
|
25
|
+
popoverAlignment: 'left' | 'right';
|
|
26
|
+
/**
|
|
27
|
+
* Force the direction of the popover dropdown when it opens.
|
|
28
|
+
* If no value is passed, the component will auto-detect the direction based on available space.
|
|
29
|
+
*/
|
|
30
|
+
popoverDirection: 'up' | 'down';
|
|
31
|
+
/** @deprecated */
|
|
32
|
+
popoverMinHeight: number;
|
|
33
|
+
/** The color of the element. */
|
|
34
|
+
theme: 'primary' | 'secondary' | 'tertiary';
|
|
35
|
+
/**
|
|
36
|
+
* Emitted when a provided option is clicked.
|
|
37
|
+
*
|
|
38
|
+
* Requires at least one option to be provided.
|
|
39
|
+
*/
|
|
40
|
+
click: EventEmitter<{
|
|
41
|
+
value: string;
|
|
42
|
+
}>;
|
|
43
|
+
disconnectedCallback(): void;
|
|
44
|
+
componentWillLoad(): void;
|
|
45
|
+
componentDidLoad(): void;
|
|
46
|
+
delegateFocus(event: FocusEvent): void;
|
|
47
|
+
popoverStateHandler({ detail: { open } }: CustomEvent<{
|
|
48
|
+
open: boolean;
|
|
49
|
+
}>): void;
|
|
50
|
+
determineOptionCount: () => void;
|
|
51
|
+
generateHiddenElement(): any;
|
|
52
|
+
handleButtonFocusout: (event: FocusEvent) => Promise<void>;
|
|
53
|
+
handleChange: (event: any) => void;
|
|
54
|
+
handleClick: (event: MouseEvent) => Promise<void>;
|
|
55
|
+
handleKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
56
|
+
handleWrapperClick: () => void;
|
|
57
|
+
onClickElsewhere: (event: CustomEvent) => void;
|
|
58
|
+
render(): any;
|
|
59
|
+
}
|
|
@@ -1870,6 +1870,10 @@ export namespace Components {
|
|
|
1870
1870
|
* @deprecated
|
|
1871
1871
|
*/
|
|
1872
1872
|
"popDirection": 'up' | 'down';
|
|
1873
|
+
/**
|
|
1874
|
+
* Force the maximum height of the popover. This value will be interpreted as pixels. If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.
|
|
1875
|
+
*/
|
|
1876
|
+
"popoverMaxHeight": number;
|
|
1873
1877
|
/**
|
|
1874
1878
|
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
1875
1879
|
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
@@ -4984,6 +4988,10 @@ declare namespace LocalJSX {
|
|
|
4984
4988
|
* @deprecated
|
|
4985
4989
|
*/
|
|
4986
4990
|
"popDirection"?: 'up' | 'down';
|
|
4991
|
+
/**
|
|
4992
|
+
* Force the maximum height of the popover. This value will be interpreted as pixels. If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.
|
|
4993
|
+
*/
|
|
4994
|
+
"popoverMaxHeight"?: number;
|
|
4987
4995
|
/**
|
|
4988
4996
|
* Determines the display mode of the popover. Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.
|
|
4989
4997
|
* @info This is a temporary solution to work around styling issues related to using fixed positioning for the popover when nested inside of elements with transform properties. This will be removed once the popover API is available for use.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionSheetListCloseData, ActionSheetListData } from 'q2-tecton-common/lib/utility/action-sheet';
|
|
2
|
+
interface IActionSheetComponent {
|
|
3
|
+
hoist: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const shouldShowActionSheet: (component: IActionSheetComponent, event?: KeyboardEvent | MouseEvent) => boolean;
|
|
6
|
+
export declare const buildListData: (component: IActionSheetListComponent, event?: MouseEvent | KeyboardEvent) => Promise<ActionSheetListData>;
|
|
7
|
+
interface IActionSheetListComponent {
|
|
8
|
+
optionList: HTMLQ2OptionListElement;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const showActionSheetList: (component: IActionSheetListComponent, event?: MouseEvent | KeyboardEvent) => Promise<ActionSheetListCloseData>;
|
|
12
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "q2-tecton-elements",
|
|
3
|
-
"version": "1.49.
|
|
3
|
+
"version": "1.49.3",
|
|
4
4
|
"description": "Q2 Tecton Custom Elements",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Q2 Tecton Team",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@stencil/core": "4.18.0",
|
|
37
|
-
"q2-tecton-common": "1.49.
|
|
37
|
+
"q2-tecton-common": "1.49.3",
|
|
38
38
|
"swiper": "8.4.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"typescript": "5.4.5",
|
|
59
59
|
"typescript-eslint": "^7.11.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "99e6e1fe0054ac95675d9cb7e99b9b99d0b22822"
|
|
62
62
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"index-a93362ed.js","mappings":";;;;SAgBgB,QAAQ;IACpB,OAAO,qFAAqF,CAAC,IAAI,CAC7F,SAAS,CAAC,SAAS,CACtB,CAAC;AACN,CAAC;SAEe,iBAAiB,CAAC,KAAiB,EAAE,WAAwB;IACzE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;;;IAI9C,MAAM,mBAAmB,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;IAE3E,MAAM,4BAA4B,GAAG,CAAC,OAAoB;QACtD,IAAI,OAAO,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QACzC,IAAI,OAAO,CAAC,aAAa,EAAE;YACvB,OAAO,4BAA4B,CAAC,OAA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AS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACrC,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;SACnD;aAAM;YACH,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACxC,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,CAAC;SAC/D;KACJ,CAAC,CAAC;AACP,CAAC;MAEY,YAAY,GAAG;;IACxB,OAAO,MAAA,MAAA,MAAM,CAAC,cAAc,0CAAE,YAAY,kDAAI,CAAC;AACnD,EAAE;AAEF;MACa,WAAW,GAAG,CAAC,MAAa;IACrC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QACnE,MAAM,CAAC,MAAM,GAAG,YAAY,MAAM,CAAC,KAAK,EAAgC,CAAC;QACzE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;KAC5B;AACL;;;;;;;;;;;;;;;;;;;;;;;;;","names":["h"],"sources":["src/utils/index.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { Q2Btn } from 'src/components/q2-btn/q2-btn';\nimport { Q2Calendar } from 'src/components/q2-calendar/q2-calendar';\nimport { Q2Carousel } from 'src/components/q2-carousel/q2-carousel';\nimport { Q2Checkbox } from 'src/components/q2-checkbox/q2-checkbox';\nimport { Q2CheckboxGroup } from 'src/components/q2-checkbox-group/q2-checkbox-group';\nimport { Q2RadioGroup } from 'src/components/q2-radio-group/q2-radio-group';\nimport { Q2Dropdown } from 'src/components/q2-dropdown/q2-dropdown';\nimport { Q2DropdownItem } from 'src/components/q2-dropdown-item/q2-dropdown-item';\nimport { Q2EditableField } from 'src/components/q2-editable-field/q2-editable-field';\nimport { Q2Input } from 'src/components/q2-input/q2-input';\nimport { Q2Loading } from 'src/components/q2-loading/q2-loading';\nimport { Q2Radio } from 'src/components/q2-radio/q2-radio';\nimport { Q2Select } from 'src/components/q2-select/q2-select';\nimport { FormFieldTypes, IDict } from 'src/util';\n\nexport function isMobile(): boolean {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(\n navigator.userAgent\n );\n}\n\nexport function isHostLosingFocus(event: FocusEvent, hostElement: HTMLElement) {\n const type = event.type;\n const focusInTypes = ['focusin', 'focus'];\n const isFocusIn = focusInTypes.includes(type);\n\n // on focusin: `target` is element losing focus, `relatedTarget` is element gaining focus\n // on focusout: `target` is element gaining focus, `relatedTarget` is element losing focus\n const elementGainingFocus = isFocusIn ? event.target : event.relatedTarget;\n\n const isElementNestedInHostElement = (element: HTMLElement) => {\n if (element === hostElement) return true;\n if (element.parentElement) {\n return isElementNestedInHostElement(element.parentElement);\n }\n return false;\n };\n\n if (!(elementGainingFocus instanceof HTMLElement)) return true;\n return !isElementNestedInHostElement(elementGainingFocus);\n}\n\nexport function isRelatedTargetWithinHost(event: FocusEvent, element: HTMLElement) {\n return event.relatedTarget !== element && !element.contains(event.relatedTarget as Node);\n}\n\nexport function isEventFromElement(event: Event, element: HTMLElement): boolean {\n return event.composedPath?.()[0] === element;\n}\n\nexport function overrideFocus(hostElement: HTMLElement) {\n hostElement.focus = () => hostElement?.dispatchEvent(new FocusEvent('focus', { bubbles: false }));\n}\n\nexport function isFirefox() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('firefox');\n}\n\nexport function isTouchDevice() {\n return 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n}\n\nexport function isSafari() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('safari') && !userAgent.includes('chrome');\n}\n\n/**\n * Returns the value of a prop if it is defined and included in the `validValues`\n * array. This is used primarily to prevent Vue wrappers from setting aria props\n * to \"Symbol()\" when the prop is not set.\n */\nexport function getAriaValueFromProp(prop: string, validValues?: string[]) {\n if (prop === undefined) return prop;\n if (!validValues) return prop !== 'Symbol()' ? prop : undefined;\n return validValues.includes(prop) || prop === '' ? prop : undefined;\n}\n\nlet guid: number = 1000;\nexport function createGuid(): number {\n return guid++;\n}\n\nexport function nextPaint(fn: (value?: unknown) => void) {\n requestAnimationFrame(() => {\n requestAnimationFrame(fn);\n });\n}\n\nexport function isVisible(element: HTMLElement) {\n return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;\n}\n\nexport function waitForNextPaint() {\n return new Promise(resolve => nextPaint(resolve));\n}\n\nexport function capitalize(value: string) {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n\nexport function pick(props: string[]): (obj: object) => object {\n return obj => {\n return props.reduce((memo, prop) => {\n return {\n ...memo,\n [prop]: obj[prop],\n };\n }, {});\n };\n}\n\nexport function loc(key: string, subs?: IDict<any> | string[]) {\n if (!key) return '';\n if (window.Tecton?.noStrings === true) {\n return key;\n }\n return window?.TectonElements?.loc(key, subs) ?? key;\n}\n\nexport function labelDOM(target: FormFieldTypes | Q2RadioGroup | Q2CheckboxGroup) {\n const { label, hideLabel, optional, readonly } = target;\n const labelClasses: string[] = ['input-label'];\n let helpText = '';\n\n let shouldHideLabel = hideLabel;\n if (!shouldHideLabel) {\n const labelSlotElements = target.hostElement.querySelectorAll<HTMLSlotElement>('[slot=\"label\"]');\n const hasSlotContent = labelSlotElements.length > 0;\n const hasLabel = !!label;\n\n shouldHideLabel = hasLabel || hasSlotContent ? false : true;\n }\n\n if (shouldHideLabel) labelClasses.push('sr');\n if (optional) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.optional')}</span>;\n }\n if (readonly) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.readonly')}</span>;\n labelClasses.push('readonly-field');\n }\n return (\n <label\n htmlFor={target.inputId}\n class={labelClasses.join(' ')}\n >\n <slot name=\"label\">\n {label ? loc(label) : undefined}\n {helpText}\n </slot>\n </label>\n );\n}\n\nexport function hasSlotContent(target: HTMLElement, slotName: string) {\n return target.querySelector(`[slot=\"${slotName}\"]`) !== null;\n}\n\nexport function handleAriaLabel(\n target:\n | Q2Input\n | Q2Select\n | Q2Radio\n | Q2Checkbox\n | Q2EditableField\n | Q2Dropdown\n | Q2DropdownItem\n | Q2Loading\n | Q2Carousel\n | Q2Calendar\n | Q2Btn\n) {\n const { ariaLabel } = target;\n if (!ariaLabel) return;\n\n // If empty ariaLabel prop is set to primitive symbol by framework wrapper, set ariaLabel to undefined and return\n const FW_WRAPPERS_EMPTY_PROP = Symbol().toString();\n if (ariaLabel === FW_WRAPPERS_EMPTY_PROP) {\n target.ariaLabel = undefined;\n return;\n }\n\n // If ariaLabel is set, set hideLabel to true and set label to ariaLabel\n if ('hideLabel' in target) target.hideLabel = true;\n target.label = loc(ariaLabel);\n target.ariaLabel = undefined;\n}\n\n/**\n * Handles when a prop has been renamed on a component without introducing a breaking change.\n */\nexport function handleRenamedProp(target: object, oldProp: string, newProp: string, removeOldProp?: boolean) {\n if (typeof target[oldProp] === 'undefined') return;\n\n // If old prop has value, aka set in component, call handleDeprecationWarning()\n if (target[oldProp]) {\n handleDeprecationWarning(target, oldProp, 'prop');\n }\n\n target[newProp] = target[oldProp];\n\n if (removeOldProp) {\n delete target[oldProp];\n }\n}\n\nexport function handleDeprecationWarning(\n target: object,\n deprecatedItemName: string,\n deprecatedItemType: 'function' | 'prop' | 'method' | 'event'\n) {\n if (window.location.hostname === 'localhost' || window.location.host === 'stack.q2developer.com') {\n if (target[deprecatedItemName] === 'undefined') return;\n\n const componentName = target.constructor.name.toLowerCase().slice(2);\n\n switch (deprecatedItemType) {\n case 'prop':\n if (deprecatedItemName === 'size' && componentName === 'btn') {\n console.warn(\n `The property of size in q2-btn should not be typeof number, or typeof string containing a number. This functionality will be deprecated in an upcoming release. Instead, please use the value 'undefined', or typeof string with any of the following values: \"small\" / \"medium\" / \"large\" `\n );\n } else {\n console.warn(\n `The property ${deprecatedItemName} in q2-${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n }\n break;\n\n case 'function':\n console.warn(\n `The function ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'method':\n console.warn(\n `The method ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'event':\n console.warn(\n `The event ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n default:\n console.error(\n `handleDeprecationWarning --> No type found for desired deprecation: ${deprecatedItemName} in q2-${componentName}: deprecatedItemType = ${deprecatedItemName}`\n );\n }\n }\n}\n\nexport function messagesDOM(target: FormFieldTypes) {\n const type = target.hasError ? 'danger' : 'info';\n\n return (\n <div class=\"messages-container\">\n <q2-message\n appearance=\"minimal\"\n description\n type={type}\n test-id=\"message\"\n >\n <ul id={target.inputDescribedBy}>\n {target.messages.map(message => (\n <li test-id=\"messageListItem\">{loc(message)}</li>\n ))}\n </ul>\n </q2-message>\n </div>\n );\n}\n\nexport function setMessageHeight(target: FormFieldTypes) {\n const messageContainer = (target.hostElement.shadowRoot as ShadowRoot).querySelector<HTMLDivElement>(\n '.messages-container'\n );\n const q2Message = messageContainer.querySelector('q2-message');\n nextPaint(() => {\n const height = target.showMessages && target.hasFocus ? q2Message.getBoundingClientRect().height : 0;\n\n if (messageContainer.style.getPropertyValue('height') === `${height}px`) return;\n\n if (height === 0) {\n q2Message.classList.add('invisible');\n messageContainer.style.removeProperty('height');\n } else {\n q2Message.classList.remove('invisible');\n messageContainer.style.setProperty('height', `${height}px`);\n }\n });\n}\n\nexport const resizeIframe = () => {\n return window.TectonElements?.resizeIframe?.();\n};\n\n// Handling color attribute (deprecated)\nexport const handleColor = (target: Q2Btn) => {\n if (!target.intent && ['primary', 'secondary'].includes(target.color)) {\n target.intent = `workflow-${target.color}` as HTMLQ2BtnElement['intent'];\n target.color = undefined;\n }\n};\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file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AAC;KAC5B;AACL;;;;","names":[],"sources":["src/utils/index.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { Q2Btn } from 'src/components/q2-btn/q2-btn';\nimport { Q2Calendar } from 'src/components/q2-calendar/q2-calendar';\nimport { Q2Carousel } from 'src/components/q2-carousel/q2-carousel';\nimport { Q2Checkbox } from 'src/components/q2-checkbox/q2-checkbox';\nimport { Q2CheckboxGroup } from 'src/components/q2-checkbox-group/q2-checkbox-group';\nimport { Q2RadioGroup } from 'src/components/q2-radio-group/q2-radio-group';\nimport { Q2Dropdown } from 'src/components/q2-dropdown/q2-dropdown';\nimport { Q2DropdownItem } from 'src/components/q2-dropdown-item/q2-dropdown-item';\nimport { Q2EditableField } from 'src/components/q2-editable-field/q2-editable-field';\nimport { Q2Input } from 'src/components/q2-input/q2-input';\nimport { Q2Loading } from 'src/components/q2-loading/q2-loading';\nimport { Q2Radio } from 'src/components/q2-radio/q2-radio';\nimport { Q2Select } from 'src/components/q2-select/q2-select';\nimport { FormFieldTypes, IDict } from 'src/util';\n\nexport function isMobile(): boolean {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(\n navigator.userAgent\n );\n}\n\nexport function isHostLosingFocus(event: FocusEvent, hostElement: HTMLElement) {\n const type = event.type;\n const focusInTypes = ['focusin', 'focus'];\n const isFocusIn = focusInTypes.includes(type);\n\n // on focusin: `target` is element losing focus, `relatedTarget` is element gaining focus\n // on focusout: `target` is element gaining focus, `relatedTarget` is element losing focus\n const elementGainingFocus = isFocusIn ? event.target : event.relatedTarget;\n\n const isElementNestedInHostElement = (element: HTMLElement) => {\n if (element === hostElement) return true;\n if (element.parentElement) {\n return isElementNestedInHostElement(element.parentElement);\n }\n return false;\n };\n\n if (!(elementGainingFocus instanceof HTMLElement)) return true;\n return !isElementNestedInHostElement(elementGainingFocus);\n}\n\nexport function isRelatedTargetWithinHost(event: FocusEvent, element: HTMLElement) {\n return event.relatedTarget !== element && !element.contains(event.relatedTarget as Node);\n}\n\nexport function isEventFromElement(event: Event, element: HTMLElement): boolean {\n return event.composedPath?.()[0] === element;\n}\n\nexport function overrideFocus(hostElement: HTMLElement) {\n hostElement.focus = () => hostElement?.dispatchEvent(new FocusEvent('focus', { bubbles: false }));\n}\n\nexport function isFirefox() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('firefox');\n}\n\nexport function isTouchDevice() {\n return 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n}\n\nexport function isSafari() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('safari') && !userAgent.includes('chrome');\n}\n\n/**\n * Returns the value of a prop if it is defined and included in the `validValues`\n * array. This is used primarily to prevent Vue wrappers from setting aria props\n * to \"Symbol()\" when the prop is not set.\n */\nexport function getAriaValueFromProp(prop: string, validValues?: string[]) {\n if (prop === undefined) return prop;\n if (!validValues) return prop !== 'Symbol()' ? prop : undefined;\n return validValues.includes(prop) || prop === '' ? prop : undefined;\n}\n\nlet guid: number = 1000;\nexport function createGuid(): number {\n return guid++;\n}\n\nexport function nextPaint(fn: (value?: unknown) => void) {\n requestAnimationFrame(() => {\n requestAnimationFrame(fn);\n });\n}\n\nexport function isVisible(element: HTMLElement) {\n return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;\n}\n\nexport function waitForNextPaint() {\n return new Promise(resolve => nextPaint(resolve));\n}\n\nexport function capitalize(value: string) {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n\nexport function pick(props: string[]): (obj: object) => object {\n return obj => {\n return props.reduce((memo, prop) => {\n return {\n ...memo,\n [prop]: obj[prop],\n };\n }, {});\n };\n}\n\nexport function loc(key: string, subs?: IDict<any> | string[]) {\n if (!key) return '';\n if (window.Tecton?.noStrings === true) {\n return key;\n }\n return window?.TectonElements?.loc(key, subs) ?? key;\n}\n\nexport function labelDOM(target: FormFieldTypes | Q2RadioGroup | Q2CheckboxGroup) {\n const { label, hideLabel, optional, readonly } = target;\n const labelClasses: string[] = ['input-label'];\n let helpText = '';\n\n let shouldHideLabel = hideLabel;\n if (!shouldHideLabel) {\n const labelSlotElements = target.hostElement.querySelectorAll<HTMLSlotElement>('[slot=\"label\"]');\n const hasSlotContent = labelSlotElements.length > 0;\n const hasLabel = !!label;\n\n shouldHideLabel = hasLabel || hasSlotContent ? false : true;\n }\n\n if (shouldHideLabel) labelClasses.push('sr');\n if (optional) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.optional')}</span>;\n }\n if (readonly) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.readonly')}</span>;\n labelClasses.push('readonly-field');\n }\n return (\n <label\n htmlFor={target.inputId}\n class={labelClasses.join(' ')}\n >\n <slot name=\"label\">\n {label ? loc(label) : undefined}\n {helpText}\n </slot>\n </label>\n );\n}\n\nexport function hasSlotContent(target: HTMLElement, slotName: string) {\n return target.querySelector(`[slot=\"${slotName}\"]`) !== null;\n}\n\nexport function handleAriaLabel(\n target:\n | Q2Input\n | Q2Select\n | Q2Radio\n | Q2Checkbox\n | Q2EditableField\n | Q2Dropdown\n | Q2DropdownItem\n | Q2Loading\n | Q2Carousel\n | Q2Calendar\n | Q2Btn\n) {\n const { ariaLabel } = target;\n if (!ariaLabel) return;\n\n // If empty ariaLabel prop is set to primitive symbol by framework wrapper, set ariaLabel to undefined and return\n const FW_WRAPPERS_EMPTY_PROP = Symbol().toString();\n if (ariaLabel === FW_WRAPPERS_EMPTY_PROP) {\n target.ariaLabel = undefined;\n return;\n }\n\n // If ariaLabel is set, set hideLabel to true and set label to ariaLabel\n if ('hideLabel' in target) target.hideLabel = true;\n target.label = loc(ariaLabel);\n target.ariaLabel = undefined;\n}\n\n/**\n * Handles when a prop has been renamed on a component without introducing a breaking change.\n */\nexport function handleRenamedProp(target: object, oldProp: string, newProp: string, removeOldProp?: boolean) {\n if (typeof target[oldProp] === 'undefined') return;\n\n // If old prop has value, aka set in component, call handleDeprecationWarning()\n if (target[oldProp]) {\n handleDeprecationWarning(target, oldProp, 'prop');\n }\n\n target[newProp] = target[oldProp];\n\n if (removeOldProp) {\n delete target[oldProp];\n }\n}\n\nexport function handleDeprecationWarning(\n target: object,\n deprecatedItemName: string,\n deprecatedItemType: 'function' | 'prop' | 'method' | 'event'\n) {\n if (window.location.hostname === 'localhost' || window.location.host === 'stack.q2developer.com') {\n if (target[deprecatedItemName] === 'undefined') return;\n\n const componentName = target.constructor.name.toLowerCase().slice(2);\n\n switch (deprecatedItemType) {\n case 'prop':\n if (deprecatedItemName === 'size' && componentName === 'btn') {\n console.warn(\n `The property of size in q2-btn should not be typeof number, or typeof string containing a number. This functionality will be deprecated in an upcoming release. Instead, please use the value 'undefined', or typeof string with any of the following values: \"small\" / \"medium\" / \"large\" `\n );\n } else {\n console.warn(\n `The property ${deprecatedItemName} in q2-${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n }\n break;\n\n case 'function':\n console.warn(\n `The function ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'method':\n console.warn(\n `The method ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'event':\n console.warn(\n `The event ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n default:\n console.error(\n `handleDeprecationWarning --> No type found for desired deprecation: ${deprecatedItemName} in q2-${componentName}: deprecatedItemType = ${deprecatedItemName}`\n );\n }\n }\n}\n\nexport function messagesDOM(target: FormFieldTypes) {\n const type = target.hasError ? 'danger' : 'info';\n\n return (\n <div class=\"messages-container\">\n <q2-message\n appearance=\"minimal\"\n description\n type={type}\n test-id=\"message\"\n >\n <ul id={target.inputDescribedBy}>\n {target.messages.map(message => (\n <li test-id=\"messageListItem\">{loc(message)}</li>\n ))}\n </ul>\n </q2-message>\n </div>\n );\n}\n\nexport function setMessageHeight(target: FormFieldTypes) {\n const messageContainer = (target.hostElement.shadowRoot as ShadowRoot).querySelector<HTMLDivElement>(\n '.messages-container'\n );\n const q2Message = messageContainer.querySelector('q2-message');\n nextPaint(() => {\n const height = target.showMessages && target.hasFocus ? q2Message.getBoundingClientRect().height : 0;\n\n if (messageContainer.style.getPropertyValue('height') === `${height}px`) return;\n\n if (height === 0) {\n q2Message.classList.add('invisible');\n messageContainer.style.removeProperty('height');\n } else {\n q2Message.classList.remove('invisible');\n messageContainer.style.setProperty('height', `${height}px`);\n }\n });\n}\n\nexport const resizeIframe = () => {\n return window.TectonElements?.resizeIframe?.();\n};\n\n// Handling color attribute (deprecated)\nexport const handleColor = (target: Q2Btn) => {\n if (!target.intent && ['primary', 'secondary'].includes(target.color)) {\n target.intent = `workflow-${target.color}` as HTMLQ2BtnElement['intent'];\n target.color = undefined;\n }\n};\n"],"version":3}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as i,g as n}from"./p-a5f18e27.js";import{n as o,l as h,o as a,i as c,w as r,q as l}from"./p-84190698.js";const d="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block;line-height:var(--tct-option-list-line-height, var(--t-option-list-line-height, var(--app-line-height, 1.428571429em)))}.content{text-align:start}:host([is-sizeable]) .content{display:block;height:auto}";const f=d;const p=class{constructor(s){t(this,s);this.change=e(this,"change",7);this.popoverState=e(this,"popoverState",7);this.ready=e(this,"ready",3);this.keyStore={queue:[],lastPressedAt:new Date};this.scheduledAfterRender=[];this.clickHandler=t=>{const e=t.target;const s=e.closest("q2-option");this.selectOption(s);if(this.multiple)return;this.popoverState.emit({open:false,action:"select"})};this.externalKeydownHandler=t=>{t.stopPropagation();const{activeIndex:e,customSearch:s,allOptions:i}=this;const{key:n}=t;let h;switch(n){case" ":if(this.searchString){if(s)break;this.searchOptions(n,true);break}else if(this.type==="menu"){this.activeIndex=0;this.openDropdownWithActiveElement(0)}else{this.setDefaultActiveElement();o((()=>this.popoverState.emit({open:true,action:"open"})))}break;case"Enter":if(this.type==="menu"){this.activeIndex=0;this.openDropdownWithActiveElement(0)}else{this.setDefaultActiveElement();o((()=>this.popoverState.emit({open:true,action:"open"})))}break;case"ArrowUp":t.preventDefault();this.activeIndex=0;h=!!this.selectedOptions.length?this.getDefaultActiveIndex():this.getNextVisibleIndex(-1);if(h===-1)break;this.openDropdownWithActiveElement(h);break;case"ArrowDown":t.preventDefault();this.activeIndex=0;h=!!this.selectedOptions.length?this.getDefaultActiveIndex():this.getNextVisibleIndex(0);if(h===-1)break;this.openDropdownWithActiveElement(h);break;case"Home":t.preventDefault();this.openDropdownWithActiveElement(0);break;case"End":t.preventDefault();this.openDropdownWithActiveElement(i.length-1);break;case"PageUp":t.preventDefault();this.openDropdownWithActiveElement(Math.max((e||0)-10,0));break;case"PageDown":t.preventDefault();this.openDropdownWithActiveElement(Math.min((e||0)+10,i.length-1));break;case"Tab":this.popoverState.emit({open:false,action:"close"});break;case"Esc":case"Escape":if(this.noSelect)this.setActiveElement(null);this.popoverState.emit({open:false,action:"close"});break;default:if(s)break;if(!n.match(/^[\w]$/))break;this.searchOptions(n,true);break}};this.focusoutHandler=t=>{const{relatedTarget:e}=t;const s=this.allOptions.includes(e);const i=!s&&this.hostElement.contains(e);if(s||i){t.stopPropagation()}};this.internalKeydownHandler=t=>{t.stopPropagation();const{activeIndex:e,customSearch:s,allOptions:i,multiple:n}=this;const{key:o,shiftKey:h}=t;let a;switch(o){case" ":if(this.searchString&&!this.multiple){if(s)break;this.searchOptions(o,false);break}t.preventDefault();a=i.find((t=>t.active));if(!a||a.disabled)break;this.selectOption(a);if(n)break;this.popoverState.emit({open:false,action:"select"});break;case"Enter":t.preventDefault();a=i.find((t=>t.active));if(!a||a.disabled)break;this.selectOption(a);if(n)break;this.popoverState.emit({open:false,action:"select"});break;case"ArrowUp":t.preventDefault();const c=e===0;if(c)break;if(e===undefined){this.setDefaultActiveElement();break}else{const t=this.getNextVisibleIndex(-1);if(t===-1)break;this.adjustActiveOptionAndScroll(t-e);break}case"ArrowDown":t.preventDefault();const r=e===i.length-1;if(r)break;if(e===undefined){this.setDefaultActiveElement();break}else{const t=this.getNextVisibleIndex(1);if(t===-1)break;this.adjustActiveOptionAndScroll(t-e);break}case"Home":t.preventDefault();this.openDropdownWithActiveElement(0);break;case"End":t.preventDefault();this.openDropdownWithActiveElement(i.length-1);break;case"PageUp":t.preventDefault();this.openDropdownWithActiveElement(Math.max(e-10,0));break;case"PageDown":t.preventDefault();this.openDropdownWithActiveElement(Math.min(e+10,i.length-1));break;case"Tab":if(h)break;if(this.multiple&&this.type==="listbox")break;a=i.find((t=>t.active));if(!a||a.disabled)return;this.selectOption(a);break;case"Esc":case"Escape":if(this.noSelect)this.setActiveElement(null);this.popoverState.emit({open:false,action:"close"});break;default:if(s)break;if(!o.match(/^[\w]$/))break;this.searchOptions(o,false);break}};this.searchAndFocus=(t,e)=>{const s=()=>{this.pivotIndex=this.pivotIndex===undefined?0:(this.activeIndex||0)+1;const t=this.allOptions.map(((t,e)=>({element:t,index:e})));return[...t.slice(this.pivotIndex),...t.slice(0,this.pivotIndex)]};const i=()=>{const e=new Date;if(e.getTime()-this.keyStore.lastPressedAt.getTime()>1e3){this.keyStore.queue.length=0}if(this.keyStore.queue.length!==1||this.keyStore.queue[0]!==t){this.keyStore.queue.push(t)}this.keyStore.lastPressedAt=e};const n=t=>{const e=this.keyStore.queue.join("");return t.find((t=>!t.element.disabled&&t.element.display&&(t.element.display.match(new RegExp(`^${e}`,"i"))||t.element.display.replace(/\s/g,"").match(new RegExp(`^${e}`,"i")))))};const o=({index:t})=>{if(this.multiple){this.openDropdownWithActiveElement(t)}else{this.activeIndex=t;if(e){this.selectOption(this.allOptions[t]);this.popoverState.emit({open:false,action:"select"})}else this.setActiveElement(t)}};i();const h=n(s());if(h){o(h)}};this.hasOptions=undefined;this.align=undefined;this.customSearch=undefined;this.disabled=undefined;this.label=h("tecton.element.optionList.label");this.multiple=undefined;this.noSelect=undefined;this.selectedOptions=[];this.showSelected=undefined;this.type="listbox"}componentWillLoad(){this.hasOptions=!!this.hostElement.querySelectorAll("q2-option").length}componentDidLoad(){a(this.hostElement);this.checkOptions();this.selectedOptionsUpdated();this.ready.emit()}componentDidRender(){this.scheduledAfterRender.forEach((t=>t()));this.scheduledAfterRender=[]}handleClick(t){t.stopPropagation()}delegateFocus(t){if(!c(t,this.hostElement))return;this.popoverState.emit({open:true,action:"open"});const{activeIndex:e}=this;if(typeof e==="number"&&e>-1){this.setActiveOption();this.setFocusedOption()}else{this.setDefaultActiveElement()}}async getContents(){return this.allContents}async getOptions(){return this.allOptions}async handleExternalKeydown(t){this.externalKeydownHandler(t)}async setActiveElement(t){this.activeIndex=t;this.setActiveOption();this.setFocusedOption()}async setDefaultActiveElement(){this.activeIndex=this.getDefaultActiveIndex();this.setActiveOption();this.setFocusedOption()}selectedOptionsUpdated(){if(this.multiple){this.updateMultipleOptionAttrs()}else{this.updateSingleOptionAttrs()}}showSelectedUpdated(t){if(t&&this.selectedOptions.length===0){this.showSelected=false;return}this.allOptions.forEach((e=>e._multiSelectHidden=t?!e.selected:false))}get allContents(){const t=this.getRootSlot(this.hostElement);const e=["Q2-OPTGROUP","Q2-OPTION"];return t.filter((t=>e.includes(t.tagName)))}get allOptions(){const t=this.allContents;const e=t=>t.reduce(((t,s)=>{if(s.tagName==="Q2-OPTGROUP"){return[...t,...e(Array.from(s.children))]}else if(s.tagName==="Q2-OPTION"){return[...t,s]}else{return t}}),[]);return e(t)}get allVisibleOptions(){return this.allOptions.filter((t=>!t.hidden&&!t._multiSelectHidden&&!t.disabled&&!t.disabledGroup))}adjustActiveOptionAndScroll(t){this.activeIndex+=t;this.setActiveOption();this.setFocusedOption();this.scrollToActiveOption()}async checkOptions(){const{type:t}=this;const e=await this.getOptions();if(!t)return;const s=t==="menu"?"menuitem":"option";e.forEach((t=>{t.role=s}))}focusSelectedSibling(t){const{allVisibleOptions:e,allOptions:s}=this;const i=e.length<2;if(i){this.showSelected=false;return}const n=e.indexOf(t);const o=n?n-1:n+1;const h=e[o];const a=s.indexOf(h);this.activeIndex=a;this.setFocusedOption();this.scheduledAfterRender.push((()=>{t._multiSelectHidden=!t.selected}))}getDefaultActiveIndex(){const{allOptions:t}=this;const e=t.findIndex((t=>t.selected));if(e>-1)return e;const s=t.findIndex((t=>!t.hidden));if(s>-1)return s;return 0}getNextVisibleIndex(t){const{allVisibleOptions:e,allOptions:s,activeIndex:i}=this;const n=s[i];const o=e.indexOf(n);let h=o+t;if(h<0){h=e.length-1}else if(h>e.length-1){h=0}const a=e[h];return s.indexOf(a)}getRootSlot(t){var e;const s=t.querySelector("slot");const i=(e=s===null||s===void 0?void 0:s.assignedElements())!==null&&e!==void 0?e:Array.from(t.children);const n=!!i.length&&i[0].tagName==="SLOT";if(n){return this.getRootSlot(i[0])}else{return i}}async openDropdownWithActiveElement(t){if(this.disabled)return;this.popoverState.emit({open:true,action:"open"});await r();this.activeIndex=t;this.setActiveOption();this.setFocusedOption();this.scrollToActiveOption()}resetTimer(){if(this.searchStringTimer){clearTimeout(this.searchStringTimer)}this.searchStringTimer=window.setTimeout((()=>{this.searchString=null}),2e3)}scrollToActiveOption(){const t=this.allOptions[this.activeIndex];t===null||t===void 0?void 0:t.scrollIntoView({block:"nearest"})}searchOptions(t,e){this.searchString=t;this.searchAndFocus(t,e)}selectOption(t){const{multiple:e,noSelect:s,showSelected:i}=this;if(!t||t.disabled||t.disabledGroup)return;const n=t.value;const o={value:n,display:t.display||t.innerText.trim()};let h=[];if(e){const{selectedOptions:e}=this;const s=e.find((t=>t.value===n));if(s){h=e.filter((({value:t})=>t!==n))}else{h=[...e,o]}if(i)this.focusSelectedSibling(t)}else{h=[o]}if(s)this.setActiveElement(null);else this.selectedOptions=h;this.change.emit({value:n,values:h})}setActiveOption(){const t=this.activeIndex;this.allOptions.forEach(((e,s)=>{e.active=t===s}))}setFocusedOption(){const t=this.allOptions[this.activeIndex];if(!t)return;const e=l(t);if(e)t.focus();else o((()=>t.focus()))}updateMultipleOptionAttrs(){const{allOptions:t,selectedOptions:e}=this;const s=e.map((({value:t})=>t));t.forEach((t=>{t.selected=s.includes(t.value)}))}updateSingleOptionAttrs(){var t;const{allOptions:e,selectedOptions:s}=this;const i=((t=s[0])===null||t===void 0?void 0:t.value)||undefined;e.forEach((t=>{t.selected=t.value===i}))}render(){return s(i,{key:"c96ee2b7016ed9bcb536cca496d16b7f1d82dffc"},s("div",{key:"f70955097de59ed340e319a1e2835837bae0deaa",class:"content",ref:t=>this.contentElement=t,onFocusout:this.focusoutHandler},s("div",{key:"d6bffcdc788da1b0f3871a216cff862e157eaa1a",class:"options","aria-label":h("tecton.element.optionList.label",[this.label]),"aria-multiselectable":`${!!this.multiple}`,role:this.type||"listbox",onKeyDown:this.internalKeydownHandler,onClick:this.clickHandler},s("slot",{key:"bb5f8b8597574fd83b1c2a45438e43072b85d7e1"}))))}get hostElement(){return n(this)}static get watchers(){return{selectedOptions:["selectedOptionsUpdated"],showSelected:["showSelectedUpdated"]}}};p.style=f;export{p as q2_option_list};
|
|
2
|
-
//# sourceMappingURL=p-089a7a1e.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["q2OptionListCss","Q2OptionListStyle0","Q2OptionList","this","keyStore","queue","lastPressedAt","Date","scheduledAfterRender","clickHandler","event","target","option","closest","selectOption","multiple","popoverState","emit","open","action","externalKeydownHandler","stopPropagation","activeIndex","customSearch","allOptions","key","nextIndex","searchString","searchOptions","type","openDropdownWithActiveElement","setDefaultActiveElement","nextPaint","preventDefault","selectedOptions","length","getDefaultActiveIndex","getNextVisibleIndex","Math","max","min","noSelect","setActiveElement","match","focusoutHandler","relatedTarget","isInQ2OptionList","includes","isInLightDom","hostElement","contains","internalKeydownHandler","shiftKey","newOption","find","element","active","disabled","isFirstOptionActive","undefined","adjustActiveOptionAndScroll","isLastOptionActive","searchAndFocus","keyValue","shouldSelect","reorder","pivotIndex","list","map","index","slice","buildQueue","now","getTime","push","searchIndex","keyStr","join","v","display","RegExp","replace","setFocus","matched","loc","componentWillLoad","hasOptions","querySelectorAll","componentDidLoad","overrideFocus","checkOptions","selectedOptionsUpdated","ready","componentDidRender","forEach","fn","handleClick","delegateFocus","isEventFromElement","setActiveOption","setFocusedOption","getContents","allContents","getOptions","handleExternalKeydown","updateMultipleOptionAttrs","updateSingleOptionAttrs","showSelectedUpdated","showSelected","_multiSelectHidden","selected","rootSlot","getRootSlot","acceptedTags","filter","tagName","contents","extractOptions","elements","reduce","acc","Array","from","children","allVisibleOptions","hidden","disabledGroup","numToAdd","scrollToActiveOption","options","optionRole","role","focusSelectedSibling","hasNoSiblings","selectedOptionVisibleIndex","indexOf","nextVisibleSiblingIndex","nextVisibleSibling","nextSiblingIndex","firstSelected","findIndex","firstEnabled","direction","activeOption","visibleActiveOptionIndex","nextVisibleOptionIndex","nextVisibleOption","slot","querySelector","assignedElements","_a","hasAnotherSlot","waitForNextPaint","resetTimer","searchStringTimer","clearTimeout","window","setTimeout","scrollIntoView","block","selectedOption","selectedValue","value","valueObject","innerText","trim","values","isAlreadySelected","change","elementIndex","isOptionVisible","isVisible","focus","selectedValues","render","h","Host","class","ref","el","contentElement","onFocusout","label","onKeyDown","onClick"],"sources":["src/components/q2-option-list/q2-option-list.scss?tag=q2-option-list&encapsulation=shadow","src/components/q2-option-list/q2-option-list.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n position: relative;\n width: 100%;\n display: block;\n line-height: var-list(var-prefixer(option-list-line-height),--app-line-height, 1.428571429em);\n}\n\n.content {\n text-align: start;\n\n :host([is-sizeable]) & {\n display: block;\n height: auto;\n }\n}\n","import {\n Component,\n Prop,\n h,\n Event,\n State,\n Element,\n ComponentInterface,\n Host,\n EventEmitter,\n Method,\n Watch,\n Listen,\n} from '@stencil/core';\nimport { isEventFromElement, isVisible, loc, nextPaint, overrideFocus, waitForNextPaint } from 'src/utils';\n\nexport interface IOptionValue {\n value: string;\n display?: string;\n}\n\n@Component({ tag: 'q2-option-list', shadow: true, styleUrl: 'q2-option-list.scss' })\nexport class Q2OptionList implements ComponentInterface {\n // #region Own Properties\n\n activeIndex: number;\n contentElement: HTMLElement;\n keyStore: {\n queue: string[];\n lastPressedAt: Date;\n } = {\n queue: [],\n lastPressedAt: new Date(),\n };\n pivotIndex: number;\n scheduledAfterRender: (() => void)[] = [];\n searchString: string;\n searchStringTimer: number;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n hasOptions: boolean;\n\n // #endregion\n // #region Public Property API\n\n @Prop({ reflect: true })\n align: 'left' | 'right';\n\n /** Indicates a custom search is being implemented for the option list. */\n @Prop({ reflect: true })\n customSearch: boolean;\n\n /** Disables the option list. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /** Determines the label that is applied to the option list for accessibility purposes. */\n @Prop()\n label: string = loc('tecton.element.optionList.label');\n\n /**\n * Enables the multi-select ability for the option list.\n * @info\n * Only applicable when options are provided.\n */\n @Prop({ reflect: true })\n multiple: boolean;\n\n /** Disables the logic that handles selecting and focusing an option in the option list. */\n @Prop({ reflect: true })\n noSelect: boolean;\n\n /** A list of the selected options on the element. */\n @Prop({ mutable: true })\n selectedOptions: IOptionValue[] = [];\n\n /** Applies focus to the selected option. */\n @Prop({ reflect: true, mutable: true })\n showSelected: boolean;\n\n /** Translates to the role of the option list */\n @Prop()\n type: 'menu' | 'listbox' = 'listbox';\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when an option is selected or deselected.\n *\n * When the multi-select is enabled, the `value` property will be `undefined` and the `selectedOptions` property\n * will contain the selected option values.\n */\n @Event()\n change: EventEmitter<{ value: string; values: IOptionValue[] }>;\n\n /**\n * Emitted to indicate the intended state of the popover.\n * @private\n */\n @Event()\n popoverState: EventEmitter<{ open: boolean; action: 'close' | 'select' | 'open' }>;\n\n /**\n * Emitted when the component has finished rendering.\n * @private\n */\n @Event({ bubbles: false })\n ready: EventEmitter<undefined>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n this.checkOptions();\n this.selectedOptionsUpdated();\n this.ready.emit();\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('click')\n handleClick(event: MouseEvent) {\n event.stopPropagation();\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.popoverState.emit({ open: true, action: 'open' });\n const { activeIndex } = this;\n if (typeof activeIndex === 'number' && activeIndex > -1) {\n this.setActiveOption();\n this.setFocusedOption();\n } else {\n this.setDefaultActiveElement();\n }\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async getContents(): Promise<(HTMLQ2OptgroupElement | HTMLQ2OptionElement)[]> {\n return this.allContents;\n }\n\n @Method()\n async getOptions(): Promise<HTMLQ2OptionElement[]> {\n return this.allOptions;\n }\n\n @Method()\n async handleExternalKeydown(event: KeyboardEvent) {\n this.externalKeydownHandler(event);\n }\n\n @Method()\n async setActiveElement(index: number) {\n this.activeIndex = index;\n this.setActiveOption();\n this.setFocusedOption();\n }\n\n @Method()\n async setDefaultActiveElement() {\n this.activeIndex = this.getDefaultActiveIndex();\n this.setActiveOption();\n this.setFocusedOption();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('selectedOptions')\n selectedOptionsUpdated() {\n if (this.multiple) {\n this.updateMultipleOptionAttrs();\n } else {\n this.updateSingleOptionAttrs();\n }\n }\n\n @Watch('showSelected')\n showSelectedUpdated(showSelected: boolean) {\n if (showSelected && this.selectedOptions.length === 0) {\n this.showSelected = false;\n return;\n }\n this.allOptions.forEach(option => (option._multiSelectHidden = showSelected ? !option.selected : false));\n }\n\n // #endregion\n // #region Local Methods\n\n get allContents(): (HTMLQ2OptgroupElement | HTMLQ2OptionElement)[] {\n const rootSlot = this.getRootSlot(this.hostElement);\n const acceptedTags = ['Q2-OPTGROUP', 'Q2-OPTION'];\n return rootSlot.filter(element => acceptedTags.includes(element.tagName)) as (\n | HTMLQ2OptgroupElement\n | HTMLQ2OptionElement\n )[];\n }\n\n get allOptions(): HTMLQ2OptionElement[] {\n const contents = this.allContents;\n\n const extractOptions = (\n elements: (HTMLQ2OptgroupElement | HTMLQ2OptionElement | Element)[]\n ): HTMLQ2OptionElement[] => {\n return elements.reduce((acc, element) => {\n if (element.tagName === 'Q2-OPTGROUP') {\n return [...acc, ...extractOptions(Array.from(element.children))];\n } else if (element.tagName === 'Q2-OPTION') {\n return [...acc, element];\n } else {\n return acc;\n }\n }, []);\n };\n\n return extractOptions(contents);\n }\n\n get allVisibleOptions(): HTMLQ2OptionElement[] {\n return this.allOptions.filter(\n option => !option.hidden && !option._multiSelectHidden && !option.disabled && !option.disabledGroup\n );\n }\n\n adjustActiveOptionAndScroll(numToAdd: number) {\n this.activeIndex += numToAdd;\n this.setActiveOption();\n this.setFocusedOption();\n this.scrollToActiveOption();\n }\n\n async checkOptions() {\n const { type } = this;\n const options = await this.getOptions();\n if (!type) return;\n const optionRole = type === 'menu' ? 'menuitem' : 'option';\n options.forEach(option => {\n option.role = optionRole;\n });\n }\n\n clickHandler = (event: Event) => {\n const target = event.target as HTMLQ2OptionElement;\n const option = target.closest('q2-option');\n this.selectOption(option);\n if (this.multiple) return;\n this.popoverState.emit({ open: false, action: 'select' });\n };\n\n /* tslint:disable:cyclomatic-complexity */\n externalKeydownHandler = (event: KeyboardEvent) => {\n event.stopPropagation();\n const { activeIndex, customSearch, allOptions } = this;\n const { key } = event;\n\n let nextIndex;\n switch (key) {\n case ' ':\n if (this.searchString) {\n if (customSearch) break;\n\n this.searchOptions(key, true);\n break;\n } else if (this.type === 'menu') {\n this.activeIndex = 0;\n this.openDropdownWithActiveElement(0);\n } else {\n this.setDefaultActiveElement();\n nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));\n }\n break;\n\n case 'Enter':\n if (this.type === 'menu') {\n this.activeIndex = 0;\n this.openDropdownWithActiveElement(0);\n } else {\n this.setDefaultActiveElement();\n nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));\n }\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n this.activeIndex = 0;\n nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(-1);\n if (nextIndex === -1) break;\n this.openDropdownWithActiveElement(nextIndex);\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n this.activeIndex = 0;\n nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(0);\n if (nextIndex === -1) break;\n this.openDropdownWithActiveElement(nextIndex);\n break;\n\n case 'Home':\n event.preventDefault();\n this.openDropdownWithActiveElement(0);\n break;\n\n case 'End':\n event.preventDefault();\n this.openDropdownWithActiveElement(allOptions.length - 1);\n break;\n\n case 'PageUp':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.max((activeIndex || 0) - 10, 0));\n break;\n\n case 'PageDown':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.min((activeIndex || 0) + 10, allOptions.length - 1));\n break;\n\n case 'Tab':\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n case 'Esc':\n case 'Escape':\n if (this.noSelect) this.setActiveElement(null);\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n default:\n if (customSearch) break;\n if (!key.match(/^[\\w]$/)) break;\n\n this.searchOptions(key, true);\n break;\n }\n };\n\n /* tslint:enable:cyclomatic-complexity */\n\n focusoutHandler = (event: FocusEvent) => {\n const { relatedTarget } = event as unknown as { relatedTarget: HTMLQ2OptionElement };\n const isInQ2OptionList = this.allOptions.includes(relatedTarget);\n const isInLightDom = !isInQ2OptionList && this.hostElement.contains(relatedTarget);\n if (isInQ2OptionList || isInLightDom) {\n event.stopPropagation();\n }\n };\n\n focusSelectedSibling(option: HTMLQ2OptionElement) {\n const { allVisibleOptions, allOptions } = this;\n const hasNoSiblings = allVisibleOptions.length < 2;\n if (hasNoSiblings) {\n this.showSelected = false;\n return;\n }\n\n const selectedOptionVisibleIndex = allVisibleOptions.indexOf(option);\n const nextVisibleSiblingIndex = selectedOptionVisibleIndex\n ? selectedOptionVisibleIndex - 1\n : selectedOptionVisibleIndex + 1;\n const nextVisibleSibling = allVisibleOptions[nextVisibleSiblingIndex];\n const nextSiblingIndex = allOptions.indexOf(nextVisibleSibling);\n\n this.activeIndex = nextSiblingIndex;\n this.setFocusedOption();\n this.scheduledAfterRender.push(() => {\n option._multiSelectHidden = !option.selected;\n });\n }\n\n getDefaultActiveIndex() {\n const { allOptions } = this;\n const firstSelected = allOptions.findIndex(element => element.selected);\n if (firstSelected > -1) return firstSelected;\n\n const firstEnabled = allOptions.findIndex(element => !element.hidden);\n if (firstEnabled > -1) return firstEnabled;\n\n return 0;\n }\n\n getNextVisibleIndex(direction) {\n const { allVisibleOptions, allOptions, activeIndex } = this;\n const activeOption = allOptions[activeIndex];\n const visibleActiveOptionIndex = allVisibleOptions.indexOf(activeOption);\n let nextVisibleOptionIndex = visibleActiveOptionIndex + direction;\n\n if (nextVisibleOptionIndex < 0) {\n nextVisibleOptionIndex = allVisibleOptions.length - 1;\n } else if (nextVisibleOptionIndex > allVisibleOptions.length - 1) {\n nextVisibleOptionIndex = 0;\n }\n\n const nextVisibleOption = allVisibleOptions[nextVisibleOptionIndex];\n return allOptions.indexOf(nextVisibleOption);\n }\n\n getRootSlot(element: Element): Element[] {\n const slot = element.querySelector('slot');\n const assignedElements = slot?.assignedElements() ?? Array.from(element.children);\n const hasAnotherSlot = !!assignedElements.length && assignedElements[0].tagName === 'SLOT';\n if (hasAnotherSlot) {\n return this.getRootSlot(assignedElements[0]);\n } else {\n return assignedElements;\n }\n }\n\n internalKeydownHandler = (event: KeyboardEvent) => {\n event.stopPropagation();\n const { activeIndex, customSearch, allOptions, multiple } = this;\n const { key, shiftKey } = event;\n\n let newOption;\n switch (key) {\n case ' ':\n if (this.searchString && !this.multiple) {\n if (customSearch) break;\n\n this.searchOptions(key, false);\n break;\n }\n\n event.preventDefault();\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) break;\n this.selectOption(newOption);\n if (multiple) break;\n this.popoverState.emit({ open: false, action: 'select' });\n break;\n\n case 'Enter':\n event.preventDefault();\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) break;\n this.selectOption(newOption);\n if (multiple) break;\n this.popoverState.emit({ open: false, action: 'select' });\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n const isFirstOptionActive = activeIndex === 0;\n if (isFirstOptionActive) break;\n if (activeIndex === undefined) {\n this.setDefaultActiveElement();\n break;\n } else {\n const nextIndex = this.getNextVisibleIndex(-1);\n if (nextIndex === -1) break;\n this.adjustActiveOptionAndScroll(nextIndex - activeIndex);\n break;\n }\n\n case 'ArrowDown':\n event.preventDefault();\n const isLastOptionActive = activeIndex === allOptions.length - 1;\n if (isLastOptionActive) break;\n if (activeIndex === undefined) {\n this.setDefaultActiveElement();\n break;\n } else {\n const nextIndex = this.getNextVisibleIndex(1);\n if (nextIndex === -1) break;\n this.adjustActiveOptionAndScroll(nextIndex - activeIndex);\n break;\n }\n\n case 'Home':\n event.preventDefault();\n this.openDropdownWithActiveElement(0);\n break;\n\n case 'End':\n event.preventDefault();\n this.openDropdownWithActiveElement(allOptions.length - 1);\n break;\n\n case 'PageUp':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.max(activeIndex - 10, 0));\n break;\n\n case 'PageDown':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.min(activeIndex + 10, allOptions.length - 1));\n break;\n\n case 'Tab':\n if (shiftKey) break;\n if (this.multiple && this.type === 'listbox') break;\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) return;\n this.selectOption(newOption);\n break;\n\n case 'Esc':\n case 'Escape':\n if (this.noSelect) this.setActiveElement(null);\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n default:\n if (customSearch) break;\n if (!key.match(/^[\\w]$/)) break;\n\n this.searchOptions(key, false);\n break;\n }\n };\n\n async openDropdownWithActiveElement(activeIndex: number) {\n if (this.disabled) return;\n this.popoverState.emit({ open: true, action: 'open' });\n await waitForNextPaint();\n this.activeIndex = activeIndex;\n this.setActiveOption();\n this.setFocusedOption();\n this.scrollToActiveOption();\n }\n\n resetTimer() {\n if (this.searchStringTimer) {\n clearTimeout(this.searchStringTimer);\n }\n\n this.searchStringTimer = window.setTimeout(() => {\n this.searchString = null;\n }, 2000);\n }\n\n scrollToActiveOption() {\n const activeOption = this.allOptions[this.activeIndex];\n activeOption?.scrollIntoView({ block: 'nearest' });\n }\n\n searchAndFocus = (keyValue: string, shouldSelect: boolean) => {\n // pseudo search in non-searchable select\n const reorder = () => {\n this.pivotIndex = this.pivotIndex === undefined ? 0 : (this.activeIndex || 0) + 1;\n const list = this.allOptions.map((element, index) => ({ element, index }));\n return [...list.slice(this.pivotIndex), ...list.slice(0, this.pivotIndex)];\n };\n\n const buildQueue = () => {\n const now = new Date();\n if (now.getTime() - this.keyStore.lastPressedAt.getTime() > 1000) {\n // empty stored keys if delay > 1s\n this.keyStore.queue.length = 0;\n }\n if (this.keyStore.queue.length !== 1 || this.keyStore.queue[0] !== keyValue) {\n this.keyStore.queue.push(keyValue);\n }\n this.keyStore.lastPressedAt = now;\n };\n\n const searchIndex = (list: any[]) => {\n const keyStr = this.keyStore.queue.join('');\n return list.find(v => {\n return (\n !v.element.disabled &&\n v.element.display &&\n (v.element.display.match(new RegExp(`^${keyStr}`, 'i')) ||\n v.element.display.replace(/\\s/g, '').match(new RegExp(`^${keyStr}`, 'i')))\n );\n });\n };\n\n const setFocus = ({ index }) => {\n if (this.multiple) {\n // multiple: should open to make sure that which options are selected\n this.openDropdownWithActiveElement(index);\n } else {\n this.activeIndex = index;\n if (shouldSelect) {\n this.selectOption(this.allOptions[index]);\n this.popoverState.emit({ open: false, action: 'select' });\n } else this.setActiveElement(index);\n }\n };\n\n buildQueue();\n const matched = searchIndex(reorder());\n if (matched) {\n setFocus(matched);\n }\n };\n\n searchOptions(key: string, shouldSelect?: boolean) {\n this.searchString = key;\n this.searchAndFocus(key, shouldSelect);\n }\n\n selectOption(selectedOption: HTMLQ2OptionElement) {\n const { multiple, noSelect, showSelected } = this;\n if (!selectedOption || selectedOption.disabled || selectedOption.disabledGroup) return;\n const selectedValue = selectedOption.value;\n const valueObject = {\n value: selectedValue,\n display: selectedOption.display || selectedOption.innerText.trim(),\n };\n\n let values: IOptionValue[] = [];\n if (multiple) {\n const { selectedOptions } = this;\n const isAlreadySelected = selectedOptions.find(option => option.value === selectedValue);\n\n if (isAlreadySelected) {\n values = selectedOptions.filter(({ value }) => value !== selectedValue);\n } else {\n values = [...selectedOptions, valueObject];\n }\n\n if (showSelected) this.focusSelectedSibling(selectedOption);\n } else {\n values = [valueObject];\n }\n\n if (noSelect) this.setActiveElement(null);\n else this.selectedOptions = values;\n\n this.change.emit({ value: selectedValue, values });\n }\n\n setActiveOption() {\n const activeIndex = this.activeIndex;\n\n this.allOptions.forEach((element, elementIndex) => {\n element.active = activeIndex === elementIndex;\n });\n }\n\n setFocusedOption() {\n const option = this.allOptions[this.activeIndex];\n if (!option) return;\n\n const isOptionVisible = isVisible(option);\n if (isOptionVisible) option.focus();\n else nextPaint(() => option.focus());\n }\n\n updateMultipleOptionAttrs() {\n const { allOptions, selectedOptions } = this;\n const selectedValues = selectedOptions.map(({ value }) => value);\n allOptions.forEach(element => {\n element.selected = selectedValues.includes(element.value);\n });\n }\n\n updateSingleOptionAttrs() {\n const { allOptions, selectedOptions } = this;\n const selectedValue = selectedOptions[0]?.value || undefined;\n allOptions.forEach(element => {\n element.selected = element.value === selectedValue;\n });\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <Host>\n <div\n class=\"content\"\n ref={el => (this.contentElement = el)}\n onFocusout={this.focusoutHandler}\n >\n <div\n class=\"options\"\n aria-label={loc('tecton.element.optionList.label', [this.label])}\n aria-multiselectable={`${!!this.multiple}`}\n role={this.type || 'listbox'}\n onKeyDown={this.internalKeydownHandler}\n onClick={this.clickHandler}\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n\n // #endregion\n}\n"],"mappings":"uIAAA,MAAMA,EAAkB,q5BACxB,MAAAC,EAAeD,E,MCqBFE,EAAY,M,gIAKrBC,KAAAC,SAGI,CACAC,MAAO,GACPC,cAAe,IAAIC,MAGvBJ,KAAAK,qBAAuC,GAwOvCL,KAAAM,aAAgBC,IACZ,MAAMC,EAASD,EAAMC,OACrB,MAAMC,EAASD,EAAOE,QAAQ,aAC9BV,KAAKW,aAAaF,GAClB,GAAIT,KAAKY,SAAU,OACnBZ,KAAKa,aAAaC,KAAK,CAAEC,KAAM,MAAOC,OAAQ,UAAW,EAI7DhB,KAAAiB,uBAA0BV,IACtBA,EAAMW,kBACN,MAAMC,YAAEA,EAAWC,aAAEA,EAAYC,WAAEA,GAAerB,KAClD,MAAMsB,IAAEA,GAAQf,EAEhB,IAAIgB,EACJ,OAAQD,GACJ,IAAK,IACD,GAAItB,KAAKwB,aAAc,CACnB,GAAIJ,EAAc,MAElBpB,KAAKyB,cAAcH,EAAK,MACxB,K,MACG,GAAItB,KAAK0B,OAAS,OAAQ,CAC7B1B,KAAKmB,YAAc,EACnBnB,KAAK2B,8BAA8B,E,KAChC,CACH3B,KAAK4B,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MjF,WAAEA,EAAUU,gBAAEA,GAAoB/B,KACxC,MAAM0K,EAAiB3I,EAAgBkC,KAAI,EAAG8F,WAAYA,IAC1D1I,EAAWsE,SAAQvC,IACfA,EAAQuD,SAAW+D,EAAe9H,SAASQ,EAAQ2G,MAAM,G,CAIjE,uBAAAxD,G,MACI,MAAMlF,WAAEA,EAAUU,gBAAEA,GAAoB/B,KACxC,MAAM8J,IAAgBX,EAAApH,EAAgB,MAAE,MAAAoH,SAAA,SAAAA,EAAEY,QAASvG,UACnDnC,EAAWsE,SAAQvC,IACfA,EAAQuD,SAAWvD,EAAQ2G,QAAUD,CAAa,G,CAO1D,MAAAa,GACI,OACIC,EAACC,EAAI,CAAAvJ,IAAA,4CACDsJ,EAAA,OAAAtJ,IAAA,2CACIwJ,MAAM,UACNC,IAAKC,GAAOhL,KAAKiL,eAAiBD,EAClCE,WAAYlL,KAAKyC,iBAEjBmI,EAAA,OAAAtJ,IAAA,2CACIwJ,MAAM,UAAS,aACH7F,EAAI,kCAAmC,CAACjF,KAAKmL,QAAO,uBAC1C,KAAKnL,KAAKY,WAChCoH,KAAMhI,KAAK0B,MAAQ,UACnB0J,UAAWpL,KAAKgD,uBAChBqI,QAASrL,KAAKM,cAEdsK,EAAA,QAAAtJ,IAAA,+C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as o,g as i,h as e}from"./p-a5f18e27.js";import{t as r,w as s}from"./p-84190698.js";const n=class{constructor(i){t(this,i);this.change=o(this,"change",7);this.isCurrentlyFocused=false;this.mouseEventList=["mousedown","dragstart","touchstart"];this.mouseHandler=t=>{const o=this.shadowContains(this.findActiveElement());const i=this.shadowContains(this.shadowEventTarget(t))||this.originatesInSlots(t.target);if(!i&&(this.isCurrentlyFocused||o)){this.isCurrentlyFocused=false;this.change.emit();return}this.isCurrentlyFocused=i||o};this.windowBlurHandler=()=>{this.isCurrentlyFocused=false;this.change.emit()}}connectedCallback(){this.mouseEventList.forEach((t=>{document.addEventListener(t,this.mouseHandler)}));window.addEventListener("blur",this.windowBlurHandler)}disconnectedCallback(){this.mouseEventList.forEach((t=>{document.removeEventListener(t,this.mouseHandler)}));window.removeEventListener("blur",this.windowBlurHandler)}componentWillLoad(){}findActiveElement(){let t=document.activeElement;while(true){if(!t||!t.shadowRoot){return t}t=t.shadowRoot.activeElement}}originatesInSlots(t){const o=this.hostElement.querySelectorAll("slot");for(const i of Array.from(o)){const o=i&&i.assignedNodes&&i.assignedNodes()||this.hostElement.childNodes;for(const i of Array.from(o)){if(i.contains(t)){return true}}}return false}shadowContains(t){while(true){if(t===this.hostElement){return true}if(!t){return false}t=t.parentNode||t.host}}shadowEventTarget(t){return t.composedPath()[0]||t.target}get hostElement(){return i(this)}};const a="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.container{display:none}.show{display:block;position:fixed;z-index:var(--tct-popover-z-index, 50);margin:0;padding:0;overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));color:var(--tct-popover-font-color, var(--t-text, #4d4d4d));min-width:var(--tct-popover-min-width, 135px);margin-block:var(--tct-popover-margin-block, 0);box-shadow:var(--tct-popover-box-shadow, var(--app-shadow-1, 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)));border-width:var(--tct-popover-border-width, 0);border-style:solid;border-color:var(--tct-popover-border-color, transparent);border-radius:var(--tct-popover-border-radius, 0);max-height:var(--comp-pop-max-height);left:var(--comp-pop-left);opacity:var(--comp-pop-opacity, 0);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 4px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}:host([block]) .show{right:unset;width:var(--comp-pop-width);min-width:var(--tct-popover-min-width, unset)}:host([align=left]) .show{left:var(--comp-pop-left);right:unset}:host([align=right]) .show{right:var(--comp-pop-right);left:unset}.show.down{top:var(--tct-popover-top, var(--comp-pop-top));bottom:unset}.show.up{top:unset;bottom:var(--comp-pop-bottom)}.show.legacy{position:absolute}.show::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.show::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.show::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}click-elsewhere{position:relative;display:block}";const c=a;const p=class{constructor(i){t(this,i);this.popoverStateChanged=o(this,"popoverStateChanged",7);this.displayBuffer=10;this.orientationChanged=false;this.handleMinHeight=()=>{if(this.minHeight){r(this,"minHeight","prop")}};this.setAbsoluteCSSProperties=async()=>{const{controlElement:t,containerElement:o,currentDirection:i,align:e}=this;if(e==="right"){o.style.setProperty("--comp-pop-right","0");o.style.setProperty("--comp-pop-left","unset")}else{o.style.setProperty("--comp-pop-left","0");o.style.setProperty("--comp-pop-right","unset")}if(this.block){o.style.setProperty("--comp-pop-width","100%")}if(i==="up"){const i=getComputedStyle(t);const e=parseInt(i.height||"0")+parseInt(i.borderTopWidth||"0")+parseInt(i.borderBottomWidth||"0");o.style.setProperty("--comp-pop-bottom",`${e}px`)}await s();o.style.setProperty("--comp-pop-opacity","1")};this.setFixedCSSProperties=async()=>{var t,o;const{controlElement:i,containerElement:e,currentDirection:r,rootElementRect:n}=this;const{top:a,bottom:c,left:p,right:h}=(o=(t=i===null||i===void 0?void 0:i.getBoundingClientRect)===null||t===void 0?void 0:t.call(i))!==null&&o!==void 0?o:{top:0,bottom:0,left:0,right:0};const l=p-n.left;if(this.block)e.style.setProperty("--comp-pop-width",`${i.offsetWidth||0}px`);e.style.setProperty("--comp-pop-left",`${l}px`);e.style.setProperty("--comp-pop-right",`${n.width+n.left-h}px`);if(r==="up"){e.style.setProperty("--comp-pop-bottom",`${n.height+n.top-a}px`)}if(r==="down"){e.style.setProperty("--comp-pop-top",`${c-n.top}px`)}await s();e.style.setProperty("--comp-pop-opacity","1")};this.viewPortChanged=()=>{if(!this.open)return;this.determinePopDirection()};this.viewPortOrientationChanged=()=>{this.orientationChanged=true;this.viewPortChanged()};this.currentDirection=undefined;this.show=false;this.align=undefined;this.block=undefined;this.controlElement=undefined;this.direction=undefined;this.minHeight=undefined;this.mode=null;this.open=undefined}disconnectedCallback(){this.removeViewportListeners()}componentDidLoad(){this.handleMinHeight();if(this.open)this.determinePopDirection()}popoverStateHandler(t){const{detail:{open:o}}=t;if(o===this.open)return;this.open=o;t.stopPropagation()}async scrollContainerTo(t){this.containerElement.scrollTo(t)}async toggle(){this.open=!this.open}minHeightProvided(){this.handleMinHeight()}async openChanged(t){this.setRootElement();this.popoverStateChanged.emit({open:t});if(t){this.addViewportListeners();this.determinePopDirection()}else{this.removeViewportListeners();this.currentDirection=undefined;this.show=false;await s();this.clearCSSProperties()}}get actualDirection(){const{direction:t}=this;switch(t){case"up":case"down":return t;default:return undefined}}get isModule(){var t,o;const i=window!==window.top;const e=Object.keys((o=(t=window.Tecton)===null||t===void 0?void 0:t.platformDimensions)!==null&&o!==void 0?o:{}).length>0;return i&&e}addViewportListeners(){var t;window.addEventListener("resize",this.viewPortOrientationChanged);window.addEventListener("scroll",this.viewPortChanged,{passive:true,capture:true});(t=screen===null||screen===void 0?void 0:screen.orientation)===null||t===void 0?void 0:t.addEventListener("change",this.viewPortOrientationChanged);window.addEventListener("orientationchange",this.viewPortOrientationChanged)}clearCSSProperties(){this.containerElement.style.removeProperty("--comp-pop-max-height");this.containerElement.style.removeProperty("--comp-pop-top");this.containerElement.style.removeProperty("--comp-pop-bottom");this.containerElement.style.removeProperty("--comp-pop-left");this.containerElement.style.removeProperty("--comp-pop-right");this.containerElement.style.removeProperty("--comp-pop-width");this.containerElement.style.removeProperty("--comp-pop-opacity")}async determinePopDirection(){var t,o,i;const{containerElement:e,controlElement:r,actualDirection:n,displayBuffer:a}=this;if(e)e.style.maxHeight=null;await s();const{isModule:c}=this;const{top:p,bottom:h}=(o=(t=r===null||r===void 0?void 0:r.getBoundingClientRect)===null||t===void 0?void 0:t.call(r))!==null&&o!==void 0?o:{top:0,bottom:0};let l;let d;let u;if(c){const{outletOffset:t=0,innerHeight:o=window.innerHeight}=((i=window.Tecton)===null||i===void 0?void 0:i.platformDimensions)||{};const e=window.visualViewport.height-h;const r=o-(t+h);const s=e<r;l=o;d=(t>0?p:p+t)-a;u=s?e-a:r-a}else{l=window.visualViewport.height;d=p-a;u=l-h-a}const f=d>u?"up":"down";const w=!e.style.getPropertyValue("--comp-pop-max-height")||this.orientationChanged;this.orientationChanged=false;const m=this.currentDirection||n||f;switch(m){case"up":if(w){e.style.setProperty("--comp-pop-max-height",`${d}px`)}this.setDirectionAndShow("up");break;case"down":if(w){e.style.setProperty("--comp-pop-max-height",`${u}px`)}this.setDirectionAndShow("down");break}}removeViewportListeners(){var t;window.removeEventListener("resize",this.viewPortOrientationChanged);window.removeEventListener("scroll",this.viewPortChanged);(t=screen===null||screen===void 0?void 0:screen.orientation)===null||t===void 0?void 0:t.removeEventListener("orientationchange",this.viewPortOrientationChanged);window.removeEventListener("orientationchange",this.viewPortOrientationChanged)}setDirectionAndShow(t){this.setRootElement();const o=this.open;if(!o)return;this.currentDirection=t;this.show=true;if(this.mode==="legacy"){this.setAbsoluteCSSProperties()}else{this.setFixedCSSProperties()}}setRootElement(){let t=this.hostElement;while(t&&t!==document.documentElement){const o=window.getComputedStyle(t);if(o.transform!=="none"||o.filter!=="none"||o.perspective!=="none"||o.containerType!=="normal"||["transform","perspective","filter"].includes(o.willChange)||["layout","paint","strict","content"].includes(o.contain)){this.rootElementRect=t.getBoundingClientRect();return}const i=t.getRootNode();const e=typeof ShadowRoot!=="undefined"&&i instanceof ShadowRoot&&i.host instanceof HTMLElement;if(e){t=i.host}else{t=t.parentElement}}this.rootElementRect={top:0,bottom:0,left:0,right:0,height:window.visualViewport.height,width:window.visualViewport.width}}render(){const t=["container",this.currentDirection];if(this.show)t.push("show");if(this.mode==="legacy")t.push("legacy");return e("div",{key:"a58234dadb51baed9f1013b44ec6f1e2b3459cb0",ref:t=>this.containerElement=t,class:t.join(" "),"test-id":"outerContainer"},e("div",{key:"50fb0083b7eeee5a654e0e9ef405d104cbe08b3c",ref:t=>this.contentElement=t,class:"content"},e("slot",{key:"c3a2cb60d4c19261cb5c8e568505d524f9405580"})))}get hostElement(){return i(this)}static get watchers(){return{minHeight:["minHeightProvided"],open:["openChanged"]}}};p.style=c;export{n as click_elsewhere,p as q2_popover};
|
|
2
|
-
//# sourceMappingURL=p-2e6669a7.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ClickElsewhere","constructor","hostRef","this","isCurrentlyFocused","mouseEventList","mouseHandler","event","shadowContains","findActiveElement","aboutToBeFocused","shadowEventTarget","originatesInSlots","target","change","emit","windowBlurHandler","connectedCallback","forEach","eventName","document","addEventListener","window","disconnectedCallback","removeEventListener","componentWillLoad","workingElement","activeElement","shadowRoot","slots","hostElement","querySelectorAll","currentSlot","Array","from","lightNodes","assignedNodes","childNodes","currentNode","contains","child","parentNode","host","composedPath","q2PopoverCss","Q2PopoverStyle0","Q2Popover","displayBuffer","orientationChanged","handleMinHeight","minHeight","handleDeprecationWarning","setAbsoluteCSSProperties","async","controlElement","containerElement","currentDirection","align","style","setProperty","block","controlStyle","getComputedStyle","controlSize","parseInt","height","borderTopWidth","borderBottomWidth","waitForNextPaint","setFixedCSSProperties","rootElementRect","top","controlTop","bottom","controlBottom","left","controlLeft","right","controlRight","_b","_a","getBoundingClientRect","call","popoverLeft","offsetWidth","width","viewPortChanged","open","determinePopDirection","viewPortOrientationChanged","undefined","removeViewportListeners","componentDidLoad","popoverStateHandler","detail","stopPropagation","scrollContainerTo","options","scrollTo","toggle","minHeightProvided","openChanged","setRootElement","popoverStateChanged","addViewportListeners","show","clearCSSProperties","actualDirection","direction","isModule","isIframe","hasPlatformDimensions","Object","keys","Tecton","platformDimensions","length","passive","capture","screen","orientation","removeProperty","maxHeight","windowHeight","maxSpaceAbove","maxSpaceBelow","outletOffset","innerHeight","_c","distanceToIframeBottom","visualViewport","viewableSpaceBelow","isIframeShorterThanWindow","directionWithMostSpace","shouldUpdateMaxHeight","getPropertyValue","currentOrDetermineDirection","setDirectionAndShow","isOpen","mode","currentElement","documentElement","computedStyle","transform","filter","perspective","containerType","includes","willChange","contain","rootNode","getRootNode","isRootNodeWebComponent","ShadowRoot","HTMLElement","parentElement","render","containerClasses","push","h","key","ref","el","class","join","contentElement"],"sources":["src/components/click-elsewhere/click-elsewhere.tsx","src/components/q2-popover/q2-popover.scss?tag=q2-popover&encapsulation=shadow","src/components/q2-popover/q2-popover.tsx"],"sourcesContent":["import { Component, ComponentInterface, Element, Event, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'click-elsewhere',\n shadow: false,\n})\nexport class ClickElsewhere implements ComponentInterface {\n // #region Own Properties\n\n isCurrentlyFocused: boolean = false;\n /**\n * Listens for mouse and window events that happen outside this click-elsewhere element so we can close popovers when users click outside them\n */\n mouseEventList: string[] = ['mousedown', 'dragstart', 'touchstart'];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the user clicks outside the element\n */\n @Event()\n change: EventEmitter;\n\n // #endregion\n // #region Component Lifecycle Events\n\n /* tslint:enable:no-empty */\n\n connectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.addEventListener(eventName, this.mouseHandler);\n });\n window.addEventListener('blur', this.windowBlurHandler);\n }\n\n disconnectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.removeEventListener(eventName, this.mouseHandler);\n });\n window.removeEventListener('blur', this.windowBlurHandler);\n }\n\n /* TODO: Stencil/Rollup is having issues compiling without this here. Will try to remove in future Stencil upgrade. */\n /* tslint:disable:no-empty */\n componentWillLoad() {}\n\n // #endregion\n // #region Local Methods\n\n findActiveElement(): Element | null {\n let workingElement = document.activeElement!;\n while (true) {\n if (!workingElement || !workingElement.shadowRoot) {\n return workingElement;\n }\n workingElement = workingElement.shadowRoot.activeElement;\n }\n }\n\n mouseHandler = (event: Event): void => {\n const isCurrentlyFocused = this.shadowContains(this.findActiveElement());\n const aboutToBeFocused =\n this.shadowContains(this.shadowEventTarget(event)) || this.originatesInSlots(event.target as Element);\n\n if (!aboutToBeFocused && (this.isCurrentlyFocused || isCurrentlyFocused)) {\n this.isCurrentlyFocused = false;\n this.change.emit();\n return;\n }\n this.isCurrentlyFocused = aboutToBeFocused || isCurrentlyFocused;\n };\n\n originatesInSlots(target: Element): boolean {\n const slots = this.hostElement.querySelectorAll('slot');\n for (const currentSlot of Array.from(slots)) {\n const lightNodes =\n (currentSlot && currentSlot.assignedNodes && currentSlot.assignedNodes()) ||\n this.hostElement.childNodes;\n\n for (const currentNode of Array.from(lightNodes)) {\n if (currentNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n }\n\n shadowContains(child: any): boolean {\n /**\n * shadow-dom enabled version of Node.contains()\n */\n\n while (true) {\n if (child === this.hostElement) {\n return true;\n }\n if (!child) {\n return false;\n }\n child = child.parentNode || child.host;\n }\n }\n\n shadowEventTarget(event: any): Element {\n return event.composedPath()[0] || event.target;\n }\n\n windowBlurHandler = (): void => {\n this.isCurrentlyFocused = false;\n this.change.emit();\n };\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.container {\n display: none;\n}\n\n.show {\n display: block;\n position: fixed;\n z-index: var-list(--tct-popover-z-index, 50);\n margin: 0;\n padding: 0;\n overflow: auto;\n background: var-list(--tct-popover-background, --app-white, #ffffff);\n color: var-list(--tct-popover-font-color, --t-text, #4d4d4d);\n min-width: var-list(--tct-popover-min-width, 135px);\n margin-block: var-list(--tct-popover-margin-block, 0);\n box-shadow: var-list(--tct-popover-box-shadow, --app-shadow-1, unquote(\"0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)\"));\n border-width: var-list(--tct-popover-border-width, 0);\n border-style: solid;\n border-color: var-list(--tct-popover-border-color, transparent);\n border-radius: var-list(--tct-popover-border-radius, 0);\n // the following --comp variables are set via JS\n max-height: var(--comp-pop-max-height);\n left: var(--comp-pop-left);\n opacity: var(--comp-pop-opacity, 0);\n\n :host([block]) & {\n right: unset;\n width: var(--comp-pop-width);\n min-width: var-list(--tct-popover-min-width, unset);\n }\n\n :host([align='left']) & {\n left: var(--comp-pop-left);\n right: unset;\n }\n\n :host([align='right']) & {\n right: var(--comp-pop-right);\n left: unset;\n }\n\n &.down {\n top: var-list(--tct-popover-top, --comp-pop-top);\n bottom: unset;\n }\n\n &.up {\n top: unset;\n bottom: var(--comp-pop-bottom);\n }\n\n &.legacy {\n position: absolute;\n }\n\n @include tiny-scrollbar();\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n","import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Watch,\n Method,\n Listen,\n EventEmitter,\n Event,\n State,\n} from '@stencil/core';\nimport { handleDeprecationWarning, waitForNextPaint } from '../../utils';\n\n@Component({ tag: 'q2-popover', shadow: true, styleUrl: 'q2-popover.scss' })\nexport class Q2Popover implements ComponentInterface {\n // #region Own Properties\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n /** remove when Popover API is supported in iOS */\n orientationChanged: boolean = false;\n rootElementRect: DOMRect;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n currentDirection: 'down' | 'up' = undefined;\n\n // remove `show` when Popover API is supported in iOS\n @State()\n show: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true })\n align: 'left' | 'right';\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop()\n controlElement: HTMLElement;\n\n /**\n * Force the direction of the popover when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop({ reflect: true })\n direction: 'up' | 'down';\n\n /** @deprecated */\n @Prop()\n minHeight: number;\n\n @Prop()\n mode: 'legacy' = null;\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true })\n open: boolean;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event()\n popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.removeViewportListeners();\n }\n\n componentDidLoad() {\n this.handleMinHeight();\n if (this.open) this.determinePopDirection();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('popoverState')\n popoverStateHandler(event: CustomEvent<{ open: boolean }>) {\n const {\n detail: { open },\n } = event;\n if (open === this.open) return;\n\n this.open = open;\n event.stopPropagation();\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\n }\n\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n @Watch('open')\n async openChanged(open: boolean) {\n this.setRootElement();\n this.popoverStateChanged.emit({ open });\n\n if (open) {\n this.addViewportListeners();\n this.determinePopDirection();\n } else {\n this.removeViewportListeners();\n this.currentDirection = undefined;\n this.show = false;\n await waitForNextPaint();\n this.clearCSSProperties();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get actualDirection(): 'up' | 'down' | undefined {\n const { direction } = this;\n switch (direction) {\n case 'up':\n case 'down':\n return direction;\n default:\n return undefined;\n }\n }\n\n get isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\n }\n\n addViewportListeners() {\n window.addEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\n screen?.orientation?.addEventListener('change', this.viewPortOrientationChanged);\n window.addEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n clearCSSProperties() {\n this.containerElement.style.removeProperty('--comp-pop-max-height');\n this.containerElement.style.removeProperty('--comp-pop-top');\n this.containerElement.style.removeProperty('--comp-pop-bottom');\n this.containerElement.style.removeProperty('--comp-pop-left');\n this.containerElement.style.removeProperty('--comp-pop-right');\n this.containerElement.style.removeProperty('--comp-pop-width');\n this.containerElement.style.removeProperty('--comp-pop-opacity');\n }\n\n async determinePopDirection() {\n const { containerElement, controlElement, actualDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n\n if (isModule) {\n const { outletOffset = 0, innerHeight = window.innerHeight } = window.Tecton?.platformDimensions || {};\n const distanceToIframeBottom = window.visualViewport.height - controlBottom;\n const viewableSpaceBelow = innerHeight - (outletOffset + controlBottom);\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n windowHeight = innerHeight;\n // If the top of the module is below the top of the window we just use the controlTop\n // Otherwise we need to add the outletOffset to the controlTop\n maxSpaceAbove = (outletOffset > 0 ? controlTop : controlTop + outletOffset) - displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.visualViewport.height;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || actualDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceAbove}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceBelow}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n handleMinHeight = () => {\n if (this.minHeight) {\n handleDeprecationWarning(this, 'minHeight', 'prop');\n }\n };\n\n removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.removeEventListener('scroll', this.viewPortChanged);\n screen?.orientation?.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n window.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n setAbsoluteCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, align } = this;\n\n if (align === 'right') {\n containerElement.style.setProperty('--comp-pop-right', '0');\n containerElement.style.setProperty('--comp-pop-left', 'unset');\n } else {\n containerElement.style.setProperty('--comp-pop-left', '0');\n containerElement.style.setProperty('--comp-pop-right', 'unset');\n }\n\n if (this.block) {\n containerElement.style.setProperty('--comp-pop-width', '100%');\n }\n\n if (currentDirection === 'up') {\n const controlStyle = getComputedStyle(controlElement);\n const controlSize =\n parseInt(controlStyle.height || '0') +\n parseInt(controlStyle.borderTopWidth || '0') +\n parseInt(controlStyle.borderBottomWidth || '0');\n\n containerElement.style.setProperty('--comp-pop-bottom', `${controlSize}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setDirectionAndShow(direction: 'up' | 'down') {\n this.setRootElement();\n // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the\n // popover can be closed between the time the popover is opened and the time the direction is determined\n const isOpen = this.open;\n if (!isOpen) return;\n\n this.currentDirection = direction;\n this.show = true;\n if (this.mode === 'legacy') {\n this.setAbsoluteCSSProperties();\n } else {\n this.setFixedCSSProperties();\n }\n }\n\n setFixedCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, rootElementRect } = this;\n const {\n top: controlTop,\n bottom: controlBottom,\n left: controlLeft,\n right: controlRight,\n } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n const popoverLeft: number = controlLeft - rootElementRect.left;\n\n if (this.block) containerElement.style.setProperty('--comp-pop-width', `${controlElement.offsetWidth || 0}px`);\n containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);\n containerElement.style.setProperty(\n '--comp-pop-right',\n `${rootElementRect.width + rootElementRect.left - controlRight}px`\n );\n\n if (currentDirection === 'up') {\n containerElement.style.setProperty(\n '--comp-pop-bottom',\n `${rootElementRect.height + rootElementRect.top - controlTop}px`\n );\n }\n if (currentDirection === 'down') {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom - rootElementRect.top}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setRootElement() {\n let currentElement: HTMLElement = this.hostElement;\n\n while (currentElement && currentElement !== document.documentElement) {\n const computedStyle = window.getComputedStyle(currentElement);\n\n // Check if the element has any styles applied that create a new containg block\n if (\n computedStyle.transform !== 'none' ||\n computedStyle.filter !== 'none' ||\n computedStyle.perspective !== 'none' ||\n computedStyle.containerType !== 'normal' ||\n ['transform', 'perspective', 'filter'].includes(computedStyle.willChange) ||\n ['layout', 'paint', 'strict', 'content'].includes(computedStyle.contain)\n ) {\n this.rootElementRect = currentElement.getBoundingClientRect();\n return;\n }\n\n const rootNode = currentElement.getRootNode();\n const isRootNodeWebComponent =\n typeof ShadowRoot !== 'undefined' &&\n rootNode instanceof ShadowRoot &&\n rootNode.host instanceof HTMLElement;\n if (isRootNodeWebComponent) {\n currentElement = rootNode.host;\n } else {\n currentElement = currentElement.parentElement;\n }\n }\n\n // Return the document's bounding rect if no element is found\n this.rootElementRect = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n height: window.visualViewport.height,\n width: window.visualViewport.width,\n } as DOMRect;\n }\n\n viewPortChanged = () => {\n if (!this.open) return;\n this.determinePopDirection();\n };\n\n viewPortOrientationChanged = () => {\n this.orientationChanged = true;\n this.viewPortChanged();\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const containerClasses = ['container', this.currentDirection];\n if (this.show) containerClasses.push('show');\n if (this.mode === 'legacy') containerClasses.push('legacy');\n\n return (\n <div\n ref={el => (this.containerElement = el)}\n class={containerClasses.join(' ')}\n test-id=\"outerContainer\"\n >\n <div\n ref={el => (this.contentElement = el)}\n class=\"content\"\n >\n <slot />\n </div>\n </div>\n );\n }\n\n // #endregion\n}\n"],"mappings":"0GAMaA,EAAc,MAJ3B,WAAAC,CAAAC,G,yCAOIC,KAAAC,mBAA8B,MAI9BD,KAAAE,eAA2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1J,KAAKqD,kBAC5C,GAAIrD,KAAKsG,KAAMoD,EAAiBC,KAAK,QACrC,GAAI3J,KAAKwI,OAAS,SAAUkB,EAAiBC,KAAK,UAElD,OACIC,EAAA,OAAAC,IAAA,2CACIC,IAAKC,GAAO/J,KAAKoD,iBAAmB2G,EACpCC,MAAON,EAAiBO,KAAK,KAAI,UACzB,kBAERL,EAAA,OAAAC,IAAA,2CACIC,IAAKC,GAAO/J,KAAKkK,eAAiBH,EAClCC,MAAM,WAENJ,EAAA,QAAAC,IAAA,8C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,g as n}from"./p-a5f18e27.js";import{d as a}from"./p-be518818.js";import{l as s,h as r,o as d,i as o,w as l,a as c}from"./p-84190698.js";function h(e){const t=new Date(e);if(!a.isValid(t))return;return a.formatISO(t,{representation:"date"})}let u;function f(e){const t=new Date(e);if(!a.isValid(t))return;const i=t.toISOString();if(!u){u=new Intl.DateTimeFormat("en-US",{month:"2-digit",day:"2-digit",year:"numeric",timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone})}return u.format(new Date(i))}let v;function p(e){const t=new Date(e);if(!a.isValid(t))return;if(!v){v=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"})}return v.format(t)}let b;function y(e){if(!e)return;const t=new Date(e);if(!a.isValid(t))return;if(!b){b=new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric",weekday:"long",timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone})}return b.format(t)}function m(e){return e.replace(/[d]/g,"E").replace(/[D]/g,"d").replace(/[Y]/g,"y").replace(/[l]/g,"P").replace(/[W]/g,"I")}function g(e){const t=typeof e==="string";if(!t&&e&&a.isValid(new Date(e||undefined))){e=h(e)}else if(!e||!a.isValid(new Date(e))){return undefined}let i;const n=e.split(/[\/\-]/).map((e=>e.padStart(2,"0")));const s=t&&e.length>=24&&e[10]==="T";const r=n.length===3;const d=n.length<3;if(s){e=e.split("T")[0];i=new Date(e)}else if(r){const t=e.includes("/")&&n[2].length===4;if(t)n.unshift(n.pop());i=new Date(Date.UTC(parseInt(n[0]),parseInt(n[1])-1,parseInt(n[2])))}else if(d){const e=new Date;let t;let a;let s;switch(n.length){case 1:t=e.getFullYear();a=n[0];s="01";break;case 2:t=e.getFullYear();a=n[0];s=n[1];break}i=new Date(`${t}-${a}-${s}`)}if(!a.isValid(i))return undefined;i=w(i);return a.isValid(i)?i:undefined}function w(e){const t=e.getTimezoneOffset();return a.setMinutes(e,t+Math.abs(t%60))}function D(e){if(!Array.isArray(e)||e.length===0){return[]}return e.map((e=>g(e)))}function x(e=new Date){return{monthIndex:e.getMonth(),selectedYear:e.getFullYear()}}function k(e="",t=[],i=[],n=[],r,d,o="mm/dd/yyyy",l){let c=true;let u=false;let f="info";let v=`${s("tecton.element.calendar.hint.format")}: ${o}`;if(!e){return{isValid:c,inputDate:new Date(""),isAvailable:u,messageType:f,message:v}}const b=$(e,l);const y=b.getMonth()+1;const m=b.getDate();const g=b.getFullYear();const w=[y,m,g];if(a.isValid(b)){const a=C()[b.getMonth()];if(e.length===10){c=true;f=null;v=null}u=t.includes(b.getDay());const l=h(b);if(u){const e=i.length&&!i.includes(l);const t=n.length&&n.includes(l);const a=r&&r>l;const s=d&&d<l;if(e||t||a||s){u=false}}if(e.length>=5&&!u){c=false;f="error";const e=!a||!m||!g;v=e?`${s("tecton.element.calendar.hint.invalidDate")}: ${o}`:s("tecton.element.calendar.hint.notAvailableDate",[p(b)])}}else{c=false;f="error";v=`${s("tecton.element.calendar.hint.invalidDate")}: ${o}`}return{isValid:c,messageType:f,message:v,inputDate:b,isAvailable:u,calendarPosition:w}}function $(e,t){const i=new Date;let[n,a,s]=e.split("/");if(n==="0")n="01";if(a==="0")a="01";if(e.length===10){return new Date(e)}else if(n&&a&&Number(a)>0){const e=Number(a)<10?`0${Number(a)}`:a;const i=!s||s.length<4?I(n,a,t):s;return new Date(`${n}/${e}/${i}`)}else if(n){return new Date(`${n}/01/${i.getFullYear()}`)}}function I(e,t,i){const n=`${e}/${t}`;const a=new Date;const s=a.getMonth()<9?`0${a.getMonth()+1}`:`${a.getMonth()+1}`;const r=a.getDate()<10?`0${a.getDate()}`:`${a.getDate()}`;const d=`${s}/${r}/${a.getFullYear()}`;let o=a.getFullYear();if(i==="future"&&d.slice(0,5)>n){o=a.getFullYear()+1}else if(i==="past"&&d.slice(0,5)<n){o=a.getFullYear()-1}return o.toString()}function T(e){if(!e){return""}if(e.match(/^[1-9]\/$/)){return`0${e}/`}else if(e.match(/^[0-9]{2}\/[1-9]{1}\/$/)){const t=e.split("/");return`${t[0]}/0${t[1]}/`}return e}function E(e){const t=(e||"").split("-");if(t.length!==3)return"";return`${t[1]}/${t[2]}/${t[0]}`}function O(e,t){return new Date(t,e,1,1,1,1,1).getDay()}function V(){return[s("tecton.element.calendar.days.short.Sunday"),s("tecton.element.calendar.days.short.Monday"),s("tecton.element.calendar.days.short.Tuesday"),s("tecton.element.calendar.days.short.Wednesday"),s("tecton.element.calendar.days.short.Thursday"),s("tecton.element.calendar.days.short.Friday"),s("tecton.element.calendar.days.short.Saturday")]}function A(){return[s("tecton.element.calendar.days.Sunday"),s("tecton.element.calendar.days.Monday"),s("tecton.element.calendar.days.Tuesday"),s("tecton.element.calendar.days.Wednesday"),s("tecton.element.calendar.days.Thursday"),s("tecton.element.calendar.days.Friday"),s("tecton.element.calendar.days.Saturday")]}function C(){return[s("tecton.element.calendar.months.January"),s("tecton.element.calendar.months.February"),s("tecton.element.calendar.months.March"),s("tecton.element.calendar.months.April"),s("tecton.element.calendar.months.May"),s("tecton.element.calendar.months.June"),s("tecton.element.calendar.months.July"),s("tecton.element.calendar.months.August"),s("tecton.element.calendar.months.September"),s("tecton.element.calendar.months.October"),s("tecton.element.calendar.months.November"),s("tecton.element.calendar.months.December")]}function z(e,t){const i=a.getDaysInMonth(new Date(t,e));return[...Array(i).keys()].reduce(((i,n)=>{i.push(new Date(t,e,n+1));return i}),[])}function q(e=127){const t=e&1;const i=e&2;const n=e&4;const a=e&8;const s=e&16;const r=e&32;const d=e&64;const o=[];if(e<=0)return o;if(t)o.push(0);if(i)o.push(1);if(n)o.push(2);if(a)o.push(3);if(s)o.push(4);if(r)o.push(5);if(d)o.push(6);return o}function S(e,t){return e.includes(t.getDay())}function Y(e,t){return!F(e,t)}function F(e,t){return e.some((e=>a.isSameDay(e,t)))}function M(e,t,i,n,a,s,r){const d=[H.bind(null,s,new Date)];if(t===null||t===void 0?void 0:t.length){d.push(F.bind(null,t))}else{d.push(S.bind(null,e))}d.push(Y.bind(null,i));return L(n,a,s,d,r)}function L({monthIndex:e,selectedYear:t},i,n,s,r){const d=!a.isValid(new Date(r));const o=z(e,t).map(((e,t)=>{const a=s.some((t=>!t(e)));const r=P(e,n,i);const o=j(Object.assign(Object.assign({},r),{isInvalid:a,isIncompleteDate:d}));return Object.assign(Object.assign({},r),{isValid:!a,date:e,integer:t+1,isEmpty:false,isActivity:false,classList:o})}));const l=B(O(e,t));const c=U((l.length+o.length)%7);return[...l,...o,...c]}function H(e,t,i){const n=a.isAfter(e===null||e===void 0?void 0:e.startDate,i);const s=a.isBefore(e===null||e===void 0?void 0:e.endDate,i);const r=a.isSameDay(t,i)&&a.isAfter(t,e===null||e===void 0?void 0:e.cutOffTime);return!(n||r||s)}function P(e,t,i){if(!i)i=new Date;const n=i&&a.isSameDay(i,e);const s=a.isSameDay(e,new Date);const r=a.isSameDay(e,t===null||t===void 0?void 0:t.startDate);const d=a.isSameDay(e,t===null||t===void 0?void 0:t.endDate);return{isSelected:n,isToday:s,isStartDate:r,isEndDate:d}}function j({isInvalid:e,isSelected:t,isEndDate:i,isStartDate:n,isToday:a,isIncompleteDate:s}){const r=[];if(!e)r.push("is-valid");if(t)r.push("is-selected");if(i)r.push("is-end-date");if(n)r.push("is-start-date");if(a)r.push("is-today");if(t&&e&&!s)r.push("is-unavailable");return r.join(" ")}function B(e){return K(0,e)}function U(e){if(e===0)return[];return K(e,7)}const W={date:null,integer:null,isActivity:false,isEmpty:true,isValid:false,isToday:false,isSelected:false,isStartDate:false,isEndDate:false,classList:""};function K(e,t){if(e===7)e=0;return[...Array(t-e).keys()].map((()=>Object.assign({},W)))}const N="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}:host[hidden]{display:none}click-elsewhere{position:relative;display:block}q2-input{margin:0;cursor:pointer}q2-popover{--comp-min-tappable-size:44px;--comp-table-border-spacing:2px;--comp-min-tappable-size-and-spacing:calc(var(--comp-min-tappable-size) + var(--comp-table-border-spacing));--comp-popover-padding:var(--tct-calendar-popover-padding, var(--t-calendar-popover-padding, var(--app-scale-1x, 5px)));--comp-min-table-width:calc(var(--comp-min-tappable-size-and-spacing) * 7);--comp-table-container-border-spacing:calc(var(--comp-table-border-spacing) * 2);--comp-popover-total-padding:calc(var(--comp-popover-padding) * 2);--tct-popover-min-width:calc(\n var(--comp-min-table-width) + var(--comp-table-container-border-spacing) + var(--comp-popover-total-padding)\n )}.calendar-field-popup{padding:var(--comp-popover-padding)}.calendar-label{--comp-label-padding:var(--tct-calendar-label-padding, var(--tct-calendar-label-vertical-padding, var(--t-calendar-label-vertical-padding, var(--tct-scale-2, var(--app-scale-2x, 10px)))) 0);font-size:var(--tct-calendar-label-font-size, var(--t-calendar-label-font-size, 16px));flex:1 1;flex-basis:calc(100% - var(--tct-btn-icon-width, 44px));margin:0;padding:var(--comp-label-padding)}.cal-month-heading{padding:0 0 0.75rem;display:flex;justify-content:center;align-items:center;font-size:var(--tct-calendar-month-font-size, var(--t-calendar-month-font-size, 16px));font-weight:var(--tct-calendar-month-font-weight, var(--t-calendar-month-font-weight, 600));text-align:center}.cal-month-text{min-width:82px;display:inline-block}.cal-year-text{min-width:50px;display:inline-block}table{width:100%;margin-bottom:2px;text-align:center;border-spacing:var(--comp-table-border-spacing)}th{font-size:var(--tct-calendar-day-heading-font-size, var(--t-calendar-day-heading-font-size, inherit));font-weight:var(--tct-calendar-day-heading-font-weight, var(--t-calendar-day-heading-font-weight, 600));width:14.285714%}td{height:var(--comp-min-tappable-size);cursor:pointer;border:var(--tct-calendar-day-border, var(--t-calendar-day-border, 0));border-radius:var(--tct-calendar-day-border-radius, var(--t-calendar-day-border-radius))}td.is-unavailable{border:1px solid var(--tct-input-error-border-color, var(--const-stoplight-alert, #d20a0a))}td.is-valid:hover{border:var(--tct-calendar-day-hover-border, var(--t-calendar-day-hover-border, var(--tct-calendar-day-border, var(--t-calendar-day-border, 0))));border-radius:var(--tct-calendar-day-hover-border-radius, var(--t-calendar-day-hover-border-radius, var(--tct-calendar-day-border-radius, var(--t-calendar-day-border-radius))));background:var(--tct-calendar-day-hover-background, var(--tct-calendar-day-hover-bg, var(--t-calendar-day-hover-bg, var(--tct-gray-14, var(--app-gray14, var(--tct-gray-l4, var(--app-gray-l4, #f2f2f2)))))));color:var(--tct-calendar-day-hover-font-color, var(--t-calendar-day-hover-font-color, inherit))}td[aria-hidden],td[aria-disabled]{pointer-events:none;cursor:not-allowed}td[aria-disabled]{opacity:var(--tct-calendar-day-disabled-opacity, var(--t-calendar-day-disabled-opacity, var(--app-disabled-opacity, 0.4)))}td[aria-selected]{border:var(--tct-calendar-day-selected-border, var(--t-calendar-day-selected-border, var(--tct-calendar-day-border, var(--t-calendar-day-border, 0))));border-radius:var(--tct-calendar-day-selected-border-radius, var(--t-calendar-day-selected-border-radius, var(--tct-calendar-day-border-radius, var(--t-calendar-day-border-radius))));background:var(--tct-calendar-day-selected-background, var(--tct-calendar-day-selected-bg, var(--t-calendar-day-selected-bg, var(--tct-calendar-day-hover-background, var(--tct-calendar-day-hover-bg, var(--t-calendar-day-hover-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l4, var(--app-gray-l4, #f2f2f2))))))))));color:var(--tct-calendar-day-selected-font-color, var(--t-calendar-day-selected-font-color, var(--tct-calendar-day-hover-font-color, var(--t-calendar-day-hover-font-color, inherit))));box-shadow:0 0 0 2px var(--tct-calendar-day-selected-outline-color, var(--t-calendar-day-selected-outline-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))))}td[aria-selected]:focus{box-shadow:0 0 0 2px var(--tct-calendar-day-selected-outline-color, var(--t-calendar-day-selected-outline-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1)))), 0 0 0 4px var(--const-focus-color, #0066cc)}.today-decorator{text-transform:uppercase;font-weight:700;font-size:10px;height:12px}.calendar-disclaimer{font-size:var(--tct-calendar-disclaimer-font-size, var(--t-calendar-disclaimer-font-size, var(--tct-font-size-small, var(--app-font-size-small, 12px))));border-style:solid;border-width:var(--tct-calendar-disclaimer-border-width, var(--t-calendar-disclaimer-border-width, 1px 0 0 0));border-color:var(--tct-calendar-disclaimer-border-color, var(--t-calendar-disclaimer-border-color, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l3, var(--app-gray-l3, #e6e6e6))))));padding:var(--tct-calendar-disclaimer-padding, var(--tct-scale-2, var(--app-scale-2x, 10px)));text-align:left}";const _=N;const J=class{constructor(i){e(this,i);this.change=t(this,"change",7);this.error=t(this,"error",7);this.success=t(this,"success",7);this.dayAbbrStrings=V();this.dayStrings=A();this.defaultFormatString="mm/dd/yyyy";this.formatModifier="M/D/YYYY";this.internalError="";this.monthStrings=C();this.scheduledAfterRender=[];this.closeCalendar=()=>{if(!this.open)return;this.open=false;this.focusInput()};this.goToMonthYear=(e,t)=>{if(e<0){e=11;t--}else if(e>11){e=0;t++}this.selectedMonthYear={monthIndex:e,selectedYear:t};this.dateList=this.buildDateList(this.selectedMonthYear);this.scheduledAfterRender.push((()=>this.checkActiveCellForBlankness()))};this.onClickElsewhere=e=>{const t=e.target;if(t.localName==="click-elsewhere"){e.stopPropagation();this.closeCalendar()}};this.onDateKeydown=e=>{const{monthIndex:t,selectedYear:i}=this.selectedMonthYear;const n=parseInt(e.target.dataset.day);const s=this.generateDateFromDay(n);switch(e.key){case"ArrowUp":e.preventDefault();this.activateDay(a.addDays(s,-7));break;case"ArrowDown":e.preventDefault();this.activateDay(a.addDays(s,7));break;case"ArrowRight":e.preventDefault();this.activateDay(a.addDays(s,1));break;case"ArrowLeft":e.preventDefault();this.activateDay(a.addDays(s,-1));break;case"PageUp":e.preventDefault();if(e.shiftKey)this.goToMonthYear(t,i-1);else this.goToMonthYear(t-1,i);break;case"PageDown":e.preventDefault();if(e.shiftKey)this.goToMonthYear(t,i+1);else this.goToMonthYear(t+1,i);break;case"Home":e.preventDefault();this.activateDay(a.addDays(s,-s.getDay()));break;case"End":e.preventDefault();this.activateDay(a.addDays(s,6-s.getDay()));break;case"Escape":e.preventDefault();this.closeCalendar();this.focusInput();break;case"Enter":e.preventDefault();if(!this.dateList.find((({date:e})=>a.isSameDay(e,s))).isValid)return;this.selectDate(s);this.closeCalendar();this.focusInput();break;case" ":e.preventDefault();if(!this.dateList.find((({date:e})=>a.isSameDay(e,s))).isValid)return;this.selectDate(s);this.closeCalendar();this.focusInput();break}};this.onDateSelection=e=>{const t=e.target.closest("td:not([aria-hidden])");if(!t)return;const i=w(new Date(t.dataset.date));this.selectDate(i);this.closeCalendar()};this.onHeaderControlKeydown=e=>{var t;const i=this.generateDateFromDay(1);const n=(t=this.calendarBody)===null||t===void 0?void 0:t.querySelector('[aria-selected="true"]');if(e.key==="Tab"&&!n){e.preventDefault();this.activateDay(i)}};this.onInputBlur=()=>{if(!this.isTypeable)return;const e=q(this.daysOfWeekChecksum);const{typedValue:t}=this;const{isValid:i,inputDate:n,isAvailable:s}=k(this.typedValue,e,this.validDates,this.invalidDates,this.startDate,this.endDate,this.defaultFormatString,this.assume);if(!t&&(n===null||n===void 0?void 0:n.toString())==="Invalid Date"){this.setHints({isValid:true,message:this.defaultHintMessage,messageType:"info"})}else if(i||t&&t.length>4&&n&&a.isValid(n)&&s){this.setCompleteInput(n)}else if(this.value){this.valueOnBlur=this.value;this.value=null;this.change.emit({value:null});this.typedValue=t}};this.onInputChange=e=>{e.stopPropagation()};this.onInputClick=()=>{if(this.disabled)return;this.toggleCalendar()};this.onInputFocus=e=>{if(!this.isTypeable)return;if(e.target===this.controlElement){if(this.valueOnBlur&&!this.value){const e=this.typedValue;this.value=this.valueOnBlur;this.typedValue=e;this.valueOnBlur=null}this.closeCalendar()}};this.onInputInput=({detail:{value:e}})=>{this.typedValue=e};this.onInputKeydown=e=>{const{dateValue:t}=this;switch(e.key){case"ArrowDown":e.preventDefault();this.openCalendar();this.activateDay(t||new Date);break;case"Enter":case" ":if(this.typeable)break;e.preventDefault();if(this.open){this.closeCalendar()}else{this.openCalendar();this.activateDay(t||new Date)}break}};this.onInputKeyup=e=>{if(this.disabled){return}switch(e.key){case"Escape":this.onInputBlur();this.closeCalendar();break}if(!this.isTypeable)return;this.typedValue=T(this.typedValue);const{typedValue:t}=this;const i=q(this.daysOfWeekChecksum);const{isValid:n,message:s,messageType:r,inputDate:d,isAvailable:o,calendarPosition:l}=k(t,i,this.validDates,this.invalidDates,this.startDate,this.endDate,this.defaultFormatString,this.assume);if(l){const[e,t,i]=l;const n=new Date(i,e-1,t);if(a.isValid(n)){this.selectedMonthYear=x(n);this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}}if(e.key==="Enter"){if(n||t&&t.length>4&&d&&a.isValid(d)&&o){this.setCompleteInput(d)}else if(this.value){this.value=null;this.change.emit({value:null});this.typedValue=t}if(this.keyboardSelection){this.keyboardSelection=false;this.closeCalendar()}else{this.toggleCalendar()}}else{this.setHints({isValid:n,message:s,messageType:r})}};this.onPopupKeyup=e=>{if(e.key==="Escape"||e.key==="Esc"){this.onInputBlur();this.closeCalendar()}};this.onRefocus=()=>{var e;(e=this.btnPrevMonth)===null||e===void 0?void 0:e.dispatchEvent(new FocusEvent("focus"))};this.openCalendar=()=>{if(this.readonly||this.open)return;this.selectedMonthYear=x(this.dateValue);this.dateList=this.buildDateList(this.selectedMonthYear);this.open=true};this.selectDate=e=>{const{isValid:t}=this.dateList.find((({date:t})=>a.isSameDay(t,e)));if(!t)return;this.change.emit({value:h(e)});this.typedValue=f(e);this.invalid=false;this.success.emit({value:h(e)})};this.toggleCalendar=()=>{if(this.readonly)return;if(this.open){this.closeCalendar()}else{this.openCalendar()}};this.dateList=undefined;this.hintMessage=this.defaultHintMessage;this.hintMessageType="info";this.keyboardSelection=false;this.typedValue="";this.ariaLabel=undefined;this.assume="current";this.buttonLabel=undefined;this.calendarLabel=undefined;this.clearable=undefined;this.cutoffTime=undefined;this.daysOfWeekChecksum=undefined;this.disabled=undefined;this.disabledMsg=undefined;this.disclaimer=undefined;this.displayFormat=undefined;this.endDate=undefined;this.errors=undefined;this.hideLabel=undefined;this.hints=undefined;this.invalid=undefined;this.invalidDates=undefined;this.label=undefined;this.onsuccess=undefined;this.open=undefined;this.optional=undefined;this.placeholder=undefined;this.popDirection=undefined;this.popoverAlignment=undefined;this.popoverDirection=undefined;this.popoverMinHeight=355;this.popoverMode=null;this.readonly=undefined;this.startDate=undefined;this.typeable=undefined;this.validDates=undefined;this.value=undefined}connectedCallback(){this.selectedMonthYear=x(this.dateValue);this.dateList=this.buildDateList(this.selectedMonthYear);if(this.value&&this.isTypeable&&!this.typedValue){this.typedValue=E(this.value)}this.validateDate()}componentWillLoad(){this.popDirectionHandler();r(this)}componentDidLoad(){d(this.hostElement)}componentDidRender(){setTimeout((()=>{this.scheduledAfterRender.forEach((e=>e()));this.scheduledAfterRender=[]}),25)}defaultChangeHandler(e){if(e.target===this.hostElement&&!this.hostElement.onchange&&!!e.detail){this.value=e.detail.value}}handleClear(){this.change.emit({value:null});this.value=null;this.typedValue=""}defaultErrorHandler(e){if(e.target===this.hostElement&&!this.hostElement.onerror){if(this.hintMessageType==="error"&&this.hintMessage){this.internalError=this.hintMessage}else{this.internalError=s("tecton.element.calendar.hint.invalidDate")}}}delegateFocus(e){if(!o(e,this.hostElement))return;this.controlElement.shadowRoot.querySelector(".input-field").focus()}popoverStateHandler({detail:{open:e}}){if(this.open!==e)this.open=e}defaultSuccessHandler(e){if(e.target!==this.hostElement){return}if(typeof this.onsuccess==="function"){this.onsuccess(e)}else{this.internalError="";if(this.hintMessageType==="error"&&this.hintMessage){this.hintMessage=null;this.hintMessageType=null;this.invalid=false}}}async closePopover(){if(!this.open)return;this._togglePopover()}async openPopover(){if(this.open)return;this._togglePopover()}async setValue(e){var t;const i=typeof e==="string"?g(e):e;if(!a.isValid(i))return;await this.openPopover();await l();this.goToMonthYear(i.getMonth(),i.getFullYear());await l();const n=(t=this.calendarTable)===null||t===void 0?void 0:t.querySelector(`td[data-date="${h(i)}"]`);n===null||n===void 0?void 0:n.click()}async typeValue(e){if(!this.typeable)return;const t=typeof e==="string"?g(e):e;const i=f(t);if(!a.isValid(t))return;const{innerInputField:n,controlElement:s}=this;n.focus();n.dispatchEvent(new FocusEvent("focus"));n.value=i;n.dispatchEvent(new InputEvent("input"));s.dispatchEvent(new KeyboardEvent("keyup"))}ariaLabelObserver(){r(this)}cutoffTimeObserver(){this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}daysOfWeekChecksumObserver(){this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}endDateObserver(){this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}invalidDatesObserver(){this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}popDirectionHandler(){c(this,"popDirection","popoverDirection")}startDateObserver(){this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}typeableChanged(){this.valueObserver(this.value)}validDatesObserver(){this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}valueObserver(e){if(e===""){this.value=undefined;this.setHints({isValid:true,message:this.defaultHintMessage,messageType:"info"});return}const t=e&&typeof e!=="string"&&"toDate"in e;const i=t?e.toDate():g(e);const n=f(i);if(this.isTypeable){this.typedValue=n}else{this.controlElement.value=n;this.selectedMonthYear=x(i);this.dateList=this.buildDateList(this.selectedMonthYear);this.validateDate()}if(this.invalid)return;if(n){this.setHints({isValid:true,message:null,messageType:null})}else{this.setHints({isValid:true,message:this.defaultHintMessage,messageType:"info"})}}get canClear(){if(this.isTypeable){return this.clearable&&!!this.typedValue}else{return this.clearable&&!!this.value}}get computedPlaceholder(){if(this.disabled&&this.disabledMsg){return s(this.disabledMsg)}if(this.buttonLabel&&(this.disabled||this.placeholder)){return s(this.buttonLabel)}return this.placeholder&&s(this.placeholder)||""}get currentWeeks(){const e=this.dateList.reduce(((e,t,i)=>{const n=Math.floor(i/7);if(!e[n]){e[n]=[]}e[n].push(t);return e}),[]);return e}get dateValidators(){const e=new Date(this.cutoffTime||"");return{startDate:g(this.startDate),endDate:g(this.endDate),cutOffTime:a.isValid(e)?e:undefined}}get dateValue(){if(this.isTypeable){return g(this.typedValue)}else{let{value:e}=this;const t=e&&typeof e!=="string"&&"toDate"in e;if(t)return e.toDate();const i=typeof e==="string"&&e.split(" ").length===6&&/GMT-\d{4}/g.test(e);if(i){e=h(e)}return g(e)}}get defaultHintMessage(){return this.typeable?s("tecton.element.calendar.hint.format")+": "+this.defaultFormatString:s("tecton.element.calendar.hint.select")}get errorList(){const{errors:e,internalError:t,invalid:i}=this;let n=[];if(t){n=[t]}if(Array.isArray(e)&&e.length){n=e.filter((e=>!!e)).map((e=>s(e))).concat(n)}else if(!t&&i){return["tecton.element.calendar.invalid"]}return n}get formattedValue(){const{typedValue:e,dateValue:t,displayFormat:i,isTypeable:n}=this;if(n)return e;if(t===undefined)return"";if(i)return a.format(t,m(i));return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}).format(t)}get hintList(){const{hints:e,hintMessageType:t,hintMessage:i}=this;if(Array.isArray(e)&&e.length)return e.filter((e=>!!e)).map((e=>s(e)));if(t==="info"&&i)return[i];return[]}get innerInputContainer(){var e,t;return(t=(e=this.controlElement)===null||e===void 0?void 0:e.shadowRoot)===null||t===void 0?void 0:t.querySelector(".input-container")}get innerInputField(){var e,t;return(t=(e=this.controlElement)===null||e===void 0?void 0:e.shadowRoot)===null||t===void 0?void 0:t.querySelector(".input-field")}get isTypeable(){return this.typeable}get selectedDate(){var e;const t=(e=this.calendarBody)===null||e===void 0?void 0:e.querySelector('[aria-selected="true"]');return t?w(new Date(t.dataset.date)):null}_togglePopover(){const e=this.typeable?this.btnCalendarToggle:this.innerInputField;e===null||e===void 0?void 0:e.click();e===null||e===void 0?void 0:e.focus();e.dispatchEvent(new FocusEvent("focus"))}activateDay(e){this.goToMonthYear(e.getMonth(),e.getFullYear());this.scheduledAfterRender.push((()=>this.focusDay(e)))}buildDateList(e){const t=D(this.invalidDates);const i=q(this.daysOfWeekChecksum);const n=D(this.validDates);return M(i,n,t,e,this.dateValue,this.dateValidators,this.typedValue)}calendarDays(){return i("table",{role:"grid","aria-labelledby":"table-label",ref:e=>this.calendarTable=e},i("thead",null,i("tr",null,[...Array(7).keys()].map((e=>i("th",{scope:"col","aria-label":this.dayStrings[e]},this.dayAbbrStrings[e]))))),i("tbody",{onClick:this.onDateSelection,onKeyDown:this.onDateKeydown,ref:e=>this.calendarBody=e,"test-id":"calendarTableBody"},this.currentWeeks.map((e=>i("tr",null,e.map((e=>{var t;let n="";if(e.isToday)n=`${s("tecton.element.calendar.today")}, `;n+=y(e.date);if(e.isSelected)n+=` (${s("tecton.element.calendar.selected")})`;return i("td",{class:e.classList,"aria-hidden":e.isEmpty?"true":undefined,tabindex:e.isSelected?0:-1,role:e.isSelected?"gridcell":undefined,"aria-selected":e.isSelected?"true":undefined,"aria-disabled":e.isValid?undefined:"true","data-day":e.integer||undefined,"data-date":e.date?h(e.date):undefined},(e===null||e===void 0?void 0:e.isToday)&&i("div",{class:"today-decorator","aria-hidden":"true"},s("tecton.element.calendar.today")),i("div",{"aria-label":n},(t=e===null||e===void 0?void 0:e.integer)!==null&&t!==void 0?t:""))})))))))}calendarPopover(){const{monthIndex:e,selectedYear:t}=this.selectedMonthYear;return i("div",{class:"calendar-field-popup",onKeyUp:this.onPopupKeyup},this.calendarLabel&&i("p",{class:"calendar-label"},s(this.calendarLabel)),i("div",{class:"cal-month-heading"},i("q2-btn",{label:s("tecton.element.calendar.previousMonth"),"hide-label":true,ref:e=>this.btnPrevMonth=e,class:"cal-nav-btn prev-month","test-id":"previousMonthButton",onClick:()=>this.goToMonthYear(e-1,t)},i("q2-icon",{type:"chevron-left"})),i("span",{class:"cal-month-text"},this.monthStrings[e]),i("q2-btn",{label:s("tecton.element.calendar.nextMonth"),"hide-label":true,class:"cal-nav-btn next-month",ref:e=>this.btnNextMonth=e,"test-id":"nextMonthButton",onClick:()=>this.goToMonthYear(e+1,t)},i("q2-icon",{type:"chevron-right"})),i("q2-btn",{label:s("tecton.element.calendar.previousYear"),"hide-label":true,class:"cal-nav-btn prev-year",ref:e=>this.btnPrevYear=e,"test-id":"previousYearButton",onClick:()=>this.goToMonthYear(e,t-1)},i("q2-icon",{type:"chevron-left"})),i("span",{class:"cal-year-text"},this.selectedMonthYear.selectedYear),i("q2-btn",{label:s("tecton.element.calendar.nextYear"),"hide-label":true,class:"cal-nav-btn next-year",ref:e=>this.btnNextYear=e,"test-id":"nextYearButton",onClick:()=>this.goToMonthYear(e,t+1),onKeyDown:this.onHeaderControlKeydown},i("q2-icon",{type:"chevron-right"}))),i("div",{class:"sr","aria-live":"polite",id:"table-label"},`${this.monthStrings[e]} ${t}`),this.calendarDays(),this.disclaimer&&i("div",{class:"calendar-disclaimer"},s(this.disclaimer)),i("q2-btn",{class:"sr refocus-popup",onFocus:this.onRefocus}))}checkActiveCellForBlankness(){const e=this.hostElement.shadowRoot.activeElement;if(!e||e.tagName!=="TD"||!e.hasAttribute("aria-hidden"))return;const{calendarBody:t}=this;const i=Array.from(t.querySelectorAll("td"));const n=Array.from(i).indexOf(e);const a=n<15?1:i.filter((e=>!e.hasAttribute("aria-hidden"))).length;this.focusDay(this.generateDateFromDay(a))}async focusDay(e){var t;if(!e)return;await l();(t=this.calendarBody.querySelector(`td[data-day="${e.getDate()}"]`))===null||t===void 0?void 0:t.focus()}focusInput(){var e;(e=this.controlElement)===null||e===void 0?void 0:e.focus()}generateDateFromDay(e){const{monthIndex:t,selectedYear:i}=this.selectedMonthYear;return new Date(i,t,e)}hintField(){if(!this.hintMessage)return;return i("q2-message",{class:"calendar-hint sr",ref:e=>this.hintMessageElement=e,type:this.hintMessageType},this.hintMessage)}inputField(){const{isTypeable:e}=this;return i("q2-input",{ref:e=>this.controlElement=e,class:"calendar-input-field",value:this.formattedValue,label:s(this.label),hideLabel:this.hideLabel,disabled:!!this.disabled,readonly:!!this.readonly,clearable:this.canClear,placeholder:this.computedPlaceholder,optional:!!this.optional,ariaExpanded:`${!!this.open}`,hints:this.hintList,errors:this.errorList,onClick:e?undefined:this.onInputClick,onChange:this.onInputChange,onInput:this.onInputInput,onKeyDown:this.onInputKeydown,onKeyUp:this.onInputKeyup,onBlur:this.onInputBlur,onFocus:this.onInputFocus,"icon-right":e?undefined:"calendar","format-modifier":e?this.formatModifier:this.displayFormat||this.formatModifier,type:"date","hide-messages":!e,"test-id":"inputAndCalendarToggle",_role:"combobox",_preventEntry:!e},e&&i("q2-btn",{ref:e=>this.btnCalendarToggle=e,slot:"input-right",onClick:this.onInputClick,"test-id":"calendarToggle",label:"tecton.element.calendar.toggleAriaLabel","hide-label":true},i("q2-icon",{type:"calendar"})))}setCompleteInput(e){const t=f(e);this.change.emit({value:h(e)});this.typedValue=t;this.internalError=null;this.setHints({isValid:true,message:null,messageType:null})}setHints({isValid:e,message:t,messageType:i}){var n;if(t===this.hintMessage)return(n=this.hintMessageElement)===null||n===void 0?void 0:n.present();this.invalid=!e;this.hintMessage=t;this.hintMessageType=i;if(i==="error"&&t){this.internalError=t;this.error.emit({errors:[{message:t,errorCode:"generalInvalid"}]})}}validateDate(){var e,t,i;try{if(!!this.value){const{dateValue:n}=this;const a=(e=n===null||n===void 0?void 0:n.getMonth())!==null&&e!==void 0?e:undefined;const s=(t=n===null||n===void 0?void 0:n.getFullYear())!==null&&t!==void 0?t:undefined;const{monthIndex:r,selectedYear:d}=this.selectedMonthYear;const o=a===r&&s===d;let l=[];if(!n){l=[]}else if(o){l=this.dateList}else{l=this.buildDateList({monthIndex:a,selectedYear:s})}const c=(i=n===null||n===void 0?void 0:n.getDate())!==null&&i!==void 0?i:undefined;const u=c?!l.find((({integer:e})=>e===c)).isValid:true;if(u){this.error.emit({errors:[{message:`Value passed is invalid: The date ${this.value} is not valid`,errorCode:"generalInvalid"}]})}else{this.success.emit({value:h(n)})}}}catch(e){console.warn("Invalid moment value ",this.dateValue)}}render(){return i("click-elsewhere",{key:"8d3332cbdb66fe4255d57d2b0e02e8a8a9d1ad75",class:this.open?"dropdown-open":undefined,onChange:this.onClickElsewhere},this.inputField(),i("q2-popover",{key:"4ae9a6156dd618bd0106920f4aaf48549e00ddec",ref:e=>this.popoverElement=e,controlElement:this.innerInputContainer,open:this.open,direction:this.popoverDirection,minHeight:this.popoverMinHeight,align:this.popoverAlignment,mode:this.popoverMode||undefined,block:true},this.hintField(),this.calendarPopover()))}get hostElement(){return n(this)}static get watchers(){return{ariaLabel:["ariaLabelObserver"],cutoffTime:["cutoffTimeObserver"],daysOfWeekChecksum:["daysOfWeekChecksumObserver"],endDate:["endDateObserver"],invalidDates:["invalidDatesObserver"],popDirection:["popDirectionHandler"],startDate:["startDateObserver"],typeable:["typeableChanged"],validDates:["validDatesObserver"],value:["valueObserver"]}}};J.style=_;export{J as q2_calendar};
|
|
2
|
-
//# sourceMappingURL=p-4da4cb5d.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./p-a5f18e27.js";function n(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(navigator.userAgent)}function i(e,n){const i=e.type;const o=["focusin","focus"];const t=o.includes(i);const r=t?e.target:e.relatedTarget;const a=e=>{if(e===n)return true;if(e.parentElement){return a(e.parentElement)}return false};if(!(r instanceof HTMLElement))return true;return!a(r)}function o(e,n){return e.relatedTarget!==n&&!n.contains(e.relatedTarget)}function t(e,n){var i;return((i=e.composedPath)===null||i===void 0?void 0:i.call(e)[0])===n}function r(e){e.focus=()=>e===null||e===void 0?void 0:e.dispatchEvent(new FocusEvent("focus",{bubbles:false}))}function a(){const e=navigator.userAgent.toLowerCase();return e.includes("firefox")}function s(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function l(e,n){if(e===undefined)return e;if(!n)return e!=="Symbol()"?e:undefined;return n.includes(e)||e===""?e:undefined}let u=1e3;function d(){return u++}function c(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}function f(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function m(){return new Promise((e=>c(e)))}function p(e,n){var i,o,t;if(!e)return"";if(((i=window.Tecton)===null||i===void 0?void 0:i.noStrings)===true){return e}return(t=(o=window===null||window===void 0?void 0:window.TectonElements)===null||o===void 0?void 0:o.loc(e,n))!==null&&t!==void 0?t:e}function b(n){const{label:i,hideLabel:o,optional:t,readonly:r}=n;const a=["input-label"];let s="";let l=o;if(!l){const e=n.hostElement.querySelectorAll('[slot="label"]');const o=e.length>0;const t=!!i;l=t||o?false:true}if(l)a.push("sr");if(t){s=e("span",{class:"optional-tag"},p("tecton.element.input.optional"))}if(r){s=e("span",{class:"optional-tag"},p("tecton.element.input.readonly"));a.push("readonly-field")}return e("label",{htmlFor:n.inputId,class:a.join(" ")},e("slot",{name:"label"},i?p(i):undefined,s))}function v(e,n){return e.querySelector(`[slot="${n}"]`)!==null}function h(e){const{ariaLabel:n}=e;if(!n)return;const i=Symbol().toString();if(n===i){e.ariaLabel=undefined;return}if("hideLabel"in e)e.hideLabel=true;e.label=p(n);e.ariaLabel=undefined}function w(e,n,i,o){if(typeof e[n]==="undefined")return;if(e[n]){g(e,n,"prop")}e[i]=e[n];if(o){delete e[n]}}function g(e,n,i){if(window.location.hostname==="localhost"||window.location.host==="stack.q2developer.com"){if(e[n]==="undefined")return;const o=e.constructor.name.toLowerCase().slice(2);switch(i){case"prop":if(n==="size"&&o==="btn"){console.warn(`The property of size in q2-btn should not be typeof number, or typeof string containing a number. This functionality will be deprecated in an upcoming release. Instead, please use the value 'undefined', or typeof string with any of the following values: "small" / "medium" / "large" `)}else{console.warn(`The property ${n} in q2-${o} has been marked for deprecation and will be removed in an upcoming major release.`)}break;case"function":console.warn(`The function ${n} in ${o} has been marked for deprecation and will be removed in an upcoming major release.`);break;case"method":console.warn(`The method ${n} in ${o} has been marked for deprecation and will be removed in an upcoming major release.`);break;case"event":console.warn(`The event ${n} in ${o} has been marked for deprecation and will be removed in an upcoming major release.`);break;default:console.error(`handleDeprecationWarning --\x3e No type found for desired deprecation: ${n} in q2-${o}: deprecatedItemType = ${n}`)}}}function y(n){const i=n.hasError?"danger":"info";return e("div",{class:"messages-container"},e("q2-message",{appearance:"minimal",description:true,type:i,"test-id":"message"},e("ul",{id:n.inputDescribedBy},n.messages.map((n=>e("li",{"test-id":"messageListItem"},p(n)))))))}function $(e){const n=e.hostElement.shadowRoot.querySelector(".messages-container");const i=n.querySelector("q2-message");c((()=>{const o=e.showMessages&&e.hasFocus?i.getBoundingClientRect().height:0;if(n.style.getPropertyValue("height")===`${o}px`)return;if(o===0){i.classList.add("invisible");n.style.removeProperty("height")}else{i.classList.remove("invisible");n.style.setProperty("height",`${o}px`)}}))}const k=()=>{var e,n;return(n=(e=window.TectonElements)===null||e===void 0?void 0:e.resizeIframe)===null||n===void 0?void 0:n.call(e)};const q=e=>{if(!e.intent&&["primary","secondary"].includes(e.color)){e.intent=`workflow-${e.color}`;e.color=undefined}};export{w as a,s as b,d as c,n as d,b as e,v as f,o as g,h,t as i,i as j,a as k,p as l,y as m,c as n,r as o,l as p,f as q,k as r,$ as s,g as t,q as u,m as w};
|
|
2
|
-
//# sourceMappingURL=p-84190698.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isMobile","test","navigator","userAgent","isHostLosingFocus","event","hostElement","type","focusInTypes","isFocusIn","includes","elementGainingFocus","target","relatedTarget","isElementNestedInHostElement","element","parentElement","HTMLElement","isRelatedTargetWithinHost","contains","isEventFromElement","_a","composedPath","call","overrideFocus","focus","dispatchEvent","FocusEvent","bubbles","isFirefox","toLowerCase","isTouchDevice","window","maxTouchPoints","getAriaValueFromProp","prop","validValues","undefined","guid","createGuid","nextPaint","fn","requestAnimationFrame","isVisible","offsetWidth","offsetHeight","getClientRects","length","waitForNextPaint","Promise","resolve","loc","key","subs","Tecton","noStrings","_c","_b","TectonElements","labelDOM","label","hideLabel","optional","readonly","labelClasses","helpText","shouldHideLabel","labelSlotElements","querySelectorAll","hasSlotContent","hasLabel","push","h","class","htmlFor","inputId","join","name","slotName","querySelector","handleAriaLabel","ariaLabel","FW_WRAPPERS_EMPTY_PROP","Symbol","toString","handleRenamedProp","oldProp","newProp","removeOldProp","handleDeprecationWarning","deprecatedItemName","deprecatedItemType","location","hostname","host","componentName","constructor","slice","console","warn","error","messagesDOM","hasError","appearance","description","id","inputDescribedBy","messages","map","message","setMessageHeight","messageContainer","shadowRoot","q2Message","height","showMessages","hasFocus","getBoundingClientRect","style","getPropertyValue","classList","add","removeProperty","remove","setProperty","resizeIframe","handleColor","intent","color"],"sources":["src/utils/index.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { Q2Btn } from 'src/components/q2-btn/q2-btn';\nimport { Q2Calendar } from 'src/components/q2-calendar/q2-calendar';\nimport { Q2Carousel } from 'src/components/q2-carousel/q2-carousel';\nimport { Q2Checkbox } from 'src/components/q2-checkbox/q2-checkbox';\nimport { Q2CheckboxGroup } from 'src/components/q2-checkbox-group/q2-checkbox-group';\nimport { Q2RadioGroup } from 'src/components/q2-radio-group/q2-radio-group';\nimport { Q2Dropdown } from 'src/components/q2-dropdown/q2-dropdown';\nimport { Q2DropdownItem } from 'src/components/q2-dropdown-item/q2-dropdown-item';\nimport { Q2EditableField } from 'src/components/q2-editable-field/q2-editable-field';\nimport { Q2Input } from 'src/components/q2-input/q2-input';\nimport { Q2Loading } from 'src/components/q2-loading/q2-loading';\nimport { Q2Radio } from 'src/components/q2-radio/q2-radio';\nimport { Q2Select } from 'src/components/q2-select/q2-select';\nimport { FormFieldTypes, IDict } from 'src/util';\n\nexport function isMobile(): boolean {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(\n navigator.userAgent\n );\n}\n\nexport function isHostLosingFocus(event: FocusEvent, hostElement: HTMLElement) {\n const type = event.type;\n const focusInTypes = ['focusin', 'focus'];\n const isFocusIn = focusInTypes.includes(type);\n\n // on focusin: `target` is element losing focus, `relatedTarget` is element gaining focus\n // on focusout: `target` is element gaining focus, `relatedTarget` is element losing focus\n const elementGainingFocus = isFocusIn ? event.target : event.relatedTarget;\n\n const isElementNestedInHostElement = (element: HTMLElement) => {\n if (element === hostElement) return true;\n if (element.parentElement) {\n return isElementNestedInHostElement(element.parentElement);\n }\n return false;\n };\n\n if (!(elementGainingFocus instanceof HTMLElement)) return true;\n return !isElementNestedInHostElement(elementGainingFocus);\n}\n\nexport function isRelatedTargetWithinHost(event: FocusEvent, element: HTMLElement) {\n return event.relatedTarget !== element && !element.contains(event.relatedTarget as Node);\n}\n\nexport function isEventFromElement(event: Event, element: HTMLElement): boolean {\n return event.composedPath?.()[0] === element;\n}\n\nexport function overrideFocus(hostElement: HTMLElement) {\n hostElement.focus = () => hostElement?.dispatchEvent(new FocusEvent('focus', { bubbles: false }));\n}\n\nexport function isFirefox() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('firefox');\n}\n\nexport function isTouchDevice() {\n return 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n}\n\nexport function isSafari() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('safari') && !userAgent.includes('chrome');\n}\n\n/**\n * Returns the value of a prop if it is defined and included in the `validValues`\n * array. This is used primarily to prevent Vue wrappers from setting aria props\n * to \"Symbol()\" when the prop is not set.\n */\nexport function getAriaValueFromProp(prop: string, validValues?: string[]) {\n if (prop === undefined) return prop;\n if (!validValues) return prop !== 'Symbol()' ? prop : undefined;\n return validValues.includes(prop) || prop === '' ? prop : undefined;\n}\n\nlet guid: number = 1000;\nexport function createGuid(): number {\n return guid++;\n}\n\nexport function nextPaint(fn: (value?: unknown) => void) {\n requestAnimationFrame(() => {\n requestAnimationFrame(fn);\n });\n}\n\nexport function isVisible(element: HTMLElement) {\n return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;\n}\n\nexport function waitForNextPaint() {\n return new Promise(resolve => nextPaint(resolve));\n}\n\nexport function capitalize(value: string) {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n\nexport function pick(props: string[]): (obj: object) => object {\n return obj => {\n return props.reduce((memo, prop) => {\n return {\n ...memo,\n [prop]: obj[prop],\n };\n }, {});\n };\n}\n\nexport function loc(key: string, subs?: IDict<any> | string[]) {\n if (!key) return '';\n if (window.Tecton?.noStrings === true) {\n return key;\n }\n return window?.TectonElements?.loc(key, subs) ?? key;\n}\n\nexport function labelDOM(target: FormFieldTypes | Q2RadioGroup | Q2CheckboxGroup) {\n const { label, hideLabel, optional, readonly } = target;\n const labelClasses: string[] = ['input-label'];\n let helpText = '';\n\n let shouldHideLabel = hideLabel;\n if (!shouldHideLabel) {\n const labelSlotElements = target.hostElement.querySelectorAll<HTMLSlotElement>('[slot=\"label\"]');\n const hasSlotContent = labelSlotElements.length > 0;\n const hasLabel = !!label;\n\n shouldHideLabel = hasLabel || hasSlotContent ? false : true;\n }\n\n if (shouldHideLabel) labelClasses.push('sr');\n if (optional) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.optional')}</span>;\n }\n if (readonly) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.readonly')}</span>;\n labelClasses.push('readonly-field');\n }\n return (\n <label\n htmlFor={target.inputId}\n class={labelClasses.join(' ')}\n >\n <slot name=\"label\">\n {label ? loc(label) : undefined}\n {helpText}\n </slot>\n </label>\n );\n}\n\nexport function hasSlotContent(target: HTMLElement, slotName: string) {\n return target.querySelector(`[slot=\"${slotName}\"]`) !== null;\n}\n\nexport function handleAriaLabel(\n target:\n | Q2Input\n | Q2Select\n | Q2Radio\n | Q2Checkbox\n | Q2EditableField\n | Q2Dropdown\n | Q2DropdownItem\n | Q2Loading\n | Q2Carousel\n | Q2Calendar\n | Q2Btn\n) {\n const { ariaLabel } = target;\n if (!ariaLabel) return;\n\n // If empty ariaLabel prop is set to primitive symbol by framework wrapper, set ariaLabel to undefined and return\n const FW_WRAPPERS_EMPTY_PROP = Symbol().toString();\n if (ariaLabel === FW_WRAPPERS_EMPTY_PROP) {\n target.ariaLabel = undefined;\n return;\n }\n\n // If ariaLabel is set, set hideLabel to true and set label to ariaLabel\n if ('hideLabel' in target) target.hideLabel = true;\n target.label = loc(ariaLabel);\n target.ariaLabel = undefined;\n}\n\n/**\n * Handles when a prop has been renamed on a component without introducing a breaking change.\n */\nexport function handleRenamedProp(target: object, oldProp: string, newProp: string, removeOldProp?: boolean) {\n if (typeof target[oldProp] === 'undefined') return;\n\n // If old prop has value, aka set in component, call handleDeprecationWarning()\n if (target[oldProp]) {\n handleDeprecationWarning(target, oldProp, 'prop');\n }\n\n target[newProp] = target[oldProp];\n\n if (removeOldProp) {\n delete target[oldProp];\n }\n}\n\nexport function handleDeprecationWarning(\n target: object,\n deprecatedItemName: string,\n deprecatedItemType: 'function' | 'prop' | 'method' | 'event'\n) {\n if (window.location.hostname === 'localhost' || window.location.host === 'stack.q2developer.com') {\n if (target[deprecatedItemName] === 'undefined') return;\n\n const componentName = target.constructor.name.toLowerCase().slice(2);\n\n switch (deprecatedItemType) {\n case 'prop':\n if (deprecatedItemName === 'size' && componentName === 'btn') {\n console.warn(\n `The property of size in q2-btn should not be typeof number, or typeof string containing a number. This functionality will be deprecated in an upcoming release. Instead, please use the value 'undefined', or typeof string with any of the following values: \"small\" / \"medium\" / \"large\" `\n );\n } else {\n console.warn(\n `The property ${deprecatedItemName} in q2-${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n }\n break;\n\n case 'function':\n console.warn(\n `The function ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'method':\n console.warn(\n `The method ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'event':\n console.warn(\n `The event ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n default:\n console.error(\n `handleDeprecationWarning --> No type found for desired deprecation: ${deprecatedItemName} in q2-${componentName}: deprecatedItemType = ${deprecatedItemName}`\n );\n }\n }\n}\n\nexport function messagesDOM(target: FormFieldTypes) {\n const type = target.hasError ? 'danger' : 'info';\n\n return (\n <div class=\"messages-container\">\n <q2-message\n appearance=\"minimal\"\n description\n type={type}\n test-id=\"message\"\n >\n <ul id={target.inputDescribedBy}>\n {target.messages.map(message => (\n <li test-id=\"messageListItem\">{loc(message)}</li>\n ))}\n </ul>\n </q2-message>\n </div>\n );\n}\n\nexport function setMessageHeight(target: FormFieldTypes) {\n const messageContainer = (target.hostElement.shadowRoot as ShadowRoot).querySelector<HTMLDivElement>(\n '.messages-container'\n );\n const q2Message = messageContainer.querySelector('q2-message');\n nextPaint(() => {\n const height = target.showMessages && target.hasFocus ? q2Message.getBoundingClientRect().height : 0;\n\n if (messageContainer.style.getPropertyValue('height') === `${height}px`) return;\n\n if (height === 0) {\n q2Message.classList.add('invisible');\n messageContainer.style.removeProperty('height');\n } else {\n q2Message.classList.remove('invisible');\n messageContainer.style.setProperty('height', `${height}px`);\n }\n });\n}\n\nexport const resizeIframe = () => {\n return window.TectonElements?.resizeIframe?.();\n};\n\n// Handling color attribute (deprecated)\nexport const handleColor = (target: Q2Btn) => {\n if (!target.intent && ['primary', 'secondary'].includes(target.color)) {\n target.intent = `workflow-${target.color}` as HTMLQ2BtnElement['intent'];\n target.color = undefined;\n }\n};\n"],"mappings":"6CAgBgBA,IACZ,MAAO,sFAAsFC,KACzFC,UAAUC,UAElB,C,SAEgBC,EAAkBC,EAAmBC,GACjD,MAAMC,EAAOF,EAAME,KACnB,MAAMC,EAAe,CAAC,UAAW,SACjC,MAAMC,EAAYD,EAAaE,SAASH,GAIxC,MAAMI,EAAsBF,EAAYJ,EAAMO,OAASP,EAAMQ,cAE7D,MAAMC,EAAgCC,IAClC,GAAIA,IAAYT,EAAa,OAAO,KACpC,GAAIS,EAAQC,cAAe,CACvB,OAAOF,EAA6BC,EAAQC,c,CAEhD,OAAO,KAAK,EAGhB,KAAML,aAA+BM,aAAc,OAAO,KAC1D,OAAQH,EAA6BH,EACzC,C,SAEgBO,EAA0Bb,EAAmBU,GACzD,OAAOV,EAAMQ,gBAAkBE,IAAYA,EAAQI,SAASd,EAAMQ,cACtE,C,SAEgBO,EAAmBf,EAAcU,G,MAC7C,QAAOM,EAAAhB,EAAMiB,gBAAY,MAAAD,SAAA,SAAAA,EAAAE,KAAAlB,GAAK,MAAOU,CACzC,C,SAEgBS,EAAclB,GAC1BA,EAAYmB,MAAQ,IAAMnB,IAAW,MAAXA,SAAW,SAAXA,EAAaoB,cAAc,IAAIC,WAAW,QAAS,CAAEC,QAAS,QAC5F,C,SAEgBC,IACZ,MAAM1B,EAAYD,UAAUC,UAAU2B,cACtC,OAAO3B,EAAUO,SAAS,UAC9B,C,SAEgBqB,IACZ,MAAO,iBAAkBC,QAAU9B,UAAU+B,eAAiB,CAClE,C,SAYgBC,EAAqBC,EAAcC,GAC/C,GAAID,IAASE,U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