@teselagen/ui 0.5.23-beta.3 → 0.5.23-beta.4
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/DataTable/utils/index.d.ts +2 -1
- package/DataTable/utils/useTableEntities.d.ts +5 -0
- package/index.cjs.js +279 -175
- package/index.d.ts +1 -1
- package/index.es.js +280 -176
- package/package.json +1 -5
- package/src/DataTable/index.js +180 -129
- package/src/DataTable/utils/index.js +3 -1
- package/src/DataTable/utils/useTableEntities.js +41 -0
- package/src/DataTable/utils/useTableParams.js +0 -1
- package/src/index.js +1 -1
- package/FormComponents/AbstractField.d.ts +0 -1
- package/src/FormComponents/AbstractField.js +0 -388
|
@@ -19,5 +19,6 @@ import { isEntityClean } from './isEntityClean';
|
|
|
19
19
|
import { PRIMARY_SELECTED_VAL } from './primarySelectedValue';
|
|
20
20
|
import { removeCleanRows } from './removeCleanRows';
|
|
21
21
|
import { useDeepEqualMemo } from './useDeepEqualMemo';
|
|
22
|
+
import { useTableEntities } from './useTableEntities';
|
|
22
23
|
|
|
23
|
-
export { defaultParsePaste, formatPasteData, getAllRows, getCellCopyText, getCellInfo, getEntityIdToEntity, getFieldPathToIndex, getFieldPathToField, getIdOrCodeOrIndex, getLastSelectedEntity, getNewEntToSelect, getNumberStrAtEnd, getRecordsFromIdMap, getRowCopyText, getSelectedRowsFromEntities, handleCopyColumn, handleCopyHelper, handleCopyRows, handleCopyTable, isBottomRightCornerOfRectangle, isEntityClean, PRIMARY_SELECTED_VAL, removeCleanRows, stripNumberAtEnd, useDeepEqualMemo };
|
|
24
|
+
export { defaultParsePaste, formatPasteData, getAllRows, getCellCopyText, getCellInfo, getEntityIdToEntity, getFieldPathToIndex, getFieldPathToField, getIdOrCodeOrIndex, getLastSelectedEntity, getNewEntToSelect, getNumberStrAtEnd, getRecordsFromIdMap, getRowCopyText, getSelectedRowsFromEntities, handleCopyColumn, handleCopyHelper, handleCopyRows, handleCopyTable, isBottomRightCornerOfRectangle, isEntityClean, PRIMARY_SELECTED_VAL, removeCleanRows, stripNumberAtEnd, useDeepEqualMemo, useTableEntities };
|
package/index.cjs.js
CHANGED
|
@@ -3123,63 +3123,89 @@ function getAugmentedNamespace(n2) {
|
|
|
3123
3123
|
}
|
|
3124
3124
|
__name(getAugmentedNamespace, "getAugmentedNamespace");
|
|
3125
3125
|
var propTypes$1 = { exports: {} };
|
|
3126
|
-
var
|
|
3127
|
-
var
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3126
|
+
var ReactPropTypesSecret_1;
|
|
3127
|
+
var hasRequiredReactPropTypesSecret;
|
|
3128
|
+
function requireReactPropTypesSecret() {
|
|
3129
|
+
if (hasRequiredReactPropTypesSecret)
|
|
3130
|
+
return ReactPropTypesSecret_1;
|
|
3131
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
3132
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
3133
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
3134
|
+
return ReactPropTypesSecret_1;
|
|
3135
|
+
}
|
|
3136
|
+
__name(requireReactPropTypesSecret, "requireReactPropTypesSecret");
|
|
3137
|
+
var factoryWithThrowingShims;
|
|
3138
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
3139
|
+
function requireFactoryWithThrowingShims() {
|
|
3140
|
+
if (hasRequiredFactoryWithThrowingShims)
|
|
3141
|
+
return factoryWithThrowingShims;
|
|
3142
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
3143
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
3144
|
+
function emptyFunction() {
|
|
3145
|
+
}
|
|
3146
|
+
__name(emptyFunction, "emptyFunction");
|
|
3147
|
+
function emptyFunctionWithReset() {
|
|
3148
|
+
}
|
|
3149
|
+
__name(emptyFunctionWithReset, "emptyFunctionWithReset");
|
|
3150
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3151
|
+
factoryWithThrowingShims = /* @__PURE__ */ __name(function() {
|
|
3152
|
+
function shim(props, propName, componentName, location2, propFullName, secret) {
|
|
3153
|
+
if (secret === ReactPropTypesSecret) {
|
|
3154
|
+
return;
|
|
3155
|
+
}
|
|
3156
|
+
var err = new Error(
|
|
3157
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
3158
|
+
);
|
|
3159
|
+
err.name = "Invariant Violation";
|
|
3160
|
+
throw err;
|
|
3140
3161
|
}
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
)
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3162
|
+
__name(shim, "shim");
|
|
3163
|
+
shim.isRequired = shim;
|
|
3164
|
+
function getShim() {
|
|
3165
|
+
return shim;
|
|
3166
|
+
}
|
|
3167
|
+
__name(getShim, "getShim");
|
|
3168
|
+
var ReactPropTypes = {
|
|
3169
|
+
array: shim,
|
|
3170
|
+
bigint: shim,
|
|
3171
|
+
bool: shim,
|
|
3172
|
+
func: shim,
|
|
3173
|
+
number: shim,
|
|
3174
|
+
object: shim,
|
|
3175
|
+
string: shim,
|
|
3176
|
+
symbol: shim,
|
|
3177
|
+
any: shim,
|
|
3178
|
+
arrayOf: getShim,
|
|
3179
|
+
element: shim,
|
|
3180
|
+
elementType: shim,
|
|
3181
|
+
instanceOf: getShim,
|
|
3182
|
+
node: shim,
|
|
3183
|
+
objectOf: getShim,
|
|
3184
|
+
oneOf: getShim,
|
|
3185
|
+
oneOfType: getShim,
|
|
3186
|
+
shape: getShim,
|
|
3187
|
+
exact: getShim,
|
|
3188
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
3189
|
+
resetWarningCache: emptyFunction
|
|
3190
|
+
};
|
|
3191
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3192
|
+
return ReactPropTypes;
|
|
3193
|
+
}, "factoryWithThrowingShims");
|
|
3194
|
+
return factoryWithThrowingShims;
|
|
3195
|
+
}
|
|
3196
|
+
__name(requireFactoryWithThrowingShims, "requireFactoryWithThrowingShims");
|
|
3197
|
+
var hasRequiredPropTypes;
|
|
3198
|
+
function requirePropTypes() {
|
|
3199
|
+
if (hasRequiredPropTypes)
|
|
3200
|
+
return propTypes$1.exports;
|
|
3201
|
+
hasRequiredPropTypes = 1;
|
|
3202
|
+
{
|
|
3203
|
+
propTypes$1.exports = requireFactoryWithThrowingShims()();
|
|
3204
|
+
}
|
|
3205
|
+
return propTypes$1.exports;
|
|
3181
3206
|
}
|
|
3182
|
-
|
|
3207
|
+
__name(requirePropTypes, "requirePropTypes");
|
|
3208
|
+
var propTypesExports = requirePropTypes();
|
|
3183
3209
|
const PropTypes$1 = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
3184
3210
|
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
3185
3211
|
function adopt(value) {
|
|
@@ -13470,7 +13496,7 @@ var reactList = {};
|
|
|
13470
13496
|
(function(exports2) {
|
|
13471
13497
|
(function(global2, factory) {
|
|
13472
13498
|
{
|
|
13473
|
-
factory(exports2,
|
|
13499
|
+
factory(exports2, requirePropTypes(), React$1);
|
|
13474
13500
|
}
|
|
13475
13501
|
})(commonjsGlobal, function(_exports, _propTypes2, _react3) {
|
|
13476
13502
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -17154,6 +17180,43 @@ const useDeepEqualMemo = /* @__PURE__ */ __name((value) => {
|
|
|
17154
17180
|
}
|
|
17155
17181
|
return ref2.current;
|
|
17156
17182
|
}, "useDeepEqualMemo");
|
|
17183
|
+
const useTableEntities = /* @__PURE__ */ __name((tableFormName) => {
|
|
17184
|
+
const dispatch = reactRedux.useDispatch();
|
|
17185
|
+
const selectTableEntities = React$1.useCallback(
|
|
17186
|
+
(entities = []) => {
|
|
17187
|
+
reduxForm.initialize(tableFormName, {}, true, {
|
|
17188
|
+
keepDirty: true,
|
|
17189
|
+
updateUnregisteredFields: true,
|
|
17190
|
+
keepValues: true
|
|
17191
|
+
});
|
|
17192
|
+
const selectedEntityIdMap = {};
|
|
17193
|
+
entities.forEach((entity) => {
|
|
17194
|
+
selectedEntityIdMap[entity.id] = {
|
|
17195
|
+
entity,
|
|
17196
|
+
time: Date.now()
|
|
17197
|
+
};
|
|
17198
|
+
});
|
|
17199
|
+
dispatch(
|
|
17200
|
+
reduxForm.change(
|
|
17201
|
+
tableFormName,
|
|
17202
|
+
"reduxFormSelectedEntityIdMap",
|
|
17203
|
+
selectedEntityIdMap
|
|
17204
|
+
)
|
|
17205
|
+
);
|
|
17206
|
+
},
|
|
17207
|
+
[dispatch, tableFormName]
|
|
17208
|
+
);
|
|
17209
|
+
const { allOrderedEntities = [], selectedEntities = {} } = reactRedux.useSelector(
|
|
17210
|
+
(state) => {
|
|
17211
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17212
|
+
return {
|
|
17213
|
+
allOrderedEntities: (_c = (_b = (_a = state.form) == null ? void 0 : _a[tableFormName]) == null ? void 0 : _b.values) == null ? void 0 : _c.allOrderedEntities,
|
|
17214
|
+
selectedEntities: (_f = (_e = (_d = state.form) == null ? void 0 : _d[tableFormName]) == null ? void 0 : _e.values) == null ? void 0 : _f.reduxFormSelectedEntityIdMap
|
|
17215
|
+
};
|
|
17216
|
+
}
|
|
17217
|
+
);
|
|
17218
|
+
return { selectTableEntities, allOrderedEntities, selectedEntities };
|
|
17219
|
+
}, "useTableEntities");
|
|
17157
17220
|
function rowClick(e2, rowInfo, entities, {
|
|
17158
17221
|
reduxFormSelectedEntityIdMap,
|
|
17159
17222
|
isSingleSelect,
|
|
@@ -48453,7 +48516,7 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
48453
48516
|
doNotValidateUntouchedRows,
|
|
48454
48517
|
editingCellSelectAll,
|
|
48455
48518
|
entities: __origEntities = [],
|
|
48456
|
-
entitiesAcrossPages,
|
|
48519
|
+
entitiesAcrossPages: _entitiesAcrossPages,
|
|
48457
48520
|
entityCount,
|
|
48458
48521
|
errorParsingUrlString,
|
|
48459
48522
|
expandAllByDefault,
|
|
@@ -48537,6 +48600,17 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
48537
48600
|
const entities = useDeepEqualMemo(
|
|
48538
48601
|
((reduxFormEntities == null ? void 0 : reduxFormEntities.length) ? reduxFormEntities : _origEntities) || []
|
|
48539
48602
|
);
|
|
48603
|
+
const entitiesAcrossPages = useDeepEqualMemo(_entitiesAcrossPages);
|
|
48604
|
+
React$1.useEffect(() => {
|
|
48605
|
+
change("allOrderedEntities", entitiesAcrossPages);
|
|
48606
|
+
if (entities.length === 0 || isEmpty$1(reduxFormSelectedEntityIdMap))
|
|
48607
|
+
return;
|
|
48608
|
+
changeSelectedEntities({
|
|
48609
|
+
idMap: reduxFormSelectedEntityIdMap,
|
|
48610
|
+
entities,
|
|
48611
|
+
change
|
|
48612
|
+
});
|
|
48613
|
+
}, [entitiesAcrossPages, reduxFormSelectedEntityIdMap]);
|
|
48540
48614
|
const [tableConfig, setTableConfig] = React$1.useState({ fieldOptions: [] });
|
|
48541
48615
|
React$1.useEffect(() => {
|
|
48542
48616
|
let newTableConfig = {};
|
|
@@ -50283,23 +50357,29 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
50283
50357
|
acc.push(field.filterKey);
|
|
50284
50358
|
return acc;
|
|
50285
50359
|
}, []);
|
|
50286
|
-
const filtersOnNonDisplayedFields =
|
|
50287
|
-
|
|
50288
|
-
|
|
50289
|
-
|
|
50290
|
-
|
|
50291
|
-
|
|
50292
|
-
|
|
50293
|
-
|
|
50294
|
-
|
|
50295
|
-
|
|
50296
|
-
|
|
50297
|
-
|
|
50298
|
-
|
|
50299
|
-
|
|
50300
|
-
|
|
50360
|
+
const filtersOnNonDisplayedFields = React$1.useMemo(() => {
|
|
50361
|
+
const _filtersOnNonDisplayedFields = [];
|
|
50362
|
+
if (filters && filters.length) {
|
|
50363
|
+
schema.fields.forEach((field) => {
|
|
50364
|
+
const ccDisplayName = getCCDisplayName(field);
|
|
50365
|
+
if (field.isHidden) {
|
|
50366
|
+
filters.forEach((filter2) => {
|
|
50367
|
+
if (filter2.filterOn === ccDisplayName) {
|
|
50368
|
+
_filtersOnNonDisplayedFields.push(__spreadProps(__spreadValues({}, filter2), {
|
|
50369
|
+
displayName: field.displayName
|
|
50370
|
+
}));
|
|
50371
|
+
}
|
|
50372
|
+
});
|
|
50373
|
+
}
|
|
50374
|
+
});
|
|
50375
|
+
}
|
|
50376
|
+
return _filtersOnNonDisplayedFields;
|
|
50377
|
+
}, [filters, schema.fields]);
|
|
50301
50378
|
const numRows = isInfinite ? entities.length : pageSize;
|
|
50302
|
-
const idMap =
|
|
50379
|
+
const idMap = React$1.useMemo(
|
|
50380
|
+
() => reduxFormSelectedEntityIdMap || {},
|
|
50381
|
+
[reduxFormSelectedEntityIdMap]
|
|
50382
|
+
);
|
|
50303
50383
|
const selectedRowCount = Object.keys(idMap).filter((key) => idMap[key]).length;
|
|
50304
50384
|
let rowsToShow = doNotShowEmptyRows ? Math.min(numRows, entities.length) : numRows;
|
|
50305
50385
|
if (entities.length === 0 && rowsToShow < 3)
|
|
@@ -50323,109 +50403,132 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
50323
50403
|
onClick: () => setFullscreen((prev) => !prev)
|
|
50324
50404
|
}
|
|
50325
50405
|
);
|
|
50326
|
-
|
|
50327
|
-
|
|
50328
|
-
|
|
50329
|
-
|
|
50330
|
-
|
|
50331
|
-
|
|
50332
|
-
|
|
50333
|
-
const
|
|
50334
|
-
|
|
50335
|
-
|
|
50336
|
-
|
|
50337
|
-
|
|
50338
|
-
|
|
50339
|
-
|
|
50340
|
-
|
|
50341
|
-
|
|
50342
|
-
|
|
50343
|
-
|
|
50344
|
-
|
|
50345
|
-
|
|
50346
|
-
|
|
50347
|
-
|
|
50348
|
-
|
|
50349
|
-
|
|
50350
|
-
|
|
50406
|
+
const { showSelectAll, showClearAll } = React$1.useMemo(() => {
|
|
50407
|
+
let _showSelectAll = false;
|
|
50408
|
+
let _showClearAll = false;
|
|
50409
|
+
if (!isInfinite) {
|
|
50410
|
+
const canShowSelectAll = withSelectAll || entitiesAcrossPages && numRows < entitiesAcrossPages.length;
|
|
50411
|
+
if (canShowSelectAll) {
|
|
50412
|
+
let atLeastOneRowOnCurrentPageSelected = false;
|
|
50413
|
+
const allRowsOnCurrentPageSelected = entities.every((e2) => {
|
|
50414
|
+
const rowId = getIdOrCodeOrIndex(e2);
|
|
50415
|
+
const selected = idMap[rowId] || isEntityDisabled(e2);
|
|
50416
|
+
if (selected)
|
|
50417
|
+
atLeastOneRowOnCurrentPageSelected = true;
|
|
50418
|
+
return selected;
|
|
50419
|
+
});
|
|
50420
|
+
if (atLeastOneRowOnCurrentPageSelected && allRowsOnCurrentPageSelected) {
|
|
50421
|
+
let everyEntitySelected;
|
|
50422
|
+
if (isLocalCall) {
|
|
50423
|
+
everyEntitySelected = entitiesAcrossPages.every((e2) => {
|
|
50424
|
+
const rowId = getIdOrCodeOrIndex(e2);
|
|
50425
|
+
return idMap[rowId] || isEntityDisabled(e2);
|
|
50426
|
+
});
|
|
50427
|
+
} else {
|
|
50428
|
+
everyEntitySelected = entityCount <= selectedRowCount;
|
|
50429
|
+
}
|
|
50430
|
+
if (everyEntitySelected) {
|
|
50431
|
+
_showClearAll = selectedRowCount;
|
|
50432
|
+
}
|
|
50433
|
+
_showSelectAll = !everyEntitySelected;
|
|
50351
50434
|
}
|
|
50352
|
-
showSelectAll = !everyEntitySelected;
|
|
50353
50435
|
}
|
|
50354
50436
|
}
|
|
50355
|
-
|
|
50437
|
+
return { showSelectAll: _showSelectAll, showClearAll: _showClearAll };
|
|
50438
|
+
}, [
|
|
50439
|
+
entities,
|
|
50440
|
+
entitiesAcrossPages,
|
|
50441
|
+
entityCount,
|
|
50442
|
+
idMap,
|
|
50443
|
+
isEntityDisabled,
|
|
50444
|
+
isInfinite,
|
|
50445
|
+
isLocalCall,
|
|
50446
|
+
numRows,
|
|
50447
|
+
selectedRowCount,
|
|
50448
|
+
withSelectAll
|
|
50449
|
+
]);
|
|
50356
50450
|
const showNumSelected = !noSelect && !isSingleSelect && !hideSelectedCount;
|
|
50357
|
-
|
|
50358
|
-
|
|
50359
|
-
|
|
50360
|
-
|
|
50361
|
-
|
|
50362
|
-
|
|
50363
|
-
|
|
50364
|
-
|
|
50365
|
-
|
|
50366
|
-
|
|
50367
|
-
|
|
50368
|
-
|
|
50369
|
-
|
|
50451
|
+
const selectedAndTotalMessage = React$1.useMemo(() => {
|
|
50452
|
+
let _selectedAndTotalMessage = "";
|
|
50453
|
+
if (showNumSelected) {
|
|
50454
|
+
_selectedAndTotalMessage += `${selectedRowCount} Selected `;
|
|
50455
|
+
}
|
|
50456
|
+
if (showCount && showNumSelected) {
|
|
50457
|
+
_selectedAndTotalMessage += `/ `;
|
|
50458
|
+
}
|
|
50459
|
+
if (showCount) {
|
|
50460
|
+
_selectedAndTotalMessage += `${entityCount || 0} Total`;
|
|
50461
|
+
}
|
|
50462
|
+
if (_selectedAndTotalMessage) {
|
|
50463
|
+
_selectedAndTotalMessage = /* @__PURE__ */ React$1.createElement("div", null, _selectedAndTotalMessage);
|
|
50464
|
+
}
|
|
50465
|
+
return _selectedAndTotalMessage;
|
|
50466
|
+
}, [entityCount, selectedRowCount, showCount, showNumSelected]);
|
|
50370
50467
|
const shouldShowPaging = !isInfinite && withPaging && (hidePageSizeWhenPossible ? entityCount > pageSize : true);
|
|
50371
|
-
|
|
50372
|
-
|
|
50373
|
-
|
|
50374
|
-
|
|
50375
|
-
|
|
50376
|
-
|
|
50377
|
-
}
|
|
50378
|
-
if (shouldShow) {
|
|
50379
|
-
return SubComponent(row);
|
|
50380
|
-
}
|
|
50381
|
-
}, "SubComponentToUse");
|
|
50382
|
-
}
|
|
50383
|
-
let nonDisplayedFilterComp;
|
|
50384
|
-
if (filtersOnNonDisplayedFields.length) {
|
|
50385
|
-
const content2 = filtersOnNonDisplayedFields.map(
|
|
50386
|
-
({ displayName, path: path2, selectedFilter, filterValue }) => {
|
|
50387
|
-
let filterValToDisplay = filterValue;
|
|
50388
|
-
if (selectedFilter === "inList") {
|
|
50389
|
-
filterValToDisplay = Array.isArray(filterValToDisplay) ? filterValToDisplay : filterValToDisplay && filterValToDisplay.split(";");
|
|
50468
|
+
const SubComponentToUse = React$1.useMemo(() => {
|
|
50469
|
+
if (SubComponent) {
|
|
50470
|
+
return (row) => {
|
|
50471
|
+
let shouldShow = true;
|
|
50472
|
+
if (shouldShowSubComponent) {
|
|
50473
|
+
shouldShow = shouldShowSubComponent(row.original);
|
|
50390
50474
|
}
|
|
50391
|
-
if (
|
|
50392
|
-
|
|
50475
|
+
if (shouldShow) {
|
|
50476
|
+
return SubComponent(row);
|
|
50393
50477
|
}
|
|
50394
|
-
|
|
50395
|
-
|
|
50396
|
-
|
|
50397
|
-
|
|
50398
|
-
|
|
50399
|
-
|
|
50400
|
-
|
|
50401
|
-
|
|
50402
|
-
|
|
50403
|
-
"
|
|
50404
|
-
|
|
50405
|
-
|
|
50406
|
-
|
|
50407
|
-
|
|
50408
|
-
|
|
50409
|
-
|
|
50410
|
-
|
|
50411
|
-
|
|
50412
|
-
|
|
50413
|
-
|
|
50414
|
-
|
|
50415
|
-
|
|
50416
|
-
|
|
50417
|
-
|
|
50418
|
-
|
|
50419
|
-
|
|
50420
|
-
|
|
50421
|
-
|
|
50422
|
-
|
|
50423
|
-
}
|
|
50424
|
-
|
|
50425
|
-
|
|
50426
|
-
|
|
50427
|
-
|
|
50428
|
-
|
|
50478
|
+
};
|
|
50479
|
+
}
|
|
50480
|
+
return;
|
|
50481
|
+
}, [SubComponent, shouldShowSubComponent]);
|
|
50482
|
+
const nonDisplayedFilterComp = React$1.useMemo(() => {
|
|
50483
|
+
if (filtersOnNonDisplayedFields.length) {
|
|
50484
|
+
const content2 = filtersOnNonDisplayedFields.map(
|
|
50485
|
+
({ displayName, path: path2, selectedFilter, filterValue }) => {
|
|
50486
|
+
let filterValToDisplay = filterValue;
|
|
50487
|
+
if (selectedFilter === "inList") {
|
|
50488
|
+
filterValToDisplay = Array.isArray(filterValToDisplay) ? filterValToDisplay : filterValToDisplay && filterValToDisplay.split(";");
|
|
50489
|
+
}
|
|
50490
|
+
if (Array.isArray(filterValToDisplay)) {
|
|
50491
|
+
filterValToDisplay = filterValToDisplay.join(", ");
|
|
50492
|
+
}
|
|
50493
|
+
return /* @__PURE__ */ React$1.createElement(
|
|
50494
|
+
"div",
|
|
50495
|
+
{
|
|
50496
|
+
key: displayName || startCase(camelCase(path2)),
|
|
50497
|
+
className: "tg-filter-on-non-displayed-field"
|
|
50498
|
+
},
|
|
50499
|
+
displayName || startCase(camelCase(path2)),
|
|
50500
|
+
" ",
|
|
50501
|
+
lowerCase(selectedFilter),
|
|
50502
|
+
" ",
|
|
50503
|
+
filterValToDisplay
|
|
50504
|
+
);
|
|
50505
|
+
}
|
|
50506
|
+
);
|
|
50507
|
+
return /* @__PURE__ */ React$1.createElement("div", { style: { marginRight: 5, marginLeft: "auto" } }, /* @__PURE__ */ React$1.createElement(
|
|
50508
|
+
core.Tooltip,
|
|
50509
|
+
{
|
|
50510
|
+
content: /* @__PURE__ */ React$1.createElement("div", null, "Active filters on hidden columns:", /* @__PURE__ */ React$1.createElement("br", null), /* @__PURE__ */ React$1.createElement("br", null), content2)
|
|
50511
|
+
},
|
|
50512
|
+
/* @__PURE__ */ React$1.createElement(core.Icon, { icon: "filter-list" })
|
|
50513
|
+
));
|
|
50514
|
+
}
|
|
50515
|
+
return null;
|
|
50516
|
+
}, [filtersOnNonDisplayedFields]);
|
|
50517
|
+
const filteredEnts = React$1.useMemo(() => {
|
|
50518
|
+
if (onlyShowRowsWErrors) {
|
|
50519
|
+
const rowToErrorMap = {};
|
|
50520
|
+
forEach(reduxFormCellValidation, (err, cellId) => {
|
|
50521
|
+
if (err) {
|
|
50522
|
+
const [rowId] = cellId.split(":");
|
|
50523
|
+
rowToErrorMap[rowId] = true;
|
|
50524
|
+
}
|
|
50525
|
+
});
|
|
50526
|
+
return entities.filter((e2) => {
|
|
50527
|
+
return rowToErrorMap[e2.id];
|
|
50528
|
+
});
|
|
50529
|
+
}
|
|
50530
|
+
return entities;
|
|
50531
|
+
}, [entities, onlyShowRowsWErrors, reduxFormCellValidation]);
|
|
50429
50532
|
const renderColumns = React$1.useMemo(
|
|
50430
50533
|
() => RenderColumns(__spreadProps(__spreadValues({}, props), {
|
|
50431
50534
|
addFilters,
|
|
@@ -65133,7 +65236,7 @@ Object.defineProperty(DraggableCore$2, "__esModule", {
|
|
|
65133
65236
|
});
|
|
65134
65237
|
DraggableCore$2.default = void 0;
|
|
65135
65238
|
var React = _interopRequireWildcard$1(React$1);
|
|
65136
|
-
var _propTypes = _interopRequireDefault$2(
|
|
65239
|
+
var _propTypes = _interopRequireDefault$2(requirePropTypes());
|
|
65137
65240
|
var _reactDom$1 = _interopRequireDefault$2(require$$2$1);
|
|
65138
65241
|
var _domFns = domFns;
|
|
65139
65242
|
var _positionFns = positionFns;
|
|
@@ -65725,7 +65828,7 @@ _defineProperty(DraggableCore$1, "defaultProps", {
|
|
|
65725
65828
|
});
|
|
65726
65829
|
exports2.default = void 0;
|
|
65727
65830
|
var React2 = _interopRequireWildcard2(React$1);
|
|
65728
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
65831
|
+
var _propTypes2 = _interopRequireDefault2(requirePropTypes());
|
|
65729
65832
|
var _reactDom2 = _interopRequireDefault2(require$$2$1);
|
|
65730
65833
|
var _clsx2 = _interopRequireDefault2(require$$3);
|
|
65731
65834
|
var _domFns2 = domFns;
|
|
@@ -69542,7 +69645,7 @@ var Transition$1 = {};
|
|
|
69542
69645
|
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(reactLifecyclesCompat_es);
|
|
69543
69646
|
Transition$1.__esModule = true;
|
|
69544
69647
|
Transition$1.default = Transition$1.EXITING = Transition$1.ENTERED = Transition$1.ENTERING = Transition$1.EXITED = Transition$1.UNMOUNTED = void 0;
|
|
69545
|
-
var PropTypes = _interopRequireWildcard(
|
|
69648
|
+
var PropTypes = _interopRequireWildcard(requirePropTypes());
|
|
69546
69649
|
var _react$1 = _interopRequireDefault$1(React$1);
|
|
69547
69650
|
var _reactDom = _interopRequireDefault$1(require$$2$1);
|
|
69548
69651
|
var _reactLifecyclesCompat = require$$2;
|
|
@@ -69860,7 +69963,7 @@ Transition$1.default = _default;
|
|
|
69860
69963
|
(function(module2, exports2) {
|
|
69861
69964
|
exports2.__esModule = true;
|
|
69862
69965
|
exports2.default = void 0;
|
|
69863
|
-
_interopRequireWildcard2(
|
|
69966
|
+
_interopRequireWildcard2(requirePropTypes());
|
|
69864
69967
|
var _addClass = _interopRequireDefault2(addClassExports);
|
|
69865
69968
|
var _removeClass = _interopRequireDefault2(removeClass);
|
|
69866
69969
|
var _react3 = _interopRequireDefault2(React$1);
|
|
@@ -70143,7 +70246,7 @@ __name(getNextChildMapping, "getNextChildMapping");
|
|
|
70143
70246
|
(function(module2, exports2) {
|
|
70144
70247
|
exports2.__esModule = true;
|
|
70145
70248
|
exports2.default = void 0;
|
|
70146
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
70249
|
+
var _propTypes2 = _interopRequireDefault2(requirePropTypes());
|
|
70147
70250
|
var _react3 = _interopRequireDefault2(React$1);
|
|
70148
70251
|
var _reactLifecyclesCompat2 = require$$2;
|
|
70149
70252
|
var _ChildMapping = ChildMapping;
|
|
@@ -70297,7 +70400,7 @@ var TransitionGroupExports = TransitionGroup.exports;
|
|
|
70297
70400
|
(function(module2, exports2) {
|
|
70298
70401
|
exports2.__esModule = true;
|
|
70299
70402
|
exports2.default = void 0;
|
|
70300
|
-
_interopRequireDefault2(
|
|
70403
|
+
_interopRequireDefault2(requirePropTypes());
|
|
70301
70404
|
var _react3 = _interopRequireDefault2(React$1);
|
|
70302
70405
|
var _reactDom2 = require$$2$1;
|
|
70303
70406
|
var _TransitionGroup2 = _interopRequireDefault2(TransitionGroupExports);
|
|
@@ -70634,6 +70737,7 @@ exports.tickMenuEnhancer = tickMenuEnhancer;
|
|
|
70634
70737
|
exports.tubeIcon = tubeIcon;
|
|
70635
70738
|
exports.useDeepEqualMemo = useDeepEqualMemo;
|
|
70636
70739
|
exports.useDialog = useDialog;
|
|
70740
|
+
exports.useTableEntities = useTableEntities;
|
|
70637
70741
|
exports.useTraceUpdate = useTraceUpdate;
|
|
70638
70742
|
exports.withAbstractWrapper = withAbstractWrapper;
|
|
70639
70743
|
exports.withCommand = withCommand;
|
package/index.d.ts
CHANGED
|
@@ -58,5 +58,5 @@ export { mergeSchemas, default as convertSchema } from './DataTable/utils/conver
|
|
|
58
58
|
export { getCurrentParamsFromUrl, setCurrentParamsOnUrl } from './DataTable/utils/queryParams';
|
|
59
59
|
export { default as withSelectedEntities, getSelectedEntities } from './DataTable/utils/withSelectedEntities';
|
|
60
60
|
export { default as DataTable, ConnectedPagingTool as PagingTool } from './DataTable';
|
|
61
|
-
export { removeCleanRows, getIdOrCodeOrIndex, useDeepEqualMemo } from './DataTable/utils';
|
|
61
|
+
export { removeCleanRows, useTableEntities, getIdOrCodeOrIndex, useDeepEqualMemo } from './DataTable/utils';
|
|
62
62
|
export { default as Timeline, TimelineEvent } from './Timeline';
|