@arcgis/common-components 6.0.0-next.4 → 6.0.0-next.40

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 (144) hide show
  1. package/dist/cdn/{B33S3YBM.js → 24FE5GMT.js} +1 -1
  2. package/dist/cdn/2XTXXTEZ.js +2 -0
  3. package/dist/cdn/3QTMLOOM.js +2 -0
  4. package/dist/cdn/4X2SOHYB.js +2 -0
  5. package/dist/cdn/{OTWADB4M.js → 4ZVHN3V7.js} +1 -1
  6. package/dist/cdn/55VDXBLV.js +2 -0
  7. package/dist/cdn/5YQK5TCH.js +2 -0
  8. package/dist/cdn/{EB5MDEWF.js → 7S4ZZPSA.js} +1 -1
  9. package/dist/cdn/7VGSZDT7.js +2 -0
  10. package/dist/cdn/ABDFJWQO.js +2 -0
  11. package/dist/cdn/BAMK6STW.js +2 -0
  12. package/dist/cdn/CC74AHNF.js +2 -0
  13. package/dist/cdn/CCJ7MF3B.js +2 -0
  14. package/dist/cdn/{TO3YFXVJ.js → EYOJNGUG.js} +1 -1
  15. package/dist/cdn/{MFGUTQRR.js → F5IBLVYU.js} +1 -1
  16. package/dist/cdn/HMGFS4YI.js +2 -0
  17. package/dist/cdn/HYR5WUUX.js +2 -0
  18. package/dist/cdn/JAMYEW7N.js +2 -0
  19. package/dist/cdn/JCWKK6FB.js +2 -0
  20. package/dist/cdn/LIFJOO55.js +2 -0
  21. package/dist/cdn/{LNXO5YIS.js → LPKRIISW.js} +1 -1
  22. package/dist/cdn/LRP7XW5X.js +2 -0
  23. package/dist/cdn/{KDCSDIUQ.js → LZPZYGFW.js} +1 -1
  24. package/dist/cdn/{JTQN5KMG.js → MWQVR7SB.js} +1 -1
  25. package/dist/cdn/N5YNSPMD.js +2 -0
  26. package/dist/cdn/NEJQBOXB.js +8207 -0
  27. package/dist/cdn/NSTQTWS5.js +2 -0
  28. package/dist/cdn/ONYZMGVN.js +2 -0
  29. package/dist/cdn/OQRMI3K5.js +2 -0
  30. package/dist/cdn/{34AP2EEB.js → OVW45JGX.js} +1 -1
  31. package/dist/cdn/Q73UFMJY.js +4 -0
  32. package/dist/cdn/{BZFAYVKR.js → RBTFN5SR.js} +1 -1
  33. package/dist/cdn/RU4PILTH.js +2 -0
  34. package/dist/cdn/RU722XDV.js +2 -0
  35. package/dist/cdn/S2EORL4N.js +2 -0
  36. package/dist/cdn/S3GK6UB7.js +2 -0
  37. package/dist/cdn/T7LZIFNY.js +2 -0
  38. package/dist/cdn/TZBDDGN3.js +2 -0
  39. package/dist/cdn/UOXUUCE7.js +3 -0
  40. package/dist/cdn/VLVINHT3.js +2 -0
  41. package/dist/cdn/WDQV5Y4K.js +2 -0
  42. package/dist/cdn/{OMROUY3L.js → X44CHGA6.js} +1 -1
  43. package/dist/cdn/XMMFL5H3.js +2 -0
  44. package/dist/cdn/{IECXEZNI.js → Y72KV72H.js} +1 -1
  45. package/dist/cdn/{D4UHHQ35.js → YOPZGJMF.js} +1 -1
  46. package/dist/cdn/ZJMMAZFG.js +2 -0
  47. package/dist/cdn/assets/layer-replace/t9n/messages.en.json +1 -0
  48. package/dist/cdn/index.js +1 -1
  49. package/dist/cdn/main.css +1 -1
  50. package/dist/chunks/sharedCacheDirective.js +74 -0
  51. package/dist/chunks/utils.js +75 -37
  52. package/dist/chunks/utils2.js +9 -14
  53. package/dist/chunks/well-known-sizes-controller.js +42 -0
  54. package/dist/components/arcgis-ckeditor5/customElement.d.ts +0 -9
  55. package/dist/components/arcgis-ckeditor5/customElement.js +1336 -1339
  56. package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +0 -6
  57. package/dist/components/arcgis-ckeditor5-popover/customElement.js +14 -17
  58. package/dist/components/arcgis-color-input/customElement.d.ts +0 -20
  59. package/dist/components/arcgis-color-input/customElement.js +33 -33
  60. package/dist/components/arcgis-color-input/index.js +2 -1
  61. package/dist/components/arcgis-field-info/customElement.d.ts +0 -3
  62. package/dist/components/arcgis-field-info/customElement.js +41 -41
  63. package/dist/components/arcgis-field-pick-list/customElement.d.ts +0 -28
  64. package/dist/components/arcgis-field-pick-list/customElement.js +114 -127
  65. package/dist/components/arcgis-field-pick-list/index.js +1 -1
  66. package/dist/components/arcgis-html-content/customElement.d.ts +42 -0
  67. package/dist/components/arcgis-html-content/customElement.js +71 -0
  68. package/dist/components/arcgis-html-content/index.d.ts +1 -0
  69. package/dist/components/arcgis-html-content/index.js +1 -0
  70. package/dist/components/arcgis-label-input/customElement.js +1 -1
  71. package/dist/components/arcgis-layer-replace/customElement.d.ts +437 -0
  72. package/dist/components/arcgis-layer-replace/customElement.js +376 -0
  73. package/dist/components/arcgis-layer-replace/index.d.ts +1 -0
  74. package/dist/components/arcgis-layer-replace/index.js +7 -0
  75. package/dist/components/arcgis-slider/customElement.js +546 -451
  76. package/dist/components/arcgis-slider-field/customElement.d.ts +43 -41
  77. package/dist/components/arcgis-slider-field/customElement.js +45 -39
  78. package/dist/components/arcgis-slider-histogram-range/customElement.d.ts +21 -19
  79. package/dist/components/arcgis-slider-histogram-range/customElement.js +28 -22
  80. package/dist/components/arcgis-slider-input/customElement.d.ts +0 -3
  81. package/dist/components/arcgis-slider-input/customElement.js +13 -13
  82. package/dist/components/arcgis-ticks/customElement.js +8 -8
  83. package/dist/components/arcgis-toolbar/customElement.d.ts +25 -2
  84. package/dist/components/arcgis-toolbar/customElement.js +55 -46
  85. package/dist/components/arcgis-toolbar/types.d.ts +21 -1
  86. package/dist/components/arcgis-toolbar-action/customElement.js +17 -18
  87. package/dist/components/arcgis-toolbar-group/customElement.js +20 -17
  88. package/dist/components/arcgis-toolbar-item/customElement.d.ts +2 -2
  89. package/dist/components/arcgis-toolbar-item/customElement.js +14 -14
  90. package/dist/components/arcgis-toolbar-more-button/customElement.js +28 -26
  91. package/dist/components/arcgis-toolbar-split-button/customElement.js +34 -34
  92. package/dist/components/arcgis-toolbar-stack/customElement.d.ts +9 -2
  93. package/dist/components/arcgis-toolbar-stack/customElement.js +63 -125
  94. package/dist/components/arcgis-unique-values-list/customElement.js +11 -11
  95. package/dist/components/arcgis-unique-values-list/index.js +1 -1
  96. package/dist/components/arcgis-value-picker/customElement.js +22 -26
  97. package/dist/components/arcgis-value-picker-combobox/customElement.js +4 -4
  98. package/dist/components/arcgis-value-picker-label/customElement.js +5 -5
  99. package/dist/components/arcgis-value-picker-slider/customElement.d.ts +12 -19
  100. package/dist/components/arcgis-value-picker-slider/customElement.js +17 -17
  101. package/dist/docs/api.json +1 -1
  102. package/dist/docs/docs.json +1 -1
  103. package/dist/docs/vscode.css-custom-data.json +1 -1
  104. package/dist/docs/vscode.html-custom-data.json +1 -1
  105. package/dist/docs/web-types.json +1 -1
  106. package/dist/index.d.ts +15 -20
  107. package/dist/index.js +8 -5
  108. package/dist/loader.js +10 -8
  109. package/dist/types/lumina.d.ts +17 -19
  110. package/dist/types/preact.d.ts +19 -19
  111. package/dist/types/react.d.ts +21 -19
  112. package/dist/types/stencil.d.ts +17 -19
  113. package/dist/utils/sharedCacheDirective.d.ts +68 -0
  114. package/dist/utils/types.d.ts +0 -12
  115. package/package.json +7 -7
  116. package/dist/cdn/32MHBJSZ.js +0 -2
  117. package/dist/cdn/3AFEXHZ5.js +0 -2
  118. package/dist/cdn/5EA7SGHX.js +0 -2
  119. package/dist/cdn/5XRYXPOX.js +0 -2
  120. package/dist/cdn/735FTIBP.js +0 -2
  121. package/dist/cdn/ATLXGXTH.js +0 -2
  122. package/dist/cdn/BCN6LPOG.js +0 -4
  123. package/dist/cdn/CKGWDI7B.js +0 -2
  124. package/dist/cdn/DPJGC3YQ.js +0 -2
  125. package/dist/cdn/DR2THZQU.js +0 -8208
  126. package/dist/cdn/EM4OQXFS.js +0 -2
  127. package/dist/cdn/GDRW3MIZ.js +0 -2
  128. package/dist/cdn/HJ3EJZFF.js +0 -2
  129. package/dist/cdn/HYFFUYAU.js +0 -2
  130. package/dist/cdn/LLATF73T.js +0 -2
  131. package/dist/cdn/M2J3GPM4.js +0 -2
  132. package/dist/cdn/M3SFEFPX.js +0 -2
  133. package/dist/cdn/OIGA7XBZ.js +0 -2
  134. package/dist/cdn/QCUF7B3I.js +0 -2
  135. package/dist/cdn/S4XOD4YS.js +0 -2
  136. package/dist/cdn/TXQKK4DJ.js +0 -2
  137. package/dist/cdn/UIBTY5FF.js +0 -2
  138. package/dist/cdn/X6DNIKWY.js +0 -2
  139. package/dist/cdn/XUPA27AW.js +0 -2
  140. package/dist/cdn/XX2ZCFWI.js +0 -2
  141. package/dist/cdn/YEFEVEP6.js +0 -2
  142. package/dist/cdn/ZCVP2N2O.js +0 -2
  143. package/dist/cdn/ZGYD3GAS.js +0 -2
  144. package/dist/chunks/toolbar.js +0 -9
