@esri/solutions-components 0.8.30 → 0.8.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-flow_6.cjs.entry.js +58 -34
  3. package/dist/cjs/crowdsource-reporter.cjs.entry.js +2 -2
  4. package/dist/cjs/feature-list.cjs.entry.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{popupUtils-e3fa775b.js → popupUtils-9ca69f8c.js} +1 -1
  7. package/dist/cjs/solutions-components.cjs.js +1 -1
  8. package/dist/collection/components/create-feature/create-feature.js +13 -8
  9. package/dist/collection/components/create-related-feature/create-related-feature.css +4 -0
  10. package/dist/collection/components/create-related-feature/create-related-feature.js +52 -26
  11. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +4 -0
  12. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +1 -1
  13. package/dist/collection/utils/popupUtils.js +1 -1
  14. package/dist/collection/utils/popupUtils.ts +1 -1
  15. package/dist/components/create-feature2.js +13 -8
  16. package/dist/components/create-related-feature2.js +57 -30
  17. package/dist/components/crowdsource-reporter.js +2 -2
  18. package/dist/components/popupUtils.js +1 -1
  19. package/dist/esm/calcite-alert_4.entry.js +1 -1
  20. package/dist/esm/calcite-flow_6.entry.js +58 -34
  21. package/dist/esm/crowdsource-reporter.entry.js +2 -2
  22. package/dist/esm/feature-list.entry.js +1 -1
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/esm/{popupUtils-17193415.js → popupUtils-8efd3cde.js} +1 -1
  25. package/dist/esm/solutions-components.js +1 -1
  26. package/dist/solutions-components/p-2455bcb0.js +21 -0
  27. package/dist/solutions-components/{p-bb90a138.entry.js → p-3365a6de.entry.js} +2 -2
  28. package/dist/solutions-components/p-4ae34862.entry.js +17 -0
  29. package/dist/solutions-components/{p-16fb8296.entry.js → p-628874a6.entry.js} +1 -1
  30. package/dist/solutions-components/{p-2f7bfd8d.entry.js → p-90c3bc54.entry.js} +1 -1
  31. package/dist/solutions-components/solutions-components.esm.js +1 -1
  32. package/dist/solutions-components/utils/popupUtils.ts +1 -1
  33. package/dist/types/components/create-feature/create-feature.d.ts +1 -1
  34. package/dist/types/components/create-related-feature/create-related-feature.d.ts +19 -1
  35. package/package.json +1 -1
  36. package/dist/solutions-components/p-2e23ac2c.js +0 -21
  37. package/dist/solutions-components/p-c21a6940.entry.js +0 -17
@@ -32,7 +32,7 @@ export class CreateFeature {
32
32
  this.customizeSubmit = false;
33
33
  this.searchConfiguration = undefined;
34
34
  this._editorLoading = false;
35
- this.showSearchWidget = undefined;
35
+ this._showSearchWidget = undefined;
36
36
  }
37
37
  //--------------------------------------------------------------------------
38
38
  //
