@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.
Files changed (37) hide show
  1. package/dist/assets/t9n/public-notification/resources.json +2 -3
  2. package/dist/assets/t9n/public-notification/resources_en.json +2 -3
  3. package/dist/cjs/basemap-gallery_7.cjs.entry.js +11 -12
  4. package/dist/cjs/calcite-alert_3.cjs.entry.js +23 -13
  5. package/dist/cjs/card-manager_3.cjs.entry.js +124 -91
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  8. package/dist/cjs/solutions-components.cjs.js +1 -1
  9. package/dist/collection/components/edit-card/edit-card.js +23 -13
  10. package/dist/collection/components/floor-filter/floor-filter.js +28 -12
  11. package/dist/collection/components/layer-table/layer-table.js +130 -91
  12. package/dist/collection/components/public-notification/public-notification.js +1 -1
  13. package/dist/collection/demos/crowdsource-manager.html +13 -0
  14. package/dist/components/edit-card2.js +23 -13
  15. package/dist/components/floor-filter2.js +12 -13
  16. package/dist/components/layer-table2.js +125 -92
  17. package/dist/components/public-notification.js +1 -1
  18. package/dist/esm/basemap-gallery_7.entry.js +11 -12
  19. package/dist/esm/calcite-alert_3.entry.js +23 -13
  20. package/dist/esm/card-manager_3.entry.js +124 -91
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/public-notification.entry.js +1 -1
  23. package/dist/esm/solutions-components.js +1 -1
  24. package/dist/solutions-components/demos/crowdsource-manager.html +13 -0
  25. package/dist/solutions-components/p-04f05bc5.entry.js +6 -0
  26. package/dist/solutions-components/{p-d3085b7a.entry.js → p-bacc9b0d.entry.js} +1 -1
  27. package/dist/solutions-components/{p-a40a1eab.entry.js → p-c634d047.entry.js} +1 -1
  28. package/dist/solutions-components/p-eff7f407.entry.js +6 -0
  29. package/dist/solutions-components/solutions-components.esm.js +1 -1
  30. package/dist/types/components/edit-card/edit-card.d.ts +2 -1
  31. package/dist/types/components/floor-filter/floor-filter.d.ts +13 -0
  32. package/dist/types/components/layer-table/layer-table.d.ts +19 -3
  33. package/dist/types/components.d.ts +19 -0
  34. package/dist/types/preact.d.ts +3 -1
  35. package/package.json +2 -2
  36. package/dist/solutions-components/p-5302f406.entry.js +0 -6
  37. package/dist/solutions-components/p-704da348.entry.js +0 -6
