@mintplayer/web-components 2.15.0 → 2.17.0
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/accordion/index.mjs +5 -5
- package/calendar/index.mjs +1 -1
- package/carousel/index.mjs +57 -143
- package/charts/core/index.mjs +30 -20
- package/charts/core/src/attributes.d.ts +18 -0
- package/charts/core/src/index.d.ts +2 -0
- package/charts/core/src/view-window.d.ts +46 -0
- package/charts/hierarchy/index.mjs +245 -256
- package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +1 -3
- package/charts/sparkline/index.mjs +27 -26
- package/charts/trend/index.mjs +21 -20
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +1 -0
- package/chunks/attributes-L3eKsbdy.mjs +16 -0
- package/chunks/color-mode-warning-71FmlzWX.mjs +13 -0
- package/chunks/{form-check.styles-B0pxJ6YC.mjs → form-check.styles-DqvBnspm.mjs} +24 -3
- package/chunks/{mp-calendar.element-CJ8-t-Zn.mjs → mp-calendar.element-BIHS9SZZ.mjs} +11 -6
- package/chunks/{mp-checkbox-CzwS7Y_t.mjs → mp-checkbox-zV83gILn.mjs} +44 -36
- package/chunks/mp-datatable-eRpl7-2V.mjs +2238 -0
- package/chunks/{mp-datetime-picker.element-D1CiLbHm.mjs → mp-datetime-picker.element-Cxu5-qRE.mjs} +29 -32
- package/chunks/{mp-pagination-Dea75mD4.mjs → mp-pagination-hGy4dL7p.mjs} +9 -4
- package/chunks/{mp-radio-cL46sUA0.mjs → mp-radio-BhRVNdKp.mjs} +32 -28
- package/chunks/{mp-select-BNrbPwN4.mjs → mp-select-CgqYFvUj.mjs} +41 -26
- package/chunks/{mp-splitter-Ckn1kN4v.mjs → mp-splitter-DLehrw3Y.mjs} +144 -120
- package/chunks/{mp-timepicker.element-COZEUIoE.mjs → mp-timepicker.element-BiB9lkgc.mjs} +58 -45
- package/chunks/{mp-toggle-button-eo_aTQtu.mjs → mp-toggle-button-CaS9uYLE.mjs} +26 -24
- package/chunks/{mp-treeview-C8iltDbq.mjs → mp-treeview-CaMTDrvY.mjs} +51 -50
- package/chunks/{overlay-controller-D6agzzOI.mjs → overlay-controller-BHDagokg.mjs} +130 -70
- package/chunks/{id-DNZVAnGC.mjs → resource.service--lqLwEqk.mjs} +144 -206
- package/chunks/view-window-DGvFiDnW.mjs +263 -0
- package/code-snippet/index.mjs +70 -66
- package/code-snippet/src/hljs-loaders.generated.d.ts +1 -1
- package/custom-elements.json +65750 -0
- package/datatable/index.mjs +6 -5
- package/datatable/src/components/column-resize.d.ts +11 -0
- package/datatable/src/components/mp-datatable.d.ts +206 -1
- package/datatable/src/index.d.ts +3 -1
- package/datatable/src/types/column-def.d.ts +61 -0
- package/datatable/src/types/filter.d.ts +138 -0
- package/datatable/src/types/index.d.ts +3 -2
- package/datatable/src/types/labels.d.ts +58 -0
- package/datepicker/index.mjs +10 -9
- package/datetime-picker/index.mjs +1 -1
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
- package/dock/index.mjs +430 -463
- package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
- package/dock/src/core/resize.d.ts +60 -0
- package/dropdown-menu/index.mjs +4 -2
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
- package/dropdown-menu/src/index.d.ts +1 -1
- package/dropdown-menu/src/types/dropdown.d.ts +14 -1
- package/dropdown-menu/src/types/index.d.ts +1 -1
- package/file-manager/index.mjs +63 -61
- package/file-manager/src/components/mp-file-manager.d.ts +4 -3
- package/multi-range/index.mjs +56 -50
- package/multi-range/src/mint-multi-range.element.d.ts +4 -10
- package/multi-range/src/pointer-geometry.d.ts +31 -0
- package/navbar/index.mjs +89 -439
- package/overlay/index.mjs +5 -2
- package/overlay/src/index.d.ts +2 -0
- package/overlay/src/overlay-controller.d.ts +27 -14
- package/overlay/src/overlay-portal.d.ts +53 -0
- package/overlay/src/placement.d.ts +48 -0
- package/package.json +7 -1
- package/pagination/index.mjs +1 -1
- package/phone-input/index.mjs +44 -40
- package/phone-input/src/components/stack.d.ts +8 -0
- package/query-builder/index.mjs +418 -466
- package/query-builder/src/dnd/drag-controller.d.ts +12 -8
- package/query-builder/src/mp-query-builder.element.d.ts +5 -1
- package/query-builder/src/mp-query-condition.element.d.ts +1 -0
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +1 -1
- package/ribbon/index.mjs +477 -498
- package/ribbon/src/core/band-text-color.d.ts +10 -0
- package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
- package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
- package/ribbon/src/mp-ribbon.element.d.ts +0 -27
- package/scheduler/index.mjs +726 -711
- package/scheduler/src/components/mp-scheduler.d.ts +19 -3
- package/scheduler/src/drag/drag-manager.d.ts +1 -9
- package/scheduler/src/input/input-handler.d.ts +12 -2
- package/scheduler/src/utils/geometry.d.ts +39 -0
- package/scheduler/src/views/timeline-view.d.ts +0 -1
- package/scheduler-core/index.mjs +84 -71
- package/scheduler-core/src/services/resource.service.d.ts +0 -12
- package/scheduler-core/src/services/timeline.service.d.ts +0 -9
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +1 -0
- package/signature-pad/index.mjs +21 -23
- package/signature-pad/src/canvas-point.d.ts +26 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +16 -0
- package/splitter/src/managers/index.d.ts +1 -0
- package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
- package/swiper-core/index.mjs +2 -2
- package/theming/bs-theme-preboot.js +1 -0
- package/theming/color-mode.css +36 -0
- package/theming/index.d.ts +1 -0
- package/theming/index.mjs +327 -0
- package/theming/src/components/mp-theme-toggle.d.ts +71 -0
- package/theming/src/cookie.d.ts +31 -0
- package/theming/src/index.d.ts +5 -0
- package/theming/src/preboot.d.ts +1 -0
- package/theming/src/resolve.d.ts +36 -0
- package/theming/src/store.d.ts +27 -0
- package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
- package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
- package/theming/src/toggle-modes.d.ts +23 -0
- package/tile-manager/index.mjs +252 -211
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
- package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
- package/timeline/index.mjs +156 -164
- package/timeline/src/components/mp-timeline.d.ts +41 -7
- package/timepicker/index.mjs +7 -4
- package/timepicker/src/mp-time-list.element.d.ts +26 -0
- package/timepicker/src/mp-timepicker.element.d.ts +3 -0
- package/toggle-button/index.mjs +1 -1
- package/tree-select/index.mjs +21 -9
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +6 -4
- package/chunks/color-DIeST-IS.mjs +0 -224
- package/chunks/mp-datatable-UJI8E73X.mjs +0 -1400
- package/datatable/src/styles/datatable.styles.d.ts +0 -2
- package/query-builder/src/mp-query-condition.element.template.d.ts +0 -2
|
@@ -56,6 +56,13 @@ export declare class MpTimeline extends LitElement {
|
|
|
56
56
|
set reverse(value: boolean);
|
|
57
57
|
get selectable(): TimelineSelectable;
|
|
58
58
|
set selectable(value: TimelineSelectable);
|
|
59
|
+
/**
|
|
60
|
+
* Opt-in keyboard reachability for click-only consumers (no selection): rows
|
|
61
|
+
* become buttons in a group with a roving tab stop, and Enter/Space emit
|
|
62
|
+
* `item-click`.
|
|
63
|
+
*/
|
|
64
|
+
get activatable(): boolean;
|
|
65
|
+
set activatable(value: boolean);
|
|
59
66
|
get isServerSide(): boolean;
|
|
60
67
|
set isServerSide(value: boolean);
|
|
61
68
|
connectedCallback(): void;
|
|
@@ -69,17 +76,41 @@ export declare class MpTimeline extends LitElement {
|
|
|
69
76
|
private isSelected;
|
|
70
77
|
render(): TemplateResult;
|
|
71
78
|
private renderDataItems;
|
|
72
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Declarative-mode sync, shared by slotchange, the MutationObserver and
|
|
81
|
+
* updated(): seed the authored selection once, then project state.
|
|
82
|
+
*/
|
|
83
|
+
private syncDeclarative;
|
|
73
84
|
private get declarativeItems();
|
|
74
85
|
private get itemElements();
|
|
75
86
|
private seedDeclarativeSelection;
|
|
87
|
+
/**
|
|
88
|
+
* Projects the container state onto slotted items — the same role, selection
|
|
89
|
+
* and roving-tabindex contract `renderDataItems` renders in data mode.
|
|
90
|
+
*/
|
|
76
91
|
private enhanceDeclarativeItems;
|
|
92
|
+
/** Re-applies roving tabindex / selection state after an interaction. */
|
|
93
|
+
private refreshItems;
|
|
94
|
+
/** Items are keyboard-reachable when selectable, or opted in via `activatable`. */
|
|
95
|
+
private get roving();
|
|
96
|
+
/**
|
|
97
|
+
* activatable-without-selection = buttons in a group: a `listitem` may not be
|
|
98
|
+
* interactive, so the item role follows what the items actually are.
|
|
99
|
+
*/
|
|
100
|
+
private get itemRole();
|
|
77
101
|
private onClick;
|
|
78
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* The item-click emission shared by pointer and keyboard activation.
|
|
104
|
+
* Returns false when there is no enabled item at `index`.
|
|
105
|
+
*/
|
|
79
106
|
private emitItemClick;
|
|
80
|
-
/**
|
|
81
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Arrows rove, Home/End jump; Enter/Space select when selectable, and emit
|
|
109
|
+
* item-click when merely activatable (activation without selection).
|
|
110
|
+
*/
|
|
82
111
|
private onKeydown;
|
|
112
|
+
/** The index a navigation key moves to, or undefined for a non-navigation key. */
|
|
113
|
+
private navigationTarget;
|
|
83
114
|
private itemFromEvent;
|
|
84
115
|
private modelFor;
|
|
85
116
|
private applySelection;
|
|
@@ -88,10 +119,13 @@ export declare class MpTimeline extends LitElement {
|
|
|
88
119
|
private modelById;
|
|
89
120
|
private resolvedActiveIndex;
|
|
90
121
|
private setActiveIndex;
|
|
91
|
-
|
|
122
|
+
/**
|
|
123
|
+
* The next enabled item from `from` in direction `dir`, wrapping; -1 when no
|
|
124
|
+
* item is enabled. A `from` of -1 (focus not on an item) starts at the
|
|
125
|
+
* current tab stop.
|
|
126
|
+
*/
|
|
127
|
+
private stepFrom;
|
|
92
128
|
private moveFocusTo;
|
|
93
|
-
private firstFocusable;
|
|
94
|
-
private lastFocusable;
|
|
95
129
|
}
|
|
96
130
|
declare global {
|
|
97
131
|
interface HTMLElementTagNameMap {
|
package/timepicker/index.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as a, M as m, a as r, h as t, m as i, r as T } from "../chunks/mp-timepicker.element-BiB9lkgc.mjs";
|
|
2
2
|
export {
|
|
3
|
-
a as
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
a as DEFAULT_TIME_STEP,
|
|
4
|
+
m as MpTimeListElement,
|
|
5
|
+
r as MpTimepickerElement,
|
|
6
|
+
t as hour12Converter,
|
|
7
|
+
i as minutesOfDay,
|
|
8
|
+
T as resolveTimeStep
|
|
6
9
|
};
|
|
@@ -12,6 +12,29 @@ export type Hour12Mode = boolean | 'auto';
|
|
|
12
12
|
* otherwise). Naming the step makes that decision visible at the call site.
|
|
13
13
|
*/
|
|
14
14
|
export declare function minutesOfDay(d: Date | null | undefined): number | null;
|
|
15
|
+
/** The slot spacing used when `step` holds no usable value. */
|
|
16
|
+
export declare const DEFAULT_TIME_STEP: TimeStep;
|
|
17
|
+
/**
|
|
18
|
+
* The slot spacing `step` actually yields: a finite number of minutes in
|
|
19
|
+
* (0, 1440], else {@link DEFAULT_TIME_STEP}.
|
|
20
|
+
*
|
|
21
|
+
* `step` is a lit Number attribute, so removing it sets the property to `null`
|
|
22
|
+
* and a non-numeric value sets `NaN`. Dividing the day by `null` (that is, by 0)
|
|
23
|
+
* made the slot loop unbounded and hung the page; `NaN` rendered an empty
|
|
24
|
+
* listbox. Every consumer of the step goes through this instead.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveTimeStep(step: unknown): number;
|
|
27
|
+
/**
|
|
28
|
+
* Attribute converter for `hour12`, shared by every element that owns the mode.
|
|
29
|
+
*
|
|
30
|
+
* The attribute was untyped, so lit stored its STRING: `hour12="true"` became
|
|
31
|
+
* `'true'`, which is neither `true` nor `false`, and the element fell back to
|
|
32
|
+
* the locale — the attribute form of the option silently did nothing. A bare
|
|
33
|
+
* `hour12` reads as true; a removed or unrecognised value is `'auto'`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const hour12Converter: {
|
|
36
|
+
fromAttribute(value: string | null): Hour12Mode;
|
|
37
|
+
};
|
|
15
38
|
/**
|
|
16
39
|
* mp-time-list — Bootstrap-styled time-slot listbox primitive.
|
|
17
40
|
*
|
|
@@ -54,6 +77,9 @@ export declare class MpTimeListElement extends LitElement {
|
|
|
54
77
|
};
|
|
55
78
|
hour12: {
|
|
56
79
|
attribute: string;
|
|
80
|
+
converter: {
|
|
81
|
+
fromAttribute(value: string | null): Hour12Mode;
|
|
82
|
+
};
|
|
57
83
|
};
|
|
58
84
|
locale: {
|
|
59
85
|
attribute: string;
|
package/toggle-button/index.mjs
CHANGED
package/tree-select/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { unsafeCSS as p, LitElement as u, nothing as o } from "lit";
|
|
2
2
|
import { s as m, i as b, d } from "../chunks/install-light-styles-DbCAGFOC.mjs";
|
|
3
3
|
import { repeat as f } from "lit/directives/repeat.js";
|
|
4
|
-
import { O as _ } from "../chunks/overlay-controller-
|
|
4
|
+
import { O as _ } from "../chunks/overlay-controller-BHDagokg.mjs";
|
|
5
5
|
import { L as v } from "../chunks/live-announcer-Bi0orG4n.mjs";
|
|
6
6
|
import { d as g } from "../chunks/focus-restore-DxuP1Oe2.mjs";
|
|
7
7
|
import { H as y } from "../chunks/host-aria-WSGs7SPQ.mjs";
|
|
8
|
-
import "../chunks/mp-treeview-
|
|
8
|
+
import "../chunks/mp-treeview-CaMTDrvY.mjs";
|
|
9
9
|
const w = p(`mp-tree-select {
|
|
10
10
|
display: inline-block;
|
|
11
11
|
width: 100%;
|
|
@@ -167,6 +167,12 @@ button[data-mps=tree-select] {
|
|
|
167
167
|
transition: transform 0.15s ease;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
.ts-caret-icon[data-mps=tree-select] {
|
|
171
|
+
display: inline-flex;
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 100%;
|
|
174
|
+
}
|
|
175
|
+
|
|
170
176
|
mp-tree-select[data-menu-open] .ts-caret[data-mps=tree-select] {
|
|
171
177
|
transform: rotate(180deg);
|
|
172
178
|
}
|
|
@@ -202,6 +208,7 @@ mp-tree-select[data-menu-open] .ts-panel[data-mps=tree-select] {
|
|
|
202
208
|
.ts-panel-body[data-mps=tree-select] {
|
|
203
209
|
flex: 1 1 auto;
|
|
204
210
|
overflow: auto;
|
|
211
|
+
max-height: var(--mp-tree-select-panel-max-height, 300px);
|
|
205
212
|
}
|
|
206
213
|
|
|
207
214
|
.ts-state[data-mps=tree-select] {
|
|
@@ -377,7 +384,7 @@ class S extends u {
|
|
|
377
384
|
return this._scrollHeight;
|
|
378
385
|
}
|
|
379
386
|
set panelScrollHeight(e) {
|
|
380
|
-
this._scrollHeight = e || "300px", this.
|
|
387
|
+
this._scrollHeight = e || "300px", this.style.setProperty("--mp-tree-select-panel-max-height", this._scrollHeight);
|
|
381
388
|
}
|
|
382
389
|
get disabled() {
|
|
383
390
|
return this._disabled;
|
|
@@ -393,11 +400,14 @@ class S extends u {
|
|
|
393
400
|
}
|
|
394
401
|
attributeChangedCallback(e, t, s) {
|
|
395
402
|
switch (super.attributeChangedCallback(e, t, s), e) {
|
|
403
|
+
// Enum and numeric attributes: a removed or unrecognised value falls back to
|
|
404
|
+
// the default instead of reaching the setter verbatim (an unknown mode used
|
|
405
|
+
// to disable single-mode pruning; a non-numeric debounce became 0 ms).
|
|
396
406
|
case "mode":
|
|
397
|
-
this.mode = s
|
|
407
|
+
this.mode = s === "multiple" || s === "checkbox" ? s : "single";
|
|
398
408
|
break;
|
|
399
409
|
case "variant":
|
|
400
|
-
this.variant = s
|
|
410
|
+
this.variant = s === "button" ? "button" : "textbox";
|
|
401
411
|
break;
|
|
402
412
|
case "cascade-select":
|
|
403
413
|
this.cascadeSelect = s !== null;
|
|
@@ -414,9 +424,11 @@ class S extends u {
|
|
|
414
424
|
case "disabled":
|
|
415
425
|
this.disabled = s !== null;
|
|
416
426
|
break;
|
|
417
|
-
case "search-debounce-ms":
|
|
418
|
-
|
|
427
|
+
case "search-debounce-ms": {
|
|
428
|
+
const r = s === null ? NaN : Number(s);
|
|
429
|
+
this.searchDebounceMs = Number.isFinite(r) ? r : 200;
|
|
419
430
|
break;
|
|
431
|
+
}
|
|
420
432
|
case "aria-label":
|
|
421
433
|
this.requestUpdate();
|
|
422
434
|
break;
|
|
@@ -737,7 +749,7 @@ class S extends u {
|
|
|
737
749
|
}
|
|
738
750
|
renderCaret() {
|
|
739
751
|
const e = document.createElement("span");
|
|
740
|
-
return e.
|
|
752
|
+
return e.className = "ts-caret-icon", e.innerHTML = x, d(e, "tree-select"), e;
|
|
741
753
|
}
|
|
742
754
|
renderPanel() {
|
|
743
755
|
return a`
|
|
@@ -753,7 +765,7 @@ class S extends u {
|
|
|
753
765
|
@input=${(e) => this.onSearchInput(e)}
|
|
754
766
|
/>
|
|
755
767
|
</div>` : o}
|
|
756
|
-
<div class="ts-panel-body"
|
|
768
|
+
<div class="ts-panel-body">${this.renderBody()}</div>
|
|
757
769
|
${this.renderLoadMore()}
|
|
758
770
|
${this.footerTemplate ? a`<div class="ts-panel-footer">${this.footerTemplate()}</div>` : o}
|
|
759
771
|
</div>
|
package/treeview/index.mjs
CHANGED
|
@@ -106,10 +106,12 @@ export declare class MpTreeview extends LitElement {
|
|
|
106
106
|
private renderNode;
|
|
107
107
|
private computeVisibleOrder;
|
|
108
108
|
private syncFocusAfterUpdate;
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
/**
|
|
110
|
+
* The host is generic and not itself focusable (light tier, no
|
|
111
|
+
* delegatesFocus), so a bare host focus() would be a silent no-op. Hand it
|
|
112
|
+
* to the roving tab stop instead — the row a Tab would have reached.
|
|
113
|
+
*/
|
|
114
|
+
focus(options?: FocusOptions): void;
|
|
113
115
|
private onRowClick;
|
|
114
116
|
private onChevronClick;
|
|
115
117
|
private onRowKeydown;
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
function Q(t) {
|
|
2
|
-
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), o = (a, u) => {
|
|
3
|
-
s.set(a.id, a), r.set(a.id, u);
|
|
4
|
-
const l = a.children?.length ? a.children.map((i) => o(i, a)).reduce((i, f) => i + f, 0) : a.value ?? 0;
|
|
5
|
-
n.set(a.id, l);
|
|
6
|
-
const c = (a.children ?? []).filter((i) => e.get(i.id) !== void 0), h = c.map((i) => n.get(i.id) ?? 0).reduce((i, f) => i + f, 0);
|
|
7
|
-
return e.set(
|
|
8
|
-
a.id,
|
|
9
|
-
a.colorValue !== void 0 ? a.colorValue : h > 0 ? c.map((i) => (e.get(i.id) ?? 0) * (n.get(i.id) ?? 0)).reduce((i, f) => i + f, 0) / h : void 0
|
|
10
|
-
), l;
|
|
11
|
-
};
|
|
12
|
-
return o(t, null), { root: t, byId: s, parents: r, values: n, colorValues: e };
|
|
13
|
-
}
|
|
14
|
-
function V(t, s) {
|
|
15
|
-
const r = (n) => n ? [...r(t.parents.get(n.id)), n] : [];
|
|
16
|
-
return r(s);
|
|
17
|
-
}
|
|
18
|
-
function q(t, s) {
|
|
19
|
-
return V(t, s).length;
|
|
20
|
-
}
|
|
21
|
-
const O = (t) => !!(t.children?.length || t.hasChildren);
|
|
22
|
-
function W(t, s) {
|
|
23
|
-
return [...s.children ?? []].sort(
|
|
24
|
-
(r, n) => (t.values.get(n.id) ?? 0) - (t.values.get(r.id) ?? 0)
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
function D(t, s) {
|
|
28
|
-
return s !== void 0 && t.byId.get(s) || t.root;
|
|
29
|
-
}
|
|
30
|
-
function X(t, s) {
|
|
31
|
-
const r = (n) => n.children?.length ? 1 + Math.max(...n.children.map(r)) : 0;
|
|
32
|
-
return r(D(t, s));
|
|
33
|
-
}
|
|
34
|
-
function Y(t, s, r = {}) {
|
|
35
|
-
const { maxDepth: n = 2, minFraction: e = 0 } = r, o = D(t, s), a = [], u = (l, c, h, i, f) => {
|
|
36
|
-
if (i > n) return;
|
|
37
|
-
const g = W(t, l);
|
|
38
|
-
if (!g.length) return;
|
|
39
|
-
const M = g.map((m) => t.values.get(m.id) ?? 0).reduce((m, $) => m + $, 0);
|
|
40
|
-
g.reduce((m, $, y) => {
|
|
41
|
-
const x = M > 0 ? (t.values.get($.id) ?? 0) / M : 1 / g.length, p = m + (h - c) * x;
|
|
42
|
-
return p - m >= e && p > m && (a.push({
|
|
43
|
-
node: $,
|
|
44
|
-
x0: m,
|
|
45
|
-
x1: p,
|
|
46
|
-
depth: i,
|
|
47
|
-
level: f + 1,
|
|
48
|
-
setsize: g.length,
|
|
49
|
-
posinset: y + 1,
|
|
50
|
-
hasChildren: O($)
|
|
51
|
-
}), u($, m, p, i + 1, f + 1)), p;
|
|
52
|
-
}, c);
|
|
53
|
-
};
|
|
54
|
-
return u(o, 0, 1, 1, q(t, o)), a;
|
|
55
|
-
}
|
|
56
|
-
function S(t, s) {
|
|
57
|
-
const r = t.reduce((u, l) => u + l, 0);
|
|
58
|
-
if (r === 0 || s === 0) return 1 / 0;
|
|
59
|
-
const n = Math.max(...t), e = Math.min(...t), o = r * r, a = s * s;
|
|
60
|
-
return Math.max(a * n / o, o / (a * e));
|
|
61
|
-
}
|
|
62
|
-
function _(t, s) {
|
|
63
|
-
const r = /* @__PURE__ */ new Map();
|
|
64
|
-
let n = { ...s }, e = t.filter((u) => u.area > 0);
|
|
65
|
-
const o = (u) => {
|
|
66
|
-
const l = u.reduce((i, f) => i + f.area, 0), c = n.x1 - n.x0, h = n.y1 - n.y0;
|
|
67
|
-
if (!(l <= 0 || c <= 0 || h <= 0))
|
|
68
|
-
if (c >= h) {
|
|
69
|
-
const i = l / h;
|
|
70
|
-
u.reduce((f, g) => {
|
|
71
|
-
const M = g.area / i;
|
|
72
|
-
return r.set(g.id, { x0: n.x0, y0: f, x1: n.x0 + i, y1: f + M }), f + M;
|
|
73
|
-
}, n.y0), n = { ...n, x0: n.x0 + i };
|
|
74
|
-
} else {
|
|
75
|
-
const i = l / c;
|
|
76
|
-
u.reduce((f, g) => {
|
|
77
|
-
const M = g.area / i;
|
|
78
|
-
return r.set(g.id, { x0: f, y0: n.y0, x1: f + M, y1: n.y0 + i }), f + M;
|
|
79
|
-
}, n.x0), n = { ...n, y0: n.y0 + i };
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
let a = [];
|
|
83
|
-
for (; e.length; ) {
|
|
84
|
-
const u = Math.min(n.x1 - n.x0, n.y1 - n.y0), l = [...a, e[0]];
|
|
85
|
-
!a.length || S(l.map((c) => c.area), u) <= S(a.map((c) => c.area), u) ? (a = l, e = e.slice(1)) : (o(a), a = []);
|
|
86
|
-
}
|
|
87
|
-
return o(a), r;
|
|
88
|
-
}
|
|
89
|
-
function tt(t, s, r = {}) {
|
|
90
|
-
const { maxDepth: n = 2, minArea: e = 0, childPadding: o = 0, childHeaderSpace: a = 0 } = r, u = D(t, s), l = [], c = (i) => {
|
|
91
|
-
const f = {
|
|
92
|
-
x0: i.x0 + o,
|
|
93
|
-
y0: i.y0 + o + a,
|
|
94
|
-
x1: i.x1 - o,
|
|
95
|
-
y1: i.y1 - o
|
|
96
|
-
};
|
|
97
|
-
return f.x1 - f.x0 > 0 && f.y1 - f.y0 > 0 ? f : null;
|
|
98
|
-
}, h = (i, f, g, M) => {
|
|
99
|
-
if (g > n) return;
|
|
100
|
-
const m = g === 1 ? f : c(f);
|
|
101
|
-
if (!m) return;
|
|
102
|
-
const $ = W(t, i);
|
|
103
|
-
if (!$.length) return;
|
|
104
|
-
const y = (m.x1 - m.x0) * (m.y1 - m.y0), x = $.map((d) => t.values.get(d.id) ?? 0).reduce((d, L) => d + L, 0), p = $.map((d) => ({
|
|
105
|
-
id: d.id,
|
|
106
|
-
area: x > 0 ? (t.values.get(d.id) ?? 0) / x * y : y / $.length
|
|
107
|
-
})), w = _(p, m);
|
|
108
|
-
$.map((d, L) => ({ kid: d, i: L, r: w.get(d.id) })).filter((d) => !!d.r && (d.r.x1 - d.r.x0) * (d.r.y1 - d.r.y0) >= e).map((d) => (l.push({
|
|
109
|
-
node: d.kid,
|
|
110
|
-
...d.r,
|
|
111
|
-
depth: g,
|
|
112
|
-
level: M + 1,
|
|
113
|
-
setsize: $.length,
|
|
114
|
-
posinset: d.i + 1,
|
|
115
|
-
hasChildren: O(d.kid)
|
|
116
|
-
}), h(d.kid, d.r, g + 1, M + 1), d));
|
|
117
|
-
};
|
|
118
|
-
return h(u, { x0: 0, y0: 0, x1: 1, y1: 1 }, 1, q(t, u)), l;
|
|
119
|
-
}
|
|
120
|
-
const j = 2 * Math.PI, I = 1e-6, b = (t, s, r) => A(t + s * Math.sin(r)), v = (t, s, r) => A(t - s * Math.cos(r)), A = (t) => Math.round(t * 1e3) / 1e3;
|
|
121
|
-
function z(t, s, r, n) {
|
|
122
|
-
const e = `M ${b(t, n, 0)} ${v(s, n, 0)} A ${n} ${n} 0 1 1 ${b(t, n, Math.PI)} ${v(s, n, Math.PI)} A ${n} ${n} 0 1 1 ${b(t, n, 0)} ${v(s, n, 0)} Z`;
|
|
123
|
-
if (r <= I) return e;
|
|
124
|
-
const o = `M ${b(t, r, 0)} ${v(s, r, 0)} A ${r} ${r} 0 1 0 ${b(t, r, Math.PI)} ${v(s, r, Math.PI)} A ${r} ${r} 0 1 0 ${b(t, r, 0)} ${v(s, r, 0)} Z`;
|
|
125
|
-
return `${e} ${o}`;
|
|
126
|
-
}
|
|
127
|
-
function nt(t, s, r, n, e, o, a = {}) {
|
|
128
|
-
const { padAngle: u = 0, ringGap: l = 1 } = a, c = Math.max(0, r), h = Math.max(c, n - l);
|
|
129
|
-
if (h - c <= I || o - e <= I) return "";
|
|
130
|
-
if (o - e >= j - I) return z(t, s, c, h);
|
|
131
|
-
const i = Math.min((o - e) / 2, u) / 2, f = i > 0 ? a.padRadius ?? Math.sqrt(c * c + h * h) : 0, g = (H) => H > I ? Math.asin(Math.min(1, f * Math.sin(i) / H)) : 0, M = (e + o) / 2, m = (H, R) => R > H ? [H, R] : [M, M + I], [$, y] = m(e + g(h), o - g(h)), x = y - $ > Math.PI ? 1 : 0, p = `M ${b(t, h, $)} ${v(s, h, $)} A ${h} ${h} 0 ${x} 1 ${b(t, h, y)} ${v(s, h, y)}`;
|
|
132
|
-
if (c <= I) return `${p} L ${A(t)} ${A(s)} Z`;
|
|
133
|
-
const [w, d] = m(e + g(c), o - g(c)), L = d - w > Math.PI ? 1 : 0;
|
|
134
|
-
return `${p} L ${b(t, c, d)} ${v(s, c, d)} A ${c} ${c} 0 ${L} 0 ${b(t, c, w)} ${v(s, c, w)} Z`;
|
|
135
|
-
}
|
|
136
|
-
function st(t, s, r, n = "radial") {
|
|
137
|
-
const e = (t + s) / 2 * 360 % 360, o = n === "radial" ? e < 180 ? 0 : 180 : e > 90 && e < 270 ? 270 : 90;
|
|
138
|
-
return `rotate(${A(e - 90)}) translate(${A(r)},0) rotate(${o})`;
|
|
139
|
-
}
|
|
140
|
-
const Z = 0.6, F = 1.2, C = 8, U = 4, K = "…", G = { visible: !1, text: "", orientation: "tangential" }, E = (t, s, r) => !t.length || s < U ? G : s >= t.length ? { visible: !0, text: t, orientation: r } : { visible: !0, text: t.slice(0, s - 1) + K, orientation: r };
|
|
141
|
-
function rt(t, s, r, n, e) {
|
|
142
|
-
const o = n - r, a = (r + n) / 2;
|
|
143
|
-
if (o <= 0 || s <= 0 || e <= 0) return G;
|
|
144
|
-
const u = a * s, l = Z * e, c = F * e, h = u >= c ? Math.floor((o - C) / l) : 0, i = 2 * a * Math.sin(Math.min(s, Math.PI) / 2), f = o >= c ? Math.floor((Math.min(u, i) - C) / l) : 0;
|
|
145
|
-
return f >= h ? E(t, f, "tangential") : E(t, h, "radial");
|
|
146
|
-
}
|
|
147
|
-
function et(t, s, r) {
|
|
148
|
-
return s >= 1.4 * r && t - C >= 3 * Z * r;
|
|
149
|
-
}
|
|
150
|
-
function B(t, s, r) {
|
|
151
|
-
const n = (t % 360 + 360) % 360, e = (1 - Math.abs(2 * r - 1)) * s, o = e * (1 - Math.abs(n / 60 % 2 - 1)), a = r - e / 2, u = Math.floor(n / 60), [l, c, h] = u === 0 ? [e, o, 0] : u === 1 ? [o, e, 0] : u === 2 ? [0, e, o] : u === 3 ? [0, o, e] : u === 4 ? [o, 0, e] : [e, 0, o];
|
|
152
|
-
return [(l + a) * 255, (c + a) * 255, (h + a) * 255];
|
|
153
|
-
}
|
|
154
|
-
function P(t) {
|
|
155
|
-
const s = t.trim().match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i)?.[1];
|
|
156
|
-
if (s) {
|
|
157
|
-
const e = s.length === 3 ? [...s].map((o) => o + o).join("") : s;
|
|
158
|
-
return [0, 2, 4].map((o) => parseInt(e.slice(o, o + 2), 16));
|
|
159
|
-
}
|
|
160
|
-
const r = t.trim().match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+\s*)?\)$/i);
|
|
161
|
-
if (r) return [Number(r[1]), Number(r[2]), Number(r[3])];
|
|
162
|
-
const n = t.trim().match(/^hsl\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*\)$/i);
|
|
163
|
-
if (n) return B(Number(n[1]), Number(n[2]) / 100, Number(n[3]) / 100);
|
|
164
|
-
throw new Error(`Unsupported color: "${t}" (use #rrggbb, rgb(r, g, b) or hsl(h, s%, l%))`);
|
|
165
|
-
}
|
|
166
|
-
function T(t) {
|
|
167
|
-
try {
|
|
168
|
-
return P(t);
|
|
169
|
-
} catch {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
function k([t, s, r]) {
|
|
174
|
-
const n = t / 255, e = s / 255, o = r / 255, a = Math.max(n, e, o), u = Math.min(n, e, o), l = (a + u) / 2;
|
|
175
|
-
if (a === u) return { h: 0, s: 0, l };
|
|
176
|
-
const c = a - u, h = l > 0.5 ? c / (2 - a - u) : c / (a + u);
|
|
177
|
-
return { h: (a === n ? (e - o) / c + (e < o ? 6 : 0) : a === e ? (o - n) / c + 2 : (n - e) / c + 4) * 60, s: h, l };
|
|
178
|
-
}
|
|
179
|
-
function ot(t, s, r, n) {
|
|
180
|
-
const e = k(P(r)), o = k(P(n)), a = s - t;
|
|
181
|
-
return (u) => {
|
|
182
|
-
const l = a === 0 ? 0 : Math.min(1, Math.max(0, (u - t) / a)), c = e.h + (o.h - e.h) * l, h = e.s + (o.s - e.s) * l, i = e.l + (o.l - e.l) * l;
|
|
183
|
-
return `hsl(${N(c)}, ${N(h * 100)}%, ${N(i * 100)}%)`;
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
const N = (t) => Math.round(t * 10) / 10;
|
|
187
|
-
function J(t) {
|
|
188
|
-
const s = T(t);
|
|
189
|
-
if (!s) return;
|
|
190
|
-
const [r, n, e] = s.map((o) => {
|
|
191
|
-
const a = o / 255;
|
|
192
|
-
return a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4);
|
|
193
|
-
});
|
|
194
|
-
return 0.2126 * r + 0.7152 * n + 0.0722 * e;
|
|
195
|
-
}
|
|
196
|
-
function at(t, s, r) {
|
|
197
|
-
const n = T(t), e = T(s);
|
|
198
|
-
if (!n || !e) return;
|
|
199
|
-
const o = Math.min(1, Math.max(0, r)), a = n.map((u, l) => Math.round(u * o + e[l] * (1 - o)));
|
|
200
|
-
return `rgb(${a[0]}, ${a[1]}, ${a[2]})`;
|
|
201
|
-
}
|
|
202
|
-
function ct(t) {
|
|
203
|
-
const s = J(t);
|
|
204
|
-
if (s === void 0) return;
|
|
205
|
-
const r = (s + 0.05) / 0.05, n = 1.05 / (s + 0.05);
|
|
206
|
-
return r >= n ? "dark" : "light";
|
|
207
|
-
}
|
|
208
|
-
export {
|
|
209
|
-
st as a,
|
|
210
|
-
nt as b,
|
|
211
|
-
Q as c,
|
|
212
|
-
ot as d,
|
|
213
|
-
at as e,
|
|
214
|
-
ct as f,
|
|
215
|
-
rt as g,
|
|
216
|
-
et as h,
|
|
217
|
-
V as i,
|
|
218
|
-
D as j,
|
|
219
|
-
X as k,
|
|
220
|
-
q as l,
|
|
221
|
-
Y as p,
|
|
222
|
-
J as r,
|
|
223
|
-
tt as s
|
|
224
|
-
};
|