@esri/solutions-components 0.7.21 → 0.7.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -530,93 +530,95 @@ const LayerTable = class {
530
530
  const featuresSelected = this._featuresSelected();
531
531
  const featuresEmpty = this._featuresEmpty();
532
532
  const hasFilterExpressions = this._hasFilterExpressions();
533
- this._toolInfos = [{
534
- active: false,
535
- icon: "zoom-to-object",
536
- indicator: false,
537
- label: this._translations.zoom,
538
- func: () => this._zoom(),
539
- disabled: !featuresSelected,
540
- isOverflow: false
541
- },
542
- hasFilterExpressions ? {
543
- active: false,
544
- icon: "filter",
545
- indicator: false,
546
- label: this._translations.filters,
547
- func: () => this._toggleFilter(),
548
- disabled: false,
549
- isOverflow: false
550
- } : undefined,
551
- this._deleteEnabled ? {
552
- active: false,
553
- icon: "trash",
554
- indicator: false,
555
- label: this._translations.delete,
556
- func: () => this._delete(),
557
- disabled: !featuresSelected,
558
- isDanger: true,
559
- isOverflow: false
560
- } : undefined, {
561
- active: false,
562
- icon: "erase",
563
- indicator: false,
564
- label: this._translations.clearSelection,
565
- func: () => this._clearSelection(),
566
- disabled: !featuresSelected,
567
- isOverflow: false
568
- }, {
569
- active: false,
570
- icon: "selected-items-filter",
571
- indicator: false,
572
- label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
573
- func: () => this._toggleShowSelected(),
574
- disabled: !featuresSelected,
575
- isOverflow: false
576
- }, {
577
- active: false,
578
- icon: "list-check-all",
579
- indicator: false,
580
- func: () => this._selectAll(),
581
- label: this._translations.selectAll,
582
- disabled: featuresEmpty,
583
- isOverflow: false
584
- }, {
585
- active: false,
586
- icon: "compare",
587
- indicator: false,
588
- func: () => this._switchSelected(),
589
- label: this._translations.switchSelected,
590
- disabled: featuresEmpty,
591
- isOverflow: false
592
- }, {
593
- active: false,
594
- icon: "refresh",
595
- indicator: false,
596
- func: () => this._refresh(),
597
- label: this._translations.refresh,
598
- disabled: false,
599
- isOverflow: false
600
- },
601
- this.enableCSV ? {
602
- active: false,
603
- icon: "export",
604
- indicator: false,
605
- func: () => void this._exportToCSV(),
606
- label: this._translations.exportCSV,
607
- disabled: featuresEmpty,
608
- isOverflow: false
609
- } : undefined, {
610
- active: false,
611
- icon: this._showHideOpen ? "chevron-down" : "chevron-right",
612
- indicator: false,
613
- func: () => this._toggleShowHide(),
614
- label: this._translations.showHideColumns,
615
- disabled: false,
616
- isOverflow: false,
617
- isSublist: true
618
- }];
619
- this._defaultVisibleToolSizeInfos = undefined;
533
+ if (this._translations) {
534
+ this._toolInfos = [{
535
+ active: false,
536
+ icon: "zoom-to-object",
537
+ indicator: false,
538
+ label: this._translations.zoom,
539
+ func: () => this._zoom(),
540
+ disabled: !featuresSelected,
541
+ isOverflow: false
542
+ },
543
+ hasFilterExpressions ? {
544
+ active: false,
545
+ icon: "filter",
546
+ indicator: false,
547
+ label: this._translations.filters,
548
+ func: () => this._toggleFilter(),
549
+ disabled: false,
550
+ isOverflow: false
551
+ } : undefined,
552
+ this._deleteEnabled ? {
553
+ active: false,
554
+ icon: "trash",
555
+ indicator: false,
556
+ label: this._translations.delete,
557
+ func: () => this._delete(),
558
+ disabled: !featuresSelected,
559
+ isDanger: true,
560
+ isOverflow: false
561
+ } : undefined, {
562
+ active: false,
563
+ icon: "erase",
564
+ indicator: false,
565
+ label: this._translations.clearSelection,
566
+ func: () => this._clearSelection(),
567
+ disabled: !featuresSelected,
568
+ isOverflow: false
569
+ }, {
570
+ active: false,
571
+ icon: "selected-items-filter",
572
+ indicator: false,
573
+ label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
574
+ func: () => this._toggleShowSelected(),
575
+ disabled: !featuresSelected,
576
+ isOverflow: false
577
+ }, {
578
+ active: false,
579
+ icon: "list-check-all",
580
+ indicator: false,
581
+ func: () => this._selectAll(),
582
+ label: this._translations.selectAll,
583
+ disabled: featuresEmpty,
584
+ isOverflow: false
585
+ }, {
586
+ active: false,
587
+ icon: "compare",
588
+ indicator: false,
589
+ func: () => this._switchSelected(),
590
+ label: this._translations.switchSelected,
591
+ disabled: featuresEmpty,
592
+ isOverflow: false
593
+ }, {
594
+ active: false,
595
+ icon: "refresh",
596
+ indicator: false,
597
+ func: () => this._refresh(),
598
+ label: this._translations.refresh,
599
+ disabled: false,
600
+ isOverflow: false
601
+ },
602
+ this.enableCSV ? {
603
+ active: false,
604
+ icon: "export",
605
+ indicator: false,
606
+ func: () => void this._exportToCSV(),
607
+ label: this._translations.exportCSV,
608
+ disabled: featuresEmpty,
609
+ isOverflow: false
610
+ } : undefined, {
611
+ active: false,
612
+ icon: this._showHideOpen ? "chevron-down" : "chevron-right",
613
+ indicator: false,
614
+ func: () => this._toggleShowHide(),
615
+ label: this._translations.showHideColumns,
616
+ disabled: false,
617
+ isOverflow: false,
618
+ isSublist: true
619
+ }];
620
+ this._defaultVisibleToolSizeInfos = undefined;
621
+ }
620
622
  }
