firstly 0.2.0 → 0.3.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/CHANGELOG.md +23 -0
- package/esm/bin/cmd.js +3 -158
- package/esm/changeLog/index.d.ts +1 -6
- package/esm/feedback/FeedbackController.d.ts +6 -2
- package/esm/feedback/FeedbackController.js +145 -143
- package/esm/feedback/server/index.d.ts +2 -2
- package/esm/feedback/server/index.js +3 -3
- package/esm/feedback/types.d.ts +5 -0
- package/esm/feedback/ui/DialogIssue.svelte +5 -5
- package/esm/feedback/ui/DialogIssues.svelte +5 -5
- package/esm/feedback/ui/DialogMilestones.svelte +1 -1
- package/esm/internals/BaseEnum.d.ts +2 -1
- package/esm/internals/FF_Entity.js +1 -17
- package/esm/internals/FF_Fields.d.ts +4 -3
- package/esm/internals/FF_Fields.js +14 -55
- package/esm/internals/cellsBuildor.d.ts +2 -1
- package/esm/internals/cellsBuildor.js +5 -4
- package/esm/internals/index.d.ts +7 -12
- package/esm/internals/storeItem.d.ts +12 -20
- package/esm/internals/storeItem.js +20 -6
- package/esm/mail/server/index.d.ts +8 -2
- package/esm/mail/server/index.js +35 -7
- package/esm/server/index.d.ts +1 -1
- package/esm/svelte/FF_Cell.svelte +3 -5
- package/esm/svelte/FF_Cell.svelte.d.ts +4 -2
- package/esm/svelte/FF_Form.svelte +4 -5
- package/esm/svelte/FF_Grid.svelte +2 -2
- package/esm/svelte/FF_Layout.svelte +3 -3
- package/esm/svelte/FF_Repo.svelte.d.ts +9 -0
- package/esm/svelte/FF_Repo.svelte.js +39 -0
- package/esm/svelte/class/SP.svelte.js +14 -2
- package/esm/svelte/dialog/DialogManagement.svelte +2 -5
- package/esm/svelte/dialog/DialogPrimitive.svelte +1 -2
- package/esm/svelte/dialog/dialog.js +2 -2
- package/esm/svelte/ff_Config.svelte.js +2 -2
- package/esm/svelte/index.d.ts +2 -7
- package/esm/svelte/index.js +2 -7
- package/esm/ui/Button.svelte +34 -66
- package/esm/ui/Button.svelte.d.ts +9 -35
- package/esm/ui/Clipboardable.svelte +13 -17
- package/esm/ui/Clipboardable.svelte.d.ts +9 -33
- package/esm/ui/Field.svelte +48 -9
- package/esm/ui/FieldGroup.svelte.d.ts +1 -1
- package/esm/ui/Grid.svelte +13 -87
- package/esm/ui/Grid.svelte.d.ts +0 -1
- package/esm/ui/Grid2.svelte +26 -90
- package/esm/ui/Grid2.svelte.d.ts +1 -2
- package/esm/ui/GridPaginate.svelte +1 -1
- package/esm/ui/GridPaginate2.svelte +2 -2
- package/esm/ui/Icon.svelte +2 -18
- package/esm/ui/Icon.svelte.d.ts +0 -2
- package/esm/ui/LibIcon.js +2 -2
- package/esm/ui/Loading.svelte +1 -1
- package/esm/ui/dialog/DialogManagement.svelte +14 -5
- package/esm/ui/dialog/DialogPrimitive.svelte +3 -3
- package/esm/ui/dialog/FormEditAction.svelte +4 -4
- package/esm/ui/dialog/dialog.d.ts +5 -2
- package/esm/ui/dialog/dialog.js +2 -2
- package/esm/ui/index.d.ts +1 -0
- package/esm/ui/index.js +1 -0
- package/esm/ui/internals/FieldContainer.svelte +25 -14
- package/esm/ui/internals/FieldContainer.svelte.d.ts +9 -30
- package/esm/ui/internals/Input.svelte.d.ts +1 -1
- package/esm/ui/internals/Textarea.svelte +2 -5
- package/esm/ui/internals/select/MultiSelectMelt.svelte +10 -8
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +1 -1
- package/esm/ui/internals/select/Select2.svelte +88 -0
- package/esm/ui/internals/select/Select2.svelte.d.ts +12 -0
- package/esm/ui/internals/select/SelectMelt.svelte +33 -24
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +1 -1
- package/esm/ui/internals/select/SelectRadio.svelte +2 -2
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +1 -1
- package/esm/ui/link/Link.svelte +1 -1
- package/esm/ui/link/LinkPlus.svelte +9 -5
- package/esm/ui/link/LinkPlus.svelte.d.ts +5 -19
- package/esm/virtual/Customer.js +1 -2
- package/esm/virtual/UIEntity.js +9 -5
- package/package.json +11 -25
- package/esm/auth/AuthController.d.ts +0 -58
- package/esm/auth/AuthController.js +0 -114
- package/esm/auth/Entities.d.ts +0 -47
- package/esm/auth/Entities.js +0 -182
- package/esm/auth/README.md +0 -3
- package/esm/auth/index.d.ts +0 -5
- package/esm/auth/index.js +0 -5
- package/esm/auth/server/AuthController.server.d.ts +0 -58
- package/esm/auth/server/AuthController.server.js +0 -498
- package/esm/auth/server/handleAuth.d.ts +0 -4
- package/esm/auth/server/handleAuth.js +0 -142
- package/esm/auth/server/handleGuard.d.ts +0 -22
- package/esm/auth/server/handleGuard.js +0 -34
- package/esm/auth/server/helperDb.d.ts +0 -10
- package/esm/auth/server/helperDb.js +0 -56
- package/esm/auth/server/helperFirstly.d.ts +0 -1
- package/esm/auth/server/helperFirstly.js +0 -9
- package/esm/auth/server/helperOslo.d.ts +0 -7
- package/esm/auth/server/helperOslo.js +0 -24
- package/esm/auth/server/helperRemultServer.d.ts +0 -5
- package/esm/auth/server/helperRemultServer.js +0 -44
- package/esm/auth/server/helperRole.d.ts +0 -19
- package/esm/auth/server/helperRole.js +0 -57
- package/esm/auth/server/index.d.ts +0 -8
- package/esm/auth/server/index.js +0 -8
- package/esm/auth/server/module.d.ts +0 -300
- package/esm/auth/server/module.js +0 -230
- package/esm/auth/server/providers/github.d.ts +0 -33
- package/esm/auth/server/providers/github.js +0 -87
- package/esm/auth/server/providers/helperProvider.d.ts +0 -1
- package/esm/auth/server/providers/helperProvider.js +0 -25
- package/esm/auth/static/assets/Page-9Ytj29NS.d.ts +0 -2
- package/esm/auth/static/assets/Page-9Ytj29NS.js +0 -1
- package/esm/auth/static/assets/Page-BHW08QWz.css +0 -1
- package/esm/auth/static/assets/Page-C1pM-UDt.d.ts +0 -2
- package/esm/auth/static/assets/Page-C1pM-UDt.js +0 -20
- package/esm/auth/static/assets/Page-CPz6KCw_.d.ts +0 -2
- package/esm/auth/static/assets/Page-CPz6KCw_.js +0 -1
- package/esm/auth/static/assets/index-AoBb9Ds5.d.ts +0 -232
- package/esm/auth/static/assets/index-AoBb9Ds5.js +0 -2
- package/esm/auth/static/assets/index-DKWpA6v7.css +0 -4
- package/esm/auth/static/favicon.svg +0 -79
- package/esm/auth/static/index.html +0 -13
- package/esm/auth/types.d.ts +0 -73
- package/esm/auth/types.js +0 -1
- package/esm/svelte/FF_Display.svelte +0 -51
- package/esm/svelte/FF_Display.svelte.d.ts +0 -29
- package/esm/svelte/FF_Edit.svelte +0 -104
- package/esm/svelte/FF_Edit.svelte.d.ts +0 -32
- package/esm/svelte/FF_Error.svelte +0 -23
- package/esm/svelte/FF_Error.svelte.d.ts +0 -29
- package/esm/svelte/FF_Field.svelte +0 -62
- package/esm/svelte/FF_Field.svelte.d.ts +0 -29
- package/esm/svelte/FF_Hint.svelte +0 -21
- package/esm/svelte/FF_Hint.svelte.d.ts +0 -29
- package/esm/svelte/FF_Label.svelte +0 -23
- package/esm/svelte/FF_Label.svelte.d.ts +0 -29
package/esm/ui/Grid2.svelte
CHANGED
|
@@ -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}
|
|
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=
|
|
97
|
+
<th class={al}>
|
|
141
98
|
{#if b.headerSlot}
|
|
142
99
|
<slot name="header" field={b.field} />
|
|
143
100
|
{:else}
|
|
@@ -160,15 +117,14 @@
|
|
|
160
117
|
</th>
|
|
161
118
|
{/each}
|
|
162
119
|
|
|
163
|
-
{#if
|
|
164
|
-
<th class="
|
|
120
|
+
{#if withEdit || withDelete || withAdd}
|
|
121
|
+
<th class="">
|
|
165
122
|
<div class="flex justify-end">
|
|
166
123
|
{#if withAdd}
|
|
167
124
|
<Button
|
|
168
|
-
permission={r.metadata.options.permissionApiInsert}
|
|
169
125
|
disabled={!r.metadata.apiInsertAllowed()}
|
|
170
126
|
class="btn btn-square btn-ghost btn-xs"
|
|
171
|
-
|
|
127
|
+
onclick={() => dispatch('add', {})}
|
|
172
128
|
>
|
|
173
129
|
<Icon data={LibIcon_Add} />
|
|
174
130
|
</Button>
|
|
@@ -180,40 +136,12 @@
|
|
|
180
136
|
{/if}
|
|
181
137
|
</tr>
|
|
182
138
|
</thead>
|
|
183
|
-
<tbody>
|
|
139
|
+
<tbody class="">
|
|
184
140
|
{#if r.loading.init && r.metadata.apiReadAllowed}
|
|
185
141
|
<GridLoading columns={getAligns(cells, withEdit || withDelete)} {loadingRows} />
|
|
186
142
|
{:else}
|
|
187
143
|
{#each r.items ?? [] as row}
|
|
188
144
|
<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
145
|
{#each cellsToTake(cells) as b}
|
|
218
146
|
{@const metaType = getFieldMetaType(b.field)}
|
|
219
147
|
<td class={align(b.field, b.kind === 'slot')}>
|
|
@@ -229,6 +157,16 @@
|
|
|
229
157
|
on:refresh
|
|
230
158
|
></svelte:component>
|
|
231
159
|
</div>
|
|
160
|
+
{:else if b.componentS5}
|
|
161
|
+
{@const Comp = b.componentS5}
|
|
162
|
+
<!-- NOT TESTED YET! -->
|
|
163
|
+
<div class={b.class}>
|
|
164
|
+
<Comp
|
|
165
|
+
{...b.props}
|
|
166
|
+
{...b.rowToProps ? b.rowToProps(row) : {}}
|
|
167
|
+
onrefresh={() => dispatch('refresh')}
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
232
170
|
{:else}
|
|
233
171
|
<pre>Col: {b.col}</pre>
|
|
234
172
|
<pre class="bg-error">Component prop needed !</pre>
|
|
@@ -282,25 +220,23 @@
|
|
|
282
220
|
</td>
|
|
283
221
|
{/each}
|
|
284
222
|
|
|
285
|
-
{#if
|
|
223
|
+
{#if withEdit || withDelete}
|
|
286
224
|
<td class="text-right">
|
|
287
225
|
<div class="flex justify-end gap-2">
|
|
288
226
|
{#if withEdit}
|
|
289
227
|
<Button
|
|
290
|
-
|
|
291
|
-
disabled={!r.metadata.apiUpdateAllowed()}
|
|
228
|
+
disabled={!r.metadata.apiUpdateAllowed(row)}
|
|
292
229
|
class="btn btn-square btn-ghost btn-xs"
|
|
293
|
-
|
|
230
|
+
onclick={() => dispatch('edit', row)}
|
|
294
231
|
>
|
|
295
232
|
<Icon data={LibIcon_Edit} />
|
|
296
233
|
</Button>
|
|
297
234
|
{/if}
|
|
298
235
|
{#if withDelete}
|
|
299
236
|
<Button
|
|
300
|
-
permission={r.metadata.options.permissionApiDelete}
|
|
301
237
|
disabled={!r.metadata.apiDeleteAllowed()}
|
|
302
238
|
class="btn btn-square btn-ghost btn-xs"
|
|
303
|
-
|
|
239
|
+
onclick={() => dispatch('delete', row)}
|
|
304
240
|
>
|
|
305
241
|
<Icon data={LibIcon_Delete} />
|
|
306
242
|
</Button>
|
|
@@ -345,7 +281,7 @@
|
|
|
345
281
|
>
|
|
346
282
|
<Button
|
|
347
283
|
class={r.loading.more ? 'btn-disabled' : 'btn-primary'}
|
|
348
|
-
|
|
284
|
+
onclick={() => {
|
|
349
285
|
r.queryMore()
|
|
350
286
|
}}>Plus</Button
|
|
351
287
|
>
|
package/esm/ui/Grid2.svelte.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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}
|
package/esm/ui/Icon.svelte
CHANGED
|
@@ -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"
|
package/esm/ui/Icon.svelte.d.ts
CHANGED
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,
|
|
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 =
|
|
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;
|
package/esm/ui/Loading.svelte
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<!-- To fix one capa & cadb are on the same css -->
|
|
9
9
|
<div
|
|
10
10
|
class={tw(
|
|
11
|
-
'
|
|
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="
|
|
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="
|
|
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
|
|
69
|
-
|
|
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>
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
{#if wDelete}
|
|
27
27
|
<Button
|
|
28
28
|
type="button"
|
|
29
|
-
|
|
30
|
-
class="
|
|
29
|
+
onclick={dispatchDelete}
|
|
30
|
+
class="mr-4 btn-error"
|
|
31
31
|
isLoading={$store.loading}
|
|
32
32
|
>
|
|
33
33
|
<Icon data={LibIcon_Delete} />
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
|
-
<Button class="
|
|
44
|
+
<Button class="btn-primary" {...$$restProps} isLoading={$store.loading}>
|
|
45
45
|
<Icon data={LibIcon_Check} />
|
|
46
46
|
<p>Sauvegarder</p>
|
|
47
47
|
</Button>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
{/if}
|
|
55
55
|
</div>
|
|
56
56
|
|
|
57
|
-
<Button class="
|
|
57
|
+
<Button class="btn-primary" {...$$restProps} isLoading={$store.loading}>
|
|
58
58
|
<Icon data={LibIcon_Add} />
|
|
59
59
|
<p>{textCreate}</p>
|
|
60
60
|
</Button>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { SvelteComponent } from 'svelte';
|
|
1
|
+
import type { Component, SvelteComponent } from 'svelte';
|
|
2
2
|
import { type Repository } from 'remult';
|
|
3
|
-
import {
|
|
3
|
+
import type { BaseItemLight } from '../../internals/BaseEnum';
|
|
4
|
+
import type { CellsInput } from '../../internals/cellsBuildor';
|
|
5
|
+
import type { StoreItem } from '../../internals/storeItem';
|
|
4
6
|
import type { FF_Repo } from '../../svelte';
|
|
5
7
|
export type DialogClasses = {
|
|
6
8
|
/**
|
|
@@ -18,6 +20,7 @@ export type DialogMetaData<entityType = any> = {
|
|
|
18
20
|
defaults?: Partial<entityType>;
|
|
19
21
|
classes?: DialogClasses;
|
|
20
22
|
component?: new (...args: any[]) => SvelteComponent;
|
|
23
|
+
componentS5?: Component;
|
|
21
24
|
props?: any;
|
|
22
25
|
children?: any;
|
|
23
26
|
reThrow?: boolean;
|
package/esm/ui/dialog/dialog.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
2
|
import {} from 'remult';
|
|
3
|
-
import { LibIcon_Add, LibIcon_Delete, LibIcon_Edit, LibIcon_Search
|
|
3
|
+
import { LibIcon_Add, LibIcon_Delete, LibIcon_Edit, LibIcon_Search } from '../LibIcon';
|
|
4
4
|
const createDialogManagement = () => {
|
|
5
5
|
const { subscribe, update } = writable([]);
|
|
6
6
|
// internal...
|
|
@@ -18,7 +18,7 @@ const createDialogManagement = () => {
|
|
|
18
18
|
confirm: (topic, text, icon) => {
|
|
19
19
|
const detail = {
|
|
20
20
|
detail: {
|
|
21
|
-
caption: '
|
|
21
|
+
caption: 'A Confirmer',
|
|
22
22
|
icon: { data: icon },
|
|
23
23
|
},
|
|
24
24
|
children: `
|
package/esm/ui/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ import type { Cell } from '../internals';
|
|
|
3
3
|
export type Align = 'text-left' | 'text-center' | 'text-right';
|
|
4
4
|
export declare const align: (f?: FieldMetadata, isSlot?: boolean) => Align;
|
|
5
5
|
export declare const getAligns: (cells: Cell<any>[], withAction: boolean) => Align[];
|
|
6
|
+
export declare const baseTable = "overflow-x-auto rounded-box bg-base-300/60";
|
package/esm/ui/index.js
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { tw } from '../../utils/tailwind'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
interface Props {
|
|
5
|
+
label?: string
|
|
6
|
+
forId: string
|
|
7
|
+
required?: boolean
|
|
8
|
+
error?: string
|
|
9
|
+
/**
|
|
10
|
+
* example usage for paginate
|
|
11
|
+
* classes={{ label: 'justify-end' }}
|
|
12
|
+
*/
|
|
13
|
+
classes?: { label?: string; slot?: string }
|
|
14
|
+
children?: import('svelte').Snippet
|
|
15
|
+
}
|
|
8
16
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
let {
|
|
18
|
+
label = 'label',
|
|
19
|
+
forId,
|
|
20
|
+
required = false,
|
|
21
|
+
error = '',
|
|
22
|
+
classes = {},
|
|
23
|
+
children,
|
|
24
|
+
}: Props = $props()
|
|
14
25
|
</script>
|
|
15
26
|
|
|
16
|
-
<
|
|
17
|
-
<label for={forId} class={tw(`label flex gap-1 px-2
|
|
27
|
+
<fieldset class="fieldset w-full">
|
|
28
|
+
<label for={forId} class={tw(`label flex gap-1 px-2 justify-between`, classes.label)}>
|
|
18
29
|
<span class="label-text pl-2 text-xs text-base-content/60">
|
|
19
30
|
{label}{required ? ' *' : ''}
|
|
20
31
|
</span>
|
|
@@ -22,7 +33,7 @@
|
|
|
22
33
|
<span class="label-text-alt truncate text-error">{error}</span>
|
|
23
34
|
{/if}
|
|
24
35
|
</label>
|
|
25
|
-
<div class={tw('grid h-12 w-full', classes.slot)}>
|
|
26
|
-
|
|
36
|
+
<div class={tw('grid h-12 w-full text-base', classes.slot)}>
|
|
37
|
+
{@render children?.()}
|
|
27
38
|
</div>
|
|
28
|
-
</
|
|
39
|
+
</fieldset>
|
|
@@ -1,39 +1,18 @@
|
|
|
1
|
-
interface
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const FieldContainer: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
1
|
+
interface Props {
|
|
20
2
|
label?: string;
|
|
21
3
|
forId: string;
|
|
22
4
|
required?: boolean;
|
|
23
5
|
error?: string;
|
|
24
6
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
7
|
+
* example usage for paginate
|
|
8
|
+
* classes={{ label: 'justify-end' }}
|
|
9
|
+
*/
|
|
10
|
+
classes?: {
|
|
28
11
|
label?: string;
|
|
29
12
|
slot?: string;
|
|
30
13
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
}, {
|
|
36
|
-
default: {};
|
|
37
|
-
}, {}, string>;
|
|
38
|
-
type FieldContainer = InstanceType<typeof FieldContainer>;
|
|
14
|
+
children?: import('svelte').Snippet;
|
|
15
|
+
}
|
|
16
|
+
declare const FieldContainer: import("svelte").Component<Props, {}, "">;
|
|
17
|
+
type FieldContainer = ReturnType<typeof FieldContainer>;
|
|
39
18
|
export default FieldContainer;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createEventDispatcher, onMount } from 'svelte'
|
|
3
3
|
|
|
4
|
-
import { scrollbar } from '../../internals/theme'
|
|
5
|
-
|
|
6
4
|
export let name: string | null = null
|
|
7
5
|
export let id = ''
|
|
8
6
|
export let rows = 4
|
|
@@ -50,10 +48,9 @@
|
|
|
50
48
|
use:focusNow
|
|
51
49
|
{...$$restProps}
|
|
52
50
|
class="shadow-neutral-focus md:rounded-xls
|
|
53
|
-
textarea
|
|
51
|
+
textarea flex h-max min-h-8
|
|
54
52
|
w-full items-center rounded-lg bg-transparent text-xs
|
|
55
|
-
shadow-sm md:text-sm lg:min-h-[2.5rem]
|
|
56
|
-
{scrollbar.thin}"
|
|
53
|
+
shadow-sm md:text-sm lg:min-h-[2.5rem]"
|
|
57
54
|
id={id || name || 'default-textarea-id'}
|
|
58
55
|
{name}
|
|
59
56
|
{placeholder}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
export let loadOptions:
|
|
24
24
|
| ((str: string) => Promise<{ items: BaseItem[]; totalCount: number }>)
|
|
25
25
|
| undefined = undefined
|
|
26
|
-
export let values: string[] | undefined = undefined
|
|
26
|
+
export let values: (string | null)[] | undefined = undefined
|
|
27
27
|
export let clearable = false
|
|
28
28
|
|
|
29
29
|
const dispatch = createEventDispatcher()
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
-
const getDefaultValues = (_selectedValue: string[] | undefined) => {
|
|
45
|
+
const getDefaultValues = (_selectedValue: (string | null)[] | undefined) => {
|
|
46
46
|
if (!items) {
|
|
47
47
|
return []
|
|
48
48
|
}
|
|
@@ -97,14 +97,16 @@
|
|
|
97
97
|
const list = (v ?? []).map((c) => c.value.id)
|
|
98
98
|
|
|
99
99
|
// Create a map to count occurrences of each element
|
|
100
|
-
|
|
100
|
+
// TODO: switch to: Use SvelteMap instead svelte/prefer-svelte-reactivity
|
|
101
|
+
// eslint-disable-next-line
|
|
102
|
+
const countMap: Map<string | null, number> = new Map()
|
|
101
103
|
|
|
102
104
|
list.forEach((item) => {
|
|
103
105
|
countMap.set(item, (countMap.get(item) || 0) + 1)
|
|
104
106
|
})
|
|
105
107
|
|
|
106
108
|
// Filter the list to include only elements that occur exactly once
|
|
107
|
-
const uniqueList: string[] = list.filter((item) => countMap.get(item) === 1)
|
|
109
|
+
const uniqueList: (string | null)[] = list.filter((item) => countMap.get(item) === 1)
|
|
108
110
|
|
|
109
111
|
const newIds = uniqueList.sort().join(',')
|
|
110
112
|
const oldSelectedValues = (values ?? []).sort().join(',')
|
|
@@ -174,7 +176,7 @@
|
|
|
174
176
|
$: calcFilteredItems($touchedInput, $inputValue, values)
|
|
175
177
|
</script>
|
|
176
178
|
|
|
177
|
-
<div class="input
|
|
179
|
+
<div class="input flex min-w-0 items-center">
|
|
178
180
|
<div class="relative">
|
|
179
181
|
{#if iconToDisplayInInput($localSelected)}
|
|
180
182
|
{@const ico = iconToDisplayInInput($localSelected)}
|
|
@@ -186,7 +188,7 @@
|
|
|
186
188
|
<input
|
|
187
189
|
{...$input}
|
|
188
190
|
use:$input.action
|
|
189
|
-
class="-
|
|
191
|
+
class="-mr-5 -ml-8 h-full min-w-0 flex-grow bg-transparent px-10"
|
|
190
192
|
{placeholder}
|
|
191
193
|
/>
|
|
192
194
|
<div class="pointer-events-none relative right-0 flex gap-2">
|
|
@@ -218,9 +220,9 @@
|
|
|
218
220
|
use:$option.action
|
|
219
221
|
class="relative flex cursor-pointer scroll-my-2 items-center rounded-md px-1
|
|
220
222
|
py-2
|
|
223
|
+
data-[disabled]:opacity-50
|
|
221
224
|
data-[highlighted]:bg-primary
|
|
222
|
-
|
|
223
|
-
data-[disabled]:opacity-50"
|
|
225
|
+
data-[highlighted]:text-primary-content"
|
|
224
226
|
>
|
|
225
227
|
{#if isChecked($localSelected, item)}
|
|
226
228
|
<Icon data={LibIcon_Check} class="w-6"></Icon>
|
|
@@ -21,7 +21,7 @@ declare const MultiSelectMelt: $$__sveltets_2_IsomorphicComponent<{
|
|
|
21
21
|
items: BaseItem[];
|
|
22
22
|
totalCount: number;
|
|
23
23
|
}>) | undefined;
|
|
24
|
-
values?: string[] | undefined;
|
|
24
|
+
values?: (string | null)[] | undefined;
|
|
25
25
|
clearable?: boolean;
|
|
26
26
|
}, {
|
|
27
27
|
selected: CustomEvent<any>;
|