@arcgis/coding-components 5.2.0-next.70 → 5.2.0-next.72

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 (39) hide show
  1. package/LICENSE.md +4 -2
  2. package/dist/cdn/{L5GMK4WW.js → 43C5J4GE.js} +1 -1
  3. package/dist/cdn/{WKATTQP5.js → 4KQVV3YD.js} +1 -1
  4. package/dist/cdn/6IKYN6UN.js +2 -0
  5. package/dist/cdn/{LMWFFLSQ.js → 6LPNGMDE.js} +1 -1
  6. package/dist/cdn/{3FFSPR6G.js → ADELNDZO.js} +1 -1
  7. package/dist/cdn/{XHOIOY7C.js → AGTV2YKX.js} +1 -1
  8. package/dist/cdn/{VCJOX5C4.js → BN5UJZOU.js} +1 -1
  9. package/dist/cdn/{GGYZW52W.js → CRHXEUUE.js} +1 -1
  10. package/dist/cdn/{GCEYNSEX.js → CVKAPGDA.js} +1 -1
  11. package/dist/cdn/{RTYRFD6M.js → E4CYGXC6.js} +1 -1
  12. package/dist/cdn/{M52C3KI5.js → FP7M64L5.js} +1 -1
  13. package/dist/cdn/{TQ6LVLSI.js → JE3AYQH2.js} +4 -4
  14. package/dist/cdn/{NR5L34UX.js → N5BWDIMZ.js} +1 -1
  15. package/dist/cdn/{QKGBTIWT.js → O5LFPM4K.js} +1 -1
  16. package/dist/cdn/{PF3ZBCB7.js → PR7KTMAS.js} +1 -1
  17. package/dist/cdn/{2TNK3TAC.js → Q6573NF7.js} +1 -1
  18. package/dist/cdn/{NOFOW72C.js → T7CCNYHK.js} +1 -1
  19. package/dist/cdn/TOQ2QWTU.js +3 -0
  20. package/dist/cdn/{75LMVVBN.js → TUB3DPGP.js} +1 -1
  21. package/dist/cdn/TUQPDQ74.js +2 -0
  22. package/dist/cdn/{YAYRZ72E.js → VZ6DLSKR.js} +1 -1
  23. package/dist/cdn/{CPS2Z2V6.js → WYJB4DB6.js} +1 -1
  24. package/dist/cdn/{BTI2OYTZ.js → ZXHMUT2I.js} +1 -1
  25. package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
  26. package/dist/cdn/assets/code-editor/sql-layer.worker.js +2726 -2086
  27. package/dist/cdn/index.js +1 -1
  28. package/dist/chunks/language-defaults-base.js +98 -85
  29. package/dist/chunks/oracle.js +218 -0
  30. package/dist/chunks/sql-layer-mode.js +59 -51
  31. package/dist/components/arcgis-arcade-editor/customElement.js +2 -2
  32. package/dist/components/arcgis-arcade-results/customElement.js +7 -7
  33. package/dist/components/arcgis-sql-layer-editor/customElement.js +42 -37
  34. package/dist/docs/api.json +1 -1
  35. package/dist/docs/docs.json +1 -1
  36. package/dist/docs/web-types.json +1 -1
  37. package/package.json +5 -5
  38. package/dist/cdn/5E3EYAL3.js +0 -3
  39. package/dist/cdn/BU4MIL63.js +0 -2
@@ -1,12 +1,12 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as p } from "../../chunks/runtime.js";
3
- import { css as h, html as o } from "lit";
4
- import { LitElement as g, createEvent as l, safeClassMap as m } from "@arcgis/lumina";
5
- import { generateGuid as u } from "@arcgis/toolkit/string";
6
- import { u as f } from "../../chunks/useT9n.js";
7
- import { createRef as b, ref as _ } from "lit/directives/ref.js";
8
- import { k as d } from "../../chunks/utils.js";
9
- import { e as E } from "../../chunks/utilities.js";
2
+ import { c as m } from "../../chunks/runtime.js";
3
+ import { css as u, html as l } from "lit";
4
+ import { LitElement as f, createEvent as n, safeClassMap as b } from "@arcgis/lumina";
5
+ import { generateGuid as _ } from "@arcgis/toolkit/string";
6
+ import { u as E } from "../../chunks/useT9n.js";
7
+ import { createRef as S, ref as v } from "lit/directives/ref.js";
8
+ import { k as c } from "../../chunks/utils.js";
9
+ import { e as y } from "../../chunks/utilities.js";
10
10
  import "@arcgis/core/portal/PortalItem.js";
11
11
  import "@arcgis/core/WebMap.js";
12
12
  import "@arcgis/core/WebScene.js";
@@ -14,22 +14,22 @@ import "@arcgis/core/layers/FeatureLayer.js";
14
14
  import "@arcgis/core/applications/Components/arcadeEditorUtils.js";
