@kubex/zinc 1.0.115 → 1.0.117
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/custom-elements.json +476 -287
- package/dist/vscode.html-custom-data.json +52 -52
- package/dist/web-types.json +116 -86
- package/dist/zn.d.ts +63 -11
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +1096 -1087
- package/docs/_includes/default.njk +3 -4
- package/docs/assets/styles/docs.css +13 -13
- package/docs/pages/components/absolute-container.md +2 -2
- package/docs/pages/components/alert.md +5 -5
- package/docs/pages/components/audio-select.md +4 -4
- package/docs/pages/components/button-group.md +1 -31
- package/docs/pages/components/button.md +13 -12
- package/docs/pages/components/checkbox.md +4 -4
- package/docs/pages/components/chip.md +14 -14
- package/docs/pages/components/data-table.md +4 -4
- package/docs/pages/components/datepicker.md +5 -5
- package/docs/pages/components/dialog.md +2 -2
- package/docs/pages/components/file.md +81 -9
- package/docs/pages/components/header.md +4 -6
- package/docs/pages/components/hover-container.md +1 -1
- package/docs/pages/components/icon.md +14 -0
- package/docs/pages/components/inline-edit.md +4 -4
- package/docs/pages/components/item.md +2 -2
- package/docs/pages/components/menu.md +2 -2
- package/docs/pages/components/note.md +12 -12
- package/docs/pages/components/page.md +3 -3
- package/docs/pages/components/pagination.md +6 -6
- package/docs/pages/components/pane.md +3 -6
- package/docs/pages/components/panel.md +10 -12
- package/docs/pages/components/priority-list.md +3 -3
- package/docs/pages/components/radio-group.md +4 -4
- package/docs/pages/components/radio.md +4 -4
- package/docs/pages/components/scroll-container.md +10 -10
- package/docs/pages/components/select.md +5 -5
- package/docs/pages/components/split-button.md +4 -4
- package/docs/pages/components/tabs.md +3 -3
- package/docs/pages/components/tile.md +13 -13
- package/docs/pages/components/toggle.md +4 -4
- package/docs/pages/components/translations.md +5 -5
- package/docs/pages/components/vertical-stepper.md +3 -3
- package/docs/pages/components/well.md +19 -19
- package/docs/pages/getting-started/example-layout.md +16 -16
- package/docs/pages/getting-started/example-page.md +1 -3
- package/package.json +2 -1
- package/scss/_root.scss +87 -60
- package/scss/shared/_button.scss +6 -1
- package/scss/shared/_form-elements.scss +1 -0
- package/scss/shared/_table.scss +1 -1
- package/scss/shared/layout.scss +5 -4
- package/scss/themes/_dark.scss +4 -4
- package/scss/themes/_light.scss +70 -287
- package/src/components/bulk-actions/bulk-actions.component.ts +0 -1
- package/src/components/button/button.component.ts +40 -10
- package/src/components/button/button.scss +67 -103
- package/src/components/button-menu/button-menu.component.ts +2 -6
- package/src/components/collapsible/collapsible.scss +1 -1
- package/src/components/cols/cols.scss +1 -1
- package/src/components/content-block/content-block.component.ts +1 -2
- package/src/components/data-table/data-table.component.ts +4 -8
- package/src/components/data-table/data-table.test.ts +7 -0
- package/src/components/data-table-filter/data-table-filter.component.ts +1 -1
- package/src/components/data-table-sort/data-table-sort.component.ts +2 -2
- package/src/components/dialog/dialog.component.ts +0 -1
- package/src/components/editor/modules/dialog/dialog.component.ts +0 -1
- package/src/components/editor/modules/dialog/dialog.scss +1 -1
- package/src/components/editor/modules/toolbar/toolbar.component.ts +0 -1
- package/src/components/expanding-action/expanding-action.component.ts +0 -3
- package/src/components/expanding-action/expanding-action.scss +0 -5
- package/src/components/file/file.component.ts +158 -17
- package/src/components/file/file.scss +122 -29
- package/src/components/header/header.component.ts +2 -8
- package/src/components/header/header.scss +4 -25
- package/src/components/icon/icon.component.ts +80 -1
- package/src/components/icon/icon.scss +8 -0
- package/src/components/icon/icon.test.ts +24 -0
- package/src/components/icon-picker/icon-picker.component.ts +0 -1
- package/src/components/inline-edit/inline-edit.component.ts +3 -4
- package/src/components/input/input.scss +21 -6
- package/src/components/input-group/input-group.scss +2 -1
- package/src/components/markdown-editor/markdown-editor.component.ts +1 -5
- package/src/components/menu/menu.scss +1 -1
- package/src/components/menu-item/menu-item.scss +4 -4
- package/src/components/navbar/navbar.component.ts +20 -0
- package/src/components/navbar/navbar.scss +31 -17
- package/src/components/navbar/navbar.test.ts +72 -0
- package/src/components/note/note.component.ts +0 -1
- package/src/components/page/page.component.ts +43 -12
- package/src/components/page/page.scss +21 -17
- package/src/components/page/page.test.ts +18 -1
- package/src/components/page-nav/page-nav.scss +6 -6
- package/src/components/panel/panel.component.ts +3 -5
- package/src/components/panel/panel.scss +3 -3
- package/src/components/panel/panel.test.ts +14 -0
- package/src/components/query-builder/query-builder.component.ts +0 -1
- package/src/components/slideout/slideout.component.ts +0 -1
- package/src/components/sp/sp.scss +2 -2
- package/src/components/tab/tab.component.ts +2 -0
- package/src/components/tabs/tabs.component.ts +1 -1
- package/src/components/tile/tile.scss +1 -1
- package/src/components/translation-group/translation-group.component.ts +0 -3
- package/src/components/translations/translations.component.ts +0 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {classMap} from 'lit/directives/class-map.js';
|
|
2
|
+
import {ifDefined} from 'lit/directives/if-defined.js';
|
|
2
3
|
import {type CSSResultGroup, html, type PropertyValues, unsafeCSS} from 'lit';
|
|
3
4
|
import {HasSlotController} from '../../internal/slot';
|
|
4
5
|
import {property, state} from 'lit/decorators.js';
|
|
@@ -20,6 +21,8 @@ interface TabDefinition {
|
|
|
20
21
|
sourceIndex: number;
|
|
21
22
|
uri: string | null;
|
|
22
23
|
slotName: string | null;
|
|
24
|
+
selected: boolean;
|
|
25
|
+
classes: string | undefined;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
/**
|
|
@@ -156,6 +159,8 @@ export default class ZnPage extends ZnTabs {
|
|
|
156
159
|
const priority = this.parsePriority(tab.getAttribute('priority'));
|
|
157
160
|
const uri = tab.getAttribute('uri');
|
|
158
161
|
const slotName = uri ? null : `page-tab-${index}`;
|
|
162
|
+
const selected = tab.hasAttribute('selected');
|
|
163
|
+
const classes = tab.getAttribute('class')?.trim() || undefined;
|
|
159
164
|
|
|
160
165
|
tab.id = id;
|
|
161
166
|
|
|
@@ -163,7 +168,7 @@ export default class ZnPage extends ZnTabs {
|
|
|
163
168
|
tab.slot = slotName!;
|
|
164
169
|
}
|
|
165
170
|
|
|
166
|
-
tabs.push({id, caption, priority, sourceIndex: index, uri, slotName});
|
|
171
|
+
tabs.push({id, caption, priority, sourceIndex: index, uri, slotName, selected, classes});
|
|
167
172
|
});
|
|
168
173
|
|
|
169
174
|
this.tabDefinitions = tabs.sort((a, b) => this.compareTabs(a, b));
|
|
@@ -272,6 +277,12 @@ export default class ZnPage extends ZnTabs {
|
|
|
272
277
|
}
|
|
273
278
|
|
|
274
279
|
private activateInitialPageTab() {
|
|
280
|
+
const preselected = this.tabDefinitions.find(tab => tab.selected);
|
|
281
|
+
if (preselected) {
|
|
282
|
+
this.activateTabDefinition(preselected);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
|
|
275
286
|
const selectedPanel = this.shadowRoot?.querySelector('#content > div[selected]');
|
|
276
287
|
const firstTab = this.tabDefinitions[0];
|
|
277
288
|
|
|
@@ -280,6 +291,28 @@ export default class ZnPage extends ZnTabs {
|
|
|
280
291
|
}
|
|
281
292
|
}
|
|
282
293
|
|
|
294
|
+
private activateTabDefinition(tab: TabDefinition) {
|
|
295
|
+
if (tab.uri) {
|
|
296
|
+
const navItem = this.findNavItemForUri(tab.uri);
|
|
297
|
+
if (navItem) {
|
|
298
|
+
this.clickTab(navItem, false);
|
|
299
|
+
this.syncNavigationActive(navItem);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
this.activateTab(tab.id, false);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
private findNavItemForUri(uri: string): HTMLElement | null {
|
|
307
|
+
const items = this.shadowRoot?.querySelectorAll<HTMLElement>('zn-navbar li[tab-uri]') ?? [];
|
|
308
|
+
for (const item of Array.from(items)) {
|
|
309
|
+
if (item.getAttribute('tab-uri') === uri) {
|
|
310
|
+
return item;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
|
|
283
316
|
private registerPagePanels() {
|
|
284
317
|
this.shadowRoot?.querySelectorAll<HTMLElement>('#content > div[id]').forEach(panel => {
|
|
285
318
|
this._addPanel(panel);
|
|
@@ -351,26 +384,24 @@ export default class ZnPage extends ZnTabs {
|
|
|
351
384
|
: null}
|
|
352
385
|
</div>` : null}
|
|
353
386
|
|
|
354
|
-
<div class="content"
|
|
387
|
+
<div class="content">
|
|
355
388
|
${hasPreviousPath ? html`
|
|
356
389
|
<a href="${this.previousPath}" class="caption__back"
|
|
357
390
|
data-target="${this.previousTarget ? this.previousTarget : ''}">
|
|
358
|
-
<zn-button
|
|
391
|
+
<zn-button icon="arrow_back" icon-size="24" color="transparent"></zn-button>
|
|
359
392
|
</a>` : null}
|
|
360
393
|
|
|
361
394
|
<div class="caption">
|
|
362
|
-
<div
|
|
363
|
-
<span class="header__caption"
|
|
395
|
+
<div class="header__left">
|
|
396
|
+
<span class="header__caption">
|
|
364
397
|
${hasBreadcrumb ? html`
|
|
365
398
|
<slot name="breadcrumb" class="breadcrumb"></slot>` : null}
|
|
366
399
|
<slot name="caption">${this.caption}</slot>
|
|
367
400
|
</span>
|
|
368
|
-
|
|
369
|
-
<span class="header__description" part="header-description">${this.summary}</span>`
|
|
370
|
-
: null}
|
|
401
|
+
<span class="header__description">${this.summary}</span>
|
|
371
402
|
</div>
|
|
372
403
|
|
|
373
|
-
<div class="header__right"
|
|
404
|
+
<div class="header__right">
|
|
374
405
|
<slot name="actions"></slot>
|
|
375
406
|
</div>
|
|
376
407
|
</div>
|
|
@@ -380,9 +411,9 @@ export default class ZnPage extends ZnTabs {
|
|
|
380
411
|
${hasNavigation ? html`
|
|
381
412
|
<zn-navbar hide-one @zn-select="${this.handleNavigationSelect}">
|
|
382
413
|
${this.tabDefinitions.map(tab => tab.uri ? html`
|
|
383
|
-
<li tab-uri="${tab.uri}">${tab.caption}</li>
|
|
414
|
+
<li tab-uri="${tab.uri}" class="${ifDefined(tab.classes)}">${tab.caption}</li>
|
|
384
415
|
` : html`
|
|
385
|
-
<li tab="${tab.id}">${tab.caption}</li>
|
|
416
|
+
<li tab="${tab.id}" class="${ifDefined(tab.classes)}">${tab.caption}</li>
|
|
386
417
|
`)}
|
|
387
418
|
<slot name="bottom" slot="bottom"></slot>
|
|
388
419
|
</zn-navbar>
|
|
@@ -394,7 +425,7 @@ export default class ZnPage extends ZnTabs {
|
|
|
394
425
|
${this.tabDefinitions
|
|
395
426
|
.filter(tab => tab.slotName !== null)
|
|
396
427
|
.map(tab => html`
|
|
397
|
-
<div id="${tab.id}">
|
|
428
|
+
<div id="${tab.id}" ?selected="${tab.selected}">
|
|
398
429
|
<slot name="${tab.slotName!}"></slot>
|
|
399
430
|
</div>
|
|
400
431
|
`)}
|
|
@@ -7,24 +7,24 @@
|
|
|
7
7
|
min-height: 0;
|
|
8
8
|
container-type: inline-size;
|
|
9
9
|
--zn-page-content-background: var(--zn-body);
|
|
10
|
-
--zn-page-header-background: var(--zn-page-surface-background, var(--zn-page-background));
|
|
10
|
+
--zn-page-header-background: var(--zn-page-surface-background, var(--zn-page-background, var(--zn-body)));
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
@container (width > 1024px) {
|
|
14
14
|
:host {
|
|
15
|
-
--zn-gutter:
|
|
15
|
+
--zn-gutter: 16px;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@container (width > 1400px) {
|
|
20
20
|
:host {
|
|
21
|
-
--zn-gutter:
|
|
21
|
+
--zn-gutter: 24px;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@container (width > 1500px) {
|
|
26
26
|
:host {
|
|
27
|
-
--zn-gutter:
|
|
27
|
+
--zn-gutter: 32px;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
position: sticky;
|
|
46
46
|
top: 0;
|
|
47
47
|
z-index: 2;
|
|
48
|
-
padding: var(--zn-base-gap) var(--zn-base-gap) 0;
|
|
49
48
|
box-sizing: border-box;
|
|
50
49
|
background: rgba(var(--zn-page-header-background), 95%);
|
|
51
50
|
|
|
@@ -72,6 +71,11 @@
|
|
|
72
71
|
flex-direction: column;
|
|
73
72
|
position: relative;
|
|
74
73
|
margin: 0;
|
|
74
|
+
padding: calc(var(--zn-base-px) * 3) var(--zn-base-gap) calc(calc(var(--zn-base-px) * 3) - var(--zn-base-gap)) var(--zn-base-gap);
|
|
75
|
+
|
|
76
|
+
&.header--has-navigation {
|
|
77
|
+
padding: calc(var(--zn-base-px) * 3) var(--zn-base-gap);
|
|
78
|
+
}
|
|
75
79
|
|
|
76
80
|
.content {
|
|
77
81
|
display: flex;
|
|
@@ -87,7 +91,7 @@
|
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
&--has-navigation .content {
|
|
90
|
-
min-height:
|
|
94
|
+
min-height: 36px;
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
.caption {
|
|
@@ -95,9 +99,9 @@
|
|
|
95
99
|
display: flex;
|
|
96
100
|
align-items: flex-start;
|
|
97
101
|
justify-content: space-between;
|
|
98
|
-
gap:
|
|
102
|
+
gap: 2px;
|
|
99
103
|
max-width: 100%;
|
|
100
|
-
min-height:
|
|
104
|
+
min-height: 36px;
|
|
101
105
|
|
|
102
106
|
a {
|
|
103
107
|
display: flex;
|
|
@@ -112,7 +116,7 @@
|
|
|
112
116
|
justify-content: flex-start;
|
|
113
117
|
flex-direction: column;
|
|
114
118
|
gap: 4px;
|
|
115
|
-
min-height:
|
|
119
|
+
min-height: 36px;
|
|
116
120
|
flex-shrink: 1;
|
|
117
121
|
max-width: 100%;
|
|
118
122
|
}
|
|
@@ -128,7 +132,7 @@
|
|
|
128
132
|
font-weight: var(--zn-font-weight-medium);
|
|
129
133
|
font-size: var(--zn-font-size-large);
|
|
130
134
|
color: rgba(var(--zn-text-panel-title), 100%);
|
|
131
|
-
line-height:
|
|
135
|
+
line-height: 18px;
|
|
132
136
|
margin: 0;
|
|
133
137
|
overflow: hidden;
|
|
134
138
|
white-space: nowrap;
|
|
@@ -142,7 +146,7 @@
|
|
|
142
146
|
&__description {
|
|
143
147
|
display: block;
|
|
144
148
|
font-size: var(--zn-font-size-medium);
|
|
145
|
-
line-height:
|
|
149
|
+
line-height: 14px;
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
.breadcrumb {
|
|
@@ -282,20 +286,20 @@
|
|
|
282
286
|
}
|
|
283
287
|
|
|
284
288
|
zn-navbar {
|
|
285
|
-
margin-top: var(--zn-base-gap);
|
|
286
289
|
|
|
287
290
|
&::part(navbar) {
|
|
288
|
-
height:
|
|
289
|
-
min-height:
|
|
290
|
-
|
|
291
|
+
height: 40px;
|
|
292
|
+
min-height: 40px;
|
|
293
|
+
max-height: 40px;
|
|
291
294
|
padding-left: var(--zn-base-gap);
|
|
295
|
+
margin: 0;
|
|
292
296
|
}
|
|
293
297
|
|
|
294
298
|
&::part(navbar-item) {
|
|
295
|
-
|
|
299
|
+
height: 40px;
|
|
296
300
|
box-sizing: border-box;
|
|
297
301
|
font-size: var(--zn-font-size-medium);
|
|
298
|
-
line-height:
|
|
302
|
+
line-height: 16px;
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
305
|
|
|
@@ -6,7 +6,7 @@ describe('<zn-page>', () => {
|
|
|
6
6
|
it('renders header actions and generated tabs', async () => {
|
|
7
7
|
const el = await fixture<ZnPage>(html`
|
|
8
8
|
<zn-page caption="Page Title" summary="Page Summary">
|
|
9
|
-
<zn-button slot="actions" type="primary"
|
|
9
|
+
<zn-button slot="actions" type="primary" href="/ui">UI Examples</zn-button>
|
|
10
10
|
|
|
11
11
|
<zn-tab caption="Overview">Overview Content</zn-tab>
|
|
12
12
|
<zn-tab caption="Tab One">Tab One Content</zn-tab>
|
|
@@ -380,6 +380,23 @@ describe('<zn-page>', () => {
|
|
|
380
380
|
expect(getComputedStyle(activeNavItem).transitionDuration).to.equal('0.1s');
|
|
381
381
|
});
|
|
382
382
|
|
|
383
|
+
it('opens the tab flagged with the selected attribute instead of the first', async () => {
|
|
384
|
+
const el = await fixture<ZnPage>(html`
|
|
385
|
+
<zn-page caption="Page Title">
|
|
386
|
+
<zn-tab caption="Overview">Overview Content</zn-tab>
|
|
387
|
+
<zn-tab caption="Dynamic Tab" uri="/tab-three" selected></zn-tab>
|
|
388
|
+
</zn-page>
|
|
389
|
+
`);
|
|
390
|
+
await aTimeout(60);
|
|
391
|
+
|
|
392
|
+
const navbar = el.shadowRoot!.querySelector('zn-navbar')!;
|
|
393
|
+
const uriItem = navbar.querySelector<HTMLElement>('li[tab-uri="/tab-three"]')!;
|
|
394
|
+
const overviewItem = navbar.querySelector<HTMLElement>('li[tab=""]')!;
|
|
395
|
+
|
|
396
|
+
expect(uriItem.classList.contains('active')).to.equal(true);
|
|
397
|
+
expect(overviewItem.classList.contains('active')).to.equal(false);
|
|
398
|
+
});
|
|
399
|
+
|
|
383
400
|
it('disables breadcrumbs in modal mode', async () => {
|
|
384
401
|
const el = await fixture<ZnPage>(html`
|
|
385
402
|
<zn-page caption="Page Title" modal>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
height: 100%;
|
|
8
8
|
|
|
9
9
|
--page-nav-crumb-height: 50px;
|
|
10
|
-
--page-nav-width:
|
|
10
|
+
--page-nav-width: 240px;
|
|
11
11
|
--page-nav-animation-duration: 0.3s;
|
|
12
12
|
|
|
13
13
|
--page-nav-bg: var(--zn-page-content-background, var(--zn-body));
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
width: var(--page-nav-width);
|
|
49
49
|
background-color: rgb(var(--page-nav-bg));
|
|
50
50
|
overflow-y: auto;
|
|
51
|
-
padding: var(--zn-
|
|
51
|
+
padding: var(--zn-base-gap) 0 var(--zn-base-gap) var(--zn-base-gap);
|
|
52
52
|
@include wc.scrollbars;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -92,16 +92,16 @@
|
|
|
92
92
|
width: 100%;
|
|
93
93
|
height: var(--page-nav-crumb-height);
|
|
94
94
|
background-color: rgb(var(--page-nav-bg));
|
|
95
|
-
gap:
|
|
95
|
+
gap: var(--zn-base-px);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
.breadcrumb-menu-toggle {
|
|
99
99
|
cursor: pointer;
|
|
100
|
-
margin-left: var(--zn-
|
|
100
|
+
margin-left: var(--zn-base-gap);
|
|
101
101
|
|
|
102
102
|
display: flex;
|
|
103
103
|
align-items: center;
|
|
104
|
-
gap:
|
|
104
|
+
gap: var(--zn-base-px);
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
height: 100%;
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
display: block;
|
|
133
133
|
position: absolute;
|
|
134
134
|
top: 0;
|
|
135
|
-
padding
|
|
135
|
+
padding: 60px var(--zn-base-gap) var(--zn-base-gap) var(--zn-base-gap);
|
|
136
136
|
left: calc(var(--page-nav-width) * -1);
|
|
137
137
|
max-width: var(--page-nav-width);
|
|
138
138
|
opacity: 0;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {classMap} from "lit/directives/class-map.js";
|
|
2
2
|
import {type CSSResultGroup, html, type PropertyValues, unsafeCSS} from 'lit';
|
|
3
3
|
import {HasSlotController} from "../../internal/slot";
|
|
4
|
-
import {ifDefined} from "lit/directives/if-defined.js";
|
|
5
4
|
import {property} from 'lit/decorators.js';
|
|
6
5
|
import ZincElement from '../../internal/zinc-element';
|
|
7
6
|
|
|
@@ -29,9 +28,8 @@ export default class ZnPanel extends ZincElement {
|
|
|
29
28
|
@property({attribute: 'basis-px', type: Number}) basis: number;
|
|
30
29
|
@property() caption: string;
|
|
31
30
|
@property() icon: string;
|
|
32
|
-
@property() description: string;
|
|
33
31
|
@property({type: Boolean}) tabbed: boolean;
|
|
34
|
-
@property({attribute: 'header-
|
|
32
|
+
@property({attribute: 'header-borderless', type: Boolean}) headerBorderless: boolean;
|
|
35
33
|
@property({type: Boolean}) cosmic: boolean;
|
|
36
34
|
@property({type: Boolean}) flush: boolean;
|
|
37
35
|
@property({attribute: 'flush-x', type: Boolean}) flushX: boolean;
|
|
@@ -91,6 +89,7 @@ export default class ZnPanel extends ZincElement {
|
|
|
91
89
|
'panel--has-actions': hasActionSlot,
|
|
92
90
|
'panel--has-footer': hasFooterSlot,
|
|
93
91
|
'panel--has-header': hasHeader,
|
|
92
|
+
'panel--borderless-header': this.headerBorderless,
|
|
94
93
|
'panel--cosmic': this.cosmic,
|
|
95
94
|
'panel--shadow': this.shadow,
|
|
96
95
|
})}">
|
|
@@ -99,11 +98,10 @@ export default class ZnPanel extends ZincElement {
|
|
|
99
98
|
${hasHeader ? html`
|
|
100
99
|
<zn-header class="${classMap({
|
|
101
100
|
"panel__header": true,
|
|
102
|
-
"panel__header--underline": this.
|
|
101
|
+
"panel__header--underline": !this.headerBorderless,
|
|
103
102
|
})}"
|
|
104
103
|
icon="${this.icon}"
|
|
105
104
|
caption="${this.caption}"
|
|
106
|
-
description="${ifDefined(this.description)}"
|
|
107
105
|
transparent>
|
|
108
106
|
${hasActionSlot ? html`
|
|
109
107
|
<slot name="actions" slot="actions" class="panel__header__actions"></slot>` : null}
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
flex-direction: column;
|
|
75
75
|
overflow-y: auto;
|
|
76
76
|
flex-grow: 1;
|
|
77
|
-
padding:
|
|
77
|
+
padding: var(--zn-base-gap);
|
|
78
78
|
|
|
79
79
|
> :not([hidden]) ~ :not([hidden]) {
|
|
80
80
|
border: 1px solid rgb(var(--zn-border-color));
|
|
@@ -110,8 +110,8 @@
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
padding-top:
|
|
113
|
+
&.panel--borderless-header:not(.panel--flush, .panel--flush-y) &__body {
|
|
114
|
+
padding-top: 0;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
&--flush {
|
|
@@ -7,4 +7,18 @@ describe('<zn-panel>', () => {
|
|
|
7
7
|
|
|
8
8
|
expect(el).to.exist;
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
it('underlines panel headers by default', async () => {
|
|
12
|
+
const el = await fixture(html` <zn-panel caption="Example"></zn-panel> `);
|
|
13
|
+
const header = el.shadowRoot!.querySelector('.panel__header')!;
|
|
14
|
+
|
|
15
|
+
expect(header.classList.contains('panel__header--underline')).to.be.true;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('removes the header underline when header-borderless is set', async () => {
|
|
19
|
+
const el = await fixture(html` <zn-panel caption="Example" header-borderless></zn-panel> `);
|
|
20
|
+
const header = el.shadowRoot!.querySelector('.panel__header')!;
|
|
21
|
+
|
|
22
|
+
expect(header.classList.contains('panel__header--underline')).to.be.false;
|
|
23
|
+
});
|
|
10
24
|
});
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
|
-
--zn-sp-padding: var(--zn-base-gap
|
|
9
|
-
--zn-sp-gap: var(--zn-base-gap
|
|
8
|
+
--zn-sp-padding: var(--zn-base-gap);
|
|
9
|
+
--zn-sp-gap: var(--zn-base-gap);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
:host([grow]) {
|
|
@@ -18,6 +18,8 @@ export default class ZnTab extends ZincElement {
|
|
|
18
18
|
@property() caption: string;
|
|
19
19
|
@property({type: Number}) priority: number;
|
|
20
20
|
@property() uri: string;
|
|
21
|
+
/** When present, zn-page opens this tab on load instead of the first tab. */
|
|
22
|
+
@property({type: Boolean, reflect: true}) selected = false;
|
|
21
23
|
|
|
22
24
|
render() {
|
|
23
25
|
return html`<slot></slot>`;
|
|
@@ -525,7 +525,7 @@ export default class ZnTabs extends ZincElement {
|
|
|
525
525
|
return html`
|
|
526
526
|
<div class="tabs">
|
|
527
527
|
${hasHeader ? html`
|
|
528
|
-
<zn-header caption="${ifDefined(this.caption)}"
|
|
528
|
+
<zn-header caption="${ifDefined(this.caption)}" transparent>
|
|
529
529
|
<slot name="actions" slot="actions"></slot>
|
|
530
530
|
</zn-header>` : null}
|
|
531
531
|
<slot name="top"></slot>
|
|
@@ -262,7 +262,6 @@ export default class ZnTranslationGroup extends ZnPanel {
|
|
|
262
262
|
${visibleLangTabs.map(code => html`
|
|
263
263
|
<zn-button
|
|
264
264
|
data-lang-btn
|
|
265
|
-
size="x-small"
|
|
266
265
|
color="default"
|
|
267
266
|
?outline="${code !== this._activeLanguage}"
|
|
268
267
|
@click="${() => this.switchLanguage(code)}"
|
|
@@ -273,7 +272,6 @@ export default class ZnTranslationGroup extends ZnPanel {
|
|
|
273
272
|
<zn-dropdown placement="bottom-end" data-lang-overflow>
|
|
274
273
|
<zn-button
|
|
275
274
|
slot="trigger"
|
|
276
|
-
size="x-small"
|
|
277
275
|
color="default"
|
|
278
276
|
icon="keyboard_arrow_down"
|
|
279
277
|
?outline="${!overflowLangTabs.includes(this._activeLanguage)}"
|
|
@@ -288,7 +286,6 @@ export default class ZnTranslationGroup extends ZnPanel {
|
|
|
288
286
|
<zn-dropdown placement="bottom-end" data-lang-add>
|
|
289
287
|
<zn-button
|
|
290
288
|
slot="trigger"
|
|
291
|
-
size="x-small"
|
|
292
289
|
color="default"
|
|
293
290
|
outline
|
|
294
291
|
>+
|
|
@@ -357,7 +357,6 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
357
357
|
${visibleLangTabs.map(code => html`
|
|
358
358
|
<zn-button
|
|
359
359
|
data-lang-btn
|
|
360
|
-
size="x-small"
|
|
361
360
|
color="default"
|
|
362
361
|
?outline="${code !== this._activeLanguage}"
|
|
363
362
|
@click="${() => this.switchLanguage(code)}"
|
|
@@ -368,7 +367,6 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
368
367
|
<zn-dropdown placement="bottom-end" data-lang-overflow>
|
|
369
368
|
<zn-button
|
|
370
369
|
slot="trigger"
|
|
371
|
-
size="x-small"
|
|
372
370
|
color="default"
|
|
373
371
|
icon="keyboard_arrow_down"
|
|
374
372
|
?outline="${!overflowLangTabs.includes(this._activeLanguage)}"
|
|
@@ -383,7 +381,6 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
383
381
|
<zn-dropdown placement="bottom-end" data-lang-add>
|
|
384
382
|
<zn-button
|
|
385
383
|
slot="trigger"
|
|
386
|
-
size="x-small"
|
|
387
384
|
color="default"
|
|
388
385
|
outline
|
|
389
386
|
>+
|