blixify-ui-web 1.2.96 → 1.2.97
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AA0Ff,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AA0D1B,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AA0Ff,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AA0D1B,eAAO,MAAM,YAAY,mFAipZvB,CAAC"}
|
|
@@ -389,6 +389,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
389
389
|
var _117 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
390
390
|
? persistedState.flexFilters
|
|
391
391
|
: defaultFlexFilterRow), flexFilters = _117[0], setFlexFilters = _117[1];
|
|
392
|
+
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
393
|
+
// clear methods so chained calls in one tick aren't stale.
|
|
394
|
+
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
395
|
+
// INFO: NOT redundant with the synchronous write in handleCommitFlexFilters —
|
|
396
|
+
// that only covers same-tick chaining. This effect resyncs the ref after the
|
|
397
|
+
// OTHER handlers (add/remove/value/etc.) call setFlexFilters without touching
|
|
398
|
+
// it, so a later imperative call doesn't read a stale ref. Do not remove.
|
|
399
|
+
(0, react_1.useEffect)(function () {
|
|
400
|
+
flexFiltersRef.current = flexFilters;
|
|
401
|
+
}, [flexFilters]);
|
|
392
402
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
393
403
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
394
404
|
var _118 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
@@ -867,15 +877,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
867
877
|
setFlexFiltersDebounced(updatedFilters);
|
|
868
878
|
setPageIndex(0);
|
|
869
879
|
};
|
|
880
|
+
// INFO: commits a flex filter change — advances the ref synchronously (so a
|
|
881
|
+
// chained call in the same tick reads this result) then sets UI + debounced.
|
|
882
|
+
var handleCommitFlexFilters = function (next) {
|
|
883
|
+
flexFiltersRef.current = next;
|
|
884
|
+
setFlexFilters(next);
|
|
885
|
+
setFlexFiltersDebounced(next);
|
|
886
|
+
};
|
|
870
887
|
// INFO: applies flex filters from a parent, merged by columnId (incoming
|
|
871
888
|
// replaces same-column rows so no contradictory AND; other columns kept).
|
|
872
889
|
var handleApplyFlexFilters = function (incoming) {
|
|
873
890
|
handleClearFlexFilterTypingTimeout();
|
|
874
891
|
var incomingColumnIds = new Set(incoming.map(function (f) { return f.columnId; }));
|
|
875
|
-
var retained =
|
|
876
|
-
|
|
877
|
-
setFlexFilters(merged);
|
|
878
|
-
setFlexFiltersDebounced(merged);
|
|
892
|
+
var retained = flexFiltersRef.current.filter(function (f) { return f.columnId && !incomingColumnIds.has(f.columnId); });
|
|
893
|
+
handleCommitFlexFilters(__spreadArray(__spreadArray([], retained, true), incoming, true));
|
|
879
894
|
setPageIndex(0);
|
|
880
895
|
};
|
|
881
896
|
// INFO: clears flex filters by columnId (other columns preserved), or all
|
|
@@ -883,13 +898,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
883
898
|
var handleClearFlexFilters = function (columnIds) {
|
|
884
899
|
handleClearFlexFilterTypingTimeout();
|
|
885
900
|
var remaining = columnIds && columnIds.length > 0
|
|
886
|
-
?
|
|
901
|
+
? flexFiltersRef.current.filter(function (f) { return f.columnId && !columnIds.includes(f.columnId); })
|
|
887
902
|
: [];
|
|
888
|
-
|
|
903
|
+
handleCommitFlexFilters(remaining.length > 0
|
|
889
904
|
? remaining
|
|
890
|
-
: [{ id: (0, uuid_1.v4)(), columnId: "", operator: "=", value: undefined }];
|
|
891
|
-
setFlexFilters(updatedFilters);
|
|
892
|
-
setFlexFiltersDebounced(updatedFilters);
|
|
905
|
+
: [{ id: (0, uuid_1.v4)(), columnId: "", operator: "=", value: undefined }]);
|
|
893
906
|
setPageIndex(0);
|
|
894
907
|
};
|
|
895
908
|
var handleFlexFilterColumnChange = function (filterId, columnId) {
|