@esri/solutions-components 0.7.22 → 0.7.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/assets/t9n/public-notification/resources.json +2 -3
  2. package/dist/assets/t9n/public-notification/resources_en.json +2 -3
  3. package/dist/cjs/basemap-gallery_7.cjs.entry.js +11 -12
  4. package/dist/cjs/calcite-alert_3.cjs.entry.js +23 -13
  5. package/dist/cjs/card-manager_3.cjs.entry.js +21 -3
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  8. package/dist/cjs/solutions-components.cjs.js +1 -1
  9. package/dist/collection/components/edit-card/edit-card.js +23 -13
  10. package/dist/collection/components/floor-filter/floor-filter.js +28 -12
  11. package/dist/collection/components/layer-table/layer-table.js +27 -3
  12. package/dist/collection/components/public-notification/public-notification.js +1 -1
  13. package/dist/collection/demos/crowdsource-manager.html +13 -0
  14. package/dist/components/edit-card2.js +23 -13
  15. package/dist/components/floor-filter2.js +12 -13
  16. package/dist/components/layer-table2.js +22 -4
  17. package/dist/components/public-notification.js +1 -1
  18. package/dist/esm/basemap-gallery_7.entry.js +11 -12
  19. package/dist/esm/calcite-alert_3.entry.js +23 -13
  20. package/dist/esm/card-manager_3.entry.js +21 -3
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/public-notification.entry.js +1 -1
  23. package/dist/esm/solutions-components.js +1 -1
  24. package/dist/solutions-components/demos/crowdsource-manager.html +13 -0
  25. package/dist/solutions-components/p-04f05bc5.entry.js +6 -0
  26. package/dist/solutions-components/{p-d3085b7a.entry.js → p-bacc9b0d.entry.js} +1 -1
  27. package/dist/solutions-components/{p-a40a1eab.entry.js → p-c634d047.entry.js} +1 -1
  28. package/dist/solutions-components/p-eff7f407.entry.js +6 -0
  29. package/dist/solutions-components/solutions-components.esm.js +1 -1
  30. package/dist/types/components/edit-card/edit-card.d.ts +2 -1
  31. package/dist/types/components/floor-filter/floor-filter.d.ts +13 -0
  32. package/dist/types/components/layer-table/layer-table.d.ts +19 -3
  33. package/dist/types/components.d.ts +19 -0
  34. package/dist/types/preact.d.ts +3 -1
  35. package/package.json +2 -2
  36. package/dist/solutions-components/p-630e274b.entry.js +0 -6
  37. package/dist/solutions-components/p-704da348.entry.js +0 -6
