@esri/solutions-components 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow_6.cjs.entry.js +103 -7
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +173 -43
- package/dist/cjs/feature-list.cjs.entry.js +110 -17
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popupUtils-92e52dbf.js → popupUtils-47bd97e7.js} +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/assets/t9n/crowdsource-reporter/resources.json +3 -1
- package/dist/collection/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
- package/dist/collection/assets/t9n/feature-list/resources.json +3 -1
- package/dist/collection/assets/t9n/feature-list/resources_en.json +3 -1
- package/dist/collection/components/create-feature/create-feature.js +145 -2
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +227 -43
- package/dist/collection/components/feature-list/feature-list.css +16 -1
- package/dist/collection/components/feature-list/feature-list.js +165 -15
- package/dist/collection/components/layer-list/layer-list.js +35 -6
- package/dist/collection/demos/crowdsource-reporter.html +2 -0
- package/dist/collection/utils/popupUtils.js +1 -1
- package/dist/collection/utils/popupUtils.ts +1 -1
- package/dist/components/create-feature2.js +91 -3
- package/dist/components/crowdsource-reporter.js +178 -45
- package/dist/components/feature-list2.js +152 -50
- package/dist/components/layer-list2.js +18 -6
- package/dist/components/popupUtils.js +1 -1
- package/dist/esm/calcite-alert_4.entry.js +1 -1
- package/dist/esm/calcite-flow_6.entry.js +104 -8
- package/dist/esm/crowdsource-reporter.entry.js +173 -43
- package/dist/esm/feature-list.entry.js +110 -17
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popupUtils-00c655fb.js → popupUtils-349a26e6.js} +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources.json +3 -1
- package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
- package/dist/solutions-components/assets/t9n/feature-list/resources.json +3 -1
- package/dist/solutions-components/assets/t9n/feature-list/resources_en.json +3 -1
- package/dist/solutions-components/demos/crowdsource-reporter.html +2 -0
- package/dist/solutions-components/p-40e305b4.entry.js +17 -0
- package/dist/solutions-components/p-4d44410b.entry.js +6 -0
- package/dist/solutions-components/{p-900fee65.js → p-5a473f0d.js} +1 -1
- package/dist/solutions-components/p-9b83e593.entry.js +6 -0
- package/dist/solutions-components/{p-cde8d6e5.entry.js → p-f6bc95b3.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/popupUtils.ts +1 -1
- package/dist/types/components/create-feature/create-feature.d.ts +34 -0
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +80 -21
- package/dist/types/components/feature-list/feature-list.d.ts +49 -7
- package/dist/types/components/layer-list/layer-list.d.ts +4 -0
- package/dist/types/components.d.ts +77 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-064e43e0.entry.js +0 -6
- package/dist/solutions-components/p-2d1afda0.entry.js +0 -17
- package/dist/solutions-components/p-c9260b4c.entry.js +0 -6
@@ -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: '
|
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
|
}
|