@esri/solutions-components 0.6.6 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. package/dist/cjs/basemap-gallery_4.cjs.entry.js +622 -0
  2. package/dist/cjs/card-manager_4.cjs.entry.js +91 -37
  3. package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/solutions-components.cjs.js +2 -2
  6. package/dist/collection/collection-manifest.json +3 -1
  7. package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -0
  8. package/dist/collection/components/basemap-gallery/basemap-gallery.js +166 -0
  9. package/dist/collection/components/basemap-gallery/test/basemap-gallery.e2e.js +29 -0
  10. package/dist/collection/components/basemap-gallery/test/basemap-gallery.spec.js +37 -0
  11. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +43 -2
  12. package/dist/collection/components/layer-table/layer-table.js +99 -30
  13. package/dist/collection/components/map-card/map-card.css +0 -7
  14. package/dist/collection/components/map-card/map-card.js +12 -7
  15. package/dist/collection/components/map-search/map-search.css +24 -0
  16. package/dist/collection/components/map-search/map-search.js +321 -0
  17. package/dist/collection/components/map-search/test/map-search.e2e.js +29 -0
  18. package/dist/collection/components/map-search/test/map-search.spec.js +37 -0
  19. package/dist/collection/components/map-tools/map-tools.js +139 -14
  20. package/dist/collection/demos/crowdsource-manager.html +3 -3
  21. package/dist/collection/utils/interfaces.ts +2 -0
  22. package/dist/components/action-bar.js +1 -0
  23. package/dist/components/action-group.js +1 -0
  24. package/dist/components/action-menu.js +1 -0
  25. package/dist/components/action.js +1 -0
  26. package/dist/components/alert.js +1 -0
  27. package/dist/components/avatar.js +1 -0
  28. package/dist/components/basemap-gallery.d.ts +11 -0
  29. package/dist/components/basemap-gallery.js +11 -0
  30. package/dist/components/basemap-gallery2.js +118 -0
  31. package/dist/components/buffer-tools2.js +1 -0
  32. package/dist/components/button.js +1 -0
  33. package/dist/components/calcite-accordion-item.js +1 -0
  34. package/dist/components/calcite-accordion.js +1 -0
  35. package/dist/components/calcite-action-pad.js +1 -0
  36. package/dist/components/calcite-block-section.js +1 -0
  37. package/dist/components/calcite-block.js +1 -0
  38. package/dist/components/calcite-card.js +1 -0
  39. package/dist/components/calcite-chip-group.js +1 -0
  40. package/dist/components/calcite-color-picker.js +1 -0
  41. package/dist/components/calcite-combobox-item-group.js +1 -0
  42. package/dist/components/calcite-fab.js +1 -0
  43. package/dist/components/calcite-flow-item.js +1 -0
  44. package/dist/components/calcite-flow.js +1 -0
  45. package/dist/components/calcite-inline-editable.js +1 -0
  46. package/dist/components/calcite-input-date-picker.js +1 -0
  47. package/dist/components/calcite-input-time-picker.js +1 -0
  48. package/dist/components/calcite-input-time-zone.js +1 -0
  49. package/dist/components/calcite-list-item-group.js +1 -0
  50. package/dist/components/calcite-menu-item.js +1 -0
  51. package/dist/components/calcite-modal.js +1 -0
  52. package/dist/components/calcite-navigation-logo.js +1 -0
  53. package/dist/components/calcite-navigation-user.js +1 -0
  54. package/dist/components/calcite-navigation.js +1 -0
  55. package/dist/components/calcite-option-group.js +1 -0
  56. package/dist/components/calcite-pagination.js +1 -0
  57. package/dist/components/calcite-pick-list-group.js +1 -0
  58. package/dist/components/calcite-pick-list.js +1 -0
  59. package/dist/components/calcite-radio-button-group.js +1 -0
  60. package/dist/components/calcite-radio-button.js +1 -0
  61. package/dist/components/calcite-rating.js +1 -0
  62. package/dist/components/calcite-shell-center-row.js +1 -0
  63. package/dist/components/calcite-sortable-list.js +1 -0
  64. package/dist/components/calcite-split-button.js +1 -0
  65. package/dist/components/calcite-stepper-item.js +1 -0
  66. package/dist/components/calcite-stepper.js +1 -0
  67. package/dist/components/calcite-text-area.js +1 -0
  68. package/dist/components/calcite-tile-select-group.js +1 -0
  69. package/dist/components/calcite-tile-select.js +1 -0
  70. package/dist/components/calcite-tip-group.js +1 -0
  71. package/dist/components/calcite-tip-manager.js +1 -0
  72. package/dist/components/calcite-tip.js +1 -0
  73. package/dist/components/card-manager2.js +1 -0
  74. package/dist/components/checkbox.js +1 -0
  75. package/dist/components/chip.js +1 -0
  76. package/dist/components/color-picker-hex-input.js +1 -0
  77. package/dist/components/color-picker-swatch.js +1 -0
  78. package/dist/components/combobox-item.js +1 -0
  79. package/dist/components/combobox.js +1 -0
  80. package/dist/components/crowdsource-manager.js +95 -78
  81. package/dist/components/crowdsource-reporter.js +1 -0
  82. package/dist/components/date-picker-day.js +1 -0
  83. package/dist/components/date-picker-month-header.js +1 -0
  84. package/dist/components/date-picker-month.js +1 -0
  85. package/dist/components/date-picker.js +1 -0
  86. package/dist/components/deduct-calculator2.js +1 -0
  87. package/dist/components/dropdown-group.js +1 -0
  88. package/dist/components/dropdown-item.js +1 -0
  89. package/dist/components/dropdown.js +1 -0
  90. package/dist/components/edit-card2.js +1 -0
  91. package/dist/components/esri-loader.js +301 -0
  92. package/dist/components/filter2.js +1 -0
  93. package/dist/components/graph.js +1 -0
  94. package/dist/components/handle.js +1 -0
  95. package/dist/components/icon.js +1 -0
  96. package/dist/components/index.d.ts +6 -0
  97. package/dist/components/index.js +1 -1
  98. package/dist/components/info-card2.js +1 -0
  99. package/dist/components/input-message.js +1 -0
  100. package/dist/components/input-number.js +1 -0
  101. package/dist/components/input-text.js +1 -0
  102. package/dist/components/input.js +1 -0
  103. package/dist/components/json-editor2.js +1 -0
  104. package/dist/components/label2.js +1 -0
  105. package/dist/components/layer-table2.js +83 -31
  106. package/dist/components/layout-manager2.js +1 -0
  107. package/dist/components/link.js +1 -0
  108. package/dist/components/list-item.js +1 -0
  109. package/dist/components/list-item2.js +1 -0
  110. package/dist/components/list.js +1 -0
  111. package/dist/components/loadModules.js +1 -1
  112. package/dist/components/loader.js +1 -0
  113. package/dist/components/locale.js +2 -295
  114. package/dist/components/map-card2.js +61 -42
  115. package/dist/components/map-draw-tools2.js +1 -0
  116. package/dist/components/map-layer-picker2.js +1 -0
  117. package/dist/components/map-picker2.js +1 -0
  118. package/dist/components/map-search.d.ts +11 -0
  119. package/dist/components/map-search.js +11 -0
  120. package/dist/components/map-search2.js +201 -0
  121. package/dist/components/map-select-tools2.js +1 -0
  122. package/dist/components/map-tools2.js +141 -30
  123. package/dist/components/menu.js +1 -0
  124. package/dist/components/notice.js +1 -0
  125. package/dist/components/option.js +1 -0
  126. package/dist/components/panel.js +1 -0
  127. package/dist/components/pci-calculator.js +1 -0
  128. package/dist/components/pdf-download2.js +1 -0
  129. package/dist/components/pick-list-item.js +1 -0
  130. package/dist/components/popover.js +1 -0
  131. package/dist/components/progress.js +1 -0
  132. package/dist/components/public-notification.js +1 -0
  133. package/dist/components/refine-selection2.js +1 -0
  134. package/dist/components/scrim.js +1 -0
  135. package/dist/components/segmented-control-item.js +1 -0
  136. package/dist/components/segmented-control.js +1 -0
  137. package/dist/components/select.js +1 -0
  138. package/dist/components/shell-panel.js +1 -0
  139. package/dist/components/shell.js +1 -0
  140. package/dist/components/slider.js +1 -0
  141. package/dist/components/solution-configuration.js +1 -0
  142. package/dist/components/solution-contents2.js +1 -0
  143. package/dist/components/solution-item-details2.js +1 -0
  144. package/dist/components/solution-item-icon2.js +1 -0
  145. package/dist/components/solution-item-sharing2.js +1 -0
  146. package/dist/components/solution-item2.js +1 -0
  147. package/dist/components/solution-organization-variables2.js +1 -0
  148. package/dist/components/solution-resource-item2.js +1 -0
  149. package/dist/components/solution-spatial-ref2.js +1 -0
  150. package/dist/components/solution-template-data2.js +1 -0
  151. package/dist/components/solution-variables2.js +1 -0
  152. package/dist/components/stack.js +1 -0
  153. package/dist/components/store-manager.js +1 -0
  154. package/dist/components/switch.js +1 -0
  155. package/dist/components/tab-nav.js +1 -0
  156. package/dist/components/tab-title.js +1 -0
  157. package/dist/components/tab.js +1 -0
  158. package/dist/components/tabs.js +1 -0
  159. package/dist/components/tile.js +1 -0
  160. package/dist/components/time-picker.js +1 -0
  161. package/dist/components/tooltip.js +1 -0
  162. package/dist/components/tree-item.js +1 -0
  163. package/dist/components/tree.js +1 -0
  164. package/dist/components/value-list-item.js +1 -0
  165. package/dist/components/value-list.js +1 -0
  166. package/dist/esm/basemap-gallery_4.entry.js +615 -0
  167. package/dist/esm/card-manager_4.entry.js +91 -37
  168. package/dist/esm/crowdsource-manager.entry.js +4 -2
  169. package/dist/esm/loader.js +1 -1
  170. package/dist/esm/polyfills/core-js.js +11 -0
  171. package/dist/esm/polyfills/dom.js +79 -0
  172. package/dist/esm/polyfills/es5-html-element.js +1 -0
  173. package/dist/esm/polyfills/index.js +34 -0
  174. package/dist/esm/polyfills/system.js +6 -0
  175. package/dist/esm/solutions-components.js +2 -2
  176. package/dist/solutions-components/demos/crowdsource-manager.html +3 -3
  177. package/dist/solutions-components/p-55aefaa8.entry.js +6 -0
  178. package/dist/solutions-components/p-5b5a6ac8.entry.js +6 -0
  179. package/dist/solutions-components/p-a6c85bd7.entry.js +6 -0
  180. package/dist/solutions-components/solutions-components.esm.js +1 -1
  181. package/dist/solutions-components/utils/interfaces.ts +2 -0
  182. package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +64 -0
  183. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +9 -1
  184. package/dist/types/components/layer-table/layer-table.d.ts +24 -2
  185. package/dist/types/components/map-card/map-card.d.ts +10 -2
  186. package/dist/types/components/map-search/map-search.d.ts +107 -0
  187. package/dist/types/components/map-tools/map-tools.d.ts +68 -5
  188. package/dist/types/components.d.ts +122 -0
  189. package/dist/types/preact.d.ts +4 -0
  190. package/dist/types/stencil-public-runtime.d.ts +2 -0
  191. package/dist/types/utils/interfaces.d.ts +2 -0
  192. package/package.json +1 -1
  193. package/dist/cjs/map-picker_2.cjs.entry.js +0 -264
  194. package/dist/esm/map-picker_2.entry.js +0 -259
  195. package/dist/solutions-components/p-1990d9c8.entry.js +0 -6
  196. package/dist/solutions-components/p-40bde8b2.entry.js +0 -6
  197. package/dist/solutions-components/p-b921aa1a.entry.js +0 -6
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ /** @license
7
+ * Copyright 2022 Esri
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ import { newSpecPage } from "@stencil/core/testing";
22
+ import { BasemapGallery } from "../basemap-gallery";
23
+ xdescribe('basemap-gallery', () => {
24
+ it('renders', async () => {
25
+ const page = await newSpecPage({
26
+ components: [BasemapGallery],
27
+ html: `<basemap-gallery></basemap-gallery>`,
28
+ });
29
+ expect(page.root).toEqualHtml(`
30
+ <basemap-gallery>
31
+ <mock:shadow-root>
32
+ <slot></slot>
33
+ </mock:shadow-root>
34
+ </basemap-gallery>
35
+ `);
36
+ });
37
+ });
@@ -24,9 +24,11 @@ import { ELayoutMode } from "../../utils/interfaces";
24
24
  export class CrowdsourceManager {
25
25
  constructor() {
26
26
  this.classicGrid = false;
27
+ this.showNewestFirst = false;
27
28
  this.hideHeader = true;
28
29
  this.hideMap = false;
29
30
  this.mapInfos = [];
31
+ this.searchConfiguration = undefined;
30
32
  this.zoomAndScrollToSelected = false;
31
33
  this._translations = undefined;
32
34
  this._layoutMode = ELayoutMode.GRID;
@@ -83,7 +85,7 @@ export class CrowdsourceManager {
83
85
  * Renders the component.
84
86
  */
