@kubex/zinc 2.0.1 → 2.0.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/custom-elements.json +373 -320
- package/dist/vscode.html-custom-data.json +30 -30
- package/dist/web-types.json +78 -78
- package/dist/zn.d.ts +11 -6
- package/dist/zn.min.js +323 -308
- package/package.json +1 -1
- package/src/components/button/button.component.ts +2 -2
- package/src/components/button/button.test.ts +7 -0
- package/src/components/chart/chart.component.ts +1 -1
- package/src/components/data-table/data-table.component.ts +48 -21
- package/src/components/data-table/data-table.scss +26 -8
- package/src/components/data-table/data-table.test.ts +54 -1
- package/src/components/editor/modules/dialog/dialog.test.ts +1 -1
- package/src/components/expanding-action/expanding-action.component.ts +1 -1
- package/src/components/filter-wrapper/filter-wrapper.component.ts +1 -1
- package/src/components/inline-edit/inline-edit.component.ts +1 -2
- package/src/components/inline-edit/inline-edit.scss +20 -20
- package/src/components/input/input.component.ts +38 -2
- package/src/components/input/input.scss +68 -4
- package/src/components/input/input.test.ts +1 -1
- package/src/components/nav-list/nav-list.test.ts +1 -1
- package/src/components/navbar/navbar.component.ts +14 -8
- package/src/components/panel/panel.component.ts +1 -1
- package/src/components/priority-list/priority-list.test.ts +1 -1
- package/src/components/split-pane/split-pane.component.ts +1 -1
- package/src/components/tabs/tabs.component.ts +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {classMap} from "lit/directives/class-map.js";
|
|
2
2
|
import {type CSSResultGroup, html, type PropertyValues, unsafeCSS} from 'lit';
|
|
3
3
|
import {ifDefined} from "lit/directives/if-defined.js";
|
|
4
|
+
import {type IndicatorEdges, slideTabIndicator, squishTabIndicator} from "../../internal/tab-indicator";
|
|
4
5
|
import {MutationController} from '@lit-labs/observers/mutation-controller.js';
|
|
5
6
|
import {property} from 'lit/decorators.js';
|
|
6
7
|
import {ResizeController} from '@lit-labs/observers/resize-controller.js';
|
|
7
|
-
import {type IndicatorEdges, slideTabIndicator, squishTabIndicator} from "../../internal/tab-indicator";
|
|
8
8
|
import {Store} from "../../internal/storage";
|
|
9
9
|
import ZincElement from '../../internal/zinc-element';
|
|
10
10
|
import ZnDropdown from "../dropdown";
|
|
@@ -111,6 +111,7 @@ export default class ZnNavbar extends ZincElement {
|
|
|
111
111
|
private _indicator: HTMLElement | null = null;
|
|
112
112
|
private _indicatorFrame: number | null = null;
|
|
113
113
|
private _indicatorTab: HTMLElement | null = null;
|
|
114
|
+
private _indicatorStripWidth = 0;
|
|
114
115
|
private _indicatorTarget: IndicatorEdges | null = null;
|
|
115
116
|
private _expandable: HTMLElement | null = null;
|
|
116
117
|
private readonly _lightDomClones = new WeakMap<HTMLElement, HTMLElement>();
|
|
@@ -242,18 +243,23 @@ export default class ZnNavbar extends ZincElement {
|
|
|
242
243
|
|
|
243
244
|
// The indicator scrolls with the tabs, so it is placed in the strip's content coordinates
|
|
244
245
|
const box = container.getBoundingClientRect();
|
|
245
|
-
|
|
246
|
-
const
|
|
246
|
+
// An ancestor mid scale-in (e.g. a modal opening) shrinks every rect, and its end fires no resize to re-measure
|
|
247
|
+
const scaleX = box.width / container.offsetWidth || 1;
|
|
248
|
+
const scaleY = box.height / container.offsetHeight || 1;
|
|
249
|
+
const toStrip = (x: number) => (x - box.left) / scaleX + container.scrollLeft;
|
|
250
|
+
const target = {left: toStrip(tab.left), right: toStrip(tab.right)};
|
|
247
251
|
const previous = this._indicatorTarget;
|
|
248
252
|
const tabChanged = active !== this._indicatorTab;
|
|
249
253
|
const ready = indicator.classList.contains('navbar__indicator--ready');
|
|
250
254
|
this._indicatorTab = active ?? null;
|
|
251
|
-
|
|
252
|
-
|
|
255
|
+
const stripResized = container.clientWidth !== this._indicatorStripWidth;
|
|
256
|
+
this._indicatorStripWidth = container.clientWidth;
|
|
257
|
+
if (active && (tabChanged || stripResized)) {
|
|
258
|
+
this._revealTab(active, ready && tabChanged);
|
|
253
259
|
}
|
|
254
260
|
// Exposed for ::part(indicator) styles that fill the tab rather than underline it.
|
|
255
|
-
setStyle(indicator, '--zn-navbar-indicator-top', `${tab.top - box.top}px`);
|
|
256
|
-
setStyle(indicator, '--zn-navbar-indicator-height', `${tab.height}px`);
|
|
261
|
+
setStyle(indicator, '--zn-navbar-indicator-top', `${(tab.top - box.top) / scaleY}px`);
|
|
262
|
+
setStyle(indicator, '--zn-navbar-indicator-height', `${tab.height / scaleY}px`);
|
|
257
263
|
indicator.classList.toggle('navbar__indicator--shown', true);
|
|
258
264
|
if (previous && Math.abs(previous.left - target.left) < 0.5 && Math.abs(previous.right - target.right) < 0.5) {
|
|
259
265
|
return;
|
|
@@ -271,7 +277,7 @@ export default class ZnNavbar extends ZincElement {
|
|
|
271
277
|
indicator.style.width = `${target.right - target.left}px`;
|
|
272
278
|
this._indicatorTarget = target;
|
|
273
279
|
if (slide) {
|
|
274
|
-
slideTabIndicator(indicator, {left: drawn.left
|
|
280
|
+
slideTabIndicator(indicator, {left: toStrip(drawn.left), right: toStrip(drawn.right)}, target);
|
|
275
281
|
}
|
|
276
282
|
|
|
277
283
|
// The first placement jumps into position; only later moves animate.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {ifDefined} from "lit/directives/if-defined.js";
|
|
2
1
|
import {classMap} from "lit/directives/class-map.js";
|
|
3
2
|
import {type CSSResultGroup, html, type PropertyValues, unsafeCSS} from 'lit';
|
|
4
3
|
import {HasSlotController} from "../../internal/slot";
|
|
4
|
+
import {ifDefined} from "lit/directives/if-defined.js";
|
|
5
5
|
import {property, state} from 'lit/decorators.js';
|
|
6
6
|
import {registerCosmicBorder} from "../../internal/cosmic-border";
|
|
7
7
|
import ZincElement from '../../internal/zinc-element';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../../dist/zn.min.js';
|
|
2
2
|
import {aTimeout, expect, fixture, html} from '@open-wc/testing';
|
|
3
|
-
import {centre,
|
|
3
|
+
import {centre, dragTo, drop, startDrag} from '../../internal/test-drag';
|
|
4
4
|
|
|
5
5
|
describe('<zn-priority-list>', () => {
|
|
6
6
|
it('should render a component', async () => {
|
|
@@ -4,8 +4,8 @@ import {on} from "../../utilities/on";
|
|
|
4
4
|
import {Store} from "../../internal/storage";
|
|
5
5
|
import ZincElement from '../../internal/zinc-element';
|
|
6
6
|
|
|
7
|
-
import styles from './split-pane.scss';
|
|
8
7
|
import { PropertyValues } from "@lit/reactive-element";
|
|
8
|
+
import styles from './split-pane.scss';
|
|
9
9
|
|
|
10
10
|
type NavigationItem = {
|
|
11
11
|
caption: string;
|
|
@@ -14,11 +14,11 @@ import {HasSlotController} from "../../internal/slot";
|
|
|
14
14
|
import {ifDefined} from "lit/directives/if-defined.js";
|
|
15
15
|
import {md5} from "../../utilities/md5";
|
|
16
16
|
import {MutationController} from '@lit-labs/observers/mutation-controller.js';
|
|
17
|
+
import {onHoverIntent} from '../../internal/hover-intent';
|
|
18
|
+
import {pointerInitiated} from '../../internal/input-modality';
|
|
17
19
|
import {property} from 'lit/decorators.js';
|
|
18
20
|
import {Store} from "../../internal/storage";
|
|
19
21
|
import ZincElement from '../../internal/zinc-element';
|
|
20
|
-
import {onHoverIntent} from '../../internal/hover-intent';
|
|
21
|
-
import {pointerInitiated} from '../../internal/input-modality';
|
|
22
22
|
|
|
23
23
|
// Tabs load in such a way that the global sheet has to be re-applied inside the shadow root.
|
|
24
24
|
import bootStyles from '../../../scss/boot.scss';
|