firstly 0.0.1 → 0.0.3
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 +15 -0
- package/LICENSE +18 -0
- package/README.md +12 -0
- package/esm/KitBaseEnum.d.ts +35 -0
- package/esm/KitBaseEnum.js +32 -0
- package/esm/KitEntity.d.ts +2 -0
- package/esm/KitEntity.js +24 -0
- package/esm/KitFields.d.ts +10 -0
- package/esm/KitFields.js +196 -0
- package/esm/ROUTES.d.ts +88 -0
- package/esm/ROUTES.js +98 -0
- package/esm/SqlDatabase/LogToConsoleCustom.d.ts +1 -0
- package/esm/SqlDatabase/LogToConsoleCustom.js +102 -0
- package/esm/api/index.d.ts +42 -0
- package/esm/api/index.js +97 -0
- package/esm/auth/Adapter.d.ts +10 -0
- package/esm/auth/Adapter.js +54 -0
- package/esm/auth/AuthController.d.ts +59 -0
- package/esm/auth/AuthController.js +434 -0
- package/esm/auth/Entities.d.ts +39 -0
- package/esm/auth/Entities.js +154 -0
- package/esm/auth/RoleController.d.ts +14 -0
- package/esm/auth/RoleController.js +57 -0
- package/esm/auth/helper.d.ts +1 -0
- package/esm/auth/helper.js +7 -0
- package/esm/auth/index.d.ts +153 -0
- package/esm/auth/index.js +280 -0
- package/esm/auth/providers/github.d.ts +25 -0
- package/esm/auth/providers/github.js +51 -0
- package/esm/auth/providers/index.d.ts +3 -0
- package/esm/auth/providers/index.js +26 -0
- package/esm/auth/providers/strava.d.ts +25 -0
- package/esm/auth/providers/strava.js +51 -0
- package/esm/auth/static/assets/Page-BMFREPjF.d.ts +5 -0
- package/esm/auth/static/assets/Page-BMFREPjF.js +18 -0
- package/esm/auth/static/assets/Page-BMOLAIFx.d.ts +5 -0
- package/esm/auth/static/assets/Page-BMOLAIFx.js +1 -0
- package/esm/auth/static/assets/Page-BwHye0GW.d.ts +5 -0
- package/esm/auth/static/assets/Page-BwHye0GW.js +1 -0
- package/esm/auth/static/assets/Page-gV58jf2r.css +1 -0
- package/esm/auth/static/assets/index-CKmKKRRL.d.ts +53 -0
- package/esm/auth/static/assets/index-CKmKKRRL.js +2 -0
- package/esm/auth/static/assets/index-R27C_TlP.css +4 -0
- package/esm/auth/static/favicon.svg +79 -0
- package/esm/auth/static/index.html +14 -0
- package/esm/auth/types.d.ts +33 -0
- package/esm/auth/types.js +1 -0
- package/esm/bin/cmd.d.ts +1 -0
- package/esm/bin/cmd.js +418 -0
- package/esm/changeLog/index.d.ts +55 -0
- package/esm/changeLog/index.js +179 -0
- package/esm/cron/index.d.ts +60 -0
- package/esm/cron/index.js +102 -0
- package/esm/feedback/FeedbackController.d.ts +30 -0
- package/esm/feedback/FeedbackController.js +313 -0
- package/esm/feedback/index.d.ts +18 -0
- package/esm/feedback/index.js +14 -0
- package/esm/feedback/ui/DialogIssue.svelte +102 -0
- package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -0
- package/esm/feedback/ui/DialogIssues.svelte +91 -0
- package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -0
- package/esm/feedback/ui/DialogMilestones.svelte +38 -0
- package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -0
- package/esm/feedback/ui/Feedback.svelte +12 -0
- package/esm/feedback/ui/Feedback.svelte.d.ts +16 -0
- package/esm/formats/dates.d.ts +18 -0
- package/esm/formats/dates.js +35 -0
- package/esm/formats/index.d.ts +4 -0
- package/esm/formats/index.js +3 -0
- package/esm/formats/numbers.d.ts +4 -0
- package/esm/formats/numbers.js +34 -0
- package/esm/formats/strings.d.ts +11 -0
- package/esm/formats/strings.js +109 -0
- package/esm/handle/index.d.ts +7 -0
- package/esm/handle/index.js +40 -0
- package/esm/helper.d.ts +50 -0
- package/esm/helper.js +118 -0
- package/esm/index.d.ts +103 -0
- package/esm/index.js +42 -0
- package/esm/kitCellsBuildor.d.ts +45 -0
- package/esm/kitCellsBuildor.js +105 -0
- package/esm/kitStoreItem.d.ts +28 -0
- package/esm/kitStoreItem.js +170 -0
- package/esm/kitStoreList.d.ts +33 -0
- package/esm/kitStoreList.js +98 -0
- package/esm/mail/index.d.ts +11 -0
- package/esm/mail/index.js +51 -0
- package/esm/theme.d.ts +4 -0
- package/esm/theme.js +4 -0
- package/esm/ui/Button.svelte +102 -0
- package/esm/ui/Button.svelte.d.ts +27 -0
- package/esm/ui/Clipboardable.svelte +19 -0
- package/esm/ui/Clipboardable.svelte.d.ts +25 -0
- package/esm/ui/Field.svelte +288 -0
- package/esm/ui/Field.svelte.d.ts +29 -0
- package/esm/ui/FieldGroup.svelte +91 -0
- package/esm/ui/FieldGroup.svelte.d.ts +30 -0
- package/esm/ui/Grid.svelte +246 -0
- package/esm/ui/Grid.svelte.d.ts +46 -0
- package/esm/ui/GridLoading.svelte +32 -0
- package/esm/ui/GridLoading.svelte.d.ts +20 -0
- package/esm/ui/GridPaginate.svelte +66 -0
- package/esm/ui/GridPaginate.svelte.d.ts +22 -0
- package/esm/ui/Icon.svelte +86 -0
- package/esm/ui/Icon.svelte.d.ts +46 -0
- package/esm/ui/LibIcon.d.ts +23 -0
- package/esm/ui/LibIcon.js +28 -0
- package/esm/ui/Loading.svelte +11 -0
- package/esm/ui/Loading.svelte.d.ts +20 -0
- package/esm/ui/Tooltip.svelte +42 -0
- package/esm/ui/Tooltip.svelte.d.ts +22 -0
- package/esm/ui/dialog/DialogForm.svelte +70 -0
- package/esm/ui/dialog/DialogForm.svelte.d.ts +19 -0
- package/esm/ui/dialog/DialogManagement.svelte +87 -0
- package/esm/ui/dialog/DialogManagement.svelte.d.ts +25 -0
- package/esm/ui/dialog/DialogPrimitive.svelte +89 -0
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +28 -0
- package/esm/ui/dialog/FormEditAction.svelte +54 -0
- package/esm/ui/dialog/FormEditAction.svelte.d.ts +24 -0
- package/esm/ui/dialog/dialog.d.ts +51 -0
- package/esm/ui/dialog/dialog.js +98 -0
- package/esm/ui/index.d.ts +5 -0
- package/esm/ui/index.js +19 -0
- package/esm/ui/internals/FieldContainer.svelte +22 -0
- package/esm/ui/internals/FieldContainer.svelte.d.ts +30 -0
- package/esm/ui/internals/Input.svelte +98 -0
- package/esm/ui/internals/Input.svelte.d.ts +35 -0
- package/esm/ui/internals/Textarea.svelte +61 -0
- package/esm/ui/internals/Textarea.svelte.d.ts +30 -0
- package/esm/ui/internals/select/MultiSelectMelt.svelte +217 -0
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +30 -0
- package/esm/ui/internals/select/SelectMelt.svelte +238 -0
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +35 -0
- package/esm/ui/internals/select/SelectRadio.svelte +37 -0
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +25 -0
- package/esm/ui/link/Link.svelte +28 -0
- package/esm/ui/link/Link.svelte.d.ts +25 -0
- package/esm/ui/link/LinkPlus.svelte +44 -0
- package/esm/ui/link/LinkPlus.svelte.d.ts +21 -0
- package/esm/utils/tailwind.d.ts +2 -0
- package/esm/utils/tailwind.js +3 -0
- package/esm/utils/transition.d.ts +10 -0
- package/esm/utils/transition.js +33 -0
- package/esm/utils/types.d.ts +17 -0
- package/esm/utils/types.js +17 -0
- package/esm/virtual/Customer.d.ts +4 -0
- package/esm/virtual/Customer.js +24 -0
- package/esm/virtual/FilterEntity.d.ts +7 -0
- package/esm/virtual/FilterEntity.js +34 -0
- package/esm/virtual/StateDemoEnum.d.ts +9 -0
- package/esm/virtual/StateDemoEnum.js +42 -0
- package/esm/virtual/UIEntity.d.ts +16 -0
- package/esm/virtual/UIEntity.js +84 -0
- package/esm/vite/index.d.ts +8 -0
- package/esm/vite/index.js +47 -0
- package/package.json +94 -10
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
<script>import { createCombobox, createSync } from "@melt-ui/svelte";
|
|
2
|
+
import { createEventDispatcher, onMount, tick } from "svelte";
|
|
3
|
+
import { fly } from "svelte/transition";
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
LibIcon_Check,
|
|
7
|
+
LibIcon_Cross,
|
|
8
|
+
LibIcon_Search,
|
|
9
|
+
tw
|
|
10
|
+
} from "../../../";
|
|
11
|
+
import Icon from "../../Icon.svelte";
|
|
12
|
+
export let id;
|
|
13
|
+
export let disabled = false;
|
|
14
|
+
export let placeholder = "";
|
|
15
|
+
export let items = [];
|
|
16
|
+
let totalCount = void 0;
|
|
17
|
+
export let focus = false;
|
|
18
|
+
const focusNow = (node) => {
|
|
19
|
+
if (focus) {
|
|
20
|
+
tick().then(() => {
|
|
21
|
+
node.focus();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export let loadOptions = void 0;
|
|
26
|
+
export let value = void 0;
|
|
27
|
+
export let clearable = false;
|
|
28
|
+
export let createOptionWhenNoResult = false;
|
|
29
|
+
export let default_select_if_one_item = false;
|
|
30
|
+
const dispatch = createEventDispatcher();
|
|
31
|
+
function dispatchSelectedValue(_data) {
|
|
32
|
+
dispatch("selected", _data);
|
|
33
|
+
}
|
|
34
|
+
function dispatchIssue(msg) {
|
|
35
|
+
dispatch("issue", msg);
|
|
36
|
+
}
|
|
37
|
+
function dispatchCreateRequest(e, input2) {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
dispatch("createRequest", input2);
|
|
40
|
+
}
|
|
41
|
+
let lastSearch = void 0;
|
|
42
|
+
const localLoadOptions = async (str) => {
|
|
43
|
+
if (str === lastSearch) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
lastSearch = str;
|
|
47
|
+
if (loadOptions) {
|
|
48
|
+
const lo = await loadOptions(str);
|
|
49
|
+
items = lo.items;
|
|
50
|
+
totalCount = lo.totalCount;
|
|
51
|
+
filteredItems = items;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
onMount(async () => {
|
|
55
|
+
localLoadOptions("");
|
|
56
|
+
sync.selected(getDefaultValue(value));
|
|
57
|
+
});
|
|
58
|
+
const getDefaultValue = (_selectedValue) => {
|
|
59
|
+
if (!items) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const found = items.find((c) => String(c?.id) === String(_selectedValue));
|
|
63
|
+
if (found) {
|
|
64
|
+
return toOption(found);
|
|
65
|
+
} else {
|
|
66
|
+
if (value !== null && value !== void 0 && items.length > 0) {
|
|
67
|
+
dispatchIssue("VALUE_NOT_IN_ITEMS");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const toOption = (item) => ({
|
|
72
|
+
value: item,
|
|
73
|
+
label: item.caption
|
|
74
|
+
// icon: item.icon,
|
|
75
|
+
// disabled: item.disabled,
|
|
76
|
+
});
|
|
77
|
+
const {
|
|
78
|
+
elements: { menu, input, option },
|
|
79
|
+
states: { open, inputValue, touchedInput, selected: localSelected }
|
|
80
|
+
// helpers: { isSelected },
|
|
81
|
+
} = createCombobox({
|
|
82
|
+
forceVisible: true,
|
|
83
|
+
disabled,
|
|
84
|
+
ids: { label: id }
|
|
85
|
+
});
|
|
86
|
+
const clearSelection = () => {
|
|
87
|
+
sync.selected(void 0);
|
|
88
|
+
};
|
|
89
|
+
let debounceTimer;
|
|
90
|
+
const debounce = (callback) => {
|
|
91
|
+
clearTimeout(debounceTimer);
|
|
92
|
+
debounceTimer = setTimeout(
|
|
93
|
+
callback,
|
|
94
|
+
// debounce only if we have a load option
|
|
95
|
+
loadOptions ? 444 : 0
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
const sync = createSync({ selected: localSelected });
|
|
99
|
+
$:
|
|
100
|
+
items && sync.selected(getDefaultValue(value), (v) => {
|
|
101
|
+
if (v?.value?.id !== value) {
|
|
102
|
+
dispatchSelectedValue(v?.value);
|
|
103
|
+
}
|
|
104
|
+
value = v?.value?.id;
|
|
105
|
+
});
|
|
106
|
+
$:
|
|
107
|
+
if (!$open) {
|
|
108
|
+
$inputValue = $localSelected?.label ?? "";
|
|
109
|
+
}
|
|
110
|
+
$:
|
|
111
|
+
filteredItems = items;
|
|
112
|
+
$: {
|
|
113
|
+
if (items.length === 1 && default_select_if_one_item) {
|
|
114
|
+
sync.selected(toOption(items[0]));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const calcFilteredItems = (touched, str, value2) => {
|
|
118
|
+
if (touched) {
|
|
119
|
+
debounce(async () => {
|
|
120
|
+
const normalizedInput = str.toLowerCase();
|
|
121
|
+
updateFilteredItems(normalizedInput);
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
updateFilteredItems("");
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const updateFilteredItems = async (normalizedInput) => {
|
|
128
|
+
if (loadOptions) {
|
|
129
|
+
await localLoadOptions(normalizedInput);
|
|
130
|
+
} else {
|
|
131
|
+
filteredItems = items.filter((item) => {
|
|
132
|
+
return item.caption?.toLowerCase().includes(normalizedInput);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
$:
|
|
137
|
+
calcFilteredItems($touchedInput, $inputValue, value);
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<div class="input input-bordered flex min-w-0 items-center {disabled && 'opacity-40'}">
|
|
141
|
+
<div class="relative">
|
|
142
|
+
{#if $localSelected?.value?.icon?.data}
|
|
143
|
+
<Icon
|
|
144
|
+
data={$localSelected.value.icon.data}
|
|
145
|
+
class={tw(['relative', $localSelected.value.icon.class])}
|
|
146
|
+
style={$localSelected.value.icon.style}
|
|
147
|
+
size={$localSelected.value.icon.size}
|
|
148
|
+
></Icon>
|
|
149
|
+
{:else}
|
|
150
|
+
<Icon data={LibIcon_Search} class="relative"></Icon>
|
|
151
|
+
{/if}
|
|
152
|
+
</div>
|
|
153
|
+
<!-- {id} -->
|
|
154
|
+
<input
|
|
155
|
+
{...$input}
|
|
156
|
+
use:$input.action
|
|
157
|
+
class="-ml-8 -mr-5 h-full min-w-0 flex-grow bg-transparent px-10"
|
|
158
|
+
{placeholder}
|
|
159
|
+
use:focusNow
|
|
160
|
+
/>
|
|
161
|
+
<div class="pointer-events-none relative right-0 flex gap-2">
|
|
162
|
+
{#if clearable && $localSelected}
|
|
163
|
+
<button on:click={clearSelection} class="pointer-events-auto">
|
|
164
|
+
<Icon data={LibIcon_Cross}></Icon>
|
|
165
|
+
</button>
|
|
166
|
+
{/if}
|
|
167
|
+
<!-- {#if $open}
|
|
168
|
+
<Icon data={LibIcon_ChevronUp}></Icon>
|
|
169
|
+
{:else}
|
|
170
|
+
<Icon data={LibIcon_ChevronDown}></Icon>
|
|
171
|
+
{/if} -->
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
{#if $open}
|
|
176
|
+
<ul
|
|
177
|
+
class="border-base-content/20 z-50 flex max-h-[300px] flex-col overflow-hidden rounded-lg border"
|
|
178
|
+
{...$menu}
|
|
179
|
+
use:$menu.action
|
|
180
|
+
transition:fly={{ duration: 150, y: -5 }}
|
|
181
|
+
>
|
|
182
|
+
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
|
183
|
+
<div class="bg-base-100 flex max-h-full flex-col gap-0 overflow-y-auto py-2" tabindex="0">
|
|
184
|
+
{#each filteredItems as item, index (index)}
|
|
185
|
+
<li
|
|
186
|
+
{...$option(toOption(item))}
|
|
187
|
+
use:$option.action
|
|
188
|
+
class="data-[highlighted]:bg-primary data-[highlighted]:text-primary-content relative flex cursor-pointer scroll-my-2 items-center
|
|
189
|
+
rounded-md
|
|
190
|
+
px-1
|
|
191
|
+
py-2
|
|
192
|
+
data-[disabled]:opacity-50"
|
|
193
|
+
>
|
|
194
|
+
{#if $localSelected?.value?.id === item.id}
|
|
195
|
+
<Icon data={LibIcon_Check} class="w-6"></Icon>
|
|
196
|
+
{:else}
|
|
197
|
+
<!-- just to book the place -->
|
|
198
|
+
<span class="w-6"></span>
|
|
199
|
+
{/if}
|
|
200
|
+
{#if item.icon?.data}
|
|
201
|
+
<Icon
|
|
202
|
+
data={item.icon.data}
|
|
203
|
+
class={tw(['flex-shrink-0', item.icon.class])}
|
|
204
|
+
style={item.icon.style}
|
|
205
|
+
size={item.icon.size}
|
|
206
|
+
></Icon>
|
|
207
|
+
{/if}
|
|
208
|
+
<div class="pl-2">
|
|
209
|
+
<span class="font-medium">{item.caption}</span>
|
|
210
|
+
</div>
|
|
211
|
+
</li>
|
|
212
|
+
{:else}
|
|
213
|
+
{#if createOptionWhenNoResult}
|
|
214
|
+
<div class="p-4">
|
|
215
|
+
<Button
|
|
216
|
+
class="w-full"
|
|
217
|
+
on:click={(e) => {
|
|
218
|
+
dispatchCreateRequest(e, $inputValue)
|
|
219
|
+
}}>Créer "{$inputValue}"</Button
|
|
220
|
+
>
|
|
221
|
+
</div>
|
|
222
|
+
{:else}
|
|
223
|
+
<li class="relative cursor-pointer rounded-md py-1 pl-8 pr-4">Aucun résultat</li>
|
|
224
|
+
{/if}
|
|
225
|
+
{/each}
|
|
226
|
+
</div>
|
|
227
|
+
{#if totalCount}
|
|
228
|
+
<div class="bg-base-300 z-50 text-center text-xs">
|
|
229
|
+
{#if items.length < totalCount}
|
|
230
|
+
({items.length} / {totalCount})
|
|
231
|
+
{:else}
|
|
232
|
+
<!-- yes, items.length can be bigger if the selected item is not in the limit -->
|
|
233
|
+
({items.length})
|
|
234
|
+
{/if}
|
|
235
|
+
</div>
|
|
236
|
+
{/if}
|
|
237
|
+
</ul>
|
|
238
|
+
{/if}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { type KitBaseItem } from '../../../';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
placeholder?: string | undefined;
|
|
8
|
+
items?: KitBaseItem[] | undefined;
|
|
9
|
+
focus?: boolean | undefined;
|
|
10
|
+
loadOptions?: ((str: string) => Promise<{
|
|
11
|
+
items: KitBaseItem[];
|
|
12
|
+
totalCount: number;
|
|
13
|
+
}>) | undefined;
|
|
14
|
+
value?: string | undefined;
|
|
15
|
+
clearable?: boolean | undefined;
|
|
16
|
+
createOptionWhenNoResult?: boolean | undefined;
|
|
17
|
+
default_select_if_one_item?: boolean | undefined;
|
|
18
|
+
};
|
|
19
|
+
events: {
|
|
20
|
+
selected: CustomEvent<any>;
|
|
21
|
+
issue: CustomEvent<any>;
|
|
22
|
+
createRequest: CustomEvent<any>;
|
|
23
|
+
} & {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
};
|
|
26
|
+
slots: {};
|
|
27
|
+
exports?: {} | undefined;
|
|
28
|
+
bindings?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
export type SelectMeltProps = typeof __propDef.props;
|
|
31
|
+
export type SelectMeltEvents = typeof __propDef.events;
|
|
32
|
+
export type SelectMeltSlots = typeof __propDef.slots;
|
|
33
|
+
export default class SelectMelt extends SvelteComponent<SelectMeltProps, SelectMeltEvents, SelectMeltSlots> {
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import Icon from "../../../ui/Icon.svelte";
|
|
3
|
+
export let id;
|
|
4
|
+
export let disabled = false;
|
|
5
|
+
export let placeholder = "";
|
|
6
|
+
export let items = [];
|
|
7
|
+
export let value = void 0;
|
|
8
|
+
const dispatch = createEventDispatcher();
|
|
9
|
+
function dispatchSelected(_data) {
|
|
10
|
+
dispatch("selected", _data);
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div {id} class="input input-bordered flex w-fit min-w-0 items-center">
|
|
15
|
+
<div class="-mx-2 flex gap-2" title={placeholder}>
|
|
16
|
+
{#each items as item}
|
|
17
|
+
<button
|
|
18
|
+
{disabled}
|
|
19
|
+
on:click={() => {
|
|
20
|
+
value = item.id
|
|
21
|
+
dispatchSelected(items.find((i) => i.id === item.id))
|
|
22
|
+
}}
|
|
23
|
+
type="button"
|
|
24
|
+
class="min-w-0 cursor-pointer rounded-md px-1.5 py-1 {value === item.id
|
|
25
|
+
? 'bg-primary text-primary-content'
|
|
26
|
+
: ''}"
|
|
27
|
+
>
|
|
28
|
+
<div class="flex gap-2">
|
|
29
|
+
{#if item.icon}
|
|
30
|
+
<Icon {...item.icon} />
|
|
31
|
+
{/if}
|
|
32
|
+
{item.caption}
|
|
33
|
+
</div>
|
|
34
|
+
</button>
|
|
35
|
+
{/each}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { KitBaseItem } from '../../../';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
placeholder?: string | undefined;
|
|
8
|
+
items?: KitBaseItem[] | undefined;
|
|
9
|
+
value?: string | number | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
selected: CustomEvent<any>;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
exports?: {} | undefined;
|
|
18
|
+
bindings?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
export type SelectRadioProps = typeof __propDef.props;
|
|
21
|
+
export type SelectRadioEvents = typeof __propDef.events;
|
|
22
|
+
export type SelectRadioSlots = typeof __propDef.slots;
|
|
23
|
+
export default class SelectRadio extends SvelteComponent<SelectRadioProps, SelectRadioEvents, SelectRadioSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script>export let href;
|
|
2
|
+
export let target = void 0;
|
|
3
|
+
export let kind = "info";
|
|
4
|
+
const daisy = { info: "link-info", ghost: "" };
|
|
5
|
+
let className = void 0;
|
|
6
|
+
export { className as class };
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<a
|
|
10
|
+
class={`${daisy[kind]} link no-underline hover:underline ${className ?? ''}`}
|
|
11
|
+
{href}
|
|
12
|
+
rel="noopener"
|
|
13
|
+
{target}
|
|
14
|
+
{...$$restProps}
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</a>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
a[target='_blank']::after {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
content: '⇱';
|
|
23
|
+
position: relative;
|
|
24
|
+
top: -3px;
|
|
25
|
+
margin-left: 3px;
|
|
26
|
+
transform: rotate(90deg);
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
href: string;
|
|
7
|
+
target?: HTMLAnchorAttributes['target'];
|
|
8
|
+
kind?: "info" | "ghost" | undefined;
|
|
9
|
+
class?: string | undefined | null;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {
|
|
15
|
+
default: {};
|
|
16
|
+
};
|
|
17
|
+
exports?: undefined;
|
|
18
|
+
bindings?: undefined;
|
|
19
|
+
};
|
|
20
|
+
export type LinkProps = typeof __propDef.props;
|
|
21
|
+
export type LinkEvents = typeof __propDef.events;
|
|
22
|
+
export type LinkSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Link extends SvelteComponent<LinkProps, LinkEvents, LinkSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>import { tw } from "../..";
|
|
2
|
+
import Icon from "../Icon.svelte";
|
|
3
|
+
import Tooltip from "../Tooltip.svelte";
|
|
4
|
+
import Link from "./Link.svelte";
|
|
5
|
+
export let item;
|
|
6
|
+
export let noIcon = false;
|
|
7
|
+
export let captionSubStyle = "under";
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div class="flex items-center gap-4">
|
|
11
|
+
{#if item}
|
|
12
|
+
{#if item.icon?.data && !noIcon}
|
|
13
|
+
<Tooltip text={item.icon.caption}>
|
|
14
|
+
<Icon
|
|
15
|
+
data={item.icon.data}
|
|
16
|
+
class={tw('flex-shrink-0', item.icon.class)}
|
|
17
|
+
size={item.icon.size}
|
|
18
|
+
/>
|
|
19
|
+
</Tooltip>
|
|
20
|
+
{/if}
|
|
21
|
+
<div class="flex flex-col items-start">
|
|
22
|
+
{#if item.href}
|
|
23
|
+
<div>
|
|
24
|
+
<Link href={item.href}>{item.caption}</Link>
|
|
25
|
+
{#if item.captionSub && captionSubStyle === 'inline'}
|
|
26
|
+
<span class="text-base-content/70 text-xs italic">{item.captionSub}</span>
|
|
27
|
+
{/if}
|
|
28
|
+
</div>
|
|
29
|
+
{:else}
|
|
30
|
+
<!-- 20 is a cool value ! -->
|
|
31
|
+
<span
|
|
32
|
+
class="text-base-content {item.class} {(item.caption ?? '').length < 20
|
|
33
|
+
? 'text-nowrap'
|
|
34
|
+
: ''}"
|
|
35
|
+
>
|
|
36
|
+
{item.caption ?? '-'}
|
|
37
|
+
</span>
|
|
38
|
+
{/if}
|
|
39
|
+
{#if item.captionSub && captionSubStyle === 'under'}
|
|
40
|
+
<span class="text-base-content/70 text-xs italic">{item.captionSub}</span>
|
|
41
|
+
{/if}
|
|
42
|
+
</div>
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { type KitBaseItemLight } from '../..';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
item: KitBaseItemLight | undefined;
|
|
6
|
+
noIcon?: boolean | undefined;
|
|
7
|
+
captionSubStyle?: "none" | "under" | "inline" | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type LinkPlusProps = typeof __propDef.props;
|
|
17
|
+
export type LinkPlusEvents = typeof __propDef.events;
|
|
18
|
+
export type LinkPlusSlots = typeof __propDef.slots;
|
|
19
|
+
export default class LinkPlus extends SvelteComponent<LinkPlusProps, LinkPlusEvents, LinkPlusSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
import type { TransitionConfig } from 'svelte/transition';
|
|
3
|
+
type FlyAndScaleOptions = {
|
|
4
|
+
y: number;
|
|
5
|
+
start: number;
|
|
6
|
+
duration?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const flyAndScale: (node: HTMLElement, options: FlyAndScaleOptions) => TransitionConfig;
|
|
9
|
+
export type StyleObject = Record<string, number | string | undefined>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// From https://github.com/melt-ui/melt-ui/blob/develop/src/docs/utils/transition.ts
|
|
2
|
+
import { cubicOut } from 'svelte/easing';
|
|
3
|
+
const scaleConversion = (valueA, scaleA, scaleB) => {
|
|
4
|
+
const [minA, maxA] = scaleA;
|
|
5
|
+
const [minB, maxB] = scaleB;
|
|
6
|
+
const percentage = (valueA - minA) / (maxA - minA);
|
|
7
|
+
const valueB = percentage * (maxB - minB) + minB;
|
|
8
|
+
return valueB;
|
|
9
|
+
};
|
|
10
|
+
export const flyAndScale = (node, options) => {
|
|
11
|
+
const style = getComputedStyle(node);
|
|
12
|
+
const transform = style.transform === 'none' ? '' : style.transform;
|
|
13
|
+
return {
|
|
14
|
+
duration: options.duration ?? 150,
|
|
15
|
+
delay: 0,
|
|
16
|
+
css: (t) => {
|
|
17
|
+
const y = scaleConversion(t, [0, 1], [options.y, 0]);
|
|
18
|
+
const scale = scaleConversion(t, [0, 1], [options.start, 1]);
|
|
19
|
+
return styleToString({
|
|
20
|
+
transform: `${transform} translate3d(0, ${y}px, 0) scale(${scale})`,
|
|
21
|
+
opacity: t,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
easing: cubicOut,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
function styleToString(style) {
|
|
28
|
+
return Object.keys(style).reduce((str, key) => {
|
|
29
|
+
if (style[key] === undefined)
|
|
30
|
+
return str;
|
|
31
|
+
return str + `${key}:${style[key]};`;
|
|
32
|
+
}, '');
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* ```ts
|
|
4
|
+
* type KnownTypes = 'password' | 'otp' | 'oAuths' | 'demo'
|
|
5
|
+
*
|
|
6
|
+
* // literal or string
|
|
7
|
+
* const knownType = litOrStr<KnownTypes>('demo')
|
|
8
|
+
* const escapedType = litOrStr('coucou')
|
|
9
|
+
*
|
|
10
|
+
* // literal[] or string[]
|
|
11
|
+
* const knownType = litOrStr<KnownTypes[]>(['demo', 'oAuths'])
|
|
12
|
+
* const escapedType = litOrStr(['hello', 'coucou'])
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function litOrStr<T extends string | string[]>(value: T): T;
|
|
16
|
+
export type ResolvedType<T> = T extends Promise<infer R> ? R : T;
|
|
17
|
+
export type UnArray<T extends any[]> = T extends (infer U)[] ? U : never;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* ```ts
|
|
4
|
+
* type KnownTypes = 'password' | 'otp' | 'oAuths' | 'demo'
|
|
5
|
+
*
|
|
6
|
+
* // literal or string
|
|
7
|
+
* const knownType = litOrStr<KnownTypes>('demo')
|
|
8
|
+
* const escapedType = litOrStr('coucou')
|
|
9
|
+
*
|
|
10
|
+
* // literal[] or string[]
|
|
11
|
+
* const knownType = litOrStr<KnownTypes[]>(['demo', 'oAuths'])
|
|
12
|
+
* const escapedType = litOrStr(['hello', 'coucou'])
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export function litOrStr(value) {
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Entity, Fields } from 'remult';
|
|
8
|
+
import { KitFields } from '../KitFields';
|
|
9
|
+
let Customer = class Customer {
|
|
10
|
+
id;
|
|
11
|
+
name;
|
|
12
|
+
};
|
|
13
|
+
__decorate([
|
|
14
|
+
Fields.cuid()
|
|
15
|
+
], Customer.prototype, "id", void 0);
|
|
16
|
+
__decorate([
|
|
17
|
+
KitFields.string({ caption: 'Nom de la société', placeholder: 'Dynamic Process' })
|
|
18
|
+
], Customer.prototype, "name", void 0);
|
|
19
|
+
Customer = __decorate([
|
|
20
|
+
Entity('customers', {
|
|
21
|
+
allowApiCrud: true,
|
|
22
|
+
})
|
|
23
|
+
], Customer);
|
|
24
|
+
export { Customer };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Entity, Fields } from 'remult';
|
|
8
|
+
// import { KitFields } from '../KitFields.js'
|
|
9
|
+
let FilterEntity = class FilterEntity {
|
|
10
|
+
search = '';
|
|
11
|
+
title = '';
|
|
12
|
+
is = true;
|
|
13
|
+
sameAdress = true;
|
|
14
|
+
number = 200;
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
Fields.string({ allowNull: true, caption: 'Rechercher par' })
|
|
18
|
+
], FilterEntity.prototype, "search", void 0);
|
|
19
|
+
__decorate([
|
|
20
|
+
Fields.string({ allowNull: false, caption: 'Titre' })
|
|
21
|
+
], FilterEntity.prototype, "title", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
Fields.boolean()
|
|
24
|
+
], FilterEntity.prototype, "is", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
Fields.boolean({ caption: 'Même adresse', allowNull: true })
|
|
27
|
+
], FilterEntity.prototype, "sameAdress", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
Fields.number({ allowNull: false, caption: 'number' })
|
|
30
|
+
], FilterEntity.prototype, "number", void 0);
|
|
31
|
+
FilterEntity = __decorate([
|
|
32
|
+
Entity('filterEntities', {})
|
|
33
|
+
], FilterEntity);
|
|
34
|
+
export { FilterEntity };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { KitBaseEnum } from '../KitBaseEnum';
|
|
2
|
+
import type { KitBaseEnumOptions } from '../KitBaseEnum';
|
|
3
|
+
import '../ui/LibIcon';
|
|
4
|
+
export declare class StateDemoEnum extends KitBaseEnum {
|
|
5
|
+
static CHECK: StateDemoEnum;
|
|
6
|
+
static EDIT: StateDemoEnum;
|
|
7
|
+
static DELETE: StateDemoEnum;
|
|
8
|
+
constructor(id: string, options?: KitBaseEnumOptions<StateDemoEnum>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var StateDemoEnum_1;
|
|
8
|
+
import { ValueListFieldType } from 'remult';
|
|
9
|
+
import { KitBaseEnum } from '../KitBaseEnum';
|
|
10
|
+
import '../ui/LibIcon';
|
|
11
|
+
import { LibIcon_Add, LibIcon_Delete, LibIcon_Edit } from '../ui/LibIcon';
|
|
12
|
+
let StateDemoEnum = class StateDemoEnum extends KitBaseEnum {
|
|
13
|
+
static { StateDemoEnum_1 = this; }
|
|
14
|
+
static CHECK = new StateDemoEnum_1('CHECK', {
|
|
15
|
+
caption: 'Check',
|
|
16
|
+
icon: {
|
|
17
|
+
data: LibIcon_Add,
|
|
18
|
+
class: 'text-primary',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
static EDIT = new StateDemoEnum_1('EDIT', {
|
|
22
|
+
caption: 'Edit',
|
|
23
|
+
icon: {
|
|
24
|
+
data: LibIcon_Edit,
|
|
25
|
+
class: 'text-secondary',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
static DELETE = new StateDemoEnum_1('DELETE', {
|
|
29
|
+
caption: 'Delete',
|
|
30
|
+
icon: {
|
|
31
|
+
data: LibIcon_Delete,
|
|
32
|
+
class: 'text-error',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
constructor(id, options) {
|
|
36
|
+
super(id, options);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
StateDemoEnum = StateDemoEnum_1 = __decorate([
|
|
40
|
+
ValueListFieldType()
|
|
41
|
+
], StateDemoEnum);
|
|
42
|
+
export { StateDemoEnum };
|