@@ -259,8 +259,11 @@ const LayerTable = class {
259
259
  * watch for changes in layer view and verify if it has editing enabled
260
260
  */
261
261
  async _layerWatchHandler() {
262
+ var _a, _b;
262
263
  this._fetchingData = true;
263
264
  this._definitionExpression = this._layer.definitionExpression;
265
+ this._floorField = (_b = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.floorInfo) === null || _b === void 0 ? void 0 : _b.floorField;
266
+ this._updateFloorDefinitionExpression();
264
267
  await this._resetTable();
265
268
  this._updateShareUrl();
266
269
  this._initLayerExpressions();
@@ -324,14 +327,19 @@ const LayerTable = class {
324
327
  }
325
328
  /**
326
329
  * Refresh the table when edits are completed
327
- *
328
330
  */
329
331
  async editsComplete() {
330
332
  await this._refresh();
331
333
  }
332
334
  /**
333
- * Refresh the table when edits are completed
334
- *
335
+ * Refresh the table when floor filter level is changed
336
+ */
337
+ async levelChanged(evt) {
338
+ this._floorLevel = evt.detail;
339
+ this._updateFloorDefinitionExpression();
340
+ }
341
+ /**
342
+ * Refresh the table when
335
343
  */
336
344
  noLayersFound() {
337
345
  this._layer = undefined;
@@ -526,93 +534,105 @@ const LayerTable = class {
526
534
  const featuresSelected = this._featuresSelected();
527
535
  const featuresEmpty = this._featuresEmpty();
528
536
  const hasFilterExpressions = this._hasFilterExpressions();
529
- this._toolInfos = [{
530
- active: false,
531
- icon: "zoom-to-object",
532
- indicator: false,
533
- label: this._translations.zoom,
534
- func: () => this._zoom(),
535
- disabled: !featuresSelected,
536
- isOverflow: false
537
- },
538
- hasFilterExpressions ? {
539
- active: false,
540
- icon: "filter",
541
- indicator: false,
542
- label: this._translations.filters,
543
- func: () => this._toggleFilter(),
544
- disabled: false,
545
- isOverflow: false
546
- } : undefined,
547
- this._deleteEnabled ? {
548
- active: false,
549
- icon: "trash",
550
- indicator: false,
551
- label: this._translations.delete,
552
- func: () => this._delete(),
553
- disabled: !featuresSelected,
554
- isDanger: true,
555
- isOverflow: false
556
- } : undefined, {
557
- active: false,
558
- icon: "erase",
559
- indicator: false,
560
- label: this._translations.clearSelection,
561
- func: () => this._clearSelection(),
562
- disabled: !featuresSelected,
563
- isOverflow: false
564
- }, {
565
- active: false,
566
- icon: "selected-items-filter",
567
- indicator: false,
568
- label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
569
- func: () => this._toggleShowSelected(),
570
- disabled: !featuresSelected,
571
- isOverflow: false
572
- }, {
573
- active: false,
574
- icon: "list-check-all",
575
- indicator: false,
576
- func: () => this._selectAll(),
577
- label: this._translations.selectAll,
578
- disabled: featuresEmpty,
579
- isOverflow: false
580
- }, {
581
- active: false,
582
- icon: "compare",
583
- indicator: false,
584
- func: () => this._switchSelected(),
585
- label: this._translations.switchSelected,
586
- disabled: featuresEmpty,
587
- isOverflow: false
588
- }, {
589
- active: false,
590
- icon: "refresh",
591
- indicator: false,
592
- func: () => this._refresh(),
593
- label: this._translations.refresh,
594
- disabled: false,
595
- isOverflow: false
596
- },
597
- this.enableCSV ? {
598
- active: false,
599
- icon: "export",
600
- indicator: false,
601
- func: () => void this._exportToCSV(),
602
- label: this._translations.exportCSV,
603
- disabled: featuresEmpty,
604
- isOverflow: false
605
- } : undefined, {
606
- active: false,
607
- icon: this._showHideOpen ? "chevron-down" : "chevron-right",
608
- indicator: false,
609
- func: () => this._toggleShowHide(),
610
- label: this._translations.showHideColumns,
611
- disabled: false,
612
- isOverflow: false,
613
- isSublist: true
614
- }];
615
- this._defaultVisibleToolSizeInfos = undefined;
537
+ if (this._translations) {
538
+ this._toolInfos = [{
539
+ active: false,
540
+ icon: "zoom-to-object",
541
+ indicator: false,
542
+ label: this._translations.zoom,
543
+ func: () => this._zoom(),
544
+ disabled: !featuresSelected,
545
+ isOverflow: false
546
+ },
547
+ hasFilterExpressions ? {
548
+ active: false,
549
+ icon: "filter",
550
+ indicator: false,
551
+ label: this._translations.filters,
552
+ func: () => this._toggleFilter(),
553
+ disabled: false,
554
+ isOverflow: false
555
+ } : undefined,
556
+ this._deleteEnabled ? {
557
+ active: false,
558
+ icon: "trash",
559
+ indicator: false,
560
+ label: this._translations.delete,
561
+ func: () => this._delete(),
562
+ disabled: !featuresSelected,
563
+ isDanger: true,
564
+ isOverflow: false
565
+ } : undefined, {
566
+ active: false,
567
+ icon: "erase",
568
+ indicator: false,
569
+ label: this._translations.clearSelection,
570
+ func: () => this._clearSelection(),
571
+ disabled: !featuresSelected,
572
+ isOverflow: false
573
+ }, {
574
+ active: false,
575
+ icon: "selected-items-filter",
576
+ indicator: false,
577
+ label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
578
+ func: () => this._toggleShowSelected(),
579
+ disabled: !featuresSelected,
580
+ isOverflow: false
581
+ }, {
582
+ active: false,
583
+ icon: "list-check-all",
584
+ indicator: false,
585
+ func: () => this._selectAll(),
586
+ label: this._translations.selectAll,
587
+ disabled: featuresEmpty,
588
+ isOverflow: false
589
+ }, {
590
+ active: false,
591
+ icon: "compare",
592
+ indicator: false,
593
+ func: () => this._switchSelected(),
594
+ label: this._translations.switchSelected,
595
+ disabled: featuresEmpty,
596
+ isOverflow: false
597
+ }, {
598
+ active: false,
599
+ icon: "refresh",
600
+ indicator: false,
601
+ func: () => this._refresh(),
602
+ label: this._translations.refresh,
603
+ disabled: false,
604
+ isOverflow: false
605
+ },
606
+ this.enableCSV ? {
607
+ active: false,
608
+ icon: "export",
609
+ indicator: false,
610
+ func: () => void this._exportToCSV(),
611
+ label: this._translations.exportCSV,
612
+ disabled: featuresEmpty,
613
+ isOverflow: false
614
+ } : undefined, {
615
+ active: false,
616
+ icon: this._showHideOpen ? "chevron-down" : "chevron-right",
617
+ indicator: false,
618
+ func: () => this._toggleShowHide(),
619
+ label: this._translations.showHideColumns,
620
+ disabled: false,
621
+ isOverflow: false,
622
+ isSublist: true
623
+ }];
624
+ this._defaultVisibleToolSizeInfos = undefined;
625
+ }
626
+ }
627
+ /**
628
+ * Applies a definition expression when floor field and level are available
629
+ *
630
+ * @returns boolean
631
+ */
632
+ _updateFloorDefinitionExpression() {
633
+ if (this._floorField && this._floorLevel) {
634
+ this._layer.definitionExpression = `${this._floorField} = '${this._floorLevel}'`;
635
+ }
616
636
  }
617
637
  /**
618
638
  * Returns true when one ore more features are selected
@@ -823,12 +843,21 @@ const LayerTable = class {
823
843
  if ((_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.id) {
824
844
  urlObj.searchParams.set("webmap", this.mapInfo.id);
825
845
  }
846
+ else {
847
+ urlObj.searchParams.delete("webmap");
848
+ }
826
849
  if ((_c = this._layer) === null || _c === void 0 ? void 0 : _c.id) {
827
850
  urlObj.searchParams.set("layer", this._layer.id);
828
851
  }
852
+ else {
853
+ urlObj.searchParams.delete("layer");
854
+ }
829
855
  if (((_d = this._selectedIndexes) === null || _d === void 0 ? void 0 : _d.length) > 0) {
830
856
  urlObj.searchParams.set("oid", this._selectedIndexes.join(","));
831
857
  }
858
+ else {
859
+ urlObj.searchParams.delete("oid");
860
+ }
832
861
  if (this._filterActive) {
833
862
  const filter = JSON.parse(this._filterList.urlParams.get("filter"));
834
863
  const layerExpressions = this._filterList.layerExpressions.map(layerExp => {
@@ -842,7 +871,11 @@ const LayerTable = class {
842
871
  });
843
872
  urlObj.searchParams.set("filter", JSON.stringify(layerExpressions));
844
873
  }
874
+ else {
875
+ urlObj.searchParams.delete("filter");
876
+ }
845
877
  this._shareNode.shareUrl = urlObj.href;
878
+ history.pushState(history.state, document.title, urlObj.href);
846
879
  }
847
880
  /**
848
881
  * Get a tooltip
@@ -1162,7 +1195,7 @@ const LayerTable = class {
1162
1195
  */
1163
1196
  _filterModal() {
1164
1197
  var _a, _b, _c;
1165
- 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 }))));
1198
+ 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 }))));
1166
1199
  }
1167
1200
  /**
1168
1201
  * Reset the filter active prop