@arcgis/common-components 6.0.0-next.36 → 6.0.0-next.38

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.
Files changed (42) hide show
  1. package/dist/cdn/22FTDQOT.js +2 -0
  2. package/dist/cdn/2QB3ZV4R.js +2 -0
  3. package/dist/cdn/3QTMLOOM.js +2 -0
  4. package/dist/cdn/4X2SOHYB.js +2 -0
  5. package/dist/cdn/AVNN2LEY.js +2 -0
  6. package/dist/cdn/BLHYP3ST.js +2 -0
  7. package/dist/cdn/BP33MOOC.js +2 -0
  8. package/dist/cdn/HX2AL2HN.js +2 -0
  9. package/dist/cdn/UMZT2TBE.js +2 -0
  10. package/dist/cdn/VAX5UX45.js +2 -0
  11. package/dist/cdn/ZJSDEBMS.js +2 -0
  12. package/dist/cdn/index.js +1 -1
  13. package/dist/chunks/utils.js +75 -37
  14. package/dist/chunks/utils2.js +9 -14
  15. package/dist/chunks/{intrinsic-sizing.js → well-known-sizes-controller.js} +38 -14
  16. package/dist/components/arcgis-slider/customElement.js +23 -16
  17. package/dist/components/arcgis-toolbar/customElement.js +34 -29
  18. package/dist/components/arcgis-toolbar/types.d.ts +20 -1
  19. package/dist/components/arcgis-toolbar-action/customElement.js +17 -18
  20. package/dist/components/arcgis-toolbar-group/customElement.js +20 -17
  21. package/dist/components/arcgis-toolbar-item/customElement.d.ts +2 -2
  22. package/dist/components/arcgis-toolbar-item/customElement.js +14 -14
  23. package/dist/components/arcgis-toolbar-more-button/customElement.js +28 -26
  24. package/dist/components/arcgis-toolbar-split-button/customElement.js +34 -34
  25. package/dist/components/arcgis-toolbar-stack/customElement.js +48 -43
  26. package/dist/components/arcgis-value-picker-slider/customElement.d.ts +12 -19
  27. package/dist/docs/api.json +1 -1
  28. package/dist/docs/docs.json +1 -1
  29. package/dist/docs/vscode.html-custom-data.json +1 -1
  30. package/dist/docs/web-types.json +1 -1
  31. package/package.json +5 -5
  32. package/dist/cdn/32MHBJSZ.js +0 -2
  33. package/dist/cdn/4D35RDOE.js +0 -2
  34. package/dist/cdn/BAALW3SQ.js +0 -2
  35. package/dist/cdn/DPJGC3YQ.js +0 -2
  36. package/dist/cdn/E5VIZW6M.js +0 -2
  37. package/dist/cdn/FGG3L42U.js +0 -2
  38. package/dist/cdn/FVFYAK24.js +0 -2
  39. package/dist/cdn/RYVWIAKZ.js +0 -2
  40. package/dist/cdn/UFSM3GRY.js +0 -2
  41. package/dist/cdn/W2W34T5K.js +0 -2
  42. package/dist/cdn/XQ65BGER.js +0 -2
@@ -139,6 +139,13 @@ let k = class extends ge {
139
139
  const e = this._get("values");
140
140
  if (a = a?.map((n) => L(y(n, this.precision), this.min, this.max)).sort((n, i) => n - i), e?.length === a?.length && e.every((n, i) => n === a[i]))
141
141
  return;
142
+ if (this._entries.size === 1 && a?.length === 1) {
143
+ const n = this._entries.keys().next().value;
144
+ if (n !== void 0) {
145
+ this._entries.set(n, a[0]), this._set("values", a);
146
+ return;
147
+ }
148
+ }
142
149
  const t = new Map(a?.map((n) => [W(), n]));
143
150
  this._entries = t, this._set("values", a);
144
151
  }
@@ -408,7 +415,7 @@ function N(a, e, t, n) {
408
415
  }
409
416
  return p ? r.indexToValue(d) : c;
410
417
  }
