q2-tecton-elements 1.52.2 → 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle-report.json +43422 -0
- package/dist/cjs/{action-sheet-d32c41ae.js → action-sheet-8254c0fd.js} +6 -3
- package/dist/cjs/action-sheet-8254c0fd.js.map +1 -0
- package/dist/cjs/click-elsewhere.cjs.entry.js +96 -0
- package/dist/cjs/click-elsewhere.cjs.entry.js.map +1 -0
- package/dist/cjs/{index-07285783.js → index-76f63767.js} +1 -21
- package/dist/cjs/index-76f63767.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-group.cjs.entry.js +38 -17
- package/dist/cjs/q2-action-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-badge_7.cjs.entry.js +52 -18
- package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q2-detail.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +17 -16
- package/dist/cjs/q2-dropdown-item.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +48 -99
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-file-picker.cjs.entry.js +236 -0
- package/dist/cjs/q2-file-picker.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-item_3.cjs.entry.js +251 -0
- package/dist/cjs/q2-item_3.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/{q2-option-list.cjs.entry.js → q2-option-list_2.cjs.entry.js} +355 -21
- package/dist/cjs/q2-option-list_2.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-option.cjs.entry.js +18 -4
- package/dist/cjs/q2-option.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +4 -4
- package/dist/cjs/q2-pill.cjs.entry.js +14 -9
- package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
- package/dist/cjs/q2-resize-observer.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +3 -3
- package/dist/cjs/q2-select.cjs.entry.js +8 -5
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- 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-tag.cjs.entry.js +9 -4
- package/dist/cjs/q2-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- 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 +1 -0
- package/dist/collection/components/q2-action-group/q2-action-group.css +25 -8
- package/dist/collection/components/q2-action-group/q2-action-group.js +55 -33
- package/dist/collection/components/q2-action-group/q2-action-group.js.map +1 -1
- package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js +142 -6
- package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js.map +1 -1
- package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js +126 -62
- package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js.map +1 -1
- package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.e2e.js +1 -1
- package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-avatar/q2-avatar.css +5 -0
- package/dist/collection/components/q2-btn/q2-btn.css +74 -0
- package/dist/collection/components/q2-btn/q2-btn.js +50 -16
- package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
- package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js +29 -0
- package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +83 -103
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +188 -24
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.css +1 -1
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js +54 -16
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
- package/dist/collection/components/q2-file-picker/q2-file-picker.css +307 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +426 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js +11 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js.map +1 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js +435 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js.map +1 -0
- package/dist/collection/components/q2-item/q2-item.css +3 -0
- package/dist/collection/components/q2-link/q2-link.js +26 -7
- package/dist/collection/components/q2-link/q2-link.js.map +1 -1
- package/dist/collection/components/q2-link/test/q2-link-test.e2e.js +20 -118
- package/dist/collection/components/q2-link/test/q2-link-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-link/test/q2-link-test.spec.js +193 -0
- package/dist/collection/components/q2-link/test/q2-link-test.spec.js.map +1 -0
- package/dist/collection/components/q2-list/q2-list.css +6 -0
- package/dist/collection/components/q2-loading/q2-loading.js +1 -1
- package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
- package/dist/collection/components/q2-option/q2-option.css +9 -3
- package/dist/collection/components/q2-option/q2-option.js +37 -4
- package/dist/collection/components/q2-option/q2-option.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.spec.js +22 -0
- package/dist/collection/components/q2-option/test/q2-option-test.spec.js.map +1 -1
- package/dist/collection/components/q2-option-list/q2-option-list.js +56 -29
- package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
- package/dist/collection/components/q2-option-list/test/q2-option-list.spec.js +489 -0
- package/dist/collection/components/q2-option-list/test/q2-option-list.spec.js.map +1 -0
- package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
- package/dist/collection/components/q2-pill/q2-pill.js +12 -7
- package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +109 -1
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +1 -1
- 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 +7 -4
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +1 -14
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.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 +7 -2
- package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +1 -1
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/collection/utils/action-sheet.js +5 -2
- package/dist/collection/utils/action-sheet.js.map +1 -1
- package/dist/collection/utils/helpers.js +29 -3
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/test/action-sheet-test.e2e.js +34 -6
- package/dist/collection/utils/test/action-sheet-test.e2e.js.map +1 -1
- package/dist/components/action-sheet.js +6 -3
- package/dist/components/action-sheet.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +1 -20
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-action-group.js +41 -19
- package/dist/components/q2-action-group.js.map +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-avatar2.js.map +1 -1
- package/dist/components/q2-btn2.js +50 -16
- package/dist/components/q2-btn2.js.map +1 -1
- package/dist/components/q2-dropdown-item2.js +19 -17
- package/dist/components/q2-dropdown-item2.js.map +1 -1
- package/dist/components/q2-dropdown.js +67 -110
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-file-picker.d.ts +11 -0
- package/dist/components/q2-file-picker.js +301 -0
- package/dist/components/q2-file-picker.js.map +1 -0
- package/dist/components/q2-item.js +1 -130
- package/dist/components/q2-item.js.map +1 -1
- package/dist/{esm/q2-item.entry.js → components/q2-item2.js} +29 -11
- package/dist/components/q2-item2.js.map +1 -0
- package/dist/components/q2-link.js +1 -86
- package/dist/components/q2-link.js.map +1 -1
- package/dist/{esm/q2-link.entry.js → components/q2-link2.js} +42 -10
- package/dist/components/q2-link2.js.map +1 -0
- package/dist/components/q2-list.js +1 -94
- package/dist/components/q2-list.js.map +1 -1
- package/dist/{esm/q2-list.entry.js → components/q2-list2.js} +30 -11
- package/dist/components/q2-list2.js.map +1 -0
- package/dist/components/q2-loading2.js.map +1 -1
- package/dist/components/q2-option-list2.js +44 -19
- package/dist/components/q2-option-list2.js.map +1 -1
- package/dist/components/q2-option2.js +20 -4
- package/dist/components/q2-option2.js.map +1 -1
- package/dist/components/q2-pagination.js +3 -3
- package/dist/components/q2-pill.js +13 -8
- package/dist/components/q2-pill.js.map +1 -1
- package/dist/components/q2-popover2.js +1 -1
- 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 +8 -5
- 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 +8 -3
- package/dist/components/q2-tag.js.map +1 -1
- package/dist/components/tecton-tab-pane.js +2 -2
- package/dist/esm/{action-sheet-e64cb6f7.js → action-sheet-1e24cb38.js} +7 -4
- package/dist/esm/action-sheet-1e24cb38.js.map +1 -0
- package/dist/esm/click-elsewhere.entry.js +92 -0
- package/dist/esm/click-elsewhere.entry.js.map +1 -0
- package/dist/esm/{index-d18e2a20.js → index-504f1a9e.js} +2 -21
- package/dist/esm/index-504f1a9e.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-group.entry.js +39 -18
- package/dist/esm/q2-action-group.entry.js.map +1 -1
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-avatar.entry.js.map +1 -1
- package/dist/esm/q2-badge_7.entry.js +52 -18
- package/dist/esm/q2-badge_7.entry.js.map +1 -1
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +1 -1
- package/dist/esm/q2-detail.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +18 -17
- package/dist/esm/q2-dropdown-item.entry.js.map +1 -1
- package/dist/esm/q2-dropdown.entry.js +48 -99
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-file-picker.entry.js +232 -0
- package/dist/esm/q2-file-picker.entry.js.map +1 -0
- package/dist/esm/q2-item_3.entry.js +245 -0
- package/dist/esm/q2-item_3.entry.js.map +1 -0
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/{q2-option-list.entry.js → q2-option-list_2.entry.js} +355 -22
- package/dist/esm/q2-option-list_2.entry.js.map +1 -0
- package/dist/esm/q2-option.entry.js +18 -4
- package/dist/esm/q2-option.entry.js.map +1 -1
- package/dist/esm/q2-pagination.entry.js +4 -4
- package/dist/esm/q2-pill.entry.js +14 -9
- package/dist/esm/q2-pill.entry.js.map +1 -1
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-relative-time.entry.js +2 -2
- package/dist/esm/q2-resize-observer.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +3 -3
- package/dist/esm/q2-select.entry.js +8 -5
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js +2 -2
- package/dist/esm/q2-tag.entry.js +9 -4
- package/dist/esm/q2-tag.entry.js.map +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/action-sheet-1e24cb38.js +80 -0
- package/dist/q2-tecton-elements/action-sheet-1e24cb38.js.map +1 -0
- package/dist/q2-tecton-elements/click-elsewhere.entry.js +90 -0
- package/dist/q2-tecton-elements/click-elsewhere.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{index-d18e2a20.js → index-504f1a9e.js} +51 -69
- package/dist/q2-tecton-elements/index-504f1a9e.js.map +1 -0
- package/dist/q2-tecton-elements/q2-action-group.entry.js +57 -33
- package/dist/q2-tecton-elements/q2-action-group.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-avatar.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-avatar.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +222 -181
- package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-calendar.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-data-table.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-detail.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +34 -34
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +86 -137
- package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +339 -0
- package/dist/q2-tecton-elements/q2-file-picker.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-item_3.entry.js +332 -0
- package/dist/q2-tecton-elements/q2-item_3.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-message.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js +902 -0
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-option.entry.js +31 -21
- package/dist/q2-tecton-elements/q2-option.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.js +34 -34
- package/dist/q2-tecton-elements/q2-pill.entry.js +24 -20
- package/dist/q2-tecton-elements/q2-pill.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-radio.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-section.entry.js +19 -19
- package/dist/q2-tecton-elements/q2-select.entry.js +21 -18
- package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +37 -37
- package/dist/q2-tecton-elements/q2-stepper.entry.js +29 -29
- package/dist/q2-tecton-elements/q2-tag.entry.js +15 -11
- package/dist/q2-tecton-elements/q2-tag.entry.js.map +1 -1
- 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/q2-tecton-elements/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
- package/dist/types/components/q2-action-group/q2-action-group.d.ts +19 -11
- package/dist/types/components/q2-btn/q2-btn.d.ts +8 -3
- package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +18 -9
- package/dist/types/components/q2-dropdown-item/q2-dropdown-item.d.ts +14 -1
- package/dist/types/components/q2-file-picker/q2-file-picker.d.ts +98 -0
- package/dist/types/components/q2-link/q2-link.d.ts +8 -6
- package/dist/types/components/q2-loading/q2-loading.d.ts +2 -2
- package/dist/types/components/q2-option/q2-option.d.ts +10 -1
- package/dist/types/components/q2-option-list/q2-option-list.d.ts +9 -8
- package/dist/types/components/q2-pill/q2-pill.d.ts +2 -2
- package/dist/types/components.d.ts +192 -28
- package/dist/types/util.d.ts +1 -0
- package/dist/types/utils/helpers.d.ts +1 -1
- package/package.json +4 -3
- package/dist/cjs/action-sheet-d32c41ae.js.map +0 -1
- package/dist/cjs/click-elsewhere_2.cjs.entry.js +0 -406
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +0 -1
- package/dist/cjs/index-07285783.js.map +0 -1
- package/dist/cjs/q2-item.cjs.entry.js +0 -120
- package/dist/cjs/q2-item.cjs.entry.js.map +0 -1
- package/dist/cjs/q2-link.cjs.entry.js +0 -64
- package/dist/cjs/q2-link.cjs.entry.js.map +0 -1
- package/dist/cjs/q2-list.cjs.entry.js +0 -83
- package/dist/cjs/q2-list.cjs.entry.js.map +0 -1
- package/dist/cjs/q2-option-list.cjs.entry.js.map +0 -1
- package/dist/esm/action-sheet-e64cb6f7.js.map +0 -1
- package/dist/esm/click-elsewhere_2.entry.js +0 -401
- package/dist/esm/click-elsewhere_2.entry.js.map +0 -1
- package/dist/esm/index-d18e2a20.js.map +0 -1
- package/dist/esm/q2-item.entry.js.map +0 -1
- package/dist/esm/q2-link.entry.js.map +0 -1
- package/dist/esm/q2-list.entry.js.map +0 -1
- package/dist/esm/q2-option-list.entry.js.map +0 -1
- package/dist/q2-tecton-elements/action-sheet-e64cb6f7.js +0 -77
- package/dist/q2-tecton-elements/action-sheet-e64cb6f7.js.map +0 -1
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js +0 -398
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js.map +0 -1
- package/dist/q2-tecton-elements/index-d18e2a20.js.map +0 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +0 -158
- package/dist/q2-tecton-elements/q2-item.entry.js.map +0 -1
- package/dist/q2-tecton-elements/q2-link.entry.js +0 -83
- package/dist/q2-tecton-elements/q2-link.entry.js.map +0 -1
- package/dist/q2-tecton-elements/q2-list.entry.js +0 -100
- package/dist/q2-tecton-elements/q2-list.entry.js.map +0 -1
- package/dist/q2-tecton-elements/q2-option-list.entry.js +0 -585
- package/dist/q2-tecton-elements/q2-option-list.entry.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { h as e } from "./index-7a5365e2.js";
|
|
2
2
|
|
|
3
3
|
const debounce = (e, n = 300) => {
|
|
4
|
-
let
|
|
5
|
-
return function(...
|
|
6
|
-
clearTimeout(
|
|
7
|
-
|
|
8
|
-
e(...
|
|
4
|
+
let i;
|
|
5
|
+
return function(...o) {
|
|
6
|
+
clearTimeout(i);
|
|
7
|
+
i = setTimeout((() => {
|
|
8
|
+
e(...o);
|
|
9
9
|
}), n);
|
|
10
10
|
};
|
|
11
11
|
};
|
|
@@ -14,31 +14,13 @@ function isMobile() {
|
|
|
14
14
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(navigator.userAgent);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
function isHostLosingFocus(e, n) {
|
|
18
|
-
const o = e.type;
|
|
19
|
-
const i = [ "focusin", "focus" ];
|
|
20
|
-
const t = i.includes(o);
|
|
21
|
-
// on focusin: `target` is element losing focus, `relatedTarget` is element gaining focus
|
|
22
|
-
// on focusout: `target` is element gaining focus, `relatedTarget` is element losing focus
|
|
23
|
-
const a = t ? e.target : e.relatedTarget;
|
|
24
|
-
const isElementNestedInHostElement = e => {
|
|
25
|
-
if (e === n) return true;
|
|
26
|
-
if (e.parentElement) {
|
|
27
|
-
return isElementNestedInHostElement(e.parentElement);
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
};
|
|
31
|
-
if (!(a instanceof HTMLElement)) return true;
|
|
32
|
-
return !isElementNestedInHostElement(a);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
17
|
function isRelatedTargetWithinHost(e, n) {
|
|
36
18
|
return e.relatedTarget !== n && !n.contains(e.relatedTarget);
|
|
37
19
|
}
|
|
38
20
|
|
|
39
21
|
function isEventFromElement(e, n) {
|
|
40
|
-
var
|
|
41
|
-
return ((
|
|
22
|
+
var i;
|
|
23
|
+
return ((i = e.composedPath) === null || i === void 0 ? void 0 : i.call(e)[0]) === n;
|
|
42
24
|
}
|
|
43
25
|
|
|
44
26
|
function overrideFocus(e) {
|
|
@@ -87,24 +69,24 @@ function waitForNextPaint() {
|
|
|
87
69
|
}
|
|
88
70
|
|
|
89
71
|
function loc(e, n) {
|
|
90
|
-
var
|
|
72
|
+
var i, o, t;
|
|
91
73
|
if (!e) return "";
|
|
92
|
-
if (((
|
|
74
|
+
if (((i = window.Tecton) === null || i === void 0 ? void 0 : i.noStrings) === true) {
|
|
93
75
|
return e;
|
|
94
76
|
}
|
|
95
|
-
return (t = (
|
|
77
|
+
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;
|
|
96
78
|
}
|
|
97
79
|
|
|
98
80
|
function renderLabel(n) {
|
|
99
|
-
const {label:
|
|
81
|
+
const {label: i, hideLabel: o, optional: t, readonly: a} = n;
|
|
100
82
|
const r = [ "input-label" ];
|
|
101
83
|
let s = "";
|
|
102
|
-
let l =
|
|
84
|
+
let l = o;
|
|
103
85
|
if (!l) {
|
|
104
86
|
const e = n.hostElement.querySelectorAll('[slot="label"]');
|
|
105
|
-
const
|
|
106
|
-
const t = !!
|
|
107
|
-
l = t ||
|
|
87
|
+
const o = e.length > 0;
|
|
88
|
+
const t = !!i;
|
|
89
|
+
l = t || o ? false : true;
|
|
108
90
|
}
|
|
109
91
|
if (l) r.push("sr");
|
|
110
92
|
if (t) {
|
|
@@ -123,7 +105,7 @@ function renderLabel(n) {
|
|
|
123
105
|
class: r.join(" ")
|
|
124
106
|
}, e("slot", {
|
|
125
107
|
name: "label"
|
|
126
|
-
},
|
|
108
|
+
}, i ? loc(i) : undefined, s));
|
|
127
109
|
}
|
|
128
110
|
|
|
129
111
|
function hasSlotContent(e, n) {
|
|
@@ -134,8 +116,8 @@ function handleAriaLabel(e) {
|
|
|
134
116
|
const {ariaLabel: n} = e;
|
|
135
117
|
if (!n) return;
|
|
136
118
|
// If empty ariaLabel prop is set to primitive symbol by framework wrapper, set ariaLabel to undefined and return
|
|
137
|
-
const
|
|
138
|
-
if (n ===
|
|
119
|
+
const i = Symbol().toString();
|
|
120
|
+
if (n === i) {
|
|
139
121
|
e.ariaLabel = undefined;
|
|
140
122
|
return;
|
|
141
123
|
}
|
|
@@ -147,57 +129,57 @@ function handleAriaLabel(e) {
|
|
|
147
129
|
|
|
148
130
|
/**
|
|
149
131
|
* Handles when a prop has been renamed on a component without introducing a breaking change.
|
|
150
|
-
*/ function handleRenamedProp(e, n,
|
|
132
|
+
*/ function handleRenamedProp(e, n, i, o) {
|
|
151
133
|
if (typeof e[n] === "undefined") return;
|
|
152
134
|
// If old prop has value, aka set in component, call handleDeprecationWarning()
|
|
153
135
|
if (e[n]) {
|
|
154
136
|
handleDeprecationWarning(e, n, "prop");
|
|
155
137
|
}
|
|
156
|
-
e[
|
|
157
|
-
if (
|
|
138
|
+
e[i] = e[n];
|
|
139
|
+
if (o) {
|
|
158
140
|
delete e[n];
|
|
159
141
|
}
|
|
160
142
|
}
|
|
161
143
|
|
|
162
|
-
function handleDeprecationWarning(e, n,
|
|
144
|
+
function handleDeprecationWarning(e, n, i) {
|
|
163
145
|
if (window.location.hostname === "localhost" || window.location.host === "stack.q2developer.com") {
|
|
164
146
|
if (e[n] === "undefined") return;
|
|
165
|
-
const
|
|
166
|
-
switch (
|
|
147
|
+
const o = e.constructor.name.toLowerCase().slice(2);
|
|
148
|
+
switch (i) {
|
|
167
149
|
case "prop":
|
|
168
|
-
if (n === "size" &&
|
|
150
|
+
if (n === "size" && o === "btn") {
|
|
169
151
|
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" `);
|
|
170
152
|
} else {
|
|
171
|
-
console.warn(`The property ${n} in q2-${
|
|
153
|
+
console.warn(`The property ${n} in q2-${o} has been marked for deprecation and will be removed in an upcoming major release.`);
|
|
172
154
|
}
|
|
173
155
|
break;
|
|
174
156
|
|
|
175
157
|
case "function":
|
|
176
|
-
console.warn(`The function ${n} in ${
|
|
158
|
+
console.warn(`The function ${n} in ${o} has been marked for deprecation and will be removed in an upcoming major release.`);
|
|
177
159
|
break;
|
|
178
160
|
|
|
179
161
|
case "method":
|
|
180
|
-
console.warn(`The method ${n} in ${
|
|
162
|
+
console.warn(`The method ${n} in ${o} has been marked for deprecation and will be removed in an upcoming major release.`);
|
|
181
163
|
break;
|
|
182
164
|
|
|
183
165
|
case "event":
|
|
184
|
-
console.warn(`The event ${n} in ${
|
|
166
|
+
console.warn(`The event ${n} in ${o} has been marked for deprecation and will be removed in an upcoming major release.`);
|
|
185
167
|
break;
|
|
186
168
|
|
|
187
169
|
default:
|
|
188
|
-
console.error(`handleDeprecationWarning --\x3e No type found for desired deprecation: ${n} in q2-${
|
|
170
|
+
console.error(`handleDeprecationWarning --\x3e No type found for desired deprecation: ${n} in q2-${o}: deprecatedItemType = ${n}`);
|
|
189
171
|
}
|
|
190
172
|
}
|
|
191
173
|
}
|
|
192
174
|
|
|
193
175
|
function renderMessages(n) {
|
|
194
|
-
const
|
|
176
|
+
const i = n.hasError ? "danger" : "info";
|
|
195
177
|
return e("div", {
|
|
196
178
|
class: "messages-container"
|
|
197
179
|
}, e("q2-message", {
|
|
198
180
|
appearance: "minimal",
|
|
199
181
|
description: true,
|
|
200
|
-
type:
|
|
182
|
+
type: i,
|
|
201
183
|
"test-id": "message"
|
|
202
184
|
}, e("ul", {
|
|
203
185
|
id: n.inputDescribedBy
|
|
@@ -208,16 +190,16 @@ function renderMessages(n) {
|
|
|
208
190
|
|
|
209
191
|
function setMessageHeight(e) {
|
|
210
192
|
const n = e.hostElement.shadowRoot.querySelector(".messages-container");
|
|
211
|
-
const
|
|
193
|
+
const i = n.querySelector("q2-message");
|
|
212
194
|
nextPaint((() => {
|
|
213
|
-
const
|
|
214
|
-
if (n.style.getPropertyValue("height") === `${
|
|
215
|
-
if (
|
|
216
|
-
|
|
195
|
+
const o = e.showMessages && e.hasFocus ? i.getBoundingClientRect().height : 0;
|
|
196
|
+
if (n.style.getPropertyValue("height") === `${o}px`) return;
|
|
197
|
+
if (o === 0) {
|
|
198
|
+
i.classList.add("invisible");
|
|
217
199
|
n.style.removeProperty("height");
|
|
218
200
|
} else {
|
|
219
|
-
|
|
220
|
-
n.style.setProperty("height", `${
|
|
201
|
+
i.classList.remove("invisible");
|
|
202
|
+
n.style.setProperty("height", `${o}px`);
|
|
221
203
|
}
|
|
222
204
|
}));
|
|
223
205
|
}
|
|
@@ -246,28 +228,28 @@ const handleColor = e => {
|
|
|
246
228
|
* @return {Promise<string>} All translated text content in DOM order
|
|
247
229
|
*/ const getAllText = async (e, n = {}) => {
|
|
248
230
|
if (!e) return "";
|
|
249
|
-
const
|
|
231
|
+
const i = Object.assign({
|
|
250
232
|
trim: true,
|
|
251
233
|
normalizeWhitespace: false,
|
|
252
234
|
skipComponentReady: false
|
|
253
235
|
}, n);
|
|
254
|
-
const
|
|
236
|
+
const o = new Set([ "STYLE", "SCRIPT", "NOSCRIPT", "TEMPLATE", "#comment" ]);
|
|
255
237
|
const t = new WeakSet;
|
|
256
238
|
let a = "";
|
|
257
239
|
async function processNode(e) {
|
|
258
240
|
var n;
|
|
259
|
-
if (t.has(e) ||
|
|
241
|
+
if (t.has(e) || o.has(e.nodeName)) return;
|
|
260
242
|
t.add(e);
|
|
261
243
|
// Handle text nodes
|
|
262
244
|
if (e.nodeType === Node.TEXT_NODE) {
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
245
|
+
const o = i.trim ? e.textContent.trim() : e.textContent;
|
|
246
|
+
if (o) {
|
|
265
247
|
// Add space between adjacent text nodes if needed
|
|
266
|
-
if (a && !a.endsWith(" ") && !
|
|
248
|
+
if (a && !a.endsWith(" ") && !o.startsWith(" ")) {
|
|
267
249
|
a += " ";
|
|
268
250
|
}
|
|
269
251
|
// Translate the text
|
|
270
|
-
a +=
|
|
252
|
+
a += i.skipComponentReady ? (n = window.TectonElements) === null || n === void 0 ? void 0 : n.loc(o) : loc(o);
|
|
271
253
|
}
|
|
272
254
|
return;
|
|
273
255
|
}
|
|
@@ -275,7 +257,7 @@ const handleColor = e => {
|
|
|
275
257
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
276
258
|
// Wait for Stencil component if needed
|
|
277
259
|
const n = e.nodeName.startsWith("Q2-") && typeof e.componentOnReady === "function";
|
|
278
|
-
if (n && !
|
|
260
|
+
if (n && !i.skipComponentReady) {
|
|
279
261
|
await e.componentOnReady();
|
|
280
262
|
}
|
|
281
263
|
// Process children in light DOM
|
|
@@ -310,14 +292,14 @@ const handleColor = e => {
|
|
|
310
292
|
}
|
|
311
293
|
await processNode(e);
|
|
312
294
|
// Apply final formatting
|
|
313
|
-
if (
|
|
295
|
+
if (i.trim) {
|
|
314
296
|
a = a.trim();
|
|
315
297
|
}
|
|
316
|
-
if (
|
|
298
|
+
if (i.normalizeWhitespace) {
|
|
317
299
|
a = a.replace(/\s+/g, " ");
|
|
318
300
|
}
|
|
319
301
|
return a;
|
|
320
302
|
};
|
|
321
303
|
|
|
322
|
-
export { handleAriaLabel as a, handleColor as b, createGuid as c, isMobile as d, hasSlotContent as e, renderLabel as f, getAriaValueFromProp as g, handleDeprecationWarning as h, isEventFromElement as i, handleRenamedProp as j, isTouchDevice as k, loc as l, resizeIframe as m, nextPaint as n, overrideFocus as o, debounce as p, isRelatedTargetWithinHost as q, renderMessages as r, setMessageHeight as s,
|
|
323
|
-
//# sourceMappingURL=index-
|
|
304
|
+
export { handleAriaLabel as a, handleColor as b, createGuid as c, isMobile as d, hasSlotContent as e, renderLabel as f, getAriaValueFromProp as g, handleDeprecationWarning as h, isEventFromElement as i, handleRenamedProp as j, isTouchDevice as k, loc as l, resizeIframe as m, nextPaint as n, overrideFocus as o, debounce as p, isRelatedTargetWithinHost as q, renderMessages as r, setMessageHeight as s, isFirefox as t, getAllText as u, isVisible as v, waitForNextPaint as w };
|
|
305
|
+
//# sourceMappingURL=index-504f1a9e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["debounce","fn","delay","timeout","args","clearTimeout","setTimeout","isMobile","test","navigator","userAgent","isRelatedTargetWithinHost","event","element","relatedTarget","contains","isEventFromElement","_a","composedPath","call","overrideFocus","hostElement","focus","dispatchEvent","FocusEvent","bubbles","isFirefox","toLowerCase","includes","isTouchDevice","window","maxTouchPoints","getAriaValueFromProp","prop","validValues","undefined","guid","createGuid","nextPaint","requestAnimationFrame","isVisible","offsetWidth","offsetHeight","getClientRects","length","waitForNextPaint","Promise","resolve","loc","key","subs","Tecton","noStrings","_c","_b","TectonElements","renderLabel","target","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","renderMessages","type","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","getAllText","async","options","opts","Object","assign","trim","normalizeWhitespace","skipComponentReady","nodesToSkip","Set","processedNodes","WeakSet","result","processNode","node","has","nodeName","nodeType","Node","TEXT_NODE","text","textContent","endsWith","startsWith","ELEMENT_NODE","isStencilComponent","componentOnReady","child","childNodes","shadowChild","assignedNodes","assigned","fallback","replace"],"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 const debounce = <F extends (...args: Parameters<F>) => ReturnType<F>>(fn: F, delay: number = 300) => {\n let timeout: ReturnType<typeof setTimeout>;\n return function (...args: Parameters<F>) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n fn(...args);\n }, delay);\n };\n};\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 renderLabel(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 renderMessages(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\n/**\n * Gets all translated text content from an element, including shadow DOM content\n *\n * @param {Element} element - The element to extract text from\n * @param {Object} options - Configuration options\n * @param {boolean} [options.trim=true] - Whether to trim whitespace\n * @param {boolean} [options.normalizeWhitespace=false] - Whether to normalize whitespace\n * @param {boolean} [options.skipComponentReady=false] - Skip waiting for components (for test environments)\n * @return {Promise<string>} All translated text content in DOM order\n */\nexport const getAllText = async (element, options = {}) => {\n if (!element) return '';\n\n const opts = {\n trim: true,\n normalizeWhitespace: false,\n skipComponentReady: false,\n ...options,\n };\n\n const nodesToSkip = new Set(['STYLE', 'SCRIPT', 'NOSCRIPT', 'TEMPLATE', '#comment']);\n const processedNodes = new WeakSet();\n let result = '';\n\n async function processNode(node) {\n if (processedNodes.has(node) || nodesToSkip.has(node.nodeName)) return;\n\n processedNodes.add(node);\n\n // Handle text nodes\n if (node.nodeType === Node.TEXT_NODE) {\n const text = opts.trim ? node.textContent.trim() : node.textContent;\n\n if (text) {\n // Add space between adjacent text nodes if needed\n if (result && !result.endsWith(' ') && !text.startsWith(' ')) {\n result += ' ';\n }\n\n // Translate the text\n result += opts.skipComponentReady ? window.TectonElements?.loc(text) : loc(text);\n }\n return;\n }\n\n // Handle element nodes\n if (node.nodeType === Node.ELEMENT_NODE) {\n // Wait for Stencil component if needed\n const isStencilComponent = node.nodeName.startsWith('Q2-') && typeof node.componentOnReady === 'function';\n\n if (isStencilComponent && !opts.skipComponentReady) {\n await node.componentOnReady();\n }\n\n // Process children in light DOM\n for (const child of node.childNodes) {\n await processNode(child);\n }\n\n // Process shadow DOM if present\n if (node.shadowRoot) {\n for (const shadowChild of node.shadowRoot.childNodes) {\n await processNode(shadowChild);\n }\n }\n\n // Handle slot elements with assigned nodes\n if (node.nodeName === 'SLOT' && typeof node.assignedNodes === 'function') {\n const assignedNodes = node.assignedNodes();\n\n if (assignedNodes.length > 0) {\n for (const assigned of assignedNodes) {\n if (!processedNodes.has(assigned)) {\n await processNode(assigned);\n }\n }\n } else {\n // Process slot fallback content\n for (const fallback of node.childNodes) {\n if (!processedNodes.has(fallback)) {\n await processNode(fallback);\n }\n }\n }\n }\n }\n }\n\n await processNode(element);\n\n // Apply final formatting\n if (opts.trim) {\n result = result.trim();\n }\n\n if (opts.normalizeWhitespace) {\n result = result.replace(/\\s+/g, ' ');\n }\n\n return result;\n};\n"],"mappings":";;MAgBaA,WAAW,CAAsDC,GAAOC,IAAgB;EACjG,IAAIC;EACJ,OAAO,YAAaC;IAChBC,aAAaF;IACbA,IAAUG,YAAW;MACjBL,KAAMG;AAAK,QACZF;;AACN;;SAGWK;EACZ,OAAO,sFAAsFC,KACzFC,UAAUC;AAElB;;SAuBgBC,0BAA0BC,GAAmBC;EACzD,OAAOD,EAAME,kBAAkBD,MAAYA,EAAQE,SAASH,EAAME;AACtE;;SAEgBE,mBAAmBJ,GAAcC;;EAC7C,SAAOI,IAAAL,EAAMM,kBAAY,QAAAD,WAAA,aAAAA,EAAAE,KAAAP,GAAK,QAAOC;AACzC;;SAEgBO,cAAcC;EAC1BA,EAAYC,QAAQ,MAAMD,MAAW,QAAXA,WAAW,aAAXA,EAAaE,cAAc,IAAIC,WAAW,SAAS;IAAEC,SAAS;;AAC5F;;SAEgBC;EACZ,MAAMhB,IAAYD,UAAUC,UAAUiB;EACtC,OAAOjB,EAAUkB,SAAS;AAC9B;;SAE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,KAAKlB,EAAeK,IAAIiB,IAAW;oBACzBnB,YAAYmB;;;;;;;QAQpCnB,YAAYjI;;IAGlB,IAAIsH,EAAKG,MAAM;IACXO,IAASA,EAAOP;;EAGpB,IAAIH,EAAKI,qBAAqB;IAC1BM,IAASA,EAAOqB,QAAQ,QAAQ;;EAGpC,OAAOrB;AAAM"}
|
|
@@ -1,44 +1,64 @@
|
|
|
1
|
-
import { r as t, h as
|
|
1
|
+
import { r as t, h as i, g as o } from "./index-7a5365e2.js";
|
|
2
2
|
|
|
3
|
-
import { n as
|
|
3
|
+
import { n as e } from "./index-504f1a9e.js";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
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(:not([hidden])){display:block;width:100%;--comp-default-action-group-margin:var(--app-scale-5x, 25px) 0;margin:var(--tct-action-group-margin, var(--comp-default-action-group-margin))}.container{--comp-default-action-group-gap:var(--tct-action-group-gap, var(--app-scale-2x, 10px));--comp-link-gap:var(--tct-action-group-gap, var(--app-scale-4x, 20px));width:100%;display:flex;gap:var(--comp-default-action-group-gap)}.container.vertical{flex-direction:var(--tct-action-group-vertical-flex-direction, column)}.container.vertical ::slotted(q2-btn){display:block;width:100%}.container.horizontal{justify-content:var(--tct-action-group-horizontal-justify-content, flex-start);flex-direction:var(--tct-action-group-horizontal-flex-direction, row-reverse);align-items:var(--tct-action-group-horizontal-align-items, center);flex-wrap:var(--tct-action-group-horizontal-flex-wrap, wrap)}.container.horizontal.full-width{flex-wrap:nowrap}.container.horizontal.has-q2-link{gap:var(--comp-link-gap)}.container.horizontal.has-q2-link ::slotted(q2-link){position:relative}.container.horizontal.has-q2-link ::slotted(q2-link:not(:last-child))::before{content:"";display:inline-block;width:0;height:28px;border-left:1px solid var(--t-gray-12, #d9d9d9);position:absolute;left:calc(var(--comp-link-gap) * -0.5)}.container.vertical ::slotted(q2-btn),.container.horizontal.full-width ::slotted(q2-btn){display:block;width:100%}';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const a = n;
|
|
8
8
|
|
|
9
9
|
const r = class {
|
|
10
|
-
constructor(
|
|
11
|
-
t(this,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
constructor(i) {
|
|
11
|
+
t(this, i);
|
|
12
|
+
this.checkForQ2Link = () => {
|
|
13
|
+
const t = this.hostElement.querySelectorAll("q2-link");
|
|
14
|
+
this.hasQ2Link = t.length > 0;
|
|
15
|
+
};
|
|
16
|
+
this.handleResize = t => {
|
|
17
|
+
const i = t.detail.entries[0].contentRect.width;
|
|
18
|
+
const o = this.orientationThreshold > i;
|
|
19
|
+
this.autoOrientation = o ? "vertical" : "horizontal";
|
|
20
|
+
};
|
|
21
|
+
this.initMutationObserver = () => {
|
|
22
|
+
const t = new MutationObserver(this.onMutationObserved);
|
|
23
|
+
t.observe(this.hostElement, {
|
|
24
|
+
childList: true,
|
|
25
|
+
subtree: true
|
|
26
|
+
});
|
|
27
|
+
this.mutationObserver = t;
|
|
28
|
+
};
|
|
29
|
+
this.onMutationObserved = () => {
|
|
30
|
+
this.checkForQ2Link();
|
|
18
31
|
};
|
|
19
32
|
this.autoOrientation = "vertical";
|
|
20
|
-
this.
|
|
21
|
-
this.orientation = "auto";
|
|
33
|
+
this.hasQ2Link = false;
|
|
22
34
|
this.fullWidth = undefined;
|
|
35
|
+
this.orientation = "auto";
|
|
36
|
+
this.orientationThreshold = 440;
|
|
23
37
|
}
|
|
24
38
|
// #endregion
|
|
25
|
-
// #region Events
|
|
26
|
-
// #endregion
|
|
27
39
|
// #region Component Lifecycle Events
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
if (this.mutationObserver) {
|
|
42
|
+
this.mutationObserver.disconnect();
|
|
43
|
+
this.mutationObserver = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
this.checkForQ2Link();
|
|
48
|
+
if ("MutationObserver" in window) this.initMutationObserver();
|
|
49
|
+
}
|
|
32
50
|
// #endregion
|
|
33
51
|
// #region Watchers
|
|
34
52
|
toggleHiddenForOneFrame() {
|
|
35
53
|
const {container: t} = this;
|
|
36
54
|
t.style.display = "none";
|
|
37
55
|
// Fixes Safari not making the buttons fill the container when going from horizontal and full-width to vertical
|
|
38
|
-
|
|
56
|
+
e((() => e((() => {
|
|
39
57
|
t.style.display = null;
|
|
40
58
|
}))));
|
|
41
59
|
}
|
|
60
|
+
// #endregion
|
|
61
|
+
// #region Local Methods
|
|
42
62
|
get computedOrientation() {
|
|
43
63
|
let t = this.orientation;
|
|
44
64
|
if (!t) t = "auto";
|
|
@@ -52,23 +72,27 @@ const r = class {
|
|
|
52
72
|
// #endregion
|
|
53
73
|
// #region Render Methods
|
|
54
74
|
render() {
|
|
55
|
-
const {shouldDisableResizeObserver: t, computedOrientation:
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
n.push(
|
|
59
|
-
|
|
60
|
-
|
|
75
|
+
const {shouldDisableResizeObserver: t, computedOrientation: o, fullWidth: e, hasQ2Link: n} = this;
|
|
76
|
+
const a = [ "container" ];
|
|
77
|
+
if (e && o === "horizontal") a.push("full-width");
|
|
78
|
+
if (n) a.push("has-q2-link");
|
|
79
|
+
a.push(o);
|
|
80
|
+
return i("q2-resize-observer", {
|
|
81
|
+
key: "4a0d43a1ad7512a7b9864f20e5728a83449bf655",
|
|
61
82
|
onTctResize: this.handleResize,
|
|
62
83
|
disabled: t
|
|
63
|
-
},
|
|
64
|
-
key: "
|
|
84
|
+
}, i("div", {
|
|
85
|
+
key: "5641b2bd03ecbdf8e6d64a01aeb678fada71d56e",
|
|
65
86
|
ref: t => this.container = t,
|
|
66
|
-
class:
|
|
87
|
+
class: a.join(" "),
|
|
67
88
|
role: "group"
|
|
68
|
-
},
|
|
69
|
-
key: "
|
|
89
|
+
}, i("slot", {
|
|
90
|
+
key: "22759c9b188a7605945bd351992889e26aa423c1"
|
|
70
91
|
})));
|
|
71
92
|
}
|
|
93
|
+
get hostElement() {
|
|
94
|
+
return o(this);
|
|
95
|
+
}
|
|
72
96
|
static get watchers() {
|
|
73
97
|
return {
|
|
74
98
|
orientation: [ "toggleHiddenForOneFrame" ]
|
|
@@ -76,7 +100,7 @@ const r = class {
|
|
|
76
100
|
}
|
|
77
101
|
};
|
|
78
102
|
|
|
79
|
-
r.style =
|
|
103
|
+
r.style = a;
|
|
80
104
|
|
|
81
105
|
export { r as q2_action_group };
|
|
82
106
|
//# sourceMappingURL=q2-action-group.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["q2ActionGroupCss","Q2ActionGroupStyle0","
|
|
1
|
+
{"version":3,"names":["q2ActionGroupCss","Q2ActionGroupStyle0","Q2ActionGroup","this","checkForQ2Link","links","hostElement","querySelectorAll","hasQ2Link","length","handleResize","event","width","detail","entries","contentRect","shouldBeVertical","orientationThreshold","autoOrientation","initMutationObserver","observer","MutationObserver","onMutationObserved","observe","childList","subtree","mutationObserver","disconnectedCallback","disconnect","componentDidLoad","window","toggleHiddenForOneFrame","container","style","display","nextPaint","computedOrientation","orientation","shouldDisableResizeObserver","render","fullWidth","containerClassNames","push","h","key","onTctResize","disabled","ref","el","class","join","role"],"sources":["src/components/q2-action-group/q2-action-group.scss?tag=q2-action-group&encapsulation=shadow","src/components/q2-action-group/q2-action-group.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host(:not([hidden])) {\n display: block;\n width: 100%;\n --comp-default-action-group-margin: #{var-list(--app-scale-5x, 25px)} 0;\n margin: var-list(--tct-action-group-margin, --comp-default-action-group-margin);\n}\n\n.container {\n --comp-default-action-group-gap: #{var-list(--tct-action-group-gap, --app-scale-2x, 10px)};\n --comp-link-gap: #{var-list(--tct-action-group-gap, --app-scale-4x, 20px)};\n width: 100%;\n display: flex;\n gap: var(--comp-default-action-group-gap);\n\n &.vertical {\n flex-direction: var-list(--tct-action-group-vertical-flex-direction, column);\n\n ::slotted(q2-btn) {\n display: block;\n width: 100%;\n }\n }\n\n &.horizontal {\n justify-content: var-list(--tct-action-group-horizontal-justify-content, flex-start);\n flex-direction: var-list(--tct-action-group-horizontal-flex-direction, row-reverse);\n align-items: var-list(--tct-action-group-horizontal-align-items, center);\n flex-wrap: var-list(--tct-action-group-horizontal-flex-wrap, wrap);\n\n &.full-width {\n flex-wrap: nowrap;\n }\n\n &.has-q2-link {\n gap: var(--comp-link-gap);\n ::slotted(q2-link) {\n position: relative;\n }\n ::slotted(q2-link:not(:last-child))::before {\n content: '';\n display: inline-block;\n width: 0;\n height: 28px;\n border-left: 1px solid var(--t-gray-12, #d9d9d9);\n position: absolute;\n left: calc(var(--comp-link-gap) * -0.5);\n }\n }\n }\n\n &.vertical,\n &.horizontal.full-width {\n ::slotted(q2-btn) {\n display: block;\n width: 100%;\n }\n }\n}\n","import { Q2ResizeObserverCustomEvent } from '@/components';\nimport { nextPaint } from '@/utils';\nimport { Component, ComponentInterface, h, Element, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'q2-action-group',\n styleUrl: 'q2-action-group.scss',\n shadow: true,\n})\nexport class Q2ActionGroup implements ComponentInterface {\n // #region Own Properties\n\n container: HTMLDivElement;\n mutationObserver: MutationObserver;\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 autoOrientation: 'vertical' | 'horizontal' = 'vertical';\n\n @State()\n hasQ2Link: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /**\n * Whether the buttons should take up the full width of the container when in horizontal orientation.\n *\n * @warning\n * This will prevent the buttons from wrapping when the container is too small to fit all buttons.\n */\n @Prop({ reflect: true })\n fullWidth: boolean;\n\n /**\n * The orientation of the buttons, which will override the auto orientation.\n *\n * @info\n * This will override and disable the auto determination of the orientation.\n */\n @Prop({ reflect: true })\n orientation: 'auto' | 'vertical' | 'horizontal' = 'auto';\n\n /**\n * The width, in pixels, that determines whether to display the buttons in vertical or horizontal orientation\n *\n * @info\n * The component determines this based on the width of the element itself, not the browser window.\n */\n @Prop({ reflect: false })\n orientationThreshold: number = 440;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback(): void {\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n this.mutationObserver = null;\n }\n }\n\n componentDidLoad() {\n this.checkForQ2Link();\n if ('MutationObserver' in window) this.initMutationObserver();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('orientation')\n toggleHiddenForOneFrame() {\n const { container } = this;\n container.style.display = 'none';\n // Fixes Safari not making the buttons fill the container when going from horizontal and full-width to vertical\n nextPaint(() =>\n nextPaint(() => {\n container.style.display = null;\n })\n );\n }\n\n // #endregion\n // #region Local Methods\n\n get computedOrientation(): 'vertical' | 'horizontal' {\n let orientation = this.orientation;\n if (!orientation) orientation = 'auto';\n return orientation === 'auto' ? this.autoOrientation : orientation;\n }\n\n get shouldDisableResizeObserver(): boolean {\n let orientation = this.orientation;\n if (!orientation) orientation = 'auto';\n return orientation !== 'auto';\n }\n\n checkForQ2Link = () => {\n const links = this.hostElement.querySelectorAll('q2-link');\n this.hasQ2Link = links.length > 0;\n };\n\n handleResize = (\n event: Q2ResizeObserverCustomEvent<{\n entries: ResizeObserverEntry[];\n }>\n ) => {\n const width = event.detail.entries[0].contentRect.width;\n const shouldBeVertical = this.orientationThreshold > width;\n this.autoOrientation = shouldBeVertical ? 'vertical' : 'horizontal';\n };\n\n initMutationObserver = () => {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true, subtree: true });\n this.mutationObserver = observer;\n };\n\n onMutationObserved = () => {\n this.checkForQ2Link();\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { shouldDisableResizeObserver, computedOrientation, fullWidth, hasQ2Link } = this;\n const containerClassNames = ['container'];\n if (fullWidth && computedOrientation === 'horizontal') containerClassNames.push('full-width');\n if (hasQ2Link) containerClassNames.push('has-q2-link');\n containerClassNames.push(computedOrientation);\n\n return (\n <q2-resize-observer\n onTctResize={this.handleResize}\n disabled={shouldDisableResizeObserver}\n >\n <div\n ref={el => (this.container = el)}\n class={containerClassNames.join(' ')}\n role=\"group\"\n >\n <slot />\n </div>\n </q2-resize-observer>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;AAAA,MAAMA,IAAmB;;AACzB,MAAAC,IAAeD;;MCQFE,IAAa;;;IAgGtBC,KAAAC,iBAAiB;MACb,MAAMC,IAAQF,KAAKG,YAAYC,iBAAiB;MAChDJ,KAAKK,YAAYH,EAAMI,SAAS;AAAC;IAGrCN,KAAAO,eACIC;MAIA,MAAMC,IAAQD,EAAME,OAAOC,QAAQ,GAAGC,YAAYH;MAClD,MAAMI,IAAmBb,KAAKc,uBAAuBL;MACrDT,KAAKe,kBAAkBF,IAAmB,aAAa;AAAY;IAGvEb,KAAAgB,uBAAuB;MACnB,MAAMC,IAAW,IAAIC,iBAAiBlB,KAAKmB;MAC3CF,EAASG,QAAQpB,KAAKG,aAAa;QAAEkB,WAAW;QAAMC,SAAS;;MAC/DtB,KAAKuB,mBAAmBN;AAAQ;IAGpCjB,KAAAmB,qBAAqB;MACjBnB,KAAKC;AAAgB;2BAtGoB;qBAGxB;;uBAqB6B;gCASnB;;;;EAK/B,oBAAAuB;IACI,IAAIxB,KAAKuB,kBAAkB;MACvBvB,KAAKuB,iBAAiBE;MACtBzB,KAAKuB,mBAAmB;;;EAIhC,gBAAAG;IACI1B,KAAKC;IACL,IAAI,sBAAsB0B,QAAQ3B,KAAKgB;;;;EAO3C,uBAAAY;IACI,OAAMC,WAAEA,KAAc7B;IACtB6B,EAAUC,MAAMC,UAAU;;QAE1BC,GAAU,MACNA,GAAU;MACNH,EAAUC,MAAMC,UAAU;AAAI;;;;EAQ1C,uBAAIE;IACA,IAAIC,IAAclC,KAAKkC;IACvB,KAAKA,GAAaA,IAAc;IAChC,OAAOA,MAAgB,SAASlC,KAAKe,kBAAkBmB;;EAG3D,+BAAIC;IACA,IAAID,IAAclC,KAAKkC;IACvB,KAAKA,GAAaA,IAAc;IAChC,OAAOA,MAAgB;;;;EA+B3B,MAAAE;IACI,OAAMD,6BAAEA,GAA2BF,qBAAEA,GAAmBI,WAAEA,GAAShC,WAAEA,KAAcL;IACnF,MAAMsC,IAAsB,EAAC;IAC7B,IAAID,KAAaJ,MAAwB,cAAcK,EAAoBC,KAAK;IAChF,IAAIlC,GAAWiC,EAAoBC,KAAK;IACxCD,EAAoBC,KAAKN;IAEzB,OACIO,EAAA;MAAAC,KAAA;MACIC,aAAa1C,KAAKO;MAClBoC,UAAUR;OAEVK,EAAA;MAAAC,KAAA;MACIG,KAAKC,KAAO7C,KAAK6B,YAAYgB;MAC7BC,OAAOR,EAAoBS,KAAK;MAChCC,MAAK;OAELR,EAAA;MAAAC,KAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as e, c as t, h as n, F as o, g as i } from "./index-7a5365e2.js";
|
|
2
2
|
|
|
3
|
-
import { l as a, w as r } from "./index-
|
|
3
|
+
import { l as a, w as r } from "./index-504f1a9e.js";
|
|
4
4
|
|
|
5
5
|
var s = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as a, h as t, g as r } from "./index-7a5365e2.js";
|
|
2
2
|
|
|
3
|
-
const i = "*{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}.avatar-img,.avatar-img-default{object-fit:cover;height:var(--tct-avatar-img-height, var(--tct-avatar-height, 44px));width:var(--tct-avatar-img-width, var(--tct-avatar-width, 44px));border-radius:var(--tct-avatar-img-border-radius, var(--tct-avatar-img-br, var(--tct-avatar-border-radius, 50%)))}.avatar-img-default{background:var(--tct-avatar-background, var(--tct-avatar-bg, #9e9e9e))}.avatar-initials{height:var(--tct-avatar-height, 44px);width:var(--tct-avatar-width, 44px);background:var(--tct-avatar-background, var(--tct-avatar-bg, var(--t-gray-8, #9e9e9e)));border-radius:var(--tct-avatar-br, 50%)}.size-1{--tct-avatar-font-size:var(--tct-avatar-size-1, 60px)}.size-2{--tct-avatar-font-size:var(--tct-avatar-size-2, 48px)}.size-3{--tct-avatar-font-size:var(--tct-avatar-size-3, 40px)}.size-4{--tct-avatar-font-size:var(--tct-avatar-size-4, 30px)}text{fill:var(--tct-avatar-text-color, var(--tct-avatar-color, #ffffff));font-weight:var(--tct-avatar-font-weight, 200);font-size:var(--tct-avatar-font-size, 40px)}.fallback{height:var(--tct-avatar-fallback-height, var(--tct-avatar-height, 44px));width:var(--tct-avatar-fallback-width, var(--tct-avatar-width, 44px));border-radius:var(--tct-avatar-fallback-border-radius, var(--tct-avatar-fallback-br, var(--tct-avatar-img-border-radius, var(--tct-avatar-img-br, 50%))));background:var(--tct-avatar-fallback-background, var(--tct-avatar-fallback-bg, var(--tct-avatar-background, var(--tct-avatar-bg, var(--t-gray-8, #9e9e9e)))));display:inline-flex;align-items:center;justify-content:center}q2-icon{--t-icon-size:var(--tct-avatar-icon-size, var(--tct-avatar-fallback-icon-size, 65%));--t-icon-stroke-primary:var(--tct-avatar-icon-stroke-primary, var(--tct-avatar-fallback-stroke-primary, currentcolor));--t-icon-stroke-secondary:var(--tct-avatar-icon-stroke-secondary, var(--tct-avatar-fallback-stroke-secondary, currentcolor));--tct-icon-fill:var(--tct-avatar-icon-fill, var(--tct-avatar-fallback-fill));color:var(--tct-avatar-icon-color, var(--tct-avatar-fallback-color, var(--tct-avatar-color, var(--t-base, #ffffff))));width:var(--tct-avatar-icon-size, var(--t-icon-size));height:var(--tct-avatar-icon-size, var(--t-icon-size))}";
|
|
3
|
+
const i = "*{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}.avatar-img,.avatar-img-default{display:var(--tct-avatar-display, inline);object-fit:cover;height:var(--tct-avatar-img-height, var(--tct-avatar-height, 44px));width:var(--tct-avatar-img-width, var(--tct-avatar-width, 44px));border-radius:var(--tct-avatar-img-border-radius, var(--tct-avatar-img-br, var(--tct-avatar-border-radius, 50%)));border:var(--tct-avatar-border, none)}.avatar-img-default{background:var(--tct-avatar-background, var(--tct-avatar-bg, #9e9e9e))}.avatar-initials{display:var(--tct-avatar-display, inline);height:var(--tct-avatar-height, 44px);width:var(--tct-avatar-width, 44px);background:var(--tct-avatar-background, var(--tct-avatar-bg, var(--t-gray-8, #9e9e9e)));border-radius:var(--tct-avatar-br, 50%);border:var(--tct-avatar-border, none)}.size-1{--tct-avatar-font-size:var(--tct-avatar-size-1, 60px)}.size-2{--tct-avatar-font-size:var(--tct-avatar-size-2, 48px)}.size-3{--tct-avatar-font-size:var(--tct-avatar-size-3, 40px)}.size-4{--tct-avatar-font-size:var(--tct-avatar-size-4, 30px)}text{fill:var(--tct-avatar-text-color, var(--tct-avatar-color, #ffffff));font-weight:var(--tct-avatar-font-weight, 200);font-size:var(--tct-avatar-font-size, 40px)}.fallback{height:var(--tct-avatar-fallback-height, var(--tct-avatar-height, 44px));width:var(--tct-avatar-fallback-width, var(--tct-avatar-width, 44px));border-radius:var(--tct-avatar-fallback-border-radius, var(--tct-avatar-fallback-br, var(--tct-avatar-img-border-radius, var(--tct-avatar-img-br, 50%))));border:var(--tct-avatar-border, none);background:var(--tct-avatar-fallback-background, var(--tct-avatar-fallback-bg, var(--tct-avatar-background, var(--tct-avatar-bg, var(--t-gray-8, #9e9e9e)))));display:inline-flex;align-items:center;justify-content:center}q2-icon{--t-icon-size:var(--tct-avatar-icon-size, var(--tct-avatar-fallback-icon-size, 65%));--t-icon-stroke-primary:var(--tct-avatar-icon-stroke-primary, var(--tct-avatar-fallback-stroke-primary, currentcolor));--t-icon-stroke-secondary:var(--tct-avatar-icon-stroke-secondary, var(--tct-avatar-fallback-stroke-secondary, currentcolor));--tct-icon-fill:var(--tct-avatar-icon-fill, var(--tct-avatar-fallback-fill));color:var(--tct-avatar-icon-color, var(--tct-avatar-fallback-color, var(--tct-avatar-color, var(--t-base, #ffffff))));width:var(--tct-avatar-icon-size, var(--t-icon-size));height:var(--tct-avatar-icon-size, var(--t-icon-size))}";
|
|
4
4
|
|
|
5
5
|
const e = i;
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["q2AvatarCss","Q2AvatarStyle0","Q2Avatar","this","onError","badSrc","onLoad","isLoaded","srcDidUpdate","computedInitials","initials","name","result","substr","parts","split","firstCharacter","lastCharacter","length","undefined","toUpperCase","render","showImg","src","showInitials","showFallback","h","key","class","alt","viewBox","preserveAspectRatio","x","y","type","icon"],"sources":["src/components/q2-avatar/q2-avatar.scss?tag=q2-avatar&encapsulation=shadow","src/components/q2-avatar/q2-avatar.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.avatar-img,\n.avatar-img-default {\n object-fit: cover;\n height: var-list(--tct-avatar-img-height, --tct-avatar-height, 44px);\n width: var-list(--tct-avatar-img-width, --tct-avatar-width, 44px);\n border-radius: var-list(--tct-avatar-img-border-radius, --tct-avatar-img-br, --tct-avatar-border-radius, 50%);\n}\n\n.avatar-img-default {\n background: var-list(--tct-avatar-background, --tct-avatar-bg, #9e9e9e);\n}\n\n.avatar-initials {\n height: var(--tct-avatar-height, 44px);\n width: var(--tct-avatar-width, 44px);\n background: var-list(--tct-avatar-background, --tct-avatar-bg, --t-gray-8, #9e9e9e);\n border-radius: var(--tct-avatar-br, 50%);\n}\n\n.size-1 {\n --tct-avatar-font-size: var(--tct-avatar-size-1, 60px);\n}\n.size-2 {\n --tct-avatar-font-size: var(--tct-avatar-size-2, 48px);\n}\n.size-3 {\n --tct-avatar-font-size: var(--tct-avatar-size-3, 40px);\n}\n.size-4 {\n --tct-avatar-font-size: var(--tct-avatar-size-4, 30px);\n}\n\ntext {\n fill: var-list(--tct-avatar-text-color, --tct-avatar-color, #ffffff);\n font-weight: var(--tct-avatar-font-weight, 200);\n font-size: var(--tct-avatar-font-size, 40px);\n}\n\n.fallback {\n height: var-list(--tct-avatar-fallback-height, --tct-avatar-height, 44px);\n width: var-list(--tct-avatar-fallback-width, --tct-avatar-width, 44px);\n border-radius: var-list(\n --tct-avatar-fallback-border-radius,\n --tct-avatar-fallback-br,\n --tct-avatar-img-border-radius,\n --tct-avatar-img-br,\n 50%\n );\n background: var-list(\n --tct-avatar-fallback-background,\n --tct-avatar-fallback-bg,\n --tct-avatar-background,\n --tct-avatar-bg,\n --t-gray-8,\n #9e9e9e\n );\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\nq2-icon {\n --t-icon-size: #{var-list(--tct-avatar-icon-size, --tct-avatar-fallback-icon-size, 65%)};\n --t-icon-stroke-primary: #{var-list(\n --tct-avatar-icon-stroke-primary,\n --tct-avatar-fallback-stroke-primary,\n currentcolor\n )};\n --t-icon-stroke-secondary: #{var-list(\n --tct-avatar-icon-stroke-secondary,\n --tct-avatar-fallback-stroke-secondary,\n currentcolor\n )};\n --tct-icon-fill: #{var-list(--tct-avatar-icon-fill, --tct-avatar-fallback-fill)};\n color: var-list(--tct-avatar-icon-color, --tct-avatar-fallback-color, --tct-avatar-color, --t-base, #ffffff);\n width: var-list(--tct-avatar-icon-size, --t-icon-size);\n height: var-list(--tct-avatar-icon-size, --t-icon-size);\n}\n","import { Component, ComponentInterface, Prop, Element, h, State, Watch } from '@stencil/core';\n\n@Component({ tag: 'q2-avatar', shadow: true, styleUrl: 'q2-avatar.scss' })\nexport class Q2Avatar implements ComponentInterface {\n // #region Host HTML Element\n\n @Element()\n el: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n badSrc: boolean = false;\n\n @State()\n isLoaded: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** A [q2-icon](https://tecton.q2developer.com/design-system/q2-icon/) to display as the fallback. */\n @Prop()\n icon: string = 'person';\n\n /** A set of up to four initials to display as capitalized text. Takes priority over `name`. */\n @Prop({ reflect: true })\n initials: string;\n\n /**\n * The name associated with the avatar.\n * The initials of the first and last words provided will display as capital letters.\n *\n * @info\n * We recommend always providing a name when you want the avatar to be presented to screen readers.\n */\n @Prop({ reflect: true })\n name: string;\n\n /** Displays the image provided by the user. */\n @Prop({ reflect: true })\n src: string;\n\n // #endregion\n // #region Watchers\n\n @Watch('src')\n srcDidUpdate() {\n this.badSrc = false;\n }\n\n // #endregion\n // #region Local Methods\n\n get computedInitials() {\n const { initials, name } = this;\n if (!initials && !name) return;\n\n let result = '';\n if (initials) {\n result = initials.substr(0, 4);\n } else if (name) {\n const parts = name.split(' ');\n const firstCharacter = parts[0][0];\n const lastCharacter = parts.length > 1 ? parts[parts.length - 1][0] : undefined;\n result += firstCharacter;\n if (lastCharacter) result += lastCharacter;\n }\n\n result = result?.toUpperCase();\n\n return result;\n }\n\n onError = () => {\n this.badSrc = true;\n };\n\n onLoad = () => {\n this.isLoaded = true;\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { computedInitials } = this;\n const showImg = this.src && !this.badSrc;\n const isLoaded = this.isLoaded;\n const showInitials = (this.name || this.initials) && (!this.src || this.badSrc);\n const showFallback = !this.name && !this.initials && (!this.src || this.badSrc);\n\n return (\n <div>\n {showImg && (\n <img\n class={isLoaded ? 'avatar-img' : 'avatar-img-default'}\n test-id=\"userImage\"\n src={this.src}\n onError={this.onError}\n onLoad={this.onLoad}\n alt={this.name || ''}\n />\n )}\n {showInitials && (\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"xMidYMid meet\"\n test-id=\"userInitials\"\n class={`avatar-initials size-${computedInitials.length}`}\n aria-label={this.name}\n aria-hidden={!this.name && 'true'}\n >\n <text\n x=\"50\"\n y=\"50\"\n dominant-baseline=\"central\"\n text-anchor=\"middle\"\n aria-hidden=\"true\"\n >\n {computedInitials}\n </text>\n </svg>\n )}\n {showFallback && (\n <div\n test-id=\"fallbackIcon\"\n class=\"fallback\"\n >\n <q2-icon type={this.icon}></q2-icon>\n </div>\n )}\n </div>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;AAAA,MAAMA,IAAc;;AACpB,MAAAC,IAAeD;;MCEFE,IAAQ;;;IAuEjBC,KAAAC,UAAU;MACND,KAAKE,SAAS;AAAI;IAGtBF,KAAAG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Q,eACR;OAEXxB,KAIZgB,KACGC,EAAA;MAAAC,KAAA;MAAA,WACY;MACRC,OAAM;OAENF,EAAA;MAAAC,KAAA;MAASO,MAAM/B,KAAKgC"}
|
|
1
|
+
{"version":3,"names":["q2AvatarCss","Q2AvatarStyle0","Q2Avatar","this","onError","badSrc","onLoad","isLoaded","srcDidUpdate","computedInitials","initials","name","result","substr","parts","split","firstCharacter","lastCharacter","length","undefined","toUpperCase","render","showImg","src","showInitials","showFallback","h","key","class","alt","viewBox","preserveAspectRatio","x","y","type","icon"],"sources":["src/components/q2-avatar/q2-avatar.scss?tag=q2-avatar&encapsulation=shadow","src/components/q2-avatar/q2-avatar.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.avatar-img,\n.avatar-img-default {\n display: var(--tct-avatar-display, inline);\n object-fit: cover;\n height: var-list(--tct-avatar-img-height, --tct-avatar-height, 44px);\n width: var-list(--tct-avatar-img-width, --tct-avatar-width, 44px);\n border-radius: var-list(--tct-avatar-img-border-radius, --tct-avatar-img-br, --tct-avatar-border-radius, 50%);\n border: var(--tct-avatar-border, none);\n}\n\n.avatar-img-default {\n background: var-list(--tct-avatar-background, --tct-avatar-bg, #9e9e9e);\n}\n\n.avatar-initials {\n display: var(--tct-avatar-display, inline);\n height: var(--tct-avatar-height, 44px);\n width: var(--tct-avatar-width, 44px);\n background: var-list(--tct-avatar-background, --tct-avatar-bg, --t-gray-8, #9e9e9e);\n border-radius: var(--tct-avatar-br, 50%);\n border: var(--tct-avatar-border, none);\n}\n\n.size-1 {\n --tct-avatar-font-size: var(--tct-avatar-size-1, 60px);\n}\n.size-2 {\n --tct-avatar-font-size: var(--tct-avatar-size-2, 48px);\n}\n.size-3 {\n --tct-avatar-font-size: var(--tct-avatar-size-3, 40px);\n}\n.size-4 {\n --tct-avatar-font-size: var(--tct-avatar-size-4, 30px);\n}\n\ntext {\n fill: var-list(--tct-avatar-text-color, --tct-avatar-color, #ffffff);\n font-weight: var(--tct-avatar-font-weight, 200);\n font-size: var(--tct-avatar-font-size, 40px);\n}\n\n.fallback {\n height: var-list(--tct-avatar-fallback-height, --tct-avatar-height, 44px);\n width: var-list(--tct-avatar-fallback-width, --tct-avatar-width, 44px);\n border-radius: var-list(\n --tct-avatar-fallback-border-radius,\n --tct-avatar-fallback-br,\n --tct-avatar-img-border-radius,\n --tct-avatar-img-br,\n 50%\n );\n border: var(--tct-avatar-border, none);\n background: var-list(\n --tct-avatar-fallback-background,\n --tct-avatar-fallback-bg,\n --tct-avatar-background,\n --tct-avatar-bg,\n --t-gray-8,\n #9e9e9e\n );\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\nq2-icon {\n --t-icon-size: #{var-list(--tct-avatar-icon-size, --tct-avatar-fallback-icon-size, 65%)};\n --t-icon-stroke-primary: #{var-list(\n --tct-avatar-icon-stroke-primary,\n --tct-avatar-fallback-stroke-primary,\n currentcolor\n )};\n --t-icon-stroke-secondary: #{var-list(\n --tct-avatar-icon-stroke-secondary,\n --tct-avatar-fallback-stroke-secondary,\n currentcolor\n )};\n --tct-icon-fill: #{var-list(--tct-avatar-icon-fill, --tct-avatar-fallback-fill)};\n color: var-list(--tct-avatar-icon-color, --tct-avatar-fallback-color, --tct-avatar-color, --t-base, #ffffff);\n width: var-list(--tct-avatar-icon-size, --t-icon-size);\n height: var-list(--tct-avatar-icon-size, --t-icon-size);\n}\n","import { Component, ComponentInterface, Prop, Element, h, State, Watch } from '@stencil/core';\n\n@Component({ tag: 'q2-avatar', shadow: true, styleUrl: 'q2-avatar.scss' })\nexport class Q2Avatar implements ComponentInterface {\n // #region Host HTML Element\n\n @Element()\n el: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n badSrc: boolean = false;\n\n @State()\n isLoaded: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** A [q2-icon](https://tecton.q2developer.com/design-system/q2-icon/) to display as the fallback. */\n @Prop()\n icon: string = 'person';\n\n /** A set of up to four initials to display as capitalized text. Takes priority over `name`. */\n @Prop({ reflect: true })\n initials: string;\n\n /**\n * The name associated with the avatar.\n * The initials of the first and last words provided will display as capital letters.\n *\n * @info\n * We recommend always providing a name when you want the avatar to be presented to screen readers.\n */\n @Prop({ reflect: true })\n name: string;\n\n /** Displays the image provided by the user. */\n @Prop({ reflect: true })\n src: string;\n\n // #endregion\n // #region Watchers\n\n @Watch('src')\n srcDidUpdate() {\n this.badSrc = false;\n }\n\n // #endregion\n // #region Local Methods\n\n get computedInitials() {\n const { initials, name } = this;\n if (!initials && !name) return;\n\n let result = '';\n if (initials) {\n result = initials.substr(0, 4);\n } else if (name) {\n const parts = name.split(' ');\n const firstCharacter = parts[0][0];\n const lastCharacter = parts.length > 1 ? parts[parts.length - 1][0] : undefined;\n result += firstCharacter;\n if (lastCharacter) result += lastCharacter;\n }\n\n result = result?.toUpperCase();\n\n return result;\n }\n\n onError = () => {\n this.badSrc = true;\n };\n\n onLoad = () => {\n this.isLoaded = true;\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { computedInitials } = this;\n const showImg = this.src && !this.badSrc;\n const isLoaded = this.isLoaded;\n const showInitials = (this.name || this.initials) && (!this.src || this.badSrc);\n const showFallback = !this.name && !this.initials && (!this.src || this.badSrc);\n\n return (\n <div>\n {showImg && (\n <img\n class={isLoaded ? 'avatar-img' : 'avatar-img-default'}\n test-id=\"userImage\"\n src={this.src}\n onError={this.onError}\n onLoad={this.onLoad}\n alt={this.name || ''}\n />\n )}\n {showInitials && (\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"xMidYMid meet\"\n test-id=\"userInitials\"\n class={`avatar-initials size-${computedInitials.length}`}\n aria-label={this.name}\n aria-hidden={!this.name && 'true'}\n >\n <text\n x=\"50\"\n y=\"50\"\n dominant-baseline=\"central\"\n text-anchor=\"middle\"\n aria-hidden=\"true\"\n >\n {computedInitials}\n </text>\n </svg>\n )}\n {showFallback && (\n <div\n test-id=\"fallbackIcon\"\n class=\"fallback\"\n >\n <q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