@revolist/revogrid 3.1.8 → 3.1.90

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 (240) hide show
  1. package/custom-element/_baseIteratee.js +2070 -0
  2. package/custom-element/columnService.js +743 -0
  3. package/custom-element/consts.js +46 -0
  4. package/custom-element/data.store.js +545 -0
  5. package/custom-element/debounce.js +217 -0
  6. package/custom-element/dimension.helpers.js +340 -0
  7. package/custom-element/each.js +180 -0
  8. package/custom-element/filter.button.js +36 -0
  9. package/custom-element/identity.js +26 -0
  10. package/custom-element/index.d.ts +15 -98
  11. package/custom-element/index.js +18 -28962
  12. package/custom-element/isSymbol.js +220 -0
  13. package/custom-element/keys.js +561 -0
  14. package/custom-element/localScrollService.js +86 -0
  15. package/custom-element/resize-observer.js +25 -11
  16. package/custom-element/revo-grid.d.ts +11 -0
  17. package/custom-element/revo-grid.js +3662 -0
  18. package/custom-element/revogr-clipboard.d.ts +11 -0
  19. package/custom-element/revogr-clipboard.js +72 -0
  20. package/custom-element/revogr-data.d.ts +11 -0
  21. package/custom-element/revogr-data.js +9 -0
  22. package/custom-element/revogr-data2.js +171 -0
  23. package/custom-element/revogr-edit.d.ts +11 -0
  24. package/custom-element/revogr-edit.js +9 -0
  25. package/custom-element/revogr-edit2.js +402 -0
  26. package/custom-element/revogr-filter-panel.d.ts +11 -0
  27. package/custom-element/revogr-filter-panel.js +308 -0
  28. package/custom-element/revogr-focus.d.ts +11 -0
  29. package/custom-element/revogr-focus.js +9 -0
  30. package/custom-element/revogr-focus2.js +64 -0
  31. package/custom-element/revogr-header.d.ts +11 -0
  32. package/custom-element/revogr-header.js +9 -0
  33. package/custom-element/revogr-header2.js +591 -0
  34. package/custom-element/revogr-order-editor.d.ts +11 -0
  35. package/custom-element/revogr-order-editor.js +9 -0
  36. package/custom-element/revogr-order-editor2.js +190 -0
  37. package/custom-element/revogr-overlay-selection.d.ts +11 -0
  38. package/custom-element/revogr-overlay-selection.js +9 -0
  39. package/custom-element/revogr-overlay-selection2.js +741 -0
  40. package/custom-element/revogr-row-headers.d.ts +11 -0
  41. package/custom-element/revogr-row-headers.js +9 -0
  42. package/custom-element/revogr-row-headers2.js +403 -0
  43. package/custom-element/revogr-scroll-virtual.d.ts +11 -0
  44. package/custom-element/revogr-scroll-virtual.js +9 -0
  45. package/custom-element/revogr-scroll-virtual2.js +135 -0
  46. package/custom-element/revogr-temp-range.d.ts +11 -0
  47. package/custom-element/revogr-temp-range.js +9 -0
  48. package/custom-element/revogr-temp-range2.js +17275 -0
  49. package/custom-element/revogr-viewport-scroll.d.ts +11 -0
  50. package/custom-element/revogr-viewport-scroll.js +9 -0
  51. package/custom-element/revogr-viewport-scroll2.js +367 -0
  52. package/custom-element/selection.utils.js +106 -0
  53. package/custom-element/toInteger.js +107 -0
  54. package/custom-element/toNumber.js +105 -0
  55. package/custom-element/utils.js +69 -0
  56. package/dist/cjs/css-shim-9f5bc84d.js +9 -0
  57. package/dist/cjs/{debounce-e9b040d9.js → debounce-6cea2774.js} +4 -1
  58. package/dist/cjs/{dom-c8b6d1a7.js → dom-fcb646f0.js} +4 -1
  59. package/dist/cjs/{index-d3f67f2e.js → index-cb904e00.js} +214 -91
  60. package/dist/cjs/index.cjs.js +3 -0
  61. package/dist/cjs/loader.cjs.js +7 -4
  62. package/dist/cjs/{resize-observer-8dc80084.js → resize-observer-bf327d6a.js} +25 -10
  63. package/dist/cjs/revo-grid.cjs.js +13 -7
  64. package/dist/cjs/revo-grid_11.cjs.entry.js +277 -15
  65. package/dist/cjs/revogr-clipboard.cjs.entry.js +4 -1
  66. package/dist/cjs/revogr-filter-panel.cjs.entry.js +5 -2
  67. package/dist/collection/collection-manifest.json +2 -2
  68. package/dist/collection/components/button/button.js +3 -0
  69. package/dist/collection/components/clipboard/revogr-clipboard.js +3 -0
  70. package/dist/collection/components/data/cellRenderer.js +3 -0
  71. package/dist/collection/components/data/columnService.js +3 -0
  72. package/dist/collection/components/data/revogr-data.js +3 -0
  73. package/dist/collection/components/data/rowRenderer.js +3 -0
  74. package/dist/collection/components/header/headerCellRenderer.js +11 -1
  75. package/dist/collection/components/header/headerRenderer.js +3 -0
  76. package/dist/collection/components/header/revogr-header.js +3 -0
  77. package/dist/collection/components/order/orderRenderer.js +3 -0
  78. package/dist/collection/components/order/revogr-order-editor.js +3 -0
  79. package/dist/collection/components/order/rowOrderService.js +3 -0
  80. package/dist/collection/components/overlay/autofill.service.js +3 -0
  81. package/dist/collection/components/overlay/clipboard.service.js +3 -0
  82. package/dist/collection/components/overlay/editors/edit.utils.js +3 -0
  83. package/dist/collection/components/overlay/editors/text.js +3 -0
  84. package/dist/collection/components/overlay/keyboard.service.js +3 -0
  85. package/dist/collection/components/overlay/revogr-edit.js +3 -0
  86. package/dist/collection/components/overlay/revogr-overlay-selection.js +3 -0
  87. package/dist/collection/components/overlay/selection.utils.js +3 -0
  88. package/dist/collection/components/revo-grid/revo-grid-style.css +18 -1
  89. package/dist/collection/components/revo-grid/revo-grid.js +72 -15
  90. package/dist/collection/components/revo-grid/viewport.helpers.js +3 -0
  91. package/dist/collection/components/revo-grid/viewport.interfaces.js +3 -0
  92. package/dist/collection/components/revo-grid/viewport.js +3 -0
  93. package/dist/collection/components/revo-grid/viewport.resize.service.js +3 -0
  94. package/dist/collection/components/revo-grid/viewport.scrolling.service.js +3 -0
  95. package/dist/collection/components/revo-grid/viewport.section.js +4 -1
  96. package/dist/collection/components/revo-grid/viewport.service.js +3 -0
  97. package/dist/collection/components/rowHeaders/revogr-row-headers.js +3 -0
  98. package/dist/collection/components/rowHeaders/row-header-render.js +3 -0
  99. package/dist/collection/components/scroll/revogr-viewport-scroll.js +5 -2
  100. package/dist/collection/components/scrollable/revogr-scroll-virtual.js +3 -0
  101. package/dist/collection/components/selection-focus/revogr-focus.js +79 -7
  102. package/dist/collection/components/selection-temp-range/revogr-temp-range.js +3 -0
  103. package/dist/collection/global/global.js +3 -0
  104. package/dist/collection/index.js +3 -0
  105. package/dist/collection/plugins/autoSizeColumn.js +4 -1
  106. package/dist/collection/plugins/basePlugin.js +3 -0
  107. package/dist/collection/plugins/dispatcher.js +22 -0
  108. package/dist/collection/plugins/export/csv.js +3 -0
  109. package/dist/collection/plugins/export/export.plugin.js +3 -0
  110. package/dist/collection/plugins/export/types.js +3 -0
  111. package/dist/collection/plugins/filter/conditions/equal.js +3 -0
  112. package/dist/collection/plugins/filter/conditions/number/greaterThan.js +3 -0
  113. package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js +3 -0
  114. package/dist/collection/plugins/filter/conditions/number/lessThan.js +3 -0
  115. package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js +3 -0
  116. package/dist/collection/plugins/filter/conditions/set.js +3 -0
  117. package/dist/collection/plugins/filter/conditions/string/beginswith.js +3 -0
  118. package/dist/collection/plugins/filter/conditions/string/contains.js +3 -0
  119. package/dist/collection/plugins/filter/filter.button.js +3 -0
  120. package/dist/collection/plugins/filter/filter.plugin.js +3 -0
  121. package/dist/collection/plugins/filter/filter.pop.js +3 -0
  122. package/dist/collection/plugins/filter/filter.service.js +3 -0
  123. package/dist/collection/plugins/filter/filter.types.js +3 -0
  124. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +3 -0
  125. package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js +6 -3
  126. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +3 -0
  127. package/dist/collection/plugins/groupingRow/grouping.const.js +3 -0
  128. package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js +3 -0
  129. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +3 -0
  130. package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +3 -0
  131. package/dist/collection/plugins/groupingRow/grouping.row.types.js +3 -0
  132. package/dist/collection/plugins/groupingRow/grouping.service.js +3 -0
  133. package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js +3 -0
  134. package/dist/collection/plugins/moveColumn/columnDragPlugin.js +163 -0
  135. package/dist/collection/plugins/moveColumn/columnOrderHandler.js +63 -0
  136. package/dist/collection/plugins/sorting/sorting.plugin.js +3 -0
  137. package/dist/collection/plugins/sorting/sorting.sign.js +3 -0
  138. package/dist/collection/plugins/stretchPlugin.js +3 -0
  139. package/dist/collection/plugins/trimmed/trimmed.plugin.js +3 -0
  140. package/dist/collection/services/cell.helpers.js +3 -0
  141. package/dist/collection/services/column.data.provider.js +6 -3
  142. package/dist/collection/services/data.provider.js +3 -0
  143. package/dist/collection/services/dimension.provider.js +3 -0
  144. package/dist/collection/services/localScrollService.js +3 -0
  145. package/dist/collection/services/resizable.directive.js +5 -0
  146. package/dist/collection/services/selection.store.connector.js +3 -0
  147. package/dist/collection/services/viewport.provider.js +3 -0
  148. package/dist/collection/store/dataSource/data.proxy.js +3 -0
  149. package/dist/collection/store/dataSource/data.store.js +3 -0
  150. package/dist/collection/store/dimension/dimension.helpers.js +3 -0
  151. package/dist/collection/store/dimension/dimension.store.js +3 -0
  152. package/dist/collection/store/selection/selection.helpers.js +3 -0
  153. package/dist/collection/store/selection/selection.store.js +3 -0
  154. package/dist/collection/store/selection/selection.store.service.js +3 -0
  155. package/dist/collection/store/storeTypes.js +3 -0
  156. package/dist/collection/store/viewPort/viewport.helpers.js +3 -0
  157. package/dist/collection/store/viewPort/viewport.store.js +3 -0
  158. package/dist/collection/themeManager/theme.compact.js +3 -0
  159. package/dist/collection/themeManager/theme.default.js +3 -0
  160. package/dist/collection/themeManager/theme.material.js +3 -0
  161. package/dist/collection/themeManager/themeService.js +3 -0
  162. package/dist/collection/utils/closestPolifill.js +3 -0
  163. package/dist/collection/utils/consts.js +3 -0
  164. package/dist/collection/utils/generateAlphabetHeader.js +3 -0
  165. package/dist/collection/utils/keyCodes.js +3 -0
  166. package/dist/collection/utils/keyCodes.utils.js +3 -0
  167. package/dist/collection/utils/platform.js +3 -0
  168. package/dist/collection/utils/resizeObserver.js +3 -0
  169. package/dist/collection/utils/store.utils.js +3 -0
  170. package/dist/collection/utils/utils.js +3 -0
  171. package/dist/esm/css-shim-e1e1ea5e.js +7 -0
  172. package/dist/esm/{debounce-8dadcda7.js → debounce-e4e6dd45.js} +5 -2
  173. package/dist/esm/{dom-1b195079.js → dom-21bd1807.js} +4 -1
  174. package/dist/esm/{index-42c84e7c.js → index-6f753b3c.js} +214 -91
  175. package/dist/esm/index.js +3 -1
  176. package/dist/esm/loader.js +7 -4
  177. package/dist/esm/polyfills/css-shim.js +1 -1
  178. package/dist/esm/{resize-observer-56b7b34f.js → resize-observer-00c48d78.js} +25 -11
  179. package/dist/esm/revo-grid.js +13 -7
  180. package/dist/esm/revo-grid_11.entry.js +277 -15
  181. package/dist/esm/revogr-clipboard.entry.js +4 -1
  182. package/dist/esm/revogr-filter-panel.entry.js +5 -2
  183. package/dist/esm-es5/css-shim-e1e1ea5e.js +4 -0
  184. package/dist/esm-es5/{debounce-8dadcda7.js → debounce-e4e6dd45.js} +4 -1
  185. package/dist/esm-es5/{dom-1b195079.js → dom-21bd1807.js} +3 -0
  186. package/dist/esm-es5/index-6f753b3c.js +4 -0
  187. package/dist/esm-es5/index.js +3 -0
  188. package/dist/esm-es5/loader.js +4 -1
  189. package/dist/esm-es5/resize-observer-00c48d78.js +4 -0
  190. package/dist/esm-es5/revo-grid.js +4 -1
  191. package/dist/esm-es5/revo-grid_11.entry.js +4 -1
  192. package/dist/esm-es5/revogr-clipboard.entry.js +4 -1
  193. package/dist/esm-es5/revogr-filter-panel.entry.js +4 -1
  194. package/dist/revo-grid/css-shim-bcf89cc0.system.js +4 -0
  195. package/dist/revo-grid/css-shim-e1e1ea5e.js +4 -0
  196. package/dist/revo-grid/{debounce-f40a88f6.system.js → debounce-5a33c710.system.js} +4 -1
  197. package/dist/revo-grid/{debounce-d097578d.js → debounce-726bdadb.js} +4 -1
  198. package/dist/revo-grid/{dom-1b195079.js → dom-21bd1807.js} +3 -0
  199. package/dist/revo-grid/{dom-ee2dd1b3.system.js → dom-726246e2.system.js} +3 -0
  200. package/dist/revo-grid/index-f14b41a0.system.js +5 -0
  201. package/dist/revo-grid/index-f30d1de1.js +5 -0
  202. package/dist/revo-grid/index.esm.js +3 -0
  203. package/dist/revo-grid/index.system.js +3 -0
  204. package/dist/revo-grid/resize-observer-00c48d78.js +4 -0
  205. package/dist/revo-grid/resize-observer-8af0bc0e.system.js +4 -0
  206. package/dist/revo-grid/revo-grid.esm.js +4 -1
  207. package/dist/revo-grid/revo-grid.js +3 -2
  208. package/dist/revo-grid/revo-grid.system.js +4 -1
  209. package/dist/revo-grid/revo-grid_11.entry.js +4 -1
  210. package/dist/revo-grid/revo-grid_11.system.entry.js +4 -1
  211. package/dist/revo-grid/revogr-clipboard.entry.js +4 -1
  212. package/dist/revo-grid/revogr-clipboard.system.entry.js +4 -1
  213. package/dist/revo-grid/revogr-filter-panel.entry.js +4 -1
  214. package/dist/revo-grid/revogr-filter-panel.system.entry.js +4 -1
  215. package/dist/types/components/revo-grid/revo-grid.d.ts +13 -0
  216. package/dist/types/components/selection-focus/revogr-focus.d.ts +8 -0
  217. package/dist/types/components.d.ts +129 -61
  218. package/dist/types/plugins/dispatcher.d.ts +10 -0
  219. package/dist/types/plugins/groupingColumn/grouping.col.plugin.d.ts +1 -1
  220. package/dist/types/plugins/moveColumn/columnDragPlugin.d.ts +54 -0
  221. package/dist/types/plugins/moveColumn/columnOrderHandler.d.ts +15 -0
  222. package/dist/types/services/resizable.directive.d.ts +1 -1
  223. package/dist/types/stencil-public-runtime.d.ts +189 -186
  224. package/loader/cdn.js +3 -1
  225. package/loader/index.cjs.js +3 -1
  226. package/loader/index.d.ts +0 -1
  227. package/loader/index.es2017.js +3 -1
  228. package/loader/index.js +3 -1
  229. package/package.json +23 -21
  230. package/dist/cjs/css-shim-e33df79c.js +0 -6
  231. package/dist/esm/css-shim-8d75038b.js +0 -4
  232. package/dist/esm-es5/css-shim-8d75038b.js +0 -1
  233. package/dist/esm-es5/index-42c84e7c.js +0 -1
  234. package/dist/esm-es5/resize-observer-56b7b34f.js +0 -1
  235. package/dist/revo-grid/css-shim-88bfb262.system.js +0 -1
  236. package/dist/revo-grid/css-shim-8d75038b.js +0 -1
  237. package/dist/revo-grid/index-a15e7527.system.js +0 -1
  238. package/dist/revo-grid/index-a7f99799.js +0 -1
  239. package/dist/revo-grid/resize-observer-56b7b34f.js +0 -1
  240. package/dist/revo-grid/resize-observer-7a7b9757.system.js +0 -1
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  const beginsWith = (value, extra) => {
2
5
  if (!value) {
3
6
  return false;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  const contains = (value, extra) => {
2
5
  if (!value) {
3
6
  return false;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { h } from '@stencil/core';
2
5
  export const FILTER_BUTTON_CLASS = 'rv-filter';
3
6
  export const FILTER_BUTTON_ACTIVE = 'active';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { h } from '@stencil/core';
2
5
  import BasePlugin from '../basePlugin';
3
6
  import { FILTER_PROP, isFilterBtn } from './filter.button';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { Component, h, Host, Listen, Prop, State, Event, Method } from '@stencil/core';
2
5
  import { AndOrButton, isFilterBtn, TrashButton } from './filter.button';
3
6
  import { RevoButton } from '../../components/button/button';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import eq, { notEq } from './conditions/equal';
2
5
  import gtThan from './conditions/number/greaterThan';
3
6
  import gtThanEq from './conditions/number/greaterThanOrEqual';
@@ -1 +1,4 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export {};
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { h } from '@stencil/core';
2
5
  import findIndex from 'lodash/findIndex';
3
6
  import { getItemByIndex } from '../../store/dimension/dimension.helpers';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import isArray from 'lodash/isArray';
2
5
  import map from 'lodash/map';
3
6
  import BasePlugin from '../basePlugin';
@@ -30,7 +33,7 @@ export default class GroupingColumnPlugin extends BasePlugin {
30
33
  res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
31
34
  return res;
32
35
  }
33
- static isColGrouping(colData) {
34
- return !!colData.children;
35
- }
36
+ }
37
+ export function isColGrouping(colData) {
38
+ return !!colData.children;
36
39
  }
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { h } from '@stencil/core';
2
5
  import { HEADER_CLASS, MIN_COL_SIZE } from '../../utils/consts';
3
6
  import { HeaderCellRenderer } from '../../components/header/headerCellRenderer';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { GRID_INTERNALS } from '../../utils/consts';
2
5
  export const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
3
6
  export const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { PSEUDO_GROUP_ITEM_ID, GROUP_EXPANDED, GROUP_DEPTH } from './grouping.const';
2
5
  import { isGrouping, getParsedGroup, isSameGroup } from './grouping.service';
3
6
  // provide collapse data
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { getPhysical, setItems } from '../../store/dataSource/data.store';
2
5
  import { columnTypes } from '../../store/storeTypes';
3
6
  import BasePlugin from '../basePlugin';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { h } from '@stencil/core';
2
5
  import RowRenderer from '../../components/data/rowRenderer';
3
6
  import { GROUP_DEPTH, GROUP_EXPANDED, GROUP_EXPAND_BTN, GROUP_EXPAND_EVENT, PSEUDO_GROUP_ITEM } from './grouping.const';
@@ -1 +1,4 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export {};
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { GROUP_DEPTH, GROUP_EXPANDED, PSEUDO_GROUP_COLUMN, PSEUDO_GROUP_ITEM, PSEUDO_GROUP_ITEM_ID, PSEUDO_GROUP_ITEM_VALUE } from './grouping.const';
2
5
  /**
3
6
  * Do actual grouping
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { gatherTrimmedItems } from '../trimmed/trimmed.plugin';
2
5
  export const TRIMMED_GROUPING = 'grouping';
3
6
  /**
@@ -0,0 +1,163 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
4
+ /**
5
+ * Plugin for column manual move
6
+ */
7
+ import debounce from 'lodash/debounce';
8
+ import each from 'lodash/each';
9
+ import { getItemByPosition } from '../../store/dimension/dimension.helpers';
10
+ import BasePlugin from '../basePlugin';
11
+ import { ColumnOrderHandler } from './columnOrderHandler';
12
+ import { dispatch } from '../dispatcher';
13
+ import { isColGrouping } from '../groupingColumn/grouping.col.plugin';
14
+ const COLUMN_CLICK = 'column-click';
15
+ const MOVE = 'column-mouse-move';
16
+ const DRAG_END = 'column-drag-end';
17
+ const BEFORE_DRAG_END = 'before-column-drag-end';
18
+ // use this event subscription to drop D&D for particular columns
19
+ const DRAG_START = 'column-drag-start';
20
+ export default class ColumnPlugin extends BasePlugin {
21
+ constructor(revogrid, providers) {
22
+ super(revogrid);
23
+ this.revogrid = revogrid;
24
+ this.providers = providers;
25
+ this.moveFunc = debounce((e) => this.doMove(e), 5);
26
+ this.staticDragData = null;
27
+ this.dragData = null;
28
+ this.localSubscriptions = {};
29
+ this.orderUi = new ColumnOrderHandler();
30
+ revogrid.registerVNode([this.orderUi.render()]);
31
+ /** Register events */
32
+ this.localSubscriptions['mouseleave'] = {
33
+ target: document,
34
+ callback: (e) => this.onMouseOut(e),
35
+ };
36
+ this.localSubscriptions['mouseup'] = {
37
+ target: document,
38
+ callback: (e) => this.onMouseUp(e),
39
+ };
40
+ this.localSubscriptions['mousemove'] = {
41
+ target: document,
42
+ callback: (e) => this.move(e),
43
+ };
44
+ this.addEventListener(COLUMN_CLICK, ({ detail }) => this.dragStart(detail));
45
+ }
46
+ dragStart({ event, data }) {
47
+ if (event.defaultPrevented) {
48
+ return;
49
+ }
50
+ const { defaultPrevented } = dispatch(this.revogrid, DRAG_START, data);
51
+ // check if allowed to drag particulat column
52
+ if (defaultPrevented) {
53
+ return;
54
+ }
55
+ this.clearOrder();
56
+ const { mouseleave, mouseup, mousemove } = this.localSubscriptions;
57
+ mouseleave.target.addEventListener('mouseleave', mouseleave.callback);
58
+ mouseup.target.addEventListener('mouseup', mouseup.callback);
59
+ const dataEl = event.target.closest('revogr-header');
60
+ const scrollEl = event.target.closest('revogr-viewport-scroll');
61
+ if (!dataEl || !scrollEl) {
62
+ return;
63
+ }
64
+ if (isColGrouping(data)) {
65
+ return;
66
+ }
67
+ const cols = this.getDimension(data.pin || 'rgCol');
68
+ const gridRect = this.revogrid.getBoundingClientRect();
69
+ const elRect = dataEl.getBoundingClientRect();
70
+ const startItem = getItemByPosition(cols, getLeftRelative(event.x, gridRect.left, elRect.left - gridRect.left));
71
+ this.staticDragData = {
72
+ startPos: event.x,
73
+ startItem,
74
+ data,
75
+ dataEl,
76
+ scrollEl,
77
+ gridEl: this.revogrid,
78
+ cols,
79
+ };
80
+ this.dragData = this.getData(this.staticDragData);
81
+ mousemove.target.addEventListener('mousemove', mousemove.callback);
82
+ this.orderUi.start(event, Object.assign(Object.assign({}, this.dragData), this.staticDragData));
83
+ }
84
+ doMove(e) {
85
+ if (!this.staticDragData) {
86
+ return;
87
+ }
88
+ const dragData = (this.dragData = this.getData(this.staticDragData));
89
+ if (!dragData) {
90
+ return;
91
+ }
92
+ const start = this.staticDragData.startPos;
93
+ if (Math.abs(start - e.x) > 10) {
94
+ const x = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
95
+ const rgCol = getItemByPosition(this.staticDragData.cols, x);
96
+ this.orderUi.autoscroll(x, dragData.elRect.width);
97
+ this.orderUi.showHandler(rgCol.end + dragData.scrollOffset, dragData.gridRect.width);
98
+ }
99
+ }
100
+ move(e) {
101
+ dispatch(this.revogrid, MOVE, Object.assign({}, e));
102
+ // then do move
103
+ this.moveFunc(e);
104
+ }
105
+ onMouseOut(_) {
106
+ this.clearOrder();
107
+ }
108
+ onMouseUp(e) {
109
+ // apply new positions
110
+ if (this.dragData) {
111
+ let relativePos = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
112
+ if (relativePos < 0) {
113
+ relativePos = 0;
114
+ }
115
+ const newPosition = getItemByPosition(this.staticDragData.cols, relativePos);
116
+ const store = this.providers.column.stores[this.dragData.type].store;
117
+ const items = [...store.get('items')];
118
+ // prevent position change if needed
119
+ const { defaultPrevented: stopDrag } = dispatch(this.revogrid, BEFORE_DRAG_END, Object.assign(Object.assign({}, this.staticDragData), { startPosition: this.staticDragData.startItem, newPosition, newItem: store.get('source')[items[this.staticDragData.startItem.itemIndex]] }));
120
+ if (!stopDrag) {
121
+ // todo: if move item out of group remove item from group
122
+ const toMove = items.splice(this.staticDragData.startItem.itemIndex, 1);
123
+ items.splice(newPosition.itemIndex, 0, ...toMove);
124
+ store.set('items', items);
125
+ }
126
+ dispatch(this.revogrid, DRAG_END, this.dragData);
127
+ }
128
+ this.clearOrder();
129
+ }
130
+ clearLocalSubscriptions() {
131
+ each(this.localSubscriptions, ({ target, callback }, key) => target.removeEventListener(key, callback));
132
+ }
133
+ clearOrder() {
134
+ this.staticDragData = null;
135
+ this.dragData = null;
136
+ this.clearLocalSubscriptions();
137
+ this.orderUi.stop();
138
+ }
139
+ /**
140
+ * Clearing subscription
141
+ */
142
+ clearSubscriptions() {
143
+ super.clearSubscriptions();
144
+ this.clearLocalSubscriptions();
145
+ }
146
+ getData({ gridEl, dataEl, data, }) {
147
+ const gridRect = gridEl.getBoundingClientRect();
148
+ const elRect = dataEl.getBoundingClientRect();
149
+ const scrollOffset = elRect.left - gridRect.left;
150
+ return {
151
+ elRect,
152
+ gridRect,
153
+ type: data.pin || 'rgCol',
154
+ scrollOffset,
155
+ };
156
+ }
157
+ getDimension(type) {
158
+ return this.providers.dimension.stores[type].getCurrentState();
159
+ }
160
+ }
161
+ export function getLeftRelative(absoluteX, gridPos, offset) {
162
+ return absoluteX - gridPos - offset;
163
+ }
@@ -0,0 +1,63 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
4
+ import { h } from '@stencil/core';
5
+ export class ColumnOrderHandler {
6
+ constructor() {
7
+ this.offset = 0;
8
+ }
9
+ renderAutoscroll(_, parent) {
10
+ if (!parent) {
11
+ return;
12
+ }
13
+ this.autoscrollEl = document.createElement('div');
14
+ this.autoscrollEl.classList.add('drag-auto-scroll-y');
15
+ parent.appendChild(this.autoscrollEl);
16
+ }
17
+ autoscroll(pos, dataContainerSize, direction = 'translateX') {
18
+ if (!this.autoscrollEl) {
19
+ return;
20
+ }
21
+ const helperOffset = 10;
22
+ // calculate current y position inside of the grid active holder
23
+ // 3 - size of element + border
24
+ const maxScroll = Math.min(pos + helperOffset, dataContainerSize - 3);
25
+ this.autoscrollEl.style.transform = `${direction}(${maxScroll}px)`;
26
+ this.autoscrollEl.scrollIntoView({
27
+ block: 'nearest',
28
+ inline: 'nearest',
29
+ });
30
+ }
31
+ start(e, { dataEl, gridRect, scrollEl }, dir = 'left') {
32
+ const scrollContainerRect = scrollEl.getBoundingClientRect();
33
+ if (scrollContainerRect) {
34
+ this.offset = scrollContainerRect[dir] - gridRect[dir];
35
+ }
36
+ this.renderAutoscroll(e, dataEl);
37
+ }
38
+ stop() {
39
+ var _a;
40
+ if (this.element) {
41
+ this.element.hidden = true;
42
+ }
43
+ this.offset = 0;
44
+ (_a = this.autoscrollEl) === null || _a === void 0 ? void 0 : _a.remove();
45
+ this.autoscrollEl = undefined;
46
+ }
47
+ showHandler(pos, size, direction = 'translateX') {
48
+ if (!this.element) {
49
+ return;
50
+ }
51
+ // do not allow overcross top of the scrollable area, header excluded
52
+ if (this.offset) {
53
+ pos = Math.max(pos, this.offset);
54
+ }
55
+ // can not be bigger then grid end
56
+ pos = Math.min(pos, size);
57
+ this.element.style.transform = `${direction}(${pos}px)`;
58
+ this.element.hidden = false;
59
+ }
60
+ render() {
61
+ return h("div", { class: "drag-position-y", hidden: true, ref: (el) => (this.element = el) });
62
+ }
63
+ }
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import size from 'lodash/size';
2
5
  import { setStore } from '../../utils/store.utils';
3
6
  import ColumnDataProvider from '../../services/column.data.provider';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { h } from '@stencil/core';
2
5
  export const FILTER_BUTTON_CLASS = 'rv-filter';
3
6
  export const FILTER_BUTTON_ACTIVE = 'active';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { each } from 'lodash';
2
5
  import { getScrollbarWidth } from '../utils/utils';
3
6
  import BasePlugin from './basePlugin';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  /**
2
5
  * Hide items from main collection
3
6
  * But keep them in store
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { DATA_COL, DATA_ROW } from '../utils/consts';
2
5
  export function getCell(cell) {
3
6
  return {
@@ -1,9 +1,12 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import reduce from 'lodash/reduce';
2
5
  import each from 'lodash/each';
3
6
  import find from 'lodash/find';
4
7
  import DataStore, { getSourceItem, getSourceItemVirtualIndexByProp, setSourceByVirtualIndex } from '../store/dataSource/data.store';
5
8
  import { columnTypes } from '../store/storeTypes';
6
- import GroupingColumnPlugin from '../plugins/groupingColumn/grouping.col.plugin';
9
+ import GroupingColumnPlugin, { isColGrouping } from '../plugins/groupingColumn/grouping.col.plugin';
7
10
  export default class ColumnDataProvider {
8
11
  constructor() {
9
12
  this.sorting = null;
@@ -135,7 +138,7 @@ export default class ColumnDataProvider {
135
138
  }
136
139
  static getColumnByProp(columns, prop) {
137
140
  return find(columns, c => {
138
- if (GroupingColumnPlugin.isColGrouping(c)) {
141
+ if (isColGrouping(c)) {
139
142
  return ColumnDataProvider.getColumnByProp(c.children, prop);
140
143
  }
141
144
  return c.prop === prop;
@@ -145,7 +148,7 @@ export default class ColumnDataProvider {
145
148
  static getColumns(columns, level = 0, types) {
146
149
  return reduce(columns, (res, colData) => {
147
150
  /** Grouped column */
148
- if (GroupingColumnPlugin.isColGrouping(colData)) {
151
+ if (isColGrouping(colData)) {
149
152
  return GroupingColumnPlugin.gatherGroup(res, colData, ColumnDataProvider.getColumns(colData.children, level + 1, types), level);
150
153
  }
151
154
  /** Regular column */
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import reduce from 'lodash/reduce';
2
5
  import DataStore, { getSourceItem, getVisibleSourceItem, setSourceByVirtualIndex } from '../store/dataSource/data.store';
3
6
  import { isRowType, rowTypes } from '../store/storeTypes';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import reduce from 'lodash/reduce';
2
5
  import { columnTypes, rowTypes } from '../store/storeTypes';
3
6
  import DimensionStore from '../store/dimension/dimension.store';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { scaleValue } from '../utils/utils';
2
5
  const initialParams = {
3
6
  contentSize: 0,
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { h } from '@stencil/core';
2
5
  var ResizeEvents;
3
6
  (function (ResizeEvents) {
@@ -131,6 +134,8 @@ export class ResizeDirective {
131
134
  if (event.defaultPrevented) {
132
135
  return;
133
136
  }
137
+ // stop other events if resize in progress
138
+ event.preventDefault();
134
139
  this.dropInitial();
135
140
  for (let elClass in RESIZE_MASK) {
136
141
  const target = event.target;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { cropCellToMax, isHiddenStore, nextCell } from '../store/selection/selection.helpers';
2
5
  import { SelectionStore } from '../store/selection/selection.store';
3
6
  export const EMPTY_INDEX = -1;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import reduce from 'lodash/reduce';
2
5
  import { columnTypes, rowTypes } from '../store/storeTypes';
3
6
  import ViewportStore from '../store/viewPort/viewport.store';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  /**
2
5
  * All items
3
6
  * Used as proxy for sorting
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { createStore } from '@stencil/store';
2
5
  import findIndex from 'lodash/findIndex';
3
6
  import range from 'lodash/range';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import each from 'lodash/each';
2
5
  import sortedIndex from 'lodash/sortedIndex';
3
6
  import reduce from 'lodash/reduce';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  /**
2
5
  * Storing pre-calculated
3
6
  * Dimension information and sizes
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { EMPTY_INDEX } from '../../services/selection.store.connector';
2
5
  export function isHiddenStore(pos) {
3
6
  return pos === EMPTY_INDEX;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { createStore } from '@stencil/store';
2
5
  import { setStore } from '../../utils/store.utils';
3
6
  import { getRange } from './selection.helpers';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { getRange } from './selection.helpers';
2
5
  export default class SelectionStoreService {
3
6
  constructor(store, config) {
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export const rowTypes = ['rowPinStart', 'rgRow', 'rowPinEnd'];
2
5
  export const columnTypes = ['colPinStart', 'rgCol', 'colPinEnd'];
3
6
  export function isRowType(type) {
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import { getItemByPosition } from '../dimension/dimension.helpers';
2
5
  /**
3
6
  * Update items based on new scroll position
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  /**
2
5
  * Store is responsible for visible
3
6
  * Viewport information for each dimension
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export default class ThemeCompact {
2
5
  constructor() {
3
6
  this.defaultRowSize = 32;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export default class ThemeDefault {
2
5
  constructor() {
3
6
  this.defaultRowSize = 27;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export default class ThemeMaterial {
2
5
  constructor() {
3
6
  this.defaultRowSize = 42;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import ThemeCompact from './theme.compact';
2
5
  import ThemeDefault from './theme.default';
3
6
  import ThemeMaterial from './theme.material';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  (function closest() {
2
5
  if (!Element.prototype.matches) {
3
6
  Element.prototype.matches =
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export const MIN_COL_SIZE = 30;
2
5
  export const DATA_COL = 'data-rgCol';
3
6
  export const DATA_ROW = 'data-rgRow';
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  export function generateHeader(index) {
2
5
  const asciiFirstLetter = 65;
3
6
  const lettersCount = 26;
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  var codes;
2
5
  (function (codes) {
3
6
  codes[codes["MOUSE_LEFT"] = 1] = "MOUSE_LEFT";
@@ -1,3 +1,6 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
1
4
  import KeyCodesEnum, { codesLetter } from './keyCodes';
2
5
  import OsPlatform from './platform';
3
6
  import includes from 'lodash/includes';