@rebasepro/core 0.3.0 → 0.5.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/index.umd.js CHANGED
@@ -258,13 +258,15 @@
258
258
  return React.useContext(RebaseDataContext);
259
259
  };
260
260
  function useCollectionFetch(t0) {
261
- const $ = reactCompilerRuntime.c(25);
261
+ const $ = reactCompilerRuntime.c(30);
262
262
  const {
263
263
  path,
264
264
  collection,
265
265
  filterValues,
266
266
  sortBy,
267
267
  itemCount,
268
+ offset,
269
+ page,
268
270
  searchString
269
271
  } = t0;
270
272
  const dataClient = useData();
@@ -308,8 +310,9 @@
308
310
  const [dataLoading, setDataLoading] = React.useState(false);
309
311
  const [dataLoadingError, setDataLoadingError] = React.useState();
310
312
  const [noMoreToLoad, setNoMoreToLoad] = React.useState(false);
313
+ const [totalCount, setTotalCount] = React.useState();
311
314
  let t3;
312
- if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !== orderByParams || $[7] !== path || $[8] !== searchString || $[9] !== whereParams) {
315
+ if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !== offset || $[7] !== orderByParams || $[8] !== page || $[9] !== path || $[10] !== searchString || $[11] !== whereParams) {
313
316
  t3 = () => {
314
317
  setDataLoading(true);
315
318
  const onEntitiesUpdate = async (res) => {
@@ -318,12 +321,14 @@
318
321
  setDataLoadingError(void 0);
319
322
  setData(entities.map(_temp$7));
320
323
  setNoMoreToLoad(!res.meta.hasMore);
324
+ setTotalCount(res.meta.total);
321
325
  };
322
326
  const onError = (error) => {
323
327
  console.error("ERROR", error);
324
328
  setDataLoading(false);
325
329
  setData([]);
326
330
  setDataLoadingError(error);
331
+ setTotalCount(void 0);
327
332
  };
328
333
  const accessor = dataClient.collection(path);
329
334
  const hasRelations = collection.properties && Object.values(collection.properties).some(_temp2$4);
@@ -332,6 +337,8 @@
332
337
  return accessor.listen({
333
338
  where: whereParams,
334
339
  limit: itemCount,
340
+ offset,
341
+ page,
335
342
  orderBy: orderByParams,
336
343
  searchString,
337
344
  include: includeParams
@@ -343,6 +350,8 @@
343
350
  accessor.find({
344
351
  where: whereParams,
345
352
  limit: itemCount,
353
+ offset,
354
+ page,
346
355
  orderBy: orderByParams,
347
356
  searchString,
348
357
  include: includeParams
@@ -356,46 +365,52 @@
356
365
  $[3] = collection.properties;
357
366
  $[4] = dataClient;
358
367
  $[5] = itemCount;
359
- $[6] = orderByParams;
360
- $[7] = path;
361
- $[8] = searchString;
362
- $[9] = whereParams;
363
- $[10] = t3;
368
+ $[6] = offset;
369
+ $[7] = orderByParams;
370
+ $[8] = page;
371
+ $[9] = path;
372
+ $[10] = searchString;
373
+ $[11] = whereParams;
374
+ $[12] = t3;
364
375
  } else {
365
- t3 = $[10];
376
+ t3 = $[12];
366
377
  }
367
378
  let t4;
368
- if ($[11] !== collection || $[12] !== currentSort || $[13] !== dataClient || $[14] !== filterValues || $[15] !== itemCount || $[16] !== path || $[17] !== searchString || $[18] !== sortByProperty) {
369
- t4 = [path, itemCount, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
370
- $[11] = collection;
371
- $[12] = currentSort;
372
- $[13] = dataClient;
373
- $[14] = filterValues;
374
- $[15] = itemCount;
375
- $[16] = path;
376
- $[17] = searchString;
377
- $[18] = sortByProperty;
378
- $[19] = t4;
379
- } else {
380
- t4 = $[19];
379
+ if ($[13] !== collection || $[14] !== currentSort || $[15] !== dataClient || $[16] !== filterValues || $[17] !== itemCount || $[18] !== offset || $[19] !== page || $[20] !== path || $[21] !== searchString || $[22] !== sortByProperty) {
380
+ t4 = [path, itemCount, offset, page, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
381
+ $[13] = collection;
382
+ $[14] = currentSort;
383
+ $[15] = dataClient;
384
+ $[16] = filterValues;
385
+ $[17] = itemCount;
386
+ $[18] = offset;
387
+ $[19] = page;
388
+ $[20] = path;
389
+ $[21] = searchString;
390
+ $[22] = sortByProperty;
391
+ $[23] = t4;
392
+ } else {
393
+ t4 = $[23];
381
394
  }
382
395
  React.useEffect(t3, t4);
383
396
  let t5;
384
397
  let t6;
385
- if ($[20] !== data || $[21] !== dataLoading || $[22] !== dataLoadingError || $[23] !== noMoreToLoad) {
398
+ if ($[24] !== data || $[25] !== dataLoading || $[26] !== dataLoadingError || $[27] !== noMoreToLoad || $[28] !== totalCount) {
386
399
  t6 = {
387
400
  data,
388
401
  dataLoading,
389
402
  dataLoadingError,
390
- noMoreToLoad
403
+ noMoreToLoad,
404
+ totalCount
391
405
  };
392
- $[20] = data;
393
- $[21] = dataLoading;
394
- $[22] = dataLoadingError;
395
- $[23] = noMoreToLoad;
396
- $[24] = t6;
406
+ $[24] = data;
407
+ $[25] = dataLoading;
408
+ $[26] = dataLoadingError;
409
+ $[27] = noMoreToLoad;
410
+ $[28] = totalCount;
411
+ $[29] = t6;
397
412
  } else {
398
- t6 = $[24];
413
+ t6 = $[29];
399
414
  }
400
415
  t5 = t6;
401
416
  return t5;
@@ -873,7 +888,7 @@
873
888
  };
874
889
  }, []);
875
890
  const getUser = React.useCallback((uid) => {
876
- return userManagement?.getUser(uid) ?? null;
891
+ return userManagement?.getUser?.(uid) ?? null;
877
892
  }, [userManagement]);
878
893
  return React.useMemo(() => ({
879
894
  items,
@@ -2528,7 +2543,7 @@
2528
2543
  sortBy: urlSortBy
2529
2544
  } = parseFilterAndSort(location.search);
2530
2545
  if (!fixedFilter) {
2531
- setFilterValues(urlFilterValues);
2546
+ setFilterValues(urlFilterValues ?? defaultFilter);
2532
2547
  }
2533
2548
  if (urlSortBy && fixedFilter && !checkFilterCombination(fixedFilter, urlSortBy)) {
2534
2549
  console.warn("URL sort is not compatible with the force filter.");
@@ -2572,7 +2587,7 @@
2572
2587
  const [dataLoading, setDataLoading] = React.useState(false);
2573
2588
  const [dataLoadingError, setDataLoadingError] = React.useState();
2574
2589
  const [noMoreToLoad, setNoMoreToLoad] = React.useState(false);
2575
- const clearFilter = React.useCallback(() => setFilterValues(fixedFilter ?? void 0), [fixedFilter]);
2590
+ const clearFilter = React.useCallback(() => setFilterValues(fixedFilter ?? defaultFilter ?? void 0), [fixedFilter, defaultFilter]);
2576
2591
  const updateFilterValues = React.useCallback((updatedFilter) => {
2577
2592
  if (fixedFilter) {
2578
2593
  console.warn("Filter is not compatible with the force filter. Ignoring filter");
@@ -2619,15 +2634,18 @@
2619
2634
  if (filterValues_0) {
2620
2635
  Object.entries(filterValues_0).forEach(([key, value]) => {
2621
2636
  if (value && Array.isArray(value)) {
2622
- const [op, val] = value;
2623
- 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";
2624
- let stringVal;
2625
- if (Array.isArray(val)) {
2626
- stringVal = `(${val.join(",")})`;
2627
- } else {
2628
- stringVal = String(val);
2637
+ const conditions = Array.isArray(value[0]) ? value : [value];
2638
+ const [op, val] = conditions[0] || [];
2639
+ if (op) {
2640
+ 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";
2641
+ let stringVal;
2642
+ if (Array.isArray(val)) {
2643
+ stringVal = `(${val.join(",")})`;
2644
+ } else {
2645
+ stringVal = String(val);
2646
+ }
2647
+ whereMap[key] = `${postgrestOp}.${stringVal}`;
2629
2648
  }
2630
- whereMap[key] = `${postgrestOp}.${stringVal}`;
2631
2649
  }
2632
2650
  });
2633
2651
  }
@@ -2729,34 +2747,37 @@
2729
2747
  if (filterValues) {
2730
2748
  Object.entries(filterValues).forEach(([key, value]) => {
2731
2749
  if (value) {
2732
- const [op, val] = value;
2733
- let encodedValue = val;
2734
- try {
2735
- if (typeof val === "object") {
2736
- if (val instanceof Date) {
2737
- encodedValue = val.toISOString();
2738
- } else if (Array.isArray(val)) {
2739
- encodedValue = JSON.stringify(val, (k, v) => {
2740
- if (v instanceof types.EntityRelation) {
2741
- return encodeRelation(v);
2742
- }
2743
- if (v instanceof types.EntityReference) {
2744
- return encodeReference(v);
2745
- }
2746
- return v;
2747
- });
2748
- } else if (val instanceof types.EntityRelation) {
2749
- encodedValue = encodeRelation(val);
2750
- } else if (val instanceof types.EntityReference) {
2751
- encodedValue = encodeReference(val);
2750
+ const conditions = Array.isArray(value[0]) ? value : [value];
2751
+ const [op, val] = conditions[0] || [];
2752
+ if (op) {
2753
+ let encodedValue = val;
2754
+ try {
2755
+ if (typeof val === "object") {
2756
+ if (val instanceof Date) {
2757
+ encodedValue = val.toISOString();
2758
+ } else if (Array.isArray(val)) {
2759
+ encodedValue = JSON.stringify(val, (k, v) => {
2760
+ if (v instanceof types.EntityRelation) {
2761
+ return encodeRelation(v);
2762
+ }
2763
+ if (v instanceof types.EntityReference) {
2764
+ return encodeReference(v);
2765
+ }
2766
+ return v;
2767
+ });
2768
+ } else if (val instanceof types.EntityRelation) {
2769
+ encodedValue = encodeRelation(val);
2770
+ } else if (val instanceof types.EntityReference) {
2771
+ encodedValue = encodeReference(val);
2772
+ }
2752
2773
  }
2774
+ } catch (e) {
2775
+ encodedValue = val;
2776
+ }
2777
+ if (encodedValue !== void 0) {
2778
+ entries[encodeURIComponent(`${key}_op`)] = encodeURIComponent(op);
2779
+ entries[encodeURIComponent(`${key}_value`)] = encodedValue ? encodeURIComponent(String(encodedValue)) : "null";
2753
2780
  }
2754
- } catch (e) {
2755
- encodedValue = val;
2756
- }
2757
- if (encodedValue !== void 0) {
2758
- entries[encodeURIComponent(`${key}_op`)] = encodeURIComponent(op);
2759
- entries[encodeURIComponent(`${key}_value`)] = encodedValue ? encodeURIComponent(String(encodedValue)) : "null";
2760
2781
  }
2761
2782
  }
2762
2783
  });
@@ -6345,7 +6366,7 @@
6345
6366
  return t8;
6346
6367
  }
6347
6368
  function LoginView(t0) {
6348
- const $ = reactCompilerRuntime.c(107);
6369
+ const $ = reactCompilerRuntime.c(111);
6349
6370
  const {
6350
6371
  logo,
6351
6372
  authController,
@@ -6360,7 +6381,9 @@
6360
6381
  subtitle,
6361
6382
  needsSetup,
6362
6383
  registrationEnabled,
6363
- additionalComponent
6384
+ additionalComponent,
6385
+ defaultEmail,
6386
+ defaultPassword
6364
6387
  } = t0;
6365
6388
  const disableSignupScreen = t1 === void 0 ? false : t1;
6366
6389
  const disabled = t2 === void 0 ? false : t2;
@@ -6737,17 +6760,19 @@
6737
6760
  t36 = $[69];
6738
6761
  }
6739
6762
  let t37;
6740
- if ($[70] !== authController || $[71] !== isBootstrapMode || $[72] !== noUserComponent) {
6741
- t37 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true });
6763
+ if ($[70] !== authController || $[71] !== defaultEmail || $[72] !== defaultPassword || $[73] !== isBootstrapMode || $[74] !== noUserComponent) {
6764
+ t37 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true, defaultEmail, defaultPassword });
6742
6765
  $[70] = authController;
6743
- $[71] = isBootstrapMode;
6744
- $[72] = noUserComponent;
6745
- $[73] = t37;
6766
+ $[71] = defaultEmail;
6767
+ $[72] = defaultPassword;
6768
+ $[73] = isBootstrapMode;
6769
+ $[74] = noUserComponent;
6770
+ $[75] = t37;
6746
6771
  } else {
6747
- t37 = $[73];
6772
+ t37 = $[75];
6748
6773
  }
6749
6774
  let t38;
6750
- if ($[74] !== authController || $[75] !== disableSignupScreen || $[76] !== disabled || $[77] !== githubClientId || $[78] !== googleClientId || $[79] !== hasGitHubLogin || $[80] !== hasGoogleLogin || $[81] !== hasLinkedinLogin || $[82] !== hasPasswordReset || $[83] !== isBootstrapMode || $[84] !== linkedinClientId || $[85] !== mode || $[86] !== noUserComponent || $[87] !== showRegistration || $[88] !== subtitle || $[89] !== title) {
6775
+ 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) {
6751
6776
  t38 = !isBootstrapMode && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6752
6777
  mode === "buttons" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col gap-3 mt-2", children: [
6753
6778
  (title || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-2", children: [
@@ -6764,53 +6789,55 @@
6764
6789
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "font-semibold hover:underline cursor-pointer text-primary-600 dark:text-primary-400", onClick: () => switchMode("register"), children: "Create one" })
6765
6790
  ] }) })
6766
6791
  ] }),
6767
- mode === "login" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0 }),
6768
- mode === "register" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login") }),
6792
+ mode === "login" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0, defaultEmail, defaultPassword }),
6793
+ mode === "register" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login"), defaultEmail, defaultPassword }),
6769
6794
  mode === "forgot" && authController.forgotPassword && /* @__PURE__ */ jsxRuntime.jsx(ForgotPasswordForm, { authController, onClose: () => switchMode("login") })
6770
6795
  ] });
