@revolist/revogrid 4.0.28 → 4.0.30

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 (198) 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-991dda26.js} +3 -3
  4. package/dist/cjs/base.plugin-991dda26.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 +7 -7
  24. package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
  25. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +3 -3
  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/header/revogr-header.js +8 -8
  40. package/dist/collection/components/header/revogr-header.js.map +1 -1
  41. package/dist/collection/components/order/revogr-order-editor.js +6 -6
  42. package/dist/collection/components/order/revogr-order-editor.js.map +1 -1
  43. package/dist/collection/components/overlay/autofill.service.js.map +1 -1
  44. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  45. package/dist/collection/components/revoGrid/revo-grid.js +9 -9
  46. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  47. package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
  48. package/dist/collection/components/scrollable/revogr-scroll-virtual.js +5 -5
  49. package/dist/collection/components/scrollable/revogr-scroll-virtual.js.map +1 -1
  50. package/dist/collection/components/selectionFocus/revogr-focus.js +10 -10
  51. package/dist/collection/components/selectionFocus/revogr-focus.js.map +1 -1
  52. package/dist/collection/components/selectionTempRange/revogr-temp-range.js +6 -6
  53. package/dist/collection/components/selectionTempRange/revogr-temp-range.js.map +1 -1
  54. package/dist/collection/components/vnode/vnode-converter.js +2 -2
  55. package/dist/collection/store/dataSource/data.proxy.js.map +1 -1
  56. package/dist/collection/store/dataSource/data.store.js +1 -1
  57. package/dist/collection/store/dataSource/data.store.js.map +1 -1
  58. package/dist/collection/store/dataSource/trimmed.plugin.js.map +1 -1
  59. package/dist/collection/store/dimension/dimension.store.js +1 -1
  60. package/dist/collection/store/dimension/dimension.store.js.map +1 -1
  61. package/dist/collection/store/selection/selection.store.js +1 -1
  62. package/dist/collection/store/selection/selection.store.js.map +1 -1
  63. package/dist/collection/store/vp/viewport.store.js +1 -1
  64. package/dist/collection/store/vp/viewport.store.js.map +1 -1
  65. package/dist/collection/types/interfaces.js.map +1 -1
  66. package/dist/collection/types/viewport.interfaces.js.map +1 -1
  67. package/dist/collection/utils/store.types.js +2 -0
  68. package/dist/collection/utils/store.types.js.map +1 -0
  69. package/dist/collection/utils/store.utils.js +1 -2
  70. package/dist/collection/utils/store.utils.js.map +1 -1
  71. package/dist/esm/{app-globals-ef1fca59.js → app-globals-c0b06b03.js} +2 -2
  72. package/dist/esm/{app-globals-ef1fca59.js.map → app-globals-c0b06b03.js.map} +1 -1
  73. package/dist/esm/{base.plugin-d0e589d8.js → base.plugin-454940e3.js} +3 -3
  74. package/dist/esm/base.plugin-454940e3.js.map +1 -0
  75. package/dist/esm/{column.service-a826bbd6.js → column.service-ffe99cfc.js} +4 -4
  76. package/dist/esm/{column.service-a826bbd6.js.map → column.service-ffe99cfc.js.map} +1 -1
  77. package/dist/esm/{dimension.helpers-a3065cb1.js → dimension.helpers-c0c2888f.js} +193 -193
  78. package/dist/esm/dimension.helpers-c0c2888f.js.map +1 -0
  79. package/dist/esm/{filter.button-46ce4f80.js → filter.button-f132c10a.js} +2 -2
  80. package/dist/esm/{filter.button-46ce4f80.js.map → filter.button-f132c10a.js.map} +1 -1
  81. package/dist/esm/{header-cell-renderer-19738045.js → header-cell-renderer-cac333a3.js} +3 -3
  82. package/dist/esm/{header-cell-renderer-19738045.js.map → header-cell-renderer-cac333a3.js.map} +1 -1
  83. package/dist/esm/{index-21436631.js → index-e661aeb5.js} +193 -185
  84. package/dist/esm/index-e661aeb5.js.map +1 -0
  85. package/dist/esm/index.js +5 -5
  86. package/dist/esm/{key.utils-7c5d91dd.js → key.utils-9120fde7.js} +2 -2
  87. package/dist/esm/{key.utils-7c5d91dd.js.map → key.utils-9120fde7.js.map} +1 -1
  88. package/dist/esm/loader.js +3 -3
  89. package/dist/esm/revo-grid.entry.js +11 -11
  90. package/dist/esm/revo-grid.entry.js.map +1 -1
  91. package/dist/esm/revo-grid.js +4 -4
  92. package/dist/esm/revo-grid.js.map +1 -1
  93. package/dist/esm/revogr-attribution_6.entry.js +7 -7
  94. package/dist/esm/revogr-attribution_6.entry.js.map +1 -1
  95. package/dist/esm/revogr-clipboard_3.entry.js +3 -3
  96. package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
  97. package/dist/esm/revogr-data_4.entry.js +8 -8
  98. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  99. package/dist/esm/revogr-filter-panel.entry.js +2 -2
  100. package/dist/esm/{selection.helpers-883ce6bc.js → selection.helpers-0f3ed629.js} +3 -3
  101. package/dist/esm/selection.helpers-0f3ed629.js.map +1 -0
  102. package/dist/esm/{viewport.store-d9e291c5.js → viewport.store-2dc172be.js} +2 -2
  103. package/dist/esm/{viewport.store-d9e291c5.js.map → viewport.store-2dc172be.js.map} +1 -1
  104. package/dist/revo-grid/app-globals-c0b06b03.js +5 -0
  105. package/dist/revo-grid/{base.plugin-d0e589d8.js → base.plugin-454940e3.js} +2 -2
  106. package/dist/revo-grid/base.plugin-454940e3.js.map +1 -0
  107. package/dist/revo-grid/{column.service-a826bbd6.js → column.service-ffe99cfc.js} +2 -2
  108. package/dist/revo-grid/column.service-ffe99cfc.js.map +1 -0
  109. package/dist/revo-grid/dimension.helpers-c0c2888f.js +5 -0
  110. package/dist/revo-grid/dimension.helpers-c0c2888f.js.map +1 -0
  111. package/dist/revo-grid/{filter.button-46ce4f80.js → filter.button-f132c10a.js} +2 -2
  112. package/dist/revo-grid/{header-cell-renderer-19738045.js → header-cell-renderer-cac333a3.js} +2 -2
  113. package/dist/revo-grid/index-e661aeb5.js +6 -0
  114. package/dist/revo-grid/index-e661aeb5.js.map +1 -0
  115. package/dist/revo-grid/index.esm.js +1 -1
  116. package/dist/revo-grid/{key.utils-7c5d91dd.js → key.utils-9120fde7.js} +2 -2
  117. package/dist/revo-grid/revo-grid.entry.js +1 -1
  118. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  119. package/dist/revo-grid/revo-grid.esm.js +1 -1
  120. package/dist/revo-grid/revo-grid.esm.js.map +1 -1
  121. package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
  122. package/dist/revo-grid/revogr-attribution_6.entry.js.map +1 -1
  123. package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
  124. package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
  125. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  126. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  127. package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
  128. package/dist/revo-grid/{selection.helpers-883ce6bc.js → selection.helpers-0f3ed629.js} +2 -2
  129. package/dist/revo-grid/selection.helpers-0f3ed629.js.map +1 -0
  130. package/dist/revo-grid/{viewport.store-d9e291c5.js → viewport.store-2dc172be.js} +2 -2
  131. package/dist/revo-grid/viewport.store-2dc172be.js.map +1 -0
  132. package/dist/types/components/data/column.service.d.ts +2 -3
  133. package/dist/types/components/data/revogr-data.d.ts +2 -2
  134. package/dist/types/components/header/revogr-header.d.ts +5 -6
  135. package/dist/types/components/order/revogr-order-editor.d.ts +2 -3
  136. package/dist/types/components/overlay/autofill.service.d.ts +2 -1
  137. package/dist/types/components/overlay/keyboard.service.d.ts +1 -1
  138. package/dist/types/components/revoGrid/revo-grid.d.ts +2 -5
  139. package/dist/types/components/scrollable/revogr-scroll-virtual.d.ts +2 -1
  140. package/dist/types/components/selectionFocus/revogr-focus.d.ts +2 -1
  141. package/dist/types/components/selectionTempRange/revogr-temp-range.d.ts +2 -1
  142. package/dist/types/components.d.ts +4 -2
  143. package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +1 -1
  144. package/dist/types/stencil-public-runtime.d.ts +0 -2
  145. package/dist/types/store/dataSource/data.proxy.d.ts +1 -1
  146. package/dist/types/store/dataSource/data.store.d.ts +2 -1
  147. package/dist/types/store/dataSource/trimmed.plugin.d.ts +1 -1
  148. package/dist/types/store/dimension/dimension.store.d.ts +2 -5
  149. package/dist/types/store/selection/selection.store.d.ts +1 -1
  150. package/dist/types/store/vp/viewport.store.d.ts +2 -1
  151. package/dist/types/types/interfaces.d.ts +2 -4
  152. package/dist/types/types/viewport.interfaces.d.ts +2 -1
  153. package/dist/types/utils/store.types.d.ts +97 -0
  154. package/dist/types/utils/store.utils.d.ts +4 -3
  155. package/hydrate/index.d.ts +29 -11
  156. package/hydrate/index.js +545 -541
  157. package/hydrate/index.mjs +32502 -0
  158. package/hydrate/package.json +7 -1
  159. package/loader/index.d.ts +3 -0
  160. package/package.json +3 -3
  161. package/standalone/column.service.js +1 -1
  162. package/standalone/column.service.js.map +1 -1
  163. package/standalone/data.store.js +192 -192
  164. package/standalone/data.store.js.map +1 -1
  165. package/standalone/revo-grid.js +3 -3
  166. package/standalone/revo-grid.js.map +1 -1
  167. package/standalone/revogr-data2.js.map +1 -1
  168. package/standalone/revogr-focus2.js.map +1 -1
  169. package/standalone/revogr-header2.js +2 -2
  170. package/standalone/revogr-header2.js.map +1 -1
  171. package/standalone/revogr-order-editor2.js.map +1 -1
  172. package/standalone/revogr-overlay-selection2.js.map +1 -1
  173. package/standalone/revogr-row-headers2.js.map +1 -1
  174. package/standalone/revogr-scroll-virtual2.js +1 -1
  175. package/standalone/revogr-scroll-virtual2.js.map +1 -1
  176. package/standalone/revogr-temp-range2.js.map +1 -1
  177. package/standalone/selection.utils.js +1 -1
  178. package/dist/cjs/base.plugin-32f80cb5.js.map +0 -1
  179. package/dist/cjs/dimension.helpers-ee39d6c4.js.map +0 -1
  180. package/dist/cjs/index-84e32c2a.js.map +0 -1
  181. package/dist/cjs/selection.helpers-32abb2a9.js.map +0 -1
  182. package/dist/esm/base.plugin-d0e589d8.js.map +0 -1
  183. package/dist/esm/dimension.helpers-a3065cb1.js.map +0 -1
  184. package/dist/esm/index-21436631.js.map +0 -1
  185. package/dist/esm/selection.helpers-883ce6bc.js.map +0 -1
  186. package/dist/revo-grid/app-globals-ef1fca59.js +0 -5
  187. package/dist/revo-grid/base.plugin-d0e589d8.js.map +0 -1
  188. package/dist/revo-grid/column.service-a826bbd6.js.map +0 -1
  189. package/dist/revo-grid/dimension.helpers-a3065cb1.js +0 -5
  190. package/dist/revo-grid/dimension.helpers-a3065cb1.js.map +0 -1
  191. package/dist/revo-grid/index-21436631.js +0 -6
  192. package/dist/revo-grid/index-21436631.js.map +0 -1
  193. package/dist/revo-grid/selection.helpers-883ce6bc.js.map +0 -1
  194. package/dist/revo-grid/viewport.store-d9e291c5.js.map +0 -1
  195. /package/dist/revo-grid/{app-globals-ef1fca59.js.map → app-globals-c0b06b03.js.map} +0 -0
  196. /package/dist/revo-grid/{filter.button-46ce4f80.js.map → filter.button-f132c10a.js.map} +0 -0
  197. /package/dist/revo-grid/{header-cell-renderer-19738045.js.map → header-cell-renderer-cac333a3.js.map} +0 -0
  198. /package/dist/revo-grid/{key.utils-7c5d91dd.js.map → key.utils-9120fde7.js.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { getRenderingRef, forceUpdate } from '@stencil/core/internal/client';
5
4
  import { _ as _baseIteratee, e as eq_1 } from './_baseIteratee.js';
6
5
  import { t as toNumber_1, i as isObject_1 } from './toNumber.js';
7
6
  import { i as isArrayLike_1, b as _isIndex } from './identity.js';
7
+ import { getRenderingRef, forceUpdate } from '@stencil/core/internal/client';
8
8
 
9
9
  /**
10
10
  * All items
@@ -41,197 +41,6 @@ function isProxy(k) {
41
41
  return k === 'proxyItems';
42
42
  }
43
43
 
44
- const appendToMap = (map, propName, value) => {
45
- const items = map.get(propName);
46
- if (!items) {
47
- map.set(propName, [value]);
48
- }
49
- else if (!items.includes(value)) {
50
- items.push(value);
51
- }
52
- };
53
- const debounce = (fn, ms) => {
54
- let timeoutId;
55
- return (...args) => {
56
- if (timeoutId) {
57
- clearTimeout(timeoutId);
58
- }
59
- timeoutId = setTimeout(() => {
60
- timeoutId = 0;
61
- fn(...args);
62
- }, ms);
63
- };
64
- };
65
-
66
- /**
67
- * Check if a possible element isConnected.
68
- * The property might not be there, so we check for it.
69
- *
70
- * We want it to return true if isConnected is not a property,
71
- * otherwise we would remove these elements and would not update.
72
- *
73
- * Better leak in Edge than to be useless.
74
- */
75
- const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
76
- const cleanupElements = debounce((map) => {
77
- for (let key of map.keys()) {
78
- map.set(key, map.get(key).filter(isConnected));
79
- }
80
- }, 2000);
81
- const stencilSubscription = () => {
82
- if (typeof getRenderingRef !== 'function') {
83
- // If we are not in a stencil project, we do nothing.
84
- // This function is not really exported by @stencil/core.
85
- return {};
86
- }
87
- const elmsToUpdate = new Map();
88
- return {
89
- dispose: () => elmsToUpdate.clear(),
90
- get: (propName) => {
91
- const elm = getRenderingRef();
92
- if (elm) {
93
- appendToMap(elmsToUpdate, propName, elm);
94
- }
95
- },
96
- set: (propName) => {
97
- const elements = elmsToUpdate.get(propName);
98
- if (elements) {
99
- elmsToUpdate.set(propName, elements.filter(forceUpdate));
100
- }
101
- cleanupElements(elmsToUpdate);
102
- },
103
- reset: () => {
104
- elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
105
- cleanupElements(elmsToUpdate);
106
- },
107
- };
108
- };
109
-
110
- const unwrap = (val) => (typeof val === 'function' ? val() : val);
111
- const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
112
- const unwrappedState = unwrap(defaultState);
113
- let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
114
- const handlers = {
115
- dispose: [],
116
- get: [],
117
- set: [],
118
- reset: [],
119
- };
120
- const reset = () => {
121
- var _a;
122
- // When resetting the state, the default state may be a function - unwrap it to invoke it.
123
- // otherwise, the state won't be properly reset
124
- states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
125
- handlers.reset.forEach((cb) => cb());
126
- };
127
- const dispose = () => {
128
- // Call first dispose as resetting the state would
129
- // cause less updates ;)
130
- handlers.dispose.forEach((cb) => cb());
131
- reset();
132
- };
133
- const get = (propName) => {
134
- handlers.get.forEach((cb) => cb(propName));
135
- return states.get(propName);
136
- };
137
- const set = (propName, value) => {
138
- const oldValue = states.get(propName);
139
- if (shouldUpdate(value, oldValue, propName)) {
140
- states.set(propName, value);
141
- handlers.set.forEach((cb) => cb(propName, value, oldValue));
142
- }
143
- };
144
- const state = (typeof Proxy === 'undefined'
145
- ? {}
146
- : new Proxy(unwrappedState, {
147
- get(_, propName) {
148
- return get(propName);
149
- },
150
- ownKeys(_) {
151
- return Array.from(states.keys());
152
- },
153
- getOwnPropertyDescriptor() {
154
- return {
155
- enumerable: true,
156
- configurable: true,
157
- };
158
- },
159
- has(_, propName) {
160
- return states.has(propName);
161
- },
162
- set(_, propName, value) {
163
- set(propName, value);
164
- return true;
165
- },
166
- }));
167
- const on = (eventName, callback) => {
168
- handlers[eventName].push(callback);
169
- return () => {
170
- removeFromArray(handlers[eventName], callback);
171
- };
172
- };
173
- const onChange = (propName, cb) => {
174
- const unSet = on('set', (key, newValue) => {
175
- if (key === propName) {
176
- cb(newValue);
177
- }
178
- });
179
- // We need to unwrap the defaultState because it might be a function.
180
- // Otherwise we might not be sending the right reset value.
181
- const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
182
- return () => {
183
- unSet();
184
- unReset();
185
- };
186
- };
187
- const use = (...subscriptions) => {
188
- const unsubs = subscriptions.reduce((unsubs, subscription) => {
189
- if (subscription.set) {
190
- unsubs.push(on('set', subscription.set));
191
- }
192
- if (subscription.get) {
193
- unsubs.push(on('get', subscription.get));
194
- }
195
- if (subscription.reset) {
196
- unsubs.push(on('reset', subscription.reset));
197
- }
198
- if (subscription.dispose) {
199
- unsubs.push(on('dispose', subscription.dispose));
200
- }
201
- return unsubs;
202
- }, []);
203
- return () => unsubs.forEach((unsub) => unsub());
204
- };
205
- const forceUpdate = (key) => {
206
- const oldValue = states.get(key);
207
- handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
208
- };
209
- return {
210
- state,
211
- get,
212
- set,
213
- on,
214
- onChange,
215
- use,
216
- dispose,
217
- reset,
218
- forceUpdate,
219
- };
220
- };
221
- const removeFromArray = (array, item) => {
222
- const index = array.indexOf(item);
223
- if (index >= 0) {
224
- array[index] = array[array.length - 1];
225
- array.length--;
226
- }
227
- };
228
-
229
- const createStore = (defaultState, shouldUpdate) => {
230
- const map = createObservableMap(defaultState, shouldUpdate);
231
- map.use(stencilSubscription());
232
- return map;
233
- };
234
-
235
44
  /**
236
45
  * The base implementation of `_.findIndex` and `_.findLastIndex` without
237
46
  * support for iteratee shorthands.
@@ -533,6 +342,197 @@ var range = createRange();
533
342
 
534
343
  var range_1 = range;
535
344
 
345
+ const appendToMap = (map, propName, value) => {
346
+ const items = map.get(propName);
347
+ if (!items) {
348
+ map.set(propName, [value]);
349
+ }
350
+ else if (!items.includes(value)) {
351
+ items.push(value);
352
+ }
353
+ };
354
+ const debounce = (fn, ms) => {
355
+ let timeoutId;
356
+ return (...args) => {
357
+ if (timeoutId) {
358
+ clearTimeout(timeoutId);
359
+ }
360
+ timeoutId = setTimeout(() => {
361
+ timeoutId = 0;
362
+ fn(...args);
363
+ }, ms);
364
+ };
365
+ };
366
+
367
+ /**
368
+ * Check if a possible element isConnected.
369
+ * The property might not be there, so we check for it.
370
+ *
371
+ * We want it to return true if isConnected is not a property,
372
+ * otherwise we would remove these elements and would not update.
373
+ *
374
+ * Better leak in Edge than to be useless.
375
+ */
376
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
377
+ const cleanupElements = debounce((map) => {
378
+ for (let key of map.keys()) {
379
+ map.set(key, map.get(key).filter(isConnected));
380
+ }
381
+ }, 2000);
382
+ const stencilSubscription = () => {
383
+ if (typeof getRenderingRef !== 'function') {
384
+ // If we are not in a stencil project, we do nothing.
385
+ // This function is not really exported by @stencil/core.
386
+ return {};
387
+ }
388
+ const elmsToUpdate = new Map();
389
+ return {
390
+ dispose: () => elmsToUpdate.clear(),
391
+ get: (propName) => {
392
+ const elm = getRenderingRef();
393
+ if (elm) {
394
+ appendToMap(elmsToUpdate, propName, elm);
395
+ }
396
+ },
397
+ set: (propName) => {
398
+ const elements = elmsToUpdate.get(propName);
399
+ if (elements) {
400
+ elmsToUpdate.set(propName, elements.filter(forceUpdate));
401
+ }
402
+ cleanupElements(elmsToUpdate);
403
+ },
404
+ reset: () => {
405
+ elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
406
+ cleanupElements(elmsToUpdate);
407
+ },
408
+ };
409
+ };
410
+
411
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
412
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
413
+ const unwrappedState = unwrap(defaultState);
414
+ let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
415
+ const handlers = {
416
+ dispose: [],
417
+ get: [],
418
+ set: [],
419
+ reset: [],
420
+ };
421
+ const reset = () => {
422
+ var _a;
423
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
424
+ // otherwise, the state won't be properly reset
425
+ states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
426
+ handlers.reset.forEach((cb) => cb());
427
+ };
428
+ const dispose = () => {
429
+ // Call first dispose as resetting the state would
430
+ // cause less updates ;)
431
+ handlers.dispose.forEach((cb) => cb());
432
+ reset();
433
+ };
434
+ const get = (propName) => {
435
+ handlers.get.forEach((cb) => cb(propName));
436
+ return states.get(propName);
437
+ };
438
+ const set = (propName, value) => {
439
+ const oldValue = states.get(propName);
440
+ if (shouldUpdate(value, oldValue, propName)) {
441
+ states.set(propName, value);
442
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
443
+ }
444
+ };
445
+ const state = (typeof Proxy === 'undefined'
446
+ ? {}
447
+ : new Proxy(unwrappedState, {
448
+ get(_, propName) {
449
+ return get(propName);
450
+ },
451
+ ownKeys(_) {
452
+ return Array.from(states.keys());
453
+ },
454
+ getOwnPropertyDescriptor() {
455
+ return {
456
+ enumerable: true,
457
+ configurable: true,
458
+ };
459
+ },
460
+ has(_, propName) {
461
+ return states.has(propName);
462
+ },
463
+ set(_, propName, value) {
464
+ set(propName, value);
465
+ return true;
466
+ },
467
+ }));
468
+ const on = (eventName, callback) => {
469
+ handlers[eventName].push(callback);
470
+ return () => {
471
+ removeFromArray(handlers[eventName], callback);
472
+ };
473
+ };
474
+ const onChange = (propName, cb) => {
475
+ const unSet = on('set', (key, newValue) => {
476
+ if (key === propName) {
477
+ cb(newValue);
478
+ }
479
+ });
480
+ // We need to unwrap the defaultState because it might be a function.
481
+ // Otherwise we might not be sending the right reset value.
482
+ const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
483
+ return () => {
484
+ unSet();
485
+ unReset();
486
+ };
487
+ };
488
+ const use = (...subscriptions) => {
489
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
490
+ if (subscription.set) {
491
+ unsubs.push(on('set', subscription.set));
492
+ }
493
+ if (subscription.get) {
494
+ unsubs.push(on('get', subscription.get));
495
+ }
496
+ if (subscription.reset) {
497
+ unsubs.push(on('reset', subscription.reset));
498
+ }
499
+ if (subscription.dispose) {
500
+ unsubs.push(on('dispose', subscription.dispose));
501
+ }
502
+ return unsubs;
503
+ }, []);
504
+ return () => unsubs.forEach((unsub) => unsub());
505
+ };
506
+ const forceUpdate = (key) => {
507
+ const oldValue = states.get(key);
508
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
509
+ };
510
+ return {
511
+ state,
512
+ get,
513
+ set,
514
+ on,
515
+ onChange,
516
+ use,
517
+ dispose,
518
+ reset,
519
+ forceUpdate,
520
+ };
521
+ };
522
+ const removeFromArray = (array, item) => {
523
+ const index = array.indexOf(item);
524
+ if (index >= 0) {
525
+ array[index] = array[array.length - 1];
526
+ array.length--;
527
+ }
528
+ };
529
+
530
+ const createStore = (defaultState, shouldUpdate) => {
531
+ const map = createObservableMap(defaultState, shouldUpdate);
532
+ map.use(stencilSubscription());
533
+ return map;
534
+ };
535
+
536
536
  /**
537
537
  * Hide items from main collection
538
538
  * But keep them in store
@@ -1 +1 @@
1
- {"file":"data.store.js","mappings":";;;;;;;;AAKA;;;;;MAKa,WAAW,GAAG,CAAC,KAAwB,MAA8B;IAChF,GAAG,CAAC,CAAC,EAAE,MAAM;QACX,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACf,OAAO;SACR;;;;;QAKD,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAA0B,EAAE,CAAS;YAC/E,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YACZ,OAAO,CAAC,CAAC;SACV,EAAE,EAAE,CAAC,CAAC;;;;;QAKP,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAW,EAAE,CAAS;YACpD,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;gBACf,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACX;YACD,OAAO,CAAC,CAAC;SACV,EAAE,EAAE,CAAC,CAAC;QACP,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC9B;CACF,EAAE;AAE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AAC;KAChD;IACD,IAAI,MAAM,EAAE;QACV,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;KAClC;AACH,CAAC;AAED;;;;;;SAMgB,wBAAwB,CACtC,KAAuC,EACvC,YAA+B,EAC/B,MAAM,GAAG,IAAI;IAEb,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,KAAK,IAAI,KAAK,IAAI,YAAY,EAAE;QAC9B,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;KACrC;IACD,IAAI,MAAM,EAAE;QACV,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;KAClC;AACH,CAAC;SAEe,QAAQ,CACtB,KAAuC,EACvC,KAAe;IAEf,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5B,CAAC;SAEe,+BAA+B,CAC7C,KAAyC,EACzC,IAAgB;IAEhB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,aAAa,GAAGC,WAAS,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACtC;;;;","names":["baseFindIndex","require$$0","toFinite","toInteger","require$$1","require$$2","nativeMax","baseRange","require$$3","isIterateeCall","createRange","range","findIndex"],"sources":["src/store/dataSource/data.proxy.ts","node_modules/@stencil/store/dist/index.mjs","node_modules/lodash/_baseFindIndex.js","node_modules/lodash/toFinite.js","node_modules/lodash/toInteger.js","node_modules/lodash/findIndex.js","node_modules/lodash/_baseRange.js","node_modules/lodash/_isIterateeCall.js","node_modules/lodash/_createRange.js","node_modules/lodash/range.js","src/store/dataSource/trimmed.plugin.ts","src/utils/store.utils.ts","src/store/dataSource/data.store.ts"],"sourcesContent":["import { DSourceState } from '@store';\nimport { Observable, PluginSubscribe } from '@type';\n\ntype State = DSourceState<any, any>;\n\n/**\n * All items\n * Used as proxy for sorting\n * Keep order but do not modify final source\n */\nexport const proxyPlugin = (store: Observable<State>): PluginSubscribe<State> => ({\n set(k, newVal) {\n if (!isProxy(k)) {\n return;\n }\n /**\n * Getting existing collection of items\n * Mark indexes as visible\n */\n const oldItems = store.get('items').reduce((r: Record<number, boolean>, v: number) => {\n r[v] = true;\n return r;\n }, {});\n /**\n * Check if new values where present in items\n * Filter item collection according presense\n */\n const newItems = newVal.reduce((r: number[], i: number) => {\n if (oldItems[i]) {\n r.push(i);\n }\n return r;\n }, []);\n store.set('items', newItems);\n },\n});\n\nfunction isProxy(k: keyof State): k is 'proxyItems' {\n return k === 'proxyItems';\n}\n","import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n var _a;\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;\n","var createRange = require('./_createRange');\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nmodule.exports = range;\n","import { Observable, PluginSubscribe } from '@type';\nimport { DSourceState } from './data.store';\n\nexport type TrimmedEntity = Record<number, boolean>;\nexport type Trimmed = Record<string, TrimmedEntity>;\n\n/**\n * Hide items from main collection\n * But keep them in store\n */\nexport const trimmedPlugin = <T>(store: Observable<DSourceState<T, any>>): PluginSubscribe<DSourceState<T, any>> => ({\n set(k, newVal) {\n switch (k) {\n case 'trimmed':\n const proxy = store.get('proxyItems');\n const trimmed = gatherTrimmedItems(newVal as Trimmed);\n\n const newItems = proxy.reduce((result: number[], v: number) => {\n // check if present in new trimmed remove from items (filter)\n if (!trimmed[v]) {\n result.push(v);\n }\n return result;\n }, []);\n\n store.set('items', newItems);\n break;\n }\n },\n});\n\nexport function gatherTrimmedItems(trimmedItems: Trimmed) {\n const trimmed: TrimmedEntity = {};\n\n for (let trimmedKey in trimmedItems) {\n // trimmed overweight not trimmed\n for (let t in trimmedItems[trimmedKey]) {\n trimmed[t] = trimmed[t] || trimmedItems[trimmedKey][t];\n }\n }\n return trimmed;\n}\n","import type { Observable } from '@type';\n\n/** Set stores data */\nfunction setStore<T extends { [key: string]: any }>(\n store: Observable<T>,\n data: Partial<T>,\n) {\n for (let key in data) {\n store.set(key, data[key]);\n }\n}\n\nexport { setStore };\n","import { createStore } from '@stencil/store';\nimport findIndex from 'lodash/findIndex';\nimport range from 'lodash/range';\n\nimport { Trimmed, trimmedPlugin } from './trimmed.plugin';\nimport { setStore } from '../../utils/store.utils';\nimport { proxyPlugin } from './data.proxy';\nimport { GroupLabelTemplateFunc } from '../../plugins/groupingRow/grouping.row.types';\nimport { DimensionRows, DimensionCols } from '@type';\nimport type {\n ColumnProperties,\n ColumnGrouping,\n ColumnRegular,\n DataType,\n DataSourceState,\n Observable,\n ColumnProp,\n} from '@type';\n\nexport interface Group extends ColumnProperties {\n name: string;\n children: (ColumnGrouping | ColumnRegular)[];\n // props/ids\n ids: (string | number)[];\n}\nexport type Groups = Record<any, any>;\nexport type GDataType = DataType | ColumnRegular;\nexport type GDimension = DimensionRows | DimensionCols;\nexport type DSourceState<\n T1 extends GDataType,\n T2 extends GDimension,\n> = DataSourceState<T1, T2> & {\n groupingCustomRenderer?: GroupLabelTemplateFunc | null;\n};\n\n/**\n * Data store\n * Manage the state of a data source and provide methods for updating, adding, and refreshing the data.\n */\nexport class DataStore<T extends GDataType, ST extends GDimension> {\n private readonly dataStore: Observable<DSourceState<T, ST>>;\n get store(): Observable<DSourceState<T, ST>> {\n return this.dataStore;\n }\n constructor(type: ST, storeData?: DSourceState<T, ST>) {\n const store = (this.dataStore = createStore<DSourceState<T, ST>>({\n items: [],\n proxyItems: [],\n source: [],\n groupingDepth: 0,\n groups: {},\n type,\n trimmed: {},\n groupingCustomRenderer: undefined,\n ...storeData,\n }));\n store.use(proxyPlugin(store));\n store.use(trimmedPlugin(store));\n }\n\n /**\n * full data source update\n * @param source - data column/rgRow source\n * @param grouping - grouping information if present\n */\n updateData(\n source: T[],\n grouping?: {\n depth: number;\n groups?: Groups;\n customRenderer?: GroupLabelTemplateFunc;\n },\n silent = false,\n ) {\n // during full update we do drop trim\n if (!silent) {\n this.store.set('trimmed', {});\n }\n // clear items\n this.store.set('items', []);\n const items = range(0, source?.length || 0);\n\n // set proxy first\n setStore(this.store, {\n source,\n proxyItems: [...items],\n });\n // update data items\n this.store.set('items', items);\n // apply grouping if present\n if (grouping) {\n setStore(this.store, {\n groupingDepth: grouping.depth,\n groups: grouping.groups,\n groupingCustomRenderer: grouping.customRenderer,\n });\n }\n }\n\n addTrimmed(some: Partial<Trimmed>) {\n let trimmed = this.store.get('trimmed');\n trimmed = { ...trimmed, ...some };\n setStore(this.store, { trimmed });\n }\n\n // local data update\n setData(input: Partial<DSourceState<T, ST>>) {\n const data: Partial<DSourceState<T, ST>> = {\n ...input,\n };\n setStore(this.store, data);\n }\n\n refresh() {\n const source = this.store.get('source');\n this.store.set('source', [...source]);\n }\n}\n/**\n * get physical index by virtual\n * @param store - store to process\n */\nexport function getPhysical(\n store: Observable<DSourceState<any, any>>,\n virtualIndex: number,\n) {\n const items = store.get('items');\n return items[virtualIndex];\n}\n\n/**\n * get all visible items\n * @param store - store to process\n */\nexport function getVisibleSourceItem(\n store: Observable<DSourceState<any, any>>,\n) {\n const source = store.get('source');\n return store.get('items').map(v => source[v]);\n}\n\n/**\n * get mapped item from source\n * @param store - store to process\n * @param virtualIndex - virtual index to process\n */\nexport const getSourceItem = (\n store: Observable<DSourceState<any, any>>,\n virtualIndex: number,\n): any | undefined => {\n const items = store.get('items');\n const source = store.get('source');\n return source[items[virtualIndex]];\n};\n\n/**\n * Apple item/model/row value to data source\n * @param store - data source with changes\n * @param modelByIndex - collection of rows/values with virtual indexes to setup/replace in store/data source\n * @param mutate - if true, store will be mutated and whole viewport will be re-rendered\n */\nexport function setSourceByVirtualIndex<T>(\n store: Observable<DSourceState<T, any>>,\n modelByIndex: Record<number, T>,\n mutate = true,\n) {\n const items = store.get('items');\n const source = store.get('source');\n\n for (let virtualIndex in modelByIndex) {\n const realIndex = items[virtualIndex];\n source[realIndex] = modelByIndex[virtualIndex];\n }\n if (mutate) {\n store.set('source', [...source]);\n }\n}\n\n/**\n * set item to source\n * @param store - store to process\n * @param modelByIndex - collection of rows with physical indexes to setup\n * @param mutate - if true, store will be mutated and whole viewport will be re-rendered\n */\nexport function setSourceByPhysicalIndex<T>(\n store: Observable<DSourceState<T, any>>,\n modelByIndex: Record<number, T>,\n mutate = true,\n) {\n const source = store.get('source');\n for (let index in modelByIndex) {\n source[index] = modelByIndex[index];\n }\n if (mutate) {\n store.set('source', [...source]);\n }\n}\n\nexport function setItems<T>(\n store: Observable<DSourceState<T, any>>,\n items: number[],\n) {\n store.set('items', items);\n}\n\nexport function getSourceItemVirtualIndexByProp(\n store: Observable<DSourceState<any, any>>,\n prop: ColumnProp,\n) {\n const items = store.get('items');\n const source = store.get('source');\n const physicalIndex = findIndex(source, { prop });\n return items.indexOf(physicalIndex);\n}\n"],"version":3}
1
+ {"file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e;IAEf,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5B,CAAC;SAEe,+BAA+B,CAC7C,KAAyC,EACzC,IAAgB;IAEhB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,aAAa,GAAGC,WAAS,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACtC;;;;","names":["baseFindIndex","require$$0","toFinite","toInteger","require$$1","require$$2","nativeMax","baseRange","require$$3","isIterateeCall","createRange","range","findIndex"],"sources":["src/store/dataSource/data.proxy.ts","node_modules/lodash/_baseFindIndex.js","node_modules/lodash/toFinite.js","node_modules/lodash/toInteger.js","node_modules/lodash/findIndex.js","node_modules/lodash/_baseRange.js","node_modules/lodash/_isIterateeCall.js","node_modules/lodash/_createRange.js","node_modules/lodash/range.js","node_modules/@stencil/store/dist/index.mjs","src/store/dataSource/trimmed.plugin.ts","src/utils/store.utils.ts","src/store/dataSource/data.store.ts"],"sourcesContent":["import { DSourceState } from '@store';\nimport { Observable, PluginSubscribe } from '../../utils/store.utils';\n\ntype State = DSourceState<any, any>;\n\n/**\n * All items\n * Used as proxy for sorting\n * Keep order but do not modify final source\n */\nexport const proxyPlugin = (store: Observable<State>): PluginSubscribe<State> => ({\n set(k, newVal) {\n if (!isProxy(k)) {\n return;\n }\n /**\n * Getting existing collection of items\n * Mark indexes as visible\n */\n const oldItems = store.get('items').reduce((r: Record<number, boolean>, v: number) => {\n r[v] = true;\n return r;\n }, {});\n /**\n * Check if new values where present in items\n * Filter item collection according presense\n */\n const newItems = newVal.reduce((r: number[], i: number) => {\n if (oldItems[i]) {\n r.push(i);\n }\n return r;\n }, []);\n store.set('items', newItems);\n },\n});\n\nfunction isProxy(k: keyof State): k is 'proxyItems' {\n return k === 'proxyItems';\n}\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;\n","var createRange = require('./_createRange');\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nmodule.exports = range;\n","import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n var _a;\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","import { Observable, PluginSubscribe } from '../../utils/store.utils';\nimport { DSourceState } from './data.store';\n\nexport type TrimmedEntity = Record<number, boolean>;\nexport type Trimmed = Record<string, TrimmedEntity>;\n\n/**\n * Hide items from main collection\n * But keep them in store\n */\nexport const trimmedPlugin = <T>(store: Observable<DSourceState<T, any>>): PluginSubscribe<DSourceState<T, any>> => ({\n set(k, newVal) {\n switch (k) {\n case 'trimmed':\n const proxy = store.get('proxyItems');\n const trimmed = gatherTrimmedItems(newVal as Trimmed);\n\n const newItems = proxy.reduce((result: number[], v: number) => {\n // check if present in new trimmed remove from items (filter)\n if (!trimmed[v]) {\n result.push(v);\n }\n return result;\n }, []);\n\n store.set('items', newItems);\n break;\n }\n },\n});\n\nexport function gatherTrimmedItems(trimmedItems: Trimmed) {\n const trimmed: TrimmedEntity = {};\n\n for (let trimmedKey in trimmedItems) {\n // trimmed overweight not trimmed\n for (let t in trimmedItems[trimmedKey]) {\n trimmed[t] = trimmed[t] || trimmedItems[trimmedKey][t];\n }\n }\n return trimmed;\n}\n","\nimport { ObservableMap, Subscription } from './store.types';\n\nexport type Observable<T> = ObservableMap<T>;\nexport type PluginSubscribe<T> = Subscription<T>;\n\n/** Set stores data */\nexport function setStore<T extends { [key: string]: any }>(\n store: Observable<T>,\n data: Partial<T>,\n) {\n for (let key in data) {\n store.set(key, data[key]);\n }\n}\n\n","import findIndex from 'lodash/findIndex';\nimport range from 'lodash/range';\nimport { createStore } from '@stencil/store';\n\nimport { Trimmed, trimmedPlugin } from './trimmed.plugin';\nimport { setStore, Observable } from '../../utils/store.utils';\nimport { proxyPlugin } from './data.proxy';\nimport { GroupLabelTemplateFunc } from '../../plugins/groupingRow/grouping.row.types';\nimport { DimensionRows, DimensionCols } from '@type';\nimport type {\n ColumnProperties,\n ColumnGrouping,\n ColumnRegular,\n DataType,\n DataSourceState,\n ColumnProp,\n} from '@type';\n\nexport interface Group extends ColumnProperties {\n name: string;\n children: (ColumnGrouping | ColumnRegular)[];\n // props/ids\n ids: (string | number)[];\n}\nexport type Groups = Record<any, any>;\nexport type GDataType = DataType | ColumnRegular;\nexport type GDimension = DimensionRows | DimensionCols;\nexport type DSourceState<\n T1 extends GDataType,\n T2 extends GDimension,\n> = DataSourceState<T1, T2> & {\n groupingCustomRenderer?: GroupLabelTemplateFunc | null;\n};\n\n/**\n * Data store\n * Manage the state of a data source and provide methods for updating, adding, and refreshing the data.\n */\nexport class DataStore<T extends GDataType, ST extends GDimension> {\n private readonly dataStore: Observable<DSourceState<T, ST>>;\n get store(): Observable<DSourceState<T, ST>> {\n return this.dataStore;\n }\n constructor(type: ST, storeData?: DSourceState<T, ST>) {\n const store = (this.dataStore = createStore<DSourceState<T, ST>>({\n items: [],\n proxyItems: [],\n source: [],\n groupingDepth: 0,\n groups: {},\n type,\n trimmed: {},\n groupingCustomRenderer: undefined,\n ...storeData,\n }));\n store.use(proxyPlugin(store));\n store.use(trimmedPlugin(store));\n }\n\n /**\n * full data source update\n * @param source - data column/rgRow source\n * @param grouping - grouping information if present\n */\n updateData(\n source: T[],\n grouping?: {\n depth: number;\n groups?: Groups;\n customRenderer?: GroupLabelTemplateFunc;\n },\n silent = false,\n ) {\n // during full update we do drop trim\n if (!silent) {\n this.store.set('trimmed', {});\n }\n // clear items\n this.store.set('items', []);\n const items = range(0, source?.length || 0);\n\n // set proxy first\n setStore(this.store, {\n source,\n proxyItems: [...items],\n });\n // update data items\n this.store.set('items', items);\n // apply grouping if present\n if (grouping) {\n setStore(this.store, {\n groupingDepth: grouping.depth,\n groups: grouping.groups,\n groupingCustomRenderer: grouping.customRenderer,\n });\n }\n }\n\n addTrimmed(some: Partial<Trimmed>) {\n let trimmed = this.store.get('trimmed');\n trimmed = { ...trimmed, ...some };\n setStore(this.store, { trimmed });\n }\n\n // local data update\n setData(input: Partial<DSourceState<T, ST>>) {\n const data: Partial<DSourceState<T, ST>> = {\n ...input,\n };\n setStore(this.store, data);\n }\n\n refresh() {\n const source = this.store.get('source');\n this.store.set('source', [...source]);\n }\n}\n/**\n * get physical index by virtual\n * @param store - store to process\n */\nexport function getPhysical(\n store: Observable<DSourceState<any, any>>,\n virtualIndex: number,\n) {\n const items = store.get('items');\n return items[virtualIndex];\n}\n\n/**\n * get all visible items\n * @param store - store to process\n */\nexport function getVisibleSourceItem(\n store: Observable<DSourceState<any, any>>,\n) {\n const source = store.get('source');\n return store.get('items').map(v => source[v]);\n}\n\n/**\n * get mapped item from source\n * @param store - store to process\n * @param virtualIndex - virtual index to process\n */\nexport const getSourceItem = (\n store: Observable<DSourceState<any, any>>,\n virtualIndex: number,\n): any | undefined => {\n const items = store.get('items');\n const source = store.get('source');\n return source[items[virtualIndex]];\n};\n\n/**\n * Apple item/model/row value to data source\n * @param store - data source with changes\n * @param modelByIndex - collection of rows/values with virtual indexes to setup/replace in store/data source\n * @param mutate - if true, store will be mutated and whole viewport will be re-rendered\n */\nexport function setSourceByVirtualIndex<T>(\n store: Observable<DSourceState<T, any>>,\n modelByIndex: Record<number, T>,\n mutate = true,\n) {\n const items = store.get('items');\n const source = store.get('source');\n\n for (let virtualIndex in modelByIndex) {\n const realIndex = items[virtualIndex];\n source[realIndex] = modelByIndex[virtualIndex];\n }\n if (mutate) {\n store.set('source', [...source]);\n }\n}\n\n/**\n * set item to source\n * @param store - store to process\n * @param modelByIndex - collection of rows with physical indexes to setup\n * @param mutate - if true, store will be mutated and whole viewport will be re-rendered\n */\nexport function setSourceByPhysicalIndex<T>(\n store: Observable<DSourceState<T, any>>,\n modelByIndex: Record<number, T>,\n mutate = true,\n) {\n const source = store.get('source');\n for (let index in modelByIndex) {\n source[index] = modelByIndex[index];\n }\n if (mutate) {\n store.set('source', [...source]);\n }\n}\n\nexport function setItems<T>(\n store: Observable<DSourceState<T, any>>,\n items: number[],\n) {\n store.set('items', items);\n}\n\nexport function getSourceItemVirtualIndexByProp(\n store: Observable<DSourceState<any, any>>,\n prop: ColumnProp,\n) {\n const items = store.get('items');\n const source = store.get('source');\n const physicalIndex = findIndex(source, { prop });\n return items.indexOf(physicalIndex);\n}\n"],"version":3}
@@ -4061,7 +4061,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4061
4061
  const headerProperties = Object.assign(Object.assign({}, view.headerProp), { type: view.type, additionalData: this.additionalData, viewportCol: view.viewportCol, selectionStore: view.columnSelectionStore, canResize: this.resize, readonly: this.readonly, columnFilter: !!this.filter });
4062
4062
  // Column headers
4063
4063
  const dataViews = [
4064
- h("revogr-header", Object.assign({ key: 'f304dcc1c0ef2bc274929ef0982152905d31f761' }, headerProperties, { slot: HEADER_SLOT })),
4064
+ h("revogr-header", Object.assign({ key: 'b3c3ccd088d6a01511b07f66f7dc937617a4786d' }, headerProperties, { slot: HEADER_SLOT })),
4065
4065
  ];
4066
4066
  // Render viewport data (vertical sections)
4067
4067
  view.dataPorts.forEach(data => {
@@ -4083,11 +4083,11 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
4083
4083
  const typeCol = 'rgCol';
4084
4084
  const viewports = this.viewportProvider.stores;
4085
4085
  const dimensions = this.dimensionProvider.stores;
4086
- return (h(Host, { key: '5eff6aab67d669ea43e09e3e78b32523ecbfdbe0', [`${UUID}`]: this.uuid }, this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("div", { key: '9db44dc1504b6d03273a609f1f68e48e4dc61937', class: "main-viewport", onClick: (e) => {
4086
+ return (h(Host, { key: '6c36df93ae796fbfeee95cb5ab789a1f9b0c42f1', [`${UUID}`]: this.uuid }, this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("div", { key: 'e5cd68158497d79d98ce4f92f1e816b60acbf6ac', class: "main-viewport", onClick: (e) => {
4087
4087
  if (e.currentTarget === e.target) {
4088
4088
  this.viewport.clearEdit();
4089
4089
  }
4090
- } }, h("div", { key: 'f07fe5ec8fc46cd071429d66923267f9459888bf', class: "viewports" }, h("slot", { key: 'd030f89592e4e426194e7f2a8ebc0f3c49108bfb', name: "viewport" }), viewportSections, h("revogr-scroll-virtual", { key: '364951111ea2eaeccc816b4b119fe270e77b83bf', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), h(OrderRenderer, { key: '7ace1eff1dc24d7250cbf1fab943a864586dd9db', ref: e => (this.orderService = e) }))), h("revogr-scroll-virtual", { key: '9fd93540972906cb6b77b5fd31ddf1805e54da4b', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
4090
+ } }, h("div", { key: '9f121f8e4184f38ad0f086eeabb287434dbae101', class: "viewports" }, h("slot", { key: 'e234abc3d5a6b1ddbe1fb1da4e415e754444057d', name: "viewport" }), viewportSections, h("revogr-scroll-virtual", { key: 'c7b915c6117a822cea1fadce5111cd665f5a43d9', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), h(OrderRenderer, { key: '5e6c259216474164247f2120eb9a16786ce03e6f', ref: e => (this.orderService = e) }))), h("revogr-scroll-virtual", { key: 'ce8e46b6e7913e798b8d1bd094a4c61a54b73a0a', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
4091
4091
  }
4092
4092
  get element() { return this; }
4093
4093
  static get watchers() { return {