fuma 0.3.36 → 0.3.38

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.
@@ -0,0 +1,2 @@
1
+ /// <reference types="svelte" />
2
+ export declare let drawerTransitionX: import("svelte/store").Writable<number>;
@@ -0,0 +1,2 @@
1
+ import { writable } from 'svelte/store';
2
+ export let drawerTransitionX = writable(0);
@@ -7,6 +7,7 @@ import { Icon } from "../icon/index.js";
7
7
  import { subscibeDrawerLayers } from "./layers.js";
8
8
  import { contextContainer } from "../context.js";
9
9
  import { drawerFly } from "./drawerFly.js";
10
+ import { writable } from "svelte/store";
10
11
  export let title = "";
11
12
  export let key;
12
13
  let klass = "";
@@ -16,6 +17,7 @@ export let classHeader = "";
16
17
  export let classBody = "";
17
18
  export let duration = 180;
18
19
  export let noOverlay = false;
20
+ export let transitionX = 0;
19
21
  export function open(value = 1, options = {}) {
20
22
  return goto($urlParam.with({ [key]: value }), {
21
23
  ...options,
@@ -46,7 +48,14 @@ let clientWidth = 0;
46
48
  {#if $isActive}
47
49
  <aside
48
50
  bind:clientWidth
49
- transition:drawerFly|local={{ x: clientWidth, duration, opacity: 1 }}
51
+ transition:drawerFly|local={{
52
+ x: clientWidth,
53
+ duration,
54
+ opacity: 1,
55
+ onTransition(pos) {
56
+ transitionX = pos.x
57
+ }
58
+ }}
50
59
  style="
51
60
  z-index: {10 + $index};
52
61
  max-width: min(100%, {maxWidth});
@@ -9,6 +9,7 @@ declare const __propDef: {
9
9
  classBody?: string | undefined;
10
10
  duration?: number | undefined;
11
11
  noOverlay?: boolean | undefined;
12
+ transitionX?: number | undefined;
12
13
  open?: ((value?: number, options?: {
13
14
  replaceState?: boolean | undefined;
14
15
  noScroll?: boolean | undefined;
@@ -1,8 +1,10 @@
1
1
  /// <reference types="svelte" />
2
2
  import type { FlyParams, TransitionConfig } from 'svelte/transition';
3
- export declare const drawerFlyTransition: import("svelte/store").Writable<{
4
- x: number;
5
- y: number;
6
- }>;
7
- export declare function drawerFly(node: HTMLElement, { delay, duration, easing, x, y, opacity }?: FlyParams): TransitionConfig;
3
+ export type DrawerFlyParams = FlyParams & {
4
+ onTransition?: (pos: {
5
+ x: number;
6
+ y: number;
7
+ }) => unknown;
8
+ };
9
+ export declare function drawerFly(node: HTMLElement, { delay, duration, easing, x, y, opacity, onTransition }?: DrawerFlyParams): TransitionConfig;
8
10
  export declare function split_css_unit(value: number | string): [number, string];
@@ -1,7 +1,5 @@
1
1
  import { cubicOut } from 'svelte/easing';
2
- import { writable } from 'svelte/store';
3
- export const drawerFlyTransition = writable({ x: 0, y: 0 });
4
- export function drawerFly(node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}) {
2
+ export function drawerFly(node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0, onTransition = () => { } } = {}) {
5
3
  const style = getComputedStyle(node);
6
4
  const target_opacity = +style.opacity;
7
5
  const transform = style.transform === 'none' ? '' : style.transform;
@@ -16,7 +14,7 @@ export function drawerFly(node, { delay = 0, duration = 400, easing = cubicOut,
16
14
  transform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit});
17
15
  opacity: ${target_opacity - od * u}`,
18
16
  tick: (t, u) => {
19
- drawerFlyTransition.set({ x: t * xValue, y: t * yValue });
17
+ onTransition({ x: t * xValue, y: t * yValue });
20
18
  }
21
19
  };
22
20
  }
@@ -24,6 +24,22 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
24
24
  error?: string | undefined;
25
25
  placeholder?: string | undefined;
26
26
  tippyProps?: Partial<import("tippy.js").Props> | undefined;
27
+ dropdownProps?: {
28
+ tippyProps?: Partial<import("tippy.js").Props> | undefined;
29
+ class?: string | undefined;
30
+ wrapperClass?: string | undefined;
31
+ classActivator?: string | undefined;
32
+ useSingleton?: boolean | undefined;
33
+ autofocus?: boolean | undefined;
34
+ hideOnBlur?: boolean | undefined;
35
+ hideOnNav?: boolean | undefined;
36
+ tip?: import("tippy.js").Instance<import("tippy.js").Props> | undefined;
37
+ disable?: boolean | undefined;
38
+ content?: HTMLDivElement | undefined;
39
+ hide?: (() => void) | undefined;
40
+ show?: (() => void) | undefined;
41
+ setTippyProps?: ((props: Partial<import("tippy.js").Props>) => void) | undefined;
42
+ } | undefined;
27
43
  flatMode?: boolean | undefined;
28
44
  slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
29
45
  slotSuggestion?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
@@ -77,6 +93,22 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
77
93
  error?: string | undefined;
78
94
  placeholder?: string | undefined;
79
95
  tippyProps?: Partial<import("tippy.js").Props> | undefined;
96
+ dropdownProps?: {
97
+ tippyProps?: Partial<import("tippy.js").Props> | undefined;
98
+ class?: string | undefined;
99
+ wrapperClass?: string | undefined;
100
+ classActivator?: string | undefined;
101
+ useSingleton?: boolean | undefined;
102
+ autofocus?: boolean | undefined;
103
+ hideOnBlur?: boolean | undefined;
104
+ hideOnNav?: boolean | undefined;
105
+ tip?: import("tippy.js").Instance<import("tippy.js").Props> | undefined;
106
+ disable?: boolean | undefined;
107
+ content?: HTMLDivElement | undefined;
108
+ hide?: (() => void) | undefined;
109
+ show?: (() => void) | undefined;
110
+ setTippyProps?: ((props: Partial<import("tippy.js").Props>) => void) | undefined;
111
+ } | undefined;
80
112
  flatMode?: boolean | undefined;
81
113
  slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
82
114
  slotSuggestion?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
@@ -45,6 +45,22 @@ export declare function relationProps<Item extends {
45
45
  error?: string | undefined;
46
46
  placeholder?: string | undefined;
47
47
  tippyProps?: Partial<import("tippy.js").Props> | undefined;
48
+ dropdownProps?: {
49
+ tippyProps?: Partial<import("tippy.js").Props> | undefined;
50
+ class?: string | undefined;
51
+ wrapperClass?: string | undefined;
52
+ classActivator?: string | undefined;
53
+ useSingleton?: boolean | undefined;
54
+ autofocus?: boolean | undefined;
55
+ hideOnBlur?: boolean | undefined;
56
+ hideOnNav?: boolean | undefined;
57
+ tip?: import("tippy.js").Instance<import("tippy.js").Props> | undefined;
58
+ disable?: boolean | undefined;
59
+ content?: HTMLDivElement | undefined;
60
+ hide?: (() => void) | undefined;
61
+ show?: (() => void) | undefined;
62
+ setTippyProps?: ((props: Partial<import("tippy.js").Props>) => void) | undefined;
63
+ } | undefined;
48
64
  flatMode?: boolean | undefined;
49
65
  slotItem?: ((item: Item) => string | import("../..").ComponentAndProps) | null | undefined;
50
66
  slotSuggestion?: ((item: Item) => string | import("../..").ComponentAndProps) | null | undefined;
@@ -19,6 +19,7 @@ export { item as value };
19
19
  export let error = "";
20
20
  export let placeholder = "";
21
21
  export let tippyProps = {};
22
+ export let dropdownProps = {};
22
23
  export let flatMode = false;
23
24
  export let slotItem = null;
24
25
  export let slotSuggestion = slotItem;
@@ -66,7 +67,7 @@ async function handleBlur() {
66
67
  }
67
68
  </script>
68
69
 
69
- <DropDown {tippyProps} disable={flatMode}>
70
+ <DropDown {tippyProps} disable={flatMode} {...dropdownProps}>
70
71
  <div class="contents" slot="activator">
71
72
  <FormControl {key} {label} {error} class={klass} let:key>
72
73
  <div class="flex grow gap-2" class:hidden={item}>
@@ -92,7 +93,7 @@ async function handleBlur() {
92
93
  </div>
93
94
 
94
95
  {#if item}
95
- <div class="flex h-12 items-center gap-2 rounded-lg border pl-4 pr-2">
96
+ <div class="flex h-12 items-center gap-2 rounded-lg border bg-base-100 pl-4 pr-2">
96
97
  <div class="grow">
97
98
  <slot name="item" {item}>
98
99
  <Slot slot={slotItem} args={item}>
@@ -16,6 +16,22 @@ declare class __sveltets_Render<RelationItem extends {
16
16
  error?: string | undefined;
17
17
  placeholder?: string | undefined;
18
18
  tippyProps?: Partial<TippyProps> | undefined;
19
+ dropdownProps?: {
20
+ tippyProps?: Partial<TippyProps> | undefined;
21
+ class?: string | undefined;
22
+ wrapperClass?: string | undefined;
23
+ classActivator?: string | undefined;
24
+ useSingleton?: boolean | undefined;
25
+ autofocus?: boolean | undefined;
26
+ hideOnBlur?: boolean | undefined;
27
+ hideOnNav?: boolean | undefined;
28
+ tip?: import("tippy.js").Instance<TippyProps> | undefined;
29
+ disable?: boolean | undefined;
30
+ content?: HTMLDivElement | undefined;
31
+ hide?: (() => void) | undefined;
32
+ show?: (() => void) | undefined;
33
+ setTippyProps?: ((props: Partial<TippyProps>) => void) | undefined;
34
+ } | undefined;
19
35
  flatMode?: boolean | undefined;
20
36
  slotItem?: ((item: RelationItem) => string | ComponentAndProps) | null | undefined;
21
37
  slotSuggestion?: ((item: RelationItem) => string | ComponentAndProps) | null | undefined;
@@ -21,7 +21,6 @@ export function createEventEmitter() {
21
21
  emit(...args) {
22
22
  if (!events[args[0]])
23
23
  events[args[0]] = [];
24
- // @ts-ignore
25
24
  events[args[0]].forEach((callback) => callback(args[1]));
26
25
  }
27
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "0.3.36",
3
+ "version": "0.3.38",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",