@arcgis/portal-components 5.2.0-next.1 → 5.2.0-next.10
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/{AQWTJKUH.js → 3MQIRMUM.js} +9 -7
- package/dist/cdn/{CI5ENGVT.js → 462NPCQK.js} +1 -1
- package/dist/cdn/{G47ZZQYL.js → 46Q4UJRT.js} +1 -1
- package/dist/cdn/{N6G6Z7BF.js → 546F7RE5.js} +67 -67
- package/dist/cdn/{K3HS2LQ7.js → 5ZNQZDQO.js} +1 -1
- package/dist/cdn/{5DPWJ7DI.js → BEX567FX.js} +1 -1
- package/dist/cdn/BLB544VG.js +3 -0
- package/dist/cdn/{OQDPULPD.js → C4D4PGO3.js} +1 -1
- package/dist/cdn/DFTUMKSN.js +3 -0
- package/dist/cdn/E7DG4PTT.js +2 -0
- package/dist/cdn/{GNOZCQ34.js → IHKNWGHP.js} +1 -1
- package/dist/cdn/{LQ3DMZ3K.js → L46YEW4Y.js} +1 -1
- package/dist/cdn/{TMYTUOSS.js → OLRMKR7F.js} +1 -1
- package/dist/cdn/QB34ACZ2.js +2 -0
- package/dist/cdn/{YMPTDKT6.js → RXSGAKUU.js} +1 -1
- package/dist/cdn/{GHQ3ZW4U.js → SBMN77ZZ.js} +1 -1
- package/dist/cdn/SIN2A4UX.js +65 -0
- package/dist/cdn/{YG5YYL6X.js → SJC3537M.js} +1 -1
- package/dist/cdn/{BEHLBKKM.js → SV2O3ZZ7.js} +1 -1
- package/dist/cdn/T7NAWRYB.js +2 -0
- package/dist/cdn/UFM62DQ3.js +2 -0
- package/dist/cdn/{2UUZHENH.js → UPEVTVNZ.js} +1 -1
- package/dist/cdn/{JNRN6DTV.js → XHASDTZ3.js} +1 -1
- package/dist/cdn/assets/portal-group-badges/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-user-popup/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/user2.js +26 -25
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +2 -2
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +10 -10
- package/dist/components/arcgis-portal-group-badges/customElement.d.ts +102 -0
- package/dist/components/arcgis-portal-group-badges/customElement.js +58 -0
- package/dist/components/arcgis-portal-group-badges/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-badges/index.js +3 -0
- package/dist/components/arcgis-portal-group-badges/types.d.ts +3 -0
- package/dist/components/arcgis-portal-group-card/customElement.d.ts +167 -0
- package/dist/components/arcgis-portal-group-card/customElement.js +187 -0
- package/dist/components/arcgis-portal-group-card/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-card/index.js +8 -0
- package/dist/components/arcgis-portal-group-thumbnail/customElement.d.ts +32 -0
- package/dist/components/arcgis-portal-group-thumbnail/customElement.js +153 -0
- package/dist/components/arcgis-portal-group-thumbnail/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-thumbnail/index.js +3 -0
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +3 -3
- package/dist/components/arcgis-portal-user-popup/customElement.d.ts +111 -0
- package/dist/components/arcgis-portal-user-popup/customElement.js +231 -0
- package/dist/components/arcgis-portal-user-popup/index.d.ts +1 -0
- package/dist/components/arcgis-portal-user-popup/index.js +5 -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 +30 -2
- package/dist/loader.js +7 -3
- package/dist/types/lumina.d.ts +25 -0
- package/dist/types/preact.d.ts +29 -0
- package/dist/types/react.d.ts +33 -0
- package/dist/types/stencil.d.ts +25 -0
- package/dist/types/tracking.d.ts +10 -0
- package/dist/types/user.d.ts +2 -2
- package/package.json +7 -7
- package/dist/cdn/KEKBRUUC.js +0 -2
- package/dist/cdn/SM4GWLRA.js +0 -66
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{O as
|
|
2
|
+
import{O as a,y as e}from"./DHHSKOUY.js";import"./YIMNOUTF.js";var t=e(a,{"arcgis-portal-ai-assistant":[()=>import("./546F7RE5.js"),"autoDestroyDisabled,config:,defaultClosed,portal:,t9n:,user:"],"arcgis-portal-ai-assistant-interrupt":[()=>import("./SIN2A4UX.js"),"_messages:,message,options:,type"],"arcgis-portal-classification-banner":[()=>import("./RXSGAKUU.js"),"autoDestroyDisabled,messages:,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./SV2O3ZZ7.js"),"autoDestroyDisabled,messages:,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./XHASDTZ3.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,messages:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./46Q4UJRT.js"),"attribute:,attributeKey,isRequiredErrors:,messages:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./SBMN77ZZ.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,messages:,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./5ZNQZDQO.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./SJC3537M.js"),"config:,fieldNames:,layer:,mapView:,messages:,options:"],"arcgis-portal-group-badges":[()=>import("./UFM62DQ3.js"),"_messages:,appearance,empty,group:,portal:,scale,showTooltips,width"],"arcgis-portal-group-card":[()=>import("./E7DG4PTT.js"),"disabled,group:,indeterminate,link,linkHandler:,messages:,name,newTab,portal:,preview,previewed,selected,selection,showBadges,showDateCreated,showDateUpdated,showOwner,showSummary,showViewableBy,user:,view;restoreFocus"],"arcgis-portal-group-thumbnail":[()=>import("./QB34ACZ2.js"),"group:,portal:,scale,tooltip"],"arcgis-portal-item-type":[()=>import("./OLRMKR7F.js"),"ellipsis,hideIcon,hideText,item:,messages:,portal:,scale,serviceInfo:,showHosted,user:"],"arcgis-portal-mentionable-text-area":[()=>import("./462NPCQK.js"),"disabled,maxLength,placeholder,popoverListLabel,popoverPlacement,portal:,readOnly,rows,scale,starters:,user:,value;closePopover,focusTextArea,selectItem"],"arcgis-portal-replacement-item-redirect":[()=>import("./IHKNWGHP.js"),"itemId,messages:,portal:,user:;setFocus"],"arcgis-portal-user-avatar":[()=>import("./BEX567FX.js"),"checkOnline,description,heading,hideAvatar,messages:,portal:,scale,showName,underline,user:,username,wrap"],"arcgis-portal-user-popup":[()=>import("./BLB544VG.js"),"appearance,avatarAriaHidden,baseUrl,checkOnline,fullName,item:,messages:,portal:,scale,showAvatar,showName,showUsername,underline,user:,username,wrap,zIndex;openPopup,setFocus"],"arcgis-portal-voice-input":[()=>import("./ZTHTFEYA.js"),"language;clearText,startListening,stopListening"]});t({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-ai-assistant-interrupt,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-group-badges,arcgis-portal-group-card,arcgis-portal-group-thumbnail,arcgis-portal-item-type,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-user-popup,arcgis-portal-voice-input){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
|
package/dist/cdn/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-ai-assistant-interrupt,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-item-type,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-voice-input){visibility:hidden}}
|
|
1
|
+
@layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-ai-assistant-interrupt,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-group-badges,arcgis-portal-group-card,arcgis-portal-group-thumbnail,arcgis-portal-item-type,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-user-popup,arcgis-portal-voice-input){visibility:hidden}}
|
package/dist/chunks/user2.js
CHANGED
|
@@ -3,28 +3,28 @@ import { i as C, a as b, g as w } from "./portal.js";
|
|
|
3
3
|
import E from "@arcgis/core/identity/IdentityManager.js";
|
|
4
4
|
import A from "@arcgis/core/request.js";
|
|
5
5
|
const u = {}, f = {}, l = {};
|
|
6
|
-
async function p({ requester: t, key: e, id:
|
|
7
|
-
const r = l[e]?.[
|
|
8
|
-
if (u[e]?.[
|
|
9
|
-
return u[e][
|
|
10
|
-
f[e] || (f[e] = {}), (!f[e][
|
|
11
|
-
const o = await f[e][
|
|
12
|
-
if (u[e] || (u[e] = {}), l[e] || (l[e] = {}), u[e][
|
|
13
|
-
const { expireAfter: a, getExpireAfterFromResult: c } =
|
|
14
|
-
l[e][
|
|
6
|
+
async function p({ requester: t, key: e, id: s, cacheOption: n }) {
|
|
7
|
+
const r = l[e]?.[s]?.expireAt, i = !!r && (/* @__PURE__ */ new Date()).getTime() > r;
|
|
8
|
+
if (u[e]?.[s] && !i)
|
|
9
|
+
return u[e][s];
|
|
10
|
+
f[e] || (f[e] = {}), (!f[e][s] || i) && (f[e][s] = t());
|
|
11
|
+
const o = await f[e][s];
|
|
12
|
+
if (u[e] || (u[e] = {}), l[e] || (l[e] = {}), u[e][s] = o, n) {
|
|
13
|
+
const { expireAfter: a, getExpireAfterFromResult: c } = n, h = c || a ? (/* @__PURE__ */ new Date()).getTime() + (c?.(o) ?? a ?? 0) : null;
|
|
14
|
+
l[e][s] = { ...l[e][s], expireAt: h };
|
|
15
15
|
}
|
|
16
16
|
return o;
|
|
17
17
|
}
|
|
18
18
|
async function x({
|
|
19
19
|
url: t,
|
|
20
20
|
portal: e,
|
|
21
|
-
params:
|
|
22
|
-
options:
|
|
21
|
+
params: s = {},
|
|
22
|
+
options: n = {},
|
|
23
23
|
method: r,
|
|
24
24
|
abortControllerId: i,
|
|
25
25
|
excludeJson: o
|
|
26
26
|
}) {
|
|
27
|
-
const a = R(i)?.signal, { customToken: c, addTokenManually: h, addSSL: P, useProxy: S } =
|
|
27
|
+
const a = R(i)?.signal, { customToken: c, addTokenManually: h, addSSL: P, useProxy: S } = n, m = { ...s };
|
|
28
28
|
if (!t.includes("f=") && !o && (m.f = "json"), c)
|
|
29
29
|
m.token = c;
|
|
30
30
|
else if (h !== !1) {
|
|
@@ -34,10 +34,10 @@ async function x({
|
|
|
34
34
|
const T = P ? U(t, e) : t, q = {
|
|
35
35
|
query: m,
|
|
36
36
|
method: r || "auto",
|
|
37
|
-
...
|
|
38
|
-
timeout:
|
|
37
|
+
...n,
|
|
38
|
+
timeout: n.timeout || 0,
|
|
39
39
|
useProxy: S,
|
|
40
|
-
...
|
|
40
|
+
...n?.disableIdentityLookup ? { authMode: "anonymous" } : {}
|
|
41
41
|
}, y = await A(T, { signal: a, ...q });
|
|
42
42
|
return i && (d[i] = void 0), y.data;
|
|
43
43
|
}
|
|
@@ -50,24 +50,24 @@ const $ = async (t) => {
|
|
|
50
50
|
const e = C(t);
|
|
51
51
|
if (!t?.isPortal || !e)
|
|
52
52
|
return b(t);
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
53
|
+
const s = t?.user;
|
|
54
|
+
if (!s && e)
|
|
55
55
|
return;
|
|
56
|
-
const { token:
|
|
56
|
+
const { token: n } = await p({
|
|
57
57
|
requester: async () => await L(t),
|
|
58
58
|
key: "platformSelf",
|
|
59
|
-
id:
|
|
59
|
+
id: s?.id ?? t.id ?? "<unknown>",
|
|
60
60
|
cacheOption: { getExpireAfterFromResult: (r) => r.expires_in }
|
|
61
61
|
});
|
|
62
|
-
return
|
|
62
|
+
return n;
|
|
63
63
|
}, L = async (t) => {
|
|
64
|
-
const
|
|
64
|
+
const s = {
|
|
65
65
|
"X-Esri-Auth-Client-Id": await M(t),
|
|
66
66
|
"X-Esri-Auth-Redirect-Uri": window.location.href.replace(/#.*$/u, "")
|
|
67
67
|
};
|
|
68
68
|
return (await A(`${w(t)}/oauth2/platformSelf`, {
|
|
69
69
|
authMode: "no-prompt",
|
|
70
|
-
headers:
|
|
70
|
+
headers: s,
|
|
71
71
|
withCredentials: !0,
|
|
72
72
|
method: "post"
|
|
73
73
|
})).data;
|
|
@@ -79,8 +79,8 @@ const $ = async (t) => {
|
|
|
79
79
|
function U(t, e) {
|
|
80
80
|
return window.location.protocol === "https:" || e.allSSL ? t.replace("http:", "https:") : t;
|
|
81
81
|
}
|
|
82
|
-
async function B(t, e,
|
|
83
|
-
const r = `${
|
|
82
|
+
async function B(t, e, s) {
|
|
83
|
+
const r = `${s ? "https://www.arcgis.com/sharing/rest/" : w(e)}community/users/${t}`, i = r?.includes("www.arcgis.com") && e.isPortal, o = r?.includes(".arcgis.com") && !e.isPortal && !e.user, a = i || o ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
|
|
84
84
|
return await p({
|
|
85
85
|
requester: async () => {
|
|
86
86
|
try {
|
|
@@ -109,5 +109,6 @@ const k = async (t) => {
|
|
|
109
109
|
export {
|
|
110
110
|
p as a,
|
|
111
111
|
k as b,
|
|
112
|
-
B as f
|
|
112
|
+
B as f,
|
|
113
|
+
x as r
|
|
113
114
|
};
|
|
@@ -104,7 +104,7 @@ const W = K(
|
|
|
104
104
|
userMessage: e,
|
|
105
105
|
hasSummaryContext: String(a)
|
|
106
106
|
}), c = await Q({
|
|
107
|
-
model: await F("fast"),
|
|
107
|
+
model: await F({ modelTier: "fast" }),
|
|
108
108
|
tools: [W],
|
|
109
109
|
systemPrompt: r,
|
|
110
110
|
responseFormat: gt,
|
|
@@ -675,7 +675,7 @@ const Yt = async (s, t) => {
|
|
|
675
675
|
question: a,
|
|
676
676
|
response: e
|
|
677
677
|
}), c = await Q({
|
|
678
|
-
model: await F("default"),
|
|
678
|
+
model: await F({ modelTier: "default" }),
|
|
679
679
|
tools: [W, Ht],
|
|
680
680
|
systemPrompt: r,
|
|
681
681
|
responseFormat: j,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c
|
|
3
|
-
import { css as o, html as
|
|
4
|
-
import { LitElement as u, createEvent as
|
|
2
|
+
import { c } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as o, html as a } from "lit";
|
|
4
|
+
import { LitElement as u, createEvent as n } from "@arcgis/lumina";
|
|
5
5
|
import m from "@esri/arcgis-html-sanitizer";
|
|
6
6
|
import { unsafeHTML as p } from "lit/directives/unsafe-html.js";
|
|
7
7
|
import { marked as r } from "marked";
|
|
8
8
|
import { u as g } from "../../chunks/useT9n.js";
|
|
9
9
|
import { a as d } from "../../chunks/functionalities.js";
|
|
10
|
-
const h = o`.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}
|
|
10
|
+
const h = o`.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}.interrupt-message :where(p){margin:0}.interrupt-message :where(ul,ol){margin:0;padding-inline-start:1.25rem}`;
|
|
11
11
|
r.use({ gfm: !0, breaks: !0, async: !1 });
|
|
12
12
|
const f = new m();
|
|
13
13
|
class b extends u {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.#t = [], this._messages = g({ blocking: !0 }), this.arcgisCancel =
|
|
15
|
+
super(...arguments), this.#t = [], this._messages = g({ blocking: !0 }), this.arcgisCancel = n(), this.arcgisSubmit = n();
|
|
16
16
|
}
|
|
17
17
|
static {
|
|
18
18
|
this.properties = { type: 1, message: 1, options: 0 };
|
|
@@ -29,11 +29,11 @@ class b extends u {
|
|
|
29
29
|
const { _messages: t, type: i, options: s } = this;
|
|
30
30
|
switch (i) {
|
|
31
31
|
case "single-select":
|
|
32
|
-
return
|
|
32
|
+
return a`<calcite-list class="interrupt-list" .label=${t.singleSelectLabel} selection-mode=single-persist @calciteListChange=${(e) => this.#t = e.target.selectedItems[0]?.value}>${s?.map((e) => a`<calcite-list-item .label=${e} .value=${e}></calcite-list-item>`)}</calcite-list>`;
|
|
33
33
|
case "multi-select":
|
|
34
|
-
return
|
|
34
|
+
return a`<calcite-list class="interrupt-list" .label=${t.multiSelectLabel} selection-mode=multiple @calciteListChange=${(e) => this.#t = e.target.selectedItems.map((l) => l.value)}>${s?.map((e) => a`<calcite-list-item .label=${e} .value=${e}></calcite-list-item>`)}</calcite-list>`;
|
|
35
35
|
case "text-input":
|
|
36
|
-
return
|
|
36
|
+
return a`<calcite-input class="interrupt-input" .label=${t.textInputLabel} @calciteInputInput=${(e) => this.#t = e.target.value}></calcite-input>`;
|
|
37
37
|
case "boolean-choice":
|
|
38
38
|
return null;
|
|
39
39
|
default:
|
|
@@ -42,10 +42,10 @@ class b extends u {
|
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
44
|
const { _messages: t, type: i } = this, s = i === "boolean-choice";
|
|
45
|
-
return
|
|
45
|
+
return a`<div class="interrupt-container"><calcite-notice open kind=neutral width=full><div slot=title>${s ? t.titleConfirm : t.titleInput}</div><div slot=message class="interrupt-message">${p(this._renderMessageContent())}</div></calcite-notice>${this._renderInterruptInput()}<div class="interrupt-actions"><calcite-button appearance=outline @click=${() => this.arcgisCancel.emit()}>${s ? t.cancelButton : t.skipButton}</calcite-button><calcite-button appearance=solid @click=${() => this.arcgisSubmit.emit(i === "boolean-choice" ? !0 : this.#t)}>${s ? t.confirmButton : t.submitButton}</calcite-button></div></div>`;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
c("arcgis-portal-ai-assistant-interrupt", b);
|
|
49
49
|
export {
|
|
50
50
|
b as ArcgisPortalAiAssistantInterrupt
|
|
51
51
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type PortalGroup from "@arcgis/core/portal/PortalGroup.js";
|
|
3
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
4
|
+
import type { GroupBadgesPortal } from "./types.js";
|
|
5
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
|
+
import type { Chip as Chip } from "@esri/calcite-components/components/calcite-chip";
|
|
7
|
+
|
|
8
|
+
/** Groups can have special statuses and capabilities. This component derives and renders badges for those states. */
|
|
9
|
+
export abstract class ArcgisPortalGroupBadges extends LitElement {
|
|
10
|
+
/** @internal */
|
|
11
|
+
protected _messages: {
|
|
12
|
+
Collaboration: {
|
|
13
|
+
title: string;
|
|
14
|
+
tooltip: string;
|
|
15
|
+
};
|
|
16
|
+
FeaturedContent: {
|
|
17
|
+
title: string;
|
|
18
|
+
tooltip: string;
|
|
19
|
+
};
|
|
20
|
+
Gallery: {
|
|
21
|
+
title: string;
|
|
22
|
+
tooltip: string;
|
|
23
|
+
};
|
|
24
|
+
OpenData: {
|
|
25
|
+
title: string;
|
|
26
|
+
tooltip: string;
|
|
27
|
+
};
|
|
28
|
+
SharedUpdate: {
|
|
29
|
+
title: string;
|
|
30
|
+
tooltip: string;
|
|
31
|
+
};
|
|
32
|
+
Partnered: {
|
|
33
|
+
title: string;
|
|
34
|
+
tooltip: string;
|
|
35
|
+
};
|
|
36
|
+
AnyOrg: {
|
|
37
|
+
title: string;
|
|
38
|
+
tooltip: string;
|
|
39
|
+
};
|
|
40
|
+
loading: string;
|
|
41
|
+
} & T9nMeta<{
|
|
42
|
+
Collaboration: {
|
|
43
|
+
title: string;
|
|
44
|
+
tooltip: string;
|
|
45
|
+
};
|
|
46
|
+
FeaturedContent: {
|
|
47
|
+
title: string;
|
|
48
|
+
tooltip: string;
|
|
49
|
+
};
|
|
50
|
+
Gallery: {
|
|
51
|
+
title: string;
|
|
52
|
+
tooltip: string;
|
|
53
|
+
};
|
|
54
|
+
OpenData: {
|
|
55
|
+
title: string;
|
|
56
|
+
tooltip: string;
|
|
57
|
+
};
|
|
58
|
+
SharedUpdate: {
|
|
59
|
+
title: string;
|
|
60
|
+
tooltip: string;
|
|
61
|
+
};
|
|
62
|
+
Partnered: {
|
|
63
|
+
title: string;
|
|
64
|
+
tooltip: string;
|
|
65
|
+
};
|
|
66
|
+
AnyOrg: {
|
|
67
|
+
title: string;
|
|
68
|
+
tooltip: string;
|
|
69
|
+
};
|
|
70
|
+
loading: string;
|
|
71
|
+
}>;
|
|
72
|
+
/** Appearance of the chips used for group badges. */
|
|
73
|
+
accessor appearance: Chip["appearance"] | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Reflected flag that indicates no badges were generated for the current input.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
accessor empty: boolean;
|
|
80
|
+
/** PortalGroup instance for deriving badge states from sourceJSON. */
|
|
81
|
+
accessor group: PortalGroup | undefined;
|
|
82
|
+
/** Current Portal instance. */
|
|
83
|
+
accessor portal: GroupBadgesPortal | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Size of each badge chip.
|
|
86
|
+
*
|
|
87
|
+
* @default "m"
|
|
88
|
+
*/
|
|
89
|
+
accessor scale: Chip["scale"];
|
|
90
|
+
/**
|
|
91
|
+
* Enables tooltip text for each badge.
|
|
92
|
+
*
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
accessor showTooltips: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Full width shows label text, narrow renders icon only.
|
|
98
|
+
*
|
|
99
|
+
* @default "full"
|
|
100
|
+
*/
|
|
101
|
+
accessor width: "full" | "narrow";
|
|
102
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as m } from "../../chunks/runtime.js";
|
|
3
|
+
import { nothing as h, safeClassMap as b, LitElement as f } from "@arcgis/lumina";
|
|
4
|
+
import { u as w } from "../../chunks/useT9n.js";
|
|
5
|
+
import { html as p, css as $ } from "lit";
|
|
6
|
+
const y = ({ appearance: e, badgeType: t, class: i, messages: s, scale: o, showTooltip: a, width: c }) => {
|
|
7
|
+
const n = s[t] ?? { title: t, tooltip: "" }, u = x[t], l = c === "narrow", d = `portal-group-badge-${t}`;
|
|
8
|
+
return p`<calcite-chip id=${d ?? h} class=${b({
|
|
9
|
+
badge: !0,
|
|
10
|
+
"badge--red": t === "SharedUpdate",
|
|
11
|
+
narrow: l,
|
|
12
|
+
[`narrow--${o}`]: l,
|
|
13
|
+
[i]: !0
|
|
14
|
+
})} .value=${t} tabindex=0 .scale=${o} .appearance=${e} .label=${n.title} .icon=${u}>${l ? null : n.title}</calcite-chip>${a ? p`<calcite-tooltip .referenceElement=${d} close-on-click placement=bottom-start offset-distance=6 offset-skidding=0>${l ? p`<h3 class="tooltip-title">${n.title}</h3>` : null}<p class="tooltip-text">${n.tooltip}</p></calcite-tooltip>` : null}`;
|
|
15
|
+
}, x = {
|
|
16
|
+
Collaboration: "collaboration",
|
|
17
|
+
FeaturedContent: "home",
|
|
18
|
+
Gallery: "images",
|
|
19
|
+
OpenData: "open-data",
|
|
20
|
+
SharedUpdate: "configure-editing",
|
|
21
|
+
Partnered: "partnered-collaboration",
|
|
22
|
+
AnyOrg: "zoom-to-object"
|
|
23
|
+
}, v = $`:host{display:flex;flex-wrap:wrap}.portal-group-badges__badge{display:inline-block;margin-inline-end:.25rem}.badge{--portal-group-badge-color: var(--calcite-color-brand);border:0}.badge--red{--portal-group-badge-color: var(--calcite-color-status-danger)}.narrow{box-sizing:border-box;width:2rem;--calcite-chip-spacing-unit-l: 0}.image{border-radius:0;display:inline-flex;align-items:center;justify-content:center;margin-inline-start:.5rem}.image svg{color:var(--portal-group-badge-color)}.narrow--s{width:1.5rem;.image{margin-inline-start:0}}.narrow--m{.image{margin-inline-start:0}}.narrow--l{width:2.75rem;.image{margin-inline-start:.25rem}}.tooltip-title{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1);margin:0 0 .25rem;padding:0}.tooltip-text{font-size:var(--calcite-font-size--2);color:var(--calcite-color-text-1);margin:0;padding:0}`, r = (e) => e.sourceJSON, g = (e) => {
|
|
24
|
+
const t = r(e)?.capabilities;
|
|
25
|
+
return Array.isArray(t) ? t : [];
|
|
26
|
+
}, G = (e) => {
|
|
27
|
+
const t = r(e).orgId;
|
|
28
|
+
return typeof t == "string" ? t : void 0;
|
|
29
|
+
}, O = (e) => {
|
|
30
|
+
const t = r(e).membershipAccess;
|
|
31
|
+
return typeof t == "string" ? t : void 0;
|
|
32
|
+
}, A = (e) => r(e).isOpenData === !0, I = (e) => g(e).includes("distributed");
|
|
33
|
+
function S(e, t) {
|
|
34
|
+
const i = [], s = g(e), o = G(e), a = O(e);
|
|
35
|
+
return t.id && (s.includes("updateitemcontrol") && i.push("SharedUpdate"), A(e) && o === t.id && i.push("OpenData"), t.featuredItemsGroupQuery === `id:${e.id}` && i.push("Gallery")), (r(e).collaborationInfo?.collaborationId || I(e)) && i.push("Collaboration"), !a && !t.isPortal && o !== "none" && i.push("AnyOrg"), a === "collaboration" && i.push("Partnered"), i.includes("SharedUpdate") && !i.includes("Partnered") && o !== t.id && i.splice(i.indexOf("SharedUpdate"), 1), i;
|
|
36
|
+
}
|
|
37
|
+
class C extends f {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments), this._messages = w({ blocking: !0 }), this.badges = [], this.width = "full", this.scale = "m", this.showTooltips = !1, this.empty = !1;
|
|
40
|
+
}
|
|
41
|
+
static {
|
|
42
|
+
this.properties = { badges: 16, group: 0, portal: 0, width: 1, appearance: 1, scale: 1, showTooltips: 5, empty: 7 };
|
|
43
|
+
}
|
|
44
|
+
static {
|
|
45
|
+
this.styles = v;
|
|
46
|
+
}
|
|
47
|
+
willUpdate(t) {
|
|
48
|
+
(t.has("group") || t.has("portal")) && (this.badges = this.group && this.portal ? S(this.group, this.portal) : [], this.empty = this.badges.length === 0);
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
const { appearance: t, badges: i, scale: s, showTooltips: o, width: a } = this;
|
|
52
|
+
return i.map((c) => y({ appearance: t, badgeType: c, class: "portal-group-badges__badge", messages: this._messages, scale: s, showTooltip: o, width: a }));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
m("arcgis-portal-group-badges", C);
|
|
56
|
+
export {
|
|
57
|
+
C as ArcgisPortalGroupBadges
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type Portal from "@arcgis/core/portal/Portal.js";
|
|
3
|
+
import type PortalGroup from "@arcgis/core/portal/PortalGroup.js";
|
|
4
|
+
import type PortalUser from "@arcgis/core/portal/PortalUser.js";
|
|
5
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
6
|
+
import type { InternalUIAction } from "../../types/tracking.js";
|
|
7
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A card for displaying portal group information.
|
|
11
|
+
*
|
|
12
|
+
* @slot [content-top] - Inserted content appears above the card body.
|
|
13
|
+
* @slot [content-end] - Inserted content appears beneath the card details.
|
|
14
|
+
* @slot [actions-start] - Inserted content appears in the footer before owner information.
|
|
15
|
+
* @slot [actions-end] - Inserted content appears in the footer end area.
|
|
16
|
+
*/
|
|
17
|
+
export abstract class ArcgisPortalGroupCard extends LitElement {
|
|
18
|
+
/**
|
|
19
|
+
* Disable interaction when true.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
accessor disabled: boolean;
|
|
24
|
+
/** Partial group JSON from community/groups. */
|
|
25
|
+
accessor group: PortalGroup;
|
|
26
|
+
/**
|
|
27
|
+
* Show the group as partially selected.
|
|
28
|
+
*
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
accessor indeterminate: boolean;
|
|
32
|
+
/** Making this non-empty turns the top section into a link. */
|
|
33
|
+
accessor link: string | undefined;
|
|
34
|
+
/** Optional callback that runs when the link is activated. */
|
|
35
|
+
accessor linkHandler: ((group: PortalGroup) => void) | undefined;
|
|
36
|
+
/** @internal */
|
|
37
|
+
protected messages: {
|
|
38
|
+
lastUpdated: string;
|
|
39
|
+
created: string;
|
|
40
|
+
viewableBy: string;
|
|
41
|
+
everyone: string;
|
|
42
|
+
organization: string;
|
|
43
|
+
groupMembers: string;
|
|
44
|
+
select: string;
|
|
45
|
+
preview: string;
|
|
46
|
+
hidePreview: string;
|
|
47
|
+
openInPortal: string;
|
|
48
|
+
badges: {
|
|
49
|
+
collaboration: string;
|
|
50
|
+
viewOnly: string;
|
|
51
|
+
autoJoin: string;
|
|
52
|
+
hiddenMembers: string;
|
|
53
|
+
};
|
|
54
|
+
} & T9nMeta<{
|
|
55
|
+
lastUpdated: string;
|
|
56
|
+
created: string;
|
|
57
|
+
viewableBy: string;
|
|
58
|
+
everyone: string;
|
|
59
|
+
organization: string;
|
|
60
|
+
groupMembers: string;
|
|
61
|
+
select: string;
|
|
62
|
+
preview: string;
|
|
63
|
+
hidePreview: string;
|
|
64
|
+
openInPortal: string;
|
|
65
|
+
badges: {
|
|
66
|
+
collaboration: string;
|
|
67
|
+
viewOnly: string;
|
|
68
|
+
autoJoin: string;
|
|
69
|
+
hiddenMembers: string;
|
|
70
|
+
};
|
|
71
|
+
}>;
|
|
72
|
+
/** Name of the radio button control for accessibility. */
|
|
73
|
+
accessor name: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Open link in new tab when true.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
accessor newTab: boolean;
|
|
80
|
+
/** Current portal instance. */
|
|
81
|
+
accessor portal: Portal;
|
|
82
|
+
/** Optionally emit preview behavior on click of card. */
|
|
83
|
+
accessor preview: GroupCardPreview | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Whether this card is currently previewed by parent browser state.
|
|
86
|
+
*
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
accessor previewed: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Set to true to mark group as selected.
|
|
92
|
+
*
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
accessor selected: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Type of selection behavior.
|
|
98
|
+
*
|
|
99
|
+
* @default "none"
|
|
100
|
+
*/
|
|
101
|
+
accessor selection: GroupCardSelection;
|
|
102
|
+
/**
|
|
103
|
+
* Show group badges.
|
|
104
|
+
*
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
accessor showBadges: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Show created date detail.
|
|
110
|
+
*
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
accessor showDateCreated: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Show last-updated detail.
|
|
116
|
+
*
|
|
117
|
+
* @default true
|
|
118
|
+
*/
|
|
119
|
+
accessor showDateUpdated: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Show the owner information in the card footer.
|
|
122
|
+
*
|
|
123
|
+
* @default true
|
|
124
|
+
*/
|
|
125
|
+
accessor showOwner: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Show group summary text in card body.
|
|
128
|
+
*
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
accessor showSummary: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Show information on who can view this group.
|
|
134
|
+
*
|
|
135
|
+
* @default true
|
|
136
|
+
*/
|
|
137
|
+
accessor showViewableBy: boolean;
|
|
138
|
+
/** Current signed-in portal user. */
|
|
139
|
+
accessor user: PortalUser | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Select which view to use for the card.
|
|
142
|
+
*
|
|
143
|
+
* @default "list"
|
|
144
|
+
*/
|
|
145
|
+
accessor view: GroupCardView;
|
|
146
|
+
restoreFocus(): Promise<void>;
|
|
147
|
+
/** Emitted when preview is requested from card interaction. */
|
|
148
|
+
readonly arcgisGroupBrowserCardPreview: import("@arcgis/lumina").TargetedEvent<this, PortalGroup | null>;
|
|
149
|
+
/** Fires on internal component interaction for telemetry. */
|
|
150
|
+
readonly arcgisGroupBrowserInternalUIAction: import("@arcgis/lumina").TargetedEvent<this, InternalUIAction>;
|
|
151
|
+
/** Emitted when the group is selected or deselected. */
|
|
152
|
+
readonly arcgisGroupCardSelect: import("@arcgis/lumina").TargetedEvent<this, {
|
|
153
|
+
group: PortalGroup;
|
|
154
|
+
selected: boolean;
|
|
155
|
+
}>;
|
|
156
|
+
readonly "@eventTypes": {
|
|
157
|
+
arcgisGroupBrowserCardPreview: ArcgisPortalGroupCard["arcgisGroupBrowserCardPreview"]["detail"];
|
|
158
|
+
arcgisGroupBrowserInternalUIAction: ArcgisPortalGroupCard["arcgisGroupBrowserInternalUIAction"]["detail"];
|
|
159
|
+
arcgisGroupCardSelect: ArcgisPortalGroupCard["arcgisGroupCardSelect"]["detail"];
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type GroupCardView = "compact" | "list";
|
|
164
|
+
|
|
165
|
+
export type GroupCardSelection = "multiple" | "none" | "single";
|
|
166
|
+
|
|
167
|
+
export type GroupCardPreview = "action" | "top";
|