@arcgis/coding-components 4.29.0-beta.93 → 4.29.0-beta.94
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 +6 -1
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ar.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bg.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bs.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ca.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.cs.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.da.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.de.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.el.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.en.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.es.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.et.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fi.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.he.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hu.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.id.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.it.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ja.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ko.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lt.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lv.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nb.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nl.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pl.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-BR.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-PT.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ro.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ru.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sk.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sl.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sv.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.th.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.tr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.uk.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.vi.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-CN.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-HK.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-TW.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ar.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.bg.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.bs.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ca.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.cs.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.da.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.de.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.el.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.en.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.es.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.et.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.fi.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.fr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.he.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.hr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.hu.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.id.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.it.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ja.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ko.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.lt.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.lv.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.nb.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.nl.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pl.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pt-BR.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pt-PT.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ro.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ru.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sk.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sl.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sv.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.th.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.tr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.uk.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.vi.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-CN.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-HK.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-TW.json +9 -2
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +1 -1
- package/dist/arcgis-coding-components/index.esm.js +6 -1
- package/dist/arcgis-coding-components/{p-a1a4f5fc.js → p-06b7a85d.js} +6 -1
- package/dist/arcgis-coding-components/{p-4c959bce.js → p-22837217.js} +15 -10
- package/dist/arcgis-coding-components/{p-ccafed7f.js → p-2b1aca7c.js} +5 -0
- package/dist/arcgis-coding-components/{p-75ae922a.js → p-4c4149bc.js} +6 -1
- package/dist/arcgis-coding-components/{p-79707082.js → p-5fb23065.js} +6 -1
- package/dist/arcgis-coding-components/{p-009eaccf.js → p-8f020f20.js} +5 -0
- package/dist/arcgis-coding-components/p-a051ec0a.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-cdfe57a1.js → p-a17571b6.js} +6 -1
- package/dist/arcgis-coding-components/{p-1d062d47.js → p-a6429039.js} +6 -1
- package/dist/arcgis-coding-components/{p-590b795b.js → p-c2344fd6.js} +6 -1
- package/dist/arcgis-coding-components/{p-ca7059d4.js → p-d37fa51c.js} +6 -1
- package/dist/arcgis-coding-components/p-db60fe10.js +6 -0
- package/dist/cjs/{arcade-defaults-7faf4d5f.js → arcade-defaults-042fbece.js} +487 -362
- package/dist/cjs/{arcade-mode-26b8bc7a.js → arcade-mode-b495cb6f.js} +24 -20
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +176 -112
- package/dist/cjs/arcgis-coding-components.cjs.js +6 -1
- package/dist/cjs/{css-eb1c8e5c.js → css-19093b80.js} +5 -0
- package/dist/cjs/{cssMode-90f06d02.js → cssMode-ce70c012.js} +7 -2
- package/dist/cjs/{html-1aa8e458.js → html-04cbd899.js} +7 -2
- package/dist/cjs/{htmlMode-d3283acc.js → htmlMode-5e973c6f.js} +7 -2
- package/dist/cjs/{index-aaf14a3e.js → index-30445be8.js} +5 -0
- package/dist/cjs/index.cjs.js +7 -2
- package/dist/cjs/{javascript-7a4d9023.js → javascript-8717f18b.js} +8 -3
- package/dist/cjs/{jsonMode-73be73dc.js → jsonMode-b93b2667.js} +7 -2
- package/dist/cjs/loader.cjs.js +6 -1
- package/dist/cjs/{tsMode-95a699e0.js → tsMode-73e2fe2f.js} +7 -2
- package/dist/cjs/{typescript-588df930.js → typescript-a75c0ef4.js} +7 -2
- package/dist/components/arcade-api.js +11 -6
- package/dist/components/arcade-contribution.js +16 -6
- package/dist/components/arcade-defaults.js +243 -118
- package/dist/components/arcade-mode.js +22 -18
- package/dist/components/arcade-results.js +137 -85
- package/dist/components/arcade-suggestions.js +9 -4
- package/dist/components/arcade-variables.js +10 -5
- package/dist/components/arcgis-arcade-api.js +5 -0
- package/dist/components/arcgis-arcade-editor.js +20 -8
- package/dist/components/arcgis-arcade-results.js +5 -0
- package/dist/components/arcgis-arcade-suggestions.js +5 -0
- package/dist/components/arcgis-arcade-variables.js +5 -0
- package/dist/components/arcgis-code-editor.js +5 -0
- package/dist/components/code-editor.js +9 -4
- package/dist/components/fields.js +5 -0
- package/dist/components/functional-components.js +5 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index2.js +7 -2
- package/dist/components/markdown.js +5 -0
- package/dist/components/utilities.js +7 -2
- package/dist/esm/{arcade-defaults-0bc49d1c.js → arcade-defaults-106e7abf.js} +479 -354
- package/dist/esm/{arcade-mode-01365fb8.js → arcade-mode-a890a073.js} +24 -20
- package/dist/esm/arcgis-arcade-api_6.entry.js +176 -112
- package/dist/esm/arcgis-coding-components.js +7 -2
- package/dist/esm/{css-aade9167.js → css-5029659c.js} +5 -0
- package/dist/esm/{cssMode-edce5a89.js → cssMode-c3ebc40a.js} +7 -2
- package/dist/esm/{html-00b724af.js → html-13c9342a.js} +7 -2
- package/dist/esm/{htmlMode-ad3459b7.js → htmlMode-053279f0.js} +7 -2
- package/dist/esm/{index-3732acb8.js → index-c845e955.js} +5 -0
- package/dist/esm/index.js +7 -2
- package/dist/esm/{javascript-bdd52d83.js → javascript-c580af02.js} +8 -3
- package/dist/esm/{jsonMode-7b4c07fb.js → jsonMode-cd51566e.js} +7 -2
- package/dist/esm/loader.js +7 -2
- package/dist/esm/{tsMode-0bd06180.js → tsMode-c0164816.js} +7 -2
- package/dist/esm/{typescript-dfdad07a.js → typescript-7e6d57f4.js} +7 -2
- package/dist/loader/cdn.js +5 -1
- package/dist/loader/index.cjs.js +5 -1
- package/dist/loader/index.es2017.js +5 -1
- package/dist/loader/index.js +5 -1
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +1 -1
- package/dist/types/components/arcade-results/arcade-results.d.ts +0 -5
- package/dist/types/components.d.ts +3 -3
- package/dist/types/utils/arcade-executor.d.ts +12 -4
- package/dist/types/utils/arcade-monaco/arcade.worker.d.ts +6 -4
- package/dist/types/utils/profile/editor-profile.d.ts +10 -5
- package/dist/types/utils/profile/types.d.ts +3 -3
- package/dist/types/utils/profile/utils.d.ts +4 -0
- package/package.json +10 -10
- package/dist/arcgis-coding-components/p-86772125.js +0 -1
- package/dist/arcgis-coding-components/p-ac769046.entry.js +0 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
* v4.29.0-beta.94
|
|
5
|
+
*/
|
|
1
6
|
import { editor, MarkerSeverity, Range, languages, Emitter } from 'monaco-editor';
|
|
2
7
|
import { CompletionItemKind, DiagnosticSeverity, InsertTextFormat } from 'vscode-languageserver-types';
|
|
3
8
|
|
|
@@ -217,7 +222,7 @@ class DiagnosticsAdapter {
|
|
|
217
222
|
this._languageId = _languageId;
|
|
218
223
|
this._worker = _worker;
|
|
219
224
|
this._disposables = [];
|
|
220
|
-
this._listener =
|
|
225
|
+
this._listener = new Map();
|
|
221
226
|
this._diagnosticsService = diagnosticsService;
|
|
222
227
|
this._defaults = defaults;
|
|
223
228
|
const onModelAdd = (model) => {
|
|
@@ -226,19 +231,23 @@ class DiagnosticsAdapter {
|
|
|
226
231
|
return;
|
|
227
232
|
}
|
|
228
233
|
let handle;
|
|
229
|
-
this._listener
|
|
234
|
+
this._listener.set(model.uri.toString(), model.onDidChangeContent(() => {
|
|
230
235
|
window.clearTimeout(handle);
|
|
231
|
-
handle = window.setTimeout(
|
|
232
|
-
|
|
236
|
+
handle = window.setTimeout(() => {
|
|
237
|
+
this._doValidate(model, languageId).catch((err) => {
|
|
238
|
+
throw err;
|
|
239
|
+
});
|
|
240
|
+
}, 500);
|
|
241
|
+
}));
|
|
233
242
|
this._doValidate(model, languageId);
|
|
234
243
|
};
|
|
235
244
|
const onModelRemoved = (model) => {
|
|
236
245
|
const uriStr = model.uri.toString();
|
|
237
246
|
editor.setModelMarkers(model, this._languageId, []);
|
|
238
|
-
const listener = this._listener
|
|
247
|
+
const listener = this._listener.get(uriStr);
|
|
239
248
|
if (listener) {
|
|
240
249
|
listener.dispose();
|
|
241
|
-
|
|
250
|
+
this._listener.delete(uriStr);
|
|
242
251
|
}
|
|
243
252
|
};
|
|
244
253
|
this._disposables.push(editor.onDidCreateModel(onModelAdd));
|
|
@@ -266,15 +275,14 @@ class DiagnosticsAdapter {
|
|
|
266
275
|
}));
|
|
267
276
|
this._disposables.push({
|
|
268
277
|
dispose: () => {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
278
|
+
this._listener.forEach((value) => value.dispose());
|
|
279
|
+
this._listener.clear();
|
|
272
280
|
}
|
|
273
281
|
});
|
|
274
282
|
editor.getModels().forEach(onModelAdd);
|
|
275
283
|
}
|
|
276
284
|
dispose() {
|
|
277
|
-
this._disposables.forEach((d) => d
|
|
285
|
+
this._disposables.forEach((d) => d.dispose());
|
|
278
286
|
this._disposables = [];
|
|
279
287
|
}
|
|
280
288
|
async _doValidate(model, languageId) {
|
|
@@ -391,8 +399,9 @@ function toCompletionItemKind(kind) {
|
|
|
391
399
|
return mItemKind.Operator;
|
|
392
400
|
case CompletionItemKind.TypeParameter:
|
|
393
401
|
return mItemKind.TypeParameter;
|
|
402
|
+
default:
|
|
403
|
+
return mItemKind.Property;
|
|
394
404
|
}
|
|
395
|
-
return mItemKind.Property;
|
|
396
405
|
}
|
|
397
406
|
class CompletionProvider {
|
|
398
407
|
constructor(_worker, _defaults) {
|
|
@@ -407,9 +416,6 @@ class CompletionProvider {
|
|
|
407
416
|
const worker = await this._worker(model.uri);
|
|
408
417
|
const context = this._defaults.getApiContextForModel(model.uri);
|
|
409
418
|
const completionList = await worker.doComplete(model.uri.toString(), fromPosition(position), context);
|
|
410
|
-
if (!completionList) {
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
419
|
const wordInfo = model.getWordUntilPosition(position);
|
|
414
420
|
const wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
415
421
|
const items = completionList.items.map((entry) => {
|
|
@@ -474,9 +480,6 @@ class FormattingProvider {
|
|
|
474
480
|
const worker = await this._worker(model.uri);
|
|
475
481
|
const context = this._defaults.getApiContextForModel(model.uri.toString());
|
|
476
482
|
const edits = await worker.doFormat(model.uri.toString(), context);
|
|
477
|
-
if (!edits) {
|
|
478
|
-
return [];
|
|
479
|
-
}
|
|
480
483
|
return edits.map((e) => ({ range: toRange(e.range), text: e.newText }));
|
|
481
484
|
}
|
|
482
485
|
}
|
|
@@ -537,7 +540,8 @@ let arcadeWorker;
|
|
|
537
540
|
async function getArcadeWorker(...uris) {
|
|
538
541
|
return await new Promise((resolve, reject) => {
|
|
539
542
|
if (!arcadeWorker) {
|
|
540
|
-
|
|
543
|
+
reject(new Error("TypeScript not registered!"));
|
|
544
|
+
return;
|
|
541
545
|
}
|
|
542
546
|
resolve(arcadeWorker(...uris));
|
|
543
547
|
});
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
* v4.29.0-beta.94
|
|
5
|
+
*/
|
|
1
6
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
2
7
|
import { e as importArcade, s as supportedFields } from './fields.js';
|
|
3
|
-
import {
|
|
8
|
+
import { H, q, I, D } from './index2.js';
|
|
9
|
+
import '@esri/calcite-components/dist/components/calcite-tree.js';
|
|
10
|
+
import '@esri/calcite-components/dist/components/calcite-tree-item.js';
|
|
4
11
|
import '@esri/calcite-components/dist/components/calcite-loader.js';
|
|
5
12
|
import '@esri/calcite-components/dist/components/calcite-list.js';
|
|
6
13
|
import '@esri/calcite-components/dist/components/calcite-list-item.js';
|
|
7
14
|
import '@esri/calcite-components/dist/components/calcite-icon.js';
|
|
8
|
-
import '@esri/calcite-components/dist/components/calcite-tree.js';
|
|
9
|
-
import '@esri/calcite-components/dist/components/calcite-tree-item.js';
|
|
10
15
|
import '@esri/calcite-components/dist/components/calcite-action-bar.js';
|
|
11
16
|
import '@esri/calcite-components/dist/components/calcite-action-group.js';
|
|
12
17
|
import '@esri/calcite-components/dist/components/calcite-action.js';
|
|
@@ -16,46 +21,89 @@ const MaxArrayItems = 100;
|
|
|
16
21
|
const BatchSize = 100;
|
|
17
22
|
|
|
18
23
|
function isArcadeFeatureSet(value) {
|
|
19
|
-
return value
|
|
24
|
+
return (!!value &&
|
|
25
|
+
typeof value === "object" &&
|
|
26
|
+
"declaredRootClass" in value &&
|
|
27
|
+
typeof value.declaredRootClass === "string" &&
|
|
28
|
+
value.declaredRootClass === "esri.arcade.featureset.support.FeatureSet");
|
|
20
29
|
}
|
|
21
30
|
function isArcadeFeature(value) {
|
|
22
|
-
return value
|
|
31
|
+
return (!!value &&
|
|
32
|
+
typeof value === "object" &&
|
|
33
|
+
"arcadeDeclaredClass" in value &&
|
|
34
|
+
typeof value.arcadeDeclaredClass === "string" &&
|
|
35
|
+
value.arcadeDeclaredClass === "esri.arcade.Feature");
|
|
23
36
|
}
|
|
24
37
|
function isArcadeDictionary(value) {
|
|
25
|
-
return value
|
|
38
|
+
return (!!value &&
|
|
39
|
+
typeof value === "object" &&
|
|
40
|
+
"declaredClass" in value &&
|
|
41
|
+
typeof value.declaredClass === "string" &&
|
|
42
|
+
value.declaredClass === "esri.arcade.Dictionary");
|
|
26
43
|
}
|
|
27
44
|
function isGeometry(value) {
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
return (!!value &&
|
|
46
|
+
typeof value === "object" &&
|
|
47
|
+
"declaredClass" in value &&
|
|
48
|
+
typeof value.declaredClass === "string" &&
|
|
49
|
+
value.declaredClass.startsWith("esri.geometry."));
|
|
50
|
+
}
|
|
51
|
+
function isKnowledgeGraph(value) {
|
|
52
|
+
return (!!value &&
|
|
53
|
+
typeof value === "object" &&
|
|
54
|
+
"declaredClass" in value &&
|
|
55
|
+
typeof value.declaredClass === "string" &&
|
|
56
|
+
value.declaredClass.startsWith("esri.rest.knowledgeGraph.KnowledgeGraph"));
|
|
30
57
|
}
|
|
31
58
|
function isArcadePortal(value) {
|
|
32
|
-
|
|
33
|
-
|
|
59
|
+
return (!!value &&
|
|
60
|
+
typeof value === "object" &&
|
|
61
|
+
"declaredClass" in value &&
|
|
62
|
+
typeof value.declaredClass === "string" &&
|
|
63
|
+
value.declaredClass === "esri.arcade.Portal");
|
|
34
64
|
}
|
|
35
65
|
function isArcadeAttachment(value) {
|
|
36
|
-
|
|
37
|
-
|
|
66
|
+
return (!!value &&
|
|
67
|
+
typeof value === "object" &&
|
|
68
|
+
"declaredClass" in value &&
|
|
69
|
+
typeof value.declaredClass === "string" &&
|
|
70
|
+
value.declaredClass === "esri.arcade.Attachment");
|
|
38
71
|
}
|
|
39
72
|
function isArcadeDate(value) {
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
return (!!value &&
|
|
74
|
+
typeof value === "object" &&
|
|
75
|
+
"declaredRootClass" in value &&
|
|
76
|
+
typeof value.declaredRootClass === "string" &&
|
|
77
|
+
value.declaredRootClass === "esri.arcade.arcadedate");
|
|
42
78
|
}
|
|
43
79
|
function isArcadeDateOnly(value) {
|
|
44
|
-
|
|
45
|
-
|
|
80
|
+
return (!!value &&
|
|
81
|
+
typeof value === "object" &&
|
|
82
|
+
"declaredRootClass" in value &&
|
|
83
|
+
typeof value.declaredRootClass === "string" &&
|
|
84
|
+
value.declaredRootClass === "esri.core.sql.dateonly");
|
|
46
85
|
}
|
|
47
86
|
function isArcadeTimeOnly(value) {
|
|
48
|
-
|
|
49
|
-
|
|
87
|
+
return (!!value &&
|
|
88
|
+
typeof value === "object" &&
|
|
89
|
+
"declaredRootClass" in value &&
|
|
90
|
+
typeof value.declaredRootClass === "string" &&
|
|
91
|
+
value.declaredRootClass === "esri.core.sql.timeonly");
|
|
50
92
|
}
|
|
51
93
|
function isArcadeImmutableArray(value) {
|
|
52
|
-
return (
|
|
94
|
+
return (!!value &&
|
|
95
|
+
typeof value === "object" &&
|
|
96
|
+
"length" in value &&
|
|
97
|
+
typeof value.length === "function" &&
|
|
98
|
+
"get" in value &&
|
|
53
99
|
typeof value.get === "function" &&
|
|
100
|
+
"toArray" in value &&
|
|
54
101
|
typeof value.toArray === "function" &&
|
|
102
|
+
"_elements" in value &&
|
|
55
103
|
Array.isArray(value._elements));
|
|
56
104
|
}
|
|
57
105
|
function valueToArcadeResult(value) {
|
|
58
|
-
if (value
|
|
106
|
+
if (value === null || value === undefined) {
|
|
59
107
|
return { type: "null" };
|
|
60
108
|
}
|
|
61
109
|
if (Array.isArray(value)) {
|
|
@@ -106,6 +154,9 @@ function valueToArcadeResult(value) {
|
|
|
106
154
|
if (isGeometry(value)) {
|
|
107
155
|
return { type: "geometry", value };
|
|
108
156
|
}
|
|
157
|
+
if (isKnowledgeGraph(value)) {
|
|
158
|
+
return { type: "knowledgeGraph", value };
|
|
159
|
+
}
|
|
109
160
|
return { type: "unknown" };
|
|
110
161
|
}
|
|
111
162
|
function formatArcadeResultDate(dateObject, lang = "en") {
|
|
@@ -132,9 +183,6 @@ async function loadArcadeResult(result, timeZone = "system") {
|
|
|
132
183
|
await result.value.load();
|
|
133
184
|
// Create the first iterator
|
|
134
185
|
result.iterator = result.value.iterator({ aborted: false });
|
|
135
|
-
if (result.iterator == null) {
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
186
|
// Load the first batch of items
|
|
139
187
|
result.features = (await result.iterator.nextBatchAsArcadeFeatures(BatchSize, timeZone)) ?? [];
|
|
140
188
|
return result;
|
|
@@ -163,7 +211,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
163
211
|
console
|
|
164
212
|
};
|
|
165
213
|
// Execute the script
|
|
166
|
-
const scriptOutput = await executor.executeAsync(profileVariableInstances
|
|
214
|
+
const scriptOutput = await executor.executeAsync(profileVariableInstances, executeContext);
|
|
167
215
|
// Convert script output to arcade result object and load data if necessary
|
|
168
216
|
const scriptResult = await loadArcadeResult(valueToArcadeResult(scriptOutput), timeZone);
|
|
169
217
|
// Timestamp and measure cost
|
|
@@ -195,7 +243,7 @@ function createPushFunc(p) {
|
|
|
195
243
|
return (substring) => `\\${p.push(substring)}\\`;
|
|
196
244
|
}
|
|
197
245
|
function createPopFunc(p) {
|
|
198
|
-
return (_, offset) => p[offset - 1];
|
|
246
|
+
return (_, offset) => p[offset - 1] ?? "";
|
|
199
247
|
}
|
|
200
248
|
function indent(index, indentType) {
|
|
201
249
|
return new Array(index + 1).join(indentType);
|
|
@@ -259,6 +307,50 @@ const expandableTreeItemProps = {
|
|
|
259
307
|
item.expanded = !item.expanded;
|
|
260
308
|
}
|
|
261
309
|
};
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region Helper Functions
|
|
312
|
+
function renderDictionaryProperty(key) {
|
|
313
|
+
return (h(Fragment, null, h("span", { class: "dictionary-property" }, key), h("span", null, ":\u00A0")));
|
|
314
|
+
}
|
|
315
|
+
function renderDictionaryAsJsonTree(value, subtree = false) {
|
|
316
|
+
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", { class: "string-value" }, jsonFormat(value.castAsJson()))));
|
|
317
|
+
}
|
|
318
|
+
function renderGeometryTree(value, subtree = false) {
|
|
319
|
+
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, renderDictionaryProperty("type"), value.type)), h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, renderDictionaryProperty("value"), h("span", { class: "string-value" }, jsonFormat(value.toJSON()))))));
|
|
320
|
+
}
|
|
321
|
+
function renderSimpleValue(arcadeResult) {
|
|
322
|
+
switch (arcadeResult.type) {
|
|
323
|
+
case "unknown":
|
|
324
|
+
case "null":
|
|
325
|
+
return h("span", { class: "constant-value" }, arcadeResult.type);
|
|
326
|
+
case "text":
|
|
327
|
+
return h("span", { class: "string-value" }, D(arcadeResult.value));
|
|
328
|
+
case "number":
|
|
329
|
+
return h("span", { class: "number-value" }, arcadeResult.value.toString());
|
|
330
|
+
case "boolean":
|
|
331
|
+
return h("span", { class: "constant-value" }, arcadeResult.value.toString());
|
|
332
|
+
case "date":
|
|
333
|
+
return h("span", { class: "date-value" }, formatArcadeResultDate(arcadeResult));
|
|
334
|
+
case "dateOnly":
|
|
335
|
+
return h("span", { class: "string-value" }, D(formatArcadeResultDateOnly(arcadeResult)));
|
|
336
|
+
case "time":
|
|
337
|
+
return h("span", { class: "string-value" }, D(formatArcadeResultTimeOnly(arcadeResult)));
|
|
338
|
+
default:
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function renderFeatureSetTable(arcadeResult) {
|
|
343
|
+
const fields = supportedFields(arcadeResult.value.fields);
|
|
344
|
+
return (h("table", null, h("thead", null, h("tr", null, fields.map((field) => (h("th", null, field.name))))), h("tbody", null, arcadeResult.features.map((feature) => (h("tr", null, fields.map((field) => {
|
|
345
|
+
try {
|
|
346
|
+
const arcadeResult = valueToArcadeResult(feature.field(field.name));
|
|
347
|
+
return h("td", null, renderSimpleValue(arcadeResult));
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
return h("td", null);
|
|
351
|
+
}
|
|
352
|
+
})))))));
|
|
353
|
+
}
|
|
262
354
|
const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeResults extends HTMLElement {
|
|
263
355
|
constructor() {
|
|
264
356
|
super();
|
|
@@ -288,10 +380,10 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
288
380
|
//#endregion
|
|
289
381
|
// #region Component lifecycle events
|
|
290
382
|
async componentWillLoad() {
|
|
291
|
-
await
|
|
383
|
+
await H(this, getAssetPath("./assets"));
|
|
292
384
|
}
|
|
293
385
|
disconnectedCallback() {
|
|
294
|
-
|
|
386
|
+
q(this);
|
|
295
387
|
}
|
|
296
388
|
// #endregion
|
|
297
389
|
//#region Private Methods
|
|
@@ -318,18 +410,18 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
318
410
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
319
411
|
}
|
|
320
412
|
const iconClass = this.result?.type === "error" ? "color-error" : "color-success";
|
|
321
|
-
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label:
|
|
413
|
+
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label: I(this._t9nStrings?.lastexecutionformat, {
|
|
322
414
|
timeStamp: new Intl.DateTimeFormat(this._t9nLocale, {
|
|
323
415
|
dateStyle: "medium",
|
|
324
416
|
timeStyle: "medium"
|
|
325
417
|
}).format(this.result.timeStamp)
|
|
326
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
418
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: I(this._t9nStrings?.compilationtimeformat, {
|
|
327
419
|
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
328
420
|
style: "unit",
|
|
329
421
|
unit: "millisecond",
|
|
330
422
|
maximumFractionDigits: 2
|
|
331
423
|
}).format(this.result.compilationTime ?? 0)
|
|
332
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
424
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: I(this._t9nStrings?.executiontimeformat, {
|
|
333
425
|
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
334
426
|
style: "unit",
|
|
335
427
|
unit: "millisecond",
|
|
@@ -346,66 +438,44 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
346
438
|
}
|
|
347
439
|
switch (this.result?.type) {
|
|
348
440
|
case "error":
|
|
349
|
-
return (h("div", { class: "result-value-simple flex-adjustable" },
|
|
441
|
+
return (h("div", { class: "result-value-simple flex-adjustable" }, I(this._t9nStrings?.executionerrorformat, {
|
|
350
442
|
message: this.result.value
|
|
351
443
|
})));
|
|
352
444
|
case "null":
|
|
353
445
|
case "unknown":
|
|
354
|
-
return h("div", { class: "result-value-simple ltr-container" },
|
|
446
|
+
return h("div", { class: "result-value-simple ltr-container" }, renderSimpleValue(this.result));
|
|
355
447
|
case "text":
|
|
356
448
|
case "number":
|
|
357
449
|
case "date":
|
|
358
450
|
case "dateOnly":
|
|
359
451
|
case "time":
|
|
360
452
|
case "boolean":
|
|
361
|
-
return (h("div", { class: "result-value-simple ltr-container" }, h("span", { class: "value-type" }, this.result.type, ":\u00A0"),
|
|
453
|
+
return (h("div", { class: "result-value-simple ltr-container" }, h("span", { class: "value-type" }, this.result.type, ":\u00A0"), renderSimpleValue(this.result)));
|
|
362
454
|
case "array": {
|
|
363
455
|
const items = this.result.value ?? [];
|
|
364
456
|
const firstItems = items.slice(0, MaxArrayItems);
|
|
365
457
|
return (h("div", { class: "result-value-simple ltr-container" }, h("calcite-tree", { ...treeProps }, h("calcite-tree-item", { expanded: true, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, this.renderArrayHeader(this.result)), this.renderArrayTree(firstItems, true)))));
|
|
366
458
|
}
|
|
367
459
|
case "geometry":
|
|
368
|
-
return (h("div", { class: "result-value-simple ltr-container" }, h("calcite-tree", { ...treeProps }, h("calcite-tree-item", { expanded: true, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, this.result.type),
|
|
460
|
+
return (h("div", { class: "result-value-simple ltr-container" }, h("calcite-tree", { ...treeProps }, h("calcite-tree-item", { expanded: true, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, this.result.type), renderGeometryTree(this.result.value, true)))));
|
|
369
461
|
case "attachment":
|
|
370
|
-
return (h("div", { class: "result-value-simple ltr-container" }, h("calcite-tree", { ...treeProps }, h("calcite-tree-item", { expanded: true, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, this.result.type),
|
|
462
|
+
return (h("div", { class: "result-value-simple ltr-container" }, h("calcite-tree", { ...treeProps }, h("calcite-tree-item", { expanded: true, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, this.result.type), renderDictionaryAsJsonTree(this.result.value, true)))));
|
|
371
463
|
case "feature":
|
|
372
464
|
case "dictionary":
|
|
373
465
|
case "portal":
|
|
374
466
|
return (h("div", { class: "result-value-simple ltr-container" }, h("calcite-tree", { ...treeProps }, h("calcite-tree-item", { expanded: true, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, this.result.type), this.renderDictionaryTree(this.result.value, true)))));
|
|
375
467
|
case "featureSet":
|
|
376
|
-
return (h("div", { class: "result-value-table ltr-container" }, this.renderFeatureSetLabel(this.result),
|
|
468
|
+
return (h("div", { class: "result-value-table ltr-container" }, this.renderFeatureSetLabel(this.result), renderFeatureSetTable(this.result)));
|
|
469
|
+
case "knowledgeGraph":
|
|
470
|
+
return (h("div", { class: "result-value-simple ltr-container" }, h("span", { class: "value-type" }, this.result.type, ":\u00A0"), h("span", { class: "string-value" }, this.result.value.url)));
|
|
377
471
|
default:
|
|
378
472
|
return (h("div", { class: "result-value-simple flex-adjustable ltr-container" }, this._t9nStrings?.runscriptmessage));
|
|
379
473
|
}
|
|
380
474
|
}
|
|
381
|
-
renderDictionaryProperty(key) {
|
|
382
|
-
return (h(Fragment, null, h("span", { class: "dictionary-property" }, key), h("span", null, ":\u00A0")));
|
|
383
|
-
}
|
|
384
|
-
renderSimpleValue(arcadeResult) {
|
|
385
|
-
switch (arcadeResult.type) {
|
|
386
|
-
case "unknown":
|
|
387
|
-
case "null":
|
|
388
|
-
return h("span", { class: "constant-value" }, arcadeResult.type);
|
|
389
|
-
case "text":
|
|
390
|
-
return h("span", { class: "string-value" }, q(arcadeResult.value));
|
|
391
|
-
case "number":
|
|
392
|
-
return h("span", { class: "number-value" }, arcadeResult.value.toString());
|
|
393
|
-
case "boolean":
|
|
394
|
-
return h("span", { class: "constant-value" }, arcadeResult.value.toString());
|
|
395
|
-
case "date":
|
|
396
|
-
return h("span", { class: "date-value" }, formatArcadeResultDate(arcadeResult));
|
|
397
|
-
case "dateOnly":
|
|
398
|
-
return h("span", { class: "string-value" }, q(formatArcadeResultDateOnly(arcadeResult)));
|
|
399
|
-
case "time":
|
|
400
|
-
return h("span", { class: "string-value" }, q(formatArcadeResultTimeOnly(arcadeResult)));
|
|
401
|
-
default:
|
|
402
|
-
return null;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
475
|
renderArrayHeader(arcadeResult) {
|
|
406
476
|
const items = arcadeResult.value ?? [];
|
|
407
477
|
const leftoverCount = Math.max(items.length - MaxArrayItems, 0);
|
|
408
|
-
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0",
|
|
478
|
+
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0", I(this._t9nStrings?.showingfirstitemsformat, {
|
|
409
479
|
count: MaxArrayItems.toString()
|
|
410
480
|
}))) : null));
|
|
411
481
|
}
|
|
@@ -415,12 +485,6 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
415
485
|
return this.renderTreeItem(arcadeValue, key, !subtree);
|
|
416
486
|
})));
|
|
417
487
|
}
|
|
418
|
-
renderGeometryTree(value, subtree = false) {
|
|
419
|
-
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, this.renderDictionaryProperty("type"), value.type)), h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, this.renderDictionaryProperty("value"), h("span", { class: "string-value" }, jsonFormat(value.toJSON()))))));
|
|
420
|
-
}
|
|
421
|
-
renderDictionaryAsJsonTree(value, subtree = false) {
|
|
422
|
-
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", { class: "string-value" }, jsonFormat(value.castAsJson()))));
|
|
423
|
-
}
|
|
424
488
|
renderDictionaryTree(value, subtree = false) {
|
|
425
489
|
const geometry = value.geometry?.();
|
|
426
490
|
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, value.keys().map((key) => {
|
|
@@ -438,41 +502,29 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
438
502
|
case "dateOnly":
|
|
439
503
|
case "time":
|
|
440
504
|
case "boolean":
|
|
441
|
-
return (h("calcite-tree-item", null, h("div", { class: "tree-item-label" },
|
|
505
|
+
return (h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, renderDictionaryProperty(key), renderSimpleValue(arcadeResult))));
|
|
442
506
|
case "array": {
|
|
443
507
|
const items = arcadeResult.value ?? [];
|
|
444
508
|
const firstItems = items.slice(0, MaxArrayItems);
|
|
445
|
-
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" },
|
|
509
|
+
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, renderDictionaryProperty(key), this.renderArrayHeader(arcadeResult)), this.renderArrayTree(firstItems, true)));
|
|
446
510
|
}
|
|
447
511
|
case "geometry":
|
|
448
|
-
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" },
|
|
512
|
+
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, renderDictionaryProperty(key), h("span", null, arcadeResult.type)), renderGeometryTree(arcadeResult.value, true)));
|
|
449
513
|
case "attachment":
|
|
450
|
-
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" },
|
|
514
|
+
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, renderDictionaryProperty(key), h("span", null, arcadeResult.type)), renderDictionaryAsJsonTree(arcadeResult.value, true)));
|
|
451
515
|
case "feature":
|
|
452
516
|
case "dictionary":
|
|
453
517
|
case "portal":
|
|
454
|
-
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" },
|
|
518
|
+
return (h("calcite-tree-item", { expanded: expanded, ...expandableTreeItemProps }, h("div", { class: "tree-item-label" }, renderDictionaryProperty(key), h("span", null, arcadeResult.type)), this.renderDictionaryTree(arcadeResult.value, true)));
|
|
455
519
|
default:
|
|
456
520
|
return null;
|
|
457
521
|
}
|
|
458
522
|
}
|
|
459
523
|
renderFeatureSetLabel(arcadeResult) {
|
|
460
|
-
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0",
|
|
524
|
+
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0", I(this._t9nStrings?.showingfirstitemsformat, {
|
|
461
525
|
count: BatchSize.toString()
|
|
462
526
|
}))) : null));
|
|
463
527
|
}
|
|
464
|
-
renderFeatureSetTable(arcadeResult) {
|
|
465
|
-
const fields = supportedFields(arcadeResult.value.fields);
|
|
466
|
-
return (h("table", null, h("thead", null, h("tr", null, fields.map((field) => (h("th", null, field.name))))), h("tbody", null, arcadeResult.features.map((feature) => (h("tr", null, fields.map((field) => {
|
|
467
|
-
try {
|
|
468
|
-
const arcadeResult = valueToArcadeResult(feature.field(field.name));
|
|
469
|
-
return h("td", null, this.renderSimpleValue(arcadeResult));
|
|
470
|
-
}
|
|
471
|
-
catch {
|
|
472
|
-
return h("td", null);
|
|
473
|
-
}
|
|
474
|
-
})))))));
|
|
475
|
-
}
|
|
476
528
|
render() {
|
|
477
529
|
return (h(Host, null, h("header", { class: "flex-row" }, h("calcite-action-bar", { class: "flex-adjustable", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { scale: "s" }, h("calcite-action", { active: this.openedResultPanel === "output", text: this._t9nStrings?.output ?? "Output", "text-enabled": true, scale: "s", icon: "list-show-all", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "output" }), h("calcite-action", { active: this.openedResultPanel === "console", text: this._t9nStrings?.console ?? "Console", "text-enabled": true, scale: "s", icon: "console", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "console" }), h("calcite-action", { active: this.openedResultPanel === "log", text: this._t9nStrings?.log ?? "Log", "text-enabled": true, scale: "s", icon: "list", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "log" }))), h("calcite-action", { scale: "s", icon: "x", text: this._t9nStrings?.close ?? "", onClick: this._emitClose })), h("article", { class: "flex-adjustable" }, this.loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: "" })) : (h("div", { class: "flex-column y-scrollable-container" }, this.renderOutputPanel(), this.renderConsolePanel(), this.renderLogPanel())))));
|
|
478
530
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
* v4.29.0-beta.94
|
|
5
|
+
*/
|
|
1
6
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Host } from '@stencil/core/internal/client';
|
|
2
7
|
import { g as generateColorizeStyles, o as onColorizeThemeChanged, c as convertMarkdownString, b as colorizeCodeElement } from './markdown.js';
|
|
3
8
|
import { S as StickyFilterInput } from './functional-components.js';
|
|
4
9
|
import { f as filterCollection } from './utilities.js';
|
|
5
|
-
import {
|
|
10
|
+
import { H, q, U } from './index2.js';
|
|
6
11
|
import '@esri/calcite-components/dist/components/calcite-list-item-group.js';
|
|
7
12
|
import '@esri/calcite-components/dist/components/calcite-list-item.js';
|
|
8
13
|
import '@esri/calcite-components/dist/components/calcite-action.js';
|
|
@@ -72,12 +77,12 @@ const ArcgisArcadeSuggestions = /*@__PURE__*/ proxyCustomElement(class ArcgisArc
|
|
|
72
77
|
async componentWillLoad() {
|
|
73
78
|
this._colorizeStyle = generateColorizeStyles();
|
|
74
79
|
this._themeChangedListner = onColorizeThemeChanged(() => (this._colorizeStyle = generateColorizeStyles()));
|
|
75
|
-
await
|
|
80
|
+
await H(this, getAssetPath("./assets"));
|
|
76
81
|
}
|
|
77
82
|
disconnectedCallback() {
|
|
78
83
|
this._flowObserver?.disconnect();
|
|
79
84
|
this._themeChangedListner?.dispose();
|
|
80
|
-
|
|
85
|
+
q(this);
|
|
81
86
|
}
|
|
82
87
|
// #endregion
|
|
83
88
|
//#region Private Methods
|
|
@@ -95,7 +100,7 @@ const ArcgisArcadeSuggestions = /*@__PURE__*/ proxyCustomElement(class ArcgisArc
|
|
|
95
100
|
// When switching between flow the same reference is reused
|
|
96
101
|
this._flowObserver = new MutationObserver(() => {
|
|
97
102
|
// Get the last panel and try to set focus on the input element
|
|
98
|
-
|
|
103
|
+
U(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
99
104
|
});
|
|
100
105
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
101
106
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
* v4.29.0-beta.94
|
|
5
|
+
*/
|
|
1
6
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h } from '@stencil/core/internal/client';
|
|
2
7
|
import { S as StickyFilterInput } from './functional-components.js';
|
|
3
|
-
import {
|
|
8
|
+
import { H, q, U, G } from './index2.js';
|
|
4
9
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
5
10
|
import '@esri/calcite-components/dist/components/calcite-flow-item.js';
|
|
6
11
|
import '@esri/calcite-components/dist/components/calcite-action.js';
|
|
@@ -69,10 +74,10 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
69
74
|
//#endregion
|
|
70
75
|
// #region Component lifecycle events
|
|
71
76
|
async componentWillLoad() {
|
|
72
|
-
await
|
|
77
|
+
await H(this, getAssetPath("./assets"));
|
|
73
78
|
}
|
|
74
79
|
disconnectedCallback() {
|
|
75
|
-
|
|
80
|
+
q(this);
|
|
76
81
|
this._flowObserver?.disconnect();
|
|
77
82
|
}
|
|
78
83
|
// #endregion
|
|
@@ -97,7 +102,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
97
102
|
// When switching between flow the same reference is reused
|
|
98
103
|
this._flowObserver = new MutationObserver(() => {
|
|
99
104
|
// Get the last panel and try to set focus on the input element
|
|
100
|
-
|
|
105
|
+
U(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
101
106
|
});
|
|
102
107
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
103
108
|
}
|
|
@@ -125,7 +130,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
125
130
|
}
|
|
126
131
|
renderEditorVariables(collection) {
|
|
127
132
|
// Filter the variables. Skip group, we will filter the children later on.
|
|
128
|
-
const filterExpression =
|
|
133
|
+
const filterExpression = G(this._filterValue);
|
|
129
134
|
const filteredVariables = collection.variables.filter((variable) => variable.passFilter(filterExpression));
|
|
130
135
|
if (!filteredVariables.length) {
|
|
131
136
|
return h("div", { class: "notice-container" }, this._t9nStrings?.noitems ?? "No item");
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
* v4.29.0-beta.94
|
|
5
|
+
*/
|
|
1
6
|
import { A as ArcgisArcadeApi$1, d as defineCustomElement$1 } from './arcade-api.js';
|
|
2
7
|
|
|
3
8
|
const ArcgisArcadeApi = ArcgisArcadeApi$1;
|