@esri/solutions-components 0.10.43 → 0.10.45

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 (130) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +5 -5
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  3. package/dist/cjs/{calcite-alert_5.cjs.entry.js → calcite-alert_6.cjs.entry.js} +136 -0
  4. package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
  5. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
  6. package/dist/cjs/{calcite-shell_3.cjs.entry.js → calcite-shell.cjs.entry.js} +0 -256
  7. package/dist/cjs/card-manager_3.cjs.entry.js +42 -8
  8. package/dist/cjs/crowdsource-manager.cjs.entry.js +25 -4
  9. package/dist/cjs/delete-dialog.cjs.entry.js +131 -0
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  12. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  13. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  14. package/dist/cjs/share-item.cjs.entry.js +1 -1
  15. package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
  16. package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
  17. package/dist/cjs/solution-item-accordion.cjs.entry.js +1 -1
  18. package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
  19. package/dist/cjs/solutions-components.cjs.js +1 -1
  20. package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
  21. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +4 -0
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +31 -3
  23. package/dist/collection/components/layer-table/layer-table.js +61 -8
  24. package/dist/collection/components/map-card/map-card.js +1 -1
  25. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  26. package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
  27. package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
  28. package/dist/collection/components/map-legend/map-legend.js +1 -1
  29. package/dist/collection/components/map-picker/map-picker.js +1 -1
  30. package/dist/collection/components/map-search/map-search.js +1 -1
  31. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  32. package/dist/collection/components/map-tools/map-tools.js +1 -1
  33. package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
  34. package/dist/collection/components/pdf-download/pdf-download.js +1 -1
  35. package/dist/collection/components/public-notification/public-notification.js +1 -1
  36. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  37. package/dist/collection/components/share-item/share-item.js +1 -1
  38. package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
  39. package/dist/collection/components/solution-contents/solution-contents.js +1 -1
  40. package/dist/collection/components/solution-item/solution-item.js +1 -1
  41. package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +1 -1
  42. package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
  43. package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
  44. package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
  45. package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
  46. package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
  47. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
  48. package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
  49. package/dist/collection/components/solution-variables/solution-variables.js +1 -1
  50. package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
  51. package/dist/collection/utils/interfaces.ts +4 -0
  52. package/dist/components/crowdsource-manager.js +27 -5
  53. package/dist/components/layer-table2.js +113 -92
  54. package/dist/components/map-card2.js +1 -1
  55. package/dist/components/map-draw-tools2.js +1 -1
  56. package/dist/components/map-fullscreen2.js +1 -1
  57. package/dist/components/map-layer-picker2.js +1 -1
  58. package/dist/components/map-legend2.js +1 -1
  59. package/dist/components/map-picker2.js +1 -1
  60. package/dist/components/map-search2.js +1 -1
  61. package/dist/components/map-select-tools2.js +1 -1
  62. package/dist/components/map-tools2.js +1 -1
  63. package/dist/components/pci-calculator.js +1 -1
  64. package/dist/components/pdf-download2.js +1 -1
  65. package/dist/components/public-notification.js +1 -1
  66. package/dist/components/refine-selection2.js +1 -1
  67. package/dist/components/share-item.js +1 -1
  68. package/dist/components/solution-configuration.js +3 -3
  69. package/dist/components/solution-contents2.js +1 -1
  70. package/dist/components/solution-item-accordion.js +1 -1
  71. package/dist/components/solution-item-details2.js +1 -1
  72. package/dist/components/solution-item-icon2.js +1 -1
  73. package/dist/components/solution-item-sharing2.js +1 -1
  74. package/dist/components/solution-item2.js +1 -1
  75. package/dist/components/solution-organization-variables2.js +1 -1
  76. package/dist/components/solution-resource-item2.js +1 -1
  77. package/dist/components/solution-spatial-ref2.js +1 -1
  78. package/dist/components/solution-template-data2.js +1 -1
  79. package/dist/components/solution-variables2.js +1 -1
  80. package/dist/components/spatial-ref.js +1 -1
  81. package/dist/esm/basemap-gallery_7.entry.js +5 -5
  82. package/dist/esm/buffer-tools_3.entry.js +1 -1
  83. package/dist/esm/{calcite-alert_5.entry.js → calcite-alert_6.entry.js} +136 -1
  84. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  85. package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
  86. package/dist/esm/{calcite-shell_3.entry.js → calcite-shell.entry.js} +2 -256
  87. package/dist/esm/card-manager_3.entry.js +42 -8
  88. package/dist/esm/crowdsource-manager.entry.js +25 -4
  89. package/dist/esm/delete-dialog.entry.js +127 -0
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/map-select-tools_3.entry.js +3 -3
  92. package/dist/esm/pci-calculator.entry.js +1 -1
  93. package/dist/esm/public-notification.entry.js +1 -1
  94. package/dist/esm/share-item.entry.js +1 -1
  95. package/dist/esm/solution-configuration.entry.js +3 -3
  96. package/dist/esm/solution-contents_3.entry.js +3 -3
  97. package/dist/esm/solution-item-accordion.entry.js +1 -1
  98. package/dist/esm/solution-item-icon.entry.js +1 -1
  99. package/dist/esm/solutions-components.js +1 -1
  100. package/dist/esm/spatial-ref.entry.js +1 -1
  101. package/dist/solutions-components/{p-56beff4c.entry.js → p-112df7b2.entry.js} +1 -1
  102. package/dist/solutions-components/{p-ce53e33d.entry.js → p-11c2426d.entry.js} +2 -2
  103. package/dist/solutions-components/{p-5001cc41.entry.js → p-274aa753.entry.js} +1 -1
  104. package/dist/solutions-components/{p-e1e21798.entry.js → p-36b864ba.entry.js} +1 -1
  105. package/dist/solutions-components/{p-561c0e02.entry.js → p-44dc3dec.entry.js} +1 -1
  106. package/dist/solutions-components/{p-471d5c7f.entry.js → p-45ab1117.entry.js} +2 -2
  107. package/dist/solutions-components/p-49ed272d.entry.js +11 -0
  108. package/dist/solutions-components/{p-b7fbaeb7.entry.js → p-6b5b52c1.entry.js} +1 -1
  109. package/dist/solutions-components/{p-62d8796c.entry.js → p-7475b8b4.entry.js} +2 -2
  110. package/dist/solutions-components/{p-80e81af7.entry.js → p-7bcfe068.entry.js} +1 -1
  111. package/dist/solutions-components/{p-41314f33.entry.js → p-96027923.entry.js} +1 -1
  112. package/dist/solutions-components/p-9c25ee2c.entry.js +6 -0
  113. package/dist/solutions-components/{p-0a2e5861.entry.js → p-add973e2.entry.js} +1 -1
  114. package/dist/solutions-components/{p-8d4a4498.entry.js → p-b6d50640.entry.js} +1 -1
  115. package/dist/solutions-components/p-b8d1b57a.entry.js +6 -0
  116. package/dist/solutions-components/p-b95968fa.entry.js +6 -0
  117. package/dist/solutions-components/p-d2f8d8a8.entry.js +6 -0
  118. package/dist/solutions-components/{p-d51c07d2.entry.js → p-f57978f3.entry.js} +1 -1
  119. package/dist/solutions-components/solutions-components.esm.js +1 -1
  120. package/dist/solutions-components/utils/interfaces.ts +4 -0
  121. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +19 -0
  122. package/dist/types/components/layer-table/layer-table.d.ts +9 -5
  123. package/dist/types/components.d.ts +7 -2
  124. package/dist/types/preact.d.ts +2 -1
  125. package/dist/types/utils/interfaces.d.ts +3 -0
  126. package/package.json +1 -1
  127. package/dist/solutions-components/p-8b92fe23.entry.js +0 -6
  128. package/dist/solutions-components/p-8e2f4995.entry.js +0 -6
  129. package/dist/solutions-components/p-a1d8aed8.entry.js +0 -6
  130. package/dist/solutions-components/p-d7afbe8d.entry.js +0 -11
