@esri/solutions-components 0.10.12 → 0.10.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-flow_6.cjs.entry.js +103 -7
  3. package/dist/cjs/card-manager_3.cjs.entry.js +2 -1
  4. package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -2
  5. package/dist/cjs/crowdsource-reporter.cjs.entry.js +173 -43
  6. package/dist/cjs/feature-list.cjs.entry.js +110 -17
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{popupUtils-92e52dbf.js → popupUtils-47bd97e7.js} +1 -1
  9. package/dist/cjs/solutions-components.cjs.js +1 -1
  10. package/dist/collection/assets/t9n/crowdsource-reporter/resources.json +3 -1
  11. package/dist/collection/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
  12. package/dist/collection/assets/t9n/feature-list/resources.json +3 -1
  13. package/dist/collection/assets/t9n/feature-list/resources_en.json +3 -1
  14. package/dist/collection/components/card-manager/card-manager.js +19 -1
  15. package/dist/collection/components/create-feature/create-feature.js +145 -2
  16. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +20 -2
  17. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +227 -43
  18. package/dist/collection/components/feature-list/feature-list.css +16 -1
  19. package/dist/collection/components/feature-list/feature-list.js +165 -15
  20. package/dist/collection/components/layer-list/layer-list.js +35 -6
  21. package/dist/collection/demos/crowdsource-reporter.html +2 -0
  22. package/dist/collection/utils/popupUtils.js +1 -1
  23. package/dist/collection/utils/popupUtils.ts +1 -1
  24. package/dist/components/card-manager2.js +3 -1
  25. package/dist/components/create-feature2.js +91 -3
  26. package/dist/components/crowdsource-manager.js +4 -2
  27. package/dist/components/crowdsource-reporter.js +178 -45
  28. package/dist/components/feature-list2.js +152 -50
  29. package/dist/components/layer-list2.js +18 -6
  30. package/dist/components/popupUtils.js +1 -1
  31. package/dist/esm/calcite-alert_4.entry.js +1 -1
  32. package/dist/esm/calcite-flow_6.entry.js +104 -8
  33. package/dist/esm/card-manager_3.entry.js +2 -1
  34. package/dist/esm/crowdsource-manager.entry.js +3 -2
  35. package/dist/esm/crowdsource-reporter.entry.js +173 -43
  36. package/dist/esm/feature-list.entry.js +110 -17
  37. package/dist/esm/loader.js +1 -1
  38. package/dist/esm/{popupUtils-00c655fb.js → popupUtils-349a26e6.js} +1 -1
  39. package/dist/esm/solutions-components.js +1 -1
  40. package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources.json +3 -1
  41. package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
  42. package/dist/solutions-components/assets/t9n/feature-list/resources.json +3 -1
  43. package/dist/solutions-components/assets/t9n/feature-list/resources_en.json +3 -1
  44. package/dist/solutions-components/demos/crowdsource-reporter.html +2 -0
  45. package/dist/solutions-components/p-40e305b4.entry.js +17 -0
  46. package/dist/solutions-components/p-4d44410b.entry.js +6 -0
  47. package/dist/solutions-components/{p-900fee65.js → p-5a473f0d.js} +1 -1
  48. package/dist/solutions-components/p-8efa9edf.entry.js +6 -0
  49. package/dist/solutions-components/p-977f2314.entry.js +6 -0
  50. package/dist/solutions-components/p-9b83e593.entry.js +6 -0
  51. package/dist/solutions-components/{p-cde8d6e5.entry.js → p-f6bc95b3.entry.js} +1 -1
  52. package/dist/solutions-components/solutions-components.esm.js +1 -1
  53. package/dist/solutions-components/utils/popupUtils.ts +1 -1
  54. package/dist/types/components/card-manager/card-manager.d.ts +4 -0
  55. package/dist/types/components/create-feature/create-feature.d.ts +34 -0
  56. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +4 -0
  57. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +80 -21
  58. package/dist/types/components/feature-list/feature-list.d.ts +49 -7
  59. package/dist/types/components/layer-list/layer-list.d.ts +4 -0
  60. package/dist/types/components.d.ts +93 -0
  61. package/package.json +1 -1
  62. package/dist/solutions-components/p-064e43e0.entry.js +0 -6
  63. package/dist/solutions-components/p-2d1afda0.entry.js +0 -17
  64. package/dist/solutions-components/p-4a0d9efe.entry.js +0 -6
  65. package/dist/solutions-components/p-c9260b4c.entry.js +0 -6
  66. package/dist/solutions-components/p-f7d3ef3e.entry.js +0 -6
