@streamscloud/kit 0.2.41 → 0.2.42-1778522742378

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.
@@ -8,6 +8,10 @@ export type SortableTableColumn = {
8
8
  sortDirection: TableColumnSortDirection;
9
9
  type: TableColumnType;
10
10
  onSort: ((state: TableColumnSortDirection) => Promise<void>) | null;
11
+ sortLabelsOverride?: {
12
+ asc: string;
13
+ desc: string;
14
+ } | null;
11
15
  };
12
16
  export declare class ResolvedColumn<T extends WithId> {
13
17
  readonly def: ColumnDef<T>;
@@ -23,6 +27,10 @@ export declare class ResolvedColumn<T extends WithId> {
23
27
  get centered(): boolean;
24
28
  get fixedCssWidth(): string;
25
29
  get hideable(): boolean;
30
+ get sortLabelsOverride(): {
31
+ asc: string;
32
+ desc: string;
33
+ } | null;
26
34
  get onSort(): ((state: TableColumnSortDirection) => Promise<void>) | null;
27
35
  get onClick(): ((item: T) => Promise<void> | void) | null;
28
36
  }
@@ -42,6 +42,12 @@ export class ResolvedColumn {
42
42
  // Structural columns (checkbox, actions, move-row) have no id — not hideable by default
43
43
  return 'id' in this.def;
44
44
  }
45
+ get sortLabelsOverride() {
46
+ if ('sortLabelsOverride' in this.def) {
47
+ return this.def.sortLabelsOverride ?? null;
48
+ }
49
+ return null;
50
+ }
45
51
  get onSort() {
46
52
  if ('onSort' in this.def) {
47
53
  return this.def.onSort ?? null;
@@ -42,6 +42,15 @@ const changeSort = (direction) => {
42
42
  {localization.oldestFirst}
43
43
  <Checkbox checked={column.sortDirection === 'asc'} on={{ change: () => changeSort('asc') }} />
44
44
  </div>
45
+ {:else if column.sortLabelsOverride}
46
+ <div class="th-sortable__dropdown-option">
47
+ {column.sortLabelsOverride.asc}
48
+ <Checkbox checked={column.sortDirection === 'asc'} on={{ change: () => changeSort('asc') }} />
49
+ </div>
50
+ <div class="th-sortable__dropdown-option">
51
+ {column.sortLabelsOverride.desc}
52
+ <Checkbox checked={column.sortDirection === 'desc'} on={{ change: () => changeSort('desc') }} />
53
+ </div>
45
54
  {:else}
46
55
  <div class="th-sortable__dropdown-option">
47
56
  {localization.ascending}
@@ -24,6 +24,10 @@ export interface ITableColumn<T> extends ITableColumnBase {
24
24
  title: string;
25
25
  onSort?: ((state: TableColumnSortDirection) => Promise<void>) | null;
26
26
  sortDirection?: TableColumnSortDirection;
27
+ sortLabelsOverride?: {
28
+ asc: string;
29
+ desc: string;
30
+ };
27
31
  onClick?: ((item: T) => Promise<void> | void) | null;
28
32
  hidden?: boolean;
29
33
  hideable?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.2.41",
3
+ "version": "0.2.42-1778522742378",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",