@revolist/revogrid 4.23.4 → 4.23.6
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-_W9mYaRy.js → column.drag.plugin-yUSx3qoN.js} +1 -1
- package/dist/cjs/{header-cell-renderer-QrcXXSkF.js → header-cell-renderer-vVr4IWNV.js} +7 -18
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/revo-grid.cjs.entry.js +2 -2
- package/dist/cjs/revogr-data_4.cjs.entry.js +11 -8
- package/dist/collection/components/header/header-renderer.js +10 -7
- package/dist/collection/components/header/resizable.element.js +7 -18
- package/dist/{revo-grid/column.drag.plugin-B9t9kBO5.js → esm/column.drag.plugin-Cg2U-91C.js} +1 -1
- package/dist/{revo-grid/header-cell-renderer-BsvUQ8GS.js → esm/header-cell-renderer-B-LX2sgu.js} +7 -18
- package/dist/esm/index.js +3 -3
- package/dist/esm/revo-grid.entry.js +2 -2
- package/dist/esm/revogr-data_4.entry.js +11 -8
- package/dist/{esm/column.drag.plugin-B9t9kBO5.js → revo-grid/column.drag.plugin-Cg2U-91C.js} +1 -1
- package/dist/{esm/header-cell-renderer-BsvUQ8GS.js → revo-grid/header-cell-renderer-B-LX2sgu.js} +7 -18
- package/dist/revo-grid/index.esm.js +3 -3
- package/dist/revo-grid/revo-grid.entry.js +2 -2
- package/dist/revo-grid/revogr-data_4.entry.js +11 -8
- package/hydrate/index.js +17 -25
- package/hydrate/index.mjs +17 -25
- package/package.json +1 -1
- package/readme.md +127 -16
- package/standalone/revogr-header2.js +1 -1
|
@@ -10,7 +10,7 @@ var index$1 = require('./index-DxaSE5uZ.js');
|
|
|
10
10
|
var index = require('./index-Dq8Xzj5l.js');
|
|
11
11
|
var filter_button = require('./filter.button-w6LWnyhi.js');
|
|
12
12
|
var debounce = require('./debounce-CcpHiH2p.js');
|
|
13
|
-
var headerCellRenderer = require('./header-cell-renderer-
|
|
13
|
+
var headerCellRenderer = require('./header-cell-renderer-vVr4IWNV.js');
|
|
14
14
|
|
|
15
15
|
function calculateRealSize({ count, originItemSize, sizes, }) {
|
|
16
16
|
const safeCount = Math.max(0, count);
|
|
@@ -285,24 +285,13 @@ const ResizableElement = (props, children) => {
|
|
|
285
285
|
}
|
|
286
286
|
})) ||
|
|
287
287
|
null;
|
|
288
|
-
if (props.active) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
for (let _p in props.active) {
|
|
300
|
-
resizeEls.push(index.h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
301
|
-
var _a;
|
|
302
|
-
e.preventDefault();
|
|
303
|
-
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
304
|
-
}, class: `no-resize` }));
|
|
305
|
-
}
|
|
288
|
+
if (props.active && props.canResize) {
|
|
289
|
+
for (let p in props.active) {
|
|
290
|
+
resizeEls.push(index.h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
291
|
+
var _a;
|
|
292
|
+
e.preventDefault();
|
|
293
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
294
|
+
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
306
295
|
}
|
|
307
296
|
}
|
|
308
297
|
return (index.h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
var column_service = require('./column.service-C1Qvcf5l.js');
|
|
7
|
-
var column_drag_plugin = require('./column.drag.plugin-
|
|
8
|
-
var headerCellRenderer = require('./header-cell-renderer-
|
|
7
|
+
var column_drag_plugin = require('./column.drag.plugin-yUSx3qoN.js');
|
|
8
|
+
var headerCellRenderer = require('./header-cell-renderer-vVr4IWNV.js');
|
|
9
9
|
var cellRenderer = require('./cell-renderer-Dcz022q7.js');
|
|
10
10
|
var index$1 = require('./index-DxaSE5uZ.js');
|
|
11
11
|
var textEditor = require('./text-editor-B4W-m-r-.js');
|
|
@@ -8,13 +8,13 @@ var column_service = require('./column.service-C1Qvcf5l.js');
|
|
|
8
8
|
var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
|
|
9
9
|
var debounce = require('./debounce-CcpHiH2p.js');
|
|
10
10
|
var viewport_helpers = require('./viewport.helpers-BND76K2j.js');
|
|
11
|
-
var column_drag_plugin = require('./column.drag.plugin-
|
|
11
|
+
var column_drag_plugin = require('./column.drag.plugin-yUSx3qoN.js');
|
|
12
12
|
var viewport_store = require('./viewport.store-BscUCiUk.js');
|
|
13
13
|
var theme_service = require('./theme.service-BgnxGIjK.js');
|
|
14
14
|
var index$1 = require('./index-DxaSE5uZ.js');
|
|
15
15
|
var events = require('./events-DeLDyZlb.js');
|
|
16
16
|
require('./filter.button-w6LWnyhi.js');
|
|
17
|
-
require('./header-cell-renderer-
|
|
17
|
+
require('./header-cell-renderer-vVr4IWNV.js');
|
|
18
18
|
|
|
19
19
|
class ColumnDataProvider {
|
|
20
20
|
get stores() {
|
|
@@ -8,7 +8,7 @@ var column_service = require('./column.service-C1Qvcf5l.js');
|
|
|
8
8
|
var dimension_helpers = require('./dimension.helpers-B9HgANnM.js');
|
|
9
9
|
var cellRenderer = require('./cell-renderer-Dcz022q7.js');
|
|
10
10
|
var filter_button = require('./filter.button-w6LWnyhi.js');
|
|
11
|
-
var headerCellRenderer = require('./header-cell-renderer-
|
|
11
|
+
var headerCellRenderer = require('./header-cell-renderer-vVr4IWNV.js');
|
|
12
12
|
var throttle = require('./throttle-BCwEuJJq.js');
|
|
13
13
|
var viewport_helpers = require('./viewport.helpers-BND76K2j.js');
|
|
14
14
|
require('./debounce-CcpHiH2p.js');
|
|
@@ -264,20 +264,23 @@ const RevogrData = class {
|
|
|
264
264
|
RevogrData.style = revogrDataStyleCss();
|
|
265
265
|
|
|
266
266
|
const HeaderRenderer = (p) => {
|
|
267
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
267
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
268
|
+
const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
|
|
269
|
+
((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
|
|
270
|
+
((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
|
|
268
271
|
const cellClass = {
|
|
269
272
|
[dimension_helpers.HEADER_CLASS]: true,
|
|
270
|
-
[dimension_helpers.HEADER_SORTABLE_CLASS]: !!((
|
|
273
|
+
[dimension_helpers.HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
|
|
271
274
|
};
|
|
272
|
-
if ((
|
|
275
|
+
if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
|
|
273
276
|
cellClass[p.data.order] = true;
|
|
274
277
|
}
|
|
275
278
|
const dataProps = {
|
|
276
|
-
key: String((
|
|
279
|
+
key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
|
|
277
280
|
[dimension_helpers.DATA_COL]: p.column.itemIndex,
|
|
278
281
|
canResize: p.canResize,
|
|
279
|
-
minWidth: ((
|
|
280
|
-
maxWidth: (
|
|
282
|
+
minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || dimension_helpers.MIN_COL_SIZE,
|
|
283
|
+
maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
|
|
281
284
|
active: p.active || ['r'],
|
|
282
285
|
class: cellClass,
|
|
283
286
|
style: {
|
|
@@ -313,7 +316,7 @@ const HeaderRenderer = (p) => {
|
|
|
313
316
|
}
|
|
314
317
|
}
|
|
315
318
|
}
|
|
316
|
-
return (index.h(headerCellRenderer.HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, index.h(cellRenderer.SortingSign, { column: p.data }), p.canFilter && ((
|
|
319
|
+
return (index.h(headerCellRenderer.HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? index.h(cellRenderer.SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (index.h(filter_button.FilterButton, { column: p.data })) : ('')));
|
|
317
320
|
};
|
|
318
321
|
|
|
319
322
|
const HeaderGroupRenderer = (p) => {
|
|
@@ -7,20 +7,23 @@ import { SortingSign } from "../../plugins/sorting/sorting.sign";
|
|
|
7
7
|
import { DATA_COL, FOCUS_CLASS, HEADER_CLASS, HEADER_SORTABLE_CLASS, MIN_COL_SIZE, } from "../../utils/consts";
|
|
8
8
|
import { HeaderCellRenderer } from "./header-cell-renderer";
|
|
9
9
|
const HeaderRenderer = (p) => {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
11
|
+
const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
|
|
12
|
+
((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
|
|
13
|
+
((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
|
|
11
14
|
const cellClass = {
|
|
12
15
|
[HEADER_CLASS]: true,
|
|
13
|
-
[HEADER_SORTABLE_CLASS]: !!((
|
|
16
|
+
[HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
|
|
14
17
|
};
|
|
15
|
-
if ((
|
|
18
|
+
if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
|
|
16
19
|
cellClass[p.data.order] = true;
|
|
17
20
|
}
|
|
18
21
|
const dataProps = {
|
|
19
|
-
key: String((
|
|
22
|
+
key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
|
|
20
23
|
[DATA_COL]: p.column.itemIndex,
|
|
21
24
|
canResize: p.canResize,
|
|
22
|
-
minWidth: ((
|
|
23
|
-
maxWidth: (
|
|
25
|
+
minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || MIN_COL_SIZE,
|
|
26
|
+
maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
|
|
24
27
|
active: p.active || ['r'],
|
|
25
28
|
class: cellClass,
|
|
26
29
|
style: {
|
|
@@ -56,6 +59,6 @@ const HeaderRenderer = (p) => {
|
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
|
-
return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, h(SortingSign, { column: p.data }), p.canFilter && ((
|
|
62
|
+
return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? h(SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (h(FilterButton, { column: p.data })) : ('')));
|
|
60
63
|
};
|
|
61
64
|
export default HeaderRenderer;
|
|
@@ -13,24 +13,13 @@ export const ResizableElement = (props, children) => {
|
|
|
13
13
|
}
|
|
14
14
|
})) ||
|
|
15
15
|
null;
|
|
16
|
-
if (props.active) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
for (let _p in props.active) {
|
|
28
|
-
resizeEls.push(h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
29
|
-
var _a;
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
32
|
-
}, class: `no-resize` }));
|
|
33
|
-
}
|
|
16
|
+
if (props.active && props.canResize) {
|
|
17
|
+
for (let p in props.active) {
|
|
18
|
+
resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
19
|
+
var _a;
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
22
|
+
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
34
23
|
}
|
|
35
24
|
}
|
|
36
25
|
return (h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
|
package/dist/{revo-grid/column.drag.plugin-B9t9kBO5.js → esm/column.drag.plugin-Cg2U-91C.js}
RENAMED
|
@@ -8,7 +8,7 @@ import { g as getScrollbarSize, t as timeout } from './index-Db3qZoW5.js';
|
|
|
8
8
|
import { h } from './index-Chp_81rd.js';
|
|
9
9
|
import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-C8XTWPU2.js';
|
|
10
10
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
11
|
-
import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-
|
|
11
|
+
import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-B-LX2sgu.js';
|
|
12
12
|
|
|
13
13
|
function calculateRealSize({ count, originItemSize, sizes, }) {
|
|
14
14
|
const safeCount = Math.max(0, count);
|
package/dist/{revo-grid/header-cell-renderer-BsvUQ8GS.js → esm/header-cell-renderer-B-LX2sgu.js}
RENAMED
|
@@ -283,24 +283,13 @@ const ResizableElement = (props, children) => {
|
|
|
283
283
|
}
|
|
284
284
|
})) ||
|
|
285
285
|
null;
|
|
286
|
-
if (props.active) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
for (let _p in props.active) {
|
|
298
|
-
resizeEls.push(h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
299
|
-
var _a;
|
|
300
|
-
e.preventDefault();
|
|
301
|
-
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
302
|
-
}, class: `no-resize` }));
|
|
303
|
-
}
|
|
286
|
+
if (props.active && props.canResize) {
|
|
287
|
+
for (let p in props.active) {
|
|
288
|
+
resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
289
|
+
var _a;
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
292
|
+
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
304
293
|
}
|
|
305
294
|
}
|
|
306
295
|
return (h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
|
package/dist/esm/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-CC_SD8W3.js';
|
|
5
|
-
import { B as BasePlugin } from './column.drag.plugin-
|
|
6
|
-
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-
|
|
7
|
-
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-Cg2U-91C.js';
|
|
6
|
+
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-Cg2U-91C.js';
|
|
7
|
+
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-B-LX2sgu.js';
|
|
8
8
|
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-BtN-NGCk.js';
|
|
9
9
|
export { a as applyMixins, f as findPositionInArray, g as getScrollbarSize, m as mergeSortedArray, p as pushSorted, r as range, s as scaleValue, t as timeout } from './index-Db3qZoW5.js';
|
|
10
10
|
export { T as TextEditor } from './text-editor-C3RUSwH5.js';
|
|
@@ -6,13 +6,13 @@ import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as
|
|
|
6
6
|
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL } from './dimension.helpers-CGKwSvw6.js';
|
|
7
7
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
8
8
|
import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
9
|
-
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-
|
|
9
|
+
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-Cg2U-91C.js';
|
|
10
10
|
import { V as ViewportStore } from './viewport.store-_c579YyM.js';
|
|
11
11
|
import { T as ThemeService } from './theme.service-BmnDvr6P.js';
|
|
12
12
|
import { t as timeout } from './index-Db3qZoW5.js';
|
|
13
13
|
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
|
14
14
|
import './filter.button-C8XTWPU2.js';
|
|
15
|
-
import './header-cell-renderer-
|
|
15
|
+
import './header-cell-renderer-B-LX2sgu.js';
|
|
16
16
|
|
|
17
17
|
class ColumnDataProvider {
|
|
18
18
|
get stores() {
|
|
@@ -6,7 +6,7 @@ import { M as ColumnService, u as isGrouping } from './column.service-CC_SD8W3.j
|
|
|
6
6
|
import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
7
7
|
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-BtN-NGCk.js';
|
|
8
8
|
import { c as FilterButton } from './filter.button-C8XTWPU2.js';
|
|
9
|
-
import { H as HeaderCellRenderer } from './header-cell-renderer-
|
|
9
|
+
import { H as HeaderCellRenderer } from './header-cell-renderer-B-LX2sgu.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService, g as getContentSize } from './throttle-CaUDyxyU.js';
|
|
11
11
|
import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
12
12
|
import './debounce-PCRWZliA.js';
|
|
@@ -262,20 +262,23 @@ const RevogrData = class {
|
|
|
262
262
|
RevogrData.style = revogrDataStyleCss();
|
|
263
263
|
|
|
264
264
|
const HeaderRenderer = (p) => {
|
|
265
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
265
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
266
|
+
const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
|
|
267
|
+
((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
|
|
268
|
+
((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
|
|
266
269
|
const cellClass = {
|
|
267
270
|
[HEADER_CLASS]: true,
|
|
268
|
-
[HEADER_SORTABLE_CLASS]: !!((
|
|
271
|
+
[HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
|
|
269
272
|
};
|
|
270
|
-
if ((
|
|
273
|
+
if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
|
|
271
274
|
cellClass[p.data.order] = true;
|
|
272
275
|
}
|
|
273
276
|
const dataProps = {
|
|
274
|
-
key: String((
|
|
277
|
+
key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
|
|
275
278
|
[DATA_COL]: p.column.itemIndex,
|
|
276
279
|
canResize: p.canResize,
|
|
277
|
-
minWidth: ((
|
|
278
|
-
maxWidth: (
|
|
280
|
+
minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || MIN_COL_SIZE,
|
|
281
|
+
maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
|
|
279
282
|
active: p.active || ['r'],
|
|
280
283
|
class: cellClass,
|
|
281
284
|
style: {
|
|
@@ -311,7 +314,7 @@ const HeaderRenderer = (p) => {
|
|
|
311
314
|
}
|
|
312
315
|
}
|
|
313
316
|
}
|
|
314
|
-
return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, h(SortingSign, { column: p.data }), p.canFilter && ((
|
|
317
|
+
return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? h(SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (h(FilterButton, { column: p.data })) : ('')));
|
|
315
318
|
};
|
|
316
319
|
|
|
317
320
|
const HeaderGroupRenderer = (p) => {
|
package/dist/{esm/column.drag.plugin-B9t9kBO5.js → revo-grid/column.drag.plugin-Cg2U-91C.js}
RENAMED
|
@@ -8,7 +8,7 @@ import { g as getScrollbarSize, t as timeout } from './index-Db3qZoW5.js';
|
|
|
8
8
|
import { h } from './index-Chp_81rd.js';
|
|
9
9
|
import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-C8XTWPU2.js';
|
|
10
10
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
11
|
-
import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-
|
|
11
|
+
import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-B-LX2sgu.js';
|
|
12
12
|
|
|
13
13
|
function calculateRealSize({ count, originItemSize, sizes, }) {
|
|
14
14
|
const safeCount = Math.max(0, count);
|
package/dist/{esm/header-cell-renderer-BsvUQ8GS.js → revo-grid/header-cell-renderer-B-LX2sgu.js}
RENAMED
|
@@ -283,24 +283,13 @@ const ResizableElement = (props, children) => {
|
|
|
283
283
|
}
|
|
284
284
|
})) ||
|
|
285
285
|
null;
|
|
286
|
-
if (props.active) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
for (let _p in props.active) {
|
|
298
|
-
resizeEls.push(h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
299
|
-
var _a;
|
|
300
|
-
e.preventDefault();
|
|
301
|
-
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
302
|
-
}, class: `no-resize` }));
|
|
303
|
-
}
|
|
286
|
+
if (props.active && props.canResize) {
|
|
287
|
+
for (let p in props.active) {
|
|
288
|
+
resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
289
|
+
var _a;
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
292
|
+
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
304
293
|
}
|
|
305
294
|
}
|
|
306
295
|
return (h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-CC_SD8W3.js';
|
|
5
|
-
import { B as BasePlugin } from './column.drag.plugin-
|
|
6
|
-
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-
|
|
7
|
-
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-
|
|
5
|
+
import { B as BasePlugin } from './column.drag.plugin-Cg2U-91C.js';
|
|
6
|
+
export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, r as SortingPlugin, a as StretchColumn, v as defaultCellCompare, w as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, y as getComparer, q as getLeftRelative, x as getNextOrder, t as getSortingIndex, s as hasActiveSorting, i as isStretchPlugin, u as sortIndexByItems } from './column.drag.plugin-Cg2U-91C.js';
|
|
7
|
+
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-B-LX2sgu.js';
|
|
8
8
|
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-BtN-NGCk.js';
|
|
9
9
|
export { a as applyMixins, f as findPositionInArray, g as getScrollbarSize, m as mergeSortedArray, p as pushSorted, r as range, s as scaleValue, t as timeout } from './index-Db3qZoW5.js';
|
|
10
10
|
export { T as TextEditor } from './text-editor-C3RUSwH5.js';
|
|
@@ -6,13 +6,13 @@ import { c as columnTypes, J as reduce, C as getColumnType, r as rowTypes, i as
|
|
|
6
6
|
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL } from './dimension.helpers-CGKwSvw6.js';
|
|
7
7
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
8
8
|
import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
9
|
-
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-
|
|
9
|
+
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, r as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-Cg2U-91C.js';
|
|
10
10
|
import { V as ViewportStore } from './viewport.store-_c579YyM.js';
|
|
11
11
|
import { T as ThemeService } from './theme.service-BmnDvr6P.js';
|
|
12
12
|
import { t as timeout } from './index-Db3qZoW5.js';
|
|
13
13
|
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
|
14
14
|
import './filter.button-C8XTWPU2.js';
|
|
15
|
-
import './header-cell-renderer-
|
|
15
|
+
import './header-cell-renderer-B-LX2sgu.js';
|
|
16
16
|
|
|
17
17
|
class ColumnDataProvider {
|
|
18
18
|
get stores() {
|
|
@@ -6,7 +6,7 @@ import { M as ColumnService, u as isGrouping } from './column.service-CC_SD8W3.j
|
|
|
6
6
|
import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
7
7
|
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-BtN-NGCk.js';
|
|
8
8
|
import { c as FilterButton } from './filter.button-C8XTWPU2.js';
|
|
9
|
-
import { H as HeaderCellRenderer } from './header-cell-renderer-
|
|
9
|
+
import { H as HeaderCellRenderer } from './header-cell-renderer-B-LX2sgu.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService, g as getContentSize } from './throttle-CaUDyxyU.js';
|
|
11
11
|
import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
12
12
|
import './debounce-PCRWZliA.js';
|
|
@@ -262,20 +262,23 @@ const RevogrData = class {
|
|
|
262
262
|
RevogrData.style = revogrDataStyleCss();
|
|
263
263
|
|
|
264
264
|
const HeaderRenderer = (p) => {
|
|
265
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
265
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
266
|
+
const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
|
|
267
|
+
((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
|
|
268
|
+
((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
|
|
266
269
|
const cellClass = {
|
|
267
270
|
[HEADER_CLASS]: true,
|
|
268
|
-
[HEADER_SORTABLE_CLASS]: !!((
|
|
271
|
+
[HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
|
|
269
272
|
};
|
|
270
|
-
if ((
|
|
273
|
+
if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
|
|
271
274
|
cellClass[p.data.order] = true;
|
|
272
275
|
}
|
|
273
276
|
const dataProps = {
|
|
274
|
-
key: String((
|
|
277
|
+
key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
|
|
275
278
|
[DATA_COL]: p.column.itemIndex,
|
|
276
279
|
canResize: p.canResize,
|
|
277
|
-
minWidth: ((
|
|
278
|
-
maxWidth: (
|
|
280
|
+
minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || MIN_COL_SIZE,
|
|
281
|
+
maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
|
|
279
282
|
active: p.active || ['r'],
|
|
280
283
|
class: cellClass,
|
|
281
284
|
style: {
|
|
@@ -311,7 +314,7 @@ const HeaderRenderer = (p) => {
|
|
|
311
314
|
}
|
|
312
315
|
}
|
|
313
316
|
}
|
|
314
|
-
return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, h(SortingSign, { column: p.data }), p.canFilter && ((
|
|
317
|
+
return (h(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? h(SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (h(FilterButton, { column: p.data })) : ('')));
|
|
315
318
|
};
|
|
316
319
|
|
|
317
320
|
const HeaderGroupRenderer = (p) => {
|
package/hydrate/index.js
CHANGED
|
@@ -18440,24 +18440,13 @@ const ResizableElement = (props, children) => {
|
|
|
18440
18440
|
}
|
|
18441
18441
|
})) ||
|
|
18442
18442
|
null;
|
|
18443
|
-
if (props.active) {
|
|
18444
|
-
|
|
18445
|
-
|
|
18446
|
-
|
|
18447
|
-
|
|
18448
|
-
|
|
18449
|
-
|
|
18450
|
-
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
18451
|
-
}
|
|
18452
|
-
}
|
|
18453
|
-
else {
|
|
18454
|
-
for (let _p in props.active) {
|
|
18455
|
-
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
18456
|
-
var _a;
|
|
18457
|
-
e.preventDefault();
|
|
18458
|
-
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
18459
|
-
}, class: `no-resize` }));
|
|
18460
|
-
}
|
|
18443
|
+
if (props.active && props.canResize) {
|
|
18444
|
+
for (let p in props.active) {
|
|
18445
|
+
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
18446
|
+
var _a;
|
|
18447
|
+
e.preventDefault();
|
|
18448
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
18449
|
+
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
18461
18450
|
}
|
|
18462
18451
|
}
|
|
18463
18452
|
return (hAsync("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
|
|
@@ -20791,20 +20780,23 @@ class RevogrFocus {
|
|
|
20791
20780
|
}
|
|
20792
20781
|
|
|
20793
20782
|
const HeaderRenderer = (p) => {
|
|
20794
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
20783
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
20784
|
+
const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
|
|
20785
|
+
((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
|
|
20786
|
+
((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
|
|
20795
20787
|
const cellClass = {
|
|
20796
20788
|
[HEADER_CLASS]: true,
|
|
20797
|
-
[HEADER_SORTABLE_CLASS]: !!((
|
|
20789
|
+
[HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
|
|
20798
20790
|
};
|
|
20799
|
-
if ((
|
|
20791
|
+
if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
|
|
20800
20792
|
cellClass[p.data.order] = true;
|
|
20801
20793
|
}
|
|
20802
20794
|
const dataProps = {
|
|
20803
|
-
key: String((
|
|
20795
|
+
key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
|
|
20804
20796
|
[DATA_COL]: p.column.itemIndex,
|
|
20805
20797
|
canResize: p.canResize,
|
|
20806
|
-
minWidth: ((
|
|
20807
|
-
maxWidth: (
|
|
20798
|
+
minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || MIN_COL_SIZE,
|
|
20799
|
+
maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
|
|
20808
20800
|
active: p.active || ['r'],
|
|
20809
20801
|
class: cellClass,
|
|
20810
20802
|
style: {
|
|
@@ -20840,7 +20832,7 @@ const HeaderRenderer = (p) => {
|
|
|
20840
20832
|
}
|
|
20841
20833
|
}
|
|
20842
20834
|
}
|
|
20843
|
-
return (hAsync(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hAsync(SortingSign, { column: p.data }), p.canFilter && ((
|
|
20835
|
+
return (hAsync(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? hAsync(SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (hAsync(FilterButton, { column: p.data })) : ('')));
|
|
20844
20836
|
};
|
|
20845
20837
|
|
|
20846
20838
|
const HeaderGroupRenderer = (p) => {
|
package/hydrate/index.mjs
CHANGED
|
@@ -18438,24 +18438,13 @@ const ResizableElement = (props, children) => {
|
|
|
18438
18438
|
}
|
|
18439
18439
|
})) ||
|
|
18440
18440
|
null;
|
|
18441
|
-
if (props.active) {
|
|
18442
|
-
|
|
18443
|
-
|
|
18444
|
-
|
|
18445
|
-
|
|
18446
|
-
|
|
18447
|
-
|
|
18448
|
-
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
18449
|
-
}
|
|
18450
|
-
}
|
|
18451
|
-
else {
|
|
18452
|
-
for (let _p in props.active) {
|
|
18453
|
-
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
18454
|
-
var _a;
|
|
18455
|
-
e.preventDefault();
|
|
18456
|
-
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
18457
|
-
}, class: `no-resize` }));
|
|
18458
|
-
}
|
|
18441
|
+
if (props.active && props.canResize) {
|
|
18442
|
+
for (let p in props.active) {
|
|
18443
|
+
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
18444
|
+
var _a;
|
|
18445
|
+
e.preventDefault();
|
|
18446
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
18447
|
+
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
18459
18448
|
}
|
|
18460
18449
|
}
|
|
18461
18450
|
return (hAsync("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }), children, resizeEls));
|
|
@@ -20789,20 +20778,23 @@ class RevogrFocus {
|
|
|
20789
20778
|
}
|
|
20790
20779
|
|
|
20791
20780
|
const HeaderRenderer = (p) => {
|
|
20792
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
20781
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
20782
|
+
const hasSortingSign = !!(((_a = p.data) === null || _a === void 0 ? void 0 : _a.sortable) ||
|
|
20783
|
+
((_b = p.data) === null || _b === void 0 ? void 0 : _b.order) ||
|
|
20784
|
+
((_c = p.data) === null || _c === void 0 ? void 0 : _c.sortIndex));
|
|
20793
20785
|
const cellClass = {
|
|
20794
20786
|
[HEADER_CLASS]: true,
|
|
20795
|
-
[HEADER_SORTABLE_CLASS]: !!((
|
|
20787
|
+
[HEADER_SORTABLE_CLASS]: !!((_d = p.data) === null || _d === void 0 ? void 0 : _d.sortable),
|
|
20796
20788
|
};
|
|
20797
|
-
if ((
|
|
20789
|
+
if ((_e = p.data) === null || _e === void 0 ? void 0 : _e.order) {
|
|
20798
20790
|
cellClass[p.data.order] = true;
|
|
20799
20791
|
}
|
|
20800
20792
|
const dataProps = {
|
|
20801
|
-
key: String((
|
|
20793
|
+
key: String((_g = (_f = p.data) === null || _f === void 0 ? void 0 : _f.prop) !== null && _g !== void 0 ? _g : p.column.itemIndex),
|
|
20802
20794
|
[DATA_COL]: p.column.itemIndex,
|
|
20803
20795
|
canResize: p.canResize,
|
|
20804
|
-
minWidth: ((
|
|
20805
|
-
maxWidth: (
|
|
20796
|
+
minWidth: ((_h = p.data) === null || _h === void 0 ? void 0 : _h.minSize) || MIN_COL_SIZE,
|
|
20797
|
+
maxWidth: (_j = p.data) === null || _j === void 0 ? void 0 : _j.maxSize,
|
|
20806
20798
|
active: p.active || ['r'],
|
|
20807
20799
|
class: cellClass,
|
|
20808
20800
|
style: {
|
|
@@ -20838,7 +20830,7 @@ const HeaderRenderer = (p) => {
|
|
|
20838
20830
|
}
|
|
20839
20831
|
}
|
|
20840
20832
|
}
|
|
20841
|
-
return (hAsync(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hAsync(SortingSign, { column: p.data }), p.canFilter && ((
|
|
20833
|
+
return (hAsync(HeaderCellRenderer, { data: p.data, props: dataProps, additionalData: p.additionalData }, hasSortingSign ? hAsync(SortingSign, { column: p.data }) : null, p.canFilter && ((_k = p.data) === null || _k === void 0 ? void 0 : _k.filter) !== false ? (hAsync(FilterButton, { column: p.data })) : ('')));
|
|
20842
20834
|
};
|
|
20843
20835
|
|
|
20844
20836
|
const HeaderGroupRenderer = (p) => {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<h3 align="center">Powerful data grid component built with <a href="https://stenciljs.com" target="_blank">StencilJS</a>.</h3>
|
|
24
24
|
<p align="center">
|
|
25
|
-
|
|
25
|
+
Render 1M+ rows, millions of cells, and thousands of columns efficiently with no hard row limit in the grid.
|
|
26
26
|
</p>
|
|
27
27
|
<p align="center">
|
|
28
28
|
Used by some of the largest companies in Europe and the United States.
|
|
@@ -31,6 +31,7 @@ Used by some of the largest companies in Europe and the United States.
|
|
|
31
31
|
<p align="center">
|
|
32
32
|
<a href="https://rv-grid.com/demo/">Demo and API</a> •
|
|
33
33
|
<a href="#key-features">Key Features</a> •
|
|
34
|
+
<a href="#revogrid-pro-features">Pro Features</a> •
|
|
34
35
|
<a href="#basic-usage">How To Use</a> •
|
|
35
36
|
<a href="#installation">Installation</a> •
|
|
36
37
|
<a href="https://rv-grid.com/guide/">Docs</a> •
|
|
@@ -44,7 +45,7 @@ Used by some of the largest companies in Europe and the United States.
|
|
|
44
45
|
|
|
45
46
|
## Key Features
|
|
46
47
|
|
|
47
|
-
- **High Performance**:
|
|
48
|
+
- **High Performance**: Render 1M+ rows and millions of cells with no hard row limit in the grid. Virtualization keeps the DOM focused on the visible viewport.
|
|
48
49
|
|
|
49
50
|
- **[Accessibility](https://rv-grid.com/guide/wcag)**: Follows WAI-ARIA best practices.
|
|
50
51
|
|
|
@@ -59,7 +60,7 @@ Used by some of the largest companies in Europe and the United States.
|
|
|
59
60
|
|
|
60
61
|
- **[Intelligent Virtual DOM](https://rv-grid.com/guide/overview#VNode-Reactive-DOM)**: Smart row recombination to minimize redraws.
|
|
61
62
|
|
|
62
|
-
- **[Virtual Scroll](https://rv-grid.com/guide/viewports)**: Handles large datasets
|
|
63
|
+
- **[Virtual Scroll](https://rv-grid.com/guide/viewports)**: Handles large datasets without rendering every row or column into the DOM.
|
|
63
64
|
|
|
64
65
|
- **[Drag and Drop](https://rv-grid.com/guide/row/order)**: Drag and drop in [rows](https://rv-grid.com/guide/row/order) and [columns](https://rv-grid.com/guide/column/order).
|
|
65
66
|
|
|
@@ -112,28 +113,138 @@ Used by some of the largest companies in Europe and the United States.
|
|
|
112
113
|
|
|
113
114
|
- **[Plugin System](https://rv-grid.com/guide/plugin/)**: Create custom plugins or extend existing ones easily.
|
|
114
115
|
|
|
115
|
-
- **[Formula Support](https://rv-grid.com/guide/cell/formula)**: Evaluate formulas in cell data with Excel-like syntax, including basic arithmetic, statistical functions, and cell references.
|
|
116
|
-
- **[Pivot Table](https://rv-grid.com/demo/pivot)**: Transform and analyze data dynamically with drag-and-drop field arrangement, aggregation functions, and interactive filtering capabilities.
|
|
117
|
-
|
|
118
|
-
- **[Master Detail/Subtables/Forms](https://rv-grid.com/guide/row/master.pro)**: Expand rows to reveal child data.
|
|
119
|
-
- **[Cell/Column/Row Span/Merge](https://rv-grid.com/guide/cell/merge)**: Merge cells to form groups.
|
|
120
|
-
- **Auto Merge**: Automatically merges cells with identical values in a column.
|
|
121
|
-
- **Form editig**: Edit forms directly within the grid, featuring all necessary fields, including custom options and markdown support for a fast and enhanced data entry experience.
|
|
122
|
-
|
|
123
116
|
- **Customizations**:
|
|
124
117
|
- [Column header template](https://rv-grid.com/guide/column/header.template).
|
|
125
118
|
- [Row header template](https://rv-grid.com/guide/row/headers).
|
|
126
119
|
- [Cell properties](https://rv-grid.com/guide/cell/) (define custom properties for rendered cells).
|
|
127
|
-
- Nested grids: Build a grid inside a grid, showcasing advanced editing options and user interactions for a more dynamic data presentation.
|
|
128
|
-
- Context Menu: Build context menus for any grid element - from cells to headers. Cut, copy, paste, add rows, modify columns, and more. Fully customizable with your own actions and behaviors.
|
|
129
|
-
|
|
130
|
-
- **[AI Agents and MCP](https://rv-grid.com/guide/mcp)**: Connect Codex, Cursor, Claude Code, and VS Code to version-aware RevoGrid docs, examples, migrations, feature availability, and typed API context.
|
|
131
|
-
|
|
132
120
|
- [Cell template](https://rv-grid.com/guide/cell/renderer) (create your own cell views).
|
|
133
121
|
- [Cell editor](https://rv-grid.com/guide/cell/editor) (use predefined or apply your own custom editors and cell types).
|
|
134
122
|
|
|
123
|
+
- **[AI Agents and MCP](https://rv-grid.com/guide/mcp)**: Connect Codex, Cursor, Claude Code, and VS Code to version-aware RevoGrid docs, examples, migrations, feature availability, and typed API context.
|
|
124
|
+
|
|
135
125
|
- **Rich API & Additional Improvements**: Explore hundreds of other small customizations and improvements in [RevoGrid](https://rv-grid.com/).
|
|
136
126
|
|
|
127
|
+
|
|
128
|
+
## RevoGrid Pro Features
|
|
129
|
+
|
|
130
|
+
RevoGrid Pro extends the core grid with production plugins for advanced data entry, analytics, layout, validation, remote data workflows, and enterprise planning.
|
|
131
|
+
|
|
132
|
+
- **Advanced Data Structures**:
|
|
133
|
+
- **Hierarchical Data View**: Display tree data with expandable rows, nested relationships, sorting, filtering, editing, and drag-and-drop friendly hierarchy handling.
|
|
134
|
+
- **Row Transpose**: Flip records into a row-oriented view when users need to inspect one entity as a vertical form-like grid.
|
|
135
|
+
|
|
136
|
+
- **Headers, Columns, and Grid Structure**:
|
|
137
|
+
- **Multi-Level Headers / Column Groups**: Build stacked, nested headers so related columns can sit under shared parent groups.
|
|
138
|
+
- **Multi-Row Headers**: Render more than one header row for dense tables, grouped labels, or spreadsheet-like header layouts.
|
|
139
|
+
- **Column Group Panel**: Let users drag columns into a grouping panel to create row groups interactively.
|
|
140
|
+
- **Column Group Render Sync**: Keep grouped header rendering aligned during column moves, resizing, and virtualization updates.
|
|
141
|
+
- **Column Move with Groups**: Move columns while preserving grouped header relationships and valid group boundaries.
|
|
142
|
+
- **Column Collapse & Expand (Drill Down)**: Collapse grouped columns to focus on summary information, then expand when details are needed.
|
|
143
|
+
- **Column Hide**: Hide and reveal columns to create focused views without mutating the underlying dataset.
|
|
144
|
+
- **Column Add Popup**: Provide a UI flow for adding columns from available field definitions.
|
|
145
|
+
- **Column Selection**: Select entire columns from the header for bulk operations, copying, formatting, or analysis.
|
|
146
|
+
- **Column Stretch**: Distribute column widths to fill available grid space while respecting sizing constraints.
|
|
147
|
+
- **Column Autosize**: Measure content and automatically adjust column widths for readability.
|
|
148
|
+
- **Merge Cells**: Merge cells across rows and columns for grouped labels, reports, or spreadsheet-style layouts.
|
|
149
|
+
- **Auto Merge / Same-Value Merge**: Automatically merge neighboring cells with matching values to reduce visual repetition.
|
|
150
|
+
- **Sticky Cells and Rows**: Keep important rows, cells, totals, labels, or action areas visible while scrolling.
|
|
151
|
+
- **Overlay Layers**: Push temporary UI layers above the grid for richer interactions without replacing the main grid.
|
|
152
|
+
|
|
153
|
+
- **Remote Data and Large Dataset Workflows**:
|
|
154
|
+
- **Server Loading with Infinite Scroll**: Load remote data as users scroll, keeping memory and DOM usage controlled for large datasets.
|
|
155
|
+
- **Infinite Scroll**: Support total-based or dynamic scrolling patterns where rows are fetched and released in chunks.
|
|
156
|
+
- **Pagination**: Split large datasets into page-sized views with built-in navigation controls.
|
|
157
|
+
- **Remote Pagination**: Keep page index, page size, total counts, and server-loaded rows synchronized with the grid.
|
|
158
|
+
- **Server-Side Grouping**: Request grouped row blocks from a remote source, expand group paths on demand, and combine grouping with remote filtering, sorting, and export.
|
|
159
|
+
|
|
160
|
+
- **Data Management and Change Tracking**:
|
|
161
|
+
- **Audit Trail History**: Record data-change history for traceability, review, and compliance-oriented workflows.
|
|
162
|
+
- **History**: Track user edits and provide undo/redo controls for grid changes.
|
|
163
|
+
- **History Controls**: Add ready-made UI controls for navigating undo and redo stacks.
|
|
164
|
+
- **Range Apply Preview**: Preview copy, paste, or fill changes before applying them to target cells.
|
|
165
|
+
- **Smart Auto Fill**: Fill ranges from an initial value, series, or pattern to speed repetitive data entry.
|
|
166
|
+
- **Excel Export/Import**: Export and import Excel workbook formats including `xlsx`, `xlsm`, `xlsb`, and `xls`.
|
|
167
|
+
- **Multi-Column Export Headers**: Preserve grouped and multi-level column headers when exporting structured grids.
|
|
168
|
+
- **Clipboard with JSON**: Copy and paste structured JSON/object values while keeping control over parsing and rendering.
|
|
169
|
+
|
|
170
|
+
- **Selection and Range Operations**:
|
|
171
|
+
- **Multi-Range Selection**: Work with multiple selected ranges for spreadsheet-style copy, edit, and interaction flows.
|
|
172
|
+
- **Range Selection Limit**: Restrict selected ranges with configurable limits to protect performance and workflow rules.
|
|
173
|
+
- **Row Checkbox Selection**: Select rows through checkbox controls with bulk selection and keyboard-friendly behavior.
|
|
174
|
+
- **Row Advanced Drag and Drop**: Reorder rows with custom drag handles, multi-row behavior, and controlled drop handling.
|
|
175
|
+
- **Row Expand**: Add expandable row affordances for detail views, children, or custom row content.
|
|
176
|
+
- **Row Custom Heading**: Customize row header content for labels, actions, or contextual row information.
|
|
177
|
+
|
|
178
|
+
- **Filtering, Search, and Grouping**:
|
|
179
|
+
- **Advanced Selection Filtering**: Filter with multi-condition selection controls for categorical data.
|
|
180
|
+
- **Selection Filter Cascade**: Cascade filters so each choice narrows available values in dependent filters.
|
|
181
|
+
- **Advanced Slider Filtering**: Filter numeric values with range sliders.
|
|
182
|
+
- **Header Input Filtering**: Put filter inputs in the header area for fast per-column search.
|
|
183
|
+
- **Date Filter**: Filter temporal data by date-specific conditions and ranges.
|
|
184
|
+
- **Row Grouping Drag and Drop**: Drag fields into a panel to group rows dynamically.
|
|
185
|
+
- **Grouping Aggregation**: Calculate grouped summaries such as sum, average, count, min, and max.
|
|
186
|
+
- **Server-Side Group Aggregation**: Combine remote grouped data with aggregate values returned by the server.
|
|
187
|
+
|
|
188
|
+
- **Calculations and Formulas**:
|
|
189
|
+
- **Formula Engine**: Add Excel-like formulas with cell references, dynamic calculations, and a broad function set.
|
|
190
|
+
- **Formula Bar**: Give users a dedicated place to inspect and edit formulas.
|
|
191
|
+
- **Formula Name Manager**: Define reusable named references for formulas.
|
|
192
|
+
- **Formula Dependency Highlighting**: Highlight related cells so users can understand formula inputs and outputs.
|
|
193
|
+
- **Summary Header**: Render calculated summary values in header-level UI.
|
|
194
|
+
|
|
195
|
+
- **Data Visualization and Cell Rendering**:
|
|
196
|
+
- **Charts in Cells**: Render compact visuals such as progress lines, progress lines with values, sparklines, bar charts, timelines, rating stars, badges, change indicators, thumbs, and pie charts.
|
|
197
|
+
- **Heat and Cold Maps**: Color-code values with gradients and legends so users can compare magnitude quickly.
|
|
198
|
+
- **Conditional Formatting**: Apply styling rules based on cell values, row data, or custom logic.
|
|
199
|
+
- **Multi-Cell Formatting**: Choose different renderers or editors inside the same column based on row-level conditions.
|
|
200
|
+
- **Cell Flash**: Highlight recently changed values so live updates are easy to spot.
|
|
201
|
+
- **Avatar, Badge, Progress, Rate, Link, and Chart Column Types**: Use ready-made renderers for common visual data patterns.
|
|
202
|
+
- **Array Renderer**: Display array-like values inside cells with a purpose-built renderer.
|
|
203
|
+
- **Buttons**: Add action buttons inside grid cells for row-level commands.
|
|
204
|
+
|
|
205
|
+
- **Editing and Data Entry**:
|
|
206
|
+
- **Dynamic Form Editing**: Edit row data through a generated form with custom options and richer inputs.
|
|
207
|
+
- **Full Row Editing**: Edit multiple columns in a row as one coordinated editing flow.
|
|
208
|
+
- **Cell Checkbox Editors**: Use checkbox cells that act as both renderer and editor.
|
|
209
|
+
- **Cell Slider Editor**: Edit bounded numeric values with an inline slider.
|
|
210
|
+
- **Cell Counter Editor**: Adjust numeric values with plus/minus controls and configurable steps.
|
|
211
|
+
- **Textarea Editor**: Edit longer text values without leaving the grid.
|
|
212
|
+
- **Dropdown Editor**: Edit values through a dropdown or custom popup.
|
|
213
|
+
- **Timeline Editor**: Edit date ranges and timeline-like values with visual controls.
|
|
214
|
+
- **Cell Validation**: Highlight invalid cells and block or guide invalid edits with custom rules.
|
|
215
|
+
- **Input Validation**: Validate editor input before it is committed to the grid.
|
|
216
|
+
|
|
217
|
+
- **User Interaction and UX**:
|
|
218
|
+
- **Context Menus**: Build menus for cells, rows, columns, and headers with actions such as cut, copy, paste, insert, delete, and custom commands.
|
|
219
|
+
- **Tooltips**: Show contextual information on hover for cells or custom grid elements.
|
|
220
|
+
- **Next Line Focus (WCAG)**: Move focus automatically to the next row during data entry workflows.
|
|
221
|
+
- **WCAG Helpers**: Improve keyboard and screen-reader-oriented grid workflows.
|
|
222
|
+
- **Cell Focus Helpers**: Extend focus behavior for custom editing and navigation scenarios.
|
|
223
|
+
- **Info Panel**: Show contextual status or helper information around grid interactions.
|
|
224
|
+
- **Loader**: Display loading state while remote data, exports, or long-running operations are in progress.
|
|
225
|
+
|
|
226
|
+
- **Development and Integration**:
|
|
227
|
+
- **Event Manager**: Coordinate grid events through one managed layer for easier customization and cleanup.
|
|
228
|
+
- **Observable Props**: React to property changes and synchronize plugin state with grid configuration.
|
|
229
|
+
- **Plugin Dependencies**: Declare and resolve plugin relationships when features need to work together.
|
|
230
|
+
- **Dimension Animation**: Animate row and column dimension changes for smoother layout transitions.
|
|
231
|
+
- **Dropdown Infrastructure**: Reuse popup/dropdown services for custom editors and plugin UI.
|
|
232
|
+
- **Grid Presets and Utilities**: Compose reusable grid configurations, helper functions, and shared plugin behavior.
|
|
233
|
+
|
|
234
|
+
- **Enterprise Analytics and Planning**:
|
|
235
|
+
- **Pivot Table**: Build multidimensional analytics with dynamic row, column, and value dimensions; built-in and custom aggregations; hierarchical rows; generated column groups; flat headers; grand totals and subtotals; values-on-rows layouts; row and column drill-down; grouped aggregate values; drag-and-drop configuration; compact field panel; server-side engine/store contracts; remote sorting and filtering; drilldown contracts; field registry validation; cache keys; serializable errors; and state save/load.
|
|
236
|
+
- **Pivot Configurator**: Give users a drag-and-drop UI for choosing Pivot rows, columns, values, filters, and field layout.
|
|
237
|
+
- **Gantt & Scheduling**: Plan projects with task, dependency, calendar, resource, assignment, and baseline models; summary tasks and milestones; WBS hierarchy; automatic scheduling; working calendars and holidays; constrained scheduling; dependency validation; FS, SS, FF, and SF dependencies with lead/lag; critical path and slack; baselines; resource filtering; task move, resize, create, and progress controls; indent/outdent; timeline zoom; highlighted ranges; non-working time shading; labels; and custom markers.
|
|
238
|
+
- **Gantt Toolbar**: Provide ready-made timeline navigation, baseline, critical path, and export actions for Gantt views.
|
|
239
|
+
- **Gantt Task Editor Dialog**: Edit task fields, dependencies, resources, and scheduling details in a structured dialog.
|
|
240
|
+
|
|
241
|
+
- **Advanced Support**:
|
|
242
|
+
- **AI Agent Support**: Use Pro AI tooling to generate plugins, renderers, templates, and grid configurations.
|
|
243
|
+
- **RevoGrid MCP - AI-Native Grid Intelligence**: Connect AI coding tools to version-aware docs, examples, migrations, feature resolution, and typed API context.
|
|
244
|
+
- **Support via GitHub**: Get engineering support through GitHub-based workflows.
|
|
245
|
+
- **Support via Email**: Get direct support for Pro and enterprise implementation questions.
|
|
246
|
+
|
|
247
|
+
|
|
137
248
|
<h2 align="center">Framework Friendly</h2>
|
|
138
249
|
|
|
139
250
|
<p align="center">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import{h as e,proxyCustomElement as t,HTMLElement as i,createEvent as r,transformTag as s}from"@stencil/core/internal/client";import{M as o,D as n,d as h,H as l,F as a,e as d,f as c}from"./consts.js";import"./platform.js";import{a as u}from"./dimension.helpers.js";import{c as v}from"./filter.button.js";import{Q as g}from"./column.service.js";function p(e,t,i){const r=new CustomEvent(t,{detail:i,cancelable:!0,bubbles:!0});return null==e||e.dispatchEvent(r),r}function b(e,t,i){return e.preventDefault(),p(e.target,t,i)}const f=({column:t})=>{var i;const r={class:null!==(i=null==t?void 0:t.order)&&void 0!==i?i:"sort-off"};return e("span",Object.assign({},{class:"sort-indicator"}),e("i",Object.assign({},r)),(null==t?void 0:t.sortIndex)?e("sup",Object.assign({},{class:"sort-order-index"}),t.sortIndex):null)};var m;!function(e){e.start="resize:start",e.move="resize:move",e.end="resize:end"}(m||(m={}));const z={"resizable-r":{bit:1,cursor:"ew-resize"},"resizable-rb":{bit:3,cursor:"se-resize"},"resizable-b":{bit:2,cursor:"s-resize"},"resizable-lb":{bit:6,cursor:"sw-resize"},"resizable-l":{bit:4,cursor:"w-resize"},"resizable-lt":{bit:12,cursor:"nw-resize"},"resizable-t":{bit:8,cursor:"n-resize"},"resizable-rt":{bit:9,cursor:"ne-resize"}};class x{constructor(e,t){var i,r,s;this.initialProps=e,this.$event=t,this.mouseX=0,this.mouseY=0,this.width=0,this.height=0,this.changeX=0,this.changeY=0,this.disableCalcMap=15,this.props=(s=e,Object.assign(Object.assign({},s),{fitParent:s.fitParent||!1,active:s.active||[],disableAttributes:s.disableAttributes||[],minWidth:s.minWidth||0,minHeight:s.minHeight||0})),this.mouseMoveFunc=this.handleMove.bind(this),this.mouseUpFunc=this.handleUp.bind(this),this.minW=this.props.minWidth,this.minH=this.props.minHeight,this.maxW=null!==(i=this.props.maxWidth)&&void 0!==i?i:0,this.maxH=null!==(r=this.props.maxHeight)&&void 0!==r?r:0,this.parent={width:0,height:0},this.resizeState=0}set(e){this.$el=e,this.props.disableAttributes.forEach((e=>{switch(e){case"l":this.disableCalcMap&=-2;break;case"t":this.disableCalcMap&=-3;break;case"w":this.disableCalcMap&=-5;break;case"h":this.disableCalcMap&=-9}}))}emitEvent(e,t){var i;if(!this.$event)return;const r=null===(i=this.activeResizer)||void 0===i?void 0:i.classList.contains("resizable-l");this.$event(Object.assign({eventName:e,width:this.width+this.changeX*(r?-1:1),height:this.height+this.changeY,changedX:this.changeX,changedY:this.changeY},t))}static isTouchEvent(e){var t;return(null===(t=e.touches)||void 0===t?void 0:t.length)>=0}handleMove(e){var t;if(!this.resizeState)return;let i,r;x.isTouchEvent(e)?(i=e.touches[0].clientY,r=e.touches[0].clientX):(i=e.clientY,r=e.clientX);let s=this.resizeState&z["resizable-r"].bit||this.resizeState&z["resizable-l"].bit;if((this.resizeState&z["resizable-t"].bit||this.resizeState&z["resizable-b"].bit)&&8&this.disableCalcMap){let e=this.changeY+(i-this.mouseY);const t=this.height+e;t<this.minH&&(e=-(this.height-this.minH)),this.maxH&&t>this.maxH&&(e=this.maxH-this.height),this.changeY=e,this.mouseY=i,this.activeResizer&&(this.activeResizer.style.bottom=-this.changeY+"px")}if(s&&4&this.disableCalcMap){const e=null===(t=this.activeResizer)||void 0===t?void 0:t.classList.contains("resizable-l");let i=this.changeX+(r-this.mouseX);const s=this.width+i*(e?-1:1);s<this.minW&&(i=-(this.width-this.minW)),this.maxW&&s>this.maxW&&(i=this.maxW-this.width),this.changeX=i,this.mouseX=r,this.activeResizer&&(e?this.activeResizer.style.left=`${this.changeX}px`:this.activeResizer.style.right=-this.changeX+"px")}this.emitEvent(m.move)}handleDown(e){if(!e.defaultPrevented){e.preventDefault(),this.dropInitial();for(let t in z){const i=e.target;if(this.$el.contains(i)&&(null==i?void 0:i.classList.contains(t))){document.body.style.cursor=z[t].cursor,x.isTouchEvent(e)?this.setInitials(e.touches[0],i):(e.preventDefault&&e.preventDefault(),this.setInitials(e,i)),this.resizeState=z[t].bit,this.emitEvent(m.start);break}}this.bindMove()}}handleUp(e){e.preventDefault(),0!==this.resizeState&&(this.resizeState=0,document.body.style.cursor="",this.emitEvent(m.end)),this.dropInitial(),this.unbindMove()}setInitials({clientX:e,clientY:t},i){var r,s,o,n;const h=getComputedStyle(this.$el);if(this.$el.classList.add("active"),this.activeResizer=i,4&this.disableCalcMap){this.mouseX=e,this.width=this.$el.clientWidth,this.parent.width=null!==(s=null===(r=this.$el.parentElement)||void 0===r?void 0:r.clientWidth)&&void 0!==s?s:0;const t=parseFloat(h.paddingLeft)+parseFloat(h.paddingRight);this.minW=Math.max(t,this.initialProps.minWidth||0),this.initialProps.maxWidth&&(this.maxW=Math.max(this.width,this.initialProps.maxWidth))}if(8&this.disableCalcMap){this.mouseY=t,this.height=this.$el.clientHeight,this.parent.height=null!==(n=null===(o=this.$el.parentElement)||void 0===o?void 0:o.clientHeight)&&void 0!==n?n:0;const e=parseFloat(h.paddingTop)+parseFloat(h.paddingBottom);this.minH=Math.max(e,this.initialProps.minHeight||0),this.initialProps.maxHeight&&(this.maxH=Math.max(this.height,this.initialProps.maxHeight))}}dropInitial(){this.changeX=this.changeY=this.minW=this.minH,this.width=this.height=0,this.activeResizer&&this.activeResizer.removeAttribute("style"),this.$el.classList.remove("active"),this.activeResizer=void 0}bindMove(){document.documentElement.addEventListener("mouseup",this.mouseUpFunc,!0),document.documentElement.addEventListener("touchend",this.mouseUpFunc,!0),document.documentElement.addEventListener("mousemove",this.mouseMoveFunc,!0),document.documentElement.addEventListener("touchmove",this.mouseMoveFunc,!0),document.documentElement.addEventListener("mouseleave",this.mouseUpFunc)}unbindMove(){document.documentElement.removeEventListener("mouseup",this.mouseUpFunc,!0),document.documentElement.removeEventListener("touchend",this.mouseUpFunc,!0),document.documentElement.removeEventListener("mousemove",this.mouseMoveFunc,!0),document.documentElement.removeEventListener("touchmove",this.mouseMoveFunc,!0),document.documentElement.removeEventListener("mouseleave",this.mouseUpFunc)}}const w=(t,i)=>{const r=[],s=t.canResize&&new x(t,(e=>{var i;e.eventName===m.end&&(null===(i=t.onResize)||void 0===i||i.call(t,e))}))||null;if(t.active)if(t.canResize)for(let i in t.active)r.push(e("div",{onClick:e=>e.preventDefault(),onDblClick:e=>{var i;e.preventDefault(),null===(i=t.onDblClick)||void 0===i||i.call(t,e)},onMouseDown:e=>null==s?void 0:s.handleDown(e),onTouchStart:e=>null==s?void 0:s.handleDown(e),class:`resizable resizable-${t.active[i]}`}));else for(let i in t.active)r.push(e("div",{onClick:e=>e.preventDefault(),onTouchStart:e=>e.preventDefault(),onDblClick:e=>{var i;e.preventDefault(),null===(i=t.onDblClick)||void 0===i||i.call(t,e)},class:"no-resize"}));return e("div",Object.assign({},t,{ref:e=>e&&(null==s?void 0:s.set(e))}),i,r)},C="columnclick",H=({data:t,props:i,additionalData:r},s)=>{let o=(null==t?void 0:t.name)||"",n=i;if((null==t?void 0:t.columnTemplate)&&(o=t.columnTemplate(e,t,r)),null==t?void 0:t.columnProperties){const e=t.columnProperties(t);e&&(n=g(i,e))}const h=Object.assign(Object.assign({},n),{onMouseDown(e){p(e.currentTarget,C,{data:t,event:e})}});return e(w,Object.assign({},h),e("div",{class:"header-content"},o),s)},k=t=>{var i,r,s,d,c,u,g;const p={[l]:!0,[h]:!!(null===(i=t.data)||void 0===i?void 0:i.sortable)};(null===(r=t.data)||void 0===r?void 0:r.order)&&(p[t.data.order]=!0);const b={key:String(null!==(d=null===(s=t.data)||void 0===s?void 0:s.prop)&&void 0!==d?d:t.column.itemIndex),[n]:t.column.itemIndex,canResize:t.canResize,minWidth:(null===(c=t.data)||void 0===c?void 0:c.minSize)||o,maxWidth:null===(u=t.data)||void 0===u?void 0:u.maxSize,active:t.active||["r"],class:p,style:{width:`${t.column.size}px`,transform:`translateX(${t.column.start-(t.renderOffset||0)}px)`},onResize:t.onResize,onDblClick(e){var i;null===(i=t.onDblClick)||void 0===i||i.call(t,{column:t.data,index:t.column.itemIndex,originalEvent:e,providers:t.data.providers})},onClick(e){!e.defaultPrevented&&t.onClick&&t.onClick({column:t.data,index:t.column.itemIndex,originalEvent:e,providers:t.data.providers})}};return t.range&&t.column.itemIndex>=t.range.x&&t.column.itemIndex<=t.range.x1&&"object"==typeof b.class&&(b.class[a]=!0),e(H,{data:t.data,props:b,additionalData:t.additionalData},e(f,{column:t.data}),t.canFilter&&!1!==(null===(g=t.data)||void 0===g?void 0:g.filter)?e(v,{column:t.data}):"")},y=t=>{const i={key:`${t.group.name}-${t.group.indexes.join("-")}`,canResize:t.canResize,minWidth:t.group.indexes.length*o,maxWidth:0,active:t.active||["r"],class:{[l]:!0},style:{transform:`translateX(${t.start-(t.renderOffset||0)}px)`,width:t.end-t.start+"px"},onResize:t.onResize};return e(H,{data:Object.assign(Object.assign({},t.group),{prop:"",providers:t.providers,index:t.start}),props:i,additionalData:t.additionalData})},j=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.initialHeaderClick=r(this,"beforeheaderclick",7),this.headerresize=r(this,"headerresize",7),this.beforeResize=r(this,"beforeheaderresize",7),this.headerdblClick=r(this,"headerdblclick",7),this.beforeHeaderRender=r(this,"beforeheaderrender",7),this.beforeGroupHeaderRender=r(this,"beforegroupheaderrender",7),this.afterHeaderRender=r(this,"afterheaderrender",7),this.groupingDepth=0,this.additionalData={}}onResize({width:e},t){this.beforeResize.emit([Object.assign(Object.assign({},this.colData[t]),{size:e||void 0})]).defaultPrevented||this.headerresize.emit({[t]:e||0})}onResizeGroup(e,t,i){const r={},s=e/(i-t+1);for(let e=t;e<=i;e++){const t=u(this.dimensionCol.state,e);r[e]=t.end-t.start+s}this.headerresize.emit(r)}componentDidRender(){this.afterHeaderRender.emit(this.providers)}render(){var t;const i=this.viewportCol.get("items"),r=null===(t=this.selectionStore)||void 0===t?void 0:t.get("range"),{cells:s}=this.renderHeaderColumns(i,r),o=this.renderGroupingColumns();return[e("div",{key:"3cc466db6bc4df0cd61c47a22c3a0473318e5dd8",class:"group-rgRow"},o),e("div",{key:"9742a3fa4d4b75073aef5544806f42386ebffdea",class:`${d} ${c}`},s)]}renderHeaderColumns(t,i){const r=[],s=this.viewportCol.get("renderOffset")||0;for(let e of t){const t={range:i,column:e,data:Object.assign(Object.assign({},this.colData[e.itemIndex]),{index:e.itemIndex,providers:this.providers}),canFilter:!!this.columnFilter,canResize:this.canResize,renderOffset:s,active:this.resizeHandler,additionalData:this.additionalData,onResize:t=>this.onResize(t,e.itemIndex),onDblClick:e=>this.headerdblClick.emit(e),onClick:e=>this.initialHeaderClick.emit(e)},o=this.beforeHeaderRender.emit(t);o.defaultPrevented||r.push(o.detail)}const o=this.getDuplicateHeaderProps(r);return{cells:r.map((t=>e(k,Object.assign({key:this.getHeaderCellKey(t.data,this.type,o)},t))))}}renderGroupingColumns(){const e=this.getVisibleGroupRange();return Array.from({length:this.groupingDepth},((t,i)=>this.renderGroupRow(i,e))).flat()}renderGroupRow(t,i){return[...(this.groups[t]||[]).map((e=>this.renderGroupColumn(e,t,i))).filter((e=>!!e)),e("div",{key:`group-row-${t}`,class:{[d]:!0,group:!0}})]}renderGroupColumn(t,i,r){const s=this.getGroupIndexRange(t),o=this.getGroupBounds(s),n={level:i,providers:this.providers,start:o.start,end:o.end,group:t,renderOffset:this.viewportCol.get("renderOffset")||0,active:this.resizeHandler,canResize:this.canResize,additionalData:this.additionalData,onResize:e=>{var t;return s?this.onResizeGroup(null!==(t=e.changedX)&&void 0!==t?t:0,s.startIndex,s.endIndex):void 0}},h=this.beforeGroupHeaderRender.emit(n);if(h.defaultPrevented)return;const l=this.getGroupIndexRange(h.detail.group);if(!(l&&r&&(a=l.startIndex,d=l.endIndex,c=r,a<=c.end&&d>=c.start)))return;var a,d,c;h.detail.onResize===n.onResize&&(h.detail.onResize=e=>{var t;return this.onResizeGroup(null!==(t=e.changedX)&&void 0!==t?t:0,l.startIndex,l.endIndex)});const u=this.getGroupBounds(l);return h.detail.start===n.start&&(h.detail.start=u.start),h.detail.end===n.end&&(h.detail.end=u.end),e(y,Object.assign({key:this.getGroupHeaderCellKey(h.detail.group,i)},h.detail))}getGroupIndexRange(e){var t;const i=null!==(t=e.indexes[0])&&void 0!==t?t:-1;if(!(i<0))return{startIndex:i,endIndex:e.indexes[e.indexes.length-1]}}getGroupBounds(e){return e?{start:u(this.dimensionCol.state,e.startIndex).start,end:u(this.dimensionCol.state,e.endIndex).end}:{start:0,end:0}}getVisibleGroupRange(){const e=this.viewportCol.get("items");if(e.length)return e.reduce(((e,t)=>({start:Math.min(e.start,t.itemIndex),end:Math.max(e.end,t.itemIndex)})),{start:e[0].itemIndex,end:e[0].itemIndex})}getHeaderCellKey(e,t,i){if(void 0===(null==e?void 0:e.prop))return`${t}-${String(null==e?void 0:e.index)}`;const r=String(e.prop);return i.has(r)?`${t}-${r}-${String(e.index)}`:`${t}-${r}`}getDuplicateHeaderProps(e){const t=new Set,i=new Set;return e.forEach((({data:e})=>{if(void 0!==(null==e?void 0:e.prop)){const r=String(e.prop);t.has(r)?i.add(r):t.add(r)}})),i}getGroupHeaderCellKey(e,t){return`group-${t}-${e.name}-${e.indexes.join("-")}`}get providers(){return{type:this.type,readonly:this.readonly,data:this.colData,viewport:this.viewportCol,dimension:this.dimensionCol,selection:this.selectionStore}}get element(){return this}static get style(){return'@charset "UTF-8";revogr-header{position:relative;z-index:5;display:block}revogr-header .header-rgRow{display:block;position:relative}revogr-header .header-rgRow.group{z-index:0}revogr-header .group-rgRow{position:relative;overflow:hidden}revogr-header .rgHeaderCell{position:absolute;box-sizing:border-box;height:100%;z-index:1;display:flex}revogr-header .rgHeaderCell.align-center{text-align:center}revogr-header .rgHeaderCell.align-left{text-align:left}revogr-header .rgHeaderCell.align-right{text-align:right}revogr-header .rgHeaderCell.sortable{cursor:pointer}revogr-header .rgHeaderCell .sort-indicator{display:inline-flex;align-items:flex-start;gap:1px}revogr-header .rgHeaderCell .sort-indicator i.asc:after,revogr-header .rgHeaderCell .sort-indicator i.desc:after{font-size:13px}revogr-header .rgHeaderCell .sort-indicator i.asc:after{content:"↑"}revogr-header .rgHeaderCell .sort-indicator i.desc:after{content:"↓"}revogr-header .rgHeaderCell .sort-indicator .sort-order-index{font-size:10px;line-height:1;top:0}revogr-header .rgHeaderCell.active{z-index:10}revogr-header .rgHeaderCell.active .resizable{background-color:deepskyblue}revogr-header .rgHeaderCell .header-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}revogr-header .rgHeaderCell .resizable{display:block;position:absolute;z-index:90;touch-action:none;user-select:none}revogr-header .rgHeaderCell .resizable:hover{background-color:deepskyblue}revogr-header .rgHeaderCell>.resizable-r{cursor:ew-resize;width:6px;right:0;top:0;height:100%}revogr-header .rgHeaderCell>.resizable-rb{cursor:se-resize;width:6px;height:6px;right:0;bottom:0}revogr-header .rgHeaderCell>.resizable-b{cursor:s-resize;height:6px;bottom:0;width:100%;left:0}revogr-header .rgHeaderCell>.resizable-lb{cursor:sw-resize;width:6px;height:6px;left:0;bottom:0}revogr-header .rgHeaderCell>.resizable-l{cursor:w-resize;width:6px;left:0;height:100%;top:0}revogr-header .rgHeaderCell>.resizable-lt{cursor:nw-resize;width:6px;height:6px;left:0;top:0}revogr-header .rgHeaderCell>.resizable-t{cursor:n-resize;height:6px;top:0;width:100%;left:0}revogr-header .rgHeaderCell>.resizable-rt{cursor:ne-resize;width:6px;height:6px;right:0;top:0}revogr-header .rv-filter{visibility:hidden}'}},[0,"revogr-header",{viewportCol:[16],dimensionCol:[16],selectionStore:[16],groups:[16],groupingDepth:[2,"grouping-depth"],readonly:[4],canResize:[4,"can-resize"],resizeHandler:[16],colData:[16],columnFilter:[4,"column-filter"],type:[1],additionalData:[8,"additional-data"]}]);function O(){"undefined"!=typeof customElements&&["revogr-header"].forEach((e=>{"revogr-header"===e&&(customElements.get(s(e))||customElements.define(s(e),j))}))}export{C as O,j as R,f as S,b as a,O as b,p as d}
|
|
4
|
+
import{h as e,proxyCustomElement as t,HTMLElement as i,createEvent as r,transformTag as s}from"@stencil/core/internal/client";import{M as o,D as n,d as h,H as l,F as a,e as d,f as c}from"./consts.js";import"./platform.js";import{a as u}from"./dimension.helpers.js";import{c as v}from"./filter.button.js";import{Q as g}from"./column.service.js";function p(e,t,i){const r=new CustomEvent(t,{detail:i,cancelable:!0,bubbles:!0});return null==e||e.dispatchEvent(r),r}function b(e,t,i){return e.preventDefault(),p(e.target,t,i)}const f=({column:t})=>{var i;const r={class:null!==(i=null==t?void 0:t.order)&&void 0!==i?i:"sort-off"};return e("span",Object.assign({},{class:"sort-indicator"}),e("i",Object.assign({},r)),(null==t?void 0:t.sortIndex)?e("sup",Object.assign({},{class:"sort-order-index"}),t.sortIndex):null)};var m;!function(e){e.start="resize:start",e.move="resize:move",e.end="resize:end"}(m||(m={}));const z={"resizable-r":{bit:1,cursor:"ew-resize"},"resizable-rb":{bit:3,cursor:"se-resize"},"resizable-b":{bit:2,cursor:"s-resize"},"resizable-lb":{bit:6,cursor:"sw-resize"},"resizable-l":{bit:4,cursor:"w-resize"},"resizable-lt":{bit:12,cursor:"nw-resize"},"resizable-t":{bit:8,cursor:"n-resize"},"resizable-rt":{bit:9,cursor:"ne-resize"}};class x{constructor(e,t){var i,r,s;this.initialProps=e,this.$event=t,this.mouseX=0,this.mouseY=0,this.width=0,this.height=0,this.changeX=0,this.changeY=0,this.disableCalcMap=15,this.props=(s=e,Object.assign(Object.assign({},s),{fitParent:s.fitParent||!1,active:s.active||[],disableAttributes:s.disableAttributes||[],minWidth:s.minWidth||0,minHeight:s.minHeight||0})),this.mouseMoveFunc=this.handleMove.bind(this),this.mouseUpFunc=this.handleUp.bind(this),this.minW=this.props.minWidth,this.minH=this.props.minHeight,this.maxW=null!==(i=this.props.maxWidth)&&void 0!==i?i:0,this.maxH=null!==(r=this.props.maxHeight)&&void 0!==r?r:0,this.parent={width:0,height:0},this.resizeState=0}set(e){this.$el=e,this.props.disableAttributes.forEach((e=>{switch(e){case"l":this.disableCalcMap&=-2;break;case"t":this.disableCalcMap&=-3;break;case"w":this.disableCalcMap&=-5;break;case"h":this.disableCalcMap&=-9}}))}emitEvent(e,t){var i;if(!this.$event)return;const r=null===(i=this.activeResizer)||void 0===i?void 0:i.classList.contains("resizable-l");this.$event(Object.assign({eventName:e,width:this.width+this.changeX*(r?-1:1),height:this.height+this.changeY,changedX:this.changeX,changedY:this.changeY},t))}static isTouchEvent(e){var t;return(null===(t=e.touches)||void 0===t?void 0:t.length)>=0}handleMove(e){var t;if(!this.resizeState)return;let i,r;x.isTouchEvent(e)?(i=e.touches[0].clientY,r=e.touches[0].clientX):(i=e.clientY,r=e.clientX);let s=this.resizeState&z["resizable-r"].bit||this.resizeState&z["resizable-l"].bit;if((this.resizeState&z["resizable-t"].bit||this.resizeState&z["resizable-b"].bit)&&8&this.disableCalcMap){let e=this.changeY+(i-this.mouseY);const t=this.height+e;t<this.minH&&(e=-(this.height-this.minH)),this.maxH&&t>this.maxH&&(e=this.maxH-this.height),this.changeY=e,this.mouseY=i,this.activeResizer&&(this.activeResizer.style.bottom=-this.changeY+"px")}if(s&&4&this.disableCalcMap){const e=null===(t=this.activeResizer)||void 0===t?void 0:t.classList.contains("resizable-l");let i=this.changeX+(r-this.mouseX);const s=this.width+i*(e?-1:1);s<this.minW&&(i=-(this.width-this.minW)),this.maxW&&s>this.maxW&&(i=this.maxW-this.width),this.changeX=i,this.mouseX=r,this.activeResizer&&(e?this.activeResizer.style.left=`${this.changeX}px`:this.activeResizer.style.right=-this.changeX+"px")}this.emitEvent(m.move)}handleDown(e){if(!e.defaultPrevented){e.preventDefault(),this.dropInitial();for(let t in z){const i=e.target;if(this.$el.contains(i)&&(null==i?void 0:i.classList.contains(t))){document.body.style.cursor=z[t].cursor,x.isTouchEvent(e)?this.setInitials(e.touches[0],i):(e.preventDefault&&e.preventDefault(),this.setInitials(e,i)),this.resizeState=z[t].bit,this.emitEvent(m.start);break}}this.bindMove()}}handleUp(e){e.preventDefault(),0!==this.resizeState&&(this.resizeState=0,document.body.style.cursor="",this.emitEvent(m.end)),this.dropInitial(),this.unbindMove()}setInitials({clientX:e,clientY:t},i){var r,s,o,n;const h=getComputedStyle(this.$el);if(this.$el.classList.add("active"),this.activeResizer=i,4&this.disableCalcMap){this.mouseX=e,this.width=this.$el.clientWidth,this.parent.width=null!==(s=null===(r=this.$el.parentElement)||void 0===r?void 0:r.clientWidth)&&void 0!==s?s:0;const t=parseFloat(h.paddingLeft)+parseFloat(h.paddingRight);this.minW=Math.max(t,this.initialProps.minWidth||0),this.initialProps.maxWidth&&(this.maxW=Math.max(this.width,this.initialProps.maxWidth))}if(8&this.disableCalcMap){this.mouseY=t,this.height=this.$el.clientHeight,this.parent.height=null!==(n=null===(o=this.$el.parentElement)||void 0===o?void 0:o.clientHeight)&&void 0!==n?n:0;const e=parseFloat(h.paddingTop)+parseFloat(h.paddingBottom);this.minH=Math.max(e,this.initialProps.minHeight||0),this.initialProps.maxHeight&&(this.maxH=Math.max(this.height,this.initialProps.maxHeight))}}dropInitial(){this.changeX=this.changeY=this.minW=this.minH,this.width=this.height=0,this.activeResizer&&this.activeResizer.removeAttribute("style"),this.$el.classList.remove("active"),this.activeResizer=void 0}bindMove(){document.documentElement.addEventListener("mouseup",this.mouseUpFunc,!0),document.documentElement.addEventListener("touchend",this.mouseUpFunc,!0),document.documentElement.addEventListener("mousemove",this.mouseMoveFunc,!0),document.documentElement.addEventListener("touchmove",this.mouseMoveFunc,!0),document.documentElement.addEventListener("mouseleave",this.mouseUpFunc)}unbindMove(){document.documentElement.removeEventListener("mouseup",this.mouseUpFunc,!0),document.documentElement.removeEventListener("touchend",this.mouseUpFunc,!0),document.documentElement.removeEventListener("mousemove",this.mouseMoveFunc,!0),document.documentElement.removeEventListener("touchmove",this.mouseMoveFunc,!0),document.documentElement.removeEventListener("mouseleave",this.mouseUpFunc)}}const w=(t,i)=>{const r=[],s=t.canResize&&new x(t,(e=>{var i;e.eventName===m.end&&(null===(i=t.onResize)||void 0===i||i.call(t,e))}))||null;if(t.active&&t.canResize)for(let i in t.active)r.push(e("div",{onClick:e=>e.preventDefault(),onDblClick:e=>{var i;e.preventDefault(),null===(i=t.onDblClick)||void 0===i||i.call(t,e)},onMouseDown:e=>null==s?void 0:s.handleDown(e),onTouchStart:e=>null==s?void 0:s.handleDown(e),class:`resizable resizable-${t.active[i]}`}));return e("div",Object.assign({},t,{ref:e=>e&&(null==s?void 0:s.set(e))}),i,r)},C="columnclick",H=({data:t,props:i,additionalData:r},s)=>{let o=(null==t?void 0:t.name)||"",n=i;if((null==t?void 0:t.columnTemplate)&&(o=t.columnTemplate(e,t,r)),null==t?void 0:t.columnProperties){const e=t.columnProperties(t);e&&(n=g(i,e))}const h=Object.assign(Object.assign({},n),{onMouseDown(e){p(e.currentTarget,C,{data:t,event:e})}});return e(w,Object.assign({},h),e("div",{class:"header-content"},o),s)},y=t=>{var i,r,s,d,c,u,g,p,b,m;const z=!!((null===(i=t.data)||void 0===i?void 0:i.sortable)||(null===(r=t.data)||void 0===r?void 0:r.order)||(null===(s=t.data)||void 0===s?void 0:s.sortIndex)),x={[l]:!0,[h]:!!(null===(d=t.data)||void 0===d?void 0:d.sortable)};(null===(c=t.data)||void 0===c?void 0:c.order)&&(x[t.data.order]=!0);const w={key:String(null!==(g=null===(u=t.data)||void 0===u?void 0:u.prop)&&void 0!==g?g:t.column.itemIndex),[n]:t.column.itemIndex,canResize:t.canResize,minWidth:(null===(p=t.data)||void 0===p?void 0:p.minSize)||o,maxWidth:null===(b=t.data)||void 0===b?void 0:b.maxSize,active:t.active||["r"],class:x,style:{width:`${t.column.size}px`,transform:`translateX(${t.column.start-(t.renderOffset||0)}px)`},onResize:t.onResize,onDblClick(e){var i;null===(i=t.onDblClick)||void 0===i||i.call(t,{column:t.data,index:t.column.itemIndex,originalEvent:e,providers:t.data.providers})},onClick(e){!e.defaultPrevented&&t.onClick&&t.onClick({column:t.data,index:t.column.itemIndex,originalEvent:e,providers:t.data.providers})}};return t.range&&t.column.itemIndex>=t.range.x&&t.column.itemIndex<=t.range.x1&&"object"==typeof w.class&&(w.class[a]=!0),e(H,{data:t.data,props:w,additionalData:t.additionalData},z?e(f,{column:t.data}):null,t.canFilter&&!1!==(null===(m=t.data)||void 0===m?void 0:m.filter)?e(v,{column:t.data}):"")},k=t=>{const i={key:`${t.group.name}-${t.group.indexes.join("-")}`,canResize:t.canResize,minWidth:t.group.indexes.length*o,maxWidth:0,active:t.active||["r"],class:{[l]:!0},style:{transform:`translateX(${t.start-(t.renderOffset||0)}px)`,width:t.end-t.start+"px"},onResize:t.onResize};return e(H,{data:Object.assign(Object.assign({},t.group),{prop:"",providers:t.providers,index:t.start}),props:i,additionalData:t.additionalData})},j=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.initialHeaderClick=r(this,"beforeheaderclick",7),this.headerresize=r(this,"headerresize",7),this.beforeResize=r(this,"beforeheaderresize",7),this.headerdblClick=r(this,"headerdblclick",7),this.beforeHeaderRender=r(this,"beforeheaderrender",7),this.beforeGroupHeaderRender=r(this,"beforegroupheaderrender",7),this.afterHeaderRender=r(this,"afterheaderrender",7),this.groupingDepth=0,this.additionalData={}}onResize({width:e},t){this.beforeResize.emit([Object.assign(Object.assign({},this.colData[t]),{size:e||void 0})]).defaultPrevented||this.headerresize.emit({[t]:e||0})}onResizeGroup(e,t,i){const r={},s=e/(i-t+1);for(let e=t;e<=i;e++){const t=u(this.dimensionCol.state,e);r[e]=t.end-t.start+s}this.headerresize.emit(r)}componentDidRender(){this.afterHeaderRender.emit(this.providers)}render(){var t;const i=this.viewportCol.get("items"),r=null===(t=this.selectionStore)||void 0===t?void 0:t.get("range"),{cells:s}=this.renderHeaderColumns(i,r),o=this.renderGroupingColumns();return[e("div",{key:"3cc466db6bc4df0cd61c47a22c3a0473318e5dd8",class:"group-rgRow"},o),e("div",{key:"9742a3fa4d4b75073aef5544806f42386ebffdea",class:`${d} ${c}`},s)]}renderHeaderColumns(t,i){const r=[],s=this.viewportCol.get("renderOffset")||0;for(let e of t){const t={range:i,column:e,data:Object.assign(Object.assign({},this.colData[e.itemIndex]),{index:e.itemIndex,providers:this.providers}),canFilter:!!this.columnFilter,canResize:this.canResize,renderOffset:s,active:this.resizeHandler,additionalData:this.additionalData,onResize:t=>this.onResize(t,e.itemIndex),onDblClick:e=>this.headerdblClick.emit(e),onClick:e=>this.initialHeaderClick.emit(e)},o=this.beforeHeaderRender.emit(t);o.defaultPrevented||r.push(o.detail)}const o=this.getDuplicateHeaderProps(r);return{cells:r.map((t=>e(y,Object.assign({key:this.getHeaderCellKey(t.data,this.type,o)},t))))}}renderGroupingColumns(){const e=this.getVisibleGroupRange();return Array.from({length:this.groupingDepth},((t,i)=>this.renderGroupRow(i,e))).flat()}renderGroupRow(t,i){return[...(this.groups[t]||[]).map((e=>this.renderGroupColumn(e,t,i))).filter((e=>!!e)),e("div",{key:`group-row-${t}`,class:{[d]:!0,group:!0}})]}renderGroupColumn(t,i,r){const s=this.getGroupIndexRange(t),o=this.getGroupBounds(s),n={level:i,providers:this.providers,start:o.start,end:o.end,group:t,renderOffset:this.viewportCol.get("renderOffset")||0,active:this.resizeHandler,canResize:this.canResize,additionalData:this.additionalData,onResize:e=>{var t;return s?this.onResizeGroup(null!==(t=e.changedX)&&void 0!==t?t:0,s.startIndex,s.endIndex):void 0}},h=this.beforeGroupHeaderRender.emit(n);if(h.defaultPrevented)return;const l=this.getGroupIndexRange(h.detail.group);if(!(l&&r&&(a=l.startIndex,d=l.endIndex,c=r,a<=c.end&&d>=c.start)))return;var a,d,c;h.detail.onResize===n.onResize&&(h.detail.onResize=e=>{var t;return this.onResizeGroup(null!==(t=e.changedX)&&void 0!==t?t:0,l.startIndex,l.endIndex)});const u=this.getGroupBounds(l);return h.detail.start===n.start&&(h.detail.start=u.start),h.detail.end===n.end&&(h.detail.end=u.end),e(k,Object.assign({key:this.getGroupHeaderCellKey(h.detail.group,i)},h.detail))}getGroupIndexRange(e){var t;const i=null!==(t=e.indexes[0])&&void 0!==t?t:-1;if(!(i<0))return{startIndex:i,endIndex:e.indexes[e.indexes.length-1]}}getGroupBounds(e){return e?{start:u(this.dimensionCol.state,e.startIndex).start,end:u(this.dimensionCol.state,e.endIndex).end}:{start:0,end:0}}getVisibleGroupRange(){const e=this.viewportCol.get("items");if(e.length)return e.reduce(((e,t)=>({start:Math.min(e.start,t.itemIndex),end:Math.max(e.end,t.itemIndex)})),{start:e[0].itemIndex,end:e[0].itemIndex})}getHeaderCellKey(e,t,i){if(void 0===(null==e?void 0:e.prop))return`${t}-${String(null==e?void 0:e.index)}`;const r=String(e.prop);return i.has(r)?`${t}-${r}-${String(e.index)}`:`${t}-${r}`}getDuplicateHeaderProps(e){const t=new Set,i=new Set;return e.forEach((({data:e})=>{if(void 0!==(null==e?void 0:e.prop)){const r=String(e.prop);t.has(r)?i.add(r):t.add(r)}})),i}getGroupHeaderCellKey(e,t){return`group-${t}-${e.name}-${e.indexes.join("-")}`}get providers(){return{type:this.type,readonly:this.readonly,data:this.colData,viewport:this.viewportCol,dimension:this.dimensionCol,selection:this.selectionStore}}get element(){return this}static get style(){return'@charset "UTF-8";revogr-header{position:relative;z-index:5;display:block}revogr-header .header-rgRow{display:block;position:relative}revogr-header .header-rgRow.group{z-index:0}revogr-header .group-rgRow{position:relative;overflow:hidden}revogr-header .rgHeaderCell{position:absolute;box-sizing:border-box;height:100%;z-index:1;display:flex}revogr-header .rgHeaderCell.align-center{text-align:center}revogr-header .rgHeaderCell.align-left{text-align:left}revogr-header .rgHeaderCell.align-right{text-align:right}revogr-header .rgHeaderCell.sortable{cursor:pointer}revogr-header .rgHeaderCell .sort-indicator{display:inline-flex;align-items:flex-start;gap:1px}revogr-header .rgHeaderCell .sort-indicator i.asc:after,revogr-header .rgHeaderCell .sort-indicator i.desc:after{font-size:13px}revogr-header .rgHeaderCell .sort-indicator i.asc:after{content:"↑"}revogr-header .rgHeaderCell .sort-indicator i.desc:after{content:"↓"}revogr-header .rgHeaderCell .sort-indicator .sort-order-index{font-size:10px;line-height:1;top:0}revogr-header .rgHeaderCell.active{z-index:10}revogr-header .rgHeaderCell.active .resizable{background-color:deepskyblue}revogr-header .rgHeaderCell .header-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}revogr-header .rgHeaderCell .resizable{display:block;position:absolute;z-index:90;touch-action:none;user-select:none}revogr-header .rgHeaderCell .resizable:hover{background-color:deepskyblue}revogr-header .rgHeaderCell>.resizable-r{cursor:ew-resize;width:6px;right:0;top:0;height:100%}revogr-header .rgHeaderCell>.resizable-rb{cursor:se-resize;width:6px;height:6px;right:0;bottom:0}revogr-header .rgHeaderCell>.resizable-b{cursor:s-resize;height:6px;bottom:0;width:100%;left:0}revogr-header .rgHeaderCell>.resizable-lb{cursor:sw-resize;width:6px;height:6px;left:0;bottom:0}revogr-header .rgHeaderCell>.resizable-l{cursor:w-resize;width:6px;left:0;height:100%;top:0}revogr-header .rgHeaderCell>.resizable-lt{cursor:nw-resize;width:6px;height:6px;left:0;top:0}revogr-header .rgHeaderCell>.resizable-t{cursor:n-resize;height:6px;top:0;width:100%;left:0}revogr-header .rgHeaderCell>.resizable-rt{cursor:ne-resize;width:6px;height:6px;right:0;top:0}revogr-header .rv-filter{visibility:hidden}'}},[0,"revogr-header",{viewportCol:[16],dimensionCol:[16],selectionStore:[16],groups:[16],groupingDepth:[2,"grouping-depth"],readonly:[4],canResize:[4,"can-resize"],resizeHandler:[16],colData:[16],columnFilter:[4,"column-filter"],type:[1],additionalData:[8,"additional-data"]}]);function O(){"undefined"!=typeof customElements&&["revogr-header"].forEach((e=>{"revogr-header"===e&&(customElements.get(s(e))||customElements.define(s(e),j))}))}export{C as O,j as R,f as S,b as a,O as b,p as d}
|