blixify-ui-web 1.2.95 → 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.
Files changed (28) hide show
  1. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  2. package/lib/components/data/dataTemplate/index.js +47 -0
  3. package/lib/components/data/dataTemplate/index.js.map +1 -1
  4. package/lib/components/data/dataTemplate/model.d.ts +2 -0
  5. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  6. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +1 -1
  7. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
  8. package/lib/components/data/dataWrapper/index.d.ts +3 -0
  9. package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
  10. package/lib/components/data/dataWrapper/index.js +12 -0
  11. package/lib/components/data/dataWrapper/index.js.map +1 -1
  12. package/lib/components/data/flexFilter/index.d.ts +1 -7
  13. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  14. package/lib/components/data/flexFilter/index.js +3 -0
  15. package/lib/components/data/flexFilter/index.js.map +1 -1
  16. package/lib/components/data/flexFilter/model.d.ts +8 -0
  17. package/lib/components/data/flexFilter/model.d.ts.map +1 -0
  18. package/lib/components/data/flexFilter/model.js +6 -0
  19. package/lib/components/data/flexFilter/model.js.map +1 -0
  20. package/lib/components/display/detailList/index.d.ts +1 -0
  21. package/lib/components/display/detailList/index.d.ts.map +1 -1
  22. package/lib/components/display/detailList/index.js +9 -6
  23. package/lib/components/display/detailList/index.js.map +1 -1
  24. package/lib/components/index.d.ts +3 -2
  25. package/lib/components/index.d.ts.map +1 -1
  26. package/lib/components/index.js.map +1 -1
  27. package/lib/tail.css +1 -1
  28. package/package.json +1 -1
@@ -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;AAwD1B,eAAO,MAAM,YAAY,mFAwlZvB,CAAC"}
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,6 +877,34 @@ 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
+ };
887
+ // INFO: applies flex filters from a parent, merged by columnId (incoming
888
+ // replaces same-column rows so no contradictory AND; other columns kept).
889
+ var handleApplyFlexFilters = function (incoming) {
890
+ handleClearFlexFilterTypingTimeout();
891
+ var incomingColumnIds = new Set(incoming.map(function (f) { return f.columnId; }));
892
+ var retained = flexFiltersRef.current.filter(function (f) { return f.columnId && !incomingColumnIds.has(f.columnId); });
893
+ handleCommitFlexFilters(__spreadArray(__spreadArray([], retained, true), incoming, true));
894
+ setPageIndex(0);
895
+ };
896
+ // INFO: clears flex filters by columnId (other columns preserved), or all
897
+ // when called with no args. Falls back to a single empty row when none remain.
898
+ var handleClearFlexFilters = function (columnIds) {
899
+ handleClearFlexFilterTypingTimeout();
900
+ var remaining = columnIds && columnIds.length > 0
901
+ ? flexFiltersRef.current.filter(function (f) { return f.columnId && !columnIds.includes(f.columnId); })
902
+ : [];
903
+ handleCommitFlexFilters(remaining.length > 0
904
+ ? remaining
905
+ : [{ id: (0, uuid_1.v4)(), columnId: "", operator: "=", value: undefined }]);
906
+ setPageIndex(0);
907
+ };
870
908
  var handleFlexFilterColumnChange = function (filterId, columnId) {
871
909
  var updatedFilters = flexFilters.map(function (f) {
872
910
  if (f.id !== filterId)
@@ -954,6 +992,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
954
992
  },
955
993
  handleFormSubmit: handleFormSubmit,
956
994
  handleFormCheck: handleFormCheck,
995
+ handleApplyFlexFilters: handleApplyFlexFilters,
996
+ handleClearFlexFilters: handleClearFlexFilters,
957
997
  handlePopUpModal: handlePopUpModal,
958
998
  handleDeleteModal: handleDeleteModal,
959
999
  handleUploadOfflineData: handleUploadOfflineData,
@@ -973,6 +1013,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
973
1013
  isLive: isLive,
974
1014
  isLiveOffline: isLiveOffline,
975
1015
  }); });
1016
+ // INFO: notify the consumer whenever the applied flex filters change, so a
1017
+ // parent can observe live filter state. Uses the debounced state so it fires
1018
+ // on committed changes, not every keystroke.
1019
+ (0, react_1.useEffect)(function () {
1020
+ var _a, _b;
1021
+ (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOnFlexFiltersChange) === null || _b === void 0 ? void 0 : _b.call(_a, flexFiltersDebounced);
1022
+ }, [flexFiltersDebounced]);
976
1023
  // INFO: Auto-save view state to storage whenever filters, sort, page index,
977
1024
  // or column visibility change. Active for both "persistent" and "session" modes.
978
1025
  var persistSaveInitialised = (0, react_1.useRef)(false);