@esri/solutions-components 0.7.21 → 0.7.23
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/public-notification/resources.json +2 -3
- package/dist/assets/t9n/public-notification/resources_en.json +2 -3
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +11 -12
- package/dist/cjs/calcite-alert_3.cjs.entry.js +23 -13
- package/dist/cjs/card-manager_3.cjs.entry.js +124 -91
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/edit-card/edit-card.js +23 -13
- package/dist/collection/components/floor-filter/floor-filter.js +28 -12
- package/dist/collection/components/layer-table/layer-table.js +130 -91
- package/dist/collection/components/public-notification/public-notification.js +1 -1
- package/dist/collection/demos/crowdsource-manager.html +13 -0
- package/dist/components/edit-card2.js +23 -13
- package/dist/components/floor-filter2.js +12 -13
- package/dist/components/layer-table2.js +125 -92
- package/dist/components/public-notification.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +11 -12
- package/dist/esm/calcite-alert_3.entry.js +23 -13
- package/dist/esm/card-manager_3.entry.js +124 -91
- package/dist/esm/loader.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/crowdsource-manager.html +13 -0
- package/dist/solutions-components/p-04f05bc5.entry.js +6 -0
- package/dist/solutions-components/{p-d3085b7a.entry.js → p-bacc9b0d.entry.js} +1 -1
- package/dist/solutions-components/{p-a40a1eab.entry.js → p-c634d047.entry.js} +1 -1
- package/dist/solutions-components/p-eff7f407.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/edit-card/edit-card.d.ts +2 -1
- package/dist/types/components/floor-filter/floor-filter.d.ts +13 -0
- package/dist/types/components/layer-table/layer-table.d.ts +19 -3
- package/dist/types/components.d.ts +19 -0
- package/dist/types/preact.d.ts +3 -1
- package/package.json +2 -2
- package/dist/solutions-components/p-5302f406.entry.js +0 -6
- package/dist/solutions-components/p-704da348.entry.js +0 -6
@@ -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
|
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;
|
@@ -472,93 +480,105 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
472
480
|
const featuresSelected = this._featuresSelected();
|
473
481
|
const featuresEmpty = this._featuresEmpty();
|
474
482
|
const hasFilterExpressions = this._hasFilterExpressions();
|
475
|
-
this.
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
483
|
+
if (this._translations) {
|
484
|
+
this._toolInfos = [{
|
485
|
+
active: false,
|
486
|
+
icon: "zoom-to-object",
|
487
|
+
indicator: false,
|
488
|
+
label: this._translations.zoom,
|
489
|
+
func: () => this._zoom(),
|
490
|
+
disabled: !featuresSelected,
|
491
|
+
isOverflow: false
|
492
|
+
},
|
493
|
+
hasFilterExpressions ? {
|
494
|
+
active: false,
|
495
|
+
icon: "filter",
|
496
|
+
indicator: false,
|
497
|
+
label: this._translations.filters,
|
498
|
+
func: () => this._toggleFilter(),
|
499
|
+
disabled: false,
|
500
|
+
isOverflow: false
|
501
|
+
} : undefined,
|
502
|
+
this._deleteEnabled ? {
|
503
|
+
active: false,
|
504
|
+
icon: "trash",
|
505
|
+
indicator: false,
|
506
|
+
label: this._translations.delete,
|
507
|
+
func: () => this._delete(),
|
508
|
+
disabled: !featuresSelected,
|
509
|
+
isDanger: true,
|
510
|
+
isOverflow: false
|
511
|
+
} : undefined, {
|
512
|
+
active: false,
|
513
|
+
icon: "erase",
|
514
|
+
indicator: false,
|
515
|
+
label: this._translations.clearSelection,
|
516
|
+
func: () => this._clearSelection(),
|
517
|
+
disabled: !featuresSelected,
|
518
|
+
isOverflow: false
|
519
|
+
}, {
|
520
|
+
active: false,
|
521
|
+
icon: "selected-items-filter",
|
522
|
+
indicator: false,
|
523
|
+
label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
|
524
|
+
func: () => this._toggleShowSelected(),
|
525
|
+
disabled: !featuresSelected,
|
526
|
+
isOverflow: false
|
527
|
+
}, {
|
528
|
+
active: false,
|
529
|
+
icon: "list-check-all",
|
530
|
+
indicator: false,
|
531
|
+
func: () => this._selectAll(),
|
532
|
+
label: this._translations.selectAll,
|
533
|
+
disabled: featuresEmpty,
|
534
|
+
isOverflow: false
|
535
|
+
}, {
|
536
|
+
active: false,
|
537
|
+
icon: "compare",
|
538
|
+
indicator: false,
|
539
|
+
func: () => this._switchSelected(),
|
540
|
+
label: this._translations.switchSelected,
|
541
|
+
disabled: featuresEmpty,
|
542
|
+
isOverflow: false
|
543
|
+
}, {
|
544
|
+
active: false,
|
545
|
+
icon: "refresh",
|
546
|
+
indicator: false,
|
547
|
+
func: () => this._refresh(),
|
548
|
+
label: this._translations.refresh,
|
549
|
+
disabled: false,
|
550
|
+
isOverflow: false
|
551
|
+
},
|
552
|
+
this.enableCSV ? {
|
553
|
+
active: false,
|
554
|
+
icon: "export",
|
555
|
+
indicator: false,
|
556
|
+
func: () => void this._exportToCSV(),
|
557
|
+
label: this._translations.exportCSV,
|
558
|
+
disabled: featuresEmpty,
|
559
|
+
isOverflow: false
|
560
|
+
} : undefined, {
|
561
|
+
active: false,
|
562
|
+
icon: this._showHideOpen ? "chevron-down" : "chevron-right",
|
563
|
+
indicator: false,
|
564
|
+
func: () => this._toggleShowHide(),
|
565
|
+
label: this._translations.showHideColumns,
|
566
|
+
disabled: false,
|
567
|
+
isOverflow: false,
|
568
|
+
isSublist: true
|
569
|
+
}];
|
570
|
+
this._defaultVisibleToolSizeInfos = undefined;
|
571
|
+
}
|
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
|
+
}
|
562
582
|
}
|
563
583
|
/**
|
564
584
|
* Returns true when one ore more features are selected
|
@@ -769,12 +789,21 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
769
789
|
if ((_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.id) {
|
770
790
|
urlObj.searchParams.set("webmap", this.mapInfo.id);
|
771
791
|
}
|
792
|
+
else {
|
793
|
+
urlObj.searchParams.delete("webmap");
|
794
|
+
}
|
772
795
|
if ((_c = this._layer) === null || _c === void 0 ? void 0 : _c.id) {
|
773
796
|
urlObj.searchParams.set("layer", this._layer.id);
|
774
797
|
}
|
798
|
+
else {
|
799
|
+
urlObj.searchParams.delete("layer");
|
800
|
+
}
|
775
801
|
if (((_d = this._selectedIndexes) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
776
802
|
urlObj.searchParams.set("oid", this._selectedIndexes.join(","));
|
777
803
|
}
|
804
|
+
else {
|
805
|
+
urlObj.searchParams.delete("oid");
|
806
|
+
}
|
778
807
|
if (this._filterActive) {
|
779
808
|
const filter = JSON.parse(this._filterList.urlParams.get("filter"));
|
780
809
|
const layerExpressions = this._filterList.layerExpressions.map(layerExp => {
|
@@ -788,7 +817,11 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
788
817
|
});
|
789
818
|
urlObj.searchParams.set("filter", JSON.stringify(layerExpressions));
|
790
819
|
}
|
820
|
+
else {
|
821
|
+
urlObj.searchParams.delete("filter");
|
822
|
+
}
|
791
823
|
this._shareNode.shareUrl = urlObj.href;
|
824
|
+
history.pushState(history.state, document.title, urlObj.href);
|
792
825
|
}
|
793
826
|
/**
|
794
827
|
* Get a tooltip
|
@@ -1108,7 +1141,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1108
1141
|
*/
|
1109
1142
|
_filterModal() {
|
1110
1143
|
var _a, _b, _c;
|
1111
|
-
return (h("calcite-modal", { "aria-labelledby": "modal-title", class: "modal", kind: "brand", onCalciteModalClose: async () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, (_b = (_a = this._translations) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.replace("{{title}}", (_c = this._layer) === null || _c === void 0 ? void 0 : _c.title)), h("div", { slot: "content" }, h("instant-apps-filter-list", { autoUpdateUrl:
|
1144
|
+
return (h("calcite-modal", { "aria-labelledby": "modal-title", class: "modal", kind: "brand", onCalciteModalClose: async () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, (_b = (_a = this._translations) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.replace("{{title}}", (_c = this._layer) === null || _c === void 0 ? void 0 : _c.title)), h("div", { slot: "content" }, h("instant-apps-filter-list", { autoUpdateUrl: true, closeBtn: true, closeBtnOnClick: async () => this._closeFilter(), layerExpressions: this._layerExpressions, onFilterListReset: () => this._handleFilterListReset(), onFilterUpdate: () => this._handleFilterUpdate(), ref: (el) => this._filterList = el, view: this.mapView, zoomBtn: false }))));
|
1112
1145
|
}
|
1113
1146
|
/**
|
1114
1147
|
* Reset the filter active prop
|
@@ -1446,7 +1479,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1446
1479
|
"_sortActive": [32],
|
1447
1480
|
"_translations": [32],
|
1448
1481
|
"deleteFeatures": [64]
|
1449
|
-
}, [[8, "selectionChanged", "selectionChanged"], [8, "editsComplete", "editsComplete"], [8, "noLayersFound", "noLayersFound"]], {
|
1482
|
+
}, [[8, "selectionChanged", "selectionChanged"], [8, "editsComplete", "editsComplete"], [8, "levelChanged", "levelChanged"], [8, "noLayersFound", "noLayersFound"]], {
|
1450
1483
|
"enableCSV": ["enableCSVWatchHandler"],
|
1451
1484
|
"enableInlineEdit": ["enableInlineEditWatchHandler"],
|
1452
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.
|
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
|
-
|
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"
|
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
|
-
|
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
|
-
|
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
|
-
|
479
|
-
this.
|
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
|
}
|