@esri/solutions-components 0.8.18 → 0.8.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
  2. package/dist/cjs/card-manager_3.cjs.entry.js +18 -9
  3. package/dist/cjs/crowdsource-manager.cjs.entry.js +11 -9
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/solutions-components.cjs.js +1 -1
  6. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +29 -43
  7. package/dist/collection/components/info-card/info-card.css +1 -0
  8. package/dist/collection/components/layer-table/layer-table.js +18 -43
  9. package/dist/collection/demos/crowdsource-manager.html +4 -2
  10. package/dist/collection/demos/crowdsource-reporter.html +1 -1
  11. package/dist/collection/utils/interfaces.ts +2 -0
  12. package/dist/components/crowdsource-manager.js +12 -11
  13. package/dist/components/info-card2.js +1 -1
  14. package/dist/components/layer-table2.js +18 -11
  15. package/dist/esm/calcite-alert_4.entry.js +1 -1
  16. package/dist/esm/card-manager_3.entry.js +18 -9
  17. package/dist/esm/crowdsource-manager.entry.js +11 -9
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/solutions-components.js +1 -1
  20. package/dist/solutions-components/demos/crowdsource-manager.html +4 -2
  21. package/dist/solutions-components/demos/crowdsource-reporter.html +1 -1
  22. package/dist/solutions-components/p-347a2b0d.entry.js +6 -0
  23. package/dist/solutions-components/p-6a598429.entry.js +6 -0
  24. package/dist/solutions-components/{p-d84fe0ee.entry.js → p-8cff32bd.entry.js} +1 -1
  25. package/dist/solutions-components/solutions-components.esm.js +1 -1
  26. package/dist/solutions-components/utils/interfaces.ts +2 -0
  27. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +6 -8
  28. package/dist/types/components/layer-table/layer-table.d.ts +1 -9
  29. package/dist/types/components.d.ts +8 -32
  30. package/dist/types/utils/interfaces.d.ts +2 -0
  31. package/package.json +1 -1
  32. package/dist/solutions-components/p-e6abef31.entry.js +0 -6
  33. package/dist/solutions-components/p-e947332f.entry.js +0 -6
@@ -670,7 +670,7 @@ const EditCard = class {
670
670
  };
671
671
  EditCard.style = EditCardStyle0;
672
672
 
673
- const infoCardCss = ":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand)}";
673
+ const infoCardCss = ":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}";
674
674
  const InfoCardStyle0 = infoCardCss;
675
675
 
