@arcgis/common-components 5.2.0-next.161 → 5.2.0-next.163
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/cdn/{N25TUHM4.js → 25YVYFDR.js} +1 -1
- package/dist/cdn/{HS7W72ER.js → 2CN444K3.js} +2 -2
- package/dist/cdn/33ALSUHX.js +2 -0
- package/dist/cdn/{6KPYL34Q.js → 3G4NZI2E.js} +1 -1
- package/dist/cdn/{3MYGEZOP.js → 45UMMWX3.js} +1 -1
- package/dist/cdn/{V5V533DI.js → 4EGAJOGW.js} +1 -1
- package/dist/cdn/{HX33VLI3.js → 4ILTGYPJ.js} +1 -1
- package/dist/cdn/6J34ISBP.js +2 -0
- package/dist/cdn/{NFWIWMYX.js → 6QHHJIHQ.js} +1 -1
- package/dist/cdn/{B3PVDZTP.js → A3ITL5ME.js} +1 -1
- package/dist/cdn/{CMX7WZPQ.js → C4SWIEG4.js} +1 -1
- package/dist/cdn/DVU3C66S.js +2 -0
- package/dist/cdn/{QP6SIWPE.js → EDPU4PG5.js} +1 -1
- package/dist/cdn/{Y2G4R4SG.js → EXN3FCB3.js} +1 -1
- package/dist/cdn/{EPTIOSEA.js → GPEHBLDD.js} +1 -1
- package/dist/cdn/{DE72K2VB.js → GVXDTJ2Y.js} +1 -1
- package/dist/cdn/{NPVQBA5D.js → HEDEJWLN.js} +1 -1
- package/dist/cdn/{2E2QBY2J.js → HFWRQ5HO.js} +1 -1
- package/dist/cdn/{6HVKL3BT.js → IX2RAUZP.js} +1 -1
- package/dist/cdn/{2IDDI3CL.js → J2K2ZA6R.js} +1 -1
- package/dist/cdn/{FVQ64IB5.js → KBQ2X2W3.js} +1 -1
- package/dist/cdn/{4R6LRUCI.js → KF3Q6HBP.js} +1 -1
- package/dist/cdn/{NZEZVGEW.js → LN5RYAEV.js} +1 -1
- package/dist/cdn/{XVHY4R5V.js → LNT2HGQB.js} +1 -1
- package/dist/cdn/{KWZ7LGK2.js → M46VSYUY.js} +1 -1
- package/dist/cdn/{SQZNAETL.js → MMRWMB4P.js} +1 -1
- package/dist/cdn/{LZ4RIDXD.js → OMH4F5GG.js} +1 -1
- package/dist/cdn/{5ESJPPJ3.js → P5FWV4P6.js} +1 -1
- package/dist/cdn/{JWK6KCSN.js → QFZ25HZA.js} +1 -1
- package/dist/cdn/RJFLKLJJ.js +2 -0
- package/dist/cdn/{BGX4M7G5.js → VRHSNO7N.js} +1 -1
- package/dist/cdn/{M3SD6ANM.js → VZEM3YFU.js} +1 -1
- package/dist/cdn/{7YKS2UHU.js → WKIY5YEY.js} +1 -1
- package/dist/cdn/{OYETN5FK.js → WMH4ZBNX.js} +1 -1
- package/dist/cdn/{YNJHUBFL.js → XF7NN262.js} +1 -1
- package/dist/cdn/{KQS6BKLU.js → XFZJKMAV.js} +1 -1
- package/dist/cdn/XZS2Z3AT.js +2 -0
- package/dist/cdn/{LON5GSEV.js → Z5IWHFGH.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/toolbar.js +3 -3
- package/dist/components/arcgis-slider/customElement.js +336 -327
- package/dist/components/arcgis-toolbar/customElement.d.ts +6 -3
- package/dist/components/arcgis-toolbar/customElement.js +30 -29
- package/dist/components/arcgis-toolbar/types.d.ts +1 -0
- package/dist/components/arcgis-toolbar-group/customElement.js +7 -7
- package/dist/components/arcgis-toolbar-stack/customElement.js +54 -53
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/D45UQLSC.js +0 -2
- package/dist/cdn/FS43JA7O.js +0 -2
- package/dist/cdn/HLJS6NZ6.js +0 -2
- package/dist/cdn/NCKLLNHD.js +0 -2
- package/dist/cdn/UVT6DEL2.js +0 -2
|
@@ -58,10 +58,13 @@ export abstract class ArcgisToolbar extends LitElement {
|
|
|
58
58
|
*/
|
|
59
59
|
measure(context: MeasurementContext): number[];
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
61
|
+
* Render method used when the toolbar is managed by a toolbar stack.
|
|
62
|
+
*
|
|
63
|
+
* @param context - Budget, which is used to determine which groups are expanded/collapsed.
|
|
64
|
+
* @param allocatedLength - Maximum rendered main-axis length, which might be smaller than the budgeted length. If available space is less than budgeted space, the toolbar scrolls.
|
|
63
65
|
* @param toolbarKind
|
|
66
|
+
* @param availableLength
|
|
64
67
|
* @internal
|
|
65
68
|
*/
|
|
66
|
-
proxiedRender(context: RenderContext,
|
|
69
|
+
proxiedRender(context: RenderContext, allocatedLength: number, toolbarKind?: "docked" | "floating", availableLength?: number): JsxNode;
|
|
67
70
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { html as
|
|
5
|
-
import { keyed as
|
|
6
|
-
import { LitElement as
|
|
7
|
-
import { useDirection as
|
|
8
|
-
import { s as
|
|
9
|
-
import { a as
|
|
10
|
-
import { i as
|
|
11
|
-
class
|
|
2
|
+
import { c as m } from "../../chunks/runtime.js";
|
|
3
|
+
import { ref as c } from "lit/directives/ref.js";
|
|
4
|
+
import { html as d } from "lit";
|
|
5
|
+
import { keyed as f } from "lit/directives/keyed.js";
|
|
6
|
+
import { LitElement as b, createEvent as _, safeStyleMap as u } from "@arcgis/lumina";
|
|
7
|
+
import { useDirection as y } from "@arcgis/lumina/controllers";
|
|
8
|
+
import { s as v, a as $, b as R, c as B } from "../../chunks/toolbar.js";
|
|
9
|
+
import { a as l } from "../../chunks/utils.js";
|
|
10
|
+
import { i as C } from "../../chunks/types.js";
|
|
11
|
+
class w extends b {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#r = new MutationObserver(() => this._syncGroups()), this.#
|
|
13
|
+
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#r = new MutationObserver(() => this._syncGroups()), this.#s = y(), this._layout = "horizontal", this._setRenderedBar = (t) => {
|
|
14
14
|
t == null && (this._renderedBar = void 0, this._hydratedRenderedBar = void 0), !(t === this._renderedBar || t === this._hydratedRenderedBar) && (this._renderedBar = t, this._hydratedRenderedBar = void 0, t && t.componentOnReady().then(() => {
|
|
15
15
|
!this.isConnected || this._renderedBar !== t || (this._hydratedRenderedBar = t);
|
|
16
16
|
}));
|
|
17
|
-
}, this._availableLength = 0, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.arcgisInternalLayoutUpdate =
|
|
17
|
+
}, this._availableLength = 0, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.arcgisInternalLayoutUpdate = _(), this.listen("arcgisInternalLayoutUpdate", (t) => {
|
|
18
18
|
t.target !== this.el && this.requestUpdate(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && t.stopPropagation();
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -22,12 +22,12 @@ class R extends p {
|
|
|
22
22
|
this.properties = { _availableLength: 16, _groups: 16, _renderedBar: 16, _hydratedRenderedBar: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, barElement: 32, effectiveRelativeDirection: 16 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
|
-
this.styles = [
|
|
25
|
+
this.styles = [v, $, R, B];
|
|
26
26
|
}
|
|
27
27
|
#t;
|
|
28
28
|
#r;
|
|
29
|
-
#s;
|
|
30
29
|
#i;
|
|
30
|
+
#s;
|
|
31
31
|
#e;
|
|
32
32
|
get layout() {
|
|
33
33
|
return this._layout;
|
|
@@ -39,7 +39,7 @@ class R extends p {
|
|
|
39
39
|
return this._hydratedRenderedBar;
|
|
40
40
|
}
|
|
41
41
|
get effectiveRelativeDirection() {
|
|
42
|
-
const [t, e] = this.relativePosition.split("-"), r = this.#
|
|
42
|
+
const [t, e] = this.relativePosition.split("-"), r = this.#s;
|
|
43
43
|
switch (e) {
|
|
44
44
|
case "left":
|
|
45
45
|
case "right":
|
|
@@ -54,18 +54,18 @@ class R extends p {
|
|
|
54
54
|
const e = this._groups;
|
|
55
55
|
if (!e?.length)
|
|
56
56
|
return [0];
|
|
57
|
-
const
|
|
58
|
-
return Array.from(new Set(
|
|
57
|
+
const o = e.map((i) => i.measure(t)).reduce((i, s) => i.flatMap((a) => s.map((n) => a + n)), [0]).map((i) => l(e, t, i).reduce((s, { budget: a }) => s + a, 0));
|
|
58
|
+
return Array.from(new Set(o)).sort((i, s) => i - s);
|
|
59
59
|
}
|
|
60
60
|
allocate(t, e) {
|
|
61
61
|
const r = this._groups;
|
|
62
|
-
return r?.length ?
|
|
62
|
+
return r?.length ? l(r, t, e) : [];
|
|
63
63
|
}
|
|
64
|
-
proxiedRender(t, e, r = this.toolbarKind) {
|
|
64
|
+
proxiedRender(t, e, r = this.toolbarKind, o = e) {
|
|
65
65
|
if (!this._groups?.length)
|
|
66
66
|
return;
|
|
67
|
-
const s = this.allocate(t, e);
|
|
68
|
-
return
|
|
67
|
+
const s = this.allocate(t, e), [a, n] = t.relativePosition.split("-"), h = t.layout === "horizontal" ? { maxWidth: `${o}px` } : { maxHeight: `${o}px` };
|
|
68
|
+
return f(this, d`<div class=${`toolbar-grid-wrapper ${n} ${a}`} style=${u(h)}><div class="toolbar-shadow-wrapper" style=${u(h)}><calcite-action-bar expand-toggle-disabled .floating=${r === "floating"} .layout=${t.layout} overflow-mode=none .scale=${t.scale} ${c(this._setRenderedBar)}>${s.map(({ group: p, budget: g }) => p.proxiedRender(t, g))}</calcite-action-bar></div></div>`);
|
|
69
69
|
}
|
|
70
70
|
connectedCallback() {
|
|
71
71
|
super.connectedCallback(), this._connectMeasurement(this.#e), this.#r.observe(this.el, { childList: !0 }), this._syncGroups();
|
|
@@ -84,9 +84,9 @@ class R extends p {
|
|
|
84
84
|
e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
|
|
85
85
|
}
|
|
86
86
|
_syncGroups() {
|
|
87
|
-
this.#
|
|
88
|
-
const t = Array.from(this.el.children).filter(
|
|
89
|
-
this.#
|
|
87
|
+
this.#i?.abort();
|
|
88
|
+
const t = Array.from(this.el.children).filter(C), e = new AbortController();
|
|
89
|
+
this.#i = e, Promise.all(t.map((r) => r.componentOnReady())).then(() => {
|
|
90
90
|
!this.isConnected || e.signal.aborted || (this._groups = t, this.arcgisInternalLayoutUpdate.emit());
|
|
91
91
|
});
|
|
92
92
|
}
|
|
@@ -97,12 +97,13 @@ class R extends p {
|
|
|
97
97
|
layout: this.layout,
|
|
98
98
|
relativePosition: this.effectiveRelativeDirection,
|
|
99
99
|
scale: this.scale,
|
|
100
|
-
tooltipAppearance: this.tooltipAppearance
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
tooltipAppearance: this.tooltipAppearance,
|
|
101
|
+
toolbarKind: this.toolbarKind
|
|
102
|
+
}, [{ budget: r }] = l([this], e, this._availableLength);
|
|
103
|
+
return d`<div class="ruler" ${c(this._setRulerEl)}></div>${this.proxiedRender(e, r, this.toolbarKind, this._availableLength)}`;
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
+
m("arcgis-toolbar", w);
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
+
w as ArcgisToolbar
|
|
108
109
|
};
|
|
@@ -5,7 +5,7 @@ import { LitElement as u, nothing as h } from "@arcgis/lumina";
|
|
|
5
5
|
import { W as i, a as m } from "../../chunks/utils.js";
|
|
6
6
|
import { L as g, i as b } from "../../chunks/types.js";
|
|
7
7
|
import { u as f } from "../../chunks/utils2.js";
|
|
8
|
-
class
|
|
8
|
+
class y extends u {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.#e = new MutationObserver(() => this.#t()), this.preferEndSlot = !1, this.priority = g.Default;
|
|
11
11
|
}
|
|
@@ -18,15 +18,15 @@ class C extends u {
|
|
|
18
18
|
const r = this._children;
|
|
19
19
|
if (!r?.length)
|
|
20
20
|
return [0];
|
|
21
|
-
const o = i.groupSeparator + i.groupPadding[e.scale],
|
|
22
|
-
return f(
|
|
21
|
+
const o = i.groupSeparator + i.groupPadding[e.scale], s = r.map((t) => t.measure(e)).reduce((t, n) => t.flatMap((a) => n.map((c) => a + c)), [0]);
|
|
22
|
+
return f(s.map((t) => o + t));
|
|
23
23
|
}
|
|
24
24
|
proxiedRender(e, r) {
|
|
25
25
|
const o = this._children;
|
|
26
26
|
if (!o)
|
|
27
27
|
return;
|
|
28
|
-
const l = this.preferEndSlot ? "actions-end" : void 0,
|
|
29
|
-
return p`<calcite-action-group .scale=${e.scale} .layout=${e.layout} slot=${l ?? h}>${t.map(({ group:
|
|
28
|
+
const l = this.preferEndSlot && (e.toolbarKind === "docked" || e.layout === "vertical") ? "actions-end" : void 0, s = r - i.groupPadding[e.scale] - i.groupSeparator, t = m(o, e, s);
|
|
29
|
+
return p`<calcite-action-group .scale=${e.scale} .layout=${e.layout} slot=${l ?? h}>${t.map(({ group: n, budget: a }) => n.proxiedRender(e, a))}</calcite-action-group>`;
|
|
30
30
|
}
|
|
31
31
|
connectedCallback() {
|
|
32
32
|
super.connectedCallback(), this.#e.observe(this.el, { childList: !0 }), this.#t();
|
|
@@ -42,7 +42,7 @@ class C extends u {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
d("arcgis-toolbar-group",
|
|
45
|
+
d("arcgis-toolbar-group", y);
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
y as ArcgisToolbarGroup
|
|
48
48
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as y } from "../../chunks/runtime.js";
|
|
3
3
|
import { ref as _ } from "lit/directives/ref.js";
|
|
4
|
-
import { css as
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { useDirection as
|
|
7
|
-
import { s as
|
|
8
|
-
import { AsyncDirective as
|
|
4
|
+
import { css as k, render as C, nothing as L, html as b } from "lit";
|
|
5
|
+
import { LitElement as P, nothing as T } from "@arcgis/lumina";
|
|
6
|
+
import { useDirection as A } from "@arcgis/lumina/controllers";
|
|
7
|
+
import { s as $, a as R, b as w, c as z } from "../../chunks/toolbar.js";
|
|
8
|
+
import { AsyncDirective as x } from "lit/async-directive.js";
|
|
9
9
|
import { directive as M, PartType as D } from "lit/directive.js";
|
|
10
|
-
import { getCommittedValue as u, clearPart as E, insertPart as
|
|
11
|
-
const V =
|
|
12
|
-
class
|
|
10
|
+
import { getCommittedValue as u, clearPart as E, insertPart as v, setCommittedValue as p } from "lit/directive-helpers.js";
|
|
11
|
+
const V = k`:host{--calcite-internal-animation-timing-slow: 0}.stack{block-size:100%}.toolbar-stack{display:flex;gap:8px}:host([toolbar-kind="docked"]) .toolbar-stack{gap:0}.line{display:flex;gap:8px}:host([layout="vertical"]) .line{block-size:100%;flex-direction:column}:host([layout="vertical"]) .line[data-alignment=bottom]{align-self:end}.line[data-alignment=left]{justify-content:left}.line[data-alignment=right]{justify-content:right}:host([layout="vertical"]) .toolbar-stack{block-size:100%}:host([layout="horizontal"]) .toolbar-stack{flex-direction:column}:host([toolbar-kind="docked"][layout="horizontal"]) .toolbar-stack{min-inline-size:100%}:host([toolbar-kind="docked"][layout="vertical"]) .toolbar-stack{min-block-size:100%}`;
|
|
12
|
+
class K {
|
|
13
13
|
constructor(t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Set()) {
|
|
14
14
|
this.cachedParts = t, this.directives = e;
|
|
15
15
|
}
|
|
@@ -18,7 +18,7 @@ class j {
|
|
|
18
18
|
t.moveToCache();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
class S extends
|
|
21
|
+
class S extends x {
|
|
22
22
|
#e;
|
|
23
23
|
#i;
|
|
24
24
|
#t;
|
|
@@ -31,13 +31,13 @@ class S extends R {
|
|
|
31
31
|
* @param _key Uniquely identifies the element being rendered
|
|
32
32
|
* @param value The content to render
|
|
33
33
|
*/
|
|
34
|
-
render(t, e,
|
|
35
|
-
return [
|
|
34
|
+
render(t, e, s) {
|
|
35
|
+
return [s];
|
|
36
36
|
}
|
|
37
|
-
update(t, [e,
|
|
38
|
-
this.#t !== e && (this.#t && this.#t.directives.delete(this), e.directives.add(this), this.#t = e), this.#e = t, this.#i =
|
|
39
|
-
const i = e.cachedParts.get(
|
|
40
|
-
return
|
|
37
|
+
update(t, [e, s, o]) {
|
|
38
|
+
this.#t !== e && (this.#t && this.#t.directives.delete(this), e.directives.add(this), this.#t = e), this.#e = t, this.#i = s;
|
|
39
|
+
const i = e.cachedParts.get(s), a = i ? u(i).pop() : void 0;
|
|
40
|
+
return a && (E(t), v(t, void 0, a), p(t, [a])), this.render(e, s, o);
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* During the update phase, a toolbar may need to be pulled from the cache in a situation
|
|
@@ -53,17 +53,17 @@ class S extends R {
|
|
|
53
53
|
const t = this.#e, e = this.#t;
|
|
54
54
|
if (!t || !e)
|
|
55
55
|
return;
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
56
|
+
const o = u(t).pop();
|
|
57
|
+
if (!o)
|
|
58
58
|
return;
|
|
59
59
|
let i = e.cachedParts.get(this.#i);
|
|
60
60
|
if (!i) {
|
|
61
61
|
const c = document.createDocumentFragment();
|
|
62
|
-
i =
|
|
62
|
+
i = C(L, c), e.cachedParts.set(this.#i, i);
|
|
63
63
|
}
|
|
64
64
|
if (u(i).length > 0)
|
|
65
65
|
throw new Error("sharedCache() keys must be unique");
|
|
66
|
-
|
|
66
|
+
p(i, [o]), v(i, void 0, o);
|
|
67
67
|
}
|
|
68
68
|
disconnected() {
|
|
69
69
|
this.#t?.directives.delete(this);
|
|
@@ -72,33 +72,33 @@ class S extends R {
|
|
|
72
72
|
this.#t?.directives.add(this);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
class
|
|
75
|
+
const O = M(S), W = 8;
|
|
76
|
+
class j extends P {
|
|
77
77
|
constructor() {
|
|
78
|
-
super(), this.#e = new ResizeObserver((t) => this._updateMeasurement(t)), this.#i = new MutationObserver(() => this._syncToolbars()), this.#r =
|
|
78
|
+
super(), this.#e = new ResizeObserver((t) => this._updateMeasurement(t)), this.#i = new MutationObserver(() => this._syncToolbars()), this.#r = A(), this.#s = new K(), this._layout = "horizontal", this._availableLength = 0, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.listen("arcgisInternalLayoutUpdate", () => this.requestUpdate());
|
|
79
79
|
}
|
|
80
80
|
static {
|
|
81
81
|
this.properties = { _availableLength: 16, _toolbars: 16, effectiveRelativeDirection: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3 };
|
|
82
82
|
}
|
|
83
83
|
static {
|
|
84
|
-
this.styles = [V,
|
|
84
|
+
this.styles = [V, $, R, w, z];
|
|
85
85
|
}
|
|
86
86
|
#e;
|
|
87
87
|
#i;
|
|
88
88
|
#t;
|
|
89
89
|
#r;
|
|
90
|
+
#s;
|
|
90
91
|
#o;
|
|
91
|
-
#a;
|
|
92
92
|
get effectiveRelativeDirection() {
|
|
93
|
-
const [t, e] = this.relativePosition.split("-"),
|
|
93
|
+
const [t, e] = this.relativePosition.split("-"), s = this.#r;
|
|
94
94
|
switch (e) {
|
|
95
95
|
case "left":
|
|
96
96
|
case "right":
|
|
97
97
|
return `${t}-${e}`;
|
|
98
98
|
case "end":
|
|
99
|
-
return `${t}-${
|
|
99
|
+
return `${t}-${s === "ltr" ? "right" : "left"}`;
|
|
100
100
|
case "start":
|
|
101
|
-
return `${t}-${
|
|
101
|
+
return `${t}-${s === "ltr" ? "left" : "right"}`;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
get layout() {
|
|
@@ -108,67 +108,68 @@ class K extends z {
|
|
|
108
108
|
t !== this._layout && (this._layout = t, this._updateMeasurement());
|
|
109
109
|
}
|
|
110
110
|
connectedCallback() {
|
|
111
|
-
super.connectedCallback(), this._connectMeasurement(this.#
|
|
111
|
+
super.connectedCallback(), this._connectMeasurement(this.#o), this.#i.observe(this.el, { childList: !0 }), this._syncToolbars();
|
|
112
112
|
}
|
|
113
113
|
disconnectedCallback() {
|
|
114
114
|
this.#e.disconnect(), this.#i.disconnect(), super.disconnectedCallback();
|
|
115
115
|
}
|
|
116
116
|
_setRulerEl(t) {
|
|
117
|
-
this.#
|
|
117
|
+
this.#o !== t && (this.#o = t, this.isConnected && this._connectMeasurement(t));
|
|
118
118
|
}
|
|
119
119
|
_connectMeasurement(t) {
|
|
120
120
|
this.#e.disconnect(), t && (this.#e.observe(t), this._updateMeasurement());
|
|
121
121
|
}
|
|
122
122
|
_updateMeasurement(t) {
|
|
123
|
-
const e = t?.at(0)?.contentRect ?? this.#
|
|
123
|
+
const e = t?.at(0)?.contentRect ?? this.#o?.getBoundingClientRect();
|
|
124
124
|
e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
|
|
125
125
|
}
|
|
126
126
|
_syncToolbars() {
|
|
127
127
|
this.#t?.abort();
|
|
128
|
-
const t = Array.from(this.el.children).filter(
|
|
129
|
-
this.#t = e, Promise.all(t.map((
|
|
128
|
+
const t = Array.from(this.el.children).filter(q), e = new AbortController();
|
|
129
|
+
this.#t = e, Promise.all(t.map((s) => s.componentOnReady())).then(() => {
|
|
130
130
|
!this.isConnected || e.signal.aborted || (this._toolbars = t);
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
_arrangeToolbarLines(t, e) {
|
|
134
|
-
const
|
|
134
|
+
const s = t.map((r) => {
|
|
135
135
|
const d = r.allocate(e, this._availableLength);
|
|
136
|
-
return { toolbar: r, budget: d.reduce((g,
|
|
137
|
-
}),
|
|
138
|
-
let i = [],
|
|
139
|
-
for (const r of
|
|
140
|
-
const d =
|
|
141
|
-
i.length > 0 && d > this._availableLength ? (
|
|
136
|
+
return { toolbar: r, budget: d.reduce((g, f) => g + f.budget, 0) };
|
|
137
|
+
}), o = [];
|
|
138
|
+
let i = [], a = 0;
|
|
139
|
+
for (const r of s) {
|
|
140
|
+
const d = a + (i.length === 0 ? 0 : W) + r.budget;
|
|
141
|
+
i.length > 0 && (this.toolbarKind === "docked" || d > this._availableLength) ? (o.push(i), i = [r], a = r.budget) : (i.push(r), a = d);
|
|
142
142
|
}
|
|
143
|
-
i.length > 0 &&
|
|
143
|
+
i.length > 0 && o.push(i);
|
|
144
144
|
const [c, h] = e.relativePosition.split("-"), l = e.layout === "vertical";
|
|
145
|
-
return (l ? h === "right" : c === "bottom") &&
|
|
145
|
+
return (l ? h === "right" : c === "bottom") && o.reverse(), (l ? c === "bottom" : h === "right") && o.forEach((r) => r.reverse()), o;
|
|
146
146
|
}
|
|
147
|
-
#
|
|
147
|
+
#a;
|
|
148
148
|
render() {
|
|
149
149
|
const t = this._toolbars;
|
|
150
150
|
if (!t?.length) {
|
|
151
|
-
this.#
|
|
151
|
+
this.#a?.length && (this.#s.moveAllToCache(), this.#a = []);
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
const e = {
|
|
155
155
|
layout: this.layout,
|
|
156
156
|
relativePosition: this.effectiveRelativeDirection,
|
|
157
157
|
scale: this.scale,
|
|
158
|
-
tooltipAppearance: this.tooltipAppearance
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
tooltipAppearance: this.tooltipAppearance,
|
|
159
|
+
toolbarKind: this.toolbarKind
|
|
160
|
+
}, s = this._arrangeToolbarLines(t, e);
|
|
161
|
+
U(this.#a, s) || (this.#s.moveAllToCache(), this.#a = s.map((h) => h.map(({ toolbar: l }) => l)));
|
|
162
|
+
const [o, i] = e.relativePosition.split("-"), a = this.layout === "vertical" ? o : i, c = this.#s;
|
|
163
|
+
return b`<div class="stack"><div class="ruler" ${_(this._setRulerEl)}></div><div class="toolbar-stack">${s.map((h) => b`<div class="line" data-alignment=${a ?? T}>${h.map(({ toolbar: l, budget: m }) => O(c, l, l.proxiedRender(e, m, this.toolbarKind, this._availableLength)))}</div>`)}</div></div>`;
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
|
-
function
|
|
166
|
+
function q(n) {
|
|
166
167
|
return n.localName === "arcgis-toolbar";
|
|
167
168
|
}
|
|
168
169
|
function U(n, t) {
|
|
169
|
-
return n?.length === t.length && t.every((e,
|
|
170
|
+
return n?.length === t.length && t.every((e, s) => e.length === n[s].length && e.every(({ toolbar: o }, i) => o === n[s][i]));
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
+
y("arcgis-toolbar-stack", j);
|
|
172
173
|
export {
|
|
173
|
-
|
|
174
|
+
j as ArcgisToolbarStack
|
|
174
175
|
};
|