@esri/solutions-components 0.6.13 → 0.6.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/dist/assets/t9n/layer-table/resources.json +1 -1
  2. package/dist/assets/t9n/layer-table/resources_en.json +1 -1
  3. package/dist/assets/t9n/map-layer-picker/resources.json +4 -0
  4. package/dist/assets/t9n/map-layer-picker/resources_en.json +4 -0
  5. package/dist/cjs/basemap-gallery_6.cjs.entry.js +20 -5
  6. package/dist/cjs/buffer-tools_4.cjs.entry.js +1 -1
  7. package/dist/cjs/calcite-chip_3.cjs.entry.js +803 -0
  8. package/dist/cjs/calcite-combobox_6.cjs.entry.js +76 -28
  9. package/dist/cjs/card-manager_3.cjs.entry.js +112 -54
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +18 -5
  11. package/dist/cjs/{downloadUtils-fb4744e0.js → downloadUtils-34a515ad.js} +2 -2
  12. package/dist/cjs/edit-card_2.cjs.entry.js +5 -0
  13. package/dist/cjs/{index.es-372e33de.js → index.es-0ba11065.js} +2 -2
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  16. package/dist/cjs/{mapViewUtils-a4dd36ec.js → mapViewUtils-a2884698.js} +39 -55
  17. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  18. package/dist/cjs/{publicNotificationStore-b69862af.js → publicNotificationStore-610bd880.js} +0 -4
  19. package/dist/cjs/solutions-components.cjs.js +1 -1
  20. package/dist/collection/components/basemap-gallery/basemap-gallery.js +23 -1
  21. package/dist/collection/components/card-manager/card-manager.js +2 -2
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +171 -5
  23. package/dist/collection/components/edit-card/edit-card.js +19 -0
  24. package/dist/collection/components/layer-table/layer-table.js +127 -47
  25. package/dist/collection/components/map-card/map-card.js +115 -5
  26. package/dist/collection/components/map-layer-picker/map-layer-picker.css +4 -0
  27. package/dist/collection/components/map-layer-picker/map-layer-picker.js +107 -27
  28. package/dist/collection/components/map-picker/map-picker.css +5 -1
  29. package/dist/collection/components/map-picker/map-picker.js +3 -3
  30. package/dist/collection/components/map-tools/map-tools.js +104 -1
  31. package/dist/collection/utils/interfaces.ts +12 -1
  32. package/dist/collection/utils/mapViewUtils.js +38 -52
  33. package/dist/collection/utils/mapViewUtils.ts +41 -57
  34. package/dist/collection/utils/publicNotificationStore.js +0 -4
  35. package/dist/collection/utils/publicNotificationStore.ts +0 -4
  36. package/dist/components/basemap-gallery2.js +2 -0
  37. package/dist/components/card-manager2.js +2 -2
  38. package/dist/components/crowdsource-manager.js +27 -6
  39. package/dist/components/edit-card2.js +5 -0
  40. package/dist/components/layer-table2.js +136 -78
  41. package/dist/components/map-card2.js +17 -5
  42. package/dist/components/map-layer-picker2.js +114 -52
  43. package/dist/components/map-picker2.js +4 -4
  44. package/dist/components/map-select-tools2.js +55 -43
  45. package/dist/components/map-tools2.js +20 -1
  46. package/dist/components/mapViewUtils.js +39 -53
  47. package/dist/components/public-notification.js +1 -1
  48. package/dist/components/publicNotificationStore.js +0 -4
  49. package/dist/components/refine-selection2.js +61 -49
  50. package/dist/esm/basemap-gallery_6.entry.js +20 -5
  51. package/dist/esm/buffer-tools_4.entry.js +1 -1
  52. package/dist/esm/calcite-chip_3.entry.js +797 -0
  53. package/dist/esm/calcite-combobox_6.entry.js +76 -28
  54. package/dist/esm/card-manager_3.entry.js +112 -54
  55. package/dist/esm/crowdsource-manager.entry.js +18 -5
  56. package/dist/esm/{downloadUtils-67c7a6c8.js → downloadUtils-ac67a786.js} +2 -2
  57. package/dist/esm/edit-card_2.entry.js +5 -0
  58. package/dist/esm/{index.es-59a67d3d.js → index.es-f553598f.js} +2 -2
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/esm/map-select-tools_3.entry.js +3 -3
  61. package/dist/esm/{mapViewUtils-00a04d52.js → mapViewUtils-8141d8c1.js} +39 -53
  62. package/dist/esm/public-notification.entry.js +3 -3
  63. package/dist/esm/{publicNotificationStore-90a6a274.js → publicNotificationStore-dcf39a55.js} +0 -4
  64. package/dist/esm/solutions-components.js +1 -1
  65. package/dist/solutions-components/p-08b52ed8.entry.js +6 -0
  66. package/dist/solutions-components/p-16362eb4.js +36 -0
  67. package/dist/solutions-components/{p-3691a072.js → p-1ab414e0.js} +2 -2
  68. package/dist/solutions-components/{p-73ab9d9a.entry.js → p-3d7aa1b2.entry.js} +1 -1
  69. package/dist/solutions-components/{p-9a8c51bf.entry.js → p-57cf6784.entry.js} +1 -1
  70. package/dist/solutions-components/p-64b22d57.entry.js +6 -0
  71. package/dist/solutions-components/p-654dd5df.entry.js +6 -0
  72. package/dist/solutions-components/{p-f9166fcb.js → p-a26711e8.js} +1 -1
  73. package/dist/solutions-components/p-b1c8c6d7.entry.js +6 -0
  74. package/dist/solutions-components/{p-b892e595.entry.js → p-b9d29f30.entry.js} +1 -1
  75. package/dist/solutions-components/{p-1b41181b.js → p-c8d0ce92.js} +2 -2
  76. package/dist/solutions-components/{p-0219a1a9.entry.js → p-e76949eb.entry.js} +6 -6
  77. package/dist/solutions-components/p-ee7e2f00.entry.js +34 -0
  78. package/dist/solutions-components/solutions-components.esm.js +1 -1
  79. package/dist/solutions-components/utils/interfaces.ts +12 -1
  80. package/dist/solutions-components/utils/mapViewUtils.ts +41 -57
  81. package/dist/solutions-components/utils/publicNotificationStore.ts +0 -4
  82. package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +5 -0
  83. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +37 -1
  84. package/dist/types/components/edit-card/edit-card.d.ts +8 -0
  85. package/dist/types/components/layer-table/layer-table.d.ts +40 -0
  86. package/dist/types/components/map-card/map-card.d.ts +25 -1
  87. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +50 -3
  88. package/dist/types/components/map-picker/map-picker.d.ts +2 -2
  89. package/dist/types/components/map-tools/map-tools.d.ts +21 -1
  90. package/dist/types/components.d.ts +182 -2
  91. package/dist/types/preact.d.ts +6 -3
  92. package/dist/types/utils/interfaces.d.ts +10 -1
  93. package/dist/types/utils/mapViewUtils.d.ts +8 -24
  94. package/dist/types/utils/publicNotificationStore.d.ts +0 -2
  95. package/package.json +1 -1
  96. package/dist/cjs/calcite-chip.cjs.entry.js +0 -259
  97. package/dist/cjs/calcite-notice.cjs.entry.js +0 -139
  98. package/dist/cjs/calcite-tooltip.cjs.entry.js +0 -439
  99. package/dist/esm/calcite-chip.entry.js +0 -255
  100. package/dist/esm/calcite-notice.entry.js +0 -135
  101. package/dist/esm/calcite-tooltip.entry.js +0 -435
  102. package/dist/solutions-components/p-2cff8331.entry.js +0 -6
  103. package/dist/solutions-components/p-3a6c8fc3.entry.js +0 -6
  104. package/dist/solutions-components/p-3b1fc7a2.entry.js +0 -6
  105. package/dist/solutions-components/p-767002cd.js +0 -36
  106. package/dist/solutions-components/p-a776b7e6.entry.js +0 -6
  107. package/dist/solutions-components/p-be36d5ed.entry.js +0 -22
  108. package/dist/solutions-components/p-c644edf5.entry.js +0 -11
  109. package/dist/solutions-components/p-cfd88a2f.entry.js +0 -11
