firstly 0.0.12 → 0.0.14
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/CHANGELOG.md +16 -0
- package/esm/ROUTES.d.ts +2 -0
- package/esm/ROUTES.js +1 -0
- package/esm/api/index.d.ts +9 -0
- package/esm/api/index.js +3 -1
- package/esm/auth/AuthController.d.ts +12 -23
- package/esm/auth/AuthController.js +12 -31
- package/esm/auth/server/AuthController.server.d.ts +11 -11
- package/esm/auth/server/AuthController.server.js +99 -34
- package/esm/auth/server/handleGuard.d.ts +16 -0
- package/esm/auth/server/handleGuard.js +67 -0
- package/esm/auth/server/helperFirstly.d.ts +1 -1
- package/esm/auth/server/helperFirstly.js +1 -0
- package/esm/auth/server/index.d.ts +3 -1
- package/esm/auth/server/index.js +3 -1
- package/esm/auth/server/module.d.ts +105 -89
- package/esm/auth/server/module.js +55 -42
- package/esm/auth/server/providers/github.d.ts +4 -2
- package/esm/auth/server/providers/github.js +2 -2
- package/esm/auth/static/assets/Page-B0XXxe0N.d.ts +6 -0
- package/esm/auth/static/assets/Page-B0XXxe0N.js +1 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.d.ts +6 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.js +20 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.d.ts +6 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.js +1 -0
- package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
- package/esm/auth/static/assets/index-C9jzxOBu.d.ts +151 -0
- package/esm/auth/static/assets/index-C9jzxOBu.js +42 -0
- package/esm/auth/static/assets/index-DKWpA6v7.css +4 -0
- package/esm/auth/static/index.html +11 -11
- package/esm/auth/types.d.ts +26 -3
- package/esm/bin/cmd.js +423 -152
- package/esm/cellsBuildor.js +1 -1
- package/esm/common.d.ts +5 -0
- package/esm/common.js +8 -0
- package/esm/cron/server/index.js +1 -1
- package/esm/feedback/FeedbackController.js +58 -53
- package/esm/feedback/server/index.d.ts +6 -15
- package/esm/feedback/server/index.js +4 -5
- package/esm/feedback/types.d.ts +14 -0
- package/esm/feedback/types.js +4 -0
- package/esm/feedback/ui/DialogIssue.svelte +131 -119
- package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogIssues.svelte +108 -99
- package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogMilestones.svelte +40 -34
- package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
- package/esm/feedback/ui/Feedback.svelte +11 -9
- package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
- package/esm/index.d.ts +2 -5
- package/esm/index.js +2 -8
- package/esm/mail/server/index.d.ts +9 -2
- package/esm/mail/server/index.js +3 -1
- package/esm/mail/templates/DefaultMail.svelte +81 -61
- package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
- package/esm/server/index.d.ts +0 -0
- package/esm/server/index.js +1 -0
- package/esm/storeItem.d.ts +1 -4
- package/esm/storeItem.js +1 -1
- package/esm/storeList.d.ts +1 -4
- package/esm/sveltekit/server/index.d.ts +3 -9
- package/esm/sveltekit/server/index.js +3 -0
- package/esm/ui/Button.svelte +112 -89
- package/esm/ui/Button.svelte.d.ts +34 -24
- package/esm/ui/Clipboardable.svelte +24 -17
- package/esm/ui/Clipboardable.svelte.d.ts +34 -23
- package/esm/ui/Field.svelte +328 -285
- package/esm/ui/Field.svelte.d.ts +15 -8
- package/esm/ui/FieldGroup.svelte +112 -91
- package/esm/ui/FieldGroup.svelte.d.ts +17 -6
- package/esm/ui/Grid.svelte +322 -308
- package/esm/ui/Grid.svelte.d.ts +17 -6
- package/esm/ui/GridLoading.svelte +28 -27
- package/esm/ui/GridLoading.svelte.d.ts +19 -17
- package/esm/ui/GridPaginate.svelte +68 -61
- package/esm/ui/GridPaginate.svelte.d.ts +21 -19
- package/esm/ui/Icon.svelte +116 -80
- package/esm/ui/Icon.svelte.d.ts +52 -43
- package/esm/ui/Loading.svelte +10 -8
- package/esm/ui/Loading.svelte.d.ts +29 -18
- package/esm/ui/Tooltip.svelte +38 -35
- package/esm/ui/Tooltip.svelte.d.ts +30 -20
- package/esm/ui/dialog/DialogForm.svelte +70 -63
- package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
- package/esm/ui/dialog/DialogManagement.svelte +74 -74
- package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
- package/esm/ui/dialog/DialogPrimitive.svelte +82 -76
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
- package/esm/ui/dialog/FormEditAction.svelte +58 -50
- package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
- package/esm/ui/dialog/dialog.d.ts +1 -4
- package/esm/ui/internals/FieldContainer.svelte +24 -17
- package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
- package/esm/ui/internals/Input.svelte +136 -102
- package/esm/ui/internals/Input.svelte.d.ts +34 -32
- package/esm/ui/internals/Textarea.svelte +60 -52
- package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
- package/esm/ui/internals/select/MultiSelectMelt.svelte +243 -199
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
- package/esm/ui/internals/select/SelectMelt.svelte +254 -219
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
- package/esm/ui/internals/select/SelectRadio.svelte +39 -33
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
- package/esm/ui/link/Link.svelte +25 -20
- package/esm/ui/link/Link.svelte.d.ts +31 -23
- package/esm/ui/link/LinkPlus.svelte +52 -51
- package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
- package/esm/vite/index.d.ts +2 -3
- package/esm/vite/index.js +33 -26
- package/package.json +16 -20
- package/esm/auth/static/assets/Page-Bb8bFlrP.d.ts +0 -4
- package/esm/auth/static/assets/Page-Bb8bFlrP.js +0 -1
- package/esm/auth/static/assets/Page-BxomFlZ8.d.ts +0 -4
- package/esm/auth/static/assets/Page-BxomFlZ8.js +0 -1
- package/esm/auth/static/assets/Page-CaIYu0-y.d.ts +0 -6
- package/esm/auth/static/assets/Page-CaIYu0-y.js +0 -19
- package/esm/auth/static/assets/Page-MkYglNtu.css +0 -1
- package/esm/auth/static/assets/index-Bl0Bk5u0.d.ts +0 -64
- package/esm/auth/static/assets/index-Bl0Bk5u0.js +0 -2
- package/esm/auth/static/assets/index-R27C_TlP.css +0 -4
|
@@ -1,214 +1,258 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export let
|
|
18
|
-
export let
|
|
19
|
-
export let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createCombobox, createSync, type ComboboxOptionProps } from '@melt-ui/svelte'
|
|
3
|
+
import { createEventDispatcher, onMount } from 'svelte'
|
|
4
|
+
import { fly } from 'svelte/transition'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
LibIcon_Check,
|
|
8
|
+
LibIcon_Cross,
|
|
9
|
+
LibIcon_MultiCheck,
|
|
10
|
+
LibIcon_Search,
|
|
11
|
+
tw,
|
|
12
|
+
type BaseItem,
|
|
13
|
+
type FF_Icon,
|
|
14
|
+
} from '../../..'
|
|
15
|
+
import Icon from '../../Icon.svelte'
|
|
16
|
+
|
|
17
|
+
export let id: string
|
|
18
|
+
export let disabled: boolean = false
|
|
19
|
+
export let placeholder: string = ''
|
|
20
|
+
export let items: BaseItem[] = []
|
|
21
|
+
let totalCount: number | undefined = undefined
|
|
22
|
+
|
|
23
|
+
export let loadOptions:
|
|
24
|
+
| ((str: string) => Promise<{ items: BaseItem[]; totalCount: number }>)
|
|
25
|
+
| undefined = undefined
|
|
26
|
+
export let values: string[] | undefined = undefined
|
|
27
|
+
export let clearable = false
|
|
28
|
+
|
|
29
|
+
const dispatch = createEventDispatcher()
|
|
30
|
+
|
|
31
|
+
function dispatchSelectedValues(_data: BaseItem[] | undefined) {
|
|
32
|
+
values = _data?.map((_data) => _data.id)
|
|
33
|
+
dispatch('selected', _data)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onMount(async () => {
|
|
37
|
+
if (loadOptions) {
|
|
38
|
+
const lo = await loadOptions('')
|
|
39
|
+
items = lo.items
|
|
40
|
+
totalCount = lo.totalCount
|
|
41
|
+
filteredItems = items
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const getDefaultValues = (_selectedValue: string[] | undefined) => {
|
|
46
|
+
if (!items) {
|
|
47
|
+
return []
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const f = items.filter((c) => (_selectedValue ?? []).includes(String(c.id)))
|
|
51
|
+
if (f) {
|
|
52
|
+
return f.map((c) => toOption(c))
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return []
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const toOption = (
|
|
59
|
+
item: BaseItem,
|
|
60
|
+
): ComboboxOptionProps<BaseItem> & {
|
|
61
|
+
icon?: FF_Icon
|
|
62
|
+
} => ({
|
|
63
|
+
value: item,
|
|
64
|
+
label: item.caption,
|
|
65
|
+
// icon: item.icon,
|
|
66
|
+
// disabled: item.disabled,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const {
|
|
70
|
+
elements: { menu, input, option },
|
|
71
|
+
states: { open, inputValue, touchedInput, selected: localSelected },
|
|
72
|
+
helpers: { isSelected },
|
|
73
|
+
} = createCombobox<BaseItem, true>({
|
|
74
|
+
forceVisible: true,
|
|
75
|
+
multiple: true,
|
|
76
|
+
disabled,
|
|
77
|
+
ids: { label: id },
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const clearSelection = () => {
|
|
81
|
+
sync.selected(undefined)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let debounceTimer: ReturnType<typeof setTimeout>
|
|
85
|
+
const debounce = (callback: () => void) => {
|
|
86
|
+
clearTimeout(debounceTimer)
|
|
87
|
+
debounceTimer = setTimeout(
|
|
88
|
+
callback,
|
|
89
|
+
// debounce only if we have a load option
|
|
90
|
+
loadOptions ? 444 : 0,
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const sync = createSync({ selected: localSelected })
|
|
95
|
+
$: items &&
|
|
96
|
+
sync.selected(getDefaultValues(values), (v) => {
|
|
97
|
+
const list = (v ?? []).map((c) => c.value.id)
|
|
98
|
+
|
|
99
|
+
// Create a map to count occurrences of each element
|
|
100
|
+
const countMap: Map<string, number> = new Map()
|
|
101
|
+
|
|
102
|
+
list.forEach((item) => {
|
|
103
|
+
countMap.set(item, (countMap.get(item) || 0) + 1)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
// Filter the list to include only elements that occur exactly once
|
|
107
|
+
const uniqueList: string[] = list.filter((item) => countMap.get(item) === 1)
|
|
108
|
+
|
|
109
|
+
const newIds = uniqueList.sort().join(',')
|
|
110
|
+
const oldSelectedValues = (values ?? []).sort().join(',')
|
|
111
|
+
|
|
112
|
+
if (newIds !== oldSelectedValues) {
|
|
113
|
+
dispatchSelectedValues(
|
|
114
|
+
v === undefined
|
|
115
|
+
? undefined
|
|
116
|
+
: v.filter((c) => uniqueList.includes(c.value.id)).map((c) => c.value),
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const labelToDisplayInInput = (_localSelected: typeof $localSelected) => {
|
|
122
|
+
if (_localSelected === undefined || _localSelected.length === 0) {
|
|
123
|
+
return ''
|
|
124
|
+
}
|
|
125
|
+
if (_localSelected.length === 1) {
|
|
126
|
+
return _localSelected[0].label ?? ''
|
|
127
|
+
}
|
|
128
|
+
return `${_localSelected.length} éléments`
|
|
129
|
+
}
|
|
130
|
+
$: $inputValue = labelToDisplayInInput($localSelected)
|
|
131
|
+
|
|
132
|
+
const iconToDisplayInInput = (_localSelected: typeof $localSelected): FF_Icon => {
|
|
133
|
+
if (_localSelected === undefined || _localSelected.length === 0) {
|
|
134
|
+
return { data: LibIcon_Search }
|
|
135
|
+
}
|
|
136
|
+
if (_localSelected.length === 1) {
|
|
137
|
+
return _localSelected[0].value.icon ?? { data: LibIcon_Search }
|
|
138
|
+
}
|
|
139
|
+
return { data: LibIcon_MultiCheck }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const isChecked = (_localSelected: typeof $localSelected, _item: BaseItem) => {
|
|
143
|
+
const f = (_localSelected ?? []).filter((c) => c.value?.id === _item.id)
|
|
144
|
+
if (f.length > 0) {
|
|
145
|
+
return true
|
|
146
|
+
}
|
|
147
|
+
return false
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
let filteredItems = items
|
|
151
|
+
const calcFilteredItems = (touched: boolean, str: string, values: any) => {
|
|
152
|
+
if (touched && !str.endsWith(' éléments')) {
|
|
153
|
+
debounce(async () => {
|
|
154
|
+
const normalizedInput = str.toLowerCase()
|
|
155
|
+
|
|
156
|
+
// In a Multi select we can't filter to the server.
|
|
157
|
+
// If we do I don't knwo what to set to $inputValue. and and list gets shorter... So what do we do about items that are selected but not in the list anymore (because of the filter) ?
|
|
158
|
+
// if (loadOptions) {
|
|
159
|
+
// const lo = await loadOptions(normalizedInput)
|
|
160
|
+
// items = lo.items
|
|
161
|
+
// totalCount = lo.totalCount
|
|
162
|
+
// filteredItems = items
|
|
163
|
+
// } else {
|
|
164
|
+
filteredItems = items.filter((item) => {
|
|
165
|
+
return item.caption?.toLowerCase().includes(normalizedInput)
|
|
166
|
+
})
|
|
167
|
+
// }
|
|
168
|
+
})
|
|
169
|
+
} else {
|
|
170
|
+
filteredItems = items
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
$: calcFilteredItems($touchedInput, $inputValue, values)
|
|
127
175
|
</script>
|
|
128
176
|
|
|
129
177
|
<div class="input input-bordered flex min-w-0 items-center">
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<Icon data={LibIcon_Cross}></Icon>
|
|
152
|
-
</button>
|
|
153
|
-
{/if}
|
|
154
|
-
<!-- {#if $open}
|
|
178
|
+
<div class="relative">
|
|
179
|
+
{#if iconToDisplayInInput($localSelected)}
|
|
180
|
+
{@const ico = iconToDisplayInInput($localSelected)}
|
|
181
|
+
<Icon data={ico?.data} class={tw(['relative', ico?.class])} style={ico?.style} size={ico?.size}
|
|
182
|
+
></Icon>
|
|
183
|
+
{/if}
|
|
184
|
+
</div>
|
|
185
|
+
<!-- {id} -->
|
|
186
|
+
<input
|
|
187
|
+
{...$input}
|
|
188
|
+
use:$input.action
|
|
189
|
+
class="-ml-8 -mr-5 h-full min-w-0 flex-grow bg-transparent px-10"
|
|
190
|
+
{placeholder}
|
|
191
|
+
/>
|
|
192
|
+
<div class="pointer-events-none relative right-0 flex gap-2">
|
|
193
|
+
{#if clearable && $localSelected && $localSelected.length > 0}
|
|
194
|
+
<button on:click={clearSelection} class="pointer-events-auto">
|
|
195
|
+
<Icon data={LibIcon_Cross}></Icon>
|
|
196
|
+
</button>
|
|
197
|
+
{/if}
|
|
198
|
+
<!-- {#if $open}
|
|
155
199
|
<Icon data={LibIcon_ChevronUp}></Icon>
|
|
156
200
|
{:else}
|
|
157
201
|
<Icon data={LibIcon_ChevronDown}></Icon>
|
|
158
202
|
{/if} -->
|
|
159
|
-
|
|
203
|
+
</div>
|
|
160
204
|
</div>
|
|
161
205
|
|
|
162
206
|
{#if $open}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
207
|
+
<ul
|
|
208
|
+
class="border-base-content/20 z-50 flex max-h-[300px] flex-col overflow-hidden rounded-lg border"
|
|
209
|
+
{...$menu}
|
|
210
|
+
use:$menu.action
|
|
211
|
+
transition:fly={{ duration: 150, y: -5 }}
|
|
212
|
+
>
|
|
213
|
+
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
|
214
|
+
<div class="bg-base-100 flex max-h-full flex-col gap-0 overflow-y-auto py-2" tabindex="0">
|
|
215
|
+
{#each filteredItems as item, index (index)}
|
|
216
|
+
<li
|
|
217
|
+
{...$option(toOption(item))}
|
|
218
|
+
use:$option.action
|
|
219
|
+
class="data-[highlighted]:bg-primary data-[highlighted]:text-primary-content relative flex cursor-pointer scroll-my-2 items-center
|
|
176
220
|
rounded-md
|
|
177
221
|
px-1
|
|
178
222
|
py-2
|
|
179
223
|
data-[disabled]:opacity-50"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
224
|
+
>
|
|
225
|
+
{#if isChecked($localSelected, item)}
|
|
226
|
+
<Icon data={LibIcon_Check} class="w-6"></Icon>
|
|
227
|
+
{:else}
|
|
228
|
+
<!-- just to book the place -->
|
|
229
|
+
<span class="w-6"></span>
|
|
230
|
+
{/if}
|
|
231
|
+
{#if item.icon?.data}
|
|
232
|
+
<Icon
|
|
233
|
+
data={item.icon.data}
|
|
234
|
+
class={tw(['flex-shrink-0', item.icon.class])}
|
|
235
|
+
style={item.icon.style}
|
|
236
|
+
size={item.icon.size}
|
|
237
|
+
></Icon>
|
|
238
|
+
{/if}
|
|
239
|
+
<div class="pl-2 {item.class}">
|
|
240
|
+
<span class="font-medium">{item.caption}</span>
|
|
241
|
+
</div>
|
|
242
|
+
</li>
|
|
243
|
+
{:else}
|
|
244
|
+
<li class="relative cursor-pointer rounded-md py-1 pl-8 pr-4">Aucun résultat</li>
|
|
245
|
+
{/each}
|
|
246
|
+
</div>
|
|
247
|
+
{#if totalCount}
|
|
248
|
+
<div class="bg-base-300 z-50 text-center text-xs">
|
|
249
|
+
{#if items.length < totalCount}
|
|
250
|
+
({items.length} / {totalCount})
|
|
251
|
+
{:else}
|
|
252
|
+
<!-- yes, items.length can be bigger if the selected item is not in the limit -->
|
|
253
|
+
({items.length})
|
|
254
|
+
{/if}
|
|
255
|
+
</div>
|
|
256
|
+
{/if}
|
|
257
|
+
</ul>
|
|
214
258
|
{/if}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type BaseItem } from '../../..';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
values?: string[] | undefined;
|
|
14
|
-
clearable?: boolean;
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
selected: CustomEvent<any>;
|
|
18
|
-
} & {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
exports?: {} | undefined;
|
|
23
|
-
bindings?: string | undefined;
|
|
24
|
-
};
|
|
25
|
-
export type MultiSelectMeltProps = typeof __propDef.props;
|
|
26
|
-
export type MultiSelectMeltEvents = typeof __propDef.events;
|
|
27
|
-
export type MultiSelectMeltSlots = typeof __propDef.slots;
|
|
28
|
-
export default class MultiSelectMelt extends SvelteComponent<MultiSelectMeltProps, MultiSelectMeltEvents, MultiSelectMeltSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
29
14
|
}
|
|
30
|
-
|
|
15
|
+
declare const MultiSelectMelt: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
id: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
items?: BaseItem[];
|
|
20
|
+
loadOptions?: ((str: string) => Promise<{
|
|
21
|
+
items: BaseItem[];
|
|
22
|
+
totalCount: number;
|
|
23
|
+
}>) | undefined;
|
|
24
|
+
values?: string[] | undefined;
|
|
25
|
+
clearable?: boolean;
|
|
26
|
+
}, {
|
|
27
|
+
selected: CustomEvent<any>;
|
|
28
|
+
} & {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {}, {}, string>;
|
|
31
|
+
type MultiSelectMelt = InstanceType<typeof MultiSelectMelt>;
|
|
32
|
+
export default MultiSelectMelt;
|