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.
Files changed (120) 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/api/index.d.ts +9 -0
  5. package/esm/api/index.js +3 -1
  6. package/esm/auth/AuthController.d.ts +12 -23
  7. package/esm/auth/AuthController.js +12 -31
  8. package/esm/auth/server/AuthController.server.d.ts +11 -11
  9. package/esm/auth/server/AuthController.server.js +99 -34
  10. package/esm/auth/server/handleGuard.d.ts +16 -0
  11. package/esm/auth/server/handleGuard.js +67 -0
  12. package/esm/auth/server/helperFirstly.d.ts +1 -1
  13. package/esm/auth/server/helperFirstly.js +1 -0
  14. package/esm/auth/server/index.d.ts +3 -1
  15. package/esm/auth/server/index.js +3 -1
  16. package/esm/auth/server/module.d.ts +105 -89
  17. package/esm/auth/server/module.js +55 -42
  18. package/esm/auth/server/providers/github.d.ts +4 -2
  19. package/esm/auth/server/providers/github.js +2 -2
  20. package/esm/auth/static/assets/Page-B0XXxe0N.d.ts +6 -0
  21. package/esm/auth/static/assets/Page-B0XXxe0N.js +1 -0
  22. package/esm/auth/static/assets/Page-DdKMiUZn.d.ts +6 -0
  23. package/esm/auth/static/assets/Page-DdKMiUZn.js +20 -0
  24. package/esm/auth/static/assets/Page-UV_hqY7I.d.ts +6 -0
  25. package/esm/auth/static/assets/Page-UV_hqY7I.js +1 -0
  26. package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
  27. package/esm/auth/static/assets/index-C9jzxOBu.d.ts +151 -0
  28. package/esm/auth/static/assets/index-C9jzxOBu.js +42 -0
  29. package/esm/auth/static/assets/index-DKWpA6v7.css +4 -0
  30. package/esm/auth/static/index.html +11 -11
  31. package/esm/auth/types.d.ts +26 -3
  32. package/esm/bin/cmd.js +423 -152
  33. package/esm/cellsBuildor.js +1 -1
  34. package/esm/common.d.ts +5 -0
  35. package/esm/common.js +8 -0
  36. package/esm/cron/server/index.js +1 -1
  37. package/esm/feedback/FeedbackController.js +58 -53
  38. package/esm/feedback/server/index.d.ts +6 -15
  39. package/esm/feedback/server/index.js +4 -5
  40. package/esm/feedback/types.d.ts +14 -0
  41. package/esm/feedback/types.js +4 -0
  42. package/esm/feedback/ui/DialogIssue.svelte +131 -119
  43. package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
  44. package/esm/feedback/ui/DialogIssues.svelte +108 -99
  45. package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
  46. package/esm/feedback/ui/DialogMilestones.svelte +40 -34
  47. package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
  48. package/esm/feedback/ui/Feedback.svelte +11 -9
  49. package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
  50. package/esm/index.d.ts +2 -5
  51. package/esm/index.js +2 -8
  52. package/esm/mail/server/index.d.ts +9 -2
  53. package/esm/mail/server/index.js +3 -1
  54. package/esm/mail/templates/DefaultMail.svelte +81 -61
  55. package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
  56. package/esm/server/index.d.ts +0 -0
  57. package/esm/server/index.js +1 -0
  58. package/esm/storeItem.d.ts +1 -4
  59. package/esm/storeItem.js +1 -1
  60. package/esm/storeList.d.ts +1 -4
  61. package/esm/sveltekit/server/index.d.ts +3 -9
  62. package/esm/sveltekit/server/index.js +3 -0
  63. package/esm/ui/Button.svelte +112 -89
  64. package/esm/ui/Button.svelte.d.ts +34 -24
  65. package/esm/ui/Clipboardable.svelte +24 -17
  66. package/esm/ui/Clipboardable.svelte.d.ts +34 -23
  67. package/esm/ui/Field.svelte +328 -285
  68. package/esm/ui/Field.svelte.d.ts +15 -8
  69. package/esm/ui/FieldGroup.svelte +112 -91
  70. package/esm/ui/FieldGroup.svelte.d.ts +17 -6
  71. package/esm/ui/Grid.svelte +322 -308
  72. package/esm/ui/Grid.svelte.d.ts +17 -6
  73. package/esm/ui/GridLoading.svelte +28 -27
  74. package/esm/ui/GridLoading.svelte.d.ts +19 -17
  75. package/esm/ui/GridPaginate.svelte +68 -61
  76. package/esm/ui/GridPaginate.svelte.d.ts +21 -19
  77. package/esm/ui/Icon.svelte +116 -80
  78. package/esm/ui/Icon.svelte.d.ts +52 -43
  79. package/esm/ui/Loading.svelte +10 -8
  80. package/esm/ui/Loading.svelte.d.ts +29 -18
  81. package/esm/ui/Tooltip.svelte +38 -35
  82. package/esm/ui/Tooltip.svelte.d.ts +30 -20
  83. package/esm/ui/dialog/DialogForm.svelte +70 -63
  84. package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
  85. package/esm/ui/dialog/DialogManagement.svelte +74 -74
  86. package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
  87. package/esm/ui/dialog/DialogPrimitive.svelte +82 -76
  88. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
  89. package/esm/ui/dialog/FormEditAction.svelte +58 -50
  90. package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
  91. package/esm/ui/dialog/dialog.d.ts +1 -4
  92. package/esm/ui/internals/FieldContainer.svelte +24 -17
  93. package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
  94. package/esm/ui/internals/Input.svelte +136 -102
  95. package/esm/ui/internals/Input.svelte.d.ts +34 -32
  96. package/esm/ui/internals/Textarea.svelte +60 -52
  97. package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
  98. package/esm/ui/internals/select/MultiSelectMelt.svelte +243 -199
  99. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
  100. package/esm/ui/internals/select/SelectMelt.svelte +254 -219
  101. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
  102. package/esm/ui/internals/select/SelectRadio.svelte +39 -33
  103. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
  104. package/esm/ui/link/Link.svelte +25 -20
  105. package/esm/ui/link/Link.svelte.d.ts +31 -23
  106. package/esm/ui/link/LinkPlus.svelte +52 -51
  107. package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
  108. package/esm/vite/index.d.ts +2 -3
  109. package/esm/vite/index.js +33 -26
  110. package/package.json +16 -20
  111. package/esm/auth/static/assets/Page-Bb8bFlrP.d.ts +0 -4
  112. package/esm/auth/static/assets/Page-Bb8bFlrP.js +0 -1
  113. package/esm/auth/static/assets/Page-BxomFlZ8.d.ts +0 -4
  114. package/esm/auth/static/assets/Page-BxomFlZ8.js +0 -1
  115. package/esm/auth/static/assets/Page-CaIYu0-y.d.ts +0 -6
  116. package/esm/auth/static/assets/Page-CaIYu0-y.js +0 -19
  117. package/esm/auth/static/assets/Page-MkYglNtu.css +0 -1
  118. package/esm/auth/static/assets/index-Bl0Bk5u0.d.ts +0 -64
  119. package/esm/auth/static/assets/index-Bl0Bk5u0.js +0 -2
  120. package/esm/auth/static/assets/index-R27C_TlP.css +0 -4
