flowbite-svelte 0.46.16 → 0.46.18
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/README.md +0 -1
- package/dist/cards/Card.svelte.d.ts +1 -0
- package/dist/carousel/Thumbnail.svelte +6 -4
- package/dist/carousel/Thumbnail.svelte.d.ts +10 -8
- package/dist/forms/Helper.svelte +1 -1
- package/dist/forms/Input.svelte +20 -6
- package/dist/forms/Input.svelte.d.ts +3 -1
- package/dist/forms/Label.svelte +1 -1
- package/dist/forms/MultiSelect.svelte +18 -8
- package/dist/forms/MultiSelect.svelte.d.ts +2 -0
- package/dist/forms/Search.svelte.d.ts +1 -1
- package/dist/forms/Select.svelte +2 -2
- package/dist/list-group/Listgroup.svelte +2 -2
- package/dist/list-group/Listgroup.svelte.d.ts +12 -12
- package/dist/progress/Progressbar.svelte +5 -3
- package/dist/progress/Progressbar.svelte.d.ts +2 -0
- package/dist/rating/Rating.svelte +19 -15
- package/dist/rating/Rating.svelte.d.ts +20 -16
- package/dist/sidebar/SidebarItem.svelte +6 -1
- package/dist/sidebar/SidebarItem.svelte.d.ts +5 -0
- package/dist/table/Table.svelte +47 -1
- package/dist/table/Table.svelte.d.ts +28 -9
- package/dist/table/TableBody.svelte +11 -1
- package/dist/table/TableBody.svelte.d.ts +12 -9
- package/dist/table/TableHeadCell.svelte +34 -1
- package/dist/table/TableHeadCell.svelte.d.ts +17 -9
- package/dist/timeline/GroupItem.svelte +4 -0
- package/dist/timeline/GroupItem.svelte.d.ts +2 -0
- package/dist/types.d.ts +1 -0
- package/dist/typography/A.svelte +6 -1
- package/dist/typography/A.svelte.d.ts +5 -0
- package/dist/utils/Popper.svelte +18 -17
- package/dist/utils/focusTrap.js +3 -1
- package/package.json +18 -17
package/README.md
CHANGED
|
@@ -468,7 +468,6 @@ Please read [how to contribute](https://github.com/themesberg/flowbite-svelte/bl
|
|
|
468
468
|
|
|
469
469
|
View the full [changelog](https://github.com/themesberg/flowbite-svelte/blob/main/CHANGELOG.md) on this page.
|
|
470
470
|
|
|
471
|
-
|
|
472
471
|
## License
|
|
473
472
|
|
|
474
473
|
Flowbite Svelte is open-source under the [MIT License](https://flowbite-svelte.com/docs/pages/license).
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script>import { twMerge } from "tailwind-merge";
|
|
2
2
|
export let selected = false;
|
|
3
|
+
export let alt = "";
|
|
3
4
|
export let activeClass = "opacity-100";
|
|
4
5
|
export let inactiveClass = "opacity-60";
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
|
-
<img
|
|
8
|
+
<img {...$$restProps} {alt} class={twMerge(selected ? activeClass : inactiveClass, $$props.class)} />
|
|
8
9
|
|
|
9
10
|
<!--
|
|
10
11
|
@component
|
|
11
12
|
[Go to docs](https://flowbite-svelte.com/)
|
|
12
13
|
## Props
|
|
13
|
-
@prop export let selected:
|
|
14
|
-
@prop export let
|
|
15
|
-
@prop export let
|
|
14
|
+
@prop export let selected: $$Props['selected'] = false;
|
|
15
|
+
@prop export let alt: $$Props['alt'] = '';
|
|
16
|
+
@prop export let activeClass: $$Props['activeClass'] = 'opacity-100';
|
|
17
|
+
@prop export let inactiveClass: $$Props['inactiveClass'] = 'opacity-60';
|
|
16
18
|
-->
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { HTMLImgAttributes } from 'svelte/elements';
|
|
2
3
|
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
activeClass?: string
|
|
7
|
-
inactiveClass?: string
|
|
4
|
+
props: HTMLImgAttributes & {
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
alt?: string;
|
|
7
|
+
activeClass?: string;
|
|
8
|
+
inactiveClass?: string;
|
|
8
9
|
};
|
|
9
10
|
events: {
|
|
10
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -17,9 +18,10 @@ export type ThumbnailSlots = typeof __propDef.slots;
|
|
|
17
18
|
/**
|
|
18
19
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
19
20
|
* ## Props
|
|
20
|
-
* @prop export let selected:
|
|
21
|
-
* @prop export let
|
|
22
|
-
* @prop export let
|
|
21
|
+
* @prop export let selected: $$Props['selected'] = false;
|
|
22
|
+
* @prop export let alt: $$Props['alt'] = '';
|
|
23
|
+
* @prop export let activeClass: $$Props['activeClass'] = 'opacity-100';
|
|
24
|
+
* @prop export let inactiveClass: $$Props['inactiveClass'] = 'opacity-60';
|
|
23
25
|
*/
|
|
24
26
|
export default class Thumbnail extends SvelteComponentTyped<ThumbnailProps, ThumbnailEvents, ThumbnailSlots> {
|
|
25
27
|
}
|
package/dist/forms/Helper.svelte
CHANGED
|
@@ -5,7 +5,7 @@ const colorClasses = {
|
|
|
5
5
|
gray: "text-gray-900 dark:text-gray-300",
|
|
6
6
|
green: "text-green-700 dark:text-green-500",
|
|
7
7
|
red: "text-red-700 dark:text-red-500",
|
|
8
|
-
disabled: "text-gray-400 dark:text-gray-500"
|
|
8
|
+
disabled: "text-gray-400 dark:text-gray-500 grayscale contrast-50"
|
|
9
9
|
};
|
|
10
10
|
</script>
|
|
11
11
|
|
package/dist/forms/Input.svelte
CHANGED
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
<script>import Wrapper from "../utils/Wrapper.svelte";
|
|
7
7
|
import { twMerge } from "tailwind-merge";
|
|
8
|
-
import { getContext } from "svelte";
|
|
8
|
+
import { createEventDispatcher, getContext } from "svelte";
|
|
9
|
+
import CloseButton from "../utils/CloseButton.svelte";
|
|
10
|
+
const dispatcher = createEventDispatcher();
|
|
9
11
|
export let type = "text";
|
|
10
12
|
export let value = void 0;
|
|
11
13
|
export let size = void 0;
|
|
14
|
+
export let clearable = false;
|
|
12
15
|
export let defaultClass = "block w-full disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right";
|
|
13
16
|
export let color = "base";
|
|
14
17
|
export let floatClass = "flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400";
|
|
@@ -39,11 +42,16 @@ $: _size = size || clampSize(group?.size) || "md";
|
|
|
39
42
|
let inputClass;
|
|
40
43
|
$: {
|
|
41
44
|
const _color = color === "base" && background ? "tinted" : color;
|
|
42
|
-
inputClass = twMerge([defaultClass, inputPadding[_size], $$slots.left && leftPadding[_size] || $$slots.right && rightPadding[_size], ringClasses[color], colorClasses[_color], borderClasses[_color], textSizes[_size], group || "rounded-lg", group && "first:rounded-s-lg last:rounded-e-lg", group && "[&:not(:first-child)]:-ms-px", $$props.class]);
|
|
45
|
+
inputClass = twMerge([defaultClass, inputPadding[_size], $$slots.left && leftPadding[_size] || (clearable || $$slots.right) && rightPadding[_size], ringClasses[color], colorClasses[_color], borderClasses[_color], textSizes[_size], group || "rounded-lg", group && "first:rounded-s-lg last:rounded-e-lg", group && "[&:not(:first-child)]:-ms-px", $$props.class]);
|
|
43
46
|
}
|
|
47
|
+
const clearAll = (e) => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
value = void 0;
|
|
50
|
+
dispatcher("change");
|
|
51
|
+
};
|
|
44
52
|
</script>
|
|
45
53
|
|
|
46
|
-
<Wrapper class="relative w-full" show
|
|
54
|
+
<Wrapper class="relative w-full" show>
|
|
47
55
|
{#if $$slots.left}
|
|
48
56
|
<div class="{twMerge(floatClass, $$props.classLeft)} start-0 ps-2.5 pointer-events-none">
|
|
49
57
|
<slot name="left" />
|
|
@@ -52,9 +60,14 @@ $: {
|
|
|
52
60
|
<slot props={{ ...$$restProps, class: inputClass }}>
|
|
53
61
|
<input {...$$restProps} bind:value on:blur on:change on:click on:contextmenu on:focus on:keydown on:keypress on:keyup on:mouseover on:mouseenter on:mouseleave on:paste on:input {...{ type }} class={inputClass} />
|
|
54
62
|
</slot>
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
<div class="{twMerge(floatClass, $$props.classRight)} end-0 pe-2.5">
|
|
64
|
+
{#if $$slots.right}
|
|
65
|
+
<slot name="right"></slot>
|
|
66
|
+
{/if}
|
|
67
|
+
{#if clearable && value && `${value}`.length > 0}
|
|
68
|
+
<CloseButton {size} on:click={clearAll} color="none" class="p-0 focus:ring-gray-400 dark:text-white" />
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
58
71
|
</Wrapper>
|
|
59
72
|
|
|
60
73
|
<!--
|
|
@@ -64,6 +77,7 @@ $: {
|
|
|
64
77
|
@prop export let type: InputType = 'text';
|
|
65
78
|
@prop export let value: any = undefined;
|
|
66
79
|
@prop export let size: FormSizeType | undefined = undefined;
|
|
80
|
+
@prop export let clearable = false;
|
|
67
81
|
@prop export let defaultClass: string = 'block w-full disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right';
|
|
68
82
|
@prop export let color: 'base' | 'green' | 'red' = 'base';
|
|
69
83
|
@prop export let floatClass: string = 'flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400';
|
|
@@ -8,13 +8,14 @@ declare const __propDef: {
|
|
|
8
8
|
type?: InputType | undefined;
|
|
9
9
|
value?: any;
|
|
10
10
|
size?: FormSizeType | undefined;
|
|
11
|
+
clearable?: boolean | undefined;
|
|
11
12
|
defaultClass?: string | undefined;
|
|
12
13
|
color?: ("base" | "green" | "red") | undefined;
|
|
13
14
|
floatClass?: string | undefined;
|
|
14
15
|
};
|
|
15
16
|
events: {
|
|
16
17
|
blur: FocusEvent;
|
|
17
|
-
change:
|
|
18
|
+
change: CustomEvent<any>;
|
|
18
19
|
click: MouseEvent;
|
|
19
20
|
contextmenu: MouseEvent;
|
|
20
21
|
focus: FocusEvent;
|
|
@@ -48,6 +49,7 @@ export type InputSlots = typeof __propDef.slots;
|
|
|
48
49
|
* @prop export let type: InputType = 'text';
|
|
49
50
|
* @prop export let value: any = undefined;
|
|
50
51
|
* @prop export let size: FormSizeType | undefined = undefined;
|
|
52
|
+
* @prop export let clearable = false;
|
|
51
53
|
* @prop export let defaultClass: string = 'block w-full disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right';
|
|
52
54
|
* @prop export let color: 'base' | 'green' | 'red' = 'base';
|
|
53
55
|
* @prop export let floatClass: string = 'flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400';
|
package/dist/forms/Label.svelte
CHANGED
|
@@ -7,7 +7,7 @@ const colorClasses = {
|
|
|
7
7
|
gray: "text-gray-900 dark:text-gray-300",
|
|
8
8
|
green: "text-green-700 dark:text-green-500",
|
|
9
9
|
red: "text-red-700 dark:text-red-500",
|
|
10
|
-
disabled: "text-gray-400 dark:text-gray-500"
|
|
10
|
+
disabled: "text-gray-400 dark:text-gray-500 grayscale contrast-50"
|
|
11
11
|
};
|
|
12
12
|
$: {
|
|
13
13
|
const control = node?.control;
|
|
@@ -8,6 +8,7 @@ export let value = [];
|
|
|
8
8
|
export let size = "md";
|
|
9
9
|
export let dropdownClass = "";
|
|
10
10
|
export let placeholder = "";
|
|
11
|
+
export let disabled = false;
|
|
11
12
|
$: selectItems = items.filter((x) => value.includes(x.value));
|
|
12
13
|
let show = false;
|
|
13
14
|
const sizes = {
|
|
@@ -15,7 +16,7 @@ const sizes = {
|
|
|
15
16
|
md: "px-3 py-1 min-h-[2.7rem]",
|
|
16
17
|
lg: "px-4 py-2 min-h-[3.2rem]"
|
|
17
18
|
};
|
|
18
|
-
const multiSelectClass = "relative border border-gray-300 flex items-center rounded-lg gap-2 dark:border-gray-600
|
|
19
|
+
const multiSelectClass = "relative border border-gray-300 flex items-center rounded-lg gap-2 dark:border-gray-600 ring-primary-500 dark:ring-primary-500 focus-visible:outline-none";
|
|
19
20
|
let multiSelectDropdown;
|
|
20
21
|
$: multiSelectDropdown = twMerge("absolute z-50 p-3 flex flex-col gap-1 max-h-64 bg-white border border-gray-300 dark:bg-gray-700 dark:border-gray-600 start-0 top-[calc(100%+1rem)] rounded-lg cursor-pointer overflow-y-scroll w-full", dropdownClass);
|
|
21
22
|
const itemsClass = "py-2 px-3 rounded-lg text-gray-600 hover:text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:text-gray-300 dark:hover:bg-gray-600";
|
|
@@ -24,6 +25,8 @@ let activeIndex = null;
|
|
|
24
25
|
$: activeItem = activeIndex !== null ? items[(activeIndex % items.length + items.length) % items.length] : null;
|
|
25
26
|
const activeItemClass = "bg-primary-100 text-primary-500 dark:bg-primary-500 dark:text-primary-100 hover:bg-primary-100 dark:hover:bg-primary-500 hover:text-primary-600 dark:hover:text-primary-100";
|
|
26
27
|
const selectOption = (select) => {
|
|
28
|
+
if (disabled) return;
|
|
29
|
+
if (select.disabled) return;
|
|
27
30
|
if (value.includes(select.value)) {
|
|
28
31
|
clearThisOption(select);
|
|
29
32
|
} else if (!value.includes(select.value)) {
|
|
@@ -32,22 +35,26 @@ const selectOption = (select) => {
|
|
|
32
35
|
}
|
|
33
36
|
};
|
|
34
37
|
const clearAll = (e) => {
|
|
38
|
+
if (disabled) return;
|
|
35
39
|
e.stopPropagation();
|
|
36
40
|
value = [];
|
|
37
41
|
dispatcher("change");
|
|
38
42
|
};
|
|
39
43
|
const clearThisOption = (select) => {
|
|
44
|
+
if (disabled) return;
|
|
40
45
|
if (value.includes(select.value)) {
|
|
41
46
|
value = value.filter((o) => o !== select.value);
|
|
42
47
|
dispatcher("change");
|
|
43
48
|
}
|
|
44
49
|
};
|
|
45
50
|
function handleEscape() {
|
|
51
|
+
if (disabled) return;
|
|
46
52
|
if (show) {
|
|
47
53
|
show = false;
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
function handleToggleActiveItem() {
|
|
57
|
+
if (disabled) return;
|
|
51
58
|
if (!show) {
|
|
52
59
|
show = true;
|
|
53
60
|
activeIndex = 0;
|
|
@@ -56,6 +63,7 @@ function handleToggleActiveItem() {
|
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
65
|
function handleArrowUpDown(offset) {
|
|
66
|
+
if (disabled) return;
|
|
59
67
|
if (!show) {
|
|
60
68
|
show = true;
|
|
61
69
|
activeIndex = 0;
|
|
@@ -68,6 +76,7 @@ function handleArrowUpDown(offset) {
|
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
78
|
function handleKeyDown(event) {
|
|
79
|
+
if (disabled) return;
|
|
71
80
|
switch (event.key) {
|
|
72
81
|
case "Escape":
|
|
73
82
|
handleEscape();
|
|
@@ -92,12 +101,12 @@ function handleKeyDown(event) {
|
|
|
92
101
|
|
|
93
102
|
<!-- Hidden select for form submission -->
|
|
94
103
|
<select {...$$restProps} {value} hidden multiple on:input>
|
|
95
|
-
{#each items as { value, name }}
|
|
96
|
-
<option {value}>{name}</option>
|
|
104
|
+
{#each items as { value, name, disabled }}
|
|
105
|
+
<option {value} {disabled}>{name}</option>
|
|
97
106
|
{/each}
|
|
98
107
|
</select>
|
|
99
108
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
100
|
-
<div on:click={() => (show = !show)} on:focusout={() => (show = false)} on:keydown={handleKeyDown} tabindex="0" role="listbox" class={twMerge(multiSelectClass, sizes[size], $$props.class)}>
|
|
109
|
+
<div on:click={() => !disabled && (show = !show)} on:focusout={() => !disabled && (show = false)} on:keydown={handleKeyDown} tabindex="0" role="listbox" class={twMerge(multiSelectClass, sizes[size], $$props.class, !disabled && "focus-within:ring-1 focus-within:border-primary-500 dark:focus-within:border-primary-500", disabled && "opacity-50 cursor-not-allowed")}>
|
|
101
110
|
{#if !selectItems.length}
|
|
102
111
|
<span class="text-gray-400">{placeholder}</span>
|
|
103
112
|
{/if}
|
|
@@ -105,7 +114,7 @@ function handleKeyDown(event) {
|
|
|
105
114
|
{#if selectItems.length}
|
|
106
115
|
{#each selectItems as item (item.name)}
|
|
107
116
|
<slot {item} clear={() => clearThisOption(item)}>
|
|
108
|
-
<Badge color="dark" large={size === 'lg'} dismissable params={{ duration: 100 }} on:close={() => clearThisOption(item)}>
|
|
117
|
+
<Badge color="dark" large={size === 'lg'} dismissable params={{ duration: 100 }} on:close={() => clearThisOption(item)} class={disabled && "pointer-events-none"} >
|
|
109
118
|
{item.name}
|
|
110
119
|
</Badge>
|
|
111
120
|
</slot>
|
|
@@ -114,10 +123,10 @@ function handleKeyDown(event) {
|
|
|
114
123
|
</span>
|
|
115
124
|
<div class="flex ms-auto gap-2 items-center">
|
|
116
125
|
{#if selectItems.length}
|
|
117
|
-
<CloseButton {size} on:click={clearAll} color="none" class="p-0 focus:ring-gray-400 dark:text-white" />
|
|
126
|
+
<CloseButton {size} on:click={clearAll} color="none" class={twMerge("p-0 focus:ring-gray-400 dark:text-white", disabled && "cursor-not-allowed")} disabled={disabled} />
|
|
118
127
|
{/if}
|
|
119
128
|
<div class="w-[1px] bg-gray-300 dark:bg-gray-600"></div>
|
|
120
|
-
<svg class="cursor-pointer h-3 w-3 ms-1 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
|
129
|
+
<svg class={twMerge("cursor-pointer h-3 w-3 ms-1 text-gray-800 dark:text-white", disabled && "cursor-not-allowed")} aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
|
121
130
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d={show ? 'm1 5 4-4 4 4' : 'm9 1-4 4-4-4'} />
|
|
122
131
|
</svg>
|
|
123
132
|
</div>
|
|
@@ -126,7 +135,7 @@ function handleKeyDown(event) {
|
|
|
126
135
|
<div on:click|stopPropagation role="presentation" class={multiSelectDropdown}>
|
|
127
136
|
{#each items as item (item.name)}
|
|
128
137
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
129
|
-
<div on:click={() => selectOption(item)} role="presentation" class={twMerge(itemsClass, selectItems.includes(item) && itemsSelectClass, activeItem === item && activeItemClass)}>
|
|
138
|
+
<div on:click={() => selectOption(item)} role="presentation" class={twMerge(itemsClass, selectItems.includes(item) && itemsSelectClass, activeItem === item && activeItemClass, disabled && "pointer-events-none", item.disabled && "opacity-50 cursor-not-allowed")}>
|
|
130
139
|
{item.name}
|
|
131
140
|
</div>
|
|
132
141
|
{/each}
|
|
@@ -143,4 +152,5 @@ function handleKeyDown(event) {
|
|
|
143
152
|
@prop export let size: FormSizeType = 'md';
|
|
144
153
|
@prop export let dropdownClass: string = '';
|
|
145
154
|
@prop export let placeholder: string = '';
|
|
155
|
+
@prop export let disabled: boolean = false;
|
|
146
156
|
-->
|
|
@@ -8,6 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
size?: FormSizeType | undefined;
|
|
9
9
|
dropdownClass?: string | undefined;
|
|
10
10
|
placeholder?: string | undefined;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
11
12
|
};
|
|
12
13
|
events: {
|
|
13
14
|
input: Event;
|
|
@@ -34,6 +35,7 @@ export type MultiSelectSlots = typeof __propDef.slots;
|
|
|
34
35
|
* @prop export let size: FormSizeType = 'md';
|
|
35
36
|
* @prop export let dropdownClass: string = '';
|
|
36
37
|
* @prop export let placeholder: string = '';
|
|
38
|
+
* @prop export let disabled: boolean = false;
|
|
37
39
|
*/
|
|
38
40
|
export default class MultiSelect extends SvelteComponentTyped<MultiSelectProps, MultiSelectEvents, MultiSelectSlots> {
|
|
39
41
|
}
|
package/dist/forms/Select.svelte
CHANGED
|
@@ -21,8 +21,8 @@ $: selectClass = twMerge(common, underline ? underlineClass : defaultClass, size
|
|
|
21
21
|
<option disabled selected={(value === undefined) ? true : undefined} value="">{placeholder}</option>
|
|
22
22
|
{/if}
|
|
23
23
|
|
|
24
|
-
{#each items as { value: itemValue, name }}
|
|
25
|
-
<option value={itemValue} selected={(itemValue === value) ? true : undefined}>{name}</option>
|
|
24
|
+
{#each items as { value: itemValue, name, disabled }}
|
|
25
|
+
<option disabled={disabled} value={itemValue} selected={(itemValue === value) ? true : undefined}>{name}</option>
|
|
26
26
|
{:else}
|
|
27
27
|
<slot />
|
|
28
28
|
{/each}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { createEventDispatcher, setContext } from "svelte";
|
|
1
|
+
<script generics="T extends ListGroupItemType | string">import { createEventDispatcher, setContext } from "svelte";
|
|
2
2
|
import { twMerge } from "tailwind-merge";
|
|
3
3
|
import Frame from "../utils/Frame.svelte";
|
|
4
4
|
import ListgroupItem from "./ListgroupItem.svelte";
|
|
@@ -28,7 +28,7 @@ $: groupClass = twMerge(defaultClass, $$props.class);
|
|
|
28
28
|
@component
|
|
29
29
|
[Go to docs](https://flowbite-svelte.com/)
|
|
30
30
|
## Props
|
|
31
|
-
@prop export let items:
|
|
31
|
+
@prop export let items: T[] = [];
|
|
32
32
|
@prop export let active: boolean = false;
|
|
33
33
|
@prop export let defaultClass: string = 'divide-y divide-gray-200 dark:divide-gray-600';
|
|
34
34
|
-->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { ListGroupItemType } from '../types';
|
|
3
|
-
declare
|
|
4
|
-
props: import("svelte/elements").HTMLAnchorAttributes & {
|
|
3
|
+
declare class __sveltets_Render<T extends ListGroupItemType | string> {
|
|
4
|
+
props(): import("svelte/elements").HTMLAnchorAttributes & {
|
|
5
5
|
tag?: string;
|
|
6
6
|
color?: import("../utils/Frame.svelte").FrameColor;
|
|
7
7
|
rounded?: boolean;
|
|
@@ -16,31 +16,31 @@ declare const __propDef: {
|
|
|
16
16
|
transition?: (node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig;
|
|
17
17
|
params?: any;
|
|
18
18
|
} & {
|
|
19
|
-
items?:
|
|
19
|
+
items?: T[] | undefined;
|
|
20
20
|
active?: boolean;
|
|
21
21
|
};
|
|
22
|
-
events: {
|
|
22
|
+
events(): {
|
|
23
23
|
click: CustomEvent<any>;
|
|
24
24
|
} & {
|
|
25
25
|
[evt: string]: CustomEvent<any>;
|
|
26
26
|
};
|
|
27
|
-
slots: {
|
|
27
|
+
slots(): {
|
|
28
28
|
default: {
|
|
29
|
-
item:
|
|
29
|
+
item: T;
|
|
30
30
|
index: number;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
}
|
|
34
|
-
export type ListgroupProps =
|
|
35
|
-
export type ListgroupEvents =
|
|
36
|
-
export type ListgroupSlots =
|
|
33
|
+
}
|
|
34
|
+
export type ListgroupProps<T extends ListGroupItemType | string> = ReturnType<__sveltets_Render<T>['props']>;
|
|
35
|
+
export type ListgroupEvents<T extends ListGroupItemType | string> = ReturnType<__sveltets_Render<T>['events']>;
|
|
36
|
+
export type ListgroupSlots<T extends ListGroupItemType | string> = ReturnType<__sveltets_Render<T>['slots']>;
|
|
37
37
|
/**
|
|
38
38
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
39
39
|
* ## Props
|
|
40
|
-
* @prop export let items:
|
|
40
|
+
* @prop export let items: T[] = [];
|
|
41
41
|
* @prop export let active: boolean = false;
|
|
42
42
|
* @prop export let defaultClass: string = 'divide-y divide-gray-200 dark:divide-gray-600';
|
|
43
43
|
*/
|
|
44
|
-
export default class Listgroup extends SvelteComponentTyped<ListgroupProps
|
|
44
|
+
export default class Listgroup<T extends ListGroupItemType | string> extends SvelteComponentTyped<ListgroupProps<T>, ListgroupEvents<T>, ListgroupSlots<T>> {
|
|
45
45
|
}
|
|
46
46
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { cubicOut } from "svelte/easing";
|
|
2
2
|
import { tweened } from "svelte/motion";
|
|
3
|
-
import { twMerge
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
4
|
export let progress = "45";
|
|
5
5
|
export let precision = 0;
|
|
6
6
|
export let tweenDuration = 400;
|
|
@@ -12,6 +12,7 @@ export let easing = cubicOut;
|
|
|
12
12
|
export let color = "primary";
|
|
13
13
|
export let labelInsideClass = "text-primary-100 text-xs font-medium text-center p-0.5 leading-none rounded-full";
|
|
14
14
|
export let divClass = "w-full bg-gray-200 rounded-full dark:bg-gray-700";
|
|
15
|
+
export let progressClass;
|
|
15
16
|
const _progress = tweened(0, {
|
|
16
17
|
duration: animate ? tweenDuration : 0,
|
|
17
18
|
easing
|
|
@@ -37,11 +38,11 @@ $: _progress.set(Number(progress));
|
|
|
37
38
|
{/if}
|
|
38
39
|
<div class={twMerge(divClass, size, $$props.class)}>
|
|
39
40
|
{#if labelInside}
|
|
40
|
-
<div class={
|
|
41
|
+
<div class={twMerge(barColors[color], labelInsideClass)} style="width: {$_progress}%">
|
|
41
42
|
{$_progress.toFixed(precision)}%
|
|
42
43
|
</div>
|
|
43
44
|
{:else}
|
|
44
|
-
<div class={
|
|
45
|
+
<div class={twMerge(barColors[color], size, 'rounded-full', progressClass)} style="width: {$_progress}%"></div>
|
|
45
46
|
{/if}
|
|
46
47
|
</div>
|
|
47
48
|
|
|
@@ -60,4 +61,5 @@ $: _progress.set(Number(progress));
|
|
|
60
61
|
@prop export let color: 'primary' | 'blue' | 'gray' | 'red' | 'green' | 'yellow' | 'purple' | 'indigo' = 'primary';
|
|
61
62
|
@prop export let labelInsideClass: string = 'text-primary-100 text-xs font-medium text-center p-0.5 leading-none rounded-full';
|
|
62
63
|
@prop export let divClass: string = 'w-full bg-gray-200 rounded-full dark:bg-gray-700';
|
|
64
|
+
@prop export let progressClass: string;
|
|
63
65
|
-->
|
|
@@ -14,6 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
color?: ("primary" | "blue" | "gray" | "red" | "green" | "yellow" | "purple" | "indigo") | undefined;
|
|
15
15
|
labelInsideClass?: string | undefined;
|
|
16
16
|
divClass?: string | undefined;
|
|
17
|
+
progressClass: string;
|
|
17
18
|
};
|
|
18
19
|
events: {
|
|
19
20
|
[evt: string]: CustomEvent<any>;
|
|
@@ -37,6 +38,7 @@ export type ProgressbarSlots = typeof __propDef.slots;
|
|
|
37
38
|
* @prop export let color: 'primary' | 'blue' | 'gray' | 'red' | 'green' | 'yellow' | 'purple' | 'indigo' = 'primary';
|
|
38
39
|
* @prop export let labelInsideClass: string = 'text-primary-100 text-xs font-medium text-center p-0.5 leading-none rounded-full';
|
|
39
40
|
* @prop export let divClass: string = 'w-full bg-gray-200 rounded-full dark:bg-gray-700';
|
|
41
|
+
* @prop export let progressClass: string;
|
|
40
42
|
*/
|
|
41
43
|
export default class Progressbar extends SvelteComponentTyped<ProgressbarProps, ProgressbarEvents, ProgressbarSlots> {
|
|
42
44
|
}
|
|
@@ -8,28 +8,30 @@ export let rating = 4;
|
|
|
8
8
|
export let partialId = "partialStar" + generateId();
|
|
9
9
|
export let icon = Star;
|
|
10
10
|
export let count = false;
|
|
11
|
+
export let iconFillColor;
|
|
12
|
+
export let iconStrokeColor;
|
|
11
13
|
const fullStarId = generateId();
|
|
12
14
|
const grayStarId = generateId();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
$: fullStars = Math.floor(rating);
|
|
16
|
+
$: rateDiffence = rating - fullStars;
|
|
17
|
+
$: percentRating = Math.round(rateDiffence * 100);
|
|
18
|
+
$: grayStars = total - (fullStars + Math.ceil(rateDiffence));
|
|
17
19
|
</script>
|
|
18
20
|
|
|
19
21
|
<div class={twMerge(divClass, $$props.class)}>
|
|
20
22
|
{#if count}
|
|
21
|
-
<svelte:component this={icon} fillPercent={100} {size} />
|
|
23
|
+
<svelte:component this={icon} fillColor={iconFillColor} strokeColor={iconStrokeColor} fillPercent={100} {size} />
|
|
22
24
|
<p class="ms-2 text-sm font-bold text-gray-900 dark:text-white">{rating}</p>
|
|
23
25
|
<slot />
|
|
24
26
|
{:else}
|
|
25
27
|
{#each Array(fullStars) as star}
|
|
26
|
-
<svelte:component this={icon} {size} fillPercent={100} id={fullStarId} />
|
|
28
|
+
<svelte:component this={icon} fillColor={iconFillColor} strokeColor={iconStrokeColor} {size} fillPercent={100} id={fullStarId} />
|
|
27
29
|
{/each}
|
|
28
30
|
{#if percentRating}
|
|
29
|
-
<svelte:component this={icon} {size} fillPercent={percentRating} id={partialId} />
|
|
31
|
+
<svelte:component this={icon} fillColor={iconFillColor} strokeColor={iconStrokeColor} {size} fillPercent={percentRating} id={partialId} />
|
|
30
32
|
{/if}
|
|
31
33
|
{#each Array(grayStars) as star}
|
|
32
|
-
<svelte:component this={icon} {size} fillPercent={0} id={grayStarId} />
|
|
34
|
+
<svelte:component this={icon} fillColor={iconFillColor} strokeColor={iconStrokeColor} {size} fillPercent={0} id={grayStarId} />
|
|
33
35
|
{/each}
|
|
34
36
|
{#if $$slots.text}
|
|
35
37
|
<slot name="text" />
|
|
@@ -41,11 +43,13 @@ let grayStars = total - (fullStars + Math.ceil(rateDiffence));
|
|
|
41
43
|
@component
|
|
42
44
|
[Go to docs](https://flowbite-svelte.com/)
|
|
43
45
|
## Props
|
|
44
|
-
@prop export let divClass:
|
|
45
|
-
@prop export let size:
|
|
46
|
-
@prop export let total:
|
|
47
|
-
@prop export let rating:
|
|
48
|
-
@prop export let partialId:
|
|
49
|
-
@prop export let icon:
|
|
50
|
-
@prop export let count:
|
|
46
|
+
@prop export let divClass: $$Props['divClass'] = 'flex items-center';
|
|
47
|
+
@prop export let size: $$Props['size'] = 24;
|
|
48
|
+
@prop export let total: NonNullable<$$Props['total']> = 5;
|
|
49
|
+
@prop export let rating: $$Props['rating'] = 4;
|
|
50
|
+
@prop export let partialId: $$Props['partialId'] = 'partialStar' + generateId();
|
|
51
|
+
@prop export let icon: $$Props['icon'] = Star;
|
|
52
|
+
@prop export let count: $$Props['count'] = false;
|
|
53
|
+
@prop export let iconFillColor: $$Props['iconFillColor'];
|
|
54
|
+
@prop export let iconStrokeColor: $$Props['iconStrokeColor'];
|
|
51
55
|
-->
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { ComponentType } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
4
|
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
props: HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
divClass?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
total?: number;
|
|
9
|
+
rating: number;
|
|
10
|
+
partialId?: string;
|
|
11
|
+
icon?: ComponentType;
|
|
12
|
+
count?: boolean;
|
|
13
|
+
iconFillColor?: string;
|
|
14
|
+
iconStrokeColor?: string;
|
|
13
15
|
};
|
|
14
16
|
events: {
|
|
15
17
|
[evt: string]: CustomEvent<any>;
|
|
@@ -25,13 +27,15 @@ export type RatingSlots = typeof __propDef.slots;
|
|
|
25
27
|
/**
|
|
26
28
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
27
29
|
* ## Props
|
|
28
|
-
* @prop export let divClass:
|
|
29
|
-
* @prop export let size:
|
|
30
|
-
* @prop export let total:
|
|
31
|
-
* @prop export let rating:
|
|
32
|
-
* @prop export let partialId:
|
|
33
|
-
* @prop export let icon:
|
|
34
|
-
* @prop export let count:
|
|
30
|
+
* @prop export let divClass: $$Props['divClass'] = 'flex items-center';
|
|
31
|
+
* @prop export let size: $$Props['size'] = 24;
|
|
32
|
+
* @prop export let total: NonNullable<$$Props['total']> = 5;
|
|
33
|
+
* @prop export let rating: $$Props['rating'] = 4;
|
|
34
|
+
* @prop export let partialId: $$Props['partialId'] = 'partialStar' + generateId();
|
|
35
|
+
* @prop export let icon: $$Props['icon'] = Star;
|
|
36
|
+
* @prop export let count: $$Props['count'] = false;
|
|
37
|
+
* @prop export let iconFillColor: $$Props['iconFillColor'];
|
|
38
|
+
* @prop export let iconStrokeColor: $$Props['iconStrokeColor'];
|
|
35
39
|
*/
|
|
36
40
|
export default class Rating extends SvelteComponentTyped<RatingProps, RatingEvents, RatingSlots> {
|
|
37
41
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
2
|
import { twMerge } from "tailwind-merge";
|
|
3
|
+
export let action = () => {
|
|
4
|
+
};
|
|
5
|
+
export let params = {};
|
|
3
6
|
export let href = "";
|
|
4
7
|
export let label = "";
|
|
5
8
|
export let spanClass = "ms-3";
|
|
@@ -16,7 +19,7 @@ $: aClass = twMerge(active ? activeClass ?? context.activeClass : nonActiveClass
|
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
21
|
<li>
|
|
19
|
-
<a {...$$restProps} {href} on:blur on:click on:focus on:keydown on:keypress on:keyup on:mouseenter on:mouseleave on:mouseover class={aClass}>
|
|
22
|
+
<a {...$$restProps} {href} use:action={params} on:blur on:click on:focus on:keydown on:keypress on:keyup on:mouseenter on:mouseleave on:mouseover class={aClass}>
|
|
20
23
|
<slot name="icon" />
|
|
21
24
|
<span class={spanClass}>{label}</span>
|
|
22
25
|
{#if $$slots.subtext}
|
|
@@ -29,6 +32,8 @@ $: aClass = twMerge(active ? activeClass ?? context.activeClass : nonActiveClass
|
|
|
29
32
|
@component
|
|
30
33
|
[Go to docs](https://flowbite-svelte.com/)
|
|
31
34
|
## Props
|
|
35
|
+
@prop export let action: Action<HTMLElement, any> = () => {};
|
|
36
|
+
@prop export let params: any = {};
|
|
32
37
|
@prop export let href: string = '';
|
|
33
38
|
@prop export let label: string = '';
|
|
34
39
|
@prop export let spanClass: string = 'ms-3';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Action } from 'svelte/action';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
6
|
+
action?: Action<HTMLElement, any> | undefined;
|
|
7
|
+
params?: any;
|
|
5
8
|
href?: string | undefined;
|
|
6
9
|
label?: string | undefined;
|
|
7
10
|
spanClass?: string | undefined;
|
|
@@ -32,6 +35,8 @@ export type SidebarItemSlots = typeof __propDef.slots;
|
|
|
32
35
|
/**
|
|
33
36
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
34
37
|
* ## Props
|
|
38
|
+
* @prop export let action: Action<HTMLElement, any> = () => {};
|
|
39
|
+
* @prop export let params: any = {};
|
|
35
40
|
* @prop export let href: string = '';
|
|
36
41
|
* @prop export let label: string = '';
|
|
37
42
|
* @prop export let spanClass: string = 'ms-3';
|
package/dist/table/Table.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script generics="T">import { writable } from "svelte/store";
|
|
2
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
2
3
|
import { setContext } from "svelte";
|
|
3
4
|
export let divClass = "relative overflow-x-auto";
|
|
4
5
|
export let striped = false;
|
|
@@ -7,6 +8,17 @@ export let noborder = false;
|
|
|
7
8
|
export let shadow = false;
|
|
8
9
|
export let color = "default";
|
|
9
10
|
export let customeColor = "";
|
|
11
|
+
export let items = [];
|
|
12
|
+
export let filter = null;
|
|
13
|
+
export let placeholder = "Search";
|
|
14
|
+
export let innerDivClass = "p-4";
|
|
15
|
+
export let searchClass = "relative mt-1";
|
|
16
|
+
export let svgDivClass = "absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none";
|
|
17
|
+
export let svgClass = "w-5 h-5 text-gray-500 dark:text-gray-400";
|
|
18
|
+
export let inputClass = "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-80 p-2.5 ps-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500";
|
|
19
|
+
let searchTerm = "";
|
|
20
|
+
let inputCls = twMerge(inputClass, $$props.classInput);
|
|
21
|
+
let svgDivCls = twMerge(svgDivClass, $$props.classSvgDiv);
|
|
10
22
|
const colors = {
|
|
11
23
|
default: "text-gray-500 dark:text-gray-400",
|
|
12
24
|
blue: "text-blue-100 dark:text-blue-100",
|
|
@@ -22,9 +34,35 @@ $: setContext("striped", striped);
|
|
|
22
34
|
$: setContext("hoverable", hoverable);
|
|
23
35
|
$: setContext("noborder", noborder);
|
|
24
36
|
$: setContext("color", color);
|
|
37
|
+
$: setContext("items", items);
|
|
38
|
+
const searchTermStore = writable(searchTerm);
|
|
39
|
+
const filterStore = writable(filter);
|
|
40
|
+
setContext("searchTerm", searchTermStore);
|
|
41
|
+
setContext("filter", filterStore);
|
|
42
|
+
$: searchTermStore.set(searchTerm);
|
|
43
|
+
$: filterStore.set(filter);
|
|
44
|
+
setContext("sorter", writable(null));
|
|
25
45
|
</script>
|
|
26
46
|
|
|
27
47
|
<div class={twJoin(divClass, shadow && 'shadow-md sm:rounded-lg')}>
|
|
48
|
+
{#if filter}
|
|
49
|
+
<slot name="search">
|
|
50
|
+
<div class={innerDivClass}>
|
|
51
|
+
<label for="table-search" class="sr-only">Search</label>
|
|
52
|
+
<div class={searchClass}>
|
|
53
|
+
<div class={svgDivCls}>
|
|
54
|
+
<slot name="svgSearch">
|
|
55
|
+
<svg class={svgClass} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
+
<path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
|
|
57
|
+
</svg>
|
|
58
|
+
</slot>
|
|
59
|
+
</div>
|
|
60
|
+
<input bind:value={searchTerm} type="text" id="table-search" class={inputCls} {placeholder} />
|
|
61
|
+
</div>
|
|
62
|
+
<slot name="header" />
|
|
63
|
+
</div>
|
|
64
|
+
</slot>
|
|
65
|
+
{/if}
|
|
28
66
|
<table {...$$restProps} class={twMerge('w-full text-left text-sm', colors[color], $$props.class)}>
|
|
29
67
|
<slot />
|
|
30
68
|
</table>
|
|
@@ -41,4 +79,12 @@ $: setContext("color", color);
|
|
|
41
79
|
@prop export let shadow: boolean = false;
|
|
42
80
|
@prop export let color: TableColorType = 'default';
|
|
43
81
|
@prop export let customeColor: string = '';
|
|
82
|
+
@prop export let items: T[] = [];
|
|
83
|
+
@prop export let filter: ((t: T, term: string) => boolean) | null = null;
|
|
84
|
+
@prop export let placeholder: string = 'Search';
|
|
85
|
+
@prop export let innerDivClass: string = 'p-4';
|
|
86
|
+
@prop export let searchClass: string = 'relative mt-1';
|
|
87
|
+
@prop export let svgDivClass: string = 'absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none';
|
|
88
|
+
@prop export let svgClass: string = 'w-5 h-5 text-gray-500 dark:text-gray-400';
|
|
89
|
+
@prop export let inputClass: string = 'bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-80 p-2.5 ps-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
44
90
|
-->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { TableColorType } from '../types';
|
|
3
|
-
declare
|
|
4
|
-
props: {
|
|
3
|
+
declare class __sveltets_Render<T> {
|
|
4
|
+
props(): {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
divClass?: string | undefined;
|
|
7
7
|
striped?: boolean | undefined;
|
|
@@ -10,17 +10,28 @@ declare const __propDef: {
|
|
|
10
10
|
shadow?: boolean | undefined;
|
|
11
11
|
color?: TableColorType | undefined;
|
|
12
12
|
customeColor?: string | undefined;
|
|
13
|
+
items?: T[] | undefined;
|
|
14
|
+
filter?: ((t: T, term: string) => boolean) | null | undefined;
|
|
15
|
+
placeholder?: string | undefined;
|
|
16
|
+
innerDivClass?: string | undefined;
|
|
17
|
+
searchClass?: string | undefined;
|
|
18
|
+
svgDivClass?: string | undefined;
|
|
19
|
+
svgClass?: string | undefined;
|
|
20
|
+
inputClass?: string | undefined;
|
|
13
21
|
};
|
|
14
|
-
events: {
|
|
22
|
+
events(): {} & {
|
|
15
23
|
[evt: string]: CustomEvent<any>;
|
|
16
24
|
};
|
|
17
|
-
slots: {
|
|
25
|
+
slots(): {
|
|
26
|
+
search: {};
|
|
27
|
+
svgSearch: {};
|
|
28
|
+
header: {};
|
|
18
29
|
default: {};
|
|
19
30
|
};
|
|
20
|
-
}
|
|
21
|
-
export type TableProps =
|
|
22
|
-
export type TableEvents =
|
|
23
|
-
export type TableSlots =
|
|
31
|
+
}
|
|
32
|
+
export type TableProps<T> = ReturnType<__sveltets_Render<T>['props']>;
|
|
33
|
+
export type TableEvents<T> = ReturnType<__sveltets_Render<T>['events']>;
|
|
34
|
+
export type TableSlots<T> = ReturnType<__sveltets_Render<T>['slots']>;
|
|
24
35
|
/**
|
|
25
36
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
26
37
|
* ## Props
|
|
@@ -31,7 +42,15 @@ export type TableSlots = typeof __propDef.slots;
|
|
|
31
42
|
* @prop export let shadow: boolean = false;
|
|
32
43
|
* @prop export let color: TableColorType = 'default';
|
|
33
44
|
* @prop export let customeColor: string = '';
|
|
45
|
+
* @prop export let items: T[] = [];
|
|
46
|
+
* @prop export let filter: ((t: T, term: string) => boolean) | null = null;
|
|
47
|
+
* @prop export let placeholder: string = 'Search';
|
|
48
|
+
* @prop export let innerDivClass: string = 'p-4';
|
|
49
|
+
* @prop export let searchClass: string = 'relative mt-1';
|
|
50
|
+
* @prop export let svgDivClass: string = 'absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none';
|
|
51
|
+
* @prop export let svgClass: string = 'w-5 h-5 text-gray-500 dark:text-gray-400';
|
|
52
|
+
* @prop export let inputClass: string = 'bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-80 p-2.5 ps-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
34
53
|
*/
|
|
35
|
-
export default class Table extends SvelteComponentTyped<TableProps
|
|
54
|
+
export default class Table<T> extends SvelteComponentTyped<TableProps<T>, TableEvents<T>, TableSlots<T>> {
|
|
36
55
|
}
|
|
37
56
|
export {};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script generics="T">import { getContext } from "svelte";
|
|
2
|
+
export let tableBodyClass = void 0;
|
|
3
|
+
$: items = getContext("items") || [];
|
|
4
|
+
let filter = getContext("filter");
|
|
5
|
+
let searchTerm = getContext("searchTerm");
|
|
6
|
+
$: filtered = $filter ? items.filter((item) => $filter(item, $searchTerm)) : items;
|
|
7
|
+
let sorter = getContext("sorter");
|
|
8
|
+
$: sorted = $sorter ? filtered.toSorted((a, b) => $sorter.sortDirection * $sorter.sort(a, b)) : filtered;
|
|
2
9
|
</script>
|
|
3
10
|
|
|
4
11
|
<tbody class={tableBodyClass}>
|
|
5
12
|
<slot />
|
|
13
|
+
{#each sorted as item}
|
|
14
|
+
<slot name="row" {item} />
|
|
15
|
+
{/each}
|
|
6
16
|
</tbody>
|
|
7
17
|
|
|
8
18
|
<!--
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare
|
|
3
|
-
props: {
|
|
2
|
+
declare class __sveltets_Render<T> {
|
|
3
|
+
props(): {
|
|
4
4
|
tableBodyClass?: string | undefined;
|
|
5
5
|
};
|
|
6
|
-
events: {
|
|
6
|
+
events(): {} & {
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
8
8
|
};
|
|
9
|
-
slots: {
|
|
9
|
+
slots(): {
|
|
10
10
|
default: {};
|
|
11
|
+
row: {
|
|
12
|
+
item: T;
|
|
13
|
+
};
|
|
11
14
|
};
|
|
12
|
-
}
|
|
13
|
-
export type TableBodyProps =
|
|
14
|
-
export type TableBodyEvents =
|
|
15
|
-
export type TableBodySlots =
|
|
15
|
+
}
|
|
16
|
+
export type TableBodyProps<T> = ReturnType<__sveltets_Render<T>['props']>;
|
|
17
|
+
export type TableBodyEvents<T> = ReturnType<__sveltets_Render<T>['events']>;
|
|
18
|
+
export type TableBodySlots<T> = ReturnType<__sveltets_Render<T>['slots']>;
|
|
16
19
|
/**
|
|
17
20
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
18
21
|
* ## Props
|
|
19
22
|
* @prop export let tableBodyClass: string | undefined = undefined;
|
|
20
23
|
*/
|
|
21
|
-
export default class TableBody extends SvelteComponentTyped<TableBodyProps
|
|
24
|
+
export default class TableBody<T> extends SvelteComponentTyped<TableBodyProps<T>, TableBodyEvents<T>, TableBodySlots<T>> {
|
|
22
25
|
}
|
|
23
26
|
export {};
|
|
@@ -1,14 +1,47 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script generics="T">import { getContext } from "svelte";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
2
3
|
export let padding = "px-6 py-3";
|
|
4
|
+
export let sort = null;
|
|
5
|
+
export let defaultDirection = "asc";
|
|
6
|
+
export let defaultSort = false;
|
|
7
|
+
export let direction = defaultSort ? defaultDirection : null;
|
|
8
|
+
let sorter = getContext("sorter");
|
|
9
|
+
let sortId = Math.random().toString(36).substring(2);
|
|
10
|
+
$: direction = $sorter?.id === sortId ? $sorter.sortDirection === 1 ? "asc" : "desc" : null;
|
|
11
|
+
if (defaultSort) {
|
|
12
|
+
sortItems();
|
|
13
|
+
}
|
|
14
|
+
function sortItems() {
|
|
15
|
+
if (!sort || !sorter) return;
|
|
16
|
+
sorter.update((sorter2) => {
|
|
17
|
+
return {
|
|
18
|
+
id: sortId,
|
|
19
|
+
sort,
|
|
20
|
+
sortDirection: sorter2?.id === sortId ? -sorter2.sortDirection : defaultDirection === "asc" ? 1 : -1
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
3
24
|
</script>
|
|
4
25
|
|
|
26
|
+
{#if sort && sorter}
|
|
27
|
+
<th {...$$restProps} class={$$props.class} on:click on:focus on:keydown on:keypress on:keyup on:mouseenter on:mouseleave on:mouseover aria-sort={direction ? `${direction}ending` : undefined}>
|
|
28
|
+
<button class={twMerge('w-full text-left', 'after:absolute after:pl-3', direction === 'asc' && 'after:content-["▲"]', direction === 'desc' && 'after:content-["▼"]', padding)} on:click={sortItems}>
|
|
29
|
+
<slot />
|
|
30
|
+
</button>
|
|
31
|
+
</th>
|
|
32
|
+
{:else}
|
|
5
33
|
<th {...$$restProps} class={twMerge(padding, $$props.class)} on:click on:focus on:keydown on:keypress on:keyup on:mouseenter on:mouseleave on:mouseover>
|
|
6
34
|
<slot />
|
|
7
35
|
</th>
|
|
36
|
+
{/if}
|
|
8
37
|
|
|
9
38
|
<!--
|
|
10
39
|
@component
|
|
11
40
|
[Go to docs](https://flowbite-svelte.com/)
|
|
12
41
|
## Props
|
|
13
42
|
@prop export let padding: string = 'px-6 py-3';
|
|
43
|
+
@prop export let sort: ((a: T, b: T) => number) | null = null;
|
|
44
|
+
@prop export let defaultDirection: 'asc' | 'desc' = 'asc';
|
|
45
|
+
@prop export let defaultSort: boolean = false;
|
|
46
|
+
@prop export let direction: 'asc' | 'desc' | null = defaultSort ? defaultDirection : null;
|
|
14
47
|
-->
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare
|
|
3
|
-
props: {
|
|
2
|
+
declare class __sveltets_Render<T> {
|
|
3
|
+
props(): {
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
padding?: string | undefined;
|
|
6
|
+
sort?: ((a: T, b: T) => number) | null | undefined;
|
|
7
|
+
defaultDirection?: ("asc" | "desc") | undefined;
|
|
8
|
+
defaultSort?: boolean | undefined;
|
|
9
|
+
direction?: ("asc" | "desc" | null) | undefined;
|
|
6
10
|
};
|
|
7
|
-
events: {
|
|
11
|
+
events(): {
|
|
8
12
|
click: MouseEvent;
|
|
9
13
|
focus: FocusEvent;
|
|
10
14
|
keydown: KeyboardEvent;
|
|
@@ -16,18 +20,22 @@ declare const __propDef: {
|
|
|
16
20
|
} & {
|
|
17
21
|
[evt: string]: CustomEvent<any>;
|
|
18
22
|
};
|
|
19
|
-
slots: {
|
|
23
|
+
slots(): {
|
|
20
24
|
default: {};
|
|
21
25
|
};
|
|
22
|
-
}
|
|
23
|
-
export type TableHeadCellProps =
|
|
24
|
-
export type TableHeadCellEvents =
|
|
25
|
-
export type TableHeadCellSlots =
|
|
26
|
+
}
|
|
27
|
+
export type TableHeadCellProps<T> = ReturnType<__sveltets_Render<T>['props']>;
|
|
28
|
+
export type TableHeadCellEvents<T> = ReturnType<__sveltets_Render<T>['events']>;
|
|
29
|
+
export type TableHeadCellSlots<T> = ReturnType<__sveltets_Render<T>['slots']>;
|
|
26
30
|
/**
|
|
27
31
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
28
32
|
* ## Props
|
|
29
33
|
* @prop export let padding: string = 'px-6 py-3';
|
|
34
|
+
* @prop export let sort: ((a: T, b: T) => number) | null = null;
|
|
35
|
+
* @prop export let defaultDirection: 'asc' | 'desc' = 'asc';
|
|
36
|
+
* @prop export let defaultSort: boolean = false;
|
|
37
|
+
* @prop export let direction: 'asc' | 'desc' | null = defaultSort ? defaultDirection : null;
|
|
30
38
|
*/
|
|
31
|
-
export default class TableHeadCell extends SvelteComponentTyped<TableHeadCellProps
|
|
39
|
+
export default class TableHeadCell<T> extends SvelteComponentTyped<TableHeadCellProps<T>, TableHeadCellEvents<T>, TableHeadCellSlots<T>> {
|
|
32
40
|
}
|
|
33
41
|
export {};
|
|
@@ -5,6 +5,7 @@ export let imgClass = "me-3 mb-3 w-12 h-12 rounded-full sm:mb-0";
|
|
|
5
5
|
export let divClass = "text-gray-600 dark:text-gray-400";
|
|
6
6
|
export let titleClass = "text-base font-normal";
|
|
7
7
|
export let spanClass = "inline-flex items-center text-xs font-normal text-gray-500 dark:text-gray-400";
|
|
8
|
+
export let isPrivacy = true;
|
|
8
9
|
let aCls = twMerge(aClass, $$props.classA);
|
|
9
10
|
let imgCls = twMerge(imgClass, $$props.classImg);
|
|
10
11
|
let divCls = twMerge(divClass, $$props.classDiv);
|
|
@@ -23,6 +24,7 @@ let spanCls = twMerge(spanClass, $$props.classSpan);
|
|
|
23
24
|
{#if comment}
|
|
24
25
|
<div class="text-sm font-normal">{comment}</div>
|
|
25
26
|
{/if}
|
|
27
|
+
{#if isPrivacy}
|
|
26
28
|
<span class={spanCls}>
|
|
27
29
|
{#if isPrivate}
|
|
28
30
|
<svg class="me-1 w-3 h-3" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -37,6 +39,7 @@ let spanCls = twMerge(spanClass, $$props.classSpan);
|
|
|
37
39
|
Public
|
|
38
40
|
{/if}
|
|
39
41
|
</span>
|
|
42
|
+
{/if}
|
|
40
43
|
</div>
|
|
41
44
|
</a>
|
|
42
45
|
</li>
|
|
@@ -52,4 +55,5 @@ let spanCls = twMerge(spanClass, $$props.classSpan);
|
|
|
52
55
|
@prop export let divClass: string = 'text-gray-600 dark:text-gray-400';
|
|
53
56
|
@prop export let titleClass: string = 'text-base font-normal';
|
|
54
57
|
@prop export let spanClass: string = 'inline-flex items-center text-xs font-normal text-gray-500 dark:text-gray-400';
|
|
58
|
+
@prop export let isPrivacy: boolean = true;
|
|
55
59
|
-->
|
|
@@ -9,6 +9,7 @@ declare const __propDef: {
|
|
|
9
9
|
divClass?: string | undefined;
|
|
10
10
|
titleClass?: string | undefined;
|
|
11
11
|
spanClass?: string | undefined;
|
|
12
|
+
isPrivacy?: boolean | undefined;
|
|
12
13
|
};
|
|
13
14
|
events: {
|
|
14
15
|
[evt: string]: CustomEvent<any>;
|
|
@@ -27,6 +28,7 @@ export type GroupItemSlots = typeof __propDef.slots;
|
|
|
27
28
|
* @prop export let divClass: string = 'text-gray-600 dark:text-gray-400';
|
|
28
29
|
* @prop export let titleClass: string = 'text-base font-normal';
|
|
29
30
|
* @prop export let spanClass: string = 'inline-flex items-center text-xs font-normal text-gray-500 dark:text-gray-400';
|
|
31
|
+
* @prop export let isPrivacy: boolean = true;
|
|
30
32
|
*/
|
|
31
33
|
export default class GroupItem extends SvelteComponentTyped<GroupItemProps, GroupItemEvents, GroupItemSlots> {
|
|
32
34
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export type ReviewType = {
|
|
|
46
46
|
export type SelectOptionType<T> = {
|
|
47
47
|
name: string | number;
|
|
48
48
|
value: T;
|
|
49
|
+
disabled?: boolean;
|
|
49
50
|
};
|
|
50
51
|
export type TransitionTypes = 'fade' | 'fly' | 'slide' | 'blur' | 'in:fly' | 'out:fly' | 'in:slide' | 'out:slide' | 'in:fade' | 'out:fade' | 'in:blur' | 'out:blur';
|
|
51
52
|
export interface ActivityType {
|
package/dist/typography/A.svelte
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<script>import { twMerge } from "tailwind-merge";
|
|
2
|
+
export let action = () => {
|
|
3
|
+
};
|
|
4
|
+
export let params = {};
|
|
2
5
|
export let href = "#";
|
|
3
6
|
export let color = "text-primary-600 dark:text-primary-500";
|
|
4
7
|
export let aClass = "inline-flex items-center hover:underline";
|
|
5
8
|
</script>
|
|
6
9
|
|
|
7
|
-
<a {...$$restProps} {href} class={twMerge(aClass, color, $$props.class)} on:click>
|
|
10
|
+
<a {...$$restProps} {href} use:action={params} class={twMerge(aClass, color, $$props.class)} on:click>
|
|
8
11
|
<slot />
|
|
9
12
|
</a>
|
|
10
13
|
|
|
@@ -12,6 +15,8 @@ export let aClass = "inline-flex items-center hover:underline";
|
|
|
12
15
|
@component
|
|
13
16
|
[Go to docs](https://flowbite-svelte.com/)
|
|
14
17
|
## Props
|
|
18
|
+
@prop export let action: Action<HTMLElement, any> = () => {};
|
|
19
|
+
@prop export let params: any = {};
|
|
15
20
|
@prop export let href: string = '#';
|
|
16
21
|
@prop export let color: string = 'text-primary-600 dark:text-primary-500';
|
|
17
22
|
@prop export let aClass: string = 'inline-flex items-center hover:underline';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Action } from 'svelte/action';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
6
|
+
action?: Action<HTMLElement, any> | undefined;
|
|
7
|
+
params?: any;
|
|
5
8
|
href?: string | undefined;
|
|
6
9
|
color?: string | undefined;
|
|
7
10
|
aClass?: string | undefined;
|
|
@@ -21,6 +24,8 @@ export type ASlots = typeof __propDef.slots;
|
|
|
21
24
|
/**
|
|
22
25
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
23
26
|
* ## Props
|
|
27
|
+
* @prop export let action: Action<HTMLElement, any> = () => {};
|
|
28
|
+
* @prop export let params: any = {};
|
|
24
29
|
* @prop export let href: string = '#';
|
|
25
30
|
* @prop export let color: string = 'text-primary-600 dark:text-primary-500';
|
|
26
31
|
* @prop export let aClass: string = 'inline-flex items-center hover:underline';
|
package/dist/utils/Popper.svelte
CHANGED
|
@@ -14,6 +14,8 @@ export let open = false;
|
|
|
14
14
|
export let yOnly = false;
|
|
15
15
|
export let middlewares = [dom.flip(), dom.shift()];
|
|
16
16
|
const dispatch = createEventDispatcher();
|
|
17
|
+
let focusable;
|
|
18
|
+
$: focusable = trigger === "focus";
|
|
17
19
|
let clickable;
|
|
18
20
|
$: clickable = trigger === "click";
|
|
19
21
|
let hoverable;
|
|
@@ -25,29 +27,28 @@ let floatingEl;
|
|
|
25
27
|
let arrowEl;
|
|
26
28
|
let contentEl;
|
|
27
29
|
let triggerEls = [];
|
|
28
|
-
let _blocked = false;
|
|
29
|
-
const block = () => (_blocked = true, setTimeout(() => _blocked = false, 250));
|
|
30
30
|
const showHandler = (ev) => {
|
|
31
31
|
if (referenceEl === void 0) console.error("trigger undefined");
|
|
32
32
|
if (!reference && triggerEls.includes(ev.target) && referenceEl !== ev.target) {
|
|
33
33
|
referenceEl = ev.target;
|
|
34
|
-
|
|
34
|
+
if (open) return;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
open = clickable && ev.type === "click" && !_blocked ? !open : true;
|
|
36
|
+
open = ev.type === "click" ? !open : true;
|
|
38
37
|
};
|
|
39
38
|
const hasHover = (el) => el.matches(":hover");
|
|
40
39
|
const hasFocus = (el) => el.contains(document.activeElement);
|
|
41
|
-
const px = (n) => n
|
|
40
|
+
const px = (n) => n ? `${n}px` : "";
|
|
42
41
|
const hideHandler = (ev) => {
|
|
43
|
-
if (activeContent) {
|
|
42
|
+
if (activeContent && hoverable) {
|
|
43
|
+
const elements = [referenceEl, floatingEl, ...triggerEls].filter(Boolean);
|
|
44
44
|
setTimeout(() => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
open = false;
|
|
45
|
+
if (ev.type === "mouseleave" && !elements.some(hasHover)) {
|
|
46
|
+
open = false;
|
|
47
|
+
}
|
|
49
48
|
}, 100);
|
|
50
|
-
} else
|
|
49
|
+
} else {
|
|
50
|
+
open = false;
|
|
51
|
+
}
|
|
51
52
|
};
|
|
52
53
|
let arrowSide;
|
|
53
54
|
const oppositeSideMap = {
|
|
@@ -85,8 +86,8 @@ function init(node, _referenceEl) {
|
|
|
85
86
|
}
|
|
86
87
|
onMount(() => {
|
|
87
88
|
const events = [
|
|
88
|
-
["focusin", showHandler,
|
|
89
|
-
["focusout", hideHandler,
|
|
89
|
+
["focusin", showHandler, focusable],
|
|
90
|
+
["focusout", hideHandler, focusable],
|
|
90
91
|
["click", showHandler, clickable],
|
|
91
92
|
["mouseenter", showHandler, hoverable],
|
|
92
93
|
["mouseleave", hideHandler, hoverable]
|
|
@@ -105,13 +106,13 @@ onMount(() => {
|
|
|
105
106
|
if (referenceEl === document.body) {
|
|
106
107
|
console.error(`Popup reference not found: '${reference}'`);
|
|
107
108
|
} else {
|
|
108
|
-
referenceEl.addEventListener("focusout", hideHandler);
|
|
109
|
+
if (focusable) referenceEl.addEventListener("focusout", hideHandler);
|
|
109
110
|
if (hoverable) referenceEl.addEventListener("mouseleave", hideHandler);
|
|
110
111
|
}
|
|
111
112
|
} else {
|
|
112
113
|
referenceEl = triggerEls[0];
|
|
113
114
|
}
|
|
114
|
-
document.addEventListener("click", closeOnClickOutside);
|
|
115
|
+
if (clickable) document.addEventListener("click", closeOnClickOutside);
|
|
115
116
|
return () => {
|
|
116
117
|
triggerEls.forEach((element) => {
|
|
117
118
|
if (element) {
|
|
@@ -152,7 +153,7 @@ function initArrow(node) {
|
|
|
152
153
|
{/if}
|
|
153
154
|
|
|
154
155
|
{#if referenceEl}
|
|
155
|
-
<Frame use={init} options={referenceEl} bind:open role="tooltip" tabindex={activeContent ? -1 : undefined} on:focusin={optional(activeContent, showHandler)} on:focusout={optional(activeContent, hideHandler)} on:mouseenter={optional(activeContent && hoverable, showHandler)} on:mouseleave={optional(activeContent && hoverable, hideHandler)} {...$$restProps}>
|
|
156
|
+
<Frame use={init} options={referenceEl} bind:open role="tooltip" tabindex={activeContent ? -1 : undefined} on:focusin={optional(activeContent && focusable, showHandler)} on:focusout={optional(activeContent && focusable, hideHandler)} on:mouseenter={optional(activeContent && hoverable, showHandler)} on:mouseleave={optional(activeContent && hoverable, hideHandler)} {...$$restProps}>
|
|
156
157
|
<slot></slot>
|
|
157
158
|
{#if arrow}<div use:initArrow class={arrowClass}></div>{/if}
|
|
158
159
|
</Frame>
|
package/dist/utils/focusTrap.js
CHANGED
|
@@ -22,7 +22,9 @@ export default function focusTrap(node) {
|
|
|
22
22
|
|
|
23
23
|
const tabbable = Array.from(node.querySelectorAll(selectorTabbable)).filter((el) => el.hidden !== true);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const activeElement = document.activeElement && document.activeElement.shadowRoot ? document.activeElement.shadowRoot.activeElement : document.activeElement;
|
|
26
|
+
|
|
27
|
+
let index = tabbable.indexOf(activeElement ?? node);
|
|
26
28
|
if (index === -1 && e.shiftKey) index = 0;
|
|
27
29
|
index += tabbable.length + (e.shiftKey ? -1 : 1);
|
|
28
30
|
index %= tabbable.length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.18",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"homepage": "https://flowbite-svelte.com/",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@changesets/cli": "^2.27.
|
|
15
|
+
"@changesets/cli": "^2.27.8",
|
|
16
16
|
"@docsearch/css": "^3.6.1",
|
|
17
17
|
"@docsearch/js": "^3.6.1",
|
|
18
|
-
"@playwright/test": "^1.
|
|
19
|
-
"@sveltejs/adapter-vercel": "^5.4.
|
|
20
|
-
"@sveltejs/kit": "^2.5.
|
|
18
|
+
"@playwright/test": "^1.47.2",
|
|
19
|
+
"@sveltejs/adapter-vercel": "^5.4.4",
|
|
20
|
+
"@sveltejs/kit": "^2.5.28",
|
|
21
21
|
"@sveltejs/package": "2.3.2",
|
|
22
22
|
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
|
23
23
|
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
|
|
@@ -25,31 +25,31 @@
|
|
|
25
25
|
"autoprefixer": "^10.4.20",
|
|
26
26
|
"dayjs": "^1.11.13",
|
|
27
27
|
"esbuild": "0.23.1",
|
|
28
|
-
"eslint": "^9.
|
|
28
|
+
"eslint": "^9.11.0",
|
|
29
29
|
"eslint-config-prettier": "^9.1.0",
|
|
30
|
-
"eslint-plugin-svelte": "^2.
|
|
31
|
-
"flowbite-svelte": "^0.46.
|
|
30
|
+
"eslint-plugin-svelte": "^2.44.0",
|
|
31
|
+
"flowbite-svelte": "^0.46.18",
|
|
32
32
|
"flowbite-svelte-blocks": "^1.1.3",
|
|
33
33
|
"flowbite-svelte-icons": "^1.6.1",
|
|
34
34
|
"mdsvex": "^0.12.3",
|
|
35
35
|
"mdsvexamples": "^0.4.1",
|
|
36
|
-
"postcss": "^8.4.
|
|
36
|
+
"postcss": "^8.4.47",
|
|
37
37
|
"prettier": "^3.3.3",
|
|
38
38
|
"prettier-plugin-svelte": "^3.2.6",
|
|
39
39
|
"prism-themes": "^1.9.0",
|
|
40
|
-
"publint": "^0.2.
|
|
40
|
+
"publint": "^0.2.11",
|
|
41
41
|
"svelte": "^4.2.19",
|
|
42
|
-
"svelte-check": "^4.0.
|
|
43
|
-
"svelte-lib-helpers": "^0.4.
|
|
42
|
+
"svelte-check": "^4.0.2",
|
|
43
|
+
"svelte-lib-helpers": "^0.4.8",
|
|
44
44
|
"svelte-meta-tags": "^3.1.4",
|
|
45
45
|
"svelte-preprocess": "^6.0.2",
|
|
46
|
-
"svelte2tsx": "^0.7.
|
|
46
|
+
"svelte2tsx": "^0.7.19",
|
|
47
47
|
"tailwind-merge": "^1.13.1",
|
|
48
|
-
"tailwindcss": "^3.4.
|
|
48
|
+
"tailwindcss": "^3.4.12",
|
|
49
49
|
"tslib": "^2.7.0",
|
|
50
|
-
"typescript": "^5.
|
|
50
|
+
"typescript": "^5.6.2",
|
|
51
51
|
"typescript-eslint": "8.4.0",
|
|
52
|
-
"vite": "^5.4.
|
|
52
|
+
"vite": "^5.4.7",
|
|
53
53
|
"vitest": "^1.6.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"url": "https://github.com/themesberg/flowbite-svelte"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@floating-ui/dom": "^1.6.
|
|
102
|
+
"@floating-ui/dom": "^1.6.11",
|
|
103
103
|
"apexcharts": "^3.53.0",
|
|
104
104
|
"flowbite": "^2.5.1",
|
|
105
105
|
"tailwind-merge": "^2.5.2"
|
|
@@ -746,6 +746,7 @@
|
|
|
746
746
|
"test": "npm run test:integration && npm run test:unit",
|
|
747
747
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
748
748
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
749
|
+
"lint:format": "prettier --plugin-search-dir . --check .",
|
|
749
750
|
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
750
751
|
"format": "prettier --plugin-search-dir . --write .",
|
|
751
752
|
"test:integration": "playwright test",
|