firstly 0.2.0 → 0.2.1

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 (96) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/esm/auth/server/AuthController.server.js +32 -12
  3. package/esm/auth/static/assets/Page-BRNWcY5Z.js +1 -0
  4. package/esm/auth/static/assets/Page-CFcEsGK8.d.ts +2 -0
  5. package/esm/auth/static/assets/Page-CFcEsGK8.js +7 -0
  6. package/esm/auth/static/assets/Page-tLVs5slF.js +1 -0
  7. package/esm/auth/static/assets/index-D38rqu4x.d.ts +201 -0
  8. package/esm/auth/static/assets/index-D38rqu4x.js +2 -0
  9. package/esm/auth/static/index.html +1 -1
  10. package/esm/bin/cmd.js +2 -2
  11. package/esm/feedback/FeedbackController.d.ts +6 -2
  12. package/esm/feedback/FeedbackController.js +145 -143
  13. package/esm/feedback/server/index.d.ts +2 -2
  14. package/esm/feedback/server/index.js +3 -3
  15. package/esm/feedback/types.d.ts +5 -0
  16. package/esm/feedback/ui/DialogIssue.svelte +5 -5
  17. package/esm/feedback/ui/DialogIssues.svelte +5 -5
  18. package/esm/feedback/ui/DialogMilestones.svelte +1 -1
  19. package/esm/internals/BaseEnum.d.ts +1 -0
  20. package/esm/internals/FF_Fields.d.ts +4 -3
  21. package/esm/internals/FF_Fields.js +14 -55
  22. package/esm/internals/cellsBuildor.d.ts +2 -1
  23. package/esm/internals/index.d.ts +6 -7
  24. package/esm/internals/storeItem.d.ts +1 -0
  25. package/esm/mail/server/index.d.ts +8 -2
  26. package/esm/mail/server/index.js +35 -7
  27. package/esm/server/index.d.ts +1 -1
  28. package/esm/svelte/FF_Cell.svelte +3 -5
  29. package/esm/svelte/FF_Cell.svelte.d.ts +4 -2
  30. package/esm/svelte/FF_Form.svelte +4 -5
  31. package/esm/svelte/FF_Grid.svelte +2 -2
  32. package/esm/svelte/FF_Layout.svelte +3 -3
  33. package/esm/svelte/dialog/DialogManagement.svelte +2 -5
  34. package/esm/svelte/dialog/DialogPrimitive.svelte +1 -2
  35. package/esm/svelte/dialog/dialog.js +2 -2
  36. package/esm/svelte/ff_Config.svelte.js +2 -2
  37. package/esm/svelte/index.d.ts +2 -7
  38. package/esm/svelte/index.js +2 -7
  39. package/esm/ui/Button.svelte +38 -22
  40. package/esm/ui/Button.svelte.d.ts +10 -34
  41. package/esm/ui/Clipboardable.svelte +13 -17
  42. package/esm/ui/Clipboardable.svelte.d.ts +9 -33
  43. package/esm/ui/Field.svelte +38 -8
  44. package/esm/ui/FieldGroup.svelte.d.ts +1 -1
  45. package/esm/ui/Grid.svelte +11 -82
  46. package/esm/ui/Grid.svelte.d.ts +0 -1
  47. package/esm/ui/Grid2.svelte +25 -86
  48. package/esm/ui/Grid2.svelte.d.ts +1 -2
  49. package/esm/ui/GridPaginate.svelte +1 -1
  50. package/esm/ui/GridPaginate2.svelte +2 -2
  51. package/esm/ui/Icon.svelte +2 -18
  52. package/esm/ui/Icon.svelte.d.ts +0 -2
  53. package/esm/ui/LibIcon.js +2 -2
  54. package/esm/ui/Loading.svelte +1 -1
  55. package/esm/ui/dialog/DialogManagement.svelte +14 -5
  56. package/esm/ui/dialog/DialogPrimitive.svelte +3 -3
  57. package/esm/ui/dialog/FormEditAction.svelte +4 -4
  58. package/esm/ui/dialog/dialog.d.ts +5 -2
  59. package/esm/ui/dialog/dialog.js +2 -2
  60. package/esm/ui/index.d.ts +1 -0
  61. package/esm/ui/index.js +1 -0
  62. package/esm/ui/internals/FieldContainer.svelte +25 -14
  63. package/esm/ui/internals/FieldContainer.svelte.d.ts +9 -30
  64. package/esm/ui/internals/Input.svelte.d.ts +1 -1
  65. package/esm/ui/internals/Textarea.svelte +2 -5
  66. package/esm/ui/internals/select/MultiSelectMelt.svelte +6 -4
  67. package/esm/ui/internals/select/Select2.svelte +88 -0
  68. package/esm/ui/internals/select/Select2.svelte.d.ts +12 -0
  69. package/esm/ui/internals/select/SelectMelt.svelte +5 -5
  70. package/esm/ui/internals/select/SelectRadio.svelte +1 -1
  71. package/esm/ui/link/Link.svelte +1 -1
  72. package/esm/ui/link/LinkPlus.svelte +9 -5
  73. package/esm/ui/link/LinkPlus.svelte.d.ts +5 -19
  74. package/esm/virtual/Customer.js +1 -2
  75. package/esm/virtual/UIEntity.js +9 -5
  76. package/package.json +7 -8
  77. package/esm/auth/static/assets/Page-9Ytj29NS.js +0 -1
  78. package/esm/auth/static/assets/Page-C1pM-UDt.d.ts +0 -2
  79. package/esm/auth/static/assets/Page-C1pM-UDt.js +0 -20
  80. package/esm/auth/static/assets/Page-CPz6KCw_.js +0 -1
  81. package/esm/auth/static/assets/index-AoBb9Ds5.d.ts +0 -232
  82. package/esm/auth/static/assets/index-AoBb9Ds5.js +0 -2
  83. package/esm/svelte/FF_Display.svelte +0 -51
  84. package/esm/svelte/FF_Display.svelte.d.ts +0 -29
  85. package/esm/svelte/FF_Edit.svelte +0 -104
  86. package/esm/svelte/FF_Edit.svelte.d.ts +0 -32
  87. package/esm/svelte/FF_Error.svelte +0 -23
  88. package/esm/svelte/FF_Error.svelte.d.ts +0 -29
  89. package/esm/svelte/FF_Field.svelte +0 -62
  90. package/esm/svelte/FF_Field.svelte.d.ts +0 -29
  91. package/esm/svelte/FF_Hint.svelte +0 -21
  92. package/esm/svelte/FF_Hint.svelte.d.ts +0 -29
  93. package/esm/svelte/FF_Label.svelte +0 -23
  94. package/esm/svelte/FF_Label.svelte.d.ts +0 -29
  95. /package/esm/auth/static/assets/{Page-CPz6KCw_.d.ts → Page-BRNWcY5Z.d.ts} +0 -0
  96. /package/esm/auth/static/assets/{Page-9Ytj29NS.d.ts → Page-tLVs5slF.d.ts} +0 -0