411
- function Se(a, e, t, n) {
418
+ function ze(a, e, t, n) {
412
419
  const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = a, c = e.get(t);
413
420
  if (n = n > 0 ? 1 : -1, !r) {
414
421
  const p = new Set(
@@ -440,7 +447,7 @@ function Se(a, e, t, n) {
440
447
  }
441
448
  return r.indexToValue(d);
442
449
  }
443
- function ze(a, e, t) {
450
+ function Se(a, e, t) {
444
451
  const { stepsProvider: n, min: i, max: r } = a, o = /* @__PURE__ */ new Map(), s = Array.from(e).sort((c, h) => re(c[1], h[1]));
445
452
  if (n) {
446
453
  let c = 0;
@@ -487,7 +494,7 @@ class Fe extends ie {
487
494
  super(...arguments), this._direction = se(), this._stepsProvider = null, this._popoverElement = j(), this._trackElement = j(), this.messages = de({}), this._onPointerMoveDragUpdate = (e) => {
488
495
  this._updateDrag(this._mapEventToRange(e));
489
496
  }, this._onPointerUpDragEnd = (e) => {
490
- z(e) && this._endDrag();
497
+ S(e) && this._endDrag();
491
498
  }, this._onPointerCancelDragEnd = () => {
492
499
  this._endDrag();
493
500
  }, this._formatLabel = (e, t, n) => {
@@ -680,16 +687,16 @@ class Fe extends ie {
680
687
  this._setActivePart(null);
681
688
  }
682
689
  _onTrackRangePointerDown(e) {
683
- this._disabledOrInvalid || !z(e) || (e.preventDefault(), e.currentTarget.focus(), this._startDrag("range", this._mapEventToRange(e)));
690
+ this._disabledOrInvalid || !S(e) || (e.preventDefault(), e.currentTarget.focus(), this._startDrag("range", this._mapEventToRange(e)));
684
691
  }
685
692
  async _onPointerDown(e) {
686
- if (this._disabledOrInvalid || !z(e))
693
+ if (this._disabledOrInvalid || !S(e))
687
694
  return;
688
695
  const t = this.renderRoot.querySelector("arcgis-label-input[editing]");
689
696
  if (e.target === t)
690
697
  return;
691
698
  if (t) {
692
- t.blur(), this._focusEntry(S(t));
699
+ t.blur(), this._focusEntry(z(t));
693
700
  return;
694
701
  }
695
702
  if (Oe(e.target) || this.values?.length > 1)
@@ -705,14 +712,14 @@ class Fe extends ie {
705
712
  this._setValue(i, l), this._focusEntry(i);
706
713
  }
707
714
  _onThumbPointerDown(e) {
708
- const t = S(e.currentTarget);
709
- if (!z(e) || this._disabledOrInvalid || !t)
715
+ const t = z(e.currentTarget);
716
+ if (!S(e) || this._disabledOrInvalid || !t)
710
717
  return;
711
718
  const n = Z(this, t);
712
719
  e.target === n && n?.editing || (e.stopPropagation(), e.preventDefault(), this._focusEntry(t), this._startDrag(t, this._mapEventToRange(e)));
713
720
  }
714
721
  _onFixedThumbPointerDown(e) {
715
- this._disabledOrInvalid || !z(e) || (e.preventDefault(), e.currentTarget.focus());
722
+ this._disabledOrInvalid || !S(e) || (e.preventDefault(), e.currentTarget.focus());
716
723
  }
717
724
  _endDrag() {
718
725
  if (this._disabledOrInvalid)
@@ -800,7 +807,7 @@ class Fe extends ie {
800
807
  return n ? e : null;
801
808
  }
802
809
  _onThumbFocus(e) {
803
- const t = S(e.currentTarget);
810
+ const t = z(e.currentTarget);
804
811
  this._setActivePart(t);
805
812
  }
806
813
  _onThumbBlur() {
@@ -822,7 +829,7 @@ class Fe extends ie {
822
829
  r && this.arcgisRangeChange.emit();
823
830
  }
824
831
  _onValueInputChange(e) {
825
- const t = e.currentTarget, n = S(t), i = t.value;
832
+ const t = e.currentTarget, n = z(t), i = t.value;
826
833
  if (n) {
827
834
  e.stopPropagation();
828
835
  const r = this._sliderData.getValue(n), o = O(this._stepsProvider, this._sliderData.entries, n, i - r, {
@@ -866,7 +873,7 @@ class Fe extends ie {
866
873
  this._hasContentEnd = H(e);
867
874
  }
868
875
  _onThumbKeyDown(e) {
869
- const t = S(e.currentTarget);
876
+ const t = z(e.currentTarget);
870
877
  if (!t)
871
878
  return;
872
879
  const n = e.currentTarget.querySelector("arcgis-label-input");
@@ -885,7 +892,7 @@ class Fe extends ie {
885
892
  }
886
893
  if (J(e.key)) {
887
894
  e.preventDefault();
888
- const r = Se(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
895
+ const r = ze(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
889
896
  this._setValue(t, r);
890
897
  }
891
898
  }
@@ -901,7 +908,7 @@ class Fe extends ie {
901
908
  }
902
909
  if (J(e.key)) {
903
910
  e.preventDefault();
904
- const n = ze(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
911
+ const n = Se(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
905
912
  this._setValues(n);
906
913
  }
907
914
  }
@@ -1078,7 +1085,7 @@ class Fe extends ie {
1078
1085
  function Oe(a) {
1079
1086
  return "dataset" in a && a.tagName === "ARCGIS-LABEL-INPUT" && (a.dataset.type === "min" || a.dataset.type === "max");
1080
1087
  }
1081
- function S(a) {
1088
+ function z(a) {
1082
1089
  const e = ce(a, "[data-entry]");
1083
1090
  return e && "dataset" in e ? e.dataset.entry : null;
1084
1091
  }
@@ -1094,7 +1101,7 @@ function Ae(a, e) {
1094
1101
  function Z(a, e) {
1095
1102
  return e ? a.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
1096
1103
  }
1097
- function z(a) {
1104
+ function S(a) {
1098
1105
  return a.isPrimary && a.button === 0;
1099
1106
  }
1100
1107
  const He = 5;
@@ -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 h } from "lit";
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 { s as _, a as $, b as R, c as z, r as B } from "../../chunks/intrinsic-sizing.js";
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 L } from "../../chunks/types.js";
11
- class w extends f {
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.#i = y(), this._layout = "horizontal", this._setRenderedBar = (t) => {
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 = [_, $, R, z];
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("-"), r = this.#i;
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}-${r === "ltr" ? "right" : "left"}`;
51
+ return `${t}-${i === "ltr" ? "right" : "left"}`;
51
52
  case "start":
52
- return `${t}-${r === "ltr" ? "left" : "right"}`;
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 s = e.map((i) => i.measure(t)).reduce((i, a) => i.flatMap((o) => a.map((n) => o + n)), [0]).map((i) => l(e, t, i).reduce((a, { budget: o }) => a + o, 0));
60
- return Array.from(new Set(s)).sort((i, a) => i - a);
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 ?? [], r = (s) => l(e, t, s).reduce((i, { budget: a }) => i + a, 0);
64
- return { minimum: r(0), maximum: r(1 / 0) };
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 r = this._groups;
68
- return r?.length ? l(r, t, e) : [];
68
+ const i = this._groups;
69
+ return i?.length ? l(i, t, e) : [];
69
70
  }
70
- proxiedRender(t, e, r = this.toolbarKind, s = e) {
71
+ proxiedRender(t, e, i = this.toolbarKind, o = e) {
71
72
  if (!this._groups?.length)
72
73
  return;
73
- const a = this.allocate(t, e), [o, n] = t.relativePosition.split("-"), d = t.layout === "horizontal" ? { maxWidth: `${s}px` } : { maxHeight: `${s}px` };
74
- return b(this, h`<div class=${`toolbar-grid-wrapper ${n} ${o}`} style=${c(d)}><div class="toolbar-shadow-wrapper" style=${c(d)}><calcite-action-bar expand-toggle-disabled .floating=${r === "floating"} .layout=${t.layout} overflow-mode=none .scale=${t.scale} ${m(this._setRenderedBar)}>${a.map(({ group: u, budget: p }) => u.proxiedRender(t, p))}</calcite-action-bar></div></div>`);
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.#r?.abort();
87
- const t = Array.from(this.el.children).filter(L), e = new AbortController();
88
- this.#r = e, Promise.all(t.map((r) => r.componentOnReady())).then(() => {
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
- }, r = this.allocate(e, this._availableLength).reduce((s, { budget: i }) => s + i, 0);
106
+ }, o = this.allocate(i, this._availableLength).reduce((r, { budget: s }) => r + s, 0);
102
107
  if (this.allocatedLength === void 0) {
103
- const { minimum: s, maximum: i } = this.measureIntrinsicSize(e);
104
- return h`<div class="intrinsic-sizing-container">${B(s, i, this.layout)}${this.proxiedRender(e, r, this.toolbarKind, this._availableLength)}</div>`;
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(e, r, this.toolbarKind, this._availableLength);
111
+ return this.proxiedRender(i, o, this.toolbarKind, this._availableLength);
107
112
  }
108
113
  }
109
- g("arcgis-toolbar", w);
114
+ g("arcgis-toolbar", C);
110
115
  export {
111
- w as ArcgisToolbar
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 p } from "../../chunks/runtime.js";
3
- import { ref as u } from "lit/directives/ref.js";
4
- import { css as g, html as o } from "lit";
5
- import { keyed as f } from "lit/directives/keyed.js";
6
- import { LitElement as b, createEvent as l, nothing as n, safeClassMap as _ } from "@arcgis/lumina";
7
- import { W as r } from "../../chunks/utils.js";
8
- import { g as $ } from "../../chunks/utils2.js";
9
- const v = g`:host([text-enabled][data-layout="vertical"]){.interaction-container>button{flex-direction:column;>.text-container{writing-mode:vertical-lr}}}`;
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(v.styleSheet));
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 = l(), this.arcgisToolbarItemSelected = l();
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 = r.actionPadding[e], i = r.action[e], s = t === "horizontal" ? this._measuredWidth : this._measuredHeight;
30
- return [Math.max(i, s) + a];
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: a } = t, i = this.tooltipText || this.labelText, s = this._hydratedElement, c = e !== "native" && !!this.tooltipText && s, d = e === "calcite-dark" ? "calcite-mode-dark" : void 0, h = $(t);
34
- return o`${f(this, o`<calcite-action .active=${this.active} data-appearance=${this.appearance ?? n} data-kind=${this.kind ?? n} data-layout=${t.layout ?? n} .disabled=${this.disabled} .icon=${this.icon} .iconFlipRtl=${this.iconFlipRtl} .indicator=${this.indicator} .label=${i} .loading=${this.loading} @click=${(m) => this._handleActionClick(m)} .scale=${a} .text=${this.labelText} .textEnabled=${this.textEnabled} title=${(e === "native" ? i : void 0) ?? n} ${u(this.#e)}></calcite-action>`)}${c ? o`<calcite-tooltip class=${_(d)} overlay-positioning=fixed .placement=${h} .referenceElement=${s} .scale=${a}><span>${i}</span></calcite-tooltip>` : void 0}`;
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
- p("arcgis-toolbar-action", x);
48
+ m("arcgis-toolbar-action", v);
50
49
  export {
51
- x as ArcgisToolbarAction
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 as d } from "../../chunks/runtime.js";
3
- import { html as p } from "lit";
4
- import { LitElement as u, nothing as h } from "@arcgis/lumina";
5
- import { W as i, a as m } from "../../chunks/utils.js";
6
- import { L as g, i as b } from "../../chunks/types.js";
7
- import { u as f } from "../../chunks/utils2.js";
8
- class y extends u {
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.#t()), this.preferEndSlot = !1, this.priority = g.Default;
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 = 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));
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 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>`;
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.#t();
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(b), r = new AbortController();
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
- d("arcgis-toolbar-group", y);
48
+ c("arcgis-toolbar-group", f);
46
49
  export {
47
- y as ArcgisToolbarGroup
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 parameter0
68
+ * @param context
69
69
  * @internal
70
70
  */
71
- measure(parameter0: MeasurementContext): number[];
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 f } from "../../chunks/runtime.js";
2
+ import { c as m } from "../../chunks/runtime.js";
3
3
  import { html as n } from "lit";
4
- import { ref as $ } from "lit/directives/ref.js";
5
- import { LitElement as v, createEvent as g, nothing as c, safeClassMap as b } from "@arcgis/lumina";
6
- import { W as s } from "../../chunks/utils.js";
7
- import { E as u } from "../../chunks/element-reference-controller.js";
8
- import { g as x } from "../../chunks/utils2.js";
9
- class C extends v {
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 u(this), this.icon = "question-mark", this.tooltipText = "", this.labelText = "", this.disabled = !1, this.loading = !1, this.iconFlipRtl = !1, this.arcgisItemSelected = g();
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({ scale: t }) {
26
- return [s.action[t] + s.actionPadding[t]];
25
+ measure(t) {
26
+ return [x(t)];
27
27
  }
28
- proxiedRender(t, e, r) {
29
- const l = t.tooltipAppearance, a = this._elementReferenceController.element, d = l !== "native" && e === "collapsed-action", m = l === "native" && e === "collapsed-action", h = l === "calcite-dark" ? "calcite-mode-dark" : void 0, p = x(t), i = this.tooltipText || this.labelText;
30
- return e === "dropdown-item" ? n`<calcite-dropdown-item .disabled=${this.disabled} icon-start=${this.icon ?? c} .iconFlipRtl=${this.iconFlipRtl ? "both" : void 0} .label=${i} @calciteDropdownItemSelect=${(o) => this._handleDropdownItemClick(o)} .selected=${this.active || r}>${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=${(m ? i : void 0) ?? c} ${$(this._elementReferenceController.ref)}></calcite-action>${d && a ? n`<calcite-tooltip class=${b(h)} close-on-click overlay-positioning=fixed .placement=${p} .referenceElement=${a}><span>${i}</span></calcite-tooltip>` : void 0}`;
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
- f("arcgis-toolbar-item", C);
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 m } from "lit";
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 { a as g, u as _, g as y } from "../../chunks/utils2.js";
9
- import { b as L } from "../../chunks/utils3.js";
10
- class R extends C {
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 i = g(e), l = t * i;
24
+ const o = g(e), s = t * o;
24
25
  if (!(this.priority < f.NeverCollapse && t > 2))
25
- return [l];
26
- const s = Math.min(t, 2) * i, o = [s];
26
+ return [s];
27
+ const r = Math.min(t, 2) * o, n = [r];
27
28
  if (t <= 2 || this.priority <= f.ForceCollapse)
28
- return o;
29
- for (let n = 1; n < t - 1; n++)
30
- o.push(s + i * n);
31
- return _(o);
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 i = this._children;
35
- if (!i)
35
+ const o = this._children;
36
+ if (!o)
36
37
  return;
37
- const { visible: l, hidden: r } = this._resolveActionsFromBudget(i, e, t), s = "hamburger", o = this.overflowActionLabel, n = e.tooltipAppearance, c = n !== "native", a = this._elementReferenceController.element, p = n === "calcite-dark" ? "calcite-mode-dark" : void 0, h = y(e), b = this.menuAppearance === "action-menu" ? m`<calcite-action-menu .label=${o} overlay-positioning=fixed .placement=${h}><calcite-action .icon=${s} .scale=${e.scale} slot=trigger .text=${o} title=${(n === "native" ? o : "") ?? v} ${u(this._elementReferenceController.ref)}></calcite-action>${r.map((d) => d.proxiedRender(e, "expanded-action"))}</calcite-action-menu>` : m`<calcite-action .icon=${s} .scale=${e.scale} .text=${o} title=${(n === "native" ? o : "") ?? v} ${u(this._elementReferenceController.ref)}></calcite-action><calcite-dropdown overlay-positioning=fixed .placement=${h} .referenceElement=${a}><calcite-dropdown-group selection-mode=none>${r.map((d) => d.proxiedRender(e, "dropdown-item"))}</calcite-dropdown-group></calcite-dropdown>`;
38
- return m`${l.map((d) => d.proxiedRender(e, "collapsed-action"))}${r.length ? b : void 0}${r.length && c ? m`<calcite-tooltip class=${$(p)} close-on-click overlay-positioning=fixed .placement=${h} .referenceElement=${a}><span>${o}</span></calcite-tooltip>` : void 0}`;
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((i) => i.componentOnReady())).then(() => {
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, i) {
54
- const l = e.find((a) => a.active) ?? e?.toSorted(L)?.at(0), r = Math.floor(i / g(t));
55
- if (r >= e.length)
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 o = r - 1, n = e.slice(0, o), c = e.slice(o);
58
- if (l && c.includes(l)) {
59
- const [a] = c.splice(c.indexOf(l), 1), p = n.pop();
60
- n.push(a), p && c.unshift(p);
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: n, hidden: c };
64
+ return { visible: d, hidden: c };
63
65
  }
64
66
  }
65
- A("arcgis-toolbar-more-button", R);
67
+ A("arcgis-toolbar-more-button", E);
66
68
  export {
67
- R as ArcgisToolbarMoreButton
69
+ E as ArcgisToolbarMoreButton
68
70
  };