q2-tecton-elements 1.57.0 → 1.57.2
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/bundle-report.json +484 -459
- package/dist/cjs/click-elsewhere.cjs.entry.js +1 -1
- package/dist/cjs/{index-Ct37J3sm.js → index-DRPUzMCR.js} +3 -7
- package/dist/{q2-tecton-elements/index-DHD1Dbkd.js.map → cjs/index-DRPUzMCR.js.map} +1 -1
- package/dist/cjs/{index-DwY8j6jj.js → index-zMAVnBYO.js} +116 -12
- package/dist/cjs/index-zMAVnBYO.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q2-action-group_2.cjs.entry.js +4 -4
- package/dist/cjs/q2-action-sheet.cjs.entry.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge_7.cjs.entry.js +6 -6
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
- package/dist/cjs/q2-card.cjs.entry.js +2 -2
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +4 -4
- package/dist/cjs/q2-carousel.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-area.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-bar.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-donut.cjs.entry.js +3 -3
- 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-context.cjs.entry.js +3 -3
- package/dist/cjs/q2-currency.cjs.entry.js +2 -2
- package/dist/cjs/q2-data-table.cjs.entry.js +2 -2
- package/dist/cjs/q2-detail.cjs.entry.js +3 -3
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown.cjs.entry.js +6 -4
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +2 -2
- package/dist/cjs/q2-example.cjs.entry.js +2 -2
- package/dist/cjs/q2-file-picker.cjs.entry.js +2 -2
- package/dist/cjs/q2-form.cjs.entry.js +2 -2
- package/dist/cjs/q2-formatted-text.cjs.entry.js +2 -2
- package/dist/cjs/q2-grid-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-grid.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +3 -3
- package/dist/cjs/q2-legend.cjs.entry.js +2 -2
- package/dist/cjs/q2-link_2.cjs.entry.js +3 -3
- package/dist/cjs/q2-loading-element.cjs.entry.js +2 -2
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +3 -3
- package/dist/cjs/q2-modal.cjs.entry.js +3 -3
- package/dist/cjs/q2-month-picker.cjs.entry.js +4 -4
- package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
- package/dist/cjs/q2-option-list.q2-popover.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-option-list_2.cjs.entry.js +53 -62
- package/dist/cjs/q2-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +2 -2
- package/dist/cjs/q2-pagination.cjs.entry.js +5 -5
- package/dist/cjs/q2-pill.cjs.entry.js +3 -3
- 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 +4 -4
- package/dist/cjs/q2-select.cjs.entry.js +81 -24
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-select.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +3 -3
- package/dist/cjs/q2-stepper.cjs.entry.js +3 -3
- package/dist/cjs/q2-tag.cjs.entry.js +3 -3
- package/dist/cjs/q2-tecton-elements.cjs.js +23 -2
- package/dist/cjs/q2-tecton-elements.cjs.js.map +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +3 -3
- package/dist/cjs/q2-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{shapes-DYFTrUXB.js → shapes-DDw2Fhwn.js} +3 -3
- package/dist/cjs/{shapes-DYFTrUXB.js.map → shapes-DDw2Fhwn.js.map} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +3 -3
- package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
- 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-month-picker.js +2 -2
- 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-context/q2-context.js +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js +1 -1
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +4 -2
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-example/q2-example.js +1 -1
- package/dist/collection/components/q2-form/q2-form.js +1 -1
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
- package/dist/collection/components/q2-input/q2-input.js +1 -1
- 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-message/q2-message.js +1 -1
- package/dist/collection/components/q2-modal/q2-modal.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
- package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
- 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 +53 -61
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
- package/dist/collection/components/q2-section/q2-section.js +2 -2
- package/dist/collection/components/q2-select/q2-select.js +89 -25
- 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-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 -4
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-action-group2.js +1 -1
- package/dist/components/q2-action-sheet.js +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-carousel-pane.js +2 -2
- 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-context.js +1 -1
- package/dist/components/q2-currency.js +1 -1
- package/dist/components/q2-detail.js +1 -1
- package/dist/components/q2-dropdown.js +4 -2
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-example.js +1 -1
- package/dist/components/q2-form.js +1 -1
- package/dist/components/q2-formatted-text.js +1 -1
- package/dist/components/q2-input2.js +1 -1
- package/dist/components/q2-item2.js +1 -1
- package/dist/components/q2-legend2.js +1 -1
- package/dist/components/q2-list2.js +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-modal.js +1 -1
- package/dist/components/q2-month-picker.js +2 -2
- package/dist/components/q2-optgroup2.js +1 -1
- package/dist/components/q2-pagination.js +3 -3
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +52 -61
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +1 -1
- package/dist/components/q2-section.js +2 -2
- package/dist/components/q2-select2.js +83 -26
- package/dist/components/q2-select2.js.map +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.entry.js +1 -1
- package/dist/esm/{index-YFPMNbDm.js → index-C7zSUT3M.js} +116 -13
- package/dist/esm/index-C7zSUT3M.js.map +1 -0
- package/dist/esm/{index-DHD1Dbkd.js → index-y0xcWkDl.js} +4 -7
- package/dist/esm/{index-DHD1Dbkd.js.map → index-y0xcWkDl.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q2-action-group_2.entry.js +4 -4
- package/dist/esm/q2-action-sheet.entry.js +3 -3
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge_7.entry.js +6 -6
- package/dist/esm/q2-calendar.entry.js +2 -2
- package/dist/esm/q2-card.entry.js +2 -2
- package/dist/esm/q2-carousel-pane.entry.js +4 -4
- package/dist/esm/q2-carousel.entry.js +2 -2
- package/dist/esm/q2-chart-area.entry.js +3 -3
- package/dist/esm/q2-chart-bar.entry.js +3 -3
- package/dist/esm/q2-chart-donut.entry.js +3 -3
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox.entry.js +2 -2
- package/dist/esm/q2-context.entry.js +3 -3
- package/dist/esm/q2-currency.entry.js +2 -2
- package/dist/esm/q2-data-table.entry.js +2 -2
- package/dist/esm/q2-detail.entry.js +3 -3
- package/dist/esm/q2-dropdown-item.entry.js +2 -2
- package/dist/esm/q2-dropdown.entry.js +6 -4
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-editable-field.entry.js +2 -2
- package/dist/esm/q2-example.entry.js +2 -2
- package/dist/esm/q2-file-picker.entry.js +2 -2
- package/dist/esm/q2-form.entry.js +2 -2
- package/dist/esm/q2-formatted-text.entry.js +2 -2
- package/dist/esm/q2-grid-area.entry.js +1 -1
- package/dist/esm/q2-grid.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +3 -3
- package/dist/esm/q2-legend.entry.js +2 -2
- package/dist/esm/q2-link_2.entry.js +3 -3
- package/dist/esm/q2-loading-element.entry.js +2 -2
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +3 -3
- package/dist/esm/q2-modal.entry.js +3 -3
- package/dist/esm/q2-month-picker.entry.js +4 -4
- package/dist/esm/q2-optgroup.entry.js +3 -3
- package/dist/esm/q2-option-list.q2-popover.entry.js.map +1 -1
- package/dist/esm/q2-option-list_2.entry.js +53 -62
- package/dist/esm/q2-option-list_2.entry.js.map +1 -1
- package/dist/esm/q2-option.entry.js +2 -2
- package/dist/esm/q2-pagination.entry.js +5 -5
- package/dist/esm/q2-pill.entry.js +3 -3
- 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 +4 -4
- package/dist/esm/q2-select.entry.js +81 -24
- 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 +3 -3
- package/dist/esm/q2-stepper.entry.js +3 -3
- package/dist/esm/q2-tag.entry.js +3 -3
- package/dist/esm/q2-tecton-elements.js +24 -3
- package/dist/esm/q2-tecton-elements.js.map +1 -1
- package/dist/esm/q2-textarea.entry.js +3 -3
- package/dist/esm/q2-tooltip.entry.js +2 -2
- package/dist/esm/{shapes-B9jYz1VS.js → shapes-DO0UnuKe.js} +3 -3
- package/dist/esm/{shapes-B9jYz1VS.js.map → shapes-DO0UnuKe.js.map} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +3 -3
- package/dist/q2-tecton-elements/click-elsewhere.entry.js +1 -1
- package/dist/q2-tecton-elements/{index-YFPMNbDm.js → index-C7zSUT3M.js} +559 -450
- package/dist/q2-tecton-elements/index-C7zSUT3M.js.map +1 -0
- package/dist/q2-tecton-elements/{index-DHD1Dbkd.js → index-y0xcWkDl.js} +4 -8
- package/dist/{cjs/index-Ct37J3sm.js.map → q2-tecton-elements/index-y0xcWkDl.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-action-group_2.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +10 -10
- package/dist/q2-tecton-elements/q2-avatar.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +75 -75
- package/dist/q2-tecton-elements/q2-calendar.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-card.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-carousel.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +70 -70
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-context.entry.js +13 -13
- package/dist/q2-tecton-elements/q2-currency.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-data-table.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-detail.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-dropdown.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +69 -67
- package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-example.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-form.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-grid-area.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-grid.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +14 -14
- package/dist/q2-tecton-elements/q2-legend.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-link_2.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-loading-element.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-loc.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-message.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-modal.entry.js +23 -23
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +67 -67
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-option-list.q2-popover.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js +208 -210
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-option.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-pagination.entry.js +26 -26
- package/dist/q2-tecton-elements/q2-pill.entry.js +23 -23
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-radio.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-section.entry.js +22 -22
- package/dist/q2-tecton-elements/q2-select.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-select.entry.js +141 -96
- package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +20 -20
- package/dist/q2-tecton-elements/q2-stepper.entry.js +14 -14
- package/dist/q2-tecton-elements/q2-tag.entry.js +12 -12
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +31 -9
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +2 -2
- package/dist/q2-tecton-elements/{shapes-B9jYz1VS.js → shapes-DO0UnuKe.js} +3 -3
- package/dist/q2-tecton-elements/{shapes-B9jYz1VS.js.map → shapes-DO0UnuKe.js.map} +1 -1
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +7 -7
- package/dist/types/components/q2-popover/q2-popover.d.ts +4 -4
- package/dist/types/components/q2-select/q2-select.d.ts +13 -3
- package/dist/types/components.d.ts +2 -0
- package/package.json +3 -3
- package/dist/cjs/index-DwY8j6jj.js.map +0 -1
- package/dist/esm/index-YFPMNbDm.js.map +0 -1
- package/dist/q2-tecton-elements/index-YFPMNbDm.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { r as t, c as
|
|
1
|
+
import { r as t, c as e, h as i, d as o, a as s } from "./index-C7zSUT3M.js";
|
|
2
2
|
|
|
3
|
-
import { l as n, n as r, o as a, a as c, w as h,
|
|
3
|
+
import { l as n, n as r, o as a, a as c, w as h, q as l, t as p } from "./index-y0xcWkDl.js";
|
|
4
4
|
|
|
5
5
|
function sanitizeRegexString(t) {
|
|
6
6
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const d = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{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}";
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
constructor(
|
|
13
|
-
t(this,
|
|
14
|
-
this.change =
|
|
15
|
-
this.popoverState =
|
|
16
|
-
this.ready =
|
|
11
|
+
const u = class {
|
|
12
|
+
constructor(i) {
|
|
13
|
+
t(this, i);
|
|
14
|
+
this.change = e(this, "change", 7);
|
|
15
|
+
this.popoverState = e(this, "popoverState", 7);
|
|
16
|
+
this.ready = e(this, "ready", 3);
|
|
17
17
|
this.keyStore = {
|
|
18
18
|
queue: [],
|
|
19
19
|
lastPressedAt: new Date
|
|
@@ -23,9 +23,9 @@ const f = class {
|
|
|
23
23
|
/** A list of the selected options on the element. */ this.selectedOptions = [];
|
|
24
24
|
/** Translates to the role of the option list */ this.type = "listbox";
|
|
25
25
|
this.clickHandler = t => {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
this.selectOption(
|
|
26
|
+
const e = t.target;
|
|
27
|
+
const i = e.closest("q2-option:not([separator]):not([separator=true]), q2-dropdown-item:not([separator]):not([separator=true])");
|
|
28
|
+
this.selectOption(i);
|
|
29
29
|
if (this.multiple) return;
|
|
30
30
|
this.popoverState.emit({
|
|
31
31
|
open: false,
|
|
@@ -34,13 +34,13 @@ const f = class {
|
|
|
34
34
|
};
|
|
35
35
|
/* tslint:disable:cyclomatic-complexity */ this.externalKeydownHandler = t => {
|
|
36
36
|
t.stopPropagation();
|
|
37
|
-
const {activeIndex:
|
|
37
|
+
const {activeIndex: e, customSearch: i, allOptions: o} = this;
|
|
38
38
|
const {key: s} = t;
|
|
39
39
|
let n;
|
|
40
40
|
switch (s) {
|
|
41
41
|
case " ":
|
|
42
42
|
if (this.searchString) {
|
|
43
|
-
if (
|
|
43
|
+
if (i) break;
|
|
44
44
|
this.searchOptions(s, true);
|
|
45
45
|
break;
|
|
46
46
|
} else if (this.type === "menu") {
|
|
@@ -94,12 +94,12 @@ const f = class {
|
|
|
94
94
|
|
|
95
95
|
case "PageUp":
|
|
96
96
|
t.preventDefault();
|
|
97
|
-
this.openDropdownWithActiveElement(Math.max((
|
|
97
|
+
this.openDropdownWithActiveElement(Math.max((e || 0) - 10, 0));
|
|
98
98
|
break;
|
|
99
99
|
|
|
100
100
|
case "PageDown":
|
|
101
101
|
t.preventDefault();
|
|
102
|
-
this.openDropdownWithActiveElement(Math.min((
|
|
102
|
+
this.openDropdownWithActiveElement(Math.min((e || 0) + 10, o.length - 1));
|
|
103
103
|
break;
|
|
104
104
|
|
|
105
105
|
case "Tab":
|
|
@@ -119,29 +119,29 @@ const f = class {
|
|
|
119
119
|
break;
|
|
120
120
|
|
|
121
121
|
default:
|
|
122
|
-
if (
|
|
122
|
+
if (i) break;
|
|
123
123
|
if (!s.match(/^[\w]$/)) break;
|
|
124
124
|
this.searchOptions(s, true);
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
/* tslint:enable:cyclomatic-complexity */ this.focusoutHandler = t => {
|
|
129
|
-
const {relatedTarget:
|
|
130
|
-
const
|
|
131
|
-
const o = !
|
|
132
|
-
if (
|
|
129
|
+
const {relatedTarget: e} = t;
|
|
130
|
+
const i = this.allOptions.includes(e);
|
|
131
|
+
const o = !i && this.hostElement.contains(e);
|
|
132
|
+
if (i || o) {
|
|
133
133
|
t.stopPropagation();
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
this.internalKeydownHandler = t => {
|
|
137
137
|
t.stopPropagation();
|
|
138
|
-
const {activeIndex:
|
|
138
|
+
const {activeIndex: e, customSearch: i, allOptions: o, allVisibleOptions: s, multiple: n} = this;
|
|
139
139
|
const {key: r, shiftKey: a} = t;
|
|
140
140
|
let c;
|
|
141
141
|
switch (r) {
|
|
142
142
|
case " ":
|
|
143
143
|
if (this.searchString && !this.multiple) {
|
|
144
|
-
if (
|
|
144
|
+
if (i) break;
|
|
145
145
|
this.searchOptions(r, false);
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
@@ -179,13 +179,13 @@ const f = class {
|
|
|
179
179
|
const h = s[0];
|
|
180
180
|
const l = h.active;
|
|
181
181
|
if (l) break;
|
|
182
|
-
if (
|
|
182
|
+
if (e === undefined) {
|
|
183
183
|
this.setDefaultActiveElement();
|
|
184
184
|
break;
|
|
185
185
|
} else {
|
|
186
186
|
const t = this.getNextVisibleIndex(-1);
|
|
187
187
|
if (t === -1) break;
|
|
188
|
-
this.adjustActiveOptionAndScroll(t -
|
|
188
|
+
this.adjustActiveOptionAndScroll(t - e);
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -194,13 +194,13 @@ const f = class {
|
|
|
194
194
|
const p = s[s.length - 1];
|
|
195
195
|
const d = p.active;
|
|
196
196
|
if (d) break;
|
|
197
|
-
if (
|
|
197
|
+
if (e === undefined) {
|
|
198
198
|
this.setDefaultActiveElement();
|
|
199
199
|
break;
|
|
200
200
|
} else {
|
|
201
201
|
const t = this.getNextVisibleIndex(1);
|
|
202
202
|
if (t === -1) break;
|
|
203
|
-
this.adjustActiveOptionAndScroll(t -
|
|
203
|
+
this.adjustActiveOptionAndScroll(t - e);
|
|
204
204
|
break;
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -216,12 +216,12 @@ const f = class {
|
|
|
216
216
|
|
|
217
217
|
case "PageUp":
|
|
218
218
|
t.preventDefault();
|
|
219
|
-
this.openDropdownWithActiveElement(Math.max(
|
|
219
|
+
this.openDropdownWithActiveElement(Math.max(e - 10, 0));
|
|
220
220
|
break;
|
|
221
221
|
|
|
222
222
|
case "PageDown":
|
|
223
223
|
t.preventDefault();
|
|
224
|
-
this.openDropdownWithActiveElement(Math.min(
|
|
224
|
+
this.openDropdownWithActiveElement(Math.min(e + 10, o.length - 1));
|
|
225
225
|
break;
|
|
226
226
|
|
|
227
227
|
case "Tab":
|
|
@@ -249,37 +249,37 @@ const f = class {
|
|
|
249
249
|
break;
|
|
250
250
|
|
|
251
251
|
default:
|
|
252
|
-
if (
|
|
252
|
+
if (i) break;
|
|
253
253
|
if (!r.match(/^[\w]$/)) break;
|
|
254
254
|
this.searchOptions(r, false);
|
|
255
255
|
break;
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
this.searchAndFocus = (t,
|
|
258
|
+
this.searchAndFocus = (t, e) => {
|
|
259
259
|
// pseudo search in non-searchable select
|
|
260
260
|
const reorder = () => {
|
|
261
261
|
this.pivotIndex = this.pivotIndex === undefined ? 0 : (this.activeIndex || 0) + 1;
|
|
262
|
-
const t = this.allOptions.map(((t,
|
|
262
|
+
const t = this.allOptions.map(((t, e) => ({
|
|
263
263
|
element: t,
|
|
264
|
-
index:
|
|
264
|
+
index: e
|
|
265
265
|
})));
|
|
266
266
|
return [ ...t.slice(this.pivotIndex), ...t.slice(0, this.pivotIndex) ];
|
|
267
267
|
};
|
|
268
268
|
const buildQueue = () => {
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
269
|
+
const e = new Date;
|
|
270
|
+
if (e.getTime() - this.keyStore.lastPressedAt.getTime() > 1e3) {
|
|
271
271
|
// empty stored keys if delay > 1s
|
|
272
272
|
this.keyStore.queue.length = 0;
|
|
273
273
|
}
|
|
274
274
|
if (this.keyStore.queue.length !== 1 || this.keyStore.queue[0] !== t) {
|
|
275
275
|
this.keyStore.queue.push(t);
|
|
276
276
|
}
|
|
277
|
-
this.keyStore.lastPressedAt =
|
|
277
|
+
this.keyStore.lastPressedAt = e;
|
|
278
278
|
};
|
|
279
279
|
const searchIndex = t => {
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
return t.find((t => !t.element.disabled && t.element.display && (t.element.display.match(new RegExp(`^${
|
|
280
|
+
const e = this.keyStore.queue.join("");
|
|
281
|
+
const i = sanitizeRegexString(e);
|
|
282
|
+
return t.find((t => !t.element.disabled && t.element.display && (t.element.display.match(new RegExp(`^${i}`, "i")) || t.element.display.replace(/\s/g, "").match(new RegExp(`^${i}`, "i")))));
|
|
283
283
|
};
|
|
284
284
|
const setFocus = ({index: t}) => {
|
|
285
285
|
if (this.multiple) {
|
|
@@ -287,7 +287,7 @@ const f = class {
|
|
|
287
287
|
this.openDropdownWithActiveElement(t);
|
|
288
288
|
} else {
|
|
289
289
|
this.activeIndex = t;
|
|
290
|
-
if (
|
|
290
|
+
if (e) {
|
|
291
291
|
this.selectOption(this.allOptions[t]);
|
|
292
292
|
this.popoverState.emit({
|
|
293
293
|
open: false,
|
|
@@ -297,9 +297,9 @@ const f = class {
|
|
|
297
297
|
}
|
|
298
298
|
};
|
|
299
299
|
buildQueue();
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
setFocus(
|
|
300
|
+
const i = searchIndex(reorder());
|
|
301
|
+
if (i) {
|
|
302
|
+
setFocus(i);
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
305
|
}
|
|
@@ -329,8 +329,8 @@ const f = class {
|
|
|
329
329
|
open: true,
|
|
330
330
|
action: "open"
|
|
331
331
|
});
|
|
332
|
-
const {activeIndex:
|
|
333
|
-
if (typeof
|
|
332
|
+
const {activeIndex: e} = this;
|
|
333
|
+
if (typeof e === "number" && e > -1) {
|
|
334
334
|
this.setActiveOption();
|
|
335
335
|
this.setFocusedOption();
|
|
336
336
|
} else {
|
|
@@ -372,25 +372,25 @@ const f = class {
|
|
|
372
372
|
this.showSelected = false;
|
|
373
373
|
return;
|
|
374
374
|
}
|
|
375
|
-
this.allOptions.forEach((
|
|
376
|
-
if (!("_multiSelectHidden" in
|
|
377
|
-
|
|
375
|
+
this.allOptions.forEach((e => {
|
|
376
|
+
if (!("_multiSelectHidden" in e)) return;
|
|
377
|
+
e._multiSelectHidden = t ? !e.selected : false;
|
|
378
378
|
}));
|
|
379
379
|
}
|
|
380
380
|
// #endregion
|
|
381
381
|
// #region Local Methods
|
|
382
382
|
get allContents() {
|
|
383
383
|
const t = this.getRootSlot(this.hostElement);
|
|
384
|
-
const
|
|
385
|
-
return t.filter((t =>
|
|
384
|
+
const e = new Set([ "Q2-OPTGROUP", "Q2-OPTION", "Q2-DROPDOWN-ITEM" ]);
|
|
385
|
+
return t.filter((t => e.has(t.tagName)));
|
|
386
386
|
}
|
|
387
387
|
get allOptions() {
|
|
388
388
|
const t = this.allContents;
|
|
389
|
-
const extractOptions = t => t.reduce(((t,
|
|
390
|
-
if (
|
|
391
|
-
return
|
|
392
|
-
} else if (
|
|
393
|
-
return [ ...t, ...extractOptions(Array.from(
|
|
389
|
+
const extractOptions = t => t.reduce(((t, e) => {
|
|
390
|
+
if (e.tagName === "Q2-OPTION" || e.tagName === "Q2-DROPDOWN-ITEM") {
|
|
391
|
+
return e.separator ? t : [ ...t, e ];
|
|
392
|
+
} else if (e.tagName === "Q2-OPTGROUP") {
|
|
393
|
+
return [ ...t, ...extractOptions(Array.from(e.children)) ];
|
|
394
394
|
} else {
|
|
395
395
|
return t;
|
|
396
396
|
}
|
|
@@ -409,22 +409,22 @@ const f = class {
|
|
|
409
409
|
checkOptions() {
|
|
410
410
|
const {type: t} = this;
|
|
411
411
|
if (!t) return;
|
|
412
|
-
const
|
|
412
|
+
const e = t === "menu" ? "menuitem" : "option";
|
|
413
413
|
this.allOptions.forEach((t => {
|
|
414
|
-
t.role =
|
|
414
|
+
t.role = e;
|
|
415
415
|
}));
|
|
416
416
|
}
|
|
417
417
|
focusSelectedSibling(t) {
|
|
418
|
-
const {allVisibleOptions:
|
|
419
|
-
const o =
|
|
418
|
+
const {allVisibleOptions: e, allOptions: i} = this;
|
|
419
|
+
const o = e.length < 2;
|
|
420
420
|
if (o) {
|
|
421
421
|
this.showSelected = false;
|
|
422
422
|
return;
|
|
423
423
|
}
|
|
424
|
-
const s =
|
|
424
|
+
const s = e.indexOf(t);
|
|
425
425
|
const n = s ? s - 1 : s + 1;
|
|
426
|
-
const r =
|
|
427
|
-
const a =
|
|
426
|
+
const r = e[n];
|
|
427
|
+
const a = i.indexOf(r);
|
|
428
428
|
this.activeIndex = a;
|
|
429
429
|
this.setFocusedOption();
|
|
430
430
|
this.scheduledAfterRender.push((() => {
|
|
@@ -434,29 +434,29 @@ const f = class {
|
|
|
434
434
|
}
|
|
435
435
|
getDefaultActiveIndex() {
|
|
436
436
|
const {allOptions: t} = this;
|
|
437
|
-
const
|
|
438
|
-
if (i > -1) return i;
|
|
439
|
-
const e = t.findIndex((t => !t.hidden));
|
|
437
|
+
const e = t.findIndex((t => "selected" in t && t.selected));
|
|
440
438
|
if (e > -1) return e;
|
|
439
|
+
const i = t.findIndex((t => !t.hidden));
|
|
440
|
+
if (i > -1) return i;
|
|
441
441
|
return 0;
|
|
442
442
|
}
|
|
443
443
|
getNextVisibleIndex(t) {
|
|
444
|
-
const {allVisibleOptions:
|
|
445
|
-
const s =
|
|
446
|
-
const n =
|
|
444
|
+
const {allVisibleOptions: e, allOptions: i, activeIndex: o} = this;
|
|
445
|
+
const s = i[o];
|
|
446
|
+
const n = e.indexOf(s);
|
|
447
447
|
let r = n + t;
|
|
448
448
|
if (r < 0) {
|
|
449
|
-
r =
|
|
450
|
-
} else if (r >
|
|
449
|
+
r = e.length - 1;
|
|
450
|
+
} else if (r > e.length - 1) {
|
|
451
451
|
r = 0;
|
|
452
452
|
}
|
|
453
|
-
const a =
|
|
454
|
-
return
|
|
453
|
+
const a = e[r];
|
|
454
|
+
return i.indexOf(a);
|
|
455
455
|
}
|
|
456
456
|
getRootSlot(t) {
|
|
457
|
-
var
|
|
458
|
-
const
|
|
459
|
-
const o = (
|
|
457
|
+
var e;
|
|
458
|
+
const i = t.querySelector("slot");
|
|
459
|
+
const o = (e = i === null || i === void 0 ? void 0 : i.assignedElements()) !== null && e !== void 0 ? e : Array.from(t.children);
|
|
460
460
|
const s = !!o.length && o[0].tagName === "SLOT";
|
|
461
461
|
if (s) {
|
|
462
462
|
return this.getRootSlot(o[0]);
|
|
@@ -490,12 +490,12 @@ const f = class {
|
|
|
490
490
|
block: "center"
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
|
-
searchOptions(t,
|
|
493
|
+
searchOptions(t, e) {
|
|
494
494
|
this.searchString = t;
|
|
495
|
-
this.searchAndFocus(t,
|
|
495
|
+
this.searchAndFocus(t, e);
|
|
496
496
|
}
|
|
497
497
|
selectOption(t) {
|
|
498
|
-
const {multiple:
|
|
498
|
+
const {multiple: e, noSelect: i, showSelected: o} = this;
|
|
499
499
|
if (!t || t.disabled || "disabledGroup" in t && t.disabledGroup) return;
|
|
500
500
|
const s = t.value;
|
|
501
501
|
const n = "display" in t && t.display ? t.display : t.innerText.trim();
|
|
@@ -504,19 +504,19 @@ const f = class {
|
|
|
504
504
|
display: n
|
|
505
505
|
};
|
|
506
506
|
let a = [];
|
|
507
|
-
if (
|
|
508
|
-
const {selectedOptions:
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
a =
|
|
507
|
+
if (e) {
|
|
508
|
+
const {selectedOptions: e} = this;
|
|
509
|
+
const i = e.find((t => t.value === s));
|
|
510
|
+
if (i) {
|
|
511
|
+
a = e.filter((({value: t}) => t !== s));
|
|
512
512
|
} else {
|
|
513
|
-
a = [ ...
|
|
513
|
+
a = [ ...e, r ];
|
|
514
514
|
}
|
|
515
515
|
if (o) this.focusSelectedSibling(t);
|
|
516
516
|
} else {
|
|
517
517
|
a = [ r ];
|
|
518
518
|
}
|
|
519
|
-
if (
|
|
519
|
+
if (i) this.setActiveElement(null); else this.selectedOptions = a;
|
|
520
520
|
this.change.emit({
|
|
521
521
|
value: s,
|
|
522
522
|
values: a
|
|
@@ -524,31 +524,31 @@ const f = class {
|
|
|
524
524
|
}
|
|
525
525
|
setActiveOption() {
|
|
526
526
|
const t = this.activeIndex;
|
|
527
|
-
this.allOptions.forEach(((
|
|
528
|
-
|
|
527
|
+
this.allOptions.forEach(((e, i) => {
|
|
528
|
+
e.active = t === i;
|
|
529
529
|
}));
|
|
530
530
|
}
|
|
531
531
|
setFocusedOption() {
|
|
532
532
|
const t = this.allOptions[this.activeIndex];
|
|
533
533
|
if (!t) return;
|
|
534
|
-
const
|
|
535
|
-
if (
|
|
534
|
+
const e = l(t);
|
|
535
|
+
if (e) t.focus(); else r((() => t.focus()));
|
|
536
536
|
}
|
|
537
537
|
updateMultipleOptionAttrs() {
|
|
538
|
-
const {allOptions: t, selectedOptions:
|
|
539
|
-
const
|
|
538
|
+
const {allOptions: t, selectedOptions: e} = this;
|
|
539
|
+
const i = e.map((({value: t}) => t));
|
|
540
540
|
if (this.noSelect) return;
|
|
541
541
|
t.forEach((t => {
|
|
542
542
|
if (!("selected" in t)) return;
|
|
543
|
-
t.selected =
|
|
543
|
+
t.selected = i.includes(t.value);
|
|
544
544
|
}));
|
|
545
545
|
}
|
|
546
546
|
updateSingleOptionAttrs() {
|
|
547
547
|
var t;
|
|
548
|
-
const {allOptions:
|
|
549
|
-
const o = ((t =
|
|
548
|
+
const {allOptions: e, selectedOptions: i} = this;
|
|
549
|
+
const o = ((t = i[0]) === null || t === void 0 ? void 0 : t.value) || undefined;
|
|
550
550
|
if (this.noSelect) return;
|
|
551
|
-
|
|
551
|
+
e.forEach((t => {
|
|
552
552
|
if (!("selected" in t)) return;
|
|
553
553
|
t.selected = t.value === o;
|
|
554
554
|
}));
|
|
@@ -556,14 +556,14 @@ const f = class {
|
|
|
556
556
|
// #endregion
|
|
557
557
|
// #region Render Methods
|
|
558
558
|
render() {
|
|
559
|
-
return
|
|
559
|
+
return i(o, {
|
|
560
560
|
key: "48bc63463e38e58f7f18e5b5b105e14689be640c"
|
|
561
|
-
},
|
|
561
|
+
}, i("div", {
|
|
562
562
|
key: "26d143ad186b387274837d2141f9e5cd7cee6fb0",
|
|
563
563
|
class: "content",
|
|
564
564
|
ref: t => this.contentElement = t,
|
|
565
565
|
onFocusout: this.focusoutHandler
|
|
566
|
-
},
|
|
566
|
+
}, i("div", {
|
|
567
567
|
key: "afecab7ca714392b609ccc57f4d920a4cc7f2c7e",
|
|
568
568
|
class: "options",
|
|
569
569
|
"aria-label": n("tecton.element.optionList.label", [ this.label ]),
|
|
@@ -571,7 +571,7 @@ const f = class {
|
|
|
571
571
|
role: this.type || "listbox",
|
|
572
572
|
onKeyDown: this.internalKeydownHandler,
|
|
573
573
|
onClick: this.clickHandler
|
|
574
|
-
},
|
|
574
|
+
}, i("slot", {
|
|
575
575
|
key: "7ca042464b34eeb59ddd8c62bf44b29b39f3ccfb"
|
|
576
576
|
}))));
|
|
577
577
|
}
|
|
@@ -586,80 +586,94 @@ const f = class {
|
|
|
586
586
|
}
|
|
587
587
|
};
|
|
588
588
|
|
|
589
|
-
|
|
589
|
+
u.style = d;
|
|
590
590
|
|
|
591
|
-
const b = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{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;
|
|
591
|
+
const b = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{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}.legacy.container{display:none}.legacy.show{display:block;z-index:var(--tct-popover-z-index, 50)}:popover-open,.show{position:absolute;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}:popover-open.block,.show.block{right:unset;width:var(--comp-pop-width);min-width:var(--tct-popover-min-width, unset)}:popover-open.left,.show.left{left:var(--comp-pop-left);right:unset}:popover-open.right,.show.right{right:var(--comp-pop-right);left:unset}:popover-open.down,.show.down{top:var(--tct-popover-top, var(--comp-pop-top));bottom:unset}:popover-open.up,.show.up{top:unset;bottom:var(--comp-pop-bottom)}:popover-open::-webkit-scrollbar,.show::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}:popover-open::-webkit-scrollbar-thumb,.show::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}:popover-open::-webkit-scrollbar-track,.show::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}click-elsewhere{position:relative;display:block}";
|
|
592
592
|
|
|
593
|
-
const
|
|
594
|
-
constructor(
|
|
595
|
-
t(this,
|
|
596
|
-
this.popoverStateChanged =
|
|
593
|
+
const f = class {
|
|
594
|
+
constructor(i) {
|
|
595
|
+
t(this, i);
|
|
596
|
+
this.popoverStateChanged = e(this, "popoverStateChanged", 7);
|
|
597
597
|
/**
|
|
598
598
|
* The number of pixels to leave between the popover and the edge of the viewport
|
|
599
599
|
*/ this.displayBuffer = 10;
|
|
600
|
-
|
|
600
|
+
this.orientationChanged = false;
|
|
601
601
|
// #endregion
|
|
602
602
|
// #region State Properties
|
|
603
603
|
this.currentDirection = undefined;
|
|
604
604
|
// remove `show` when Popover API is supported in iOS
|
|
605
605
|
this.show = false;
|
|
606
|
+
// #endregion
|
|
607
|
+
// #region Public Property API
|
|
608
|
+
/** Aligns the popover to the left or right side of the control element. */ this.align = "left";
|
|
606
609
|
this.mode = null;
|
|
607
610
|
this.handleMinHeight = () => {
|
|
608
611
|
if (this.minHeight) {
|
|
609
612
|
p(this, "minHeight", "prop");
|
|
610
613
|
}
|
|
611
614
|
};
|
|
615
|
+
this.handlePopoverToggleEvent = t => {
|
|
616
|
+
this.popoverStateChanged.emit({
|
|
617
|
+
open: t.newState === "open"
|
|
618
|
+
});
|
|
619
|
+
};
|
|
612
620
|
this.setAbsoluteCSSProperties = async () => {
|
|
613
|
-
const {controlElement: t, containerElement:
|
|
621
|
+
const {controlElement: t, containerElement: e, currentDirection: i, align: o} = this;
|
|
614
622
|
if (o === "right") {
|
|
615
|
-
|
|
616
|
-
|
|
623
|
+
e.style.setProperty("--comp-pop-right", "0");
|
|
624
|
+
e.style.setProperty("--comp-pop-left", "unset");
|
|
617
625
|
} else {
|
|
618
|
-
|
|
619
|
-
|
|
626
|
+
e.style.setProperty("--comp-pop-left", "0");
|
|
627
|
+
e.style.setProperty("--comp-pop-right", "unset");
|
|
620
628
|
}
|
|
621
629
|
if (this.block) {
|
|
622
|
-
|
|
630
|
+
e.style.setProperty("--comp-pop-width", "100%");
|
|
623
631
|
}
|
|
624
|
-
if (
|
|
625
|
-
const
|
|
626
|
-
const o = parseInt(
|
|
627
|
-
|
|
632
|
+
if (i === "up") {
|
|
633
|
+
const i = getComputedStyle(t);
|
|
634
|
+
const o = parseInt(i.height || "0") + parseInt(i.borderTopWidth || "0") + parseInt(i.borderBottomWidth || "0");
|
|
635
|
+
e.style.setProperty("--comp-pop-bottom", `${o}px`);
|
|
628
636
|
}
|
|
629
637
|
// Wait for one paint to prevent layout thrashing
|
|
630
638
|
await h();
|
|
631
|
-
|
|
639
|
+
e.style.setProperty("--comp-pop-opacity", "1");
|
|
632
640
|
};
|
|
633
|
-
this.
|
|
634
|
-
var t, i,
|
|
635
|
-
const {controlElement:
|
|
636
|
-
const {top:
|
|
641
|
+
this.setPopoverAPICSSProperties = async () => {
|
|
642
|
+
var t, e, i, o, s, n;
|
|
643
|
+
const {controlElement: r, containerElement: a, currentDirection: c, isModule: l, align: p} = this;
|
|
644
|
+
const {top: d, bottom: u, left: b, right: f} = (e = (t = r === null || r === void 0 ? void 0 : r.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(r)) !== null && e !== void 0 ? e : {
|
|
637
645
|
top: 0,
|
|
638
646
|
bottom: 0,
|
|
639
647
|
left: 0,
|
|
640
648
|
right: 0
|
|
641
649
|
};
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
650
|
+
const v = b;
|
|
651
|
+
const w = ((i = window === null || window === void 0 ? void 0 : window.visualViewport) === null || i === void 0 ? void 0 : i.width) - f;
|
|
652
|
+
if (p === "right") {
|
|
653
|
+
a.style.setProperty("--comp-pop-right", `${w - window.scrollX}px`);
|
|
654
|
+
a.style.setProperty("--comp-pop-left", "unset");
|
|
655
|
+
} else {
|
|
656
|
+
a.style.setProperty("--comp-pop-left", `${v + window.scrollX}px`);
|
|
657
|
+
a.style.setProperty("--comp-pop-right", "unset");
|
|
658
|
+
}
|
|
659
|
+
if (this.block) a.style.setProperty("--comp-pop-width", `${(r === null || r === void 0 ? void 0 : r.offsetWidth) || 0}px`);
|
|
660
|
+
if (c === "up") {
|
|
661
|
+
if (l) {
|
|
662
|
+
a.style.setProperty("--comp-pop-bottom", `${window.innerHeight - d}px`);
|
|
649
663
|
} else {
|
|
650
|
-
|
|
664
|
+
a.style.setProperty("--comp-pop-bottom", `${window.innerHeight - d - ((o = window === null || window === void 0 ? void 0 : window.visualViewport) === null || o === void 0 ? void 0 : o.offsetTop) - window.scrollY}px`);
|
|
651
665
|
}
|
|
652
666
|
}
|
|
653
|
-
if (
|
|
654
|
-
if (
|
|
655
|
-
|
|
667
|
+
if (c === "down") {
|
|
668
|
+
if (l) {
|
|
669
|
+
a.style.setProperty("--comp-pop-top", `${u}px`);
|
|
656
670
|
} else {
|
|
657
|
-
|
|
671
|
+
a.style.setProperty("--comp-pop-top", `${u + ((n = (s = window === null || window === void 0 ? void 0 : window.visualViewport) === null || s === void 0 ? void 0 : s.offsetTop) !== null && n !== void 0 ? n : 0) + window.scrollY}px`);
|
|
658
672
|
}
|
|
659
673
|
}
|
|
660
674
|
// Wait for one paint to prevent layout thrashing
|
|
661
675
|
await h();
|
|
662
|
-
|
|
676
|
+
a.style.setProperty("--comp-pop-opacity", "1");
|
|
663
677
|
};
|
|
664
678
|
this.viewPortChanged = () => {
|
|
665
679
|
if (!this.open) return;
|
|
@@ -674,21 +688,28 @@ const w = class {
|
|
|
674
688
|
// #region Component Lifecycle Events
|
|
675
689
|
disconnectedCallback() {
|
|
676
690
|
this.removeViewportListeners();
|
|
691
|
+
this.containerElement.removeEventListener("toggle", this.handlePopoverToggleEvent);
|
|
677
692
|
this.containerElement = null;
|
|
678
693
|
this.contentElement = null;
|
|
679
694
|
this.controlElement = null;
|
|
680
|
-
|
|
695
|
+
}
|
|
696
|
+
componentWillLoad() {
|
|
697
|
+
if (!this.supportsPopoverAPI) {
|
|
698
|
+
console.warn("The Popover API is not supported in this browser. Please update your browser to the latest version. The component will use legacy mode.");
|
|
699
|
+
this.mode = "legacy";
|
|
700
|
+
}
|
|
681
701
|
}
|
|
682
702
|
componentDidLoad() {
|
|
683
703
|
this.handleMinHeight();
|
|
704
|
+
if (this.supportsPopoverAPI) this.containerElement.addEventListener("toggle", this.handlePopoverToggleEvent);
|
|
684
705
|
if (this.open) this.determinePopDirection();
|
|
685
706
|
}
|
|
686
707
|
// #endregion
|
|
687
708
|
// #region Listeners
|
|
688
709
|
popoverStateHandler(t) {
|
|
689
|
-
const {detail: {open:
|
|
690
|
-
if (
|
|
691
|
-
this.open =
|
|
710
|
+
const {detail: {open: e}} = t;
|
|
711
|
+
if (e === this.open) return;
|
|
712
|
+
this.open = e;
|
|
692
713
|
t.stopPropagation();
|
|
693
714
|
}
|
|
694
715
|
// #endregion
|
|
@@ -705,7 +726,6 @@ const w = class {
|
|
|
705
726
|
this.handleMinHeight();
|
|
706
727
|
}
|
|
707
728
|
async openChanged(t) {
|
|
708
|
-
this.setRootElement();
|
|
709
729
|
this.popoverStateChanged.emit({
|
|
710
730
|
open: t
|
|
711
731
|
});
|
|
@@ -715,7 +735,11 @@ const w = class {
|
|
|
715
735
|
} else {
|
|
716
736
|
this.removeViewportListeners();
|
|
717
737
|
this.currentDirection = undefined;
|
|
718
|
-
this.
|
|
738
|
+
if (this.mode === "legacy" || !this.supportsPopoverAPI) {
|
|
739
|
+
this.show = false;
|
|
740
|
+
} else {
|
|
741
|
+
this.containerElement.hidePopover();
|
|
742
|
+
}
|
|
719
743
|
await h();
|
|
720
744
|
this.clearCSSProperties();
|
|
721
745
|
}
|
|
@@ -723,10 +747,10 @@ const w = class {
|
|
|
723
747
|
// #endregion
|
|
724
748
|
// #region Local Methods
|
|
725
749
|
get isModule() {
|
|
726
|
-
var t,
|
|
727
|
-
const
|
|
728
|
-
const o = Object.keys((
|
|
729
|
-
return
|
|
750
|
+
var t, e;
|
|
751
|
+
const i = window !== window.top;
|
|
752
|
+
const o = Object.keys((e = (t = window.Tecton) === null || t === void 0 ? void 0 : t.platformDimensions) !== null && e !== void 0 ? e : {}).length > 0;
|
|
753
|
+
return i && o;
|
|
730
754
|
}
|
|
731
755
|
get providedDirection() {
|
|
732
756
|
const {direction: t} = this;
|
|
@@ -739,6 +763,9 @@ const w = class {
|
|
|
739
763
|
return undefined;
|
|
740
764
|
}
|
|
741
765
|
}
|
|
766
|
+
get supportsPopoverAPI() {
|
|
767
|
+
return Object.hasOwn(HTMLElement.prototype, "popover");
|
|
768
|
+
}
|
|
742
769
|
get validatedMaxHeight() {
|
|
743
770
|
const {maxHeight: t} = this;
|
|
744
771
|
return isNaN(t) ? undefined : t;
|
|
@@ -747,15 +774,13 @@ const w = class {
|
|
|
747
774
|
var t;
|
|
748
775
|
window.addEventListener("resize", this.viewPortOrientationChanged);
|
|
749
776
|
visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.addEventListener("resize", this.viewPortChanged);
|
|
750
|
-
|
|
751
|
-
window.addEventListener("scroll", this.viewPortChanged, {
|
|
777
|
+
window.addEventListener("scroll", this.viewPortChanged, {
|
|
752
778
|
passive: true,
|
|
753
779
|
capture: true
|
|
754
780
|
});
|
|
755
781
|
(t = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || t === void 0 ? void 0 : t.addEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
756
782
|
window.addEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
757
|
-
|
|
758
|
-
}
|
|
783
|
+
}
|
|
759
784
|
clearCSSProperties() {
|
|
760
785
|
this.containerElement.style.removeProperty("--comp-pop-max-height");
|
|
761
786
|
this.containerElement.style.removeProperty("--comp-pop-top");
|
|
@@ -766,12 +791,12 @@ const w = class {
|
|
|
766
791
|
this.containerElement.style.removeProperty("--comp-pop-opacity");
|
|
767
792
|
}
|
|
768
793
|
async determinePopDirection() {
|
|
769
|
-
var t,
|
|
794
|
+
var t, e, i;
|
|
770
795
|
const {containerElement: o, controlElement: s, providedDirection: n, displayBuffer: r} = this;
|
|
771
796
|
if (o) o.style.maxHeight = null;
|
|
772
797
|
await h();
|
|
773
798
|
const {isModule: a} = this;
|
|
774
|
-
const {top: c, bottom: l} = (
|
|
799
|
+
const {top: c, bottom: l} = (e = (t = s === null || s === void 0 ? void 0 : s.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(s)) !== null && e !== void 0 ? e : {
|
|
775
800
|
top: 0,
|
|
776
801
|
bottom: 0
|
|
777
802
|
};
|
|
@@ -779,11 +804,11 @@ const w = class {
|
|
|
779
804
|
let d;
|
|
780
805
|
let u;
|
|
781
806
|
if (a) {
|
|
782
|
-
const {outletOffset: t = 0, innerHeight:
|
|
807
|
+
const {outletOffset: t = 0, innerHeight: e = window.innerHeight} = ((i = window.Tecton) === null || i === void 0 ? void 0 : i.platformDimensions) || {};
|
|
783
808
|
const o = window.visualViewport.height - l;
|
|
784
|
-
const s =
|
|
809
|
+
const s = e - (t + l);
|
|
785
810
|
const n = o < s;
|
|
786
|
-
p =
|
|
811
|
+
p = e;
|
|
787
812
|
// If the top of the module is below the top of the window we just use the controlTop
|
|
788
813
|
// Otherwise we need to add the outletOffset to the controlTop
|
|
789
814
|
d = (t > 0 ? c : c + t) - r;
|
|
@@ -793,27 +818,27 @@ const w = class {
|
|
|
793
818
|
d = c - r;
|
|
794
819
|
u = p - l - r;
|
|
795
820
|
}
|
|
796
|
-
const
|
|
821
|
+
const b = d > u ? "up" : "down";
|
|
797
822
|
// We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)
|
|
798
|
-
const
|
|
823
|
+
const f = !o.style.getPropertyValue("--comp-pop-max-height") || this.orientationChanged;
|
|
799
824
|
// we do not want to constantly update the max-height after an orientation change, so we switch this back to false
|
|
800
825
|
this.orientationChanged = false;
|
|
801
|
-
const
|
|
802
|
-
switch (
|
|
826
|
+
const v = this.currentDirection || n || b;
|
|
827
|
+
switch (v) {
|
|
803
828
|
case "up":
|
|
804
|
-
if (
|
|
829
|
+
if (f) {
|
|
805
830
|
const t = this.validatedMaxHeight || d;
|
|
806
|
-
const
|
|
807
|
-
o.style.setProperty("--comp-pop-max-height", `${
|
|
831
|
+
const e = Math.min(d, t);
|
|
832
|
+
o.style.setProperty("--comp-pop-max-height", `${e}px`);
|
|
808
833
|
}
|
|
809
834
|
this.setDirectionAndShow("up");
|
|
810
835
|
break;
|
|
811
836
|
|
|
812
837
|
case "down":
|
|
813
|
-
if (
|
|
838
|
+
if (f) {
|
|
814
839
|
const t = this.validatedMaxHeight || u;
|
|
815
|
-
const
|
|
816
|
-
o.style.setProperty("--comp-pop-max-height", `${
|
|
840
|
+
const e = Math.min(u, t);
|
|
841
|
+
o.style.setProperty("--comp-pop-max-height", `${e}px`);
|
|
817
842
|
}
|
|
818
843
|
this.setDirectionAndShow("down");
|
|
819
844
|
break;
|
|
@@ -823,73 +848,46 @@ const w = class {
|
|
|
823
848
|
var t;
|
|
824
849
|
window.removeEventListener("resize", this.viewPortOrientationChanged);
|
|
825
850
|
visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.removeEventListener("resize", this.viewPortChanged);
|
|
826
|
-
|
|
827
|
-
window.removeEventListener("scroll", this.viewPortChanged, {
|
|
851
|
+
window.removeEventListener("scroll", this.viewPortChanged, {
|
|
828
852
|
capture: true
|
|
829
853
|
});
|
|
830
854
|
(t = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || t === void 0 ? void 0 : t.removeEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
831
855
|
window.removeEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
832
|
-
|
|
833
|
-
}
|
|
856
|
+
}
|
|
834
857
|
setDirectionAndShow(t) {
|
|
835
|
-
this.setRootElement();
|
|
836
858
|
// Due to some runtime inconsistency across devices/browsers we need to add one more check here because the
|
|
837
859
|
// popover can be closed between the time the popover is opened and the time the direction is determined
|
|
838
|
-
|
|
839
|
-
if (!
|
|
860
|
+
const e = this.open;
|
|
861
|
+
if (!e) return;
|
|
840
862
|
this.currentDirection = t;
|
|
841
|
-
this.
|
|
842
|
-
|
|
863
|
+
if (this.mode === "legacy" || !this.supportsPopoverAPI) {
|
|
864
|
+
this.show = true;
|
|
843
865
|
this.setAbsoluteCSSProperties();
|
|
844
866
|
} else {
|
|
845
|
-
this.
|
|
867
|
+
this.setPopoverAPICSSProperties();
|
|
868
|
+
this.containerElement.showPopover();
|
|
846
869
|
}
|
|
847
870
|
}
|
|
848
|
-
setRootElement() {
|
|
849
|
-
let t = this.hostElement;
|
|
850
|
-
while (t && t !== document.documentElement) {
|
|
851
|
-
const i = window.getComputedStyle(t);
|
|
852
|
-
// Check if the element has any styles applied that create a new containg block
|
|
853
|
-
if (i.transform !== "none" || i.filter !== "none" || i.perspective !== "none" || i.containerType !== "normal" || [ "transform", "perspective", "filter" ].includes(i.willChange) || [ "layout", "paint", "strict", "content" ].includes(i.contain)) {
|
|
854
|
-
this.rootElementRect = t.getBoundingClientRect();
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
|
-
const e = t.getRootNode();
|
|
858
|
-
const o = typeof ShadowRoot !== "undefined" && e instanceof ShadowRoot && e.host instanceof HTMLElement;
|
|
859
|
-
if (o) {
|
|
860
|
-
t = e.host;
|
|
861
|
-
} else {
|
|
862
|
-
t = t.parentElement;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
// Return the document's bounding rect if no element is found
|
|
866
|
-
this.rootElementRect = {
|
|
867
|
-
top: 0,
|
|
868
|
-
bottom: 0,
|
|
869
|
-
left: 0,
|
|
870
|
-
right: 0,
|
|
871
|
-
height: window.visualViewport.height,
|
|
872
|
-
width: window.visualViewport.width
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
871
|
// #endregion
|
|
876
872
|
// #region Render Methods
|
|
877
873
|
render() {
|
|
878
|
-
const t = [ "container", this.currentDirection ];
|
|
874
|
+
const t = [ "container", this.currentDirection, this.align ];
|
|
879
875
|
if (this.show) t.push("show");
|
|
876
|
+
if (this.block) t.push("block");
|
|
880
877
|
if (this.mode === "legacy") t.push("legacy");
|
|
881
|
-
return
|
|
882
|
-
key: "
|
|
878
|
+
return i("div", {
|
|
879
|
+
key: "c9bbcb53ba8f8bb8879d96cd2f828943dea32b92",
|
|
883
880
|
ref: t => this.containerElement = t,
|
|
884
881
|
class: t.join(" "),
|
|
885
882
|
"test-id": "outerContainer",
|
|
886
|
-
tabIndex: -1
|
|
887
|
-
|
|
888
|
-
|
|
883
|
+
tabIndex: -1,
|
|
884
|
+
popover: "auto"
|
|
885
|
+
}, i("div", {
|
|
886
|
+
key: "4088186bfb7b320fcd8836bcef40b90a685caf9e",
|
|
889
887
|
ref: t => this.contentElement = t,
|
|
890
888
|
class: "content"
|
|
891
|
-
},
|
|
892
|
-
key: "
|
|
889
|
+
}, i("slot", {
|
|
890
|
+
key: "0876866b03a8708a0b401df638d3146263afc141"
|
|
893
891
|
})));
|
|
894
892
|
}
|
|
895
893
|
get hostElement() {
|
|
@@ -903,8 +901,8 @@ const w = class {
|
|
|
903
901
|
}
|
|
904
902
|
};
|
|
905
903
|
|
|
906
|
-
|
|
904
|
+
f.style = b;
|
|
907
905
|
|
|
908
|
-
export {
|
|
906
|
+
export { u as q2_option_list, f as q2_popover };
|
|
909
907
|
//# sourceMappingURL=q2-option-list.q2-popover.entry.esm.js.map
|
|
910
908
|
//# sourceMappingURL=q2-option-list_2.entry.js.map
|