@arcgis/common-components 5.2.0-next.10 → 5.2.0-next.12
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/{232BH3SJ.js → 2XA6O2MP.js} +1 -1
- package/dist/cdn/3P53QRGS.js +2 -0
- package/dist/cdn/{6XE5JNJ7.js → 3V5M7OHL.js} +1 -1
- package/dist/cdn/4W7JZPB6.js +2 -0
- package/dist/cdn/{YG4PY2H3.js → 5KS7T5BY.js} +1 -1
- package/dist/cdn/5U5NQ3F5.js +2 -0
- package/dist/cdn/77HZGUSC.js +2 -0
- package/dist/cdn/{OOBX2C2L.js → AFBKMYU6.js} +1 -1
- package/dist/cdn/GVOQ2CB7.js +2 -0
- package/dist/cdn/{F45Q3BRT.js → IUJ4ILLQ.js} +1 -1
- package/dist/cdn/{WJ3TYWP2.js → JLPZ3OR2.js} +1 -1
- package/dist/cdn/JPD7Z3MB.js +2 -0
- package/dist/cdn/L2JNUMXB.js +2 -0
- package/dist/cdn/L5RMOAO3.js +2 -0
- package/dist/cdn/LB7I345F.js +2 -0
- package/dist/cdn/LBD3GPSD.js +2 -0
- package/dist/cdn/LKUOAV7B.js +2 -0
- package/dist/cdn/MCH3WQ4X.js +2 -0
- package/dist/cdn/{YVCGEEMG.js → MCZBUYS5.js} +1 -1
- package/dist/cdn/N7C4DINF.js +2 -0
- package/dist/cdn/OBIWQRXY.js +2 -0
- package/dist/cdn/PSITQBDP.js +2 -0
- package/dist/cdn/{BDF4ZLUF.js → TXYPZ6MB.js} +1 -1
- package/dist/cdn/{MINFRX4Y.js → VQLI4IE7.js} +1 -1
- package/dist/cdn/WEKRF34E.js +2 -0
- package/dist/cdn/WLYFLEI6.js +2 -0
- package/dist/cdn/XRARFMJ7.js +2 -0
- package/dist/cdn/ZDMNUSIJ.js +2 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/components/arcgis-color-input/customElement.js +5 -5
- package/dist/components/arcgis-field-pick-list/customElement.js +43 -51
- package/dist/components/arcgis-picker-input/customElement.d.ts +6 -2
- package/dist/components/arcgis-picker-input/customElement.js +7 -7
- package/dist/components/arcgis-value-picker/customElement.d.ts +377 -0
- package/dist/components/arcgis-value-picker/customElement.js +87 -0
- package/dist/components/arcgis-value-picker/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker/index.js +3 -0
- package/dist/components/arcgis-value-picker/types.d.ts +69 -0
- package/dist/components/arcgis-value-picker-collection/customElement.d.ts +113 -0
- package/dist/components/arcgis-value-picker-collection/customElement.js +43 -0
- package/dist/components/arcgis-value-picker-collection/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-collection/index.js +1 -0
- package/dist/components/arcgis-value-picker-combobox/customElement.d.ts +90 -0
- package/dist/components/arcgis-value-picker-combobox/customElement.js +55 -0
- package/dist/components/arcgis-value-picker-combobox/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-combobox/index.js +3 -0
- package/dist/components/arcgis-value-picker-label/customElement.d.ts +81 -0
- package/dist/components/arcgis-value-picker-label/customElement.js +51 -0
- package/dist/components/arcgis-value-picker-label/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-label/index.js +1 -0
- package/dist/components/arcgis-value-picker-slider/customElement.d.ts +173 -0
- package/dist/components/arcgis-value-picker-slider/customElement.js +60 -0
- package/dist/components/arcgis-value-picker-slider/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-slider/index.js +3 -0
- 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 +50 -0
- package/dist/loader.js +8 -3
- package/dist/types/lumina.d.ts +36 -0
- package/dist/types/preact.d.ts +41 -0
- package/dist/types/react.d.ts +46 -0
- package/dist/types/stencil.d.ts +36 -0
- package/package.json +3 -3
- package/dist/cdn/2MN6S2HH.js +0 -2
- package/dist/cdn/4NANIXN7.js +0 -2
- package/dist/cdn/5I5ODGDD.js +0 -2
- package/dist/cdn/AGGCAE6P.js +0 -2
- package/dist/cdn/D3WBDGDH.js +0 -2
- package/dist/cdn/HWEOBUAY.js +0 -2
- package/dist/cdn/OTXMT4H5.js +0 -2
- package/dist/cdn/OUUS7VKS.js +0 -2
- package/dist/cdn/OYXJA2QF.js +0 -2
- package/dist/cdn/QS7JRY4H.js +0 -2
- package/dist/cdn/SKYXMBD4.js +0 -2
- package/dist/cdn/UEGSIUVY.js +0 -2
- package/dist/cdn/YVWFGK4M.js +0 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as F } from "../../chunks/runtime.js";
|
|
3
|
-
import { keyed as
|
|
4
|
-
import { LitElement as
|
|
3
|
+
import { keyed as w } from "lit/directives/keyed.js";
|
|
4
|
+
import { LitElement as $, createEvent as r, renderElement as y, nothing as h, safeStyleMap as u, safeClassMap as v } from "@arcgis/lumina";
|
|
5
5
|
import { createRef as a, ref as c } from "lit/directives/ref.js";
|
|
6
6
|
import { html as l, css as C } from "lit";
|
|
7
|
-
import { Task as
|
|
8
|
-
import { log as f, composeMissingPropertyMessage as
|
|
7
|
+
import { Task as S } from "@lit/task";
|
|
8
|
+
import { log as f, composeMissingPropertyMessage as x } from "@arcgis/toolkit/log";
|
|
9
9
|
import { F as g } from "../../chunks/internal-types.js";
|
|
10
|
-
import { i as
|
|
11
|
-
import { u as
|
|
10
|
+
import { i as b } from "../../chunks/commonFunctions.js";
|
|
11
|
+
import { u as k } from "../../chunks/useT9n.js";
|
|
12
12
|
const n = /* @__PURE__ */ new Map();
|
|
13
13
|
n.set("oid", "key");
|
|
14
14
|
n.set("guid", "key");
|
|
@@ -26,13 +26,13 @@ n.set("date-only", "calendar");
|
|
|
26
26
|
n.set("time-only", "clock");
|
|
27
27
|
n.set("timestamp-offset", "time-zone");
|
|
28
28
|
n.set("string", "string");
|
|
29
|
-
const
|
|
30
|
-
class
|
|
29
|
+
const L = ({ fieldType: m }) => l`<calcite-icon scale=s .icon=${n.get(m)}></calcite-icon>`, B = C`.panel{min-height:250px}.content{max-height:50vh}.field-icons{display:flex;align-items:center;padding:0 var(--calcite-space-sm)}.selection-button-div{padding:var(--calcite-space-2xs) var(--calcite-space-sm-plus)}.no-match-text{padding:var(--calcite-space-md)}.footer{width:100%}.add-cancel-buttons{display:flex;align-content:space-between}`;
|
|
30
|
+
class I extends $ {
|
|
31
31
|
constructor() {
|
|
32
|
-
super(...arguments), this._messages =
|
|
32
|
+
super(...arguments), this._messages = k({ blocking: !0 }), this.popoverNode = a(), this.listNode = a(), this.flowElement = a(), this.panelElement = a(), this.dropdownNode = a(), this.fieldInfoFlowItemEl = a(), this.allLists = [], this.filterText = "", this.panelCutOffHeight = 0, this._propWatcherTask = new S(this, {
|
|
33
33
|
task: async ([e]) => {
|
|
34
|
-
if (!this.listOnly && !
|
|
35
|
-
throw f("error", this,
|
|
34
|
+
if (!this.listOnly && !b(e?.refElement))
|
|
35
|
+
throw f("error", this, x("popoverProps")), new Error();
|
|
36
36
|
this._propWatcherTask.autoRun = !1;
|
|
37
37
|
},
|
|
38
38
|
args: () => [this.popoverProps]
|
|
@@ -42,7 +42,7 @@ class L extends w {
|
|
|
42
42
|
this.properties = { lastSortBy: 16, filterFields: 16, mapView: 0, view: 0, layer: 0, fields: 0, selectedFields: 0, listOnly: 5, popoverProps: 0, showFieldInfo: 5, showFieldTypeIcon: 5, showFieldName: 5, showDescription: 5, showSelectionAll: 5, showCancel: 5, hideCancel: 5, showSort: 5, hideSort: 5, showFilterLength: 9, multiple: 5, heading: 1, okBtnText: 1, filterPlaceholderText: 1, filterNoResultsText: 1, sortBy: 1, groupFieldsAndExpressions: 5, fieldsGroupHeading: 1, expressionsGroupHeading: 1, customExpressionCheck: 0 };
|
|
43
43
|
}
|
|
44
44
|
static {
|
|
45
|
-
this.styles =
|
|
45
|
+
this.styles = B;
|
|
46
46
|
}
|
|
47
47
|
async reposition() {
|
|
48
48
|
await this.popoverNode.value?.reposition();
|
|
@@ -88,8 +88,8 @@ class L extends w {
|
|
|
88
88
|
}
|
|
89
89
|
getSortedList(e) {
|
|
90
90
|
let t = [...e];
|
|
91
|
-
const
|
|
92
|
-
return t = t.filter((
|
|
91
|
+
const s = t.filter((i) => i.type === "none");
|
|
92
|
+
return t = t.filter((i) => i.type !== "none"), this.lastSortBy === "display" ? t.sort((i, o) => i.alias.localeCompare(o.alias)) : this.lastSortBy === "field" ? t.sort((i, o) => i.name.localeCompare(o.name)) : this.lastSortBy === "type" && t.sort((i, o) => i.type.localeCompare(o.type)), t = t.concat(s), t;
|
|
93
93
|
}
|
|
94
94
|
isExpression(e) {
|
|
95
95
|
return this.customExpressionCheck ? this.customExpressionCheck(e) : e.name.includes(g.expression);
|
|
@@ -132,12 +132,12 @@ class L extends w {
|
|
|
132
132
|
];
|
|
133
133
|
}
|
|
134
134
|
addFieldInfoFlowItem(e, t) {
|
|
135
|
-
const
|
|
135
|
+
const s = this.flowElement.value, i = y(l`<calcite-flow-item selected .heading=${e.alias ?? e.name} .description=${e.name} class="panel" style=${u(this.panelCutOffHeight > 0 ? `max-height: ${this.panelCutOffHeight}px` : "max-height: 50vh")} @calciteFlowItemBack=${(o) => {
|
|
136
136
|
o.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
137
137
|
t.setFocus();
|
|
138
138
|
}, 300);
|
|
139
139
|
}} ${c(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang ?? h} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);
|
|
140
|
-
|
|
140
|
+
s.appendChild(i), this.panelElement.value.selected = !1, this.fieldInfoFlowItemEl?.value.setFocus();
|
|
141
141
|
}
|
|
142
142
|
usingCustomGroups() {
|
|
143
143
|
return !!this.fields.length && "fields" in this.fields[0];
|
|
@@ -151,12 +151,12 @@ class L extends w {
|
|
|
151
151
|
reorderSelectedFieldsByCurrentListOrder() {
|
|
152
152
|
if (!this.selectedFields.length)
|
|
153
153
|
return !1;
|
|
154
|
-
const e = this.getAllFields().map((o) => o.name), t = new Set(this.selectedFields),
|
|
154
|
+
const e = this.getAllFields().map((o) => o.name), t = new Set(this.selectedFields), s = e.filter((o) => t.has(o)), i = (
|
|
155
155
|
// adding/removing fields
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
s.length !== this.selectedFields.length || // reordering fields
|
|
157
|
+
s.some((o, p) => o !== this.selectedFields[p])
|
|
158
158
|
);
|
|
159
|
-
return
|
|
159
|
+
return i && (this.selectedFields = [...s]), i;
|
|
160
160
|
}
|
|
161
161
|
render() {
|
|
162
162
|
return this._propWatcherTask.render({
|
|
@@ -177,30 +177,22 @@ class L extends w {
|
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
renderList() {
|
|
180
|
-
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.getAllFields(),
|
|
181
|
-
return l`${t.length ? l`<calcite-list .label=${e} .selectionMode=${this.multiple ? "multiple" : "single"} class=${v(this.listOnly ? "" : "content")} .filterEnabled=${
|
|
182
|
-
const
|
|
180
|
+
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.getAllFields(), s = t.length >= this.showFilterLength;
|
|
181
|
+
return l`${t.length ? l`<calcite-list .label=${e} .selectionMode=${this.multiple ? "multiple" : "single"} class=${v(this.listOnly ? "" : "content")} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteListChange=${() => {
|
|
182
|
+
const i = this.listNode.value.selectedItems.map((d) => d.value), o = this.selectedFields.filter((d) => i.includes(d)), p = i.filter((d) => !this.selectedFields.includes(d));
|
|
183
183
|
this.selectedFields = [.../* @__PURE__ */ new Set([...o, ...p])], this.reorderSelectedFieldsByCurrentListOrder(), 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 }));
|
|
184
|
-
}} @calciteListFilter=${(
|
|
185
|
-
|
|
186
|
-
}} ${c(this.listNode)}>${this.renderSortButton()}<slot name=content-center></slot>${this.multiple && this.showSelectionAll && (!
|
|
184
|
+
}} @calciteListFilter=${(i) => {
|
|
185
|
+
i.stopPropagation(), this.filterFields = this.listNode.value.filteredItems?.map((o) => o.value), this.filterText = this.listNode.value.filterText;
|
|
186
|
+
}} ${c(this.listNode)}>${this.renderSortButton()}<slot name=content-center></slot>${this.multiple && this.showSelectionAll && (!s || !this.filterText || this.filterFields?.length) ? this.renderSelectionButton() : null}${this.renderListItems()}</calcite-list>` : l`<slot name=no-fields></slot>`}${this.filterFields && !this.filterFields.length && this.listNode.value && this.filterNoResultsText?.length !== 0 ? l`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
|
|
187
187
|
}
|
|
188
188
|
renderSortButton() {
|
|
189
189
|
const e = this.getAllFields();
|
|
190
190
|
if (!(e.length >= this.showFilterLength && !this.hideSort))
|
|
191
191
|
return "";
|
|
192
|
-
const
|
|
192
|
+
const s = e.every((i) => !!i.type);
|
|
193
193
|
return l`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed .disabled=${this.filterFields ? this.filterFields.length < 4 : !1} @calciteDropdownOpen=${() => {
|
|
194
194
|
this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
|
|
195
|
-
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${c(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? h}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @
|
|
196
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("default");
|
|
197
|
-
}}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @click=${() => this.setSortBy("display")} @keydown=${(s) => {
|
|
198
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("display");
|
|
199
|
-
}}>${this._messages.displayName}</calcite-dropdown-item>${i && l`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @click=${() => this.setSortBy("type")} @keydown=${(s) => {
|
|
200
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("type");
|
|
201
|
-
}}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @click=${() => this.setSortBy("field")} @keydown=${(s) => {
|
|
202
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("field");
|
|
203
|
-
}}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
|
|
195
|
+
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${c(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? h}><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 && l`<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>`;
|
|
204
196
|
}
|
|
205
197
|
renderSelectionButton() {
|
|
206
198
|
return l`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${() => {
|
|
@@ -210,18 +202,18 @@ class L extends w {
|
|
|
210
202
|
this.selectedFields = [.../* @__PURE__ */ new Set([...this.selectedFields, ...this.filterFields])];
|
|
211
203
|
else {
|
|
212
204
|
const t = this.getAllFields();
|
|
213
|
-
this.selectedFields = t.map((
|
|
205
|
+
this.selectedFields = t.map((s) => s.name);
|
|
214
206
|
}
|
|
215
207
|
this.reorderSelectedFieldsByCurrentListOrder(), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
|
|
216
208
|
}}>${this.canDeselectAll() ? this._messages.deselectAll : this._messages.selectAll}</calcite-button></div>`;
|
|
217
209
|
}
|
|
218
210
|
renderListItems() {
|
|
219
211
|
const e = this.allLists.filter((t) => !!t.fields.length);
|
|
220
|
-
return e.length === 1 && !e[0].title ? e[0].fields.map((t) => this.renderCalciteListItem(t)) : e.map((
|
|
212
|
+
return e.length === 1 && !e[0].title ? e[0].fields.map((t) => this.renderCalciteListItem(t)) : e.map((s) => l`<calcite-list-item-group .heading=${s.title}>${s.fields.map((i) => this.renderCalciteListItem(i))}</calcite-list-item-group>`);
|
|
221
213
|
}
|
|
222
214
|
renderCalciteListItem(e) {
|
|
223
|
-
const t = this.showFieldInfoCheck(e),
|
|
224
|
-
return
|
|
215
|
+
const t = this.showFieldInfoCheck(e), s = this.showFieldTypeIcon && !!e.type;
|
|
216
|
+
return w(e.name, l`<calcite-list-item .label=${e.alias || e.name} .description=${(() => {
|
|
225
217
|
if (this.showFieldName && e.hideFieldName !== !0)
|
|
226
218
|
return `{${e.name}}`;
|
|
227
219
|
if (this.showDescription && e.hideDescription !== !0 && e.description)
|
|
@@ -229,26 +221,26 @@ class L extends w {
|
|
|
229
221
|
})()} .value=${e.name} .selected=${!this.multiple && e.name === this.selectedFields[0] || this.multiple && this.selectedFields.includes(e.name)} .metadata=${{
|
|
230
222
|
label: e.alias,
|
|
231
223
|
fieldName: e.name
|
|
232
|
-
}}>${
|
|
224
|
+
}}>${s && l`<div slot=actions-end class="field-icons">${L({ fieldType: e.type })}</div>` || ""}${this.renderInfoAction(e, t)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`);
|
|
233
225
|
}
|
|
234
226
|
renderInfoAction(e, t) {
|
|
235
|
-
const { _messages:
|
|
236
|
-
return t ? l`<calcite-action slot=actions-end .text=${
|
|
237
|
-
|
|
238
|
-
const o =
|
|
227
|
+
const { _messages: s } = this;
|
|
228
|
+
return t ? l`<calcite-action slot=actions-end .text=${s.info} title=${s.info ?? h} scale=s icon=information @click=${(i) => {
|
|
229
|
+
i.stopPropagation();
|
|
230
|
+
const o = i.currentTarget;
|
|
239
231
|
this.addFieldInfoFlowItem(e, o);
|
|
240
232
|
}}></calcite-action>` : "";
|
|
241
233
|
}
|
|
242
234
|
renderEditAction(e) {
|
|
243
235
|
const { _messages: t } = this;
|
|
244
|
-
return e.showEditAction ? l`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? h} scale=s icon=pencil @click=${(
|
|
245
|
-
|
|
236
|
+
return e.showEditAction ? l`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? h} scale=s icon=pencil @click=${(s) => {
|
|
237
|
+
s.stopPropagation(), this.arcgisEditField.emit({ fieldName: e.name });
|
|
246
238
|
}}></calcite-action>` : "";
|
|
247
239
|
}
|
|
248
240
|
renderDeleteAction(e) {
|
|
249
241
|
const { _messages: t } = this;
|
|
250
|
-
return e.showDeleteAction ? l`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? h} scale=s icon=trash @click=${(
|
|
251
|
-
|
|
242
|
+
return e.showDeleteAction ? l`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? h} scale=s icon=trash @click=${(s) => {
|
|
243
|
+
s.stopPropagation(), this.arcgisDeleteField.emit({ fieldName: e.name });
|
|
252
244
|
}}></calcite-action>` : "";
|
|
253
245
|
}
|
|
254
246
|
renderAddButton() {
|
|
@@ -262,7 +254,7 @@ class L extends w {
|
|
|
262
254
|
}}>${this._messages.cancel}</calcite-button>`;
|
|
263
255
|
}
|
|
264
256
|
}
|
|
265
|
-
F("arcgis-field-pick-list",
|
|
257
|
+
F("arcgis-field-pick-list", I);
|
|
266
258
|
export {
|
|
267
|
-
|
|
259
|
+
I as ArcgisFieldPickList
|
|
268
260
|
};
|
|
@@ -29,8 +29,12 @@ export abstract class ArcgisPickerInput extends LitElement {
|
|
|
29
29
|
accessor label: string;
|
|
30
30
|
/** Convenience prop to specify common popover props. */
|
|
31
31
|
accessor popoverProps: PopoverProps | undefined;
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Close the component.
|
|
34
|
+
*
|
|
35
|
+
* @param options
|
|
36
|
+
*/
|
|
37
|
+
close(options?: { focus: boolean; }): Promise<void>;
|
|
34
38
|
/** Set focus on the component. */
|
|
35
39
|
setFocus(): Promise<void>;
|
|
36
40
|
/** Emitted when the component has been closed. */
|
|
@@ -14,8 +14,8 @@ class d extends a {
|
|
|
14
14
|
static {
|
|
15
15
|
this.styles = p;
|
|
16
16
|
}
|
|
17
|
-
async close() {
|
|
18
|
-
this.onPopoverClose();
|
|
17
|
+
async close(e) {
|
|
18
|
+
this.onPopoverClose(e);
|
|
19
19
|
}
|
|
20
20
|
async setFocus() {
|
|
21
21
|
this.buttonEl?.focus();
|
|
@@ -30,16 +30,16 @@ class d extends a {
|
|
|
30
30
|
this.panelEl.value.closed = !1, this.arcgisPopoverOpen.emit(), e.stopPropagation();
|
|
31
31
|
}
|
|
32
32
|
handlePopoverKeyUp({ key: e }) {
|
|
33
|
-
e === "Escape" && this.onPopoverClose();
|
|
33
|
+
e === "Escape" && this.onPopoverClose({ focus: !0 });
|
|
34
34
|
}
|
|
35
35
|
onPopoverOpen(e) {
|
|
36
36
|
this.open && (e.composedPath().includes(this.el) || (this.open = !1));
|
|
37
37
|
}
|
|
38
|
-
onPopoverClose() {
|
|
39
|
-
this.open = !1, this.arcgisPopoverClose.emit(), setTimeout(() => this.buttonEl?.focus(), 300);
|
|
38
|
+
onPopoverClose(e) {
|
|
39
|
+
this.open = !1, this.arcgisPopoverClose.emit(), e?.focus && setTimeout(() => this.buttonEl?.focus(), 300);
|
|
40
40
|
}
|
|
41
41
|
handlePanelClose(e) {
|
|
42
|
-
e.stopPropagation(), this.onPopoverClose();
|
|
42
|
+
e.stopPropagation(), this.onPopoverClose({ focus: !0 });
|
|
43
43
|
}
|
|
44
44
|
handleButtonClick() {
|
|
45
45
|
this.open = !this.open, this.open && setTimeout(() => {
|
|
@@ -48,7 +48,7 @@ class d extends a {
|
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
50
|
const { popoverProps: e } = this;
|
|
51
|
-
return o`<calcite-popover pointer-disabled trigger-disabled @keyup=${this.handlePopoverKeyUp} .label=${this.label} .offsetDistance=${e?.offsetDistance ?? 0} .offsetSkidding=${e?.offsetSkidding ?? 0} .flipDisabled=${e?.flipDisabled ?? !1} .open=${this.disabled ? !1 : this.open} .overlayPositioning=${e?.overlayPositioning ?? "fixed"} .placement=${e?.placement ?? "bottom"} @calcitePopoverOpen=${this.handlePopoverOpen} @calcitePopoverClose=${(s) => s.stopPropagation()} .referenceElement=${e?.refElement ?? this.previewContainerEl}><calcite-panel closable .heading=${this.heading} style=${r(e?.maxHeight ? { maxHeight: e.maxHeight } : void 0)} @calcitePanelClose=${this.handlePanelClose} ${t(this.panelEl)}><slot name=content></slot><calcite-button appearance=solid slot=footer width=full .label=${this.intlDone} @click=${this.onPopoverClose}>${this.intlDone}</calcite-button></calcite-panel></calcite-popover><div class="container"><div class="preview" ${t(this.setPreviewContainerRef)}><button .disabled=${this.disabled} @click=${this.handleButtonClick} type=button .ariaLabel=${this.label} ${t(this.setButtonRef)}><slot name=preview></slot>${this.iconEnd ? o`<calcite-icon .icon=${this.iconEnd} scale=s></calcite-icon>` : null}</button></div><slot name=content-end></slot></div>`;
|
|
51
|
+
return o`<calcite-popover pointer-disabled trigger-disabled @keyup=${this.handlePopoverKeyUp} .label=${this.label} .offsetDistance=${e?.offsetDistance ?? 0} .offsetSkidding=${e?.offsetSkidding ?? 0} .flipDisabled=${e?.flipDisabled ?? !1} .open=${this.disabled ? !1 : this.open} .overlayPositioning=${e?.overlayPositioning ?? "fixed"} .placement=${e?.placement ?? "bottom"} @calcitePopoverOpen=${this.handlePopoverOpen} @calcitePopoverClose=${(s) => s.stopPropagation()} .referenceElement=${e?.refElement ?? this.previewContainerEl}><calcite-panel closable .heading=${this.heading} style=${r(e?.maxHeight ? { maxHeight: e.maxHeight } : void 0)} @calcitePanelClose=${this.handlePanelClose} ${t(this.panelEl)}><slot name=content></slot><calcite-button appearance=solid slot=footer width=full .label=${this.intlDone} @click=${() => this.onPopoverClose({ focus: !0 })}>${this.intlDone}</calcite-button></calcite-panel></calcite-popover><div class="container"><div class="preview" ${t(this.setPreviewContainerRef)}><button .disabled=${this.disabled} @click=${this.handleButtonClick} type=button .ariaLabel=${this.label} ${t(this.setButtonRef)}><slot name=preview></slot>${this.iconEnd ? o`<calcite-icon .icon=${this.iconEnd} scale=s></calcite-icon>` : null}</button></div><slot name=content-end></slot></div>`;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
n("arcgis-picker-input", d);
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { IconName, AnimateEvent, ArcgisValuePickerSubcomponent, Layout } from "./types.js";
|
|
4
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Value Picker component allows users to step or play through an iterable set of data. The component alone acts as a shell, consisting
|
|
8
|
+
* of a play/pause button, a next button, a previous button, and a slot for adding a component to Value Picker. Value Picker is not associated with a
|
|
9
|
+
* [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/) nor does it require that the dataset adheres to a specific structure
|
|
10
|
+
* for it to function. The [arcgis-value-picker-label](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-label/), [arcgis-value-picker-slider](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-slider/),
|
|
11
|
+
* [arcgis-value-picker-combobox](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-combobox/), and [arcgis-value-picker-collection](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-collection/) components provide the user with a few different options
|
|
12
|
+
* for placing their data into a Value Picker with minimal configuration. Value Picker handles the different shapes of these components automatically by asserting
|
|
13
|
+
* that all slotted components will extend the
|
|
14
|
+
* [ArcgisValuePickerSubcomponent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker/types/#ArcgisValuePickerSubcomponent)
|
|
15
|
+
* interface, which allows Value picker to send and receive generic sets of instructions that are interpreted by the slotted component.
|
|
16
|
+
*
|
|
17
|
+
* ### Configuring Value Picker
|
|
18
|
+
*
|
|
19
|
+
* #### Configuring Value Picker without slotted components
|
|
20
|
+
*
|
|
21
|
+
* 
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <arcgis-map itemId="462c629e8e604c15baf45627c4f337d6">
|
|
25
|
+
* <arcgis-value-picker slot="top-right"></arcgis-value-picker>
|
|
26
|
+
* </arcgis-map>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* If a user wishes to use Value Picker with a component or dataset that can't be accurately represented by the slottable components, the component may be placed
|
|
30
|
+
* adjacent to the empty Value Picker, and events fired by Value Picker can be used to orchestrate the behavior of the adjacent component.
|
|
31
|
+
* For example, when the user clicks the play button, Value Picker will emit [@arcgisAnimate](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#event-arcgisAnimate) each time
|
|
32
|
+
* [playRate](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#playRate) ms have elapsed since the button was clicked, which the user could listen to and iterate the index of
|
|
33
|
+
* their dataset on an interval as a result.
|
|
34
|
+
*
|
|
35
|
+
* ```js
|
|
36
|
+
* const valuePicker = document.querySelector("arcgis-value-picker");
|
|
37
|
+
* const basemapGallery = document.querySelector("arcgis-basemap-gallery");
|
|
38
|
+
*
|
|
39
|
+
* const basemaps = new Collection([
|
|
40
|
+
* Basemap.fromId("topo-vector"),
|
|
41
|
+
* Basemap.fromId("hybrid"),
|
|
42
|
+
* Basemap.fromId("streets"),
|
|
43
|
+
* Basemap.fromId("satellite"),
|
|
44
|
+
* Basemap.fromId("oceans"),
|
|
45
|
+
* ]);
|
|
46
|
+
*
|
|
47
|
+
* basemapGallery.source = new LocalBasemapsSource({ basemaps });
|
|
48
|
+
* basemapGallery.activeBasemap = basemaps.getItemAt(0);
|
|
49
|
+
*
|
|
50
|
+
* valuePicker.addEventListener("arcgisAnimate", () => {
|
|
51
|
+
* const currentIndex = basemaps.indexOf(basemapGallery.activeBasemap);
|
|
52
|
+
* basemapGallery.activeBasemap = basemaps.getItemAt(currentIndex + 1);
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* #### Configuring Value Picker with slotted components
|
|
57
|
+
*
|
|
58
|
+
* A single component may be placed into the Value Picker slot by placing one element inside of the other:
|
|
59
|
+
*
|
|
60
|
+
* ```html
|
|
61
|
+
* <arcgis-value-picker>
|
|
62
|
+
* <arcgis-value-picker-slider></arcgis-value-picker-slider>
|
|
63
|
+
* </arcgis-value-picker>
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* #### 1. Using a label component to step through a list of items
|
|
67
|
+
*
|
|
68
|
+
* Consider using the [arcgis-value-picker-label](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-label/) component to step through a small, fixed list of predefined values. This component provides a strict
|
|
69
|
+
* interface that steps back and forth, so it's a good option for temporal data, or data that shows progression dependent on the element's position in the list.
|
|
70
|
+
*
|
|
71
|
+
* 
|
|
72
|
+
*
|
|
73
|
+
* ```js
|
|
74
|
+
* const mapElement = document.querySelector("arcgis-map");
|
|
75
|
+
* const valuePickerLabel = document.querySelector("arcgis-value-picker-label");
|
|
76
|
+
*
|
|
77
|
+
* const labelItems = [
|
|
78
|
+
* { value: "2017", label: "Tree cover in 2017" },
|
|
79
|
+
* { value: "2018", label: "Tree cover in 2018" },
|
|
80
|
+
* { value: "2019", label: "Tree cover in 2019" },
|
|
81
|
+
* { value: "2020", label: "Tree cover in 2020" },
|
|
82
|
+
* { value: "2021", label: "Tree cover in 2021" }
|
|
83
|
+
* ];
|
|
84
|
+
*
|
|
85
|
+
* valuePickerLabel.items = labelItems;
|
|
86
|
+
*
|
|
87
|
+
* valuePickerLabel.currentValue = labelItems[0];
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* The user's interaction can be handled by monitoring the [arcgis-value-picker-label.currentValue](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-label/#currentValue) property.
|
|
91
|
+
*
|
|
92
|
+
* ```js
|
|
93
|
+
* valuePickerLabel.addEventListener("arcgisPropertyChange", () => {
|
|
94
|
+
* const year = Number(valuePickerLabel.currentValue.value);
|
|
95
|
+
* mapElement.view.timeExtent = {
|
|
96
|
+
* start: new Date(year, 0, 1),
|
|
97
|
+
* end: new Date(year + 1, 0, 1),
|
|
98
|
+
* };
|
|
99
|
+
* console.log("The current year is: ", valuePickerLabel.currentValue.value);
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* #### 2. Using a slider component to traverse a list of items
|
|
104
|
+
*
|
|
105
|
+
* Consider using the [arcgis-value-picker-slider](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-slider/) component to quickly traverse through a set of data
|
|
106
|
+
* that can be represented along a fixed numeric range. This is a good option for sets of elements spaced along an interval, or mutating
|
|
107
|
+
* a continuous parameter such as layer opacity.
|
|
108
|
+
*
|
|
109
|
+
* 
|
|
110
|
+
*
|
|
111
|
+
* ```js
|
|
112
|
+
* const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
|
|
113
|
+
*
|
|
114
|
+
* valuePickerSlider.steps = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
115
|
+
* valuePickerSlider.labels = [0, 20, 40, 60, 80, 100];
|
|
116
|
+
* valuePickerSlider.majorTicks = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
117
|
+
* valuePickerSlider.minorTicks = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95];
|
|
118
|
+
* valuePickerSlider.currentValue = 100;
|
|
119
|
+
* valuePickerSlider.labelFormatter = (value) => `${value}%`;
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* The user's interaction can be handled by monitoring the [arcgis-value-picker-slider.currentValue](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-slider/#currentValue) property.
|
|
123
|
+
*
|
|
124
|
+
* ```js
|
|
125
|
+
* valuePickerSlider.addEventListener("arcgisPropertyChange", () => {
|
|
126
|
+
* layer.opacity = valuePickerSlider.currentValue / 100;
|
|
127
|
+
* console.log("The current layer opacity is: ", valuePickerSlider.currentValue / 100);
|
|
128
|
+
* });
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* Note that [arcgis-value-picker-slider.labels](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-slider/#labels), [arcgis-value-picker-slider.majorTicks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-slider/#majorTicks), and [arcgis-value-picker-slider.minorTicks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-slider/#minorTicks)
|
|
132
|
+
* are all independent of each other and optional.
|
|
133
|
+
*
|
|
134
|
+
* #### 3. Using a combobox component to select from a list of items
|
|
135
|
+
*
|
|
136
|
+
* Consider using the [arcgis-value-picker-combobox](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-combobox/) component to step through a longer list of items that cannot be clicked through
|
|
137
|
+
* one by one. The combobox component allows the user to open the list as a dropdown and make a selection, or narrow the size of the list by searching for an element or keyword.
|
|
138
|
+
*
|
|
139
|
+
* 
|
|
140
|
+
*
|
|
141
|
+
* ```js
|
|
142
|
+
* const valuePickerCombobox = document.querySelector("arcgis-value-picker-combobox");
|
|
143
|
+
*
|
|
144
|
+
* const comboboxItems = [
|
|
145
|
+
* { value: "Bare", label: "Isolate Bare Ground Areas" },
|
|
146
|
+
* { value: "Built", label: "Isolate Built Areas" },
|
|
147
|
+
* { value: "Trees", label: "Isolate Trees" },
|
|
148
|
+
* { value: "Water", label: "Isolate Water Areas" },
|
|
149
|
+
* { value: "Crops", label: "Isolate Crop Areas" },
|
|
150
|
+
* ];
|
|
151
|
+
*
|
|
152
|
+
* valuePickerCombobox.items = comboboxItems;
|
|
153
|
+
*
|
|
154
|
+
* valuePickerCombobox.currentValue = comboboxItems[0];
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* The user's interaction can be handled by monitoring the [arcgis-value-picker-combobox.currentValue](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-combobox/#currentValue) property.
|
|
158
|
+
*
|
|
159
|
+
* ```js
|
|
160
|
+
* valuePickerCombobox.addEventListener("arcgisPropertyChange", () => {
|
|
161
|
+
* layer.rasterFunction = {
|
|
162
|
+
* functionName: valuePickerCombobox.currentValue.value,
|
|
163
|
+
* };
|
|
164
|
+
* console.log("The current land cover category is: ", valuePickerCombobox.currentValue.value);
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* #### 4. Using a collection component to step through an arbitrary set of data
|
|
169
|
+
*
|
|
170
|
+
* Consider using the [arcgis-value-picker-collection](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-collection/) component when a visual representation for the dataset is not necessary.
|
|
171
|
+
* This is also a good option for datasets already in the form of a [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/).
|
|
172
|
+
*
|
|
173
|
+
* 
|
|
174
|
+
*
|
|
175
|
+
* ```js
|
|
176
|
+
* const Collection = (await import("@arcgis/core/core/Collection.js")).default;
|
|
177
|
+
*
|
|
178
|
+
* const mapElement = document.querySelector("arcgis-map");
|
|
179
|
+
* const valuePickerCollection = document.querySelector("arcgis-value-picker-collection");
|
|
180
|
+
*
|
|
181
|
+
* const basemapCollection = new Collection(["topo-vector", "streets", "osm"]);
|
|
182
|
+
*
|
|
183
|
+
* valuePickerCollection.items = basemapCollection;
|
|
184
|
+
*
|
|
185
|
+
* valuePickerCollection.currentValue = "topo-vector";
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* The user's interaction can be handled by monitoring the [arcgis-value-picker-collection.currentValue](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker-collection/#currentValue) property.
|
|
189
|
+
*
|
|
190
|
+
* ```js
|
|
191
|
+
* valuePickerCollection.addEventListener("arcgisPropertyChange", () => {
|
|
192
|
+
* mapElement.basemap = valuePickerCollection.currentValue;
|
|
193
|
+
* console.log("The current basemap is: ", valuePickerCollection.currentValue);
|
|
194
|
+
* });
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* @slot - Default slot for adding a component to value-picker. User is responsible for positioning the content via CSS.
|
|
198
|
+
* @since 5.2
|
|
199
|
+
*/
|
|
200
|
+
export abstract class ArcgisValuePicker extends LitElement {
|
|
201
|
+
/**
|
|
202
|
+
* If true, the component will not be destroyed automatically when it is
|
|
203
|
+
* disconnected from the document. This is useful when you want to move the
|
|
204
|
+
* component to a different place on the page, or temporarily hide it. If this
|
|
205
|
+
* is set, make sure to call the [destroy()](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#destroy) method when you are done to
|
|
206
|
+
* prevent memory leaks.
|
|
207
|
+
*
|
|
208
|
+
* @default false
|
|
209
|
+
*/
|
|
210
|
+
accessor autoDestroyDisabled: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* When true, the component is visually withdrawn and cannot be interacted with. If the slotted component also has a `disabled` property,
|
|
213
|
+
* it will be kept in sync with this property.
|
|
214
|
+
*
|
|
215
|
+
* @default false
|
|
216
|
+
*/
|
|
217
|
+
accessor disabled: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* When set to `true`, the next button is not displayed.
|
|
220
|
+
*
|
|
221
|
+
* @default false
|
|
222
|
+
*/
|
|
223
|
+
accessor hideNextButton: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* When set to `true`, the play/pause button is not displayed.
|
|
226
|
+
*
|
|
227
|
+
* @default false
|
|
228
|
+
*/
|
|
229
|
+
accessor hidePlayButton: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* When set to `true`, the previous button is not displayed.
|
|
232
|
+
*
|
|
233
|
+
* @default false
|
|
234
|
+
*/
|
|
235
|
+
accessor hidePreviousButton: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Icon which represents the component.
|
|
238
|
+
*
|
|
239
|
+
* @default "list-rectangle"
|
|
240
|
+
*/
|
|
241
|
+
accessor icon: IconName;
|
|
242
|
+
/**
|
|
243
|
+
* The component's default label.
|
|
244
|
+
*
|
|
245
|
+
* @default ""
|
|
246
|
+
*/
|
|
247
|
+
accessor label: string | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* Indicates the axis that the Value Picker buttons should be oriented along.
|
|
250
|
+
*
|
|
251
|
+
* Horizontal layouts are best for wider components that don't require a lot of vertical space,
|
|
252
|
+
* or components that iterate from left to right over a dataset. Some examples of these are
|
|
253
|
+
* horizontal sliders, collapsable dropdowns, or label components.
|
|
254
|
+
*
|
|
255
|
+
* Vertical layouts are best for taller components or components that should iterate vertically.
|
|
256
|
+
* Some examples include vertical sliders or list components that require a larger space to allow the user to scroll through the list.
|
|
257
|
+
*
|
|
258
|
+
* @default "horizontal"
|
|
259
|
+
*/
|
|
260
|
+
accessor layout: Layout;
|
|
261
|
+
/**
|
|
262
|
+
* When set to `true`, playback will restart from the first element of the slotted component's dataset
|
|
263
|
+
* once it reaches the end. Note that this will not allow the Value Picker buttons to be used to manually loop back to the first element.
|
|
264
|
+
*
|
|
265
|
+
* @default false
|
|
266
|
+
*/
|
|
267
|
+
accessor loop: boolean;
|
|
268
|
+
/** @internal */
|
|
269
|
+
protected messages: {
|
|
270
|
+
componentLabel: string;
|
|
271
|
+
next: string;
|
|
272
|
+
previous: string;
|
|
273
|
+
play: string;
|
|
274
|
+
pause: string;
|
|
275
|
+
} & T9nMeta<{
|
|
276
|
+
componentLabel: string;
|
|
277
|
+
next: string;
|
|
278
|
+
previous: string;
|
|
279
|
+
play: string;
|
|
280
|
+
pause: string;
|
|
281
|
+
}>;
|
|
282
|
+
/**
|
|
283
|
+
* Specifies the interval, in milliseconds, on which the component will call `step("next")` on the slotted component.
|
|
284
|
+
*
|
|
285
|
+
* @default 1000
|
|
286
|
+
*/
|
|
287
|
+
accessor playRate: number;
|
|
288
|
+
/** The current state of the component. */
|
|
289
|
+
get state(): "playing" | "ready";
|
|
290
|
+
/** Permanently destroys the component. */
|
|
291
|
+
destroy(): Promise<void>;
|
|
292
|
+
/**
|
|
293
|
+
* Selects the next index from the slotted component's dataset.
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```js
|
|
297
|
+
* const valuePicker = document.querySelector("arcgis-value-picker");
|
|
298
|
+
* const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
|
|
299
|
+
*
|
|
300
|
+
* valuePickerSlider.steps = [1, 2, 3, 4, 5];
|
|
301
|
+
* valuePickerSlider.currentValue = 1;
|
|
302
|
+
*
|
|
303
|
+
* console.log(`Current value: ${valuePickerSlider.currentValue}`); // "Current value: 1"
|
|
304
|
+
* valuePicker.next();
|
|
305
|
+
* console.log(`Current value: ${valuePickerSlider.currentValue}`); // "Current value: 2"
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
next(): void;
|
|
309
|
+
/** Stops the component from playing. */
|
|
310
|
+
pause(): void;
|
|
311
|
+
/**
|
|
312
|
+
* Start playing. Value Picker will call `step("next")` on the slotted component at an interval defined by [playRate](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#playRate).
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```js
|
|
316
|
+
* // Start a continuously looping ValuePicker.
|
|
317
|
+
* const valuePicker = document.querySelector("arcgis-value-picker");
|
|
318
|
+
* const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
|
|
319
|
+
*
|
|
320
|
+
* valuePickerSlider.steps = [1, 2, 3];
|
|
321
|
+
* valuePickerSlider.currentValue = 1;
|
|
322
|
+
* valuePicker.loop = true;
|
|
323
|
+
*
|
|
324
|
+
* valuePickerSlider.addEventListener("arcgisPropertyChange", () => {
|
|
325
|
+
* console.log(valuePickerSlider.currentValue);
|
|
326
|
+
* });
|
|
327
|
+
*
|
|
328
|
+
* valuePicker.play();
|
|
329
|
+
* // output: 1, 2, 3, 1, 2, 3, 1...
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
play(): void;
|
|
333
|
+
/**
|
|
334
|
+
* Selects the previous index from the slotted component's dataset.
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```js
|
|
338
|
+
* const valuePicker = document.querySelector("arcgis-value-picker");
|
|
339
|
+
* const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
|
|
340
|
+
*
|
|
341
|
+
* valuePickerSlider.steps = [1, 2, 3, 4, 5];
|
|
342
|
+
* valuePickerSlider.currentValue = 3;
|
|
343
|
+
*
|
|
344
|
+
* console.log(`Current value: ${valuePickerSlider.currentValue}`); // "Current value: 3"
|
|
345
|
+
* valuePicker.previous();
|
|
346
|
+
* console.log(`Current value: ${valuePickerSlider.currentValue}`); // "Current value: 2"
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
previous(): void;
|
|
350
|
+
/**
|
|
351
|
+
* Fires on each playback tick after the user presses the play button. The event payload contains `{ first: boolean }` and fires for
|
|
352
|
+
* the first time after [playRate](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#playRate) ms have elapsed since the user pressed the play button. Users should
|
|
353
|
+
* listen to this event to manually iterate an external dataset on an interval.
|
|
354
|
+
*/
|
|
355
|
+
readonly arcgisAnimate: import("@arcgis/lumina").TargetedEvent<this, AnimateEvent>;
|
|
356
|
+
/** Fires when the Value Picker's next button is pressed or when the [next()](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#next) method is invoked. */
|
|
357
|
+
readonly arcgisNext: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
358
|
+
/** Fires when the Value Picker's pause button is pressed or when the [pause()](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#pause) method is invoked. */
|
|
359
|
+
readonly arcgisPause: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
360
|
+
/** Fires when the Value Picker's play button is pressed or when the [play()](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#play) method is invoked. */
|
|
361
|
+
readonly arcgisPlay: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
362
|
+
/** Fires when the Value Picker's previous button is pressed or when the [previous()](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-value-picker/#previous) method is invoked. */
|
|
363
|
+
readonly arcgisPrevious: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
364
|
+
/** @copyDoc */
|
|
365
|
+
readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "layout" | "loop" | "playRate" | "state"; }>;
|
|
366
|
+
/** Fires when the contents of Value Picker's slot changes. */
|
|
367
|
+
readonly arcgisSlottedElementChange: import("@arcgis/lumina").TargetedEvent<this, { slottedElement: ArcgisValuePickerSubcomponent | undefined; }>;
|
|
368
|
+
readonly "@eventTypes": {
|
|
369
|
+
arcgisAnimate: ArcgisValuePicker["arcgisAnimate"]["detail"];
|
|
370
|
+
arcgisNext: ArcgisValuePicker["arcgisNext"]["detail"];
|
|
371
|
+
arcgisPause: ArcgisValuePicker["arcgisPause"]["detail"];
|
|
372
|
+
arcgisPlay: ArcgisValuePicker["arcgisPlay"]["detail"];
|
|
373
|
+
arcgisPrevious: ArcgisValuePicker["arcgisPrevious"]["detail"];
|
|
374
|
+
arcgisPropertyChange: ArcgisValuePicker["arcgisPropertyChange"]["detail"];
|
|
375
|
+
arcgisSlottedElementChange: ArcgisValuePicker["arcgisSlottedElementChange"]["detail"];
|
|
376
|
+
};
|
|
377
|
+
}
|