6771
- $[74] = authController;
6772
- $[75] = disableSignupScreen;
6773
- $[76] = disabled;
6774
- $[77] = githubClientId;
6775
- $[78] = googleClientId;
6776
- $[79] = hasGitHubLogin;
6777
- $[80] = hasGoogleLogin;
6778
- $[81] = hasLinkedinLogin;
6779
- $[82] = hasPasswordReset;
6780
- $[83] = isBootstrapMode;
6781
- $[84] = linkedinClientId;
6782
- $[85] = mode;
6783
- $[86] = noUserComponent;
6784
- $[87] = showRegistration;
6785
- $[88] = subtitle;
6786
- $[89] = title;
6787
- $[90] = t38;
6788
- } else {
6789
- t38 = $[90];
6796
+ $[76] = authController;
6797
+ $[77] = defaultEmail;
6798
+ $[78] = defaultPassword;
6799
+ $[79] = disableSignupScreen;
6800
+ $[80] = disabled;
6801
+ $[81] = githubClientId;
6802
+ $[82] = googleClientId;
6803
+ $[83] = hasGitHubLogin;
6804
+ $[84] = hasGoogleLogin;
6805
+ $[85] = hasLinkedinLogin;
6806
+ $[86] = hasPasswordReset;
6807
+ $[87] = isBootstrapMode;
6808
+ $[88] = linkedinClientId;
6809
+ $[89] = mode;
6810
+ $[90] = noUserComponent;
6811
+ $[91] = showRegistration;
6812
+ $[92] = subtitle;
6813
+ $[93] = title;
6814
+ $[94] = t38;
6815
+ } else {
6816
+ t38 = $[94];
6790
6817
  }
