firstly 0.0.8 → 0.0.10

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 (63) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/esm/BaseEnum.d.ts +3 -14
  3. package/esm/BaseEnum.js +0 -4
  4. package/esm/FF_Entity.d.ts +1 -1
  5. package/esm/FF_Entity.js +7 -3
  6. package/esm/ROUTES.d.ts +2 -2
  7. package/esm/api/index.d.ts +2 -3
  8. package/esm/api/index.js +4 -4
  9. package/esm/auth/RoleHelpers.d.ts +1 -1
  10. package/esm/auth/RoleHelpers.js +5 -3
  11. package/esm/auth/client/Auth.js +2 -2
  12. package/esm/auth/client/Entities.d.ts +2 -2
  13. package/esm/auth/client/Entities.js +5 -5
  14. package/esm/auth/client/index.d.ts +1 -1
  15. package/esm/auth/client/index.js +1 -1
  16. package/esm/auth/index.d.ts +2 -0
  17. package/esm/auth/index.js +23 -12
  18. package/esm/cellsBuildor.d.ts +4 -4
  19. package/esm/cellsBuildor.js +19 -6
  20. package/esm/feedback/FeedbackController.d.ts +1 -1
  21. package/esm/feedback/FeedbackController.js +0 -2
  22. package/esm/feedback/ui/DialogIssue.svelte +8 -8
  23. package/esm/handle/index.d.ts +0 -1
  24. package/esm/helper.d.ts +16 -14
  25. package/esm/helper.js +58 -2
  26. package/esm/index.d.ts +7 -3
  27. package/esm/index.js +1 -1
  28. package/esm/mail/index.js +15 -10
  29. package/esm/mail/templates/DefaultMail.svelte.d.ts +3 -3
  30. package/esm/storeItem.d.ts +1 -2
  31. package/esm/storeList.d.ts +4 -3
  32. package/esm/storeList.js +20 -10
  33. package/esm/ui/Clipboardable.svelte.d.ts +1 -1
  34. package/esm/ui/Field.svelte +9 -3
  35. package/esm/ui/Field.svelte.d.ts +3 -2
  36. package/esm/ui/FieldGroup.svelte +4 -2
  37. package/esm/ui/FieldGroup.svelte.d.ts +1 -1
  38. package/esm/ui/Grid.svelte +90 -20
  39. package/esm/ui/Grid.svelte.d.ts +6 -5
  40. package/esm/ui/GridLoading.svelte.d.ts +1 -1
  41. package/esm/ui/GridPaginate.svelte +6 -4
  42. package/esm/ui/GridPaginate.svelte.d.ts +2 -2
  43. package/esm/ui/Icon.svelte.d.ts +3 -3
  44. package/esm/ui/Loading.svelte.d.ts +1 -1
  45. package/esm/ui/Tooltip.svelte.d.ts +2 -2
  46. package/esm/ui/dialog/DialogPrimitive.svelte +1 -5
  47. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +3 -3
  48. package/esm/ui/dialog/dialog.d.ts +10 -8
  49. package/esm/ui/dialog/dialog.js +9 -10
  50. package/esm/ui/internals/FieldContainer.svelte.d.ts +6 -6
  51. package/esm/ui/internals/Input.svelte +10 -1
  52. package/esm/ui/internals/Input.svelte.d.ts +1 -1
  53. package/esm/ui/internals/Textarea.svelte.d.ts +2 -2
  54. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +4 -4
  55. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +7 -7
  56. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +3 -3
  57. package/esm/ui/link/Link.svelte +1 -1
  58. package/esm/ui/link/Link.svelte.d.ts +2 -2
  59. package/esm/ui/link/LinkPlus.svelte +41 -29
  60. package/esm/ui/link/LinkPlus.svelte.d.ts +2 -2
  61. package/esm/utils/transition.d.ts +0 -1
  62. package/esm/vite/index.js +2 -0
  63. package/package.json +3 -3
@@ -42,10 +42,9 @@ const createDialogManagement = () => {
42
42
  };