@@ -105,10 +105,10 @@ export class CreateFeature {
105
105
  * Renders the component.
106
106
  */
107
107
  render() {
108
- const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
108
+ const showSearchWidget = this._showSearchWidget ? '' : 'display-none';
109
109
  const loaderClass = this._editorLoading ? "" : "display-none";
110
110
  const featureFormClass = this._editorLoading ? "display-none" : "";
111
- return (h(Fragment, { key: '2e790defdd5592fed729853888ee06143c95c84d' }, h("calcite-loader", { key: 'a0f1de0064ea80305d4aaf83f78939c0236c955a', class: loaderClass, label: "", scale: "s" }), h("div", { key: '1af391d6d7fd0dffa2e8e4b43905f8081a5f9820', class: featureFormClass, id: "feature-form" }), h("div", { key: '88d12115c3c2e0d34a5d6fd8895fb60cec6e9b5d', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref" })));
111
+ return (h(Fragment, { key: 'a4ccd565a52a4cde4e76439629425f19bd4c222e' }, h("calcite-loader", { key: '30e8a3753985a734dd7cba461f26691b51f49ab9', class: loaderClass, label: "", scale: "s" }), h("div", { key: '0845f1fa85a21b578fd18200b43d4a77c34e6808', class: featureFormClass, id: "feature-form" }), h("div", { key: 'af74b6337f5a0dcfdbd552145c88eae5282a3307', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref" })));
112
112
  }
113
113
  //--------------------------------------------------------------------------
114
114
  //
@@ -198,7 +198,7 @@ export class CreateFeature {
198
198
  const formHandle = this.reactiveUtils.watch(() => this._editor.viewModel.state, (state) => {
199
199
  if (state === 'creating-features') {
200
200
  this._editorLoading = true;
201
- this.showSearchWidget = true;
201
+ this._showSearchWidget = true;
202
202
  }
203
203
  });
204
204
  this._editor.viewModel.addHandles(formHandle);
@@ -222,11 +222,12 @@ export class CreateFeature {
222
222
  //on sketch complete emit the event
223
223
  this._editor.viewModel.sketchViewModel.on("create", (evt) => {
224
224
  if (evt.state === "complete") {
225
- this.showSearchWidget = false;
225
+ this._showSearchWidget = false;
226
226
  this.progressStatus.emit(1);
227
227
  this.drawComplete.emit();
228
228
  }
229
229
  });
230
+ //hides the header and footer elements in editor widget
230
231
  this.hideEditorsElements().then(() => {
231
232
  resolve({});
232
233
  }, e => reject(e));
@@ -237,8 +238,12 @@ export class CreateFeature {
237
238
  if (items.length === 1) {
238
239
  this._editor.viewModel.featureTemplatesViewModel.select(items[0]);
239
240
  }
240
- //hides the header and footer elements in editor widget
241
- void this.hideEditorsElements();
241
+ const resolvePromise = items.length > 1;
242
+ this.hideEditorsElements().then(() => {
243
+ if (resolvePromise) {
244
+ resolve({});
245
+ }
246
+ }, e => resolvePromise && reject(e));
242
247
  }
243
248
  });
244
249
  }
@@ -486,7 +491,7 @@ export class CreateFeature {
486
491
  static get states() {
487
492
  return {
488
493
  "_editorLoading": {},
489
- "showSearchWidget": {}
494
+ "_showSearchWidget": {}
490
495
  };
491
496
  }
492
497
  static get events() {
@@ -5,4 +5,8 @@
5
5
  /* Override to hide Editor settings panel collapsible */
6
6
  .esri-editor__panel-toolbar {
7
7
  display: none !important;
8
+ }
9
+
10
+ .display-none {
11
+ display: none !important;
8
12
  }
@@ -18,7 +18,7 @@
18
18
  * See the License for the specific language governing permissions and
19
19
  * limitations under the License.
20
20
  */
21
- import { Host, h } from "@stencil/core";
21
+ import { h } from "@stencil/core";
22
22
  import { loadModules } from "../../utils/loadModules";
23
23
  export class CreateRelatedFeature {
24
24
  constructor() {
@@ -30,6 +30,7 @@ export class CreateRelatedFeature {
30
30
  this.table = undefined;
31
31
  this.selectedFeature = undefined;
32
32
  this.customizeSubmit = false;
33
+ this._editorLoading = false;
33
34
  }
34
35
  //--------------------------------------------------------------------------
35
36
  //
@@ -44,6 +45,18 @@ export class CreateRelatedFeature {
44
45
  await this.init();
45
46
  });
46
47
  }
48
+ /**
49
+ * When _editorLoading is true the container node will be hidden while starting the create workflow
50
+ */
51
+ async _editorLoadingWatchHandler(v) {
52
+ var _a, _b;
53
+ if (v) {
54
+ (_a = this._container) === null || _a === void 0 ? void 0 : _a.classList.add("display-none");
55
+ await this.startCreate();
56
+ (_b = this._container) === null || _b === void 0 ? void 0 : _b.classList.remove("display-none");
57
+ this._editorLoading = false;
58
+ }
59
+ }
47
60
  //--------------------------------------------------------------------------
48
61
  //
49
62
  // Methods (public)
@@ -100,7 +113,8 @@ export class CreateRelatedFeature {
100
113
  this.reactiveUtils = reactiveUtils;
101
114
  }
102
115
  render() {
103
- return (h(Host, { key: 'c8516898db79b35b7fba909810afdc56b0602ebd' }));
116
+ const loaderClass = this._editorLoading ? "" : "display-none";
117
+ return (h("calcite-loader", { key: 'a8fd1e83a4a9614779be19a11e6028b3a402cbd2', class: loaderClass, label: "", scale: "s" }));
104
118
  }
105
119
  /**
106
120
  * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
@@ -113,29 +127,24 @@ export class CreateRelatedFeature {
113
127
  * @protected
114
128
  */
115
129
  async createEditorWidget() {
130
+ var _a;
116
131
  if (this._editor) {
117
132
  this._editor.destroy();
118
133
  }
119
- const container = document.createElement("div");
134
+ this._container = document.createElement("div");
135
+ (_a = this._container) === null || _a === void 0 ? void 0 : _a.classList.add("display-none");
120
136
  this._editor = new this.Editor({
121
137
  view: this.mapView,
122
138
  visibleElements: {
123
139
  snappingControls: false
124
140
  },
125
- container
141
+ container: this._container
126
142
  });
127
- this.el.appendChild(container);
128
- //Add handle to watch featureFormViewModel ready state and hide the editor elements
129
- const hideElementHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.featureFormViewModel) === null || _a === void 0 ? void 0 : _a.state; }, (state) => {
130
- if (state === 'ready') {
131
- this.hideEditorsElements();
132
- }
133
- });
134
- this._editor.viewModel.addHandles(hideElementHandle);
143
+ this.el.appendChild(this._container);
135
144
  //Add handle to watch featureTemplatesViewModel ready state and then start the creation
136
145
  const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
137
146
  if (state === 'ready') {
138
- void this.startCreate();
147
+ this._editorLoading = true;
139
148
  }
140
149
  });
141
150
  this._editor.viewModel.addHandles(handle);
@@ -176,6 +185,8 @@ export class CreateRelatedFeature {
176
185
  template,
177
186
  };
178
187
  await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(creationInfo);
188
+ //hides the header and footer elements in editor widget
189
+ await this.hideEditorsElements();
179
190
  // Emit an event to show submit cancel buttons
180
191
  this.isActionPending.emit(false);
181
192
  this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
@@ -184,22 +195,21 @@ export class CreateRelatedFeature {
184
195
  * Hides the elements of editor widget
185
196
  * @protected
186
197
  */
187
- hideEditorsElements() {
198
+ async hideEditorsElements() {
199
+ var _a, _b;
188
200
  if (!this.customizeSubmit) {
189
201
  return;
190
202
  }
191
- setTimeout(() => {
192
- var _a;
193
- //hides the header and footer on the featureForm
194
- (_a = this.el.querySelector('.esri-editor').querySelectorAll('calcite-flow-item')) === null || _a === void 0 ? void 0 : _a.forEach((flowItem) => {
195
- var _a, _b, _c, _d, _e;
196
- const article = (_c = (_b = (_a = flowItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('calcite-panel')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('article');
197
- //hide the header
198
- (_d = article === null || article === void 0 ? void 0 : article.querySelector('header')) === null || _d === void 0 ? void 0 : _d.setAttribute('style', 'display: none');
199
- //hide the footer
200
- (_e = article === null || article === void 0 ? void 0 : article.querySelector('footer')) === null || _e === void 0 ? void 0 : _e.setAttribute('style', 'display: none');
201
- });
202
- }, 700);
203
+ await this.timeout(700);
204
+ //hides the header and footer on the featureForm
205
+ (_b = (_a = this.el.querySelector('.esri-editor')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('calcite-flow-item')) === null || _b === void 0 ? void 0 : _b.forEach((flowItem) => {
206
+ var _a, _b, _c, _d, _e;
207
+ const article = (_c = (_b = (_a = flowItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('calcite-panel')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('article');
208
+ //hide the header
209
+ (_d = article === null || article === void 0 ? void 0 : article.querySelector('header')) === null || _d === void 0 ? void 0 : _d.setAttribute('style', 'display: none');
210
+ //hide the footer
211
+ (_e = article === null || article === void 0 ? void 0 : article.querySelector('footer')) === null || _e === void 0 ? void 0 : _e.setAttribute('style', 'display: none');
212
+ });
203
213
  }
204
214
  /**
205
215
  * Makes attributes for related feature
@@ -255,6 +265,14 @@ export class CreateRelatedFeature {
255
265
  this.success.emit();
256
266
  }
257
267
  }
268
+ /**
269
+ * call setTimeout in Promise wrapper
270
+ * @param delay The time, in milliseconds that the timer should wait before the promise is resolved
271
+ * @protected
272
+ */
273
+ timeout(delay) {
274
+ return new Promise(resolve => setTimeout(resolve, delay));
275
+ }
258
276
  static get is() { return "create-related-feature"; }
259
277
  static get originalStyleUrls() {
260
278
  return {
@@ -348,6 +366,11 @@ export class CreateRelatedFeature {
348
366
  }
349
367
  };
350
368
  }
369
+ static get states() {
370
+ return {
371
+ "_editorLoading": {}
372
+ };
373
+ }
351
374
  static get events() {
352
375
  return [{
353
376
  "method": "success",
@@ -444,6 +467,9 @@ export class CreateRelatedFeature {
444
467
  return [{
445
468
  "propName": "mapView",
446
469
  "methodName": "mapViewWatchHandler"
470
+ }, {
471
+ "propName": "_editorLoading",
472
+ "methodName": "_editorLoadingWatchHandler"
447
473
  }];
448
474
  }
449
475
  }
@@ -79,3 +79,7 @@
79
79
  position: absolute;
80
80
  z-index: 1000;
81
81
  }
82
+
83
+ .share-node {
84
+ display: flex;
85
+ }
@@ -580,7 +580,7 @@ export class CrowdsourceReporter {
580
580
  getFeatureDetailsFlowItem() {
581
581
  var _a;
582
582
  const showCommentBtn = ((_a = this._getLayersConfig(this._selectedLayerId)) === null || _a === void 0 ? void 0 : _a.comment) && this._selectedLayer.relationships.length > 0;
583
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, removePopoverOffset: true, scale: "s", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("calcite-panel", null, h("feature-details", { class: 'full-height', graphics: this._selectedFeature, layerItemsHash: this._layerItemsHash, mapView: this.mapView, onCommentSelect: this.onCommentSelectFromList.bind(this), onFeatureSelectionChange: this.selectionChanged.bind(this), onLoadingStatus: (evt) => void this.updatingFeatureDetails(evt.detail), ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }), showCommentBtn &&
583
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, class: "share-node", embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, removePopoverOffset: true, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("calcite-panel", null, h("feature-details", { class: 'full-height', graphics: this._selectedFeature, layerItemsHash: this._layerItemsHash, mapView: this.mapView, onCommentSelect: this.onCommentSelectFromList.bind(this), onFeatureSelectionChange: this.selectionChanged.bind(this), onLoadingStatus: (evt) => void this.updatingFeatureDetails(evt.detail), ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }), showCommentBtn &&
584
584
  h("calcite-button", { appearance: "solid", onClick: () => this._flowItems = [...this._flowItems, "add-comment"], slot: "footer", width: "full" }, this._translations.comment))));
585
585
  }
586
586
  /**
@@ -68,7 +68,7 @@ export class PopupUtils {
68
68
  const fieldInfo = layer.popupTemplate.fieldInfos.find((fInfo) => fInfo.fieldName.toLowerCase() === field.name.toLowerCase());
69
69
  //format the attribute value
70
70
  const formattedAttributeValue = _prepareAttributeValue(attributeValue, field.type, field.domain, fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.format, this.intl);
71
- attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue;
71
+ attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue !== null && formattedAttributeValue !== void 0 ? formattedAttributeValue : attributeValue;
72
72
  });
73
73
  }
74
74
  return popupTitle === null || popupTitle === void 0 ? void 0 : popupTitle.replace(/{.*?}/g, (placeholder) => {
@@ -80,7 +80,7 @@ export class PopupUtils {
80
80
  const fieldInfo = layer.popupTemplate.fieldInfos.find((fInfo) => fInfo.fieldName.toLowerCase() === field.name.toLowerCase());
81
81
  //format the attribute value
82
82
  const formattedAttributeValue = _prepareAttributeValue(attributeValue, field.type, field.domain, fieldInfo?.format, this.intl);
83
- attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue;
83
+ attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue ?? attributeValue;
84
84
  })
85
85
  }
86
86
 
@@ -29,7 +29,7 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
29
29
  this.customizeSubmit = false;
30
30
  this.searchConfiguration = undefined;
31
31
  this._editorLoading = false;
32
- this.showSearchWidget = undefined;
32
+ this._showSearchWidget = undefined;
33
33
  }
34
34
  //--------------------------------------------------------------------------
35
35
  //
@@ -102,10 +102,10 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
102
102
  * Renders the component.
103
103
  */
104
104
  render() {
105
- const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
105
+ const showSearchWidget = this._showSearchWidget ? '' : 'display-none';
106
106
  const loaderClass = this._editorLoading ? "" : "display-none";
107
107
  const featureFormClass = this._editorLoading ? "display-none" : "";
108
- return (h(Fragment, { key: '2e790defdd5592fed729853888ee06143c95c84d' }, h("calcite-loader", { key: 'a0f1de0064ea80305d4aaf83f78939c0236c955a', class: loaderClass, label: "", scale: "s" }), h("div", { key: '1af391d6d7fd0dffa2e8e4b43905f8081a5f9820', class: featureFormClass, id: "feature-form" }), h("div", { key: '88d12115c3c2e0d34a5d6fd8895fb60cec6e9b5d', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref" })));
108
+ return (h(Fragment, { key: 'a4ccd565a52a4cde4e76439629425f19bd4c222e' }, h("calcite-loader", { key: '30e8a3753985a734dd7cba461f26691b51f49ab9', class: loaderClass, label: "", scale: "s" }), h("div", { key: '0845f1fa85a21b578fd18200b43d4a77c34e6808', class: featureFormClass, id: "feature-form" }), h("div", { key: 'af74b6337f5a0dcfdbd552145c88eae5282a3307', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref" })));
109
109
  }
110
110
  //--------------------------------------------------------------------------
111
111
  //
@@ -195,7 +195,7 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
195
195
  const formHandle = this.reactiveUtils.watch(() => this._editor.viewModel.state, (state) => {
196
196
  if (state === 'creating-features') {
197
197
  this._editorLoading = true;
198
- this.showSearchWidget = true;
198
+ this._showSearchWidget = true;
199
199
  }
200
200
  });
201
201
  this._editor.viewModel.addHandles(formHandle);
@@ -219,11 +219,12 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
219
219
  //on sketch complete emit the event
220
220
  this._editor.viewModel.sketchViewModel.on("create", (evt) => {
221
221
  if (evt.state === "complete") {
222
- this.showSearchWidget = false;
222
+ this._showSearchWidget = false;
223
223
  this.progressStatus.emit(1);
224
224
  this.drawComplete.emit();
225
225
  }
226
226
  });
227
+ //hides the header and footer elements in editor widget
227
228
  this.hideEditorsElements().then(() => {
228
229
  resolve({});
229
230
  }, e => reject(e));
@@ -234,8 +235,12 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
234
235
  if (items.length === 1) {
235
236
  this._editor.viewModel.featureTemplatesViewModel.select(items[0]);
236
237
  }
237
- //hides the header and footer elements in editor widget
238
- void this.hideEditorsElements();
238
+ const resolvePromise = items.length > 1;
239
+ this.hideEditorsElements().then(() => {
240
+ if (resolvePromise) {
241
+ resolve({});
242
+ }
243
+ }, e => resolvePromise && reject(e));
239
244
  }
240
245
  });
241
246
  }
@@ -401,7 +406,7 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
401
406
  "customizeSubmit": [4, "customize-submit"],
402
407
  "searchConfiguration": [16],
403
408
  "_editorLoading": [32],
404
- "showSearchWidget": [32],
409
+ "_showSearchWidget": [32],
405
410
  "close": [64],
406
411
  "submit": [64]
407
412
  }, undefined, {
@@ -3,10 +3,11 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
6
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
7
7
  import { l as loadModules } from './loadModules.js';
8
+ import { d as defineCustomElement$1 } from './loader.js';
8
9
 
9
- const createRelatedFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}";
10
+ const createRelatedFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.display-none{display:none !important}";
10
11
  const CreateRelatedFeatureStyle0 = createRelatedFeatureCss;
11
12
 
12
13
  const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelatedFeature extends HTMLElement {
@@ -24,6 +25,7 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
24
25
  this.table = undefined;
25
26
  this.selectedFeature = undefined;
26
27
  this.customizeSubmit = false;
28
+ this._editorLoading = false;
27
29
  }
28
30
  //--------------------------------------------------------------------------
29
31
  //
@@ -38,6 +40,18 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
38
40
  await this.init();
39
41
  });
40
42
  }
43
+ /**
44
+ * When _editorLoading is true the container node will be hidden while starting the create workflow
45
+ */
46
+ async _editorLoadingWatchHandler(v) {
47
+ var _a, _b;
48
+ if (v) {
49
+ (_a = this._container) === null || _a === void 0 ? void 0 : _a.classList.add("display-none");
50
+ await this.startCreate();
51
+ (_b = this._container) === null || _b === void 0 ? void 0 : _b.classList.remove("display-none");
52
+ this._editorLoading = false;
53
+ }
54
+ }
41
55
  //--------------------------------------------------------------------------
42
56
  //
43
57
  // Methods (public)
@@ -94,7 +108,8 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
94
108
  this.reactiveUtils = reactiveUtils;
95
109
  }
96
110
  render() {
97
- return (h(Host, { key: 'c8516898db79b35b7fba909810afdc56b0602ebd' }));
111
+ const loaderClass = this._editorLoading ? "" : "display-none";
112
+ return (h("calcite-loader", { key: 'a8fd1e83a4a9614779be19a11e6028b3a402cbd2', class: loaderClass, label: "", scale: "s" }));
98
113
  }
99
114
  /**
100
115
  * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
@@ -107,29 +122,24 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
107
122
  * @protected
108
123
  */
109
124
  async createEditorWidget() {
125
+ var _a;
110
126
  if (this._editor) {
111
127
  this._editor.destroy();
112
128
  }
113
- const container = document.createElement("div");
129
+ this._container = document.createElement("div");
130
+ (_a = this._container) === null || _a === void 0 ? void 0 : _a.classList.add("display-none");
114
131
  this._editor = new this.Editor({
115
132
  view: this.mapView,
116
133
  visibleElements: {
117
134
  snappingControls: false
118
135
  },
119
- container
120
- });
121
- this.el.appendChild(container);
122
- //Add handle to watch featureFormViewModel ready state and hide the editor elements
123
- const hideElementHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.featureFormViewModel) === null || _a === void 0 ? void 0 : _a.state; }, (state) => {
124
- if (state === 'ready') {
125
- this.hideEditorsElements();
126
- }
136
+ container: this._container
127
137
  });
128
- this._editor.viewModel.addHandles(hideElementHandle);
138
+ this.el.appendChild(this._container);
129
139
  //Add handle to watch featureTemplatesViewModel ready state and then start the creation
130
140
  const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
131
141
  if (state === 'ready') {
132
- void this.startCreate();
142
+ this._editorLoading = true;
133
143
  }
134
144
  });
135
145
  this._editor.viewModel.addHandles(handle);
@@ -170,6 +180,8 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
170
180
  template,
171
181
  };
172
182
  await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(creationInfo);
183
+ //hides the header and footer elements in editor widget
184
+ await this.hideEditorsElements();
173
185
  // Emit an event to show submit cancel buttons
174
186
  this.isActionPending.emit(false);
175
187
  this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
@@ -178,22 +190,21 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
178
190
  * Hides the elements of editor widget
179
191
  * @protected
180
192
  */
181
- hideEditorsElements() {
193
+ async hideEditorsElements() {
194
+ var _a, _b;
182
195
  if (!this.customizeSubmit) {
183
196
  return;
184
197
  }
185
- setTimeout(() => {
186
- var _a;
187
- //hides the header and footer on the featureForm
188
- (_a = this.el.querySelector('.esri-editor').querySelectorAll('calcite-flow-item')) === null || _a === void 0 ? void 0 : _a.forEach((flowItem) => {
189
- var _a, _b, _c, _d, _e;
190
- const article = (_c = (_b = (_a = flowItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('calcite-panel')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('article');
191
- //hide the header
192
- (_d = article === null || article === void 0 ? void 0 : article.querySelector('header')) === null || _d === void 0 ? void 0 : _d.setAttribute('style', 'display: none');
193
- //hide the footer
194
- (_e = article === null || article === void 0 ? void 0 : article.querySelector('footer')) === null || _e === void 0 ? void 0 : _e.setAttribute('style', 'display: none');
195
- });
196
- }, 700);
198
+ await this.timeout(700);
199
+ //hides the header and footer on the featureForm
200
+ (_b = (_a = this.el.querySelector('.esri-editor')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('calcite-flow-item')) === null || _b === void 0 ? void 0 : _b.forEach((flowItem) => {
201
+ var _a, _b, _c, _d, _e;
202
+ const article = (_c = (_b = (_a = flowItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('calcite-panel')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('article');
203
+ //hide the header
204
+ (_d = article === null || article === void 0 ? void 0 : article.querySelector('header')) === null || _d === void 0 ? void 0 : _d.setAttribute('style', 'display: none');
205
+ //hide the footer
206
+ (_e = article === null || article === void 0 ? void 0 : article.querySelector('footer')) === null || _e === void 0 ? void 0 : _e.setAttribute('style', 'display: none');
207
+ });
197
208
  }
198
209
  /**
199
210
  * Makes attributes for related feature
@@ -249,9 +260,18 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
249
260
  this.success.emit();
250
261
  }
251
262
  }
263
+ /**
264
+ * call setTimeout in Promise wrapper
265
+ * @param delay The time, in milliseconds that the timer should wait before the promise is resolved
266
+ * @protected
267
+ */
268
+ timeout(delay) {
269
+ return new Promise(resolve => setTimeout(resolve, delay));
270
+ }
252
271
  get el() { return this; }
253
272
  static get watchers() { return {
254
- "mapView": ["mapViewWatchHandler"]
273
+ "mapView": ["mapViewWatchHandler"],
274
+ "_editorLoading": ["_editorLoadingWatchHandler"]
255
275
  }; }
256
276
  static get style() { return CreateRelatedFeatureStyle0; }
257
277
  }, [0, "create-related-feature", {
@@ -259,22 +279,29 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
259
279
  "table": [16],
260
280
  "selectedFeature": [16],
261
281
  "customizeSubmit": [4, "customize-submit"],
282
+ "_editorLoading": [32],
262
283
  "close": [64],
263
284
  "submit": [64]
264
285
  }, undefined, {
265
- "mapView": ["mapViewWatchHandler"]
286
+ "mapView": ["mapViewWatchHandler"],
287
+ "_editorLoading": ["_editorLoadingWatchHandler"]
266
288
  }]);
267
289
  function defineCustomElement() {
268
290
  if (typeof customElements === "undefined") {
269
291
  return;
270
292
  }
271
- const components = ["create-related-feature"];
293
+ const components = ["create-related-feature", "calcite-loader"];
272
294
  components.forEach(tagName => { switch (tagName) {
273
295
  case "create-related-feature":
274
296
  if (!customElements.get(tagName)) {
275
297
  customElements.define(tagName, CreateRelatedFeature);
276
298
  }
277
299
  break;
300
+ case "calcite-loader":
301
+ if (!customElements.get(tagName)) {
302
+ defineCustomElement$1();
303
+ }
304
+ break;
278
305
  } });
279
306
  }
280
307
  defineCustomElement();
@@ -55,7 +55,7 @@ import { d as defineCustomElement$4 } from './instant-apps-filter-list2.js';
55
55
  import { d as defineCustomElement$3 } from './instant-apps-social-share2.js';
56
56
  import { d as defineCustomElement$2 } from './layer-list2.js';
57
57
 
58
- const crowdsourceReporterCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1) !important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}.report-submitted-msg{position:absolute;z-index:1000}";
58
+ const crowdsourceReporterCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1) !important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}.report-submitted-msg{position:absolute;z-index:1000}.share-node{display:flex}";
59
59
  const CrowdsourceReporterStyle0 = crowdsourceReporterCss;
60
60
 
61
61
  const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceReporter extends HTMLElement {
@@ -618,7 +618,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
618
618
  getFeatureDetailsFlowItem() {
619
619
  var _a;
620
620
  const showCommentBtn = ((_a = this._getLayersConfig(this._selectedLayerId)) === null || _a === void 0 ? void 0 : _a.comment) && this._selectedLayer.relationships.length > 0;
621
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, removePopoverOffset: true, scale: "s", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("calcite-panel", null, h("feature-details", { class: 'full-height', graphics: this._selectedFeature, layerItemsHash: this._layerItemsHash, mapView: this.mapView, onCommentSelect: this.onCommentSelectFromList.bind(this), onFeatureSelectionChange: this.selectionChanged.bind(this), onLoadingStatus: (evt) => void this.updatingFeatureDetails(evt.detail), ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }), showCommentBtn &&
621
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, class: "share-node", embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, removePopoverOffset: true, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("calcite-panel", null, h("feature-details", { class: 'full-height', graphics: this._selectedFeature, layerItemsHash: this._layerItemsHash, mapView: this.mapView, onCommentSelect: this.onCommentSelectFromList.bind(this), onFeatureSelectionChange: this.selectionChanged.bind(this), onLoadingStatus: (evt) => void this.updatingFeatureDetails(evt.detail), ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }), showCommentBtn &&
622
622
  h("calcite-button", { appearance: "solid", onClick: () => this._flowItems = [...this._flowItems, "add-comment"], slot: "footer", width: "full" }, this._translations.comment))));
623
623
  }
624
624
  /**
@@ -69,7 +69,7 @@ class PopupUtils {
69
69
  const fieldInfo = layer.popupTemplate.fieldInfos.find((fInfo) => fInfo.fieldName.toLowerCase() === field.name.toLowerCase());
70
70
  //format the attribute value
71
71
  const formattedAttributeValue = _prepareAttributeValue(attributeValue, field.type, field.domain, fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.format, this.intl);
72
- attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue;
72
+ attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue !== null && formattedAttributeValue !== void 0 ? formattedAttributeValue : attributeValue;
73
73
  });
74
74
  }
75
75
  return popupTitle === null || popupTitle === void 0 ? void 0 : popupTitle.replace(/{.*?}/g, (placeholder) => {
@@ -13,7 +13,7 @@ import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as
13
13
  import { K as KindIcons } from './resources-ae36eaff.js';
14
14
  import { g as getLocaleComponentStrings, l as loadModules } from './locale-a490c4f6.js';
15
15
  import { a as getAllLayers } from './mapViewUtils-b8deb4ae.js';
16
- import { P as PopupUtils } from './popupUtils-17193415.js';
16
+ import { P as PopupUtils } from './popupUtils-8efd3cde.js';
17
17
  import './guid-f05d01d5.js';
18
18
  import './resources-1febf4c6.js';
19
19
  import './key-092b6260.js';