6791
6818
  let t39;
6792
- if ($[91] !== t36 || $[92] !== t37 || $[93] !== t38) {
6819
+ if ($[95] !== t36 || $[96] !== t37 || $[97] !== t38) {
6793
6820
  t39 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t36, children: [
6794
6821
  t37,
6795
6822
  t38
6796
6823
  ] });
6797
- $[91] = t36;
6798
- $[92] = t37;
6799
- $[93] = t38;
6800
- $[94] = t39;
6824
+ $[95] = t36;
6825
+ $[96] = t37;
6826
+ $[97] = t38;
6827
+ $[98] = t39;
6801
6828
  } else {
6802
- t39 = $[94];
6829
+ t39 = $[98];
6803
6830
  }
6804
6831
  let t40;
6805
- if ($[95] !== additionalComponent) {
6832
+ if ($[99] !== additionalComponent) {
6806
6833
  t40 = additionalComponent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: additionalComponent });
6807
- $[95] = additionalComponent;
6808
- $[96] = t40;
6834
+ $[99] = additionalComponent;
6835
+ $[100] = t40;
6809
6836
  } else {
6810
- t40 = $[96];
6837
+ t40 = $[100];
6811
6838
  }
6812
6839
  let t41;
6813
- if ($[97] !== t32 || $[98] !== t33 || $[99] !== t34 || $[100] !== t39 || $[101] !== t40) {
6840
+ if ($[101] !== t32 || $[102] !== t33 || $[103] !== t34 || $[104] !== t39 || $[105] !== t40) {
6814
6841
  t41 = /* @__PURE__ */ jsxRuntime.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: [
6815
6842
  t32,
6816
6843
  t33,
@@ -6818,29 +6845,29 @@
6818
6845
  t39,
6819
6846
  t40
6820
6847
  ] });
