@pure-ds/core 0.7.23 → 0.7.25
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/types/public/assets/js/pds-ask.d.ts +1 -2
- package/dist/types/public/assets/js/pds-ask.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds-autocomplete.d.ts +36 -25
- package/dist/types/public/assets/js/pds-autocomplete.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds-enhancers.d.ts +4 -4
- package/dist/types/public/assets/js/pds-enhancers.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds-manager.d.ts +159 -444
- package/dist/types/public/assets/js/pds-manager.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds-toast.d.ts +6 -7
- package/dist/types/public/assets/js/pds-toast.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds.d.ts +3 -4
- package/dist/types/public/assets/js/pds.d.ts.map +1 -1
- package/dist/types/public/assets/pds/components/pds-omnibox.d.ts.map +1 -1
- package/dist/types/public/assets/pds/components/pds-toaster.d.ts +3 -0
- package/dist/types/public/assets/pds/components/pds-toaster.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-enhancers.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-live.d.ts.map +1 -1
- package/package.json +1 -1
- package/packages/pds-cli/bin/templates/bootstrap/pds.config.js +14 -4
- package/public/assets/js/app.js +1 -1
- package/public/assets/js/pds-enhancers.js +1 -1
- package/public/assets/js/pds-manager.js +26 -26
- package/public/assets/pds/components/pds-live-edit.js +3 -8
- package/public/assets/pds/components/pds-omnibox.js +37 -1
- package/public/assets/pds/components/pds-toaster.js +35 -1
- package/public/assets/pds/core/pds-enhancers.js +1 -1
- package/public/assets/pds/core/pds-manager.js +26 -26
- package/src/js/pds-core/pds-enhancers.js +53 -8
- package/src/js/pds-core/pds-generator.js +1 -1
- package/src/js/pds-core/pds-live.js +5 -0
|
@@ -181,6 +181,41 @@ function enhanceDropdown(elem) {
|
|
|
181
181
|
menu.style.removeProperty("overflow");
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
+
const getContainingAncestor = (node) => {
|
|
185
|
+
if (!node) return null;
|
|
186
|
+
if (node.parentElement) return node.parentElement;
|
|
187
|
+
const root = node.getRootNode?.();
|
|
188
|
+
return root instanceof ShadowRoot ? root.host : null;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const hasNonViewportFixedContainingBlock = () => {
|
|
192
|
+
let current = getContainingAncestor(menu);
|
|
193
|
+
while (current && current !== document.documentElement) {
|
|
194
|
+
const style = getComputedStyle(current);
|
|
195
|
+
const contain = style.contain || "";
|
|
196
|
+
const willChange = style.willChange || "";
|
|
197
|
+
const createsContainingBlock =
|
|
198
|
+
style.transform !== "none" ||
|
|
199
|
+
style.perspective !== "none" ||
|
|
200
|
+
style.filter !== "none" ||
|
|
201
|
+
style.backdropFilter !== "none" ||
|
|
202
|
+
contain.includes("paint") ||
|
|
203
|
+
contain.includes("layout") ||
|
|
204
|
+
contain.includes("strict") ||
|
|
205
|
+
contain.includes("content") ||
|
|
206
|
+
willChange.includes("transform") ||
|
|
207
|
+
willChange.includes("perspective") ||
|
|
208
|
+
willChange.includes("filter");
|
|
209
|
+
|
|
210
|
+
if (createsContainingBlock) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
current = getContainingAncestor(current);
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
};
|
|
218
|
+
|
|
184
219
|
const reattachFloatingMenu = () => {
|
|
185
220
|
if (menu.getAttribute("aria-hidden") !== "false") return;
|
|
186
221
|
clearFloatingMenuPosition();
|
|
@@ -193,6 +228,10 @@ function enhanceDropdown(elem) {
|
|
|
193
228
|
|
|
194
229
|
const positionFloatingMenu = () => {
|
|
195
230
|
if (menu.getAttribute("aria-hidden") !== "false") return;
|
|
231
|
+
if (hasNonViewportFixedContainingBlock()) {
|
|
232
|
+
clearFloatingMenuPosition();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
196
235
|
const anchorRect = (trigger || elem).getBoundingClientRect();
|
|
197
236
|
const viewport = window.visualViewport;
|
|
198
237
|
const viewportWidth =
|
|
@@ -267,21 +306,22 @@ function enhanceDropdown(elem) {
|
|
|
267
306
|
};
|
|
268
307
|
|
|
269
308
|
let configChangedHandler = null;
|
|
309
|
+
let configRepositionFrame = null;
|
|
270
310
|
const bindConfigChanged = () => {
|
|
271
311
|
if (configChangedHandler || typeof document === "undefined") return;
|
|
272
312
|
configChangedHandler = () => {
|
|
273
313
|
if (menu.getAttribute("aria-hidden") !== "false") return;
|
|
274
314
|
elem.dataset.dropdownDirection = resolveDirection();
|
|
275
315
|
elem.dataset.dropdownAlign = resolveAlign();
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
316
|
+
|
|
317
|
+
if (configRepositionFrame !== null) {
|
|
318
|
+
cancelAnimationFrame(configRepositionFrame);
|
|
319
|
+
}
|
|
320
|
+
configRepositionFrame = requestAnimationFrame(() => {
|
|
321
|
+
configRepositionFrame = null;
|
|
282
322
|
if (menu.getAttribute("aria-hidden") !== "false") return;
|
|
283
|
-
|
|
284
|
-
}
|
|
323
|
+
positionFloatingMenu();
|
|
324
|
+
});
|
|
285
325
|
};
|
|
286
326
|
document.addEventListener("pds:config-changed", configChangedHandler);
|
|
287
327
|
};
|
|
@@ -290,6 +330,10 @@ function enhanceDropdown(elem) {
|
|
|
290
330
|
if (!configChangedHandler || typeof document === "undefined") return;
|
|
291
331
|
document.removeEventListener("pds:config-changed", configChangedHandler);
|
|
292
332
|
configChangedHandler = null;
|
|
333
|
+
if (configRepositionFrame !== null) {
|
|
334
|
+
cancelAnimationFrame(configRepositionFrame);
|
|
335
|
+
configRepositionFrame = null;
|
|
336
|
+
}
|
|
293
337
|
};
|
|
294
338
|
|
|
295
339
|
// Store click handler reference for cleanup
|
|
@@ -401,6 +445,7 @@ function enhanceToggle(elem) {
|
|
|
401
445
|
if (checkbox.disabled) return;
|
|
402
446
|
checkbox.checked = !checkbox.checked;
|
|
403
447
|
updateAria();
|
|
448
|
+
checkbox.dispatchEvent(new Event("input", { bubbles: true }));
|
|
404
449
|
checkbox.dispatchEvent(new Event("change", { bubbles: true }));
|
|
405
450
|
};
|
|
406
451
|
|
|
@@ -3313,7 +3313,7 @@ tbody {
|
|
|
3313
3313
|
display: flex;
|
|
3314
3314
|
align-items: center;
|
|
3315
3315
|
gap: var(--spacing-2);
|
|
3316
|
-
border-radius:
|
|
3316
|
+
border-radius: var(--radius-md);
|
|
3317
3317
|
transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
|
|
3318
3318
|
|
|
3319
3319
|
&::-webkit-details-marker {
|
|
@@ -715,6 +715,11 @@ async function __attachLiveAPIs(PDS, { applyResolvedTheme, setupSystemListenerIf
|
|
|
715
715
|
PDS.buildConfigFormSchema = buildDesignConfigFormSchema;
|
|
716
716
|
PDS.getConfigEditorMetadata = getDesignConfigEditorMetadata;
|
|
717
717
|
PDS.enhancerMetadata = defaultPDSEnhancerMetadata;
|
|
718
|
+
if (!Array.isArray(PDS.defaultEnhancers) || PDS.defaultEnhancers.length === 0) {
|
|
719
|
+
PDS.defaultEnhancers = Array.isArray(defaultPDSEnhancers)
|
|
720
|
+
? defaultPDSEnhancers
|
|
721
|
+
: [];
|
|
722
|
+
}
|
|
718
723
|
PDS.applyStyles = function(generator) {
|
|
719
724
|
const targetGenerator = generator || Generator.instance;
|
|
720
725
|
applyStyles(targetGenerator);
|