fuma 2.0.6 → 2.0.7

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.
@@ -6,6 +6,7 @@
6
6
  TableCellString
7
7
  } from './cell/index.js'
8
8
  import type { ItemBase, TableField } from './index.js'
9
+ import TableCellDate from './cell/TableCellDate.svelte'
9
10
 
10
11
  let { item, field }: { item: Item; field: TableField<Item> } = $props()
11
12
 
@@ -19,7 +20,9 @@
19
20
  {:else if typeof cell === 'boolean'}
20
21
  <TableCellBoolean {cell} />
21
22
  {:else if typeof cell === 'string'}
22
- <TableCellString {cell} {field} />
23
+ <TableCellString {cell} />
24
+ {:else if cell instanceof Date}
25
+ <TableCellDate {cell} />
23
26
  {:else if cell === undefined || cell === null}
24
27
  <td>-</td>
25
28
  {:else}
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- let { cell }: { cell: (string | number | boolean)[] } = $props()
2
+ let { cell }: { cell: (string | number | boolean | Date)[] } = $props()
3
3
  </script>
4
4
 
5
5
  <td>
@@ -1,5 +1,5 @@
1
1
  type $$ComponentProps = {
2
- cell: (string | number | boolean)[];
2
+ cell: (string | number | boolean | Date)[];
3
3
  };
4
4
  declare const TableCellArray: import("svelte").Component<$$ComponentProps, {}, "">;
5
5
  type TableCellArray = ReturnType<typeof TableCellArray>;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ let { cell }: { cell: Date } = $props()
3
+ </script>
4
+
5
+ <td>
6
+ <span>{cell.toLocaleDateString()}</span>
7
+ </td>
@@ -0,0 +1,6 @@
1
+ type $$ComponentProps = {
2
+ cell: Date;
3
+ };
4
+ declare const TableCellDate: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type TableCellDate = ReturnType<typeof TableCellDate>;
6
+ export default TableCellDate;
@@ -1,10 +1,7 @@
1
- <script lang="ts" generics="Item extends ItemBase">
2
- import type { ItemBase, TableField } from '../index.js'
3
-
4
- let { cell, field }: { cell: string; field: TableField<Item> } = $props()
1
+ <script lang="ts">
2
+ let { cell }: { cell: string } = $props()
5
3
  </script>
6
4
 
7
- <td data-field-key={field.key} data-field-type={field.type === 'textarea' ? 'textarea' : 'string'}>
8
- <!-- TODO: Sanitize -->
9
- <span>{@html cell}</span>
5
+ <td>
6
+ <span>{cell}</span>
10
7
  </td>
@@ -1,28 +1,6 @@
1
- import type { ItemBase, TableField } from '../index.js';
2
- declare function $$render<Item extends ItemBase>(): {
3
- props: {
4
- cell: string;
5
- field: TableField<Item>;
6
- };
7
- exports: {};
8
- bindings: "";
9
- slots: {};
10
- events: {};
1
+ type $$ComponentProps = {
2
+ cell: string;
11
3
  };
12
- declare class __sveltets_Render<Item extends ItemBase> {
13
- props(): ReturnType<typeof $$render<Item>>['props'];
14
- events(): ReturnType<typeof $$render<Item>>['events'];
15
- slots(): ReturnType<typeof $$render<Item>>['slots'];
16
- bindings(): "";
17
- exports(): {};
18
- }
19
- interface $$IsomorphicComponent {
20
- new <Item extends ItemBase>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Item>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Item>['props']>, ReturnType<__sveltets_Render<Item>['events']>, ReturnType<__sveltets_Render<Item>['slots']>> & {
21
- $$bindings?: ReturnType<__sveltets_Render<Item>['bindings']>;
22
- } & ReturnType<__sveltets_Render<Item>['exports']>;
23
- <Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {}): ReturnType<__sveltets_Render<Item>['exports']>;
24
- z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
25
- }
26
- declare const TableCellString: $$IsomorphicComponent;
27
- type TableCellString<Item extends ItemBase> = InstanceType<typeof TableCellString<Item>>;
4
+ declare const TableCellString: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type TableCellString = ReturnType<typeof TableCellString>;
28
6
  export default TableCellString;
@@ -2,3 +2,4 @@ export { default as TableCellArray } from './TableCellArray.svelte';
2
2
  export { default as TableCellBoolean } from './TableCellBoolean.svelte';
3
3
  export { default as TableCellNumber } from './TableCellNumber.svelte';
4
4
  export { default as TableCellString } from './TableCellString.svelte';
5
+ export { default as TableCellDate } from './TableCellDate.svelte';
@@ -2,3 +2,4 @@ export { default as TableCellArray } from './TableCellArray.svelte';
2
2
  export { default as TableCellBoolean } from './TableCellBoolean.svelte';
3
3
  export { default as TableCellNumber } from './TableCellNumber.svelte';
4
4
  export { default as TableCellString } from './TableCellString.svelte';
5
+ export { default as TableCellDate } from './TableCellDate.svelte';
@@ -1,6 +1,6 @@
1
1
  import type { Options } from '../../utils/options.js';
2
- import type { Primitive } from '../../utils/component.js';
3
2
  import type { SnippetLike } from './type.js';
3
+ export type Primitive = string | number | boolean | Date;
4
4
  export type ItemBase = {
5
5
  id: number | number;
6
6
  };
@@ -1,5 +1,4 @@
1
1
  import type { ComponentProps, ComponentType } from 'svelte';
2
- export type Primitive = string | number | boolean;
3
2
  export type ComponentAndProps = {
4
3
  component: ComponentType;
5
4
  props: ComponentProps<InstanceType<ComponentType>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",