@esri/solutions-components 0.6.28 → 0.6.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +2 -2
- package/dist/cjs/calcite-alert_3.cjs.entry.js +3 -3
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +2 -2
- package/dist/cjs/card-manager_3.cjs.entry.js +333 -11
- package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/basemap-gallery/basemap-gallery.js +2 -2
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +0 -4
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +3 -3
- package/dist/collection/components/edit-card/edit-card.css +9 -0
- package/dist/collection/components/edit-card/edit-card.js +2 -2
- package/dist/collection/components/layer-table/layer-table.css +6 -2
- package/dist/collection/components/layer-table/layer-table.js +337 -10
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +2 -2
- package/dist/collection/utils/interfaces.ts +14 -0
- package/dist/components/basemap-gallery2.js +2 -2
- package/dist/components/crowdsource-manager.js +4 -4
- package/dist/components/edit-card2.js +3 -3
- package/dist/components/layer-table2.js +336 -11
- package/dist/components/map-layer-picker2.js +2 -2
- package/dist/esm/basemap-gallery_7.entry.js +2 -2
- package/dist/esm/calcite-alert_3.entry.js +3 -3
- package/dist/esm/calcite-combobox_6.entry.js +2 -2
- package/dist/esm/card-manager_3.entry.js +333 -11
- package/dist/esm/crowdsource-manager.entry.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-5e446b18.entry.js → p-190c83b9.entry.js} +1 -1
- package/dist/solutions-components/{p-f8687049.entry.js → p-33fa9891.entry.js} +2 -2
- package/dist/solutions-components/p-3c702004.entry.js +6 -0
- package/dist/solutions-components/p-d44ad6c4.entry.js +6 -0
- package/dist/solutions-components/p-f2dcb05a.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +14 -0
- package/dist/types/components/layer-table/layer-table.d.ts +140 -4
- package/dist/types/utils/interfaces.d.ts +12 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-25729b41.entry.js +0 -6
- package/dist/solutions-components/p-cd7873ae.entry.js +0 -6
- package/dist/solutions-components/p-ea238bbc.entry.js +0 -6
@@ -33,7 +33,7 @@ import { d as defineCustomElement$3 } from './shell.js';
|
|
33
33
|
import { d as defineCustomElement$2 } from './tooltip.js';
|
34
34
|
import { d as defineCustomElement$1 } from './map-layer-picker2.js';
|
35
35
|
|
36
|
-
const layerTableCss = ":host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.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)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.bottom-left{position:absolute;left:
|
36
|
+
const layerTableCss = ":host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.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)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.bottom-left{position:absolute;left:5;bottom:0}html[dir=\"rtl\"] .bottom-left{position:absolute;right:5;bottom:0}.height-19{height:19px}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{padding:var(--lumo-space-xs) var(--lumo-space-m) !important;font-size:14px !important}";
|
37
37
|
|
38
38
|
const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTMLElement {
|
39
39
|
constructor() {
|
@@ -69,6 +69,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
69
69
|
this.showNewestFirst = undefined;
|
70
70
|
this.zoomAndScrollToSelected = undefined;
|
71
71
|
this._confirmDelete = false;
|
72
|
+
this._controlsThatFit = undefined;
|
72
73
|
this._fetchingData = false;
|
73
74
|
this._isDeleting = false;
|
74
75
|
this._layer = undefined;
|
@@ -82,6 +83,22 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
82
83
|
// Watch handlers
|
83
84
|
//
|
84
85
|
//--------------------------------------------------------------------------
|
86
|
+
/**
|
87
|
+
* watch for changes to the list of controls that will currently fit in the display
|
88
|
+
*/
|
89
|
+
_controlsThatFitWatchHandler() {
|
90
|
+
const ids = this._controlsThatFit ? this._controlsThatFit.reduce((prev, cur) => {
|
91
|
+
prev.push(cur.id);
|
92
|
+
return prev;
|
93
|
+
}, []) : [];
|
94
|
+
this._toolInfos = this._toolInfos.map(ti => {
|
95
|
+
if (ti && this._controlsThatFit) {
|
96
|
+
const id = this._getId(ti.icon);
|
97
|
+
ti.isOverflow = ids.indexOf(id) < 0;
|
98
|
+
return ti;
|
99
|
+
}
|
100
|
+
});
|
101
|
+
}
|
85
102
|
/**
|
86
103
|
* watch for changes in map view and get the first layer
|
87
104
|
*/
|
@@ -103,6 +120,12 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
103
120
|
await this._resetTable();
|
104
121
|
this._fetchingData = false;
|
105
122
|
}
|
123
|
+
/**
|
124
|
+
* watch for selection changes
|
125
|
+
*/
|
126
|
+
async _selectedIndexesWatchHandler() {
|
127
|
+
this._validateEnabledActions();
|
128
|
+
}
|
106
129
|
/**
|
107
130
|
* When sortActive is false the user has not defined a sort and we should use the default sort
|
108
131
|
*/
|
@@ -140,8 +163,8 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
140
163
|
* Refresh the table when edits are completed
|
141
164
|
*
|
142
165
|
*/
|
143
|
-
editsComplete() {
|
144
|
-
this._refresh();
|
166
|
+
async editsComplete() {
|
167
|
+
await this._refresh();
|
145
168
|
}
|
146
169
|
/**
|
147
170
|
* Refresh the table when edits are completed
|
@@ -165,6 +188,8 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
165
188
|
async componentWillLoad() {
|
166
189
|
await this._getTranslations();
|
167
190
|
await this._initModules();
|
191
|
+
this._initToolInfos();
|
192
|
+
this._resizeObserver = new ResizeObserver(() => this._onResize());
|
168
193
|
}
|
169
194
|
/**
|
170
195
|
* Renders the component.
|
@@ -174,10 +199,22 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
174
199
|
const loadingClass = this._fetchingData ? "" : "display-none";
|
175
200
|
const total = this._allIds.length.toString();
|
176
201
|
const selected = this._selectedIndexes.length.toString();
|
177
|
-
return (h(Host, null, h("calcite-shell", null, this._getTableControlRow("header"), h("div", { class: "height-full-adjusted width-full" }, h("calcite-panel", { class: "height-full width-full" }, h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), h("div", { class: "bottom-left text-color" }, this._translations.recordsSelected
|
202
|
+
return (h(Host, null, h("calcite-shell", null, this._getTableControlRow("header"), h("div", { class: "height-full-adjusted width-full" }, h("calcite-panel", { class: "height-full width-full" }, h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
|
178
203
|
.replace("{{total}}", total)
|
179
204
|
.replace("{{selected}}", selected)))), this._deleteMessage()));
|
180
205
|
}
|
206
|
+
/**
|
207
|
+
* Called once after the component is loaded
|
208
|
+
*/
|
209
|
+
async componentDidLoad() {
|
210
|
+
this._resizeObserver.observe(this._toolbar);
|
211
|
+
}
|
212
|
+
/**
|
213
|
+
* Called after the component is rendered
|
214
|
+
*/
|
215
|
+
componentDidRender() {
|
216
|
+
this._updateToolbar();
|
217
|
+
}
|
181
218
|
//--------------------------------------------------------------------------
|
182
219
|
//
|
183
220
|
// Functions (protected)
|
@@ -198,6 +235,14 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
198
235
|
this.FeatureTable = FeatureTable;
|
199
236
|
this.reactiveUtils = reactiveUtils;
|
200
237
|
}
|
238
|
+
/**
|
239
|
+
* Update the toolbar when its size changes
|
240
|
+
*
|
241
|
+
* @returns void
|
242
|
+
*/
|
243
|
+
_onResize() {
|
244
|
+
this._updateToolbar();
|
245
|
+
}
|
201
246
|
/**
|
202
247
|
* Gets a row of controls that can be used for various interactions with the table
|
203
248
|
*
|
@@ -206,11 +251,261 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
206
251
|
* @returns The dom node that contains the controls
|
207
252
|
*/
|
208
253
|
_getTableControlRow(slot) {
|
254
|
+
const id = "more-table-options";
|
255
|
+
return (h("div", { class: "display-flex border-bottom height-51", ref: (el) => this._toolbar = el, slot: slot }, this._getActionBar(), this._getDropdown(id), this._getToolTip("", "bottom", id, this._translations.moreOptions)));
|
256
|
+
}
|
257
|
+
/**
|
258
|
+
* Gets a row of controls that can be used for various interactions with the table
|
259
|
+
*
|
260
|
+
* @param slot string optional slot to display the control within
|
261
|
+
*
|
262
|
+
* @returns The dom node that contains the controls
|
263
|
+
*/
|
264
|
+
_getActionBar() {
|
265
|
+
return (h("calcite-action-bar", { expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, h("div", { class: "border-end", id: "solutions-map-layer-picker-container" }, h("map-layer-picker", { appearance: "transparent", mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt), onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", showTables: true, type: "dropdown" })), this._getActions()));
|
266
|
+
}
|
267
|
+
/**
|
268
|
+
* Get the actions that are used for various interactions with the table
|
269
|
+
*
|
270
|
+
* @returns VNode[] the action nodes
|
271
|
+
*/
|
272
|
+
_getActions() {
|
273
|
+
const actions = this._getActionItems();
|
274
|
+
return actions.reduce((prev, cur) => {
|
275
|
+
if (cur && !cur.isOverflow) {
|
276
|
+
prev.push(cur.isDanger ?
|
277
|
+
this._getDangerAction(cur.icon, cur.label, cur.func, cur.disabled) :
|
278
|
+
this._getAction(cur.icon, cur.label, cur.func, cur.disabled));
|
279
|
+
}
|
280
|
+
return prev;
|
281
|
+
}, []);
|
282
|
+
}
|
283
|
+
/**
|
284
|
+
* Update actions enabled prop based on number of selected indexes
|
285
|
+
*
|
286
|
+
* @returns void
|
287
|
+
*/
|
288
|
+
_validateEnabledActions() {
|
289
|
+
const featuresSelected = this._selectedIndexes.length > 0;
|
290
|
+
const selectionDependant = [
|
291
|
+
"zoom-to-object",
|
292
|
+
"trash",
|
293
|
+
"erase",
|
294
|
+
"selected-items-filter"
|
295
|
+
];
|
296
|
+
this._toolInfos.forEach(ti => {
|
297
|
+
if (ti && selectionDependant.indexOf(ti.icon) > -1) {
|
298
|
+
ti.disabled = !featuresSelected;
|
299
|
+
}
|
300
|
+
});
|
301
|
+
}
|
302
|
+
/**
|
303
|
+
* Get the full list of toolInfos.
|
304
|
+
* Order is important. They should be listed in the order they should display in the UI from
|
305
|
+
* Left to Right for the action bar and Top to Bottom for the dropdown.
|
306
|
+
*
|
307
|
+
* @returns void
|
308
|
+
*/
|
309
|
+
_initToolInfos() {
|
209
310
|
var _a;
|
210
311
|
const featuresSelected = this._selectedIndexes.length > 0;
|
211
|
-
|
212
|
-
|
213
|
-
|
312
|
+
this._toolInfos = [{
|
313
|
+
icon: "zoom-to-object",
|
314
|
+
label: this._translations.zoom,
|
315
|
+
func: () => this._zoom(),
|
316
|
+
disabled: !featuresSelected,
|
317
|
+
isOverflow: false
|
318
|
+
}, ((_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.filters) ? {
|
319
|
+
icon: "filter",
|
320
|
+
label: this._translations.filters,
|
321
|
+
func: () => this._filter(),
|
322
|
+
disabled: false,
|
323
|
+
isOverflow: false
|
324
|
+
} : undefined,
|
325
|
+
this._deleteEnabled ? {
|
326
|
+
icon: "trash",
|
327
|
+
label: this._translations.delete,
|
328
|
+
func: () => this._delete(),
|
329
|
+
disabled: !featuresSelected,
|
330
|
+
isDanger: true,
|
331
|
+
isOverflow: false
|
332
|
+
} : undefined, {
|
333
|
+
icon: "erase",
|
334
|
+
label: this._translations.clearSelection,
|
335
|
+
func: () => this._clearSelection(),
|
336
|
+
disabled: !featuresSelected,
|
337
|
+
isOverflow: false
|
338
|
+
}, {
|
339
|
+
icon: "selected-items-filter",
|
340
|
+
label: this._showOnlySelected ? this._translations.showAll : this._translations.showSelected,
|
341
|
+
func: () => this._toggleShowSelected(),
|
342
|
+
disabled: !featuresSelected,
|
343
|
+
isOverflow: false
|
344
|
+
}, {
|
345
|
+
icon: "list-check-all",
|
346
|
+
func: () => this._selectAll(),
|
347
|
+
label: this._translations.selectAll,
|
348
|
+
disabled: false,
|
349
|
+
isOverflow: true
|
350
|
+
}, {
|
351
|
+
icon: "compare",
|
352
|
+
func: () => this._switchSelected(),
|
353
|
+
label: this._translations.switchSelected,
|
354
|
+
disabled: false,
|
355
|
+
isOverflow: true
|
356
|
+
}, {
|
357
|
+
icon: "refresh",
|
358
|
+
func: () => this._refresh(),
|
359
|
+
label: this._translations.refresh,
|
360
|
+
disabled: false,
|
361
|
+
isOverflow: true
|
362
|
+
},
|
363
|
+
this.enableCSV ? {
|
364
|
+
icon: "export",
|
365
|
+
func: () => void this._exportToCSV(),
|
366
|
+
label: this._translations.exportCSV,
|
367
|
+
disabled: false,
|
368
|
+
isOverflow: true
|
369
|
+
} : undefined];
|
370
|
+
this._defaultVisibleToolSizeInfos = undefined;
|
371
|
+
}
|
372
|
+
/**
|
373
|
+
* Add/Remove tools from the action bar and dropdown based on available size
|
374
|
+
*
|
375
|
+
* @returns void
|
376
|
+
*/
|
377
|
+
_updateToolbar() {
|
378
|
+
if (this._timeout) {
|
379
|
+
clearTimeout(this._timeout);
|
380
|
+
}
|
381
|
+
this._timeout = setTimeout(() => {
|
382
|
+
clearTimeout(this._timeout);
|
383
|
+
this._setToolbarSizeInfos();
|
384
|
+
const toolbarWidth = this._toolbar.offsetWidth;
|
385
|
+
let controlsWidth = this._toolbarSizeInfos.reduce((prev, cur) => {
|
386
|
+
prev += cur.width;
|
387
|
+
return prev;
|
388
|
+
}, 0);
|
389
|
+
const skipControls = ["solutions-more", "solutions-map-layer-picker-container"];
|
390
|
+
if (controlsWidth > toolbarWidth) {
|
391
|
+
if (this._toolbarSizeInfos.length > 0) {
|
392
|
+
const controlsThatFit = [...this._toolbarSizeInfos].reverse().reduce((prev, cur) => {
|
393
|
+
if (skipControls.indexOf(cur.id) < 0) {
|
394
|
+
if (controlsWidth > toolbarWidth) {
|
395
|
+
controlsWidth -= cur.width;
|
396
|
+
}
|
397
|
+
else {
|
398
|
+
prev.push(cur);
|
399
|
+
}
|
400
|
+
}
|
401
|
+
return prev;
|
402
|
+
}, []).reverse();
|
403
|
+
this._setControlsThatFit(controlsThatFit, skipControls);
|
404
|
+
}
|
405
|
+
}
|
406
|
+
else {
|
407
|
+
if (this._defaultVisibleToolSizeInfos) {
|
408
|
+
const currentTools = this._toolbarSizeInfos.reduce((prev, cur) => {
|
409
|
+
prev.push(cur.id);
|
410
|
+
return prev;
|
411
|
+
}, []);
|
412
|
+
const controlsThatFit = [...this._defaultVisibleToolSizeInfos].reduce((prev, cur) => {
|
413
|
+
if (skipControls.indexOf(cur.id) < 0 &&
|
414
|
+
(currentTools.indexOf(cur.id) > -1 || (controlsWidth + cur.width) <= toolbarWidth)) {
|
415
|
+
if (currentTools.indexOf(cur.id) < 0) {
|
416
|
+
controlsWidth += cur.width;
|
417
|
+
}
|
418
|
+
prev.push(cur);
|
419
|
+
}
|
420
|
+
return prev;
|
421
|
+
}, []);
|
422
|
+
this._setControlsThatFit(controlsThatFit, skipControls);
|
423
|
+
}
|
424
|
+
}
|
425
|
+
}, 5);
|
426
|
+
}
|
427
|
+
/**
|
428
|
+
* Validate if controls that fit the current display has changed or
|
429
|
+
* is different from what is currently displayed
|
430
|
+
*
|
431
|
+
* @returns void
|
432
|
+
*/
|
433
|
+
_setControlsThatFit(controlsThatFit, skipControls) {
|
434
|
+
let update = JSON.stringify(controlsThatFit) !== JSON.stringify(this._controlsThatFit);
|
435
|
+
const actionbar = document.getElementById("solutions-action-bar");
|
436
|
+
actionbar.childNodes.forEach((n) => {
|
437
|
+
if (skipControls.indexOf(n.id) < 0 && !update) {
|
438
|
+
update = this._controlsThatFit.map(c => c.id).indexOf(n.id) < 0;
|
439
|
+
}
|
440
|
+
});
|
441
|
+
if (update) {
|
442
|
+
this._controlsThatFit = [...controlsThatFit];
|
443
|
+
}
|
444
|
+
}
|
445
|
+
/**
|
446
|
+
* Get the id and size for the toolbars current items
|
447
|
+
*
|
448
|
+
* @returns void
|
449
|
+
*/
|
450
|
+
_setToolbarSizeInfos() {
|
451
|
+
let hasWidth = false;
|
452
|
+
this._toolbarSizeInfos = [];
|
453
|
+
this._toolbar.childNodes.forEach((c, i) => {
|
454
|
+
// handle the action bar
|
455
|
+
if (i === 0) {
|
456
|
+
c.childNodes.forEach((actionbarChild) => {
|
457
|
+
this._toolbarSizeInfos.push({
|
458
|
+
id: actionbarChild.id,
|
459
|
+
width: actionbarChild.offsetWidth
|
460
|
+
});
|
461
|
+
if (!hasWidth) {
|
462
|
+
hasWidth = actionbarChild.offsetWidth > 0;
|
463
|
+
}
|
464
|
+
});
|
465
|
+
}
|
466
|
+
else if (!c.referenceElement) {
|
467
|
+
// skip tooltips
|
468
|
+
this._toolbarSizeInfos.push({
|
469
|
+
id: c.id,
|
470
|
+
width: c.offsetWidth
|
471
|
+
});
|
472
|
+
if (!hasWidth) {
|
473
|
+
hasWidth = c.offsetWidth > 0;
|
474
|
+
}
|
475
|
+
}
|
476
|
+
});
|
477
|
+
if (hasWidth && !this._defaultVisibleToolSizeInfos) {
|
478
|
+
this._defaultVisibleToolSizeInfos = [...this._toolbarSizeInfos];
|
479
|
+
}
|
480
|
+
}
|
481
|
+
/**
|
482
|
+
* Get a list of toolInfos that should display outside of the dropdown
|
483
|
+
*
|
484
|
+
* @returns IToolInfo[] the list of toolInfos that should not display in the overflow dropdown
|
485
|
+
*/
|
486
|
+
_getActionItems() {
|
487
|
+
return this._toolInfos.filter(toolInfo => toolInfo && !toolInfo.isOverflow);
|
488
|
+
}
|
489
|
+
/**
|
490
|
+
* Get a list of toolInfos that should display in the dropdown
|
491
|
+
*
|
492
|
+
* @param id string the id for the dropdown and its tooltip
|
493
|
+
*
|
494
|
+
* @returns VNode the dropdown node
|
495
|
+
*/
|
496
|
+
_getDropdown(id) {
|
497
|
+
const dropdownItems = this._getDropdownItems();
|
498
|
+
return (h("calcite-dropdown", { disabled: this._layer === undefined, id: "solutions-more" }, h("calcite-action", { appearance: "solid", id: id, label: "", slot: "trigger", text: "" }, h("calcite-button", { appearance: "transparent", iconEnd: "chevron-down", kind: "neutral" }, this._translations.more)), h("calcite-dropdown-group", { "selection-mode": "none" }, dropdownItems.map(item => {
|
499
|
+
return (h("calcite-dropdown-item", { iconStart: item.icon, onClick: item.func }, item.label));
|
500
|
+
}))));
|
501
|
+
}
|
502
|
+
/**
|
503
|
+
* Get a list of toolInfos that should display in the dropdown
|
504
|
+
*
|
505
|
+
* @returns IToolInfo[] the list of toolInfos that should display in the dropdown
|
506
|
+
*/
|
507
|
+
_getDropdownItems() {
|
508
|
+
return this._toolInfos.filter(toolInfo => toolInfo && toolInfo.isOverflow);
|
214
509
|
}
|
215
510
|
/**
|
216
511
|
* Get an action and tooltip
|
@@ -224,7 +519,30 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
224
519
|
*/
|
225
520
|
_getAction(icon, label, func, disabled) {
|
226
521
|
const _disabled = this._layer === undefined ? true : disabled;
|
227
|
-
return (h("div", { class: "display-flex" }, h("calcite-action", { appearance: "solid", disabled: _disabled, icon: icon, id: icon, label: label, onClick: func, text: label, textEnabled: true }),
|
522
|
+
return (h("div", { class: "display-flex", id: this._getId(icon) }, h("calcite-action", { appearance: "solid", disabled: _disabled, icon: icon, id: icon, label: label, onClick: func, text: label, textEnabled: true }), this._getToolTip("", "bottom", icon, label)));
|
523
|
+
}
|
524
|
+
/**
|
525
|
+
* Get a tooltip
|
526
|
+
*
|
527
|
+
* @param label string accessible name for the component
|
528
|
+
* @param placement string where the tooltip should display
|
529
|
+
* @param referenceElement string the element the tooltip will be associated with
|
530
|
+
* @param text string the text to display in the tooltip
|
531
|
+
*
|
532
|
+
* @returns VNode The tooltip node
|
533
|
+
*/
|
534
|
+
_getToolTip(label, placement, referenceElement, text) {
|
535
|
+
return (h("calcite-tooltip", { label: label, placement: placement, "reference-element": referenceElement }, h("span", null, text)));
|
536
|
+
}
|
537
|
+
/**
|
538
|
+
* Get an id with a prefix to the user supplied value
|
539
|
+
*
|
540
|
+
* @param id the unique value for the id
|
541
|
+
*
|
542
|
+
* @returns the new id with the prefix value
|
543
|
+
*/
|
544
|
+
_getId(id) {
|
545
|
+
return `solutions-action-${id}`;
|
228
546
|
}
|
229
547
|
/**
|
230
548
|
* Get an action with danger color icon and text
|
@@ -238,7 +556,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
238
556
|
*/
|
239
557
|
_getDangerAction(icon, label, func, disabled) {
|
240
558
|
const _disabled = this._layer === undefined ? true : disabled;
|
241
|
-
return (h("div", { class: "display-flex" }, h("calcite-action", { appearance: "solid", disabled: _disabled, id: icon, onClick: func, text: "" }, h("calcite-button", { appearance: "transparent", iconStart: icon, kind: "danger" }, label)),
|
559
|
+
return (h("div", { class: "display-flex", id: this._getId(icon) }, h("calcite-action", { appearance: "solid", disabled: _disabled, id: icon, onClick: func, text: "" }, h("calcite-button", { appearance: "transparent", iconStart: icon, kind: "danger" }, label)), this._getToolTip("", "bottom", icon, label)));
|
242
560
|
}
|
243
561
|
/**
|
244
562
|
* Initialize the FeatureTable
|
@@ -309,6 +627,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
309
627
|
this._table.view = this.mapView;
|
310
628
|
this._checkEditEnabled();
|
311
629
|
this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
|
630
|
+
this._initToolInfos();
|
312
631
|
});
|
313
632
|
await this._table.when(() => {
|
314
633
|
this._table.clearSelectionFilter();
|
@@ -495,8 +814,9 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
495
814
|
*
|
496
815
|
* @returns void
|
497
816
|
*/
|
498
|
-
_refresh() {
|
499
|
-
|
817
|
+
async _refresh() {
|
818
|
+
await this._table.refresh();
|
819
|
+
this.featureSelectionChange.emit(this._selectedIndexes);
|
500
820
|
}
|
501
821
|
/**
|
502
822
|
* Zoom to all selected features
|
@@ -594,8 +914,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
594
914
|
}
|
595
915
|
get el() { return this; }
|
596
916
|
static get watchers() { return {
|
917
|
+
"_controlsThatFit": ["_controlsThatFitWatchHandler"],
|
597
918
|
"mapView": ["mapViewWatchHandler"],
|
598
919
|
"_layer": ["_layerWatchHandler"],
|
920
|
+
"_selectedIndexes": ["_selectedIndexesWatchHandler"],
|
599
921
|
"_sortActive": ["_sortActiveWatchHandler"]
|
600
922
|
}; }
|
601
923
|
static get style() { return layerTableCss; }
|
@@ -609,6 +931,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
609
931
|
"showNewestFirst": [4, "show-newest-first"],
|
610
932
|
"zoomAndScrollToSelected": [4, "zoom-and-scroll-to-selected"],
|
611
933
|
"_confirmDelete": [32],
|
934
|
+
"_controlsThatFit": [32],
|
612
935
|
"_fetchingData": [32],
|
613
936
|
"_isDeleting": [32],
|
614
937
|
"_layer": [32],
|
@@ -617,8 +940,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
617
940
|
"_sortActive": [32],
|
618
941
|
"_translations": [32]
|
619
942
|
}, [[8, "selectionChanged", "selectionChanged"], [8, "editsComplete", "editsComplete"], [8, "noLayersFound", "noLayersFound"]], {
|
943
|
+
"_controlsThatFit": ["_controlsThatFitWatchHandler"],
|
620
944
|
"mapView": ["mapViewWatchHandler"],
|
621
945
|
"_layer": ["_layerWatchHandler"],
|
946
|
+
"_selectedIndexes": ["_selectedIndexesWatchHandler"],
|
622
947
|
"_sortActive": ["_sortActiveWatchHandler"]
|
623
948
|
}]);
|
624
949
|
function defineCustomElement() {
|
@@ -202,8 +202,8 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
202
202
|
const mapTableIds = this.showTables ? this.onlyShowUpdatableLayers ?
|
203
203
|
this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
|
204
204
|
this.ids = [
|
205
|
-
...mapLayerIds.filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.indexOf(n) > -1 : true; }),
|
206
|
-
...mapTableIds.filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.indexOf(n) > -1 : true; }),
|
205
|
+
...mapLayerIds.reverse().filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.reverse().indexOf(n) > -1 : true; }),
|
206
|
+
...mapTableIds.reverse().filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.reverse().indexOf(n) > -1 : true; }),
|
207
207
|
];
|
208
208
|
}
|
209
209
|
}
|
@@ -89,9 +89,9 @@ const BasemapGallery = class {
|
|
89
89
|
}
|
90
90
|
const source = new this.PortalBasemapsSource({
|
91
91
|
query: ((_a = this.basemapConfig) === null || _a === void 0 ? void 0 : _a.basemapGroupId) ? `id:${this.basemapConfig.basemapGroupId}` : null,
|
92
|
-
filterFunction: (basemap) => {
|
92
|
+
filterFunction: this.basemapConfig ? (basemap) => {
|
93
93
|
return !this.basemapConfig.basemapIdsToFilter.includes(basemap.portalItem.id);
|
94
|
-
}
|
94
|
+
} : () => true
|
95
95
|
});
|
96
96
|
await source.refresh();
|
97
97
|
this.basemapWidget = new this.BasemapGallery({
|
@@ -319,7 +319,7 @@ const Alert = class {
|
|
319
319
|
};
|
320
320
|
Alert.style = alertCss;
|
321
321
|
|
322
|
-
const editCardCss = ":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-ui-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-ui-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-ui-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}";
|
322
|
+
const editCardCss = ":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-ui-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-ui-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-ui-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";
|
323
323
|
|
324
324
|
const EditCard = class {
|
325
325
|
constructor(hostRef) {
|
@@ -406,9 +406,9 @@ const EditCard = class {
|
|
406
406
|
// when you use MULTI edit mode...is fine in SINGLE
|
407
407
|
const editDisabled = ((_a = this.graphics) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.graphics[0] ?
|
408
408
|
!this.graphics[0].layer.editingEnabled : true;
|
409
|
-
const tableNodeClass = this._editorLoading ? "display-none" : "";
|
409
|
+
const tableNodeClass = this._editorLoading ? "display-none" : "position-absolute";
|
410
410
|
const loadingClass = this._editorLoading ? "" : "display-none";
|
411
|
-
return (h(Host, null, h("div", { class: "position-
|
411
|
+
return (h(Host, null, h("div", { class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { class: "position-absolute", slot: "content" }, h("div", { class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { class: loadingClass, scale: "s" })))));
|
412
412
|
}
|
413
413
|
//--------------------------------------------------------------------------
|
414
414
|
//
|
@@ -1866,8 +1866,8 @@ const MapLayerPicker = class {
|
|
1866
1866
|
const mapTableIds = this.showTables ? this.onlyShowUpdatableLayers ?
|
1867
1867
|
this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
|
1868
1868
|
this.ids = [
|
1869
|
-
...mapLayerIds.filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.indexOf(n) > -1 : true; }),
|
1870
|
-
...mapTableIds.filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.indexOf(n) > -1 : true; }),
|
1869
|
+
...mapLayerIds.reverse().filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.reverse().indexOf(n) > -1 : true; }),
|
1870
|
+
...mapTableIds.reverse().filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.reverse().indexOf(n) > -1 : true; }),
|
1871
1871
|
];
|
1872
1872
|
}
|
1873
1873
|
}
|