@revolist/revogrid 4.9.9 → 4.9.11
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.
- package/dist/cjs/column.drag.plugin-e636b5af.js +1686 -0
- package/dist/cjs/column.drag.plugin-e636b5af.js.map +1 -0
- package/dist/cjs/{column.service-bfaba0e0.js → column.service-15c8352d.js} +443 -56
- package/dist/cjs/column.service-15c8352d.js.map +1 -0
- package/dist/cjs/{toNumber-838e6ff5.js → debounce-cb5f4e35.js} +229 -12
- package/dist/cjs/debounce-cb5f4e35.js.map +1 -0
- package/dist/cjs/{edit.utils-983f1a82.js → edit.utils-1172677c.js} +2 -2
- package/dist/cjs/{edit.utils-983f1a82.js.map → edit.utils-1172677c.js.map} +1 -1
- package/dist/cjs/{header-cell-renderer-53e4fd75.js → header-cell-renderer-375a879f.js} +42 -4
- package/dist/cjs/header-cell-renderer-375a879f.js.map +1 -0
- package/dist/cjs/{index-464d1aaf.js → index-28b6fdfb.js} +31 -31
- package/dist/cjs/{index-464d1aaf.js.map → index-28b6fdfb.js.map} +1 -1
- package/dist/cjs/index.cjs.js +39 -28
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{key.utils-12715159.js → key.utils-c62ab1e1.js} +2 -12
- package/dist/cjs/key.utils-c62ab1e1.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.entry.js +704 -2034
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-attribution_6.cjs.entry.js +17 -18
- package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +6 -77
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +117 -123
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +1 -2
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/{row-header-utils-e71dc7bf.js → row-header-utils-22ffee54.js} +2 -2
- package/dist/cjs/{row-header-utils-e71dc7bf.js.map → row-header-utils-22ffee54.js.map} +1 -1
- package/dist/cjs/sorting.sign-8bf92449.js +19 -0
- package/dist/cjs/sorting.sign-8bf92449.js.map +1 -0
- package/dist/cjs/text-editor-91a9f5b5.js +82 -0
- package/dist/cjs/text-editor-91a9f5b5.js.map +1 -0
- package/dist/cjs/{throttle-c893457e.js → throttle-5da5df51.js} +4 -5
- package/dist/cjs/throttle-5da5df51.js.map +1 -0
- package/dist/cjs/viewport.helpers-e59a544e.js +58 -0
- package/dist/cjs/viewport.helpers-e59a544e.js.map +1 -0
- package/dist/collection/components/editors/text-editor.js.map +1 -1
- package/dist/collection/components/header/revogr-header.js +1 -1
- package/dist/collection/components/overlay/keyboard.service.js +2 -2
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid-style.css +6 -0
- package/dist/collection/index.js +2 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/plugins/index.js +16 -0
- package/dist/collection/plugins/index.js.map +1 -0
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -1
- package/dist/collection/types/selection.js.map +1 -1
- package/dist/collection/utils/key.utils.js +0 -9
- package/dist/collection/utils/key.utils.js.map +1 -1
- package/dist/esm/column.drag.plugin-30dc4e24.js +1665 -0
- package/dist/esm/column.drag.plugin-30dc4e24.js.map +1 -0
- package/dist/esm/{column.service-6f1faf2d.js → column.service-414e9cba.js} +435 -51
- package/dist/esm/column.service-414e9cba.js.map +1 -0
- package/dist/esm/{toNumber-8de324a7.js → debounce-e8e9464a.js} +229 -13
- package/dist/esm/debounce-e8e9464a.js.map +1 -0
- package/dist/esm/{edit.utils-c3f5c9f4.js → edit.utils-0666e5bd.js} +2 -2
- package/dist/esm/{edit.utils-c3f5c9f4.js.map → edit.utils-0666e5bd.js.map} +1 -1
- package/dist/esm/{header-cell-renderer-66d01daa.js → header-cell-renderer-ca570fcf.js} +40 -4
- package/dist/esm/header-cell-renderer-ca570fcf.js.map +1 -0
- package/dist/esm/{index-c428acf6.js → index-74b9801b.js} +3 -3
- package/dist/esm/{index-c428acf6.js.map → index-74b9801b.js.map} +1 -1
- package/dist/esm/index.js +10 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{key.utils-b1f93f7e.js → key.utils-d3df5db8.js} +3 -12
- package/dist/esm/key.utils-d3df5db8.js.map +1 -0
- package/dist/esm/revo-grid.entry.js +675 -2005
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revogr-attribution_6.entry.js +9 -10
- package/dist/esm/revogr-attribution_6.entry.js.map +1 -1
- package/dist/esm/revogr-clipboard_3.entry.js +5 -76
- package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/esm/revogr-data_4.entry.js +50 -56
- package/dist/esm/revogr-data_4.entry.js.map +1 -1
- package/dist/esm/revogr-filter-panel.entry.js +1 -2
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/{row-header-utils-3a6f6adc.js → row-header-utils-c7e3e2d5.js} +2 -2
- package/dist/esm/{row-header-utils-3a6f6adc.js.map → row-header-utils-c7e3e2d5.js.map} +1 -1
- package/dist/esm/sorting.sign-1afddea1.js +15 -0
- package/dist/esm/sorting.sign-1afddea1.js.map +1 -0
- package/dist/esm/text-editor-96d69516.js +80 -0
- package/dist/esm/text-editor-96d69516.js.map +1 -0
- package/dist/esm/{throttle-f9cda5b0.js → throttle-262c3ed2.js} +3 -4
- package/dist/esm/throttle-262c3ed2.js.map +1 -0
- package/dist/esm/viewport.helpers-7e7f9dad.js +52 -0
- package/dist/esm/viewport.helpers-7e7f9dad.js.map +1 -0
- package/dist/revo-grid/column.drag.plugin-30dc4e24.js +5 -0
- package/dist/revo-grid/column.drag.plugin-30dc4e24.js.map +1 -0
- package/dist/revo-grid/column.service-414e9cba.js +5 -0
- package/dist/revo-grid/column.service-414e9cba.js.map +1 -0
- package/dist/revo-grid/debounce-e8e9464a.js +5 -0
- package/dist/revo-grid/debounce-e8e9464a.js.map +1 -0
- package/dist/revo-grid/{edit.utils-c3f5c9f4.js → edit.utils-0666e5bd.js} +2 -2
- package/dist/revo-grid/header-cell-renderer-ca570fcf.js +5 -0
- package/dist/revo-grid/header-cell-renderer-ca570fcf.js.map +1 -0
- package/dist/revo-grid/{index-c428acf6.js → index-74b9801b.js} +2 -2
- package/dist/revo-grid/index.esm.js +1 -1
- package/dist/revo-grid/key.utils-d3df5db8.js +5 -0
- package/dist/revo-grid/key.utils-d3df5db8.js.map +1 -0
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js.map +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
- package/dist/revo-grid/{row-header-utils-3a6f6adc.js → row-header-utils-c7e3e2d5.js} +2 -2
- package/dist/revo-grid/sorting.sign-1afddea1.js +5 -0
- package/dist/revo-grid/sorting.sign-1afddea1.js.map +1 -0
- package/dist/revo-grid/text-editor-96d69516.js +5 -0
- package/dist/revo-grid/text-editor-96d69516.js.map +1 -0
- package/dist/revo-grid/throttle-262c3ed2.js +5 -0
- package/dist/revo-grid/{throttle-f9cda5b0.js.map → throttle-262c3ed2.js.map} +1 -1
- package/dist/revo-grid/viewport.helpers-7e7f9dad.js +5 -0
- package/dist/revo-grid/viewport.helpers-7e7f9dad.js.map +1 -0
- package/dist/types/components/editors/text-editor.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/plugins/index.d.ts +12 -0
- package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +1 -13
- package/dist/types/types/selection.d.ts +1 -1
- package/dist/types/utils/key.utils.d.ts +0 -1
- package/hydrate/index.js +2 -11
- package/hydrate/index.mjs +2 -11
- package/package.json +1 -1
- package/standalone/_stringToPath.js +1 -1
- package/standalone/column.service.js +1 -1
- package/standalone/data.store.js +2 -2
- package/standalone/debounce.js +1 -1
- package/standalone/dimension.helpers.js +1 -1
- package/standalone/index.js +7 -5
- package/standalone/index.js.map +1 -1
- package/standalone/isObjectLike.js +1 -1
- package/standalone/revo-grid.js +1948 -1948
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-edit.js +1 -1
- package/standalone/revogr-edit2.js +1 -10
- package/standalone/revogr-edit2.js.map +1 -1
- package/standalone/revogr-header.js +1 -1
- package/standalone/revogr-header2.js +54 -52
- package/standalone/revogr-header2.js.map +1 -1
- package/standalone/revogr-overlay-selection2.js +2 -2
- package/standalone/revogr-overlay-selection2.js.map +1 -1
- package/standalone/revogr-row-headers2.js +1 -1
- package/standalone/throttle.js +1 -1
- package/standalone/toNumber.js +1 -1
- package/dist/cjs/column.service-bfaba0e0.js.map +0 -1
- package/dist/cjs/column.utils-4a450d27.js +0 -345
- package/dist/cjs/column.utils-4a450d27.js.map +0 -1
- package/dist/cjs/debounce-e2b7c6fb.js +0 -226
- package/dist/cjs/debounce-e2b7c6fb.js.map +0 -1
- package/dist/cjs/dispatcher-998aa470.js +0 -46
- package/dist/cjs/dispatcher-998aa470.js.map +0 -1
- package/dist/cjs/header-cell-renderer-53e4fd75.js.map +0 -1
- package/dist/cjs/key.utils-12715159.js.map +0 -1
- package/dist/cjs/selection.helpers-2c90d546.js +0 -450
- package/dist/cjs/selection.helpers-2c90d546.js.map +0 -1
- package/dist/cjs/throttle-c893457e.js.map +0 -1
- package/dist/cjs/toNumber-838e6ff5.js.map +0 -1
- package/dist/esm/column.service-6f1faf2d.js.map +0 -1
- package/dist/esm/column.utils-1a402ff9.js +0 -333
- package/dist/esm/column.utils-1a402ff9.js.map +0 -1
- package/dist/esm/debounce-7781346d.js +0 -224
- package/dist/esm/debounce-7781346d.js.map +0 -1
- package/dist/esm/dispatcher-ea08404f.js +0 -43
- package/dist/esm/dispatcher-ea08404f.js.map +0 -1
- package/dist/esm/header-cell-renderer-66d01daa.js.map +0 -1
- package/dist/esm/key.utils-b1f93f7e.js.map +0 -1
- package/dist/esm/selection.helpers-ac4368b0.js +0 -441
- package/dist/esm/selection.helpers-ac4368b0.js.map +0 -1
- package/dist/esm/throttle-f9cda5b0.js.map +0 -1
- package/dist/esm/toNumber-8de324a7.js.map +0 -1
- package/dist/revo-grid/column.service-6f1faf2d.js +0 -5
- package/dist/revo-grid/column.service-6f1faf2d.js.map +0 -1
- package/dist/revo-grid/column.utils-1a402ff9.js +0 -5
- package/dist/revo-grid/column.utils-1a402ff9.js.map +0 -1
- package/dist/revo-grid/debounce-7781346d.js +0 -5
- package/dist/revo-grid/debounce-7781346d.js.map +0 -1
- package/dist/revo-grid/dispatcher-ea08404f.js +0 -5
- package/dist/revo-grid/dispatcher-ea08404f.js.map +0 -1
- package/dist/revo-grid/header-cell-renderer-66d01daa.js +0 -5
- package/dist/revo-grid/header-cell-renderer-66d01daa.js.map +0 -1
- package/dist/revo-grid/key.utils-b1f93f7e.js +0 -5
- package/dist/revo-grid/key.utils-b1f93f7e.js.map +0 -1
- package/dist/revo-grid/selection.helpers-ac4368b0.js +0 -5
- package/dist/revo-grid/selection.helpers-ac4368b0.js.map +0 -1
- package/dist/revo-grid/throttle-f9cda5b0.js +0 -5
- package/dist/revo-grid/toNumber-8de324a7.js +0 -5
- package/dist/revo-grid/toNumber-8de324a7.js.map +0 -1
- /package/dist/revo-grid/{edit.utils-c3f5c9f4.js.map → edit.utils-0666e5bd.js.map} +0 -0
- /package/dist/revo-grid/{index-c428acf6.js.map → index-74b9801b.js.map} +0 -0
- /package/dist/revo-grid/{row-header-utils-3a6f6adc.js.map → row-header-utils-c7e3e2d5.js.map} +0 -0
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-a61f225b.js';
|
|
5
|
-
import {
|
|
6
|
-
import { c as columnTypes,
|
|
7
|
-
import { _ as _baseGetTag, c as isObjectLike_1 } from './
|
|
8
|
-
import { E as EMPTY_INDEX,
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { F as FILTER_PROP, i as isFilterBtn } from './filter.button-37373672.js';
|
|
12
|
-
import { i as isGrouping, g as getGroupingName, G as GROUP_EXPANDED, a as getParsedGroup, b as isSameGroup, c as GROUP_DEPTH, P as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, e as GROUPING_ROW_TYPE, f as PSEUDO_GROUP_COLUMN, h as GROUP_EXPAND_EVENT, j as gatherGrouping, k as isGroupingColumn, v as viewportDataPartition, H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT, D as DATA_SLOT } from './column.service-6f1faf2d.js';
|
|
13
|
-
import { d as dispatch } from './dispatcher-ea08404f.js';
|
|
14
|
-
import { O as ON_COLUMN_CLICK } from './header-cell-renderer-66d01daa.js';
|
|
5
|
+
import { g as getPhysical, d as setItems, X as isArray_1, a1 as _baseProperty, a2 as _baseKeys, a3 as _getTag, a4 as isArrayLike_1, a5 as range_1, v as setStore, a6 as _baseIteratee, a7 as keys_1, a8 as findIndex_1, D as DataStore, b as getSourceItem, W as reduce_1, e as getSourceItemVirtualIndexByProp, s as setSourceByVirtualIndex, Y as each, a as getVisibleSourceItem, f as gatherTrimmedItems, j as getItemByIndex, R as RESIZE_INTERVAL, q as timeout } from './index-74b9801b.js';
|
|
6
|
+
import { B as BasePlugin, c as columnTypes, F as FILTER_TRIMMED_TYPE, l as getColumnByProp, e as getColumnType, r as rowTypes, i as isRowType, D as DimensionStore, f as getColumnSizes, j as getColumns, a as isStretchPlugin, S as StretchColumn, A as AutoSizeColumnPlugin, d as FilterPlugin, E as ExportFilePlugin, C as ColumnPlugin } from './column.drag.plugin-30dc4e24.js';
|
|
7
|
+
import { _ as _baseGetTag, c as isObjectLike_1, d as debounce_1 } from './debounce-e8e9464a.js';
|
|
8
|
+
import { b as isGrouping, G as GROUP_EXPANDED, f as getParsedGroup, h as isSameGroup, j as GROUP_DEPTH, P as PSEUDO_GROUP_ITEM_VALUE, k as PSEUDO_GROUP_ITEM_ID, l as GROUPING_ROW_TYPE, m as PSEUDO_GROUP_COLUMN, o as GROUP_EXPAND_EVENT, p as gatherGrouping, q as isGroupingColumn, E as EMPTY_INDEX, r as SelectionStoreConnector } from './column.service-414e9cba.js';
|
|
9
|
+
import { V as ViewportStore } from './row-header-utils-c7e3e2d5.js';
|
|
10
|
+
import { v as viewportDataPartition, H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT, D as DATA_SLOT } from './viewport.helpers-7e7f9dad.js';
|
|
15
11
|
import { g as getPropertyFromEvent } from './events-cf0893a3.js';
|
|
12
|
+
import './filter.button-37373672.js';
|
|
13
|
+
import './header-cell-renderer-ca570fcf.js';
|
|
16
14
|
|
|
17
15
|
class ThemeCompact {
|
|
18
16
|
constructor() {
|
|
@@ -79,1081 +77,371 @@ class ThemeService {
|
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return function(collection, predicate, fromIndex) {
|
|
95
|
-
var iterable = Object(collection);
|
|
96
|
-
if (!isArrayLike$1(collection)) {
|
|
97
|
-
var iteratee = baseIteratee(predicate);
|
|
98
|
-
collection = keys(collection);
|
|
99
|
-
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
|
|
100
|
-
}
|
|
101
|
-
var index = findIndexFunc(collection, predicate, fromIndex);
|
|
102
|
-
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
var _createFind = createFind$1;
|
|
107
|
-
|
|
108
|
-
var createFind = _createFind,
|
|
109
|
-
findIndex = findIndex_1;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Iterates over elements of `collection`, returning the first element
|
|
113
|
-
* `predicate` returns truthy for. The predicate is invoked with three
|
|
114
|
-
* arguments: (value, index|key, collection).
|
|
115
|
-
*
|
|
116
|
-
* @static
|
|
117
|
-
* @memberOf _
|
|
118
|
-
* @since 0.1.0
|
|
119
|
-
* @category Collection
|
|
120
|
-
* @param {Array|Object} collection The collection to inspect.
|
|
121
|
-
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
|
122
|
-
* @param {number} [fromIndex=0] The index to search from.
|
|
123
|
-
* @returns {*} Returns the matched element, else `undefined`.
|
|
124
|
-
* @example
|
|
125
|
-
*
|
|
126
|
-
* var users = [
|
|
127
|
-
* { 'user': 'barney', 'age': 36, 'active': true },
|
|
128
|
-
* { 'user': 'fred', 'age': 40, 'active': false },
|
|
129
|
-
* { 'user': 'pebbles', 'age': 1, 'active': true }
|
|
130
|
-
* ];
|
|
131
|
-
*
|
|
132
|
-
* _.find(users, function(o) { return o.age < 40; });
|
|
133
|
-
* // => object for 'barney'
|
|
134
|
-
*
|
|
135
|
-
* // The `_.matches` iteratee shorthand.
|
|
136
|
-
* _.find(users, { 'age': 1, 'active': true });
|
|
137
|
-
* // => object for 'pebbles'
|
|
138
|
-
*
|
|
139
|
-
* // The `_.matchesProperty` iteratee shorthand.
|
|
140
|
-
* _.find(users, ['active', false]);
|
|
141
|
-
* // => object for 'fred'
|
|
142
|
-
*
|
|
143
|
-
* // The `_.property` iteratee shorthand.
|
|
144
|
-
* _.find(users, 'active');
|
|
145
|
-
* // => object for 'barney'
|
|
146
|
-
*/
|
|
147
|
-
var find = createFind(findIndex);
|
|
148
|
-
|
|
149
|
-
var find_1 = find;
|
|
150
|
-
|
|
151
|
-
class ColumnDataProvider {
|
|
152
|
-
get order() {
|
|
153
|
-
const order = {};
|
|
154
|
-
const sorting = this.sorting;
|
|
155
|
-
if (sorting) {
|
|
156
|
-
Object.keys(sorting).forEach((prop) => {
|
|
157
|
-
order[prop] = sorting[prop].order;
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
return order;
|
|
161
|
-
}
|
|
162
|
-
get stores() {
|
|
163
|
-
return this.dataSources;
|
|
164
|
-
}
|
|
165
|
-
constructor() {
|
|
166
|
-
this.sorting = null;
|
|
167
|
-
this.dataSources = columnTypes.reduce((sources, k) => {
|
|
168
|
-
sources[k] = new DataStore(k);
|
|
169
|
-
return sources;
|
|
170
|
-
}, {});
|
|
171
|
-
}
|
|
172
|
-
column(c, pin) {
|
|
173
|
-
return this.getColumn(c, pin || 'rgCol');
|
|
174
|
-
}
|
|
175
|
-
getColumn(virtualIndex, type) {
|
|
176
|
-
return getSourceItem(this.dataSources[type].store, virtualIndex);
|
|
177
|
-
}
|
|
178
|
-
getRawColumns() {
|
|
179
|
-
return reduce_1(this.dataSources, (result, item, type) => {
|
|
180
|
-
result[type] = item.store.get('source');
|
|
181
|
-
return result;
|
|
182
|
-
}, {
|
|
183
|
-
rgCol: [],
|
|
184
|
-
colPinStart: [],
|
|
185
|
-
colPinEnd: [],
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
getColumns(type = 'all') {
|
|
189
|
-
if (type !== 'all') {
|
|
190
|
-
return this.dataSources[type].store.get('source');
|
|
191
|
-
}
|
|
192
|
-
return columnTypes.reduce((r, t) => {
|
|
193
|
-
r.push(...this.dataSources[t].store.get('source'));
|
|
194
|
-
return r;
|
|
195
|
-
}, []);
|
|
196
|
-
}
|
|
197
|
-
getColumnIndexByProp(prop, type) {
|
|
198
|
-
return getSourceItemVirtualIndexByProp(this.dataSources[type].store, prop);
|
|
199
|
-
}
|
|
200
|
-
getColumnByProp(prop, type) {
|
|
201
|
-
const items = this.dataSources[type].store.get('source');
|
|
202
|
-
return find_1(items, { prop });
|
|
203
|
-
}
|
|
204
|
-
refreshByType(type) {
|
|
205
|
-
this.dataSources[type].refresh();
|
|
206
|
-
}
|
|
207
|
-
setColumns(data) {
|
|
208
|
-
columnTypes.forEach(k => {
|
|
209
|
-
// set columns data
|
|
210
|
-
this.dataSources[k].updateData(data.columns[k], {
|
|
211
|
-
// max depth level
|
|
212
|
-
depth: data.maxLevel,
|
|
213
|
-
// groups
|
|
214
|
-
groups: data.columnGrouping[k].reduce((res, g) => {
|
|
215
|
-
if (!res[g.level]) {
|
|
216
|
-
res[g.level] = [];
|
|
217
|
-
}
|
|
218
|
-
res[g.level].push(g);
|
|
219
|
-
return res;
|
|
220
|
-
}, {}),
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
this.sorting = data.sort;
|
|
224
|
-
return data;
|
|
225
|
-
}
|
|
226
|
-
updateColumns(cols) {
|
|
227
|
-
// collect column by type and propert
|
|
228
|
-
const columnByKey = cols.reduce((res, c) => {
|
|
229
|
-
const type = getColumnType(c);
|
|
230
|
-
if (!res[type]) {
|
|
231
|
-
res[type] = {};
|
|
232
|
-
}
|
|
233
|
-
res[type][c.prop] = c;
|
|
234
|
-
return res;
|
|
235
|
-
}, {});
|
|
236
|
-
// find indexes in source
|
|
237
|
-
const colByIndex = {};
|
|
238
|
-
for (const t in columnByKey) {
|
|
239
|
-
if (!columnByKey.hasOwnProperty(t)) {
|
|
240
|
-
continue;
|
|
241
|
-
}
|
|
242
|
-
const type = t;
|
|
243
|
-
const colsToUpdate = columnByKey[type];
|
|
244
|
-
const items = this.dataSources[type].store.get('source');
|
|
245
|
-
colByIndex[type] = {};
|
|
246
|
-
for (let i = 0; i < items.length; i++) {
|
|
247
|
-
const rgCol = items[i];
|
|
248
|
-
const colToUpdateIfExists = colsToUpdate === null || colsToUpdate === void 0 ? void 0 : colsToUpdate[rgCol.prop];
|
|
249
|
-
if (colToUpdateIfExists) {
|
|
250
|
-
colByIndex[type][i] = colToUpdateIfExists;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
for (const t in colByIndex) {
|
|
255
|
-
if (!colByIndex.hasOwnProperty(t)) {
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
const type = t;
|
|
259
|
-
setSourceByVirtualIndex(this.dataSources[type].store, colByIndex[type] || {});
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
updateColumn(column, index) {
|
|
263
|
-
const type = getColumnType(column);
|
|
264
|
-
setSourceByVirtualIndex(this.dataSources[type].store, { [index]: column });
|
|
265
|
-
}
|
|
266
|
-
updateColumnSorting(column, index, sorting, additive) {
|
|
267
|
-
if (!additive) {
|
|
268
|
-
this.clearSorting();
|
|
269
|
-
}
|
|
270
|
-
column.order = sorting;
|
|
271
|
-
if (!this.sorting) {
|
|
272
|
-
this.sorting = {};
|
|
273
|
-
}
|
|
274
|
-
this.sorting[column.prop] = column;
|
|
275
|
-
this.updateColumn(column, index);
|
|
276
|
-
return column;
|
|
277
|
-
}
|
|
278
|
-
clearSorting() {
|
|
279
|
-
const types = reduce_1(this.sorting, (r, c) => {
|
|
280
|
-
const k = getColumnType(c);
|
|
281
|
-
r[k] = true;
|
|
282
|
-
return r;
|
|
283
|
-
}, {});
|
|
284
|
-
each(types, (_, type) => {
|
|
285
|
-
const cols = this.dataSources[type].store.get('source');
|
|
286
|
-
each(cols, (c) => (c.order = undefined));
|
|
287
|
-
this.dataSources[type].setData({ source: [...cols] });
|
|
288
|
-
});
|
|
289
|
-
this.sorting = {};
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Data source provider
|
|
295
|
-
*/
|
|
296
|
-
class DataProvider {
|
|
297
|
-
constructor(dimensionProvider) {
|
|
298
|
-
this.dimensionProvider = dimensionProvider;
|
|
299
|
-
this.stores = reduce_1(rowTypes, (sources, k) => {
|
|
300
|
-
sources[k] = new DataStore(k);
|
|
301
|
-
return sources;
|
|
302
|
-
}, {});
|
|
303
|
-
}
|
|
304
|
-
setData(data, type = 'rgRow', disableVirtualRows = false, grouping, silent = false) {
|
|
305
|
-
// set rgRow data
|
|
306
|
-
this.stores[type].updateData([...data], grouping, silent);
|
|
307
|
-
// for pinned row no need virtual data
|
|
308
|
-
const noVirtual = type !== 'rgRow' || disableVirtualRows;
|
|
309
|
-
this.dimensionProvider.setData(data.length, type, noVirtual);
|
|
310
|
-
return data;
|
|
311
|
-
}
|
|
312
|
-
getModel(virtualIndex, type = 'rgRow') {
|
|
313
|
-
const store = this.stores[type].store;
|
|
314
|
-
return getSourceItem(store, virtualIndex);
|
|
315
|
-
}
|
|
316
|
-
setCellData({ type, rowIndex, prop, val }, mutate = true) {
|
|
317
|
-
const model = this.getModel(rowIndex, type);
|
|
318
|
-
model[prop] = val;
|
|
319
|
-
// apply data to source
|
|
320
|
-
setSourceByVirtualIndex(this.stores[type].store, { [rowIndex]: model }, mutate);
|
|
321
|
-
}
|
|
322
|
-
setRangeData(data, type) {
|
|
323
|
-
const items = {};
|
|
324
|
-
for (let rowIndex in data) {
|
|
325
|
-
const oldModel = (items[rowIndex] = getSourceItem(this.stores[type].store, parseInt(rowIndex, 10)));
|
|
326
|
-
if (!oldModel) {
|
|
327
|
-
continue;
|
|
328
|
-
}
|
|
329
|
-
for (let prop in data[rowIndex]) {
|
|
330
|
-
oldModel[prop] = data[rowIndex][prop];
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
// apply data to source
|
|
334
|
-
setSourceByVirtualIndex(this.stores[type].store, items);
|
|
335
|
-
}
|
|
336
|
-
refresh(type = 'all') {
|
|
337
|
-
if (isRowType(type)) {
|
|
338
|
-
this.refreshItems(type);
|
|
339
|
-
}
|
|
340
|
-
rowTypes.forEach((t) => this.refreshItems(t));
|
|
341
|
-
}
|
|
342
|
-
refreshItems(type = 'rgRow') {
|
|
343
|
-
const items = this.stores[type].store.get('items');
|
|
344
|
-
this.stores[type].setData({ items: [...items] });
|
|
345
|
-
}
|
|
346
|
-
setGrouping({ depth }, type = 'rgRow') {
|
|
347
|
-
this.stores[type].setData({ groupingDepth: depth });
|
|
348
|
-
}
|
|
349
|
-
setTrimmed(trimmed, type = 'rgRow') {
|
|
350
|
-
const store = this.stores[type];
|
|
351
|
-
store.addTrimmed(trimmed);
|
|
352
|
-
this.dimensionProvider.setTrimmed(trimmed, type);
|
|
353
|
-
if (type === 'rgRow') {
|
|
354
|
-
this.dimensionProvider.setData(getVisibleSourceItem(store.store).length, type);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Dimension provider
|
|
361
|
-
* Stores dimension information and custom sizes
|
|
362
|
-
*/
|
|
363
|
-
class DimensionProvider {
|
|
364
|
-
constructor(viewports, config) {
|
|
365
|
-
this.viewports = viewports;
|
|
366
|
-
const sizeChanged = debounce_1((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
|
|
367
|
-
this.stores = reduce_1([...rowTypes, ...columnTypes], (sources, k) => {
|
|
368
|
-
sources[k] = new DimensionStore();
|
|
369
|
-
sources[k].store.onChange('realSize', () => sizeChanged(k));
|
|
370
|
-
return sources;
|
|
371
|
-
}, {});
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Clear old sizes from dimension and viewports
|
|
375
|
-
* @param type - dimension type
|
|
376
|
-
* @param count - count of items
|
|
377
|
-
*/
|
|
378
|
-
clearSize(t, count) {
|
|
379
|
-
this.stores[t].drop();
|
|
380
|
-
// after we done with drop trigger viewport recalculaction
|
|
381
|
-
this.viewports.stores[t].setOriginalSizes(this.stores[t].store.get('originItemSize'));
|
|
382
|
-
this.setItemCount(count, t);
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Apply new custom sizes to dimension and view port
|
|
386
|
-
* @param type - dimension type
|
|
387
|
-
* @param sizes - new custom sizes
|
|
388
|
-
* @param keepOld - keep old sizes merge new with old
|
|
389
|
-
*/
|
|
390
|
-
setCustomSizes(type, sizes, keepOld = false) {
|
|
391
|
-
let newSizes = sizes;
|
|
392
|
-
if (keepOld) {
|
|
393
|
-
const oldSizes = this.stores[type].store.get('sizes');
|
|
394
|
-
newSizes = Object.assign(Object.assign({}, oldSizes), sizes);
|
|
395
|
-
}
|
|
396
|
-
this.stores[type].setDimensionSize(newSizes);
|
|
397
|
-
this.updateViewport(type, true);
|
|
398
|
-
}
|
|
399
|
-
setItemCount(realCount, type) {
|
|
400
|
-
this.viewports.stores[type].setViewport({ realCount });
|
|
401
|
-
this.stores[type].setStore({ count: realCount });
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Apply trimmed items
|
|
405
|
-
* @param trimmed - trimmed items
|
|
406
|
-
* @param type
|
|
407
|
-
*/
|
|
408
|
-
setTrimmed(trimmed, type) {
|
|
409
|
-
const allTrimmed = gatherTrimmedItems(trimmed);
|
|
410
|
-
const dimStoreType = this.stores[type];
|
|
411
|
-
dimStoreType.setStore({ trimmed: allTrimmed });
|
|
412
|
-
this.updateViewport(type, true);
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Sets dimension data and view port coordinate
|
|
416
|
-
* @param itemCount
|
|
417
|
-
* @param type - dimension type
|
|
418
|
-
* @param noVirtual - disable virtual data
|
|
419
|
-
*/
|
|
420
|
-
setData(itemCount, type, noVirtual = false) {
|
|
421
|
-
this.setItemCount(itemCount, type);
|
|
422
|
-
// Virtualization will get disabled
|
|
423
|
-
if (noVirtual) {
|
|
424
|
-
const dimension = this.stores[type].getCurrentState();
|
|
425
|
-
this.viewports.stores[type].setViewport({
|
|
426
|
-
virtualSize: dimension.realSize,
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
this.updateViewport(type);
|
|
430
|
-
}
|
|
431
|
-
applyNewColumns(columns, disableVirtualX) {
|
|
432
|
-
for (let type of columnTypes) {
|
|
433
|
-
// clear existing data
|
|
434
|
-
this.stores[type].drop();
|
|
435
|
-
const items = columns[type];
|
|
436
|
-
// for pinned col no need virtual data
|
|
437
|
-
const noVirtual = type !== 'rgCol' || disableVirtualX;
|
|
438
|
-
// setItemCount
|
|
439
|
-
this.stores[type].setStore({ count: items.length });
|
|
440
|
-
// setCustomSizes
|
|
441
|
-
const newSizes = getColumnSizes(items);
|
|
442
|
-
this.stores[type].setDimensionSize(newSizes);
|
|
443
|
-
const vpUpdate = {
|
|
444
|
-
// this triggers drop on realCount change
|
|
445
|
-
realCount: items.length,
|
|
446
|
-
};
|
|
447
|
-
// Virtualization will get disabled
|
|
448
|
-
if (noVirtual) {
|
|
449
|
-
vpUpdate.virtualSize = this.stores[type].getCurrentState().realSize;
|
|
450
|
-
}
|
|
451
|
-
this.viewports.stores[type].setViewport(vpUpdate);
|
|
452
|
-
this.setViewPortCoordinate({
|
|
453
|
-
coordinate: this.viewports.stores[type].lastCoordinate,
|
|
454
|
-
type,
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
getFullSize() {
|
|
459
|
-
var _a, _b;
|
|
460
|
-
let x = 0;
|
|
461
|
-
let y = 0;
|
|
462
|
-
for (let type of columnTypes) {
|
|
463
|
-
x += ((_a = this.stores[type]) === null || _a === void 0 ? void 0 : _a.store.get('realSize')) || 0;
|
|
464
|
-
}
|
|
465
|
-
for (let type of rowTypes) {
|
|
466
|
-
y += ((_b = this.stores[type]) === null || _b === void 0 ? void 0 : _b.store.get('realSize')) || 0;
|
|
467
|
-
}
|
|
468
|
-
return { y, x };
|
|
469
|
-
}
|
|
470
|
-
updateViewport(type, force = false) {
|
|
471
|
-
this.setViewPortCoordinate({
|
|
472
|
-
coordinate: this.viewports.stores[type].lastCoordinate,
|
|
473
|
-
type,
|
|
474
|
-
force,
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
setViewPortCoordinate({ coordinate, type, force = false, }) {
|
|
478
|
-
const dimension = this.stores[type].getCurrentState();
|
|
479
|
-
this.viewports.stores[type].setViewPortCoordinate(coordinate, dimension, force);
|
|
480
|
-
}
|
|
481
|
-
getViewPortPos(e) {
|
|
482
|
-
const dimension = this.stores[e.dimension].getCurrentState();
|
|
483
|
-
const item = getItemByIndex(dimension, e.coordinate);
|
|
484
|
-
return item.start;
|
|
485
|
-
}
|
|
486
|
-
setSettings(data, dimensionType) {
|
|
487
|
-
let stores = [];
|
|
488
|
-
switch (dimensionType) {
|
|
489
|
-
case 'rgCol':
|
|
490
|
-
stores = columnTypes;
|
|
491
|
-
break;
|
|
492
|
-
case 'rgRow':
|
|
493
|
-
stores = rowTypes;
|
|
80
|
+
// provide collapse data
|
|
81
|
+
function doCollapse(pIndex, source) {
|
|
82
|
+
const model = source[pIndex];
|
|
83
|
+
const collapseValue = model[PSEUDO_GROUP_ITEM_VALUE];
|
|
84
|
+
const trimmed = {};
|
|
85
|
+
let i = pIndex + 1;
|
|
86
|
+
const total = source.length;
|
|
87
|
+
while (i < total) {
|
|
88
|
+
const currentModel = source[i];
|
|
89
|
+
if (isGrouping(currentModel)) {
|
|
90
|
+
const currentValue = currentModel[PSEUDO_GROUP_ITEM_VALUE];
|
|
91
|
+
if (!currentValue.length || !currentValue.startsWith(collapseValue + ',')) {
|
|
494
92
|
break;
|
|
93
|
+
}
|
|
94
|
+
currentModel[GROUP_EXPANDED] = false;
|
|
495
95
|
}
|
|
496
|
-
|
|
497
|
-
this.stores[s].setStore(data);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
class ViewportProvider {
|
|
503
|
-
constructor() {
|
|
504
|
-
this.stores = reduce_1([...rowTypes, ...columnTypes], (sources, k) => {
|
|
505
|
-
sources[k] = new ViewportStore(k);
|
|
506
|
-
return sources;
|
|
507
|
-
}, {});
|
|
508
|
-
}
|
|
509
|
-
setViewport(type, data) {
|
|
510
|
-
this.stores[type].setViewport(data);
|
|
96
|
+
trimmed[i++] = true;
|
|
511
97
|
}
|
|
98
|
+
model[GROUP_EXPANDED] = false;
|
|
99
|
+
return { trimmed };
|
|
512
100
|
}
|
|
513
|
-
|
|
514
101
|
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
102
|
+
*
|
|
103
|
+
* @param pIndex - physical index
|
|
104
|
+
* @param vIndex - virtual index, need to update item collection
|
|
105
|
+
* @param source - data source
|
|
106
|
+
* @param rowItemsIndexes - rgRow indexes
|
|
517
107
|
*/
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
//
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
ColumnAutoSizeMode["autoSizeAll"] = "autoSizeAll";
|
|
527
|
-
})(ColumnAutoSizeMode || (ColumnAutoSizeMode = {}));
|
|
528
|
-
class AutoSizeColumnPlugin extends BasePlugin {
|
|
529
|
-
constructor(revogrid, providers, config) {
|
|
530
|
-
super(revogrid, providers);
|
|
531
|
-
this.providers = providers;
|
|
532
|
-
this.config = config;
|
|
533
|
-
this.autoSizeColumns = null;
|
|
534
|
-
/** for edge case when no columns defined before data */
|
|
535
|
-
this.dataResolve = null;
|
|
536
|
-
this.dataReject = null;
|
|
537
|
-
this.letterBlockSize = (config === null || config === void 0 ? void 0 : config.letterBlockSize) || LETTER_BLOCK_SIZE;
|
|
538
|
-
// create test container to check text width
|
|
539
|
-
if (config === null || config === void 0 ? void 0 : config.preciseSize) {
|
|
540
|
-
this.precsizeCalculationArea = this.initiatePresizeElement();
|
|
541
|
-
revogrid.appendChild(this.precsizeCalculationArea);
|
|
542
|
-
}
|
|
543
|
-
const aftersourceset = ({ detail: { source }, }) => {
|
|
544
|
-
this.setSource(source);
|
|
545
|
-
};
|
|
546
|
-
const afteredit = ({ detail }) => {
|
|
547
|
-
this.afteredit(detail);
|
|
548
|
-
};
|
|
549
|
-
const afterEditAll = ({ detail }) => {
|
|
550
|
-
this.afterEditAll(detail);
|
|
551
|
-
};
|
|
552
|
-
const beforecolumnsset = ({ detail: { columns }, }) => {
|
|
553
|
-
this.columnSet(columns);
|
|
554
|
-
};
|
|
555
|
-
const headerDblClick = ({ detail }) => {
|
|
556
|
-
const type = getColumnType(detail.column);
|
|
557
|
-
const size = this.getColumnSize(detail.index, type);
|
|
558
|
-
if (size) {
|
|
559
|
-
this.providers.dimension.setCustomSizes(type, {
|
|
560
|
-
[detail.index]: size,
|
|
561
|
-
}, true);
|
|
562
|
-
}
|
|
563
|
-
};
|
|
564
|
-
this.addEventListener('beforecolumnsset', beforecolumnsset);
|
|
565
|
-
switch (config === null || config === void 0 ? void 0 : config.mode) {
|
|
566
|
-
case ColumnAutoSizeMode.autoSizeOnTextOverlap:
|
|
567
|
-
this.addEventListener('aftersourceset', aftersourceset);
|
|
568
|
-
this.addEventListener('afteredit', afteredit);
|
|
569
|
-
break;
|
|
570
|
-
case ColumnAutoSizeMode.autoSizeAll:
|
|
571
|
-
this.addEventListener('aftersourceset', aftersourceset);
|
|
572
|
-
this.addEventListener('afteredit', afterEditAll);
|
|
573
|
-
break;
|
|
574
|
-
default:
|
|
575
|
-
this.addEventListener('headerdblclick', headerDblClick);
|
|
576
|
-
break;
|
|
577
|
-
}
|
|
108
|
+
function doExpand(vIndex, source, rowItemsIndexes) {
|
|
109
|
+
const physicalIndex = rowItemsIndexes[vIndex];
|
|
110
|
+
const model = source[physicalIndex];
|
|
111
|
+
const currentGroup = getParsedGroup(model[PSEUDO_GROUP_ITEM_ID]);
|
|
112
|
+
const trimmed = {};
|
|
113
|
+
// no group found
|
|
114
|
+
if (!currentGroup) {
|
|
115
|
+
return { trimmed };
|
|
578
116
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
autoSize = await request;
|
|
593
|
-
}
|
|
594
|
-
catch (e) {
|
|
595
|
-
return;
|
|
117
|
+
const groupItems = [];
|
|
118
|
+
model[GROUP_EXPANDED] = true;
|
|
119
|
+
let i = physicalIndex + 1;
|
|
120
|
+
const total = source.length;
|
|
121
|
+
let groupLevelOnly = 0;
|
|
122
|
+
// go through all rows
|
|
123
|
+
while (i < total) {
|
|
124
|
+
const currentModel = source[i];
|
|
125
|
+
const isGroup = isGrouping(currentModel);
|
|
126
|
+
// group found
|
|
127
|
+
if (isGroup) {
|
|
128
|
+
if (!isSameGroup(currentGroup, model, currentModel)) {
|
|
129
|
+
break;
|
|
596
130
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
const sizes = {};
|
|
601
|
-
each(autoSize[type], rgCol => {
|
|
602
|
-
// calculate size
|
|
603
|
-
rgCol.size = sizes[rgCol.index] = source.reduce((prev, rgRow) => Math.max(prev, this.getLength(rgRow[rgCol.prop])), this.getLength(rgCol.name || ''));
|
|
604
|
-
});
|
|
605
|
-
this.providers.dimension.setCustomSizes(type, sizes, true);
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
getLength(len) {
|
|
609
|
-
var _a;
|
|
610
|
-
const padding = 15;
|
|
611
|
-
if (!len) {
|
|
612
|
-
return 0;
|
|
613
|
-
}
|
|
614
|
-
try {
|
|
615
|
-
const str = len.toString();
|
|
616
|
-
/**if exact calculation required proxy with html element, slow operation */
|
|
617
|
-
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.preciseSize) {
|
|
618
|
-
this.precsizeCalculationArea.innerText = str;
|
|
619
|
-
return this.precsizeCalculationArea.scrollWidth + padding * 2;
|
|
131
|
+
else if (!groupLevelOnly) {
|
|
132
|
+
// if get group first it's group only level
|
|
133
|
+
groupLevelOnly = currentModel[GROUP_DEPTH];
|
|
620
134
|
}
|
|
621
|
-
return str.length * this.letterBlockSize + padding * 2;
|
|
622
|
-
}
|
|
623
|
-
catch (e) {
|
|
624
|
-
return 0;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
afteredit(e) {
|
|
628
|
-
let data;
|
|
629
|
-
if (this.isRangeEdit(e)) {
|
|
630
|
-
data = e.data;
|
|
631
135
|
}
|
|
632
|
-
|
|
633
|
-
|
|
136
|
+
// level 0 or same depth
|
|
137
|
+
if (!groupLevelOnly || (isGroup && groupLevelOnly === currentModel[GROUP_DEPTH])) {
|
|
138
|
+
trimmed[i] = false;
|
|
139
|
+
groupItems.push(i);
|
|
634
140
|
}
|
|
635
|
-
|
|
636
|
-
const sizes = {};
|
|
637
|
-
each(columns, rgCol => {
|
|
638
|
-
var _a;
|
|
639
|
-
// calculate size
|
|
640
|
-
const size = reduce_1(data, (prev, rgRow) => {
|
|
641
|
-
if (typeof rgRow[rgCol.prop] === 'undefined') {
|
|
642
|
-
return prev;
|
|
643
|
-
}
|
|
644
|
-
return Math.max(prev || 0, this.getLength(rgRow[rgCol.prop]));
|
|
645
|
-
}, undefined);
|
|
646
|
-
if (size && ((_a = rgCol.size) !== null && _a !== void 0 ? _a : 0) < size) {
|
|
647
|
-
rgCol.size = sizes[rgCol.index] = size;
|
|
648
|
-
}
|
|
649
|
-
});
|
|
650
|
-
this.providers.dimension.setCustomSizes(type, sizes, true);
|
|
651
|
-
});
|
|
141
|
+
i++;
|
|
652
142
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
}
|
|
661
|
-
each(this.autoSizeColumns, (columns, type) => {
|
|
662
|
-
const sizes = {};
|
|
663
|
-
each(columns, rgCol => {
|
|
664
|
-
if (props[rgCol.prop]) {
|
|
665
|
-
const size = this.getColumnSize(rgCol.index, type);
|
|
666
|
-
if (size) {
|
|
667
|
-
sizes[rgCol.index] = size;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
this.providers.dimension.setCustomSizes(type, sizes, true);
|
|
672
|
-
});
|
|
143
|
+
const result = {
|
|
144
|
+
trimmed,
|
|
145
|
+
};
|
|
146
|
+
if (groupItems.length) {
|
|
147
|
+
const items = [...rowItemsIndexes];
|
|
148
|
+
items.splice(vIndex + 1, 0, ...groupItems);
|
|
149
|
+
result.items = items;
|
|
673
150
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const TRIMMED_GROUPING = 'grouping';
|
|
155
|
+
/**
|
|
156
|
+
* Prepare trimming updated indexes for grouping
|
|
157
|
+
* @param initiallyTrimed
|
|
158
|
+
* @param firstLevelMap
|
|
159
|
+
* @param secondLevelMap
|
|
160
|
+
*/
|
|
161
|
+
function processDoubleConversionTrimmed(initiallyTrimed, firstLevelMap, secondLevelMap) {
|
|
162
|
+
const trimemedOptionsToUpgrade = {};
|
|
163
|
+
/**
|
|
164
|
+
* go through all groups except grouping
|
|
165
|
+
*/
|
|
166
|
+
for (let type in initiallyTrimed) {
|
|
167
|
+
if (type === TRIMMED_GROUPING) {
|
|
168
|
+
continue;
|
|
679
169
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
170
|
+
const items = initiallyTrimed[type];
|
|
171
|
+
const newItems = {};
|
|
172
|
+
for (let initialIndex in items) {
|
|
173
|
+
/**
|
|
174
|
+
* if item exists we find it in collection
|
|
175
|
+
* we support 2 level of conversions
|
|
176
|
+
*/
|
|
177
|
+
let newConversionIndex = firstLevelMap[initialIndex];
|
|
178
|
+
if (secondLevelMap) {
|
|
179
|
+
newConversionIndex = secondLevelMap[newConversionIndex];
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* if item was trimmed previously
|
|
183
|
+
* trimming makes sense to apply
|
|
184
|
+
*/
|
|
185
|
+
if (items[initialIndex]) {
|
|
186
|
+
newItems[newConversionIndex] = true;
|
|
187
|
+
/**
|
|
188
|
+
* If changes present apply changes to new source
|
|
189
|
+
*/
|
|
190
|
+
if (newConversionIndex !== parseInt(initialIndex, 10)) {
|
|
191
|
+
trimemedOptionsToUpgrade[type] = newItems;
|
|
702
192
|
}
|
|
703
193
|
}
|
|
704
194
|
}
|
|
705
|
-
if (this.dataResolve) {
|
|
706
|
-
this.dataResolve(this.autoSizeColumns || {});
|
|
707
|
-
this.clearPromise();
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
clearPromise() {
|
|
711
|
-
this.dataResolve = null;
|
|
712
|
-
this.dataReject = null;
|
|
713
|
-
}
|
|
714
|
-
isRangeEdit(e) {
|
|
715
|
-
return !!e.data;
|
|
716
|
-
}
|
|
717
|
-
initiatePresizeElement() {
|
|
718
|
-
var _a;
|
|
719
|
-
const styleForFontTest = {
|
|
720
|
-
position: 'absolute',
|
|
721
|
-
fontSize: '14px',
|
|
722
|
-
height: '0',
|
|
723
|
-
width: '0',
|
|
724
|
-
whiteSpace: 'nowrap',
|
|
725
|
-
top: '0',
|
|
726
|
-
overflowX: 'scroll',
|
|
727
|
-
};
|
|
728
|
-
const el = document.createElement('div');
|
|
729
|
-
for (let s in styleForFontTest) {
|
|
730
|
-
el.style[s] = (_a = styleForFontTest[s]) !== null && _a !== void 0 ? _a : '';
|
|
731
|
-
}
|
|
732
|
-
el.classList.add('revo-test-container');
|
|
733
|
-
return el;
|
|
734
|
-
}
|
|
735
|
-
destroy() {
|
|
736
|
-
var _a;
|
|
737
|
-
super.destroy();
|
|
738
|
-
(_a = this.precsizeCalculationArea) === null || _a === void 0 ? void 0 : _a.remove();
|
|
739
195
|
}
|
|
196
|
+
return trimemedOptionsToUpgrade;
|
|
740
197
|
}
|
|
741
198
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
if (typeof value !== 'string') {
|
|
747
|
-
value = JSON.stringify(value);
|
|
748
|
-
}
|
|
749
|
-
const filterVal = extra === null || extra === void 0 ? void 0 : extra.toString().toLocaleLowerCase();
|
|
750
|
-
if ((filterVal === null || filterVal === void 0 ? void 0 : filterVal.length) === 0) {
|
|
751
|
-
return true;
|
|
752
|
-
}
|
|
753
|
-
return value.toLocaleLowerCase() === filterVal;
|
|
754
|
-
};
|
|
755
|
-
const notEq = (value, extra) => !eq(value, extra);
|
|
756
|
-
notEq.extra = 'input';
|
|
757
|
-
eq.extra = 'input';
|
|
758
|
-
|
|
759
|
-
const gtThan = function (value, extra) {
|
|
760
|
-
let conditionValue;
|
|
761
|
-
if (typeof value === 'number' && typeof extra !== 'undefined' && extra !== null) {
|
|
762
|
-
conditionValue = parseFloat(extra === null || extra === void 0 ? void 0 : extra.toString());
|
|
763
|
-
return value > conditionValue;
|
|
764
|
-
}
|
|
765
|
-
return false;
|
|
766
|
-
};
|
|
767
|
-
gtThan.extra = 'input';
|
|
768
|
-
|
|
769
|
-
const gtThanEq = function (value, extra) {
|
|
770
|
-
return eq(value, extra) || gtThan(value, extra);
|
|
771
|
-
};
|
|
772
|
-
gtThanEq.extra = 'input';
|
|
773
|
-
|
|
774
|
-
const lt = function (value, extra) {
|
|
775
|
-
let conditionValue;
|
|
776
|
-
if (typeof value === 'number' && typeof extra !== 'undefined' && extra !== null) {
|
|
777
|
-
conditionValue = parseFloat(extra.toString());
|
|
778
|
-
return value < conditionValue;
|
|
199
|
+
class GroupingRowPlugin extends BasePlugin {
|
|
200
|
+
get hasProps() {
|
|
201
|
+
var _a, _b, _c;
|
|
202
|
+
return ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) && ((_c = (_b = this.options) === null || _b === void 0 ? void 0 : _b.props) === null || _c === void 0 ? void 0 : _c.length);
|
|
779
203
|
}
|
|
780
|
-
|
|
781
|
-
return
|
|
204
|
+
get store() {
|
|
205
|
+
return this.providers.data.stores[GROUPING_ROW_TYPE].store;
|
|
782
206
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
const lsEq = function (value, extra) {
|
|
787
|
-
return eq(value, extra) || lt(value, extra);
|
|
788
|
-
};
|
|
789
|
-
lsEq.extra = 'input';
|
|
790
|
-
|
|
791
|
-
const set = (value) => !(value === '' || value === null || value === void 0);
|
|
792
|
-
const notSet = (value) => !set(value);
|
|
793
|
-
|
|
794
|
-
const beginsWith = (value, extra) => {
|
|
795
|
-
if (!value) {
|
|
796
|
-
return false;
|
|
207
|
+
// proxy for items get
|
|
208
|
+
get rowItems() {
|
|
209
|
+
return this.store.get('items');
|
|
797
210
|
}
|
|
798
|
-
|
|
799
|
-
return
|
|
211
|
+
get trimmed() {
|
|
212
|
+
return this.store.get('trimmed');
|
|
800
213
|
}
|
|
801
|
-
|
|
802
|
-
|
|
214
|
+
constructor(revogrid, providers) {
|
|
215
|
+
super(revogrid, providers);
|
|
216
|
+
this.revogrid = revogrid;
|
|
217
|
+
this.providers = providers;
|
|
803
218
|
}
|
|
804
|
-
|
|
805
|
-
|
|
219
|
+
// befoce cell focus
|
|
220
|
+
onFocus(e) {
|
|
221
|
+
if (isGrouping(e.detail.model)) {
|
|
222
|
+
e.preventDefault();
|
|
223
|
+
}
|
|
806
224
|
}
|
|
807
|
-
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
225
|
+
// expand event triggered
|
|
226
|
+
onExpand({ virtualIndex }) {
|
|
227
|
+
const { source } = this.getSource();
|
|
228
|
+
let newTrimmed = this.trimmed[TRIMMED_GROUPING];
|
|
229
|
+
let i = getPhysical(this.store, virtualIndex);
|
|
230
|
+
const model = source[i];
|
|
231
|
+
const prevExpanded = model[GROUP_EXPANDED];
|
|
232
|
+
if (!prevExpanded) {
|
|
233
|
+
const { trimmed, items } = doExpand(virtualIndex, source, this.rowItems);
|
|
234
|
+
newTrimmed = Object.assign(Object.assign({}, newTrimmed), trimmed);
|
|
235
|
+
if (items) {
|
|
236
|
+
setItems(this.store, items);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
const { trimmed } = doCollapse(i, source);
|
|
241
|
+
newTrimmed = Object.assign(Object.assign({}, newTrimmed), trimmed);
|
|
242
|
+
this.revogrid.clearFocus();
|
|
243
|
+
}
|
|
244
|
+
this.store.set('source', source);
|
|
245
|
+
this.revogrid.addTrimmed(newTrimmed, TRIMMED_GROUPING);
|
|
814
246
|
}
|
|
815
|
-
|
|
816
|
-
|
|
247
|
+
// get source based on proxy item collection to preserve rgRow order
|
|
248
|
+
getSource(withoutGrouping = false) {
|
|
249
|
+
const source = this.store.get('source');
|
|
250
|
+
const items = this.store.get('proxyItems');
|
|
251
|
+
let index = 0;
|
|
252
|
+
// order important here, expected parent is first, then others
|
|
253
|
+
return items.reduce((result, i) => {
|
|
254
|
+
const model = source[i];
|
|
255
|
+
if (!withoutGrouping) {
|
|
256
|
+
result.source.push(model);
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
// grouping filter
|
|
260
|
+
if (isGrouping(model)) {
|
|
261
|
+
if (model[GROUP_EXPANDED]) {
|
|
262
|
+
result.prevExpanded[model[PSEUDO_GROUP_ITEM_VALUE]] = true;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
result.source.push(model);
|
|
267
|
+
result.oldNewIndexes[i] = index;
|
|
268
|
+
index++;
|
|
269
|
+
}
|
|
270
|
+
return result;
|
|
271
|
+
}, {
|
|
272
|
+
source: [],
|
|
273
|
+
prevExpanded: {},
|
|
274
|
+
oldNewIndexes: {},
|
|
275
|
+
});
|
|
817
276
|
}
|
|
818
|
-
|
|
819
|
-
if
|
|
820
|
-
|
|
277
|
+
setColumnGrouping(cols) {
|
|
278
|
+
// if 0 column as holder
|
|
279
|
+
if (cols === null || cols === void 0 ? void 0 : cols.length) {
|
|
280
|
+
cols[0][PSEUDO_GROUP_COLUMN] = true;
|
|
281
|
+
return true;
|
|
821
282
|
}
|
|
822
|
-
return
|
|
283
|
+
return false;
|
|
823
284
|
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
};
|
|
829
|
-
notContains.extra = 'input';
|
|
830
|
-
contains.extra = 'input';
|
|
831
|
-
|
|
832
|
-
const filterNames = {
|
|
833
|
-
none: 'None',
|
|
834
|
-
empty: 'Not set',
|
|
835
|
-
notEmpty: 'Set',
|
|
836
|
-
eq: 'Equal',
|
|
837
|
-
notEq: 'Not equal',
|
|
838
|
-
begins: 'Begins with',
|
|
839
|
-
contains: 'Contains',
|
|
840
|
-
notContains: 'Does not contain',
|
|
841
|
-
eqN: '=',
|
|
842
|
-
neqN: '!=',
|
|
843
|
-
gt: '>',
|
|
844
|
-
gte: '>=',
|
|
845
|
-
lt: '<',
|
|
846
|
-
lte: '<=',
|
|
847
|
-
};
|
|
848
|
-
const filterEntities = {
|
|
849
|
-
none: () => true,
|
|
850
|
-
empty: notSet,
|
|
851
|
-
notEmpty: set,
|
|
852
|
-
eq: eq,
|
|
853
|
-
notEq: notEq,
|
|
854
|
-
begins: beginsWith,
|
|
855
|
-
contains: contains,
|
|
856
|
-
notContains: notContains,
|
|
857
|
-
eqN: eq,
|
|
858
|
-
neqN: notEq,
|
|
859
|
-
gt: gtThan,
|
|
860
|
-
gte: gtThanEq,
|
|
861
|
-
lt: lt,
|
|
862
|
-
lte: lsEq,
|
|
863
|
-
};
|
|
864
|
-
const filterTypes = {
|
|
865
|
-
string: ['notEmpty', 'empty', 'eq', 'notEq', 'begins', 'contains', 'notContains'],
|
|
866
|
-
number: ['notEmpty', 'empty', 'eqN', 'neqN', 'gt', 'gte', 'lt', 'lte'],
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
const FILTER_TRIMMED_TYPE = 'filter';
|
|
870
|
-
const FILTER_CONFIG_CHANGED_EVENT = 'filterconfigchanged';
|
|
871
|
-
class FilterPlugin extends BasePlugin {
|
|
872
|
-
constructor(revogrid, providers, config) {
|
|
873
|
-
var _a;
|
|
874
|
-
super(revogrid, providers);
|
|
875
|
-
this.revogrid = revogrid;
|
|
876
|
-
this.filterCollection = {};
|
|
877
|
-
this.multiFilterItems = {};
|
|
878
|
-
this.possibleFilters = Object.assign({}, filterTypes);
|
|
879
|
-
this.possibleFilterNames = Object.assign({}, filterNames);
|
|
880
|
-
this.possibleFilterEntities = Object.assign({}, filterEntities);
|
|
881
|
-
this.filterProp = FILTER_PROP;
|
|
882
|
-
if (config) {
|
|
883
|
-
this.initConfig(config);
|
|
884
|
-
}
|
|
885
|
-
const headerclick = (e) => this.headerclick(e);
|
|
886
|
-
const aftersourceset = async () => {
|
|
887
|
-
const filterCollectionProps = Object.keys(this.filterCollection);
|
|
888
|
-
if (filterCollectionProps.length > 0) {
|
|
889
|
-
// handle old way of filtering by reworking FilterCollection to new MultiFilterItem
|
|
890
|
-
filterCollectionProps.forEach((prop, index) => {
|
|
891
|
-
if (!this.multiFilterItems[prop]) {
|
|
892
|
-
this.multiFilterItems[prop] = [
|
|
893
|
-
{
|
|
894
|
-
id: index,
|
|
895
|
-
type: this.filterCollection[prop].type,
|
|
896
|
-
value: this.filterCollection[prop].value,
|
|
897
|
-
relation: 'and',
|
|
898
|
-
},
|
|
899
|
-
];
|
|
900
|
-
}
|
|
901
|
-
});
|
|
285
|
+
setColumns({ columns }) {
|
|
286
|
+
for (let type of columnTypes) {
|
|
287
|
+
if (this.setColumnGrouping(columns[type])) {
|
|
288
|
+
break;
|
|
902
289
|
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// evaluate drag between groups
|
|
293
|
+
onDrag(e) {
|
|
294
|
+
const { from, to } = e.detail;
|
|
295
|
+
const isDown = to - from >= 0;
|
|
296
|
+
const { source } = this.getSource();
|
|
297
|
+
const items = this.rowItems;
|
|
298
|
+
let i = isDown ? from : to;
|
|
299
|
+
const end = isDown ? to : from;
|
|
300
|
+
for (; i < end; i++) {
|
|
301
|
+
const model = source[items[i]];
|
|
302
|
+
const isGroup = isGrouping(model);
|
|
303
|
+
if (isGroup) {
|
|
304
|
+
e.preventDefault();
|
|
909
305
|
return;
|
|
910
306
|
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
...existingNodes,
|
|
921
|
-
h("revogr-filter-panel", { filterItems: this.multiFilterItems, filterNames: this.possibleFilterNames, filterEntities: this.possibleFilterEntities, filterCaptions: (_a = config === null || config === void 0 ? void 0 : config.localization) === null || _a === void 0 ? void 0 : _a.captions, onFilterChange: e => this.onFilterChange(e.detail), disableDynamicFiltering: config === null || config === void 0 ? void 0 : config.disableDynamicFiltering, ref: e => (this.pop = e) }),
|
|
922
|
-
];
|
|
923
|
-
}
|
|
924
|
-
initConfig(config) {
|
|
925
|
-
if (config.multiFilterItems) {
|
|
926
|
-
this.multiFilterItems = Object.assign({}, config.multiFilterItems);
|
|
927
|
-
}
|
|
928
|
-
if (config.customFilters) {
|
|
929
|
-
for (let cType in config.customFilters) {
|
|
930
|
-
const cFilter = config.customFilters[cType];
|
|
931
|
-
if (!this.possibleFilters[cFilter.columnFilterType]) {
|
|
932
|
-
this.possibleFilters[cFilter.columnFilterType] = [];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
beforeTrimmedApply(trimmed, type) {
|
|
310
|
+
/** Before filter apply remove grouping filtering */
|
|
311
|
+
if (type === FILTER_TRIMMED_TYPE) {
|
|
312
|
+
const source = this.store.get('source');
|
|
313
|
+
for (let index in trimmed) {
|
|
314
|
+
if (trimmed[index] && isGrouping(source[index])) {
|
|
315
|
+
trimmed[index] = false;
|
|
933
316
|
}
|
|
934
|
-
this.possibleFilters[cFilter.columnFilterType].push(cType);
|
|
935
|
-
this.possibleFilterEntities[cType] = cFilter.func;
|
|
936
|
-
this.possibleFilterNames[cType] = cFilter.name;
|
|
937
317
|
}
|
|
938
318
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
319
|
+
}
|
|
320
|
+
// subscribe to grid events to process them accordingly
|
|
321
|
+
subscribe() {
|
|
322
|
+
/** if grouping present and new data source arrived */
|
|
323
|
+
this.addEventListener('beforesourceset', ({ detail }) => this.onDataSet(detail));
|
|
324
|
+
this.addEventListener('beforecolumnsset', ({ detail }) => this.setColumns(detail));
|
|
942
325
|
/**
|
|
943
|
-
*
|
|
944
|
-
*
|
|
326
|
+
* filter applied need to clear grouping and apply again
|
|
327
|
+
* based on new results can be new grouping
|
|
945
328
|
*/
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
}
|
|
966
|
-
else {
|
|
967
|
-
console.warn(`${item.type} type is not found.`);
|
|
968
|
-
}
|
|
969
|
-
return result;
|
|
970
|
-
}, {});
|
|
971
|
-
}
|
|
972
|
-
if (config.localization) {
|
|
973
|
-
if (config.localization.filterNames) {
|
|
974
|
-
Object.entries(config.localization.filterNames).forEach(([k, v]) => {
|
|
975
|
-
if (this.possibleFilterNames[k] != void 0) {
|
|
976
|
-
this.possibleFilterNames[k] = v;
|
|
977
|
-
}
|
|
978
|
-
});
|
|
979
|
-
}
|
|
980
|
-
}
|
|
329
|
+
this.addEventListener('beforetrimmed', ({ detail: { trimmed, trimmedType } }) => this.beforeTrimmedApply(trimmed, trimmedType));
|
|
330
|
+
/**
|
|
331
|
+
* sorting applied need to clear grouping and apply again
|
|
332
|
+
* based on new results whole grouping order will changed
|
|
333
|
+
*/
|
|
334
|
+
this.addEventListener('aftersortingapply', () => this.doSourceUpdate(Object.assign({}, this.options)));
|
|
335
|
+
/**
|
|
336
|
+
* Apply logic for focus inside of grouping
|
|
337
|
+
* We can't focus on grouping rows, navigation only inside of groups for now
|
|
338
|
+
*/
|
|
339
|
+
this.addEventListener('beforecellfocus', e => this.onFocus(e));
|
|
340
|
+
/**
|
|
341
|
+
* Prevent rgRow drag outside the group
|
|
342
|
+
*/
|
|
343
|
+
this.addEventListener('roworderchanged', e => this.onDrag(e));
|
|
344
|
+
/**
|
|
345
|
+
* When grouping expand icon was clicked
|
|
346
|
+
*/
|
|
347
|
+
this.addEventListener(GROUP_EXPAND_EVENT, ({ detail }) => this.onExpand(detail));
|
|
981
348
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
// close if same
|
|
990
|
-
const changes = await ((_b = this.pop) === null || _b === void 0 ? void 0 : _b.getChanges());
|
|
991
|
-
if (changes && (changes === null || changes === void 0 ? void 0 : changes.prop) === e.detail.prop) {
|
|
992
|
-
(_c = this.pop) === null || _c === void 0 ? void 0 : _c.show();
|
|
993
|
-
return;
|
|
994
|
-
}
|
|
995
|
-
if (!this.pop) {
|
|
349
|
+
/**
|
|
350
|
+
* Starts global source update with group clearing and applying new one
|
|
351
|
+
* Initiated when need to reapply grouping
|
|
352
|
+
*/
|
|
353
|
+
doSourceUpdate(options) {
|
|
354
|
+
var _a;
|
|
355
|
+
if (!this.hasProps) {
|
|
996
356
|
return;
|
|
997
357
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
if (this.isValidType(type)) {
|
|
1012
|
-
filterType = type;
|
|
1013
|
-
// if multiple filters applied
|
|
1014
|
-
}
|
|
1015
|
-
else if (typeof type === 'object' && type.length) {
|
|
1016
|
-
return type.reduce((r, multiType) => {
|
|
1017
|
-
if (this.isValidType(multiType)) {
|
|
1018
|
-
r[multiType] = this.possibleFilters[multiType];
|
|
1019
|
-
}
|
|
1020
|
-
return r;
|
|
1021
|
-
}, {});
|
|
1022
|
-
}
|
|
1023
|
-
return { [filterType]: this.possibleFilters[filterType] };
|
|
1024
|
-
}
|
|
1025
|
-
isValidType(type) {
|
|
1026
|
-
return !!(typeof type === 'string' && this.possibleFilters[type]);
|
|
1027
|
-
}
|
|
1028
|
-
// called on internal component change
|
|
1029
|
-
async onFilterChange(filterItems) {
|
|
1030
|
-
this.multiFilterItems = filterItems;
|
|
1031
|
-
this.runFiltering();
|
|
358
|
+
/**
|
|
359
|
+
* Get source without grouping
|
|
360
|
+
* @param newOldIndexMap - provides us mapping with new indexes vs old indexes, we would use it for trimmed mapping
|
|
361
|
+
*/
|
|
362
|
+
const { source, prevExpanded, oldNewIndexes } = this.getSource(true);
|
|
363
|
+
/**
|
|
364
|
+
* Group again
|
|
365
|
+
* @param oldNewIndexMap - provides us mapping with new indexes vs old indexes
|
|
366
|
+
*/
|
|
367
|
+
const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], Object.assign({ prevExpanded }, options));
|
|
368
|
+
// setup source
|
|
369
|
+
this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer: options === null || options === void 0 ? void 0 : options.groupLabelTemplate }, true);
|
|
370
|
+
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes !== null && oldNewIndexes !== void 0 ? oldNewIndexes : {}, oldNewIndexMap);
|
|
1032
371
|
}
|
|
1033
372
|
/**
|
|
1034
|
-
*
|
|
373
|
+
* Apply grouping on data set
|
|
374
|
+
* Clear grouping from source
|
|
375
|
+
* If source came from other plugin
|
|
1035
376
|
*/
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
const column = Object.assign({}, rgCol);
|
|
1040
|
-
const hasFilter = filterItems[column.prop];
|
|
1041
|
-
if (column[this.filterProp] && !hasFilter) {
|
|
1042
|
-
delete column[this.filterProp];
|
|
1043
|
-
columnsToUpdate.push(column);
|
|
1044
|
-
}
|
|
1045
|
-
if (!column[this.filterProp] && hasFilter) {
|
|
1046
|
-
columnsToUpdate.push(column);
|
|
1047
|
-
column[this.filterProp] = true;
|
|
1048
|
-
}
|
|
1049
|
-
});
|
|
1050
|
-
const itemsToFilter = this.getRowFilter(items, filterItems);
|
|
1051
|
-
// check is filter event prevented
|
|
1052
|
-
const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', {
|
|
1053
|
-
collection,
|
|
1054
|
-
itemsToFilter,
|
|
1055
|
-
source: items,
|
|
1056
|
-
filterItems,
|
|
1057
|
-
});
|
|
1058
|
-
if (defaultPrevented) {
|
|
377
|
+
onDataSet(data) {
|
|
378
|
+
var _a;
|
|
379
|
+
if (!this.hasProps || !(data === null || data === void 0 ? void 0 : data.source) || !data.source.length) {
|
|
1059
380
|
return;
|
|
1060
381
|
}
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1063
|
-
|
|
382
|
+
const source = data.source.filter(s => !isGrouping(s));
|
|
383
|
+
const expanded = this.revogrid.grouping || {};
|
|
384
|
+
const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], Object.assign({}, (expanded || {})));
|
|
385
|
+
data.source = sourceWithGroups;
|
|
386
|
+
this.providers.data.setGrouping({ depth });
|
|
387
|
+
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexMap);
|
|
388
|
+
}
|
|
389
|
+
// apply grouping
|
|
390
|
+
setGrouping(options) {
|
|
391
|
+
// unsubscribe from all events when group applied
|
|
392
|
+
this.clearSubscriptions();
|
|
393
|
+
this.options = options;
|
|
394
|
+
// clear props, no grouping exists
|
|
395
|
+
if (!options.props || !Object.keys(options.props).length) {
|
|
396
|
+
this.clearGrouping();
|
|
1064
397
|
return;
|
|
1065
398
|
}
|
|
1066
|
-
//
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
async clearFiltering() {
|
|
1071
|
-
this.multiFilterItems = {};
|
|
1072
|
-
await this.runFiltering();
|
|
1073
|
-
}
|
|
1074
|
-
async runFiltering() {
|
|
1075
|
-
const collection = {};
|
|
1076
|
-
// handle old filterCollection to return the first filter only (if any) from multiFilterItems
|
|
1077
|
-
const filterProps = Object.keys(this.multiFilterItems);
|
|
1078
|
-
for (const prop of filterProps) {
|
|
1079
|
-
// check if we have any filter for a column
|
|
1080
|
-
if (this.multiFilterItems[prop].length > 0) {
|
|
1081
|
-
const firstFilterItem = this.multiFilterItems[prop][0];
|
|
1082
|
-
collection[prop] = {
|
|
1083
|
-
filter: filterEntities[firstFilterItem.type],
|
|
1084
|
-
type: firstFilterItem.type,
|
|
1085
|
-
value: firstFilterItem.value,
|
|
1086
|
-
};
|
|
1087
|
-
}
|
|
399
|
+
// props exist and source inited
|
|
400
|
+
const { source } = this.getSource();
|
|
401
|
+
if (source.length) {
|
|
402
|
+
this.doSourceUpdate(Object.assign({}, options));
|
|
1088
403
|
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
filterItems: this.multiFilterItems,
|
|
1096
|
-
});
|
|
1097
|
-
if (defaultPrevented) {
|
|
1098
|
-
return;
|
|
404
|
+
// props exist and columns inited
|
|
405
|
+
for (let t of columnTypes) {
|
|
406
|
+
if (this.setColumnGrouping(this.providers.column.getColumns(t))) {
|
|
407
|
+
this.providers.column.refreshByType(t);
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
1099
410
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
async getData() {
|
|
1103
|
-
return {
|
|
1104
|
-
source: await this.revogrid.getSource(),
|
|
1105
|
-
columns: await this.revogrid.getColumns(),
|
|
1106
|
-
};
|
|
411
|
+
// if has any grouping subscribe to events again
|
|
412
|
+
this.subscribe();
|
|
1107
413
|
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
// THE MAGIC OF FILTERING IS HERE
|
|
1125
|
-
if (filterData.relation === 'or') {
|
|
1126
|
-
lastFilterResults = [];
|
|
1127
|
-
if (filter(model[prop], filterData.value)) {
|
|
1128
|
-
continue;
|
|
1129
|
-
}
|
|
1130
|
-
propFilterSatisfiedCount++;
|
|
1131
|
-
}
|
|
1132
|
-
else {
|
|
1133
|
-
// 'and' relation will need to know the next filter
|
|
1134
|
-
// so we save this current filter to include it in the next filter
|
|
1135
|
-
lastFilterResults.push(!filter(model[prop], filterData.value));
|
|
1136
|
-
// check first if we have a filter on the next index to pair it with this current filter
|
|
1137
|
-
const nextFilterData = propFilters[filterIndex + 1];
|
|
1138
|
-
// stop the sequence if there is no next filter or if the next filter is not an 'and' relation
|
|
1139
|
-
if (!nextFilterData || nextFilterData.relation !== 'and') {
|
|
1140
|
-
// let's just continue since for sure propFilterSatisfiedCount cannot be satisfied
|
|
1141
|
-
if (lastFilterResults.indexOf(true) === -1) {
|
|
1142
|
-
lastFilterResults = [];
|
|
1143
|
-
continue;
|
|
1144
|
-
}
|
|
1145
|
-
// we need to add all of the lastFilterResults since we need to satisfy all
|
|
1146
|
-
propFilterSatisfiedCount += lastFilterResults.length;
|
|
1147
|
-
lastFilterResults = [];
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
} // end of propFilters forEach
|
|
1151
|
-
// add to the list of removed/trimmed rows of filter condition is satisfied
|
|
1152
|
-
if (propFilterSatisfiedCount === propFilters.length)
|
|
1153
|
-
trimmed[rowIndex] = true;
|
|
1154
|
-
} // end of for-of propKeys
|
|
414
|
+
// clear grouping
|
|
415
|
+
clearGrouping() {
|
|
416
|
+
// clear columns
|
|
417
|
+
columnTypes.forEach(t => {
|
|
418
|
+
const cols = this.providers.column.getColumns(t);
|
|
419
|
+
let deleted = false;
|
|
420
|
+
cols.forEach(c => {
|
|
421
|
+
if (isGroupingColumn(c)) {
|
|
422
|
+
delete c[PSEUDO_GROUP_COLUMN];
|
|
423
|
+
deleted = true;
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
// if column store had grouping clear and refresh
|
|
427
|
+
if (deleted) {
|
|
428
|
+
this.providers.column.refreshByType(t);
|
|
429
|
+
}
|
|
1155
430
|
});
|
|
1156
|
-
|
|
431
|
+
// clear rows
|
|
432
|
+
const { source, oldNewIndexes } = this.getSource(true);
|
|
433
|
+
this.providers.data.setData(source, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, undefined, true);
|
|
434
|
+
this.updateTrimmed(undefined, undefined, oldNewIndexes);
|
|
435
|
+
}
|
|
436
|
+
updateTrimmed(trimmedGroup = {}, _childrenByGroup = {}, firstLevelMap = {}, secondLevelMap) {
|
|
437
|
+
// map previously trimmed data
|
|
438
|
+
const trimemedOptionsToUpgrade = processDoubleConversionTrimmed(this.trimmed, firstLevelMap, secondLevelMap);
|
|
439
|
+
for (let type in trimemedOptionsToUpgrade) {
|
|
440
|
+
this.revogrid.addTrimmed(trimemedOptionsToUpgrade[type], type);
|
|
441
|
+
}
|
|
442
|
+
// const emptyGroups = this.filterOutEmptyGroups(trimemedOptionsToUpgrade, childrenByGroup);
|
|
443
|
+
// setup trimmed data for grouping
|
|
444
|
+
this.revogrid.addTrimmed(Object.assign({}, trimmedGroup), TRIMMED_GROUPING);
|
|
1157
445
|
}
|
|
1158
446
|
}
|
|
1159
447
|
|
|
@@ -1296,7 +584,7 @@ var _stringSize = stringSize$1;
|
|
|
1296
584
|
|
|
1297
585
|
var baseKeys = _baseKeys,
|
|
1298
586
|
getTag = _getTag,
|
|
1299
|
-
isArrayLike = isArrayLike_1,
|
|
587
|
+
isArrayLike$1 = isArrayLike_1,
|
|
1300
588
|
isString = isString_1,
|
|
1301
589
|
stringSize = _stringSize;
|
|
1302
590
|
|
|
@@ -1329,7 +617,7 @@ function size(collection) {
|
|
|
1329
617
|
if (collection == null) {
|
|
1330
618
|
return 0;
|
|
1331
619
|
}
|
|
1332
|
-
if (isArrayLike(collection)) {
|
|
620
|
+
if (isArrayLike$1(collection)) {
|
|
1333
621
|
return isString(collection) ? stringSize(collection) : collection.length;
|
|
1334
622
|
}
|
|
1335
623
|
var tag = getTag(collection);
|
|
@@ -1562,742 +850,435 @@ class SortingPlugin extends BasePlugin {
|
|
|
1562
850
|
}
|
|
1563
851
|
}
|
|
1564
852
|
|
|
853
|
+
var baseIteratee = _baseIteratee,
|
|
854
|
+
isArrayLike = isArrayLike_1,
|
|
855
|
+
keys = keys_1;
|
|
856
|
+
|
|
1565
857
|
/**
|
|
1566
|
-
*
|
|
858
|
+
* Creates a `_.find` or `_.findLast` function.
|
|
1567
859
|
*
|
|
1568
860
|
* @private
|
|
1569
|
-
* @param {
|
|
1570
|
-
* @
|
|
1571
|
-
* @param {number} upper The upper bound.
|
|
1572
|
-
* @returns {number} Returns the clamped number.
|
|
861
|
+
* @param {Function} findIndexFunc The function to find the collection index.
|
|
862
|
+
* @returns {Function} Returns the new find function.
|
|
1573
863
|
*/
|
|
1574
|
-
|
|
1575
|
-
function
|
|
1576
|
-
|
|
1577
|
-
if (
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
number = number >= lower ? number : lower;
|
|
864
|
+
function createFind$1(findIndexFunc) {
|
|
865
|
+
return function(collection, predicate, fromIndex) {
|
|
866
|
+
var iterable = Object(collection);
|
|
867
|
+
if (!isArrayLike(collection)) {
|
|
868
|
+
var iteratee = baseIteratee(predicate);
|
|
869
|
+
collection = keys(collection);
|
|
870
|
+
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
|
|
1582
871
|
}
|
|
1583
|
-
|
|
1584
|
-
|
|
872
|
+
var index = findIndexFunc(collection, predicate, fromIndex);
|
|
873
|
+
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
|
874
|
+
};
|
|
1585
875
|
}
|
|
1586
876
|
|
|
1587
|
-
var
|
|
1588
|
-
|
|
1589
|
-
var baseClamp = _baseClamp,
|
|
1590
|
-
toInteger$1 = toInteger_1;
|
|
877
|
+
var _createFind = createFind$1;
|
|
1591
878
|
|
|
1592
|
-
|
|
1593
|
-
|
|
879
|
+
var createFind = _createFind,
|
|
880
|
+
findIndex = findIndex_1;
|
|
1594
881
|
|
|
1595
882
|
/**
|
|
1596
|
-
*
|
|
1597
|
-
*
|
|
1598
|
-
*
|
|
1599
|
-
* **Note:** This method is based on
|
|
1600
|
-
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
883
|
+
* Iterates over elements of `collection`, returning the first element
|
|
884
|
+
* `predicate` returns truthy for. The predicate is invoked with three
|
|
885
|
+
* arguments: (value, index|key, collection).
|
|
1601
886
|
*
|
|
1602
887
|
* @static
|
|
1603
888
|
* @memberOf _
|
|
1604
|
-
* @since
|
|
1605
|
-
* @category
|
|
1606
|
-
* @param {
|
|
1607
|
-
* @
|
|
889
|
+
* @since 0.1.0
|
|
890
|
+
* @category Collection
|
|
891
|
+
* @param {Array|Object} collection The collection to inspect.
|
|
892
|
+
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
|
893
|
+
* @param {number} [fromIndex=0] The index to search from.
|
|
894
|
+
* @returns {*} Returns the matched element, else `undefined`.
|
|
1608
895
|
* @example
|
|
1609
896
|
*
|
|
1610
|
-
*
|
|
1611
|
-
*
|
|
1612
|
-
*
|
|
1613
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1616
|
-
* _.toLength(Infinity);
|
|
1617
|
-
* // => 4294967295
|
|
1618
|
-
*
|
|
1619
|
-
* _.toLength('3.2');
|
|
1620
|
-
* // => 3
|
|
1621
|
-
*/
|
|
1622
|
-
function toLength$1(value) {
|
|
1623
|
-
return value ? baseClamp(toInteger$1(value), 0, MAX_ARRAY_LENGTH) : 0;
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
|
-
var toLength_1 = toLength$1;
|
|
1627
|
-
|
|
1628
|
-
var toInteger = toInteger_1,
|
|
1629
|
-
toLength = toLength_1;
|
|
1630
|
-
|
|
1631
|
-
/**
|
|
1632
|
-
* The base implementation of `_.fill` without an iteratee call guard.
|
|
1633
|
-
*
|
|
1634
|
-
* @private
|
|
1635
|
-
* @param {Array} array The array to fill.
|
|
1636
|
-
* @param {*} value The value to fill `array` with.
|
|
1637
|
-
* @param {number} [start=0] The start position.
|
|
1638
|
-
* @param {number} [end=array.length] The end position.
|
|
1639
|
-
* @returns {Array} Returns `array`.
|
|
1640
|
-
*/
|
|
1641
|
-
function baseFill$1(array, value, start, end) {
|
|
1642
|
-
var length = array.length;
|
|
1643
|
-
|
|
1644
|
-
start = toInteger(start);
|
|
1645
|
-
if (start < 0) {
|
|
1646
|
-
start = -start > length ? 0 : (length + start);
|
|
1647
|
-
}
|
|
1648
|
-
end = (end === undefined || end > length) ? length : toInteger(end);
|
|
1649
|
-
if (end < 0) {
|
|
1650
|
-
end += length;
|
|
1651
|
-
}
|
|
1652
|
-
end = start > end ? 0 : toLength(end);
|
|
1653
|
-
while (start < end) {
|
|
1654
|
-
array[start++] = value;
|
|
1655
|
-
}
|
|
1656
|
-
return array;
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
var _baseFill = baseFill$1;
|
|
1660
|
-
|
|
1661
|
-
var baseFill = _baseFill,
|
|
1662
|
-
isIterateeCall = _isIterateeCall;
|
|
1663
|
-
|
|
1664
|
-
/**
|
|
1665
|
-
* Fills elements of `array` with `value` from `start` up to, but not
|
|
1666
|
-
* including, `end`.
|
|
1667
|
-
*
|
|
1668
|
-
* **Note:** This method mutates `array`.
|
|
1669
|
-
*
|
|
1670
|
-
* @static
|
|
1671
|
-
* @memberOf _
|
|
1672
|
-
* @since 3.2.0
|
|
1673
|
-
* @category Array
|
|
1674
|
-
* @param {Array} array The array to fill.
|
|
1675
|
-
* @param {*} value The value to fill `array` with.
|
|
1676
|
-
* @param {number} [start=0] The start position.
|
|
1677
|
-
* @param {number} [end=array.length] The end position.
|
|
1678
|
-
* @returns {Array} Returns `array`.
|
|
1679
|
-
* @example
|
|
897
|
+
* var users = [
|
|
898
|
+
* { 'user': 'barney', 'age': 36, 'active': true },
|
|
899
|
+
* { 'user': 'fred', 'age': 40, 'active': false },
|
|
900
|
+
* { 'user': 'pebbles', 'age': 1, 'active': true }
|
|
901
|
+
* ];
|
|
1680
902
|
*
|
|
1681
|
-
*
|
|
903
|
+
* _.find(users, function(o) { return o.age < 40; });
|
|
904
|
+
* // => object for 'barney'
|
|
1682
905
|
*
|
|
1683
|
-
* _.
|
|
1684
|
-
*
|
|
1685
|
-
* // =>
|
|
906
|
+
* // The `_.matches` iteratee shorthand.
|
|
907
|
+
* _.find(users, { 'age': 1, 'active': true });
|
|
908
|
+
* // => object for 'pebbles'
|
|
1686
909
|
*
|
|
1687
|
-
* _.
|
|
1688
|
-
*
|
|
910
|
+
* // The `_.matchesProperty` iteratee shorthand.
|
|
911
|
+
* _.find(users, ['active', false]);
|
|
912
|
+
* // => object for 'fred'
|
|
1689
913
|
*
|
|
1690
|
-
* _.
|
|
1691
|
-
*
|
|
914
|
+
* // The `_.property` iteratee shorthand.
|
|
915
|
+
* _.find(users, 'active');
|
|
916
|
+
* // => object for 'barney'
|
|
1692
917
|
*/
|
|
1693
|
-
|
|
1694
|
-
var length = array == null ? 0 : array.length;
|
|
1695
|
-
if (!length) {
|
|
1696
|
-
return [];
|
|
1697
|
-
}
|
|
1698
|
-
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
|
|
1699
|
-
start = 0;
|
|
1700
|
-
end = length;
|
|
1701
|
-
}
|
|
1702
|
-
return baseFill(array, value, start, end);
|
|
1703
|
-
}
|
|
918
|
+
var find = createFind(findIndex);
|
|
1704
919
|
|
|
1705
|
-
var
|
|
920
|
+
var find_1 = find;
|
|
1706
921
|
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
encoding: '',
|
|
1715
|
-
};
|
|
1716
|
-
// The ASCII character code 13 is called a Carriage Return or CR.
|
|
1717
|
-
const CARRIAGE_RETURN = String.fromCharCode(13);
|
|
1718
|
-
// Chr(13) followed by a Chr(10) that compose a proper CRLF.
|
|
1719
|
-
const LINE_FEED = String.fromCharCode(10);
|
|
1720
|
-
const DOUBLE_QT = String.fromCharCode(34);
|
|
1721
|
-
const NO_BREAK_SPACE = String.fromCharCode(0xfeff);
|
|
1722
|
-
const escapeRegex = new RegExp('"', 'g');
|
|
1723
|
-
class ExportCsv {
|
|
1724
|
-
constructor(options = {}) {
|
|
1725
|
-
this.options = Object.assign(Object.assign({}, INITIAL), options);
|
|
1726
|
-
}
|
|
1727
|
-
doExport({ data, headers, props }) {
|
|
1728
|
-
let result = this.options.bom ? NO_BREAK_SPACE : '';
|
|
1729
|
-
// any header
|
|
1730
|
-
if ((headers === null || headers === void 0 ? void 0 : headers.length) > 0) {
|
|
1731
|
-
headers.forEach(header => {
|
|
1732
|
-
// ignore empty
|
|
1733
|
-
if (!header.length) {
|
|
1734
|
-
return;
|
|
1735
|
-
}
|
|
1736
|
-
result += this.prepareHeader(header, this.options.columnDelimiter);
|
|
1737
|
-
result += this.options.rowDelimiter;
|
|
922
|
+
class ColumnDataProvider {
|
|
923
|
+
get order() {
|
|
924
|
+
const order = {};
|
|
925
|
+
const sorting = this.sorting;
|
|
926
|
+
if (sorting) {
|
|
927
|
+
Object.keys(sorting).forEach((prop) => {
|
|
928
|
+
order[prop] = sorting[prop].order;
|
|
1738
929
|
});
|
|
1739
930
|
}
|
|
1740
|
-
|
|
1741
|
-
if (index > 0) {
|
|
1742
|
-
result += this.options.rowDelimiter;
|
|
1743
|
-
}
|
|
1744
|
-
// support grouping
|
|
1745
|
-
if (isGrouping(rgRow)) {
|
|
1746
|
-
result += this.parseCell(getGroupingName(rgRow), this.options.columnDelimiter);
|
|
1747
|
-
return;
|
|
1748
|
-
}
|
|
1749
|
-
result += props.map(p => this.parseCell(rgRow[p], this.options.columnDelimiter)).join(this.options.columnDelimiter);
|
|
1750
|
-
});
|
|
1751
|
-
return result;
|
|
931
|
+
return order;
|
|
1752
932
|
}
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
const newColumnHeaders = columnHeaders.map(v => this.parseCell(v, columnDelimiter, true));
|
|
1756
|
-
result += newColumnHeaders.join(columnDelimiter);
|
|
1757
|
-
return result;
|
|
933
|
+
get stores() {
|
|
934
|
+
return this.dataSources;
|
|
1758
935
|
}
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
if (typeof escape === 'undefined') {
|
|
1766
|
-
return '';
|
|
1767
|
-
}
|
|
1768
|
-
if (escape !== '' && (force || toEscape.some(i => escape.indexOf(i) >= 0))) {
|
|
1769
|
-
return `"${escape.replace(escapeRegex, '""')}"`;
|
|
1770
|
-
}
|
|
1771
|
-
return escape;
|
|
936
|
+
constructor() {
|
|
937
|
+
this.sorting = null;
|
|
938
|
+
this.dataSources = columnTypes.reduce((sources, k) => {
|
|
939
|
+
sources[k] = new DataStore(k);
|
|
940
|
+
return sources;
|
|
941
|
+
}, {});
|
|
1772
942
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
var ExportTypes;
|
|
1776
|
-
(function (ExportTypes) {
|
|
1777
|
-
ExportTypes["csv"] = "csv";
|
|
1778
|
-
})(ExportTypes || (ExportTypes = {}));
|
|
1779
|
-
class ExportFilePlugin extends BasePlugin {
|
|
1780
|
-
/** Exports string */
|
|
1781
|
-
async exportString(options = {}, t = ExportTypes.csv) {
|
|
1782
|
-
const data = await this.beforeexport();
|
|
1783
|
-
if (!data) {
|
|
1784
|
-
return null;
|
|
1785
|
-
}
|
|
1786
|
-
return this.formatter(t, options).doExport(data);
|
|
1787
|
-
}
|
|
1788
|
-
/** Exports Blob */
|
|
1789
|
-
async exportBlob(options = {}, t = ExportTypes.csv) {
|
|
1790
|
-
return await this.getBlob(this.formatter(t, options));
|
|
1791
|
-
}
|
|
1792
|
-
/** Export file */
|
|
1793
|
-
async exportFile(options = {}, t = ExportTypes.csv) {
|
|
1794
|
-
const formatter = this.formatter(t, options);
|
|
1795
|
-
// url
|
|
1796
|
-
const URL = window.URL || window.webkitURL;
|
|
1797
|
-
const a = document.createElement('a');
|
|
1798
|
-
const { filename, fileKind } = formatter.options;
|
|
1799
|
-
const name = `${filename}.${fileKind}`;
|
|
1800
|
-
const blob = await this.getBlob(formatter);
|
|
1801
|
-
const url = blob ? URL.createObjectURL(blob) : '';
|
|
1802
|
-
a.style.display = 'none';
|
|
1803
|
-
a.setAttribute('href', url);
|
|
1804
|
-
a.setAttribute('download', name);
|
|
1805
|
-
this.revogrid.appendChild(a);
|
|
1806
|
-
a.dispatchEvent(new MouseEvent('click'));
|
|
1807
|
-
this.revogrid.removeChild(a);
|
|
1808
|
-
// delay for revoke, correct for some browsers
|
|
1809
|
-
await timeout(120);
|
|
1810
|
-
URL.revokeObjectURL(url);
|
|
1811
|
-
}
|
|
1812
|
-
/** Blob object */
|
|
1813
|
-
async getBlob(formatter) {
|
|
1814
|
-
const type = `${formatter.options.mime};charset=${formatter.options.encoding}`;
|
|
1815
|
-
if (typeof Blob !== 'undefined') {
|
|
1816
|
-
const data = await this.beforeexport();
|
|
1817
|
-
if (!data) {
|
|
1818
|
-
return null;
|
|
1819
|
-
}
|
|
1820
|
-
return new Blob([formatter.doExport(data)], { type });
|
|
1821
|
-
}
|
|
1822
|
-
return null;
|
|
943
|
+
column(c, pin) {
|
|
944
|
+
return this.getColumn(c, pin || 'rgCol');
|
|
1823
945
|
}
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
let data = await this.getData();
|
|
1827
|
-
const event = this.emit('beforeexport', { data });
|
|
1828
|
-
if (event.defaultPrevented) {
|
|
1829
|
-
return null;
|
|
1830
|
-
}
|
|
1831
|
-
return event.detail.data;
|
|
946
|
+
getColumn(virtualIndex, type) {
|
|
947
|
+
return getSourceItem(this.dataSources[type].store, virtualIndex);
|
|
1832
948
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
949
|
+
getRawColumns() {
|
|
950
|
+
return reduce_1(this.dataSources, (result, item, type) => {
|
|
951
|
+
result[type] = item.store.get('source');
|
|
952
|
+
return result;
|
|
953
|
+
}, {
|
|
954
|
+
rgCol: [],
|
|
955
|
+
colPinStart: [],
|
|
956
|
+
colPinEnd: [],
|
|
1839
957
|
});
|
|
1840
|
-
await Promise.all(colPromises);
|
|
1841
|
-
const columns = {
|
|
1842
|
-
headers: [],
|
|
1843
|
-
props: [],
|
|
1844
|
-
};
|
|
1845
|
-
for (let source of colSource) {
|
|
1846
|
-
source.headers.forEach((h, i) => {
|
|
1847
|
-
if (!columns.headers[i]) {
|
|
1848
|
-
columns.headers[i] = [];
|
|
1849
|
-
}
|
|
1850
|
-
columns.headers[i].push(...h);
|
|
1851
|
-
});
|
|
1852
|
-
columns.props.push(...source.props);
|
|
1853
|
-
}
|
|
1854
|
-
return Object.assign({ data }, columns);
|
|
1855
|
-
}
|
|
1856
|
-
async getColPerSource(t) {
|
|
1857
|
-
const store = await this.revogrid.getColumnStore(t);
|
|
1858
|
-
const source = store.get('source');
|
|
1859
|
-
const virtualIndexes = store.get('items');
|
|
1860
|
-
const depth = store.get('groupingDepth');
|
|
1861
|
-
const groups = store.get('groups');
|
|
1862
|
-
const colNames = [];
|
|
1863
|
-
const colProps = [];
|
|
1864
|
-
const visibleItems = virtualIndexes.reduce((r, v, virtualIndex) => {
|
|
1865
|
-
const prop = source[v].prop;
|
|
1866
|
-
colNames.push(source[v].name || '');
|
|
1867
|
-
colProps.push(prop);
|
|
1868
|
-
r[prop] = virtualIndex;
|
|
1869
|
-
return r;
|
|
1870
|
-
}, {});
|
|
1871
|
-
const rows = this.getGroupHeaders(depth, groups, virtualIndexes, visibleItems);
|
|
1872
|
-
rows.push(colNames);
|
|
1873
|
-
return {
|
|
1874
|
-
headers: rows,
|
|
1875
|
-
props: colProps,
|
|
1876
|
-
};
|
|
1877
958
|
}
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
for (let d = 0; d < depth; d++) {
|
|
1882
|
-
const rgRow = [...template];
|
|
1883
|
-
rows.push(rgRow);
|
|
1884
|
-
if (!groups[d]) {
|
|
1885
|
-
continue;
|
|
1886
|
-
}
|
|
1887
|
-
const levelGroups = groups[d];
|
|
1888
|
-
// add names of groups
|
|
1889
|
-
levelGroups.forEach((group) => {
|
|
1890
|
-
const minIndex = this.findGroupStartIndex(group.ids, visibleItems);
|
|
1891
|
-
if (typeof minIndex === 'number') {
|
|
1892
|
-
rgRow[minIndex] = group.name;
|
|
1893
|
-
}
|
|
1894
|
-
});
|
|
959
|
+
getColumns(type = 'all') {
|
|
960
|
+
if (type !== 'all') {
|
|
961
|
+
return this.dataSources[type].store.get('source');
|
|
1895
962
|
}
|
|
1896
|
-
return
|
|
1897
|
-
|
|
1898
|
-
findGroupStartIndex(ids, visibleItems) {
|
|
1899
|
-
let min;
|
|
1900
|
-
ids.forEach(id => {
|
|
1901
|
-
const current = visibleItems[id];
|
|
1902
|
-
if (typeof current === 'number') {
|
|
1903
|
-
if (typeof min !== 'number' || min > current) {
|
|
1904
|
-
min = current;
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
});
|
|
1908
|
-
return min;
|
|
1909
|
-
}
|
|
1910
|
-
async getSource() {
|
|
1911
|
-
const data = [];
|
|
1912
|
-
const promisesData = [];
|
|
1913
|
-
rowTypes.forEach(t => {
|
|
1914
|
-
const dataPart = [];
|
|
1915
|
-
data.push(dataPart);
|
|
1916
|
-
const promise = this.revogrid.getVisibleSource(t).then((d) => dataPart.push(...d));
|
|
1917
|
-
promisesData.push(promise);
|
|
1918
|
-
});
|
|
1919
|
-
await Promise.all(promisesData);
|
|
1920
|
-
return data.reduce((r, v) => {
|
|
1921
|
-
r.push(...v);
|
|
963
|
+
return columnTypes.reduce((r, t) => {
|
|
964
|
+
r.push(...this.dataSources[t].store.get('source'));
|
|
1922
965
|
return r;
|
|
1923
966
|
}, []);
|
|
1924
967
|
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
switch (type) {
|
|
1928
|
-
case ExportTypes.csv:
|
|
1929
|
-
return new ExportCsv(options);
|
|
1930
|
-
default:
|
|
1931
|
-
throw new Error('Unknown format');
|
|
1932
|
-
}
|
|
968
|
+
getColumnIndexByProp(prop, type) {
|
|
969
|
+
return getSourceItemVirtualIndexByProp(this.dataSources[type].store, prop);
|
|
1933
970
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
function doCollapse(pIndex, source) {
|
|
1938
|
-
const model = source[pIndex];
|
|
1939
|
-
const collapseValue = model[PSEUDO_GROUP_ITEM_VALUE];
|
|
1940
|
-
const trimmed = {};
|
|
1941
|
-
let i = pIndex + 1;
|
|
1942
|
-
const total = source.length;
|
|
1943
|
-
while (i < total) {
|
|
1944
|
-
const currentModel = source[i];
|
|
1945
|
-
if (isGrouping(currentModel)) {
|
|
1946
|
-
const currentValue = currentModel[PSEUDO_GROUP_ITEM_VALUE];
|
|
1947
|
-
if (!currentValue.length || !currentValue.startsWith(collapseValue + ',')) {
|
|
1948
|
-
break;
|
|
1949
|
-
}
|
|
1950
|
-
currentModel[GROUP_EXPANDED] = false;
|
|
1951
|
-
}
|
|
1952
|
-
trimmed[i++] = true;
|
|
971
|
+
getColumnByProp(prop, type) {
|
|
972
|
+
const items = this.dataSources[type].store.get('source');
|
|
973
|
+
return find_1(items, { prop });
|
|
1953
974
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
*
|
|
1959
|
-
* @param pIndex - physical index
|
|
1960
|
-
* @param vIndex - virtual index, need to update item collection
|
|
1961
|
-
* @param source - data source
|
|
1962
|
-
* @param rowItemsIndexes - rgRow indexes
|
|
1963
|
-
*/
|
|
1964
|
-
function doExpand(vIndex, source, rowItemsIndexes) {
|
|
1965
|
-
const physicalIndex = rowItemsIndexes[vIndex];
|
|
1966
|
-
const model = source[physicalIndex];
|
|
1967
|
-
const currentGroup = getParsedGroup(model[PSEUDO_GROUP_ITEM_ID]);
|
|
1968
|
-
const trimmed = {};
|
|
1969
|
-
// no group found
|
|
1970
|
-
if (!currentGroup) {
|
|
1971
|
-
return { trimmed };
|
|
975
|
+
refreshByType(type) {
|
|
976
|
+
this.dataSources[type].refresh();
|
|
1972
977
|
}
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
978
|
+
setColumns(data) {
|
|
979
|
+
columnTypes.forEach(k => {
|
|
980
|
+
// set columns data
|
|
981
|
+
this.dataSources[k].updateData(data.columns[k], {
|
|
982
|
+
// max depth level
|
|
983
|
+
depth: data.maxLevel,
|
|
984
|
+
// groups
|
|
985
|
+
groups: data.columnGrouping[k].reduce((res, g) => {
|
|
986
|
+
if (!res[g.level]) {
|
|
987
|
+
res[g.level] = [];
|
|
988
|
+
}
|
|
989
|
+
res[g.level].push(g);
|
|
990
|
+
return res;
|
|
991
|
+
}, {}),
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
this.sorting = data.sort;
|
|
995
|
+
return data;
|
|
996
|
+
}
|
|
997
|
+
updateColumns(cols) {
|
|
998
|
+
// collect column by type and propert
|
|
999
|
+
const columnByKey = cols.reduce((res, c) => {
|
|
1000
|
+
const type = getColumnType(c);
|
|
1001
|
+
if (!res[type]) {
|
|
1002
|
+
res[type] = {};
|
|
1986
1003
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1004
|
+
res[type][c.prop] = c;
|
|
1005
|
+
return res;
|
|
1006
|
+
}, {});
|
|
1007
|
+
// find indexes in source
|
|
1008
|
+
const colByIndex = {};
|
|
1009
|
+
for (const t in columnByKey) {
|
|
1010
|
+
if (!columnByKey.hasOwnProperty(t)) {
|
|
1011
|
+
continue;
|
|
1012
|
+
}
|
|
1013
|
+
const type = t;
|
|
1014
|
+
const colsToUpdate = columnByKey[type];
|
|
1015
|
+
const items = this.dataSources[type].store.get('source');
|
|
1016
|
+
colByIndex[type] = {};
|
|
1017
|
+
for (let i = 0; i < items.length; i++) {
|
|
1018
|
+
const rgCol = items[i];
|
|
1019
|
+
const colToUpdateIfExists = colsToUpdate === null || colsToUpdate === void 0 ? void 0 : colsToUpdate[rgCol.prop];
|
|
1020
|
+
if (colToUpdateIfExists) {
|
|
1021
|
+
colByIndex[type][i] = colToUpdateIfExists;
|
|
1022
|
+
}
|
|
1990
1023
|
}
|
|
1991
1024
|
}
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1025
|
+
for (const t in colByIndex) {
|
|
1026
|
+
if (!colByIndex.hasOwnProperty(t)) {
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
const type = t;
|
|
1030
|
+
setSourceByVirtualIndex(this.dataSources[type].store, colByIndex[type] || {});
|
|
1996
1031
|
}
|
|
1997
|
-
i++;
|
|
1998
1032
|
}
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
if (groupItems.length) {
|
|
2003
|
-
const items = [...rowItemsIndexes];
|
|
2004
|
-
items.splice(vIndex + 1, 0, ...groupItems);
|
|
2005
|
-
result.items = items;
|
|
1033
|
+
updateColumn(column, index) {
|
|
1034
|
+
const type = getColumnType(column);
|
|
1035
|
+
setSourceByVirtualIndex(this.dataSources[type].store, { [index]: column });
|
|
2006
1036
|
}
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
const TRIMMED_GROUPING = 'grouping';
|
|
2011
|
-
/**
|
|
2012
|
-
* Prepare trimming updated indexes for grouping
|
|
2013
|
-
* @param initiallyTrimed
|
|
2014
|
-
* @param firstLevelMap
|
|
2015
|
-
* @param secondLevelMap
|
|
2016
|
-
*/
|
|
2017
|
-
function processDoubleConversionTrimmed(initiallyTrimed, firstLevelMap, secondLevelMap) {
|
|
2018
|
-
const trimemedOptionsToUpgrade = {};
|
|
2019
|
-
/**
|
|
2020
|
-
* go through all groups except grouping
|
|
2021
|
-
*/
|
|
2022
|
-
for (let type in initiallyTrimed) {
|
|
2023
|
-
if (type === TRIMMED_GROUPING) {
|
|
2024
|
-
continue;
|
|
1037
|
+
updateColumnSorting(column, index, sorting, additive) {
|
|
1038
|
+
if (!additive) {
|
|
1039
|
+
this.clearSorting();
|
|
2025
1040
|
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
/**
|
|
2030
|
-
* if item exists we find it in collection
|
|
2031
|
-
* we support 2 level of conversions
|
|
2032
|
-
*/
|
|
2033
|
-
let newConversionIndex = firstLevelMap[initialIndex];
|
|
2034
|
-
if (secondLevelMap) {
|
|
2035
|
-
newConversionIndex = secondLevelMap[newConversionIndex];
|
|
2036
|
-
}
|
|
2037
|
-
/**
|
|
2038
|
-
* if item was trimmed previously
|
|
2039
|
-
* trimming makes sense to apply
|
|
2040
|
-
*/
|
|
2041
|
-
if (items[initialIndex]) {
|
|
2042
|
-
newItems[newConversionIndex] = true;
|
|
2043
|
-
/**
|
|
2044
|
-
* If changes present apply changes to new source
|
|
2045
|
-
*/
|
|
2046
|
-
if (newConversionIndex !== parseInt(initialIndex, 10)) {
|
|
2047
|
-
trimemedOptionsToUpgrade[type] = newItems;
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
1041
|
+
column.order = sorting;
|
|
1042
|
+
if (!this.sorting) {
|
|
1043
|
+
this.sorting = {};
|
|
2050
1044
|
}
|
|
1045
|
+
this.sorting[column.prop] = column;
|
|
1046
|
+
this.updateColumn(column, index);
|
|
1047
|
+
return column;
|
|
1048
|
+
}
|
|
1049
|
+
clearSorting() {
|
|
1050
|
+
const types = reduce_1(this.sorting, (r, c) => {
|
|
1051
|
+
const k = getColumnType(c);
|
|
1052
|
+
r[k] = true;
|
|
1053
|
+
return r;
|
|
1054
|
+
}, {});
|
|
1055
|
+
each(types, (_, type) => {
|
|
1056
|
+
const cols = this.dataSources[type].store.get('source');
|
|
1057
|
+
each(cols, (c) => (c.order = undefined));
|
|
1058
|
+
this.dataSources[type].setData({ source: [...cols] });
|
|
1059
|
+
});
|
|
1060
|
+
this.sorting = {};
|
|
2051
1061
|
}
|
|
2052
|
-
return trimemedOptionsToUpgrade;
|
|
2053
1062
|
}
|
|
2054
1063
|
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
return this.store.get('items');
|
|
2066
|
-
}
|
|
2067
|
-
get trimmed() {
|
|
2068
|
-
return this.store.get('trimmed');
|
|
1064
|
+
/**
|
|
1065
|
+
* Data source provider
|
|
1066
|
+
*/
|
|
1067
|
+
class DataProvider {
|
|
1068
|
+
constructor(dimensionProvider) {
|
|
1069
|
+
this.dimensionProvider = dimensionProvider;
|
|
1070
|
+
this.stores = reduce_1(rowTypes, (sources, k) => {
|
|
1071
|
+
sources[k] = new DataStore(k);
|
|
1072
|
+
return sources;
|
|
1073
|
+
}, {});
|
|
2069
1074
|
}
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
this.
|
|
2073
|
-
|
|
1075
|
+
setData(data, type = 'rgRow', disableVirtualRows = false, grouping, silent = false) {
|
|
1076
|
+
// set rgRow data
|
|
1077
|
+
this.stores[type].updateData([...data], grouping, silent);
|
|
1078
|
+
// for pinned row no need virtual data
|
|
1079
|
+
const noVirtual = type !== 'rgRow' || disableVirtualRows;
|
|
1080
|
+
this.dimensionProvider.setData(data.length, type, noVirtual);
|
|
1081
|
+
return data;
|
|
2074
1082
|
}
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
e.preventDefault();
|
|
2079
|
-
}
|
|
1083
|
+
getModel(virtualIndex, type = 'rgRow') {
|
|
1084
|
+
const store = this.stores[type].store;
|
|
1085
|
+
return getSourceItem(store, virtualIndex);
|
|
2080
1086
|
}
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
const model = source[i];
|
|
2087
|
-
const prevExpanded = model[GROUP_EXPANDED];
|
|
2088
|
-
if (!prevExpanded) {
|
|
2089
|
-
const { trimmed, items } = doExpand(virtualIndex, source, this.rowItems);
|
|
2090
|
-
newTrimmed = Object.assign(Object.assign({}, newTrimmed), trimmed);
|
|
2091
|
-
if (items) {
|
|
2092
|
-
setItems(this.store, items);
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
else {
|
|
2096
|
-
const { trimmed } = doCollapse(i, source);
|
|
2097
|
-
newTrimmed = Object.assign(Object.assign({}, newTrimmed), trimmed);
|
|
2098
|
-
this.revogrid.clearFocus();
|
|
2099
|
-
}
|
|
2100
|
-
this.store.set('source', source);
|
|
2101
|
-
this.revogrid.addTrimmed(newTrimmed, TRIMMED_GROUPING);
|
|
1087
|
+
setCellData({ type, rowIndex, prop, val }, mutate = true) {
|
|
1088
|
+
const model = this.getModel(rowIndex, type);
|
|
1089
|
+
model[prop] = val;
|
|
1090
|
+
// apply data to source
|
|
1091
|
+
setSourceByVirtualIndex(this.stores[type].store, { [rowIndex]: model }, mutate);
|
|
2102
1092
|
}
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
return items.reduce((result, i) => {
|
|
2110
|
-
const model = source[i];
|
|
2111
|
-
if (!withoutGrouping) {
|
|
2112
|
-
result.source.push(model);
|
|
2113
|
-
return result;
|
|
2114
|
-
}
|
|
2115
|
-
// grouping filter
|
|
2116
|
-
if (isGrouping(model)) {
|
|
2117
|
-
if (model[GROUP_EXPANDED]) {
|
|
2118
|
-
result.prevExpanded[model[PSEUDO_GROUP_ITEM_VALUE]] = true;
|
|
2119
|
-
}
|
|
1093
|
+
setRangeData(data, type) {
|
|
1094
|
+
const items = {};
|
|
1095
|
+
for (let rowIndex in data) {
|
|
1096
|
+
const oldModel = (items[rowIndex] = getSourceItem(this.stores[type].store, parseInt(rowIndex, 10)));
|
|
1097
|
+
if (!oldModel) {
|
|
1098
|
+
continue;
|
|
2120
1099
|
}
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
result.oldNewIndexes[i] = index;
|
|
2124
|
-
index++;
|
|
1100
|
+
for (let prop in data[rowIndex]) {
|
|
1101
|
+
oldModel[prop] = data[rowIndex][prop];
|
|
2125
1102
|
}
|
|
2126
|
-
return result;
|
|
2127
|
-
}, {
|
|
2128
|
-
source: [],
|
|
2129
|
-
prevExpanded: {},
|
|
2130
|
-
oldNewIndexes: {},
|
|
2131
|
-
});
|
|
2132
|
-
}
|
|
2133
|
-
setColumnGrouping(cols) {
|
|
2134
|
-
// if 0 column as holder
|
|
2135
|
-
if (cols === null || cols === void 0 ? void 0 : cols.length) {
|
|
2136
|
-
cols[0][PSEUDO_GROUP_COLUMN] = true;
|
|
2137
|
-
return true;
|
|
2138
1103
|
}
|
|
2139
|
-
|
|
1104
|
+
// apply data to source
|
|
1105
|
+
setSourceByVirtualIndex(this.stores[type].store, items);
|
|
2140
1106
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
break;
|
|
2145
|
-
}
|
|
1107
|
+
refresh(type = 'all') {
|
|
1108
|
+
if (isRowType(type)) {
|
|
1109
|
+
this.refreshItems(type);
|
|
2146
1110
|
}
|
|
1111
|
+
rowTypes.forEach((t) => this.refreshItems(t));
|
|
2147
1112
|
}
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
const isDown = to - from >= 0;
|
|
2152
|
-
const { source } = this.getSource();
|
|
2153
|
-
const items = this.rowItems;
|
|
2154
|
-
let i = isDown ? from : to;
|
|
2155
|
-
const end = isDown ? to : from;
|
|
2156
|
-
for (; i < end; i++) {
|
|
2157
|
-
const model = source[items[i]];
|
|
2158
|
-
const isGroup = isGrouping(model);
|
|
2159
|
-
if (isGroup) {
|
|
2160
|
-
e.preventDefault();
|
|
2161
|
-
return;
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
1113
|
+
refreshItems(type = 'rgRow') {
|
|
1114
|
+
const items = this.stores[type].store.get('items');
|
|
1115
|
+
this.stores[type].setData({ items: [...items] });
|
|
2164
1116
|
}
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
1117
|
+
setGrouping({ depth }, type = 'rgRow') {
|
|
1118
|
+
this.stores[type].setData({ groupingDepth: depth });
|
|
1119
|
+
}
|
|
1120
|
+
setTrimmed(trimmed, type = 'rgRow') {
|
|
1121
|
+
const store = this.stores[type];
|
|
1122
|
+
store.addTrimmed(trimmed);
|
|
1123
|
+
this.dimensionProvider.setTrimmed(trimmed, type);
|
|
1124
|
+
if (type === 'rgRow') {
|
|
1125
|
+
this.dimensionProvider.setData(getVisibleSourceItem(store.store).length, type);
|
|
2174
1126
|
}
|
|
2175
1127
|
}
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
/**
|
|
2192
|
-
* Apply logic for focus inside of grouping
|
|
2193
|
-
* We can't focus on grouping rows, navigation only inside of groups for now
|
|
2194
|
-
*/
|
|
2195
|
-
this.addEventListener('beforecellfocus', e => this.onFocus(e));
|
|
2196
|
-
/**
|
|
2197
|
-
* Prevent rgRow drag outside the group
|
|
2198
|
-
*/
|
|
2199
|
-
this.addEventListener('roworderchanged', e => this.onDrag(e));
|
|
2200
|
-
/**
|
|
2201
|
-
* When grouping expand icon was clicked
|
|
2202
|
-
*/
|
|
2203
|
-
this.addEventListener(GROUP_EXPAND_EVENT, ({ detail }) => this.onExpand(detail));
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* Dimension provider
|
|
1132
|
+
* Stores dimension information and custom sizes
|
|
1133
|
+
*/
|
|
1134
|
+
class DimensionProvider {
|
|
1135
|
+
constructor(viewports, config) {
|
|
1136
|
+
this.viewports = viewports;
|
|
1137
|
+
const sizeChanged = debounce_1((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
|
|
1138
|
+
this.stores = reduce_1([...rowTypes, ...columnTypes], (sources, k) => {
|
|
1139
|
+
sources[k] = new DimensionStore();
|
|
1140
|
+
sources[k].store.onChange('realSize', () => sizeChanged(k));
|
|
1141
|
+
return sources;
|
|
1142
|
+
}, {});
|
|
2204
1143
|
}
|
|
2205
1144
|
/**
|
|
2206
|
-
*
|
|
2207
|
-
*
|
|
1145
|
+
* Clear old sizes from dimension and viewports
|
|
1146
|
+
* @param type - dimension type
|
|
1147
|
+
* @param count - count of items
|
|
2208
1148
|
*/
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
1149
|
+
clearSize(t, count) {
|
|
1150
|
+
this.stores[t].drop();
|
|
1151
|
+
// after we done with drop trigger viewport recalculaction
|
|
1152
|
+
this.viewports.stores[t].setOriginalSizes(this.stores[t].store.get('originItemSize'));
|
|
1153
|
+
this.setItemCount(count, t);
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Apply new custom sizes to dimension and view port
|
|
1157
|
+
* @param type - dimension type
|
|
1158
|
+
* @param sizes - new custom sizes
|
|
1159
|
+
* @param keepOld - keep old sizes merge new with old
|
|
1160
|
+
*/
|
|
1161
|
+
setCustomSizes(type, sizes, keepOld = false) {
|
|
1162
|
+
let newSizes = sizes;
|
|
1163
|
+
if (keepOld) {
|
|
1164
|
+
const oldSizes = this.stores[type].store.get('sizes');
|
|
1165
|
+
newSizes = Object.assign(Object.assign({}, oldSizes), sizes);
|
|
2213
1166
|
}
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
* Group again
|
|
2221
|
-
* @param oldNewIndexMap - provides us mapping with new indexes vs old indexes
|
|
2222
|
-
*/
|
|
2223
|
-
const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], Object.assign({ prevExpanded }, options));
|
|
2224
|
-
// setup source
|
|
2225
|
-
this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer: options === null || options === void 0 ? void 0 : options.groupLabelTemplate }, true);
|
|
2226
|
-
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes !== null && oldNewIndexes !== void 0 ? oldNewIndexes : {}, oldNewIndexMap);
|
|
1167
|
+
this.stores[type].setDimensionSize(newSizes);
|
|
1168
|
+
this.updateViewport(type, true);
|
|
1169
|
+
}
|
|
1170
|
+
setItemCount(realCount, type) {
|
|
1171
|
+
this.viewports.stores[type].setViewport({ realCount });
|
|
1172
|
+
this.stores[type].setStore({ count: realCount });
|
|
2227
1173
|
}
|
|
2228
1174
|
/**
|
|
2229
|
-
* Apply
|
|
2230
|
-
*
|
|
2231
|
-
*
|
|
1175
|
+
* Apply trimmed items
|
|
1176
|
+
* @param trimmed - trimmed items
|
|
1177
|
+
* @param type
|
|
2232
1178
|
*/
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
1179
|
+
setTrimmed(trimmed, type) {
|
|
1180
|
+
const allTrimmed = gatherTrimmedItems(trimmed);
|
|
1181
|
+
const dimStoreType = this.stores[type];
|
|
1182
|
+
dimStoreType.setStore({ trimmed: allTrimmed });
|
|
1183
|
+
this.updateViewport(type, true);
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Sets dimension data and view port coordinate
|
|
1187
|
+
* @param itemCount
|
|
1188
|
+
* @param type - dimension type
|
|
1189
|
+
* @param noVirtual - disable virtual data
|
|
1190
|
+
*/
|
|
1191
|
+
setData(itemCount, type, noVirtual = false) {
|
|
1192
|
+
this.setItemCount(itemCount, type);
|
|
1193
|
+
// Virtualization will get disabled
|
|
1194
|
+
if (noVirtual) {
|
|
1195
|
+
const dimension = this.stores[type].getCurrentState();
|
|
1196
|
+
this.viewports.stores[type].setViewport({
|
|
1197
|
+
virtualSize: dimension.realSize,
|
|
1198
|
+
});
|
|
2237
1199
|
}
|
|
2238
|
-
|
|
2239
|
-
const expanded = this.revogrid.grouping || {};
|
|
2240
|
-
const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], Object.assign({}, (expanded || {})));
|
|
2241
|
-
data.source = sourceWithGroups;
|
|
2242
|
-
this.providers.data.setGrouping({ depth });
|
|
2243
|
-
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexMap);
|
|
1200
|
+
this.updateViewport(type);
|
|
2244
1201
|
}
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
1202
|
+
applyNewColumns(columns, disableVirtualX) {
|
|
1203
|
+
for (let type of columnTypes) {
|
|
1204
|
+
// clear existing data
|
|
1205
|
+
this.stores[type].drop();
|
|
1206
|
+
const items = columns[type];
|
|
1207
|
+
// for pinned col no need virtual data
|
|
1208
|
+
const noVirtual = type !== 'rgCol' || disableVirtualX;
|
|
1209
|
+
// setItemCount
|
|
1210
|
+
this.stores[type].setStore({ count: items.length });
|
|
1211
|
+
// setCustomSizes
|
|
1212
|
+
const newSizes = getColumnSizes(items);
|
|
1213
|
+
this.stores[type].setDimensionSize(newSizes);
|
|
1214
|
+
const vpUpdate = {
|
|
1215
|
+
// this triggers drop on realCount change
|
|
1216
|
+
realCount: items.length,
|
|
1217
|
+
};
|
|
1218
|
+
// Virtualization will get disabled
|
|
1219
|
+
if (noVirtual) {
|
|
1220
|
+
vpUpdate.virtualSize = this.stores[type].getCurrentState().realSize;
|
|
1221
|
+
}
|
|
1222
|
+
this.viewports.stores[type].setViewport(vpUpdate);
|
|
1223
|
+
this.setViewPortCoordinate({
|
|
1224
|
+
coordinate: this.viewports.stores[type].lastCoordinate,
|
|
1225
|
+
type,
|
|
1226
|
+
});
|
|
2254
1227
|
}
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
1228
|
+
}
|
|
1229
|
+
getFullSize() {
|
|
1230
|
+
var _a, _b;
|
|
1231
|
+
let x = 0;
|
|
1232
|
+
let y = 0;
|
|
1233
|
+
for (let type of columnTypes) {
|
|
1234
|
+
x += ((_a = this.stores[type]) === null || _a === void 0 ? void 0 : _a.store.get('realSize')) || 0;
|
|
2259
1235
|
}
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
if (this.setColumnGrouping(this.providers.column.getColumns(t))) {
|
|
2263
|
-
this.providers.column.refreshByType(t);
|
|
2264
|
-
break;
|
|
2265
|
-
}
|
|
1236
|
+
for (let type of rowTypes) {
|
|
1237
|
+
y += ((_b = this.stores[type]) === null || _b === void 0 ? void 0 : _b.store.get('realSize')) || 0;
|
|
2266
1238
|
}
|
|
2267
|
-
|
|
2268
|
-
this.subscribe();
|
|
1239
|
+
return { y, x };
|
|
2269
1240
|
}
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
let deleted = false;
|
|
2276
|
-
cols.forEach(c => {
|
|
2277
|
-
if (isGroupingColumn(c)) {
|
|
2278
|
-
delete c[PSEUDO_GROUP_COLUMN];
|
|
2279
|
-
deleted = true;
|
|
2280
|
-
}
|
|
2281
|
-
});
|
|
2282
|
-
// if column store had grouping clear and refresh
|
|
2283
|
-
if (deleted) {
|
|
2284
|
-
this.providers.column.refreshByType(t);
|
|
2285
|
-
}
|
|
1241
|
+
updateViewport(type, force = false) {
|
|
1242
|
+
this.setViewPortCoordinate({
|
|
1243
|
+
coordinate: this.viewports.stores[type].lastCoordinate,
|
|
1244
|
+
type,
|
|
1245
|
+
force,
|
|
2286
1246
|
});
|
|
2287
|
-
// clear rows
|
|
2288
|
-
const { source, oldNewIndexes } = this.getSource(true);
|
|
2289
|
-
this.providers.data.setData(source, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, undefined, true);
|
|
2290
|
-
this.updateTrimmed(undefined, undefined, oldNewIndexes);
|
|
2291
1247
|
}
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
1248
|
+
setViewPortCoordinate({ coordinate, type, force = false, }) {
|
|
1249
|
+
const dimension = this.stores[type].getCurrentState();
|
|
1250
|
+
this.viewports.stores[type].setViewPortCoordinate(coordinate, dimension, force);
|
|
1251
|
+
}
|
|
1252
|
+
getViewPortPos(e) {
|
|
1253
|
+
const dimension = this.stores[e.dimension].getCurrentState();
|
|
1254
|
+
const item = getItemByIndex(dimension, e.coordinate);
|
|
1255
|
+
return item.start;
|
|
1256
|
+
}
|
|
1257
|
+
setSettings(data, dimensionType) {
|
|
1258
|
+
let stores = [];
|
|
1259
|
+
switch (dimensionType) {
|
|
1260
|
+
case 'rgCol':
|
|
1261
|
+
stores = columnTypes;
|
|
1262
|
+
break;
|
|
1263
|
+
case 'rgRow':
|
|
1264
|
+
stores = rowTypes;
|
|
1265
|
+
break;
|
|
2297
1266
|
}
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
1267
|
+
for (let s of stores) {
|
|
1268
|
+
this.stores[s].setStore(data);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
class ViewportProvider {
|
|
1274
|
+
constructor() {
|
|
1275
|
+
this.stores = reduce_1([...rowTypes, ...columnTypes], (sources, k) => {
|
|
1276
|
+
sources[k] = new ViewportStore(k);
|
|
1277
|
+
return sources;
|
|
1278
|
+
}, {});
|
|
1279
|
+
}
|
|
1280
|
+
setViewport(type, data) {
|
|
1281
|
+
this.stores[type].setViewport(data);
|
|
2301
1282
|
}
|
|
2302
1283
|
}
|
|
2303
1284
|
|
|
@@ -2652,95 +1633,6 @@ const OrderRenderer = ({ ref }) => {
|
|
|
2652
1633
|
h("div", { class: "drag-position", ref: e => (service.rgRow = e) })));
|
|
2653
1634
|
};
|
|
2654
1635
|
|
|
2655
|
-
class StretchColumn extends BasePlugin {
|
|
2656
|
-
constructor(revogrid, providers) {
|
|
2657
|
-
super(revogrid, providers);
|
|
2658
|
-
this.providers = providers;
|
|
2659
|
-
this.stretchedColumn = null;
|
|
2660
|
-
// calculate scroll bar size for current user session
|
|
2661
|
-
this.scrollSize = getScrollbarSize(document);
|
|
2662
|
-
// subscribe to column changes
|
|
2663
|
-
const beforecolumnapplied = ({ detail: { columns }, }) => this.applyStretch(columns);
|
|
2664
|
-
this.addEventListener('beforecolumnapplied', beforecolumnapplied);
|
|
2665
|
-
}
|
|
2666
|
-
setScroll({ type, hasScroll }) {
|
|
2667
|
-
var _a;
|
|
2668
|
-
if (type === 'rgRow' &&
|
|
2669
|
-
this.stretchedColumn &&
|
|
2670
|
-
((_a = this.stretchedColumn) === null || _a === void 0 ? void 0 : _a.initialSize) === this.stretchedColumn.size) {
|
|
2671
|
-
if (hasScroll) {
|
|
2672
|
-
this.stretchedColumn.size -= this.scrollSize;
|
|
2673
|
-
this.apply();
|
|
2674
|
-
this.dropChanges();
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
}
|
|
2678
|
-
activateChanges() {
|
|
2679
|
-
const setScroll = ({ detail }) => this.setScroll(detail);
|
|
2680
|
-
this.addEventListener('scrollchange', setScroll);
|
|
2681
|
-
}
|
|
2682
|
-
dropChanges() {
|
|
2683
|
-
this.stretchedColumn = null;
|
|
2684
|
-
this.removeEventListener('scrollchange');
|
|
2685
|
-
}
|
|
2686
|
-
apply() {
|
|
2687
|
-
if (!this.stretchedColumn) {
|
|
2688
|
-
return;
|
|
2689
|
-
}
|
|
2690
|
-
const type = 'rgCol';
|
|
2691
|
-
const sizes = this.providers.dimension.stores[type].store.get('sizes');
|
|
2692
|
-
this.providers.dimension.setCustomSizes(type, Object.assign(Object.assign({}, sizes), { [this.stretchedColumn.index]: this.stretchedColumn.size }), true);
|
|
2693
|
-
}
|
|
2694
|
-
/**
|
|
2695
|
-
* Apply stretch changes
|
|
2696
|
-
*/
|
|
2697
|
-
applyStretch(columns) {
|
|
2698
|
-
// unsubscribe from all events
|
|
2699
|
-
this.dropChanges();
|
|
2700
|
-
// calculate grid size
|
|
2701
|
-
let sizeDifference = this.revogrid.clientWidth - 1;
|
|
2702
|
-
each(columns, (_, type) => {
|
|
2703
|
-
const realSize = this.providers.dimension.stores[type].store.get('realSize');
|
|
2704
|
-
sizeDifference -= realSize;
|
|
2705
|
-
});
|
|
2706
|
-
if (this.revogrid.rowHeaders) {
|
|
2707
|
-
const itemsLength = this.providers.data.stores.rgRow.store.get('source').length;
|
|
2708
|
-
const header = this.revogrid.rowHeaders;
|
|
2709
|
-
const rowHeaderSize = calculateRowHeaderSize(itemsLength, typeof header === 'object' ? header : undefined);
|
|
2710
|
-
if (rowHeaderSize) {
|
|
2711
|
-
sizeDifference -= rowHeaderSize;
|
|
2712
|
-
}
|
|
2713
|
-
}
|
|
2714
|
-
if (sizeDifference > 0) {
|
|
2715
|
-
// currently plugin accepts last column only
|
|
2716
|
-
const index = columns.rgCol.length - 1;
|
|
2717
|
-
const last = columns.rgCol[index];
|
|
2718
|
-
/**
|
|
2719
|
-
* has column
|
|
2720
|
-
* no auto size applied
|
|
2721
|
-
* size for column shouldn't be defined
|
|
2722
|
-
*/
|
|
2723
|
-
const colSize = (last === null || last === void 0 ? void 0 : last.size) || this.revogrid.colSize || 0;
|
|
2724
|
-
const size = sizeDifference + colSize - 1;
|
|
2725
|
-
if (last && !last.autoSize && colSize < size) {
|
|
2726
|
-
this.stretchedColumn = {
|
|
2727
|
-
initialSize: size,
|
|
2728
|
-
index,
|
|
2729
|
-
size,
|
|
2730
|
-
};
|
|
2731
|
-
this.apply();
|
|
2732
|
-
this.activateChanges();
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
/**
|
|
2738
|
-
* Check plugin type is Stretch
|
|
2739
|
-
*/
|
|
2740
|
-
function isStretchPlugin(plugin) {
|
|
2741
|
-
return !!plugin.applyStretch;
|
|
2742
|
-
}
|
|
2743
|
-
|
|
2744
1636
|
const rowDefinitionByType = (newVal = []) => {
|
|
2745
1637
|
const result = {};
|
|
2746
1638
|
for (const v of newVal) {
|
|
@@ -2771,228 +1663,6 @@ const rowDefinitionRemoveByType = (oldVal = []) => {
|
|
|
2771
1663
|
return result;
|
|
2772
1664
|
};
|
|
2773
1665
|
|
|
2774
|
-
const COLUMN_DRAG_CLASS = 'column-drag-start';
|
|
2775
|
-
class ColumnOrderHandler {
|
|
2776
|
-
constructor() {
|
|
2777
|
-
this.offset = 0;
|
|
2778
|
-
}
|
|
2779
|
-
renderAutoscroll(_, parent) {
|
|
2780
|
-
if (!parent) {
|
|
2781
|
-
return;
|
|
2782
|
-
}
|
|
2783
|
-
this.autoscrollEl = document.createElement('div');
|
|
2784
|
-
this.autoscrollEl.classList.add('drag-auto-scroll-y');
|
|
2785
|
-
parent.appendChild(this.autoscrollEl);
|
|
2786
|
-
}
|
|
2787
|
-
autoscroll(pos, dataContainerSize, direction = 'translateX') {
|
|
2788
|
-
if (!this.autoscrollEl) {
|
|
2789
|
-
return;
|
|
2790
|
-
}
|
|
2791
|
-
const helperOffset = 10;
|
|
2792
|
-
// calculate current y position inside of the grid active holder
|
|
2793
|
-
// 3 - size of element + border
|
|
2794
|
-
const maxScroll = Math.min(pos + helperOffset, dataContainerSize - 3);
|
|
2795
|
-
this.autoscrollEl.style.transform = `${direction}(${maxScroll}px)`;
|
|
2796
|
-
this.autoscrollEl.scrollIntoView({
|
|
2797
|
-
block: 'nearest',
|
|
2798
|
-
inline: 'nearest',
|
|
2799
|
-
});
|
|
2800
|
-
}
|
|
2801
|
-
start(e, { dataEl, gridRect, scrollEl, gridEl }, dir = 'left') {
|
|
2802
|
-
gridEl.classList.add(COLUMN_DRAG_CLASS);
|
|
2803
|
-
const scrollContainerRect = scrollEl.getBoundingClientRect();
|
|
2804
|
-
if (scrollContainerRect) {
|
|
2805
|
-
this.offset = scrollContainerRect[dir] - gridRect[dir];
|
|
2806
|
-
}
|
|
2807
|
-
this.renderAutoscroll(e, dataEl);
|
|
2808
|
-
}
|
|
2809
|
-
stop(gridEl) {
|
|
2810
|
-
var _a;
|
|
2811
|
-
gridEl.classList.remove(COLUMN_DRAG_CLASS);
|
|
2812
|
-
if (this.element) {
|
|
2813
|
-
this.element.hidden = true;
|
|
2814
|
-
}
|
|
2815
|
-
this.offset = 0;
|
|
2816
|
-
(_a = this.autoscrollEl) === null || _a === void 0 ? void 0 : _a.remove();
|
|
2817
|
-
this.autoscrollEl = undefined;
|
|
2818
|
-
}
|
|
2819
|
-
showHandler(pos, size, direction = 'translateX') {
|
|
2820
|
-
if (!this.element) {
|
|
2821
|
-
return;
|
|
2822
|
-
}
|
|
2823
|
-
// do not allow overcross top of the scrollable area, header excluded
|
|
2824
|
-
if (this.offset) {
|
|
2825
|
-
pos = Math.max(pos, this.offset);
|
|
2826
|
-
}
|
|
2827
|
-
// can not be bigger then grid end
|
|
2828
|
-
pos = Math.min(pos, size);
|
|
2829
|
-
this.element.style.transform = `${direction}(${pos}px)`;
|
|
2830
|
-
this.element.hidden = false;
|
|
2831
|
-
}
|
|
2832
|
-
render() {
|
|
2833
|
-
const el = this.element = document.createElement('div');
|
|
2834
|
-
el.classList.add('drag-position-y');
|
|
2835
|
-
el.hidden = true;
|
|
2836
|
-
return el;
|
|
2837
|
-
}
|
|
2838
|
-
}
|
|
2839
|
-
|
|
2840
|
-
/**
|
|
2841
|
-
* Plugin for column manual move
|
|
2842
|
-
*/
|
|
2843
|
-
const COLUMN_CLICK = ON_COLUMN_CLICK;
|
|
2844
|
-
const MOVE = 'columndragmousemove';
|
|
2845
|
-
const DRAG_END = 'columndragend';
|
|
2846
|
-
const BEFORE_DRAG_END = 'beforecolumndragend';
|
|
2847
|
-
// use this event subscription to drop D&D for particular columns
|
|
2848
|
-
const DRAG_START = 'columndragstart';
|
|
2849
|
-
class ColumnPlugin extends BasePlugin {
|
|
2850
|
-
constructor(revogrid, providers) {
|
|
2851
|
-
super(revogrid, providers);
|
|
2852
|
-
this.revogrid = revogrid;
|
|
2853
|
-
this.providers = providers;
|
|
2854
|
-
this.moveFunc = debounce_1((e) => this.doMove(e), 5);
|
|
2855
|
-
this.staticDragData = null;
|
|
2856
|
-
this.dragData = null;
|
|
2857
|
-
this.localSubscriptions = {};
|
|
2858
|
-
this.orderUi = new ColumnOrderHandler();
|
|
2859
|
-
revogrid.appendChild(this.orderUi.render());
|
|
2860
|
-
revogrid.classList.add('column-draggable');
|
|
2861
|
-
// Register events
|
|
2862
|
-
this.localSubscriptions['mouseleave'] = {
|
|
2863
|
-
target: document,
|
|
2864
|
-
callback: (e) => this.onMouseOut(e),
|
|
2865
|
-
};
|
|
2866
|
-
this.localSubscriptions['mouseup'] = {
|
|
2867
|
-
target: document,
|
|
2868
|
-
callback: (e) => this.onMouseUp(e),
|
|
2869
|
-
};
|
|
2870
|
-
this.localSubscriptions['mousemove'] = {
|
|
2871
|
-
target: document,
|
|
2872
|
-
callback: (e) => this.move(e),
|
|
2873
|
-
};
|
|
2874
|
-
this.addEventListener(COLUMN_CLICK, ({ detail }) => this.dragStart(detail));
|
|
2875
|
-
}
|
|
2876
|
-
dragStart({ event, data }) {
|
|
2877
|
-
if (event.defaultPrevented) {
|
|
2878
|
-
return;
|
|
2879
|
-
}
|
|
2880
|
-
const { defaultPrevented } = dispatch(this.revogrid, DRAG_START, data);
|
|
2881
|
-
// check if allowed to drag particulat column
|
|
2882
|
-
if (defaultPrevented) {
|
|
2883
|
-
return;
|
|
2884
|
-
}
|
|
2885
|
-
this.clearOrder();
|
|
2886
|
-
const { mouseleave, mouseup, mousemove } = this.localSubscriptions;
|
|
2887
|
-
mouseleave.target.addEventListener('mouseleave', mouseleave.callback);
|
|
2888
|
-
mouseup.target.addEventListener('mouseup', mouseup.callback);
|
|
2889
|
-
const dataEl = event.target.closest('revogr-header');
|
|
2890
|
-
const scrollEl = event.target.closest('revogr-viewport-scroll');
|
|
2891
|
-
if (!dataEl || !scrollEl) {
|
|
2892
|
-
return;
|
|
2893
|
-
}
|
|
2894
|
-
// no grouping drag and no row header column drag
|
|
2895
|
-
if (isColGrouping(data) || data.providers.type === 'rowHeaders') {
|
|
2896
|
-
return;
|
|
2897
|
-
}
|
|
2898
|
-
const cols = this.getDimension(data.pin || 'rgCol');
|
|
2899
|
-
const gridRect = this.revogrid.getBoundingClientRect();
|
|
2900
|
-
const elRect = dataEl.getBoundingClientRect();
|
|
2901
|
-
const startItem = getItemByPosition(cols, getLeftRelative(event.x, gridRect.left, elRect.left - gridRect.left));
|
|
2902
|
-
this.staticDragData = {
|
|
2903
|
-
startPos: event.x,
|
|
2904
|
-
startItem,
|
|
2905
|
-
data,
|
|
2906
|
-
dataEl,
|
|
2907
|
-
scrollEl,
|
|
2908
|
-
gridEl: this.revogrid,
|
|
2909
|
-
cols,
|
|
2910
|
-
};
|
|
2911
|
-
this.dragData = this.getData(this.staticDragData);
|
|
2912
|
-
mousemove.target.addEventListener('mousemove', mousemove.callback);
|
|
2913
|
-
this.orderUi.start(event, Object.assign(Object.assign({}, this.dragData), this.staticDragData));
|
|
2914
|
-
}
|
|
2915
|
-
doMove(e) {
|
|
2916
|
-
if (!this.staticDragData) {
|
|
2917
|
-
return;
|
|
2918
|
-
}
|
|
2919
|
-
const dragData = (this.dragData = this.getData(this.staticDragData));
|
|
2920
|
-
if (!dragData) {
|
|
2921
|
-
return;
|
|
2922
|
-
}
|
|
2923
|
-
const start = this.staticDragData.startPos;
|
|
2924
|
-
if (Math.abs(start - e.x) > 10) {
|
|
2925
|
-
const x = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
|
|
2926
|
-
const rgCol = getItemByPosition(this.staticDragData.cols, x);
|
|
2927
|
-
this.orderUi.autoscroll(x, dragData.elRect.width);
|
|
2928
|
-
this.orderUi.showHandler(rgCol.end + dragData.scrollOffset, dragData.gridRect.width);
|
|
2929
|
-
}
|
|
2930
|
-
}
|
|
2931
|
-
move(e) {
|
|
2932
|
-
dispatch(this.revogrid, MOVE, e);
|
|
2933
|
-
// then do move
|
|
2934
|
-
this.moveFunc(e);
|
|
2935
|
-
}
|
|
2936
|
-
onMouseOut(_) {
|
|
2937
|
-
this.clearOrder();
|
|
2938
|
-
}
|
|
2939
|
-
onMouseUp(e) {
|
|
2940
|
-
// apply new positions
|
|
2941
|
-
if (this.dragData && this.staticDragData) {
|
|
2942
|
-
let relativePos = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
|
|
2943
|
-
if (relativePos < 0) {
|
|
2944
|
-
relativePos = 0;
|
|
2945
|
-
}
|
|
2946
|
-
const newPosition = getItemByPosition(this.staticDragData.cols, relativePos);
|
|
2947
|
-
const store = this.providers.column.stores[this.dragData.type].store;
|
|
2948
|
-
const items = [...store.get('items')];
|
|
2949
|
-
// prevent position change if needed
|
|
2950
|
-
const { defaultPrevented: stopDrag } = dispatch(this.revogrid, BEFORE_DRAG_END, Object.assign(Object.assign({}, this.staticDragData), { startPosition: this.staticDragData.startItem, newPosition, newItem: store.get('source')[items[this.staticDragData.startItem.itemIndex]] }));
|
|
2951
|
-
if (!stopDrag) {
|
|
2952
|
-
// todo: if move item out of group remove item from group
|
|
2953
|
-
const toMove = items.splice(this.staticDragData.startItem.itemIndex, 1);
|
|
2954
|
-
items.splice(newPosition.itemIndex, 0, ...toMove);
|
|
2955
|
-
store.set('items', items);
|
|
2956
|
-
}
|
|
2957
|
-
dispatch(this.revogrid, DRAG_END, this.dragData);
|
|
2958
|
-
}
|
|
2959
|
-
this.clearOrder();
|
|
2960
|
-
}
|
|
2961
|
-
clearLocalSubscriptions() {
|
|
2962
|
-
each(this.localSubscriptions, ({ target, callback }, key) => target.removeEventListener(key, callback));
|
|
2963
|
-
}
|
|
2964
|
-
clearOrder() {
|
|
2965
|
-
this.staticDragData = null;
|
|
2966
|
-
this.dragData = null;
|
|
2967
|
-
this.clearLocalSubscriptions();
|
|
2968
|
-
this.orderUi.stop(this.revogrid);
|
|
2969
|
-
}
|
|
2970
|
-
/**
|
|
2971
|
-
* Clearing subscription
|
|
2972
|
-
*/
|
|
2973
|
-
clearSubscriptions() {
|
|
2974
|
-
super.clearSubscriptions();
|
|
2975
|
-
this.clearLocalSubscriptions();
|
|
2976
|
-
}
|
|
2977
|
-
getData({ gridEl, dataEl, data, }) {
|
|
2978
|
-
const gridRect = gridEl.getBoundingClientRect();
|
|
2979
|
-
const elRect = dataEl.getBoundingClientRect();
|
|
2980
|
-
const scrollOffset = elRect.left - gridRect.left;
|
|
2981
|
-
return {
|
|
2982
|
-
elRect,
|
|
2983
|
-
gridRect,
|
|
2984
|
-
type: data.pin || 'rgCol',
|
|
2985
|
-
scrollOffset,
|
|
2986
|
-
};
|
|
2987
|
-
}
|
|
2988
|
-
getDimension(type) {
|
|
2989
|
-
return this.providers.dimension.stores[type].getCurrentState();
|
|
2990
|
-
}
|
|
2991
|
-
}
|
|
2992
|
-
function getLeftRelative(absoluteX, gridPos, offset) {
|
|
2993
|
-
return absoluteX - gridPos - offset;
|
|
2994
|
-
}
|
|
2995
|
-
|
|
2996
1666
|
function isMobileDevice() {
|
|
2997
1667
|
return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;
|
|
2998
1668
|
}
|
|
@@ -3072,7 +1742,7 @@ class WCAGPlugin extends BasePlugin {
|
|
|
3072
1742
|
}
|
|
3073
1743
|
}
|
|
3074
1744
|
|
|
3075
|
-
const revoGridStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037;border:1px solid #00772d}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:1px solid #cedefa;line-height:32px;background:none;color:#000;box-shadow:none}revo-grid[theme=default],revo-grid:not([theme]){border:1px solid #cecece;font-size:12px}revo-grid[theme=default] revogr-header,revo-grid:not([theme]) revogr-header{text-align:center;line-height:30px;background-color:#f8f9fa}revo-grid[theme=default] revogr-header .group-rgRow,revo-grid:not([theme]) revogr-header .group-rgRow{box-shadow:none}revo-grid[theme=default] revogr-header .header-rgRow,revo-grid[theme=default] revogr-header .group-rgRow,revo-grid:not([theme]) revogr-header .header-rgRow,revo-grid:not([theme]) revogr-header .group-rgRow{text-transform:uppercase;font-size:12px;color:#000}revo-grid[theme=default] revogr-header .header-rgRow,revo-grid:not([theme]) revogr-header .header-rgRow{height:30px;box-shadow:0 -1px 0 0 #cecece inset}revo-grid[theme=default] revogr-header .rgHeaderCell,revo-grid:not([theme]) revogr-header .rgHeaderCell{box-shadow:-1px 0 0 0 #cecece inset, 0 -1px 0 0 #cecece, 0 -1px 0 0 #cecece inset}revo-grid[theme=default] revogr-header .rgHeaderCell.focused-cell,revo-grid:not([theme]) revogr-header .rgHeaderCell.focused-cell{background:rgba(233, 234, 237, 0.5)}revo-grid[theme=default] .rowHeaders,revo-grid:not([theme]) .rowHeaders{background-color:#f8f9fa}revo-grid[theme=default] .rowHeaders revogr-data .rgCell,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell{color:#000}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:first-child,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:first-child{box-shadow:0 -1px 0 0 #cecece inset}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:not(:first-child),revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:not(:first-child){box-shadow:0 -1px 0 0 #cecece inset, 1px 0 0 0 #cecece inset}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:last-child,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:last-child{border-right:1px solid #cecece}revo-grid[theme=default] .rowHeaders revogr-data revogr-header,revo-grid:not([theme]) .rowHeaders revogr-data revogr-header{box-shadow:0 -1px 0 0 #cecece inset}revo-grid[theme=default] revogr-viewport-scroll.colPinStart revogr-data .rgRow .rgCell:last-child,revo-grid:not([theme]) revogr-viewport-scroll.colPinStart revogr-data .rgRow .rgCell:last-child{box-shadow:0 -1px 0 0 #e2e3e3 inset, -1px 0 0 0 #cecece inset}revo-grid[theme=default] revogr-viewport-scroll.colPinStart .footer-wrapper revogr-data .rgRow:first-child .rgCell,revo-grid:not([theme]) revogr-viewport-scroll.colPinStart .footer-wrapper revogr-data .rgRow:first-child .rgCell{box-shadow:0 1px 0 0 #cecece inset, -1px 0 0 0 #cecece inset}revo-grid[theme=default] revogr-viewport-scroll.colPinEnd,revo-grid[theme=default] revogr-viewport-scroll.colPinEnd revogr-header,revo-grid:not([theme]) revogr-viewport-scroll.colPinEnd,revo-grid:not([theme]) revogr-viewport-scroll.colPinEnd revogr-header{box-shadow:1px 0 0 #cecece inset}revo-grid[theme=default] .footer-wrapper revogr-data .rgRow:first-child .rgCell,revo-grid:not([theme]) .footer-wrapper revogr-data .rgRow:first-child .rgCell{box-shadow:0 1px 0 0 #e2e3e3 inset, -1px 0 0 0 #e2e3e3 inset, 0 -1px 0 0 #e2e3e3 inset}revo-grid[theme=default] revogr-data,revo-grid:not([theme]) revogr-data{text-align:center}revo-grid[theme=default] revogr-data .revo-draggable,revo-grid:not([theme]) revogr-data .revo-draggable{float:left}revo-grid[theme=default] revogr-data .rgRow,revo-grid:not([theme]) revogr-data .rgRow{line-height:27px}revo-grid[theme=default] revogr-data .rgRow.focused-rgRow,revo-grid:not([theme]) revogr-data .rgRow.focused-rgRow{background-color:rgba(233, 234, 237, 0.5)}revo-grid[theme=default] revogr-data .rgCell,revo-grid:not([theme]) revogr-data .rgCell{box-shadow:0 -1px 0 0 #e2e3e3 inset, -1px 0 0 0 #e2e3e3 inset}revo-grid[theme=default] revogr-data .rgCell.disabled,revo-grid:not([theme]) revogr-data .rgCell.disabled{background-color:0 -1px 0 0 #e2e3e3 inset, -1px 0 0 0 #e2e3e3 inset}revo-grid[theme=material]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=material] revogr-header{line-height:50px;font-weight:600;text-align:left}revo-grid[theme=material] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=material] revogr-header .header-rgRow{height:50px}revo-grid[theme=material] revogr-data{text-align:left}revo-grid[theme=material] revogr-data .rgRow{line-height:42px}revo-grid[theme=material] revogr-data .rgCell{padding:0 15px}revo-grid[theme=material] .rowHeaders{background-color:#f7faff}revo-grid[theme=material] .rowHeaders revogr-data .rgCell{color:#757a82}revo-grid[theme=material] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #f1f1f1, 0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-header .rgHeaderCell.sortable:hover{background-color:#f1f1f1}revo-grid[theme=material] revogr-header .rgHeaderCell.focused-cell{background:rgba(233, 234, 237, 0.5)}revo-grid[theme=material] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #f1f1f1}revo-grid[theme=material] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #f1f1f1}revo-grid[theme=material] revogr-data .rgRow{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-data .rgRow.focused-rgRow{background-color:rgba(233, 234, 237, 0.5)}revo-grid[theme=material] revogr-data .rgCell{color:rgba(0, 0, 0, 0.87)}revo-grid[theme=material] revogr-data .rgCell.disabled{background-color:#f7f7f7}revo-grid[theme=darkMaterial]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#d8d8d8}revo-grid[theme=darkMaterial] revogr-header{line-height:50px;font-weight:600;text-align:left}revo-grid[theme=darkMaterial] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=darkMaterial] revogr-header .header-rgRow{height:50px}revo-grid[theme=darkMaterial] revogr-data{text-align:left}revo-grid[theme=darkMaterial] revogr-data .rgRow{line-height:42px}revo-grid[theme=darkMaterial] revogr-data .rgCell{padding:0 15px}revo-grid[theme=darkMaterial] .rowHeaders{background-color:rgba(40, 39, 43, 0.8)}revo-grid[theme=darkMaterial] .rowHeaders revogr-data .rgCell{color:rgba(216, 216, 216, 0.8)}revo-grid[theme=darkMaterial] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #404040, 0 -1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-header .rgHeaderCell.sortable:hover{background-color:rgba(64, 64, 64, 0.5)}revo-grid[theme=darkMaterial] revogr-header .rgHeaderCell.focused-cell{background:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkMaterial] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #404040}revo-grid[theme=darkMaterial] revogr-data .rgCell{color:rgba(216, 216, 216, 0.9)}revo-grid[theme=darkMaterial] revogr-data .rgRow{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-data .rgRow.focused-rgRow{background-color:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkMaterial] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #404040}revo-grid[theme=darkCompact]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#d8d8d8}revo-grid[theme=darkCompact] revogr-header{line-height:45px;font-weight:600;text-align:left}revo-grid[theme=darkCompact] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=darkCompact] revogr-header .header-rgRow{height:45px}revo-grid[theme=darkCompact] revogr-data{text-align:left}revo-grid[theme=darkCompact] revogr-data .rgRow{line-height:32px}revo-grid[theme=darkCompact] revogr-data .rgCell{padding:0 15px}revo-grid[theme=darkCompact] .rowHeaders{background-color:rgba(40, 39, 43, 0.8)}revo-grid[theme=darkCompact] .rowHeaders revogr-data .rgCell{color:rgba(216, 216, 216, 0.8)}revo-grid[theme=darkCompact] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #404040, 0 -1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-header .rgHeaderCell.sortable:hover{background-color:rgba(64, 64, 64, 0.5)}revo-grid[theme=darkCompact] revogr-header .rgHeaderCell.focused-cell{background:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkCompact] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #404040}revo-grid[theme=darkCompact] revogr-data .rgCell{color:rgba(216, 216, 216, 0.9)}revo-grid[theme=darkCompact] revogr-data .rgRow{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-data .rgRow.focused-rgRow{background-color:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkCompact] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #404040}revo-grid[theme=compact]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=compact] revogr-header{line-height:45px;font-weight:600;text-align:left}revo-grid[theme=compact] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=compact] revogr-header .header-rgRow{height:45px}revo-grid[theme=compact] revogr-data{text-align:left}revo-grid[theme=compact] revogr-data .rgRow{line-height:32px}revo-grid[theme=compact] revogr-data .rgCell{padding:0 15px}revo-grid[theme=compact] .rowHeaders{background-color:#f7faff}revo-grid[theme=compact] .rowHeaders revogr-data .rgCell{color:#757a82}revo-grid[theme=compact] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #f1f1f1, 0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-header .rgHeaderCell.sortable:hover{background-color:#f1f1f1}revo-grid[theme=compact] revogr-header .rgHeaderCell.focused-cell{background:rgba(233, 234, 237, 0.5)}revo-grid[theme=compact] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #f1f1f1}revo-grid[theme=compact] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #f1f1f1}revo-grid[theme=compact] revogr-data .rgRow{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-data .rgRow.focused-rgRow{background-color:rgba(233, 234, 237, 0.5)}revo-grid[theme=compact] revogr-data .rgCell{color:rgba(0, 0, 0, 0.87)}revo-grid[theme=compact] revogr-data .rgCell.disabled{background-color:#f7f7f7}revo-grid[theme=compact] revo-dropdown .rv-dr-root{padding:0px 9px}revo-grid{display:block;height:100%;min-height:300px;font-family:Helvetica, Arial, Sans-Serif, serif;font-size:14px;position:relative;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column;width:100%;height:100%}revo-grid .attribution{position:absolute;top:0;left:0;right:0;z-index:100;width:0;height:0;border-left:4px solid rgba(38, 106, 232, 0.6);border-top:4px solid rgba(38, 106, 232, 0.6);border-bottom:4px solid transparent;border-right:4px solid transparent;cursor:pointer}revo-grid .attribution .value{position:absolute;top:0;left:0;background-color:rgba(255, 255, 255, 0.9);padding:4px;border-radius:4px;box-shadow:0 1px 10px rgba(0, 0, 0, 0.2);white-space:nowrap;text-decoration:none;color:black;letter-spacing:0.3px;font-size:11px;opacity:0;width:4px;overflow:hidden;transition:opacity 0.5s ease-in-out, width 0.3s ease-in-out}revo-grid .attribution:hover .value{width:63px;opacity:1}revo-grid.column-draggable.column-drag-start:hover,revo-grid.column-draggable.column-drag-start *:hover{cursor:grabbing}revo-grid .footer-wrapper,revo-grid .header-wrapper{width:100%}revo-grid .footer-wrapper revogr-data,revo-grid .header-wrapper revogr-data{z-index:3}revo-grid revo-dropdown{width:100%}revo-grid revo-dropdown .rv-dr-root{max-height:100%}revo-grid revo-dropdown.shrink label{opacity:0}revo-grid .viewports{max-width:100%;display:flex;flex-direction:row;align-items:flex-start;flex-grow:1}revo-grid .main-viewport{flex-grow:1;height:0;display:flex;justify-content:space-between;flex-direction:row}revo-grid .draggable{position:fixed;height:30px;line-height:30px;background:#fff;border-radius:3px;display:block;z-index:100;margin-top:5px;margin-right:-20px;box-shadow:0 4px 20px 0 rgba(0, 0, 0, 0.15);padding-left:20px;padding-right:5px}revo-grid .draggable.hidden{display:none}revo-grid .draggable .revo-alt-icon{background-color:black;position:absolute;left:5px;top:10px}revo-grid .draggable-wrapper.hidden{display:none}revo-grid .drag-position{position:absolute;left:0;right:0;height:1px;z-index:2;background:gray;pointer-events:none}revo-grid .drag-position-y{position:absolute;top:0;left:0;bottom:0;width:1px;z-index:2;background:gray;pointer-events:none}revo-grid .drag-auto-scroll-y{pointer-events:none;position:absolute;left:0;top:0;height:50px;width:1px}revo-grid .clipboard{position:absolute;left:0;top:0}revo-grid revogr-scroll-virtual{position:relative}revo-grid revogr-scroll-virtual.vertical,revo-grid revogr-scroll-virtual.horizontal{z-index:3}";
|
|
1745
|
+
const revoGridStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037;border:1px solid #00772d}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:1px solid #cedefa;line-height:32px;background:none;color:#000;box-shadow:none}revo-grid[theme=default],revo-grid:not([theme]){border:1px solid #cecece;font-size:12px}revo-grid[theme=default] revogr-header,revo-grid:not([theme]) revogr-header{text-align:center;line-height:30px;background-color:#f8f9fa}revo-grid[theme=default] revogr-header .group-rgRow,revo-grid:not([theme]) revogr-header .group-rgRow{box-shadow:none}revo-grid[theme=default] revogr-header .header-rgRow,revo-grid[theme=default] revogr-header .group-rgRow,revo-grid:not([theme]) revogr-header .header-rgRow,revo-grid:not([theme]) revogr-header .group-rgRow{text-transform:uppercase;font-size:12px;color:#000}revo-grid[theme=default] revogr-header .header-rgRow,revo-grid:not([theme]) revogr-header .header-rgRow{height:30px;box-shadow:0 -1px 0 0 #cecece inset}revo-grid[theme=default] revogr-header .rgHeaderCell,revo-grid:not([theme]) revogr-header .rgHeaderCell{box-shadow:-1px 0 0 0 #cecece inset, 0 -1px 0 0 #cecece, 0 -1px 0 0 #cecece inset}revo-grid[theme=default] revogr-header .rgHeaderCell.focused-cell,revo-grid:not([theme]) revogr-header .rgHeaderCell.focused-cell{background:rgba(233, 234, 237, 0.5)}revo-grid[theme=default] .rowHeaders,revo-grid:not([theme]) .rowHeaders{background-color:#f8f9fa}revo-grid[theme=default] .rowHeaders revogr-data .rgCell,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell{color:#000}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:first-child,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:first-child{box-shadow:0 -1px 0 0 #cecece inset}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:not(:first-child),revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:not(:first-child){box-shadow:0 -1px 0 0 #cecece inset, 1px 0 0 0 #cecece inset}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:last-child,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:last-child{border-right:1px solid #cecece}revo-grid[theme=default] .rowHeaders revogr-data revogr-header,revo-grid:not([theme]) .rowHeaders revogr-data revogr-header{box-shadow:0 -1px 0 0 #cecece inset}revo-grid[theme=default] revogr-viewport-scroll.colPinStart revogr-data .rgRow .rgCell:last-child,revo-grid:not([theme]) revogr-viewport-scroll.colPinStart revogr-data .rgRow .rgCell:last-child{box-shadow:0 -1px 0 0 #e2e3e3 inset, -1px 0 0 0 #cecece inset}revo-grid[theme=default] revogr-viewport-scroll.colPinStart .footer-wrapper revogr-data .rgRow:first-child .rgCell,revo-grid:not([theme]) revogr-viewport-scroll.colPinStart .footer-wrapper revogr-data .rgRow:first-child .rgCell{box-shadow:0 1px 0 0 #cecece inset, -1px 0 0 0 #cecece inset}revo-grid[theme=default] revogr-viewport-scroll.colPinEnd,revo-grid[theme=default] revogr-viewport-scroll.colPinEnd revogr-header,revo-grid:not([theme]) revogr-viewport-scroll.colPinEnd,revo-grid:not([theme]) revogr-viewport-scroll.colPinEnd revogr-header{box-shadow:1px 0 0 #cecece inset}revo-grid[theme=default] .footer-wrapper revogr-data .rgRow:first-child .rgCell,revo-grid:not([theme]) .footer-wrapper revogr-data .rgRow:first-child .rgCell{box-shadow:0 1px 0 0 #e2e3e3 inset, -1px 0 0 0 #e2e3e3 inset, 0 -1px 0 0 #e2e3e3 inset}revo-grid[theme=default] revogr-data,revo-grid:not([theme]) revogr-data{text-align:center}revo-grid[theme=default] revogr-data .revo-draggable,revo-grid:not([theme]) revogr-data .revo-draggable{float:left}revo-grid[theme=default] revogr-data .rgRow,revo-grid:not([theme]) revogr-data .rgRow{line-height:27px}revo-grid[theme=default] revogr-data .rgRow.focused-rgRow,revo-grid:not([theme]) revogr-data .rgRow.focused-rgRow{background-color:rgba(233, 234, 237, 0.5)}revo-grid[theme=default] revogr-data .rgCell,revo-grid:not([theme]) revogr-data .rgCell{box-shadow:0 -1px 0 0 #e2e3e3 inset, -1px 0 0 0 #e2e3e3 inset}revo-grid[theme=default] revogr-data .rgCell.disabled,revo-grid:not([theme]) revogr-data .rgCell.disabled{background-color:0 -1px 0 0 #e2e3e3 inset, -1px 0 0 0 #e2e3e3 inset}revo-grid[theme=material]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=material] revogr-header{line-height:50px;font-weight:600;text-align:left}revo-grid[theme=material] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=material] revogr-header .header-rgRow{height:50px}revo-grid[theme=material] revogr-data{text-align:left}revo-grid[theme=material] revogr-data .rgRow{line-height:42px}revo-grid[theme=material] revogr-data .rgCell{padding:0 15px}revo-grid[theme=material] .rowHeaders{background-color:#f7faff}revo-grid[theme=material] .rowHeaders revogr-data .rgCell{color:#757a82}revo-grid[theme=material] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #f1f1f1, 0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-header .rgHeaderCell.sortable:hover{background-color:#f1f1f1}revo-grid[theme=material] revogr-header .rgHeaderCell.focused-cell{background:rgba(233, 234, 237, 0.5)}revo-grid[theme=material] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #f1f1f1}revo-grid[theme=material] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #f1f1f1}revo-grid[theme=material] revogr-data .rgRow{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=material] revogr-data .rgRow.focused-rgRow{background-color:rgba(233, 234, 237, 0.5)}revo-grid[theme=material] revogr-data .rgCell{color:rgba(0, 0, 0, 0.87)}revo-grid[theme=material] revogr-data .rgCell.disabled{background-color:#f7f7f7}revo-grid[theme=darkMaterial]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#d8d8d8}revo-grid[theme=darkMaterial] revogr-header{line-height:50px;font-weight:600;text-align:left}revo-grid[theme=darkMaterial] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=darkMaterial] revogr-header .header-rgRow{height:50px}revo-grid[theme=darkMaterial] revogr-data{text-align:left}revo-grid[theme=darkMaterial] revogr-data .rgRow{line-height:42px}revo-grid[theme=darkMaterial] revogr-data .rgCell{padding:0 15px}revo-grid[theme=darkMaterial] .rowHeaders{background-color:rgba(40, 39, 43, 0.8)}revo-grid[theme=darkMaterial] .rowHeaders revogr-data .rgCell{color:rgba(216, 216, 216, 0.8)}revo-grid[theme=darkMaterial] revogr-edit{background-color:#28272b}revo-grid[theme=darkMaterial] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #404040, 0 -1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-header .rgHeaderCell.sortable:hover{background-color:rgba(64, 64, 64, 0.5)}revo-grid[theme=darkMaterial] revogr-header .rgHeaderCell.focused-cell{background:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkMaterial] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #404040}revo-grid[theme=darkMaterial] revogr-data .rgCell{color:rgba(216, 216, 216, 0.9)}revo-grid[theme=darkMaterial] revogr-data .rgRow{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-data .rgRow.focused-rgRow{background-color:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkMaterial] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #404040 inset}revo-grid[theme=darkMaterial] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #404040}revo-grid[theme=darkCompact]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#d8d8d8}revo-grid[theme=darkCompact] revogr-header{line-height:45px;font-weight:600;text-align:left}revo-grid[theme=darkCompact] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=darkCompact] revogr-header .header-rgRow{height:45px}revo-grid[theme=darkCompact] revogr-data{text-align:left}revo-grid[theme=darkCompact] revogr-data .rgRow{line-height:32px}revo-grid[theme=darkCompact] revogr-data .rgCell{padding:0 15px}revo-grid[theme=darkCompact] .rowHeaders{background-color:rgba(40, 39, 43, 0.8)}revo-grid[theme=darkCompact] .rowHeaders revogr-data .rgCell{color:rgba(216, 216, 216, 0.8)}revo-grid[theme=darkCompact] revogr-edit{background-color:#28272b}revo-grid[theme=darkCompact] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #404040, 0 -1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-header .rgHeaderCell.sortable:hover{background-color:rgba(64, 64, 64, 0.5)}revo-grid[theme=darkCompact] revogr-header .rgHeaderCell.focused-cell{background:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkCompact] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #404040}revo-grid[theme=darkCompact] revogr-data .rgCell{color:rgba(216, 216, 216, 0.9)}revo-grid[theme=darkCompact] revogr-data .rgRow{box-shadow:0 -1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-data .rgRow.focused-rgRow{background-color:rgba(115, 148, 160, 0.15)}revo-grid[theme=darkCompact] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #404040 inset}revo-grid[theme=darkCompact] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #404040}revo-grid[theme=compact]{font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=compact] revogr-header{line-height:45px;font-weight:600;text-align:left}revo-grid[theme=compact] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=compact] revogr-header .header-rgRow{height:45px}revo-grid[theme=compact] revogr-data{text-align:left}revo-grid[theme=compact] revogr-data .rgRow{line-height:32px}revo-grid[theme=compact] revogr-data .rgCell{padding:0 15px}revo-grid[theme=compact] .rowHeaders{background-color:#f7faff}revo-grid[theme=compact] .rowHeaders revogr-data .rgCell{color:#757a82}revo-grid[theme=compact] revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 #f1f1f1, 0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-header .rgHeaderCell.sortable:hover{background-color:#f1f1f1}revo-grid[theme=compact] revogr-header .rgHeaderCell.focused-cell{background:rgba(233, 234, 237, 0.5)}revo-grid[theme=compact] .footer-wrapper revogr-data{box-shadow:0 -1px 0 #f1f1f1}revo-grid[theme=compact] revogr-viewport-scroll.colPinStart{box-shadow:-1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-viewport-scroll.colPinEnd{box-shadow:-1px 0 0 #f1f1f1}revo-grid[theme=compact] revogr-data .rgRow{box-shadow:0 -1px 0 0 #f1f1f1 inset}revo-grid[theme=compact] revogr-data .rgRow.focused-rgRow{background-color:rgba(233, 234, 237, 0.5)}revo-grid[theme=compact] revogr-data .rgCell{color:rgba(0, 0, 0, 0.87)}revo-grid[theme=compact] revogr-data .rgCell.disabled{background-color:#f7f7f7}revo-grid[theme=compact] revo-dropdown .rv-dr-root{padding:0px 9px}revo-grid{display:block;height:100%;min-height:300px;font-family:Helvetica, Arial, Sans-Serif, serif;font-size:14px;position:relative;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column;width:100%;height:100%}revo-grid .attribution{position:absolute;top:0;left:0;right:0;z-index:100;width:0;height:0;border-left:4px solid rgba(38, 106, 232, 0.6);border-top:4px solid rgba(38, 106, 232, 0.6);border-bottom:4px solid transparent;border-right:4px solid transparent;cursor:pointer}revo-grid .attribution .value{position:absolute;top:0;left:0;background-color:rgba(255, 255, 255, 0.9);padding:4px;border-radius:4px;box-shadow:0 1px 10px rgba(0, 0, 0, 0.2);white-space:nowrap;text-decoration:none;color:black;letter-spacing:0.3px;font-size:11px;opacity:0;width:4px;overflow:hidden;transition:opacity 0.5s ease-in-out, width 0.3s ease-in-out}revo-grid .attribution:hover .value{width:63px;opacity:1}revo-grid.column-draggable.column-drag-start:hover,revo-grid.column-draggable.column-drag-start *:hover{cursor:grabbing}revo-grid .footer-wrapper,revo-grid .header-wrapper{width:100%}revo-grid .footer-wrapper revogr-data,revo-grid .header-wrapper revogr-data{z-index:3}revo-grid revo-dropdown{width:100%}revo-grid revo-dropdown .rv-dr-root{max-height:100%}revo-grid revo-dropdown.shrink label{opacity:0}revo-grid .viewports{max-width:100%;display:flex;flex-direction:row;align-items:flex-start;flex-grow:1}revo-grid .main-viewport{flex-grow:1;height:0;display:flex;justify-content:space-between;flex-direction:row}revo-grid .draggable{position:fixed;height:30px;line-height:30px;background:#fff;border-radius:3px;display:block;z-index:100;margin-top:5px;margin-right:-20px;box-shadow:0 4px 20px 0 rgba(0, 0, 0, 0.15);padding-left:20px;padding-right:5px}revo-grid .draggable.hidden{display:none}revo-grid .draggable .revo-alt-icon{background-color:black;position:absolute;left:5px;top:10px}revo-grid .draggable-wrapper.hidden{display:none}revo-grid .drag-position{position:absolute;left:0;right:0;height:1px;z-index:2;background:gray;pointer-events:none}revo-grid .drag-position-y{position:absolute;top:0;left:0;bottom:0;width:1px;z-index:2;background:gray;pointer-events:none}revo-grid .drag-auto-scroll-y{pointer-events:none;position:absolute;left:0;top:0;height:50px;width:1px}revo-grid .clipboard{position:absolute;left:0;top:0}revo-grid revogr-scroll-virtual{position:relative}revo-grid revogr-scroll-virtual.vertical,revo-grid revogr-scroll-virtual.horizontal{z-index:3}";
|
|
3076
1746
|
const RevoGridStyle0 = revoGridStyleCss;
|
|
3077
1747
|
|
|
3078
1748
|
const RevoGridComponent = class {
|