@revolist/revogrid 4.0.29 → 4.0.31

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 (211) hide show
  1. package/dist/cjs/{app-globals-53fde1aa.js → app-globals-067b9262.js} +2 -2
  2. package/dist/cjs/{app-globals-53fde1aa.js.map → app-globals-067b9262.js.map} +1 -1
  3. package/dist/cjs/{base.plugin-32f80cb5.js → base.plugin-75fc9e81.js} +3 -4
  4. package/dist/cjs/base.plugin-75fc9e81.js.map +1 -0
  5. package/dist/cjs/{column.service-52b4cac9.js → column.service-b3b5a4ee.js} +4 -4
  6. package/dist/cjs/{column.service-52b4cac9.js.map → column.service-b3b5a4ee.js.map} +1 -1
  7. package/dist/cjs/{dimension.helpers-ee39d6c4.js → dimension.helpers-8e234f00.js} +193 -193
  8. package/dist/cjs/dimension.helpers-8e234f00.js.map +1 -0
  9. package/dist/cjs/{filter.button-db6cbd2e.js → filter.button-147884a8.js} +2 -2
  10. package/dist/cjs/{filter.button-db6cbd2e.js.map → filter.button-147884a8.js.map} +1 -1
  11. package/dist/cjs/{header-cell-renderer-a3f202a1.js → header-cell-renderer-96a37624.js} +3 -3
  12. package/dist/cjs/{header-cell-renderer-a3f202a1.js.map → header-cell-renderer-96a37624.js.map} +1 -1
  13. package/dist/cjs/{index-84e32c2a.js → index-feb2edd5.js} +193 -185
  14. package/dist/cjs/index-feb2edd5.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +5 -5
  16. package/dist/cjs/{key.utils-ee3d9eab.js → key.utils-be4d0b46.js} +2 -2
  17. package/dist/cjs/{key.utils-ee3d9eab.js.map → key.utils-be4d0b46.js.map} +1 -1
  18. package/dist/cjs/loader.cjs.js +2 -2
  19. package/dist/cjs/revo-grid.cjs.entry.js +11 -11
  20. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  21. package/dist/cjs/revo-grid.cjs.js +3 -3
  22. package/dist/cjs/revo-grid.cjs.js.map +1 -1
  23. package/dist/cjs/revogr-attribution_6.cjs.entry.js +8 -8
  24. package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
  25. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +4 -4
  26. package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
  27. package/dist/cjs/revogr-data_4.cjs.entry.js +8 -8
  28. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  29. package/dist/cjs/revogr-filter-panel.cjs.entry.js +2 -2
  30. package/dist/cjs/{selection.helpers-32abb2a9.js → selection.helpers-032d7192.js} +3 -3
  31. package/dist/cjs/selection.helpers-032d7192.js.map +1 -0
  32. package/dist/cjs/{viewport.store-2ab4e166.js → viewport.store-c4b986f9.js} +2 -2
  33. package/dist/cjs/{viewport.store-2ab4e166.js.map → viewport.store-c4b986f9.js.map} +1 -1
  34. package/dist/collection/collection-manifest.json +1 -1
  35. package/dist/collection/components/data/column.service.js +1 -1
  36. package/dist/collection/components/data/column.service.js.map +1 -1
  37. package/dist/collection/components/data/revogr-data.js +13 -13
  38. package/dist/collection/components/data/revogr-data.js.map +1 -1
  39. package/dist/collection/components/editors/text-editor.js +1 -1
  40. package/dist/collection/components/editors/text-editor.js.map +1 -1
  41. package/dist/collection/components/header/revogr-header.js +8 -8
  42. package/dist/collection/components/header/revogr-header.js.map +1 -1
  43. package/dist/collection/components/order/revogr-order-editor.js +6 -6
  44. package/dist/collection/components/order/revogr-order-editor.js.map +1 -1
  45. package/dist/collection/components/overlay/autofill.service.js.map +1 -1
  46. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  47. package/dist/collection/components/overlay/revogr-overlay-selection.js +1 -1
  48. package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
  49. package/dist/collection/components/revoGrid/revo-grid.js +9 -9
  50. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  51. package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
  52. package/dist/collection/components/scrollable/revogr-scroll-virtual.js +5 -5
  53. package/dist/collection/components/scrollable/revogr-scroll-virtual.js.map +1 -1
  54. package/dist/collection/components/selectionFocus/revogr-focus.js +10 -10
  55. package/dist/collection/components/selectionFocus/revogr-focus.js.map +1 -1
  56. package/dist/collection/components/selectionTempRange/revogr-temp-range.js +6 -6
  57. package/dist/collection/components/selectionTempRange/revogr-temp-range.js.map +1 -1
  58. package/dist/collection/components/vnode/vnode-converter.js +2 -2
  59. package/dist/collection/components/vnode/vnode.utils.js.map +1 -1
  60. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -1
  61. package/dist/collection/store/dataSource/data.proxy.js.map +1 -1
  62. package/dist/collection/store/dataSource/data.store.js +1 -1
  63. package/dist/collection/store/dataSource/data.store.js.map +1 -1
  64. package/dist/collection/store/dataSource/trimmed.plugin.js.map +1 -1
  65. package/dist/collection/store/dimension/dimension.store.js +1 -2
  66. package/dist/collection/store/dimension/dimension.store.js.map +1 -1
  67. package/dist/collection/store/selection/selection.store.js +1 -1
  68. package/dist/collection/store/selection/selection.store.js.map +1 -1
  69. package/dist/collection/store/vp/viewport.store.js +1 -1
  70. package/dist/collection/store/vp/viewport.store.js.map +1 -1
  71. package/dist/collection/types/interfaces.js.map +1 -1
  72. package/dist/collection/types/viewport.interfaces.js.map +1 -1
  73. package/dist/collection/utils/store.types.js +2 -0
  74. package/dist/collection/utils/store.types.js.map +1 -0
  75. package/dist/collection/utils/store.utils.js +1 -2
  76. package/dist/collection/utils/store.utils.js.map +1 -1
  77. package/dist/esm/{app-globals-ef1fca59.js → app-globals-c0b06b03.js} +2 -2
  78. package/dist/esm/{app-globals-ef1fca59.js.map → app-globals-c0b06b03.js.map} +1 -1
  79. package/dist/esm/{base.plugin-d0e589d8.js → base.plugin-e6e2bac2.js} +3 -4
  80. package/dist/esm/base.plugin-e6e2bac2.js.map +1 -0
  81. package/dist/esm/{column.service-a826bbd6.js → column.service-ffe99cfc.js} +4 -4
  82. package/dist/esm/{column.service-a826bbd6.js.map → column.service-ffe99cfc.js.map} +1 -1
  83. package/dist/esm/{dimension.helpers-a3065cb1.js → dimension.helpers-c0c2888f.js} +193 -193
  84. package/dist/esm/dimension.helpers-c0c2888f.js.map +1 -0
  85. package/dist/esm/{filter.button-46ce4f80.js → filter.button-f132c10a.js} +2 -2
  86. package/dist/esm/{filter.button-46ce4f80.js.map → filter.button-f132c10a.js.map} +1 -1
  87. package/dist/esm/{header-cell-renderer-19738045.js → header-cell-renderer-cac333a3.js} +3 -3
  88. package/dist/esm/{header-cell-renderer-19738045.js.map → header-cell-renderer-cac333a3.js.map} +1 -1
  89. package/dist/esm/{index-21436631.js → index-e661aeb5.js} +193 -185
  90. package/dist/esm/index-e661aeb5.js.map +1 -0
  91. package/dist/esm/index.js +5 -5
  92. package/dist/esm/{key.utils-7c5d91dd.js → key.utils-9120fde7.js} +2 -2
  93. package/dist/esm/{key.utils-7c5d91dd.js.map → key.utils-9120fde7.js.map} +1 -1
  94. package/dist/esm/loader.js +3 -3
  95. package/dist/esm/revo-grid.entry.js +11 -11
  96. package/dist/esm/revo-grid.entry.js.map +1 -1
  97. package/dist/esm/revo-grid.js +4 -4
  98. package/dist/esm/revo-grid.js.map +1 -1
  99. package/dist/esm/revogr-attribution_6.entry.js +8 -8
  100. package/dist/esm/revogr-attribution_6.entry.js.map +1 -1
  101. package/dist/esm/revogr-clipboard_3.entry.js +4 -4
  102. package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
  103. package/dist/esm/revogr-data_4.entry.js +8 -8
  104. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  105. package/dist/esm/revogr-filter-panel.entry.js +2 -2
  106. package/dist/esm/{selection.helpers-883ce6bc.js → selection.helpers-0f3ed629.js} +3 -3
  107. package/dist/esm/selection.helpers-0f3ed629.js.map +1 -0
  108. package/dist/esm/{viewport.store-d9e291c5.js → viewport.store-2dc172be.js} +2 -2
  109. package/dist/esm/{viewport.store-d9e291c5.js.map → viewport.store-2dc172be.js.map} +1 -1
  110. package/dist/revo-grid/app-globals-c0b06b03.js +5 -0
  111. package/dist/revo-grid/base.plugin-e6e2bac2.js +5 -0
  112. package/dist/revo-grid/base.plugin-e6e2bac2.js.map +1 -0
  113. package/dist/revo-grid/{column.service-a826bbd6.js → column.service-ffe99cfc.js} +2 -2
  114. package/dist/revo-grid/column.service-ffe99cfc.js.map +1 -0
  115. package/dist/revo-grid/dimension.helpers-c0c2888f.js +5 -0
  116. package/dist/revo-grid/dimension.helpers-c0c2888f.js.map +1 -0
  117. package/dist/revo-grid/{filter.button-46ce4f80.js → filter.button-f132c10a.js} +2 -2
  118. package/dist/revo-grid/{header-cell-renderer-19738045.js → header-cell-renderer-cac333a3.js} +2 -2
  119. package/dist/revo-grid/index-e661aeb5.js +6 -0
  120. package/dist/revo-grid/index-e661aeb5.js.map +1 -0
  121. package/dist/revo-grid/index.esm.js +1 -1
  122. package/dist/revo-grid/{key.utils-7c5d91dd.js → key.utils-9120fde7.js} +2 -2
  123. package/dist/revo-grid/revo-grid.entry.js +1 -1
  124. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  125. package/dist/revo-grid/revo-grid.esm.js +1 -1
  126. package/dist/revo-grid/revo-grid.esm.js.map +1 -1
  127. package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
  128. package/dist/revo-grid/revogr-attribution_6.entry.js.map +1 -1
  129. package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
  130. package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
  131. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  132. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  133. package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
  134. package/dist/revo-grid/{selection.helpers-883ce6bc.js → selection.helpers-0f3ed629.js} +2 -2
  135. package/dist/revo-grid/selection.helpers-0f3ed629.js.map +1 -0
  136. package/dist/revo-grid/{viewport.store-d9e291c5.js → viewport.store-2dc172be.js} +2 -2
  137. package/dist/revo-grid/viewport.store-2dc172be.js.map +1 -0
  138. package/dist/types/components/data/column.service.d.ts +2 -3
  139. package/dist/types/components/data/revogr-data.d.ts +2 -2
  140. package/dist/types/components/editors/text-editor.d.ts +3 -3
  141. package/dist/types/components/header/revogr-header.d.ts +5 -6
  142. package/dist/types/components/order/revogr-order-editor.d.ts +2 -3
  143. package/dist/types/components/overlay/autofill.service.d.ts +2 -1
  144. package/dist/types/components/overlay/keyboard.service.d.ts +1 -1
  145. package/dist/types/components/overlay/revogr-overlay-selection.d.ts +2 -2
  146. package/dist/types/components/revoGrid/revo-grid.d.ts +2 -5
  147. package/dist/types/components/scrollable/revogr-scroll-virtual.d.ts +2 -1
  148. package/dist/types/components/selectionFocus/revogr-focus.d.ts +2 -1
  149. package/dist/types/components/selectionTempRange/revogr-temp-range.d.ts +2 -1
  150. package/dist/types/components/vnode/vnode.utils.d.ts +2 -1
  151. package/dist/types/components.d.ts +4 -2
  152. package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +4 -2
  153. package/dist/types/stencil-public-runtime.d.ts +0 -2
  154. package/dist/types/store/dataSource/data.proxy.d.ts +1 -1
  155. package/dist/types/store/dataSource/data.store.d.ts +2 -1
  156. package/dist/types/store/dataSource/trimmed.plugin.d.ts +1 -1
  157. package/dist/types/store/dimension/dimension.store.d.ts +3 -18
  158. package/dist/types/store/selection/selection.store.d.ts +1 -1
  159. package/dist/types/store/vp/viewport.store.d.ts +2 -1
  160. package/dist/types/types/interfaces.d.ts +2 -4
  161. package/dist/types/types/viewport.interfaces.d.ts +2 -1
  162. package/dist/types/utils/store.types.d.ts +97 -0
  163. package/dist/types/utils/store.utils.d.ts +4 -3
  164. package/hydrate/index.d.ts +29 -11
  165. package/hydrate/index.js +547 -544
  166. package/hydrate/index.mjs +32501 -0
  167. package/hydrate/package.json +7 -1
  168. package/loader/index.d.ts +3 -0
  169. package/package.json +3 -3
  170. package/standalone/column.service.js +1 -1
  171. package/standalone/column.service.js.map +1 -1
  172. package/standalone/data.store.js +192 -192
  173. package/standalone/data.store.js.map +1 -1
  174. package/standalone/revo-grid.js +3 -4
  175. package/standalone/revo-grid.js.map +1 -1
  176. package/standalone/revogr-data2.js.map +1 -1
  177. package/standalone/revogr-edit2.js +1 -1
  178. package/standalone/revogr-edit2.js.map +1 -1
  179. package/standalone/revogr-focus2.js.map +1 -1
  180. package/standalone/revogr-header2.js +2 -2
  181. package/standalone/revogr-header2.js.map +1 -1
  182. package/standalone/revogr-order-editor2.js.map +1 -1
  183. package/standalone/revogr-overlay-selection2.js +1 -1
  184. package/standalone/revogr-overlay-selection2.js.map +1 -1
  185. package/standalone/revogr-row-headers2.js.map +1 -1
  186. package/standalone/revogr-scroll-virtual2.js +1 -1
  187. package/standalone/revogr-scroll-virtual2.js.map +1 -1
  188. package/standalone/revogr-temp-range2.js.map +1 -1
  189. package/standalone/selection.utils.js +1 -1
  190. package/dist/cjs/base.plugin-32f80cb5.js.map +0 -1
  191. package/dist/cjs/dimension.helpers-ee39d6c4.js.map +0 -1
  192. package/dist/cjs/index-84e32c2a.js.map +0 -1
  193. package/dist/cjs/selection.helpers-32abb2a9.js.map +0 -1
  194. package/dist/esm/base.plugin-d0e589d8.js.map +0 -1
  195. package/dist/esm/dimension.helpers-a3065cb1.js.map +0 -1
  196. package/dist/esm/index-21436631.js.map +0 -1
  197. package/dist/esm/selection.helpers-883ce6bc.js.map +0 -1
  198. package/dist/revo-grid/app-globals-ef1fca59.js +0 -5
  199. package/dist/revo-grid/base.plugin-d0e589d8.js +0 -5
  200. package/dist/revo-grid/base.plugin-d0e589d8.js.map +0 -1
  201. package/dist/revo-grid/column.service-a826bbd6.js.map +0 -1
  202. package/dist/revo-grid/dimension.helpers-a3065cb1.js +0 -5
  203. package/dist/revo-grid/dimension.helpers-a3065cb1.js.map +0 -1
  204. package/dist/revo-grid/index-21436631.js +0 -6
  205. package/dist/revo-grid/index-21436631.js.map +0 -1
  206. package/dist/revo-grid/selection.helpers-883ce6bc.js.map +0 -1
  207. package/dist/revo-grid/viewport.store-d9e291c5.js.map +0 -1
  208. /package/dist/revo-grid/{app-globals-ef1fca59.js.map → app-globals-c0b06b03.js.map} +0 -0
  209. /package/dist/revo-grid/{filter.button-46ce4f80.js.map → filter.button-f132c10a.js.map} +0 -0
  210. /package/dist/revo-grid/{header-cell-renderer-19738045.js.map → header-cell-renderer-cac333a3.js.map} +0 -0
  211. /package/dist/revo-grid/{key.utils-7c5d91dd.js.map → key.utils-9120fde7.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import{i as t,k as e,l as s}from"./dimension.helpers-a3065cb1.js";function i(e,s,i,f,u){const l=t(u,e);const m=h(s);let d;if(m){let t=l.itemIndex-(m.itemIndex||0);if(t){d=a(Math.abs(t),Object.assign(Object.assign({positiveDirection:t>-1},u),s))}}const z=n(f,u.realSize,l);if(d){const t=o(l,i,z,d,u);if(t.length){r(d.items,t,d)}}if(!d){const t=c({firstItemStart:l.start,firstItemIndex:l.itemIndex,origSize:u.originItemSize,maxSize:z,maxCount:i,sizes:u.sizes});d={items:t,start:0,end:t.length-1}}return d}function n(t,e,s){return Math.min(t+(s.end-s.start),e)}function r(t,e,s){t.splice(s.end+1,0,...e);if(s.start>=s.end&&!(s.start===s.end&&s.start===0)){s.start+=e.length}s.end+=e.length}function o(t,e,s,i,n){const r=m(i);const o=c({sizes:n.sizes,firstItemStart:r.end,firstItemIndex:r.itemIndex+1,origSize:n.originItemSize,maxSize:s-(r.end-t.start),maxCount:e});return o}function c(t,e=0){const s=[];let i=t.firstItemIndex;let n=e;while(n<=t.maxSize&&i<t.maxCount){const e=f(i,t.sizes,t.origSize);s.push({start:t.firstItemStart+n,end:t.firstItemStart+n+e,itemIndex:i,size:e});n+=e;i++}return s}function a(t,e){const s=[...e.items];const i=s.length;let n={start:e.start,end:e.end};if(t>i){return null}if(e.positiveDirection){let r=m(e);let o=n.start;const c=o+t;for(;o<c;o++){const t=r.itemIndex+1;const c=f(t,e.sizes,e.originItemSize);if(r.end+c>e.realSize){break}let a=o%i;if(!s[a]){throw new Error("incorrect index")}s[a]=r={start:r.end,end:r.end+c,itemIndex:t,size:c};n.start++;n.end=a}}else{let r=h(e);const o=n.end;for(let c=0;c<t;c++){const t=r.itemIndex-1;const a=f(t,e.sizes,e.originItemSize);let u=o-c;u=(u<0?i+u:u)%i;if(!s[u]){throw new Error("incorrect index")}s[u]=r={start:r.start-a,end:r.start,itemIndex:t,size:a};n.start=u;n.end--}}const r={start:(n.start<0?i+n.start:n.start)%i,end:(n.end<0?i+n.end:n.end)%i};return Object.assign({items:s},r)}function f(t,e,s=0){if(e&&e[t]){return e[t]}return s}function u(t,e,s,i){if(!s||!i){return false}return t>=s.start&&t<=s.end||t>s.end&&i.end===e}function l(t,e,s,i){if(!s){return false}return e+t>(i===null||i===void 0?void 0:i.end)}function h(t){return t.items[t.start]}function m(t){return t.items[t.end]}function d(t,e,s,i){const n=[...t];const r=n.length;let o=i;let c=0;let a=e;if(!r){return[]}while(c<r){const t=n[a];t.start=o;t.size=s;t.end=t.start+s;o=t.end;a++;c++;if(a===r){a=0}}return n}function z(){return{items:[],start:0,end:0,virtualSize:0,realCount:0}}class b{get lastCoordinate(){return this.lastKnownScroll}set lastCoordinate(t){this.lastKnownScroll=t}constructor(t){this.type=t;this.lastKnownScroll=0;this.store=e(z());this.store.onChange("realCount",(()=>this.clearItems()));this.store.onChange("virtualSize",(()=>this.clearItems()))}setViewPortCoordinate(t,e){const s=this.store.get("virtualSize");if(!s){return}const n=1;const c=e.originItemSize*n;const a=c*2;const f=s+a;let d=0;if(e.realSize>s){d=e.realSize-s-c}let z=t;if(z<0){z=0}else if(z>d){z=d}this.lastCoordinate=z;z-=c;z=z<0?0:z<d?z:d;const b=this.getItems();const x=[...b.items];const I=h(b);const S=m(b);let j={};if(!u(z,e.realSize,I,S)){j=Object.assign(Object.assign({},j),i(z,b,this.store.get("realCount"),f,e));this.setViewport(Object.assign({},j))}else if(l(z,f,I,S)){const t=o(I,this.store.get("realCount"),f+z-I.start,b,{sizes:e.sizes,originItemSize:e.originItemSize});if(t.length){const e={start:this.store.get("start"),end:this.store.get("end")};r(x,t,e);j=Object.assign(Object.assign(Object.assign({},j),{items:[...x]}),e);this.setViewport(Object.assign({},j))}}}setViewPortDimensionSizes(t,e){let s=[...this.store.get("items")];const i=s.length;if(!i){return}let n=0;let r=0;let o=this.store.get("start");if(e){const t=this.getItems();const i=h(t);s=d(s,o,e,i.start)}while(r<i){const e=s[o];if(n){e.start+=n;e.end+=n}const c=t[e.itemIndex];if(c){const t=c-e.size;n+=t;e.size=c;e.end=e.start+c}o++;r++;if(o===i){o=0}}this.setViewport({items:[...s]})}setOriginalSizes(t){const e=this.store.get("items");const i=e.length;if(!i){return}s(this.store,{items:d(e,this.store.get("start"),t,this.lastCoordinate)})}getItems(){return{items:this.store.get("items"),start:this.store.get("start"),end:this.store.get("end")}}setViewport(t){s(this.store,t)}clearItems(){this.store.set("items",[])}}export{b as V,o as a,c as b,l as c,h as d,m as e,i as g,u as i,a as r,d as s,r as u};
5
- //# sourceMappingURL=viewport.store-d9e291c5.js.map
4
+ import{i as t,k as e,l as s}from"./dimension.helpers-c0c2888f.js";function i(e,s,i,f,u){const l=t(u,e);const m=h(s);let d;if(m){let t=l.itemIndex-(m.itemIndex||0);if(t){d=a(Math.abs(t),Object.assign(Object.assign({positiveDirection:t>-1},u),s))}}const z=n(f,u.realSize,l);if(d){const t=o(l,i,z,d,u);if(t.length){r(d.items,t,d)}}if(!d){const t=c({firstItemStart:l.start,firstItemIndex:l.itemIndex,origSize:u.originItemSize,maxSize:z,maxCount:i,sizes:u.sizes});d={items:t,start:0,end:t.length-1}}return d}function n(t,e,s){return Math.min(t+(s.end-s.start),e)}function r(t,e,s){t.splice(s.end+1,0,...e);if(s.start>=s.end&&!(s.start===s.end&&s.start===0)){s.start+=e.length}s.end+=e.length}function o(t,e,s,i,n){const r=m(i);const o=c({sizes:n.sizes,firstItemStart:r.end,firstItemIndex:r.itemIndex+1,origSize:n.originItemSize,maxSize:s-(r.end-t.start),maxCount:e});return o}function c(t,e=0){const s=[];let i=t.firstItemIndex;let n=e;while(n<=t.maxSize&&i<t.maxCount){const e=f(i,t.sizes,t.origSize);s.push({start:t.firstItemStart+n,end:t.firstItemStart+n+e,itemIndex:i,size:e});n+=e;i++}return s}function a(t,e){const s=[...e.items];const i=s.length;let n={start:e.start,end:e.end};if(t>i){return null}if(e.positiveDirection){let r=m(e);let o=n.start;const c=o+t;for(;o<c;o++){const t=r.itemIndex+1;const c=f(t,e.sizes,e.originItemSize);if(r.end+c>e.realSize){break}let a=o%i;if(!s[a]){throw new Error("incorrect index")}s[a]=r={start:r.end,end:r.end+c,itemIndex:t,size:c};n.start++;n.end=a}}else{let r=h(e);const o=n.end;for(let c=0;c<t;c++){const t=r.itemIndex-1;const a=f(t,e.sizes,e.originItemSize);let u=o-c;u=(u<0?i+u:u)%i;if(!s[u]){throw new Error("incorrect index")}s[u]=r={start:r.start-a,end:r.start,itemIndex:t,size:a};n.start=u;n.end--}}const r={start:(n.start<0?i+n.start:n.start)%i,end:(n.end<0?i+n.end:n.end)%i};return Object.assign({items:s},r)}function f(t,e,s=0){if(e&&e[t]){return e[t]}return s}function u(t,e,s,i){if(!s||!i){return false}return t>=s.start&&t<=s.end||t>s.end&&i.end===e}function l(t,e,s,i){if(!s){return false}return e+t>(i===null||i===void 0?void 0:i.end)}function h(t){return t.items[t.start]}function m(t){return t.items[t.end]}function d(t,e,s,i){const n=[...t];const r=n.length;let o=i;let c=0;let a=e;if(!r){return[]}while(c<r){const t=n[a];t.start=o;t.size=s;t.end=t.start+s;o=t.end;a++;c++;if(a===r){a=0}}return n}function z(){return{items:[],start:0,end:0,virtualSize:0,realCount:0}}class b{get lastCoordinate(){return this.lastKnownScroll}set lastCoordinate(t){this.lastKnownScroll=t}constructor(t){this.type=t;this.lastKnownScroll=0;this.store=e(z());this.store.onChange("realCount",(()=>this.clearItems()));this.store.onChange("virtualSize",(()=>this.clearItems()))}setViewPortCoordinate(t,e){const s=this.store.get("virtualSize");if(!s){return}const n=1;const c=e.originItemSize*n;const a=c*2;const f=s+a;let d=0;if(e.realSize>s){d=e.realSize-s-c}let z=t;if(z<0){z=0}else if(z>d){z=d}this.lastCoordinate=z;z-=c;z=z<0?0:z<d?z:d;const b=this.getItems();const x=[...b.items];const I=h(b);const S=m(b);let j={};if(!u(z,e.realSize,I,S)){j=Object.assign(Object.assign({},j),i(z,b,this.store.get("realCount"),f,e));this.setViewport(Object.assign({},j))}else if(l(z,f,I,S)){const t=o(I,this.store.get("realCount"),f+z-I.start,b,{sizes:e.sizes,originItemSize:e.originItemSize});if(t.length){const e={start:this.store.get("start"),end:this.store.get("end")};r(x,t,e);j=Object.assign(Object.assign(Object.assign({},j),{items:[...x]}),e);this.setViewport(Object.assign({},j))}}}setViewPortDimensionSizes(t,e){let s=[...this.store.get("items")];const i=s.length;if(!i){return}let n=0;let r=0;let o=this.store.get("start");if(e){const t=this.getItems();const i=h(t);s=d(s,o,e,i.start)}while(r<i){const e=s[o];if(n){e.start+=n;e.end+=n}const c=t[e.itemIndex];if(c){const t=c-e.size;n+=t;e.size=c;e.end=e.start+c}o++;r++;if(o===i){o=0}}this.setViewport({items:[...s]})}setOriginalSizes(t){const e=this.store.get("items");const i=e.length;if(!i){return}s(this.store,{items:d(e,this.store.get("start"),t,this.lastCoordinate)})}getItems(){return{items:this.store.get("items"),start:this.store.get("start"),end:this.store.get("end")}}setViewport(t){s(this.store,t)}clearItems(){this.store.set("items",[])}}export{b as V,o as a,c as b,l as c,h as d,m as e,i as g,u as i,a as r,d as s,r as u};
5
+ //# sourceMappingURL=viewport.store-2dc172be.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getUpdatedItemsByPosition","pos","items","realCount","virtualSize","dimension","activeItem","getItemByPosition","firstItem","getFirstItem","toUpdate","changedOffsetStart","itemIndex","recombineByOffset","Math","abs","Object","assign","positiveDirection","maxSizeVirtualSize","getMaxVirtualSize","realSize","extra","addMissingItems","length","updateMissingAndRange","getItems","firstItemStart","start","firstItemIndex","origSize","originItemSize","maxSize","maxCount","sizes","end","min","missing","range","splice","existingCollection","lastItem","getLastItem","opt","currentSize","index","size","newSize","getItemSize","push","offset","data","newItems","itemsCount","newRange","i","newIndex","newEnd","Error","newStart","isActiveRange","first","last","isActiveRangeOutsideLastItem","s","setItemSizes","vpItems","initialIndex","lastCoordinate","count","item","initialState","ViewportStore","this","lastKnownScroll","value","constructor","type","store","createStore","onChange","clearItems","setViewPortCoordinate","position","viewportSize","get","frameOffset","singleOffsetInPx","outsize","maxCoordinate","allItems","setViewport","setViewPortDimensionSizes","dropToOriginalSize","changedCoordinate","changedSize","setOriginalSizes","setStore","set"],"sources":["src/store/vp/viewport.helpers.ts","src/store/vp/viewport.store.ts"],"sourcesContent":["import {\n DimensionSettingsState,\n PositionItem,\n ViewSettingSizeProp,\n ViewportStateItems,\n VirtualPositionItem,\n Range,\n} from '@type';\n\nimport { getItemByPosition } from '../dimension/dimension.helpers';\n\nexport type DimensionDataViewport = Pick<\n DimensionSettingsState,\n | 'indexes'\n | 'positionIndexes'\n | 'positionIndexToItem'\n | 'sizes'\n | 'originItemSize'\n | 'realSize'\n>;\n\ntype ItemsToUpdate = Pick<ViewportStateItems, 'items' | 'start' | 'end'>;\n/**\n * Update items based on new scroll position\n * If viewport wasn't changed fully simple recombination of positions\n * Otherwise rebuild viewport items\n */\nexport function getUpdatedItemsByPosition<T extends ItemsToUpdate>(\n pos: number, // coordinate\n items: T,\n realCount: number,\n virtualSize: number,\n dimension: DimensionDataViewport,\n): ItemsToUpdate {\n const activeItem: PositionItem = getItemByPosition(dimension, pos);\n const firstItem: PositionItem = getFirstItem(items);\n let toUpdate: ItemsToUpdate;\n // do simple position recombination if items already present in viewport\n if (firstItem) {\n let changedOffsetStart = activeItem.itemIndex - (firstItem.itemIndex || 0);\n // if item changed\n if (changedOffsetStart) {\n // simple recombination\n toUpdate = recombineByOffset(Math.abs(changedOffsetStart), {\n positiveDirection: changedOffsetStart > -1,\n ...dimension,\n ...items,\n });\n }\n }\n\n const maxSizeVirtualSize = getMaxVirtualSize(\n virtualSize,\n dimension.realSize,\n activeItem,\n );\n // if partial recombination add items if revo-viewport has some space left\n if (toUpdate) {\n const extra = addMissingItems(\n activeItem,\n realCount,\n maxSizeVirtualSize,\n toUpdate,\n dimension,\n );\n if (extra.length) {\n updateMissingAndRange(toUpdate.items, extra, toUpdate);\n }\n }\n\n // new collection if no items after replacement full replacement\n if (!toUpdate) {\n const items = getItems({\n firstItemStart: activeItem.start,\n firstItemIndex: activeItem.itemIndex,\n origSize: dimension.originItemSize,\n maxSize: maxSizeVirtualSize,\n maxCount: realCount,\n sizes: dimension.sizes,\n });\n\n // range now comes from 0 to length - 1\n toUpdate = {\n items,\n start: 0,\n end: items.length - 1,\n };\n }\n return toUpdate;\n}\n\n// virtual size can differ based on scroll position if some big items are present\n// scroll can be in the middle of item and virtual size will be larger\n// so we need to exclude this part from virtual size hence it's already passed\nfunction getMaxVirtualSize(\n virtualSize: number,\n realSize: number,\n activeItem: PositionItem,\n) {\n return Math.min(virtualSize + (activeItem.end - activeItem.start), realSize);\n}\n\nexport function updateMissingAndRange(\n items: VirtualPositionItem[],\n missing: VirtualPositionItem[],\n range: Range,\n) {\n items.splice(range.end + 1, 0, ...missing);\n // update range if start larger after recombination\n if (\n range.start >= range.end &&\n !(range.start === range.end && range.start === 0)\n ) {\n range.start += missing.length;\n }\n range.end += missing.length;\n}\n\n/**\n * If partial replacement\n * this function adds items if viewport has some space left\n */\nexport function addMissingItems<T extends ItemsToUpdate>(\n firstItem: PositionItem,\n realCount: number,\n virtualSize: number,\n existingCollection: T,\n dimension: Pick<DimensionSettingsState, 'sizes' | 'originItemSize'>,\n): VirtualPositionItem[] {\n const lastItem: VirtualPositionItem = getLastItem(existingCollection);\n const items = getItems({\n sizes: dimension.sizes,\n firstItemStart: lastItem.end,\n firstItemIndex: lastItem.itemIndex + 1,\n origSize: dimension.originItemSize,\n maxSize: virtualSize - (lastItem.end - firstItem.start),\n maxCount: realCount,\n });\n return items;\n}\n\n/**\n * Get wiewport items parameters\n * caching position and calculating items count in viewport\n */\nexport function getItems(\n opt: {\n firstItemIndex: number;\n firstItemStart: number;\n origSize: number;\n maxSize: number; // virtual size\n maxCount: number; // real item count, where the last item\n sizes?: ViewSettingSizeProp;\n },\n currentSize = 0,\n) {\n const items: VirtualPositionItem[] = [];\n\n let index = opt.firstItemIndex;\n let size = currentSize;\n\n // max size or max count\n while (size <= opt.maxSize && index < opt.maxCount) {\n const newSize = getItemSize(index, opt.sizes, opt.origSize);\n items.push({\n start: opt.firstItemStart + size,\n end: opt.firstItemStart + size + newSize,\n itemIndex: index,\n size: newSize,\n });\n size += newSize;\n index++;\n }\n return items;\n}\n\n/**\n * Do batch items recombination\n * If items not overlapped with existing viewport returns null\n */\ntype RecombindDimensionData = Pick<\n DimensionSettingsState,\n 'sizes' | 'realSize' | 'originItemSize'\n>;\ntype RecombineOffsetData = {\n positiveDirection: boolean;\n} & ItemsToUpdate &\n RecombindDimensionData;\nexport function recombineByOffset(\n offset: number,\n data: RecombineOffsetData,\n): ItemsToUpdate | null {\n const newItems = [...data.items];\n const itemsCount = newItems.length;\n let newRange = {\n start: data.start,\n end: data.end,\n };\n\n // if offset out of revo-viewport, makes sense whole redraw\n if (offset > itemsCount) {\n return null;\n }\n\n // is direction of scroll positive\n if (data.positiveDirection) {\n // push item to the end\n let lastItem: VirtualPositionItem = getLastItem(data);\n\n let i = newRange.start;\n const length = i + offset;\n for (; i < length; i++) {\n const newIndex = lastItem.itemIndex + 1;\n const size = getItemSize(\n newIndex,\n data.sizes,\n data.originItemSize,\n );\n\n // if item overlapped limit break a loop\n if (lastItem.end + size > data.realSize) {\n break;\n }\n\n // new item index to recombine\n let newEnd = i % itemsCount;\n\n // item should always present, we do not create new item, we recombine them\n if (!newItems[newEnd]) {\n throw new Error('incorrect index');\n }\n\n // do recombination\n newItems[newEnd] = lastItem = {\n start: lastItem.end,\n end: lastItem.end + size,\n itemIndex: newIndex,\n size: size,\n };\n // update range\n newRange.start++;\n newRange.end = newEnd;\n }\n\n // direction is negative\n } else {\n // push item to the start\n let firstItem: VirtualPositionItem = getFirstItem(data);\n\n const end = newRange.end;\n for (let i = 0; i < offset; i++) {\n const newIndex = firstItem.itemIndex - 1;\n const size = getItemSize(\n newIndex,\n data.sizes,\n data.originItemSize,\n );\n\n // new item index to recombine\n let newStart = end - i;\n newStart = (newStart < 0 ? itemsCount + newStart : newStart) % itemsCount;\n\n // item should always present, we do not create new item, we recombine them\n if (!newItems[newStart]) {\n throw new Error('incorrect index');\n }\n\n // do recombination\n newItems[newStart] = firstItem = {\n start: firstItem.start - size,\n end: firstItem.start,\n itemIndex: newIndex,\n size: size,\n };\n // update range\n newRange.start = newStart;\n newRange.end--;\n }\n }\n const range = {\n start:\n (newRange.start < 0 ? itemsCount + newRange.start : newRange.start) %\n itemsCount,\n end:\n (newRange.end < 0 ? itemsCount + newRange.end : newRange.end) %\n itemsCount,\n };\n return {\n items: newItems,\n ...range,\n };\n}\n\nfunction getItemSize(\n index: number,\n sizes?: ViewSettingSizeProp,\n origSize = 0,\n): number {\n if (sizes && sizes[index]) {\n return sizes[index];\n }\n return origSize;\n}\n\n/**\n * Verify if position is in range of the PositionItem, start and end are included\n */\nexport function isActiveRange(\n pos: number,\n realSize: number,\n first?: PositionItem,\n last?: PositionItem,\n): boolean {\n if (!first || !last) {\n return false;\n }\n // if position is in range of first item\n // or position is after first item and last item is the last item in real size\n return (\n (pos >= first.start && pos <= first.end) ||\n (pos > first.end && last.end === realSize)\n );\n}\n\nexport function isActiveRangeOutsideLastItem(\n pos: number,\n virtualSize: number,\n firstItem?: PositionItem,\n lastItem?: PositionItem,\n) {\n // if no first item, means no items in viewport\n if (!firstItem) {\n return false;\n }\n return virtualSize + pos > lastItem?.end;\n}\n\nexport function getFirstItem(\n s: ItemsToUpdate,\n): VirtualPositionItem | undefined {\n return s.items[s.start];\n}\n\nexport function getLastItem(s: ItemsToUpdate): VirtualPositionItem {\n return s.items[s.end];\n}\n\n/**\n * Set items sizes from start index to end\n * @param vpItems\n * @param start\n * @param size\n * @param lastCoordinate\n * @returns\n */\nexport function setItemSizes(\n vpItems: VirtualPositionItem[],\n initialIndex: number,\n size: number,\n lastCoordinate: number,\n) {\n const items = [...vpItems];\n const count = items.length;\n\n let pos = lastCoordinate;\n let i = 0;\n let start = initialIndex;\n\n // viewport not inited\n if (!count) {\n return [];\n }\n // loop through array from initial item after recombination\n while (i < count) {\n const item = items[start];\n item.start = pos;\n item.size = size;\n item.end = item.start + size;\n pos = item.end;\n // loop by start index\n start++;\n i++;\n\n // if start index out of array, reset it\n if (start === count) {\n start = 0;\n }\n }\n return items;\n}\n","import {\n DimensionDataViewport,\n addMissingItems,\n getFirstItem,\n getLastItem,\n getUpdatedItemsByPosition,\n isActiveRange,\n setItemSizes,\n updateMissingAndRange,\n isActiveRangeOutsideLastItem,\n} from './viewport.helpers';\nimport { createStore } from '@stencil/store';\nimport { type Observable, setStore } from '../../utils/store.utils';\nimport type {\n VirtualPositionItem,\n ViewportStateItems,\n ViewportState,\n ViewSettingSizeProp,\n MultiDimensionType,\n} from '@type';\n\n/**\n * Viewport store\n * Used for virtualization (process of rendering only visible part of data)\n * Redraws viewport based on position and dimension\n */\nfunction initialState(): ViewportState {\n return {\n // virtual item information per rendered item\n items: [],\n // virtual dom item order to render\n start: 0,\n end: 0,\n\n // size of viewport in px\n virtualSize: 0,\n\n // total number of items\n realCount: 0,\n };\n}\n\n/**\n * Viewport store class\n */\nexport class ViewportStore {\n readonly store: Observable<ViewportState>;\n\n // last coordinate for store position restore\n private lastKnownScroll = 0;\n\n get lastCoordinate() {\n return this.lastKnownScroll;\n }\n set lastCoordinate(value: number) {\n this.lastKnownScroll = value;\n }\n constructor(readonly type: MultiDimensionType) {\n this.store = createStore(initialState());\n // drop items on real size change, require a new item set\n this.store.onChange('realCount', () => this.clearItems());\n // drop items on virtual size change, require a new item set\n this.store.onChange('virtualSize', () => this.clearItems());\n }\n\n /**\n * Render viewport based on coordinate\n * It's the main method for draw\n */\n setViewPortCoordinate(position: number, dimension: DimensionDataViewport) {\n const viewportSize = this.store.get('virtualSize');\n // no visible data to calculate\n if (!viewportSize) {\n return;\n }\n\n const frameOffset = 1;\n const singleOffsetInPx = dimension.originItemSize * frameOffset;\n // add offset to virtual size from both sides\n const outsize = singleOffsetInPx * 2;\n // math virtual size is based on visible area + 2 items outside of visible area\n const virtualSize = viewportSize + outsize;\n\n // expected no scroll if real size less than virtual size, position is 0\n let maxCoordinate = 0;\n // if there is nodes outside of viewport, max coordinate has to be adjusted\n if (dimension.realSize > viewportSize) {\n // max coordinate is real size minus virtual/rendered space\n maxCoordinate = dimension.realSize - viewportSize - singleOffsetInPx;\n }\n\n let pos = position;\n // limit position to max and min coordinates\n if (pos < 0) {\n pos = 0;\n } else if (pos > maxCoordinate) {\n pos = maxCoordinate;\n }\n\n // store last coordinate for further restore on redraw\n this.lastCoordinate = pos;\n\n // actual position is less than first item start based on offset\n pos -= singleOffsetInPx;\n pos = pos < 0 ? 0 : pos < maxCoordinate ? pos : maxCoordinate;\n\n const allItems = this.getItems();\n const items = [...allItems.items];\n\n const firstItem: VirtualPositionItem | undefined = getFirstItem(allItems);\n const lastItem: VirtualPositionItem | undefined = getLastItem(allItems);\n\n let toUpdate: Partial<ViewportState> = {};\n\n // left position changed\n // verify if new position is in range of previously rendered first item\n if (!isActiveRange(pos, dimension.realSize, firstItem, lastItem)) {\n toUpdate = {\n ...toUpdate,\n ...getUpdatedItemsByPosition(\n pos,\n allItems,\n this.store.get('realCount'),\n virtualSize,\n dimension,\n ),\n };\n this.setViewport({ ...toUpdate });\n // verify is render area is outside of last item\n } else if (\n isActiveRangeOutsideLastItem(pos, virtualSize, firstItem, lastItem)\n ) {\n // check is any item missing for full fill content\n const missing = addMissingItems(\n firstItem,\n this.store.get('realCount'),\n virtualSize + pos - firstItem.start,\n allItems,\n {\n sizes: dimension.sizes,\n originItemSize: dimension.originItemSize,\n },\n );\n\n // update missing items\n if (missing.length) {\n const range = {\n start: this.store.get('start'),\n end: this.store.get('end'),\n };\n updateMissingAndRange(items, missing, range);\n toUpdate = {\n ...toUpdate,\n items: [...items],\n ...range,\n };\n this.setViewport({ ...toUpdate });\n }\n }\n }\n\n /**\n * Update viewport sizes for existing items\n * This method is generating new item positions based on custom sizes and original sizes\n * @param sizes - custom sizes for each item\n * @param dropToOriginalSize - drop to original size if requested\n */\n setViewPortDimensionSizes(\n sizes: ViewSettingSizeProp,\n dropToOriginalSize?: number,\n ) {\n let items = [...this.store.get('items')];\n const count = items.length;\n // viewport not inited\n if (!count) {\n return;\n }\n\n let changedCoordinate = 0;\n let i = 0;\n let start = this.store.get('start');\n\n // drop to original size if requested\n if (dropToOriginalSize) {\n const allItems = this.getItems();\n const firstItem: VirtualPositionItem | undefined = getFirstItem(allItems);\n items = setItemSizes(items, start, dropToOriginalSize, firstItem.start);\n }\n\n // loop through array from initial item after recombination\n // if size change present, change position for all items after\n while (i < count) {\n const item = items[start];\n // change pos if size change present before\n if (changedCoordinate) {\n item.start += changedCoordinate;\n item.end += changedCoordinate;\n }\n // check if size change present\n const size: number | undefined = sizes[item.itemIndex];\n // size found\n if (size) {\n const changedSize = size - item.size;\n changedCoordinate += changedSize;\n item.size = size;\n item.end = item.start + size;\n // size lost\n }\n\n // loop by start index\n start++;\n i++;\n // if start index out of array, reset it\n if (start === count) {\n start = 0;\n }\n }\n\n this.setViewport({ items: [...items] });\n }\n\n /**\n * Set sizes for existing items\n */\n setOriginalSizes(size: number) {\n const items = this.store.get('items');\n const count = items.length;\n // viewport not inited\n if (!count) {\n return;\n }\n\n setStore(this.store, {\n items: setItemSizes(\n items,\n this.store.get('start'),\n size,\n this.lastCoordinate,\n ),\n });\n }\n\n getItems(): Pick<ViewportStateItems, 'items' | 'start' | 'end'> {\n return {\n items: this.store.get('items'),\n start: this.store.get('start'),\n end: this.store.get('end'),\n };\n }\n\n setViewport(data: Partial<ViewportState>) {\n setStore(this.store, data);\n }\n\n clearItems() {\n this.store.set('items', []);\n }\n}\n"],"mappings":";;;2EA2BgBA,EACdC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAMC,EAA2BC,EAAkBF,EAAWJ,GAC9D,MAAMO,EAA0BC,EAAaP,GAC7C,IAAIQ,EAEJ,GAAIF,EAAW,CACb,IAAIG,EAAqBL,EAAWM,WAAaJ,EAAUI,WAAa,GAExE,GAAID,EAAoB,CAEtBD,EAAWG,EAAkBC,KAAKC,IAAIJ,GAAmBK,OAAAC,OAAAD,OAAAC,OAAA,CACvDC,kBAAmBP,GAAsB,GACtCN,GACAH,G,EAKT,MAAMiB,EAAqBC,EACzBhB,EACAC,EAAUgB,SACVf,GAGF,GAAII,EAAU,CACZ,MAAMY,EAAQC,EACZjB,EACAH,EACAgB,EACAT,EACAL,GAEF,GAAIiB,EAAME,OAAQ,CAChBC,EAAsBf,EAASR,MAAOoB,EAAOZ,E,EAKjD,IAAKA,EAAU,CACb,MAAMR,EAAQwB,EAAS,CACrBC,eAAgBrB,EAAWsB,MAC3BC,eAAgBvB,EAAWM,UAC3BkB,SAAUzB,EAAU0B,eACpBC,QAASb,EACTc,SAAU9B,EACV+B,MAAO7B,EAAU6B,QAInBxB,EAAW,CACTR,QACA0B,MAAO,EACPO,IAAKjC,EAAMsB,OAAS,E,CAGxB,OAAOd,CACT,CAKA,SAASU,EACPhB,EACAiB,EACAf,GAEA,OAAOQ,KAAKsB,IAAIhC,GAAeE,EAAW6B,IAAM7B,EAAWsB,OAAQP,EACrE,C,SAEgBI,EACdvB,EACAmC,EACAC,GAEApC,EAAMqC,OAAOD,EAAMH,IAAM,EAAG,KAAME,GAElC,GACEC,EAAMV,OAASU,EAAMH,OACnBG,EAAMV,QAAUU,EAAMH,KAAOG,EAAMV,QAAU,GAC/C,CACAU,EAAMV,OAASS,EAAQb,M,CAEzBc,EAAMH,KAAOE,EAAQb,MACvB,C,SAMgBD,EACdf,EACAL,EACAC,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,KAAKK,MAAO3B,E,CAGvB,UAAA8B,GACER,KAAKK,MAAMoB,IAAI,QAAS,G","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  import { DSourceState } from "../../store/index";
2
- import { DimensionCols, DimensionRows, RowDrag } from "../../types/index";
3
- import { ColumnRegular, Observable, DataType, CellProps, ColumnDataSchemaModel, ColumnProp, DataLookup, DataFormat } from "../../types/index";
4
- import { ChangedRange, OldNewRangeMapping, Cell, RangeArea, BeforeSaveDataDetails, EditorCtr, Editors } from "../../types/index";
2
+ import { DimensionCols, DimensionRows, RowDrag, ColumnRegular, DataType, CellProps, ColumnDataSchemaModel, ColumnProp, DataLookup, DataFormat, ChangedRange, OldNewRangeMapping, Cell, RangeArea, BeforeSaveDataDetails, EditorCtr, Editors } from "../../types/index";
3
+ import { Observable } from '../../utils/store.utils';
5
4
  export type ColumnStores = {
6
5
  [T in DimensionCols]: Observable<DSourceState<ColumnRegular, DimensionCols>>;
7
6
  };
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { DSourceState } from "../../store/index";
3
3
  import { DimensionCols, DimensionRows } from "../../types/index";
4
- import { Observable, ViewportState, DimensionSettingsState, BeforeRowRenderEvent, Providers, ColumnRegular, DataType, BeforeCellRenderEvent, DragStartEvent, ColumnDataSchemaModel, VirtualPositionItem } from "../../types/index";
5
- import { SelectionStoreState } from "../../types/index";
4
+ import { ViewportState, DimensionSettingsState, BeforeRowRenderEvent, Providers, ColumnRegular, DataType, BeforeCellRenderEvent, DragStartEvent, ColumnDataSchemaModel, VirtualPositionItem, SelectionStoreState } from "../../types/index";
5
+ import { Observable } from '../../utils/store.utils';
6
6
  /**
7
7
  * This component is responsible for rendering data
8
8
  * Rows, columns, groups and cells
@@ -1,4 +1,4 @@
1
- import { h as createElement } from '../../stencil-public-runtime';
1
+ import { VNode, h as createElement } from '../../stencil-public-runtime';
2
2
  import { ColumnRegular } from "../../types/index";
3
3
  import { EditCell, EditorBase, SaveData } from "../../types/index";
4
4
  /**
@@ -18,7 +18,7 @@ export declare class TextEditor implements EditorBase {
18
18
  private saveCallback?;
19
19
  private editInput;
20
20
  element: Element | null;
21
- editCell: EditCell | null;
21
+ editCell?: EditCell;
22
22
  constructor(column: ColumnRegular, saveCallback?: SaveCallback);
23
23
  /**
24
24
  * Callback triggered on cell editor render
@@ -42,5 +42,5 @@ export declare class TextEditor implements EditorBase {
42
42
  * @param {Object} _additionalData - additional data from plugin.
43
43
  * @returns {VNode} - input element.
44
44
  */
45
- render(h: typeof createElement, _additionalData: any): import("@stencil/core").VNode;
45
+ render(h: typeof createElement, _additionalData: any): VNode | VNode[];
46
46
  }
