q2-tecton-elements 1.71.2 → 1.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle-report.json +1282 -594
- package/dist/cjs/click-elsewhere_3.cjs.entry.js +10 -9
- package/dist/cjs/{index-SpDCZABA.js → index-BY3aao8R.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{q2-action-group_2.cjs.entry.js → q2-action-group.cjs.entry.js} +1 -89
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +113 -12
- package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-calendar.cjs.entry.js +7 -5
- package/dist/cjs/q2-card-image.cjs.entry.js +4 -4
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/q2-context.cjs.entry.js +4 -3
- package/dist/cjs/q2-data-table.cjs.entry.js +2 -2
- package/dist/cjs/q2-detail.cjs.entry.js +1 -1
- 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 +38 -37
- package/dist/cjs/q2-file-picker.cjs.entry.js +60 -4
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-link_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +2 -2
- package/dist/cjs/q2-meter.cjs.entry.js +1 -1
- package/dist/cjs/q2-modal.cjs.entry.js +59 -17
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +1 -1
- package/dist/cjs/q2-otp.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio-group.cjs.entry.js +22 -4
- package/dist/cjs/q2-radio.cjs.entry.js +3 -3
- package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
- package/dist/cjs/q2-resize-observer.cjs.entry.js +92 -0
- package/dist/cjs/q2-search.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +7 -7
- package/dist/cjs/q2-select.cjs.entry.js +35 -19
- 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 +1 -1
- 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 +1 -1
- package/dist/cjs/q2-toast.cjs.entry.js +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +5 -3
- package/dist/collection/components/q2-btn/q2-btn.css +79 -21
- package/dist/collection/components/q2-btn/test/q2-btn-test.vr.js +156 -3
- package/dist/collection/components/q2-calendar/q2-calendar.css +3 -0
- package/dist/collection/components/q2-calendar/q2-calendar.js +5 -3
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.vr.js +23 -2
- package/dist/collection/components/q2-card/test/q2-card-test.vr.js +4 -0
- package/dist/collection/components/q2-card-image/q2-card-image.css +89 -134
- package/dist/collection/components/q2-card-image/q2-card-image.js +4 -4
- package/dist/collection/components/q2-card-image/test/q2-card-image-test.vr.js +4 -0
- package/dist/collection/components/q2-carousel/test/q2-carousel-test.vr.js +13 -0
- package/dist/collection/components/q2-checkbox/q2-checkbox.css +2 -2
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +2 -0
- package/dist/collection/components/q2-context/q2-context.css +5 -0
- package/dist/collection/components/q2-context/q2-context.js +2 -1
- package/dist/collection/components/q2-context/test/q2-context-test.vr.js +11 -1
- package/dist/collection/components/q2-data-table/q2-data-table.css +3 -0
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.vr.js +5 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.css +2 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.vr.js +30 -0
- package/dist/collection/components/q2-editable-field/q2-editable-field.css +2 -0
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +38 -43
- package/dist/collection/components/q2-file-picker/q2-file-picker.css +27 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +98 -2
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.vr.js +22 -0
- package/dist/collection/components/q2-input/q2-input.css +67 -1
- package/dist/collection/components/q2-input/q2-input.js +155 -13
- package/dist/collection/components/q2-input/test/q2-input-test.vr.js +35 -0
- package/dist/collection/components/q2-item/q2-item.css +3 -1
- package/dist/collection/components/q2-item/test/q2-item-test.vr.js +6 -0
- package/dist/collection/components/q2-message/q2-message.css +5 -5
- package/dist/collection/components/q2-modal/q2-modal.css +40 -3
- package/dist/collection/components/q2-modal/q2-modal.js +100 -16
- package/dist/collection/components/q2-modal/test/q2-modal-test.vr.js +25 -0
- package/dist/collection/components/q2-pill/q2-pill.css +2 -2
- package/dist/collection/components/q2-popover/q2-popover.css +3 -2
- package/dist/collection/components/q2-popover/q2-popover.js +8 -7
- package/dist/collection/components/q2-radio/q2-radio.css +158 -104
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio/test/q2-radio-test.vr.js +25 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.css +39 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +68 -2
- package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.vr.js +43 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +2 -2
- package/dist/collection/components/q2-search/q2-search.css +2 -0
- package/dist/collection/components/q2-section/q2-section.css +2 -0
- package/dist/collection/components/q2-section/q2-section.js +6 -6
- package/dist/collection/components/q2-select/q2-select.css +3 -0
- package/dist/collection/components/q2-select/q2-select.js +37 -18
- package/dist/collection/components/q2-select/test/q2-select-test.vr.js +13 -0
- 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-tab-container/q2-tab-container.js +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +5 -3
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/test/vr-helpers.js +16 -2
- package/dist/components/index2.js +1 -1
- package/dist/components/q2-btn2.js +1 -1
- package/dist/components/q2-calendar.js +11 -9
- package/dist/components/q2-card-image.js +24 -24
- package/dist/components/q2-checkbox-group.js +6 -6
- package/dist/components/q2-checkbox2.js +1 -1
- package/dist/components/q2-context.js +27 -26
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-dropdown.js +21 -21
- package/dist/components/q2-editable-field.js +33 -35
- package/dist/components/q2-file-picker.js +70 -10
- package/dist/components/q2-input2.js +268 -163
- package/dist/components/q2-item2.js +1 -1
- package/dist/components/q2-message2.js +24 -24
- package/dist/components/q2-modal.js +96 -78
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +29 -26
- package/dist/components/q2-radio-group.js +70 -40
- package/dist/components/q2-radio.js +40 -55
- package/dist/components/q2-relative-time.js +5 -5
- package/dist/components/q2-search.js +1 -1
- package/dist/components/q2-section.js +33 -33
- package/dist/components/q2-select2.js +46 -39
- package/dist/components/q2-stepper-pane.js +15 -11
- package/dist/components/q2-stepper-vertical.js +4 -4
- package/dist/components/q2-surface.js +3 -3
- package/dist/components/q2-tab-container.js +21 -21
- package/dist/components/q2-tab-pane.js +2 -2
- package/dist/components/q2-tag2.js +5 -5
- package/dist/components/tecton-tab-pane.js +8 -7
- package/dist/esm/click-elsewhere_3.entry.js +10 -9
- package/dist/esm/{index-Cps4jSQM.js → index-DJw6Feh0.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{q2-action-group_2.entry.js → q2-action-group.entry.js} +3 -90
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +113 -12
- package/dist/esm/q2-btn_2.entry.js +2 -2
- package/dist/esm/q2-calendar.entry.js +7 -5
- package/dist/esm/q2-card-image.entry.js +4 -4
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox_2.entry.js +3 -3
- package/dist/esm/q2-context.entry.js +4 -3
- package/dist/esm/q2-data-table.entry.js +2 -2
- package/dist/esm/q2-detail.entry.js +1 -1
- 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 +38 -37
- package/dist/esm/q2-file-picker.entry.js +60 -4
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +2 -2
- package/dist/esm/q2-link_2.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +2 -2
- package/dist/esm/q2-meter.entry.js +1 -1
- package/dist/esm/q2-modal.entry.js +59 -17
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-otp.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +2 -2
- package/dist/esm/q2-radio-group.entry.js +22 -4
- package/dist/esm/q2-radio.entry.js +3 -3
- package/dist/esm/q2-relative-time.entry.js +3 -3
- package/dist/esm/q2-resize-observer.entry.js +90 -0
- package/dist/esm/q2-search.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +7 -7
- package/dist/esm/q2-select.entry.js +35 -19
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/q2-toast.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +5 -3
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +32 -29
- package/dist/q2-tecton-elements/{index-Cps4jSQM.js → index-DJw6Feh0.js} +1 -1
- package/dist/q2-tecton-elements/{q2-action-group_2.entry.js → q2-action-group.entry.js} +35 -113
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-badge_2.entry.js +240 -140
- package/dist/q2-tecton-elements/q2-btn_2.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-calendar.entry.js +14 -12
- package/dist/q2-tecton-elements/q2-card-image.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +31 -31
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +16 -16
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-context.entry.js +22 -21
- package/dist/q2-tecton-elements/q2-data-table.entry.js +34 -34
- package/dist/q2-tecton-elements/q2-detail.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +15 -15
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +38 -40
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +61 -6
- package/dist/q2-tecton-elements/q2-icon.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-link_2.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-message.entry.js +24 -24
- package/dist/q2-tecton-elements/q2-meter.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-modal.entry.js +61 -45
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +11 -11
- package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-otp.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pill.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +55 -34
- package/dist/q2-tecton-elements/q2-radio.entry.js +38 -53
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +12 -12
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +81 -0
- package/dist/q2-tecton-elements/q2-search.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-section.entry.js +33 -33
- package/dist/q2-tecton-elements/q2-select.entry.js +27 -20
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +20 -16
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-stepper.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-surface.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-tab-container.entry.js +20 -20
- package/dist/q2-tecton-elements/q2-tab-pane.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +1 -1
- 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/tecton-tab-pane.entry.js +8 -7
- package/dist/types/components/q2-card-image/q2-card-image.d.ts +1 -1
- package/dist/types/components/q2-dropdown/test/q2-dropdown-test.vr.d.ts +1 -0
- package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +6 -1
- package/dist/types/components/q2-file-picker/q2-file-picker.d.ts +20 -0
- package/dist/types/components/q2-input/q2-input.d.ts +28 -2
- package/dist/types/components/q2-modal/q2-modal.d.ts +10 -1
- package/dist/types/components/q2-radio-group/q2-radio-group.d.ts +14 -0
- package/dist/types/components/q2-select/q2-select.d.ts +8 -2
- package/dist/types/components.d.ts +119 -11
- package/dist/types/utils/test/vr-helpers.d.ts +2 -0
- package/package.json +3 -3
|
@@ -21,11 +21,19 @@ export class Q2Modal {
|
|
|
21
21
|
// #endregion
|
|
22
22
|
// #region Public Property API
|
|
23
23
|
/**
|
|
24
|
-
* Controls visibility of the close button
|
|
24
|
+
* Controls visibility of the close button and whether the modal can be dismissed with the backdrop or Escape key.
|
|
25
25
|
*/
|
|
26
26
|
this.closable = true;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the action buttons should take up the full width of the modal footer.
|
|
29
|
+
*/
|
|
30
|
+
this.fullWidthButton = true;
|
|
27
31
|
// #endregion
|
|
28
32
|
// #region Local Methods
|
|
33
|
+
this.hasDialogTransition = () => {
|
|
34
|
+
const transitionDurations = (getComputedStyle(this.dialogElement).transitionDuration || '0s').split(',');
|
|
35
|
+
return transitionDurations.some(duration => parseFloat(duration) > 0);
|
|
36
|
+
};
|
|
29
37
|
this.initializeModal = () => {
|
|
30
38
|
// limits 4 buttons in action slot
|
|
31
39
|
this.hostElement.querySelectorAll('[slot="action"]').forEach((el, i) => {
|
|
@@ -39,6 +47,8 @@ export class Q2Modal {
|
|
|
39
47
|
};
|
|
40
48
|
this.onCancel = (event) => {
|
|
41
49
|
event.preventDefault();
|
|
50
|
+
if (!this.closable)
|
|
51
|
+
return;
|
|
42
52
|
this.closeModal();
|
|
43
53
|
};
|
|
44
54
|
this.onClick = (event) => {
|
|
@@ -49,12 +59,16 @@ export class Q2Modal {
|
|
|
49
59
|
const slot = eventTarget.getAttribute('slot');
|
|
50
60
|
if (slot === 'action') {
|
|
51
61
|
this.tctClick.emit({ value: eventTarget.dataset.value });
|
|
52
|
-
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
this.closeModal();
|
|
53
64
|
}
|
|
54
65
|
else {
|
|
55
66
|
const isInContent = !!eventTarget.closest('.interior , q2-modal');
|
|
56
67
|
if (isInContent)
|
|
57
68
|
return;
|
|
69
|
+
this.tctBackdropClick.emit();
|
|
70
|
+
if (!this.closable)
|
|
71
|
+
return;
|
|
58
72
|
this.onCancel(event);
|
|
59
73
|
}
|
|
60
74
|
};
|
|
@@ -78,33 +92,50 @@ export class Q2Modal {
|
|
|
78
92
|
// #region Component Lifecycle Events
|
|
79
93
|
disconnectedCallback() {
|
|
80
94
|
var _a;
|
|
81
|
-
this.dialogElement.removeEventListener('cancel', this.onCancel);
|
|
82
95
|
(_a = this.contentElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', this.debouncedScroll);
|
|
83
96
|
}
|
|
84
97
|
componentDidLoad() {
|
|
85
|
-
this.dialogElement.addEventListener('cancel', this.onCancel);
|
|
86
98
|
this.tctReady.emit();
|
|
87
99
|
this.bodyOverflow = document.body.style.overflow;
|
|
88
100
|
this.debouncedScroll = debounce(this.onContentScroll, 100);
|
|
89
101
|
this.contentElement.addEventListener('scroll', this.debouncedScroll);
|
|
90
102
|
}
|
|
91
103
|
componentDidRender() {
|
|
92
|
-
var _a;
|
|
93
|
-
(_a = this.
|
|
104
|
+
var _a, _b;
|
|
105
|
+
(_a = this.dialogElement) === null || _a === void 0 ? void 0 : _a.setAttribute('closedby', this.closable ? 'closerequest' : 'none');
|
|
106
|
+
(_b = this.scheduledAfterRender) === null || _b === void 0 ? void 0 : _b.forEach(fn => fn());
|
|
94
107
|
this.scheduledAfterRender = [];
|
|
95
108
|
}
|
|
96
109
|
// #endregion
|
|
97
110
|
// #region Public Methods API
|
|
98
111
|
async closeModal(data) {
|
|
99
|
-
|
|
100
|
-
this.
|
|
112
|
+
var _a;
|
|
113
|
+
if (!((_a = this.dialogElement) === null || _a === void 0 ? void 0 : _a.open))
|
|
114
|
+
return;
|
|
115
|
+
const shouldWaitForTransition = this.renderStatus === 'is-open' && this.hasDialogTransition();
|
|
101
116
|
document.body.style.overflow = this.bodyOverflow;
|
|
102
|
-
|
|
117
|
+
const completeClose = () => {
|
|
103
118
|
if (this.renderStatus !== 'is-closing')
|
|
104
119
|
return;
|
|
120
|
+
this.dialogElement.removeEventListener('transitionend', onTransitionComplete);
|
|
121
|
+
this.dialogElement.removeEventListener('transitioncancel', onTransitionComplete);
|
|
105
122
|
this.dialogElement.close();
|
|
106
123
|
this.renderStatus = null;
|
|
107
|
-
|
|
124
|
+
this.tctClose.emit(data);
|
|
125
|
+
};
|
|
126
|
+
const onTransitionComplete = (event) => {
|
|
127
|
+
if (event.target !== this.dialogElement || event.propertyName !== 'transform')
|
|
128
|
+
return;
|
|
129
|
+
completeClose();
|
|
130
|
+
};
|
|
131
|
+
if (shouldWaitForTransition) {
|
|
132
|
+
this.dialogElement.addEventListener('transitionend', onTransitionComplete);
|
|
133
|
+
this.dialogElement.addEventListener('transitioncancel', onTransitionComplete);
|
|
134
|
+
}
|
|
135
|
+
this.renderStatus = 'is-closing';
|
|
136
|
+
if (!shouldWaitForTransition) {
|
|
137
|
+
completeClose();
|
|
138
|
+
}
|
|
108
139
|
}
|
|
109
140
|
async openModal(option) {
|
|
110
141
|
var _a;
|
|
@@ -125,18 +156,28 @@ export class Q2Modal {
|
|
|
125
156
|
document.body.style.overflow = 'hidden';
|
|
126
157
|
this.initializeModal();
|
|
127
158
|
this.renderStatus = 'is-opening';
|
|
128
|
-
this.
|
|
129
|
-
if (this.renderStatus !== 'is-opening')
|
|
130
|
-
return;
|
|
159
|
+
if (!this.hasDialogTransition()) {
|
|
131
160
|
this.renderStatus = 'is-open';
|
|
132
|
-
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const completeOpen = (event) => {
|
|
164
|
+
if (event.target !== this.dialogElement || event.propertyName !== 'transform')
|
|
165
|
+
return;
|
|
166
|
+
this.dialogElement.removeEventListener('transitionend', completeOpen);
|
|
167
|
+
this.dialogElement.removeEventListener('transitioncancel', completeOpen);
|
|
168
|
+
if (this.renderStatus === 'is-opening') {
|
|
169
|
+
this.renderStatus = 'is-open';
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
this.dialogElement.addEventListener('transitionend', completeOpen);
|
|
173
|
+
this.dialogElement.addEventListener('transitioncancel', completeOpen);
|
|
133
174
|
}
|
|
134
175
|
// #endregion
|
|
135
176
|
// #region Render Methods
|
|
136
177
|
render() {
|
|
137
178
|
const interiorClasses = `interior`;
|
|
138
179
|
const renderStatus = `${this.renderStatus || ''}`;
|
|
139
|
-
return (h("dialog", { key: '
|
|
180
|
+
return (h("dialog", { key: 'efa04c4cab9624ecc331124fbc54bba9b0b67f23', ref: el => (this.dialogElement = el), class: renderStatus, onCancel: this.onCancel, onClick: this.onClick }, h("div", { key: '81e9fa70f3c4a687fc543250d5d7c8c351968aba', class: interiorClasses }, this.title && (h("header", { key: '30eb57f4344a623ecbfa36a05f19cdbf2012cf55' }, this.title && h("h2", { key: 'a3d880ddf32ef43e2587c47152a28b0a861a60e4', class: "title" }, this.title), !!this.closable && (h("q2-btn", { key: '90ae641a244ca09a2de917331d5669ceddef24e9', class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.modal.close", "hide-label": true }, h("q2-icon", { key: '530d9b90eb044e7eb0b52cb877ee018e859014ec', type: "close" }))))), h("div", { key: 'a643bd41ea14bb6238bebaff18d608bb1116c4d5', class: "content", ref: el => (this.contentElement = el) }, this.icon && (h("div", { key: 'e5d99acc00768c6f235a7108903d9992725c08f2', class: "icon" }, h("q2-icon", { key: '97ffba3484e2bf0901a1520a7a8e8099cc03c3ba', type: this.icon }))), this.imageSrc && (h("div", { key: '5426e6276902a70be2b6cf64849580587dfa6368', class: "image" }, h("img", { key: '00bb517674151bce32307c0cae70e1cae45da7a2', src: this.imageSrc }))), hasSlotContent(this.hostElement, 'content') && h("slot", { key: '1ca0b130e835e24b3891d7ca2870105b538ba14d', name: "content" }), this.description && h("p", { key: '86d27f942231bff0754befb1abc2b1108f16f1ad', class: "description" }, this.description), this.customMarkup && (h("p", { key: 'f25747c08a3c49fe8388f1528b70490e92ee01fb', class: "customMarkup", innerHTML: sanitizeHTMLString(this.customMarkup) }))), h("footer", { key: 'd823aa857d2f003ac671d6cf93b1a0b63dabdaff' }, h("q2-action-group", { key: '31c7fa360c61861b26b26e38ffe241760f3c5cb9', "full-width": this.fullWidthButton }, h("slot", { key: '9988c2db9d3635d05c66c2b5e3ed6745a9bfaa1c', name: "action" }))))));
|
|
140
181
|
}
|
|
141
182
|
static get is() { return "q2-modal"; }
|
|
142
183
|
static get encapsulation() { return "shadow"; }
|
|
@@ -164,7 +205,7 @@ export class Q2Modal {
|
|
|
164
205
|
"optional": false,
|
|
165
206
|
"docs": {
|
|
166
207
|
"tags": [],
|
|
167
|
-
"text": "Controls visibility of the close button
|
|
208
|
+
"text": "Controls visibility of the close button and whether the modal can be dismissed with the backdrop or Escape key."
|
|
168
209
|
},
|
|
169
210
|
"getter": false,
|
|
170
211
|
"setter": false,
|
|
@@ -210,6 +251,26 @@ export class Q2Modal {
|
|
|
210
251
|
"reflect": false,
|
|
211
252
|
"attribute": "description"
|
|
212
253
|
},
|
|
254
|
+
"fullWidthButton": {
|
|
255
|
+
"type": "boolean",
|
|
256
|
+
"mutable": false,
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "boolean",
|
|
259
|
+
"resolved": "boolean",
|
|
260
|
+
"references": {}
|
|
261
|
+
},
|
|
262
|
+
"required": false,
|
|
263
|
+
"optional": false,
|
|
264
|
+
"docs": {
|
|
265
|
+
"tags": [],
|
|
266
|
+
"text": "Whether the action buttons should take up the full width of the modal footer."
|
|
267
|
+
},
|
|
268
|
+
"getter": false,
|
|
269
|
+
"setter": false,
|
|
270
|
+
"reflect": true,
|
|
271
|
+
"attribute": "full-width-button",
|
|
272
|
+
"defaultValue": "true"
|
|
273
|
+
},
|
|
213
274
|
"icon": {
|
|
214
275
|
"type": "string",
|
|
215
276
|
"mutable": false,
|
|
@@ -277,6 +338,21 @@ export class Q2Modal {
|
|
|
277
338
|
}
|
|
278
339
|
static get events() {
|
|
279
340
|
return [{
|
|
341
|
+
"method": "tctBackdropClick",
|
|
342
|
+
"name": "tctBackdropClick",
|
|
343
|
+
"bubbles": true,
|
|
344
|
+
"cancelable": true,
|
|
345
|
+
"composed": true,
|
|
346
|
+
"docs": {
|
|
347
|
+
"tags": [],
|
|
348
|
+
"text": "Emitted when the modal backdrop is clicked."
|
|
349
|
+
},
|
|
350
|
+
"complexType": {
|
|
351
|
+
"original": "undefined",
|
|
352
|
+
"resolved": "undefined",
|
|
353
|
+
"references": {}
|
|
354
|
+
}
|
|
355
|
+
}, {
|
|
280
356
|
"method": "tctClick",
|
|
281
357
|
"name": "tctClick",
|
|
282
358
|
"bubbles": true,
|
|
@@ -361,6 +437,10 @@ export class Q2Modal {
|
|
|
361
437
|
"path": "q2-tecton-common/lib/types/modal",
|
|
362
438
|
"id": "../q2-tecton-common/lib/types/modal.d.ts::ModalResponse",
|
|
363
439
|
"referenceLocation": "ModalResponse"
|
|
440
|
+
},
|
|
441
|
+
"TransitionEvent": {
|
|
442
|
+
"location": "global",
|
|
443
|
+
"id": "global::TransitionEvent"
|
|
364
444
|
}
|
|
365
445
|
},
|
|
366
446
|
"return": "Promise<void>"
|
|
@@ -388,6 +468,10 @@ export class Q2Modal {
|
|
|
388
468
|
"path": "q2-tecton-common/lib/types/modal",
|
|
389
469
|
"id": "../q2-tecton-common/lib/types/modal.d.ts::ModalOption",
|
|
390
470
|
"referenceLocation": "ModalOption"
|
|
471
|
+
},
|
|
472
|
+
"TransitionEvent": {
|
|
473
|
+
"location": "global",
|
|
474
|
+
"id": "global::TransitionEvent"
|
|
391
475
|
}
|
|
392
476
|
},
|
|
393
477
|
"return": "Promise<void>"
|
|
@@ -92,6 +92,7 @@ const focusCase = (variant, theme) => {
|
|
|
92
92
|
});
|
|
93
93
|
};
|
|
94
94
|
const BASIC_VARIANT = VARIANTS.find(v => v.name === 'basic');
|
|
95
|
+
const LONG_DESCRIPTION_VARIANT = VARIANTS.find(v => v.name === 'long-description');
|
|
95
96
|
test.describe('q2-modal — variants × themes', () => {
|
|
96
97
|
for (const variant of VARIANTS) {
|
|
97
98
|
for (const theme of THEMES) {
|
|
@@ -104,6 +105,11 @@ test.describe('q2-modal — variants × themes', () => {
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
});
|
|
108
|
+
test('q2-modal--full-width-button-false--open — standard', async ({ page }) => {
|
|
109
|
+
await setupPage(page, `${VISIBLE_HYDRATION_ANCHOR}<q2-modal title="Confirm action" description="Are you sure you want to continue with this action?" full-width-button="false">${ACTIONS}</q2-modal>`, { theme: 'standard', setupLoc: true });
|
|
110
|
+
await openModal(page);
|
|
111
|
+
await expect(page).toHaveScreenshot('q2-modal--full-width-button-false--open--standard.png');
|
|
112
|
+
});
|
|
107
113
|
test.describe(`q2-modal — scaled font size × themes`, () => {
|
|
108
114
|
if (BASIC_VARIANT) {
|
|
109
115
|
for (const theme of THEMES) {
|
|
@@ -115,3 +121,22 @@ test.describe(`q2-modal — scaled font size × themes`, () => {
|
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
});
|
|
124
|
+
test.describe('q2-modal — 400% zoom equivalent × themes', () => {
|
|
125
|
+
if (LONG_DESCRIPTION_VARIANT) {
|
|
126
|
+
for (const theme of THEMES) {
|
|
127
|
+
test(`q2-modal--long-description--400-percent-zoom — ${theme}`, async ({ page }) => {
|
|
128
|
+
await page.setViewportSize({ width: 320, height: 256 });
|
|
129
|
+
await setupPage(page, LONG_DESCRIPTION_VARIANT.html, { theme, setupLoc: true });
|
|
130
|
+
await openModal(page);
|
|
131
|
+
await page.locator('q2-modal').evaluate((el) => {
|
|
132
|
+
var _a;
|
|
133
|
+
const interior = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.interior');
|
|
134
|
+
if (!interior)
|
|
135
|
+
throw new Error('q2-modal interior not found in shadow DOM');
|
|
136
|
+
interior.scrollTop = interior.scrollHeight;
|
|
137
|
+
});
|
|
138
|
+
await expect(page).toHaveScreenshot(`q2-modal--long-description--400-percent-zoom--${theme}.png`);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
@@ -349,8 +349,8 @@ q2-popover,
|
|
|
349
349
|
q2-icon {
|
|
350
350
|
--tct-icon-stroke-primary: var(--tct-pill-icon-stroke, currentcolor);
|
|
351
351
|
--tct-icon-stroke-width: var(--tct-pill-icon-stroke-width, inherit);
|
|
352
|
-
width: var(--tct-pill-icon-size, var(--t-pill-icon-size,
|
|
353
|
-
height: var(--tct-pill-icon-size, var(--t-pill-icon-size,
|
|
352
|
+
width: var(--tct-pill-icon-size, var(--t-pill-icon-size, var(--const-px-18, 18px)));
|
|
353
|
+
height: var(--tct-pill-icon-size, var(--t-pill-icon-size, var(--const-px-18, 18px)));
|
|
354
354
|
transition-property: transform;
|
|
355
355
|
transition: var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)));
|
|
356
356
|
}
|
|
@@ -199,8 +199,9 @@ button {
|
|
|
199
199
|
}
|
|
200
200
|
:popover-open.up,
|
|
201
201
|
.show.up {
|
|
202
|
-
top:
|
|
203
|
-
bottom:
|
|
202
|
+
top: var(--comp-pop-top);
|
|
203
|
+
bottom: unset;
|
|
204
|
+
translate: 0 calc(-100% - var(--app-scale-2x, 10px));
|
|
204
205
|
}
|
|
205
206
|
:popover-open.down.left:not(.mobile),
|
|
206
207
|
.show.down.left:not(.mobile) {
|
|
@@ -117,10 +117,10 @@ export class Q2Popover {
|
|
|
117
117
|
const isScrollableIframe = isModule && isInScrollableContainer(this.hostElement);
|
|
118
118
|
if (currentDirection === 'up') {
|
|
119
119
|
if (isModule && !isScrollableIframe) {
|
|
120
|
-
containerElement.style.setProperty('--comp-pop-
|
|
120
|
+
containerElement.style.setProperty('--comp-pop-top', `${controlTop}px`);
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
containerElement.style.setProperty('--comp-pop-
|
|
123
|
+
containerElement.style.setProperty('--comp-pop-top', `${controlTop + scrollY}px`);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
if (currentDirection === 'down') {
|
|
@@ -287,7 +287,7 @@ export class Q2Popover {
|
|
|
287
287
|
this.containerElement.style.removeProperty('--comp-pop-position');
|
|
288
288
|
}
|
|
289
289
|
async determinePopDirection() {
|
|
290
|
-
var _a, _b, _c;
|
|
290
|
+
var _a, _b, _c, _d;
|
|
291
291
|
const { containerElement, controlElement, providedDirection, displayBuffer } = this;
|
|
292
292
|
if (containerElement)
|
|
293
293
|
containerElement.style.maxHeight = null;
|
|
@@ -320,9 +320,10 @@ export class Q2Popover {
|
|
|
320
320
|
: viewableSpaceBelow - displayBuffer;
|
|
321
321
|
}
|
|
322
322
|
else {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
323
|
+
const { height = window.innerHeight, offsetTop = 0 } = (_d = window.visualViewport) !== null && _d !== void 0 ? _d : {};
|
|
324
|
+
windowHeight = height;
|
|
325
|
+
maxSpaceAbove = controlTop - offsetTop - displayBuffer;
|
|
326
|
+
maxSpaceBelow = offsetTop + windowHeight - controlBottom - displayBuffer;
|
|
326
327
|
}
|
|
327
328
|
const directionWithMostSpace = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';
|
|
328
329
|
// We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)
|
|
@@ -392,7 +393,7 @@ export class Q2Popover {
|
|
|
392
393
|
containerClasses.push('animating-open');
|
|
393
394
|
if (this.animationState === 'closing')
|
|
394
395
|
containerClasses.push('animating-close');
|
|
395
|
-
return (h("div", { key: '
|
|
396
|
+
return (h("div", { key: '680ad8a90ef98d3a8c2c1f5ba2284d7cdfc3d2a6', ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer", tabIndex: -1, popover: "manual" }, h("div", { key: 'dfe4d6f72df0dfa029d9296e27ceb60a75131d83', ref: el => (this.contentElement = el), class: "content" }, h("slot", { key: '22144006d226160fe790d156255d54e24bcad8ce' }))));
|
|
396
397
|
}
|
|
397
398
|
static get is() { return "q2-popover"; }
|
|
398
399
|
static get encapsulation() { return "shadow"; }
|