85
87
  render() {
86
- return (h(Host, null, h("calcite-shell", null, h("calcite-panel", { class: "width-full height-full", heading: this.hideHeader ? undefined : this._translations.header }, this.hideHeader ? undefined : (h("layout-manager", { slot: "header-actions-end" })), this._getBody(this._layoutMode, this._panelOpen, this.hideMap)))));
88
+ return (h(Host, null, h("calcite-shell", { class: "position-relative" }, h("calcite-panel", { class: "width-full height-full", heading: this.hideHeader ? undefined : this._translations.header }, this.hideHeader ? undefined : (h("layout-manager", { slot: "header-actions-end" })), this._getBody(this._layoutMode, this._panelOpen, this.hideMap)))));
87
89
  }
88
90
  //--------------------------------------------------------------------------
89
91
  //
@@ -249,7 +251,7 @@ export class CrowdsourceManager {
249
251
  const toggleSlot = this.classicGrid && layoutMode !== ELayoutMode.VERTICAL ? "footer" :
250
252
  this.classicGrid && layoutMode === ELayoutMode.VERTICAL ? "panel-end" :
251
253
  layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
252
- 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", { mapView: this === null || this === void 0 ? void 0 : this._mapView, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
254
+ 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", { mapView: this === null || this === void 0 ? void 0 : this._mapView, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
253
255
  }
