@ctrliq/quantic-components 1.67.1 → 1.67.3
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.d.ts +1 -1
- package/dist/alert/alert.js +4 -12
- package/dist/card/card-title.component.d.ts +1 -1
- package/dist/card/card-title.component.js +4 -12
- package/dist/card/card.component.d.ts +2 -1
- package/dist/card/card.component.js +9 -10
- package/dist/dialog/dialog-title.d.ts +1 -1
- package/dist/dialog/dialog-title.js +3 -11
- package/dist/dialog/dialog.d.ts +1 -1
- package/dist/dialog/dialog.js +4 -13
- package/dist/dropdown-menu/group.component.d.ts +2 -1
- package/dist/dropdown-menu/group.component.js +9 -3
- package/dist/field/field.component.d.ts +4 -3
- package/dist/field/field.component.js +59 -35
- package/dist/field/render-as-field.hoc.d.ts +1 -1
- package/dist/field/render-as-field.hoc.js +21 -8
- package/dist/index.js.map +1 -1
- package/dist/inline-edit/index.d.ts +2 -3
- package/dist/inline-edit/index.js +16 -8
- package/dist/layout/layout.component.d.ts +5 -4
- package/dist/layout/layout.component.js +37 -24
- package/dist/layout/sidebar.component.d.ts +1 -1
- package/dist/layout/sidebar.component.js +5 -5
- package/dist/meta/index.js.map +1 -1
- package/dist/option-card/option-card.component.d.ts +1 -1
- package/dist/option-card/option-card.component.js +4 -12
- package/dist/panel/panel-header.component.d.ts +1 -1
- package/dist/panel/panel-header.component.js +4 -16
- package/dist/panel/panel.component.d.ts +1 -1
- package/dist/panel/panel.component.js +4 -12
- package/dist/popover/popover-popup.d.ts +1 -1
- package/dist/popover/popover-popup.js +3 -3
- package/dist/popover/popover.d.ts +2 -2
- package/dist/quantic-components.js +260 -316
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +1918 -1983
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/shared/auto-hide-empty-slots.mixin.d.ts +19 -20
- package/dist/shared/auto-hide-empty-slots.mixin.js +43 -43
- package/dist/shared/quantic-element.d.ts +11 -1
- package/dist/shared/slot-utils.d.ts +24 -0
- package/dist/shared/slot-utils.js +38 -0
- package/dist/table/index.stories.d.ts +1 -0
- package/dist/table/index.stories.js +19 -0
- package/dist/table/table.component.d.ts +1 -1
- package/dist/table/table.component.js +3 -11
- package/dist/toast/toast.d.ts +1 -1
- package/dist/toast/toast.js +4 -12
- package/dist/toggle/index.d.ts +1 -1
- package/dist/toggle/index.js +1 -2
- package/dist/types/alert/alert.d.ts +1 -1
- package/dist/types/card/card-title.component.d.ts +1 -1
- package/dist/types/card/card.component.d.ts +2 -1
- package/dist/types/dialog/dialog-title.d.ts +1 -1
- package/dist/types/dialog/dialog.d.ts +1 -1
- package/dist/types/dropdown-menu/group.component.d.ts +2 -1
- package/dist/types/field/field.component.d.ts +4 -3
- package/dist/types/field/render-as-field.hoc.d.ts +1 -1
- package/dist/types/inline-edit/index.d.ts +2 -3
- package/dist/types/layout/layout.component.d.ts +5 -4
- package/dist/types/layout/sidebar.component.d.ts +1 -1
- package/dist/types/option-card/option-card.component.d.ts +1 -1
- package/dist/types/panel/panel-header.component.d.ts +1 -1
- package/dist/types/panel/panel.component.d.ts +1 -1
- package/dist/types/popover/popover-popup.d.ts +1 -1
- package/dist/types/popover/popover.d.ts +2 -2
- package/dist/types/shared/auto-hide-empty-slots.mixin.d.ts +19 -20
- package/dist/types/shared/quantic-element.d.ts +11 -1
- package/dist/types/shared/slot-utils.d.ts +24 -0
- package/dist/types/table/index.stories.d.ts +1 -0
- package/dist/types/table/table.component.d.ts +1 -1
- package/dist/types/toast/toast.d.ts +1 -1
- package/dist/types/toggle/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { SlotContentInterface } from './slot-content.mixin';
|
|
2
1
|
import { LitConstructor } from './shared.types';
|
|
3
2
|
import { QuanticElement } from './quantic-element';
|
|
4
|
-
export interface AutoHideEmptySlotsInterface extends SlotContentInterface {
|
|
5
|
-
handleAutoHide(e: Event): void;
|
|
6
|
-
}
|
|
7
3
|
/**
|
|
8
|
-
* Mixin that automatically hides empty slots using
|
|
9
|
-
* Extends SlotContentMixin to inherit slot checking functionality.
|
|
4
|
+
* Mixin that automatically hides empty named slots using CSS only.
|
|
10
5
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* Each named slot is hidden by default and revealed when the host has a light
|
|
7
|
+
* DOM child with a matching `slot` attribute. Two rules cover all browsers:
|
|
8
|
+
*
|
|
9
|
+
* - `:host(:has([slot="name"]))` — Safari and Firefox
|
|
10
|
+
* - `@scope { :scope:has([slot="name"]) }` — Chrome (@scope changes the
|
|
11
|
+
* evaluation context so :has() can see light DOM children)
|
|
12
|
+
*
|
|
13
|
+
* The reveal value is `display: revert-layer` rather than `display: block` so
|
|
14
|
+
* that the component's own display value is restored instead of overridden.
|
|
15
|
+
* Component styles are placed in `@layer quantic-component` and the
|
|
16
|
+
* hide/reveal rules in `@layer quantic-slot-visibility` (declared after, so
|
|
17
|
+
* higher priority). `revert-layer` then falls back to whatever the component
|
|
18
|
+
* set in `quantic-component`.
|
|
19
|
+
*
|
|
20
|
+
* CSS is injected via `finalizeStyles` so it lands in Lit SSR's Declarative
|
|
21
|
+
* Shadow DOM output — no JS, no layout shift.
|
|
13
22
|
*
|
|
14
23
|
* @example
|
|
15
|
-
*
|
|
16
|
-
* class MyComponent extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
17
|
-
* render() {
|
|
18
|
-
* return html`
|
|
19
|
-
* <slot name="header" @slotchange=${this.handleAutoHide}></slot>
|
|
20
|
-
* <slot></slot>
|
|
21
|
-
* <slot name="footer" @slotchange=${this.handleAutoHide}></slot>
|
|
22
|
-
* `;
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
24
|
+
* class MyElement extends AutoHideEmptySlotsMixin(QuanticElement, ['header', 'footer']) {}
|
|
26
25
|
*/
|
|
27
|
-
export declare const AutoHideEmptySlotsMixin: <T extends LitConstructor<QuanticElement>>(superClass: T) => T
|
|
26
|
+
export declare const AutoHideEmptySlotsMixin: <T extends LitConstructor<QuanticElement>>(superClass: T, namedSlots?: string[]) => T;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import type { LitConstructor } from './shared.types';
|
|
2
3
|
import type { ComponentMeta } from './meta.types';
|
|
3
4
|
/**
|
|
4
5
|
* Base class for Quantic components.
|
|
@@ -8,10 +9,19 @@ export declare class QuanticElement extends LitElement {
|
|
|
8
9
|
static meta?: ComponentMeta;
|
|
9
10
|
static ensureDefined(): void;
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Any QuanticElement subclass, including the anonymous ones mixins and HOCs
|
|
14
|
+
* return — those are plain constructors, so their statics are declared here
|
|
15
|
+
* rather than inferred from `typeof QuanticElement`.
|
|
16
|
+
*/
|
|
17
|
+
export type QuanticElementConstructor = LitConstructor<QuanticElement> & {
|
|
18
|
+
tagName?: string;
|
|
19
|
+
meta?: ComponentMeta;
|
|
20
|
+
};
|
|
11
21
|
/**
|
|
12
22
|
* Decorator that registers a QuanticElement subclass as a custom element and sets its tagName.
|
|
13
23
|
* The class must extend QuanticElement to inherit the ensureDefined() static method.
|
|
14
24
|
*
|
|
15
25
|
* @param tagName - The custom element tag name (e.g., 'quantic-badge')
|
|
16
26
|
*/
|
|
17
|
-
export declare function quanticElement(tagName: string): <T extends
|
|
27
|
+
export declare function quanticElement(tagName: string): <T extends QuanticElementConstructor>(target: T) => T;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if a slot has at least one non-whitespace node assigned.
|
|
3
|
+
*/
|
|
4
|
+
export declare function slotHasContent(slot: HTMLSlotElement): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Returns the concatenated trimmed text content of all assigned nodes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function slotTextContent(slot: HTMLSlotElement): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns a slotchange event handler that calls `setter` with whether the slot
|
|
11
|
+
* has non-empty content.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* html`<slot @slotchange=${onSlotChange((has) => (this._hasLabel = has))}></slot>`
|
|
15
|
+
*/
|
|
16
|
+
export declare function onSlotChange(setter: (has: boolean) => void): (e: Event) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a slotchange event handler that calls `setter` with the slot's text
|
|
19
|
+
* content, falling back to `''` when empty.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* html`<slot @slotchange=${onSlotTextChange((t) => (this._labelText = t))}></slot>`
|
|
23
|
+
*/
|
|
24
|
+
export declare function onSlotTextChange(setter: (text: string) => void): (e: Event) => void;
|
|
@@ -20,4 +20,5 @@ export declare const WithToolbar: import("../shared/story").StoryObject<Args>;
|
|
|
20
20
|
export declare const WithControls: import("../shared/story").StoryObject<Args>;
|
|
21
21
|
export declare const WithToolbarAndControls: import("../shared/story").StoryObject<Args>;
|
|
22
22
|
export declare const SortChange: import("../shared/story").StoryObject<Args>;
|
|
23
|
+
export declare const EmptyOptionalSlots: any;
|
|
23
24
|
export declare const CustomColumnWidths: import("../shared/story").StoryObject<Args>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QuanticElement } from '../shared/quantic-element';
|
|
2
2
|
import { TableSize, TableVariant } from './index.constants';
|
|
3
3
|
import type { ComponentMeta } from '../shared/meta.types';
|
|
4
|
-
declare const Table_base: typeof QuanticElement
|
|
4
|
+
declare const Table_base: typeof QuanticElement;
|
|
5
5
|
export declare class Table extends Table_base {
|
|
6
6
|
static meta: ComponentMeta;
|
|
7
7
|
size: TableSize;
|
|
@@ -3,7 +3,7 @@ import { QuanticElement } from '../shared/quantic-element';
|
|
|
3
3
|
import { ToastType } from './index.constants';
|
|
4
4
|
import type { ComponentMeta } from '../shared/meta.types';
|
|
5
5
|
export { ToastType } from './index.constants';
|
|
6
|
-
declare const Toast_base: typeof QuanticElement
|
|
6
|
+
declare const Toast_base: typeof QuanticElement;
|
|
7
7
|
export declare class Toast extends Toast_base {
|
|
8
8
|
static meta: ComponentMeta;
|
|
9
9
|
open: boolean;
|
|
@@ -14,7 +14,7 @@ declare const Toggle_base: {
|
|
|
14
14
|
invalid?: boolean;
|
|
15
15
|
} | undefined): import("../shared/a11y-attributes.mixin").A11yAttributeValues;
|
|
16
16
|
};
|
|
17
|
-
} & typeof QuanticElement
|
|
17
|
+
} & typeof QuanticElement;
|
|
18
18
|
export declare class Toggle extends Toggle_base {
|
|
19
19
|
static meta: ComponentMeta;
|
|
20
20
|
static formAssociated: boolean;
|