firstly 0.0.13 → 0.0.15

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/esm/ROUTES.d.ts +2 -0
  3. package/esm/ROUTES.js +1 -0
  4. package/esm/auth/AuthController.d.ts +12 -23
  5. package/esm/auth/AuthController.js +12 -31
  6. package/esm/auth/server/AuthController.server.d.ts +11 -11
  7. package/esm/auth/server/AuthController.server.js +84 -18
  8. package/esm/auth/server/helperFirstly.d.ts +1 -1
  9. package/esm/auth/server/helperFirstly.js +1 -0
  10. package/esm/auth/server/module.d.ts +4 -7
  11. package/esm/auth/server/module.js +1 -1
  12. package/esm/auth/server/providers/github.d.ts +2 -1
  13. package/esm/auth/server/providers/github.js +1 -1
  14. package/esm/auth/static/assets/Page-B1GE_oYi.d.ts +6 -0
  15. package/esm/auth/static/assets/Page-B1GE_oYi.js +1 -0
  16. package/esm/auth/static/assets/Page-CDHFtYuN.d.ts +6 -0
  17. package/esm/auth/static/assets/Page-CDHFtYuN.js +1 -0
  18. package/esm/auth/static/assets/Page-Dh8pvAo6.d.ts +6 -0
  19. package/esm/auth/static/assets/Page-Dh8pvAo6.js +20 -0
  20. package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
  21. package/esm/auth/static/assets/index-7Nh2ct-y.d.ts +151 -0
  22. package/esm/auth/static/assets/index-7Nh2ct-y.js +42 -0
  23. package/esm/auth/static/index.html +3 -3
  24. package/esm/auth/types.d.ts +26 -3
  25. package/esm/bin/cmd.js +343 -143
  26. package/esm/changeLog/server/index.d.ts +1 -1
  27. package/esm/changeLog/server/index.js +1 -1
  28. package/esm/cron/server/index.d.ts +1 -1
  29. package/esm/cron/server/index.js +1 -1
  30. package/esm/feedback/FeedbackController.js +57 -51
  31. package/esm/feedback/server/index.d.ts +7 -16
  32. package/esm/feedback/server/index.js +5 -6
  33. package/esm/feedback/types.d.ts +14 -0
  34. package/esm/feedback/types.js +4 -0
  35. package/esm/feedback/ui/DialogIssue.svelte +78 -62
  36. package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
  37. package/esm/feedback/ui/DialogIssues.svelte +37 -28
  38. package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
  39. package/esm/feedback/ui/DialogMilestones.svelte +18 -12
  40. package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
  41. package/esm/feedback/ui/Feedback.svelte +11 -9
  42. package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
  43. package/esm/mail/server/index.d.ts +9 -2
  44. package/esm/mail/server/index.js +6 -2
  45. package/esm/mail/templates/DefaultMail.svelte +64 -44
  46. package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
  47. package/esm/{api → server}/index.d.ts +8 -0
  48. package/esm/storeItem.d.ts +1 -1
  49. package/esm/storeList.d.ts +1 -1
  50. package/esm/sveltekit/server/index.d.ts +1 -10
  51. package/esm/sveltekit/server/index.js +1 -1
  52. package/esm/ui/Button.svelte +79 -56
  53. package/esm/ui/Button.svelte.d.ts +34 -24
  54. package/esm/ui/Clipboardable.svelte +18 -11
  55. package/esm/ui/Clipboardable.svelte.d.ts +34 -23
  56. package/esm/ui/Field.svelte +189 -136
  57. package/esm/ui/Field.svelte.d.ts +13 -6
  58. package/esm/ui/FieldGroup.svelte +74 -53
  59. package/esm/ui/FieldGroup.svelte.d.ts +17 -6
  60. package/esm/ui/Grid.svelte +110 -86
  61. package/esm/ui/Grid.svelte.d.ts +17 -6
  62. package/esm/ui/GridLoading.svelte +10 -5
  63. package/esm/ui/GridLoading.svelte.d.ts +19 -17
  64. package/esm/ui/GridPaginate.svelte +30 -23
  65. package/esm/ui/GridPaginate.svelte.d.ts +21 -19
  66. package/esm/ui/Icon.svelte +67 -32
  67. package/esm/ui/Icon.svelte.d.ts +52 -43
  68. package/esm/ui/Loading.svelte +5 -3
  69. package/esm/ui/Loading.svelte.d.ts +29 -18
  70. package/esm/ui/Tooltip.svelte +22 -19
  71. package/esm/ui/Tooltip.svelte.d.ts +30 -20
  72. package/esm/ui/dialog/DialogForm.svelte +48 -41
  73. package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
  74. package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
  75. package/esm/ui/dialog/DialogPrimitive.svelte +32 -26
  76. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
  77. package/esm/ui/dialog/FormEditAction.svelte +20 -12
  78. package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
  79. package/esm/ui/dialog/dialog.d.ts +1 -1
  80. package/esm/ui/internals/FieldContainer.svelte +13 -6
  81. package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
  82. package/esm/ui/internals/Input.svelte +110 -76
  83. package/esm/ui/internals/Input.svelte.d.ts +34 -32
  84. package/esm/ui/internals/Textarea.svelte +39 -31
  85. package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
  86. package/esm/ui/internals/select/MultiSelectMelt.svelte +174 -126
  87. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
  88. package/esm/ui/internals/select/SelectMelt.svelte +168 -133
  89. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
  90. package/esm/ui/internals/select/SelectRadio.svelte +17 -11
  91. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
  92. package/esm/ui/link/Link.svelte +11 -6
  93. package/esm/ui/link/Link.svelte.d.ts +31 -22
  94. package/esm/ui/link/LinkPlus.svelte +19 -16
  95. package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
  96. package/esm/vite/index.d.ts +2 -3
  97. package/esm/vite/index.js +33 -26
  98. package/package.json +14 -14
  99. package/esm/auth/static/assets/Page-BUfjaN-D.d.ts +0 -5
  100. package/esm/auth/static/assets/Page-BUfjaN-D.js +0 -19
  101. package/esm/auth/static/assets/Page-CJ58H1vl.css +0 -1
  102. package/esm/auth/static/assets/Page-CaDAqmBS.d.ts +0 -5
  103. package/esm/auth/static/assets/Page-CaDAqmBS.js +0 -1
  104. package/esm/auth/static/assets/Page-DhdZddzJ.d.ts +0 -5
  105. package/esm/auth/static/assets/Page-DhdZddzJ.js +0 -1
  106. package/esm/auth/static/assets/index-D-Ztdt2o.d.ts +0 -54
  107. package/esm/auth/static/assets/index-D-Ztdt2o.js +0 -2
  108. /package/esm/auth/static/assets/{index-BDy4A_14.css → index-DKWpA6v7.css} +0 -0
  109. /package/esm/{api → server}/index.js +0 -0
