@arcgis/common-components 5.2.0-next.160 → 5.2.0-next.162

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 (56) hide show
  1. package/dist/cdn/{N25TUHM4.js → 25YVYFDR.js} +1 -1
  2. package/dist/cdn/{HS7W72ER.js → 2CN444K3.js} +2 -2
  3. package/dist/cdn/33ALSUHX.js +2 -0
  4. package/dist/cdn/{6KPYL34Q.js → 3G4NZI2E.js} +1 -1
  5. package/dist/cdn/{3MYGEZOP.js → 45UMMWX3.js} +1 -1
  6. package/dist/cdn/{V5V533DI.js → 4EGAJOGW.js} +1 -1
  7. package/dist/cdn/{HX33VLI3.js → 4ILTGYPJ.js} +1 -1
  8. package/dist/cdn/6J34ISBP.js +2 -0
  9. package/dist/cdn/{NFWIWMYX.js → 6QHHJIHQ.js} +1 -1
  10. package/dist/cdn/{B3PVDZTP.js → A3ITL5ME.js} +1 -1
  11. package/dist/cdn/{CMX7WZPQ.js → C4SWIEG4.js} +1 -1
  12. package/dist/cdn/{QP6SIWPE.js → EDPU4PG5.js} +1 -1
  13. package/dist/cdn/{Y2G4R4SG.js → EXN3FCB3.js} +1 -1
  14. package/dist/cdn/{EPTIOSEA.js → GPEHBLDD.js} +1 -1
  15. package/dist/cdn/{DE72K2VB.js → GVXDTJ2Y.js} +1 -1
  16. package/dist/cdn/{NPVQBA5D.js → HEDEJWLN.js} +1 -1
  17. package/dist/cdn/{2E2QBY2J.js → HFWRQ5HO.js} +1 -1
  18. package/dist/cdn/{6HVKL3BT.js → IX2RAUZP.js} +1 -1
  19. package/dist/cdn/{2IDDI3CL.js → J2K2ZA6R.js} +1 -1
  20. package/dist/cdn/{FVQ64IB5.js → KBQ2X2W3.js} +1 -1
  21. package/dist/cdn/{4R6LRUCI.js → KF3Q6HBP.js} +1 -1
  22. package/dist/cdn/{NZEZVGEW.js → LN5RYAEV.js} +1 -1
  23. package/dist/cdn/{XVHY4R5V.js → LNT2HGQB.js} +1 -1
  24. package/dist/cdn/{UVT6DEL2.js → LOHAKHGE.js} +1 -1
  25. package/dist/cdn/{KWZ7LGK2.js → M46VSYUY.js} +1 -1
  26. package/dist/cdn/{SQZNAETL.js → MMRWMB4P.js} +1 -1
  27. package/dist/cdn/{LZ4RIDXD.js → OMH4F5GG.js} +1 -1
  28. package/dist/cdn/{5ESJPPJ3.js → P5FWV4P6.js} +1 -1
  29. package/dist/cdn/{JWK6KCSN.js → QFZ25HZA.js} +1 -1
  30. package/dist/cdn/RJFLKLJJ.js +2 -0
  31. package/dist/cdn/{BGX4M7G5.js → VRHSNO7N.js} +1 -1
  32. package/dist/cdn/{M3SD6ANM.js → VZEM3YFU.js} +1 -1
  33. package/dist/cdn/{7YKS2UHU.js → WKIY5YEY.js} +1 -1
  34. package/dist/cdn/WMH4ZBNX.js +2 -0
  35. package/dist/cdn/{YNJHUBFL.js → XF7NN262.js} +1 -1
  36. package/dist/cdn/{KQS6BKLU.js → XFZJKMAV.js} +1 -1
  37. package/dist/cdn/XZS2Z3AT.js +2 -0
  38. package/dist/cdn/{LON5GSEV.js → Z5IWHFGH.js} +1 -1
  39. package/dist/cdn/index.js +1 -1
  40. package/dist/chunks/toolbar.js +3 -3
  41. package/dist/components/arcgis-toolbar/customElement.d.ts +6 -3
  42. package/dist/components/arcgis-toolbar/customElement.js +30 -29
  43. package/dist/components/arcgis-toolbar/types.d.ts +1 -0
  44. package/dist/components/arcgis-toolbar-group/customElement.js +7 -7
  45. package/dist/components/arcgis-toolbar-item/customElement.js +1 -1
  46. package/dist/components/arcgis-toolbar-stack/customElement.js +54 -53
  47. package/dist/docs/api.json +1 -1
  48. package/dist/docs/docs.json +1 -1
  49. package/dist/docs/vscode.html-custom-data.json +1 -1
  50. package/dist/docs/web-types.json +1 -1
  51. package/package.json +5 -5
  52. package/dist/cdn/4LQHU5XS.js +0 -2
  53. package/dist/cdn/5DN7BGGJ.js +0 -2
  54. package/dist/cdn/A72IJUIB.js +0 -2
  55. package/dist/cdn/NCKLLNHD.js +0 -2
  56. package/dist/cdn/WJQZVHBV.js +0 -2
@@ -1,15 +1,15 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as k } from "../../chunks/runtime.js";
2
+ import { c as y } from "../../chunks/runtime.js";
3
3
  import { ref as _ } from "lit/directives/ref.js";
