@revolist/revogrid 4.26.2 → 4.27.0
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/{cell-renderer-Cf2Pu4S0.js → cell-renderer-C7rdgaov.js} +3 -3
- package/dist/cjs/{column.service-C7p5eC5V.js → column.service-Bbml5C2j.js} +3 -3
- package/dist/cjs/{dimension.helpers-CgHhnN1d.js → dimension.helpers-CptesQOZ.js} +52 -8
- package/dist/cjs/{edit.utils-rAcGublN.js → edit.utils-CBAbQhGP.js} +1 -1
- package/dist/cjs/{header-cell-renderer-DHClfIto.js → header-cell-renderer-BljFI6wj.js} +1 -1
- package/dist/cjs/{index--FdNLz1Z.js → index-BVESmpqW.js} +1 -1
- package/dist/cjs/index.cjs.js +71 -55
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +74 -49
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +51 -19
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +4 -4
- package/dist/cjs/revogr-data_4.cjs.entry.js +21 -15
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +9 -9
- package/dist/cjs/{column.drag.plugin-CK5HADlW.js → row-resize.plugin-BRQy_qNn.js} +573 -19
- package/dist/cjs/{text-editor-F04kTx53.js → text-editor-CJyQaYei.js} +2 -2
- package/dist/cjs/{throttle-fV6BUmM7.js → throttle-BsaP4fgu.js} +3 -3
- package/dist/cjs/{viewport.store-B4Clk4m9.js → viewport.store-mhsdi61t.js} +1 -1
- package/dist/collection/components/data/revogr-data-style.css +11 -0
- package/dist/collection/components/data/revogr-data.js +14 -8
- package/dist/collection/components/header/revogr-header-style.css +1 -0
- package/dist/collection/components/overlay/keyboard.service.js +33 -3
- package/dist/collection/components/overlay/revogr-overlay-selection.js +12 -10
- package/dist/collection/components/revoGrid/plugin.service.js +2 -2
- package/dist/collection/components/revoGrid/revo-grid.js +44 -10
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js +24 -13
- package/dist/collection/components/revoGrid/viewport.service.js +1 -1
- package/dist/collection/plugins/filter/filter.constants.js +9 -0
- package/dist/collection/plugins/filter/filter.panel.js +8 -8
- package/dist/collection/plugins/filter/filter.plugin.js +109 -10
- package/dist/collection/plugins/filter/filter.style.css +2 -0
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +9 -2
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +1 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js +1 -1
- package/dist/collection/plugins/index.js +1 -0
- package/dist/collection/plugins/row-resize/index.js +6 -0
- package/dist/collection/plugins/row-resize/row-resize.plugin.js +385 -0
- package/dist/collection/plugins/row-resize/row-resize.types.js +1 -0
- package/dist/collection/plugins/row-resize/row-resize.utils.js +55 -0
- package/dist/collection/serve/controller.js +1 -1
- package/dist/collection/services/data.provider.js +8 -2
- package/dist/collection/services/local.scroll.timer.js +3 -3
- package/dist/collection/services/selection.store.connector.js +4 -2
- package/dist/collection/store/dataSource/data.pending.plugin.js +21 -0
- package/dist/collection/store/dataSource/data.store.js +25 -3
- package/dist/collection/store/dataSource/trimmed.plugin.js +9 -6
- package/dist/collection/store/dimension/dimension.trim.plugin.js +1 -3
- package/dist/collection/types/events.js +4 -1
- package/dist/collection/utils/column.utils.js +1 -1
- package/dist/esm/{cell-renderer-11cf-lu3.js → cell-renderer-BFpmdV8H.js} +3 -3
- package/dist/esm/{column.service-Cfw3L0PN.js → column.service-CM-wgGs8.js} +3 -3
- package/dist/{revo-grid/dimension.helpers-fl4HSSK9.js → esm/dimension.helpers-Cln9sALu.js} +52 -9
- package/dist/{revo-grid/edit.utils-4e9fsqOR.js → esm/edit.utils-3ZbhQCv_.js} +1 -1
- package/dist/esm/{header-cell-renderer-Cqtg1ETB.js → header-cell-renderer-Bqh1PrgH.js} +1 -1
- package/dist/esm/{index-D24ku9ej.js → index-BvMNbQyq.js} +1 -1
- package/dist/esm/index.js +14 -11
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +56 -31
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +51 -19
- package/dist/esm/revogr-clipboard_3.entry.js +4 -4
- package/dist/esm/revogr-data_4.entry.js +21 -15
- package/dist/esm/revogr-filter-panel.entry.js +9 -9
- package/dist/esm/{column.drag.plugin-DDBKeTGI.js → row-resize.plugin-BRiaHlHA.js} +562 -20
- package/dist/{revo-grid/text-editor-DlMnLkRK.js → esm/text-editor-eHtrwvxH.js} +2 -2
- package/dist/{revo-grid/throttle-Cpk1LoGk.js → esm/throttle-3rhqdcLy.js} +3 -3
- package/dist/{revo-grid/viewport.store-BSXmsiZc.js → esm/viewport.store-DWMKRDSH.js} +1 -1
- package/dist/revo-grid/{cell-renderer-11cf-lu3.js → cell-renderer-BFpmdV8H.js} +3 -3
- package/dist/revo-grid/{column.service-Cfw3L0PN.js → column.service-CM-wgGs8.js} +3 -3
- package/dist/{esm/dimension.helpers-fl4HSSK9.js → revo-grid/dimension.helpers-Cln9sALu.js} +52 -9
- package/dist/{esm/edit.utils-4e9fsqOR.js → revo-grid/edit.utils-3ZbhQCv_.js} +1 -1
- package/dist/revo-grid/{header-cell-renderer-Cqtg1ETB.js → header-cell-renderer-Bqh1PrgH.js} +1 -1
- package/dist/revo-grid/{index-D24ku9ej.js → index-BvMNbQyq.js} +1 -1
- package/dist/revo-grid/index.esm.js +14 -11
- package/dist/revo-grid/revo-grid.entry.js +56 -31
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +51 -19
- package/dist/revo-grid/revogr-clipboard_3.entry.js +4 -4
- package/dist/revo-grid/revogr-data_4.entry.js +21 -15
- package/dist/revo-grid/revogr-filter-panel.entry.js +9 -9
- package/dist/revo-grid/{column.drag.plugin-DDBKeTGI.js → row-resize.plugin-BRiaHlHA.js} +562 -20
- package/dist/{esm/text-editor-DlMnLkRK.js → revo-grid/text-editor-eHtrwvxH.js} +2 -2
- package/dist/{esm/throttle-Cpk1LoGk.js → revo-grid/throttle-3rhqdcLy.js} +3 -3
- package/dist/{esm/viewport.store-BSXmsiZc.js → revo-grid/viewport.store-DWMKRDSH.js} +1 -1
- package/dist/types/components/data/revogr-data.d.ts +1 -0
- package/dist/types/components/overlay/keyboard.service.d.ts +6 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +3 -1
- package/dist/types/components/revoGrid/revo-grid.d.ts +7 -1
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +3 -1
- package/dist/types/components.d.ts +23 -10
- package/dist/types/plugins/filter/filter.constants.d.ts +6 -0
- package/dist/types/plugins/filter/filter.plugin.d.ts +15 -0
- package/dist/types/plugins/index.d.ts +1 -0
- package/dist/types/plugins/row-resize/index.d.ts +3 -0
- package/dist/types/plugins/row-resize/row-resize.plugin.d.ts +44 -0
- package/dist/types/plugins/row-resize/row-resize.types.d.ts +40 -0
- package/dist/types/plugins/row-resize/row-resize.utils.d.ts +14 -0
- package/dist/types/services/data.provider.d.ts +2 -0
- package/dist/types/store/dataSource/data.pending.plugin.d.ts +9 -0
- package/dist/types/store/dataSource/data.store.d.ts +10 -0
- package/dist/types/store/dataSource/trimmed.plugin.d.ts +5 -0
- package/dist/types/types/events.d.ts +1 -1
- package/dist/types/types/interfaces.d.ts +3 -1
- package/hydrate/index.js +734 -85
- package/hydrate/index.mjs +734 -85
- package/package.json +1 -1
- package/readme.md +4 -1
- package/standalone/column.service.js +1 -1
- package/standalone/data.store.js +1 -1
- package/standalone/dimension.helpers.js +1 -1
- package/standalone/index.js +1 -1
- package/standalone/local.scroll.timer.js +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-data2.js +1 -1
- package/standalone/revogr-filter-panel.js +1 -1
- package/standalone/revogr-header2.js +1 -1
- package/standalone/revogr-overlay-selection2.js +1 -1
- package/standalone/revogr-row-headers2.js +1 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var edit_utils = require('./edit.utils-
|
|
7
|
-
var index = require('./index
|
|
6
|
+
var edit_utils = require('./edit.utils-CBAbQhGP.js');
|
|
7
|
+
var index = require('./index-BVESmpqW.js');
|
|
8
8
|
|
|
9
9
|
class TextEditor {
|
|
10
10
|
constructor(data, saveCallback) {
|
|
@@ -197,7 +197,7 @@ class LocalScrollTimer {
|
|
|
197
197
|
* Remember last mw event time
|
|
198
198
|
*/
|
|
199
199
|
latestScrollUpdate(dimension) {
|
|
200
|
-
this.mouseWheelScrollTimestamp[dimension] =
|
|
200
|
+
this.mouseWheelScrollTimestamp[dimension] = Date.now();
|
|
201
201
|
}
|
|
202
202
|
isReady(type, coordinate) {
|
|
203
203
|
// if there is a callback, clear it
|
|
@@ -208,7 +208,7 @@ class LocalScrollTimer {
|
|
|
208
208
|
return this.verifyChange(type, coordinate);
|
|
209
209
|
}
|
|
210
210
|
verifyChange(type, coordinate) {
|
|
211
|
-
const now =
|
|
211
|
+
const now = Date.now();
|
|
212
212
|
const change = now - this.mouseWheelScrollTimestamp[type];
|
|
213
213
|
return change > this.scrollThrottling &&
|
|
214
214
|
coordinate !== this.lastKnownScrollCoordinate[type];
|
|
@@ -226,7 +226,7 @@ class LocalScrollTimer {
|
|
|
226
226
|
// save lastScrollUpdate callback
|
|
227
227
|
const callback = this.lastScrollUpdateCallbacks[type] = {
|
|
228
228
|
callback: lastScrollUpdate,
|
|
229
|
-
timestamp:
|
|
229
|
+
timestamp: Date.now(),
|
|
230
230
|
coordinate,
|
|
231
231
|
timeout: 0,
|
|
232
232
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var dimension_helpers = require('./dimension.helpers-
|
|
6
|
+
var dimension_helpers = require('./dimension.helpers-CptesQOZ.js');
|
|
7
7
|
|
|
8
8
|
const LETTER_BLOCK_SIZE = 10;
|
|
9
9
|
const calculateRowHeaderSize = (itemsLength, rowHeaderColumn, minWidth = 50) => {
|
|
@@ -44,6 +44,17 @@ revogr-data .rgRow {
|
|
|
44
44
|
width: 100%;
|
|
45
45
|
left: 0;
|
|
46
46
|
}
|
|
47
|
+
revogr-data .rgRow > .row-resize-handle {
|
|
48
|
+
position: absolute;
|
|
49
|
+
z-index: 2;
|
|
50
|
+
right: 0;
|
|
51
|
+
bottom: -3px;
|
|
52
|
+
left: 0;
|
|
53
|
+
height: 7px;
|
|
54
|
+
cursor: row-resize;
|
|
55
|
+
touch-action: none;
|
|
56
|
+
user-select: none;
|
|
57
|
+
}
|
|
47
58
|
revogr-data .rgRow.groupingRow {
|
|
48
59
|
font-weight: 600;
|
|
49
60
|
text-align: left;
|
|
@@ -113,7 +113,10 @@ export class RevogrData {
|
|
|
113
113
|
groupingCellRenderer, additionalData: this.additionalData,
|
|
114
114
|
// Only show expand button if grouping is enabled and not in row headers
|
|
115
115
|
hasExpand: this.columnService.hasGrouping && this.colType !== 'rowHeaders', columnItems: cols, providers: this.providers });
|
|
116
|
-
|
|
116
|
+
const row = h(GroupingRowRenderer, Object.assign({}, gmodel));
|
|
117
|
+
this.triggerBeforeRowRender(row, rgRow, dataItem);
|
|
118
|
+
rowsEls.push(row);
|
|
119
|
+
this.renderedRows.set(rgRow.itemIndex, row);
|
|
117
120
|
continue;
|
|
118
121
|
}
|
|
119
122
|
// #endregion
|
|
@@ -162,19 +165,22 @@ export class RevogrData {
|
|
|
162
165
|
rowClass += ` ${ROW_FOCUSED_CLASS}`;
|
|
163
166
|
}
|
|
164
167
|
const row = (h(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start - rowRenderOffset, groupingLevel: groupDepth || undefined }, cells));
|
|
165
|
-
this.
|
|
166
|
-
node: row,
|
|
167
|
-
item: rgRow,
|
|
168
|
-
model: dataItem,
|
|
169
|
-
colType: this.columnService.type,
|
|
170
|
-
rowType: this.type,
|
|
171
|
-
});
|
|
168
|
+
this.triggerBeforeRowRender(row, rgRow, dataItem);
|
|
172
169
|
rowsEls.push(row);
|
|
173
170
|
this.renderedRows.set(rgRow.itemIndex, row);
|
|
174
171
|
// #endregion
|
|
175
172
|
}
|
|
176
173
|
return (h(Host, null, h("slot", null), rowsEls));
|
|
177
174
|
}
|
|
175
|
+
triggerBeforeRowRender(node, item, model) {
|
|
176
|
+
this.beforerowrender.emit({
|
|
177
|
+
node,
|
|
178
|
+
item,
|
|
179
|
+
model,
|
|
180
|
+
colType: this.colType,
|
|
181
|
+
rowType: this.type,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
178
184
|
triggerBeforeCellRender(model, row, column) {
|
|
179
185
|
const detail = {
|
|
180
186
|
column,
|
|
@@ -15,6 +15,16 @@ const DIRECTION_CODES = [
|
|
|
15
15
|
export class KeyboardService {
|
|
16
16
|
constructor(sv) {
|
|
17
17
|
this.sv = sv;
|
|
18
|
+
/** Keep focus transitions in keydown order so rendering can scroll each cell into view. */
|
|
19
|
+
this.keyChangeQueue = Promise.resolve(false);
|
|
20
|
+
this.keyChangeGeneration = 0;
|
|
21
|
+
this.applyingKeyChange = false;
|
|
22
|
+
}
|
|
23
|
+
/** Cancel delayed directional input after focus or edit context changes externally. */
|
|
24
|
+
invalidatePendingChanges() {
|
|
25
|
+
if (!this.applyingKeyChange) {
|
|
26
|
+
this.keyChangeGeneration += 1;
|
|
27
|
+
}
|
|
18
28
|
}
|
|
19
29
|
/**
|
|
20
30
|
* Appends printable key input that arrives after edit mode was requested
|
|
@@ -117,13 +127,33 @@ export class KeyboardService {
|
|
|
117
127
|
if (!data) {
|
|
118
128
|
return false;
|
|
119
129
|
}
|
|
130
|
+
const keyChangeGeneration = this.keyChangeGeneration;
|
|
120
131
|
// this interval needed for several cases
|
|
121
132
|
// grid could be resized before next click
|
|
122
133
|
// at this case to avoid screen jump we use this interval
|
|
123
134
|
await timeout(RESIZE_INTERVAL + 30);
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
135
|
+
const applyKeyChange = async () => {
|
|
136
|
+
if (keyChangeGeneration !== this.keyChangeGeneration) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const range = this.sv.selectionStore.get('range');
|
|
140
|
+
const focus = this.sv.selectionStore.get('focus');
|
|
141
|
+
this.applyingKeyChange = true;
|
|
142
|
+
let changed;
|
|
143
|
+
try {
|
|
144
|
+
changed = this.keyPositionChange(data.changes, range, focus, data.isMulti);
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
this.applyingKeyChange = false;
|
|
148
|
+
}
|
|
149
|
+
await new Promise(resolve => requestAnimationFrame(() => {
|
|
150
|
+
requestAnimationFrame(() => resolve());
|
|
151
|
+
}));
|
|
152
|
+
return changed;
|
|
153
|
+
};
|
|
154
|
+
const queuedChange = this.keyChangeQueue.then(applyKeyChange, applyKeyChange);
|
|
155
|
+
this.keyChangeQueue = queuedChange.catch(() => false);
|
|
156
|
+
return queuedChange;
|
|
127
157
|
}
|
|
128
158
|
keyPositionChange(changes, range, focus, isMulti = false) {
|
|
129
159
|
if (!range || !focus) {
|
|
@@ -84,6 +84,8 @@ export class OverlaySelection {
|
|
|
84
84
|
* Selection & Keyboard
|
|
85
85
|
*/
|
|
86
86
|
selectionServiceSet(selectionStore) {
|
|
87
|
+
var _a;
|
|
88
|
+
(_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges();
|
|
87
89
|
// clear subscriptions
|
|
88
90
|
this.unsubscribeSelectionStore.forEach(v => v());
|
|
89
91
|
this.unsubscribeSelectionStore.length = 0;
|
|
@@ -111,6 +113,7 @@ export class OverlaySelection {
|
|
|
111
113
|
getData: () => this.getData(),
|
|
112
114
|
selectAll: () => this.selectAll.emit(),
|
|
113
115
|
});
|
|
116
|
+
this.unsubscribeSelectionStore.push(selectionStore.onChange('focus', () => { var _a; return (_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges(); }), selectionStore.onChange('edit', () => { var _a; return (_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges(); }));
|
|
114
117
|
this.createAutoFillService();
|
|
115
118
|
}
|
|
116
119
|
/** Autofill */
|
|
@@ -147,11 +150,12 @@ export class OverlaySelection {
|
|
|
147
150
|
this.selectionServiceSet(this.selectionStore);
|
|
148
151
|
}
|
|
149
152
|
disconnectedCallback() {
|
|
150
|
-
var _a;
|
|
153
|
+
var _a, _b;
|
|
151
154
|
// clear subscriptions
|
|
155
|
+
(_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.invalidatePendingChanges();
|
|
152
156
|
this.unsubscribeSelectionStore.forEach(v => v());
|
|
153
157
|
this.unsubscribeSelectionStore.length = 0;
|
|
154
|
-
(
|
|
158
|
+
(_b = this.columnService) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
155
159
|
}
|
|
156
160
|
async componentWillRender() {
|
|
157
161
|
var _a, _b;
|
|
@@ -163,9 +167,7 @@ export class OverlaySelection {
|
|
|
163
167
|
renderRange(range) {
|
|
164
168
|
const cell = getCell(range, this.dimensionRow.state, this.dimensionCol.state);
|
|
165
169
|
const styles = styleByCellProps(cell);
|
|
166
|
-
return
|
|
167
|
-
h("div", { class: SELECTION_BORDER_CLASS, style: styles }, this.isMobileDevice && (h("div", { class: "range-handlers" }, h("span", { class: MOBILE_CLASS }), h("span", { class: MOBILE_CLASS })))),
|
|
168
|
-
];
|
|
170
|
+
return (h("div", { class: SELECTION_BORDER_CLASS, style: styles }, this.isMobileDevice && (h("div", { class: "range-handlers" }, h("span", { class: MOBILE_CLASS }), h("span", { class: MOBILE_CLASS })))));
|
|
169
171
|
}
|
|
170
172
|
renderEditor() {
|
|
171
173
|
// Check if edit access
|
|
@@ -218,7 +220,7 @@ export class OverlaySelection {
|
|
|
218
220
|
}
|
|
219
221
|
// Range
|
|
220
222
|
if (range) {
|
|
221
|
-
nodes.push(
|
|
223
|
+
nodes.push(this.renderRange(range));
|
|
222
224
|
}
|
|
223
225
|
// Autofill
|
|
224
226
|
if (focus && !this.readonly && this.range) {
|
|
@@ -229,9 +231,9 @@ export class OverlaySelection {
|
|
|
229
231
|
nodes.push(h("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
|
-
return (h(Host, { key: '
|
|
234
|
+
return (h(Host, { key: '230e2122c5c7065c072f02019d616a64949d54d0', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true), onCloseedit: (e) => this.closeEdit(e),
|
|
233
235
|
// it's done to be able to throw events from different levels, not just from editor
|
|
234
|
-
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '
|
|
236
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '47740a79c605258b4024384510358be927d000b7', name: "data" })));
|
|
235
237
|
}
|
|
236
238
|
/**
|
|
237
239
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -428,12 +430,12 @@ export class OverlaySelection {
|
|
|
428
430
|
clearCell() {
|
|
429
431
|
var _a;
|
|
430
432
|
const range = this.selectionStore.get('range');
|
|
431
|
-
|
|
433
|
+
const focused = this.selectionStore.get('focus');
|
|
434
|
+
if (range && (!isRangeSingleCell(range) || !focused)) {
|
|
432
435
|
const data = this.columnService.getRangeStaticData(range, '');
|
|
433
436
|
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(data, range, range);
|
|
434
437
|
}
|
|
435
438
|
else if (this.canEdit()) {
|
|
436
|
-
const focused = this.selectionStore.get('focus');
|
|
437
439
|
if (!focused) {
|
|
438
440
|
return;
|
|
439
441
|
}
|
|
@@ -33,7 +33,7 @@ export class PluginService {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
// Step 1: Identify plugins to remove, compare new and old plugins
|
|
36
|
-
const pluginsToRemove = (prevPlugins === null || prevPlugins === void 0 ? void 0 : prevPlugins.filter(prevPlugin => !plugins.
|
|
36
|
+
const pluginsToRemove = (prevPlugins === null || prevPlugins === void 0 ? void 0 : prevPlugins.filter(prevPlugin => !plugins.includes(prevPlugin))) || [];
|
|
37
37
|
// Step 2: Remove old plugins
|
|
38
38
|
pluginsToRemove.forEach(plugin => {
|
|
39
39
|
var _a, _b;
|
|
@@ -46,7 +46,7 @@ export class PluginService {
|
|
|
46
46
|
// Step 3: Register user plugins
|
|
47
47
|
plugins === null || plugins === void 0 ? void 0 : plugins.forEach(userPlugin => {
|
|
48
48
|
// check if plugin already exists, if so, skip
|
|
49
|
-
const existingPlugin = this.internalPlugins.
|
|
49
|
+
const existingPlugin = this.internalPlugins.some(createdPlugin => createdPlugin instanceof userPlugin);
|
|
50
50
|
if (existingPlugin) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -29,6 +29,7 @@ import { getColumnByProp, getColumns } from "../../utils/column.utils";
|
|
|
29
29
|
import { WCAGPlugin } from "../../plugins/wcag";
|
|
30
30
|
import { PluginService } from "./plugin.service";
|
|
31
31
|
import { RTLPlugin } from "../../plugins/rtl/rtl.plugin";
|
|
32
|
+
import { RowResizePlugin, } from "../../plugins/row-resize";
|
|
32
33
|
const DEFAULT_COLUMN_SIZE = 100;
|
|
33
34
|
function getColumnSize(size) {
|
|
34
35
|
return Number.isFinite(size) && size > 0 ? size : DEFAULT_COLUMN_SIZE;
|
|
@@ -74,7 +75,12 @@ export class RevoGridComponent {
|
|
|
74
75
|
/** When true, grid in read only mode. */
|
|
75
76
|
this.readonly = false;
|
|
76
77
|
/** When true, columns are resizable. */
|
|
77
|
-
this.resize =
|
|
78
|
+
this.resize = true;
|
|
79
|
+
/**
|
|
80
|
+
* Enables row resizing. Pass a configuration object to customize the
|
|
81
|
+
* height limits or enable resize edges across the full row.
|
|
82
|
+
*/
|
|
83
|
+
this.resizeRow = false;
|
|
78
84
|
/**
|
|
79
85
|
* Prevents horizontal scroll state from being mirrored across viewport sections.
|
|
80
86
|
*/
|
|
@@ -145,15 +151,15 @@ export class RevoGridComponent {
|
|
|
145
151
|
*/
|
|
146
152
|
this.autoSizeColumn = false;
|
|
147
153
|
/**
|
|
148
|
-
* Enables filter plugin.
|
|
154
|
+
* Enables filter plugin. Enabled by default; set to `false` to opt out.
|
|
149
155
|
* Can be boolean.
|
|
150
156
|
* Or can be filter collection See `FilterCollection` for more info.
|
|
151
157
|
*/
|
|
152
|
-
this.filter =
|
|
158
|
+
this.filter = true;
|
|
153
159
|
/**
|
|
154
160
|
* Enable column move plugin.
|
|
155
161
|
*/
|
|
156
|
-
this.canMoveColumns =
|
|
162
|
+
this.canMoveColumns = true;
|
|
157
163
|
/**
|
|
158
164
|
* Trimmed rows.
|
|
159
165
|
* Functionality which allows to hide rows from main data set.
|
|
@@ -163,7 +169,7 @@ export class RevoGridComponent {
|
|
|
163
169
|
/**
|
|
164
170
|
* Enable export plugin.
|
|
165
171
|
*/
|
|
166
|
-
this.exporting =
|
|
172
|
+
this.exporting = true;
|
|
167
173
|
/**
|
|
168
174
|
* Stretch strategy for columns by `StretchColumn` plugin.
|
|
169
175
|
* For example if there are more space on the right last column size would be increased.
|
|
@@ -255,7 +261,7 @@ export class RevoGridComponent {
|
|
|
255
261
|
var _a;
|
|
256
262
|
if (this.dataProvider && this.columnProvider && !skipDataUpdate) {
|
|
257
263
|
const columnProp = (_a = this.columnProvider.getColumn(col, colType)) === null || _a === void 0 ? void 0 : _a.prop;
|
|
258
|
-
if (
|
|
264
|
+
if (columnProp !== undefined) {
|
|
259
265
|
this.dataProvider.setCellData({
|
|
260
266
|
type: rowType,
|
|
261
267
|
rowIndex: row,
|
|
@@ -984,6 +990,7 @@ export class RevoGridComponent {
|
|
|
984
990
|
this.pluginService.add(new SortingPlugin(this.element, pluginData));
|
|
985
991
|
// register grouping plugin
|
|
986
992
|
this.pluginService.add(new GroupingRowPlugin(this.element, pluginData));
|
|
993
|
+
this.pluginService.add(RowResizePlugin.fromGridProperty(this.element, pluginData));
|
|
987
994
|
if (this.canMoveColumns) {
|
|
988
995
|
this.pluginService.add(new ColumnMovePlugin(this.element, pluginData));
|
|
989
996
|
}
|
|
@@ -1318,6 +1325,33 @@ export class RevoGridComponent {
|
|
|
1318
1325
|
"setter": false,
|
|
1319
1326
|
"reflect": false,
|
|
1320
1327
|
"attribute": "resize",
|
|
1328
|
+
"defaultValue": "true"
|
|
1329
|
+
},
|
|
1330
|
+
"resizeRow": {
|
|
1331
|
+
"type": "boolean",
|
|
1332
|
+
"mutable": false,
|
|
1333
|
+
"complexType": {
|
|
1334
|
+
"original": "boolean | RowResizeConfig",
|
|
1335
|
+
"resolved": "boolean | { minHeight?: number | undefined; maxHeight?: number | undefined; fullRow?: boolean | undefined; }",
|
|
1336
|
+
"references": {
|
|
1337
|
+
"RowResizeConfig": {
|
|
1338
|
+
"location": "import",
|
|
1339
|
+
"path": "../../plugins/row-resize",
|
|
1340
|
+
"id": "src/plugins/row-resize/index.ts::RowResizeConfig",
|
|
1341
|
+
"referenceLocation": "RowResizeConfig"
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
},
|
|
1345
|
+
"required": false,
|
|
1346
|
+
"optional": false,
|
|
1347
|
+
"docs": {
|
|
1348
|
+
"tags": [],
|
|
1349
|
+
"text": "Enables row resizing. Pass a configuration object to customize the\nheight limits or enable resize edges across the full row."
|
|
1350
|
+
},
|
|
1351
|
+
"getter": false,
|
|
1352
|
+
"setter": false,
|
|
1353
|
+
"reflect": false,
|
|
1354
|
+
"attribute": "resize-row",
|
|
1321
1355
|
"defaultValue": "false"
|
|
1322
1356
|
},
|
|
1323
1357
|
"noHorizontalScrollTransfer": {
|
|
@@ -1724,13 +1758,13 @@ export class RevoGridComponent {
|
|
|
1724
1758
|
"optional": false,
|
|
1725
1759
|
"docs": {
|
|
1726
1760
|
"tags": [],
|
|
1727
|
-
"text": "Enables filter plugin.\nCan be boolean.\nOr can be filter collection See `FilterCollection` for more info."
|
|
1761
|
+
"text": "Enables filter plugin. Enabled by default; set to `false` to opt out.\nCan be boolean.\nOr can be filter collection See `FilterCollection` for more info."
|
|
1728
1762
|
},
|
|
1729
1763
|
"getter": false,
|
|
1730
1764
|
"setter": false,
|
|
1731
1765
|
"reflect": false,
|
|
1732
1766
|
"attribute": "filter",
|
|
1733
|
-
"defaultValue": "
|
|
1767
|
+
"defaultValue": "true"
|
|
1734
1768
|
},
|
|
1735
1769
|
"sorting": {
|
|
1736
1770
|
"type": "unknown",
|
|
@@ -1798,7 +1832,7 @@ export class RevoGridComponent {
|
|
|
1798
1832
|
"setter": false,
|
|
1799
1833
|
"reflect": false,
|
|
1800
1834
|
"attribute": "can-move-columns",
|
|
1801
|
-
"defaultValue": "
|
|
1835
|
+
"defaultValue": "true"
|
|
1802
1836
|
},
|
|
1803
1837
|
"trimmedRows": {
|
|
1804
1838
|
"type": "unknown",
|
|
@@ -1841,7 +1875,7 @@ export class RevoGridComponent {
|
|
|
1841
1875
|
"setter": false,
|
|
1842
1876
|
"reflect": false,
|
|
1843
1877
|
"attribute": "exporting",
|
|
1844
|
-
"defaultValue": "
|
|
1878
|
+
"defaultValue": "true"
|
|
1845
1879
|
},
|
|
1846
1880
|
"grouping": {
|
|
1847
1881
|
"type": "unknown",
|
|
@@ -8,29 +8,25 @@ export default class GridScrollingService {
|
|
|
8
8
|
this.elements = {};
|
|
9
9
|
}
|
|
10
10
|
async proxyScroll(e, key, skipEvent) {
|
|
11
|
-
var _a;
|
|
12
11
|
let newEventPromise;
|
|
13
12
|
let event = e;
|
|
14
|
-
for (
|
|
13
|
+
for (const elKey in (skipEvent ? {} : this.elements)) {
|
|
15
14
|
// skip
|
|
16
15
|
if (e.dimension === 'rgCol' && elKey === 'headerRow') {
|
|
17
16
|
continue;
|
|
18
17
|
// pinned column only
|
|
19
18
|
}
|
|
20
|
-
|
|
19
|
+
if (this.isPinnedColumn(key) && e.dimension === 'rgCol') {
|
|
21
20
|
if (elKey === key || !e.delta) {
|
|
22
21
|
continue;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
23
|
+
const changedEvent = this.changeScroll(this.elements[elKey], e);
|
|
24
|
+
if (changedEvent) {
|
|
25
|
+
newEventPromise = changedEvent;
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
else {
|
|
31
|
-
|
|
32
|
-
await ((_a = el.setScroll) === null || _a === void 0 ? void 0 : _a.call(el, e));
|
|
33
|
-
}
|
|
29
|
+
await this.setScroll(this.elements[elKey], e);
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
32
|
const newEvent = await newEventPromise;
|
|
@@ -40,12 +36,27 @@ export default class GridScrollingService {
|
|
|
40
36
|
this.setViewport(skipEvent && this.isPinnedColumn(key)
|
|
41
37
|
? Object.assign(Object.assign({}, event), { dimension: key }) : event);
|
|
42
38
|
}
|
|
39
|
+
changeScroll(elements, e) {
|
|
40
|
+
let changedEvent;
|
|
41
|
+
for (const element of elements) {
|
|
42
|
+
if (element.changeScroll) {
|
|
43
|
+
changedEvent = element.changeScroll(e);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return changedEvent;
|
|
47
|
+
}
|
|
48
|
+
async setScroll(elements, e) {
|
|
49
|
+
var _a;
|
|
50
|
+
for (const element of elements) {
|
|
51
|
+
await ((_a = element.setScroll) === null || _a === void 0 ? void 0 : _a.call(element, e));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
43
54
|
/**
|
|
44
55
|
* Silent scroll update for mobile devices when we have negative scroll top
|
|
45
56
|
*/
|
|
46
57
|
async scrollSilentService(e, key) {
|
|
47
58
|
var _a;
|
|
48
|
-
for (
|
|
59
|
+
for (const elKey in this.elements) {
|
|
49
60
|
// skip same element update
|
|
50
61
|
if (elKey === key) {
|
|
51
62
|
continue;
|
|
@@ -53,7 +64,7 @@ export default class GridScrollingService {
|
|
|
53
64
|
if (columnTypes.includes(key) &&
|
|
54
65
|
(elKey === 'headerRow' ||
|
|
55
66
|
columnTypes.includes(elKey))) {
|
|
56
|
-
for (
|
|
67
|
+
for (const el of this.elements[elKey]) {
|
|
57
68
|
await ((_a = el.changeScroll) === null || _a === void 0 ? void 0 : _a.call(el, e, true));
|
|
58
69
|
}
|
|
59
70
|
continue;
|
|
@@ -61,7 +72,7 @@ export default class GridScrollingService {
|
|
|
61
72
|
}
|
|
62
73
|
}
|
|
63
74
|
isPinnedColumn(key) {
|
|
64
|
-
return !!key && ['colPinStart', 'colPinEnd'].
|
|
75
|
+
return !!key && ['colPinStart', 'colPinEnd'].includes(key);
|
|
65
76
|
}
|
|
66
77
|
registerElements(els) {
|
|
67
78
|
this.elements = els;
|
|
@@ -114,7 +114,7 @@ export default class ViewportService {
|
|
|
114
114
|
const changedItems = {};
|
|
115
115
|
for (const i of Object.keys(detail || {})) {
|
|
116
116
|
const size = detail[i];
|
|
117
|
-
const virtualIndex = parseInt(i, 10);
|
|
117
|
+
const virtualIndex = Number.parseInt(i, 10);
|
|
118
118
|
const item = getSourceItem(store, virtualIndex);
|
|
119
119
|
if (item) {
|
|
120
120
|
changedItems[virtualIndex] = Object.assign(Object.assign({}, item), { size });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist OU ❤️
|
|
3
|
+
*/
|
|
4
|
+
/** Fewer rows keep the existing synchronous filtering behavior. */
|
|
5
|
+
export const ASYNC_FILTER_ROW_THRESHOLD = 15000;
|
|
6
|
+
/** Maximum rows evaluated in one filtering chunk. */
|
|
7
|
+
export const FILTER_CHUNK_SIZE = 1000;
|
|
8
|
+
/** Yield after approximately this much accumulated filtering work. */
|
|
9
|
+
export const FILTER_TIME_BUDGET_MS = 5;
|
|
@@ -107,7 +107,7 @@ export class FilterPanel {
|
|
|
107
107
|
getFilterItemsList() {
|
|
108
108
|
var _a, _b;
|
|
109
109
|
const prop = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.prop;
|
|
110
|
-
if (
|
|
110
|
+
if (prop === undefined)
|
|
111
111
|
return '';
|
|
112
112
|
const propFilters = (_b = this.filterItems[prop]) !== null && _b !== void 0 ? _b : [];
|
|
113
113
|
const visibleFilterCount = propFilters.filter(filter => !filter.hidden).length;
|
|
@@ -131,7 +131,7 @@ export class FilterPanel {
|
|
|
131
131
|
'filter-row-dragging': isDragging,
|
|
132
132
|
'filter-row-drag-over': isDragOver,
|
|
133
133
|
} }, canReorder ? (h("button", { type: "button", class: "filter-row-drop-target", tabIndex: -1, "aria-label": `${capts.filterCondition} ${index + 1}`, onDragOver: e => this.onFilterDragOver(e, filter.id), onDragLeave: () => this.onFilterDragLeave(filter.id), onDrop: e => this.onFilterDrop(e, prop, filter.id) })) : '', canReorder ? (h(ReorderButton, { ariaLabel: capts.reorderFilter, dragging: isDragging, dragOver: isDragOver, onDragStart: e => this.onFilterDragStart(e, filter.id), onDragEnd: () => this.onFilterDragEnd(), onKeyDown: e => this.onFilterReorderKeyDown(e, prop, filter.id) })) : '', h("div", { class: { 'select-input': true } }, h("select", { class: "select-css select-filter", onChange: e => this.onFilterTypeChange(e, prop, index) }, this.renderSelectOptions(this.filterItems[prop][index].type, true)), extra ? h("div", { class: "filter-extra" }, extra) : ''), h("div", { class: FILTER_LIST_CLASS_ACTION }, andOrButton, h(TrashButton, { ariaLabel: capts.removeFilter, onClick: () => this.onRemoveFilter(filter.id) })))));
|
|
134
|
-
})), propFilters.
|
|
134
|
+
})), propFilters.some(f => !f.hidden) ? h("div", { class: "add-filter-divider" }) : ''));
|
|
135
135
|
}
|
|
136
136
|
componentDidRender() {
|
|
137
137
|
this.syncDialog();
|
|
@@ -492,7 +492,7 @@ export class FilterPanel {
|
|
|
492
492
|
top: `${(_d = (_c = this.changes) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0}px`,
|
|
493
493
|
};
|
|
494
494
|
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
495
|
-
return (h(Host, { key: '
|
|
495
|
+
return (h(Host, { key: 'd0e4ebb408750b11b3965da6a25e581733c968e3' }, h("dialog", { key: '3df36777c931ec1063e8574169ca880a99dbfe41', class: "filter-panel-dialog", style: style, ref: el => (this.dialog = el), onCancel: e => {
|
|
496
496
|
e.preventDefault();
|
|
497
497
|
this.onCancel();
|
|
498
498
|
} }, this.changes && [
|
|
@@ -501,16 +501,16 @@ export class FilterPanel {
|
|
|
501
501
|
((_g = this.changes) === null || _g === void 0 ? void 0 : _g.hideDefaultFilters) !== true && [
|
|
502
502
|
h("label", { key: "filter-title" }, capts.title),
|
|
503
503
|
h("div", { key: "filter-holder", class: "filter-holder" }, this.getFilterItemsList()),
|
|
504
|
-
h("div", { key: "add-filter", class: "add-filter" }, h("select", { key: '
|
|
504
|
+
h("div", { key: "add-filter", class: "add-filter" }, h("select", { key: 'e2a8bd29f2090d3e6c933795427b71ca190b82aa', id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))),
|
|
505
505
|
],
|
|
506
506
|
h("slot", { key: "default-slot" }),
|
|
507
507
|
((_j = (_h = this.changes).extraBottomContent) === null || _j === void 0 ? void 0 : _j.call(_h, this.changes)) || '',
|
|
508
508
|
h("div", { key: "filter-actions", class: "filter-actions" }, this.disableDynamicFiltering && [
|
|
509
|
-
h("button", { key: "save", id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
|
|
510
|
-
h("button", { key: "cancel", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
|
|
509
|
+
h("button", { key: "save", type: "button", id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
|
|
510
|
+
h("button", { key: "cancel", type: "button", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
|
|
511
511
|
], !this.disableDynamicFiltering && [
|
|
512
|
-
h("button", { key: "ok", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
|
|
513
|
-
h("button", { key: "reset", id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
|
|
512
|
+
h("button", { key: "ok", type: "button", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
|
|
513
|
+
h("button", { key: "reset", type: "button", id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
|
|
514
514
|
]),
|
|
515
515
|
h("slot", { key: "footer-slot", slot: "footer" }),
|
|
516
516
|
])));
|