@cashub/ui 0.17.5 → 0.17.6
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/package.json +1 -1
- package/table/Table.js +10 -4
package/package.json
CHANGED
package/table/Table.js
CHANGED
|
@@ -171,16 +171,22 @@ var Table = function Table(_ref) {
|
|
|
171
171
|
custom = column.custom,
|
|
172
172
|
props = _objectWithoutProperties(column, _excluded);
|
|
173
173
|
|
|
174
|
-
var key = rowIndex + columnIndex.toString();
|
|
174
|
+
var key = rowIndex + columnIndex.toString();
|
|
175
|
+
var value = row[fieldName]; // 如果有matcher,比對當前 column 的 fieldName 是不是等於 matcher
|
|
175
176
|
|
|
176
177
|
if (matcher && fieldName === matcher) {
|
|
177
|
-
if (type === 'single' && selected ===
|
|
178
|
+
if (type === 'single' && selected === value) {
|
|
178
179
|
active = true;
|
|
179
180
|
}
|
|
180
181
|
|
|
181
|
-
if (type === 'multiple' && selected.includes(
|
|
182
|
+
if (type === 'multiple' && selected.includes(value)) {
|
|
182
183
|
active = true;
|
|
183
184
|
}
|
|
185
|
+
} // convert to an empty string
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
if (value === null || value === undefined) {
|
|
189
|
+
value = '';
|
|
184
190
|
}
|
|
185
191
|
|
|
186
192
|
var isCustom = false;
|
|
@@ -195,7 +201,7 @@ var Table = function Table(_ref) {
|
|
|
195
201
|
renderedData = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
196
202
|
id: key,
|
|
197
203
|
onClick: showFullValue,
|
|
198
|
-
children: render ? render(
|
|
204
|
+
children: render ? render(value, row) : String(value)
|
|
199
205
|
});
|
|
200
206
|
}
|
|
201
207
|
|