@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,11 +1,11 @@
|
|
|
1
1
|
import { QuanticElement } from '../shared/quantic-element';
|
|
2
2
|
import type { ComponentMeta } from '../shared/meta.types';
|
|
3
|
-
declare
|
|
4
|
-
export declare class InlineEdit extends InlineEdit_base {
|
|
3
|
+
export declare class InlineEdit extends QuanticElement {
|
|
5
4
|
static meta: ComponentMeta;
|
|
6
5
|
label: string;
|
|
7
6
|
active: boolean;
|
|
8
7
|
invalid: boolean;
|
|
8
|
+
private hasLabelSlot;
|
|
9
9
|
connectedCallback(): void;
|
|
10
10
|
disconnectedCallback(): void;
|
|
11
11
|
static styles: import("lit").CSSResult;
|
|
@@ -17,4 +17,3 @@ export declare class InlineEdit extends InlineEdit_base {
|
|
|
17
17
|
private handleFocusOut;
|
|
18
18
|
render(): import("lit").TemplateResult<1>;
|
|
19
19
|
}
|
|
20
|
-
export {};
|
|
@@ -5,19 +5,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { css, html } from 'lit';
|
|
8
|
+
import { state } from 'lit/decorators.js';
|
|
8
9
|
import { quanticElement, QuanticElement } from '../shared/quantic-element';
|
|
9
|
-
import {
|
|
10
|
+
import { onSlotChange } from '../shared/slot-utils';
|
|
10
11
|
import { IconSize } from '../icon/index.constants';
|
|
11
12
|
import { LucideIconPencil } from '../icon/__generated__/lucide/pencil';
|
|
12
13
|
import { classMap } from 'lit/directives/class-map.js';
|
|
13
14
|
import { event, prop } from '../shared/component-meta.decorators';
|
|
14
15
|
LucideIconPencil.ensureDefined();
|
|
15
|
-
let InlineEdit = class InlineEdit extends
|
|
16
|
+
let InlineEdit = class InlineEdit extends QuanticElement {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments);
|
|
18
19
|
this.label = '';
|
|
19
20
|
this.active = false;
|
|
20
21
|
this.invalid = false;
|
|
22
|
+
this.hasLabelSlot = false;
|
|
21
23
|
this.handleActivateClick = () => {
|
|
22
24
|
if (!this.active)
|
|
23
25
|
this.activate();
|
|
@@ -75,7 +77,7 @@ let InlineEdit = class InlineEdit extends SlotContentMixin(QuanticElement) {
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
render() {
|
|
78
|
-
const hasLabel = this.
|
|
80
|
+
const hasLabel = this.hasLabelSlot || !!this.label;
|
|
79
81
|
return html `
|
|
80
82
|
<div
|
|
81
83
|
class="${classMap({
|
|
@@ -87,11 +89,9 @@ let InlineEdit = class InlineEdit extends SlotContentMixin(QuanticElement) {
|
|
|
87
89
|
@click=${this.handleActivateClick}
|
|
88
90
|
@keydown=${this.handleTriggerKey}
|
|
89
91
|
>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
>`
|
|
94
|
-
: ''}
|
|
92
|
+
<span class=${classMap({ label: true, 'is-empty': !hasLabel })}
|
|
93
|
+
><slot name="label" @slotchange=${onSlotChange((has) => (this.hasLabelSlot = has))}>${this.label}</slot></span
|
|
94
|
+
>
|
|
95
95
|
<span class="value">
|
|
96
96
|
<span class="display">
|
|
97
97
|
<slot name="display"><span>—</span></slot>
|
|
@@ -164,6 +164,11 @@ InlineEdit.styles = css `
|
|
|
164
164
|
);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
/* The label renders unconditionally so its slot exists to fire slotchange. */
|
|
168
|
+
.label.is-empty {
|
|
169
|
+
display: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
167
172
|
.value {
|
|
168
173
|
min-width: 0;
|
|
169
174
|
display: flex;
|
|
@@ -239,6 +244,9 @@ __decorate([
|
|
|
239
244
|
__decorate([
|
|
240
245
|
prop({ type: 'boolean', default: 'false', description: 'When true, focusout does not close the editor. The editor stays open until the value is valid or the user cancels.' })
|
|
241
246
|
], InlineEdit.prototype, "invalid", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
state()
|
|
249
|
+
], InlineEdit.prototype, "hasLabelSlot", void 0);
|
|
242
250
|
InlineEdit = __decorate([
|
|
243
251
|
event('cancel', { description: 'Fired on Escape. Consumer should revert optimistic state.' }),
|
|
244
252
|
quanticElement('quantic-inline-edit')
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { type PropertyValues } from 'lit';
|
|
1
|
+
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
|
2
2
|
import { LayoutVariant } from './index.constants';
|
|
3
3
|
import { QuanticElement } from '../shared/quantic-element';
|
|
4
4
|
import type { ComponentMeta } from '../shared/meta.types';
|
|
5
|
-
declare const Layout_base: typeof QuanticElement
|
|
5
|
+
declare const Layout_base: typeof QuanticElement;
|
|
6
6
|
export declare class Layout extends Layout_base {
|
|
7
7
|
static meta: ComponentMeta;
|
|
8
8
|
variant: LayoutVariant;
|
|
9
9
|
private isSmallViewport;
|
|
10
10
|
private previousIsSmallViewport?;
|
|
11
|
+
private hasSidebarSlot;
|
|
12
|
+
private hasTitlebarSlot;
|
|
11
13
|
private asideElement?;
|
|
12
14
|
private toggleButtonElement?;
|
|
13
15
|
private focusTrap?;
|
|
@@ -23,12 +25,11 @@ export declare class Layout extends Layout_base {
|
|
|
23
25
|
disconnectedCallback(): void;
|
|
24
26
|
protected willUpdate(_props: PropertyValues): void;
|
|
25
27
|
protected updated(props: PropertyValues): void;
|
|
26
|
-
private handleSlotChange;
|
|
27
28
|
static styles: import("lit").CSSResult;
|
|
29
|
+
static finalizeStyles(styles?: CSSResultGroup): import("lit").CSSResultOrNative[];
|
|
28
30
|
private get isAsideCollapsible();
|
|
29
31
|
private get hasSidebar();
|
|
30
32
|
private get hasTitlebar();
|
|
31
|
-
private get hasHeader();
|
|
32
33
|
render(): import("lit").TemplateResult;
|
|
33
34
|
}
|
|
34
35
|
export {};
|
|
@@ -4,12 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { css } from 'lit';
|
|
8
|
-
import { query } from 'lit/decorators.js';
|
|
7
|
+
import { css, unsafeCSS } from 'lit';
|
|
8
|
+
import { query, state } from 'lit/decorators.js';
|
|
9
9
|
import { html } from 'lit/static-html.js';
|
|
10
10
|
import { classMap } from 'lit/directives/class-map.js';
|
|
11
11
|
import { provide } from '@lit/context';
|
|
12
12
|
import { AutoHideEmptySlotsMixin } from '../shared/auto-hide-empty-slots.mixin';
|
|
13
|
+
import { onSlotChange } from '../shared/slot-utils';
|
|
13
14
|
import { respond, Breakpoint } from '../shared/respond.decorator';
|
|
14
15
|
import { LayoutVariant } from './index.constants';
|
|
15
16
|
import { asideExpandedContext } from './index.context';
|
|
@@ -20,10 +21,12 @@ import { QuanticElement, quanticElement } from '../shared/quantic-element';
|
|
|
20
21
|
import { prop } from '../shared/component-meta.decorators';
|
|
21
22
|
Button.ensureDefined();
|
|
22
23
|
LucideIconMenu.ensureDefined();
|
|
23
|
-
let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
24
|
+
let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement, ['logo', 'titlebar', 'toolbar', 'navbar', 'sidebar']) {
|
|
24
25
|
constructor() {
|
|
25
26
|
super(...arguments);
|
|
26
27
|
this.variant = LayoutVariant.Default;
|
|
28
|
+
this.hasSidebarSlot = false;
|
|
29
|
+
this.hasTitlebarSlot = false;
|
|
27
30
|
this._isAsideExpanded = true;
|
|
28
31
|
this.handleAsideExpand = (event) => {
|
|
29
32
|
this.isAsideExpanded = event.detail.expanded;
|
|
@@ -33,10 +36,6 @@ let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
|
33
36
|
this.isAsideExpanded = false;
|
|
34
37
|
}
|
|
35
38
|
};
|
|
36
|
-
this.handleSlotChange = (event) => {
|
|
37
|
-
this.handleAutoHide(event);
|
|
38
|
-
this.requestUpdate();
|
|
39
|
-
};
|
|
40
39
|
}
|
|
41
40
|
get isAsideExpanded() {
|
|
42
41
|
return this._isAsideExpanded;
|
|
@@ -115,18 +114,32 @@ let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
|
115
114
|
}
|
|
116
115
|
this.previousIsSmallViewport = this.isSmallViewport;
|
|
117
116
|
}
|
|
117
|
+
static finalizeStyles(styles) {
|
|
118
|
+
const base = super.finalizeStyles(styles) ?? [];
|
|
119
|
+
return [
|
|
120
|
+
...base,
|
|
121
|
+
unsafeCSS(`@layer quantic-header-visibility {
|
|
122
|
+
.header { display: none; }
|
|
123
|
+
.header.collapsible,
|
|
124
|
+
:host(:has([slot="navbar"])) .header,
|
|
125
|
+
:host(:has([slot="titlebar"])) .header,
|
|
126
|
+
:host(:has([slot="logo"])) .header { display: revert-layer; }
|
|
127
|
+
@scope {
|
|
128
|
+
:scope:has([slot="navbar"]) .header,
|
|
129
|
+
:scope:has([slot="titlebar"]) .header,
|
|
130
|
+
:scope:has([slot="logo"]) .header { display: revert-layer; }
|
|
131
|
+
}
|
|
132
|
+
}`),
|
|
133
|
+
];
|
|
134
|
+
}
|
|
118
135
|
get isAsideCollapsible() {
|
|
119
136
|
return this.isSmallViewport && this.hasSidebar;
|
|
120
137
|
}
|
|
121
138
|
get hasSidebar() {
|
|
122
|
-
return
|
|
139
|
+
return this.hasSidebarSlot;
|
|
123
140
|
}
|
|
124
141
|
get hasTitlebar() {
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
get hasHeader() {
|
|
128
|
-
return (this.isAsideCollapsible ||
|
|
129
|
-
['titlebar', 'navbar', 'logo'].some((slot) => !this.isSlotEmpty(slot)));
|
|
142
|
+
return this.hasTitlebarSlot;
|
|
130
143
|
}
|
|
131
144
|
render() {
|
|
132
145
|
const toggleButton = html `<quantic-button
|
|
@@ -143,12 +156,11 @@ let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
|
143
156
|
const logo = html `<slot
|
|
144
157
|
name="logo"
|
|
145
158
|
class="logo"
|
|
146
|
-
@slotchange=${this.handleSlotChange}
|
|
147
159
|
></slot>`;
|
|
148
160
|
const titlebar = html `<slot
|
|
149
161
|
class="titlebar"
|
|
150
162
|
name="titlebar"
|
|
151
|
-
@slotchange=${this.
|
|
163
|
+
@slotchange=${onSlotChange((has) => (this.hasTitlebarSlot = has))}
|
|
152
164
|
></slot> `;
|
|
153
165
|
return html `
|
|
154
166
|
<div
|
|
@@ -160,14 +172,13 @@ let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
|
160
172
|
})}
|
|
161
173
|
@expanded-changed=${this.handleAsideExpand}
|
|
162
174
|
>
|
|
163
|
-
<header class
|
|
175
|
+
<header class=${classMap({ header: true, collapsible: this.isAsideCollapsible })}>
|
|
164
176
|
${!this.hasSidebar ? logo : null}
|
|
165
177
|
${this.isAsideCollapsible ? toggleButton : null}
|
|
166
178
|
${this.isSmallViewport ? null : titlebar}
|
|
167
179
|
<slot
|
|
168
180
|
class="navbar"
|
|
169
181
|
name="navbar"
|
|
170
|
-
@slotchange=${this.handleSlotChange}
|
|
171
182
|
></slot>
|
|
172
183
|
</header>
|
|
173
184
|
|
|
@@ -176,12 +187,10 @@ let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
|
176
187
|
<slot
|
|
177
188
|
name="toolbar"
|
|
178
189
|
class="toolbar"
|
|
179
|
-
@slotchange=${this.handleSlotChange}
|
|
180
190
|
></slot>
|
|
181
191
|
|
|
182
192
|
<div
|
|
183
193
|
class="aside-backdrop"
|
|
184
|
-
?hidden=${!this.hasSidebar}
|
|
185
194
|
aria-hidden="true"
|
|
186
195
|
@click=${this.toggleAsideExpanded}
|
|
187
196
|
></div>
|
|
@@ -196,7 +205,7 @@ let Layout = class Layout extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
|
196
205
|
<slot
|
|
197
206
|
class="sidebar"
|
|
198
207
|
name="sidebar"
|
|
199
|
-
@slotchange=${this.
|
|
208
|
+
@slotchange=${onSlotChange((has) => (this.hasSidebarSlot = has))}
|
|
200
209
|
></slot>
|
|
201
210
|
</aside>
|
|
202
211
|
|
|
@@ -372,7 +381,7 @@ Layout.styles = css `
|
|
|
372
381
|
opacity: 0;
|
|
373
382
|
}
|
|
374
383
|
|
|
375
|
-
.is-aside-expanded .aside-backdrop {
|
|
384
|
+
.has-sidebar.is-aside-expanded .aside-backdrop {
|
|
376
385
|
display: block;
|
|
377
386
|
pointer-events: auto;
|
|
378
387
|
opacity: var(--quantic-component-layout-aside-backdrop-opacity);
|
|
@@ -397,8 +406,6 @@ Layout.styles = css `
|
|
|
397
406
|
|
|
398
407
|
.header {
|
|
399
408
|
grid-area: header;
|
|
400
|
-
display: flex;
|
|
401
|
-
align-items: center;
|
|
402
409
|
}
|
|
403
410
|
|
|
404
411
|
.logo {
|
|
@@ -425,7 +432,7 @@ Layout.styles = css `
|
|
|
425
432
|
pointer-events: auto;
|
|
426
433
|
}
|
|
427
434
|
|
|
428
|
-
.is-aside-expanded .aside-backdrop {
|
|
435
|
+
.has-sidebar.is-aside-expanded .aside-backdrop {
|
|
429
436
|
display: none;
|
|
430
437
|
}
|
|
431
438
|
|
|
@@ -482,6 +489,12 @@ __decorate([
|
|
|
482
489
|
__decorate([
|
|
483
490
|
respond(Breakpoint.below(1024))
|
|
484
491
|
], Layout.prototype, "isSmallViewport", void 0);
|
|
492
|
+
__decorate([
|
|
493
|
+
state()
|
|
494
|
+
], Layout.prototype, "hasSidebarSlot", void 0);
|
|
495
|
+
__decorate([
|
|
496
|
+
state()
|
|
497
|
+
], Layout.prototype, "hasTitlebarSlot", void 0);
|
|
485
498
|
__decorate([
|
|
486
499
|
query('.aside')
|
|
487
500
|
], Layout.prototype, "asideElement", void 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QuanticElement } from '../shared/quantic-element';
|
|
2
2
|
import type { ComponentMeta } from '../shared/meta.types';
|
|
3
|
-
declare const Sidebar_base: typeof QuanticElement
|
|
3
|
+
declare const Sidebar_base: typeof QuanticElement;
|
|
4
4
|
export declare class Sidebar extends Sidebar_base {
|
|
5
5
|
static meta: ComponentMeta;
|
|
6
6
|
isAsideExpanded?: boolean;
|
|
@@ -20,7 +20,7 @@ import { prop } from '../shared/component-meta.decorators';
|
|
|
20
20
|
SidebarMenuItem.ensureDefined();
|
|
21
21
|
LucideIconPanelLeftClose.ensureDefined();
|
|
22
22
|
LucideIconPanelLeft.ensureDefined();
|
|
23
|
-
let Sidebar = class Sidebar extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
23
|
+
let Sidebar = class Sidebar extends AutoHideEmptySlotsMixin(QuanticElement, ['header', 'footer']) {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(...arguments);
|
|
26
26
|
this.ariaLabel = 'Sidebar navigation';
|
|
@@ -42,16 +42,16 @@ let Sidebar = class Sidebar extends AutoHideEmptySlotsMixin(QuanticElement) {
|
|
|
42
42
|
aria-expanded=${this.isAsideExpanded !== false ? 'true' : 'false'}
|
|
43
43
|
>
|
|
44
44
|
<div class="header">
|
|
45
|
-
<slot name="header"
|
|
45
|
+
<slot name="header"></slot>
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
48
|
<div class="scroll-area">
|
|
49
49
|
<div class="body">
|
|
50
|
-
<slot
|
|
50
|
+
<slot></slot>
|
|
51
51
|
</div>
|
|
52
52
|
|
|
53
53
|
<div class="footer">
|
|
54
|
-
<slot name="footer"
|
|
54
|
+
<slot name="footer"></slot>
|
|
55
55
|
</div>
|
|
56
56
|
|
|
57
57
|
${this.isDesktopViewport && this.collapsible
|
|
@@ -114,7 +114,7 @@ Sidebar.styles = css `
|
|
|
114
114
|
flex-shrink: 0;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
:host(:not(:has([slot="header"]))) .header {
|
|
118
118
|
display: none;
|
|
119
119
|
}
|
|
120
120
|
|