@esri/solutions-components 0.7.20 → 0.7.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/dist/assets/t9n/public-notification/resources.json +2 -1
  2. package/dist/assets/t9n/public-notification/resources_en.json +2 -1
  3. package/dist/cjs/card-manager_3.cjs.entry.js +133 -91
  4. package/dist/cjs/crowdsource-manager.cjs.entry.js +10 -10
  5. package/dist/cjs/{downloadUtils-9a13c6ac.js → downloadUtils-401356b5.js} +5 -3
  6. package/dist/cjs/{index.es-284a020c.js → index.es-a9a4ff08.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
  9. package/dist/cjs/public-notification.cjs.entry.js +7 -4
  10. package/dist/cjs/solutions-components.cjs.js +1 -1
  11. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +29 -11
  12. package/dist/collection/components/layer-table/layer-table.js +162 -99
  13. package/dist/collection/components/public-notification/public-notification.js +7 -3
  14. package/dist/collection/utils/pdfUtils.js +4 -2
  15. package/dist/collection/utils/pdfUtils.ts +4 -2
  16. package/dist/components/crowdsource-manager.js +13 -12
  17. package/dist/components/downloadUtils.js +4 -2
  18. package/dist/components/layer-table2.js +134 -91
  19. package/dist/components/public-notification.js +7 -3
  20. package/dist/esm/card-manager_3.entry.js +133 -91
  21. package/dist/esm/crowdsource-manager.entry.js +10 -10
  22. package/dist/esm/{downloadUtils-a4bbdb1d.js → downloadUtils-13579d93.js} +5 -3
  23. package/dist/esm/{index.es-48fdb288.js → index.es-04d2e63e.js} +1 -1
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/esm/map-select-tools_3.entry.js +1 -1
  26. package/dist/esm/public-notification.entry.js +7 -4
  27. package/dist/esm/solutions-components.js +1 -1
  28. package/dist/solutions-components/p-02fad071.entry.js +6 -0
  29. package/dist/solutions-components/{p-b1422b00.entry.js → p-24286e8c.entry.js} +1 -1
  30. package/dist/solutions-components/p-630e274b.entry.js +6 -0
  31. package/dist/solutions-components/{p-72dbfa77.js → p-c68a6d4f.js} +1 -1
  32. package/dist/solutions-components/{p-d4afcf86.js → p-c9f87acb.js} +2 -2
  33. package/dist/solutions-components/p-d3085b7a.entry.js +6 -0
  34. package/dist/solutions-components/solutions-components.esm.js +1 -1
  35. package/dist/solutions-components/utils/pdfUtils.ts +4 -2
  36. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +13 -4
  37. package/dist/types/components/layer-table/layer-table.d.ts +14 -5
  38. package/dist/types/components/public-notification/public-notification.d.ts +4 -0
  39. package/dist/types/components.d.ts +18 -0
  40. package/package.json +1 -1
  41. package/dist/solutions-components/p-107b7816.entry.js +0 -6
  42. package/dist/solutions-components/p-2abc02a1.entry.js +0 -6
  43. package/dist/solutions-components/p-6b4e621b.entry.js +0 -6
@@ -29,6 +29,7 @@ export class CrowdsourceManager {
29
29
  */
30
30
  this._shouldSetMapView = false;
31
31
  this.defaultCenter = "";
32
+ this.defaultFilter = "";
32
33
  this.defaultGlobalId = "";
33
34
  this.defaultLayer = "";
34
35
  this.defaultLevel = "";
@@ -79,6 +80,12 @@ export class CrowdsourceManager {
79
80
  this._defaultCenter = !this.defaultCenter ? undefined :
80
81
  this.defaultCenter.split(";").map(v => parseFloat(v));
81
82
  }
83
+ /**
84
+ * Watch for filter url param to be set
85
+ */
86
+ defaultFilterWatchHandler() {
87
+ this._defaultFilter = JSON.parse(this.defaultFilter);
88
+ }
82
89
  /**
83
90
  * Watch for globalid url param to be set
84
91
  */
@@ -105,13 +112,6 @@ export class CrowdsourceManager {
105
112
  enableZoomWatchHandler() {
106
113
  this._initMapZoom();
107
114
  }
108
- /**
109
- * Show the map, popup, and table if the user switches out of mobile mode
110
- */
111
- async _isMobileWatchHandler() {
112
- const show = !this._isMobile ? false : this._numSelected > 0;
113
- this.showHideMapPopupAndTable(show);
114
- }
115
115
  //--------------------------------------------------------------------------
116
116
  //
117
117
  // Methods (public)
@@ -390,7 +390,7 @@ export class CrowdsourceManager {
390
390
  const toggleLayout = layoutMode === ELayoutMode.HORIZONTAL ? "horizontal" : "vertical";
391
391
  const toggleSlot = layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
392
392
  const hasMapAndLayer = this.defaultWebmap && this.defaultLayer;
393
- return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
393
+ return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultFilter: hasMapAndLayer ? this._defaultFilter : undefined, defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
394
394
  }
395
395
  /**
396
396
  * Update the component layout when its size changes
@@ -510,6 +510,24 @@ export class CrowdsourceManager {
510
510
  "reflect": false,
511
511
  "defaultValue": "\"\""
512
512
  },
513
+ "defaultFilter": {
514
+ "type": "string",
515
+ "mutable": false,
516
+ "complexType": {
517
+ "original": "string",
518
+ "resolved": "string",
519
+ "references": {}
520
+ },
521
+ "required": false,
522
+ "optional": false,
523
+ "docs": {
524
+ "tags": [],
525
+ "text": "string: default layer expression to apply to the current layer"
526
+ },
527
+ "attribute": "default-filter",
528
+ "reflect": false,
529
+ "defaultValue": "\"\""
530
+ },
513
531
  "defaultGlobalId": {
514
532
  "type": "string",
515
533
  "mutable": false,
@@ -1014,6 +1032,9 @@ export class CrowdsourceManager {
1014
1032
  return [{
1015
1033
  "propName": "defaultCenter",
1016
1034
  "methodName": "defaultCenterWatchHandler"
1035
+ }, {
1036
+ "propName": "defaultFilter",
1037
+ "methodName": "defaultFilterWatchHandler"
1017
1038
  }, {
1018
1039
  "propName": "defaultGlobalId",
1019
1040
  "methodName": "defaultGlobalIdWatchHandler"
@@ -1026,9 +1047,6 @@ export class CrowdsourceManager {
1026
1047
  }, {
1027
1048
  "propName": "enableZoom",
1028
1049
  "methodName": "enableZoomWatchHandler"
1029
- }, {
1030
- "propName": "_isMobile",
1031
- "methodName": "_isMobileWatchHandler"
1032
1050
  }];
1033
1051
  }
1034
1052
  static get listeners() {
@@ -35,6 +35,10 @@ export class LayerTable {
35
35
  * boolean: When true the ctrl key is currently pressed
36
36
  */
37
37
  this._ctrlIsPressed = false;
38
+ /**
39
+ * boolean: When true the default filter provided via url param has been honored and should now be ignored
40
+ */
41
+ this._defaultFilterHonored = false;
38
42
  /**
39
43
  * boolean: When true the default global id provided via url param has been honored and should now be ignored
40
44
  */
@@ -68,8 +72,9 @@ export class LayerTable {
68
72
  this.onTableNodeCreate = (node) => {
69
73
  this._tableNode = node;
70
74
  };
71
- this.defaultLayerId = undefined;
75
+ this.defaultFilter = undefined;
72
76
  this.defaultGlobalId = undefined;
77
+ this.defaultLayerId = undefined;
73
78
  this.defaultOid = undefined;
74
79
  this.enableAutoRefresh = undefined;
75
80
  this.enableColumnReorder = true;
@@ -439,93 +444,95 @@ export class LayerTable {
439
444
  const featuresSelected = this._featuresSelected();
440
445
  const featuresEmpty = this._featuresEmpty();
441
446
  const hasFilterExpressions = this._hasFilterExpressions();
442
- this._toolInfos = [{
443
- active: false,
444
- icon: "zoom-to-object",
445
- indicator: false,
446
- label: this._translations.zoom,
447
- func: () => this._zoom(),
448
- disabled: !featuresSelected,
449
- isOverflow: false
450
- },
451
- hasFilterExpressions ? {
452
- active: false,
453
- icon: "filter",
454
- indicator: false,
455
- label: this._translations.filters,
456
- func: () => this._toggleFilter(),
457
- disabled: false,
458
- isOverflow: false
459
- } : undefined,
460
- this._deleteEnabled ? {
461
- active: false,
462
- icon: "trash",
463
- indicator: false,
464
- label: this._translations.delete,
465
- func: () => this._delete(),
466
- disabled: !featuresSelected,
467
- isDanger: true,
468
- isOverflow: false
469
- } : undefined, {
470
- active: false,
471
- icon: "erase",
472
- indicator: false,
473
- label: this._translations.clearSelection,
474
- func: () => this._clearSelection(),
475
- disabled: !featuresSelected,
476
- isOverflow: false
477
- }, {
478
- active: false,
479
- icon: "selected-items-filter",
480
- indicator: false,
481
- label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
482
- func: () => this._toggleShowSelected(),
483
- disabled: !featuresSelected,
484
- isOverflow: false
485
- }, {
486
- active: false,
487
- icon: "list-check-all",
488
- indicator: false,
489
- func: () => this._selectAll(),
490
- label: this._translations.selectAll,
491
- disabled: featuresEmpty,
492
- isOverflow: false
493
- }, {
494
- active: false,
495
- icon: "compare",
496
- indicator: false,
497
- func: () => this._switchSelected(),
498
- label: this._translations.switchSelected,
499
- disabled: featuresEmpty,
500
- isOverflow: false
501
- }, {
502
- active: false,
503
- icon: "refresh",
504
- indicator: false,
505
- func: () => this._refresh(),
506
- label: this._translations.refresh,
507
- disabled: false,
508
- isOverflow: false
509
- },
510
- this.enableCSV ? {
511
- active: false,
512
- icon: "export",
513
- indicator: false,
514
- func: () => void this._exportToCSV(),
515
- label: this._translations.exportCSV,
516
- disabled: featuresEmpty,
517
- isOverflow: false
518
- } : undefined, {
519
- active: false,
520
- icon: this._showHideOpen ? "chevron-down" : "chevron-right",
521
- indicator: false,
522
- func: () => this._toggleShowHide(),
523
- label: this._translations.showHideColumns,
524
- disabled: false,
525
- isOverflow: false,
526
- isSublist: true
527
- }];
528
- this._defaultVisibleToolSizeInfos = undefined;
447
+ if (this._translations) {
448
+ this._toolInfos = [{
449
+ active: false,
450
+ icon: "zoom-to-object",
451
+ indicator: false,
452
+ label: this._translations.zoom,
453
+ func: () => this._zoom(),
454
+ disabled: !featuresSelected,
455
+ isOverflow: false
456
+ },
457
+ hasFilterExpressions ? {
458
+ active: false,
459
+ icon: "filter",
460
+ indicator: false,
461
+ label: this._translations.filters,
462
+ func: () => this._toggleFilter(),
463
+ disabled: false,
464
+ isOverflow: false
465
+ } : undefined,
466
+ this._deleteEnabled ? {
467
+ active: false,
468
+ icon: "trash",
469
+ indicator: false,
470
+ label: this._translations.delete,
471
+ func: () => this._delete(),
472
+ disabled: !featuresSelected,
473
+ isDanger: true,
474
+ isOverflow: false
475
+ } : undefined, {
476
+ active: false,
477
+ icon: "erase",
478
+ indicator: false,
479
+ label: this._translations.clearSelection,
480
+ func: () => this._clearSelection(),
481
+ disabled: !featuresSelected,
482
+ isOverflow: false
483
+ }, {
484
+ active: false,
485
+ icon: "selected-items-filter",
486
+ indicator: false,
487
+ label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
488
+ func: () => this._toggleShowSelected(),
489
+ disabled: !featuresSelected,
490
+ isOverflow: false
491
+ }, {
492
+ active: false,
493
+ icon: "list-check-all",
494
+ indicator: false,
495
+ func: () => this._selectAll(),
496
+ label: this._translations.selectAll,
497
+ disabled: featuresEmpty,
498
+ isOverflow: false
499
+ }, {
500
+ active: false,
501
+ icon: "compare",
502
+ indicator: false,
503
+ func: () => this._switchSelected(),
504
+ label: this._translations.switchSelected,
505
+ disabled: featuresEmpty,
506
+ isOverflow: false
507
+ }, {
508
+ active: false,
509
+ icon: "refresh",
510
+ indicator: false,
511
+ func: () => this._refresh(),
512
+ label: this._translations.refresh,
513
+ disabled: false,
514
+ isOverflow: false
515
+ },
516
+ this.enableCSV ? {
517
+ active: false,
518
+ icon: "export",
519
+ indicator: false,
520
+ func: () => void this._exportToCSV(),
521
+ label: this._translations.exportCSV,
522
+ disabled: featuresEmpty,
523
+ isOverflow: false
524
+ } : undefined, {
525
+ active: false,
526
+ icon: this._showHideOpen ? "chevron-down" : "chevron-right",
527
+ indicator: false,
528
+ func: () => this._toggleShowHide(),
529
+ label: this._translations.showHideColumns,
530
+ disabled: false,
531
+ isOverflow: false,
532
+ isSublist: true
533
+ }];
534
+ this._defaultVisibleToolSizeInfos = undefined;
535
+ }
529
536
  }
530
537
  /**
531
538
  * Returns true when one ore more features are selected
@@ -736,13 +743,39 @@ export class LayerTable {
736
743
  if ((_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.id) {
737
744
  urlObj.searchParams.set("webmap", this.mapInfo.id);
738
745
  }
746
+ else {
747
+ urlObj.searchParams.delete("webmap");
748
+ }
739
749
  if ((_c = this._layer) === null || _c === void 0 ? void 0 : _c.id) {
740
750
  urlObj.searchParams.set("layer", this._layer.id);
741
751
  }
752
+ else {
753
+ urlObj.searchParams.delete("layer");
754
+ }
742
755
  if (((_d = this._selectedIndexes) === null || _d === void 0 ? void 0 : _d.length) > 0) {
743
756
  urlObj.searchParams.set("oid", this._selectedIndexes.join(","));
744
757
  }
758
+ else {
759
+ urlObj.searchParams.delete("oid");
760
+ }
761
+ if (this._filterActive) {
762
+ const filter = JSON.parse(this._filterList.urlParams.get("filter"));
763
+ const layerExpressions = this._filterList.layerExpressions.map(layerExp => {
764
+ layerExp.expressions = layerExp.expressions.map(exp => {
765
+ if (exp.id.toString() === filter.expressionId.toString()) {
766
+ exp.active = true;
767
+ }
768
+ return exp;
769
+ });
770
+ return layerExp;
771
+ });
772
+ urlObj.searchParams.set("filter", JSON.stringify(layerExpressions));
773
+ }
774
+ else {
775
+ urlObj.searchParams.delete("filter");
776
+ }
745
777
  this._shareNode.shareUrl = urlObj.href;
778
+ history.pushState(history.state, document.title, urlObj.href);
746
779
  }
747
780
  /**
748
781
  * Get a tooltip
@@ -863,7 +896,8 @@ export class LayerTable {
863
896
  const _end = this._table.viewModel.getObjectIdIndex(this._currentId);
864
897
  const startIndex = _start < _end ? _start : _end;
865
898
  const endIndex = _end > _start ? _end : _start;
866
- this._selectedIndexes = oids.reduce((prev, cur) => {
899
+ this._skipOnChange = startIndex + 1 !== endIndex;
900
+ const selectedIndexes = oids.reduce((prev, cur) => {
867
901
  const id = cur;
868
902
  const index = this._table.viewModel.getObjectIdIndex(id);
869
903
  if ((id === this._currentId || id === this._previousCurrentId)) {
@@ -885,6 +919,7 @@ export class LayerTable {
885
919
  }
886
920
  return prev;
887
921
  }, []);
922
+ this._selectedIndexes = _start < _end ? selectedIndexes.reverse() : selectedIndexes;
888
923
  this._table.highlightIds.addMany(this._selectedIndexes.filter(i => ids.indexOf(i) < 0));
889
924
  }
890
925
  }
@@ -947,6 +982,11 @@ export class LayerTable {
947
982
  }
948
983
  this._defaultGlobalIdHonored = true;
949
984
  }
985
+ if (!this._defaultFilterHonored && this.defaultFilter && this._filterList) {
986
+ this._layerExpressions = this.defaultFilter;
987
+ this._filterActive = true;
988
+ this._defaultFilterHonored = true;
989
+ }
950
990
  });
951
991
  this._showOnlySelected = false;
952
992
  this._sortActive = false;
@@ -1055,19 +1095,21 @@ export class LayerTable {
1055
1095
  */
1056
1096
  _filterModal() {
1057
1097
  var _a, _b, _c;
1058
- 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: false, 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 }))));
1098
+ 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 }))));
1059
1099
  }