43
43
  return show(detail, 'confirmDelete');
44
44
  },
45
- // FIXME JYC: refactor this (no need repo? options?)
46
- form: (type, topic, repo, cells, options) => {
47
- const topicPrefixText = options?.topicPrefixText
48
- ? options?.topicPrefixText + ' '
45
+ form: (type, topic, repo, settings) => {
46
+ const topicPrefixText = settings?.topicPrefixText
47
+ ? settings?.topicPrefixText + ' '
49
48
  : type === 'insert'
50
49
  ? `Créer `
51
50
  : type === 'update'
@@ -60,12 +59,12 @@ const createDialogManagement = () => {
60
59
  },
61
60
  repo,
62
61
  // store,
63
- cells,
64
- defaults: options?.defaults,
65
- classes: options?.classes,
66
- noThrow: options?.noThrow,
67
- wDelete: options?.wDelete,
68
- focusKey: options?.focusKey,
62
+ cells: settings.cells ?? [],
63
+ defaults: settings?.defaults,
64
+ classes: settings?.classes,
65
+ noThrow: settings?.noThrow,
66
+ wDelete: settings?.wDelete,
67
+ focusKey: settings?.focusKey,
69
68
  topicPrefixText,
70
69
  };
71
70
  return show(detail, type);
@@ -1,17 +1,17 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- label?: string | undefined;
4
+ label?: string;
5
5
  forId: string;
6
- required?: boolean | undefined;
7
- error?: string | undefined;
6
+ required?: boolean;
7
+ error?: string;
8
8
  /**
9
9
  * example usage for paginate
10
10
  * classes={{ label: 'justify-end' }}
11
11
  */ classes?: {
12
- label?: string | undefined;
13
- slot?: string | undefined;
14
- } | undefined;
12
+ label?: string;
13
+ slot?: string;
14
+ };
15
15
  };
