firstly 0.0.12 → 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 +8 -0
- package/esm/api/index.d.ts +1 -0
- package/esm/api/index.js +3 -1
- package/esm/auth/server/AuthController.server.d.ts +1 -1
- package/esm/auth/server/AuthController.server.js +19 -19
- package/esm/auth/server/handleGuard.d.ts +16 -0
- package/esm/auth/server/handleGuard.js +67 -0
- package/esm/auth/server/index.d.ts +3 -1
- package/esm/auth/server/index.js +3 -1
- package/esm/auth/server/module.d.ts +102 -83
- package/esm/auth/server/module.js +55 -42
- package/esm/auth/server/providers/github.d.ts +2 -1
- package/esm/auth/server/providers/github.js +1 -1
- 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/bin/cmd.js +119 -48
- package/esm/cellsBuildor.js +1 -1
- package/esm/common.d.ts +5 -0
- package/esm/common.js +8 -0
- package/esm/cron/server/index.js +1 -1
- package/esm/feedback/FeedbackController.js +1 -2
- 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/index.d.ts +2 -5
- package/esm/index.js +2 -8
- package/esm/mail/templates/DefaultMail.svelte +17 -17
- package/esm/storeItem.d.ts +1 -4
- package/esm/storeItem.js +1 -1
- package/esm/storeList.d.ts +1 -4
- package/esm/sveltekit/server/index.d.ts +3 -0
- package/esm/sveltekit/server/index.js +3 -0
- package/esm/ui/Button.svelte +33 -33
- package/esm/ui/Button.svelte.d.ts +2 -2
- package/esm/ui/Clipboardable.svelte +6 -6
- package/esm/ui/Clipboardable.svelte.d.ts +4 -4
- package/esm/ui/Field.svelte +139 -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 -5
- package/esm/ui/Tooltip.svelte +16 -16
- package/esm/ui/dialog/DialogForm.svelte +22 -22
- package/esm/ui/dialog/DialogManagement.svelte +74 -74
- package/esm/ui/dialog/DialogPrimitive.svelte +50 -50
- package/esm/ui/dialog/FormEditAction.svelte +34 -34
- package/esm/ui/dialog/dialog.d.ts +1 -4
- package/esm/ui/internals/FieldContainer.svelte +11 -11
- 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/package.json +14 -18
- package/esm/auth/static/assets/Page-Bb8bFlrP.d.ts +0 -4
- package/esm/auth/static/assets/Page-Bb8bFlrP.js +0 -1
- package/esm/auth/static/assets/Page-BxomFlZ8.d.ts +0 -4
- package/esm/auth/static/assets/Page-BxomFlZ8.js +0 -1
- package/esm/auth/static/assets/Page-CaIYu0-y.d.ts +0 -6
- package/esm/auth/static/assets/Page-CaIYu0-y.js +0 -19
- package/esm/auth/static/assets/Page-MkYglNtu.css +0 -1
- package/esm/auth/static/assets/index-Bl0Bk5u0.d.ts +0 -64
- package/esm/auth/static/assets/index-Bl0Bk5u0.js +0 -2
- package/esm/auth/static/assets/index-R27C_TlP.css +0 -4
package/esm/ui/Field.svelte
CHANGED
|
@@ -137,154 +137,144 @@ const calcSuffix = (value2) => {
|
|
|
137
137
|
</script>
|
|
138
138
|
|
|
139
139
|
<FieldContainer
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
forId={cell.field?.key ?? ''}
|
|
141
|
+
label={cell?.header ?? cell.field?.caption ?? cell.field?.key}
|
|
142
|
+
required={!cell.field?.allowNull && mode === 'edit' && metaType.subKind !== 'checkbox'}
|
|
143
|
+
{error}
|
|
144
|
+
classes={{ slot: metaType.subKind === 'textarea' ? 'h-24 items-start' : '' }}
|
|
145
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
|
-
|
|
192
|
-
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
// @ts-ignore
|
|
281
|
-
value = fromInput(cell.field, e.detail.value)
|
|
282
|
-
}}
|
|
283
|
-
/>
|
|
284
|
-
{:else}
|
|
285
|
-
<!-- This shoud NEVER be displayed -->
|
|
286
|
-
<span class="text-error flex items-center pl-2"
|
|
287
|
-
>Type "{cell.field?.inputType}" not managed!</span
|
|
288
|
-
>
|
|
289
|
-
{/if}
|
|
146
|
+
{@const clearableComputed =
|
|
147
|
+
cell.clearable || clearable || (mode === 'filtre' && clearable === undefined)}
|
|
148
|
+
{#if isViewMode(mode, cell.field)}
|
|
149
|
+
<span class="input-bordered flex items-center pl-2 pr-4">
|
|
150
|
+
{#if cell.field?.inputType === 'checkbox'}
|
|
151
|
+
<input type="checkbox" {...common(cell.field)} class="checkbox ml-2" disabled checked={value} />
|
|
152
|
+
{:else if metaType.kind === 'relation'}
|
|
153
|
+
{@const item = getEntityDisplayValue(metaType.repoTarget, value)}
|
|
154
|
+
<div class={tw('flex items-center gap-4', 'h-12', 'pl-2')}>
|
|
155
|
+
<LinkPlus {item}></LinkPlus>
|
|
156
|
+
</div>
|
|
157
|
+
{:else if metaType.kind === 'enum'}
|
|
158
|
+
{@const v = displayWithDefaultAndSuffix(cell.field, value)}
|
|
159
|
+
<div class="ml-2 flex h-12 items-center gap-4">
|
|
160
|
+
{#if value?.icon}
|
|
161
|
+
<Icon {...value.icon} />
|
|
162
|
+
{/if}
|
|
163
|
+
<Clipboardable value={v}>{v}</Clipboardable>
|
|
164
|
+
</div>
|
|
165
|
+
{:else}
|
|
166
|
+
{@const v = displayWithDefaultAndSuffix(cell.field, value)}
|
|
167
|
+
<div
|
|
168
|
+
class="ml-2 flex h-12 w-full items-center {metaType.subKind === 'number' ? 'justify-end' : ''}"
|
|
169
|
+
>
|
|
170
|
+
<Clipboardable value={v}>{v}</Clipboardable>
|
|
171
|
+
</div>
|
|
172
|
+
{/if}
|
|
173
|
+
</span>
|
|
174
|
+
{:else if metaType.kind === 'relation'}
|
|
175
|
+
{#if metaType.field.options.multiSelect}
|
|
176
|
+
<MultiSelectMelt
|
|
177
|
+
{...common(cell.field, true)}
|
|
178
|
+
clearable={clearableComputed}
|
|
179
|
+
loadOptions={async (str) => await getLoadOptions(cellsValues, str)}
|
|
180
|
+
values={value}
|
|
181
|
+
on:selected={(e) => dispatchSelected(e.detail)}
|
|
182
|
+
/>
|
|
183
|
+
{:else}
|
|
184
|
+
<!-- {items} -->
|
|
185
|
+
<SelectMelt
|
|
186
|
+
{focus}
|
|
187
|
+
{...common(cell.field, true)}
|
|
188
|
+
clearable={clearableComputed}
|
|
189
|
+
loadOptions={async (str) => await getLoadOptions(cellsValues, str)}
|
|
190
|
+
value={value?.id || value}
|
|
191
|
+
on:selected={(e) => dispatchSelected(e.detail)}
|
|
192
|
+
on:issue={(e) => {
|
|
193
|
+
error = e.detail
|
|
194
|
+
}}
|
|
195
|
+
createOptionWhenNoResult={!!cell.field?.options.createOptionWhenNoResult}
|
|
196
|
+
on:createRequest
|
|
197
|
+
/>
|
|
198
|
+
{/if}
|
|
199
|
+
{:else if metaType.kind === 'enum'}
|
|
200
|
+
{#if metaType.field.options.multiSelect || metaType.subKind === 'multi'}
|
|
201
|
+
<MultiSelectMelt
|
|
202
|
+
{...common(cell.field, true)}
|
|
203
|
+
clearable={clearableComputed}
|
|
204
|
+
items={metaType.values}
|
|
205
|
+
values={getMultiValues(value)}
|
|
206
|
+
on:selected={(e) => {
|
|
207
|
+
dispatchSelected(e.detail)
|
|
208
|
+
}}
|
|
209
|
+
/>
|
|
210
|
+
{:else if metaType.values.length <= (cell.field?.options.styleRadioUntil ?? 3) && !clearableComputed}
|
|
211
|
+
<SelectRadio
|
|
212
|
+
{...common(cell.field, true)}
|
|
213
|
+
items={metaType.values}
|
|
214
|
+
value={value?.id || value}
|
|
215
|
+
on:selected={(e) => dispatchSelected(e.detail)}
|
|
216
|
+
/>
|
|
217
|
+
{:else}
|
|
218
|
+
<SelectMelt
|
|
219
|
+
{focus}
|
|
220
|
+
{...common(cell.field, true)}
|
|
221
|
+
clearable={clearableComputed}
|
|
222
|
+
items={metaType.values}
|
|
223
|
+
value={value?.id || value}
|
|
224
|
+
on:selected={(e) => dispatchSelected(e.detail)}
|
|
225
|
+
on:issue={(e) => {
|
|
226
|
+
error = e.detail
|
|
227
|
+
}}
|
|
228
|
+
/>
|
|
229
|
+
{/if}
|
|
230
|
+
{:else if metaType.subKind === 'checkbox'}
|
|
231
|
+
<div class="grid content-center items-center pl-4">
|
|
232
|
+
<input
|
|
233
|
+
type="checkbox"
|
|
234
|
+
{...{ ...common(cell.field), required: undefined }}
|
|
235
|
+
class="checkbox"
|
|
236
|
+
checked={value}
|
|
237
|
+
on:input={(e) => {
|
|
238
|
+
// @ts-ignore
|
|
239
|
+
value = e.target.checked
|
|
240
|
+
dispatchSelected(value)
|
|
241
|
+
}}
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
244
|
+
{:else if metaType.subKind === 'text' || metaType.subKind === 'email' || metaType.subKind === 'password' || metaType.subKind === 'dateOnly' || metaType.subKind === 'number'}
|
|
245
|
+
<div class="input input-bordered inline-flex w-full items-center pl-2">
|
|
246
|
+
<Input
|
|
247
|
+
{focus}
|
|
248
|
+
{...common(cell.field)}
|
|
249
|
+
autocomplete="off"
|
|
250
|
+
class={tw(
|
|
251
|
+
`join-item placeholder:text-base-content/30 w-full bg-transparent`,
|
|
252
|
+
metaType.subKind === 'number' && 'text-end',
|
|
253
|
+
)}
|
|
254
|
+
type={metaType.subKind.replaceAll('dateOnly', 'date')}
|
|
255
|
+
value={toInput(cell.field, value)}
|
|
256
|
+
{withDedounce}
|
|
257
|
+
on:input={(e) => {
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
value = fromInput(cell.field, e.detail.value)
|
|
260
|
+
dispatchSelected(value)
|
|
261
|
+
}}
|
|
262
|
+
{...$$restProps}
|
|
263
|
+
/>
|
|
264
|
+
{calcSuffix(value)}
|
|
265
|
+
</div>
|
|
266
|
+
{:else if metaType.subKind === 'textarea'}
|
|
267
|
+
<Textarea
|
|
268
|
+
{focus}
|
|
269
|
+
{...common(cell.field)}
|
|
270
|
+
value={toInput(cell.field, value)}
|
|
271
|
+
on:input={(e) => {
|
|
272
|
+
// @ts-ignore
|
|
273
|
+
value = fromInput(cell.field, e.detail.value)
|
|
274
|
+
}}
|
|
275
|
+
/>
|
|
276
|
+
{:else}
|
|
277
|
+
<!-- This shoud NEVER be displayed -->
|
|
278
|
+
<span class="text-error flex items-center pl-2">Type "{cell.field?.inputType}" not managed!</span>
|
|
279
|
+
{/if}
|
|
290
280
|
</FieldContainer>
|
package/esm/ui/Field.svelte.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ declare class __sveltets_Render<T extends Record<any, any>> {
|
|
|
9
9
|
cellsValues?: any;
|
|
10
10
|
withDedounce?: boolean | undefined;
|
|
11
11
|
error?: string | undefined;
|
|
12
|
-
mode?:
|
|
12
|
+
mode?: "edit" | "view" | "filtre" | undefined;
|
|
13
13
|
focus?: boolean | undefined;
|
|
14
|
-
clearable?: boolean | undefined;
|
|
14
|
+
clearable?: boolean | undefined | undefined;
|
|
15
15
|
disabled?: boolean | undefined;
|
|
16
16
|
};
|
|
17
17
|
events(): {
|
package/esm/ui/FieldGroup.svelte
CHANGED
|
@@ -54,42 +54,42 @@ function isToFocus(currentKey, focusKey2, i) {
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
{#each cells as cell, i}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
57
|
+
{@const focus = isToFocus(cell.field?.key, focusKey, i)}
|
|
58
|
+
{#if shouldHide(cell, mode)}
|
|
59
|
+
<!-- Do nothing -->
|
|
60
|
+
{:else if cell.field && !cell.field.includedInApi($store.item)}
|
|
61
|
+
<!-- Do nothing, but keep the class... -->
|
|
62
|
+
<div class={cell.class}></div>
|
|
63
|
+
{:else}
|
|
64
|
+
<div class={cell.class}>
|
|
65
|
+
{#if cell.kind === 'header'}
|
|
66
|
+
<span>{cell.header}</span>
|
|
67
|
+
{:else if cell.field && (!$store || $store.loading)}
|
|
68
|
+
<!-- If the store is not ready mdiYeast, or in loading... -->
|
|
69
|
+
<FieldContainer label={cell.field.caption} forId={cell.field.key}>
|
|
70
|
+
<Loading
|
|
71
|
+
class={tw(
|
|
72
|
+
`mx-4 my-3 h-6`,
|
|
73
|
+
size[parseInt((((i + 1) * Math.random() * size.length) % size.length).toString())],
|
|
74
|
+
)}
|
|
75
|
+
/>
|
|
76
|
+
</FieldContainer>
|
|
77
|
+
{:else if cell.kind === 'slot'}
|
|
78
|
+
<slot name="field" field={cell.field} {focus} />
|
|
79
|
+
{:else if cell.field && $store.item}
|
|
80
|
+
<Field
|
|
81
|
+
mode={modeToUse(cell, mode)}
|
|
82
|
+
{cell}
|
|
83
|
+
cellsValues={$store.item}
|
|
84
|
+
bind:value={$store.item[cell.field.key]}
|
|
85
|
+
error={getError($store.errors, cell.field)}
|
|
86
|
+
{focus}
|
|
87
|
+
on:createRequest
|
|
88
|
+
/>
|
|
89
|
+
<!-- disabled={isDisableFieldDynamic(cell)} -->
|
|
90
|
+
{:else}
|
|
91
|
+
FieldGroup : Case not handled
|
|
92
|
+
{/if}
|
|
93
|
+
</div>
|
|
94
|
+
{/if}
|
|
95
95
|
{/each}
|