@isoftdata/svelte-table 2.8.2 → 2.9.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/dist/Table.svelte CHANGED
@@ -903,7 +903,9 @@
903
903
  </thead>
904
904
  <tbody class:unselectable={selectionMode === 'RANGE'}>
905
905
  {#snippet tableRow(row: R & { originalIndex: number; uuid: string }, index: number)}
906
- {#if children}{@render children({ row, index })}{:else}
906
+ {#if children}
907
+ {@render children({ row, index })}
908
+ {:else}
907
909
  <tr
908
910
  class:table-primary={rowIsSelected(row, rowSelectionIdProp, selectedRowIds)}
909
911
  onclick={() => rowClick(row)}
package/dist/Td.svelte CHANGED
@@ -1,5 +1,8 @@
1
- <script lang="ts">
2
- import type { UuidRowProps } from './'
1
+ <script
2
+ lang="ts"
3
+ generics="R extends UuidRowProps = any"
4
+ >
5
+ import type { ColumnInfo, RowProperties, UuidRowProps } from './'
3
6
  import type { ColumnInfoRunicStore } from './column-info-store.svelte'
4
7
  import type { HTMLTdAttributes, ClassValue } from 'svelte/elements'
5
8
  import type { Writable } from 'svelte/store'
@@ -12,7 +15,7 @@
12
15
 
13
16
  interface Props extends Omit<HTMLTdAttributes, 'align'> {
14
17
  class?: ClassValue
15
- property: string
18
+ property: ColumnInfo<R>['property']
16
19
  /** Direction to align the column's contents
17
20
  *
18
21
  * `start` and `end` are only available in Bootstrap 5+
@@ -1,28 +1,42 @@
1
+ import type { RowProperties, UuidRowProps } from './';
1
2
  import type { HTMLTdAttributes, ClassValue } from 'svelte/elements';
2
3
  import { type Snippet } from 'svelte';
3
- interface Props extends Omit<HTMLTdAttributes, 'align'> {
4
- class?: ClassValue;
5
- property: string;
6
- /** Direction to align the column's contents
7
- *
8
- * `start` and `end` are only available in Bootstrap 5+
9
- *
10
- * `left` and `right`should only be used while you transition to Boostrap 5+
11
- */
12
- align?: 'start' | 'left' | 'center' | 'right' | 'end';
13
- /** If enabled, pressing enter while focused in this Td will focus the next non-disabled input/select/textarea in the column. Holding shift will go up instead of down.
14
- *
15
- * Can also be a callback that is fired when the enter key is used to move between rows.
16
- */
17
- enterGoesDown?: boolean | ((ctx: {
18
- event: KeyboardEvent;
19
- tr: HTMLTableRowElement;
20
- }) => void);
21
- /** If enabled, keypress (enter only) and click events on the Td's contents will have `stopPropagation`/`preventDefault` called on them. */
22
- stopPropagation?: boolean;
23
- tagName?: 'TD' | 'TH';
24
- children?: Snippet;
4
+ declare class __sveltets_Render<R extends UuidRowProps = any> {
5
+ props(): Omit<HTMLTdAttributes, "align"> & {
6
+ class?: ClassValue;
7
+ property: `_${string}` | RowProperties<R>;
8
+ /** Direction to align the column's contents
9
+ *
10
+ * `start` and `end` are only available in Bootstrap 5+
11
+ *
12
+ * `left` and `right`should only be used while you transition to Boostrap 5+
13
+ */
14
+ align?: "start" | "left" | "center" | "right" | "end";
15
+ /** If enabled, pressing enter while focused in this Td will focus the next non-disabled input/select/textarea in the column. Holding shift will go up instead of down.
16
+ *
17
+ * Can also be a callback that is fired when the enter key is used to move between rows.
18
+ */
19
+ enterGoesDown?: boolean | ((ctx: {
20
+ event: KeyboardEvent;
21
+ tr: HTMLTableRowElement;
22
+ }) => void) | undefined;
23
+ /** If enabled, keypress (enter only) and click events on the Td's contents will have `stopPropagation`/`preventDefault` called on them. */
24
+ stopPropagation?: boolean;
25
+ tagName?: "TD" | "TH";
26
+ children?: Snippet;
27
+ };
28
+ events(): {};
29
+ slots(): {};
30
+ bindings(): "align";
31
+ exports(): {};
25
32
  }
26
- declare const Td: import("svelte").Component<Props, {}, "align">;
27
- type Td = ReturnType<typeof Td>;
33
+ interface $$IsomorphicComponent {
34
+ new <R extends UuidRowProps = any>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<R>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<R>['props']>, ReturnType<__sveltets_Render<R>['events']>, ReturnType<__sveltets_Render<R>['slots']>> & {
35
+ $$bindings?: ReturnType<__sveltets_Render<R>['bindings']>;
36
+ } & ReturnType<__sveltets_Render<R>['exports']>;
37
+ <R extends UuidRowProps = any>(internal: unknown, props: ReturnType<__sveltets_Render<R>['props']> & {}): ReturnType<__sveltets_Render<R>['exports']>;
38
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
39
+ }
40
+ declare const Td: $$IsomorphicComponent;
41
+ type Td<R extends UuidRowProps = any> = InstanceType<typeof Td<R>>;
28
42
  export default Td;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-table",
3
- "version": "2.8.2",
3
+ "version": "2.9.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",