firstly 0.2.1 → 0.4.0

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 (210) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/esm/SqlDatabase/FF_LogToConsole.js +9 -14
  3. package/esm/carbone/CarboneController.js +2 -1
  4. package/esm/changeLog/index.d.ts +0 -10
  5. package/esm/{internals → core}/BaseEnum.d.ts +1 -1
  6. package/esm/core/FF_Entity.js +5 -0
  7. package/esm/core/helper.d.ts +2 -0
  8. package/esm/core/helper.js +3 -0
  9. package/esm/core/index.d.ts +0 -0
  10. package/esm/core/index.js +5 -0
  11. package/esm/core/tailwind.d.ts +21 -0
  12. package/esm/core/tailwind.js +22 -0
  13. package/esm/core/tryCatch.d.ts +44 -0
  14. package/esm/core/tryCatch.js +34 -0
  15. package/esm/cron/server/index.js +1 -1
  16. package/esm/feedback/FeedbackController.js +3 -2
  17. package/esm/feedback/index.d.ts +7 -2
  18. package/esm/feedback/index.js +1 -2
  19. package/esm/feedback/server/index.d.ts +0 -5
  20. package/esm/feedback/server/index.js +1 -1
  21. package/esm/formats/strings.js +2 -2
  22. package/esm/index.d.ts +16 -0
  23. package/esm/index.js +13 -0
  24. package/esm/svelte/FF_Repo.svelte.d.ts +9 -2
  25. package/esm/svelte/FF_Repo.svelte.js +40 -17
  26. package/esm/svelte/class/SP.svelte.js +14 -2
  27. package/esm/svelte/helpers/debounce.js +1 -1
  28. package/esm/svelte/index.d.ts +2 -24
  29. package/esm/svelte/index.js +2 -22
  30. package/esm/{ui → svelte/ui}/Icon.svelte +1 -1
  31. package/esm/virtual/StateDemoEnum.d.ts +3 -3
  32. package/esm/virtual/StateDemoEnum.js +3 -3
  33. package/esm/virtual/UIEntity.js +1 -2
  34. package/package.json +8 -39
  35. package/esm/auth/AuthController.d.ts +0 -58
  36. package/esm/auth/AuthController.js +0 -114
  37. package/esm/auth/Entities.d.ts +0 -47
  38. package/esm/auth/Entities.js +0 -182
  39. package/esm/auth/README.md +0 -3
  40. package/esm/auth/index.d.ts +0 -5
  41. package/esm/auth/index.js +0 -5
  42. package/esm/auth/server/AuthController.server.d.ts +0 -58
  43. package/esm/auth/server/AuthController.server.js +0 -518
  44. package/esm/auth/server/handleAuth.d.ts +0 -4
  45. package/esm/auth/server/handleAuth.js +0 -142
  46. package/esm/auth/server/handleGuard.d.ts +0 -22
  47. package/esm/auth/server/handleGuard.js +0 -34
  48. package/esm/auth/server/helperDb.d.ts +0 -10
  49. package/esm/auth/server/helperDb.js +0 -56
  50. package/esm/auth/server/helperFirstly.d.ts +0 -1
  51. package/esm/auth/server/helperFirstly.js +0 -9
  52. package/esm/auth/server/helperOslo.d.ts +0 -7
  53. package/esm/auth/server/helperOslo.js +0 -24
  54. package/esm/auth/server/helperRemultServer.d.ts +0 -5
  55. package/esm/auth/server/helperRemultServer.js +0 -44
  56. package/esm/auth/server/helperRole.d.ts +0 -19
  57. package/esm/auth/server/helperRole.js +0 -57
  58. package/esm/auth/server/index.d.ts +0 -8
  59. package/esm/auth/server/index.js +0 -8
  60. package/esm/auth/server/module.d.ts +0 -300
  61. package/esm/auth/server/module.js +0 -230
  62. package/esm/auth/server/providers/github.d.ts +0 -33
  63. package/esm/auth/server/providers/github.js +0 -87
  64. package/esm/auth/server/providers/helperProvider.d.ts +0 -1
  65. package/esm/auth/server/providers/helperProvider.js +0 -25
  66. package/esm/auth/static/assets/Page-BHW08QWz.css +0 -1
  67. package/esm/auth/static/assets/Page-BRNWcY5Z.d.ts +0 -2
  68. package/esm/auth/static/assets/Page-BRNWcY5Z.js +0 -1
  69. package/esm/auth/static/assets/Page-CFcEsGK8.d.ts +0 -2
  70. package/esm/auth/static/assets/Page-CFcEsGK8.js +0 -7
  71. package/esm/auth/static/assets/Page-tLVs5slF.d.ts +0 -2
  72. package/esm/auth/static/assets/Page-tLVs5slF.js +0 -1
  73. package/esm/auth/static/assets/index-D38rqu4x.d.ts +0 -201
  74. package/esm/auth/static/assets/index-D38rqu4x.js +0 -2
  75. package/esm/auth/static/assets/index-DKWpA6v7.css +0 -4
  76. package/esm/auth/static/favicon.svg +0 -79
  77. package/esm/auth/static/index.html +0 -13
  78. package/esm/auth/types.d.ts +0 -73
  79. package/esm/bin/cmd.d.ts +0 -1
  80. package/esm/bin/cmd.js +0 -793
  81. package/esm/feedback/ui/DialogIssue.svelte +0 -149
  82. package/esm/feedback/ui/DialogIssue.svelte.d.ts +0 -22
  83. package/esm/feedback/ui/DialogIssues.svelte +0 -114
  84. package/esm/feedback/ui/DialogIssues.svelte.d.ts +0 -22
  85. package/esm/feedback/ui/DialogMilestones.svelte +0 -43
  86. package/esm/feedback/ui/DialogMilestones.svelte.d.ts +0 -20
  87. package/esm/feedback/ui/Feedback.svelte +0 -16
  88. package/esm/feedback/ui/Feedback.svelte.d.ts +0 -18
  89. package/esm/internals/FF_Entity.d.ts +0 -2
  90. package/esm/internals/FF_Entity.js +0 -21
  91. package/esm/internals/FF_Fields.d.ts +0 -11
  92. package/esm/internals/FF_Fields.js +0 -144
  93. package/esm/internals/cellsBuildor.d.ts +0 -47
  94. package/esm/internals/cellsBuildor.js +0 -140
  95. package/esm/internals/helper.d.ts +0 -49
  96. package/esm/internals/helper.js +0 -162
  97. package/esm/internals/index.d.ts +0 -82
  98. package/esm/internals/index.js +0 -45
  99. package/esm/internals/storeItem.d.ts +0 -28
  100. package/esm/internals/storeItem.js +0 -176
  101. package/esm/internals/storeList.d.ts +0 -34
  102. package/esm/internals/storeList.js +0 -108
  103. package/esm/internals/theme.d.ts +0 -4
  104. package/esm/internals/theme.js +0 -4
  105. package/esm/server/index.d.ts +0 -52
  106. package/esm/server/index.js +0 -87
  107. package/esm/svelte/FF_Cell.svelte +0 -103
  108. package/esm/svelte/FF_Cell.svelte.d.ts +0 -33
  109. package/esm/svelte/FF_Cell_Caption.svelte +0 -20
  110. package/esm/svelte/FF_Cell_Caption.svelte.d.ts +0 -31
  111. package/esm/svelte/FF_Cell_Display.svelte +0 -61
  112. package/esm/svelte/FF_Cell_Display.svelte.d.ts +0 -29
  113. package/esm/svelte/FF_Cell_Edit.svelte +0 -104
  114. package/esm/svelte/FF_Cell_Edit.svelte.d.ts +0 -32
  115. package/esm/svelte/FF_Cell_Error.svelte +0 -20
  116. package/esm/svelte/FF_Cell_Error.svelte.d.ts +0 -31
  117. package/esm/svelte/FF_Cell_Hint.svelte +0 -20
  118. package/esm/svelte/FF_Cell_Hint.svelte.d.ts +0 -31
  119. package/esm/svelte/FF_Config.svelte +0 -29
  120. package/esm/svelte/FF_Config.svelte.d.ts +0 -9
  121. package/esm/svelte/FF_Form.svelte +0 -155
  122. package/esm/svelte/FF_Form.svelte.d.ts +0 -37
  123. package/esm/svelte/FF_Grid.svelte +0 -257
  124. package/esm/svelte/FF_Grid.svelte.d.ts +0 -37
  125. package/esm/svelte/FF_Layout.svelte +0 -62
  126. package/esm/svelte/FF_Layout.svelte.d.ts +0 -31
  127. package/esm/svelte/actions/intersection.d.ts +0 -6
  128. package/esm/svelte/actions/intersection.js +0 -17
  129. package/esm/svelte/customField.d.ts +0 -69
  130. package/esm/svelte/customField.js +0 -4
  131. package/esm/svelte/dialog/DialogManagement.svelte +0 -98
  132. package/esm/svelte/dialog/DialogManagement.svelte.d.ts +0 -18
  133. package/esm/svelte/dialog/DialogPrimitive.svelte +0 -156
  134. package/esm/svelte/dialog/DialogPrimitive.svelte.d.ts +0 -38
  135. package/esm/svelte/dialog/dialog.d.ts +0 -58
  136. package/esm/svelte/dialog/dialog.js +0 -130
  137. package/esm/svelte/ff_Config.svelte.d.ts +0 -91
  138. package/esm/svelte/ff_Config.svelte.js +0 -111
  139. package/esm/svelte/firstly.css +0 -14
  140. package/esm/svelte/helpers.d.ts +0 -30
  141. package/esm/svelte/helpers.js +0 -38
  142. package/esm/svelte/tryCatch.d.ts +0 -12
  143. package/esm/svelte/tryCatch.js +0 -18
  144. package/esm/sveltekit/server/index.d.ts +0 -5
  145. package/esm/sveltekit/server/index.js +0 -24
  146. package/esm/ui/Button.svelte +0 -138
  147. package/esm/ui/Button.svelte.d.ts +0 -13
  148. package/esm/ui/Clipboardable.svelte +0 -25
  149. package/esm/ui/Clipboardable.svelte.d.ts +0 -12
  150. package/esm/ui/Field.svelte +0 -382
  151. package/esm/ui/Field.svelte.d.ts +0 -40
  152. package/esm/ui/FieldGroup.svelte +0 -117
  153. package/esm/ui/FieldGroup.svelte.d.ts +0 -44
  154. package/esm/ui/Grid.svelte +0 -265
  155. package/esm/ui/Grid.svelte.d.ts +0 -57
  156. package/esm/ui/Grid2.svelte +0 -293
  157. package/esm/ui/Grid2.svelte.d.ts +0 -57
  158. package/esm/ui/GridLoading.svelte +0 -58
  159. package/esm/ui/GridLoading.svelte.d.ts +0 -23
  160. package/esm/ui/GridPaginate.svelte +0 -69
  161. package/esm/ui/GridPaginate.svelte.d.ts +0 -23
  162. package/esm/ui/GridPaginate2.svelte +0 -25
  163. package/esm/ui/GridPaginate2.svelte.d.ts +0 -7
  164. package/esm/ui/Loading.svelte +0 -16
  165. package/esm/ui/Loading.svelte.d.ts +0 -31
  166. package/esm/ui/Tooltip.svelte +0 -45
  167. package/esm/ui/Tooltip.svelte.d.ts +0 -32
  168. package/esm/ui/dialog/DialogForm.svelte +0 -76
  169. package/esm/ui/dialog/DialogForm.svelte.d.ts +0 -21
  170. package/esm/ui/dialog/DialogManagement.svelte +0 -96
  171. package/esm/ui/dialog/DialogManagement.svelte.d.ts +0 -26
  172. package/esm/ui/dialog/DialogPrimitive.svelte +0 -90
  173. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +0 -38
  174. package/esm/ui/dialog/FormEditAction.svelte +0 -62
  175. package/esm/ui/dialog/FormEditAction.svelte.d.ts +0 -31
  176. package/esm/ui/dialog/dialog.d.ts +0 -60
  177. package/esm/ui/dialog/dialog.js +0 -100
  178. package/esm/ui/index.d.ts +0 -6
  179. package/esm/ui/index.js +0 -20
  180. package/esm/ui/internals/FieldContainer.svelte +0 -39
  181. package/esm/ui/internals/FieldContainer.svelte.d.ts +0 -18
  182. package/esm/ui/internals/Input.svelte +0 -143
  183. package/esm/ui/internals/Input.svelte.d.ts +0 -37
  184. package/esm/ui/internals/Textarea.svelte +0 -66
  185. package/esm/ui/internals/Textarea.svelte.d.ts +0 -33
  186. package/esm/ui/internals/select/MultiSelectMelt.svelte +0 -260
  187. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +0 -32
  188. package/esm/ui/internals/select/Select2.svelte +0 -88
  189. package/esm/ui/internals/select/Select2.svelte.d.ts +0 -12
  190. package/esm/ui/internals/select/SelectMelt.svelte +0 -280
  191. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +0 -40
  192. package/esm/ui/internals/select/SelectRadio.svelte +0 -43
  193. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +0 -27
  194. package/esm/ui/link/Link.svelte +0 -33
  195. package/esm/ui/link/Link.svelte.d.ts +0 -33
  196. package/esm/ui/link/LinkPlus.svelte +0 -63
  197. package/esm/ui/link/LinkPlus.svelte.d.ts +0 -9
  198. package/esm/utils/tailwind.d.ts +0 -2
  199. package/esm/utils/tailwind.js +0 -3
  200. package/esm/utils/transition.d.ts +0 -9
  201. package/esm/utils/transition.js +0 -33
  202. package/esm/utils/types.js +0 -1
  203. /package/esm/{internals → core}/BaseEnum.js +0 -0
  204. /package/esm/{internals → core}/common.d.ts +0 -0
  205. /package/esm/{internals → core}/common.js +0 -0
  206. /package/esm/{utils → core}/types.d.ts +0 -0
  207. /package/esm/{auth → core}/types.js +0 -0
  208. /package/esm/{ui → svelte/ui}/Icon.svelte.d.ts +0 -0
  209. /package/esm/{ui → svelte/ui}/LibIcon.d.ts +0 -0
  210. /package/esm/{ui → svelte/ui}/LibIcon.js +0 -0
