@arcgis/coding-components 4.29.0-beta.107 → 4.29.0-beta.109
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/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-2c94e34e.js → p-09a0ee03.js} +2 -2
- package/dist/arcgis-coding-components/{p-94436a35.js → p-09dd5d6c.js} +1 -1
- package/dist/arcgis-coding-components/{p-599777f8.js → p-174178e7.js} +2 -2
- package/dist/arcgis-coding-components/{p-1f288af6.js → p-1cd316bf.js} +2 -2
- package/dist/arcgis-coding-components/p-690b6627.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-ee0405a5.js → p-adf98d20.js} +2 -2
- package/dist/arcgis-coding-components/{p-54956a0b.js → p-b14ac5b8.js} +10 -10
- package/dist/arcgis-coding-components/{p-91bbadd0.js → p-c089ef80.js} +3 -3
- package/dist/arcgis-coding-components/{p-a2dcc80b.js → p-c441923b.js} +1 -1
- package/dist/arcgis-coding-components/{p-4ab89e7d.js → p-dd629a57.js} +2 -2
- package/dist/arcgis-coding-components/{p-4990e8c6.js → p-ec85d134.js} +2 -2
- package/dist/arcgis-coding-components/{p-1e9a909a.js → p-ffc1ca6e.js} +2 -2
- package/dist/cjs/{arcade-defaults-da037f39.js → arcade-defaults-243f1d0c.js} +218 -193
- package/dist/cjs/{arcade-mode-84768b0f.js → arcade-mode-713ce2c3.js} +3 -3
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +35 -47
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- package/dist/cjs/{css-373c87ad.js → css-d9452f0e.js} +1 -1
- package/dist/cjs/{cssMode-174c6a14.js → cssMode-4ba5410f.js} +3 -3
- package/dist/cjs/{html-34d84912.js → html-fc5c516e.js} +3 -3
- package/dist/cjs/{htmlMode-560580bc.js → htmlMode-8437fe37.js} +3 -3
- package/dist/cjs/{index-a28e8c4d.js → index-1b175662.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-0e9272ba.js → javascript-94bf8806.js} +4 -4
- package/dist/cjs/{jsonMode-f03296f5.js → jsonMode-3528dffd.js} +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{tsMode-61a0f476.js → tsMode-fe693a2d.js} +3 -3
- package/dist/cjs/{typescript-3bc44ecc.js → typescript-2f8ed118.js} +3 -3
- package/dist/components/arcade-api.js +1 -1
- package/dist/components/arcade-contribution.js +2 -2
- package/dist/components/arcade-defaults.js +169 -152
- package/dist/components/arcade-mode.js +1 -1
- package/dist/components/arcade-results.js +2 -2
- package/dist/components/arcade-suggestions.js +1 -1
- package/dist/components/arcade-variables.js +19 -16
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +13 -29
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.js +1 -1
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/code-editor.js +1 -1
- package/dist/components/fields.js +10 -2
- package/dist/components/functional-components.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{arcade-defaults-b0a0d60e.js → arcade-defaults-2be262c3.js} +218 -193
- package/dist/esm/{arcade-mode-886ad2c6.js → arcade-mode-9b5533a2.js} +3 -3
- package/dist/esm/arcgis-arcade-api_6.entry.js +35 -47
- package/dist/esm/arcgis-coding-components.js +4 -4
- package/dist/esm/{css-97e0bca1.js → css-09aa6c3a.js} +1 -1
- package/dist/esm/{cssMode-af0b0322.js → cssMode-f90a1e62.js} +3 -3
- package/dist/esm/{html-5b306e7f.js → html-2dae6cf1.js} +3 -3
- package/dist/esm/{htmlMode-ade22305.js → htmlMode-7e3483f9.js} +3 -3
- package/dist/esm/{index-318ffb0c.js → index-23b528c2.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-e24d6f51.js → javascript-84611956.js} +4 -4
- package/dist/esm/{jsonMode-dcc1e54f.js → jsonMode-cdf283a8.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{tsMode-3c62ab70.js → tsMode-0c3bded5.js} +3 -3
- package/dist/esm/{typescript-b5ee74fa.js → typescript-6fb8a4c2.js} +3 -3
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +1 -7
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +0 -1
- package/dist/types/components.d.ts +2 -7
- package/dist/types/utils/arcade-monaco/arcade-theme.d.ts +1 -0
- package/dist/types/utils/profile/editor-profile.d.ts +49 -63
- package/dist/types/utils/profile/types.d.ts +122 -1
- package/dist/types/utils/profile/utils.d.ts +22 -9
- package/package.json +8 -8
- package/dist/arcgis-coding-components/p-0afd6c41.entry.js +0 -6
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
-
* v4.29.0-beta.
|
|
4
|
+
* v4.29.0-beta.109
|
|
5
5
|
*/
|
|
6
6
|
import { Emitter, Uri } from 'monaco-editor';
|
|
7
7
|
import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
|
|
8
|
-
import { i as
|
|
8
|
+
import { i as importLayersFeatureLayer, a as importRequest, s as supportedFields, n as newPortalPortalItem, b as newWebScene, c as newWebMap, f as fieldTypeToIconName, d as fieldTypeToArcadeType } from './fields.js';
|
|
9
9
|
import { p as portalItemPageUrl } from './utilities.js';
|
|
10
10
|
import { Y, e as ee, Z, K, E, N } from './index2.js';
|
|
11
11
|
import { getAssetPath } from '@stencil/core/internal/client';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
const PortalItem = await importPortalPortalItem();
|
|
15
|
-
return new PortalItem(definition);
|
|
16
|
-
}
|
|
13
|
+
//#region core adapter fix
|
|
17
14
|
async function newFeatureLayer(definition) {
|
|
18
15
|
const FeatureLayer = await importLayersFeatureLayer();
|
|
19
16
|
// Fix title for the layer. Instead of defaulting to the map viewer style.
|
|
20
17
|
return new FeatureLayer({ ...definition, sublayerTitleMode: "service-name" });
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return new WebMap(definition);
|
|
25
|
-
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region Type Guards
|
|
26
21
|
function isSupportedLayerInstance(item) {
|
|
27
22
|
return (!!item &&
|
|
28
23
|
typeof item === "object" &&
|
|
@@ -107,7 +102,6 @@ function isPredefinedProfile(item) {
|
|
|
107
102
|
typeof item.definitions === "object" &&
|
|
108
103
|
!Array.isArray(item.definitions));
|
|
109
104
|
}
|
|
110
|
-
|
|
111
105
|
function isTitleCapableSource(item) {
|
|
112
106
|
return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
|
|
113
107
|
}
|
|
@@ -143,7 +137,54 @@ function isLoadableSource(item) {
|
|
|
143
137
|
return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
|
|
144
138
|
}
|
|
145
139
|
//#endregion
|
|
146
|
-
//#region
|
|
140
|
+
//#region Service Metadata
|
|
141
|
+
async function supportedSourceFromDefinition(definition) {
|
|
142
|
+
if (!definition) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
let source = null;
|
|
146
|
+
if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
|
|
147
|
+
source = definition;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
source = await newFeatureLayer(definition);
|
|
151
|
+
}
|
|
152
|
+
if (isLoadableSource(source)) {
|
|
153
|
+
await source.load();
|
|
154
|
+
}
|
|
155
|
+
return source;
|
|
156
|
+
}
|
|
157
|
+
async function serviceMetaData(url) {
|
|
158
|
+
url += "/layers";
|
|
159
|
+
const request = await importRequest();
|
|
160
|
+
const response = await request(url, { responseType: "json", query: { f: "json" } });
|
|
161
|
+
const data = {
|
|
162
|
+
layers: response.data?.layers ?? [],
|
|
163
|
+
tables: response.data?.tables ?? []
|
|
164
|
+
};
|
|
165
|
+
const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
|
|
166
|
+
const layers = filterFeatureLayerInfos(data.layers, queryCapability);
|
|
167
|
+
const tables = filterFeatureLayerInfos(data.tables, queryCapability);
|
|
168
|
+
return { layers, tables };
|
|
169
|
+
}
|
|
170
|
+
function filterFeatureLayerInfos(layers, queryCapability) {
|
|
171
|
+
return layers.filter((layer) => {
|
|
172
|
+
if (layer.type !== "Feature Layer" && layer.type !== "Table") {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
const capabilities = layer.capabilities
|
|
176
|
+
? layer.capabilities
|
|
177
|
+
.toLowerCase()
|
|
178
|
+
.split(",")
|
|
179
|
+
.map((value) => value.trim())
|
|
180
|
+
: [];
|
|
181
|
+
return capabilities.includes(queryCapability);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region Support functions
|
|
147
188
|
async function getRelatedFeatureLayer(layer, relationship) {
|
|
148
189
|
const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
|
|
149
190
|
await relatedFeatureLayer.load();
|
|
@@ -184,64 +225,6 @@ function sortFields(layer) {
|
|
|
184
225
|
return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
|
|
185
226
|
};
|
|
186
227
|
}
|
|
187
|
-
function getTypeOrSubtypeDomainGroup(profile, types, field) {
|
|
188
|
-
// Try the coded domain first
|
|
189
|
-
if (isCodedValueDomainInstance(field.domain)) {
|
|
190
|
-
return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
|
|
191
|
-
}
|
|
192
|
-
// No coded domain, we will manufacture it
|
|
193
|
-
const values = types?.map((t) => {
|
|
194
|
-
const label = isSubtypeInstance(t) ? t.code : t.id;
|
|
195
|
-
return new ValueVariable({ profile, label: `${label}`, description: t.name, snippet: `"${label}"` });
|
|
196
|
-
}) ?? [];
|
|
197
|
-
return new GroupOfVariables(profile, { code: "subtypes" }, values);
|
|
198
|
-
}
|
|
199
|
-
function getCodedValueDomainGroup(profile, domain, label) {
|
|
200
|
-
const values = domain.codedValues.map((v) => new ValueVariable({
|
|
201
|
-
profile,
|
|
202
|
-
label: `${v.code}`,
|
|
203
|
-
description: v.name,
|
|
204
|
-
snippet: `"${v.code}"`,
|
|
205
|
-
filterDescription: true
|
|
206
|
-
}));
|
|
207
|
-
return new GroupOfVariables(profile, label, values);
|
|
208
|
-
}
|
|
209
|
-
function getDomainValuesGroup(profile, types, field) {
|
|
210
|
-
const variables = [];
|
|
211
|
-
if (!types || types.length === 0) {
|
|
212
|
-
return null;
|
|
213
|
-
}
|
|
214
|
-
types.forEach((type) => {
|
|
215
|
-
let domain = type.domains[field.name];
|
|
216
|
-
if (!domain) {
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
if (isInheritedDomainInstance(domain)) {
|
|
220
|
-
domain = field.domain;
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
if (!isCodedValueDomainInstance(domain)) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
|
|
227
|
-
code: "domainvaluesfortypeformat",
|
|
228
|
-
formatValues: {
|
|
229
|
-
fieldName: field.alias ?? field.name,
|
|
230
|
-
typeName: type.name
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
const id = isSubtypeInstance(type) ? type.code : type.id;
|
|
234
|
-
const label = `${id}`;
|
|
235
|
-
const snippet = `"${id}""`;
|
|
236
|
-
const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
|
|
237
|
-
subtypeDictionary.variables = [domainValuesGroup];
|
|
238
|
-
variables.push(subtypeDictionary);
|
|
239
|
-
});
|
|
240
|
-
if (!variables.length) {
|
|
241
|
-
return null;
|
|
242
|
-
}
|
|
243
|
-
return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
244
|
-
}
|
|
245
228
|
function areAllDomainsInherited(types, field) {
|
|
246
229
|
return types?.every((type) => type.domains[field.name]?.type === "inherited") ?? false;
|
|
247
230
|
}
|
|
@@ -260,52 +243,7 @@ function assembleMemberExpression(obj, prop) {
|
|
|
260
243
|
return `${obj}${getMemberExpressionProperty(prop)}`;
|
|
261
244
|
}
|
|
262
245
|
//#endregion
|
|
263
|
-
//#region
|
|
264
|
-
async function supportedSourceFromDefinition(definition) {
|
|
265
|
-
if (!definition) {
|
|
266
|
-
return null;
|
|
267
|
-
}
|
|
268
|
-
let source = null;
|
|
269
|
-
if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
|
|
270
|
-
source = definition;
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
source = await newFeatureLayer(definition);
|
|
274
|
-
}
|
|
275
|
-
if (isLoadableSource(source)) {
|
|
276
|
-
await source.load();
|
|
277
|
-
}
|
|
278
|
-
return source;
|
|
279
|
-
}
|
|
280
|
-
async function serviceMetaData(url) {
|
|
281
|
-
url += "/layers";
|
|
282
|
-
const request = await importRequest();
|
|
283
|
-
const response = await request(url, { responseType: "json", query: { f: "json" } });
|
|
284
|
-
const data = {
|
|
285
|
-
layers: response.data?.layers ?? [],
|
|
286
|
-
tables: response.data?.tables ?? []
|
|
287
|
-
};
|
|
288
|
-
const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
|
|
289
|
-
const layers = filterFeatureLayerInfos(data.layers, queryCapability);
|
|
290
|
-
const tables = filterFeatureLayerInfos(data.tables, queryCapability);
|
|
291
|
-
return { layers, tables };
|
|
292
|
-
}
|
|
293
|
-
function filterFeatureLayerInfos(layers, queryCapability) {
|
|
294
|
-
return layers.filter((layer) => {
|
|
295
|
-
if (layer.type !== "Feature Layer" && layer.type !== "Table") {
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
const capabilities = layer.capabilities
|
|
299
|
-
? layer.capabilities
|
|
300
|
-
.toLowerCase()
|
|
301
|
-
.split(",")
|
|
302
|
-
.map((value) => value.trim())
|
|
303
|
-
: [];
|
|
304
|
-
return capabilities.includes(queryCapability);
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
//#endregion
|
|
308
|
-
//#region Functions to Editor Variables to a language service variables
|
|
246
|
+
//#region Editor Profile to Language Service Profile functions
|
|
309
247
|
async function variablesToLSVariable(editorVariables, kind = CompletionItemKind.Variable) {
|
|
310
248
|
return await Promise.all(editorVariables.map(async (editorVariable) => {
|
|
311
249
|
switch (editorVariable.type) {
|
|
@@ -566,8 +504,9 @@ class ArrayVariable extends VariableBase {
|
|
|
566
504
|
* collection is ready or not.
|
|
567
505
|
*/
|
|
568
506
|
class CollectionBasedVariable extends VariableBase {
|
|
569
|
-
constructor() {
|
|
570
|
-
super(
|
|
507
|
+
constructor(owner, props) {
|
|
508
|
+
super(props);
|
|
509
|
+
this.owner = owner;
|
|
571
510
|
this.isCollection = true;
|
|
572
511
|
this._loaded = true;
|
|
573
512
|
/**
|
|
@@ -577,19 +516,21 @@ class CollectionBasedVariable extends VariableBase {
|
|
|
577
516
|
*/
|
|
578
517
|
this.variables = [];
|
|
579
518
|
}
|
|
519
|
+
get breadcrumb() {
|
|
520
|
+
// If there's an owner, prepend its breadcrumb and append the current name
|
|
521
|
+
if (this.owner) {
|
|
522
|
+
const ownerBreadcrumb = this.owner.breadcrumb;
|
|
523
|
+
return ownerBreadcrumb ? `${ownerBreadcrumb} / ${this.name}` : this.name;
|
|
524
|
+
}
|
|
525
|
+
// If there's no owner, this is the root element, so just return its name
|
|
526
|
+
return this.name;
|
|
527
|
+
}
|
|
580
528
|
/**
|
|
581
529
|
* Returns true if the collection has been loaded
|
|
582
530
|
*/
|
|
583
531
|
get loaded() {
|
|
584
532
|
return this._loaded;
|
|
585
533
|
}
|
|
586
|
-
/**
|
|
587
|
-
* Loads the items if the collection is asynchronous.
|
|
588
|
-
* If the colleciton is synchronous then the function is a no-op.
|
|
589
|
-
*/
|
|
590
|
-
async loadSource() {
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
534
|
/**
|
|
594
535
|
* Returns an url to the associated information
|
|
595
536
|
*/
|
|
@@ -612,8 +553,8 @@ class GroupOfVariables extends ProfileItemBase {
|
|
|
612
553
|
}
|
|
613
554
|
}
|
|
614
555
|
class DictionaryVariable extends CollectionBasedVariable {
|
|
615
|
-
constructor(props) {
|
|
616
|
-
super(props);
|
|
556
|
+
constructor(owner, props) {
|
|
557
|
+
super(owner, props);
|
|
617
558
|
this.type = "dictionary";
|
|
618
559
|
/**
|
|
619
560
|
* The variables that the dictionary holds. It is different than the variables.
|
|
@@ -627,6 +568,9 @@ class DictionaryVariable extends CollectionBasedVariable {
|
|
|
627
568
|
this.variables = [new GroupOfVariables(this._profile, this.snippet, this.dictionaryVariables)];
|
|
628
569
|
}
|
|
629
570
|
}
|
|
571
|
+
async loadSource() {
|
|
572
|
+
// No-op
|
|
573
|
+
}
|
|
630
574
|
loadPropertyDeclarations(declarations) {
|
|
631
575
|
this.dictionaryVariables = this.createVariableInstances(declarations);
|
|
632
576
|
this.variables = this.dictionaryVariables;
|
|
@@ -651,23 +595,26 @@ class DictionaryVariable extends CollectionBasedVariable {
|
|
|
651
595
|
case "text":
|
|
652
596
|
case "boolean":
|
|
653
597
|
case "date":
|
|
598
|
+
case "dateOnly":
|
|
599
|
+
case "time":
|
|
654
600
|
case "geometry":
|
|
601
|
+
case "knowledgeGraph":
|
|
655
602
|
return new ValueVariable({ profile: this._profile, declaration, label: snippet, snippet });
|
|
656
603
|
case "feature":
|
|
657
|
-
return new FeatureVariable({ profile: this._profile, declaration, label: snippet, snippet });
|
|
604
|
+
return new FeatureVariable(this, { profile: this._profile, declaration, label: snippet, snippet });
|
|
658
605
|
case "featureSet":
|
|
659
|
-
return new FeatureSetVariable({ profile: this._profile, declaration, label: snippet, snippet }, [
|
|
606
|
+
return new FeatureSetVariable(this, { profile: this._profile, declaration, label: snippet, snippet }, [
|
|
660
607
|
new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })
|
|
661
608
|
]);
|
|
662
609
|
case "featureSetCollection":
|
|
663
|
-
return new FeatureSetCollectionVariable({
|
|
610
|
+
return new FeatureSetCollectionVariable(this, {
|
|
664
611
|
profile: this._profile,
|
|
665
612
|
declaration,
|
|
666
613
|
label: snippet,
|
|
667
614
|
snippet
|
|
668
615
|
});
|
|
669
616
|
case "dictionary":
|
|
670
|
-
return new DictionaryVariable({
|
|
617
|
+
return new DictionaryVariable(this, {
|
|
671
618
|
profile: this._profile,
|
|
672
619
|
declaration,
|
|
673
620
|
label: snippet,
|
|
@@ -681,7 +628,7 @@ class DictionaryVariable extends CollectionBasedVariable {
|
|
|
681
628
|
snippet
|
|
682
629
|
});
|
|
683
630
|
default:
|
|
684
|
-
console.error("Invalid profile variable", declaration);
|
|
631
|
+
console.error("Editor profile: Invalid profile variable", declaration);
|
|
685
632
|
return null;
|
|
686
633
|
}
|
|
687
634
|
}
|
|
@@ -695,8 +642,8 @@ class DictionaryVariable extends CollectionBasedVariable {
|
|
|
695
642
|
}
|
|
696
643
|
}
|
|
697
644
|
class SourceBasedVariable extends CollectionBasedVariable {
|
|
698
|
-
constructor(props, relationshipsProperties) {
|
|
699
|
-
super(props);
|
|
645
|
+
constructor(owner, props, relationshipsProperties) {
|
|
646
|
+
super(owner, props);
|
|
700
647
|
this.relationshipsProperties = relationshipsProperties;
|
|
701
648
|
this._source = null;
|
|
702
649
|
this._loaded = false;
|
|
@@ -795,7 +742,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
795
742
|
// Sepcial case for the subtype field
|
|
796
743
|
if (field.name === this._source.subtypeField) {
|
|
797
744
|
const domainDictionary = this._createDomainDictionary(field);
|
|
798
|
-
domainDictionary.variables.push(
|
|
745
|
+
domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, field));
|
|
799
746
|
return domainDictionary;
|
|
800
747
|
}
|
|
801
748
|
// Check if all the domains for the field in the types are inherited.
|
|
@@ -805,7 +752,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
805
752
|
}
|
|
806
753
|
// We have domains per subtype
|
|
807
754
|
// We need to go thru each types and create a dictionary.
|
|
808
|
-
const domainValuesBySubtypeGroup =
|
|
755
|
+
const domainValuesBySubtypeGroup = this._getDomainValuesGroup(this._source.subtypes, field);
|
|
809
756
|
if (!domainValuesBySubtypeGroup) {
|
|
810
757
|
return null;
|
|
811
758
|
}
|
|
@@ -821,7 +768,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
821
768
|
// Special case for the type id field
|
|
822
769
|
if (field.name === this._source.typeIdField) {
|
|
823
770
|
const domainDictionary = this._createDomainDictionary(field);
|
|
824
|
-
domainDictionary.variables.push(
|
|
771
|
+
domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, field));
|
|
825
772
|
return domainDictionary;
|
|
826
773
|
}
|
|
827
774
|
// Check if all the domains for the field in the types are inherited.
|
|
@@ -831,7 +778,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
831
778
|
}
|
|
832
779
|
// We have domains per feature type
|
|
833
780
|
// We need to go thru each types and create a dictionary.
|
|
834
|
-
const domainValuesByFeatureTypeGroup =
|
|
781
|
+
const domainValuesByFeatureTypeGroup = this._getDomainValuesGroup(this._source.types, field);
|
|
835
782
|
if (!domainValuesByFeatureTypeGroup) {
|
|
836
783
|
return null;
|
|
837
784
|
}
|
|
@@ -848,24 +795,94 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
848
795
|
if (!isCodedValueDomainInstance(fieldDomain)) {
|
|
849
796
|
return null;
|
|
850
797
|
}
|
|
851
|
-
const domainValuesGroup =
|
|
798
|
+
const domainValuesGroup = this._getCodedValueDomainGroup(fieldDomain, {
|
|
852
799
|
code: "domainvalues"
|
|
853
800
|
});
|
|
854
801
|
const domainDictionary = this._createDomainDictionary(field);
|
|
855
802
|
domainDictionary.variables.push(domainValuesGroup);
|
|
856
803
|
return domainDictionary;
|
|
857
804
|
}
|
|
805
|
+
_getTypeOrSubtypeDomainGroup(types, field) {
|
|
806
|
+
// Try the coded domain first
|
|
807
|
+
if (isCodedValueDomainInstance(field.domain)) {
|
|
808
|
+
return this._getCodedValueDomainGroup(field.domain, { code: "subtypes" });
|
|
809
|
+
}
|
|
810
|
+
// No coded domain, we will manufacture it
|
|
811
|
+
const values = types?.map((t) => {
|
|
812
|
+
const label = isSubtypeInstance(t) ? t.code : t.id;
|
|
813
|
+
return new ValueVariable({
|
|
814
|
+
profile: this._profile,
|
|
815
|
+
label: `${label}`,
|
|
816
|
+
description: t.name,
|
|
817
|
+
snippet: `"${label}"`
|
|
818
|
+
});
|
|
819
|
+
}) ?? [];
|
|
820
|
+
return new GroupOfVariables(this._profile, { code: "subtypes" }, values);
|
|
821
|
+
}
|
|
822
|
+
_getCodedValueDomainGroup(domain, label) {
|
|
823
|
+
const values = domain.codedValues.map((v) => new ValueVariable({
|
|
824
|
+
profile: this._profile,
|
|
825
|
+
label: `${v.code}`,
|
|
826
|
+
description: v.name,
|
|
827
|
+
snippet: `"${v.code}"`,
|
|
828
|
+
filterDescription: true
|
|
829
|
+
}));
|
|
830
|
+
return new GroupOfVariables(this._profile, label, values);
|
|
831
|
+
}
|
|
832
|
+
_getDomainValuesGroup(types, field) {
|
|
833
|
+
const variables = [];
|
|
834
|
+
if (!types || types.length === 0) {
|
|
835
|
+
return null;
|
|
836
|
+
}
|
|
837
|
+
types.forEach((type) => {
|
|
838
|
+
let domain = type.domains[field.name];
|
|
839
|
+
if (!domain) {
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
if (isInheritedDomainInstance(domain)) {
|
|
843
|
+
domain = field.domain;
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
if (!isCodedValueDomainInstance(domain)) {
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
const domainValuesGroup = this._getCodedValueDomainGroup(domain, {
|
|
850
|
+
code: "domainvaluesfortypeformat",
|
|
851
|
+
formatValues: {
|
|
852
|
+
fieldName: field.alias ?? field.name,
|
|
853
|
+
typeName: type.name
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
const id = isSubtypeInstance(type) ? type.code : type.id;
|
|
857
|
+
const label = `${id}`;
|
|
858
|
+
const snippet = `"${id}""`;
|
|
859
|
+
const subtypeDictionary = new DictionaryVariable(this, {
|
|
860
|
+
profile: this._profile,
|
|
861
|
+
label,
|
|
862
|
+
snippet,
|
|
863
|
+
description: type.name,
|
|
864
|
+
declaration: { name: field.alias ?? field.name }
|
|
865
|
+
});
|
|
866
|
+
subtypeDictionary.variables = [domainValuesGroup];
|
|
867
|
+
variables.push(subtypeDictionary);
|
|
868
|
+
});
|
|
869
|
+
if (!variables.length) {
|
|
870
|
+
return null;
|
|
871
|
+
}
|
|
872
|
+
return new GroupOfVariables(this._profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
873
|
+
}
|
|
858
874
|
_createDomainDictionary(field) {
|
|
859
875
|
// Create the domain dictionary.
|
|
860
876
|
// The dictionary will have a header group and a value group.
|
|
861
877
|
// At this point we are only creating the header group in the dictionary.
|
|
862
878
|
const valueSnippet = this._getValueSnippet(field);
|
|
863
|
-
const domainDictionary = new DictionaryVariable({
|
|
879
|
+
const domainDictionary = new DictionaryVariable(this, {
|
|
864
880
|
profile: this._profile,
|
|
865
881
|
label: valueSnippet,
|
|
866
882
|
description: field.alias ?? field.name,
|
|
867
883
|
snippet: valueSnippet,
|
|
868
|
-
icon: "form-dropdown"
|
|
884
|
+
icon: "form-dropdown",
|
|
885
|
+
declaration: { name: field.alias ?? field.name }
|
|
869
886
|
});
|
|
870
887
|
// Add the header group
|
|
871
888
|
const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
|
|
@@ -909,7 +926,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
909
926
|
return null;
|
|
910
927
|
}
|
|
911
928
|
const snippet = `FeatureSetByRelationshipName(${this.snippet}, "${relationship.name}")`;
|
|
912
|
-
return new FeatureSetVariable({
|
|
929
|
+
return new FeatureSetVariable(this, {
|
|
913
930
|
profile: this._profile,
|
|
914
931
|
declaration: { definition: relatedLayer },
|
|
915
932
|
label: relatedLayer.title,
|
|
@@ -925,8 +942,8 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
925
942
|
}
|
|
926
943
|
}
|
|
927
944
|
class FeatureVariable extends SourceBasedVariable {
|
|
928
|
-
constructor(props) {
|
|
929
|
-
super(props, { exposeRelationships: true });
|
|
945
|
+
constructor(owner, props) {
|
|
946
|
+
super(owner, props, { exposeRelationships: true });
|
|
930
947
|
this.type = "feature";
|
|
931
948
|
}
|
|
932
949
|
get title() {
|
|
@@ -994,11 +1011,11 @@ class FeatureVariable extends SourceBasedVariable {
|
|
|
994
1011
|
}
|
|
995
1012
|
}
|
|
996
1013
|
class FeatureSetVariable extends SourceBasedVariable {
|
|
997
|
-
constructor(props, featureSetSnippets = [],
|
|
1014
|
+
constructor(owner, props, featureSetSnippets = [],
|
|
998
1015
|
// Relationships for feature set if only supported if the feature set is actually
|
|
999
1016
|
// representing a relationsip feature layer for a feature source.
|
|
1000
1017
|
relationshipProps) {
|
|
1001
|
-
super(props, relationshipProps);
|
|
1018
|
+
super(owner, props, relationshipProps);
|
|
1002
1019
|
this.featureSetSnippets = featureSetSnippets;
|
|
1003
1020
|
this.type = "featureSet";
|
|
1004
1021
|
}
|
|
@@ -1045,8 +1062,8 @@ class FeatureSetVariable extends SourceBasedVariable {
|
|
|
1045
1062
|
}
|
|
1046
1063
|
}
|
|
1047
1064
|
class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
1048
|
-
constructor(props) {
|
|
1049
|
-
super(props);
|
|
1065
|
+
constructor(owner, props) {
|
|
1066
|
+
super(owner, props);
|
|
1050
1067
|
this.type = "featureSetCollection";
|
|
1051
1068
|
this._featureSetCollections = null;
|
|
1052
1069
|
this._loaded = false;
|
|
@@ -1154,7 +1171,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1154
1171
|
};
|
|
1155
1172
|
}
|
|
1156
1173
|
async _featureSetCollectionFromPortalItem(definition) {
|
|
1157
|
-
const portalItem = await
|
|
1174
|
+
const portalItem = await newPortalPortalItem(definition);
|
|
1158
1175
|
await portalItem.load();
|
|
1159
1176
|
switch (portalItem.type) {
|
|
1160
1177
|
case "Web Map": {
|
|
@@ -1213,9 +1230,9 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1213
1230
|
return layerVariables;
|
|
1214
1231
|
}
|
|
1215
1232
|
_createFeatureSetVariable(featureLayer, isFromWebMap = false) {
|
|
1216
|
-
return new FeatureSetVariable({
|
|
1233
|
+
return new FeatureSetVariable(this, {
|
|
1217
1234
|
profile: this._profile,
|
|
1218
|
-
declaration: { definition: featureLayer },
|
|
1235
|
+
declaration: { name: featureLayer.title, definition: featureLayer },
|
|
1219
1236
|
label: featureLayer.title,
|
|
1220
1237
|
description: "",
|
|
1221
1238
|
nonInteractive: true
|
|
@@ -1253,7 +1270,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1253
1270
|
class EditorProfile extends DictionaryVariable {
|
|
1254
1271
|
constructor(definition, intlStrings, locale = "en") {
|
|
1255
1272
|
// Delay the load of the variable declarations so we have a `this`
|
|
1256
|
-
super({
|
|
1273
|
+
super(undefined, {
|
|
1257
1274
|
profile: null,
|
|
1258
1275
|
declaration: { properties: [] }
|
|
1259
1276
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
-
* v4.29.0-beta.
|
|
4
|
+
* v4.29.0-beta.109
|
|
5
5
|
*/
|
|
6
6
|
import { editor, MarkerSeverity, Range, languages, Emitter } from 'monaco-editor';
|
|
7
7
|
import { CompletionItemKind, DiagnosticSeverity, InsertTextFormat } from 'vscode-languageserver-types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
-
* v4.29.0-beta.
|
|
4
|
+
* v4.29.0-beta.109
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { e as importArcade, s as supportedFields } from './fields.js';
|
|
@@ -292,7 +292,7 @@ function jsonFormat(json) {
|
|
|
292
292
|
.replace(/\\(\d+)\\/gu, popFunc); // backslashes in strings
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
const arcadeResultsCss = ":host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2)}:host .flex-adjustable{flex:1 1 auto;overflow:hidden}:host .flex-row{display:flex;flex-direction:row;overflow:hidden}:host .flex-column{display:flex;flex-direction:column;overflow:hidden}:host .y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}:host header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}:host .ltr-container{direction:ltr}:host calcite-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group:last-child{border-inline-end-width:0px}:host calcite-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-color-foreground-1)}:host .color-info{color:var(--calcite-color-info)}:host .color-error{color:var(--calcite-color-danger)}:host .color-success{color:var(--calcite-color-success)}:host [class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-three-quarter)}:host .console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-three-quarter);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}:host .result-value-table table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap}:host .result-value-table table thead{background-color:var(--calcite-color-foreground-2)}:host .result-value-table table tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}:host .result-value-table table th,:host .result-value-table table td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-quarter)}:host .result-value-table table th .string-value,:host .result-value-table table td .string-value{white-space:pre}:host .result-value-table table th{font-weight:var(--calcite-font-weight-medium)}:host .tree-item-label,:host .number-value,:host .string-value,:host .boolean-value{font-family:var(--calcite-code-family)}:host .tree-item-label,:host .value-type{color:var(--calcite-text-2);font-weight:var(--calcite-font-weight-normal)}:host .dictionary-property{color:var(--arcgis-arcade-editor-identifier)}:host .number-value{color:var(--arcgis-arcade-editor-number)}:host .string-value{color:var(--arcgis-arcade-editor-string);white-space:pre-wrap}:host .constant-value{color:var(--arcgis-arcade-editor-constant)}:host .date-value{color:var(--arcgis-arcade-editor-date)}";
|
|
295
|
+
const arcadeResultsCss = ":host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2)}:host .flex-adjustable{flex:1 1 auto;overflow:hidden}:host .flex-row{display:flex;flex-direction:row;overflow:hidden}:host .flex-column{display:flex;flex-direction:column;overflow:hidden}:host .y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}:host header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}:host .ltr-container{direction:ltr}:host calcite-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group:last-child{border-inline-end-width:0px}:host calcite-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-color-foreground-1)}:host .color-info{color:var(--calcite-color-status-info)}:host .color-error{color:var(--calcite-color-status-danger)}:host .color-success{color:var(--calcite-color-status-success)}:host [class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-three-quarter)}:host .console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-three-quarter);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}:host .result-value-table table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap}:host .result-value-table table thead{background-color:var(--calcite-color-foreground-2)}:host .result-value-table table tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}:host .result-value-table table th,:host .result-value-table table td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-quarter)}:host .result-value-table table th .string-value,:host .result-value-table table td .string-value{white-space:pre}:host .result-value-table table th{font-weight:var(--calcite-font-weight-medium)}:host .tree-item-label,:host .number-value,:host .string-value,:host .boolean-value{font-family:var(--calcite-code-family)}:host .tree-item-label,:host .value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}:host .dictionary-property{color:var(--arcgis-arcade-editor-identifier)}:host .number-value{color:var(--arcgis-arcade-editor-number)}:host .string-value{color:var(--arcgis-arcade-editor-string);white-space:pre-wrap}:host .constant-value{color:var(--arcgis-arcade-editor-constant)}:host .date-value{color:var(--arcgis-arcade-editor-date)}";
|
|
296
296
|
|
|
297
297
|
//#region Specialized Constants
|
|
298
298
|
const treeProps = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
-
* v4.29.0-beta.
|
|
4
|
+
* v4.29.0-beta.109
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as generateColorizeStyles, o as onColorizeThemeChanged, c as convertMarkdownString, b as colorizeCodeElement } from './markdown.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
-
* v4.29.0-beta.
|
|
4
|
+
* v4.29.0-beta.109
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h } from '@stencil/core/internal/client';
|
|
7
7
|
import { S as StickyFilterInput } from './functional-components.js';
|
|
@@ -18,6 +18,11 @@ import '@esri/calcite-components/dist/components/calcite-flow.js';
|
|
|
18
18
|
|
|
19
19
|
const arcadeVariablesCss = ":host{background-color:var(--calcite-color-foreground-1)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-color-foreground-1)}:host .sticky{position:sticky;top:0px;z-index:10}:host calcite-flow{height:100%}";
|
|
20
20
|
|
|
21
|
+
function stopEnterPropagation(e) {
|
|
22
|
+
if (e.key === "Enter") {
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
21
26
|
const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeVariables extends HTMLElement {
|
|
22
27
|
constructor() {
|
|
23
28
|
super();
|
|
@@ -25,16 +30,14 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
25
30
|
this.__attachShadow();
|
|
26
31
|
this.close = createEvent(this, "close", 3);
|
|
27
32
|
this.itemSelected = createEvent(this, "itemSelected", 3);
|
|
28
|
-
|
|
29
|
-
this._updateFilterValue = (e) => (this._filterValue = e.target?.value ?? "");
|
|
33
|
+
this._updateFilterValue = (e) => (this._filterValue = e.target.value);
|
|
30
34
|
this._beforeBack = async () => {
|
|
31
35
|
this.removeLastPanelRenderer();
|
|
32
36
|
this._filterValue = "";
|
|
33
37
|
};
|
|
34
|
-
this._emitClose = () => this.close.emit();
|
|
35
|
-
this._backToTop = () => (this._flowItemRenderers = []);
|
|
38
|
+
this._emitClose = () => void this.close.emit();
|
|
39
|
+
this._backToTop = () => void (this._flowItemRenderers = []);
|
|
36
40
|
this._emitItemSelected = (e) => {
|
|
37
|
-
// @ts-expect-error
|
|
38
41
|
const variable = e.target?.["data-item"];
|
|
39
42
|
if (!variable || variable.nonInteractive) {
|
|
40
43
|
return;
|
|
@@ -45,13 +48,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
45
48
|
this.itemSelected.emit(variable.snippet);
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
|
-
this._stopEnterPropagation = (e) => {
|
|
49
|
-
if (e.key === "Enter") {
|
|
50
|
-
e.stopPropagation();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
51
|
this._showCollectionPanel = (e) => {
|
|
54
|
-
// @ts-expect-error
|
|
55
52
|
const collectionVariable = e.target?.["data-item"];
|
|
56
53
|
if (!collectionVariable) {
|
|
57
54
|
return;
|
|
@@ -120,12 +117,18 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
120
117
|
let loading = this.loading;
|
|
121
118
|
if (!loading && !collection.loaded) {
|
|
122
119
|
// Request to load and update mutation counter when done
|
|
123
|
-
collection
|
|
120
|
+
collection
|
|
121
|
+
.loadSource()
|
|
122
|
+
.then(() => setTimeout(() => {
|
|
124
123
|
this._mutationCounter += 1;
|
|
125
|
-
}))
|
|
124
|
+
}))
|
|
125
|
+
.catch(() => {
|
|
126
|
+
console.error("Error loading collection");
|
|
127
|
+
loading = false;
|
|
128
|
+
});
|
|
126
129
|
loading = true;
|
|
127
130
|
}
|
|
128
|
-
return (h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this._t9nStrings?.backtotop ?? "Back to top", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h(StickyFilterInput, { filterValue: this._filterValue, onCalciteInputInput: this._updateFilterValue }), loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (h("calcite-list", null, this.renderEditorVariables(collection)))));
|
|
131
|
+
return (h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, description: collection.breadcrumb, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this._t9nStrings?.backtotop ?? "Back to top", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h(StickyFilterInput, { filterValue: this._filterValue, onCalciteInputInput: this._updateFilterValue }), loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (h("calcite-list", null, this.renderEditorVariables(collection)))));
|
|
129
132
|
};
|
|
130
133
|
}
|
|
131
134
|
renderEditorVariables(collection) {
|
|
@@ -143,7 +146,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
143
146
|
// Group is a collection but we represent it differently
|
|
144
147
|
return (h("calcite-list-item-group", { heading: variable.getLabel() }, this.renderEditorVariables(variable)));
|
|
145
148
|
default:
|
|
146
|
-
return (h("calcite-list-item", { label: variable.getLabel(), description: variable.getDescription(), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": variable }, variable.isCollection ? (h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "", scale: "s", icon: "chevron-right", iconFlipRtl: true, onClick: this._showCollectionPanel, onKeyPress:
|
|
149
|
+
return (h("calcite-list-item", { label: variable.getLabel(), description: variable.getDescription(), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": variable }, variable.isCollection ? (h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "", scale: "s", icon: "chevron-right", iconFlipRtl: true, onClick: this._showCollectionPanel, onKeyPress: stopEnterPropagation, "data-item": variable })) : null, variable.icon ? h("calcite-icon", { icon: variable.icon, scale: "s", slot: "content-start" }) : null));
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
render() {
|