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.
Files changed (156) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +18 -0
  3. package/README.md +12 -0
  4. package/esm/KitBaseEnum.d.ts +35 -0
  5. package/esm/KitBaseEnum.js +32 -0
  6. package/esm/KitEntity.d.ts +2 -0
  7. package/esm/KitEntity.js +24 -0
  8. package/esm/KitFields.d.ts +10 -0
  9. package/esm/KitFields.js +196 -0
  10. package/esm/ROUTES.d.ts +88 -0
  11. package/esm/ROUTES.js +98 -0
  12. package/esm/SqlDatabase/LogToConsoleCustom.d.ts +1 -0
  13. package/esm/SqlDatabase/LogToConsoleCustom.js +102 -0
  14. package/esm/api/index.d.ts +42 -0
  15. package/esm/api/index.js +97 -0
  16. package/esm/auth/Adapter.d.ts +10 -0
  17. package/esm/auth/Adapter.js +54 -0
  18. package/esm/auth/AuthController.d.ts +59 -0
  19. package/esm/auth/AuthController.js +434 -0
  20. package/esm/auth/Entities.d.ts +39 -0
  21. package/esm/auth/Entities.js +154 -0
  22. package/esm/auth/RoleController.d.ts +14 -0
  23. package/esm/auth/RoleController.js +57 -0
  24. package/esm/auth/helper.d.ts +1 -0
  25. package/esm/auth/helper.js +7 -0
  26. package/esm/auth/index.d.ts +153 -0
  27. package/esm/auth/index.js +280 -0
  28. package/esm/auth/providers/github.d.ts +25 -0
  29. package/esm/auth/providers/github.js +51 -0
  30. package/esm/auth/providers/index.d.ts +3 -0
  31. package/esm/auth/providers/index.js +26 -0
  32. package/esm/auth/providers/strava.d.ts +25 -0
  33. package/esm/auth/providers/strava.js +51 -0
  34. package/esm/auth/static/assets/Page-BMFREPjF.d.ts +5 -0
  35. package/esm/auth/static/assets/Page-BMFREPjF.js +18 -0
  36. package/esm/auth/static/assets/Page-BMOLAIFx.d.ts +5 -0
  37. package/esm/auth/static/assets/Page-BMOLAIFx.js +1 -0
  38. package/esm/auth/static/assets/Page-BwHye0GW.d.ts +5 -0
  39. package/esm/auth/static/assets/Page-BwHye0GW.js +1 -0
  40. package/esm/auth/static/assets/Page-gV58jf2r.css +1 -0
  41. package/esm/auth/static/assets/index-CKmKKRRL.d.ts +53 -0
  42. package/esm/auth/static/assets/index-CKmKKRRL.js +2 -0
  43. package/esm/auth/static/assets/index-R27C_TlP.css +4 -0
  44. package/esm/auth/static/favicon.svg +79 -0
  45. package/esm/auth/static/index.html +14 -0
  46. package/esm/auth/types.d.ts +33 -0
  47. package/esm/auth/types.js +1 -0
  48. package/esm/bin/cmd.d.ts +1 -0
  49. package/esm/bin/cmd.js +418 -0
  50. package/esm/changeLog/index.d.ts +55 -0
  51. package/esm/changeLog/index.js +179 -0
  52. package/esm/cron/index.d.ts +60 -0
  53. package/esm/cron/index.js +102 -0
  54. package/esm/feedback/FeedbackController.d.ts +30 -0
  55. package/esm/feedback/FeedbackController.js +313 -0
  56. package/esm/feedback/index.d.ts +18 -0
  57. package/esm/feedback/index.js +14 -0
  58. package/esm/feedback/ui/DialogIssue.svelte +102 -0
  59. package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -0
  60. package/esm/feedback/ui/DialogIssues.svelte +91 -0
  61. package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -0
  62. package/esm/feedback/ui/DialogMilestones.svelte +38 -0
  63. package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -0
  64. package/esm/feedback/ui/Feedback.svelte +12 -0
  65. package/esm/feedback/ui/Feedback.svelte.d.ts +16 -0
  66. package/esm/formats/dates.d.ts +18 -0
  67. package/esm/formats/dates.js +35 -0
  68. package/esm/formats/index.d.ts +4 -0
  69. package/esm/formats/index.js +3 -0
  70. package/esm/formats/numbers.d.ts +4 -0
  71. package/esm/formats/numbers.js +34 -0
  72. package/esm/formats/strings.d.ts +11 -0
  73. package/esm/formats/strings.js +109 -0
  74. package/esm/handle/index.d.ts +7 -0
  75. package/esm/handle/index.js +40 -0
  76. package/esm/helper.d.ts +50 -0
  77. package/esm/helper.js +118 -0
  78. package/esm/index.d.ts +103 -0
  79. package/esm/index.js +42 -0
  80. package/esm/kitCellsBuildor.d.ts +45 -0
  81. package/esm/kitCellsBuildor.js +105 -0
  82. package/esm/kitStoreItem.d.ts +28 -0
  83. package/esm/kitStoreItem.js +170 -0
  84. package/esm/kitStoreList.d.ts +33 -0
  85. package/esm/kitStoreList.js +98 -0
  86. package/esm/mail/index.d.ts +11 -0
  87. package/esm/mail/index.js +51 -0
  88. package/esm/theme.d.ts +4 -0
  89. package/esm/theme.js +4 -0
  90. package/esm/ui/Button.svelte +102 -0
  91. package/esm/ui/Button.svelte.d.ts +27 -0
  92. package/esm/ui/Clipboardable.svelte +19 -0
  93. package/esm/ui/Clipboardable.svelte.d.ts +25 -0
  94. package/esm/ui/Field.svelte +288 -0
  95. package/esm/ui/Field.svelte.d.ts +29 -0
  96. package/esm/ui/FieldGroup.svelte +91 -0
  97. package/esm/ui/FieldGroup.svelte.d.ts +30 -0
  98. package/esm/ui/Grid.svelte +246 -0
  99. package/esm/ui/Grid.svelte.d.ts +46 -0
  100. package/esm/ui/GridLoading.svelte +32 -0
  101. package/esm/ui/GridLoading.svelte.d.ts +20 -0
  102. package/esm/ui/GridPaginate.svelte +66 -0
  103. package/esm/ui/GridPaginate.svelte.d.ts +22 -0
  104. package/esm/ui/Icon.svelte +86 -0
  105. package/esm/ui/Icon.svelte.d.ts +46 -0
  106. package/esm/ui/LibIcon.d.ts +23 -0
  107. package/esm/ui/LibIcon.js +28 -0
  108. package/esm/ui/Loading.svelte +11 -0
  109. package/esm/ui/Loading.svelte.d.ts +20 -0
  110. package/esm/ui/Tooltip.svelte +42 -0
  111. package/esm/ui/Tooltip.svelte.d.ts +22 -0
  112. package/esm/ui/dialog/DialogForm.svelte +70 -0
  113. package/esm/ui/dialog/DialogForm.svelte.d.ts +19 -0
  114. package/esm/ui/dialog/DialogManagement.svelte +87 -0
  115. package/esm/ui/dialog/DialogManagement.svelte.d.ts +25 -0
  116. package/esm/ui/dialog/DialogPrimitive.svelte +89 -0
  117. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +28 -0
  118. package/esm/ui/dialog/FormEditAction.svelte +54 -0
  119. package/esm/ui/dialog/FormEditAction.svelte.d.ts +24 -0
  120. package/esm/ui/dialog/dialog.d.ts +51 -0
  121. package/esm/ui/dialog/dialog.js +98 -0
  122. package/esm/ui/index.d.ts +5 -0
  123. package/esm/ui/index.js +19 -0
  124. package/esm/ui/internals/FieldContainer.svelte +22 -0
  125. package/esm/ui/internals/FieldContainer.svelte.d.ts +30 -0
  126. package/esm/ui/internals/Input.svelte +98 -0
  127. package/esm/ui/internals/Input.svelte.d.ts +35 -0
  128. package/esm/ui/internals/Textarea.svelte +61 -0
  129. package/esm/ui/internals/Textarea.svelte.d.ts +30 -0
  130. package/esm/ui/internals/select/MultiSelectMelt.svelte +217 -0
  131. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +30 -0
  132. package/esm/ui/internals/select/SelectMelt.svelte +238 -0
  133. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +35 -0
  134. package/esm/ui/internals/select/SelectRadio.svelte +37 -0
  135. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +25 -0
  136. package/esm/ui/link/Link.svelte +28 -0
  137. package/esm/ui/link/Link.svelte.d.ts +25 -0
  138. package/esm/ui/link/LinkPlus.svelte +44 -0
  139. package/esm/ui/link/LinkPlus.svelte.d.ts +21 -0
  140. package/esm/utils/tailwind.d.ts +2 -0
  141. package/esm/utils/tailwind.js +3 -0
  142. package/esm/utils/transition.d.ts +10 -0
  143. package/esm/utils/transition.js +33 -0
  144. package/esm/utils/types.d.ts +17 -0
  145. package/esm/utils/types.js +17 -0
  146. package/esm/virtual/Customer.d.ts +4 -0
  147. package/esm/virtual/Customer.js +24 -0
  148. package/esm/virtual/FilterEntity.d.ts +7 -0
  149. package/esm/virtual/FilterEntity.js +34 -0
  150. package/esm/virtual/StateDemoEnum.d.ts +9 -0
  151. package/esm/virtual/StateDemoEnum.js +42 -0
  152. package/esm/virtual/UIEntity.d.ts +16 -0
  153. package/esm/virtual/UIEntity.js +84 -0
  154. package/esm/vite/index.d.ts +8 -0
  155. package/esm/vite/index.js +47 -0
  156. package/package.json +94 -10
