@pega/lists-core 8.8.0 → 9.0.0-build.10.0

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 (92) hide show
  1. package/lib/index.d.ts +2 -2
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +2 -2
  4. package/lib/index.js.map +1 -1
  5. package/lib/src/core/StateResolver.d.ts.map +1 -1
  6. package/lib/src/core/StateResolver.js +2 -1
  7. package/lib/src/core/StateResolver.js.map +1 -1
  8. package/lib/src/core/constants.d.ts +11 -101
  9. package/lib/src/core/constants.d.ts.map +1 -1
  10. package/lib/src/core/constants.js +6 -6
  11. package/lib/src/core/constants.js.map +1 -1
  12. package/lib/src/core/features/featureFactory.d.ts.map +1 -1
  13. package/lib/src/core/features/featureFactory.js +0 -1
  14. package/lib/src/core/features/featureFactory.js.map +1 -1
  15. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts.map +1 -1
  16. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js +12 -5
  17. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js.map +1 -1
  18. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -1
  19. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js +13 -1
  20. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -1
  21. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts +1 -0
  22. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts.map +1 -1
  23. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js +3 -1
  24. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js.map +1 -1
  25. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts +1 -0
  26. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts.map +1 -1
  27. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js +3 -1
  28. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js.map +1 -1
  29. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts.map +1 -1
  30. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js +2 -3
  31. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js.map +1 -1
  32. package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -1
  33. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +6 -7
  34. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -1
  35. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts.map +1 -1
  36. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js +11 -3
  37. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js.map +1 -1
  38. package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.d.ts.map +1 -1
  39. package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.js +4 -0
  40. package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.js.map +1 -1
  41. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -1
  42. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +2 -1
  43. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -1
  44. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts.map +1 -1
  45. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +19 -0
  46. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -1
  47. package/lib/src/core/features/uIFeatures/index.d.ts +0 -2
  48. package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
  49. package/lib/src/core/features/uIFeatures/index.js +0 -2
  50. package/lib/src/core/features/uIFeatures/index.js.map +1 -1
  51. package/lib/src/core/generators/ColumnGenerator.d.ts +1 -1
  52. package/lib/src/core/generators/ColumnGenerator.d.ts.map +1 -1
  53. package/lib/src/core/generators/ColumnGenerator.js +2 -1
  54. package/lib/src/core/generators/ColumnGenerator.js.map +1 -1
  55. package/lib/src/core/generators/ColumnGenerator.types.d.ts +1 -1
  56. package/lib/src/core/generators/ColumnGenerator.types.d.ts.map +1 -1
  57. package/lib/src/core/generators/ColumnGenerator.types.js.map +1 -1
  58. package/lib/src/core/generators/GroupGenerator.d.ts +4 -1
  59. package/lib/src/core/generators/GroupGenerator.d.ts.map +1 -1
  60. package/lib/src/core/generators/GroupGenerator.js +4 -1
  61. package/lib/src/core/generators/GroupGenerator.js.map +1 -1
  62. package/lib/src/core/generators/ViewGenerator.d.ts.map +1 -1
  63. package/lib/src/core/generators/ViewGenerator.js +7 -2
  64. package/lib/src/core/generators/ViewGenerator.js.map +1 -1
  65. package/lib/src/core/generators/viewUtilityMethods.js +3 -3
  66. package/lib/src/core/generators/viewUtilityMethods.js.map +1 -1
  67. package/lib/src/core/reducers/error.d.ts.map +1 -1
  68. package/lib/src/core/reducers/index.d.ts.map +1 -1
  69. package/lib/src/core/utils/condition-utils.js +1 -1
  70. package/lib/src/core/utils/condition-utils.js.map +1 -1
  71. package/lib/src/core/utils/util.d.ts +1 -0
  72. package/lib/src/core/utils/util.d.ts.map +1 -1
  73. package/lib/src/core/utils/util.js +7 -1
  74. package/lib/src/core/utils/util.js.map +1 -1
  75. package/lib/types/ApiContext.types.d.ts +32 -3
  76. package/lib/types/ApiContext.types.d.ts.map +1 -1
  77. package/lib/types/ApiContext.types.js.map +1 -1
  78. package/lib/types/Meta.types.d.ts +36 -4
  79. package/lib/types/Meta.types.d.ts.map +1 -1
  80. package/lib/types/Meta.types.js +3 -0
  81. package/lib/types/Meta.types.js.map +1 -1
  82. package/lib/types/State.types.d.ts +21 -2
  83. package/lib/types/State.types.d.ts.map +1 -1
  84. package/lib/types/State.types.js.map +1 -1
  85. package/lib/types.d.ts +4 -1
  86. package/lib/types.d.ts.map +1 -1
  87. package/lib/types.js.map +1 -1
  88. package/package.json +3 -4
  89. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts +0 -7
  90. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts.map +0 -1
  91. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js +0 -24
  92. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js.map +0 -1
package/lib/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { getMockColumn } from './src/core/test/junitMocks';
8
8
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
9
9
  export { default as BaseA11y } from './src/core/a11y/BaseA11y';
10
10
  export type { RsCoreTypes } from './types';