@@ -3,6 +3,7 @@
3
3
  import type { HTMLInputAttributes } from 'svelte/elements'
4
4
 
5
5
  import { type FieldMetadata, type FindOptions } from 'remult'
6
+ import { midTrim } from '@kitql/helpers'
6
7
 
7
8
  import { suffixWithS } from '../formats/strings'
8
9
  import { type BaseItem, type Cell } from '../internals'
@@ -23,8 +24,11 @@
23
24
  import SelectRadio from './internals/select/SelectRadio.svelte'
24
25
  import Textarea from './internals/Textarea.svelte'
25
26
  import { LibIcon_Eye, LibIcon_EyeOff } from './LibIcon'
27
+ import Link from './link/Link.svelte'
26
28
  import LinkPlus from './link/LinkPlus.svelte'
27
29
 
30
+ // import Select2 from './internals/select/Select2.svelte'
31
+
28
32
  export let cell: Cell<T>
29
33
  export let value: HTMLInputAttributes['value'] = undefined
30
34
 
@@ -203,9 +207,15 @@
203
207
  {@const clearableComputed =
204
208
  cell.clearable || clearable || (mode === 'filtre' && clearable === undefined)}
205
209
  {#if isViewMode(mode, cell.field)}
206
- <span class="input-bordered flex items-center pl-2 pr-4">
210
+ <span class="flex items-center pr-4 pl-2">
207
211
  {#if cell.field?.inputType === 'checkbox'}
208
- <input type="checkbox" {...common(cell.field)} class="checkbox ml-2" disabled checked={value} />
212
+ <input
213
+ type="checkbox"
214
+ {...common(cell.field)}
215
+ class="checkbox ml-2 border-base-content/60"
216
+ disabled
217
+ checked={value}
218
+ />
209
219
  {:else if metaType.kind === 'relation'}
210
220
  {@const item = getEntityDisplayValue(metaType.repoTarget, value)}
211
221
  <div class={tw('flex items-center gap-4', 'h-12', 'pl-2')}>
@@ -219,10 +229,23 @@
219
229
  {/if}
220
230
  <Clipboardable value={v}>{v}</Clipboardable>
221
231
  </div>
232
+ {:else if metaType.subKind === 'link'}
233
+ <div class="ml-2 flex h-12 max-w-sm items-center gap-4 truncate">
234
+ {#if value}
235
+ <Link href={value} target="_blank" isExternal
236
+ >{midTrim(value.replaceAll('https://', '').replaceAll('www.', ''), {
237
+ len: 38,
238
+ midStr: ' ... ',
239
+ })}</Link
240
+ >
241
+ {:else}
242
+ <span class="text-base-content/30">-</span>
243
+ {/if}
244
+ </div>
222
245
  {:else}
223
246
  {@const v = displayWithDefaultAndSuffix(cell.field, value)}
224
247
  <div
225
- class="ml-2 flex h-12 w-full items-center {metaType.subKind === 'number' ? 'justify-end' : ''}"
248
+ class="ml-2 pb-2 flex h-12 w-full items-center {metaType.subKind === 'number' ? 'justify-end' : ''}"
226
249
  >
227
250
  <Clipboardable value={v}>{v}</Clipboardable>
228
251
  </div>
@@ -273,6 +296,13 @@
273
296
  on:selected={(e) => dispatchSelected(e.detail)}
274
297
  />
275
298
  {:else}
299
+ <!-- <Select2
300
+ {...common(cell.field, true)}
301
+ clearable={clearableComputed}
302
+ items={metaType.values}
303
+ value={value?.id || value}
304
+ onChange={(e) => dispatchSelected(metaType.values.find((v) => v.id === e))}
305
+ /> -->
276
306
  <SelectMelt
277
307
  {focus}
278
308
  {...common(cell.field, true)}
@@ -286,7 +316,7 @@
286
316
  />
287
317
  {/if}
288
318
  {:else if metaType.subKind === 'checkbox'}
289
- <div class="grid content-center items-center pl-4">
319
+ <div class="grid content-center items-center pl-4 pb-2">
290
320
  <input
291
321
  type="checkbox"
292
322
  {...{ ...common(cell.field), required: undefined }}
@@ -299,20 +329,20 @@
299
329
  }}
300
330
  />
301
331
  </div>
302
- {:else if metaType.subKind === 'text' || metaType.subKind === 'email' || metaType.subKind === 'password' || metaType.subKind === 'dateOnly' || metaType.subKind === 'number' || metaType.subKind === 'textpsd'}
303
- <div class="input input-bordered inline-flex w-full items-center pl-2">
332
+ {:else if metaType.subKind === 'text' || metaType.subKind === 'email' || metaType.subKind === 'password' || metaType.subKind === 'date' || metaType.subKind === 'number' || metaType.subKind === 'textpsd' || metaType.subKind === 'link'}
333
+ <div class="input inline-flex w-full items-center pl-2">
304
334
  <Input
305
335
  {focus}
306
336
  {...common(cell.field)}
307
337
  autocomplete="off"
308
338
  class={tw(
309
- `join-item w-full bg-transparent placeholder:text-base-content/30`,
339
+ `join-item w-full placeholder:text-base-content/30`,
310
340
  metaType.subKind === 'number' && 'text-end',
311
341
  )}
312
342
  style={cell.field?.inputType === 'textpsd' && textpsdVisible === false
313
343
  ? 'filter: blur(0.2rem)'
314
344
  : ''}
315
- type={metaType.subKind.replaceAll('dateOnly', 'date').replaceAll('textpsd', 'text')}
345
+ type={metaType.subKind.replaceAll('textpsd', 'text').replaceAll('link', 'text')}
316
346
  value={toInput(cell.field, value)}
317
347
  {withDedounce}
318
348
  on:input={(e) => {
@@ -3,7 +3,7 @@ import { type StoreItem } from '../internals';
3
3
  import type { Cell } from '../internals/cellsBuildor';
4
4
  declare class __sveltets_Render<T extends Record<any, any>> {
5
5
  props(): {
6
- mode?: "edit" | "view" | "filtre";
6
+ mode?: "view" | "edit" | "filtre";
7
7
  cells: Cell<T>[];
8
8
  store: StoreItem<T>;
9
9
  focusKey?: string | null | undefined;
@@ -16,7 +16,7 @@
16
16
  import Clipboardable from './Clipboardable.svelte'
17
17
  import GridLoading from './GridLoading.svelte'
18
18
  import Icon from './Icon.svelte'
19
- import { align, getAligns } from './index.js'
19
+ import { align, baseTable, getAligns } from './index.js'
20
20
  import {
21
21
  LibIcon_Add,
22
22
  LibIcon_Settings,
@@ -36,11 +36,11 @@
36
36
  export let loadingRows = 5
37
37
 
38
38
  export let classes = {
39
- table: 'table-pin-rows table-pin-cols',
39
+ // table: 'table-pin-rows table-pin-cols',
40
+ table: '',
40
41
  }
41
42
  export let orderBy: EntityOrderBy<T> | undefined = undefined
42
43
  export let orderByCols: (keyof T)[] | true | undefined = undefined
43
- export let settingsLeft = false
44
44
 
45
45
  export let dicoNoResult = 'Aucun résultat !'
46
46
 
@@ -84,58 +84,15 @@
84
84
  const cellsToTake = (cells: Cell<T>[]) => {
85
85
  return cells.filter((c) => c.modeView !== 'hide')
86
86
  }
87
-
88
- const classForRounding = (i: number) => {
89
- if (settingsLeft && (withEdit || withDelete || withAdd)) {
90
- if (i === 0) {
91
- return ''
92
- } else if (i === cells.length - 1) {
93
- return 'rounded-tr-lg'
94
- }
95
- }
96
-
97
- if (!settingsLeft && (withEdit || withDelete || withAdd)) {
98
- if (i === 0) {
99
- return 'rounded-tl-lg'
100
- } else if (i === cells.length - 1) {
101
- return ''
102
- }
103
- }
104
-
105
- if (i === 0) {
106
- return 'rounded-tl-lg'
107
- } else if (i === cells.length - 1) {
108
- return 'rounded-tr-lg'
109
- }
110
- }
111
87
  </script>
112
88
 
113
89
  <div class="overflow-x-auto">
114
- <table class="table {classes.table} bg-base-200">
90
+ <table class="table {classes.table} {baseTable}">
115
91
  <thead>
116
92
  <tr>
117
- {#if settingsLeft && (withEdit || withDelete || withAdd)}
118
- <th class="rounded-tl-lg">
119
- <div class="flex justify-start">
120
- {#if !withAdd}
121
- <Icon data={LibIcon_Settings}></Icon>
122
- {:else}
123
- <Button
124
- permission={store.getRepo().metadata.options.permissionApiInsert}
125
- disabled={!store.getRepo().metadata.apiInsertAllowed()}
126
- class="btn btn-square btn-ghost btn-xs"
127
- on:click={() => dispatch('add', {})}
128
- >
129
- <Icon data={LibIcon_Add} />
130
- </Button>
131
- {/if}
132
- </div>
133
- </th>
134
- {/if}
135
-
136
93
  {#each cellsToTake(cells) as b, i}
137
94
  {@const al = align(b.field, b.kind === 'slot')}
138
- <th class="{al} {classForRounding(i)}">
95
+ <th class={al}>
139
96
  {#if b.headerSlot}
140
97
  <slot name="header" field={b.field} />
141
98
  {:else}
@@ -158,15 +115,15 @@
158
115
  </th>
159
116
  {/each}
160
117
 
161
- {#if !settingsLeft && (withEdit || withDelete || withAdd)}
162
- <th class="rounded-tr-lg">
118
+ {#if withEdit || withDelete || withAdd}
119
+ <th class="">
163
120
  <div class="flex justify-end">
164
121
  {#if withAdd}
165
122
  <Button
166
123
  permission={store.getRepo().metadata.options.permissionApiInsert}
167
124
  disabled={!store.getRepo().metadata.apiInsertAllowed()}
168
125
  class="btn btn-square btn-ghost btn-xs"
169
- on:click={() => dispatch('add', {})}
126
+ onclick={() => dispatch('add', {})}
170
127
  >
171
128
  <Icon data={LibIcon_Add} />
172
129
  </Button>
@@ -185,34 +142,6 @@
185
142
  {:else}
186
143
  {#each $store.items as row}
187
144
  <tr on:click={() => dispatch('rowclick', row)} class="hover:bg-base-content/20">
188
- <!-- BECARFULL THIS CODE IS DUPLICATED -->
189
- {#if settingsLeft && (withEdit || withDelete)}
190
- <td class="text-left">
191
- <div class="flex justify-start gap-2">
192
- {#if withEdit}
193
- <Button
194
- permission={store.getRepo().metadata.options.permissionApiUpdate}
195
- disabled={!store.getRepo().metadata.apiUpdateAllowed()}
196
- class="btn btn-square btn-ghost btn-xs"
197
- on:click={() => dispatch('edit', row)}
198
- >
199
- <Icon data={LibIcon_Edit} />
200
- </Button>
201
- {/if}
202
- {#if withDelete}
203
- <Button
204
- permission={store.getRepo().metadata.options.permissionApiDelete}
205
- disabled={!store.getRepo().metadata.apiDeleteAllowed()}
206
- class="btn btn-square btn-ghost btn-xs"
207
- on:click={() => dispatch('delete', row)}
208
- >
209
- <Icon data={LibIcon_Delete} />
210
- </Button>
211
- {/if}
212
- </div>
213
- </td>
214
- {/if}
215
-
216
145
  {#each cellsToTake(cells) as b}
217
146
  {@const metaType = getFieldMetaType(b.field)}
218
147
  <td class={align(b.field, b.kind === 'slot')}>
@@ -287,7 +216,7 @@
287
216
  </td>
288
217
  {/each}
289
218
 
290
- {#if !settingsLeft && (withEdit || withDelete)}
219
+ {#if withEdit || withDelete}
291
220
  <td class="text-right">
292
221
  <div class="flex justify-end gap-2">
293
222
  {#if withEdit}
@@ -295,7 +224,7 @@
295
224
  permission={store.getRepo().metadata.options.permissionApiUpdate}
296
225
  disabled={!store.getRepo().metadata.apiUpdateAllowed()}
297
226
  class="btn btn-square btn-ghost btn-xs"
298
- on:click={() => dispatch('edit', row)}
227
+ onclick={() => dispatch('edit', row)}
299
228
  >
300
229
  <Icon data={LibIcon_Edit} />
301
230
  </Button>
@@ -305,7 +234,7 @@
305
234
  permission={store.getRepo().metadata.options.permissionApiDelete}
306
235
  disabled={!store.getRepo().metadata.apiDeleteAllowed()}
307
236
  class="btn btn-square btn-ghost btn-xs"
308
- on:click={() => dispatch('delete', row)}
237
+ onclick={() => dispatch('delete', row)}
309
238
  >
310
239
  <Icon data={LibIcon_Delete} />
311
240
  </Button>
@@ -14,7 +14,6 @@ declare class __sveltets_Render<T extends Record<any, any>> {
14
14
  } | undefined;
15
15
  orderBy?: EntityOrderBy<T> | undefined;
16
16
  orderByCols?: true | (keyof T)[] | undefined;
17
- settingsLeft?: boolean;
18
17
  dicoNoResult?: string;
19
18
  };
20
19
  events(): {
@@ -18,7 +18,7 @@
18
18
  import Clipboardable from './Clipboardable.svelte'
19
19
  import GridLoading from './GridLoading.svelte'
20
20
  import Icon from './Icon.svelte'
21
- import { align, getAligns } from './index.js'
21
+ import { align, baseTable, getAligns } from './index.js'
22
22
  import {
23
23
  LibIcon_Add,
24
24
  LibIcon_Settings,
@@ -38,11 +38,11 @@
38
38
  export let loadingRows = 5
39
39
 
40
40
  export let classes = {
41
- table: 'table-pin-rows table-pin-cols',
41
+ // table: 'table-pin-rows table-pin-cols',
42
+ table: '',
42
43
  }
43
44
  export let orderBy: EntityOrderBy<T> | undefined = undefined
44
45
  export let orderByCols: (keyof T)[] | true | undefined = undefined
45
- export let settingsLeft = false
46
46
 
47
47
  export let dicoNoResult = 'Aucun résultat !'
48
48
 
@@ -86,58 +86,15 @@
86
86
  const cellsToTake = (cells: Cell<T>[]) => {
87
87
  return cells.filter((c) => c.modeView !== 'hide')
88
88
  }
89
-
90
- const classForRounding = (i: number) => {
91
- if (settingsLeft && (withEdit || withDelete || withAdd)) {
92
- if (i === 0) {
93
- return ''
94
- } else if (i === cells.length - 1) {
95
- return 'rounded-tr-lg'
96
- }
97
- }
98
-
99
- if (!settingsLeft && (withEdit || withDelete || withAdd)) {
100
- if (i === 0) {
101
- return 'rounded-tl-lg'
102
- } else if (i === cells.length - 1) {
103
- return ''
104
- }
105
- }
106
-
107
- if (i === 0) {
108
- return 'rounded-tl-lg'
109
- } else if (i === cells.length - 1) {
110
- return 'rounded-tr-lg'
111
- }
112
- }
113
89
  </script>
114
90
 
115
91
  <div class="overflow-x-auto">
116
- <table class="table {classes.table} bg-base-200">
117
- <thead>
118
- <tr>
119
- {#if settingsLeft && (withEdit || withDelete || withAdd)}
120
- <th class="rounded-tl-lg">
121
- <div class="flex justify-start">
122
- {#if !withAdd}
123
- <Icon data={LibIcon_Settings}></Icon>
124
- {:else}
125
- <Button
126
- permission={r.metadata.options.permissionApiInsert}
127
- disabled={!r.metadata.apiInsertAllowed()}
128
- class="btn btn-square btn-ghost btn-xs"
129
- on:click={() => dispatch('add', {})}
130
- >
131
- <Icon data={LibIcon_Add} />
132
- </Button>
133
- {/if}
134
- </div>
135
- </th>
136
- {/if}
137
-
92
+ <table class="table {classes.table} {baseTable}">
93
+ <thead class="">
94
+ <tr class="">
138
95
  {#each cellsToTake(cells) as b, i}
139
96
  {@const al = align(b.field, b.kind === 'slot')}
140
- <th class="{al} {classForRounding(i)}">
97
+ <th class={al}>
141
98
  {#if b.headerSlot}
142
99
  <slot name="header" field={b.field} />
143
100
  {:else}
@@ -160,15 +117,15 @@
160
117
  </th>
161
118
  {/each}
162
119
 
163
- {#if !settingsLeft && (withEdit || withDelete || withAdd)}
164
- <th class="rounded-tr-lg">
120
+ {#if withEdit || withDelete || withAdd}
121
+ <th class="">
165
122
  <div class="flex justify-end">
166
123
  {#if withAdd}
167
124
  <Button
168
125
  permission={r.metadata.options.permissionApiInsert}
169
126
  disabled={!r.metadata.apiInsertAllowed()}
170
127
  class="btn btn-square btn-ghost btn-xs"
171
- on:click={() => dispatch('add', {})}
128
+ onclick={() => dispatch('add', {})}
172
129
  >
173
130
  <Icon data={LibIcon_Add} />
174
131
  </Button>
@@ -180,40 +137,12 @@
180
137
  {/if}
181
138
  </tr>
182
139
  </thead>
183
- <tbody>
140
+ <tbody class="">
184
141
  {#if r.loading.init && r.metadata.apiReadAllowed}
185
142
  <GridLoading columns={getAligns(cells, withEdit || withDelete)} {loadingRows} />
186
143
  {:else}
187
144
  {#each r.items ?? [] as row}
188
145
  <tr onclick={() => dispatch('rowclick', row)} class="hover:bg-base-content/20">
189
- <!-- BECARFULL THIS CODE IS DUPLICATED -->
190
- {#if settingsLeft && (withEdit || withDelete)}
191
- <td class="text-left">
192
- <div class="flex justify-start gap-2">
193
- {#if withEdit}
194
- <Button
195
- permission={r.metadata.options.permissionApiUpdate}
196
- disabled={!r.metadata.apiUpdateAllowed()}
197
- class="btn btn-square btn-ghost btn-xs"
198
- on:click={() => dispatch('edit', row)}
199
- >
200
- <Icon data={LibIcon_Edit} />
201
- </Button>
202
- {/if}
203
- {#if withDelete}
204
- <Button
205
- permission={r.metadata.options.permissionApiDelete}
206
- disabled={!r.metadata.apiDeleteAllowed()}
207
- class="btn btn-square btn-ghost btn-xs"
208
- on:click={() => dispatch('delete', row)}
209
- >
210
- <Icon data={LibIcon_Delete} />
211
- </Button>
212
- {/if}
213
- </div>
214
- </td>
215
- {/if}
216
-
217
146
  {#each cellsToTake(cells) as b}
218
147
  {@const metaType = getFieldMetaType(b.field)}
219
148
  <td class={align(b.field, b.kind === 'slot')}>
@@ -229,6 +158,16 @@
229
158
  on:refresh
230
159
  ></svelte:component>
231
160
  </div>
161
+ {:else if b.componentS5}
162
+ {@const Comp = b.componentS5}
163
+ <!-- NOT TESTED YET! -->
164
+ <div class={b.class}>
165
+ <Comp
166
+ {...b.props}
167
+ {...b.rowToProps ? b.rowToProps(row) : {}}
168
+ onrefresh={() => dispatch('refresh')}
169
+ />
170
+ </div>
232
171
  {:else}
233
172
  <pre>Col: {b.col}</pre>
234
173
  <pre class="bg-error">Component prop needed !</pre>
@@ -282,7 +221,7 @@
282
221
  </td>
283
222
  {/each}
284
223
 
285
- {#if !settingsLeft && (withEdit || withDelete)}
224
+ {#if withEdit || withDelete}
286
225
  <td class="text-right">
287
226
  <div class="flex justify-end gap-2">
288
227
  {#if withEdit}
@@ -290,7 +229,7 @@
290
229
  permission={r.metadata.options.permissionApiUpdate}
291
230
  disabled={!r.metadata.apiUpdateAllowed()}
292
231
  class="btn btn-square btn-ghost btn-xs"
293
- on:click={() => dispatch('edit', row)}
232
+ onclick={() => dispatch('edit', row)}
294
233
  >
295
234
  <Icon data={LibIcon_Edit} />
296
235
  </Button>
@@ -300,7 +239,7 @@
300
239
  permission={r.metadata.options.permissionApiDelete}
301
240
  disabled={!r.metadata.apiDeleteAllowed()}
302
241
  class="btn btn-square btn-ghost btn-xs"
303
- on:click={() => dispatch('delete', row)}
242
+ onclick={() => dispatch('delete', row)}
304
243
  >
305
244
  <Icon data={LibIcon_Delete} />
306
245
  </Button>
@@ -345,7 +284,7 @@
345
284
  >
346
285
  <Button
347
286
  class={r.loading.more ? 'btn-disabled' : 'btn-primary'}
348
- on:click={() => {
287
+ onclick={() => {
349
288
  r.queryMore()
350
289
  }}>Plus</Button
351
290
  >
@@ -14,11 +14,10 @@ declare class __sveltets_Render<T extends Record<any, any>> {
14
14
  } | undefined;
15
15
  orderBy?: EntityOrderBy<T> | undefined;
16
16
  orderByCols?: true | (keyof T)[] | undefined;
17
- settingsLeft?: boolean;
18
17
  dicoNoResult?: string;
19
18
  };
20
19
  events(): {
21
- refresh: any;
20
+ refresh: CustomEvent<any>;
22
21
  add: CustomEvent<any>;
23
22
  rowclick: CustomEvent<any>;
24
23
  edit: CustomEvent<any>;
@@ -30,7 +30,7 @@
30
30
  <FieldContainer {label} forId="paginate" classes={{ label: 'justify-end' }}>
31
31
  <div class="flex w-36 items-center justify-end">
32
32
  {#if totalCount === undefined}
33
- <Loading class="ml-6 mr-2 h-3 w-1/6"></Loading>
33
+ <Loading class="mr-2 ml-6 h-3 w-1/6"></Loading>
34
34
  <Loading class="mx-2 h-4 w-1/2"></Loading>
35
35
  <Loading class="mx-2 h-3 w-1/6"></Loading>
36
36
  {:else if !needPaginate}
@@ -13,11 +13,11 @@
13
13
  <FieldContainer {label} forId="paginate" classes={{ label: 'justify-end' }}>
14
14
  <div class="flex w-14 items-center justify-end">
15
15
  {#if totalCount === undefined}
16
- <Loading class="ml-6 mr-2 h-3 w-1/6"></Loading>
16
+ <Loading class="mr-2 ml-6 h-3 w-1/6"></Loading>
17
17
  <Loading class="mx-2 h-4 w-1/2"></Loading>
18
18
  <Loading class="mx-2 h-3 w-1/6"></Loading>
19
19
  {:else}
20
- <span class="justify-end px-2 font-bold text-primary">
20
+ <span class="mb-2 justify-end px-2 text-lg font-bold text-primary">
21
21
  {totalCount}
22
22
  </span>
23
23
  {/if}
@@ -69,14 +69,7 @@
69
69
 
70
70
  {#if BROWSER || ssr}
71
71
  {#if svg || $$slots.default}
72
- <span
73
- class={getInfoProps(className)}
74
- style={getInfoProps(style)}
75
- style:width
76
- style:height
77
- {role}
78
- on:click
79
- >
72
+ <span class={getInfoProps(className)} style={getInfoProps(style)} style:width style:height {role}>
80
73
  <slot>
81
74
  {@html svg ?? ''}
82
75
  </slot>
@@ -89,7 +82,6 @@
89
82
  class={getInfoProps(className)}
90
83
  style={getInfoProps(style)}
91
84
  {role}
92
- on:click
93
85
  >
94
86
  {#each Array.isArray(path) ? path : [path] as d, i}
95
87
  <path
@@ -102,15 +94,7 @@
102
94
  </svg>
103
95
  {/if}
104
96
  {:else}
105
- <svg
106
- {width}
107
- {height}
108
- {viewBox}
109
- class={getInfoProps(className)}
110
- style={getInfoProps(style)}
111
- {role}
112
- on:click
113
- >
97
+ <svg {width} {height} {viewBox} class={getInfoProps(className)} style={getInfoProps(style)} {role}>
114
98
  <path
115
99
  d={LibIcon_Empty}
116
100
  fill="currentColor"
@@ -45,8 +45,6 @@ declare const Icon: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithC
45
45
  }, {
46
46
  default: {};
47
47
  }>, {
48
- click: MouseEvent;
49
- } & {
50
48
  [evt: string]: CustomEvent<any>;
51
49
  }, {
52
50
  default: {};
package/esm/ui/LibIcon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Lib Icons
2
2
  // https://icones.js.org/ and https://pictogrammers.com/library/mdi/
3
- import { mdiAccountTie, mdiAccountTieWoman, mdiCancel, mdiCheck, mdiCheckAll, mdiChevronDown, mdiChevronLeft, mdiChevronRight, mdiChevronUp, mdiCloseCircleOutline, mdiCogOutline, mdiContentSaveEdit, mdiDelete, mdiEye, mdiEyeOff, mdiLoading, mdiMagnify, mdiPencil, mdiPlusBoxMultiple, mdiPlusCircle, mdiSend, mdiSort, mdiSortReverseVariant, mdiSortVariant, } from '@mdi/js';
3
+ import { mdiAccountTie, mdiAccountTieWoman, mdiCancel, mdiCheck, mdiCheckAll, mdiChevronDown, mdiChevronLeft, mdiChevronRight, mdiChevronUp, mdiCloseCircleOutline, mdiCogOutline, mdiContentSaveEdit, mdiDelete, mdiEye, mdiEyeOff, mdiLoading, mdiMagnify, mdiPencil, mdiPlus, mdiPlusBoxMultiple, mdiSend, mdiSort, mdiSortReverseVariant, mdiSortVariant, } from '@mdi/js';
4
4
  export const LibIcon_Empty = ``;
5
5
  export const LibIcon_Forbidden = mdiCancel;
6
6
  export const LibIcon_ChevronDown = mdiChevronDown;
@@ -10,7 +10,7 @@ export const LibIcon_ChevronRight = mdiChevronRight;
10
10
  export const LibIcon_Search = mdiMagnify;
11
11
  export const LibIcon_Check = mdiCheck;
12
12
  export const LibIcon_MultiCheck = mdiCheckAll;
13
- export const LibIcon_Add = mdiPlusCircle;
13
+ export const LibIcon_Add = mdiPlus;
14
14
  export const LibIcon_Eye = mdiEye;
15
15
  export const LibIcon_EyeOff = mdiEyeOff;
16
16
  export const LibIcon_MultiAdd = mdiPlusBoxMultiple;
@@ -8,7 +8,7 @@
8
8
  <!-- To fix one capa & cadb are on the same css -->
9
9
  <div
10
10
  class={tw(
11
- 'skeleton flex h-4 w-full items-center justify-center rounded-lg bg-base-content/20',
11
+ 'flex h-4 skeleton items-center justify-center rounded-lg bg-base-content/20',
12
12
  extraClass,
13
13
  )}
14
14
  >
@@ -16,7 +16,7 @@
16
16
  >
17
17
  {@html toShow.children}
18
18
  <svelte:fragment slot="actions">
19
- <Button class="text-white" on:click={() => dialog.close(toShow.id, { success: true })}
19
+ <Button class="btn-primary" onclick={() => dialog.close(toShow.id, { success: true })}
20
20
  >Confirmer</Button
21
21
  >
22
22
  </svelte:fragment>
@@ -29,10 +29,7 @@
29
29
  >
30
30
  {@html toShow.children}
31
31
  <svelte:fragment slot="actions">
32
- <Button
33
- class="btn-outline btn-error"
34
- on:click={() => dialog.close(toShow.id, { success: true })}
35
- >
32
+ <Button class="btn-error" onclick={() => dialog.close(toShow.id, { success: true })}>
36
33
  Confirmer
37
34
  </Button>
38
35
  </svelte:fragment>
@@ -51,6 +48,18 @@
51
48
  {/if}
52
49
  </svelte:component>
53
50
  </DialogPrimitive>
51
+ {:else if toShow.componentS5}
52
+ <DialogPrimitive
53
+ detail={toShow.detail}
54
+ open
55
+ on:change={() => dialog.close(toShow.id, { success: false })}
56
+ >
57
+ <svelte:component this={toShow.componentS5} {...toShow.props} dialogId={toShow.id}>
58
+ {#if toShow.children}
59
+ {@html toShow.children}
60
+ {/if}
61
+ </svelte:component>
62
+ </DialogPrimitive>
54
63
  {:else if toShow.component}
55
64
  <DialogPrimitive
56
65
  detail={toShow.detail}
@@ -57,7 +57,7 @@
57
57
  {...$content}
58
58
  use:$content.action
59
59
  >
60
- <div class="left-0 top-0 mb-4 w-full">
60
+ <div class="top-0 left-0 mb-4 w-full">
61
61
  <h2 {...$localTitle} use:$localTitle.action class="m-0 text-lg font-medium">
62
62
  <div class="flex items-center justify-between gap-4">
63
63
  <LinkPlus item={detail}></LinkPlus>
@@ -65,8 +65,8 @@
65
65
  {...$close}
66
66
  use:$close.action
67
67
  aria-label="close"
68
- class="btn btn-circle btn-outline btn-lg
69
- h-max min-h-0 w-max border-none"
68
+ class="btn btn-circle h-max min-h-0
69
+ w-max border-none btn-outline btn-lg"
70
70
  >
71
71
  <Icon data={LibIcon_Cross}></Icon>
72
72
  </button>