@arcgis/coding-components 4.31.0-next.2 → 4.31.0-next.21
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/README.md +22 -3
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +6 -6
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +5 -5
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/css.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/html.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/json.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +33 -0
- package/dist/arcgis-coding-components/assets/code-editor/ts.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/language-api-panel/t9n/language-api-panel.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/sql-expression-editor/api/sql-expression-api.t9n.en.json +735 -0
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-7984ea8e.js → p-1b799777.js} +2 -2
- package/dist/arcgis-coding-components/p-4d5cf512.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-60c2a820.js → p-56266a64.js} +2 -2
- package/dist/arcgis-coding-components/{p-e8211ffe.js → p-57b8bcd7.js} +1 -1
- package/dist/arcgis-coding-components/{p-9eced6fc.js → p-5b67b62b.js} +2 -2
- package/dist/arcgis-coding-components/{p-93a97573.js → p-64137fec.js} +3 -3
- package/dist/arcgis-coding-components/{p-e7ee4d64.js → p-6621a80f.js} +3 -3
- package/dist/arcgis-coding-components/p-77dd5521.js +6 -0
- package/dist/arcgis-coding-components/p-8eb7e694.js +6 -0
- package/dist/arcgis-coding-components/p-a2341e0c.js +6 -0
- package/dist/arcgis-coding-components/{p-bb7e832e.js → p-b715834b.js} +3 -3
- package/dist/arcgis-coding-components/p-cbee273f.js +6 -0
- package/dist/arcgis-coding-components/{p-5ef7cce5.js → p-cdc52d2f.js} +1 -1
- package/dist/arcgis-coding-components/{p-36fedc23.js → p-d7d1f130.js} +12 -12
- package/dist/arcgis-coding-components/p-e1f9b463.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-62ee6251.js → p-e5a924a1.js} +1 -1
- package/dist/arcgis-coding-components/p-f2d64a9d.js +6 -0
- package/dist/arcgis-coding-components/{p-03ea6cd7.js → p-ff62d134.js} +3 -3
- package/dist/arcgis-coding-components/p-ffce0588.entry.js +6 -0
- package/dist/cjs/{app-globals-aee5f4b5.js → app-globals-a9ef3ca8.js} +1 -1
- package/dist/cjs/arcade-defaults-f5241680.js +349 -0
- package/dist/cjs/arcade-language-features-0b9f3947.js +274 -0
- package/dist/cjs/arcade-mode-cc08d9cd.js +335 -0
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +181 -1501
- package/dist/cjs/arcgis-coding-components.cjs.js +4 -4
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +81 -0
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +80 -0
- package/dist/cjs/{css-7cc05f76.js → css-bb6a49ec.js} +1 -1
- package/dist/cjs/{cssMode-2b0daeae.js → cssMode-e7fac7d7.js} +3 -4
- package/dist/cjs/{html-f56911e1.js → html-7ff4071d.js} +3 -4
- package/dist/cjs/{htmlMode-43eed674.js → htmlMode-c89193ec.js} +3 -4
- package/dist/cjs/{index-b34238a6.js → index-4b7880ab.js} +9 -1
- package/dist/cjs/index.cjs.js +4 -3
- package/dist/cjs/{javascript-5115cb76.js → javascript-864c0220.js} +3 -4
- package/dist/cjs/{jsonMode-550dda36.js → jsonMode-ac4a7be7.js} +3 -4
- package/dist/cjs/{arcade-defaults-a8d8f8e2.js → language-defaults-base-57b37f9f.js} +842 -1183
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/sql-expr-defaults-245b036d.js +1347 -0
- package/dist/cjs/sql-expr-mode-304f5ce2.js +20844 -0
- package/dist/cjs/{tsMode-336306a9.js → tsMode-d30d4ab1.js} +4 -5
- package/dist/cjs/{typescript-b395242f.js → typescript-6c87ddb3.js} +3 -4
- package/dist/components/arcade-defaults.js +54 -1369
- package/dist/components/arcade-language-features.js +271 -0
- package/dist/components/arcade-mode.js +4 -264
- package/dist/components/arcade-results.js +7 -5
- package/dist/components/arcade-suggestions.js +7 -5
- package/dist/components/arcade-variables.js +8 -6
- package/dist/components/arcgis-arcade-editor.js +37 -35
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.js +1 -1
- package/dist/components/arcgis-assets.d.ts +1 -1
- package/dist/components/arcgis-assets.js +1 -1
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/arcgis-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-editor.js +120 -0
- package/dist/components/arcgis-sql-expression-fields.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-fields.js +11 -0
- package/dist/components/chunk-2JTWBRMN.js +1154 -0
- package/dist/components/code-editor.js +40 -13
- package/dist/components/fields.js +5 -5
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +30 -22
- package/dist/components/language-api-panel.js +13 -40
- package/dist/components/language-defaults-base.js +1309 -0
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +196 -0
- package/dist/components/sql-expr-mode.js +20842 -0
- package/dist/components/sql-expression-fields.js +102 -0
- package/dist/components/useT9n.js +45 -8
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-59faaf33.js → app-globals-6d0ca11d.js} +1 -1
- package/dist/esm/arcade-defaults-066445c4.js +344 -0
- package/dist/esm/arcade-language-features-0e00c199.js +269 -0
- package/dist/esm/{arcade-mode-5d46035e.js → arcade-mode-abf1e1cf.js} +3 -263
- package/dist/esm/arcgis-arcade-editor_6.entry.js +127 -1447
- package/dist/esm/arcgis-coding-components.js +5 -5
- package/dist/esm/arcgis-sql-expression-editor.entry.js +77 -0
- package/dist/esm/arcgis-sql-expression-fields.entry.js +76 -0
- package/dist/esm/{css-e257dc49.js → css-c6dae12d.js} +1 -1
- package/dist/esm/{cssMode-c11f7f40.js → cssMode-052bb603.js} +2 -3
- package/dist/esm/{html-a6c37a99.js → html-572696a1.js} +2 -3
- package/dist/esm/{htmlMode-1270bc7d.js → htmlMode-fc184f2d.js} +2 -3
- package/dist/esm/{index-a970952c.js → index-0edd9846.js} +9 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/{javascript-ee179624.js → javascript-8bfc0096.js} +3 -4
- package/dist/esm/{jsonMode-07502ccb.js → jsonMode-7adf94ff.js} +2 -3
- package/dist/esm/{arcade-defaults-9eb28407.js → language-defaults-base-85a7f476.js} +833 -1179
- package/dist/esm/loader.js +5 -5
- package/dist/esm/sql-expr-defaults-be84ec7f.js +1339 -0
- package/dist/esm/sql-expr-mode-a4413e5c.js +20840 -0
- package/dist/esm/{tsMode-96749a12.js → tsMode-d10773c8.js} +2 -3
- package/dist/esm/{typescript-a3cf9881.js → typescript-9491f23e.js} +2 -3
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +45 -10
- package/dist/types/components/arcade-results/arcade-results.d.ts +43 -1
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +22 -1
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +28 -1
- package/dist/types/components/code-editor/code-editor.d.ts +16 -5
- package/dist/types/components/language-api-panel/language-api-panel.d.ts +34 -8
- package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +24 -0
- package/dist/types/components/sql-expression-fields/sql-expression-fields.d.ts +32 -0
- package/dist/types/components.d.ts +98 -24
- package/dist/types/data/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 +8 -1
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +5 -1
- package/dist/types/data/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 +13 -0
- package/dist/types/dependencies.d.ts +6 -10
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
- package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
- package/dist/types/utils/fields.d.ts +2 -2
- package/dist/types/utils/language-defaults-base.d.ts +2 -9
- package/dist/types/utils/profile/editor-profile.d.ts +7 -6
- package/dist/types/utils/profile/types.d.ts +53 -65
- package/dist/types/utils/profile/utils.d.ts +9 -8
- package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +41 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +16 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +26 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +37 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +11 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +122 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +5 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +18 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +6 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +156 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +150 -0
- package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +1397 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +6 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +45 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +21 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +39 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-syntax.d.ts +8 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +43 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +34 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +100 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +41 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +17 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +24 -0
- package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +13 -0
- package/dist/types/utils/sql-expr-monaco/types.d.ts +89 -0
- package/package.json +27 -21
- package/dist/arcgis-coding-components/p-0c6de9b3.js +0 -6
- package/dist/arcgis-coding-components/p-81c37dab.entry.js +0 -6
- package/dist/cjs/arcade-mode-b85ae7d4.js +0 -595
- package/dist/components/chunk-IHYYRFLQ.js +0 -1363
- package/dist/types/components/arcade-editor/t9n-types.d.ts +0 -8
- package/dist/types/components/arcade-results/t9n-types.d.ts +0 -13
- package/dist/types/components/arcade-suggestions/t9n-types.d.ts +0 -6
- package/dist/types/components/arcade-variables/t9n-types.d.ts +0 -8
- package/dist/types/components/language-api-panel/t9n-types.d.ts +0 -8
- package/dist/types/utils/profile/predefined-profile.d.ts +0 -2
|
@@ -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.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h } from '@stencil/core/internal/client';
|
|
7
|
-
import { u as useControllerManager } from './chunk-
|
|
8
|
-
import {
|
|
7
|
+
import { u as useControllerManager } from './chunk-2JTWBRMN.js';
|
|
8
|
+
import { r as setFocusOnElement, d as createFilterExpression } from './index2.js';
|
|
9
9
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
10
10
|
import { u as useT9n } from './useT9n.js';
|
|
11
11
|
import "@esri/calcite-components/dist/components/calcite-flow-item.js";
|
|
@@ -28,6 +28,7 @@ function stopEnterPropagation(e) {
|
|
|
28
28
|
}
|
|
29
29
|
const __cmpMeta = [1,"arcgis-arcade-variables",{"loading":[1028],"modelId":[1025,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},undefined,{"modelId":["modelIdPropChanged"]}];
|
|
30
30
|
const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeVariables extends HTMLElement {
|
|
31
|
+
connectedCallback() { this.manager._connectedCallback(); }
|
|
31
32
|
constructor() {
|
|
32
33
|
super();
|
|
33
34
|
this.__registerHost();
|
|
@@ -80,6 +81,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
80
81
|
}
|
|
81
82
|
//#endregion
|
|
82
83
|
disconnectedCallback() {
|
|
84
|
+
this.manager._disconnectedCallback();
|
|
83
85
|
this._flowObserver?.disconnect();
|
|
84
86
|
}
|
|
85
87
|
// #endregion
|
|
@@ -133,7 +135,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
133
135
|
});
|
|
134
136
|
loading = true;
|
|
135
137
|
}
|
|
136
|
-
return (h("calcite-flow-item", { heading: this.messages.profilevariables, description: collection.breadcrumb, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this.messages.backtotop ?? "
|
|
138
|
+
return (h("calcite-flow-item", { heading: this.messages.profilevariables, description: collection.breadcrumb, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this.messages.backtotop ?? "", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h("calcite-input", { value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this.messages.loading ?? "" })) : (h("calcite-list", null, this.renderEditorVariables(collection)))));
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
141
|
renderEditorVariables(collection) {
|
|
@@ -141,7 +143,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
141
143
|
const filterExpression = createFilterExpression(this._filterValue);
|
|
142
144
|
const filteredVariables = collection.variables.filter((variable) => variable.passFilter(filterExpression));
|
|
143
145
|
if (!filteredVariables.length) {
|
|
144
|
-
return h("div", { class: "notice-container" }, this.messages.noitems
|
|
146
|
+
return h("div", { class: "notice-container" }, this.messages.noitems);
|
|
145
147
|
}
|
|
146
148
|
return filteredVariables.map((variable) => this.renderEditorVariable(variable));
|
|
147
149
|
}
|
|
@@ -157,7 +159,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
157
159
|
render() {
|
|
158
160
|
const profile = arcadeDefaults.getEditorProfileForModel(this.modelId ?? "");
|
|
159
161
|
if (!this.loading && !profile?.variables.length) {
|
|
160
|
-
return (h("calcite-flow", null, h("calcite-flow-item", { heading: this.messages.profilevariables, closable: true, onCalciteFlowItemClose: this._emitClose }, h("div", { class: "notice-container" }, this.messages.noprofilevariablesmessage
|
|
162
|
+
return (h("calcite-flow", null, h("calcite-flow-item", { heading: this.messages.profilevariables, closable: true, onCalciteFlowItemClose: this._emitClose }, h("div", { class: "notice-container" }, this.messages.noprofilevariablesmessage))));
|
|
161
163
|
}
|
|
162
164
|
return (h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, this.collectionBasedVariableRenderer(profile, true)(), this._flowItemRenderers.map((renderer) => renderer())));
|
|
163
165
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
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.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { KeyCode } from 'monaco-editor';
|
|
8
8
|
import { d as defineCustomElement$6, e as executeScript, D as DevelopersWebSitePath } from './arcade-results.js';
|
|
9
9
|
import { d as defineCustomElement$3, u as updateThemeColors, c as colorRulesKeys, s as setupMonacoEnvironment } from './code-editor.js';
|
|
10
|
-
import { u as useControllerManager } from './chunk-
|
|
10
|
+
import { u as useControllerManager, g as getSet } from './chunk-2JTWBRMN.js';
|
|
11
11
|
import { D as Deferred, g as generateGuid, e as getElementTheme } from './index2.js';
|
|
12
12
|
import { b as arcadeDefaults, g as getArcadeDiagnosticService } from './arcade-defaults.js';
|
|
13
13
|
import { u as useT9n } from './useT9n.js';
|
|
@@ -23,8 +23,9 @@ import { getArcgisAssetPath as getAssetPath } from "./arcgis-assets.js";
|
|
|
23
23
|
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}";
|
|
24
24
|
const ArcgisArcadeEditorStyle0 = arcadeEditorCss;
|
|
25
25
|
|
|
26
|
-
const __cmpMeta = [0,"arcgis-arcade-editor",{"profile":[1040],"script":[1025],"testData":[1040],"suggestions":[1040],"snippets":[1040],"hideDocumentationActions":[1028,"hide-documentation-actions"],"hideSideBar":[1028,"hide-side-bar"],"sideActionBarExpanded":[1540,"side-action-bar-expanded"],"openedSidePanel":[1537,"opened-side-panel"],"editorOptions":[1040],"editorInstance":[1040],"
|
|
26
|
+
const __cmpMeta = [0,"arcgis-arcade-editor",{"profile":[1040],"script":[1025],"testData":[1040],"suggestions":[1040],"snippets":[1040],"hideDocumentationActions":[1028,"hide-documentation-actions"],"hideSideBar":[1028,"hide-side-bar"],"sideActionBarExpanded":[1540,"side-action-bar-expanded"],"openedSidePanel":[1537,"opened-side-panel"],"editorOptions":[1040],"editorInstance":[1040],"_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]},undefined,{"messages":["_messagesChanged"],"profile":["_profileChanged"],"testData":["_testDataChanged"],"snippets":["_snippetChanged"]}];
|
|
27
27
|
const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeEditor extends HTMLElement {
|
|
28
|
+
connectedCallback() { this.manager._connectedCallback(); }
|
|
28
29
|
constructor() {
|
|
29
30
|
super();
|
|
30
31
|
this.__registerHost();
|
|
@@ -50,7 +51,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
50
51
|
this._executingScript = true;
|
|
51
52
|
this._consoleLogs = [];
|
|
52
53
|
setTimeout(() => void (async () => {
|
|
53
|
-
const script =
|
|
54
|
+
const script = this._codeEditorElt?.value;
|
|
54
55
|
this._executionResult = await executeScript(editorProfile.definition, script, testContext, (log) => setTimeout(() => (this._consoleLogs = [...this._consoleLogs, log]), 0));
|
|
55
56
|
this._executingScript = false;
|
|
56
57
|
})(), 0);
|
|
@@ -83,14 +84,15 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
83
84
|
this._insertAsText = (e) => void this._codeEditorElt?.insertText(e.detail).catch(console.error);
|
|
84
85
|
this._onResultPanelChange = (e) => void (this._resultPanel = e.detail);
|
|
85
86
|
this._onExecutionPanelClose = () => void (this._showExecutionPanel = false);
|
|
86
|
-
this.
|
|
87
|
-
this._preparingProfile = false;
|
|
87
|
+
this._preparingArcade = false;
|
|
88
88
|
this._editorProfile = undefined;
|
|
89
|
+
this._apiLibrary = undefined;
|
|
89
90
|
this._showExecutionPanel = false;
|
|
90
91
|
this._resultPanel = "output";
|
|
91
92
|
this._executingScript = false;
|
|
92
93
|
this._consoleLogs = [];
|
|
93
94
|
this._executionResult = undefined;
|
|
95
|
+
this.messages = useT9n();
|
|
94
96
|
this.profile = undefined;
|
|
95
97
|
this.script = "";
|
|
96
98
|
this.testData = undefined;
|
|
@@ -101,13 +103,16 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
101
103
|
this.sideActionBarExpanded = false;
|
|
102
104
|
this.openedSidePanel = "none";
|
|
103
105
|
this.editorOptions = undefined;
|
|
104
|
-
this.editorInstance =
|
|
106
|
+
this.editorInstance = getSet(undefined, {
|
|
105
107
|
get: () => this._codeEditorElt?.editorInstance,
|
|
106
108
|
set: "ignore",
|
|
107
109
|
});
|
|
108
110
|
}
|
|
111
|
+
_messagesChanged() {
|
|
112
|
+
this._updateArcadeDefaults().catch(console.error);
|
|
113
|
+
}
|
|
109
114
|
_profileChanged() {
|
|
110
|
-
this.
|
|
115
|
+
this._updateArcadeDefaults().catch(console.error);
|
|
111
116
|
}
|
|
112
117
|
_testDataChanged() {
|
|
113
118
|
if (!this._showExecutionPanel) {
|
|
@@ -156,7 +161,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
156
161
|
return { type: "error", value: "Missing editor profile", error: null };
|
|
157
162
|
}
|
|
158
163
|
await this._componentReadyDefer.promise;
|
|
159
|
-
const script =
|
|
164
|
+
const script = this._codeEditorElt?.value;
|
|
160
165
|
return await executeScript(editorProfile.definition, script, this.testData);
|
|
161
166
|
}
|
|
162
167
|
/**
|
|
@@ -189,9 +194,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
189
194
|
// However, we need to setup the environment before the code editor is instantiated because
|
|
190
195
|
// we need to access the arcade language service to get the api library.
|
|
191
196
|
setupMonacoEnvironment(assetsPath);
|
|
192
|
-
await this.
|
|
193
|
-
// The profile has to be refreshed on locale change
|
|
194
|
-
this.manager.watch("messages", () => void this._updateEditorProfile().catch(console.error));
|
|
197
|
+
await this._updateArcadeDefaults();
|
|
195
198
|
}
|
|
196
199
|
async componentDidLoad() {
|
|
197
200
|
// Mark on component as ready.
|
|
@@ -200,7 +203,7 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
200
203
|
// Start listening to the validation diagnostics.
|
|
201
204
|
// We are doing this as late as possible
|
|
202
205
|
const diagnosticsService = await getArcadeDiagnosticService();
|
|
203
|
-
this._disposables.push(diagnosticsService.onDiagnosticsChange((event) => !this.
|
|
206
|
+
this._disposables.push(diagnosticsService.onDiagnosticsChange((event) => !this._preparingArcade && this.arcgisDiagnosticsChange.emit(event.diagnostics)));
|
|
204
207
|
// Get editor instance and add action
|
|
205
208
|
this.editorInstance?.addAction({
|
|
206
209
|
// An unique identifier for the action.
|
|
@@ -218,35 +221,32 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
218
221
|
await this._codeEditorElt?.setFocus();
|
|
219
222
|
}
|
|
220
223
|
disconnectedCallback() {
|
|
221
|
-
|
|
222
|
-
arcadeDefaults.
|
|
224
|
+
this.manager._disconnectedCallback();
|
|
225
|
+
arcadeDefaults.disposeForModel(this._modelId);
|
|
223
226
|
while (this._disposables.length) {
|
|
224
227
|
this._disposables.pop()?.dispose();
|
|
225
228
|
}
|
|
226
229
|
}
|
|
227
230
|
// #endregion
|
|
228
231
|
// #region Private methods API
|
|
229
|
-
async
|
|
230
|
-
// The
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
this._preparingProfile = true;
|
|
232
|
+
async _updateArcadeDefaults() {
|
|
233
|
+
// The profile definition or the locale has changed.
|
|
234
|
+
// Ask the arcade defaults to prepare the profile for the model and to download the api library.
|
|
235
|
+
this._preparingArcade = true;
|
|
234
236
|
try {
|
|
235
|
-
// Set a new profile for the model using the profile definition and the locale.
|
|
236
237
|
await arcadeDefaults.setProfileForModel(this._modelId, this.profile, {
|
|
237
238
|
locale: this.messages._t9nLocale,
|
|
238
239
|
snippets: this.snippets,
|
|
239
240
|
});
|
|
240
|
-
// Get the corresponding editor profile for the model.
|
|
241
|
-
// The editor profile contains the specialized profile for the UI.
|
|
242
241
|
this._editorProfile = arcadeDefaults.getEditorProfileForModel(this._modelId);
|
|
242
|
+
this._apiLibrary = await arcadeDefaults.getApiLibrary(this._modelId);
|
|
243
243
|
}
|
|
244
244
|
catch {
|
|
245
245
|
this._editorProfile = undefined;
|
|
246
246
|
}
|
|
247
247
|
finally {
|
|
248
248
|
this._editorProfilePromise = Promise.resolve(this._editorProfile);
|
|
249
|
-
this.
|
|
249
|
+
this._preparingArcade = false;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
// #endregion
|
|
@@ -255,17 +255,17 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
255
255
|
if (!this.testData) {
|
|
256
256
|
return null;
|
|
257
257
|
}
|
|
258
|
-
return (h("calcite-action-bar", { class: "main-action-bar", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { scale: "s" }, h("calcite-action", { text: this.messages.run ?? "
|
|
258
|
+
return (h("calcite-action-bar", { class: "main-action-bar", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { scale: "s" }, h("calcite-action", { text: this.messages.run ?? "", textEnabled: true, icon: "play", scale: "s", loading: this._preparingArcade, onClick: () => void this._executeScript().catch(console.error) }), this._executionResult ? (h("calcite-action", { text: this.messages.lastresults ?? "", active: this._showExecutionPanel, textEnabled: true, icon: "access-string-results", iconFlipRtl: true, scale: "s", onClick: this._toggleShowExecutionPanel })) : null)));
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region Render Main Panel
|
|
262
262
|
renderMainPanel() {
|
|
263
|
-
return (h("arcgis-code-editor", { class: "flex-adjustable", language: arcadeDefaults.languageId, value: this.script ?? "", modelId: this._modelId,
|
|
263
|
+
return (h("arcgis-code-editor", { class: "flex-adjustable", editorOptions: this.editorOptions, language: arcadeDefaults.languageId, value: this.script ?? "", modelId: this._modelId, onArcgisValueChange: this._onCodeEditorValueChange, ref: (e) => (this._codeEditorElt = e) }));
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region Rendering the Action Bar
|
|
267
|
-
renderAction({ id, label, icon, active, panelName, onClick = this._toggleSidePanel, }) {
|
|
268
|
-
return (h(Fragment, null, h("calcite-action", { id: id, text: label, icon: icon, active: active, onClick: onClick, "data-panel-name": panelName }), !this.sideActionBarExpanded && (h("calcite-tooltip", {
|
|
267
|
+
renderAction({ id, label, icon, active, panelName, iconFlipRtl = false, onClick = this._toggleSidePanel, }) {
|
|
268
|
+
return (h(Fragment, null, h("calcite-action", { id: id, text: label, icon: icon, active: active, onClick: onClick, "data-panel-name": panelName, iconFlipRtl: iconFlipRtl }), !this.sideActionBarExpanded && (h("calcite-tooltip", { "reference-element": id }, h("span", null, label)))));
|
|
269
269
|
}
|
|
270
270
|
renderSideActionBar() {
|
|
271
271
|
if (this.hideSideBar) {
|
|
@@ -273,20 +273,20 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
273
273
|
}
|
|
274
274
|
return (h("calcite-action-bar", { class: "side-action-bar border-inline-start", expanded: !!this.sideActionBarExpanded, position: "end", onCalciteActionBarToggle: this._toggleSideActionBarExpanded }, h("calcite-action-group", null, this.renderAction({
|
|
275
275
|
id: "profile-variables-action",
|
|
276
|
-
label: this.messages.profilevariables ?? "
|
|
276
|
+
label: this.messages.profilevariables ?? "",
|
|
277
277
|
icon: "profile-variables",
|
|
278
278
|
active: this.openedSidePanel === "variables",
|
|
279
279
|
panelName: "variables",
|
|
280
280
|
}), this.renderAction({
|
|
281
281
|
id: "function-action",
|
|
282
|
-
label: this.messages.constantsandfunctions ?? "
|
|
282
|
+
label: this.messages.constantsandfunctions ?? "",
|
|
283
283
|
icon: "function",
|
|
284
284
|
active: this.openedSidePanel === "api",
|
|
285
285
|
panelName: "api",
|
|
286
286
|
}), this.suggestions?.length
|
|
287
287
|
? this.renderAction({
|
|
288
288
|
id: "suggestions-action",
|
|
289
|
-
label: this.messages.suggestions ?? "
|
|
289
|
+
label: this.messages.suggestions ?? "",
|
|
290
290
|
icon: "lightbulb",
|
|
291
291
|
active: this.openedSidePanel === "suggestions",
|
|
292
292
|
panelName: "suggestions",
|
|
@@ -295,10 +295,11 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
295
295
|
? null
|
|
296
296
|
: this.renderAction({
|
|
297
297
|
id: "developer-website-action",
|
|
298
|
-
label: this.messages.help ?? "
|
|
298
|
+
label: this.messages.help ?? "",
|
|
299
299
|
icon: "question",
|
|
300
300
|
active: false,
|
|
301
301
|
panelName: "none",
|
|
302
|
+
iconFlipRtl: this.messages._lang === "ar",
|
|
302
303
|
onClick: this._openArcadeHelp,
|
|
303
304
|
}))));
|
|
304
305
|
}
|
|
@@ -310,9 +311,9 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
310
311
|
}
|
|
311
312
|
switch (this.openedSidePanel) {
|
|
312
313
|
case "api":
|
|
313
|
-
return (h("arcgis-language-api-panel", { class: "side-panel flex-panel border-inline-start",
|
|
314
|
+
return (h("arcgis-language-api-panel", { class: "side-panel flex-panel border-inline-start", loading: this._preparingArcade, apiLibrary: this._apiLibrary, hideDocumentationActions: this.hideDocumentationActions, onArcgisItemSelected: this._insertAsSnippet, onArcgisClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
314
315
|
case "variables":
|
|
315
|
-
return (h("arcgis-arcade-variables", { class: "side-panel flex-panel border-inline-start", loading: this.
|
|
316
|
+
return (h("arcgis-arcade-variables", { class: "side-panel flex-panel border-inline-start", loading: this._preparingArcade, modelId: this._modelId, onArcgisItemSelected: this._insertAsText, onArcgisClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
316
317
|
case "suggestions":
|
|
317
318
|
return (h("arcgis-arcade-suggestions", { class: "side-panel flex-panel border-inline-start", suggestions: this.suggestions, onArcgisItemSelected: this._insertAsText, onArcgisClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
318
319
|
default:
|
|
@@ -330,11 +331,12 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
330
331
|
//#endregion
|
|
331
332
|
//#region Render
|
|
332
333
|
render() {
|
|
333
|
-
return (h(Host, { key: '
|
|
334
|
+
return (h(Host, { key: 'f8a7e9cb7620c72586fc06dba017a44b63330198' }, this.renderMainActionBar(), h("div", { key: '086f52ceaa74266a8bcd28833ae526f73537a165', class: "flex-row flex-adjustable" }, h("div", { key: 'fa33e21b52d41b7c01a504eb85a229714b8c0556', class: "flex-column flex-adjustable" }, this.renderMainPanel(), this.renderResultsPanel()), this.renderSidePanel(), this.renderSideActionBar())));
|
|
334
335
|
}
|
|
335
336
|
static get assetsDirs() { return ["assets"]; }
|
|
336
337
|
get el() { return this; }
|
|
337
338
|
static get watchers() { return {
|
|
339
|
+
"messages": ["_messagesChanged"],
|
|
338
340
|
"profile": ["_profileChanged"],
|
|
339
341
|
"testData": ["_testDataChanged"],
|
|
340
342
|
"snippets": ["_snippetChanged"]
|
|
@@ -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.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeResults$1, d as defineCustomElement$1 } from './arcade-results.js';
|
|
7
7
|
|
|
@@ -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.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeSuggestions$1, d as defineCustomElement$1 } from './arcade-suggestions.js';
|
|
7
7
|
|
|
@@ -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.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeVariables$1, d as defineCustomElement$1 } from './arcade-variables.js';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
5
|
-
* v4.31.0-next.
|
|
5
|
+
* v4.31.0-next.21
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Get the base path to where the package assets can be found.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
5
|
-
* v4.31.0-next.
|
|
5
|
+
* v4.31.0-next.21
|
|
6
6
|
*/
|
|
7
7
|
let resourceUrl = "https://js.arcgis.com/coding-components/next/";
|
|
8
8
|
export const getArcgisAssetPath = (path) => {
|
|
@@ -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.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisCodeEditor$1, d as defineCustomElement$1 } from './code-editor.js';
|
|
7
7
|
|
|
@@ -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.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisLanguageApiPanel$1, d as defineCustomElement$1 } from './language-api-panel.js';
|
|
7
7
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ArcgisSqlExpressionEditor extends Components.ArcgisSqlExpressionEditor, HTMLElement {}
|
|
4
|
+
export const ArcgisSqlExpressionEditor: {
|
|
5
|
+
prototype: ArcgisSqlExpressionEditor;
|
|
6
|
+
new (): ArcgisSqlExpressionEditor;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
|
+
*/
|
|
6
|
+
import { proxyCustomElement, HTMLElement, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
7
|
+
import { u as useControllerManager } from './chunk-2JTWBRMN.js';
|
|
8
|
+
import { g as generateGuid } from './index2.js';
|
|
9
|
+
import { s as sqlExprDefaults } from './sql-expr-defaults.js';
|
|
10
|
+
import { d as defineCustomElement$4 } from './code-editor.js';
|
|
11
|
+
import { d as defineCustomElement$3 } from './language-api-panel.js';
|
|
12
|
+
import { d as defineCustomElement$2 } from './sql-expression-fields.js';
|
|
13
|
+
import "@esri/calcite-components/dist/components/calcite-action-bar.js";
|
|
14
|
+
import "@esri/calcite-components/dist/components/calcite-action.js";
|
|
15
|
+
|
|
16
|
+
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%}";
|
|
17
|
+
const ArcgisSqlExpressionEditorStyle0 = sqlExpressionEditorCss;
|
|
18
|
+
|
|
19
|
+
const __cmpMeta = [0,"arcgis-sql-expression-editor",{"profile":[1040],"_preparing":[32],"_editorProfile":[32],"_activeAction":[32],"_apiLibrary":[32]},undefined,{"profile":["_profileChanged"]}];
|
|
20
|
+
const SqlExpressionEditor = /*@__PURE__*/ proxyCustomElement(class SqlExpressionEditor extends HTMLElement {
|
|
21
|
+
connectedCallback() { this.manager._connectedCallback(); }
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.__registerHost();
|
|
25
|
+
this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
26
|
+
this.manager = useControllerManager(this,forceUpdate);
|
|
27
|
+
// #endregion
|
|
28
|
+
// #region Private properties
|
|
29
|
+
this._modelId = generateGuid();
|
|
30
|
+
this._insertAsSnippet = (e) => void this._codeEditorElt?.insertSnippet(e.detail).catch(console.error);
|
|
31
|
+
this._preparing = false;
|
|
32
|
+
this._editorProfile = undefined;
|
|
33
|
+
this._activeAction = undefined;
|
|
34
|
+
this._apiLibrary = undefined;
|
|
35
|
+
this.profile = undefined;
|
|
36
|
+
}
|
|
37
|
+
_profileChanged() {
|
|
38
|
+
this._updateSqlExprDefaults().catch(console.error);
|
|
39
|
+
}
|
|
40
|
+
// #endregion
|
|
41
|
+
// #region Private methods API
|
|
42
|
+
async _updateSqlExprDefaults() {
|
|
43
|
+
this._preparing = true;
|
|
44
|
+
try {
|
|
45
|
+
await sqlExprDefaults.setProfileForModel(this._modelId, this.profile);
|
|
46
|
+
this._apiLibrary = await sqlExprDefaults.getApiLibrary(this._modelId);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
this._editorProfile = undefined;
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
// this._editorProfilePromise = Promise.resolve(this._editorProfile);
|
|
53
|
+
this._preparing = false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
_setActiveAction(action) {
|
|
57
|
+
this._activeAction = action;
|
|
58
|
+
}
|
|
59
|
+
_handleActionClick(e) {
|
|
60
|
+
const action = e.target;
|
|
61
|
+
this._setActiveAction(action.dataset.panelName);
|
|
62
|
+
}
|
|
63
|
+
// #endregion
|
|
64
|
+
// #region Component lifecycle events
|
|
65
|
+
async componentWillLoad() {
|
|
66
|
+
await this._updateSqlExprDefaults().catch(console.error);
|
|
67
|
+
// The profile has to be refreshed on locale change
|
|
68
|
+
// this.manager.watch("messages", () => void this._updateEditorProfile().catch(console.error));
|
|
69
|
+
}
|
|
70
|
+
disconnectedCallback() {
|
|
71
|
+
this.manager._disconnectedCallback();
|
|
72
|
+
sqlExprDefaults.disposeForModel(this._modelId);
|
|
73
|
+
}
|
|
74
|
+
// #endregion
|
|
75
|
+
render() {
|
|
76
|
+
return (h(Host, { key: '67f7ebf7a28a8ffc3fe967721389d45c4e2003a1' }, h("div", { key: 'b3bf4ec2a8d04105e97489593ccec95cd33237f0', class: "flex-row flex-adjustable" }, h("div", { key: 'fdac47e22baf64c72f786f9e09b637050f417f94', class: "flex-column flex-adjustable" }, h("arcgis-code-editor", { key: 'f4151dd39ec3523907cd907ebb7558e05bca9cc1', language: "arcgis-sql-expression", modelId: this._modelId, ref: (e) => (this._codeEditorElt = e) })), this._activeAction === "fields" && (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" && (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" })), h("calcite-action-bar", { key: 'ee618d666b70405495627a9d15238e8723c6f961', class: "side-action-bar border-inline-start", expanded: false, position: "end" }, h("calcite-action", { key: '2c828df5dded6347e13e59ba9e313824baa606ff', id: "fields-action", text: "Fields", icon: "profile-variables", active: this._activeAction === "fields", "data-panel-name": "fields",
|
|
77
|
+
// need to use an arrow function to automatically bind 'this'
|
|
78
|
+
onClick: (e) => this._handleActionClick(e) }), 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) })))));
|
|
79
|
+
}
|
|
80
|
+
static get assetsDirs() { return ["assets"]; }
|
|
81
|
+
get el() { return this; }
|
|
82
|
+
static get watchers() { return {
|
|
83
|
+
"profile": ["_profileChanged"]
|
|
84
|
+
}; }
|
|
85
|
+
static get style() { return ArcgisSqlExpressionEditorStyle0; }
|
|
86
|
+
}, __cmpMeta);
|
|
87
|
+
function defineCustomElement$1() {
|
|
88
|
+
if (typeof customElements === "undefined") {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const components = ["arcgis-sql-expression-editor", "arcgis-code-editor", "arcgis-language-api-panel", "arcgis-sql-expression-fields"];
|
|
92
|
+
components.forEach(tagName => { switch (tagName) {
|
|
93
|
+
case "arcgis-sql-expression-editor":
|
|
94
|
+
if (!customElements.get(tagName)) {
|
|
95
|
+
customElements.define(tagName, SqlExpressionEditor);
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
case "arcgis-code-editor":
|
|
99
|
+
if (!customElements.get(tagName)) {
|
|
100
|
+
defineCustomElement$4();
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
case "arcgis-language-api-panel":
|
|
104
|
+
if (!customElements.get(tagName)) {
|
|
105
|
+
defineCustomElement$3();
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case "arcgis-sql-expression-fields":
|
|
109
|
+
if (!customElements.get(tagName)) {
|
|
110
|
+
defineCustomElement$2();
|
|
111
|
+
}
|
|
112
|
+
break;
|
|
113
|
+
} });
|
|
114
|
+
}
|
|
115
|
+
defineCustomElement$1();
|
|
116
|
+
|
|
117
|
+
const ArcgisSqlExpressionEditor = SqlExpressionEditor;
|
|
118
|
+
const defineCustomElement = defineCustomElement$1;
|
|
119
|
+
|
|
120
|
+
export { ArcgisSqlExpressionEditor, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ArcgisSqlExpressionFields extends Components.ArcgisSqlExpressionFields, HTMLElement {}
|
|
4
|
+
export const ArcgisSqlExpressionFields: {
|
|
5
|
+
prototype: ArcgisSqlExpressionFields;
|
|
6
|
+
new (): ArcgisSqlExpressionFields;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
|
+
*/
|
|
6
|
+
import { S as SqlExpressionFields, d as defineCustomElement$1 } from './sql-expression-fields.js';
|
|
7
|
+
|
|
8
|
+
const ArcgisSqlExpressionFields = SqlExpressionFields;
|
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
|
10
|
+
|
|
11
|
+
export { ArcgisSqlExpressionFields, defineCustomElement };
|