fuma 0.3.54 → 0.3.55
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 (isClickOnLink(event))
|
|
19
|
+
return;
|
|
17
20
|
await goto($urlParam.toggle({ section: value }), { noScroll: true, keepFocus: true });
|
|
18
21
|
}
|
|
22
|
+
function isClickOnLink(event) {
|
|
23
|
+
if (!event)
|
|
24
|
+
return false;
|
|
25
|
+
const target = event.target;
|
|
26
|
+
const links = [...header.getElementsByTagName("a")];
|
|
27
|
+
return !!links.filter((link) => link.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
|
|
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" | "
|
|
34
|
+
export declare const formInputsType: ("number" | "boolean" | "select" | "textarea" | "date" | "text" | "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>>>): {
|
package/dist/ui/table/field.d.ts
CHANGED
|
@@ -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" | "
|
|
52
|
+
type: "string" | "number" | "boolean" | "textarea" | "date";
|
|
53
53
|
options?: Options | undefined;
|
|
54
54
|
hint?: string | undefined;
|
|
55
55
|
locked?: boolean | undefined;
|