4
- import { css as C, render as w, nothing as P, html as p } from "lit";
5
- import { LitElement as z, nothing as v } from "@arcgis/lumina";
6
- import { useDirection as L } from "@arcgis/lumina/controllers";
7
- import { s as x, a as T, b as $, c as A } from "../../chunks/toolbar.js";
8
- import { AsyncDirective as R } from "lit/async-directive.js";
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 b, setCommittedValue as f } from "lit/directive-helpers.js";
11
- const V = C`:host{--calcite-internal-animation-timing-slow: 0}.toolbar-stack{align-items:stretch;display:flex;max-inline-size:min(100cqw,100vw);max-block-size:min(100cqh,100vh);min-inline-size:0;min-block-size:0;gap:8px}.stack{display:flex}.stack[data-horizontal-position=right]{justify-content:right}.stack[data-horizontal-position=left]{justify-content:left}.line{display:flex;flex:none;gap:8px}:host([layout="vertical"]) .line{flex-direction:column;max-height:min(100cqh - var(--arcgis-internal-attribution-space-top) - 2 * var(--calcite-space-lg),100vh - 2 * var(--calcite-space-lg))}:host([layout="horizontal"]) .line{flex-direction:row}.line[data-alignment=top]{justify-content:flex-start}.line[data-alignment=bottom]{justify-content:flex-end}.line[data-alignment=left]{justify-content:left}.line[data-alignment=right]{justify-content:right}:host([layout="vertical"]) .toolbar-stack{flex-direction:row}:host([layout="horizontal"]) .toolbar-stack{flex-direction:column}:host([toolbar-kind="docked"][layout="horizontal"]) .toolbar-stack{min-inline-size:100%;calcite-action-bar{min-width:auto}}:host([toolbar-kind="docked"][layout="vertical"]) .toolbar-stack{min-block-size:100%;calcite-action-bar{min-height:auto}}:host([toolbar-kind="floating"]) .toolbar-shadow-wrapper{box-shadow:var(--calcite-shadow-md);background-color:var(--calcite-action-bar-background-color, var(--calcite-color-foreground-1));border-radius:var(--calcite-action-bar-corner-radius, var(--calcite-corner-radius-round));min-inline-size:0;min-block-size:0}`;
12
- class j {
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 R {
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, o) {
35
- return [o];
34
+ render(t, e, s) {
35
+ return [s];
36
36
  }
37
- update(t, [e, o, a]) {
38
- this.#t !== e && (this.#t && this.#t.directives.delete(this), e.directives.add(this), this.#t = e), this.#e = t, this.#i = o;
39
- const i = e.cachedParts.get(o), s = i ? u(i).pop() : void 0;
40
- return s && (E(t), b(t, void 0, s), f(t, [s])), this.render(e, o, a);
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 a = u(t).pop();
57
- if (!a)
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 = w(P, c), e.cachedParts.set(this.#i, 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
- f(i, [a]), b(i, void 0, a);
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 q = M(S), O = 8;
76
- class K extends z {
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 = L(), this.#o = new j(), this._layout = "horizontal", this._availableLength = 0, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.listen("arcgisInternalLayoutUpdate", () => this.requestUpdate());
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, x, T, $, A];
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("-"), o = this.#r;
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}-${o === "ltr" ? "right" : "left"}`;
99
+ return `${t}-${s === "ltr" ? "right" : "left"}`;
100
100
  case "start":
101
- return `${t}-${o === "ltr" ? "left" : "right"}`;
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.#a), this.#i.observe(this.el, { childList: !0 }), this._syncToolbars();
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.#a !== t && (this.#a = t, this.isConnected && this._connectMeasurement(t));
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.#a?.getBoundingClientRect();
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(W), e = new AbortController();
129
- this.#t = e, Promise.all(t.map((o) => o.componentOnReady())).then(() => {
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 o = t.map((r) => {
134
+ const s = t.map((r) => {
135
135
  const d = r.allocate(e, this._availableLength);
136
- return { toolbar: r, budget: d.reduce((g, y) => g + y.budget, 0) };
137
- }), a = [];
138
- let i = [], s = 0;
139
- for (const r of o) {
140
- const d = s + (i.length === 0 ? 0 : O) + r.budget;
141
- i.length > 0 && d > this._availableLength ? (a.push(i), i = [r], s = r.budget) : (i.push(r), s = d);
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 && a.push(i);
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") && a.reverse(), (l ? c === "bottom" : h === "right") && a.forEach((r) => r.reverse()), a;
145
+ return (l ? h === "right" : c === "bottom") && o.reverse(), (l ? c === "bottom" : h === "right") && o.forEach((r) => r.reverse()), o;
146
146
  }
147
- #s;
147
+ #a;
148
148
  render() {
149
149
  const t = this._toolbars;
150
150
  if (!t?.length) {
151
- this.#s?.length && (this.#o.moveAllToCache(), this.#s = []);
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
- }, o = this._arrangeToolbarLines(t, e);
160
- U(this.#s, o) || (this.#o.moveAllToCache(), this.#s = o.map((h) => h.map(({ toolbar: l }) => l)));
161
- const [a, i] = e.relativePosition.split("-"), s = this.layout === "vertical" ? a : i, c = this.#o;
162
- return p`<div class="stack" data-horizontal-position=${i ?? v}><div class="ruler" ${_(this._setRulerEl)}></div><div class="toolbar-stack">${o.map((h) => p`<div class="line" data-alignment=${s ?? v}>${h.map(({ toolbar: l, budget: m }) => q(c, l, l.proxiedRender(e, m, this.toolbarKind)))}</div>`)}</div></div>`;
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 W(n) {
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, o) => e.length === n[o].length && e.every(({ toolbar: a }, i) => a === n[o][i]));
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
- k("arcgis-toolbar-stack", K);
172
+ y("arcgis-toolbar-stack", j);
172
173
  export {
173
- K as ArcgisToolbarStack
174
+ j as ArcgisToolbarStack
174
175
  };