1060
1100
  /**
1061
1101
  * Reset the filter active prop
1062
1102
  */
1063
1103
  _handleFilterListReset() {
1064
1104
  this._filterActive = false;
1105
+ this._updateShareUrl();
1065
1106
  }
1066
1107
  /**
1067
1108
  * Check if the layers definitionExpression has been modified
1068
1109
  */
1069
1110
  _handleFilterUpdate() {
1070
1111
  this._filterActive = this._definitionExpression !== this._layer.definitionExpression;
1112
+ this._updateShareUrl();
1071
1113
  }
1072
1114
  /**
1073
1115
  * Close the filter modal
@@ -1359,22 +1401,26 @@ export class LayerTable {
1359
1401
  }
1360
1402
  static get properties() {
1361
1403
  return {
1362
- "defaultLayerId": {
1363
- "type": "string",
1404
+ "defaultFilter": {
1405
+ "type": "unknown",
1364
1406
  "mutable": false,
1365
1407
  "complexType": {
1366
- "original": "string",
1367
- "resolved": "string",
1368
- "references": {}
1408
+ "original": "LayerExpression[]",
1409
+ "resolved": "LayerExpression[]",
1410
+ "references": {
1411
+ "LayerExpression": {
1412
+ "location": "import",
1413
+ "path": "@esri/instant-apps-components",
1414
+ "id": ""
1415
+ }
1416
+ }
1369
1417
  },
1370
1418
  "required": false,
1371
1419
  "optional": false,
1372
1420
  "docs": {
1373
1421
  "tags": [],
1374
- "text": "string: when provided this layer ID will be used when the app loads"
1375
- },
1376
- "attribute": "default-layer-id",
1377
- "reflect": false
1422
+ "text": "LayerExpression[]: default layer expression(s) to apply to the current layer"
1423
+ }
1378
1424
  },
1379
1425
  "defaultGlobalId": {
1380
1426
  "type": "unknown",
@@ -1391,6 +1437,23 @@ export class LayerTable {
1391
1437
  "text": "string: Global ID of the feature to select"
1392
1438
  }
1393
1439
  },
1440
+ "defaultLayerId": {
1441
+ "type": "string",
1442
+ "mutable": false,
1443
+ "complexType": {
1444
+ "original": "string",
1445
+ "resolved": "string",
1446
+ "references": {}
1447
+ },
1448
+ "required": false,
1449
+ "optional": false,
1450
+ "docs": {
1451
+ "tags": [],
1452
+ "text": "string: when provided this layer ID will be used when the app loads"
1453
+ },
1454
+ "attribute": "default-layer-id",
1455
+ "reflect": false
1456
+ },
1394
1457
  "defaultOid": {
1395
1458
  "type": "unknown",
1396
1459
  "mutable": false,
@@ -60,6 +60,7 @@ export class PublicNotification {
60
60
  this.sketchPointSymbol = undefined;
61
61
  this.sketchPolygonSymbol = undefined;
62
62
  this._addMap = false;
63
+ this._addResults = true;
63
64
  this._addTitle = false;
64
65
  this._downloadActive = true;
65
66
  this._exportType = EExportType.PDF;
@@ -498,7 +499,7 @@ export class PublicNotification {
498
499
  _getExportPage() {
499
500
  const hasSelections = this._hasSelections(this.showRefineSelection);
500
501
  const displayDuplicatesClass = this._numDuplicates > 0 ? "display-block" : "display-none";
501
- return (h("calcite-panel", null, h("div", null, this._getLabel(this._translations.export, false), hasSelections ? (h("div", null, this._getNotice(this._translations.exportTip, "padding-sides-1"), this._getLabel(this._translations.exportListsLabel), this._getExportSelectionLists(), h("div", { class: "padding-sides-1 " + displayDuplicatesClass }, h("div", { class: "display-flex" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { ref: (el) => { this._removeDuplicates = el; } }), h("div", { class: "display-flex" }, this._translations.removeDuplicate, h("div", { class: "info-message padding-start-1-2" }, h("calcite-input-message", { class: "info-blue margin-top-0", scale: "m" }, ` ${this._translations.numDuplicates.replace("{{n}}", this._numDuplicates.toString())}`)))), h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "remove-duplicates-icon", scale: "s" })), h("calcite-popover", { closable: true, label: "", referenceElement: "remove-duplicates-icon" }, h("span", { class: "tooltip-message" }, this._translations.duplicatesTip))), h("div", { class: "border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-segmented-control", { class: "w-100", onCalciteSegmentedControlChange: (evt) => this._exportTypeChange(evt) }, h("calcite-segmented-control-item", { checked: this._exportType === EExportType.PDF, class: "w-50 end-border", value: EExportType.PDF }, h("span", { class: "font-weight-500" }, this._translations.pdf)), h("calcite-segmented-control-item", { checked: this._exportType === EExportType.CSV, class: "w-50", value: EExportType.CSV }, h("span", { class: "font-weight-500" }, this._translations.csv)))), h("div", { class: "padding-bottom-1" }, this._getExportOptions()), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive || this._fetchingData, loading: this._fetchingData, onClick: () => void this._export(), width: "full" }, h("span", { class: "font-weight-500" }, this._translations.export))))) : (this._getNotice(this._translations.downloadNoLists, "padding-sides-1 padding-bottom-1")))));
502
+ return (h("calcite-panel", null, h("div", null, this._getLabel(this._translations.export, false), hasSelections ? (h("div", null, this._getNotice(this._translations.exportTip, "padding-sides-1"), this._getLabel(this._translations.exportListsLabel), this._getExportSelectionLists(), h("div", { class: "padding-sides-1 " + displayDuplicatesClass }, h("div", { class: "display-flex" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { ref: (el) => { this._removeDuplicates = el; } }), h("div", { class: "display-flex" }, this._translations.removeDuplicate, h("div", { class: "info-message padding-start-1-2" }, h("calcite-input-message", { class: "info-blue margin-top-0", scale: "m" }, ` ${this._translations.numDuplicates.replace("{{n}}", this._numDuplicates.toString())}`)))), h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "remove-duplicates-icon", scale: "s" })), h("calcite-popover", { closable: true, label: "", referenceElement: "remove-duplicates-icon" }, h("span", { class: "tooltip-message" }, this._translations.duplicatesTip))), h("div", { class: "border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-segmented-control", { class: "w-100", onCalciteSegmentedControlChange: (evt) => this._exportTypeChange(evt) }, h("calcite-segmented-control-item", { checked: this._exportType === EExportType.PDF, class: "w-50 end-border", value: EExportType.PDF }, h("span", { class: "font-weight-500" }, this._translations.pdf)), h("calcite-segmented-control-item", { checked: this._exportType === EExportType.CSV, class: "w-50", value: EExportType.CSV }, h("span", { class: "font-weight-500" }, this._translations.csv)))), h("div", { class: "padding-bottom-1" }, this._getExportOptions()), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: (!this._downloadActive || this._fetchingData) || (!this._addMap && !this._addResults), loading: this._fetchingData, onClick: () => void this._export(), width: "full" }, h("span", { class: "font-weight-500" }, this._translations.export))))) : (this._getNotice(this._translations.downloadNoLists, "padding-sides-1 padding-bottom-1")))));
502
503
  }
503
504
  /**
504
505
  * Store the user selected export type CSV || PDF
@@ -517,7 +518,8 @@ export class PublicNotification {
517
518
  const displayClass = this._exportType === EExportType.PDF ? "display-block" : "display-none";
518
519
  const titleOptionsClass = this._addTitle ? "display-block" : "display-none";
519
520
  const title = this._titleValue ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
520
- 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" }, this._translations.selectPDFLabelOption)), h("div", { class: "padding-sides-1" }, 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))));
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))));
521
523
  }
522
524
  /**
523
525
  * Render the refine page
@@ -623,7 +625,8 @@ export class PublicNotification {
623
625
  * @protected
624
626
  */
