fuma 0.3.26 → 0.3.28

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.
@@ -3,7 +3,7 @@ import type { DragHandler } from './handlers.js';
3
3
  export declare function mouseDragTrigger(element: HTMLElement, handler: DragHandler): {
4
4
  destroy(): void;
5
5
  };
6
- /** Gestion du cycle de vie des évènements de la souris */
6
+ /** Gestion du cycle de vie des évènements de l'écran tactile */
7
7
  export declare function touchDragTrigger(element: HTMLElement, handler: DragHandler): {
8
8
  destroy(): void;
9
9
  };
@@ -24,7 +24,7 @@ export function mouseDragTrigger(element, handler) {
24
24
  }
25
25
  };
26
26
  }
27
- /** Gestion du cycle de vie des évènements de la souris */
27
+ /** Gestion du cycle de vie des évènements de l'écran tactile */
28
28
  export function touchDragTrigger(element, handler) {
29
29
  let onDrag = false;
30
30
  function startHandler(event) {
@@ -0,0 +1,8 @@
1
+ <script>let klass = "";
2
+ export { klass as class };
3
+ export let content;
4
+ </script>
5
+
6
+ <span class="badge mr-1 whitespace-nowrap {klass}">
7
+ {content}
8
+ </span>
@@ -0,0 +1,17 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ class?: string | undefined;
5
+ content: string;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export type BadgeProps = typeof __propDef.props;
13
+ export type BadgeEvents = typeof __propDef.events;
14
+ export type BadgeSlots = typeof __propDef.slots;
15
+ export default class Badge extends SvelteComponent<BadgeProps, BadgeEvents, BadgeSlots> {
16
+ }
17
+ export {};
@@ -0,0 +1 @@
1
+ export { default as Badge } from './Badge.svelte';
@@ -0,0 +1 @@
1
+ export { default as Badge } from './Badge.svelte';
@@ -14,3 +14,4 @@ export * from './login/index.js';
14
14
  export * from './slot/index.js';
15
15
  export * from './pagination/index.js';
16
16
  export * from './mode/index.js';
17
+ export * from './badge/index.js';
package/dist/ui/index.js CHANGED
@@ -14,3 +14,4 @@ export * from './login/index.js';
14
14
  export * from './slot/index.js';
15
15
  export * from './pagination/index.js';
16
16
  export * from './mode/index.js';
17
+ export * from './badge/index.js';
@@ -1,10 +1,12 @@
1
- <script>export let value;
1
+ <script>import { Badge } from "../../badge/index.js";
2
+ import { component } from "../../../utils/component.js";
3
+ export let value;
2
4
  </script>
3
5
 
4
6
  <td>
5
7
  {#each value as v}
6
- <span class="badge mr-1 whitespace-nowrap">
7
- {v}
8
- </span>
8
+ {@const componentAndProps =
9
+ typeof v === 'object' ? v : component(Badge, { content: String(v) })}
10
+ <svelte:component this={componentAndProps.component} {...componentAndProps.props} />
9
11
  {/each}
10
12
  </td>
@@ -1,7 +1,8 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import { type ComponentAndProps } from '../../../utils/component.js';
2
3
  declare const __propDef: {
3
4
  props: {
4
- value: (string | number | boolean)[];
5
+ value: (ComponentAndProps | string | number | boolean)[];
5
6
  };
6
7
  events: {
7
8
  [evt: string]: CustomEvent<any>;
@@ -14,12 +14,12 @@ type TableFieldCommon = {
14
14
  $visible?: boolean;
15
15
  };
16
16
  type TableFieldUntyped<Item = any> = {
17
- getCell: (item: Item) => ComponentAndProps | Primitive[] | Primitive | undefined | null;
17
+ getCell: (item: Item) => ComponentAndProps[] | ComponentAndProps | Primitive[] | Primitive | undefined | null;
18
18
  head?: ComponentAndProps | ((field: TableField) => ComponentAndProps);
19
19
  };
20
20
  type TableFieldPrimitive<Item = any> = {
21
21
  type: Exclude<TableFieldType, 'select' | 'multiselect'>;
22
- getCell: (item: Item) => ComponentAndProps | Primitive | undefined | null;
22
+ getCell: (item: Item) => ComponentAndProps[] | ComponentAndProps | Primitive | undefined | null;
23
23
  };
24
24
  type TableFieldSelect<Item = any> = {
25
25
  type: 'select';
@@ -43,7 +43,7 @@ export declare function syncFieldsWithParams(tablekey: string, fields: TableFiel
43
43
  hint?: string | undefined;
44
44
  locked?: boolean | undefined;
45
45
  visible?: boolean | undefined;
46
- getCell: (item: any) => Primitive | ComponentAndProps | Primitive[] | null | undefined;
46
+ getCell: (item: any) => Primitive | ComponentAndProps | ComponentAndProps[] | Primitive[] | null | undefined;
47
47
  head?: ComponentAndProps | ((field: TableField<any>) => ComponentAndProps) | undefined;
48
48
  } | {
49
49
  $visible: boolean;
@@ -54,7 +54,7 @@ export declare function syncFieldsWithParams(tablekey: string, fields: TableFiel
54
54
  hint?: string | undefined;
55
55
  locked?: boolean | undefined;
56
56
  visible?: boolean | undefined;
57
- getCell: (item: any) => Primitive | ComponentAndProps | null | undefined;
57
+ getCell: (item: any) => Primitive | ComponentAndProps | ComponentAndProps[] | null | undefined;
58
58
  } | {
59
59
  $visible: boolean;
60
60
  key: string;
@@ -63,8 +63,8 @@ const filter = {
63
63
  }).optional(),
64
64
  multiselect: array(zod.string()).optional(),
65
65
  range: json({
66
- start: zod.date().optional(),
67
- end: zod.date().optional()
66
+ start: zod.coerce.date().optional(),
67
+ end: zod.coerce.date().optional()
68
68
  }).optional(),
69
69
  boolean: zod
70
70
  .enum(['true', 'false'])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",