254
256
  /**
255
257
  * Open/Close the appropriate panel.
@@ -302,6 +304,24 @@ export class CrowdsourceManager {
302
304
  "reflect": false,
303
305
  "defaultValue": "false"
304
306
  },
307
+ "showNewestFirst": {
308
+ "type": "boolean",
309
+ "mutable": false,
310
+ "complexType": {
311
+ "original": "boolean",
312
+ "resolved": "boolean",
313
+ "references": {}
314
+ },
315
+ "required": false,
316
+ "optional": false,
317
+ "docs": {
318
+ "tags": [],
319
+ "text": "boolean: when true the table will be sorted by objectid in descending order by default"
320
+ },
321
+ "attribute": "show-newest-first",
322
+ "reflect": false,
323
+ "defaultValue": "false"
324
+ },
305
325
  "hideHeader": {
306
326
  "type": "boolean",
307
327
  "mutable": false,
@@ -360,6 +380,27 @@ export class CrowdsourceManager {
360
380
  },
361
381
  "defaultValue": "[]"
362
382
  },
383
+ "searchConfiguration": {
384
+ "type": "unknown",
385
+ "mutable": false,
386
+ "complexType": {
387
+ "original": "ISearchConfiguration",
388
+ "resolved": "ISearchConfiguration",
389
+ "references": {
390
+ "ISearchConfiguration": {
391
+ "location": "import",
392
+ "path": "../../utils/interfaces",
393
+ "id": "src/utils/interfaces.ts::ISearchConfiguration"
394
+ }
395
+ }
396
+ },
397
+ "required": false,
398
+ "optional": false,
399
+ "docs": {
400
+ "tags": [],
401
+ "text": "ISearchConfiguration: Configuration details for the Search widget"
402
+ }
403
+ },
363
404
  "zoomAndScrollToSelected": {
364
405
  "type": "boolean",
365
406
  "mutable": false,
@@ -30,6 +30,10 @@ export class LayerTable {
30
30
  * number[]: A list of all IDs for the current layer
31
31
  */
