@rebasepro/core 0.3.0 → 0.4.0
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/components/LoginView/LoginView.d.ts +9 -1
- package/dist/components/common/types.d.ts +3 -3
- package/dist/hooks/data/useCollectionFetch.d.ts +12 -1
- package/dist/index.es.js +160 -124
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +160 -124
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/components/LoginView/LoginView.tsx +27 -5
- package/src/components/common/types.tsx +3 -3
- package/src/components/common/useDataTableController.tsx +47 -35
- package/src/hooks/data/useCollectionFetch.tsx +27 -4
- package/src/hooks/data/useUserSelector.tsx +1 -1
- package/src/hooks/useResolvedComponent.tsx +3 -3
- package/src/locales/en.ts +2 -2
- package/src/util/previews.ts +9 -1
|
@@ -92,10 +92,18 @@ export interface LoginViewProps {
|
|
|
92
92
|
* If not set, derived from `authController.capabilities.registration`.
|
|
93
93
|
*/
|
|
94
94
|
registrationEnabled?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Pre-fill the email field (e.g. for demo or testing environments).
|
|
97
|
+
*/
|
|
98
|
+
defaultEmail?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Pre-fill the password field (e.g. for demo or testing environments).
|
|
101
|
+
*/
|
|
102
|
+
defaultPassword?: string;
|
|
95
103
|
}
|
|
96
104
|
/**
|
|
97
105
|
* Generic login view component that works with any AuthControllerExtended.
|
|
98
106
|
* Feature-detects capabilities to show/hide login methods.
|
|
99
107
|
* @group Core
|
|
100
108
|
*/
|
|
101
|
-
export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent }: LoginViewProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent, defaultEmail, defaultPassword }: LoginViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Property } from "@rebasepro/types";
|
|
1
|
+
import type { Property, Entity } from "@rebasepro/types";
|
|
2
2
|
import { CollectionSize, SelectedCellProps } from "@rebasepro/types";
|
|
3
3
|
export type EntityCollectionTableController<M extends Record<string, unknown>> = {
|
|
4
4
|
/**
|
|
@@ -26,7 +26,7 @@ export type EntityCollectionTableController<M extends Record<string, unknown>> =
|
|
|
26
26
|
* Callback used when the value of a cell has changed.
|
|
27
27
|
* @param params
|
|
28
28
|
*/
|
|
29
|
-
onValueChange?: (params: OnCellValueChangeParams<unknown, M
|
|
29
|
+
onValueChange?: (params: OnCellValueChangeParams<unknown, Entity<M>>) => void;
|
|
30
30
|
/**
|
|
31
31
|
* Size of the elements in the collection
|
|
32
32
|
*/
|
|
@@ -56,7 +56,7 @@ export type UniqueFieldValidator = (props: {
|
|
|
56
56
|
* Callback when a cell has changed in a table
|
|
57
57
|
* @group Collection components
|
|
58
58
|
*/
|
|
59
|
-
export type OnCellValueChange<T, M extends Record<string, unknown>> = (params: OnCellValueChangeParams<T, M
|
|
59
|
+
export type OnCellValueChange<T, M extends Record<string, unknown>> = (params: OnCellValueChangeParams<T, Entity<M>>) => Promise<void> | void;
|
|
60
60
|
/**
|
|
61
61
|
* @group Collection components
|
|
62
62
|
*/
|
|
@@ -16,6 +16,14 @@ export interface CollectionFetchProps<M extends Record<string, any>> {
|
|
|
16
16
|
* Number of entities to fetch
|
|
17
17
|
*/
|
|
18
18
|
itemCount?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Number of items to skip
|
|
21
|
+
*/
|
|
22
|
+
offset?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Page number (1-indexed), alternative to offset
|
|
25
|
+
*/
|
|
26
|
+
page?: number;
|
|
19
27
|
/**
|
|
20
28
|
* Filter the fetched data by the property
|
|
21
29
|
*/
|
|
@@ -37,6 +45,7 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
|
|
|
37
45
|
dataLoading: boolean;
|
|
38
46
|
noMoreToLoad: boolean;
|
|
39
47
|
dataLoadingError?: Error;
|
|
48
|
+
totalCount?: number;
|
|
40
49
|
}
|
|
41
50
|
/**
|
|
42
51
|
* This hook is used to fetch collections using a given collection
|
|
@@ -45,7 +54,9 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
|
|
|
45
54
|
* @param filterValues
|
|
46
55
|
* @param sortBy
|
|
47
56
|
* @param itemCount
|
|
57
|
+
* @param offset
|
|
58
|
+
* @param page
|
|
48
59
|
* @param searchString
|
|
49
60
|
* @group Hooks and utilities
|
|
50
61
|
*/
|
|
51
|
-
export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
|
|
62
|
+
export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path, collection, filterValues, sortBy, itemCount, offset, page, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
|
package/dist/index.es.js
CHANGED
|
@@ -268,13 +268,15 @@ const useData = () => {
|
|
|
268
268
|
return useContext(RebaseDataContext);
|
|
269
269
|
};
|
|
270
270
|
function useCollectionFetch(t0) {
|
|
271
|
-
const $ = c(
|
|
271
|
+
const $ = c(30);
|
|
272
272
|
const {
|
|
273
273
|
path,
|
|
274
274
|
collection,
|
|
275
275
|
filterValues,
|
|
276
276
|
sortBy,
|
|
277
277
|
itemCount,
|
|
278
|
+
offset,
|
|
279
|
+
page,
|
|
278
280
|
searchString
|
|
279
281
|
} = t0;
|
|
280
282
|
const dataClient = useData();
|
|
@@ -318,8 +320,9 @@ function useCollectionFetch(t0) {
|
|
|
318
320
|
const [dataLoading, setDataLoading] = useState(false);
|
|
319
321
|
const [dataLoadingError, setDataLoadingError] = useState();
|
|
320
322
|
const [noMoreToLoad, setNoMoreToLoad] = useState(false);
|
|
323
|
+
const [totalCount, setTotalCount] = useState();
|
|
321
324
|
let t3;
|
|
322
|
-
if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !==
|
|
325
|
+
if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !== offset || $[7] !== orderByParams || $[8] !== page || $[9] !== path || $[10] !== searchString || $[11] !== whereParams) {
|
|
323
326
|
t3 = () => {
|
|
324
327
|
setDataLoading(true);
|
|
325
328
|
const onEntitiesUpdate = async (res) => {
|
|
@@ -328,12 +331,14 @@ function useCollectionFetch(t0) {
|
|
|
328
331
|
setDataLoadingError(void 0);
|
|
329
332
|
setData(entities.map(_temp$7));
|
|
330
333
|
setNoMoreToLoad(!res.meta.hasMore);
|
|
334
|
+
setTotalCount(res.meta.total);
|
|
331
335
|
};
|
|
332
336
|
const onError = (error) => {
|
|
333
337
|
console.error("ERROR", error);
|
|
334
338
|
setDataLoading(false);
|
|
335
339
|
setData([]);
|
|
336
340
|
setDataLoadingError(error);
|
|
341
|
+
setTotalCount(void 0);
|
|
337
342
|
};
|
|
338
343
|
const accessor = dataClient.collection(path);
|
|
339
344
|
const hasRelations = collection.properties && Object.values(collection.properties).some(_temp2$4);
|
|
@@ -342,6 +347,8 @@ function useCollectionFetch(t0) {
|
|
|
342
347
|
return accessor.listen({
|
|
343
348
|
where: whereParams,
|
|
344
349
|
limit: itemCount,
|
|
350
|
+
offset,
|
|
351
|
+
page,
|
|
345
352
|
orderBy: orderByParams,
|
|
346
353
|
searchString,
|
|
347
354
|
include: includeParams
|
|
@@ -353,6 +360,8 @@ function useCollectionFetch(t0) {
|
|
|
353
360
|
accessor.find({
|
|
354
361
|
where: whereParams,
|
|
355
362
|
limit: itemCount,
|
|
363
|
+
offset,
|
|
364
|
+
page,
|
|
356
365
|
orderBy: orderByParams,
|
|
357
366
|
searchString,
|
|
358
367
|
include: includeParams
|
|
@@ -366,46 +375,52 @@ function useCollectionFetch(t0) {
|
|
|
366
375
|
$[3] = collection.properties;
|
|
367
376
|
$[4] = dataClient;
|
|
368
377
|
$[5] = itemCount;
|
|
369
|
-
$[6] =
|
|
370
|
-
$[7] =
|
|
371
|
-
$[8] =
|
|
372
|
-
$[9] =
|
|
373
|
-
$[10] =
|
|
378
|
+
$[6] = offset;
|
|
379
|
+
$[7] = orderByParams;
|
|
380
|
+
$[8] = page;
|
|
381
|
+
$[9] = path;
|
|
382
|
+
$[10] = searchString;
|
|
383
|
+
$[11] = whereParams;
|
|
384
|
+
$[12] = t3;
|
|
374
385
|
} else {
|
|
375
|
-
t3 = $[
|
|
386
|
+
t3 = $[12];
|
|
376
387
|
}
|
|
377
388
|
let t4;
|
|
378
|
-
if ($[
|
|
379
|
-
t4 = [path, itemCount, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
if ($[13] !== collection || $[14] !== currentSort || $[15] !== dataClient || $[16] !== filterValues || $[17] !== itemCount || $[18] !== offset || $[19] !== page || $[20] !== path || $[21] !== searchString || $[22] !== sortByProperty) {
|
|
390
|
+
t4 = [path, itemCount, offset, page, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
|
|
391
|
+
$[13] = collection;
|
|
392
|
+
$[14] = currentSort;
|
|
393
|
+
$[15] = dataClient;
|
|
394
|
+
$[16] = filterValues;
|
|
395
|
+
$[17] = itemCount;
|
|
396
|
+
$[18] = offset;
|
|
397
|
+
$[19] = page;
|
|
398
|
+
$[20] = path;
|
|
399
|
+
$[21] = searchString;
|
|
400
|
+
$[22] = sortByProperty;
|
|
401
|
+
$[23] = t4;
|
|
402
|
+
} else {
|
|
403
|
+
t4 = $[23];
|
|
391
404
|
}
|
|
392
405
|
useEffect(t3, t4);
|
|
393
406
|
let t5;
|
|
394
407
|
let t6;
|
|
395
|
-
if ($[
|
|
408
|
+
if ($[24] !== data || $[25] !== dataLoading || $[26] !== dataLoadingError || $[27] !== noMoreToLoad || $[28] !== totalCount) {
|
|
396
409
|
t6 = {
|
|
397
410
|
data,
|
|
398
411
|
dataLoading,
|
|
399
412
|
dataLoadingError,
|
|
400
|
-
noMoreToLoad
|
|
413
|
+
noMoreToLoad,
|
|
414
|
+
totalCount
|
|
401
415
|
};
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
416
|
+
$[24] = data;
|
|
417
|
+
$[25] = dataLoading;
|
|
418
|
+
$[26] = dataLoadingError;
|
|
419
|
+
$[27] = noMoreToLoad;
|
|
420
|
+
$[28] = totalCount;
|
|
421
|
+
$[29] = t6;
|
|
407
422
|
} else {
|
|
408
|
-
t6 = $[
|
|
423
|
+
t6 = $[29];
|
|
409
424
|
}
|
|
410
425
|
t5 = t6;
|
|
411
426
|
return t5;
|
|
@@ -883,7 +898,7 @@ function useUserSelector({
|
|
|
883
898
|
};
|
|
884
899
|
}, []);
|
|
885
900
|
const getUser = useCallback((uid) => {
|
|
886
|
-
return userManagement?.getUser(uid) ?? null;
|
|
901
|
+
return userManagement?.getUser?.(uid) ?? null;
|
|
887
902
|
}, [userManagement]);
|
|
888
903
|
return useMemo(() => ({
|
|
889
904
|
items,
|
|
@@ -2629,15 +2644,18 @@ function useDataTableController({
|
|
|
2629
2644
|
if (filterValues_0) {
|
|
2630
2645
|
Object.entries(filterValues_0).forEach(([key, value]) => {
|
|
2631
2646
|
if (value && Array.isArray(value)) {
|
|
2632
|
-
const [
|
|
2633
|
-
const
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
stringVal
|
|
2637
|
-
|
|
2638
|
-
|
|
2647
|
+
const conditions = Array.isArray(value[0]) ? value : [value];
|
|
2648
|
+
const [op, val] = conditions[0] || [];
|
|
2649
|
+
if (op) {
|
|
2650
|
+
const postgrestOp = op === "==" ? "eq" : op === "!=" ? "neq" : op === ">" ? "gt" : op === ">=" ? "gte" : op === "<" ? "lt" : op === "<=" ? "lte" : op === "in" ? "in" : op === "not-in" ? "nin" : op === "array-contains" ? "cs" : op === "array-contains-any" ? "csa" : "eq";
|
|
2651
|
+
let stringVal;
|
|
2652
|
+
if (Array.isArray(val)) {
|
|
2653
|
+
stringVal = `(${val.join(",")})`;
|
|
2654
|
+
} else {
|
|
2655
|
+
stringVal = String(val);
|
|
2656
|
+
}
|
|
2657
|
+
whereMap[key] = `${postgrestOp}.${stringVal}`;
|
|
2639
2658
|
}
|
|
2640
|
-
whereMap[key] = `${postgrestOp}.${stringVal}`;
|
|
2641
2659
|
}
|
|
2642
2660
|
});
|
|
2643
2661
|
}
|
|
@@ -2739,34 +2757,37 @@ function encodeFilterAndSort(filterValues, sortBy) {
|
|
|
2739
2757
|
if (filterValues) {
|
|
2740
2758
|
Object.entries(filterValues).forEach(([key, value]) => {
|
|
2741
2759
|
if (value) {
|
|
2742
|
-
const [
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2760
|
+
const conditions = Array.isArray(value[0]) ? value : [value];
|
|
2761
|
+
const [op, val] = conditions[0] || [];
|
|
2762
|
+
if (op) {
|
|
2763
|
+
let encodedValue = val;
|
|
2764
|
+
try {
|
|
2765
|
+
if (typeof val === "object") {
|
|
2766
|
+
if (val instanceof Date) {
|
|
2767
|
+
encodedValue = val.toISOString();
|
|
2768
|
+
} else if (Array.isArray(val)) {
|
|
2769
|
+
encodedValue = JSON.stringify(val, (k, v) => {
|
|
2770
|
+
if (v instanceof EntityRelation) {
|
|
2771
|
+
return encodeRelation(v);
|
|
2772
|
+
}
|
|
2773
|
+
if (v instanceof EntityReference) {
|
|
2774
|
+
return encodeReference(v);
|
|
2775
|
+
}
|
|
2776
|
+
return v;
|
|
2777
|
+
});
|
|
2778
|
+
} else if (val instanceof EntityRelation) {
|
|
2779
|
+
encodedValue = encodeRelation(val);
|
|
2780
|
+
} else if (val instanceof EntityReference) {
|
|
2781
|
+
encodedValue = encodeReference(val);
|
|
2782
|
+
}
|
|
2762
2783
|
}
|
|
2784
|
+
} catch (e) {
|
|
2785
|
+
encodedValue = val;
|
|
2786
|
+
}
|
|
2787
|
+
if (encodedValue !== void 0) {
|
|
2788
|
+
entries[encodeURIComponent(`${key}_op`)] = encodeURIComponent(op);
|
|
2789
|
+
entries[encodeURIComponent(`${key}_value`)] = encodedValue ? encodeURIComponent(String(encodedValue)) : "null";
|
|
2763
2790
|
}
|
|
2764
|
-
} catch (e) {
|
|
2765
|
-
encodedValue = val;
|
|
2766
|
-
}
|
|
2767
|
-
if (encodedValue !== void 0) {
|
|
2768
|
-
entries[encodeURIComponent(`${key}_op`)] = encodeURIComponent(op);
|
|
2769
|
-
entries[encodeURIComponent(`${key}_value`)] = encodedValue ? encodeURIComponent(String(encodedValue)) : "null";
|
|
2770
2791
|
}
|
|
2771
2792
|
}
|
|
2772
2793
|
});
|
|
@@ -6355,7 +6376,7 @@ function UserDisplay(t0) {
|
|
|
6355
6376
|
return t8;
|
|
6356
6377
|
}
|
|
6357
6378
|
function LoginView(t0) {
|
|
6358
|
-
const $ = c(
|
|
6379
|
+
const $ = c(111);
|
|
6359
6380
|
const {
|
|
6360
6381
|
logo,
|
|
6361
6382
|
authController,
|
|
@@ -6370,7 +6391,9 @@ function LoginView(t0) {
|
|
|
6370
6391
|
subtitle,
|
|
6371
6392
|
needsSetup,
|
|
6372
6393
|
registrationEnabled,
|
|
6373
|
-
additionalComponent
|
|
6394
|
+
additionalComponent,
|
|
6395
|
+
defaultEmail,
|
|
6396
|
+
defaultPassword
|
|
6374
6397
|
} = t0;
|
|
6375
6398
|
const disableSignupScreen = t1 === void 0 ? false : t1;
|
|
6376
6399
|
const disabled = t2 === void 0 ? false : t2;
|
|
@@ -6747,17 +6770,19 @@ function LoginView(t0) {
|
|
|
6747
6770
|
t36 = $[69];
|
|
6748
6771
|
}
|
|
6749
6772
|
let t37;
|
|
6750
|
-
if ($[70] !== authController || $[71] !==
|
|
6751
|
-
t37 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true });
|
|
6773
|
+
if ($[70] !== authController || $[71] !== defaultEmail || $[72] !== defaultPassword || $[73] !== isBootstrapMode || $[74] !== noUserComponent) {
|
|
6774
|
+
t37 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true, defaultEmail, defaultPassword });
|
|
6752
6775
|
$[70] = authController;
|
|
6753
|
-
$[71] =
|
|
6754
|
-
$[72] =
|
|
6755
|
-
$[73] =
|
|
6776
|
+
$[71] = defaultEmail;
|
|
6777
|
+
$[72] = defaultPassword;
|
|
6778
|
+
$[73] = isBootstrapMode;
|
|
6779
|
+
$[74] = noUserComponent;
|
|
6780
|
+
$[75] = t37;
|
|
6756
6781
|
} else {
|
|
6757
|
-
t37 = $[
|
|
6782
|
+
t37 = $[75];
|
|
6758
6783
|
}
|
|
6759
6784
|
let t38;
|
|
6760
|
-
if ($[
|
|
6785
|
+
if ($[76] !== authController || $[77] !== defaultEmail || $[78] !== defaultPassword || $[79] !== disableSignupScreen || $[80] !== disabled || $[81] !== githubClientId || $[82] !== googleClientId || $[83] !== hasGitHubLogin || $[84] !== hasGoogleLogin || $[85] !== hasLinkedinLogin || $[86] !== hasPasswordReset || $[87] !== isBootstrapMode || $[88] !== linkedinClientId || $[89] !== mode || $[90] !== noUserComponent || $[91] !== showRegistration || $[92] !== subtitle || $[93] !== title) {
|
|
6761
6786
|
t38 = !isBootstrapMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6762
6787
|
mode === "buttons" && /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col gap-3 mt-2", children: [
|
|
6763
6788
|
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-2", children: [
|
|
@@ -6774,53 +6799,55 @@ function LoginView(t0) {
|
|
|
6774
6799
|
/* @__PURE__ */ jsx("button", { type: "button", className: "font-semibold hover:underline cursor-pointer text-primary-600 dark:text-primary-400", onClick: () => switchMode("register"), children: "Create one" })
|
|
6775
6800
|
] }) })
|
|
6776
6801
|
] }),
|
|
6777
|
-
mode === "login" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0 }),
|
|
6778
|
-
mode === "register" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login") }),
|
|
6802
|
+
mode === "login" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0, defaultEmail, defaultPassword }),
|
|
6803
|
+
mode === "register" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login"), defaultEmail, defaultPassword }),
|
|
6779
6804
|
mode === "forgot" && authController.forgotPassword && /* @__PURE__ */ jsx(ForgotPasswordForm, { authController, onClose: () => switchMode("login") })
|
|
6780
6805
|
] });
|
|
6781
|
-
$[
|
|
6782
|
-
$[
|
|
6783
|
-
$[
|
|
6784
|
-
$[
|
|
6785
|
-
$[
|
|
6786
|
-
$[
|
|
6787
|
-
$[
|
|
6788
|
-
$[
|
|
6789
|
-
$[
|
|
6790
|
-
$[
|
|
6791
|
-
$[
|
|
6792
|
-
$[
|
|
6793
|
-
$[
|
|
6794
|
-
$[
|
|
6795
|
-
$[
|
|
6796
|
-
$[
|
|
6797
|
-
$[
|
|
6798
|
-
|
|
6799
|
-
|
|
6806
|
+
$[76] = authController;
|
|
6807
|
+
$[77] = defaultEmail;
|
|
6808
|
+
$[78] = defaultPassword;
|
|
6809
|
+
$[79] = disableSignupScreen;
|
|
6810
|
+
$[80] = disabled;
|
|
6811
|
+
$[81] = githubClientId;
|
|
6812
|
+
$[82] = googleClientId;
|
|
6813
|
+
$[83] = hasGitHubLogin;
|
|
6814
|
+
$[84] = hasGoogleLogin;
|
|
6815
|
+
$[85] = hasLinkedinLogin;
|
|
6816
|
+
$[86] = hasPasswordReset;
|
|
6817
|
+
$[87] = isBootstrapMode;
|
|
6818
|
+
$[88] = linkedinClientId;
|
|
6819
|
+
$[89] = mode;
|
|
6820
|
+
$[90] = noUserComponent;
|
|
6821
|
+
$[91] = showRegistration;
|
|
6822
|
+
$[92] = subtitle;
|
|
6823
|
+
$[93] = title;
|
|
6824
|
+
$[94] = t38;
|
|
6825
|
+
} else {
|
|
6826
|
+
t38 = $[94];
|
|
6800
6827
|
}
|
|
6801
6828
|
let t39;
|
|
6802
|
-
if ($[
|
|
6829
|
+
if ($[95] !== t36 || $[96] !== t37 || $[97] !== t38) {
|
|
6803
6830
|
t39 = /* @__PURE__ */ jsxs("div", { className: t36, children: [
|
|
6804
6831
|
t37,
|
|
6805
6832
|
t38
|
|
6806
6833
|
] });
|
|
6807
|
-
$[
|
|
6808
|
-
$[
|
|
6809
|
-
$[
|
|
6810
|
-
$[
|
|
6834
|
+
$[95] = t36;
|
|
6835
|
+
$[96] = t37;
|
|
6836
|
+
$[97] = t38;
|
|
6837
|
+
$[98] = t39;
|
|
6811
6838
|
} else {
|
|
6812
|
-
t39 = $[
|
|
6839
|
+
t39 = $[98];
|
|
6813
6840
|
}
|
|
6814
6841
|
let t40;
|
|
6815
|
-
if ($[
|
|
6842
|
+
if ($[99] !== additionalComponent) {
|
|
6816
6843
|
t40 = additionalComponent && /* @__PURE__ */ jsx("div", { className: "w-full", children: additionalComponent });
|
|
6817
|
-
$[
|
|
6818
|
-
$[
|
|
6844
|
+
$[99] = additionalComponent;
|
|
6845
|
+
$[100] = t40;
|
|
6819
6846
|
} else {
|
|
6820
|
-
t40 = $[
|
|
6847
|
+
t40 = $[100];
|
|
6821
6848
|
}
|
|
6822
6849
|
let t41;
|
|
6823
|
-
if ($[
|
|
6850
|
+
if ($[101] !== t32 || $[102] !== t33 || $[103] !== t34 || $[104] !== t39 || $[105] !== t40) {
|
|
6824
6851
|
t41 = /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col items-center w-[440px] max-w-full p-8 sm:p-10 bg-white/70 dark:bg-surface-900/60 backdrop-blur-xl border border-surface-200/50 dark:border-surface-800/50 rounded-2xl shadow-2xl z-10 transition-all duration-300 hover:shadow-primary-500/5", children: [
|
|
6825
6852
|
t32,
|
|
6826
6853
|
t33,
|
|
@@ -6828,29 +6855,29 @@ function LoginView(t0) {
|
|
|
6828
6855
|
t39,
|
|
6829
6856
|
t40
|
|
6830
6857
|
] });
|
|
6831
|
-
$[
|
|
6832
|
-
$[
|
|
6833
|
-
$[
|
|
6834
|
-
$[
|
|
6835
|
-
$[
|
|
6836
|
-
$[
|
|
6858
|
+
$[101] = t32;
|
|
6859
|
+
$[102] = t33;
|
|
6860
|
+
$[103] = t34;
|
|
6861
|
+
$[104] = t39;
|
|
6862
|
+
$[105] = t40;
|
|
6863
|
+
$[106] = t41;
|
|
6837
6864
|
} else {
|
|
6838
|
-
t41 = $[
|
|
6865
|
+
t41 = $[106];
|
|
6839
6866
|
}
|
|
6840
6867
|
let t42;
|
|
6841
|
-
if ($[
|
|
6868
|
+
if ($[107] !== t14 || $[108] !== t31 || $[109] !== t41) {
|
|
6842
6869
|
t42 = /* @__PURE__ */ jsxs("div", { className: t14, children: [
|
|
6843
6870
|
t15,
|
|
6844
6871
|
t16,
|
|
6845
6872
|
t31,
|
|
6846
6873
|
t41
|
|
6847
6874
|
] });
|
|
6848
|
-
$[
|
|
6849
|
-
$[
|
|
6850
|
-
$[
|
|
6851
|
-
$[
|
|
6875
|
+
$[107] = t14;
|
|
6876
|
+
$[108] = t31;
|
|
6877
|
+
$[109] = t41;
|
|
6878
|
+
$[110] = t42;
|
|
6852
6879
|
} else {
|
|
6853
|
-
t42 = $[
|
|
6880
|
+
t42 = $[110];
|
|
6854
6881
|
}
|
|
6855
6882
|
return t42;
|
|
6856
6883
|
}
|
|
@@ -7114,12 +7141,14 @@ function LoginForm(t0) {
|
|
|
7114
7141
|
noUserComponent,
|
|
7115
7142
|
bootstrapMode: t1,
|
|
7116
7143
|
switchToRegister,
|
|
7117
|
-
switchToLogin
|
|
7144
|
+
switchToLogin,
|
|
7145
|
+
defaultEmail,
|
|
7146
|
+
defaultPassword
|
|
7118
7147
|
} = t0;
|
|
7119
7148
|
const bootstrapMode = t1 === void 0 ? false : t1;
|
|
7120
7149
|
const passwordRef = useRef(null);
|
|
7121
|
-
const [email, setEmail] = useState();
|
|
7122
|
-
const [password, setPassword] = useState();
|
|
7150
|
+
const [email, setEmail] = useState(defaultEmail);
|
|
7151
|
+
const [password, setPassword] = useState(defaultPassword);
|
|
7123
7152
|
const [displayName, setDisplayName] = useState();
|
|
7124
7153
|
let t2;
|
|
7125
7154
|
let t3;
|
|
@@ -8066,14 +8095,14 @@ const en = {
|
|
|
8066
8095
|
data_imported_successfully: "Data imported successfully",
|
|
8067
8096
|
export: "Export",
|
|
8068
8097
|
export_data: "Export data",
|
|
8069
|
-
download_table_csv: "Download the
|
|
8098
|
+
download_table_csv: "Download the content of this table as a CSV",
|
|
8070
8099
|
csv: "CSV",
|
|
8071
8100
|
json: "JSON",
|
|
8072
8101
|
dates_as_timestamps: "Dates as timestamps",
|
|
8073
8102
|
dates_as_strings: "Dates as strings",
|
|
8074
8103
|
flatten_arrays: "Flatten arrays",
|
|
8075
8104
|
download: "Download",
|
|
8076
|
-
large_number_of_documents: "This
|
|
8105
|
+
large_number_of_documents: "This collection has a large number of documents ({{count}}).",
|
|
8077
8106
|
include_undefined_values: "Include undefined values",
|
|
8078
8107
|
submit: "Submit",
|
|
8079
8108
|
no_filterable_properties: "No filterable properties available",
|
|
@@ -14614,6 +14643,10 @@ function isRelationProperty(property) {
|
|
|
14614
14643
|
}
|
|
14615
14644
|
return false;
|
|
14616
14645
|
}
|
|
14646
|
+
function isHiddenProperty(property) {
|
|
14647
|
+
if (!property) return false;
|
|
14648
|
+
return Boolean(property.ui?.hideFromCollection);
|
|
14649
|
+
}
|
|
14617
14650
|
function getEntityPreviewKeys(authController, targetCollection, fields, previewProperties, limit = 3) {
|
|
14618
14651
|
const allProperties = Object.keys(targetCollection.properties);
|
|
14619
14652
|
let listProperties = previewProperties?.filter((p) => allProperties.includes(p));
|
|
@@ -14630,7 +14663,7 @@ function getEntityPreviewKeys(authController, targetCollection, fields, previewP
|
|
|
14630
14663
|
return !isIdProp && key !== "id";
|
|
14631
14664
|
}).filter((key) => {
|
|
14632
14665
|
const property = targetCollection.properties[key];
|
|
14633
|
-
return property && !isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property);
|
|
14666
|
+
return property && !isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property) && !isHiddenProperty(property);
|
|
14634
14667
|
}).slice(0, limit);
|
|
14635
14668
|
}
|
|
14636
14669
|
}
|
|
@@ -14644,6 +14677,9 @@ function getEntityTitlePropertyKey(collection, propertyConfigs) {
|
|
|
14644
14677
|
const property = collection.properties[key];
|
|
14645
14678
|
if (property && !isPropertyBuilder(property)) {
|
|
14646
14679
|
const prop = property;
|
|
14680
|
+
if (isHiddenProperty(prop)) {
|
|
14681
|
+
continue;
|
|
14682
|
+
}
|
|
14647
14683
|
if (prop.type === "string" && !prop.ui?.multiline && !prop.ui?.markdown && !prop.storage && !prop.isId) {
|
|
14648
14684
|
if (!firstStringCandidate) {
|
|
14649
14685
|
firstStringCandidate = key;
|