apiblaze 0.19.15 → 0.19.16
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/index.js +1 -1
- package/dist/react/index.d.mts +4 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +11 -1
- package/dist/react/index.mjs +11 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/react/index.d.mts
CHANGED
|
@@ -26,6 +26,10 @@ interface UsersGroupsWidgetProps {
|
|
|
26
26
|
theme?: UsersGroupsWidgetTheme;
|
|
27
27
|
/** Heading text. Default "Users & groups". */
|
|
28
28
|
title?: string;
|
|
29
|
+
/** Auto-expand the group with this NAME on first load (if it exists) — e.g.
|
|
30
|
+
* a demo landing the user on the group it just talked about. One-shot: the
|
|
31
|
+
* user can still collapse it; later refreshes don't force it back open. */
|
|
32
|
+
defaultOpenGroup?: string;
|
|
29
33
|
className?: string;
|
|
30
34
|
}
|
|
31
35
|
interface UsersGroupsWidgetHandle {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ interface UsersGroupsWidgetProps {
|
|
|
26
26
|
theme?: UsersGroupsWidgetTheme;
|
|
27
27
|
/** Heading text. Default "Users & groups". */
|
|
28
28
|
title?: string;
|
|
29
|
+
/** Auto-expand the group with this NAME on first load (if it exists) — e.g.
|
|
30
|
+
* a demo landing the user on the group it just talked about. One-shot: the
|
|
31
|
+
* user can still collapse it; later refreshes don't force it back open. */
|
|
32
|
+
defaultOpenGroup?: string;
|
|
29
33
|
className?: string;
|
|
30
34
|
}
|
|
31
35
|
interface UsersGroupsWidgetHandle {
|
package/dist/react/index.js
CHANGED
|
@@ -169,7 +169,7 @@ function Typeahead(props) {
|
|
|
169
169
|
] })
|
|
170
170
|
] });
|
|
171
171
|
}
|
|
172
|
-
var UsersGroupsWidget = React.forwardRef(function UsersGroupsWidget2({ endpoint = "/api/apiblaze/groups", theme, title = "Users & groups", className }, ref) {
|
|
172
|
+
var UsersGroupsWidget = React.forwardRef(function UsersGroupsWidget2({ endpoint = "/api/apiblaze/groups", theme, title = "Users & groups", defaultOpenGroup, className }, ref) {
|
|
173
173
|
const t = { ...DEFAULTS, ...theme ?? {} };
|
|
174
174
|
const headerBg = t.headerBackground || t.surface;
|
|
175
175
|
const [access, setAccess] = React.useState("ok");
|
|
@@ -298,6 +298,16 @@ var UsersGroupsWidget = React.forwardRef(function UsersGroupsWidget2({ endpoint
|
|
|
298
298
|
setOpen(g.id);
|
|
299
299
|
loadDetail(g.id);
|
|
300
300
|
}
|
|
301
|
+
const autoOpened = React.useRef(false);
|
|
302
|
+
React.useEffect(() => {
|
|
303
|
+
if (autoOpened.current || !defaultOpenGroup || open) return;
|
|
304
|
+
const g = (groups ?? []).find((x) => x.name === defaultOpenGroup);
|
|
305
|
+
if (g) {
|
|
306
|
+
autoOpened.current = true;
|
|
307
|
+
setOpen(g.id);
|
|
308
|
+
loadDetail(g.id);
|
|
309
|
+
}
|
|
310
|
+
}, [groups, open, defaultOpenGroup, loadDetail]);
|
|
301
311
|
async function act(label, body, after) {
|
|
302
312
|
setPending(label);
|
|
303
313
|
setErr(null);
|
package/dist/react/index.mjs
CHANGED
|
@@ -134,7 +134,7 @@ function Typeahead(props) {
|
|
|
134
134
|
] })
|
|
135
135
|
] });
|
|
136
136
|
}
|
|
137
|
-
var UsersGroupsWidget = React.forwardRef(function UsersGroupsWidget2({ endpoint = "/api/apiblaze/groups", theme, title = "Users & groups", className }, ref) {
|
|
137
|
+
var UsersGroupsWidget = React.forwardRef(function UsersGroupsWidget2({ endpoint = "/api/apiblaze/groups", theme, title = "Users & groups", defaultOpenGroup, className }, ref) {
|
|
138
138
|
const t = { ...DEFAULTS, ...theme ?? {} };
|
|
139
139
|
const headerBg = t.headerBackground || t.surface;
|
|
140
140
|
const [access, setAccess] = React.useState("ok");
|
|
@@ -263,6 +263,16 @@ var UsersGroupsWidget = React.forwardRef(function UsersGroupsWidget2({ endpoint
|
|
|
263
263
|
setOpen(g.id);
|
|
264
264
|
loadDetail(g.id);
|
|
265
265
|
}
|
|
266
|
+
const autoOpened = React.useRef(false);
|
|
267
|
+
React.useEffect(() => {
|
|
268
|
+
if (autoOpened.current || !defaultOpenGroup || open) return;
|
|
269
|
+
const g = (groups ?? []).find((x) => x.name === defaultOpenGroup);
|
|
270
|
+
if (g) {
|
|
271
|
+
autoOpened.current = true;
|
|
272
|
+
setOpen(g.id);
|
|
273
|
+
loadDetail(g.id);
|
|
274
|
+
}
|
|
275
|
+
}, [groups, open, defaultOpenGroup, loadDetail]);
|
|
266
276
|
async function act(label, body, after) {
|
|
267
277
|
setPending(label);
|
|
268
278
|
setErr(null);
|