@arcgis/common-components 6.0.0-next.37 → 6.0.0-next.39
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/{IZD4AM2W.js → 24FE5GMT.js} +1 -1
- package/dist/cdn/2XTXXTEZ.js +2 -0
- package/dist/cdn/3QTMLOOM.js +2 -0
- package/dist/cdn/4X2SOHYB.js +2 -0
- package/dist/cdn/{3ZTHRAIZ.js → 4ZVHN3V7.js} +1 -1
- package/dist/cdn/{TWPYXZ2O.js → 55VDXBLV.js} +1 -1
- package/dist/cdn/{ANK7TFWV.js → 5YQK5TCH.js} +1 -1
- package/dist/cdn/{TE77L77R.js → 7S4ZZPSA.js} +1 -1
- package/dist/cdn/{HX2AL2HN.js → 7VGSZDT7.js} +1 -1
- package/dist/cdn/{5TNOGXJJ.js → ABDFJWQO.js} +1 -1
- package/dist/cdn/{BUPRL52I.js → BAMK6STW.js} +1 -1
- package/dist/cdn/CC74AHNF.js +2 -0
- package/dist/cdn/CCJ7MF3B.js +2 -0
- package/dist/cdn/{LLLQXE2U.js → EYOJNGUG.js} +1 -1
- package/dist/cdn/{J4AV4EAC.js → F5IBLVYU.js} +1 -1
- package/dist/cdn/{D4JWM5PW.js → HMGFS4YI.js} +1 -1
- package/dist/cdn/HYR5WUUX.js +2 -0
- package/dist/cdn/JAMYEW7N.js +2 -0
- package/dist/cdn/{SRO2CZ77.js → JCWKK6FB.js} +1 -1
- package/dist/cdn/{74TVQE6W.js → LIFJOO55.js} +1 -1
- package/dist/cdn/{BDIGRQ2U.js → LPKRIISW.js} +1 -1
- package/dist/cdn/{V5FMQXMU.js → LRP7XW5X.js} +1 -1
- package/dist/cdn/{M7F7EBFY.js → LZPZYGFW.js} +1 -1
- package/dist/cdn/{PIXY2HTI.js → MWQVR7SB.js} +1 -1
- package/dist/cdn/{6LZNNXUL.js → N5YNSPMD.js} +1 -1
- package/dist/cdn/{4L362IQJ.js → NEJQBOXB.js} +1 -1
- package/dist/cdn/{2K4XK5CC.js → NSTQTWS5.js} +1 -1
- package/dist/cdn/{32JRESCI.js → ONYZMGVN.js} +1 -1
- package/dist/cdn/{NZDJ3HVF.js → OQRMI3K5.js} +1 -1
- package/dist/cdn/{ZMYTELNC.js → OVW45JGX.js} +1 -1
- package/dist/cdn/{4IMLX5B4.js → Q73UFMJY.js} +1 -1
- package/dist/cdn/{PJGWH4LW.js → RBTFN5SR.js} +1 -1
- package/dist/cdn/{T57JKNGO.js → RU4PILTH.js} +1 -1
- package/dist/cdn/RU722XDV.js +2 -0
- package/dist/cdn/{ZLVMV6TP.js → S2EORL4N.js} +1 -1
- package/dist/cdn/{HWVDNUPX.js → S3GK6UB7.js} +1 -1
- package/dist/cdn/{JYWWX277.js → T7LZIFNY.js} +1 -1
- package/dist/cdn/TZBDDGN3.js +2 -0
- package/dist/cdn/VLVINHT3.js +2 -0
- package/dist/cdn/{WIOMW22N.js → WDQV5Y4K.js} +1 -1
- package/dist/cdn/{FESNPMRM.js → X44CHGA6.js} +1 -1
- package/dist/cdn/{EOGA62GK.js → Y72KV72H.js} +1 -1
- package/dist/cdn/{IOAVVVNO.js → YOPZGJMF.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/utils.js +75 -37
- package/dist/chunks/utils2.js +9 -14
- package/dist/chunks/{intrinsic-sizing.js → well-known-sizes-controller.js} +38 -14
- package/dist/components/arcgis-toolbar/customElement.js +34 -29
- package/dist/components/arcgis-toolbar/types.d.ts +20 -1
- package/dist/components/arcgis-toolbar-action/customElement.js +17 -18
- package/dist/components/arcgis-toolbar-group/customElement.js +20 -17
- package/dist/components/arcgis-toolbar-item/customElement.d.ts +2 -2
- package/dist/components/arcgis-toolbar-item/customElement.js +14 -14
- package/dist/components/arcgis-toolbar-more-button/customElement.js +28 -26
- package/dist/components/arcgis-toolbar-split-button/customElement.js +34 -34
- package/dist/components/arcgis-toolbar-stack/customElement.js +48 -43
- 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/32MHBJSZ.js +0 -2
- package/dist/cdn/4D35RDOE.js +0 -2
- package/dist/cdn/BAALW3SQ.js +0 -2
- package/dist/cdn/DPJGC3YQ.js +0 -2
- package/dist/cdn/E5VIZW6M.js +0 -2
- package/dist/cdn/FVFYAK24.js +0 -2
- package/dist/cdn/RYVWIAKZ.js +0 -2
- package/dist/cdn/UFSM3GRY.js +0 -2
- package/dist/cdn/W2W34T5K.js +0 -2
- package/dist/cdn/XQ65BGER.js +0 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import { c as g } from "../../chunks/runtime.js";
|
|
3
3
|
import { ref as m } from "lit/directives/ref.js";
|
|
4
|
-
import { html as
|
|
4
|
+
import { html as d } from "lit";
|
|
5
5
|
import { keyed as b } from "lit/directives/keyed.js";
|
|
6
6
|
import { LitElement as f, createEvent as v, safeStyleMap as c } from "@arcgis/lumina";
|
|
7
7
|
import { useDirection as y } from "@arcgis/lumina/controllers";
|
|
8
|
-
import {
|
|
8
|
+
import { W as _, s as $, a as R, b as z, c as B, r as L } from "../../chunks/well-known-sizes-controller.js";
|
|
9
9
|
import { a as l } from "../../chunks/utils.js";
|
|
10
|
-
import { i as
|
|
11
|
-
class
|
|
10
|
+
import { i as w } from "../../chunks/types.js";
|
|
11
|
+
class C extends f {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#e = new MutationObserver(() => this._syncGroups()), this.#
|
|
13
|
+
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#e = new MutationObserver(() => this._syncGroups()), this.#r = y(), this.#s = new _(this), 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
|
}));
|
|
@@ -22,12 +22,13 @@ class w extends f {
|
|
|
22
22
|
this.properties = { _observedSize: 16, _availableLength: 16, _groups: 16, _renderedBar: 16, _hydratedRenderedBar: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, allocatedLength: 11, barElement: 32, effectiveRelativeDirection: 16 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
|
-
this.styles = [
|
|
25
|
+
this.styles = [$, R, z, B];
|
|
26
26
|
}
|
|
27
27
|
#t;
|
|
28
28
|
#e;
|
|
29
|
-
#r;
|
|
30
29
|
#i;
|
|
30
|
+
#r;
|
|
31
|
+
#s;
|
|
31
32
|
get _availableLength() {
|
|
32
33
|
return this.allocatedLength ?? (this.layout === "horizontal" ? this._observedSize?.width : this._observedSize?.height) ?? 0;
|
|
33
34
|
}
|
|
@@ -41,37 +42,37 @@ class w extends f {
|
|
|
41
42
|
return this._hydratedRenderedBar;
|
|
42
43
|
}
|
|
43
44
|
get effectiveRelativeDirection() {
|
|
44
|
-
const [t, e] = this.relativePosition.split("-"),
|
|
45
|
+
const [t, e] = this.relativePosition.split("-"), i = this.#r;
|
|
45
46
|
switch (e) {
|
|
46
47
|
case "left":
|
|
47
48
|
case "right":
|
|
48
49
|
return `${t}-${e}`;
|
|
49
50
|
case "end":
|
|
50
|
-
return `${t}-${
|
|
51
|
+
return `${t}-${i === "ltr" ? "right" : "left"}`;
|
|
51
52
|
case "start":
|
|
52
|
-
return `${t}-${
|
|
53
|
+
return `${t}-${i === "ltr" ? "left" : "right"}`;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
measure(t) {
|
|
56
57
|
const e = this._groups;
|
|
57
58
|
if (!e?.length)
|
|
58
59
|
return [0];
|
|
59
|
-
const
|
|
60
|
-
return Array.from(new Set(
|
|
60
|
+
const o = e.map((r) => r.measure(t)).reduce((r, s) => r.flatMap((a) => s.map((n) => a + n)), [0]).map((r) => l(e, t, r).reduce((s, { budget: a }) => s + a, 0));
|
|
61
|
+
return Array.from(new Set(o)).sort((r, s) => r - s);
|
|
61
62
|
}
|
|
62
63
|
measureIntrinsicSize(t) {
|
|
63
|
-
const e = this._groups ?? [],
|
|
64
|
-
return { minimum:
|
|
64
|
+
const e = this._groups ?? [], i = (o) => l(e, t, o).reduce((r, { budget: s }) => r + s, 0);
|
|
65
|
+
return { minimum: i(0), maximum: i(1 / 0) };
|
|
65
66
|
}
|
|
66
67
|
allocate(t, e) {
|
|
67
|
-
const
|
|
68
|
-
return
|
|
68
|
+
const i = this._groups;
|
|
69
|
+
return i?.length ? l(i, t, e) : [];
|
|
69
70
|
}
|
|
70
|
-
proxiedRender(t, e,
|
|
71
|
+
proxiedRender(t, e, i = this.toolbarKind, o = e) {
|
|
71
72
|
if (!this._groups?.length)
|
|
72
73
|
return;
|
|
73
|
-
const
|
|
74
|
-
return b(this,
|
|
74
|
+
const s = this.allocate(t, e), [a, n] = t.relativePosition.split("-"), h = t.layout === "horizontal" ? { maxWidth: `${o}px` } : { maxHeight: `${o}px` };
|
|
75
|
+
return b(this, d`<div class=${`toolbar-grid-wrapper ${n} ${a}`} style=${c(h)}><div class="toolbar-shadow-wrapper" style=${c(h)}><calcite-action-bar expand-toggle-disabled .floating=${i === "floating"} .layout=${t.layout} overflow-mode=none .scale=${t.scale} ${m(this._setRenderedBar)}>${s.map(({ group: u, budget: p }) => u.proxiedRender(t, p))}</calcite-action-bar></div></div>`);
|
|
75
76
|
}
|
|
76
77
|
connectedCallback() {
|
|
77
78
|
super.connectedCallback(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && this.#t.observe(this.el), this.#e.observe(this.el, { childList: !0 }), this._syncGroups();
|
|
@@ -83,30 +84,34 @@ class w extends f {
|
|
|
83
84
|
this._observedSize = t?.at(0)?.contentRect;
|
|
84
85
|
}
|
|
85
86
|
_syncGroups() {
|
|
86
|
-
this.#
|
|
87
|
-
const t = Array.from(this.el.children).filter(
|
|
88
|
-
this.#
|
|
87
|
+
this.#i?.abort();
|
|
88
|
+
const t = Array.from(this.el.children).filter(w), e = new AbortController();
|
|
89
|
+
this.#i = e, Promise.all(t.map((i) => i.componentOnReady())).then(() => {
|
|
89
90
|
!this.isConnected || e.signal.aborted || (this._groups = t, this.arcgisInternalLayoutUpdate.emit());
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
93
|
render() {
|
|
93
94
|
if (!this._groups?.length || this.el.parentElement?.localName === "arcgis-toolbar-stack")
|
|
94
95
|
return;
|
|
95
|
-
const e =
|
|
96
|
+
const e = this.#s.exports;
|
|
97
|
+
if (!e)
|
|
98
|
+
return;
|
|
99
|
+
const i = {
|
|
100
|
+
sizes: e,
|
|
96
101
|
layout: this.layout,
|
|
97
102
|
relativePosition: this.effectiveRelativeDirection,
|
|
98
103
|
scale: this.scale,
|
|
99
104
|
tooltipAppearance: this.tooltipAppearance,
|
|
100
105
|
toolbarKind: this.toolbarKind
|
|
101
|
-
},
|
|
106
|
+
}, o = this.allocate(i, this._availableLength).reduce((r, { budget: s }) => r + s, 0);
|
|
102
107
|
if (this.allocatedLength === void 0) {
|
|
103
|
-
const { minimum:
|
|
104
|
-
return
|
|
108
|
+
const { minimum: r, maximum: s } = this.measureIntrinsicSize(i);
|
|
109
|
+
return d`<div class="intrinsic-sizing-container">${L(r, s, this.layout)}${this.proxiedRender(i, o, this.toolbarKind, this._availableLength)}</div>`;
|
|
105
110
|
}
|
|
106
|
-
return this.proxiedRender(
|
|
111
|
+
return this.proxiedRender(i, o, this.toolbarKind, this._availableLength);
|
|
107
112
|
}
|
|
108
113
|
}
|
|
109
|
-
g("arcgis-toolbar",
|
|
114
|
+
g("arcgis-toolbar", C);
|
|
110
115
|
export {
|
|
111
|
-
|
|
116
|
+
C as ArcgisToolbar
|
|
112
117
|
};
|
|
@@ -15,8 +15,15 @@ export const LayoutPriorities: {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export type MeasurementContext = {
|
|
18
|
+
/**
|
|
19
|
+
* The actual pixel lengths of Calcite components as rendered in the current document, taking custom styles into
|
|
20
|
+
* account. Computed once, then shared among all elements in a toolbar or stack.
|
|
21
|
+
*/
|
|
22
|
+
sizes: ToolbarSizes;
|
|
18
23
|
layout: "horizontal" | "vertical";
|
|
19
24
|
scale: "l" | "m" | "s";
|
|
25
|
+
/** Temporary: passed only for the Calcite group-separator workaround; remove when Calcite issue 15377 is resolved. */
|
|
26
|
+
toolbarKind?: "docked" | "floating";
|
|
20
27
|
};
|
|
21
28
|
|
|
22
29
|
export type RenderContext = MeasurementContext
|
|
@@ -39,4 +46,16 @@ export interface RenderableToolbarContent {
|
|
|
39
46
|
proxiedRender: (context: RenderContext, budget: number) => JsxNode;
|
|
40
47
|
priority?: number;
|
|
41
48
|
componentOnReady: () => Promise<unknown>;
|
|
42
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type ToolbarSizes = {
|
|
52
|
+
groupSeparator: number;
|
|
53
|
+
groupPadding: SizesByScale;
|
|
54
|
+
/** Calcite action padding is added separately because the action's minimum length does not include it. */
|
|
55
|
+
actionPadding: SizesByScale;
|
|
56
|
+
/** Minimum painted action length before the separately tracked action padding is added. */
|
|
57
|
+
action: Record<MeasurementContext["layout"], SizesByScale>;
|
|
58
|
+
splitButtonPart: Record<MeasurementContext["layout"], SizesByScale>;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type SizesByScale = Record<MeasurementContext["scale"], number>;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { css as
|
|
5
|
-
import { keyed as
|
|
6
|
-
import { LitElement as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class x extends b {
|
|
2
|
+
import { c as m } from "../../chunks/runtime.js";
|
|
3
|
+
import { ref as p } from "lit/directives/ref.js";
|
|
4
|
+
import { css as u, html as c } from "lit";
|
|
5
|
+
import { keyed as g } from "lit/directives/keyed.js";
|
|
6
|
+
import { LitElement as f, createEvent as r, nothing as s, safeClassMap as b } from "@arcgis/lumina";
|
|
7
|
+
import { g as _ } from "../../chunks/utils2.js";
|
|
8
|
+
const $ = u`:host([text-enabled][data-layout="vertical"]){.interaction-container>button{flex-direction:column;>.text-container{writing-mode:vertical-lr}}}`;
|
|
9
|
+
class v extends f {
|
|
11
10
|
constructor() {
|
|
12
11
|
super(...arguments), this.#e = (t) => {
|
|
13
12
|
t !== this._element && (this.#t?.disconnect(), this._element = t, this._hydratedElement = void 0, this.isConnected && this.arcgisRenderedActionChanged.emit({ element: t }), t && (this._measureAction(), this.#t ??= new ResizeObserver((e) => {
|
|
14
13
|
!this.textEnabled || !this._element || this._measureAction(e);
|
|
15
14
|
}), this.#t.observe(t), t.componentOnReady().then(() => {
|
|
16
|
-
!this.isConnected || this._element !== t || (this._hydratedElement = t, t.shadowRoot?.adoptedStyleSheets.push(
|
|
15
|
+
!this.isConnected || this._element !== t || (this._hydratedElement = t, t.shadowRoot?.adoptedStyleSheets.push($.styleSheet));
|
|
17
16
|
})));
|
|
18
|
-
}, this._measuredWidth = 0, this._measuredHeight = 0, this.active = !1, this.tooltipText = "", this.labelText = "", this.disabled = !1, this.loading = !1, this.indicator = !1, this.textEnabled = !1, this.appearance = "transparent", this.iconFlipRtl = !1, this.arcgisRenderedActionChanged =
|
|
17
|
+
}, this._measuredWidth = 0, this._measuredHeight = 0, this.active = !1, this.tooltipText = "", this.labelText = "", this.disabled = !1, this.loading = !1, this.indicator = !1, this.textEnabled = !1, this.appearance = "transparent", this.iconFlipRtl = !1, this.arcgisRenderedActionChanged = r(), this.arcgisToolbarItemSelected = r();
|
|
19
18
|
}
|
|
20
19
|
static {
|
|
21
20
|
this.properties = { _element: 16, _hydratedElement: 16, _measuredWidth: 16, _measuredHeight: 16, icon: 1, active: 7, tooltipText: 1, labelText: 1, disabled: 5, loading: 5, indicator: 5, textEnabled: 5, kind: 3, appearance: 3, iconFlipRtl: 5, actionElement: 32 };
|
|
@@ -25,13 +24,13 @@ class x extends b {
|
|
|
25
24
|
get actionElement() {
|
|
26
25
|
return this._element;
|
|
27
26
|
}
|
|
28
|
-
measure({ layout: t, scale: e }) {
|
|
29
|
-
const a =
|
|
30
|
-
return [Math.max(
|
|
27
|
+
measure({ layout: t, scale: e, sizes: i }) {
|
|
28
|
+
const a = i.actionPadding[e], n = i.action[t][e], o = t === "horizontal" ? this._measuredWidth : this._measuredHeight;
|
|
29
|
+
return [Math.max(n, o) + a];
|
|
31
30
|
}
|
|
32
31
|
proxiedRender(t) {
|
|
33
|
-
const { tooltipAppearance: e, scale:
|
|
34
|
-
return
|
|
32
|
+
const { tooltipAppearance: e, scale: i } = t, a = this.tooltipText || this.labelText, n = this._hydratedElement, o = e !== "native" && !!this.tooltipText && n, l = e === "calcite-dark" ? "calcite-mode-dark" : void 0, d = _(t);
|
|
33
|
+
return c`${g(this, c`<calcite-action .active=${this.active} data-appearance=${this.appearance ?? s} data-kind=${this.kind ?? s} data-layout=${t.layout ?? s} .disabled=${this.disabled} .icon=${this.icon} .iconFlipRtl=${this.iconFlipRtl} .indicator=${this.indicator} .label=${a} .loading=${this.loading} @click=${(h) => this._handleActionClick(h)} .scale=${i} .text=${this.labelText} .textEnabled=${this.textEnabled} title=${(e === "native" ? a : void 0) ?? s} ${p(this.#e)}></calcite-action>`)}${o ? c`<calcite-tooltip class=${b(l)} overlay-positioning=fixed .placement=${d} .referenceElement=${n} .scale=${i}><span>${a}</span></calcite-tooltip>` : void 0}`;
|
|
35
34
|
}
|
|
36
35
|
disconnectedCallback() {
|
|
37
36
|
this.#t?.disconnect(), super.disconnectedCallback();
|
|
@@ -46,7 +45,7 @@ class x extends b {
|
|
|
46
45
|
e && (this._measuredWidth = Math.round(e.width), this._measuredHeight = Math.round(e.height));
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
|
|
48
|
+
m("arcgis-toolbar-action", v);
|
|
50
49
|
export {
|
|
51
|
-
|
|
50
|
+
v as ArcgisToolbarAction
|
|
52
51
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c
|
|
3
|
-
import { html as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import {
|
|
6
|
-
import { L as
|
|
7
|
-
import { u as
|
|
8
|
-
class
|
|
2
|
+
import { c } from "../../chunks/runtime.js";
|
|
3
|
+
import { html as d } from "lit";
|
|
4
|
+
import { LitElement as p, nothing as h } from "@arcgis/lumina";
|
|
5
|
+
import { a as u } from "../../chunks/utils.js";
|
|
6
|
+
import { L as m, i as g } from "../../chunks/types.js";
|
|
7
|
+
import { u as b } from "../../chunks/utils2.js";
|
|
8
|
+
class f extends p {
|
|
9
9
|
constructor() {
|
|
10
|
-
super(...arguments), this.#e = new MutationObserver(() => this.#
|
|
10
|
+
super(...arguments), this.#e = new MutationObserver(() => this.#o()), this.preferEndSlot = !1, this.priority = m.Default;
|
|
11
11
|
}
|
|
12
12
|
static {
|
|
13
13
|
this.properties = { _children: 16, preferEndSlot: 5, priority: 9 };
|
|
@@ -18,31 +18,34 @@ class y extends u {
|
|
|
18
18
|
const r = this._children;
|
|
19
19
|
if (!r?.length)
|
|
20
20
|
return [0];
|
|
21
|
-
const o =
|
|
22
|
-
return
|
|
21
|
+
const o = this.#t(e) + e.sizes.groupPadding[e.scale], i = r.map((t) => t.measure(e)).reduce((t, s) => t.flatMap((a) => s.map((l) => a + l)), [0]);
|
|
22
|
+
return b(i.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
|
|
29
|
-
return
|
|
28
|
+
const n = this.preferEndSlot && (e.toolbarKind === "docked" || e.layout === "vertical") ? "actions-end" : void 0, i = r - e.sizes.groupPadding[e.scale] - this.#t(e), t = u(o, e, i);
|
|
29
|
+
return d`<calcite-action-group .scale=${e.scale} .layout=${e.layout} slot=${n ?? h}>${t.map(({ group: s, budget: a }) => s.proxiedRender(e, a))}</calcite-action-group>`;
|
|
30
30
|
}
|
|
31
31
|
connectedCallback() {
|
|
32
|
-
super.connectedCallback(), this.#e.observe(this.el, { childList: !0 }), this.#
|
|
32
|
+
super.connectedCallback(), this.#e.observe(this.el, { childList: !0 }), this.#o();
|
|
33
33
|
}
|
|
34
34
|
disconnectedCallback() {
|
|
35
35
|
this.#e.disconnect(), super.disconnectedCallback();
|
|
36
36
|
}
|
|
37
|
-
#t() {
|
|
37
|
+
#t(e) {
|
|
38
|
+
return this.preferEndSlot && e.layout === "horizontal" && e.toolbarKind === "docked" ? 0 : e.sizes.groupSeparator;
|
|
39
|
+
}
|
|
40
|
+
#o() {
|
|
38
41
|
this.#r?.abort();
|
|
39
|
-
const e = Array.from(this.el.children).filter(
|
|
42
|
+
const e = Array.from(this.el.children).filter(g), r = new AbortController();
|
|
40
43
|
this.#r = r, Promise.all(e.map((o) => o.componentOnReady())).then(() => {
|
|
41
44
|
!this.isConnected || r.signal.aborted || (this._children = e);
|
|
42
45
|
});
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
c("arcgis-toolbar-group", f);
|
|
46
49
|
export {
|
|
47
|
-
|
|
50
|
+
f as ArcgisToolbarGroup
|
|
48
51
|
};
|
|
@@ -65,10 +65,10 @@ export abstract class ArcgisToolbarItem extends LitElement {
|
|
|
65
65
|
*/
|
|
66
66
|
accessor tooltipText: string;
|
|
67
67
|
/**
|
|
68
|
-
* @param
|
|
68
|
+
* @param context
|
|
69
69
|
* @internal
|
|
70
70
|
*/
|
|
71
|
-
measure(
|
|
71
|
+
measure(context: MeasurementContext): number[];
|
|
72
72
|
/**
|
|
73
73
|
* @param context
|
|
74
74
|
* @param mode
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as m } from "../../chunks/runtime.js";
|
|
3
3
|
import { html as n } from "lit";
|
|
4
|
-
import { ref as
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { g as x } from "../../chunks/
|
|
9
|
-
class C extends
|
|
4
|
+
import { ref as f } from "lit/directives/ref.js";
|
|
5
|
+
import { LitElement as $, createEvent as v, nothing as a, safeClassMap as g } from "@arcgis/lumina";
|
|
6
|
+
import { E as b } from "../../chunks/element-reference-controller.js";
|
|
7
|
+
import { g as u } from "../../chunks/utils2.js";
|
|
8
|
+
import { g as x } from "../../chunks/utils.js";
|
|
9
|
+
class C extends $ {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(...arguments), this._active = !1, this._elementReferenceController = new
|
|
11
|
+
super(...arguments), this._active = !1, this._elementReferenceController = new b(this), this.icon = "question-mark", this.tooltipText = "", this.labelText = "", this.disabled = !1, this.loading = !1, this.iconFlipRtl = !1, this.arcgisItemSelected = v();
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
14
|
this.properties = { icon: 3, lastActivated: 0, active: 7, tooltipText: 1, labelText: 3, disabled: 7, loading: 7, iconFlipRtl: 7, actionElement: 32 };
|
|
@@ -22,12 +22,12 @@ class C extends v {
|
|
|
22
22
|
get actionElement() {
|
|
23
23
|
return this._elementReferenceController.element;
|
|
24
24
|
}
|
|
25
|
-
measure(
|
|
26
|
-
return [
|
|
25
|
+
measure(t) {
|
|
26
|
+
return [x(t)];
|
|
27
27
|
}
|
|
28
|
-
proxiedRender(t, e,
|
|
29
|
-
const l = t.tooltipAppearance,
|
|
30
|
-
return e === "dropdown-item" ? n`<calcite-dropdown-item .disabled=${this.disabled} icon-start=${this.icon ??
|
|
28
|
+
proxiedRender(t, e, s) {
|
|
29
|
+
const l = t.tooltipAppearance, c = this._elementReferenceController.element, r = l !== "native" && e === "collapsed-action", d = l === "native" && e === "collapsed-action", h = l === "calcite-dark" ? "calcite-mode-dark" : void 0, p = u(t), i = this.tooltipText || this.labelText;
|
|
30
|
+
return e === "dropdown-item" ? n`<calcite-dropdown-item .disabled=${this.disabled} icon-start=${this.icon ?? a} .iconFlipRtl=${this.iconFlipRtl ? "both" : void 0} .label=${i} @calciteDropdownItemSelect=${(o) => this._handleDropdownItemClick(o)} .selected=${this.active || s}>${this.labelText}</calcite-dropdown-item>` : n`<calcite-action .active=${this.active} .disabled=${this.disabled} .icon=${this.icon} .iconFlipRtl=${this.iconFlipRtl} .label=${i} .loading=${this.loading} @click=${(o) => this._handleActionClick(o)} .scale=${t.scale} .text=${this.labelText} .textEnabled=${e === "expanded-action"} title=${(d ? i : void 0) ?? a} ${f(this._elementReferenceController.ref)}></calcite-action>${r && c ? n`<calcite-tooltip class=${g(h)} close-on-click overlay-positioning=fixed .placement=${p} .referenceElement=${c}><span>${i}</span></calcite-tooltip>` : void 0}`;
|
|
31
31
|
}
|
|
32
32
|
_handleActionClick(t) {
|
|
33
33
|
this.isConnected && (this.lastActivated = /* @__PURE__ */ new Date(), this.arcgisItemSelected?.emit({ element: t.currentTarget }));
|
|
@@ -36,7 +36,7 @@ class C extends v {
|
|
|
36
36
|
this.isConnected && (this.lastActivated = /* @__PURE__ */ new Date(), this.arcgisItemSelected?.emit({ element: t.currentTarget }));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
m("arcgis-toolbar-item", C);
|
|
40
40
|
export {
|
|
41
41
|
C as ArcgisToolbarItem
|
|
42
42
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import { c as A } from "../../chunks/runtime.js";
|
|
3
3
|
import { ref as u } from "lit/directives/ref.js";
|
|
4
|
-
import { html as
|
|
4
|
+
import { html as h } from "lit";
|
|
5
5
|
import { LitElement as C, nothing as v, safeClassMap as $ } from "@arcgis/lumina";
|
|
6
6
|
import { L as f } from "../../chunks/types.js";
|
|
7
7
|
import { E as w } from "../../chunks/element-reference-controller.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import { u as _, g as y } from "../../chunks/utils2.js";
|
|
9
|
+
import { g, f as L } from "../../chunks/utils.js";
|
|
10
|
+
import { b as R } from "../../chunks/utils3.js";
|
|
11
|
+
class E extends C {
|
|
11
12
|
constructor() {
|
|
12
13
|
super(...arguments), this._elementReferenceController = new w(this), this._childrenObserver = new MutationObserver(() => {
|
|
13
14
|
this._syncChildren();
|
|
@@ -20,22 +21,22 @@ class R extends C {
|
|
|
20
21
|
const t = this._children?.length ?? 0;
|
|
21
22
|
if (!t)
|
|
22
23
|
return [0];
|
|
23
|
-
const
|
|
24
|
+
const o = g(e), s = t * o;
|
|
24
25
|
if (!(this.priority < f.NeverCollapse && t > 2))
|
|
25
|
-
return [
|
|
26
|
-
const
|
|
26
|
+
return [s];
|
|
27
|
+
const r = Math.min(t, 2) * o, n = [r];
|
|
27
28
|
if (t <= 2 || this.priority <= f.ForceCollapse)
|
|
28
|
-
return
|
|
29
|
-
for (let
|
|
30
|
-
|
|
31
|
-
return _(
|
|
29
|
+
return n;
|
|
30
|
+
for (let i = 1; i < t - 1; i++)
|
|
31
|
+
n.push(r + o * i);
|
|
32
|
+
return _(n);
|
|
32
33
|
}
|
|
33
34
|
proxiedRender(e, t) {
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
35
|
+
const o = this._children;
|
|
36
|
+
if (!o)
|
|
36
37
|
return;
|
|
37
|
-
const { visible:
|
|
38
|
-
return
|
|
38
|
+
const { visible: s, hidden: l } = this._resolveActionsFromBudget(o, e, t), r = "hamburger", n = this.overflowActionLabel, i = e.tooltipAppearance, d = i !== "native", c = this._elementReferenceController.element, p = i === "calcite-dark" ? "calcite-mode-dark" : void 0, a = y(e), b = this.menuAppearance === "action-menu" ? h`<calcite-action-menu .label=${n} overlay-positioning=fixed .placement=${a}><calcite-action .icon=${r} .scale=${e.scale} slot=trigger .text=${n} title=${(i === "native" ? n : "") ?? v} ${u(this._elementReferenceController.ref)}></calcite-action>${l.map((m) => m.proxiedRender(e, "expanded-action"))}</calcite-action-menu>` : h`<calcite-action .icon=${r} .scale=${e.scale} .text=${n} title=${(i === "native" ? n : "") ?? v} ${u(this._elementReferenceController.ref)}></calcite-action><calcite-dropdown overlay-positioning=fixed .placement=${a} .referenceElement=${c}><calcite-dropdown-group selection-mode=none>${l.map((m) => m.proxiedRender(e, "dropdown-item"))}</calcite-dropdown-group></calcite-dropdown>`;
|
|
39
|
+
return h`${s.map((m) => m.proxiedRender(e, "collapsed-action"))}${l.length ? b : void 0}${l.length && d ? h`<calcite-tooltip class=${$(p)} close-on-click overlay-positioning=fixed .placement=${a} .referenceElement=${c}><span>${n}</span></calcite-tooltip>` : void 0}`;
|
|
39
40
|
}
|
|
40
41
|
connectedCallback() {
|
|
41
42
|
super.connectedCallback(), this._childrenObserver.observe(this.el, { childList: !0 }), this._syncChildren();
|
|
@@ -46,23 +47,24 @@ class R extends C {
|
|
|
46
47
|
_syncChildren() {
|
|
47
48
|
this._componentWaitAbortController?.abort();
|
|
48
49
|
const e = Array.from(this.el.querySelectorAll("arcgis-toolbar-item")), t = new AbortController();
|
|
49
|
-
this._componentWaitAbortController = t, Promise.all(e.map((
|
|
50
|
+
this._componentWaitAbortController = t, Promise.all(e.map((o) => o.componentOnReady())).then(() => {
|
|
50
51
|
!this.isConnected || t.signal.aborted || (this._children = e);
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
_resolveActionsFromBudget(e, t,
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
_resolveActionsFromBudget(e, t, o) {
|
|
55
|
+
const s = e.find((p) => p.active) ?? e?.toSorted(R)?.at(0), l = g(t);
|
|
56
|
+
let r = Math.floor(o / l);
|
|
57
|
+
if (L((r + 1) * l, o) && r++, r >= e.length)
|
|
56
58
|
return { visible: [...e], hidden: [] };
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
const [
|
|
60
|
-
|
|
59
|
+
const i = r - 1, d = e.slice(0, i), c = e.slice(i);
|
|
60
|
+
if (s && c.includes(s)) {
|
|
61
|
+
const [p] = c.splice(c.indexOf(s), 1), a = d.pop();
|
|
62
|
+
d.push(p), a && c.unshift(a);
|
|
61
63
|
}
|
|
62
|
-
return { visible:
|
|
64
|
+
return { visible: d, hidden: c };
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
|
-
A("arcgis-toolbar-more-button",
|
|
67
|
+
A("arcgis-toolbar-more-button", E);
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
E as ArcgisToolbarMoreButton
|
|
68
70
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import { c as y } from "../../chunks/runtime.js";
|
|
3
3
|
import { ref as $ } from "lit/directives/ref.js";
|
|
4
|
-
import { html as
|
|
5
|
-
import { LitElement as _, nothing as
|
|
4
|
+
import { html as h } from "lit";
|
|
5
|
+
import { LitElement as _, nothing as a, safeClassMap as d } from "@arcgis/lumina";
|
|
6
6
|
import { E as L } from "../../chunks/element-reference-controller.js";
|
|
7
|
-
import { L as
|
|
8
|
-
import {
|
|
9
|
-
import { b as
|
|
10
|
-
import {
|
|
11
|
-
class
|
|
7
|
+
import { L as u } from "../../chunks/types.js";
|
|
8
|
+
import { u as R, g as k } from "../../chunks/utils2.js";
|
|
9
|
+
import { g as b, f as E } from "../../chunks/utils.js";
|
|
10
|
+
import { b as O } from "../../chunks/utils3.js";
|
|
11
|
+
class T extends _ {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(...arguments), this._elementReferenceController = new L(this), this._childrenObserver = new MutationObserver(() => this._syncChildren()), this.priority =
|
|
13
|
+
super(...arguments), this._elementReferenceController = new L(this), this._childrenObserver = new MutationObserver(() => this._syncChildren()), this.priority = u.Medium, this.menuAppearance = "dropdown", this.overflowActionLabel = "More actions";
|
|
14
14
|
}
|
|
15
15
|
static {
|
|
16
16
|
this.properties = { _children: 16, priority: 9, menuAppearance: 1, overflowActionLabel: 1 };
|
|
17
17
|
}
|
|
18
18
|
measure(e) {
|
|
19
|
-
const { priority:
|
|
20
|
-
if (!
|
|
19
|
+
const { priority: t, _children: r } = this, l = r?.length ?? 0;
|
|
20
|
+
if (!l)
|
|
21
21
|
return [0];
|
|
22
|
-
const o =
|
|
23
|
-
if (!(
|
|
24
|
-
return [
|
|
25
|
-
const
|
|
26
|
-
return
|
|
22
|
+
const o = b(e), i = l * o;
|
|
23
|
+
if (!(t < u.NeverCollapse) || l <= 1)
|
|
24
|
+
return [i];
|
|
25
|
+
const s = o + P(e);
|
|
26
|
+
return t <= u.ForceCollapse ? [s] : R([s, i]);
|
|
27
27
|
}
|
|
28
|
-
proxiedRender(e,
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
28
|
+
proxiedRender(e, t) {
|
|
29
|
+
const r = this._children;
|
|
30
|
+
if (!r)
|
|
31
31
|
return;
|
|
32
|
-
const { visible:
|
|
33
|
-
return
|
|
32
|
+
const { visible: l, hidden: o } = this._resolveActionsFromBudget(r, e, t, this.menuAppearance === "dropdown"), i = B(e), n = this.overflowActionLabel, s = e.tooltipAppearance, C = s !== "native", f = this._elementReferenceController.element, A = s === "calcite-dark" ? "calcite-mode-dark" : void 0, v = "split-anchor", g = o.length ? "split-menu" : "", m = k(e), w = this.menuAppearance === "action-menu" ? h`<calcite-action-menu class=${d(g)} .label=${n} overlay-positioning=fixed .placement=${m}><calcite-action class=${d(v)} data-layout=${e.layout ?? a} data-scale=${e.scale ?? a} .icon=${i} .label=${n} .scale=${e.scale} slot=trigger .text=${n} title=${n ?? a} ${$(this._elementReferenceController.ref)}></calcite-action>${o.map((c) => c.proxiedRender(e, "expanded-action"))}</calcite-action-menu>` : h`<calcite-action class=${d(v)} data-layout=${e.layout ?? a} data-scale=${e.scale ?? a} .icon=${i} .label=${n} .scale=${e.scale} .text=${s === "native" ? n : ""} title=${n ?? a} ${$(this._elementReferenceController.ref)}></calcite-action><calcite-dropdown class=${d(g)} overlay-positioning=fixed .placement=${m} .referenceElement=${f} .scale=${e.scale}><calcite-dropdown-group selection-mode=single>${o.map((c) => c.proxiedRender(e, "dropdown-item", c === l.at(0)))}</calcite-dropdown-group></calcite-dropdown>`;
|
|
33
|
+
return h`<div class="split-host">${l.map((c) => c.proxiedRender(e, "collapsed-action"))}${o.length ? w : void 0}${o.length && C ? h`<calcite-tooltip class=${d(A)} close-on-click overlay-positioning=fixed .placement=${m} .referenceElement=${f}><span>${n}</span></calcite-tooltip>` : void 0}</div>`;
|
|
34
34
|
}
|
|
35
35
|
connectedCallback() {
|
|
36
36
|
super.connectedCallback(), this._childrenObserver.observe(this.el, { childList: !0 }), this._syncChildren();
|
|
@@ -38,30 +38,30 @@ class S extends _ {
|
|
|
38
38
|
disconnectedCallback() {
|
|
39
39
|
this._childrenObserver.disconnect(), super.disconnectedCallback();
|
|
40
40
|
}
|
|
41
|
-
_resolveActionsFromBudget(e,
|
|
42
|
-
const o = e.find((
|
|
43
|
-
if (
|
|
41
|
+
_resolveActionsFromBudget(e, t, r, l) {
|
|
42
|
+
const o = e.find((s) => s.active) ?? e?.toSorted(O)?.at(0);
|
|
43
|
+
if (E(e.length * b(t), r))
|
|
44
44
|
return { visible: [...e], hidden: [] };
|
|
45
|
-
if (
|
|
45
|
+
if (l)
|
|
46
46
|
return { visible: [o ?? e[0]], hidden: [...e] };
|
|
47
|
-
const
|
|
48
|
-
return { visible:
|
|
47
|
+
const i = [...e];
|
|
48
|
+
return { visible: i.splice(i.indexOf(o), 1), hidden: i };
|
|
49
49
|
}
|
|
50
50
|
_syncChildren() {
|
|
51
51
|
this._componentWaitAbortController?.abort();
|
|
52
|
-
const e = Array.from(this.el.querySelectorAll("arcgis-toolbar-item")),
|
|
53
|
-
this._componentWaitAbortController =
|
|
54
|
-
!this.isConnected ||
|
|
52
|
+
const e = Array.from(this.el.querySelectorAll("arcgis-toolbar-item")), t = new AbortController();
|
|
53
|
+
this._componentWaitAbortController = t, Promise.all(e.map((r) => r.componentOnReady())).then(() => {
|
|
54
|
+
!this.isConnected || t.signal.aborted || (this._children = e);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function B({ layout: p, relativePosition: e }) {
|
|
59
59
|
return p === "horizontal" ? e.startsWith("top") ? "chevron-down" : "chevron-up" : e.endsWith("left") ? "chevron-right" : "chevron-left";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
61
|
+
function P({ layout: p, scale: e, sizes: t }) {
|
|
62
|
+
return t.splitButtonPart[p][e];
|
|
63
63
|
}
|
|
64
|
-
y("arcgis-toolbar-split-button",
|
|
64
|
+
y("arcgis-toolbar-split-button", T);
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
T as ArcgisToolbarSplitButton
|
|
67
67
|
};
|