@v1nt1248/3nclient-lib 0.1.40 → 0.1.41

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.
@@ -45,11 +45,14 @@ export type Ui3nTableGroupActionsSlot = {
45
45
  export type Ui3nTableHeaderCellSlot<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
46
46
  [p in `header-cell-${K}`]: () => VNode;
47
47
  };
48
- export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem> = {
48
+ export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
49
49
  row: T;
50
50
  rowStyle?: Record<string, string>;
51
51
  rowIndex: number;
52
52
  isRowSelected?: boolean;
53
+ columnStyle?: {
54
+ [P in Omit<K, 'id'> as string | number]: Record<string, string>;
55
+ };
53
56
  events?: Record<string, (value: unknown) => unknown>;
54
57
  };
55
58
  export type Ui3nTableBodyRowSlot<T extends Ui3nTableBodyBaseItem> = {
@@ -59,6 +62,9 @@ export type Ui3nTableBodyRowCellSlotScope<T extends Ui3nTableBodyBaseItem, K ext
59
62
  row: T;
60
63
  rowIndex: number;
61
64
  isRowSelected?: boolean;
65
+ columnStyle?: {
66
+ [P in Omit<K, 'id'> as string | number]: Record<string, string>;
67
+ };
62
68
  cell: T[K];
63
69
  };
64
70
  export type Ui3nTableBodyRowCellSlot<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
@@ -12962,18 +12962,22 @@ const mf = /* @__PURE__ */ Eg({
12962
12962
  RA("div", {
12963
12963
  class: EA(x.$style.body)
12964
12964
  }, [
12965
- x.$slots.row ? (eA(!0), DA(AB, { key: 0 }, gB(x.body.content, (O, CA) => (eA(), DA("div", {
12966
- key: KA(U)(O, CA),
12967
- class: EA([x.$style.row, KA(h)(O) && x.$style.selected, x.config.selectable && x.$style.selectable])
12968
- }, [
12969
- eg(x.$slots, "row", {
12970
- row: O,
12971
- rowStyle: KA(r)(O),
12972
- rowIndex: CA,
12973
- isRowSelected: KA(h)(O),
12974
- events: J
12975
- })
12976
- ], 2))), 128)) : (eA(!0), DA(AB, { key: 1 }, gB(x.body.content, (O, CA) => (eA(), DA("div", {
12965
+ x.$slots.row ? (eA(!0), DA(AB, { key: 0 }, gB(x.body.content, (O, CA) => {
12966
+ var W;
12967
+ return eA(), DA("div", {
12968
+ key: KA(U)(O, CA),
12969
+ class: EA([x.$style.row, KA(h)(O) && x.$style.selected, x.config.selectable && x.$style.selectable])
12970
+ }, [
12971
+ eg(x.$slots, "row", {
12972
+ row: O,
12973
+ rowStyle: KA(r)(O),
12974
+ rowIndex: CA,
12975
+ isRowSelected: KA(h)(O),
12976
+ columnStyle: (W = x.config) == null ? void 0 : W.columnStyle,
12977
+ events: J
12978
+ })
12979
+ ], 2);
12980
+ }), 128)) : (eA(!0), DA(AB, { key: 1 }, gB(x.body.content, (O, CA) => (eA(), DA("div", {
12977
12981
  key: KA(U)(O, CA),
12978
12982
  class: EA([x.$style.row, KA(h)(O) && x.$style.selected, x.config.selectable && x.$style.selectable]),
12979
12983
  style: mI(KA(r)(O))
@@ -12987,21 +12991,25 @@ const mf = /* @__PURE__ */ Eg({
12987
12991
  onChange: (W) => KA(S)(O)
12988
12992
  }, null, 8, ["model-value", "onChange"])
12989
12993
  ], 2)) : WA("", !0),
12990
- (eA(!0), DA(AB, null, gB(KA(s), (W, X) => (eA(), DA("div", {
12991
- key: W.key,
12992
- class: EA([x.$style.bodyItem, X === 0 && x.$style.bodyItemFirst])
12993
- }, [
12994
- eg(x.$slots, `row-cell-${W.key}`, {
12995
- row: O,
12996
- rowIndex: CA,
12997
- isRowSelected: KA(h)(O),
12998
- cell: O[W.key]
12999
- }, () => [
13000
- RA("span", {
13001
- class: EA(x.$style.cell)
13002
- }, ng(O[W.key]), 3)
13003
- ])
13004
- ], 2))), 128))
12994
+ (eA(!0), DA(AB, null, gB(KA(s), (W, X) => {
12995
+ var b;
12996
+ return eA(), DA("div", {
12997
+ key: W.key,
12998
+ class: EA([x.$style.bodyItem, X === 0 && x.$style.bodyItemFirst])
12999
+ }, [
13000
+ eg(x.$slots, `row-cell-${W.key}`, {
13001
+ row: O,
13002
+ rowIndex: CA,
13003
+ isRowSelected: KA(h)(O),
13004
+ columnStyle: (b = x.config) == null ? void 0 : b.columnStyle,
13005
+ cell: O[W.key]
13006
+ }, () => [
13007
+ RA("span", {
13008
+ class: EA(x.$style.cell)
13009
+ }, ng(O[W.key]), 3)
13010
+ ])
13011
+ ], 2);
13012
+ }), 128))
13005
13013
  ], 6))), 128))
13006
13014
  ], 2)
13007
13015
  ], 2));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@v1nt1248/3nclient-lib",
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "v1nt1248",
5
- "version": "0.1.40",
5
+ "version": "0.1.41",
6
6
  "description": "Library for 3NWeb clients",
7
7
  "type": "module",
8
8
  "files": [
@@ -53,11 +53,12 @@ export type Ui3nTableHeaderCellSlot<T extends Ui3nTableBodyBaseItem, K extends s
53
53
  [p in `header-cell-${K}`]: () => VNode;
54
54
  };
55
55
 
56
- export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem> = {
56
+ export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
57
57
  row: T;
58
58
  rowStyle?: Record<string, string>;
59
59
  rowIndex: number;
60
60
  isRowSelected?: boolean;
61
+ columnStyle?: { [P in Omit<K, 'id'> as string | number]: Record<string, string> };
61
62
  events?: Record<string, (value: unknown) => unknown>;
62
63
  };
63
64
 
@@ -69,6 +70,7 @@ export type Ui3nTableBodyRowCellSlotScope<T extends Ui3nTableBodyBaseItem, K ext
69
70
  row: T;
70
71
  rowIndex: number;
71
72
  isRowSelected?: boolean;
73
+ columnStyle?: { [P in Omit<K, 'id'> as string | number]: Record<string, string> };
72
74
  cell: T[K];
73
75
  };
74
76
 
@@ -107,6 +107,7 @@
107
107
  :row-style="getRowStyle(row)"
108
108
  :row-index="rowIndex"
109
109
  :is-row-selected="isRowSelected(row)"
110
+ :column-style="config?.columnStyle"
110
111
  :events="eventsHandlers"
111
112
  />
112
113
  </div>
@@ -139,6 +140,7 @@
139
140
  :row="row"
140
141
  :row-index="rowIndex"
141
142
  :is-row-selected="isRowSelected(row)"
143
+ :column-style="config?.columnStyle"
142
144
  :cell="row[col.key]"
143
145
  >
144
146
  <span :class="$style.cell">