@esri/solutions-components 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/dist/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  2. package/dist/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  3. package/dist/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  4. package/dist/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  5. package/dist/assets/arcgis-pdf-creator/grid.js +1 -1
  6. package/dist/assets/data/images/grid.png +0 -0
  7. package/dist/assets/data/images/horizontal.png +0 -0
  8. package/dist/assets/data/images/vertical.png +0 -0
  9. package/dist/assets/t9n/crowdsource-manager/resources.json +7 -1
  10. package/dist/assets/t9n/crowdsource-manager/resources_en.json +7 -1
  11. package/dist/cjs/buffer-tools_6.cjs.entry.js +85 -85
  12. package/dist/cjs/{calcite-block_2.cjs.entry.js → calcite-action-bar_4.cjs.entry.js} +307 -18
  13. package/dist/cjs/{calcite-action.cjs.entry.js → calcite-action_2.cjs.entry.js} +84 -1
  14. package/dist/cjs/{calcite-combobox_3.cjs.entry.js → calcite-chip_4.cjs.entry.js} +187 -61
  15. package/dist/cjs/{calcite-dropdown-group_4.cjs.entry.js → calcite-dropdown_5.cjs.entry.js} +467 -1
  16. package/dist/cjs/calcite-input-message_5.cjs.entry.js +283 -283
  17. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
  18. package/dist/cjs/{calcite-action-bar_2.cjs.entry.js → calcite-tooltip.cjs.entry.js} +2 -208
  19. package/dist/cjs/crowdsource-manager.cjs.entry.js +88 -14
  20. package/dist/cjs/{downloadUtils-b85476e8.js → downloadUtils-9359e9ff.js} +1218 -1127
  21. package/dist/cjs/{index.es-3ba50626.js → index.es-9c0d0ed6.js} +10682 -10682
  22. package/dist/cjs/{interfaces-17c631bf.js → interfaces-cac36920.js} +6 -0
  23. package/dist/cjs/layer-table_2.cjs.entry.js +512 -0
  24. package/dist/cjs/loader.cjs.js +30 -30
  25. package/dist/cjs/{mapViewUtils-df63bfa4.js → mapViewUtils-090f4d4d.js} +24 -24
  26. package/dist/cjs/public-notification.cjs.entry.js +69 -49
  27. package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
  28. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  29. package/dist/cjs/{solution-store-b86759b2.js → solution-store-d28c332e.js} +1 -1
  30. package/dist/cjs/solutions-components.cjs.js +31 -31
  31. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  32. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  33. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  34. package/dist/collection/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  35. package/dist/collection/assets/arcgis-pdf-creator/grid.js +1 -1
  36. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +122 -0
  37. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +130 -14
  38. package/dist/collection/components/layer-table/layer-table.css +2 -70
  39. package/dist/collection/components/layer-table/layer-table.js +66 -106
  40. package/dist/collection/components/map-card/map-card.css +4 -7
  41. package/dist/collection/components/map-card/map-card.js +44 -10
  42. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  43. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  44. package/dist/collection/components/public-notification/public-notification.js +45 -27
  45. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +1 -1
  46. package/dist/collection/demos/crowdsource-manager.html +14 -41
  47. package/dist/collection/utils/csvDownload.js +41 -0
  48. package/dist/collection/utils/csvDownload.ts +42 -0
  49. package/dist/collection/utils/csvUtils.js +6 -23
  50. package/dist/collection/utils/csvUtils.ts +8 -27
  51. package/dist/collection/utils/downloadUtils.js +30 -14
  52. package/dist/collection/utils/downloadUtils.ts +36 -14
  53. package/dist/collection/utils/interfaces.js +6 -0
  54. package/dist/collection/utils/interfaces.ts +6 -0
  55. package/dist/collection/utils/pdfUtils.js +9 -6
  56. package/dist/collection/utils/pdfUtils.ts +13 -8
  57. package/dist/collection/utils/test/csvUtils.spec.tsx +56 -0
  58. package/dist/collection/utils/test/downloadUtils.spec.tsx +133 -0
  59. package/dist/components/crowdsource-manager.js +293 -17
  60. package/dist/components/downloadUtils.js +133 -42
  61. package/dist/components/interfaces3.js +7 -1
  62. package/dist/components/layer-table.js +1 -443
  63. package/dist/components/layer-table2.js +429 -0
  64. package/dist/components/map-card.js +1 -339
  65. package/dist/{esm/map-card.entry.js → components/map-card2.js} +118 -22
  66. package/dist/components/map-draw-tools2.js +16 -16
  67. package/dist/components/map-layer-picker2.js +1 -1
  68. package/dist/components/map-select-tools2.js +38 -38
  69. package/dist/components/public-notification.js +102 -82
  70. package/dist/components/queryUtils.js +10 -10
  71. package/dist/components/refine-selection-tools2.js +3 -3
  72. package/dist/components/refine-selection2.js +1 -1
  73. package/dist/components/solution-resource-item2.js +1 -1
  74. package/dist/components/solution-store.js +1 -1
  75. package/dist/esm/buffer-tools_6.entry.js +76 -76
  76. package/dist/esm/{calcite-block_2.entry.js → calcite-action-bar_4.entry.js} +307 -20
  77. package/dist/esm/{calcite-action.entry.js → calcite-action_2.entry.js} +84 -2
  78. package/dist/esm/{calcite-combobox_3.entry.js → calcite-chip_4.entry.js} +181 -56
  79. package/dist/esm/{calcite-dropdown-group_4.entry.js → calcite-dropdown_5.entry.js} +468 -3
  80. package/dist/esm/calcite-input-message_5.entry.js +275 -275
  81. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  82. package/dist/esm/{calcite-action-bar_2.entry.js → calcite-tooltip.entry.js} +4 -209
  83. package/dist/esm/crowdsource-manager.entry.js +88 -14
  84. package/dist/esm/{downloadUtils-f278742f.js → downloadUtils-a8f139c5.js} +1214 -1123
  85. package/dist/esm/{index.es-6f3a1143.js → index.es-a75412ff.js} +10596 -10596
  86. package/dist/esm/{interfaces-d0d83efa.js → interfaces-cd4054e5.js} +7 -1
  87. package/dist/esm/layer-table_2.entry.js +507 -0
  88. package/dist/esm/loader.js +26 -26
  89. package/dist/esm/{mapViewUtils-bd1809f0.js → mapViewUtils-8ffcd36d.js} +12 -12
  90. package/dist/esm/public-notification.entry.js +65 -45
  91. package/dist/esm/solution-configuration.entry.js +2 -2
  92. package/dist/esm/solution-contents_3.entry.js +2 -2
  93. package/dist/esm/{solution-store-477288ac.js → solution-store-1b67f2c8.js} +1 -1
  94. package/dist/esm/solutions-components.js +26 -26
  95. package/dist/solutions-components/demos/crowdsource-manager.html +14 -41
  96. package/dist/solutions-components/{p-dd11eeb2.js → p-1395b0ef.js} +1 -1
  97. package/dist/solutions-components/{p-cbac29fb.entry.js → p-1affd711.entry.js} +18 -18
  98. package/dist/solutions-components/p-30de8da1.entry.js +17 -0
  99. package/dist/solutions-components/{p-91cad71e.entry.js → p-439c878d.entry.js} +3 -9
  100. package/dist/solutions-components/{p-03e2c6fd.js → p-765a27f3.js} +60 -60
  101. package/dist/solutions-components/p-813a04c3.entry.js +6 -0
  102. package/dist/solutions-components/{p-9e8a371f.entry.js → p-874b39a7.entry.js} +3 -3
  103. package/dist/solutions-components/p-8cece97f.js +21 -0
  104. package/dist/solutions-components/{p-dd0241fb.entry.js → p-97aa7211.entry.js} +1 -1
  105. package/dist/solutions-components/{p-0e459cc7.entry.js → p-a955a3e6.entry.js} +10 -4
  106. package/dist/solutions-components/{p-40c12650.js → p-bb64bd47.js} +453 -437
  107. package/dist/solutions-components/{p-70e1d4d8.entry.js → p-c392dd95.entry.js} +17 -17
  108. package/dist/solutions-components/p-ca386a72.entry.js +6 -0
  109. package/dist/solutions-components/p-d47d74a6.entry.js +23 -0
  110. package/dist/solutions-components/p-db846ee2.entry.js +11 -0
  111. package/dist/solutions-components/{p-88e5a76d.js → p-dc53c9c1.js} +36 -36
  112. package/dist/solutions-components/p-e1c93241.entry.js +6 -0
  113. package/dist/solutions-components/{p-4cbaf0f1.entry.js → p-e6d235d6.entry.js} +1 -1
  114. package/dist/solutions-components/solutions-components.esm.js +6 -6
  115. package/dist/solutions-components/utils/csvDownload.ts +42 -0
  116. package/dist/solutions-components/utils/csvUtils.ts +8 -27
  117. package/dist/solutions-components/utils/downloadUtils.ts +36 -14
  118. package/dist/solutions-components/utils/interfaces.ts +6 -0
  119. package/dist/solutions-components/utils/pdfUtils.ts +13 -8
  120. package/dist/solutions-components/utils/test/csvUtils.spec.tsx +56 -0
  121. package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +133 -0
  122. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +39 -0
  123. package/dist/types/components/layer-table/layer-table.d.ts +35 -48
  124. package/dist/types/components/map-card/map-card.d.ts +10 -6
  125. package/dist/types/components/public-notification/public-notification.d.ts +18 -6
  126. package/dist/types/components.d.ts +1621 -1601
  127. package/dist/types/preact.d.ts +2 -1
  128. package/dist/types/utils/csvDownload.d.ts +24 -0
  129. package/dist/types/utils/csvUtils.d.ts +2 -1
  130. package/dist/types/utils/downloadUtils.d.ts +25 -0
  131. package/dist/types/utils/interfaces.d.ts +5 -0
  132. package/dist/types/utils/pdfUtils.d.ts +2 -1
  133. package/package.json +4 -4
  134. package/dist/cjs/calcite-chip.cjs.entry.js +0 -142
  135. package/dist/cjs/calcite-dropdown.cjs.entry.js +0 -481
  136. package/dist/cjs/calcite-handle.cjs.entry.js +0 -99
  137. package/dist/cjs/calcite-loader.cjs.entry.js +0 -95
  138. package/dist/cjs/layer-table.cjs.entry.js +0 -317
  139. package/dist/cjs/map-card.cjs.entry.js +0 -252
  140. package/dist/esm/calcite-chip.entry.js +0 -138
  141. package/dist/esm/calcite-dropdown.entry.js +0 -477
  142. package/dist/esm/calcite-handle.entry.js +0 -95
  143. package/dist/esm/calcite-loader.entry.js +0 -91
  144. package/dist/esm/layer-table.entry.js +0 -313
  145. package/dist/solutions-components/p-045d3988.entry.js +0 -12
  146. package/dist/solutions-components/p-11132485.entry.js +0 -11
  147. package/dist/solutions-components/p-15b43c29.entry.js +0 -11
  148. package/dist/solutions-components/p-5034aabc.entry.js +0 -11
  149. package/dist/solutions-components/p-6f012424.entry.js +0 -6
  150. package/dist/solutions-components/p-7fd10eb3.entry.js +0 -11
  151. package/dist/solutions-components/p-a57ef371.entry.js +0 -6
  152. package/dist/solutions-components/p-bc39f296.entry.js +0 -6
  153. package/dist/solutions-components/p-c93d8e80.entry.js +0 -6
  154. package/dist/solutions-components/p-dbc9a5a8.js +0 -21
  155. package/dist/solutions-components/p-f5c70be2.entry.js +0 -6
  156. package/dist/solutions-components/p-f6b17cc6.entry.js +0 -11
