q2-tecton-elements 1.54.5 → 1.55.1
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
|
@@ -0,0 +1,719 @@
|
|
|
1
|
+
import { Q2Tag } from "../q2-tag";
|
|
2
|
+
import { setupSpecPageWithLoc } from "../../../utils/helpers";
|
|
3
|
+
import { overrideFocus, isEventFromElement } from "../../../utils/index";
|
|
4
|
+
import { shouldShowActionSheet, showActionSheetList } from "../../../utils/action-sheet";
|
|
5
|
+
import { Q2Popover } from "../../q2-popover/q2-popover";
|
|
6
|
+
const overrideFocusMock = jest.fn();
|
|
7
|
+
const isEventFromElementMock = jest.fn();
|
|
8
|
+
const shouldShowActionSheetMock = jest.fn();
|
|
9
|
+
const showActionSheetListMock = jest.fn();
|
|
10
|
+
const originalOverrideFocus = overrideFocus;
|
|
11
|
+
const originalIsEventFromElement = isEventFromElement;
|
|
12
|
+
const originalShouldShowActionSheet = shouldShowActionSheet;
|
|
13
|
+
const originalShowActionSheetList = showActionSheetList;
|
|
14
|
+
overrideFocus = overrideFocusMock;
|
|
15
|
+
isEventFromElement = isEventFromElementMock;
|
|
16
|
+
shouldShowActionSheet = shouldShowActionSheetMock;
|
|
17
|
+
showActionSheetList = showActionSheetListMock;
|
|
18
|
+
describe('q2-tag', () => {
|
|
19
|
+
let specPage;
|
|
20
|
+
let tagClass;
|
|
21
|
+
let tagElement;
|
|
22
|
+
let option;
|
|
23
|
+
let button;
|
|
24
|
+
let event;
|
|
25
|
+
let spy;
|
|
26
|
+
const testStringsDict = {
|
|
27
|
+
'tecton.element.tag.test': 'Test String',
|
|
28
|
+
'tecton.element.tag.changed': 'Changed String',
|
|
29
|
+
'tecton.element.optionList.optionCount': 'This option list has {0} options.',
|
|
30
|
+
};
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
overrideFocusMock.mockClear();
|
|
33
|
+
isEventFromElementMock.mockClear();
|
|
34
|
+
shouldShowActionSheetMock.mockClear();
|
|
35
|
+
showActionSheetListMock.mockClear();
|
|
36
|
+
});
|
|
37
|
+
afterAll(() => {
|
|
38
|
+
// this is to stop typescript from complaining about the functions
|
|
39
|
+
overrideFocus = originalOverrideFocus;
|
|
40
|
+
isEventFromElement = originalIsEventFromElement;
|
|
41
|
+
shouldShowActionSheet = originalShouldShowActionSheet;
|
|
42
|
+
showActionSheetList = originalShowActionSheetList;
|
|
43
|
+
});
|
|
44
|
+
describe('Props', () => {
|
|
45
|
+
describe('hoist', () => {
|
|
46
|
+
it('is false by default', async () => {
|
|
47
|
+
specPage = await setupSpecPageWithLoc({
|
|
48
|
+
components: [Q2Tag],
|
|
49
|
+
html: `<q2-tag></q2-tag>`,
|
|
50
|
+
}, testStringsDict);
|
|
51
|
+
tagClass = specPage.rootInstance;
|
|
52
|
+
expect(tagClass.hoist).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
describe('optionListLabel', () => {
|
|
56
|
+
it('defaults to "options"', async () => {
|
|
57
|
+
specPage = await setupSpecPageWithLoc({
|
|
58
|
+
components: [Q2Tag],
|
|
59
|
+
html: `<q2-tag></q2-tag>`,
|
|
60
|
+
}, testStringsDict);
|
|
61
|
+
tagClass = specPage.rootInstance;
|
|
62
|
+
expect(tagClass.optionListLabel).toBe('options');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
describe('popoverAlignment', () => {
|
|
66
|
+
it('defaults to "right"', async () => {
|
|
67
|
+
specPage = await setupSpecPageWithLoc({
|
|
68
|
+
components: [Q2Tag, Q2Popover],
|
|
69
|
+
html: `<q2-tag></q2-tag>`,
|
|
70
|
+
}, testStringsDict);
|
|
71
|
+
tagClass = specPage.rootInstance;
|
|
72
|
+
expect(tagClass.popoverAlignment).toBe('right');
|
|
73
|
+
});
|
|
74
|
+
it('gets passed to the <q2-popover> when provided', async () => {
|
|
75
|
+
specPage = await setupSpecPageWithLoc({
|
|
76
|
+
components: [Q2Tag, Q2Popover],
|
|
77
|
+
html: `<q2-tag popover-alignment="left"><q2-option></q2-option></q2-tag>`,
|
|
78
|
+
}, testStringsDict);
|
|
79
|
+
tagClass = specPage.rootInstance;
|
|
80
|
+
expect(tagClass.popoverElement.align).toBe('left');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
describe('popoverDirection', () => {
|
|
84
|
+
it('defaults to undefined', async () => {
|
|
85
|
+
specPage = await setupSpecPageWithLoc({
|
|
86
|
+
components: [Q2Tag, Q2Popover],
|
|
87
|
+
html: `<q2-tag></q2-tag>`,
|
|
88
|
+
}, testStringsDict);
|
|
89
|
+
tagClass = specPage.rootInstance;
|
|
90
|
+
expect(tagClass.popoverDirection).toBeUndefined();
|
|
91
|
+
});
|
|
92
|
+
it('gets passed to the <q2-popover> when provided', async () => {
|
|
93
|
+
specPage = await setupSpecPageWithLoc({
|
|
94
|
+
components: [Q2Tag, Q2Popover],
|
|
95
|
+
html: `<q2-tag popover-direction="up"><q2-option></q2-option></q2-tag>`,
|
|
96
|
+
}, testStringsDict);
|
|
97
|
+
tagClass = specPage.rootInstance;
|
|
98
|
+
expect(tagClass.popoverElement.direction).toBe('up');
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
describe('popoverMaxheight', () => {
|
|
102
|
+
it('defaults to undefined', async () => {
|
|
103
|
+
specPage = await setupSpecPageWithLoc({
|
|
104
|
+
components: [Q2Tag, Q2Popover],
|
|
105
|
+
html: `<q2-tag></q2-tag>`,
|
|
106
|
+
}, testStringsDict);
|
|
107
|
+
tagClass = specPage.rootInstance;
|
|
108
|
+
expect(tagClass.popoverMaxheight).toBeUndefined();
|
|
109
|
+
});
|
|
110
|
+
it('gets passed to the <q2-popover> when provided', async () => {
|
|
111
|
+
specPage = await setupSpecPageWithLoc({
|
|
112
|
+
components: [Q2Tag, Q2Popover],
|
|
113
|
+
html: `<q2-tag popover-max-height="400"><q2-option></q2-option></q2-tag>`,
|
|
114
|
+
}, testStringsDict);
|
|
115
|
+
tagClass = specPage.rootInstance;
|
|
116
|
+
expect(tagClass.popoverElement.maxHeight).toBe(400);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
describe('popoverMinHeight', () => {
|
|
120
|
+
it('defaults to undefined', async () => {
|
|
121
|
+
specPage = await setupSpecPageWithLoc({
|
|
122
|
+
components: [Q2Tag, Q2Popover],
|
|
123
|
+
html: `<q2-tag></q2-tag>`,
|
|
124
|
+
}, testStringsDict);
|
|
125
|
+
tagClass = specPage.rootInstance;
|
|
126
|
+
expect(tagClass.popoverMinHeight).toBeUndefined();
|
|
127
|
+
});
|
|
128
|
+
it('gets passed to the <q2-popover> when provided', async () => {
|
|
129
|
+
specPage = await setupSpecPageWithLoc({
|
|
130
|
+
components: [Q2Tag, Q2Popover],
|
|
131
|
+
html: `<q2-tag popover-min-height="200"><q2-option></q2-option></q2-tag>`,
|
|
132
|
+
}, testStringsDict);
|
|
133
|
+
tagClass = specPage.rootInstance;
|
|
134
|
+
expect(tagClass.popoverElement.minHeight).toBe(200);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
describe('theme', () => {
|
|
138
|
+
it('defaults to undefined', async () => {
|
|
139
|
+
specPage = await setupSpecPageWithLoc({
|
|
140
|
+
components: [Q2Tag],
|
|
141
|
+
html: `<q2-tag></q2-tag>`,
|
|
142
|
+
}, testStringsDict);
|
|
143
|
+
tagClass = specPage.rootInstance;
|
|
144
|
+
expect(tagClass.theme).toBeUndefined();
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
describe('Lifecycle Methods', () => {
|
|
149
|
+
describe('componentWillLoad', () => {
|
|
150
|
+
it('fires initMutationObserver', async () => {
|
|
151
|
+
specPage = await setupSpecPageWithLoc({
|
|
152
|
+
components: [Q2Tag],
|
|
153
|
+
html: `<q2-tag></q2-tag>`,
|
|
154
|
+
}, testStringsDict);
|
|
155
|
+
tagClass = specPage.rootInstance;
|
|
156
|
+
spy = jest.spyOn(tagClass, 'initMutationObserver');
|
|
157
|
+
tagClass.componentWillLoad();
|
|
158
|
+
expect(spy).toHaveBeenCalled();
|
|
159
|
+
});
|
|
160
|
+
it('fires determineOptionCount', async () => {
|
|
161
|
+
specPage = await setupSpecPageWithLoc({
|
|
162
|
+
components: [Q2Tag],
|
|
163
|
+
html: `<q2-tag></q2-tag>`,
|
|
164
|
+
}, testStringsDict);
|
|
165
|
+
tagClass = specPage.rootInstance;
|
|
166
|
+
spy = jest.spyOn(tagClass, 'determineOptionCount');
|
|
167
|
+
tagClass.componentWillLoad();
|
|
168
|
+
expect(spy).toHaveBeenCalled();
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
describe('componentDidLoad', () => {
|
|
172
|
+
it('fires overrideFocus', async () => {
|
|
173
|
+
specPage = await setupSpecPageWithLoc({
|
|
174
|
+
components: [Q2Tag],
|
|
175
|
+
html: `<q2-tag></q2-tag>`,
|
|
176
|
+
}, testStringsDict);
|
|
177
|
+
expect(overrideFocusMock).toHaveBeenCalled();
|
|
178
|
+
});
|
|
179
|
+
it('fires filterSlottedElements', async () => {
|
|
180
|
+
specPage = await setupSpecPageWithLoc({
|
|
181
|
+
components: [Q2Tag],
|
|
182
|
+
html: `<q2-tag></q2-tag>`,
|
|
183
|
+
}, testStringsDict);
|
|
184
|
+
tagClass = specPage.rootInstance;
|
|
185
|
+
spy = jest.spyOn(tagClass, 'filterSlottedElements');
|
|
186
|
+
tagClass.componentDidLoad();
|
|
187
|
+
expect(spy).toHaveBeenCalled();
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
describe('Methods', () => {
|
|
192
|
+
describe('delegateFocus', () => {
|
|
193
|
+
it('calls focus on the optionList element', async () => {
|
|
194
|
+
specPage = await setupSpecPageWithLoc({
|
|
195
|
+
components: [Q2Tag],
|
|
196
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
197
|
+
}, testStringsDict);
|
|
198
|
+
tagClass = specPage.rootInstance;
|
|
199
|
+
button = tagClass.dropdownBtn;
|
|
200
|
+
spy = jest.spyOn(button, 'focus');
|
|
201
|
+
isEventFromElementMock.mockReturnValue(true);
|
|
202
|
+
tagClass.delegateFocus(new FocusEvent('focus'));
|
|
203
|
+
expect(spy).toHaveBeenCalled();
|
|
204
|
+
});
|
|
205
|
+
it('fails when isEventFromElement is false', async () => {
|
|
206
|
+
specPage = await setupSpecPageWithLoc({
|
|
207
|
+
components: [Q2Tag],
|
|
208
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
209
|
+
}, testStringsDict);
|
|
210
|
+
tagClass = specPage.rootInstance;
|
|
211
|
+
button = tagClass.dropdownBtn;
|
|
212
|
+
spy = jest.spyOn(button, 'focus');
|
|
213
|
+
isEventFromElementMock.mockReturnValue(false);
|
|
214
|
+
tagClass.delegateFocus(new FocusEvent('focus'));
|
|
215
|
+
expect(spy).not.toHaveBeenCalled();
|
|
216
|
+
});
|
|
217
|
+
it('fails when there are no options provided', async () => {
|
|
218
|
+
specPage = await setupSpecPageWithLoc({
|
|
219
|
+
components: [Q2Tag],
|
|
220
|
+
html: `<q2-tag></q2-tag>`,
|
|
221
|
+
}, testStringsDict);
|
|
222
|
+
tagClass = specPage.rootInstance;
|
|
223
|
+
button = tagClass.dropdownBtn;
|
|
224
|
+
expect(button).toBeUndefined();
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
describe('popoverStateHandler', () => {
|
|
228
|
+
it('updates the "open" property with the new state', async () => {
|
|
229
|
+
specPage = await setupSpecPageWithLoc({
|
|
230
|
+
components: [Q2Tag],
|
|
231
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
232
|
+
}, testStringsDict);
|
|
233
|
+
tagClass = specPage.rootInstance;
|
|
234
|
+
expect(tagClass.open).toBeUndefined();
|
|
235
|
+
tagClass.popoverStateHandler({ detail: { open: true } });
|
|
236
|
+
expect(tagClass.open).toBe(true);
|
|
237
|
+
});
|
|
238
|
+
it('does not update the "open" property when the state is unchanged', async () => {
|
|
239
|
+
specPage = await setupSpecPageWithLoc({
|
|
240
|
+
components: [Q2Tag],
|
|
241
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
242
|
+
}, testStringsDict);
|
|
243
|
+
tagClass = specPage.rootInstance;
|
|
244
|
+
tagClass.optionList.setActiveElement = jest.fn();
|
|
245
|
+
expect(tagClass.open).toBeUndefined();
|
|
246
|
+
tagClass.popoverStateHandler({ detail: { open: false } });
|
|
247
|
+
expect(tagClass.open).toBe(false);
|
|
248
|
+
});
|
|
249
|
+
it('calls setActiveElement and sets to "null" when popovers is closed', async () => {
|
|
250
|
+
specPage = await setupSpecPageWithLoc({
|
|
251
|
+
components: [Q2Tag],
|
|
252
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
253
|
+
}, testStringsDict);
|
|
254
|
+
tagClass = specPage.rootInstance;
|
|
255
|
+
tagClass.optionList.setActiveElement = jest.fn();
|
|
256
|
+
tagClass.popoverStateHandler({ detail: { open: false } });
|
|
257
|
+
expect(tagClass.optionList.setActiveElement).toHaveBeenCalledWith(null);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
describe('Public Methods API', () => {
|
|
262
|
+
describe('closePopover', () => {
|
|
263
|
+
it('calls _togglePopover when open and provided options', async () => {
|
|
264
|
+
specPage = await setupSpecPageWithLoc({
|
|
265
|
+
components: [Q2Tag],
|
|
266
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
267
|
+
}, testStringsDict);
|
|
268
|
+
tagClass = specPage.rootInstance;
|
|
269
|
+
tagClass.open = true;
|
|
270
|
+
tagClass._togglePopover = jest.fn();
|
|
271
|
+
await tagClass.closePopover();
|
|
272
|
+
expect(tagClass._togglePopover).toHaveBeenCalled();
|
|
273
|
+
});
|
|
274
|
+
it('does not call _togglePopover when open', async () => {
|
|
275
|
+
specPage = await setupSpecPageWithLoc({
|
|
276
|
+
components: [Q2Tag],
|
|
277
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
278
|
+
}, testStringsDict);
|
|
279
|
+
tagClass = specPage.rootInstance;
|
|
280
|
+
tagClass._togglePopover = jest.fn();
|
|
281
|
+
await tagClass.closePopover();
|
|
282
|
+
expect(tagClass._togglePopover).not.toHaveBeenCalled();
|
|
283
|
+
});
|
|
284
|
+
it('does not call _togglePopover when no options provided', async () => {
|
|
285
|
+
specPage = await setupSpecPageWithLoc({
|
|
286
|
+
components: [Q2Tag],
|
|
287
|
+
html: `<q2-tag></q2-tag>`,
|
|
288
|
+
}, testStringsDict);
|
|
289
|
+
tagClass = specPage.rootInstance;
|
|
290
|
+
tagClass._togglePopover = jest.fn();
|
|
291
|
+
await tagClass.closePopover();
|
|
292
|
+
expect(tagClass._togglePopover).not.toHaveBeenCalled();
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
describe('openPopover', () => {
|
|
296
|
+
it('calls _togglePopover when not open and provided options', async () => {
|
|
297
|
+
specPage = await setupSpecPageWithLoc({
|
|
298
|
+
components: [Q2Tag],
|
|
299
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
300
|
+
}, testStringsDict);
|
|
301
|
+
tagClass = specPage.rootInstance;
|
|
302
|
+
tagClass._togglePopover = jest.fn();
|
|
303
|
+
await tagClass.openPopover();
|
|
304
|
+
expect(tagClass._togglePopover).toHaveBeenCalled();
|
|
305
|
+
});
|
|
306
|
+
it('does not call _togglePopover when open', async () => {
|
|
307
|
+
specPage = await setupSpecPageWithLoc({
|
|
308
|
+
components: [Q2Tag],
|
|
309
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
310
|
+
}, testStringsDict);
|
|
311
|
+
tagClass = specPage.rootInstance;
|
|
312
|
+
tagClass.open = true;
|
|
313
|
+
tagClass._togglePopover = jest.fn();
|
|
314
|
+
await tagClass.openPopover();
|
|
315
|
+
expect(tagClass._togglePopover).not.toHaveBeenCalled();
|
|
316
|
+
});
|
|
317
|
+
it('does not call _togglePopover when no options provided', async () => {
|
|
318
|
+
specPage = await setupSpecPageWithLoc({
|
|
319
|
+
components: [Q2Tag],
|
|
320
|
+
html: `<q2-tag></q2-tag>`,
|
|
321
|
+
}, testStringsDict);
|
|
322
|
+
tagClass = specPage.rootInstance;
|
|
323
|
+
tagClass._togglePopover = jest.fn();
|
|
324
|
+
await tagClass.openPopover();
|
|
325
|
+
expect(tagClass._togglePopover).not.toHaveBeenCalled();
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
describe('selectOption', () => {
|
|
329
|
+
beforeEach(async () => {
|
|
330
|
+
specPage = await setupSpecPageWithLoc({
|
|
331
|
+
components: [Q2Tag],
|
|
332
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
333
|
+
}, testStringsDict);
|
|
334
|
+
tagClass = specPage.rootInstance;
|
|
335
|
+
option = specPage.root.querySelector('q2-option');
|
|
336
|
+
tagClass.openPopover = jest.fn();
|
|
337
|
+
tagClass.optionList.getOptions = jest.fn();
|
|
338
|
+
tagClass.optionList.getOptions.mockReturnValue([option]);
|
|
339
|
+
});
|
|
340
|
+
it('calls openPopover', async () => {
|
|
341
|
+
await tagClass.selectOption();
|
|
342
|
+
expect(tagClass.openPopover).toHaveBeenCalled();
|
|
343
|
+
});
|
|
344
|
+
it('calls getOptions', async () => {
|
|
345
|
+
await tagClass.selectOption();
|
|
346
|
+
expect(tagClass.optionList.getOptions).toHaveBeenCalled();
|
|
347
|
+
});
|
|
348
|
+
it('calls "click" on the option element', async () => {
|
|
349
|
+
spy = jest.spyOn(option, 'click');
|
|
350
|
+
await tagClass.selectOption();
|
|
351
|
+
expect(spy).toHaveBeenCalled();
|
|
352
|
+
});
|
|
353
|
+
it('does nothing if no options are provided', async () => {
|
|
354
|
+
tagClass.optionCount = 0;
|
|
355
|
+
await tagClass.selectOption();
|
|
356
|
+
expect(tagClass.openPopover).not.toHaveBeenCalled();
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
describe('Local Methods', () => {
|
|
361
|
+
describe('onMutationObserved', () => {
|
|
362
|
+
it('calls determineOptionCount', async () => {
|
|
363
|
+
specPage = await setupSpecPageWithLoc({
|
|
364
|
+
components: [Q2Tag],
|
|
365
|
+
html: `<q2-tag></q2-tag>`,
|
|
366
|
+
}, testStringsDict);
|
|
367
|
+
tagClass = specPage.rootInstance;
|
|
368
|
+
spy = jest.spyOn(tagClass, 'determineOptionCount');
|
|
369
|
+
tagClass.onMutationObserved();
|
|
370
|
+
expect(spy).toHaveBeenCalled();
|
|
371
|
+
});
|
|
372
|
+
it('calls filterSlottedElements', async () => {
|
|
373
|
+
specPage = await setupSpecPageWithLoc({
|
|
374
|
+
components: [Q2Tag],
|
|
375
|
+
html: `<q2-tag></q2-tag>`,
|
|
376
|
+
}, testStringsDict);
|
|
377
|
+
tagClass = specPage.rootInstance;
|
|
378
|
+
spy = jest.spyOn(tagClass, 'filterSlottedElements');
|
|
379
|
+
tagClass.onMutationObserved();
|
|
380
|
+
expect(spy).toHaveBeenCalled();
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
describe('_togglePopover', () => {
|
|
384
|
+
beforeEach(async () => {
|
|
385
|
+
specPage = await setupSpecPageWithLoc({
|
|
386
|
+
components: [Q2Tag],
|
|
387
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
388
|
+
}, testStringsDict);
|
|
389
|
+
tagClass = specPage.rootInstance;
|
|
390
|
+
tagElement = specPage.root;
|
|
391
|
+
button = tagClass.dropdownBtn;
|
|
392
|
+
tagClass.handleClick = jest.fn();
|
|
393
|
+
tagClass.popoverElement.toggle = jest.fn();
|
|
394
|
+
});
|
|
395
|
+
it('clicks the dropdown button', async () => {
|
|
396
|
+
spy = jest.spyOn(button, 'click');
|
|
397
|
+
tagClass._togglePopover();
|
|
398
|
+
expect(spy).toHaveBeenCalled();
|
|
399
|
+
});
|
|
400
|
+
it('calls focus() on the dropdown button', async () => {
|
|
401
|
+
spy = jest.spyOn(button, 'focus');
|
|
402
|
+
tagClass._togglePopover();
|
|
403
|
+
expect(spy).toHaveBeenCalled();
|
|
404
|
+
});
|
|
405
|
+
it('dispatches a FocusEvent on the button', async () => {
|
|
406
|
+
spy = jest.spyOn(button, 'dispatchEvent');
|
|
407
|
+
tagClass._togglePopover();
|
|
408
|
+
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ type: 'focus' }));
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
describe('determineOptionCount', () => {
|
|
412
|
+
it('sets optionCount to the number of q2-options found', async () => {
|
|
413
|
+
specPage = await setupSpecPageWithLoc({
|
|
414
|
+
components: [Q2Tag],
|
|
415
|
+
html: `<q2-tag><q2-option></q2-option><q2-option></q2-option></q2-tag>`,
|
|
416
|
+
}, testStringsDict);
|
|
417
|
+
tagClass = specPage.rootInstance;
|
|
418
|
+
tagClass.optionCount = 0;
|
|
419
|
+
expect(tagClass.optionCount).toBe(0);
|
|
420
|
+
tagClass.determineOptionCount();
|
|
421
|
+
expect(tagClass.optionCount).toBe(2);
|
|
422
|
+
});
|
|
423
|
+
});
|
|
424
|
+
describe('handleButtonFocusout', () => {
|
|
425
|
+
it('sets open to false', async () => {
|
|
426
|
+
specPage = await setupSpecPageWithLoc({
|
|
427
|
+
components: [Q2Tag],
|
|
428
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
429
|
+
}, testStringsDict);
|
|
430
|
+
tagClass = specPage.rootInstance;
|
|
431
|
+
tagClass.open = true;
|
|
432
|
+
tagClass.handleButtonFocusout(new FocusEvent('focusout'));
|
|
433
|
+
expect(tagClass.open).toBe(false);
|
|
434
|
+
});
|
|
435
|
+
it('does not set open to false when the event is from the popover', async () => {
|
|
436
|
+
specPage = await setupSpecPageWithLoc({
|
|
437
|
+
components: [Q2Tag],
|
|
438
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
439
|
+
}, testStringsDict);
|
|
440
|
+
tagClass = specPage.rootInstance;
|
|
441
|
+
tagClass.open = true;
|
|
442
|
+
tagClass.handleButtonFocusout(new FocusEvent('focusout', { relatedTarget: tagClass.popoverElement }));
|
|
443
|
+
expect(tagClass.open).toBe(true);
|
|
444
|
+
});
|
|
445
|
+
it('does not set open to false when the event is from the an option', async () => {
|
|
446
|
+
specPage = await setupSpecPageWithLoc({
|
|
447
|
+
components: [Q2Tag],
|
|
448
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
449
|
+
}, testStringsDict);
|
|
450
|
+
tagClass = specPage.rootInstance;
|
|
451
|
+
tagClass.open = true;
|
|
452
|
+
option = specPage.root.querySelector('q2-option');
|
|
453
|
+
tagClass.handleButtonFocusout(new FocusEvent('focusout', { relatedTarget: option }));
|
|
454
|
+
expect(tagClass.open).toBe(true);
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
describe('handleChange', () => {
|
|
458
|
+
it('emits a click event', async () => {
|
|
459
|
+
specPage = await setupSpecPageWithLoc({
|
|
460
|
+
components: [Q2Tag],
|
|
461
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
462
|
+
}, testStringsDict);
|
|
463
|
+
tagClass = specPage.rootInstance;
|
|
464
|
+
event = new CustomEvent('click', { detail: { value: 'foo' } });
|
|
465
|
+
spy = jest.spyOn(tagClass.click, 'emit');
|
|
466
|
+
tagClass.handleChange(event);
|
|
467
|
+
expect(spy).toHaveBeenCalled();
|
|
468
|
+
expect(spy).toHaveBeenCalledWith({ value: 'foo' });
|
|
469
|
+
});
|
|
470
|
+
it('calls stopPropagation', async () => {
|
|
471
|
+
specPage = await setupSpecPageWithLoc({
|
|
472
|
+
components: [Q2Tag],
|
|
473
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
474
|
+
}, testStringsDict);
|
|
475
|
+
tagClass = specPage.rootInstance;
|
|
476
|
+
event = new CustomEvent('click', { detail: { value: 'foo' } });
|
|
477
|
+
spy = jest.spyOn(event, 'stopPropagation');
|
|
478
|
+
tagClass.handleChange(event);
|
|
479
|
+
expect(spy).toHaveBeenCalled();
|
|
480
|
+
});
|
|
481
|
+
});
|
|
482
|
+
describe('handleClick', () => {
|
|
483
|
+
beforeEach(async () => {
|
|
484
|
+
specPage = await setupSpecPageWithLoc({
|
|
485
|
+
components: [Q2Tag],
|
|
486
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
487
|
+
}, testStringsDict);
|
|
488
|
+
tagClass = specPage.rootInstance;
|
|
489
|
+
shouldShowActionSheetMock.mockReturnValue(true);
|
|
490
|
+
showActionSheetListMock.mockReturnValue({ value: 'foo' });
|
|
491
|
+
tagClass.popoverElement.toggle = jest.fn();
|
|
492
|
+
event = new CustomEvent('click', { detail: { value: 'foo' } });
|
|
493
|
+
});
|
|
494
|
+
it('calls stopPropagation', async () => {
|
|
495
|
+
const stopSpy = jest.spyOn(event, 'stopPropagation');
|
|
496
|
+
await tagClass.handleClick(event);
|
|
497
|
+
expect(stopSpy).toHaveBeenCalled();
|
|
498
|
+
});
|
|
499
|
+
it('assigns popover controlElement to dropdownBtn', async () => {
|
|
500
|
+
tagClass.popoverElement.controlElement = null;
|
|
501
|
+
await tagClass.handleClick(event);
|
|
502
|
+
expect(tagClass.popoverElement.controlElement).toBe(tagClass.dropdownBtn);
|
|
503
|
+
});
|
|
504
|
+
it('calls shouldShowActionSheet with "this"', async () => {
|
|
505
|
+
await tagClass.handleClick(event);
|
|
506
|
+
expect(shouldShowActionSheetMock).toHaveBeenCalledWith(tagClass);
|
|
507
|
+
});
|
|
508
|
+
describe('when shouldShowActionSheet is true', () => {
|
|
509
|
+
it('calls showActionSheetList with "this" and "event', async () => {
|
|
510
|
+
await tagClass.handleClick(event);
|
|
511
|
+
expect(showActionSheetListMock).toHaveBeenCalledWith(tagClass, event);
|
|
512
|
+
});
|
|
513
|
+
it('emits a click event with the value from showActionSheetList', async () => {
|
|
514
|
+
const clickSpy = jest.spyOn(tagClass.click, 'emit');
|
|
515
|
+
await tagClass.handleClick(event);
|
|
516
|
+
expect(clickSpy).toHaveBeenCalledWith({ value: 'foo' });
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
describe('when shouldShowActionSheet is false', () => {
|
|
520
|
+
it('toggles the popover element', async () => {
|
|
521
|
+
shouldShowActionSheetMock.mockReturnValue(false);
|
|
522
|
+
const toggleSpy = jest.spyOn(tagClass.popoverElement, 'toggle');
|
|
523
|
+
await tagClass.handleClick(event);
|
|
524
|
+
expect(toggleSpy).toHaveBeenCalled();
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
});
|
|
528
|
+
describe('handleKeydown', () => {
|
|
529
|
+
beforeEach(async () => {
|
|
530
|
+
specPage = await setupSpecPageWithLoc({
|
|
531
|
+
components: [Q2Tag],
|
|
532
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
533
|
+
}, testStringsDict);
|
|
534
|
+
tagClass = specPage.rootInstance;
|
|
535
|
+
showActionSheetListMock.mockReturnValue({ value: 'foo' });
|
|
536
|
+
tagClass.open = true;
|
|
537
|
+
tagClass.optionList.handleExternalKeydown = jest.fn();
|
|
538
|
+
event = new KeyboardEvent('keydown', { key: 'Enter' });
|
|
539
|
+
});
|
|
540
|
+
it('calls preventDefault', async () => {
|
|
541
|
+
const preventSpy = jest.spyOn(event, 'preventDefault');
|
|
542
|
+
tagClass.handleKeydown(event);
|
|
543
|
+
expect(preventSpy).toHaveBeenCalled();
|
|
544
|
+
});
|
|
545
|
+
it('assigns popover controlElement to dropdownBtn', async () => {
|
|
546
|
+
tagClass.popoverElement.controlElement = null;
|
|
547
|
+
await tagClass.handleKeydown(event);
|
|
548
|
+
expect(tagClass.popoverElement.controlElement).toBe(tagClass.dropdownBtn);
|
|
549
|
+
});
|
|
550
|
+
describe('when shouldShowActionSheet is true', () => {
|
|
551
|
+
it('calls showActionSheetList with "this" and "event"', async () => {
|
|
552
|
+
shouldShowActionSheetMock.mockReturnValue(true);
|
|
553
|
+
await tagClass.handleKeydown(event);
|
|
554
|
+
expect(showActionSheetListMock).toHaveBeenCalledWith(tagClass, event);
|
|
555
|
+
});
|
|
556
|
+
it('calls focus() on the dropdown button', async () => {
|
|
557
|
+
shouldShowActionSheetMock.mockReturnValue(true);
|
|
558
|
+
spy = jest.spyOn(tagClass.dropdownBtn, 'focus');
|
|
559
|
+
await tagClass.handleKeydown(event);
|
|
560
|
+
expect(spy).toHaveBeenCalled();
|
|
561
|
+
});
|
|
562
|
+
it('emits a click event with the value from showActionSheetList', async () => {
|
|
563
|
+
shouldShowActionSheetMock.mockReturnValue(true);
|
|
564
|
+
spy = jest.spyOn(tagClass.click, 'emit');
|
|
565
|
+
await tagClass.handleKeydown(event);
|
|
566
|
+
expect(spy).toHaveBeenCalledWith({ value: 'foo' });
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
describe('when shouldShowActionSheet is false', () => {
|
|
570
|
+
it('calls optionList.handleExternalKeydown with the event', async () => {
|
|
571
|
+
shouldShowActionSheetMock.mockReturnValue(false);
|
|
572
|
+
await tagClass.handleKeydown(event);
|
|
573
|
+
expect(tagClass.optionList.handleExternalKeydown).toHaveBeenCalledWith(event);
|
|
574
|
+
});
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
describe('handleWrapperClick', () => {
|
|
578
|
+
beforeEach(async () => {
|
|
579
|
+
specPage = await setupSpecPageWithLoc({
|
|
580
|
+
components: [Q2Tag],
|
|
581
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
582
|
+
}, testStringsDict);
|
|
583
|
+
tagClass = specPage.rootInstance;
|
|
584
|
+
tagClass.handleClick = jest.fn();
|
|
585
|
+
tagClass.popoverElement.toggle = jest.fn();
|
|
586
|
+
button = tagClass.dropdownBtn;
|
|
587
|
+
});
|
|
588
|
+
it('calls focus() on the dropdown button', async () => {
|
|
589
|
+
spy = jest.spyOn(button, 'focus');
|
|
590
|
+
tagClass.handleWrapperClick();
|
|
591
|
+
expect(spy).toHaveBeenCalled();
|
|
592
|
+
});
|
|
593
|
+
it('calls click() on the dropdown button', async () => {
|
|
594
|
+
spy = jest.spyOn(button, 'click');
|
|
595
|
+
tagClass.handleWrapperClick();
|
|
596
|
+
expect(spy).toHaveBeenCalled();
|
|
597
|
+
});
|
|
598
|
+
});
|
|
599
|
+
describe('onClickElsewhere', () => {
|
|
600
|
+
describe('when the target is click-elsewhere', () => {
|
|
601
|
+
beforeEach(async () => {
|
|
602
|
+
specPage = await setupSpecPageWithLoc({
|
|
603
|
+
components: [Q2Tag],
|
|
604
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
605
|
+
}, testStringsDict);
|
|
606
|
+
tagClass = specPage.rootInstance;
|
|
607
|
+
event = new CustomEvent('click');
|
|
608
|
+
event.target = { localName: 'click-elsewhere' };
|
|
609
|
+
});
|
|
610
|
+
it('calls stopPropagation', async () => {
|
|
611
|
+
spy = jest.spyOn(event, 'stopPropagation');
|
|
612
|
+
tagClass.onClickElsewhere(event);
|
|
613
|
+
expect(spy).toHaveBeenCalled();
|
|
614
|
+
});
|
|
615
|
+
it('sets popoverElement "open" prop to false when element is present', async () => {
|
|
616
|
+
tagClass.open = true;
|
|
617
|
+
tagClass.popoverElement = { open: true };
|
|
618
|
+
tagClass.onClickElsewhere(event);
|
|
619
|
+
expect(tagClass.popoverElement.open).toBe(false);
|
|
620
|
+
});
|
|
621
|
+
it('does not change popoverElement "open" prop when element is not present', async () => {
|
|
622
|
+
specPage = await setupSpecPageWithLoc({
|
|
623
|
+
components: [Q2Tag],
|
|
624
|
+
html: `<q2-tag></q2-tag>`,
|
|
625
|
+
}, testStringsDict);
|
|
626
|
+
tagClass = specPage.rootInstance;
|
|
627
|
+
event = new CustomEvent('click');
|
|
628
|
+
event.target = { localName: 'click-elsewhere' };
|
|
629
|
+
tagClass.onClickElsewhere(event);
|
|
630
|
+
expect(tagClass.popoverElement).toBeUndefined();
|
|
631
|
+
});
|
|
632
|
+
});
|
|
633
|
+
describe('when the target is not click-elsewhere', () => {
|
|
634
|
+
it('does nothing', async () => {
|
|
635
|
+
event.target = { localName: 'not-click-elsewhere' };
|
|
636
|
+
spy = jest.spyOn(event, 'stopPropagation');
|
|
637
|
+
tagClass.onClickElsewhere(event);
|
|
638
|
+
expect(spy).not.toHaveBeenCalled();
|
|
639
|
+
});
|
|
640
|
+
});
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
describe('Render Methods', () => {
|
|
644
|
+
describe('renderHiddenElement', () => {
|
|
645
|
+
it('fires when options are provided', async () => {
|
|
646
|
+
specPage = await setupSpecPageWithLoc({
|
|
647
|
+
components: [Q2Tag],
|
|
648
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
649
|
+
}, testStringsDict);
|
|
650
|
+
tagClass = specPage.rootInstance;
|
|
651
|
+
expect(tagClass.optionCount).toBeGreaterThan(0);
|
|
652
|
+
spy = jest.spyOn(tagClass, 'renderHiddenElement');
|
|
653
|
+
tagClass.render();
|
|
654
|
+
expect(spy).toHaveBeenCalled();
|
|
655
|
+
});
|
|
656
|
+
it('does not fire when no options are provided', async () => {
|
|
657
|
+
specPage = await setupSpecPageWithLoc({
|
|
658
|
+
components: [Q2Tag],
|
|
659
|
+
html: `<q2-tag></q2-tag>`,
|
|
660
|
+
}, testStringsDict);
|
|
661
|
+
tagClass = specPage.rootInstance;
|
|
662
|
+
expect(tagClass.optionCount).toBe(0);
|
|
663
|
+
spy = jest.spyOn(tagClass, 'renderHiddenElement');
|
|
664
|
+
tagClass.render();
|
|
665
|
+
expect(spy).not.toHaveBeenCalled();
|
|
666
|
+
});
|
|
667
|
+
});
|
|
668
|
+
describe('render', () => {
|
|
669
|
+
describe('when options are NOT provided', () => {
|
|
670
|
+
beforeEach(async () => {
|
|
671
|
+
specPage = await setupSpecPageWithLoc({
|
|
672
|
+
components: [Q2Tag],
|
|
673
|
+
html: `<q2-tag></q2-tag>`,
|
|
674
|
+
}, testStringsDict);
|
|
675
|
+
tagClass = specPage.rootInstance;
|
|
676
|
+
tagElement = specPage.root;
|
|
677
|
+
});
|
|
678
|
+
it('renders the tag-wrapper as a div', async () => {
|
|
679
|
+
const tagWrapper = tagElement.shadowRoot.querySelector('.tag-wrapper');
|
|
680
|
+
expect(tagWrapper.tagName).toBe('DIV');
|
|
681
|
+
});
|
|
682
|
+
it('zero does not render inside the click-elsewhere element', async () => {
|
|
683
|
+
tagClass.label = 'My Tag';
|
|
684
|
+
const clickElsewhere = tagElement.shadowRoot.querySelector('click-elsewhere');
|
|
685
|
+
expect(clickElsewhere.textContent.slice(-1)).not.toBe('0');
|
|
686
|
+
});
|
|
687
|
+
it('does not render button by default', async () => {
|
|
688
|
+
specPage = await setupSpecPageWithLoc({
|
|
689
|
+
components: [Q2Tag],
|
|
690
|
+
html: `<q2-tag></q2-tag>`,
|
|
691
|
+
}, testStringsDict);
|
|
692
|
+
tagClass = specPage.rootInstance;
|
|
693
|
+
expect(tagClass.dropdownBtn).toBeUndefined();
|
|
694
|
+
});
|
|
695
|
+
it('does not render the option list by default', async () => {
|
|
696
|
+
specPage = await setupSpecPageWithLoc({
|
|
697
|
+
components: [Q2Tag],
|
|
698
|
+
html: `<q2-tag></q2-tag>`,
|
|
699
|
+
}, testStringsDict);
|
|
700
|
+
tagClass = specPage.rootInstance;
|
|
701
|
+
expect(tagClass.optionList).toBeUndefined();
|
|
702
|
+
});
|
|
703
|
+
});
|
|
704
|
+
describe('when options are provided', () => {
|
|
705
|
+
it('renders the tag-wrapper as a button', async () => {
|
|
706
|
+
specPage = await setupSpecPageWithLoc({
|
|
707
|
+
components: [Q2Tag],
|
|
708
|
+
html: `<q2-tag><q2-option></q2-option></q2-tag>`,
|
|
709
|
+
}, testStringsDict);
|
|
710
|
+
tagClass = specPage.rootInstance;
|
|
711
|
+
tagElement = specPage.root;
|
|
712
|
+
const tagWrapper = tagElement.shadowRoot.querySelector('.tag-wrapper');
|
|
713
|
+
expect(tagWrapper.tagName).toBe('BUTTON');
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
//# sourceMappingURL=q2-tag-test.spec.js.map
|