@@ -20,9 +20,11 @@ import { C as ComboboxChildSelector, b as getItemAncestors, c as getItemChildren
20
20
  import { d as debounce } from './debounce-229b1a22.js';
21
21
  import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-dff8f839.js';
22
22
  import { i as isActivationKey } from './key-02fa06ae.js';
23
- import { b as getMapLayerIds, l as getMapTableIds, m as getMapLayerHash, n as getMapTableHash } from './mapViewUtils-00a04d52.js';
24
- import { s as state } from './publicNotificationStore-90a6a274.js';
23
+ import { g as getLocaleComponentStrings } from './locale-9624832c.js';
24
+ import { k as getMapLayerHash, l as getMapTableHash } from './mapViewUtils-8141d8c1.js';
25
+ import { s as state } from './publicNotificationStore-dcf39a55.js';
25
26
  import './resources-1e6d76df.js';
27
+ import './_commonjsHelpers-d5f9d613.js';
26
28
  import './interfaces-7470d906.js';
27
29
  import './index-f4bd5aa3.js';
28
30
 
@@ -1675,23 +1677,27 @@ const DropdownItem = class {
1675
1677
  };
1676
1678
  DropdownItem.style = dropdownItemCss;
1677
1679
 
1678
- const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100%}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}";
1680
+ const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100%}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}";
1679
1681
 
