@arcgis/coding-components 4.31.0-next.54 → 4.31.0-next.56

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.
Files changed (122) hide show
  1. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  2. package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +3 -3
  3. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +32 -32
  4. package/dist/arcgis-coding-components/assets/sql-expression-editor/t9n/sql-expression-editor.t9n.en.json +4 -0
  5. package/dist/arcgis-coding-components/assets/sql-expression-fields/t9n/sql-expression-fields.t9n.en.json +4 -0
  6. package/dist/arcgis-coding-components/index.esm.js +2 -2
  7. package/dist/arcgis-coding-components/{p-e99ebc55.js → p-0048c7be.js} +2 -2
  8. package/dist/arcgis-coding-components/p-3966b909.entry.js +6 -0
  9. package/dist/arcgis-coding-components/p-47da1193.entry.js +6 -0
  10. package/dist/arcgis-coding-components/{p-26d3fcc7.js → p-4afbb375.js} +1 -1
  11. package/dist/arcgis-coding-components/{p-ee8e91c5.js → p-4d15b7fb.js} +2 -2
  12. package/dist/arcgis-coding-components/{p-bf7e11fd.js → p-4d8c4601.js} +2 -2
  13. package/dist/arcgis-coding-components/{p-2aa428af.js → p-515abc51.js} +1 -1
  14. package/dist/arcgis-coding-components/{p-f048c26d.js → p-5285c444.js} +2 -2
  15. package/dist/arcgis-coding-components/p-529e06e1.js +6 -0
  16. package/dist/arcgis-coding-components/{p-5f82bda4.js → p-605de796.js} +9 -9
  17. package/dist/arcgis-coding-components/{p-40c8e02b.js → p-8afe732b.js} +2 -2
  18. package/dist/arcgis-coding-components/p-9e8d27e9.js +6 -0
  19. package/dist/arcgis-coding-components/{p-187be214.js → p-b620b06c.js} +3 -3
  20. package/dist/arcgis-coding-components/{p-7518bf06.js → p-bf988dbf.js} +2 -2
  21. package/dist/arcgis-coding-components/{p-eac1cf63.js → p-d6a50105.js} +2 -2
  22. package/dist/arcgis-coding-components/{p-9cfd8c44.js → p-dbc5c2e8.js} +1 -1
  23. package/dist/arcgis-coding-components/p-e36a3779.js +6 -0
  24. package/dist/arcgis-coding-components/p-f2a42428.entry.js +6 -0
  25. package/dist/cjs/{app-globals-633389bb.js → app-globals-0b20f844.js} +1 -1
  26. package/dist/cjs/{arcade-defaults-e89d821f.js → arcade-defaults-d588ea90.js} +4 -4
  27. package/dist/cjs/{arcade-mode-51017641.js → arcade-mode-23964e19.js} +16 -3
  28. package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +46 -123
  29. package/dist/cjs/arcgis-coding-components.cjs.js +4 -4
  30. package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +32 -11
  31. package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +16 -10
  32. package/dist/cjs/{css-2a866ead.js → css-1527ad06.js} +1 -1
  33. package/dist/cjs/{cssMode-322bf1ca.js → cssMode-266600eb.js} +2 -2
  34. package/dist/cjs/{html-bf50b9d5.js → html-c79594b0.js} +2 -2
  35. package/dist/cjs/{htmlMode-e064979b.js → htmlMode-9f7c4794.js} +2 -2
  36. package/dist/cjs/{index-c6ca5d79.js → index-a6a79883.js} +1 -1
  37. package/dist/cjs/index.cjs.js +4 -4
  38. package/dist/cjs/{javascript-59b31aab.js → javascript-f757ee11.js} +3 -3
  39. package/dist/cjs/{jsonMode-62d33ca8.js → jsonMode-730c12d6.js} +2 -2
  40. package/dist/cjs/{language-defaults-base-7f799681.js → language-defaults-base-f992e8fd.js} +9 -9
  41. package/dist/cjs/loader.cjs.js +4 -4
  42. package/dist/cjs/{sql-expr-defaults-56a073df.js → sql-expr-defaults-14e3c0f4.js} +161 -38
  43. package/dist/cjs/{sql-expr-mode-b76f2cd7.js → sql-expr-mode-5cf780b5.js} +17 -4
  44. package/dist/cjs/{tsMode-343a564e.js → tsMode-f009817f.js} +2 -2
  45. package/dist/cjs/{typescript-aa39a9f1.js → typescript-b067d8ea.js} +2 -2
  46. package/dist/components/arcade-defaults.js +1 -1
  47. package/dist/components/arcade-mode.js +16 -3
  48. package/dist/components/arcade-results.js +2 -2
  49. package/dist/components/arcade-suggestions.js +2 -2
  50. package/dist/components/arcade-variables.js +2 -2
  51. package/dist/components/arcgis-arcade-editor.js +17 -10
  52. package/dist/components/arcgis-arcade-results.js +1 -1
  53. package/dist/components/arcgis-arcade-suggestions.js +1 -1
  54. package/dist/components/arcgis-arcade-variables.js +1 -1
  55. package/dist/components/arcgis-assets.d.ts +1 -1
  56. package/dist/components/arcgis-assets.js +1 -1
  57. package/dist/components/arcgis-code-editor.js +1 -1
  58. package/dist/components/arcgis-language-api-panel.js +1 -1
  59. package/dist/components/arcgis-sql-expression-editor.js +33 -11
  60. package/dist/components/arcgis-sql-expression-fields.js +1 -1
  61. package/dist/components/{chunk-BMBYH3VH.js → chunk-W77CUVCX.js} +54 -31
  62. package/dist/components/code-editor.js +4 -3
  63. package/dist/components/fields.js +1 -1
  64. package/dist/components/index.js +1 -1
  65. package/dist/components/index2.js +1 -1
  66. package/dist/components/language-api-panel.js +22 -4
  67. package/dist/components/language-defaults-base.js +1 -1
  68. package/dist/components/markdown.js +1 -1
  69. package/dist/components/sql-expr-defaults.js +1 -1
  70. package/dist/components/sql-expr-mode.js +15 -2
  71. package/dist/components/sql-expression-fields.js +15 -8
  72. package/dist/components/useT9n.js +2 -2
  73. package/dist/components/utilities.js +1 -1
  74. package/dist/esm/{app-globals-7a9ff748.js → app-globals-68a9d20e.js} +1 -1
  75. package/dist/esm/{arcade-defaults-112cabaa.js → arcade-defaults-06fa8817.js} +4 -4
  76. package/dist/esm/{arcade-mode-78a2482d.js → arcade-mode-e2e247bd.js} +16 -3
  77. package/dist/esm/arcgis-arcade-editor_6.entry.js +41 -118
  78. package/dist/esm/arcgis-coding-components.js +5 -5
  79. package/dist/esm/arcgis-sql-expression-editor.entry.js +32 -11
  80. package/dist/esm/arcgis-sql-expression-fields.entry.js +16 -10
  81. package/dist/esm/{css-e8c18f98.js → css-9bd3c065.js} +1 -1
  82. package/dist/esm/{cssMode-769cabbb.js → cssMode-b0760052.js} +2 -2
  83. package/dist/esm/{html-91c19065.js → html-bccc0bb4.js} +2 -2
  84. package/dist/esm/{htmlMode-2e105097.js → htmlMode-d49b807b.js} +2 -2
  85. package/dist/esm/{index-20936dfe.js → index-b5d43ca7.js} +1 -1
  86. package/dist/esm/index.js +4 -4
  87. package/dist/esm/{javascript-68620191.js → javascript-56c5dd2a.js} +3 -3
  88. package/dist/esm/{jsonMode-e89d6d21.js → jsonMode-5e5edb97.js} +2 -2
  89. package/dist/esm/{language-defaults-base-9e3f1f44.js → language-defaults-base-307b77e5.js} +10 -10
  90. package/dist/esm/loader.js +5 -5
  91. package/dist/esm/{sql-expr-defaults-3913a59f.js → sql-expr-defaults-c2608671.js} +161 -35
  92. package/dist/esm/{sql-expr-mode-abd729cf.js → sql-expr-mode-a76dd370.js} +17 -4
  93. package/dist/esm/{tsMode-05dfb27e.js → tsMode-81f755f4.js} +2 -2
  94. package/dist/esm/{typescript-d6646874.js → typescript-63767e00.js} +2 -2
  95. package/dist/loader/cdn.js +1 -1
  96. package/dist/loader/index.cjs.js +1 -1
  97. package/dist/loader/index.es2017.js +1 -1
  98. package/dist/loader/index.js +1 -1
  99. package/dist/types/components/arcade-editor/arcade-editor.d.ts +4 -3
  100. package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -0
  101. package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +31 -3
  102. package/dist/types/components/sql-expression-fields/sql-expression-fields.d.ts +17 -0
  103. package/dist/types/components.d.ts +27 -0
  104. package/dist/types/data/arcgis-web-compoments/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +3 -0
  105. package/dist/types/utils/arcade-monaco/arcade-worker-manager.d.ts +6 -0
  106. package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +6 -0
  107. package/package.json +11 -11
  108. package/dist/arcgis-coding-components/p-0d09a590.js +0 -6
  109. package/dist/arcgis-coding-components/p-710acdb6.entry.js +0 -6
  110. package/dist/arcgis-coding-components/p-8157c6db.entry.js +0 -6
  111. package/dist/arcgis-coding-components/p-83675007.js +0 -6
  112. package/dist/arcgis-coding-components/p-c5f85501.js +0 -6
  113. package/dist/arcgis-coding-components/p-e65a39fc.entry.js +0 -6
  114. package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +0 -3
  115. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +0 -0
  116. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +0 -0
  117. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/code-editor/code-editor.stories.d.ts +0 -0
  118. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/sql-expression-editor/sql-expression-editor.stories.d.ts +0 -0
  119. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/reference/stories/arcade-editor.stories.d.ts +0 -0
  120. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-inline-url-importer.d.ts +0 -0
  121. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-json-importer.d.ts +0 -0
  122. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/stencil-monaco-plugins.d.ts +0 -0
