@arcgis/common-components 6.0.0-next.32 → 6.0.0-next.34
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/2K4XK5CC.js +2 -0
- package/dist/cdn/32JRESCI.js +2 -0
- package/dist/cdn/{7WN227WZ.js → 4L362IQJ.js} +24 -24
- package/dist/cdn/5TNOGXJJ.js +2 -0
- package/dist/cdn/D4JWM5PW.js +2 -0
- package/dist/cdn/E5VIZW6M.js +2 -0
- package/dist/cdn/{W7CWMG2O.js → HWVDNUPX.js} +1 -1
- package/dist/cdn/RYVWIAKZ.js +2 -0
- package/dist/cdn/UFSM3GRY.js +2 -0
- package/dist/cdn/WIOMW22N.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/intrinsic-sizing.js +18 -0
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +0 -9
- package/dist/components/arcgis-ckeditor5/customElement.js +1207 -1207
- package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +0 -6
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +14 -17
- package/dist/components/arcgis-color-input/customElement.d.ts +0 -20
- package/dist/components/arcgis-color-input/customElement.js +18 -18
- package/dist/components/arcgis-field-info/customElement.d.ts +0 -3
- package/dist/components/arcgis-field-info/customElement.js +41 -41
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +0 -28
- package/dist/components/arcgis-field-pick-list/customElement.js +114 -127
- package/dist/components/arcgis-slider-input/customElement.d.ts +0 -3
- package/dist/components/arcgis-slider-input/customElement.js +13 -13
- package/dist/components/arcgis-toolbar/customElement.d.ts +20 -0
- package/dist/components/arcgis-toolbar/customElement.js +40 -37
- package/dist/components/arcgis-toolbar-stack/customElement.d.ts +9 -2
- package/dist/components/arcgis-toolbar-stack/customElement.js +49 -51
- 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 +0 -20
- package/dist/loader.js +4 -4
- package/dist/types/lumina.d.ts +4 -30
- package/dist/types/preact.d.ts +4 -30
- package/dist/types/react.d.ts +4 -30
- package/dist/types/stencil.d.ts +4 -30
- package/dist/utils/types.d.ts +0 -12
- package/package.json +7 -7
- package/dist/cdn/2S4SSY4K.js +0 -2
- package/dist/cdn/3UAY23XT.js +0 -2
- package/dist/cdn/BMR5AH6W.js +0 -2
- package/dist/cdn/GZVXOCN5.js +0 -2
- package/dist/cdn/KEQPWVA6.js +0 -2
- package/dist/cdn/OUPGMHLD.js +0 -2
- package/dist/cdn/U6OGOB7D.js +0 -2
- package/dist/cdn/VNC7X43V.js +0 -2
- package/dist/chunks/toolbar.js +0 -9
- /package/dist/cdn/{DAAON2UO.js → UOXUUCE7.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as I } 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
|
-
import { LitElement as
|
|
6
|
-
import { createRef as
|
|
7
|
-
import { html as
|
|
5
|
+
import { LitElement as C, createEvent as f, renderElement as S, nothing as p, safeStyleMap as $, safeClassMap as b } from "@arcgis/lumina";
|
|
6
|
+
import { createRef as h, ref as d } from "lit/directives/ref.js";
|
|
7
|
+
import { html as o, css as x } from "lit";
|
|
8
8
|
import { Task as T } from "@lit/task";
|
|
9
|
-
import { log as w, composeMissingPropertyMessage as
|
|
10
|
-
import { F as
|
|
11
|
-
import { i as
|
|
12
|
-
import { u as
|
|
9
|
+
import { log as w, composeMissingPropertyMessage as B } from "@arcgis/toolkit/log";
|
|
10
|
+
import { F as L } from "../../chunks/internal-types.js";
|
|
11
|
+
import { i as E } from "../../chunks/general.js";
|
|
12
|
+
import { u as k } from "../../chunks/useT9n.js";
|
|
13
13
|
const r = /* @__PURE__ */ new Map();
|
|
14
14
|
r.set("oid", "key");
|
|
15
15
|
r.set("guid", "key");
|
|
@@ -27,57 +27,57 @@ 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
|
|
32
|
-
return !!
|
|
30
|
+
const N = ({ fieldType: n }) => o`<calcite-icon scale=s .icon=${r.get(n)}></calcite-icon>`;
|
|
31
|
+
function _(n) {
|
|
32
|
+
return !!n.length && "fields" in n[0];
|
|
33
33
|
}
|
|
34
|
-
function u(
|
|
35
|
-
return !!
|
|
34
|
+
function u(n) {
|
|
35
|
+
return !!n.length && "subFieldInfos" in n[0];
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function O(n) {
|
|
38
|
+
return n.filter((e) => u(e.fields));
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function M(n) {
|
|
41
|
+
return n.flatMap((e) => e.fields);
|
|
42
42
|
}
|
|
43
|
-
function A(
|
|
44
|
-
return
|
|
43
|
+
function A(n) {
|
|
44
|
+
return n.flatMap((e) => u(e.fields) ? [] : e.fields);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function m(n) {
|
|
47
|
+
return n.flatMap(
|
|
48
48
|
(e) => u(e.fields) ? e.fields.flatMap((t) => t.subFieldInfos) : e.fields
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
53
|
-
(
|
|
54
|
-
) : t.fields.filter((
|
|
51
|
+
function H(n, e) {
|
|
52
|
+
return n.flatMap((t) => u(t.fields) ? t.fields.flatMap(
|
|
53
|
+
(s) => s.subFieldInfos.filter((i) => g(i, e, !0))
|
|
54
|
+
) : t.fields.filter((s) => F(s, e)));
|
|
55
55
|
}
|
|
56
|
-
function F(
|
|
57
|
-
return e ? "subFieldInfos" in
|
|
56
|
+
function F(n, e) {
|
|
57
|
+
return e ? "subFieldInfos" in n ? g(n, e) || n.subFieldInfos.some((t) => g(t, e, !0)) : g(n, e) : !0;
|
|
58
58
|
}
|
|
59
|
-
function g(
|
|
60
|
-
return [t ?
|
|
61
|
-
(
|
|
59
|
+
function g(n, e, t = !1) {
|
|
60
|
+
return [t ? n.name.split("/").pop() : n.name, n.alias, n.description].some(
|
|
61
|
+
(i) => i?.toLocaleLowerCase().includes(e.toLocaleLowerCase())
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
class
|
|
64
|
+
const D = x`.panel{min-height:250px}.list-wrapper{max-height:50vh;overflow:auto}.list-controls{display:grid;grid-template-columns:1fr auto}.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}`;
|
|
65
|
+
class P extends C {
|
|
66
66
|
constructor() {
|
|
67
|
-
super(...arguments), this._messages =
|
|
67
|
+
super(...arguments), this._messages = k({ blocking: !0 }), this.popoverNode = h(), this.listWrapper = h(), this.listNode = h(), this.flowElement = h(), this.panelElement = h(), this.dropdownNode = h(), this.fieldInfoFlowItemEl = h(), this.allLists = [], this.filterText = "", this.panelCutOffHeight = 0, this.initialized = !1, this._propWatcherTask = new T(this, {
|
|
68
68
|
task: async ([e]) => {
|
|
69
|
-
if (!this.listOnly && !
|
|
70
|
-
throw w("error", this,
|
|
69
|
+
if (!this.listOnly && !E(e?.refElement))
|
|
70
|
+
throw w("error", this, B("popoverProps")), new Error();
|
|
71
71
|
this._propWatcherTask.autoRun = !1;
|
|
72
72
|
},
|
|
73
73
|
args: () => [this.popoverProps]
|
|
74
|
-
}), this.fields = [], this.selectedFields = [], this.listOnly = !1, this.showFieldInfo = !1, this.showFieldTypeIcon = !1, this.showFieldName = !1, this.showDescription = !1, this.showSelectionAll = !1, this.
|
|
74
|
+
}), this.fields = [], this.selectedFields = [], this.listOnly = !1, this.showFieldInfo = !1, this.showFieldTypeIcon = !1, this.showFieldName = !1, this.showDescription = !1, this.showSelectionAll = !1, this.hideCancel = !1, this.hideSort = !1, this.showFilterLength = 10, this.multiple = !1, this.sortBy = "default", this.arcgisChange = f(), this.arcgisClose = f(), this.arcgisDeleteField = f(), this.arcgisEditField = f(), this.arcgisSortByChange = f();
|
|
75
75
|
}
|
|
76
76
|
static {
|
|
77
|
-
this.properties = { lastSortBy: 16, filterFields: 16,
|
|
77
|
+
this.properties = { lastSortBy: 16, filterFields: 16, view: 0, layer: 0, fields: 0, selectedFields: 0, listOnly: 5, popoverProps: 0, showFieldInfo: 5, showFieldTypeIcon: 5, showFieldName: 5, showDescription: 5, showSelectionAll: 5, hideCancel: 5, hideSort: 5, showFilterLength: 9, multiple: 5, heading: 1, okBtnText: 1, filterPlaceholderText: 1, filterNoResultsText: 1, sortBy: 1, fieldsGroupHeading: 1, expressionsGroupHeading: 1, customExpressionCheck: 0 };
|
|
78
78
|
}
|
|
79
79
|
static {
|
|
80
|
-
this.styles =
|
|
80
|
+
this.styles = D;
|
|
81
81
|
}
|
|
82
82
|
async reposition() {
|
|
83
83
|
await this.popoverNode.value?.reposition();
|
|
@@ -91,7 +91,7 @@ class H extends I {
|
|
|
91
91
|
}), 1);
|
|
92
92
|
}
|
|
93
93
|
load() {
|
|
94
|
-
|
|
94
|
+
this.listOnly && this.showFieldInfo && (this.showFieldInfo = !1, w("info", this, "showFieldInfo is not supported if listOnly is true.")), !this.multiple && this.selectedFields.length > 1 && (this.selectedFields = [this.selectedFields[0]]), this.lastSortBy = this.sortBy ?? this.lastSortBy, this.updateGroupedLists(), this.initialized = !0;
|
|
95
95
|
}
|
|
96
96
|
willUpdate(e) {
|
|
97
97
|
this.initialized && (e.has("fields") || e.has("sortBy") || e.has("lastSortBy") || e.has("customExpressionCheck")) && (e.has("sortBy") && (this.lastSortBy = this.sortBy ?? this.lastSortBy), this.updateGroupedLists());
|
|
@@ -123,14 +123,14 @@ class H extends I {
|
|
|
123
123
|
}
|
|
124
124
|
getSortedList(e) {
|
|
125
125
|
let t = [...e];
|
|
126
|
-
const
|
|
127
|
-
return t = t.filter((
|
|
126
|
+
const s = t.filter((i) => i.type === "none");
|
|
127
|
+
return t = t.filter((i) => i.type !== "none"), this.lastSortBy === "display" ? t.sort((i, l) => i.alias.localeCompare(l.alias)) : this.lastSortBy === "field" ? t.sort((i, l) => i.name.localeCompare(l.name)) : this.lastSortBy === "type" && t.sort((i, l) => i.type.localeCompare(l.type)), t = t.concat(s), t;
|
|
128
128
|
}
|
|
129
129
|
isExpression(e) {
|
|
130
|
-
return this.customExpressionCheck ? this.customExpressionCheck(e) : e.name.includes(
|
|
130
|
+
return this.customExpressionCheck ? this.customExpressionCheck(e) : e.name.includes(L.expression);
|
|
131
131
|
}
|
|
132
132
|
canDeselectAll() {
|
|
133
|
-
const e =
|
|
133
|
+
const e = m(this.allLists);
|
|
134
134
|
return this.filterFields?.length ? this.filterContainsAll() : this.selectedFields.length === e.length;
|
|
135
135
|
}
|
|
136
136
|
filterContainsAll() {
|
|
@@ -138,11 +138,11 @@ class H extends I {
|
|
|
138
138
|
}
|
|
139
139
|
showFieldInfoCheck(e) {
|
|
140
140
|
const { layer: t } = this;
|
|
141
|
-
return this.showFieldInfo ? !(!t || this.isExpression(e) || e.name.includes(
|
|
141
|
+
return this.showFieldInfo ? !(!t || this.isExpression(e) || e.name.includes(L.relationship) || e.type === "none") : !1;
|
|
142
142
|
}
|
|
143
143
|
updateGroupedLists() {
|
|
144
144
|
if (this.fields)
|
|
145
|
-
if (this.allLists = [],
|
|
145
|
+
if (this.allLists = [], _(this.fields))
|
|
146
146
|
for (const e of this.fields) {
|
|
147
147
|
if (this.listOnly && u(e.fields)) {
|
|
148
148
|
w("error", this, "subFieldInfos are not supported if listOnly is true.");
|
|
@@ -154,16 +154,7 @@ class H extends I {
|
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
else
|
|
157
|
-
this.allLists =
|
|
158
|
-
{
|
|
159
|
-
title: this.expressionsGroupHeading,
|
|
160
|
-
fields: [...this.getSortedList(this.fields)].filter((e) => this.isExpression(e))
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
title: this.fieldsGroupHeading,
|
|
164
|
-
fields: [...this.getSortedList(this.fields)].filter((e) => !this.isExpression(e))
|
|
165
|
-
}
|
|
166
|
-
] : [
|
|
157
|
+
this.allLists = [
|
|
167
158
|
{
|
|
168
159
|
title: void 0,
|
|
169
160
|
fields: this.getSortedList(this.fields)
|
|
@@ -173,32 +164,32 @@ class H extends I {
|
|
|
173
164
|
getSortedGroupFields(e) {
|
|
174
165
|
return u(e) ? this.getSortedList(e).map((t) => ({
|
|
175
166
|
...t,
|
|
176
|
-
subFieldInfos: this.getSortedList(t.subFieldInfos).map((
|
|
177
|
-
...
|
|
167
|
+
subFieldInfos: this.getSortedList(t.subFieldInfos).map((s) => ({
|
|
168
|
+
...s,
|
|
178
169
|
// ensure uniqueness
|
|
179
|
-
name: `${t.name}/${
|
|
170
|
+
name: `${t.name}/${s.name}`
|
|
180
171
|
}))
|
|
181
172
|
})) : this.getSortedList(e);
|
|
182
173
|
}
|
|
183
174
|
addFieldInfoFlowItem(e, t) {
|
|
184
|
-
const
|
|
175
|
+
const s = this.flowElement.value, i = S(o`<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
176
|
l.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
186
177
|
t.setFocus();
|
|
187
178
|
}, 300);
|
|
188
|
-
}} ${d(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang ??
|
|
189
|
-
|
|
179
|
+
}} ${d(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang ?? p} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);
|
|
180
|
+
s.appendChild(i), this.panelElement.value.selected = !1, setTimeout(() => {
|
|
190
181
|
this.fieldInfoFlowItemEl?.value.setFocus();
|
|
191
182
|
}, 1);
|
|
192
183
|
}
|
|
193
184
|
addSubFieldInfoFlowItem(e, t) {
|
|
194
|
-
const
|
|
185
|
+
const s = this.flowElement.value, i = e.subFieldInfos.filter((a) => g(a, this.filterText, !0)), l = S(o`<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) => {
|
|
195
186
|
a.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
196
187
|
t.setFocus();
|
|
197
188
|
}, 300);
|
|
198
189
|
}} ${d(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias ?? e.name} .selectionMode=${this.multiple ? "multiple" : "single"} @calciteListChange=${(a) => {
|
|
199
|
-
this.updateSelectedFieldsForList(a.currentTarget, e.subFieldInfos), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.
|
|
200
|
-
}}>${
|
|
201
|
-
|
|
190
|
+
this.updateSelectedFieldsForList(a.currentTarget, e.subFieldInfos), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.multiple || this.arcgisClose.emit({ selectedFields: this.selectedFields });
|
|
191
|
+
}}>${i.map((a) => this.renderCalciteListItem(a, !1))}</calcite-list>${this.filterText && !i.length && this.filterNoResultsText?.length !== 0 ? o`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}</calcite-flow-item>`);
|
|
192
|
+
s.appendChild(l), this.panelElement.value.selected = !1, setTimeout(() => {
|
|
202
193
|
this.fieldInfoFlowItemEl.value?.setFocus();
|
|
203
194
|
}, 1);
|
|
204
195
|
}
|
|
@@ -206,24 +197,24 @@ class H extends I {
|
|
|
206
197
|
return this.multiple && this.showSelectionAll && (!e || !this.filterText || !!this.filterFields?.length);
|
|
207
198
|
}
|
|
208
199
|
handleListSelectionChange(e) {
|
|
209
|
-
this.updateSelectedFieldsForList(this.listNode.value, e), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.
|
|
200
|
+
this.updateSelectedFieldsForList(this.listNode.value, e), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.multiple || this.arcgisClose.emit({ selectedFields: this.selectedFields });
|
|
210
201
|
}
|
|
211
202
|
updateSelectedFieldsForList(e, t) {
|
|
212
|
-
const
|
|
213
|
-
this.selectedFields = this.multiple ? [.../* @__PURE__ */ new Set([...l, ...a])] :
|
|
203
|
+
const s = new Set(t.map((c) => c.name)), i = e.selectedItems.map((c) => c.value), l = this.selectedFields.filter((c) => !s.has(c) || i.includes(c)), a = i.filter((c) => !this.selectedFields.includes(c));
|
|
204
|
+
this.selectedFields = this.multiple ? [.../* @__PURE__ */ new Set([...l, ...a])] : i, this.reorderSelectedFieldsByCurrentListOrder();
|
|
214
205
|
}
|
|
215
206
|
setSortBy(e) {
|
|
216
|
-
this.lastSortBy = e, this.updateGroupedLists(), this.arcgisSortByChange.emit(this.lastSortBy), this.
|
|
207
|
+
this.lastSortBy = e, this.updateGroupedLists(), this.arcgisSortByChange.emit(this.lastSortBy), this.reorderSelectedFieldsByCurrentListOrder() && this.arcgisChange.emit({ selectedFields: this.selectedFields });
|
|
217
208
|
}
|
|
218
209
|
reorderSelectedFieldsByCurrentListOrder() {
|
|
219
210
|
if (!this.selectedFields.length)
|
|
220
211
|
return !1;
|
|
221
|
-
const e =
|
|
212
|
+
const e = m(this.allLists).map((l) => l.name), t = new Set(this.selectedFields), s = e.filter((l) => t.has(l)), i = (
|
|
222
213
|
// adding/removing fields
|
|
223
|
-
|
|
224
|
-
|
|
214
|
+
s.length !== this.selectedFields.length || // reordering fields
|
|
215
|
+
s.some((l, a) => l !== this.selectedFields[a])
|
|
225
216
|
);
|
|
226
|
-
return
|
|
217
|
+
return i && (this.selectedFields = [...s]), i;
|
|
227
218
|
}
|
|
228
219
|
render() {
|
|
229
220
|
return this._propWatcherTask.render({
|
|
@@ -231,80 +222,76 @@ class H extends I {
|
|
|
231
222
|
if (this.listOnly)
|
|
232
223
|
return this.renderList();
|
|
233
224
|
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.popoverProps;
|
|
234
|
-
return this.el.classList.add("js-app-flyout"), v(`${t.autoClose}`,
|
|
235
|
-
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
236
|
-
}} ${d(this.popoverNode)}><calcite-flow style=${$({
|
|
225
|
+
return this.el.classList.add("js-app-flyout"), v(`${t.autoClose}`, o`<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=${() => this.arcgisClose.emit()} ${d(this.popoverNode)}><calcite-flow style=${$({
|
|
237
226
|
width: `${t.popoverWidth ?? t.refElement.getBoundingClientRect().width}px`,
|
|
238
227
|
...t.maxHeight && { maxHeight: t.maxHeight }
|
|
239
|
-
})} ${d(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${() => {
|
|
240
|
-
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
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>`);
|
|
228
|
+
})} ${d(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${() => this.arcgisClose.emit()} ${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) && o`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple && !this.hideCancel ? o`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>` : o`${this.renderAddButton()}${this.renderCancelButton()}`}</div>` || ""}</calcite-flow-item></calcite-flow></calcite-popover>`);
|
|
242
229
|
},
|
|
243
230
|
error: () => ""
|
|
244
231
|
});
|
|
245
232
|
}
|
|
246
233
|
renderList() {
|
|
247
|
-
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = A(this.allLists),
|
|
248
|
-
return t.length ||
|
|
234
|
+
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = A(this.allLists), s = O(this.allLists), i = m(this.allLists).length >= this.showFilterLength;
|
|
235
|
+
return t.length || s.length ? s.length ? this.renderSplitLists(t, s, i) : this.renderTopLevelOnlyFieldList(e, t, i) : o`<slot name=no-fields></slot>`;
|
|
249
236
|
}
|
|
250
|
-
renderSplitLists(e, t,
|
|
251
|
-
const
|
|
252
|
-
return
|
|
253
|
-
this.filterText = a.currentTarget.value, this.filterFields = this.filterText ?
|
|
254
|
-
}}></calcite-filter>${this.renderSortButton()}</div>` : null}<div class=${
|
|
237
|
+
renderSplitLists(e, t, s) {
|
|
238
|
+
const i = m(this.allLists), l = M(this.allLists).some((a) => F(a, this.filterText));
|
|
239
|
+
return o`${s ? o`<div class="list-controls"><calcite-filter .items=${i} .filterProps=${["name", "alias", "description"]} .placeholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteFilterChange=${(a) => {
|
|
240
|
+
this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? H(this.allLists, this.filterText).map((c) => c.name) : void 0;
|
|
241
|
+
}}></calcite-filter>${this.renderSortButton()}</div>` : null}<div class=${b(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(s) ? this.renderSelectionButton() : null}${this.renderSplitSubFieldLists(t)}${e.length ? this.renderSplitTopLevelFieldList(e, !0) : null}</div>${this.filterText && !l && this.filterNoResultsText?.length !== 0 ? o`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
|
|
255
242
|
}
|
|
256
243
|
renderSplitSubFieldLists(e) {
|
|
257
|
-
const t = e.map((
|
|
258
|
-
...
|
|
259
|
-
fields:
|
|
260
|
-
})).filter((
|
|
261
|
-
return y(t, (
|
|
262
|
-
l.key === "Enter" && this.addSubFieldInfoFlowItem(
|
|
244
|
+
const t = e.map((s) => ({
|
|
245
|
+
...s,
|
|
246
|
+
fields: s.fields.filter((i) => F(i, this.filterText))
|
|
247
|
+
})).filter((s) => !!s.fields.length);
|
|
248
|
+
return y(t, (s) => s.title, (s) => o`<calcite-list selection-mode=none .label=${s.title ?? this.heading ?? ""}><calcite-list-item-group .heading=${s.title}>${y(s.fields, (i) => i.name, (i) => o`<calcite-list-item .label=${i.alias || i.name} .description=${this.multiple ? this._messages.subFieldsSelected.replace("${count}", `${i.subFieldInfos.filter((l) => this.selectedFields.includes(l.name)).length}`) : void 0} .value=${i.name} @click=${(l) => this.addSubFieldInfoFlowItem(i, l.currentTarget)} @keydown=${(l) => {
|
|
249
|
+
l.key === "Enter" && this.addSubFieldInfoFlowItem(i, l.currentTarget);
|
|
263
250
|
}}><calcite-icon slot=actions-end icon=chevron-right flip-rtl scale=s></calcite-icon></calcite-list-item>`)}</calcite-list-item-group></calcite-list>`);
|
|
264
251
|
}
|
|
265
252
|
renderSplitTopLevelFieldList(e, t) {
|
|
266
|
-
return
|
|
253
|
+
return o`<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>`;
|
|
267
254
|
}
|
|
268
|
-
renderTopLevelOnlyFieldList(e, t,
|
|
269
|
-
return
|
|
270
|
-
|
|
271
|
-
}} ${d(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(
|
|
255
|
+
renderTopLevelOnlyFieldList(e, t, s) {
|
|
256
|
+
return o`<div class=${b(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}><calcite-list .label=${e} .selectionMode=${this.multiple ? "multiple" : "single"} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteListChange=${() => this.handleListSelectionChange(t)} @calciteListFilter=${(i) => {
|
|
257
|
+
i.stopPropagation(), this.filterFields = this.listNode.value.filteredItems?.map((l) => l.value), this.filterText = this.listNode.value.filterText;
|
|
258
|
+
}} ${d(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(s) ? this.renderSelectionButton() : null}<slot name=content-center></slot>${this.renderGroupedListItems(!1)}</calcite-list></div>`;
|
|
272
259
|
}
|
|
273
260
|
renderSortButton(e) {
|
|
274
|
-
const t =
|
|
261
|
+
const t = m(this.allLists);
|
|
275
262
|
if (!(t.length >= this.showFilterLength && !this.hideSort))
|
|
276
263
|
return "";
|
|
277
|
-
const
|
|
278
|
-
return
|
|
264
|
+
const i = t.every((l) => !!l.type);
|
|
265
|
+
return o`<calcite-action id=sort-action slot=${e ?? p} .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? p}><calcite-icon scale=s icon=sort-descending flip-rtl></calcite-icon></calcite-action><calcite-dropdown placement=bottom-end overlay-positioning=fixed reference-element=sort-action @calciteDropdownOpen=${() => {
|
|
279
266
|
this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
|
|
280
|
-
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><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>${
|
|
267
|
+
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><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>${i && o`<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>`;
|
|
281
268
|
}
|
|
282
269
|
renderSelectionButton() {
|
|
283
|
-
return
|
|
270
|
+
return o`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${() => {
|
|
284
271
|
if (this.canDeselectAll())
|
|
285
272
|
this.selectedFields = this.filterFields?.length ? this.selectedFields.filter((e) => !this.filterFields?.includes(e)) : [];
|
|
286
273
|
else if (this.filterFields?.length)
|
|
287
274
|
this.selectedFields = [.../* @__PURE__ */ new Set([...this.selectedFields, ...this.filterFields])];
|
|
288
275
|
else {
|
|
289
|
-
const t =
|
|
290
|
-
this.selectedFields = t.map((
|
|
276
|
+
const t = m(this.allLists);
|
|
277
|
+
this.selectedFields = t.map((s) => s.name);
|
|
291
278
|
}
|
|
292
|
-
this.reorderSelectedFieldsByCurrentListOrder(), this.arcgisChange.emit({ selectedFields: this.selectedFields })
|
|
279
|
+
this.reorderSelectedFieldsByCurrentListOrder(), this.arcgisChange.emit({ selectedFields: this.selectedFields });
|
|
293
280
|
}}>${this.canDeselectAll() ? this._messages.deselectAll : this._messages.selectAll}</calcite-button></div>`;
|
|
294
281
|
}
|
|
295
282
|
renderGroupedListItems(e) {
|
|
296
|
-
const t = this.allLists.filter((
|
|
297
|
-
...
|
|
298
|
-
fields: e ?
|
|
299
|
-
})).filter((
|
|
300
|
-
return t.length === 1 && !t[0].title ? this.renderListItems(t[0].fields) : t.map((
|
|
283
|
+
const t = this.allLists.filter((s) => !!s.fields.length && !u(s.fields)).map((s) => ({
|
|
284
|
+
...s,
|
|
285
|
+
fields: e ? s.fields.filter((i) => F(i, this.filterText)) : s.fields
|
|
286
|
+
})).filter((s) => !!s.fields.length);
|
|
287
|
+
return t.length === 1 && !t[0].title ? this.renderListItems(t[0].fields) : t.map((i) => o`<calcite-list-item-group .heading=${i.title}>${this.renderListItems(i.fields)}</calcite-list-item-group>`);
|
|
301
288
|
}
|
|
302
289
|
renderListItems(e) {
|
|
303
290
|
return e.map((t) => this.renderCalciteListItem(t));
|
|
304
291
|
}
|
|
305
292
|
renderCalciteListItem(e, t = !0) {
|
|
306
|
-
const
|
|
307
|
-
return v(e.name,
|
|
293
|
+
const s = t && this.showFieldInfoCheck(e), i = this.showFieldTypeIcon && !!e.type;
|
|
294
|
+
return v(e.name, o`<calcite-list-item .label=${e.alias || e.name} .description=${(() => {
|
|
308
295
|
if (this.showFieldName && e.hideFieldName !== !0)
|
|
309
296
|
return `{${e.name}}`;
|
|
310
297
|
if (this.showDescription && e.hideDescription !== !0 && e.description)
|
|
@@ -312,40 +299,40 @@ class H extends I {
|
|
|
312
299
|
})()} .value=${e.name} .selected=${!this.multiple && e.name === this.selectedFields[0] || this.multiple && this.selectedFields.includes(e.name)} .metadata=${{
|
|
313
300
|
label: e.alias,
|
|
314
301
|
fieldName: e.name
|
|
315
|
-
}}>${
|
|
302
|
+
}}>${i && o`<div slot=actions-end class="field-icons">${N({ fieldType: e.type })}</div>` || ""}${this.renderInfoAction(e, s)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`);
|
|
316
303
|
}
|
|
317
304
|
renderInfoAction(e, t) {
|
|
318
|
-
const { _messages:
|
|
319
|
-
return t ?
|
|
320
|
-
|
|
321
|
-
const l =
|
|
305
|
+
const { _messages: s } = this;
|
|
306
|
+
return t ? o`<calcite-action slot=actions-end .text=${s.info} title=${s.info ?? p} scale=s icon=information @click=${(i) => {
|
|
307
|
+
i.stopPropagation();
|
|
308
|
+
const l = i.currentTarget;
|
|
322
309
|
this.addFieldInfoFlowItem(e, l);
|
|
323
310
|
}}></calcite-action>` : "";
|
|
324
311
|
}
|
|
325
312
|
renderEditAction(e) {
|
|
326
313
|
const { _messages: t } = this;
|
|
327
|
-
return e.showEditAction ?
|
|
328
|
-
|
|
314
|
+
return e.showEditAction ? o`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? p} scale=s icon=pencil @click=${(s) => {
|
|
315
|
+
s.stopPropagation(), this.arcgisEditField.emit({ fieldName: e.name });
|
|
329
316
|
}}></calcite-action>` : "";
|
|
330
317
|
}
|
|
331
318
|
renderDeleteAction(e) {
|
|
332
319
|
const { _messages: t } = this;
|
|
333
|
-
return e.showDeleteAction ?
|
|
334
|
-
|
|
320
|
+
return e.showDeleteAction ? o`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? p} scale=s icon=trash @click=${(s) => {
|
|
321
|
+
s.stopPropagation(), this.arcgisDeleteField.emit({ fieldName: e.name });
|
|
335
322
|
}}></calcite-action>` : "";
|
|
336
323
|
}
|
|
337
324
|
renderAddButton() {
|
|
338
|
-
return this.multiple ?
|
|
339
|
-
this.arcgisClose.emit({ selectedFields: this.selectedFields })
|
|
325
|
+
return this.multiple ? o`<calcite-button .appearance=${this.hideCancel ? "outline-fill" : "solid"} .width=${this.hideCancel ? "full" : "half"} @click=${() => {
|
|
326
|
+
this.arcgisClose.emit({ selectedFields: this.selectedFields });
|
|
340
327
|
}}>${this.okBtnText || (this.multiple ? this._messages.done : this._messages.ok)}</calcite-button>` : "";
|
|
341
328
|
}
|
|
342
329
|
renderCancelButton() {
|
|
343
|
-
return this.hideCancel ? "" :
|
|
344
|
-
this.arcgisClose.emit()
|
|
330
|
+
return this.hideCancel ? "" : o`<calcite-button appearance=outline-fill .width=${this.multiple ? "half" : "full"} @click=${() => {
|
|
331
|
+
this.arcgisClose.emit();
|
|
345
332
|
}}>${this._messages.cancel}</calcite-button>`;
|
|
346
333
|
}
|
|
347
334
|
}
|
|
348
|
-
|
|
335
|
+
I("arcgis-field-pick-list", P);
|
|
349
336
|
export {
|
|
350
|
-
|
|
337
|
+
P as ArcgisFieldPickList
|
|
351
338
|
};
|
|
@@ -55,12 +55,9 @@ export abstract class ArcgisSliderInput extends LitElement {
|
|
|
55
55
|
* @default false
|
|
56
56
|
*/
|
|
57
57
|
accessor withSteppers: boolean;
|
|
58
|
-
/** @deprecated use arcgisValueChange instead. */
|
|
59
|
-
readonly arcgisSliderInputValueChange: import("@arcgis/lumina").TargetedEvent<this, number>;
|
|
60
58
|
/** Emitted when the value has changed. */
|
|
61
59
|
readonly arcgisValueChange: import("@arcgis/lumina").TargetedEvent<this, number>;
|
|
62
60
|
readonly "@eventTypes": {
|
|
63
|
-
arcgisSliderInputValueChange: ArcgisSliderInput["arcgisSliderInputValueChange"]["detail"];
|
|
64
61
|
arcgisValueChange: ArcgisSliderInput["arcgisValueChange"]["detail"];
|
|
65
62
|
};
|
|
66
63
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import { c as d } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { debounce as
|
|
6
|
-
const
|
|
7
|
-
class
|
|
3
|
+
import { css as h, html as m } from "lit";
|
|
4
|
+
import { LitElement as o, createEvent as b } from "@arcgis/lumina";
|
|
5
|
+
import { debounce as $ } from "@arcgis/toolkit/function";
|
|
6
|
+
const f = h`.container{display:flex;align-items:center;justify-content:space-between;position:relative}.slider{width:50%}.input{width:45%}`;
|
|
7
|
+
class g extends o {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(...arguments), this.debouncedApplyValueOnChange =
|
|
9
|
+
super(...arguments), this.debouncedApplyValueOnChange = $((e) => this.applyValueOnChange(e), 800), this.disabled = !1, this.flipLabels = !1, this.scale = "s", this.min = 0, this.max = 100, this.value = 50, this.step = 1, this.withSteppers = !1, this.arcgisValueChange = b();
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
12
|
this.properties = { disabled: 5, label: 1, flipLabels: 5, scale: 1, min: 9, max: 9, value: 9, step: 9, unitsLabel: 1, withSteppers: 5 };
|
|
13
13
|
}
|
|
14
14
|
static {
|
|
15
|
-
this.styles =
|
|
15
|
+
this.styles = f;
|
|
16
16
|
}
|
|
17
17
|
applyValueOnChange(e) {
|
|
18
|
-
const { min:
|
|
19
|
-
s !== n && (e.value = `${
|
|
18
|
+
const { min: t, max: i, value: n } = this, s = Number(e.value), a = t !== void 0 && i !== void 0 ? Math.min(i, Math.max(t, s)) : s;
|
|
19
|
+
s !== n && (e.value = `${a}`, this.arcgisValueChange.emit(a), this.value = a);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
const { disabled: e, min:
|
|
23
|
-
return
|
|
22
|
+
const { disabled: e, min: t, max: i, value: n, step: s, withSteppers: a, flipLabels: c, unitsLabel: p, label: r, scale: u } = this;
|
|
23
|
+
return m`<div class="container"><calcite-slider class="slider" .disabled=${e} .min=${t} .max=${i} .value=${n} .step=${s} @calciteSliderInput=${(l) => this.debouncedApplyValueOnChange(l.currentTarget)}></calcite-slider><calcite-input class="input" .disabled=${e} .min=${t} .max=${i} .numberButtonType=${a ? "vertical" : "none"} .prefixText=${c ? p : ""} @calciteInputInput=${(l) => this.debouncedApplyValueOnChange(l.target)} @click=${(l) => l.stopPropagation()} .scale=${u} step=any .suffixText=${c ? "" : p} type=number .value=${`${n}`} .label=${r}></calcite-input></div>`;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
d("arcgis-slider-input",
|
|
26
|
+
d("arcgis-slider-input", g);
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
g as ArcgisSliderInput
|
|
29
29
|
};
|
|
@@ -13,6 +13,14 @@ import type { ActionBar as ActionBar } from "@esri/calcite-components/components
|
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
15
|
export abstract class ArcgisToolbar extends LitElement {
|
|
16
|
+
/**
|
|
17
|
+
* Main-axis budget in pixels. Undefined (the default) enables intrinsic sizing:
|
|
18
|
+
* CSS determines the host's size, and its observed content box supplies the budget.
|
|
19
|
+
* Specifying a value, including zero, disables intrinsic sizing and directly controls
|
|
20
|
+
* the budget used to collapse groups. CSS can still constrain the host.
|
|
21
|
+
* When managed by a stack, the stack owns sizing and allocation instead.
|
|
22
|
+
*/
|
|
23
|
+
accessor allocatedLength: number | undefined;
|
|
16
24
|
get barElement(): ActionBar | undefined;
|
|
17
25
|
/** Toolbar orientation. */
|
|
18
26
|
accessor layout: "horizontal" | "vertical";
|
|
@@ -57,6 +65,18 @@ export abstract class ArcgisToolbar extends LitElement {
|
|
|
57
65
|
* @internal
|
|
58
66
|
*/
|
|
59
67
|
measure(context: MeasurementContext): number[];
|
|
68
|
+
/**
|
|
69
|
+
* Intrinsic sizing needs only the collapsed and fully allocated lengths, not
|
|
70
|
+
* every combination of intermediate group lengths. Use allocation for both
|
|
71
|
+
* endpoints so forced-collapse priorities follow the same rules as rendering.
|
|
72
|
+
*
|
|
73
|
+
* @param context
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
measureIntrinsicSize(context: MeasurementContext): {
|
|
77
|
+
minimum: number;
|
|
78
|
+
maximum: number;
|
|
79
|
+
};
|
|
60
80
|
/**
|
|
61
81
|
* Render method used when the toolbar is managed by a toolbar stack.
|
|
62
82
|
*
|