fuma 0.1.25 → 0.1.27

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.
@@ -1,7 +1,7 @@
1
1
  export * from './card/index.js';
2
2
  export * from './drawer/index.js';
3
- export * from './form/index.js';
4
3
  export * from './input/index.js';
4
+ export * from './form/index.js';
5
5
  export * from './menu/index.js';
6
6
  export * from './period/index.js';
7
7
  export * from './table/index.js';
package/dist/ui/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from './card/index.js';
2
2
  export * from './drawer/index.js';
3
- export * from './form/index.js';
4
3
  export * from './input/index.js';
4
+ export * from './form/index.js';
5
5
  export * from './menu/index.js';
6
6
  export * from './period/index.js';
7
7
  export * from './table/index.js';
@@ -11,6 +11,7 @@ export let hint = "";
11
11
  export let prefix = "";
12
12
  export let prefixFor = "";
13
13
  export let enhanceDisabled = false;
14
+ export let labelPosition = "top";
14
15
  $:
15
16
  _key = prefix && key ? `${prefix}_${key}` : key || "";
16
17
  if (!enhanceDisabled) {
@@ -31,15 +32,24 @@ onMount(() => {
31
32
  </script>
32
33
 
33
34
  <div class="form-control {klass}" bind:this={formControl}>
34
- {#if label || $$slots.label}
35
- <label for="{prefixFor}{_key}" class="label cursor-pointer {classLabel}">
36
- <span class="label-text">{label}</span>
37
- <slot name="label" />
38
- <slot name="label_append" />
39
- </label>
40
- {/if}
35
+ <div
36
+ class:contents={labelPosition === 'top'}
37
+ class:flex={labelPosition !== 'top'}
38
+ class:items-center={labelPosition !== 'top'}
39
+ class:gap-2={labelPosition !== 'top'}
40
+ class:flex-row-reverse={labelPosition === 'right'}
41
+ class:justify-end={labelPosition === 'right'}
42
+ >
43
+ {#if label || $$slots.label}
44
+ <label for="{prefixFor}{_key}" class="label cursor-pointer {classLabel}">
45
+ <span class="label-text">{label}</span>
46
+ <slot name="label" />
47
+ <slot name="label_append" />
48
+ </label>
49
+ {/if}
41
50
 
42
- <slot key={_key} />
51
+ <slot key={_key} />
52
+ </div>
43
53
 
44
54
  {#if error}
45
55
  <label for="{prefixFor}{_key}" class="label" transition:slide>
@@ -10,6 +10,7 @@ declare const __propDef: {
10
10
  prefix?: string | number | undefined;
11
11
  prefixFor?: string | number | undefined;
12
12
  enhanceDisabled?: boolean | undefined;
13
+ labelPosition?: ("top" | "left" | "right") | undefined;
13
14
  };
14
15
  events: {
15
16
  [evt: string]: CustomEvent<any>;
@@ -1,19 +1,15 @@
1
1
  <script>import { createEventDispatcher } from "svelte";
2
2
  import { FormControl, bindCheckedWithParams } from "./index.js";
3
- $:
4
- ({ input, value: _value, bindWithParams, label, ...props } = $$restProps);
5
- export let value = _value;
3
+ export let value = false;
4
+ export let input = {};
5
+ export let inputElement = void 0;
6
+ export let bindWithParams = false;
6
7
  const dispatch = createEventDispatcher();
7
8
  </script>
8
9
 
9
- <FormControl {...props} let:key>
10
- <label for={key} class="label cursor-pointer">
11
- <span class="label-text">
12
- <slot>{label}</slot>
13
- </span>
14
- </label>
15
-
10
+ <FormControl {...$$restProps} let:key class="">
16
11
  <input
12
+ bind:this={inputElement}
17
13
  bind:checked={value}
18
14
  use:bindCheckedWithParams={{ bindEnable: bindWithParams }}
19
15
  on:input={({ currentTarget: { checked } }) => dispatch('change', checked)}
@@ -1,7 +1,26 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type InputProps } from './index.js';
2
+ import type { HTMLInputAttributes } from 'svelte/elements';
3
3
  declare const __propDef: {
4
- props: InputProps<boolean>;
4
+ props: {
5
+ class?: string | undefined;
6
+ classLabel?: string | undefined;
7
+ key?: string | undefined;
8
+ label?: string | undefined;
9
+ error?: string | undefined;
10
+ hint?: string | undefined;
11
+ prefix?: string | number | undefined;
12
+ prefixFor?: string | number | undefined;
13
+ enhanceDisabled?: boolean | undefined;
14
+ labelPosition?: ("top" | "left" | "right") | undefined;
15
+ } & {
16
+ input?: HTMLInputAttributes | undefined;
17
+ inputElement?: HTMLInputElement | undefined;
18
+ wrapperClass?: string | undefined;
19
+ value?: boolean | undefined;
20
+ bindWithParams?: boolean | undefined;
21
+ } & {
22
+ isRow?: boolean | undefined;
23
+ };
5
24
  events: {
6
25
  focus: FocusEvent;
7
26
  blur: FocusEvent;
@@ -9,9 +28,7 @@ declare const __propDef: {
9
28
  } & {
10
29
  [evt: string]: CustomEvent<any>;
11
30
  };
12
- slots: {
13
- default: {};
14
- };
31
+ slots: {};
15
32
  };
16
33
  export type InputBooleanProps = typeof __propDef.props;
17
34
  export type InputBooleanEvents = typeof __propDef.events;
@@ -11,6 +11,7 @@ declare const __propDef: {
11
11
  prefix?: string | number | undefined;
12
12
  prefixFor?: string | number | undefined;
13
13
  enhanceDisabled?: boolean | undefined;
14
+ labelPosition?: ("top" | "left" | "right") | undefined;
14
15
  } & {
15
16
  input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
16
17
  inputElement?: HTMLInputElement | undefined;
@@ -11,6 +11,7 @@ declare const __propDef: {
11
11
  prefix?: string | number | undefined;
12
12
  prefixFor?: string | number | undefined;
13
13
  enhanceDisabled?: boolean | undefined;
14
+ labelPosition?: ("top" | "left" | "right") | undefined;
14
15
  } & {
15
16
  input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
16
17
  inputElement?: HTMLInputElement | undefined;
@@ -14,6 +14,7 @@ declare const __propDef: {
14
14
  prefix?: string | number | undefined;
15
15
  prefixFor?: string | number | undefined;
16
16
  enhanceDisabled?: boolean | undefined;
17
+ labelPosition?: ("top" | "left" | "right") | undefined;
17
18
  } & {
18
19
  input?: import("svelte/elements").HTMLInputAttributes | undefined;
19
20
  inputElement?: HTMLInputElement | undefined;
@@ -10,6 +10,7 @@ declare const __propDef: {
10
10
  prefix?: string | number | undefined;
11
11
  prefixFor?: string | number | undefined;
12
12
  enhanceDisabled?: boolean | undefined;
13
+ labelPosition?: ("top" | "left" | "right") | undefined;
13
14
  } & {
14
15
  input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
15
16
  inputElement?: HTMLInputElement | undefined;
@@ -11,6 +11,7 @@ declare const __propDef: {
11
11
  prefix?: string | number | undefined;
12
12
  prefixFor?: string | number | undefined;
13
13
  enhanceDisabled?: boolean | undefined;
14
+ labelPosition?: ("top" | "left" | "right") | undefined;
14
15
  } & {
15
16
  input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
16
17
  inputElement?: HTMLInputElement | undefined;
@@ -10,6 +10,7 @@ declare const __propDef: {
10
10
  prefix?: string | number | undefined;
11
11
  prefixFor?: string | number | undefined;
12
12
  enhanceDisabled?: boolean | undefined;
13
+ labelPosition?: ("top" | "left" | "right") | undefined;
13
14
  } & {
14
15
  value?: string | undefined;
15
16
  classToolbar?: string | undefined;
@@ -48,7 +48,6 @@ onMount(() => {
48
48
  interactive: true,
49
49
  interactiveDebounce: 50,
50
50
  appendTo: "parent",
51
- hideOnClick: false,
52
51
  onShown() {
53
52
  if (autofocus)
54
53
  focusables[0]?.select();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod and more",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",