15
15
  import "@arcgis/toolkit/predicate";
16
16
  import "vscode-languageserver-types";
17
- import { rethrowError as r } from "@arcgis/toolkit/log";
17
+ import { rethrowError as d } from "@arcgis/toolkit/log";
18
18
  import "@arcgis/core/core/Error.js";
19
- import { d as n } from "../../chunks/language-defaults-base.js";
19
+ import { d as p } from "../../chunks/language-defaults-base.js";
20
20
  import "@arcgis/core/portal/Portal.js";
21
- import { g as S, a as v, b as y, c as $ } from "../../chunks/sql-layer-defaults.js";
22
- import { getSqlLayerDiagnosticService as x } from "../../chunks/sql-layer-mode.js";
23
- const I = h`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`;
24
- class L extends g {
21
+ import { g as $, a as L, b as x, c as I } from "../../chunks/sql-layer-defaults.js";
22
+ import { getSqlLayerDiagnosticService as P } from "../../chunks/sql-layer-mode.js";
23
+ const C = u`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`;
24
+ class D extends f {
25
25
  constructor() {
26
- super(...arguments), this._codeEditorElt = b(), this._disposables = [], this._modelId = u(), this.messages = f(), this._preparing = !1, this._resolvedLanguage = n, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.openedSidePanel = "none", this.arcgisDiagnosticsChange = l({ bubbles: !1 }), this.arcgisScriptChange = l({ bubbles: !1 });
26
+ super(...arguments), this._codeEditorElt = S(), this._disposables = [], this._modelId = _(), this.messages = E(), this._preparing = !1, this._resolvedLanguage = p, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.openedSidePanel = "none", this.arcgisDiagnosticsChange = n({ bubbles: !1 }), this.arcgisScriptChange = n({ bubbles: !1 });
27
27
  }
28
28
  static {
29
29
  this.properties = { _editorProfile: 16, _preparing: 16, _resolvedLanguage: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5, messageOverrides: 0, openedSidePanel: 3, editorOptions: 0, editorInstance: 32 };
30
30
  }
31
31
  static {
32
- this.styles = [I];
32
+ this.styles = [C];
33
33
  }
34
34
  get editorInstance() {
35
35
  return this._codeEditorElt.value?.editorInstance;
@@ -38,13 +38,13 @@ class L extends g {
38
38
  await this._codeEditorElt.value?.setFocus();
39
39
  }
40
40
  async load() {
41
- await this._updateDataModelDeps().catch(r(this));
41
+ await this._updateDataModelDeps().catch(d(this));
42
42
  }
43
43
  willUpdate(e) {
44
- e.has("profile") && this._updateDataModelDeps().catch(r(this));
44
+ e.has("profile") && this._updateDataModelDeps().catch(d(this));
45
45
  }
46
46
  async loaded() {
47
- const e = x();
47
+ const e = P();
48
48
  this._disposables.push(e.onDiagnosticsChange((t) => {
49
49
  t.uri.toString() === this._modelId && !this._preparing && this.arcgisDiagnosticsChange.emit(t.diagnostics);
50
50
  }));
@@ -52,17 +52,17 @@ class L extends g {
52
52
  disconnectedCallback() {
53
53
  for (super.disconnectedCallback(); this._disposables.length; )
54
54
  this._disposables.pop()?.dispose();
55
- S().forEach((e) => e.disposeForModel(this._modelId));
55
+ $().forEach((e) => e.disposeForModel(this._modelId));
56
56
  }
57
57
  async _updateDataModelDeps() {
58
58
  this._preparing = !0;
59
59
  try {
60
- const e = await v(this.profile);
61
- e !== this._resolvedLanguage && (y(this._resolvedLanguage)?.disposeForModel(this._modelId), this._resolvedLanguage = e);
62
- const t = $(this._resolvedLanguage);
60
+ const e = await L(this.profile);
61
+ e !== this._resolvedLanguage && (x(this._resolvedLanguage)?.disposeForModel(this._modelId), this._resolvedLanguage = e);
62
+ const t = I(this._resolvedLanguage);
63
63
  await t.setProfileForModel(this._modelId, this.profile, { locale: this.messages._t9nLocale }), this._editorProfile = t.getEditorProfileForModel(this._modelId);
64
64
  } catch {
65
- this._editorProfile = void 0, this._resolvedLanguage = n;
65
+ this._editorProfile = void 0, this._resolvedLanguage = p;
66
66
  } finally {
67
67
  this._preparing = !1;
68
68
  }
@@ -80,31 +80,36 @@ class L extends g {
80
80
  e.stopPropagation();
81
81
  const t = this._getSelectedTableVariable(e.detail);
82
82
  if (!t) {
83
- this._codeEditorElt.value?.insertText(e.detail).catch(r(this));
83
+ this._codeEditorElt.value?.insertText(e.detail).catch(d(this));
84
84
  return;
85
85
  }
86
86
  await t.loadSource();
87
- let i;
88
- const s = t.fieldInfos.filter((a) => a.type === "geometry" && !i ? (i = a.name, !0) : a.type !== "geometry").map((a) => a.name).filter(Boolean), c = `select ${s.length ? s.join(", ") : "*"} from ${t.snippet}`;
89
- E(this._codeEditorElt.value?.editorInstance, c, "replace", "");
87
+ let a;
88
+ const s = t.fieldInfos.filter((i) => i.type === "geometry" && !a ? (a = i.name, !0) : i.type !== "geometry").map((i) => i.name).filter(Boolean), h = `select ${s.length ? s.join(", ") : "*"} from ${t.snippet}`, o = this._codeEditorElt.value?.editorInstance;
89
+ y(o, h, "replace", ""), o?.getAction("editor.action.formatDocument")?.run();
90
+ const r = o?.getModel();
91
+ if (r) {
92
+ const i = r.getLineCount(), g = r.getLineMaxColumn(i);
93
+ o?.setPosition({ lineNumber: i, column: g });
94
+ }
90
95
  }
91
96
  _getTablesVariable() {
92
- return this._editorProfile?.variables.find(d);
97
+ return this._editorProfile?.variables.find(c);
93
98
  }
94
99
  _getSelectedTableVariable(e) {
95
100
  const t = this._getTablesVariable();
96
- if (d(t))
97
- return t.tableVariables.find((i) => i.snippet === e);
101
+ if (c(t))
102
+ return t.tableVariables.find((a) => a.snippet === e);
98
103
  }
99
104
  render() {
100
- const e = this._getTablesVariable(), i = String(this.messages.placeholderexample ?? "Example: {sqlQueryExample}").replace("{sqlQueryExample}", "select field1, field2 from db.dataset"), s = `${this.messages.placeholder ?? "Start filtering data using SQL query syntax"}
101
- ${i}`;
102
- return o`<arcgis-code-editor-shell><arcgis-code-editor slot=editor .language=${this._resolvedLanguage} .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} .editorOptions=${{ placeholder: s, ...this.editorOptions }} ${_(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar && o`<arcgis-editor-variables slot=side-panel .variable=${e} .heading=${this.messages.tables ?? "Tables"} .messageOverrides=${{ profileempty: this.messages.profileempty }} .closed=${this.openedSidePanel !== "variables"} class=${m(this.openedSidePanel === "variables" ? "" : "hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._onItemSelected} @arcgisInternalClosePanel=${() => {
105
+ const e = this._getTablesVariable(), a = String(this.messages.placeholderexample ?? "Example: {sqlQueryExample}").replace("{sqlQueryExample}", "select field1, field2 from db.dataset"), s = `${this.messages.placeholder ?? "Start filtering data using SQL query syntax"}
106
+ ${a}`;
107
+ return l`<arcgis-code-editor-shell><arcgis-code-editor slot=editor .language=${this._resolvedLanguage} .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} .editorOptions=${{ placeholder: s, ...this.editorOptions }} ${v(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar && l`<arcgis-editor-variables slot=side-panel .variable=${e} .heading=${this.messages.tables ?? "Tables"} .messageOverrides=${{ profileempty: this.messages.profileempty }} .closed=${this.openedSidePanel !== "variables"} class=${b(this.openedSidePanel === "variables" ? "" : "hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._onItemSelected} @arcgisInternalClosePanel=${() => {
103
108
  this.openedSidePanel = "none";
104
- }} data-panel-name=none></arcgis-editor-variables><calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=tables-action .text=${this.messages.tables ?? "Tables"} icon=table .active=${this.openedSidePanel === "variables"} data-panel-name=variables @click=${() => this._toggleSidePanel("variables")}></calcite-action>${!this.sideActionBarExpanded && o`<calcite-tooltip reference-element=tables-action><span>${this.messages.tables ?? "Tables"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</arcgis-code-editor-shell>`;
109
+ }} data-panel-name=none></arcgis-editor-variables><calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=tables-action .text=${this.messages.tables ?? "Tables"} icon=table .active=${this.openedSidePanel === "variables"} data-panel-name=variables @click=${() => this._toggleSidePanel("variables")}></calcite-action>${!this.sideActionBarExpanded && l`<calcite-tooltip reference-element=tables-action><span>${this.messages.tables ?? "Tables"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</arcgis-code-editor-shell>`;
105
110
  }
106
111
  }
107
- p("arcgis-sql-layer-editor", L);
112
+ m("arcgis-sql-layer-editor", D);
108
113
  export {
109
- L as ArcgisSqlLayerEditor
114
+ D as ArcgisSqlLayerEditor
110
115
  };