firstly 0.0.11 → 0.0.13
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/CHANGELOG.md +16 -0
- package/esm/BaseEnum.d.ts +2 -0
- package/esm/BaseEnum.js +2 -0
- package/esm/FF_Fields.js +0 -1
- package/esm/ROUTES.d.ts +2 -2
- package/esm/ROUTES.js +10 -5
- package/esm/SqlDatabase/FF_LogToConsole.d.ts +1 -0
- package/esm/SqlDatabase/FF_LogToConsole.js +22 -16
- package/esm/api/index.d.ts +20 -21
- package/esm/api/index.js +74 -62
- package/esm/auth/{client/Auth.d.ts → AuthController.d.ts} +18 -25
- package/esm/auth/{client/Auth.js → AuthController.js} +48 -44
- package/esm/auth/{client/Entities.d.ts → Entities.d.ts} +4 -3
- package/esm/auth/{client/Entities.js → Entities.js} +7 -7
- package/esm/auth/README.md +0 -10
- package/esm/auth/index.d.ts +5 -149
- package/esm/auth/index.js +5 -316
- package/esm/auth/{AuthController.server.d.ts → server/AuthController.server.d.ts} +10 -10
- package/esm/auth/{AuthController.server.js → server/AuthController.server.js} +133 -171
- package/esm/auth/server/handleAuth.d.ts +2 -0
- package/esm/auth/server/handleAuth.js +140 -0
- package/esm/auth/server/handleGuard.d.ts +16 -0
- package/esm/auth/server/handleGuard.js +67 -0
- package/esm/auth/server/helperDb.d.ts +10 -0
- package/esm/auth/server/helperDb.js +56 -0
- package/esm/auth/server/helperFirstly.d.ts +1 -0
- package/esm/auth/server/helperFirstly.js +8 -0
- package/esm/auth/server/helperOslo.d.ts +7 -0
- package/esm/auth/server/helperOslo.js +24 -0
- package/esm/auth/server/helperRemultServer.d.ts +5 -0
- package/esm/auth/server/helperRemultServer.js +44 -0
- package/esm/auth/{RoleHelpers.d.ts → server/helperRole.d.ts} +1 -1
- package/esm/auth/{RoleHelpers.js → server/helperRole.js} +1 -1
- package/esm/auth/server/index.d.ts +7 -0
- package/esm/auth/server/index.js +7 -0
- package/esm/auth/server/module.d.ts +257 -0
- package/esm/auth/server/module.js +197 -0
- package/esm/auth/{providers → server/providers}/github.d.ts +6 -4
- package/esm/auth/{providers → server/providers}/github.js +29 -20
- package/esm/auth/{providers/index.d.ts → server/providers/helperProvider.d.ts} +0 -2
- package/esm/auth/{providers/index.js → server/providers/helperProvider.js} +5 -6
- package/esm/auth/static/assets/Page-BUfjaN-D.d.ts +5 -0
- package/esm/auth/static/assets/Page-BUfjaN-D.js +19 -0
- package/esm/auth/static/assets/Page-CJ58H1vl.css +1 -0
- package/esm/auth/static/assets/Page-CaDAqmBS.d.ts +5 -0
- package/esm/auth/static/assets/Page-CaDAqmBS.js +1 -0
- package/esm/auth/static/assets/Page-DhdZddzJ.d.ts +5 -0
- package/esm/auth/static/assets/Page-DhdZddzJ.js +1 -0
- package/esm/auth/static/assets/index-BDy4A_14.css +4 -0
- package/esm/auth/static/assets/index-D-Ztdt2o.d.ts +54 -0
- package/esm/auth/static/assets/index-D-Ztdt2o.js +2 -0
- package/esm/auth/static/index.html +11 -11
- package/esm/auth/types.d.ts +5 -0
- package/esm/bin/cmd.js +122 -54
- package/esm/cellsBuildor.js +7 -7
- package/esm/changeLog/index.d.ts +0 -36
- package/esm/changeLog/index.js +3 -43
- package/esm/changeLog/server/index.d.ts +36 -0
- package/esm/changeLog/server/index.js +42 -0
- package/esm/common.d.ts +5 -0
- package/esm/common.js +8 -0
- package/esm/cron/{index.d.ts → server/index.d.ts} +1 -1
- package/esm/cron/server/index.js +103 -0
- package/esm/feedback/FeedbackController.js +4 -5
- package/esm/feedback/index.d.ts +0 -16
- package/esm/feedback/index.js +0 -11
- package/esm/feedback/server/index.d.ts +17 -0
- package/esm/feedback/server/index.js +13 -0
- package/esm/feedback/ui/DialogIssue.svelte +52 -56
- package/esm/feedback/ui/DialogIssues.svelte +71 -71
- package/esm/feedback/ui/DialogMilestones.svelte +22 -22
- package/esm/helper.js +3 -3
- package/esm/index.d.ts +3 -20
- package/esm/index.js +3 -10
- package/esm/mail/index.d.ts +2 -30
- package/esm/mail/index.js +2 -79
- package/esm/mail/server/index.d.ts +31 -0
- package/esm/mail/server/index.js +88 -0
- package/esm/mail/templates/DefaultMail.svelte +17 -17
- package/esm/storeItem.js +8 -2
- package/esm/storeList.d.ts +1 -1
- package/esm/storeList.js +1 -1
- package/esm/sveltekit/server/index.d.ts +14 -0
- package/esm/sveltekit/server/index.js +24 -0
- package/esm/ui/Button.svelte +33 -33
- package/esm/ui/Button.svelte.d.ts +2 -2
- package/esm/ui/Clipboardable.svelte +11 -8
- package/esm/ui/Clipboardable.svelte.d.ts +4 -4
- package/esm/ui/Field.svelte +142 -149
- package/esm/ui/Field.svelte.d.ts +2 -2
- package/esm/ui/FieldGroup.svelte +38 -38
- package/esm/ui/Grid.svelte +212 -222
- package/esm/ui/GridLoading.svelte +18 -22
- package/esm/ui/GridPaginate.svelte +38 -38
- package/esm/ui/Icon.svelte +50 -49
- package/esm/ui/Icon.svelte.d.ts +18 -18
- package/esm/ui/Loading.svelte +5 -2
- package/esm/ui/Tooltip.svelte +16 -16
- package/esm/ui/dialog/DialogForm.svelte +23 -23
- package/esm/ui/dialog/DialogManagement.svelte +74 -74
- package/esm/ui/dialog/DialogPrimitive.svelte +50 -51
- package/esm/ui/dialog/FormEditAction.svelte +34 -34
- package/esm/ui/dialog/dialog.d.ts +2 -2
- package/esm/ui/dialog/dialog.js +1 -1
- package/esm/ui/internals/FieldContainer.svelte +11 -12
- package/esm/ui/internals/FieldContainer.svelte.d.ts +3 -3
- package/esm/ui/internals/Input.svelte +25 -25
- package/esm/ui/internals/Input.svelte.d.ts +1 -1
- package/esm/ui/internals/Textarea.svelte +21 -21
- package/esm/ui/internals/Textarea.svelte.d.ts +2 -2
- package/esm/ui/internals/select/MultiSelectMelt.svelte +69 -73
- package/esm/ui/internals/select/SelectMelt.svelte +86 -86
- package/esm/ui/internals/select/SelectRadio.svelte +22 -22
- package/esm/ui/link/Link.svelte +14 -14
- package/esm/ui/link/Link.svelte.d.ts +3 -4
- package/esm/ui/link/LinkPlus.svelte +33 -35
- package/esm/vite/index.js +24 -25
- package/package.json +50 -42
- package/esm/auth/Adapter.d.ts +0 -10
- package/esm/auth/Adapter.js +0 -50
- package/esm/auth/client/index.d.ts +0 -7
- package/esm/auth/client/index.js +0 -7
- package/esm/auth/helper.d.ts +0 -6
- package/esm/auth/helper.js +0 -14
- package/esm/auth/providers/strava.d.ts +0 -30
- package/esm/auth/providers/strava.js +0 -60
- package/esm/auth/static/assets/Page-BEFYPjis.d.ts +0 -4
- package/esm/auth/static/assets/Page-BEFYPjis.js +0 -1
- package/esm/auth/static/assets/Page-BGTO8LC5.css +0 -1
- package/esm/auth/static/assets/Page-Cfysx_UV.d.ts +0 -6
- package/esm/auth/static/assets/Page-Cfysx_UV.js +0 -18
- package/esm/auth/static/assets/Page-DtgkOCJs.d.ts +0 -4
- package/esm/auth/static/assets/Page-DtgkOCJs.js +0 -1
- package/esm/auth/static/assets/index-CR_3yNaJ.css +0 -4
- package/esm/auth/static/assets/index-QypqCYwC.d.ts +0 -63
- package/esm/auth/static/assets/index-QypqCYwC.js +0 -2
- package/esm/cron/index.js +0 -102
- package/esm/handle/index.d.ts +0 -7
- package/esm/handle/index.js +0 -40
package/esm/ui/Grid.svelte
CHANGED
|
@@ -87,230 +87,220 @@ const classForRounding = (i) => {
|
|
|
87
87
|
</script>
|
|
88
88
|
|
|
89
89
|
<div class="overflow-x-auto">
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
<table class="table {classes.table}">
|
|
91
|
+
<thead>
|
|
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
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
{/each}
|
|
112
|
+
{#each cellsToTake(cells) as b, i}
|
|
113
|
+
{@const al = align(b.field, b.kind === 'slot')}
|
|
114
|
+
<th class="{al} {classForRounding(i)}">
|
|
115
|
+
{#if b.headerSlot}
|
|
116
|
+
<slot name="header" field={b.field} />
|
|
117
|
+
{:else}
|
|
118
|
+
{@const toSort = orderByCols === true || (orderByCols && orderByCols.includes(b.field?.key))}
|
|
119
|
+
{#if toSort}
|
|
120
|
+
<button
|
|
121
|
+
class="flex items-center justify-between gap-2"
|
|
122
|
+
disabled={!toSort}
|
|
123
|
+
on:click={() => sorting(toSort ?? false, b)}
|
|
124
|
+
>
|
|
125
|
+
{b.header ?? b.field?.caption}
|
|
126
|
+
{#if toSort}
|
|
127
|
+
<Icon {...sortingIcon(toSort ?? false, b, orderBy)}></Icon>
|
|
128
|
+
{/if}
|
|
129
|
+
</button>
|
|
130
|
+
{:else}
|
|
131
|
+
{b.header ?? b.field?.caption}
|
|
132
|
+
{/if}
|
|
133
|
+
{/if}
|
|
134
|
+
</th>
|
|
135
|
+
{/each}
|
|
137
136
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
137
|
+
{#if !settingsLeft && (withEdit || withDelete || withAdd)}
|
|
138
|
+
<th class="rounded-tr-lg">
|
|
139
|
+
<div class="flex justify-end">
|
|
140
|
+
{#if withAdd}
|
|
141
|
+
<Button
|
|
142
|
+
permission={store.getRepo().metadata.options.permissionApiInsert}
|
|
143
|
+
disabled={!store.getRepo().metadata.apiInsertAllowed()}
|
|
144
|
+
class="btn btn-square btn-ghost btn-xs"
|
|
145
|
+
on:click={() => dispatch('add', {})}
|
|
146
|
+
>
|
|
147
|
+
<Icon data={LibIcon_Add} />
|
|
148
|
+
</Button>
|
|
149
|
+
{:else}
|
|
150
|
+
<Icon data={LibIcon_Settings}></Icon>
|
|
151
|
+
{/if}
|
|
152
|
+
</div>
|
|
153
|
+
</th>
|
|
154
|
+
{/if}
|
|
155
|
+
</tr>
|
|
156
|
+
</thead>
|
|
157
|
+
<tbody>
|
|
158
|
+
<!-- Show loading only if there is no items and loading is true, like this on an update, there will be no jump -->
|
|
159
|
+
{#if $store.items.length === 0 && $store.loading && store.getRepo().metadata.apiReadAllowed}
|
|
160
|
+
<GridLoading columns={getAligns(cells, withEdit || withDelete)} {loadingRows} />
|
|
161
|
+
{:else}
|
|
162
|
+
{#each $store.items as row}
|
|
163
|
+
<tr on:click={() => dispatch('rowclick', row)} class="hover:bg-base-content/20">
|
|
164
|
+
<!-- BECARFULL THIS CODE IS DUPLICATED -->
|
|
165
|
+
{#if settingsLeft && (withEdit || withDelete)}
|
|
166
|
+
<td class="text-left">
|
|
167
|
+
<div class="flex justify-start gap-2">
|
|
168
|
+
{#if withEdit}
|
|
169
|
+
<Button
|
|
170
|
+
permission={store.getRepo().metadata.options.permissionApiUpdate}
|
|
171
|
+
disabled={!store.getRepo().metadata.apiUpdateAllowed()}
|
|
172
|
+
class="btn btn-square btn-ghost btn-xs"
|
|
173
|
+
on:click={() => dispatch('edit', row)}
|
|
174
|
+
>
|
|
175
|
+
<Icon data={LibIcon_Edit} />
|
|
176
|
+
</Button>
|
|
177
|
+
{/if}
|
|
178
|
+
{#if withDelete}
|
|
179
|
+
<Button
|
|
180
|
+
permission={store.getRepo().metadata.options.permissionApiDelete}
|
|
181
|
+
disabled={!store.getRepo().metadata.apiDeleteAllowed()}
|
|
182
|
+
class="btn btn-square btn-ghost btn-xs"
|
|
183
|
+
on:click={() => dispatch('delete', row)}
|
|
184
|
+
>
|
|
185
|
+
<Icon data={LibIcon_Delete} />
|
|
186
|
+
</Button>
|
|
187
|
+
{/if}
|
|
188
|
+
</div>
|
|
189
|
+
</td>
|
|
190
|
+
{/if}
|
|
192
191
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
{/if}
|
|
261
|
-
</td>
|
|
262
|
-
{/each}
|
|
192
|
+
{#each cellsToTake(cells) as b}
|
|
193
|
+
{@const metaType = getFieldMetaType(b.field)}
|
|
194
|
+
<td class={align(b.field, b.kind === 'slot')}>
|
|
195
|
+
{#if metaType.kind === 'slot' || b.kind === 'slot'}
|
|
196
|
+
<slot name="cell" {row} field={b.field} cell={b} />
|
|
197
|
+
{:else if b.kind === 'component'}
|
|
198
|
+
{#if b.component}
|
|
199
|
+
<div class={b.class}>
|
|
200
|
+
<svelte:component
|
|
201
|
+
this={b.component}
|
|
202
|
+
{...b.props}
|
|
203
|
+
{...b.rowToProps ? b.rowToProps(row) : {}}
|
|
204
|
+
on:refresh
|
|
205
|
+
></svelte:component>
|
|
206
|
+
</div>
|
|
207
|
+
{:else}
|
|
208
|
+
<pre>Col: {b.col}</pre>
|
|
209
|
+
<pre class="bg-error">Component prop needed !</pre>
|
|
210
|
+
{/if}
|
|
211
|
+
{:else if metaType.kind === 'relation'}
|
|
212
|
+
{@const item = getEntityDisplayValue(metaType.repoTarget, row[metaType.field.key])}
|
|
213
|
+
<LinkPlus
|
|
214
|
+
item={{
|
|
215
|
+
...item,
|
|
216
|
+
href: b.field?.options?.href ? b.field?.options.href(row) : item?.href,
|
|
217
|
+
}}
|
|
218
|
+
/>
|
|
219
|
+
{:else if b.kind === 'baseItem'}
|
|
220
|
+
<LinkPlus item={row[metaType.field.key]} />
|
|
221
|
+
{:else if b.kind === 'field_link'}
|
|
222
|
+
{@const item = getFieldLinkDisplayValue(metaType.field, row)}
|
|
223
|
+
<LinkPlus {item} />
|
|
224
|
+
{:else if b.kind === 'entity_link'}
|
|
225
|
+
{@const item = getEntityDisplayValueFromField(metaType.field, row)}
|
|
226
|
+
<LinkPlus {item} />
|
|
227
|
+
{:else if metaType.kind === 'enum'}
|
|
228
|
+
{#if metaType.subKind === 'single'}
|
|
229
|
+
<LinkPlus item={row[metaType.field.key]}></LinkPlus>
|
|
230
|
+
{:else if metaType.subKind === 'multi'}
|
|
231
|
+
<!-- {@const t = metaType.field.displayValue(row)} -->
|
|
232
|
+
{#each row[metaType.field.key] as enumVal}
|
|
233
|
+
<div>
|
|
234
|
+
{enumVal.caption}
|
|
235
|
+
</div>
|
|
236
|
+
{/each}
|
|
237
|
+
{/if}
|
|
238
|
+
{:else if metaType.subKind === 'checkbox'}
|
|
239
|
+
{@const t = metaType.field.displayValue(row)}
|
|
240
|
+
{t === 'true' ? 'Oui' : 'Non'}
|
|
241
|
+
{:else}
|
|
242
|
+
{@const t = displayWithDefaultAndSuffix(metaType.field, row[metaType.field.key])}
|
|
243
|
+
{#if b.clipboardable}
|
|
244
|
+
<Clipboardable value={t}>
|
|
245
|
+
<!-- 20 is a cool value ! -->
|
|
246
|
+
<span class={t.length < 20 ? 'text-nowrap' : ''}>
|
|
247
|
+
{t}
|
|
248
|
+
</span>
|
|
249
|
+
</Clipboardable>
|
|
250
|
+
{:else}
|
|
251
|
+
<!-- 20 is a cool value ! -->
|
|
252
|
+
<span class={t.length < 20 ? 'text-nowrap' : ''}>
|
|
253
|
+
{t}
|
|
254
|
+
</span>
|
|
255
|
+
{/if}
|
|
256
|
+
{/if}
|
|
257
|
+
</td>
|
|
258
|
+
{/each}
|
|
263
259
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
{/if}
|
|
311
|
-
{/each}
|
|
312
|
-
<slot name="extra" />
|
|
313
|
-
{/if}
|
|
314
|
-
</tbody>
|
|
315
|
-
</table>
|
|
260
|
+
{#if !settingsLeft && (withEdit || withDelete)}
|
|
261
|
+
<td class="text-right">
|
|
262
|
+
<div class="flex justify-end gap-2">
|
|
263
|
+
{#if withEdit}
|
|
264
|
+
<Button
|
|
265
|
+
permission={store.getRepo().metadata.options.permissionApiUpdate}
|
|
266
|
+
disabled={!store.getRepo().metadata.apiUpdateAllowed()}
|
|
267
|
+
class="btn btn-square btn-ghost btn-xs"
|
|
268
|
+
on:click={() => dispatch('edit', row)}
|
|
269
|
+
>
|
|
270
|
+
<Icon data={LibIcon_Edit} />
|
|
271
|
+
</Button>
|
|
272
|
+
{/if}
|
|
273
|
+
{#if withDelete}
|
|
274
|
+
<Button
|
|
275
|
+
permission={store.getRepo().metadata.options.permissionApiDelete}
|
|
276
|
+
disabled={!store.getRepo().metadata.apiDeleteAllowed()}
|
|
277
|
+
class="btn btn-square btn-ghost btn-xs"
|
|
278
|
+
on:click={() => dispatch('delete', row)}
|
|
279
|
+
>
|
|
280
|
+
<Icon data={LibIcon_Delete} />
|
|
281
|
+
</Button>
|
|
282
|
+
{/if}
|
|
283
|
+
</div>
|
|
284
|
+
</td>
|
|
285
|
+
{/if}
|
|
286
|
+
</tr>
|
|
287
|
+
{:else}
|
|
288
|
+
{#if !store.getRepo().metadata.apiReadAllowed}
|
|
289
|
+
<tr>
|
|
290
|
+
<td colspan={getAligns(cells, withEdit || withDelete).length} class="text-center py-12">
|
|
291
|
+
Vous n'avez pas la permission pour ces données!
|
|
292
|
+
</td>
|
|
293
|
+
</tr>
|
|
294
|
+
{:else if dicoNoResult}
|
|
295
|
+
<tr>
|
|
296
|
+
<td colspan={getAligns(cells, withEdit || withDelete).length} class="text-center py-12">
|
|
297
|
+
{dicoNoResult}
|
|
298
|
+
</td>
|
|
299
|
+
</tr>
|
|
300
|
+
{/if}
|
|
301
|
+
{/each}
|
|
302
|
+
<slot name="extra" />
|
|
303
|
+
{/if}
|
|
304
|
+
</tbody>
|
|
305
|
+
</table>
|
|
316
306
|
</div>
|
|
@@ -7,26 +7,22 @@ let size = ["", "w-1/2", "w-1/3", "w-1/4", "w-1/5", "w-1/6"];
|
|
|
7
7
|
|
|
8
8
|
<!-- Do 10 rows -->
|
|
9
9
|
{#each new Array(loadingRows) as _row, r}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</div>
|
|
29
|
-
</td>
|
|
30
|
-
{/each}
|
|
31
|
-
</tr>
|
|
10
|
+
<tr>
|
|
11
|
+
{#each columns as column, c}
|
|
12
|
+
<td class="{column} ">
|
|
13
|
+
<div class={tw('flex justify-between', column === 'text-right' && 'flex-row-reverse')}>
|
|
14
|
+
{#if column === 'text-center'}
|
|
15
|
+
<div></div>
|
|
16
|
+
{/if}
|
|
17
|
+
<Loading
|
|
18
|
+
class={tw(
|
|
19
|
+
`h-4`,
|
|
20
|
+
size[parseInt((((r + 1) * (c + 1) * Math.random() * size.length) % size.length).toString())],
|
|
21
|
+
)}
|
|
22
|
+
/>
|
|
23
|
+
<div></div>
|
|
24
|
+
</div>
|
|
25
|
+
</td>
|
|
26
|
+
{/each}
|
|
27
|
+
</tr>
|
|
32
28
|
{/each}
|
|
@@ -24,42 +24,42 @@ $: canGoNext = isValidValue && needPaginate && pageDisplayed < Math.ceil((totalC
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<FieldContainer {label} forId="paginate" classes={{ label: 'justify-end' }}>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
27
|
+
<div class="flex w-36 items-center justify-end">
|
|
28
|
+
{#if totalCount === undefined}
|
|
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>
|
|
32
|
+
{:else if !needPaginate}
|
|
33
|
+
<span class="text-primary justify-end px-2 font-bold">
|
|
34
|
+
{totalCount}
|
|
35
|
+
</span>
|
|
36
|
+
{:else}
|
|
37
|
+
<div class="join">
|
|
38
|
+
<button
|
|
39
|
+
aria-label="left"
|
|
40
|
+
on:click={() => update('-')}
|
|
41
|
+
class="btn join-item p-1 {pageDisplayed === 1 ? 'btn-disabled' : ''}"
|
|
42
|
+
>
|
|
43
|
+
<Icon data={LibIcon_ChevronLeft} />
|
|
44
|
+
</button>
|
|
45
|
+
{#if isValidValue}
|
|
46
|
+
<button aria-label="current" class="btn join-item px-0">
|
|
47
|
+
<span class="text-primary font-bold">{totalCount}</span>
|
|
48
|
+
<span class="text-[0.55rem] italic"
|
|
49
|
+
>({pageDisplayed} / {Math.ceil((totalCount ?? 0) / pageSize)})</span
|
|
50
|
+
>
|
|
51
|
+
</button>
|
|
52
|
+
{:else}
|
|
53
|
+
<button aria-label="loading" class="btn join-item animate-pulse">.....</button>
|
|
54
|
+
{/if}
|
|
55
|
+
<button
|
|
56
|
+
aria-label="right"
|
|
57
|
+
on:click={() => update('+')}
|
|
58
|
+
class="btn join-item p-1 {!canGoNext ? 'btn-disabled' : ''}"
|
|
59
|
+
>
|
|
60
|
+
<Icon data={LibIcon_ChevronRight} />
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
65
|
</FieldContainer>
|