@etsoo/react 1.5.62 → 1.5.63
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/lib/mu/OptionGroup.js
CHANGED
|
@@ -12,7 +12,7 @@ export function OptionGroup(props) {
|
|
|
12
12
|
// Get option value
|
|
13
13
|
// D type should be the source id type
|
|
14
14
|
const getOptionValue = (option) => {
|
|
15
|
-
const value = DataTypes.
|
|
15
|
+
const value = DataTypes.getValue(option, idField);
|
|
16
16
|
if (value == null)
|
|
17
17
|
return null;
|
|
18
18
|
return value;
|
package/lib/mu/ScrollerListEx.js
CHANGED
|
@@ -112,7 +112,7 @@ export function ScrollerListEx(props) {
|
|
|
112
112
|
return selected;
|
|
113
113
|
};
|
|
114
114
|
// Destruct
|
|
115
|
-
const { alternatingColors = [undefined, undefined], className, idField = 'id', innerItemRenderer, itemSize, itemKey = (index, data) => { var _a; return (_a = DataTypes.
|
|
115
|
+
const { alternatingColors = [undefined, undefined], className, idField = 'id', innerItemRenderer, itemSize, itemKey = (index, data) => { var _a; return (_a = DataTypes.getValue(data, idField)) !== null && _a !== void 0 ? _a : index; }, itemRenderer = (itemProps) => {
|
|
116
116
|
const [itemHeight, space, margins] = calculateItemSize(itemProps.index);
|
|
117
117
|
return defaultItemRenderer({
|
|
118
118
|
itemHeight,
|
package/lib/mu/TableEx.js
CHANGED
|
@@ -229,7 +229,7 @@ export function TableEx(props) {
|
|
|
229
229
|
? rows[rowIndex]
|
|
230
230
|
: undefined;
|
|
231
231
|
// Row id field value
|
|
232
|
-
const rowId = (_a = DataTypes.
|
|
232
|
+
const rowId = (_a = DataTypes.getValue(row, idField)) !== null && _a !== void 0 ? _a : rowIndex;
|
|
233
233
|
// Selected or not
|
|
234
234
|
const isItemSelected = selectable
|
|
235
235
|
? selectedItems.some((item) => item[idField] === rowId)
|
package/package.json
CHANGED
package/src/mu/OptionGroup.tsx
CHANGED
|
@@ -104,7 +104,7 @@ export function OptionGroup<
|
|
|
104
104
|
// Get option value
|
|
105
105
|
// D type should be the source id type
|
|
106
106
|
const getOptionValue = (option: T): D | null => {
|
|
107
|
-
const value = DataTypes.
|
|
107
|
+
const value = DataTypes.getValue(option, idField);
|
|
108
108
|
if (value == null) return null;
|
|
109
109
|
return value as D;
|
|
110
110
|
};
|
|
@@ -299,7 +299,7 @@ export function ScrollerListEx<T extends Record<string, unknown>>(
|
|
|
299
299
|
innerItemRenderer,
|
|
300
300
|
itemSize,
|
|
301
301
|
itemKey = (index: number, data: T) =>
|
|
302
|
-
DataTypes.
|
|
302
|
+
DataTypes.getValue(data, idField) ?? index,
|
|
303
303
|
itemRenderer = (itemProps) => {
|
|
304
304
|
const [itemHeight, space, margins] = calculateItemSize(
|
|
305
305
|
itemProps.index
|
package/src/mu/TableEx.tsx
CHANGED
|
@@ -441,7 +441,7 @@ export function TableEx<T extends Record<string, unknown>>(
|
|
|
441
441
|
|
|
442
442
|
// Row id field value
|
|
443
443
|
const rowId =
|
|
444
|
-
DataTypes.
|
|
444
|
+
DataTypes.getValue(row, idField) ?? rowIndex;
|
|
445
445
|
|
|
446
446
|
// Selected or not
|
|
447
447
|
const isItemSelected = selectable
|