@revolist/revogrid 3.1.6 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/revo-grid/_baseIteratee-af30b221.js +2070 -0
  2. package/dist/{collection/global/global.js → revo-grid/app-globals-7e6866ba.js} +11 -2
  3. package/dist/{collection/components/data/columnService.js → revo-grid/columnService-91e552ba.js} +11 -6
  4. package/dist/revo-grid/consts-ef824e6f.js +46 -0
  5. package/dist/revo-grid/css-shim-5387c708.js +7 -0
  6. package/dist/revo-grid/data.store-3263fff9.js +557 -0
  7. package/dist/revo-grid/debounce-aaa4b4da.js +217 -0
  8. package/dist/revo-grid/dimension.helpers-a7944fc4.js +340 -0
  9. package/dist/revo-grid/dispatcher-891af82e.js +24 -0
  10. package/dist/{cjs/dom-c8b6d1a7.js → revo-grid/dom-21bd1807.js} +4 -3
  11. package/dist/revo-grid/each-0378e5a3.js +180 -0
  12. package/dist/{collection/plugins/filter/filter.button.js → revo-grid/filter.button-74c1cd9c.js} +16 -10
  13. package/dist/revo-grid/identity-c8c7d3d8.js +26 -0
  14. package/dist/revo-grid/index-8a604c17.js +3067 -0
  15. package/dist/revo-grid/index.esm.js +3 -0
  16. package/dist/revo-grid/isString-a51066b5.js +34 -0
  17. package/dist/revo-grid/isSymbol-e4b5dafe.js +247 -0
  18. package/dist/revo-grid/keyCodes.utils-bd06e3ba.js +299 -0
  19. package/dist/revo-grid/keys-70b7c240.js +561 -0
  20. package/dist/{collection/services/localScrollService.js → revo-grid/localScrollService-e9b73323.js} +8 -2
  21. package/dist/{esm/revo-grid_11.entry.js → revo-grid/lodash-a0ab4cdd.js} +13773 -24597
  22. package/dist/{cjs/resize-observer-8dc80084.js → revo-grid/resize-observer-00c48d78.js} +25 -14
  23. package/dist/revo-grid/revo-grid.entry.js +3484 -0
  24. package/dist/revo-grid/revo-grid.esm.js +133 -1
  25. package/dist/revo-grid/revogr-clipboard.entry.js +52 -1
  26. package/dist/revo-grid/revogr-data.entry.js +152 -0
  27. package/dist/revo-grid/revogr-edit.entry.js +105 -0
  28. package/dist/revo-grid/revogr-filter-panel.entry.js +277 -1
  29. package/dist/revo-grid/revogr-focus.entry.js +41 -0
  30. package/dist/revo-grid/revogr-header.entry.js +560 -0
  31. package/dist/revo-grid/revogr-order-editor.entry.js +175 -0
  32. package/dist/revo-grid/revogr-overlay-selection.entry.js +711 -0
  33. package/dist/revo-grid/revogr-row-headers.entry.js +73 -0
  34. package/dist/revo-grid/revogr-scroll-virtual.entry.js +114 -0
  35. package/dist/revo-grid/revogr-temp-range.entry.js +73 -0
  36. package/dist/revo-grid/revogr-viewport-scroll.entry.js +340 -0
  37. package/dist/revo-grid/selection.store.connector-2b613fd0.js +503 -0
  38. package/dist/{collection/components/overlay/selection.utils.js → revo-grid/selection.utils-a9932db6.js} +15 -9
  39. package/dist/revo-grid/shadow-css-602a09db.js +390 -0
  40. package/dist/{collection/themeManager/themeService.js → revo-grid/themeService-ddaaa364.js} +26 -6
  41. package/dist/revo-grid/toInteger-9e6cbfd2.js +107 -0
  42. package/dist/revo-grid/toNumber-913b0b72.js +105 -0
  43. package/dist/{collection/utils/utils.js → revo-grid/utils-2c3b3857.js} +13 -8
  44. package/dist/revo-grid/viewport.helpers-49d3f031.js +16 -0
  45. package/dist/{collection/store/viewPort/viewport.helpers.js → revo-grid/viewport.store-ffaaab6d.js} +135 -9
  46. package/dist/types/components/revo-grid/revo-grid.d.ts +6 -0
  47. package/dist/types/components.d.ts +110 -58
  48. package/dist/types/plugins/dispatcher.d.ts +10 -0
  49. package/dist/types/plugins/moveColumn/columnDragPlugin.d.ts +66 -0
  50. package/dist/types/plugins/moveColumn/columnOrderHandler.d.ts +12 -0
  51. package/dist/types/services/resizable.directive.d.ts +1 -1
  52. package/dist/types/stencil-public-runtime.d.ts +189 -186
  53. package/package.json +22 -20
  54. package/custom-element/index.js +0 -28972
  55. package/custom-element/resize-observer.js +0 -489
  56. package/dist/cjs/css-shim-e33df79c.js +0 -6
  57. package/dist/cjs/debounce-e9b040d9.js +0 -575
  58. package/dist/cjs/index-d3f67f2e.js +0 -1729
  59. package/dist/cjs/index.cjs.js +0 -2
  60. package/dist/cjs/loader.cjs.js +0 -35
  61. package/dist/cjs/revo-grid.cjs.js +0 -73
  62. package/dist/cjs/revo-grid_11.cjs.entry.js +0 -28056
  63. package/dist/cjs/revogr-clipboard.cjs.entry.js +0 -53
  64. package/dist/cjs/revogr-filter-panel.cjs.entry.js +0 -275
  65. package/dist/collection/collection-manifest.json +0 -25
  66. package/dist/collection/components/button/button.js +0 -4
  67. package/dist/collection/components/clipboard/revogr-clipboard.js +0 -121
  68. package/dist/collection/components/data/cellRenderer.js +0 -24
  69. package/dist/collection/components/data/revogr-data-style.css +0 -135
  70. package/dist/collection/components/data/revogr-data.js +0 -322
  71. package/dist/collection/components/data/rowRenderer.js +0 -6
  72. package/dist/collection/components/header/headerCellRenderer.js +0 -19
  73. package/dist/collection/components/header/headerRenderer.js +0 -45
  74. package/dist/collection/components/header/revogr-header-style.css +0 -198
  75. package/dist/collection/components/header/revogr-header.js +0 -297
  76. package/dist/collection/components/order/orderRenderer.js +0 -50
  77. package/dist/collection/components/order/revogr-order-editor.js +0 -358
  78. package/dist/collection/components/order/rowOrderService.js +0 -68
  79. package/dist/collection/components/overlay/autofill.service.js +0 -182
  80. package/dist/collection/components/overlay/clipboard.service.js +0 -39
  81. package/dist/collection/components/overlay/editors/edit.utils.js +0 -5
  82. package/dist/collection/components/overlay/editors/text.js +0 -35
  83. package/dist/collection/components/overlay/keyboard.service.js +0 -128
  84. package/dist/collection/components/overlay/revogr-edit-style.css +0 -86
  85. package/dist/collection/components/overlay/revogr-edit.js +0 -159
  86. package/dist/collection/components/overlay/revogr-overlay-selection.js +0 -726
  87. package/dist/collection/components/overlay/revogr-overlay-style.css +0 -98
  88. package/dist/collection/components/revo-grid/revo-grid-style.css +0 -527
  89. package/dist/collection/components/revo-grid/revo-grid.js +0 -2186
  90. package/dist/collection/components/revo-grid/viewport.helpers.js +0 -11
  91. package/dist/collection/components/revo-grid/viewport.interfaces.js +0 -1
  92. package/dist/collection/components/revo-grid/viewport.js +0 -18
  93. package/dist/collection/components/revo-grid/viewport.resize.service.js +0 -21
  94. package/dist/collection/components/revo-grid/viewport.scrolling.service.js +0 -60
  95. package/dist/collection/components/revo-grid/viewport.section.js +0 -28
  96. package/dist/collection/components/revo-grid/viewport.service.js +0 -209
  97. package/dist/collection/components/rowHeaders/revogr-row-headers.js +0 -210
  98. package/dist/collection/components/rowHeaders/row-header-render.js +0 -1
  99. package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +0 -137
  100. package/dist/collection/components/scroll/revogr-viewport-scroll.js +0 -399
  101. package/dist/collection/components/scrollable/revogr-scroll-style.css +0 -104
  102. package/dist/collection/components/scrollable/revogr-scroll-virtual.js +0 -253
  103. package/dist/collection/components/selection-focus/revogr-focus-style.css +0 -77
  104. package/dist/collection/components/selection-focus/revogr-focus.js +0 -103
  105. package/dist/collection/components/selection-temp-range/revogr-temp-range-style.css +0 -98
  106. package/dist/collection/components/selection-temp-range/revogr-temp-range.js +0 -138
  107. package/dist/collection/index.js +0 -1
  108. package/dist/collection/plugins/autoSizeColumn.js +0 -230
  109. package/dist/collection/plugins/basePlugin.js +0 -27
  110. package/dist/collection/plugins/export/csv.js +0 -68
  111. package/dist/collection/plugins/export/export.plugin.js +0 -165
  112. package/dist/collection/plugins/export/types.js +0 -1
  113. package/dist/collection/plugins/filter/conditions/equal.js +0 -17
  114. package/dist/collection/plugins/filter/conditions/number/greaterThan.js +0 -10
  115. package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js +0 -7
  116. package/dist/collection/plugins/filter/conditions/number/lessThan.js +0 -12
  117. package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js +0 -7
  118. package/dist/collection/plugins/filter/conditions/set.js +0 -3
  119. package/dist/collection/plugins/filter/conditions/string/beginswith.js +0 -17
  120. package/dist/collection/plugins/filter/conditions/string/contains.js +0 -18
  121. package/dist/collection/plugins/filter/filter.plugin.js +0 -256
  122. package/dist/collection/plugins/filter/filter.pop.js +0 -485
  123. package/dist/collection/plugins/filter/filter.service.js +0 -44
  124. package/dist/collection/plugins/filter/filter.style.css +0 -239
  125. package/dist/collection/plugins/filter/filter.types.js +0 -1
  126. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +0 -30
  127. package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js +0 -36
  128. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +0 -21
  129. package/dist/collection/plugins/groupingRow/grouping.const.js +0 -10
  130. package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js +0 -76
  131. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +0 -258
  132. package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +0 -29
  133. package/dist/collection/plugins/groupingRow/grouping.row.types.js +0 -1
  134. package/dist/collection/plugins/groupingRow/grouping.service.js +0 -155
  135. package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js +0 -57
  136. package/dist/collection/plugins/sorting/sorting.plugin.js +0 -181
  137. package/dist/collection/plugins/sorting/sorting.sign.js +0 -6
  138. package/dist/collection/plugins/stretchPlugin.js +0 -68
  139. package/dist/collection/plugins/trimmed/trimmed.plugin.js +0 -32
  140. package/dist/collection/services/cell.helpers.js +0 -7
  141. package/dist/collection/services/column.data.provider.js +0 -188
  142. package/dist/collection/services/data.provider.js +0 -47
  143. package/dist/collection/services/dimension.provider.js +0 -78
  144. package/dist/collection/services/resizable.directive.js +0 -250
  145. package/dist/collection/services/selection.store.connector.js +0 -213
  146. package/dist/collection/services/viewport.provider.js +0 -14
  147. package/dist/collection/store/dataSource/data.proxy.js +0 -34
  148. package/dist/collection/store/dataSource/data.store.js +0 -127
  149. package/dist/collection/store/dimension/dimension.helpers.js +0 -107
  150. package/dist/collection/store/dimension/dimension.store.js +0 -59
  151. package/dist/collection/store/selection/selection.helpers.js +0 -53
  152. package/dist/collection/store/selection/selection.store.js +0 -68
  153. package/dist/collection/store/selection/selection.store.service.js +0 -35
  154. package/dist/collection/store/storeTypes.js +0 -5
  155. package/dist/collection/store/viewPort/viewport.store.js +0 -121
  156. package/dist/collection/themeManager/theme.compact.js +0 -5
  157. package/dist/collection/themeManager/theme.default.js +0 -5
  158. package/dist/collection/themeManager/theme.material.js +0 -5
  159. package/dist/collection/utils/closestPolifill.js +0 -18
  160. package/dist/collection/utils/consts.js +0 -19
  161. package/dist/collection/utils/generateAlphabetHeader.js +0 -20
  162. package/dist/collection/utils/keyCodes.js +0 -70
  163. package/dist/collection/utils/keyCodes.utils.js +0 -64
  164. package/dist/collection/utils/platform.js +0 -5
  165. package/dist/collection/utils/resizeObserver.js +0 -6
  166. package/dist/collection/utils/store.utils.js +0 -7
  167. package/dist/collection/utilsExternal/generate-data.js +0 -132
  168. package/dist/esm/css-shim-8d75038b.js +0 -4
  169. package/dist/esm/debounce-8dadcda7.js +0 -558
  170. package/dist/esm/dom-1b195079.js +0 -73
  171. package/dist/esm/index-42c84e7c.js +0 -1694
  172. package/dist/esm/index.js +0 -1
  173. package/dist/esm/loader.js +0 -31
  174. package/dist/esm/polyfills/core-js.js +0 -11
  175. package/dist/esm/polyfills/css-shim.js +0 -1
  176. package/dist/esm/polyfills/dom.js +0 -79
  177. package/dist/esm/polyfills/es5-html-element.js +0 -1
  178. package/dist/esm/polyfills/index.js +0 -34
  179. package/dist/esm/polyfills/system.js +0 -6
  180. package/dist/esm/resize-observer-56b7b34f.js +0 -489
  181. package/dist/esm/revo-grid.js +0 -71
  182. package/dist/esm/revogr-clipboard.entry.js +0 -49
  183. package/dist/esm/revogr-filter-panel.entry.js +0 -271
  184. package/dist/esm-es5/css-shim-8d75038b.js +0 -1
  185. package/dist/esm-es5/debounce-8dadcda7.js +0 -1
  186. package/dist/esm-es5/dom-1b195079.js +0 -21
  187. package/dist/esm-es5/index-42c84e7c.js +0 -1
  188. package/dist/esm-es5/index.js +0 -0
  189. package/dist/esm-es5/loader.js +0 -1
  190. package/dist/esm-es5/resize-observer-56b7b34f.js +0 -1
  191. package/dist/esm-es5/revo-grid.js +0 -1
  192. package/dist/esm-es5/revo-grid_11.entry.js +0 -1
  193. package/dist/esm-es5/revogr-clipboard.entry.js +0 -1
  194. package/dist/esm-es5/revogr-filter-panel.entry.js +0 -1
  195. package/dist/index.cjs.js +0 -1
  196. package/dist/index.js +0 -1
  197. package/dist/revo-grid/css-shim-88bfb262.system.js +0 -1
  198. package/dist/revo-grid/css-shim-8d75038b.js +0 -1
  199. package/dist/revo-grid/debounce-d097578d.js +0 -1
  200. package/dist/revo-grid/debounce-f40a88f6.system.js +0 -1
  201. package/dist/revo-grid/dom-1b195079.js +0 -19
  202. package/dist/revo-grid/dom-ee2dd1b3.system.js +0 -21
  203. package/dist/revo-grid/index-a15e7527.system.js +0 -1
  204. package/dist/revo-grid/index-a7f99799.js +0 -1
  205. package/dist/revo-grid/index.system.js +0 -1
  206. package/dist/revo-grid/resize-observer-56b7b34f.js +0 -1
  207. package/dist/revo-grid/resize-observer-7a7b9757.system.js +0 -1
  208. package/dist/revo-grid/revo-grid.js +0 -132
  209. package/dist/revo-grid/revo-grid.system.js +0 -1
  210. package/dist/revo-grid/revo-grid_11.entry.js +0 -1
  211. package/dist/revo-grid/revo-grid_11.system.entry.js +0 -1
  212. package/dist/revo-grid/revogr-clipboard.system.entry.js +0 -1
  213. package/dist/revo-grid/revogr-filter-panel.system.entry.js +0 -1