@@ -25,5 +25,7 @@
25
25
  "sortNewest": "Newest",
26
26
  "sortOldest": "Oldest",
27
27
  "sortHighestVoted": "Highest voted",
28
- "sortLowestVoted": "Lowest voted"
28
+ "sortLowestVoted": "Lowest voted",
29
+ "resetFilter": "Reset filter",
30
+ "close": "Close"
29
31
  }
@@ -25,5 +25,7 @@
25
25
  "sortNewest": "Newest",
26
26
  "sortOldest": "Oldest",
27
27
  "sortHighestVoted": "Highest voted",
28
- "sortLowestVoted": "Lowest voted"
28
+ "sortLowestVoted": "Lowest voted",
29
+ "resetFilter": "Reset filter",
30
+ "close": "Close"
29
31
  }
@@ -1,4 +1,6 @@
1
1
  {
2
2
  "error": "Error",
3
- "featureErrorMsg": "No records found."
3
+ "featureErrorMsg": "No records found.",
4
+ "thousandsAbbreviation": "{{abbreviated_value}}k",
5
+ "millionsAbbreviation": "{{abbreviated_value}}M"
4
6
  }
@@ -1,4 +1,6 @@
1
1
  {
2
2
  "error": "Error",
3
- "featureErrorMsg": "No records found."
3
+ "featureErrorMsg": "No records found.",
4
+ "thousandsAbbreviation": "{{abbreviated_value}}k",
5
+ "millionsAbbreviation": "{{abbreviated_value}}M"
4
6
  }
@@ -24,6 +24,7 @@ import { queryFeaturesByID } from "../../utils/queryUtils";
24
24
  import { getLayerOrTable } from "../../utils/mapViewUtils";
