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

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 (35) hide show
  1. package/dist/cdn/{L5GMK4WW.js → 43C5J4GE.js} +1 -1
  2. package/dist/cdn/{WKATTQP5.js → 4KQVV3YD.js} +1 -1
  3. package/dist/cdn/6IKYN6UN.js +2 -0
  4. package/dist/cdn/{LMWFFLSQ.js → 6LPNGMDE.js} +1 -1
  5. package/dist/cdn/{3FFSPR6G.js → 7FJQFKWF.js} +1 -1
  6. package/dist/cdn/{XHOIOY7C.js → AGTV2YKX.js} +1 -1
  7. package/dist/cdn/{VCJOX5C4.js → BN5UJZOU.js} +1 -1
  8. package/dist/cdn/{GGYZW52W.js → CRHXEUUE.js} +1 -1
  9. package/dist/cdn/{RTYRFD6M.js → E4CYGXC6.js} +1 -1
  10. package/dist/cdn/{M52C3KI5.js → FP7M64L5.js} +1 -1
  11. package/dist/cdn/{TQ6LVLSI.js → JE3AYQH2.js} +4 -4
  12. package/dist/cdn/{NR5L34UX.js → N5BWDIMZ.js} +1 -1
  13. package/dist/cdn/{QKGBTIWT.js → O5LFPM4K.js} +1 -1
  14. package/dist/cdn/{PF3ZBCB7.js → PR7KTMAS.js} +1 -1
  15. package/dist/cdn/{2TNK3TAC.js → Q6573NF7.js} +1 -1
  16. package/dist/cdn/{NOFOW72C.js → T7CCNYHK.js} +1 -1
  17. package/dist/cdn/TOQ2QWTU.js +3 -0
  18. package/dist/cdn/{75LMVVBN.js → TUB3DPGP.js} +1 -1
  19. package/dist/cdn/TUQPDQ74.js +2 -0
  20. package/dist/cdn/{YAYRZ72E.js → VZ6DLSKR.js} +1 -1
  21. package/dist/cdn/{CPS2Z2V6.js → WYJB4DB6.js} +1 -1
  22. package/dist/cdn/{BTI2OYTZ.js → ZXHMUT2I.js} +1 -1
  23. package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
  24. package/dist/cdn/assets/code-editor/sql-layer.worker.js +2726 -2086
  25. package/dist/cdn/index.js +1 -1
  26. package/dist/chunks/language-defaults-base.js +98 -85
  27. package/dist/chunks/oracle.js +218 -0
  28. package/dist/chunks/sql-layer-mode.js +59 -51
  29. package/dist/components/arcgis-sql-layer-editor/customElement.js +42 -37
  30. package/dist/docs/api.json +1 -1
  31. package/dist/docs/docs.json +1 -1
  32. package/dist/docs/web-types.json +1 -1
  33. package/package.json +5 -5
  34. package/dist/cdn/5E3EYAL3.js +0 -3
  35. package/dist/cdn/BU4MIL63.js +0 -2
