q2-tecton-elements 1.72.0 → 1.73.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 +39545 -34361
- package/dist/cjs/{charting-ClN1ldqv.js → charting-CdNTrVBe.js} +80 -0
- package/dist/cjs/click-elsewhere_3.cjs.entry.js +81 -14
- package/dist/cjs/{dataSample-BYR-wrOn.js → dataSample-B4blhlH4.js} +1 -1
- package/dist/cjs/date-picker-helpers-UYvPn98R.js +257 -0
- package/dist/cjs/{index-BY3aao8R.js → index-BqyWHpNu.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +98 -18
- package/dist/cjs/q2-avatar.cjs.entry.js +34 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +3 -3
- package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-calendar.cjs.entry.js +9 -4
- package/dist/cjs/q2-card-image.cjs.entry.js +3 -3
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
- package/dist/cjs/q2-carousel.cjs.entry.js +20 -6
- package/dist/cjs/q2-chart-area.cjs.entry.js +38 -7
- package/dist/cjs/q2-chart-bar.cjs.entry.js +39 -8
- package/dist/cjs/q2-chart-donut.cjs.entry.js +31 -13
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox_2.cjs.entry.js +8 -5
- package/dist/cjs/q2-context.cjs.entry.js +4 -4
- package/dist/cjs/q2-currency.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +7 -7
- package/dist/cjs/q2-date-calendar.cjs.entry.js +452 -0
- package/dist/cjs/q2-date-picker_2.cjs.entry.js +968 -0
- 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 +3 -3
- package/dist/cjs/q2-editable-field.cjs.entry.js +20 -7
- package/dist/cjs/q2-example.cjs.entry.js +1 -1
- package/dist/cjs/q2-file-picker.cjs.entry.js +2 -2
- package/dist/cjs/q2-form.cjs.entry.js +1 -1
- package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +20 -2
- package/dist/cjs/q2-legend.cjs.entry.js +1 -1
- package/dist/cjs/q2-link_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +3 -3
- package/dist/cjs/q2-meter.cjs.entry.js +2 -2
- package/dist/cjs/q2-modal.cjs.entry.js +2 -2
- package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
- package/dist/cjs/q2-mutation-observer.cjs.entry.js +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +1 -1
- package/dist/cjs/q2-otp.cjs.entry.js +5 -5
- package/dist/cjs/q2-pagination.cjs.entry.js +12 -6
- package/dist/cjs/q2-pill.cjs.entry.js +8 -5
- package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio.cjs.entry.js +2 -2
- package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
- package/dist/cjs/q2-resize-observer.cjs.entry.js +1 -1
- package/dist/cjs/q2-search.cjs.entry.js +3 -3
- package/dist/cjs/q2-section.cjs.entry.js +3 -3
- package/dist/cjs/q2-select.cjs.entry.js +8 -4
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
- package/dist/cjs/q2-surface.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
- package/dist/cjs/q2-toast.cjs.entry.js +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/{sectorHelper-9TWL-3dw.js → sectorHelper-CxhDl5ql.js} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.css +52 -0
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +98 -18
- package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.vr.js +124 -0
- package/dist/collection/components/q2-avatar/q2-avatar.js +34 -1
- package/dist/collection/components/q2-avatar/test/q2-avatar-test.vr.js +79 -4
- package/dist/collection/components/q2-btn/q2-btn.css +84 -136
- package/dist/collection/components/q2-btn/q2-btn.js +10 -4
- package/dist/collection/components/q2-btn/test/q2-btn-test.vr.js +99 -43
- package/dist/collection/components/q2-calendar/q2-calendar.js +16 -5
- package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.vr.js +3 -13
- package/dist/collection/components/q2-card-image/q2-card-image.js +2 -2
- package/dist/collection/components/q2-carousel/q2-carousel.js +19 -5
- package/dist/collection/components/q2-carousel/test/q2-carousel-test.vr.js +32 -0
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
- package/dist/collection/components/q2-chart-area/q2-chart-area.css +11 -0
- package/dist/collection/components/q2-chart-area/q2-chart-area.js +53 -7
- package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.vr.js +14 -0
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.css +11 -0
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +50 -4
- package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.vr.js +14 -0
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +30 -10
- package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.vr.js +25 -0
- package/dist/collection/components/q2-checkbox/q2-checkbox.js +6 -3
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +6 -3
- package/dist/collection/components/q2-context/q2-context.js +3 -3
- package/dist/collection/components/q2-context/test/q2-context-test.vr.js +3 -3
- package/dist/collection/components/q2-currency/q2-currency.js +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.css +3 -0
- package/dist/collection/components/q2-data-table/q2-data-table.js +5 -5
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.vr.js +47 -0
- package/dist/collection/components/q2-date-calendar/q2-date-calendar.css +393 -0
- package/dist/collection/components/q2-date-calendar/q2-date-calendar.js +1022 -0
- package/dist/collection/components/q2-date-calendar/test/q2-date-calendar-test.vr.js +111 -0
- package/dist/collection/components/q2-date-picker/q2-date-picker.css +138 -0
- package/dist/collection/components/q2-date-picker/q2-date-picker.js +2010 -0
- package/dist/collection/components/q2-date-picker/test/q2-date-picker-test.vr.js +179 -0
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +5 -5
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +27 -8
- package/dist/collection/components/q2-example/q2-example.js +1 -1
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +1 -1
- package/dist/collection/components/q2-form/q2-form.js +1 -1
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
- package/dist/collection/components/q2-input/formatting/phone-number-formats.js +1 -1
- package/dist/collection/components/q2-input/q2-input.js +6 -3
- package/dist/collection/components/q2-item/q2-item.js +19 -1
- package/dist/collection/components/q2-item/test/q2-item-test.vr.js +2 -2
- package/dist/collection/components/q2-legend/q2-legend.js +1 -1
- package/dist/collection/components/q2-list/q2-list.js +1 -1
- package/dist/collection/components/q2-message/q2-message.css +1 -1
- package/dist/collection/components/q2-message/q2-message.js +1 -1
- package/dist/collection/components/q2-message/test/q2-message-test.vr.js +11 -2
- package/dist/collection/components/q2-meter/q2-meter.js +1 -1
- package/dist/collection/components/q2-modal/q2-modal.js +1 -1
- package/dist/collection/components/q2-modal/test/q2-modal-test.vr.js +7 -7
- package/dist/collection/components/q2-mutation-observer/q2-mutation-observer.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
- package/dist/collection/components/q2-option-list/q2-option-list.js +36 -4
- package/dist/collection/components/q2-otp/q2-otp.js +4 -4
- package/dist/collection/components/q2-pagination/q2-pagination.css +17 -0
- package/dist/collection/components/q2-pagination/q2-pagination.js +10 -4
- package/dist/collection/components/q2-pagination/test/q2-pagination-test.vr.js +39 -0
- package/dist/collection/components/q2-pill/q2-pill.css +14 -10
- package/dist/collection/components/q2-pill/q2-pill.js +6 -3
- package/dist/collection/components/q2-pill/test/q2-pill-test.vr.js +25 -0
- package/dist/collection/components/q2-popover/q2-popover.css +1 -0
- package/dist/collection/components/q2-popover/q2-popover.js +43 -8
- package/dist/collection/components/q2-radio/q2-radio.js +5 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +6 -3
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
- package/dist/collection/components/q2-search/q2-search.js +6 -3
- package/dist/collection/components/q2-section/q2-section.js +2 -2
- package/dist/collection/components/q2-select/q2-select.js +12 -5
- package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
- package/dist/collection/components/q2-surface/q2-surface.js +1 -1
- package/dist/collection/components/q2-surface/test/q2-surface-test.vr.js +2 -2
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +6 -3
- package/dist/collection/components/q2-textarea/q2-textarea.js +6 -3
- package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.vr.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/collection/utils/chart-keyboard.js +76 -0
- package/dist/collection/utils/date-picker/date-picker-helpers.js +239 -0
- package/dist/collection/utils/date-picker/date-picker-types.js +1 -0
- package/dist/collection/utils/index.js +1 -1
- package/dist/components/charting.js +1603 -1532
- package/dist/components/dataSample.js +7 -7
- package/dist/components/index.js +57 -53
- package/dist/components/index2.js +2 -2
- package/dist/components/q2-action-sheet.js +224 -103
- package/dist/components/q2-avatar2.js +41 -27
- package/dist/components/q2-btn2.js +2 -2
- package/dist/components/q2-calendar.js +6 -3
- package/dist/components/q2-card-image.js +2 -2
- package/dist/components/q2-carousel-pane2.js +3 -3
- package/dist/components/q2-carousel.js +37 -24
- package/dist/components/q2-chart-area.js +415 -369
- package/dist/components/q2-chart-bar.js +193 -148
- package/dist/components/q2-chart-donut.js +185 -158
- package/dist/components/q2-checkbox-group.js +6 -6
- package/dist/components/q2-checkbox2.js +11 -11
- package/dist/components/q2-context.js +20 -20
- package/dist/components/q2-currency.js +9 -9
- package/dist/components/q2-data-table.js +111 -111
- package/dist/components/q2-date-calendar.d.ts +11 -0
- package/dist/components/q2-date-calendar.js +5 -0
- package/dist/components/q2-date-calendar2.js +678 -0
- package/dist/components/q2-date-picker.d.ts +11 -0
- package/dist/components/q2-date-picker.js +5 -0
- package/dist/components/q2-date-picker2.js +875 -0
- package/dist/components/q2-detail.js +3 -3
- package/dist/components/q2-dropdown.js +17 -17
- package/dist/components/q2-editable-field.js +16 -5
- package/dist/components/q2-example.js +11 -11
- package/dist/components/q2-file-picker.js +1 -1
- package/dist/components/q2-form.js +6 -6
- package/dist/components/q2-formatted-text.js +2 -2
- package/dist/components/q2-input2.js +6 -6
- package/dist/components/q2-item2.js +32 -22
- package/dist/components/q2-legend2.js +7 -7
- package/dist/components/q2-list2.js +6 -6
- package/dist/components/q2-message2.js +10 -10
- package/dist/components/q2-meter.js +7 -7
- package/dist/components/q2-modal.js +22 -22
- package/dist/components/q2-month-picker.js +17 -17
- package/dist/components/q2-mutation-observer.js +1 -1
- package/dist/components/q2-optgroup2.js +7 -7
- package/dist/components/q2-option-list2.js +55 -34
- package/dist/components/q2-otp.js +8 -8
- package/dist/components/q2-pagination.js +70 -68
- package/dist/components/q2-pill.js +51 -46
- package/dist/components/q2-popover2.js +70 -49
- package/dist/components/q2-radio-group.js +7 -7
- package/dist/components/q2-radio.js +6 -6
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +1 -1
- package/dist/components/q2-search.js +5 -5
- package/dist/components/q2-section.js +17 -17
- package/dist/components/q2-select2.js +2 -2
- package/dist/components/q2-stepper-pane.js +29 -29
- package/dist/components/q2-stepper-vertical.js +4 -4
- package/dist/components/q2-stepper.js +57 -57
- package/dist/components/q2-surface.js +3 -3
- package/dist/components/q2-tab-container.js +21 -21
- package/dist/components/q2-tab-pane.js +6 -6
- package/dist/components/q2-tag2.js +8 -6
- package/dist/components/q2-textarea.js +3 -3
- package/dist/components/sectorHelper.js +78 -78
- package/dist/components/tecton-tab-pane.js +10 -10
- package/dist/esm/{charting-DOZct-UB.js → charting-DFXJklqs.js} +79 -1
- package/dist/esm/click-elsewhere_3.entry.js +81 -14
- package/dist/esm/{dataSample-Dm1zpQNi.js → dataSample-CP_VKNqt.js} +1 -1
- package/dist/esm/date-picker-helpers-D8QnN_AS.js +242 -0
- package/dist/esm/{index-DJw6Feh0.js → index-CP8pXJ-l.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-group.entry.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +99 -19
- package/dist/esm/q2-avatar.entry.js +34 -1
- package/dist/esm/q2-badge_2.entry.js +3 -3
- package/dist/esm/q2-btn_2.entry.js +2 -2
- package/dist/esm/q2-calendar.entry.js +9 -4
- package/dist/esm/q2-card-image.entry.js +3 -3
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +3 -3
- package/dist/esm/q2-carousel.entry.js +20 -6
- package/dist/esm/q2-chart-area.entry.js +38 -7
- package/dist/esm/q2-chart-bar.entry.js +39 -8
- package/dist/esm/q2-chart-donut.entry.js +31 -13
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox_2.entry.js +8 -5
- package/dist/esm/q2-context.entry.js +4 -4
- package/dist/esm/q2-currency.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +7 -7
- package/dist/esm/q2-date-calendar.entry.js +450 -0
- package/dist/esm/q2-date-picker_2.entry.js +965 -0
- 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 +3 -3
- package/dist/esm/q2-editable-field.entry.js +20 -7
- package/dist/esm/q2-example.entry.js +1 -1
- package/dist/esm/q2-file-picker.entry.js +2 -2
- package/dist/esm/q2-form.entry.js +1 -1
- package/dist/esm/q2-formatted-text.entry.js +1 -1
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +20 -2
- package/dist/esm/q2-legend.entry.js +1 -1
- package/dist/esm/q2-link_2.entry.js +2 -2
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +3 -3
- package/dist/esm/q2-meter.entry.js +2 -2
- package/dist/esm/q2-modal.entry.js +2 -2
- package/dist/esm/q2-month-picker.entry.js +3 -3
- package/dist/esm/q2-mutation-observer.entry.js +1 -1
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-otp.entry.js +5 -5
- package/dist/esm/q2-pagination.entry.js +12 -6
- package/dist/esm/q2-pill.entry.js +8 -5
- package/dist/esm/q2-radio-group.entry.js +2 -2
- package/dist/esm/q2-radio.entry.js +2 -2
- package/dist/esm/q2-relative-time.entry.js +2 -2
- package/dist/esm/q2-resize-observer.entry.js +1 -1
- package/dist/esm/q2-search.entry.js +3 -3
- package/dist/esm/q2-section.entry.js +3 -3
- package/dist/esm/q2-select.entry.js +8 -4
- package/dist/esm/q2-stepper-pane.entry.js +2 -2
- package/dist/esm/q2-stepper-vertical.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js +2 -2
- package/dist/esm/q2-surface.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js +2 -2
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +2 -2
- package/dist/esm/q2-toast.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/esm/{sectorHelper--RMGWGAy.js → sectorHelper-DBtkWtpl.js} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/{charting-DOZct-UB.js → charting-DFXJklqs.js} +1625 -1554
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +85 -43
- package/dist/q2-tecton-elements/{dataSample-Dm1zpQNi.js → dataSample-CP_VKNqt.js} +33 -33
- package/dist/q2-tecton-elements/date-picker-helpers-D8QnN_AS.js +153 -0
- package/dist/q2-tecton-elements/{index-DJw6Feh0.js → index-CP8pXJ-l.js} +1 -1
- package/dist/q2-tecton-elements/q2-action-group.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +169 -84
- package/dist/q2-tecton-elements/q2-avatar.entry.js +24 -10
- package/dist/q2-tecton-elements/q2-badge_2.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-btn_2.entry.js +23 -23
- package/dist/q2-tecton-elements/q2-calendar.entry.js +7 -4
- package/dist/q2-tecton-elements/q2-card-image.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-carousel.entry.js +24 -11
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +187 -141
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +377 -333
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +184 -158
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +20 -18
- package/dist/q2-tecton-elements/q2-context.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-currency.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-data-table.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-date-calendar.entry.js +438 -0
- package/dist/q2-tecton-elements/q2-date-picker_2.entry.js +792 -0
- package/dist/q2-tecton-elements/q2-detail.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +16 -16
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +17 -6
- package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-form.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-icon.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +26 -16
- package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-link_2.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-message.entry.js +29 -29
- package/dist/q2-tecton-elements/q2-meter.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-modal.entry.js +18 -18
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +14 -14
- package/dist/q2-tecton-elements/q2-mutation-observer.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-otp.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-pagination.entry.js +51 -49
- package/dist/q2-tecton-elements/q2-pill.entry.js +22 -17
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-radio.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +13 -13
- package/dist/q2-tecton-elements/q2-search.entry.js +31 -31
- package/dist/q2-tecton-elements/q2-section.entry.js +20 -20
- package/dist/q2-tecton-elements/q2-select.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +10 -10
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-stepper.entry.js +45 -45
- package/dist/q2-tecton-elements/q2-surface.entry.js +15 -15
- package/dist/q2-tecton-elements/q2-tab-container.entry.js +20 -20
- package/dist/q2-tecton-elements/q2-tab-pane.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-toast.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
- package/dist/q2-tecton-elements/{sectorHelper--RMGWGAy.js → sectorHelper-DBtkWtpl.js} +56 -56
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +9 -9
- package/dist/types/components/q2-action-sheet/q2-action-sheet.d.ts +21 -1
- package/dist/types/components/q2-action-sheet/test/q2-action-sheet-test.vr.d.ts +1 -0
- package/dist/types/components/q2-avatar/q2-avatar.d.ts +5 -0
- package/dist/types/components/q2-btn/q2-btn.d.ts +7 -3
- package/dist/types/components/q2-calendar/q2-calendar.d.ts +10 -2
- package/dist/types/components/q2-carousel/q2-carousel.d.ts +5 -0
- package/dist/types/components/q2-chart-area/q2-chart-area.d.ts +11 -2
- package/dist/types/components/q2-chart-bar/q2-chart-bar.d.ts +9 -0
- package/dist/types/components/q2-chart-donut/q2-chart-donut.d.ts +1 -0
- package/dist/types/components/q2-checkbox/q2-checkbox.d.ts +4 -3
- package/dist/types/components/q2-checkbox-group/q2-checkbox-group.d.ts +4 -2
- package/dist/types/components/q2-date-calendar/q2-date-calendar.d.ts +122 -0
- package/dist/types/components/q2-date-calendar/test/q2-date-calendar-test.vr.d.ts +1 -0
- package/dist/types/components/q2-date-picker/q2-date-picker.d.ts +304 -0
- package/dist/types/components/q2-date-picker/test/q2-date-picker-test.vr.d.ts +1 -0
- package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +3 -3
- package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +14 -1
- package/dist/types/components/q2-input/q2-input.d.ts +4 -2
- package/dist/types/components/q2-item/q2-item.d.ts +3 -0
- package/dist/types/components/q2-option-list/q2-option-list.d.ts +1 -0
- package/dist/types/components/q2-popover/q2-popover.d.ts +4 -0
- package/dist/types/components/q2-radio/q2-radio.d.ts +3 -2
- package/dist/types/components/q2-radio-group/q2-radio-group.d.ts +4 -2
- package/dist/types/components/q2-search/q2-search.d.ts +3 -1
- package/dist/types/components/q2-select/q2-select.d.ts +4 -2
- package/dist/types/components/q2-textarea/q2-textarea.d.ts +4 -2
- package/dist/types/components.d.ts +858 -49
- package/dist/types/global.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/chart-keyboard.d.ts +16 -0
- package/dist/types/utils/date-picker/date-picker-helpers.d.ts +47 -0
- package/dist/types/utils/date-picker/date-picker-types.d.ts +42 -0
- package/package.json +3 -3
- package/dist/cjs/q2-optgroup.cjs.entry.js +0 -70
- package/dist/esm/q2-optgroup.entry.js +0 -68
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +0 -88
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
2
|
import { loc, waitForNextPaint } from "../../utils/index";
|
|
3
3
|
import sanitizeHTMLString, { sanitizeActionSheetSlotHtml } from "../../utils/sanitize-html-string";
|
|
4
4
|
import mirrorEmit from "../../utils/mirror-emit";
|
|
@@ -9,9 +9,13 @@ import mirrorEmit from "../../utils/mirror-emit";
|
|
|
9
9
|
*/
|
|
10
10
|
export class Q2ActionSheet {
|
|
11
11
|
constructor() {
|
|
12
|
+
// #region Own Properties
|
|
13
|
+
this.bodyOverflow = '';
|
|
12
14
|
this.initialSelectedOptions = [];
|
|
13
15
|
this.maxHeight = 0.75;
|
|
14
16
|
this.minHeight = 0.2;
|
|
17
|
+
this.rootOverflow = '';
|
|
18
|
+
this.selectedDate = {};
|
|
15
19
|
this.selectedOptions = { values: [], value: '' };
|
|
16
20
|
// #endregion
|
|
17
21
|
// #region State Properties
|
|
@@ -168,6 +172,26 @@ export class Q2ActionSheet {
|
|
|
168
172
|
return;
|
|
169
173
|
this.onCancel(event);
|
|
170
174
|
};
|
|
175
|
+
this.onDatePickerCancel = (event) => {
|
|
176
|
+
event.stopPropagation();
|
|
177
|
+
this.onCancel(event);
|
|
178
|
+
};
|
|
179
|
+
this.onDatePickerChange = (event) => {
|
|
180
|
+
event.stopPropagation();
|
|
181
|
+
this.selectedDate = event.detail;
|
|
182
|
+
};
|
|
183
|
+
this.onDatePickerClose = (event) => {
|
|
184
|
+
event.stopPropagation();
|
|
185
|
+
const detail = event.detail || undefined;
|
|
186
|
+
if (detail === null || detail === void 0 ? void 0 : detail.error) {
|
|
187
|
+
this.hide({ error: detail.error, type: 'confirm' });
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const hasSelection = this.selectedDate.value !== undefined ||
|
|
191
|
+
this.selectedDate.rangeStart !== undefined ||
|
|
192
|
+
this.selectedDate.rangeEnd !== undefined;
|
|
193
|
+
this.hide({ ...this.selectedDate, type: hasSelection ? 'confirm' : 'cancel' });
|
|
194
|
+
};
|
|
171
195
|
this.onListChange = (event) => {
|
|
172
196
|
this.selectedOptions = event.detail;
|
|
173
197
|
};
|
|
@@ -187,16 +211,47 @@ export class Q2ActionSheet {
|
|
|
187
211
|
this.onListDone();
|
|
188
212
|
}
|
|
189
213
|
};
|
|
214
|
+
this.onViewportResize = () => {
|
|
215
|
+
requestAnimationFrame(() => this.updateDialogMinMaxHeight());
|
|
216
|
+
};
|
|
190
217
|
// #endregion
|
|
191
218
|
// #region Render Methods
|
|
219
|
+
this.renderDatePicker = ({ data }) => {
|
|
220
|
+
const props = data.datePickerProps;
|
|
221
|
+
return (h("div", { class: "content date-picker-content", ref: el => (this.contentElement = el) }, h("q2-date-picker", { _actionSheet: true, open: true, calendarLabel: props.calendarLabel, closeDelay: props.closeDelay, cutoffTime: props.cutoffTime, daysOfWeekChecksum: props.daysOfWeekChecksum, disclaimer: props.disclaimer, endDate: props.endDate, displayFormat: props.displayFormat, invalidDates: props.invalidDates, locale: props.locale, mode: props.mode, rangeEnd: props.rangeEnd, rangeStart: props.rangeStart, startDate: props.startDate, validDates: props.validDates, value: props.value, onTctCancel: this.onDatePickerCancel, onTctChange: this.onDatePickerChange, onTctClose: this.onDatePickerClose })));
|
|
222
|
+
};
|
|
192
223
|
this.renderList = ({ data }) => {
|
|
193
224
|
var _a;
|
|
194
225
|
const { listProps, slotsHtml = [] } = data;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
226
|
+
let scrollTopSlots = false;
|
|
227
|
+
const slots = slotsHtml.map(entry => {
|
|
228
|
+
var _a;
|
|
229
|
+
const html = sanitizeActionSheetSlotHtml(entry.html);
|
|
230
|
+
const container = document.createElement('div');
|
|
231
|
+
container.innerHTML = html;
|
|
232
|
+
const marked = ((_a = container.firstElementChild) === null || _a === void 0 ? void 0 : _a.hasAttribute('data-action-sheet-scroll')) === true;
|
|
233
|
+
if (entry.slot === 'top' && marked)
|
|
234
|
+
scrollTopSlots = true;
|
|
235
|
+
return {
|
|
236
|
+
...entry,
|
|
237
|
+
html,
|
|
238
|
+
scrolls: entry.slot === 'top' ? scrollTopSlots : marked,
|
|
239
|
+
};
|
|
240
|
+
});
|
|
241
|
+
// Bottom content joins the scroll area from the options through the last marker.
|
|
242
|
+
let scrollBottomSlots = false;
|
|
243
|
+
for (let index = slots.length - 1; index >= 0; index--) {
|
|
244
|
+
const entry = slots[index];
|
|
245
|
+
if (entry.slot !== 'bottom')
|
|
246
|
+
continue;
|
|
247
|
+
if (entry.scrolls)
|
|
248
|
+
scrollBottomSlots = true;
|
|
249
|
+
entry.scrolls = scrollBottomSlots;
|
|
250
|
+
}
|
|
251
|
+
const renderSlots = (position, scrolls) => slots
|
|
252
|
+
.filter(entry => entry.slot === position && entry.scrolls === scrolls)
|
|
253
|
+
.map(entry => (h("div", { class: "list-slot", innerHTML: entry.html })));
|
|
254
|
+
return (h("div", { class: "list-body" }, renderSlots('top', false), h("div", { class: "content", ref: el => (this.contentElement = el) }, renderSlots('top', true), h("q2-option-list", { ref: el => (this.optionListElement = el), multiple: listProps.multiple, label: ((_a = this.data) === null || _a === void 0 ? void 0 : _a.title) || this.title, noSelect: listProps.noSelect, onChange: this.onListChange, onPopoverState: this.onListPopoverStateChange, selectedOptions: listProps.selectedOptions }, h("slot", null)), renderSlots('bottom', true)), h("footer", null, listProps.multiple && (h("q2-btn", { ref: el => (this.doneButtonElement = el), "test-id": "btnDone", intent: "primary", onClick: this.onListDone }, loc('tecton.element.actionSheet.done')))), renderSlots('bottom', false)));
|
|
200
255
|
};
|
|
201
256
|
this.renderMessage = ({ data }) => {
|
|
202
257
|
return (h("q2-message", { type: data.type }, data.title && h("h2", null, data.title), data.description && h("p", null, data.description)));
|
|
@@ -210,6 +265,9 @@ export class Q2ActionSheet {
|
|
|
210
265
|
disconnectedCallback() {
|
|
211
266
|
this.dialogElement.removeEventListener('cancel', this.onCancel);
|
|
212
267
|
this.dialogElement.removeEventListener('keydown', this.handleDialogKeydown, true);
|
|
268
|
+
window.removeEventListener('resize', this.onViewportResize);
|
|
269
|
+
if (this.dialogElement.open)
|
|
270
|
+
this.restorePageScroll();
|
|
213
271
|
}
|
|
214
272
|
componentDidLoad() {
|
|
215
273
|
this.dialogElement.addEventListener('cancel', this.onCancel);
|
|
@@ -222,6 +280,8 @@ export class Q2ActionSheet {
|
|
|
222
280
|
async hide(data = { value: '', values: [], type: 'confirm' }) {
|
|
223
281
|
mirrorEmit(this, ['close', 'tctClose'], data);
|
|
224
282
|
this.renderStatus = 'is-closing';
|
|
283
|
+
window.removeEventListener('resize', this.onViewportResize);
|
|
284
|
+
this.restorePageScroll();
|
|
225
285
|
this.dialogElement.addEventListener('transitionend', () => {
|
|
226
286
|
if (this.renderStatus !== 'is-closing')
|
|
227
287
|
return;
|
|
@@ -229,25 +289,38 @@ export class Q2ActionSheet {
|
|
|
229
289
|
this.renderStatus = null;
|
|
230
290
|
this.data = undefined;
|
|
231
291
|
this.initialSelectedOptions = [];
|
|
292
|
+
this.selectedDate = {};
|
|
232
293
|
this.selectedOptions = { values: [], value: '' };
|
|
233
294
|
this.hidePostHook();
|
|
234
295
|
}, { once: true });
|
|
235
296
|
}
|
|
236
297
|
async show() {
|
|
298
|
+
if (this.dialogElement.open)
|
|
299
|
+
return;
|
|
237
300
|
this.showPreHook();
|
|
238
301
|
await waitForNextPaint();
|
|
239
302
|
this.updateDialogMinMaxHeight();
|
|
240
303
|
this.storeInitialValues();
|
|
241
|
-
if (this.dialogElement.open)
|
|
242
|
-
return;
|
|
243
304
|
this.dialogElement.showModal();
|
|
244
|
-
|
|
245
|
-
this.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
305
|
+
window.addEventListener('resize', this.onViewportResize);
|
|
306
|
+
this.bodyOverflow = document.body.style.overflow;
|
|
307
|
+
this.rootOverflow = document.documentElement.style.overflow;
|
|
308
|
+
document.body.style.overflow = 'hidden';
|
|
309
|
+
document.documentElement.style.overflow = 'hidden';
|
|
310
|
+
try {
|
|
311
|
+
this.renderStatus = 'is-opening';
|
|
312
|
+
this.dialogElement.addEventListener('transitionend', () => {
|
|
313
|
+
if (this.renderStatus !== 'is-opening')
|
|
314
|
+
return;
|
|
315
|
+
this.renderStatus = 'is-open';
|
|
316
|
+
this.focusContent();
|
|
317
|
+
}, { once: true });
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
window.removeEventListener('resize', this.onViewportResize);
|
|
321
|
+
this.restorePageScroll();
|
|
322
|
+
throw error;
|
|
323
|
+
}
|
|
251
324
|
}
|
|
252
325
|
// #endregion
|
|
253
326
|
// #region Local Methods
|
|
@@ -273,6 +346,10 @@ export class Q2ActionSheet {
|
|
|
273
346
|
this.hostElement.innerHTML = null;
|
|
274
347
|
}
|
|
275
348
|
}
|
|
349
|
+
restorePageScroll() {
|
|
350
|
+
document.body.style.overflow = this.bodyOverflow;
|
|
351
|
+
document.documentElement.style.overflow = this.rootOverflow;
|
|
352
|
+
}
|
|
276
353
|
showPreHook() {
|
|
277
354
|
const { data } = this;
|
|
278
355
|
if (!data)
|
|
@@ -298,12 +375,15 @@ export class Q2ActionSheet {
|
|
|
298
375
|
this.dialogElement.style.setProperty('--comp-action-sheet-computed-max-height', `${Math.floor(windowHeight * this.maxHeight)}px`);
|
|
299
376
|
}
|
|
300
377
|
render() {
|
|
301
|
-
var _a;
|
|
302
378
|
const { data } = this;
|
|
303
379
|
const showHeader = (data === null || data === void 0 ? void 0 : data.title) || this.title || !this.hideClose;
|
|
380
|
+
const headerTitle = (data === null || data === void 0 ? void 0 : data.title) || this.title;
|
|
304
381
|
const renderStatus = this.renderStatus || '';
|
|
305
382
|
let RenderContent = null;
|
|
306
383
|
switch (data === null || data === void 0 ? void 0 : data.appearance) {
|
|
384
|
+
case 'date-picker':
|
|
385
|
+
RenderContent = this.renderDatePicker;
|
|
386
|
+
break;
|
|
307
387
|
case 'message':
|
|
308
388
|
RenderContent = this.renderMessage;
|
|
309
389
|
break;
|
|
@@ -316,7 +396,7 @@ export class Q2ActionSheet {
|
|
|
316
396
|
}
|
|
317
397
|
const appearance = (data === null || data === void 0 ? void 0 : data.appearance) || 'slot';
|
|
318
398
|
const interiorClasses = `interior is-${appearance}`;
|
|
319
|
-
return (h("dialog", { key: '
|
|
399
|
+
return (h("dialog", { key: 'a2594cad0378cf9bf045ed3ec1022afc58e34dbb', ref: el => (this.dialogElement = el), class: renderStatus, "aria-label": showHeader ? undefined : headerTitle, "aria-labelledby": showHeader ? 'title' : undefined, onClick: this.onClick }, h("div", { key: 'de6361cfa49ec69666b8b2c193dcc9cfc5ac4b0f', class: interiorClasses }, showHeader && (h("header", { key: 'c5a1ddd1f414027e3f75d2a7048c1ccd349cba78' }, h("div", { key: '3d4e7472f5c55ed96eec5ad8909d6ada7a5aa5b2', id: "title" }, (data === null || data === void 0 ? void 0 : data.title) || this.title), !this.hideClose && (h("q2-btn", { key: 'c5e4c952b308e2571a6e90017e4f8010b4a580fe', ref: el => (this.closeButtonElement = el), class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.actionSheet.close", "hide-label": true }, h("q2-icon", { key: '10383e6b8d6ab899648208bbada3c18f47fb5bd3', type: "close" }))))), data && 'description' in data && data.description && h("p", { key: 'a1de7256a6f497270866f076d7697226a8bea946' }, data.description), RenderContent && h(RenderContent, { key: '3f5a57d706b4066c036bb4710a612bd34268b78e', data: this.data }))));
|
|
320
400
|
}
|
|
321
401
|
static get is() { return "q2-action-sheet"; }
|
|
322
402
|
static get encapsulation() { return "shadow"; }
|
|
@@ -337,7 +417,7 @@ export class Q2ActionSheet {
|
|
|
337
417
|
"mutable": true,
|
|
338
418
|
"complexType": {
|
|
339
419
|
"original": "ActionSheetData",
|
|
340
|
-
"resolved": "{ appearance: \"list\"; title?: string; description?: string; event?: MouseEvent | KeyboardEvent; listProps: { multiple: boolean; selectedOptions: ActionSheetSelectedOption[]; noSelect: boolean; }; options: ActionSheetListDataOptions; slotsHtml?: ActionSheetStaticHtmlData[]; } | { appearance: \"message\"; type: \"info\" | \"success\" | \"warning\" | \"error\"; title?: string; description?: string; slotsHtml?: ActionSheetStaticHtmlData[]; }",
|
|
420
|
+
"resolved": "{ appearance: \"date-picker\"; title?: string; datePickerProps: ActionSheetDatePickerProps; } | { appearance: \"list\"; title?: string; description?: string; event?: MouseEvent | KeyboardEvent; listProps: { multiple: boolean; selectedOptions: ActionSheetSelectedOption[]; noSelect: boolean; }; options: ActionSheetListDataOptions; slotsHtml?: ActionSheetStaticHtmlData[]; } | { appearance: \"message\"; type: \"info\" | \"success\" | \"warning\" | \"error\"; title?: string; description?: string; slotsHtml?: ActionSheetStaticHtmlData[]; }",
|
|
341
421
|
"references": {
|
|
342
422
|
"ActionSheetData": {
|
|
343
423
|
"location": "import",
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { expect } from "@playwright/test";
|
|
2
|
+
import { test } from "@stencil/playwright";
|
|
3
|
+
import { setupPage, THEMES } from "../../../utils/test/vr-helpers";
|
|
4
|
+
// q2-action-sheet hosts stay hidden until show() runs, which makes setupPage's
|
|
5
|
+
// `[stencil-hydrated]:visible` wait time out. Prepending any visible hydrated Stencil
|
|
6
|
+
// element lets that wait resolve so we can call show(). Matches q2-modal's VR setup.
|
|
7
|
+
const VISIBLE_HYDRATION_ANCHOR = `<q2-icon type="info"></q2-icon>`;
|
|
8
|
+
for (const multiple of [false, true]) {
|
|
9
|
+
for (const landscape of [false, true]) {
|
|
10
|
+
const name = `mixed-slots-${multiple ? 'multi' : 'single'}-${landscape ? 'landscape' : 'portrait'}`;
|
|
11
|
+
test(name, async ({ page }) => {
|
|
12
|
+
await page.setViewportSize(landscape ? { width: 667, height: 375 } : { width: 375, height: 667 });
|
|
13
|
+
await setupPage(page, `${VISIBLE_HYDRATION_ANCHOR}<q2-action-sheet></q2-action-sheet>`, {
|
|
14
|
+
setupLoc: true,
|
|
15
|
+
fontSizePx: 24,
|
|
16
|
+
});
|
|
17
|
+
await page.locator('q2-action-sheet').evaluate(async (element, multiple) => {
|
|
18
|
+
await element.componentOnReady();
|
|
19
|
+
element.data = {
|
|
20
|
+
appearance: 'list',
|
|
21
|
+
title: 'Profile',
|
|
22
|
+
listProps: { multiple, selectedOptions: [], noSelect: false },
|
|
23
|
+
options: Array.from({ length: 30 }, (_, index) => ({
|
|
24
|
+
value: `profile-${index}`,
|
|
25
|
+
display: `Profile ${index + 1}`,
|
|
26
|
+
innerHTML: `Profile ${index + 1}`,
|
|
27
|
+
disabled: false,
|
|
28
|
+
hidden: false,
|
|
29
|
+
multiline: false,
|
|
30
|
+
separator: false,
|
|
31
|
+
})),
|
|
32
|
+
slotsHtml: [
|
|
33
|
+
{ slot: 'top', html: '<div>Fixed top</div>' },
|
|
34
|
+
{ slot: 'top', html: '<div data-action-sheet-scroll>Alex Example</div>' },
|
|
35
|
+
{ slot: 'top', html: '<div>alex@example.com</div>' },
|
|
36
|
+
{ slot: 'bottom', html: '<div>Profile help</div>' },
|
|
37
|
+
{ slot: 'bottom', html: '<div data-action-sheet-scroll>Manage profiles</div>' },
|
|
38
|
+
{ slot: 'bottom', html: '<div>Fixed bottom</div>' },
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
await element.show();
|
|
42
|
+
}, multiple);
|
|
43
|
+
await expect(page.locator('q2-action-sheet dialog')).toHaveClass('is-open');
|
|
44
|
+
const content = page.locator('q2-action-sheet .list-body > .content');
|
|
45
|
+
await expect(content).toHaveCount(1);
|
|
46
|
+
// Opening moves focus from the dialog's close button to its options.
|
|
47
|
+
// Capture a defined focus and scroll state rather than either opening state.
|
|
48
|
+
const firstOption = page.locator('q2-action-sheet q2-option').first();
|
|
49
|
+
await expect(firstOption).toHaveAttribute('stencil-hydrated', '');
|
|
50
|
+
await firstOption.evaluate(element => element.focus({ preventScroll: true }));
|
|
51
|
+
await expect(firstOption).toBeFocused();
|
|
52
|
+
await content.evaluate(element => {
|
|
53
|
+
element.scrollTop = 0;
|
|
54
|
+
});
|
|
55
|
+
await expect(content).toHaveJSProperty('scrollTop', 0);
|
|
56
|
+
const movingSlots = content.locator('.list-slot');
|
|
57
|
+
const fixedSlots = page.locator('q2-action-sheet .list-body > .list-slot');
|
|
58
|
+
await expect(movingSlots).toHaveText([
|
|
59
|
+
'Alex Example',
|
|
60
|
+
'alex@example.com',
|
|
61
|
+
'Profile help',
|
|
62
|
+
'Manage profiles',
|
|
63
|
+
]);
|
|
64
|
+
await expect(fixedSlots).toHaveText(['Fixed top', 'Fixed bottom']);
|
|
65
|
+
const fixedElements = page.locator('q2-action-sheet header, q2-action-sheet .list-body > .list-slot, q2-action-sheet footer');
|
|
66
|
+
const initialBounds = await Promise.all((await fixedElements.all()).map(element => element.boundingBox()));
|
|
67
|
+
const dimensions = await content.evaluate(element => ({
|
|
68
|
+
clientHeight: element.clientHeight,
|
|
69
|
+
scrollHeight: element.scrollHeight,
|
|
70
|
+
}));
|
|
71
|
+
expect(dimensions.clientHeight).toBeGreaterThan(0);
|
|
72
|
+
expect(dimensions.scrollHeight).toBeGreaterThan(dimensions.clientHeight);
|
|
73
|
+
const dialogBounds = await page.locator('q2-action-sheet dialog').boundingBox();
|
|
74
|
+
const contentBounds = await content.boundingBox();
|
|
75
|
+
expect(contentBounds.y).toBeGreaterThanOrEqual(dialogBounds.y);
|
|
76
|
+
expect(contentBounds.y + contentBounds.height).toBeLessThanOrEqual(dialogBounds.y + dialogBounds.height + 1);
|
|
77
|
+
await expect(firstOption).toBeFocused();
|
|
78
|
+
await expect(page).toHaveScreenshot(`q2-action-sheet--${name}.png`);
|
|
79
|
+
const lastOption = page.locator('q2-action-sheet q2-option').last();
|
|
80
|
+
await lastOption.scrollIntoViewIfNeeded();
|
|
81
|
+
await expect(lastOption).toBeInViewport({ ratio: 1 });
|
|
82
|
+
const optionBounds = await lastOption.boundingBox();
|
|
83
|
+
expect(optionBounds.y).toBeGreaterThanOrEqual(contentBounds.y - 1);
|
|
84
|
+
expect(optionBounds.y + optionBounds.height).toBeLessThanOrEqual(contentBounds.y + contentBounds.height + 1);
|
|
85
|
+
expect(await content.evaluate(element => element.scrollTop)).toBeGreaterThan(0);
|
|
86
|
+
await content.evaluate(element => {
|
|
87
|
+
element.scrollTop = element.scrollHeight;
|
|
88
|
+
});
|
|
89
|
+
await expect(movingSlots.last()).toBeInViewport({ ratio: 1 });
|
|
90
|
+
await expect(movingSlots.first()).not.toBeInViewport();
|
|
91
|
+
expect(await Promise.all((await fixedElements.all()).map(element => element.boundingBox()))).toEqual(initialBounds);
|
|
92
|
+
for (const element of await fixedSlots.all()) {
|
|
93
|
+
await expect(element).toBeInViewport({ ratio: 1 });
|
|
94
|
+
}
|
|
95
|
+
if (multiple) {
|
|
96
|
+
await expect(page.locator('q2-action-sheet [test-id="btnDone"]')).toBeInViewport({ ratio: 1 });
|
|
97
|
+
}
|
|
98
|
+
await expect(page.locator('q2-action-sheet [test-id="btnClose"]')).toBeInViewport({ ratio: 1 });
|
|
99
|
+
await expect(page).toHaveScreenshot(`q2-action-sheet--${name}--scrolled.png`);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
for (const theme of THEMES) {
|
|
104
|
+
test(`q2-action-sheet--calendar-navigation-focus — ${theme}`, async ({ page }) => {
|
|
105
|
+
await setupPage(page, '<q2-btn>Choose a date</q2-btn><q2-action-sheet></q2-action-sheet>', {
|
|
106
|
+
theme,
|
|
107
|
+
setupLoc: true,
|
|
108
|
+
});
|
|
109
|
+
await page.locator('q2-action-sheet').evaluate((element) => {
|
|
110
|
+
element.data = {
|
|
111
|
+
appearance: 'date-picker',
|
|
112
|
+
title: 'Choose a date',
|
|
113
|
+
datePickerProps: { mode: 'single', value: '2026-06-15' },
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
await page.locator('q2-action-sheet').evaluate((element) => element.show());
|
|
117
|
+
const navigation = page.locator('q2-date-picker .previousYear button');
|
|
118
|
+
await navigation.waitFor({ state: 'visible' });
|
|
119
|
+
await page.keyboard.press('Tab');
|
|
120
|
+
await navigation.focus();
|
|
121
|
+
await expect(navigation).toBeFocused();
|
|
122
|
+
await expect(page).toHaveScreenshot(`q2-action-sheet--calendar-navigation-focus--${theme}.png`);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
@@ -8,6 +8,7 @@ import { h } from "@stencil/core";
|
|
|
8
8
|
*/
|
|
9
9
|
export class Q2Avatar {
|
|
10
10
|
constructor() {
|
|
11
|
+
this.initialsFontScale = 1;
|
|
11
12
|
// #endregion
|
|
12
13
|
// #region State Properties
|
|
13
14
|
this.badSrc = false;
|
|
@@ -29,9 +30,11 @@ export class Q2Avatar {
|
|
|
29
30
|
// #endregion
|
|
30
31
|
// #region Component Lifecycle Events
|
|
31
32
|
disconnectedCallback() {
|
|
33
|
+
var _a;
|
|
32
34
|
if (this.decoratorObserver) {
|
|
33
35
|
this.decoratorObserver.disconnect();
|
|
34
36
|
}
|
|
37
|
+
(_a = this.initialsResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
35
38
|
}
|
|
36
39
|
componentWillLoad() {
|
|
37
40
|
this.checkDecorator();
|
|
@@ -39,6 +42,20 @@ export class Q2Avatar {
|
|
|
39
42
|
componentDidLoad() {
|
|
40
43
|
this.setupDecoratorObserver();
|
|
41
44
|
}
|
|
45
|
+
componentDidRender() {
|
|
46
|
+
var _a, _b, _c;
|
|
47
|
+
const text = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.avatar-initials text');
|
|
48
|
+
if (text !== this.observedInitialsText) {
|
|
49
|
+
(_b = this.initialsResizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
50
|
+
this.observedInitialsText = text;
|
|
51
|
+
this.initialsFontScale = 1;
|
|
52
|
+
if (text && typeof ResizeObserver === 'function') {
|
|
53
|
+
(_c = this.initialsResizeObserver) !== null && _c !== void 0 ? _c : (this.initialsResizeObserver = new ResizeObserver(() => this.fitInitials()));
|
|
54
|
+
this.initialsResizeObserver.observe(text);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
this.fitInitials();
|
|
58
|
+
}
|
|
42
59
|
// #endregion
|
|
43
60
|
// #region Watchers
|
|
44
61
|
srcDidUpdate() {
|
|
@@ -69,6 +86,22 @@ export class Q2Avatar {
|
|
|
69
86
|
const decoratorElements = Array.from(this.el.children).filter(child => child.getAttribute('slot') === 'decorator');
|
|
70
87
|
this.hasDecorator = decoratorElements.length > 0;
|
|
71
88
|
}
|
|
89
|
+
fitInitials() {
|
|
90
|
+
const text = this.observedInitialsText;
|
|
91
|
+
if (!text)
|
|
92
|
+
return;
|
|
93
|
+
const { x, y, width, height } = text.getBBox();
|
|
94
|
+
const requiredHalfExtent = Math.max(50 - x, x + width - 50, 50 - y, y + height - 50);
|
|
95
|
+
const baseHalfExtent = requiredHalfExtent / this.initialsFontScale;
|
|
96
|
+
const scale = baseHalfExtent > 50 ? 48 / baseHalfExtent : 1;
|
|
97
|
+
if (Math.abs(scale - this.initialsFontScale) < 0.00001)
|
|
98
|
+
return;
|
|
99
|
+
this.initialsFontScale = scale;
|
|
100
|
+
if (scale === 1)
|
|
101
|
+
text.style.removeProperty('font-size');
|
|
102
|
+
else
|
|
103
|
+
text.style.fontSize = `calc(var(--tct-avatar-font-size, var(--const-px-40, 40px)) * ${scale})`;
|
|
104
|
+
}
|
|
72
105
|
setupDecoratorObserver() {
|
|
73
106
|
// Set up MutationObserver to watch for changes to the host element's children
|
|
74
107
|
this.decoratorObserver = new MutationObserver(() => {
|
|
@@ -90,7 +123,7 @@ export class Q2Avatar {
|
|
|
90
123
|
const isLoaded = this.isLoaded;
|
|
91
124
|
const showInitials = (this.name || this.initials) && (!this.src || this.badSrc);
|
|
92
125
|
const showFallback = !this.name && !this.initials && (!this.src || this.badSrc);
|
|
93
|
-
return (h("div", { key: '
|
|
126
|
+
return (h("div", { key: 'd5a32129734a7923c61ecfbace6af0799051b8c9', class: `avatar-wrapper size-${this.size}` }, this.hasDecorator && (h("div", { key: 'a20e35425d03a0b45df79846b1613be993935bab', class: "decorator" }, h("slot", { key: '082a7d3022be63825ac0237b0f458eb3fc328737', name: "decorator" }))), showImg && (h("img", { key: 'bc092a5fe3996d53f89bc69146aceb2af53b571a', class: `${isLoaded ? 'avatar-img' : 'avatar-img-default'}`, "test-id": "userImage", src: this.src, onError: this.onError, onLoad: this.onLoad, alt: this.name || '' })), showInitials && (h("svg", { key: '385335ea2b6d35d48179cbea4aa3ac3d99e56093', viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid meet", "test-id": "userInitials", class: `avatar-initials initials-size-${computedInitials.length}`, "aria-label": this.name, "aria-hidden": !this.name && 'true' }, h("text", { key: 'fb331a07ddc746787341e31febcf2a267f8f0e33', x: "50", y: "50", "dominant-baseline": "central", "text-anchor": "middle", "aria-hidden": "true" }, computedInitials))), showFallback && (h("div", { key: 'da7a75cc5e5b4e62eeaa63c399ed0dc6c869e99c', "test-id": "fallbackIcon", class: "fallback" }, h("q2-icon", { key: '626219dd1528fa7e39d298856be8205f21a6708e', type: this.icon })))));
|
|
94
127
|
}
|
|
95
128
|
static get is() { return "q2-avatar"; }
|
|
96
129
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3,6 +3,10 @@ import { test } from "@stencil/playwright";
|
|
|
3
3
|
import { setupPage, THEMES, FONT_SCALE_PX, FONT_SCALE_SUFFIX } from "../../../utils/test/vr-helpers";
|
|
4
4
|
// Inline 2x2 solid-blue PNG — keeps the image variant hermetic (no network).
|
|
5
5
|
const IMAGE_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAFklEQVQI12NkYGD4z8DAwMTAwMDAAAALzAEFwQ7e7AAAAABJRU5ErkJggg==';
|
|
6
|
+
const waitForInitialsToSettle = (page) => page.evaluate(async () => {
|
|
7
|
+
await document.fonts.ready;
|
|
8
|
+
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));
|
|
9
|
+
});
|
|
6
10
|
const VARIANTS = [
|
|
7
11
|
{
|
|
8
12
|
name: 'icon-small',
|
|
@@ -30,7 +34,7 @@ const VARIANTS = [
|
|
|
30
34
|
},
|
|
31
35
|
{
|
|
32
36
|
name: 'initials-4',
|
|
33
|
-
html: `<q2-avatar initials="
|
|
37
|
+
html: `<q2-avatar initials="WWWW"></q2-avatar>`,
|
|
34
38
|
},
|
|
35
39
|
{
|
|
36
40
|
name: 'image',
|
|
@@ -48,7 +52,9 @@ const VARIANTS = [
|
|
|
48
52
|
const restingCase = (variant, theme) => {
|
|
49
53
|
test(`q2-avatar--${variant.name}--resting — ${theme}`, async ({ page }) => {
|
|
50
54
|
await setupPage(page, variant.html, { theme });
|
|
51
|
-
|
|
55
|
+
if (variant.name.startsWith('initials-'))
|
|
56
|
+
await waitForInitialsToSettle(page);
|
|
57
|
+
await expect(page).toHaveScreenshot(`q2-avatar--${variant.name}--resting--${theme}.png`, variant.name === 'initials-4' ? { maxDiffPixels: 50 } : undefined);
|
|
52
58
|
});
|
|
53
59
|
};
|
|
54
60
|
test.describe('q2-avatar — variants × themes', () => {
|
|
@@ -59,14 +65,83 @@ test.describe('q2-avatar — variants × themes', () => {
|
|
|
59
65
|
}
|
|
60
66
|
});
|
|
61
67
|
// Initials variants exercise --tct-avatar-font-size (SVG text element).
|
|
62
|
-
const AVATAR_FONT_SCALE_VARIANTS = VARIANTS.filter(v => v.name
|
|
68
|
+
const AVATAR_FONT_SCALE_VARIANTS = VARIANTS.filter(v => v.name.startsWith('initials-'));
|
|
63
69
|
test.describe(`q2-avatar — scaled font size × themes`, () => {
|
|
64
70
|
for (const variant of AVATAR_FONT_SCALE_VARIANTS) {
|
|
65
71
|
for (const theme of THEMES) {
|
|
66
72
|
test(`q2-avatar--${variant.name}--resting--${FONT_SCALE_SUFFIX} — ${theme}`, async ({ page }) => {
|
|
67
73
|
await setupPage(page, variant.html, { theme, fontSizePx: FONT_SCALE_PX });
|
|
68
|
-
await
|
|
74
|
+
await waitForInitialsToSettle(page);
|
|
75
|
+
await expect(page).toHaveScreenshot(`q2-avatar--${variant.name}--resting--${FONT_SCALE_SUFFIX}--${theme}.png`, variant.name === 'initials-4' ? { maxDiffPixels: 50 } : undefined);
|
|
69
76
|
});
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
79
|
});
|
|
80
|
+
test.describe('q2-avatar — initials fit inside the circle', () => {
|
|
81
|
+
for (const theme of THEMES) {
|
|
82
|
+
test(`q2-avatar--initials-fit — ${theme}`, async ({ page }) => {
|
|
83
|
+
const html = ['small', 'medium', 'large']
|
|
84
|
+
.map(size => `<div style="display: flex; gap: 8px; margin-bottom: 16px">
|
|
85
|
+
${['E', 'ES', 'ESS', 'ESSS', 'LSMA', 'W', 'WW', 'WWW', 'WWWW']
|
|
86
|
+
.map(initials => `<q2-avatar size="${size}" initials="${initials}"></q2-avatar>`)
|
|
87
|
+
.join('')}
|
|
88
|
+
</div>`)
|
|
89
|
+
.join('');
|
|
90
|
+
await setupPage(page, html, { theme, fontSizePx: FONT_SCALE_PX });
|
|
91
|
+
await expect
|
|
92
|
+
.poll(() => page.locator('q2-avatar text').evaluateAll(elements => elements.every(element => {
|
|
93
|
+
const { x, y, width, height } = element.getBBox();
|
|
94
|
+
return x >= 0 && x + width <= 100 && y >= 0 && y + height <= 100;
|
|
95
|
+
})))
|
|
96
|
+
.toBe(true);
|
|
97
|
+
const bounds = await page.locator('q2-avatar text').evaluateAll(elements => elements.map(element => {
|
|
98
|
+
const { x, y, width, height } = element.getBBox();
|
|
99
|
+
return {
|
|
100
|
+
initials: element.textContent,
|
|
101
|
+
x,
|
|
102
|
+
y,
|
|
103
|
+
right: x + width,
|
|
104
|
+
bottom: y + height,
|
|
105
|
+
};
|
|
106
|
+
}));
|
|
107
|
+
for (const { initials, x, y, right, bottom } of bounds) {
|
|
108
|
+
expect(x, `${initials} left edge`).toBeGreaterThanOrEqual(-0.25);
|
|
109
|
+
expect(right, `${initials} right edge`).toBeLessThanOrEqual(100.25);
|
|
110
|
+
expect(y, `${initials} top edge`).toBeGreaterThanOrEqual(-0.25);
|
|
111
|
+
expect(bottom, `${initials} bottom edge`).toBeLessThanOrEqual(100.25);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
test('q2-avatar — initials fit at font-32 root size', async ({ page }) => {
|
|
117
|
+
const html = ['small', 'medium', 'large']
|
|
118
|
+
.map(size => `<div style="display: flex; gap: 8px; margin-bottom: 16px">
|
|
119
|
+
${['ES', 'ESS', 'LSM', 'LSMA', 'WWWW']
|
|
120
|
+
.map(initials => `<q2-avatar size="${size}" initials="${initials}"></q2-avatar>`)
|
|
121
|
+
.join('')}
|
|
122
|
+
</div>`)
|
|
123
|
+
.join('');
|
|
124
|
+
// Set the font size before hydration, as a browser preference would be.
|
|
125
|
+
await setupPage(page, `<style>html { font-size: 32px; --t-px-1: calc(1 / 16 * 1rem); }</style>${html}`, {
|
|
126
|
+
theme: 'standard',
|
|
127
|
+
});
|
|
128
|
+
expect(await page.evaluate(() => getComputedStyle(document.documentElement).fontSize)).toBe('32px');
|
|
129
|
+
const allInitialsFit = () => page.locator('q2-avatar text').evaluateAll(elements => elements.every(element => {
|
|
130
|
+
const { x, y, width, height } = element.getBBox();
|
|
131
|
+
return x >= 0 && x + width <= 100 && y >= 0 && y + height <= 100;
|
|
132
|
+
}));
|
|
133
|
+
await expect.poll(allInitialsFit).toBe(true);
|
|
134
|
+
const bounds = await page.locator('q2-avatar text').evaluateAll(elements => elements.map(element => {
|
|
135
|
+
const { x, y, width, height } = element.getBBox();
|
|
136
|
+
return { initials: element.textContent, x, y, right: x + width, bottom: y + height };
|
|
137
|
+
}));
|
|
138
|
+
for (const { initials, x, y, right, bottom } of bounds) {
|
|
139
|
+
expect(x, `${initials} left edge`).toBeGreaterThanOrEqual(0);
|
|
140
|
+
expect(right, `${initials} right edge`).toBeLessThanOrEqual(100);
|
|
141
|
+
expect(y, `${initials} top edge`).toBeGreaterThanOrEqual(0);
|
|
142
|
+
expect(bottom, `${initials} bottom edge`).toBeLessThanOrEqual(100);
|
|
143
|
+
}
|
|
144
|
+
// Also verify an already-rendered avatar refits when the font scale changes.
|
|
145
|
+
await page.evaluate(() => document.documentElement.style.setProperty('--t-px-1', '3px'));
|
|
146
|
+
await expect.poll(allInitialsFit).toBe(true);
|
|
147
|
+
});
|