@arcgis/coding-components 5.2.0-next.1 → 5.2.0-next.11
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/cdn/3QN6NREQ.js +2 -0
- package/dist/cdn/76VHPECE.js +2 -0
- package/dist/cdn/{QGBZYXBS.js → 7BIFZ5DU.js} +1 -1
- package/dist/cdn/7UTCJERR.js +2 -0
- package/dist/cdn/7Z6G332Z.js +2 -0
- package/dist/cdn/{O3PQD5N5.js → A6IGYBAZ.js} +2 -2
- package/dist/cdn/{QW7OA32G.js → B3RGPCZC.js} +1 -1
- package/dist/cdn/{CC4XBW6V.js → B73HLERI.js} +1 -1
- package/dist/cdn/BXC4G3AT.js +6 -0
- package/dist/cdn/{PUY5G6AF.js → CKBZZB5E.js} +1 -1
- package/dist/cdn/GTE3KXNK.js +2 -0
- package/dist/cdn/H2YYYWPE.js +2 -0
- package/dist/cdn/{3PBQ47BB.js → HXJFZ2Y5.js} +1 -1
- package/dist/cdn/{LZ2JU5WD.js → JLYAOSQM.js} +1 -1
- package/dist/cdn/{2DNHMHBF.js → LEFFI3FB.js} +1 -1
- package/dist/cdn/{IETP57KJ.js → MCVII2KK.js} +1 -1
- package/dist/cdn/{2WVAYBDV.js → MFDNJU3K.js} +1 -1
- package/dist/cdn/MZMKV7FA.js +2 -0
- package/dist/cdn/{LUJKYDO7.js → NCMXRX7O.js} +1 -1
- package/dist/cdn/NP37C536.js +2 -0
- package/dist/cdn/NVWQE3SF.js +2 -0
- package/dist/cdn/O6L3YJ7J.js +68 -0
- package/dist/cdn/{XU7YAUUX.js → PJBI5XFD.js} +1 -1
- package/dist/cdn/{QUR4WECO.js → PXKBNRBR.js} +1 -1
- package/dist/cdn/Q5RDW24Y.js +2 -0
- package/dist/cdn/{HRM2JUGO.js → RFQXYDLI.js} +1 -1
- package/dist/cdn/{WWVPYM5B.js → TIZLT4V3.js} +1 -1
- package/dist/cdn/UTTEHEMP.js +12 -0
- package/dist/cdn/VPVLZ5QO.js +2 -0
- package/dist/cdn/{BXEZA6TW.js → WRVJHPML.js} +1 -1
- package/dist/cdn/XJRNIBLO.js +2 -0
- package/dist/cdn/ZXEQOR2Y.js +2 -0
- package/dist/cdn/assets/arcade-language/api/arcade-api.t9n.en.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ar.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.bg.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.bs.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ca.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.cs.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.da.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.de.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.el.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.es.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.et.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.fi.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.fr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.he.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.hr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.hu.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.id.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.it.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ja.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ko.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.lt.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.lv.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.nl.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.no.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pl.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pt-BR.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pt-PT.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ro.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ru.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sk.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sl.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sv.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.th.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.tr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.uk.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.vi.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-CN.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-HK.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-TW.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +2613 -2588
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/ArcadeDebuggerPreviewTabsState.js +1 -1
- package/dist/chunks/arcade-defaults.js +56 -54
- package/dist/chunks/debugger-value-components.js +51 -47
- package/dist/chunks/debugger-value-styles.js +8 -8
- package/dist/chunks/fields.js +18 -14
- package/dist/chunks/functional.js +34 -34
- package/dist/chunks/language-defaults-base.js +230 -221
- package/dist/chunks/sql-expr-defaults.js +63 -59
- package/dist/components/arcgis-arcade-debugger-console/customElement.js +7 -7
- package/dist/components/arcgis-arcade-debugger-output/customElement.js +21 -18
- package/dist/components/arcgis-arcade-editor/customElement.d.ts +38 -3
- package/dist/components/arcgis-arcade-editor/customElement.js +185 -179
- package/dist/components/arcgis-arcade-results/customElement.js +18 -18
- package/dist/components/arcgis-code-editor-shell/customElement.js +70 -65
- package/dist/components/arcgis-editor-variables/customElement.js +12 -6
- package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-editor/customElement.js +5 -5
- package/dist/components/arcgis-sql-layer-editor/customElement.js +10 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +8 -8
- package/dist/cdn/3CHKFCKR.js +0 -2
- package/dist/cdn/3UD4JSPW.js +0 -2
- package/dist/cdn/4G3EYLJY.js +0 -2
- package/dist/cdn/4N67XYKO.js +0 -2
- package/dist/cdn/6QMGBWXM.js +0 -2
- package/dist/cdn/72E5GBWN.js +0 -68
- package/dist/cdn/B5A6XU2C.js +0 -2
- package/dist/cdn/CA3GVMWI.js +0 -2
- package/dist/cdn/CQTJWVFM.js +0 -6
- package/dist/cdn/G5IXPOCO.js +0 -2
- package/dist/cdn/P3LG4UGD.js +0 -2
- package/dist/cdn/RMVHO2AH.js +0 -12
- package/dist/cdn/RO6RHW6I.js +0 -2
- package/dist/cdn/TQDN6SR5.js +0 -2
- package/dist/cdn/TWEJITWD.js +0 -2
- package/dist/cdn/ZTCCL565.js +0 -2
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as p } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as g, html as e } from "lit";
|
|
4
|
-
import { LitElement as f, createEvent as
|
|
4
|
+
import { LitElement as f, createEvent as u, safeClassMap as r } from "@arcgis/lumina";
|
|
5
5
|
import { setValuesInString as i, uncapitalize as a } from "@arcgis/toolkit/string";
|
|
6
6
|
import { M as v } from "../../chunks/arcade-executor.js";
|
|
7
7
|
import { u as b } from "../../chunks/useT9n.js";
|
|
8
8
|
import { F as $, a as x, t as s, D as y, A as R, b as P } from "../../chunks/functional.js";
|
|
9
|
-
import { d as w, g as k, c as m, b as S, G as T, a as C, S as
|
|
9
|
+
import { d as w, g as k, c as m, b as S, G as T, a as C, S as h } from "../../chunks/debugger-value-styles.js";
|
|
10
10
|
import { createRef as o, ref as n } from "lit/directives/ref.js";
|
|
11
11
|
import { observeAncestorsMutation as M, unsafeGetCalciteModeName as I } from "@arcgis/toolkit/dom";
|
|
12
|
-
const L = g`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden;min-height:0}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}
|
|
13
|
-
onClick: (
|
|
14
|
-
const t =
|
|
12
|
+
const L = g`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden;min-height:0}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{display:flex;flex-direction:column;min-height:0;.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1)}table{min-width:max-content;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}}`, c = {
|
|
13
|
+
onClick: (d) => {
|
|
14
|
+
const t = d.currentTarget;
|
|
15
15
|
t.expanded = !t.expanded;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
class F extends f {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), this.messages = b(), this.outputRef = o(), this.consoleRef = o(), this.logRef = o(), this.openedResultPanel = "output", this.hideHeader = !1, this.arcgisInternalClosePanel =
|
|
20
|
+
super(...arguments), this.messages = b(), this.outputRef = o(), this.consoleRef = o(), this.logRef = o(), this.openedResultPanel = "output", this.hideHeader = !1, this.arcgisInternalClosePanel = u({ bubbles: !1, composed: !1 }), this.arcgisInternalOpenedResultPanelChange = u({ bubbles: !1, composed: !1 });
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.properties = { consoleLogs: 0, loading: 5, openedResultPanel: 3, result: 0, hideHeader: 5 };
|
|
@@ -48,7 +48,7 @@ class F extends f {
|
|
|
48
48
|
I(this.el) === "dark" ? this.elementInternals.states.add(m) : this.elementInternals.states.delete(m);
|
|
49
49
|
}
|
|
50
50
|
renderConsolePanel() {
|
|
51
|
-
return this.openedResultPanel !== "console" ? null : this.loading && !this.consoleLogs?.length ? e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "loading"}></calcite-loader>` : e`<div class="console-logs-container
|
|
51
|
+
return this.openedResultPanel !== "console" ? null : this.loading && !this.consoleLogs?.length ? e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "loading"}></calcite-loader>` : e`<div class="console-logs-container">${this.consoleLogs?.length ? this.consoleLogs.map((t) => e`<p dir=auto>${t}</p>`) : e`<p dir=auto>${this.messages.consolemessage}</p>`}</div>`;
|
|
52
52
|
}
|
|
53
53
|
renderLogPanel() {
|
|
54
54
|
if (this.openedResultPanel !== "log")
|
|
@@ -85,7 +85,7 @@ class F extends f {
|
|
|
85
85
|
return e`<div class="result-value-simple flex-adjustable">${i(this.messages.executionerrorformat ?? "", { message: this.result.value })}</div>`;
|
|
86
86
|
case "null":
|
|
87
87
|
case "unknown":
|
|
88
|
-
return e`<div class="result-value-simple
|
|
88
|
+
return e`<div class="result-value-simple">${h({ type: this.result.type, value: a(this.result.type) })}</div>`;
|
|
89
89
|
case "text":
|
|
90
90
|
case "number":
|
|
91
91
|
case "date":
|
|
@@ -93,33 +93,33 @@ class F extends f {
|
|
|
93
93
|
case "time":
|
|
94
94
|
case "boolean": {
|
|
95
95
|
const { type: t, value: l } = C(this.result);
|
|
96
|
-
return e`<div class="result-value-simple
|
|
96
|
+
return e`<div class="result-value-simple"><bdi class="value-type">${a(this.result.type)}: </bdi>${h({ type: t, value: l })}</div>`;
|
|
97
97
|
}
|
|
98
98
|
case "array": {
|
|
99
99
|
const l = (this.result.value ?? []).slice(0, v);
|
|
100
|
-
return e`<div class="result-value-simple
|
|
100
|
+
return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label">${R({ arcadeResult: this.result, t9nStrings: this.messages })}</div>${P({ items: l, subtree: !0, t9nStrings: this.messages })}</calcite-tree-item></calcite-tree></div>`;
|
|
101
101
|
}
|
|
102
102
|
case "geometry":
|
|
103
|
-
return e`<div class="result-value-simple
|
|
103
|
+
return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label"><bdi>${a(this.result.type)}</bdi></div>${T({ value: this.result.value, subtree: !0 })}</calcite-tree-item></calcite-tree></div>`;
|
|
104
104
|
case "attachment":
|
|
105
|
-
return e`<div class="result-value-simple
|
|
105
|
+
return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label"><bdi>${a(this.result.type)}</bdi></div>${S({ obj: this.result.value.castAsJson(), subtree: !0 })}</calcite-tree-item></calcite-tree></div>`;
|
|
106
106
|
case "feature":
|
|
107
107
|
case "dictionary":
|
|
108
108
|
case "portal":
|
|
109
|
-
return e`<div class="result-value-simple
|
|
109
|
+
return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label"><bdi>${a(this.result.type)}</bdi></div>${y({ value: this.result.value, subtree: !0, t9nStrings: this.messages })}</calcite-tree-item></calcite-tree></div>`;
|
|
110
110
|
case "featureSet":
|
|
111
|
-
return e`<div class="result-value-table
|
|
111
|
+
return e`<div class="result-value-table">${$({ arcadeResult: this.result, t9nStrings: this.messages })}${x({ arcadeResult: this.result })}</div>`;
|
|
112
112
|
case "knowledgeGraph":
|
|
113
|
-
return e`<div class="result-value-simple
|
|
113
|
+
return e`<div class="result-value-simple"><bdi class="value-type">${a(this.result.type)}: </bdi><bdi class="string-value">${this.result.value.url}</bdi></div>`;
|
|
114
114
|
default:
|
|
115
|
-
return e`<div class="result-value-simple flex-adjustable
|
|
115
|
+
return e`<div class="result-value-simple flex-adjustable">${this.messages.runscriptmessage}</div>`;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
render() {
|
|
119
119
|
return e`${this.hideHeader ? null : e`<header class="flex-row"><calcite-action-bar class="flex-adjustable" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .active=${this.openedResultPanel === "output"} .text=${this.messages.output ?? ""} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=output ${n(this.outputRef)}></calcite-action><calcite-action .active=${this.openedResultPanel === "console"} .text=${this.messages.console ?? ""} text-enabled scale=s icon=console icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=console ${n(this.consoleRef)}></calcite-action><calcite-action .active=${this.openedResultPanel === "log"} .text=${this.messages.log ?? ""} text-enabled scale=s icon=list icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=log ${n(this.logRef)}></calcite-action></calcite-action-group></calcite-action-bar><calcite-action scale=s icon=x .text=${this.messages.close ?? ""} @click=${this._emitClose}></calcite-action></header>`}<article class="flex-adjustable">${this.loading ? e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"}></calcite-loader>` : e`<div class="flex-column y-scrollable-container">${this.renderOutputPanel()}${this.renderConsolePanel()}${this.renderLogPanel()}</div>`}</article>`;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
p("arcgis-arcade-results", F);
|
|
123
123
|
export {
|
|
124
124
|
F as ArcgisArcadeResults
|
|
125
125
|
};
|
|
@@ -1,88 +1,93 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as g } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as
|
|
3
|
+
import { css as f, html as x } from "lit";
|
|
4
4
|
import { LitElement as v } from "@arcgis/lumina";
|
|
5
5
|
import { slotChangeHasContent as y } from "@arcgis/toolkit/dom";
|
|
6
|
-
import { createRef as
|
|
7
|
-
const w =
|
|
6
|
+
import { createRef as l, ref as c } from "lit/directives/ref.js";
|
|
7
|
+
const w = f`:host{--internal-border: var(--arcgis-coding-components-border, 1px solid var(--calcite-color-border-3));--internal-background-color: var(--arcgis-coding-components-background-color, var(--calcite-color-foreground-1));--internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--internal-code-editor-side-panel-w: var(--arcgis-coding-components-code-editor-side-panel-w, 600px);--internal-code-editor-side-panel-max-w: var(--arcgis-coding-components-code-editor-side-panel-max-w, 45%);--internal-code-editor-results-panel-max-h: var(--arcgis-coding-components-code-editor-results-panel-max-h, 50%);--internal-code-editor-results-panel-h: var(--arcgis-coding-components-code-editor-results-panel-h, 50%);--internal-code-editor-results-panel-bottom-drawer-controls-h: 0px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--internal-border);box-sizing:border-box;background-color:var(--internal-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.bottom-drawer{display:flex;flex:0 0 auto;flex-direction:column;overflow:hidden;position:relative;box-sizing:border-box;min-height:0}.bottom-drawer-resize-handle{display:none;position:absolute;inset-inline:0;inset-block-start:0;align-items:center;justify-content:center;block-size:var(--calcite-size-fixed-sm-plus);cursor:ns-resize;touch-action:none;user-select:none;z-index:var(--calcite-z-index-header);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);outline:none}.bottom-drawer-resize-handle-bar{display:flex;align-items:center;justify-content:center;inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);transition:box-shadow .12s ease,color .12s ease,background-color .12s ease}.bottom-drawer-resize-handle-bar calcite-icon{color:inherit}}:host(:state(results-has-content)) .bottom-drawer{padding-block-start:var(--calcite-size-fixed-sm-plus);height:calc(var(--internal-code-editor-results-panel-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h));max-height:calc(var(--internal-code-editor-results-panel-max-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h))}:host(:state(results-has-content)) .bottom-drawer-resize-handle{display:flex}:host(:state(results-has-content)) .bottom-drawer-resize-handle:focus .bottom-drawer-resize-handle-bar{box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host(:state(results-has-content)) .bottom-drawer-resize-handle:hover .bottom-drawer-resize-handle-bar,:host(:state(results-has-content)) .bottom-drawer-resize-handle .bottom-drawer-resize-handle-bar,:host(:state(is-resizing)) .bottom-drawer-resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}:host(:state(results-has-content)) slot[name=bottom-action-bar]::slotted(*){border-top:0}slot[name=top-action-bar]{flex:0 0 auto}slot[name=top-action-bar]::slotted(*){border-bottom:var(--internal-border)}slot[name=bottom-action-bar]{flex:0 0 auto}slot[name=bottom-action-bar]::slotted(*){border-top:var(--internal-border)}slot[name=side-panel]::slotted(*){max-width:var(--internal-code-editor-side-panel-max-w);width:var(--internal-code-editor-side-panel-w);border-inline-start:var(--internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:auto;min-height:0}slot[name=results-panel]{display:flex;flex:1 1 auto;overflow:hidden;min-height:0}slot[name=results-panel]::slotted(*){border-top:var(--internal-border);box-sizing:border-box;flex:1 1 auto;min-height:0}slot[name=side-action-bar]::slotted(*){max-width:var(--internal-side-action-bar-max-w);border-inline-start:var(--internal-border)}`, z = 10, P = 25, h = 100, u = "results-has-content", m = "is-resizing", H = "--arcgis-coding-components-code-editor-results-panel-max-h", s = "--internal-code-editor-results-panel-h", n = "--internal-code-editor-results-panel-max-h", i = "--internal-code-editor-results-panel-bottom-drawer-controls-h";
|
|
8
8
|
class R extends v {
|
|
9
9
|
static {
|
|
10
10
|
this.styles = [w];
|
|
11
11
|
}
|
|
12
12
|
#e = void 0;
|
|
13
|
-
#
|
|
14
|
-
#n =
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
#t = !1;
|
|
14
|
+
#n = !1;
|
|
15
|
+
#a = l();
|
|
16
|
+
#h = l();
|
|
17
|
+
#l = l();
|
|
18
|
+
#r;
|
|
19
|
+
#u(e) {
|
|
20
|
+
this.#e === e.pointerId && this.#o();
|
|
21
|
+
}
|
|
22
|
+
#f = (e) => {
|
|
23
|
+
this.#e === e.pointerId && this.#o();
|
|
23
24
|
};
|
|
24
25
|
load() {
|
|
25
|
-
this.manager.onLifecycle(() => (this.#
|
|
26
|
-
this
|
|
27
|
-
}), this.updateComplete.then(() => this.#
|
|
28
|
-
this.#
|
|
26
|
+
this.manager.onLifecycle(() => (this.#r = new ResizeObserver(() => {
|
|
27
|
+
this.#t && this.#i();
|
|
28
|
+
}), this.updateComplete.then(() => this.#g()), () => {
|
|
29
|
+
this.#o(), this.#r?.disconnect(), this.#r = void 0;
|
|
29
30
|
}));
|
|
30
31
|
}
|
|
31
32
|
#x() {
|
|
32
|
-
this
|
|
33
|
-
}
|
|
34
|
-
#f(e) {
|
|
35
|
-
e.button !== 0 || !this.elementInternals.states.has(i) || (e.preventDefault(), e.currentTarget instanceof HTMLElement && (e.currentTarget.focus(), e.currentTarget.setPointerCapture(e.pointerId)), this.#e = e.pointerId, this.#i = !0, this.elementInternals.states.add(m), this.#u(e));
|
|
33
|
+
this.#t && this.#i(), this.#g();
|
|
36
34
|
}
|
|
37
35
|
#v(e) {
|
|
38
|
-
|
|
39
|
-
return;
|
|
40
|
-
this.#s();
|
|
41
|
-
const t = this.#P(e);
|
|
42
|
-
t != null && (e.preventDefault(), e.stopPropagation(), this.#i = !0, this.#c(t));
|
|
36
|
+
e.button !== 0 || !this.#t || (e.preventDefault(), e.currentTarget instanceof HTMLElement && (e.currentTarget.focus(), e.currentTarget.setPointerCapture(e.pointerId)), this.#e = e.pointerId, this.#n = !0, this.elementInternals.states.add(m), this.#m(e));
|
|
43
37
|
}
|
|
44
38
|
#y(e) {
|
|
39
|
+
if (!this.#t)
|
|
40
|
+
return;
|
|
41
|
+
this.#i();
|
|
42
|
+
const t = this.#H(e);
|
|
43
|
+
t != null && (e.preventDefault(), e.stopPropagation(), this.#n = !0, this.#d(t));
|
|
44
|
+
}
|
|
45
|
+
#w(e) {
|
|
45
46
|
if (!e.target)
|
|
46
47
|
return;
|
|
47
48
|
const r = y(e);
|
|
48
|
-
|
|
49
|
+
if (this.#t = r, r) {
|
|
50
|
+
this.elementInternals.states.add(u), this.#i();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.#o(), this.#n || this.#C(), this.elementInternals.states.delete(u);
|
|
49
54
|
}
|
|
50
|
-
#
|
|
55
|
+
#o() {
|
|
51
56
|
const e = this.#e;
|
|
52
57
|
if (!e)
|
|
53
58
|
return;
|
|
54
59
|
this.#e = void 0;
|
|
55
|
-
const t = this.#
|
|
60
|
+
const t = this.#h.value;
|
|
56
61
|
t?.hasPointerCapture(e) && t.releasePointerCapture(e), this.elementInternals.states.delete(m);
|
|
57
62
|
}
|
|
58
|
-
#
|
|
63
|
+
#m(e) {
|
|
59
64
|
if (this.#e !== e.pointerId)
|
|
60
65
|
return;
|
|
61
|
-
const t = this.#
|
|
62
|
-
this.#
|
|
66
|
+
const t = this.#s(), r = this.el.getBoundingClientRect().bottom - e.clientY - t;
|
|
67
|
+
this.#d(r, t);
|
|
63
68
|
}
|
|
64
|
-
#
|
|
69
|
+
#z() {
|
|
65
70
|
const e = Number.parseFloat(this.el.style.getPropertyValue(s));
|
|
66
71
|
if (Number.isFinite(e))
|
|
67
72
|
return e;
|
|
68
|
-
const t = Number.parseFloat(getComputedStyle(this.#
|
|
69
|
-
return Number.isFinite(t) ? Math.max(0, t - this.#
|
|
73
|
+
const t = Number.parseFloat(getComputedStyle(this.#a.value ?? this.el).height);
|
|
74
|
+
return Number.isFinite(t) ? Math.max(0, t - this.#s()) : h;
|
|
70
75
|
}
|
|
71
|
-
#
|
|
76
|
+
#p() {
|
|
72
77
|
return this.el.querySelector(':scope > [slot="bottom-action-bar"]');
|
|
73
78
|
}
|
|
74
|
-
#
|
|
75
|
-
const e = this.#
|
|
79
|
+
#s() {
|
|
80
|
+
const e = this.#p()?.getBoundingClientRect().height ?? 0, t = this.#l.value?.getBoundingClientRect().height ?? 0;
|
|
76
81
|
return e + t;
|
|
77
82
|
}
|
|
78
|
-
#
|
|
83
|
+
#b() {
|
|
79
84
|
return getComputedStyle(this.el).getPropertyValue(H).trim() || null;
|
|
80
85
|
}
|
|
81
|
-
#
|
|
86
|
+
#c(e, t) {
|
|
82
87
|
t ? this.el.style.setProperty(e, t) : this.el.style.removeProperty(e);
|
|
83
88
|
}
|
|
84
|
-
#
|
|
85
|
-
const t = this.#
|
|
89
|
+
#P(e) {
|
|
90
|
+
const t = this.#b();
|
|
86
91
|
if (!t)
|
|
87
92
|
return null;
|
|
88
93
|
const r = Number.parseFloat(t);
|
|
@@ -90,26 +95,26 @@ class R extends v {
|
|
|
90
95
|
return r;
|
|
91
96
|
if (t.endsWith("%") && Number.isFinite(r))
|
|
92
97
|
return this.el.getBoundingClientRect().height * r / 100;
|
|
93
|
-
const o = this.#
|
|
98
|
+
const o = this.#a.value;
|
|
94
99
|
if (!o)
|
|
95
100
|
return null;
|
|
96
|
-
const
|
|
97
|
-
this.el.style.setProperty(
|
|
98
|
-
const
|
|
99
|
-
return this.#
|
|
101
|
+
const a = this.el.style.getPropertyValue(i), p = this.el.style.getPropertyValue(s), b = this.el.style.getPropertyValue(n);
|
|
102
|
+
this.el.style.setProperty(i, `${e}px`), this.el.style.setProperty(s, `${this.el.getBoundingClientRect().height}px`), this.el.style.setProperty(n, t);
|
|
103
|
+
const d = Number.parseFloat(getComputedStyle(o).height);
|
|
104
|
+
return this.#c(i, a), this.#c(s, p), this.#c(n, b), Number.isFinite(d) ? Math.max(0, d - e) : null;
|
|
100
105
|
}
|
|
101
|
-
#
|
|
102
|
-
const e = this.#
|
|
106
|
+
#g() {
|
|
107
|
+
const e = this.#r;
|
|
103
108
|
if (!e)
|
|
104
109
|
return;
|
|
105
110
|
e.disconnect(), e.observe(this.el);
|
|
106
|
-
const t = this.#
|
|
111
|
+
const t = this.#l.value;
|
|
107
112
|
t && e.observe(t);
|
|
108
|
-
const r = this.#
|
|
113
|
+
const r = this.#p();
|
|
109
114
|
r && e.observe(r);
|
|
110
115
|
}
|
|
111
|
-
#
|
|
112
|
-
const t = e.shiftKey ? P : z, r = this.#
|
|
116
|
+
#H(e) {
|
|
117
|
+
const t = e.shiftKey ? P : z, r = this.#z();
|
|
113
118
|
switch (e.key) {
|
|
114
119
|
case "ArrowUp":
|
|
115
120
|
return r + t;
|
|
@@ -119,23 +124,23 @@ class R extends v {
|
|
|
119
124
|
return;
|
|
120
125
|
}
|
|
121
126
|
}
|
|
122
|
-
#
|
|
123
|
-
const r = Math.max(0, this.el.getBoundingClientRect().height - t), o = this.#
|
|
124
|
-
return Math.min(Math.max(e,
|
|
127
|
+
#R(e, t) {
|
|
128
|
+
const r = Math.max(0, this.el.getBoundingClientRect().height - t), o = this.#P(t), a = o == null ? r : Math.min(r, o);
|
|
129
|
+
return Math.min(Math.max(e, h), a);
|
|
125
130
|
}
|
|
126
|
-
#
|
|
127
|
-
const r = this.#
|
|
128
|
-
this.el.style.setProperty(
|
|
131
|
+
#d(e, t = this.#s()) {
|
|
132
|
+
const r = this.#R(e, t), o = this.#b();
|
|
133
|
+
this.el.style.setProperty(i, `${t}px`), this.el.style.setProperty(s, `${r}px`), this.el.style.setProperty(n, o ?? `calc(100% - ${t}px)`);
|
|
129
134
|
}
|
|
130
|
-
#
|
|
131
|
-
this.el.style.removeProperty(
|
|
135
|
+
#C() {
|
|
136
|
+
this.el.style.removeProperty(i), this.el.style.removeProperty(s), this.el.style.removeProperty(n);
|
|
132
137
|
}
|
|
133
|
-
#
|
|
134
|
-
const e = this.#
|
|
135
|
-
return Number.isFinite(t) ? this.#
|
|
138
|
+
#i() {
|
|
139
|
+
const e = this.#s(), t = Number.parseFloat(this.el.style.getPropertyValue(s));
|
|
140
|
+
return Number.isFinite(t) ? this.#d(t, e) : this.el.style.setProperty(i, `${e}px`), e;
|
|
136
141
|
}
|
|
137
142
|
render() {
|
|
138
|
-
return
|
|
143
|
+
return x`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><div class="bottom-drawer" ${c(this.#a)}><div aria-label="Resize results panel" aria-orientation=horizontal class="bottom-drawer-resize-handle" role=separator tabindex=0 @pointercancel=${this.#u} @pointerdown=${this.#v} @pointermove=${this.#m} @pointerup=${this.#u} @lostpointercapture=${this.#f} @keydown=${this.#y} ${c(this.#h)}><div class="bottom-drawer-resize-handle-bar" ${c(this.#l)}><calcite-icon icon=drag-resize-vertical scale=s></calcite-icon></div></div><slot name=bottom-action-bar @slotchange=${this.#x}></slot><slot name=results-panel @slotchange=${this.#w}></slot></div></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`;
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
146
|
g("arcgis-code-editor-shell", R);
|
|
@@ -12,14 +12,14 @@ const w = h`:host{background-color:var(--calcite-color-foreground-1);.notice-con
|
|
|
12
12
|
function $(a) {
|
|
13
13
|
a.key === "Enter" && a.stopPropagation();
|
|
14
14
|
}
|
|
15
|
-
class
|
|
15
|
+
class I extends f {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this._beforeBack = async () => {
|
|
18
18
|
this.removeLastPanelRenderer(), this._filterValue = "";
|
|
19
|
-
}, this.messages = b(), this._filterValue = "", this._flowItemRenderers = [], this._rootPresentation = "profile", this._mutationCounter = 1, this.loading = !1, this.closed = !1, this.arcgisInternalClosePanel = l({ bubbles: !1, composed: !1 }), this.arcgisInternalItemSelected = l({ bubbles: !1 });
|
|
19
|
+
}, this.messages = b(), this._filterValue = "", this._flowItemRenderers = [], this._rootPresentation = "profile", this._mutationCounter = 1, this.loading = !1, this.closed = !1, this.hideDescriptions = !1, this.arcgisInternalClosePanel = l({ bubbles: !1, composed: !1 }), this.arcgisInternalItemSelected = l({ bubbles: !1 });
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
|
-
this.properties = { _filterValue: 16, _flowItemRenderers: 16, _rootPresentation: 16, _mutationCounter: 16, loading: 5, modelId: 1, closed: 5, variable: 0, heading: 1, messageOverrides: 0 };
|
|
22
|
+
this.properties = { _filterValue: 16, _flowItemRenderers: 16, _rootPresentation: 16, _mutationCounter: 16, loading: 5, modelId: 1, closed: 5, variable: 0, heading: 1, hideDescriptions: 5, messageOverrides: 0 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
25
|
this.styles = w;
|
|
@@ -97,6 +97,12 @@ class C extends f {
|
|
|
97
97
|
_getDescriptionForCollection(e) {
|
|
98
98
|
return e ? n(e) ? e.variables[0]?.getLabel() ?? "" : v(e) ? e.datastoreInfo?.name ?? e.getDescription() ?? "" : e.breadcrumb : "";
|
|
99
99
|
}
|
|
100
|
+
_getItemLabel(e) {
|
|
101
|
+
return e.getLabel();
|
|
102
|
+
}
|
|
103
|
+
_getItemDescription(e) {
|
|
104
|
+
return this.hideDescriptions ? "" : e.getDescription();
|
|
105
|
+
}
|
|
100
106
|
renderCollectionBasedVariable(e, t = !1, s = !1) {
|
|
101
107
|
if (!e)
|
|
102
108
|
return null;
|
|
@@ -112,7 +118,7 @@ class C extends f {
|
|
|
112
118
|
return s.length ? s.map((r) => this.renderEditorVariable(r)) : i`<div class="notice-container">${this.messages.noitems}</div>`;
|
|
113
119
|
}
|
|
114
120
|
renderEditorVariable(e) {
|
|
115
|
-
return e.type === "group" ? this._isRootPresentation("featureSetRoot") && e.isHeader ? i`<calcite-list-item-group .heading=${
|
|
121
|
+
return e.type === "group" ? this._isRootPresentation("featureSetRoot") && e.isHeader ? i`<calcite-list-item-group .heading=${this._getItemLabel(e)}></calcite-list-item-group>` : this._isRootPresentation("featureSetRoot") && e._label?.code === "fields" ? this.renderEditorVariables(e) : i`<calcite-list-item-group .heading=${this._getItemLabel(e)}>${this.renderEditorVariables(e)}</calcite-list-item-group>` : i`<calcite-list-item .label=${this._getItemLabel(e)} .description=${this._getItemDescription(e)} @calciteListItemSelect=${(t) => this._emitItemSelected(t, e)} @keydown=${(t) => this._emitItemSelected(t, e)}>${e.isCollection ? i`<calcite-action slot=actions-end .text=${this.messages.expand ?? ""} scale=s icon=chevron-right icon-flip-rtl @click=${(t) => this._showCollectionPanel(t, e)} @keydown=${$}></calcite-action>` : null}${e.icon ? i`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>` : null}</calcite-list-item>`;
|
|
116
122
|
}
|
|
117
123
|
render() {
|
|
118
124
|
return this.closed ? null : this.loading && !this.variable ? i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading ?? this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? ""}></calcite-loader></calcite-flow-item></calcite-flow>` : !this.loading && (!this.variable || this.variable?.loaded && !this.variable?.variables.length) ? i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading ?? this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.profileempty}</div></calcite-flow-item></calcite-flow>` : i`<calcite-flow ${d(this.flowFocusHandler)}>${this.renderCollectionBasedVariable(this.variable, !0, this._flowItemRenderers.length === 0)}${this._flowItemRenderers.map((e, t, s) => (
|
|
@@ -121,7 +127,7 @@ class C extends f {
|
|
|
121
127
|
))}</calcite-flow>`;
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
|
-
c("arcgis-editor-variables",
|
|
130
|
+
c("arcgis-editor-variables", I);
|
|
125
131
|
export {
|
|
126
|
-
|
|
132
|
+
I as ArcgisEditorVariables
|
|
127
133
|
};
|
|
@@ -12,6 +12,17 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export abstract class ArcgisSqlExpressionEditor extends LitElement {
|
|
15
|
+
/**
|
|
16
|
+
* If true, field aliases are hidden in the fields panel so only field names are displayed.
|
|
17
|
+
* Validation, completion, and inserted field snippets are unchanged.
|
|
18
|
+
*
|
|
19
|
+
* @default false
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <arcgis-sql-expression-editor hideDescriptionsInFieldsPanel></arcgis-sql-expression-editor>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
accessor hideDescriptionsInFieldsPanel: boolean;
|
|
15
26
|
/**
|
|
16
27
|
* If true, it will hide the side actions bar. The editor will be in a minimalistic UX.
|
|
17
28
|
*
|
|
@@ -4,17 +4,17 @@ import { css as c, html as t } from "lit";
|
|
|
4
4
|
import { LitElement as l, createEvent as o, safeClassMap as r } from "@arcgis/lumina";
|
|
5
5
|
import { generateGuid as d } from "@arcgis/toolkit/string";
|
|
6
6
|
import { a as s } from "../../chunks/sql-expr-defaults.js";
|
|
7
|
-
import { u as
|
|
8
|
-
import { createRef as
|
|
7
|
+
import { u as h } from "../../chunks/useT9n.js";
|
|
8
|
+
import { createRef as p, ref as g } from "lit/directives/ref.js";
|
|
9
9
|
import { getSqlExprDiagnosticService as _ } from "../../chunks/sql-expr-mode.js";
|
|
10
10
|
import { rethrowError as a } from "@arcgis/toolkit/log";
|
|
11
11
|
const f = c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`;
|
|
12
12
|
class m extends l {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments), this._codeEditorElt =
|
|
14
|
+
super(...arguments), this._codeEditorElt = p(), this._disposables = [], this.messages = h(), this._modelId = d(), this._preparing = !1, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.hideDescriptionsInFieldsPanel = !1, this.arcgisDiagnosticsChange = o({ bubbles: !1 }), this.arcgisScriptChange = o({ bubbles: !1 });
|
|
15
15
|
}
|
|
16
16
|
static {
|
|
17
|
-
this.properties = { _activeAction: 16, _apiLibrary: 16, _editorProfile: 16, _preparing: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5, messageOverrides: 0 };
|
|
17
|
+
this.properties = { _activeAction: 16, _apiLibrary: 16, _editorProfile: 16, _preparing: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5, messageOverrides: 0, hideDescriptionsInFieldsPanel: 5 };
|
|
18
18
|
}
|
|
19
19
|
static {
|
|
20
20
|
this.styles = [f];
|
|
@@ -82,7 +82,7 @@ class m extends l {
|
|
|
82
82
|
}
|
|
83
83
|
render() {
|
|
84
84
|
const i = this._getFeatureSetVariable();
|
|
85
|
-
return t`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} ${g(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar && i && t`<arcgis-editor-variables slot=side-panel .variable=${i} .closed=${this._activeAction !== "fields"} class=${r(this._activeAction === "fields" ? "" : "hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${() => this._setActiveAction(void 0)} data-panel-name=none .messageOverrides=${{ profileempty: this.messages.profileempty }}></arcgis-editor-variables>` || ""}${!this.hideSideBar && t`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction === "functions" ? "" : "hidden")} .closed=${this._activeAction !== "functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${() => this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${s.languageId}></arcgis-language-api-panel>` || ""}${!this.hideSideBar && t`<calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i && t`<calcite-action id=fields-action .text=${this.messages.fields ?? "Fields"} icon=profile-variables .active=${this._activeAction === "fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>` || ""}${i && !this.sideActionBarExpanded && t`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields ?? "Fields"}</span></calcite-tooltip>` || ""}<calcite-action id=functions-action .text=${this.messages.functions ?? "Functions"} icon=function .active=${this._activeAction === "functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && t`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions ?? "Functions"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</arcgis-code-editor-shell>`;
|
|
85
|
+
return t`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} ${g(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar && i && t`<arcgis-editor-variables slot=side-panel .variable=${i} .hideDescriptions=${this.hideDescriptionsInFieldsPanel} .closed=${this._activeAction !== "fields"} class=${r(this._activeAction === "fields" ? "" : "hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${() => this._setActiveAction(void 0)} data-panel-name=none .messageOverrides=${{ profileempty: this.messages.profileempty }}></arcgis-editor-variables>` || ""}${!this.hideSideBar && t`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction === "functions" ? "" : "hidden")} .closed=${this._activeAction !== "functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${() => this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${s.languageId}></arcgis-language-api-panel>` || ""}${!this.hideSideBar && t`<calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i && t`<calcite-action id=fields-action .text=${this.messages.fields ?? "Fields"} icon=profile-variables .active=${this._activeAction === "fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>` || ""}${i && !this.sideActionBarExpanded && t`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields ?? "Fields"}</span></calcite-tooltip>` || ""}<calcite-action id=functions-action .text=${this.messages.functions ?? "Functions"} icon=function .active=${this._activeAction === "functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && t`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions ?? "Functions"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</arcgis-code-editor-shell>`;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
n("arcgis-sql-expression-editor", m);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as p } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as h, html as
|
|
3
|
+
import { css as h, html as o } from "lit";
|
|
4
4
|
import { LitElement as g, createEvent as l, safeClassMap as m } from "@arcgis/lumina";
|
|
5
5
|
import { generateGuid as u } from "@arcgis/toolkit/string";
|
|
6
6
|
import { u as f } from "../../chunks/useT9n.js";
|
|
7
|
-
import { createRef as
|
|
7
|
+
import { createRef as b, ref as _ } from "lit/directives/ref.js";
|
|
8
8
|
import { k as d } from "../../chunks/utils.js";
|
|
9
9
|
import { e as E } from "../../chunks/utilities.js";
|
|
10
10
|
import "@arcgis/core/portal/PortalItem.js";
|
|
@@ -14,7 +14,7 @@ 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
|
|
17
|
+
import { rethrowError as r } from "@arcgis/toolkit/log";
|
|
18
18
|
import "@arcgis/core/core/Error.js";
|
|
19
19
|
import { d as n } from "../../chunks/language-defaults-base.js";
|
|
20
20
|
import "@arcgis/core/portal/Portal.js";
|
|
@@ -23,7 +23,7 @@ import { getSqlLayerDiagnosticService as x } from "../../chunks/sql-layer-mode.j
|
|
|
23
23
|
const I = h`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`;
|
|
24
24
|
class L extends g {
|
|
25
25
|
constructor() {
|
|
26
|
-
super(...arguments), this._codeEditorElt =
|
|
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 });
|
|
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 };
|
|
@@ -38,10 +38,10 @@ class L extends g {
|
|
|
38
38
|
await this._codeEditorElt.value?.setFocus();
|
|
39
39
|
}
|
|
40
40
|
async load() {
|
|
41
|
-
await this._updateDataModelDeps().catch(
|
|
41
|
+
await this._updateDataModelDeps().catch(r(this));
|
|
42
42
|
}
|
|
43
43
|
willUpdate(e) {
|
|
44
|
-
e.has("profile") && this._updateDataModelDeps().catch(
|
|
44
|
+
e.has("profile") && this._updateDataModelDeps().catch(r(this));
|
|
45
45
|
}
|
|
46
46
|
async loaded() {
|
|
47
47
|
const e = x();
|
|
@@ -71,7 +71,7 @@ class L extends g {
|
|
|
71
71
|
this.sideActionBarExpanded = !this.sideActionBarExpanded;
|
|
72
72
|
}
|
|
73
73
|
_toggleSidePanel(e) {
|
|
74
|
-
this.openedSidePanel = this.openedSidePanel === e ? "none" : e
|
|
74
|
+
this.openedSidePanel = this.openedSidePanel === e ? "none" : e;
|
|
75
75
|
}
|
|
76
76
|
_onCodeEditorValueChange(e) {
|
|
77
77
|
e.stopPropagation(), this.script = e.detail, this.arcgisScriptChange.emit(e.detail);
|
|
@@ -80,7 +80,7 @@ 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(
|
|
83
|
+
this._codeEditorElt.value?.insertText(e.detail).catch(r(this));
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
await t.loadSource();
|
|
@@ -99,9 +99,9 @@ class L extends g {
|
|
|
99
99
|
render() {
|
|
100
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
101
|
${i}`;
|
|
102
|
-
return
|
|
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=${() => {
|
|
103
103
|
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 &&
|
|
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>`;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
p("arcgis-sql-layer-editor", L);
|