@supersoniks/concorde 3.1.72 → 3.1.74
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-infos.json +1 -1
- package/concorde-core.bundle.js +216 -201
- package/concorde-core.es.js +533 -519
- package/dist/concorde-core.bundle.js +216 -201
- package/dist/concorde-core.es.js +533 -519
- package/package.json +1 -1
- package/src/core/components/ui/modal/modal.ts +15 -0
- package/src/core/components/ui/pop/pop.ts +6 -1
- package/src/core/utils/HTML.ts +12 -11
package/package.json
CHANGED
|
@@ -143,6 +143,21 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
143
143
|
transform: translateX(-50%) translateY(-50%);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
/* Solution améliorée pour les navigateurs supportant round() */
|
|
147
|
+
@supports (transform: translateX(round(-50%, 1px))) {
|
|
148
|
+
.modal-wrapper {
|
|
149
|
+
transform: translateX(round(-50%, 1px)) translateY(round(-50%, 1px));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([fullScreen]) .modal-wrapper {
|
|
154
|
+
top: 0;
|
|
155
|
+
left: 0;
|
|
156
|
+
right: 0;
|
|
157
|
+
bottom: 0;
|
|
158
|
+
transform: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
146
161
|
.modal {
|
|
147
162
|
top: 50%;
|
|
148
163
|
bottom: auto;
|
|
@@ -125,6 +125,10 @@ export class Pop extends LitElement {
|
|
|
125
125
|
this.triggerElement.focus();
|
|
126
126
|
this.triggerElement = null;
|
|
127
127
|
}
|
|
128
|
+
Object.assign(this.popContent.style, {
|
|
129
|
+
left: `${this.lastContentX}px`,
|
|
130
|
+
top: `${this.lastContentY}px`,
|
|
131
|
+
});
|
|
128
132
|
this.dispatchEvent(new CustomEvent("hide"));
|
|
129
133
|
}
|
|
130
134
|
|
|
@@ -220,7 +224,7 @@ export class Pop extends LitElement {
|
|
|
220
224
|
const placementSplit = placement.split(" ");
|
|
221
225
|
const placementBase = placementSplit[0];
|
|
222
226
|
let placementSec = placementSplit[1];
|
|
223
|
-
|
|
227
|
+
|
|
224
228
|
const padding = 5;
|
|
225
229
|
const thisRect = this.getBoundingClientRect();
|
|
226
230
|
|
|
@@ -244,6 +248,7 @@ export class Pop extends LitElement {
|
|
|
244
248
|
const y0 = thisRect.top;
|
|
245
249
|
let x = x0,
|
|
246
250
|
y = y0;
|
|
251
|
+
let contentRect = this.popContent?.getBoundingClientRect();
|
|
247
252
|
const yTop = y0 - contentRect.height;
|
|
248
253
|
const xLeft = x0 - contentRect.width;
|
|
249
254
|
const xRight = x0 + thisRect.width;
|
package/src/core/utils/HTML.ts
CHANGED
|
@@ -43,12 +43,13 @@ class HTML {
|
|
|
43
43
|
if (htmlNode.nodeType === 1) {
|
|
44
44
|
const style = window.getComputedStyle(htmlNode);
|
|
45
45
|
if (
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
style?.overflowY === "auto" ||
|
|
47
|
+
style?.overflowY === "scroll" ||
|
|
48
48
|
style?.overflowY === "hidden" ||
|
|
49
|
+
style?.overflowX === "auto" ||
|
|
50
|
+
style?.overflowX === "scroll" ||
|
|
49
51
|
style?.overflowX === "hidden"
|
|
50
52
|
) {
|
|
51
|
-
|
|
52
53
|
return node;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -175,25 +176,25 @@ class HTML {
|
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
export default HTML;
|
|
178
|
-
export const detecHTMLLanguageChange = (handler:()=>void) => {
|
|
179
|
+
export const detecHTMLLanguageChange = (handler: () => void) => {
|
|
179
180
|
// Select the <html> element
|
|
180
181
|
const htmlElement = document.documentElement;
|
|
181
182
|
|
|
182
183
|
// Create a new MutationObserver instance
|
|
183
184
|
const observer = new MutationObserver((mutationsList) => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
185
|
+
for (let mutation of mutationsList) {
|
|
186
|
+
if (mutation.type === "attributes" && mutation.attributeName === "lang") {
|
|
187
|
+
handler();
|
|
188
188
|
}
|
|
189
|
+
}
|
|
189
190
|
});
|
|
190
191
|
|
|
191
192
|
// Observer configuration: watch for changes to attributes
|
|
192
193
|
const config = {
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
attributes: true, // Watch for attribute changes
|
|
195
|
+
attributeFilter: ["lang"], // Only watch for changes to the lang attribute
|
|
195
196
|
};
|
|
196
197
|
|
|
197
198
|
// Start observing the <html> element for changes
|
|
198
199
|
observer.observe(htmlElement, config);
|
|
199
|
-
}
|
|
200
|
+
};
|