@@ -0,0 +1,218 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ const E = {
3
+ id: "oracle",
4
+ keywords: [
5
+ "ACCESS",
6
+ "ADD",
7
+ "ALL",
8
+ "ALTER",
9
+ "AND",
10
+ "ANY",
11
+ "AS",
12
+ "ASC",
13
+ "AUDIT",
14
+ "AVG",
15
+ "BETWEEN",
16
+ "BY",
17
+ "CHAR",
18
+ "CHARACTER",
19
+ "CHECK",
20
+ "CLUSTER",
21
+ "COLUMN",
22
+ "COMMENT",
23
+ "COMPRESS",
24
+ "CONNECT",
25
+ "CREATE",
26
+ "CURRENT",
27
+ "DATE",
28
+ "DECIMAL",
29
+ "DEFAULT",
30
+ "DELETE",
31
+ "DESC",
32
+ "DISTINCT",
33
+ "DROP",
34
+ "ELSE",
35
+ "EXCLUSIVE",
36
+ "EXEC",
37
+ "EXISTS",
38
+ "FETCH",
39
+ "FILE",
40
+ "FLOAT",
41
+ "FOR",
42
+ "FROM",
43
+ "GRANT",
44
+ "GROUP",
45
+ "HAVING",
46
+ "IDENTIFIED",
47
+ "IMMEDIATE",
48
+ "IN",
49
+ "INCREMENT",
50
+ "INDEX",
51
+ "INITIAL",
52
+ "INSERT",
53
+ "INTEGER",
54
+ "INTERSECT",
55
+ "INTO",
56
+ "IS",
57
+ "LATERAL",
58
+ "LEVEL",
59
+ "LIKE",
60
+ "LOCK",
61
+ "LONG",
62
+ "MAXEXTENT",
63
+ "MINUS",
64
+ "MLSLABEL",
65
+ "MODE",
66
+ "MODIFY",
67
+ "NOAUDIT",
68
+ "NOCOMPRESS",
69
+ "NOT",
70
+ "NOWAIT",
71
+ "NULL",
72
+ "NUMBER",
73
+ "OF",
74
+ "OFFLINE",
75
+ "ON",
76
+ "ONLINE",
77
+ "OPTION",
78
+ "OR",
79
+ "ORDER",
80
+ "PLI",
81
+ "PCTREE",
82
+ "PRIOR",
83
+ "PRIVILEGES",
84
+ "PUBLIC",
85
+ "RAW",
86
+ "RENAME",
87
+ "RESOURCE",
88
+ "REVOKE",
89
+ "ROW",
90
+ "ROWID",
91
+ "ROWLABEL",
92
+ "ROWNUM",
93
+ "ROWS",
94
+ "SELECT",
95
+ "SESSION",
96
+ "SET",
97
+ "SHARE",
98
+ "SIZE",
99
+ "SMALLINT",
100
+ "START",
101
+ "SUCCESSFUL",
102
+ "SYNONYM",
103
+ "SYSDATE",
104
+ "TABLE",
105
+ "THEN",
106
+ "TO",
107
+ "TRIGGER",
108
+ "UID",
109
+ "UNION",
110
+ "UNIQUE",
111
+ "UPDATE",
112
+ "USER",
113
+ "VALIDATE",
114
+ "VALUES",
115
+ "VARCHAR",
116
+ "VARCHAR2",
117
+ "VIEW",
118
+ "WHENEVER",
119
+ "WHERE",
120
+ "WITH"
121
+ ],
122
+ functions: [
123
+ "UPPER",
124
+ "LOWER",
125
+ "CONCAT",
126
+ "ASCII",
127
+ "LENGTH",
128
+ "LENGTHB",
129
+ "CHR",
130
+ "LTRIM",
131
+ "RTRIM",
132
+ "SUBSTR",
133
+ "SUBSTRB",
134
+ "SOUNDEX",
135
+ "TRANSLATE",
136
+ "TRIM",
137
+ "CEIL",
138
+ "FLOOR",
139
+ "ROUND",
140
+ "LN",
141
+ "LOG",
142
+ "MOD",
143
+ "POWER",
144
+ "SIGN",
145
+ "TRUNC",
146
+ "SINH",
147
+ "COSH",
148
+ "TANH",
149
+ "ASIN",
150
+ "ACOS",
151
+ "ATAN",
152
+ "RAWTOHEX",
153
+ "SIN",
154
+ "COS",
155
+ "TAN",
156
+ "EXTRACT",
157
+ "BIT_LENGTH",
158
+ "INSTR",
159
+ "ABS",
160
+ "VARIANCE",
161
+ "STDDEV",
162
+ "AVG",
163
+ "COUNT",
164
+ "MAX",
165
+ "MIN",
166
+ "SUM",
167
+ "COALESCE",
168
+ "CONVERT",
169
+ "CAST",
170
+ "USER",
171
+ "CURRENT_DATE",
172
+ "CURRENT_TIMESTAMP",
173
+ "STDDEV_POP",
174
+ "STDDEV_SAMP",
175
+ "VAR_POP",
176
+ "VAR_SAMP",
177
+ "NULLIF",
178
+ "PERCENTILE_CONT",
179
+ "PERCENTILE_DISC",
180
+ "CUME_DIST",
181
+ "FIRST_VALUE",
182
+ "LAST_VALUE",
183
+ "LEAD",
184
+ "LAG",
185
+ "PERCENT_RANK",
186
+ "RANK",
187
+ "NTILE",
188
+ "DENSE_RANK",
189
+ "ROW_NUMBER",
190
+ "LISTAGG",
191
+ "GROUPING SETS",
192
+ "CUBE",
193
+ "ROLLUP",
194
+ "REGR_INTERCEPT",
195
+ "REGR_R2",
196
+ "REGR_SLOPE"
197
+ ],
198
+ operators: ["||"],
199
+ specialChars: {
200
+ likeWildcardAny: "%",
201
+ likeWildcardOne: "_",
202
+ identifierQuote: {
203
+ start: '"',
204
+ end: '"'
205
+ },
206
+ escapeKey: {
207
+ start: "'",
208
+ end: null
209
+ },
210
+ escapeClause: {
211
+ keyword: "ESCAPE",
212
+ suffix: ""
213
+ }
214
+ }
215
+ };
216
+ export {
217
+ E as oracleDialect
218
+ };
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { Emitter as C, languages as u } from "monaco-editor";
2
+ import { Emitter as C, languages as l } from "monaco-editor";
3
3
  import "monaco-editor/editor/standalone/browser/standaloneServices.js";