@@ -1,317 +0,0 @@
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
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- const index = require('./index-c6979cbb.js');
11
- const locale = require('./locale-04da9a8c.js');
12
- const mapViewUtils = require('./mapViewUtils-df63bfa4.js');
13
- const downloadUtils = require('./downloadUtils-b85476e8.js');
14
- require('./_commonjsHelpers-384729db.js');
15
- require('./interfaces-17c631bf.js');
16
- require('./loadModules-0806a34f.js');
17
-
18
- const layerTableCss = ":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";
19
-
20
- const LayerTable = class {
21
- constructor(hostRef) {
22
- index.registerInstance(this, hostRef);
23
- /**
24
- * esri/Graphic[]: https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html
25
- */
26
- this._graphics = [];
27
- /**
28
- * string[]: List of field names to display
29
- */
30
- this._fieldNames = [];
31
- this.mapView = undefined;
32
- this._translations = undefined;
33
- this._selectedIndexes = [];
34
- }
35
- //--------------------------------------------------------------------------
36
- //
37
- // Watch handlers
38
- //
39
- //--------------------------------------------------------------------------
40
- //--------------------------------------------------------------------------
41
- //
42
- // Methods (public)
43
- //
44
- //--------------------------------------------------------------------------
45
- //--------------------------------------------------------------------------
46
- //
47
- // Events (public)
48
- //
49
- //--------------------------------------------------------------------------
50
- //--------------------------------------------------------------------------
51
- //
52
- // Functions (lifecycle)
53
- //
54
- //--------------------------------------------------------------------------
55
- /**
56
- * StencilJS: Called once just after the component is first connected to the DOM.
57
- *
58
- * @returns Promise when complete
59
- */
60
- async componentWillLoad() {
61
- await this._getTranslations();
62
- }
63
- /**
64
- * Renders the component.
65
- */
66
- render() {
67
- return (index.h(index.Host, null, this._getTableControlRow(), index.h("div", { class: "data-container" }, index.h("div", { class: "table-container" }, index.h("div", { class: "table" }, this._getTableHeader(), this._getTableRows()))), index.h("edit-record-modal", { ref: (el) => this._editMultipleMpdal = el })));
68
- }
69
- //--------------------------------------------------------------------------
70
- //
71
- // Functions (protected)
72
- //
73
- //--------------------------------------------------------------------------
74
- /**
75
- * Gets a row of controls that can be used for various interactions with the table
76
- *
77
- * @returns The dom node that contains the controls
78
- */
79
- _getTableControlRow() {
80
- const featuresSelected = this._selectedIndexes.length > 0;
81
- const multiFeaturesSelected = this._selectedIndexes.length > 1;
82
- return (index.h("div", { class: "display-flex table-border" }, index.h("map-layer-picker", { mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt) }), index.h("div", null, index.h("calcite-button", { appearance: 'transparent', color: 'neutral', disabled: !featuresSelected, iconStart: 'magnifying-glass', onClick: () => this._zoom() }, this._translations.zoom), index.h("calcite-button", { appearance: 'transparent', color: 'neutral', disabled: !multiFeaturesSelected, iconStart: 'pencil', onClick: () => this._editMultiple() }, this._translations.editMultiple), index.h("calcite-button", { appearance: 'transparent', color: 'neutral', disabled: !featuresSelected, iconStart: 'trash', onClick: () => this._delete() }, this._translations.delete), index.h("calcite-split-button", { appearance: "transparent", color: "neutral", "primary-text": this._translations.more }, index.h("calcite-dropdown-group", { "selection-mode": "none" }, index.h("calcite-dropdown-item", { iconStart: 'list-check-all', onClick: () => this._selectAll(true) }, this._translations.selectAll), index.h("calcite-dropdown-item", { iconStart: 'selected-items-filter', onClick: () => this._showSelected() }, this._translations.showSelected), index.h("calcite-dropdown-item", { iconStart: 'erase', onClick: () => this._clearSelection() }, this._translations.clearSelection), index.h("calcite-dropdown-item", { iconStart: 'refresh', onClick: () => this._switchSelected() }, this._translations.switchSelected), index.h("calcite-dropdown-item", { iconStart: 'export', onClick: () => this._exportToCSV() }, this._translations.exportCSV))))));
83
- }
84
- /**
85
- * Gets the table header with a select all control and column headers for each field
86
- *
87
- * @returns The dom node that contains the header
88
- */
89
- _getTableHeader() {
90
- return (index.h("div", { class: "header" }, index.h("div", { class: "table-header-cell padding-3-4" }, index.h("calcite-checkbox", { class: "display-flex justify-center", onClick: () => this._selectAll(this._selectAllElement.checked), ref: (el) => this._selectAllElement = el })), this._fieldNames.map(name => this._getTableHeaderCell(name))));
91
- }
92
- /**
93
- * Gets a header cell for the table header
94
- *
95
- * @param name the string to display in the cell
96
- *
97
- * @returns The dom node that contains the header cell
98
- */
99
- _getTableHeaderCell(name) {
100
- return (index.h("div", { class: "table-header-cell field-width" }, name));
101
- }
102
- /**
103
- * Gets the table rows for all features
104
- *
105
- * @returns The dom node that contains the body of the table
106
- */
107
- _getTableRows() {
108
- return (index.h("div", { class: "table-body" }, this._graphics.map((g, i) => this._getTableRow(g, i))));
109
- }
110
- /**
111
- * Gets the individual table row for a feature
112
- *
113
- * @param g the graphic the row is based on
114
- * @param index the index location of the row within the table
115
- *
116
- * @returns The dom node that contains the row
117
- */
118
- _getTableRow(g, index$1) {
119
- // TODO think through this more...should build the fieldType info once up front rather
120
- // than on every single value...
121
- const checked = this._selectedIndexes.indexOf(index$1) > -1;
122
- return (index.h("div", { class: "row" }, index.h("div", { class: "table-cell table-border padding-3-4" }, index.h("calcite-checkbox", { checked: checked, class: "display-flex justify-center", onClick: () => this._rowSelected(index$1), value: index$1 })), this._fieldNames.map(name => {
123
- const field = this._layerView.layer.fieldsIndex.get(name);
124
- return this._getTableRowCell(g.attributes[name], field, checked);
125
- })));
126
- }
127
- /**
128
- * Gets the individual table cell for the provided field
129
- *
130
- * @param v the value to display
131
- * @param field the field the row is based on
132
- * @param rowSelected when true editable fields will render a control that will allow the value to be updated
133
- *
134
- * @returns The dom node that contains the table cell
135
- */
136
- _getTableRowCell(v, field, rowSelected) {
137
- const editable = field.editable && rowSelected;
138
- const inputType = this._getInputType(field.type);
139
- // TODO find some domain data to test with..this has not been tested
140
- let domainInput;
141
- const domain = field.domain;
142
- if (domain) {
143
- if (domain.type === "coded-value") {
144
- domainInput = (index.h("calcite-select", { label: '' }, domain.codedValues.map(cv => {
145
- return (index.h("calcite-option", { label: cv.name, selected: v === cv.code.toString(), value: cv.code }));
146
- })));
147
- }
148
- else {
149
- // range domain
150
- const range = domain;
151
- domainInput = (index.h("calcite-input", { max: range.maxValue, min: range.minValue, type: "number", value: v }));
152
- }
153
- }
154
- return (index.h("div", { class: "table-cell table-border field-width" }, editable && domainInput ? domainInput : editable ? (index.h("calcite-input", { type: inputType, value: v })) : v));
155
- }
156
- /**
157
- * Simple lookup that will get the appropriate edit control for the value type
158
- *
159
- * @param type the Esri field type
160
- *
161
- * @returns A string for the type of control to create based on the provided field type
162
- */
163
- _getInputType(type) {
164
- // JS API field types
165
- // "string" | "small-integer" | "integer" | "single" | "double" | "long" | "date" | "oid" | "geometry" | "blob" | "raster" | "guid" | "global-id" | "xml"
166
- // not sure about these: "geometry" | "blob" | "raster" | | "xml"
167
- // Calcite input types
168
- // color date datetime-local email file image month number password search tel text(default) textarea time url week
169
- const inputTypes = {
170
- "string": 'text',
171
- "small-integer": "number",
172
- "integer": "number",
173
- "single": "number",
174
- "double": "number",
175
- "long": "number",
176
- "date": "datetime-local",
177
- "oid": "number",
178
- "guid": "text",
179
- "global-id": "text"
180
- };
181
- return Object.keys(inputTypes).indexOf(type) > -1 ? inputTypes[type] : "text";
182
- }
183
- /**
184
- * Select or deselect all rows
185
- *
186
- * @param checked When true all rows will be selected
187
- *
188
- * @returns void
189
- */
190
- _selectAll(checked) {
191
- this._selectedIndexes = checked ? this._graphics.map((_g, i) => i) : [];
192
- }
193
- // need to discuss with team
194
- _showSelected() {
195
- console.log("_showSelected");
196
- }
197
- /**
198
- * Clears the selected indexes
199
- *
200
- * @returns void
201
- */
202
- _clearSelection() {
203
- this._selectedIndexes = [];
204
- }
205
- /**
206
- * Select all rows that are not currently selectd
207
- *
208
- * @returns void
209
- */
210
- _switchSelected() {
211
- const currentIndexes = [...this._selectedIndexes];
212
- this._selectedIndexes = this._graphics.reduce((prev, _cur, i) => {
213
- if (currentIndexes.indexOf(i) < 0) {
214
- prev.push(i);
215
- }
216
- return prev;
217
- }, []);
218
- }
219
- /**
220
- * Export all selected rows as CSV
221
- *
222
- * @returns a promise that will resolve when the operation is complete
223
- */
224
- async _exportToCSV() {
225
- return downloadUtils.downloadCSV([], this._layerView.layer, this._getSelectedIds(), false, // formatUsingLayerPopup
226
- false, // removeDuplicates
227
- true);
228
- }
229
- /**
230
- * Zoom to all selected features
231
- *
232
- * @returns a promise that will resolve when the operation is complete
233
- */
234
- _zoom() {
235
- const ids = this._getSelectedIds();
236
- void mapViewUtils.goToSelection(ids, this._layerView, this.mapView, true);
237
- }
238
- /**
239
- * Open the edit multiple modal
240
- *
241
- * @returns void
242
- */
243
- _editMultiple() {
244
- this._editMultipleMpdal.open = true;
245
- }
246
- /**
247
- * Delete all selected records
248
- *
249
- * @returns a promise that will resolve when the operation is complete
250
- */
251
- _delete() {
252
- console.log("delete");
253
- }
254
- /**
255
- * Get the graphics for all selected indexes
256
- *
257
- * @param indexes the indexes for the graphics to fetch
258
- *
259
- * @returns An array of selected graphics
260
- */
261
- _getGraphics(indexes) {
262
- return this._graphics.filter((_g, i) => indexes.indexOf(i) > -1);
263
- }
264
- /**
265
- * Gets the object ids for all selected rows
266
- *
267
- * @returns An array of object ids
268
- */
269
- _getSelectedIds() {
270
- const graphics = this._getGraphics(this._selectedIndexes);
271
- return graphics.map(g => g.getObjectId());
272
- }
273
- /**
274
- * Update the selected indexes based on the current row
275
- *
276
- * @param index the index of the selected row
277
- *
278
- * @returns void
279
- */
280
- _rowSelected(index) {
281
- const indexOfSelected = this._selectedIndexes.indexOf(index);
282
- if (indexOfSelected > -1) {
283
- this._selectedIndexes.splice(indexOfSelected, 1);
284
- this._selectedIndexes = [...this._selectedIndexes];
285
- }
286
- else {
287
- this._selectedIndexes = [...this._selectedIndexes, index];
288
- }
289
- }
290
- /**
291
- * Handles layer selection change to show new table
292
- *
293
- * @returns a promise that will resolve when the operation is complete
294
- */
295
- async _layerSelectionChanged(evt) {
296
- const layerName = evt.detail[0];
297
- this._layerView = await mapViewUtils.getMapLayerView(this.mapView, layerName);
298
- // TODO rethink this...when we use later we need to be able to lookup with name
299
- this._fieldNames = this._layerView.layer.fields.map(f => f.alias || f.name);
300
- this._graphics = await mapViewUtils.queryAllFeatures(0, this._layerView.layer, []);
301
- this._selectedIndexes = [];
302
- }
303
- /**
304
- * Fetches the component's translations
305
- *
306
- * @returns Promise when complete
307
- * @protected
308
- */
309
- async _getTranslations() {
310
- const messages = await locale.getLocaleComponentStrings(this.el);
311
- this._translations = messages[0];
312
- }
313
- get el() { return index.getElement(this); }
314
- };
315
- LayerTable.style = layerTableCss;
316
-
317
- exports.layer_table = LayerTable;
@@ -1,252 +0,0 @@
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
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- const index = require('./index-c6979cbb.js');
11
- const loadModules = require('./loadModules-0806a34f.js');
12
- const locale = require('./locale-04da9a8c.js');
13
- const interfaces = require('./interfaces-17c631bf.js');
14
- require('./_commonjsHelpers-384729db.js');
15
-
16
- const mapCardCss = ":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.action-bar-size{height:3.5rem;width:100%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.width-1-7{width:14.28%}.width-1-6{width:16.66%}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.block-button{border-bottom:0}.block-button:hover{background-color:var(--calcite-ui-foreground-2)}.block-button:active{background-color:var(--calcite-ui-foreground-3)}.map-view{padding:0;margin:0;height:100%;width:100%}.map-list{position:absolute;inset:3.5rem 0 0 0;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background);z-index:1;width:100%;height:-moz-fit-content;height:fit-content}.map-height{height:calc(100% - 58px)}.display-none{display:none}.esri-zoom{display:none !important}";
17
-
18
- const MapCard = class {
19
- constructor(hostRef) {
20
- index.registerInstance(this, hostRef);
21
- this.expandMap = index.createEvent(this, "expandMap", 7);
22
- /**
23
- * string: the id of map currently displayed
24
- */
25
- this._loadedId = "";
26
- /**
27
- * string: the id of the container div for the map
28
- */
29
- this._mapDivId = "map-div";
30
- this.mapInfos = [];
31
- this._mapListExpanded = false;
32
- this._mapView = undefined;
33
- this._translations = undefined;
34
- this._webMapId = "";
35
- }
36
- //--------------------------------------------------------------------------
37
- //
38
- // Watch handlers
39
- //
40
- //--------------------------------------------------------------------------
41
- /**
42
- * Called each time the _webMapId prop is changed.
43
- */
44
- _webMapIdWatchHandler(v, oldV) {
45
- if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
46
- this._loadMap(v);
47
- }
48
- }
49
- /**
50
- * Called each time the mapInfos prop is changed.
51
- */
52
- mapInfosWatchHandler(v, oldV) {
53
- if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
54
- this._loadMap(v[0].id);
55
- }
56
- }
57
- //--------------------------------------------------------------------------
58
- //
59
- // Functions (lifecycle)
60
- //
61
- //--------------------------------------------------------------------------
62
- /**
63
- * StencilJS: Called once just after the component is first connected to the DOM.
64
- */
65
- async componentWillLoad() {
66
- await this._getTranslations();
67
- await this._initModules();
68
- }
69
- /**
70
- * StencilJS: Called after every render.
71
- */
72
- componentDidRender() {
73
- // the container node for the map view needs to exist before the view is created
74
- this._loadMap(this._webMapId);
75
- }
76
- /**
77
- * Renders the component.
78
- */
79
- render() {
80
- return (index.h(index.Host, null, this._getToolbar(), this._getMapNameList(this._mapListExpanded), index.h("div", { class: "map-height", id: this._mapDivId })));
81
- }
82
- //--------------------------------------------------------------------------
83
- //
84
- // Functions (protected)
85
- //
86
- //--------------------------------------------------------------------------
87
- /**
88
- * Load esri javascript api modules
89
- *
90
- * @returns Promise resolving when function is done
91
- *
92
- * @protected
93
- */
94
- async _initModules() {
95
- const [WebMap, MapView] = await loadModules.loadModules([
96
- "esri/WebMap",
97
- "esri/views/MapView"
98
- ]);
99
- this.WebMap = WebMap;
100
- this.MapView = MapView;
101
- }
102
- /**
103
- * Create the toolbar (controls used for map and app interactions)
104
- *
105
- * @returns The dom node with the toolbar
106
- *
107
- * @protected
108
- */
109
- _getToolbar() {
110
- return (index.h("div", { class: "display-flex" }, index.h("calcite-action-bar", { class: "border-bottom-1 action-bar-size", "expand-disabled": true, layout: "horizontal", slot: "header" }, this._getMapPicker(), this._getActionGroup("home", false, this._translations.home, () => this._goHome()), this._getActionGroup("list", false, this._translations.list, () => this._showList()), this._getActionGroup("magnifying-glass-plus", false, this._translations.search, () => this._search()), this._getActionGroup("plus", false, this._translations.zoomIn, () => this._zoomIn()), this._getActionGroup("minus", false, this._translations.zoomOut, () => this._zoomOut()), this._getActionGroup("expand", false, this._translations.expand, () => this._expand()))));
111
- }
112
- /**
113
- * Load the webmap for the provided id
114
- *
115
- * @param id the webmap id to load
116
- *
117
- * @returns void
118
- *
119
- * @protected
120
- */
121
- _loadMap(id) {
122
- // on the first render use the first child of the provided mapInfos
123
- if (id === "" && this.mapInfos.length > 0) {
124
- id = this.mapInfos[0].id;
125
- }
126
- if (this._loadedId !== id) {
127
- const webMap = new this.WebMap({
128
- portalItem: { id }
129
- });
130
- this._mapView = new this.MapView({
131
- container: this._mapDivId,
132
- map: webMap,
133
- // TODO consider this more...seems to cause less overflow issues when the component is resized
134
- resizeAlign: "top-left"
135
- });
136
- this._loadedId = id;
137
- }
138
- }
139
- /**
140
- * Get a calcite action group for the current action
141
- *
142
- * @param icon the icon to display for the current action
143
- * @param disabled should the action be disabled
144
- * @param tip information tip to display helpful details to end user
145
- * @param func the associated onClick function to execute
146
- *
147
- * @returns the dom node for the action group
148
- *
149
- * @protected
150
- */
151
- _getActionGroup(icon, disabled, tip, func) {
152
- return (index.h("calcite-action-group", { class: "action-center width-1-6", layout: "horizontal" }, index.h("calcite-action", { alignment: "center", class: "width-full height-full", compact: false, disabled: disabled, icon: icon, id: icon, onClick: func, text: "" }, index.h("calcite-icon", { icon: "cheveron-up", scale: "s", slot: "icon" })), index.h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, index.h("span", null, tip))));
153
- }
154
- /**
155
- * Get a calcite action group for the map list
156
- * Actions do not support multiple icons so this uses a block
157
- *
158
- * @returns the dom node for the action group
159
- *
160
- * @protected
161
- */
162
- _getMapPicker() {
163
- const mapListIcon = this._mapListExpanded ? "chevron-up" : "chevron-down";
164
- return (index.h("calcite-action-group", { class: "action-center width-1-6", layout: "horizontal" }, index.h("calcite-block", { class: "action-center block-button width-full height-full", heading: '', onClick: () => this._chooseMap() }, index.h("calcite-icon", { icon: "map", scale: "s", slot: "icon" }), index.h("calcite-icon", { icon: mapListIcon, scale: "s", slot: "icon" }), index.h("calcite-tooltip", { label: "", placement: "bottom" }, index.h("span", null, this._translations.mapName)))));
165
- }
166
- /**
167
- * Get a pick list for all maps in mapInfos
168
- *
169
- * @param show boolean to indicate if the list should be shown or hidden
170
- *
171
- * @returns the dom node for the list of maps
172
- *
173
- * @protected
174
- */
175
- _getMapNameList(show) {
176
- const listClass = show ? "map-list" : "display-none";
177
- return (index.h("div", { class: listClass }, index.h("calcite-pick-list", { id: "mapList" }, this.mapInfos.map(mapInfo => {
178
- return (index.h("calcite-pick-list-item", { label: mapInfo.name, onClick: () => this._webMapSelected(mapInfo.id), selected: mapInfo.id === this._loadedId, value: mapInfo.id }));
179
- }))));
180
- }
181
- /**
182
- * Fired when the user clicks on the map list
183
- *
184
- * @param id the web map id selected from the list
185
- *
186
- * @returns void
187
- *
188
- * @protected
189
- */
190
- _webMapSelected(id) {
191
- this._mapListExpanded = false;
192
- this._webMapId = id;
193
- }
194
- /**
195
- * Toggles the open/close state of the map list
196
- *
197
- * @returns the dom node for the action group
198
- *
199
- * @protected
200
- */
201
- _chooseMap() {
202
- this._mapListExpanded = !this._mapListExpanded;
203
- }
204
- // Need to discuss this with the team
205
- _goHome() {
206
- alert("go home");
207
- }
208
- // need to discuss this with the team
209
- _showList() {
210
- alert("show list");
211
- }
212
- // Need to discuss this with the team
213
- _search() {
214
- alert("search");
215
- }
216
- // Need to explore map fixed zoom in considerations
217
- _zoomIn() {
218
- alert("zoom in");
219
- }
220
- // Need to explore map fixed zoom out considerations
221
- _zoomOut() {
222
- alert("zoom out");
223
- }
224
- /**
225
- * Emit the expand map event
226
- *
227
- * @returns void
228
- *
229
- * @protected
230
- */
231
- _expand() {
232
- this.expandMap.emit(interfaces.EExpandType.EXPAND);
233
- }
234
- /**
235
- * Fetches the component's translations
236
- *
237
- * @returns Promise when complete
238
- * @protected
239
- */
240
- async _getTranslations() {
241
- const messages = await locale.getLocaleComponentStrings(this.el);
242
- this._translations = messages[0];
243
- }
244
- get el() { return index.getElement(this); }
245
- static get watchers() { return {
246
- "_webMapId": ["_webMapIdWatchHandler"],
247
- "mapInfos": ["mapInfosWatchHandler"]
248
- }; }
249
- };
250
- MapCard.style = mapCardCss;
251
-
252
- exports.map_card = MapCard;