@esri/solutions-components 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/public-notification/resources.json +4 -1
- package/dist/assets/t9n/public-notification/resources_en.json +4 -1
- package/dist/cjs/buffer-tools_6.cjs.entry.js +8 -7
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +38 -25
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +272 -21
- package/dist/cjs/{csvUtils-18a03353.js → csvUtils-83af7ae1.js} +5 -5
- package/dist/cjs/layer-table.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-search.cjs.entry.js +46 -7
- package/dist/cjs/{mapViewUtils-8ea9adc5.js → mapViewUtils-55ac76cb.js} +40 -25
- package/dist/cjs/public-notification.cjs.entry.js +101 -18
- package/dist/cjs/{publicNotificationStore-aca88430.js → publicNotificationStore-28a8759d.js} +3 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -5
- package/dist/collection/components/buffer-tools/buffer-tools.js +7 -6
- package/dist/collection/components/layer-table/layer-table.js +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +47 -29
- package/dist/collection/components/map-search/map-search.js +66 -7
- package/dist/collection/components/map-select-tools/map-select-tools.js +125 -8
- package/dist/collection/components/pdf-download/pdf-download.js +32 -8
- package/dist/collection/components/public-notification/public-notification.css +46 -41
- package/dist/collection/components/public-notification/public-notification.js +267 -19
- package/dist/collection/components/refine-selection/refine-selection.js +18 -1
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +22 -5
- package/dist/{solutions-components/demos/config-pdf-download.html → collection/demos/buffer-tools.html} +13 -21
- package/dist/collection/demos/index.html +0 -24
- package/dist/collection/demos/map-draw-tools.html +17 -17
- package/dist/collection/demos/map-layer-picker.html +2 -0
- package/dist/collection/demos/map-search.html +16 -15
- package/dist/collection/demos/map-select-tools.html +16 -24
- package/dist/collection/demos/new-public-notification.html +46 -35
- package/dist/collection/demos/pdf-download.html +8 -1
- package/dist/collection/utils/csvUtils.js +4 -4
- package/dist/collection/utils/csvUtils.ts +6 -4
- package/dist/collection/utils/interfaces.ts +65 -1
- package/dist/collection/utils/mapViewUtils.js +36 -22
- package/dist/collection/utils/mapViewUtils.ts +50 -27
- package/dist/collection/utils/publicNotificationStore.js +3 -1
- package/dist/collection/utils/publicNotificationStore.ts +3 -1
- package/dist/collection/utils/queryUtils.js +2 -2
- package/dist/collection/utils/queryUtils.ts +2 -2
- package/dist/components/buffer-tools2.js +1 -1
- package/dist/components/csvUtils.js +4 -4
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.js +0 -5
- package/dist/components/layer-table.js +2 -3
- package/dist/components/map-layer-picker2.js +177 -28
- package/dist/components/map-search.js +47 -7
- package/dist/components/map-select-tools2.js +56 -11
- package/dist/components/pdf-download2.js +217 -8
- package/dist/components/public-notification.js +154 -55
- package/dist/components/publicNotificationStore.js +3 -1
- package/dist/components/queryUtils.js +3 -3
- package/dist/components/refine-selection-tools2.js +9 -8
- package/dist/components/refine-selection2.js +3 -1
- package/dist/esm/buffer-tools_6.entry.js +8 -7
- package/dist/esm/calcite-combobox_3.entry.js +38 -25
- package/dist/esm/calcite-input-message_5.entry.js +271 -20
- package/dist/esm/{csvUtils-edc0c2a8.js → csvUtils-eb231cfb.js} +5 -5
- package/dist/esm/layer-table.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-search.entry.js +46 -7
- package/dist/esm/{mapViewUtils-31d2c2bb.js → mapViewUtils-e5d8a1e1.js} +39 -25
- package/dist/esm/public-notification.entry.js +101 -18
- package/dist/esm/{publicNotificationStore-3e762eea.js → publicNotificationStore-8e9cb73b.js} +3 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/{collection/demos/config-pdf-download.html → solutions-components/demos/buffer-tools.html} +13 -21
- package/dist/solutions-components/demos/index.html +0 -24
- package/dist/solutions-components/demos/map-draw-tools.html +17 -17
- package/dist/solutions-components/demos/map-layer-picker.html +2 -0
- package/dist/solutions-components/demos/map-search.html +16 -15
- package/dist/solutions-components/demos/map-select-tools.html +16 -24
- package/dist/solutions-components/demos/new-public-notification.html +46 -35
- package/dist/solutions-components/demos/pdf-download.html +8 -1
- package/dist/solutions-components/p-07593958.entry.js +6 -0
- package/dist/solutions-components/p-3fa9b3c8.js +36 -0
- package/dist/solutions-components/p-9b5a9117.entry.js +12 -0
- package/dist/solutions-components/{p-15cd8a97.js → p-9c1ebc90.js} +1 -1
- package/dist/solutions-components/{p-c76f8ff7.entry.js → p-a516c658.entry.js} +1 -1
- package/dist/solutions-components/{p-ad42039f.js → p-b668daf8.js} +2 -2
- package/dist/solutions-components/p-bfa95147.entry.js +17 -0
- package/dist/solutions-components/p-d09a168c.entry.js +6 -0
- package/dist/solutions-components/{p-fa6046a8.entry.js → p-fc9609e6.entry.js} +2 -2
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/csvUtils.ts +6 -4
- package/dist/solutions-components/utils/interfaces.ts +65 -1
- package/dist/solutions-components/utils/mapViewUtils.ts +50 -27
- package/dist/solutions-components/utils/publicNotificationStore.ts +3 -1
- package/dist/solutions-components/utils/queryUtils.ts +2 -2
- package/dist/types/components/buffer-tools/buffer-tools.d.ts +4 -3
- package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +22 -11
- package/dist/types/components/map-search/map-search.d.ts +18 -1
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +31 -1
- package/dist/types/components/pdf-download/pdf-download.d.ts +7 -2
- package/dist/types/components/public-notification/public-notification.d.ts +98 -4
- package/dist/types/components/refine-selection/refine-selection.d.ts +5 -0
- package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +6 -1
- package/dist/types/components.d.ts +154 -180
- package/dist/types/preact.d.ts +0 -10
- package/dist/types/utils/csvUtils.d.ts +1 -1
- package/dist/types/utils/interfaces.d.ts +56 -1
- package/dist/types/utils/mapViewUtils.d.ts +19 -9
- package/dist/types/utils/publicNotificationStore.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/check-list.cjs.entry.js +0 -103
- package/dist/cjs/config-buffer-tools.cjs.entry.js +0 -125
- package/dist/cjs/config-draw-tools.cjs.entry.js +0 -85
- package/dist/cjs/config-layer-picker.cjs.entry.js +0 -113
- package/dist/cjs/config-pdf-download.cjs.entry.js +0 -117
- package/dist/cjs/labelFormats-3236d2e0.js +0 -212
- package/dist/collection/components/check-list/check-list.css +0 -3
- package/dist/collection/components/check-list/check-list.js +0 -179
- package/dist/collection/components/config-buffer-tools/config-buffer-tools.css +0 -34
- package/dist/collection/components/config-buffer-tools/config-buffer-tools.js +0 -209
- package/dist/collection/components/config-draw-tools/config-draw-tools.css +0 -17
- package/dist/collection/components/config-draw-tools/config-draw-tools.js +0 -150
- package/dist/collection/components/config-layer-picker/config-layer-picker.css +0 -17
- package/dist/collection/components/config-layer-picker/config-layer-picker.js +0 -218
- package/dist/collection/components/config-pdf-download/config-pdf-download.css +0 -17
- package/dist/collection/components/config-pdf-download/config-pdf-download.js +0 -183
- package/dist/collection/demos/check-list.html +0 -65
- package/dist/collection/demos/config-buffer-tools.html +0 -92
- package/dist/collection/demos/config-draw-tools.html +0 -58
- package/dist/collection/demos/config-layer-picker.html +0 -97
- package/dist/components/check-list.d.ts +0 -11
- package/dist/components/check-list.js +0 -11
- package/dist/components/check-list2.js +0 -131
- package/dist/components/config-buffer-tools.d.ts +0 -11
- package/dist/components/config-buffer-tools.js +0 -187
- package/dist/components/config-draw-tools.d.ts +0 -11
- package/dist/components/config-draw-tools.js +0 -121
- package/dist/components/config-layer-picker.d.ts +0 -11
- package/dist/components/config-layer-picker.js +0 -163
- package/dist/components/config-pdf-download.d.ts +0 -11
- package/dist/components/config-pdf-download.js +0 -154
- package/dist/components/labelFormats.js +0 -210
- package/dist/components/mapViewUtils.js +0 -129
- package/dist/esm/check-list.entry.js +0 -99
- package/dist/esm/config-buffer-tools.entry.js +0 -121
- package/dist/esm/config-draw-tools.entry.js +0 -81
- package/dist/esm/config-layer-picker.entry.js +0 -109
- package/dist/esm/config-pdf-download.entry.js +0 -113
- package/dist/esm/labelFormats-b37958c3.js +0 -210
- package/dist/solutions-components/demos/check-list.html +0 -65
- package/dist/solutions-components/demos/config-buffer-tools.html +0 -92
- package/dist/solutions-components/demos/config-draw-tools.html +0 -58
- package/dist/solutions-components/demos/config-layer-picker.html +0 -97
- package/dist/solutions-components/p-16a0e65a.entry.js +0 -6
- package/dist/solutions-components/p-35078393.entry.js +0 -17
- package/dist/solutions-components/p-3d72bba6.entry.js +0 -6
- package/dist/solutions-components/p-3e444242.entry.js +0 -6
- package/dist/solutions-components/p-67afea92.entry.js +0 -12
- package/dist/solutions-components/p-7dcab29d.js +0 -36
- package/dist/solutions-components/p-89f7b02a.entry.js +0 -6
- package/dist/solutions-components/p-906b7b96.entry.js +0 -6
- package/dist/solutions-components/p-99c98510.entry.js +0 -6
- package/dist/solutions-components/p-b1a3605f.entry.js +0 -6
- package/dist/solutions-components/p-e99b1247.js +0 -6
- package/dist/types/components/check-list/check-list.d.ts +0 -57
- package/dist/types/components/config-buffer-tools/config-buffer-tools.d.ts +0 -92
- package/dist/types/components/config-draw-tools/config-draw-tools.d.ts +0 -58
- package/dist/types/components/config-layer-picker/config-layer-picker.d.ts +0 -83
- package/dist/types/components/config-pdf-download/config-pdf-download.d.ts +0 -81
@@ -1,150 +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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { Host, h } from '@stencil/core';
|
22
|
-
import { getLocaleComponentStrings } from "../../utils/locale";
|
23
|
-
export class ConfigDrawTools {
|
24
|
-
constructor() {
|
25
|
-
this.defaultChecked = true;
|
26
|
-
this._translations = undefined;
|
27
|
-
}
|
28
|
-
//--------------------------------------------------------------------------
|
29
|
-
//
|
30
|
-
// Watch handlers
|
31
|
-
//
|
32
|
-
//--------------------------------------------------------------------------
|
33
|
-
//--------------------------------------------------------------------------
|
34
|
-
//
|
35
|
-
// Methods (public)
|
36
|
-
//
|
37
|
-
//--------------------------------------------------------------------------
|
38
|
-
/**
|
39
|
-
* Returns a key/value pair that represents the checkbox value and checked state
|
40
|
-
*
|
41
|
-
* @returns Promise with the state of the checkboxes
|
42
|
-
*/
|
43
|
-
async getConfigInfo() {
|
44
|
-
return this._checkList.getConfigInfo();
|
45
|
-
}
|
46
|
-
//--------------------------------------------------------------------------
|
47
|
-
//
|
48
|
-
// Events (public)
|
49
|
-
//
|
50
|
-
//--------------------------------------------------------------------------
|
51
|
-
//--------------------------------------------------------------------------
|
52
|
-
//
|
53
|
-
// Functions (lifecycle)
|
54
|
-
//
|
55
|
-
//--------------------------------------------------------------------------
|
56
|
-
/**
|
57
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
58
|
-
*
|
59
|
-
* @returns Promise when complete
|
60
|
-
*/
|
61
|
-
async componentWillLoad() {
|
62
|
-
await this._getTranslations();
|
63
|
-
}
|
64
|
-
/**
|
65
|
-
* Renders the component.
|
66
|
-
*/
|
67
|
-
render() {
|
68
|
-
const nlsTypes = this._translations.types || {};
|
69
|
-
const types = Object.keys(nlsTypes).map(k => nlsTypes[k]);
|
70
|
-
return (h(Host, null, h("div", null, h("div", { class: "padding-block-end-1" }, h("calcite-label", { class: "label-spacing" }, this._translations.drawTools)), h("div", { class: "padding-inline-start-1" }, h("check-list", { defaultChecked: this.defaultChecked, ref: (el) => { this._checkList = el; }, values: types })))));
|
71
|
-
}
|
72
|
-
//--------------------------------------------------------------------------
|
73
|
-
//
|
74
|
-
// Functions (protected)
|
75
|
-
//
|
76
|
-
//--------------------------------------------------------------------------
|
77
|
-
/**
|
78
|
-
* Fetches the component's translations
|
79
|
-
*
|
80
|
-
* @returns Promise when complete
|
81
|
-
* @protected
|
82
|
-
*/
|
83
|
-
async _getTranslations() {
|
84
|
-
const messages = await getLocaleComponentStrings(this.el);
|
85
|
-
this._translations = messages[0];
|
86
|
-
}
|
87
|
-
static get is() { return "config-draw-tools"; }
|
88
|
-
static get encapsulation() { return "shadow"; }
|
89
|
-
static get originalStyleUrls() {
|
90
|
-
return {
|
91
|
-
"$": ["config-draw-tools.css"]
|
92
|
-
};
|
93
|
-
}
|
94
|
-
static get styleUrls() {
|
95
|
-
return {
|
96
|
-
"$": ["config-draw-tools.css"]
|
97
|
-
};
|
98
|
-
}
|
99
|
-
static get properties() {
|
100
|
-
return {
|
101
|
-
"defaultChecked": {
|
102
|
-
"type": "boolean",
|
103
|
-
"mutable": false,
|
104
|
-
"complexType": {
|
105
|
-
"original": "boolean",
|
106
|
-
"resolved": "boolean",
|
107
|
-
"references": {}
|
108
|
-
},
|
109
|
-
"required": false,
|
110
|
-
"optional": false,
|
111
|
-
"docs": {
|
112
|
-
"tags": [],
|
113
|
-
"text": "boolean: All checkboxes checked state will be set with this value on first render.\r\nDefault is true"
|
114
|
-
},
|
115
|
-
"attribute": "default-checked",
|
116
|
-
"reflect": true,
|
117
|
-
"defaultValue": "true"
|
118
|
-
}
|
119
|
-
};
|
120
|
-
}
|
121
|
-
static get states() {
|
122
|
-
return {
|
123
|
-
"_translations": {}
|
124
|
-
};
|
125
|
-
}
|
126
|
-
static get methods() {
|
127
|
-
return {
|
128
|
-
"getConfigInfo": {
|
129
|
-
"complexType": {
|
130
|
-
"signature": "() => Promise<{ [key: string]: boolean; }>",
|
131
|
-
"parameters": [],
|
132
|
-
"references": {
|
133
|
-
"Promise": {
|
134
|
-
"location": "global"
|
135
|
-
}
|
136
|
-
},
|
137
|
-
"return": "Promise<{ [key: string]: boolean; }>"
|
138
|
-
},
|
139
|
-
"docs": {
|
140
|
-
"text": "Returns a key/value pair that represents the checkbox value and checked state",
|
141
|
-
"tags": [{
|
142
|
-
"name": "returns",
|
143
|
-
"text": "Promise with the state of the checkboxes"
|
144
|
-
}]
|
145
|
-
}
|
146
|
-
}
|
147
|
-
};
|
148
|
-
}
|
149
|
-
static get elementRef() { return "el"; }
|
150
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
:host {
|
2
|
-
display: block;
|
3
|
-
}
|
4
|
-
|
5
|
-
.label-spacing {
|
6
|
-
--calcite-label-margin-bottom: 0;
|
7
|
-
}
|
8
|
-
|
9
|
-
.padding-block-end-1 {
|
10
|
-
-webkit-padding-after: 1rem;
|
11
|
-
padding-block-end: 1rem;
|
12
|
-
}
|
13
|
-
|
14
|
-
.padding-inline-start-1 {
|
15
|
-
-webkit-padding-start: 1rem;
|
16
|
-
padding-inline-start: 1rem;
|
17
|
-
}
|
@@ -1,218 +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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { Host, h } from '@stencil/core';
|
22
|
-
import { getLocaleComponentStrings } from "../../utils/locale";
|
23
|
-
import { getMapLayerNames } from "../../utils/mapViewUtils";
|
24
|
-
export class ConfigLayerPicker {
|
25
|
-
constructor() {
|
26
|
-
this.defaultChecked = true;
|
27
|
-
this.instruction = "";
|
28
|
-
this.mapView = undefined;
|
29
|
-
this._layerNames = [];
|
30
|
-
this._translations = undefined;
|
31
|
-
}
|
32
|
-
//--------------------------------------------------------------------------
|
33
|
-
//
|
34
|
-
// Watch handlers
|
35
|
-
//
|
36
|
-
//--------------------------------------------------------------------------
|
37
|
-
/**
|
38
|
-
* Called each time the mapView prop is changed.
|
39
|
-
*
|
40
|
-
*/
|
41
|
-
async watchStateHandler() {
|
42
|
-
await this._setLayers();
|
43
|
-
}
|
44
|
-
//--------------------------------------------------------------------------
|
45
|
-
//
|
46
|
-
// Methods (public)
|
47
|
-
//
|
48
|
-
//--------------------------------------------------------------------------
|
49
|
-
/**
|
50
|
-
* Returns a list of layers that have been selected
|
51
|
-
*
|
52
|
-
* @returns Promise with a list of layer names to use
|
53
|
-
*/
|
54
|
-
async getConfigInfo() {
|
55
|
-
return typeof this._checkList.value === "string" ?
|
56
|
-
[this._checkList.value] : this._checkList.value;
|
57
|
-
}
|
58
|
-
//--------------------------------------------------------------------------
|
59
|
-
//
|
60
|
-
// Events (public)
|
61
|
-
//
|
62
|
-
//--------------------------------------------------------------------------
|
63
|
-
//--------------------------------------------------------------------------
|
64
|
-
//
|
65
|
-
// Functions (lifecycle)
|
66
|
-
//
|
67
|
-
//--------------------------------------------------------------------------
|
68
|
-
/**
|
69
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
70
|
-
*
|
71
|
-
* @returns Promise when complete
|
72
|
-
*/
|
73
|
-
async componentWillLoad() {
|
74
|
-
await this._setLayers();
|
75
|
-
await this._getTranslations();
|
76
|
-
}
|
77
|
-
/**
|
78
|
-
* Renders the component.
|
79
|
-
*/
|
80
|
-
render() {
|
81
|
-
return (h(Host, null, h("div", null, h("div", { class: "padding-block-end-1" }, h("calcite-label", { class: "label-spacing" }, this.instruction || this._translations.chooseLayer)), h("div", { class: "padding-inline-start-1" }, h("calcite-combobox", { label: '', overlayPositioning: "fixed", ref: (el) => { this._checkList = el; }, selectionMode: "multiple" }, this._getComboboxItems())))));
|
82
|
-
}
|
83
|
-
//--------------------------------------------------------------------------
|
84
|
-
//
|
85
|
-
// Functions (protected)
|
86
|
-
//
|
87
|
-
//--------------------------------------------------------------------------
|
88
|
-
_getComboboxItems() {
|
89
|
-
return this._layerNames ? this._layerNames.map(name => (h("calcite-combobox-item", { textLabel: name, value: name }))) : [];
|
90
|
-
}
|
91
|
-
/**
|
92
|
-
* Fetch the names of the layers from the map
|
93
|
-
*
|
94
|
-
* @returns Promise when the operation has completed
|
95
|
-
*/
|
96
|
-
async _setLayers() {
|
97
|
-
if (this.mapView) {
|
98
|
-
this._layerNames = await getMapLayerNames(this.mapView);
|
99
|
-
}
|
100
|
-
}
|
101
|
-
/**
|
102
|
-
* Fetches the component's translations
|
103
|
-
*
|
104
|
-
* @returns Promise when complete
|
105
|
-
* @protected
|
106
|
-
*/
|
107
|
-
async _getTranslations() {
|
108
|
-
const messages = await getLocaleComponentStrings(this.el);
|
109
|
-
this._translations = messages[0];
|
110
|
-
}
|
111
|
-
static get is() { return "config-layer-picker"; }
|
112
|
-
static get encapsulation() { return "shadow"; }
|
113
|
-
static get originalStyleUrls() {
|
114
|
-
return {
|
115
|
-
"$": ["config-layer-picker.css"]
|
116
|
-
};
|
117
|
-
}
|
118
|
-
static get styleUrls() {
|
119
|
-
return {
|
120
|
-
"$": ["config-layer-picker.css"]
|
121
|
-
};
|
122
|
-
}
|
123
|
-
static get properties() {
|
124
|
-
return {
|
125
|
-
"defaultChecked": {
|
126
|
-
"type": "boolean",
|
127
|
-
"mutable": false,
|
128
|
-
"complexType": {
|
129
|
-
"original": "boolean",
|
130
|
-
"resolved": "boolean",
|
131
|
-
"references": {}
|
132
|
-
},
|
133
|
-
"required": false,
|
134
|
-
"optional": false,
|
135
|
-
"docs": {
|
136
|
-
"tags": [],
|
137
|
-
"text": "boolean: All checkboxes checked state will be set with this value on first render.\r\nDefault is true"
|
138
|
-
},
|
139
|
-
"attribute": "default-checked",
|
140
|
-
"reflect": true,
|
141
|
-
"defaultValue": "true"
|
142
|
-
},
|
143
|
-
"instruction": {
|
144
|
-
"type": "string",
|
145
|
-
"mutable": false,
|
146
|
-
"complexType": {
|
147
|
-
"original": "string",
|
148
|
-
"resolved": "string",
|
149
|
-
"references": {}
|
150
|
-
},
|
151
|
-
"required": false,
|
152
|
-
"optional": false,
|
153
|
-
"docs": {
|
154
|
-
"tags": [],
|
155
|
-
"text": "string: Value to be shown above the check list\r\nAllows this to support multiple sets of layers."
|
156
|
-
},
|
157
|
-
"attribute": "instruction",
|
158
|
-
"reflect": false,
|
159
|
-
"defaultValue": "\"\""
|
160
|
-
},
|
161
|
-
"mapView": {
|
162
|
-
"type": "unknown",
|
163
|
-
"mutable": false,
|
164
|
-
"complexType": {
|
165
|
-
"original": "__esri.MapView",
|
166
|
-
"resolved": "MapView",
|
167
|
-
"references": {
|
168
|
-
"___esri": {
|
169
|
-
"location": "global"
|
170
|
-
}
|
171
|
-
}
|
172
|
-
},
|
173
|
-
"required": false,
|
174
|
-
"optional": false,
|
175
|
-
"docs": {
|
176
|
-
"tags": [],
|
177
|
-
"text": "esri/views/View: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"
|
178
|
-
}
|
179
|
-
}
|
180
|
-
};
|
181
|
-
}
|
182
|
-
static get states() {
|
183
|
-
return {
|
184
|
-
"_layerNames": {},
|
185
|
-
"_translations": {}
|
186
|
-
};
|
187
|
-
}
|
188
|
-
static get methods() {
|
189
|
-
return {
|
190
|
-
"getConfigInfo": {
|
191
|
-
"complexType": {
|
192
|
-
"signature": "() => Promise<string[]>",
|
193
|
-
"parameters": [],
|
194
|
-
"references": {
|
195
|
-
"Promise": {
|
196
|
-
"location": "global"
|
197
|
-
}
|
198
|
-
},
|
199
|
-
"return": "Promise<string[]>"
|
200
|
-
},
|
201
|
-
"docs": {
|
202
|
-
"text": "Returns a list of layers that have been selected",
|
203
|
-
"tags": [{
|
204
|
-
"name": "returns",
|
205
|
-
"text": "Promise with a list of layer names to use"
|
206
|
-
}]
|
207
|
-
}
|
208
|
-
}
|
209
|
-
};
|
210
|
-
}
|
211
|
-
static get elementRef() { return "el"; }
|
212
|
-
static get watchers() {
|
213
|
-
return [{
|
214
|
-
"propName": "mapView",
|
215
|
-
"methodName": "watchStateHandler"
|
216
|
-
}];
|
217
|
-
}
|
218
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
:host {
|
2
|
-
display: block;
|
3
|
-
}
|
4
|
-
|
5
|
-
.label-spacing {
|
6
|
-
--calcite-label-margin-bottom: 0;
|
7
|
-
}
|
8
|
-
|
9
|
-
.padding-block-end-1 {
|
10
|
-
-webkit-padding-after: 1rem;
|
11
|
-
padding-block-end: 1rem;
|
12
|
-
}
|
13
|
-
|
14
|
-
.padding-inline-start-1 {
|
15
|
-
-webkit-padding-start: 1rem;
|
16
|
-
padding-inline-start: 1rem;
|
17
|
-
}
|
@@ -1,183 +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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { Host, h } from '@stencil/core';
|
22
|
-
import { getLocaleComponentStrings } from "../../utils/locale";
|
23
|
-
import * as pdfUtils from "../../assets/data/labelFormats.json";
|
24
|
-
export class ConfigPdfDownload {
|
25
|
-
constructor() {
|
26
|
-
this.defaultChecked = true;
|
27
|
-
this._formatOptions = [];
|
28
|
-
this._translations = undefined;
|
29
|
-
}
|
30
|
-
//--------------------------------------------------------------------------
|
31
|
-
//
|
32
|
-
// Watch handlers
|
33
|
-
//
|
34
|
-
//--------------------------------------------------------------------------
|
35
|
-
//--------------------------------------------------------------------------
|
36
|
-
//
|
37
|
-
// Methods (public)
|
38
|
-
//
|
39
|
-
//--------------------------------------------------------------------------
|
40
|
-
/**
|
41
|
-
* Returns a key/value pair that represents the checkbox value and checked state
|
42
|
-
*
|
43
|
-
* @returns Promise with the state of the checkboxes
|
44
|
-
*/
|
45
|
-
async getConfigInfo() {
|
46
|
-
const formatOptions = await this._formatOptionsCheckList.getConfigInfo();
|
47
|
-
const csvOptions = await this._csvOptionsCheckList.getConfigInfo();
|
48
|
-
return Object.assign(Object.assign({}, formatOptions), csvOptions);
|
49
|
-
}
|
50
|
-
//--------------------------------------------------------------------------
|
51
|
-
//
|
52
|
-
// Events (public)
|
53
|
-
//
|
54
|
-
//--------------------------------------------------------------------------
|
55
|
-
//--------------------------------------------------------------------------
|
56
|
-
//
|
57
|
-
// Functions (lifecycle)
|
58
|
-
//
|
59
|
-
//--------------------------------------------------------------------------
|
60
|
-
/**
|
61
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
62
|
-
*
|
63
|
-
* @returns Promise when complete
|
64
|
-
*/
|
65
|
-
async componentWillLoad() {
|
66
|
-
await this._getTranslations();
|
67
|
-
await this._setFormatOptions();
|
68
|
-
}
|
69
|
-
/**
|
70
|
-
* Renders the component.
|
71
|
-
*/
|
72
|
-
render() {
|
73
|
-
return (h(Host, null, h("div", null, h("div", { class: "padding-block-end-1" }, h("calcite-label", { class: "label-spacing" }, this._translations.availableLabelFormats)), h("div", { class: "padding-block-end-1 padding-inline-start-1" }, h("check-list", { defaultChecked: this.defaultChecked, ref: (el) => { this._formatOptionsCheckList = el; }, values: this._formatOptions })), h("div", { class: "padding-block-end-1" }, h("calcite-label", { class: "label-spacing" }, this._translations.csvOptions)), h("div", { class: "padding-block-end-1 padding-inline-start-1" }, h("check-list", { defaultChecked: this.defaultChecked, ref: (el) => { this._csvOptionsCheckList = el; }, values: [this._translations.csvColumnTitle] })))));
|
74
|
-
}
|
75
|
-
//--------------------------------------------------------------------------
|
76
|
-
//
|
77
|
-
// Functions (protected)
|
78
|
-
//
|
79
|
-
//--------------------------------------------------------------------------
|
80
|
-
/**
|
81
|
-
* Fetch the names of the layers from the map
|
82
|
-
*
|
83
|
-
* @returns Promise when the operation has completed
|
84
|
-
*/
|
85
|
-
async _setFormatOptions() {
|
86
|
-
const s = pdfUtils;
|
87
|
-
const sortedPdfIndo = (s.default || s).sort((a, b) => {
|
88
|
-
const _a = parseInt(a.descriptionPDF.labelsPerPageDisplay, 10);
|
89
|
-
const _b = parseInt(b.descriptionPDF.labelsPerPageDisplay, 10);
|
90
|
-
return _a < _b ? -1 : _a > _b ? 1 : 0;
|
91
|
-
});
|
92
|
-
this._formatOptions = sortedPdfIndo.map(l => {
|
93
|
-
return this._getLabelSizeText(l);
|
94
|
-
});
|
95
|
-
}
|
96
|
-
/**
|
97
|
-
* Gets the formatted pdf export size text
|
98
|
-
*
|
99
|
-
* @param labelInfo current user selected label info
|
100
|
-
*
|
101
|
-
* @returns the pdf label as a string
|
102
|
-
* @protected
|
103
|
-
*/
|
104
|
-
_getLabelSizeText(labelInfo) {
|
105
|
-
const lNum = labelInfo.descriptionPDF.labelsPerPageDisplay;
|
106
|
-
const lSize = `${labelInfo.descriptionPDF.labelWidthDisplay} x ${labelInfo.descriptionPDF.labelHeightDisplay}`;
|
107
|
-
return this._translations.pdfLabel.replace("{{n}}", lNum).replace("{{labelSize}}", lSize);
|
108
|
-
}
|
109
|
-
/**
|
110
|
-
* Fetches the component's translations
|
111
|
-
*
|
112
|
-
* @returns Promise when complete
|
113
|
-
* @protected
|
114
|
-
*/
|
115
|
-
async _getTranslations() {
|
116
|
-
const messages = await getLocaleComponentStrings(this.el);
|
117
|
-
this._translations = messages[0];
|
118
|
-
}
|
119
|
-
static get is() { return "config-pdf-download"; }
|
120
|
-
static get encapsulation() { return "shadow"; }
|
121
|
-
static get originalStyleUrls() {
|
122
|
-
return {
|
123
|
-
"$": ["config-pdf-download.css"]
|
124
|
-
};
|
125
|
-
}
|
126
|
-
static get styleUrls() {
|
127
|
-
return {
|
128
|
-
"$": ["config-pdf-download.css"]
|
129
|
-
};
|
130
|
-
}
|
131
|
-
static get properties() {
|
132
|
-
return {
|
133
|
-
"defaultChecked": {
|
134
|
-
"type": "boolean",
|
135
|
-
"mutable": false,
|
136
|
-
"complexType": {
|
137
|
-
"original": "boolean",
|
138
|
-
"resolved": "boolean",
|
139
|
-
"references": {}
|
140
|
-
},
|
141
|
-
"required": false,
|
142
|
-
"optional": false,
|
143
|
-
"docs": {
|
144
|
-
"tags": [],
|
145
|
-
"text": "boolean: All checkboxes checked state will be set with this value on first render.\r\nDefault is true"
|
146
|
-
},
|
147
|
-
"attribute": "default-checked",
|
148
|
-
"reflect": true,
|
149
|
-
"defaultValue": "true"
|
150
|
-
}
|
151
|
-
};
|
152
|
-
}
|
153
|
-
static get states() {
|
154
|
-
return {
|
155
|
-
"_formatOptions": {},
|
156
|
-
"_translations": {}
|
157
|
-
};
|
158
|
-
}
|
159
|
-
static get methods() {
|
160
|
-
return {
|
161
|
-
"getConfigInfo": {
|
162
|
-
"complexType": {
|
163
|
-
"signature": "() => Promise<{ [key: string]: boolean; }>",
|
164
|
-
"parameters": [],
|
165
|
-
"references": {
|
166
|
-
"Promise": {
|
167
|
-
"location": "global"
|
168
|
-
}
|
169
|
-
},
|
170
|
-
"return": "Promise<{ [key: string]: boolean; }>"
|
171
|
-
},
|
172
|
-
"docs": {
|
173
|
-
"text": "Returns a key/value pair that represents the checkbox value and checked state",
|
174
|
-
"tags": [{
|
175
|
-
"name": "returns",
|
176
|
-
"text": "Promise with the state of the checkboxes"
|
177
|
-
}]
|
178
|
-
}
|
179
|
-
}
|
180
|
-
};
|
181
|
-
}
|
182
|
-
static get elementRef() { return "el"; }
|
183
|
-
}
|
@@ -1,65 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<meta charset="utf-8" />
|
4
|
-
<meta
|
5
|
-
name="viewport"
|
6
|
-
content="initial-scale=1,maximum-scale=1,user-scalable=no"
|
7
|
-
/>
|
8
|
-
<title>Check List</title>
|
9
|
-
<!--
|
10
|
-
| Copyright 2022 Esri
|
11
|
-
|
|
12
|
-
| Licensed under the Apache License, Version 2.0 (the "License");
|
13
|
-
| you may not use this file except in compliance with the License.
|
14
|
-
| You may obtain a copy of the License at
|
15
|
-
|
|
16
|
-
| http://www.apache.org/licenses/LICENSE-2.0
|
17
|
-
|
|
18
|
-
| Unless required by applicable law or agreed to in writing, software
|
19
|
-
| distributed under the License is distributed on an "AS IS" BASIS,
|
20
|
-
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
21
|
-
| See the License for the specific language governing permissions and
|
22
|
-
| limitations under the License.
|
23
|
-
-->
|
24
|
-
<style>
|
25
|
-
.over-map {
|
26
|
-
position: absolute;
|
27
|
-
right: 0px;
|
28
|
-
background-color: var(--calcite-ui-foreground-1);
|
29
|
-
}
|
30
|
-
.column {
|
31
|
-
min-width: 300px;
|
32
|
-
margin: 1rem;
|
33
|
-
padding: 1rem;
|
34
|
-
border: 1px solid;
|
35
|
-
}
|
36
|
-
</style>
|
37
|
-
|
38
|
-
<link rel="stylesheet" href="https://unpkg.com/@esri/calcite-components@1.0.0-beta.97/dist/calcite/calcite.css" type="text/css" />
|
39
|
-
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
|
40
|
-
<link rel="stylesheet" href="../solutions-components.css" type="text/css">
|
41
|
-
|
42
|
-
<script type="module" src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.97/dist/calcite/calcite.esm.js"></script>
|
43
|
-
<script type="module" src="../solutions-components.esm.js"></script>
|
44
|
-
<script>
|
45
|
-
function loadList() {
|
46
|
-
const demo = document.getElementById("demo");
|
47
|
-
demo.values = ["A", "B", "C"];
|
48
|
-
}
|
49
|
-
|
50
|
-
function showResults() {
|
51
|
-
const demo = document.getElementById("demo");
|
52
|
-
demo?.getConfigInfo().then(configInfo => {
|
53
|
-
alert(JSON.stringify(configInfo));
|
54
|
-
});
|
55
|
-
}
|
56
|
-
</script>
|
57
|
-
</head>
|
58
|
-
|
59
|
-
<body onload="loadList()">
|
60
|
-
<div class="over-map column">
|
61
|
-
<check-list id="demo"></check-list>
|
62
|
-
<calcite-button onclick="showResults()">Demo Results</calcite-button>
|
63
|
-
</div>
|
64
|
-
</body>
|
65
|
-
</html>
|