4
4
  import "monaco-editor/editor/standalone/common/standaloneTheme.js";
5
5
  import "monaco-editor/platform/hover/browser/hover.js";
@@ -9,9 +9,9 @@ import "monaco-editor/editor/browser/editorDom.js";
9
9
  import "monaco-editor/editor/browser/controller/mouseTarget.js";
10
10
  import { i as g } from "./monaco-importer.js";
11
11
  import { debounce as x } from "@arcgis/toolkit/function";
12
- import { rethrowError as l } from "@arcgis/toolkit/log";
12
+ import { rethrowError as h } from "@arcgis/toolkit/log";
13
13
  let p = Promise.withResolvers();
14
- class k {
14
+ class _ {
15
15
  constructor(e) {
16
16
  this._defaults = e, this._worker = null, this._client = null, this._modelLifecycleListeners = [], this._isDisposed = !1, this._configChangeListener = this._defaults.onDidChange(() => this.stopWorker()), this._modelContextChangeListener = this._defaults.onModelContextDidChange(() => {
17
17
  this._stopWorkerIfUnused();
@@ -43,18 +43,18 @@ class k {
43
43
  async _stopWorkerIfUnused() {
44
44
  if (!this._worker)
45
45
  return;
46
- (await g()).getModels().some((i) => i.getLanguageId() === this._defaults.languageId) || this.stopWorker();
46
+ (await g()).getModels().some((s) => s.getLanguageId() === this._defaults.languageId) || this.stopWorker();
47
47
  }
48
48
  async _getClientProxy() {
49
49
  const e = await g();
50
50
  if (!this._client) {
51
- const { languageId: t } = this._defaults, i = window.MonacoEnvironment?.getWorker;
52
- if (!i)
51
+ const { languageId: t } = this._defaults, s = window.MonacoEnvironment?.getWorker;
52
+ if (!s)
53
53
  throw new Error(
54
54
  "MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Layer workers."
55
55
  );
56
56
  this._worker = e.createWebWorker({
57
- worker: i("SqlLayerWorker", t),
57
+ worker: s("SqlLayerWorker", t),
58
58
  host: this._defaults.workerHost
59
59
  }), p.resolve(this._worker), this._client = this._worker.getProxy();
60
60
  }
@@ -66,14 +66,14 @@ class k {
66
66
  }
67
67
  }
68
68
  const b = (o) => {
69
- const e = _(o.start), t = _(o.end);
69
+ const e = k(o.start), t = k(o.end);
70
70
  return {
71
71
  startRegex: new RegExp(e),
72
72
  contentRegex: new RegExp(`[^${t}]+`),
73
73
  escapedRegex: new RegExp(`${t}${t}`),
74
74
  endRegex: new RegExp(t)
75
75
  };
76
- }, M = (o) => {
76
+ }, S = (o) => {
77
77
  const e = o.specialChars.identifierQuote;
78
78
  return {
79
79
  comments: {
@@ -102,7 +102,7 @@ const b = (o) => {
102
102
  { open: e.start, close: e.end }
103
103
  ]
104
104
  };
105
- }, S = (o) => {
105
+ }, D = (o) => {
106
106
  const e = b(o.specialChars.identifierQuote);
107
107
  return {
108
108
  defaultToken: "",
@@ -178,44 +178,44 @@ const b = (o) => {
178
178
  ]
179
179
  }
180
180
  };
181
- }, _ = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
181
+ }, k = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
182
182
  class I {
183
183
  constructor(e, t) {
184
184
  this._worker = e, this._defaults = t;
185
185
  }
186
186
  async provideCompletionItems(e, t) {
187
187
  try {
188
- const i = await this._worker(e.uri), a = this._defaults.getApiContextForModel(e.uri), r = e.getWordUntilPosition(t), c = {
188
+ const s = await this._worker(e.uri), a = this._defaults.getApiContextForModel(e.uri), r = e.getWordUntilPosition(t), c = {
189
189
  startLineNumber: t.lineNumber,
190
190
  endLineNumber: t.lineNumber,
191
191
  startColumn: r.startColumn,
192
192
  endColumn: r.endColumn
193
193
  };
194
- return await i.doComplete(e.uri.toString(), c, t, a);
195
- } catch (i) {
196
- return l("SqlLayerCompletionProvider")(i), { suggestions: [] };
194
+ return await s.doComplete(e.uri.toString(), c, t, a);
195
+ } catch (s) {
196
+ return h("SqlLayerCompletionProvider")(s), { suggestions: [] };
197
197
  }
198
198
  }
199
199
  }
200
- class D {
200
+ class M {
201
201
  constructor(e, t, {
202
- defaults: i,
202
+ defaults: s,
203
203
  diagnosticService: a
204
204
  }) {
205
- this._languageId = e, this._worker = t, this._disposables = [], this._modelListeners = /* @__PURE__ */ new Map(), this._defaults = i, this._diagnosticsService = a, g().then((r) => {
206
- const c = (s) => {
207
- const n = s.getLanguageId();
205
+ this._languageId = e, this._worker = t, this._disposables = [], this._modelListeners = /* @__PURE__ */ new Map(), this._defaults = s, this._diagnosticsService = a, g().then((r) => {
206
+ const c = (i) => {
207
+ const n = i.getLanguageId();
208
208
  if (n !== this._languageId)
209
209
  return;
210
210
  const d = x(() => {
211
- this._doValidate(s, n).catch((y) => {
211
+ this._doValidate(i, n).catch((y) => {
212
212
  throw y;
213
213
  });
214
- }), f = s.onDidChangeContent(d), L = s.onDidChangeAttached(d);
215
- this._modelListeners.set(s.uri.toString(), [f, L]), this._doValidate(s, n).catch(l("SqlLayerDiagnosticsAdapter"));
216
- }, h = (s) => {
217
- const n = s.uri.toString();
218
- r.setModelMarkers(s, this._languageId, []);
214
+ }), f = i.onDidChangeContent(d), L = i.onDidChangeAttached(d);
215
+ this._modelListeners.set(i.uri.toString(), [f, L]), this._doValidate(i, n).catch(h("SqlLayerDiagnosticsAdapter"));
216
+ }, u = (i) => {
217
+ const n = i.uri.toString();
218
+ r.setModelMarkers(i, this._languageId, []);
219
219
  const d = this._modelListeners.get(n);
220
220
  if (d) {
221
221
  for (; d.length; )
@@ -223,43 +223,51 @@ class D {
223
223
  this._modelListeners.delete(n);
224
224
  }
225
225
  };
226
- this._disposables.push(r.onDidCreateModel(c)), this._disposables.push(r.onWillDisposeModel((s) => h(s))), this._disposables.push(
227
- r.onDidChangeModelLanguage((s) => {
228
- h(s.model), c(s.model);
226
+ this._disposables.push(r.onDidCreateModel(c)), this._disposables.push(r.onWillDisposeModel((i) => u(i))), this._disposables.push(
227
+ r.onDidChangeModelLanguage((i) => {
228
+ u(i.model), c(i.model);
229
229
  })
230
230
  ), this._disposables.push(
231
- i.onDidChange(() => {
232
- r.getModels().forEach((s) => {
233
- s.getLanguageId() === this._languageId && (h(s), c(s));
231
+ s.onDidChange(() => {
232
+ r.getModels().forEach((i) => {
233
+ i.getLanguageId() === this._languageId && (u(i), c(i));
234
234
  });
235
235
  })
236
236
  ), this._disposables.push(
237
- i.onModelContextDidChange((s) => {
237
+ s.onModelContextDidChange((i) => {
238
238
  r.getModels().forEach((n) => {
239
- n.getLanguageId() === this._languageId && n.uri.toString() === s && this._doValidate(n, this._languageId).catch(l("SqlLayerDiagnosticsAdapter"));
239
+ n.getLanguageId() === this._languageId && n.uri.toString() === i && this._doValidate(n, this._languageId).catch(h("SqlLayerDiagnosticsAdapter"));
240
240
  });
241
241
  })
242
242
  ), this._disposables.push({
243
243
  dispose: () => {
244
- this._modelListeners.forEach((s) => s.forEach((n) => n.dispose())), this._modelListeners.clear();
244
+ this._modelListeners.forEach((i) => i.forEach((n) => n.dispose())), this._modelListeners.clear();
245
245
  }
246
246
  }), r.getModels().forEach(c);
247
247
  });
248
248
  }
249
249
  async _doValidate(e, t) {
250
- const i = await g();
250
+ const s = await g();
251
251
  if (e.isAttachedToEditor())
252
252
  try {
253
253
  const a = await this._worker(e.uri), r = this._defaults.getApiContextForModel(e.uri), c = await a.doValidation(e.uri.toString(), r);
254
- this._diagnosticsService.fireDiagnosticsChange(e.uri, c), i.setModelMarkers(e, t, c);
254
+ this._diagnosticsService.fireDiagnosticsChange(e.uri, c), s.setModelMarkers(e, t, c);
255
255
  } catch (a) {
256
- l("SqlLayerDiagnosticsAdapter")(a);
256
+ h("SqlLayerDiagnosticsAdapter")(a);
257
257
  }
258
258
  }
259
259
  }
260
+ class v {
261
+ constructor(e) {
262
+ this._worker = e;
263
+ }
264
+ async provideDocumentFormattingEdits(e) {
265
+ return await (await this._worker(e.uri)).doFormat(e.uri.toString());
266
+ }
267
+ }
260
268
  let w;
261
- async function U(...o) {
262
- return await k.waitForWorker(), await new Promise((e, t) => {
269
+ async function T(...o) {
270
+ return await _.waitForWorker(), await new Promise((e, t) => {
263
271
  if (!w) {
264
272
  t(new Error("SQL layer worker not registered!"));
265
273
  return;
@@ -267,7 +275,7 @@ async function U(...o) {
267
275
  e(w(...o));
268
276
  });
269
277
  }
270
- class v {
278
+ class E {
271
279
  constructor() {
272
280
  this._onDiagnosticsChange = new C();
273
281
  }
@@ -278,24 +286,24 @@ class v {
278
286
  this._onDiagnosticsChange.fire({ uri: e, diagnostics: t });
279
287
  }
280
288
  }
281
- const m = new v();
282
- function T() {
289
+ const m = new E();
290
+ function H() {
283
291
  return m;
284
292
  }
285
- async function H(o) {
286
- const e = new k(o), t = async (...a) => await e.getLanguageServiceWorker(...a);
293
+ async function z(o) {
294
+ const e = new _(o), t = async (...a) => await e.getLanguageServiceWorker(...a);
287
295
  w = t;
288
- const i = await o.getDialectSpec();
289
- u.setMonarchTokensProvider(o.languageId, S(i)), u.setLanguageConfiguration(o.languageId, M(i)), u.registerCompletionItemProvider(
296
+ const s = await o.getDialectSpec();
297
+ l.setMonarchTokensProvider(o.languageId, D(s)), l.setLanguageConfiguration(o.languageId, S(s)), l.registerCompletionItemProvider(
290
298
  o.languageId,
291
299
  new I(t, o)
292
- ), new D(o.languageId, t, {
300
+ ), l.registerDocumentFormattingEditProvider(o.languageId, new v(t)), new M(o.languageId, t, {
293
301
  defaults: o,
294
302
  diagnosticService: m
295
303
  });
296
304
  }
297
305
  export {
298
- T as getSqlLayerDiagnosticService,
299
- U as getSqlLayerWorker,
300
- H as setupMode
306
+ H as getSqlLayerDiagnosticService,
307
+ T as getSqlLayerWorker,
308
+ z as setupMode
301
309
  };
@@ -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
  };