6821
- $[97] = t32;
6822
- $[98] = t33;
6823
- $[99] = t34;
6824
- $[100] = t39;
6825
- $[101] = t40;
6826
- $[102] = t41;
6848
+ $[101] = t32;
6849
+ $[102] = t33;
6850
+ $[103] = t34;
6851
+ $[104] = t39;
6852
+ $[105] = t40;
6853
+ $[106] = t41;
6827
6854
  } else {
6828
- t41 = $[102];
6855
+ t41 = $[106];
6829
6856
  }
6830
6857
  let t42;
6831
- if ($[103] !== t14 || $[104] !== t31 || $[105] !== t41) {
6858
+ if ($[107] !== t14 || $[108] !== t31 || $[109] !== t41) {
6832
6859
  t42 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t14, children: [
6833
6860
  t15,
6834
6861
  t16,
6835
6862
  t31,
6836
6863
  t41
6837
6864
  ] });
6838
- $[103] = t14;
6839
- $[104] = t31;
6840
- $[105] = t41;
6841
- $[106] = t42;
6865
+ $[107] = t14;
6866
+ $[108] = t31;
6867
+ $[109] = t41;
6868
+ $[110] = t42;
6842
6869
  } else {
6843
- t42 = $[106];
6870
+ t42 = $[110];
6844
6871
  }
