@arcgis/portal-components 6.0.0-next.30 → 6.0.0-next.32
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/22DNGXFY.js +2 -0
- package/dist/cdn/25K5D5HL.js +2 -0
- package/dist/cdn/2CC4MNQP.js +2 -0
- package/dist/cdn/{BPFX6I6Z.js → 3CXU5CCM.js} +1 -1
- package/dist/cdn/{4PL5CXXD.js → 3DTSKTHB.js} +1 -1
- package/dist/cdn/3MUI6DF4.js +2 -0
- package/dist/cdn/{L2P23REA.js → 3QWNGHAK.js} +1 -1
- package/dist/cdn/3T3QBPC3.js +2 -0
- package/dist/cdn/4X4EYM3Q.js +2 -0
- package/dist/cdn/4Y73LE7P.js +2 -0
- package/dist/cdn/5CEFJTG4.js +2 -0
- package/dist/cdn/5VFGR7LA.js +2 -0
- package/dist/cdn/5Y32T5IJ.js +2 -0
- package/dist/cdn/{4XFXM76G.js → 6EMK2BU6.js} +1 -1
- package/dist/cdn/6HNKQNS5.js +2 -0
- package/dist/cdn/{BNDM7DRY.js → 7BFTXD5J.js} +1 -1
- package/dist/cdn/{SF7P7MND.js → 7DAB2CEU.js} +1 -1
- package/dist/cdn/7ZWYPQMW.js +2 -0
- package/dist/cdn/{OUFJRLPQ.js → AM3UTQWH.js} +1 -1
- package/dist/cdn/ASLKTYLX.js +2 -0
- package/dist/cdn/{WQOCWSJC.js → B343BOVA.js} +1 -1
- package/dist/cdn/BHZKSSVZ.js +2 -0
- package/dist/cdn/BOEGDK4D.js +2 -0
- package/dist/cdn/{DSJOBYW5.js → BRWHEYLW.js} +1 -1
- package/dist/cdn/{TABWX4F2.js → BX2LXI3N.js} +1 -1
- package/dist/cdn/{COET6FWR.js → C3F24ZOM.js} +1 -1
- package/dist/cdn/C4GK263H.js +2 -0
- package/dist/cdn/CBFFZMX4.js +2 -0
- package/dist/cdn/CJ4S56BE.js +2 -0
- package/dist/cdn/{BDMPW4YT.js → CMNTOT5D.js} +1 -1
- package/dist/cdn/CVU6YKOA.js +2 -0
- package/dist/cdn/{Z7DRFGQ6.js → D52TYBRX.js} +1 -1
- package/dist/cdn/{EY37MGL2.js → DMS3R2W5.js} +1 -1
- package/dist/cdn/{S4Y7FPSQ.js → DV57AOBF.js} +1 -1
- package/dist/cdn/{UOY4FZLR.js → EDQSL2P3.js} +1 -1
- package/dist/cdn/{YKFYCIOS.js → ERBRAY5U.js} +1 -1
- package/dist/cdn/{TP5IFB74.js → FAZVQI4K.js} +1 -1
- package/dist/cdn/{KWZIYNDC.js → FGDSHTJ5.js} +1 -1
- package/dist/cdn/{5MZ64QM7.js → FKOSVY5D.js} +1 -1
- package/dist/cdn/FOWOLUC3.js +2 -0
- package/dist/cdn/{XLR4JEUA.js → FVHP6PFG.js} +1 -1
- package/dist/cdn/{XX6BL3DR.js → G7DJPREL.js} +1 -1
- package/dist/cdn/GBXFX37Y.js +2 -0
- package/dist/cdn/{657KMT6Y.js → GC4BV7IZ.js} +1 -1
- package/dist/cdn/H6MGSC3Y.js +2 -0
- package/dist/cdn/{MDYX3ON3.js → HBO7XTIL.js} +1 -1
- package/dist/cdn/HKHDBGNN.js +2 -0
- package/dist/cdn/HVQ7FKJ5.js +2 -0
- package/dist/cdn/{CFNR4XS2.js → HXR7GUM3.js} +1 -1
- package/dist/cdn/IGOSZ2LL.js +2 -0
- package/dist/cdn/IX4WEZZ2.js +2 -0
- package/dist/cdn/{W2MFAJEG.js → JA3GGSJJ.js} +1 -1
- package/dist/cdn/{GRQLUOSD.js → JEVNGG2O.js} +1 -1
- package/dist/cdn/JLT5GCLY.js +2 -0
- package/dist/cdn/KHA6NJ4N.js +2 -0
- package/dist/cdn/{5BVGWSPJ.js → KTTPPUQ7.js} +1 -1
- package/dist/cdn/{MSOJ4BDB.js → L25GEXL6.js} +1 -1
- package/dist/cdn/LBW47BJG.js +2 -0
- package/dist/cdn/LR33CLTB.js +2 -0
- package/dist/cdn/{QE64NUUD.js → M664QA6J.js} +1 -1
- package/dist/cdn/MJVKDAYF.js +2 -0
- package/dist/cdn/MVC6LIQ6.js +2 -0
- package/dist/cdn/{EQZYUMUN.js → NENAFJEC.js} +1 -1
- package/dist/cdn/NLFBHNSX.js +2 -0
- package/dist/cdn/{WUPQROF4.js → NYBLHT3F.js} +1 -1
- package/dist/cdn/{VZPUDARW.js → PJZZIITX.js} +1 -1
- package/dist/cdn/{2XRZP4QI.js → PRBP4AP6.js} +1 -1
- package/dist/cdn/{XMFA6QY6.js → PST62OKJ.js} +1 -1
- package/dist/cdn/{76IANSI7.js → Q2CCAKI4.js} +1 -1
- package/dist/cdn/{7HNMTPSD.js → QF626JXP.js} +1 -1
- package/dist/cdn/{AHJDGTDG.js → QMIVFHQE.js} +1 -1
- package/dist/cdn/{PU7NVVTN.js → QRHXMIMW.js} +1 -1
- package/dist/cdn/RJ3SU3EV.js +2 -0
- package/dist/cdn/{CHJAALGF.js → RJRTGF33.js} +1 -1
- package/dist/cdn/{HH5DBWJ2.js → SO3IBFEU.js} +1 -1
- package/dist/cdn/SUA7ZZUH.js +2 -0
- package/dist/cdn/SV6SGTR6.js +2 -0
- package/dist/cdn/TAZDV6DB.js +2 -0
- package/dist/cdn/TJANHZ25.js +2 -0
- package/dist/cdn/{7ECLKNGV.js → TO666HVV.js} +1 -1
- package/dist/cdn/{L3JSQQUK.js → UBPCKCW2.js} +1 -1
- package/dist/cdn/US37IXWO.js +2 -0
- package/dist/cdn/UZW2KV4X.js +2 -0
- package/dist/cdn/{2W3O3KBH.js → VFECPSKA.js} +1 -1
- package/dist/cdn/VLD3MVSG.js +2 -0
- package/dist/cdn/{GQTAE72S.js → VWV2LCNA.js} +1 -1
- package/dist/cdn/{R3IQ7OYN.js → WC3MDSMP.js} +1 -1
- package/dist/cdn/{GJP72ONW.js → WCZJXBW3.js} +1 -1
- package/dist/cdn/{O2H6SPV3.js → WIUFH5SJ.js} +1 -1
- package/dist/cdn/{YG5ZZUE4.js → WZFGZEQI.js} +1 -1
- package/dist/cdn/XE3DCC5D.js +2 -0
- package/dist/cdn/{NK474LV6.js → XEVOU7SJ.js} +1 -1
- package/dist/cdn/{YWWBQUH2.js → XH6RD5BO.js} +1 -1
- package/dist/cdn/{OW67EEOH.js → XJNEK5Q7.js} +1 -1
- package/dist/cdn/XK3WIW4R.js +2 -0
- package/dist/cdn/{JD6QT6IC.js → XOM3GLYF.js} +1 -1
- package/dist/cdn/YGZICQBT.js +2 -0
- package/dist/cdn/{WRP5SUB4.js → YP7T6NKR.js} +1 -1
- package/dist/cdn/{47EZWWY7.js → YYKKXL62.js} +1 -1
- package/dist/cdn/Z5OZYZYV.js +2 -0
- package/dist/cdn/{CB3UEA5V.js → ZGSAH7Z7.js} +1 -1
- package/dist/cdn/assets/portal-item-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-item-type/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/FieldIcons.js +24 -0
- package/dist/chunks/item.js +50 -50
- package/dist/chunks/layers.js +196 -0
- package/dist/chunks/portal-browser.js +49 -46
- package/dist/chunks/portal-item-preview-sublayer.js +214 -0
- package/dist/chunks/portal2.js +23 -23
- package/dist/chunks/services.js +4 -4
- package/dist/chunks/user2.js +10 -10
- package/dist/chunks/utils4.js +94 -95
- package/dist/components/arcgis-portal-browser/customElement.d.ts +3 -0
- package/dist/components/arcgis-portal-browser/customElement.js +3 -2
- package/dist/components/arcgis-portal-browser/index.js +1 -0
- package/dist/components/arcgis-portal-field-delete/customElement.js +79 -95
- package/dist/components/arcgis-portal-group-browser/customElement.js +9 -7
- package/dist/components/arcgis-portal-group-browser-preview/customElement.js +40 -31
- package/dist/components/arcgis-portal-group-browser-preview/index.js +1 -0
- package/dist/components/arcgis-portal-item-badges/customElement.js +4 -4
- package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.js +101 -272
- package/dist/components/arcgis-portal-item-favorite/customElement.js +42 -29
- package/dist/components/arcgis-portal-item-preview/customElement.d.ts +263 -0
- package/dist/components/arcgis-portal-item-preview/customElement.js +137 -0
- package/dist/components/arcgis-portal-item-preview/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-preview/index.js +20 -0
- package/dist/components/arcgis-portal-item-preview/types.d.ts +14 -0
- package/dist/components/arcgis-portal-item-preview-copy/customElement.d.ts +215 -0
- package/dist/components/arcgis-portal-item-preview-copy/customElement.js +46 -0
- package/dist/components/arcgis-portal-item-preview-copy/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-preview-copy/index.js +5 -0
- package/dist/components/arcgis-portal-item-preview-field/customElement.d.ts +216 -0
- package/dist/components/arcgis-portal-item-preview-field/customElement.js +34 -0
- package/dist/components/arcgis-portal-item-preview-field/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-preview-field/index.js +6 -0
- package/dist/components/arcgis-portal-item-preview-sublayer/customElement.d.ts +216 -0
- package/dist/components/arcgis-portal-item-preview-sublayer/customElement.js +15 -0
- package/dist/components/arcgis-portal-item-preview-sublayer/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-preview-sublayer/index.js +11 -0
- package/dist/components/arcgis-portal-item-type/customElement.d.ts +16 -14
- package/dist/components/arcgis-portal-item-type/customElement.js +25 -28
- package/dist/components/arcgis-portal-navigation/index.js +4 -4
- package/dist/components/arcgis-portal-preview-panel/customElement.d.ts +40 -0
- package/dist/components/arcgis-portal-preview-panel/customElement.js +40 -0
- package/dist/components/arcgis-portal-preview-panel/index.d.ts +1 -0
- package/dist/components/arcgis-portal-preview-panel/index.js +1 -0
- package/dist/components/arcgis-portal-user-avatar/customElement.d.ts +2 -3
- package/dist/components/arcgis-portal-user-avatar/customElement.js +15 -16
- package/dist/components/arcgis-portal-user-popup/customElement.d.ts +3 -6
- package/dist/components/arcgis-portal-user-popup/customElement.js +128 -112
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +32 -0
- package/dist/loader.js +5 -0
- package/dist/types/item.d.ts +6 -0
- package/dist/types/layer.d.ts +27 -0
- package/dist/types/lumina.d.ts +32 -0
- package/dist/types/preact.d.ts +37 -0
- package/dist/types/react.d.ts +42 -0
- package/dist/types/services.d.ts +1 -0
- package/dist/types/stencil.d.ts +32 -0
- package/dist/types/user.d.ts +14 -10
- package/package.json +8 -7
- package/dist/cdn/6P7WYZZS.js +0 -2
- package/dist/cdn/7DBQRL5U.js +0 -2
- package/dist/cdn/AEJPC2Q5.js +0 -2
- package/dist/cdn/DOU2QZP5.js +0 -2
- package/dist/cdn/F5T3DTCW.js +0 -2
- package/dist/cdn/FCGMSMBW.js +0 -2
- package/dist/cdn/FICE62PO.js +0 -2
- package/dist/cdn/GW6SI25C.js +0 -2
- package/dist/cdn/HNVQMOOU.js +0 -2
- package/dist/cdn/IMFTTYIV.js +0 -2
- package/dist/cdn/ITGOCCZZ.js +0 -2
- package/dist/cdn/JTSFNRWR.js +0 -2
- package/dist/cdn/K6NEES4K.js +0 -2
- package/dist/cdn/K6YTIB74.js +0 -2
- package/dist/cdn/L3A3L7FY.js +0 -2
- package/dist/cdn/LGRW3SGR.js +0 -2
- package/dist/cdn/MDOMTVQY.js +0 -2
- package/dist/cdn/MLTZSPZQ.js +0 -2
- package/dist/cdn/NNILBERZ.js +0 -2
- package/dist/cdn/NO5VHQVY.js +0 -2
- package/dist/cdn/NYOXMT6S.js +0 -2
- package/dist/cdn/OHEJPZ35.js +0 -2
- package/dist/cdn/P4XDOAK2.js +0 -2
- package/dist/cdn/PKA745KL.js +0 -2
- package/dist/cdn/SCZ2GY3E.js +0 -2
- package/dist/cdn/TOVMYLXB.js +0 -2
- package/dist/cdn/TRPOPI34.js +0 -2
- package/dist/cdn/UPVGSEFX.js +0 -2
- package/dist/cdn/W5AV2JMK.js +0 -2
- package/dist/cdn/X4EHFUD4.js +0 -2
- package/dist/cdn/YF4HTCBB.js +0 -2
- package/dist/cdn/YMVVEC2R.js +0 -2
- package/dist/cdn/Z55T6COF.js +0 -2
- package/dist/cdn/ZJQ55GQG.js +0 -2
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import { c as y } from "./runtime.js";
|
|
3
|
+
import { isAbortError as l } from "@arcgis/core/core/promiseUtils.js";
|
|
4
|
+
import { LitElement as b, createEvent as v, safeClassMap as g } from "@arcgis/lumina";
|
|
5
|
+
import { log as n } from "@arcgis/toolkit/log";
|
|
6
|
+
import { Task as h, TaskStatus as w } from "@lit/task";
|
|
7
|
+
import { css as m, html as o } from "lit";
|
|
8
|
+
import { u as T } from "./useT9n.js";
|
|
9
|
+
import { s as $, h as k } from "./dom.js";
|
|
10
|
+
import { g as S } from "./utils3.js";
|
|
11
|
+
import p from "@arcgis/core/layers/support/Field.js";
|
|
12
|
+
import { a as I, b as L, f as E, g as x } from "./layers.js";
|
|
13
|
+
import { r as A } from "./request.js";
|
|
14
|
+
import { b as f } from "./items.js";
|
|
15
|
+
import { g as F } from "./portal.js";
|
|
16
|
+
import "../components/arcgis-portal-item-preview-field/customElement.js";
|
|
17
|
+
function R(i) {
|
|
18
|
+
return ["Feature Service", "Layer Template", "Feature Collection"].includes(i.type ?? "") && !f(i).some(
|
|
19
|
+
(e) => ["Route Layer", "Markup", "Map Notes", "markup", "IndoorPositioningDataService"].includes(e)
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function u(i, e) {
|
|
23
|
+
let t;
|
|
24
|
+
if (e.type === "Feature Service" && e.url) {
|
|
25
|
+
const r = new URL(e.url);
|
|
26
|
+
r.pathname = r.pathname.replace(/\/$/u, ""), /\/\d+$/u.test(r.pathname) || (r.pathname += `/${i.id}`), t = r.href;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
id: i.id,
|
|
30
|
+
title: i.title,
|
|
31
|
+
type: i.type,
|
|
32
|
+
description: i.description,
|
|
33
|
+
sourceJSON: i.sourceJSON,
|
|
34
|
+
url: t,
|
|
35
|
+
geometryType: i.geometryType === "table" || !i.geometryType ? "nonspatial" : i.geometryType === "esriGeometryEnvelope" ? "extent" : i.geometryType
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function Y(i, e, t) {
|
|
39
|
+
try {
|
|
40
|
+
if (t.throwIfAborted(), i.type === "Image Service") {
|
|
41
|
+
if (!i.url)
|
|
42
|
+
throw new Error("The imagery item has no service URL.");
|
|
43
|
+
const a = await L(e, i.url, t);
|
|
44
|
+
return t.throwIfAborted(), a.result ? {
|
|
45
|
+
result: {
|
|
46
|
+
sublayers: [],
|
|
47
|
+
serviceInfo: {
|
|
48
|
+
hasMultidimensions: a.result.hasMultidimensions,
|
|
49
|
+
sourceType: a.result.serviceSourceType === "esriImageServiceSourceTypeMosaicDataset" ? "mosaic-dataset" : void 0
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
} : { error: a.error ?? { code: "unhandledError" } };
|
|
53
|
+
}
|
|
54
|
+
if (!R(i))
|
|
55
|
+
return { result: { sublayers: [] } };
|
|
56
|
+
if (i.type === "Layer Template" && f(i).some((a) => a.toLowerCase() === "service template")) {
|
|
57
|
+
const a = await A({
|
|
58
|
+
url: `${F(e)}content/items/${i.id}/data`,
|
|
59
|
+
portal: e,
|
|
60
|
+
options: { signal: t, disableIdentityLookup: !0 }
|
|
61
|
+
});
|
|
62
|
+
return t.throwIfAborted(), {
|
|
63
|
+
result: {
|
|
64
|
+
sublayers: [...a.layers ?? [], ...(a.tables ?? []).map((s) => ({ ...s, type: "Table" }))].map(
|
|
65
|
+
(s) => {
|
|
66
|
+
if (s.id === void 0)
|
|
67
|
+
throw new Error("The layer template contains a layer without an ID.");
|
|
68
|
+
return u(
|
|
69
|
+
{ ...s, id: s.id, title: s.title || s.name || "", sourceJSON: s },
|
|
70
|
+
i
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const r = await E({ item: i, portal: e, signal: t });
|
|
78
|
+
return t.throwIfAborted(), r.result ? { result: { sublayers: r.result.sublayers.map((a) => u(a, i)) } } : { error: r.error ?? { code: "unhandledError" } };
|
|
79
|
+
} catch (r) {
|
|
80
|
+
if (t.aborted || l(r))
|
|
81
|
+
throw r;
|
|
82
|
+
return n("error", "portal.itemPreview", "Unable to load preview layers.", { detail: { error: r } }), {
|
|
83
|
+
error: {
|
|
84
|
+
code: x(r).messageCode === "SB_0006" ? "serviceNotExist" : "unhandledError"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function D(i, e, t) {
|
|
90
|
+
try {
|
|
91
|
+
t.throwIfAborted();
|
|
92
|
+
const r = i.url ? await I(e, i.url, t) : void 0;
|
|
93
|
+
if (t.throwIfAborted(), r && !r.result)
|
|
94
|
+
return { error: r.error ?? { code: "unhandledError" } };
|
|
95
|
+
const a = r?.result ?? i.sourceJSON ?? {}, s = (a.fields ?? i.sourceJSON?.fields ?? []).map((c) => {
|
|
96
|
+
if (!c.name || !c.type)
|
|
97
|
+
throw new Error("The layer returned a field without a name or type.");
|
|
98
|
+
if (c.type === "esriFieldTypeBoolean" || c.type === "boolean")
|
|
99
|
+
return { name: c.name, alias: c.alias ?? c.name, type: "boolean" };
|
|
100
|
+
const d = p.fromJSON(c);
|
|
101
|
+
if (!(d instanceof p))
|
|
102
|
+
throw new Error("The layer returned an invalid field definition.");
|
|
103
|
+
return d;
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
result: {
|
|
107
|
+
...i,
|
|
108
|
+
description: a.description ?? i.description,
|
|
109
|
+
fields: s,
|
|
110
|
+
editingInfo: a.editingInfo ?? i.sourceJSON?.editingInfo
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
} catch (r) {
|
|
114
|
+
if (t.aborted || l(r))
|
|
115
|
+
throw r;
|
|
116
|
+
return n("error", "portal.itemPreview", "Unable to read preview layer details.", { detail: { error: r } }), { error: { code: "unhandledError" } };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function U(i, e, t) {
|
|
120
|
+
e.throwIfAborted();
|
|
121
|
+
const { default: r } = await import("@arcgis/core/layers/FeatureLayer.js");
|
|
122
|
+
e.throwIfAborted();
|
|
123
|
+
const a = new r({ url: i, apiKey: t ?? void 0 });
|
|
124
|
+
try {
|
|
125
|
+
return await a.load({ signal: e }), e.throwIfAborted(), a;
|
|
126
|
+
} catch (s) {
|
|
127
|
+
throw a.destroy(), s;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const z = m`:host{display:block;color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--1);line-height:1.35}.heading{display:flex;align-items:center;margin:0;padding:1rem 1rem .5rem;background:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium)}calcite-tab-nav{padding-inline:1rem;background:var(--calcite-color-foreground-1)}.fields{background:var(--calcite-color-foreground-1)}.fields,.overview{margin-block-start:-.5rem}calcite-block{margin:0}.overview{display:flex;flex-direction:column;gap:1rem;padding:2rem 1.25rem;background:var(--calcite-color-background)}.detail>h4{margin:0 0 .25rem;color:var(--calcite-color-text-3);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-medium)}.detail>p{margin:0;overflow-wrap:anywhere}.empty,.empty-message{color:var(--calcite-color-text-1)}.empty-message{margin:0;padding:1rem}.error{padding:1rem}`, q = m`.rich-text{overflow-wrap:anywhere;a{color:var(--calcite-color-text-link)}img,video{max-inline-size:100%;block-size:auto}table{display:block;max-inline-size:100%;overflow:auto}}.description{overflow:auto;padding-block-end:.25rem;*{max-inline-size:100%;font-size:.875rem!important}table{display:table;inline-size:100%;background:var(--calcite-color-foreground-1);border-collapse:collapse;border-spacing:0;text-align:start;border:1px solid var(--calcite-color-border-2)}th,td{padding:.5rem;text-align:start;font-weight:var(--calcite-font-weight-light);border-inline:1px solid var(--calcite-color-border-2)}tr,thead{border-block-end:1px solid var(--calcite-color-border-2)}tfoot{border-block-start:1px solid var(--calcite-color-border-2)}tr:last-child{border-block-end:none}}`;
|
|
131
|
+
class C extends b {
|
|
132
|
+
constructor() {
|
|
133
|
+
super(...arguments), this.messages = T({ name: "portal-item-preview", blocking: !0 }), this.statisticsRequestActive = !1, this.statisticsTask = new h(this, {
|
|
134
|
+
autoRun: !1,
|
|
135
|
+
task: async (e, { signal: t }) => {
|
|
136
|
+
if (!this.layer?.url)
|
|
137
|
+
throw new Error("Field statistics require a service layer URL.");
|
|
138
|
+
const r = await U(this.layer.url, t, this.item?.apiKey);
|
|
139
|
+
return t.aborted && (r.destroy(), t.throwIfAborted()), r;
|
|
140
|
+
},
|
|
141
|
+
onComplete: (e) => {
|
|
142
|
+
this.statisticsLayer = e, this.statisticsRequestActive = !1;
|
|
143
|
+
},
|
|
144
|
+
onError: (e) => {
|
|
145
|
+
this.statisticsRequestActive = !1, l(e) || n("error", this, "Unable to load the field statistics layer.", { detail: { error: e } });
|
|
146
|
+
}
|
|
147
|
+
}), this.detailTask = new h(this, {
|
|
148
|
+
args: () => [this.item, this.portal, this.portal?.user, this.layer],
|
|
149
|
+
task: async ([, e, , t], { signal: r }) => (this.releaseStatisticsLayer(), !e || !t ? { error: { code: "unhandledError" } } : await D(t, e, r)),
|
|
150
|
+
onError: (e) => {
|
|
151
|
+
l(e) || n("error", this, "Unable to load preview layer details.", { detail: { error: e } });
|
|
152
|
+
}
|
|
153
|
+
}), this.tab = "fields", this.showFieldStatistics = !1, this.arcgisInternalUIAction = v();
|
|
154
|
+
}
|
|
155
|
+
static {
|
|
156
|
+
this.properties = { tab: 16, item: 0, portal: 0, layer: 0, externalLinkHandler: 0, showFieldStatistics: 5 };
|
|
157
|
+
}
|
|
158
|
+
static {
|
|
159
|
+
this.styles = [q, z];
|
|
160
|
+
}
|
|
161
|
+
connectedCallback() {
|
|
162
|
+
super.connectedCallback(), this.hasUpdated && this.detailTask.run();
|
|
163
|
+
}
|
|
164
|
+
willUpdate(e) {
|
|
165
|
+
e.has("showFieldStatistics") && !this.showFieldStatistics && this.releaseStatisticsLayer(), e.has("layer") && (this.tab = "fields"), this.language !== this.messages._lang && (this.language = this.messages._lang, this.dateFormatter = new Intl.DateTimeFormat(this.language, {
|
|
166
|
+
year: "numeric",
|
|
167
|
+
month: "short",
|
|
168
|
+
day: "numeric"
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
disconnectedCallback() {
|
|
172
|
+
super.disconnectedCallback(), this.detailTask.abort(), this.releaseStatisticsLayer();
|
|
173
|
+
}
|
|
174
|
+
changeTab(e) {
|
|
175
|
+
this.tab = e, this.arcgisInternalUIAction.emit({ action: "click", category: "panel action", details: `sublayer ${e}` });
|
|
176
|
+
}
|
|
177
|
+
date(e) {
|
|
178
|
+
return e == null ? "" : this.dateFormatter.format(new Date(e));
|
|
179
|
+
}
|
|
180
|
+
releaseStatisticsLayer() {
|
|
181
|
+
this.statisticsTask.abort(), this.statisticsRequestActive = !1, this.statisticsLayer?.destroy(), this.statisticsLayer = void 0;
|
|
182
|
+
}
|
|
183
|
+
requestStatistics() {
|
|
184
|
+
!this.showFieldStatistics || this.item?.type !== "Feature Service" || !this.layer?.url || this.statisticsLayer || this.statisticsRequestActive || (this.statisticsRequestActive = !0, this.statisticsTask.run());
|
|
185
|
+
}
|
|
186
|
+
renderDetail(e, t, r, a = !1) {
|
|
187
|
+
return o`<div class="detail"><h4>${e}</h4>${a && t ? o`<div class="rich-text description" .innerHTML=${$(k(t)) ?? ""} @click=${this.externalLinkHandler}></div>` : o`<p class=${g({ empty: !t })}>${t || r}</p>`}</div>`;
|
|
188
|
+
}
|
|
189
|
+
renderContent(e) {
|
|
190
|
+
const { messages: t } = this, r = e.fields.filter((s) => s.name !== "OBJECTID"), a = S({ type: e.type, geometry: e.geometryType });
|
|
191
|
+
return o`<calcite-tabs layout=center><calcite-tab-nav slot=title-group><calcite-tab-title tab=fields .selected=${this.tab === "fields"} @calciteTabsActivate=${() => this.changeTab("fields")}>${t.fields}</calcite-tab-title><calcite-tab-title tab=overview .selected=${this.tab === "overview"} @calciteTabsActivate=${() => this.changeTab("overview")}>${t.overview}</calcite-tab-title></calcite-tab-nav><calcite-tab tab=fields .selected=${this.tab === "fields"}><div class="fields">${r.length ? r.map((s) => o`<arcgis-portal-item-preview-field .field=${s} .showStatistics=${this.showFieldStatistics && this.item?.type === "Feature Service" && !!e.url && s.type !== "boolean"} .layer=${this.statisticsLayer} .failed=${this.statisticsTask.status === w.ERROR} @arcgisInternalRequestStatistics=${this.requestStatistics}></arcgis-portal-item-preview-field>`) : o`<p class="empty-message">${t.noFields}</p>`}</div></calcite-tab><calcite-tab tab=overview .selected=${this.tab === "overview"}><div class="overview">${this.renderDetail(a.isGeometry ? t.geometryTypeTitle : t.layerTypeTitle, t.layerTypes[a.type])}${this.renderDetail(t.description, e.description, t.noDescription, !0)}${!this.portal?.isPortal && o`${this.renderDetail(t.dataUpdated, this.date(e.editingInfo?.dataLastEditDate))}${this.renderDetail(t.schemaUpdated, this.date(e.editingInfo?.schemaLastEditDate))}` || ""}${e.url && o`<arcgis-portal-item-preview-copy .heading=${t.url} .label=${t.copyURL} .text=${e.url} section=layers></arcgis-portal-item-preview-copy>` || ""}</div></calcite-tab></calcite-tabs>`;
|
|
192
|
+
}
|
|
193
|
+
renderError(e = !1) {
|
|
194
|
+
return o`<div class="error"><calcite-notice open icon kind=warning scale=s width=full><div slot=title>${this.messages.sublayerErrorTitle}</div><div slot=message>${e ? this.messages.noServiceMessage : this.messages.sublayerErrorMessage}</div><calcite-button slot=link appearance=transparent @click=${() => {
|
|
195
|
+
this.detailTask.run();
|
|
196
|
+
}}>${this.messages.retry}</calcite-button></calcite-notice></div>`;
|
|
197
|
+
}
|
|
198
|
+
render() {
|
|
199
|
+
const e = () => o`<calcite-loader .label=${this.messages.loadingSublayer} scale=s></calcite-loader>`;
|
|
200
|
+
return o`<h3 class="heading"><arcgis-portal-sublayer-type .name=${this.layer?.title} .geometry=${this.layer?.geometryType} .type=${this.layer?.type} hide-type scale=s></arcgis-portal-sublayer-type></h3>${this.detailTask.render({
|
|
201
|
+
initial: e,
|
|
202
|
+
pending: e,
|
|
203
|
+
error: () => this.renderError(),
|
|
204
|
+
complete: ({ result: t, error: r }) => t ? this.renderContent(t) : this.renderError(r?.code === "serviceNotExist")
|
|
205
|
+
})}`;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
y("arcgis-portal-item-preview-sublayer", C);
|
|
209
|
+
export {
|
|
210
|
+
C as A,
|
|
211
|
+
Y as f,
|
|
212
|
+
R as h,
|
|
213
|
+
q as s
|
|
214
|
+
};
|
package/dist/chunks/portal2.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import
|
|
3
|
-
import { f as n, r as
|
|
2
|
+
import i from "@arcgis/core/request.js";
|
|
3
|
+
import { f as n, r as u } from "./request.js";
|
|
4
4
|
import { g as a } from "./portal.js";
|
|
5
5
|
import { c as r } from "./requests.js";
|
|
6
|
-
async function
|
|
6
|
+
async function m(e) {
|
|
7
7
|
const s = `${e.restUrl}/portals/${e.id}/approvedApps`;
|
|
8
8
|
return await r(s, { query: { returnAllApps: !1 } });
|
|
9
9
|
}
|
|
10
|
-
async function
|
|
10
|
+
async function y(e) {
|
|
11
11
|
const s = `${e.restUrl}/portals/self/subscriptionInfo`, { result: t } = await r(s);
|
|
12
12
|
return t?.orgCapabilities || [];
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
15
|
-
const
|
|
16
|
-
return
|
|
14
|
+
async function d(e, s) {
|
|
15
|
+
const t = `${e.restUrl}/portals/self/settings`, { result: o } = await r(t, s);
|
|
16
|
+
return o;
|
|
17
17
|
}
|
|
18
|
-
async function
|
|
18
|
+
async function w(e) {
|
|
19
19
|
const s = `${e.restUrl}/portals/self/servers`;
|
|
20
20
|
return (await r(s))?.result?.servers || [];
|
|
21
21
|
}
|
|
22
|
-
async function
|
|
22
|
+
async function l(e) {
|
|
23
23
|
const s = `${e.restUrl}/portals/self/signinSettings`;
|
|
24
24
|
return (await r(s)).result || {};
|
|
25
25
|
}
|
|
26
|
-
async function w(e) {
|
|
27
|
-
return e?.user ? (await u(e))?.blockedApps || [] : [];
|
|
28
|
-
}
|
|
29
26
|
async function $(e) {
|
|
27
|
+
return e?.user ? (await l(e))?.blockedApps || [] : [];
|
|
28
|
+
}
|
|
29
|
+
async function S(e) {
|
|
30
30
|
return (await n({
|
|
31
|
-
requester: async () => await
|
|
31
|
+
requester: async () => await i(`${a(e)}portals/self/userDefaultSettings`, { query: { f: "json" } }),
|
|
32
32
|
key: "memberDefaults",
|
|
33
33
|
id: e.id
|
|
34
34
|
})).data;
|
|
35
35
|
}
|
|
36
|
-
async function
|
|
36
|
+
async function b(e) {
|
|
37
37
|
try {
|
|
38
38
|
return { result: await n({
|
|
39
|
-
requester: async () => await
|
|
39
|
+
requester: async () => await u({
|
|
40
40
|
url: `${a(e)}portals/self/resources/home.page.json`,
|
|
41
41
|
portal: e
|
|
42
42
|
}),
|
|
@@ -48,12 +48,12 @@ async function S(e) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
S as a,
|
|
52
|
+
m as b,
|
|
53
|
+
y as c,
|
|
54
|
+
l as d,
|
|
55
|
+
w as e,
|
|
56
|
+
d as f,
|
|
57
|
+
b as g,
|
|
58
|
+
$ as h
|
|
59
59
|
};
|
package/dist/chunks/services.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import { b as a, g as i } from "./portal.js";
|
|
3
|
-
const o = (t) =>
|
|
4
|
-
function u(t,
|
|
3
|
+
const o = (t) => "thumbnailUrl" in t;
|
|
4
|
+
function u(t, n, r = !1) {
|
|
5
5
|
if (o(t))
|
|
6
6
|
return t.thumbnailUrl;
|
|
7
7
|
const s = t.thumbnail;
|
|
@@ -9,8 +9,8 @@ function u(t, r, n = !1) {
|
|
|
9
9
|
return null;
|
|
10
10
|
if (s.startsWith("http"))
|
|
11
11
|
return s;
|
|
12
|
-
const e = a(
|
|
13
|
-
return `${
|
|
12
|
+
const e = a(n);
|
|
13
|
+
return `${r ? "https://www.arcgis.com/sharing/rest/" : i(n)}community/users/${t.username}/info/${s}${e && !r ? `?token=${e}` : ""}`;
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
16
|
u as g
|
package/dist/chunks/user2.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
function
|
|
3
|
-
const { fullName:
|
|
4
|
-
return
|
|
2
|
+
function s(e, r) {
|
|
3
|
+
const { fullName: n, username: a } = e, t = "firstName" in e ? e.firstName : void 0, i = "lastName" in e ? e.lastName : void 0;
|
|
4
|
+
return n || (t && i ? r === "ja" ? `${i} ${t}` : `${t} ${i}` : a ?? "");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function c(e) {
|
|
7
7
|
return e && !e.id;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function o(e) {
|
|
10
10
|
return e?.sourceJSON?.privileges?.includes("portal:user:createItem");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function u(e) {
|
|
13
13
|
return e?.sourceJSON?.privileges?.includes("premium:publisher:createNotebooks");
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
|
-
|
|
17
|
-
c,
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
u as a,
|
|
17
|
+
o as c,
|
|
18
|
+
s as g,
|
|
19
|
+
c as i
|
|
20
20
|
};
|