q2-tecton-elements 1.54.4 → 1.55.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 +2047 -769
- package/dist/cjs/{index-76f63767.js → index-905f4c87.js} +3 -2
- package/dist/cjs/index-905f4c87.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-group.cjs.entry.js +45 -14
- package/dist/cjs/q2-action-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +4 -1364
- package/dist/cjs/q2-action-sheet.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_7.cjs.entry.js +59 -22
- package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
- package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +21 -21
- package/dist/cjs/q2-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-currency.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q2-detail.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-file-picker.cjs.entry.js +2 -2
- package/dist/cjs/q2-file-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-form.cjs.entry.js +23 -0
- package/dist/cjs/q2-form.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
- package/dist/cjs/q2-item_3.cjs.entry.js +3 -3
- package/dist/cjs/q2-legend.cjs.entry.js +2 -2
- package/dist/cjs/q2-legend.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +20 -26
- package/dist/cjs/q2-loc.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +2 -2
- package/dist/cjs/q2-modal.cjs.entry.js +172 -0
- package/dist/cjs/q2-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
- package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/q2-option-list_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-option.cjs.entry.js +22 -24
- 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 +2 -2
- package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio-group.cjs.entry.js.map +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 +2 -2
- package/dist/cjs/q2-resize-observer.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +3 -3
- package/dist/cjs/q2-select.cjs.entry.js +10 -6
- 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 +51 -9
- 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 +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/q2-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/sanitize-html-string-b8e3b24b.js +1366 -0
- package/dist/cjs/sanitize-html-string-b8e3b24b.js.map +1 -0
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/click-elsewhere/click-elsewhere.js.map +1 -1
- package/dist/collection/components/click-elsewhere/test/click-elsewhere-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-action-group/q2-action-group.css +11 -4
- package/dist/collection/components/q2-action-group/q2-action-group.js +47 -13
- 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-test.e2e.js +365 -0
- package/dist/collection/components/q2-action-group/test/q2-action-group-test.e2e.js.map +1 -0
- package/dist/collection/components/q2-action-group/test/{q2-action-group.spec.js → q2-action-group-test.spec.js} +67 -26
- package/dist/collection/components/q2-action-group/test/q2-action-group-test.spec.js.map +1 -0
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js.map +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.js +1 -1
- package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
- package/dist/collection/components/q2-avatar/test/q2-avatar-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-badge/q2-badge.css +52 -41
- package/dist/collection/components/q2-badge/q2-badge.js +88 -22
- package/dist/collection/components/q2-badge/q2-badge.js.map +1 -1
- package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js +35 -126
- package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-badge/test/q2-badge-test.spec.js +415 -0
- package/dist/collection/components/q2-badge/test/q2-badge-test.spec.js.map +1 -0
- package/dist/collection/components/q2-btn/q2-btn.css +12 -10
- package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
- package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar-types.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar-validation.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar.css +2 -0
- package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
- package/dist/collection/components/q2-calendar/q2-month-picker.js.map +1 -1
- package/dist/collection/components/q2-calendar/test/helpers-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-calendar/test/q2-calendar-month-picker-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-calendar/test/validation-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-card/q2-card.js.map +1 -1
- package/dist/collection/components/q2-card/test/q2-card-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
- package/dist/collection/components/q2-carousel/test/q2-carousel-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js.map +1 -1
- package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.spec.js.map +1 -1
- package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
- package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
- package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js.map +1 -1
- package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
- package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-checkbox/q2-checkbox.css +99 -62
- package/dist/collection/components/q2-checkbox/q2-checkbox.js +19 -19
- package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
- package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js +227 -208
- package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +8 -1
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
- package/dist/collection/components/q2-checkbox-group/test/q2-checkbox-group-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
- package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-detail/q2-detail.js.map +1 -1
- package/dist/collection/components/q2-detail/test/q2-detail-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- 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.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
- package/dist/collection/components/q2-editable-field/test/q2-editable-field-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-example/q2-example.js.map +1 -1
- package/dist/collection/components/q2-example/test/q2-example.e2e.js.map +1 -1
- package/dist/collection/components/q2-example/test/q2-example.spec.js.map +1 -1
- package/dist/collection/components/q2-file-picker/q2-file-picker.css +2 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -1
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js.map +1 -1
- package/dist/collection/components/q2-form/q2-form.css +93 -0
- package/dist/collection/components/q2-form/q2-form.js +44 -0
- package/dist/collection/components/q2-form/q2-form.js.map +1 -0
- package/dist/collection/components/q2-form/test/q2-form-test.e2e.js +93 -0
- package/dist/collection/components/q2-form/test/q2-form-test.e2e.js.map +1 -0
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js.map +1 -1
- package/dist/collection/components/q2-formatted-text/test/q2-formatted-text-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-icon/q2-icon-types.js.map +1 -1
- package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
- package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js +1 -352
- package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-icon/test/q2-icon-test.spec.js +464 -0
- package/dist/collection/components/q2-icon/test/q2-icon-test.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/alpha.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/alpha.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/alphanumeric.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/credit-card.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/credit-card.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/currency.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/currency.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/date.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/generic.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/number.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/numeric.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/numeric.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/phone.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/phone.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/postal.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/ssn.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/ssn.spec.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/tin.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/tin.spec.js.map +1 -1
- package/dist/collection/components/q2-input/q2-input-types.js.map +1 -1
- package/dist/collection/components/q2-input/q2-input.css +3 -2
- package/dist/collection/components/q2-input/q2-input.js +4 -3
- package/dist/collection/components/q2-input/q2-input.js.map +1 -1
- package/dist/collection/components/q2-input/test/q2-input-credit-card-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-input/test/q2-input-test.spec.js +10 -0
- package/dist/collection/components/q2-input/test/q2-input-test.spec.js.map +1 -1
- package/dist/collection/components/q2-item/q2-item.js +1 -1
- package/dist/collection/components/q2-item/q2-item.js.map +1 -1
- package/dist/collection/components/q2-item/test/q2-item-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-item/test/q2-item-test.spec.js.map +1 -1
- package/dist/collection/components/q2-legend/q2-legend.css +1 -1
- package/dist/collection/components/q2-legend/q2-legend.js +1 -1
- package/dist/collection/components/q2-legend/q2-legend.js.map +1 -1
- package/dist/collection/components/q2-legend/test/q2-legend-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-legend/test/q2-legend-test.spec.js.map +1 -1
- package/dist/collection/components/q2-link/q2-link.js.map +1 -1
- 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.map +1 -1
- package/dist/collection/components/q2-list/q2-list.js +1 -1
- package/dist/collection/components/q2-list/q2-list.js.map +1 -1
- package/dist/collection/components/q2-list/test/q2-list-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js.map +1 -1
- package/dist/collection/components/q2-loading/skeleton/shapes.js.map +1 -1
- package/dist/collection/components/q2-loading/test/q2-loading-element-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-loading/test/q2-loading-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-loc/q2-loc.js +19 -37
- package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
- package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js +1 -7
- package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js +140 -82
- package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js.map +1 -1
- package/dist/collection/components/q2-message/q2-message.js +1 -1
- package/dist/collection/components/q2-message/q2-message.js.map +1 -1
- package/dist/collection/components/q2-message/test/q2-message-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-modal/q2-modal.css +223 -0
- package/dist/collection/components/q2-modal/q2-modal.js +470 -0
- package/dist/collection/components/q2-modal/q2-modal.js.map +1 -0
- package/dist/collection/components/q2-modal/test/q2-modal-test.e2e.js +102 -0
- package/dist/collection/components/q2-modal/test/q2-modal-test.e2e.js.map +1 -0
- package/dist/collection/components/q2-modal/test/q2-modal-test.spec.js +127 -0
- package/dist/collection/components/q2-modal/test/q2-modal-test.spec.js.map +1 -0
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
- package/dist/collection/components/q2-optgroup/test/q2-optgroup-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-option/q2-option.js +22 -24
- package/dist/collection/components/q2-option/q2-option.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js +32 -5
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.spec.js +137 -19
- 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.map +1 -1
- package/dist/collection/components/q2-option-list/test/q2-option-list-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-option-list/test/q2-option-list.spec.js.map +1 -1
- package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
- package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
- package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-pill/q2-pill.js +1 -1
- package/dist/collection/components/q2-pill/q2-pill.js.map +1 -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-popover/test/q2-popover-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
- package/dist/collection/components/q2-radio/q2-radio.js.map +1 -1
- package/dist/collection/components/q2-radio/test/q2-radio-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-radio-group/q2-radio-group.css +4 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
- package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
- package/dist/collection/components/q2-relative-time/test/q2-relative-time-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +2 -2
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js.map +1 -1
- package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.e2e.js.map +1 -1
- package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.spec.js.map +1 -1
- package/dist/collection/components/q2-section/q2-section.js +2 -2
- package/dist/collection/components/q2-section/q2-section.js.map +1 -1
- package/dist/collection/components/q2-section/test/q2-section-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.css +2 -2
- package/dist/collection/components/q2-select/q2-select.js +15 -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 +5 -1
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-select/test/q2-select-test.spec.js +85 -0
- package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -0
- package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
- package/dist/collection/components/q2-stepper/test/q2-stepper-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
- package/dist/collection/components/q2-stepper-pane/test/q2-stepper-pane-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
- package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
- package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.spec.js.map +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js.map +1 -1
- package/dist/collection/components/q2-tab-pane/test/q2-tab-pane-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tag/q2-tag.css +9 -0
- package/dist/collection/components/q2-tag/q2-tag.js +65 -15
- package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +131 -341
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tag/test/q2-tag-test.spec.js +719 -0
- package/dist/collection/components/q2-tag/test/q2-tag-test.spec.js.map +1 -0
- package/dist/collection/components/q2-textarea/q2-textarea.css +2 -2
- package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
- package/dist/collection/components/q2-textarea/q2-textarea.js.map +1 -1
- package/dist/collection/components/q2-textarea/test/q2-textarea-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tooltip/q2-tooltip.css +0 -1
- package/dist/collection/components/q2-tooltip/q2-tooltip.js.map +1 -1
- package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.e2e.js.map +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane-types.js.map +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js.map +1 -1
- package/dist/collection/components/tecton-tab-pane/test/tecton-tab-pane-test.e2e.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/action-sheet.js.map +1 -1
- package/dist/collection/utils/charting.js.map +1 -1
- package/dist/collection/utils/helpers.js +1 -25
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/index.js +2 -1
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/collection/utils/mirror-emit.js.map +1 -1
- package/dist/collection/utils/sanitize-html-string.js.map +1 -1
- package/dist/collection/utils/sanitize-regex-string.js.map +1 -1
- package/dist/collection/utils/test/action-sheet-test.e2e.js.map +1 -1
- package/dist/collection/utils/test/index.spec.js.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +2 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-action-group.js +1 -116
- package/dist/components/q2-action-group.js.map +1 -1
- package/dist/components/q2-action-group2.js +151 -0
- package/dist/components/q2-action-group2.js.map +1 -0
- package/dist/components/q2-action-sheet.js +2 -1362
- package/dist/components/q2-action-sheet.js.map +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-badge2.js +54 -16
- package/dist/components/q2-badge2.js.map +1 -1
- package/dist/components/q2-btn2.js +1 -1
- package/dist/components/q2-btn2.js.map +1 -1
- package/dist/components/q2-calendar.js +1 -1
- package/dist/components/q2-calendar.js.map +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-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox-group.js.map +1 -1
- package/dist/components/q2-checkbox2.js +20 -20
- package/dist/components/q2-checkbox2.js.map +1 -1
- package/dist/components/q2-currency.js +1 -1
- package/dist/components/q2-detail.js +1 -1
- package/dist/components/q2-file-picker.js +1 -1
- package/dist/components/q2-file-picker.js.map +1 -1
- package/dist/components/q2-form.d.ts +11 -0
- package/dist/components/q2-form.js +39 -0
- package/dist/components/q2-form.js.map +1 -0
- package/dist/components/q2-formatted-text.js +1 -1
- package/dist/components/q2-input2.js +5 -4
- package/dist/components/q2-input2.js.map +1 -1
- package/dist/components/q2-item2.js +1 -1
- package/dist/components/q2-legend2.js +2 -2
- package/dist/components/q2-legend2.js.map +1 -1
- package/dist/components/q2-list2.js +1 -1
- package/dist/components/q2-loc.js +22 -33
- package/dist/components/q2-loc.js.map +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-modal.d.ts +11 -0
- package/dist/components/q2-modal.js +231 -0
- package/dist/components/q2-modal.js.map +1 -0
- package/dist/components/q2-month-picker.js +2 -2
- package/dist/components/q2-optgroup2.js +1 -1
- package/dist/components/q2-option2.js +23 -25
- package/dist/components/q2-option2.js.map +1 -1
- package/dist/components/q2-pagination.js +3 -3
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio-group.js.map +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +2 -2
- package/dist/components/q2-resize-observer2.js.map +1 -1
- package/dist/components/q2-section.js +2 -2
- package/dist/components/q2-select2.js +9 -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 +50 -8
- package/dist/components/q2-tag.js.map +1 -1
- package/dist/components/q2-textarea.js +2 -2
- package/dist/components/q2-textarea.js.map +1 -1
- package/dist/components/q2-tooltip.js +1 -1
- package/dist/components/q2-tooltip.js.map +1 -1
- package/dist/components/sanitize-html-string.js +1364 -0
- package/dist/components/sanitize-html-string.js.map +1 -0
- package/dist/components/tecton-tab-pane.js +2 -2
- package/dist/esm/{index-504f1a9e.js → index-f2a66217.js} +3 -2
- package/dist/esm/index-f2a66217.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-group.entry.js +45 -14
- package/dist/esm/q2-action-group.entry.js.map +1 -1
- package/dist/esm/q2-action-sheet.entry.js +3 -1363
- package/dist/esm/q2-action-sheet.entry.js.map +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-badge_7.entry.js +59 -22
- package/dist/esm/q2-badge_7.entry.js.map +1 -1
- package/dist/esm/q2-calendar.entry.js +2 -2
- package/dist/esm/q2-calendar.entry.js.map +1 -1
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +3 -3
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +2 -2
- package/dist/esm/q2-chart-bar.entry.js +2 -2
- package/dist/esm/q2-chart-donut.entry.js +2 -2
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox-group.entry.js.map +1 -1
- package/dist/esm/q2-checkbox.entry.js +21 -21
- package/dist/esm/q2-checkbox.entry.js.map +1 -1
- package/dist/esm/q2-currency.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +1 -1
- package/dist/esm/q2-detail.entry.js +2 -2
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-file-picker.entry.js +2 -2
- package/dist/esm/q2-file-picker.entry.js.map +1 -1
- package/dist/esm/q2-form.entry.js +19 -0
- package/dist/esm/q2-form.entry.js.map +1 -0
- package/dist/esm/q2-formatted-text.entry.js +1 -1
- package/dist/esm/q2-item_3.entry.js +3 -3
- package/dist/esm/q2-legend.entry.js +2 -2
- package/dist/esm/q2-legend.entry.js.map +1 -1
- package/dist/esm/q2-loc.entry.js +21 -27
- package/dist/esm/q2-loc.entry.js.map +1 -1
- package/dist/esm/q2-message.entry.js +2 -2
- package/dist/esm/q2-modal.entry.js +168 -0
- package/dist/esm/q2-modal.entry.js.map +1 -0
- package/dist/esm/q2-month-picker.entry.js +3 -3
- package/dist/esm/q2-optgroup.entry.js +2 -2
- package/dist/esm/q2-option-list_2.entry.js +2 -2
- package/dist/esm/q2-option.entry.js +22 -24
- 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 +2 -2
- package/dist/esm/q2-radio-group.entry.js +2 -2
- package/dist/esm/q2-radio-group.entry.js.map +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 +2 -2
- package/dist/esm/q2-resize-observer.entry.js.map +1 -1
- package/dist/esm/q2-section.entry.js +3 -3
- package/dist/esm/q2-select.entry.js +10 -6
- 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 +51 -9
- 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 +3 -3
- package/dist/esm/q2-textarea.entry.js.map +1 -1
- package/dist/esm/q2-tooltip.entry.js +2 -2
- package/dist/esm/q2-tooltip.entry.js.map +1 -1
- package/dist/esm/sanitize-html-string-735c19f5.js +1364 -0
- package/dist/esm/sanitize-html-string-735c19f5.js.map +1 -0
- package/dist/esm/tecton-tab-pane.entry.js +2 -2
- package/dist/jest.setup.js +22 -0
- package/dist/jest.setup.js.map +1 -0
- package/dist/q2-tecton-elements/{index-504f1a9e.js → index-f2a66217.js} +9 -8
- package/dist/q2-tecton-elements/index-f2a66217.js.map +1 -0
- package/dist/q2-tecton-elements/q2-action-group.entry.js +49 -17
- package/dist/q2-tecton-elements/q2-action-group.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +121 -1331
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-avatar.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +199 -164
- package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-calendar.entry.js +180 -180
- package/dist/q2-tecton-elements/q2-calendar.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +92 -88
- package/dist/q2-tecton-elements/q2-checkbox.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-currency.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-data-table.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-detail.entry.js +39 -39
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-file-picker.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-form.entry.js +25 -0
- package/dist/q2-tecton-elements/q2-form.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-item_3.entry.js +22 -22
- package/dist/q2-tecton-elements/q2-legend.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-legend.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +23 -32
- package/dist/q2-tecton-elements/q2-loc.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-message.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-modal.entry.js +226 -0
- package/dist/q2-tecton-elements/q2-modal.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +14 -14
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-option.entry.js +38 -38
- package/dist/q2-tecton-elements/q2-option.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.js +38 -38
- package/dist/q2-tecton-elements/q2-pill.entry.js +14 -14
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +28 -28
- package/dist/q2-tecton-elements/q2-radio-group.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-radio.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +5 -2
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-section.entry.js +19 -19
- package/dist/q2-tecton-elements/q2-select.entry.js +13 -9
- 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 +5 -5
- package/dist/q2-tecton-elements/q2-stepper.entry.js +22 -22
- package/dist/q2-tecton-elements/q2-tag.entry.js +84 -45
- 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 +4 -4
- package/dist/q2-tecton-elements/q2-textarea.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-tooltip.entry.js.map +1 -1
- package/dist/q2-tecton-elements/sanitize-html-string-735c19f5.js +1214 -0
- package/dist/q2-tecton-elements/sanitize-html-string-735c19f5.js.map +1 -0
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +9 -9
- package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +1 -0
- package/dist/types/components/q2-action-group/q2-action-group.d.ts +5 -2
- package/dist/types/components/q2-badge/q2-badge.d.ts +17 -3
- package/dist/types/components/q2-checkbox/q2-checkbox.d.ts +3 -3
- package/dist/types/components/q2-form/q2-form.d.ts +6 -0
- package/dist/types/components/q2-loc/q2-loc.d.ts +5 -5
- package/dist/types/components/q2-modal/q2-modal.d.ts +80 -0
- package/dist/types/components/q2-option/q2-option.d.ts +4 -4
- package/dist/types/components/q2-select/q2-select.d.ts +1 -0
- package/dist/types/components/q2-tag/q2-tag.d.ts +19 -0
- package/dist/types/components.d.ts +182 -6
- package/dist/types/util.d.ts +1 -8
- package/dist/types/utils/helpers.d.ts +1 -13
- package/dist/types/utils/index.d.ts +3 -2
- package/package.json +3 -3
- package/dist/cjs/index-76f63767.js.map +0 -1
- package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js +0 -166
- package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js.map +0 -1
- package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js.map +0 -1
- package/dist/esm/index-504f1a9e.js.map +0 -1
- package/dist/q2-tecton-elements/index-504f1a9e.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAc/B,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,IAAa,EACb,SAA4B,EAC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AO,EAAE;KACzB,CAAC,CAAC;IACH,GAAG,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACf,CAAC,CAAC;AASF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,IAAa,EAAE,QAAgB,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IACxF,mBAAmB;IACnB,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAErC,oCAAoC;IACpC,MAAM,IAAI,CAAC,QAAQ,CAAC;0BACE,UAAU,CAAC,QAAQ,EAAE;GAC5C,CAAC,CAAC;IAED,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,cAAc;IACd,OAAO,IAAI,CAAC,QAAQ,CAChB,KAAK,EAAE,QAAgB,EAAE,kBAAkB,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAE1B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC/C,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC,EACD,QAAQ,EACR,IAAI,CAAC,SAAS,iCAAM,OAAO,KAAE,kBAAkB,EAAE,IAAI,IAAG,CAC3D,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { newE2EPage, E2EPage } from '@stencil/core/testing';\nimport { IDict } from '@/util';\nimport { E2EElement, NewE2EPageOptions } from '@stencil/core/testing/puppeteer/puppeteer-declarations';\nimport { removeTimezoneOffset } from '../components/q2-calendar/q2-calendar-helpers';\nimport { AxePuppeteer } from '@axe-core/puppeteer';\nimport { NewSpecPageOptions } from '@stencil/core/internal';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { getAllText } from '.';\n\ninterface PasteInit extends EventInit {\n pastedValue: string;\n}\n\ntype EventInitType =\n | EventInit\n | KeyboardEventInit\n | MouseEventInit\n | FocusEventInit\n | CustomEventInit\n | PasteInit\n | ClipboardEventInit;\nexport async function dispatchEvent(\n page: E2EPage,\n selectors: string | string[],\n eventType: string,\n eventInit?: EventInitType\n) {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n\n await page.evaluate(\n (passedSelectors: string[], passedEventType: string, passedEventInit: EventInitType) => {\n const eventTypeDict = {\n change: CustomEvent,\n input: CustomEvent,\n keydown: KeyboardEvent,\n keyup: KeyboardEvent,\n focus: FocusEvent,\n blur: FocusEvent,\n click: MouseEvent,\n mousedown: MouseEvent,\n animationStart: AnimationEvent,\n animationEnd: AnimationEvent,\n slotchange: Event,\n load: Event,\n paste: ClipboardEvent,\n };\n\n let eventInit = passedEventInit;\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n const clipboardData = new DataTransfer();\n clipboardData.getData = () => (passedEventInit as PasteInit).pastedValue;\n eventInit = {\n bubbles: true,\n clipboardData,\n };\n }\n\n const EventTypeInit = eventTypeDict[passedEventType] || Event;\n const [first, ...rest] = passedSelectors;\n let itemElement = document.querySelector(first);\n const rootElement = itemElement;\n if (rest.length) {\n itemElement = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), itemElement);\n }\n\n itemElement?.dispatchEvent(new EventTypeInit(passedEventType, eventInit));\n\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n if (rootElement.getAttribute('type') !== 'currency') {\n (itemElement as HTMLInputElement).value =\n (itemElement as HTMLInputElement).value + passedEventInit.pastedValue;\n itemElement && itemElement.dispatchEvent(new InputEvent('input'));\n }\n }\n },\n selectors,\n eventType,\n eventInit\n );\n\n await page.waitForChanges();\n}\n\nexport async function setTestStrings(page: E2EPage, strings: IDict<string>) {\n await page.evaluate(function (strings) {\n this.TEST_STRINGS = strings;\n }, strings);\n}\n\nexport async function promiseMap<T>(arr: T[], fn: (...args: any[]) => any) {\n const promises = arr.map(fn);\n\n return Promise.all(promises);\n}\n\n/**\n * Waits for a specified amount of time.\n *\n * Please use this function sparingly, as it can slow down tests.\n */\nexport async function waitForTimeout(timeout: number) {\n return new Promise(resolve => setTimeout(resolve, timeout));\n}\n\nexport function offsetTimezone(date: string) {\n return removeTimezoneOffset(new Date(date)).toISOString();\n}\n\nexport async function setup(pageOptions?: NewE2EPageOptions) {\n const page = await newE2EPage(pageOptions);\n\n await page.evaluate(function () {\n this.TectonElements = this.TectonElements || {};\n this.TectonElements.loc = (key: string, subs?: string[] | IDict<string>) => {\n const string = (this.TEST_STRINGS && this.TEST_STRINGS[key]) || key;\n\n if (Array.isArray(subs)) {\n const regex = /({[0-9]})/g;\n return string.replace(regex, match => {\n return subs[parseInt(match[1])];\n });\n } else if (typeof subs === 'object') {\n return Object.entries(subs).reduce((accum, [key, value]) => accum.replace(`{${key}}`, value), string);\n }\n\n return string;\n };\n });\n\n await page.waitForChanges();\n\n return page;\n}\n\n/**\n * Converts an object to a string of HTML attributes.\n *\n * @param obj - The object to convert, where keys are attribute names and values are attribute values.\n * @returns A string representing the HTML attributes.\n *\n * @example\n * const attributes = objectToHTMLAttributes({ id: 'my-element', class: 'my-class', 'data-value': '123' });\n * console.log(attributes); // Output: \"id='my-element' class='my-class' data-value='123'\"\n */\nexport function objectToHTMLAttributes(obj) {\n return Object.entries(obj)\n .map(([key, value]) => `${key}='${value}'`)\n .join(' ');\n}\n\n/**\n * Sets up a new Spec Page with localization capabilities for testing.\n *\n * @param pageOptions - Configuration options for the new Spec Page.\n * @param testStrings - Optional dictionary of test strings for localization.\n * @returns A promise that resolves to the configured Spec Page.\n *\n * This function initializes a new Spec Page and sets up the `TectonElements`\n * object for localization testing. It also sets the provided test strings for\n * localization and reloads the page to ensure the new `TectonElements` object\n * is available.\n *\n * @note This method doesn't work with `NewSpecPageOptions.template`\n * property. If you need to use that, please use `newSpecPage` directly.\n */\nexport async function setupSpecPageWithLoc(pageOptions: NewSpecPageOptions, testStrings?: IDict<string>) {\n const page = await newSpecPage(pageOptions);\n await page.waitForChanges();\n\n // Setup the TectonElements object for localization testing\n const specWindow = page.win as Window & {\n TectonElements: { loc: (key: string, subs?: string[] | IDict<string>) => string };\n TEST_STRINGS: IDict<string>;\n };\n specWindow.TectonElements = {\n loc: (key: string, subs?: string[] | IDict<string>) => {\n const string = (specWindow.TEST_STRINGS && specWindow.TEST_STRINGS[key]) || key;\n\n if (Array.isArray(subs)) {\n const regex = /({[0-9]})/g;\n return string.replace(regex, match => {\n return subs[parseInt(match[1])];\n });\n } else if (typeof subs === 'object') {\n return Object.entries(subs).reduce((accum, [key, value]) => accum.replace(`{${key}}`, value), string);\n }\n\n return string;\n },\n resizeIframe: () => {},\n resolveMenu: async () => {\n return [];\n },\n navigateTo: () => {},\n showOverpanel: async <T>(): Promise<T> => {\n return {} as T;\n },\n };\n\n // Set the test strings\n specWindow.TEST_STRINGS = testStrings || {};\n\n // Reload the page to ensure the new TectonElements object is available\n await page.setContent(page.body.innerHTML);\n\n return page;\n}\n\nexport function setWindowHeight(height: number) {\n Object.defineProperty(window, 'innerHeight', {\n writable: true,\n configurable: true,\n value: height,\n });\n\n window.dispatchEvent(new Event('resize'));\n\n expect(window.innerHeight).toBe(height);\n}\n\nexport function makeDomRect(customAttributes) {\n const defaults = {\n bottom: 0,\n height: 50,\n width: 50,\n left: 40,\n right: 0,\n top: 0,\n x: 0,\n y: 0,\n toJSON: () => ({}),\n };\n return { ...defaults, ...customAttributes };\n}\nexport const base64Image =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=';\n\nexport async function getActiveElementTestId(page: E2EPage) {\n return page.$eval(\n 'body',\n () =>\n (document.activeElement.shadowRoot?.activeElement ?? document.activeElement).getAttribute('test-id') ?? null\n );\n}\n\nexport const getFocusedOptionValue = async (page: E2EPage) => {\n await page.waitForSelector('q2-option:focus');\n return page.$eval('body', () => document.activeElement.getAttribute('value'));\n};\n\nexport const getFocusedTagName = async (page: E2EPage) => {\n return page.$eval('body', () => document.activeElement?.tagName);\n};\n\nexport async function getFocusedAttribute(page: E2EPage, attribute: string) {\n return page.$eval(\n 'body',\n (_, attribute: string) => {\n const activeElement = document.activeElement.shadowRoot?.activeElement ?? document.activeElement;\n return activeElement?.getAttribute(attribute) ?? null;\n },\n attribute\n );\n}\n\nexport const testDeprecatedAriaLabel = async (element: E2EElement, label: string = 'My Label') => {\n expect(element).toEqualAttribute('label', label);\n const hasHideLabelProp = typeof (await element.getProperty('hideLabel')) !== 'undefined';\n if (hasHideLabelProp) expect(element).toHaveAttribute('hide-label');\n expect(await element.getProperty('ariaLabel')).toBeUndefined();\n};\n\nexport const getListOfStyleCompilationIssues = async (page: E2EPage, selector: string) => {\n return page.$eval(selector, el => {\n interface ShadowRootShim extends ShadowRoot {\n adoptedStyleSheets: CSSStyleSheet[];\n }\n const adoptedStyleSheets = (el.shadowRoot as ShadowRootShim).adoptedStyleSheets;\n const result = adoptedStyleSheets.reduce((accum, styleSheet) => {\n Array.from(styleSheet.cssRules).forEach(rule => {\n const hasVarList = rule.cssText.includes('var-list(');\n const hasVarPrefixer = rule.cssText.includes('var-prefixer(');\n if (hasVarList || hasVarPrefixer) accum.push((rule as any).selectorText);\n });\n return accum;\n }, []);\n\n if (!!result.length) {\n // eslint-disable-next-line no-console\n console.log(`The following selectors have compilation issues: ${result.join(', ')}`);\n }\n\n return result;\n });\n};\n\nexport const getNestedElementProperty = async (page: E2EPage, selectors: string | string[], prop: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.evaluate(\n (selectors: string[], prop: string) => {\n const [first, ...rest] = selectors;\n let element = document.querySelector(first);\n if (rest.length) {\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n }\n return element[prop];\n },\n selectors,\n prop\n );\n};\n\nexport const getNestedElementAttribute = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return element.getAttribute(attribute);\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedElementStyle = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n const elementStyle = window.getComputedStyle(element);\n return elementStyle[attribute];\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedAssignedElementLength = async (page: E2EPage, selectors: string | string[]) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element: HTMLElement, selectors: string[]) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return (element as HTMLSlotElement)?.assignedElements?.().length ?? undefined;\n },\n selectors\n );\n};\n\nexport const evaluateA11y = async (page: any, ...args: string[]) => {\n // Configuration\n const config = {\n detailLevel: args.includes('verbose') ? 'verbose' : 'default',\n testType: args.includes('webpage') ? 'webpage' : 'component',\n disabledRulesForComponents: [\n 'document-title',\n 'html-has-lang',\n 'landmark-one-main',\n 'page-has-heading-one',\n 'region',\n ],\n };\n\n // Set disabled rules based on test type\n const disabledRules = config.testType === 'webpage' ? [] : config.disabledRulesForComponents;\n\n let processedViolations;\n\n try {\n // Create a timeout promise for the axe analysis\n const timeoutPromise = new Promise((_, reject) => {\n const id = setTimeout(() => {\n clearTimeout(id);\n reject(new Error('AxePuppeteer analysis timed out'));\n }, 10000);\n });\n\n // Run analysis with timeout\n const analysisPromise = new AxePuppeteer(page).disableRules(disabledRules).analyze();\n const analysisResults = await Promise.race([analysisPromise, timeoutPromise]);\n\n // Clean up AxePuppeteer resources\n await page.evaluate(() => {\n // Remove axe script elements\n document.querySelectorAll('script[id$=\"axe-puppeteer\"]').forEach(el => el.remove());\n\n // Clear any remaining axe-related listeners\n const win = window as any;\n if (win.axe) {\n if (win.axe.teardown === 'function') {\n win.axe.teardown();\n }\n delete win.axe;\n }\n\n // ensure the promise resolves\n return true;\n });\n\n // @ts-expect-error analysisResults complains about the violations property\n const { violations } = analysisResults;\n\n if (!violations.length) return false;\n\n // Return full violations if verbose mode is requested\n if (config.detailLevel === 'verbose') return violations;\n\n // Process violations for default detail level\n processedViolations = violations.reduce((responseObj, violation) => {\n const { nodes, help, helpUrl, id } = violation;\n const node = nodes[0];\n\n // Create violation info object\n responseObj[id] = {\n help,\n helpUrl,\n failureSummary: node.failureSummary,\n html: node.html,\n rulesViolated: node.any.reduce((rules, rule) => {\n rules[rule.id] = rule.message;\n return rules;\n }, {}),\n };\n\n return responseObj;\n }, {});\n } catch (error) {\n console.error(`There was an error with AxePuppeteer analysis. ERROR: ${error}`);\n }\n\n return processedViolations;\n};\n\n/**\n * This function mocks the fetch API to return a resolved promise with the given icon markup.\n * You can optionally provide a <symbol> element, but it is not required.\n *\n * This is meant to be used to prevent errors on Unit/Spec tests with <q2-icon> because we are unable to provide a valid\n * URL for the fetch call in that context.\n *\n * @note This function should be called before the component is rendered.\n * @note Be sure to call `jest.restoreAllMocks()` after the test to restore the original fetch function.\n */\nexport const mockIconFetch = (iconMarkup?: string) => {\n const spy = jest.spyOn(global, 'fetch');\n const mockResponse = new Response(`<svg>${iconMarkup}</svg>`, {\n status: 200,\n statusText: 'OK',\n headers: new Headers(),\n });\n spy.mockResolvedValue(mockResponse);\n return spy;\n};\n\n// For E2E tests with Puppeteer\ndeclare global {\n interface Window {\n getAllText: (element: Element, options: any) => Promise<string>;\n }\n}\n\n/**\n * Mimicks the behavior of the {@link getAllText} utility function, with a few extractions to simplify usage.\n * @param {E2EPage} page\n * @param {string} selector\n * @param {Object} options\n * @returns {Promise<string>}\n */\nexport const getAllElementTextE2E = async (page: E2EPage, selector: string, options = {}) => {\n // Wait for element\n await page.waitForSelector(selector);\n\n // First inject the utility function\n await page.evaluate(`\n window.getAllText = ${getAllText.toString()};\n `);\n\n await page.waitForChanges();\n\n // Then use it\n return page.evaluate(\n async (selector: string, stringifiedOptions) => {\n const element = document.querySelector(selector);\n if (!element) return null;\n\n const options = JSON.parse(stringifiedOptions);\n return await window.getAllText(element, options);\n },\n selector,\n JSON.stringify({ ...options, skipComponentReady: true })\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAcpD,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,IAAa,EACb,SAA4B,EAC5B,SAAiB,EACjB,SAAyB;IAEzB,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChC,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,IAAI,CAAC,QAAQ,CACf,CAAC,eAAyB,EAAE,eAAuB,EAAE,eAA8B,EAAE,EAAE;QACnF,MAAM,aAAa,GAAG;YAClB,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,UAAU;YACrB,cAAc,EAAE,cAAc;YAC9B,YAAY,EAAE,cAAc;YAC5B,UAAU,EAAE,K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EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;oBAC3C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;oBAC9B,OAAO,KAAK,CAAC;gBACjB,CAAC,EAAE,EAAE,CAAC;aACT,CAAC;YAEF,OAAO,WAAW,CAAC;QACvB,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,yDAAyD,KAAK,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAmB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,QAAQ,UAAU,QAAQ,EAAE;QAC1D,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI,OAAO,EAAE;KACzB,CAAC,CAAC;IACH,GAAG,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { newE2EPage, E2EPage } from '@stencil/core/testing';\nimport { IDict } from '@/util';\nimport { E2EElement, NewE2EPageOptions } from '@stencil/core/testing/puppeteer/puppeteer-declarations';\nimport { removeTimezoneOffset } from '../components/q2-calendar/q2-calendar-helpers';\nimport { AxePuppeteer } from '@axe-core/puppeteer';\nimport { NewSpecPageOptions } from '@stencil/core/internal';\nimport { newSpecPage } from '@stencil/core/testing';\n\ninterface PasteInit extends EventInit {\n pastedValue: string;\n}\n\ntype EventInitType =\n | EventInit\n | KeyboardEventInit\n | MouseEventInit\n | FocusEventInit\n | CustomEventInit\n | PasteInit\n | ClipboardEventInit;\nexport async function dispatchEvent(\n page: E2EPage,\n selectors: string | string[],\n eventType: string,\n eventInit?: EventInitType\n) {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n\n await page.evaluate(\n (passedSelectors: string[], passedEventType: string, passedEventInit: EventInitType) => {\n const eventTypeDict = {\n change: CustomEvent,\n input: CustomEvent,\n keydown: KeyboardEvent,\n keyup: KeyboardEvent,\n focus: FocusEvent,\n blur: FocusEvent,\n click: MouseEvent,\n mousedown: MouseEvent,\n animationStart: AnimationEvent,\n animationEnd: AnimationEvent,\n slotchange: Event,\n load: Event,\n paste: ClipboardEvent,\n };\n\n let eventInit = passedEventInit;\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n const clipboardData = new DataTransfer();\n clipboardData.getData = () => (passedEventInit as PasteInit).pastedValue;\n eventInit = {\n bubbles: true,\n clipboardData,\n };\n }\n\n const EventTypeInit = eventTypeDict[passedEventType] || Event;\n const [first, ...rest] = passedSelectors;\n let itemElement = document.querySelector(first);\n const rootElement = itemElement;\n if (rest.length) {\n itemElement = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), itemElement);\n }\n\n itemElement?.dispatchEvent(new EventTypeInit(passedEventType, eventInit));\n\n if (passedEventType === 'paste' && 'pastedValue' in passedEventInit) {\n if (rootElement.getAttribute('type') !== 'currency') {\n (itemElement as HTMLInputElement).value =\n (itemElement as HTMLInputElement).value + passedEventInit.pastedValue;\n itemElement && itemElement.dispatchEvent(new InputEvent('input'));\n }\n }\n },\n selectors,\n eventType,\n eventInit\n );\n\n await page.waitForChanges();\n}\n\nexport async function setTestStrings(page: E2EPage, strings: IDict<string>) {\n await page.evaluate(function (strings) {\n this.TEST_STRINGS = strings;\n }, strings);\n}\n\nexport async function promiseMap<T>(arr: T[], fn: (...args: any[]) => any) {\n const promises = arr.map(fn);\n\n return Promise.all(promises);\n}\n\n/**\n * Waits for a specified amount of time.\n *\n * Please use this function sparingly, as it can slow down tests.\n */\nexport async function waitForTimeout(timeout: number) {\n return new Promise(resolve => setTimeout(resolve, timeout));\n}\n\nexport function offsetTimezone(date: string) {\n return removeTimezoneOffset(new Date(date)).toISOString();\n}\n\nexport async function setup(pageOptions?: NewE2EPageOptions) {\n const page = await newE2EPage(pageOptions);\n\n await page.evaluate(function () {\n this.TectonElements = this.TectonElements || {};\n this.TectonElements.loc = (key: string, subs?: string[] | IDict<string>) => {\n const string = (this.TEST_STRINGS && this.TEST_STRINGS[key]) || key;\n\n if (Array.isArray(subs)) {\n const regex = /({[0-9]})/g;\n return string.replace(regex, match => {\n return subs[parseInt(match[1])];\n });\n } else if (typeof subs === 'object') {\n return Object.entries(subs).reduce((accum, [key, value]) => accum.replace(`{${key}}`, value), string);\n }\n\n return string;\n };\n });\n\n await page.waitForChanges();\n\n return page;\n}\n\n/**\n * Converts an object to a string of HTML attributes.\n *\n * @param obj - The object to convert, where keys are attribute names and values are attribute values.\n * @returns A string representing the HTML attributes.\n *\n * @example\n * const attributes = objectToHTMLAttributes({ id: 'my-element', class: 'my-class', 'data-value': '123' });\n * console.log(attributes); // Output: \"id='my-element' class='my-class' data-value='123'\"\n */\nexport function objectToHTMLAttributes(obj) {\n return Object.entries(obj)\n .map(([key, value]) => `${key}='${value}'`)\n .join(' ');\n}\n\n/**\n * Sets up a new Spec Page with localization capabilities for testing.\n *\n * @param pageOptions - Configuration options for the new Spec Page.\n * @param testStrings - Optional dictionary of test strings for localization.\n * @returns A promise that resolves to the configured Spec Page.\n *\n * This function initializes a new Spec Page and sets up the `TectonElements`\n * object for localization testing. It also sets the provided test strings for\n * localization and reloads the page to ensure the new `TectonElements` object\n * is available.\n *\n * @note This method doesn't work with `NewSpecPageOptions.template`\n * property. If you need to use that, please use `newSpecPage` directly.\n */\nexport async function setupSpecPageWithLoc(pageOptions: NewSpecPageOptions, testStrings?: IDict<string>) {\n const page = await newSpecPage(pageOptions);\n await page.waitForChanges();\n\n // Setup the TectonElements object for localization testing\n const specWindow = page.win as Window & {\n TectonElements: { loc: (key: string, subs?: string[] | IDict<string>) => string };\n TEST_STRINGS: IDict<string>;\n };\n specWindow.TectonElements = {\n loc: (key: string, subs?: string[] | IDict<string>) => {\n const string = (specWindow.TEST_STRINGS && specWindow.TEST_STRINGS[key]) || key;\n\n if (Array.isArray(subs)) {\n const regex = /({[0-9]})/g;\n return string.replace(regex, match => {\n return subs[parseInt(match[1])];\n });\n } else if (typeof subs === 'object') {\n return Object.entries(subs).reduce((accum, [key, value]) => accum.replace(`{${key}}`, value), string);\n }\n\n return string;\n },\n resizeIframe: () => {},\n resolveMenu: async () => {\n return [];\n },\n navigateTo: () => {},\n showOverpanel: async <T>(): Promise<T> => {\n return {} as T;\n },\n };\n\n // Set the test strings\n specWindow.TEST_STRINGS = testStrings || {};\n\n // Reload the page to ensure the new TectonElements object is available\n await page.setContent(page.body.innerHTML);\n\n return page;\n}\n\nexport function setWindowHeight(height: number) {\n Object.defineProperty(window, 'innerHeight', {\n writable: true,\n configurable: true,\n value: height,\n });\n\n window.dispatchEvent(new Event('resize'));\n\n expect(window.innerHeight).toBe(height);\n}\n\nexport function makeDomRect(customAttributes) {\n const defaults = {\n bottom: 0,\n height: 50,\n width: 50,\n left: 40,\n right: 0,\n top: 0,\n x: 0,\n y: 0,\n toJSON: () => ({}),\n };\n return { ...defaults, ...customAttributes };\n}\nexport const base64Image =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=';\n\nexport async function getActiveElementTestId(page: E2EPage) {\n return page.$eval(\n 'body',\n () =>\n (document.activeElement.shadowRoot?.activeElement ?? document.activeElement).getAttribute('test-id') ?? null\n );\n}\n\nexport const getFocusedOptionValue = async (page: E2EPage) => {\n await page.waitForSelector('q2-option:focus');\n return page.$eval('body', () => document.activeElement.getAttribute('value'));\n};\n\nexport const getFocusedTagName = async (page: E2EPage) => {\n return page.$eval('body', () => document.activeElement?.tagName);\n};\n\nexport async function getFocusedAttribute(page: E2EPage, attribute: string) {\n return page.$eval(\n 'body',\n (_, attribute: string) => {\n const activeElement = document.activeElement.shadowRoot?.activeElement ?? document.activeElement;\n return activeElement?.getAttribute(attribute) ?? null;\n },\n attribute\n );\n}\n\nexport const testDeprecatedAriaLabel = async (element: E2EElement, label: string = 'My Label') => {\n expect(element).toEqualAttribute('label', label);\n const hasHideLabelProp = typeof (await element.getProperty('hideLabel')) !== 'undefined';\n if (hasHideLabelProp) expect(element).toHaveAttribute('hide-label');\n expect(await element.getProperty('ariaLabel')).toBeUndefined();\n};\n\n/** This function ensures all shadowDOM-enabled components check for SCSS compilation issues. */\nexport const getListOfStyleCompilationIssues = async (page: E2EPage, selector: string) => {\n return page.$eval(selector, el => {\n interface ShadowRootShim extends ShadowRoot {\n adoptedStyleSheets: CSSStyleSheet[];\n }\n const adoptedStyleSheets = (el.shadowRoot as ShadowRootShim).adoptedStyleSheets;\n const result = adoptedStyleSheets.reduce((accum, styleSheet) => {\n Array.from(styleSheet.cssRules).forEach(rule => {\n const hasVarList = rule.cssText.includes('var-list(');\n const hasVarPrefixer = rule.cssText.includes('var-prefixer(');\n if (hasVarList || hasVarPrefixer) accum.push((rule as any).selectorText);\n });\n return accum;\n }, []);\n\n if (!!result.length) {\n // eslint-disable-next-line no-console\n console.log(`The following selectors have compilation issues: ${result.join(', ')}`);\n }\n\n return result;\n });\n};\n\nexport const getNestedElementProperty = async (page: E2EPage, selectors: string | string[], prop: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.evaluate(\n (selectors: string[], prop: string) => {\n const [first, ...rest] = selectors;\n let element = document.querySelector(first);\n if (rest.length) {\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n }\n return element[prop];\n },\n selectors,\n prop\n );\n};\n\nexport const getNestedElementAttribute = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return element.getAttribute(attribute);\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedElementStyle = async (page: E2EPage, selectors: string | string[], attribute: string) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element, selectors: string[], attribute: string) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n const elementStyle = window.getComputedStyle(element);\n return elementStyle[attribute];\n },\n selectors,\n attribute\n );\n};\n\nexport const getNestedAssignedElementLength = async (page: E2EPage, selectors: string | string[]) => {\n if (typeof selectors === 'string') {\n selectors = [selectors];\n }\n return page.$eval(\n 'body',\n (element: HTMLElement, selectors: string[]) => {\n const [first, ...rest] = selectors;\n element = document.querySelector(first);\n element = rest.reduce((acc, selector) => acc.shadowRoot.querySelector(selector), element);\n return (element as HTMLSlotElement)?.assignedElements?.().length ?? undefined;\n },\n selectors\n );\n};\n\nexport const evaluateA11y = async (page: any, ...args: string[]) => {\n // Configuration\n const config = {\n detailLevel: args.includes('verbose') ? 'verbose' : 'default',\n testType: args.includes('webpage') ? 'webpage' : 'component',\n disabledRulesForComponents: [\n 'document-title',\n 'html-has-lang',\n 'landmark-one-main',\n 'page-has-heading-one',\n 'region',\n ],\n };\n\n // Set disabled rules based on test type\n const disabledRules = config.testType === 'webpage' ? [] : config.disabledRulesForComponents;\n\n let processedViolations;\n\n try {\n // Create a timeout promise for the axe analysis\n const timeoutPromise = new Promise((_, reject) => {\n const id = setTimeout(() => {\n clearTimeout(id);\n reject(new Error('AxePuppeteer analysis timed out'));\n }, 10000);\n });\n\n // Run analysis with timeout\n const analysisPromise = new AxePuppeteer(page).disableRules(disabledRules).analyze();\n const analysisResults = await Promise.race([analysisPromise, timeoutPromise]);\n\n // Clean up AxePuppeteer resources\n await page.evaluate(() => {\n // Remove axe script elements\n document.querySelectorAll('script[id$=\"axe-puppeteer\"]').forEach(el => el.remove());\n\n // Clear any remaining axe-related listeners\n const win = window as any;\n if (win.axe) {\n if (win.axe.teardown === 'function') {\n win.axe.teardown();\n }\n delete win.axe;\n }\n\n // ensure the promise resolves\n return true;\n });\n\n // @ts-expect-error analysisResults complains about the violations property\n const { violations } = analysisResults;\n\n if (!violations.length) return false;\n\n // Return full violations if verbose mode is requested\n if (config.detailLevel === 'verbose') return violations;\n\n // Process violations for default detail level\n processedViolations = violations.reduce((responseObj, violation) => {\n const { nodes, help, helpUrl, id } = violation;\n const node = nodes[0];\n\n // Create violation info object\n responseObj[id] = {\n help,\n helpUrl,\n failureSummary: node.failureSummary,\n html: node.html,\n rulesViolated: node.any.reduce((rules, rule) => {\n rules[rule.id] = rule.message;\n return rules;\n }, {}),\n };\n\n return responseObj;\n }, {});\n } catch (error) {\n console.error(`There was an error with AxePuppeteer analysis. ERROR: ${error}`);\n }\n\n return processedViolations;\n};\n\n/**\n * This function mocks the fetch API to return a resolved promise with the given icon markup.\n * You can optionally provide a <symbol> element, but it is not required.\n *\n * This is meant to be used to prevent errors on Unit/Spec tests with <q2-icon> because we are unable to provide a valid\n * URL for the fetch call in that context.\n *\n * @note This function should be called before the component is rendered.\n * @note Be sure to call `jest.restoreAllMocks()` after the test to restore the original fetch function.\n */\nexport const mockIconFetch = (iconMarkup?: string) => {\n const spy = jest.spyOn(global, 'fetch');\n const mockResponse = new Response(`<svg>${iconMarkup}</svg>`, {\n status: 200,\n statusText: 'OK',\n headers: new Headers(),\n });\n spy.mockResolvedValue(mockResponse);\n return spy;\n};\n"]}
|
|
@@ -154,10 +154,11 @@ export function handleRenamedProp(target, oldProp, newProp, removeOldProp) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
export function handleDeprecationWarning(target, deprecatedItemName, deprecatedItemType) {
|
|
157
|
+
var _a, _b, _c, _d, _e;
|
|
157
158
|
if (window.location.hostname === 'localhost' || window.location.host === 'stack.q2developer.com') {
|
|
158
159
|
if (target[deprecatedItemName] === 'undefined')
|
|
159
160
|
return;
|
|
160
|
-
const componentName = target.constructor.name.toLowerCase().slice(2);
|
|
161
|
+
const componentName = ((_c = (_b = (_a = target.constructor) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === null || _c === void 0 ? void 0 : _c.slice(2)) || ((_e = (_d = target.hostElement) === null || _d === void 0 ? void 0 : _d.tagName) === null || _e === void 0 ? void 0 : _e.toLowerCase().slice(3));
|
|
161
162
|
switch (deprecatedItemType) {
|
|
162
163
|
case 'prop':
|
|
163
164
|
if (deprecatedItemName === 'size' && componentName === 'btn') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAgBlC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAsD,EAAK,EAAE,QAAgB,GAAG,EAAE,EAAE;IACxG,IAAI,OAAsC,CAAC;IAC3C,OAAO,UAAU,GAAG,IAAmB;QACnC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YACtB,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAChB,CAAC,EAAE,KAAK,CAAC,CAAC;IACd,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,QAAQ;IACpB,OAAO,qFAAqF,CAAC,IAAI,CAC7F,SAAS,CAAC,SAAS,CACtB,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAiB,EAAE,WAAwB;IACzE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,SAAS,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KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;wBACrC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;4BAChC,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;wBAChC,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;IAE3B,yBAAyB;IACzB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC","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"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAiBlC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAsD,EAAK,EAAE,QAAgB,GAAG,EAAE,EAAE;IACxG,IAAI,OAAsC,CAAC;IAC3C,OAAO,UAAU,GAAG,IAAmB;QACnC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YACtB,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAChB,CAAC,EAAE,KAAK,CAAC,CAAC;IACd,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,QAAQ;IACpB,OAAO,qFAAqF,CAAC,IAAI,CAC7F,SAAS,CAAC,SAAS,CACtB,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAiB,EAAE,WAAwB;IACzE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE9C,yFAAyF;IACzF,0FAA0F;IAC1F,MAAM,mBAAmB,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;IAE3E,MAAM,4BAA4B,GAAG,CAAC,OAAoB,EAAE,EAAE;QAC1D,IAAI,OAAO,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QACzC,IAAI,OAAO,CAAC,aAAa,E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CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;IAE3B,yBAAyB;IACzB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC","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';\nimport { Q2Popover } from '@/components/q2-popover/q2-popover';\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(\n target: Q2Btn | Q2Calendar | Q2Dropdown | Q2Popover,\n oldProp: string,\n newProp: string,\n removeOldProp?: boolean\n) {\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: Q2Btn | Q2Calendar | Q2Dropdown | Q2Popover,\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 =\n target.constructor?.name?.toLowerCase()?.slice(2) || target.hostElement?.tagName?.toLowerCase().slice(3);\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mirror-emit.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"mirror-emit.js","sourceRoot":"","sources":["../../../src/utils/mirror-emit.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CAA4B,OAA2B,EAAE,MAAqB,EAAE,MAAS,EAAE,EAAE;IAC5G,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;;QACnB,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAoB,CAAC;QACrD,IAAI,CAAC,UAAU;YAAE,OAAO;QACxB,MAAA,UAAU,CAAC,IAAI,2DAAG,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { ComponentInterface, EventEmitter } from '@stencil/core';\n\n/**\n * Emits specified events from a given component context with the provided detail.\n *\n * @template T - The type of the event detail. Defaults to the type of `CustomEvent['detail']`.\n * @param context - The component context that contains the event emitters.\n * @param events - An array of event names to be emitted.\n * @param detail - The detail payload to be passed to each emitted event.\n */\nconst mirrorEmit = <T = CustomEvent['detail']>(context: ComponentInterface, events: Array<string>, detail: T) => {\n events.forEach(event => {\n const eventEntry = context[event] as EventEmitter<T>;\n if (!eventEntry) return;\n eventEntry.emit?.(detail);\n });\n};\n\nexport default mirrorEmit;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize-html-string.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"sanitize-html-string.js","sourceRoot":"","sources":["../../../src/utils/sanitize-html-string.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,UAAkB;IACzD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE;QAC1C,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,uBAAuB,EAAE;YACrB,YAAY,EAAE,MAAM;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import DOMPurify from 'dompurify';\n\nexport default function sanitizeHTMLString(htmlString: string) {\n return DOMPurify(window).sanitize(htmlString, {\n FORBID_TAGS: ['style'],\n CUSTOM_ELEMENT_HANDLING: {\n tagNameCheck: /^q2-/,\n },\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize-regex-string.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"sanitize-regex-string.js","sourceRoot":"","sources":["../../../src/utils/sanitize-regex-string.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,WAAmB;IAC3D,OAAO,WAAW,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["export default function sanitizeRegexString(regexString: string) {\n return regexString.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-sheet-test.e2e.js","sourceRoot":"","sources":["../../../src/utils/test/action-sheet-test.e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEvE,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACjC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACnC,MAAM,qBAAqB,GAAG,GAAG,EAAE;YAC9B,MAAc,CAAC,cAAc,GAAG;gBAC7B,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;oBAC1B,eAAe,EAAE,EAAE;oBACnB,IAAI,EAAE,SAAS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;QACP,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;YACpD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;gBAC/B,UAAU,EAAE;oBACR,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;oBAC7D,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;iBACH;gBAC5B,KAAK,EAAE,EAAE;aACZ,CAAC,CAAC;YAEH,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;gBAC7B,QAAQ,EAAE,KAAK;gBACf,QAAQ,EAAE,KAAK;gBACf,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;aAChE,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { ActionSheetListOptgroup, ActionSheetListOption } from 'q2-tecton-common/lib/utility/action-sheet';\nimport { shouldShowActionSheet, buildListData } from '../action-sheet';\n\ndescribe('utils: action-sheet', () => {\n describe('shouldShowActionSheet', () => {\n const defineShowActionSheet = () => {\n (window as any).TectonElements = {\n showActionSheet: async () => ({\n selectedOptions: [],\n type: 'confirm',\n }),\n };\n };\n const originalCreateElement = document.createElement;\n const setDialogCompatibility = (enabled: boolean) => {\n document.createElement = jest.fn().mockImplementation(tagName => {\n return tagName === 'dialog' && enabled ? { open: true } : {};\n });\n };\n const newKeyboardEvent = (key: string) => new KeyboardEvent('keydown', { key });\n\n describe(\"when component's hoist prop is true\", () => {\n afterEach(() => {\n document.createElement = originalCreateElement;\n });\n\n it('returns false when dialog is not supported', async () => {\n setDialogCompatibility(false);\n expect(shouldShowActionSheet({ hoist: true })).toBe(false);\n });\n\n describe('when dialog is supported', () => {\n beforeEach(() => {\n setDialogCompatibility(true);\n });\n\n it('returns false when showActionSheet is undefined', async () => {\n expect(shouldShowActionSheet({ hoist: true })).toBe(false);\n });\n\n describe('when showActionSheet is defined', () => {\n beforeEach(() => {\n defineShowActionSheet();\n });\n\n it('returns true', async () => {\n expect(shouldShowActionSheet({ hoist: true })).toBe(true);\n });\n\n describe('when event is defined', () => {\n describe('when event is a KeyboardEvent', () => {\n it('returns true on ArrowDown', async () => {\n expect(shouldShowActionSheet({ hoist: true }, newKeyboardEvent('ArrowDown'))).toBe(\n true\n );\n });\n\n it('returns false on the letter \"S\"', async () => {\n expect(shouldShowActionSheet({ hoist: true }, newKeyboardEvent('S'))).toBe(false);\n });\n });\n\n describe('when event is a MouseEvent', () => {\n it(\"returns true when event's type is click\", async () => {\n expect(shouldShowActionSheet({ hoist: true }, new MouseEvent('click'))).toBe(true);\n });\n it(\"returns false when event's type is mousedown\", async () => {\n expect(shouldShowActionSheet({ hoist: true }, new MouseEvent('mousedown'))).toBe(false);\n });\n });\n });\n });\n });\n });\n });\n describe('buildListData', () => {\n beforeEach(() => {});\n afterEach(() => {\n document.body.innerHTML = '';\n });\n\n it('serializes options', async () => {\n document.body.innerHTML = `\n <q2-option value=\"option-1\">Option 1</q2-option>\n <q2-option value=\"option-2\">Option 2</q2-option>\n <q2-option value=\"option-separator\" separator></q2-option>\n <q2-option value=\"option-3\">Option 3</q2-option>\n <q2-option value=\"option-4\">Option 4</q2-option>\n `;\n\n // This is necessary because the components are not actually defined here\n document.querySelector<HTMLQ2DropdownItemElement>('q2-option[separator]').separator = true;\n\n const result = await buildListData({\n optionList: {\n getContents: async () => Array.from(document.body.children),\n } as HTMLQ2OptionListElement,\n label: 'Test',\n });\n\n expect(result.title).toEqual('Test');\n expect(result.options).toHaveLength(5);\n expect((result.options[2] as ActionSheetListOption).separator).toBe(true);\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: false,\n selectedOptions: [],\n });\n });\n\n it('serializes dropdown-items', async () => {\n document.body.innerHTML = `\n <q2-dropdown-item value=\"dropdown-item-1\">Option 1</q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-2\">Option 2</q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-separator\" separator=\"true\"></q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-3\">Option 3</q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-4\">Option 4</q2-dropdown-item>\n `;\n\n // This is necessary because the components are not actually defined here\n document.querySelector<HTMLQ2DropdownItemElement>('q2-dropdown-item[separator]').separator = true;\n\n const result = await buildListData({\n optionList: {\n getContents: async () => Array.from(document.body.children),\n } as HTMLQ2OptionListElement,\n label: 'Test',\n });\n\n expect(result.title).toEqual('Test');\n expect(result.options).toHaveLength(5);\n expect((result.options[2] as ActionSheetListOption).separator).toBe(true);\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: false,\n selectedOptions: [],\n });\n });\n\n it('serializes groups of options', async () => {\n document.body.innerHTML = `\n <q2-optgroup label=\"Group 1\">\n <q2-option value=\"option-1\">Option 1</q2-option>\n <q2-option value=\"option-2\">Option 2</q2-option>\n <q2-option value=\"option-3\">Option 3</q2-option>\n </q2-optgroup>\n <q2-optgroup label=\"Group 2\">\n <q2-option value=\"option-4\">Option 4</q2-option>\n </q2-optgroup>\n `;\n const result = await buildListData({\n optionList: {\n getContents: async () => Array.from(document.body.children),\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.options).toHaveLength(2);\n expect((result.options[0] as ActionSheetListOptgroup).options).toHaveLength(3);\n expect((result.options[1] as ActionSheetListOptgroup).options).toHaveLength(1);\n });\n\n it('sets listProps.multiple to true', async () => {\n const result = await buildListData({\n optionList: {\n multiple: true,\n getContents: async () => [],\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.listProps).toEqual({\n multiple: true,\n noSelect: false,\n selectedOptions: [],\n });\n });\n\n it('sets listProps.noSelect to true', async () => {\n const result = await buildListData({\n optionList: {\n noSelect: true,\n getContents: async () => [],\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: true,\n selectedOptions: [],\n });\n });\n\n it('sets listProps.selectedOptions to true', async () => {\n const result = await buildListData({\n optionList: {\n selectedOptions: [{ value: 'option-1', display: 'Option 1' }],\n getContents: async () => [],\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: false,\n selectedOptions: [{ value: 'option-1', display: 'Option 1' }],\n });\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"action-sheet-test.e2e.js","sourceRoot":"","sources":["../../../../src/utils/test/action-sheet-test.e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEvE,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACjC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACnC,MAAM,qBAAqB,GAAG,GAAG,EAAE;YAC9B,MAAc,CAAC,cAAc,GAAG;gBAC7B,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;oBAC1B,eAAe,EAAE,EAAE;oBACnB,IAAI,EAAE,SAAS;iBAClB,CAAC;aACL,CAAC;QACN,CAAC,CAAC;QACF,MAAM,qBAAqB,GAAG,QAAQ,CAAC,aAAa,CAAC;QACrD,MAAM,sBAAsB,GAAG,CAAC,OAAgB,EAAE,EAAE;YAChD,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE;gBAC5D,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QACF,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,SAAS,EAAE,EAAE,GAAG,EAA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AU,EAAE,CAAC;aAChE,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { ActionSheetListOptgroup, ActionSheetListOption } from 'q2-tecton-common/lib/utility/action-sheet';\nimport { shouldShowActionSheet, buildListData } from '../action-sheet';\n\ndescribe('utils: action-sheet', () => {\n describe('shouldShowActionSheet', () => {\n const defineShowActionSheet = () => {\n (window as any).TectonElements = {\n showActionSheet: async () => ({\n selectedOptions: [],\n type: 'confirm',\n }),\n };\n };\n const originalCreateElement = document.createElement;\n const setDialogCompatibility = (enabled: boolean) => {\n document.createElement = jest.fn().mockImplementation(tagName => {\n return tagName === 'dialog' && enabled ? { open: true } : {};\n });\n };\n const newKeyboardEvent = (key: string) => new KeyboardEvent('keydown', { key });\n\n describe(\"when component's hoist prop is true\", () => {\n afterEach(() => {\n document.createElement = originalCreateElement;\n });\n\n it('returns false when dialog is not supported', async () => {\n setDialogCompatibility(false);\n expect(shouldShowActionSheet({ hoist: true })).toBe(false);\n });\n\n describe('when dialog is supported', () => {\n beforeEach(() => {\n setDialogCompatibility(true);\n });\n\n it('returns false when showActionSheet is undefined', async () => {\n expect(shouldShowActionSheet({ hoist: true })).toBe(false);\n });\n\n describe('when showActionSheet is defined', () => {\n beforeEach(() => {\n defineShowActionSheet();\n });\n\n it('returns true', async () => {\n expect(shouldShowActionSheet({ hoist: true })).toBe(true);\n });\n\n describe('when event is defined', () => {\n describe('when event is a KeyboardEvent', () => {\n it('returns true on ArrowDown', async () => {\n expect(shouldShowActionSheet({ hoist: true }, newKeyboardEvent('ArrowDown'))).toBe(\n true\n );\n });\n\n it('returns false on the letter \"S\"', async () => {\n expect(shouldShowActionSheet({ hoist: true }, newKeyboardEvent('S'))).toBe(false);\n });\n });\n\n describe('when event is a MouseEvent', () => {\n it(\"returns true when event's type is click\", async () => {\n expect(shouldShowActionSheet({ hoist: true }, new MouseEvent('click'))).toBe(true);\n });\n it(\"returns false when event's type is mousedown\", async () => {\n expect(shouldShowActionSheet({ hoist: true }, new MouseEvent('mousedown'))).toBe(false);\n });\n });\n });\n });\n });\n });\n });\n describe('buildListData', () => {\n beforeEach(() => {});\n afterEach(() => {\n document.body.innerHTML = '';\n });\n\n it('serializes options', async () => {\n document.body.innerHTML = `\n <q2-option value=\"option-1\">Option 1</q2-option>\n <q2-option value=\"option-2\">Option 2</q2-option>\n <q2-option value=\"option-separator\" separator></q2-option>\n <q2-option value=\"option-3\">Option 3</q2-option>\n <q2-option value=\"option-4\">Option 4</q2-option>\n `;\n\n // This is necessary because the components are not actually defined here\n document.querySelector<HTMLQ2DropdownItemElement>('q2-option[separator]').separator = true;\n\n const result = await buildListData({\n optionList: {\n getContents: async () => Array.from(document.body.children),\n } as HTMLQ2OptionListElement,\n label: 'Test',\n });\n\n expect(result.title).toEqual('Test');\n expect(result.options).toHaveLength(5);\n expect((result.options[2] as ActionSheetListOption).separator).toBe(true);\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: false,\n selectedOptions: [],\n });\n });\n\n it('serializes dropdown-items', async () => {\n document.body.innerHTML = `\n <q2-dropdown-item value=\"dropdown-item-1\">Option 1</q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-2\">Option 2</q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-separator\" separator=\"true\"></q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-3\">Option 3</q2-dropdown-item>\n <q2-dropdown-item value=\"dropdown-item-4\">Option 4</q2-dropdown-item>\n `;\n\n // This is necessary because the components are not actually defined here\n document.querySelector<HTMLQ2DropdownItemElement>('q2-dropdown-item[separator]').separator = true;\n\n const result = await buildListData({\n optionList: {\n getContents: async () => Array.from(document.body.children),\n } as HTMLQ2OptionListElement,\n label: 'Test',\n });\n\n expect(result.title).toEqual('Test');\n expect(result.options).toHaveLength(5);\n expect((result.options[2] as ActionSheetListOption).separator).toBe(true);\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: false,\n selectedOptions: [],\n });\n });\n\n it('serializes groups of options', async () => {\n document.body.innerHTML = `\n <q2-optgroup label=\"Group 1\">\n <q2-option value=\"option-1\">Option 1</q2-option>\n <q2-option value=\"option-2\">Option 2</q2-option>\n <q2-option value=\"option-3\">Option 3</q2-option>\n </q2-optgroup>\n <q2-optgroup label=\"Group 2\">\n <q2-option value=\"option-4\">Option 4</q2-option>\n </q2-optgroup>\n `;\n const result = await buildListData({\n optionList: {\n getContents: async () => Array.from(document.body.children),\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.options).toHaveLength(2);\n expect((result.options[0] as ActionSheetListOptgroup).options).toHaveLength(3);\n expect((result.options[1] as ActionSheetListOptgroup).options).toHaveLength(1);\n });\n\n it('sets listProps.multiple to true', async () => {\n const result = await buildListData({\n optionList: {\n multiple: true,\n getContents: async () => [],\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.listProps).toEqual({\n multiple: true,\n noSelect: false,\n selectedOptions: [],\n });\n });\n\n it('sets listProps.noSelect to true', async () => {\n const result = await buildListData({\n optionList: {\n noSelect: true,\n getContents: async () => [],\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: true,\n selectedOptions: [],\n });\n });\n\n it('sets listProps.selectedOptions to true', async () => {\n const result = await buildListData({\n optionList: {\n selectedOptions: [{ value: 'option-1', display: 'Option 1' }],\n getContents: async () => [],\n } as HTMLQ2OptionListElement,\n label: '',\n });\n\n expect(result.listProps).toEqual({\n multiple: false,\n noSelect: false,\n selectedOptions: [{ value: 'option-1', display: 'Option 1' }],\n });\n });\n });\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../src/utils/test/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACtD,MAAM,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,qFAAqF,EAAE,GAAG,EAAE;YAC3F,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;YAC5F,MAAM,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACvD,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { getAriaValueFromProp } from '../index';\n\ndescribe('General Utils', () => {\n describe('getAriaValueFromProp', () => {\n it('return `undefined` value when `prop` undefined', () => {\n expect(getAriaValueFromProp(undefined)).toEqual(undefined);\n });\n it('return `prop` value when `validValues` undefined and `prop` not equal to \"Symbol()\"', () => {\n expect(getAriaValueFromProp('test')).toEqual('test');\n });\n it('return `undefined` value when `validValues` undefined and `prop` equal to \"Symbol()\"', () => {\n expect(getAriaValueFromProp('Symbol()')).toEqual(undefined);\n });\n it('return `prop` value when in `validValues` array', () => {\n expect(getAriaValueFromProp('test', ['test', 'test2'])).toEqual('test');\n });\n });\n});\n"]}
|
package/dist/components/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { Q2DropdownItem } from './q2-dropdown-item.js';
|
|
|
21
21
|
import { Q2EditableField } from './q2-editable-field.js';
|
|
22
22
|
import { Q2Example } from './q2-example.js';
|
|
23
23
|
import { Q2FilePicker } from './q2-file-picker.js';
|
|
24
|
+
import { Q2Form } from './q2-form.js';
|
|
24
25
|
import { Q2FormattedText } from './q2-formatted-text.js';
|
|
25
26
|
import { Q2Icon } from './q2-icon.js';
|
|
26
27
|
import { Q2Input } from './q2-input.js';
|
|
@@ -32,6 +33,7 @@ import { Q2Loading } from './q2-loading.js';
|
|
|
32
33
|
import { Q2LoadingElement } from './q2-loading-element.js';
|
|
33
34
|
import { Q2Loc } from './q2-loc.js';
|
|
34
35
|
import { Q2Message } from './q2-message.js';
|
|
36
|
+
import { Q2Modal } from './q2-modal.js';
|
|
35
37
|
import { Q2MonthPicker } from './q2-month-picker.js';
|
|
36
38
|
import { Q2Optgroup } from './q2-optgroup.js';
|
|
37
39
|
import { Q2Option } from './q2-option.js';
|
|
@@ -82,6 +84,7 @@ const defineCustomElements = (opts) => {
|
|
|
82
84
|
Q2EditableField,
|
|
83
85
|
Q2Example,
|
|
84
86
|
Q2FilePicker,
|
|
87
|
+
Q2Form,
|
|
85
88
|
Q2FormattedText,
|
|
86
89
|
Q2Icon,
|
|
87
90
|
Q2Input,
|
|
@@ -93,6 +96,7 @@ const defineCustomElements = (opts) => {
|
|
|
93
96
|
Q2LoadingElement,
|
|
94
97
|
Q2Loc,
|
|
95
98
|
Q2Message,
|
|
99
|
+
Q2Modal,
|
|
96
100
|
Q2MonthPicker,
|
|
97
101
|
Q2Optgroup,
|
|
98
102
|
Q2Option,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":"
|
|
1
|
+
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -125,10 +125,11 @@ function handleRenamedProp(target, oldProp, newProp, removeOldProp) {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
function handleDeprecationWarning(target, deprecatedItemName, deprecatedItemType) {
|
|
128
|
+
var _a, _b, _c, _d, _e;
|
|
128
129
|
if (window.location.hostname === 'localhost' || window.location.host === 'stack.q2developer.com') {
|
|
129
130
|
if (target[deprecatedItemName] === 'undefined')
|
|
130
131
|
return;
|
|
131
|
-
const componentName = target.constructor.name.toLowerCase().slice(2);
|
|
132
|
+
const componentName = ((_c = (_b = (_a = target.constructor) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === null || _c === void 0 ? void 0 : _c.slice(2)) || ((_e = (_d = target.hostElement) === null || _d === void 0 ? void 0 : _d.tagName) === null || _e === void 0 ? void 0 : _e.toLowerCase().slice(3));
|
|
132
133
|
switch (deprecatedItemType) {
|
|
133
134
|
case 'prop':
|
|
134
135
|
if (deprecatedItemName === 'size' && componentName === 'btn') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index2.js","mappings":";;MAgBa,QAAQ,GAAG,CAAsD,EAAK,EAAE,QAAgB,GAAG;IACpG,IAAI,OAAsC,CAAC;IAC3C,OAAO,UAAU,GAAG,IAAmB;QACnC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC;YACjB,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;SACf,EAAE,KAAK,CAAC,CAAC;KACb,CAAC;AACN,EAAE;SAEc,QAAQ;IACpB,OAAO,qFAAqF,CAAC,IAAI,CAC7F,SAAS,CAAC,SAAS,CACtB,CAAC;AACN,CAAC;SAuBe,yBAAyB,CAAC,KAAiB,EAAE,OAAoB;IAC7E,OAAO,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,OAAO,C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J;qBAAM;;oBAEH,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;wBACpC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;4BAC/B,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;yBAC/B;qBACJ;iBACJ;aACJ;SACJ;KACJ;IAED,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;;IAG3B,IAAI,IAAI,CAAC,IAAI,EAAE;QACX,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;KAC1B;IAED,IAAI,IAAI,CAAC,mBAAmB,EAAE;QAC1B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACxC;IAED,OAAO,MAAM,CAAC;AAClB;;;;","names":[],"sources":["src/utils/index.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { Q2Btn } from 'src/components/q2-btn/q2-btn';\nimport { Q2Calendar } from 'src/components/q2-calendar/q2-calendar';\nimport { Q2Carousel } from 'src/components/q2-carousel/q2-carousel';\nimport { Q2Checkbox } from 'src/components/q2-checkbox/q2-checkbox';\nimport { Q2CheckboxGroup } from 'src/components/q2-checkbox-group/q2-checkbox-group';\nimport { Q2RadioGroup } from 'src/components/q2-radio-group/q2-radio-group';\nimport { Q2Dropdown } from 'src/components/q2-dropdown/q2-dropdown';\nimport { Q2DropdownItem } from 'src/components/q2-dropdown-item/q2-dropdown-item';\nimport { Q2EditableField } from 'src/components/q2-editable-field/q2-editable-field';\nimport { Q2Input } from 'src/components/q2-input/q2-input';\nimport { Q2Loading } from 'src/components/q2-loading/q2-loading';\nimport { Q2Radio } from 'src/components/q2-radio/q2-radio';\nimport { Q2Select } from 'src/components/q2-select/q2-select';\nimport { FormFieldTypes, IDict } from 'src/util';\n\nexport 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"],"version":3}
|
|
1
|
+
{"file":"index2.js","mappings":";;MAiBa,QAAQ,GAAG,CAAsD,EAAK,EAAE,QAAgB,GAAG;IACpG,IAAI,OAAsC,CAAC;IAC3C,OAAO,UAAU,GAAG,IAAmB;QACnC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC;YACjB,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;SACf,EAAE,KAAK,CAAC,CAAC;KACb,CAAC;AACN,EAAE;SAEc,QAAQ;IACpB,OAAO,qFAAqF,CAAC,IAAI,CAC7F,SAAS,CAAC,SAAS,CACtB,CAAC;AACN,CAAC;SAuBe,yBAAyB,CAAC,KAAiB,EAAE,OAAoB;IAC7E,OAAO,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAqB,CAAC,CAAC;AAC7F,CAAC;SAEe,kBAAkB,CAAC,KAAY,EAAE,OAAoB;;IACjE,OAAO,CAAA,MAAA,KAAK,CAAC,YAAY,sDAAK,CAAC,CAAC,MAAK,OAAO,CAAC;AACjD,CAAC;SAEe,aAAa,CAAC,WAAwB;IAClD,WAAW,CAAC,KAAK,GAAG,MAAM,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,aAAa,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AACtG,CAAC;SAEe,SAAS;IACrB,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;IACpD,OAAO,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;SAEe,aAAa;IACzB,OAAO,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,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O,MAAM,CAAC;AAClB;;;;","names":[],"sources":["src/utils/index.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { Q2Btn } from 'src/components/q2-btn/q2-btn';\nimport { Q2Calendar } from 'src/components/q2-calendar/q2-calendar';\nimport { Q2Carousel } from 'src/components/q2-carousel/q2-carousel';\nimport { Q2Checkbox } from 'src/components/q2-checkbox/q2-checkbox';\nimport { Q2CheckboxGroup } from 'src/components/q2-checkbox-group/q2-checkbox-group';\nimport { Q2RadioGroup } from 'src/components/q2-radio-group/q2-radio-group';\nimport { Q2Dropdown } from 'src/components/q2-dropdown/q2-dropdown';\nimport { Q2DropdownItem } from 'src/components/q2-dropdown-item/q2-dropdown-item';\nimport { Q2EditableField } from 'src/components/q2-editable-field/q2-editable-field';\nimport { Q2Input } from 'src/components/q2-input/q2-input';\nimport { Q2Loading } from 'src/components/q2-loading/q2-loading';\nimport { Q2Radio } from 'src/components/q2-radio/q2-radio';\nimport { Q2Select } from 'src/components/q2-select/q2-select';\nimport { FormFieldTypes, IDict } from 'src/util';\nimport { Q2Popover } from '@/components/q2-popover/q2-popover';\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(\n target: Q2Btn | Q2Calendar | Q2Dropdown | Q2Popover,\n oldProp: string,\n newProp: string,\n removeOldProp?: boolean\n) {\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: Q2Btn | Q2Calendar | Q2Dropdown | Q2Popover,\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 =\n target.constructor?.name?.toLowerCase()?.slice(2) || target.hostElement?.tagName?.toLowerCase().slice(3);\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"],"version":3}
|