@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
package/dist/chunks/item.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import a from "@arcgis/core/request.js";
|
|
3
3
|
import { g as i } from "./portal.js";
|
|
4
|
-
|
|
4
|
+
import { g as p } from "./items.js";
|
|
5
|
+
function h(e, r) {
|
|
5
6
|
return `${i(r)}content/items/${e}`;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
+
function v(e) {
|
|
8
9
|
return e.typeKeywords?.includes("Hosted Service") && e.type !== "Insights Workbook" && e.type !== "Insights Data Engineering Workbook" && e.type !== "Insights Page";
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function S(e) {
|
|
11
12
|
return e.typeKeywords?.includes("View Service");
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function P(e) {
|
|
14
15
|
return e?.type === "Geoprocessing Service";
|
|
15
16
|
}
|
|
16
17
|
function I(e) {
|
|
17
18
|
return e.typeKeywords?.includes("Service Proxy") && e.typeKeywords.includes("Geocoding filter");
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function T(e) {
|
|
20
21
|
return e.type === "Image Collection" && e.typeKeywords?.includes("Photo locations");
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
return e
|
|
24
|
-
}
|
|
25
|
-
function P(e, r) {
|
|
26
|
-
return e.typeKeywords?.includes("Managed Image Collection") || p(r) && !e.typeKeywords?.includes("Tiled Imagery");
|
|
23
|
+
function m(e) {
|
|
24
|
+
return !!e && ("sourceType" in e && e.sourceType === "mosaic-dataset" || "serviceSourceType" in e && e.serviceSourceType === "esriImageServiceSourceTypeMosaicDataset");
|
|
27
25
|
}
|
|
28
26
|
function K(e, r) {
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
return e.typeKeywords?.includes("Managed Image Collection") || m(r) && !e.typeKeywords?.includes("Tiled Imagery");
|
|
28
|
+
}
|
|
29
|
+
function j(e, r) {
|
|
30
|
+
const t = "serviceProperties" in e ? e.serviceProperties : void 0, s = t && typeof t == "object" && "tags" in t ? t.tags : void 0, o = p(e).serviceProperties?.tags ?? s;
|
|
31
|
+
return !!(Array.isArray(o) && o.includes("hasMultidimensions") || r && "hasMultidimensions" in r && r.hasMultidimensions);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return c(e, r) ||
|
|
33
|
+
function k(e, r) {
|
|
34
|
+
return c(e, r) || y(e, r);
|
|
35
35
|
}
|
|
36
36
|
function c(e, r) {
|
|
37
37
|
return e.owner === r.username;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const t = e.owner, s = e.itemControl === "admin",
|
|
39
|
+
function y(e, r) {
|
|
40
|
+
const t = e.owner, s = e.itemControl === "admin", o = ["esri_livingatlas", "esri_demographics", "esri_boundaries"];
|
|
41
41
|
return e.portal?.isPortal && !c(e, r) && s && t?.includes("esri_") && // portal incorrectly returns "itemControl="admin" for esri owned items
|
|
42
|
-
!
|
|
42
|
+
!o.includes(t) ? !1 : s;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
function
|
|
44
|
+
const G = (e, r) => !!r.orgId && e.every((t) => t.isOrgItem);
|
|
45
|
+
function V(e) {
|
|
46
46
|
return e.typeKeywords?.includes("Spatiotemporal");
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function b(e) {
|
|
49
49
|
return e.typeKeywords?.includes("View Service");
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function M(e) {
|
|
52
52
|
return e.typeKeywords?.includes("Hosted Service");
|
|
53
53
|
}
|
|
54
54
|
function U(e) {
|
|
@@ -57,7 +57,7 @@ function U(e) {
|
|
|
57
57
|
function $(e) {
|
|
58
58
|
return e?.hasViews && !e.sourceSchemaChangesAllowed;
|
|
59
59
|
}
|
|
60
|
-
async function
|
|
60
|
+
async function A(e) {
|
|
61
61
|
const r = e?.portalItem;
|
|
62
62
|
if (!r)
|
|
63
63
|
return await Promise.resolve(null);
|
|
@@ -71,16 +71,16 @@ async function b(e) {
|
|
|
71
71
|
},
|
|
72
72
|
responseType: "json"
|
|
73
73
|
}).then(
|
|
74
|
-
async (
|
|
75
|
-
const
|
|
76
|
-
return await Promise.resolve(
|
|
74
|
+
async (o) => {
|
|
75
|
+
const n = o.data?.groups ?? [];
|
|
76
|
+
return await Promise.resolve(n);
|
|
77
77
|
},
|
|
78
78
|
async () => await Promise.reject(new Error("Failed to fetch user groups"))
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
return await Promise.resolve(null);
|
|
82
82
|
}
|
|
83
|
-
async function
|
|
83
|
+
async function C(e) {
|
|
84
84
|
const r = e?.portalItem;
|
|
85
85
|
if (!r)
|
|
86
86
|
return await Promise.resolve(null);
|
|
@@ -92,21 +92,21 @@ async function M(e) {
|
|
|
92
92
|
},
|
|
93
93
|
responseType: "json"
|
|
94
94
|
}).then(
|
|
95
|
-
async (
|
|
96
|
-
const
|
|
95
|
+
async (o) => {
|
|
96
|
+
const n = o.data?.admin ?? [], u = o.data?.member ?? [], l = o.data?.other ?? [], d = [...n, ...u, ...l];
|
|
97
97
|
return await Promise.resolve(d);
|
|
98
98
|
},
|
|
99
99
|
async () => await Promise.reject(new Error("Failed to fetch item groups"))
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
|
-
async function
|
|
103
|
-
const
|
|
104
|
-
return await a(
|
|
105
|
-
query: { f: "json", relationshipType: t, direction: s, includeRecycleBin:
|
|
102
|
+
async function q(e, r, { relationshipType: t, direction: s }, o = !1) {
|
|
103
|
+
const n = `${i(r)}content/items/${e}/relatedItems`;
|
|
104
|
+
return await a(n, {
|
|
105
|
+
query: { f: "json", relationshipType: t, direction: s, includeRecycleBin: o },
|
|
106
106
|
responseType: "json"
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function B(e, r) {
|
|
110
110
|
return e?.some(
|
|
111
111
|
(t) => r?.some(
|
|
112
112
|
(s) => t.id === s.id && t.capabilities.includes("updateitemcontrol")
|
|
@@ -114,23 +114,23 @@ function q(e, r) {
|
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
M as a,
|
|
118
|
+
b,
|
|
119
119
|
$ as c,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
V as d,
|
|
121
|
+
A as e,
|
|
122
|
+
C as f,
|
|
123
|
+
q as g,
|
|
124
|
+
B as h,
|
|
125
|
+
v as i,
|
|
126
|
+
P as j,
|
|
127
|
+
h as k,
|
|
128
128
|
U as l,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
G as m,
|
|
130
|
+
j as n,
|
|
131
|
+
K as o,
|
|
132
|
+
S as p,
|
|
133
133
|
I as q,
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
T as r,
|
|
135
|
+
k as u
|
|
136
136
|
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import { isAbortError as v } from "@arcgis/core/core/promiseUtils.js";
|
|
3
|
+
import { log as w } from "@arcgis/toolkit/log";
|
|
4
|
+
import { b as k } from "./items.js";
|
|
5
|
+
import { g, b as I } from "./portal.js";
|
|
6
|
+
import { r as R } from "./request.js";
|
|
7
|
+
function b(e) {
|
|
8
|
+
const r = typeof e == "object" && e !== null && "details" in e ? e.details : void 0, s = typeof r == "object" && r !== null && "raw" in r ? r.raw : void 0, t = {};
|
|
9
|
+
for (const o of [e, r, s])
|
|
10
|
+
typeof o != "object" || o === null || ("code" in o && typeof o.code == "number" && t.code === void 0 && (t.code = o.code), "messageCode" in o && typeof o.messageCode == "string" && (t.messageCode = o.messageCode));
|
|
11
|
+
return t;
|
|
12
|
+
}
|
|
13
|
+
async function D(e, r, s) {
|
|
14
|
+
return await T(e, r, s);
|
|
15
|
+
}
|
|
16
|
+
async function O(e, r, s) {
|
|
17
|
+
return await T(e, r, s);
|
|
18
|
+
}
|
|
19
|
+
async function T(e, r, s) {
|
|
20
|
+
for (const t of [!1, !0])
|
|
21
|
+
try {
|
|
22
|
+
s.throwIfAborted();
|
|
23
|
+
const o = await m(r, e, t, !1, s);
|
|
24
|
+
return s.throwIfAborted(), { result: o };
|
|
25
|
+
} catch (o) {
|
|
26
|
+
if (s.aborted || v(o))
|
|
27
|
+
throw o;
|
|
28
|
+
if (L(t, o, e))
|
|
29
|
+
continue;
|
|
30
|
+
return w("error", "portal.services.layers", "Unable to load service information.", { detail: { error: o } }), { error: { code: S(o) ? "serviceNotExist" : "unhandledError" } };
|
|
31
|
+
}
|
|
32
|
+
return { error: { code: "unhandledError" } };
|
|
33
|
+
}
|
|
34
|
+
function f(e, r, s) {
|
|
35
|
+
if (e.id === void 0)
|
|
36
|
+
throw new Error("The service layer has no ID.");
|
|
37
|
+
return {
|
|
38
|
+
description: e.description,
|
|
39
|
+
fieldAliases: e.fields?.map((t) => t.alias ?? ""),
|
|
40
|
+
fields: e.fields,
|
|
41
|
+
geometryType: s ? "table" : e.geometryType,
|
|
42
|
+
id: e.id,
|
|
43
|
+
title: e.name || e.title || "",
|
|
44
|
+
type: e.type,
|
|
45
|
+
matched: r?.find((t) => t.id === e.id)?.matched,
|
|
46
|
+
sourceJSON: e
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async function m(e, r, s, t, o) {
|
|
50
|
+
const i = r.portalMode === "multitenant", c = new URL(g(r)).hostname, a = e.includes(".arcgis.com/"), n = ["//services", "//tiles", "//features", "//locationservices"].some(
|
|
51
|
+
(l) => e.includes(l)
|
|
52
|
+
), d = r.supportsHostedServices && e.includes(c) && i;
|
|
53
|
+
return await R({
|
|
54
|
+
url: e,
|
|
55
|
+
portal: r,
|
|
56
|
+
method: "post",
|
|
57
|
+
options: {
|
|
58
|
+
useProxy: !1,
|
|
59
|
+
timeout: i ? 5e3 : 6e4,
|
|
60
|
+
addSSL: a && n || !a && d,
|
|
61
|
+
...s ? {} : { addTokenManually: !1 },
|
|
62
|
+
disableIdentityLookup: !t,
|
|
63
|
+
signal: o
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function E(e) {
|
|
68
|
+
return typeof e == "object" && e !== null && "message" in e && typeof e.message == "string" ? e.message : void 0;
|
|
69
|
+
}
|
|
70
|
+
function S(e) {
|
|
71
|
+
return [404, 500].includes(b(e).code ?? 0) || E(e) === "Invalid URL";
|
|
72
|
+
}
|
|
73
|
+
function L(e, r, s) {
|
|
74
|
+
const { code: t } = b(r), o = E(r);
|
|
75
|
+
return !e && (t === 499 && (o === "Token Required" || o === "Token required.") || t === 403 || t === 498 && o === "Invalid Token") && !!s.user;
|
|
76
|
+
}
|
|
77
|
+
function p(e, r, s, t) {
|
|
78
|
+
const o = s?.tables, i = !!s?.layers?.length || !!o, c = [...s?.layers ?? [], ...s?.tables ?? []].map((a) => a.id);
|
|
79
|
+
return (e ?? []).filter(({ id: a, type: n }) => !i || n === "Table" && !o || c.includes(a)).map((a) => f(a, r, t));
|
|
80
|
+
}
|
|
81
|
+
async function x({
|
|
82
|
+
serviceInfo: e,
|
|
83
|
+
item: r,
|
|
84
|
+
portal: s,
|
|
85
|
+
layers: t,
|
|
86
|
+
isSecure: o,
|
|
87
|
+
allowLoginWindow: i,
|
|
88
|
+
data: c,
|
|
89
|
+
signal: a
|
|
90
|
+
}) {
|
|
91
|
+
if (!e.layers?.length && !e.tables?.length && e.fields)
|
|
92
|
+
return { result: { sublayers: [f(e, t)], serviceInfo: e } };
|
|
93
|
+
try {
|
|
94
|
+
const n = await m(
|
|
95
|
+
`${r.url}/layers`,
|
|
96
|
+
s,
|
|
97
|
+
o,
|
|
98
|
+
i,
|
|
99
|
+
a
|
|
100
|
+
);
|
|
101
|
+
return {
|
|
102
|
+
result: {
|
|
103
|
+
sublayers: [
|
|
104
|
+
...p(n.layers, t, c),
|
|
105
|
+
...p(n.tables, t, c, !0)
|
|
106
|
+
].sort((d, u) => d.id - u.id),
|
|
107
|
+
serviceInfo: e
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
} catch {
|
|
111
|
+
return { error: { code: "unhandledError" } };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function q(e, r, s) {
|
|
115
|
+
try {
|
|
116
|
+
const t = new URL(`${g(r)}content/items/${e.id}/data`);
|
|
117
|
+
t.searchParams.set("f", "json");
|
|
118
|
+
const o = I(r);
|
|
119
|
+
o && t.searchParams.set("token", o);
|
|
120
|
+
const c = await (await fetch(t, { signal: s })).text();
|
|
121
|
+
return c ? JSON.parse(c) : void 0;
|
|
122
|
+
} catch (t) {
|
|
123
|
+
if (s?.aborted || v(t))
|
|
124
|
+
throw t;
|
|
125
|
+
w("warn", "portal.services.layers", "Unable to read optional item data; loading the service directly.", {
|
|
126
|
+
detail: { error: t }
|
|
127
|
+
});
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async function N({
|
|
132
|
+
item: e,
|
|
133
|
+
portal: r,
|
|
134
|
+
layers: s,
|
|
135
|
+
isSecure: t = !1,
|
|
136
|
+
data: o,
|
|
137
|
+
allowLoginWindow: i,
|
|
138
|
+
retry: c,
|
|
139
|
+
signal: a
|
|
140
|
+
}) {
|
|
141
|
+
try {
|
|
142
|
+
const n = o ?? (c ? void 0 : await q(e, r, a));
|
|
143
|
+
if (n?.error?.code === 403 && n.error.messageCode === "SB_0006")
|
|
144
|
+
return { error: { code: "serviceNotExist" } };
|
|
145
|
+
if (e.type === "Feature Collection" && (n?.layers || n?.tables))
|
|
146
|
+
return {
|
|
147
|
+
result: {
|
|
148
|
+
sublayers: [...n.layers ?? [], ...n.tables ?? []].map(({ layerDefinition: d }, u) => {
|
|
149
|
+
if (!d)
|
|
150
|
+
throw new Error("A feature collection layer has no layer definition.");
|
|
151
|
+
return {
|
|
152
|
+
...f({ ...d, id: u }, void 0, u >= (n.layers?.length ?? 0)),
|
|
153
|
+
description: "",
|
|
154
|
+
matched: !1,
|
|
155
|
+
sourceJSON: d
|
|
156
|
+
};
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
try {
|
|
161
|
+
if (!e.url)
|
|
162
|
+
throw new Error("Invalid URL");
|
|
163
|
+
const d = await m(e.url, r, t, i, a), u = await x({
|
|
164
|
+
serviceInfo: d,
|
|
165
|
+
item: e,
|
|
166
|
+
portal: r,
|
|
167
|
+
layers: s,
|
|
168
|
+
isSecure: t,
|
|
169
|
+
allowLoginWindow: i,
|
|
170
|
+
data: n,
|
|
171
|
+
signal: a
|
|
172
|
+
});
|
|
173
|
+
return k(e).includes("SubtypeGroupLayer") && u.result && n?.layers?.length && (u.result.sublayers = u.result.sublayers.flatMap((l) => {
|
|
174
|
+
const y = n?.layers?.find(({ id: h }) => h === l.id);
|
|
175
|
+
return y?.layerType === "SubtypeGroupLayer" && y.layers?.length ? [
|
|
176
|
+
l,
|
|
177
|
+
...y.layers.map((h) => ({
|
|
178
|
+
...f(h),
|
|
179
|
+
// use the parent layer as the geometry type
|
|
180
|
+
geometryType: l.geometryType
|
|
181
|
+
}))
|
|
182
|
+
] : [l];
|
|
183
|
+
})), u;
|
|
184
|
+
} catch (d) {
|
|
185
|
+
return !a?.aborted && L(t, d, r) ? await N({ item: e, portal: r, layers: s, data: n, isSecure: !0, allowLoginWindow: i, signal: a }) : { error: { code: S(d) ? "serviceNotExist" : "unhandledError" } };
|
|
186
|
+
}
|
|
187
|
+
} catch {
|
|
188
|
+
return { error: { code: "unhandledError" } };
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
export {
|
|
192
|
+
O as a,
|
|
193
|
+
D as b,
|
|
194
|
+
N as f,
|
|
195
|
+
b as g
|
|
196
|
+
};
|
|
@@ -3,15 +3,16 @@ import { c as F } from "./runtime.js";
|
|
|
3
3
|
import { watch as l } from "@arcgis/core/core/reactiveUtils.js";
|
|
4
4
|
import * as p from "@arcgis/core/intl.js";
|
|
5
5
|
import { substitute as g } from "@arcgis/core/intl.js";
|
|
6
|
-
import { LitElement as S, createEvent as m, safeClassMap as
|
|
7
|
-
import { css as
|
|
8
|
-
import { createRef as
|
|
6
|
+
import { LitElement as S, createEvent as m, safeClassMap as o, safeStyleMap as v } from "@arcgis/lumina";
|
|
7
|
+
import { css as P, html as r } from "lit";
|
|
8
|
+
import { createRef as B, ref as C } from "lit/directives/ref.js";
|
|
9
9
|
import { u as R } from "./useT9n.js";
|
|
10
10
|
import { c as u } from "./dom.js";
|
|
11
|
-
import { i as
|
|
11
|
+
import { i as k } from "./functionalities.js";
|
|
12
12
|
import "../components/arcgis-portal-browser-filter-status/customElement.js";
|
|
13
13
|
import { c as E, o as T, a as W, i as z } from "./store.js";
|
|
14
|
-
|
|
14
|
+
import "../components/arcgis-portal-preview-panel/customElement.js";
|
|
15
|
+
const I = P`:host{position:relative;display:flex;height:100%;flex-direction:column;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-background);--arcgis-browser-max-width: 100%;--arcgis-browser-pane-width: 18.75rem;--arcgis-browser-pane-z-index: 11;container-type:inline-size;container-name:portal-browser}:host([height="auto"]){height:auto;min-height:100%;flex:1 1 100%}.wrapper{display:flex;height:100%;flex-direction:column;overflow:hidden}.wrapper--fixed{overflow:hidden}.wrapper--auto{flex:1 1 100%}.wrapper--full{transform:translate(0)}.panel{display:flex;height:100%;flex-direction:column;overflow:hidden}.panel--fixed{transform:translateZ(0)}.top-bar{position:sticky;top:0;right:0;left:0;z-index:20;flex-shrink:0;flex-grow:0;border-bottom:1px solid var(--calcite-color-border-3)}.scrolling{position:relative;display:flex;min-height:0px;width:100%;flex:1 1 0%;flex-direction:column}.scrolling--panel{overflow-y:scroll}@supports (scrollbar-gutter: stable){.scrolling--panel{scrollbar-gutter:stable;overflow-y:auto}}.scrolling--full{overflow:hidden}.preview-position{position:absolute;inset:0;margin-inline:auto;width:100%;max-width:var(--arcgis-browser-max-width)}.preview-position--with-top-bar{top:3rem}.two-up{margin-left:auto;margin-right:auto;display:flex;width:100%;flex:1 1 auto;flex-direction:row;max-width:var(--arcgis-browser-max-width)}.two-up.small{margin-top:-1px}.two-up--fullscreen{height:100%;overflow:hidden}.content__start{margin-inline-end:.25rem;padding-inline:1rem}.content{position:relative;display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;overflow:hidden}.content--full{overflow-y:scroll}@supports (scrollbar-gutter: stable){.content--full{scrollbar-gutter:stable;overflow-y:auto}}.content__top{position:relative;display:flex;height:1.5rem;flex-grow:0;align-items:center;justify-content:space-between;padding-top:1.25rem;padding-bottom:.75rem;font-size:1.125rem;color:var(--calcite-color-text-1);z-index:2}.content__top__end{margin-inline-start:auto;display:grid;gap:.5rem;grid-auto-flow:column}.actions,.filter-status{flex:1 1 0%}.content__view{margin-inline-end:.25rem;min-width:0px;flex:1 1 0%;padding-inline:var(--arcgis-browser-content-padding, 1rem)}.content__view--padded-bottom{padding-bottom:1rem}.content__view--no-filters{margin-inline-start:.25rem;padding-inline-start:var(--arcgis-browser-content-padding, 1rem)}arcgis-portal-preview-panel{--arcgis-portal-preview-panel-width: var(--arcgis-browser-pane-width);--arcgis-portal-preview-panel-z-index: var(--arcgis-browser-pane-z-index)}arcgis-portal-preview-panel[open]{box-shadow:#0000000f 4px 0 16px}.filter-panel,.preview-panel{position:relative;height:100%;background-color:var(--calcite-color-background)}.filter-panel__content{padding:.75rem 1rem 0}.filter-status--mobile{width:100%}.filter-status--active{display:block}.popover-contents{width:var(--arcgis-browser-popover-width);height:var(--arcgis-browser-popover-height)}.sheet{pointer-events:none;position:fixed;inset:0;z-index:110}.sheet--top-bar{top:3rem;overflow:hidden}.sheet__background{position:absolute;inset:0;opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;background-color:#0003}.sheet__background--hidden{display:none}.sheet--active .sheet__background{opacity:1}.sheet--active{pointer-events:auto;opacity:1}.sheet__contents{position:absolute;inset:0;opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;top:3rem;transform:translate3d(0,24px,0)}.sheet__contents--full{top:0;--tw-shadow: 0 2px 12px -4px rgba(0, 0, 0, .2), 0 2px 4px -2px rgba(0, 0, 0, .16);--tw-shadow-colored: 0 2px 12px -4px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);inset-inline-end:0;width:100%;border:1px solid var(--calcite-color-border-3);border-inline-start:1px solid var(--calcite-color-border-3);transform:translate3d(0,24px,0)}.sheet--active .sheet__contents{opacity:1;transform:translateZ(0)}.hide{display:none}.aria-hidden{height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;position:absolute;top:0;bottom:0;width:0px;inset-inline-end:0}.content__view--flex{display:flex;flex-direction:column}.cover{display:flex;flex:1 1 0%;align-items:flex-start;justify-content:center;overflow:auto;padding-bottom:1rem;padding-top:.25rem}.no-results{height:100%;width:100%;flex:1 1 0%;text-align:center;font-size:.875rem;color:var(--calcite-color-text-2)}::slotted([slot="no-results"]){width:100%}::slotted([slot="no-content"]){width:100%}.results-wrapper{flex:1 1 0%}.results-wrapper--spaced{padding-top:1.5rem}.loader{margin-top:min(8rem,30vh);--calcite-loader-padding: 0}.filters{box-sizing:border-box;flex-grow:0;padding-inline:1.5rem 0;width:var(--arcgis-browser-pane-width)}.filters--sticky{position:sticky;top:0;height:100%}.filters__content{overflow-y:auto;height:100%;padding-top:1.5rem;box-sizing:border-box;scrollbar-gutter:stable}.filters--empty{display:none}.filters--active{opacity:1;transform:translateZ(0)}.filters__title{margin:0 0 1rem;padding:0 0 1rem;font-size:1.125rem;font-weight:500;color:var(--calcite-color-text-1);padding-inline-start:.75rem;border-bottom:1px solid var(--calcite-color-border-3)}.range{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;color:var(--calcite-color-text-1)}.container{display:flex;height:100%;width:100%;flex-direction:column;background-color:var(--calcite-color-background)}.container__header{display:flex;flex:0 1 auto;flex-direction:row;background-color:var(--calcite-color-foreground-1);border-bottom:1px solid var(--calcite-color-border-3)}.container__header__text{margin:0;flex:1 1 0%;padding:.875rem .75rem;font-size:1rem;font-weight:500;color:var(--calcite-color-text-2)}.container__content{flex:1 1 0%;overflow:auto}.container__footer{box-sizing:border-box;width:100%;flex:0 1 auto;background-color:var(--calcite-color-foreground-1);padding:.5rem}.small .filters{padding:0}.small .filters__content{padding-left:1rem;padding-right:1rem}.small .content__view{padding-inline:.5rem;margin-inline:0}.small .content__view--panel{padding-inline:0}.small .content__start{margin-inline:0;padding-inline:.5rem}@container portal-browser (max-width: 640px){:host{--arcgis-browser-pane-width: 100%}}.scrim__find{margin-top:3.5rem;opacity:.6;transition-property:opacity;transition-duration:.15s;--calcite-scrim-background: rgba(0, 0, 0, .6)}`;
|
|
15
16
|
function f(c) {
|
|
16
17
|
return {
|
|
17
18
|
...c,
|
|
@@ -20,9 +21,9 @@ function f(c) {
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
function U(c, t = {}) {
|
|
23
|
-
const { hiddenFilterIds: e, preservedFilterIds: i } = t,
|
|
24
|
+
const { hiddenFilterIds: e, preservedFilterIds: i } = t, a = /* @__PURE__ */ new Set([...e || [], ...i || []]);
|
|
24
25
|
return Object.entries(c).reduce(
|
|
25
|
-
(
|
|
26
|
+
(s, [n, d]) => a.has(n) ? (s[n] = d, s) : (s[n] = f(d), s),
|
|
26
27
|
{}
|
|
27
28
|
);
|
|
28
29
|
}
|
|
@@ -30,13 +31,13 @@ function q(c) {
|
|
|
30
31
|
const t = Math.max(c?.total ?? 0, 0), e = c?.results?.length ?? 0;
|
|
31
32
|
if (!t || !e)
|
|
32
33
|
return { start: 0, end: 0, total: t };
|
|
33
|
-
const i = Math.max(c?.start ?? 1, 1),
|
|
34
|
-
return { start: i, end:
|
|
34
|
+
const i = Math.max(c?.start ?? 1, 1), a = Math.min(i + e - 1, t);
|
|
35
|
+
return { start: i, end: a, total: t };
|
|
35
36
|
}
|
|
36
37
|
const A = 49;
|
|
37
38
|
class H extends S {
|
|
38
39
|
constructor() {
|
|
39
|
-
super(...arguments), this._messages = R({ blocking: !0 }), this._previewContainer =
|
|
40
|
+
super(...arguments), this._messages = R({ blocking: !0 }), this._previewContainer = B(), this.toggleScrim = (t) => {
|
|
40
41
|
this.scrimActive = t.detail;
|
|
41
42
|
}, this.checkFlowItem = () => {
|
|
42
43
|
this.flowItem = u(this.el, "calcite-flow-item");
|
|
@@ -49,11 +50,11 @@ class H extends S {
|
|
|
49
50
|
const t = this._previewContainer.value?.getBoundingClientRect();
|
|
50
51
|
if (!t)
|
|
51
52
|
return;
|
|
52
|
-
const { x: e, y: i, height:
|
|
53
|
+
const { x: e, y: i, height: a, right: s, width: n } = t, d = a + i, h = window.innerWidth - document.body.offsetWidth, w = window.innerWidth < n || window.innerWidth < window.outerWidth && window.innerWidth <= n + h;
|
|
53
54
|
this.previewBoundingBox = {
|
|
54
55
|
top: Math.max(i, 0),
|
|
55
56
|
left: e,
|
|
56
|
-
right:
|
|
57
|
+
right: w ? 0 : window.outerWidth - s - h,
|
|
57
58
|
bottom: d > window.innerHeight ? 0 : window.innerHeight - d
|
|
58
59
|
};
|
|
59
60
|
}, this.pageRangeText = "", this.noResults = !1, this.initialHide = !0, this.scrimActive = !1, this.panel = !1, this.preview = !1, this.loading = !1, this.hideContentTop = !1, this.alwaysShowSelection = !1, this.alwaysShowContent = !1, this.response = {
|
|
@@ -62,7 +63,7 @@ class H extends S {
|
|
|
62
63
|
results: [],
|
|
63
64
|
start: 1,
|
|
64
65
|
total: 0
|
|
65
|
-
}, this.store = E(), this.formFactor = "large", this.searchTerm = "", this.height = "full", this.arcgisAriaUpdate = m(), this.arcgisBrowserFilterClear = m(), this.arcgisBrowserFilterRemove = m(), this.ariaUpdate = m();
|
|
66
|
+
}, this.store = E(), this.formFactor = "large", this.searchTerm = "", this.height = "full", this.arcgisAriaUpdate = m(), this.arcgisBrowserFilterClear = m(), this.arcgisBrowserFilterRemove = m(), this.arcgisPreviewClose = m(), this.ariaUpdate = m();
|
|
66
67
|
}
|
|
67
68
|
static {
|
|
68
69
|
this.properties = { pageRangeText: 16, noResults: 16, previewBoundingBox: 16, initialHide: 16, scrimActive: 16, flowItem: 16, panel: 5, preview: 5, loading: 5, hideContentTop: 5, hideTopBar: 5, selected: 0, alwaysShowSelection: 5, alwaysShowContent: 5, response: 0, store: 0, formFactor: 1, searchTerm: 1, height: 3, hideFilters: 5, showPreSearch: 5, rangeFormatter: 0, alwaysShowPagination: 5 };
|
|
@@ -113,36 +114,36 @@ class H extends S {
|
|
|
113
114
|
this.pageRangeText = e, this.arcgisAriaUpdate.emit(i), this.el.dispatchEvent(new CustomEvent("ariaUpdate", { detail: i })), this.noResults = W(this.store) && this.store.recycleBin ? t.results.length === 0 : (t?.total ?? 0) === 0, this.initialHide = !1;
|
|
114
115
|
}
|
|
115
116
|
async updatePageRange(t) {
|
|
116
|
-
const { start: e, end: i, total:
|
|
117
|
+
const { start: e, end: i, total: a } = q(t), s = p.formatNumber(e, { maximumFractionDigits: 0 }), n = p.formatNumber(i, { maximumFractionDigits: 0 }), h = `${p.formatNumber(a, { maximumFractionDigits: 0 })}${a >= 1e4 ? "+" : ""}`, w = p.formatNumber(t.results?.length ?? 0, { maximumFractionDigits: 0 }), x = p.formatNumber(Math.max(Math.ceil(e / Math.max(t.num || 1, 1)), 1), {
|
|
117
118
|
maximumFractionDigits: 0
|
|
118
119
|
});
|
|
119
120
|
if (this.rangeFormatter)
|
|
120
121
|
return await this.rangeFormatter({
|
|
121
|
-
start:
|
|
122
|
-
end:
|
|
122
|
+
start: s,
|
|
123
|
+
end: n,
|
|
123
124
|
total: h,
|
|
124
|
-
results: { items:
|
|
125
|
+
results: { items: w, page: x }
|
|
125
126
|
});
|
|
126
127
|
const b = this._messages.browser.pageRange, _ = this._messages.browser.pageRangeAria, y = g(b, {
|
|
127
|
-
start:
|
|
128
|
-
end:
|
|
128
|
+
start: s,
|
|
129
|
+
end: n,
|
|
129
130
|
total: h
|
|
130
131
|
}), $ = g(_, {
|
|
131
|
-
start:
|
|
132
|
-
end:
|
|
132
|
+
start: s,
|
|
133
|
+
end: n,
|
|
133
134
|
total: h
|
|
134
135
|
});
|
|
135
136
|
return [y, $];
|
|
136
137
|
}
|
|
137
138
|
hasActiveFilter(t) {
|
|
138
|
-
return Object.values(t.filters).filter(({ id: e }) => !
|
|
139
|
+
return Object.values(t.filters).filter(({ id: e }) => !k(z, e)).some((e) => !!e.value || e.id === "collaborations");
|
|
139
140
|
}
|
|
140
141
|
removeFilter(t) {
|
|
141
142
|
const e = this.store.filters[t];
|
|
142
143
|
if (!e)
|
|
143
144
|
return;
|
|
144
|
-
const i = f(e),
|
|
145
|
-
this.store.filters =
|
|
145
|
+
const i = f(e), a = { ...this.store.filters, [t]: i };
|
|
146
|
+
this.store.filters = a, this.arcgisBrowserFilterRemove.emit(t);
|
|
146
147
|
}
|
|
147
148
|
clearFilters() {
|
|
148
149
|
const t = U(this.store.filters, {
|
|
@@ -153,63 +154,65 @@ class H extends S {
|
|
|
153
154
|
}
|
|
154
155
|
renderNoResults() {
|
|
155
156
|
const t = this.noResults && !this.loading && !this.showPreSearch, e = this.hasActiveFilter(this.store) || !!this.searchTerm;
|
|
156
|
-
return t ?
|
|
157
|
+
return t ? r`<div class="cover"><div class="no-results">${e ? r`<slot name=no-results></slot>` : r`<slot name=no-content></slot>`}</div></div>` : null;
|
|
157
158
|
}
|
|
158
159
|
renderPopoverContents(t, e, i) {
|
|
159
|
-
const
|
|
160
|
-
return this.el.style.setProperty("--arcgis-browser-popover-width", i ? "100%" : `${this.store.width || 0}px`), this.el.style.setProperty("--arcgis-browser-popover-height", i ? "100%" : `${
|
|
160
|
+
const a = this.flowItem ? this.flowItem.offsetHeight : this.store.height, s = this.formFactor === "small" && this.hasActiveFilter(this.store) && !this.hideFilters;
|
|
161
|
+
return this.el.style.setProperty("--arcgis-browser-popover-width", i ? "100%" : `${this.store.width || 0}px`), this.el.style.setProperty("--arcgis-browser-popover-height", i ? "100%" : `${a || 0}px`), r`<div class="popover-contents"><div class=${o({ hide: !e, "preview-panel": !0 })}><slot name=preview></slot></div><div class=${o({ hide: !t, "filter-panel": !0 })}><article class="container"><header class="container__header"><h2 class="container__header__text">${this._messages.browser?.refineContent}</h2><calcite-action .text=${this._messages.browser?.close} scale=m icon=x @click=${() => {
|
|
161
162
|
this.store.filtersExpanded = !1;
|
|
162
|
-
}}></calcite-action></header><div class="container__content"><div class="container__content__scroll"><slot name=filters-top></slot>${(this.store.panel || i) &&
|
|
163
|
+
}}></calcite-action></header><div class="container__content"><div class="container__content__scroll"><slot name=filters-top></slot>${(this.store.panel || i) && r`<div class="filter-container__content"><slot name=sort></slot></div>` || ""}<slot name=filters></slot></div></div><div class=${o({ "filter-status--mobile": !0, container__footer: !0, hide: !s })}><arcgis-portal-browser-filter-status class="filter-status" .filters=${this.store.filters} .hiddenFilterIds=${this.store.hiddenFilters || []} .componentWidth=${this.store.width || this.flowItem?.offsetWidth || window.innerWidth} .browserWidth=${window.innerWidth} @arcgisBrowserFilterClear=${() => this.clearFilters()} @arcgisBrowserFilterRemove=${(n) => this.removeFilter(n.detail)}></arcgis-portal-browser-filter-status></div></article></div></div>`;
|
|
163
164
|
}
|
|
164
165
|
renderFlow() {
|
|
165
|
-
const t = !!this.store.panel, e = !!this.store.filtersExpanded && (!this.store.filtersEmpty || !this.store.sortEmpty && t), i = !!this.store.preview,
|
|
166
|
-
return
|
|
166
|
+
const t = !!this.store.panel, e = !!this.store.filtersExpanded && (!this.store.filtersEmpty || !this.store.sortEmpty && t), i = !!this.store.preview, a = !this.store.panel && document.documentElement.clientWidth > (this.store.width || 0);
|
|
167
|
+
return r`<div class=${o({ panel: !0, "panel--fixed": a })}>${!this.hideTopBar && r`<div class=${o({ "top-bar": !0, "top-bar--small": this.formFactor === "small" })}><slot name=top-bar></slot></div>` || ""}<div class="scrolling scrolling--panel"><div class=${o({ "two-up": !0, [this.formFactor]: !0 })}><div class="content"><div><slot name=primary-filter></slot></div><div class="content__start"><slot name=content-start></slot></div>${this.loading && !this.alwaysShowContent && r`<div class="content__view content__view--flex"><div class="cover"><calcite-loader class="loader" label></calcite-loader></div></div>` || ""}${this.noResults && !this.loading && r`<div class="content__view content__view--flex"><div class="cover">${this.renderNoResults()}</div></div>` || ""}<div class=${o({
|
|
167
168
|
hide: this.loading || this.noResults,
|
|
168
169
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
169
170
|
content__view: !0,
|
|
170
171
|
"content__view--panel": !!this.store.panel,
|
|
171
172
|
"content__view--flex": !this.loading && !this.noResults
|
|
172
|
-
})}>${!this.store.panel && !this.hideContentTop &&
|
|
173
|
+
})}>${!this.store.panel && !this.hideContentTop && r`<div class="content__top"><span class=${o({ selection: !0, hide: !this.alwaysShowSelection })}><slot name=selection></slot></span>${!this.loading && r`<span class="range">${this.pageRangeText}</span>` || ""}<span class="actions"><slot name=actions></slot></span><div class="content__top__end"><slot name=view></slot>${!t && r`<slot name=sort></slot>` || ""}</div></div>` || ""}<div class="flow-content"><slot name=content></slot></div><slot name=pagination></slot><slot name=content-end></slot></div></div></div><slot name=scroll-end></slot></div>${!this.store.panel || window.innerWidth < (this.store.width || 0) * 2 ? r`<div class=${o({
|
|
173
174
|
sheet: !0,
|
|
174
175
|
"sheet--active": e || i,
|
|
175
|
-
"sheet--top-bar":
|
|
176
|
-
})}><div class=${
|
|
177
|
-
(!this.store.panel || window.innerWidth < (this.store.width || 0) * 2) && (
|
|
176
|
+
"sheet--top-bar": a
|
|
177
|
+
})}><div class=${o({ sheet__background: !0, "sheet__background--hidden": a })}></div><div class=${o({ sheet__contents: !0, "sheet__contents--full": a })}>${this.renderPopoverContents(e, i, !0)}</div></div>` : r`<calcite-popover overlay-positioning=fixed .open=${i || e} label=filters .referenceElement=${this.flowItem || this.el} offset-skidding=0 offset-distance=0 trigger-disabled pointer-disabled .placement=${this.store.panel ? "trailing" : "auto"} @calcitePopoverOpen=${(s) => {
|
|
178
|
+
(!this.store.panel || window.innerWidth < (this.store.width || 0) * 2) && (s.currentTarget.style.transform = "none");
|
|
178
179
|
}} .focusTrapOptions=${{
|
|
179
|
-
setReturnFocus: (
|
|
180
|
-
if (!(
|
|
181
|
-
return
|
|
182
|
-
const
|
|
183
|
-
return
|
|
180
|
+
setReturnFocus: (s) => {
|
|
181
|
+
if (!(s instanceof HTMLElement))
|
|
182
|
+
return s;
|
|
183
|
+
const n = u(s, "arcgis-portal-item-card, arcgis-portal-group-card");
|
|
184
|
+
return n?.restoreFocus ? (n.restoreFocus(), !1) : s;
|
|
184
185
|
}
|
|
185
186
|
}}>${this.renderPopoverContents(e, i)}</calcite-popover>`}</div>`;
|
|
186
187
|
}
|
|
187
188
|
render() {
|
|
188
|
-
const t = this.height === "auto", e = this.height === "full", i = !!this.store.preview,
|
|
189
|
-
return this.formFactor === "small" ? this.renderFlow() :
|
|
189
|
+
const t = this.height === "auto", e = this.height === "full", i = !!this.store.preview, a = `${(this.store.height || window.innerHeight) - A}px`, s = t ? {} : { maxHeight: a };
|
|
190
|
+
return this.formFactor === "small" ? this.renderFlow() : r`<div class=${o({
|
|
190
191
|
wrapper: !0,
|
|
191
192
|
"wrapper--fixed": !!this.store.filtersExpanded,
|
|
192
193
|
"wrapper--auto": t,
|
|
193
194
|
"wrapper--full": e
|
|
194
|
-
})}>${!this.hideTopBar &&
|
|
195
|
+
})}>${!this.hideTopBar && r`<div class="top-bar"><slot name=top-bar></slot></div>` || ""}<slot name=top-bar-end></slot><div class=${o({ "preview-position": !0, "preview-position--with-top-bar": !this.store.topbarEmpty })} ${C(this._previewContainer)}><arcgis-portal-preview-panel .open=${i} .fixed=${t} @arcgisClose=${(n) => {
|
|
196
|
+
n.stopPropagation(), this.arcgisPreviewClose.emit();
|
|
197
|
+
}} style=${v(t && this.previewBoundingBox ? {
|
|
195
198
|
top: `${this.previewBoundingBox.top || 0}px`,
|
|
196
199
|
...document.dir === "rtl" ? { right: `${this.previewBoundingBox.right || 0}px` } : { left: `${this.previewBoundingBox.left || 0}px` },
|
|
197
200
|
bottom: `${this.previewBoundingBox.bottom || 0}px`
|
|
198
|
-
} : {})}><
|
|
201
|
+
} : {})}><slot name=preview></slot></arcgis-portal-preview-panel></div><div class=${o({ scrolling: !0, "scrolling--full": !t || this.panel })}>${this.scrimActive && r`<calcite-scrim class="scrim__find"></calcite-scrim>` || ""}<div class=${o({ "two-up": !0, "two-up--fullscreen": e, [this.formFactor]: !0 })}><div class=${o({
|
|
199
202
|
filters: !0,
|
|
200
203
|
"filters--sticky": !t,
|
|
201
204
|
"filters--empty": this.store.filtersEmpty && !this.store.preview,
|
|
202
205
|
"filters--active": !!this.store.filtersExpanded
|
|
203
|
-
})} style=${
|
|
206
|
+
})} style=${v(e ? {} : s)}><div class="filters__content" style=${v(e ? {} : s)}><slot name=filters></slot></div></div><div class=${o({ content: !0, "content--full": e })}><div class="content__start"><slot name=content-start></slot></div><div class=${o({
|
|
204
207
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
205
208
|
content__view: !0,
|
|
206
209
|
"content__view--no-filters": this.store.filtersEmpty && !this.store.preview,
|
|
207
210
|
"content__view--flex": !0
|
|
208
|
-
})}>${!this.hideContentTop &&
|
|
211
|
+
})}>${!this.hideContentTop && r`<div class="content__top">${this.showPreSearch ? null : r`<div class="content__top__summary"><span class=${o({ selection: !0, hide: !this.alwaysShowSelection })}><slot name=selection></slot></span>${!this.loading && r`<span class="range">${this.pageRangeText}<slot name=range-end></slot></span>` || ""}</div>`}<span class="actions"><slot name=actions></slot></span><div class="content__top__end"><slot name=view></slot><slot name=sort></slot></div></div>` || ""}${this.loading && (!this.alwaysShowContent || this.initialHide) && r`<div class="cover"><calcite-loader class="loader" .label=${this._messages.browser?.loading ?? ""}></calcite-loader></div>` || ""}${this.renderNoResults()}${!this.loading && this.showPreSearch && r`<div class="cover"><div class="no-results"><slot name=pre-search></slot></div></div>` || ""}<div class=${o({
|
|
209
212
|
hide: !!this.showPreSearch || this.loading && !this.alwaysShowContent || !this.loading && this.noResults || this.initialHide,
|
|
210
213
|
"results-wrapper--spaced": this.hideContentTop,
|
|
211
214
|
"results-wrapper": !0
|
|
212
|
-
})}><slot name=content></slot></div><div class=${
|
|
215
|
+
})}><slot name=content></slot></div><div class=${o({ hide: this.loading || this.noResults && !this.alwaysShowPagination })}><slot name=pagination></slot><slot name=content-end></slot></div></div></div></div><slot name=scroll-end></slot></div></div>`;
|
|
213
216
|
}
|
|
214
217
|
}
|
|
215
218
|
F("arcgis-portal-browser", H);
|