@ctrliq/quantic-components 1.85.0 → 1.85.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/alert/alert.js +2 -1
- package/dist/alert/index.stories.d.ts +7 -0
- package/dist/alert/index.stories.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/meta/index.js.map +1 -1
- package/dist/meta.json +1 -1
- package/dist/quantic-components.js +13 -4
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +1846 -1845
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/register.js.map +1 -1
- package/dist/shared/auto-hide-empty-slots.mixin.d.ts +0 -35
- package/dist/shared/auto-hide-empty-slots.mixin.js +11 -3
- package/dist/shared/auto-hide-empty-slots.mixin.test.d.ts +1 -0
- package/dist/shared/auto-hide-empty-slots.mixin.test.js +57 -0
- package/dist/types/alert/index.stories.d.ts +7 -0
- package/dist/types/shared/auto-hide-empty-slots.mixin.d.ts +0 -35
- package/dist/types/shared/auto-hide-empty-slots.mixin.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/meta.json
CHANGED
|
@@ -322,13 +322,20 @@
|
|
|
322
322
|
*
|
|
323
323
|
* Chrome doesn't re-evaluate :has() in shadow DOM when light-DOM children
|
|
324
324
|
* arrive asynchronously (e.g. React CSR). A capture listener on the shadow
|
|
325
|
-
* root intercepts all slotchange events internally and
|
|
326
|
-
*
|
|
325
|
+
* root intercepts all slotchange events internally and marks filled slots with
|
|
326
|
+
* `data-slot-filled`, no wiring required in component templates.
|
|
327
|
+
*
|
|
328
|
+
* That reveal has to be a rule inside `quantic-slot-visibility`, not an inline
|
|
329
|
+
* style. Inline declarations sit in the implicit unlayered layer, which the
|
|
330
|
+
* cascade orders after every explicit layer, so an inline
|
|
331
|
+
* `display: revert-layer` reverts to the `display: none` above rather than
|
|
332
|
+
* past it.
|
|
327
333
|
*
|
|
328
334
|
* @example
|
|
329
335
|
* class MyElement extends AutoHideEmptySlotsMixin(QuanticElement, ['header', 'footer']) {}
|
|
330
336
|
* class Toast extends AutoHideEmptySlotsMixin(QuanticElement, ['title', '', 'action']) {}
|
|
331
337
|
*/
|
|
338
|
+
const FILLED_ATTRIBUTE = 'data-slot-filled';
|
|
332
339
|
const AutoHideEmptySlotsMixin = (superClass, slots = []) => {
|
|
333
340
|
var _AutoHideEmptySlotsClass_instances, _AutoHideEmptySlotsClass_slotListenerAttached, _AutoHideEmptySlotsClass_isMeaningful, _AutoHideEmptySlotsClass_onSlotChange, _AutoHideEmptySlotsClass_attachSlotListener, _AutoHideEmptySlotsClass_detachSlotListener;
|
|
334
341
|
if (slots.length === 0)
|
|
@@ -346,6 +353,7 @@
|
|
|
346
353
|
`${sel} { display: none; }`,
|
|
347
354
|
whenSlotPresent(name, r$6(`${sel} { display: revert-layer; }`))
|
|
348
355
|
.cssText,
|
|
356
|
+
`${sel}[${FILLED_ATTRIBUTE}] { display: revert-layer; }`,
|
|
349
357
|
].join(' ');
|
|
350
358
|
})
|
|
351
359
|
.join(' ');
|
|
@@ -367,7 +375,7 @@
|
|
|
367
375
|
const hasContent = slot
|
|
368
376
|
.assignedNodes({ flatten: true })
|
|
369
377
|
.some(__classPrivateFieldGet(this, _AutoHideEmptySlotsClass_isMeaningful, "f"));
|
|
370
|
-
slot.
|
|
378
|
+
slot.toggleAttribute(FILLED_ATTRIBUTE, hasContent);
|
|
371
379
|
});
|
|
372
380
|
}
|
|
373
381
|
static finalizeStyles(styles) {
|
|
@@ -2956,9 +2964,10 @@
|
|
|
2956
2964
|
|
|
2957
2965
|
.icon {
|
|
2958
2966
|
display: inline-flex;
|
|
2967
|
+
align-items: center;
|
|
2959
2968
|
flex-shrink: 0;
|
|
2969
|
+
height: var(--quantic-line-height-body-sm);
|
|
2960
2970
|
color: var(--quantic-component-alert-icon-color);
|
|
2961
|
-
line-height: 0;
|
|
2962
2971
|
}
|
|
2963
2972
|
|
|
2964
2973
|
.content {
|