@v1nt1248/3nclient-lib 0.1.40 → 0.1.42
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,12 +45,18 @@ 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
|
|
48
|
+
export type Ui3nTableBodyRowEventHandlers<T extends Ui3nTableBodyBaseItem> = {
|
|
49
|
+
select: (row: T, withoutEvents?: boolean) => void;
|
|
50
|
+
};
|
|
51
|
+
export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
|
|
49
52
|
row: T;
|
|
50
53
|
rowStyle?: Record<string, string>;
|
|
51
54
|
rowIndex: number;
|
|
52
55
|
isRowSelected?: boolean;
|
|
53
|
-
|
|
56
|
+
columnStyle?: {
|
|
57
|
+
[P in Omit<K, 'id'> as string | number]: Record<string, string>;
|
|
58
|
+
};
|
|
59
|
+
eventHandlers?: Ui3nTableBodyRowEventHandlers<T>;
|
|
54
60
|
};
|
|
55
61
|
export type Ui3nTableBodyRowSlot<T extends Ui3nTableBodyBaseItem> = {
|
|
56
62
|
row: (scope: Ui3nTableBodyRowSlotScope<T>) => VNode;
|
|
@@ -59,6 +65,9 @@ export type Ui3nTableBodyRowCellSlotScope<T extends Ui3nTableBodyBaseItem, K ext
|
|
|
59
65
|
row: T;
|
|
60
66
|
rowIndex: number;
|
|
61
67
|
isRowSelected?: boolean;
|
|
68
|
+
columnStyle?: {
|
|
69
|
+
[P in Omit<K, 'id'> as string | number]: Record<string, string>;
|
|
70
|
+
};
|
|
62
71
|
cell: T[K];
|
|
63
72
|
};
|
|
64
73
|
export type Ui3nTableBodyRowCellSlot<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
|
package/dist/ui3n-components.js
CHANGED
|
@@ -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) =>
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
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
|
+
"eventHandlers-": 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) =>
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
},
|
|
13003
|
-
|
|
13004
|
-
|
|
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
|
@@ -53,12 +53,17 @@ export type Ui3nTableHeaderCellSlot<T extends Ui3nTableBodyBaseItem, K extends s
|
|
|
53
53
|
[p in `header-cell-${K}`]: () => VNode;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export type
|
|
56
|
+
export type Ui3nTableBodyRowEventHandlers<T extends Ui3nTableBodyBaseItem> = {
|
|
57
|
+
select: (row: T, withoutEvents?: boolean) => void;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
|
|
57
61
|
row: T;
|
|
58
62
|
rowStyle?: Record<string, string>;
|
|
59
63
|
rowIndex: number;
|
|
60
64
|
isRowSelected?: boolean;
|
|
61
|
-
|
|
65
|
+
columnStyle?: { [P in Omit<K, 'id'> as string | number]: Record<string, string> };
|
|
66
|
+
eventHandlers?: Ui3nTableBodyRowEventHandlers<T>;
|
|
62
67
|
};
|
|
63
68
|
|
|
64
69
|
export type Ui3nTableBodyRowSlot<T extends Ui3nTableBodyBaseItem> = {
|
|
@@ -69,6 +74,7 @@ export type Ui3nTableBodyRowCellSlotScope<T extends Ui3nTableBodyBaseItem, K ext
|
|
|
69
74
|
row: T;
|
|
70
75
|
rowIndex: number;
|
|
71
76
|
isRowSelected?: boolean;
|
|
77
|
+
columnStyle?: { [P in Omit<K, 'id'> as string | number]: Record<string, string> };
|
|
72
78
|
cell: T[K];
|
|
73
79
|
};
|
|
74
80
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
changeSortOrder,
|
|
26
26
|
} = useTable(props, emits);
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const eventHandlers = {
|
|
29
29
|
select: processSelection,
|
|
30
30
|
};
|
|
31
31
|
</script>
|
|
@@ -107,7 +107,8 @@
|
|
|
107
107
|
:row-style="getRowStyle(row)"
|
|
108
108
|
:row-index="rowIndex"
|
|
109
109
|
:is-row-selected="isRowSelected(row)"
|
|
110
|
-
:
|
|
110
|
+
:column-style="config?.columnStyle"
|
|
111
|
+
:event-handlers-="eventHandlers"
|
|
111
112
|
/>
|
|
112
113
|
</div>
|
|
113
114
|
</template>
|
|
@@ -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">
|