firstly 0.0.12 → 0.0.14
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/ROUTES.d.ts +2 -0
- package/esm/ROUTES.js +1 -0
- package/esm/api/index.d.ts +9 -0
- package/esm/api/index.js +3 -1
- package/esm/auth/AuthController.d.ts +12 -23
- package/esm/auth/AuthController.js +12 -31
- package/esm/auth/server/AuthController.server.d.ts +11 -11
- package/esm/auth/server/AuthController.server.js +99 -34
- package/esm/auth/server/handleGuard.d.ts +16 -0
- package/esm/auth/server/handleGuard.js +67 -0
- package/esm/auth/server/helperFirstly.d.ts +1 -1
- package/esm/auth/server/helperFirstly.js +1 -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 +105 -89
- package/esm/auth/server/module.js +55 -42
- package/esm/auth/server/providers/github.d.ts +4 -2
- package/esm/auth/server/providers/github.js +2 -2
- package/esm/auth/static/assets/Page-B0XXxe0N.d.ts +6 -0
- package/esm/auth/static/assets/Page-B0XXxe0N.js +1 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.d.ts +6 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.js +20 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.d.ts +6 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.js +1 -0
- package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
- package/esm/auth/static/assets/index-C9jzxOBu.d.ts +151 -0
- package/esm/auth/static/assets/index-C9jzxOBu.js +42 -0
- package/esm/auth/static/assets/index-DKWpA6v7.css +4 -0
- package/esm/auth/static/index.html +11 -11
- package/esm/auth/types.d.ts +26 -3
- package/esm/bin/cmd.js +423 -152
- 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 +58 -53
- package/esm/feedback/server/index.d.ts +6 -15
- package/esm/feedback/server/index.js +4 -5
- package/esm/feedback/types.d.ts +14 -0
- package/esm/feedback/types.js +4 -0
- package/esm/feedback/ui/DialogIssue.svelte +131 -119
- package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogIssues.svelte +108 -99
- package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogMilestones.svelte +40 -34
- package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
- package/esm/feedback/ui/Feedback.svelte +11 -9
- package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
- package/esm/index.d.ts +2 -5
- package/esm/index.js +2 -8
- package/esm/mail/server/index.d.ts +9 -2
- package/esm/mail/server/index.js +3 -1
- package/esm/mail/templates/DefaultMail.svelte +81 -61
- package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
- package/esm/server/index.d.ts +0 -0
- package/esm/server/index.js +1 -0
- 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 -9
- package/esm/sveltekit/server/index.js +3 -0
- package/esm/ui/Button.svelte +112 -89
- package/esm/ui/Button.svelte.d.ts +34 -24
- package/esm/ui/Clipboardable.svelte +24 -17
- package/esm/ui/Clipboardable.svelte.d.ts +34 -23
- package/esm/ui/Field.svelte +328 -285
- package/esm/ui/Field.svelte.d.ts +15 -8
- package/esm/ui/FieldGroup.svelte +112 -91
- package/esm/ui/FieldGroup.svelte.d.ts +17 -6
- package/esm/ui/Grid.svelte +322 -308
- package/esm/ui/Grid.svelte.d.ts +17 -6
- package/esm/ui/GridLoading.svelte +28 -27
- package/esm/ui/GridLoading.svelte.d.ts +19 -17
- package/esm/ui/GridPaginate.svelte +68 -61
- package/esm/ui/GridPaginate.svelte.d.ts +21 -19
- package/esm/ui/Icon.svelte +116 -80
- package/esm/ui/Icon.svelte.d.ts +52 -43
- package/esm/ui/Loading.svelte +10 -8
- package/esm/ui/Loading.svelte.d.ts +29 -18
- package/esm/ui/Tooltip.svelte +38 -35
- package/esm/ui/Tooltip.svelte.d.ts +30 -20
- package/esm/ui/dialog/DialogForm.svelte +70 -63
- package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
- package/esm/ui/dialog/DialogManagement.svelte +74 -74
- package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
- package/esm/ui/dialog/DialogPrimitive.svelte +82 -76
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
- package/esm/ui/dialog/FormEditAction.svelte +58 -50
- package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
- package/esm/ui/dialog/dialog.d.ts +1 -4
- package/esm/ui/internals/FieldContainer.svelte +24 -17
- package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
- package/esm/ui/internals/Input.svelte +136 -102
- package/esm/ui/internals/Input.svelte.d.ts +34 -32
- package/esm/ui/internals/Textarea.svelte +60 -52
- package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
- package/esm/ui/internals/select/MultiSelectMelt.svelte +243 -199
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
- package/esm/ui/internals/select/SelectMelt.svelte +254 -219
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
- package/esm/ui/internals/select/SelectRadio.svelte +39 -33
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
- package/esm/ui/link/Link.svelte +25 -20
- package/esm/ui/link/Link.svelte.d.ts +31 -23
- package/esm/ui/link/LinkPlus.svelte +52 -51
- package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
- package/esm/vite/index.d.ts +2 -3
- package/esm/vite/index.js +33 -26
- package/package.json +16 -20
- 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
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
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;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {
|
|
10
|
-
default: {};
|
|
11
|
-
};
|
|
12
|
-
exports?: {} | undefined;
|
|
13
|
-
bindings?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type LoadingProps = typeof __propDef.props;
|
|
16
|
-
export type LoadingEvents = typeof __propDef.events;
|
|
17
|
-
export type LoadingSlots = typeof __propDef.slots;
|
|
18
|
-
export default class Loading extends SvelteComponent<LoadingProps, LoadingEvents, LoadingSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
19
13
|
}
|
|
20
|
-
|
|
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 Loading: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
class?: string;
|
|
21
|
+
}, {
|
|
22
|
+
default: {};
|
|
23
|
+
}>, {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
}, {
|
|
28
|
+
class: string;
|
|
29
|
+
}, string>;
|
|
30
|
+
type Loading = InstanceType<typeof Loading>;
|
|
31
|
+
export default Loading;
|
package/esm/ui/Tooltip.svelte
CHANGED
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createTooltip } from '@melt-ui/svelte'
|
|
3
|
+
import { fade } from 'svelte/transition'
|
|
4
|
+
|
|
5
|
+
export let text = ''
|
|
6
|
+
export let hideTooltip = false
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
elements: { trigger, content, arrow },
|
|
10
|
+
states: { open },
|
|
11
|
+
} = createTooltip({
|
|
12
|
+
positioning: {
|
|
13
|
+
placement: 'top',
|
|
14
|
+
},
|
|
15
|
+
openDelay: 0,
|
|
16
|
+
closeDelay: 0,
|
|
17
|
+
closeOnPointerDown: false,
|
|
18
|
+
forceVisible: true,
|
|
19
|
+
escapeBehavior: 'close',
|
|
20
|
+
group: true,
|
|
21
|
+
// disableHoverableContent: true,
|
|
22
|
+
})
|
|
20
23
|
</script>
|
|
21
24
|
|
|
22
25
|
<button type="button" class="trigger" {...$trigger} use:trigger aria-label="Add">
|
|
23
|
-
|
|
26
|
+
<slot />
|
|
24
27
|
</button>
|
|
25
28
|
<!-- {hideTooltip} -->
|
|
26
29
|
{#if $open && !hideTooltip && (text || $$slots.tooltip)}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
<div
|
|
31
|
+
{...$content}
|
|
32
|
+
use:content
|
|
33
|
+
transition:fade={{ duration: 100 }}
|
|
34
|
+
class="bg-base-300 z-30 rounded-lg ring-1 ring-black"
|
|
35
|
+
>
|
|
36
|
+
<div {...$arrow} use:arrow></div>
|
|
37
|
+
<div class="px-4 py-1">
|
|
38
|
+
{#if $$slots.tooltip}
|
|
39
|
+
<slot name="tooltip" />
|
|
40
|
+
{:else}
|
|
41
|
+
{@html text}
|
|
42
|
+
{/if}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
42
45
|
{/if}
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
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;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
tooltip: {};
|
|
13
|
-
};
|
|
14
|
-
exports?: {} | undefined;
|
|
15
|
-
bindings?: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
export type TooltipProps = typeof __propDef.props;
|
|
18
|
-
export type TooltipEvents = typeof __propDef.events;
|
|
19
|
-
export type TooltipSlots = typeof __propDef.slots;
|
|
20
|
-
export default class Tooltip extends SvelteComponent<TooltipProps, TooltipEvents, TooltipSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
21
13
|
}
|
|
22
|
-
|
|
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 Tooltip: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
text?: string;
|
|
21
|
+
hideTooltip?: boolean;
|
|
22
|
+
}, {
|
|
23
|
+
default: {};
|
|
24
|
+
tooltip: {};
|
|
25
|
+
}>, {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {
|
|
28
|
+
default: {};
|
|
29
|
+
tooltip: {};
|
|
30
|
+
}, {}, string>;
|
|
31
|
+
type Tooltip = InstanceType<typeof Tooltip>;
|
|
32
|
+
export default Tooltip;
|
|
@@ -1,69 +1,76 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { FieldGroup, storeItem } from '../..'
|
|
3
|
+
import { cellsBuildor } from '../../cellsBuildor'
|
|
4
|
+
import { dialog, type DialogMetaDataInternal } from './dialog'
|
|
5
|
+
import DialogPrimitive from './DialogPrimitive.svelte'
|
|
6
|
+
import FormEditAction from './FormEditAction.svelte'
|
|
7
|
+
|
|
8
|
+
export let toShow: DialogMetaDataInternal
|
|
9
|
+
|
|
10
|
+
$: cells = cellsBuildor(toShow.repo!, toShow.cells!)
|
|
11
|
+
$: store = toShow.store ?? storeItem(toShow.repo!)
|
|
12
|
+
|
|
13
|
+
$: {
|
|
14
|
+
if (toShow.type === 'update' || toShow.type === 'view') {
|
|
15
|
+
store.set({ item: toShow.defaults, errors: {}, loading: false, globalError: undefined })
|
|
16
|
+
} else {
|
|
17
|
+
store.create(toShow.defaults ?? {})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const onCreate = (e: CustomEvent) => {
|
|
22
|
+
dialog.close(toShow.id, { success: true, item: e.detail })
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let isLoading = false
|
|
26
|
+
const onInsert = async () => {
|
|
27
|
+
isLoading = true
|
|
28
|
+
try {
|
|
29
|
+
const result = await store.save()
|
|
30
|
+
if (result) {
|
|
31
|
+
dialog.close(toShow.id, { success: true, item: result })
|
|
32
|
+
}
|
|
33
|
+
} catch (e) {
|
|
34
|
+
if (toShow.reThrow) {
|
|
35
|
+
throw e
|
|
36
|
+
}
|
|
37
|
+
} finally {
|
|
38
|
+
isLoading = false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const onDelete = async () => {
|
|
43
|
+
const res = await dialog.confirmDelete('')
|
|
44
|
+
if (res.success) {
|
|
45
|
+
await store.delete()
|
|
46
|
+
dialog.close(toShow.id, { success: true, item: $store.item })
|
|
47
|
+
}
|
|
48
|
+
}
|
|
42
49
|
</script>
|
|
43
50
|
|
|
44
51
|
<DialogPrimitive
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
detail={toShow.detail}
|
|
53
|
+
open
|
|
54
|
+
classes={{ root: toShow.classes?.root }}
|
|
55
|
+
on:change={() => dialog.close(toShow.id, { success: false })}
|
|
49
56
|
>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
<form on:submit|preventDefault={onInsert}>
|
|
58
|
+
<div class="grid {toShow.classes?.formGrid ?? ''} gap-4 pb-4">
|
|
59
|
+
<FieldGroup
|
|
60
|
+
focusKey={toShow.focusKey}
|
|
61
|
+
{cells}
|
|
62
|
+
{store}
|
|
63
|
+
mode={toShow.type === 'view' ? 'view' : 'edit'}
|
|
64
|
+
on:createRequest={onCreate}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
60
67
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
<FormEditAction
|
|
69
|
+
type={toShow.type}
|
|
70
|
+
wDelete={toShow.wDelete}
|
|
71
|
+
{store}
|
|
72
|
+
on:delete={onDelete}
|
|
73
|
+
textCreate={toShow.topicPrefixText}
|
|
74
|
+
></FormEditAction>
|
|
75
|
+
</form>
|
|
69
76
|
</DialogPrimitive>
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type DialogMetaDataInternal } from './dialog';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
6
12
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
exports?: {} | undefined;
|
|
12
|
-
bindings?: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
export type DialogFormProps = typeof __propDef.props;
|
|
15
|
-
export type DialogFormEvents = typeof __propDef.events;
|
|
16
|
-
export type DialogFormSlots = typeof __propDef.slots;
|
|
17
|
-
export default class DialogForm extends SvelteComponent<DialogFormProps, DialogFormEvents, DialogFormSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
18
14
|
}
|
|
19
|
-
|
|
15
|
+
declare const DialogForm: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
toShow: DialogMetaDataInternal;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type DialogForm = InstanceType<typeof DialogForm>;
|
|
21
|
+
export default DialogForm;
|
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import Button from '../Button.svelte'
|
|
3
|
+
import { dialog } from './dialog'
|
|
4
|
+
import DialogForm from './DialogForm.svelte'
|
|
5
|
+
import DialogPrimitive from './DialogPrimitive.svelte'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
$: dialogSorted = $dialog.sort((a, b) => a.id - b.id)
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
{#each dialogSorted as toShow}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
11
|
+
{#if toShow.type === 'confirm'}
|
|
12
|
+
<DialogPrimitive
|
|
13
|
+
detail={toShow.detail}
|
|
14
|
+
open
|
|
15
|
+
on:change={() => dialog.close(toShow.id, { success: false })}
|
|
16
|
+
>
|
|
17
|
+
{@html toShow.children}
|
|
18
|
+
<svelte:fragment slot="actions">
|
|
19
|
+
<Button class="text-white" on:click={() => dialog.close(toShow.id, { success: true })}
|
|
20
|
+
>Confirmer</Button
|
|
21
|
+
>
|
|
22
|
+
</svelte:fragment>
|
|
23
|
+
</DialogPrimitive>
|
|
24
|
+
{:else if toShow.type === 'confirmDelete'}
|
|
25
|
+
<DialogPrimitive
|
|
26
|
+
detail={toShow.detail}
|
|
27
|
+
open
|
|
28
|
+
on:change={() => dialog.close(toShow.id, { success: false })}
|
|
29
|
+
>
|
|
30
|
+
{@html toShow.children}
|
|
31
|
+
<svelte:fragment slot="actions">
|
|
32
|
+
<Button
|
|
33
|
+
class="btn-outline btn-error"
|
|
34
|
+
on:click={() => dialog.close(toShow.id, { success: true })}
|
|
35
|
+
>
|
|
36
|
+
Confirmer
|
|
37
|
+
</Button>
|
|
38
|
+
</svelte:fragment>
|
|
39
|
+
</DialogPrimitive>
|
|
40
|
+
{:else if toShow.type === 'insert' || toShow.type === 'update' || toShow.type === 'view'}
|
|
41
|
+
<DialogForm {toShow}></DialogForm>
|
|
42
|
+
{:else if toShow.component && toShow.children}
|
|
43
|
+
<DialogPrimitive
|
|
44
|
+
detail={toShow.detail}
|
|
45
|
+
open
|
|
46
|
+
on:change={() => dialog.close(toShow.id, { success: false })}
|
|
47
|
+
>
|
|
48
|
+
<svelte:component this={toShow.component} {...toShow.props} dialogId={toShow.id}>
|
|
49
|
+
{#if toShow.children}
|
|
50
|
+
{@html toShow.children}
|
|
51
|
+
{/if}
|
|
52
|
+
</svelte:component>
|
|
53
|
+
</DialogPrimitive>
|
|
54
|
+
{:else if toShow.component}
|
|
55
|
+
<DialogPrimitive
|
|
56
|
+
detail={toShow.detail}
|
|
57
|
+
open
|
|
58
|
+
classes={{ root: toShow.classes?.root }}
|
|
59
|
+
on:change={() => dialog.close(toShow.id, { success: false })}
|
|
60
|
+
>
|
|
61
|
+
<svelte:component this={toShow.component} {...toShow.props} dialogId={toShow.id}
|
|
62
|
+
></svelte:component>
|
|
63
|
+
</DialogPrimitive>
|
|
64
|
+
{:else}
|
|
65
|
+
<DialogPrimitive
|
|
66
|
+
detail={toShow.detail}
|
|
67
|
+
open
|
|
68
|
+
on:change={() => dialog.close(toShow.id, { success: false })}
|
|
69
|
+
>
|
|
70
|
+
<div class="grid gap-2">
|
|
71
|
+
<p>Hey 🫵 developer, you are missing a few things 🤡!</p>
|
|
72
|
+
<p>Or use use one of the custom built in dialog like</p>
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
<pre class="bg-base-300 mt-2 p-2 text-xs">await dialog.confirmDelete('The Car')</pre>
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
<p>Or pass you own component</p>
|
|
77
|
+
<pre class="bg-base-300 mt-2 p-2 text-xs">{`await dialog.show({
|
|
78
78
|
detail: { caption: 'Interlocuteur' },
|
|
79
79
|
component: CreateCarForm,
|
|
80
80
|
props: { isEdit: false },
|
|
81
81
|
})`}</pre>
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
<p>Good luck 🚀</p>
|
|
84
|
+
</div>
|
|
85
|
+
</DialogPrimitive>
|
|
86
|
+
{/if}
|
|
87
87
|
{/each}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/** @typedef {typeof __propDef.slots} DialogManagementSlots */
|
|
4
|
-
export default class DialogManagement extends SvelteComponent<{
|
|
1
|
+
export default DialogManagement;
|
|
2
|
+
type DialogManagement = SvelteComponent<{
|
|
5
3
|
[x: string]: never;
|
|
6
4
|
}, {
|
|
7
5
|
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
|
|
10
|
-
export type DialogManagementProps = typeof __propDef.props;
|
|
11
|
-
export type DialogManagementEvents = typeof __propDef.events;
|
|
12
|
-
export type DialogManagementSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponent } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: never;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
exports?: undefined;
|
|
23
|
-
bindings?: undefined;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
24
8
|
};
|
|
25
|
-
|
|
9
|
+
declare const DialogManagement: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|