@@ -1,16 +1,18 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- [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: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
6
11
  };
7
- slots: {};
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
- export {};
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;
@@ -7,9 +7,9 @@ import type SMTPPool from 'nodemailer/lib/smtp-pool';
7
7
  import type SMTPTransport from 'nodemailer/lib/smtp-transport';
8
8
  import type StreamTransport from 'nodemailer/lib/stream-transport';
9
9
  import type { ComponentProps, ComponentType, SvelteComponent } from 'svelte';
10
- import { Module } from '../../api';
10
+ import { Module } from '../../server';
11
11
  import { default as DefaultMail } from '../templates/DefaultMail.svelte';
12
- export type TransportTypes = SMTPTransport | SMTPTransport.Options | string | SMTPPool | SMTPPool.Options | SendmailTransport | SendmailTransport.Options | StreamTransport | StreamTransport.Options | JSONTransport | JSONTransport.Options | SESTransport | SESTransport.Options | typeNodemailer.Transport<any> | typeNodemailer.TransportOptions;
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,6 +22,13 @@ 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
+ 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;
25
32
  export 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] & {
@@ -1,7 +1,8 @@
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
- import { Module } from '../../api';
5
+ import { Module } from '../../server';
5
6
  import { default as DefaultMail } from '../templates/DefaultMail.svelte';
6
7
  let transporter;
7
8
  let globalOptions;
@@ -78,11 +79,14 @@ export const sendMail = async (topic, mailOptions) => {
78
79
  };
79
80
  const mailModule = new Module({
80
81
  name: 'mail',
81
- priority: -778,
82
+ priority: -888,
82
83
  });
83
84
  export const mail = (o) => {
84
85
  mailModule.initApi = () => {
85
86
  initMail(o);
86
87
  };
88
+ mailModule.initRequest = async () => {
89
+ remult.context.sendMail = sendMail;
90
+ };
87
91
  return mailModule;
88
92
  };
@@ -1,47 +1,67 @@
1
- <script>import { Button, Container, Head, Heading, Html, Preview, Section, Text } from "svelty-email";
2
- export let previewText;
3
- export let title;
4
- export let sections = [];
5
- export let brandColor = "#5B68DF";
6
- const fontFamily = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif';
7
- const main = {
8
- backgroundColor: "#ffffff"
9
- };
10
- const container = {
11
- margin: "0 auto",
12
- padding: "20px 0 48px",
13
- width: "580px"
14
- };
15
- const heading = {
16
- fontFamily,
17
- fontSize: "32px",
18
- lineHeight: "1.3",
19
- fontWeight: "700",
20
- color: "#484848"
21
- };
22
- const paragraph = {
23
- fontFamily,
24
- fontSize: "18px",
25
- lineHeight: "1.4",
26
- color: "#484848"
27
- };
28
- const highlighted = {
29
- ...paragraph,
30
- padding: "24px",
31
- backgroundColor: "#f2f3f3",
32
- borderRadius: "4px"
33
- };
34
- const button = {
35
- fontFamily,
36
- backgroundColor: brandColor,
37
- borderRadius: "5px",
38
- color: "#fff",
39
- fontSize: "18px",
40
- textDecoration: "none",
41
- textAlign: "center",
42
- display: "block",
43
- width: "100%"
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
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- previewText: string | undefined;
5
- title: string | undefined;
6
- sections?: {
7
- text: string;
8
- highlighted?: boolean;
9
- cta?: {
10
- text: string;
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
- slots: {};
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
- export {};
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;
@@ -28,6 +28,14 @@ export declare class Module {
28
28
  type Options = RemultServerOptions<RequestEvent<Partial<Record<string, string>>, string | null>> & {
29
29
  modules?: Module[] | undefined;
30
30
  };
31
+ declare module 'remult' {
32
+ interface RemultContext {
33
+ request: RequestEvent;
34
+ setHeaders(headers: Record<string, string>): void;
35
+ setCookie(...args: Parameters<RequestEvent['cookies']['set']>): void;
36
+ deleteCookie(...args: Parameters<RequestEvent['cookies']['delete']>): void;
37
+ }
38
+ }
31
39
  export declare let entities: ClassType<any>[];
32
40
  /**
33
41
  * it's basically `remultSveltekit` with the `modules` option
@@ -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?: import("svelte/store").Invalidator<TheStoreItem<T>> | undefined) => import("svelte/store").Unsubscriber;
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
  /**
@@ -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?: import("svelte/store").Invalidator<TheStoreList<T>> | undefined) => import("svelte/store").Unsubscriber;
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
- 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
- }
1
+ import { Module } from '../../server';
11
2
  /**
12
3
  * @deprecated will be done directly in remult when modules will be in 😉
13
4
  */
@@ -1,5 +1,5 @@
1
1
  import { remult } from 'remult';
2
- import { Module } from '../../api';
2
+ import { Module } from '../../server';
3
3
  /**
4
4
  * @deprecated will be done directly in remult when modules will be in 😉
5
5
  */
@@ -1,59 +1,82 @@
1
- <script>import { createTooltip } from "@melt-ui/svelte";
2
- import { fade, fly } from "svelte/transition";
3
- import { remult } from "remult";
4
- import { BaseEnum, tw } from "../";
5
- export let isLoading = false;
6
- let className = void 0;
7
- export { className as class };
8
- export let permission = void 0;
9
- let permissionDisabled = false;
10
- $: disabled = $$restProps.disabled || permissionDisabled || isLoading;
11
- let triggerAnnimation = false;
12
- $: isLoading && setTimeout(() => {
13
- if (isLoading) {
14
- triggerAnnimation = true;
15
- }
16
- }, 200);
17
- let updates = (param) => {
18
- if (param && param.permission) {
19
- permissionDisabled = !remult.isAllowed(
20
- Array.isArray(param.permission) ? param.permission.map((c) => c.id) : param.permission.id
21
- );
22
- if (permissionDisabled) {
23
- disabledWhy = `Vous n'avez pas la permission: ${Array.isArray(param.permission) ? param.permission.map((c) => `"${c.caption}"`).join(" ou ") : `"${param.permission.caption}"`}`;
24
- } else {
25
- disabledWhy = "";
26
- }
27
- } else {
28
- permissionDisabled = false;
29
- disabledWhy = "";
30
- }
31
- };
32
- let disabledWhy = "";
33
- const isAllowed = (node, param) => {
34
- updates(param);
35
- return {
36
- update(param2) {
37
- updates(param2);
38
- },
39
- destroy() {
40
- }
41
- };
42
- };
43
- const {
44
- elements: { trigger, content, arrow },
45
- states: { open }
46
- } = createTooltip({
47
- positioning: {
48
- placement: "top"
49
- },
50
- openDelay: 0,
51
- closeDelay: 0,
52
- closeOnPointerDown: false,
53
- forceVisible: true,
54
- escapeBehavior: "close",
55
- group: true
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
- declare const __propDef: {
4
- props: {
5
- [x: string]: any;
6
- isLoading?: boolean | undefined;
7
- class?: string | undefined | null | undefined;
8
- permission?: BaseEnum<any> | BaseEnum<any>[] | undefined;
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
- events: {
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
- export {};
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>export let value;
2
- export { extraClass as class };
3
- let extraClass = "";
4
- async function clip(_value) {
5
- if (_value) {
6
- try {
7
- await navigator.clipboard.writeText(_value);
8
- } catch (error) {
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
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- /**
5
- * @param value to set in the clipboard if not null.
6
- *
7
- * 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)!
8
- */ value: string | null;
9
- class?: string;
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
- events: {
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
- export {};
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;