@ai-matrx/records-ui 0.88.0 → 0.88.1
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/CHANGELOG.md +15 -1
- package/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5209,17 +5209,22 @@ function useMergedGridControls(args) {
|
|
|
5209
5209
|
const known = new Set(fieldKeys);
|
|
5210
5210
|
return (held?.hidden ?? keptHidden ?? []).filter((k) => known.has(k));
|
|
5211
5211
|
}, [held, keptHidden, fieldKeys]);
|
|
5212
|
+
const naturalOrder = useMemo12(
|
|
5213
|
+
() => [...fieldKeys.filter((k) => frozenKeys.has(k)), ...fieldKeys.filter((k) => !frozenKeys.has(k))],
|
|
5214
|
+
[fieldKeys, frozenKeys]
|
|
5215
|
+
);
|
|
5212
5216
|
const keepColumns = useCallback5(
|
|
5213
5217
|
(next) => {
|
|
5214
5218
|
setHeld(next);
|
|
5215
5219
|
const { columnOrder: _o, hiddenFields: _h, ...rest } = presentation;
|
|
5220
|
+
const moved = next.order.length > 0 && next.order.join("\0") !== naturalOrder.join("\0");
|
|
5216
5221
|
writeLook({
|
|
5217
5222
|
...rest,
|
|
5218
|
-
...
|
|
5223
|
+
...moved ? { columnOrder: next.order } : {},
|
|
5219
5224
|
...next.hidden.length > 0 ? { hiddenFields: next.hidden } : {}
|
|
5220
5225
|
});
|
|
5221
5226
|
},
|
|
5222
|
-
[presentation, writeLook]
|
|
5227
|
+
[presentation, writeLook, naturalOrder]
|
|
5223
5228
|
);
|
|
5224
5229
|
const pendingInsert = useRef5(null);
|
|
5225
5230
|
useEffect11(() => {
|