firstly 0.0.8 → 0.0.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/esm/BaseEnum.d.ts +3 -14
  3. package/esm/BaseEnum.js +0 -4
  4. package/esm/FF_Entity.d.ts +1 -1
  5. package/esm/FF_Entity.js +7 -3
  6. package/esm/ROUTES.d.ts +2 -2
  7. package/esm/api/index.d.ts +2 -3
  8. package/esm/api/index.js +4 -4
  9. package/esm/auth/RoleHelpers.d.ts +1 -1
  10. package/esm/auth/RoleHelpers.js +5 -3
  11. package/esm/auth/client/Auth.js +2 -2
  12. package/esm/auth/client/Entities.d.ts +2 -2
  13. package/esm/auth/client/Entities.js +5 -5
  14. package/esm/auth/client/index.d.ts +1 -1
  15. package/esm/auth/client/index.js +1 -1
  16. package/esm/auth/index.d.ts +2 -0
  17. package/esm/auth/index.js +23 -12
  18. package/esm/cellsBuildor.d.ts +4 -4
  19. package/esm/cellsBuildor.js +19 -6
  20. package/esm/feedback/FeedbackController.d.ts +1 -1
  21. package/esm/feedback/FeedbackController.js +0 -2
  22. package/esm/feedback/ui/DialogIssue.svelte +8 -8
  23. package/esm/handle/index.d.ts +0 -1
  24. package/esm/helper.d.ts +16 -14
  25. package/esm/helper.js +58 -2
  26. package/esm/index.d.ts +7 -3
  27. package/esm/index.js +1 -1
  28. package/esm/mail/index.js +15 -10
  29. package/esm/mail/templates/DefaultMail.svelte.d.ts +3 -3
  30. package/esm/storeItem.d.ts +1 -2
  31. package/esm/storeList.d.ts +4 -3
  32. package/esm/storeList.js +20 -10
  33. package/esm/ui/Clipboardable.svelte.d.ts +1 -1
  34. package/esm/ui/Field.svelte +9 -3
  35. package/esm/ui/Field.svelte.d.ts +3 -2
  36. package/esm/ui/FieldGroup.svelte +4 -2
  37. package/esm/ui/FieldGroup.svelte.d.ts +1 -1
  38. package/esm/ui/Grid.svelte +90 -20
  39. package/esm/ui/Grid.svelte.d.ts +6 -5
  40. package/esm/ui/GridLoading.svelte.d.ts +1 -1
  41. package/esm/ui/GridPaginate.svelte +6 -4
  42. package/esm/ui/GridPaginate.svelte.d.ts +2 -2
  43. package/esm/ui/Icon.svelte.d.ts +3 -3
  44. package/esm/ui/Loading.svelte.d.ts +1 -1
  45. package/esm/ui/Tooltip.svelte.d.ts +2 -2
  46. package/esm/ui/dialog/DialogPrimitive.svelte +1 -5
  47. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +3 -3
  48. package/esm/ui/dialog/dialog.d.ts +10 -8
  49. package/esm/ui/dialog/dialog.js +9 -10
  50. package/esm/ui/internals/FieldContainer.svelte.d.ts +6 -6
  51. package/esm/ui/internals/Input.svelte +10 -1
  52. package/esm/ui/internals/Input.svelte.d.ts +1 -1
  53. package/esm/ui/internals/Textarea.svelte.d.ts +2 -2
  54. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +4 -4
  55. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +7 -7
  56. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +3 -3
  57. package/esm/ui/link/Link.svelte +1 -1
  58. package/esm/ui/link/Link.svelte.d.ts +2 -2
  59. package/esm/ui/link/LinkPlus.svelte +41 -29
  60. package/esm/ui/link/LinkPlus.svelte.d.ts +2 -2
  61. package/esm/utils/transition.d.ts +0 -1
  62. package/esm/vite/index.js +2 -0
  63. package/package.json +3 -3
package/esm/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types=".pnpm/@sveltejs+kit@2.5.24_@sveltejs+vite-plugin-svelte@3.1.2_svelte@4.2.18_vite@5.4.1_@types+node@_lnml5jetshdinsnlj53joqxhde/node_modules/@sveltejs/kit" />
2
1
  import type { RequestEvent } from '@sveltejs/kit';