621
623
  /**
622
624
  * Returns true when one ore more features are selected
@@ -827,12 +829,21 @@ const LayerTable = class {
827
829
  if ((_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.id) {
828
830
  urlObj.searchParams.set("webmap", this.mapInfo.id);
829
831
  }
832
+ else {
833
+ urlObj.searchParams.delete("webmap");
834
+ }
830
835
  if ((_c = this._layer) === null || _c === void 0 ? void 0 : _c.id) {
831
836
  urlObj.searchParams.set("layer", this._layer.id);
832
837
  }
838
+ else {
839
+ urlObj.searchParams.delete("layer");
840
+ }
833
841
  if (((_d = this._selectedIndexes) === null || _d === void 0 ? void 0 : _d.length) > 0) {
834
842
  urlObj.searchParams.set("oid", this._selectedIndexes.join(","));
835
843
  }
844
+ else {
845
+ urlObj.searchParams.delete("oid");
846
+ }
836
847
  if (this._filterActive) {
837
848
  const filter = JSON.parse(this._filterList.urlParams.get("filter"));
838
849
  const layerExpressions = this._filterList.layerExpressions.map(layerExp => {
@@ -846,7 +857,11 @@ const LayerTable = class {
846
857
  });
847
858
  urlObj.searchParams.set("filter", JSON.stringify(layerExpressions));
848
859
  }
860
+ else {
861
+ urlObj.searchParams.delete("filter");
862
+ }
849
863
  this._shareNode.shareUrl = urlObj.href;
864
+ history.pushState(history.state, document.title, urlObj.href);
850
865
  }
851
866
  /**
852
867
  * Get a tooltip
@@ -1166,7 +1181,7 @@ const LayerTable = class {
1166
1181
  */
1167
1182
  _filterModal() {
1168
1183
  var _a, _b, _c;
1169
- return (index.h("calcite-modal", { "aria-labelledby": "modal-title", class: "modal", kind: "brand", onCalciteModalClose: async () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, index.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)), index.h("div", { slot: "content" }, index.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 }))));
1184
+ return (index.h("calcite-modal", { "aria-labelledby": "modal-title", class: "modal", kind: "brand", onCalciteModalClose: async () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, index.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)), index.h("div", { slot: "content" }, index.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 }))));
1170
1185
  }