625
627
  async _export() {
626
- const exportInfos = this._getSelectionIdsAndViews(this._selectionSets, true);
628
+ const exportInfos = this._addResults ?
629
+ this._getSelectionIdsAndViews(this._selectionSets, true) : {};
627
630
  if (this._exportType === EExportType.PDF) {
628
631
  // Generate a map screenshot
629
632
  let initialImageDataUrl = "";
@@ -1226,6 +1229,7 @@ export class PublicNotification {
1226
1229
  static get states() {
1227
1230
  return {
1228
1231
  "_addMap": {},
1232
+ "_addResults": {},
1229
1233
  "_addTitle": {},
1230
1234
  "_downloadActive": {},
1231
1235
  "_exportType": {},
@@ -74,8 +74,10 @@ function downloadPDFFile(filename, labels, labelPageDescription, title = "", ini
74
74
  if (title) {
75
75
  labeller.drawSupplementalText(title, 0, -0.1);
76
76
  }
77
- pdfLib.addPage();
78
- ++startingPageNum;
77
+ if (labels.length > 0) {
78
+ pdfLib.addPage();
79
+ ++startingPageNum;
80
+ }
79
81
  }
80
82
  // Add the labels to the PDF
81
83
  await labeller.addLabelsToDoc(labels, labelSpec, startingPageNum, title // heading
@@ -98,8 +98,10 @@ function downloadPDFFile(
98
98
  labeller.drawSupplementalText(title, 0, -0.1);
99
99
  }
100
100
 
101
- pdfLib.addPage();
102
- ++startingPageNum;
101
+ if (labels.length > 0) {
102
+ pdfLib.addPage();
103
+ ++startingPageNum;
104
+ }
103
105
  }
104
106
 
105
107
  // Add the labels to the PDF
@@ -75,6 +75,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
75
75
  */
76
76
  this._shouldSetMapView = false;
77
77
  this.defaultCenter = "";
78
+ this.defaultFilter = "";
78
79
  this.defaultGlobalId = "";
79
80
  this.defaultLayer = "";
80
81
  this.defaultLevel = "";
@@ -125,6 +126,12 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
125
126
  this._defaultCenter = !this.defaultCenter ? undefined :
126
127
  this.defaultCenter.split(";").map(v => parseFloat(v));
127
128
  }
129
+ /**
130
+ * Watch for filter url param to be set
131
+ */
132
+ defaultFilterWatchHandler() {
133
+ this._defaultFilter = JSON.parse(this.defaultFilter);
134
+ }
128
135
  /**
129
136
  * Watch for globalid url param to be set
130
137
  */
@@ -151,13 +158,6 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
151
158
  enableZoomWatchHandler() {
152
159
  this._initMapZoom();
153
160
  }
154
- /**
155
- * Show the map, popup, and table if the user switches out of mobile mode
156
- */
157
- async _isMobileWatchHandler() {
158
- const show = !this._isMobile ? false : this._numSelected > 0;
159
- this.showHideMapPopupAndTable(show);
160
- }
161
161
  //--------------------------------------------------------------------------
162
162
  //
163
163
  // Methods (public)
@@ -436,7 +436,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
436
436
  const toggleLayout = layoutMode === ELayoutMode.HORIZONTAL ? "horizontal" : "vertical";
437
437
  const toggleSlot = layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
438
438
  const hasMapAndLayer = this.defaultWebmap && this.defaultLayer;
439
- return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
439
+ return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultFilter: hasMapAndLayer ? this._defaultFilter : undefined, defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
440
440
  }
441
441
  /**
442
442
  * Update the component layout when its size changes
@@ -528,15 +528,16 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
528
528
  get el() { return this; }
529
529
  static get watchers() { return {
530
530
  "defaultCenter": ["defaultCenterWatchHandler"],
531
+ "defaultFilter": ["defaultFilterWatchHandler"],
531
532
  "defaultGlobalId": ["defaultGlobalIdWatchHandler"],
532
533
  "defaultOid": ["defaultOidWatchHandler"],
533
534
  "defaultLevel": ["defaultLevelWatchHandler"],
534
- "enableZoom": ["enableZoomWatchHandler"],
535
- "_isMobile": ["_isMobileWatchHandler"]
535
+ "enableZoom": ["enableZoomWatchHandler"]
536
536
  }; }
537
537
  static get style() { return crowdsourceManagerCss; }
538
538
  }, [0, "crowdsource-manager", {
539
539
  "defaultCenter": [1, "default-center"],
540
+ "defaultFilter": [1, "default-filter"],
540
541
  "defaultGlobalId": [1, "default-global-id"],
541
542
  "defaultLayer": [1, "default-layer"],
542
543
  "defaultLevel": [1, "default-level"],
@@ -576,11 +577,11 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
576
577
  "_tableOnly": [32]
577
578
  }, [[8, "featureSelectionChange", "featureSelectionChange"], [8, "popupClosed", "popupClosed"], [8, "idsFound", "idsFound"], [8, "layoutChanged", "layoutChanged"], [8, "mapChanged", "mapChanged"], [8, "beforeMapChanged", "beforeMapChanged"]], {
578
579
  "defaultCenter": ["defaultCenterWatchHandler"],
580
+ "defaultFilter": ["defaultFilterWatchHandler"],
579
581
  "defaultGlobalId": ["defaultGlobalIdWatchHandler"],
580
582
  "defaultOid": ["defaultOidWatchHandler"],
581
583
  "defaultLevel": ["defaultLevelWatchHandler"],
582
- "enableZoom": ["enableZoomWatchHandler"],
583
- "_isMobile": ["_isMobileWatchHandler"]
584
+ "enableZoom": ["enableZoomWatchHandler"]
584
585
  }]);
585
586
  function defineCustomElement$1() {
586
587
  if (typeof customElements === "undefined") {
@@ -2231,8 +2231,10 @@ function downloadPDFFile(filename, labels, labelPageDescription, title = "", ini
2231
2231
  if (title) {
2232
2232
  labeller.drawSupplementalText(title, 0, -0.1);
2233
2233
  }
2234
- pdfLib.addPage();
2235
- ++startingPageNum;
2234
+ if (labels.length > 0) {
2235
+ pdfLib.addPage();
2236
+ ++startingPageNum;
2237
+ }
2236
2238
  }
2237
2239
  // Add the labels to the PDF
2238
2240
  await labeller.addLabelsToDoc(labels, labelSpec, startingPageNum, title // heading