intelliwaketssveltekitv25 0.1.113 → 0.1.115

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.
@@ -17,6 +17,7 @@
17
17
  possibles,
18
18
  selected = $bindable([]),
19
19
  selectedIDs = $bindable(undefined),
20
+ autoModifySelected = true,
20
21
  created = $bindable([]),
21
22
  existing = $bindable([]),
22
23
  name = null,
@@ -42,6 +43,7 @@
42
43
  bodyClass = '',
43
44
  toggleClass = '',
44
45
  controlClass = '',
46
+ inputClass = '',
45
47
  parentDivElement = null,
46
48
  form = undefined
47
49
  }: {
@@ -51,6 +53,7 @@
51
53
  possibles: T[]
52
54
  selected?: T[]
53
55
  selectedIDs?: (number | string)[] | undefined
56
+ autoModifySelected?: boolean
54
57
  created?: T[]
55
58
  existing?: T[]
56
59
  name?: string | null
@@ -77,6 +80,7 @@
77
80
  bodyClass?: string
78
81
  toggleClass?: string
79
82
  controlClass?: string
83
+ inputClass?: string
80
84
  parentDivElement?: HTMLDivElement | null
81
85
  form?: string | undefined
82
86
  } = $props()
@@ -96,7 +100,7 @@
96
100
  async function doAdd(item: T | null | undefined) {
97
101
  if (!disable) {
98
102
  if (item) {
99
- selected = [...selected, item]
103
+ if (autoModifySelected) selected = [...selected, item]
100
104
  searchValue = ''
101
105
  await tick()
102
106
  if (elInput) elInput.focus()
@@ -106,7 +110,7 @@
106
110
 
107
111
  async function doClear(item: T) {
108
112
  if (!disable) {
109
- selected = selected.filter(s => !DeepEqual(idValue(s), idValue(item)))
113
+ if (autoModifySelected) selected = selected.filter(s => !DeepEqual(idValue(s), idValue(item)))
110
114
  if (elInput) {
111
115
  await tick()
112
116
  elInput.focus()
@@ -118,7 +122,7 @@
118
122
  e.stopPropagation()
119
123
  if (!disable) {
120
124
  if (allowClearAll) {
121
- selected = []
125
+ if (autoModifySelected) selected = []
122
126
  await tick()
123
127
  }
124
128
  if (elInput) {
@@ -153,7 +157,7 @@
153
157
  })))
154
158
 
155
159
  function setSelectedIDs(sels: T[]) {
156
- if (!initialPass && selectedIDs && (selectedIDs.length !== sels.length || !sels.every(sel => !!selectedIDs?.some(selID => selID === idValue(sel))))) {
160
+ if (!initialPass && autoModifySelected && selectedIDs && (selectedIDs.length !== sels.length || !sels.every(sel => !!selectedIDs?.some(selID => selID === idValue(sel))))) {
157
161
  selectedIDs = sels.map(sel => idValue(sel))
158
162
  }
159
163
  }
@@ -163,7 +167,7 @@
163
167
  })
164
168
 
165
169
  function setSelected(selIDs: (string | number)[] | undefined, poss: T[]) {
166
- if (selIDs && (selIDs.length !== selected.length || !selected.every(sel => !!selIDs?.some(selID => selID === idValue(sel))))) {
170
+ if (selIDs && autoModifySelected && (selIDs.length !== selected.length || !selected.every(sel => !!selIDs?.some(selID => selID === idValue(sel))))) {
167
171
  selected = poss.filter(po => !!selIDs?.some(selID => selID == idValue(po)))
168
172
  }
169
173
  }
@@ -317,7 +321,7 @@
317
321
  autocomplete="off"
318
322
  bind:this={elInput}
319
323
  bind:value={searchValue}
320
- class='noFormat flex grow-1 m-1 ring-0 focus:ring-0 outline-0 focus:outline-0 min-w-[3em] w-[3em] border-none p-0'
324
+ class="noFormat flex grow-1 m-1 ring-0 focus:ring-0 outline-0 focus:outline-0 min-w-[3em] w-[3em] border-none p-0 {inputClass}"
321
325
  onkeydown={onKeyPress} />
322
326
  {/if}
323
327
  </div>
@@ -8,6 +8,7 @@ declare class __sveltets_Render<T extends TGenericMultiSelect> {
8
8
  possibles: T[];
9
9
  selected?: T[] | undefined;
10
10
  selectedIDs?: (number | string)[] | undefined;
11
+ autoModifySelected?: boolean;
11
12
  created?: T[] | undefined;
12
13
  existing?: T[] | undefined;
13
14
  name?: string | null;
@@ -34,6 +35,7 @@ declare class __sveltets_Render<T extends TGenericMultiSelect> {
34
35
  bodyClass?: string;
35
36
  toggleClass?: string;
36
37
  controlClass?: string;
38
+ inputClass?: string;
37
39
  parentDivElement?: HTMLDivElement | null;
38
40
  form?: string | undefined;
39
41
  };
@@ -1,6 +1,7 @@
1
1
  <script lang='ts'>
2
2
  import { selectOnFocus } from './Functions'
3
3
  import { type ActionArray, useActions } from './useActions'
4
+ import type { HTMLInputAttributes } from 'svelte/elements'
4
5
 
5
6
  let {
6
7
  id = undefined,
@@ -15,7 +16,7 @@
15
16
  onChange = () => {
16
17
  },
17
18
  ...restProps
18
- }: {
19
+ }: HTMLInputAttributes & {
19
20
  id?: string | undefined
20
21
  value?: string
21
22
  use?: ActionArray
@@ -1,5 +1,6 @@
1
1
  import { type ActionArray } from './useActions';
2
- type $$ComponentProps = {
2
+ import type { HTMLInputAttributes } from 'svelte/elements';
3
+ type $$ComponentProps = HTMLInputAttributes & {
3
4
  id?: string | undefined;
4
5
  value?: string;
5
6
  use?: ActionArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.1.113",
3
+ "version": "0.1.115",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",