@@ -1,16 +1,16 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const index = require('./index-c6ca5d79.js');
11
- const languageDefaultsBase = require('./language-defaults-base-7f799681.js');
12
- const sqlExprDefaults = require('./sql-expr-defaults-56a073df.js');
13
- const arcadeDefaults = require('./arcade-defaults-e89d821f.js');
10
+ const index = require('./index-a6a79883.js');
11
+ const languageDefaultsBase = require('./language-defaults-base-f992e8fd.js');
12
+ const sqlExprDefaults = require('./sql-expr-defaults-14e3c0f4.js');
13
+ const arcadeDefaults = require('./arcade-defaults-d588ea90.js');
14
14
 
15
15
  const DevelopersWebSitePath = "https://developers.arcgis.com/arcade/";
16
16
  const MaxArrayItems = 100;
@@ -294,107 +294,6 @@ function updateThemeColors(theme, colorRules) {
294
294
  languageDefaultsBase.editor.defineTheme(base, { base, inherit: true, rules, colors: {} });
295
295
  }
296
296
 
297
- // src/functional.ts
298
- var makeController = (constructor) => proxy(void 0, constructor);
299
- var FunctionalController = class extends sqlExprDefaults.Controller {
300
- constructor(component, constructor) {
301
- super(component);
302
- const originalExports = this.exports;
303
- try {
304
- sqlExprDefaults.setAmbientComponent(this.component);
305
- const value = constructor(this.component, this);
306
- const constructorChangedExports = this.exports !== originalExports;
307
- if (value instanceof Promise) {
308
- if (!constructorChangedExports) {
309
- this.setProvisionalExports(value);
310
- }
311
- const resolved = value.then((result) => {
312
- this.exports = result;
313
- super.catchUpLifecycle();
314
- }).catch((error) => {
315
- this._ready.reject(error);
316
- console.error(error);
317
- });
318
- this.onLoad(async () => await resolved);
319
- } else {
320
- if (!constructorChangedExports || value !== void 0) {
321
- this.exports = value;
322
- }
323
- queueMicrotask(() => super.catchUpLifecycle());
324
- }
325
- } catch (error) {
326
- this._ready.reject(error);
327
- console.error(error);
328
- }
329
- }
330
- /** Noop - will be called in the constructor instead */
331
- catchUpLifecycle() {
332
- return;
333
- }
334
- };
335
- var proxy = sqlExprDefaults.proxyExports(FunctionalController);
336
- var makeT9nController = (getAssetPath) => (options = {}) => (
337
- // eslint-disable-next-line @typescript-eslint/promise-function-async
338
- makeController((component, controller) => {
339
- const componentWithOverrides = component;
340
- controller.onLifecycle(
341
- () => languageDefaultsBase.startLocaleObserver(
342
- component.el,
343
- getAssetPath("./assets"),
344
- ({ t9nLocale, t9nStrings, lang }) => {
345
- const withoutOverrides = {
346
- ...t9nStrings,
347
- _lang: lang,
348
- _t9nLocale: t9nLocale,
349
- _loading: false
350
- };
351
- controller.exports = withoutOverrides;
352
- const label = t9nStrings.componentLabel ?? t9nStrings.widgetLabel;
353
- if (typeof label === "string" && "label" in component && component.label == null) {
354
- component.label ?? (component.label = label);
355
- }
356
- applyOverrides(componentWithOverrides.messageOverrides);
357
- },
358
- options.name
359
- )
360
- );
361
- function applyOverrides(messageOverrides) {
362
- const currentValue = controller.exports;
363
- const rawMessages = currentValue._original ?? currentValue;
364
- const updated = deepMerge(rawMessages, messageOverrides);
365
- updated._original = rawMessages;
366
- controller.exports = updated;
367
- }
368
- if ("messageOverrides" in componentWithOverrides) {
369
- controller.onLifecycle(() => sqlExprDefaults.watch(componentWithOverrides, "messageOverrides", applyOverrides));
370
- }
371
- if (options.blocking) {
372
- return controller.ready;
373
- }
374
- const locale = languageDefaultsBase.getElementLocales(component.el);
375
- const pending = {
376
- _lang: locale.lang,
377
- _t9nLocale: locale.t9nLocale,
378
- _loading: true
379
- };
380
- return pending;
381
- })
382
- );
383
- function deepMerge(original, overwrites) {
384
- if (!overwrites) {
385
- return original;
386
- }
387
- const merged = { ...original };
388
- Object.entries(overwrites).forEach(([key, value]) => {
389
- if (typeof value === "object") {
390
- merged[key] = deepMerge(original[key], value);
391
- } else {
392
- merged[key] = value ?? original[key];
393
- }
394
- });
395
- return merged;
396
- }
397
-
398
297
  function isMonacoEnvironmentSetup() {
399
298
  return !!window.MonacoEnvironment?.getWorkerUrl;
400
299
  }