25
25
  export class CardManager {
26
26
  constructor() {
27
+ this.customInfoText = undefined;
27
28
  this.enableEditGeometry = false;
28
29
  this.isMobile = undefined;
29
30
  this.layer = undefined;
@@ -91,7 +92,7 @@ export class CardManager {
91
92
  render() {
92
93
  const featuresClass = this._graphics?.length > 0 ? "" : "display-none";
93
94
  const messageClass = this._graphics?.length > 0 ? "display-none" : "";
94
- return (h(Host, { key: '0309205d485d9c7a5c558b3619a6c5ac03fcb528' }, h("div", { key: 'a5d291f6073b0e0a918573549c6eb29fe1d892dd', class: "overflow-auto height-full" }, h("calcite-shell", { key: '572b9cdf002e0c8c46e6c4bc5e2f1f8494228e93', class: "position-relative " + featuresClass }, h("div", { key: 'f8ba07deb9786d64f3d25011ff66ead43d809bf1' }, h("info-card", { key: '6eda3ab2cfa2e5fb948f5a7ddaeb6b9022aa5543', enableEditGeometry: this.enableEditGeometry, graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), h("calcite-shell", { key: 'f32d9cfe3a41bbd7d58cdc732c8abe99b232beb7', class: "position-relative " + messageClass }, h("div", { key: 'b97eb023c5d57a4a8dda09467d8599166da40f3c', class: "padding-1" }, h("calcite-notice", { key: '23a204782bd254909e3ab803a944d10004e4954a', icon: "table", open: true }, h("div", { key: 'ea25078647612b8fa40e26b4474a91c853dae126', slot: "message" }, this._translations.selectFeaturesToStart)))))));
95
+ return (h(Host, { key: 'dafff11793b5ae60164964c346cbb152caceaeb9' }, h("div", { key: '02507fe9e1f4205fe8a9342b466f1ada849c8ed8', class: "overflow-auto height-full" }, h("calcite-shell", { key: '712c42c4044c1386e8bc4ff42e44f250ac4023a2', class: "position-relative " + featuresClass }, h("div", { key: 'f2bc47f58463506f7ea8011495b22cafb63e4f27' }, h("info-card", { key: '1ad1fb78dcc99a43d92ad08d4c7bbeda7c2f276d', enableEditGeometry: this.enableEditGeometry, graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), h("calcite-shell", { key: 'fa9fcada67198c182f918b939826f1f7f19f8e5b', class: "position-relative " + messageClass }, h("div", { key: '0da349d1442b6375cde177780c5f868d2e32072a', class: "padding-1" }, h("calcite-notice", { key: 'c0e04ca03c546f90c942c2eef622fbe9c8e61227', icon: "table", open: true }, h("div", { key: '85e3925e725798189b16270df31c266c55391ec7', slot: "message" }, this.customInfoText || this._translations.selectFeaturesToStart)))))));
95
96
  }
96
97
  //--------------------------------------------------------------------------
97
98
  //
@@ -133,6 +134,23 @@ export class CardManager {
133
134
  }
134
135
  static get properties() {
135
136
  return {
137
+ "customInfoText": {
138
+ "type": "string",
139
+ "mutable": false,
140
+ "complexType": {
141
+ "original": "string",
142
+ "resolved": "string",
143
+ "references": {}
144
+ },
145
+ "required": false,
146
+ "optional": false,
147
+ "docs": {
148
+ "tags": [],
149
+ "text": "string: custom notice text to display"
150
+ },
151
+ "attribute": "custom-info-text",
152
+ "reflect": false
153
+ },
136
154
  "enableEditGeometry": {
137
155
  "type": "boolean",
138
156
  "mutable": false,
@@ -28,6 +28,8 @@ export class CreateFeature {
28
28
  this.customizeSubmit = false;
29
29
  this.searchConfiguration = undefined;
30
30
  this.isMobile = undefined;
31
+ this.floorLevel = undefined;
32
+ this.formElements = undefined;
31
33
  this._editorLoading = false;
32
34
  this._showSearchWidget = undefined;
33
35
  }
@@ -47,6 +49,20 @@ export class CreateFeature {
47
49
  * The Editor constructor
48
50
  */
49
51
  Editor;
52
+ /**
53
+ * esri/form/ExpressionInfo: https://developers.arcgis.com/javascript/latest/api-reference/esri-form-ExpressionInfo.html
54
+ * The ExpressionInfo constructor
55
+ */
56
+ ExpressionInfo;
57
+ /**
58
+ * esri/form/elements/FieldElement: https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-FieldElement.html
59
+ * The FieldElement constructor
60
+ */
61
+ FieldElement;
62
+ /**
63
+ * esri/form/FormTemplate: https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html
64
+ */
65
+ FormTemplate;
50
66
  /**
51
67
  * esri/widgets/Editor: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html
52
68
  * The Editor instance
@@ -152,6 +168,15 @@ export class CreateFeature {
152
168
  this._editor.viewModel.featureFormViewModel.submit();
153
169
  }
154
170
  }
171
+ /**
172
+ * refresh the feature form
173
+ * @returns Promise that resolves when the operation is complete
174
+ */
175
+ async refresh(floorLevel) {
176
+ if (this._editor) {
177
+ void this._setFloorLevel(floorLevel);
178
+ }
179
+ }
155
180
  //--------------------------------------------------------------------------
156
181
  //
157
182
  // Events (public)
@@ -207,7 +232,7 @@ export class CreateFeature {
207
232
  const loaderClass = this._editorLoading ? "" : "display-none";
208
233
  const featureFormClass = this._editorLoading ? "display-none" : "";
209
234
  const mobileMapClass = this.isMobile ? "show-map" : "display-none";
210
- return (h(Fragment, { key: '8adaa70257dfef9632f82be75dbdff572e2c39b3' }, h("calcite-loader", { key: 'e1a1aba8613d9cea1033513748dd21b7f27f9806', class: loaderClass, label: "", scale: "s" }), h("div", { key: 'e1089ffe60d079f345d358aac7ae1a6bd59a55df', class: featureFormClass, id: "feature-form" }), h("div", { key: '52274b6cd4c9f6886293f858caac9e572697da25', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref" }), h("div", { key: '64108cfa3bb57f9739bfb4951352c5523c194761', class: `${mobileMapClass}`, ref: (el) => { this._mapViewContainer = el; } })));
235
+ return (h(Fragment, { key: '47d29e529402482acf3811c37c0cd5a426ed40ed' }, h("calcite-loader", { key: '283b2c6a0f1722c9a8d955e11390e65e6041b247', class: loaderClass, label: "", scale: "s" }), h("div", { key: 'bb596467d5da22882932259db6a9e8029717850b', class: featureFormClass, id: "feature-form" }), h("div", { key: 'c3887f5c5aa92efdcf588da4918933dadb87937f', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref" }), h("div", { key: '566069a6202053468a3cf7a221feb071491eabb4', class: `${mobileMapClass}`, ref: (el) => { this._mapViewContainer = el; } })));
211
236
  }
212
237
  //--------------------------------------------------------------------------
213
238
  //
@@ -230,15 +255,21 @@ export class CreateFeature {
230
255
  * @protected
231
256
  */
232
257
  async initModules() {
233
- const [Editor, reactiveUtils, Search, MapView] = await loadModules([
258
+ const [Editor, reactiveUtils, Search, ExpressionInfo, FieldElement, FormTemplate, MapView] = await loadModules([
234
259
  "esri/widgets/Editor",
235
260
  "esri/core/reactiveUtils",
236
261
  "esri/widgets/Search",
262
+ "esri/form/ExpressionInfo",
263
+ "esri/form/elements/FieldElement",
264
+ "esri/form/FormTemplate",
237
265
  "esri/views/MapView"
238
266
  ]);
239
267
  this.Editor = Editor;
240
268
  this.reactiveUtils = reactiveUtils;
241
269
  this.Search = Search;
270
+ this.ExpressionInfo = ExpressionInfo;
271
+ this.FieldElement = FieldElement;
272
+ this.FormTemplate = FormTemplate;
242
273
  this.MapView = MapView;
243
274
  }
244
275
  /**
@@ -329,6 +360,7 @@ export class CreateFeature {
329
360
  const formHandle = this.reactiveUtils.watch(() => this._editor.viewModel.featureFormViewModel?.state, (state) => {
330
361
  if (state === 'ready') {
331
362
  this._mapViewContainer?.classList?.replace("show-map", "hide-map");
363
+ void this._setFloorLevel(this.floorLevel);
332
364
  this._showSearchWidget = false;
333
365
  this.progressStatus.emit(1);
334
366
  this.drawComplete.emit();
@@ -473,6 +505,59 @@ export class CreateFeature {
473
505
  }
474
506
  return searchConfiguration;
475
507
  }
508
+ /**
509
+ * Add the floor level value to form
510
+ * @param level selected floor level
511
+ *
512
+ * @protected
513
+ */
514
+ async _setFloorLevel(level) {
515
+ if (!level) {
516
+ return;
517
+ }
518
+ const layer = await getLayerOrTable(this._updatedMapView, this.selectedLayerId);
519
+ if (layer?.floorInfo?.floorField) {
520
+ const layerField = layer.fields.find((field) => field.name === layer.floorInfo.floorField);
521
+ // if layer field is present and form template is not present only then we can set value of floorfield into feature form otherwise create a mannual formtemplate to add the floorfeild element
522
+ if (layerField && !layer?.formTemplate) {
523
+ this._editor.viewModel.featureFormViewModel.setValue(layerField.name, level);
524
+ layerField.editable = false;
525
+ }
526
+ else if (layer.formTemplate && this.formElements) {
527
+ const floorInfoExpression = new this.ExpressionInfo({
528
+ expression: `"${level}"`,
529
+ name: "floor-info-test",
530
+ title: "Floor Info",
531
+ returnType: "string"
532
+ });
533
+ const levelIdFieldElement = new this.FieldElement({
534
+ label: layer.floorInfo.floorField,
535
+ editableExpression: 'false',
536
+ fieldName: layer.floorInfo.floorField,
537
+ input: {
538
+ type: "text-box",
539
+ maxLength: 50,
540
+ minLength: 0
541
+ },
542
+ valueExpression: floorInfoExpression.name
543
+ });
544
+ this._updatedMapView.map.editableLayers.forEach((layer) => {
545
+ const orgElements = this.formElements.orgElements;
546
+ const orgExpressionInfos = this.formElements.orgExpressionInfos;
547
+ const elements = [...orgElements];
548
+ elements.push(levelIdFieldElement);
549
+ // Creating formtemplate
550
+ const floorInfoTemplate = new this.FormTemplate({
551
+ title: layer.formTemplate.title,
552
+ description: layer.formTemplate.description,
553
+ elements,
554
+ expressionInfos: [floorInfoExpression].concat(orgExpressionInfos)
555
+ });
556
+ layer.formTemplate = floorInfoTemplate;
557
+ });
558
+ }
559
+ }
560
+ }
476
561
  /**
477
562
  * Hides the elements of editor widget
478
563
  * @protected
@@ -637,6 +722,40 @@ export class CreateFeature {
637
722
  },
638
723
  "attribute": "is-mobile",
639
724
  "reflect": false
725
+ },
726
+ "floorLevel": {
727
+ "type": "string",
728
+ "mutable": false,
729
+ "complexType": {
730
+ "original": "string",
731
+ "resolved": "string",
732
+ "references": {}
733
+ },
734
+ "required": false,
735
+ "optional": false,
736
+ "docs": {
737
+ "tags": [],
738
+ "text": "string: selected floor level"
739
+ },
740
+ "attribute": "floor-level",
741
+ "reflect": false
742
+ },
743
+ "formElements": {
744
+ "type": "any",
745
+ "mutable": false,
746
+ "complexType": {
747
+ "original": "any",
748
+ "resolved": "any",
749
+ "references": {}
750
+ },
751
+ "required": false,
752
+ "optional": false,
753
+ "docs": {
754
+ "tags": [],
755
+ "text": "string: selected floor level"
756
+ },
757
+ "attribute": "form-elements",
758
+ "reflect": false
640
759
  }
641
760
  };
642
761
  }
@@ -785,6 +904,30 @@ export class CreateFeature {
785
904
  "text": "Promise that resolves when the operation is complete"
786
905
  }]
787
906
  }
907
+ },
908
+ "refresh": {
909
+ "complexType": {
910
+ "signature": "(floorLevel: string) => Promise<void>",
911
+ "parameters": [{
912
+ "name": "floorLevel",
913
+ "type": "string",
914
+ "docs": ""
915
+ }],
916
+ "references": {
917
+ "Promise": {
918
+ "location": "global",
919
+ "id": "global::Promise"
920
+ }
921
+ },
922
+ "return": "Promise<void>"
923
+ },
924
+ "docs": {
925
+ "text": "refresh the feature form",
926
+ "tags": [{
927
+ "name": "returns",
928
+ "text": "Promise that resolves when the operation is complete"
929
+ }]
930
+ }
788
931
  }
789
932
  };
790
933
  }
@@ -28,6 +28,7 @@ export class CrowdsourceManager {
28
28
  this.appProxies = undefined;
29
29
  this.basemapConfig = undefined;
30
30
  this.coverPageEnabled = undefined;
31
+ this.customInfoText = undefined;
31
32
  this.defaultCenter = "";
32
33
  this.defaultGlobalId = "";
33
34
  this.defaultLayer = "";
@@ -228,7 +229,7 @@ export class CrowdsourceManager {
228
229
  render() {
229
230
  // only avoid border when we have a header color that is not white
230
231
  const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
231
- return (h(Host, { key: '805eb5daf8d5d7879e3404cd3c5145abf36469de' }, h("calcite-shell", { key: 'cb8a9037084e0ce4d32986a19a9aac9e6f407e1a', class: "position-relative" }, h("calcite-panel", { key: '176b6ef3c05414ec4a0582aac2d56deb21bd329f', class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter()), this._filterModal()));
232
+ return (h(Host, { key: 'fa5d4e79b6f5a3eb176af497a4444bb9aca59f15' }, h("calcite-shell", { key: '3e7466a6db42b61db1f9b6efb5cd84b97d3f9d3b', class: "position-relative" }, h("calcite-panel", { key: '15b850a0e9c3b62ebe3bd94b39b61eff1734ad4b', class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter()), this._filterModal()));
232
233
  }
233
234
  /**
234
235
  * Called after each render
@@ -451,7 +452,7 @@ export class CrowdsourceManager {
451
452
  const isTableLayout = this.appLayout === 'tableView';
452
453
  const cardManagerHeight = (isMapLayout || isTableLayout) ? "height-full" : !this._isMobile ? "height-50" : "height-full";
453
454
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
454
- return (h("div", { class: `width-50 height-full ${themeClass}` }, h("card-manager", { class: `${cardManagerHeight} width-full`, enableEditGeometry: this?._mapInfo?.enableEditGeometry, isMobile: this._isMobile, layer: this._layer, mapView: this?._mapView, selectedFeaturesIds: this._layerTable?.selectedIds, zoomAndScrollToSelected: this.zoomAndScrollToSelected })));
455
+ return (h("div", { class: `width-50 height-full ${themeClass}` }, h("card-manager", { class: `${cardManagerHeight} width-full`, customInfoText: this.customInfoText, enableEditGeometry: this?._mapInfo?.enableEditGeometry, isMobile: this._isMobile, layer: this._layer, mapView: this?._mapView, selectedFeaturesIds: this._layerTable?.selectedIds, zoomAndScrollToSelected: this.zoomAndScrollToSelected })));
455
456
  }
456
457
  /**
457
458
  * Get the table node based for the current layout
@@ -777,6 +778,23 @@ export class CrowdsourceManager {
777
778
  "attribute": "cover-page-enabled",
778
779
  "reflect": false
779
780
  },
781
+ "customInfoText": {
782
+ "type": "string",
783
+ "mutable": false,
784
+ "complexType": {
785
+ "original": "string",
786
+ "resolved": "string",
787
+ "references": {}
788
+ },
789
+ "required": false,
790
+ "optional": false,
791
+ "docs": {
792
+ "tags": [],
793
+ "text": "string: custom notification text to display in the card manager"
794
+ },
795
+ "attribute": "custom-info-text",
796
+ "reflect": false
797
+ },
780
798
  "defaultCenter": {
781
799
  "type": "string",
782
800
  "mutable": false,