@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.
- package/dist/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
- package/dist/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
- package/dist/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
- package/dist/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
- package/dist/assets/arcgis-pdf-creator/grid.js +1 -1
- package/dist/assets/data/images/grid.png +0 -0
- package/dist/assets/data/images/horizontal.png +0 -0
- package/dist/assets/data/images/vertical.png +0 -0
- package/dist/assets/t9n/crowdsource-manager/resources.json +7 -1
- package/dist/assets/t9n/crowdsource-manager/resources_en.json +7 -1
- package/dist/cjs/buffer-tools_6.cjs.entry.js +85 -85
- package/dist/cjs/{calcite-block_2.cjs.entry.js → calcite-action-bar_4.cjs.entry.js} +307 -18
- package/dist/cjs/{calcite-action.cjs.entry.js → calcite-action_2.cjs.entry.js} +84 -1
- package/dist/cjs/{calcite-combobox_3.cjs.entry.js → calcite-chip_4.cjs.entry.js} +187 -61
- package/dist/cjs/{calcite-dropdown-group_4.cjs.entry.js → calcite-dropdown_5.cjs.entry.js} +467 -1
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +283 -283
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/{calcite-action-bar_2.cjs.entry.js → calcite-tooltip.cjs.entry.js} +2 -208
- package/dist/cjs/crowdsource-manager.cjs.entry.js +88 -14
- package/dist/cjs/{downloadUtils-b85476e8.js → downloadUtils-9359e9ff.js} +1218 -1127
- package/dist/cjs/{index.es-3ba50626.js → index.es-9c0d0ed6.js} +10682 -10682
- package/dist/cjs/{interfaces-17c631bf.js → interfaces-cac36920.js} +6 -0
- package/dist/cjs/layer-table_2.cjs.entry.js +512 -0
- package/dist/cjs/loader.cjs.js +30 -30
- package/dist/cjs/{mapViewUtils-df63bfa4.js → mapViewUtils-090f4d4d.js} +24 -24
- package/dist/cjs/public-notification.cjs.entry.js +69 -49
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-b86759b2.js → solution-store-d28c332e.js} +1 -1
- package/dist/cjs/solutions-components.cjs.js +31 -31
- package/dist/collection/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
- package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
- package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
- package/dist/collection/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
- package/dist/collection/assets/arcgis-pdf-creator/grid.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +122 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +130 -14
- package/dist/collection/components/layer-table/layer-table.css +2 -70
- package/dist/collection/components/layer-table/layer-table.js +66 -106
- package/dist/collection/components/map-card/map-card.css +4 -7
- package/dist/collection/components/map-card/map-card.js +44 -10
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
- package/dist/collection/components/public-notification/public-notification.js +45 -27
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +1 -1
- package/dist/collection/demos/crowdsource-manager.html +14 -41
- package/dist/collection/utils/csvDownload.js +41 -0
- package/dist/collection/utils/csvDownload.ts +42 -0
- package/dist/collection/utils/csvUtils.js +6 -23
- package/dist/collection/utils/csvUtils.ts +8 -27
- package/dist/collection/utils/downloadUtils.js +30 -14
- package/dist/collection/utils/downloadUtils.ts +36 -14
- package/dist/collection/utils/interfaces.js +6 -0
- package/dist/collection/utils/interfaces.ts +6 -0
- package/dist/collection/utils/pdfUtils.js +9 -6
- package/dist/collection/utils/pdfUtils.ts +13 -8
- package/dist/collection/utils/test/csvUtils.spec.tsx +56 -0
- package/dist/collection/utils/test/downloadUtils.spec.tsx +133 -0
- package/dist/components/crowdsource-manager.js +293 -17
- package/dist/components/downloadUtils.js +133 -42
- package/dist/components/interfaces3.js +7 -1
- package/dist/components/layer-table.js +1 -443
- package/dist/components/layer-table2.js +429 -0
- package/dist/components/map-card.js +1 -339
- package/dist/{esm/map-card.entry.js → components/map-card2.js} +118 -22
- package/dist/components/map-draw-tools2.js +16 -16
- package/dist/components/map-layer-picker2.js +1 -1
- package/dist/components/map-select-tools2.js +38 -38
- package/dist/components/public-notification.js +102 -82
- package/dist/components/queryUtils.js +10 -10
- package/dist/components/refine-selection-tools2.js +3 -3
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/solution-resource-item2.js +1 -1
- package/dist/components/solution-store.js +1 -1
- package/dist/esm/buffer-tools_6.entry.js +76 -76
- package/dist/esm/{calcite-block_2.entry.js → calcite-action-bar_4.entry.js} +307 -20
- package/dist/esm/{calcite-action.entry.js → calcite-action_2.entry.js} +84 -2
- package/dist/esm/{calcite-combobox_3.entry.js → calcite-chip_4.entry.js} +181 -56
- package/dist/esm/{calcite-dropdown-group_4.entry.js → calcite-dropdown_5.entry.js} +468 -3
- package/dist/esm/calcite-input-message_5.entry.js +275 -275
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/{calcite-action-bar_2.entry.js → calcite-tooltip.entry.js} +4 -209
- package/dist/esm/crowdsource-manager.entry.js +88 -14
- package/dist/esm/{downloadUtils-f278742f.js → downloadUtils-a8f139c5.js} +1214 -1123
- package/dist/esm/{index.es-6f3a1143.js → index.es-a75412ff.js} +10596 -10596
- package/dist/esm/{interfaces-d0d83efa.js → interfaces-cd4054e5.js} +7 -1
- package/dist/esm/layer-table_2.entry.js +507 -0
- package/dist/esm/loader.js +26 -26
- package/dist/esm/{mapViewUtils-bd1809f0.js → mapViewUtils-8ffcd36d.js} +12 -12
- package/dist/esm/public-notification.entry.js +65 -45
- package/dist/esm/solution-configuration.entry.js +2 -2
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-477288ac.js → solution-store-1b67f2c8.js} +1 -1
- package/dist/esm/solutions-components.js +26 -26
- package/dist/solutions-components/demos/crowdsource-manager.html +14 -41
- package/dist/solutions-components/{p-dd11eeb2.js → p-1395b0ef.js} +1 -1
- package/dist/solutions-components/{p-cbac29fb.entry.js → p-1affd711.entry.js} +18 -18
- package/dist/solutions-components/p-30de8da1.entry.js +17 -0
- package/dist/solutions-components/{p-91cad71e.entry.js → p-439c878d.entry.js} +3 -9
- package/dist/solutions-components/{p-03e2c6fd.js → p-765a27f3.js} +60 -60
- package/dist/solutions-components/p-813a04c3.entry.js +6 -0
- package/dist/solutions-components/{p-9e8a371f.entry.js → p-874b39a7.entry.js} +3 -3
- package/dist/solutions-components/p-8cece97f.js +21 -0
- package/dist/solutions-components/{p-dd0241fb.entry.js → p-97aa7211.entry.js} +1 -1
- package/dist/solutions-components/{p-0e459cc7.entry.js → p-a955a3e6.entry.js} +10 -4
- package/dist/solutions-components/{p-40c12650.js → p-bb64bd47.js} +453 -437
- package/dist/solutions-components/{p-70e1d4d8.entry.js → p-c392dd95.entry.js} +17 -17
- package/dist/solutions-components/p-ca386a72.entry.js +6 -0
- package/dist/solutions-components/p-d47d74a6.entry.js +23 -0
- package/dist/solutions-components/p-db846ee2.entry.js +11 -0
- package/dist/solutions-components/{p-88e5a76d.js → p-dc53c9c1.js} +36 -36
- package/dist/solutions-components/p-e1c93241.entry.js +6 -0
- package/dist/solutions-components/{p-4cbaf0f1.entry.js → p-e6d235d6.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +6 -6
- package/dist/solutions-components/utils/csvDownload.ts +42 -0
- package/dist/solutions-components/utils/csvUtils.ts +8 -27
- package/dist/solutions-components/utils/downloadUtils.ts +36 -14
- package/dist/solutions-components/utils/interfaces.ts +6 -0
- package/dist/solutions-components/utils/pdfUtils.ts +13 -8
- package/dist/solutions-components/utils/test/csvUtils.spec.tsx +56 -0
- package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +133 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +39 -0
- package/dist/types/components/layer-table/layer-table.d.ts +35 -48
- package/dist/types/components/map-card/map-card.d.ts +10 -6
- package/dist/types/components/public-notification/public-notification.d.ts +18 -6
- package/dist/types/components.d.ts +1621 -1601
- package/dist/types/preact.d.ts +2 -1
- package/dist/types/utils/csvDownload.d.ts +24 -0
- package/dist/types/utils/csvUtils.d.ts +2 -1
- package/dist/types/utils/downloadUtils.d.ts +25 -0
- package/dist/types/utils/interfaces.d.ts +5 -0
- package/dist/types/utils/pdfUtils.d.ts +2 -1
- package/package.json +4 -4
- package/dist/cjs/calcite-chip.cjs.entry.js +0 -142
- package/dist/cjs/calcite-dropdown.cjs.entry.js +0 -481
- package/dist/cjs/calcite-handle.cjs.entry.js +0 -99
- package/dist/cjs/calcite-loader.cjs.entry.js +0 -95
- package/dist/cjs/layer-table.cjs.entry.js +0 -317
- package/dist/cjs/map-card.cjs.entry.js +0 -252
- package/dist/esm/calcite-chip.entry.js +0 -138
- package/dist/esm/calcite-dropdown.entry.js +0 -477
- package/dist/esm/calcite-handle.entry.js +0 -95
- package/dist/esm/calcite-loader.entry.js +0 -91
- package/dist/esm/layer-table.entry.js +0 -313
- package/dist/solutions-components/p-045d3988.entry.js +0 -12
- package/dist/solutions-components/p-11132485.entry.js +0 -11
- package/dist/solutions-components/p-15b43c29.entry.js +0 -11
- package/dist/solutions-components/p-5034aabc.entry.js +0 -11
- package/dist/solutions-components/p-6f012424.entry.js +0 -6
- package/dist/solutions-components/p-7fd10eb3.entry.js +0 -11
- package/dist/solutions-components/p-a57ef371.entry.js +0 -6
- package/dist/solutions-components/p-bc39f296.entry.js +0 -6
- package/dist/solutions-components/p-c93d8e80.entry.js +0 -6
- package/dist/solutions-components/p-dbc9a5a8.js +0 -21
- package/dist/solutions-components/p-f5c70be2.entry.js +0 -6
- package/dist/solutions-components/p-f6b17cc6.entry.js +0 -11
@@ -3,449 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import { g as getLocaleComponentStrings } from './locale.js';
|
8
|
-
import { g as goToSelection, a as getMapLayerView, d as defineCustomElement$2 } from './map-layer-picker2.js';
|
9
|
-
import { q as queryAllFeatures } from './queryUtils.js';
|
10
|
-
import { d as downloadCSV } from './downloadUtils.js';
|
11
|
-
import { d as defineCustomElement$l } from './button.js';
|
12
|
-
import { d as defineCustomElement$k } from './checkbox.js';
|
13
|
-
import { d as defineCustomElement$j } from './chip.js';
|
14
|
-
import { d as defineCustomElement$i } from './combobox.js';
|
15
|
-
import { d as defineCustomElement$h } from './combobox-item.js';
|
16
|
-
import { d as defineCustomElement$g } from './dropdown.js';
|
17
|
-
import { d as defineCustomElement$f } from './dropdown-group.js';
|
18
|
-
import { d as defineCustomElement$e } from './dropdown-item.js';
|
19
|
-
import { d as defineCustomElement$d } from './icon.js';
|
20
|
-
import { d as defineCustomElement$c } from './input.js';
|
21
|
-
import { d as defineCustomElement$b } from './label.js';
|
22
|
-
import { d as defineCustomElement$a } from './loader.js';
|
23
|
-
import { d as defineCustomElement$9 } from './modal.js';
|
24
|
-
import { d as defineCustomElement$8 } from './option.js';
|
25
|
-
import { d as defineCustomElement$7 } from './progress.js';
|
26
|
-
import { d as defineCustomElement$6 } from './scrim.js';
|
27
|
-
import { d as defineCustomElement$5 } from './select.js';
|
28
|
-
import { d as defineCustomElement$4 } from './split-button.js';
|
29
|
-
import { d as defineCustomElement$3 } from './edit-record-modal2.js';
|
30
|
-
|
31
|
-
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}";
|
32
|
-
|
33
|
-
const LayerTable$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
34
|
-
constructor() {
|
35
|
-
super();
|
36
|
-
this.__registerHost();
|
37
|
-
this.__attachShadow();
|
38
|
-
/**
|
39
|
-
* esri/Graphic[]: https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html
|
40
|
-
*/
|
41
|
-
this._graphics = [];
|
42
|
-
/**
|
43
|
-
* string[]: List of field names to display
|
44
|
-
*/
|
45
|
-
this._fieldNames = [];
|
46
|
-
this.mapView = undefined;
|
47
|
-
this._translations = undefined;
|
48
|
-
this._selectedIndexes = [];
|
49
|
-
}
|
50
|
-
//--------------------------------------------------------------------------
|
51
|
-
//
|
52
|
-
// Watch handlers
|
53
|
-
//
|
54
|
-
//--------------------------------------------------------------------------
|
55
|
-
//--------------------------------------------------------------------------
|
56
|
-
//
|
57
|
-
// Methods (public)
|
58
|
-
//
|
59
|
-
//--------------------------------------------------------------------------
|
60
|
-
//--------------------------------------------------------------------------
|
61
|
-
//
|
62
|
-
// Events (public)
|
63
|
-
//
|
64
|
-
//--------------------------------------------------------------------------
|
65
|
-
//--------------------------------------------------------------------------
|
66
|
-
//
|
67
|
-
// Functions (lifecycle)
|
68
|
-
//
|
69
|
-
//--------------------------------------------------------------------------
|
70
|
-
/**
|
71
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
72
|
-
*
|
73
|
-
* @returns Promise when complete
|
74
|
-
*/
|
75
|
-
async componentWillLoad() {
|
76
|
-
await this._getTranslations();
|
77
|
-
}
|
78
|
-
/**
|
79
|
-
* Renders the component.
|
80
|
-
*/
|
81
|
-
render() {
|
82
|
-
return (h(Host, null, this._getTableControlRow(), h("div", { class: "data-container" }, h("div", { class: "table-container" }, h("div", { class: "table" }, this._getTableHeader(), this._getTableRows()))), h("edit-record-modal", { ref: (el) => this._editMultipleMpdal = el })));
|
83
|
-
}
|
84
|
-
//--------------------------------------------------------------------------
|
85
|
-
//
|
86
|
-
// Functions (protected)
|
87
|
-
//
|
88
|
-
//--------------------------------------------------------------------------
|
89
|
-
/**
|
90
|
-
* Gets a row of controls that can be used for various interactions with the table
|
91
|
-
*
|
92
|
-
* @returns The dom node that contains the controls
|
93
|
-
*/
|
94
|
-
_getTableControlRow() {
|
95
|
-
const featuresSelected = this._selectedIndexes.length > 0;
|
96
|
-
const multiFeaturesSelected = this._selectedIndexes.length > 1;
|
97
|
-
return (h("div", { class: "display-flex table-border" }, h("map-layer-picker", { mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt) }), h("div", null, h("calcite-button", { appearance: 'transparent', color: 'neutral', disabled: !featuresSelected, iconStart: 'magnifying-glass', onClick: () => this._zoom() }, this._translations.zoom), h("calcite-button", { appearance: 'transparent', color: 'neutral', disabled: !multiFeaturesSelected, iconStart: 'pencil', onClick: () => this._editMultiple() }, this._translations.editMultiple), h("calcite-button", { appearance: 'transparent', color: 'neutral', disabled: !featuresSelected, iconStart: 'trash', onClick: () => this._delete() }, this._translations.delete), h("calcite-split-button", { appearance: "transparent", color: "neutral", "primary-text": this._translations.more }, h("calcite-dropdown-group", { "selection-mode": "none" }, h("calcite-dropdown-item", { iconStart: 'list-check-all', onClick: () => this._selectAll(true) }, this._translations.selectAll), h("calcite-dropdown-item", { iconStart: 'selected-items-filter', onClick: () => this._showSelected() }, this._translations.showSelected), h("calcite-dropdown-item", { iconStart: 'erase', onClick: () => this._clearSelection() }, this._translations.clearSelection), h("calcite-dropdown-item", { iconStart: 'refresh', onClick: () => this._switchSelected() }, this._translations.switchSelected), h("calcite-dropdown-item", { iconStart: 'export', onClick: () => this._exportToCSV() }, this._translations.exportCSV))))));
|
98
|
-
}
|
99
|
-
/**
|
100
|
-
* Gets the table header with a select all control and column headers for each field
|
101
|
-
*
|
102
|
-
* @returns The dom node that contains the header
|
103
|
-
*/
|
104
|
-
_getTableHeader() {
|
105
|
-
return (h("div", { class: "header" }, h("div", { class: "table-header-cell padding-3-4" }, 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))));
|
106
|
-
}
|
107
|
-
/**
|
108
|
-
* Gets a header cell for the table header
|
109
|
-
*
|
110
|
-
* @param name the string to display in the cell
|
111
|
-
*
|
112
|
-
* @returns The dom node that contains the header cell
|
113
|
-
*/
|
114
|
-
_getTableHeaderCell(name) {
|
115
|
-
return (h("div", { class: "table-header-cell field-width" }, name));
|
116
|
-
}
|
117
|
-
/**
|
118
|
-
* Gets the table rows for all features
|
119
|
-
*
|
120
|
-
* @returns The dom node that contains the body of the table
|
121
|
-
*/
|
122
|
-
_getTableRows() {
|
123
|
-
return (h("div", { class: "table-body" }, this._graphics.map((g, i) => this._getTableRow(g, i))));
|
124
|
-
}
|
125
|
-
/**
|
126
|
-
* Gets the individual table row for a feature
|
127
|
-
*
|
128
|
-
* @param g the graphic the row is based on
|
129
|
-
* @param index the index location of the row within the table
|
130
|
-
*
|
131
|
-
* @returns The dom node that contains the row
|
132
|
-
*/
|
133
|
-
_getTableRow(g, index) {
|
134
|
-
// TODO think through this more...should build the fieldType info once up front rather
|
135
|
-
// than on every single value...
|
136
|
-
const checked = this._selectedIndexes.indexOf(index) > -1;
|
137
|
-
return (h("div", { class: "row" }, h("div", { class: "table-cell table-border padding-3-4" }, h("calcite-checkbox", { checked: checked, class: "display-flex justify-center", onClick: () => this._rowSelected(index), value: index })), this._fieldNames.map(name => {
|
138
|
-
const field = this._layerView.layer.fieldsIndex.get(name);
|
139
|
-
return this._getTableRowCell(g.attributes[name], field, checked);
|
140
|
-
})));
|
141
|
-
}
|
142
|
-
/**
|
143
|
-
* Gets the individual table cell for the provided field
|
144
|
-
*
|
145
|
-
* @param v the value to display
|
146
|
-
* @param field the field the row is based on
|
147
|
-
* @param rowSelected when true editable fields will render a control that will allow the value to be updated
|
148
|
-
*
|
149
|
-
* @returns The dom node that contains the table cell
|
150
|
-
*/
|
151
|
-
_getTableRowCell(v, field, rowSelected) {
|
152
|
-
const editable = field.editable && rowSelected;
|
153
|
-
const inputType = this._getInputType(field.type);
|
154
|
-
// TODO find some domain data to test with..this has not been tested
|
155
|
-
let domainInput;
|
156
|
-
const domain = field.domain;
|
157
|
-
if (domain) {
|
158
|
-
if (domain.type === "coded-value") {
|
159
|
-
domainInput = (h("calcite-select", { label: '' }, domain.codedValues.map(cv => {
|
160
|
-
return (h("calcite-option", { label: cv.name, selected: v === cv.code.toString(), value: cv.code }));
|
161
|
-
})));
|
162
|
-
}
|
163
|
-
else {
|
164
|
-
// range domain
|
165
|
-
const range = domain;
|
166
|
-
domainInput = (h("calcite-input", { max: range.maxValue, min: range.minValue, type: "number", value: v }));
|
167
|
-
}
|
168
|
-
}
|
169
|
-
return (h("div", { class: "table-cell table-border field-width" }, editable && domainInput ? domainInput : editable ? (h("calcite-input", { type: inputType, value: v })) : v));
|
170
|
-
}
|
171
|
-
/**
|
172
|
-
* Simple lookup that will get the appropriate edit control for the value type
|
173
|
-
*
|
174
|
-
* @param type the Esri field type
|
175
|
-
*
|
176
|
-
* @returns A string for the type of control to create based on the provided field type
|
177
|
-
*/
|
178
|
-
_getInputType(type) {
|
179
|
-
// JS API field types
|
180
|
-
// "string" | "small-integer" | "integer" | "single" | "double" | "long" | "date" | "oid" | "geometry" | "blob" | "raster" | "guid" | "global-id" | "xml"
|
181
|
-
// not sure about these: "geometry" | "blob" | "raster" | | "xml"
|
182
|
-
// Calcite input types
|
183
|
-
// color date datetime-local email file image month number password search tel text(default) textarea time url week
|
184
|
-
const inputTypes = {
|
185
|
-
"string": 'text',
|
186
|
-
"small-integer": "number",
|
187
|
-
"integer": "number",
|
188
|
-
"single": "number",
|
189
|
-
"double": "number",
|
190
|
-
"long": "number",
|
191
|
-
"date": "datetime-local",
|
192
|
-
"oid": "number",
|
193
|
-
"guid": "text",
|
194
|
-
"global-id": "text"
|
195
|
-
};
|
196
|
-
return Object.keys(inputTypes).indexOf(type) > -1 ? inputTypes[type] : "text";
|
197
|
-
}
|
198
|
-
/**
|
199
|
-
* Select or deselect all rows
|
200
|
-
*
|
201
|
-
* @param checked When true all rows will be selected
|
202
|
-
*
|
203
|
-
* @returns void
|
204
|
-
*/
|
205
|
-
_selectAll(checked) {
|
206
|
-
this._selectedIndexes = checked ? this._graphics.map((_g, i) => i) : [];
|
207
|
-
}
|
208
|
-
// need to discuss with team
|
209
|
-
_showSelected() {
|
210
|
-
console.log("_showSelected");
|
211
|
-
}
|
212
|
-
/**
|
213
|
-
* Clears the selected indexes
|
214
|
-
*
|
215
|
-
* @returns void
|
216
|
-
*/
|
217
|
-
_clearSelection() {
|
218
|
-
this._selectedIndexes = [];
|
219
|
-
}
|
220
|
-
/**
|
221
|
-
* Select all rows that are not currently selectd
|
222
|
-
*
|
223
|
-
* @returns void
|
224
|
-
*/
|
225
|
-
_switchSelected() {
|
226
|
-
const currentIndexes = [...this._selectedIndexes];
|
227
|
-
this._selectedIndexes = this._graphics.reduce((prev, _cur, i) => {
|
228
|
-
if (currentIndexes.indexOf(i) < 0) {
|
229
|
-
prev.push(i);
|
230
|
-
}
|
231
|
-
return prev;
|
232
|
-
}, []);
|
233
|
-
}
|
234
|
-
/**
|
235
|
-
* Export all selected rows as CSV
|
236
|
-
*
|
237
|
-
* @returns a promise that will resolve when the operation is complete
|
238
|
-
*/
|
239
|
-
async _exportToCSV() {
|
240
|
-
return downloadCSV([], this._layerView.layer, this._getSelectedIds(), false, // formatUsingLayerPopup
|
241
|
-
false, // removeDuplicates
|
242
|
-
true);
|
243
|
-
}
|
244
|
-
/**
|
245
|
-
* Zoom to all selected features
|
246
|
-
*
|
247
|
-
* @returns a promise that will resolve when the operation is complete
|
248
|
-
*/
|
249
|
-
_zoom() {
|
250
|
-
const ids = this._getSelectedIds();
|
251
|
-
void goToSelection(ids, this._layerView, this.mapView, true);
|
252
|
-
}
|
253
|
-
/**
|
254
|
-
* Open the edit multiple modal
|
255
|
-
*
|
256
|
-
* @returns void
|
257
|
-
*/
|
258
|
-
_editMultiple() {
|
259
|
-
this._editMultipleMpdal.open = true;
|
260
|
-
}
|
261
|
-
/**
|
262
|
-
* Delete all selected records
|
263
|
-
*
|
264
|
-
* @returns a promise that will resolve when the operation is complete
|
265
|
-
*/
|
266
|
-
_delete() {
|
267
|
-
console.log("delete");
|
268
|
-
}
|
269
|
-
/**
|
270
|
-
* Get the graphics for all selected indexes
|
271
|
-
*
|
272
|
-
* @param indexes the indexes for the graphics to fetch
|
273
|
-
*
|
274
|
-
* @returns An array of selected graphics
|
275
|
-
*/
|
276
|
-
_getGraphics(indexes) {
|
277
|
-
return this._graphics.filter((_g, i) => indexes.indexOf(i) > -1);
|
278
|
-
}
|
279
|
-
/**
|
280
|
-
* Gets the object ids for all selected rows
|
281
|
-
*
|
282
|
-
* @returns An array of object ids
|
283
|
-
*/
|
284
|
-
_getSelectedIds() {
|
285
|
-
const graphics = this._getGraphics(this._selectedIndexes);
|
286
|
-
return graphics.map(g => g.getObjectId());
|
287
|
-
}
|
288
|
-
/**
|
289
|
-
* Update the selected indexes based on the current row
|
290
|
-
*
|
291
|
-
* @param index the index of the selected row
|
292
|
-
*
|
293
|
-
* @returns void
|
294
|
-
*/
|
295
|
-
_rowSelected(index) {
|
296
|
-
const indexOfSelected = this._selectedIndexes.indexOf(index);
|
297
|
-
if (indexOfSelected > -1) {
|
298
|
-
this._selectedIndexes.splice(indexOfSelected, 1);
|
299
|
-
this._selectedIndexes = [...this._selectedIndexes];
|
300
|
-
}
|
301
|
-
else {
|
302
|
-
this._selectedIndexes = [...this._selectedIndexes, index];
|
303
|
-
}
|
304
|
-
}
|
305
|
-
/**
|
306
|
-
* Handles layer selection change to show new table
|
307
|
-
*
|
308
|
-
* @returns a promise that will resolve when the operation is complete
|
309
|
-
*/
|
310
|
-
async _layerSelectionChanged(evt) {
|
311
|
-
const layerName = evt.detail[0];
|
312
|
-
this._layerView = await getMapLayerView(this.mapView, layerName);
|
313
|
-
// TODO rethink this...when we use later we need to be able to lookup with name
|
314
|
-
this._fieldNames = this._layerView.layer.fields.map(f => f.alias || f.name);
|
315
|
-
this._graphics = await queryAllFeatures(0, this._layerView.layer, []);
|
316
|
-
this._selectedIndexes = [];
|
317
|
-
}
|
318
|
-
/**
|
319
|
-
* Fetches the component's translations
|
320
|
-
*
|
321
|
-
* @returns Promise when complete
|
322
|
-
* @protected
|
323
|
-
*/
|
324
|
-
async _getTranslations() {
|
325
|
-
const messages = await getLocaleComponentStrings(this.el);
|
326
|
-
this._translations = messages[0];
|
327
|
-
}
|
328
|
-
get el() { return this; }
|
329
|
-
static get style() { return layerTableCss; }
|
330
|
-
}, [1, "layer-table", {
|
331
|
-
"mapView": [16],
|
332
|
-
"_translations": [32],
|
333
|
-
"_selectedIndexes": [32]
|
334
|
-
}]);
|
335
|
-
function defineCustomElement$1() {
|
336
|
-
if (typeof customElements === "undefined") {
|
337
|
-
return;
|
338
|
-
}
|
339
|
-
const components = ["layer-table", "calcite-button", "calcite-checkbox", "calcite-chip", "calcite-combobox", "calcite-combobox-item", "calcite-dropdown", "calcite-dropdown-group", "calcite-dropdown-item", "calcite-icon", "calcite-input", "calcite-label", "calcite-loader", "calcite-modal", "calcite-option", "calcite-progress", "calcite-scrim", "calcite-select", "calcite-split-button", "edit-record-modal", "map-layer-picker"];
|
340
|
-
components.forEach(tagName => { switch (tagName) {
|
341
|
-
case "layer-table":
|
342
|
-
if (!customElements.get(tagName)) {
|
343
|
-
customElements.define(tagName, LayerTable$1);
|
344
|
-
}
|
345
|
-
break;
|
346
|
-
case "calcite-button":
|
347
|
-
if (!customElements.get(tagName)) {
|
348
|
-
defineCustomElement$l();
|
349
|
-
}
|
350
|
-
break;
|
351
|
-
case "calcite-checkbox":
|
352
|
-
if (!customElements.get(tagName)) {
|
353
|
-
defineCustomElement$k();
|
354
|
-
}
|
355
|
-
break;
|
356
|
-
case "calcite-chip":
|
357
|
-
if (!customElements.get(tagName)) {
|
358
|
-
defineCustomElement$j();
|
359
|
-
}
|
360
|
-
break;
|
361
|
-
case "calcite-combobox":
|
362
|
-
if (!customElements.get(tagName)) {
|
363
|
-
defineCustomElement$i();
|
364
|
-
}
|
365
|
-
break;
|
366
|
-
case "calcite-combobox-item":
|
367
|
-
if (!customElements.get(tagName)) {
|
368
|
-
defineCustomElement$h();
|
369
|
-
}
|
370
|
-
break;
|
371
|
-
case "calcite-dropdown":
|
372
|
-
if (!customElements.get(tagName)) {
|
373
|
-
defineCustomElement$g();
|
374
|
-
}
|
375
|
-
break;
|
376
|
-
case "calcite-dropdown-group":
|
377
|
-
if (!customElements.get(tagName)) {
|
378
|
-
defineCustomElement$f();
|
379
|
-
}
|
380
|
-
break;
|
381
|
-
case "calcite-dropdown-item":
|
382
|
-
if (!customElements.get(tagName)) {
|
383
|
-
defineCustomElement$e();
|
384
|
-
}
|
385
|
-
break;
|
386
|
-
case "calcite-icon":
|
387
|
-
if (!customElements.get(tagName)) {
|
388
|
-
defineCustomElement$d();
|
389
|
-
}
|
390
|
-
break;
|
391
|
-
case "calcite-input":
|
392
|
-
if (!customElements.get(tagName)) {
|
393
|
-
defineCustomElement$c();
|
394
|
-
}
|
395
|
-
break;
|
396
|
-
case "calcite-label":
|
397
|
-
if (!customElements.get(tagName)) {
|
398
|
-
defineCustomElement$b();
|
399
|
-
}
|
400
|
-
break;
|
401
|
-
case "calcite-loader":
|
402
|
-
if (!customElements.get(tagName)) {
|
403
|
-
defineCustomElement$a();
|
404
|
-
}
|
405
|
-
break;
|
406
|
-
case "calcite-modal":
|
407
|
-
if (!customElements.get(tagName)) {
|
408
|
-
defineCustomElement$9();
|
409
|
-
}
|
410
|
-
break;
|
411
|
-
case "calcite-option":
|
412
|
-
if (!customElements.get(tagName)) {
|
413
|
-
defineCustomElement$8();
|
414
|
-
}
|
415
|
-
break;
|
416
|
-
case "calcite-progress":
|
417
|
-
if (!customElements.get(tagName)) {
|
418
|
-
defineCustomElement$7();
|
419
|
-
}
|
420
|
-
break;
|
421
|
-
case "calcite-scrim":
|
422
|
-
if (!customElements.get(tagName)) {
|
423
|
-
defineCustomElement$6();
|
424
|
-
}
|
425
|
-
break;
|
426
|
-
case "calcite-select":
|
427
|
-
if (!customElements.get(tagName)) {
|
428
|
-
defineCustomElement$5();
|
429
|
-
}
|
430
|
-
break;
|
431
|
-
case "calcite-split-button":
|
432
|
-
if (!customElements.get(tagName)) {
|
433
|
-
defineCustomElement$4();
|
434
|
-
}
|
435
|
-
break;
|
436
|
-
case "edit-record-modal":
|
437
|
-
if (!customElements.get(tagName)) {
|
438
|
-
defineCustomElement$3();
|
439
|
-
}
|
440
|
-
break;
|
441
|
-
case "map-layer-picker":
|
442
|
-
if (!customElements.get(tagName)) {
|
443
|
-
defineCustomElement$2();
|
444
|
-
}
|
445
|
-
break;
|
446
|
-
} });
|
447
|
-
}
|
448
|
-
defineCustomElement$1();
|
6
|
+
import { L as LayerTable$1, d as defineCustomElement$1 } from './layer-table2.js';
|
449
7
|
|
450
8
|
const LayerTable = LayerTable$1;
|
451
9
|
const defineCustomElement = defineCustomElement$1;
|