@esri/solutions-components 5.1.0-next.100 → 5.1.0-next.102
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/cdn/24OJQL75.js +2 -0
- package/dist/cdn/2AXKBNIN.js +2 -0
- package/dist/cdn/{CEP54NLT.js → 2C4DK6YC.js} +1 -1
- package/dist/cdn/2HGZUNIC.js +2 -0
- package/dist/cdn/{E63XW5PH.js → 3NPBN2B4.js} +1 -1
- package/dist/cdn/{HHVIWWK2.js → 45UNI2VP.js} +2 -2
- package/dist/cdn/4SPIPOYO.js +2 -0
- package/dist/cdn/5LX6ROQC.js +384 -0
- package/dist/cdn/64ZLSOK3.js +2 -0
- package/dist/cdn/{MVYIHKFK.js → 66BZFR5Z.js} +1 -1
- package/dist/cdn/{ULTK7DMM.js → 6GOYDVLJ.js} +1 -1
- package/dist/cdn/{IVSYM7YY.js → 6UTDTBHM.js} +1 -1
- package/dist/cdn/{76APML4N.js → 76OYXG7R.js} +1 -1
- package/dist/cdn/{XKFPWKMX.js → 7EPZDMA2.js} +1 -1
- package/dist/cdn/{7SJP3QTP.js → 7SFTLJTV.js} +1 -1
- package/dist/cdn/7X5K32QE.js +2 -0
- package/dist/cdn/{AY6K2SJI.js → A2SX6EF7.js} +1 -1
- package/dist/cdn/{2MK34V3V.js → ADTHTFGI.js} +1 -1
- package/dist/cdn/{IEKNRCBC.js → AFMPPVMO.js} +1 -1
- package/dist/cdn/{TFZ2AK22.js → ANZVLZYR.js} +1 -1
- package/dist/cdn/{VG6ML5VK.js → AO3QYZNQ.js} +1 -1
- package/dist/cdn/AOTEIDXK.js +2 -0
- package/dist/cdn/{X23TE3BV.js → AYO5GP4M.js} +1 -1
- package/dist/cdn/{DHPZIFHE.js → B4EWPUMU.js} +1 -1
- package/dist/cdn/{74OJ22BW.js → BELRJU3A.js} +1 -1
- package/dist/cdn/{ZS6XB5WK.js → BYU5RVVM.js} +1 -1
- package/dist/cdn/{J3MAWMYQ.js → CNY6H6U2.js} +1 -1
- package/dist/cdn/{44R32SU3.js → CZZN3R4F.js} +1 -1
- package/dist/cdn/{ZYCAAXQF.js → DINEURA2.js} +1 -1
- package/dist/cdn/{W6E3DYEQ.js → EW4O5UX4.js} +1 -1
- package/dist/cdn/{E6YARJM2.js → G4OMMOS4.js} +1 -1
- package/dist/cdn/GKT3GU2L.js +2 -0
- package/dist/cdn/GU4QAZMD.js +2 -0
- package/dist/cdn/{7RFQ7MW2.js → IGIHPCRS.js} +1 -1
- package/dist/cdn/{CRFLICFH.js → IIOO4ABM.js} +1 -1
- package/dist/cdn/{V3YTRV33.js → JMVHSWQR.js} +1 -1
- package/dist/cdn/JPJ2PWRJ.js +2 -0
- package/dist/cdn/{2PM224B6.js → JUJ5KUGK.js} +1 -1
- package/dist/cdn/{UUPARGLA.js → LYNVZ7EL.js} +1 -1
- package/dist/cdn/{NBPM6OJQ.js → MSEGWVWC.js} +19 -19
- package/dist/cdn/{66NSOJUX.js → MT2QHKUQ.js} +1 -1
- package/dist/cdn/{DJFXVUF7.js → N3FJFS6W.js} +1 -1
- package/dist/cdn/{GSK7CUMC.js → NBJK6Z7L.js} +1 -1
- package/dist/cdn/{R3QHE3VT.js → O5PAINAH.js} +1 -1
- package/dist/cdn/O7TCCL6B.js +2 -0
- package/dist/cdn/P2QWXLFJ.js +2 -0
- package/dist/cdn/{Q6XLTRMA.js → P76UNULK.js} +1 -1
- package/dist/cdn/{OIRNHTN3.js → PCZFIXAY.js} +1 -1
- package/dist/cdn/{OG6IMWBH.js → PDE6N2YM.js} +1 -1
- package/dist/cdn/{U77O2MIG.js → PQPNCADS.js} +1 -1
- package/dist/cdn/{KH2WXNMT.js → RQIBNHBN.js} +1 -1
- package/dist/cdn/{4QJK4LPR.js → S7ZM2RFD.js} +1 -1
- package/dist/cdn/{HNVWONX2.js → SKUGEKDV.js} +1 -1
- package/dist/cdn/{2ASJ2RMU.js → SR53JCI4.js} +1 -1
- package/dist/cdn/{LOINOBXI.js → TDY54Z67.js} +1 -1
- package/dist/cdn/{2HLILJFJ.js → TS7GYVPR.js} +1 -1
- package/dist/cdn/{HM4YDFBC.js → TWO6FJHP.js} +1 -1
- package/dist/cdn/UUGWRXGN.js +2 -0
- package/dist/cdn/{Y3PCMVG7.js → UUMJMH3T.js} +1 -1
- package/dist/cdn/VB5C4Z27.js +2 -0
- package/dist/cdn/VK6ZOC6A.js +2 -0
- package/dist/cdn/WNH3PY6X.js +2 -0
- package/dist/cdn/{J75MHJID.js → WU7QCA5H.js} +1 -1
- package/dist/cdn/{VLBW4YNM.js → WZ22NICV.js} +1 -1
- package/dist/cdn/{DQWJUYMM.js → XF533XOH.js} +1 -1
- package/dist/cdn/{YOAGUXW6.js → XKMN6N5I.js} +1 -1
- package/dist/cdn/{QZRJRLYA.js → XMHHBXM6.js} +1 -1
- package/dist/cdn/{RG2D7ZRS.js → Y2ROEEOX.js} +2 -2
- package/dist/cdn/{D5FLGJ5G.js → YXJJ5QPI.js} +1 -1
- package/dist/cdn/{3RJKHADA.js → ZPOWEU76.js} +1 -1
- package/dist/cdn/{6ENQ42XY.js → ZT5TOVYM.js} +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/CardsFetcher.js +287 -0
- package/dist/chunks/cardFetchingUtils.js +22 -304
- package/dist/chunks/cardsHelpers.js +6 -6
- package/dist/chunks/converter.js +72 -28
- package/dist/chunks/downloadUtils.js +246 -235
- package/dist/chunks/helpers.js +38 -43
- package/dist/chunks/interfaces.js +1 -1
- package/dist/chunks/popupUtils.js +2 -2
- package/dist/chunks/queryUtils.js +3 -3
- package/dist/chunks/solutions-deploy-app-nav.js +1 -1
- package/dist/components/arcgis-solutions-assistant/customElement.d.ts +2 -0
- package/dist/components/arcgis-solutions-assistant/customElement.js +9725 -8601
- package/dist/components/buffer-tools/customElement.d.ts +4 -3
- package/dist/components/card-manager/customElement.d.ts +4 -3
- package/dist/components/consent-manager/customElement.d.ts +2 -2
- package/dist/components/create-feature/customElement.d.ts +2 -2
- package/dist/components/create-feature/customElement.js +13 -13
- package/dist/components/create-related-feature/customElement.d.ts +6 -4
- package/dist/components/create-related-feature/customElement.js +2 -2
- package/dist/components/crowdsource-reporter/customElement.d.ts +2 -2
- package/dist/components/crowdsource-reporter/customElement.js +4 -4
- package/dist/components/delete-button/customElement.d.ts +2 -2
- package/dist/components/delete-dialog/customElement.d.ts +2 -2
- package/dist/components/edit-card/customElement.d.ts +7 -5
- package/dist/components/edit-card/customElement.js +2 -2
- package/dist/components/feature-details/customElement.d.ts +7 -6
- package/dist/components/feature-details/customElement.js +2 -2
- package/dist/components/feature-list/customElement.d.ts +4 -3
- package/dist/components/feature-list/customElement.js +3 -3
- package/dist/components/field-selection/customElement.d.ts +6 -4
- package/dist/components/info-card/customElement.d.ts +6 -5
- package/dist/components/info-card/customElement.js +2 -2
- package/dist/components/layer-list/customElement.d.ts +2 -2
- package/dist/components/layer-list/customElement.js +2 -2
- package/dist/components/layer-list-widget/customElement.d.ts +4 -3
- package/dist/components/layer-list-widget/customElement.js +1 -1
- package/dist/components/layer-table/customElement.d.ts +4 -3
- package/dist/components/layer-table/customElement.js +5 -5
- package/dist/components/map-basemap-gallery/customElement.d.ts +4 -3
- package/dist/components/map-basemap-gallery/customElement.js +2 -2
- package/dist/components/map-card/customElement.d.ts +7 -5
- package/dist/components/map-card/customElement.js +4 -4
- package/dist/components/map-draw-tools/customElement.d.ts +10 -6
- package/dist/components/map-draw-tools/customElement.js +3 -3
- package/dist/components/map-floor-filter/customElement.d.ts +4 -3
- package/dist/components/map-floor-filter/customElement.js +2 -2
- package/dist/components/map-fullscreen/customElement.d.ts +4 -3
- package/dist/components/map-fullscreen/customElement.js +2 -2
- package/dist/components/map-layer-picker/customElement.d.ts +2 -2
- package/dist/components/map-legend/customElement.d.ts +4 -3
- package/dist/components/map-legend/customElement.js +1 -1
- package/dist/components/map-search/customElement.d.ts +4 -3
- package/dist/components/map-search/customElement.js +2 -2
- package/dist/components/map-select-tools/customElement.d.ts +13 -8
- package/dist/components/map-select-tools/customElement.js +5 -5
- package/dist/components/map-tools/customElement.d.ts +6 -4
- package/dist/components/map-tools/customElement.js +2 -2
- package/dist/components/pdf-download/customElement.d.ts +3 -3
- package/dist/components/public-notification/customElement.d.ts +10 -6
- package/dist/components/public-notification/customElement.js +154 -70
- package/dist/components/refine-selection/customElement.d.ts +15 -9
- package/dist/components/refine-selection/customElement.js +2 -2
- package/dist/components/selection-tool/customElement.d.ts +2 -2
- package/dist/components/selection-tool/customElement.js +2 -2
- package/dist/components/solution-builder-assistant/customElement.js +57 -57
- package/dist/components/solution-configure-titles/customElement.js +1 -1
- package/dist/components/solution-delete-dialog/customElement.js +1 -1
- package/dist/components/solution-deployed-card-panel/customElement.d.ts +2 -0
- package/dist/components/solution-deployed-card-panel/customElement.js +51 -39
- package/dist/components/solution-details-card/customElement.js +26 -26
- package/dist/components/solution-details-panel/customElement.js +67 -63
- package/dist/components/solution-item-accordion/customElement.js +7 -8
- package/dist/components/solution-resource-card/customElement.js +1 -1
- package/dist/components/solution-snapshot-gallery/customElement.js +1 -1
- package/dist/components/solution-social-share/customElement.js +2 -2
- package/dist/components/solutions-all-panel/customElement.js +6 -5
- package/dist/components/solutions-deploy-app/customElement.js +3 -2
- package/dist/components/solutions-deployed-list/customElement.d.ts +10 -6
- package/dist/components/solutions-deployed-list/customElement.js +40 -18
- package/dist/components/solutions-deployed-list/index.js +2 -0
- package/dist/components/solutions-deployed-panel/customElement.js +8 -7
- package/dist/components/solutions-deployed-shell/customElement.js +1 -1
- package/dist/components/solutions-filter-panel/customElement.js +1 -1
- package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +3 -3
- package/dist/solutions-components_commit.txt +7 -7
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/dist/utils/Auth.d.ts +2 -2
- package/dist/utils/interfaces.d.ts +27 -27
- package/package.json +1 -1
- package/dist/cdn/2R3HJ764.js +0 -2
- package/dist/cdn/5AGYVY7S.js +0 -2
- package/dist/cdn/AWQQ3CNF.js +0 -2
- package/dist/cdn/C47FRSF6.js +0 -2
- package/dist/cdn/C6KN2U7N.js +0 -2
- package/dist/cdn/DOK6WZN3.js +0 -2
- package/dist/cdn/DRXERUDE.js +0 -2
- package/dist/cdn/ESBPGZRY.js +0 -2
- package/dist/cdn/J6LCEXM3.js +0 -2
- package/dist/cdn/J6MVIDTT.js +0 -2
- package/dist/cdn/JSJWGKKI.js +0 -2
- package/dist/cdn/LEBQMVF6.js +0 -2
- package/dist/cdn/MVJVKXZM.js +0 -2
- package/dist/cdn/MZXEOLNG.js +0 -2
- package/dist/cdn/NM7MKM5L.js +0 -2
- package/dist/cdn/TSEG3YWM.js +0 -359
- /package/dist/cdn/{HMKJYAVE.js → 2KSTM3IP.js} +0 -0
- /package/dist/cdn/{J5FYHTE4.js → 6S56JAXB.js} +0 -0
- /package/dist/cdn/{6WQK4DHL.js → 7JOL6EOJ.js} +0 -0
- /package/dist/cdn/{ZDLTST3A.js → FB2RD4BK.js} +0 -0
- /package/dist/cdn/{3JGLETSR.js → IRQKL5IM.js} +0 -0
- /package/dist/cdn/{34EUIYLN.js → ITM5SR7G.js} +0 -0
- /package/dist/cdn/{6MP2RVUK.js → SITXFSGP.js} +0 -0
- /package/dist/cdn/{QAMVNRII.js → W5VSVSIV.js} +0 -0
- /package/dist/cdn/{YVNP437O.js → WV7QX3ED.js} +0 -0
- /package/dist/cdn/{6IIMJC5D.js → XMLWS6XC.js} +0 -0
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { jsPDF as
|
|
3
|
-
import { g as
|
|
4
|
-
import { a as
|
|
5
|
-
import { Sanitizer as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
function
|
|
2
|
+
import { jsPDF as k } from "jspdf";
|
|
3
|
+
import { g as G } from "./runtime.js";
|
|
4
|
+
import { a as W } from "./queryUtils.js";
|
|
5
|
+
import { Sanitizer as $ } from "@esri/arcgis-html-sanitizer";
|
|
6
|
+
import * as I from "@esri/solution-common";
|
|
7
|
+
import * as S from "@arcgis/core/arcade.js";
|
|
8
|
+
import * as j from "@arcgis/core/intl.js";
|
|
9
|
+
function H(s, t) {
|
|
10
10
|
const e = document.createElement("a");
|
|
11
11
|
e.download !== void 0 && (e.href = URL.createObjectURL(new Blob([decodeURIComponent("%ef%bb%bf"), t.join("")], { type: "text/csv;charset=utf-8;" })), e.download = `${s}.csv` || "export.csv", e.style.visibility = "hidden", document.body.appendChild(e), e.click(), document.body.removeChild(e));
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function B(s, t) {
|
|
14
14
|
const e = t.map(
|
|
15
15
|
(i) => Object.values(i).map((o) => `"${o}"`).join(",") + `\r
|
|
16
16
|
`
|
|
17
17
|
);
|
|
18
|
-
|
|
18
|
+
H(s, e);
|
|
19
19
|
}
|
|
20
|
-
var
|
|
20
|
+
var y;
|
|
21
21
|
(function(s) {
|
|
22
22
|
s.A4 = "A4", s.ANSI_A = "ANSI A";
|
|
23
|
-
})(
|
|
24
|
-
class
|
|
23
|
+
})(y || (y = {}));
|
|
24
|
+
class D {
|
|
25
25
|
// Properties are public for testing purposes
|
|
26
26
|
dataPath = "";
|
|
27
27
|
lang = "en";
|
|
@@ -50,7 +50,7 @@ class v {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
pageOptions = {
|
|
53
|
-
pageType:
|
|
53
|
+
pageType: y.ANSI_A,
|
|
54
54
|
width: 8.5,
|
|
55
55
|
height: 11,
|
|
56
56
|
leftMargin: 0.25,
|
|
@@ -101,13 +101,13 @@ class v {
|
|
|
101
101
|
* @class PDFCreator
|
|
102
102
|
*/
|
|
103
103
|
static getPageSize(t) {
|
|
104
|
-
switch (typeof t == "string" && (t = t ===
|
|
105
|
-
case
|
|
104
|
+
switch (typeof t == "string" && (t = t === y.A4 ? y.A4 : y.ANSI_A), t) {
|
|
105
|
+
case y.A4:
|
|
106
106
|
return {
|
|
107
107
|
width: 8.25,
|
|
108
108
|
height: 11.708333
|
|
109
109
|
};
|
|
110
|
-
case
|
|
110
|
+
case y.ANSI_A:
|
|
111
111
|
return {
|
|
112
112
|
width: 8.5,
|
|
113
113
|
height: 11
|
|
@@ -273,13 +273,13 @@ class v {
|
|
|
273
273
|
/**
|
|
274
274
|
* @class PDFCreator
|
|
275
275
|
*/
|
|
276
|
-
async initialize(t = {}, e = "", i = "en", o = "",
|
|
276
|
+
async initialize(t = {}, e = "", i = "en", o = "", n = !1) {
|
|
277
277
|
if (JSON.stringify(t) !== "{}") {
|
|
278
|
-
this.pageOptions.pageType = t.pageType ===
|
|
279
|
-
const
|
|
280
|
-
this.pageOptions.width =
|
|
278
|
+
this.pageOptions.pageType = t.pageType === y.A4 ? y.A4 : y.ANSI_A;
|
|
279
|
+
const r = D.getPageSize(this.pageOptions.pageType);
|
|
280
|
+
this.pageOptions.width = r.width, this.pageOptions.height = r.height, this.pageOptions.leftMargin = t.leftMargin ?? this.pageOptions.leftMargin, this.pageOptions.rightMargin = t.rightMargin ?? this.pageOptions.rightMargin, this.pageOptions.topMargin = t.topMargin ?? this.pageOptions.topMargin, this.pageOptions.bottomMargin = t.bottomMargin ?? this.pageOptions.bottomMargin;
|
|
281
281
|
}
|
|
282
|
-
return this.dataPath = e, this.lang = i, this.title = o || "PDF Document", this.pageOptions.drawNeatline =
|
|
282
|
+
return this.dataPath = e, this.lang = i, this.title = o || "PDF Document", this.pageOptions.drawNeatline = n, Promise.resolve();
|
|
283
283
|
}
|
|
284
284
|
/**
|
|
285
285
|
* @class PDFCreator
|
|
@@ -327,7 +327,7 @@ class v {
|
|
|
327
327
|
this.lineOptions.lineProperties.thickness !== t.thickness && this.setLineWidth(t.thickness), (this.lineOptions.lineProperties.color !== t.color || this.lineOptions.lineProperties.opacity !== t.opacity) && this.setDrawColor(t.color, t.opacity), this.lineOptions.lineProperties = t;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
class
|
|
330
|
+
class J extends D {
|
|
331
331
|
jsDoc;
|
|
332
332
|
constructor(t = null) {
|
|
333
333
|
super(), this.jsDoc = t;
|
|
@@ -414,8 +414,8 @@ class H extends v {
|
|
|
414
414
|
super.drawText(t, e);
|
|
415
415
|
let i = this.pageOptions.leftMargin + this.textOptions.left;
|
|
416
416
|
if (this.lang === "ar" || this.lang === "he") {
|
|
417
|
-
const
|
|
418
|
-
i = this.pageOptions.width - this.pageOptions.leftMargin -
|
|
417
|
+
const n = this.jsDoc.context2d.measureText(t).width * this.fontProps.fontResolutionInchesPerPoint;
|
|
418
|
+
i = this.pageOptions.width - this.pageOptions.leftMargin - n - this.textOptions.left;
|
|
419
419
|
}
|
|
420
420
|
const o = this.pageOptions.topMargin + this.textOptions.top + this.fontAscenderBaselineHeight(this.textOptions.fontPoints);
|
|
421
421
|
this.jsDoc.text(t, i, o);
|
|
@@ -435,9 +435,9 @@ class H extends v {
|
|
|
435
435
|
/**
|
|
436
436
|
* @class PDFCreator_jsPDF
|
|
437
437
|
*/
|
|
438
|
-
async initialize(t = {}, e = "", i = "en", o = "",
|
|
439
|
-
await super.initialize(t, e, i, o,
|
|
440
|
-
format: t.pageType ===
|
|
438
|
+
async initialize(t = {}, e = "", i = "en", o = "", n = !1) {
|
|
439
|
+
await super.initialize(t, e, i, o, n), this.jsDoc || (this.jsDoc = new k({
|
|
440
|
+
format: t.pageType === y.A4 ? "a4" : "letter",
|
|
441
441
|
orientation: "portrait",
|
|
442
442
|
putOnlyUsedFonts: !0,
|
|
443
443
|
unit: "in"
|
|
@@ -494,7 +494,7 @@ class H extends v {
|
|
|
494
494
|
this.jsDoc.setLineWidth(t);
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function V(s, t = {
|
|
498
498
|
numAcross: 1,
|
|
499
499
|
numDown: 1,
|
|
500
500
|
x0: 0,
|
|
@@ -520,7 +520,7 @@ function B(s, t = {
|
|
|
520
520
|
lineProperties: t.lineProperties
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
|
-
class
|
|
523
|
+
class U {
|
|
524
524
|
// Properties are public for testing purposes
|
|
525
525
|
PDFCreator;
|
|
526
526
|
labelFormats;
|
|
@@ -537,38 +537,38 @@ class J {
|
|
|
537
537
|
*
|
|
538
538
|
* @class PDFLabels
|
|
539
539
|
*/
|
|
540
|
-
addLabelsToDoc(t, e, i, o,
|
|
541
|
-
return new Promise((
|
|
542
|
-
const
|
|
543
|
-
let l, a, c,
|
|
540
|
+
addLabelsToDoc(t, e, i, o, n) {
|
|
541
|
+
return new Promise((r) => {
|
|
542
|
+
const g = e.numLabelsAcross * e.numLabelsDown;
|
|
543
|
+
let l, a, c, p;
|
|
544
544
|
const f = e.labelWidth - 2 * e.labelPadding;
|
|
545
|
-
let
|
|
546
|
-
const
|
|
545
|
+
let w = i;
|
|
546
|
+
const b = e.pageProperties.topMargin - this.PDFCreator.pageOptions.topMargin;
|
|
547
547
|
o && this.drawSupplementalText(o, 0, -0.1);
|
|
548
|
-
for (let
|
|
549
|
-
|
|
550
|
-
let
|
|
551
|
-
if (
|
|
548
|
+
for (let O = 0, d = 0; O < t.length; O++) {
|
|
549
|
+
n && n(Math.round(O / t.length * 100));
|
|
550
|
+
let h = t[O].map((F) => F.trim()).filter((F) => F.length > 0);
|
|
551
|
+
if (h.length === 0)
|
|
552
552
|
continue;
|
|
553
|
-
|
|
554
|
-
const
|
|
553
|
+
d % g === 0 ? (d > 0 && (this.PDFCreator.addPage(), ++w, o && this.drawSupplementalText(o, 0, -0.1)), l = 0, c = 0, a = 0) : d % e.numLabelsDown === 0 && (c = ++l * (e.labelWidth + e.horizGapIn), a = 0);
|
|
554
|
+
const P = 4;
|
|
555
555
|
let u = e.fontSizePx;
|
|
556
|
-
e.maxNumLabelLines <
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
this.PDFCreator.drawText(
|
|
556
|
+
e.maxNumLabelLines < h.length && (u = Math.max(Math.floor(e.maxNumLabelLines / h.length * e.fontSizePx), P)), u = this._getFontSizeForOverlongLines(h, f, u, P), h = this._clipOverlongLines(h, f, u);
|
|
557
|
+
const m = this.PDFCreator.fontAscenderDescenderHeight(u);
|
|
558
|
+
p = b + a++ * (e.labelHeight + e.vertGapIn), h.forEach((F) => {
|
|
559
|
+
this.PDFCreator.drawText(F, {
|
|
560
560
|
left: c + e.labelPadding,
|
|
561
|
-
top:
|
|
561
|
+
top: p + e.labelPadding,
|
|
562
562
|
fontPoints: u,
|
|
563
563
|
fontColor: "000000"
|
|
564
|
-
}),
|
|
565
|
-
}), ++
|
|
564
|
+
}), p += m;
|
|
565
|
+
}), ++d;
|
|
566
566
|
}
|
|
567
|
-
|
|
567
|
+
n && n(100), r(w);
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
570
|
drawLabelGuidelines(t, e = null) {
|
|
571
|
-
e !== null &&
|
|
571
|
+
e !== null && V(this.PDFCreator, {
|
|
572
572
|
// Margins in the page spec are absolute but we draw in within the margins
|
|
573
573
|
x0: t.pageProperties.leftMargin - this.PDFCreator.pageOptions.leftMargin,
|
|
574
574
|
y0: t.pageProperties.topMargin - this.PDFCreator.pageOptions.topMargin,
|
|
@@ -640,8 +640,8 @@ class J {
|
|
|
640
640
|
* @class PDFLabels
|
|
641
641
|
*/
|
|
642
642
|
removeDuplicates(t) {
|
|
643
|
-
const i = t.filter((
|
|
644
|
-
return i.forEach((
|
|
643
|
+
const i = t.filter((r) => Array.isArray(r) && r.length > 0).map((r) => r.map((g) => g.trim()).join("?")), o = {};
|
|
644
|
+
return i.forEach((r) => o[r] = !0), Object.keys(o).sort().map((r) => r.split("?"));
|
|
645
645
|
}
|
|
646
646
|
//-- Private methods -----------------------------------------------------------------------------------------------//
|
|
647
647
|
/**
|
|
@@ -657,8 +657,8 @@ class J {
|
|
|
657
657
|
* @class PDFLabels
|
|
658
658
|
* @private
|
|
659
659
|
*/
|
|
660
|
-
_calculateLabelFirstLineBase(t, e, i, o,
|
|
661
|
-
return t + e / 2 + (2 - i) / 2 * o + (1 - i) / 2 *
|
|
660
|
+
_calculateLabelFirstLineBase(t, e, i, o, n) {
|
|
661
|
+
return t + e / 2 + (2 - i) / 2 * o + (1 - i) / 2 * n;
|
|
662
662
|
}
|
|
663
663
|
/**
|
|
664
664
|
* Trims a set of text lines to fit within specified bounds.
|
|
@@ -673,14 +673,14 @@ class J {
|
|
|
673
673
|
*/
|
|
674
674
|
_clipOverlongLines(t, e, i) {
|
|
675
675
|
const o = [];
|
|
676
|
-
return t.forEach((
|
|
677
|
-
if (
|
|
676
|
+
return t.forEach((n) => {
|
|
677
|
+
if (n = n.trim(), this.PDFCreator.getTextWidth(n, i) > e) {
|
|
678
678
|
do
|
|
679
|
-
|
|
680
|
-
while (this.PDFCreator.getTextWidth(
|
|
681
|
-
|
|
679
|
+
n = n.slice(0, -1);
|
|
680
|
+
while (this.PDFCreator.getTextWidth(n, i) > e);
|
|
681
|
+
n += "...";
|
|
682
682
|
}
|
|
683
|
-
o.push(
|
|
683
|
+
o.push(n);
|
|
684
684
|
}), o;
|
|
685
685
|
}
|
|
686
686
|
/**
|
|
@@ -697,13 +697,13 @@ class J {
|
|
|
697
697
|
* @private
|
|
698
698
|
*/
|
|
699
699
|
_getFontSizeForOverlongLines(t, e, i, o) {
|
|
700
|
-
let
|
|
701
|
-
return t.forEach((
|
|
702
|
-
if (
|
|
700
|
+
let n = i;
|
|
701
|
+
return t.forEach((r) => {
|
|
702
|
+
if (r = r.trim(), this.PDFCreator.getTextWidth(r, n) > e)
|
|
703
703
|
do
|
|
704
|
-
--
|
|
705
|
-
while (this.PDFCreator.getTextWidth(
|
|
706
|
-
}),
|
|
704
|
+
--n;
|
|
705
|
+
while (this.PDFCreator.getTextWidth(r, n) > e && n > o);
|
|
706
|
+
}), n;
|
|
707
707
|
}
|
|
708
708
|
/**
|
|
709
709
|
* Loads the label formats.
|
|
@@ -718,84 +718,95 @@ class J {
|
|
|
718
718
|
return await (await fetch(t + "labelFormats.json")).json();
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
function
|
|
722
|
-
|
|
721
|
+
function q(s, t, e, i = "", o = "") {
|
|
722
|
+
X(s, t, e, i, o);
|
|
723
723
|
}
|
|
724
|
-
async function
|
|
725
|
-
const
|
|
726
|
-
await
|
|
724
|
+
async function X(s, t, e, i = "", o = "") {
|
|
725
|
+
const n = new J(void 0);
|
|
726
|
+
await n.initialize(
|
|
727
727
|
{
|
|
728
728
|
pageType: "ANSI_A"
|
|
729
729
|
},
|
|
730
|
-
|
|
730
|
+
G("assets/arcgis-pdf-creator/"),
|
|
731
731
|
"en",
|
|
732
732
|
s
|
|
733
733
|
// filename without ".pdf"
|
|
734
734
|
);
|
|
735
|
-
const
|
|
736
|
-
await
|
|
737
|
-
const
|
|
735
|
+
const r = new U();
|
|
736
|
+
await r.initialize(n);
|
|
737
|
+
const g = e.labelSpec;
|
|
738
738
|
let l = 1;
|
|
739
739
|
if (o) {
|
|
740
|
-
const a =
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
740
|
+
const a = g.pageProperties, c = D.getPageSize(a.pageType || ""), p = 0.25, f = i ? 0.25 : 0, w = p, b = p + f, O = c.width - 2 * p, d = c.height - 2 * p - f, h = await Y(o);
|
|
741
|
+
let P = w, u = b, m = O, F = d;
|
|
742
|
+
if (h && h.width > 0 && h.height > 0 && O > 0 && d > 0) {
|
|
743
|
+
const L = h.width / h.height, z = O / d;
|
|
744
|
+
L > z ? (m = O, F = O / L, u = b + (d - F) / 2) : (F = d, m = d * L, P = w + (O - m) / 2);
|
|
745
|
+
}
|
|
746
|
+
n.drawImage(o, {
|
|
747
|
+
x: P,
|
|
748
|
+
y: u,
|
|
749
|
+
width: m,
|
|
750
|
+
height: F
|
|
751
|
+
}), i && r.drawSupplementalText(i, 0, -0.1), t.length > 0 && (n.addPage(), ++l);
|
|
747
752
|
}
|
|
748
|
-
await
|
|
753
|
+
await r.addLabelsToDoc(
|
|
749
754
|
t,
|
|
750
|
-
|
|
755
|
+
g,
|
|
751
756
|
l,
|
|
752
757
|
i
|
|
753
758
|
// heading
|
|
754
|
-
),
|
|
759
|
+
), n.save();
|
|
760
|
+
}
|
|
761
|
+
async function Y(s) {
|
|
762
|
+
return new Promise((t) => {
|
|
763
|
+
const e = new Image();
|
|
764
|
+
e.onload = () => t({ width: e.naturalWidth, height: e.naturalHeight }), e.onerror = () => t(null), e.src = s;
|
|
765
|
+
});
|
|
755
766
|
}
|
|
756
767
|
const x = "|";
|
|
757
|
-
async function
|
|
768
|
+
async function M(s, t, e = !0, i = !1, o = !1, n = void 0, r = !1, g = !1) {
|
|
758
769
|
const l = [];
|
|
759
770
|
return Object.keys(t).forEach((c) => {
|
|
760
|
-
const
|
|
771
|
+
const p = t[c], f = p.layerView?.layer || p.layer;
|
|
761
772
|
f && l.push(
|
|
762
|
-
|
|
773
|
+
nt(s, f, p.ids, e, i, n, r, g)
|
|
763
774
|
), o && l.push(Promise.resolve([[c]]));
|
|
764
|
-
}), (await Promise.all(l)).reduce((c,
|
|
775
|
+
}), (await Promise.all(l)).reduce((c, p) => c.concat(p), []);
|
|
765
776
|
}
|
|
766
|
-
async function
|
|
767
|
-
let l = await
|
|
768
|
-
l = i ?
|
|
777
|
+
async function dt(s, t, e, i = !1, o = !1, n = void 0, r = !1, g = !1) {
|
|
778
|
+
let l = await M(s, t, e, o, !0, n, r, g);
|
|
779
|
+
l = i ? N(l) : l;
|
|
769
780
|
const a = Object.keys(t);
|
|
770
781
|
let c = [];
|
|
771
|
-
return l.forEach((
|
|
772
|
-
const f =
|
|
782
|
+
return l.forEach((p) => {
|
|
783
|
+
const f = p[0];
|
|
773
784
|
if (a.indexOf(f) < 0)
|
|
774
|
-
c.push(
|
|
785
|
+
c.push(p);
|
|
775
786
|
else {
|
|
776
|
-
const
|
|
777
|
-
|
|
787
|
+
const w = _(t, new RegExp(`\\b${f}\\b`));
|
|
788
|
+
B(E(w), c), c = [];
|
|
778
789
|
}
|
|
779
790
|
}), Promise.resolve();
|
|
780
791
|
}
|
|
781
|
-
async function
|
|
782
|
-
let
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
const l = o ||
|
|
787
|
-
return
|
|
792
|
+
async function gt(s, t, e, i = !1, o = "", n = "") {
|
|
793
|
+
let r = await M(s, t);
|
|
794
|
+
const g = _(t);
|
|
795
|
+
r = // Remove empty lines in labels
|
|
796
|
+
r.map((a) => a.filter((c) => c.length > 0)).filter((a) => a.length > 0), r = i ? N(r) : r;
|
|
797
|
+
const l = o || E(g);
|
|
798
|
+
return q(l, r, e, o, n), Promise.resolve();
|
|
788
799
|
}
|
|
789
|
-
function
|
|
800
|
+
function N(s) {
|
|
790
801
|
const t = s.map((i) => JSON.stringify(i)), e = new Set(t);
|
|
791
802
|
return Array.from(e, (i) => JSON.parse(i));
|
|
792
803
|
}
|
|
793
|
-
function
|
|
794
|
-
for (s = s.replace(/<br\s*\/?>/gi, x), s = s.replace(/<p[^>]*>/gi, x).trim().replace(/^\|/, ""), s = s.replace(/<\/p>/gi, ""), s = s.replace(/\n/gi, "|"), s = new
|
|
804
|
+
function A(s) {
|
|
805
|
+
for (s = s.replace(/<br\s*\/?>/gi, x), s = s.replace(/<p[^>]*>/gi, x).trim().replace(/^\|/, ""), s = s.replace(/<\/p>/gi, ""), s = s.replace(/\n/gi, "|"), s = new $().sanitize(s), s = s.replace(/<[\s.]*[^<>]*\/?>/gi, "").replace(/\xA0/gi, " ").replace(/ /gi, " "), s = s.replace(/\s*\|\s*/g, "|"); s.match(/\|\|/); )
|
|
795
806
|
s = s.replace(/\|\|/, "|");
|
|
796
807
|
return s = s.replace(/^\|/, ""), s = s.replace(/\|$/, ""), s;
|
|
797
808
|
}
|
|
798
|
-
function
|
|
809
|
+
function v(s, t = !1) {
|
|
799
810
|
const e = [];
|
|
800
811
|
return s.forEach((i) => {
|
|
801
812
|
(i.visible || t) && e.push(`{${i.fieldName}}`);
|
|
@@ -804,13 +815,13 @@ function D(s, t = !1) {
|
|
|
804
815
|
format: e.join(x)
|
|
805
816
|
};
|
|
806
817
|
}
|
|
807
|
-
function
|
|
818
|
+
function K(s) {
|
|
808
819
|
return {
|
|
809
820
|
type: "pattern",
|
|
810
|
-
format:
|
|
821
|
+
format: A(s)
|
|
811
822
|
};
|
|
812
823
|
}
|
|
813
|
-
async function
|
|
824
|
+
async function Q(s) {
|
|
814
825
|
const t = {
|
|
815
826
|
variables: [
|
|
816
827
|
{
|
|
@@ -830,20 +841,20 @@ async function K(s) {
|
|
|
830
841
|
type: "featureSetCollection"
|
|
831
842
|
}
|
|
832
843
|
]
|
|
833
|
-
}, e = await
|
|
844
|
+
}, e = await S.createArcadeExecutor(s.expression, t);
|
|
834
845
|
return Promise.resolve({
|
|
835
846
|
type: "executor",
|
|
836
847
|
format: e
|
|
837
848
|
});
|
|
838
849
|
}
|
|
839
|
-
async function
|
|
850
|
+
async function Z(s, t) {
|
|
840
851
|
const e = {};
|
|
841
852
|
if (!Array.isArray(t?.popupTemplate?.expressionInfos) || t?.popupTemplate?.expressionInfos.length === 0)
|
|
842
853
|
return Promise.resolve(e);
|
|
843
854
|
const i = /\{expression\/\w+\}/g, o = s.match(i);
|
|
844
855
|
if (!o)
|
|
845
856
|
return Promise.resolve(e);
|
|
846
|
-
const
|
|
857
|
+
const n = {
|
|
847
858
|
variables: [
|
|
848
859
|
{
|
|
849
860
|
name: "$feature",
|
|
@@ -862,38 +873,38 @@ async function Q(s, t) {
|
|
|
862
873
|
type: "featureSetCollection"
|
|
863
874
|
}
|
|
864
875
|
]
|
|
865
|
-
},
|
|
876
|
+
}, r = {};
|
|
866
877
|
o.forEach((l) => {
|
|
867
878
|
const a = l.substring(l.indexOf("/") + 1, l.length - 1);
|
|
868
879
|
(t?.popupTemplate?.expressionInfos || []).forEach((c) => {
|
|
869
|
-
c.name === a && (
|
|
880
|
+
c.name === a && (r[a] = S.createArcadeExecutor(c.expression, n));
|
|
870
881
|
});
|
|
871
882
|
});
|
|
872
|
-
const
|
|
873
|
-
return Promise.all(
|
|
874
|
-
const a = Object.keys(
|
|
883
|
+
const g = Object.values(r);
|
|
884
|
+
return Promise.all(g).then((l) => {
|
|
885
|
+
const a = Object.keys(r);
|
|
875
886
|
for (let c = 0; c < a.length; ++c)
|
|
876
887
|
e[a[c]] = l[c].valueOf();
|
|
877
888
|
return e;
|
|
878
889
|
});
|
|
879
890
|
}
|
|
880
|
-
function
|
|
891
|
+
function E(s) {
|
|
881
892
|
return s.length > 0 ? s.join(", ") : "download";
|
|
882
893
|
}
|
|
883
|
-
function
|
|
894
|
+
function tt(s) {
|
|
884
895
|
return s.split(x).map((i, o) => {
|
|
885
|
-
const
|
|
886
|
-
return
|
|
896
|
+
const n = i.match(/\{[^\}]*\}/g);
|
|
897
|
+
return n ? n.map((r) => r.substring(1, r.length - 1)).map((r) => r.startsWith("expression/") ? r.substring(r.indexOf("/") + 1) : r).join("__") : `column_${o + 1}`;
|
|
887
898
|
});
|
|
888
899
|
}
|
|
889
|
-
function
|
|
900
|
+
function et(s) {
|
|
890
901
|
const t = /\{expression\/\w+\}/g;
|
|
891
902
|
return s.match(t) ?? [];
|
|
892
903
|
}
|
|
893
|
-
function
|
|
894
|
-
const
|
|
895
|
-
Number.isNaN(Number.parseInt(
|
|
896
|
-
const
|
|
904
|
+
function it(s, t, e, i, o) {
|
|
905
|
+
const n = s.substring(s.lastIndexOf("/") + 1);
|
|
906
|
+
Number.isNaN(Number.parseInt(n)) && (s += "/" + t.toString());
|
|
907
|
+
const r = {
|
|
897
908
|
definitionExpression: "1=1",
|
|
898
909
|
httpMethod: "POST",
|
|
899
910
|
objectIds: i,
|
|
@@ -901,39 +912,39 @@ function Z(s, t, e, i, o) {
|
|
|
901
912
|
relationshipId: e,
|
|
902
913
|
url: s
|
|
903
914
|
};
|
|
904
|
-
return o && (
|
|
915
|
+
return o && (r.params = { token: o }), T(r);
|
|
905
916
|
}
|
|
906
|
-
function
|
|
917
|
+
function T(s, t = [], e = 0) {
|
|
907
918
|
const i = {
|
|
908
919
|
...s.params,
|
|
909
920
|
resultOffset: e
|
|
910
921
|
};
|
|
911
|
-
return
|
|
922
|
+
return I.queryRelated({
|
|
912
923
|
...s,
|
|
913
924
|
params: i
|
|
914
925
|
//TODO } as IQueryRelatedOptionsOffset).then((response: IQueryRelatedResponseOffset) => {
|
|
915
|
-
}).then((o) => (t.push(...o.relatedRecordGroups), o.exceededTransferLimit ?
|
|
926
|
+
}).then((o) => (t.push(...o.relatedRecordGroups), o.exceededTransferLimit ? T(s, t, e + o.relatedRecordGroups.length) : Promise.resolve(t)));
|
|
916
927
|
}
|
|
917
|
-
function
|
|
928
|
+
function st(s) {
|
|
918
929
|
const t = [];
|
|
919
930
|
let e = 0;
|
|
920
931
|
for (; e < s.length; ) {
|
|
921
932
|
const o = s.indexOf("{", e);
|
|
922
933
|
if (o < 0)
|
|
923
934
|
break;
|
|
924
|
-
const
|
|
925
|
-
if (
|
|
935
|
+
const n = s.indexOf("}", o);
|
|
936
|
+
if (n < 0)
|
|
926
937
|
break;
|
|
927
|
-
const
|
|
928
|
-
t.push(
|
|
938
|
+
const r = s.substring(o, n + 1);
|
|
939
|
+
t.push(r), e = n + 1;
|
|
929
940
|
}
|
|
930
|
-
const i =
|
|
941
|
+
const i = et(s);
|
|
931
942
|
return t.filter((o) => i.indexOf(o) < 0);
|
|
932
943
|
}
|
|
933
|
-
function
|
|
944
|
+
function ot(s) {
|
|
934
945
|
return s.map((t) => t.substring(1, t.length - 1));
|
|
935
946
|
}
|
|
936
|
-
async function
|
|
947
|
+
async function C(s, t, e) {
|
|
937
948
|
let i = {
|
|
938
949
|
layer: t,
|
|
939
950
|
attributeFormats: {},
|
|
@@ -949,189 +960,189 @@ async function L(s, t, e) {
|
|
|
949
960
|
o.format && (i.attributeFormats[o.fieldName.toLowerCase()] = o.format);
|
|
950
961
|
}
|
|
951
962
|
), e && t)) {
|
|
952
|
-
const o = t?.popupTemplate?.content || [],
|
|
953
|
-
if (
|
|
954
|
-
const
|
|
963
|
+
const o = t?.popupTemplate?.content || [], n = o && o.length > 0 ? o[0]?.type : void 0;
|
|
964
|
+
if (n === "relationship") {
|
|
965
|
+
const r = o[0].relationshipId, g = t.relationships?.find((a) => a.id === r);
|
|
955
966
|
let l = s.layers.toArray().concat(s.tables.toArray());
|
|
956
|
-
if (l = l.filter((a) => a.type === "feature" && a.layerId ===
|
|
957
|
-
i = await
|
|
967
|
+
if (l = l.filter((a) => a.type === "feature" && a.layerId === g?.relatedTableId), l.length > 0)
|
|
968
|
+
i = await C(s, l[0], e), i.relationshipId = r.toString();
|
|
958
969
|
else {
|
|
959
970
|
l = s.layers.toArray().concat(s.tables.toArray());
|
|
960
971
|
const a = [];
|
|
961
972
|
l = l.filter((f) => {
|
|
962
973
|
if (f.type === "feature" && f.layerId != t.layerId && f.url) {
|
|
963
|
-
const
|
|
964
|
-
return a.push(
|
|
965
|
-
|
|
974
|
+
const w = f.url + "/" + f?.layerId?.toString();
|
|
975
|
+
return a.push(I.getJson(
|
|
976
|
+
w
|
|
966
977
|
/*, authentication*/
|
|
967
978
|
)), !0;
|
|
968
979
|
} else
|
|
969
980
|
return !1;
|
|
970
981
|
});
|
|
971
982
|
const c = await Promise.all(a);
|
|
972
|
-
let
|
|
973
|
-
c.some((f,
|
|
983
|
+
let p = Promise.resolve(void 0);
|
|
984
|
+
c.some((f, w) => f.relationships && f.relationships.some((b) => b.id === r) ? (p = C(s, l[w], e), !0) : !1) ? (i = await p, i.relationshipId = r.toString()) : i.labelFormat = v(t.popupTemplate?.fieldInfos);
|
|
974
985
|
}
|
|
975
|
-
} else
|
|
986
|
+
} else n === "fields" ? (i.labelFormat = v(t.popupTemplate?.fieldInfos), i.labelFormat.format.length === 0 && (i.labelFormat = t.popupTemplate?.title && typeof t.popupTemplate?.title == "string" ? { type: "pattern", format: t.popupTemplate.title } : (
|
|
976
987
|
// Otherwise revert to using attributes
|
|
977
|
-
|
|
978
|
-
))) :
|
|
988
|
+
v(t.popupTemplate?.fieldInfos, !0)
|
|
989
|
+
))) : n === "text" ? i.labelFormat = K(o[0].text) : n === "expression" ? i.labelFormat = await Q(o[0].expressionInfo) : i.labelFormat = v(t.popupTemplate?.fieldInfos);
|
|
979
990
|
}
|
|
980
991
|
return Promise.resolve(i);
|
|
981
992
|
}
|
|
982
|
-
function
|
|
993
|
+
function _(s, t = /.+/) {
|
|
983
994
|
let e = [];
|
|
984
995
|
return Object.keys(s).forEach((i) => {
|
|
985
996
|
const o = s[i];
|
|
986
997
|
t.test(i) && (e = e.concat(o.selectionSetNames));
|
|
987
998
|
}), e;
|
|
988
999
|
}
|
|
989
|
-
function
|
|
1000
|
+
function R(s, t, e, i, o) {
|
|
990
1001
|
if (s === null || typeof s > "u")
|
|
991
1002
|
return "";
|
|
992
1003
|
if (e && e.type === "coded-value")
|
|
993
1004
|
return e.getName(s)?.toString();
|
|
994
1005
|
{
|
|
995
|
-
let
|
|
1006
|
+
let n = s;
|
|
996
1007
|
switch (t) {
|
|
997
1008
|
case "date":
|
|
998
1009
|
if (i?.dateFormat) {
|
|
999
|
-
const
|
|
1000
|
-
|
|
1010
|
+
const r = o.convertDateFormatToIntlOptions(i.dateFormat);
|
|
1011
|
+
n = o.formatDate(n, r);
|
|
1001
1012
|
} else
|
|
1002
|
-
|
|
1003
|
-
|
|
1013
|
+
n = o.formatDate(n);
|
|
1014
|
+
n = n.replace(/\xe2\x80\xaf/g, "");
|
|
1004
1015
|
break;
|
|
1005
1016
|
case "date-only":
|
|
1006
1017
|
if (i?.dateFormat) {
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1018
|
+
const r = o.convertDateFormatToIntlOptions(i.dateFormat);
|
|
1019
|
+
n = o.formatDateOnly(n, r);
|
|
1009
1020
|
} else
|
|
1010
|
-
|
|
1021
|
+
n = o.formatDateOnly(n);
|
|
1011
1022
|
break;
|
|
1012
1023
|
case "time-only":
|
|
1013
1024
|
if (i?.dateFormat) {
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1025
|
+
const r = o.convertDateFormatToIntlOptions(i.dateFormat);
|
|
1026
|
+
n = o.formatTimeOnly(n, r);
|
|
1016
1027
|
} else
|
|
1017
|
-
|
|
1028
|
+
n = o.formatTimeOnly(n);
|
|
1018
1029
|
break;
|
|
1019
1030
|
case "double":
|
|
1020
1031
|
case "integer":
|
|
1021
1032
|
case "long":
|
|
1022
1033
|
case "small-integer":
|
|
1023
1034
|
if (i) {
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1035
|
+
const r = o.convertNumberFormatToIntlOptions(i);
|
|
1036
|
+
n = o.formatNumber(n, r);
|
|
1026
1037
|
} else
|
|
1027
|
-
|
|
1038
|
+
n = o.formatNumber(n?.toString(), {
|
|
1028
1039
|
maximumFractionDigits: 100
|
|
1029
1040
|
});
|
|
1030
1041
|
break;
|
|
1031
1042
|
}
|
|
1032
|
-
return
|
|
1043
|
+
return n;
|
|
1033
1044
|
}
|
|
1034
1045
|
}
|
|
1035
|
-
async function
|
|
1036
|
-
const l = s?.portalItem?.portal?.credential?.token, a = await
|
|
1037
|
-
let
|
|
1046
|
+
async function nt(s, t, e, i = !0, o = !1, n = [], r = !1, g = !1) {
|
|
1047
|
+
const l = s?.portalItem?.portal?.credential?.token, a = await C(s, t, i), c = a.layer;
|
|
1048
|
+
let p = [];
|
|
1038
1049
|
if (typeof a.relationshipId < "u") {
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1041
|
-
u.relatedRecords?.forEach((
|
|
1042
|
-
|
|
1050
|
+
const d = await it(t.url, t.layerId, a.relationshipId, e, l), h = [];
|
|
1051
|
+
d.forEach((u) => {
|
|
1052
|
+
u.relatedRecords?.forEach((m) => {
|
|
1053
|
+
h.push(m.attributes);
|
|
1043
1054
|
});
|
|
1044
1055
|
});
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1056
|
+
const P = t.objectIdField;
|
|
1057
|
+
if (h.sort((u, m) => u[P] < m[P] ? -1 : u[P] > m[P] ? 1 : 0), p = h.filter((u, m) => m === 0 ? !0 : u[P] !== h[m - 1][P]), p.length === 0)
|
|
1047
1058
|
return Promise.resolve([]);
|
|
1048
1059
|
} else {
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1060
|
+
const d = n.length > 0 ? n : void 0;
|
|
1061
|
+
p = await W(e, c, [], !1, void 0, d);
|
|
1051
1062
|
}
|
|
1052
|
-
const f = {},
|
|
1053
|
-
c.fields &&
|
|
1054
|
-
if (!
|
|
1055
|
-
const
|
|
1056
|
-
f[
|
|
1063
|
+
const f = {}, w = {}, b = {};
|
|
1064
|
+
c.fields && n ? c.fields.forEach((d) => {
|
|
1065
|
+
if (!g || n.indexOf((d?.name || "").toLowerCase()) > -1) {
|
|
1066
|
+
const h = d.name.toLowerCase();
|
|
1067
|
+
f[h] = d.name, b[h] = d.domain, w[h] = d.type;
|
|
1057
1068
|
}
|
|
1058
|
-
}) :
|
|
1059
|
-
if (!
|
|
1060
|
-
const
|
|
1061
|
-
f[
|
|
1069
|
+
}) : n && Object.keys(p[0]).forEach((d) => {
|
|
1070
|
+
if (!g || n.indexOf(d.toLowerCase()) > -1) {
|
|
1071
|
+
const h = d.toLowerCase();
|
|
1072
|
+
f[h] = d;
|
|
1062
1073
|
}
|
|
1063
1074
|
});
|
|
1064
|
-
const
|
|
1075
|
+
const O = a.labelFormat.type === "pattern" ? (
|
|
1065
1076
|
// Export attributes in format
|
|
1066
|
-
await
|
|
1077
|
+
await at(
|
|
1067
1078
|
t,
|
|
1068
|
-
|
|
1079
|
+
p,
|
|
1069
1080
|
f,
|
|
1070
|
-
O,
|
|
1071
1081
|
w,
|
|
1082
|
+
b,
|
|
1072
1083
|
a.attributeFormats,
|
|
1073
1084
|
a.labelFormat.format,
|
|
1074
1085
|
o
|
|
1075
1086
|
)
|
|
1076
1087
|
) : a.labelFormat.type === "executor" ? (
|
|
1077
1088
|
// Export attributes in expression
|
|
1078
|
-
await
|
|
1089
|
+
await lt(p, a.labelFormat.format)
|
|
1079
1090
|
) : (
|
|
1080
1091
|
// Export all attributes
|
|
1081
|
-
await
|
|
1092
|
+
await rt(p, w, b, o, r)
|
|
1082
1093
|
);
|
|
1083
|
-
return Promise.resolve(
|
|
1094
|
+
return Promise.resolve(O);
|
|
1084
1095
|
}
|
|
1085
|
-
async function
|
|
1086
|
-
const
|
|
1087
|
-
const l =
|
|
1088
|
-
return
|
|
1096
|
+
async function rt(s, t, e, i = !1, o = !1) {
|
|
1097
|
+
const n = s.map((r) => Object.keys(r.attributes).map((g) => {
|
|
1098
|
+
const l = g.toLowerCase();
|
|
1099
|
+
return R(r.attributes[g], t[l], e[l], void 0, j);
|
|
1089
1100
|
}));
|
|
1090
1101
|
if (i) {
|
|
1091
|
-
const
|
|
1092
|
-
Object.keys(
|
|
1093
|
-
|
|
1094
|
-
}),
|
|
1102
|
+
const r = [], g = s[0].attributes, l = s[0]?.layer?.fields.reduce((a, c) => (a[c.name] = c.alias, a), {});
|
|
1103
|
+
Object.keys(g).forEach((a) => {
|
|
1104
|
+
r.push(o && l ? l[a] : a);
|
|
1105
|
+
}), n.unshift(r);
|
|
1095
1106
|
}
|
|
1096
|
-
return Promise.resolve(
|
|
1107
|
+
return Promise.resolve(n);
|
|
1097
1108
|
}
|
|
1098
|
-
async function
|
|
1099
|
-
const l =
|
|
1100
|
-
t.map(async (
|
|
1101
|
-
let
|
|
1102
|
-
for (let
|
|
1103
|
-
const u = f[
|
|
1104
|
-
|
|
1109
|
+
async function at(s, t, e, i, o, n, r, g = !1) {
|
|
1110
|
+
const l = st(r), a = ot(l), c = await Z(r, s), p = /\{expression\/\w+\}/g, f = r.match(p) ?? [], w = await Promise.all(
|
|
1111
|
+
t.map(async (b) => {
|
|
1112
|
+
let O = r;
|
|
1113
|
+
for (let P = 0; P < f.length; P++) {
|
|
1114
|
+
const u = f[P], m = u.substring(u.indexOf("/") + 1, u.length - 1), F = await c[m].executeAsync({ $feature: b, $layer: s });
|
|
1115
|
+
F && (O = O.replace(u, F).replace(/\n/gi, "|"));
|
|
1105
1116
|
}
|
|
1106
|
-
const
|
|
1107
|
-
a.forEach((
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
i[
|
|
1111
|
-
o[
|
|
1112
|
-
|
|
1113
|
-
|
|
1117
|
+
const d = b.attributes ?? b;
|
|
1118
|
+
a.forEach((P, u) => {
|
|
1119
|
+
const m = P.toLowerCase(), F = R(
|
|
1120
|
+
d[e[m]],
|
|
1121
|
+
i[m],
|
|
1122
|
+
o[m],
|
|
1123
|
+
n[m],
|
|
1124
|
+
j
|
|
1114
1125
|
);
|
|
1115
|
-
|
|
1126
|
+
O = O.replace(l[u], F);
|
|
1116
1127
|
});
|
|
1117
|
-
let
|
|
1118
|
-
return
|
|
1128
|
+
let h = O.split(x);
|
|
1129
|
+
return h = h.map((P) => A(P)), h;
|
|
1119
1130
|
})
|
|
1120
1131
|
);
|
|
1121
|
-
return
|
|
1132
|
+
return g && w.unshift(tt(r)), Promise.resolve(w);
|
|
1122
1133
|
}
|
|
1123
|
-
async function
|
|
1134
|
+
async function lt(s, t) {
|
|
1124
1135
|
const i = (await Promise.all(
|
|
1125
1136
|
s.map(async (o) => t.executeAsync({ $feature: o }))
|
|
1126
|
-
)).filter((o) => o?.text).map((o) =>
|
|
1137
|
+
)).filter((o) => o?.text).map((o) => A(o.text).split(x));
|
|
1127
1138
|
return Promise.resolve(i);
|
|
1128
1139
|
}
|
|
1129
1140
|
export {
|
|
1130
|
-
_,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1141
|
+
R as _,
|
|
1142
|
+
gt as a,
|
|
1143
|
+
_ as b,
|
|
1144
|
+
M as c,
|
|
1145
|
+
dt as d,
|
|
1146
|
+
E as e,
|
|
1147
|
+
N as r
|
|
1137
1148
|
};
|