intelliwaketssveltekitv25 0.1.89 → 0.1.91
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.
- package/dist/InputNumber.svelte +14 -6
- package/dist/Modal.svelte +7 -0
- package/dist/Modal.svelte.d.ts +2 -0
- package/dist/ModalFormAction.svelte +7 -1
- package/dist/ModalFormAction.svelte.d.ts +2 -0
- package/dist/MultiSelect.svelte +8 -4
- package/dist/MultiSelect.svelte.d.ts +2 -0
- package/package.json +1 -1
package/dist/InputNumber.svelte
CHANGED
|
@@ -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
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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>
|
package/dist/Modal.svelte
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
import { type Snippet, tick } from 'svelte'
|
|
11
11
|
import ActivityOverlay from './ActivityOverlay.svelte'
|
|
12
12
|
import { CleanNumber } from '@solidbasisventures/intelliwaketsfoundation'
|
|
13
|
+
import type { IFAProps } from './Definitions'
|
|
14
|
+
import { Icon } from './index'
|
|
13
15
|
|
|
14
16
|
let {
|
|
15
17
|
header,
|
|
@@ -24,6 +26,7 @@
|
|
|
24
26
|
okButton = 'OK',
|
|
25
27
|
okActionNotOnEnter = false,
|
|
26
28
|
okDisabled = false,
|
|
29
|
+
okFAProps,
|
|
27
30
|
noCloseOnOK = true,
|
|
28
31
|
overflowVisible = false,
|
|
29
32
|
disable = false,
|
|
@@ -54,6 +57,7 @@
|
|
|
54
57
|
width?: string
|
|
55
58
|
cancelButton?: string | false
|
|
56
59
|
okButton?: string | false
|
|
60
|
+
okFAProps?: IFAProps
|
|
57
61
|
okActionNotOnEnter?: boolean
|
|
58
62
|
okDisabled?: boolean
|
|
59
63
|
noCloseOnOK?: boolean
|
|
@@ -265,6 +269,9 @@
|
|
|
265
269
|
bind:this={okButtonElement}
|
|
266
270
|
onclick={okAction}
|
|
267
271
|
disabled={okDisabled}>
|
|
272
|
+
{#if okFAProps}
|
|
273
|
+
<Icon fw {...okFAProps} />
|
|
274
|
+
{/if}
|
|
268
275
|
{okButton}
|
|
269
276
|
</button>
|
|
270
277
|
{/if}
|
package/dist/Modal.svelte.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { IFAProps } from './Definitions';
|
|
2
3
|
type $$ComponentProps = {
|
|
3
4
|
header?: Snippet;
|
|
4
5
|
body?: Snippet;
|
|
@@ -12,6 +13,7 @@ type $$ComponentProps = {
|
|
|
12
13
|
width?: string;
|
|
13
14
|
cancelButton?: string | false;
|
|
14
15
|
okButton?: string | false;
|
|
16
|
+
okFAProps?: IFAProps;
|
|
15
17
|
okActionNotOnEnter?: boolean;
|
|
16
18
|
okDisabled?: boolean;
|
|
17
19
|
noCloseOnOK?: boolean;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { FormEnhance } from './FormEnhance'
|
|
6
6
|
import { enhance } from '$app/forms'
|
|
7
7
|
import { CleanNumber } from '@solidbasisventures/intelliwaketsfoundation'
|
|
8
|
+
import { Icon, type IFAProps } from './index'
|
|
8
9
|
|
|
9
10
|
let {
|
|
10
11
|
header,
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
cancelButton = 'Cancel',
|
|
20
21
|
okButton = 'OK',
|
|
21
22
|
okDisabled = false,
|
|
23
|
+
okFAProps,
|
|
22
24
|
noCloseOnOK = false,
|
|
23
25
|
overflowVisible = false,
|
|
24
26
|
disable = false,
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
cancelButton?: string | false
|
|
46
48
|
okButton?: string | false
|
|
47
49
|
okDisabled?: boolean
|
|
50
|
+
okFAProps?: IFAProps
|
|
48
51
|
noCloseOnOK?: boolean
|
|
49
52
|
overflowVisible?: boolean
|
|
50
53
|
disable?: boolean
|
|
@@ -158,7 +161,7 @@
|
|
|
158
161
|
onmousemove={doMouseMove} />
|
|
159
162
|
|
|
160
163
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
161
|
-
<dialog class='bg-white shadow-xl
|
|
164
|
+
<dialog class='bg-white shadow-xl rounded-lg overflow-hidden w-full p-0 max-w-full
|
|
162
165
|
dark:bg-slate-600 dark:text-white m-auto {clazz}'
|
|
163
166
|
class:overflow-y-visible={overflowVisible}
|
|
164
167
|
class:overflow-hidden={!overflowVisible}
|
|
@@ -235,6 +238,9 @@
|
|
|
235
238
|
type='submit'
|
|
236
239
|
class:whitespace-nowrap={!okButtonWrap}
|
|
237
240
|
disabled={okDisabled}>
|
|
241
|
+
{#if okFAProps}
|
|
242
|
+
<Icon fw {...okFAProps} />
|
|
243
|
+
{/if}
|
|
238
244
|
{okButton}
|
|
239
245
|
</button>
|
|
240
246
|
{/if}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
2
|
import type { TEnhanceOptions } from './FormEnhance';
|
|
3
|
+
import { type IFAProps } from './index';
|
|
3
4
|
type $$ComponentProps = {
|
|
4
5
|
header?: Snippet;
|
|
5
6
|
body?: Snippet;
|
|
@@ -13,6 +14,7 @@ type $$ComponentProps = {
|
|
|
13
14
|
cancelButton?: string | false;
|
|
14
15
|
okButton?: string | false;
|
|
15
16
|
okDisabled?: boolean;
|
|
17
|
+
okFAProps?: IFAProps;
|
|
16
18
|
noCloseOnOK?: boolean;
|
|
17
19
|
overflowVisible?: boolean;
|
|
18
20
|
disable?: boolean;
|
package/dist/MultiSelect.svelte
CHANGED
|
@@ -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.
|
|
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
|
};
|