flowbite-svelte 0.10.11 → 0.12.0
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 +12 -0
- package/alerts/Alert.svelte +24 -1
- package/alerts/Alert.svelte.d.ts +3 -0
- package/avatar/Avatar.svelte +40 -0
- package/avatar/Avatar.svelte.d.ts +19 -0
- package/badges/BadgeIcon.svelte +1 -1
- package/buttons/GradientOutlineButton.svelte +1 -1
- package/index.d.ts +16 -0
- package/index.js +30 -2
- package/modals/SignInModal.svelte +2 -1
- package/modals/SignInModal.svelte.d.ts +1 -0
- package/package.json +18 -1
- package/paginations/Next.svelte +28 -0
- package/paginations/Next.svelte.d.ts +19 -0
- package/paginations/Pagination.svelte +67 -0
- package/paginations/Pagination.svelte.d.ts +27 -0
- package/paginations/Previous.svelte +28 -0
- package/paginations/Previous.svelte.d.ts +19 -0
- package/paginations/TableData.svelte +28 -0
- package/paginations/TableData.svelte.d.ts +25 -0
- package/sidebars/Sidebar.svelte +101 -0
- package/sidebars/Sidebar.svelte.d.ts +19 -0
- package/tabs/InteractiveTabs.svelte +7 -3
- package/timelines/Activity.svelte +6 -0
- package/timelines/Activity.svelte.d.ts +18 -0
- package/timelines/ActivityItem.svelte +29 -0
- package/timelines/ActivityItem.svelte.d.ts +17 -0
- package/timelines/Group.svelte +11 -0
- package/timelines/Group.svelte.d.ts +20 -0
- package/timelines/GroupItem.svelte +49 -0
- package/timelines/GroupItem.svelte.d.ts +17 -0
- package/timelines/Timeline.svelte +6 -0
- package/timelines/Timeline.svelte.d.ts +18 -0
- package/timelines/TimelineHorizontal.svelte +6 -0
- package/timelines/TimelineHorizontal.svelte.d.ts +18 -0
- package/timelines/TimelineItem.svelte +37 -0
- package/timelines/TimelineItem.svelte.d.ts +17 -0
- package/timelines/TimelineItemHorizontal.svelte +38 -0
- package/timelines/TimelineItemHorizontal.svelte.d.ts +17 -0
- package/timelines/TimelineItemVertical.svelte +54 -0
- package/timelines/TimelineItemVertical.svelte.d.ts +17 -0
- package/toasts/Toast.svelte +83 -0
- package/toasts/Toast.svelte.d.ts +25 -0
- package/types.d.ts +65 -1
- package/types.js +0 -7
package/README.md
CHANGED
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
[Accordions](https://flowbite-svelte.vercel.app/accordions)
|
|
12
12
|
|
|
13
|
+
## Avatar components
|
|
14
|
+
|
|
15
|
+
[Avatar](https://flowbite-svelte.vercel.app/avatar)
|
|
16
|
+
|
|
13
17
|
## Alert components
|
|
14
18
|
|
|
15
19
|
[Alerts](https://flowbite-svelte.vercel.app/alerts)
|
|
@@ -62,6 +66,10 @@
|
|
|
62
66
|
|
|
63
67
|
[Navbars](https://flowbite-svelte.vercel.app/navbar)
|
|
64
68
|
|
|
69
|
+
## Sidebar components
|
|
70
|
+
|
|
71
|
+
[Sidebar](https://flowbite-svelte.vercel.app/sidebars)
|
|
72
|
+
|
|
65
73
|
## Spinner components
|
|
66
74
|
|
|
67
75
|
[Spinners](https://flowbite-svelte.vercel.app/spinners)
|
|
@@ -70,6 +78,10 @@
|
|
|
70
78
|
|
|
71
79
|
[Tabs](https://flowbite-svelte.vercel.app/tabs)
|
|
72
80
|
|
|
81
|
+
## Toast components
|
|
82
|
+
|
|
83
|
+
[Toast](https://flowbite-svelte.vercel.app/toasts)
|
|
84
|
+
|
|
73
85
|
## Tooltip components
|
|
74
86
|
|
|
75
87
|
[Tooltips](https://flowbite-svelte.vercel.app/tooltips)
|
package/alerts/Alert.svelte
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
<script >
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
export let color = 'blue';
|
|
2
4
|
export let alertId = 'alert-1';
|
|
3
5
|
export let closeBtn = false;
|
|
6
|
+
export let btn1 = false;
|
|
4
7
|
let hidden = false;
|
|
8
|
+
const handlebtn1 = () => {
|
|
9
|
+
dispatch('handlebtn1');
|
|
10
|
+
};
|
|
5
11
|
const handleHide = () => {
|
|
6
12
|
hidden = !hidden;
|
|
7
13
|
};
|
|
@@ -72,6 +78,7 @@ else {
|
|
|
72
78
|
buttonClass =
|
|
73
79
|
'ml-auto -mx-1.5 -my-1.5 bg-gray-100 text-gray-500 rounded-lg focus:ring-2 focus:ring-gray-400 p-1.5 hover:bg-gray-200 inline-flex h-8 w-8 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300';
|
|
74
80
|
}
|
|
81
|
+
let button1Class = 'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
75
82
|
</script>
|
|
76
83
|
|
|
77
84
|
<div id={alertId} class:hidden class={divClass} role="alert">
|
|
@@ -101,4 +108,20 @@ else {
|
|
|
101
108
|
>
|
|
102
109
|
</button>
|
|
103
110
|
{/if}
|
|
111
|
+
{#if btn1}
|
|
112
|
+
<button on:click={handlebtn1} type="button" class={buttonClass} aria-label="Close">
|
|
113
|
+
<span class="sr-only">Close</span>
|
|
114
|
+
<svg
|
|
115
|
+
class="w-5 h-5"
|
|
116
|
+
fill="currentColor"
|
|
117
|
+
viewBox="0 0 20 20"
|
|
118
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
119
|
+
><path
|
|
120
|
+
fill-rule="evenodd"
|
|
121
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
122
|
+
clip-rule="evenodd"
|
|
123
|
+
/></svg
|
|
124
|
+
>
|
|
125
|
+
</button>
|
|
126
|
+
{/if}
|
|
104
127
|
</div>
|
package/alerts/Alert.svelte.d.ts
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script >export let avatar = {
|
|
2
|
+
src: '/',
|
|
3
|
+
alt: '',
|
|
4
|
+
size: 8,
|
|
5
|
+
border: false,
|
|
6
|
+
round: false,
|
|
7
|
+
header: '',
|
|
8
|
+
text: ''
|
|
9
|
+
};
|
|
10
|
+
let isCircle = avatar.round ? 'rounded-full' : 'rounded';
|
|
11
|
+
let isBorder = avatar.border ? 'p-1 ring-2 ring-gray-300 dark:ring-gray-500' : '';
|
|
12
|
+
export let avatarClass = `w-${avatar.size} h-${avatar.size} ${isCircle} ${isBorder}`;
|
|
13
|
+
export let placehoder = false;
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
{#if placehoder}
|
|
17
|
+
<div class="relative w-10 h-10 overflow-hidden bg-gray-100 rounded-full dark:bg-gray-600">
|
|
18
|
+
<svg
|
|
19
|
+
class="absolute w-12 h-12 text-gray-400 -left-1"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
viewBox="0 0 20 20"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
><path
|
|
24
|
+
fill-rule="evenodd"
|
|
25
|
+
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
26
|
+
clip-rule="evenodd"
|
|
27
|
+
/></svg
|
|
28
|
+
>
|
|
29
|
+
</div>
|
|
30
|
+
{:else if avatar.header && avatar.text}
|
|
31
|
+
<div class="flex items-center space-x-4">
|
|
32
|
+
<img class="class={avatarClass}" alt={avatar.alt} src={avatar.src} />
|
|
33
|
+
<div class="space-y-1 font-medium dark:text-white">
|
|
34
|
+
<div>{avatar.header}</div>
|
|
35
|
+
<div class="text-sm text-gray-500 dark:text-gray-400">{avatar.text}</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
{:else}
|
|
39
|
+
<img class={avatarClass} alt={avatar.alt} src={avatar.src} />
|
|
40
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AvatarType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
avatar?: AvatarType;
|
|
6
|
+
avatarClass?: string;
|
|
7
|
+
placehoder?: boolean;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type AvatarProps = typeof __propDef.props;
|
|
15
|
+
export declare type AvatarEvents = typeof __propDef.events;
|
|
16
|
+
export declare type AvatarSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Avatar extends SvelteComponentTyped<AvatarProps, AvatarEvents, AvatarSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
package/badges/BadgeIcon.svelte
CHANGED
|
@@ -10,7 +10,7 @@ if (color === 'purple2blue') {
|
|
|
10
10
|
'relative px-5 py-2.5 transition-all ease-in duration-75 bg-white dark:bg-gray-900 rounded-md group-hover:bg-opacity-0';
|
|
11
11
|
}
|
|
12
12
|
else if (color === 'cyan2blue') {
|
|
13
|
-
btnClass = `relative inline-flex items-center justify-center p-0.5 mb-2 mr-2 overflow-hidden ${textSize} font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-cyan-500 to-blue-500 group-hover:from-cyan-500 group-hover:to-blue-500 hover:text-white dark:text-white focus:ring-4 focus:ring-cyan-200 dark:focus:ring-cyan-800`;
|
|
13
|
+
btnClass = `relative inline-flex items-center justify-center p-0.5 mb-2 mr-2 overflow-hidden ${textSize} font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-cyan-500 to-blue-500 group-hover:from-cyan-500 group-hover:to-blue-500 hover:text-white dark:text-white focus:ring-4 focus:outline-none focus:ring-cyan-200 dark:focus:ring-cyan-800`;
|
|
14
14
|
spanClass =
|
|
15
15
|
'relative px-5 py-2.5 transition-all ease-in duration-75 bg-white dark:bg-gray-900 rounded-md group-hover:bg-opacity-0';
|
|
16
16
|
}
|
package/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { default as ForgotPassword } from "./auth/ForgotPassword.svelte";
|
|
|
8
8
|
export { default as Login } from "./auth/Login.svelte";
|
|
9
9
|
export { default as Register } from "./auth/Register.svelte";
|
|
10
10
|
export { default as Reset } from "./auth/Reset.svelte";
|
|
11
|
+
export { default as Avatar } from "./avatar/Avatar.svelte";
|
|
11
12
|
export { default as Badge } from "./badges/Badge.svelte";
|
|
12
13
|
export { default as BadgeIcon } from "./badges/BadgeIcon.svelte";
|
|
13
14
|
export { default as BadgeLink } from "./badges/BadgeLink.svelte";
|
|
@@ -51,10 +52,25 @@ export { default as SignInModal } from "./modals/SignInModal.svelte";
|
|
|
51
52
|
export { default as SmallModal } from "./modals/SmallModal.svelte";
|
|
52
53
|
export { default as Navbar } from "./navbar/Navbar.svelte";
|
|
53
54
|
export { default as DropdownNavbar } from "./navbar/DropdownNavbar.svelte";
|
|
55
|
+
export { default as Pagination } from "./paginations/Pagination.svelte";
|
|
56
|
+
export { default as Previous } from "./paginations/Previous.svelte";
|
|
57
|
+
export { default as Next } from "./paginations/Next.svelte";
|
|
58
|
+
export { default as TableData } from "./paginations/TableData.svelte";
|
|
59
|
+
export { default as Sidebar } from "./sidebars/Sidebar.svelte";
|
|
54
60
|
export { default as Spinner } from "./spinners/Spinner.svelte";
|
|
55
61
|
export { default as SpinnerButton } from "./spinners/SpinnerButton.svelte";
|
|
56
62
|
export { default as InteractiveTabs } from "./tabs/InteractiveTabs.svelte";
|
|
57
63
|
export { default as DefaultTabs } from "./tabs/DefaultTabs.svelte";
|
|
58
64
|
export { default as PillTabs } from "./tabs/PillTabs.svelte";
|
|
65
|
+
export { default as Group } from "./timelines/Group.svelte";
|
|
66
|
+
export { default as GroupItem } from "./timelines/GroupItem.svelte";
|
|
67
|
+
export { default as Activity } from "./timelines/Activity.svelte";
|
|
68
|
+
export { default as ActivityItem } from "./timelines/ActivityItem.svelte";
|
|
69
|
+
export { default as Timeline } from "./timelines/Timeline.svelte";
|
|
70
|
+
export { default as TimelineItem } from "./timelines/TimelineItem.svelte";
|
|
71
|
+
export { default as TimelineHorizontal } from "./timelines/TimelineHorizontal.svelte";
|
|
72
|
+
export { default as TimelineItemHorizontal } from "./timelines/TimelineItemHorizontal.svelte";
|
|
73
|
+
export { default as TimelineItemVertical } from "./timelines/TimelineItemVertical.svelte";
|
|
74
|
+
export { default as Toast } from "./toasts/Toast.svelte";
|
|
59
75
|
export { default as Tooltip } from "./tooltips/Tooltip.svelte";
|
|
60
76
|
export { default as LightTooltip } from "./tooltips/LightTooltip.svelte";
|
package/index.js
CHANGED
|
@@ -12,7 +12,10 @@ export { default as Confirm } from'./auth/Confirm.svelte'
|
|
|
12
12
|
export { default as ForgotPassword } from'./auth/ForgotPassword.svelte'
|
|
13
13
|
export { default as Login } from'./auth/Login.svelte'
|
|
14
14
|
export { default as Register } from'./auth/Register.svelte'
|
|
15
|
-
export { default as Reset } from'./auth/Reset.svelte'
|
|
15
|
+
export { default as Reset } from './auth/Reset.svelte'
|
|
16
|
+
|
|
17
|
+
// Avatar
|
|
18
|
+
export { default as Avatar } from './avatar/Avatar.svelte'
|
|
16
19
|
|
|
17
20
|
// Badges
|
|
18
21
|
export { default as Badge } from'./badges/Badge.svelte'
|
|
@@ -79,6 +82,15 @@ export { default as SmallModal } from'./modals/SmallModal.svelte'
|
|
|
79
82
|
export { default as Navbar } from'./navbar/Navbar.svelte'
|
|
80
83
|
export { default as DropdownNavbar } from'./navbar/DropdownNavbar.svelte'
|
|
81
84
|
|
|
85
|
+
// Pagination
|
|
86
|
+
export { default as Pagination } from './paginations/Pagination.svelte'
|
|
87
|
+
export { default as Previous } from './paginations/Previous.svelte'
|
|
88
|
+
export { default as Next } from './paginations/Next.svelte'
|
|
89
|
+
export { default as TableData } from './paginations/TableData.svelte'
|
|
90
|
+
|
|
91
|
+
// Sidebar
|
|
92
|
+
export { default as Sidebar } from './sidebars/Sidebar.svelte'
|
|
93
|
+
|
|
82
94
|
// Spin
|
|
83
95
|
export { default as Spinner } from'./spinners/Spinner.svelte'
|
|
84
96
|
export { default as SpinnerButton } from'./spinners/SpinnerButton.svelte'
|
|
@@ -86,7 +98,23 @@ export { default as SpinnerButton } from'./spinners/SpinnerButton.svelte'
|
|
|
86
98
|
// Tabs
|
|
87
99
|
export { default as InteractiveTabs } from'./tabs/InteractiveTabs.svelte'
|
|
88
100
|
export { default as DefaultTabs } from'./tabs/DefaultTabs.svelte'
|
|
89
|
-
export { default as PillTabs } from'./tabs/PillTabs.svelte'
|
|
101
|
+
export { default as PillTabs } from './tabs/PillTabs.svelte'
|
|
102
|
+
|
|
103
|
+
// Timeline
|
|
104
|
+
export { default as Group } from './timelines/Group.svelte'
|
|
105
|
+
export { default as GroupItem } from './timelines/GroupItem.svelte'
|
|
106
|
+
export { default as Activity } from './timelines/Activity.svelte'
|
|
107
|
+
export { default as ActivityItem } from './timelines/ActivityItem.svelte'
|
|
108
|
+
export { default as Timeline } from './timelines/Timeline.svelte'
|
|
109
|
+
export { default as TimelineItem } from './timelines/TimelineItem.svelte'
|
|
110
|
+
export { default as TimelineHorizontal } from './timelines/TimelineHorizontal.svelte'
|
|
111
|
+
export { default as TimelineItemHorizontal } from './timelines/TimelineItemHorizontal.svelte'
|
|
112
|
+
export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte'
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
// Toast
|
|
117
|
+
export { default as Toast } from './toasts/Toast.svelte'
|
|
90
118
|
|
|
91
119
|
// Tooltips
|
|
92
120
|
export { default as Tooltip } from'./tooltips/Tooltip.svelte'
|
|
@@ -6,6 +6,7 @@ export let lostPasswordLink;
|
|
|
6
6
|
export let rememberMe = false;
|
|
7
7
|
export let signUp;
|
|
8
8
|
export let action;
|
|
9
|
+
export let emailPlaceholder = 'name@company.com';
|
|
9
10
|
const closeModal = () => {
|
|
10
11
|
modalIdStore.update((value) => (value = null));
|
|
11
12
|
};
|
|
@@ -95,7 +96,7 @@ else {
|
|
|
95
96
|
name="email"
|
|
96
97
|
id="email-{id}"
|
|
97
98
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
98
|
-
placeholder=
|
|
99
|
+
placeholder={emailPlaceholder}
|
|
99
100
|
required
|
|
100
101
|
/>
|
|
101
102
|
</div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
|
+
"main": "./package/index.js",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "Shinichi Okada",
|
|
7
8
|
"email": "connect@codewithshin.com",
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
"./auth/Login.svelte": "./auth/Login.svelte",
|
|
81
82
|
"./auth/Register.svelte": "./auth/Register.svelte",
|
|
82
83
|
"./auth/Reset.svelte": "./auth/Reset.svelte",
|
|
84
|
+
"./avatar/Avatar.svelte": "./avatar/Avatar.svelte",
|
|
83
85
|
"./badges/Badge.svelte": "./badges/Badge.svelte",
|
|
84
86
|
"./badges/BadgeIcon.svelte": "./badges/BadgeIcon.svelte",
|
|
85
87
|
"./badges/BadgeLink.svelte": "./badges/BadgeLink.svelte",
|
|
@@ -124,12 +126,27 @@
|
|
|
124
126
|
"./modals/modalStores": "./modals/modalStores.js",
|
|
125
127
|
"./navbar/DropdownNavbar.svelte": "./navbar/DropdownNavbar.svelte",
|
|
126
128
|
"./navbar/Navbar.svelte": "./navbar/Navbar.svelte",
|
|
129
|
+
"./paginations/Next.svelte": "./paginations/Next.svelte",
|
|
130
|
+
"./paginations/Pagination.svelte": "./paginations/Pagination.svelte",
|
|
131
|
+
"./paginations/Previous.svelte": "./paginations/Previous.svelte",
|
|
132
|
+
"./paginations/TableData.svelte": "./paginations/TableData.svelte",
|
|
133
|
+
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
127
134
|
"./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
|
|
128
135
|
"./spinners/SpinnerButton.svelte": "./spinners/SpinnerButton.svelte",
|
|
129
136
|
"./tables/Table.svelte": "./tables/Table.svelte",
|
|
130
137
|
"./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
|
|
131
138
|
"./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
|
|
132
139
|
"./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
|
|
140
|
+
"./timelines/Activity.svelte": "./timelines/Activity.svelte",
|
|
141
|
+
"./timelines/ActivityItem.svelte": "./timelines/ActivityItem.svelte",
|
|
142
|
+
"./timelines/Group.svelte": "./timelines/Group.svelte",
|
|
143
|
+
"./timelines/GroupItem.svelte": "./timelines/GroupItem.svelte",
|
|
144
|
+
"./timelines/Timeline.svelte": "./timelines/Timeline.svelte",
|
|
145
|
+
"./timelines/TimelineHorizontal.svelte": "./timelines/TimelineHorizontal.svelte",
|
|
146
|
+
"./timelines/TimelineItem.svelte": "./timelines/TimelineItem.svelte",
|
|
147
|
+
"./timelines/TimelineItemHorizontal.svelte": "./timelines/TimelineItemHorizontal.svelte",
|
|
148
|
+
"./timelines/TimelineItemVertical.svelte": "./timelines/TimelineItemVertical.svelte",
|
|
149
|
+
"./toasts/Toast.svelte": "./toasts/Toast.svelte",
|
|
133
150
|
"./tooltips/LightTooltip.svelte": "./tooltips/LightTooltip.svelte",
|
|
134
151
|
"./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte",
|
|
135
152
|
"./types": "./types.js"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let icon = false;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
const next = () => {
|
|
5
|
+
dispatch('next');
|
|
6
|
+
};
|
|
7
|
+
export let nextClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
8
|
+
if (!icon) {
|
|
9
|
+
nextClass += ' ml-3';
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<a href="/" on:click|preventDefault={next} class={nextClass}>
|
|
14
|
+
Next
|
|
15
|
+
{#if icon}
|
|
16
|
+
<svg
|
|
17
|
+
class="ml-2 w-5 h-5"
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
viewBox="0 0 20 20"
|
|
20
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
21
|
+
><path
|
|
22
|
+
fill-rule="evenodd"
|
|
23
|
+
d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
|
|
24
|
+
clip-rule="evenodd"
|
|
25
|
+
/></svg
|
|
26
|
+
>
|
|
27
|
+
{/if}
|
|
28
|
+
</a>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
icon?: boolean;
|
|
5
|
+
nextClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
next: CustomEvent<any>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type NextProps = typeof __propDef.props;
|
|
15
|
+
export declare type NextEvents = typeof __propDef.events;
|
|
16
|
+
export declare type NextSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Next extends SvelteComponentTyped<NextProps, NextEvents, NextSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let icon = false;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
const previous = () => {
|
|
5
|
+
dispatch('previous');
|
|
6
|
+
};
|
|
7
|
+
const next = () => {
|
|
8
|
+
dispatch('next');
|
|
9
|
+
};
|
|
10
|
+
export let pages;
|
|
11
|
+
export let ulClass = 'inline-flex -space-x-px items-center';
|
|
12
|
+
export let pageClass = 'py-2 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
13
|
+
export let previousClass = 'py-2 px-3 ml-0 leading-tight text-gray-500 bg-white rounded-l-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
14
|
+
export let nextClass = 'py-2 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
15
|
+
export let iconPreviousClass = 'block py-2 px-3 ml-0 leading-tight text-gray-500 bg-white rounded-l-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
16
|
+
export let iconNextClass = 'block py-2 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<nav aria-label="Page navigation">
|
|
20
|
+
<ul class={ulClass}>
|
|
21
|
+
<li>
|
|
22
|
+
{#if icon}
|
|
23
|
+
<a href="/" on:click|preventDefault={previous} class={iconPreviousClass}>
|
|
24
|
+
<span class="sr-only">Previous</span>
|
|
25
|
+
<svg
|
|
26
|
+
class="w-5 h-5"
|
|
27
|
+
fill="currentColor"
|
|
28
|
+
viewBox="0 0 20 20"
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
><path
|
|
31
|
+
fill-rule="evenodd"
|
|
32
|
+
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
|
|
33
|
+
clip-rule="evenodd"
|
|
34
|
+
/></svg
|
|
35
|
+
>
|
|
36
|
+
</a>
|
|
37
|
+
{:else}
|
|
38
|
+
<a href="/" on:click|preventDefault={previous} class={previousClass}>Previous</a>
|
|
39
|
+
{/if}
|
|
40
|
+
</li>
|
|
41
|
+
{#each pages as { pageNum, href }}
|
|
42
|
+
<li>
|
|
43
|
+
<a {href} class={pageClass}>{pageNum}</a>
|
|
44
|
+
</li>
|
|
45
|
+
{/each}
|
|
46
|
+
<li>
|
|
47
|
+
{#if icon}
|
|
48
|
+
<a href="/" on:click|preventDefault={next} class={iconNextClass}>
|
|
49
|
+
<span class="sr-only">Next</span>
|
|
50
|
+
<svg
|
|
51
|
+
class="w-5 h-5"
|
|
52
|
+
fill="currentColor"
|
|
53
|
+
viewBox="0 0 20 20"
|
|
54
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
55
|
+
><path
|
|
56
|
+
fill-rule="evenodd"
|
|
57
|
+
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
|
58
|
+
clip-rule="evenodd"
|
|
59
|
+
/></svg
|
|
60
|
+
>
|
|
61
|
+
</a>
|
|
62
|
+
{:else}
|
|
63
|
+
<a href="/" on:click|preventDefault={next} class={nextClass}>Next</a>
|
|
64
|
+
{/if}
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
</nav>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { PageType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
icon?: boolean;
|
|
6
|
+
pages: PageType[];
|
|
7
|
+
ulClass?: string;
|
|
8
|
+
pageClass?: string;
|
|
9
|
+
previousClass?: string;
|
|
10
|
+
nextClass?: string;
|
|
11
|
+
iconPreviousClass?: string;
|
|
12
|
+
iconNextClass?: string;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
previous: CustomEvent<any>;
|
|
16
|
+
next: CustomEvent<any>;
|
|
17
|
+
} & {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {};
|
|
21
|
+
};
|
|
22
|
+
export declare type PaginationProps = typeof __propDef.props;
|
|
23
|
+
export declare type PaginationEvents = typeof __propDef.events;
|
|
24
|
+
export declare type PaginationSlots = typeof __propDef.slots;
|
|
25
|
+
export default class Pagination extends SvelteComponentTyped<PaginationProps, PaginationEvents, PaginationSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let icon = false;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
const previous = () => {
|
|
5
|
+
dispatch('previous');
|
|
6
|
+
};
|
|
7
|
+
export let previousClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
8
|
+
if (icon) {
|
|
9
|
+
previousClass += ' mr-3';
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<a href="/" on:click|preventDefault={previous} class={previousClass}>
|
|
14
|
+
{#if icon}
|
|
15
|
+
<svg
|
|
16
|
+
class="mr-2 w-5 h-5"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
viewBox="0 0 20 20"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
><path
|
|
21
|
+
fill-rule="evenodd"
|
|
22
|
+
d="M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z"
|
|
23
|
+
clip-rule="evenodd"
|
|
24
|
+
/></svg
|
|
25
|
+
>
|
|
26
|
+
{/if}
|
|
27
|
+
Previous
|
|
28
|
+
</a>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
icon?: boolean;
|
|
5
|
+
previousClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
previous: CustomEvent<any>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type PreviousProps = typeof __propDef.props;
|
|
15
|
+
export declare type PreviousEvents = typeof __propDef.events;
|
|
16
|
+
export declare type PreviousSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Previous extends SvelteComponentTyped<PreviousProps, PreviousEvents, PreviousSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
const previous = () => {
|
|
4
|
+
dispatch('previous');
|
|
5
|
+
};
|
|
6
|
+
const next = () => {
|
|
7
|
+
dispatch('next');
|
|
8
|
+
};
|
|
9
|
+
export let helper;
|
|
10
|
+
export let btnPreClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-l hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
11
|
+
export let btnNextClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-r border-0 border-l border-gray-700 hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div class="flex flex-col items-center">
|
|
15
|
+
{#if helper}
|
|
16
|
+
<!-- Help text -->
|
|
17
|
+
<span class="text-sm text-gray-700 dark:text-gray-400">
|
|
18
|
+
Showing <span class="font-semibold text-gray-900 dark:text-white">{helper.start}</span> to
|
|
19
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.end}</span>
|
|
20
|
+
of <span class="font-semibold text-gray-900 dark:text-white">{helper.total}</span> Entries
|
|
21
|
+
</span>
|
|
22
|
+
{/if}
|
|
23
|
+
<!-- Buttons -->
|
|
24
|
+
<div class="inline-flex mt-2 xs:mt-0">
|
|
25
|
+
<button on:click={previous} class={btnPreClass}> Prev </button>
|
|
26
|
+
<button on:click={next} class={btnNextClass}> Next </button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
helper: {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
total: number;
|
|
8
|
+
};
|
|
9
|
+
btnPreClass?: string;
|
|
10
|
+
btnNextClass?: string;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
previous: CustomEvent<any>;
|
|
14
|
+
next: CustomEvent<any>;
|
|
15
|
+
} & {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export declare type TableDataProps = typeof __propDef.props;
|
|
21
|
+
export declare type TableDataEvents = typeof __propDef.events;
|
|
22
|
+
export declare type TableDataSlots = typeof __propDef.slots;
|
|
23
|
+
export default class TableData extends SvelteComponentTyped<TableDataProps, TableDataEvents, TableDataSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|