@esri/solutions-components 0.7.31 → 0.7.33
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-flow_5.cjs.entry.js +94 -43
- package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +35 -8
- package/dist/cjs/{downloadUtils-10e0de31.js → downloadUtils-6b451886.js} +2 -2
- package/dist/cjs/{index.es-72dc7ab9.js → index.es-3eaba9ef.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -19
- package/dist/collection/components/create-feature/create-feature.css +27 -0
- package/dist/collection/components/create-feature/create-feature.js +126 -43
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +35 -8
- package/dist/collection/components/map-fullscreen/map-fullscreen.css +19 -19
- package/dist/collection/components/map-legend/map-legend.css +3 -3
- package/dist/collection/demos/create-feature.html +90 -0
- package/dist/collection/utils/downloadUtils.js +1 -1
- package/dist/collection/utils/downloadUtils.ts +1 -1
- package/dist/components/create-feature2.js +96 -44
- package/dist/components/crowdsource-reporter.js +35 -8
- package/dist/components/downloadUtils.js +1 -1
- package/dist/esm/calcite-flow_5.entry.js +95 -44
- package/dist/esm/card-manager_3.entry.js +1 -1
- package/dist/esm/crowdsource-reporter.entry.js +35 -8
- package/dist/esm/{downloadUtils-d297078f.js → downloadUtils-4577cf8b.js} +2 -2
- package/dist/esm/{index.es-3b4fa9d0.js → index.es-a28dad8e.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/create-feature.html +90 -0
- package/dist/solutions-components/{p-09ec8c8f.entry.js → p-288dfd06.entry.js} +1 -1
- package/dist/solutions-components/{p-103c5318.js → p-6c85b276.js} +2 -2
- package/dist/solutions-components/{p-57d49d15.entry.js → p-a84acc82.entry.js} +1 -1
- package/dist/solutions-components/{p-8ec25bf4.js → p-b1a5f341.js} +1 -1
- package/dist/solutions-components/p-d5263cb9.entry.js +17 -0
- package/dist/solutions-components/{p-921f21d5.entry.js → p-e22bce70.entry.js} +1 -1
- package/dist/solutions-components/p-ea17cefb.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +1 -1
- package/dist/solutions-components_commit.txt +7 -0
- package/dist/types/components/create-feature/create-feature.d.ts +21 -3
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +18 -4
- package/dist/types/components.d.ts +13 -0
- package/dist/types/preact.d.ts +2 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-b4e2cac4.entry.js +0 -17
- package/dist/solutions-components/p-bb6562ab.entry.js +0 -6
@@ -339,7 +339,7 @@ const FlowItem = class {
|
|
339
339
|
};
|
340
340
|
FlowItem.style = flowItemCss;
|
341
341
|
|
342
|
-
const createFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}";
|
342
|
+
const createFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}";
|
343
343
|
|
344
344
|
const CreateFeature = class {
|
345
345
|
constructor(hostRef) {
|
@@ -347,8 +347,10 @@ const CreateFeature = class {
|
|
347
347
|
this.success = index.createEvent(this, "success", 7);
|
348
348
|
this.fail = index.createEvent(this, "fail", 7);
|
349
349
|
this.drawComplete = index.createEvent(this, "drawComplete", 7);
|
350
|
+
this.editingAttachment = index.createEvent(this, "editingAttachment", 7);
|
350
351
|
this.mapView = undefined;
|
351
352
|
this.selectedLayerId = undefined;
|
353
|
+
this.customizeSubmit = false;
|
352
354
|
}
|
353
355
|
//--------------------------------------------------------------------------
|
354
356
|
//
|
@@ -419,18 +421,8 @@ const CreateFeature = class {
|
|
419
421
|
* Init Editor widget and starts the create workflow
|
420
422
|
*/
|
421
423
|
async init() {
|
422
|
-
if (this.mapView) {
|
423
|
-
|
424
|
-
await mapViewUtils.getLayerOrTable(this.mapView, this.selectedLayerId);
|
425
|
-
await this.createEditorWidget();
|
426
|
-
await this.startCreate();
|
427
|
-
this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
|
428
|
-
setTimeout(() => {
|
429
|
-
var _a, _b;
|
430
|
-
this.el.querySelector('.esri-editor').querySelectorAll('calcite-flow-item')[1].shadowRoot.querySelector('calcite-panel').shadowRoot.querySelector('article').querySelector('header').setAttribute('style', 'display: none');
|
431
|
-
(_b = (_a = this.el.querySelector('.esri-editor').querySelectorAll('calcite-flow-item')[1].shadowRoot.querySelector('calcite-panel').shadowRoot.querySelector('article')) === null || _a === void 0 ? void 0 : _a.querySelector('footer')) === null || _b === void 0 ? void 0 : _b.setAttribute('style', 'display: none');
|
432
|
-
}, 700);
|
433
|
-
}
|
424
|
+
if (this.mapView && this.selectedLayerId) {
|
425
|
+
await this.createEditorWidget();
|
434
426
|
}
|
435
427
|
}
|
436
428
|
/**
|
@@ -439,10 +431,12 @@ const CreateFeature = class {
|
|
439
431
|
* @protected
|
440
432
|
*/
|
441
433
|
async initModules() {
|
442
|
-
const [Editor] = await locale$1.loadModules([
|
443
|
-
"esri/widgets/Editor"
|
434
|
+
const [Editor, reactiveUtils] = await locale$1.loadModules([
|
435
|
+
"esri/widgets/Editor",
|
436
|
+
"esri/core/reactiveUtils"
|
444
437
|
]);
|
445
438
|
this.Editor = Editor;
|
439
|
+
this.reactiveUtils = reactiveUtils;
|
446
440
|
}
|
447
441
|
/**
|
448
442
|
* Display editor widget to create the new feature
|
@@ -452,50 +446,104 @@ const CreateFeature = class {
|
|
452
446
|
if (this._editor) {
|
453
447
|
this._editor.destroy();
|
454
448
|
}
|
449
|
+
const layerInfos = [];
|
455
450
|
const container = document.createElement("div");
|
456
|
-
const
|
457
|
-
|
458
|
-
|
459
|
-
|
451
|
+
const allMapLayers = await mapViewUtils.getAllLayers(this.mapView);
|
452
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
453
|
+
allMapLayers.forEach(async (eachLayer) => {
|
454
|
+
layerInfos.push({
|
455
|
+
layer: eachLayer,
|
456
|
+
enabled: (eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.type) === "feature" && (eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.id) === this.selectedLayerId,
|
457
|
+
addEnabled: true,
|
458
|
+
updateEnabled: false,
|
459
|
+
deleteEnabled: false // default is true, set to false to disable the ability to delete features
|
460
|
+
});
|
461
|
+
});
|
460
462
|
this._editor = new this.Editor({
|
461
463
|
allowedWorkflows: "create-features",
|
462
464
|
view: this.mapView,
|
463
|
-
layerInfos:
|
465
|
+
layerInfos: layerInfos,
|
464
466
|
visibleElements: {
|
465
|
-
snappingControls: false
|
466
|
-
snappingControlsElements: {
|
467
|
-
featureEnabledToggle: false,
|
468
|
-
layerList: false,
|
469
|
-
enabledToggle: false
|
470
|
-
}
|
467
|
+
snappingControls: false
|
471
468
|
},
|
472
|
-
container
|
469
|
+
container
|
473
470
|
});
|
474
471
|
this.el.appendChild(container);
|
472
|
+
//Add handle to watch if attachments are added/edited
|
473
|
+
const attachmentHandle = this.reactiveUtils.watch(() => this._editor.viewModel.state, (state) => {
|
474
|
+
if (state === 'adding-attachment' || state === 'editing-attachment') {
|
475
|
+
this._addingAttachment = true;
|
476
|
+
this.editingAttachment.emit(true);
|
477
|
+
}
|
478
|
+
else {
|
479
|
+
if (this._addingAttachment) {
|
480
|
+
this.editingAttachment.emit(false);
|
481
|
+
this._addingAttachment = false;
|
482
|
+
}
|
483
|
+
}
|
484
|
+
});
|
485
|
+
this._editor.viewModel.addHandles(attachmentHandle);
|
486
|
+
//Add handle to watch featureTemplatesViewModel ready state and then start the creation
|
487
|
+
const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
|
488
|
+
if (state === 'ready') {
|
489
|
+
void this.startCreate();
|
490
|
+
}
|
491
|
+
});
|
492
|
+
this._editor.viewModel.addHandles(handle);
|
475
493
|
}
|
476
494
|
/**
|
477
495
|
* Start creating the feature
|
478
496
|
* @protected
|
479
497
|
*/
|
480
498
|
async startCreate() {
|
481
|
-
var _a
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
499
|
+
var _a;
|
500
|
+
if ((_a = this._editor.viewModel.featureTemplatesViewModel.items) === null || _a === void 0 ? void 0 : _a.length) {
|
501
|
+
const items = this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");
|
502
|
+
//once the feature template is selected handle the event for formSubmit and sketch complete
|
503
|
+
//also, hide the headers and footer in the editor as we will be showing our own submit and cancel button
|
504
|
+
this._editor.viewModel.featureTemplatesViewModel.on('select', () => {
|
505
|
+
setTimeout(() => {
|
506
|
+
//on form submit
|
507
|
+
this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
|
508
|
+
//on sketch complete emit the event
|
509
|
+
this._editor.viewModel.sketchViewModel.on("create", (evt) => {
|
510
|
+
if (evt.state === "complete") {
|
511
|
+
this.drawComplete.emit();
|
512
|
+
}
|
513
|
+
});
|
514
|
+
this.hideEditorsElements();
|
515
|
+
}, 700);
|
516
|
+
this.hideEditorsElements();
|
497
517
|
});
|
518
|
+
//if only one feature template then directly start geometry creation for that
|
519
|
+
//else allow feature template selection to user
|
520
|
+
if (items.length === 1) {
|
521
|
+
this._editor.viewModel.featureTemplatesViewModel.select(items[0]);
|
522
|
+
}
|
523
|
+
//hides the header and footer elements in editor widget
|
524
|
+
this.hideEditorsElements();
|
525
|
+
}
|
526
|
+
}
|
527
|
+
/**
|
528
|
+
* Hides the elements of editor widget
|
529
|
+
* @protected
|
530
|
+
*/
|
531
|
+
hideEditorsElements() {
|
532
|
+
if (!this.customizeSubmit) {
|
533
|
+
return;
|
498
534
|
}
|
535
|
+
setTimeout(() => {
|
536
|
+
var _a;
|
537
|
+
//hides the header and footer on the featureForm
|
538
|
+
(_a = this.el.querySelector('.esri-editor').querySelectorAll('calcite-flow-item')) === null || _a === void 0 ? void 0 : _a.forEach((flowItem) => {
|
539
|
+
var _a, _b, _c, _d, _e;
|
540
|
+
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');
|
541
|
+
//hide the header
|
542
|
+
(_d = article === null || article === void 0 ? void 0 : article.querySelector('header')) === null || _d === void 0 ? void 0 : _d.setAttribute('style', 'display: none');
|
543
|
+
//hide the footer
|
544
|
+
(_e = article === null || article === void 0 ? void 0 : article.querySelector('footer')) === null || _e === void 0 ? void 0 : _e.setAttribute('style', 'display: none');
|
545
|
+
});
|
546
|
+
}, 700);
|
499
547
|
}
|
500
548
|
/**
|
501
549
|
* On creation of feature emit the event that the feature is created
|
@@ -504,9 +552,12 @@ const CreateFeature = class {
|
|
504
552
|
*/
|
505
553
|
async submitted(evt) {
|
506
554
|
var _a;
|
555
|
+
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
507
556
|
if (evt.invalid.length) {
|
508
557
|
return;
|
509
558
|
}
|
559
|
+
//Submit only when valid attributes
|
560
|
+
//emit success or fail based on the result
|
510
561
|
if (evt.valid.length) {
|
511
562
|
try {
|
512
563
|
await this._editor.activeWorkflow.commit();
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
const index = require('./index-b8a649fc.js');
|
11
11
|
const locale = require('./locale-a476e15d.js');
|
12
12
|
const mapViewUtils = require('./mapViewUtils-8aa325de.js');
|
13
|
-
const downloadUtils = require('./downloadUtils-
|
13
|
+
const downloadUtils = require('./downloadUtils-6b451886.js');
|
14
14
|
require('./esri-loader-a91c0ec1.js');
|
15
15
|
require('./_commonjsHelpers-384729db.js');
|
16
16
|
require('./interfaces-7cd0a48a.js');
|
@@ -83,6 +83,7 @@ const CrowdsourceReporter = class {
|
|
83
83
|
* @returns Promise when complete
|
84
84
|
*/
|
85
85
|
async componentWillLoad() {
|
86
|
+
this._urlParamsLoaded = false;
|
86
87
|
await this._initModules();
|
87
88
|
await this._getTranslations();
|
88
89
|
}
|
@@ -119,6 +120,11 @@ const CrowdsourceReporter = class {
|
|
119
120
|
setSelectedLayer(layerId, layerName) {
|
120
121
|
this._selectedLayerId = layerId;
|
121
122
|
this._selectedLayerName = layerName;
|
123
|
+
//show only current layer on map and hide other valid editable layers
|
124
|
+
//if layerId is empty then show all the layers on map
|
125
|
+
this._validLayers.forEach(layer => {
|
126
|
+
layer.set('visible', !layerId || (layer.id === layerId));
|
127
|
+
});
|
122
128
|
}
|
123
129
|
/**
|
124
130
|
* Get the reporter app functionality
|
@@ -175,15 +181,22 @@ const CrowdsourceReporter = class {
|
|
175
181
|
* @protected
|
176
182
|
*/
|
177
183
|
getFeatureCreateFlowItem() {
|
178
|
-
return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && index.h("div", { class: "width-full", slot: "footer" }, index.h("calcite-button", { appearance: "secondary", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), index.h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), index.h("calcite-panel", { "full-height": true, "full-width": true }, index.h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, index.h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), index.h("create-feature", { mapView: this.mapView, onDrawComplete: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.
|
184
|
+
return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && index.h("div", { class: "width-full", slot: "footer" }, index.h("calcite-button", { appearance: "secondary", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), index.h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), index.h("calcite-panel", { "full-height": true, "full-width": true }, index.h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, index.h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), index.h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, selectedLayerId: this._selectedLayerId }))));
|
179
185
|
}
|
180
186
|
/**
|
181
187
|
* When drawing of incident location completed on map show the submit and cancel button
|
182
188
|
* @protected
|
183
189
|
*/
|
184
|
-
|
190
|
+
onDrawComplete() {
|
185
191
|
this._showSubmitCancelButton = true;
|
186
192
|
}
|
193
|
+
/**
|
194
|
+
* When Add attachment panel is enabled hide the submit and cancel button
|
195
|
+
* @protected
|
196
|
+
*/
|
197
|
+
showSubmitCancelButton(evt) {
|
198
|
+
this._showSubmitCancelButton = !evt.detail;
|
199
|
+
}
|
187
200
|
/**
|
188
201
|
* On back from create feature, call submit editor to destroy the Editor widget instance
|
189
202
|
* @protected
|
@@ -216,11 +229,22 @@ const CrowdsourceReporter = class {
|
|
216
229
|
* On submit report navigate to the layer list home page and refresh the layer list
|
217
230
|
* @protected
|
218
231
|
*/
|
219
|
-
|
232
|
+
onReportSubmitted() {
|
220
233
|
this._reportSubmitted = true;
|
234
|
+
this.navigateToHomePage();
|
235
|
+
}
|
236
|
+
/**
|
237
|
+
* Navigates to layer-list
|
238
|
+
* @protected
|
239
|
+
*/
|
240
|
+
navigateToHomePage() {
|
241
|
+
if (this._createFeature) {
|
242
|
+
this._createFeature.close();
|
243
|
+
}
|
221
244
|
if (this._layerList) {
|
222
245
|
this._layerList.refresh();
|
223
246
|
}
|
247
|
+
this.setSelectedFeatures([]);
|
224
248
|
this._flowItems = ["layer-list"];
|
225
249
|
}
|
226
250
|
/**
|
@@ -266,7 +290,10 @@ const CrowdsourceReporter = class {
|
|
266
290
|
//update the has valid layer state
|
267
291
|
this._hasValidLayers = layersListed.length > 0;
|
268
292
|
//navigate to the feature details if URL params found
|
269
|
-
|
293
|
+
if (!this._urlParamsLoaded) {
|
294
|
+
this._urlParamsLoaded = true;
|
295
|
+
await this.loadFeatureFromURLParams();
|
296
|
+
}
|
270
297
|
}
|
271
298
|
/**On click of layer list item show feature list
|
272
299
|
* @param evt Event which has details of selected layerId and layerName
|
@@ -283,10 +310,10 @@ const CrowdsourceReporter = class {
|
|
283
310
|
backFromSelectedPanel() {
|
284
311
|
const updatedFlowItems = [...this._flowItems];
|
285
312
|
updatedFlowItems.pop();
|
286
|
-
//
|
313
|
+
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
287
314
|
if (updatedFlowItems.length === 1) {
|
288
|
-
this.
|
289
|
-
|
315
|
+
this.navigateToHomePage();
|
316
|
+
return;
|
290
317
|
}
|
291
318
|
this._flowItems = [...updatedFlowItems];
|
292
319
|
}
|
@@ -435,7 +462,6 @@ const CrowdsourceReporter = class {
|
|
435
462
|
}
|
436
463
|
/**
|
437
464
|
* Updates the share url for current selected feature
|
438
|
-
* @returns
|
439
465
|
* @protected
|
440
466
|
*/
|
441
467
|
_updateShareURL() {
|
@@ -464,6 +490,7 @@ const CrowdsourceReporter = class {
|
|
464
490
|
}
|
465
491
|
/**
|
466
492
|
* Navigates to selected features detail based on the URL params
|
493
|
+
* @protected
|
467
494
|
*/
|
468
495
|
async loadFeatureFromURLParams() {
|
469
496
|
if (this.layerId && this.objectId) {
|
@@ -1510,7 +1510,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
|
|
1510
1510
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1511
1511
|
* ====================================================================
|
1512
1512
|
*/
|
1513
|
-
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-
|
1513
|
+
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-3eaba9ef.js'); })).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
1514
1514
|
/** ====================================================================
|
1515
1515
|
* @license
|
1516
1516
|
* jsPDF XMP metadata plugin
|
@@ -3084,7 +3084,7 @@ async function _prepareLabelsFromPattern(layer, featureSet, attributeOrigNames,
|
|
3084
3084
|
const match = arcadeExpressionMatches[i];
|
3085
3085
|
const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
|
3086
3086
|
const value = await arcadeExecutors[expressionName].executeAsync({ "$feature": feature, "$layer": layer });
|
3087
|
-
labelPrep = labelPrep.replace(match, value);
|
3087
|
+
labelPrep = labelPrep.replace(match, value).replace(/\n/gi, "|");
|
3088
3088
|
}
|
3089
3089
|
// Replace non-Arcade fields in this feature
|
3090
3090
|
const attributeValues = (_a = feature.attributes) !== null && _a !== void 0 ? _a : feature;
|
@@ -6,7 +6,7 @@
|
|
6
6
|
'use strict';
|
7
7
|
|
8
8
|
const _commonjsHelpers = require('./_commonjsHelpers-384729db.js');
|
9
|
-
const downloadUtils = require('./downloadUtils-
|
9
|
+
const downloadUtils = require('./downloadUtils-6b451886.js');
|
10
10
|
require('./index-b8a649fc.js');
|
11
11
|
require('./locale-a476e15d.js');
|
12
12
|
require('./esri-loader-a91c0ec1.js');
|