@@ -15,7 +15,7 @@ const l = {
15
15
  tickLabelFocused: "tick-label--focused",
16
16
  tickLabelText: "tick-label-text",
17
17
  baseline: "baseline"
18
- }, A = C`:host{display:flex;--arcgis-ticks-font-size: var(--calcite-font-size--2);--arcgis-ticks-font-weight: var(--calcite-font-weight-medium);--arcgis-ticks-gap: 1em;--arcgis-ticks-tick-color: var(--calcite-color-border-input);--arcgis-ticks-tick-length: .5rem;--arcgis-ticks-tick-transform: translateX(-50%);--arcgis-ticks-tick-width: .125rem}.container{align-items:stretch;display:flex;color:var(--calcite-color-text-2);flex:1;font-weight:var(--arcgis-ticks-font-weight);font-size:var(--arcgis-ticks-font-size);line-height:1em;position:relative;user-select:none;word-wrap:normal;word-break:normal}.baseline{background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick{position:absolute;background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick-label{position:absolute;text-align:var(--arcgis-ticks-label-text-align, center);width:var(--arcgis-ticks-label-width, var(--labels-container-width, "auto"))}.tick-label-text{display:inline-block;line-height:1}.tick-label--focused .tick-label-text{outline:2px solid var(--calcite-color-focus, var(--calcite-color-brand));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:dir(rtl){.tick-label{direction:rtl}}:host([layout="horizontal"]){.ticks-container{height:var(--arcgis-ticks-tick-length)}.labels-container{height:var(--labels-container-height, "auto")}.tick{width:var(--arcgis-ticks-tick-width);height:var(--arcgis-ticks-tick-length);transform:var(--arcgis-ticks-tick-transform)}.tick-label{transform:translate(-50%)}.tick--min{transform:unset}.tick--max{transform:translate(-100%)}}:host([layout="vertical"]){.ticks-container{width:var(--arcgis-ticks-tick-length)}.labels-container{width:var(--labels-container-width)}.tick{width:var(--arcgis-ticks-tick-length);height:var(--arcgis-ticks-tick-width);transform:translateY(50%)}.tick-label{text-align:right;transform:translateY(50%)}.tick--min{transform:unset}.tick--max{transform:translateY(100%)}}:host([layout="horizontal"][mirrored]){.tick,.tick-label{transform:translate(50%)}.tick--min{transform:unset}.tick--max{transform:translate(100%)}}:host([layout="vertical"][mirrored]){.tick,.tick-label{transform:translateY(-50%)}.tick--min{transform:unset}.tick--max{transform:translateY(-100%)}}:host([layout="horizontal"][label-placement="start"]){.container{flex-direction:column;justify-content:flex-end}.labels-container{margin-bottom:var(--arcgis-ticks-gap)}}:host([layout="horizontal"][label-placement="end"]){.container{flex-direction:column-reverse;justify-content:flex-end}.labels-container{margin-top:var(--arcgis-ticks-gap)}}:host([layout="vertical"][label-placement="start"]){.container{flex-direction:row;justify-content:flex-end}:dir(ltr){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right}}:dir(rtl){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left;unicode-bidi:plaintext}}}:host([layout="vertical"][label-placement="end"]){.container{flex-direction:row-reverse;justify-content:flex-end}:dir(ltr){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left}}:dir(rtl){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right;unicode-bidi:plaintext}}}:host([interactive]){pointer-events:none;.tick,.tick-label{pointer-events:auto;cursor:pointer}.tick-label-text:hover{text-decoration:underline}.tick:focus{background-color:var(--calcite-color-brand);outline:2px solid var(--calcite-color-focus, var(--calcite-color-brand));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}`;
18
+ }, A = C`:host{display:flex;--arcgis-internal-ticks-color: var(--calcite-color-text-2);--arcgis-ticks-font-size: var(--calcite-font-size--2);--arcgis-ticks-font-weight: var(--calcite-font-weight-medium);--arcgis-ticks-gap: 1em;--arcgis-ticks-tick-color: var(--calcite-color-border-input);--arcgis-ticks-tick-length: .5rem;--arcgis-ticks-tick-transform: translateX(-50%);--arcgis-ticks-tick-width: .125rem}.container{align-items:stretch;display:flex;color:var(--arcgis-internal-ticks-color);flex:1;font-weight:var(--arcgis-ticks-font-weight);font-size:var(--arcgis-ticks-font-size);line-height:1em;position:relative;user-select:none;word-wrap:normal;word-break:normal}.baseline{background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick{position:absolute;background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick-label{position:absolute;text-align:var(--arcgis-ticks-label-text-align, center);width:var(--arcgis-ticks-label-width, var(--labels-container-width, "auto"))}.tick-label-text{display:inline-block;line-height:1}.tick-label--focused .tick-label-text{outline:2px solid var(--calcite-color-focus, var(--calcite-color-brand));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:dir(rtl){.tick-label{direction:rtl}}:host([layout="horizontal"]){.ticks-container{height:var(--arcgis-ticks-tick-length)}.labels-container{height:var(--labels-container-height, "auto")}.tick{width:var(--arcgis-ticks-tick-width);height:var(--arcgis-ticks-tick-length);transform:var(--arcgis-ticks-tick-transform)}.tick-label{transform:translate(-50%)}.tick--min{transform:unset}.tick--max{transform:translate(-100%)}}:host([layout="vertical"]){.ticks-container{width:var(--arcgis-ticks-tick-length)}.labels-container{width:var(--labels-container-width)}.tick{width:var(--arcgis-ticks-tick-length);height:var(--arcgis-ticks-tick-width);transform:translateY(50%)}.tick-label{text-align:right;transform:translateY(50%)}.tick--min{transform:unset}.tick--max{transform:translateY(100%)}}:host([layout="horizontal"][mirrored]){.tick,.tick-label{transform:translate(50%)}.tick--min{transform:unset}.tick--max{transform:translate(100%)}}:host([layout="vertical"][mirrored]){.tick,.tick-label{transform:translateY(-50%)}.tick--min{transform:unset}.tick--max{transform:translateY(-100%)}}:host([layout="horizontal"][label-placement="start"]){.container{flex-direction:column;justify-content:flex-end}.labels-container{margin-bottom:var(--arcgis-ticks-gap)}}:host([layout="horizontal"][label-placement="end"]){.container{flex-direction:column-reverse;justify-content:flex-end}.labels-container{margin-top:var(--arcgis-ticks-gap)}}:host([layout="vertical"][label-placement="start"]){.container{flex-direction:row;justify-content:flex-end}:dir(ltr){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right}}:dir(rtl){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left;unicode-bidi:plaintext}}}:host([layout="vertical"][label-placement="end"]){.container{flex-direction:row-reverse;justify-content:flex-end}:dir(ltr){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left}}:dir(rtl){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right;unicode-bidi:plaintext}}}:host([interactive]){pointer-events:none;.tick,.tick-label{pointer-events:auto;cursor:pointer}.tick-label-text:hover{text-decoration:underline}.tick:focus{background-color:var(--calcite-color-brand);outline:2px solid var(--calcite-color-focus, var(--calcite-color-brand));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}`;
19
19
  class D extends F {
20
20
  constructor() {
21
21
  super(...arguments), this._messages = T({ name: null }), this.#t = (t) => z(this._messages._lang, this._formatOptions).format(t), this._activeTick = null, this._formatOptions = {
@@ -85,14 +85,14 @@ class D extends F {
85
85
  return h`<div class=${o(l.container)} touch-action=none>${this._renderContent()}${this._renderBaseline()}</div>`;
86
86
  }
87
87
  _renderContent() {
88
- const { interpolationExponent: t, max: e, min: i, mode: a, values: r, layout: n, mirrored: c, showLabels: w, interactive: k } = this, g = [], v = [];
88
+ const { interpolationExponent: t, max: e, min: i, mode: a, values: r, layout: n, mirrored: c, showLabels: w, interactive: k } = this, b = [], v = [];
89
89
  for (const [f, d] of P(a, i, e, t, r)) {
90
90
  const p = { [n === "horizontal" ? c ? "right" : "left" : c ? "top" : "bottom"]: `${f}%` }, $ = {
91
91
  [l.tick]: !0,
92
92
  [l.tickMin]: f === 0,
93
93
  [l.tickMax]: f === 100
94
94
  };
95
- if (g.push(h`<div class=${o($)} .role=${k ? "button" : void 0} .ariaLabel=${k ? this._internalLabelFormatter(d) : void 0} style=${m(p)} data-value=${d ?? y} .tabIndex=${k ? 0 : -1} @blur=${this._handleBlur} @click=${this._handleClick} @focus=${this._handleFocus} @keydown=${this._handleKeyDown} @mousedown=${this._handleMouseDown}></div>`), w) {
95
+ if (b.push(h`<div class=${o($)} .role=${k ? "button" : void 0} .ariaLabel=${k ? this._internalLabelFormatter(d) : void 0} style=${m(p)} data-value=${d ?? y} .tabIndex=${k ? 0 : -1} @blur=${this._handleBlur} @click=${this._handleClick} @focus=${this._handleFocus} @keydown=${this._handleKeyDown} @mousedown=${this._handleMouseDown}></div>`), w) {
96
96
  const _ = {
97
97
  [l.tickLabel]: !0,
98
98
  [l.tickLabelFocused]: this._activeTick === String(d)
@@ -100,7 +100,7 @@ class D extends F {
100
100
  v.push(h`<div class=${o(_)} style=${m(p)} data-value=${d ?? y} @click=${this._handleClick}><span class=${o(l.tickLabelText)}>${this._internalLabelFormatter(d)}</span></div>`);
101
101
  }
102
102
  }
103
- return [h`<div class=${o(l.labelsContainer)}>${v}</div>`, h`<div class=${o(l.ticksContainer)}>${g}</div>`];
103
+ return [h`<div class=${o(l.labelsContainer)}>${v}</div>`, h`<div class=${o(l.ticksContainer)}>${b}</div>`];
104
104
  }
105
105
  _renderBaseline() {
106
106
  const { showBaseline: t, layout: e } = this;
@@ -142,7 +142,7 @@ function* P(s, t, e, i, a) {
142
142
  }
143
143
  }
144
144
  }
145
- function b(s, t, e) {
145
+ function g(s, t, e) {
146
146
  return e < s ? s : e > t ? t : e;
147
147
  }
148
148
  function x(s, t, e) {
@@ -150,13 +150,13 @@ function x(s, t, e) {
150
150
  }
151
151
  function B(s, t, e, i = 0) {
152
152
  let a = (e - s) / (t - s);
153
- if (a = b(0, 1, a), Math.abs(i) < 1e-9)
153
+ if (a = g(0, 1, a), Math.abs(i) < 1e-9)
154
154
  return a;
155
155
  const r = 1 + Math.expm1(i) * a;
156
- return a = Math.log(r) / i, b(0, 1, a);
156
+ return a = Math.log(r) / i, g(0, 1, a);
157
157
  }
158
158
  function u(s, t, e, i = 0) {
159
- if (e = b(0, 1, e), Math.abs(i) < 1e-9)
159
+ if (e = g(0, 1, e), Math.abs(i) < 1e-9)
160
160
  return x(s, t, e);
161
161
  const a = Math.expm1(i * e) / Math.expm1(i);
162
162
  return x(s, t, a);
@@ -13,6 +13,14 @@ import type { ActionBar as ActionBar } from "@esri/calcite-components/components
13
13
  * @internal
14
14
  */
15
15
  export abstract class ArcgisToolbar extends LitElement {
16
+ /**
17
+ * Main-axis budget in pixels. Undefined (the default) enables intrinsic sizing:
18
+ * CSS determines the host's size, and its observed content box supplies the budget.
19
+ * Specifying a value, including zero, disables intrinsic sizing and directly controls
20
+ * the budget used to collapse groups. CSS can still constrain the host.
21
+ * When managed by a stack, the stack owns sizing and allocation instead.
22
+ */
23
+ accessor allocatedLength: number | undefined;
16
24
  get barElement(): ActionBar | undefined;
17
25
  /** Toolbar orientation. */
18
26
  accessor layout: "horizontal" | "vertical";
@@ -58,10 +66,25 @@ export abstract class ArcgisToolbar extends LitElement {
58
66
  */
59
67
  measure(context: MeasurementContext): number[];
60
68
  /**
69
+ * Intrinsic sizing needs only the collapsed and fully allocated lengths, not
70
+ * every combination of intermediate group lengths. Use allocation for both
71
+ * endpoints so forced-collapse priorities follow the same rules as rendering.
72
+ *
61
73
  * @param context
62
- * @param budget
74
+ * @internal
75
+ */
76
+ measureIntrinsicSize(context: MeasurementContext): {
77
+ minimum: number;
78
+ maximum: number;
79
+ };
80
+ /**
81
+ * Render method used when the toolbar is managed by a toolbar stack.
82
+ *
83
+ * @param context - Budget, which is used to determine which groups are expanded/collapsed.
84
+ * @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
85
  * @param toolbarKind
86
+ * @param availableLength
64
87
  * @internal
65
88
  */
66
- proxiedRender(context: RenderContext, budget: number, toolbarKind?: "docked" | "floating"): JsxNode;
89
+ proxiedRender(context: RenderContext, allocatedLength: number, toolbarKind?: "docked" | "floating", availableLength?: number): JsxNode;
67
90
  }
@@ -1,108 +1,117 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import { c as d } from "../../chunks/runtime.js";
3
- import { ref as l } from "lit/directives/ref.js";
4
- import { html as c } from "lit";
5
- import { keyed as u } from "lit/directives/keyed.js";
6
- import { LitElement as p, createEvent as g } from "@arcgis/lumina";
7
- import { useDirection as m } from "@arcgis/lumina/controllers";
8
- import { s as f, a as b, b as _, c as v } from "../../chunks/toolbar.js";
9
- import { a as o } from "../../chunks/utils.js";
10
- import { i as y } from "../../chunks/types.js";
11
- class R extends p {
2
+ import { c as g } from "../../chunks/runtime.js";
3
+ import { ref as m } from "lit/directives/ref.js";
4
+ import { html as d } from "lit";
5
+ import { keyed as b } from "lit/directives/keyed.js";
6
+ import { LitElement as f, createEvent as v, safeStyleMap as c } from "@arcgis/lumina";
7
+ import { useDirection as y } from "@arcgis/lumina/controllers";
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
+ import { a as l } from "../../chunks/utils.js";
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.#r = new MutationObserver(() => this._syncGroups()), this.#i = m(), 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
  }));
17
- }, this._availableLength = 0, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.arcgisInternalLayoutUpdate = g(), this.listen("arcgisInternalLayoutUpdate", (t) => {
17
+ }, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.arcgisInternalLayoutUpdate = v(), 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
  }
21
21
  static {
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 };
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 = [f, b, _, v];
25
+ this.styles = [$, R, z, B];
26
26
  }
27
27
  #t;
28
+ #e;
29
+ #i;
28
30
  #r;
29
31
  #s;
30
- #i;
31
- #e;
32
+ get _availableLength() {
33
+ return this.allocatedLength ?? (this.layout === "horizontal" ? this._observedSize?.width : this._observedSize?.height) ?? 0;
34
+ }
32
35
  get layout() {
33
36
  return this._layout;
34
37
  }
35
38
  set layout(t) {
36
- t !== this._layout && (this._layout = t, this._updateMeasurement());
39
+ t !== this._layout && (this._layout = t);
37
40
  }
38
41
  get barElement() {
39
42
  return this._hydratedRenderedBar;
40
43
  }
41
44
  get effectiveRelativeDirection() {
42
- const [t, e] = this.relativePosition.split("-"), r = this.#i;
45
+ const [t, e] = this.relativePosition.split("-"), i = this.#r;
43
46
  switch (e) {
44
47
  case "left":
45
48
  case "right":
46
49
  return `${t}-${e}`;
47
50
  case "end":
48
- return `${t}-${r === "ltr" ? "right" : "left"}`;
51
+ return `${t}-${i === "ltr" ? "right" : "left"}`;
49
52
  case "start":
50
- return `${t}-${r === "ltr" ? "left" : "right"}`;
53
+ return `${t}-${i === "ltr" ? "left" : "right"}`;
51
54
  }
52
55
  }
53
56
  measure(t) {
54
57
  const e = this._groups;
55
58
  if (!e?.length)
56
59
  return [0];
57
- const n = e.map((s) => s.measure(t)).reduce((s, i) => s.flatMap((a) => i.map((h) => a + h)), [0]).map((s) => o(e, t, s).reduce((i, { budget: a }) => i + a, 0));
58
- return Array.from(new Set(n)).sort((s, i) => s - i);
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);
62
+ }
63
+ measureIntrinsicSize(t) {
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) };
59
66
  }
60
67
  allocate(t, e) {
61
- const r = this._groups;
62
- return r?.length ? o(r, t, e) : [];
68
+ const i = this._groups;
69
+ return i?.length ? l(i, t, e) : [];
63
70
  }
64
- proxiedRender(t, e, r = this.toolbarKind) {
71
+ proxiedRender(t, e, i = this.toolbarKind, o = e) {
65
72
  if (!this._groups?.length)
66
73
  return;
67
- const s = this.allocate(t, e);
68
- return u(this, c`<div class="toolbar-grid-wrapper"><div class="toolbar-shadow-wrapper"><calcite-action-bar expand-toggle-disabled .floating=${r === "floating"} .layout=${t.layout} overflow-mode=none .scale=${t.scale} ${l(this._setRenderedBar)}>${s.map(({ group: i, budget: a }) => i.proxiedRender(t, a))}</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>`);
69
76
  }
70
77
  connectedCallback() {
71
- super.connectedCallback(), this._connectMeasurement(this.#e), this.#r.observe(this.el, { childList: !0 }), this._syncGroups();
78
+ super.connectedCallback(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && this.#t.observe(this.el), this.#e.observe(this.el, { childList: !0 }), this._syncGroups();
72
79
  }
73
80
  disconnectedCallback() {
74
- this.#t.disconnect(), this.#r.disconnect(), super.disconnectedCallback();
75
- }
76
- _setRulerEl(t) {
77
- this.#e !== t && (this.#e = t, this.isConnected && this._connectMeasurement(t));
78
- }
79
- _connectMeasurement(t) {
80
- this.#t.disconnect(), t && (this.#t.observe(t), this._updateMeasurement());
81
+ this.#t.disconnect(), this.#e.disconnect(), super.disconnectedCallback();
81
82
  }
82
83
  _updateMeasurement(t) {
83
- const e = t?.at(0)?.contentRect ?? this.#e?.getBoundingClientRect();
84
- e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
84
+ this._observedSize = t?.at(0)?.contentRect;
85
85
  }
86
86
  _syncGroups() {
87
- this.#s?.abort();
88
- const t = Array.from(this.el.children).filter(y), e = new AbortController();
89
- this.#s = 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(() => {
90
90
  !this.isConnected || e.signal.aborted || (this._groups = t, this.arcgisInternalLayoutUpdate.emit());
91
91
  });
92
92
  }
93
93
  render() {
94
94
  if (!this._groups?.length || this.el.parentElement?.localName === "arcgis-toolbar-stack")
95
95
  return;
96
- const e = {
96
+ const e = this.#s.exports;
97
+ if (!e)
98
+ return;
99
+ const i = {
100
+ sizes: e,
97
101
  layout: this.layout,
98
102
  relativePosition: this.effectiveRelativeDirection,
99
103
  scale: this.scale,
100
- tooltipAppearance: this.tooltipAppearance
101
- }, [{ budget: r }] = o([this], e, this._availableLength);
102
- return c`<div class="ruler" ${l(this._setRulerEl)}></div>${this.proxiedRender(e, r)}`;
104
+ tooltipAppearance: this.tooltipAppearance,
105
+ toolbarKind: this.toolbarKind
106
+ }, o = this.allocate(i, this._availableLength).reduce((r, { budget: s }) => r + s, 0);
107
+ if (this.allocatedLength === void 0) {
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>`;
110
+ }
111
+ return this.proxiedRender(i, o, this.toolbarKind, this._availableLength);
103
112
  }
104
113
  }
105
- d("arcgis-toolbar", R);
114
+ g("arcgis-toolbar", C);
106
115
  export {
107
- R as ArcgisToolbar
116
+ C as ArcgisToolbar
108
117
  };
@@ -15,14 +15,22 @@ 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
23
30
  & {
24
31
  relativePosition: "bottom-left" | "bottom-right" | "top-left" | "top-right";
25
32
  tooltipAppearance: "calcite-dark" | "calcite" | "native";
33
+ toolbarKind: "docked" | "floating";
26
34
  };
27
35
 
28
36
  /**
@@ -38,4 +46,16 @@ export interface RenderableToolbarContent {
38
46
  proxiedRender: (context: RenderContext, budget: number) => JsxNode;
39
47
  priority?: number;
40
48
  componentOnReady: () => Promise<unknown>;
41
- }
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 C 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 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], n = r.map((t) => t.measure(e)).reduce((t, s) => t.flatMap((a) => s.map((c) => a + c)), [0]);
22
- return f(n.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 ? "actions-end" : void 0, n = r - i.groupPadding[e.scale] - i.groupSeparator, t = m(o, e, n);
29
- return p`<calcite-action-group .scale=${e.scale} .layout=${e.layout} slot=${l ?? h}>${t.map(({ group: s, budget: a }) => s.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", C);
48
+ c("arcgis-toolbar-group", f);
46
49
  export {
47
- C 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} @click=${(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
  };