flowbite-svelte 0.29.9 → 0.29.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/accordions/AccordionItem.svelte +1 -1
- package/footer/FooterCopyright.svelte +2 -1
- package/footer/FooterCopyright.svelte.d.ts +1 -0
- package/footer/FooterLink.svelte +1 -2
- package/forms/Select.svelte +5 -1
- package/forms/Select.svelte.d.ts +3 -1
- package/forms/Textarea.svelte +1 -0
- package/forms/Textarea.svelte.d.ts +1 -0
- package/modals/Modal.svelte +18 -13
- package/navbar/NavUl.svelte +2 -1
- package/navbar/NavUl.svelte.d.ts +2 -0
- package/package.json +1 -1
- package/paginations/PaginationItem.svelte +1 -1
- package/ratings/Rating.svelte +2 -2
- package/ratings/RatingComment.svelte +51 -51
- package/types.d.ts +1 -1
- package/utils/backdrop.d.ts +2 -2
- package/utils/backdrop.js +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.29.10](https://github.com/themesberg/flowbite-svelte/compare/v0.29.9...v0.29.10) (2023-01-13)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add on:input to textarea ([#518](https://github.com/themesberg/flowbite-svelte/issues/518)) ([318ffbf](https://github.com/themesberg/flowbite-svelte/commit/318ffbf676366fcc7bd08c538270800d90ce5189))
|
|
11
|
+
* make Select receive custom options ([#514](https://github.com/themesberg/flowbite-svelte/issues/514)) ([a58b410](https://github.com/themesberg/flowbite-svelte/commit/a58b410a3ffce29432907457baeae8c20977ef42))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* [#530](https://github.com/themesberg/flowbite-svelte/issues/530) ([16c6650](https://github.com/themesberg/flowbite-svelte/commit/16c66504d42a378705a120fae5a6ca147a776bd4))
|
|
17
|
+
* export slide params ([#516](https://github.com/themesberg/flowbite-svelte/issues/516)) ([c8dd81d](https://github.com/themesberg/flowbite-svelte/commit/c8dd81d5493b908a903648104f0371ac143c1167))
|
|
18
|
+
* modal layout ([#526](https://github.com/themesberg/flowbite-svelte/issues/526)) ([6b25019](https://github.com/themesberg/flowbite-svelte/commit/6b250190f25feefe21191b3d8cab709fe28c6908))
|
|
19
|
+
* npm run check corrections ([#517](https://github.com/themesberg/flowbite-svelte/issues/517)) ([f1f89e3](https://github.com/themesberg/flowbite-svelte/commit/f1f89e30221fd3bb63fed174fe825a46f780d1c7))
|
|
20
|
+
|
|
5
21
|
### [0.29.9](https://github.com/themesberg/flowbite-svelte/compare/v0.29.8...v0.29.9) (2023-01-01)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -35,7 +35,7 @@ onMount(() => {
|
|
|
35
35
|
// this will trigger unsubscribe on destroy
|
|
36
36
|
return selected.subscribe((x) => (open = x === self));
|
|
37
37
|
});
|
|
38
|
-
const handleToggle = (
|
|
38
|
+
const handleToggle = (_) => selected.set(open ? {} : self);
|
|
39
39
|
let buttonClass;
|
|
40
40
|
$: buttonClass = classNames(defaultClass, ctx.flush ? 'py-5' : 'p-5', open && (ctx.flush ? 'text-gray-900 dark:text-white' : activeClasses || ctx.activeClasses), !open && (ctx.flush ? 'text-gray-500 dark:text-gray-400' : inactiveClasses || ctx.inactiveClasses), $$props.class);
|
|
41
41
|
</script>
|
|
@@ -5,6 +5,7 @@ export let year = new Date().getFullYear();
|
|
|
5
5
|
export let href = '';
|
|
6
6
|
export let by = '';
|
|
7
7
|
export let target = undefined;
|
|
8
|
+
export let copyrightMessage = 'All Rights Reserved.';
|
|
8
9
|
</script>
|
|
9
10
|
|
|
10
11
|
<span class={classNames(spanClass, $$props.class)}>
|
|
@@ -16,5 +17,5 @@ export let target = undefined;
|
|
|
16
17
|
{:else}
|
|
17
18
|
<span class="ml-1">{by}</span>
|
|
18
19
|
{/if}
|
|
19
|
-
.
|
|
20
|
+
. {copyrightMessage}
|
|
20
21
|
</span>
|
package/footer/FooterLink.svelte
CHANGED
package/forms/Select.svelte
CHANGED
|
@@ -17,9 +17,13 @@ $: selectClass = classNames(common, underline ? underlineClass : defaultClass, s
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<select {...$$restProps} bind:value class={selectClass} on:change on:contextmenu on:input>
|
|
20
|
-
|
|
20
|
+
{#if placeholder}
|
|
21
|
+
<option disabled selected value="">{placeholder}</option>
|
|
22
|
+
{/if}
|
|
21
23
|
|
|
22
24
|
{#each items as { value, name }}
|
|
23
25
|
<option {value}>{name}</option>
|
|
26
|
+
{:else}
|
|
27
|
+
<slot />
|
|
24
28
|
{/each}
|
|
25
29
|
</select>
|
package/forms/Select.svelte.d.ts
CHANGED
package/forms/Textarea.svelte
CHANGED
package/modals/Modal.svelte
CHANGED
|
@@ -62,15 +62,14 @@ const sizes = {
|
|
|
62
62
|
const onAutoClose = (e) => {
|
|
63
63
|
const target = e.target;
|
|
64
64
|
if (autoclose && target?.tagName === 'BUTTON')
|
|
65
|
-
|
|
65
|
+
hide(e);
|
|
66
66
|
};
|
|
67
|
-
const hide = () => {
|
|
67
|
+
const hide = (e) => {
|
|
68
|
+
e.preventDefault();
|
|
68
69
|
open = false;
|
|
69
70
|
};
|
|
70
|
-
let mainClass;
|
|
71
|
-
$: mainClass = classNames('flex overflow-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full', backdropClasses, ...getPlacementClasses());
|
|
72
71
|
let frameClass;
|
|
73
|
-
$: frameClass = classNames('relative flex flex-col
|
|
72
|
+
$: frameClass = classNames('relative flex flex-col mx-auto', $$props.class);
|
|
74
73
|
const isScrollable = (e) => [
|
|
75
74
|
e.scrollWidth > e.clientWidth && ['scroll', 'auto'].indexOf(getComputedStyle(e).overflowX) >= 0,
|
|
76
75
|
e.scrollHeight > e.clientHeight && ['scroll', 'auto'].indexOf(getComputedStyle(e).overflowY) >= 0
|
|
@@ -82,22 +81,28 @@ function preventWheelDefault(e) {
|
|
|
82
81
|
}
|
|
83
82
|
function handleKeys(e) {
|
|
84
83
|
if (e.key === 'Escape' && !permanent)
|
|
85
|
-
return hide();
|
|
84
|
+
return hide(e);
|
|
86
85
|
}
|
|
87
86
|
</script>
|
|
88
87
|
|
|
89
88
|
{#if open}
|
|
89
|
+
<!-- backdrop -->
|
|
90
|
+
<div class={classNames('fixed inset-0 z-40', backdropClasses)} />
|
|
91
|
+
<!-- dialog -->
|
|
90
92
|
<div
|
|
91
|
-
|
|
92
|
-
class={mainClass}
|
|
93
|
-
aria-modal="true"
|
|
94
|
-
role="dialog"
|
|
95
|
-
on:keydown|preventDefault={handleKeys}
|
|
93
|
+
on:keydown={handleKeys}
|
|
96
94
|
on:wheel|preventDefault
|
|
97
95
|
use:prepareFocus
|
|
98
96
|
use:focusTrap
|
|
99
|
-
on:click={autoclose ? onAutoClose : null}
|
|
100
|
-
|
|
97
|
+
on:click={autoclose ? onAutoClose : null}
|
|
98
|
+
class={classNames(
|
|
99
|
+
'fixed top-0 left-0 right-0 h-modal md:inset-0 md:h-full z-50 w-full p-4 flex',
|
|
100
|
+
...getPlacementClasses()
|
|
101
|
+
)}
|
|
102
|
+
tabindex="-1"
|
|
103
|
+
aria-modal="true"
|
|
104
|
+
role="dialog">
|
|
105
|
+
<div class="flex relative {sizes[size]} w-full max-h-full">
|
|
101
106
|
<!-- Modal content -->
|
|
102
107
|
<Frame rounded shadow {...$$restProps} class={frameClass}>
|
|
103
108
|
<!-- Modal header -->
|
package/navbar/NavUl.svelte
CHANGED
|
@@ -5,6 +5,7 @@ import Frame from '../utils/Frame.svelte';
|
|
|
5
5
|
export let divClass = 'w-full md:block md:w-auto';
|
|
6
6
|
export let ulClass = 'flex flex-col p-4 mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium';
|
|
7
7
|
export let hidden = true;
|
|
8
|
+
export let slideParams = { delay: 250, duration: 500, easing: quintOut };
|
|
8
9
|
let _divClass;
|
|
9
10
|
$: _divClass = classNames(divClass, $$props.class);
|
|
10
11
|
let _ulClass;
|
|
@@ -14,7 +15,7 @@ $$props.class);
|
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
17
|
{#if !hidden}
|
|
17
|
-
<div {...$$restProps} class={_divClass} transition:slide={
|
|
18
|
+
<div {...$$restProps} class={_divClass} transition:slide={slideParams}>
|
|
18
19
|
<Frame tag="ul" border rounded color="navbarUl" class={_ulClass}>
|
|
19
20
|
<slot />
|
|
20
21
|
</Frame>
|
package/navbar/NavUl.svelte.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { type SlideParams } from 'svelte/transition';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
5
6
|
divClass?: string | undefined;
|
|
6
7
|
ulClass?: string | undefined;
|
|
7
8
|
hidden?: boolean | undefined;
|
|
9
|
+
slideParams?: SlideParams | undefined;
|
|
8
10
|
};
|
|
9
11
|
events: {
|
|
10
12
|
[evt: string]: CustomEvent<any>;
|
package/package.json
CHANGED
package/ratings/Rating.svelte
CHANGED
|
@@ -17,12 +17,12 @@ let grayStars = total - roundedRating;
|
|
|
17
17
|
<p class="ml-2 text-sm font-bold text-gray-900 dark:text-white">{rating}</p>
|
|
18
18
|
<slot />
|
|
19
19
|
{:else}
|
|
20
|
-
{#each Array(roundedRating) as _
|
|
20
|
+
{#each Array(roundedRating) as _}
|
|
21
21
|
<slot name="ratingUp">
|
|
22
22
|
<Star variation="solid" {size} class="text-yellow-300 dark:text-yellow-200" />
|
|
23
23
|
</slot>
|
|
24
24
|
{/each}
|
|
25
|
-
{#each Array(grayStars) as _
|
|
25
|
+
{#each Array(grayStars) as _}
|
|
26
26
|
<slot name="ratingDown">
|
|
27
27
|
<Star {size} class="text-gray-300 dark:text-gray-500" />
|
|
28
28
|
</slot>
|
|
@@ -10,55 +10,55 @@ let grayStars = comment.total - roundedRating;
|
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<article>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
13
|
+
<div class="flex items-center mb-4 space-x-4">
|
|
14
|
+
<img class="w-10 h-10 rounded-full" src={comment.user.img.src} alt={comment.user.img.alt} />
|
|
15
|
+
<div class="space-y-1 font-medium dark:text-white">
|
|
16
|
+
<p>
|
|
17
|
+
{comment.user.name}
|
|
18
|
+
<time datetime="2014-08-16 19:00" class="block text-sm text-gray-500 dark:text-gray-400"
|
|
19
|
+
>{comment.user.joined}</time>
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="flex items-center mb-1">
|
|
24
|
+
{#each Array(roundedRating) as _}
|
|
25
|
+
<slot name="ratingUp">
|
|
26
|
+
<Star variation="solid" size="24" class="text-yellow-300 dark:text-yellow-200" />
|
|
27
|
+
</slot>
|
|
28
|
+
{/each}
|
|
29
|
+
{#each Array(grayStars) as _}
|
|
30
|
+
<slot name="ratingDown">
|
|
31
|
+
<Star size="24" class="px-0.5 text-gray-300 dark:text-gray-500" />
|
|
32
|
+
</slot>
|
|
33
|
+
{/each}
|
|
34
|
+
{#if comment.heading}
|
|
35
|
+
<h3 class="ml-2 text-sm font-semibold text-gray-900 dark:text-white">
|
|
36
|
+
{comment.heading}
|
|
37
|
+
</h3>
|
|
38
|
+
{/if}
|
|
39
|
+
</div>
|
|
40
|
+
{#if comment.address || comment.datetime}
|
|
41
|
+
<footer class="mb-5 text-sm text-gray-500 dark:text-gray-400">
|
|
42
|
+
<p>Reviewed in {comment.address} on {comment.datetime}</p>
|
|
43
|
+
</footer>
|
|
44
|
+
{/if}
|
|
45
|
+
<slot />
|
|
46
|
+
<aside>
|
|
47
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">
|
|
48
|
+
<slot name="evaluation" />
|
|
49
|
+
</p>
|
|
50
|
+
{#if helpfullink || abuselink}
|
|
51
|
+
<div class="flex items-center mt-3 space-x-3 divide-x divide-gray-200 dark:divide-gray-600">
|
|
52
|
+
{#if helpfullink}
|
|
53
|
+
<Button size="xs" href="/" color="dark">Helpful</Button>
|
|
54
|
+
{/if}
|
|
55
|
+
{#if abuselink}
|
|
56
|
+
<a
|
|
57
|
+
href={abuselink}
|
|
58
|
+
class="pl-4 text-sm font-medium text-blue-600 hover:underline dark:text-blue-500"
|
|
59
|
+
>Report abuse</a>
|
|
60
|
+
{/if}
|
|
61
|
+
</div>
|
|
62
|
+
{/if}
|
|
63
|
+
</aside>
|
|
64
64
|
</article>
|
package/types.d.ts
CHANGED
package/utils/backdrop.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare let open: boolean;
|
|
2
2
|
export declare let placement: string;
|
|
3
|
-
export declare const init: (node:
|
|
4
|
-
update(_open:
|
|
3
|
+
export declare const init: (node: HTMLElement, _open: boolean) => {
|
|
4
|
+
update(_open: boolean): void;
|
|
5
5
|
destroy(): void;
|
|
6
6
|
};
|
package/utils/backdrop.js
CHANGED
|
@@ -15,7 +15,6 @@ export let placement;
|
|
|
15
15
|
export const init = (node, _open) => {
|
|
16
16
|
getPlacementClasses().map((c) => node.classList.add(c));
|
|
17
17
|
_open && createBackdrop(node);
|
|
18
|
-
console.log('init clicked');
|
|
19
18
|
return {
|
|
20
19
|
update(_open) {
|
|
21
20
|
allPlacementClasses.map((c) => node.classList.remove(c));
|
|
@@ -58,7 +57,7 @@ const createBackdrop = (node) => {
|
|
|
58
57
|
if (!backdropEl) {
|
|
59
58
|
backdropEl = document.createElement('div');
|
|
60
59
|
backdropEl.classList.add(...backdropClasses.split(' '));
|
|
61
|
-
const body = document.
|
|
60
|
+
const body = document.body;
|
|
62
61
|
body.append(backdropEl);
|
|
63
62
|
body.style.overflow = 'hidden';
|
|
64
63
|
document.addEventListener('keydown', handleEscape, true);
|
|
@@ -66,7 +65,7 @@ const createBackdrop = (node) => {
|
|
|
66
65
|
dispatch('show', node);
|
|
67
66
|
};
|
|
68
67
|
const destroyBackdrop = (node) => {
|
|
69
|
-
const body = document.
|
|
68
|
+
const body = document.body;
|
|
70
69
|
body.style.overflow = 'auto';
|
|
71
70
|
if (backdropEl)
|
|
72
71
|
backdropEl.remove();
|