@kubex/zinc 1.1.161 → 1.1.162
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 +266 -118
- package/dist/vscode.html-custom-data.json +13 -14
- package/dist/web-types.json +31 -30
- package/dist/zn.d.ts +22 -8
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +335 -301
- package/docs/pages/components/data-table.md +30 -20
- package/package.json +1 -1
- package/scss/themes/_dark.scss +1 -0
- package/scss/themes/_light.scss +1 -0
- package/src/components/button/button.scss +5 -0
- package/src/components/checkbox/checkbox.component.ts +10 -6
- package/src/components/checkbox/checkbox.scss +4 -8
- package/src/components/data-table/data-table.component.ts +171 -76
- package/src/components/data-table/data-table.scss +16 -60
- package/src/components/dropdown/dropdown.component.ts +6 -3
- package/src/components/panel/panel.scss +23 -0
- package/src/components/popup/popup.component.ts +8 -1
- package/src/components/tooltip/tooltip.component.ts +10 -1
- package/src/components/tooltip/tooltip.scss +5 -0
|
@@ -44,7 +44,7 @@ table {
|
|
|
44
44
|
border-bottom: 1px solid rgb(var(--zn-border-color)) !important;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
&.with-hover tbody tr.table__row--data:
|
|
47
|
+
&.with-hover tbody tr.table__row--data:hover td {
|
|
48
48
|
background-color: rgba(var(--zn-primary), 0.05) !important;
|
|
49
49
|
cursor: pointer;
|
|
50
50
|
}
|
|
@@ -414,68 +414,24 @@ zn-menu::part(base) {
|
|
|
414
414
|
background-color: rgb(var(--zn-panel, 255, 255, 255));
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
&:hover {
|
|
422
|
-
background-color: var(--zn-color-purple-200) !important;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
td {
|
|
426
|
-
border-top: 1px solid var(--zn-color-purple-600) !important;
|
|
427
|
-
border-bottom: 1px solid var(--zn-color-purple-600) !important;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
td:first-of-type {
|
|
431
|
-
border-left: 1px solid var(--zn-color-purple-600);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
td:last-of-type {
|
|
435
|
-
border-right: 1px solid var(--zn-color-purple-600);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
&:last-of-type td:first-of-type {
|
|
439
|
-
border-bottom-left-radius: var(--zn-border-radius);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
&:last-of-type td:last-of-type {
|
|
443
|
-
border-bottom-right-radius: var(--zn-border-radius);
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
& + tr.table__row--selected td {
|
|
447
|
-
border-top: 0 !important;
|
|
448
|
-
|
|
449
|
-
&:first-of-type {
|
|
450
|
-
border-top-left-radius: 0;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
&:last-of-type {
|
|
454
|
-
border-top-right-radius: 0;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
&:has(+ tr.table__row--selected) td {
|
|
459
|
-
border-bottom: 0 !important;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
&:first-of-type td {
|
|
463
|
-
border-top: 0 !important;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
&:has(+ tr.table__row--selected) {
|
|
467
|
-
td:first-of-type {
|
|
468
|
-
border-bottom-left-radius: 0;
|
|
469
|
-
}
|
|
417
|
+
.table tr .table__head[tabindex]:focus-visible {
|
|
418
|
+
outline: var(--zn-focus-ring);
|
|
419
|
+
outline-offset: calc(-1 * var(--zn-focus-ring-width));
|
|
420
|
+
}
|
|
470
421
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
422
|
+
.table tr .table__head--checkbox,
|
|
423
|
+
.table tr .table__cell--checkbox {
|
|
424
|
+
width: 1px;
|
|
425
|
+
min-width: 0;
|
|
426
|
+
padding-right: 0;
|
|
475
427
|
}
|
|
476
428
|
|
|
477
|
-
|
|
478
|
-
|
|
429
|
+
// Visually hidden rather than display: none, which would stop a slotted zn-confirm's dialog rendering
|
|
430
|
+
.table__actions-source {
|
|
431
|
+
position: absolute;
|
|
432
|
+
width: 0;
|
|
433
|
+
height: 0;
|
|
434
|
+
overflow: hidden;
|
|
479
435
|
}
|
|
480
436
|
|
|
481
437
|
tbody tr.table__row--group th {
|
|
@@ -182,7 +182,7 @@ export default class ZnDropdown extends ZincElement {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
private async handleTriggerKeyDown(event: KeyboardEvent) {
|
|
185
|
-
if ([' ', 'Enter'
|
|
185
|
+
if ([' ', 'Enter'].includes(event.key)) {
|
|
186
186
|
event.preventDefault();
|
|
187
187
|
await this.handleTriggerClick();
|
|
188
188
|
return;
|
|
@@ -252,9 +252,12 @@ export default class ZnDropdown extends ZincElement {
|
|
|
252
252
|
|
|
253
253
|
if (event.key === 'Tab') {
|
|
254
254
|
if (this.open) {
|
|
255
|
-
event.preventDefault();
|
|
256
255
|
this.hide().then(r => r);
|
|
257
|
-
|
|
256
|
+
// Tabbing out of the menu resumes from the trigger; from the trigger, Tab moves on as usual
|
|
257
|
+
if (this.panel?.assignedElements({flatten: true}).some(el => el.matches(':focus-within'))) {
|
|
258
|
+
event.preventDefault();
|
|
259
|
+
this.focusOnTrigger();
|
|
260
|
+
}
|
|
258
261
|
return;
|
|
259
262
|
}
|
|
260
263
|
|
|
@@ -141,11 +141,34 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
// Nothing visible to clip to, so leave room for the focus ring of a control sitting flush against the edge.
|
|
145
|
+
// The body scrolls, so it can't take a clip margin — it gets a gutter cancelled by a negative margin instead.
|
|
144
146
|
&--transparent {
|
|
145
147
|
.panel__header {
|
|
146
148
|
padding-left: 0;
|
|
147
149
|
padding-right: 0;
|
|
148
150
|
}
|
|
151
|
+
|
|
152
|
+
.panel__inner,
|
|
153
|
+
.panel__content {
|
|
154
|
+
overflow: clip;
|
|
155
|
+
overflow-clip-margin: var(--zn-focus-ring-outset);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&.panel--flush .panel__body {
|
|
159
|
+
padding: var(--zn-focus-ring-outset);
|
|
160
|
+
margin: calc(var(--zn-focus-ring-outset) * -1);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.panel--flush-x .panel__body {
|
|
164
|
+
padding-inline: var(--zn-focus-ring-outset);
|
|
165
|
+
margin-inline: calc(var(--zn-focus-ring-outset) * -1);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&.panel--flush-y .panel__body {
|
|
169
|
+
padding-block: var(--zn-focus-ring-outset);
|
|
170
|
+
margin-block: calc(var(--zn-focus-ring-outset) * -1);
|
|
171
|
+
}
|
|
149
172
|
}
|
|
150
173
|
|
|
151
174
|
&--cosmic {
|
|
@@ -386,6 +386,12 @@ export default class ZnPopup extends ZincElement {
|
|
|
386
386
|
? (element: Element) => platform.getOffsetParent(element, offsetParent)
|
|
387
387
|
: platform.getOffsetParent;
|
|
388
388
|
|
|
389
|
+
// A closed popover has no size to measure, so it would first land on top of its anchor
|
|
390
|
+
if (this.popup.isConnected && !this.popup.matches(':popover-open')) {
|
|
391
|
+
this.popup.style.visibility = 'hidden';
|
|
392
|
+
this.popup.showPopover();
|
|
393
|
+
}
|
|
394
|
+
|
|
389
395
|
computePosition(this.anchorEl, this.popup, {
|
|
390
396
|
placement: this.placement,
|
|
391
397
|
middleware,
|
|
@@ -402,7 +408,8 @@ export default class ZnPopup extends ZincElement {
|
|
|
402
408
|
|
|
403
409
|
Object.assign(this.popup.style, {
|
|
404
410
|
left: `${x}px`,
|
|
405
|
-
top: `${y}px
|
|
411
|
+
top: `${y}px`,
|
|
412
|
+
visibility: ''
|
|
406
413
|
});
|
|
407
414
|
|
|
408
415
|
if (!this.popup?.isConnected) return;
|
|
@@ -191,6 +191,14 @@ export default class ZnTooltip extends ZincElement {
|
|
|
191
191
|
waitForEvent(this, 'zn-after-hide');
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
// The bubble renders inside its anchor's host (e.g. zn-button), so its clicks would reach the host's
|
|
195
|
+
// listeners. Anchor clicks target the slotted element, so only bubble clicks target the popup.
|
|
196
|
+
private handlePopupClick = (event: MouseEvent) => {
|
|
197
|
+
if (event.target === event.currentTarget) {
|
|
198
|
+
event.stopPropagation();
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
194
202
|
render() {
|
|
195
203
|
return html`
|
|
196
204
|
<zn-popup
|
|
@@ -207,7 +215,8 @@ export default class ZnTooltip extends ZincElement {
|
|
|
207
215
|
flip
|
|
208
216
|
shift
|
|
209
217
|
arrow
|
|
210
|
-
hover-bridge
|
|
218
|
+
hover-bridge
|
|
219
|
+
@click="${this.handlePopupClick}">
|
|
211
220
|
<slot slot="anchor"></slot>
|
|
212
221
|
<div part="body" id="tooltip" class="tooltip__body"
|
|
213
222
|
role="tooltip"
|