intelliwaketssveltekitv25 0.1.89 → 0.1.90

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.
@@ -32,6 +32,7 @@
32
32
  let displayMultiplier = $derived(shiftDigits === 0 ? 1 : shiftDigits > 0 ? CleanNumber(`1${'0'.repeat(shiftDigits)}`) : CleanNumber(`.${'0'.repeat(Math.abs(shiftDigits) + 1)}1`))
33
33
  let constrainDecimals = $derived(decimalsMax ?? decimals ?? 0)
34
34
  let useDecimals = $derived(!shiftDigits ? constrainDecimals : CleanNumbers(0, constrainDecimals, shiftDigits))
35
+ let plainTextMode = $derived(!!otherProps.readonly || !!otherProps.disabled)
35
36
 
36
37
  function refreshDisplayValue(useValue: number | null) {
37
38
  if (!isFocused) {
@@ -51,6 +52,11 @@
51
52
  }
52
53
  }
53
54
 
55
+ if (plainTextMode) {
56
+ if (prefix) newDisplayValue = `${prefix} ${newDisplayValue}`
57
+ if (suffix) newDisplayValue = `${newDisplayValue} ${suffix}`
58
+ }
59
+
54
60
  if (displayValue !== newDisplayValue) {
55
61
  displayValue = newDisplayValue
56
62
  }
@@ -84,13 +90,13 @@
84
90
  !!suffix ? `padding-right: ${0.75 + (suffix.length * 0.5)}em;` : ''
85
91
  ].join(' ').trim())
86
92
 
93
+ // pattern={!!constrainDecimals ? "[0-9,]*[.,]?[0-9]+" : "[0-9,]*"}
87
94
  </script>
88
95
 
89
96
  <div class="inputAddOn relative overflow-hidden h-fit {clazz}">
90
97
  <input
91
98
  type="text"
92
99
  inputmode={!!constrainDecimals ? "decimal" : "numeric"}
93
- pattern={!!constrainDecimals ? "[0-9,]*[.,]?[0-9]+" : "[0-9,]*"}
94
100
  style={inputStyle}
95
101
  {...otherProps}
96
102
  class="text-right {inputClass}"
@@ -111,10 +117,12 @@
111
117
  use:useActions={use}
112
118
  bind:this={thisRef}
113
119
  />
114
- {#if prefix}
115
- <div class="absolute pointer-events-none left-1 top-1/2 -translate-y-1/2">{prefix}</div>
116
- {/if}
117
- {#if suffix}
118
- <div class="absolute pointer-events-none right-1 top-1/2 -translate-y-1/2">{suffix}</div>
120
+ {#if !plainTextMode}
121
+ {#if prefix}
122
+ <div class="absolute pointer-events-none left-1 top-1/2 -translate-y-1/2">{prefix}</div>
123
+ {/if}
124
+ {#if suffix}
125
+ <div class="absolute pointer-events-none right-1 top-1/2 -translate-y-1/2">{suffix}</div>
126
+ {/if}
119
127
  {/if}
120
128
  </div>
@@ -40,6 +40,8 @@
40
40
  autoFocus = false,
41
41
  zIndex = 50,
42
42
  bodyClass = '',
43
+ toggleClass = '',
44
+ controlClass = '',
43
45
  parentDivElement = null,
44
46
  form = undefined
45
47
  }: {
@@ -73,6 +75,8 @@
73
75
  autoFocus?: boolean
74
76
  zIndex?: number
75
77
  bodyClass?: string
78
+ toggleClass?: string
79
+ controlClass?: string
76
80
  parentDivElement?: HTMLDivElement | null
77
81
  form?: string | undefined
78
82
  } = $props()
@@ -246,8 +250,8 @@
246
250
 
247
251
  </script>
248
252
 
249
- <DropDownControl controlClass='block w-full'
250
- toggleClass='block w-full'
253
+ <DropDownControl controlClass='block w-full {controlClass}'
254
+ toggleClass='block w-full {toggleClass}'
251
255
  onfocusin={() => {
252
256
  show = true
253
257
  }}
@@ -276,7 +280,7 @@
276
280
  onkeydown={() => {}}>
277
281
  <div
278
282
  class='items-center cursor-default flex flex-wrap justify-start transition-all overflow-hidden min-h-[2em]'>
279
- {#each selected as selectedItem (keyValue(selectedItem, possibles.indexOf(poss => DeepEqual(idValue(poss), idValue(selectedItem)))))}
283
+ {#each selected as selectedItem (keyValue(selectedItem, possibles.findIndex(poss => DeepEqual(idValue(poss), idValue(selectedItem)))))}
280
284
  <div class='flex min-w-0 rounded box-border overflow-hidden m-1'
281
285
  class:bg-slate-300={!disable}>
282
286
  <div class='overflow-hidden text-ellipsis whitespace-nowrap px-1 py-0 box-border select-none'>
@@ -360,7 +364,7 @@
360
364
  {createPrefix} {searchValue}
361
365
  </button>
362
366
  {/if}
363
- {#each listItems as listItem, idx (keyValue(listItem, idx))}
367
+ {#each listItems as listItem, idx (keyValue(listItem.item, idx))}
364
368
  <button type='button'
365
369
  class='btnClean w-full px-2 py-1 hover:bg-slate-200 text-left'
366
370
  onclick={() => doAdd(listItem.item)}
@@ -32,6 +32,8 @@ declare class __sveltets_Render<T extends TGenericMultiSelect> {
32
32
  autoFocus?: boolean;
33
33
  zIndex?: number;
34
34
  bodyClass?: string;
35
+ toggleClass?: string;
36
+ controlClass?: string;
35
37
  parentDivElement?: HTMLDivElement | null;
36
38
  form?: string | undefined;
37
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.1.89",
3
+ "version": "0.1.90",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",