3
2
  import type { FindOptionsBase } from 'remult';
4
3
  import { Log } from '@kitql/helpers';
@@ -10,6 +9,7 @@ import { storeItem } from './storeItem.js';
10
9
  import { storeList } from './storeList.js';
11
10
  import { default as Button } from './ui/Button.svelte';
12
11
  import { default as Clipboardable } from './ui/Clipboardable.svelte';
12
+ import type { dialog } from './ui/dialog/dialog.js';
13
13
  import { default as DialogManagement } from './ui/dialog/DialogManagement.svelte';
14
14
  import { default as FormEditAction } from './ui/dialog/FormEditAction.svelte';
15
15
  import { default as Field } from './ui/Field.svelte';
@@ -43,7 +43,7 @@ export { FF_Entity } from './FF_Entity.js';
43
43
  export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
44
44
  export { BaseEnum } from './BaseEnum.js';
45
45
  export { dialog } from './ui/dialog/dialog.js';
46
- export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, } from './helper.js';
46
+ export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, upsert, onDelete, } from './helper.js';
47
47
  export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, containsWords, } from './cellsBuildor.js';
48
48
  export { storeItem };
49
49
  export { storeList };
@@ -72,7 +72,11 @@ declare module 'remult' {
72
72
  href?: (item: entityType) => string;
73
73
  findOptionsForEdit?: ((entity: entityType) => FindOptionsBase<valueType>) | FindOptionsBase<valueType>;
74
74
  findOptionsLimit?: number;
75
- createOptionWhenNoResult?: boolean;
75
+ createOptionWhenNoResult?: {
76
+ onCreateRequest: (item: entityType, strCreateNew: string) => Parameters<typeof dialog.form>;
77
+ onSuccess: (entity: entityType, newItem: any) => Promise<void>;
78
+ onError?: () => void;
79
+ };
76
80
  multiSelect?: boolean;
77
81
  skipForDefaultField?: boolean;
78
82
  }
package/esm/index.js CHANGED
@@ -36,7 +36,7 @@ export { FF_Entity } from './FF_Entity.js';
36
36
  export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
37
37
  export { BaseEnum } from './BaseEnum.js';
38
38
  export { dialog } from './ui/dialog/dialog.js';
39
- export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, } from './helper.js';
39
+ export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, upsert, onDelete, } from './helper.js';
40
40
  export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, containsWords, } from './cellsBuildor.js';
41
41
  export { storeItem };
42
42
  export { storeList };
