@esri/solutions-components 0.8.29 → 0.8.30
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +65 -40
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/floor-filter/floor-filter.js +66 -39
- package/dist/components/floor-filter2.js +67 -41
- package/dist/esm/basemap-gallery_7.entry.js +65 -40
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solutions-components.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/types/components/floor-filter/floor-filter.d.ts +23 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-327577d1.entry.js +0 -6
@@ -136,23 +136,22 @@ const FloorFilter = class {
|
|
136
136
|
// Watch handlers
|
137
137
|
//
|
138
138
|
//--------------------------------------------------------------------------
|
139
|
+
/**
|
140
|
+
* Watch for changes to the mapView and re-init the floor filter
|
141
|
+
*/
|
139
142
|
async mapViewWatchHandler() {
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
console.log("this._floorFilterElement created");
|
153
|
-
}
|
154
|
-
this._initFloorFilter(this.mapView, webMap);
|
155
|
-
});
|
143
|
+
await this._initFloorFilter(this.mapView);
|
144
|
+
}
|
145
|
+
/**
|
146
|
+
* Watch for changes to the enabled property and re-init or destroy the floor filter
|
147
|
+
*/
|
148
|
+
async enabledWatchHandler() {
|
149
|
+
if (this.enabled) {
|
150
|
+
await this._initFloorFilter(this.mapView);
|
151
|
+
}
|
152
|
+
else if (!this.enabled) {
|
153
|
+
this._destroyWidget();
|
154
|
+
}
|
156
155
|
}
|
157
156
|
//--------------------------------------------------------------------------
|
158
157
|
//
|
@@ -165,8 +164,11 @@ const FloorFilter = class {
|
|
165
164
|
async componentWillLoad() {
|
166
165
|
return this._initModules();
|
167
166
|
}
|
167
|
+
/**
|
168
|
+
* Renders the component.
|
169
|
+
*/
|
168
170
|
render() {
|
169
|
-
return (index.h(index.Host, { key: '
|
171
|
+
return (index.h(index.Host, { key: 'c80a8d46fb48f3789d9fa09c2400faad49e2e236' }, index.h("div", { key: '82919a3ba061a17c8aeaa0d2f6f4f13bc428b519', ref: (el) => { this._floorFilterElement = el; } })));
|
170
172
|
}
|
171
173
|
//--------------------------------------------------------------------------
|
172
174
|
//
|
@@ -188,38 +190,61 @@ const FloorFilter = class {
|
|
188
190
|
this.FloorFilter = FloorFilter;
|
189
191
|
this.reactiveUtils = reactiveUtils;
|
190
192
|
}
|
193
|
+
/**
|
194
|
+
* Destroy the widget and remove the containing element if it exists
|
195
|
+
*
|
196
|
+
* @protected
|
197
|
+
*/
|
198
|
+
_destroyWidget() {
|
199
|
+
if (this.floorFilterWidget) {
|
200
|
+
this.floorFilterWidget.destroy();
|
201
|
+
this.floorFilterWidget = undefined;
|
202
|
+
}
|
203
|
+
if (this._floorFilterElement) {
|
204
|
+
this._floorFilterElement.remove();
|
205
|
+
}
|
206
|
+
}
|
207
|
+
/**
|
208
|
+
* Destroy the widget and remove the containing element then re-create the container element
|
209
|
+
*
|
210
|
+
* @protected
|
211
|
+
*/
|
212
|
+
_initContainer() {
|
213
|
+
this._destroyWidget();
|
214
|
+
this._floorFilterElement = document.createElement("div");
|
215
|
+
}
|
191
216
|
/**
|
192
217
|
* Initialize the floor filter or reset the current view if it already exists
|
193
218
|
*/
|
194
|
-
_initFloorFilter(view
|
195
|
-
|
196
|
-
console.log("_initFloorFilter");
|
197
|
-
console.log(`view: ${view}`);
|
198
|
-
console.log(`this.enabled: ${this.enabled}`);
|
199
|
-
console.log(`this.FloorFilter: ${this.FloorFilter}`);
|
200
|
-
console.log(`webMap?.floorInfo: ${webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo}`);
|
219
|
+
async _initFloorFilter(view) {
|
220
|
+
const webMap = view === null || view === void 0 ? void 0 : view.map;
|
201
221
|
if (view && this.enabled && this.FloorFilter && (webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo)) {
|
202
|
-
this.
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
222
|
+
this._initContainer();
|
223
|
+
await webMap.when(() => {
|
224
|
+
var _a, _b, _c;
|
225
|
+
this.floorFilterWidget = new this.FloorFilter({
|
226
|
+
container: this._floorFilterElement,
|
227
|
+
view
|
228
|
+
});
|
229
|
+
(_a = this._facilityHandle) === null || _a === void 0 ? void 0 : _a.remove();
|
230
|
+
this._facilityHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.facility, (facility) => {
|
231
|
+
this.facilityChanged.emit(facility);
|
232
|
+
});
|
233
|
+
(_b = this._levelHandle) === null || _b === void 0 ? void 0 : _b.remove();
|
234
|
+
this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
|
235
|
+
this.levelChanged.emit(level);
|
236
|
+
});
|
237
|
+
(_c = this._siteHandle) === null || _c === void 0 ? void 0 : _c.remove();
|
238
|
+
this._siteHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.site, (site) => {
|
239
|
+
this.siteChanged.emit(site);
|
240
|
+
});
|
217
241
|
});
|
218
242
|
}
|
219
243
|
}
|
220
244
|
get el() { return index.getElement(this); }
|
221
245
|
static get watchers() { return {
|
222
|
-
"mapView": ["mapViewWatchHandler"]
|
246
|
+
"mapView": ["mapViewWatchHandler"],
|
247
|
+
"enabled": ["enabledWatchHandler"]
|
223
248
|
}; }
|
224
249
|
};
|
225
250
|
FloorFilter.style = FloorFilterStyle0;
|