@isoftdata/svelte-table 2.10.0-beta.1 → 2.10.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 CHANGED
@@ -35,6 +35,7 @@ This component uses a generic type `R` to represent the type of a single row pas
35
35
  | class | `string` | Any extra classes to apply to the `table`. | `""` |
36
36
  | columnClickedMethod | `(column: Column, direction: SortDirection) => void` | Called when a column is clicked. Should update `previousSortOrder`, `previousSortDirection`, `previousSortColumn`, and `sortedRows`. | `defaultColumnClicked` |
37
37
  | columnHidingEnabled | `boolean` | When enabled, the user will be able to right click a column header and hide/show it. | `false` |
38
+ | columnPinningEnabled | `boolean` | When enabled, the user will be able to right click a column header and pin or unpin it. | `false` |
38
39
  | columnResizingEnabled | `boolean` | When enabled, the user will be able to drag on the edge of a column header and resize it. | `false` |
39
40
  | columns | `Array<Column>` | The definition of the columns. See columns docs below. | **Required** |
40
41
  | currentPageNumber | `number` | The current page number. | `1` |
package/dist/Table.svelte CHANGED
@@ -1000,14 +1000,26 @@
1000
1000
  <DropdownItem
1001
1001
  icon={isPinned ? 'thumbtack-angle-slash' : 'thumbtack-angle'}
1002
1002
  title={isPinned
1003
- ? 'Unpinning this column will make it scroll normally'
1004
- : 'Pinning this column will keep it visible as you scroll to the right'}
1003
+ ? translate('common:tableUnpinColumnTitle', 'Unpinning this column will make it scroll normally')
1004
+ : translate(
1005
+ 'common:tablePinColumnTitle',
1006
+ 'Pinning this column will keep it visible as you scroll to the right',
1007
+ )}
1005
1008
  onclick={() => {
1006
1009
  if (contextMenuColumn) {
1007
1010
  pinUnpinColumn(contextMenuColumn)
1008
1011
  }
1009
1012
  }}
1010
- >{isPinned ? `Unpin ${contextMenuColumn?.name}` : `Pin ${contextMenuColumn?.name}`}
1013
+ >{#if contextMenuColumn?.name}
1014
+ {isPinned
1015
+ ? translate('common:tableUnpinColumnName', 'Unpin {{name}}', { name: contextMenuColumn.name })
1016
+ : translate('common:tablePinColumnName', 'Pin {{name}}', { name: contextMenuColumn.name })}
1017
+ {:else}
1018
+ {isPinned ? translate('common:tableUnpinColumn', 'Unpin') : translate('common:tablePinColumn', 'Pin')}
1019
+ {#if contextMenuColumn?.icon}
1020
+ <Icon icon={contextMenuColumn.icon}></Icon>
1021
+ {/if}
1022
+ {/if}
1011
1023
  </DropdownItem>
1012
1024
 
1013
1025
  {#if columnHidingEnabled || columnResizingEnabled}
@@ -77,7 +77,7 @@ export class ColumnInfoRunicStore {
77
77
  return '0px';
78
78
  }
79
79
  else if (colIndex === 0) {
80
- return '0px';
80
+ return '-1px'; // Fix the gap on the left side of the first column
81
81
  }
82
82
  const offsetPx = this.pinnedColumns.slice(0, colIndex).reduce((acc, col) => {
83
83
  if (col.userWidth && col.visible) {
@@ -88,7 +88,7 @@ export class ColumnInfoRunicStore {
88
88
  }
89
89
  return acc;
90
90
  }, 0);
91
- return `${offsetPx}px`;
91
+ return `${offsetPx - colIndex - 1}px`;
92
92
  }
93
93
  getStoreValFromColumns(columns, storeValue) {
94
94
  const columnInfo = columns.reduce((acc, column) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-table",
3
- "version": "2.10.0-beta.1",
3
+ "version": "2.10.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",