@esri/solutions-components 0.6.36 → 0.6.38
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/basemap-gallery_7.cjs.entry.js +16 -0
- package/dist/cjs/calcite-alert_3.cjs.entry.js +2 -13
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/card-manager_3.cjs.entry.js +4 -3
- package/dist/cjs/{downloadUtils-37d9aaf3.js → downloadUtils-d8e48fbd.js} +55 -12
- package/dist/cjs/{index.es-d1d9b140.js → index.es-6159eedc.js} +4 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -3
- package/dist/cjs/{mapViewUtils-96172223.js → mapViewUtils-f7bbc35b.js} +5 -2
- package/dist/cjs/public-notification.cjs.entry.js +6 -5
- package/dist/cjs/{clean-url-d5326abb.js → restHelpersGet-c94617cf.js} +398 -0
- package/dist/cjs/solution-configuration.cjs.entry.js +565 -565
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-714601a2.js → solution-store-b40c2f46.js} +19 -383
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/basemap-gallery/basemap-gallery.js +8 -0
- package/dist/collection/components/edit-card/edit-card.js +1 -12
- package/dist/collection/components/map-legend/map-legend.js +9 -1
- package/dist/collection/components/public-notification/public-notification.js +7 -6
- package/dist/collection/utils/downloadUtils.js +50 -8
- package/dist/collection/utils/downloadUtils.ts +62 -9
- package/dist/collection/utils/queryUtils.js +5 -2
- package/dist/collection/utils/queryUtils.ts +4 -2
- package/dist/components/basemap-gallery2.js +8 -0
- package/dist/components/downloadUtils.js +51 -8
- package/dist/components/edit-card2.js +1 -12
- package/dist/components/map-legend2.js +8 -0
- package/dist/components/public-notification.js +3 -3
- package/dist/components/queryUtils.js +5 -2
- package/dist/components/{clean-url.js → restHelpersGet.js} +392 -1
- package/dist/components/solution-configuration.js +552 -552
- package/dist/components/solution-store.js +2 -365
- package/dist/esm/basemap-gallery_7.entry.js +16 -0
- package/dist/esm/calcite-alert_3.entry.js +2 -13
- package/dist/esm/calcite-combobox_6.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/card-manager_3.entry.js +4 -3
- package/dist/esm/{downloadUtils-76379e4a.js → downloadUtils-d41ecba9.js} +53 -10
- package/dist/esm/{index.es-0d134a52.js → index.es-b226bf47.js} +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +4 -3
- package/dist/esm/{mapViewUtils-08f6cfce.js → mapViewUtils-1e2befd7.js} +5 -2
- package/dist/esm/public-notification.entry.js +6 -5
- package/dist/esm/{clean-url-bce022e6.js → restHelpersGet-a5ec2192.js} +392 -1
- package/dist/esm/solution-configuration.entry.js +552 -552
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-3ee6c7a3.js → solution-store-17bb0a75.js} +2 -365
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-9800e602.entry.js → p-091120c5.entry.js} +1 -1
- package/dist/solutions-components/p-1b14b687.entry.js +6 -0
- package/dist/solutions-components/p-20e627ed.entry.js +6 -0
- package/dist/solutions-components/{p-646e983f.entry.js → p-2d143359.entry.js} +1 -1
- package/dist/solutions-components/{p-ac7332b3.entry.js → p-40e95e2b.entry.js} +1 -1
- package/dist/solutions-components/p-420e1585.entry.js +36 -0
- package/dist/solutions-components/p-4807b2a1.js +36 -0
- package/dist/solutions-components/p-56a3b81e.entry.js +6 -0
- package/dist/solutions-components/p-5856dc4f.js +66 -0
- package/dist/solutions-components/p-89b4b401.js +145 -0
- package/dist/solutions-components/{p-0f50087e.entry.js → p-973625f8.entry.js} +2 -2
- package/dist/solutions-components/{p-03130804.js → p-9ecb5d66.js} +1 -1
- package/dist/solutions-components/{p-b02eb8f4.js → p-a8661f1f.js} +30 -30
- package/dist/solutions-components/p-fbc7fc26.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +62 -9
- package/dist/solutions-components/utils/queryUtils.ts +4 -2
- package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +4 -0
- package/dist/types/components/map-legend/map-legend.d.ts +4 -0
- package/dist/types/components/public-notification/public-notification.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/solutions-components/p-13b21d19.entry.js +0 -36
- package/dist/solutions-components/p-15070568.js +0 -36
- package/dist/solutions-components/p-1682bd0f.entry.js +0 -6
- package/dist/solutions-components/p-7b61f856.entry.js +0 -6
- package/dist/solutions-components/p-81a0c88f.entry.js +0 -6
- package/dist/solutions-components/p-d0544f24.js +0 -192
- package/dist/solutions-components/p-eba875d9.entry.js +0 -6
- package/dist/solutions-components/p-ecc95259.js +0 -20
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { c as createStore } from './index3.js';
|
|
7
7
|
import { f as EUpdateType } from './interfaces.js';
|
|
8
8
|
import { E as EFileType, j as jszip_min, S as SolutionTemplateFormatVersion } from './solution-resource.js';
|
|
9
|
-
import { c as cleanUrl, r as request } from './
|
|
9
|
+
import { c as cleanUrl, r as request, b as blobToFile, d as checkUrlPathTermination, f as getThumbnailFile, h as getItemDataAsJson, a as getProp, s as setCreateProp } from './restHelpersGet.js';
|
|
10
10
|
|
|
11
11
|
/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc.
|
|
12
12
|
* Apache-2.0 */
|
|
@@ -265,369 +265,6 @@ function removeItemResource(requestOptions) {
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
/** @license
|
|
269
|
-
* Copyright 2020 Esri
|
|
270
|
-
*
|
|
271
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
272
|
-
* you may not use this file except in compliance with the License.
|
|
273
|
-
* You may obtain a copy of the License at
|
|
274
|
-
*
|
|
275
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
276
|
-
*
|
|
277
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
278
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
279
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
280
|
-
* See the License for the specific language governing permissions and
|
|
281
|
-
* limitations under the License.
|
|
282
|
-
*/
|
|
283
|
-
/**
|
|
284
|
-
* Supplies the File constructor for Microsoft Legacy Edge.
|
|
285
|
-
*
|
|
286
|
-
* @param fileBits Contents for file
|
|
287
|
-
* @param fileName Name for file
|
|
288
|
-
* @param options Bucket of options, euch as `type` for the MIME type; defaults to empty string for `type`
|
|
289
|
-
* @returns File or, for Microsoft Legacy Edge, Blob
|
|
290
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/File/File
|
|
291
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
|
|
292
|
-
*/
|
|
293
|
-
function new_File(fileBits, fileName, options) {
|
|
294
|
-
let file;
|
|
295
|
-
try {
|
|
296
|
-
// Modern browser
|
|
297
|
-
file = new File(fileBits, fileName, options);
|
|
298
|
-
}
|
|
299
|
-
catch (error) {
|
|
300
|
-
// Microsoft Legacy Edge
|
|
301
|
-
/* istanbul ignore next */
|
|
302
|
-
file = (function () {
|
|
303
|
-
if (typeof options === "undefined") {
|
|
304
|
-
// Microsoft Legacy Edge fails in karma if options is not defined
|
|
305
|
-
options = {
|
|
306
|
-
type: ""
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
const blob = new Blob(fileBits, options);
|
|
310
|
-
blob.lastModified = new Date();
|
|
311
|
-
blob.name = fileName;
|
|
312
|
-
return blob;
|
|
313
|
-
})();
|
|
314
|
-
}
|
|
315
|
-
return file;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
/** @license
|
|
319
|
-
* Copyright 2018 Esri
|
|
320
|
-
*
|
|
321
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
322
|
-
* you may not use this file except in compliance with the License.
|
|
323
|
-
* You may obtain a copy of the License at
|
|
324
|
-
*
|
|
325
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
326
|
-
*
|
|
327
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
328
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
329
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
330
|
-
* See the License for the specific language governing permissions and
|
|
331
|
-
* limitations under the License.
|
|
332
|
-
*/
|
|
333
|
-
/**
|
|
334
|
-
* Extracts JSON from a Blob.
|
|
335
|
-
*
|
|
336
|
-
* @param blob Blob to use as source
|
|
337
|
-
* @returns A promise that will resolve with JSON or null
|
|
338
|
-
*/
|
|
339
|
-
function blobToJson(blob) {
|
|
340
|
-
return new Promise(resolve => {
|
|
341
|
-
blobToText(blob).then(blobContents => {
|
|
342
|
-
try {
|
|
343
|
-
resolve(JSON.parse(blobContents));
|
|
344
|
-
}
|
|
345
|
-
catch (err) {
|
|
346
|
-
resolve(null);
|
|
347
|
-
}
|
|
348
|
-
}, () => resolve(null));
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* Converts a Blob to a File.
|
|
353
|
-
*
|
|
354
|
-
* @param blob Blob to use as source
|
|
355
|
-
* @param filename Name to use for file
|
|
356
|
-
* @param mimeType MIME type to override blob's MIME type
|
|
357
|
-
* @returns File created out of Blob and filename
|
|
358
|
-
*/
|
|
359
|
-
function blobToFile(blob, filename, mimeType) {
|
|
360
|
-
return blob
|
|
361
|
-
? new_File([blob], filename ? filename : "", {
|
|
362
|
-
type: mimeType || blob.type
|
|
363
|
-
})
|
|
364
|
-
: null;
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Extracts text from a Blob.
|
|
368
|
-
*
|
|
369
|
-
* @param blob Blob to use as source
|
|
370
|
-
* @returns A promise that will resolve with text read from blob
|
|
371
|
-
*/
|
|
372
|
-
function blobToText(blob) {
|
|
373
|
-
return new Promise(resolve => {
|
|
374
|
-
const reader = new FileReader();
|
|
375
|
-
reader.onload = function (evt) {
|
|
376
|
-
// Disable needed because Node requires cast
|
|
377
|
-
// tslint:disable-next-line: no-unnecessary-type-assertion
|
|
378
|
-
const blobContents = evt.target.result;
|
|
379
|
-
resolve(blobContents ? blobContents : ""); // not handling ArrayContents variant
|
|
380
|
-
};
|
|
381
|
-
reader.readAsText(blob);
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Checks that a URL path ends with a slash.
|
|
386
|
-
*
|
|
387
|
-
* @param url URL to check
|
|
388
|
-
* @returns URL, appended with slash if missing
|
|
389
|
-
*/
|
|
390
|
-
function checkUrlPathTermination(url) {
|
|
391
|
-
return url ? (url.endsWith("/") ? url : url + "/") : url;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Gets a property out of a deeply nested object.
|
|
395
|
-
* Does not handle anything but nested object graph
|
|
396
|
-
*
|
|
397
|
-
* @param obj Object to retrieve value from
|
|
398
|
-
* @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
|
|
399
|
-
* in obj
|
|
400
|
-
* @returns Value at end of path
|
|
401
|
-
*/
|
|
402
|
-
function getProp(obj, path) {
|
|
403
|
-
return path.split(".").reduce(function (prev, curr) {
|
|
404
|
-
/* istanbul ignore next no need to test undefined scenario */
|
|
405
|
-
return prev ? prev[curr] : undefined;
|
|
406
|
-
}, obj);
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Sets a deeply nested property of an object.
|
|
410
|
-
* Creates the full path if it does not exist.
|
|
411
|
-
*
|
|
412
|
-
* @param obj Object to set value of
|
|
413
|
-
* @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property in obj
|
|
414
|
-
* @param value The value to set at the end of the path
|
|
415
|
-
*/
|
|
416
|
-
function setCreateProp(obj, path, value) {
|
|
417
|
-
const pathParts = path.split(".");
|
|
418
|
-
pathParts.reduce((a, b, c) => {
|
|
419
|
-
if (c === pathParts.length - 1) {
|
|
420
|
-
a[b] = value;
|
|
421
|
-
return value;
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
if (!a[b]) {
|
|
425
|
-
a[b] = {};
|
|
426
|
-
}
|
|
427
|
-
return a[b];
|
|
428
|
-
}
|
|
429
|
-
}, obj);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Gets a Blob from a web site.
|
|
434
|
-
*
|
|
435
|
-
* @param url Address of Blob
|
|
436
|
-
* @param authentication Credentials for the request
|
|
437
|
-
* @param requestOptions - Options for the request, including parameters relevant to the endpoint.
|
|
438
|
-
* @returns Promise that will resolve with Blob or an AGO-style JSON failure response
|
|
439
|
-
*/
|
|
440
|
-
function getBlob(url, authentication, requestOptions = {}) {
|
|
441
|
-
if (!url) {
|
|
442
|
-
return Promise.reject("Url must be provided");
|
|
443
|
-
}
|
|
444
|
-
const blobRequestOptions = {
|
|
445
|
-
authentication: authentication,
|
|
446
|
-
rawResponse: true,
|
|
447
|
-
...requestOptions
|
|
448
|
-
};
|
|
449
|
-
return request(url, blobRequestOptions).then(response => {
|
|
450
|
-
return response.blob();
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/** @license
|
|
455
|
-
* Copyright 2018 Esri
|
|
456
|
-
*
|
|
457
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
458
|
-
* you may not use this file except in compliance with the License.
|
|
459
|
-
* You may obtain a copy of the License at
|
|
460
|
-
*
|
|
461
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
462
|
-
*
|
|
463
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
464
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
465
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
466
|
-
* See the License for the specific language governing permissions and
|
|
467
|
-
* limitations under the License.
|
|
468
|
-
*/
|
|
469
|
-
// ------------------------------------------------------------------------------------------------------------------ //
|
|
470
|
-
const ZIP_FILE_HEADER_SIGNATURE = "PK";
|
|
471
|
-
/**
|
|
472
|
-
* Gets a Blob from a web site and casts it as a file using the supplied name.
|
|
473
|
-
*
|
|
474
|
-
* @param url Address of Blob
|
|
475
|
-
* @param filename Name to use for file
|
|
476
|
-
* @param authentication Credentials for the request
|
|
477
|
-
* @returns Promise that will resolve with a File, undefined if the Blob is null, or an AGO-style JSON failure response
|
|
478
|
-
*/
|
|
479
|
-
function getBlobAsFile(url, filename, authentication, ignoreErrors = [], mimeType) {
|
|
480
|
-
return new Promise((resolve, reject) => {
|
|
481
|
-
// Get the blob from the URL
|
|
482
|
-
getBlobCheckForError(url, authentication, ignoreErrors).then(blob => !blob ? resolve(null) : resolve(blobToFile(blob, filename, mimeType)), reject);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* Gets a Blob from a web site and checks for a JSON error packet in the Blob.
|
|
487
|
-
*
|
|
488
|
-
* @param url Address of Blob
|
|
489
|
-
* @param authentication Credentials for the request
|
|
490
|
-
* @param ignoreErrors List of HTTP error codes that should be ignored
|
|
491
|
-
* @returns Promise that will resolve with Blob or an AGO-REST JSON failure response
|
|
492
|
-
*/
|
|
493
|
-
function getBlobCheckForError(url, authentication, ignoreErrors = []) {
|
|
494
|
-
return new Promise((resolve, reject) => {
|
|
495
|
-
// Get the blob from the URL
|
|
496
|
-
getBlob(url, authentication).then(blob => {
|
|
497
|
-
// Reclassify text/plain blobs as needed
|
|
498
|
-
_fixTextBlobType(blob).then(adjustedBlob => {
|
|
499
|
-
if (adjustedBlob.type === "application/json") {
|
|
500
|
-
// Blob may be an error
|
|
501
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
502
|
-
blobToJson(adjustedBlob).then((json) => {
|
|
503
|
-
// Check for valid JSON with an error
|
|
504
|
-
if (json?.error) {
|
|
505
|
-
const code = json.error.code;
|
|
506
|
-
if (code !== undefined && ignoreErrors.indexOf(code) >= 0) {
|
|
507
|
-
resolve(null); // Error, but ignored
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
reject(json); // Other error; fail with error
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
resolve(adjustedBlob);
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
else {
|
|
519
|
-
resolve(adjustedBlob);
|
|
520
|
-
}
|
|
521
|
-
}, reject);
|
|
522
|
-
}, reject);
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* Gets the data information of an AGO item in its JSON form.
|
|
527
|
-
*
|
|
528
|
-
* @param itemId Id of an item whose data information is sought
|
|
529
|
-
* @param filename Name to use for file
|
|
530
|
-
* @param authentication Credentials for the request to AGO
|
|
531
|
-
* @returns Promise that will resolve with JSON, or an AGO-style JSON failure response
|
|
532
|
-
*/
|
|
533
|
-
function getItemDataAsJson(itemId, authentication) {
|
|
534
|
-
return new Promise(resolve => {
|
|
535
|
-
getItemDataBlob(itemId, authentication).then(blob => resolve(blobToJson(blob)), () => resolve(null));
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Gets the data information of an AGO item in its raw (Blob) form.
|
|
540
|
-
*
|
|
541
|
-
* @param itemId Id of an item whose data information is sought
|
|
542
|
-
* @param authentication Credentials for the request to AGO
|
|
543
|
-
* @returns A promise that will resolve with the data Blob or null if the item doesn't have a data section
|
|
544
|
-
*/
|
|
545
|
-
function getItemDataBlob(itemId, authentication) {
|
|
546
|
-
return new Promise(resolve => {
|
|
547
|
-
const url = getItemDataBlobUrl(itemId, authentication);
|
|
548
|
-
getBlobCheckForError(url, authentication, [400, 500]).then(blob => resolve(_fixTextBlobType(blob)), () => resolve(null));
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* Gets the URL to the data information of an AGO item in its raw (Blob) form.
|
|
553
|
-
*
|
|
554
|
-
* @param itemId Id of an item whose data information is sought
|
|
555
|
-
* @param authentication Credentials for the request to AGO
|
|
556
|
-
* @returns URL string
|
|
557
|
-
*/
|
|
558
|
-
function getItemDataBlobUrl(itemId, authentication) {
|
|
559
|
-
return `${getPortalSharingUrlFromAuth(authentication)}/content/items/${itemId}/data`;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Extracts the portal sharing url from a supplied authentication.
|
|
563
|
-
*
|
|
564
|
-
* @param authentication Credentials for the request to AGO
|
|
565
|
-
* @returns Portal sharing url to be used in API requests, defaulting to `https://www.arcgis.com/sharing/rest`
|
|
566
|
-
*/
|
|
567
|
-
function getPortalSharingUrlFromAuth(authentication) {
|
|
568
|
-
// If auth was passed, use that portal
|
|
569
|
-
return getProp(authentication, "portal") || "https://www.arcgis.com/sharing/rest";
|
|
570
|
-
}
|
|
571
|
-
function getThumbnailFile(url, filename, authentication) {
|
|
572
|
-
return new Promise(resolve => {
|
|
573
|
-
getBlobAsFile(url, filename, authentication, [500]).then(resolve, () => resolve(null));
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
// ------------------------------------------------------------------------------------------------------------------ //
|
|
577
|
-
/**
|
|
578
|
-
* Fixes the types of Blobs incorrectly typed as text/plain.
|
|
579
|
-
*
|
|
580
|
-
* @param blob Blob to check
|
|
581
|
-
* @returns Promise resolving to original Blob, unless it's originally typed as text/plain but is
|
|
582
|
-
* really JSON, ZIP, or XML
|
|
583
|
-
* @private
|
|
584
|
-
*/
|
|
585
|
-
function _fixTextBlobType(blob) {
|
|
586
|
-
return new Promise((resolve, reject) => {
|
|
587
|
-
if (blob &&
|
|
588
|
-
blob.size > 0 &&
|
|
589
|
-
(blob.type.startsWith("text/plain") ||
|
|
590
|
-
blob.type.startsWith("application/json"))) {
|
|
591
|
-
blobToText(blob).then(blobText => {
|
|
592
|
-
// Convertible to JSON?
|
|
593
|
-
try {
|
|
594
|
-
JSON.parse(blobText);
|
|
595
|
-
// Yes; reclassify as JSON
|
|
596
|
-
resolve(new Blob([blob], { type: "application/json" }));
|
|
597
|
-
}
|
|
598
|
-
catch (ignored) {
|
|
599
|
-
// Nope; test for ZIP file
|
|
600
|
-
if (blobText.length > 4 &&
|
|
601
|
-
blobText.substr(0, 4) === ZIP_FILE_HEADER_SIGNATURE) {
|
|
602
|
-
// Yes; reclassify as ZIP
|
|
603
|
-
resolve(new Blob([blob], { type: "application/zip" }));
|
|
604
|
-
}
|
|
605
|
-
else if (blobText.startsWith("<")) {
|
|
606
|
-
// Reclassify as XML; since the blob started out as text/plain, it's more likely that is
|
|
607
|
-
// meant to be human-readable, so we'll use text/xml instead of application/xml
|
|
608
|
-
resolve(new Blob([blob], { type: "text/xml" }));
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
// Leave as text
|
|
612
|
-
resolve(blob);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
},
|
|
616
|
-
// Faulty blob
|
|
617
|
-
reject);
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
// Empty or not typed as plain text, so simply return
|
|
621
|
-
if (blob) {
|
|
622
|
-
resolve(blob);
|
|
623
|
-
}
|
|
624
|
-
else {
|
|
625
|
-
reject();
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
|
|
631
268
|
/** @license
|
|
632
269
|
* Copyright 2018 Esri
|
|
633
270
|
*
|
|
@@ -1701,4 +1338,4 @@ class SolutionStore {
|
|
|
1701
1338
|
}
|
|
1702
1339
|
const state = SolutionStore.Store;
|
|
1703
1340
|
|
|
1704
|
-
export {
|
|
1341
|
+
export { state as s };
|
|
@@ -54,6 +54,14 @@ const BasemapGallery = class {
|
|
|
54
54
|
render() {
|
|
55
55
|
return (h(Host, null, h("div", { ref: (el) => { this._basemapElement = el; } })));
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
|
59
|
+
*/
|
|
60
|
+
async componentDidLoad() {
|
|
61
|
+
if (this.mapView) {
|
|
62
|
+
await this.mapViewWatchHandler();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
57
65
|
//--------------------------------------------------------------------------
|
|
58
66
|
//
|
|
59
67
|
// Functions (protected)
|
|
@@ -344,6 +352,14 @@ const MapLegend = class {
|
|
|
344
352
|
render() {
|
|
345
353
|
return (h(Host, null, h("div", { ref: (el) => { this._legendElement = el; } })));
|
|
346
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
|
357
|
+
*/
|
|
358
|
+
async componentDidLoad() {
|
|
359
|
+
if (this.mapView) {
|
|
360
|
+
await this.mapViewWatchHandler();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
347
363
|
//--------------------------------------------------------------------------
|
|
348
364
|
//
|
|
349
365
|
// Functions (protected)
|
|
@@ -14,7 +14,7 @@ import { g as getBreakpoints } from './responsive-4d7ef153.js';
|
|
|
14
14
|
import { c as createObserver } from './observers-115d1b4b.js';
|
|
15
15
|
import { l as loadModules } from './loadModules-687a30c5.js';
|
|
16
16
|
import { g as getLocaleComponentStrings } from './locale-6be4e8f0.js';
|
|
17
|
-
import { k as getAllLayers } from './mapViewUtils-
|
|
17
|
+
import { k as getAllLayers } from './mapViewUtils-1e2befd7.js';
|
|
18
18
|
import './guid-99d025c6.js';
|
|
19
19
|
import './resources-bb8600a6.js';
|
|
20
20
|
import './key-5ab69c42.js';
|
|
@@ -446,11 +446,7 @@ const EditCard = class {
|
|
|
446
446
|
const container = document.createElement("div");
|
|
447
447
|
const layers = await getAllLayers(this.mapView);
|
|
448
448
|
const layerInfos = layers.map(layer => {
|
|
449
|
-
return {
|
|
450
|
-
layer,
|
|
451
|
-
geometryUpdatesEnabled: false,
|
|
452
|
-
addEnabled: false
|
|
453
|
-
};
|
|
449
|
+
return { layer };
|
|
454
450
|
});
|
|
455
451
|
this._editor = new this.Editor({
|
|
456
452
|
allowedWorkflows: "update",
|
|
@@ -466,7 +462,6 @@ const EditCard = class {
|
|
|
466
462
|
this._editHandle.remove();
|
|
467
463
|
this._attachmentHandle.remove();
|
|
468
464
|
this._activeWorkflowHandle.remove();
|
|
469
|
-
this._addRelatedRecordHandle.remove();
|
|
470
465
|
}
|
|
471
466
|
this._attachmentHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "adding-attachment" ||
|
|
472
467
|
this._editor.viewModel.state === "editing-attachment" ||
|
|
@@ -486,12 +481,6 @@ const EditCard = class {
|
|
|
486
481
|
this._shouldClose = false;
|
|
487
482
|
}
|
|
488
483
|
});
|
|
489
|
-
// Temp workaround until a new prop is added at 4.29
|
|
490
|
-
this._addRelatedRecordHandle = this.reactiveUtils.when(() => !!this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks, () => {
|
|
491
|
-
this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks.addRelatedRecord = null;
|
|
492
|
-
}, {
|
|
493
|
-
once: true
|
|
494
|
-
});
|
|
495
484
|
// had issues with destroy before adding like this
|
|
496
485
|
this._editContainer.appendChild(container);
|
|
497
486
|
}
|
|
@@ -21,7 +21,7 @@ import { d as debounce } from './debounce-229b1a22.js';
|
|
|
21
21
|
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-94095778.js';
|
|
22
22
|
import { i as isActivationKey } from './key-5ab69c42.js';
|
|
23
23
|
import { g as getLocaleComponentStrings } from './locale-6be4e8f0.js';
|
|
24
|
-
import { l as getMapLayerHash, m as getMapTableHash } from './mapViewUtils-
|
|
24
|
+
import { l as getMapLayerHash, m as getMapTableHash } from './mapViewUtils-1e2befd7.js';
|
|
25
25
|
import { s as state } from './publicNotificationStore-f25d1e95.js';
|
|
26
26
|
import './resources-bb8600a6.js';
|
|
27
27
|
import './browser-b8a2c2d7.js';
|
|
@@ -19,7 +19,7 @@ import { d as dragActive, a as disconnectSortableComponent, c as connectSortable
|
|
|
19
19
|
import { C as CSS$3, S as SLOTS$3 } from './resources-4100c616.js';
|
|
20
20
|
import { I as ICON_TYPES$1 } from './resources-ee6e347f.js';
|
|
21
21
|
import { g as getLocaleComponentStrings } from './locale-6be4e8f0.js';
|
|
22
|
-
import { s as state } from './solution-store-
|
|
22
|
+
import { s as state } from './solution-store-17bb0a75.js';
|
|
23
23
|
import { d as EUpdateType } from './interfaces-7470d906.js';
|
|
24
24
|
import { E as EFileType } from './solution-resource-be35d35b.js';
|
|
25
25
|
import './key-5ab69c42.js';
|
|
@@ -29,7 +29,7 @@ import './resources-c8f83593.js';
|
|
|
29
29
|
import './debounce-229b1a22.js';
|
|
30
30
|
import './_commonjsHelpers-d5f9d613.js';
|
|
31
31
|
import './index-71d123d4.js';
|
|
32
|
-
import './
|
|
32
|
+
import './restHelpersGet-a5ec2192.js';
|
|
33
33
|
|
|
34
34
|
/*!
|
|
35
35
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-0740c914.js';
|
|
7
7
|
import { g as getLocaleComponentStrings } from './locale-6be4e8f0.js';
|
|
8
|
-
import { q as queryFeaturesByID, a as getLayerOrTable, g as goToSelection, b as queryAllIds } from './mapViewUtils-
|
|
8
|
+
import { q as queryFeaturesByID, a as getLayerOrTable, g as goToSelection, b as queryAllIds } from './mapViewUtils-1e2befd7.js';
|
|
9
9
|
import { l as loadModules } from './loadModules-687a30c5.js';
|
|
10
|
-
import { d as downloadCSV } from './downloadUtils-
|
|
10
|
+
import { d as downloadCSV } from './downloadUtils-d41ecba9.js';
|
|
11
11
|
import './_commonjsHelpers-d5f9d613.js';
|
|
12
12
|
import './interfaces-7470d906.js';
|
|
13
|
-
import './
|
|
13
|
+
import './solution-resource-be35d35b.js';
|
|
14
|
+
import './restHelpersGet-a5ec2192.js';
|
|
14
15
|
|
|
15
16
|
const cardManagerCss = ":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";
|
|
16
17
|
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-d5f9d613.js';
|
|
7
7
|
import { a as getAssetPath } from './index-0740c914.js';
|
|
8
8
|
import { l as loadModules } from './loadModules-687a30c5.js';
|
|
9
|
-
import { q as queryFeaturesByID } from './mapViewUtils-
|
|
10
|
-
import
|
|
9
|
+
import { q as queryFeaturesByID } from './mapViewUtils-1e2befd7.js';
|
|
10
|
+
import './solution-resource-be35d35b.js';
|
|
11
|
+
import { _ as __assign$1, r as request, c as cleanUrl, g as getJson } from './restHelpersGet-a5ec2192.js';
|
|
11
12
|
|
|
12
13
|
/** @license
|
|
13
14
|
* Copyright 2022 Esri
|
|
@@ -1506,7 +1507,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
|
|
|
1506
1507
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1507
1508
|
* ====================================================================
|
|
1508
1509
|
*/
|
|
1509
|
-
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-
|
|
1510
|
+
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-b226bf47.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},
|
|
1510
1511
|
/** ====================================================================
|
|
1511
1512
|
* @license
|
|
1512
1513
|
* jsPDF XMP metadata plugin
|
|
@@ -2742,13 +2743,55 @@ async function _getLabelFormat(webmap, layer, formatUsingLayerPopup) {
|
|
|
2742
2743
|
const labelFormatType = (_b = (_a = layer.popupTemplate) === null || _a === void 0 ? void 0 : _a.content[0]) === null || _b === void 0 ? void 0 : _b.type;
|
|
2743
2744
|
if (labelFormatType === "relationship") {
|
|
2744
2745
|
const relationshipId = layer.popupTemplate.content[0].relationshipId;
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
&&
|
|
2749
|
-
&&
|
|
2750
|
-
|
|
2751
|
-
|
|
2746
|
+
// Get related layer
|
|
2747
|
+
let webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
|
|
2748
|
+
webmapLayers = webmapLayers.filter((webmapLayer) => webmapLayer.type === "feature"
|
|
2749
|
+
&& webmapLayer.id !== layer.id
|
|
2750
|
+
&& webmapLayer.relationships
|
|
2751
|
+
&& webmapLayer.relationships.some(relationship => relationship.id === relationshipId));
|
|
2752
|
+
if (webmapLayers.length > 0) {
|
|
2753
|
+
labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
|
|
2754
|
+
labelFormatProps.relationshipId = relationshipId;
|
|
2755
|
+
}
|
|
2756
|
+
else {
|
|
2757
|
+
// Related layer info is not in webmap; get the label info from the related layer
|
|
2758
|
+
webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
|
|
2759
|
+
// Keep only feature layers and tables that have the type "feature" and whose layerId doesn't
|
|
2760
|
+
// match the one we entered this function with and who have a URL that we can query
|
|
2761
|
+
const relationshipCandidatePromises = [];
|
|
2762
|
+
webmapLayers = webmapLayers.filter((webmapLayer) => {
|
|
2763
|
+
if (webmapLayer.type === "feature" && webmapLayer.layerId != layer.layerId && webmapLayer.url) {
|
|
2764
|
+
// Query the feature layer/table for properties missing from the webmap version
|
|
2765
|
+
const webmapLayerUrl = webmapLayer.url + "/" + webmapLayer.layerId.toString();
|
|
2766
|
+
relationshipCandidatePromises.push(getJson(webmapLayerUrl /*, authentication*/));
|
|
2767
|
+
return true;
|
|
2768
|
+
}
|
|
2769
|
+
else {
|
|
2770
|
+
return false;
|
|
2771
|
+
}
|
|
2772
|
+
});
|
|
2773
|
+
// Of the queried feature layers/tables, find the one with the matching relationship id
|
|
2774
|
+
const relationshipCandidates = await Promise.all(relationshipCandidatePromises);
|
|
2775
|
+
let labelFormatPropsPromise;
|
|
2776
|
+
if (!relationshipCandidates.some((candidateLayer, i) => {
|
|
2777
|
+
if (candidateLayer.relationships
|
|
2778
|
+
&& candidateLayer.relationships.some(relationship => relationship.id === relationshipId)) {
|
|
2779
|
+
// Found the matching relationship; get the label format from it
|
|
2780
|
+
labelFormatPropsPromise = _getLabelFormat(webmap, webmapLayers[i], formatUsingLayerPopup);
|
|
2781
|
+
return true;
|
|
2782
|
+
}
|
|
2783
|
+
else {
|
|
2784
|
+
return false;
|
|
2785
|
+
}
|
|
2786
|
+
})) {
|
|
2787
|
+
// Fallback to all fields
|
|
2788
|
+
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
|
2789
|
+
}
|
|
2790
|
+
else {
|
|
2791
|
+
labelFormatProps = await labelFormatPropsPromise;
|
|
2792
|
+
labelFormatProps.relationshipId = relationshipId;
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2752
2795
|
}
|
|
2753
2796
|
else if (labelFormatType === "fields") {
|
|
2754
2797
|
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { a as commonjsGlobal, c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-d5f9d613.js';
|
|
7
|
-
import { _ as _typeof_1 } from './downloadUtils-
|
|
7
|
+
import { _ as _typeof_1 } from './downloadUtils-d41ecba9.js';
|
|
8
8
|
import './index-0740c914.js';
|
|
9
9
|
import './loadModules-687a30c5.js';
|
|
10
10
|
import './locale-6be4e8f0.js';
|
|
11
|
-
import './mapViewUtils-
|
|
11
|
+
import './mapViewUtils-1e2befd7.js';
|
|
12
12
|
import './interfaces-7470d906.js';
|
|
13
|
-
import './
|
|
13
|
+
import './solution-resource-be35d35b.js';
|
|
14
|
+
import './restHelpersGet-a5ec2192.js';
|
|
14
15
|
|
|
15
16
|
var check = function (it) {
|
|
16
17
|
return it && it.Math == Math && it;
|