11
- export { ROW_DENSITY } from './types/Meta.types';
12
- export { REPEATING_STRUCTURE_TEMPLATES } from './types/Meta.types';
11
+ export { ROW_DENSITY, FieldType } from './types/Meta.types';
12
+ export { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';
13
13
  export { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,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,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE/D,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC"}
package/lib/index.js CHANGED
@@ -9,7 +9,7 @@ export const { UPDATE_DEBUG_INFO, TOGGLE_DISABLE_SELECTION, TOGGLE_REQUIRED, NOT
9
9
  export { getMockColumn } from './src/core/test/junitMocks';
10
10
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
11
11
  export { default as BaseA11y } from './src/core/a11y/BaseA11y';
12
- export { ROW_DENSITY } from './types/Meta.types';
13
- export { REPEATING_STRUCTURE_TEMPLATES } from './types/Meta.types';
12
+ export { ROW_DENSITY, FieldType } from './types/Meta.types';
13
+ export { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';
14
14
  export { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';
15
15
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibileFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibileFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY, FieldType } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StateResolver.d.ts","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAc,UAAU,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAgB9F,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,2BAA2B,CAAC;AAC7F,OAAO,KAAK,EAAoB,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGpF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,KAAK,KAAK,CAAC;AAC9F,MAAM,MAAM,gBAAgB,GAAG,CAC7B,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,UAAU,KACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAChC,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;;IAwChC,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;OAKG;gBAED,QAAQ,EAAE,eAAe,EACzB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU;IAoCxB;;;;;OAKG;IACH,QAAQ,GAAI,QAAQ,UAAU,KAAG,IAAI,CA+CnC;IAEF;;OAEG;IACH,QAAQ,cAEN;IAEF;;OAEG;IACH,gBAAgB,cAEd;IAEF;;;;;OAKG;IACH,cAAc,GACZ,aAAa,CAAC,YAAY,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,UAI3E;CAwHH;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,UAAU,IAcrD,O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,gCAwBzD"}
@@ -274,7 +274,8 @@ export function initializeFetchDataHandler(rsCoreInternal) {
274
274
  state.refresh,
275
275
  state.groups,
276
276
  state.hierarchicalGroup,
277
- state.groupFilters
277
+ state.groupFilters,
278
+ state.hiddenColumns
278
279
  ]);
279
280
  return response;
280
281
  };
@@ -1 +1 @@
1
- {"version":3,"file":"StateResolver.js","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,OAAO,EACP,uBAAuB,EACvB,mBAAmB,IAAI,0BAA0B,EACjD,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAapD,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,gDAAgD;IAChD,WAAW,CAAa;IAExB,0EAA0E;IAC1E,SAAS,CAAkB;IAE3B,8CAA8C;IAC9C,YAAY,CAAkE;IAE9E,yFAAyF;IACzF,iBAAiB,CAAmB;IAEpC,iEAAiE;IACjE,MAAM,CAAQ;IAEd,mFAAmF;IACnF,aAAa,CAAQ;IAErB,sDAAsD;IACtD,aAAa,CAAQ;IAErB,iDAAiD;IACjD,cAAc,CAAW;IAEzB,0CAA0C;IAC1C,4BAA4B,CAAW;IAEvC,kEAAkE;IAClE,iBAAiB,CAAwC;IAEzD,6FAA6F;IAC7F,cAAc,GAAG,IAAI,GAAG,EAAsB,CAAC;IAE/C,gFAAgF;IAChF,qBAAqB,GAAG,KAAK,CAAC;IAE9B,kEAAkE;IAClE,gBAAgB,CAAmB;IAEnC,6CAA6C;IAC7C,mBAAmB,CAAW;IAE9B;;;;;OAKG;IACH,YACE,QAAyB,EACzB,gBAAkC,EAClC,UAAsB;Q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AAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;SACnB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const visibleColumnsArr = this.#rsInternal.getView().getVisibleColumns();\n const visibleColumns = visibleColumnsArr.map(col => col.field.id);\n const { apiContext } = this.#rsInternal.getRsProps();\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps),\n visibleColumns\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n * @returns\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n if (isStaleAction(queuedAction, this.#latestActions)) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // For eg.renderHeader and autosize feature set forceRenderOnNextRun and forceCalculateAutoWidth in this slice so that they will get executed after the existing rendering cycle is complete and the rows are rendered on DOM.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (\n this.#queuedActions.length === 1 &&\n this.#queuedActions[0]?.type === ActionTypes.FORCE_UPDATE &&\n !Object.keys(this.#queuedActions[0].payload.forceUpdateFeatures).length\n ) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters\n ]\n );\n return response;\n };\n}\n"]}
1
+ {"version":3,"file":"StateResolver.js","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,OAAO,EACP,uBAAuB,EACvB,mBAAmB,IAAI,0BAA0B,EACjD,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAapD,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,gDAAgD;IAChD,WAAW,CAAa;IAExB,0EAA0E;IAC1E,SAAS,CAAkB;IAE3B,8CAA8C;IAC9C,YAAY,CAAkE;IAE9E,yFAAyF;IAC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,CAAC;YAClB,IAAI,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,EAAE,KAAY,EAAE,gBAA4B,EAAE,EAAE;QAC1D;;;;;WAKG;QACH,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC;QAC/C,MAAM,YAAY,CAChB,CAAC,KAAK,EAAE,gBAAgB,CAAC,EACzB;YACE,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,aAAa;SACpB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const visibleColumnsArr = this.#rsInternal.getView().getVisibleColumns();\n const visibleColumns = visibleColumnsArr.map(col => col.field.id);\n const { apiContext } = this.#rsInternal.getRsProps();\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps),\n visibleColumns\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n * @returns\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n if (isStaleAction(queuedAction, this.#latestActions)) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // For eg.renderHeader and autosize feature set forceRenderOnNextRun and forceCalculateAutoWidth in this slice so that they will get executed after the existing rendering cycle is complete and the rows are rendered on DOM.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (\n this.#queuedActions.length === 1 &&\n this.#queuedActions[0]?.type === ActionTypes.FORCE_UPDATE &&\n !Object.keys(this.#queuedActions[0].payload.forceUpdateFeatures).length\n ) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters,\n state.hiddenColumns\n ]\n );\n return response;\n };\n}\n"]}
@@ -1,115 +1,24 @@
1
+ import type { OmitStrict } from '@pega/cosmos-react-core';
2
+ import type { ColumnConfig } from './generators/ColumnGenerator.types';
1
3
  export declare const nonPersonalizationViewKey = "nonPersonalizationViewKey";
2
4
  export declare const defaultPresetIdIndex = 0;
3
5
  export declare const EXTERNAL_FILTERS = "externalFilters";
4
6
  export declare const ACTION_FIELD_TYPE = "action";
5
7
  export declare const rowActionColumnMeta: {
6
- field: {
7
- resize: boolean;
8
- filter: boolean;
9
- sort: boolean;
10
- autosize: boolean;
11
- freeze: boolean;
12
- aggregation: boolean;
13
- toggle: boolean;
14
- grouping: boolean;
15
- customizeColumn: boolean;
16
- combineColumn: boolean;
17
- showMenu: boolean;
18
- noContextMenu: boolean;
19
- showTooltip: boolean;
20
- reorderFields: boolean;
21
- type: "action";
22
- name: string;
23
- label: string;
24
- cellRenderer: string;
25
- id: string;
26
- width: number;
27
- };
28
- options: {
29
- classList: string[];
30
- };
8
+ field: ColumnConfig['field'];
9
+ options: OmitStrict<ColumnConfig, 'field'>;
31
10
  };
32
11
  export declare const rowSelectColumnMeta: {
33
- field: {
34
- resize: boolean;
35
- filter: boolean;
36
- sort: boolean;
37
- autosize: boolean;
38
- freeze: boolean;
39
- aggregation: boolean;
40
- toggle: boolean;
41
- grouping: boolean;
42
- customizeColumn: boolean;
43
- combineColumn: boolean;
44
- showMenu: boolean;
45
- noContextMenu: boolean;
46
- showTooltip: boolean;
47
- reorderFields: boolean;
48
- type: "action";
49
- name: string;
50
- label: string;
51
- cellRenderer: string;
52
- id: string;
53
- headerCellRenderer: string;
54
- };
55
- options: {
56
- classList: string[];
57
- label: string;
58
- };
12
+ field: ColumnConfig['field'];
13
+ options: OmitStrict<ColumnConfig, 'field'>;
59
14
  };
60
15
  export declare const rowDragDropColumnMeta: {
61
- field: {
62
- resize: boolean;
63
- filter: boolean;
64
- sort: boolean;
65
- autosize: boolean;
66
- freeze: boolean;
67
- aggregation: boolean;
68
- toggle: boolean;
69
- grouping: boolean;
70
- customizeColumn: boolean;
71
- combineColumn: boolean;
72
- showMenu: boolean;
73
- noContextMenu: boolean;
74
- showTooltip: boolean;
75
- reorderFields: boolean;
76
- type: "action";
77
- name: string;
78
- label: string;
79
- cellRenderer: string;
80
- id: string;
81
- width: number;
82
- };
83
- options: {
84
- classList: string[];
85
- };
16
+ field: ColumnConfig['field'];
17
+ options: OmitStrict<ColumnConfig, 'field'>;
86
18
  };
87
19
  export declare const rowErrorColumnMeta: {
88
- field: {
89
- resize: boolean;
90
- filter: boolean;
91
- sort: boolean;
92
- autosize: boolean;
93
- freeze: boolean;
94
- aggregation: boolean;
95
- toggle: boolean;
96
- grouping: boolean;
97
- customizeColumn: boolean;
98
- combineColumn: boolean;
99
- showMenu: boolean;
100
- noContextMenu: boolean;
101
- showTooltip: boolean;
102
- reorderFields: boolean;
103
- type: "action";
104
- name: string;
105
- label: string;
106
- cellRenderer: string;
107
- id: string;
108
- width: number;
109
- };
110
- options: {
111
- classList: string[];
112
- };
20
+ field: ColumnConfig['field'];
21
+ options: OmitStrict<ColumnConfig, 'field'>;
113
22
  };
114
23
  export declare const UNSUPPORTED_HEADER_ICON_FIELD_TYPES: string[];
115
24
  export declare const RICH_TEXT = "RichText";
@@ -141,6 +50,7 @@ export declare const TEMPLATES: {
141
50
  export declare const DEFAULT_FORMAT = "Default";
142
51
  export declare const expandCollapseAllMeta: {
143
52
  width: number;
53
+ selector: string;
144
54
  };
145
55
  export declare const NON_DRAGGABLE_COLUMNS: string[];
146
56
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AACrE,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAClD,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAmB1C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CAa/B,CAAC;AAE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} from '../../types/Meta.types';
1
+ import { cellUpdateTrigger, FieldType } from '../../types/Meta.types';
2
2
  export const nonPersonalizationViewKey = 'nonPersonalizationViewKey';
3
3
  export const defaultPresetIdIndex = 0;
