flowbite-svelte 0.26.14 → 0.26.17
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 +37 -0
- package/drawer/Drawer.svelte +8 -4
- package/drawer/Drawer.svelte.d.ts +4 -0
- package/dropdowns/DropdownItem.svelte +22 -16
- package/forms/Radio.svelte +2 -3
- package/forms/Select.svelte +4 -4
- package/forms/Select.svelte.d.ts +1 -1
- package/package.json +1 -1
- package/sidebars/SidebarItem.svelte +21 -19
- package/sidebars/SidebarItem.svelte.d.ts +2 -0
- package/utils/Popper.svelte +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
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.26.17](https://github.com/themesberg/flowbite-svelte/compare/v0.26.16...v0.26.17) (2022-09-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add active to SidebarItem component and an example in the page ([af80c2b](https://github.com/themesberg/flowbite-svelte/commit/af80c2b7c1d81e711bba0faca959e6501b31257c))
|
|
11
|
+
* add md files in components folder ([8d7e05a](https://github.com/themesberg/flowbite-svelte/commit/8d7e05a0098437ac7ddd3f9122a2c23f481e54cd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* Drawer placement right ([4fe9283](https://github.com/themesberg/flowbite-svelte/commit/4fe928380f4bb95c59e311e7ccc3a8ae49fda89d))
|
|
17
|
+
* remove Datepicker from index ([f08230c](https://github.com/themesberg/flowbite-svelte/commit/f08230c84d29f172f1a30a6194e2694eb65f3e3e))
|
|
18
|
+
* remove Toc from layout since it needs to be updated ([2ea41a0](https://github.com/themesberg/flowbite-svelte/commit/2ea41a0c82bb8a7f583a001c1c5f598ac5855102))
|
|
19
|
+
|
|
20
|
+
### [0.26.16](https://github.com/themesberg/flowbite-svelte/compare/v0.26.15...v0.26.16) (2022-09-06)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* add offset position props to Drawer and example in the drawer page ([680d358](https://github.com/themesberg/flowbite-svelte/commit/680d358ef3d55df202ae2bcaf5deb9c3e6834c18))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* [#273](https://github.com/themesberg/flowbite-svelte/issues/273) remove number from select value type ([529510b](https://github.com/themesberg/flowbite-svelte/commit/529510bc50e561b544175a350390d7f32291727c))
|
|
31
|
+
* [#274](https://github.com/themesberg/flowbite-svelte/issues/274) change the links to singular for blocks components ([7378935](https://github.com/themesberg/flowbite-svelte/commit/73789353f4d598722db88cecb595303e8d60ac31))
|
|
32
|
+
* index blocks names, e.g. Tooltips to Tooltip ([5f902b2](https://github.com/themesberg/flowbite-svelte/commit/5f902b22043838a3e3413679632c9516ea81b906))
|
|
33
|
+
|
|
34
|
+
### [0.26.15](https://github.com/themesberg/flowbite-svelte/compare/v0.26.14...v0.26.15) (2022-09-06)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* dropdowns events docs ([a6d86b6](https://github.com/themesberg/flowbite-svelte/commit/a6d86b671a5c481288a20c1fe68cfcfe0faea880))
|
|
40
|
+
* dropdowns tweaks ([ad797ca](https://github.com/themesberg/flowbite-svelte/commit/ad797ca4a4a60abd7723b3b1415e70fb6e1328a6))
|
|
41
|
+
|
|
5
42
|
### [0.26.14](https://github.com/themesberg/flowbite-svelte/compare/v0.26.13...v0.26.14) (2022-09-06)
|
|
6
43
|
|
|
7
44
|
|
package/drawer/Drawer.svelte
CHANGED
|
@@ -3,6 +3,10 @@ import { fly, slide, blur, fade } from 'svelte/transition';
|
|
|
3
3
|
import { clickOutside } from '../utils/clickOutside';
|
|
4
4
|
export let hidden = true;
|
|
5
5
|
export let position = 'fixed';
|
|
6
|
+
export let leftOffset = 'inset-y-0 left-0';
|
|
7
|
+
export let rightOffset = 'inset-y-0 right-0';
|
|
8
|
+
export let topOffset = 'inset-x-0 top-0';
|
|
9
|
+
export let bottomOffset = 'inset-x-0 bottom-0';
|
|
6
10
|
export let width = 'w-80';
|
|
7
11
|
export let backdrop = true;
|
|
8
12
|
export let bgColor = 'bg-gray-900';
|
|
@@ -25,10 +29,10 @@ function multiple(node, params) {
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
const placements = {
|
|
28
|
-
left:
|
|
29
|
-
right:
|
|
30
|
-
top:
|
|
31
|
-
bottom:
|
|
32
|
+
left: leftOffset,
|
|
33
|
+
right: rightOffset,
|
|
34
|
+
top: topOffset,
|
|
35
|
+
bottom: bottomOffset
|
|
32
36
|
};
|
|
33
37
|
const handleDrawer = () => {
|
|
34
38
|
hidden = !hidden;
|
|
@@ -8,20 +8,26 @@ const colors = {
|
|
|
8
8
|
};
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
{#if href}
|
|
12
|
+
<li>
|
|
13
|
+
<svelte:element
|
|
14
|
+
this={href ? 'a' : 'div'}
|
|
15
|
+
{href}
|
|
16
|
+
{...$$restProps}
|
|
17
|
+
class={classNames(liClass, colors[color] ?? colors.default, $$props.class)}
|
|
18
|
+
on:click
|
|
19
|
+
on:change
|
|
20
|
+
on:keydown
|
|
21
|
+
on:keyup
|
|
22
|
+
on:focus
|
|
23
|
+
on:blur
|
|
24
|
+
on:mouseenter
|
|
25
|
+
on:mouseleave>
|
|
26
|
+
<slot />
|
|
27
|
+
</svelte:element>
|
|
28
|
+
</li>
|
|
29
|
+
{:else}
|
|
30
|
+
<li class={classNames(liClass, colors[color] ?? colors.default, $$props.class)}>
|
|
25
31
|
<slot />
|
|
26
|
-
</
|
|
27
|
-
|
|
32
|
+
</li>
|
|
33
|
+
{/if}
|
package/forms/Radio.svelte
CHANGED
|
@@ -37,7 +37,7 @@ export let value = '';
|
|
|
37
37
|
let background = getContext('background');
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
|
-
<Label class={labelClass(inline, $$props.class)} show={
|
|
40
|
+
<Label class={labelClass(inline, $$props.class)} show={$$slots.default}>
|
|
41
41
|
<input
|
|
42
42
|
type="radio"
|
|
43
43
|
bind:group
|
|
@@ -54,6 +54,5 @@ let background = getContext('background');
|
|
|
54
54
|
on:paste
|
|
55
55
|
{value}
|
|
56
56
|
{...$$restProps}
|
|
57
|
-
class={inputClass(custom, color, false, background, $$slots.default || $$props.class)}
|
|
58
|
-
/><slot />
|
|
57
|
+
class={inputClass(custom, color, false, background, $$slots.default || $$props.class)} /><slot />
|
|
59
58
|
</Label>
|
package/forms/Select.svelte
CHANGED
|
@@ -17,9 +17,9 @@ $: selectClass = classNames(common, underline ? underlineClass : defaultClass, s
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<select {...$$restProps} bind:value class={selectClass} on:change on:input>
|
|
20
|
-
|
|
20
|
+
<option disabled selected value="">{placeholder}</option>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
{#each items as { value, name }}
|
|
23
|
+
<option {value}>{name}</option>
|
|
24
|
+
{/each}
|
|
25
25
|
</select>
|
package/forms/Select.svelte.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -3,26 +3,28 @@ export let aClass = 'flex items-center p-2 text-base font-normal text-gray-900 r
|
|
|
3
3
|
export let href = '';
|
|
4
4
|
export let label = '';
|
|
5
5
|
export let spanClass = 'ml-3';
|
|
6
|
+
export let activeClass = 'flex items-center p-2 text-base font-normal text-gray-900 bg-gray-200 dark:bg-gray-700 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700';
|
|
7
|
+
export let active = false;
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
10
|
<li>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
<a
|
|
12
|
+
{...$$restProps}
|
|
13
|
+
{href}
|
|
14
|
+
on:blur
|
|
15
|
+
on:click
|
|
16
|
+
on:focus
|
|
17
|
+
on:keydown
|
|
18
|
+
on:keypress
|
|
19
|
+
on:keyup
|
|
20
|
+
on:mouseenter
|
|
21
|
+
on:mouseleave
|
|
22
|
+
on:mouseover
|
|
23
|
+
class={classNames(active ? activeClass : aClass, $$props.class)}>
|
|
24
|
+
<slot name="icon" />
|
|
25
|
+
<span class={spanClass}>{label}</span>
|
|
26
|
+
{#if $$slots.subtext}
|
|
27
|
+
<slot name="subtext" />
|
|
28
|
+
{/if}
|
|
29
|
+
</a>
|
|
28
30
|
</li>
|
package/utils/Popper.svelte
CHANGED
|
@@ -61,11 +61,13 @@ function init(node, _triggerEl) {
|
|
|
61
61
|
name: 'offset',
|
|
62
62
|
options: {
|
|
63
63
|
offset: ({ placement, reference, popper }) => {
|
|
64
|
+
// for full screen mega menu
|
|
64
65
|
return [yOnly ? popper.width / 2 - reference.width / 2 - reference.x : 0, offset];
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
|
-
{ name: 'eventListeners', enabled: open }
|
|
69
|
+
{ name: 'eventListeners', enabled: open },
|
|
70
|
+
{ name: 'flip', enabled: false }
|
|
69
71
|
]
|
|
70
72
|
});
|
|
71
73
|
return {
|
|
@@ -127,8 +129,7 @@ onMount(() => {
|
|
|
127
129
|
on:mouseenter={showHandler}
|
|
128
130
|
on:mouseleave={activeContent && !clickable ? hideHandler : undefined}
|
|
129
131
|
{...$$restProps}
|
|
130
|
-
class={classNames('z-10', $$props.class)}
|
|
131
|
-
style="position: absolute;">
|
|
132
|
+
class={classNames('z-10', $$props.class)}>
|
|
132
133
|
<slot />
|
|
133
134
|
{#if arrow}<div data-popper-arrow />{/if}
|
|
134
135
|
</Frame>
|