@@ -453,8 +352,6 @@ function setupMonacoEnvironment(assetsPath) {
453
352
  };
454
353
  }
455
354
 
456
- const useT9n = makeT9nController(index.getAssetPath);
457
-
458
355
  const arcadeEditorCss = "arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid var(--calcite-color-border-3);box-sizing:border-box;background-color:var(--calcite-color-foreground-1);height:100%}arcgis-arcade-editor .flex-adjustable{flex:1 1 auto;overflow:hidden}arcgis-arcade-editor .flex-panel{flex:1 0 auto}arcgis-arcade-editor .position-relative{position:relative}arcgis-arcade-editor .flex-row{display:flex;flex-direction:row;overflow:hidden}arcgis-arcade-editor .flex-column{display:flex;flex-direction:column;overflow:hidden}arcgis-arcade-editor .border-inline-start{border-inline-start:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-arcade-editor .border-inline-end{border-inline-end:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-arcade-editor .sticky{position:sticky;top:0px;z-index:10}arcgis-arcade-editor .notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}arcgis-arcade-editor .side-action-bar{max-width:25%}arcgis-arcade-editor .side-panel{max-width:45%;width:600px}arcgis-arcade-editor .side-panel calcite-flow{height:100%}arcgis-arcade-editor .main-action-bar{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}arcgis-arcade-editor .main-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group:last-child{border-inline-end-width:0px}arcgis-arcade-editor .main-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}arcgis-arcade-editor arcgis-arcade-results{border-top:1px solid var(--calcite-color-border-3);box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}arcgis-arcade-editor calcite-flow [slot=footer]{word-break:break-word}";
459
356
  const ArcgisArcadeEditorStyle0 = arcadeEditorCss;
460
357
 
@@ -523,7 +420,7 @@ const ArcgisArcadeEditor = class {
523
420
  this._executingScript = false;
524
421
  this._consoleLogs = [];
525
422
  this._executionResult = undefined;
526
- this.messages = useT9n();
423
+ this.messages = sqlExprDefaults.useT9n();
527
424
  this.profile = undefined;
528
425
  this.script = "";
529
426
  this.testData = undefined;
@@ -539,11 +436,13 @@ const ArcgisArcadeEditor = class {
539
436
  set: "ignore",
540
437
  });
541
438
  }
