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,66 +1,86 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export let
|
|
5
|
-
export let
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Button, Container, Head, Heading, Html, Preview, Section, Text } from 'svelty-email'
|
|
3
|
+
|
|
4
|
+
export let previewText: string | undefined
|
|
5
|
+
export let title: string | undefined
|
|
6
|
+
export let sections: {
|
|
7
|
+
text: string
|
|
8
|
+
highlighted?: boolean
|
|
9
|
+
cta?: { text: string; link: string } | undefined
|
|
10
|
+
}[] = []
|
|
11
|
+
export let brandColor = '#5B68DF'
|
|
12
|
+
|
|
13
|
+
const fontFamily =
|
|
14
|
+
'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif'
|
|
15
|
+
|
|
16
|
+
const main = {
|
|
17
|
+
backgroundColor: '#ffffff',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const container = {
|
|
21
|
+
margin: '0 auto',
|
|
22
|
+
padding: '20px 0 48px',
|
|
23
|
+
width: '580px',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// const userImage = {
|
|
27
|
+
// margin: '0 auto',
|
|
28
|
+
// marginBottom: '16px',
|
|
29
|
+
// borderRadius: '50%',
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
const heading = {
|
|
33
|
+
fontFamily,
|
|
34
|
+
fontSize: '32px',
|
|
35
|
+
lineHeight: '1.3',
|
|
36
|
+
fontWeight: '700',
|
|
37
|
+
color: '#484848',
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const paragraph = {
|
|
41
|
+
fontFamily,
|
|
42
|
+
fontSize: '18px',
|
|
43
|
+
lineHeight: '1.4',
|
|
44
|
+
color: '#484848',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const highlighted = {
|
|
48
|
+
...paragraph,
|
|
49
|
+
padding: '24px',
|
|
50
|
+
backgroundColor: '#f2f3f3',
|
|
51
|
+
borderRadius: '4px',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const button = {
|
|
55
|
+
fontFamily,
|
|
56
|
+
backgroundColor: brandColor,
|
|
57
|
+
borderRadius: '5px',
|
|
58
|
+
color: '#fff',
|
|
59
|
+
fontSize: '18px',
|
|
60
|
+
textDecoration: 'none',
|
|
61
|
+
textAlign: 'center' as const,
|
|
62
|
+
display: 'block',
|
|
63
|
+
width: '100%',
|
|
64
|
+
}
|
|
45
65
|
</script>
|
|
46
66
|
|
|
47
67
|
<Html>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
<Head />
|
|
69
|
+
<Preview preview={previewText ?? title + '...'} />
|
|
70
|
+
<Section style={main}>
|
|
71
|
+
<Container style={container}>
|
|
72
|
+
{#if title}
|
|
73
|
+
<Heading style={heading}>{title}</Heading>
|
|
74
|
+
{/if}
|
|
55
75
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
{#each sections as s}
|
|
77
|
+
<Text style={s.highlighted ? highlighted : paragraph}>
|
|
78
|
+
{s.text}
|
|
79
|
+
</Text>
|
|
80
|
+
{#if s.cta}
|
|
81
|
+
<Button pY={19} style={button} href={s.cta.link}>{s.cta.text}</Button>
|
|
82
|
+
{/if}
|
|
83
|
+
{/each}
|
|
84
|
+
</Container>
|
|
85
|
+
</Section>
|
|
66
86
|
</Html>
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
link: string;
|
|
12
|
-
} | undefined;
|
|
13
|
-
}[];
|
|
14
|
-
brandColor?: string;
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
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;
|
|
18
11
|
};
|
|
19
|
-
|
|
20
|
-
exports?: {} | undefined;
|
|
21
|
-
bindings?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
export type DefaultMailProps = typeof __propDef.props;
|
|
24
|
-
export type DefaultMailEvents = typeof __propDef.events;
|
|
25
|
-
export type DefaultMailSlots = typeof __propDef.slots;
|
|
26
|
-
export default class DefaultMail extends SvelteComponent<DefaultMailProps, DefaultMailEvents, DefaultMailSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
27
13
|
}
|
|
28
|
-
|
|
14
|
+
declare const DefaultMail: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
previewText: string | undefined;
|
|
16
|
+
title: string | undefined;
|
|
17
|
+
sections?: {
|
|
18
|
+
text: string;
|
|
19
|
+
highlighted?: boolean;
|
|
20
|
+
cta?: {
|
|
21
|
+
text: string;
|
|
22
|
+
link: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}[];
|
|
25
|
+
brandColor?: string;
|
|
26
|
+
}, {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {}, {}, string>;
|
|
29
|
+
type DefaultMail = InstanceType<typeof DefaultMail>;
|
|
30
|
+
export default DefaultMail;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/esm/storeItem.d.ts
CHANGED
|
@@ -6,10 +6,7 @@ type TheStoreItem<T> = {
|
|
|
6
6
|
globalError?: string | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const storeItem: <T>(repo: Repository<T>, initValues?: TheStoreItem<T>) => {
|
|
9
|
-
subscribe:
|
|
10
|
-
(this: void, run: import("svelte/store").Subscriber<TheStoreItem<T>>, invalidate?: import("svelte/store").Invalidator<TheStoreItem<T>> | undefined): import("svelte/store").Unsubscriber;
|
|
11
|
-
(this: void, run: import("svelte/store").Subscriber<TheStoreItem<T>>, invalidate?: (() => void) | undefined): import("svelte/store").Unsubscriber;
|
|
12
|
-
};
|
|
9
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreItem<T>>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
13
10
|
create: (item: Partial<T>) => void;
|
|
14
11
|
set: (newItem: TheStoreItem<T>) => void;
|
|
15
12
|
/**
|
package/esm/storeItem.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BROWSER } from 'esm-env';
|
|
2
2
|
import { derived, get, writable } from 'svelte/store';
|
|
3
|
-
import { ff_Log } from './';
|
|
3
|
+
import { ff_Log } from './common.js';
|
|
4
4
|
import { isError } from './helper';
|
|
5
5
|
export const storeItem = (repo, initValues = {
|
|
6
6
|
item: undefined,
|
package/esm/storeList.d.ts
CHANGED
|
@@ -25,10 +25,7 @@ export type FF_FindOptions<T> = FindOptions<T> & {
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export declare const storeList: <T>(repo: Repository<T>, initValues?: TheStoreList<T>) => {
|
|
28
|
-
subscribe:
|
|
29
|
-
(this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?: import("svelte/store").Invalidator<TheStoreList<T>> | undefined): import("svelte/store").Unsubscriber;
|
|
30
|
-
(this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?: (() => void) | undefined): import("svelte/store").Unsubscriber;
|
|
31
|
-
};
|
|
28
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
32
29
|
manualSet: (info: TheStoreList<T>) => void;
|
|
33
30
|
fetch: (options?: FF_FindOptions<T>, onNewData?: (items?: T[], totalCount?: number) => void) => Promise<void>;
|
|
34
31
|
listen: (options?: FF_FindOptions<T>) => Promise<void>;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import type { RequestEvent } from '@sveltejs/kit';
|
|
2
1
|
import { Module } from '../../api';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
setHeaders(headers: Record<string, string>): void;
|
|
7
|
-
setCookie(...args: Parameters<RequestEvent['cookies']['set']>): void;
|
|
8
|
-
deleteCookie(...args: Parameters<RequestEvent['cookies']['delete']>): void;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated will be done directly in remult when modules will be in 😉
|
|
4
|
+
*/
|
|
11
5
|
export declare const sveltekit: () => Module;
|
package/esm/ui/Button.svelte
CHANGED
|
@@ -1,100 +1,123 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createTooltip } from '@melt-ui/svelte'
|
|
3
|
+
import type { Action } from 'svelte/action'
|
|
4
|
+
import { fade, fly } from 'svelte/transition'
|
|
5
|
+
|
|
6
|
+
import { remult } from 'remult'
|
|
7
|
+
|
|
8
|
+
import { BaseEnum, tw } from '../'
|
|
9
|
+
|
|
10
|
+
export let isLoading = false
|
|
11
|
+
let className: string | undefined | null = undefined
|
|
12
|
+
export { className as class }
|
|
13
|
+
|
|
14
|
+
export let permission: BaseEnum[] | BaseEnum | undefined = undefined
|
|
15
|
+
|
|
16
|
+
let permissionDisabled = false
|
|
17
|
+
$: disabled = $$restProps.disabled || permissionDisabled || isLoading
|
|
18
|
+
|
|
19
|
+
// let's trigger the annimation if it's more than 200ms
|
|
20
|
+
let triggerAnnimation = false
|
|
21
|
+
$: isLoading &&
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
if (isLoading) {
|
|
24
|
+
// eslint-disable-next-line
|
|
25
|
+
triggerAnnimation = true
|
|
26
|
+
}
|
|
27
|
+
}, 200)
|
|
28
|
+
|
|
29
|
+
let updates = (param: { permission: BaseEnum[] | BaseEnum | undefined }) => {
|
|
30
|
+
if (param && param.permission) {
|
|
31
|
+
permissionDisabled = !remult.isAllowed(
|
|
32
|
+
Array.isArray(param.permission) ? param.permission.map((c) => c.id) : param.permission.id,
|
|
33
|
+
)
|
|
34
|
+
if (permissionDisabled) {
|
|
35
|
+
disabledWhy = `Vous n'avez pas la permission: ${Array.isArray(param.permission) ? param.permission.map((c) => `"${c.caption}"`).join(' ou ') : `"${param.permission.caption}"`}`
|
|
36
|
+
} else {
|
|
37
|
+
disabledWhy = ''
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
permissionDisabled = false
|
|
41
|
+
disabledWhy = ''
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let disabledWhy = ''
|
|
46
|
+
const isAllowed: Action<HTMLElement, { permission: BaseEnum[] | BaseEnum | undefined }> = (
|
|
47
|
+
node,
|
|
48
|
+
param,
|
|
49
|
+
) => {
|
|
50
|
+
// the node has been mounted in the DOM
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
updates(param)
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
update(param) {
|
|
56
|
+
// the value of `bar` has changed
|
|
57
|
+
updates(param)
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
destroy() {
|
|
61
|
+
// the node has been removed from the DOM
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const {
|
|
67
|
+
elements: { trigger, content, arrow },
|
|
68
|
+
states: { open },
|
|
69
|
+
} = createTooltip({
|
|
70
|
+
positioning: {
|
|
71
|
+
placement: 'top',
|
|
72
|
+
},
|
|
73
|
+
openDelay: 0,
|
|
74
|
+
closeDelay: 0,
|
|
75
|
+
closeOnPointerDown: false,
|
|
76
|
+
forceVisible: true,
|
|
77
|
+
escapeBehavior: 'close',
|
|
78
|
+
group: true,
|
|
79
|
+
})
|
|
57
80
|
</script>
|
|
58
81
|
|
|
59
82
|
<button
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
83
|
+
{...$trigger}
|
|
84
|
+
use:trigger
|
|
85
|
+
use:isAllowed={{ permission }}
|
|
86
|
+
on:click
|
|
87
|
+
{...$$restProps}
|
|
88
|
+
class={tw(['btn text-white', disabled ? '' : 'btn-primary', className])}
|
|
89
|
+
{disabled}
|
|
67
90
|
>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
91
|
+
<!-- btn-outline -->
|
|
92
|
+
<slot />
|
|
93
|
+
{#if triggerAnnimation && isLoading}
|
|
94
|
+
<div in:fly={{ x: -20 }}>
|
|
95
|
+
<span class="loading loading-spinner"></span>
|
|
96
|
+
</div>
|
|
97
|
+
{/if}
|
|
75
98
|
</button>
|
|
76
99
|
|
|
77
100
|
{#if $open && (disabledWhy || $$slots.tooltip)}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
<div
|
|
102
|
+
{...$content}
|
|
103
|
+
use:content
|
|
104
|
+
transition:fade={{ duration: 100 }}
|
|
105
|
+
class="bg-base-300 z-30 rounded-lg ring-1 ring-black"
|
|
106
|
+
>
|
|
107
|
+
<div {...$arrow} use:arrow></div>
|
|
108
|
+
<div class="px-4 py-1">
|
|
109
|
+
{#if $$slots.tooltip}
|
|
110
|
+
<slot name="tooltip" />
|
|
111
|
+
{:else}
|
|
112
|
+
{disabledWhy}
|
|
113
|
+
{/if}
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
93
116
|
{/if}
|
|
94
117
|
|
|
95
118
|
<style>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
119
|
+
.btn[disabled] {
|
|
120
|
+
pointer-events: all;
|
|
121
|
+
cursor: not-allowed;
|
|
122
|
+
}
|
|
100
123
|
</style>
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { BaseEnum } from '../';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
9
12
|
};
|
|
10
|
-
|
|
11
|
-
click: MouseEvent;
|
|
12
|
-
} & {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {
|
|
16
|
-
default: {};
|
|
17
|
-
tooltip: {};
|
|
18
|
-
};
|
|
19
|
-
exports?: undefined;
|
|
20
|
-
bindings?: undefined;
|
|
21
|
-
};
|
|
22
|
-
export type ButtonProps = typeof __propDef.props;
|
|
23
|
-
export type ButtonEvents = typeof __propDef.events;
|
|
24
|
-
export type ButtonSlots = typeof __propDef.slots;
|
|
25
|
-
export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
26
14
|
}
|
|
27
|
-
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
declare const Button: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
isLoading?: boolean | undefined;
|
|
23
|
+
class?: string | undefined | null | undefined;
|
|
24
|
+
permission?: BaseEnum<any> | BaseEnum<any>[] | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
tooltip: {};
|
|
28
|
+
}>, {
|
|
29
|
+
click: MouseEvent;
|
|
30
|
+
} & {
|
|
31
|
+
[evt: string]: CustomEvent<any>;
|
|
32
|
+
}, {
|
|
33
|
+
default: {};
|
|
34
|
+
tooltip: {};
|
|
35
|
+
}, {}, string>;
|
|
36
|
+
type Button = InstanceType<typeof Button>;
|
|
37
|
+
export default Button;
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* @param value to set in the clipboard if not null.
|
|
4
|
+
*
|
|
5
|
+
* Don't put this on an input, if not, when a user will select the input via the mouse, this clipboard will be copied (usually you wanted to paste)!
|
|
6
|
+
*/
|
|
7
|
+
export let value: string | null
|
|
8
|
+
export { extraClass as class }
|
|
9
|
+
|
|
10
|
+
let extraClass = ''
|
|
11
|
+
|
|
12
|
+
async function clip(_value: string | null) {
|
|
13
|
+
if (_value) {
|
|
14
|
+
try {
|
|
15
|
+
await navigator.clipboard.writeText(_value)
|
|
16
|
+
} catch (error) {}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
12
19
|
</script>
|
|
13
20
|
|
|
14
21
|
<span
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
role="button"
|
|
23
|
+
tabindex="0"
|
|
24
|
+
on:keyup={() => {}}
|
|
25
|
+
on:click={() => clip(value)}
|
|
26
|
+
class={`${value ? 'cursor-copy' : ''} ${extraClass}`}
|
|
20
27
|
>
|
|
21
|
-
|
|
28
|
+
<slot />
|
|
22
29
|
</span>
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
default: {};
|
|
16
|
-
};
|
|
17
|
-
exports?: {} | undefined;
|
|
18
|
-
bindings?: string | undefined;
|
|
19
|
-
};
|
|
20
|
-
export type ClipboardableProps = typeof __propDef.props;
|
|
21
|
-
export type ClipboardableEvents = typeof __propDef.events;
|
|
22
|
-
export type ClipboardableSlots = typeof __propDef.slots;
|
|
23
|
-
export default class Clipboardable extends SvelteComponent<ClipboardableProps, ClipboardableEvents, ClipboardableSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
24
13
|
}
|
|
25
|
-
|
|
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 Clipboardable: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
/**
|
|
21
|
+
* @param value to set in the clipboard if not null.
|
|
22
|
+
*
|
|
23
|
+
* Don't put this on an input, if not, when a user will select the input via the mouse, this clipboard will be copied (usually you wanted to paste)!
|
|
24
|
+
*/ value: string | null;
|
|
25
|
+
class?: string;
|
|
26
|
+
}, {
|
|
27
|
+
default: {};
|
|
28
|
+
}>, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {
|
|
31
|
+
default: {};
|
|
32
|
+
}, {
|
|
33
|
+
class: string;
|
|
34
|
+
}, string>;
|
|
35
|
+
type Clipboardable = InstanceType<typeof Clipboardable>;
|
|
36
|
+
export default Clipboardable;
|