@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
@@ -0,0 +1,133 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2023 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
|
+
import * as downloadUtils from "../downloadUtils";
|
18
|
+
|
19
|
+
describe("downloadUtils", () => {
|
20
|
+
|
21
|
+
describe("_convertPopupFieldsToLabelSpec", () => {
|
22
|
+
|
23
|
+
it("handles fieldname visibility", () => {
|
24
|
+
const fieldInfos: __esri.FieldInfo[] = [
|
25
|
+
{ fieldName: "A", visible: true },
|
26
|
+
{ fieldName: "B", visible: true },
|
27
|
+
{ fieldName: "C", visible: false },
|
28
|
+
{ fieldName: "D", visible: true }
|
29
|
+
];
|
30
|
+
const bypassFieldVisiblity = false;
|
31
|
+
const expectedLabelSpec = "{A}|{B}|{D}";
|
32
|
+
|
33
|
+
const labelSpec = downloadUtils._convertPopupFieldsToLabelSpec(fieldInfos, bypassFieldVisiblity);
|
34
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
35
|
+
});
|
36
|
+
|
37
|
+
it("handles fieldname ignoring visibility", () => {
|
38
|
+
const fieldInfos: __esri.FieldInfo[] = [
|
39
|
+
{ fieldName: "A", visible: true },
|
40
|
+
{ fieldName: "B", visible: true },
|
41
|
+
{ fieldName: "C", visible: false },
|
42
|
+
{ fieldName: "D", visible: true }
|
43
|
+
];
|
44
|
+
const bypassFieldVisiblity = true;
|
45
|
+
const expectedLabelSpec = "{A}|{B}|{C}|{D}";
|
46
|
+
|
47
|
+
const labelSpec = downloadUtils._convertPopupFieldsToLabelSpec(fieldInfos, bypassFieldVisiblity);
|
48
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
49
|
+
});
|
50
|
+
|
51
|
+
});
|
52
|
+
|
53
|
+
describe("_convertPopupTextToLabelSpec", () => {
|
54
|
+
|
55
|
+
it("handles <br> variants", () => {
|
56
|
+
const popupInfo = "<div style='text-align: left;'>{NAME}<br />{STREET}<br/>{CITY}, {STATE} {ZIP} <br></div>";
|
57
|
+
const expectedLabelSpec = "{NAME}|{STREET}|{CITY}, {STATE} {ZIP}";
|
58
|
+
|
59
|
+
const labelSpec = downloadUtils._convertPopupTextToLabelSpec(popupInfo);
|
60
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
61
|
+
});
|
62
|
+
|
63
|
+
it("handles <p>", () => {
|
64
|
+
const popupInfo = "<p>{NAME}</p><p>{STREET}</p><p>{CITY}, {STATE} {ZIP}</p>";
|
65
|
+
const expectedLabelSpec = "{NAME}|{STREET}|{CITY}, {STATE} {ZIP}";
|
66
|
+
|
67
|
+
const labelSpec = downloadUtils._convertPopupTextToLabelSpec(popupInfo);
|
68
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
69
|
+
});
|
70
|
+
|
71
|
+
it("handles popup's use of \xA0", () => {
|
72
|
+
const popupInfo = "<div style='text-align: left;'>{NAME}<br />{STREET}<br />{CITY},\xA0{STATE}\xA0{ZIP}\xA0<br /></div>";
|
73
|
+
const expectedLabelSpec = "{NAME}|{STREET}|{CITY}, {STATE} {ZIP}";
|
74
|
+
|
75
|
+
const labelSpec = downloadUtils._convertPopupTextToLabelSpec(popupInfo);
|
76
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
77
|
+
});
|
78
|
+
|
79
|
+
it("removes newlines and blank lines, and trims each line", () => {
|
80
|
+
const popupInfo = " \n\n {NAME} \n \n\n {STREET}\n{CITY}, {STATE} {ZIP}\n\n \n ";
|
81
|
+
const expectedLabelSpec = "{NAME}|{STREET}|{CITY}, {STATE} {ZIP}";
|
82
|
+
|
83
|
+
const labelSpec = downloadUtils._convertPopupTextToLabelSpec(popupInfo);
|
84
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
85
|
+
});
|
86
|
+
|
87
|
+
it("removes extra HTML", () => {
|
88
|
+
const popupInfo = "\n<div style='text-align: left;'><span style='font-weight:bold'>{NAME}</span><br />{STREET}<br />{CITY},\xA0{STATE}\xA0{ZIP}\xA0<br /></div>\n";
|
89
|
+
const expectedLabelSpec = "{NAME}|{STREET}|{CITY}, {STATE} {ZIP}";
|
90
|
+
|
91
|
+
const labelSpec = downloadUtils._convertPopupTextToLabelSpec(popupInfo);
|
92
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
93
|
+
});
|
94
|
+
|
95
|
+
it("handles some special characters", () => {
|
96
|
+
const popupInfo = "<div style='text-align: left;'><{NAME}><br />{STREET}<br/>{CITY}, {STATE} {ZIP}<br></div>";
|
97
|
+
const expectedLabelSpec = "<{NAME}>|{STREET}|{CITY}, {STATE} {ZIP}";
|
98
|
+
|
99
|
+
const labelSpec = downloadUtils._convertPopupTextToLabelSpec(popupInfo);
|
100
|
+
expect(labelSpec).toEqual(expectedLabelSpec);
|
101
|
+
});
|
102
|
+
|
103
|
+
});
|
104
|
+
|
105
|
+
describe("_createTitle", () => {
|
106
|
+
|
107
|
+
it("handles no selection set names", () => {
|
108
|
+
const selectionSetNames: string[] = [];
|
109
|
+
const expectedTitle = "download";
|
110
|
+
|
111
|
+
const title = downloadUtils._createTitle(selectionSetNames);
|
112
|
+
expect(title).toEqual(expectedTitle);
|
113
|
+
});
|
114
|
+
|
115
|
+
it("handles one selection set name", () => {
|
116
|
+
const selectionSetNames: string[] = ["fred"];
|
117
|
+
const expectedTitle = "fred";
|
118
|
+
|
119
|
+
const title = downloadUtils._createTitle(selectionSetNames);
|
120
|
+
expect(title).toEqual(expectedTitle);
|
121
|
+
});
|
122
|
+
|
123
|
+
it("handles two selection set names", () => {
|
124
|
+
const selectionSetNames: string[] = ["fred", "ginger"];
|
125
|
+
const expectedTitle = "fred,ginger";
|
126
|
+
|
127
|
+
const title = downloadUtils._createTitle(selectionSetNames);
|
128
|
+
expect(title).toEqual(expectedTitle);
|
129
|
+
});
|
130
|
+
|
131
|
+
});
|
132
|
+
|
133
|
+
});
|
@@ -4,27 +4,56 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
7
|
+
import { g as getLocaleComponentStrings } from './locale.js';
|
8
|
+
import { E as ELayoutMode } from './interfaces3.js';
|
9
|
+
import { d as defineCustomElement$y } from './action.js';
|
10
|
+
import { d as defineCustomElement$x } from './action-bar.js';
|
11
|
+
import { d as defineCustomElement$w } from './action-group.js';
|
12
|
+
import { d as defineCustomElement$v } from './action-menu.js';
|
13
|
+
import { d as defineCustomElement$u } from './block.js';
|
14
|
+
import { d as defineCustomElement$t } from './button.js';
|
15
|
+
import { d as defineCustomElement$s } from './chip.js';
|
16
|
+
import { d as defineCustomElement$r } from './combobox.js';
|
17
|
+
import { d as defineCustomElement$q } from './combobox-item.js';
|
18
|
+
import { d as defineCustomElement$p } from './dropdown.js';
|
19
|
+
import { d as defineCustomElement$o } from './dropdown-group.js';
|
20
|
+
import { d as defineCustomElement$n } from './dropdown-item.js';
|
21
|
+
import { d as defineCustomElement$m } from './handle.js';
|
22
|
+
import { d as defineCustomElement$l } from './icon.js';
|
23
|
+
import { d as defineCustomElement$k } from './input.js';
|
24
|
+
import { d as defineCustomElement$j } from './label.js';
|
25
|
+
import { d as defineCustomElement$i } from './loader.js';
|
26
|
+
import { d as defineCustomElement$h } from './modal.js';
|
27
|
+
import { d as defineCustomElement$g } from './option.js';
|
28
|
+
import { d as defineCustomElement$f } from './panel.js';
|
29
|
+
import { d as defineCustomElement$e } from './pick-list.js';
|
30
|
+
import { d as defineCustomElement$d } from './pick-list-item.js';
|
31
|
+
import { d as defineCustomElement$c } from './popover.js';
|
32
|
+
import { d as defineCustomElement$b } from './progress.js';
|
33
|
+
import { d as defineCustomElement$a } from './scrim.js';
|
34
|
+
import { d as defineCustomElement$9 } from './select.js';
|
35
|
+
import { d as defineCustomElement$8 } from './shell.js';
|
36
|
+
import { d as defineCustomElement$7 } from './split-button.js';
|
37
|
+
import { d as defineCustomElement$6 } from './tooltip.js';
|
38
|
+
import { d as defineCustomElement$5 } from './edit-record-modal2.js';
|
39
|
+
import { d as defineCustomElement$4 } from './layer-table2.js';
|
40
|
+
import { d as defineCustomElement$3 } from './map-card2.js';
|
41
|
+
import { d as defineCustomElement$2 } from './map-layer-picker2.js';
|
7
42
|
|
8
|
-
const crowdsourceManagerCss = ":host{display:block}";
|
43
|
+
const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px}.pad-top-51{padding-top:51px}.header-title{display:flex;float:left}.header-controls-label{display:flex;float:right}.header-controls{height:50px}.img-background{background-repeat:no-repeat;background-size:100% 100%;width:38px;height:26px}.grid-background{background-image:url('../../assets/data/images/grid.png')}.vertical-background{background-image:url('../../assets/data/images/horizontal.png')}.horizontal-background{background-image:url('../../assets/data/images/vertical.png')}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.background-transparent{background-color:transparent}.display-flex{display:flex}.header-text{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);padding-inline:0.75rem;padding-block:0.875rem;line-height:1.25rem}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:48px;height:48px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.position-relative{position:relative}";
|
9
44
|
|
10
45
|
const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
11
46
|
constructor() {
|
12
47
|
super();
|
13
48
|
this.__registerHost();
|
14
|
-
this.
|
49
|
+
this.mapInfos = [];
|
50
|
+
this._translations = undefined;
|
51
|
+
this._layoutMode = ELayoutMode.GRID;
|
52
|
+
this._mapView = undefined;
|
53
|
+
this._panelOpen = true;
|
15
54
|
}
|
16
55
|
//--------------------------------------------------------------------------
|
17
56
|
//
|
18
|
-
// Properties (public)
|
19
|
-
//
|
20
|
-
//--------------------------------------------------------------------------
|
21
|
-
//--------------------------------------------------------------------------
|
22
|
-
//
|
23
|
-
// State (internal)
|
24
|
-
//
|
25
|
-
//--------------------------------------------------------------------------
|
26
|
-
//--------------------------------------------------------------------------
|
27
|
-
//
|
28
57
|
// Properties (protected)
|
29
58
|
//
|
30
59
|
//--------------------------------------------------------------------------
|
@@ -43,19 +72,95 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
43
72
|
// Events (public)
|
44
73
|
//
|
45
74
|
//--------------------------------------------------------------------------
|
75
|
+
/**
|
76
|
+
* Handle changes to the buffer distance value
|
77
|
+
*/
|
78
|
+
mapChanged(event) {
|
79
|
+
this._mapView = event.detail;
|
80
|
+
}
|
46
81
|
//--------------------------------------------------------------------------
|
47
82
|
//
|
48
83
|
// Functions (lifecycle)
|
49
84
|
//
|
50
85
|
//--------------------------------------------------------------------------
|
86
|
+
async componentWillLoad() {
|
87
|
+
await this._getTranslations();
|
88
|
+
}
|
51
89
|
render() {
|
52
|
-
return (h(Host, null, h("slot",
|
90
|
+
return (h(Host, null, h("calcite-panel", { class: "width-full height-full", heading: this._translations.header }, h("div", { class: "display-flex", slot: "header-actions-end" }, h("div", { class: "header-text" }, "Layout"), this._getAction("grid-background", ELayoutMode.GRID, this._translations.grid), this._getAction("horizontal-background", ELayoutMode.VERTICAL, this._translations.horizontal), this._getAction("vertical-background", ELayoutMode.HORIZONTAL, this._translations.vertical)), this._getBody(this._layoutMode, this._panelOpen))));
|
53
91
|
}
|
54
92
|
//--------------------------------------------------------------------------
|
55
93
|
//
|
56
94
|
// Functions (protected)
|
57
95
|
//
|
58
96
|
//--------------------------------------------------------------------------
|
97
|
+
_getAction(imgClass, layoutMode, tip) {
|
98
|
+
return (h("div", null, h("calcite-action", { alignment: "center", appearance: "transparent", compact: false, id: imgClass, indicator: layoutMode === this._layoutMode, onClick: () => { this._setLayoutMode(layoutMode); }, text: "" }, h("div", { class: imgClass + " img-background" })), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": imgClass }, h("span", null, tip))));
|
99
|
+
}
|
100
|
+
_getDividerIcon(layoutMode, panelOpen) {
|
101
|
+
let icon = "";
|
102
|
+
switch (layoutMode) {
|
103
|
+
case ELayoutMode.HORIZONTAL:
|
104
|
+
icon = panelOpen ? "chevrons-up" : "chevrons-down";
|
105
|
+
break;
|
106
|
+
default:
|
107
|
+
icon = panelOpen ? "chevrons-left" : "chevrons-right";
|
108
|
+
break;
|
109
|
+
}
|
110
|
+
return icon;
|
111
|
+
}
|
112
|
+
_getMapSizeClass(layoutMode, panelOpen) {
|
113
|
+
let sizeClass = "";
|
114
|
+
switch (layoutMode) {
|
115
|
+
case ELayoutMode.HORIZONTAL:
|
116
|
+
sizeClass = `${panelOpen ? "height-1-2" : "height-0"} width-full position-relative`;
|
117
|
+
break;
|
118
|
+
case ELayoutMode.GRID:
|
119
|
+
sizeClass = `height-full position-relative ${panelOpen ? "width-1-3" : "width-0"}`;
|
120
|
+
break;
|
121
|
+
case ELayoutMode.VERTICAL:
|
122
|
+
sizeClass = `height-full position-relative ${panelOpen ? "width-1-2" : "width-0"}`;
|
123
|
+
break;
|
124
|
+
}
|
125
|
+
return sizeClass;
|
126
|
+
}
|
127
|
+
_getTableSizeClass(layoutMode, panelOpen) {
|
128
|
+
let sizeClass = "";
|
129
|
+
switch (layoutMode) {
|
130
|
+
case ELayoutMode.HORIZONTAL:
|
131
|
+
sizeClass = `${panelOpen ? "height-1-2" : "height-full"} width-full display-flex flex-column`;
|
132
|
+
break;
|
133
|
+
case ELayoutMode.GRID:
|
134
|
+
sizeClass = `${panelOpen ? "width-2-3" : "width-full"} height-full display-flex`;
|
135
|
+
break;
|
136
|
+
case ELayoutMode.VERTICAL:
|
137
|
+
sizeClass = `${panelOpen ? "width-1-2" : "width-full"} height-full display-flex`;
|
138
|
+
break;
|
139
|
+
}
|
140
|
+
return sizeClass;
|
141
|
+
}
|
142
|
+
_getBody(layoutMode, panelOpen) {
|
143
|
+
const displayFlex = layoutMode === ELayoutMode.HORIZONTAL ? "" : "display-flex";
|
144
|
+
return (h("calcite-shell", { class: "width-full height-full pad-top-51" }, h("div", { class: `width-full height-full ${displayFlex}` }, this._getMap(layoutMode, panelOpen), this._getTable(layoutMode, panelOpen))));
|
145
|
+
}
|
146
|
+
_getMap(layoutMode, panelOpen) {
|
147
|
+
const mapSizeClass = this._getMapSizeClass(layoutMode, panelOpen);
|
148
|
+
return (h("div", { class: `${mapSizeClass} overflow-hidden` }, h("div", { style: { "overflow": "hidden" } }, h("map-card", { mapInfos: this.mapInfos }))));
|
149
|
+
}
|
150
|
+
_getTable(layoutMode, panelOpen) {
|
151
|
+
const tableSizeClass = this._getTableSizeClass(layoutMode, panelOpen);
|
152
|
+
const icon = this._getDividerIcon(layoutMode, panelOpen);
|
153
|
+
const tooltip = panelOpen ? this._translations.close : this._translations.open;
|
154
|
+
const id = "toggle-layout";
|
155
|
+
const toggleSizeClass = layoutMode === ELayoutMode.HORIZONTAL ? "divider-h" : "divider-w";
|
156
|
+
return (h("div", { class: tableSizeClass }, h("div", { class: `border ${toggleSizeClass}` }, h("div", { class: "toggle-node" }, 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" }, h("layer-table", { mapView: this === null || this === void 0 ? void 0 : this._mapView }))));
|
157
|
+
}
|
158
|
+
_setLayoutMode(layoutMode) {
|
159
|
+
this._layoutMode = layoutMode;
|
160
|
+
}
|
161
|
+
_toggleLayout() {
|
162
|
+
this._panelOpen = !this._panelOpen;
|
163
|
+
}
|
59
164
|
/**
|
60
165
|
* Fetches the component's translations
|
61
166
|
*
|
@@ -63,23 +168,194 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
63
168
|
* @protected
|
64
169
|
*/
|
65
170
|
async _getTranslations() {
|
66
|
-
|
67
|
-
|
171
|
+
const messages = await getLocaleComponentStrings(this.el);
|
172
|
+
this._translations = messages[0];
|
68
173
|
}
|
69
174
|
get el() { return this; }
|
70
175
|
static get style() { return crowdsourceManagerCss; }
|
71
|
-
}, [
|
176
|
+
}, [0, "crowdsource-manager", {
|
177
|
+
"mapInfos": [16],
|
178
|
+
"_translations": [32],
|
179
|
+
"_layoutMode": [32],
|
180
|
+
"_mapView": [32],
|
181
|
+
"_panelOpen": [32]
|
182
|
+
}, [[8, "mapChanged", "mapChanged"]]]);
|
72
183
|
function defineCustomElement$1() {
|
73
184
|
if (typeof customElements === "undefined") {
|
74
185
|
return;
|
75
186
|
}
|
76
|
-
const components = ["crowdsource-manager"];
|
187
|
+
const components = ["crowdsource-manager", "calcite-action", "calcite-action-bar", "calcite-action-group", "calcite-action-menu", "calcite-block", "calcite-button", "calcite-chip", "calcite-combobox", "calcite-combobox-item", "calcite-dropdown", "calcite-dropdown-group", "calcite-dropdown-item", "calcite-handle", "calcite-icon", "calcite-input", "calcite-label", "calcite-loader", "calcite-modal", "calcite-option", "calcite-panel", "calcite-pick-list", "calcite-pick-list-item", "calcite-popover", "calcite-progress", "calcite-scrim", "calcite-select", "calcite-shell", "calcite-split-button", "calcite-tooltip", "edit-record-modal", "layer-table", "map-card", "map-layer-picker"];
|
77
188
|
components.forEach(tagName => { switch (tagName) {
|
78
189
|
case "crowdsource-manager":
|
79
190
|
if (!customElements.get(tagName)) {
|
80
191
|
customElements.define(tagName, CrowdsourceManager$1);
|
81
192
|
}
|
82
193
|
break;
|
194
|
+
case "calcite-action":
|
195
|
+
if (!customElements.get(tagName)) {
|
196
|
+
defineCustomElement$y();
|
197
|
+
}
|
198
|
+
break;
|
199
|
+
case "calcite-action-bar":
|
200
|
+
if (!customElements.get(tagName)) {
|
201
|
+
defineCustomElement$x();
|
202
|
+
}
|
203
|
+
break;
|
204
|
+
case "calcite-action-group":
|
205
|
+
if (!customElements.get(tagName)) {
|
206
|
+
defineCustomElement$w();
|
207
|
+
}
|
208
|
+
break;
|
209
|
+
case "calcite-action-menu":
|
210
|
+
if (!customElements.get(tagName)) {
|
211
|
+
defineCustomElement$v();
|
212
|
+
}
|
213
|
+
break;
|
214
|
+
case "calcite-block":
|
215
|
+
if (!customElements.get(tagName)) {
|
216
|
+
defineCustomElement$u();
|
217
|
+
}
|
218
|
+
break;
|
219
|
+
case "calcite-button":
|
220
|
+
if (!customElements.get(tagName)) {
|
221
|
+
defineCustomElement$t();
|
222
|
+
}
|
223
|
+
break;
|
224
|
+
case "calcite-chip":
|
225
|
+
if (!customElements.get(tagName)) {
|
226
|
+
defineCustomElement$s();
|
227
|
+
}
|
228
|
+
break;
|
229
|
+
case "calcite-combobox":
|
230
|
+
if (!customElements.get(tagName)) {
|
231
|
+
defineCustomElement$r();
|
232
|
+
}
|
233
|
+
break;
|
234
|
+
case "calcite-combobox-item":
|
235
|
+
if (!customElements.get(tagName)) {
|
236
|
+
defineCustomElement$q();
|
237
|
+
}
|
238
|
+
break;
|
239
|
+
case "calcite-dropdown":
|
240
|
+
if (!customElements.get(tagName)) {
|
241
|
+
defineCustomElement$p();
|
242
|
+
}
|
243
|
+
break;
|
244
|
+
case "calcite-dropdown-group":
|
245
|
+
if (!customElements.get(tagName)) {
|
246
|
+
defineCustomElement$o();
|
247
|
+
}
|
248
|
+
break;
|
249
|
+
case "calcite-dropdown-item":
|
250
|
+
if (!customElements.get(tagName)) {
|
251
|
+
defineCustomElement$n();
|
252
|
+
}
|
253
|
+
break;
|
254
|
+
case "calcite-handle":
|
255
|
+
if (!customElements.get(tagName)) {
|
256
|
+
defineCustomElement$m();
|
257
|
+
}
|
258
|
+
break;
|
259
|
+
case "calcite-icon":
|
260
|
+
if (!customElements.get(tagName)) {
|
261
|
+
defineCustomElement$l();
|
262
|
+
}
|
263
|
+
break;
|
264
|
+
case "calcite-input":
|
265
|
+
if (!customElements.get(tagName)) {
|
266
|
+
defineCustomElement$k();
|
267
|
+
}
|
268
|
+
break;
|
269
|
+
case "calcite-label":
|
270
|
+
if (!customElements.get(tagName)) {
|
271
|
+
defineCustomElement$j();
|
272
|
+
}
|
273
|
+
break;
|
274
|
+
case "calcite-loader":
|
275
|
+
if (!customElements.get(tagName)) {
|
276
|
+
defineCustomElement$i();
|
277
|
+
}
|
278
|
+
break;
|
279
|
+
case "calcite-modal":
|
280
|
+
if (!customElements.get(tagName)) {
|
281
|
+
defineCustomElement$h();
|
282
|
+
}
|
283
|
+
break;
|
284
|
+
case "calcite-option":
|
285
|
+
if (!customElements.get(tagName)) {
|
286
|
+
defineCustomElement$g();
|
287
|
+
}
|
288
|
+
break;
|
289
|
+
case "calcite-panel":
|
290
|
+
if (!customElements.get(tagName)) {
|
291
|
+
defineCustomElement$f();
|
292
|
+
}
|
293
|
+
break;
|
294
|
+
case "calcite-pick-list":
|
295
|
+
if (!customElements.get(tagName)) {
|
296
|
+
defineCustomElement$e();
|
297
|
+
}
|
298
|
+
break;
|
299
|
+
case "calcite-pick-list-item":
|
300
|
+
if (!customElements.get(tagName)) {
|
301
|
+
defineCustomElement$d();
|
302
|
+
}
|
303
|
+
break;
|
304
|
+
case "calcite-popover":
|
305
|
+
if (!customElements.get(tagName)) {
|
306
|
+
defineCustomElement$c();
|
307
|
+
}
|
308
|
+
break;
|
309
|
+
case "calcite-progress":
|
310
|
+
if (!customElements.get(tagName)) {
|
311
|
+
defineCustomElement$b();
|
312
|
+
}
|
313
|
+
break;
|
314
|
+
case "calcite-scrim":
|
315
|
+
if (!customElements.get(tagName)) {
|
316
|
+
defineCustomElement$a();
|
317
|
+
}
|
318
|
+
break;
|
319
|
+
case "calcite-select":
|
320
|
+
if (!customElements.get(tagName)) {
|
321
|
+
defineCustomElement$9();
|
322
|
+
}
|
323
|
+
break;
|
324
|
+
case "calcite-shell":
|
325
|
+
if (!customElements.get(tagName)) {
|
326
|
+
defineCustomElement$8();
|
327
|
+
}
|
328
|
+
break;
|
329
|
+
case "calcite-split-button":
|
330
|
+
if (!customElements.get(tagName)) {
|
331
|
+
defineCustomElement$7();
|
332
|
+
}
|
333
|
+
break;
|
334
|
+
case "calcite-tooltip":
|
335
|
+
if (!customElements.get(tagName)) {
|
336
|
+
defineCustomElement$6();
|
337
|
+
}
|
338
|
+
break;
|
339
|
+
case "edit-record-modal":
|
340
|
+
if (!customElements.get(tagName)) {
|
341
|
+
defineCustomElement$5();
|
342
|
+
}
|
343
|
+
break;
|
344
|
+
case "layer-table":
|
345
|
+
if (!customElements.get(tagName)) {
|
346
|
+
defineCustomElement$4();
|
347
|
+
}
|
348
|
+
break;
|
349
|
+
case "map-card":
|
350
|
+
if (!customElements.get(tagName)) {
|
351
|
+
defineCustomElement$3();
|
352
|
+
}
|
353
|
+
break;
|
354
|
+
case "map-layer-picker":
|
355
|
+
if (!customElements.get(tagName)) {
|
356
|
+
defineCustomElement$2();
|
357
|
+
}
|
358
|
+
break;
|
83
359
|
} });
|
84
360
|
}
|
85
361
|
defineCustomElement$1();
|