@@ -1,66 +1,86 @@
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>
48
- <Head />
49
- <Preview preview={previewText ?? title + '...'} />
50
- <Section style={main}>
51
- <Container style={container}>
52
- {#if title}
53
- <Heading style={heading}>{title}</Heading>
54
- {/if}
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
- {#each sections as s}
57
- <Text style={s.highlighted ? highlighted : paragraph}>
58
- {s.text}
59
- </Text>
60
- {#if s.cta}
61
- <Button pY={19} style={button} href={s.cta.link}>{s.cta.text}</Button>
62
- {/if}
63
- {/each}
64
- </Container>
65
- </Section>
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
- 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;
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -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,
@@ -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
- 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
- }
2
+ /**
3
+ * @deprecated will be done directly in remult when modules will be in 😉
4
+ */
11
5
  export declare const sveltekit: () => Module;
@@ -1,5 +1,8 @@
1
1
  import { remult } from 'remult';
2
2
  import { Module } from '../../api';
3
+ /**
4
+ * @deprecated will be done directly in remult when modules will be in 😉
5
+ */
3
6
  export const sveltekit = () => {
4
7
  return new Module({
5
8
  name: 'sveltekit',
@@ -1,100 +1,123 @@
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
60
- {...$trigger}
61
- use:trigger
62
- use:isAllowed={{ permission }}
63
- on:click
64
- {...$$restProps}
65
- class={tw(['btn text-white', disabled ? '' : 'btn-primary', className])}
66
- {disabled}
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
- <!-- btn-outline -->
69
- <slot />
70
- {#if triggerAnnimation && isLoading}
71
- <div in:fly={{ x: -20 }}>
72
- <span class="loading loading-spinner"></span>
73
- </div>
74
- {/if}
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
- <div
79
- {...$content}
80
- use:content
81
- transition:fade={{ duration: 100 }}
82
- class="bg-base-300 z-30 rounded-lg ring-1 ring-black"
83
- >
84
- <div {...$arrow} use:arrow></div>
85
- <div class="px-4 py-1">
86
- {#if $$slots.tooltip}
87
- <slot name="tooltip" />
88
- {:else}
89
- {disabledWhy}
90
- {/if}
91
- </div>
92
- </div>
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
- .btn[disabled] {
97
- pointer-events: all;
98
- cursor: not-allowed;
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
- declare const __propDef: {
4
- props: {
5
- [x: string]: any;
6
- isLoading?: boolean | undefined;
7
- class?: string | undefined | null;
8
- permission?: BaseEnum[] | BaseEnum | 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,22 +1,29 @@
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
15
- role="button"
16
- tabindex="0"
17
- on:keyup={() => {}}
18
- on:click={() => clip(value)}
19
- class={`${value ? 'cursor-copy' : ''} ${extraClass}`}
22
+ role="button"
23
+ tabindex="0"
24
+ on:keyup={() => {}}
25
+ on:click={() => clip(value)}
26
+ class={`${value ? 'cursor-copy' : ''} ${extraClass}`}
20
27
  >
21
- <slot />
28
+ <slot />
22
29
  </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;