542
- _messagesChanged() {
543
- this._updateArcadeDefaults().catch(console.error);
439
+ async _messagesChanged() {
440
+ await this._updateEditorProfile().catch(console.error);
441
+ await this._updateApiLibrary().catch(console.error);
544
442
  }
545
- _profileChanged() {
546
- this._updateArcadeDefaults().catch(console.error);
443
+ async _profileChanged() {
444
+ await this._updateEditorProfile().catch(console.error);
445
+ await this._updateApiLibrary().catch(console.error);
547
446
  }
548
447
  _testDataChanged() {
549
448
  if (!this._showExecutionPanel) {
@@ -625,12 +524,15 @@ const ArcgisArcadeEditor = class {
625
524
  // However, we need to setup the environment before the code editor is instantiated because
626
525
  // we need to access the arcade language service to get the api library.
627
526
  setupMonacoEnvironment(assetsPath);
628
- await this._updateArcadeDefaults();
527
+ await this._updateEditorProfile();
629
528
  }
630
529
  async componentDidLoad() {
631
530
  // Mark on component as ready.
632
531
  // Some methods are waiting for this state to actually continue.
633
532
  this._componentReadyDefer.resolve();
533
+ // We do updateApiLibrary in componentDidLoad because we need to wait until code editor
534
+ // is rendered for worker to register and allow for fetching the sdk
535
+ await this._updateApiLibrary();
634
536
  // Start listening to the validation diagnostics.
635
537
  // We are doing this as late as possible
636
538
  const diagnosticsService = await arcadeDefaults.getArcadeDiagnosticService();
@@ -659,7 +561,7 @@ const ArcgisArcadeEditor = class {
659
561
  }
660
562
  // #endregion
661
563
  // #region Private methods API
662
- async _updateArcadeDefaults() {
564
+ async _updateEditorProfile() {
663
565
  // The profile definition or the locale has changed.
664
566
  // Ask the arcade defaults to prepare the profile for the model and to download the api library.
665
567
  this._preparingArcade = true;
@@ -669,7 +571,6 @@ const ArcgisArcadeEditor = class {
669
571
  snippets: this.snippets,
670
572
  });
671
573
  this._editorProfile = arcadeDefaults.arcadeDefaults.getEditorProfileForModel(this._modelId);
672
- this._apiLibrary = await arcadeDefaults.arcadeDefaults.getApiLibrary(this._modelId);
673
574
  }
674
575
  catch {
675
576
  this._editorProfile = undefined;
@@ -679,6 +580,9 @@ const ArcgisArcadeEditor = class {
679
580
  this._preparingArcade = false;
680
581
  }
681
582
  }
583
+ async _updateApiLibrary() {
584
+ this._apiLibrary = await arcadeDefaults.arcadeDefaults.getApiLibrary(this._modelId);
585
+ }
682
586
  // #endregion
683
587
  //#region Render Main Action Bar
684
588
  renderMainActionBar() {
@@ -761,7 +665,7 @@ const ArcgisArcadeEditor = class {
761
665
  //#endregion
762
666
  //#region Render
763
667
  render() {
764
- return (index.h(index.Host, { key: 'f8a7e9cb7620c72586fc06dba017a44b63330198' }, this.renderMainActionBar(), index.h("div", { key: '086f52ceaa74266a8bcd28833ae526f73537a165', class: "flex-row flex-adjustable" }, index.h("div", { key: 'fa33e21b52d41b7c01a504eb85a229714b8c0556', class: "flex-column flex-adjustable" }, this.renderMainPanel(), this.renderResultsPanel()), this.renderSidePanel(), this.renderSideActionBar())));
668
+ return (index.h(index.Host, { key: '0d94f0940e22ebdf09ce14dac1f29ff6d0cda848' }, this.renderMainActionBar(), index.h("div", { key: 'cf41e32ee268570fc70204de9885f351bf2f0f6e', class: "flex-row flex-adjustable" }, index.h("div", { key: 'd2dd6c0e068baa18aa057b53b31b5ee552de97bc', class: "flex-column flex-adjustable" }, this.renderMainPanel(), this.renderResultsPanel()), this.renderSidePanel(), this.renderSideActionBar())));
765
669
  }
766
670
  static get assetsDirs() { return ["assets"]; }
767
671
  get el() { return index.getElement(this); }
@@ -841,7 +745,7 @@ const ArcgisArcadeResults = class {
841
745
  this.arcgisClose = index.createEvent(this, "arcgisClose", 3);
842
746
  this.manager = sqlExprDefaults.useControllerManager(this);
843
747
  //#region Private Properties
844
- this.messages = useT9n();
748
+ this.messages = sqlExprDefaults.useT9n();
845
749
  this._switchResultPanel = (e) => {
846
750
  if (!e.target) {
847
751
  return;
@@ -3956,7 +3860,7 @@ const ArcgisArcadeSuggestions = class {
3956
3860
  this.arcgisClose = index.createEvent(this, "arcgisClose", 3);
3957
3861
  this.arcgisItemSelected = index.createEvent(this, "arcgisItemSelected", 3);
3958
3862
  this.manager = sqlExprDefaults.useControllerManager(this);
3959
- this.messages = useT9n();
3863
+ this.messages = sqlExprDefaults.useT9n();
3960
3864
  this._updateFilterValue = (e) => {
3961
3865
  this._filterValue = e.target?.value ?? "";
3962
3866
  };
@@ -4073,7 +3977,7 @@ const ArcgisArcadeVariables = class {
4073
3977
  this.arcgisClose = index.createEvent(this, "arcgisClose", 3);
4074
3978
  this.arcgisItemSelected = index.createEvent(this, "arcgisItemSelected", 3);
4075
3979
  this.manager = sqlExprDefaults.useControllerManager(this);
4076
- this.messages = useT9n();
3980
+ this.messages = sqlExprDefaults.useT9n();
4077
3981
  this._updateFilterValue = (e) => {
4078
3982
  this._filterValue = e.target.value;
4079
3983
  };
@@ -4424,6 +4328,7 @@ const ArcgisCodeEditor = class {
4424
4328
  this.addCommonEditorActions();
4425
4329
  }
4426
4330
  disconnectedCallback() {
4331
+ this._editorInstance?.getModel()?.dispose();
4427
4332
  while (this._disposables.length) {
4428
4333
  this._disposables.pop()?.dispose();
4429
4334
  }
@@ -4491,7 +4396,7 @@ const ArcgisCodeEditor = class {
4491
4396
  //#endregion
4492
4397
  // #region Rendering
4493
4398
  render() {
4494
- return index.h(index.Host, { key: 'dc46295c6153511a5af31138745f7cb7cc03e1c8' });
4399
+ return index.h(index.Host, { key: 'ad62779413690025ea1498106aee049b3c786582' });
4495
4400
  }
4496
4401
  static get assetsDirs() { return ["assets"]; }
4497
4402
  get el() { return index.getElement(this); }
@@ -4512,7 +4417,7 @@ const ArcgisLanguageApiPanel = class {
4512
4417
  this.arcgisClose = index.createEvent(this, "arcgisClose", 3);
4513
4418
  this.arcgisItemSelected = index.createEvent(this, "arcgisItemSelected", 3);
4514
4419
  this.manager = sqlExprDefaults.useControllerManager(this);
4515
- this.messages = useT9n();
4420
+ this.messages = sqlExprDefaults.useT9n();
4516
4421
  this._emitItemSelected = (e) => {
4517
4422
  const item = e.target?.["data-item"];
4518
4423
  if (!item) {
@@ -4559,6 +4464,21 @@ const ArcgisLanguageApiPanel = class {
4559
4464
  this.loading = false;
4560
4465
  this.apiLibrary = undefined;
4561
4466
  }
4467
+ _apiLibraryChanged(newVal) {
4468
+ // refresh the selected api item if there is one to use the new language
4469
+ if (!this._selectedApiItem) {
4470
+ return;
4471
+ }
4472
+ for (const category of newVal ?? []) {
4473
+ for (const item of category.items) {
4474
+ if (item.name === this._selectedApiItem.name) {
4475
+ this._selectedApiItem = item;
4476
+ return;
4477
+ }
4478
+ }
4479
+ }
4480
+ this._selectedApiItem = undefined;
4481
+ }
4562
4482
  //#endregion
4563
4483
  // #region Component lifecycle events
4564
4484
  async componentWillLoad() {
@@ -4620,10 +4540,13 @@ const ArcgisLanguageApiPanel = class {
4620
4540
  render() {
4621
4541
  const categories = (this.apiLibrary ?? []).map((apiCategory) => this.renderApiCategory(apiCategory));
4622
4542
  const empty = categories.every((g) => !g);
4623
- return (index.h(index.Host, { key: '60e169c299bceeb3d2912eea067d69005fb27bf5' }, index.h("style", { key: '4460f4de437b518f40f5013c6e06dadefc7c90a4' }, this._colorizeStyle), index.h("calcite-flow", { key: '06a7e13f55efbd24e4eb200ad2c4cbf56b699b50', ref: (ref) => this.flowFocusHandler(ref) }, index.h("calcite-flow-item", { key: 'db5e4e8817ee85de1c19655496529fb93bb544dd', heading: this.messages.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, index.h("calcite-input", { key: 'a35a4cedbdec59eed366f719c7d48e662005f6fb', value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), this.loading ? (index.h("calcite-loader", { scale: "s", type: "indeterminate", label: this.messages.loading ?? "Loading" })) : (index.h("calcite-list", null, empty ? index.h("div", { class: "notice-container" }, this.messages.noitems) : categories))), this.renderApiItemFlowItem())));
4543
+ return (index.h(index.Host, { key: '777e65f0a9891fbdf8fd6177890df475261d198e' }, index.h("style", { key: 'bacffd5a30dfa72f9cc99db6a7066fd551c06e60' }, this._colorizeStyle), index.h("calcite-flow", { key: 'b48417bccd1a1a5e400d5b205ff0dc3a21e08a76', ref: (ref) => this.flowFocusHandler(ref) }, index.h("calcite-flow-item", { key: 'a44cdb484d60daa1a6410ed7d513eb680f20f883', heading: this.messages.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, index.h("calcite-input", { key: 'ebe4708ce6ccb62b2d5639bb9cbc5ee207e7e2b9', value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), this.loading ? (index.h("calcite-loader", { scale: "s", type: "indeterminate", label: this.messages.loading ?? "Loading" })) : (index.h("calcite-list", null, empty ? index.h("div", { class: "notice-container" }, this.messages.noitems) : categories))), this.renderApiItemFlowItem())));
4624
4544
  }
4625
4545
  static get assetsDirs() { return ["assets"]; }
4626
4546
  get el() { return index.getElement(this); }
4547
+ static get watchers() { return {
4548
+ "apiLibrary": ["_apiLibraryChanged"]
4549
+ }; }
4627
4550
  };
4628
4551
  ArcgisLanguageApiPanel.style = ArcgisLanguageApiPanelStyle0;
4629
4552
 
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const index = require('./index-c6ca5d79.js');
11
- const appGlobals = require('./app-globals-633389bb.js');
10
+ const index = require('./index-a6a79883.js');
11
+ const appGlobals = require('./app-globals-0b20f844.js');
12
12
 
13
13
  /*
14
14
  Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -24,7 +24,7 @@ var patchBrowser = () => {
24
24
 
25
25
  patchBrowser().then(async (options) => {
26
26
  await appGlobals.globalScripts();
27
- return index.bootstrapLazy([["arcgis-sql-expression-fields.cjs",[[1,"arcgis-sql-expression-fields",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}]]],["arcgis-arcade-editor_6.cjs",[[0,"arcgis-arcade-editor",{"profile":[16],"script":[1025],"testData":[16],"suggestions":[16],"snippets":[16],"hideDocumentationActions":[4,"hide-documentation-actions"],"hideSideBar":[4,"hide-side-bar"],"sideActionBarExpanded":[1540,"side-action-bar-expanded"],"openedSidePanel":[1537,"opened-side-panel"],"editorOptions":[16],"editorInstance":[16],"_preparingArcade":[32],"_editorProfile":[32],"_apiLibrary":[32],"_showExecutionPanel":[32],"_resultPanel":[32],"_executingScript":[32],"_consoleLogs":[32],"_executionResult":[32],"messages":[32],"getScript":[64],"setFocus":[64],"getEditorInstance":[64],"getTestResult":[64],"updateThemeColors":[64]},null,{"messages":["_messagesChanged"],"profile":["_profileChanged"],"testData":["_testDataChanged"],"snippets":["_snippetChanged"]}],[1,"arcgis-arcade-results",{"loading":[4],"openedResultPanel":[1537,"opened-result-panel"],"result":[16],"consoleLogs":[16]}],[1,"arcgis-arcade-suggestions",{"suggestions":[16],"_selectedSuggestion":[32],"_filterValue":[32],"_colorizeStyle":[32]},null,{"suggestions":["suggestionsPropChanged"]}],[1,"arcgis-arcade-variables",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}],[0,"arcgis-code-editor",{"value":[1],"language":[1],"modelId":[1,"model-id"],"editorOptions":[16],"editorInstance":[16],"getValue":[64],"setValue":[64],"insertText":[64],"insertSnippet":[64],"getEditorInstance":[64],"setFocus":[64]},null,{"language":["languagePropChange"],"modelId":["modelIdPropChange"],"editorOptions":["editorOptionsPropChange"]}],[1,"arcgis-language-api-panel",{"hideDocumentationActions":[4,"hide-documentation-actions"],"loading":[4],"apiLibrary":[16],"_selectedApiItem":[32],"_filterValue":[32],"_colorizeStyle":[32]}]]],["arcgis-sql-expression-editor.cjs",[[0,"arcgis-sql-expression-editor",{"profile":[16],"_preparing":[32],"_editorProfile":[32],"_activeAction":[32],"_apiLibrary":[32]},null,{"profile":["_profileChanged"]}]]]], options);
27
+ return index.bootstrapLazy([["arcgis-sql-expression-fields.cjs",[[1,"arcgis-sql-expression-fields",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}]]],["arcgis-arcade-editor_6.cjs",[[0,"arcgis-arcade-editor",{"profile":[16],"script":[1025],"testData":[16],"suggestions":[16],"snippets":[16],"hideDocumentationActions":[4,"hide-documentation-actions"],"hideSideBar":[4,"hide-side-bar"],"sideActionBarExpanded":[1540,"side-action-bar-expanded"],"openedSidePanel":[1537,"opened-side-panel"],"editorOptions":[16],"editorInstance":[16],"_preparingArcade":[32],"_editorProfile":[32],"_apiLibrary":[32],"_showExecutionPanel":[32],"_resultPanel":[32],"_executingScript":[32],"_consoleLogs":[32],"_executionResult":[32],"messages":[32],"getScript":[64],"setFocus":[64],"getEditorInstance":[64],"getTestResult":[64],"updateThemeColors":[64]},null,{"messages":["_messagesChanged"],"profile":["_profileChanged"],"testData":["_testDataChanged"],"snippets":["_snippetChanged"]}],[1,"arcgis-arcade-results",{"loading":[4],"openedResultPanel":[1537,"opened-result-panel"],"result":[16],"consoleLogs":[16]}],[1,"arcgis-arcade-suggestions",{"suggestions":[16],"_selectedSuggestion":[32],"_filterValue":[32],"_colorizeStyle":[32]},null,{"suggestions":["suggestionsPropChanged"]}],[1,"arcgis-arcade-variables",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}],[0,"arcgis-code-editor",{"value":[1],"language":[1],"modelId":[1,"model-id"],"editorOptions":[16],"editorInstance":[16],"getValue":[64],"setValue":[64],"insertText":[64],"insertSnippet":[64],"getEditorInstance":[64],"setFocus":[64]},null,{"language":["languagePropChange"],"modelId":["modelIdPropChange"],"editorOptions":["editorOptionsPropChange"]}],[1,"arcgis-language-api-panel",{"hideDocumentationActions":[4,"hide-documentation-actions"],"loading":[4],"apiLibrary":[16],"_selectedApiItem":[32],"_filterValue":[32],"_colorizeStyle":[32]},null,{"apiLibrary":["_apiLibraryChanged"]}]]],["arcgis-sql-expression-editor.cjs",[[0,"arcgis-sql-expression-editor",{"profile":[16],"script":[1025],"_preparing":[32],"_editorProfile":[32],"_activeAction":[32],"_apiLibrary":[32],"messages":[32]},null,{"messages":["_messagesChanged"],"profile":["_profileChanged"]}]]]], options);
28
28
  });
29
29
 
30
30
  exports.setNonce = index.setNonce;
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const index = require('./index-c6ca5d79.js');
11
- const sqlExprDefaults = require('./sql-expr-defaults-56a073df.js');
12
- const languageDefaultsBase = require('./language-defaults-base-7f799681.js');
10
+ const index = require('./index-a6a79883.js');
11
+ const sqlExprDefaults = require('./sql-expr-defaults-14e3c0f4.js');
12
+ const languageDefaultsBase = require('./language-defaults-base-f992e8fd.js');
13
13
 
14
14
  const sqlExpressionEditorCss = "arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid var(--calcite-color-border-3);box-sizing:border-box;background-color:var(--calcite-color-foreground-1);height:100%}arcgis-sql-expression-editor .flex-adjustable{flex:1 1 auto;overflow:hidden}arcgis-sql-expression-editor .flex-panel{flex:1 0 auto}arcgis-sql-expression-editor .position-relative{position:relative}arcgis-sql-expression-editor .flex-row{display:flex;flex-direction:row;overflow:hidden}arcgis-sql-expression-editor .flex-column{display:flex;flex-direction:column;overflow:hidden}arcgis-sql-expression-editor .border-inline-start{border-inline-start:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-sql-expression-editor .border-inline-end{border-inline-end:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-sql-expression-editor .side-action-bar{max-width:25%}arcgis-sql-expression-editor .side-panel{max-width:45%;width:600px}arcgis-sql-expression-editor .side-panel calcite-flow{height:100%}";
15
15
  const ArcgisSqlExpressionEditorStyle0 = sqlExpressionEditorCss;
@@ -17,27 +17,42 @@ const ArcgisSqlExpressionEditorStyle0 = sqlExpressionEditorCss;
17
17
  const SqlExpressionEditor = class {
18
18
  constructor(hostRef) {
19
19
  index.registerInstance(this, hostRef);
20
+ this.arcgisScriptChange = index.createEvent(this, "arcgisScriptChange", 3);
20
21
  this.manager = sqlExprDefaults.useControllerManager(this);
21
22
  // #endregion
22
23
  // #region Private properties
23
24
  this._modelId = languageDefaultsBase.generateGuid();
24
25
  this._insertAsSnippet = (e) => void this._codeEditorElt?.insertSnippet(e.detail).catch(console.error);
26
+ this._updateApiLibrary = async () => {
27
+ this._apiLibrary = await sqlExprDefaults.sqlExprDefaults.getApiLibrary(this._modelId);
28
+ };
29
+ this._onCodeEditorValueChange = (e) => {
30
+ e.stopPropagation();
31
+ this.script = e.detail;
32
+ this.arcgisScriptChange.emit(e.detail);
33
+ };
25
34
  this._preparing = false;
26
35
  this._editorProfile = undefined;
27
36
  this._activeAction = undefined;
28
37
  this._apiLibrary = undefined;
38
+ this.messages = sqlExprDefaults.useT9n();
29
39
  this.profile = undefined;
40
+ this.script = "";
41
+ }
42
+ async _messagesChanged() {
43
+ await this._updateEditorProfile().catch(console.error);
44
+ await this._updateApiLibrary().catch(console.error);
30
45
  }
31
- _profileChanged() {
32
- this._updateSqlExprDefaults().catch(console.error);
46
+ async _profileChanged() {
47
+ await this._updateEditorProfile().catch(console.error);
48
+ await this._updateApiLibrary().catch(console.error);
33
49
  }
34
50
  // #endregion
35
51
  // #region Private methods API
36
- async _updateSqlExprDefaults() {
52
+ async _updateEditorProfile() {
37
53
  this._preparing = true;
38
54
  try {
39
55
  await sqlExprDefaults.sqlExprDefaults.setProfileForModel(this._modelId, this.profile);
40
- this._apiLibrary = await sqlExprDefaults.sqlExprDefaults.getApiLibrary(this._modelId);
41
56
  }
42
57
  catch {
43
58
  this._editorProfile = undefined;
@@ -57,22 +72,28 @@ const SqlExpressionEditor = class {
57
72
  // #endregion
58
73
  // #region Component lifecycle events
59
74
  async componentWillLoad() {
60
- await this._updateSqlExprDefaults().catch(console.error);
75
+ await this._updateEditorProfile().catch(console.error);
61
76
  // The profile has to be refreshed on locale change
62
77
  // this.manager.watch("messages", () => void this._updateEditorProfile().catch(console.error));
63
78
  }
79
+ async componentDidLoad() {
80
+ // We do updateApiLibrary in componentDidLoad because we need to wait until code editor
81
+ // is rendered for worker to register and allow for fetching the sdk
82
+ await this._updateApiLibrary();
83
+ }
64
84
  disconnectedCallback() {
65
85
  sqlExprDefaults.sqlExprDefaults.disposeForModel(this._modelId);
66
86
  }
67
87
  // #endregion
68
88
  render() {
69
- return (index.h(index.Host, { key: '67f7ebf7a28a8ffc3fe967721389d45c4e2003a1' }, index.h("div", { key: 'b3bf4ec2a8d04105e97489593ccec95cd33237f0', class: "flex-row flex-adjustable" }, index.h("div", { key: 'fdac47e22baf64c72f786f9e09b637050f417f94', class: "flex-column flex-adjustable" }, index.h("arcgis-code-editor", { key: 'f4151dd39ec3523907cd907ebb7558e05bca9cc1', language: "arcgis-sql-expression", modelId: this._modelId, ref: (e) => (this._codeEditorElt = e) })), this._activeAction === "fields" && (index.h("arcgis-sql-expression-fields", { key: 'aa0e5d88429d4bf865b9adc506028efefec1a73a', class: "side-panel flex-panel border-inline-start", loading: this._preparing, modelId: this._modelId, "data-panel-name": "none", onArcgisFieldSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined) })), this._activeAction === "functions" && (index.h("arcgis-language-api-panel", { key: '7826dbb1b08894c6c6385806a3aef6cff77395d0', class: "side-panel flex-panel border-inline-start", onArcgisItemSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined), loading: this._preparing, apiLibrary: this._apiLibrary, "data-panel-name": "none" })), index.h("calcite-action-bar", { key: 'ee618d666b70405495627a9d15238e8723c6f961', class: "side-action-bar border-inline-start", expanded: false, position: "end" }, index.h("calcite-action", { key: '2c828df5dded6347e13e59ba9e313824baa606ff', id: "fields-action", text: "Fields", icon: "profile-variables", active: this._activeAction === "fields", "data-panel-name": "fields",
89
+ return (index.h(index.Host, { key: '63348b6e3e5aa7544203c5ec7270db7827c6f3ed' }, index.h("div", { key: '203ed656208717c877c540ed5c49fc12338d6b15', class: "flex-row flex-adjustable" }, index.h("div", { key: '4dfe400bbc9ab74ef86c4115ceeabbcb41913427', class: "flex-column flex-adjustable" }, index.h("arcgis-code-editor", { key: 'dfc9e247b39d2d9901ac911e147d993897809954', language: "arcgis-sql-expression", modelId: this._modelId, ref: (e) => (this._codeEditorElt = e), value: this.script ?? "", onArcgisValueChange: this._onCodeEditorValueChange })), this._activeAction === "fields" && (index.h("arcgis-sql-expression-fields", { key: 'b5a5516264aae278f3feec00a5e20e2d0855024d', class: "side-panel flex-panel border-inline-start", loading: this._preparing, modelId: this._modelId, "data-panel-name": "none", onArcgisFieldSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined) })), this._activeAction === "functions" && (index.h("arcgis-language-api-panel", { key: '6da236e289e8bcdadc27cadece6e1fb34c55b1da', class: "side-panel flex-panel border-inline-start", onArcgisItemSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined), loading: this._preparing, apiLibrary: this._apiLibrary, "data-panel-name": "none" })), index.h("calcite-action-bar", { key: '91549ebac7e78165b911e5def1141010032dfa43', class: "side-action-bar border-inline-start", expanded: false, position: "end" }, index.h("calcite-action", { key: '32211e3b4e8db0530a047ba6c22234d15e504e17', id: "fields-action", text: this.messages.fields ?? "Fields", icon: "profile-variables", active: this._activeAction === "fields", "data-panel-name": "fields",
70
90
  // need to use an arrow function to automatically bind 'this'
71
- onClick: (e) => this._handleActionClick(e) }), index.h("calcite-action", { key: 'eab785c5b14cadeb5047db1957134f5accfedc76', id: "functions-action", text: "Functions", icon: "function", active: this._activeAction === "functions", "data-panel-name": "functions", onClick: (e) => this._handleActionClick(e) })))));
91
+ onClick: (e) => this._handleActionClick(e) }), index.h("calcite-action", { key: '3c308d994b45c67df76414580d881a082333d2f8', id: "functions-action", text: this.messages.functions ?? "Functions", icon: "function", active: this._activeAction === "functions", "data-panel-name": "functions", onClick: (e) => this._handleActionClick(e) })))));
72
92
  }
73
93
  static get assetsDirs() { return ["assets"]; }
74
94
  get el() { return index.getElement(this); }
75
95
  static get watchers() { return {
96
+ "messages": ["_messagesChanged"],
76
97
  "profile": ["_profileChanged"]
77
98
  }; }
78
99
  };
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const index = require('./index-c6ca5d79.js');
11
- const sqlExprDefaults = require('./sql-expr-defaults-56a073df.js');
12
- require('./language-defaults-base-7f799681.js');
10
+ const index = require('./index-a6a79883.js');
11
+ const sqlExprDefaults = require('./sql-expr-defaults-14e3c0f4.js');
12
+ require('./language-defaults-base-f992e8fd.js');
13
13
 
14
14
  const sqlExpressionFieldsCss = ":host calcite-flow{height:100%}:host calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}";
15
15
  const ArcgisSqlExpressionFieldsStyle0 = sqlExpressionFieldsCss;
@@ -20,22 +20,28 @@ const SqlExpressionFields = class {
20
20
  this.arcgisClose = index.createEvent(this, "arcgisClose", 3);
21
21
  this.arcgisFieldSelected = index.createEvent(this, "arcgisFieldSelected", 3);
22
22
  this.manager = sqlExprDefaults.useControllerManager(this);
23
+ this.messages = sqlExprDefaults.useT9n();
23
24
  // #endregion
24
25
  // #region Private Methods
25
26
  this._handleSelectField = (event) => {
26
27
  if (event.target instanceof HTMLElement) {
27
28
  const tagName = event.target.tagName;
28
29
  switch (tagName.toLowerCase()) {
29
- case "calcite-list-item":
30
- // TODO: why is value missing from HTMLCalciteListElement type?
31
- this.arcgisFieldSelected.emit(event.target.value ?? "");
30
+ case "calcite-list-item": {
31
+ const value = event.target.value;
32
+ this.arcgisFieldSelected.emit(value ?? "");
32
33
  break;
34
+ }
33
35
  case "calcite-action":
34
36
  event.stopPropagation();
35
37
  break;
36
38
  }
37
39
  }
38
40
  };
41
+ this._handleSelectDomain = (event) => {
42
+ const value = event.target.value;
43
+ this.arcgisFieldSelected.emit(value ? `'${value}'` : "");
44
+ };
39
45
  this._emitClose = () => {
40
46
  this.arcgisClose.emit();
41
47
  };
@@ -57,14 +63,14 @@ const SqlExpressionFields = class {
57
63
  render() {
58
64
  const layer = sqlExprDefaults.sqlExprDefaults.getFeatureLayerForModel(this.modelId ?? "");
59
65
  if (this.loading || !this.modelId || !layer) {
60
- return index.h("calcite-block", { heading: "Available Fields" });
66
+ return index.h("calcite-block", { heading: this.messages.availablefields ?? "" });
61
67
  }
62
- return (index.h("calcite-flow", null, index.h("calcite-flow-item", { heading: "Available Fields", closable: true, description: "Select a field to insert into the expression", onCalciteFlowItemClose: this._emitClose }, index.h("calcite-list", { filterEnabled: true }, layer.fields.map((field) => (index.h("calcite-list-item", { key: field.name, onClick: this._handleSelectField, label: field.name, description: field.alias, value: field.name }, field.domain && (index.h("calcite-action", { slot: "actions-end", text: "open", icon: "chevron-right", onClick: () => {
68
+ return (index.h("calcite-flow", null, index.h("calcite-flow-item", { heading: this.messages.availablefields ?? "", closable: true, onCalciteFlowItemClose: this._emitClose }, index.h("calcite-list", { filterEnabled: true }, layer.fields.map((field) => (index.h("calcite-list-item", { key: field.name, onClick: this._handleSelectField, label: field.name, description: field.alias, value: field.name }, field.domain && (index.h("calcite-action", { slot: "actions-end", text: "open", icon: "chevron-right", onClick: () => {
63
69
  const domain = field.domain;
64
70
  if (domain.type === "coded-value") {
65
71
  this._flowItemRenderers = [
66
72
  ...this._flowItemRenderers,
67
- () => (index.h("calcite-flow-item", { closable: true, heading: "Domains", description: field.name, onCalciteFlowItemClose: this._emitClose }, index.h("calcite-list", null, domain.codedValues.map((value) => (index.h("calcite-list-item", { key: value.code, onClick: this._handleSelectField, label: value.name, description: String(value.code), value: value.code })))))),
73
+ () => (index.h("calcite-flow-item", { closable: true, heading: this.messages.domainvalues ?? "", description: field.name, onCalciteFlowItemClose: this._emitClose }, index.h("calcite-list", null, domain.codedValues.map((value) => (index.h("calcite-list-item", { key: value.code, onClick: this._handleSelectDomain, label: value.name, description: String(value.code), value: String(value.code) })))))),
68
74
  ];
69
75
  }
70
76
  } }))))))), this._flowItemRenderers.map((renderer) => renderer())));
@@ -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.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
- const languageDefaultsBase = require('./language-defaults-base-7f799681.js');
8
+ const languageDefaultsBase = require('./language-defaults-base-f992e8fd.js');
9
9
 
10
10
  /*!-----------------------------------------------------------------------------
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
- const languageDefaultsBase = require('./language-defaults-base-7f799681.js');
8
+ const languageDefaultsBase = require('./language-defaults-base-f992e8fd.js');
9
9
 
10
10
  /*!-----------------------------------------------------------------------------
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
- const languageDefaultsBase = require('./language-defaults-base-7f799681.js');
8
+ const languageDefaultsBase = require('./language-defaults-base-f992e8fd.js');
9
9
 
10
10
  /*!-----------------------------------------------------------------------------
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -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.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const arcadeDefaults = require('./arcade-defaults-e89d821f.js');
11
- require('./language-defaults-base-7f799681.js');
12
- require('./index-c6ca5d79.js');
10
+ const arcadeDefaults = require('./arcade-defaults-d588ea90.js');
11
+ require('./language-defaults-base-f992e8fd.js');
12
+ require('./index-a6a79883.js');
13
13
 
14
14
 
15
15
 
@@ -1,12 +1,12 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
- const typescript = require('./typescript-aa39a9f1.js');
9
- require('./language-defaults-base-7f799681.js');
8
+ const typescript = require('./typescript-b067d8ea.js');
9
+ require('./language-defaults-base-f992e8fd.js');
10
10
 
11
11
  /*!-----------------------------------------------------------------------------
12
12
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.54
4
+ * v4.31.0-next.56
5
5
  */
6
6
  'use strict';
7
7
 
8
- const languageDefaultsBase = require('./language-defaults-base-7f799681.js');
8
+ const languageDefaultsBase = require('./language-defaults-base-f992e8fd.js');
9
9
 
10
10
  /*!-----------------------------------------------------------------------------
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.