@@ -0,0 +1,30 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ label?: string | undefined;
5
+ forId: string;
6
+ required?: boolean | undefined;
7
+ error?: string | undefined;
8
+ /**
9
+ * example usage for paginate
10
+ * classes={{ label: 'justify-end' }}
11
+ */ classes?: {
12
+ label?: string | undefined;
13
+ slot?: string | undefined;
14
+ } | undefined;
15
+ };
16
+ events: {
17
+ [evt: string]: CustomEvent<any>;
18
+ };
19
+ slots: {
20
+ default: {};
21
+ };
22
+ exports?: {} | undefined;
23
+ bindings?: string | undefined;
24
+ };
25
+ export type FieldContainerProps = typeof __propDef.props;
26
+ export type FieldContainerEvents = typeof __propDef.events;
27
+ export type FieldContainerSlots = typeof __propDef.slots;
28
+ export default class FieldContainer extends SvelteComponent<FieldContainerProps, FieldContainerEvents, FieldContainerSlots> {
29
+ }
30
+ export {};
@@ -0,0 +1,98 @@
1
+ <script>import { createEventDispatcher, tick } from "svelte";
2
+ import { tw } from "../../utils/tailwind";
3
+ export let value = void 0;
4
+ const dispatch = createEventDispatcher();
5
+ export let focus = false;
6
+ const focusNow = (node) => {
7
+ if (focus) {
8
+ tick().then(() => {
9
+ node.focus();
10
+ });
11
+ }
12
+ };
13
+ export let withDedounce = false;
14
+ let timer = null;
15
+ const debounce = (fn) => {
16
+ clearTimeout(timer);
17
+ timer = setTimeout(() => {
18
+ fn();
19
+ }, 444);
20
+ };
21
+ function dispatchInput(value2) {
22
+ if ($$restProps.type === "date") {
23
+ if (value2) {
24
+ dispatch("input", { value: transformDate(value2) });
25
+ }
26
+ } else {
27
+ dispatch("input", { value: value2 });
28
+ }
29
+ }
30
+ let className = void 0;
31
+ export { className as class };
32
+ const handleInput = (e) => {
33
+ const target = e.target;
34
+ if ($$restProps.type === "number") {
35
+ if (e.data === "." || e.data === ",") {
36
+ e.preventDefault();
37
+ } else {
38
+ value = +target.value;
39
+ }
40
+ } else {
41
+ value = target.value;
42
+ }
43
+ if (withDedounce) {
44
+ return debounce(() => {
45
+ dispatchInput(value);
46
+ });
47
+ } else {
48
+ dispatchInput(value);
49
+ }
50
+ };
51
+ const transformDate = (input) => {
52
+ const rawDateSplited = input.split("-");
53
+ if (rawDateSplited.length === 3) {
54
+ const yearSplited = rawDateSplited[0].split("");
55
+ if (yearSplited.length === 4 && yearSplited[0] === "0" && yearSplited[1] === "0" && yearSplited[2] !== "0") {
56
+ return `20${yearSplited[2]}${yearSplited[3]}-${rawDateSplited[1]}-${rawDateSplited[2]}`;
57
+ }
58
+ }
59
+ return input;
60
+ };
61
+ const handleKeyup = (event) => {
62
+ if ($$restProps.type === "date") {
63
+ value = transformDate(event.target.value);
64
+ }
65
+ };
66
+ </script>
67
+
68
+ <input
69
+ use:focusNow
70
+ class={tw('w-full px-2', className)}
71
+ on:input={handleInput}
72
+ bind:value
73
+ on:blur
74
+ on:change
75
+ on:click
76
+ on:focus
77
+ on:keydown
78
+ on:keypress
79
+ on:keyup={handleKeyup}
80
+ on:mouseover
81
+ on:mouseenter
82
+ on:mouseleave
83
+ on:paste
84
+ {...$$restProps}
85
+ />
86
+
87
+ <style>
88
+ input[type='number'] {
89
+ -webkit-appearance: textfield;
90
+ -moz-appearance: textfield;
91
+ appearance: textfield;
92
+ }
93
+
94
+ input[type='number']::-webkit-inner-spin-button,
95
+ input[type='number']::-webkit-outer-spin-button {
96
+ -webkit-appearance: none;
97
+ }
98
+ </style>
@@ -0,0 +1,35 @@
1
+ import { SvelteComponent } from "svelte";
2
+ import type { HTMLInputAttributes } from 'svelte/elements';
3
+ declare const __propDef: {
4
+ props: {
5
+ [x: string]: any;
6
+ value?: HTMLInputAttributes['value'];
7
+ focus?: boolean | undefined;
8
+ withDedounce?: boolean | undefined;
9
+ class?: string | undefined | null;
10
+ };
11
+ events: {
12
+ blur: FocusEvent;
13
+ change: Event;
14
+ click: MouseEvent;
15
+ focus: FocusEvent;
16
+ keydown: KeyboardEvent;
17
+ keypress: KeyboardEvent;
18
+ mouseover: MouseEvent;
19
+ mouseenter: MouseEvent;
20
+ mouseleave: MouseEvent;
21
+ paste: ClipboardEvent;
22
+ input: CustomEvent<any>;
23
+ } & {
24
+ [evt: string]: CustomEvent<any>;
25
+ };
26
+ slots: {};
27
+ exports?: undefined;
28
+ bindings?: undefined;
29
+ };
30
+ export type InputProps = typeof __propDef.props;
31
+ export type InputEvents = typeof __propDef.events;
32
+ export type InputSlots = typeof __propDef.slots;
33
+ export default class Input extends SvelteComponent<InputProps, InputEvents, InputSlots> {
34
+ }
35
+ export {};
@@ -0,0 +1,61 @@
1
+ <script>import { createEventDispatcher, onMount } from "svelte";
2
+ import { scrollbar } from "../../theme";
3
+ export let name = null;
4
+ export let id = "";
5
+ export let rows = 6;
6
+ export let placeholder = "";
7
+ export let focus = false;
8
+ export let value = "";
9
+ export let readonly = false;
10
+ export const error = false;
11
+ export let align = `left`;
12
+ const _tmp = align;
13
+ const dispatch = createEventDispatcher();
14
+ let reference;
15
+ const focusNow = (node) => {
16
+ if (focus) {
17
+ node.focus();
18
+ }
19
+ };
20
+ onMount(() => {
21
+ if (!reference) {
22
+ return;
23
+ }
24
+ if (!focus) {
25
+ return;
26
+ }
27
+ reference.focus();
28
+ });
29
+ function dispatchInput(value2) {
30
+ dispatch("input", { value: value2 });
31
+ }
32
+ </script>
33
+
34
+ {#if readonly}
35
+ <span class="flex min-h-8 max-w-full items-center px-3 py-1 text-sm md:min-h-[2.5rem]">
36
+ <div class="overflow-hidden">
37
+ {@html value ?? '-'}
38
+ </div>
39
+ </span>
40
+ {:else}
41
+ <textarea
42
+ use:focusNow
43
+ {...$$restProps}
44
+ class="textarea textarea-bordered
45
+ shadow-neutral-focus md:rounded-xls flex h-max min-h-8
46
+ w-full items-center rounded-lg bg-transparent text-xs
47
+ shadow-sm md:text-sm lg:min-h-[2.5rem]
48
+ {scrollbar.thin}"
49
+ id={id || name || 'default-textarea-id'}
50
+ {name}
51
+ {placeholder}
52
+ autocomplete="off"
53
+ bind:this={reference}
54
+ bind:value
55
+ {rows}
56
+ on:input={(e) => {
57
+ // @ts-ignore
58
+ dispatchInput(e.target.value)
59
+ }}
60
+ />
61
+ {/if}
@@ -0,0 +1,30 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ name?: string | null | undefined;
6
+ id?: string | undefined;
7
+ rows?: number | undefined;
8
+ placeholder?: string | undefined;
9
+ focus?: boolean | undefined;
10
+ value?: string | undefined;
11
+ readonly?: boolean | undefined;
12
+ error?: false | undefined;
13
+ align?: "left" | "right" | undefined;
14
+ };
15
+ events: {
16
+ input: CustomEvent<any>;
17
+ } & {
18
+ [evt: string]: CustomEvent<any>;
19
+ };
20
+ slots: {};
21
+ exports?: undefined;
22
+ bindings?: undefined;
23
+ };
24
+ export type TextareaProps = typeof __propDef.props;
25
+ export type TextareaEvents = typeof __propDef.events;
26
+ export type TextareaSlots = typeof __propDef.slots;
27
+ export default class Textarea extends SvelteComponent<TextareaProps, TextareaEvents, TextareaSlots> {
28
+ get error(): false;
29
+ }
30
+ export {};
@@ -0,0 +1,217 @@
1
+ <script>import { createCombobox, createSync } from "@melt-ui/svelte";
2
+ import { createEventDispatcher, onMount } from "svelte";
3
+ import { fly } from "svelte/transition";
4
+ import {
5
+ LibIcon_Check,
6
+ LibIcon_Cross,
7
+ LibIcon_MultiCheck,
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 loadOptions = void 0;
18
+ export let values = void 0;
19
+ export let clearable = false;
20
+ const dispatch = createEventDispatcher();
21
+ function dispatchSelectedValues(_data) {
22
+ values = _data?.map((_data2) => _data2.id);
23
+ dispatch("selected", _data);
24
+ }
25
+ onMount(async () => {
26
+ if (loadOptions) {
27
+ const lo = await loadOptions("");
28
+ items = lo.items;
29
+ totalCount = lo.totalCount;
30
+ filteredItems = items;
31
+ }
32
+ });
33
+ const getDefaultValues = (_selectedValue) => {
34
+ if (!items) {
35
+ return [];
36
+ }
37
+ const f = items.filter((c) => (_selectedValue ?? []).includes(String(c.id)));
38
+ if (f) {
39
+ return f.map((c) => toOption(c));
40
+ }
41
+ return [];
42
+ };
43
+ const toOption = (item) => ({
44
+ value: item,
45
+ label: item.caption
46
+ // icon: item.icon,
47
+ // disabled: item.disabled,
48
+ });
49
+ const {
50
+ elements: { menu, input, option },
51
+ states: { open, inputValue, touchedInput, selected: localSelected },
52
+ helpers: { isSelected }
53
+ } = createCombobox({
54
+ forceVisible: true,
55
+ multiple: true,
56
+ disabled,
57
+ ids: { label: id }
58
+ });
59
+ const clearSelection = () => {
60
+ sync.selected(void 0);
61
+ };
62
+ let debounceTimer;
63
+ const debounce = (callback) => {
64
+ clearTimeout(debounceTimer);
65
+ debounceTimer = setTimeout(
66
+ callback,
67
+ // debounce only if we have a load option
68
+ loadOptions ? 444 : 0
69
+ );
70
+ };
71
+ const sync = createSync({ selected: localSelected });
72
+ $:
73
+ items && sync.selected(getDefaultValues(values), (v) => {
74
+ const list = (v ?? []).map((c) => c.value.id);
75
+ const countMap = /* @__PURE__ */ new Map();
76
+ list.forEach((item) => {
77
+ countMap.set(item, (countMap.get(item) || 0) + 1);
78
+ });
79
+ const uniqueList = list.filter((item) => countMap.get(item) === 1);
80
+ const newIds = uniqueList.sort().join(",");
81
+ const oldSelectedValues = (values ?? []).sort().join(",");
82
+ if (newIds !== oldSelectedValues) {
83
+ dispatchSelectedValues(
84
+ v === void 0 ? void 0 : v.filter((c) => uniqueList.includes(c.value.id)).map((c) => c.value)
85
+ );
86
+ }
87
+ });
88
+ const labelToDisplayInInput = (_localSelected) => {
89
+ if (_localSelected === void 0 || _localSelected.length === 0) {
90
+ return "";
91
+ }
92
+ if (_localSelected.length === 1) {
93
+ return _localSelected[0].label ?? "";
94
+ }
95
+ return `${_localSelected.length} \xE9l\xE9ments`;
96
+ };
97
+ $:
98
+ $inputValue = labelToDisplayInInput($localSelected);
99
+ const iconToDisplayInInput = (_localSelected) => {
100
+ if (_localSelected === void 0 || _localSelected.length === 0) {
101
+ return { data: LibIcon_Search };
102
+ }
103
+ if (_localSelected.length === 1) {
104
+ return _localSelected[0].value.icon ?? { data: LibIcon_Search };
105
+ }
106
+ return { data: LibIcon_MultiCheck };
107
+ };
108
+ const isChecked = (_localSelected, _item) => {
109
+ const f = (_localSelected ?? []).filter((c) => c.value?.id === _item.id);
110
+ if (f.length > 0) {
111
+ return true;
112
+ }
113
+ return false;
114
+ };
115
+ let filteredItems = items;
116
+ const calcFilteredItems = (touched, str, values2) => {
117
+ if (touched && !str.endsWith(" \xE9l\xE9ments")) {
118
+ debounce(async () => {
119
+ const normalizedInput = str.toLowerCase();
120
+ filteredItems = items.filter((item) => {
121
+ return item.caption?.toLowerCase().includes(normalizedInput);
122
+ });
123
+ });
124
+ } else {
125
+ filteredItems = items;
126
+ }
127
+ };
128
+ $:
129
+ calcFilteredItems($touchedInput, $inputValue, values);
130
+ </script>
131
+
132
+ <div class="input input-bordered flex min-w-0 items-center">
133
+ <div class="relative">
134
+ {#if iconToDisplayInInput($localSelected)}
135
+ {@const ico = iconToDisplayInInput($localSelected)}
136
+ <Icon
137
+ data={ico?.data}
138
+ class={tw(['relative', ico?.class])}
139
+ style={ico?.style}
140
+ size={ico?.size}
141
+ ></Icon>
142
+ {/if}
143
+ </div>
144
+ <!-- {id} -->
145
+ <input
146
+ {...$input}
147
+ use:$input.action
148
+ class="-ml-8 -mr-5 h-full min-w-0 flex-grow bg-transparent px-10"
149
+ {placeholder}
150
+ />
151
+ <div class="pointer-events-none relative right-0 flex gap-2">
152
+ {#if clearable && $localSelected && $localSelected.length > 0}
153
+ <button on:click={clearSelection} class="pointer-events-auto">
154
+ <Icon data={LibIcon_Cross}></Icon>
155
+ </button>
156
+ {/if}
157
+ <!-- {#if $open}
158
+ <Icon data={LibIcon_ChevronUp}></Icon>
159
+ {:else}
160
+ <Icon data={LibIcon_ChevronDown}></Icon>
161
+ {/if} -->
162
+ </div>
163
+ </div>
164
+
165
+ {#if $open}
166
+ <ul
167
+ class="border-base-content/20 z-50 flex max-h-[300px] flex-col overflow-hidden rounded-lg border"
168
+ {...$menu}
169
+ use:$menu.action
170
+ transition:fly={{ duration: 150, y: -5 }}
171
+ >
172
+ <!-- svelte-ignore a11y-no-noninteractive-tabindex -->
173
+ <div class="bg-base-100 flex max-h-full flex-col gap-0 overflow-y-auto py-2" tabindex="0">
174
+ {#each filteredItems as item, index (index)}
175
+ <li
176
+ {...$option(toOption(item))}
177
+ use:$option.action
178
+ class="data-[highlighted]:bg-primary data-[highlighted]:text-primary-content relative flex cursor-pointer scroll-my-2 items-center
179
+ rounded-md
180
+ px-1
181
+ py-2
182
+ data-[disabled]:opacity-50"
183
+ >
184
+ {#if isChecked($localSelected, item)}
185
+ <Icon data={LibIcon_Check} class="w-6"></Icon>
186
+ {:else}
187
+ <!-- just to book the place -->
188
+ <span class="w-6"></span>
189
+ {/if}
190
+ {#if item.icon?.data}
191
+ <Icon
192
+ data={item.icon.data}
193
+ class={tw(['flex-shrink-0', item.icon.class])}
194
+ style={item.icon.style}
195
+ size={item.icon.size}
196
+ ></Icon>
197
+ {/if}
198
+ <div class="pl-2 {item.class}">
199
+ <span class="font-medium">{item.caption}</span>
200
+ </div>
201
+ </li>
202
+ {:else}
203
+ <li class="relative cursor-pointer rounded-md py-1 pl-8 pr-4">Aucun résultat</li>
204
+ {/each}
205
+ </div>
206
+ {#if totalCount}
207
+ <div class="bg-base-300 z-50 text-center text-xs">
208
+ {#if items.length < totalCount}
209
+ ({items.length} / {totalCount})
210
+ {:else}
211
+ <!-- yes, items.length can be bigger if the selected item is not in the limit -->
212
+ ({items.length})
213
+ {/if}
214
+ </div>
215
+ {/if}
216
+ </ul>
217
+ {/if}
@@ -0,0 +1,30 @@
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
+ loadOptions?: ((str: string) => Promise<{
10
+ items: KitBaseItem[];
11
+ totalCount: number;
12
+ }>) | undefined;
13
+ values?: string[] | undefined;
14
+ clearable?: boolean | undefined;
15
+ };
16
+ events: {
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> {
29
+ }
30
+ export {};