32
32
  this._allIds = [];
33
+ /**
34
+ * bool: When true the table is being sorted
35
+ */
36
+ this._tableSorting = false;
33
37
  /**
34
38
  * Store a reference to the table node after it's first created
35
39
  * and initializes the FeatureTable
@@ -40,15 +44,16 @@ export class LayerTable {
40
44
  */
41
45
  this.onTableNodeCreate = (node) => {
42
46
  this._tableNode = node;
43
- this._getTable(node);
44
47
  };
45
48
  this.mapView = undefined;
49
+ this.showNewestFirst = undefined;
46
50
  this.zoomAndScrollToSelected = undefined;
47
51
  this._alertOpen = false;
48
52
  this._fetchingData = false;
49
53
  this._layer = undefined;
50
54
  this._selectedIndexes = [];
51
55
  this._showOnlySelected = false;
56
+ this._sortActive = false;
52
57
  this._translations = undefined;
53
58
  }
54
59
  //--------------------------------------------------------------------------
@@ -63,7 +68,6 @@ export class LayerTable {
63
68
  this._fetchingData = true;
64
69
  const mapLayerIds = await getMapLayerIds(this.mapView);
65
70
  this._layer = await getLayer(this.mapView, mapLayerIds[0]);
66
- this._resetTable();
67
71
  this.reactiveUtils.on(() => this.mapView, "click", (event) => {
68
72
  void this._mapClicked(event);
69
73
  });
@@ -74,9 +78,17 @@ export class LayerTable {
74
78
  */
75
79
  async _layerWatchHandler() {
76
80
  this._fetchingData = true;
77
- this._resetTable();
81
+ await this._resetTable();
78
82
  this._fetchingData = false;
79
83
  }
84
+ /**
85
+ * When sortActive is false the user has not defined a sort and we should use the default sort
86
+ */
87
+ async _sortActiveWatchHandler() {
88
+ if (!this._sortActive) {
89
+ await this._sortTable();
90
+ }
91
+ }
80
92
  //--------------------------------------------------------------------------
81
93
  //
82
94
  // Methods (public)
@@ -181,31 +193,39 @@ export class LayerTable {
181
193
  *
182
194
  * @returns void
183
195
  */
184
- _getTable(node) {
196
+ async _getTable(node) {
185
197
  if (this._layer) {
186
- this._table = new this.FeatureTable({
187
- layer: this._layer,
188
- view: this.mapView,
189
- //editingEnabled: this._editEnabled,
190
- highlightEnabled: true,
191
- multiSortEnabled: false,
192
- visibleElements: {
193
- header: false,
194
- menu: false
195
- },
196
- container: node
197
- });
198
- this._table.highlightIds.on("change", () => {
199
- this._selectedIndexes = this._table.highlightIds.toArray();
200
- if (this._showOnlySelected) {
201
- if (this._selectedIndexes.length > 0) {
202
- this._table.filterBySelection();
203
- }
204
- else {
205
- this._toggleShowSelected();
206
- }
207
- }
208
- this.featureSelectionChange.emit(this._selectedIndexes);
198
+ await this._layer.when(async () => {
199
+ this._table = new this.FeatureTable({
200
+ layer: this._layer,
201
+ view: this.mapView,
202
+ //editingEnabled: this._editEnabled,
203
+ highlightEnabled: true,
204
+ multiSortEnabled: false,
205
+ visibleElements: {
206
+ header: false,
207
+ menu: false
208
+ },
209
+ container: node
210
+ });
211
+ await this._table.when(async () => {
212
+ this._table.highlightIds.on("change", () => {
213
+ this._selectedIndexes = this._table.highlightIds.toArray();
214
+ if (this._showOnlySelected) {
215
+ if (this._selectedIndexes.length > 0) {
216
+ this._table.filterBySelection();
217
+ }
218
+ else {
219
+ this._toggleShowSelected();
220
+ }
221
+ }
222
+ this.featureSelectionChange.emit(this._selectedIndexes);
223
+ });
224
+ this.reactiveUtils.watch(() => this._table.activeSortOrders, (sortOrders) => {
225
+ var _a, _b;
226
+ 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";
227
+ });
228
+ });
209
229
  });
210
230
  }
211
231
  }
@@ -214,9 +234,10 @@ export class LayerTable {
214
234
  *
215
235
  * @returns void
216
236
  */
217
- _resetTable() {
237
+ async _resetTable() {
218
238
  if (this._layer && this._table) {
219
239
  this._clearSelection();
240
+ this._allIds = [];
220
241
  this.featureSelectionChange.emit(this._selectedIndexes);
221
242
  this._table.layer = this._layer;
222
243
  this._editEnabled = this._layer.editingEnabled;
@@ -224,6 +245,26 @@ export class LayerTable {
224
245
  this._table.editingEnabled = this._editEnabled;
225
246
  this._table.clearSelectionFilter();
226
247
  this._showOnlySelected = false;
248
+ this._sortActive = false;
249
+ await this._sortTable();
250
+ }
251
+ }
252
+ /**
253
+ * Sort the objectid field in descending order
254
+ *
255
+ * @returns void
256
+ */
257
+ async _sortTable() {
258
+ if (this._table && this._layer && !this._sortActive) {
259
+ if (!this._tableSorting && this.showNewestFirst) {
260
+ this._tableSorting = true;
261
+ await this._table.when(async () => {
262
+ await this._layer.when(async () => {
263
+ this._table.sortColumn(this._layer.objectIdField, "desc");
264
+ this._tableSorting = false;
265
+ });
266
+ });
267
+ }
227
268
  }
228
269
  }
229
270
  /**
@@ -402,14 +443,21 @@ export class LayerTable {
402
443
  const id = evt.detail[0];
403
444
  if (id !== this._layer.id || this._allIds.length === 0) {
404
445
  this._fetchingData = true;
405
- this._table.highlightIds.removeAll();
406
446
  this._layer = await getLayer(this.mapView, id);
407
447
  this._allIds = await queryAllIds(this._layer);
448
+ if (!this._table) {
449
+ await this._getTable(this._tableNode);
450
+ }
451
+ await this._table.when(() => {
452
+ this._table.highlightIds.removeAll();
453
+ });
408
454
  this._selectedIndexes = [];
409
455
  this._table.layer = this._layer;
410
456
  this._table.render();
411
- this._fetchingData = false;
412
457
  }
458
+ this._sortActive = false;
459
+ await this._sortTable();
460
+ this._fetchingData = false;
413
461
  }
414
462
  /**
415
463
  * Fetches the component's translations
@@ -454,6 +502,23 @@ export class LayerTable {
454
502
  "text": "esri/views/View: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"
455
503
  }
456
504
  },
505
+ "showNewestFirst": {
506
+ "type": "boolean",
507
+ "mutable": false,
508
+ "complexType": {
509
+ "original": "boolean",
510
+ "resolved": "boolean",
511
+ "references": {}
512
+ },
513
+ "required": false,
514
+ "optional": false,
515
+ "docs": {
516
+ "tags": [],
517
+ "text": "boolean: when true the table will be sorted by objectid in descending order by default"
518
+ },
519
+ "attribute": "show-newest-first",
520
+ "reflect": false
521
+ },
457
522
  "zoomAndScrollToSelected": {
458
523
  "type": "boolean",
459
524
  "mutable": false,
@@ -480,6 +545,7 @@ export class LayerTable {
480
545
  "_layer": {},
481
546
  "_selectedIndexes": {},
482
547
  "_showOnlySelected": {},
548
+ "_sortActive": {},
483
549
  "_translations": {}
484
550
  };
485
551
  }
@@ -537,6 +603,9 @@ export class LayerTable {
537
603
  }, {
538
604
  "propName": "_layer",
539
605
  "methodName": "_layerWatchHandler"
606
+ }, {
607
+ "propName": "_sortActive",
608
+ "methodName": "_sortActiveWatchHandler"
540
609
  }];
541
610
  }
542
611
  static get listeners() {
@@ -30,10 +30,3 @@
30
30
  .esri-zoom {
31
31
  display: none !important;
32
32
  }
33
-
34
- .map-tools {
35
- position: absolute;
36
- top: 40px;
37
- right: 0px;
38
- padding: 1rem;
39
- }
@@ -23,8 +23,7 @@ import { loadModules } from "../../utils/loadModules";
23
23
  // TODO navigation and accessability isn't right for the map list
24
24
  // tab does not go into the list when it's open
25
25
  // focus is not set when it opens
26
- // TODO clarify what the Home and List buttons are supposed to do
27
- // TODO handle zoom in/out
26
+ // TODO clarify what the List button is supposed to do
28
27
  // TODO map list button tooltip does not work
29
28
  // TODO map list should close if the user clicks something else...hope this will be easy when I figure out how to set focus when it opens
30
29
  export class MapCard {
@@ -35,13 +34,14 @@ export class MapCard {
35
34
  this._loadedId = "";
36
35
  this.mapInfos = [];
37
36
  this.mapView = undefined;
37
+ this._searchConfiguration = undefined;
38
38
  this._webMapInfo = undefined;
39
39
  }
40
40
  /**
41
41
  * Listen for changes to map info and load the appropriate map
42
42
  */
43
43
  async mapInfoChange(evt) {
44
- this._loadMap(evt.detail);
44
+ await this._loadMap(evt.detail);
45
45
  }
46
46
  //--------------------------------------------------------------------------
47
47
  //
@@ -58,7 +58,7 @@ export class MapCard {
58
58
  * Renders the component.
59
59
  */
60
60
  render() {
61
- return (h(Host, null, h("map-picker", { mapInfos: this.mapInfos }), h("div", { class: "map-height", ref: (el) => (this._mapDiv = el) }), h("map-tools", { class: "map-tools" })));
61
+ return (h(Host, null, h("map-picker", { mapInfos: this.mapInfos }), h("div", { class: "map-height", ref: (el) => (this._mapDiv = el) }), h("map-tools", { mapView: this.mapView, ref: (el) => this._mapTools = el, searchConfiguration: this._searchConfiguration })));
62
62
  }
63
63
  //--------------------------------------------------------------------------
64
64
  //
@@ -89,7 +89,7 @@ export class MapCard {
89
89
  *
90
90
  * @protected
91
91
  */
92
- _loadMap(webMapInfo) {
92
+ async _loadMap(webMapInfo) {
93
93
  let id = webMapInfo === null || webMapInfo === void 0 ? void 0 : webMapInfo.id;
94
94
  // on the first render use the first child of the provided mapInfos
95
95
  this._webMapInfo = (id === "" || !id) && this.mapInfos.length > 0 ?
@@ -104,8 +104,12 @@ export class MapCard {
104
104
  map: webMap,
105
105
  resizeAlign: "top-left"
106
106
  });
107
- this._loadedId = id;
108
- this.mapChanged.emit(this.mapView);
107
+ await this.mapView.when(() => {
108
+ this._loadedId = id;
109
+ this._searchConfiguration = this._webMapInfo.searchConfiguration;
110
+ this.mapChanged.emit(this.mapView);
111
+ this.mapView.ui.add(this._mapTools, { position: "top-right", index: 0 });
112
+ });
109
113
  }
110
114
  }
111
115
  static get is() { return "map-card"; }
@@ -167,6 +171,7 @@ export class MapCard {
167
171
  }
168
172
  static get states() {
169
173
  return {
174
+ "_searchConfiguration": {},
170
175
  "_webMapInfo": {}
171
176
  };
172
177
  }
@@ -0,0 +1,24 @@
1
+ /** @license
2
+ * Copyright 2022 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ :host {
18
+ display: block;
19
+ }
20
+
21
+ .search-widget {
22
+ width: 100% !important;
23
+ border: 1px solid var(--calcite-ui-border-input);
24
+ }