@@ -1,149 +0,0 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte'
3
-
4
- import { repo } from 'remult'
5
-
6
- import { page } from '$app/stores'
7
-
8
- import { FeedbackController } from '..'
9
- import {
10
- Button,
11
- cellBuildor,
12
- Field,
13
- FilterEntity,
14
- Loading,
15
- type ResolvedType,
16
- } from '../../internals'
17
- import Textarea from '../../ui/internals/Textarea.svelte'
18
-
19
- export let dialogId: number
20
- const rmvWarning = dialogId
21
-
22
- export let milestoneId: string
23
- export let issueNumber: number | null
24
-
25
- let state: 'loading' | 'done' = 'loading'
26
-
27
- let issue: ResolvedType<ReturnType<typeof FeedbackController.getIssue>> | undefined
28
-
29
- const update = async () => {
30
- state = 'loading'
31
- if (issueNumber) {
32
- issue = await FeedbackController.getIssue(issueNumber)
33
- }
34
- state = 'done'
35
- }
36
-
37
- onMount(async () => {
38
- await update()
39
- })
40
-
41
- let title: ''
42
- let content: ''
43
- const send = async () => {
44
- state = 'loading'
45
-
46
- const p = $page.url.pathname + $page.url.search
47
- if (!issue?.id) {
48
- const result = await FeedbackController.createIssue(milestoneId, title, content, { page: p })
49
- issueNumber = result.number
50
- } else {
51
- await FeedbackController.addCommentOnIssue(
52
- issue.id,
53
- issueNumber!,
54
- issue.title,
55
- content,
56
- { page: p },
57
- issue.labels,
58
- )
59
- }
60
-
61
- content = ''
62
- await update()
63
- state = 'done'
64
- }
65
-
66
- const close = async () => {
67
- state = 'loading'
68
- await FeedbackController.close(issue!.id, issue!.labels)
69
- content = ''
70
- await update()
71
- state = 'done'
72
- }
73
-
74
- const reOpen = async () => {
75
- state = 'loading'
76
- await FeedbackController.reOpen(issue!.id)
77
- content = ''
78
- await update()
79
- state = 'done'
80
- }
81
-
82
- const disableButton = (issueNumber: number | null, title: string, content: string) => {
83
- if (issueNumber) {
84
- if (content?.length > 2) {
85
- return false
86
- }
87
- }
88
- if (title?.length > 2 && content?.length > 2) {
89
- return false
90
- }
91
- return true
92
- }
93
- </script>
94
-
95
- <div class="mb-4 grid gap-4">
96
- {#if state === 'loading'}
97
- <Loading class="h-12"></Loading>
98
- <Loading class="h-12"></Loading>
99
- <Loading class="h-12"></Loading>
100
- {:else}
101
- {#each issue?.items ?? [] as item}
102
- <div class="chat {item.who ? 'chat-start' : 'chat-end'}">
103
- <div class="avatar chat-image">
104
- <div class="w-10 rounded-full">
105
- <div class="h-10 w-10 {item.who ? 'bg-primary' : 'bg-secondary'}"></div>
106
- </div>
107
- </div>
108
- <div class="chat-header">
109
- {item.who ?? 'Support'}
110
- <time class="text-xs opacity-50"
111
- >{new Date(item.createdAt).toLocaleDateString()} - {new Date(
112
- item.createdAt,
113
- ).toLocaleTimeString()}</time
114
- >
115
- </div>
116
- <div class="chat-bubble prose">{@html item.bodyHTML}</div>
117
- <!-- <div class="chat-footer opacity-50">Delivered</div> -->
118
- </div>
119
- {/each}
120
- {#if issue?.highlight && issue.state === 'OPEN'}
121
- <span class="badge badge-warning">En attente de réponse de TA part 😉, oui 🫵!</span>
122
- {/if}
123
- {#if issueNumber}
124
- <button on:click={update} aria-label="Actualiser" class="divider"></button>
125
- {/if}
126
-
127
- {#if issue?.state === 'CLOSED'}
128
- <div class="flex justify-end">
129
- <Button onclick={reOpen} class="btn-neutral">Re Ouvrir</Button>
130
- </div>
131
- {:else}
132
- {#if issueNumber === null}
133
- <Field cell={cellBuildor(repo(FilterEntity), 'title')} bind:value={title} />
134
- {/if}
135
- <Textarea
136
- bind:value={content}
137
- placeholder="Un peu de détail c'est pas mal... Fais toi Plaiz' (Tu as même le droit d'utiliser le format markdown!)"
138
- ></Textarea>
139
- <div class="flex justify-between">
140
- {#if issueNumber}
141
- <Button onclick={close} tabindex={-1} class="btn-error">Clore le feedback</Button>
142
- {:else}
143
- <div></div>
144
- {/if}
145
- <Button onclick={send} disabled={disableButton(issueNumber, title, content)}>Envoyer</Button>
146
- </div>
147
- {/if}
148
- {/if}
149
- </div>
@@ -1,22 +0,0 @@
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;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const DialogIssue: $$__sveltets_2_IsomorphicComponent<{
15
- dialogId: number;
16
- milestoneId: string;
17
- issueNumber: number | null;
18
- }, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type DialogIssue = InstanceType<typeof DialogIssue>;
22
- export default DialogIssue;
@@ -1,114 +0,0 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte'
3
-
4
- import { FeedbackController } from '..'
5
- import {
6
- Button,
7
- dialog,
8
- Icon,
9
- LibIcon_Add,
10
- LibIcon_Check,
11
- LibIcon_Search,
12
- Loading,
13
- type ResolvedType,
14
- } from '../../internals'
15
- import DialogIssue from './DialogIssue.svelte'
16
-
17
- export let dialogId: number
18
- const rmvWarning = dialogId
19
-
20
- export let milestoneNumber: number
21
- export let milestoneId: string
22
-
23
- let state: 'loading' | 'done' = 'loading'
24
- let issueState: 'OPEN' | 'CLOSED' = 'OPEN'
25
-
26
- let issues: ResolvedType<ReturnType<typeof FeedbackController.getIssues>> = []
27
-
28
- const update = async (_issueState: 'OPEN' | 'CLOSED') => {
29
- issueState = _issueState
30
- state = 'loading'
31
- issues = await FeedbackController.getIssues(milestoneNumber, issueState)
32
- state = 'done'
33
- }
34
-
35
- onMount(async () => {
36
- await update(issueState)
37
- })
38
- </script>
39
-
40
- <div class="mb-4 grid gap-4">
41
- <div class="flex justify-between">
42
- <div>
43
- <Button
44
- class={issueState === 'OPEN' ? 'btn-primary' : 'btn-ghost'}
45
- onclick={() => update('OPEN')}>En cours</Button
46
- >
47
- <Button
48
- class={issueState === 'CLOSED' ? 'btn-primary' : 'btn-ghost'}
49
- onclick={() => update('CLOSED')}>Clos</Button
50
- >
51
- </div>
52
-
53
- <Button
54
- onclick={async () => {
55
- await dialog.show({
56
- component: DialogIssue,
57
- classes: { root: 'overflow-auto w-[80vh] h-[80vh]' },
58
- props: { issueNumber: null, milestoneId },
59
- detail: {
60
- caption: 'Nouveau Feedback',
61
- icon: { data: LibIcon_Search },
62
- },
63
- })
64
- await update(issueState)
65
- }}
66
- >
67
- <Icon data={LibIcon_Add}></Icon>
68
- </Button>
69
- </div>
70
-
71
- {#each issues as issue}
72
- <Button
73
- onclick={async () => {
74
- await dialog.show({
75
- component: DialogIssue,
76
- classes: { root: 'overflow-auto w-[80vh] h-[80vh]' },
77
- props: { issueNumber: issue.number, milestoneId },
78
- detail: {
79
- caption: '#' + issue.number + ' - ' + issue.titleHTML,
80
- icon: { data: issue.state === 'OPEN' ? LibIcon_Search : LibIcon_Check },
81
- },
82
- })
83
- await update(issueState)
84
- }}
85
- class="btn-neutral"
86
- >
87
- <div class="flex w-full justify-center justify-items-center text-left">
88
- <div class="flex-grow">
89
- <span class="mr-2 inline-block w-8 text-right text-xs text-base-content/60 italic"
90
- >#{issue.number}</span
91
- >
92
- {@html issue.titleHTML}
93
- </div>
94
- {#if issue.highlight}
95
- <span class="badge badge-warning">En attente de réponse</span>
96
- {/if}
97
- </div>
98
- </Button>
99
- {:else}
100
- {#if state === 'loading'}
101
- <Loading class="h-12"></Loading>
102
- <Loading class="h-12"></Loading>
103
- <Loading class="h-12"></Loading>
104
- {:else}
105
- <div class="flex flex-col items-center justify-center p-8 text-center text-gray-500">
106
- <div class="mb-4">
107
- <Icon data={LibIcon_Search} size="4rem"></Icon>
108
- </div>
109
- <p class="text-lg font-medium">Aucun feedback <b>{issueState}</b> pour le moment</p>
110
- <p class="mt-2 text-sm">Soyez le premier à donner votre avis sur cette version !</p>
111
- </div>
112
- {/if}
113
- {/each}
114
- </div>
@@ -1,22 +0,0 @@
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;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const DialogIssues: $$__sveltets_2_IsomorphicComponent<{
15
- dialogId: number;
16
- milestoneNumber: number;
17
- milestoneId: string;
18
- }, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type DialogIssues = InstanceType<typeof DialogIssues>;
22
- export default DialogIssues;
@@ -1,43 +0,0 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte'
3
-
4
- import { FeedbackController } from '../../feedback/FeedbackController'
5
- import { Button, dialog, Loading, type ResolvedType } from '../../internals'
6
- import DialogIssues from './DialogIssues.svelte'
7
-
8
- export let dialogId: number
9
- const rmvWarning = dialogId
10
-
11
- let state: 'loading' | 'done' = 'loading'
12
-
13
- let milestones: ResolvedType<ReturnType<typeof FeedbackController.getMilestones>> = []
14
- onMount(async () => {
15
- milestones = await FeedbackController.getMilestones()
16
- state = 'done'
17
- })
18
- </script>
19
-
20
- <div class="mb-4 grid gap-4">
21
- {#each milestones as milestone}
22
- <Button
23
- onclick={() =>
24
- dialog.show({
25
- component: DialogIssues,
26
- classes: { root: 'overflow-auto w-[85vh] h-[85vh]' },
27
- props: { milestoneNumber: milestone.number, milestoneId: milestone.id },
28
- detail: { caption: milestone.title },
29
- })}
30
- class="btn-neutral"
31
- >
32
- {milestone.title}
33
- </Button>
34
- {:else}
35
- {#if state === 'loading'}
36
- <Loading class="h-12"></Loading>
37
- <Loading class="h-12"></Loading>
38
- <Loading class="h-12"></Loading>
39
- {:else}
40
- <p>No milestones found / Filter too strict!</p>
41
- {/if}
42
- {/each}
43
- </div>
@@ -1,20 +0,0 @@
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;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const DialogMilestones: $$__sveltets_2_IsomorphicComponent<{
15
- dialogId: number;
16
- }, {
17
- [evt: string]: CustomEvent<any>;
18
- }, {}, {}, string>;
19
- type DialogMilestones = InstanceType<typeof DialogMilestones>;
20
- export default DialogMilestones;
@@ -1,16 +0,0 @@
1
- <script lang="ts">
2
- import { dialog } from '../../internals'
3
- import DialogMilestones from './DialogMilestones.svelte'
4
-
5
- const list = async () => {
6
- await dialog.show({
7
- component: DialogMilestones,
8
- classes: { root: 'overflow-auto w-[90vh] h-[90vh]' },
9
- detail: { caption: 'Feedback' },
10
- })
11
- }
12
- </script>
13
-
14
- <button class="text-secondary" on:click={list}>Feedback</button>
15
-
16
- <!-- <span class="h-9/12 hidden w-9/12"></span> -->
@@ -1,18 +0,0 @@
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;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
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;
@@ -1,2 +0,0 @@
1
- import { type EntityOptions } from 'remult';
2
- export declare function FF_Entity<entityType>(key: string, options?: EntityOptions<entityType extends new (...args: any) => any ? InstanceType<entityType> : entityType>): (target: any, info?: import("remult/src/remult3/remult3").ClassDecoratorContextStub<entityType extends infer T ? T extends entityType ? T extends new (...args: any) => any ? entityType : never : never : never> | undefined) => any;
@@ -1,21 +0,0 @@
1
- import { Entity } from 'remult';
2
- import { withChangeLog } from '../changeLog';
3
- const toAllow = (permission) => {
4
- if (permission) {
5
- if (Array.isArray(permission)) {
6
- return permission.map((p) => p.id);
7
- }
8
- return permission.id;
9
- }
10
- return undefined;
11
- };
12
- export function FF_Entity(key, options) {
13
- return Entity(key, withChangeLog({
14
- ...options,
15
- allowApiCrud: options?.allowApiCrud ?? toAllow(options?.permissionApiCrud),
16
- allowApiDelete: options?.allowApiDelete ?? toAllow(options?.permissionApiDelete),
17
- allowApiInsert: options?.allowApiInsert ?? toAllow(options?.permissionApiInsert),
18
- allowApiRead: options?.allowApiRead ?? toAllow(options?.permissionApiRead),
19
- allowApiUpdate: options?.allowApiUpdate ?? toAllow(options?.permissionApiUpdate),
20
- }));
21
- }
@@ -1,11 +0,0 @@
1
- import { type ClassType, type FieldOptions } from 'remult';
2
- import type { BaseEnum } from './BaseEnum';
3
- export declare class FF_Fields {
4
- static currency<entityType = unknown>(o?: FieldOptions<entityType, number>): import("remult").ClassFieldDecorator<entityType, number | undefined>;
5
- static arrayEnum<enumType = any, entityType = any>(enumClass: enumType, o?: FieldOptions<entityType, any[]>): import("remult").ClassFieldDecorator<entityType, any[] | undefined>;
6
- static arrayEnumToGql<enumType = any, entityType = any>(enumClass: enumType, o?: FieldOptions<entityType, any[]>): import("remult").ClassFieldDecorator<entityType, any[] | undefined>;
7
- static arrayValueList<enumType = any, entityType = any>(enumClass: ClassType<BaseEnum<any>>, o?: FieldOptions<entityType, any[]>): import("remult").ClassFieldDecorator<entityType, any[] | undefined>;
8
- static vector32<entityType = unknown>(...options: (FieldOptions<entityType, number[]> & {
9
- dimensions?: number;
10
- })[]): import("remult").ClassFieldDecorator<entityType, number[] | undefined>;
11
- }
@@ -1,144 +0,0 @@
1
- import { Fields, Validators } from 'remult';
2
- import { displayCurrency } from '../formats';
3
- import { getEnums } from './helper';
4
- // Translate default messages
5
- // REMULT P3 JYC: I need to set this here the one of my app are not overwriting these...
6
- // It look like I have 2 remult loaded... But even trying to remove one, I still have the issue
7
- Validators.unique.defaultMessage = 'Existe déjà!';
8
- Validators.required.defaultMessage = 'Obligatoire!';
9
- export class FF_Fields {
10
- static currency(o) {
11
- // let's return the field
12
- return Fields.number({
13
- ...o,
14
- step: '0.01',
15
- suffix: undefined,
16
- suffixEdit: '€',
17
- inputType: 'number',
18
- displayValue: displayCurrency,
19
- valueConverter: {
20
- toInput(val, inputType) {
21
- const valStr = String(val);
22
- if (valStr.includes('.')) {
23
- const [left, right] = valStr.split('.');
24
- // Take only the 2 first digits after the dot
25
- return `${left}.${right.slice(0, 2)}`;
26
- }
27
- return valStr;
28
- },
29
- fromDb(val) {
30
- if (val) {
31
- return parseFloat(val.toString());
32
- }
33
- return val;
34
- },
35
- },
36
- });
37
- }
38
- static arrayEnum(enumClass, o) {
39
- return Fields.json(() => Array, {
40
- ...o,
41
- inputType: 'selectArrayEnum',
42
- allowNull: false,
43
- valueConverter: {
44
- fromDb: (v) => {
45
- if (!v)
46
- return [];
47
- const keys = v
48
- .slice(1, -1)
49
- .split(',')
50
- .map((s) => {
51
- // @ts-ignore
52
- return enumClass[s];
53
- })
54
- .filter((p) => p !== undefined);
55
- return keys;
56
- },
57
- toDb: (v) => {
58
- const arr = Array.isArray(v) ? v : [v];
59
- return `{${[...new Set((arr ?? []).map((c) => c.id))].join(',')}}`;
60
- },
61
- displayValue: (v) => {
62
- return v.map((c) => c.caption).join(', ');
63
- },
64
- // REMULT P2 Noam: how to do this in an official way?
65
- // @ts-ignore
66
- values: getEnums(enumClass),
67
- },
68
- });
69
- }
70
- static arrayEnumToGql(enumClass, o) {
71
- return Fields.json(() => Array, {
72
- ...o,
73
- inputType: 'selectArrayEnum',
74
- allowNull: false,
75
- valueConverter: {
76
- fromDb: (v) => {
77
- if (!v)
78
- return [];
79
- const keys = v.slice(1, -1).split(',');
80
- return keys;
81
- },
82
- toDb: (v) => {
83
- const arr = Array.isArray(v) ? v : [v];
84
- return `{${[...new Set((arr ?? []).map((c) => c.id))].join(',')}}`;
85
- },
86
- displayValue: (v) => {
87
- return v.map((c) => c.caption).join(', ');
88
- },
89
- // REMULT P2 Noam: how to do this in an official way?
90
- // @ts-ignore
91
- values: getEnums(enumClass),
92
- },
93
- });
94
- }
95
- static arrayValueList(enumClass, o) {
96
- return Fields.json(() => Array, {
97
- ...o,
98
- inputType: 'selectArrayEnum',
99
- allowNull: false,
100
- valueConverter: {
101
- fromDb: (v) => {
102
- if (!v)
103
- return [];
104
- const arr = Array.isArray(v)
105
- ? v
106
- : v?.split(',').flatMap((c) => c.replaceAll('{', '').replaceAll('}', ''));
107
- const list = getEnums(enumClass);
108
- const toRet = [];
109
- for (const s of arr) {
110
- const found = list.find((c) => c.id === s);
111
- if (found) {
112
- toRet.push(found);
113
- }
114
- }
115
- return toRet;
116
- },
117
- toDb: (v) => {
118
- const arr = Array.isArray(v) ? v : [v];
119
- return `{${[...new Set((arr.filter((c) => c !== undefined) ?? []).map((c) => c.id))].join(',')}}`;
120
- },
121
- displayValue: (v) => {
122
- // Nice to have a oneLiner, but if you want custom style, just take the array and do what you want
123
- return v.map((c) => c.caption).join(', ');
124
- },
125
- // REMULT P2 Noam: how to do this in an official way?
126
- // @ts-ignore
127
- values: getEnums(enumClass),
128
- },
129
- });
130
- }
131
- static vector32(...options) {
132
- const dimensions = options[0].dimensions ?? 1024;
133
- return Fields.object({
134
- valueConverter: {
135
- fieldTypeInDb: `F32_BLOB(${dimensions})`,
136
- toDb: (val) => JSON.stringify(val),
137
- // TODO: remove ts-ignore when remult@3.3.0-next.1 is released (that has toDbSql)
138
- // @ts-ignore
139
- toDbSql: (val) => `vector32(${val})`,
140
- fromDb: (val) => Array.from(new Float32Array(val)),
141
- },
142
- }, ...options);
143
- }
144
- }
@@ -1,47 +0,0 @@
1
- import type { Component, SvelteComponent } from 'svelte';
2
- import { type ClassType, type EntityFilter, type FieldMetadata, type Repository } from 'remult';
3
- import type { UnArray } from '../utils/types.js';
4
- export type VisibilityMode = 'view' | 'edit' | 'hide';
5
- type CellInternal<Entity> = {
6
- col?: keyof Entity;
7
- kind?: 'field' | 'field_link' | 'entity_link' | 'slot' | 'header' | 'component' | 'baseItem';
8
- class?: string;
9
- header?: string;
10
- headerSlot?: boolean;
11
- modeEdit?: VisibilityMode;
12
- modeView?: VisibilityMode;
13
- clipboardable?: boolean;
14
- clearable?: boolean;
15
- component?: new (...args: any[]) => SvelteComponent;
16
- componentS5?: Component;
17
- props?: any;
18
- rowToProps?: (row: any) => any;
19
- };
20
- export type Cell<Entity> = CellInternal<Entity> & {
21
- field?: FieldMetadata<any, Entity>;
22
- };
23
- export type CellsInput<Entity> = (keyof Entity | CellInternal<Entity>)[];
24
- /**
25
- * cellsBuildor is a function to build cells for a <Grid /> or <FieldGroup /> component.
26
- *
27
- * ```html
28
- * <script lang="ts">
29
- * import { repo } from 'remult'
30
- *
31
- * const cells = cellsBuildor(repo(Site), ['name', 'description'])
32
- * const store = storeList( repo(Site) )
33
- * $: store.fetch()
34
- * </script>
35
- *
36
- * <Grid {cells} {store} />
37
- * ```
38
- *
39
- */
40
- export declare function cellsBuildor<Entity>(repo: Repository<Entity>, inputBuildor: CellsInput<Entity>): Cell<Entity>[];
41
- export declare function cellBuildor<Entity>(repo: Repository<Entity>, inputBuildor: UnArray<CellsInput<Entity>>): Cell<Entity>;
42
- export declare const fieldsOf: <Entity>(b: Cell<Entity>[]) => FieldMetadata<any, Entity>[];
43
- export declare const getPlaceholder: <Entity>(fields: FieldMetadata<any, Entity>[]) => string;
44
- export declare const buildSearchWhere: <Entity>(entity: ClassType<Entity> | undefined, fields: FieldMetadata<any, Entity>[], search?: string | null) => EntityFilter<Entity>[];
45
- export declare const containsWords: <Entity>(fields: FieldMetadata<any, Entity>[], search: string) => EntityFilter<Entity>;
46
- export declare const buildWhere: <Entity>(entity: ClassType<Entity> | undefined, defaultWhere: EntityFilter<Entity> | undefined, fields_filter: FieldMetadata<any, Entity>[], fields_search: FieldMetadata<any, Entity>[], obj: Record<string, string>) => EntityFilter<Entity>;
47
- export {};