@@ -3,16 +3,13 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import { r as registerInstance, h, F as Fragment, g as getElement, c as createEvent, H as Host } from './index-904bc599.js';
6
+ import { r as registerInstance, h, F as Fragment, g as getElement } from './index-904bc599.js';
7
7
  import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-8a0b08ef.js';
8
8
  import { s as slotChangeHasAssignedElement, e as slotChangeGetAssignedElements } from './dom-75c641a7.js';
9
- import { g as getLocaleComponentStrings } from './locale-0d06fca0.js';
10
9
  import './observers-c83631e8.js';
11
10
  import './browser-b67d8df6.js';
12
11
  import './guid-b0fb1de3.js';
13
12
  import './resources-8e2ed936.js';
14
- import './esri-loader-c6842c6b.js';
15
- import './_commonjsHelpers-089957fe.js';
16
13
 
17
14
  /*!
18
15
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
@@ -202,255 +199,4 @@ const Shell = class {
202
199
  };
203
200
  Shell.style = CalciteShellStyle0;
204
201
 
205
- const deleteButtonCss = ":host{display:block}.delete-modal{position:fixed}";
206
- const DeleteButtonStyle0 = deleteButtonCss;
207
-
208
- const DeleteButton = class {
209
- constructor(hostRef) {
210
- registerInstance(this, hostRef);
211
- this.editsComplete = createEvent(this, "editsComplete", 7);
212
- this.deleteDialog = undefined;
213
- this.buttonType = "button";
214
- this.disabled = false;
215
- this.icon = undefined;
216
- this.ids = [];
217
- this.layer = undefined;
218
- this.locale = undefined;
219
- this._confirmDelete = false;
220
- this._deleteEndabled = false;
221
- this._supportsDelete = undefined;
222
- this._translations = undefined;
223
- }
224
- get el() { return getElement(this); }
225
- //--------------------------------------------------------------------------
226
- //
227
- // Properties (protected)
228
- //
229
- //--------------------------------------------------------------------------
230
- //--------------------------------------------------------------------------
231
- //
232
- // Watch handlers
233
- //
234
- //--------------------------------------------------------------------------
235
- /**
236
- * watch for changes in layer view and verify if it has editing enabled
237
- */
238
- async idsWatchHandler() {
239
- this._setDeleteEnabled();
240
- }
241
- /**
242
- * watch for changes in layer view and verify if it has editing enabled
243
- */
244
- async layerWatchHandler() {
245
- this._setDeleteEnabled();
246
- }
247
- /**
248
- * Fetch translations when the locale is updated
249
- */
250
- async localeWatchHandler() {
251
- // to support url param and language switcher
252
- this.el.lang = this.locale;
253
- await this._getTranslations();
254
- }
255
- //--------------------------------------------------------------------------
256
- //
257
- // Methods (public)
258
- //
259
- //--------------------------------------------------------------------------
260
- //--------------------------------------------------------------------------
261
- //
262
- // Events (public)
263
- //
264
- //--------------------------------------------------------------------------
265
- /**
266
- * Emitted on demand when features have been deleted
267
- */
268
- editsComplete;
269
- //--------------------------------------------------------------------------
270
- //
271
- // Functions (lifecycle)
272
- //
273
- //--------------------------------------------------------------------------
274
- /**
275
- * StencilJS: Called once just after the component is first connected to the DOM.
276
- *
277
- * @returns Promise when complete
278
- */
279
- async componentWillLoad() {
280
- await this._getTranslations();
281
- }
282
- /**
283
- * Renders the component.
284
- */
285
- render() {
286
- return (h(Host, { key: '1816da3d5cd7903b4e699dffa4ac4836dca722bb' }, this.buttonType === "button" ? (h("calcite-button", { appearance: "outline", disabled: !this._deleteEndabled, id: "solutions-delete", kind: "danger", onClick: () => this._delete(), width: "full" }, this._translations.deleteCount.replace("{{n}}", this.ids.length.toString()))) : (h("calcite-action", { appearance: "solid", compact: true, disabled: !this._deleteEndabled, id: this.icon, onClick: () => this._delete(), scale: "s", text: this._translations.delete }, h("calcite-button", { appearance: "transparent", iconStart: this.icon, kind: "danger" }, this._translations.delete))), this._deleteMessage(), h("calcite-tooltip", { key: '26fc4d4b4ea02b7a6c5e3f87abe2c5b8f96a3654', placement: "bottom", "reference-element": this.buttonType === "button" ? "solutions-delete" : this.icon }, h("span", { key: 'c2f7b101bb3a99274fe7f364ad29365c212d856e' }, this._translations.delete))));
287
- }
288
- /**
289
- * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
290
- */
291
- async componentDidLoad() {
292
- this._setDeleteEnabled();
293
- }
294
- //--------------------------------------------------------------------------
295
- //
296
- // Functions (protected)
297
- //
298
- //--------------------------------------------------------------------------
299
- /**
300
- * Verify if the layer supports delete and that we have 1 or more ids
301
- */
302
- _setDeleteEnabled() {
303
- this._supportsDelete = this.layer?.editingEnabled && this.layer?.capabilities?.operations?.supportsDelete;
304
- this._deleteEndabled = !this.disabled || this._supportsDelete && this.ids.length > 0;
305
- }
306
- /**
307
- * Delete all selected records or shows an alert if the layer does not have editing enabled
308
- *
309
- * @returns a promise that will resolve when the operation is complete
310
- */
311
- _delete() {
312
- this._confirmDelete = true;
313
- }
314
- /**
315
- * Show delete confirmation message
316
- *
317
- * @returns node to confirm or deny the delete operation
318
- */
319
- _deleteMessage() {
320
- return this.deleteDialog ? this.deleteDialog : (h("delete-dialog", { id: "solution-delete-dialog", ids: this.ids, layer: this.layer, locale: this.locale, onDeleteDialogClose: () => this._confirmDelete = false, open: this._confirmDelete }));
321
- }
322
- /**
323
- * Fetches the component's translations
324
- *
325
- * @returns Promise when complete
326
- * @protected
327
- */
328
- async _getTranslations() {
329
- const messages = await getLocaleComponentStrings(this.el);
330
- this._translations = messages[0];
331
- }
332
- static get watchers() { return {
333
- "ids": ["idsWatchHandler"],
334
- "layer": ["layerWatchHandler"],
335
- "locale": ["localeWatchHandler"]
336
- }; }
337
- };
338
- DeleteButton.style = DeleteButtonStyle0;
339
-
340
- const deleteDialogCss = ":host{display:block}.delete-modal{position:fixed}";
341
- const DeleteDialogStyle0 = deleteDialogCss;
342
-
343
- const DeleteDialog = class {
344
- constructor(hostRef) {
345
- registerInstance(this, hostRef);
346
- this.editsComplete = createEvent(this, "editsComplete", 7);
347
- this.deleteDialogClose = createEvent(this, "deleteDialogClose", 7);
348
- this.ids = [];
349
- this.layer = undefined;
350
- this.locale = undefined;
351
- this.open = false;
352
- this._isDeleting = false;
353
- this._translations = undefined;
354
- }
355
- get el() { return getElement(this); }
356
- //--------------------------------------------------------------------------
357
- //
358
- // Properties (protected)
359
- //
360
- //--------------------------------------------------------------------------
361
- //--------------------------------------------------------------------------
362
- //
363
- // Watch handlers
364
- //
365
- //--------------------------------------------------------------------------
366
- /**
367
- * Fetch translations when the locale is updated
368
- */
369
- async localeWatchHandler() {
370
- // to support url param and language switcher
371
- this.el.lang = this.locale;
372
- await this._getTranslations();
373
- }
374
- //--------------------------------------------------------------------------
375
- //
376
- // Methods (public)
377
- //
378
- //--------------------------------------------------------------------------
379
- //--------------------------------------------------------------------------
380
- //
381
- // Events (public)
382
- //
383
- //--------------------------------------------------------------------------
384
- /**
385
- * Emitted on demand when features have been deleted
386
- */
387
- editsComplete;
388
- /**
389
- * Emitted on demand when features have been deleted
390
- */
391
- deleteDialogClose;
392
- //--------------------------------------------------------------------------
393
- //
394
- // Functions (lifecycle)
395
- //
396
- //--------------------------------------------------------------------------
397
- /**
398
- * StencilJS: Called once just after the component is first connected to the DOM.
399
- *
400
- * @returns Promise when complete
401
- */
402
- async componentWillLoad() {
403
- await this._getTranslations();
404
- }
405
- /**
406
- * Renders the component.
407
- */
408
- render() {
409
- const confirmMessage = this.ids.length === 1 ? this._translations?.confirmSingle :
410
- this._translations?.confirmMultiple;
411
- return (h(Host, { key: 'eafca7d4325c65ff21fbfeaa24ea14e95bc25a34' }, h("calcite-modal", { key: '745e52d7b23318492914662cc769a1206baefd28', "aria-labelledby": "modal-title", class: "delete-modal", kind: "danger", onCalciteModalClose: () => this._close(), open: this.open, widthScale: "s" }, h("div", { key: '363614f6eaf30c30c6c2ccde3875dfff5cd94088', class: "display-flex align-center", id: "modal-title", slot: "header" }, this._translations?.deleteFeature), h("div", { key: 'b3b6f74495894589b7fd8be54265c4a69ffaa62e', slot: "content" }, confirmMessage), h("calcite-button", { key: 'd325fcf12624bac39f56ec690f7e4e9660789891', appearance: "outline", kind: "danger", onClick: () => this._close(), slot: "secondary", width: "full" }, this._translations?.cancel), h("calcite-button", { key: '73a10546ad92065c949bfacca3eb3d508685030e', kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations?.delete))));
412
- }
413
- //--------------------------------------------------------------------------
414
- //
415
- // Functions (protected)
416
- //
417
- //--------------------------------------------------------------------------
418
- /**
419
- * Delete the currently selected features
420
- */
421
- async _deleteFeatures() {
422
- this._isDeleting = true;
423
- const deleteFeatures = this.ids.map((objectId) => {
424
- return { objectId };
425
- });
426
- await this.layer.applyEdits({
427
- deleteFeatures
428
- });
429
- this._isDeleting = false;
430
- this._close();
431
- this.editsComplete.emit("delete");
432
- }
433
- /**
434
- * Set the alertOpen member to false when the alert is closed
435
- */
436
- _close() {
437
- this.open = false;
438
- this.deleteDialogClose.emit();
439
- }
440
- /**
441
- * Fetches the component's translations
442
- *
443
- * @returns Promise when complete
444
- * @protected
445
- */
446
- async _getTranslations() {
447
- const messages = await getLocaleComponentStrings(this.el);
448
- this._translations = messages[0];
449
- }
450
- static get watchers() { return {
451
- "locale": ["localeWatchHandler"]
452
- }; }
453
- };
454
- DeleteDialog.style = DeleteDialogStyle0;
455
-
456
- export { Shell as calcite_shell, DeleteButton as delete_button, DeleteDialog as delete_dialog };
202
+ export { Shell as calcite_shell };
@@ -221,6 +221,7 @@ const LayerTable = class {
221
221
  registerInstance(this, hostRef);
222
222
  this.featureSelectionChange = createEvent(this, "featureSelectionChange", 7);
223
223
  this.toggleFilter = createEvent(this, "toggleFilter", 7);
224
+ this.showDelete = createEvent(this, "showDelete", 7);
224
225
  this.appLayout = undefined;
225
226
  this.defaultGlobalId = undefined;
226
227
  this.defaultLayerId = undefined;
@@ -251,7 +252,6 @@ const LayerTable = class {
251
252
  this._filterOpen = false;
252
253
  this._layer = undefined;
253
254
  this._selectAllActive = false;
254
- this._deleteDialogOpen = false;
255
255
  this._showHideOpen = false;
256
256
  this._showOnlySelected = false;
257
257
  this._toolInfos = undefined;
@@ -422,6 +422,10 @@ const LayerTable = class {
422
422
  * string the current search expression
423
423
  */
424
424
  _searchExpression;
425
+ /**
426
+ * number[]: selected features from table
427
+ */
428
+ _tempSelectedIds;
425
429
  //--------------------------------------------------------------------------
426
430
  //
427
431
  // Watch handlers
@@ -614,6 +618,10 @@ const LayerTable = class {
614
618
  * Emitted on demand when filter action is clicked
615
619
  */
616
620
  toggleFilter;
621
+ /**
622
+ * Emitted on demand when when the delete dialog should be shown
623
+ */
624
+ showDelete;
617
625
  /**
618
626
  * Scroll and zoom to the selected feature from the Features widget.
619
627
  *
@@ -727,10 +735,10 @@ const LayerTable = class {
727
735
  const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
728
736
  const showSearch = this._canShowFullTextSearch();
729
737
  this._validateActiveActions();
730
- return (h(Host, { key: 'f56462fd5d5afa71052cf2557069bb2fee15aaeb' }, h("calcite-shell", { key: '92ccfa2235269aad6da5f918f79ec8ae100e99ca' }, this._getTableControlRow("header"), h("div", { key: 'e5b8fe5e4236e1a7b7e9d31ad784d9bb52a6918d', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: 'eca933d832e5b6efddb025211c253bf09e41ab22', class: "height-full width-full" }, showSearch &&
731
- h("div", { key: 'e819896c4264db3ee95d10194b67da65997b541d', class: "search-container" }, h("calcite-input", { key: 'e979c7962205caf072057332280b9e04ecd233c4', class: "search", clearable: true, icon: "search", onCalciteInputChange: (evt) => void this._searchTextChanged(evt), placeholder: this._searchPlaceHolder, title: this._searchPlaceHolder, type: "search" })), h("calcite-loader", { key: 'ee715472a4f819dd1e9328e75022439e9bba1334', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '8085821dea31de1fcbb1119e5791c0dea744e470', class: tableNodeClass, ref: this.onTableNodeCreate }))), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
738
+ return (h(Host, { key: 'ade26bd309af37b5b9f9bdc355f1cf6c575fa89a' }, h("calcite-shell", { key: '95668ae72cde1a3600e17a0d138ba8b810a4c525' }, this._getTableControlRow("header"), h("div", { key: '488eabfc4666c0d81aacbac523e7ba20288a4701', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: '75d01c41afbb872f57472adc76045431163c0cab', class: "height-full width-full" }, showSearch &&
739
+ h("div", { key: 'b6062ca6e5702fc835777a6fe6ecec7a66926bc0', class: "search-container" }, h("calcite-input", { key: 'eade11ccb0d7b6d5aed838dbb6b2eaec4286d8c6', class: "search", clearable: true, icon: "search", onCalciteInputChange: (evt) => void this._searchTextChanged(evt), placeholder: this._searchPlaceHolder, title: this._searchPlaceHolder, type: "search" })), h("calcite-loader", { key: '889c97b23074f5be4b045199cf48632720d6c598', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '4ac0bfdaf07c38ff57008bade29b4b90b11f437d', class: tableNodeClass, ref: this.onTableNodeCreate }))), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
732
740
  .replace("{{total}}", total)
733
- .replace("{{selected}}", selected))) : undefined), this.createFilterModal && this._filterModal(), h("delete-dialog", { key: '20c9a06c3f0d44433d9442755d25658c249e102c', id: "deleteDialogId", ids: this._getIds(), layer: this._layer, locale: this.locale, onDeleteDialogClose: () => this._deleteDialogOpen = false, open: this._deleteDialogOpen, ref: (el) => this._deleteDialog = el })));
741
+ .replace("{{selected}}", selected))) : undefined), this.createFilterModal && this._filterModal()));
734
742
  }
735
743
  _deleteDialog;
736
744
  /**
@@ -790,18 +798,37 @@ const LayerTable = class {
790
798
  *
791
799
  */
792
800
  async _searchFullText() {
801
+ let selectedIds = [];
802
+ let showSelected = false;
803
+ if (this._showOnlySelected) {
804
+ selectedIds = this._tempSelectedIds;
805
+ showSelected = true;
806
+ }
807
+ else {
808
+ this._clearSelection();
809
+ this._tempSelectedIds = [];
810
+ }
793
811
  //always clear previous search definition
794
812
  if (this._searchExpression) {
795
813
  this._clearSearchDefinitionExpression();
796
814
  }
815
+ let searchedIds = [];
797
816
  if (this._fullTextSearchInfo.length) {
798
817
  if (this._fullTextSearchInfo[0].searchTerm) {
799
818
  const searchQueryParams = this._layer.createQuery();
800
819
  searchQueryParams.fullText = this._fullTextSearchInfo;
801
- const searchedIds = await this._layer.queryObjectIds(searchQueryParams);
820
+ searchedIds = await this._layer.queryObjectIds(searchQueryParams);
821
+ if (showSelected && selectedIds?.length) {
822
+ searchedIds = searchedIds.filter((id) => selectedIds.includes(id));
823
+ }
802
824
  await this._updateSearchDefinitionExpression(searchedIds?.length ? searchedIds : [-1]);
803
825
  }
804
826
  }
827
+ // highlight the feature only when selected feature is present in applied filter
828
+ if (showSelected && searchedIds?.length) {
829
+ this._showOnlySelected = true;
830
+ this._table.highlightIds.addMany(searchedIds.reverse());
831
+ }
805
832
  //Added timeout and table.refresh() to avoid the issue in which we see empty table records after searching in combination to filter/reset filter
806
833
  await new Promise(resolve => setTimeout(resolve, 800));
807
834
  await this._updateAllIds();
@@ -1307,7 +1334,9 @@ const LayerTable = class {
1307
1334
  *
1308
1335
  */
1309
1336
  _showDelete() {
1310
- this._deleteDialogOpen = true;
1337
+ this.showDelete.emit({
1338
+ ids: this._getIds()
1339
+ });
1311
1340
  }
1312
1341
  /**
1313
1342
  * Get an action and tooltip for share
@@ -1385,7 +1414,7 @@ const LayerTable = class {
1385
1414
  */
1386
1415
  _getDangerAction(icon, label, func, disabled) {
1387
1416
  const _disabled = this._layer === undefined ? true : disabled;
1388
- return (h("div", { class: "display-flex", id: this._getId(icon) }, icon === "trash" ? (h("delete-button", { buttonType: "action", class: "display-flex", disabled: _disabled, icon: icon, id: "solutions-delete", ids: this._getIds(), layer: this._layer, locale: this.locale })) : (h("calcite-action", { appearance: "solid", disabled: _disabled, id: icon, onClick: func, text: label }, h("calcite-button", { appearance: "transparent", iconStart: icon, kind: "danger" }, label))), this._getToolTip("bottom", icon, label)));
1417
+ return (h("div", { class: "display-flex", id: this._getId(icon) }, (h("calcite-action", { appearance: "solid", compact: true, disabled: _disabled, id: icon, onClick: func, text: "" }, h("calcite-button", { appearance: "transparent", iconStart: icon, kind: "danger" }, label))), this._getToolTip("bottom", icon, label)));
1389
1418
  }
1390
1419
  /**
1391
1420
  * Return all currently selected IDs from the table
@@ -1421,6 +1450,7 @@ const LayerTable = class {
1421
1450
  highlightEnabled: true,
1422
1451
  multiSortEnabled: false,
1423
1452
  visibleElements: {
1453
+ columnDescriptions: false,
1424
1454
  header: false,
1425
1455
  menu: false
1426
1456
  },
@@ -1451,6 +1481,7 @@ const LayerTable = class {
1451
1481
  // only readd in specific case where we have multiple selected and then click one of the currently selected
1452
1482
  const reAdd = this.selectedIds.length > 1 && evt.removed.length === 1;
1453
1483
  const newIds = reAdd ? evt.removed : ids.filter(id => this.selectedIds.indexOf(id) < 0);
1484
+ this._tempSelectedIds = newIds.length ? [...newIds] : [...this.selectedIds];
1454
1485
  this._clearSelection();
1455
1486
  this.selectedIds = [...newIds];
1456
1487
  if (newIds.length > 0) {
@@ -1463,10 +1494,12 @@ const LayerTable = class {
1463
1494
  else {
1464
1495
  // https://github.com/Esri/solutions-components/issues/365
1465
1496
  this.selectedIds = ids.reverse();
1497
+ this._tempSelectedIds = [...this.selectedIds];
1466
1498
  }
1467
1499
  }
1468
1500
  else if (this._ctrlIsPressed) {
1469
1501
  this.selectedIds = ids.reverse();
1502
+ this._tempSelectedIds = [...this.selectedIds];
1470
1503
  }
1471
1504
  else if (this._shiftIsPressed && ids?.length > 0) {
1472
1505
  this._skipOnChange = true;
@@ -1503,6 +1536,7 @@ const LayerTable = class {
1503
1536
  }, []);
1504
1537
  const selectedIds = _start < _end ? idsInRange.reverse() : idsInRange;
1505
1538
  this.selectedIds = [...new Set([...selectedIds, ...this.selectedIds])];
1539
+ this._tempSelectedIds = [...this.selectedIds];
1506
1540
  this._table.highlightIds.addMany(this.selectedIds.filter(i => ids.indexOf(i) < 0));
1507
1541
  }
1508
1542
  }
@@ -2465,7 +2499,7 @@ const MapCard = class {
2465
2499
  const mapHeightClass = this.mapInfos?.length > 1 || this.isMapLayout ? "map-height" : "height-full";
2466
2500
  const progressClass = this.isMapLayout ? "" : "display-none";
2467
2501
  this._validateActiveActions();
2468
- return (h(Host, { key: '525ee5ce855cf5aa4f8c50e7e88be6c6236046ac' }, h("div", { key: '899898ee0b2ba9048ed24716a339c94d3106a52e', class: `${mapContainerClass} width-full`, ref: (el) => this._toolbar = el }, this._getActionBar(), !this.isMobile && this.isMapLayout && this._getDropdown("more-table-options"), this.enableShare && !this.isMobile && this.isMapLayout ? this._getShare("share") : undefined), h("calcite-progress", { key: '896569eb6cf65f45cbebb4b36f5b01ada5ed1092', class: progressClass, value: 0 }), h("div", { key: '79cac798541783bdc74e4b13f9df4d7564eb99f4', class: `${mapHeightClass} ${mapClass}`, ref: (el) => (this._mapDiv = el) }), h("map-tools", { key: '730d48c4ce98af3872bfa6c486e8749e18c24477', basemapConfig: this.basemapConfig, class: `box-shadow ${themeClass}`, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: this.enableSingleExpand, homeZoomToolsSize: this.homeZoomToolsSize, locale: this.locale, mapView: this.mapView, mapWidgetsSize: this.mapWidgetsSize, position: this.mapWidgetsPosition, ref: (el) => this._mapTools = el, searchConfiguration: this._searchConfiguration, stackTools: this.stackTools, toolOrder: this.toolOrder })));
2502
+ return (h(Host, { key: '5861d407b8529c6834d5d05450693d1fff2b71ee' }, h("div", { key: '01e028e8a00fc66d5eaa8eb7f85b58d579c3e7ff', class: `${mapContainerClass} width-full`, ref: (el) => this._toolbar = el }, this._getActionBar(), !this.isMobile && this.isMapLayout && this._getDropdown("more-table-options"), this.enableShare && !this.isMobile && this.isMapLayout ? this._getShare("share") : undefined), h("calcite-progress", { key: '6a0b7a2a734f3631b8c8a712acaf60a9e95c6c16', class: progressClass, value: 0 }), h("div", { key: '74cebf9c194bfc5b72be3b397821f586a5923fa4', class: `${mapHeightClass} ${mapClass}`, ref: (el) => (this._mapDiv = el) }), h("map-tools", { key: '6c87207eecaacf61c594f1036af38c0548ea1767', basemapConfig: this.basemapConfig, class: `box-shadow ${themeClass}`, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: this.enableSingleExpand, homeZoomToolsSize: this.homeZoomToolsSize, locale: this.locale, mapView: this.mapView, mapWidgetsSize: this.mapWidgetsSize, position: this.mapWidgetsPosition, ref: (el) => this._mapTools = el, searchConfiguration: this._searchConfiguration, stackTools: this.stackTools, toolOrder: this.toolOrder })));
2469
2503
  }
2470
2504
  /**
2471
2505
  * Called each time after the component is loaded
@@ -10,7 +10,7 @@ import { g as getLayerOrTable } from './mapViewUtils-f54edae3.js';
10
10
  import './esri-loader-c6842c6b.js';
11
11
  import './_commonjsHelpers-089957fe.js';
12
12
 
13
- const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-right{border-right:2px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.position-absolute{position:absolute}.position-sticky{position:sticky}.height-50{height:50%}.top-51{top:51px}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-51{height:calc(100% - 51px)}.display-none{display:none !important}.adjusted-height-50_25{height:calc(50% + 25px)}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}.z-index-0{z-index:0 !important}";
13
+ const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-right{border-right:2px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.position-absolute{position:absolute}.position-sticky{position:sticky}.height-50{height:50%}.top-51{top:51px}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-51{height:calc(100% - 51px)}.display-none{display:none !important}.adjusted-height-50_25{height:calc(50% + 25px)}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}.z-index-0{z-index:0 !important}.z-index-1{z-index:1 !important}";
14
14
  const CrowdsourceManagerStyle0 = crowdsourceManagerCss;
15
15
 
16
16
  const CrowdsourceManager = class {
@@ -56,6 +56,7 @@ const CrowdsourceManager = class {
56
56
  this.theme = "light";
57
57
  this.zoomAndScrollToSelected = false;
58
58
  this.zoomToScale = undefined;
59
+ this._deleteDialogOpen = false;
59
60
  this._enableCreateFeatures = true;
60
61
  this._hideFooter = false;
61
62
  this._hideTable = false;
@@ -93,6 +94,10 @@ const CrowdsourceManager = class {
93
94
  * MapView.when is not fired when mapView is not currently visible
94
95
  */
95
96
  _defaultLevelHonored = false;
97
+ /**
98
+ * number[]: the ids to be deleted
99
+ */
100
+ _deleteIds;
96
101
  /**
97
102
  * HTMLLayerTableElement: The layer table element
98
103
  */
@@ -224,6 +229,13 @@ const CrowdsourceManager = class {
224
229
  this._isLoading = false;
225
230
  });
226
231
  }
232
+ /**
233
+ * Get the feature ids and open the delete dialog
234
+ */
235
+ async showDelete(evt) {
236
+ this._deleteIds = evt.detail.ids;
237
+ this._deleteDialogOpen = true;
238
+ }
227
239
  /**
228
240
  * Get the layer ids from the map
229
241
  */
@@ -250,7 +262,7 @@ const CrowdsourceManager = class {
250
262
  render() {
251
263
  // only avoid border when we have a header color that is not white
252
264
  const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
253
- return (h(Host, { key: '8fd887051b4437477f1413843dfc6d938304364a' }, h("calcite-shell", { key: 'a9989a1698b268db75cdbcadcd3956d944daa25c', class: "position-relative" }, h("calcite-panel", { key: '88c5631e21b5ccb6a958e016c274e3aa746a6af1', class: `width-full height-full ${borderClass}`, loading: this._isLoading }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter()), this._filterModal()));
265
+ return (h(Host, { key: '8f8d68ca8cd5e170196639cda11b61d64a8e6050' }, h("calcite-shell", { key: '351696228f10d637c4c033d857dc2e169d33bcb5', class: "position-relative" }, h("calcite-panel", { key: 'b77a1b4d4d15f466cf2650d86f084c150b8aaa86', class: `width-full height-full ${borderClass}`, loading: this._isLoading }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter()), this._filterModal(), this._deleteModal()));
254
266
  }
255
267
  /**
256
268
  * Called after each render
@@ -430,7 +442,7 @@ const CrowdsourceManager = class {
430
442
  _getMapAndCard(layoutMode, panelOpen, hideTable) {
431
443
  const mapSizeClass = this._getMapSizeClass(layoutMode, panelOpen, hideTable);
432
444
  const borderRight = !this._isPortraitMobile && this._isMobile ? "border-right" : "";
433
- return (h("div", { class: `${mapSizeClass} overflow-hidden ${borderRight}` }, this._getMapNode(panelOpen), this._getPopupExpandNode()));
445
+ return (h("div", { class: `${mapSizeClass} overflow-hidden z-index-1 ${borderRight}` }, this._getMapNode(panelOpen), this._getPopupExpandNode()));
434
446
  }
435
447
  /**
436
448
  * Get the map node based for the current layout options
@@ -455,7 +467,7 @@ const CrowdsourceManager = class {
455
467
  * @protected
456
468
  */
457
469
  _getPopupExpandNode() {
458
- const popupNodeClass = this._isMobile ? "height-full" : "height-full position-relative z-index-0";
470
+ const popupNodeClass = this._isMobile ? "height-full" : "height-full position-relative";
459
471
  const headerClass = this._isPortraitMobile && this._showInformationHeader ? "display-none height-0" : "";
460
472
  const headerTheme = this.popupHeaderColor ? "" : !this._isPortraitMobile ? "calcite-mode-dark" : "calcite-mode-light";
461
473
  const containerClass = this._isPortraitMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isPortraitMobile ? "display-none height-0" : "";
@@ -522,6 +534,15 @@ const CrowdsourceManager = class {
522
534
  const id = "toggle-layout";
523
535
  return (h(Fragment, null, h("calcite-action", { active: this.appLayout === 'splitView', class: "toggle-node", icon: "browser", id: "browser-action", onClick: () => { this.appLayout = "splitView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-action" }, h("span", null, this._translations.splitView)), h("calcite-action", { active: this.appLayout === 'tableView', class: "toggle-node", icon: "dock-left", id: "dock-left-action", onClick: () => { this.appLayout = "tableView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "dock-left-action" }, h("span", null, this._translations.tableView)), h("calcite-action", { active: this.appLayout === 'mapView', class: "toggle-node", disabled: this._layerIds?.length === 0, icon: "browser-map", id: "browser-map-action", onClick: () => { this.appLayout = "mapView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-map-action" }, h("span", null, this._translations.mapView)), h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), slot: "actions-end", text: "" }), h("calcite-tooltip", { placement: "bottom", "reference-element": id }, h("span", null, tooltip))));
524
536
  }
537
+ /**
538
+ * Show delete dialog
539
+ *
540
+ * @returns node that will support delete or keep of the features
541
+ * @protected
542
+ */
543
+ _deleteModal() {
544
+ return (h("delete-dialog", { id: "deleteDialogId", ids: this._deleteIds, layer: this._layer, locale: this.locale, onDeleteDialogClose: () => this._deleteDialogOpen = false, open: this._deleteDialogOpen }));
545
+ }
525
546
  /**
526
547
  * Show filter component in modal
527
548
  *
@@ -0,0 +1,127 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-904bc599.js';
7
+ import { g as getLocaleComponentStrings } from './locale-0d06fca0.js';
8
+ import './esri-loader-c6842c6b.js';
9
+ import './_commonjsHelpers-089957fe.js';
10
+
11
+ const deleteDialogCss = ":host{display:block}.delete-modal{position:fixed}";
12
+ const DeleteDialogStyle0 = deleteDialogCss;
13
+
14
+ const DeleteDialog = class {
15
+ constructor(hostRef) {
16
+ registerInstance(this, hostRef);
17
+ this.editsComplete = createEvent(this, "editsComplete", 7);
18
+ this.deleteDialogClose = createEvent(this, "deleteDialogClose", 7);
19
+ this.ids = [];
20
+ this.layer = undefined;
21
+ this.locale = undefined;
22
+ this.open = false;
23
+ this._isDeleting = false;
24
+ this._translations = undefined;
25
+ }
26
+ get el() { return getElement(this); }
27
+ //--------------------------------------------------------------------------
28
+ //
29
+ // Properties (protected)
30
+ //
31
+ //--------------------------------------------------------------------------
32
+ //--------------------------------------------------------------------------
33
+ //
34
+ // Watch handlers
35
+ //
36
+ //--------------------------------------------------------------------------
37
+ /**
38
+ * Fetch translations when the locale is updated
39
+ */
40
+ async localeWatchHandler() {
41
+ // to support url param and language switcher
42
+ this.el.lang = this.locale;
43
+ await this._getTranslations();
44
+ }
45
+ //--------------------------------------------------------------------------
46
+ //
47
+ // Methods (public)
48
+ //
49
+ //--------------------------------------------------------------------------
50
+ //--------------------------------------------------------------------------
51
+ //
52
+ // Events (public)
53
+ //
54
+ //--------------------------------------------------------------------------
55
+ /**
56
+ * Emitted on demand when features have been deleted
57
+ */
58
+ editsComplete;
59
+ /**
60
+ * Emitted on demand when features have been deleted
61
+ */
62
+ deleteDialogClose;
63
+ //--------------------------------------------------------------------------
64
+ //
65
+ // Functions (lifecycle)
66
+ //
67
+ //--------------------------------------------------------------------------
68
+ /**
69
+ * StencilJS: Called once just after the component is first connected to the DOM.
70
+ *
71
+ * @returns Promise when complete
72
+ */
73
+ async componentWillLoad() {
74
+ await this._getTranslations();
75
+ }
76
+ /**
77
+ * Renders the component.
78
+ */
79
+ render() {
80
+ const confirmMessage = this.ids.length === 1 ? this._translations?.confirmSingle :
81
+ this._translations?.confirmMultiple;
82
+ return (h(Host, { key: 'eafca7d4325c65ff21fbfeaa24ea14e95bc25a34' }, h("calcite-modal", { key: '745e52d7b23318492914662cc769a1206baefd28', "aria-labelledby": "modal-title", class: "delete-modal", kind: "danger", onCalciteModalClose: () => this._close(), open: this.open, widthScale: "s" }, h("div", { key: '363614f6eaf30c30c6c2ccde3875dfff5cd94088', class: "display-flex align-center", id: "modal-title", slot: "header" }, this._translations?.deleteFeature), h("div", { key: 'b3b6f74495894589b7fd8be54265c4a69ffaa62e', slot: "content" }, confirmMessage), h("calcite-button", { key: 'd325fcf12624bac39f56ec690f7e4e9660789891', appearance: "outline", kind: "danger", onClick: () => this._close(), slot: "secondary", width: "full" }, this._translations?.cancel), h("calcite-button", { key: '73a10546ad92065c949bfacca3eb3d508685030e', kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations?.delete))));
83
+ }
84
+ //--------------------------------------------------------------------------
85
+ //
86
+ // Functions (protected)
87
+ //
88
+ //--------------------------------------------------------------------------
89
+ /**
90
+ * Delete the currently selected features
91
+ */
92
+ async _deleteFeatures() {
93
+ this._isDeleting = true;
94
+ const deleteFeatures = this.ids.map((objectId) => {
95
+ return { objectId };
96
+ });
97
+ await this.layer.applyEdits({
98
+ deleteFeatures
99
+ });
100
+ this._isDeleting = false;
101
+ this._close();
102
+ this.editsComplete.emit("delete");
103
+ }
104
+ /**
105
+ * Set the alertOpen member to false when the alert is closed
106
+ */
107
+ _close() {
108
+ this.open = false;
109
+ this.deleteDialogClose.emit();
110
+ }
111
+ /**
112
+ * Fetches the component's translations
113
+ *
114
+ * @returns Promise when complete
115
+ * @protected
116
+ */
117
+ async _getTranslations() {
118
+ const messages = await getLocaleComponentStrings(this.el);
119
+ this._translations = messages[0];
120
+ }
121
+ static get watchers() { return {
122
+ "locale": ["localeWatchHandler"]
123
+ }; }
124
+ };
125
+ DeleteDialog.style = DeleteDialogStyle0;
126
+
127
+ export { DeleteDialog as delete_dialog };