fuma 0.3.54 → 0.3.56

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.
@@ -12,10 +12,20 @@ export let classBody = "";
12
12
  export let classTitle = "";
13
13
  $:
14
14
  isOpen = $urlParam.hasValue("section", value);
15
+ let header;
15
16
  let timeout;
16
- async function handleClick() {
17
+ async function handleClick(event) {
18
+ if (isClickOnInteractiveElement(event))
19
+ return;
17
20
  await goto($urlParam.toggle({ section: value }), { noScroll: true, keepFocus: true });
18
21
  }
22
+ function isClickOnInteractiveElement(event) {
23
+ if (!event)
24
+ return false;
25
+ const target = event.target;
26
+ const elements = [...header.querySelectorAll("a, button")];
27
+ return !!elements.filter((element) => element.contains(target)).length;
28
+ }
19
29
  onDestroy(() => {
20
30
  clearTimeout(timeout);
21
31
  });
@@ -24,11 +34,12 @@ onDestroy(() => {
24
34
  <section class="card bordered border bg-base-100 shadow-md {klass}">
25
35
  <div
26
36
  id={value}
37
+ bind:this={header}
27
38
  tabindex="0"
28
39
  class="min-w-0 grow cursor-pointer p-2 sm:px-5 sm:py-3 {classHeader}"
29
40
  role="link"
30
41
  on:click={handleClick}
31
- on:keydown={(e) => e.key === ' ' && handleClick()}
42
+ on:keydown={(e) => e.key === ' ' && handleClick(null)}
32
43
  >
33
44
  <slot name="header">
34
45
  <div class="flex gap-2">
@@ -46,7 +57,10 @@ onDestroy(() => {
46
57
  </div>
47
58
 
48
59
  {#if isOpen}
49
- <div class="card-body pt-0 p-2 sm:px-5 sm:py-3 {classBody}" transition:slide={{ duration: 200 }}>
60
+ <div
61
+ class="card-body p-2 pt-0 sm:px-5 sm:py-3 {classBody}"
62
+ transition:slide={{ duration: 200 }}
63
+ >
50
64
  <slot />
51
65
  </div>
52
66
  {/if}
@@ -31,7 +31,7 @@ export type FormInputProps<T extends FormInputsType> = ComponentProps<InstanceTy
31
31
  export type FormInputsProps = {
32
32
  [T in FormInputsType]: FormInputProps<T>;
33
33
  };
34
- export declare const formInputsType: ("number" | "boolean" | "select" | "date" | "textarea" | "text" | "password" | "radio" | "textrich" | "datetime" | "relation" | "relations")[];
34
+ export declare const formInputsType: ("number" | "boolean" | "select" | "textarea" | "text" | "date" | "password" | "radio" | "textrich" | "datetime" | "relation" | "relations")[];
35
35
  export declare function relationProps<Item extends {
36
36
  id: string;
37
37
  }>(props: ComponentProps<InstanceType<typeof InputRelation<Item>>>): {
@@ -49,7 +49,7 @@ export declare function syncFieldsWithParams(tablekey: string, fields: TableFiel
49
49
  $visible: boolean;
50
50
  key: string;
51
51
  label: string;
52
- type: "string" | "number" | "boolean" | "date" | "textarea";
52
+ type: "string" | "number" | "boolean" | "textarea" | "date";
53
53
  options?: Options | undefined;
54
54
  hint?: string | undefined;
55
55
  locked?: boolean | undefined;
@@ -186,7 +186,7 @@ export declare const z: {
186
186
  map: "map";
187
187
  set: "set";
188
188
  };
189
- getParsedType: (data: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "map" | "nan" | "integer" | "float" | "date" | "null" | "array" | "unknown" | "promise" | "void" | "never" | "set";
189
+ getParsedType: (data: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "map" | "set" | "nan" | "integer" | "float" | "date" | "null" | "array" | "unknown" | "promise" | "void" | "never";
190
190
  ZodType: typeof zod.ZodType;
191
191
  ZodString: typeof zod.ZodString;
192
192
  ZodNumber: typeof zod.ZodNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "0.3.54",
3
+ "version": "0.3.56",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",