@arcgis/portal-components 5.2.0-next.57 → 5.2.0-next.59
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/2H7Y7RJV.js +2 -0
- package/dist/cdn/32FQ7WJE.js +2 -0
- package/dist/cdn/3Q3EP3BN.js +2 -0
- package/dist/cdn/3VDVNPZ7.js +2 -0
- package/dist/cdn/3WH3ENZP.js +2 -0
- package/dist/cdn/4QA4AYHJ.js +3 -0
- package/dist/cdn/{LDCSQHZX.js → 55FL7WQV.js} +1 -1
- package/dist/cdn/5CT433EX.js +2 -0
- package/dist/cdn/6ROVXNLV.js +2 -0
- package/dist/cdn/7JQ6D224.js +2 -0
- package/dist/cdn/B36VBHAI.js +2 -0
- package/dist/cdn/CFBSBZSS.js +2 -0
- package/dist/cdn/CYEC77HO.js +2 -0
- package/dist/cdn/E6STCC7O.js +2 -0
- package/dist/cdn/EYTAC4Z4.js +2 -0
- package/dist/cdn/{NWIIOJEG.js → FGJNEKPQ.js} +1 -1
- package/dist/cdn/{TUQSWB7B.js → FPYIRCJO.js} +1 -1
- package/dist/cdn/{C4UBEDKI.js → G2NXASJO.js} +1 -1
- package/dist/cdn/{DNMB343K.js → GLDJPWRZ.js} +1 -1
- package/dist/cdn/HHA5STNZ.js +2 -0
- package/dist/cdn/HV3BRK66.js +2 -0
- package/dist/cdn/I5GDSNYE.js +2 -0
- package/dist/cdn/IRK4UW2F.js +2 -0
- package/dist/cdn/IVATGXII.js +2 -0
- package/dist/cdn/IXATTQKO.js +2 -0
- package/dist/cdn/JCIDQZ6X.js +2 -0
- package/dist/cdn/{R3VY2KZV.js → LDRIWXTO.js} +1 -1
- package/dist/cdn/{3PWVEX4V.js → ODJRHB2N.js} +1 -1
- package/dist/cdn/{EJZ55DVU.js → OK75ZZ2M.js} +1 -1
- package/dist/cdn/{DHMH2XFA.js → OTC37DGK.js} +1 -1
- package/dist/cdn/OYX64HG5.js +2 -0
- package/dist/cdn/QS3GXAIH.js +2 -0
- package/dist/cdn/RKT7WCDH.js +2 -0
- package/dist/cdn/RL7X3ACG.js +2 -0
- package/dist/cdn/RZPKVJMB.js +2 -0
- package/dist/cdn/S2JZ5KTI.js +2 -0
- package/dist/cdn/SJGVHRK2.js +2 -0
- package/dist/cdn/SUBBPVRW.js +2 -0
- package/dist/cdn/T7GD53BL.js +2 -0
- package/dist/cdn/{2VLAJOZX.js → TFFZ425X.js} +1 -1
- package/dist/cdn/UDTQ7U6L.js +2 -0
- package/dist/cdn/UPSYDUD6.js +2 -0
- package/dist/cdn/UUSJCAH5.js +2 -0
- package/dist/cdn/UXLENIDB.js +2 -0
- package/dist/cdn/UZCHLKLO.js +2 -0
- package/dist/cdn/VMQIDO4Z.js +2 -0
- package/dist/cdn/WBNJYBQD.js +2 -0
- package/dist/cdn/XSUXR4WJ.js +2 -0
- package/dist/cdn/Z2ZW4FY2.js +2 -0
- package/dist/cdn/ZP6MVFXR.js +2 -0
- package/dist/cdn/{U2QZZSPC.js → ZV4GLQQG.js} +1 -1
- package/dist/cdn/assets/portal-group-browser/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/groups.js +61 -7
- package/dist/chunks/groups2.js +8 -61
- package/dist/chunks/item.js +123 -29
- package/dist/chunks/item2.js +29 -123
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/portal-browser.js +223 -0
- package/dist/chunks/portal.js +48 -40
- package/dist/chunks/portal2.js +50 -24
- package/dist/chunks/query.js +159 -0
- package/dist/chunks/request.js +87 -0
- package/dist/chunks/requests.js +4 -4
- package/dist/chunks/store.js +1 -5
- package/dist/chunks/string.js +19 -14
- package/dist/chunks/thumbnail.js +189 -0
- package/dist/chunks/ui.js +2 -3
- package/dist/chunks/url.js +17 -0
- package/dist/chunks/user.js +96 -13
- package/dist/chunks/user2.js +13 -178
- package/dist/chunks/utils.js +1 -1
- package/dist/components/arcgis-portal-account-switcher/customElement.js +1 -1
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +3 -3
- package/dist/components/arcgis-portal-browser/customElement.d.ts +15 -7
- package/dist/components/arcgis-portal-browser/customElement.js +14 -196
- package/dist/components/arcgis-portal-browser/utils/store.d.ts +4 -4
- package/dist/components/arcgis-portal-browser/utils/types.d.ts +6 -0
- package/dist/components/arcgis-portal-browser-actions/customElement.d.ts +2 -4
- package/dist/components/arcgis-portal-browser-actions/customElement.js +12 -9
- package/dist/components/arcgis-portal-browser-filter/customElement.js +5 -5
- package/dist/components/arcgis-portal-browser-filter-date/customElement.d.ts +5 -5
- package/dist/components/arcgis-portal-browser-filter-date/customElement.js +13 -12
- package/dist/components/arcgis-portal-browser-filter-status/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-pagination/customElement.js +25 -27
- package/dist/components/arcgis-portal-browser-search/customElement.js +1 -4
- package/dist/components/arcgis-portal-browser-top-bar/customElement.d.ts +6 -0
- package/dist/components/arcgis-portal-browser-top-bar/customElement.js +15 -16
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-badges/customElement.d.ts +0 -1
- package/dist/components/arcgis-portal-group-badges/customElement.js +21 -20
- package/dist/components/arcgis-portal-group-browser/customElement.d.ts +301 -0
- package/dist/components/arcgis-portal-group-browser/customElement.js +494 -0
- package/dist/components/arcgis-portal-group-browser/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-browser/index.js +6 -0
- package/dist/components/arcgis-portal-group-browser/types.d.ts +193 -0
- package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +225 -0
- package/dist/components/arcgis-portal-group-browser-preview/customElement.js +150 -0
- package/dist/components/arcgis-portal-group-browser-preview/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-browser-preview/index.js +12 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +82 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +92 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/index.js +6 -0
- package/dist/components/arcgis-portal-group-card/customElement.d.ts +3 -1
- package/dist/components/arcgis-portal-group-card/customElement.js +71 -91
- package/dist/components/arcgis-portal-group-card/index.js +3 -3
- package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +40 -39
- package/dist/components/arcgis-portal-navigation/customElement.js +418 -411
- package/dist/components/arcgis-portal-navigation/index.js +1 -1
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +68 -249
- package/dist/components/arcgis-portal-user-avatar/customElement.js +2 -2
- package/dist/components/arcgis-portal-user-popup/customElement.d.ts +5 -2
- package/dist/components/arcgis-portal-user-popup/customElement.js +4 -3
- package/dist/components/portal-group-browser-filters/customElement.js +104 -0
- package/dist/components/portal-group-browser-filters/index.js +8 -0
- package/dist/components/portal-group-browser-pagination/customElement.js +13 -0
- package/dist/components/portal-group-browser-pagination/index.js +2 -0
- package/dist/components/portal-group-browser-sort/customElement.js +16 -0
- package/dist/components/portal-group-browser-sort/index.js +2 -0
- 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/index.d.ts +36 -0
- package/dist/loader.js +5 -2
- package/dist/types/group.d.ts +6 -8
- package/dist/types/item.d.ts +1 -1
- package/dist/types/lumina.d.ts +32 -0
- package/dist/types/preact.d.ts +35 -0
- package/dist/types/react.d.ts +38 -0
- package/dist/types/search.d.ts +2 -2
- package/dist/types/stencil.d.ts +32 -0
- package/dist/types/user.d.ts +2 -2
- package/package.json +4 -4
- package/dist/cdn/2EJG4DOC.js +0 -2
- package/dist/cdn/2JCFEF3J.js +0 -2
- package/dist/cdn/2WEWH5G3.js +0 -2
- package/dist/cdn/6AGZRMJC.js +0 -2
- package/dist/cdn/6D3PU4ZT.js +0 -2
- package/dist/cdn/7QXIBQV7.js +0 -2
- package/dist/cdn/BJTJP57C.js +0 -2
- package/dist/cdn/BZRM2V6V.js +0 -2
- package/dist/cdn/C2DREZD4.js +0 -2
- package/dist/cdn/CSH3WCYD.js +0 -2
- package/dist/cdn/GKBK32VH.js +0 -2
- package/dist/cdn/GYFQDPCN.js +0 -2
- package/dist/cdn/J46I5HEQ.js +0 -2
- package/dist/cdn/JJ7P5JJ3.js +0 -2
- package/dist/cdn/JZ2ZI5WO.js +0 -2
- package/dist/cdn/LTQA5JRV.js +0 -2
- package/dist/cdn/M5MGOBU3.js +0 -2
- package/dist/cdn/M6X5KCWL.js +0 -2
- package/dist/cdn/OBVMQ64S.js +0 -2
- package/dist/cdn/OGC5YU6V.js +0 -2
- package/dist/cdn/OUN473QW.js +0 -2
- package/dist/cdn/QPFPNUHH.js +0 -2
- package/dist/cdn/R6SSAPLB.js +0 -3
- package/dist/cdn/SJDQS32I.js +0 -2
- package/dist/cdn/UQWELJR5.js +0 -2
- package/dist/cdn/Y4YNN6DS.js +0 -2
- package/dist/cdn/Y5CRBUVL.js +0 -2
- /package/dist/cdn/{AWIVXH7M.js → 5KDFY5KE.js} +0 -0
package/dist/chunks/user2.js
CHANGED
|
@@ -1,185 +1,20 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { f as g, c as P, r as $ } from "./requests.js";
|
|
6
|
-
const l = {}, f = {}, d = {};
|
|
7
|
-
async function y({ requester: e, key: t, id: r, cacheOption: s }) {
|
|
8
|
-
const n = d[t]?.[r]?.expireAt, o = !!n && (/* @__PURE__ */ new Date()).getTime() > n;
|
|
9
|
-
if (l[t]?.[r] && !o)
|
|
10
|
-
return l[t][r];
|
|
11
|
-
f[t] || (f[t] = {}), (!f[t][r] || o) && (f[t][r] = e());
|
|
12
|
-
const i = await f[t][r];
|
|
13
|
-
if (l[t] || (l[t] = {}), d[t] || (d[t] = {}), l[t][r] = i, s) {
|
|
14
|
-
const { expireAfter: a, getExpireAfterFromResult: c } = s, w = c || a ? (/* @__PURE__ */ new Date()).getTime() + (c?.(i) ?? a ?? 0) : null;
|
|
15
|
-
d[t][r] = { ...d[t][r], expireAt: w };
|
|
16
|
-
}
|
|
17
|
-
return i;
|
|
2
|
+
function i(e, n) {
|
|
3
|
+
const { fullName: u, firstName: r, lastName: t, username: s } = e;
|
|
4
|
+
return u || (r && t ? n === "ja" ? `${t} ${r}` : `${r} ${t}` : s);
|
|
18
5
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
portal: t,
|
|
22
|
-
params: r = {},
|
|
23
|
-
options: s = {},
|
|
24
|
-
method: n,
|
|
25
|
-
abortControllerId: o,
|
|
26
|
-
excludeJson: i
|
|
27
|
-
}) {
|
|
28
|
-
const a = v(o)?.signal, { customToken: c, addTokenManually: w, addSSL: S, useProxy: T } = s, m = { ...r };
|
|
29
|
-
if (!e.includes("f=") && !i && (m.f = "json"), c)
|
|
30
|
-
m.token = c;
|
|
31
|
-
else if (w !== !1) {
|
|
32
|
-
const A = await E(t);
|
|
33
|
-
A && (m.token = A);
|
|
34
|
-
}
|
|
35
|
-
const x = S ? O(e, t) : e, C = {
|
|
36
|
-
query: m,
|
|
37
|
-
method: n || "auto",
|
|
38
|
-
...s,
|
|
39
|
-
timeout: s.timeout || 0,
|
|
40
|
-
useProxy: T,
|
|
41
|
-
...s?.disableIdentityLookup ? { authMode: "anonymous" } : {}
|
|
42
|
-
}, L = await U(x, { signal: a, ...C });
|
|
43
|
-
return o && (p[o] = void 0), L.data;
|
|
6
|
+
function a(e) {
|
|
7
|
+
return e && !e.id;
|
|
44
8
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (e)
|
|
48
|
-
return p[e] && p[e].abort(), p[e] = new AbortController(), p[e];
|
|
9
|
+
function c(e) {
|
|
10
|
+
return e?.sourceJSON?.privileges?.includes("portal:user:createItem");
|
|
49
11
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (!e?.isPortal || !t)
|
|
53
|
-
return k(e);
|
|
54
|
-
const r = e?.user;
|
|
55
|
-
if (!r && t)
|
|
56
|
-
return;
|
|
57
|
-
const { token: s } = await y({
|
|
58
|
-
requester: async () => await M(e),
|
|
59
|
-
key: "platformSelf",
|
|
60
|
-
id: r?.id ?? e.id ?? "<unknown>",
|
|
61
|
-
cacheOption: { getExpireAfterFromResult: (n) => n.expires_in }
|
|
62
|
-
});
|
|
63
|
-
return s;
|
|
64
|
-
}
|
|
65
|
-
const M = async (e) => {
|
|
66
|
-
const r = {
|
|
67
|
-
"X-Esri-Auth-Client-Id": await F(e),
|
|
68
|
-
"X-Esri-Auth-Redirect-Uri": window.location.href.replace(/#.*$/u, "")
|
|
69
|
-
};
|
|
70
|
-
return (await U(`${h(e)}/oauth2/platformSelf`, {
|
|
71
|
-
authMode: "no-prompt",
|
|
72
|
-
headers: r,
|
|
73
|
-
withCredentials: !0,
|
|
74
|
-
method: "post"
|
|
75
|
-
})).data;
|
|
76
|
-
}, F = async (e) => (await y({
|
|
77
|
-
requester: async () => await b.getCredential(h(e), { oAuthPopupConfirmation: !1 }),
|
|
78
|
-
key: "credential",
|
|
79
|
-
id: e.user?.id ?? "<unknown>"
|
|
80
|
-
})).oAuthState?.appId ?? "arcgisonline";
|
|
81
|
-
function O(e, t) {
|
|
82
|
-
return window.location.protocol === "https:" || t.allSSL ? e.replace("http:", "https:") : e;
|
|
83
|
-
}
|
|
84
|
-
async function W(e, t, r) {
|
|
85
|
-
const n = `${r ? "https://www.arcgis.com/sharing/rest/" : h(t)}community/users/${e}`, o = n?.includes("www.arcgis.com") && t.isPortal, i = n?.includes(".arcgis.com") && !t.isPortal && !t.user, a = o || i ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
|
|
86
|
-
return await y({
|
|
87
|
-
requester: async () => {
|
|
88
|
-
try {
|
|
89
|
-
return await q({ url: n, portal: t, options: a });
|
|
90
|
-
} catch {
|
|
91
|
-
return { username: e };
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
key: "user",
|
|
95
|
-
id: n
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const X = async (e) => {
|
|
99
|
-
const t = `${h(e)}/portals/${e.id}/users`;
|
|
100
|
-
return await q({
|
|
101
|
-
url: t,
|
|
102
|
-
portal: e,
|
|
103
|
-
params: {
|
|
104
|
-
// TODO: Add pagination
|
|
105
|
-
num: 100,
|
|
106
|
-
sortField: "lastlogin",
|
|
107
|
-
sortOrder: "desc"
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
function u(e, t) {
|
|
112
|
-
return `${e.restUrl}/community/users/${t?.id || e?.user?.id}`;
|
|
113
|
-
}
|
|
114
|
-
async function H(e, t) {
|
|
115
|
-
const r = `${u(e, t)}/properties`;
|
|
116
|
-
return await $(r);
|
|
117
|
-
}
|
|
118
|
-
async function J(e, t, r) {
|
|
119
|
-
const s = `${u(t, r)}/setProperties`, n = k(t), o = new FormData();
|
|
120
|
-
return o.append("properties", JSON.stringify(e)), o.append("token", n), o.append("f", "json"), await $(s, {
|
|
121
|
-
method: "post",
|
|
122
|
-
body: o
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
async function N(e, t) {
|
|
126
|
-
const r = `${u(e, t)}/provisionedListings`;
|
|
127
|
-
return await g(
|
|
128
|
-
r,
|
|
129
|
-
{ returnAppClientIds: !0, returnAllProvisions: !0 },
|
|
130
|
-
"provisionedListings"
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
async function _(e, t) {
|
|
134
|
-
const r = `${u(e, t)}/linkedUsers`;
|
|
135
|
-
try {
|
|
136
|
-
return await g(r, { num: 10 }, "linkedUsers");
|
|
137
|
-
} catch (s) {
|
|
138
|
-
return console.error("Error fetching linked accounts:", s), [];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
async function z(e, t, r) {
|
|
142
|
-
try {
|
|
143
|
-
return await g(
|
|
144
|
-
`https://${e.portalHostname}/sharing/rest/community/users/${t}/linkedUsers`,
|
|
145
|
-
{ num: 10, token: r },
|
|
146
|
-
"linkedUsers"
|
|
147
|
-
);
|
|
148
|
-
} catch (s) {
|
|
149
|
-
return console.error(s), [];
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
async function G({
|
|
153
|
-
portal: e,
|
|
154
|
-
user: t,
|
|
155
|
-
targetUser: r,
|
|
156
|
-
targetToken: s
|
|
157
|
-
}) {
|
|
158
|
-
const n = `${u(e, t)}/linkUser`, o = await P(n, {
|
|
159
|
-
method: "post",
|
|
160
|
-
query: { user: r, userToken: s }
|
|
161
|
-
});
|
|
162
|
-
return o.error && console.error(o.error), o;
|
|
163
|
-
}
|
|
164
|
-
async function K({
|
|
165
|
-
portal: e,
|
|
166
|
-
user: t,
|
|
167
|
-
linkedUsername: r
|
|
168
|
-
}) {
|
|
169
|
-
const s = `${u(e, t)}/unlinkUser`, n = await P(s, { method: "post", query: { user: r } });
|
|
170
|
-
return n.error && console.error(n.error), n;
|
|
12
|
+
function o(e) {
|
|
13
|
+
return e?.sourceJSON?.privileges?.includes("premium:publisher:createNotebooks");
|
|
171
14
|
}
|
|
172
15
|
export {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
N as e,
|
|
178
|
-
W as f,
|
|
179
|
-
z as g,
|
|
180
|
-
H as h,
|
|
181
|
-
E as i,
|
|
182
|
-
G as l,
|
|
183
|
-
q as r,
|
|
184
|
-
K as u
|
|
16
|
+
o as a,
|
|
17
|
+
c,
|
|
18
|
+
i as g,
|
|
19
|
+
a as i
|
|
185
20
|
};
|
package/dist/chunks/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { u as f, i as S, a as M, b as A, c as x, d as C, e as j, f as G } from "./
|
|
2
|
+
import { u as f, i as S, a as M, b as A, c as x, d as C, e as j, f as G } from "./item.js";
|
|
3
3
|
const L = (r) => typeof r?.role == "string" && r?.role ? r?.role : r?.roleId ?? r?.sourceJSON?.id;
|
|
4
4
|
function v(r) {
|
|
5
5
|
return r ? ["org_admin", "account_admin"].includes(L(r)) && !r?.roleId : !1;
|
|
@@ -3,7 +3,7 @@ import { c as y } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { LitElement as S, createEvent as b, nothing as L } from "@arcgis/lumina";
|
|
4
4
|
import { html as d, svg as _ } from "lit";
|
|
5
5
|
import { s as O } from "../../chunks/portal-account-switcher.js";
|
|
6
|
-
import { g as x, a as I, l as v, u as C } from "../../chunks/
|
|
6
|
+
import { g as x, a as I, l as v, u as C } from "../../chunks/user.js";
|
|
7
7
|
import p from "@arcgis/core/identity/IdentityManager.js";
|
|
8
8
|
import { t as E } from "../../chunks/functionalities.js";
|
|
9
9
|
import { u as M } from "../../chunks/useT9n.js";
|
|
@@ -8,13 +8,13 @@ import { a as C, t as yt, b as wt } from "../../chunks/functionalities.js";
|
|
|
8
8
|
import { NodeInterrupt as W, Annotation as y, StateGraph as N, START as P, END as w } from "@langchain/langgraph/web";
|
|
9
9
|
import { sendTraceMessage as g, invokeStructuredPrompt as v, sendUXSuggestion as E, createAgentRuntimeStateWithSharedState as k, createChatModel as D } from "@arcgis/ai-components/utils/index.js";
|
|
10
10
|
import n from "zod";
|
|
11
|
-
import { a as bt, c as vt, q as It } from "../../chunks/
|
|
11
|
+
import { a as bt, c as vt, q as It } from "../../chunks/groups.js";
|
|
12
12
|
import xt from "@arcgis/core/identity/IdentityManager.js";
|
|
13
13
|
import F from "@arcgis/core/request.js";
|
|
14
14
|
import { ChatPromptTemplate as U } from "@langchain/core/prompts";
|
|
15
15
|
import { tool as Y } from "@langchain/core/tools";
|
|
16
|
-
import { s as St, a as Mt } from "../../chunks/
|
|
17
|
-
import {
|
|
16
|
+
import { s as St, a as Mt } from "../../chunks/item2.js";
|
|
17
|
+
import { g as Gt, e as Tt, i as At, c as Ct, a as Nt } from "../../chunks/groups2.js";
|
|
18
18
|
const H = (a) => {
|
|
19
19
|
const { portal: t, user: e } = a ?? {};
|
|
20
20
|
return !!a && !!t && !!e;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
-
import type { SearchResultGroup } from "../../types/group.js";
|
|
4
|
-
import type { SearchResultItem } from "../../types/item.js";
|
|
5
|
-
import type { SearchResult } from "../../types/search.js";
|
|
6
|
-
import type { SearchResultUser } from "../../types/user.js";
|
|
7
3
|
import type { PortalBrowserStore } from "./utils/store.js";
|
|
8
|
-
import type { RangeFormatter } from "./utils/types.js";
|
|
4
|
+
import type { BrowserContent, RangeFormatter } from "./utils/types.js";
|
|
9
5
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
10
6
|
|
|
11
7
|
export abstract class ArcgisPortalBrowser extends LitElement {
|
|
@@ -217,19 +213,31 @@ export abstract class ArcgisPortalBrowser extends LitElement {
|
|
|
217
213
|
/** @default false */
|
|
218
214
|
accessor preview: boolean;
|
|
219
215
|
accessor rangeFormatter: RangeFormatter | undefined;
|
|
220
|
-
accessor response:
|
|
216
|
+
accessor response: PortalBrowserSearchResponse;
|
|
221
217
|
/** @default "" */
|
|
222
218
|
accessor searchTerm: string;
|
|
223
|
-
accessor selected:
|
|
219
|
+
accessor selected: BrowserContent | undefined;
|
|
224
220
|
/** @default false */
|
|
225
221
|
accessor showPreSearch: boolean | undefined;
|
|
226
222
|
accessor store: PortalBrowserStore;
|
|
227
223
|
scrollToTop(): Promise<void>;
|
|
228
224
|
readonly arcgisAriaUpdate: import("@arcgis/lumina").TargetedEvent<this, string>;
|
|
225
|
+
readonly arcgisBrowserFilterClear: import("@arcgis/lumina").TargetedEvent<this, null>;
|
|
226
|
+
readonly arcgisBrowserFilterRemove: import("@arcgis/lumina").TargetedEvent<this, string>;
|
|
229
227
|
/** @deprecated Use arcgisAriaUpdate instead. */
|
|
230
228
|
readonly ariaUpdate: import("@arcgis/lumina").TargetedEvent<this, string>;
|
|
231
229
|
readonly "@eventTypes": {
|
|
232
230
|
arcgisAriaUpdate: ArcgisPortalBrowser["arcgisAriaUpdate"]["detail"];
|
|
231
|
+
arcgisBrowserFilterClear: ArcgisPortalBrowser["arcgisBrowserFilterClear"]["detail"];
|
|
232
|
+
arcgisBrowserFilterRemove: ArcgisPortalBrowser["arcgisBrowserFilterRemove"]["detail"];
|
|
233
233
|
ariaUpdate: ArcgisPortalBrowser["ariaUpdate"]["detail"];
|
|
234
234
|
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface PortalBrowserSearchResponse {
|
|
238
|
+
nextStart?: number;
|
|
239
|
+
num: number;
|
|
240
|
+
start: number;
|
|
241
|
+
total: number;
|
|
242
|
+
results: unknown[];
|
|
235
243
|
}
|
|
@@ -1,201 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import "../arcgis-portal-browser-filter/customElement.js";
|
|
2
|
+
import "../../chunks/runtime.js";
|
|
3
|
+
import "@arcgis/core/core/reactiveUtils.js";
|
|
4
|
+
import "@arcgis/core/intl.js";
|
|
5
|
+
import "@arcgis/lumina";
|
|
6
|
+
import "lit";
|
|
7
|
+
import "lit/directives/ref.js";
|
|
8
|
+
import "../../chunks/useT9n.js";
|
|
9
|
+
import "../../chunks/dom.js";
|
|
10
|
+
import "../../chunks/functionalities.js";
|
|
12
11
|
import "../arcgis-portal-browser-filter-date/customElement.js";
|
|
13
|
-
import "../arcgis-portal-browser-filters/customElement.js";
|
|
14
12
|
import "../arcgis-portal-browser-filter-status/customElement.js";
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!t || !e)
|
|
20
|
-
return { start: 0, end: 0, total: t };
|
|
21
|
-
const i = Math.max(h?.start ?? 1, 1), s = Math.min(i + e - 1, t);
|
|
22
|
-
return { start: i, end: s, total: t };
|
|
23
|
-
}
|
|
24
|
-
const U = 49;
|
|
25
|
-
class q extends $ {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments), this._messages = k({ blocking: !0 }), this._previewContainer = S(), this.toggleScrim = (t) => {
|
|
28
|
-
this.scrimActive = t.detail;
|
|
29
|
-
}, this.checkFlowItem = () => {
|
|
30
|
-
this.flowItem = g(this.el, "calcite-flow-item");
|
|
31
|
-
}, this.handleResize = () => {
|
|
32
|
-
requestAnimationFrame(this.updatePreviewPosition);
|
|
33
|
-
}, this.updatePreviewPosition = () => {
|
|
34
|
-
if (this.formFactor === "small" || this.height !== "auto" || !this._previewContainer)
|
|
35
|
-
return;
|
|
36
|
-
this.checkFlowItem();
|
|
37
|
-
const t = this._previewContainer.value?.getBoundingClientRect();
|
|
38
|
-
if (!t)
|
|
39
|
-
return;
|
|
40
|
-
const { x: e, y: i, height: s, right: a, width: l } = t, p = s + i, d = window.innerWidth - document.body.offsetWidth, m = window.innerWidth < l || window.innerWidth < window.outerWidth && window.innerWidth <= l + d;
|
|
41
|
-
this.previewBoundingBox = {
|
|
42
|
-
top: Math.max(i, 0),
|
|
43
|
-
left: e,
|
|
44
|
-
right: m ? 0 : window.outerWidth - a - d,
|
|
45
|
-
bottom: p > window.innerHeight ? 0 : window.innerHeight - p
|
|
46
|
-
};
|
|
47
|
-
}, 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 = {
|
|
48
|
-
nextStart: -1,
|
|
49
|
-
num: 0,
|
|
50
|
-
results: [],
|
|
51
|
-
start: 1,
|
|
52
|
-
total: 0
|
|
53
|
-
}, this.store = R(), this.formFactor = "large", this.searchTerm = "", this.height = "full", this.api = 4, this.arcgisAriaUpdate = w(), this.ariaUpdate = w();
|
|
54
|
-
}
|
|
55
|
-
static {
|
|
56
|
-
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, api: 9 };
|
|
57
|
-
}
|
|
58
|
-
static {
|
|
59
|
-
this.styles = W;
|
|
60
|
-
}
|
|
61
|
-
async scrollToTop() {
|
|
62
|
-
this.renderRoot.querySelector(".top-bar")?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
63
|
-
}
|
|
64
|
-
connectedCallback() {
|
|
65
|
-
super.connectedCallback(), window.addEventListener("scroll", this.handleResize), window.addEventListener("resize", this.handleResize), this.el.addEventListener("arcgisItemBrowserScrimToggle", this.toggleScrim), this.checkFlowItem(), this.attachStoreWatchers();
|
|
66
|
-
}
|
|
67
|
-
willUpdate(t) {
|
|
68
|
-
t.has("store") && this.attachStoreWatchers(), t.has("response") && this.updatePage(this.response);
|
|
69
|
-
}
|
|
70
|
-
firstUpdated() {
|
|
71
|
-
requestAnimationFrame(this.updatePreviewPosition);
|
|
72
|
-
}
|
|
73
|
-
disconnectedCallback() {
|
|
74
|
-
this.removePreviewWatcher?.(), this.removeStoreWatcher?.(), window.removeEventListener("resize", this.handleResize), window.removeEventListener("scroll", this.handleResize), this.el.removeEventListener("arcgisItemBrowserScrimToggle", this.toggleScrim), super.disconnectedCallback();
|
|
75
|
-
}
|
|
76
|
-
attachStoreWatchers() {
|
|
77
|
-
if (this.removePreviewWatcher?.(), this.removeStoreWatcher?.(), !this.store)
|
|
78
|
-
return;
|
|
79
|
-
this.removePreviewWatcher = C(this.store, this.updatePreviewPosition);
|
|
80
|
-
const t = [
|
|
81
|
-
n(() => this.store.type, () => this.requestUpdate()),
|
|
82
|
-
n(() => this.store.width, () => this.requestUpdate()),
|
|
83
|
-
n(() => this.store.height, () => this.requestUpdate()),
|
|
84
|
-
n(() => this.store.filtersEmpty, () => this.requestUpdate()),
|
|
85
|
-
n(() => this.store.topbarEmpty, () => this.requestUpdate()),
|
|
86
|
-
n(() => this.store.sortEmpty, () => this.requestUpdate()),
|
|
87
|
-
n(() => this.store.filtersExpanded, () => this.requestUpdate()),
|
|
88
|
-
n(() => this.store.panel, () => this.requestUpdate()),
|
|
89
|
-
n(() => this.store.preview, () => this.requestUpdate()),
|
|
90
|
-
n(() => this.store.searchTerm, () => this.requestUpdate()),
|
|
91
|
-
n(() => this.store.hiddenFilters, () => this.requestUpdate()),
|
|
92
|
-
n(() => this.store.filters, () => this.requestUpdate()),
|
|
93
|
-
n(() => this.store.recycleBin, () => this.requestUpdate())
|
|
94
|
-
];
|
|
95
|
-
this.removeStoreWatcher = () => {
|
|
96
|
-
t.forEach((e) => e.remove());
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
async updatePage(t) {
|
|
100
|
-
const [e, i] = await this.updatePageRange(t);
|
|
101
|
-
this.pageRangeText = e, this.arcgisAriaUpdate.emit(i), this.el.dispatchEvent(new CustomEvent("ariaUpdate", { detail: i })), this.noResults = E(this.store) && this.store.recycleBin ? t.results.length === 0 : (t?.total ?? 0) === 0, this.initialHide = !1;
|
|
102
|
-
}
|
|
103
|
-
async updatePageRange(t) {
|
|
104
|
-
const { start: e, end: i, total: s } = z(t), a = c.formatNumber(e, { maximumFractionDigits: 0 }), l = c.formatNumber(i, { maximumFractionDigits: 0 }), d = `${c.formatNumber(s, { maximumFractionDigits: 0 })}${s >= 1e4 ? "+" : ""}`, m = c.formatNumber(t.results?.length ?? 0, { maximumFractionDigits: 0 }), u = c.formatNumber(Math.max(Math.ceil(e / Math.max(t.num || 1, 1)), 1), {
|
|
105
|
-
maximumFractionDigits: 0
|
|
106
|
-
});
|
|
107
|
-
if (this.rangeFormatter)
|
|
108
|
-
return await this.rangeFormatter({
|
|
109
|
-
start: a,
|
|
110
|
-
end: l,
|
|
111
|
-
total: d,
|
|
112
|
-
results: { items: m, page: u }
|
|
113
|
-
});
|
|
114
|
-
const f = this._messages.browser.pageRange, x = this._messages.browser.pageRangeAria, b = f.replace("${start}", a).replace("${end}", l).replace("${total}", d), _ = x.replace("${start}", a).replace("${end}", l).replace("${total}", d);
|
|
115
|
-
return [b, _];
|
|
116
|
-
}
|
|
117
|
-
hasActiveFilter(t) {
|
|
118
|
-
return Object.values(t.filters).filter(({ id: e }) => !B(T, e)).some((e) => !!e.value || e.id === "collaborations");
|
|
119
|
-
}
|
|
120
|
-
removeFilter(t) {
|
|
121
|
-
const e = this.store.filters[t];
|
|
122
|
-
if (!e)
|
|
123
|
-
return;
|
|
124
|
-
const i = { ...e, value: void 0 };
|
|
125
|
-
"additionalParams" in e && (i.additionalParams = void 0);
|
|
126
|
-
const s = { ...this.store.filters, [t]: i };
|
|
127
|
-
this.store.filters = s;
|
|
128
|
-
}
|
|
129
|
-
clearFilters() {
|
|
130
|
-
const t = Object.entries(this.store.filters).reduce((e, [i, s]) => this.store.hiddenFilters?.includes(i) || s.id === "folder" || s.id === "group" || s.id === "contentType" ? (e[i] = s, e) : (e[i] = {
|
|
131
|
-
...s,
|
|
132
|
-
value: void 0,
|
|
133
|
-
..."additionalParams" in s ? { additionalParams: void 0 } : {}
|
|
134
|
-
}, e), {});
|
|
135
|
-
this.store.filters = t;
|
|
136
|
-
}
|
|
137
|
-
renderNoResults() {
|
|
138
|
-
const t = this.noResults && !this.loading && !this.showPreSearch, e = this.hasActiveFilter(this.store) || !!this.searchTerm;
|
|
139
|
-
return t ? o`<div class="cover"><div class="no-results">${e ? o`<slot name=no-results></slot>` : o`<slot name=no-content></slot>`}</div></div>` : null;
|
|
140
|
-
}
|
|
141
|
-
renderPopoverContents(t, e, i) {
|
|
142
|
-
const s = this.flowItem ? this.flowItem.offsetHeight : this.store.height, a = this.formFactor === "small" && this.hasActiveFilter(this.store) && !this.hideFilters;
|
|
143
|
-
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%" : `${s || 0}px`), o`<div class="popover-contents"><div class=${r({ hide: !e, "preview-panel": !0 })}><slot name=preview></slot></div><div class=${r({ 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=${() => {
|
|
144
|
-
this.store.filtersExpanded = !1;
|
|
145
|
-
}}></calcite-action></header><div class="container__content"><div class="container__content__scroll"><slot name=filters-top></slot>${(this.store.panel || i) && o`<div class="filter-container__content"><slot name=sort></slot></div>` || ""}<slot name=filters></slot></div></div><div class=${r({ "filter-status--mobile": !0, container__footer: !0, hide: !a })}><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=${(l) => this.removeFilter(l.detail)}></arcgis-portal-browser-filter-status></div></article></div></div>`;
|
|
146
|
-
}
|
|
147
|
-
renderFlow() {
|
|
148
|
-
const t = !!this.store.panel, e = !!this.store.filtersExpanded && (!this.store.filtersEmpty || !this.store.sortEmpty && t), i = !!this.store.preview, s = !this.store.panel && document.documentElement.clientWidth > (this.store.width || 0);
|
|
149
|
-
return o`<div class=${r({ panel: !0, "panel--fixed": s })}>${!this.hideTopBar && o`<div class=${r({ "top-bar": !0, "top-bar--small": this.formFactor === "small" })}><slot name=top-bar></slot></div>` || ""}<div class="scrolling scrolling--panel"><div class=${r({ "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 && o`<div class="content__view content__view--flex"><div class="cover"><calcite-loader class="loader" label></calcite-loader></div></div>` || ""}${this.noResults && !this.loading && o`<div class="content__view content__view--flex"><div class="cover">${this.renderNoResults()}</div></div>` || ""}<div class=${r({
|
|
150
|
-
hide: this.loading || this.noResults,
|
|
151
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
152
|
-
content__view: !0,
|
|
153
|
-
"content__view--panel": !!this.store.panel,
|
|
154
|
-
"content__view--flex": !this.loading && !this.noResults
|
|
155
|
-
})}>${!this.store.panel && !this.hideContentTop && o`<div class="content__top"><span class=${r({ selection: !0, hide: !this.alwaysShowSelection })}><slot name=selection></slot></span>${!this.loading && o`<span class="range">${this.pageRangeText}</span>` || ""}<span class="actions"><slot name=actions></slot></span><div class="content__top__end"><slot name=view></slot>${!t && o`<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 ? o`<div class=${r({
|
|
156
|
-
sheet: !0,
|
|
157
|
-
"sheet--active": e || i,
|
|
158
|
-
"sheet--top-bar": s
|
|
159
|
-
})}><div class=${r({ sheet__background: !0, "sheet__background--hidden": s })}></div><div class=${r({ sheet__contents: !0, "sheet__contents--full": s })}>${this.renderPopoverContents(e, i, !0)}</div></div>` : o`<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=${(a) => {
|
|
160
|
-
(!this.store.panel || window.innerWidth < (this.store.width || 0) * 2) && (a.currentTarget.style.transform = "none");
|
|
161
|
-
}} .focusTrapOptions=${{
|
|
162
|
-
setReturnFocus: (a) => {
|
|
163
|
-
if (!(a instanceof HTMLElement))
|
|
164
|
-
return a;
|
|
165
|
-
const l = g(a, "arcgis-portal-item-card, arcgis-portal-group-card");
|
|
166
|
-
return l?.restoreFocus ? (l.restoreFocus(), !1) : a;
|
|
167
|
-
}
|
|
168
|
-
}}>${this.renderPopoverContents(e, i)}</calcite-popover>`}</div>`;
|
|
169
|
-
}
|
|
170
|
-
render() {
|
|
171
|
-
const t = this.height === "auto", e = this.height === "full", i = `${(this.store.height || window.innerHeight) - U}px`, s = t ? {} : { maxHeight: i };
|
|
172
|
-
return this.formFactor === "small" ? this.renderFlow() : o`<div class=${r({
|
|
173
|
-
wrapper: !0,
|
|
174
|
-
"wrapper--fixed": !!this.store.filtersExpanded,
|
|
175
|
-
"wrapper--auto": t,
|
|
176
|
-
"wrapper--full": e
|
|
177
|
-
})}>${!this.hideTopBar && o`<div class="top-bar"><slot name=top-bar></slot></div>` || ""}<slot name=top-bar-end></slot><div class=${r({ "preview-position": !0, "preview-position--with-top-bar": !this.store.topbarEmpty })} ${P(this._previewContainer)}><div class=${r({ preview: !0, "preview--active": !!this.store.preview, "preview--fixed": t })} style=${v(t && this.previewBoundingBox ? {
|
|
178
|
-
top: `${this.previewBoundingBox.top || 0}px`,
|
|
179
|
-
...document.dir === "rtl" ? { right: `${this.previewBoundingBox.right || 0}px` } : { left: `${this.previewBoundingBox.left || 0}px` },
|
|
180
|
-
bottom: `${this.previewBoundingBox.bottom || 0}px`
|
|
181
|
-
} : {})}><div class=${r({ pane: !0, "pane--open": !!this.store.preview })}><div class="preview-desktop"><slot name=preview></slot></div></div></div></div><div class=${r({ scrolling: !0, "scrolling--full": !t || this.panel })}>${this.scrimActive && o`<calcite-scrim class="scrim__find"></calcite-scrim>` || ""}<div class=${r({ "two-up": !0, "two-up--fullscreen": e, [this.formFactor]: !0 })}><div class=${r({
|
|
182
|
-
filters: !0,
|
|
183
|
-
"filters--sticky": !t,
|
|
184
|
-
"filters--empty": this.store.filtersEmpty && !this.store.preview,
|
|
185
|
-
"filters--active": !!this.store.filtersExpanded
|
|
186
|
-
})} style=${v(e ? {} : s)}><div class="filters__content" style=${v(e ? {} : s)}><slot name=filters></slot></div></div><div class=${r({ content: !0, "content--full": e })}><div class="content__start"><slot name=content-start></slot></div><div class=${r({
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
188
|
-
content__view: !0,
|
|
189
|
-
"content__view--no-filters": this.store.filtersEmpty && !this.store.preview,
|
|
190
|
-
"content__view--flex": !0
|
|
191
|
-
})}>${!this.hideContentTop && o`<div class="content__top">${this.showPreSearch ? null : o`<div class="content__top__summary"><span class=${r({ selection: !0, hide: !this.alwaysShowSelection })}><slot name=selection></slot></span>${!this.loading && o`<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) && o`<div class="cover"><calcite-loader class="loader" .label=${this._messages.browser?.loading ?? ""}></calcite-loader></div>` || ""}${this.renderNoResults()}${!this.loading && this.showPreSearch && o`<div class="cover"><div class="no-results"><slot name=pre-search></slot></div></div>` || ""}<div class=${r({
|
|
192
|
-
hide: !!this.showPreSearch || this.loading && !this.alwaysShowContent || !this.loading && this.noResults || this.initialHide,
|
|
193
|
-
"results-wrapper--spaced": this.hideContentTop,
|
|
194
|
-
"results-wrapper": !0
|
|
195
|
-
})}><slot name=content></slot></div><div class=${r({ 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>`;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
y("arcgis-portal-browser", q);
|
|
13
|
+
import "../arcgis-portal-browser-filter/customElement.js";
|
|
14
|
+
import "../arcgis-portal-browser-filters/customElement.js";
|
|
15
|
+
import { A as B } from "../../chunks/portal-browser.js";
|
|
16
|
+
import "../../chunks/store.js";
|
|
199
17
|
export {
|
|
200
|
-
|
|
18
|
+
B as ArcgisPortalBrowser
|
|
201
19
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type Accessor from "@arcgis/core/core/Accessor.js";
|
|
2
2
|
import type { Accordion as Accordion } from "@esri/calcite-components/components/calcite-accordion";
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface PortalBrowserFilterDetail<T = unknown> {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
7
|
-
value:
|
|
7
|
+
value: T;
|
|
8
8
|
additionalParams?: unknown;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
|
|
11
11
|
export type PortalBrowserStore = ReturnType<typeof createPortalBrowserStore>;
|
|
12
12
|
|
|
13
13
|
/** @param initialState */
|
|
14
|
-
export function createPortalBrowserStore(initialState?:
|
|
14
|
+
export function createPortalBrowserStore<Type extends PortalBrowserState>(initialState?: PortalBrowserState): Accessor & Type;
|
|
15
15
|
|
|
16
16
|
export interface PortalBrowserState {
|
|
17
17
|
type?: "group-browser" | "item-browser" | "member-browser";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import type PortalGroup from "@arcgis/core/portal/PortalGroup.js";
|
|
2
|
+
import type { ItemSourceJSON } from "../../../types/item.js";
|
|
3
|
+
import type { SearchResultUser } from "../../../types/user.js";
|
|
4
|
+
|
|
1
5
|
/** @param input */
|
|
2
6
|
export type RangeFormatter = (input: RangeFormatInput) => Promise<[string, string]>;
|
|
3
7
|
|
|
8
|
+
export type BrowserContent = ItemSourceJSON[] | PortalGroup[] | SearchResultUser[];
|
|
9
|
+
|
|
4
10
|
export interface BrowserPageDetail {
|
|
5
11
|
start: number;
|
|
6
12
|
total: number;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
-
import type {
|
|
4
|
-
import type { SearchResultItem } from "../../types/item.js";
|
|
5
|
-
import type { SearchResultUser } from "../../types/user.js";
|
|
3
|
+
import type { BrowserContent } from "../arcgis-portal-browser/utils/types.js";
|
|
6
4
|
import type { PortalBrowserAction } from "./types.js";
|
|
7
5
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
8
6
|
|
|
@@ -182,6 +180,6 @@ export abstract class ArcgisPortalBrowserActions extends LitElement {
|
|
|
182
180
|
};
|
|
183
181
|
}>;
|
|
184
182
|
accessor actions: PortalBrowserAction[];
|
|
185
|
-
accessor selection:
|
|
183
|
+
accessor selection: BrowserContent | undefined;
|
|
186
184
|
restoreFocus(): Promise<void>;
|
|
187
185
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as d } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as u, nothing as m } from "@arcgis/lumina";
|
|
4
4
|
import { css as p, html as s } from "lit";
|
|
5
|
-
import { createRef as
|
|
5
|
+
import { createRef as c, ref as l } from "lit/directives/ref.js";
|
|
6
6
|
import { u as v } from "../../chunks/useT9n.js";
|
|
7
7
|
import { t as f } from "../../chunks/functionalities.js";
|
|
8
8
|
const w = p`:host{display:flex;justify-content:flex-end;margin-inline:1rem;position:relative}.wrapper{padding-inline-start:.25rem;display:flex;border-inline-start:1px solid var(--calcite-color-border-1);border-inline-end:1px solid var(--calcite-color-border-1)}.tooltip-container{width:9rem}.button{margin-inline-end:.25rem}.measure-container{position:absolute;width:100%;height:0;overflow:hidden}.measure-text{visibility:hidden;height:0;width:auto;overflow:hidden;font-size:var(--calcite-font-size--1)}`;
|
|
9
9
|
class b extends u {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(...arguments), this.measureText =
|
|
11
|
+
super(...arguments), this.measureText = c(), this.overflowButton = c(), this.resizeObserver = null, this.actionWidths = [], this._messages = v({ name: "portal-browser", blocking: !0 }), this.buttonPadding = 88, this.moreWidth = 0, this.elementWidth = 0, this.visibleActions = [], this.overflowActions = [], this.calculating = !1, this.actions = [];
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
14
|
this.properties = { visibleActions: 16, overflowActions: 16, calculating: 16, actions: 0, selection: 0 };
|
|
@@ -20,7 +20,7 @@ class b extends u {
|
|
|
20
20
|
this.lastExecutedAction?.setFocus();
|
|
21
21
|
}
|
|
22
22
|
willUpdate(t) {
|
|
23
|
-
t.has("actions") && (this.measureAndCacheWidths(this.actions), this.calculateOverflow()), t.has("selection") && (this.
|
|
23
|
+
t.has("actions") && (this.measureAndCacheWidths(this.actions), this.calculateOverflow()), t.has("selection") && (this.hasSelection() ? f(100).then(() => {
|
|
24
24
|
this.calculating = !1;
|
|
25
25
|
}) : this.calculating = !0);
|
|
26
26
|
}
|
|
@@ -45,12 +45,15 @@ class b extends u {
|
|
|
45
45
|
e.textContent = i, this.moreWidth = e.scrollWidth + this.buttonPadding;
|
|
46
46
|
}
|
|
47
47
|
calculateOverflow() {
|
|
48
|
-
const t = this.moreWidth, e = this.actionWidths.reduce(({ width: i, visible: o, overflow: r }, { action:
|
|
49
|
-
const n = i +
|
|
50
|
-
return n >= this.elementWidth ? { width: n, visible: o, overflow: [...r,
|
|
48
|
+
const t = this.moreWidth, e = this.actionWidths.reduce(({ width: i, visible: o, overflow: r }, { action: a, width: h }) => {
|
|
49
|
+
const n = i + h;
|
|
50
|
+
return n >= this.elementWidth ? { width: n, visible: o, overflow: [...r, a] } : { width: n, visible: [...o, a], overflow: r };
|
|
51
51
|
}, { visible: [], overflow: [], width: t });
|
|
52
52
|
this.visibleActions = e.visible, this.overflowActions = e.overflow;
|
|
53
53
|
}
|
|
54
|
+
hasSelection() {
|
|
55
|
+
return !!this.selection?.length;
|
|
56
|
+
}
|
|
54
57
|
renderButton(t) {
|
|
55
58
|
const e = t.id || `${t.text}-${t.icon || "none"}`;
|
|
56
59
|
return s`<div><calcite-button class="button" .iconStart=${t.icon} @click=${(i) => {
|
|
@@ -59,12 +62,12 @@ class b extends u {
|
|
|
59
62
|
}
|
|
60
63
|
render() {
|
|
61
64
|
const t = this.overflowActions.length > 0, e = this._messages.actions.more;
|
|
62
|
-
return s`<div><span class="measure-container"><span class="measure-text" aria-hidden ${
|
|
65
|
+
return s`<div><span class="measure-container"><span class="measure-text" aria-hidden ${l(this.measureText)}></span></span>${this.hasSelection() && (this.visibleActions.length > 0 || t) && !this.calculating && s`<nav class="wrapper">${this.visibleActions.map((i) => this.renderButton(i))}${t && s`<calcite-dropdown width=m placement=bottom-end><calcite-button slot=trigger kind=neutral icon-end=chevron-down appearance=transparent ${l(this.overflowButton)}>${e}</calcite-button><calcite-dropdown-group selection-mode=none>${this.overflowActions.map((i) => s`<calcite-dropdown-item .iconStart=${i.icon || "blank"} @calciteDropdownItemSelect=${() => {
|
|
63
66
|
this.lastExecutedAction = this.overflowButton.value || void 0, i.onClick();
|
|
64
67
|
}}>${i.text}</calcite-dropdown-item>`)}</calcite-dropdown-group></calcite-dropdown>` || ""}</nav>` || ""}</div>`;
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
|
|
70
|
+
d("arcgis-portal-browser-actions", b);
|
|
68
71
|
export {
|
|
69
72
|
b as ArcgisPortalBrowserActions
|
|
70
73
|
};
|