16
16
  events: {
17
17
  [evt: string]: CustomEvent<any>;
@@ -20,7 +20,7 @@ const debounce = (fn) => {
20
20
  };
21
21
  function dispatchInput(value2) {
22
22
  if ($$restProps.type === "date") {
23
- if (value2) {
23
+ if (value2 || value2 === null) {
24
24
  dispatch("input", { value: transformDate(value2) });
25
25
  }
26
26
  } else {
@@ -37,6 +37,12 @@ const handleInput = (e) => {
37
37
  } else {
38
38
  value = target.value.toString().replaceAll(",", ".");
39
39
  }
40
+ } else if ($$restProps.type === "date") {
41
+ if (target.value === "") {
42
+ value = null;
43
+ } else {
44
+ value = target.value;
45
+ }
40
46
  } else {
41
47
  value = target.value;
42
48
  }
@@ -49,6 +55,9 @@ const handleInput = (e) => {
49
55
  }
50
56
  };
51
57
  const transformDate = (input) => {
58
+ if (input === null) {
59
+ return null;
60
+ }
52
61
  const rawDateSplited = input.split("-");
53
62
  if (rawDateSplited.length === 3) {
54
63
  const yearSplited = rawDateSplited[0].split("");
@@ -3,7 +3,7 @@ import type { HTMLInputAttributes } from 'svelte/elements';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
- value?: HTMLInputAttributes['value'];
6
+ value?: HTMLInputAttributes["value"];
7
7
  focus?: boolean | undefined;
8
8
  withDedounce?: boolean | undefined;
9
9
  class?: string | undefined | null;
@@ -2,7 +2,7 @@ import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
- name?: string | null | undefined;
5
+ name?: (string | null) | undefined;
6
6
  id?: string | undefined;
7
7
  rows?: number | undefined;
8
8
  placeholder?: string | undefined;
@@ -10,7 +10,7 @@ declare const __propDef: {
10
10
  value?: string | undefined;
11
11
  readonly?: boolean | undefined;
12
12
  error?: false | undefined;
13
- align?: "left" | "right" | undefined;
13
+ align?: (`left` | `right`) | undefined;
14
14
  };
15
15
  events: {
16
16
  input: CustomEvent<any>;
@@ -3,15 +3,15 @@ import { type BaseItem } from '../../..';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
- disabled?: boolean | undefined;
7
- placeholder?: string | undefined;
8
- items?: BaseItem[] | undefined;
6
+ disabled?: boolean;
7
+ placeholder?: string;
8
+ items?: BaseItem[];
9
9
  loadOptions?: ((str: string) => Promise<{
10
10
  items: BaseItem[];
11
11
  totalCount: number;
12
12
  }>) | undefined;
13
13
  values?: string[] | undefined;
14
- clearable?: boolean | undefined;
14
+ clearable?: boolean;
15
15
  };
16
16
  events: {
17
17
  selected: CustomEvent<any>;
@@ -3,18 +3,18 @@ import { type BaseItem } from '../../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
- disabled?: boolean | undefined;
7
- placeholder?: string | undefined;
8
- items?: BaseItem[] | undefined;
9
- focus?: boolean | undefined;
6
+ disabled?: boolean;
7
+ placeholder?: string;
8
+ items?: BaseItem[];
9
+ focus?: boolean;
10
10
  loadOptions?: ((str: string) => Promise<{
11
11
  items: BaseItem[];
12
12
  totalCount: number;
13
13
  }>) | undefined;
14
14
  value?: string | undefined;
15
- clearable?: boolean | undefined;
16
- createOptionWhenNoResult?: boolean | undefined;
17
- default_select_if_one_item?: boolean | undefined;
15
+ clearable?: boolean;
16
+ createOptionWhenNoResult?: boolean;
17
+ default_select_if_one_item?: boolean;
18
18
  };
19
19
  events: {
20
20
  selected: CustomEvent<any>;
@@ -3,9 +3,9 @@ import type { BaseItem } from '../../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
- disabled?: boolean | undefined;
7
- placeholder?: string | undefined;
8
- items?: BaseItem[] | undefined;
6
+ disabled?: boolean;
7
+ placeholder?: string;
8
+ items?: BaseItem[];
9
9
  value?: string | number | undefined;
10
10
  };
11
11
  events: {
@@ -7,7 +7,7 @@ export { className as class };
7
7
  </script>
8
8
 
9
9
  <a
10
- class={`${daisy[kind]} link no-underline hover:underline ${className ?? ''}`}
10
+ class={`${daisy[kind]} link inline-block text-left no-underline hover:underline ${className ?? ''}`}
11
11
  {href}
12
12
  rel="noopener"
13
13
  {target}
@@ -4,8 +4,8 @@ declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
6
  href: string;
7
- target?: HTMLAnchorAttributes['target'];
8
- kind?: "info" | "ghost" | undefined;
7
+ target?: HTMLAnchorAttributes["target"];
8
+ kind?: ("info" | "ghost") | undefined;
9
9
  class?: string | undefined | null;
10
10
  };
11
11
  events: {
@@ -1,44 +1,56 @@
1
- <script>import { tw } from "../..";
1
+ <script>import {} from "../..";
2
2
  import Icon from "../Icon.svelte";
3
3
  import Tooltip from "../Tooltip.svelte";
4
4
  import Link from "./Link.svelte";
5
5
  export let item;
6
6
  export let noIcon = false;
7
7
  export let captionSubStyle = "under";
8
+ const hasSomethingToDisplay = (item2) => {
9
+ if (item2.href) {
10
+ return true;
11
+ }
12
+ if (item2.caption) {
13
+ return true;
14
+ }
15
+ return false;
16
+ };
8
17
  </script>
9
18
 
10
19
  <div class="flex items-center gap-4">
11
20
  {#if item}
12
21
  {#if item.icon?.data && !noIcon}
13
- <Tooltip text={item.icon.caption}>
14
- <Icon
15
- data={item.icon.data}
16
- class={tw('flex-shrink-0', item.icon.class)}
17
- size={item.icon.size}
18
- />
19
- </Tooltip>
20
- {/if}
21
- <div class="flex flex-col items-start">
22
- {#if item.href}
23
- <div>
24
- <Link href={item.href}>{item.caption}</Link>
25
- {#if item.captionSub && captionSubStyle === 'inline'}
26
- <span class="text-base-content/70 text-xs italic">{item.captionSub}</span>
27
- {/if}
28
- </div>
22
+ {#if item.icon.caption}
23
+ <Tooltip text={item.icon.caption}>
24
+ <Icon {...item.icon} />
25
+ </Tooltip>
29
26
  {:else}
30
- <!-- 20 is a cool value ! -->
31
- <span
32
- class="text-base-content {item.class} {(item.caption ?? '').length < 20
33
- ? 'text-nowrap'
34
- : ''}"
35
- >
36
- {item.caption ?? '-'}
37
- </span>
38
- {/if}
39
- {#if item.captionSub && captionSubStyle === 'under'}
40
- <span class="text-base-content/70 text-xs italic">{item.captionSub}</span>
27
+ <Icon {...item.icon} />
41
28
  {/if}
42
- </div>
29
+ {/if}
30
+
31
+ {#if hasSomethingToDisplay(item)}
32
+ <div class="flex flex-col items-start">
33
+ {#if item.href}
34
+ <div>
35
+ <Link href={item.href}>{item.caption}</Link>
36
+ {#if item.captionSub && captionSubStyle === 'inline'}
37
+ <span class="text-base-content/70 text-xs italic">{item.captionSub}</span>
38
+ {/if}
39
+ </div>
40
+ {:else}
41
+ <!-- 20 is a cool value ! -->
42
+ <span
43
+ class="text-base-content {item.class} {(item.caption ?? '').length < 20
44
+ ? 'text-nowrap'
45
+ : ''}"
46
+ >
47
+ {item.caption ?? '-'}
48
+ </span>
49
+ {/if}
50
+ {#if item.captionSub && captionSubStyle === 'under'}
51
+ <span class="text-base-content/70 text-xs italic">{item.captionSub}</span>
52
+ {/if}
53
+ </div>
54
+ {/if}
43
55
  {/if}
44
56
  </div>
@@ -3,8 +3,8 @@ import { type BaseItemLight } from '../..';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  item: BaseItemLight | undefined;
6
- noIcon?: boolean | undefined;
7
- captionSubStyle?: "none" | "under" | "inline" | undefined;
6
+ noIcon?: boolean;
7
+ captionSubStyle?: "under" | "inline" | "none";
8
8
  };
9
9
  events: {
10
10
  [evt: string]: CustomEvent<any>;
@@ -1,4 +1,3 @@
1
- /// <reference types="svelte" />
2
1
  import type { TransitionConfig } from 'svelte/transition';
3
2
  type FlyAndScaleOptions = {
4
3
  y: number;
package/esm/vite/index.js CHANGED
@@ -29,6 +29,7 @@ export function firstly(options) {
29
29
  });
30
30
  },
31
31
  },
32
+ // @ts-ignore
32
33
  ...kitRoutes({
33
34
  ...(options?.kitRoutes ?? {}),
34
35
  ...{
@@ -40,6 +41,7 @@ export function firstly(options) {
40
41
  },
41
42
  },
42
43
  }),
44
+ // @ts-ignore
43
45
  ...stripper({
44
46
  decorators: ['BackendMethod'],
45
47
  hard: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firstly",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "description": "Firstly, an opinionated Remult setup!",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@sveltejs/kit": ">=1.0.0 <3.0.0",
17
- "remult": "0.27.7",
17
+ "remult": "0.27.20",
18
18
  "svelte": ">=4.2.18"
19
19
  },
20
20
  "dependencies": {
@@ -26,7 +26,7 @@
26
26
  "arctic": "^1.8.0",
27
27
  "clsx": "^2.1.1",
28
28
  "cron": "^3.1.7",
29
- "daisyui": "^4.10.3",
29
+ "daisyui": "^4.12.10",
30
30
  "esm-env": "^1.0.0",
31
31
  "lucia": "^3.2.0",
32
32
  "nodemailer": "^6.9.13",