1171
1186
  /**
1172
1187
  * Reset the filter active prop
@@ -444,93 +444,95 @@ export class LayerTable {
444
444
  const featuresSelected = this._featuresSelected();
445
445
  const featuresEmpty = this._featuresEmpty();
446
446
  const hasFilterExpressions = this._hasFilterExpressions();
447
- this._toolInfos = [{
448
- active: false,
449
- icon: "zoom-to-object",
450
- indicator: false,
451
- label: this._translations.zoom,
452
- func: () => this._zoom(),
453
- disabled: !featuresSelected,
454
- isOverflow: false
455
- },
456
- hasFilterExpressions ? {
457
- active: false,
458
- icon: "filter",
459
- indicator: false,
460
- label: this._translations.filters,
461
- func: () => this._toggleFilter(),
462
- disabled: false,
463
- isOverflow: false
464
- } : undefined,
465
- this._deleteEnabled ? {
466
- active: false,
467
- icon: "trash",
468
- indicator: false,
469
- label: this._translations.delete,
470
- func: () => this._delete(),
471
- disabled: !featuresSelected,
472
- isDanger: true,
473
- isOverflow: false
474
- } : undefined, {
475
- active: false,
476
- icon: "erase",
477
- indicator: false,
478
- label: this._translations.clearSelection,
479
- func: () => this._clearSelection(),
480
- disabled: !featuresSelected,
481
- isOverflow: false
482
- }, {
483
- active: false,
484
- icon: "selected-items-filter",
485
- indicator: false,
486
- label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
487
- func: () => this._toggleShowSelected(),
488
- disabled: !featuresSelected,
489
- isOverflow: false
490
- }, {
491
- active: false,
492
- icon: "list-check-all",
493
- indicator: false,
494
- func: () => this._selectAll(),
495
- label: this._translations.selectAll,
496
- disabled: featuresEmpty,
497
- isOverflow: false
498
- }, {
499
- active: false,
500
- icon: "compare",
501
- indicator: false,
502
- func: () => this._switchSelected(),
503
- label: this._translations.switchSelected,
504
- disabled: featuresEmpty,
505
- isOverflow: false
506
- }, {
507
- active: false,
508
- icon: "refresh",
509
- indicator: false,
510
- func: () => this._refresh(),
511
- label: this._translations.refresh,
512
- disabled: false,
513
- isOverflow: false
514
- },
515
- this.enableCSV ? {
516
- active: false,
517
- icon: "export",
518
- indicator: false,
519
- func: () => void this._exportToCSV(),
520
- label: this._translations.exportCSV,
521
- disabled: featuresEmpty,
522
- isOverflow: false
523
- } : undefined, {
524
- active: false,
525
- icon: this._showHideOpen ? "chevron-down" : "chevron-right",
526
- indicator: false,
527
- func: () => this._toggleShowHide(),
528
- label: this._translations.showHideColumns,
529
- disabled: false,
530
- isOverflow: false,
531
- isSublist: true
532
- }];
533
- 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
+ }
534
536
  }
535
537
  /**
536
538
  * Returns true when one ore more features are selected
@@ -741,12 +743,21 @@ export class LayerTable {
741
743
  if ((_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.id) {
742
744
  urlObj.searchParams.set("webmap", this.mapInfo.id);
743
745
  }
746
+ else {
747
+ urlObj.searchParams.delete("webmap");
748
+ }
744
749
  if ((_c = this._layer) === null || _c === void 0 ? void 0 : _c.id) {
745
750
  urlObj.searchParams.set("layer", this._layer.id);
746
751
  }
752
+ else {
753
+ urlObj.searchParams.delete("layer");
754
+ }
747
755
  if (((_d = this._selectedIndexes) === null || _d === void 0 ? void 0 : _d.length) > 0) {
748
756
  urlObj.searchParams.set("oid", this._selectedIndexes.join(","));
749
757
  }
758
+ else {
759
+ urlObj.searchParams.delete("oid");
760
+ }
750
761
  if (this._filterActive) {
751
762
  const filter = JSON.parse(this._filterList.urlParams.get("filter"));
752
763
  const layerExpressions = this._filterList.layerExpressions.map(layerExp => {
@@ -760,7 +771,11 @@ export class LayerTable {
760
771
  });
761
772
  urlObj.searchParams.set("filter", JSON.stringify(layerExpressions));
762
773
  }
774
+ else {
775
+ urlObj.searchParams.delete("filter");
776
+ }
763
777
  this._shareNode.shareUrl = urlObj.href;
778
+ history.pushState(history.state, document.title, urlObj.href);
764
779
  }
765
780
  /**
766
781
  * Get a tooltip
@@ -1080,7 +1095,7 @@ export class LayerTable {
1080
1095
  */
1081
1096
  _filterModal() {
1082
1097
  var _a, _b, _c;
1083
- 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 }))));
1084
1099
  }
1085
1100
  /**
1086
1101
  * Reset the filter active prop