4
4
  export const EXTERNAL_FILTERS = 'externalFilters';
@@ -17,7 +17,8 @@ const ootbFieldMeta = {
17
17
  showMenu: false,
18
18
  noContextMenu: true,
19
19
  showTooltip: false,
20
- reorderFields: false
20
+ reorderFields: false,
21
+ cellUpdateTriggers: [cellUpdateTrigger.ROW_DENSITY_CHANGE]
21
22
  };
22
23
  export const rowActionColumnMeta = {
23
24
  field: {
@@ -26,7 +27,6 @@ export const rowActionColumnMeta = {
26
27
  label: 'Actions',
27
28
  cellRenderer: 'RowActionMenu',
28
29
  id: 'RowActionMenu',
29
- width: 32,
30
30
  ...ootbFieldMeta
31
31
  },
32
32
  options: {
@@ -55,7 +55,6 @@ export const rowDragDropColumnMeta = {
55
55
  label: '',
56
56
  cellRenderer: 'RowDragDropHandle',
57
57
  id: 'RowDragDrop',
58
- width: 34,
59
58
  ...ootbFieldMeta
60
59
  },
61
60
  options: {
@@ -69,7 +68,6 @@ export const rowErrorColumnMeta = {
69
68
  label: '',
70
69
  cellRenderer: 'RowError',
71
70
  id: 'RowError',
72
- width: 34,
73
71
  ...ootbFieldMeta
74
72
  },
75
73
  options: {
@@ -114,7 +112,9 @@ export const TEMPLATES = {
114
112
  };
115
113
  export const DEFAULT_FORMAT = 'Default';
116
114
  export const expandCollapseAllMeta = {
117
- width: 32
115
+ width: 32,
116
+ // TODO: RsCore should take this as part of contract. It wil be fixed, after setting up css classes contract OR go with some other approach if accepting CSS classes is not an option.
117
+ selector: '.expand-collapse-all'
118
118
  };
119
119
  export const NON_DRAGGABLE_COLUMNS = [
120
120
  rowSelectColumnMeta.field.id,
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wB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G,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAEhF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAE1B;IACF,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,EAAE;IACxD,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,EAAE;IACzD,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE;IAC1D,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,EAAE;CACV,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB,CAAC,KAAK,CAAC,EAAE;IAC5B,qBAAqB,CAAC,KAAK,CAAC,EAAE;IAC9B,mBAAmB,CAAC,KAAK,CAAC,EAAE;CAC7B,CAAC","sourcesContent":["import { FieldType } from '../../types/Meta.types';\n\nexport const nonPersonalizationViewKey = 'nonPersonalizationViewKey';\nexport const defaultPresetIdIndex = 0;\nexport const EXTERNAL_FILTERS = 'externalFilters';\nexport const ACTION_FIELD_TYPE = 'action';\n\nconst ootbFieldMeta = {\n resize: false,\n filter: false,\n sort: false,\n autosize: false,\n freeze: false,\n aggregation: false,\n toggle: false,\n grouping: false,\n customizeColumn: false,\n combineColumn: false,\n showMenu: false,\n noContextMenu: true,\n showTooltip: false,\n reorderFields: false\n};\n\nexport const rowActionColumnMeta = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowActionMenu',\n label: 'Actions',\n cellRenderer: 'RowActionMenu',\n id: 'RowActionMenu',\n width: 32,\n ...ootbFieldMeta\n },\n options: {\n classList: ['cell-action']\n }\n};\n\nexport const rowSelectColumnMeta = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowSelect',\n label: 'Select',\n cellRenderer: 'RowSelectHandle',\n id: 'RowSelect',\n headerCellRenderer: 'selectAllCheckboxRenderer',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-select-handle'],\n label: 'Select'\n }\n};\n\nexport const rowDragDropColumnMeta = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowDragDrop',\n label: '',\n cellRenderer: 'RowDragDropHandle',\n id: 'RowDragDrop',\n width: 34,\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-reorder-handle']\n }\n};\n\nexport const rowErrorColumnMeta = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowError',\n label: '',\n cellRenderer: 'RowError',\n id: 'RowError',\n width: 34,\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-error-column']\n }\n};\n\nexport const UNSUPPORTED_HEADER_ICON_FIELD_TYPES = [ACTION_FIELD_TYPE];\n\nexport const RICH_TEXT = 'RichText';\n\nexport const STATE = {\n NOT_STARTED: 'NOT_STARTED',\n IN_PROGRESS: 'IN_PROGRESS',\n FAILED: 'FAILED'\n};\n\nexport const SELECTION_MODES = {\n single: 'single',\n multi: 'multi',\n multi_on_hover: 'multi_on_hover'\n};\nexport const SUPPORTED_MODES_FOR_SELECTALL = [\n SELECTION_MODES.multi_on_hover,\n SELECTION_MODES.multi\n];\n\nexport const SUPPORTED_FLUSH_KEYS = [\n 'filterExpression',\n 'search',\n 'selectedRows',\n 'sourceID',\n 'destinationID'\n];\nexport const SUPPORTED_AVOIDABLE_FEATURES = ['rowAnimation', 'columnAnimation'];\n\n// FIXME: this should be injectable in core\nexport const rowDensityClasses: {\n [key: number]: { id: string; className: string; rowHeight?: number };\n} = {\n 1: { id: '1', className: 'short-height', rowHeight: 25 },\n 2: { id: '2', className: 'medium-height', rowHeight: 35 },\n 3: { id: '3', className: 'tall-height', rowHeight: 45.04 },\n 4: { id: '4', className: 'wrap-content-height' }\n};\n\nexport const TEMPLATES = {\n GALLERY: 'Gallery',\n TABLE: 'Table',\n TIMELINE: 'Timeline'\n};\n\nexport const DEFAULT_FORMAT = 'Default';\nexport const expandCollapseAllMeta = {\n width: 32\n};\nexport const NON_DRAGGABLE_COLUMNS = [\n rowSelectColumnMeta.field.id,\n rowDragDropColumnMeta.field.id,\n rowActionColumnMeta.field.id\n];\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAiB,MAAM,wBAAwB,CAAC;AAIrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,MAAM,aAAa,GAAsB;IACvC,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,KAAK;IACf,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,KAAK;IAClB,aAAa,EAAE,KAAK;IACpB,kBAAkB,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC;CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,mB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,KAAK,EAAE,EAAE;IACT,sLAAsL;IACtL,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB,CAAC,KAAK,CAAC,EAAE;IAC5B,qBAAqB,CAAC,KAAK,CAAC,EAAE;IAC9B,mBAAmB,CAAC,KAAK,CAAC,EAAE;CAC7B,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport { cellUpdateTrigger, FieldType, type FieldDef } from '../../types/Meta.types';\n\nimport type { ColumnConfig } from './generators/ColumnGenerator.types';\n\nexport const nonPersonalizationViewKey = 'nonPersonalizationViewKey';\nexport const defaultPresetIdIndex = 0;\nexport const EXTERNAL_FILTERS = 'externalFilters';\nexport const ACTION_FIELD_TYPE = 'action';\n\nconst ootbFieldMeta: Partial<FieldDef> = {\n resize: false,\n filter: false,\n sort: false,\n autosize: false,\n freeze: false,\n aggregation: false,\n toggle: false,\n grouping: false,\n customizeColumn: false,\n combineColumn: false,\n showMenu: false,\n noContextMenu: true,\n showTooltip: false,\n reorderFields: false,\n cellUpdateTriggers: [cellUpdateTrigger.ROW_DENSITY_CHANGE]\n};\n\nexport const rowActionColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowActionMenu',\n label: 'Actions',\n cellRenderer: 'RowActionMenu',\n id: 'RowActionMenu',\n ...ootbFieldMeta\n },\n options: {\n classList: ['cell-action']\n }\n};\n\nexport const rowSelectColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowSelect',\n label: 'Select',\n cellRenderer: 'RowSelectHandle',\n id: 'RowSelect',\n headerCellRenderer: 'selectAllCheckboxRenderer',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-select-handle'],\n label: 'Select'\n }\n};\n\nexport const rowDragDropColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowDragDrop',\n label: '',\n cellRenderer: 'RowDragDropHandle',\n id: 'RowDragDrop',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-reorder-handle']\n }\n};\n\nexport const rowErrorColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowError',\n label: '',\n cellRenderer: 'RowError',\n id: 'RowError',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-error-column']\n }\n};\n\nexport const UNSUPPORTED_HEADER_ICON_FIELD_TYPES = [ACTION_FIELD_TYPE];\n\nexport const RICH_TEXT = 'RichText';\n\nexport const STATE = {\n NOT_STARTED: 'NOT_STARTED',\n IN_PROGRESS: 'IN_PROGRESS',\n FAILED: 'FAILED'\n};\n\nexport const SELECTION_MODES = {\n single: 'single',\n multi: 'multi',\n multi_on_hover: 'multi_on_hover'\n};\nexport const SUPPORTED_MODES_FOR_SELECTALL = [\n SELECTION_MODES.multi_on_hover,\n SELECTION_MODES.multi\n];\n\nexport const SUPPORTED_FLUSH_KEYS = [\n 'filterExpression',\n 'search',\n 'selectedRows',\n 'sourceID',\n 'destinationID'\n];\nexport const SUPPORTED_AVOIDABLE_FEATURES = ['rowAnimation', 'columnAnimation'];\n\n// FIXME: this should be injectable in core\nexport const rowDensityClasses: {\n [key: number]: { id: string; className: string; rowHeight?: number };\n} = {\n 1: { id: '1', className: 'short-height', rowHeight: 25 },\n 2: { id: '2', className: 'medium-height', rowHeight: 35 },\n 3: { id: '3', className: 'tall-height', rowHeight: 45.04 },\n 4: { id: '4', className: 'wrap-content-height' }\n};\n\nexport const TEMPLATES = {\n GALLERY: 'Gallery',\n TABLE: 'Table',\n TIMELINE: 'Timeline'\n};\n\nexport const DEFAULT_FORMAT = 'Default';\nexport const expandCollapseAllMeta = {\n width: 32,\n // TODO: RsCore should take this as part of contract. It wil be fixed, after setting up css classes contract OR go with some other approach if accepting CSS classes is not an option.\n selector: '.expand-collapse-all'\n};\nexport const NON_DRAGGABLE_COLUMNS = [\n rowSelectColumnMeta.field.id,\n rowDragDropColumnMeta.field.id,\n rowActionColumnMeta.field.id\n];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"featureFactory.d.ts","sourceRoot":"","sources":["../../../../src/core/features/featureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,KAAK,IAAI,MAAM,6BAA6B,CAAC;AAKpD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIvD,MAAM,MAAM,YAAY,CAAC,iBAAiB,SAAS,OAAO,GAAG,KAAK,IAAI;IACpE,gDAAgD;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,EAAE,MAAM,KAAK,CAAC;IACtB,0FAA0F;IAC1F,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACpD,2CAA2C;IAC3C,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACrC,GAAG,CAAC,iBAAiB,SAAS,IAAI,GAC/B;IACE,sDAAsD;IACtD,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,GAGD,EAAE,CAAC,CAAC;AAER,MAAM,MAAM,wBAAwB,GAAG,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AAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,iBAAS,aAAa;kBAEJ,OAAO,CAAC,IAAI,CAAC,EAAE;iBAChB,OAAO,EAAE;EA2DzB;AAuDD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,UAAU,EAAE,UAAU,GACrB,CAAC,CAAC,YAAY,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,CAE9E"}
@@ -39,7 +39,6 @@ function getUIFeatures() {
39
39
  // We have to inject this feature always as we are generating instance
40
40
  // level data with same to avoid condition block in UI.
41
41
  features.beforeRender.push(uiFeatures.beforeRender.grouping);
42
- features.beforeRender.push(uiFeatures.beforeRender.resizeGroupedDragDropColumn);
43
42
  features.beforeRender.push(uiFeatures.beforeRender.filter);
44
43
  features.beforeRender.push(uiFeatures.beforeRender.columnSort);
45
44
  features.beforeRender.push(uiFeatures.beforeRender.columnResize);
@@ -1 +1 @@
1
- {"version":3,"file":"featureFactory.js","sourceRoot":"","sources":["../../../../src/core/features/featureFactory.ts"],"names":[],"mappings":"AAaA,OAAO,UAAU,MAAM,cAAc,CAAC;AA6CtC,SAAS,aAAa;IACpB,MAAM,QAAQ,GAGV;QACF,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,EAAE;KAChB,CAAC;IACF,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAChE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAClE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IACpE,iGAAiG;IACjG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAC/D,QAAQ,CAAC,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AAC,kBAAkB,EAAG,CAAC,QAAQ;oBACnD,gBAAgB,EAAE,UAAU,CAAC,kBAAkB,EAAG,CAAC,gBAAgB;oBACnE,QAAQ,EAAE,UAAU,CAAC,kBAAkB,EAAG,CAAC,QAAQ;iBACpD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,UAAsB;IAEtB,OAAO,CAAC,8BAA8B,CAAC,UAAU,CAAC,EAAE,6BAA6B,CAAC,UAAU,CAAC,CAAC,CAAC;AACjG,CAAC","sourcesContent":["import type { State } from 'packages/lists-rs-core/types/State.types';\n\nimport type View from '../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type Column from '../generators/ColumnGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type Row from '../generators/RowGenerator';\nimport type RsInternal from '../RsInternal';\nimport type RsProps from '../RsProps';\nimport type StateResolver from '../StateResolver';\nimport type RsStore from '../RsStore';\nimport type { Action } from '../actions/actions.types';\n\nimport uiFeatures from './uIFeatures';\n\nexport type FeatureProps<WithQueuedActions extends boolean = false> = {\n /** Returns reference to current {@link View} */\n getView: () => View;\n /** Returns reference to {@link RsStore} */\n getRsStore: () => RsStore;\n /** Returns reference to {@link RsProps} */\n getRsProps: () => RsProps;\n /** Returns reference to latest/current {@link State} */\n getState: () => State;\n /** Returns the stable {@link State} before the actions in the queue started executing. */\n getOriginalState: StateResolver['getOriginalState'];\n /** A dispatcher to dispatch RS actions. */\n dispatch: StateResolver['dispatch'];\n} & (WithQueuedActions extends true\n ? {\n /** A queue of current actions that are dispatched. */\n queuedActions: Action[];\n }\n : // For better readability keeping {} rather than Record<string, never>.\n // eslint-disable-next-line @typescript-eslint/ban-types\n {});\n\nexport type BeforeRenderFeatureProps = FeatureProps<true>;\n\nexport type MiddleWareFeatureProps = {\n /** Reference to RsInternal object. */\n rsInternal: RsInternal;\n /** Returns reference to latest/current {@link State}. */\n getState: () => State;\n /** Returns the stable {@link State} before the actions in the queue started executing. */\n getOriginalState: StateResolver['getOriginalState'];\n /** A dispatcher to dispatch RS actions. */\n dispatch: StateResolver['dispatch'];\n /** A queue of current actions that are dispatched. */\n queuedActions: Action[];\n};\n\n/** A feature is a function that runs based on a particular state slice change and produces immutable generator({@link View}, {@link Row}, {@link Column}) objects. It may also {@link StateResolver.dispatch dispatch} an action. */\nexport type Feature<WithQueuedActions extends boolean = false> = (\n rsInternal: RsInternal\n) => ((featureProps: FeatureProps<WithQueuedActions>) => void) | void;\n\nexport type UIFeatures = ReturnType<typeof getUIFeatures>;\nfunction getUIFeatures() {\n const features: {\n beforeRender: Feature<true>[];\n afterRender: Feature[];\n } = {\n beforeRender: [],\n afterRender: []\n };\n features.beforeRender.push(uiFeatures.beforeRender.scrollToTop);\n features.beforeRender.push(uiFeatures.beforeRender.busyIndicator);\n features.beforeRender.push(uiFeatures.beforeRender.personalization);\n // Reset dataApi context so that new count and data could be fetched on change of personalization\n features.beforeRender.push(uiFeatures.beforeRender.resetFetch);\n features.beforeRender.push(uiFeatures.beforeRender.changePersonalisation);\n features.beforeRender.push(uiFeatures.beforeRender.prepareColumns);\n features.beforeRender.push(uiFeatures.beforeRender.columnFormatter);\n features.beforeRender.push(uiFeatures.beforeRender.ColumnDisplayMode);\n /* customColumn feature injects field definitions for custom fields, so stateSanitization feature should run after customColumn */\n features.beforeRender.push(uiFeatures.beforeRender.customColumn);\n features.beforeRender.push(uiFeatures.beforeRender.columnAlias);\n features.beforeRender.push(uiFeatures.beforeRender.stateSanitization);\n features.beforeRender.push(uiFeatures.beforeRender.stateHydration);\n features.beforeRender.push(uiFeatures.beforeRender.conditionalStyleFormat);\n features.beforeRender.push(uiFeatures.beforeRender.columnToggle);\n // ORDER: if any feature is going to generate some markup, then it should come before columnSizing feature\n // If reordering or moving records is enabled then rowDragDrop handler size has to be calculated and picked by column sizing\n features.beforeRender.push(uiFeatures.beforeRender.errorColumn);\n features.beforeRender.push(uiFeatures.beforeRender.rowDragDrop);\n features.beforeRender.push(uiFeatures.beforeRender.columnSizing);\n features.beforeRender.push(uiFeatures.beforeRender.adjustHeight);\n features.beforeRender.push(uiFeatures.beforeRender.freeze);\n // columnOrder is required for both columnVisualOrder and columnReorder feature\n features.beforeRender.push(uiFeatures.beforeRender.columnOrder);\n features.beforeRender.push(uiFeatures.beforeRender.columnVisualOrder);\n // Columns header should be rendered as soon as it is available. Features making calculation on columns should be before this.\n features.beforeRender.push(uiFeatures.beforeRender.renderHeader);\n features.beforeRender.push(uiFeatures.beforeRender.refresh);\n features.beforeRender.push(uiFeatures.beforeRender.rowHeight);\n features.beforeRender.push(uiFeatures.beforeRender.animation);\n features.beforeRender.push(uiFeatures.beforeRender.prepareRows);\n // We have to inject this feature always as we are generating instance\n // level data with same to avoid condition block in UI.\n\n features.beforeRender.push(uiFeatures.beforeRender.grouping);\n features.beforeRender.push(uiFeatures.beforeRender.resizeGroupedDragDropColumn);\n features.beforeRender.push(uiFeatures.beforeRender.filter);\n features.beforeRender.push(uiFeatures.beforeRender.columnSort);\n features.beforeRender.push(uiFeatures.beforeRender.columnResize);\n features.beforeRender.push(uiFeatures.beforeRender.adjustHeightToFitRecords);\n\n features.beforeRender.push(uiFeatures.beforeRender.columnReOrder);\n features.beforeRender.push(uiFeatures.beforeRender.rowSelect);\n features.beforeRender.push(uiFeatures.beforeRender.toggleSelectAllCheckbox);\n features.beforeRender.push(uiFeatures.beforeRender.aggregation);\n features.beforeRender.push(uiFeatures.beforeRender.edit);\n features.beforeRender.push(uiFeatures.beforeRender.moveRecords);\n features.beforeRender.push(uiFeatures.beforeRender.toggleHeaderIcons);\n\n features.afterRender.push(uiFeatures.afterRender.animation);\n features.afterRender.push(uiFeatures.afterRender.columnAutoSizing);\n features.afterRender.push(uiFeatures.afterRender.customizeParentContainer);\n\n return features;\n}\n\n/**\n * Initializes and returns before render features which run when any action is dispatched in the queue.\n * @param rsInternal - RsInternal reference.\n * @returns\n */\nfunction initializeBeforeRenderFeatures(rsInternal: RsInternal) {\n const features = getUIFeatures();\n const beforeRenderUIFeatures = features.beforeRender.map(t => t(rsInternal)).filter(Boolean);\n return (featureProps: MiddleWareFeatureProps) => {\n return (beforeRenderUIFeatures as ((featureProps: BeforeRenderFeatureProps) => void)[]).reduce<\n Promise<void | null>\n >(async (p, feature) => {\n return p.then(() => {\n if (!featureProps.rsInternal.getRsStore().isMounted) return null;\n return feature({\n getView: featureProps.rsInternal.getView,\n getRsStore: featureProps.rsInternal.getRsStore,\n getRsProps: featureProps.rsInternal.getRsProps,\n getState: featureProps.getState,\n getOriginalState: featureProps.getOriginalState,\n dispatch: featureProps.dispatch,\n queuedActions: featureProps.queuedActions\n });\n });\n }, Promise.resolve());\n };\n}\n\n/**\n * Initializes and returns after render features which run after the render is completed.\n * @param rsInternal RsInternal reference.\n * @returns\n */\nfunction initializeAfterRenderFeatures(rsInternal: RsInternal) {\n const features = getUIFeatures();\n const afterRenderUIFeatures = features.afterRender.map(t => t(rsInternal)).filter(Boolean);\n\n return () => {\n (afterRenderUIFeatures as ((featureProps: FeatureProps) => void)[]).forEach(feature => {\n if (rsInternal.getRsStore().isMounted) {\n feature({\n getView: rsInternal.getView,\n getRsStore: rsInternal.getRsStore,\n getRsProps: rsInternal.getRsProps,\n getState: rsInternal.getRsStateResolver()!.getState,\n getOriginalState: rsInternal.getRsStateResolver()!.getOriginalState,\n dispatch: rsInternal.getRsStateResolver()!.dispatch\n });\n }\n });\n };\n}\n\n/**\n * Initializes and return before and after render features.\n * @param rsInternal\n * @returns\n */\nexport default function initializeFeatures(\n rsInternal: RsInternal\n): [(featureProps: MiddleWareFeatureProps) => Promise<void | null>, () => void] {\n return [initializeBeforeRenderFeatures(rsInternal), initializeAfterRenderFeatures(rsInternal)];\n}\n"]}
1
+ {"version":3,"file":"featureFactory.js","sourceRoot":"","sources":["../../../../src/core/features/featureFactory.ts"],"names":[],"m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AAqB,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE3F,OAAO,GAAG,EAAE;QACT,qBAAkE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACpF,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,CAAC;gBACtC,OAAO,CAAC;oBACN,OAAO,EAAE,UAAU,CAAC,OAAO;oBAC3B,UAAU,EAAE,UAAU,CAAC,UAAU;oBACjC,UAAU,EAAE,UAAU,CAAC,UAAU;oBACjC,QAAQ,EAAE,UAAU,CAAC,kBAAkB,EAAG,CAAC,QAAQ;oBACnD,gBAAgB,EAAE,UAAU,CAAC,kBAAkB,EAAG,CAAC,gBAAgB;oBACnE,QAAQ,EAAE,UAAU,CAAC,kBAAkB,EAAG,CAAC,QAAQ;iBACpD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,UAAsB;IAEtB,OAAO,CAAC,8BAA8B,CAAC,UAAU,CAAC,EAAE,6BAA6B,CAAC,UAAU,CAAC,CAAC,CAAC;AACjG,CAAC","sourcesContent":["import type { State } from 'packages/lists-rs-core/types/State.types';\n\nimport type View from '../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type Column from '../generators/ColumnGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type Row from '../generators/RowGenerator';\nimport type RsInternal from '../RsInternal';\nimport type RsProps from '../RsProps';\nimport type StateResolver from '../StateResolver';\nimport type RsStore from '../RsStore';\nimport type { Action } from '../actions/actions.types';\n\nimport uiFeatures from './uIFeatures';\n\nexport type FeatureProps<WithQueuedActions extends boolean = false> = {\n /** Returns reference to current {@link View} */\n getView: () => View;\n /** Returns reference to {@link RsStore} */\n getRsStore: () => RsStore;\n /** Returns reference to {@link RsProps} */\n getRsProps: () => RsProps;\n /** Returns reference to latest/current {@link State} */\n getState: () => State;\n /** Returns the stable {@link State} before the actions in the queue started executing. */\n getOriginalState: StateResolver['getOriginalState'];\n /** A dispatcher to dispatch RS actions. */\n dispatch: StateResolver['dispatch'];\n} & (WithQueuedActions extends true\n ? {\n /** A queue of current actions that are dispatched. */\n queuedActions: Action[];\n }\n : // For better readability keeping {} rather than Record<string, never>.\n // eslint-disable-next-line @typescript-eslint/ban-types\n {});\n\nexport type BeforeRenderFeatureProps = FeatureProps<true>;\n\nexport type MiddleWareFeatureProps = {\n /** Reference to RsInternal object. */\n rsInternal: RsInternal;\n /** Returns reference to latest/current {@link State}. */\n getState: () => State;\n /** Returns the stable {@link State} before the actions in the queue started executing. */\n getOriginalState: StateResolver['getOriginalState'];\n /** A dispatcher to dispatch RS actions. */\n dispatch: StateResolver['dispatch'];\n /** A queue of current actions that are dispatched. */\n queuedActions: Action[];\n};\n\n/** A feature is a function that runs based on a particular state slice change and produces immutable generator({@link View}, {@link Row}, {@link Column}) objects. It may also {@link StateResolver.dispatch dispatch} an action. */\nexport type Feature<WithQueuedActions extends boolean = false> = (\n rsInternal: RsInternal\n) => ((featureProps: FeatureProps<WithQueuedActions>) => void) | void;\n\nexport type UIFeatures = ReturnType<typeof getUIFeatures>;\nfunction getUIFeatures() {\n const features: {\n beforeRender: Feature<true>[];\n afterRender: Feature[];\n } = {\n beforeRender: [],\n afterRender: []\n };\n features.beforeRender.push(uiFeatures.beforeRender.scrollToTop);\n features.beforeRender.push(uiFeatures.beforeRender.busyIndicator);\n features.beforeRender.push(uiFeatures.beforeRender.personalization);\n // Reset dataApi context so that new count and data could be fetched on change of personalization\n features.beforeRender.push(uiFeatures.beforeRender.resetFetch);\n features.beforeRender.push(uiFeatures.beforeRender.changePersonalisation);\n features.beforeRender.push(uiFeatures.beforeRender.prepareColumns);\n features.beforeRender.push(uiFeatures.beforeRender.columnFormatter);\n features.beforeRender.push(uiFeatures.beforeRender.ColumnDisplayMode);\n /* customColumn feature injects field definitions for custom fields, so stateSanitization feature should run after customColumn */\n features.beforeRender.push(uiFeatures.beforeRender.customColumn);\n features.beforeRender.push(uiFeatures.beforeRender.columnAlias);\n features.beforeRender.push(uiFeatures.beforeRender.stateSanitization);\n features.beforeRender.push(uiFeatures.beforeRender.stateHydration);\n features.beforeRender.push(uiFeatures.beforeRender.conditionalStyleFormat);\n features.beforeRender.push(uiFeatures.beforeRender.columnToggle);\n // ORDER: if any feature is going to generate some markup, then it should come before columnSizing feature\n // If reordering or moving records is enabled then rowDragDrop handler size has to be calculated and picked by column sizing\n features.beforeRender.push(uiFeatures.beforeRender.errorColumn);\n features.beforeRender.push(uiFeatures.beforeRender.rowDragDrop);\n features.beforeRender.push(uiFeatures.beforeRender.columnSizing);\n features.beforeRender.push(uiFeatures.beforeRender.adjustHeight);\n features.beforeRender.push(uiFeatures.beforeRender.freeze);\n // columnOrder is required for both columnVisualOrder and columnReorder feature\n features.beforeRender.push(uiFeatures.beforeRender.columnOrder);\n features.beforeRender.push(uiFeatures.beforeRender.columnVisualOrder);\n // Columns header should be rendered as soon as it is available. Features making calculation on columns should be before this.\n features.beforeRender.push(uiFeatures.beforeRender.renderHeader);\n features.beforeRender.push(uiFeatures.beforeRender.refresh);\n features.beforeRender.push(uiFeatures.beforeRender.rowHeight);\n features.beforeRender.push(uiFeatures.beforeRender.animation);\n features.beforeRender.push(uiFeatures.beforeRender.prepareRows);\n // We have to inject this feature always as we are generating instance\n // level data with same to avoid condition block in UI.\n\n features.beforeRender.push(uiFeatures.beforeRender.grouping);\n features.beforeRender.push(uiFeatures.beforeRender.filter);\n features.beforeRender.push(uiFeatures.beforeRender.columnSort);\n features.beforeRender.push(uiFeatures.beforeRender.columnResize);\n features.beforeRender.push(uiFeatures.beforeRender.adjustHeightToFitRecords);\n\n features.beforeRender.push(uiFeatures.beforeRender.columnReOrder);\n features.beforeRender.push(uiFeatures.beforeRender.rowSelect);\n features.beforeRender.push(uiFeatures.beforeRender.toggleSelectAllCheckbox);\n features.beforeRender.push(uiFeatures.beforeRender.aggregation);\n features.beforeRender.push(uiFeatures.beforeRender.edit);\n features.beforeRender.push(uiFeatures.beforeRender.moveRecords);\n features.beforeRender.push(uiFeatures.beforeRender.toggleHeaderIcons);\n\n features.afterRender.push(uiFeatures.afterRender.animation);\n features.afterRender.push(uiFeatures.afterRender.columnAutoSizing);\n features.afterRender.push(uiFeatures.afterRender.customizeParentContainer);\n\n return features;\n}\n\n/**\n * Initializes and returns before render features which run when any action is dispatched in the queue.\n * @param rsInternal - RsInternal reference.\n * @returns\n */\nfunction initializeBeforeRenderFeatures(rsInternal: RsInternal) {\n const features = getUIFeatures();\n const beforeRenderUIFeatures = features.beforeRender.map(t => t(rsInternal)).filter(Boolean);\n return (featureProps: MiddleWareFeatureProps) => {\n return (beforeRenderUIFeatures as ((featureProps: BeforeRenderFeatureProps) => void)[]).reduce<\n Promise<void | null>\n >(async (p, feature) => {\n return p.then(() => {\n if (!featureProps.rsInternal.getRsStore().isMounted) return null;\n return feature({\n getView: featureProps.rsInternal.getView,\n getRsStore: featureProps.rsInternal.getRsStore,\n getRsProps: featureProps.rsInternal.getRsProps,\n getState: featureProps.getState,\n getOriginalState: featureProps.getOriginalState,\n dispatch: featureProps.dispatch,\n queuedActions: featureProps.queuedActions\n });\n });\n }, Promise.resolve());\n };\n}\n\n/**\n * Initializes and returns after render features which run after the render is completed.\n * @param rsInternal RsInternal reference.\n * @returns\n */\nfunction initializeAfterRenderFeatures(rsInternal: RsInternal) {\n const features = getUIFeatures();\n const afterRenderUIFeatures = features.afterRender.map(t => t(rsInternal)).filter(Boolean);\n\n return () => {\n (afterRenderUIFeatures as ((featureProps: FeatureProps) => void)[]).forEach(feature => {\n if (rsInternal.getRsStore().isMounted) {\n feature({\n getView: rsInternal.getView,\n getRsStore: rsInternal.getRsStore,\n getRsProps: rsInternal.getRsProps,\n getState: rsInternal.getRsStateResolver()!.getState,\n getOriginalState: rsInternal.getRsStateResolver()!.getOriginalState,\n dispatch: rsInternal.getRsStateResolver()!.dispatch\n });\n }\n });\n };\n}\n\n/**\n * Initializes and return before and after render features.\n * @param rsInternal\n * @returns\n */\nexport default function initializeFeatures(\n rsInternal: RsInternal\n): [(featureProps: MiddleWareFeatureProps) => Promise<void | null>, () => void] {\n return [initializeBeforeRenderFeatures(rsInternal), initializeAfterRenderFeatures(rsInternal)];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"autoSize.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC;AAO7D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,aAAa,UAAQ,UA0CtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,UAmBnF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,KAAK,CAAC,EAAE,OAAO;;EA8BhB"}
1
+ {"version":3,"file":"autoSize.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC;AAK7D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,aAAa,UAAQ,UA0DtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,UAmBnF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,KAAK,CAAC,EAAE,OAAO;;EA8BhB"}
@@ -1,6 +1,5 @@
1
- import { rowSelectColumnMeta } from '../../../../constants';
1
+ import { expandCollapseAllMeta, rowSelectColumnMeta } from '../../../../constants';
2
2
  import { getScrollbarWidth } from '../../../../utils/util';
3
- const GROUP_ICON_WIDTH = 24;
4
3
  /**
5
4
  * Calculates the width of column based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width.
6
5
  *
@@ -18,6 +17,8 @@ export function autoSizeOfColumn(column, domContainer, forceAutoSize = false) {
18
17
  if (column.field.width)
19
18
  return column.field.width;
20
19
  }
20
+ const view = column.parent;
21
+ const { showGroupingExpandCollapseAll, state: { showSelectAllCheckbox } } = view;
21
22
  // Condition for double click event triggered to autosize the column
22
23
  /* Autosize calculations begin */
23
24
  const cells = domContainer.querySelectorAll(`[data-col-id="${column.field.id}"]`);
@@ -34,12 +35,18 @@ export function autoSizeOfColumn(column, domContainer, forceAutoSize = false) {
34
35
  });
35
36
  let autoSize = Math.ceil(span.getBoundingClientRect().width);
36
37
  const iconsPlaceholder = domContainer.querySelector(`.header .cell[data-col-id="${column.field.id}"] .icons-ph`);
37
- const groupIconPlaceholder = domContainer.querySelector(`.show-expand-collapse-all .row .cell[data-col-id="${column.field.id}"]`);
38
+ // If grouping and select all functionality are enabled and selection is the first column, reserve extra space in Row select header column to accommodate expand all button.
39
+ const reserveSpaceForGroupToggleButton = showGroupingExpandCollapseAll &&
40
+ showSelectAllCheckbox &&
41
+ column.field.id === rowSelectColumnMeta.field.id &&
42
+ // TODO: Selectors should not be hardcoded in rsCore OR it should come via proper contract.
43
+ domContainer.querySelector(`.row .cell[data-col-id="${rowSelectColumnMeta.field.id}"]:first-child`);
38
44
  if (iconsPlaceholder) {
39
45
  autoSize += iconsPlaceholder.offsetWidth;
40
46
  }
41
- if (groupIconPlaceholder) {
42
- autoSize += GROUP_ICON_WIDTH;
47
+ if (reserveSpaceForGroupToggleButton) {
48
+ const expandCollapseAllElement = domContainer.querySelector(expandCollapseAllMeta.selector);
49
+ autoSize += expandCollapseAllElement ? expandCollapseAllElement.offsetWidth : 0;
43
50
  }
44
51
  domContainer.removeChild(holder);
45
52
  // Increased spacing style width by 1px to account for offsetWidth rounding off, this was causing truncation.
@@ -1 +1 @@
1
- {"version":3,"file":"autoSize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,YAA+C,EAC/C,aAAa,GAAG,KAAK;IAErB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,+CAA+C;QAC/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACxD,IAAI,iBAAiB;YAAE,OAAO,iBAAiB,CAAC;QAChD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IACpD,CAAC;IACD,oEAAoE;IACpE,iCAAiC;IACjC,MAAM,KAAK,GAAG,YAAY,CAAC,gBAAgB,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,EA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ClD,CAAC,eAAe,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnD,0BAA0B,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;IAC5D,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import type { ColumnResizePayload } from '../../../../actions/actions.types';\nimport { rowSelectColumnMeta } from '../../../../constants';\nimport type Column from '../../../../generators/ColumnGenerator';\nimport type View from '../../../../generators/ViewGenerator';\nimport { getScrollbarWidth } from '../../../../utils/util';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef } from '../../../../../../types/Meta.types';\n\nconst GROUP_ICON_WIDTH = 24;\n\n/**\n * Calculates the width of column based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width.\n *\n * @param column - A column object representing column in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param forceAutoSize - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns column width in pixels.\n */\nexport function autoSizeOfColumn(\n column: Column,\n domContainer: NonNullable<View['domContainer']>,\n forceAutoSize = false\n) {\n if (!forceAutoSize) {\n // This will be executed in case of reset width\n const personalizedWidth = column.getPersonalizedWidth();\n if (personalizedWidth) return personalizedWidth;\n if (column.field.width) return column.field.width;\n }\n // Condition for double click event triggered to autosize the column\n /* Autosize calculations begin */\n const cells = domContainer.querySelectorAll(`[data-col-id=\"${column.field.id}\"]`);\n const holder = document.createElement('div');\n holder.style.width = '100000px'; // some very high number\n const span = document.createElement('span');\n holder.appendChild(span);\n domContainer.appendChild(holder);\n cells.forEach(cell => {\n const row = document.createElement('div');\n row.style.display = 'table-row';\n cell.childNodes.forEach(child => row.appendChild(child.cloneNode(true)));\n span.appendChild(row);\n });\n let autoSize = Math.ceil(span.getBoundingClientRect().width);\n const iconsPlaceholder = domContainer.querySelector<HTMLElement>(\n `.header .cell[data-col-id=\"${column.field.id}\"] .icons-ph`\n );\n const groupIconPlaceholder = domContainer.querySelector<HTMLElement>(\n `.show-expand-collapse-all .row .cell[data-col-id=\"${column.field.id}\"]`\n );\n if (iconsPlaceholder) {\n autoSize += iconsPlaceholder.offsetWidth;\n }\n if (groupIconPlaceholder) {\n autoSize += GROUP_ICON_WIDTH;\n }\n domContainer.removeChild(holder);\n // Increased spacing style width by 1px to account for offsetWidth rounding off, this was causing truncation.\n autoSize += 17; // 17px for Spacing styles applied (Fetching applied styles is costly, so keeping some visible space)\n // Allow columns to autosize till a restricted max width\n return column.field.maxWidth && autoSize > column.field.maxWidth\n ? column.field.maxWidth\n : autoSize;\n}\n\n/**\n * Calculates the maximum width available in the dom container\n * @param domContainer The HTML element that acts as the container for RS.\n * @returns Maximum available width.\n */\nexport function getMaxAvailableWidth(domContainer: NonNullable<View['domContainer']>) {\n let width = domContainer.clientWidth - getScrollbarWidth();\n const firstCell = domContainer.querySelector('.cell');\n if (!firstCell) {\n return width;\n }\n let element = firstCell.parentElement!;\n let style = null;\n let margin = 0;\n let padding = 0;\n while (element !== domContainer.parentElement) {\n // @ts-expect-error Property 'currentStyle' does not exist on type 'HTMLElement' This was used for IE browser initially. Check if it can be removed.\n style = element.currentStyle || window.getComputedStyle(element);\n margin = parseFloat(style.marginLeft) + parseFloat(style.marginRight);\n padding = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n width -= padding + margin + element.offsetWidth - element.clientWidth;\n element = element.parentElement!;\n }\n return width;\n}\n\n/**\n * Calculates the width of columns based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width..\n *\n * @param columns - An array of `Column` objects representing the columns in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param reset - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns An object containing width for each column.\n */\nexport function autoSizeOfColumns(\n columns: Column[],\n domContainer: NonNullable<View['domContainer']>,\n reset?: boolean\n) {\n let totalCalculatedWidth = 0;\n const columnAutoSizes: ColumnResizePayload['data'] = {};\n\n const remainingAvailableWidth = getMaxAvailableWidth(domContainer);\n\n columns.forEach(column => {\n if (!column.hidden) {\n if (!(column.currentWidth && reset === undefined)) {\n // always calculate the content based width for row selection column because it's width will change depending on if grouping is applied or not.\n const forceAutosize = column.field.id === rowSelectColumnMeta.field.id || !reset;\n const autoSize = autoSizeOfColumn(column, domContainer, forceAutosize);\n columnAutoSizes[column.field.id] = autoSize;\n totalCalculatedWidth += autoSize;\n } else {\n totalCalculatedWidth += column.currentWidth;\n }\n }\n });\n const extraSpace = remainingAvailableWidth - totalCalculatedWidth;\n if (extraSpace <= 0 || Number.isNaN(extraSpace)) return columnAutoSizes;\n const columnToFillRemainingSpace = columns.find(c => c.field.fillAvailableSpace);\n\n if (columnToFillRemainingSpace && !columnToFillRemainingSpace.hidden) {\n columnAutoSizes[columnToFillRemainingSpace.field.id] =\n (columnAutoSizes[columnToFillRemainingSpace.field.id] ??\n columnToFillRemainingSpace.currentWidth) + extraSpace;\n }\n return columnAutoSizes;\n}\n"]}
1
+ {"version":3,"file":"autoSize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,YAA+C,EAC/C,aAAa,GAAG,KAAK;IAErB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,+CAA+C;QAC/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACxD,IAAI,iBAAiB;YAAE,OAAO,iBAAiB,CAAC;QAChD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IACpD,CAAC;IAED,MAAM,IAAI,GAAG,MA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CAAC;YACnC,CAAC;iBAAM,CAAC;gBACN,oBAAoB,IAAI,MAAM,CAAC,YAAY,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,uBAAuB,GAAG,oBAAoB,CAAC;IAClE,IAAI,UAAU,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;QAAE,OAAO,eAAe,CAAC;IACxE,MAAM,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAEjF,IAAI,0BAA0B,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,CAAC;QACrE,eAAe,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,CAAC,eAAe,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnD,0BAA0B,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;IAC5D,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import type { ColumnResizePayload } from '../../../../actions/actions.types';\nimport { expandCollapseAllMeta, rowSelectColumnMeta } from '../../../../constants';\nimport type Column from '../../../../generators/ColumnGenerator';\nimport type View from '../../../../generators/ViewGenerator';\nimport { getScrollbarWidth } from '../../../../utils/util';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef } from '../../../../../../types/Meta.types';\n\n/**\n * Calculates the width of column based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width.\n *\n * @param column - A column object representing column in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param forceAutoSize - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns column width in pixels.\n */\nexport function autoSizeOfColumn(\n column: Column,\n domContainer: NonNullable<View['domContainer']>,\n forceAutoSize = false\n) {\n if (!forceAutoSize) {\n // This will be executed in case of reset width\n const personalizedWidth = column.getPersonalizedWidth();\n if (personalizedWidth) return personalizedWidth;\n if (column.field.width) return column.field.width;\n }\n\n const view = column.parent;\n const {\n showGroupingExpandCollapseAll,\n state: { showSelectAllCheckbox }\n } = view;\n // Condition for double click event triggered to autosize the column\n /* Autosize calculations begin */\n const cells = domContainer.querySelectorAll(`[data-col-id=\"${column.field.id}\"]`);\n const holder = document.createElement('div');\n holder.style.width = '100000px'; // some very high number\n const span = document.createElement('span');\n holder.appendChild(span);\n domContainer.appendChild(holder);\n cells.forEach(cell => {\n const row = document.createElement('div');\n row.style.display = 'table-row';\n cell.childNodes.forEach(child => row.appendChild(child.cloneNode(true)));\n span.appendChild(row);\n });\n let autoSize = Math.ceil(span.getBoundingClientRect().width);\n const iconsPlaceholder = domContainer.querySelector<HTMLElement>(\n `.header .cell[data-col-id=\"${column.field.id}\"] .icons-ph`\n );\n // If grouping and select all functionality are enabled and selection is the first column, reserve extra space in Row select header column to accommodate expand all button.\n const reserveSpaceForGroupToggleButton =\n showGroupingExpandCollapseAll &&\n showSelectAllCheckbox &&\n column.field.id === rowSelectColumnMeta.field.id &&\n // TODO: Selectors should not be hardcoded in rsCore OR it should come via proper contract.\n domContainer.querySelector<HTMLElement>(\n `.row .cell[data-col-id=\"${rowSelectColumnMeta.field.id}\"]:first-child`\n );\n\n if (iconsPlaceholder) {\n autoSize += iconsPlaceholder.offsetWidth;\n }\n if (reserveSpaceForGroupToggleButton) {\n const expandCollapseAllElement = domContainer.querySelector<HTMLElement>(\n expandCollapseAllMeta.selector\n );\n autoSize += expandCollapseAllElement ? expandCollapseAllElement.offsetWidth : 0;\n }\n domContainer.removeChild(holder);\n // Increased spacing style width by 1px to account for offsetWidth rounding off, this was causing truncation.\n autoSize += 17; // 17px for Spacing styles applied (Fetching applied styles is costly, so keeping some visible space)\n // Allow columns to autosize till a restricted max width\n return column.field.maxWidth && autoSize > column.field.maxWidth\n ? column.field.maxWidth\n : autoSize;\n}\n\n/**\n * Calculates the maximum width available in the dom container\n * @param domContainer The HTML element that acts as the container for RS.\n * @returns Maximum available width.\n */\nexport function getMaxAvailableWidth(domContainer: NonNullable<View['domContainer']>) {\n let width = domContainer.clientWidth - getScrollbarWidth();\n const firstCell = domContainer.querySelector('.cell');\n if (!firstCell) {\n return width;\n }\n let element = firstCell.parentElement!;\n let style = null;\n let margin = 0;\n let padding = 0;\n while (element !== domContainer.parentElement) {\n // @ts-expect-error Property 'currentStyle' does not exist on type 'HTMLElement' This was used for IE browser initially. Check if it can be removed.\n style = element.currentStyle || window.getComputedStyle(element);\n margin = parseFloat(style.marginLeft) + parseFloat(style.marginRight);\n padding = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n width -= padding + margin + element.offsetWidth - element.clientWidth;\n element = element.parentElement!;\n }\n return width;\n}\n\n/**\n * Calculates the width of columns based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width..\n *\n * @param columns - An array of `Column` objects representing the columns in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param reset - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns An object containing width for each column.\n */\nexport function autoSizeOfColumns(\n columns: Column[],\n domContainer: NonNullable<View['domContainer']>,\n reset?: boolean\n) {\n let totalCalculatedWidth = 0;\n const columnAutoSizes: ColumnResizePayload['data'] = {};\n\n const remainingAvailableWidth = getMaxAvailableWidth(domContainer);\n\n columns.forEach(column => {\n if (!column.hidden) {\n if (!(column.currentWidth && reset === undefined)) {\n // always calculate the content based width for row selection column because it's width will change depending on if grouping is applied or not.\n const forceAutosize = column.field.id === rowSelectColumnMeta.field.id || !reset;\n const autoSize = autoSizeOfColumn(column, domContainer, forceAutosize);\n columnAutoSizes[column.field.id] = autoSize;\n totalCalculatedWidth += autoSize;\n } else {\n totalCalculatedWidth += column.currentWidth;\n }\n }\n });\n const extraSpace = remainingAvailableWidth - totalCalculatedWidth;\n if (extraSpace <= 0 || Number.isNaN(extraSpace)) return columnAutoSizes;\n const columnToFillRemainingSpace = columns.find(c => c.field.fillAvailableSpace);\n\n if (columnToFillRemainingSpace && !columnToFillRemainingSpace.hidden) {\n columnAutoSizes[columnToFillRemainingSpace.field.id] =\n (columnAutoSizes[columnToFillRemainingSpace.field.id] ??\n columnToFillRemainingSpace.currentWidth) + extraSpace;\n }\n return columnAutoSizes;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAU1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAwD5D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE;IAC7E,YAAY,EAAE,UAAU,CAAC,YAAY,EAAE,kBAAkB,GAAG,YAAY,CAAC;CAC1E,QA2DA;AAWD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;+BAKuB,cAAc,YAAY;AAJpD,wBAwBE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAU1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAmE5D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE;IAC7E,YAAY,EAAE,UAAU,CAAC,YAAY,EAAE,kBAAkB,GAAG,YAAY,CAAC;CAC1E,QA2DA;AAWD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;+BAMuB,cAAc,YAAY;AALpD,wBA0BE"}