@emamid/svelte-data-table 0.0.15 → 0.0.16
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.
|
@@ -3,4 +3,7 @@ export {};
|
|
|
3
3
|
* Cell containing a Button ({@link https://flowbite-svelte.com/docs/components/buttons}) component.
|
|
4
4
|
* @typedef {object} ButtonCell
|
|
5
5
|
* @property {string} [caption] - Text to be displayed inside the button.
|
|
6
|
+
* @property {ConstructorOfATypedSvelteComponent} [icon] - Icon to be displayed inside the button.
|
|
7
|
+
* @property {string} [iconClass] - CSS class of the icon to be displayed inside the button.
|
|
8
|
+
* @property {'left' | 'right'} [iconPosition] - Position of the icon, relative to the caption.
|
|
6
9
|
*/
|
|
@@ -3,4 +3,7 @@
|
|
|
3
3
|
* Cell containing a Button ({@link https://flowbite-svelte.com/docs/components/buttons}) component.
|
|
4
4
|
* @typedef {object} ButtonCell
|
|
5
5
|
* @property {string} [caption] - Text to be displayed inside the button.
|
|
6
|
+
* @property {ConstructorOfATypedSvelteComponent} [icon] - Icon to be displayed inside the button.
|
|
7
|
+
* @property {string} [iconClass] - CSS class of the icon to be displayed inside the button.
|
|
8
|
+
* @property {'left' | 'right'} [iconPosition] - Position of the icon, relative to the caption.
|
|
6
9
|
*/
|
|
@@ -3,6 +3,9 @@ import { Button } from "flowbite-svelte";
|
|
|
3
3
|
export let caption = "";
|
|
4
4
|
export let column;
|
|
5
5
|
export let item;
|
|
6
|
+
export let icon = null;
|
|
7
|
+
export let iconClass = "";
|
|
8
|
+
export let iconPosition = "right";
|
|
6
9
|
const dispatch = createEventDispatcher();
|
|
7
10
|
const buttonClicked = () => {
|
|
8
11
|
dispatch("click", {
|
|
@@ -12,6 +15,12 @@ const buttonClicked = () => {
|
|
|
12
15
|
};
|
|
13
16
|
</script>
|
|
14
17
|
|
|
15
|
-
<Button {...$$props} on:click={buttonClicked}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
<Button {...$$props} on:click={buttonClicked}>
|
|
19
|
+
{#if icon && iconPosition === 'left'}
|
|
20
|
+
<svelte:component this={icon} class={iconClass} />
|
|
21
|
+
{/if}
|
|
22
|
+
{#if caption}{caption}{/if}
|
|
23
|
+
{#if icon && iconPosition === 'right'}
|
|
24
|
+
<svelte:component this={icon} class={iconClass} />
|
|
25
|
+
{/if}
|
|
26
|
+
</Button>
|
|
@@ -6,6 +6,9 @@ declare const __propDef: {
|
|
|
6
6
|
caption?: string | undefined;
|
|
7
7
|
column: ColumnConfig;
|
|
8
8
|
item: any;
|
|
9
|
+
icon?: ConstructorOfATypedSvelteComponent | null | undefined;
|
|
10
|
+
iconClass?: string | undefined;
|
|
11
|
+
iconPosition?: "left" | "right" | undefined;
|
|
9
12
|
};
|
|
10
13
|
events: {
|
|
11
14
|
click: CustomEvent<any>;
|
|
@@ -2,6 +2,6 @@ export {};
|
|
|
2
2
|
/**
|
|
3
3
|
* Cell containing a range ({@link https://flowbite-svelte.com/docs/forms/range}) component.
|
|
4
4
|
* @typedef {object} RangeCell
|
|
5
|
-
* @property {number}
|
|
6
|
-
* @property {number}
|
|
5
|
+
* @property {number} min - Passed through.
|
|
6
|
+
* @property {number} max - Passed through.
|
|
7
7
|
*/
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Cell containing a range ({@link https://flowbite-svelte.com/docs/forms/range}) component.
|
|
4
4
|
* @typedef {object} RangeCell
|
|
5
|
-
* @property {number}
|
|
6
|
-
* @property {number}
|
|
5
|
+
* @property {number} min - Passed through.
|
|
6
|
+
* @property {number} max - Passed through.
|
|
7
7
|
*/
|