firstly 0.0.13 → 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 +8 -0
- package/esm/ROUTES.d.ts +2 -0
- package/esm/ROUTES.js +1 -0
- package/esm/api/index.d.ts +8 -0
- 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 +83 -18
- package/esm/auth/server/helperFirstly.d.ts +1 -1
- package/esm/auth/server/helperFirstly.js +1 -0
- package/esm/auth/server/module.d.ts +3 -6
- 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-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/index.html +2 -2
- package/esm/auth/types.d.ts +26 -3
- package/esm/bin/cmd.js +339 -139
- package/esm/feedback/FeedbackController.js +57 -51
- 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 +78 -62
- package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogIssues.svelte +37 -28
- package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogMilestones.svelte +18 -12
- 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/mail/server/index.d.ts +9 -2
- package/esm/mail/server/index.js +3 -1
- package/esm/mail/templates/DefaultMail.svelte +64 -44
- 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 -1
- package/esm/storeList.d.ts +1 -1
- package/esm/sveltekit/server/index.d.ts +0 -9
- package/esm/ui/Button.svelte +79 -56
- package/esm/ui/Button.svelte.d.ts +34 -24
- package/esm/ui/Clipboardable.svelte +18 -11
- package/esm/ui/Clipboardable.svelte.d.ts +34 -23
- package/esm/ui/Field.svelte +189 -136
- package/esm/ui/Field.svelte.d.ts +13 -6
- package/esm/ui/FieldGroup.svelte +74 -53
- package/esm/ui/FieldGroup.svelte.d.ts +17 -6
- package/esm/ui/Grid.svelte +110 -86
- package/esm/ui/Grid.svelte.d.ts +17 -6
- package/esm/ui/GridLoading.svelte +10 -5
- package/esm/ui/GridLoading.svelte.d.ts +19 -17
- package/esm/ui/GridPaginate.svelte +30 -23
- package/esm/ui/GridPaginate.svelte.d.ts +21 -19
- package/esm/ui/Icon.svelte +67 -32
- package/esm/ui/Icon.svelte.d.ts +52 -43
- package/esm/ui/Loading.svelte +5 -3
- package/esm/ui/Loading.svelte.d.ts +29 -18
- package/esm/ui/Tooltip.svelte +22 -19
- package/esm/ui/Tooltip.svelte.d.ts +30 -20
- package/esm/ui/dialog/DialogForm.svelte +48 -41
- package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
- package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
- package/esm/ui/dialog/DialogPrimitive.svelte +32 -26
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
- package/esm/ui/dialog/FormEditAction.svelte +20 -12
- package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
- package/esm/ui/dialog/dialog.d.ts +1 -1
- package/esm/ui/internals/FieldContainer.svelte +13 -6
- package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
- package/esm/ui/internals/Input.svelte +110 -76
- package/esm/ui/internals/Input.svelte.d.ts +34 -32
- package/esm/ui/internals/Textarea.svelte +39 -31
- package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
- package/esm/ui/internals/select/MultiSelectMelt.svelte +174 -126
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
- package/esm/ui/internals/select/SelectMelt.svelte +168 -133
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
- package/esm/ui/internals/select/SelectRadio.svelte +17 -11
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
- package/esm/ui/link/Link.svelte +11 -6
- package/esm/ui/link/Link.svelte.d.ts +31 -22
- package/esm/ui/link/LinkPlus.svelte +19 -16
- 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 +5 -5
- package/esm/auth/static/assets/Page-BUfjaN-D.d.ts +0 -5
- package/esm/auth/static/assets/Page-BUfjaN-D.js +0 -19
- package/esm/auth/static/assets/Page-CJ58H1vl.css +0 -1
- package/esm/auth/static/assets/Page-CaDAqmBS.d.ts +0 -5
- package/esm/auth/static/assets/Page-CaDAqmBS.js +0 -1
- package/esm/auth/static/assets/Page-DhdZddzJ.d.ts +0 -5
- package/esm/auth/static/assets/Page-DhdZddzJ.js +0 -1
- package/esm/auth/static/assets/index-D-Ztdt2o.d.ts +0 -54
- package/esm/auth/static/assets/index-D-Ztdt2o.js +0 -2
- /package/esm/auth/static/assets/{index-BDy4A_14.css → index-DKWpA6v7.css} +0 -0
|
@@ -1,16 +1,18 @@
|
|
|
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: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
exports?: {} | undefined;
|
|
9
|
-
bindings?: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
export type FeedbackProps = typeof __propDef.props;
|
|
12
|
-
export type FeedbackEvents = typeof __propDef.events;
|
|
13
|
-
export type FeedbackSlots = typeof __propDef.slots;
|
|
14
|
-
export default class Feedback extends SvelteComponent<FeedbackProps, FeedbackEvents, FeedbackSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
declare const Feedback: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Feedback = InstanceType<typeof Feedback>;
|
|
18
|
+
export default Feedback;
|
|
@@ -9,7 +9,7 @@ import type StreamTransport from 'nodemailer/lib/stream-transport';
|
|
|
9
9
|
import type { ComponentProps, ComponentType, SvelteComponent } from 'svelte';
|
|
10
10
|
import { Module } from '../../api';
|
|
11
11
|
import { default as DefaultMail } from '../templates/DefaultMail.svelte';
|
|
12
|
-
export type TransportTypes = SMTPTransport |
|
|
12
|
+
export type TransportTypes = SMTPTransport | SMTPPool | SendmailTransport | StreamTransport | JSONTransport | SESTransport | typeNodemailer.Transport<any> | DefaultOptions;
|
|
13
13
|
export type DefaultOptions = SMTPTransport.Options | SMTPPool.Options | SendmailTransport.Options | StreamTransport.Options | JSONTransport.Options | SESTransport.Options | typeNodemailer.TransportOptions;
|
|
14
14
|
export type MailOptions<ComponentTemplateDefault extends SvelteComponent> = {
|
|
15
15
|
from?: Mail.Options['from'];
|
|
@@ -22,7 +22,14 @@ export type MailOptions<ComponentTemplateDefault extends SvelteComponent> = {
|
|
|
22
22
|
apiUrl?: Parameters<typeof typeNodemailer.createTestAccount>[0];
|
|
23
23
|
};
|
|
24
24
|
declare let transporter: ReturnType<typeof typeNodemailer.createTransport>;
|
|
25
|
-
|
|
25
|
+
declare module 'remult' {
|
|
26
|
+
interface RemultContext {
|
|
27
|
+
/** Better checking is it's present or not, that's why it's "?" */
|
|
28
|
+
sendMail?: SendMail;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export type SendMail = typeof sendMail;
|
|
32
|
+
declare const sendMail: <ComponentTemplateDefault extends SvelteComponent = DefaultMail>(
|
|
26
33
|
/** usefull for logs, it has NO impact on the mail itself */
|
|
27
34
|
topic: string, mailOptions: Parameters<typeof transporter.sendMail>[0] & {
|
|
28
35
|
templateProps?: ComponentProps<ComponentTemplateDefault> | undefined;
|
package/esm/mail/server/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import nodemailer from 'nodemailer';
|
|
2
2
|
import { render } from 'svelty-email';
|
|
3
|
+
import { remult } from 'remult';
|
|
3
4
|
import { cyan, green, magenta, red, sleep, white } from '@kitql/helpers';
|
|
4
5
|
import { Module } from '../../api';
|
|
5
6
|
import { default as DefaultMail } from '../templates/DefaultMail.svelte';
|
|
@@ -35,7 +36,7 @@ const initMail = async (o) => {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
const sendMail = async (topic, mailOptions) => {
|
|
39
40
|
// if the transporter is not ready, wait for it! (it can happen only if nothing is set...)
|
|
40
41
|
for (let i = 0; i < 30; i++) {
|
|
41
42
|
if (transporter !== undefined) {
|
|
@@ -83,6 +84,7 @@ const mailModule = new Module({
|
|
|
83
84
|
export const mail = (o) => {
|
|
84
85
|
mailModule.initApi = () => {
|
|
85
86
|
initMail(o);
|
|
87
|
+
remult.context.sendMail = sendMail;
|
|
86
88
|
};
|
|
87
89
|
return mailModule;
|
|
88
90
|
};
|
|
@@ -1,47 +1,67 @@
|
|
|
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>
|
|
@@ -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,7 +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: (this: void, run: import("svelte/store").Subscriber<TheStoreItem<T>>, invalidate?:
|
|
9
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreItem<T>>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
10
10
|
create: (item: Partial<T>) => void;
|
|
11
11
|
set: (newItem: TheStoreItem<T>) => void;
|
|
12
12
|
/**
|
package/esm/storeList.d.ts
CHANGED
|
@@ -25,7 +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: (this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?:
|
|
28
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
29
29
|
manualSet: (info: TheStoreList<T>) => void;
|
|
30
30
|
fetch: (options?: FF_FindOptions<T>, onNewData?: (items?: T[], totalCount?: number) => void) => Promise<void>;
|
|
31
31
|
listen: (options?: FF_FindOptions<T>) => Promise<void>;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import type { RequestEvent } from '@sveltejs/kit';
|
|
2
1
|
import { Module } from '../../api';
|
|
3
|
-
declare module 'remult' {
|
|
4
|
-
interface RemultContext {
|
|
5
|
-
request: RequestEvent;
|
|
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
|
-
}
|
|
11
2
|
/**
|
|
12
3
|
* @deprecated will be done directly in remult when modules will be in 😉
|
|
13
4
|
*/
|
package/esm/ui/Button.svelte
CHANGED
|
@@ -1,59 +1,82 @@
|
|
|
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
|
|
@@ -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,14 +1,21 @@
|
|
|
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
|
|
@@ -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;
|