fuma 2.0.27 → 2.0.29

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.
@@ -56,18 +56,18 @@
56
56
  {
57
57
  key: 'name',
58
58
  label: 'Prop',
59
- getCell: (p) => p.id,
59
+ cell: (p) => p.id,
60
60
  locked: true
61
61
  },
62
62
  {
63
63
  key: 'type',
64
64
  label: 'Type',
65
- getCell: (p) => typeof p.value
65
+ cell: (p) => typeof p.value
66
66
  },
67
67
  {
68
68
  key: 'value',
69
69
  label: 'Value',
70
- getCell: (p) => p.value,
70
+ cell: (p) => p.value,
71
71
  visible: true
72
72
  }
73
73
  ]}
@@ -3,7 +3,6 @@
3
3
  import type { HTMLInputAttributes } from 'svelte/elements'
4
4
  import debounce from 'debounce'
5
5
  import { toast } from 'svelte-sonner'
6
- import { mdiClose } from '@mdi/js'
7
6
 
8
7
  import { USE_COERCE_JSON } from '../../utils/constant.js'
9
8
  import { Icon } from '../icon/index.js'
@@ -31,6 +30,7 @@
31
30
  export let slotSuggestion: SnippetLike<[RelationItem]> = slotItem
32
31
  export let input: HTMLInputAttributes | undefined = undefined
33
32
  export let append: Snippet | undefined = undefined
33
+ export let disabled = false
34
34
 
35
35
  let klass = ''
36
36
  export { klass as class }
@@ -122,6 +122,7 @@
122
122
  {:else}
123
123
  <button
124
124
  type="button"
125
+ {disabled}
125
126
  on:click|stopPropagation={() => clear()}
126
127
  class="input h-auto min-h-10 w-full grow items-start pt-2 pr-2"
127
128
  >
@@ -24,6 +24,7 @@ declare class __sveltets_Render<RelationItem extends {
24
24
  slotSuggestion?: SnippetLike<[RelationItem]> | undefined;
25
25
  input?: HTMLInputAttributes | undefined;
26
26
  append?: Snippet | undefined;
27
+ disabled?: boolean;
27
28
  class?: string;
28
29
  classList?: string;
29
30
  inputElement?: HTMLInputElement | undefined;
@@ -13,8 +13,9 @@
13
13
  options: Options
14
14
  tippyProps?: TippyProps
15
15
  placeholder?: string
16
+ disabled?: boolean
16
17
  }
17
- $: ({ value: _value, options, tippyProps, placeholder, ...props } = $$props as $$Props)
18
+ $: ({ value: _value, options, tippyProps, placeholder, disabled, ...props } = $$props as $$Props)
18
19
  export let value = _value
19
20
 
20
21
  $: _options = parseOptions(options)
@@ -43,7 +44,13 @@
43
44
  <svelte:fragment slot="activator">
44
45
  <FormControl {...props}>
45
46
  {#snippet children({ key })}
46
- <button bind:this={button} id={key} type="button" class="input flex grow items-center pr-2">
47
+ <button
48
+ bind:this={button}
49
+ id={key}
50
+ {disabled}
51
+ type="button"
52
+ class="input flex grow items-center pr-2"
53
+ >
47
54
  {#if selectedOption}
48
55
  {#if selectedOption.icon}
49
56
  <Icon path={selectedOption.icon} size={21} class="opacity-70" />
@@ -64,7 +71,7 @@
64
71
  <SelectorList
65
72
  trigger={button}
66
73
  {focusIndex}
67
- items={_options.map((opt) => ({ id: opt.value, ...opt }))}
74
+ items={_options.map((opt) => ({ id: opt.value, ...opt })).filter((opt) => !opt.disable)}
68
75
  let:item
69
76
  on:select={({ detail }) => onSelect(detail)}
70
77
  class="w-full"
@@ -18,6 +18,7 @@ declare const InputSelect: $$__sveltets_2_IsomorphicComponent<Omit<InputProps, "
18
18
  options: Options;
19
19
  tippyProps?: TippyProps;
20
20
  placeholder?: string;
21
+ disabled?: boolean;
21
22
  }, {
22
23
  input: CustomEvent<string>;
23
24
  select: CustomEvent<string>;
@@ -3,6 +3,7 @@ export type Option = {
3
3
  value: string;
4
4
  label: string;
5
5
  icon?: string | Snippet;
6
+ disable?: boolean;
6
7
  };
7
8
  export type OptionRecord<Values extends string> = Record<Values, Omit<Option, 'value'>>;
8
9
  export type Options = string | string[] | Option[] | Record<string, string> | OptionRecord<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "2.0.27",
3
+ "version": "2.0.29",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",
@@ -114,7 +114,7 @@
114
114
  "svelte-sonner": "^0.3.28",
115
115
  "tippy.js": "^6.3.7",
116
116
  "ts-node": "^10.9.2",
117
- "vite": "^7.1.9",
117
+ "vite": "^7.1.12",
118
118
  "zod": "^4.1.11"
119
119
  },
120
120
  "scripts": {