@arcgis/common-components 5.2.0-next.105 → 5.2.0-next.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{IXISGCNR.js → 2JQ6OEBP.js} +2 -2
- package/dist/cdn/{JLF6J4PV.js → 2ZQLPGO6.js} +2 -2
- package/dist/cdn/{BQCBHDME.js → 34O5NI3L.js} +2 -2
- package/dist/cdn/{VL3L3YNC.js → 3KVQXK6I.js} +2 -2
- package/dist/cdn/{H4B7RWSC.js → 3KZKOKL3.js} +2 -2
- package/dist/cdn/{27EUJ42B.js → 3YTGG7RF.js} +2 -2
- package/dist/cdn/{M7RV4JOU.js → 44GHRHDT.js} +2 -2
- package/dist/cdn/46YOWKVP.js +2 -0
- package/dist/cdn/4Z3W4SLN.js +2 -0
- package/dist/cdn/5I46DP72.js +2 -0
- package/dist/cdn/{SWYNNHSD.js → 6G2BA5R6.js} +2 -2
- package/dist/cdn/{CEXP5DLE.js → 73LCJZI5.js} +2 -2
- package/dist/cdn/{Y5Y7IXOV.js → 74MDECVO.js} +1 -1
- package/dist/cdn/AHWD5KV4.js +2 -0
- package/dist/cdn/B2QFPLR5.js +2 -0
- package/dist/cdn/{WJZHHIWO.js → DLOQSM4T.js} +2 -2
- package/dist/cdn/{ZQJCCG4K.js → E4CBJIXT.js} +2 -2
- package/dist/cdn/{XEK22IDA.js → E4NVOXNZ.js} +1 -1
- package/dist/cdn/EWHSIDUL.js +2 -0
- package/dist/cdn/{AY6QNI6M.js → FH6M3L5Q.js} +2 -2
- package/dist/cdn/FMIYRWWD.js +2 -0
- package/dist/cdn/{RYAF2CEQ.js → G2DVIZZJ.js} +2 -2
- package/dist/cdn/GB5FMYCZ.js +2 -0
- package/dist/cdn/GPRF6QZC.js +2 -0
- package/dist/cdn/{MYCSWWIQ.js → GQBGVIQF.js} +2 -2
- package/dist/cdn/{7VETJO2V.js → GQCIBJZF.js} +2 -2
- package/dist/cdn/{7XSCHHGO.js → IBJHDNP3.js} +2 -2
- package/dist/cdn/{3TIDAJES.js → ISCASG7C.js} +2 -2
- package/dist/cdn/{4TZVXSQZ.js → LE43VGSR.js} +2 -2
- package/dist/cdn/LRG23IGC.js +2 -0
- package/dist/cdn/{PMV2N3L3.js → NMDESY3T.js} +1 -1
- package/dist/cdn/O2DY73RF.js +2 -0
- package/dist/cdn/OHMQBUUM.js +2 -0
- package/dist/cdn/{FRL73WUI.js → OVOUEXKG.js} +2 -2
- package/dist/cdn/{Z5QBBHLD.js → P3DCEHGK.js} +1 -1
- package/dist/cdn/{7CY3QEZW.js → QH4CFJEJ.js} +2 -2
- package/dist/cdn/{TWW63D32.js → QJJFF4PI.js} +1 -1
- package/dist/cdn/{U4P7UKY3.js → QKRBQ2F5.js} +2 -2
- package/dist/cdn/RT25KW2T.js +2 -0
- package/dist/cdn/RZEJ56RX.js +2 -0
- package/dist/cdn/S3XLEJSQ.js +2 -0
- package/dist/cdn/SBVCJDLD.js +2 -0
- package/dist/cdn/{FQRP2RUU.js → UIHTW6OA.js} +2 -2
- package/dist/cdn/UIKQQY3N.js +2 -0
- package/dist/cdn/{LLKF5IUE.js → UWHPPNTE.js} +2 -2
- package/dist/cdn/VIBCKXUC.js +2 -0
- package/dist/cdn/{4DL4CQMD.js → WUGJFP7P.js} +2 -2
- package/dist/cdn/{UGWLCTVM.js → YJTI6KPW.js} +1 -1
- package/dist/cdn/index.js +2 -2
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/element-reference-controller.js +8 -6
- package/dist/chunks/general.js +1 -1
- package/dist/chunks/internal-types.js +1 -1
- package/dist/chunks/layer-utils.js +1 -1
- package/dist/chunks/locale.js +1 -1
- package/dist/chunks/resources.js +1 -1
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/strategies.js +1 -1
- package/dist/chunks/toolbar.js +9 -0
- package/dist/chunks/types.js +16 -0
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utils.js +18 -28
- package/dist/chunks/utils2.js +1 -1
- package/dist/chunks/utils3.js +4 -4
- package/dist/components/arcgis-ckeditor5/customElement.js +1 -1
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
- package/dist/components/arcgis-color-input/customElement.js +1 -1
- package/dist/components/arcgis-coordinate-system-picker/customElement.js +1 -1
- package/dist/components/arcgis-coordinate-system-picker-tree/customElement.js +1 -1
- package/dist/components/arcgis-field-info/customElement.d.ts +1 -1
- package/dist/components/arcgis-field-info/customElement.js +73 -80
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +7 -7
- package/dist/components/arcgis-field-pick-list/customElement.js +49 -45
- package/dist/components/arcgis-histogram/customElement.js +1 -1
- package/dist/components/arcgis-label-input/customElement.js +19 -15
- package/dist/components/arcgis-picker-input/customElement.js +1 -1
- package/dist/components/arcgis-ramp-color/customElement.js +1 -1
- package/dist/components/arcgis-ramp-color-break/customElement.js +1 -1
- package/dist/components/arcgis-ramp-opacity/customElement.js +1 -1
- package/dist/components/arcgis-slider/customElement.js +1 -1
- package/dist/components/arcgis-slider-field/customElement.js +1 -1
- package/dist/components/arcgis-slider-histogram-range/customElement.js +1 -1
- package/dist/components/arcgis-slider-input/customElement.js +1 -1
- package/dist/components/arcgis-ticks/customElement.js +1 -1
- package/dist/components/arcgis-toolbar/customElement.d.ts +26 -6
- package/dist/components/arcgis-toolbar/customElement.js +61 -35
- package/dist/components/arcgis-toolbar/types.d.ts +32 -1
- package/dist/components/arcgis-toolbar-action/customElement.d.ts +1 -1
- package/dist/components/arcgis-toolbar-action/customElement.js +17 -22
- package/dist/components/arcgis-toolbar-group/customElement.js +18 -17
- package/dist/components/arcgis-toolbar-item/customElement.d.ts +1 -1
- package/dist/components/arcgis-toolbar-item/customElement.js +7 -7
- package/dist/components/arcgis-toolbar-more-button/customElement.js +8 -8
- package/dist/components/arcgis-toolbar-split-button/customElement.js +16 -15
- package/dist/components/arcgis-toolbar-stack/customElement.d.ts +48 -0
- package/dist/components/arcgis-toolbar-stack/customElement.js +174 -0
- package/dist/components/arcgis-toolbar-stack/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-stack/index.js +1 -0
- package/dist/components/arcgis-unique-values-list/customElement.js +3 -3
- package/dist/components/arcgis-value-picker/customElement.js +1 -1
- package/dist/components/arcgis-value-picker-collection/customElement.js +1 -1
- package/dist/components/arcgis-value-picker-combobox/customElement.js +1 -1
- package/dist/components/arcgis-value-picker-label/customElement.js +1 -1
- package/dist/components/arcgis-value-picker-slider/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -1
- package/dist/loader.js +3 -2
- package/dist/types/lumina.d.ts +5 -0
- package/dist/types/preact.d.ts +6 -0
- package/dist/types/react.d.ts +7 -0
- package/dist/types/stencil.d.ts +5 -0
- package/package.json +4 -4
- package/dist/cdn/4O3NDSCB.js +0 -2
- package/dist/cdn/76AEYDPR.js +0 -2
- package/dist/cdn/BOMP3AYJ.js +0 -2
- package/dist/cdn/EESAFFL6.js +0 -2
- package/dist/cdn/EO2W4XX2.js +0 -2
- package/dist/cdn/EQ7Q27AM.js +0 -2
- package/dist/cdn/F55DGSXH.js +0 -2
- package/dist/cdn/FQKMFVEL.js +0 -2
- package/dist/cdn/JH47GD45.js +0 -2
- package/dist/cdn/NANUDTUO.js +0 -2
- package/dist/cdn/NUJU53OQ.js +0 -2
- package/dist/cdn/Q7X4435G.js +0 -2
- package/dist/cdn/SM5735TW.js +0 -2
- package/dist/cdn/VCZLD7ZT.js +0 -2
- package/dist/cdn/VOBBBIYC.js +0 -2
- package/dist/cdn/XWGTFIHC.js +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as b } from "../../chunks/runtime.js";
|
|
3
3
|
import { keyed as v } from "lit/directives/keyed.js";
|
|
4
4
|
import { repeat as y } from "lit/directives/repeat.js";
|
|
5
5
|
import { LitElement as I, createEvent as h, renderElement as S, nothing as m, safeStyleMap as $, safeClassMap as L } from "@arcgis/lumina";
|
|
6
6
|
import { createRef as p, ref as d } from "lit/directives/ref.js";
|
|
7
|
-
import { html as
|
|
7
|
+
import { html as n, css as x } from "lit";
|
|
8
8
|
import { Task as T } from "@lit/task";
|
|
9
9
|
import { log as w, composeMissingPropertyMessage as k } from "@arcgis/toolkit/log";
|
|
10
10
|
import { F as C } from "../../chunks/internal-types.js";
|
|
@@ -27,37 +27,37 @@ r.set("date-only", "calendar");
|
|
|
27
27
|
r.set("time-only", "clock");
|
|
28
28
|
r.set("timestamp-offset", "time-zone");
|
|
29
29
|
r.set("string", "string");
|
|
30
|
-
const N = ({ fieldType:
|
|
31
|
-
function P(
|
|
32
|
-
return !!
|
|
30
|
+
const N = ({ fieldType: o }) => n`<calcite-icon scale=s .icon=${r.get(o)}></calcite-icon>`;
|
|
31
|
+
function P(o) {
|
|
32
|
+
return !!o.length && "fields" in o[0];
|
|
33
33
|
}
|
|
34
|
-
function u(
|
|
35
|
-
return !!
|
|
34
|
+
function u(o) {
|
|
35
|
+
return !!o.length && "subFieldInfos" in o[0];
|
|
36
36
|
}
|
|
37
|
-
function _(
|
|
38
|
-
return
|
|
37
|
+
function _(o) {
|
|
38
|
+
return o.filter((e) => u(e.fields));
|
|
39
39
|
}
|
|
40
|
-
function D(
|
|
41
|
-
return
|
|
40
|
+
function D(o) {
|
|
41
|
+
return o.flatMap((e) => e.fields);
|
|
42
42
|
}
|
|
43
|
-
function O(
|
|
44
|
-
return
|
|
43
|
+
function O(o) {
|
|
44
|
+
return o.flatMap((e) => u(e.fields) ? [] : e.fields);
|
|
45
45
|
}
|
|
46
|
-
function f(
|
|
47
|
-
return
|
|
46
|
+
function f(o) {
|
|
47
|
+
return o.flatMap(
|
|
48
48
|
(e) => u(e.fields) ? e.fields.flatMap((t) => t.subFieldInfos) : e.fields
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
function A(
|
|
52
|
-
return
|
|
51
|
+
function A(o, e) {
|
|
52
|
+
return o.flatMap((t) => u(t.fields) ? t.fields.flatMap(
|
|
53
53
|
(i) => i.subFieldInfos.filter((s) => g(s, e, !0))
|
|
54
54
|
) : t.fields.filter((i) => F(i, e)));
|
|
55
55
|
}
|
|
56
|
-
function F(
|
|
57
|
-
return e ? "subFieldInfos" in
|
|
56
|
+
function F(o, e) {
|
|
57
|
+
return e ? "subFieldInfos" in o ? g(o, e) || o.subFieldInfos.some((t) => g(t, e, !0)) : g(o, e) : !0;
|
|
58
58
|
}
|
|
59
|
-
function g(
|
|
60
|
-
return [t ?
|
|
59
|
+
function g(o, e, t = !1) {
|
|
60
|
+
return [t ? o.name.split("/").pop() : o.name, o.alias, o.description].some(
|
|
61
61
|
(s) => s?.toLocaleLowerCase().includes(e.toLocaleLowerCase())
|
|
62
62
|
);
|
|
63
63
|
}
|
|
@@ -181,22 +181,26 @@ class H extends I {
|
|
|
181
181
|
})) : this.getSortedList(e);
|
|
182
182
|
}
|
|
183
183
|
addFieldInfoFlowItem(e, t) {
|
|
184
|
-
const i = this.flowElement.value, s = S(
|
|
184
|
+
const i = this.flowElement.value, s = S(n`<calcite-flow-item selected .heading=${e.alias ?? e.name} .description=${e.name} class="panel" style=${$(this.panelCutOffHeight > 0 ? `max-height: ${this.panelCutOffHeight}px` : "max-height: 50vh")} @calciteFlowItemBack=${(l) => {
|
|
185
185
|
l.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
186
186
|
t.setFocus();
|
|
187
187
|
}, 300);
|
|
188
188
|
}} ${d(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang ?? m} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);
|
|
189
|
-
i.appendChild(s), this.panelElement.value.selected = !1, setTimeout(() =>
|
|
189
|
+
i.appendChild(s), this.panelElement.value.selected = !1, setTimeout(() => {
|
|
190
|
+
this.fieldInfoFlowItemEl?.value.setFocus();
|
|
191
|
+
}, 1);
|
|
190
192
|
}
|
|
191
193
|
addSubFieldInfoFlowItem(e, t) {
|
|
192
|
-
const i = this.flowElement.value, s = e.subFieldInfos.filter((a) => g(a, this.filterText, !0)), l = S(
|
|
194
|
+
const i = this.flowElement.value, s = e.subFieldInfos.filter((a) => g(a, this.filterText, !0)), l = S(n`<calcite-flow-item selected .heading=${e.alias ?? e.name} .description=${e.description ?? void 0} class="panel" style=${$(this.panelCutOffHeight > 0 ? `max-height: ${this.panelCutOffHeight}px` : "max-height: 50vh")} @calciteFlowItemBack=${(a) => {
|
|
193
195
|
a.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
194
196
|
t.setFocus();
|
|
195
197
|
}, 300);
|
|
196
198
|
}} ${d(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias ?? e.name} .selectionMode=${this.multiple ? "multiple" : "single"} @calciteListChange=${(a) => {
|
|
197
199
|
this.updateSelectedFieldsForList(a.currentTarget, e.subFieldInfos), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields }), this.multiple || (this.arcgisClose.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields }));
|
|
198
|
-
}}>${s.map((a) => this.renderCalciteListItem(a, !1))}</calcite-list>${this.filterText && !s.length && this.filterNoResultsText?.length !== 0 ?
|
|
199
|
-
i.appendChild(l), this.panelElement.value.selected = !1, setTimeout(() =>
|
|
200
|
+
}}>${s.map((a) => this.renderCalciteListItem(a, !1))}</calcite-list>${this.filterText && !s.length && this.filterNoResultsText?.length !== 0 ? n`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}</calcite-flow-item>`);
|
|
201
|
+
i.appendChild(l), this.panelElement.value.selected = !1, setTimeout(() => {
|
|
202
|
+
this.fieldInfoFlowItemEl.value?.setFocus();
|
|
203
|
+
}, 1);
|
|
200
204
|
}
|
|
201
205
|
shouldRenderSelectionButton(e) {
|
|
202
206
|
return this.multiple && this.showSelectionAll && (!e || !this.filterText || !!this.filterFields?.length);
|
|
@@ -227,42 +231,42 @@ class H extends I {
|
|
|
227
231
|
if (this.listOnly)
|
|
228
232
|
return this.renderList();
|
|
229
233
|
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.popoverProps;
|
|
230
|
-
return this.el.classList.add("js-app-flyout"), v(`${t.autoClose}`,
|
|
234
|
+
return this.el.classList.add("js-app-flyout"), v(`${t.autoClose}`, n`<calcite-popover .placement=${t.placement ?? "leading-start"} open pointer-disabled .referenceElement=${t.refElement} .offsetDistance=${t.offsetDistance ?? -Math.round(t.refElement.getBoundingClientRect().width)} .offsetSkidding=${t.offsetSkidding ?? 0} .overlayPositioning=${t.overlayPositioning} trigger-disabled .autoClose=${t.autoClose} .label=${this.heading ?? (this.multiple ? this._messages.headerSelect : this._messages.header) ?? ""} @calcitePopoverClose=${() => {
|
|
231
235
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
232
236
|
}} ${d(this.popoverNode)}><calcite-flow style=${$({
|
|
233
237
|
width: `${t.popoverWidth ?? t.refElement.getBoundingClientRect().width}px`,
|
|
234
238
|
...t.maxHeight && { maxHeight: t.maxHeight }
|
|
235
239
|
})} ${d(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${() => {
|
|
236
240
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
237
|
-
}} ${d(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple || !this.hideCancel) &&
|
|
241
|
+
}} ${d(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple || !this.hideCancel) && n`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple && !this.hideCancel ? n`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>` : n`${this.renderAddButton()}${this.renderCancelButton()}`}</div>` || ""}</calcite-flow-item></calcite-flow></calcite-popover>`);
|
|
238
242
|
},
|
|
239
243
|
error: () => ""
|
|
240
244
|
});
|
|
241
245
|
}
|
|
242
246
|
renderList() {
|
|
243
247
|
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = O(this.allLists), i = _(this.allLists), s = f(this.allLists).length >= this.showFilterLength;
|
|
244
|
-
return t.length || i.length ? i.length ? this.renderSplitLists(t, i, s) : this.renderTopLevelOnlyFieldList(e, t, s) :
|
|
248
|
+
return t.length || i.length ? i.length ? this.renderSplitLists(t, i, s) : this.renderTopLevelOnlyFieldList(e, t, s) : n`<slot name=no-fields></slot>`;
|
|
245
249
|
}
|
|
246
250
|
renderSplitLists(e, t, i) {
|
|
247
251
|
const s = f(this.allLists), l = D(this.allLists).some((a) => F(a, this.filterText));
|
|
248
|
-
return
|
|
252
|
+
return n`${i ? n`<div class="list-controls"><calcite-filter .items=${s} .filterProps=${["name", "alias", "description"]} .placeholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteFilterChange=${(a) => {
|
|
249
253
|
this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? A(this.allLists, this.filterText).map((c) => c.name) : void 0;
|
|
250
|
-
}}></calcite-filter>${this.renderSortButton()}</div>` : null}<div class=${L(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(i) ? this.renderSelectionButton() : null}${this.renderSplitSubFieldLists(t)}${e.length ? this.renderSplitTopLevelFieldList(e, !0) : null}</div>${this.filterText && !l && this.filterNoResultsText?.length !== 0 ?
|
|
254
|
+
}}></calcite-filter>${this.renderSortButton()}</div>` : null}<div class=${L(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(i) ? this.renderSelectionButton() : null}${this.renderSplitSubFieldLists(t)}${e.length ? this.renderSplitTopLevelFieldList(e, !0) : null}</div>${this.filterText && !l && this.filterNoResultsText?.length !== 0 ? n`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
|
|
251
255
|
}
|
|
252
256
|
renderSplitSubFieldLists(e) {
|
|
253
257
|
const t = e.map((i) => ({
|
|
254
258
|
...i,
|
|
255
259
|
fields: i.fields.filter((s) => F(s, this.filterText))
|
|
256
260
|
})).filter((i) => !!i.fields.length);
|
|
257
|
-
return y(t, (i) => i.title, (i) =>
|
|
261
|
+
return y(t, (i) => i.title, (i) => n`<calcite-list selection-mode=none .label=${i.title ?? this.heading ?? ""}><calcite-list-item-group .heading=${i.title}>${y(i.fields, (s) => s.name, (s) => n`<calcite-list-item .label=${s.alias || s.name} .description=${this.multiple ? this._messages.subFieldsSelected.replace("${count}", `${s.subFieldInfos.filter((l) => this.selectedFields.includes(l.name)).length}`) : void 0} .value=${s.name} @click=${(l) => this.addSubFieldInfoFlowItem(s, l.currentTarget)} @keydown=${(l) => {
|
|
258
262
|
l.key === "Enter" && this.addSubFieldInfoFlowItem(s, l.currentTarget);
|
|
259
263
|
}}><calcite-icon slot=actions-end icon=chevron-right flip-rtl scale=s></calcite-icon></calcite-list-item>`)}</calcite-list-item-group></calcite-list>`);
|
|
260
264
|
}
|
|
261
265
|
renderSplitTopLevelFieldList(e, t) {
|
|
262
|
-
return
|
|
266
|
+
return n`<calcite-list .label=${this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header)} .selectionMode=${this.multiple ? "multiple" : "single"} @calciteListChange=${() => this.handleListSelectionChange(e)} ${d(this.listNode)}><slot name=content-center></slot>${this.renderGroupedListItems(t)}</calcite-list>`;
|
|
263
267
|
}
|
|
264
268
|
renderTopLevelOnlyFieldList(e, t, i) {
|
|
265
|
-
return
|
|
269
|
+
return n`<div class=${L(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}><calcite-list .label=${e} .selectionMode=${this.multiple ? "multiple" : "single"} .filterEnabled=${i} .filterPlaceholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteListChange=${() => this.handleListSelectionChange(t)} @calciteListFilter=${(s) => {
|
|
266
270
|
s.stopPropagation(), this.filterFields = this.listNode.value.filteredItems?.map((l) => l.value), this.filterText = this.listNode.value.filterText;
|
|
267
271
|
}} ${d(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(i) ? this.renderSelectionButton() : null}<slot name=content-center></slot>${this.renderGroupedListItems(!1)}</calcite-list></div>`;
|
|
268
272
|
}
|
|
@@ -271,12 +275,12 @@ class H extends I {
|
|
|
271
275
|
if (!(t.length >= this.showFilterLength && !this.hideSort))
|
|
272
276
|
return "";
|
|
273
277
|
const s = t.every((l) => !!l.type);
|
|
274
|
-
return
|
|
278
|
+
return n`<calcite-dropdown slot=${e ?? m} placement=bottom-end overlay-positioning=fixed @calciteDropdownOpen=${() => {
|
|
275
279
|
this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
|
|
276
|
-
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? m}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @calciteDropdownItemSelect=${() => this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @calciteDropdownItemSelect=${() => this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${s &&
|
|
280
|
+
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? m}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @calciteDropdownItemSelect=${() => this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @calciteDropdownItemSelect=${() => this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${s && n`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @calciteDropdownItemSelect=${() => this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @calciteDropdownItemSelect=${() => this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
|
|
277
281
|
}
|
|
278
282
|
renderSelectionButton() {
|
|
279
|
-
return
|
|
283
|
+
return n`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${() => {
|
|
280
284
|
if (this.canDeselectAll())
|
|
281
285
|
this.selectedFields = this.filterFields?.length ? this.selectedFields.filter((e) => !this.filterFields?.includes(e)) : [];
|
|
282
286
|
else if (this.filterFields?.length)
|
|
@@ -293,14 +297,14 @@ class H extends I {
|
|
|
293
297
|
...i,
|
|
294
298
|
fields: e ? i.fields.filter((s) => F(s, this.filterText)) : i.fields
|
|
295
299
|
})).filter((i) => !!i.fields.length);
|
|
296
|
-
return t.length === 1 && !t[0].title ? this.renderListItems(t[0].fields) : t.map((s) =>
|
|
300
|
+
return t.length === 1 && !t[0].title ? this.renderListItems(t[0].fields) : t.map((s) => n`<calcite-list-item-group .heading=${s.title}>${this.renderListItems(s.fields)}</calcite-list-item-group>`);
|
|
297
301
|
}
|
|
298
302
|
renderListItems(e) {
|
|
299
303
|
return e.map((t) => this.renderCalciteListItem(t));
|
|
300
304
|
}
|
|
301
305
|
renderCalciteListItem(e, t = !0) {
|
|
302
306
|
const i = t && this.showFieldInfoCheck(e), s = this.showFieldTypeIcon && !!e.type;
|
|
303
|
-
return v(e.name,
|
|
307
|
+
return v(e.name, n`<calcite-list-item .label=${e.alias || e.name} .description=${(() => {
|
|
304
308
|
if (this.showFieldName && e.hideFieldName !== !0)
|
|
305
309
|
return `{${e.name}}`;
|
|
306
310
|
if (this.showDescription && e.hideDescription !== !0 && e.description)
|
|
@@ -308,11 +312,11 @@ class H extends I {
|
|
|
308
312
|
})()} .value=${e.name} .selected=${!this.multiple && e.name === this.selectedFields[0] || this.multiple && this.selectedFields.includes(e.name)} .metadata=${{
|
|
309
313
|
label: e.alias,
|
|
310
314
|
fieldName: e.name
|
|
311
|
-
}}>${s &&
|
|
315
|
+
}}>${s && n`<div slot=actions-end class="field-icons">${N({ fieldType: e.type })}</div>` || ""}${this.renderInfoAction(e, i)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`);
|
|
312
316
|
}
|
|
313
317
|
renderInfoAction(e, t) {
|
|
314
318
|
const { _messages: i } = this;
|
|
315
|
-
return t ?
|
|
319
|
+
return t ? n`<calcite-action slot=actions-end .text=${i.info} title=${i.info ?? m} scale=s icon=information @click=${(s) => {
|
|
316
320
|
s.stopPropagation();
|
|
317
321
|
const l = s.currentTarget;
|
|
318
322
|
this.addFieldInfoFlowItem(e, l);
|
|
@@ -320,23 +324,23 @@ class H extends I {
|
|
|
320
324
|
}
|
|
321
325
|
renderEditAction(e) {
|
|
322
326
|
const { _messages: t } = this;
|
|
323
|
-
return e.showEditAction ?
|
|
327
|
+
return e.showEditAction ? n`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? m} scale=s icon=pencil @click=${(i) => {
|
|
324
328
|
i.stopPropagation(), this.arcgisEditField.emit({ fieldName: e.name });
|
|
325
329
|
}}></calcite-action>` : "";
|
|
326
330
|
}
|
|
327
331
|
renderDeleteAction(e) {
|
|
328
332
|
const { _messages: t } = this;
|
|
329
|
-
return e.showDeleteAction ?
|
|
333
|
+
return e.showDeleteAction ? n`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? m} scale=s icon=trash @click=${(i) => {
|
|
330
334
|
i.stopPropagation(), this.arcgisDeleteField.emit({ fieldName: e.name });
|
|
331
335
|
}}></calcite-action>` : "";
|
|
332
336
|
}
|
|
333
337
|
renderAddButton() {
|
|
334
|
-
return this.multiple ?
|
|
338
|
+
return this.multiple ? n`<calcite-button .appearance=${this.hideCancel ? "outline-fill" : "solid"} .width=${this.hideCancel ? "full" : "half"} @click=${() => {
|
|
335
339
|
this.arcgisClose.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
|
|
336
340
|
}}>${this.okBtnText || (this.multiple ? this._messages.done : this._messages.ok)}</calcite-button>` : "";
|
|
337
341
|
}
|
|
338
342
|
renderCancelButton() {
|
|
339
|
-
return this.hideCancel ? "" :
|
|
343
|
+
return this.hideCancel ? "" : n`<calcite-button appearance=outline-fill .width=${this.multiple ? "half" : "full"} @click=${() => {
|
|
340
344
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
341
345
|
}}>${this._messages.cancel}</calcite-button>`;
|
|
342
346
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as M } from "../../chunks/runtime.js";
|
|
3
3
|
import { u as k } from "../../chunks/useT9n.js";
|
|
4
4
|
import { substitute as E } from "@arcgis/core/intl.js";
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { c as
|
|
3
|
-
import { formatNumber as
|
|
4
|
-
import { LitElement as
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
+
import { formatNumber as o } from "@arcgis/core/intl.js";
|
|
4
|
+
import { LitElement as u, createEvent as c, safeClassMap as h } from "@arcgis/lumina";
|
|
5
|
+
import { useWatchAttributes as d } from "@arcgis/lumina/controllers";
|
|
5
6
|
import { createRef as s, ref as l } from "lit/directives/ref.js";
|
|
6
|
-
import { css as p, html as
|
|
7
|
+
import { css as p, html as a } from "lit";
|
|
7
8
|
const m = p`:host{display:block}:host([hidden]){display:none}.content{display:flex;flex-direction:column}.readOnlyLabel{display:block;font-size:var(--calcite-font-size-sm);font-variant-numeric:tabular-nums;line-height:var(--calcite-font-line-height-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:.5rem;padding-block:3px;border-color:var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px);color:var(--calcite-color-text-1)}:host(:not([read-only])) .readOnlyLabel{position:absolute;opacity:0}:host([alignment="start"]){.content{align-items:start}.readOnlyLabel{text-align:start}}:host([alignment="end"]){.content{align-items:end}.readOnlyLabel{text-align:end}}:host([alignment="center"]){.content{align-items:center}.readOnlyLabel{text-align:center}}calcite-button{inline-size:100%;--calcite-offset-invert-focus: 1;--calcite-internal-animation-timing-fast: 0}calcite-input-number{inline-size:100%;--calcite-internal-animation-timing-fast: 0}`;
|
|
8
|
-
class f extends
|
|
9
|
+
class f extends u {
|
|
9
10
|
constructor() {
|
|
10
|
-
super(
|
|
11
|
+
super(), this._buttonRef = s(), this._inputRef = s(), this._labelRef = s(), this._formatOptions = {
|
|
11
12
|
style: "decimal",
|
|
12
13
|
useGrouping: !0,
|
|
13
14
|
minimumFractionDigits: 0,
|
|
14
15
|
maximumFractionDigits: 2
|
|
15
|
-
}, this._formatValue = (t) =>
|
|
16
|
+
}, this._formatValue = (t) => o(t, this._formatOptions), this._pointerDownPosition = null, this._displayedValue = "", this._editing = !1, this.alignment = "center", this.readOnly = !1, this.value = 0, this.arcgisChange = c({ cancelable: !1 }), d(["hidden"], () => this.requestUpdate());
|
|
16
17
|
}
|
|
17
18
|
static {
|
|
18
19
|
this.properties = { _displayedValue: 16, _editing: 16, alignment: 3, editing: 39, labelFormatter: 0, readOnly: 7, value: 11 };
|
|
@@ -39,10 +40,13 @@ class f extends c {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
updated(t) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
this.#t();
|
|
44
|
+
}
|
|
45
|
+
#t() {
|
|
46
|
+
const t = this._inputRef.value, e = this._buttonRef.value, i = this.renderRoot.querySelector(".readOnlyLabel");
|
|
47
|
+
if (t && e && i) {
|
|
48
|
+
const n = i.offsetWidth;
|
|
49
|
+
n > 0 && (e.style.width = `${n}px`, t.style.width = `${n}px`);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
_enterEdit() {
|
|
@@ -103,14 +107,14 @@ class f extends c {
|
|
|
103
107
|
}
|
|
104
108
|
render() {
|
|
105
109
|
const { alignment: t, _displayedValue: e } = this, i = [
|
|
106
|
-
|
|
110
|
+
a`<span class="readOnlyLabel"><span ${l(this._labelRef)}>${e}</span></span>`
|
|
107
111
|
];
|
|
108
|
-
return this.readOnly || i.push(
|
|
112
|
+
return this.readOnly || i.push(a`<calcite-button .alignment=${t} appearance=transparent .hidden=${this._editing} kind=neutral @pointerdown=${this._onPointerDown} @click=${this._onClick} scale=s width=full ${l(this._buttonRef)}>${e}</calcite-button>`, a`<calcite-input-number .alignment=${t} group-separator .hidden=${!this._editing} number-button-type=none @calciteInputNumberChange=${this._onValueChange} @keydown=${this._onKeyDown} @blur=${this._onBlur} @input=${this._onInput} scale=s status=idle .value=${`${this.value}`} ${l(this._inputRef)}></calcite-input-number>`), a`<div class=${h({
|
|
109
113
|
content: !0
|
|
110
114
|
})}>${i}</div>`;
|
|
111
115
|
}
|
|
112
116
|
}
|
|
113
|
-
|
|
117
|
+
r("arcgis-label-input", f);
|
|
114
118
|
export {
|
|
115
119
|
f as ArcgisLabelInput
|
|
116
120
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as n } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as l, html as o } from "lit";
|
|
4
4
|
import { LitElement as a, createEvent as i, safeStyleMap as r } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as f } from "../../chunks/runtime.js";
|
|
3
3
|
import w from "@arcgis/core/Color.js";
|
|
4
4
|
import { LitElement as x, nothing as u, safeClassMap as C } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as l } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as m } from "@arcgis/lumina";
|
|
4
4
|
import { css as p, html as c } from "lit";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as Q } from "../../chunks/runtime.js";
|
|
3
3
|
import { keyed as Z } from "lit/directives/keyed.js";
|
|
4
4
|
import { LitElement as ee, createEvent as S, safeClassMap as M, safeStyleMap as R, nothing as E } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as m } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as u, createEvent as n } from "@arcgis/lumina";
|
|
4
4
|
import { css as g, html as c } from "lit";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c } from "../../chunks/runtime.js";
|
|
3
3
|
import { sqlName as p, sqlLiteral as b } from "@arcgis/core/core/sql.js";
|
|
4
4
|
import { LitElement as v, createEvent as d, safeStyleMap as f } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as d } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as m, html as o } from "lit";
|
|
4
4
|
import { LitElement as b, createEvent as p } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { c as M } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as C, html as h } from "lit";
|
|
4
4
|
import { LitElement as F, createEvent as L, safeClassMap as o, nothing as y, safeStyleMap as m } from "@arcgis/lumina";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
|
-
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
2
|
+
import type { JsxNode, PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { MeasurementContext, RenderableToolbarContent, RenderContext } from "./types.js";
|
|
3
4
|
import type { ActionBar as ActionBar } from "@esri/calcite-components/components/calcite-action-bar";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -7,15 +8,13 @@ import type { ActionBar as ActionBar } from "@esri/calcite-components/components
|
|
|
7
8
|
*
|
|
8
9
|
* Measures the child elements then renders their content within its own shadow root.
|
|
9
10
|
*
|
|
11
|
+
* Can be used alone, or in conjunction with a toolbar-stack (ideal in cases with multiple toolbars).
|
|
12
|
+
*
|
|
10
13
|
* @internal
|
|
11
14
|
*/
|
|
12
15
|
export abstract class ArcgisToolbar extends LitElement {
|
|
13
16
|
get barElement(): ActionBar | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Toolbar orientation.
|
|
16
|
-
*
|
|
17
|
-
* @default "horizontal"
|
|
18
|
-
*/
|
|
17
|
+
/** Toolbar orientation. */
|
|
19
18
|
accessor layout: "horizontal" | "vertical";
|
|
20
19
|
/**
|
|
21
20
|
* Relative position is used to control how popover element placement and directional arrows
|
|
@@ -44,4 +43,25 @@ export abstract class ArcgisToolbar extends LitElement {
|
|
|
44
43
|
* @default "native"
|
|
45
44
|
*/
|
|
46
45
|
accessor tooltipAppearance: "calcite-dark" | "calcite" | "native";
|
|
46
|
+
/**
|
|
47
|
+
* @param context
|
|
48
|
+
* @param budget
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
allocate(context: RenderContext, budget: number): {
|
|
52
|
+
group: RenderableToolbarContent;
|
|
53
|
+
budget: number;
|
|
54
|
+
}[];
|
|
55
|
+
/**
|
|
56
|
+
* @param context
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
measure(context: MeasurementContext): number[];
|
|
60
|
+
/**
|
|
61
|
+
* @param context
|
|
62
|
+
* @param budget
|
|
63
|
+
* @param toolbarKind
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
proxiedRender(context: RenderContext, budget: number, toolbarKind?: "docked" | "floating"): JsxNode;
|
|
47
67
|
}
|
|
@@ -1,82 +1,108 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { c as
|
|
3
|
-
import { ref as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.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 {
|
|
10
12
|
constructor() {
|
|
11
|
-
super(
|
|
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) => {
|
|
12
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(() => {
|
|
13
15
|
!this.isConnected || this._renderedBar !== t || (this._hydratedRenderedBar = t);
|
|
14
16
|
}));
|
|
15
|
-
}, this._availableLength = 0, this.
|
|
17
|
+
}, this._availableLength = 0, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.arcgisInternalLayoutUpdate = g(), this.listen("arcgisInternalLayoutUpdate", (t) => {
|
|
18
|
+
t.target !== this.el && this.requestUpdate(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && t.stopPropagation();
|
|
19
|
+
});
|
|
16
20
|
}
|
|
17
21
|
static {
|
|
18
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 };
|
|
19
23
|
}
|
|
20
24
|
static {
|
|
21
|
-
this.styles = [
|
|
25
|
+
this.styles = [f, b, _, v];
|
|
22
26
|
}
|
|
23
27
|
#t;
|
|
24
|
-
#a;
|
|
25
28
|
#r;
|
|
29
|
+
#s;
|
|
26
30
|
#i;
|
|
27
|
-
#
|
|
31
|
+
#e;
|
|
32
|
+
get layout() {
|
|
33
|
+
return this._layout;
|
|
34
|
+
}
|
|
35
|
+
set layout(t) {
|
|
36
|
+
t !== this._layout && (this._layout = t, this._updateMeasurement());
|
|
37
|
+
}
|
|
28
38
|
get barElement() {
|
|
29
39
|
return this._hydratedRenderedBar;
|
|
30
40
|
}
|
|
31
41
|
get effectiveRelativeDirection() {
|
|
32
|
-
const [t,
|
|
33
|
-
switch (
|
|
42
|
+
const [t, e] = this.relativePosition.split("-"), r = this.#i;
|
|
43
|
+
switch (e) {
|
|
34
44
|
case "left":
|
|
35
45
|
case "right":
|
|
36
|
-
return `${t}-${
|
|
46
|
+
return `${t}-${e}`;
|
|
37
47
|
case "end":
|
|
38
|
-
return `${t}-${
|
|
48
|
+
return `${t}-${r === "ltr" ? "right" : "left"}`;
|
|
39
49
|
case "start":
|
|
40
|
-
return `${t}-${
|
|
50
|
+
return `${t}-${r === "ltr" ? "left" : "right"}`;
|
|
41
51
|
}
|
|
42
52
|
}
|
|
53
|
+
measure(t) {
|
|
54
|
+
const e = this._groups;
|
|
55
|
+
if (!e?.length)
|
|
56
|
+
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);
|
|
59
|
+
}
|
|
60
|
+
allocate(t, e) {
|
|
61
|
+
const r = this._groups;
|
|
62
|
+
return r?.length ? o(r, t, e) : [];
|
|
63
|
+
}
|
|
64
|
+
proxiedRender(t, e, r = this.toolbarKind) {
|
|
65
|
+
if (!this._groups?.length)
|
|
66
|
+
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>`);
|
|
69
|
+
}
|
|
43
70
|
connectedCallback() {
|
|
44
|
-
super.connectedCallback(), this._connectMeasurement(this.#
|
|
71
|
+
super.connectedCallback(), this._connectMeasurement(this.#e), this.#r.observe(this.el, { childList: !0 }), this._syncGroups();
|
|
45
72
|
}
|
|
46
73
|
disconnectedCallback() {
|
|
47
|
-
this.#t.disconnect(), this.#
|
|
74
|
+
this.#t.disconnect(), this.#r.disconnect(), super.disconnectedCallback();
|
|
48
75
|
}
|
|
49
76
|
_setRulerEl(t) {
|
|
50
|
-
this.#
|
|
77
|
+
this.#e !== t && (this.#e = t, this.isConnected && this._connectMeasurement(t));
|
|
51
78
|
}
|
|
52
79
|
_connectMeasurement(t) {
|
|
53
80
|
this.#t.disconnect(), t && (this.#t.observe(t), this._updateMeasurement());
|
|
54
81
|
}
|
|
55
82
|
_updateMeasurement(t) {
|
|
56
|
-
const
|
|
57
|
-
|
|
83
|
+
const e = t?.at(0)?.contentRect ?? this.#e?.getBoundingClientRect();
|
|
84
|
+
e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
|
|
58
85
|
}
|
|
59
86
|
_syncGroups() {
|
|
60
|
-
this.#
|
|
61
|
-
const t = Array.from(this.el.children).filter(
|
|
62
|
-
this.#
|
|
63
|
-
!this.isConnected ||
|
|
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(() => {
|
|
90
|
+
!this.isConnected || e.signal.aborted || (this._groups = t, this.arcgisInternalLayoutUpdate.emit());
|
|
64
91
|
});
|
|
65
92
|
}
|
|
66
93
|
render() {
|
|
67
|
-
|
|
68
|
-
if (!t?.length)
|
|
94
|
+
if (!this._groups?.length || this.el.parentElement?.localName === "arcgis-toolbar-stack")
|
|
69
95
|
return;
|
|
70
|
-
const
|
|
96
|
+
const e = {
|
|
71
97
|
layout: this.layout,
|
|
72
98
|
relativePosition: this.effectiveRelativeDirection,
|
|
73
99
|
scale: this.scale,
|
|
74
100
|
tooltipAppearance: this.tooltipAppearance
|
|
75
|
-
},
|
|
76
|
-
return
|
|
101
|
+
}, [{ budget: r }] = o([this], e, this._availableLength);
|
|
102
|
+
return c`<div class="ruler" ${l(this._setRulerEl)}></div>${this.proxiedRender(e, r)}`;
|
|
77
103
|
}
|
|
78
104
|
}
|
|
79
|
-
|
|
105
|
+
d("arcgis-toolbar", R);
|
|
80
106
|
export {
|
|
81
|
-
|
|
107
|
+
R as ArcgisToolbar
|
|
82
108
|
};
|