@esri/solutions-components 0.8.29 → 0.8.31
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/cjs/basemap-gallery_7.cjs.entry.js +65 -40
- package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow_6.cjs.entry.js +58 -34
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +2 -2
- package/dist/cjs/feature-list.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popupUtils-e3fa775b.js → popupUtils-9ca69f8c.js} +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/create-feature/create-feature.js +13 -8
- package/dist/collection/components/create-related-feature/create-related-feature.css +4 -0
- package/dist/collection/components/create-related-feature/create-related-feature.js +52 -26
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +4 -0
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +1 -1
- package/dist/collection/components/floor-filter/floor-filter.js +66 -39
- package/dist/collection/utils/popupUtils.js +1 -1
- package/dist/collection/utils/popupUtils.ts +1 -1
- package/dist/components/create-feature2.js +13 -8
- package/dist/components/create-related-feature2.js +57 -30
- package/dist/components/crowdsource-reporter.js +2 -2
- package/dist/components/floor-filter2.js +67 -41
- package/dist/components/popupUtils.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +65 -40
- package/dist/esm/calcite-alert_4.entry.js +1 -1
- package/dist/esm/calcite-flow_6.entry.js +58 -34
- package/dist/esm/crowdsource-reporter.entry.js +2 -2
- package/dist/esm/feature-list.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popupUtils-17193415.js → popupUtils-8efd3cde.js} +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/p-2455bcb0.js +21 -0
- package/dist/solutions-components/{p-bb90a138.entry.js → p-3365a6de.entry.js} +2 -2
- package/dist/solutions-components/p-4ae34862.entry.js +17 -0
- package/dist/solutions-components/{p-16fb8296.entry.js → p-628874a6.entry.js} +1 -1
- package/dist/solutions-components/{p-2f7bfd8d.entry.js → p-90c3bc54.entry.js} +1 -1
- package/dist/solutions-components/p-a0616647.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/popupUtils.ts +1 -1
- package/dist/types/components/create-feature/create-feature.d.ts +1 -1
- package/dist/types/components/create-related-feature/create-related-feature.d.ts +19 -1
- package/dist/types/components/floor-filter/floor-filter.d.ts +23 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-2e23ac2c.js +0 -21
- package/dist/solutions-components/p-327577d1.entry.js +0 -6
- package/dist/solutions-components/p-c21a6940.entry.js +0 -17
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { proxyCustomElement, HTMLElement, createEvent, h
|
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
7
7
|
import { l as loadModules } from './loadModules.js';
|
|
8
|
+
import { d as defineCustomElement$1 } from './loader.js';
|
|
8
9
|
|
|
9
|
-
const createRelatedFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}";
|
|
10
|
+
const createRelatedFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.display-none{display:none !important}";
|
|
10
11
|
const CreateRelatedFeatureStyle0 = createRelatedFeatureCss;
|
|
11
12
|
|
|
12
13
|
const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelatedFeature extends HTMLElement {
|
|
@@ -24,6 +25,7 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
24
25
|
this.table = undefined;
|
|
25
26
|
this.selectedFeature = undefined;
|
|
26
27
|
this.customizeSubmit = false;
|
|
28
|
+
this._editorLoading = false;
|
|
27
29
|
}
|
|
28
30
|
//--------------------------------------------------------------------------
|
|
29
31
|
//
|
|
@@ -38,6 +40,18 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
38
40
|
await this.init();
|
|
39
41
|
});
|
|
40
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* When _editorLoading is true the container node will be hidden while starting the create workflow
|
|
45
|
+
*/
|
|
46
|
+
async _editorLoadingWatchHandler(v) {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
if (v) {
|
|
49
|
+
(_a = this._container) === null || _a === void 0 ? void 0 : _a.classList.add("display-none");
|
|
50
|
+
await this.startCreate();
|
|
51
|
+
(_b = this._container) === null || _b === void 0 ? void 0 : _b.classList.remove("display-none");
|
|
52
|
+
this._editorLoading = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
41
55
|
//--------------------------------------------------------------------------
|
|
42
56
|
//
|
|
43
57
|
// Methods (public)
|
|
@@ -94,7 +108,8 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
94
108
|
this.reactiveUtils = reactiveUtils;
|
|
95
109
|
}
|
|
96
110
|
render() {
|
|
97
|
-
|
|
111
|
+
const loaderClass = this._editorLoading ? "" : "display-none";
|
|
112
|
+
return (h("calcite-loader", { key: 'a8fd1e83a4a9614779be19a11e6028b3a402cbd2', class: loaderClass, label: "", scale: "s" }));
|
|
98
113
|
}
|
|
99
114
|
/**
|
|
100
115
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
|
@@ -107,29 +122,24 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
107
122
|
* @protected
|
|
108
123
|
*/
|
|
109
124
|
async createEditorWidget() {
|
|
125
|
+
var _a;
|
|
110
126
|
if (this._editor) {
|
|
111
127
|
this._editor.destroy();
|
|
112
128
|
}
|
|
113
|
-
|
|
129
|
+
this._container = document.createElement("div");
|
|
130
|
+
(_a = this._container) === null || _a === void 0 ? void 0 : _a.classList.add("display-none");
|
|
114
131
|
this._editor = new this.Editor({
|
|
115
132
|
view: this.mapView,
|
|
116
133
|
visibleElements: {
|
|
117
134
|
snappingControls: false
|
|
118
135
|
},
|
|
119
|
-
container
|
|
120
|
-
});
|
|
121
|
-
this.el.appendChild(container);
|
|
122
|
-
//Add handle to watch featureFormViewModel ready state and hide the editor elements
|
|
123
|
-
const hideElementHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.featureFormViewModel) === null || _a === void 0 ? void 0 : _a.state; }, (state) => {
|
|
124
|
-
if (state === 'ready') {
|
|
125
|
-
this.hideEditorsElements();
|
|
126
|
-
}
|
|
136
|
+
container: this._container
|
|
127
137
|
});
|
|
128
|
-
this.
|
|
138
|
+
this.el.appendChild(this._container);
|
|
129
139
|
//Add handle to watch featureTemplatesViewModel ready state and then start the creation
|
|
130
140
|
const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
|
|
131
141
|
if (state === 'ready') {
|
|
132
|
-
|
|
142
|
+
this._editorLoading = true;
|
|
133
143
|
}
|
|
134
144
|
});
|
|
135
145
|
this._editor.viewModel.addHandles(handle);
|
|
@@ -170,6 +180,8 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
170
180
|
template,
|
|
171
181
|
};
|
|
172
182
|
await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(creationInfo);
|
|
183
|
+
//hides the header and footer elements in editor widget
|
|
184
|
+
await this.hideEditorsElements();
|
|
173
185
|
// Emit an event to show submit cancel buttons
|
|
174
186
|
this.isActionPending.emit(false);
|
|
175
187
|
this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
|
|
@@ -178,22 +190,21 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
178
190
|
* Hides the elements of editor widget
|
|
179
191
|
* @protected
|
|
180
192
|
*/
|
|
181
|
-
hideEditorsElements() {
|
|
193
|
+
async hideEditorsElements() {
|
|
194
|
+
var _a, _b;
|
|
182
195
|
if (!this.customizeSubmit) {
|
|
183
196
|
return;
|
|
184
197
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
196
|
-
}, 700);
|
|
198
|
+
await this.timeout(700);
|
|
199
|
+
//hides the header and footer on the featureForm
|
|
200
|
+
(_b = (_a = this.el.querySelector('.esri-editor')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('calcite-flow-item')) === null || _b === void 0 ? void 0 : _b.forEach((flowItem) => {
|
|
201
|
+
var _a, _b, _c, _d, _e;
|
|
202
|
+
const article = (_c = (_b = (_a = flowItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('calcite-panel')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('article');
|
|
203
|
+
//hide the header
|
|
204
|
+
(_d = article === null || article === void 0 ? void 0 : article.querySelector('header')) === null || _d === void 0 ? void 0 : _d.setAttribute('style', 'display: none');
|
|
205
|
+
//hide the footer
|
|
206
|
+
(_e = article === null || article === void 0 ? void 0 : article.querySelector('footer')) === null || _e === void 0 ? void 0 : _e.setAttribute('style', 'display: none');
|
|
207
|
+
});
|
|
197
208
|
}
|
|
198
209
|
/**
|
|
199
210
|
* Makes attributes for related feature
|
|
@@ -249,9 +260,18 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
249
260
|
this.success.emit();
|
|
250
261
|
}
|
|
251
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* call setTimeout in Promise wrapper
|
|
265
|
+
* @param delay The time, in milliseconds that the timer should wait before the promise is resolved
|
|
266
|
+
* @protected
|
|
267
|
+
*/
|
|
268
|
+
timeout(delay) {
|
|
269
|
+
return new Promise(resolve => setTimeout(resolve, delay));
|
|
270
|
+
}
|
|
252
271
|
get el() { return this; }
|
|
253
272
|
static get watchers() { return {
|
|
254
|
-
"mapView": ["mapViewWatchHandler"]
|
|
273
|
+
"mapView": ["mapViewWatchHandler"],
|
|
274
|
+
"_editorLoading": ["_editorLoadingWatchHandler"]
|
|
255
275
|
}; }
|
|
256
276
|
static get style() { return CreateRelatedFeatureStyle0; }
|
|
257
277
|
}, [0, "create-related-feature", {
|
|
@@ -259,22 +279,29 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
|
259
279
|
"table": [16],
|
|
260
280
|
"selectedFeature": [16],
|
|
261
281
|
"customizeSubmit": [4, "customize-submit"],
|
|
282
|
+
"_editorLoading": [32],
|
|
262
283
|
"close": [64],
|
|
263
284
|
"submit": [64]
|
|
264
285
|
}, undefined, {
|
|
265
|
-
"mapView": ["mapViewWatchHandler"]
|
|
286
|
+
"mapView": ["mapViewWatchHandler"],
|
|
287
|
+
"_editorLoading": ["_editorLoadingWatchHandler"]
|
|
266
288
|
}]);
|
|
267
289
|
function defineCustomElement() {
|
|
268
290
|
if (typeof customElements === "undefined") {
|
|
269
291
|
return;
|
|
270
292
|
}
|
|
271
|
-
const components = ["create-related-feature"];
|
|
293
|
+
const components = ["create-related-feature", "calcite-loader"];
|
|
272
294
|
components.forEach(tagName => { switch (tagName) {
|
|
273
295
|
case "create-related-feature":
|
|
274
296
|
if (!customElements.get(tagName)) {
|
|
275
297
|
customElements.define(tagName, CreateRelatedFeature);
|
|
276
298
|
}
|
|
277
299
|
break;
|
|
300
|
+
case "calcite-loader":
|
|
301
|
+
if (!customElements.get(tagName)) {
|
|
302
|
+
defineCustomElement$1();
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
278
305
|
} });
|
|
279
306
|
}
|
|
280
307
|
defineCustomElement();
|
|
@@ -55,7 +55,7 @@ import { d as defineCustomElement$4 } from './instant-apps-filter-list2.js';
|
|
|
55
55
|
import { d as defineCustomElement$3 } from './instant-apps-social-share2.js';
|
|
56
56
|
import { d as defineCustomElement$2 } from './layer-list2.js';
|
|
57
57
|
|
|
58
|
-
const crowdsourceReporterCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1) !important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}.report-submitted-msg{position:absolute;z-index:1000}";
|
|
58
|
+
const crowdsourceReporterCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1) !important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}.report-submitted-msg{position:absolute;z-index:1000}.share-node{display:flex}";
|
|
59
59
|
const CrowdsourceReporterStyle0 = crowdsourceReporterCss;
|
|
60
60
|
|
|
61
61
|
const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceReporter extends HTMLElement {
|
|
@@ -618,7 +618,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
618
618
|
getFeatureDetailsFlowItem() {
|
|
619
619
|
var _a;
|
|
620
620
|
const showCommentBtn = ((_a = this._getLayersConfig(this._selectedLayerId)) === null || _a === void 0 ? void 0 : _a.comment) && this._selectedLayer.relationships.length > 0;
|
|
621
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, removePopoverOffset: true, scale: "
|
|
621
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, class: "share-node", embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, removePopoverOffset: true, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("calcite-panel", null, h("feature-details", { class: 'full-height', graphics: this._selectedFeature, layerItemsHash: this._layerItemsHash, mapView: this.mapView, onCommentSelect: this.onCommentSelectFromList.bind(this), onFeatureSelectionChange: this.selectionChanged.bind(this), onLoadingStatus: (evt) => void this.updatingFeatureDetails(evt.detail), ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }), showCommentBtn &&
|
|
622
622
|
h("calcite-button", { appearance: "solid", onClick: () => this._flowItems = [...this._flowItems, "add-comment"], slot: "footer", width: "full" }, this._translations.comment))));
|
|
623
623
|
}
|
|
624
624
|
/**
|
|
@@ -26,23 +26,22 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
|
26
26
|
// Watch handlers
|
|
27
27
|
//
|
|
28
28
|
//--------------------------------------------------------------------------
|
|
29
|
+
/**
|
|
30
|
+
* Watch for changes to the mapView and re-init the floor filter
|
|
31
|
+
*/
|
|
29
32
|
async mapViewWatchHandler() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
console.log("this._floorFilterElement created");
|
|
43
|
-
}
|
|
44
|
-
this._initFloorFilter(this.mapView, webMap);
|
|
45
|
-
});
|
|
33
|
+
await this._initFloorFilter(this.mapView);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Watch for changes to the enabled property and re-init or destroy the floor filter
|
|
37
|
+
*/
|
|
38
|
+
async enabledWatchHandler() {
|
|
39
|
+
if (this.enabled) {
|
|
40
|
+
await this._initFloorFilter(this.mapView);
|
|
41
|
+
}
|
|
42
|
+
else if (!this.enabled) {
|
|
43
|
+
this._destroyWidget();
|
|
44
|
+
}
|
|
46
45
|
}
|
|
47
46
|
//--------------------------------------------------------------------------
|
|
48
47
|
//
|
|
@@ -55,8 +54,11 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
|
55
54
|
async componentWillLoad() {
|
|
56
55
|
return this._initModules();
|
|
57
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Renders the component.
|
|
59
|
+
*/
|
|
58
60
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: 'c80a8d46fb48f3789d9fa09c2400faad49e2e236' }, h("div", { key: '82919a3ba061a17c8aeaa0d2f6f4f13bc428b519', ref: (el) => { this._floorFilterElement = el; } })));
|
|
60
62
|
}
|
|
61
63
|
//--------------------------------------------------------------------------
|
|
62
64
|
//
|
|
@@ -78,38 +80,61 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
|
78
80
|
this.FloorFilter = FloorFilter;
|
|
79
81
|
this.reactiveUtils = reactiveUtils;
|
|
80
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Destroy the widget and remove the containing element if it exists
|
|
85
|
+
*
|
|
86
|
+
* @protected
|
|
87
|
+
*/
|
|
88
|
+
_destroyWidget() {
|
|
89
|
+
if (this.floorFilterWidget) {
|
|
90
|
+
this.floorFilterWidget.destroy();
|
|
91
|
+
this.floorFilterWidget = undefined;
|
|
92
|
+
}
|
|
93
|
+
if (this._floorFilterElement) {
|
|
94
|
+
this._floorFilterElement.remove();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Destroy the widget and remove the containing element then re-create the container element
|
|
99
|
+
*
|
|
100
|
+
* @protected
|
|
101
|
+
*/
|
|
102
|
+
_initContainer() {
|
|
103
|
+
this._destroyWidget();
|
|
104
|
+
this._floorFilterElement = document.createElement("div");
|
|
105
|
+
}
|
|
81
106
|
/**
|
|
82
107
|
* Initialize the floor filter or reset the current view if it already exists
|
|
83
108
|
*/
|
|
84
|
-
_initFloorFilter(view
|
|
85
|
-
|
|
86
|
-
console.log("_initFloorFilter");
|
|
87
|
-
console.log(`view: ${view}`);
|
|
88
|
-
console.log(`this.enabled: ${this.enabled}`);
|
|
89
|
-
console.log(`this.FloorFilter: ${this.FloorFilter}`);
|
|
90
|
-
console.log(`webMap?.floorInfo: ${webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo}`);
|
|
109
|
+
async _initFloorFilter(view) {
|
|
110
|
+
const webMap = view === null || view === void 0 ? void 0 : view.map;
|
|
91
111
|
if (view && this.enabled && this.FloorFilter && (webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo)) {
|
|
92
|
-
this.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
this._initContainer();
|
|
113
|
+
await webMap.when(() => {
|
|
114
|
+
var _a, _b, _c;
|
|
115
|
+
this.floorFilterWidget = new this.FloorFilter({
|
|
116
|
+
container: this._floorFilterElement,
|
|
117
|
+
view
|
|
118
|
+
});
|
|
119
|
+
(_a = this._facilityHandle) === null || _a === void 0 ? void 0 : _a.remove();
|
|
120
|
+
this._facilityHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.facility, (facility) => {
|
|
121
|
+
this.facilityChanged.emit(facility);
|
|
122
|
+
});
|
|
123
|
+
(_b = this._levelHandle) === null || _b === void 0 ? void 0 : _b.remove();
|
|
124
|
+
this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
|
|
125
|
+
this.levelChanged.emit(level);
|
|
126
|
+
});
|
|
127
|
+
(_c = this._siteHandle) === null || _c === void 0 ? void 0 : _c.remove();
|
|
128
|
+
this._siteHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.site, (site) => {
|
|
129
|
+
this.siteChanged.emit(site);
|
|
130
|
+
});
|
|
107
131
|
});
|
|
108
132
|
}
|
|
109
133
|
}
|
|
110
134
|
get el() { return this; }
|
|
111
135
|
static get watchers() { return {
|
|
112
|
-
"mapView": ["mapViewWatchHandler"]
|
|
136
|
+
"mapView": ["mapViewWatchHandler"],
|
|
137
|
+
"enabled": ["enabledWatchHandler"]
|
|
113
138
|
}; }
|
|
114
139
|
static get style() { return FloorFilterStyle0; }
|
|
115
140
|
}, [1, "floor-filter", {
|
|
@@ -117,7 +142,8 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
|
117
142
|
"floorFilterWidget": [16],
|
|
118
143
|
"mapView": [16]
|
|
119
144
|
}, undefined, {
|
|
120
|
-
"mapView": ["mapViewWatchHandler"]
|
|
145
|
+
"mapView": ["mapViewWatchHandler"],
|
|
146
|
+
"enabled": ["enabledWatchHandler"]
|
|
121
147
|
}]);
|
|
122
148
|
function defineCustomElement() {
|
|
123
149
|
if (typeof customElements === "undefined") {
|
|
@@ -69,7 +69,7 @@ class PopupUtils {
|
|
|
69
69
|
const fieldInfo = layer.popupTemplate.fieldInfos.find((fInfo) => fInfo.fieldName.toLowerCase() === field.name.toLowerCase());
|
|
70
70
|
//format the attribute value
|
|
71
71
|
const formattedAttributeValue = _prepareAttributeValue(attributeValue, field.type, field.domain, fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.format, this.intl);
|
|
72
|
-
attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue;
|
|
72
|
+
attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue !== null && formattedAttributeValue !== void 0 ? formattedAttributeValue : attributeValue;
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
return popupTitle === null || popupTitle === void 0 ? void 0 : popupTitle.replace(/{.*?}/g, (placeholder) => {
|
|
@@ -132,23 +132,22 @@ const FloorFilter = class {
|
|
|
132
132
|
// Watch handlers
|
|
133
133
|
//
|
|
134
134
|
//--------------------------------------------------------------------------
|
|
135
|
+
/**
|
|
136
|
+
* Watch for changes to the mapView and re-init the floor filter
|
|
137
|
+
*/
|
|
135
138
|
async mapViewWatchHandler() {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
console.log("this._floorFilterElement created");
|
|
149
|
-
}
|
|
150
|
-
this._initFloorFilter(this.mapView, webMap);
|
|
151
|
-
});
|
|
139
|
+
await this._initFloorFilter(this.mapView);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Watch for changes to the enabled property and re-init or destroy the floor filter
|
|
143
|
+
*/
|
|
144
|
+
async enabledWatchHandler() {
|
|
145
|
+
if (this.enabled) {
|
|
146
|
+
await this._initFloorFilter(this.mapView);
|
|
147
|
+
}
|
|
148
|
+
else if (!this.enabled) {
|
|
149
|
+
this._destroyWidget();
|
|
150
|
+
}
|
|
152
151
|
}
|
|
153
152
|
//--------------------------------------------------------------------------
|
|
154
153
|
//
|
|
@@ -161,8 +160,11 @@ const FloorFilter = class {
|
|
|
161
160
|
async componentWillLoad() {
|
|
162
161
|
return this._initModules();
|
|
163
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Renders the component.
|
|
165
|
+
*/
|
|
164
166
|
render() {
|
|
165
|
-
return (h(Host, { key: '
|
|
167
|
+
return (h(Host, { key: 'c80a8d46fb48f3789d9fa09c2400faad49e2e236' }, h("div", { key: '82919a3ba061a17c8aeaa0d2f6f4f13bc428b519', ref: (el) => { this._floorFilterElement = el; } })));
|
|
166
168
|
}
|
|
167
169
|
//--------------------------------------------------------------------------
|
|
168
170
|
//
|
|
@@ -184,38 +186,61 @@ const FloorFilter = class {
|
|
|
184
186
|
this.FloorFilter = FloorFilter;
|
|
185
187
|
this.reactiveUtils = reactiveUtils;
|
|
186
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Destroy the widget and remove the containing element if it exists
|
|
191
|
+
*
|
|
192
|
+
* @protected
|
|
193
|
+
*/
|
|
194
|
+
_destroyWidget() {
|
|
195
|
+
if (this.floorFilterWidget) {
|
|
196
|
+
this.floorFilterWidget.destroy();
|
|
197
|
+
this.floorFilterWidget = undefined;
|
|
198
|
+
}
|
|
199
|
+
if (this._floorFilterElement) {
|
|
200
|
+
this._floorFilterElement.remove();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Destroy the widget and remove the containing element then re-create the container element
|
|
205
|
+
*
|
|
206
|
+
* @protected
|
|
207
|
+
*/
|
|
208
|
+
_initContainer() {
|
|
209
|
+
this._destroyWidget();
|
|
210
|
+
this._floorFilterElement = document.createElement("div");
|
|
211
|
+
}
|
|
187
212
|
/**
|
|
188
213
|
* Initialize the floor filter or reset the current view if it already exists
|
|
189
214
|
*/
|
|
190
|
-
_initFloorFilter(view
|
|
191
|
-
|
|
192
|
-
console.log("_initFloorFilter");
|
|
193
|
-
console.log(`view: ${view}`);
|
|
194
|
-
console.log(`this.enabled: ${this.enabled}`);
|
|
195
|
-
console.log(`this.FloorFilter: ${this.FloorFilter}`);
|
|
196
|
-
console.log(`webMap?.floorInfo: ${webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo}`);
|
|
215
|
+
async _initFloorFilter(view) {
|
|
216
|
+
const webMap = view === null || view === void 0 ? void 0 : view.map;
|
|
197
217
|
if (view && this.enabled && this.FloorFilter && (webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo)) {
|
|
198
|
-
this.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
218
|
+
this._initContainer();
|
|
219
|
+
await webMap.when(() => {
|
|
220
|
+
var _a, _b, _c;
|
|
221
|
+
this.floorFilterWidget = new this.FloorFilter({
|
|
222
|
+
container: this._floorFilterElement,
|
|
223
|
+
view
|
|
224
|
+
});
|
|
225
|
+
(_a = this._facilityHandle) === null || _a === void 0 ? void 0 : _a.remove();
|
|
226
|
+
this._facilityHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.facility, (facility) => {
|
|
227
|
+
this.facilityChanged.emit(facility);
|
|
228
|
+
});
|
|
229
|
+
(_b = this._levelHandle) === null || _b === void 0 ? void 0 : _b.remove();
|
|
230
|
+
this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
|
|
231
|
+
this.levelChanged.emit(level);
|
|
232
|
+
});
|
|
233
|
+
(_c = this._siteHandle) === null || _c === void 0 ? void 0 : _c.remove();
|
|
234
|
+
this._siteHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.site, (site) => {
|
|
235
|
+
this.siteChanged.emit(site);
|
|
236
|
+
});
|
|
213
237
|
});
|
|
214
238
|
}
|
|
215
239
|
}
|
|
216
240
|
get el() { return getElement(this); }
|
|
217
241
|
static get watchers() { return {
|
|
218
|
-
"mapView": ["mapViewWatchHandler"]
|
|
242
|
+
"mapView": ["mapViewWatchHandler"],
|
|
243
|
+
"enabled": ["enabledWatchHandler"]
|
|
219
244
|
}; }
|
|
220
245
|
};
|
|
221
246
|
FloorFilter.style = FloorFilterStyle0;
|
|
@@ -13,7 +13,7 @@ import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as
|
|
|
13
13
|
import { K as KindIcons } from './resources-ae36eaff.js';
|
|
14
14
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-a490c4f6.js';
|
|
15
15
|
import { a as getAllLayers } from './mapViewUtils-b8deb4ae.js';
|
|
16
|
-
import { P as PopupUtils } from './popupUtils-
|
|
16
|
+
import { P as PopupUtils } from './popupUtils-8efd3cde.js';
|
|
17
17
|
import './guid-f05d01d5.js';
|
|
18
18
|
import './resources-1febf4c6.js';
|
|
19
19
|
import './key-092b6260.js';
|