@@ -1,6 +1,9 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  /* Generate range on size
2
5
  */
3
- export function range(size, startAt = 0) {
6
+ function range(size, startAt = 0) {
4
7
  const res = [];
5
8
  const end = startAt + size;
6
9
  for (let i = startAt; i < end; i++) {
@@ -9,7 +12,7 @@ export function range(size, startAt = 0) {
9
12
  return res;
10
13
  }
11
14
  /* Find index position in array */
12
- export function findPositionInArray(el, compareFn) {
15
+ function findPositionInArray(el, compareFn) {
13
16
  return (function (arr) {
14
17
  let m = 0;
15
18
  let n = arr.length - 1;
@@ -29,7 +32,7 @@ export function findPositionInArray(el, compareFn) {
29
32
  return -m - 1;
30
33
  })(this);
31
34
  }
32
- export function pushSorted(arr, el, fn) {
35
+ function pushSorted(arr, el, fn) {
33
36
  arr.splice(findPositionInArray.bind(arr)(el, fn), 0, el);
34
37
  return arr;
35
38
  }
@@ -37,7 +40,7 @@ export function pushSorted(arr, el, fn) {
37
40
  function simpleCompare(el1, el2) {
38
41
  return el1 < el2;
39
42
  }
40
- export function mergeSortedArray(arr1, arr2, compareFn = simpleCompare) {
43
+ function mergeSortedArray(arr1, arr2, compareFn = simpleCompare) {
41
44
  const merged = [];
42
45
  let index1 = 0;
43
46
  let index2 = 0;
@@ -58,7 +61,7 @@ export function mergeSortedArray(arr1, arr2, compareFn = simpleCompare) {
58
61
  return merged;
59
62
  }
60
63
  /* Calculate system scrollbar width */
61
- export function getScrollbarWidth(doc) {
64
+ function getScrollbarWidth(doc) {
62
65
  // Creating invisible container
63
66
  const outer = doc.createElement('div');
64
67
  const styles = outer.style;
@@ -87,18 +90,20 @@ export function getScrollbarWidth(doc) {
87
90
  *
88
91
  * ~~ return value does the equivalent of Math.floor but faster.
89
92
  */
90
- export function scaleValue(value, from, to) {
93
+ function scaleValue(value, from, to) {
91
94
  return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
92
95
  }
93
- export async function timeout(delay = 0) {
96
+ async function timeout(delay = 0) {
94
97
  await new Promise((r) => {
95
98
  setTimeout(() => r(), delay);
96
99
  });
97
100
  }
98
- export function applyMixins(derivedCtor, constructors) {
101
+ function applyMixins(derivedCtor, constructors) {
99
102
  constructors.forEach(baseCtor => {
100
103
  Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
101
104
  Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null));
102
105
  });
103
106
  });
104
107
  }
108
+
109
+ export { getScrollbarWidth as g, mergeSortedArray as m, scaleValue as s, timeout as t };
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
4
+ const HEADER_SLOT = 'header';
5
+ const FOOTER_SLOT = 'footer';
6
+ const CONTENT_SLOT = 'content';
7
+ const DATA_SLOT = 'data';
8
+ /** Receive last visible in viewport by required type */
9
+ function getLastCell(data, rowType) {
10
+ return {
11
+ x: data.viewports[data.colType].store.get('realCount'),
12
+ y: data.viewports[rowType].store.get('realCount'),
13
+ };
14
+ }
15
+
16
+ export { CONTENT_SLOT as C, DATA_SLOT as D, FOOTER_SLOT as F, HEADER_SLOT as H, getLastCell as g };
@@ -1,10 +1,15 @@
1
- import { getItemByPosition } from '../dimension/dimension.helpers';
1
+ /*!
2
+ * Built by Revolist
3
+ */
4
+ import { c as createStore, d as setStore } from './data.store-3263fff9.js';
5
+ import { a as getItemByPosition } from './dimension.helpers-a7944fc4.js';
6
+
2
7
  /**
3
8
  * Update items based on new scroll position
4
9
  * If viewport wasn't changed fully simple recombination of positions
5
10
  * Otherwise rebuild viewport items
6
11
  */
7
- export function getUpdatedItemsByPosition(pos, items, realCount, virtualSize, dimension) {
12
+ function getUpdatedItemsByPosition(pos, items, realCount, virtualSize, dimension) {
8
13
  const activeItem = getItemByPosition(dimension, pos);
9
14
  const firstItem = getFirstItem(items);
10
15
  let toUpdate;
@@ -45,7 +50,7 @@ export function getUpdatedItemsByPosition(pos, items, realCount, virtualSize, di
45
50
  }
46
51
  return toUpdate;
47
52
  }
48
- export function updateMissingAndRange(items, missing, range) {
53
+ function updateMissingAndRange(items, missing, range) {
49
54
  items.splice(range.end + 1, 0, ...missing);
50
55
  // update range if start larger after recombination
51
56
  if (range.start >= range.end && !(range.start === range.end && range.start === 0)) {
@@ -54,7 +59,7 @@ export function updateMissingAndRange(items, missing, range) {
54
59
  range.end += missing.length;
55
60
  }
56
61
  // if partial replacement add items if revo-viewport has some space left
57
- export function addMissingItems(firstItem, realCount, virtualSize, existingCollection, dimension) {
62
+ function addMissingItems(firstItem, realCount, virtualSize, existingCollection, dimension) {
58
63
  const lastItem = getLastItem(existingCollection);
59
64
  const items = getItems({
60
65
  sizes: dimension.sizes,
@@ -67,7 +72,7 @@ export function addMissingItems(firstItem, realCount, virtualSize, existingColle
67
72
  return items;
68
73
  }
69
74
  // get revo-viewport items parameters, caching position and calculating items count in revo-viewport
70
- export function getItems(opt, currentSize = 0) {
75
+ function getItems(opt, currentSize = 0) {
71
76
  const items = [];
72
77
  let index = opt.startIndex;
73
78
  let size = currentSize;
@@ -88,7 +93,7 @@ export function getItems(opt, currentSize = 0) {
88
93
  * Do batch items recombination
89
94
  * If items not overlapped with existing viewport returns null
90
95
  */
91
- export function recombineByOffset(offset, data) {
96
+ function recombineByOffset(offset, data) {
92
97
  const newItems = [...data.items];
93
98
  const itemsCount = newItems.length;
94
99
  let newRange = {
@@ -169,12 +174,133 @@ function getItemSize(index, sizes, origSize = 0) {
169
174
  }
170
175
  return origSize;
171
176
  }
172
- export function isActiveRange(pos, item) {
177
+ function isActiveRange(pos, item) {
173
178
  return item && pos >= item.start && pos <= item.end;
174
179
  }
175
- export function getFirstItem(s) {
180
+ function getFirstItem(s) {
176
181
  return s.items[s.start];
177
182
  }
178
- export function getLastItem(s) {
183
+ function getLastItem(s) {
179
184
  return s.items[s.end];
180
185
  }
186
+
187
+ /**
188
+ * Store is responsible for visible
189
+ * Viewport information for each dimension
190
+ * Redraw items during scrolling
191
+ */
192
+ function initialState() {
193
+ return {
194
+ // virtual item information per rendered item
195
+ items: [],
196
+ // virtual dom item order to render
197
+ start: 0,
198
+ end: 0,
199
+ // size of viewport in px
200
+ virtualSize: 0,
201
+ // total number of items
202
+ realCount: 0,
203
+ // last coordinate for store position restore
204
+ lastCoordinate: 0,
205
+ };
206
+ }
207
+ class ViewportStore {
208
+ constructor() {
209
+ this.store = createStore(initialState());
210
+ this.store.onChange('realCount', () => this.clear());
211
+ }
212
+ /** Render viewport based on coordinate, this is main method for draw */
213
+ setViewPortCoordinate(position, dimension) {
214
+ let virtualSize = this.store.get('virtualSize');
215
+ // no visible data to calculate
216
+ if (!virtualSize) {
217
+ return;
218
+ }
219
+ const frameOffset = dimension.frameOffset;
220
+ const outsize = frameOffset * 2 * dimension.originItemSize;
221
+ virtualSize += outsize;
222
+ let maxCoordinate = virtualSize;
223
+ if (dimension.realSize > virtualSize) {
224
+ maxCoordinate = dimension.realSize - virtualSize;
225
+ }
226
+ let toUpdate = {
227
+ lastCoordinate: position,
228
+ };
229
+ let pos = position;
230
+ pos -= frameOffset * dimension.originItemSize;
231
+ pos = pos < 0 ? 0 : pos < maxCoordinate ? pos : maxCoordinate;
232
+ const firstItem = getFirstItem(this.getItems());
233
+ const lastItem = getLastItem(this.getItems());
234
+ // left position changed
235
+ if (!isActiveRange(pos, firstItem)) {
236
+ toUpdate = Object.assign(Object.assign({}, toUpdate), getUpdatedItemsByPosition(pos, this.getItems(), this.store.get('realCount'), virtualSize, dimension));
237
+ setStore(this.store, Object.assign({}, toUpdate));
238
+ // right position changed
239
+ }
240
+ else if (firstItem && this.store.get('virtualSize') + pos > (lastItem === null || lastItem === void 0 ? void 0 : lastItem.end)) {
241
+ // check is any item missing for full fill content
242
+ const missing = addMissingItems(firstItem, this.store.get('realCount'), virtualSize + pos - firstItem.start, this.getItems(), dimension);
243
+ if (missing.length) {
244
+ const items = [...this.store.get('items')];
245
+ const range = {
246
+ start: this.store.get('start'),
247
+ end: this.store.get('end'),
248
+ };
249
+ updateMissingAndRange(items, missing, range);
250
+ toUpdate = Object.assign(Object.assign(Object.assign({}, toUpdate), { items: [...items] }), range);
251
+ setStore(this.store, Object.assign({}, toUpdate));
252
+ }
253
+ }
254
+ }
255
+ /** Update viewport sizes */
256
+ setViewPortDimension(sizes) {
257
+ const items = this.store.get('items');
258
+ const count = items.length;
259
+ // viewport not inited
260
+ if (!count) {
261
+ return;
262
+ }
263
+ let changedCoordinate = 0;
264
+ let i = 0;
265
+ let start = this.store.get('start');
266
+ // loop through array from initial item after recombination
267
+ while (i < count) {
268
+ const item = items[start];
269
+ // change pos if size change present before
270
+ if (changedCoordinate) {
271
+ item.start += changedCoordinate;
272
+ item.end += changedCoordinate;
273
+ }
274
+ // change size
275
+ const size = sizes[item.itemIndex];
276
+ if (size) {
277
+ const changedSize = size - item.size;
278
+ changedCoordinate += changedSize;
279
+ item.size = size;
280
+ item.end = item.start + size;
281
+ }
282
+ // loop by start index
283
+ start++;
284
+ i++;
285
+ if (start === count) {
286
+ start = 0;
287
+ }
288
+ }
289
+ setStore(this.store, { items: [...items] });
290
+ }
291
+ getItems() {
292
+ return {
293
+ items: this.store.get('items'),
294
+ start: this.store.get('start'),
295
+ end: this.store.get('end'),
296
+ };
297
+ }
298
+ setViewport(data) {
299
+ setStore(this.store, data);
300
+ }
301
+ clear() {
302
+ this.store.set('items', []);
303
+ }
304
+ }
305
+
306
+ export { ViewportStore as V };
@@ -87,6 +87,12 @@ export declare class RevoGridComponent {
87
87
  * Can be filter collection
88
88
  */
89
89
  filter: boolean | ColumnFilterConfig;
90
+ /**
91
+ * Enables column move plugin
92
+ * Can be boolean
93
+ * Can be filter collection
94
+ */
95
+ canMoveColumns: boolean;
90
96
  /**
91
97
  * Trimmed rows
92
98
  * Functionality which allows to hide rows from main data set