package/esm/mail/index.js CHANGED
@@ -14,16 +14,21 @@ export const mailInit = async (nodemailer, o) => {
14
14
  else {
15
15
  try {
16
16
  nodemailer.createTestAccount(globalOptions?.apiUrl ?? '', (err, account) => {
17
- globalOptions = { ...globalOptions, from: account.user };
18
- transporter = nodemailer.createTransport({
19
- host: account.smtp.host,
20
- port: account.smtp.port,
21
- secure: account.smtp.secure,
22
- auth: {
23
- user: account.user,
24
- pass: account.pass,
25
- },
26
- });
17
+ if (account) {
18
+ globalOptions = { ...globalOptions, from: account.user };
19
+ transporter = nodemailer.createTransport({
20
+ host: account.smtp.host,
21
+ port: account.smtp.port,
22
+ secure: account.smtp.secure,
23
+ auth: {
24
+ user: account.user,
25
+ pass: account.pass,
26
+ },
27
+ });
28
+ }
29
+ else {
30
+ log.error("Error nodemailer.createTestAccount() can't be done.");
31
+ }
27
32
  });
28
33
  }
29
34
  catch (error) {
@@ -5,13 +5,13 @@ declare const __propDef: {
5
5
  title: string | undefined;
6
6
  sections?: {
7
7
  text: string;
8
- highlighted?: boolean | undefined;
8
+ highlighted?: boolean;
9
9
  cta?: {
10
10
  text: string;
11
11
  link: string;
12
12
  } | undefined;
13
- }[] | undefined;
14
- brandColor?: string | undefined;
13
+ }[];
14
+ brandColor?: string;
15
15
  };
16
16
  events: {
17
17
  [evt: string]: CustomEvent<any>;
@@ -1,4 +1,3 @@
1
- /// <reference types="svelte" />
2
1
  import type { ErrorInfo, FindOptions, Repository } from 'remult';
3
2
  type TheStoreItem<T> = {
4
3
  item: T | undefined;
@@ -17,7 +16,7 @@ export declare const storeItem: <T>(repo: Repository<T>, initValues?: TheStoreIt
17
16
  * store.fetch(id)
18
17
  * ```
19
18
  */
20
- fetch: (id: Parameters<Repository<T>['findId']>[0], options?: FindOptions<T>, onNewData?: ((item: T) => void) | undefined) => Promise<void>;
19
+ fetch: (id: Parameters<Repository<T>["findId"]>[0], options?: FindOptions<T>, onNewData?: (item: T) => void) => Promise<void>;
21
20
  /**
22
21
  * `.save()` will `update` or `insert` the current item.
23
22
  */
@@ -1,13 +1,14 @@
1
- /// <reference types="svelte" />
2
- import type { FindOptions, Repository } from 'remult';
1
+ import type { FindOptions, GroupByOptions, MembersOnly, Repository } from 'remult';
3
2
  type TheStoreList<T> = {
4
3
  items: T[];
5
4
  loading: boolean;
6
5
  totalCount: number | undefined;
6
+ agg: any | undefined;
7
7
  };
8
8
  export type FF_FindOptions<T> = FindOptions<T> & {
9
9
  withCount?: boolean;
10
10
  withItems?: boolean;
11
+ aggregate?: GroupByOptions<T, (keyof MembersOnly<T>)[], any, any, any, any, any>;
11
12
  };
12
13
  /**
13
14
  * @param repo remult repository to listen to
@@ -26,7 +27,7 @@ export type FF_FindOptions<T> = FindOptions<T> & {
26
27
  export declare const storeList: <T>(repo: Repository<T>, initValues?: TheStoreList<T>) => {
27
28
  subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?: import("svelte/store").Invalidator<TheStoreList<T>> | undefined) => import("svelte/store").Unsubscriber;
28
29
  manualSet: (info: TheStoreList<T>) => void;
29
- fetch: (options?: FF_FindOptions<T>, onNewData?: ((items?: T[], totalCount?: number) => void) | undefined) => Promise<void>;
30
+ fetch: (options?: FF_FindOptions<T>, onNewData?: (items?: T[], totalCount?: number) => void) => Promise<void>;
30
31
  listen: (options?: FF_FindOptions<T>) => Promise<void>;
31
32
  getRepo: () => Repository<T>;
32
33
  };
package/esm/storeList.js CHANGED
@@ -15,7 +15,7 @@ import { writable } from 'svelte/store';
15
15
  * $: browser && tasks.listen(data.options)
16
16
  * ```
17
17
  */
18
- export const storeList = (repo, initValues = { items: [], loading: true, totalCount: undefined }) => {
18
+ export const storeList = (repo, initValues = { items: [], loading: true, totalCount: undefined, agg: undefined }) => {
19
19
  const { subscribe, set, update } = writable(initValues);
20
20
  let unSub = null;
21
21
  onDestroy(async () => {
@@ -43,27 +43,36 @@ export const storeList = (repo, initValues = { items: [], loading: true, totalCo
43
43
  throw new Error(`xxx.fetch() withItems and withCount can't be both false!`);
44
44
  }
45
45
  else if (!withItems && withCount) {
46
- const totalCount = await repo.count(options?.where);
47
- set({ loading: false, items: [], totalCount });
46
+ let optionsToUse = { where: options?.where };
47
+ if (options?.aggregate) {
48
+ optionsToUse = { ...options.aggregate, where: options?.where };
49
+ }
50
+ // const agg = await repo.aggregate({ ...options?.aggregate, where: options?.where })
51
+ const agg = await repo.aggregate(optionsToUse);
52
+ set({ loading: false, items: [], totalCount: agg.$count, agg });
48
53
  if (onNewData) {
49
- onNewData(undefined, totalCount);
54
+ onNewData(undefined, agg.$count);
50
55
  }
51
56
  }
52
57
  else if (withItems && !withCount) {
53
58
  const items = await repo.find(options);
54
- set({ loading: false, items, totalCount: undefined });
59
+ set({ loading: false, items, totalCount: undefined, agg: undefined });
55
60
  if (onNewData) {
56
61
  onNewData(items, undefined);
57
62
  }
58
63
  }
59
64
  else {
60
- const [items, totalCount] = await Promise.all([
65
+ let optionsToUse = { where: options?.where };
66
+ if (options?.aggregate) {
67
+ optionsToUse = { ...options.aggregate, where: options?.where };
68
+ }
69
+ const [items, agg] = await Promise.all([
61
70
  repo.find({ ...options }),
62
- repo.count(options?.where),
71
+ repo.aggregate(optionsToUse),
63
72
  ]);
64
- set({ loading: false, items, totalCount });
73
+ set({ loading: false, items, totalCount: agg.$count, agg });
65
74
  if (onNewData) {
66
- onNewData(items, totalCount);
75
+ onNewData(items, agg.$count);
67
76
  }
68
77
  }
69
78
  }
@@ -75,7 +84,8 @@ export const storeList = (repo, initValues = { items: [], loading: true, totalCo
75
84
  const withCount = options?.withCount ?? false;
76
85
  let totalCount = undefined;
77
86
  if (withCount) {
78
- totalCount = await repo.count(options?.where);
87
+ const agg = await repo.aggregate({ where: options?.where });
88
+ totalCount = agg.$count;
79
89
  }
80
90
  update((c) => {
81
91
  return { ...c, items: info.items, loading: false, ...(withCount ? { totalCount } : {}) };
@@ -6,7 +6,7 @@ declare const __propDef: {
6
6
  *
7
7
  * Don't put this on an input, if not, when a user will select the input via the mouse, this clipboard will be copied (usually you wanted to paste)!
8
8
  */ value: string | null;
9
- class?: string | undefined;
9
+ class?: string;
10
10
  };
11
11
  events: {
12
12
  [evt: string]: CustomEvent<any>;
@@ -101,7 +101,8 @@ const getLoadOptions = async (cellsValues2, str) => {
101
101
  );
102
102
  let totalCount = arr.length;
103
103
  if (totalCount === limit) {
104
- totalCount = await metaTypeObj.repoTarget.count(findToUse.where);
104
+ const agg = await metaTypeObj.repoTarget.aggregate({ where: findToUse.where });
105
+ totalCount = agg.$count;
105
106
  }
106
107
  if (!cell.field?.options.multiSelect) {
107
108
  if (str === "" && getId() && !arr.find((r) => String(r.id) === String(getId()))) {
@@ -196,7 +197,7 @@ const calcSuffix = (value2) => {
196
197
  on:issue={(e) => {
197
198
  error = e.detail
198
199
  }}
199
- createOptionWhenNoResult={cell.field?.options.createOptionWhenNoResult}
200
+ createOptionWhenNoResult={!!cell.field?.options.createOptionWhenNoResult}
200
201
  on:createRequest
201
202
  />
202
203
  {/if}
@@ -237,7 +238,12 @@ const calcSuffix = (value2) => {
237
238
  type="checkbox"
238
239
  {...{ ...common(cell.field), required: undefined }}
239
240
  class="checkbox"
240
- bind:checked={value}
241
+ checked={value}
242
+ on:input={(e) => {
243
+ // @ts-ignore
244
+ value = e.target.checked
245
+ dispatchSelected(value)
246
+ }}
241
247
  />
242
248
  </div>
243
249
  {:else if metaType.subKind === 'text' || metaType.subKind === 'email' || metaType.subKind === 'password' || metaType.subKind === 'dateOnly' || metaType.subKind === 'number'}
@@ -1,14 +1,15 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import type { HTMLInputAttributes } from 'svelte/elements';
2
3
  import { type Cell } from '../';
3
4
  declare class __sveltets_Render<T extends Record<any, any>> {
4
5
  props(): {
5
6
  [x: string]: any;
6
7
  cell: Cell<T>;
7
- value?: any;
8
+ value?: HTMLInputAttributes["value"];
8
9
  cellsValues?: any;
9
10
  withDedounce?: boolean | undefined;
10
11
  error?: string | undefined;
11
- mode?: "view" | "edit" | "filtre" | undefined;
12
+ mode?: ("edit" | "view" | "filtre") | undefined;
12
13
  focus?: boolean | undefined;
13
14
  clearable?: boolean | undefined;
14
15
  disabled?: boolean | undefined;
@@ -10,9 +10,11 @@ export let store;
10
10
  export let focusKey = null;
11
11
  const getError = (errors, field) => {
12
12
  const fo = getRelationFieldInfo(field);
13
- const keyToUse = fo?.options?.field ?? field.key;
14
- if (errors && errors[keyToUse]) {
13
+ const keyToUse = fo?.options?.field;
14
+ if (errors && keyToUse && errors[keyToUse]) {
15
15
  return errors[keyToUse];
16
+ } else if (errors && errors[field.key]) {
17
+ return errors[field.key];
16
18
  }
17
19
  return void 0;
18
20
  };
@@ -4,7 +4,7 @@ import { type StoreItem } from '../';
4
4
  import type { Cell } from '../cellsBuildor';
5
5
  declare class __sveltets_Render<T extends Record<any, any>> {
6
6
  props(): {
7
- mode?: ("view" | "edit" | "filtre") | undefined;
7
+ mode?: "view" | "edit" | "filtre";
8
8
  cells: Cell<T>[];
9
9
  store: StoreItem<T>;
10
10
  focusKey?: string | null | undefined;
@@ -31,6 +31,7 @@ export let classes = {
31
31
  };
32
32
  export let orderBy = void 0;
33
33
  export let orderByCols = void 0;
34
+ export let settingsLeft = false;
34
35
  export let dicoNoResult = "Aucun r\xE9sultat !";
35
36
  const dispatch = createEventDispatcher();
36
37
  const sorting = (toSort, b) => {
@@ -62,19 +63,55 @@ const sortingIcon = (toSort, b, _orderBy) => {
62
63
  const cellsToTake = (cells2) => {
63
64
  return cells2.filter((c) => c.modeView !== "hide");
64
65
  };
66
+ const classForRounding = (i) => {
67
+ if (settingsLeft && (withEdit || withDelete || withAdd)) {
68
+ if (i === 0) {
69
+ return "";
70
+ } else if (i === cells.length - 1) {
71
+ return "rounded-tr-lg";
72
+ }
73
+ }
74
+ if (!settingsLeft && (withEdit || withDelete || withAdd)) {
75
+ if (i === 0) {
76
+ return "rounded-tl-lg";
77
+ } else if (i === cells.length - 1) {
78
+ return "";
79
+ }
80
+ }
81
+ if (i === 0) {
82
+ return "rounded-tl-lg";
83
+ } else if (i === cells.length - 1) {
84
+ return "rounded-tr-lg";
85
+ }
86
+ };
65
87
  </script>
66
88
 
67
89
  <div class="overflow-x-auto">
68
90
  <table class="table {classes.table}">
69
91
  <thead>
70
92
  <tr>
93
+ {#if settingsLeft && (withEdit || withDelete || withAdd)}
94
+ <th class="rounded-tl-lg">
95
+ <div class="flex justify-start">
96
+ {#if !withAdd}
97
+ <Icon data={LibIcon_Settings}></Icon>
98
+ {:else}
99
+ <Button
100
+ permission={store.getRepo().metadata.options.permissionApiInsert}
101
+ disabled={!store.getRepo().metadata.apiInsertAllowed()}
102
+ class="btn btn-square btn-ghost btn-xs"
103
+ on:click={() => dispatch('add', {})}
104
+ >
105
+ <Icon data={LibIcon_Add} />
106
+ </Button>
107
+ {/if}
108
+ </div>
109
+ </th>
110
+ {/if}
111
+
71
112
  {#each cellsToTake(cells) as b, i}
72
113
  {@const al = align(b.field, b.kind === 'slot')}
73
- <th
74
- class="{al}
75
- {i === 0 ? 'rounded-tl-lg' : ''}
76
- {i === cells.length - 1 && !withEdit && !withDelete ? 'rounded-tr-lg' : ''}"
77
- >
114
+ <th class="{al} {classForRounding(i)}">
78
115
  {#if b.headerSlot}
79
116
  <slot name="header" field={b.field} />
80
117
  {:else}
@@ -98,20 +135,22 @@ const cellsToTake = (cells2) => {
98
135
  </th>
99
136
  {/each}
100
137
 
101
- {#if withEdit || withDelete || withAdd}
102
- <th class="flex justify-end rounded-tr-lg">
103
- {#if withAdd}
104
- <Button
105
- permission={store.getRepo().metadata.options.permissionApiInsert}
106
- disabled={!store.getRepo().metadata.apiInsertAllowed()}
107
- class="btn btn-square btn-ghost btn-xs"
108
- on:click={() => dispatch('add', {})}
109
- >
110
- <Icon data={LibIcon_Add} />
111
- </Button>
112
- {:else}
113
- <Icon data={LibIcon_Settings}></Icon>
114
- {/if}
138
+ {#if !settingsLeft && (withEdit || withDelete || withAdd)}
139
+ <th class="rounded-tr-lg">
140
+ <div class="flex justify-end">
141
+ {#if withAdd}
142
+ <Button
143
+ permission={store.getRepo().metadata.options.permissionApiInsert}
144
+ disabled={!store.getRepo().metadata.apiInsertAllowed()}
145
+ class="btn btn-square btn-ghost btn-xs"
146
+ on:click={() => dispatch('add', {})}
147
+ >
148
+ <Icon data={LibIcon_Add} />
149
+ </Button>
150
+ {:else}
151
+ <Icon data={LibIcon_Settings}></Icon>
152
+ {/if}
153
+ </div>
115
154
  </th>
116
155
  {/if}
117
156
  </tr>
@@ -123,6 +162,34 @@ const cellsToTake = (cells2) => {
123
162
  {:else}
124
163
  {#each $store.items as row}
125
164
  <tr on:click={() => dispatch('rowclick', row)} class="hover:bg-base-content/20">
165
+ <!-- BECARFULL THIS CODE IS DUPLICATED -->
166
+ {#if settingsLeft && (withEdit || withDelete)}
167
+ <td class="text-left">
168
+ <div class="flex justify-start gap-2">
169
+ {#if withEdit}
170
+ <Button
171
+ permission={store.getRepo().metadata.options.permissionApiUpdate}
172
+ disabled={!store.getRepo().metadata.apiUpdateAllowed()}
173
+ class="btn btn-square btn-ghost btn-xs"
174
+ on:click={() => dispatch('edit', row)}
175
+ >
176
+ <Icon data={LibIcon_Edit} />
177
+ </Button>
178
+ {/if}
179
+ {#if withDelete}
180
+ <Button
181
+ permission={store.getRepo().metadata.options.permissionApiDelete}
182
+ disabled={!store.getRepo().metadata.apiDeleteAllowed()}
183
+ class="btn btn-square btn-ghost btn-xs"
184
+ on:click={() => dispatch('delete', row)}
185
+ >
186
+ <Icon data={LibIcon_Delete} />
187
+ </Button>
188
+ {/if}
189
+ </div>
190
+ </td>
191
+ {/if}
192
+
126
193
  {#each cellsToTake(cells) as b}
127
194
  {@const metaType = getFieldMetaType(b.field)}
128
195
  <td class={align(b.field, b.kind === 'slot')}>
@@ -153,6 +220,8 @@ const cellsToTake = (cells2) => {
153
220
  href: b.field?.options?.href ? b.field?.options.href(row) : item?.href,
154
221
  }}
155
222
  />
223
+ {:else if b.kind === 'baseItem'}
224
+ <LinkPlus item={row[metaType.field.key]} />
156
225
  {:else if b.kind === 'field_link'}
157
226
  {@const item = getFieldLinkDisplayValue(metaType.field, row)}
158
227
  <LinkPlus {item} />
@@ -191,7 +260,8 @@ const cellsToTake = (cells2) => {
191
260
  {/if}
192
261
  </td>
193
262
  {/each}
194
- {#if withEdit || withDelete}
263
+
264
+ {#if !settingsLeft && (withEdit || withDelete)}
195
265
  <td class="text-right">
196
266
  <div class="flex justify-end gap-2">
197
267
  {#if withEdit}
@@ -6,16 +6,17 @@ declare class __sveltets_Render<T extends Record<any, any>> {
6
6
  props(): {
7
7
  cells: Cell<T>[];
8
8
  store: StoreList<T>;
9
- withAdd?: boolean | undefined;
10
- withEdit?: boolean | undefined;
11
- withDelete?: boolean | undefined;
12
- loadingRows?: number | undefined;
9
+ withAdd?: boolean;
10
+ withEdit?: boolean;
11
+ withDelete?: boolean;
12
+ loadingRows?: number;
13
13
  classes?: {
14
14
  table: string;
15
15
  } | undefined;
16
16
  orderBy?: EntityOrderBy<T> | undefined;
17
17
  orderByCols?: true | (keyof T)[] | undefined;
18
- dicoNoResult?: string | undefined;
18
+ settingsLeft?: boolean;
19
+ dicoNoResult?: string;
19
20
  };
20
21
  events(): {
21
22
  refresh: any;
@@ -3,7 +3,7 @@ import type { Align } from './index.js';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  columns: Align[];
6
- loadingRows?: number | undefined;
6
+ loadingRows?: number;
7
7
  };
8
8
  events: {
9
9
  [evt: string]: CustomEvent<any>;
@@ -24,9 +24,11 @@ $: canGoNext = isValidValue && needPaginate && pageDisplayed < Math.ceil((totalC
24
24
  </script>
25
25
 
26
26
  <FieldContainer {label} forId="paginate" classes={{ label: 'justify-end' }}>
27
- <div class="flex items-center justify-end">
27
+ <div class="flex w-36 items-center justify-end">
28
28
  {#if totalCount === undefined}
29
- <Loading class="mx-2 h-8 w-1/2"></Loading>
29
+ <Loading class="ml-6 mr-2 h-3 w-1/6"></Loading>
30
+ <Loading class="mx-2 h-4 w-1/2"></Loading>
31
+ <Loading class="mx-2 h-3 w-1/6"></Loading>
30
32
  {:else if !needPaginate}
31
33
  <span class="text-primary justify-end px-2 font-bold">
32
34
  {totalCount}
@@ -36,7 +38,7 @@ $: canGoNext = isValidValue && needPaginate && pageDisplayed < Math.ceil((totalC
36
38
  <button
37
39
  aria-label="left"
38
40
  on:click={() => update('-')}
39
- class="btn join-item {pageDisplayed === 1 ? 'btn-disabled' : ''}"
41
+ class="btn join-item p-1 {pageDisplayed === 1 ? 'btn-disabled' : ''}"
40
42
  >
41
43
  <Icon data={LibIcon_ChevronLeft} />
42
44
  </button>
@@ -53,7 +55,7 @@ $: canGoNext = isValidValue && needPaginate && pageDisplayed < Math.ceil((totalC
53
55
  <button
54
56
  aria-label="right"
55
57
  on:click={() => update('+')}
56
- class="btn join-item {!canGoNext ? 'btn-disabled' : ''}"
58
+ class="btn join-item p-1 {!canGoNext ? 'btn-disabled' : ''}"
57
59
  >
58
60
  <Icon data={LibIcon_ChevronRight} />
59
61
  </button>
@@ -2,10 +2,10 @@ import { SvelteComponent } from "svelte";
2
2
  import './LibIcon';
3
3
  declare const __propDef: {
4
4
  props: {
5
- label?: string | undefined;
5
+ label?: string;
6
6
  pageDisplayed: number;
7
7
  totalCount?: number | undefined | null;
8
- pageSize?: number | undefined;
8
+ pageSize?: number;
9
9
  };
10
10
  events: {
11
11
  [evt: string]: CustomEvent<any>;
@@ -16,14 +16,14 @@ declare const __propDef: {
16
16
  * import Woman from "virtual:icons/mdi/account-tie-woman";
17
17
  * <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
18
18
  * ```
19
- */ data?: string | string[] | undefined;
20
- size?: string | number | undefined;
19
+ */ data?: string | string[];
20
+ size?: string | number;
21
21
  caption?: string | undefined;
22
22
  /**
23
23
  * By default, svg are not rendered on the server side.
24
24
  * But the size will be respected to not have glitch on the client side when the icon is coming.
25
25
  * @default false
26
- */ ssr?: boolean | undefined;
26
+ */ ssr?: boolean;
27
27
  class?: string | string[] | undefined;
28
28
  style?: string | string[] | undefined;
29
29
  };
@@ -1,7 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- class?: string | undefined;
4
+ class?: string;
5
5
  };
6
6
  events: {
7
7
  [evt: string]: CustomEvent<any>;
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- text?: string | undefined;
5
- hideTooltip?: boolean | undefined;
4
+ text?: string;
5
+ hideTooltip?: boolean;
6
6
  };
7
7
  events: {
8
8
  [evt: string]: CustomEvent<any>;
@@ -40,11 +40,7 @@ function dispatchChange(_data) {
40
40
  />
41
41
  <div
42
42
  class={tw(
43
- `border-base-content/60
44
- bg-base-100
45
- relative z-40 max-h-[90vh] overflow-visible rounded-xl
46
- border p-6
47
- shadow-lg`,
43
+ `border-base-content/60 bg-base-100 relative z-40 max-h-[90vh] overflow-auto rounded-xl border p-6 shadow-lg`,
48
44
  classes.root,
49
45
  )}
50
46
  transition:flyAndScale={{
@@ -3,10 +3,10 @@ import { type BaseItemLight } from '../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  detail?: BaseItemLight | undefined;
6
- open?: boolean | undefined;
6
+ open?: boolean;
7
7
  classes?: {
8
- root?: string | undefined;
9
- } | undefined;
8
+ root?: string;
9
+ };
10
10
  };
11
11
  events: {
12
12
  change: CustomEvent<any>;
@@ -29,6 +29,15 @@ type ResultClose<entityType = any> = {
29
29
  item?: entityType;
30
30
  };
31
31
  export type DialogType = 'custom' | 'confirm' | 'confirmDelete' | 'insert' | 'update' | 'view';
32
+ export type DialogFormType<entityType> = {
33
+ cells?: CellsInput<entityType>;
34
+ defaults?: Partial<entityType>;
35
+ classes?: DialogClasses;
36
+ noThrow?: boolean;
37
+ wDelete?: boolean;
38
+ topicPrefixText?: string;
39
+ focusKey?: string;
40
+ };
32
41
  export type DialogMetaDataInternal<entityType = any> = DialogMetaData<entityType> & {
33
42
  id: number;
34
43
  type: DialogType;
@@ -37,14 +46,7 @@ export type DialogMetaDataInternal<entityType = any> = DialogMetaData<entityType
37
46
  export declare const dialog: {
38
47
  confirm: (topic: string, text: string, icon?: string) => Promise<ResultClose<any>>;
39
48
  confirmDelete: (topic: string) => Promise<ResultClose<any>>;
40
- form: <entityType>(type: 'insert' | 'update' | 'view', topic: string, repo: Repository<entityType>, cells: CellsInput<entityType>, options?: {
41
- defaults?: Partial<entityType>;
42
- classes?: DialogClasses;
43
- noThrow?: boolean;
44
- wDelete?: boolean;
45
- topicPrefixText?: string;
46
- focusKey?: string;
47
- }) => Promise<ResultClose<any>>;
49
+ form: <entityType>(type: "insert" | "update" | "view", topic: string, repo: Repository<entityType>, settings: DialogFormType<entityType>) => Promise<ResultClose<any>>;
48
50
  show: (dialog: DialogMetaData) => Promise<ResultClose<any>>;
49
51
  close: (id: number, result: ResultClose) => void;
50
52
  closeAll: () => void;