1680
1682
  const MapLayerPicker = class {
1681
1683
  constructor(hostRef) {
1682
1684
  registerInstance(this, hostRef);
1685
+ this.noLayersFound = createEvent(this, "noLayersFound", 7);
1683
1686
  this.layerSelectionChange = createEvent(this, "layerSelectionChange", 7);
1684
1687
  this.appearance = "transparent";
1685
1688
  this.enabledLayerIds = [];
1686
1689
  this.enabledTableIds = [];
1687
1690
  this.mapView = undefined;
1691
+ this.onlyShowUpdatableLayers = undefined;
1688
1692
  this.placeholderIcon = "";
1689
1693
  this.selectedIds = [];
1690
1694
  this.scale = "m";
1691
1695
  this.showTables = true;
1692
1696
  this.type = "select";
1697
+ this._hasValidLayers = true;
1693
1698
  this.ids = [];
1694
1699
  this.selectedName = "";
1700
+ this._translations = undefined;
1695
1701
  }
1696
1702
  //--------------------------------------------------------------------------
1697
1703
  //
@@ -1704,10 +1710,13 @@ const MapLayerPicker = class {
1704
1710
  */
1705
1711
  async mapViewWatchHandler() {
1706
1712
  await this._setLayers();
1707
- const hasLayers = Object.keys(state.layerNameHash).length > 0;
1708
- const hasTables = Object.keys(state.tableNameHash).length > 0 && this.showTables;
1709
- if (hasLayers || hasTables) {
1710
- this._setSelectedLayer(this.ids[0], hasLayers ? "layer" : "table");
1713
+ if (this.ids.length > 0) {
1714
+ this._hasValidLayers = true;
1715
+ this._setSelectedLayer(this.ids[0]);
1716
+ }
1717
+ else {
1718
+ this._hasValidLayers = false;
1719
+ this.noLayersFound.emit();
1711
1720
  }
1712
1721
  }
1713
1722
  //--------------------------------------------------------------------------
@@ -1719,6 +1728,7 @@ const MapLayerPicker = class {
1719
1728
  * StencilJS: Called once just after the component is first connected to the DOM.
1720
1729
  */
1721
1730
  async componentWillLoad() {
1731
+ await this._getTranslations();
1722
1732
  await this._setLayers();
1723
1733
  if (this.ids.length > 0 || this.selectedIds.length === 1) {
1724
1734
  this.layerSelectionChange.emit(this.selectedIds.length === 1 ? [this.selectedIds[0]] : [this.ids[0]]);
@@ -1728,7 +1738,7 @@ const MapLayerPicker = class {
1728
1738
  * Renders the component.
1729
1739
  */
1730
1740
  render() {
1731
- return (h(Host, null, h("div", { class: "map-layer-picker-container" }, h("div", { class: "map-layer-picker" }, this.type === "combobox" ? this._getCombobox() :
1741
+ return (h(Host, null, h("div", { class: "map-layer-picker-container" }, h("div", { class: "map-layer-picker" }, !this._hasValidLayers ? this._getInvalidPlaceholder() : this.type === "combobox" ? this._getCombobox() :
1732
1742
  this.type === "select" ? this._getSelect() : this._getDropdown()))));
1733
1743
  }
1734
1744
  /**
@@ -1741,9 +1751,9 @@ const MapLayerPicker = class {
1741
1751
  this._layerElement.value = id;
1742
1752
  }
1743
1753
  else if (this.type === "dropdown") {
1744
- this.selectedName = Object.keys(state.layerNameHash).indexOf(id) > -1 ?
1745
- state.layerNameHash[id] : Object.keys(state.tableNameHash).indexOf(id) > -1 ?
1746
- state.tableNameHash[id] : "";
1754
+ this.selectedName = Object.keys(this._layerNameHash).indexOf(id) > -1 ?
1755
+ this._layerNameHash[id].name : Object.keys(this._tableNameHash).indexOf(id) > -1 ?
1756
+ this._tableNameHash[id].name : "";
1747
1757
  }
1748
1758
  }
1749
1759
  }
@@ -1752,6 +1762,14 @@ const MapLayerPicker = class {
1752
1762
  // Functions (protected)
1753
1763
  //
1754
1764
  //--------------------------------------------------------------------------
1765
+ /**
1766
+ * Create a notice to inform the user that no layers were found
1767
+ *
1768
+ * @returns Calcite Notice component with the message
1769
+ */
1770
+ _getInvalidPlaceholder() {
1771
+ return (h("div", null, h("calcite-notice", { class: "height-100", icon: "exclamation-mark-triangle", id: "no-valid-layers", kind: "danger", open: true }, h("div", { slot: "message" }, this._translations.noLayersFound)), h("calcite-tooltip", { label: this._translations.enableEditUpdate, placement: "bottom", "reference-element": "no-valid-layers" }, h("span", null, this._translations.enableEditUpdate))));
1772
+ }
1755
1773
  /**
1756
1774
  * Create a list of layers from the map
1757
1775
  *
@@ -1802,16 +1820,21 @@ const MapLayerPicker = class {
1802
1820
  * @returns A dom node with the name of the layer or table
1803
1821
  */
1804
1822
  _getItem(id, itemType) {
1805
- const name = itemType === "layer" ? state.layerNameHash[id] : state.tableNameHash[id];
1806
- return this.type === "combobox" ? (h("calcite-combobox-item", { textLabel: name, value: id })) :
1807
- this.type === "select" ? (h("calcite-option", { label: name, value: id })) :
1808
- (h("calcite-dropdown-item", { onClick: () => void this._setSelectedLayer(id, itemType) }, name));
1823
+ const item = itemType === "layer" ? this._layerNameHash[id] : this._tableNameHash[id];
1824
+ const disabled = this.onlyShowUpdatableLayers ? !item.supportsUpdate : false;
1825
+ const name = item.name;
1826
+ return this.type === "combobox" ? (h("calcite-combobox-item", { disabled: disabled, textLabel: name, value: id })) :
1827
+ this.type === "select" ? (h("calcite-option", { disabled: disabled, label: name, value: id })) :
1828
+ (h("calcite-dropdown-item", { disabled: disabled, onClick: disabled ? undefined : () => void this._setSelectedLayer(id) }, name));
1809
1829
  }
1810
1830
  /**
1811
1831
  * Store the layer name based on the user selection
1812
1832
  */
1813
- _setSelectedLayer(id, type) {
1814
- this.selectedName = type === "layer" ? state.layerNameHash[id] : state.tableNameHash[id];
1833
+ _setSelectedLayer(id) {
1834
+ const item = Object.keys(this._layerNameHash).indexOf(id) > -1 ?
1835
+ this._layerNameHash[id] : Object.keys(this._tableNameHash).indexOf(id) > -1 ?
1836
+ this._tableNameHash[id] : undefined;
1837
+ this.selectedName = item === null || item === void 0 ? void 0 : item.name;
1815
1838
  this.selectedIds = [id];
1816
1839
  this.layerSelectionChange.emit(this.selectedIds);
1817
1840
  }
@@ -1822,25 +1845,38 @@ const MapLayerPicker = class {
1822
1845
  */
1823
1846
  async _setLayers() {
1824
1847
  if (this.mapView) {
1825
- const mapLayerIds = await getMapLayerIds(this.mapView);
1826
- const mapTableIds = this.showTables ? await getMapTableIds(this.mapView) : [];
1848
+ await this._initLayerTableHash();
1849
+ const mapLayerIds = this.onlyShowUpdatableLayers ?
1850
+ this._getEditableIds(this._layerNameHash) : Object.keys(this._layerNameHash);
1851
+ const mapTableIds = this.showTables ? this.onlyShowUpdatableLayers ?
1852
+ this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
1827
1853
  this.ids = [
1828
1854
  ...mapLayerIds.filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.indexOf(n) > -1 : true; }),
1829
1855
  ...mapTableIds.filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.indexOf(n) > -1 : true; }),
1830
1856
  ];
1831
- await this._initStateHash();
1832
1857
  }
1833
1858
  }
1859
+ /**
1860
+ * Fetch the ids of all layers that support edits with the update capability
1861
+ *
1862
+ * @returns array of layer ids
1863
+ */
1864
+ _getEditableIds(hash) {
1865
+ return Object.keys(hash).reduce((prev, cur) => {
1866
+ if (hash[cur].supportsUpdate) {
1867
+ prev.push(cur);
1868
+ }
1869
+ return prev;
1870
+ }, []);
1871
+ }
1834
1872
  /**
1835
1873
  * Create a layer id:title hash for layer name display
1836
1874
  *
1837
1875
  * @returns Promise when the operation has completed
1838
1876
  */
1839
- async _initStateHash() {
1840
- if (this.mapView) {
1841
- state.layerNameHash = await getMapLayerHash(this.mapView);
1842
- state.tableNameHash = this.showTables ? await getMapTableHash(this.mapView) : {};
1843
- }
1877
+ async _initLayerTableHash() {
1878
+ this._layerNameHash = await getMapLayerHash(this.mapView, this.onlyShowUpdatableLayers);
1879
+ this._tableNameHash = this.showTables ? await getMapTableHash(this.mapView, this.onlyShowUpdatableLayers) : {};
1844
1880
  }
1845
1881
  /**
1846
1882
  * Evaluate if the id exists in the current hash and verify if it should be excluded
@@ -1848,9 +1884,10 @@ const MapLayerPicker = class {
1848
1884
  * @returns boolean when true the layer will be used in the current layer picker type
1849
1885
  */
1850
1886
  _validLayer(id) {
1851
- const name = state.layerNameHash[id];
1887
+ var _a;
1888
+ const name = (_a = this._layerNameHash[id]) === null || _a === void 0 ? void 0 : _a.name;
1852
1889
  return name && state.managedLayers.indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
1853
- this.enabledLayerIds.indexOf(id) > -1 : name);
1890
+ this.enabledLayerIds.indexOf(id) > -1 : true);
1854
1891
  }
1855
1892
  /**
1856
1893
  * Evaluate if the id exists in the current hash and verify if it should be excluded
@@ -1858,7 +1895,8 @@ const MapLayerPicker = class {
1858
1895
  * @returns boolean when true the table will be used in the current layer picker type
1859
1896
  */
1860
1897
  _validTable(id) {
1861
- const name = state.tableNameHash[id];
1898
+ var _a;
1899
+ const name = (_a = this._tableNameHash[id]) === null || _a === void 0 ? void 0 : _a.name;
1862
1900
  const validName = name && this.showTables;
1863
1901
  return validName ? state.managedTables.indexOf(name) < 0 &&
1864
1902
  (this.enabledTableIds.length > 0 ? this.enabledTableIds.indexOf(id) > -1 : true) : validName;
@@ -1875,6 +1913,16 @@ const MapLayerPicker = class {
1875
1913
  this.layerSelectionChange.emit(this.selectedIds);
1876
1914
  }
1877
1915
  }
1916
+ /**
1917
+ * Fetches the component's translations
1918
+ *
1919
+ * @returns Promise when complete
1920
+ * @protected
1921
+ */
1922
+ async _getTranslations() {
1923
+ const messages = await getLocaleComponentStrings(this.el);
1924
+ this._translations = messages[0];
1925
+ }
1878
1926
  get el() { return getElement(this); }
1879
1927
  static get watchers() { return {
1880
1928
  "mapView": ["mapViewWatchHandler"]
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-c7de2486.js';
7
7
  import { g as getLocaleComponentStrings } from './locale-9624832c.js';
8
- import { q as queryFeaturesByID, a as getLayer, b as getMapLayerIds, g as goToSelection, c as queryAllIds } from './mapViewUtils-00a04d52.js';
8
+ import { q as queryFeaturesByID, a as getLayerOrTable, g as goToSelection, b as queryAllIds } from './mapViewUtils-8141d8c1.js';
9
9
  import { l as loadModules } from './loadModules-2880c7e3.js';
10
- import { d as downloadCSV } from './downloadUtils-67c7a6c8.js';
10
+ import { d as downloadCSV } from './downloadUtils-ac67a786.js';
11
11
  import './_commonjsHelpers-d5f9d613.js';
12
12
  import './interfaces-7470d906.js';
13
13
  import './clean-url-bce022e6.js';
@@ -55,7 +55,7 @@ const CardManager = class {
55
55
  */
56
56
  async layerSelectionChange(evt) {
57
57
  const id = evt.detail[0];
58
- this.layer = await getLayer(this.mapView, id);
58
+ this.layer = await getLayerOrTable(this.mapView, id);
59
59
  }
60
60
  //--------------------------------------------------------------------------
61
61
  //
@@ -127,6 +127,7 @@ const LayerTable = class {
127
127
  this.enableInlineEdit = undefined;
128
128
  this.mapInfo = undefined;
129
129
  this.mapView = undefined;
130
+ this.onlyShowUpdatableLayers = undefined;
130
131
  this.showNewestFirst = undefined;
131
132
  this.zoomAndScrollToSelected = undefined;
132
133
  this._alertOpen = false;
@@ -147,13 +148,12 @@ const LayerTable = class {
147
148
  * watch for changes in map view and get the first layer
148
149
  */
149
150
  async mapViewWatchHandler() {
150
- this._fetchingData = true;
151
- const mapLayerIds = await getMapLayerIds(this.mapView);
152
- this._layer = await getLayer(this.mapView, mapLayerIds[0]);
153
- this.reactiveUtils.on(() => this.mapView, "click", (event) => {
151
+ if (this._mapClickHandle) {
152
+ this._mapClickHandle.remove();
153
+ }
154
+ this._mapClickHandle = this.reactiveUtils.on(() => this.mapView, "click", (event) => {
154
155
  void this._mapClicked(event);
155
156
  });
156
- this._fetchingData = false;
157
157
  }
158
158
  /**
159
159
  * watch for changes in layer view and verify if it has editing enabled
@@ -210,6 +210,22 @@ const LayerTable = class {
210
210
  }
211
211
  }
212
212
  }
213
+ /**
214
+ * Refresh the table when edits are completed
215
+ *
216
+ */
217
+ editsComplete() {
218
+ this._refresh();
219
+ }
220
+ /**
221
+ * Refresh the table when edits are completed
222
+ *
223
+ */
224
+ noLayersFound() {
225
+ this._layer = undefined;
226
+ this._allIds = [];
227
+ this._clearSelection();
228
+ }
213
229
  //--------------------------------------------------------------------------
214
230
  //
215
231
  // Functions (lifecycle)
@@ -228,9 +244,6 @@ const LayerTable = class {
228
244
  * Renders the component.
229
245
  */
230
246
  render() {
231
- if (!this._layer) {
232
- return null;
233
- }
234
247
  const tableNodeClass = this._fetchingData ? "display-none" : "";
235
248
  const loadingClass = this._fetchingData ? "" : "display-none";
236
249
  const total = this._allIds.length.toString();
@@ -268,9 +281,37 @@ const LayerTable = class {
268
281
  */
269
282
  _getTableControlRow(slot) {
270
283
  const featuresSelected = this._selectedIndexes.length > 0;
271
- return (h("div", { class: "display-flex table-border height-51", slot: slot }, h("calcite-action-bar", { expandDisabled: true, expanded: true, layout: "horizontal" }, h("div", { class: "border-end" }, h("map-layer-picker", { appearance: "transparent", mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt), placeholderIcon: "layers", scale: "l", type: "dropdown" })), h("calcite-action", { appearance: "solid", disabled: !featuresSelected, icon: "magnifying-glass", id: "magnifying-glass", label: this._translations.zoom, onClick: () => this._zoom(), text: this._translations.zoom, textEnabled: true }), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "magnifying-glass" }, h("span", null, this._translations.zoom)), h("calcite-action", { appearance: "solid", icon: "filter", id: "filter", onClick: () => this._filter(), text: this._translations.filters, "text-enabled": "true", textEnabled: true }), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "filter" }, h("span", null, this._translations.filters)), h("calcite-action", { appearance: "solid", disabled: !featuresSelected, id: "trash", onClick: () => this._delete(), text: "" }, h("calcite-button", { appearance: "transparent", iconStart: "trash", kind: "danger" }, this._translations.delete)), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "trash" }, h("span", null, this._translations.delete)), h("calcite-action", { appearance: "solid", disabled: !featuresSelected, icon: "erase", id: "erase", onClick: () => this._clearSelection(), text: this._translations.clearSelection, "text-enabled": "true", textEnabled: true }), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "erase" }, h("span", null, this._translations.clearSelection))), h("calcite-dropdown", null, h("calcite-action", { appearance: "solid", label: "", slot: "trigger", text: "" }, h("calcite-button", { appearance: "transparent", iconEnd: "chevron-down", kind: "neutral" }, this._translations.more)), h("calcite-dropdown-group", { "selection-mode": "none" }, h("calcite-dropdown-item", { iconStart: "list-check-all", onClick: () => this._selectAll() }, this._translations.selectAll), h("calcite-dropdown-item", { iconStart: "selected-items-filter", onClick: () => this._toggleShowSelected() }, this._showOnlySelected ? this._translations.showAll :
284
+ return (h("div", { class: "display-flex table-border height-51", slot: slot }, h("calcite-action-bar", { expandDisabled: true, expanded: true, layout: "horizontal" }, h("div", { class: "border-end" }, h("map-layer-picker", { appearance: "transparent", mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt), onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", type: "dropdown" })), this._getAction("zoom-to-object", this._translations.zoom, () => this._zoom(), !featuresSelected), this._getAction("filter", this._translations.filters, () => this._filter(), false), this._deleteEnabled ? this._getDangerAction("trash", this._translations.delete, () => this._delete(), !featuresSelected) : undefined, this._getAction("erase", this._translations.clearSelection, () => this._clearSelection(), !featuresSelected)), h("calcite-dropdown", { disabled: this._layer === undefined }, h("calcite-action", { appearance: "solid", label: "", slot: "trigger", text: "" }, h("calcite-button", { appearance: "transparent", iconEnd: "chevron-down", kind: "neutral" }, this._translations.more)), h("calcite-dropdown-group", { "selection-mode": "none" }, h("calcite-dropdown-item", { iconStart: "list-check-all", onClick: () => this._selectAll() }, this._translations.selectAll), h("calcite-dropdown-item", { iconStart: "selected-items-filter", onClick: () => this._toggleShowSelected() }, this._showOnlySelected ? this._translations.showAll :
272
285
  this._translations.showSelected), h("calcite-dropdown-item", { iconStart: "compare", onClick: () => this._switchSelected() }, this._translations.switchSelected), h("calcite-dropdown-item", { iconStart: "refresh", onClick: () => this._refresh() }, this._translations.refresh), h("calcite-dropdown-item", { iconStart: "export", onClick: () => void this._exportToCSV() }, this._translations.exportCSV)))));
273
286
  }
287
+ /**
288
+ * Get an action and tooltip
289
+ *
290
+ * @param icon string the name of the icon to display, will also be used as the id
291
+ * @param label string the text to display and label the action
292
+ * @param func any the function to execute
293
+ * @param disabled boolean when true the user will not be able to interact with the action
294
+ *
295
+ * @returns VNode The node representing the DOM element that will contain the action
296
+ */
297
+ _getAction(icon, label, func, disabled) {
298
+ const _disabled = this._layer === undefined ? true : disabled;
299
+ return (h("div", { class: "display-flex" }, h("calcite-action", { appearance: "solid", disabled: _disabled, icon: icon, id: icon, label: label, onClick: func, text: label, textEnabled: true }), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, h("span", null, label))));
300
+ }
301
+ /**
302
+ * Get an action with danger color icon and text
303
+ *
304
+ * @param icon string the name of the icon to display, will also be used as the id
305
+ * @param label string the text to display and label the action
306
+ * @param func any the function to execute
307
+ * @param disabled boolean when true the user will not be able to interact with the action
308
+ *
309
+ * @returns VNode The node representing the DOM element that will contain the action
310
+ */
311
+ _getDangerAction(icon, label, func, disabled) {
312
+ const _disabled = this._layer === undefined ? true : disabled;
313
+ return (h("div", { class: "display-flex" }, h("calcite-action", { appearance: "solid", disabled: _disabled, id: icon, onClick: func, text: "" }, h("calcite-button", { appearance: "transparent", iconStart: icon, kind: "danger" }, label)), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, h("span", null, label))));
314
+ }
274
315
  /**
275
316
  * Initialize the FeatureTable
276
317
  *
@@ -280,7 +321,7 @@ const LayerTable = class {
280
321
  */
281
322
  async _getTable(node, columnTemplates) {
282
323
  if (this._layer) {
283
- await this._layer.when(async () => {
324
+ await this._layer.when(() => {
284
325
  this._table = new this.FeatureTable({
285
326
  autoRefreshEnabled: this.enableAutoRefresh,
286
327
  layer: this._layer,
@@ -297,25 +338,25 @@ const LayerTable = class {
297
338
  },
298
339
  container: node
299
340
  });
300
- this._checkEditEnabled();
301
- await this._table.when(async () => {
302
- this._table.highlightIds.on("change", () => {
303
- this._selectedIndexes = this._table.highlightIds.toArray();
304
- if (this._showOnlySelected) {
305
- if (this._selectedIndexes.length > 0) {
306
- this._table.filterBySelection();
307
- }
308
- else {
309
- this._toggleShowSelected();
310
- }
341
+ });
342
+ this._checkEditEnabled();
343
+ await this._table.when(() => {
344
+ this._table.highlightIds.on("change", () => {
345
+ this._selectedIndexes = this._table.highlightIds.toArray();
346
+ if (this._showOnlySelected) {
347
+ if (this._selectedIndexes.length > 0) {
348
+ this._table.filterBySelection();
349
+ }
350
+ else {
351
+ this._toggleShowSelected();
311
352
  }
312
- this.featureSelectionChange.emit(this._selectedIndexes);
313
- });
314
- this.reactiveUtils.watch(() => this._table.activeSortOrders, (sortOrders) => {
315
- var _a, _b, _c, _d;
316
- this._sortActive = (sortOrders.length > 0 && ((_a = sortOrders[0]) === null || _a === void 0 ? void 0 : _a.direction) === "asc" || ((_b = sortOrders[0]) === null || _b === void 0 ? void 0 : _b.direction) === "desc") ||
317
- ((_c = sortOrders[0]) === null || _c === void 0 ? void 0 : _c.direction) === null && ((_d = sortOrders[0]) === null || _d === void 0 ? void 0 : _d.fieldName) === this._layer.objectIdField;
318
- });
353
+ }
354
+ this.featureSelectionChange.emit(this._selectedIndexes);
355
+ });
356
+ this.reactiveUtils.watch(() => this._table.activeSortOrders, (sortOrders) => {
357
+ var _a, _b, _c, _d;
358
+ this._sortActive = this._layer ? (sortOrders.length > 0 && ((_a = sortOrders[0]) === null || _a === void 0 ? void 0 : _a.direction) === "asc" || ((_b = sortOrders[0]) === null || _b === void 0 ? void 0 : _b.direction) === "desc") ||
359
+ ((_c = sortOrders[0]) === null || _c === void 0 ? void 0 : _c.direction) === null && ((_d = sortOrders[0]) === null || _d === void 0 ? void 0 : _d.fieldName) === this._layer.objectIdField : false;
319
360
  });
320
361
  });
321
362
  }
@@ -326,20 +367,30 @@ const LayerTable = class {
326
367
  * @returns void
327
368
  */
328
369
  async _resetTable() {
329
- if (this._layer && this._table) {
370
+ if (this._table) {
330
371
  this._clearSelection();
331
372
  this._allIds = [];
332
373
  this.featureSelectionChange.emit(this._selectedIndexes);
333
- const columnTemplates = this._getColumnTemplates(this._layer.id);
334
- this._table.layer = this._layer;
335
- this._table.tableTemplate.columnTemplates = columnTemplates;
336
- this._checkEditEnabled();
337
- this._table.view = this.mapView;
338
- this._table.editingEnabled = this._editEnabled;
339
- this._table.clearSelectionFilter();
340
- this._showOnlySelected = false;
341
- this._sortActive = false;
342
- await this._sortTable();
374
+ if (this._layer) {
375
+ await this._layer.when(() => {
376
+ const columnTemplates = this._getColumnTemplates(this._layer.id);
377
+ this._table.layer = this._layer;
378
+ this._table.tableTemplate.columnTemplates = columnTemplates;
379
+ this._table.view = this.mapView;
380
+ this._checkEditEnabled();
381
+ this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
382
+ });
383
+ await this._table.when(() => {
384
+ this._table.clearSelectionFilter();
385
+ });
386
+ this._showOnlySelected = false;
387
+ this._sortActive = false;
388
+ await this._sortTable();
389
+ }
390
+ else {
391
+ this._table.view = this.mapView;
392
+ this._table.layer = this._layer;
393
+ }
343
394
  }
344
395
  }
345
396
  /**
@@ -360,11 +411,10 @@ const LayerTable = class {
360
411
  if (this._table && this._layer && !this._sortActive) {
361
412
  if (!this._tableSorting && this.showNewestFirst) {
362
413
  this._tableSorting = true;
363
- await this._table.when(async () => {
364
- await this._layer.when(async () => {
365
- this._table.sortColumn(this._layer.objectIdField, "desc");
366
- this._tableSorting = false;
367
- });
414
+ await this._table.when();
415
+ await this._layer.when(() => {
416
+ this._table.sortColumn(this._layer.objectIdField, "desc");
417
+ this._tableSorting = false;
368
418
  });
369
419
  }
370
420
  }
@@ -562,11 +612,12 @@ const LayerTable = class {
562
612
  * @returns a promise that will resolve when the operation is complete
563
613
  */
564
614
  async _layerSelectionChanged(evt) {
615
+ var _a;
565
616
  const id = evt.detail[0];
566
- if (id !== this._layer.id || this._allIds.length === 0) {
617
+ if (id !== ((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id) || this._allIds.length === 0) {
567
618
  this._fetchingData = true;
568
619
  const columnTemplates = this._getColumnTemplates(id);
569
- this._layer = await getLayer(this.mapView, id);
620
+ this._layer = await getLayerOrTable(this.mapView, id);
570
621
  this._allIds = await queryAllIds(this._layer);
571
622
  if (!this._table) {
572
623
  await this._getTable(this._tableNode, columnTemplates);
@@ -628,10 +679,16 @@ const MapCard = class {
628
679
  constructor(hostRef) {
629
680
  registerInstance(this, hostRef);
630
681
  this.mapChanged = createEvent(this, "mapChanged", 7);
682
+ this.beforeMapChanged = createEvent(this, "beforeMapChanged", 7);
631
683
  /**
632
684
  * string: the id of map currently displayed
633
685
  */
634
686
  this._loadedId = "";
687
+ this.enableLegend = undefined;
688
+ this.enableFullscreen = undefined;
689
+ this.enableSearch = undefined;
690
+ this.enableBasemap = undefined;
691
+ this.basemapConfig = undefined;
635
692
  this.mapInfos = [];
636
693
  this.mapView = undefined;
637
694
  this._searchConfiguration = undefined;
@@ -658,7 +715,7 @@ const MapCard = class {
658
715
  * Renders the component.
659
716
  */
660
717
  render() {
661
- return (h(Host, null, h("map-picker", { mapInfos: this.mapInfos }), h("div", { class: "map-height", ref: (el) => (this._mapDiv = el) }), h("map-tools", { class: "box-shadow", mapView: this.mapView, ref: (el) => this._mapTools = el, searchConfiguration: this._searchConfiguration })));
718
+ return (h(Host, null, h("map-picker", { mapInfos: this.mapInfos }), h("div", { class: "map-height", ref: (el) => (this._mapDiv = el) }), h("map-tools", { basemapConfig: this.basemapConfig, class: "box-shadow", enableBasemap: this.enableBasemap, enableFullscreen: this.enableFullscreen, enableLegend: this.enableLegend, enableSearch: this.enableSearch, mapView: this.mapView, ref: (el) => this._mapTools = el, searchConfiguration: this._searchConfiguration })));
662
719
  }
663
720
  //--------------------------------------------------------------------------
664
721
  //
@@ -708,16 +765,17 @@ const MapCard = class {
708
765
  });
709
766
  this._loadedId = id;
710
767
  this._searchConfiguration = this._webMapInfo.searchConfiguration;
711
- this.mapChanged.emit({
712
- id: id,
713
- mapView: this.mapView
714
- });
768
+ this.beforeMapChanged.emit();
715
769
  await this.mapView.when(() => {
716
770
  const home = new this.Home({
717
771
  view: this.mapView
718
772
  });
719
773
  this.mapView.ui.add(home, { position: "top-left", index: 3 });
720
774
  this.mapView.ui.add(this._mapTools, { position: "top-right", index: 0 });
775
+ this.mapChanged.emit({
776
+ id: id,
777
+ mapView: this.mapView
778
+ });
721
779
  });
722
780
  }
723
781
  }
@@ -20,10 +20,18 @@ const CrowdsourceManager = class {
20
20
  this._shouldSetMapView = false;
21
21
  this.classicGrid = false;
22
22
  this.enableAutoRefresh = true;
23
+ this.enableFullscreen = true;
23
24
  this.enableInlineEdit = false;
25
+ this.enableLegend = true;
26
+ this.enableSearch = true;
27
+ this.enableHome = true;
28
+ this.enableZoom = true;
29
+ this.enableBasemap = true;
30
+ this.basemapConfig = undefined;
24
31
  this.showNewestFirst = true;
25
32
  this.hideMap = false;
26
33
  this.mapInfos = [];
34
+ this.onlyShowUpdatableLayers = true;
27
35
  this.searchConfiguration = undefined;
28
36
  this.zoomAndScrollToSelected = false;
29
37
  this._expandPopup = false;
@@ -58,13 +66,18 @@ const CrowdsourceManager = class {
58
66
  */
59
67
  async mapChanged(evt) {
60
68
  this._mapChange = evt.detail;
69
+ await this._mapChange.mapView.when(() => {
70
+ this._setMapView();
71
+ });
72
+ }
73
+ /**
74
+ * Listen for beforeMapChanged and minimize the popup if it's expanded
75
+ */
76
+ async beforeMapChanged() {
61
77
  if (this._expandPopup) {
62
78
  this._shouldSetMapView = true;
63
79
  this._expandPopup = false;
64
80
  }
65
- else {
66
- this._setMapView();
67
- }
68
81
  }
69
82
  //--------------------------------------------------------------------------
70
83
  //
@@ -223,7 +236,7 @@ const CrowdsourceManager = class {
223
236
  const mapDisplayClass = this.classicGrid && layoutMode === ELayoutMode.GRID ? "display-flex height-full width-1-2" :
224
237
  layoutMode === ELayoutMode.GRID && !hideMap ? "" : "display-none";
225
238
  const mapContainerClass = this.classicGrid && layoutMode === ELayoutMode.GRID ? "width-full" : this._expandPopup ? "height-50-px" : "adjusted-height-50";
226
- return (h("div", { class: `${mapContainerClass} overflow-hidden ${mapDisplayClass}` }, h("map-card", { class: "width-full", mapInfos: this.mapInfos })));
239
+ return (h("div", { class: `${mapContainerClass} overflow-hidden ${mapDisplayClass}` }, h("map-card", { basemapConfig: this.basemapConfig, class: "width-full", enableBasemap: this.enableBasemap, enableFullscreen: this.enableFullscreen, enableLegend: this.enableLegend, enableSearch: this.enableSearch, mapInfos: this.mapInfos })));
227
240
  }
228
241
  /**
229
242
  * Get the expand node for the popup information
@@ -277,7 +290,7 @@ const CrowdsourceManager = class {
277
290
  const toggleSlot = this.classicGrid && layoutMode !== ELayoutMode.VERTICAL ? "footer" :
278
291
  this.classicGrid && layoutMode === ELayoutMode.VERTICAL ? "panel-end" :
279
292
  layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
280
- return (h("calcite-shell", { class: tableSizeClass + " border-bottom" }, h("calcite-action-bar", { class: "border", 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))), h("div", { class: "width-full height-full position-relative" }, h("layer-table", { enableAutoRefresh: this.enableAutoRefresh, enableInlineEdit: this.enableInlineEdit, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
293
+ return (h("calcite-shell", { class: tableSizeClass + " border-bottom" }, h("calcite-action-bar", { class: "border", 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))), h("div", { class: "width-full height-full position-relative" }, h("layer-table", { enableAutoRefresh: this.enableAutoRefresh, enableInlineEdit: this.enableInlineEdit, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
281
294
  }
282
295
  /**
283
296
  * Open/Close the appropriate panel.
@@ -6,7 +6,7 @@
6
6
  import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-d5f9d613.js';
7
7
  import { a as getAssetPath } from './index-c7de2486.js';
8
8
  import { l as loadModules } from './loadModules-2880c7e3.js';
9
- import { q as queryFeaturesByID } from './mapViewUtils-00a04d52.js';
9
+ import { q as queryFeaturesByID } from './mapViewUtils-8141d8c1.js';
10
10
  import { _ as __assign$1, r as request, c as cleanUrl } from './clean-url-bce022e6.js';
11
11
 
12
12
  /** @license
@@ -1506,7 +1506,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
1506
1506
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1507
1507
  * ====================================================================
1508
1508
  */
1509
- function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-59a67d3d.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
1509
+ function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-f553598f.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
1510
1510
  /** ====================================================================
1511
1511
  * @license
1512
1512
  * jsPDF XMP metadata plugin
@@ -14,6 +14,7 @@ const EditCard = class {
14
14
  constructor(hostRef) {
15
15
  registerInstance(this, hostRef);
16
16
  this.closeEdit = createEvent(this, "closeEdit", 7);
17
+ this.editsComplete = createEvent(this, "editsComplete", 7);
17
18
  /**
18
19
  * boolean: When true the Editor widget should be closed
19
20
  */
@@ -76,6 +77,10 @@ const EditCard = class {
76
77
  }
77
78
  if (((_a = this.graphics) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_b = this.graphics[0]) === null || _b === void 0 ? void 0 : _b.layer)) {
78
79
  this._layer = this.graphics[0].layer;
80
+ if (this._layerEditHandle) {
81
+ this._layerEditHandle.remove();
82
+ }
83
+ this._layerEditHandle = this._layer.on("edits", () => this.editsComplete.emit());
79
84
  }
80
85
  }
81
86
  /**