676
676
  const InfoCard = class {
@@ -166,8 +166,6 @@ const LayerTable = class {
166
166
  this.shareIncludeEmbed = undefined;
167
167
  this.shareIncludeSocial = undefined;
168
168
  this.showNewestFirst = undefined;
169
- this.sortField = undefined;
170
- this.sortOrder = undefined;
171
169
  this.zoomAndScrollToSelected = undefined;
172
170
  this.zoomToScale = undefined;
173
171
  this._allIds = [];
@@ -395,7 +393,7 @@ const LayerTable = class {
395
393
  const selected = this.selectedIds.length.toString();
396
394
  const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
397
395
  this._validateActiveActions();
398
- return (index.h(index.Host, { key: '69a8f1d8c41eb82d6f39f6c580f78369f372567f' }, index.h("calcite-shell", { key: '3cb7997d918af450d04b95e1a236e09400b30af1' }, this._getTableControlRow("header"), index.h("div", { key: '1f0e84f1759c0333acee402a603923ca96e7d9e4', class: `width-full ${tableHeightClass}` }, index.h("calcite-panel", { key: 'b62bedc4c924f0d0a30e2746a532270c2a4d4a4b', class: "height-full width-full" }, index.h("calcite-loader", { key: 'e28017e4c3aba559774965f2cbff0fcb83f9ab2d', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), index.h("div", { key: 'efc520212f53c3db46574c7caf5d9f9835b83a2c', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (index.h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
396
+ return (index.h(index.Host, { key: '1077bca0d3f59ed86999449c2c5428e4aa65b30f' }, index.h("calcite-shell", { key: '02b7a7512cfdc8958251ae00709b971f9bfff6df' }, this._getTableControlRow("header"), index.h("div", { key: '83d03238c368cd332714f4434297a9a4f9d47ec4', class: `width-full ${tableHeightClass}` }, index.h("calcite-panel", { key: '18927c7c65687c9df28f69b1e66f542be05e8c52', class: "height-full width-full" }, index.h("calcite-loader", { key: '51ed528d5676b983c27b50b098dd8785a3c7b591', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), index.h("div", { key: '4e51683f468b29b6dcdf1a588cdfedb37a02166f', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (index.h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
399
397
  .replace("{{total}}", total)
400
398
  .replace("{{selected}}", selected))) : undefined)), this._filterModal()));
401
399
  }
@@ -1195,16 +1193,27 @@ const LayerTable = class {
1195
1193
  this._deleteEnabled = this._layer.editingEnabled && this._layer.capabilities.operations.supportsDelete;
1196
1194
  }
1197
1195
  /**
1198
- * Sort the table with the configured field in the configured sort order
1196
+ * Sort the table with the configured field and the sort order
1199
1197
  */
1200
1198
  async _sortTable() {
1201
- var _a, _b, _c, _d, _e, _f;
1202
- let sortField = this.sortField ? this.sortField : this._layer.objectIdField;
1199
+ var _a, _b, _c, _d;
1200
+ //By default sort the table using objectIdField and in descending order
1201
+ let sortField = this._layer.objectIdField;
1202
+ let sortOrder = 'desc';
1203
+ let configuredLayer;
1204
+ //get the sortField and sortOrder from the configuration
1203
1205
  if (((_c = (_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1204
- const configuredLayer = (_d = this.mapInfo.layerOptions) === null || _d === void 0 ? void 0 : _d.layers.filter((layer) => layer.id === this._layer.id);
1205
- sortField = ((_f = (_e = configuredLayer[0]) === null || _e === void 0 ? void 0 : _e.fields) === null || _f === void 0 ? void 0 : _f.includes(this.sortField)) ? this.sortField : this._layer.objectIdField;
1206
+ configuredLayer = this.mapInfo.layerOptions.layers.filter((layer) => layer.id === this._layer.id);
1207
+ if (configuredLayer && configuredLayer.length > 0) {
1208
+ configuredLayer = configuredLayer[0];
1209
+ //if sort field is defined and sortField is available in the fields then use it
1210
+ if (configuredLayer.sortField && ((_d = configuredLayer.fields) === null || _d === void 0 ? void 0 : _d.includes(configuredLayer.sortField))) {
1211
+ sortField = configuredLayer.sortField;
1212
+ }
1213
+ //use sort order if configured
1214
+ sortOrder = (configuredLayer === null || configuredLayer === void 0 ? void 0 : configuredLayer.sortOrder) ? configuredLayer.sortOrder : "desc";
1215
+ }
1206
1216
  }
1207
- const sortOrder = this.sortOrder ? this.sortOrder : 'desc';
1208
1217
  if (this._table && this._layer) {
1209
1218
  await this._table.when();
1210
1219
  await this._layer.when(() => {
@@ -49,6 +49,7 @@ const CrowdsourceManager = class {
49
49
  this.defaultLevel = "";
50
50
  this.defaultOid = "";
51
51
  this.defaultWebmap = "";
52
+ this.introductionPageEnabled = false;
52
53
  this.enableAutoRefresh = false;
53
54
  this.enableBasemap = true;
54
55
  this.enableColumnReorder = true;
@@ -75,8 +76,6 @@ const CrowdsourceManager = class {
75
76
  this.theme = "light";
76
77
  this.zoomAndScrollToSelected = false;
77
78
  this.zoomToScale = undefined;
78
- this.sortField = undefined;
79
- this.sortOrder = undefined;
80
79
  this._expandPopup = this.hideMapOnLoad;
81
80
  this._hideFooter = false;
82
81
  this._hideTable = false;
@@ -183,7 +182,9 @@ const CrowdsourceManager = class {
183
182
  * Renders the component.
184
183
  */
185
184
  render() {
186
- return (index.h(index.Host, { key: '686aeccc0f97c1eb8bc1b673d8816663e80fdf71' }, index.h("calcite-shell", { key: 'f3451483cdbafa8b68a00b71e9927bbff55781b9', class: "position-relative" }, index.h("calcite-panel", { key: '8256440e1cefa8f25bf1af1f9a1e87650c34462d', class: `width-full height-full border-width-0` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
185
+ // only avoid border when we have a header color that is not white
186
+ const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
187
+ return (index.h(index.Host, { key: '175124a05c83f6f02bef1378a20e5a3ed083ce00' }, index.h("calcite-shell", { key: '10677408a11bbe6196a95622a7a5f69fd3766c20', class: "position-relative" }, index.h("calcite-panel", { key: 'd3f044385482089d2dd5a457c2de4b3cc748e7c6', class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
187
188
  }
188
189
  /**
189
190
  * Called after each render
@@ -303,7 +304,8 @@ const CrowdsourceManager = class {
303
304
  _getBody(layoutMode, panelOpen, hideTable) {
304
305
  const contentClass = layoutMode === interfaces.ELayoutMode.HORIZONTAL ? "" : "display-flex";
305
306
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
306
- return (index.h("calcite-panel", { class: "width-full height-full" }, index.h("div", { class: `width-full height-full overflow-hidden ${contentClass}` }, this._getMapAndCard(layoutMode, panelOpen, hideTable), this._getTable(layoutMode, panelOpen, hideTable)), index.h("div", { class: "floating-container", onClick: this.infoButtonClick.bind(this) }, index.h("calcite-button", { appearance: "solid", class: `floating-button ${themeClass}`, "icon-start": "information-letter", kind: "neutral", label: "", round: true, scale: "l", "split-child": "primary", width: "auto" }))));
307
+ return (index.h("calcite-panel", { class: "width-full height-full" }, index.h("div", { class: `width-full height-full overflow-hidden ${contentClass}` }, this._getMapAndCard(layoutMode, panelOpen, hideTable), this._getTable(layoutMode, panelOpen, hideTable)), this.coverPageEnabled &&
308
+ index.h("div", { class: "floating-container", onClick: this.infoButtonClick.bind(this) }, index.h("calcite-button", { appearance: "solid", class: `floating-button ${themeClass}`, "icon-start": "information-letter", kind: "neutral", label: "", round: true, scale: "l", "split-child": "primary", width: "auto" }))));
307
309
  }
308
310
  /**
309
311
  * Emit the event when info button clicked
@@ -356,10 +358,10 @@ const CrowdsourceManager = class {
356
358
  const headerTheme = this.popupHeaderColor ? "" : !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
357
359
  const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
358
360
  return (index.h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}`, style: {
359
- '--calcite-color-foreground-1': this.popupHeaderColor, /* background color to apply to the popup header */
360
- '--calcite-color-foreground-2': this.popupHeaderHoverColor, /* color that will be displayed on hover when expanding the popup header */
361
- '--calcite-color-text-3': this.popupHeaderHoverTextColor, /* font color that will be displayed on hover when expanding the popup header */
362
- '--calcite-color-text-2': this.popupHeaderTextColor, /* font color to apply to the popup header */
361
+ '--calcite-color-foreground-1': this.popupHeaderColor, /* background color that will be displayed on the popup header */
362
+ '--calcite-color-foreground-2': this.popupHeaderHoverColor, /* background color that will be displayed on button when hovered */
363
+ '--calcite-color-text-3': this.popupHeaderTextColor, /* font color that will be displayed on button */
364
+ '--calcite-color-text-2': this.popupHeaderTextColor, /* font color that will be displayed on popup header text*/
363
365
  } }, index.h("calcite-panel", null, !this._isMobile ? (index.h("div", { class: `display-flex align-items-center ${headerClass}`, slot: "header-content" }, index.h("calcite-icon", { icon: "information", scale: "s" }), index.h("div", { class: "padding-inline-start-75" }, this._translations.information))) : undefined, index.h("calcite-action", { class: headerClass, disabled: this._tableOnly, icon: icon, id: id, onClick: () => this._togglePopup(), slot: "header-actions-end", text: "" }), !this._tableOnly ? index.h("calcite-tooltip", { class: themeClass, label: "", placement: "bottom", "reference-element": id }, index.h("span", null, tooltip)) : undefined, this._getCardNode())));
364
366
  }
365
367
  /**
@@ -404,7 +406,7 @@ const CrowdsourceManager = class {
404
406
  ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
405
407
  const defaultOid = !this.defaultOid ? undefined :
406
408
  ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
407
- return (index.h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (index.h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, index.h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), index.h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, index.h("span", null, tooltip)))) : undefined, index.h("div", { class: `width-full height-full position-relative` }, index.h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, sortField: this.sortField, sortOrder: this.sortOrder, zoomAndScrollToSelected: this.zoomAndScrollToSelected, zoomToScale: this.zoomToScale }))));
409
+ return (index.h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (index.h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, index.h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), index.h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, index.h("span", null, tooltip)))) : undefined, index.h("div", { class: `width-full height-full position-relative` }, index.h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected, zoomToScale: this.zoomToScale }))));
408
410
  }
409
411
  /**
410
412
  * Update the component layout when its size changes