@shoper/phoenix_design_system 1.18.11-2 → 1.18.11-4
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/build/cjs/packages/phoenix/src/components/accordion/accordion_content.js +77 -39
- package/build/cjs/packages/phoenix/src/components/accordion/accordion_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/accordion/accordion_content.d.ts +7 -0
- package/build/esm/packages/phoenix/src/components/accordion/accordion_content.js +77 -39
- package/build/esm/packages/phoenix/src/components/accordion/accordion_content.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,6 +23,8 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
23
23
|
this._mutationObserver = null;
|
|
24
24
|
this._resizeObserver = null;
|
|
25
25
|
this._resizeObserverDebounceTimer = null;
|
|
26
|
+
this._lastKnownHeight = 0;
|
|
27
|
+
this._settlementCheckTimer = null;
|
|
26
28
|
this._handleResize = () => {
|
|
27
29
|
if (this._resizeDebounceTimer !== null) {
|
|
28
30
|
window.cancelAnimationFrame(this._resizeDebounceTimer);
|
|
@@ -50,60 +52,46 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
50
52
|
window.clearTimeout(this._mutationDebounceTimer);
|
|
51
53
|
}
|
|
52
54
|
this._mutationDebounceTimer = window.setTimeout(() => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const previousHeight = this.style.height;
|
|
57
|
-
// Temporarily set to auto to measure
|
|
58
|
-
this.style.display = 'block';
|
|
59
|
-
this.style.height = 'auto';
|
|
60
|
-
// Read layout (batched read phase)
|
|
61
|
-
const newHeight = this.getBoundingClientRect().height;
|
|
62
|
-
// Batch layout writes in next RAF
|
|
63
|
-
requestAnimationFrame(() => {
|
|
64
|
-
// Update cached height
|
|
65
|
-
if (newHeight !== 0 || this.children.length === 0) {
|
|
66
|
-
this._originalHeight = `${newHeight}px`;
|
|
67
|
-
}
|
|
68
|
-
// Restore and apply correct height
|
|
69
|
-
this.style.display = previousDisplay;
|
|
70
|
-
if (this.hidden) {
|
|
71
|
-
this.style.height = '0px';
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.style.height = this._originalHeight;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
55
|
+
this._forceHeightRecalculation();
|
|
56
|
+
// Re-setup image listeners for any newly added images
|
|
57
|
+
this._setupImageLoadListeners();
|
|
78
58
|
}, MUTATION_DEBOUNCE_MS);
|
|
79
59
|
};
|
|
80
60
|
this._handleContentResize = (entries) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
// AGGRESSIVE APPROACH: No debouncing, immediate response
|
|
62
|
+
const entry = entries[0];
|
|
63
|
+
if (!entry)
|
|
64
|
+
return;
|
|
65
|
+
requestAnimationFrame(() => {
|
|
85
66
|
var _a, _b, _c;
|
|
86
|
-
// Get
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const newHeight = (_c = (_b = (_a = entry.borderBoxSize) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.blockSize) !== null && _c !== void 0 ? _c : entry.contentRect.height;
|
|
92
|
-
// Batch style writes in RAF
|
|
67
|
+
// Get height from ResizeObserver first
|
|
68
|
+
let newHeight = (_c = (_b = (_a = entry.borderBoxSize) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.blockSize) !== null && _c !== void 0 ? _c : entry.contentRect.height;
|
|
69
|
+
// FALLBACK: If the element might be constrained, measure directly
|
|
70
|
+
const previousHeight = this.style.height;
|
|
71
|
+
this.style.height = 'auto';
|
|
93
72
|
requestAnimationFrame(() => {
|
|
94
|
-
//
|
|
73
|
+
// Double-check with getBoundingClientRect
|
|
74
|
+
const measuredHeight = this.getBoundingClientRect().height;
|
|
75
|
+
// Use the larger of the two measurements
|
|
76
|
+
newHeight = Math.max(newHeight, measuredHeight);
|
|
77
|
+
// Track if height is still changing
|
|
78
|
+
const heightChanged = Math.abs(newHeight - this._lastKnownHeight) > 1;
|
|
79
|
+
this._lastKnownHeight = newHeight;
|
|
95
80
|
if (newHeight !== 0 || this.children.length === 0) {
|
|
96
81
|
this._originalHeight = `${newHeight}px`;
|
|
97
82
|
}
|
|
98
|
-
// Apply correct height based on state
|
|
99
83
|
if (this.hidden) {
|
|
100
84
|
this.style.height = '0px';
|
|
101
85
|
}
|
|
102
86
|
else {
|
|
103
87
|
this.style.height = this._originalHeight;
|
|
104
88
|
}
|
|
89
|
+
// If height is still changing, schedule a settlement check
|
|
90
|
+
if (heightChanged) {
|
|
91
|
+
this._scheduleSettlementCheck();
|
|
92
|
+
}
|
|
105
93
|
});
|
|
106
|
-
}
|
|
94
|
+
});
|
|
107
95
|
};
|
|
108
96
|
this._setOriginalHeightValue = () => {
|
|
109
97
|
const newHeight = this.getBoundingClientRect().height;
|
|
@@ -133,6 +121,7 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
133
121
|
};
|
|
134
122
|
this.setAttribute('role', 'region');
|
|
135
123
|
this._boundHandleTransitionEnd = this._handleTransitionEnd.bind(this);
|
|
124
|
+
this._boundHandleImageLoad = this._handleImageLoad.bind(this);
|
|
136
125
|
}
|
|
137
126
|
connectedCallback() {
|
|
138
127
|
super.connectedCallback();
|
|
@@ -157,6 +146,46 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
157
146
|
this._mutationObserver.observe(this, { childList: true, subtree: true });
|
|
158
147
|
this._resizeObserver = new ResizeObserver(this._handleContentResize);
|
|
159
148
|
this._resizeObserver.observe(this);
|
|
149
|
+
// Listen for image loads
|
|
150
|
+
this._setupImageLoadListeners();
|
|
151
|
+
}
|
|
152
|
+
_scheduleSettlementCheck() {
|
|
153
|
+
if (this._settlementCheckTimer !== null) {
|
|
154
|
+
window.clearTimeout(this._settlementCheckTimer);
|
|
155
|
+
}
|
|
156
|
+
// Check again after a delay to see if we've stabilized
|
|
157
|
+
this._settlementCheckTimer = window.setTimeout(() => {
|
|
158
|
+
this._forceHeightRecalculation();
|
|
159
|
+
}, 300);
|
|
160
|
+
}
|
|
161
|
+
_forceHeightRecalculation() {
|
|
162
|
+
if (this.hidden)
|
|
163
|
+
return;
|
|
164
|
+
requestAnimationFrame(() => {
|
|
165
|
+
this.style.height = 'auto';
|
|
166
|
+
requestAnimationFrame(() => {
|
|
167
|
+
const finalHeight = this.getBoundingClientRect().height;
|
|
168
|
+
if (finalHeight !== 0 || this.children.length === 0) {
|
|
169
|
+
this._originalHeight = `${finalHeight}px`;
|
|
170
|
+
this._lastKnownHeight = finalHeight;
|
|
171
|
+
}
|
|
172
|
+
this.style.height = this._originalHeight;
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
_setupImageLoadListeners() {
|
|
177
|
+
// Listen to all current and future images
|
|
178
|
+
const images = this.querySelectorAll('img');
|
|
179
|
+
images.forEach((img) => {
|
|
180
|
+
if (!img.complete) {
|
|
181
|
+
img.addEventListener('load', this._boundHandleImageLoad, { once: true });
|
|
182
|
+
img.addEventListener('error', this._boundHandleImageLoad, { once: true });
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
_handleImageLoad() {
|
|
187
|
+
// When an image loads, force recalculation
|
|
188
|
+
this._forceHeightRecalculation();
|
|
160
189
|
}
|
|
161
190
|
_setHeight(height) {
|
|
162
191
|
this.style.height = height;
|
|
@@ -171,6 +200,12 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
171
200
|
(_a = this._accordionGroupProps) === null || _a === void 0 ? void 0 : _a.unsubscribe(this._accordionGroupPropsObserver);
|
|
172
201
|
(_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
173
202
|
(_c = this._resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
203
|
+
// Remove image listeners
|
|
204
|
+
const images = this.querySelectorAll('img');
|
|
205
|
+
images.forEach((img) => {
|
|
206
|
+
img.removeEventListener('load', this._boundHandleImageLoad);
|
|
207
|
+
img.removeEventListener('error', this._boundHandleImageLoad);
|
|
208
|
+
});
|
|
174
209
|
window.removeEventListener('resize', this._handleResize);
|
|
175
210
|
this.removeEventListener('transitionend', this._boundHandleTransitionEnd);
|
|
176
211
|
if (this._resizeDebounceTimer !== null) {
|
|
@@ -182,6 +217,9 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
182
217
|
if (this._resizeObserverDebounceTimer !== null) {
|
|
183
218
|
window.clearTimeout(this._resizeObserverDebounceTimer);
|
|
184
219
|
}
|
|
220
|
+
if (this._settlementCheckTimer !== null) {
|
|
221
|
+
window.clearTimeout(this._settlementCheckTimer);
|
|
222
|
+
}
|
|
185
223
|
}
|
|
186
224
|
};
|
|
187
225
|
tslib_es6.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -12,7 +12,10 @@ export declare class HAccordionContent extends PhoenixLightLitElement {
|
|
|
12
12
|
private _mutationObserver;
|
|
13
13
|
private _resizeObserver;
|
|
14
14
|
private _resizeObserverDebounceTimer;
|
|
15
|
+
private _lastKnownHeight;
|
|
16
|
+
private _settlementCheckTimer;
|
|
15
17
|
private _boundHandleTransitionEnd;
|
|
18
|
+
private _boundHandleImageLoad;
|
|
16
19
|
constructor();
|
|
17
20
|
connectedCallback(): void;
|
|
18
21
|
firstUpdated(props: PropertyValues): void;
|
|
@@ -21,6 +24,10 @@ export declare class HAccordionContent extends PhoenixLightLitElement {
|
|
|
21
24
|
private _subscribeObserver;
|
|
22
25
|
private _handleMutation;
|
|
23
26
|
private _handleContentResize;
|
|
27
|
+
private _scheduleSettlementCheck;
|
|
28
|
+
private _forceHeightRecalculation;
|
|
29
|
+
private _setupImageLoadListeners;
|
|
30
|
+
private _handleImageLoad;
|
|
24
31
|
private _setOriginalHeightValue;
|
|
25
32
|
private _expand;
|
|
26
33
|
private _handleTransitionEnd;
|
|
@@ -19,6 +19,8 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
|
|
|
19
19
|
this._mutationObserver = null;
|
|
20
20
|
this._resizeObserver = null;
|
|
21
21
|
this._resizeObserverDebounceTimer = null;
|
|
22
|
+
this._lastKnownHeight = 0;
|
|
23
|
+
this._settlementCheckTimer = null;
|
|
22
24
|
this._handleResize = () => {
|
|
23
25
|
if (this._resizeDebounceTimer !== null) {
|
|
24
26
|
window.cancelAnimationFrame(this._resizeDebounceTimer);
|
|
@@ -46,60 +48,46 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
|
|
|
46
48
|
window.clearTimeout(this._mutationDebounceTimer);
|
|
47
49
|
}
|
|
48
50
|
this._mutationDebounceTimer = window.setTimeout(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const previousHeight = this.style.height;
|
|
53
|
-
// Temporarily set to auto to measure
|
|
54
|
-
this.style.display = 'block';
|
|
55
|
-
this.style.height = 'auto';
|
|
56
|
-
// Read layout (batched read phase)
|
|
57
|
-
const newHeight = this.getBoundingClientRect().height;
|
|
58
|
-
// Batch layout writes in next RAF
|
|
59
|
-
requestAnimationFrame(() => {
|
|
60
|
-
// Update cached height
|
|
61
|
-
if (newHeight !== 0 || this.children.length === 0) {
|
|
62
|
-
this._originalHeight = `${newHeight}px`;
|
|
63
|
-
}
|
|
64
|
-
// Restore and apply correct height
|
|
65
|
-
this.style.display = previousDisplay;
|
|
66
|
-
if (this.hidden) {
|
|
67
|
-
this.style.height = '0px';
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
this.style.height = this._originalHeight;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
51
|
+
this._forceHeightRecalculation();
|
|
52
|
+
// Re-setup image listeners for any newly added images
|
|
53
|
+
this._setupImageLoadListeners();
|
|
74
54
|
}, MUTATION_DEBOUNCE_MS);
|
|
75
55
|
};
|
|
76
56
|
this._handleContentResize = (entries) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
57
|
+
// AGGRESSIVE APPROACH: No debouncing, immediate response
|
|
58
|
+
const entry = entries[0];
|
|
59
|
+
if (!entry)
|
|
60
|
+
return;
|
|
61
|
+
requestAnimationFrame(() => {
|
|
81
62
|
var _a, _b, _c;
|
|
82
|
-
// Get
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const newHeight = (_c = (_b = (_a = entry.borderBoxSize) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.blockSize) !== null && _c !== void 0 ? _c : entry.contentRect.height;
|
|
88
|
-
// Batch style writes in RAF
|
|
63
|
+
// Get height from ResizeObserver first
|
|
64
|
+
let newHeight = (_c = (_b = (_a = entry.borderBoxSize) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.blockSize) !== null && _c !== void 0 ? _c : entry.contentRect.height;
|
|
65
|
+
// FALLBACK: If the element might be constrained, measure directly
|
|
66
|
+
const previousHeight = this.style.height;
|
|
67
|
+
this.style.height = 'auto';
|
|
89
68
|
requestAnimationFrame(() => {
|
|
90
|
-
//
|
|
69
|
+
// Double-check with getBoundingClientRect
|
|
70
|
+
const measuredHeight = this.getBoundingClientRect().height;
|
|
71
|
+
// Use the larger of the two measurements
|
|
72
|
+
newHeight = Math.max(newHeight, measuredHeight);
|
|
73
|
+
// Track if height is still changing
|
|
74
|
+
const heightChanged = Math.abs(newHeight - this._lastKnownHeight) > 1;
|
|
75
|
+
this._lastKnownHeight = newHeight;
|
|
91
76
|
if (newHeight !== 0 || this.children.length === 0) {
|
|
92
77
|
this._originalHeight = `${newHeight}px`;
|
|
93
78
|
}
|
|
94
|
-
// Apply correct height based on state
|
|
95
79
|
if (this.hidden) {
|
|
96
80
|
this.style.height = '0px';
|
|
97
81
|
}
|
|
98
82
|
else {
|
|
99
83
|
this.style.height = this._originalHeight;
|
|
100
84
|
}
|
|
85
|
+
// If height is still changing, schedule a settlement check
|
|
86
|
+
if (heightChanged) {
|
|
87
|
+
this._scheduleSettlementCheck();
|
|
88
|
+
}
|
|
101
89
|
});
|
|
102
|
-
}
|
|
90
|
+
});
|
|
103
91
|
};
|
|
104
92
|
this._setOriginalHeightValue = () => {
|
|
105
93
|
const newHeight = this.getBoundingClientRect().height;
|
|
@@ -129,6 +117,7 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
|
|
|
129
117
|
};
|
|
130
118
|
this.setAttribute('role', 'region');
|
|
131
119
|
this._boundHandleTransitionEnd = this._handleTransitionEnd.bind(this);
|
|
120
|
+
this._boundHandleImageLoad = this._handleImageLoad.bind(this);
|
|
132
121
|
}
|
|
133
122
|
connectedCallback() {
|
|
134
123
|
super.connectedCallback();
|
|
@@ -153,6 +142,46 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
|
|
|
153
142
|
this._mutationObserver.observe(this, { childList: true, subtree: true });
|
|
154
143
|
this._resizeObserver = new ResizeObserver(this._handleContentResize);
|
|
155
144
|
this._resizeObserver.observe(this);
|
|
145
|
+
// Listen for image loads
|
|
146
|
+
this._setupImageLoadListeners();
|
|
147
|
+
}
|
|
148
|
+
_scheduleSettlementCheck() {
|
|
149
|
+
if (this._settlementCheckTimer !== null) {
|
|
150
|
+
window.clearTimeout(this._settlementCheckTimer);
|
|
151
|
+
}
|
|
152
|
+
// Check again after a delay to see if we've stabilized
|
|
153
|
+
this._settlementCheckTimer = window.setTimeout(() => {
|
|
154
|
+
this._forceHeightRecalculation();
|
|
155
|
+
}, 300);
|
|
156
|
+
}
|
|
157
|
+
_forceHeightRecalculation() {
|
|
158
|
+
if (this.hidden)
|
|
159
|
+
return;
|
|
160
|
+
requestAnimationFrame(() => {
|
|
161
|
+
this.style.height = 'auto';
|
|
162
|
+
requestAnimationFrame(() => {
|
|
163
|
+
const finalHeight = this.getBoundingClientRect().height;
|
|
164
|
+
if (finalHeight !== 0 || this.children.length === 0) {
|
|
165
|
+
this._originalHeight = `${finalHeight}px`;
|
|
166
|
+
this._lastKnownHeight = finalHeight;
|
|
167
|
+
}
|
|
168
|
+
this.style.height = this._originalHeight;
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
_setupImageLoadListeners() {
|
|
173
|
+
// Listen to all current and future images
|
|
174
|
+
const images = this.querySelectorAll('img');
|
|
175
|
+
images.forEach((img) => {
|
|
176
|
+
if (!img.complete) {
|
|
177
|
+
img.addEventListener('load', this._boundHandleImageLoad, { once: true });
|
|
178
|
+
img.addEventListener('error', this._boundHandleImageLoad, { once: true });
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
_handleImageLoad() {
|
|
183
|
+
// When an image loads, force recalculation
|
|
184
|
+
this._forceHeightRecalculation();
|
|
156
185
|
}
|
|
157
186
|
_setHeight(height) {
|
|
158
187
|
this.style.height = height;
|
|
@@ -167,6 +196,12 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
|
|
|
167
196
|
(_a = this._accordionGroupProps) === null || _a === void 0 ? void 0 : _a.unsubscribe(this._accordionGroupPropsObserver);
|
|
168
197
|
(_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
169
198
|
(_c = this._resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
199
|
+
// Remove image listeners
|
|
200
|
+
const images = this.querySelectorAll('img');
|
|
201
|
+
images.forEach((img) => {
|
|
202
|
+
img.removeEventListener('load', this._boundHandleImageLoad);
|
|
203
|
+
img.removeEventListener('error', this._boundHandleImageLoad);
|
|
204
|
+
});
|
|
170
205
|
window.removeEventListener('resize', this._handleResize);
|
|
171
206
|
this.removeEventListener('transitionend', this._boundHandleTransitionEnd);
|
|
172
207
|
if (this._resizeDebounceTimer !== null) {
|
|
@@ -178,6 +213,9 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
|
|
|
178
213
|
if (this._resizeObserverDebounceTimer !== null) {
|
|
179
214
|
window.clearTimeout(this._resizeObserverDebounceTimer);
|
|
180
215
|
}
|
|
216
|
+
if (this._settlementCheckTimer !== null) {
|
|
217
|
+
window.clearTimeout(this._settlementCheckTimer);
|
|
218
|
+
}
|
|
181
219
|
}
|
|
182
220
|
};
|
|
183
221
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|