flowbite-svelte 0.17.4 → 0.18.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/CHANGELOG.md CHANGED
@@ -2,8 +2,39 @@
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.18.0](https://github.com/themesberg/flowbite-svelte/compare/v0.17.6...v0.18.0) (2022-06-17)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * new Table components
11
+
12
+ ### Features
13
+
14
+ * add simeple search component ([945c27b](https://github.com/themesberg/flowbite-svelte/commit/945c27b5299ae52f9c160cbda74a0b0540d98be8))
15
+ * new Table components ([b2d4c8c](https://github.com/themesberg/flowbite-svelte/commit/b2d4c8cca892da8e18fd0e2f688ccc9280bc8df8))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add SimpleSearch to index.ts ([64a8f49](https://github.com/themesberg/flowbite-svelte/commit/64a8f496a22948874dac2695e96ba397e53026b5))
21
+ * update Tabel component, add TableHead, TableBody, TableHeadCell, TabelRow ([09b7ad9](https://github.com/themesberg/flowbite-svelte/commit/09b7ad971a2d5ba01eca463e251f2c078a86b708))
22
+ * wrong label class name ([39735b3](https://github.com/themesberg/flowbite-svelte/commit/39735b3a85285bd69d064aef22145d60d278da46))
23
+
24
+ ### [0.17.6](https://github.com/themesberg/flowbite-svelte/compare/v0.17.5...v0.17.6) (2022-06-17)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * removed $app/env browser from Tooltip component ([604a1e0](https://github.com/themesberg/flowbite-svelte/commit/604a1e075c6333c5532e04916a20500a31fb4716))
30
+
31
+ ### [0.17.5](https://github.com/themesberg/flowbite-svelte/compare/v0.17.4...v0.17.5) (2022-06-16)
32
+
5
33
  ### [0.17.4](https://github.com/themesberg/flowbite-svelte/compare/v0.17.3...v0.17.4) (2022-06-14)
6
34
 
35
+ ### Breaking Change
36
+
37
+ * Tooltip component has different structures.
7
38
 
8
39
  ### Bug Fixes
9
40
 
@@ -0,0 +1,43 @@
1
+ <script>export let id = '';
2
+ export let labelClass = 'sr-only';
3
+ export let iconClass = 'w-5 h-5 text-gray-500 dark:text-gray-400';
4
+ export let iconDivClass = 'flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none';
5
+ 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-full pl-10 p-2.5 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';
6
+ export let btnClass = 'p-2.5 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
7
+ export let placeholder = 'Search';
8
+ </script>
9
+
10
+ <form class="flex items-center" on:submit>
11
+ <label for={id} class={labelClass}>Search</label>
12
+ <div class="relative w-full">
13
+ <div class={iconDivClass}>
14
+ <svg
15
+ class={iconClass}
16
+ fill="currentColor"
17
+ viewBox="0 0 20 20"
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ ><path
20
+ fill-rule="evenodd"
21
+ 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"
22
+ clip-rule="evenodd"
23
+ /></svg
24
+ >
25
+ </div>
26
+ <input type="text" {id} class={inputClass} {placeholder} {...$$restProps} />
27
+ </div>
28
+ <button type="submit" class={btnClass}
29
+ ><svg
30
+ class="w-5 h-5"
31
+ fill="none"
32
+ stroke="currentColor"
33
+ viewBox="0 0 24 24"
34
+ xmlns="http://www.w3.org/2000/svg"
35
+ ><path
36
+ stroke-linecap="round"
37
+ stroke-linejoin="round"
38
+ stroke-width="2"
39
+ d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
40
+ /></svg
41
+ ></button
42
+ >
43
+ </form>
@@ -0,0 +1,25 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ id?: string;
6
+ labelClass?: string;
7
+ iconClass?: string;
8
+ iconDivClass?: string;
9
+ inputClass?: string;
10
+ btnClass?: string;
11
+ placeholder?: string;
12
+ };
13
+ events: {
14
+ submit: SubmitEvent;
15
+ } & {
16
+ [evt: string]: CustomEvent<any>;
17
+ };
18
+ slots: {};
19
+ };
20
+ export declare type SimpleSearchProps = typeof __propDef.props;
21
+ export declare type SimpleSearchEvents = typeof __propDef.events;
22
+ export declare type SimpleSearchSlots = typeof __propDef.slots;
23
+ export default class SimpleSearch extends SvelteComponentTyped<SimpleSearchProps, SimpleSearchEvents, SimpleSearchSlots> {
24
+ }
25
+ export {};
package/index.d.ts CHANGED
@@ -40,6 +40,7 @@ export { default as RadioInline } from './forms/RadioInline.svelte';
40
40
  export { default as Radio } from './forms/Radio.svelte';
41
41
  export { default as Range } from './forms/Range.svelte';
42
42
  export { default as Search } from './forms/Search.svelte';
43
+ export { default as SimpleSearch } from './forms/SimpleSearch.svelte';
43
44
  export { default as Select } from './forms/Select.svelte';
44
45
  export { default as Textarea } from './forms/Textarea.svelte';
45
46
  export { default as Toggle } from './forms/Toggle.svelte';
@@ -75,7 +76,11 @@ export { default as SidebarGroup } from './sidebars/SidebarGroup.svelte';
75
76
  export { default as SidebarWrapper } from './sidebars/SidebarWrapper.svelte';
76
77
  export { default as Spinner } from './spinners/Spinner.svelte';
77
78
  export { default as Table } from './tables/Table.svelte';
78
- export { default as TableDefaultRow } from './tables/TableDefaultRow.svelte';
79
+ export { default as TableBody } from './tables/TableBody.svelte';
80
+ export { default as TableBodyCell } from './tables/TableBodyCell.svelte';
81
+ export { default as TableBodyRow } from './tables/TableBodyRow.svelte';
82
+ export { default as TableHead } from './tables/TableHead.svelte';
83
+ export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
79
84
  export { default as TableSearch } from './tables/TableSearch.svelte';
80
85
  export { tabStore } from './tabs/tabStores.js';
81
86
  export { default as InteractiveTabHead } from './tabs/InteractiveTabHead.svelte';
package/index.js CHANGED
@@ -53,6 +53,7 @@ export { default as RadioInline } from './forms/RadioInline.svelte';
53
53
  export { default as Radio } from './forms/Radio.svelte';
54
54
  export { default as Range } from './forms/Range.svelte';
55
55
  export { default as Search } from './forms/Search.svelte';
56
+ export { default as SimpleSearch } from './forms/SimpleSearch.svelte';
56
57
  export { default as Select } from './forms/Select.svelte';
57
58
  export { default as Textarea } from './forms/Textarea.svelte';
58
59
  export { default as Toggle } from './forms/Toggle.svelte';
@@ -97,7 +98,11 @@ export { default as SidebarWrapper } from './sidebars/SidebarWrapper.svelte';
97
98
  export { default as Spinner } from './spinners/Spinner.svelte';
98
99
  // Tables
99
100
  export { default as Table } from './tables/Table.svelte';
100
- export { default as TableDefaultRow } from './tables/TableDefaultRow.svelte';
101
+ export { default as TableBody } from './tables/TableBody.svelte';
102
+ export { default as TableBodyCell } from './tables/TableBodyCell.svelte';
103
+ export { default as TableBodyRow } from './tables/TableBodyRow.svelte';
104
+ export { default as TableHead } from './tables/TableHead.svelte';
105
+ export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
101
106
  export { default as TableSearch } from './tables/TableSearch.svelte';
102
107
  // Tabs
103
108
  export { tabStore } from './tabs/tabStores.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.17.4",
3
+ "version": "0.18.0",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -84,6 +84,12 @@
84
84
  "npm": ">=7.0.0",
85
85
  "node": ">=16.0.0"
86
86
  },
87
+ "contributors": [
88
+ "Zoltán Szőgyényi <zoltan@themesberg.com>",
89
+ "Robert Tanislav <robert@themesberg.com>",
90
+ "Victor Cordos <victor@themesberg.com>",
91
+ "Shinichi Okada <okada.shin@gmail.com>"
92
+ ],
87
93
  "exports": {
88
94
  "./package.json": "./package.json",
89
95
  "./.DS_Store": "./.DS_Store",
@@ -134,6 +140,7 @@
134
140
  "./forms/Range.svelte": "./forms/Range.svelte",
135
141
  "./forms/Search.svelte": "./forms/Search.svelte",
136
142
  "./forms/Select.svelte": "./forms/Select.svelte",
143
+ "./forms/SimpleSearch.svelte": "./forms/SimpleSearch.svelte",
137
144
  "./forms/SingleCheckbox.svelte": "./forms/SingleCheckbox.svelte",
138
145
  "./forms/Textarea.svelte": "./forms/Textarea.svelte",
139
146
  "./forms/Toggle.svelte": "./forms/Toggle.svelte",
@@ -172,9 +179,11 @@
172
179
  "./sidebars/SidebarWrapper.svelte": "./sidebars/SidebarWrapper.svelte",
173
180
  "./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
174
181
  "./tables/Table.svelte": "./tables/Table.svelte",
175
- "./tables/TableCheckbox.svelte": "./tables/TableCheckbox.svelte",
176
- "./tables/TableCheckboxRow.svelte": "./tables/TableCheckboxRow.svelte",
177
- "./tables/TableDefaultRow.svelte": "./tables/TableDefaultRow.svelte",
182
+ "./tables/TableBody.svelte": "./tables/TableBody.svelte",
183
+ "./tables/TableBodyCell.svelte": "./tables/TableBodyCell.svelte",
184
+ "./tables/TableBodyRow.svelte": "./tables/TableBodyRow.svelte",
185
+ "./tables/TableHead.svelte": "./tables/TableHead.svelte",
186
+ "./tables/TableHeadCell.svelte": "./tables/TableHeadCell.svelte",
178
187
  "./tables/TableSearch.svelte": "./tables/TableSearch.svelte",
179
188
  "./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
180
189
  "./tabs/FullWidthTabs.svelte": "./tabs/FullWidthTabs.svelte",
@@ -1,22 +1,17 @@
1
- <script>export let header;
1
+ <script>import classNames from 'classnames';
2
+ import { setContext } from 'svelte';
2
3
  export let divClass = 'relative overflow-x-auto shadow-md sm:rounded-lg';
3
- export let tableClass = 'w-full text-sm text-left text-gray-500 dark:text-gray-400';
4
- export let theadClass = 'text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400';
4
+ export let striped = false;
5
+ export let hoverable = false;
6
+ $: setContext('striped', striped);
7
+ $: setContext('hoverable', hoverable);
5
8
  </script>
6
9
 
7
10
  <div class={divClass}>
8
- <table class={tableClass}>
9
- <thead class={theadClass}>
10
- <tr>
11
- {#each header as column}
12
- <th scope="col" class="px-6 py-3">
13
- {column}
14
- </th>
15
- {/each}
16
- </tr>
17
- </thead>
18
- <tbody>
19
- <slot />
20
- </tbody>
21
- </table>
11
+ <table
12
+ {...$$restProps}
13
+ class={classNames('w-full text-left text-sm text-gray-500 dark:text-gray-400', $$props.class)}
14
+ >
15
+ <slot />
16
+ </table>
22
17
  </div>
@@ -1,10 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- header: Array<string>;
4
+ [x: string]: any;
5
5
  divClass?: string;
6
- tableClass?: string;
7
- theadClass?: string;
6
+ striped?: boolean;
7
+ hoverable?: boolean;
8
8
  };
9
9
  events: {
10
10
  [evt: string]: CustomEvent<any>;
@@ -0,0 +1,3 @@
1
+ <tbody {...$$props}>
2
+ <slot />
3
+ </tbody>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} TableBodyProps */
2
+ /** @typedef {typeof __propDef.events} TableBodyEvents */
3
+ /** @typedef {typeof __propDef.slots} TableBodySlots */
4
+ export default class TableBody extends SvelteComponentTyped<{
5
+ [x: string]: any;
6
+ }, {
7
+ [evt: string]: CustomEvent<any>;
8
+ }, {
9
+ default: {};
10
+ }> {
11
+ }
12
+ export type TableBodyProps = typeof __propDef.props;
13
+ export type TableBodyEvents = typeof __propDef.events;
14
+ export type TableBodySlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ [x: string]: any;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {
24
+ default: {};
25
+ };
26
+ };
27
+ export {};
@@ -0,0 +1,7 @@
1
+ <script>import classNames from 'classnames';
2
+ export let tdClass = 'px-6 py-4 whitespace-nowrap font-medium text-gray-900 dark:text-white';
3
+ </script>
4
+
5
+ <td {...$$restProps} class={classNames(tdClass, $$props.class)}>
6
+ <slot />
7
+ </td>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ tdClass?: string;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {
11
+ default: {};
12
+ };
13
+ };
14
+ export declare type TableBodyCellProps = typeof __propDef.props;
15
+ export declare type TableBodyCellEvents = typeof __propDef.events;
16
+ export declare type TableBodyCellSlots = typeof __propDef.slots;
17
+ export default class TableBodyCell extends SvelteComponentTyped<TableBodyCellProps, TableBodyCellEvents, TableBodyCellSlots> {
18
+ }
19
+ export {};
@@ -0,0 +1,19 @@
1
+ <script>import classNames from 'classnames';
2
+ import { getContext } from 'svelte';
3
+ export let trClass = 'bg-white dark:border-gray-700 dark:bg-gray-800';
4
+ </script>
5
+
6
+ <tr
7
+ {...$$restProps}
8
+ class={classNames(
9
+ trClass,
10
+ {
11
+ 'odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700':
12
+ getContext('striped') === true,
13
+ 'hover:bg-gray-50 dark:hover:bg-gray-600': getContext('hoverable') === true
14
+ },
15
+ $$props.class
16
+ )}
17
+ >
18
+ <slot />
19
+ </tr>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ trClass?: string;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {
11
+ default: {};
12
+ };
13
+ };
14
+ export declare type TableBodyRowProps = typeof __propDef.props;
15
+ export declare type TableBodyRowEvents = typeof __propDef.events;
16
+ export declare type TableBodyRowSlots = typeof __propDef.slots;
17
+ export default class TableBodyRow extends SvelteComponentTyped<TableBodyRowProps, TableBodyRowEvents, TableBodyRowSlots> {
18
+ }
19
+ export {};
@@ -0,0 +1,14 @@
1
+ <script>import classNames from 'classnames';
2
+ </script>
3
+
4
+ <thead
5
+ {...$$restProps}
6
+ class={classNames(
7
+ 'bg-gray-50 text-xs uppercase text-gray-700 dark:bg-gray-700 dark:text-gray-400',
8
+ $$props.class
9
+ )}
10
+ >
11
+ <tr>
12
+ <slot />
13
+ </tr>
14
+ </thead>
@@ -0,0 +1,18 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {
10
+ default: {};
11
+ };
12
+ };
13
+ export declare type TableHeadProps = typeof __propDef.props;
14
+ export declare type TableHeadEvents = typeof __propDef.events;
15
+ export declare type TableHeadSlots = typeof __propDef.slots;
16
+ export default class TableHead extends SvelteComponentTyped<TableHeadProps, TableHeadEvents, TableHeadSlots> {
17
+ }
18
+ export {};
@@ -0,0 +1,6 @@
1
+ <script>import classNames from 'classnames';
2
+ </script>
3
+
4
+ <th {...$$props} class={classNames('px-6 py-3', $$props.class)}>
5
+ <slot />
6
+ </th>
@@ -0,0 +1,18 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {
10
+ default: {};
11
+ };
12
+ };
13
+ export declare type TableHeadCellProps = typeof __propDef.props;
14
+ export declare type TableHeadCellEvents = typeof __propDef.events;
15
+ export declare type TableHeadCellSlots = typeof __propDef.slots;
16
+ export default class TableHeadCell extends SvelteComponentTyped<TableHeadCellProps, TableHeadCellEvents, TableHeadCellSlots> {
17
+ }
18
+ export {};
@@ -1,16 +1,18 @@
1
- <script>import TableDefaultRow from './TableDefaultRow.svelte';
1
+ <script>import classNames from 'classnames';
2
+ import { setContext } from 'svelte';
3
+ export let divClass = 'relative overflow-x-auto shadow-md sm:rounded-lg';
2
4
  export let inputValue = '';
5
+ export let striped = false;
6
+ export let hoverable = false;
3
7
  export let menuItems;
4
8
  export let filteredItems = [];
5
9
  export let placeholder = 'Search';
10
+ $: setContext('striped', striped);
11
+ $: setContext('hoverable', hoverable);
6
12
  const handleInput = () => {
7
13
  let result = (filteredItems = menuItems.filter((item) => item[0].toLowerCase().match(inputValue.toLowerCase())));
8
14
  return result;
9
15
  };
10
- export let header;
11
- export let divClass = 'relative overflow-x-auto shadow-md sm:rounded-lg';
12
- export let tableClass = 'w-full text-sm text-left text-gray-500 dark:text-gray-400';
13
- export let theadClass = 'text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400';
14
16
  </script>
15
17
 
16
18
  <div class={divClass}>
@@ -40,23 +42,10 @@ export let theadClass = 'text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray
40
42
  />
41
43
  </div>
42
44
  </div>
43
-
44
- <table class={tableClass}>
45
- <thead class={theadClass}>
46
- <tr>
47
- {#each header as column}
48
- <th scope="col" class="px-6 py-3">
49
- {column}
50
- </th>
51
- {/each}
52
- </tr>
53
- </thead>
54
- <tbody>
55
- {#if filteredItems.length > 0}
56
- <TableDefaultRow items={filteredItems} html />
57
- {:else}
58
- <TableDefaultRow items={menuItems} html />
59
- {/if}
60
- </tbody>
45
+ <table
46
+ {...$$restProps}
47
+ class={classNames('w-full text-left text-sm text-gray-500 dark:text-gray-400', $$props.class)}
48
+ >
49
+ <slot />
61
50
  </table>
62
51
  </div>
@@ -1,19 +1,21 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ [x: string]: any;
5
+ divClass?: string;
4
6
  inputValue?: string;
7
+ striped?: boolean;
8
+ hoverable?: boolean;
5
9
  menuItems: Array<Array<string>>;
6
10
  filteredItems?: Array<Array<string>>;
7
11
  placeholder?: string;
8
- header: Array<string>;
9
- divClass?: string;
10
- tableClass?: string;
11
- theadClass?: string;
12
12
  };
13
13
  events: {
14
14
  [evt: string]: CustomEvent<any>;
15
15
  };
16
- slots: {};
16
+ slots: {
17
+ default: {};
18
+ };
17
19
  };
18
20
  export declare type TableSearchProps = typeof __propDef.props;
19
21
  export declare type TableSearchEvents = typeof __propDef.events;
@@ -1,5 +1,4 @@
1
1
  <script>import classNames from 'classnames';
2
- import { browser } from '$app/env';
3
2
  import { clickOutside } from '../utils/clickOutside';
4
3
  import { computePosition, flip, shift, offset, autoPlacement, arrow as arrowFloat } from '@floating-ui/dom';
5
4
  import { onDestroy } from 'svelte';
@@ -41,9 +40,9 @@ const updatePosition = () => computePosition(triggerRef, tooltipRef, {
41
40
  placement: floatingPlacement({ placement })
42
41
  }).then((data) => (placementData = data));
43
42
  let attachedScroll = false;
44
- $: browser && tooltipRef && open && updatePosition();
43
+ $: tooltipRef && open && updatePosition();
45
44
  $: {
46
- if (browser && open && !attachedScroll) {
45
+ if (open && !attachedScroll) {
47
46
  attachedScroll = true;
48
47
  window.addEventListener('scroll', updatePosition, true);
49
48
  }
@@ -1,28 +0,0 @@
1
- <script>export let header;
2
- export let divClass = 'relative overflow-x-auto shadow-md sm:rounded-lg';
3
- export let tableClass = 'w-full text-sm text-left text-gray-500 dark:text-gray-400';
4
- export let theadClass = 'text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400';
5
- </script>
6
-
7
- <div class={divClass}>
8
- <table class={tableClass}>
9
- <thead class={theadClass}>
10
- <tr>
11
- <th scope="col" class="p-4">
12
- <div class="flex items-center">
13
- <input id="checkbox-all" type="checkbox" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600" />
14
- <label for="checkbox-all" class="sr-only">checkbox</label>
15
- </div>
16
- </th>
17
- {#each header as column}
18
- <th scope="col" class="px-6 py-3">
19
- {column}
20
- </th>
21
- {/each}
22
- </tr>
23
- </thead>
24
- <tbody>
25
- <slot />
26
- </tbody>
27
- </table>
28
- </div>
@@ -1,21 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- header: Array<string>;
5
- divClass?: string;
6
- tableClass?: string;
7
- theadClass?: string;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {
13
- default: {};
14
- };
15
- };
16
- export declare type TableCheckboxProps = typeof __propDef.props;
17
- export declare type TableCheckboxEvents = typeof __propDef.events;
18
- export declare type TableCheckboxSlots = typeof __propDef.slots;
19
- export default class TableCheckbox extends SvelteComponentTyped<TableCheckboxProps, TableCheckboxEvents, TableCheckboxSlots> {
20
- }
21
- export {};
File without changes
@@ -1,19 +0,0 @@
1
- /** @typedef {typeof __propDef.props} TableCheckboxRowProps */
2
- /** @typedef {typeof __propDef.events} TableCheckboxRowEvents */
3
- /** @typedef {typeof __propDef.slots} TableCheckboxRowSlots */
4
- export default class TableCheckboxRow extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type TableCheckboxRowProps = typeof __propDef.props;
9
- export type TableCheckboxRowEvents = typeof __propDef.events;
10
- export type TableCheckboxRowSlots = typeof __propDef.slots;
11
- import { SvelteComponentTyped } from "svelte";
12
- declare const __propDef: {
13
- props: {};
14
- events: {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {};
18
- };
19
- export {};
@@ -1,66 +0,0 @@
1
- <script>export let items;
2
- export let html = false;
3
- export let rowState = undefined;
4
- let trClass;
5
- let trLastClass;
6
- if (rowState === 'striped') {
7
- trClass = 'border-b dark:bg-gray-800 dark:border-gray-700 odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700';
8
- trLastClass = 'odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700';
9
- }
10
- else if (rowState === 'hover') {
11
- trClass = 'bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600';
12
- trLastClass = 'bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-600';
13
- }
14
- else {
15
- trClass = 'bg-white border-b dark:bg-gray-800 dark:border-gray-700';
16
- trLastClass = 'bg-white dark:bg-gray-800';
17
- }
18
- </script>
19
-
20
- {#each items as item, i}
21
- {#if i === items.length - 1}
22
- <tr class={trLastClass}>
23
- {#each item as cell, j}
24
- {#if j === 0}
25
- <th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap">
26
- {#if html}
27
- {@html cell}
28
- {:else}
29
- {cell}
30
- {/if}
31
- </th>
32
- {:else}
33
- <td class="px-6 py-4">
34
- {#if html}
35
- {@html cell}
36
- {:else}
37
- {cell}
38
- {/if}
39
- </td>
40
- {/if}
41
- {/each}
42
- </tr>
43
- {:else}
44
- <tr class={trClass}>
45
- {#each item as cell, j}
46
- {#if j === 0}
47
- <th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap">
48
- {#if html}
49
- {@html cell}
50
- {:else}
51
- {cell}
52
- {/if}
53
- </th>
54
- {:else}
55
- <td class="px-6 py-4">
56
- {#if html}
57
- {@html cell}
58
- {:else}
59
- {cell}
60
- {/if}
61
- </td>
62
- {/if}
63
- {/each}
64
- </tr>
65
- {/if}
66
- {/each}
@@ -1,18 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- items: Array<Array<string>>;
5
- html?: boolean;
6
- rowState?: 'striped' | 'hover' | undefined;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- };
13
- export declare type TableDefaultRowProps = typeof __propDef.props;
14
- export declare type TableDefaultRowEvents = typeof __propDef.events;
15
- export declare type TableDefaultRowSlots = typeof __propDef.slots;
16
- export default class TableDefaultRow extends SvelteComponentTyped<TableDefaultRowProps, TableDefaultRowEvents, TableDefaultRowSlots> {
17
- }
18
- export {};