@arcgis/portal-components 5.2.0-next.85 → 5.2.0-next.87
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/{GADH24KO.js → 25KISBCS.js} +1 -1
- package/dist/cdn/2TQ4B2LU.js +2 -0
- package/dist/cdn/4GRTJ7XT.js +2 -0
- package/dist/cdn/{ZAB6B2B6.js → 5EMPEJ65.js} +1 -1
- package/dist/cdn/C7XKSVMU.js +2 -0
- package/dist/cdn/{DHWAQSKG.js → F3LFFR3K.js} +1 -1
- package/dist/cdn/F3M3R7X2.js +2 -0
- package/dist/cdn/{CD2GV5YW.js → F76RXJ66.js} +1 -1
- package/dist/cdn/FQTFZLHT.js +2 -0
- package/dist/cdn/KYNL256E.js +2 -0
- package/dist/cdn/{NASFEWDT.js → LDYOCDG6.js} +1 -1
- package/dist/cdn/{LRADZ46B.js → NQQLTGIK.js} +1 -1
- package/dist/cdn/{R5MGNFM2.js → PMQCCLS5.js} +1 -1
- package/dist/cdn/QTKBB22S.js +2 -0
- package/dist/cdn/SYDYG3CL.js +2 -0
- package/dist/cdn/{TUBYAQ6R.js → X5B4PAML.js} +1 -1
- package/dist/cdn/{ECA5GSSU.js → X6XTK2TE.js} +1 -1
- package/dist/cdn/{6BALICUQ.js → Y56BS6IQ.js} +52 -52
- package/dist/cdn/YBWCEZJP.js +2 -0
- package/dist/cdn/assets/portal-account-switcher/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/groups2.js +1 -1
- package/dist/chunks/item2.js +1 -1
- package/dist/chunks/portal-account-switcher.js +3 -3
- package/dist/chunks/portal.js +2 -2
- package/dist/chunks/portal2.js +1 -1
- package/dist/chunks/request.js +1 -1
- package/dist/chunks/services.js +17 -0
- package/dist/chunks/user.js +1 -1
- package/dist/chunks/utils.js +4 -4
- package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +22 -2
- package/dist/components/arcgis-portal-account-switcher/customElement.js +211 -207
- package/dist/components/arcgis-portal-account-switcher/index.js +1 -3
- package/dist/components/arcgis-portal-account-switcher/types.d.ts +6 -0
- package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +20 -2
- package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +5 -5
- package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +22 -4
- package/dist/components/arcgis-portal-account-switcher-list/customElement.js +58 -37
- package/dist/components/arcgis-portal-account-switcher-list/index.js +2 -3
- package/dist/components/arcgis-portal-ai-assistant/agents/portalRouteKeys.d.ts +25 -16
- package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +4 -4
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +611 -603
- package/dist/components/arcgis-portal-field-delete/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-browser/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/customElement.js +1 -2
- package/dist/components/arcgis-portal-user-avatar/customElement.js +25 -36
- package/dist/components/arcgis-portal-user-popup/customElement.js +27 -27
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +4 -4
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/dist/types/user.d.ts +1 -1
- package/package.json +7 -7
- package/dist/cdn/5MVBQWW3.js +0 -2
- package/dist/cdn/76A6NXMY.js +0 -2
- package/dist/cdn/E4D3U6ZA.js +0 -2
- package/dist/cdn/J57ZXL3U.js +0 -2
- package/dist/cdn/OAKVCMNN.js +0 -2
- package/dist/cdn/QREMLELA.js +0 -2
- package/dist/cdn/SOJ5KMMZ.js +0 -2
- package/dist/cdn/V6N5BWDA.js +0 -2
|
@@ -11,7 +11,7 @@ import U from "@arcgis/core/identity/IdentityManager.js";
|
|
|
11
11
|
import b from "@arcgis/core/request.js";
|
|
12
12
|
import * as q from "@arcgis/core/applications/PortalApp/layerUtils.js";
|
|
13
13
|
import { i as $, a as R, g as J, b as z, d as W, e as _ } from "../../chunks/fieldAddDelete.js";
|
|
14
|
-
import {
|
|
14
|
+
import { a as C } from "../../chunks/portal.js";
|
|
15
15
|
import { u as V } from "../../chunks/useT9n.js";
|
|
16
16
|
import { log as v, composeMissingPropertyMessage as k, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
|
|
17
17
|
const n = /* @__PURE__ */ new Map();
|
|
@@ -15,7 +15,7 @@ import { c as k } from "../../chunks/store.js";
|
|
|
15
15
|
import { i as A } from "../../chunks/query.js";
|
|
16
16
|
import T from "@arcgis/core/portal/PortalGroup.js";
|
|
17
17
|
import { r as E } from "../../chunks/request.js";
|
|
18
|
-
import {
|
|
18
|
+
import { a as M } from "../../chunks/portal.js";
|
|
19
19
|
import { b as f } from "../../chunks/ui.js";
|
|
20
20
|
import { watch as q } from "@arcgis/core/core/reactiveUtils.js";
|
|
21
21
|
import { PortalGroupBrowserSort as L } from "../portal-group-browser-sort/customElement.js";
|
|
@@ -3,7 +3,7 @@ import { c as p } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { LitElement as m, nothing as f, safeStyleMap as g } from "@arcgis/lumina";
|
|
4
4
|
import { css as d, html as l } from "lit";
|
|
5
5
|
import { createRef as c, ref as h } from "lit/directives/ref.js";
|
|
6
|
-
import {
|
|
6
|
+
import { g as $, a as b } from "../../chunks/portal.js";
|
|
7
7
|
const x = /^#[0-9a-f]{3}$/iu, k = /^#[0-9a-f]{6}$/iu;
|
|
8
8
|
function u(r) {
|
|
9
9
|
return E(r) || I(r);
|
|
@@ -9,14 +9,13 @@ import { a as B } from "../../chunks/requests.js";
|
|
|
9
9
|
import { repeat as U } from "lit/directives/repeat.js";
|
|
10
10
|
import { m as Pt } from "../../chunks/icons.js";
|
|
11
11
|
import { i as M, c as me, a as Tt } from "../../chunks/user2.js";
|
|
12
|
-
import "@arcgis/core/portal/Portal.js";
|
|
13
12
|
import { c as Nt, d as Ct, e as Mt, f as Lt, h as Ot } from "../../chunks/portal2.js";
|
|
14
13
|
import { c as Et, d as jt, e as Dt } from "../../chunks/user.js";
|
|
15
14
|
import { i as Se, a as zt } from "../../chunks/utils2.js";
|
|
16
15
|
import { g as Gt } from "../../chunks/request.js";
|
|
17
16
|
import { g as Ie } from "../../chunks/item.js";
|
|
18
17
|
import { keyed as se } from "lit/directives/keyed.js";
|
|
19
|
-
import { e as ae, n as Ut,
|
|
18
|
+
import { e as ae, n as Ut, a as ce, f as q, g as Bt } from "../../chunks/portal.js";
|
|
20
19
|
import { ref as R, createRef as W } from "lit/directives/ref.js";
|
|
21
20
|
import { c as Ft, g as Wt } from "../../chunks/dom.js";
|
|
22
21
|
import { debounce as fe } from "@arcgis/toolkit/function";
|
|
@@ -1,62 +1,51 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as x } from "../../chunks/runtime.js";
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { css as k, html as
|
|
5
|
-
import { u as
|
|
3
|
+
import { LitElement as w, safeClassMap as l } from "@arcgis/lumina";
|
|
4
|
+
import { css as k, html as t } from "lit";
|
|
5
|
+
import { u as b } from "../../chunks/useT9n.js";
|
|
6
6
|
import { f as z } from "../../chunks/user.js";
|
|
7
|
-
import { g as
|
|
8
|
-
import {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
if (B(s))
|
|
12
|
-
return s.thumbnailUrl;
|
|
13
|
-
const e = s.thumbnail;
|
|
14
|
-
if (!e)
|
|
15
|
-
return null;
|
|
16
|
-
if (e.startsWith("http"))
|
|
17
|
-
return e;
|
|
18
|
-
const t = y(a);
|
|
19
|
-
return `${r ? "https://www.arcgis.com/sharing/rest/" : A(a)}community/users/${s.username}/info/${e}${t && !r ? `?token=${t}` : ""}`;
|
|
20
|
-
}
|
|
21
|
-
class P extends b {
|
|
7
|
+
import { g as $ } from "../../chunks/user2.js";
|
|
8
|
+
import { g as n } from "../../chunks/services.js";
|
|
9
|
+
const U = k`:host{max-width:100%;display:flex;align-items:center;min-width:0}.skeleton{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite;display:flex;align-items:center}.skeleton-avatar{border-radius:100%;background-color:var(--calcite-color-foreground-3);width:var(--arcgis-portal-user-avatar-size);height:var(--arcgis-portal-user-avatar-size)}.skeleton-name{background-color:var(--calcite-color-foreground-3);border-radius:var(--calcite-border-radius);width:var(--arcgis-portal-user-avatar-skeleton-width);border-radius:var(--arcgis-portal-user-avatar-spacing);height:var(--arcgis-portal-user-avatar-spacing);margin-inline-start:var(--arcgis-portal-user-avatar-spacing)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.avatar{display:block;flex-grow:0;flex-shrink:0;border-radius:100%;background-color:var(--calcite-color-foreground-3);width:var(--arcgis-portal-user-avatar-size);height:var(--arcgis-portal-user-avatar-size)}.text{color:var(--calcite-color-text-2);display:flex;flex-direction:column;justify-content:center;min-width:0;text-align:start;margin-inline-start:var(--arcgis-portal-user-avatar-spacing);line-height:calc(var(--arcgis-portal-user-avatar-size) / 2)}.text--no-avatar{margin-inline-start:0}.-text-underline .title{text-decoration:underline}.text--clamp{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.text--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.has-description{font-weight:500}.description{font-weight:400;color:var(--calcite-color-text-2)}:host([scale="xs"]){font-size:.75rem;--arcgis-portal-user-avatar-size: 18px;--arcgis-portal-user-avatar-spacing: .25rem ;.description{font-size:.625rem;margin-top:-.125rem}.text{line-height:1.35}}:host([scale="s"]){font-size:.75rem;--arcgis-portal-user-avatar-size: 1.5rem ;--arcgis-portal-user-avatar-spacing: .5rem ;--arcgis-portal-user-avatar-skeleton-width: 4rem ;.description{font-size:.625rem}}:host([scale="m"]){font-size:.875rem;--arcgis-portal-user-avatar-size: 2rem ;--arcgis-portal-user-avatar-spacing: .75rem ;--arcgis-portal-user-avatar-skeleton-width: 5rem ;.description{font-size:.75rem}}:host([scale="l"]){font-size:1rem;--arcgis-portal-user-avatar-size: 2.5rem ;--arcgis-portal-user-avatar-spacing: 1rem ;--arcgis-portal-user-avatar-skeleton-width: 6rem ;.description{font-size:.875rem}}`;
|
|
10
|
+
class y extends w {
|
|
22
11
|
constructor() {
|
|
23
|
-
super(...arguments), this.messages =
|
|
12
|
+
super(...arguments), this.messages = b({ name: null }), this.thumbnailUrl = null, this.scale = "m", this.hideAvatar = !1;
|
|
24
13
|
}
|
|
25
14
|
static {
|
|
26
15
|
this.properties = { user: 0, portal: 0, scale: 3, showName: 5, hideAvatar: 5, heading: 1, description: 1, underline: 5, username: 1, wrap: 5, checkOnline: 5 };
|
|
27
16
|
}
|
|
28
17
|
static {
|
|
29
|
-
this.styles =
|
|
18
|
+
this.styles = U;
|
|
30
19
|
}
|
|
31
20
|
async load() {
|
|
32
|
-
const { username:
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
this.user =
|
|
36
|
-
} else
|
|
21
|
+
const { username: e, checkOnline: a, portal: r, user: i } = this;
|
|
22
|
+
if (e && r) {
|
|
23
|
+
const s = await z(e, r, a);
|
|
24
|
+
this.user = s, this.thumbnailUrl = n(s, r, a);
|
|
25
|
+
} else i && r && (this.thumbnailUrl = n(i, r, a));
|
|
37
26
|
}
|
|
38
|
-
updated(
|
|
39
|
-
const
|
|
40
|
-
|
|
27
|
+
updated(e) {
|
|
28
|
+
const a = e.get("user");
|
|
29
|
+
a && this.portal && (this.thumbnailUrl = n(a, this.portal, this.checkOnline));
|
|
41
30
|
}
|
|
42
31
|
renderSkeleton() {
|
|
43
|
-
return
|
|
32
|
+
return t`<div class="skeleton">${!this.hideAvatar && t`<div class="skeleton-avatar"></div>` || ""}${this.showName && t`<div class="skeleton-name"></div>` || ""}</div>`;
|
|
44
33
|
}
|
|
45
34
|
renderUser() {
|
|
46
|
-
const { user:
|
|
47
|
-
if (!
|
|
35
|
+
const { user: e, messages: a, thumbnailUrl: r, hideAvatar: i, showName: s, description: c, scale: p, underline: m, heading: d } = this;
|
|
36
|
+
if (!e)
|
|
48
37
|
return [];
|
|
49
|
-
const { fullName:
|
|
38
|
+
const { fullName: h, username: g, id: v } = e, o = !!c, f = (h?.split(" ") || []).slice(0, 2).join(" "), u = this.wrap ? "text--clamp" : "text--ellipsis";
|
|
50
39
|
return [
|
|
51
|
-
!
|
|
52
|
-
(
|
|
40
|
+
!i && t`<calcite-avatar class="avatar" .scale=${p === "xs" ? "s" : p} .fullName=${f} .username=${g} .userId=${v} .thumbnail=${r || void 0} .inert=${s || o ? !0 : void 0}></calcite-avatar>` || "",
|
|
41
|
+
(s || o) && t`<span class=${l({ text: !0, "text--underline": m, "text--no-avatar": i })}>${s && t`<span class=${l({ title: !0, "has-description": o, [u]: !0 })}>${d || $(e, a._lang)}</span>` || ""}${o && t`<span class=${l({ description: !0, [u]: !0 })}>${c}</span>` || ""}</span>` || ""
|
|
53
42
|
];
|
|
54
43
|
}
|
|
55
44
|
render() {
|
|
56
45
|
return this.user && this.messages._lang ? this.renderUser() : this.renderSkeleton();
|
|
57
46
|
}
|
|
58
47
|
}
|
|
59
|
-
x("arcgis-portal-user-avatar",
|
|
48
|
+
x("arcgis-portal-user-avatar", y);
|
|
60
49
|
export {
|
|
61
|
-
|
|
50
|
+
y as ArcgisPortalUserAvatar
|
|
62
51
|
};
|
|
@@ -9,67 +9,67 @@ import { r as C, g as T } from "../../chunks/string.js";
|
|
|
9
9
|
import { g as z } from "../../chunks/user2.js";
|
|
10
10
|
import { f as k, r as y } from "../../chunks/request.js";
|
|
11
11
|
import { s as q } from "../../chunks/dom.js";
|
|
12
|
-
import {
|
|
12
|
+
import { a as U } from "../../chunks/portal.js";
|
|
13
13
|
import { f as F } from "../../chunks/verified.js";
|
|
14
|
-
const H = N`:host{display:flex}.button{display:flex;align-items:center;max-width:100%;cursor:pointer;white-space:normal;border-style:none;padding:0;font-size:.75rem;color:var(--calcite-color-text-2);outline:2px solid transparent;outline-offset:2px;transition-property:all;outline-color:transparent;background:transparent;font-family:inherit;line-height:1.5;&:focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px}}.button--outline{box-sizing:border-box;width:100%;padding:.5rem .75rem;transition-property:all;border:1px solid var(--calcite-color-border-3);&:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}}.name{overflow:hidden;white-space:nowrap;margin-inline-start:.5rem;text-overflow:ellipsis}.popover__wrapper{background-color:var(--calcite-color-foreground-1);width:min(32rem,80vw)}.popover__header{padding:1.25rem 1rem}.popover__avatar{max-width:100%}.popover__content{padding:.5rem 1rem 1.25rem}.popover__description{margin:0;overflow:auto;padding:0;padding-bottom:1rem;font-size:.875rem;color:var(--calcite-color-text-2);max-height:21.25rem}.popover__fade{position:relative;z-index:10;margin-bottom:.25rem;display:block;height:1rem;width:100%;background:linear-gradient(to bottom,transparent,var(--calcite-color-foreground-1) 100%);margin-top:-1rem}.popover__buttons{display:grid;grid-auto-flow:column;grid-gap:.5rem}.popover__buttons--no-description{padding-top:1rem}.popover__button{min-width:0px}.popover__loader{--calcite-loader-padding: 0}`, I = (
|
|
14
|
+
const H = N`:host{display:flex}.button{display:flex;align-items:center;max-width:100%;cursor:pointer;white-space:normal;border-style:none;padding:0;font-size:.75rem;color:var(--calcite-color-text-2);outline:2px solid transparent;outline-offset:2px;transition-property:all;outline-color:transparent;background:transparent;font-family:inherit;line-height:1.5;&:focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px}}.button--outline{box-sizing:border-box;width:100%;padding:.5rem .75rem;transition-property:all;border:1px solid var(--calcite-color-border-3);&:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}}.name{overflow:hidden;white-space:nowrap;margin-inline-start:.5rem;text-overflow:ellipsis}.popover__wrapper{background-color:var(--calcite-color-foreground-1);width:min(32rem,80vw)}.popover__header{padding:1.25rem 1rem}.popover__avatar{max-width:100%}.popover__content{padding:.5rem 1rem 1.25rem}.popover__description{margin:0;overflow:auto;padding:0;padding-bottom:1rem;font-size:.875rem;color:var(--calcite-color-text-2);max-height:21.25rem}.popover__fade{position:relative;z-index:10;margin-bottom:.25rem;display:block;height:1rem;width:100%;background:linear-gradient(to bottom,transparent,var(--calcite-color-foreground-1) 100%);margin-top:-1rem}.popover__buttons{display:grid;grid-auto-flow:column;grid-gap:.5rem}.popover__buttons--no-description{padding-top:1rem}.popover__button{min-width:0px}.popover__loader{--calcite-loader-padding: 0}`, I = (s) => (
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
16
|
-
|
|
16
|
+
s?.sourceJSON?.contentStatus === "public_authoritative"
|
|
17
17
|
);
|
|
18
|
-
async function M(
|
|
19
|
-
if (I(
|
|
20
|
-
const e =
|
|
21
|
-
if (!
|
|
18
|
+
async function M(s, t, r, o) {
|
|
19
|
+
if (I(s)) {
|
|
20
|
+
const e = s.owner || "", a = await F(s, r, t, o);
|
|
21
|
+
if (!a)
|
|
22
22
|
return await f(e, t, o);
|
|
23
|
-
const { description: n, name: i, thumbnail: u, url: m } =
|
|
23
|
+
const { description: n, name: i, thumbnail: u, url: m } = a;
|
|
24
24
|
return {
|
|
25
25
|
description: n ? q(n) : "",
|
|
26
26
|
fullName: i,
|
|
27
27
|
username: e,
|
|
28
28
|
thumbnail: u,
|
|
29
|
-
id:
|
|
29
|
+
id: s.portal.id,
|
|
30
30
|
url: m
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
return await f(
|
|
33
|
+
return await f(s.owner || "", t, o);
|
|
34
34
|
}
|
|
35
|
-
async function E(
|
|
35
|
+
async function E(s, t, r) {
|
|
36
36
|
const o = r ? "https://www.arcgis.com/sharing/rest/" : U(t), e = r ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
|
|
37
37
|
return await k({
|
|
38
38
|
requester: async () => await y({
|
|
39
39
|
url: `${o}community/groups`,
|
|
40
40
|
portal: t,
|
|
41
41
|
params: {
|
|
42
|
-
q: `(owner:"${
|
|
42
|
+
q: `(owner:"${s}")`,
|
|
43
43
|
num: 100
|
|
44
44
|
},
|
|
45
45
|
options: e
|
|
46
46
|
}),
|
|
47
47
|
key: "userGroups",
|
|
48
|
-
id:
|
|
48
|
+
id: s
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
async function G(
|
|
51
|
+
async function G(s, t, r) {
|
|
52
52
|
const o = r ? "https://www.arcgis.com/sharing/rest/" : U(t), e = r ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
|
|
53
53
|
return await k({
|
|
54
54
|
requester: async () => (await y({
|
|
55
55
|
url: `${o}search`,
|
|
56
56
|
portal: t,
|
|
57
57
|
params: {
|
|
58
|
-
q: `(owner:"${
|
|
58
|
+
q: `(owner:"${s}") -typekeywords:"recyclebin"`,
|
|
59
59
|
num: 1
|
|
60
60
|
},
|
|
61
61
|
options: e
|
|
62
62
|
})).total,
|
|
63
63
|
key: "userItemsTotal",
|
|
64
|
-
id:
|
|
64
|
+
id: s
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function _({
|
|
68
|
-
baseUrl:
|
|
68
|
+
baseUrl: s,
|
|
69
69
|
user: t,
|
|
70
70
|
type: r
|
|
71
71
|
}) {
|
|
72
|
-
const o = C(
|
|
72
|
+
const o = C(s), e = encodeURIComponent(t.username || "");
|
|
73
73
|
return e ? `${o}/${r}.html?user=${e}` : `${o}/${r}.html`;
|
|
74
74
|
}
|
|
75
75
|
class S extends R {
|
|
@@ -98,10 +98,10 @@ class S extends R {
|
|
|
98
98
|
return this.baseUrl || `${this.portal.url}/home`;
|
|
99
99
|
}
|
|
100
100
|
async init() {
|
|
101
|
-
const { item: t, username: r, portal: o, fullName: e, messages:
|
|
102
|
-
if (!(!
|
|
101
|
+
const { item: t, username: r, portal: o, fullName: e, messages: a } = this;
|
|
102
|
+
if (!(!a._lang || !o)) {
|
|
103
103
|
if (t) {
|
|
104
|
-
this.itemUserInfo = await M(t, o,
|
|
104
|
+
this.itemUserInfo = await M(t, o, a._lang, this.checkOnline);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
if (r) {
|
|
@@ -111,7 +111,7 @@ class S extends R {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
async fetchItemsAndGroups() {
|
|
114
|
-
const { user: t, itemUserInfo: r, item: o, portal: e, username:
|
|
114
|
+
const { user: t, itemUserInfo: r, item: o, portal: e, username: a, checkOnline: n } = this, i = a || t?.username || o?.owner || r?.username;
|
|
115
115
|
if (!(!i || !e)) {
|
|
116
116
|
if (!this.groups) {
|
|
117
117
|
const u = await E(i, e, n);
|
|
@@ -130,13 +130,13 @@ class S extends R {
|
|
|
130
130
|
}
|
|
131
131
|
renderOrgButtons(t) {
|
|
132
132
|
const { messages: r } = this, e = (t.url || this.resolvedBaseUrl).replace(/\/$/u, "");
|
|
133
|
-
return l`<calcite-button appearance=outline-fill kind=neutral .href=${e} target=_blank @click=${(
|
|
133
|
+
return l`<calcite-button appearance=outline-fill kind=neutral .href=${e} target=_blank @click=${(a) => this.openLink(a, e)}>${r.homepage}</calcite-button><calcite-button appearance=outline-fill kind=neutral .href=${`${e}/gallery.html`} target=_blank @click=${(a) => this.openLink(a, `${e}/gallery.html`)}>${r.gallery}</calcite-button>`;
|
|
134
134
|
}
|
|
135
135
|
renderUserButtons(t) {
|
|
136
|
-
const { total: r, groups: o, messages: e } = this,
|
|
136
|
+
const { total: r, groups: o, messages: e } = this, a = t.username || "";
|
|
137
137
|
if (typeof r != "number" || !o)
|
|
138
138
|
return l`<calcite-loader .label=${e.loadingUserInformation} scale=s class="popover__loader"></calcite-loader>`;
|
|
139
|
-
const i = _({ baseUrl: this.resolvedBaseUrl, user: { username:
|
|
139
|
+
const i = _({ baseUrl: this.resolvedBaseUrl, user: { username: a }, type: "groups" }), u = _({ baseUrl: this.resolvedBaseUrl, user: { username: a }, type: "content" }), m = `${this.resolvedBaseUrl.replace(/\/$/u, "")}/user.html?user=${encodeURIComponent(a)}`;
|
|
140
140
|
return l`${!!o.total && l`<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${i} target=_blank @click=${(p) => {
|
|
141
141
|
this.openLink(p, i), this.arcgisUserPopupInternalUIAction.emit({ category: "profile popup", action: "view all groups" });
|
|
142
142
|
}}>${e.groups.replace("${number}", new Intl.NumberFormat(e._lang).format(o.total))}</calcite-button>` || ""}${!!r && l`<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${u} target=_blank @click=${(p) => {
|
|
@@ -146,13 +146,13 @@ class S extends R {
|
|
|
146
146
|
}}>${e.profile}</calcite-button>`;
|
|
147
147
|
}
|
|
148
148
|
render() {
|
|
149
|
-
const { user: t, itemUserInfo: r, portal: o, item: e, appearance:
|
|
149
|
+
const { user: t, itemUserInfo: r, portal: o, item: e, appearance: a, scale: n, isPopoverOpen: i, showName: u, showUsername: m, messages: p } = this, c = t || r;
|
|
150
150
|
if (!p._lang || !c)
|
|
151
151
|
return l`<arcgis-portal-user-avatar scale=s show-name .checkOnline=${this.checkOnline}></arcgis-portal-user-avatar>`;
|
|
152
152
|
const v = I(e), d = c.username || "", h = T(c.description || "") || "", x = z(c, p._lang), P = v ? p.itemManagedBy.replace("${username}", d) : d;
|
|
153
153
|
return l`<button class=${b({
|
|
154
154
|
button: !0,
|
|
155
|
-
"button--outline":
|
|
155
|
+
"button--outline": a === "outline"
|
|
156
156
|
})} @click=${() => {
|
|
157
157
|
this.isPopoverOpen || (this.isPopoverOpen = !0), this.fetchItemsAndGroups();
|
|
158
158
|
}} ${w(this.buttonRef)}><slot><arcgis-portal-user-avatar .user=${c} .scale=${n} .portal=${o} .showName=${u} .description=${m ? d : ""} .hideAvatar=${!this.showAvatar} .underline=${this.underline} .checkOnline=${this.checkOnline} .wrap=${this.wrap}></arcgis-portal-user-avatar></slot></button>${i && this.buttonRef.value && c && l`<calcite-popover class="popover" .label=${x} pointer-disabled .referenceElement=${this.buttonRef.value} placement=auto .id=${`${d}-popover`} auto-close style=${B({ "--calcite-popover-z-index": this.zIndex?.toString() || "12" })} @calcitePopoverOpen=${() => {
|