6845
6872
  return t42;
6846
6873
  }
@@ -7104,12 +7131,14 @@
7104
7131
  noUserComponent,
7105
7132
  bootstrapMode: t1,
7106
7133
  switchToRegister,
7107
- switchToLogin
7134
+ switchToLogin,
7135
+ defaultEmail,
7136
+ defaultPassword
7108
7137
  } = t0;
7109
7138
  const bootstrapMode = t1 === void 0 ? false : t1;
7110
7139
  const passwordRef = React.useRef(null);
7111
- const [email, setEmail] = React.useState();
7112
- const [password, setPassword] = React.useState();
7140
+ const [email, setEmail] = React.useState(defaultEmail);
7141
+ const [password, setPassword] = React.useState(defaultPassword);
7113
7142
  const [displayName, setDisplayName] = React.useState();
7114
7143
  let t2;
7115
7144
  let t3;
@@ -8056,14 +8085,14 @@
8056
8085
  data_imported_successfully: "Data imported successfully",
8057
8086
  export: "Export",
8058
8087
  export_data: "Export data",
8059
- download_table_csv: "Download the the content of this table as a CSV",
8088
+ download_table_csv: "Download the content of this table as a CSV",
8060
8089
  csv: "CSV",
8061
8090
  json: "JSON",
8062
8091
  dates_as_timestamps: "Dates as timestamps",
8063
8092
  dates_as_strings: "Dates as strings",
8064
8093
  flatten_arrays: "Flatten arrays",
8065
8094
  download: "Download",
8066
- large_number_of_documents: "This collections has a large number of documents ({{count}}).",
8095
+ large_number_of_documents: "This collection has a large number of documents ({{count}}).",
8067
8096
  include_undefined_values: "Include undefined values",
8068
8097
  submit: "Submit",
8069
8098
  no_filterable_properties: "No filterable properties available",
@@ -14604,6 +14633,10 @@
14604
14633
  }
14605
14634
  return false;
14606
14635
  }
14636
+ function isHiddenProperty(property) {
14637
+ if (!property) return false;
14638
+ return Boolean(property.ui?.hideFromCollection);
14639
+ }
14607
14640
  function getEntityPreviewKeys(authController, targetCollection, fields, previewProperties, limit = 3) {
14608
14641
  const allProperties = Object.keys(targetCollection.properties);
14609
14642
  let listProperties = previewProperties?.filter((p) => allProperties.includes(p));
@@ -14620,7 +14653,7 @@
14620
14653
  return !isIdProp && key !== "id";
14621
14654
  }).filter((key) => {
14622
14655
  const property = targetCollection.properties[key];
14623
- return property && !common.isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property);
14656
+ return property && !common.isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property) && !isHiddenProperty(property);
14624
14657
  }).slice(0, limit);
14625
14658
  }
14626
14659
  }
@@ -14634,6 +14667,9 @@
14634
14667
  const property = collection.properties[key];
14635
14668
  if (property && !common.isPropertyBuilder(property)) {
14636
14669
  const prop = property;
14670
+ if (isHiddenProperty(prop)) {
14671
+ continue;
14672
+ }
14637
14673
  if (prop.type === "string" && !prop.ui?.multiline && !prop.ui?.markdown && !prop.storage && !prop.isId) {
14638
14674
  if (!firstStringCandidate) {
14639
14675
  firstStringCandidate = key;