@arcgis/portal-components 5.2.0-next.84 → 5.2.0-next.86
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/{UWCAB6HI.js → GADH24KO.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-portal-group-browser/customElement.js +108 -107
- package/dist/components/arcgis-portal-group-browser/types.d.ts +14 -2
- package/dist/components/arcgis-portal-group-card/customElement.d.ts +3 -1
- package/dist/components/arcgis-portal-navigation/index.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { keyed as
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { u as
|
|
7
|
-
import { a as
|
|
8
|
-
import { c as
|
|
2
|
+
import { c as B } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as O, html as h } from "lit";
|
|
4
|
+
import { keyed as C } from "lit/directives/keyed.js";
|
|
5
|
+
import { LitElement as U, createEvent as u, nothing as v, safeClassMap as x } from "@arcgis/lumina";
|
|
6
|
+
import { u as b } from "../../chunks/useT9n.js";
|
|
7
|
+
import { a as R } from "../../chunks/functionalities.js";
|
|
8
|
+
import { c as _, a as y } from "../../chunks/string.js";
|
|
9
9
|
import "../arcgis-portal-browser-search/customElement.js";
|
|
10
10
|
import "../arcgis-portal-browser-top-bar/customElement.js";
|
|
11
|
-
import { c as
|
|
11
|
+
import { c as W, a as P } from "../../chunks/portal-browser.js";
|
|
12
12
|
import "../arcgis-portal-group-card/customElement.js";
|
|
13
13
|
import "../arcgis-portal-group-browser-preview/customElement.js";
|
|
14
|
-
import { c as
|
|
15
|
-
import { i as
|
|
16
|
-
import
|
|
17
|
-
import { r as
|
|
14
|
+
import { c as k } from "../../chunks/store.js";
|
|
15
|
+
import { i as A } from "../../chunks/query.js";
|
|
16
|
+
import T from "@arcgis/core/portal/PortalGroup.js";
|
|
17
|
+
import { r as E } from "../../chunks/request.js";
|
|
18
18
|
import { g as M } from "../../chunks/portal.js";
|
|
19
|
-
import { b as
|
|
20
|
-
import { watch as
|
|
21
|
-
import { PortalGroupBrowserSort as
|
|
22
|
-
import { PortalGroupBrowserPagination as
|
|
23
|
-
import { PortalGroupBrowserFilters as
|
|
24
|
-
const
|
|
25
|
-
async function
|
|
26
|
-
const t = `${M(s)}community/groups`, r =
|
|
27
|
-
if (!r.trim() && !
|
|
19
|
+
import { b as f } from "../../chunks/ui.js";
|
|
20
|
+
import { watch as q } from "@arcgis/core/core/reactiveUtils.js";
|
|
21
|
+
import { PortalGroupBrowserSort as L } from "../portal-group-browser-sort/customElement.js";
|
|
22
|
+
import { PortalGroupBrowserPagination as z } from "../portal-group-browser-pagination/customElement.js";
|
|
23
|
+
import { PortalGroupBrowserFilters as Q } from "../portal-group-browser-filters/customElement.js";
|
|
24
|
+
const I = O`:host{position:relative;background-color:var(--calcite-color-background);display:flex;flex-direction:column;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;--portal-group-browser-max-width: var(--group-browser-max-width, 100%);--portal-group-browser-pane-width: 18.75rem;--portal-group-browser-pane-z-index: 11;container-type:inline-size;container-name:portal-group-browser}arcgis-portal-browser{--arcgis-browser-max-width: var(--portal-group-browser-max-width);--arcgis-browser-pane-width: var(--portal-group-browser-pane-width);--arcgis-browser-pane-z-index: var(--portal-group-browser-pane-z-index)}.filters-title__heading{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);line-height:1.2;margin:0;padding:1rem .5rem}.filters-shell{display:block}.filters-shell__top{padding:0}.filters-shell__top--padded{padding:0 1rem 1rem}.filter__accordion-item{--calcite-accordion-item-content-space: .75rem .25rem;--calcite-accordion-icon-margin: .5rem;border-top:1px solid var(--calcite-color-border-1)}.filter__actions-slot{display:flex;align-self:center;align-items:center;line-height:0}.filter__content{margin:0}.filter__content--padded{margin:-.75rem .5rem 0}.filter__content>calcite-tree>calcite-tree-item>a{padding-block:.25rem}.clear-button{line-height:1;margin-inline:.25rem}.custom-date-picker{margin-block:.5rem;margin-inline-start:1.75rem;width:12.75rem}.groups-by-user__label{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.special-groups-settings-option{display:inline-flex;align-items:center;gap:.25rem}.special-groups-settings-icon{display:inline-flex;align-items:center}.group-browser__results{display:grid;gap:.5rem}.group-browser__results--compact{gap:0}.group-browser__result-card{margin:0}@container portal-group-browser (max-width: 640px){:host{--portal-group-browser-pane-width: 100%}}.empty-text-slot{width:100%;height:100%;display:flex;justify-content:center}.empty-text-slot__default{@apply max-w-lg mx-auto px-6 pb-16;max-width:32rem;margin-inline:auto;padding-inline:1.5rem;padding-bottom:4rem;margin-top:min(8rem,30vh)}`;
|
|
25
|
+
async function V(s, e) {
|
|
26
|
+
const t = `${M(s)}community/groups`, r = N(e), i = j(e), o = !!e.searchUser?.trim();
|
|
27
|
+
if (!r.trim() && !o)
|
|
28
28
|
return {
|
|
29
29
|
nextStart: -1,
|
|
30
30
|
num: 0,
|
|
31
31
|
q: r,
|
|
32
|
-
queryParams: { ...
|
|
32
|
+
queryParams: { ...i, q: r },
|
|
33
33
|
results: [],
|
|
34
34
|
start: 0,
|
|
35
35
|
total: 0
|
|
36
36
|
};
|
|
37
|
-
const l = { ...
|
|
37
|
+
const l = { ...i, q: r }, d = await E({
|
|
38
38
|
url: t,
|
|
39
39
|
portal: s,
|
|
40
40
|
params: l
|
|
41
|
-
}),
|
|
42
|
-
const
|
|
43
|
-
return
|
|
41
|
+
}), p = d.results.map((a) => {
|
|
42
|
+
const n = T.fromJSON(a);
|
|
43
|
+
return n.portal = s, n;
|
|
44
44
|
});
|
|
45
45
|
return {
|
|
46
|
-
...
|
|
46
|
+
...d,
|
|
47
47
|
q: r,
|
|
48
48
|
queryParams: l,
|
|
49
|
-
results:
|
|
49
|
+
results: p
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
function
|
|
54
|
-
return !!s &&
|
|
52
|
+
const D = ["created", "modified", "owner", "title"];
|
|
53
|
+
function H(s) {
|
|
54
|
+
return !!s && D.includes(s);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function N(s) {
|
|
57
57
|
const e = [], t = s.baseQuery?.trim();
|
|
58
58
|
t && e.push(`(${t})`);
|
|
59
59
|
const r = s.searchTerm?.trim();
|
|
60
|
-
r && e.push(`(${
|
|
61
|
-
for (const
|
|
62
|
-
typeof
|
|
60
|
+
r && e.push(`(${_(r)})`);
|
|
61
|
+
for (const i of Object.values(s.filters ?? {}))
|
|
62
|
+
typeof i.value == "string" && i.value.trim() && e.push(`(${i.value.trim()})`), typeof i.additionalParams == "string" && i.additionalParams.trim() && e.push(`(${i.additionalParams.trim()})`);
|
|
63
63
|
return e.join(" AND ");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function j(s) {
|
|
66
66
|
return {
|
|
67
67
|
num: s.num,
|
|
68
68
|
start: s.start,
|
|
69
69
|
...s.searchUser ? { searchUserAccess: "groupMember", searchUserName: s.searchUser } : {},
|
|
70
|
-
...s.sortField === "relevance" || !
|
|
70
|
+
...s.sortField === "relevance" || !H(s.sortField) ? {} : {
|
|
71
71
|
sortField: s.sortField,
|
|
72
72
|
sortOrder: s.sortOrder
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function F(s, e = "desc") {
|
|
77
77
|
switch (s) {
|
|
78
78
|
case "owner":
|
|
79
79
|
case "title":
|
|
@@ -86,39 +86,39 @@ function b(s, e = "desc") {
|
|
|
86
86
|
return e;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function J(s) {
|
|
90
90
|
let e, t, r;
|
|
91
|
-
const
|
|
91
|
+
const i = () => {
|
|
92
92
|
e?.();
|
|
93
|
-
const a =
|
|
93
|
+
const a = q(
|
|
94
94
|
() => s.getStore().width,
|
|
95
95
|
() => {
|
|
96
|
-
|
|
96
|
+
o();
|
|
97
97
|
}
|
|
98
98
|
);
|
|
99
99
|
e = () => {
|
|
100
100
|
a.remove();
|
|
101
101
|
};
|
|
102
|
-
},
|
|
103
|
-
const a = s.getStore(),
|
|
104
|
-
a.width !==
|
|
105
|
-
const m =
|
|
102
|
+
}, o = () => {
|
|
103
|
+
const a = s.getStore(), n = a.width || s.getHostWidth() || s.getViewportWidth(), c = Math.min(n, s.getViewportWidth());
|
|
104
|
+
a.width !== c && (a.width = c);
|
|
105
|
+
const m = c > f.md ? "large" : "small";
|
|
106
106
|
s.getResponsiveFormFactor() === "large" && m === "small" && (a.panel = !1, a.filtersExpanded = !1), s.getResponsiveFormFactor() === "small" && m === "large" && (a.panel = !1, a.filtersExpanded = !0), s.setResponsiveFormFactor(m);
|
|
107
107
|
};
|
|
108
108
|
return {
|
|
109
109
|
connect: () => {
|
|
110
110
|
typeof ResizeObserver < "u" && (t = new ResizeObserver((a) => {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
s.setHostWidth(
|
|
111
|
+
const n = a[0]?.contentRect?.width ?? 0;
|
|
112
|
+
if (n > 0) {
|
|
113
|
+
const c = Math.round(n);
|
|
114
|
+
s.setHostWidth(c), s.getStore().width = c, o();
|
|
115
115
|
}
|
|
116
|
-
}), t.observe(s.el)),
|
|
116
|
+
}), t.observe(s.el)), i(), o();
|
|
117
117
|
},
|
|
118
118
|
disconnect: () => {
|
|
119
119
|
r !== void 0 && (cancelAnimationFrame(r), r = void 0), e?.(), t?.disconnect(), t = void 0;
|
|
120
120
|
},
|
|
121
|
-
refreshStoreWatcher:
|
|
121
|
+
refreshStoreWatcher: i,
|
|
122
122
|
handleWindowResize: () => {
|
|
123
123
|
if (s.setViewportWidth(window.innerWidth), !t) {
|
|
124
124
|
if (r !== void 0)
|
|
@@ -127,33 +127,33 @@ function N(s) {
|
|
|
127
127
|
r = void 0;
|
|
128
128
|
const a = Math.round(
|
|
129
129
|
s.el.getBoundingClientRect().width || s.getHostWidth() || s.getViewportWidth()
|
|
130
|
-
),
|
|
131
|
-
|
|
130
|
+
), n = Math.min(a, s.getViewportWidth()), c = s.getStore();
|
|
131
|
+
c.width !== n && (c.width = n), o();
|
|
132
132
|
});
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
o();
|
|
136
136
|
},
|
|
137
|
-
updateResponsiveLayout:
|
|
137
|
+
updateResponsiveLayout: o
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const G = ["title", "relevance", "modified"], S = {
|
|
141
141
|
queryParams: void 0,
|
|
142
142
|
nextStart: -1,
|
|
143
143
|
results: [],
|
|
144
144
|
start: -1,
|
|
145
145
|
num: 0,
|
|
146
146
|
total: 0
|
|
147
|
-
},
|
|
147
|
+
}, $ = [
|
|
148
148
|
"openData",
|
|
149
149
|
"sharedUpdate",
|
|
150
150
|
"distributed",
|
|
151
151
|
"admin",
|
|
152
152
|
"settings"
|
|
153
153
|
];
|
|
154
|
-
class
|
|
154
|
+
class K extends U {
|
|
155
155
|
constructor() {
|
|
156
|
-
super(...arguments), this._messages =
|
|
156
|
+
super(...arguments), this._messages = b({ name: "portal-group-browser", blocking: !0 }), this._browserMessages = b({ name: "portal-browser", blocking: !0 }), this.responsiveLayoutController = J({
|
|
157
157
|
el: this.el,
|
|
158
158
|
getStore: () => this.store,
|
|
159
159
|
getViewportWidth: () => this.viewportWidth,
|
|
@@ -173,9 +173,9 @@ class j extends O {
|
|
|
173
173
|
}, this.handleBrowserFilterRemove = (e) => {
|
|
174
174
|
const t = e.detail;
|
|
175
175
|
t && this.removeFilter(t);
|
|
176
|
-
}, this.selectedOwner = null, this.selectedMembership = null, this.selectedMemberOrg = null, this.selectedSpecialGroup = null, this.selectedAccess = null, this.selectedGroups = [], this.previewGroup = null, this.queryResponse =
|
|
176
|
+
}, this.selectedOwner = null, this.selectedMembership = null, this.selectedMemberOrg = null, this.selectedSpecialGroup = null, this.selectedAccess = null, this.selectedGroups = [], this.previewGroup = null, this.queryResponse = S, this.specialGroupOptions = $, this.responsiveFormFactor = "large", this.viewportWidth = typeof window > "u" ? f.lg : window.innerWidth, this.hostWidth = 0, this.store = k({
|
|
177
177
|
type: "group-browser",
|
|
178
|
-
width: window?.innerWidth ??
|
|
178
|
+
width: window?.innerWidth ?? f.lg,
|
|
179
179
|
hiddenFilters: [],
|
|
180
180
|
filtersEmpty: !1,
|
|
181
181
|
topbarEmpty: !1,
|
|
@@ -186,15 +186,15 @@ class j extends O {
|
|
|
186
186
|
}), this.filters = {}, this.loading = !1, this.formFactor = "large", this.height = "full", this.searchTerm = "", this.cards = {}, this.preview = "top", this.q = "", this.num = 60, this.sort = {
|
|
187
187
|
enabled: !0,
|
|
188
188
|
props: {
|
|
189
|
-
options:
|
|
189
|
+
options: G
|
|
190
190
|
}
|
|
191
|
-
}, this.selection = "none", this.alwaysShowSelection = !1, this.hidePreviewFooter = !1, this.hidePreviewBadges = !1, this.hasIndoorsSpaces = !1, this.arcgisGroupBrowserLoading =
|
|
191
|
+
}, this.selection = "none", this.alwaysShowSelection = !1, this.hidePreviewFooter = !1, this.hidePreviewBadges = !1, this.hasIndoorsSpaces = !1, this.arcgisGroupBrowserLoading = u(), this.arcgisGroupBrowserPreview = u(), this.arcgisGroupBrowserSelect = u(), this.arcgisGroupBrowserSublayerPreview = u(), this.arcgisGroupBrowserUpdate = u(), this.arcgisGroupBrowserInternalUIAction = u(), this.arcgisGroupBrowserUserFilterChange = u(), this.arcgisAriaUpdate = u();
|
|
192
192
|
}
|
|
193
193
|
static {
|
|
194
194
|
this.properties = { selectedGroupsByUser: 16, selectedOwner: 16, selectedMembership: 16, selectedMemberOrg: 16, selectedSpecialGroup: 16, selectedAccess: 16, selectedGroups: 16, previewGroup: 16, queryResponse: 16, specialGroupOptions: 16, sortField: 16, sortOrder: 16, responsiveFormFactor: 16, viewportWidth: 16, hostWidth: 16, store: 0, filters: 0, loading: 5, formFactor: 1, height: 3, searchTerm: 1, selected: 0, cards: 0, preview: 1, q: 1, portal: 0, num: 9, sort: 0, fetch: 0, preflight: 0, searchUser: 1, selection: 1, alwaysShowSelection: 5, hidePreviewFooter: 5, hidePreviewBadges: 5, hasIndoorsSpaces: 5 };
|
|
195
195
|
}
|
|
196
196
|
static {
|
|
197
|
-
this.styles =
|
|
197
|
+
this.styles = I;
|
|
198
198
|
}
|
|
199
199
|
get currentUsername() {
|
|
200
200
|
return this.portal.user?.username ?? "";
|
|
@@ -245,7 +245,7 @@ class j extends O {
|
|
|
245
245
|
this.requestUpdate();
|
|
246
246
|
}
|
|
247
247
|
syncSortFromConfig() {
|
|
248
|
-
const e = this.sort, t = e.props?.options ??
|
|
248
|
+
const e = this.sort, t = e.props?.options ?? G;
|
|
249
249
|
if (!e.enabled) {
|
|
250
250
|
this.sortField = void 0, this.sortOrder = void 0;
|
|
251
251
|
return;
|
|
@@ -254,8 +254,8 @@ class j extends O {
|
|
|
254
254
|
this.sortField = void 0, this.sortOrder = void 0;
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
|
-
const r = e.props?.field,
|
|
258
|
-
this.sortField =
|
|
257
|
+
const r = e.props?.field, i = r && t.includes(r) ? r : t[0];
|
|
258
|
+
this.sortField = i, this.sortOrder = e.props?.order ?? F(i, this.sortOrder);
|
|
259
259
|
}
|
|
260
260
|
async updateSpecialGroupOptions() {
|
|
261
261
|
if (!this.portal) {
|
|
@@ -264,11 +264,11 @@ class j extends O {
|
|
|
264
264
|
}
|
|
265
265
|
let e = "";
|
|
266
266
|
try {
|
|
267
|
-
e = await
|
|
267
|
+
e = await A(this.portal);
|
|
268
268
|
} catch {
|
|
269
269
|
e = "";
|
|
270
270
|
}
|
|
271
|
-
this.specialGroupOptions =
|
|
271
|
+
this.specialGroupOptions = $.filter((t) => !(t === "openData" && this.portal.isPortal || // https://devtopia.esri.com/webgis/arcgis-portal-app/issues/37831
|
|
272
272
|
t === "distributed" && this.hasIndoorsSpaces || // https://devtopia.esri.com/WebGIS/arcgis-portal-app/issues/45449 orgs with no settings
|
|
273
273
|
t === "settings" && !e)), this.selectedSpecialGroup && !this.specialGroupOptions.includes(this.selectedSpecialGroup) && this.removeFilter("specialGroups");
|
|
274
274
|
}
|
|
@@ -281,11 +281,11 @@ class j extends O {
|
|
|
281
281
|
const t = this.store.filters[e];
|
|
282
282
|
t && (this.store.filters = {
|
|
283
283
|
...this.store.filters,
|
|
284
|
-
[e]:
|
|
284
|
+
[e]: W(t)
|
|
285
285
|
}, this.resetSelectionByFilterId(e), this.publishFilterStateChange(), this.fetchGroups());
|
|
286
286
|
}
|
|
287
287
|
clearFilters() {
|
|
288
|
-
this.store.filters =
|
|
288
|
+
this.store.filters = P(this.store.filters, {
|
|
289
289
|
hiddenFilterIds: this.store.hiddenFilters
|
|
290
290
|
}), this.resetAllFilterSelections(), this.publishFilterStateChange(), this.fetchGroups();
|
|
291
291
|
}
|
|
@@ -314,7 +314,7 @@ class j extends O {
|
|
|
314
314
|
this.selectedSpecialGroup = e.value;
|
|
315
315
|
break;
|
|
316
316
|
default:
|
|
317
|
-
|
|
317
|
+
R(e);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
selectGroup(e) {
|
|
@@ -358,7 +358,7 @@ class j extends O {
|
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
async handleSortFieldChange(e) {
|
|
361
|
-
this.sortField = e, this.sortOrder =
|
|
361
|
+
this.sortField = e, this.sortOrder = F(e, this.sortOrder), this.loading = !0, this.arcgisGroupBrowserLoading.emit();
|
|
362
362
|
const t = this.createQuery({ start: 1, total: 0 });
|
|
363
363
|
await this.fetchAndEmit(t, this.searchTerm);
|
|
364
364
|
}
|
|
@@ -379,7 +379,7 @@ class j extends O {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
async queryGroups(e) {
|
|
382
|
-
return await (this.fetch?.(e) ??
|
|
382
|
+
return await (this.fetch?.(e) ?? V(this.portal, e));
|
|
383
383
|
}
|
|
384
384
|
async fetchAndEmit(e, t) {
|
|
385
385
|
this.preflight && (e = await this.preflight(e));
|
|
@@ -406,76 +406,77 @@ class j extends O {
|
|
|
406
406
|
}
|
|
407
407
|
async handlePage({ num: e, start: t, total: r }) {
|
|
408
408
|
this.loading = !0, this.arcgisGroupBrowserLoading.emit();
|
|
409
|
-
const
|
|
410
|
-
await this.fetchAndEmit(
|
|
409
|
+
const i = this.createQuery({ start: t, num: e, total: r });
|
|
410
|
+
await this.fetchAndEmit(i, this.searchTerm);
|
|
411
411
|
}
|
|
412
412
|
getBrowserResponseFromQueryResponse(e) {
|
|
413
|
-
const { nextStart: t, num: r, queryParams:
|
|
413
|
+
const { nextStart: t, num: r, queryParams: i, results: o, start: l, total: d } = e ?? S;
|
|
414
414
|
return {
|
|
415
415
|
nextStart: t ?? -1,
|
|
416
|
-
num: r ??
|
|
417
|
-
results:
|
|
418
|
-
start: l ??
|
|
419
|
-
total:
|
|
416
|
+
num: r ?? i?.num ?? 0,
|
|
417
|
+
results: o,
|
|
418
|
+
start: l ?? i?.start ?? 1,
|
|
419
|
+
total: d
|
|
420
420
|
};
|
|
421
421
|
}
|
|
422
422
|
async formatRange({ start: e, end: t, total: r }) {
|
|
423
423
|
if (this._messages._lang === "en")
|
|
424
424
|
return [`${e}-${t} of ${r}`, `${e}-${t} of ${r} group${r === "1" ? "" : "s"}`];
|
|
425
|
-
const
|
|
426
|
-
return [
|
|
425
|
+
const o = this._messages.browser, l = { start: e, end: t, total: r }, d = y(o.pageRange, l), p = y(o.pageRangeAria, l);
|
|
426
|
+
return [d, p];
|
|
427
427
|
}
|
|
428
428
|
getPreviewFooterActionsEmpty() {
|
|
429
429
|
return !this.el?.querySelector('[slot="preview-footer-action"]');
|
|
430
430
|
}
|
|
431
431
|
renderTopBar() {
|
|
432
|
-
return
|
|
432
|
+
return h`<arcgis-portal-browser-top-bar slot=top-bar .store=${this.store}><arcgis-portal-browser-search slot=search .store=${this.store} .term=${this.searchTerm} @arcgisBrowserSearch=${(e) => {
|
|
433
433
|
this.handleSearch(e.detail);
|
|
434
434
|
}}></arcgis-portal-browser-search></arcgis-portal-browser-top-bar>`;
|
|
435
435
|
}
|
|
436
436
|
renderEmptyTextSlot(e, t) {
|
|
437
|
-
return
|
|
437
|
+
return h`<div slot=${e ?? v} class="empty-text-slot"><slot name=${e ?? v}><p class="empty-text-slot__default">${t}</p></slot></div>`;
|
|
438
438
|
}
|
|
439
439
|
renderContent() {
|
|
440
|
-
const e = new Set(this.selectedGroups.map((
|
|
441
|
-
const
|
|
440
|
+
const e = new Set(this.selectedGroups.map((i) => i.id)), t = this.queryResponse.results.map((i) => {
|
|
441
|
+
const o = this.cards.group?.(i) ?? {}, l = o.view ?? this.store.view ?? "list";
|
|
442
442
|
return {
|
|
443
|
-
group:
|
|
444
|
-
cardProps:
|
|
443
|
+
group: i,
|
|
444
|
+
cardProps: o,
|
|
445
|
+
slots: o.slots,
|
|
445
446
|
view: l
|
|
446
447
|
};
|
|
447
|
-
}), r = t.length > 0 && t.every(({ view:
|
|
448
|
-
return
|
|
449
|
-
const
|
|
450
|
-
return
|
|
451
|
-
this.handleGroupCardSelect(
|
|
452
|
-
}} @arcgisGroupBrowserCardPreview=${(
|
|
453
|
-
const
|
|
454
|
-
if (this.store.filtersExpanded = !1, !
|
|
448
|
+
}), r = t.length > 0 && t.every(({ view: i }) => i === "compact");
|
|
449
|
+
return h`<div class=${x({ "group-browser__results": !0, "group-browser__results--compact": r })} .part=${"results"}>${t.map(({ group: i, cardProps: o, slots: l, view: d }) => {
|
|
450
|
+
const p = i.id, a = l?.contentTop?.(i), n = l?.contentEnd?.(i), c = l?.actionsStart?.(i), m = l?.actionsEnd?.(i);
|
|
451
|
+
return C(p, h`<arcgis-portal-group-card class="group-browser__result-card" .portal=${this.portal} .group=${i} .user=${o.user} .indeterminate=${o.indeterminate} .view=${d} .selection=${this.selection} .selected=${e.has(p)} .preview=${o.preview ?? this.preview} .previewed=${o.previewed ?? this.store.preview === p} .name=${o.name} .showSummary=${o.showSummary ?? !0} .hideBadges=${o.hideBadges ?? !1} .hideDateUpdated=${o.hideDateUpdated ?? !1} .showDateCreated=${o.showDateCreated ?? !1} .hideViewableBy=${o.hideViewableBy ?? !1} .hideOwner=${o.hideOwner ?? !1} .link=${o.link} .linkHandler=${o.linkHandler} .newTab=${o.newTab ?? !1} .disabled=${o.disabled ?? !1} @arcgisGroupCardSelect=${(w) => {
|
|
452
|
+
this.handleGroupCardSelect(w);
|
|
453
|
+
}} @arcgisGroupBrowserCardPreview=${(w) => {
|
|
454
|
+
const g = w.detail;
|
|
455
|
+
if (this.store.filtersExpanded = !1, !g || this.store.preview === g.id) {
|
|
455
456
|
this.closePreview();
|
|
456
457
|
return;
|
|
457
458
|
}
|
|
458
|
-
this.restoreFocusTarget =
|
|
459
|
-
}}
|
|
459
|
+
this.restoreFocusTarget = w.currentTarget, this.store.preview = g.id, this.previewGroup = g, this.arcgisGroupBrowserPreview.emit(g);
|
|
460
|
+
}}>${a && h`<div slot=content-top>${a}</div>` || ""}${n && h`<div slot=content-end>${n}</div>` || ""}${c && h`<div slot=actions-start>${c}</div>` || ""}${m && h`<div slot=actions-end>${m}</div>` || ""}</arcgis-portal-group-card>`);
|
|
460
461
|
})}</div>`;
|
|
461
462
|
}
|
|
462
463
|
render() {
|
|
463
464
|
const e = this.responsiveFormFactor === "small" ? "small" : this.formFactor;
|
|
464
|
-
return
|
|
465
|
+
return h`<arcgis-portal-browser .store=${this.store} .response=${this.getBrowserResponseFromQueryResponse(this.queryResponse)} .loading=${this.loading} .formFactor=${e} .height=${this.height} .searchTerm=${this.searchTerm} .rangeFormatter=${this.formatRange} .selected=${this.selectedGroups} .alwaysShowSelection=${this.alwaysShowSelection} @arcgisBrowserFilterClear=${this.handleBrowserFilterClear} @arcgisBrowserFilterRemove=${this.handleBrowserFilterRemove} @arcgisAriaUpdate=${(t) => {
|
|
465
466
|
this.arcgisAriaUpdate.emit(t.detail);
|
|
466
|
-
}}><slot name=top-bar slot=top-bar>${this.renderTopBar()}</slot><slot name=content-start slot=content-start></slot><slot name=selection slot=selection></slot><slot name=actions slot=actions></slot><slot name=view slot=view></slot>${
|
|
467
|
+
}}><slot name=top-bar slot=top-bar>${this.renderTopBar()}</slot><slot name=content-start slot=content-start></slot><slot name=selection slot=selection></slot><slot name=actions slot=actions></slot><slot name=view slot=view></slot>${L({ slot: "sort", sort: this.sort, formFactor: e, sortField: this.sortField, sortOrder: this.sortOrder, onSortFieldChange: (t) => {
|
|
467
468
|
this.handleSortFieldChange(t);
|
|
468
469
|
}, onSortOrderChange: (t) => {
|
|
469
470
|
this.handleSortOrderChange(t);
|
|
470
|
-
} })}<slot name=content slot=content>${this.renderContent()}</slot>${
|
|
471
|
+
} })}<slot name=content slot=content>${this.renderContent()}</slot>${z({ slot: "pagination", store: this.store, total: this.queryResponse.total, start: this.queryResponse?.queryParams?.start ?? 1, num: this.queryResponse?.queryParams?.num ?? this.num, onPage: (t) => {
|
|
471
472
|
this.handlePage(t);
|
|
472
|
-
} })}<slot name=content-end slot=content-end></slot><slot name=preview slot=preview>${this.previewGroup &&
|
|
473
|
+
} })}<slot name=content-end slot=content-end></slot><slot name=preview slot=preview>${this.previewGroup && h`<arcgis-portal-group-browser-preview .group=${this.previewGroup} .portal=${this.portal} .user=${this.portal.user ?? void 0} .hideBadges=${this.hidePreviewBadges} .hidePreviewFooter=${this.hidePreviewFooter} .currentResponse=${this.queryResponse} .previewFooterActionsSpaced=${!this.getPreviewFooterActionsEmpty()} @arcgisGroupBrowserInternalUIAction=${(t) => {
|
|
473
474
|
this.arcgisGroupBrowserInternalUIAction.emit(t.detail);
|
|
474
475
|
}} @arcgisGroupBrowserPreviewClose=${() => {
|
|
475
476
|
this.closePreview({ restoreFocus: !0 });
|
|
476
477
|
}} @arcgisPreviewClose=${() => {
|
|
477
478
|
this.closePreview({ restoreFocus: !0 });
|
|
478
|
-
}}><slot name=preview-footer-action slot=footer-action></slot></arcgis-portal-group-browser-preview>` || ""}</slot>${this.renderEmptyTextSlot("no-results", this._messages.content.noResults)}${this.renderEmptyTextSlot("no-content", this._messages.content.noContent)}<slot name=scroll-end slot=scroll-end></slot>${
|
|
479
|
+
}}><slot name=preview-footer-action slot=footer-action></slot></arcgis-portal-group-browser-preview>` || ""}</slot>${this.renderEmptyTextSlot("no-results", this._messages.content.noResults)}${this.renderEmptyTextSlot("no-content", this._messages.content.noContent)}<slot name=scroll-end slot=scroll-end></slot>${Q({ slot: "filters", filters: this.filters, messages: this._messages, browserMessages: this._browserMessages, store: this.store, portal: this.portal, hasIndoorsSpaces: this.hasIndoorsSpaces, selectedGroupsByUser: this.selectedGroupsByUser, selectedOwner: this.selectedOwner, selectedMembership: this.selectedMembership, selectedMemberOrg: this.selectedMemberOrg, selectedSpecialGroup: this.selectedSpecialGroup, specialGroupOptions: this.specialGroupOptions, selectedAccess: this.selectedAccess, isFilterActive: (t) => this.isFilterActive(t), handleSelect: (t) => {
|
|
479
480
|
this.setFilterSelection(t);
|
|
480
481
|
}, handleUserFilterChange: (t) => {
|
|
481
482
|
this.arcgisGroupBrowserUserFilterChange.emit(t);
|
|
@@ -486,7 +487,7 @@ class j extends O {
|
|
|
486
487
|
} })}</arcgis-portal-browser>`;
|
|
487
488
|
}
|
|
488
489
|
}
|
|
489
|
-
|
|
490
|
+
B("arcgis-portal-group-browser", K);
|
|
490
491
|
export {
|
|
491
|
-
|
|
492
|
+
K as ArcgisPortalGroupBrowser
|
|
492
493
|
};
|
|
@@ -3,7 +3,7 @@ import type { SearchResult } from "../../types/search.js";
|
|
|
3
3
|
import type { PortalBrowserSortField, PortalBrowserSortOrder } from "../arcgis-portal-browser-sort/utils.js";
|
|
4
4
|
import type { PortalBrowserState } from "../arcgis-portal-browser/utils/store.js";
|
|
5
5
|
import type { BrowserPageDetail } from "../arcgis-portal-browser/utils/types.js";
|
|
6
|
-
import type { PortalGroupCardProps } from "../arcgis-portal-group-card/customElement.js";
|
|
6
|
+
import type { PortalGroupCardProps, PortalGroupCardSlotType } from "../arcgis-portal-group-card/customElement.js";
|
|
7
7
|
|
|
8
8
|
export interface PortalGroupBrowserFiltersConfig {
|
|
9
9
|
created?: GroupFilterConfig<PortalGroupBrowserDateFilterProps>;
|
|
@@ -37,7 +37,7 @@ export interface GroupBrowserState extends PortalBrowserState<GroupBrowserFilter
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export interface PortalGroupBrowserCardsConfig {
|
|
40
|
-
group?: (group: PortalGroup) =>
|
|
40
|
+
group?: (group: PortalGroup) => PortalGroupBrowserGroupCardConfig;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export interface PortalGroupBrowserSearchResult extends SearchResult<PortalGroup> {
|
|
@@ -117,6 +117,11 @@ export interface PortalGroupBrowserQueryParams {
|
|
|
117
117
|
start?: number;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
export type PortalGroupBrowserGroupCardConfig = PortalGroupCardProps
|
|
121
|
+
& {
|
|
122
|
+
slots?: PortalGroupBrowserCardSlotsConfig;
|
|
123
|
+
};
|
|
124
|
+
|
|
120
125
|
export interface PortalGroupBrowserDateSelection {
|
|
121
126
|
range: PortalGroupBrowserDateRange | null;
|
|
122
127
|
start: Date | number | string | null;
|
|
@@ -174,6 +179,13 @@ export interface PortalGroupBrowserDateFilterSharedProps {
|
|
|
174
179
|
serverProperty?: string;
|
|
175
180
|
}
|
|
176
181
|
|
|
182
|
+
export interface PortalGroupBrowserCardSlotsConfig {
|
|
183
|
+
actionsEnd?: (group: PortalGroup) => PortalGroupCardSlotType;
|
|
184
|
+
actionsStart?: (group: PortalGroup) => PortalGroupCardSlotType;
|
|
185
|
+
contentEnd?: (group: PortalGroup) => PortalGroupCardSlotType;
|
|
186
|
+
contentTop?: (group: PortalGroup) => PortalGroupCardSlotType;
|
|
187
|
+
}
|
|
188
|
+
|
|
177
189
|
export type PortalGroupBrowserOwner = "inOrg" | "outsideOrg" | "owner";
|
|
178
190
|
|
|
179
191
|
export type PortalGroupBrowserMembership = "anyOrg" | "collaboration" | "org";
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import type Portal from "@arcgis/core/portal/Portal.js";
|
|
3
3
|
import type PortalGroup from "@arcgis/core/portal/PortalGroup.js";
|
|
4
4
|
import type PortalUser from "@arcgis/core/portal/PortalUser.js";
|
|
5
|
-
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
5
|
+
import type { JsxNode, PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
6
6
|
import type { InternalUIAction } from "../../types/tracking.js";
|
|
7
7
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
8
8
|
|
|
9
9
|
export type PortalGroupCardProps = Partial<Pick<ArcgisPortalGroupCard, "disabled" | "hideBadges" | "hideDateUpdated" | "hideOwner" | "hideViewableBy" | "indeterminate" | "link" | "linkHandler" | "name" | "newTab" | "preview" | "previewed" | "selected" | "selection" | "showDateCreated" | "showSummary" | "user" | "view">>;
|
|
10
10
|
|
|
11
|
+
export type PortalGroupCardSlotType = JsxNode;
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* A card for displaying portal group information.
|
|
13
15
|
*
|
|
@@ -2,13 +2,13 @@ import "@esri/calcite-components/components/calcite-chip";
|
|
|
2
2
|
import "@esri/calcite-components/components/calcite-tooltip";
|
|
3
3
|
import "@esri/calcite-components/components/calcite-list-item";
|
|
4
4
|
import "@esri/calcite-components/components/calcite-action";
|
|
5
|
-
import "@esri/calcite-components/components/calcite-dropdown-item";
|
|
6
5
|
import "@esri/calcite-components/components/calcite-icon";
|
|
7
6
|
import "@esri/calcite-components/components/calcite-popover";
|
|
8
7
|
import "@esri/calcite-components/components/calcite-list";
|
|
9
8
|
import "../arcgis-portal-item-type/index.js";
|
|
10
9
|
import "@esri/calcite-components/components/calcite-loader";
|
|
11
10
|
import "@esri/calcite-components/components/calcite-button";
|
|
11
|
+
import "@esri/calcite-components/components/calcite-dropdown-item";
|
|
12
12
|
import "@esri/calcite-components/components/calcite-input";
|
|
13
13
|
import "@esri/calcite-components/components/calcite-dropdown";
|
|
14
14
|
import "../arcgis-portal-user-avatar/index.js";
|