@@ -2,9 +2,8 @@ import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { HTMLStencilElement } from '../../stencil-public-runtime';
3
3
  import { Groups } from "../../store/index";
4
4
  import { ResizeProps } from '../../services/resizable.directive';
5
- import { ColumnRegular, DimensionSettingsState, InitialHeaderClick, Observable, Providers, ViewportState, ViewSettingSizeProp } from "../../types/index";
6
- import { DimensionCols } from "../../types/index";
7
- import { SelectionStoreState } from "../../types/index";
5
+ import { ColumnRegular, DimensionSettingsState, InitialHeaderClick, Providers, ViewportState, ViewSettingSizeProp, DimensionCols, SelectionStoreState } from "../../types/index";
6
+ import { Observable } from '../../utils/store.utils';
8
7
  export declare class RevogrHeaderComponent {
9
8
  /**
10
9
  * Stores
@@ -53,15 +52,15 @@ export declare class RevogrHeaderComponent {
53
52
  additionalData: any;
54
53
  /**
55
54
  * On initial header click
56
- */
55
+ */
57
56
  initialHeaderClick: EventEmitter<InitialHeaderClick>;
58
57
  /**
59
58
  * On header resize
60
- */
59
+ */
61
60
  headerresize: EventEmitter<ViewSettingSizeProp>;
62
61
  /**
63
62
  * On before header resize
64
- */
63
+ */
65
64
  beforeResize: EventEmitter<ColumnRegular[]>;
66
65
  /**
67
66
  * On header double click
@@ -1,8 +1,7 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { DSourceState } from "../../store/index";
3
- import { DimensionRows } from "../../types/index";
4
- import { DataType, DimensionSettingsState, DragStartEvent, Observable, PositionItem } from "../../types/index";
5
- import { Cell } from "../../types/index";
3
+ import { DimensionRows, DataType, DimensionSettingsState, DragStartEvent, PositionItem, Cell } from "../../types/index";
4
+ import { Observable } from '../../utils/store.utils';
6
5
  /**
7
6
  * Component for handling row order editor.
8
7
  */
@@ -1,7 +1,8 @@
1
1
  import { EventData } from './selection.utils';
2
2
  import { DSourceState } from "../../store/index";
3
3
  import ColumnService from '../data/column.service';
4
- import { DataLookup, DataType, DimensionSettingsState, Observable, TempRange, ChangedRange, BeforeRangeSaveDataDetails, RangeArea, Cell, DimensionRows } from "../../types/index";
4
+ import { DataLookup, DataType, DimensionSettingsState, TempRange, ChangedRange, BeforeRangeSaveDataDetails, RangeArea, Cell, DimensionRows } from "../../types/index";
5
+ import { Observable } from '../../utils/store.utils';
5
6
  type Config = {
6
7
  dimensionRow: Observable<DimensionSettingsState>;
7
8
  dimensionCol: Observable<DimensionSettingsState>;
@@ -1,6 +1,6 @@
1
1
  import { EventData } from './selection.utils';
2
2
  import { Cell, RangeArea, SelectionStoreState } from "../../types/index";
3
- import { Observable } from "../../types/index";
3
+ import { Observable } from '../../utils/store.utils';
4
4
  type Config = {
5
5
  selectionStore: Observable<SelectionStoreState>;
6
6
  change(val?: any): void;
@@ -3,7 +3,7 @@ import ColumnService from '../data/column.service';
3
3
  import { DSourceState } from "../../store/index";
4
4
  import { EventData } from './selection.utils';
5
5
  import { Observable, SelectionStoreState, DimensionSettingsState, DataType, DimensionRows, ColumnRegular, DimensionCols, Cell, DragStartEvent } from '../../components';
6
- import { MultiDimensionType } from "../../types/index";
6
+ import { EditCellStore, MultiDimensionType } from "../../types/index";
7
7
  import { FocusRenderEvent, ApplyFocusEvent, AllDimensionType } from "../../types/index";
8
8
  import { Editors, BeforeSaveDataDetails, BeforeEdit, RangeArea, TempRange, ChangedRange, BeforeRangeSaveDataDetails, SaveDataDetails } from "../../types/index";
9
9
  /**
@@ -230,7 +230,7 @@ export declare class OverlaySelection {
230
230
  * Verify if edit allowed.
231
231
  */
232
232
  protected canEdit(): boolean;
233
- get edited(): import("@type").EditCellStore;
233
+ get edited(): EditCellStore;
234
234
  /**
235
235
  * Sets the focus on a cell and optionally edits a range.
236
236
  */
@@ -9,11 +9,8 @@ import { ColumnFilterConfig, FilterCollection } from '../../plugins/filter/filte
9
9
  import { DataInput } from '../../plugins/export/types';
10
10
  import { GroupingOptions } from '../../plugins/groupingRow/grouping.row.types';
11
11
  import { FocusedData } from './viewport.service';
12
- import { MultiDimensionType, DimensionRows, DimensionCols, DimensionTypeCol } from "../../types/index";
13
- import { RowHeaders, ColumnRegular, ColumnGrouping, DataType, RowDefinition, ColumnType, FocusTemplateFunc, PositionItem, ColumnProp, ViewPortScrollEvent, InitialHeaderClick, ColumnDataSchema, Observable, AllDimensionType } from "../../types/index";
14
- import { Editors, BeforeSaveDataDetails, BeforeRangeSaveDataDetails, Cell, ChangedRange, RangeArea, AfterEditEvent } from "../../types/index";
15
- import { Theme } from "../../types/index";
16
- import { PluginBaseComponent, PluginExternalConstructor } from "../../types/index";
12
+ import { MultiDimensionType, DimensionRows, DimensionCols, DimensionTypeCol, RowHeaders, ColumnRegular, ColumnGrouping, DataType, RowDefinition, ColumnType, FocusTemplateFunc, PositionItem, ColumnProp, ViewPortScrollEvent, InitialHeaderClick, ColumnDataSchema, AllDimensionType, Editors, BeforeSaveDataDetails, BeforeRangeSaveDataDetails, Cell, ChangedRange, RangeArea, AfterEditEvent, Theme, PluginBaseComponent, PluginExternalConstructor } from "../../types/index";
13
+ import { Observable } from '../../utils/store.utils';
17
14
  /**
18
15
  * Revogrid - High-performance, customizable grid library for managing large datasets.
19
16
  *
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { DimensionType } from "../../types/index";
3
- import { Observable, ViewportState, DimensionSettingsState, ViewPortScrollEvent } from "../../types/index";
3
+ import { ViewportState, DimensionSettingsState, ViewPortScrollEvent } from "../../types/index";
4
+ import { Observable } from '../../utils/store.utils';
4
5
  /**
5
6
  * Virtual scroll component
6
7
  */
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { DSourceState } from "../../store/index";
3
- import { SelectionStoreState, ColumnRegular, DataType, DimensionSettingsState, FocusRenderEvent, FocusTemplateFunc, Observable, DimensionCols, DimensionRows } from "../../types/index";
3
+ import { SelectionStoreState, ColumnRegular, DataType, DimensionSettingsState, FocusRenderEvent, FocusTemplateFunc, DimensionCols, DimensionRows } from "../../types/index";
4
+ import { Observable } from '../../utils/store.utils';
4
5
  /**
5
6
  * Focus component. Shows focus layer around the cell that is currently in focus.
6
7
  * @slot focus-${view.type}-${data.type}. @example focus-rgCol-rgRow
@@ -1,5 +1,6 @@
1
- import { Observable, DimensionSettingsState } from "../../types/index";
1
+ import { DimensionSettingsState } from "../../types/index";
2
2
  import { SelectionStoreState } from "../../types/index";
3
+ import { Observable } from '../../utils/store.utils';
3
4
  /**
4
5
  * Temporary range selection component. Shows temporary range selection.
5
6
  */
@@ -1,8 +1,9 @@
1
+ import { VNode } from '../../stencil-public-runtime';
1
2
  import { JSX } from '../../components';
2
3
  /**
3
4
  * Converts a VNode element into an HTML element and appends it to the specified parentHolder.
4
5
  */
5
6
  export declare function convertVNodeToHTML(parentHolder: Element, redraw: JSX.VnodeHtml['redraw']): Promise<{
6
7
  html: string;
7
- vnodes: import("@stencil/core/internal/stencil-public-runtime").VNode[];
8
+ vnodes: VNode[];
8
9
  }>;
@@ -5,7 +5,7 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { AfterEditEvent, AllDimensionType, ApplyFocusEvent, BeforeCellRenderEvent, BeforeEdit, BeforeRangeSaveDataDetails, BeforeRowRenderEvent, BeforeSaveDataDetails, Cell, ChangedRange, ColumnDataSchemaModel, ColumnGrouping, ColumnProp, ColumnRegular, ColumnType, DataFormat, DataType, DimensionCols, DimensionRows, DimensionSettingsState, DimensionType, DimensionTypeCol, DragStartEvent, EditCell, EditorCtr, Editors, ElementScroll, FocusRenderEvent, FocusTemplateFunc, InitialHeaderClick, MultiDimensionType, Observable, PluginBaseComponent, PluginExternalConstructor, PositionItem, RangeArea, RowDefinition, RowHeaders, SaveDataDetails, SelectionStoreState, TempRange, Theme, ViewportData, ViewPortResizeEvent, ViewPortScrollEvent, ViewportState, ViewSettingSizeProp } from "./types/index";
8
+ import { AfterEditEvent, AllDimensionType, ApplyFocusEvent, BeforeCellRenderEvent, BeforeEdit, BeforeRangeSaveDataDetails, BeforeRowRenderEvent, BeforeSaveDataDetails, Cell, ChangedRange, ColumnDataSchemaModel, ColumnGrouping, ColumnProp, ColumnRegular, ColumnType, DataFormat, DataType, DimensionCols, DimensionRows, DimensionSettingsState, DimensionType, DimensionTypeCol, DragStartEvent, EditCell, EditorCtr, Editors, ElementScroll, FocusRenderEvent, FocusTemplateFunc, InitialHeaderClick, MultiDimensionType, PluginBaseComponent, PluginExternalConstructor, PositionItem, RangeArea, RowDefinition, RowHeaders, SaveDataDetails, SelectionStoreState, TempRange, Theme, ViewportData, ViewPortResizeEvent, ViewPortScrollEvent, ViewportState, ViewSettingSizeProp } from "./types/index";
9
9
  import { AutoSizeColumnConfig } from "./plugins/column.auto-size.plugin";
10
10
  import { ColumnFilterConfig, FilterCaptions, FilterCollection } from "./plugins/filter/filter.plugin";
11
11
  import { GroupingOptions } from "./plugins/groupingRow/grouping.row.types";
@@ -13,12 +13,13 @@ import { VNode } from "./stencil-public-runtime";
13
13
  import { FocusedData } from "./components/revoGrid/viewport.service";
14
14
  import { ColumnCollection } from "./services/column.data.provider";
15
15
  import { DataInput } from "./plugins/export/types";
16
+ import { Observable } from "./utils/store.utils";
16
17
  import { DSourceState, Groups } from "./store/index";
17
18
  import { MultiFilterItem, ShowData } from "./plugins/filter/filter.pop";
18
19
  import { LogicFunction } from "./plugins/filter/filter.types";
19
20
  import { ResizeProps } from "./services/resizable.directive";
20
21
  import { Cell as Cell1, ColumnRegular as ColumnRegular1, DataType as DataType1, DimensionCols as DimensionCols1, DimensionRows as DimensionRows1, DimensionSettingsState as DimensionSettingsState1, Observable as Observable1, SelectionStoreState as SelectionStoreState1 } from "./components";
21
- export { AfterEditEvent, AllDimensionType, ApplyFocusEvent, BeforeCellRenderEvent, BeforeEdit, BeforeRangeSaveDataDetails, BeforeRowRenderEvent, BeforeSaveDataDetails, Cell, ChangedRange, ColumnDataSchemaModel, ColumnGrouping, ColumnProp, ColumnRegular, ColumnType, DataFormat, DataType, DimensionCols, DimensionRows, DimensionSettingsState, DimensionType, DimensionTypeCol, DragStartEvent, EditCell, EditorCtr, Editors, ElementScroll, FocusRenderEvent, FocusTemplateFunc, InitialHeaderClick, MultiDimensionType, Observable, PluginBaseComponent, PluginExternalConstructor, PositionItem, RangeArea, RowDefinition, RowHeaders, SaveDataDetails, SelectionStoreState, TempRange, Theme, ViewportData, ViewPortResizeEvent, ViewPortScrollEvent, ViewportState, ViewSettingSizeProp } from "./types/index";
22
+ export { AfterEditEvent, AllDimensionType, ApplyFocusEvent, BeforeCellRenderEvent, BeforeEdit, BeforeRangeSaveDataDetails, BeforeRowRenderEvent, BeforeSaveDataDetails, Cell, ChangedRange, ColumnDataSchemaModel, ColumnGrouping, ColumnProp, ColumnRegular, ColumnType, DataFormat, DataType, DimensionCols, DimensionRows, DimensionSettingsState, DimensionType, DimensionTypeCol, DragStartEvent, EditCell, EditorCtr, Editors, ElementScroll, FocusRenderEvent, FocusTemplateFunc, InitialHeaderClick, MultiDimensionType, PluginBaseComponent, PluginExternalConstructor, PositionItem, RangeArea, RowDefinition, RowHeaders, SaveDataDetails, SelectionStoreState, TempRange, Theme, ViewportData, ViewPortResizeEvent, ViewPortScrollEvent, ViewportState, ViewSettingSizeProp } from "./types/index";
22
23
  export { AutoSizeColumnConfig } from "./plugins/column.auto-size.plugin";
23
24
  export { ColumnFilterConfig, FilterCaptions, FilterCollection } from "./plugins/filter/filter.plugin";
24
25
  export { GroupingOptions } from "./plugins/groupingRow/grouping.row.types";
@@ -26,6 +27,7 @@ export { VNode } from "./stencil-public-runtime";
26
27
  export { FocusedData } from "./components/revoGrid/viewport.service";
27
28
  export { ColumnCollection } from "./services/column.data.provider";
28
29
  export { DataInput } from "./plugins/export/types";
30
+ export { Observable } from "./utils/store.utils";
29
31
  export { DSourceState, Groups } from "./store/index";
30
32
  export { MultiFilterItem, ShowData } from "./plugins/filter/filter.pop";
31
33
  export { LogicFunction } from "./plugins/filter/filter.types";
@@ -1,12 +1,14 @@
1
+ import { DSourceState } from "../../store/index";
1
2
  import { BasePlugin } from '../base.plugin';
2
3
  import { GroupingOptions } from './grouping.row.types';
3
- import { PluginProviders } from "../../types/index";
4
+ import { DataType, DimensionRows, PluginProviders } from "../../types/index";
5
+ import { Observable } from '../../utils/store.utils';
4
6
  export default class GroupingRowPlugin extends BasePlugin {
5
7
  protected revogrid: HTMLRevoGridElement;
6
8
  protected providers: PluginProviders;
7
9
  private options;
8
10
  get hasProps(): number;
9
- get store(): import("@type").Observable<import("@store").DSourceState<import("@type").DataType, import("@type").DimensionRows>>;
11
+ get store(): Observable<DSourceState<DataType, DimensionRows>>;
10
12
  get rowItems(): number[];
11
13
  get trimmed(): Record<any, any>;
12
14
  constructor(revogrid: HTMLRevoGridElement, providers: PluginProviders);
@@ -989,7 +989,6 @@ export declare namespace JSXBase {
989
989
  interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
990
990
  form?: string;
991
991
  htmlFor?: string;
992
- htmlfor?: string;
993
992
  }
994
993
  interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
995
994
  value?: string | string[] | number;
@@ -1100,7 +1099,6 @@ export declare namespace JSXBase {
1100
1099
  interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
1101
1100
  form?: string;
1102
1101
  htmlFor?: string;
1103
- htmlfor?: string;
1104
1102
  name?: string;
1105
1103
  }
1106
1104
  interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -1,5 +1,5 @@
1
1
  import { DSourceState } from "../index";
2
- import { Observable, PluginSubscribe } from "../../types/index";
2
+ import { Observable, PluginSubscribe } from '../../utils/store.utils';
3
3
  type State = DSourceState<any, any>;
4
4
  /**
5
5
  * All items
@@ -1,7 +1,8 @@
1
1
  import { Trimmed } from './trimmed.plugin';
2
+ import { Observable } from '../../utils/store.utils';
2
3
  import { GroupLabelTemplateFunc } from '../../plugins/groupingRow/grouping.row.types';
3
4
  import { DimensionRows, DimensionCols } from "../../types/index";
4
- import type { ColumnProperties, ColumnGrouping, ColumnRegular, DataType, DataSourceState, Observable, ColumnProp } from "../../types/index";
5
+ import type { ColumnProperties, ColumnGrouping, ColumnRegular, DataType, DataSourceState, ColumnProp } from "../../types/index";
5
6
  export interface Group extends ColumnProperties {
6
7
  name: string;
7
8
  children: (ColumnGrouping | ColumnRegular)[];
@@ -1,4 +1,4 @@
1
- import { Observable, PluginSubscribe } from "../../types/index";
1
+ import { Observable, PluginSubscribe } from '../../utils/store.utils';
2
2
  import { DSourceState } from './data.store';
3
3
  export type TrimmedEntity = Record<number, boolean>;
4
4
  export type Trimmed = Record<string, TrimmedEntity>;
@@ -1,8 +1,5 @@
1
- /**
2
- * Storing pre-calculated
3
- * Dimension information and sizes
4
- */
5
- import { DimensionSettingsState, Observable, ViewSettingSizeProp, MultiDimensionType } from "../../types/index";
1
+ import { Observable } from '../../utils/store.utils';
2
+ import { DimensionSettingsState, ViewSettingSizeProp, MultiDimensionType } from "../../types/index";
6
3
  export type DimensionStoreCollection = {
7
4
  [T in MultiDimensionType]: DimensionStore;
8
5
  };
@@ -18,17 +15,5 @@ export declare class DimensionStore {
18
15
  * Generates new indexes based on sizes
19
16
  * @param sizes - sizes to set
20
17
  */
21
- setDimensionSize(sizes: ViewSettingSizeProp): {
22
- indexes: number[];
23
- positionIndexes: number[];
24
- positionIndexToItem: {
25
- [x: number]: import("@type").PositionItem;
26
- };
27
- indexToItem: {
28
- [index: number]: import("@type").PositionItem;
29
- };
30
- sizes: {
31
- [x: string]: number;
32
- };
33
- };
18
+ setDimensionSize(sizes: ViewSettingSizeProp): void;
34
19
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Selection store
3
3
  */
4
- import { Observable } from "../../types/index";
4
+ import { Observable } from '../../utils/store.utils';
5
5
  import { SelectionStoreState, Cell, TempRange, RangeArea } from "../../types/index";
6
6
  export declare class SelectionStore {
7
7
  readonly store: Observable<SelectionStoreState>;
@@ -1,5 +1,6 @@
1
1
  import { DimensionDataViewport } from './viewport.helpers';
2
- import type { ViewportStateItems, ViewportState, Observable, ViewSettingSizeProp, MultiDimensionType } from "../../types/index";
2
+ import { type Observable } from '../../utils/store.utils';
3
+ import type { ViewportStateItems, ViewportState, ViewSettingSizeProp, MultiDimensionType } from "../../types/index";
3
4
  /**
4
5
  * Viewport store class
5
6
  */
@@ -1,9 +1,7 @@
1
- import { VNode } from '../stencil-public-runtime';
2
- import { ObservableMap, Subscription } from '@stencil/store';
1
+ import type { VNode } from '../stencil-public-runtime';
3
2
  import { DimensionCols, DimensionRows, DimensionColPin, DimensionType, MultiDimensionType } from './dimension';
4
3
  import { Cell, EditorCtr, FocusedCells, RangeArea, SelectionStoreState } from './selection';
5
- export type Observable<T> = ObservableMap<T>;
6
- export type PluginSubscribe<T> = Subscription<T>;
4
+ import type { Observable } from '../utils/store.utils';
7
5
  export type ColumnDataSchemaModel = {
8
6
  /**
9
7
  * Column prop used for mapping value to cell from data source model/row
@@ -1,6 +1,7 @@
1
1
  import type { JSXBase } from '../stencil-public-runtime';
2
- import type { DimensionCols, ColumnRegular, Observable, ViewPortScrollEvent, ViewportState, Cell, SelectionStoreState } from "./index";
2
+ import type { DimensionCols, ColumnRegular, ViewPortScrollEvent, ViewportState, Cell, SelectionStoreState } from "./index";
3
3
  import type { DimensionStoreCollection, ViewportStoreCollection, DSourceState } from "../store/index";
4
+ import { Observable } from '../utils/store.utils';
4
5
  import type { RowDataSources } from '../services/data.provider';
5
6
  import type { JSX } from '..';
6
7
  export type SlotType = 'content' | 'header' | 'footer';
@@ -0,0 +1,97 @@
1
+ export interface Handlers<T> {
2
+ dispose: DisposeEventHandler[];
3
+ get: GetEventHandler<T>[];
4
+ reset: ResetEventHandler[];
5
+ set: SetEventHandler<T>[];
6
+ }
7
+ export type SetEventHandler<StoreType> = (key: keyof StoreType, newValue: any, oldValue: any) => void;
8
+ export type GetEventHandler<StoreType> = (key: keyof StoreType) => void;
9
+ export type ResetEventHandler = () => void;
10
+ export type DisposeEventHandler = () => void;
11
+ export interface OnHandler<StoreType> {
12
+ (eventName: 'set', callback: SetEventHandler<StoreType>): () => void;
13
+ (eventName: 'get', callback: GetEventHandler<StoreType>): () => void;
14
+ (eventName: 'dispose', callback: DisposeEventHandler): () => void;
15
+ (eventName: 'reset', callback: ResetEventHandler): () => void;
16
+ }
17
+ export interface OnChangeHandler<StoreType> {
18
+ <Key extends keyof StoreType>(propName: Key, cb: (newValue: StoreType[Key]) => void): () => void;
19
+ }
20
+ export interface Subscription<StoreType> {
21
+ dispose?(): void;
22
+ get?<KeyFromStoreType extends keyof StoreType>(key: KeyFromStoreType): void;
23
+ set?<KeyFromStoreType extends keyof StoreType>(key: KeyFromStoreType, newValue: StoreType[KeyFromStoreType], oldValue: StoreType[KeyFromStoreType]): void;
24
+ reset?(): void;
25
+ }
26
+ export interface Getter<T> {
27
+ <P extends keyof T>(propName: P & string): T[P];
28
+ }
29
+ export interface Setter<T> {
30
+ <P extends keyof T>(propName: P & string, value: T[P]): void;
31
+ }
32
+ export interface ObservableMap<T> {
33
+ /**
34
+ * Proxied object that will detect dependencies and call
35
+ * the subscriptions and computed properties.
36
+ *
37
+ * If available, it will detect from which Stencil Component
38
+ * it was called and rerender it when the property changes.
39
+ *
40
+ * Note: Proxy objects are not supported by IE11 (not even with a polyfill)
41
+ * so you need to use the store.get and store.set methods of the API if you wish to support IE11.
42
+ *
43
+ */
44
+ state: T;
45
+ /**
46
+ * Only useful if you need to support IE11.
47
+ *
48
+ * @example
49
+ * const { state, get } = createStore({ hola: 'hello', adios: 'goodbye' });
50
+ * console.log(state.hola); // If you don't need to support IE11, use this way.
51
+ * console.log(get('hola')); // If you need to support IE11, use this other way.
52
+ */
53
+ get: Getter<T>;
54
+ /**
55
+ * Only useful if you need to support IE11.
56
+ *
57
+ * @example
58
+ * const { state, get } = createStore({ hola: 'hello', adios: 'goodbye' });
59
+ * state.hola = 'ola'; // If you don't need to support IE11, use this way.
60
+ * set('hola', 'ola')); // If you need to support IE11, use this other way.
61
+ */
62
+ set: Setter<T>;
63
+ /**
64
+ * Register a event listener, you can listen to `set`, `get` and `reset` events.
65
+ *
66
+ * @example
67
+ * store.on('set', (prop, value) => {
68
+ * console.log(`Prop ${prop} changed to: ${value}`);
69
+ * });
70
+ */
71
+ on: OnHandler<T>;
72
+ /**
73
+ * Easily listen for value changes of the specified key.
74
+ */
75
+ onChange: OnChangeHandler<T>;
76
+ /**
77
+ * Resets the state to its original state and
78
+ * signals a dispose event to all the plugins.
79
+ *
80
+ * This method is intended for plugins to reset
81
+ * all their internal state between tests.
82
+ */
83
+ dispose(): void;
84
+ /**
85
+ * Resets the state to its original state.
86
+ */
87
+ reset(): void;
88
+ /**
89
+ * Registers a subscription that will be called whenever the user gets, sets, or
90
+ * resets a value.
91
+ */
92
+ use(...plugins: Subscription<T>[]): () => void;
93
+ /**
94
+ * Force a rerender of the specified key, just like the value changed.
95
+ */
96
+ forceUpdate(key: keyof T): any;
97
+ }
@@ -1,6 +1,7 @@
1
- import type { Observable } from "../types/index";
1
+ import { ObservableMap, Subscription } from './store.types';
2
+ export type Observable<T> = ObservableMap<T>;
3
+ export type PluginSubscribe<T> = Subscription<T>;
2
4
  /** Set stores data */
3
- declare function setStore<T extends {
5
+ export declare function setStore<T extends {
4
6
  [key: string]: any;
5
7
  }>(store: Observable<T>, data: Partial<T>): void;
6
- export { setStore };