@esri/solutions-components 0.6.6 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_4.cjs.entry.js +622 -0
- package/dist/cjs/card-manager_4.cjs.entry.js +91 -37
- package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -0
- package/dist/collection/components/basemap-gallery/basemap-gallery.js +166 -0
- package/dist/collection/components/basemap-gallery/test/basemap-gallery.e2e.js +29 -0
- package/dist/collection/components/basemap-gallery/test/basemap-gallery.spec.js +37 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +43 -2
- package/dist/collection/components/layer-table/layer-table.js +99 -30
- package/dist/collection/components/map-card/map-card.css +0 -7
- package/dist/collection/components/map-card/map-card.js +12 -7
- package/dist/collection/components/map-search/map-search.css +24 -0
- package/dist/collection/components/map-search/map-search.js +321 -0
- package/dist/collection/components/map-search/test/map-search.e2e.js +29 -0
- package/dist/collection/components/map-search/test/map-search.spec.js +37 -0
- package/dist/collection/components/map-tools/map-tools.js +139 -14
- package/dist/collection/demos/crowdsource-manager.html +3 -3
- package/dist/collection/utils/interfaces.ts +2 -0
- package/dist/components/action-bar.js +1 -0
- package/dist/components/action-group.js +1 -0
- package/dist/components/action-menu.js +1 -0
- package/dist/components/action.js +1 -0
- package/dist/components/alert.js +1 -0
- package/dist/components/avatar.js +1 -0
- package/dist/components/basemap-gallery.d.ts +11 -0
- package/dist/components/basemap-gallery.js +11 -0
- package/dist/components/basemap-gallery2.js +118 -0
- package/dist/components/buffer-tools2.js +1 -0
- package/dist/components/button.js +1 -0
- package/dist/components/calcite-accordion-item.js +1 -0
- package/dist/components/calcite-accordion.js +1 -0
- package/dist/components/calcite-action-pad.js +1 -0
- package/dist/components/calcite-block-section.js +1 -0
- package/dist/components/calcite-block.js +1 -0
- package/dist/components/calcite-card.js +1 -0
- package/dist/components/calcite-chip-group.js +1 -0
- package/dist/components/calcite-color-picker.js +1 -0
- package/dist/components/calcite-combobox-item-group.js +1 -0
- package/dist/components/calcite-fab.js +1 -0
- package/dist/components/calcite-flow-item.js +1 -0
- package/dist/components/calcite-flow.js +1 -0
- package/dist/components/calcite-inline-editable.js +1 -0
- package/dist/components/calcite-input-date-picker.js +1 -0
- package/dist/components/calcite-input-time-picker.js +1 -0
- package/dist/components/calcite-input-time-zone.js +1 -0
- package/dist/components/calcite-list-item-group.js +1 -0
- package/dist/components/calcite-menu-item.js +1 -0
- package/dist/components/calcite-modal.js +1 -0
- package/dist/components/calcite-navigation-logo.js +1 -0
- package/dist/components/calcite-navigation-user.js +1 -0
- package/dist/components/calcite-navigation.js +1 -0
- package/dist/components/calcite-option-group.js +1 -0
- package/dist/components/calcite-pagination.js +1 -0
- package/dist/components/calcite-pick-list-group.js +1 -0
- package/dist/components/calcite-pick-list.js +1 -0
- package/dist/components/calcite-radio-button-group.js +1 -0
- package/dist/components/calcite-radio-button.js +1 -0
- package/dist/components/calcite-rating.js +1 -0
- package/dist/components/calcite-shell-center-row.js +1 -0
- package/dist/components/calcite-sortable-list.js +1 -0
- package/dist/components/calcite-split-button.js +1 -0
- package/dist/components/calcite-stepper-item.js +1 -0
- package/dist/components/calcite-stepper.js +1 -0
- package/dist/components/calcite-text-area.js +1 -0
- package/dist/components/calcite-tile-select-group.js +1 -0
- package/dist/components/calcite-tile-select.js +1 -0
- package/dist/components/calcite-tip-group.js +1 -0
- package/dist/components/calcite-tip-manager.js +1 -0
- package/dist/components/calcite-tip.js +1 -0
- package/dist/components/card-manager2.js +1 -0
- package/dist/components/checkbox.js +1 -0
- package/dist/components/chip.js +1 -0
- package/dist/components/color-picker-hex-input.js +1 -0
- package/dist/components/color-picker-swatch.js +1 -0
- package/dist/components/combobox-item.js +1 -0
- package/dist/components/combobox.js +1 -0
- package/dist/components/crowdsource-manager.js +95 -78
- package/dist/components/crowdsource-reporter.js +1 -0
- package/dist/components/date-picker-day.js +1 -0
- package/dist/components/date-picker-month-header.js +1 -0
- package/dist/components/date-picker-month.js +1 -0
- package/dist/components/date-picker.js +1 -0
- package/dist/components/deduct-calculator2.js +1 -0
- package/dist/components/dropdown-group.js +1 -0
- package/dist/components/dropdown-item.js +1 -0
- package/dist/components/dropdown.js +1 -0
- package/dist/components/edit-card2.js +1 -0
- package/dist/components/esri-loader.js +301 -0
- package/dist/components/filter2.js +1 -0
- package/dist/components/graph.js +1 -0
- package/dist/components/handle.js +1 -0
- package/dist/components/icon.js +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/info-card2.js +1 -0
- package/dist/components/input-message.js +1 -0
- package/dist/components/input-number.js +1 -0
- package/dist/components/input-text.js +1 -0
- package/dist/components/input.js +1 -0
- package/dist/components/json-editor2.js +1 -0
- package/dist/components/label2.js +1 -0
- package/dist/components/layer-table2.js +83 -31
- package/dist/components/layout-manager2.js +1 -0
- package/dist/components/link.js +1 -0
- package/dist/components/list-item.js +1 -0
- package/dist/components/list-item2.js +1 -0
- package/dist/components/list.js +1 -0
- package/dist/components/loadModules.js +1 -1
- package/dist/components/loader.js +1 -0
- package/dist/components/locale.js +2 -295
- package/dist/components/map-card2.js +61 -42
- package/dist/components/map-draw-tools2.js +1 -0
- package/dist/components/map-layer-picker2.js +1 -0
- package/dist/components/map-picker2.js +1 -0
- package/dist/components/map-search.d.ts +11 -0
- package/dist/components/map-search.js +11 -0
- package/dist/components/map-search2.js +201 -0
- package/dist/components/map-select-tools2.js +1 -0
- package/dist/components/map-tools2.js +141 -30
- package/dist/components/menu.js +1 -0
- package/dist/components/notice.js +1 -0
- package/dist/components/option.js +1 -0
- package/dist/components/panel.js +1 -0
- package/dist/components/pci-calculator.js +1 -0
- package/dist/components/pdf-download2.js +1 -0
- package/dist/components/pick-list-item.js +1 -0
- package/dist/components/popover.js +1 -0
- package/dist/components/progress.js +1 -0
- package/dist/components/public-notification.js +1 -0
- package/dist/components/refine-selection2.js +1 -0
- package/dist/components/scrim.js +1 -0
- package/dist/components/segmented-control-item.js +1 -0
- package/dist/components/segmented-control.js +1 -0
- package/dist/components/select.js +1 -0
- package/dist/components/shell-panel.js +1 -0
- package/dist/components/shell.js +1 -0
- package/dist/components/slider.js +1 -0
- package/dist/components/solution-configuration.js +1 -0
- package/dist/components/solution-contents2.js +1 -0
- package/dist/components/solution-item-details2.js +1 -0
- package/dist/components/solution-item-icon2.js +1 -0
- package/dist/components/solution-item-sharing2.js +1 -0
- package/dist/components/solution-item2.js +1 -0
- package/dist/components/solution-organization-variables2.js +1 -0
- package/dist/components/solution-resource-item2.js +1 -0
- package/dist/components/solution-spatial-ref2.js +1 -0
- package/dist/components/solution-template-data2.js +1 -0
- package/dist/components/solution-variables2.js +1 -0
- package/dist/components/stack.js +1 -0
- package/dist/components/store-manager.js +1 -0
- package/dist/components/switch.js +1 -0
- package/dist/components/tab-nav.js +1 -0
- package/dist/components/tab-title.js +1 -0
- package/dist/components/tab.js +1 -0
- package/dist/components/tabs.js +1 -0
- package/dist/components/tile.js +1 -0
- package/dist/components/time-picker.js +1 -0
- package/dist/components/tooltip.js +1 -0
- package/dist/components/tree-item.js +1 -0
- package/dist/components/tree.js +1 -0
- package/dist/components/value-list-item.js +1 -0
- package/dist/components/value-list.js +1 -0
- package/dist/esm/basemap-gallery_4.entry.js +615 -0
- package/dist/esm/card-manager_4.entry.js +91 -37
- package/dist/esm/crowdsource-manager.entry.js +4 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/solutions-components.js +2 -2
- package/dist/solutions-components/demos/crowdsource-manager.html +3 -3
- package/dist/solutions-components/p-55aefaa8.entry.js +6 -0
- package/dist/solutions-components/p-5b5a6ac8.entry.js +6 -0
- package/dist/solutions-components/p-a6c85bd7.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +2 -0
- package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +64 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +9 -1
- package/dist/types/components/layer-table/layer-table.d.ts +24 -2
- package/dist/types/components/map-card/map-card.d.ts +10 -2
- package/dist/types/components/map-search/map-search.d.ts +107 -0
- package/dist/types/components/map-tools/map-tools.d.ts +68 -5
- package/dist/types/components.d.ts +122 -0
- package/dist/types/preact.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +2 -0
- package/dist/types/utils/interfaces.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/map-picker_2.cjs.entry.js +0 -264
- package/dist/esm/map-picker_2.entry.js +0 -259
- package/dist/solutions-components/p-1990d9c8.entry.js +0 -6
- package/dist/solutions-components/p-40bde8b2.entry.js +0 -6
- package/dist/solutions-components/p-b921aa1a.entry.js +0 -6
@@ -1,264 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Copyright 2022 Esri
|
3
|
-
* Licensed under the Apache License, Version 2.0
|
4
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
-
*/
|
6
|
-
'use strict';
|
7
|
-
|
8
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
9
|
-
|
10
|
-
const index = require('./index-0e50040c.js');
|
11
|
-
const locale = require('./locale-d15cd743.js');
|
12
|
-
const interfaces = require('./interfaces-d539e30c.js');
|
13
|
-
require('./_commonjsHelpers-384729db.js');
|
14
|
-
|
15
|
-
const mapPickerCss = ":host{display:block}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background);z-index:1;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}";
|
16
|
-
|
17
|
-
const MapPicker = class {
|
18
|
-
constructor(hostRef) {
|
19
|
-
index.registerInstance(this, hostRef);
|
20
|
-
this.mapInfoChange = index.createEvent(this, "mapInfoChange", 7);
|
21
|
-
/**
|
22
|
-
* string: the id of map currently displayed
|
23
|
-
*/
|
24
|
-
this._loadedId = "";
|
25
|
-
this.mapInfos = [];
|
26
|
-
this._mapListExpanded = false;
|
27
|
-
this._webMapInfo = undefined;
|
28
|
-
}
|
29
|
-
//--------------------------------------------------------------------------
|
30
|
-
//
|
31
|
-
// Watch handlers
|
32
|
-
//
|
33
|
-
//--------------------------------------------------------------------------
|
34
|
-
/**
|
35
|
-
* Called each time the _webMapInfo prop is changed.
|
36
|
-
*/
|
37
|
-
_webMapInfoWatchHandler(v, oldV) {
|
38
|
-
if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
|
39
|
-
this._loadedId = v === null || v === void 0 ? void 0 : v.id;
|
40
|
-
this.mapInfoChange.emit(v);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
/**
|
44
|
-
* Called each time the mapInfos prop is changed.
|
45
|
-
*/
|
46
|
-
mapInfosWatchHandler(v, oldV) {
|
47
|
-
if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
|
48
|
-
this.mapInfoChange.emit(v[0]);
|
49
|
-
}
|
50
|
-
}
|
51
|
-
//--------------------------------------------------------------------------
|
52
|
-
//
|
53
|
-
// Functions (lifecycle)
|
54
|
-
//
|
55
|
-
//--------------------------------------------------------------------------
|
56
|
-
/**
|
57
|
-
* Renders the component.
|
58
|
-
*/
|
59
|
-
render() {
|
60
|
-
return (index.h(index.Host, null, this._getToolbar(), this._getMapNameList(this._mapListExpanded)));
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* Called after each render
|
64
|
-
*/
|
65
|
-
async componentDidRender() {
|
66
|
-
if (this._mapListExpanded) {
|
67
|
-
await this._list.setFocus();
|
68
|
-
}
|
69
|
-
}
|
70
|
-
/**
|
71
|
-
* Called once after the component has loaded
|
72
|
-
*/
|
73
|
-
componentDidLoad() {
|
74
|
-
const webMapInfo = this.mapInfos && this.mapInfos.length > 0 ? this.mapInfos[0] : undefined;
|
75
|
-
if (webMapInfo) {
|
76
|
-
this._webMapSelected(webMapInfo);
|
77
|
-
}
|
78
|
-
}
|
79
|
-
//--------------------------------------------------------------------------
|
80
|
-
//
|
81
|
-
// Functions (protected)
|
82
|
-
//
|
83
|
-
//--------------------------------------------------------------------------
|
84
|
-
/**
|
85
|
-
* Get a calcite action group for the map list
|
86
|
-
* Actions do not support multiple icons so this uses a block
|
87
|
-
*
|
88
|
-
* @returns the dom node for the action group
|
89
|
-
*
|
90
|
-
* @protected
|
91
|
-
*/
|
92
|
-
_getMapPicker() {
|
93
|
-
var _a;
|
94
|
-
const mapListIcon = this._mapListExpanded ? "chevron-up" : "chevron-down";
|
95
|
-
return (index.h("calcite-button", { alignment: "icon-end-space-between", appearance: "solid", class: "width-full height-full", iconEnd: mapListIcon, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, (_a = this._webMapInfo) === null || _a === void 0 ? void 0 : _a.name));
|
96
|
-
}
|
97
|
-
/**
|
98
|
-
* Create the toolbar (controls used for map and app interactions)
|
99
|
-
*
|
100
|
-
* @returns The dom node with the toolbar
|
101
|
-
*
|
102
|
-
* @protected
|
103
|
-
*/
|
104
|
-
_getToolbar() {
|
105
|
-
return (index.h("div", { class: "display-flex" }, index.h("calcite-action-bar", { class: "border-bottom-1 action-bar-size", "expand-disabled": true, layout: "horizontal", slot: "header" }, this._getMapPicker())));
|
106
|
-
}
|
107
|
-
/**
|
108
|
-
* Get a pick list for all maps in mapInfos
|
109
|
-
*
|
110
|
-
* @param show boolean to indicate if the list should be shown or hidden
|
111
|
-
*
|
112
|
-
* @returns the dom node for the list of maps
|
113
|
-
*
|
114
|
-
* @protected
|
115
|
-
*/
|
116
|
-
_getMapNameList(show) {
|
117
|
-
const listClass = show ? "map-list" : "display-none";
|
118
|
-
return (index.h("div", { class: listClass }, index.h("calcite-list", { id: "mapList", ref: (el) => this._list = el, selectionAppearance: "border" }, this.mapInfos.map(mapInfo => {
|
119
|
-
return (index.h("calcite-list-item", { label: mapInfo.name, onClick: () => this._webMapSelected(mapInfo), selected: mapInfo.id === this._loadedId, value: mapInfo.id }));
|
120
|
-
}))));
|
121
|
-
}
|
122
|
-
/**
|
123
|
-
* Fired when the user clicks on the map list
|
124
|
-
*
|
125
|
-
* @param webMapInfo the web map id and name selected from the list
|
126
|
-
*
|
127
|
-
* @returns void
|
128
|
-
*
|
129
|
-
* @protected
|
130
|
-
*/
|
131
|
-
_webMapSelected(webMapInfo) {
|
132
|
-
this._mapListExpanded = false;
|
133
|
-
this._webMapInfo = webMapInfo;
|
134
|
-
}
|
135
|
-
/**
|
136
|
-
* Toggles the open/close state of the map list
|
137
|
-
*
|
138
|
-
* @returns the dom node for the action group
|
139
|
-
*
|
140
|
-
* @protected
|
141
|
-
*/
|
142
|
-
_chooseMap() {
|
143
|
-
this._mapListExpanded = !this._mapListExpanded;
|
144
|
-
}
|
145
|
-
get el() { return index.getElement(this); }
|
146
|
-
static get watchers() { return {
|
147
|
-
"_webMapInfo": ["_webMapInfoWatchHandler"],
|
148
|
-
"mapInfos": ["mapInfosWatchHandler"]
|
149
|
-
}; }
|
150
|
-
};
|
151
|
-
MapPicker.style = mapPickerCss;
|
152
|
-
|
153
|
-
const mapToolsCss = ":host{display:block}.display-none{display:none}.border{border:1px solid var(--calcite-ui-border-3)}.margin-top-1-2{margin-top:0.5rem}";
|
154
|
-
|
155
|
-
const MapTools = class {
|
156
|
-
constructor(hostRef) {
|
157
|
-
index.registerInstance(this, hostRef);
|
158
|
-
this.expandMap = index.createEvent(this, "expandMap", 7);
|
159
|
-
this.layout = "vertical";
|
160
|
-
this.mapView = undefined;
|
161
|
-
this._translations = undefined;
|
162
|
-
this._showTools = true;
|
163
|
-
this._showBasemapPicker = false;
|
164
|
-
}
|
165
|
-
//--------------------------------------------------------------------------
|
166
|
-
//
|
167
|
-
// Functions (lifecycle)
|
168
|
-
//
|
169
|
-
//--------------------------------------------------------------------------
|
170
|
-
/**
|
171
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
172
|
-
*/
|
173
|
-
async componentWillLoad() {
|
174
|
-
await this._getTranslations();
|
175
|
-
}
|
176
|
-
/**
|
177
|
-
* StencilJS: Renders the component.
|
178
|
-
*/
|
179
|
-
render() {
|
180
|
-
const toggleIcon = this._showTools ? "chevrons-up" : "chevrons-down";
|
181
|
-
const toolsClass = this._showTools ? "" : "display-none";
|
182
|
-
return (index.h(index.Host, null, index.h("div", { class: "display-flex" }, index.h("calcite-action", { alignment: "center", class: "border", compact: false, icon: toggleIcon, onClick: () => { this._toggleTools(); }, text: "" }), index.h("calcite-action-bar", { class: `border margin-top-1-2 ${toolsClass}`, "expand-disabled": true, layout: this.layout }, this._getActionGroup("home", false, this._translations.home, () => this._goHome()), this._getActionGroup("plus", false, this._translations.zoomIn, () => this._zoomIn()), this._getActionGroup("minus", false, this._translations.zoomOut, () => this._zoomOut()), this._getActionGroup("list", false, this._translations.list, () => this._showList()), this._getActionGroup("magnifying-glass", false, this._translations.search, () => this._search()), this._getActionGroup("expand", false, this._translations.expand, () => this._expand()), this._getActionGroup("basemap", false, this._translations.basemap, () => this._toggleBasemapPicker())))));
|
183
|
-
}
|
184
|
-
/**
|
185
|
-
* Get a calcite action group for the current action
|
186
|
-
*
|
187
|
-
* @param icon the icon to display for the current action
|
188
|
-
* @param disabled should the action be disabled
|
189
|
-
* @param tip information tip to display helpful details to end user
|
190
|
-
* @param func the associated onClick function to execute
|
191
|
-
*
|
192
|
-
* @returns the dom node for the action group
|
193
|
-
*
|
194
|
-
* @protected
|
195
|
-
*/
|
196
|
-
_getActionGroup(icon, disabled, tip, func) {
|
197
|
-
return (index.h("calcite-action-group", null, index.h("calcite-action", { alignment: "center", compact: false, disabled: disabled, icon: icon, id: icon, onClick: func, text: "" }, index.h("calcite-icon", { icon: "cheveron-up", scale: "s", slot: "icon" })), index.h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, index.h("span", null, tip))));
|
198
|
-
}
|
199
|
-
// Need to discuss this with the team
|
200
|
-
_goHome() {
|
201
|
-
alert("go home");
|
202
|
-
}
|
203
|
-
// need to discuss this with the team
|
204
|
-
_showList() {
|
205
|
-
alert("show list");
|
206
|
-
}
|
207
|
-
// Need to discuss this with the team
|
208
|
-
_search() {
|
209
|
-
alert("search");
|
210
|
-
}
|
211
|
-
// Need to explore map fixed zoom in considerations
|
212
|
-
_zoomIn() {
|
213
|
-
alert("zoom in");
|
214
|
-
}
|
215
|
-
// Need to explore map fixed zoom out considerations
|
216
|
-
_zoomOut() {
|
217
|
-
alert("zoom out");
|
218
|
-
}
|
219
|
-
/**
|
220
|
-
* Show/Hide the basemap picker
|
221
|
-
*
|
222
|
-
* @returns void
|
223
|
-
*
|
224
|
-
* @protected
|
225
|
-
*/
|
226
|
-
_toggleBasemapPicker() {
|
227
|
-
this._showBasemapPicker = !this._showBasemapPicker;
|
228
|
-
}
|
229
|
-
/**
|
230
|
-
* Emit the expand map event
|
231
|
-
*
|
232
|
-
* @returns void
|
233
|
-
*
|
234
|
-
* @protected
|
235
|
-
*/
|
236
|
-
_expand() {
|
237
|
-
this.expandMap.emit(interfaces.EExpandType.EXPAND);
|
238
|
-
}
|
239
|
-
/**
|
240
|
-
* Show/Hide the map tools
|
241
|
-
*
|
242
|
-
* @returns void
|
243
|
-
*
|
244
|
-
* @protected
|
245
|
-
*/
|
246
|
-
_toggleTools() {
|
247
|
-
this._showTools = !this._showTools;
|
248
|
-
}
|
249
|
-
/**
|
250
|
-
* Fetches the component's translations
|
251
|
-
*
|
252
|
-
* @returns Promise when complete
|
253
|
-
* @protected
|
254
|
-
*/
|
255
|
-
async _getTranslations() {
|
256
|
-
const messages = await locale.getLocaleComponentStrings(this.el);
|
257
|
-
this._translations = messages[0];
|
258
|
-
}
|
259
|
-
get el() { return index.getElement(this); }
|
260
|
-
};
|
261
|
-
MapTools.style = mapToolsCss;
|
262
|
-
|
263
|
-
exports.map_picker = MapPicker;
|
264
|
-
exports.map_tools = MapTools;
|
@@ -1,259 +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
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-b5d9d795.js';
|
7
|
-
import { g as getLocaleComponentStrings } from './locale-aa3de591.js';
|
8
|
-
import { g as EExpandType } from './interfaces-5a2fe8b4.js';
|
9
|
-
import './_commonjsHelpers-d5f9d613.js';
|
10
|
-
|
11
|
-
const mapPickerCss = ":host{display:block}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background);z-index:1;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}";
|
12
|
-
|
13
|
-
const MapPicker = class {
|
14
|
-
constructor(hostRef) {
|
15
|
-
registerInstance(this, hostRef);
|
16
|
-
this.mapInfoChange = createEvent(this, "mapInfoChange", 7);
|
17
|
-
/**
|
18
|
-
* string: the id of map currently displayed
|
19
|
-
*/
|
20
|
-
this._loadedId = "";
|
21
|
-
this.mapInfos = [];
|
22
|
-
this._mapListExpanded = false;
|
23
|
-
this._webMapInfo = undefined;
|
24
|
-
}
|
25
|
-
//--------------------------------------------------------------------------
|
26
|
-
//
|
27
|
-
// Watch handlers
|
28
|
-
//
|
29
|
-
//--------------------------------------------------------------------------
|
30
|
-
/**
|
31
|
-
* Called each time the _webMapInfo prop is changed.
|
32
|
-
*/
|
33
|
-
_webMapInfoWatchHandler(v, oldV) {
|
34
|
-
if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
|
35
|
-
this._loadedId = v === null || v === void 0 ? void 0 : v.id;
|
36
|
-
this.mapInfoChange.emit(v);
|
37
|
-
}
|
38
|
-
}
|
39
|
-
/**
|
40
|
-
* Called each time the mapInfos prop is changed.
|
41
|
-
*/
|
42
|
-
mapInfosWatchHandler(v, oldV) {
|
43
|
-
if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
|
44
|
-
this.mapInfoChange.emit(v[0]);
|
45
|
-
}
|
46
|
-
}
|
47
|
-
//--------------------------------------------------------------------------
|
48
|
-
//
|
49
|
-
// Functions (lifecycle)
|
50
|
-
//
|
51
|
-
//--------------------------------------------------------------------------
|
52
|
-
/**
|
53
|
-
* Renders the component.
|
54
|
-
*/
|
55
|
-
render() {
|
56
|
-
return (h(Host, null, this._getToolbar(), this._getMapNameList(this._mapListExpanded)));
|
57
|
-
}
|
58
|
-
/**
|
59
|
-
* Called after each render
|
60
|
-
*/
|
61
|
-
async componentDidRender() {
|
62
|
-
if (this._mapListExpanded) {
|
63
|
-
await this._list.setFocus();
|
64
|
-
}
|
65
|
-
}
|
66
|
-
/**
|
67
|
-
* Called once after the component has loaded
|
68
|
-
*/
|
69
|
-
componentDidLoad() {
|
70
|
-
const webMapInfo = this.mapInfos && this.mapInfos.length > 0 ? this.mapInfos[0] : undefined;
|
71
|
-
if (webMapInfo) {
|
72
|
-
this._webMapSelected(webMapInfo);
|
73
|
-
}
|
74
|
-
}
|
75
|
-
//--------------------------------------------------------------------------
|
76
|
-
//
|
77
|
-
// Functions (protected)
|
78
|
-
//
|
79
|
-
//--------------------------------------------------------------------------
|
80
|
-
/**
|
81
|
-
* Get a calcite action group for the map list
|
82
|
-
* Actions do not support multiple icons so this uses a block
|
83
|
-
*
|
84
|
-
* @returns the dom node for the action group
|
85
|
-
*
|
86
|
-
* @protected
|
87
|
-
*/
|
88
|
-
_getMapPicker() {
|
89
|
-
var _a;
|
90
|
-
const mapListIcon = this._mapListExpanded ? "chevron-up" : "chevron-down";
|
91
|
-
return (h("calcite-button", { alignment: "icon-end-space-between", appearance: "solid", class: "width-full height-full", iconEnd: mapListIcon, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, (_a = this._webMapInfo) === null || _a === void 0 ? void 0 : _a.name));
|
92
|
-
}
|
93
|
-
/**
|
94
|
-
* Create the toolbar (controls used for map and app interactions)
|
95
|
-
*
|
96
|
-
* @returns The dom node with the toolbar
|
97
|
-
*
|
98
|
-
* @protected
|
99
|
-
*/
|
100
|
-
_getToolbar() {
|
101
|
-
return (h("div", { class: "display-flex" }, h("calcite-action-bar", { class: "border-bottom-1 action-bar-size", "expand-disabled": true, layout: "horizontal", slot: "header" }, this._getMapPicker())));
|
102
|
-
}
|
103
|
-
/**
|
104
|
-
* Get a pick list for all maps in mapInfos
|
105
|
-
*
|
106
|
-
* @param show boolean to indicate if the list should be shown or hidden
|
107
|
-
*
|
108
|
-
* @returns the dom node for the list of maps
|
109
|
-
*
|
110
|
-
* @protected
|
111
|
-
*/
|
112
|
-
_getMapNameList(show) {
|
113
|
-
const listClass = show ? "map-list" : "display-none";
|
114
|
-
return (h("div", { class: listClass }, h("calcite-list", { id: "mapList", ref: (el) => this._list = el, selectionAppearance: "border" }, this.mapInfos.map(mapInfo => {
|
115
|
-
return (h("calcite-list-item", { label: mapInfo.name, onClick: () => this._webMapSelected(mapInfo), selected: mapInfo.id === this._loadedId, value: mapInfo.id }));
|
116
|
-
}))));
|
117
|
-
}
|
118
|
-
/**
|
119
|
-
* Fired when the user clicks on the map list
|
120
|
-
*
|
121
|
-
* @param webMapInfo the web map id and name selected from the list
|
122
|
-
*
|
123
|
-
* @returns void
|
124
|
-
*
|
125
|
-
* @protected
|
126
|
-
*/
|
127
|
-
_webMapSelected(webMapInfo) {
|
128
|
-
this._mapListExpanded = false;
|
129
|
-
this._webMapInfo = webMapInfo;
|
130
|
-
}
|
131
|
-
/**
|
132
|
-
* Toggles the open/close state of the map list
|
133
|
-
*
|
134
|
-
* @returns the dom node for the action group
|
135
|
-
*
|
136
|
-
* @protected
|
137
|
-
*/
|
138
|
-
_chooseMap() {
|
139
|
-
this._mapListExpanded = !this._mapListExpanded;
|
140
|
-
}
|
141
|
-
get el() { return getElement(this); }
|
142
|
-
static get watchers() { return {
|
143
|
-
"_webMapInfo": ["_webMapInfoWatchHandler"],
|
144
|
-
"mapInfos": ["mapInfosWatchHandler"]
|
145
|
-
}; }
|
146
|
-
};
|
147
|
-
MapPicker.style = mapPickerCss;
|
148
|
-
|
149
|
-
const mapToolsCss = ":host{display:block}.display-none{display:none}.border{border:1px solid var(--calcite-ui-border-3)}.margin-top-1-2{margin-top:0.5rem}";
|
150
|
-
|
151
|
-
const MapTools = class {
|
152
|
-
constructor(hostRef) {
|
153
|
-
registerInstance(this, hostRef);
|
154
|
-
this.expandMap = createEvent(this, "expandMap", 7);
|
155
|
-
this.layout = "vertical";
|
156
|
-
this.mapView = undefined;
|
157
|
-
this._translations = undefined;
|
158
|
-
this._showTools = true;
|
159
|
-
this._showBasemapPicker = false;
|
160
|
-
}
|
161
|
-
//--------------------------------------------------------------------------
|
162
|
-
//
|
163
|
-
// Functions (lifecycle)
|
164
|
-
//
|
165
|
-
//--------------------------------------------------------------------------
|
166
|
-
/**
|
167
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
168
|
-
*/
|
169
|
-
async componentWillLoad() {
|
170
|
-
await this._getTranslations();
|
171
|
-
}
|
172
|
-
/**
|
173
|
-
* StencilJS: Renders the component.
|
174
|
-
*/
|
175
|
-
render() {
|
176
|
-
const toggleIcon = this._showTools ? "chevrons-up" : "chevrons-down";
|
177
|
-
const toolsClass = this._showTools ? "" : "display-none";
|
178
|
-
return (h(Host, null, h("div", { class: "display-flex" }, h("calcite-action", { alignment: "center", class: "border", compact: false, icon: toggleIcon, onClick: () => { this._toggleTools(); }, text: "" }), h("calcite-action-bar", { class: `border margin-top-1-2 ${toolsClass}`, "expand-disabled": true, layout: this.layout }, this._getActionGroup("home", false, this._translations.home, () => this._goHome()), this._getActionGroup("plus", false, this._translations.zoomIn, () => this._zoomIn()), this._getActionGroup("minus", false, this._translations.zoomOut, () => this._zoomOut()), this._getActionGroup("list", false, this._translations.list, () => this._showList()), this._getActionGroup("magnifying-glass", false, this._translations.search, () => this._search()), this._getActionGroup("expand", false, this._translations.expand, () => this._expand()), this._getActionGroup("basemap", false, this._translations.basemap, () => this._toggleBasemapPicker())))));
|
179
|
-
}
|
180
|
-
/**
|
181
|
-
* Get a calcite action group for the current action
|
182
|
-
*
|
183
|
-
* @param icon the icon to display for the current action
|
184
|
-
* @param disabled should the action be disabled
|
185
|
-
* @param tip information tip to display helpful details to end user
|
186
|
-
* @param func the associated onClick function to execute
|
187
|
-
*
|
188
|
-
* @returns the dom node for the action group
|
189
|
-
*
|
190
|
-
* @protected
|
191
|
-
*/
|
192
|
-
_getActionGroup(icon, disabled, tip, func) {
|
193
|
-
return (h("calcite-action-group", null, h("calcite-action", { alignment: "center", compact: false, disabled: disabled, icon: icon, id: icon, onClick: func, text: "" }, h("calcite-icon", { icon: "cheveron-up", scale: "s", slot: "icon" })), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, h("span", null, tip))));
|
194
|
-
}
|
195
|
-
// Need to discuss this with the team
|
196
|
-
_goHome() {
|
197
|
-
alert("go home");
|
198
|
-
}
|
199
|
-
// need to discuss this with the team
|
200
|
-
_showList() {
|
201
|
-
alert("show list");
|
202
|
-
}
|
203
|
-
// Need to discuss this with the team
|
204
|
-
_search() {
|
205
|
-
alert("search");
|
206
|
-
}
|
207
|
-
// Need to explore map fixed zoom in considerations
|
208
|
-
_zoomIn() {
|
209
|
-
alert("zoom in");
|
210
|
-
}
|
211
|
-
// Need to explore map fixed zoom out considerations
|
212
|
-
_zoomOut() {
|
213
|
-
alert("zoom out");
|
214
|
-
}
|
215
|
-
/**
|
216
|
-
* Show/Hide the basemap picker
|
217
|
-
*
|
218
|
-
* @returns void
|
219
|
-
*
|
220
|
-
* @protected
|
221
|
-
*/
|
222
|
-
_toggleBasemapPicker() {
|
223
|
-
this._showBasemapPicker = !this._showBasemapPicker;
|
224
|
-
}
|
225
|
-
/**
|
226
|
-
* Emit the expand map event
|
227
|
-
*
|
228
|
-
* @returns void
|
229
|
-
*
|
230
|
-
* @protected
|
231
|
-
*/
|
232
|
-
_expand() {
|
233
|
-
this.expandMap.emit(EExpandType.EXPAND);
|
234
|
-
}
|
235
|
-
/**
|
236
|
-
* Show/Hide the map tools
|
237
|
-
*
|
238
|
-
* @returns void
|
239
|
-
*
|
240
|
-
* @protected
|
241
|
-
*/
|
242
|
-
_toggleTools() {
|
243
|
-
this._showTools = !this._showTools;
|
244
|
-
}
|
245
|
-
/**
|
246
|
-
* Fetches the component's translations
|
247
|
-
*
|
248
|
-
* @returns Promise when complete
|
249
|
-
* @protected
|
250
|
-
*/
|
251
|
-
async _getTranslations() {
|
252
|
-
const messages = await getLocaleComponentStrings(this.el);
|
253
|
-
this._translations = messages[0];
|
254
|
-
}
|
255
|
-
get el() { return getElement(this); }
|
256
|
-
};
|
257
|
-
MapTools.style = mapToolsCss;
|
258
|
-
|
259
|
-
export { MapPicker as map_picker, MapTools as map_tools };
|
@@ -1,6 +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
|
-
import{r as t,h as i,H as e,g as l}from"./p-9310b882.js";import{g as h}from"./p-a0a2c53d.js";import{E as s}from"./p-868df4a0.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this.classicGrid=!1,this.hideHeader=!0,this.hideMap=!1,this.mapInfos=[],this.zoomAndScrollToSelected=!1,this._translations=void 0,this._layoutMode=s.GRID,this._mapView=void 0,this._panelOpen=!0}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapView=t.detail,this._mapView.popupEnabled=!1}async componentWillLoad(){await this._getTranslations()}render(){return i(e,null,i("calcite-shell",null,i("calcite-panel",{class:"width-full height-full",heading:this.hideHeader?void 0:this._translations.header},this.hideHeader?void 0:i("layout-manager",{slot:"header-actions-end"}),this._getBody(this._layoutMode,this._panelOpen,this.hideMap))))}_getDividerIcon(t,i){let e="";switch(t){case s.HORIZONTAL:e=this.classicGrid?i?"chevrons-down":"chevrons-up":i?"chevrons-up":"chevrons-down";break;case s.VERTICAL:e=this.classicGrid?i?"chevrons-right":"chevrons-left":i?"chevrons-left":"chevrons-right";break;case s.GRID:e=this.classicGrid?i?"chevrons-up":"chevrons-down":i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i){let e="";switch(t){case s.HORIZONTAL:e=(i?"height-1-2":"height-0")+" width-full position-relative";break;case s.GRID:e=this.classicGrid?(i?"position-relative":"position-absolute-53")+" height-full width-full display-flex":"height-full position-relative "+(i?"width-1-3":"width-0");break;case s.VERTICAL:e="height-full position-relative "+(i?"width-1-2":"width-0")}return e}_getTableSizeClass(t,i){let e="";switch(t){case s.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case s.GRID:e=this.classicGrid?(i?"height-full":"height-53")+" position-relative width-full display-flex":(i?"width-2-3":"width-full")+" height-full display-flex";break;case s.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,l){const h=this.classicGrid&&t===s.GRID&&e?"display-grid":t===s.HORIZONTAL?"":"display-flex";return i("calcite-panel",{class:"width-full height-full"},this.classicGrid?i("div",{class:`width-full height-full ${h}`},this._getTable(t,e),this._getMapAndCard(t,e,l)):i("div",{class:`width-full height-full ${h}`},this._getMapAndCard(t,e,l),this._getTable(t,e)))}_getMapAndCard(t,e,l){const h=this._getMapSizeClass(t,e);return this.classicGrid?i("div",{class:`${h} overflow-hidden`},this._getCardNode(t,l),this._getMapNode(t,l)):i("div",{class:`${h} overflow-hidden`},this._getMapNode(t,l),this._getCardNode(t,l))}_getMapNode(t,e){return i("div",{class:`${this.classicGrid&&t===s.GRID?"width-full":"adjusted-height-50"} overflow-hidden ${this.classicGrid&&t===s.GRID?"display-flex height-full width-1-2":t!==s.GRID||e?"display-none":""}`},i("map-card",{class:"width-full",mapInfos:this.mapInfos}))}_getCardNode(t,e){return i("div",{class:"padding-1-2 "+(this.classicGrid&&t===s.GRID?"width-full adjusted-height-100":"width-50 height-full")},i("card-manager",{class:(this.classicGrid&&t===s.GRID?"":t!==s.GRID||e?"adjusted-height-100":"adjusted-height-50")+" width-full",mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e){const l=this._getTableSizeClass(t,e),h=this._getDividerIcon(t,e),a=e?this._translations.close:this._translations.open,o="toggle-layout";return i("calcite-shell",{class:l+" border-bottom"},i("calcite-action-bar",{class:"border",expandDisabled:!0,layout:t===s.HORIZONTAL||this.classicGrid?"horizontal":"vertical",slot:this.classicGrid&&t!==s.VERTICAL?"footer":this.classicGrid&&t===s.VERTICAL?"panel-end":t===s.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:h,id:o,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:a,placement:"bottom","reference-element":o},i("span",null,a))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_toggleLayout(){this._panelOpen=!this._panelOpen}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return l(this)}};a.style=":host{display:block;--calcite-label-margin-bottom:0px}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.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:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-ui-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 0.5rem)}.adjusted-height-100{height:calc(100% - 1rem)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}";export{a as crowdsource_manager}
|
@@ -1,6 +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
|
-
import{r as t,h as i,H as e,g as s,c as a}from"./p-9310b882.js";import{g as l}from"./p-a0a2c53d.js";import{q as n,a as o,b as h,g as c,c as r}from"./p-f8dd2784.js";import{l as d}from"./p-6de98c51.js";import{d as p}from"./p-75f26870.js";import{E as g}from"./p-868df4a0.js";import"./p-e1a4994d.js";const m=class{constructor(i){t(this,i),this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(t){const i=t.detail;this._cardLoading=!0;const e=i.length>0?await n(i,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=e,this._cardLoading=!1}async layerSelectionChange(t){const i=t.detail[0];this.layer=await o(this.mapView,i)}async componentWillLoad(){await this._getTranslations()}render(){var t,s;const a=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",l=(null===(s=this._graphics)||void 0===s?void 0:s.length)>0?"display-none":"";return i(e,null,i("div",{class:"border-rounded overflow-auto height-full"},i("calcite-shell",{class:"position-relative padding-1 "+a},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),i("div",{class:"padding-1 "+l},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart)))))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}};m.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.border-rounded{border:1px solid var(--calcite-ui-border-2);border-radius:5px}.height-full{height:100%}card-manager{display:block}";const u=class{constructor(i){t(this,i),this.featureSelectionChange=a(this,"featureSelectionChange",7),this._allIds=[],this.onTableNodeCreate=t=>{this._tableNode=t,this._getTable(t)},this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._alertOpen=!1,this._fetchingData=!1,this._layer=void 0,this._selectedIndexes=[],this._showOnlySelected=!1,this._translations=void 0}async mapViewWatchHandler(){this._fetchingData=!0;const t=await h(this.mapView);this._layer=await o(this.mapView,t[0]),this._resetTable(),this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})),this._fetchingData=!1}async _layerWatchHandler(){this._fetchingData=!0,this._resetTable(),this._fetchingData=!1}async getSelectedGraphics(){return this._selectedIndexes.length>0?await this._getGraphics(this._selectedIndexes):[]}async selectionChanged(t){if(this.zoomAndScrollToSelected){const i=t.detail,e=i.getObjectId(),s=this._table.viewModel.getObjectIdIndex(e);this._table.scrollToIndex(s);const a=i.layer;let l;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===a.title&&"feature"===t.layer.type)return l=t,!0})),l&&await c([e],l,this.mapView,!0)}}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){if(!this._layer)return null;const t=this._fetchingData?"display-none":"",s=this._fetchingData?"":"display-none",a=this._alertShowAction?"":"display-none";return i(e,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full width-full"},i("calcite-panel",{class:"height-full width-full"},i("calcite-loader",{class:s,label:this._translations.fetchingData,scale:"l"}),i("div",{class:t,ref:this.onTableNodeCreate}))),i("calcite-alert",{icon:this._alertIcon,kind:this._alertKind,label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},i("div",{slot:"title"},this._alertTitle),i("div",{slot:"message"},this._alertMessage),i("calcite-link",{class:a,onClick:this._alertActionFunction,slot:"link"},this._alertActionText))))}async _initModules(){const[t,i]=await d(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_getTableControlRow(t){const e=this._selectedIndexes.length>0;return i("div",{class:"display-flex table-border height-51",slot:t},i("calcite-action-bar",{expandDisabled:!0,expanded:!0,layout:"horizontal"},i("div",{class:"border-end"},i("map-layer-picker",{appearance:"transparent",mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),placeholderIcon:"layers",scale:"l",type:"dropdown"})),i("calcite-action",{appearance:"solid",disabled:!e,icon:"magnifying-glass",id:"magnifying-glass",label:this._translations.zoom,onClick:()=>this._zoom(),text:this._translations.zoom,textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"magnifying-glass"},i("span",null,this._translations.zoom)),i("calcite-action",{appearance:"solid",icon:"filter",id:"filter",onClick:()=>this._filter(),text:this._translations.filters,"text-enabled":"true",textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"filter"},i("span",null,this._translations.filters)),i("calcite-action",{appearance:"solid",disabled:!e,id:"trash",onClick:()=>this._delete(),text:""},i("calcite-button",{appearance:"transparent",iconStart:"trash",kind:"danger"},this._translations.delete)),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"trash"},i("span",null,this._translations.delete)),i("calcite-action",{appearance:"solid",disabled:!e,icon:"erase",id:"erase",onClick:()=>this._clearSelection(),text:this._translations.clearSelection,"text-enabled":"true",textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"erase"},i("span",null,this._translations.clearSelection))),i("calcite-dropdown",null,i("calcite-action",{appearance:"solid",label:"",slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},i("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll()},this._translations.selectAll),i("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._toggleShowSelected()},this._showOnlySelected?this._translations.showAll:this._translations.showSelected),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._refresh()},this._translations.refresh),i("calcite-dropdown-item",{iconStart:"export",onClick:()=>{this._exportToCSV()}},this._translations.exportCSV))))}_getTable(t){this._layer&&(this._table=new this.FeatureTable({layer:this._layer,view:this.mapView,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},container:t}),this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray(),this._showOnlySelected&&(this._selectedIndexes.length>0?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})))}_resetTable(){this._layer&&this._table&&(this._clearSelection(),this.featureSelectionChange.emit(this._selectedIndexes),this._table.layer=this._layer,this._editEnabled=this._layer.editingEnabled,this._table.view=this.mapView,this._table.editingEnabled=this._editEnabled,this._table.clearSelectionFilter(),this._showOnlySelected=!1)}async _mapClicked(t){const i={include:this._layer},e=await this.mapView.hitTest(t.screenPoint,i);e.results.length>0&&(e.results.forEach((t=>{const i=t.graphic.getObjectId(),e=this._table.highlightIds.indexOf(i);e>-1?this._table.highlightIds.removeAt(e):this._table.highlightIds.add(i)})),this._showOnlySelected&&this._table.filterBySelection())}_alertClosed(){this._alertOpen=!1}_selectAll(){const t=this._allIds;this._table.highlightIds.addMany(t),this._selectedIndexes=t}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){this._selectedIndexes=[],this._table.highlightIds.removeAll()}_filter(){alert("do whatever this button is supposed to do")}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._allIds.reduce(((i,e,s)=>(t.indexOf(s)<0&&i.push(s),i)),[]),this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(this._selectedIndexes)}async _exportToCSV(){const t={},i=this._table.highlightIds.toArray();t[this._layer.id]={selectionSetNames:[],ids:i,layer:this._layer},p(t,!1,!0)}_refresh(){this._table.refresh()}_zoom(){this._table.zoomToSelection()}_delete(){this._editEnabled?(this._alertIcon="trash",this._alertTitle=this._translations.deleteRows,this._alertActionText=this._translations.delete,this._alertShowAction=!0,this._alertMessage=this._translations.confirm,this._alertKind="danger",this._alertActionFunction=()=>{this._layer.applyEdits({deleteFeatures:this._table.highlightIds.toArray()}),this._alertOpen=!1}):(this._alertIcon="layer-broken",this._alertTitle=this._translations.deleteDisabled,this._alertShowAction=!1,this._alertMessage=this._translations.enableEditing,this._alertKind="warning"),this._alertOpen=!0}async _getGraphics(t){return t.length>0?n(t,this._table.layer,[],!1,this.mapView.spatialReference):[]}async _layerSelectionChanged(t){const i=t.detail[0];i===this._layer.id&&0!==this._allIds.length||(this._fetchingData=!0,this._table.highlightIds.removeAll(),this._layer=await o(this.mapView,i),this._allIds=await r(this._layer),this._selectedIndexes=[],this._table.layer=this._layer,this._table.render(),this._fetchingData=!1)}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"]}}};u.style=":host{display:block}.height-full{height:100%}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.height-51{height:51px}";const b=class{constructor(i){t(this,i),this.layoutChanged=a(this,"layoutChanged",7),this._layoutMode=g.GRID,this._translations=void 0}async componentWillLoad(){await this._getTranslations()}render(){return i(e,null,i("div",{class:"display-flex"},i("div",{class:"display-flex action-center"},i("calcite-icon",{class:"icon icon-color",icon:"information",id:"app-information-icon",scale:"s"}),i("calcite-popover",{closable:!0,label:"",referenceElement:"app-information-icon"},i("span",{class:"tooltip-message"},this._translations.appInfo))),i("div",{class:"header-text"},this._translations.layout),this._getAction("grid-background",g.GRID,this._translations.grid),this._getAction("vertical-background",g.VERTICAL,this._translations.vertical),this._getAction("horizontal-background",g.HORIZONTAL,this._translations.horizontal)))}_getAction(t,e,s){return i("div",null,i("calcite-action",{alignment:"center",appearance:"transparent",compact:!1,id:t,indicator:e===this._layoutMode,onClick:()=>{this._setLayoutMode(e)},text:""},i("div",{class:t+" img-background"})),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},i("span",null,s)))}_setLayoutMode(t){this._layoutMode=t,this.layoutChanged.emit(this._layoutMode)}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}};b.style=":host{display:block}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.display-flex{display:flex}.icon-color{--calcite-ui-icon-color:var(--calcite-ui-brand)}.icon{cursor:pointer}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}.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}.img-background{background-repeat:no-repeat;background-size:100% 100%;width:38px;height:26px}.grid-background{background-image:url('../../assets/data/images/grid.png')}.horizontal-background{background-image:url('../../assets/data/images/horizontal.png')}.vertical-background{background-image:url('../../assets/data/images/vertical.png')}";const f=class{constructor(i){t(this,i),this.mapChanged=a(this,"mapChanged",7),this._loadedId="",this.mapInfos=[],this.mapView=void 0,this._webMapInfo=void 0}async mapInfoChange(t){this._loadMap(t.detail)}async componentWillLoad(){await this._initModules()}render(){return i(e,null,i("map-picker",{mapInfos:this.mapInfos}),i("div",{class:"map-height",ref:t=>this._mapDiv=t}),i("map-tools",{class:"map-tools"}))}async _initModules(){const[t,i]=await d(["esri/WebMap","esri/views/MapView"]);this.WebMap=t,this.MapView=i}_loadMap(t){let i=null==t?void 0:t.id;if(this._webMapInfo=(""===i||!i)&&this.mapInfos.length>0?this.mapInfos[0]:t,i=this._webMapInfo.id,this._loadedId!==i){const t=new this.WebMap({portalItem:{id:i}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"top-left"}),this._loadedId=i,this.mapChanged.emit(this.mapView)}}get el(){return s(this)}};f.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 58px)}.esri-zoom{display:none !important}.map-tools{position:absolute;top:40px;right:0px;padding:1rem}";export{m as card_manager,u as layer_table,b as layout_manager,f as map_card}
|
@@ -1,6 +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
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-9310b882.js";import{g as o}from"./p-a0a2c53d.js";import{g as n}from"./p-868df4a0.js";import"./p-e1a4994d.js";const l=class{constructor(s){t(this,s),this.mapInfoChange=i(this,"mapInfoChange",7),this._loadedId="",this.mapInfos=[],this._mapListExpanded=!1,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=null==t?void 0:t.id,this.mapInfoChange.emit(t))}mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this.mapInfoChange.emit(t[0])}render(){return s(e,null,this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidRender(){this._mapListExpanded&&await this._list.setFocus()}componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){var t;return s("calcite-button",{alignment:"icon-end-space-between",appearance:"solid",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name)}_getToolbar(){return s("div",{class:"display-flex"},s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return s("div",{class:t?"map-list":"display-none"},s("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border"},this.mapInfos.map((t=>s("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}get el(){return a(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};l.style=":host{display:block}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background);z-index:1;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}";const c=class{constructor(s){t(this,s),this.expandMap=i(this,"expandMap",7),this.layout="vertical",this.mapView=void 0,this._translations=void 0,this._showTools=!0,this._showBasemapPicker=!1}async componentWillLoad(){await this._getTranslations()}render(){const t=this._showTools?"":"display-none";return s(e,null,s("div",{class:"display-flex"},s("calcite-action",{alignment:"center",class:"border",compact:!1,icon:this._showTools?"chevrons-up":"chevrons-down",onClick:()=>{this._toggleTools()},text:""}),s("calcite-action-bar",{class:`border margin-top-1-2 ${t}`,"expand-disabled":!0,layout:this.layout},this._getActionGroup("home",!1,this._translations.home,(()=>this._goHome())),this._getActionGroup("plus",!1,this._translations.zoomIn,(()=>this._zoomIn())),this._getActionGroup("minus",!1,this._translations.zoomOut,(()=>this._zoomOut())),this._getActionGroup("list",!1,this._translations.list,(()=>this._showList())),this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())),this._getActionGroup("expand",!1,this._translations.expand,(()=>this._expand())),this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())))))}_getActionGroup(t,i,e,a){return s("calcite-action-group",null,s("calcite-action",{alignment:"center",compact:!1,disabled:i,icon:t,id:t,onClick:a,text:""},s("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),s("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},s("span",null,e)))}_goHome(){alert("go home")}_showList(){alert("show list")}_search(){alert("search")}_zoomIn(){alert("zoom in")}_zoomOut(){alert("zoom out")}_toggleBasemapPicker(){this._showBasemapPicker=!this._showBasemapPicker}_expand(){this.expandMap.emit(n.EXPAND)}_toggleTools(){this._showTools=!this._showTools}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}get el(){return a(this)}};c.style=":host{display:block}.display-none{display:none}.border{border:1px solid var(--calcite-ui-border-3)}.margin-top-1-2{margin-top:0.5rem}";export{l as map_picker,c as map_tools}
|