@@ -26,6 +26,7 @@ export class EditCard {
26
26
  constructor() {
27
27
  /**
28
28
  * boolean: When true the Editor widget should be closed
29
+ * Without this logic we are taken to the Editors "Select" workflow step
29
30
  */
30
31
  this._shouldClose = false;
31
32
  this.graphics = undefined;
@@ -44,8 +45,8 @@ export class EditCard {
44
45
  * Watch for changes to the graphics and update the feature widget
45
46
  */
46
47
  async graphicsWatchHandler() {
47
- if (this.graphics.length === 0) {
48
- await this._closeEdit();
48
+ if (this.graphics.length === 0 && this.open) {
49
+ await this._closeEdit(true);
49
50
  }
50
51
  }
51
52
  async openWatchHandler(v) {
@@ -59,11 +60,13 @@ export class EditCard {
59
60
  this._editorLoading = false;
60
61
  }
61
62
  if (!v) {
62
- await this._closeEdit();
63
+ await this._closeEdit(true);
63
64
  }
64
65
  }
65
66
  async featureSelectionChange() {
66
- await this._closeEdit();
67
+ if (this.open) {
68
+ await this._closeEdit(false);
69
+ }
67
70
  }
68
71
  //--------------------------------------------------------------------------
69
72
  //
@@ -94,7 +97,6 @@ export class EditCard {
94
97
  }
95
98
  this._layerEditHandle = this._layer.on("edits", () => {
96
99
  this.editsComplete.emit();
97
- this.open = false;
98
100
  });
99
101
  }
100
102
  }
@@ -109,7 +111,7 @@ export class EditCard {
109
111
  !this.graphics[0].layer.editingEnabled : true;
110
112
  const tableNodeClass = this._editorLoading ? "display-none" : "position-absolute";
111
113
  const loadingClass = this._editorLoading ? "" : "display-none";
112
- return (h(Host, null, h("div", { class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { class: "position-absolute", slot: "content" }, h("div", { class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { class: loadingClass, label: "", scale: "s" })))));
114
+ return (h(Host, null, h("div", { class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { class: "position-absolute" }, h("div", { class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { class: loadingClass, label: "", scale: "s" })))));
113
115
  }
114
116
  //--------------------------------------------------------------------------
115
117
  //
@@ -164,10 +166,13 @@ export class EditCard {
164
166
  this._shouldClose = false;
165
167
  });
166
168
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
169
+ var _a, _b;
167
170
  if ((activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "update-table-record" || (activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "create-features") {
168
171
  this._shouldClose = false;
169
172
  }
170
- if (!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits)) {
173
+ // Handle back click and when feature is de-selected from the table
174
+ // this ensures that we are not shown the Editors "Select" workflow step
175
+ if ((!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits) && !this._editor.activeWorkflow) || !((_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) === null || _b === void 0 ? void 0 : _b.started)) {
171
176
  this.open = false;
172
177
  }
173
178
  });
@@ -178,16 +183,21 @@ export class EditCard {
178
183
  /**
179
184
  * Close the edit widget
180
185
  */
181
- async _closeEdit() {
186
+ async _closeEdit(destroyOnClose) {
182
187
  var _a, _b, _c, _d;
183
188
  this._shouldClose = true;
184
- if ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) {
185
- await ((_b = this._editor) === null || _b === void 0 ? void 0 : _b.cancelWorkflow());
189
+ if (destroyOnClose && ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow)) {
190
+ if ((_c = (_b = this._editor.activeWorkflow) === null || _b === void 0 ? void 0 : _b.activeWorkflow) === null || _c === void 0 ? void 0 : _c.hasPendingEdits) {
191
+ await this._editor.activeWorkflow.reset();
192
+ await this._editor.cancelWorkflow();
193
+ }
194
+ this._editor.destroy();
186
195
  }
187
- if (this.graphicIndex > -1 && ((_c = this.graphics) === null || _c === void 0 ? void 0 : _c.length) > 0) {
188
- this.refreshGraphics.emit(this.graphics);
196
+ else {
197
+ if (this.graphicIndex > -1 && ((_d = this.graphics) === null || _d === void 0 ? void 0 : _d.length) > 0) {
198
+ this.refreshGraphics.emit(this.graphics);
199
+ }
189
200
  }
190
- (_d = this._editor) === null || _d === void 0 ? void 0 : _d.destroy();
191
201
  this._shouldClose = false;
192
202
  this.closeEdit.emit();
193
203
  }
@@ -38,16 +38,6 @@ export class FloorFilter {
38
38
  }
39
39
  //--------------------------------------------------------------------------
40
40
  //
41
- // Methods (public)
42
- //
43
- //--------------------------------------------------------------------------
44
- //--------------------------------------------------------------------------
45
- //
46
- // Events (public)
47
- //
48
- //--------------------------------------------------------------------------
49
- //--------------------------------------------------------------------------
50
- //
51
41
  // Functions (lifecycle)
52
42
  //
53
43
  //--------------------------------------------------------------------------
@@ -73,10 +63,12 @@ export class FloorFilter {
73
63
  * @protected
74
64
  */
75
65
  async _initModules() {
76
- const [FloorFilter] = await loadModules([
77
- "esri/widgets/FloorFilter"
66
+ const [FloorFilter, reactiveUtils] = await loadModules([
67
+ "esri/widgets/FloorFilter",
68
+ "esri/core/reactiveUtils"
78
69
  ]);
79
70
  this.FloorFilter = FloorFilter;
71
+ this.reactiveUtils = reactiveUtils;
80
72
  }
81
73
  /**
82
74
  * Initialize the floor filter or reset the current view if it already exists
@@ -89,6 +81,12 @@ export class FloorFilter {
89
81
  container: this._floorFilterElement,
90
82
  view
91
83
  });
84
+ if (this._levelHandle) {
85
+ this._levelHandle.remove();
86
+ }
87
+ this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
88
+ this.levelChanged.emit(level);
89
+ });
92
90
  }
93
91
  else {
94
92
  this.floorFilterWidget.view = view;
@@ -168,6 +166,24 @@ export class FloorFilter {
168
166
  }
169
167
  };
170
168
  }
169
+ static get events() {
170
+ return [{
171
+ "method": "levelChanged",
172
+ "name": "levelChanged",
173
+ "bubbles": true,
174
+ "cancelable": true,
175
+ "composed": true,
176
+ "docs": {
177
+ "tags": [],
178
+ "text": "Emitted on demand when the Level is changed"
179
+ },
180
+ "complexType": {
181
+ "original": "string",
182
+ "resolved": "string",
183
+ "references": {}
184
+ }
185
+ }];
186
+ }
171
187
  static get elementRef() { return "el"; }
172
188
  static get watchers() {
173
189
  return [{
@@ -177,8 +177,11 @@ export class LayerTable {
177
177
  * watch for changes in layer view and verify if it has editing enabled
178
178
  */
179
179
  async _layerWatchHandler() {
180
+ var _a, _b;
180
181
  this._fetchingData = true;
181
182
  this._definitionExpression = this._layer.definitionExpression;
183
+ this._floorField = (_b = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.floorInfo) === null || _b === void 0 ? void 0 : _b.floorField;
184
+ this._updateFloorDefinitionExpression();
182
185
  await this._resetTable();
183
186
  this._updateShareUrl();
184
187
  this._initLayerExpressions();
@@ -242,14 +245,19 @@ export class LayerTable {
242
245
  }
243
246
  /**
244
247
  * Refresh the table when edits are completed
245
- *
246
248
  */
247
249
  async editsComplete() {
248
250
  await this._refresh();
249
251
  }
250
252
  /**
251
- * Refresh the table when edits are completed
252
- *
253
+ * Refresh the table when floor filter level is changed
254
+ */
255
+ async levelChanged(evt) {
256
+ this._floorLevel = evt.detail;
257
+ this._updateFloorDefinitionExpression();
258
+ }
259
+ /**
260
+ * Refresh the table when
253
261
  */
254
262
  noLayersFound() {
255
263
  this._layer = undefined;
@@ -534,6 +542,16 @@ export class LayerTable {
534
542
  this._defaultVisibleToolSizeInfos = undefined;
535
543
  }
536
544
  }
545
+ /**
546
+ * Applies a definition expression when floor field and level are available
547
+ *
548
+ * @returns boolean
549
+ */
550
+ _updateFloorDefinitionExpression() {
551
+ if (this._floorField && this._floorLevel) {
552
+ this._layer.definitionExpression = `${this._floorField} = '${this._floorLevel}'`;
553
+ }
554
+ }
537
555
  /**
538
556
  * Returns true when one ore more features are selected
539
557
  *
@@ -1803,6 +1821,12 @@ export class LayerTable {
1803
1821
  "target": "window",
1804
1822
  "capture": false,
1805
1823
  "passive": false
1824
+ }, {
1825
+ "name": "levelChanged",
1826
+ "method": "levelChanged",
1827
+ "target": "window",
1828
+ "capture": false,
1829
+ "passive": false
1806
1830
  }, {
1807
1831
  "name": "noLayersFound",
1808
1832
  "method": "noLayersFound",
@@ -519,7 +519,7 @@ export class PublicNotification {
519
519
  const titleOptionsClass = this._addTitle ? "display-block" : "display-none";
520
520
  const title = this._titleValue ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
521
521
  const formatOptionsClass = this._addResults ? "" : "display-none";
522
- return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addResults, onCalciteCheckboxChange: () => this._addResults = !this._addResults }), this._translations.addResults)), h("div", { class: `padding-top-sides-1 ${formatOptionsClass}` }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: `padding-sides-1 ${formatOptionsClass}` }, h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.addTitle)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
522
+ return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addResults, onCalciteCheckboxChange: () => this._addResults = !this._addResults }), this._translations.addResults)), h("div", { class: `padding-top-sides-1 ${formatOptionsClass}` }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: `padding-sides-1 ${formatOptionsClass}` }, h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.title)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
523
523
  }
524
524
  /**
525
525
  * Render the refine page
@@ -95,6 +95,19 @@
95
95
  active: false
96
96
  }
97
97
  ]
98
+ }, {
99
+ id: "Requets_6608",
100
+ title: "Comments",
101
+ operator: " AND ",
102
+ expressions: [
103
+ {
104
+ definitionExpression: "OBJECTID > 1",
105
+ id: 1701793260226,
106
+ index: 0,
107
+ name: "greater than 1",
108
+ active: false
109
+ }
110
+ ]
98
111
  }
99
112
  ]
100
113
  }
@@ -22,6 +22,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
22
22
  this.refreshGraphics = createEvent(this, "refreshGraphics", 7);
23
23
  /**
24
24
  * boolean: When true the Editor widget should be closed
25
+ * Without this logic we are taken to the Editors "Select" workflow step
25
26
  */
26
27
  this._shouldClose = false;
27
28
  this.graphics = undefined;
@@ -40,8 +41,8 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
40
41
  * Watch for changes to the graphics and update the feature widget
41
42
  */
42
43
  async graphicsWatchHandler() {
43
- if (this.graphics.length === 0) {
44
- await this._closeEdit();
44
+ if (this.graphics.length === 0 && this.open) {
45
+ await this._closeEdit(true);
45
46
  }
46
47
  }
47
48
  async openWatchHandler(v) {
@@ -55,11 +56,13 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
55
56
  this._editorLoading = false;
56
57
  }
57
58
  if (!v) {
58
- await this._closeEdit();
59
+ await this._closeEdit(true);
59
60
  }
60
61
  }
61
62
  async featureSelectionChange() {
62
- await this._closeEdit();
63
+ if (this.open) {
64
+ await this._closeEdit(false);
65
+ }
63
66
  }
64
67
  //--------------------------------------------------------------------------
65
68
  //
@@ -90,7 +93,6 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
90
93
  }
91
94
  this._layerEditHandle = this._layer.on("edits", () => {
92
95
  this.editsComplete.emit();
93
- this.open = false;
94
96
  });
95
97
  }
96
98
  }
@@ -105,7 +107,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
105
107
  !this.graphics[0].layer.editingEnabled : true;
106
108
  const tableNodeClass = this._editorLoading ? "display-none" : "position-absolute";
107
109
  const loadingClass = this._editorLoading ? "" : "display-none";
108
- return (h(Host, null, h("div", { class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { class: "position-absolute", slot: "content" }, h("div", { class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { class: loadingClass, label: "", scale: "s" })))));
110
+ return (h(Host, null, h("div", { class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { class: "position-absolute" }, h("div", { class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { class: loadingClass, label: "", scale: "s" })))));
109
111
  }
110
112
  //--------------------------------------------------------------------------
111
113
  //
@@ -160,10 +162,13 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
160
162
  this._shouldClose = false;
161
163
  });
162
164
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
165
+ var _a, _b;
163
166
  if ((activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "update-table-record" || (activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "create-features") {
164
167
  this._shouldClose = false;
165
168
  }
166
- if (!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits)) {
169
+ // Handle back click and when feature is de-selected from the table
170
+ // this ensures that we are not shown the Editors "Select" workflow step
171
+ if ((!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits) && !this._editor.activeWorkflow) || !((_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) === null || _b === void 0 ? void 0 : _b.started)) {
167
172
  this.open = false;
168
173
  }
169
174
  });
@@ -174,16 +179,21 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
174
179
  /**
175
180
  * Close the edit widget
176
181
  */
177
- async _closeEdit() {
182
+ async _closeEdit(destroyOnClose) {
178
183
  var _a, _b, _c, _d;
179
184
  this._shouldClose = true;
180
- if ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) {
181
- await ((_b = this._editor) === null || _b === void 0 ? void 0 : _b.cancelWorkflow());
185
+ if (destroyOnClose && ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow)) {
186
+ if ((_c = (_b = this._editor.activeWorkflow) === null || _b === void 0 ? void 0 : _b.activeWorkflow) === null || _c === void 0 ? void 0 : _c.hasPendingEdits) {
187
+ await this._editor.activeWorkflow.reset();
188
+ await this._editor.cancelWorkflow();
189
+ }
190
+ this._editor.destroy();
182
191
  }
183
- if (this.graphicIndex > -1 && ((_c = this.graphics) === null || _c === void 0 ? void 0 : _c.length) > 0) {
184
- this.refreshGraphics.emit(this.graphics);
192
+ else {
193
+ if (this.graphicIndex > -1 && ((_d = this.graphics) === null || _d === void 0 ? void 0 : _d.length) > 0) {
194
+ this.refreshGraphics.emit(this.graphics);
195
+ }
185
196
  }
186
- (_d = this._editor) === null || _d === void 0 ? void 0 : _d.destroy();
187
197
  this._shouldClose = false;
188
198
  this.closeEdit.emit();
189
199
  }
@@ -3,7 +3,7 @@
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, h, Host } from '@stencil/core/internal/client';
6
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { l as loadModules } from './loadModules.js';
8
8
 
9
9
  const floorFilterCss = ":host{display:block}";
@@ -13,6 +13,7 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
13
13
  super();
14
14
  this.__registerHost();
15
15
  this.__attachShadow();
16
+ this.levelChanged = createEvent(this, "levelChanged", 7);
16
17
  this.enabled = undefined;
17
18
  this.floorFilterWidget = undefined;
18
19
  this.mapView = undefined;
@@ -29,16 +30,6 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
29
30
  }
30
31
  //--------------------------------------------------------------------------
31
32
  //
32
- // Methods (public)
33
- //
34
- //--------------------------------------------------------------------------
35
- //--------------------------------------------------------------------------
36
- //
37
- // Events (public)
38
- //
39
- //--------------------------------------------------------------------------
40
- //--------------------------------------------------------------------------
41
- //
42
33
  // Functions (lifecycle)
43
34
  //
44
35
  //--------------------------------------------------------------------------
@@ -64,10 +55,12 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
64
55
  * @protected
65
56
  */
66
57
  async _initModules() {
67
- const [FloorFilter] = await loadModules([
68
- "esri/widgets/FloorFilter"
58
+ const [FloorFilter, reactiveUtils] = await loadModules([
59
+ "esri/widgets/FloorFilter",
60
+ "esri/core/reactiveUtils"
69
61
  ]);
70
62
  this.FloorFilter = FloorFilter;
63
+ this.reactiveUtils = reactiveUtils;
71
64
  }
72
65
  /**
73
66
  * Initialize the floor filter or reset the current view if it already exists
@@ -80,6 +73,12 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
80
73
  container: this._floorFilterElement,
81
74
  view
82
75
  });
76
+ if (this._levelHandle) {
77
+ this._levelHandle.remove();
78
+ }
79
+ this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
80
+ this.levelChanged.emit(level);
81
+ });
83
82
  }
84
83
  else {
85
84
  this.floorFilterWidget.view = view;
@@ -205,8 +205,11 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
205
205
  * watch for changes in layer view and verify if it has editing enabled
206
206
  */
207
207
  async _layerWatchHandler() {
208
+ var _a, _b;
208
209
  this._fetchingData = true;
209
210
  this._definitionExpression = this._layer.definitionExpression;
211
+ this._floorField = (_b = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.floorInfo) === null || _b === void 0 ? void 0 : _b.floorField;
212
+ this._updateFloorDefinitionExpression();
210
213
  await this._resetTable();
211
214
  this._updateShareUrl();
212
215
  this._initLayerExpressions();
@@ -270,14 +273,19 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
270
273
  }
271
274
  /**
272
275
  * Refresh the table when edits are completed
273
- *
274
276
  */
275
277
  async editsComplete() {
276
278
  await this._refresh();
277
279
  }
278
280
  /**
279
- * Refresh the table when edits are completed
280
- *
281
+ * Refresh the table when floor filter level is changed
282
+ */
283
+ async levelChanged(evt) {
284
+ this._floorLevel = evt.detail;
285
+ this._updateFloorDefinitionExpression();
286
+ }
287
+ /**
288
+ * Refresh the table when
281
289
  */
282
290
  noLayersFound() {
283
291
  this._layer = undefined;
@@ -562,6 +570,16 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
562
570
  this._defaultVisibleToolSizeInfos = undefined;
563
571
  }
564
572
  }
573
+ /**
574
+ * Applies a definition expression when floor field and level are available
575
+ *
576
+ * @returns boolean
577
+ */
578
+ _updateFloorDefinitionExpression() {
579
+ if (this._floorField && this._floorLevel) {
580
+ this._layer.definitionExpression = `${this._floorField} = '${this._floorLevel}'`;
581
+ }
582
+ }
565
583
  /**
566
584
  * Returns true when one ore more features are selected
567
585
  *
@@ -1461,7 +1479,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1461
1479
  "_sortActive": [32],
1462
1480
  "_translations": [32],
1463
1481
  "deleteFeatures": [64]
1464
- }, [[8, "selectionChanged", "selectionChanged"], [8, "editsComplete", "editsComplete"], [8, "noLayersFound", "noLayersFound"]], {
1482
+ }, [[8, "selectionChanged", "selectionChanged"], [8, "editsComplete", "editsComplete"], [8, "levelChanged", "levelChanged"], [8, "noLayersFound", "noLayersFound"]], {
1465
1483
  "enableCSV": ["enableCSVWatchHandler"],
1466
1484
  "enableInlineEdit": ["enableInlineEditWatchHandler"],
1467
1485
  "_controlsThatFit": ["_controlsThatFitWatchHandler"],
@@ -552,7 +552,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class PublicNotifi
552
552
  const titleOptionsClass = this._addTitle ? "display-block" : "display-none";
553
553
  const title = this._titleValue ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
554
554
  const formatOptionsClass = this._addResults ? "" : "display-none";
555
- return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addResults, onCalciteCheckboxChange: () => this._addResults = !this._addResults }), this._translations.addResults)), h("div", { class: `padding-top-sides-1 ${formatOptionsClass}` }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: `padding-sides-1 ${formatOptionsClass}` }, h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.addTitle)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
555
+ return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addResults, onCalciteCheckboxChange: () => this._addResults = !this._addResults }), this._translations.addResults)), h("div", { class: `padding-top-sides-1 ${formatOptionsClass}` }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: `padding-sides-1 ${formatOptionsClass}` }, h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.title)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
556
556
  }
557
557
  /**
558
558
  * Render the refine page
@@ -120,6 +120,7 @@ const floorFilterCss = ":host{display:block}";
120
120
  const FloorFilter = class {
121
121
  constructor(hostRef) {
122
122
  registerInstance(this, hostRef);
123
+ this.levelChanged = createEvent(this, "levelChanged", 7);
123
124
  this.enabled = undefined;
124
125
  this.floorFilterWidget = undefined;
125
126
  this.mapView = undefined;
@@ -136,16 +137,6 @@ const FloorFilter = class {
136
137
  }
137
138
  //--------------------------------------------------------------------------
138
139
  //
139
- // Methods (public)
140
- //
141
- //--------------------------------------------------------------------------
142
- //--------------------------------------------------------------------------
143
- //
144
- // Events (public)
145
- //
146
- //--------------------------------------------------------------------------
147
- //--------------------------------------------------------------------------
148
- //
149
140
  // Functions (lifecycle)
150
141
  //
151
142
  //--------------------------------------------------------------------------
@@ -171,10 +162,12 @@ const FloorFilter = class {
171
162
  * @protected
172
163
  */
173
164
  async _initModules() {
174
- const [FloorFilter] = await loadModules([
175
- "esri/widgets/FloorFilter"
165
+ const [FloorFilter, reactiveUtils] = await loadModules([
166
+ "esri/widgets/FloorFilter",
167
+ "esri/core/reactiveUtils"
176
168
  ]);
177
169
  this.FloorFilter = FloorFilter;
170
+ this.reactiveUtils = reactiveUtils;
178
171
  }
179
172
  /**
180
173
  * Initialize the floor filter or reset the current view if it already exists
@@ -187,6 +180,12 @@ const FloorFilter = class {
187
180
  container: this._floorFilterElement,
188
181
  view
189
182
  });
183
+ if (this._levelHandle) {
184
+ this._levelHandle.remove();
185
+ }
186
+ this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
187
+ this.levelChanged.emit(level);
188
+ });
190
189
  }
191
190
  else {
192
191
  this.floorFilterWidget.view = view;
@@ -317,6 +317,7 @@ const EditCard = class {
317
317
  this.refreshGraphics = createEvent(this, "refreshGraphics", 7);
318
318
  /**
319
319
  * boolean: When true the Editor widget should be closed
320
+ * Without this logic we are taken to the Editors "Select" workflow step
320
321
  */
321
322
  this._shouldClose = false;
322
323
  this.graphics = undefined;
@@ -335,8 +336,8 @@ const EditCard = class {
335
336
  * Watch for changes to the graphics and update the feature widget
336
337
  */
337
338
  async graphicsWatchHandler() {
338
- if (this.graphics.length === 0) {
339
- await this._closeEdit();
339
+ if (this.graphics.length === 0 && this.open) {
340
+ await this._closeEdit(true);
340
341
  }
341
342
  }
342
343
  async openWatchHandler(v) {
@@ -350,11 +351,13 @@ const EditCard = class {
350
351
  this._editorLoading = false;
351
352
  }
352
353
  if (!v) {
353
- await this._closeEdit();
354
+ await this._closeEdit(true);
354
355
  }
355
356
  }
356
357
  async featureSelectionChange() {
357
- await this._closeEdit();
358
+ if (this.open) {
359
+ await this._closeEdit(false);
360
+ }
358
361
  }
359
362
  //--------------------------------------------------------------------------
360
363
  //
@@ -385,7 +388,6 @@ const EditCard = class {
385
388
  }
386
389
  this._layerEditHandle = this._layer.on("edits", () => {
387
390
  this.editsComplete.emit();
388
- this.open = false;
389
391
  });
390
392
  }
391
393
  }
@@ -400,7 +402,7 @@ const EditCard = class {
400
402
  !this.graphics[0].layer.editingEnabled : true;
401
403
  const tableNodeClass = this._editorLoading ? "display-none" : "position-absolute";
402
404
  const loadingClass = this._editorLoading ? "" : "display-none";
403
- return (h(Host, null, h("div", { class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { class: "position-absolute", slot: "content" }, h("div", { class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { class: loadingClass, label: "", scale: "s" })))));
405
+ return (h(Host, null, h("div", { class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { class: "position-absolute" }, h("div", { class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { class: loadingClass, label: "", scale: "s" })))));
404
406
  }
405
407
  //--------------------------------------------------------------------------
406
408
  //
@@ -455,10 +457,13 @@ const EditCard = class {
455
457
  this._shouldClose = false;
456
458
  });
457
459
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
460
+ var _a, _b;
458
461
  if ((activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "update-table-record" || (activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "create-features") {
459
462
  this._shouldClose = false;
460
463
  }
461
- if (!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits)) {
464
+ // Handle back click and when feature is de-selected from the table
465
+ // this ensures that we are not shown the Editors "Select" workflow step
466
+ if ((!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits) && !this._editor.activeWorkflow) || !((_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) === null || _b === void 0 ? void 0 : _b.started)) {
462
467
  this.open = false;
463
468
  }
464
469
  });
@@ -469,16 +474,21 @@ const EditCard = class {
469
474
  /**
470
475
  * Close the edit widget
471
476
  */
472
- async _closeEdit() {
477
+ async _closeEdit(destroyOnClose) {
473
478
  var _a, _b, _c, _d;
474
479
  this._shouldClose = true;
475
- if ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) {
476
- await ((_b = this._editor) === null || _b === void 0 ? void 0 : _b.cancelWorkflow());
480
+ if (destroyOnClose && ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow)) {
481
+ if ((_c = (_b = this._editor.activeWorkflow) === null || _b === void 0 ? void 0 : _b.activeWorkflow) === null || _c === void 0 ? void 0 : _c.hasPendingEdits) {
482
+ await this._editor.activeWorkflow.reset();
483
+ await this._editor.cancelWorkflow();
484
+ }
485
+ this._editor.destroy();
477
486
  }
478
- if (this.graphicIndex > -1 && ((_c = this.graphics) === null || _c === void 0 ? void 0 : _c.length) > 0) {
479
- this.refreshGraphics.emit(this.graphics);
487
+ else {
488
+ if (this.graphicIndex > -1 && ((_d = this.graphics) === null || _d === void 0 ? void 0 : _d.length) > 0) {
489
+ this.refreshGraphics.emit(this.graphics);
490
+ }
480
491
  }
481
- (_d = this._editor) === null || _d === void 0 ? void 0 : _d.destroy();
482
492
  this._shouldClose = false;
483
493
  this.closeEdit.emit();
484
494
  }