@revolist/revogrid 4.21.6 → 4.21.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cell-renderer-DW8i7ULg.js → cell-renderer-uZmDBXz7.js} +4 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +16 -6
- package/dist/collection/components/data/revogr-data.js +5 -5
- package/dist/collection/components/data/row-renderer.js +4 -2
- package/dist/collection/components/editors/revogr-edit.js +2 -2
- package/dist/collection/components/header/revogr-header.js +5 -5
- package/dist/collection/components/order/revogr-order-editor.js +2 -2
- package/dist/collection/components/overlay/revogr-overlay-selection.js +2 -2
- package/dist/collection/components/revoGrid/revo-grid.js +24 -12
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +14 -4
- package/dist/collection/components/selectionFocus/revogr-focus.js +2 -2
- package/dist/esm/{cell-renderer-CqVunVBY.js → cell-renderer-K_BKH7Kx.js} +4 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/revogr-data_4.entry.js +16 -6
- package/dist/revo-grid/{cell-renderer-CqVunVBY.js → cell-renderer-K_BKH7Kx.js} +4 -2
- package/dist/revo-grid/index.esm.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +16 -6
- package/dist/types/components/data/revogr-data.d.ts +1 -1
- package/dist/types/components/data/row-renderer.d.ts +2 -1
- package/dist/types/services/column.data.provider.d.ts +1 -1
- package/dist/types/types/interfaces.d.ts +20 -20
- package/hydrate/index.js +19 -7
- package/hydrate/index.mjs +19 -7
- package/package.json +1 -1
- package/standalone/revogr-data2.js +1 -1
- package/standalone/revogr-viewport-scroll2.js +1 -1
|
@@ -13,8 +13,10 @@ const SortingSign = ({ column }) => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const PADDING_DEPTH = 10;
|
|
16
|
-
const RowRenderer = ({ rowClass, index: index$1, size, start, depth }, cells) => {
|
|
17
|
-
const props = Object.assign({ [dimension_helpers.DATA_ROW]: index$1 }
|
|
16
|
+
const RowRenderer = ({ rowClass, index: index$1, size, start, depth, groupingLevel }, cells) => {
|
|
17
|
+
const props = Object.assign({ [dimension_helpers.DATA_ROW]: index$1 }, (typeof groupingLevel === 'number'
|
|
18
|
+
? { 'data-level': groupingLevel }
|
|
19
|
+
: {}));
|
|
18
20
|
return (index.h("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
19
21
|
height: `${size}px`,
|
|
20
22
|
transform: `translateY(${start}px)`,
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var column_service = require('./column.service-DvQDqxxx.js');
|
|
7
7
|
var column_drag_plugin = require('./column.drag.plugin-BWX5_5iT.js');
|
|
8
8
|
var headerCellRenderer = require('./header-cell-renderer-B1dJwgTO.js');
|
|
9
|
-
var cellRenderer = require('./cell-renderer-
|
|
9
|
+
var cellRenderer = require('./cell-renderer-uZmDBXz7.js');
|
|
10
10
|
var dimension_helpers = require('./dimension.helpers-CaIsYC99.js');
|
|
11
11
|
var textEditor = require('./text-editor-BTnGaIl3.js');
|
|
12
12
|
var edit_utils = require('./edit.utils-CwMzSIVF.js');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var index = require('./index-Dq8Xzj5l.js');
|
|
7
7
|
var column_service = require('./column.service-DvQDqxxx.js');
|
|
8
8
|
var dimension_helpers = require('./dimension.helpers-CaIsYC99.js');
|
|
9
|
-
var cellRenderer = require('./cell-renderer-
|
|
9
|
+
var cellRenderer = require('./cell-renderer-uZmDBXz7.js');
|
|
10
10
|
var filter_button = require('./filter.button-w6LWnyhi.js');
|
|
11
11
|
var headerCellRenderer = require('./header-cell-renderer-B1dJwgTO.js');
|
|
12
12
|
var throttle = require('./throttle-CI4MsAqs.js');
|
|
@@ -225,7 +225,7 @@ const RevogrData = class {
|
|
|
225
225
|
if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {
|
|
226
226
|
rowClass += ` ${dimension_helpers.ROW_FOCUSED_CLASS}`;
|
|
227
227
|
}
|
|
228
|
-
const row = (index.h(cellRenderer.RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start }, cells));
|
|
228
|
+
const row = (index.h(cellRenderer.RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start, groupingLevel: groupDepth || undefined }, cells));
|
|
229
229
|
this.beforerowrender.emit({
|
|
230
230
|
node: row,
|
|
231
231
|
item: rgRow,
|
|
@@ -901,7 +901,7 @@ const RevogrViewportScroll = class {
|
|
|
901
901
|
* @param e
|
|
902
902
|
*/
|
|
903
903
|
onHorizontalMouseWheel(type, delta, e) {
|
|
904
|
-
var _a, _b;
|
|
904
|
+
var _a, _b, _c, _d;
|
|
905
905
|
if (!e.deltaX) {
|
|
906
906
|
return;
|
|
907
907
|
}
|
|
@@ -910,11 +910,21 @@ const RevogrViewportScroll = class {
|
|
|
910
910
|
const atRight = scrollLeft + clientWidth >= scrollWidth && e.deltaX > 0;
|
|
911
911
|
// Detect if the user has reached the left end
|
|
912
912
|
const atLeft = scrollLeft === 0 && e.deltaX < 0;
|
|
913
|
-
if (
|
|
914
|
-
(
|
|
913
|
+
if (this.noHorizontalScrollTransfer) {
|
|
914
|
+
if (!atRight && !atLeft) {
|
|
915
|
+
const nextScrollLeft = scrollLeft + e[delta];
|
|
916
|
+
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
917
|
+
this.horizontalScroll.scrollLeft = nextScrollLeft;
|
|
918
|
+
(_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(this.horizontalScroll.scrollLeft, type, undefined, e[delta]);
|
|
919
|
+
this.localScrollTimer.latestScrollUpdate(type);
|
|
920
|
+
}
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
if (!atRight && !atLeft) {
|
|
924
|
+
(_c = e.preventDefault) === null || _c === void 0 ? void 0 : _c.call(e);
|
|
915
925
|
}
|
|
916
926
|
const pos = scrollLeft + e[delta];
|
|
917
|
-
(
|
|
927
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
918
928
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
919
929
|
}
|
|
920
930
|
get horizontalScroll() { return index.getElement(this); }
|
|
@@ -157,7 +157,7 @@ export class RevogrData {
|
|
|
157
157
|
if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {
|
|
158
158
|
rowClass += ` ${ROW_FOCUSED_CLASS}`;
|
|
159
159
|
}
|
|
160
|
-
const row = (h(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start }, cells));
|
|
160
|
+
const row = (h(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start, groupingLevel: groupDepth || undefined }, cells));
|
|
161
161
|
this.beforerowrender.emit({
|
|
162
162
|
node: row,
|
|
163
163
|
item: rgRow,
|
|
@@ -395,7 +395,7 @@ export class RevogrData {
|
|
|
395
395
|
"mutable": false,
|
|
396
396
|
"complexType": {
|
|
397
397
|
"original": "Observable<DSourceState<ColumnRegular, DimensionCols>>",
|
|
398
|
-
"resolved": "\"colPinEnd\" | \"colPinStart\" | \"rgCol\" | ColumnRegular",
|
|
398
|
+
"resolved": "\"colPinEnd\" | \"colPinStart\" | \"rgCol\" | ColumnRegular<ColumnProp>",
|
|
399
399
|
"references": {
|
|
400
400
|
"Observable": {
|
|
401
401
|
"location": "import",
|
|
@@ -437,7 +437,7 @@ export class RevogrData {
|
|
|
437
437
|
"mutable": false,
|
|
438
438
|
"complexType": {
|
|
439
439
|
"original": "Observable<DSourceState<DataType, DimensionRows>>",
|
|
440
|
-
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D",
|
|
440
|
+
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D | K",
|
|
441
441
|
"references": {
|
|
442
442
|
"Observable": {
|
|
443
443
|
"location": "import",
|
|
@@ -613,7 +613,7 @@ export class RevogrData {
|
|
|
613
613
|
},
|
|
614
614
|
"complexType": {
|
|
615
615
|
"original": "BeforeCellRenderEvent<CellTemplateProp>",
|
|
616
|
-
"resolved": "BeforeCellRenderEvent<CellTemplateProp
|
|
616
|
+
"resolved": "BeforeCellRenderEvent<CellTemplateProp<DataType<any, ColumnProp>, ColumnRegular<ColumnProp>, ColumnProp>>",
|
|
617
617
|
"references": {
|
|
618
618
|
"BeforeCellRenderEvent": {
|
|
619
619
|
"location": "import",
|
|
@@ -663,7 +663,7 @@ export class RevogrData {
|
|
|
663
663
|
},
|
|
664
664
|
"complexType": {
|
|
665
665
|
"original": "DragStartEvent",
|
|
666
|
-
"resolved": "DragStartEvent",
|
|
666
|
+
"resolved": "DragStartEvent<DataType<any, ColumnProp>, ColumnRegular<ColumnProp>>",
|
|
667
667
|
"references": {
|
|
668
668
|
"DragStartEvent": {
|
|
669
669
|
"location": "import",
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
import { h } from "@stencil/core";
|
|
5
5
|
import { DATA_ROW } from "../../utils/consts";
|
|
6
6
|
export const PADDING_DEPTH = 10;
|
|
7
|
-
const RowRenderer = ({ rowClass, index, size, start, depth }, cells) => {
|
|
8
|
-
const props = Object.assign({ [DATA_ROW]: index }
|
|
7
|
+
const RowRenderer = ({ rowClass, index, size, start, depth, groupingLevel }, cells) => {
|
|
8
|
+
const props = Object.assign({ [DATA_ROW]: index }, (typeof groupingLevel === 'number'
|
|
9
|
+
? { 'data-level': groupingLevel }
|
|
10
|
+
: {}));
|
|
9
11
|
return (h("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
10
12
|
height: `${size}px`,
|
|
11
13
|
transform: `translateY(${start}px)`,
|
|
@@ -180,7 +180,7 @@ export class RevoEdit {
|
|
|
180
180
|
"mutable": false,
|
|
181
181
|
"complexType": {
|
|
182
182
|
"original": "ColumnDataSchemaModel | null",
|
|
183
|
-
"resolved": "ColumnDataSchemaModel | null",
|
|
183
|
+
"resolved": "ColumnDataSchemaModel<DataType<any, ColumnProp>, ColumnRegular<ColumnProp>, ColumnProp> | null",
|
|
184
184
|
"references": {
|
|
185
185
|
"ColumnDataSchemaModel": {
|
|
186
186
|
"location": "import",
|
|
@@ -204,7 +204,7 @@ export class RevoEdit {
|
|
|
204
204
|
"mutable": false,
|
|
205
205
|
"complexType": {
|
|
206
206
|
"original": "EditorCtr | null",
|
|
207
|
-
"resolved": "((column: ColumnDataSchemaModel, save: (value?: any, preventFocus?: boolean | undefined) => void, close: (focusNext?: boolean | undefined) => void) => EditorBase) | EditorCtrConstructible | null",
|
|
207
|
+
"resolved": "((column: ColumnDataSchemaModel<DataType<any, ColumnProp>, ColumnRegular<ColumnProp>, ColumnProp>, save: (value?: any, preventFocus?: boolean | undefined) => void, close: (focusNext?: boolean | undefined) => void) => EditorBase) | EditorCtrConstructible | null",
|
|
208
208
|
"references": {
|
|
209
209
|
"EditorCtr": {
|
|
210
210
|
"location": "import",
|
|
@@ -336,7 +336,7 @@ export class RevogrHeaderComponent {
|
|
|
336
336
|
"mutable": false,
|
|
337
337
|
"complexType": {
|
|
338
338
|
"original": "ColumnRegular[]",
|
|
339
|
-
"resolved": "ColumnRegular[]",
|
|
339
|
+
"resolved": "ColumnRegular<ColumnProp>[]",
|
|
340
340
|
"references": {
|
|
341
341
|
"ColumnRegular": {
|
|
342
342
|
"location": "import",
|
|
@@ -435,7 +435,7 @@ export class RevogrHeaderComponent {
|
|
|
435
435
|
},
|
|
436
436
|
"complexType": {
|
|
437
437
|
"original": "InitialHeaderClick",
|
|
438
|
-
"resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular
|
|
438
|
+
"resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular<ColumnProp>; providers: ProvidersColumns<DimensionCols | \"rowHeaders\">; }",
|
|
439
439
|
"references": {
|
|
440
440
|
"InitialHeaderClick": {
|
|
441
441
|
"location": "import",
|
|
@@ -479,7 +479,7 @@ export class RevogrHeaderComponent {
|
|
|
479
479
|
},
|
|
480
480
|
"complexType": {
|
|
481
481
|
"original": "ColumnRegular[]",
|
|
482
|
-
"resolved": "ColumnRegular[]",
|
|
482
|
+
"resolved": "ColumnRegular<ColumnProp>[]",
|
|
483
483
|
"references": {
|
|
484
484
|
"ColumnRegular": {
|
|
485
485
|
"location": "import",
|
|
@@ -501,7 +501,7 @@ export class RevogrHeaderComponent {
|
|
|
501
501
|
},
|
|
502
502
|
"complexType": {
|
|
503
503
|
"original": "InitialHeaderClick",
|
|
504
|
-
"resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular
|
|
504
|
+
"resolved": "{ index: number; originalEvent: MouseEvent; column: ColumnRegular<ColumnProp>; providers: ProvidersColumns<DimensionCols | \"rowHeaders\">; }",
|
|
505
505
|
"references": {
|
|
506
506
|
"InitialHeaderClick": {
|
|
507
507
|
"location": "import",
|
|
@@ -523,7 +523,7 @@ export class RevogrHeaderComponent {
|
|
|
523
523
|
},
|
|
524
524
|
"complexType": {
|
|
525
525
|
"original": "HeaderRenderProps",
|
|
526
|
-
"resolved": "{ column: VirtualPositionItem; additionalData: any; data: ColumnTemplateProp
|
|
526
|
+
"resolved": "{ column: VirtualPositionItem; additionalData: any; data: ColumnTemplateProp<ColumnProp>; range?: RangeArea | null | undefined; canResize?: boolean | undefined; canFilter?: boolean | undefined; onResize?(e: ResizeEvent): void; onClick?(data: InitialHeaderClick): void; onDblClick?(data: InitialHeaderClick): void; } & Partial<Pick<ResizeProps, \"active\">>",
|
|
527
527
|
"references": {
|
|
528
528
|
"HeaderRenderProps": {
|
|
529
529
|
"location": "import",
|
|
@@ -182,7 +182,7 @@ export class OrderEditor {
|
|
|
182
182
|
"mutable": false,
|
|
183
183
|
"complexType": {
|
|
184
184
|
"original": "Observable<DSourceState<DataType, DimensionRows>>",
|
|
185
|
-
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D",
|
|
185
|
+
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D | K",
|
|
186
186
|
"references": {
|
|
187
187
|
"Observable": {
|
|
188
188
|
"location": "import",
|
|
@@ -401,7 +401,7 @@ export class OrderEditor {
|
|
|
401
401
|
"signature": "(e: DragStartEvent) => Promise<void>",
|
|
402
402
|
"parameters": [{
|
|
403
403
|
"name": "e",
|
|
404
|
-
"type": "DragStartEvent",
|
|
404
|
+
"type": "DragStartEvent<DataType<any, ColumnProp>, ColumnRegular<ColumnProp>>",
|
|
405
405
|
"docs": ""
|
|
406
406
|
}],
|
|
407
407
|
"references": {
|
|
@@ -675,7 +675,7 @@ export class OverlaySelection {
|
|
|
675
675
|
"mutable": false,
|
|
676
676
|
"complexType": {
|
|
677
677
|
"original": "Observable<DSourceState<DataType, DimensionRows>>",
|
|
678
|
-
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D",
|
|
678
|
+
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D | K",
|
|
679
679
|
"references": {
|
|
680
680
|
"Observable": {
|
|
681
681
|
"location": "import",
|
|
@@ -717,7 +717,7 @@ export class OverlaySelection {
|
|
|
717
717
|
"mutable": false,
|
|
718
718
|
"complexType": {
|
|
719
719
|
"original": "Observable<DSourceState<ColumnRegular, DimensionCols>>",
|
|
720
|
-
"resolved": "\"colPinEnd\" | \"colPinStart\" | \"rgCol\" | ColumnRegular",
|
|
720
|
+
"resolved": "\"colPinEnd\" | \"colPinStart\" | \"rgCol\" | ColumnRegular<ColumnProp>",
|
|
721
721
|
"references": {
|
|
722
722
|
"Observable": {
|
|
723
723
|
"location": "import",
|
|
@@ -1251,7 +1251,7 @@ export class RevoGridComponent {
|
|
|
1251
1251
|
"mutable": false,
|
|
1252
1252
|
"complexType": {
|
|
1253
1253
|
"original": "(ColumnRegular | ColumnGrouping)[]",
|
|
1254
|
-
"resolved": "(ColumnRegular | ColumnGrouping<any>)[]",
|
|
1254
|
+
"resolved": "(ColumnRegular<ColumnProp> | ColumnGrouping<any>)[]",
|
|
1255
1255
|
"references": {
|
|
1256
1256
|
"ColumnRegular": {
|
|
1257
1257
|
"location": "import",
|
|
@@ -2117,7 +2117,7 @@ export class RevoGridComponent {
|
|
|
2117
2117
|
},
|
|
2118
2118
|
"complexType": {
|
|
2119
2119
|
"original": "{\n column: ColumnRegular;\n order: 'desc' | 'asc';\n additive: boolean;\n }",
|
|
2120
|
-
"resolved": "{ column: ColumnRegular
|
|
2120
|
+
"resolved": "{ column: ColumnRegular<ColumnProp>; order: \"asc\" | \"desc\"; additive: boolean; }",
|
|
2121
2121
|
"references": {
|
|
2122
2122
|
"ColumnRegular": {
|
|
2123
2123
|
"location": "import",
|
|
@@ -2167,7 +2167,7 @@ export class RevoGridComponent {
|
|
|
2167
2167
|
},
|
|
2168
2168
|
"complexType": {
|
|
2169
2169
|
"original": "{\n column: ColumnRegular;\n order: 'desc' | 'asc';\n additive: boolean;\n }",
|
|
2170
|
-
"resolved": "{ column: ColumnRegular
|
|
2170
|
+
"resolved": "{ column: ColumnRegular<ColumnProp>; order: \"asc\" | \"desc\"; additive: boolean; }",
|
|
2171
2171
|
"references": {
|
|
2172
2172
|
"ColumnRegular": {
|
|
2173
2173
|
"location": "import",
|
|
@@ -2211,7 +2211,7 @@ export class RevoGridComponent {
|
|
|
2211
2211
|
},
|
|
2212
2212
|
"complexType": {
|
|
2213
2213
|
"original": "ColumnRegular",
|
|
2214
|
-
"resolved": "ColumnRegular",
|
|
2214
|
+
"resolved": "ColumnRegular<ColumnProp>",
|
|
2215
2215
|
"references": {
|
|
2216
2216
|
"ColumnRegular": {
|
|
2217
2217
|
"location": "import",
|
|
@@ -2255,7 +2255,7 @@ export class RevoGridComponent {
|
|
|
2255
2255
|
},
|
|
2256
2256
|
"complexType": {
|
|
2257
2257
|
"original": "FocusedData | null",
|
|
2258
|
-
"resolved": "null | { model: any; cell: Cell; colType: DimensionCols; rowType: DimensionRows; column?: ColumnRegular | undefined; }",
|
|
2258
|
+
"resolved": "null | { model: any; cell: Cell; colType: DimensionCols; rowType: DimensionRows; column?: ColumnRegular<ColumnProp> | undefined; }",
|
|
2259
2259
|
"references": {
|
|
2260
2260
|
"FocusedData": {
|
|
2261
2261
|
"location": "import",
|
|
@@ -2389,7 +2389,7 @@ export class RevoGridComponent {
|
|
|
2389
2389
|
},
|
|
2390
2390
|
"complexType": {
|
|
2391
2391
|
"original": "{\n columns: (ColumnGrouping | ColumnRegular)[];\n }",
|
|
2392
|
-
"resolved": "{ columns: (ColumnRegular | ColumnGrouping<any>)[]; }",
|
|
2392
|
+
"resolved": "{ columns: (ColumnRegular<ColumnProp> | ColumnGrouping<any>)[]; }",
|
|
2393
2393
|
"references": {
|
|
2394
2394
|
"ColumnGrouping": {
|
|
2395
2395
|
"location": "import",
|
|
@@ -2417,7 +2417,7 @@ export class RevoGridComponent {
|
|
|
2417
2417
|
},
|
|
2418
2418
|
"complexType": {
|
|
2419
2419
|
"original": "ColumnCollection",
|
|
2420
|
-
"resolved": "{ columns: Record<DimensionCols, ColumnRegular[]>; columnByProp: Record<ColumnProp, ColumnRegular[]>; columnGrouping: ColumnGroupingCollection; maxLevel: number; sort: Record<ColumnProp, ColumnRegular
|
|
2420
|
+
"resolved": "{ columns: Record<DimensionCols, ColumnRegular<ColumnProp>[]>; columnByProp: Record<ColumnProp, ColumnRegular<ColumnProp>[]>; columnGrouping: ColumnGroupingCollection; maxLevel: number; sort: Record<ColumnProp, ColumnRegular<ColumnProp>>; }",
|
|
2421
2421
|
"references": {
|
|
2422
2422
|
"ColumnCollection": {
|
|
2423
2423
|
"location": "import",
|
|
@@ -2439,7 +2439,7 @@ export class RevoGridComponent {
|
|
|
2439
2439
|
},
|
|
2440
2440
|
"complexType": {
|
|
2441
2441
|
"original": "ColumnCollection",
|
|
2442
|
-
"resolved": "{ columns: Record<DimensionCols, ColumnRegular[]>; columnByProp: Record<ColumnProp, ColumnRegular[]>; columnGrouping: ColumnGroupingCollection; maxLevel: number; sort: Record<ColumnProp, ColumnRegular
|
|
2442
|
+
"resolved": "{ columns: Record<DimensionCols, ColumnRegular<ColumnProp>[]>; columnByProp: Record<ColumnProp, ColumnRegular<ColumnProp>[]>; columnGrouping: ColumnGroupingCollection; maxLevel: number; sort: Record<ColumnProp, ColumnRegular<ColumnProp>>; }",
|
|
2443
2443
|
"references": {
|
|
2444
2444
|
"ColumnCollection": {
|
|
2445
2445
|
"location": "import",
|
|
@@ -2654,7 +2654,7 @@ export class RevoGridComponent {
|
|
|
2654
2654
|
},
|
|
2655
2655
|
"complexType": {
|
|
2656
2656
|
"original": "{\n [index: number]: ColumnRegular;\n }",
|
|
2657
|
-
"resolved": "{ [index: number]: ColumnRegular
|
|
2657
|
+
"resolved": "{ [index: number]: ColumnRegular<ColumnProp>; }",
|
|
2658
2658
|
"references": {
|
|
2659
2659
|
"ColumnRegular": {
|
|
2660
2660
|
"location": "import",
|
|
@@ -2977,7 +2977,7 @@ export class RevoGridComponent {
|
|
|
2977
2977
|
"signature": "(cols: ColumnRegular[]) => Promise<void>",
|
|
2978
2978
|
"parameters": [{
|
|
2979
2979
|
"name": "cols",
|
|
2980
|
-
"type": "ColumnRegular[]",
|
|
2980
|
+
"type": "ColumnRegular<ColumnProp>[]",
|
|
2981
2981
|
"docs": ""
|
|
2982
2982
|
}],
|
|
2983
2983
|
"references": {
|
|
@@ -3300,9 +3300,15 @@ export class RevoGridComponent {
|
|
|
3300
3300
|
"path": "@type",
|
|
3301
3301
|
"id": "src/types/index.ts::DimensionCols",
|
|
3302
3302
|
"referenceLocation": "DimensionCols"
|
|
3303
|
+
},
|
|
3304
|
+
"ColumnProp": {
|
|
3305
|
+
"location": "import",
|
|
3306
|
+
"path": "@type",
|
|
3307
|
+
"id": "src/types/index.ts::ColumnProp",
|
|
3308
|
+
"referenceLocation": "ColumnProp"
|
|
3303
3309
|
}
|
|
3304
3310
|
},
|
|
3305
|
-
"return": "Promise<Observable<DSourceState<ColumnRegular
|
|
3311
|
+
"return": "Promise<Observable<DSourceState<ColumnRegular<ColumnProp>, DimensionCols>>>"
|
|
3306
3312
|
},
|
|
3307
3313
|
"docs": {
|
|
3308
3314
|
"text": "Provides access to column internal store observer\nCan be used for plugin support",
|
|
@@ -3391,9 +3397,15 @@ export class RevoGridComponent {
|
|
|
3391
3397
|
"path": "@type",
|
|
3392
3398
|
"id": "src/types/index.ts::ColumnRegular",
|
|
3393
3399
|
"referenceLocation": "ColumnRegular"
|
|
3400
|
+
},
|
|
3401
|
+
"ColumnProp": {
|
|
3402
|
+
"location": "import",
|
|
3403
|
+
"path": "@type",
|
|
3404
|
+
"id": "src/types/index.ts::ColumnProp",
|
|
3405
|
+
"referenceLocation": "ColumnProp"
|
|
3394
3406
|
}
|
|
3395
3407
|
},
|
|
3396
|
-
"return": "Promise<ColumnRegular[]>"
|
|
3408
|
+
"return": "Promise<ColumnRegular<ColumnProp>[]>"
|
|
3397
3409
|
},
|
|
3398
3410
|
"docs": {
|
|
3399
3411
|
"text": "Receive all columns in data source",
|
|
@@ -277,7 +277,7 @@ export class RevogrViewportScroll {
|
|
|
277
277
|
* @param e
|
|
278
278
|
*/
|
|
279
279
|
onHorizontalMouseWheel(type, delta, e) {
|
|
280
|
-
var _a, _b;
|
|
280
|
+
var _a, _b, _c, _d;
|
|
281
281
|
if (!e.deltaX) {
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
@@ -286,11 +286,21 @@ export class RevogrViewportScroll {
|
|
|
286
286
|
const atRight = scrollLeft + clientWidth >= scrollWidth && e.deltaX > 0;
|
|
287
287
|
// Detect if the user has reached the left end
|
|
288
288
|
const atLeft = scrollLeft === 0 && e.deltaX < 0;
|
|
289
|
-
if (
|
|
290
|
-
(
|
|
289
|
+
if (this.noHorizontalScrollTransfer) {
|
|
290
|
+
if (!atRight && !atLeft) {
|
|
291
|
+
const nextScrollLeft = scrollLeft + e[delta];
|
|
292
|
+
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
293
|
+
this.horizontalScroll.scrollLeft = nextScrollLeft;
|
|
294
|
+
(_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(this.horizontalScroll.scrollLeft, type, undefined, e[delta]);
|
|
295
|
+
this.localScrollTimer.latestScrollUpdate(type);
|
|
296
|
+
}
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
if (!atRight && !atLeft) {
|
|
300
|
+
(_c = e.preventDefault) === null || _c === void 0 ? void 0 : _c.call(e);
|
|
291
301
|
}
|
|
292
302
|
const pos = scrollLeft + e[delta];
|
|
293
|
-
(
|
|
303
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
294
304
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
295
305
|
}
|
|
296
306
|
static get is() { return "revogr-viewport-scroll"; }
|
|
@@ -235,7 +235,7 @@ export class RevogrFocus {
|
|
|
235
235
|
"mutable": false,
|
|
236
236
|
"complexType": {
|
|
237
237
|
"original": "Observable<DSourceState<DataType, DimensionRows>>",
|
|
238
|
-
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D",
|
|
238
|
+
"resolved": "\"rgRow\" | \"rowPinEnd\" | \"rowPinStart\" | D | K",
|
|
239
239
|
"references": {
|
|
240
240
|
"Observable": {
|
|
241
241
|
"location": "import",
|
|
@@ -277,7 +277,7 @@ export class RevogrFocus {
|
|
|
277
277
|
"mutable": false,
|
|
278
278
|
"complexType": {
|
|
279
279
|
"original": "Observable<DSourceState<ColumnRegular, DimensionCols>>",
|
|
280
|
-
"resolved": "\"colPinEnd\" | \"colPinStart\" | \"rgCol\" | ColumnRegular",
|
|
280
|
+
"resolved": "\"colPinEnd\" | \"colPinStart\" | \"rgCol\" | ColumnRegular<ColumnProp>",
|
|
281
281
|
"references": {
|
|
282
282
|
"Observable": {
|
|
283
283
|
"location": "import",
|
|
@@ -11,8 +11,10 @@ const SortingSign = ({ column }) => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const PADDING_DEPTH = 10;
|
|
14
|
-
const RowRenderer = ({ rowClass, index, size, start, depth }, cells) => {
|
|
15
|
-
const props = Object.assign({ [DATA_ROW]: index }
|
|
14
|
+
const RowRenderer = ({ rowClass, index, size, start, depth, groupingLevel }, cells) => {
|
|
15
|
+
const props = Object.assign({ [DATA_ROW]: index }, (typeof groupingLevel === 'number'
|
|
16
|
+
? { 'data-level': groupingLevel }
|
|
17
|
+
: {}));
|
|
16
18
|
return (h("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
17
19
|
height: `${size}px`,
|
|
18
20
|
transform: `translateY(${start}px)`,
|
package/dist/esm/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as
|
|
|
5
5
|
import { B as BasePlugin } from './column.drag.plugin-6YvuxWof.js';
|
|
6
6
|
export { A as AutoSizeColumnPlugin, C as ColumnAutoSizeMode, l 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, n as SortingPlugin, a as StretchColumn, o as defaultCellCompare, p as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getComparer, m as getLeftRelative, q as getNextOrder, i as isStretchPlugin, s as sortIndexByItems } from './column.drag.plugin-6YvuxWof.js';
|
|
7
7
|
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-DXhxZMly.js';
|
|
8
|
-
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-
|
|
8
|
+
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-K_BKH7Kx.js';
|
|
9
9
|
export { C as CELL_CLASS, L as CELL_HANDLER_CLASS, x as DATA_COL, y as DATA_ROW, z as DISABLED_CLASS, I as DRAGGABLE_CLASS, O as DRAGG_TEXT, G as DRAG_ICON_CLASS, D as DataStore, N as EDIT_INPUT_WR, J as FOCUS_CLASS, P as GRID_INTERNALS, F as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, E as HEADER_ROW_CLASS, B as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, K as MOBILE_CLASS, R as RESIZE_INTERVAL, Q as ROW_FOCUSED_CLASS, A as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, v as applyMixins, i as calculateDimensionData, U as codesLetter, l as findPositionInArray, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, o as getScrollbarSize, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, V as keyValues, n as mergeSortedArray, p as proxyPlugin, m as pushSorted, r as range, q as scaleValue, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, w as setStore, u as timeout, t as trimmedPlugin } from './dimension.helpers-DzxqJQqN.js';
|
|
10
10
|
export { T as TextEditor } from './text-editor-C1ks5eQ4.js';
|
|
11
11
|
export { k as isAll, c as isClear, h as isCopy, a as isCtrlKey, b as isCtrlMetaKey, g as isCut, l as isEditInput, m as isEditorCtrConstructible, f as isEnterKeyValue, i as isMetaKey, j as isPaste, d as isTab, e as isTabKeyValue } from './edit.utils-CzfeG98N.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
5
|
import { M as ColumnService, u as isGrouping, K as baseEach } from './column.service-Cdz3dYqZ.js';
|
|
6
6
|
import { Q as ROW_FOCUSED_CLASS, b as getSourceItem, y as DATA_ROW, x as DATA_COL, a3 as getNative, a4 as baseIteratee, Y as isArray, M as MIN_COL_SIZE, B as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, J as FOCUS_CLASS, E as HEADER_ROW_CLASS, F as HEADER_ACTUAL_ROW_CLASS, k as getItemByIndex } from './dimension.helpers-DzxqJQqN.js';
|
|
7
|
-
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-
|
|
7
|
+
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-K_BKH7Kx.js';
|
|
8
8
|
import { c as FilterButton } from './filter.button-C8XTWPU2.js';
|
|
9
9
|
import { H as HeaderCellRenderer } from './header-cell-renderer-DXhxZMly.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService } from './throttle-BEjFQa2l.js';
|
|
@@ -223,7 +223,7 @@ const RevogrData = class {
|
|
|
223
223
|
if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {
|
|
224
224
|
rowClass += ` ${ROW_FOCUSED_CLASS}`;
|
|
225
225
|
}
|
|
226
|
-
const row = (h(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start }, cells));
|
|
226
|
+
const row = (h(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start, groupingLevel: groupDepth || undefined }, cells));
|
|
227
227
|
this.beforerowrender.emit({
|
|
228
228
|
node: row,
|
|
229
229
|
item: rgRow,
|
|
@@ -899,7 +899,7 @@ const RevogrViewportScroll = class {
|
|
|
899
899
|
* @param e
|
|
900
900
|
*/
|
|
901
901
|
onHorizontalMouseWheel(type, delta, e) {
|
|
902
|
-
var _a, _b;
|
|
902
|
+
var _a, _b, _c, _d;
|
|
903
903
|
if (!e.deltaX) {
|
|
904
904
|
return;
|
|
905
905
|
}
|
|
@@ -908,11 +908,21 @@ const RevogrViewportScroll = class {
|
|
|
908
908
|
const atRight = scrollLeft + clientWidth >= scrollWidth && e.deltaX > 0;
|
|
909
909
|
// Detect if the user has reached the left end
|
|
910
910
|
const atLeft = scrollLeft === 0 && e.deltaX < 0;
|
|
911
|
-
if (
|
|
912
|
-
(
|
|
911
|
+
if (this.noHorizontalScrollTransfer) {
|
|
912
|
+
if (!atRight && !atLeft) {
|
|
913
|
+
const nextScrollLeft = scrollLeft + e[delta];
|
|
914
|
+
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
915
|
+
this.horizontalScroll.scrollLeft = nextScrollLeft;
|
|
916
|
+
(_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(this.horizontalScroll.scrollLeft, type, undefined, e[delta]);
|
|
917
|
+
this.localScrollTimer.latestScrollUpdate(type);
|
|
918
|
+
}
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
if (!atRight && !atLeft) {
|
|
922
|
+
(_c = e.preventDefault) === null || _c === void 0 ? void 0 : _c.call(e);
|
|
913
923
|
}
|
|
914
924
|
const pos = scrollLeft + e[delta];
|
|
915
|
-
(
|
|
925
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
916
926
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
917
927
|
}
|
|
918
928
|
get horizontalScroll() { return getElement(this); }
|
|
@@ -11,8 +11,10 @@ const SortingSign = ({ column }) => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const PADDING_DEPTH = 10;
|
|
14
|
-
const RowRenderer = ({ rowClass, index, size, start, depth }, cells) => {
|
|
15
|
-
const props = Object.assign({ [DATA_ROW]: index }
|
|
14
|
+
const RowRenderer = ({ rowClass, index, size, start, depth, groupingLevel }, cells) => {
|
|
15
|
+
const props = Object.assign({ [DATA_ROW]: index }, (typeof groupingLevel === 'number'
|
|
16
|
+
? { 'data-level': groupingLevel }
|
|
17
|
+
: {}));
|
|
16
18
|
return (h("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
17
19
|
height: `${size}px`,
|
|
18
20
|
transform: `translateY(${start}px)`,
|
|
@@ -5,7 +5,7 @@ export { o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as
|
|
|
5
5
|
import { B as BasePlugin } from './column.drag.plugin-6YvuxWof.js';
|
|
6
6
|
export { A as AutoSizeColumnPlugin, C as ColumnAutoSizeMode, l 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, n as SortingPlugin, a as StretchColumn, o as defaultCellCompare, p as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getComparer, m as getLeftRelative, q as getNextOrder, i as isStretchPlugin, s as sortIndexByItems } from './column.drag.plugin-6YvuxWof.js';
|
|
7
7
|
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-DXhxZMly.js';
|
|
8
|
-
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-
|
|
8
|
+
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-K_BKH7Kx.js';
|
|
9
9
|
export { C as CELL_CLASS, L as CELL_HANDLER_CLASS, x as DATA_COL, y as DATA_ROW, z as DISABLED_CLASS, I as DRAGGABLE_CLASS, O as DRAGG_TEXT, G as DRAG_ICON_CLASS, D as DataStore, N as EDIT_INPUT_WR, J as FOCUS_CLASS, P as GRID_INTERNALS, F as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, E as HEADER_ROW_CLASS, B as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, K as MOBILE_CLASS, R as RESIZE_INTERVAL, Q as ROW_FOCUSED_CLASS, A as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, v as applyMixins, i as calculateDimensionData, U as codesLetter, l as findPositionInArray, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, o as getScrollbarSize, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, V as keyValues, n as mergeSortedArray, p as proxyPlugin, m as pushSorted, r as range, q as scaleValue, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, w as setStore, u as timeout, t as trimmedPlugin } from './dimension.helpers-DzxqJQqN.js';
|
|
10
10
|
export { T as TextEditor } from './text-editor-C1ks5eQ4.js';
|
|
11
11
|
export { k as isAll, c as isClear, h as isCopy, a as isCtrlKey, b as isCtrlMetaKey, g as isCut, l as isEditInput, m as isEditorCtrConstructible, f as isEnterKeyValue, i as isMetaKey, j as isPaste, d as isTab, e as isTabKeyValue } from './edit.utils-CzfeG98N.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
5
|
import { M as ColumnService, u as isGrouping, K as baseEach } from './column.service-Cdz3dYqZ.js';
|
|
6
6
|
import { Q as ROW_FOCUSED_CLASS, b as getSourceItem, y as DATA_ROW, x as DATA_COL, a3 as getNative, a4 as baseIteratee, Y as isArray, M as MIN_COL_SIZE, B as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, J as FOCUS_CLASS, E as HEADER_ROW_CLASS, F as HEADER_ACTUAL_ROW_CLASS, k as getItemByIndex } from './dimension.helpers-DzxqJQqN.js';
|
|
7
|
-
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-
|
|
7
|
+
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-K_BKH7Kx.js';
|
|
8
8
|
import { c as FilterButton } from './filter.button-C8XTWPU2.js';
|
|
9
9
|
import { H as HeaderCellRenderer } from './header-cell-renderer-DXhxZMly.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService } from './throttle-BEjFQa2l.js';
|
|
@@ -223,7 +223,7 @@ const RevogrData = class {
|
|
|
223
223
|
if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {
|
|
224
224
|
rowClass += ` ${ROW_FOCUSED_CLASS}`;
|
|
225
225
|
}
|
|
226
|
-
const row = (h(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start }, cells));
|
|
226
|
+
const row = (h(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start, groupingLevel: groupDepth || undefined }, cells));
|
|
227
227
|
this.beforerowrender.emit({
|
|
228
228
|
node: row,
|
|
229
229
|
item: rgRow,
|
|
@@ -899,7 +899,7 @@ const RevogrViewportScroll = class {
|
|
|
899
899
|
* @param e
|
|
900
900
|
*/
|
|
901
901
|
onHorizontalMouseWheel(type, delta, e) {
|
|
902
|
-
var _a, _b;
|
|
902
|
+
var _a, _b, _c, _d;
|
|
903
903
|
if (!e.deltaX) {
|
|
904
904
|
return;
|
|
905
905
|
}
|
|
@@ -908,11 +908,21 @@ const RevogrViewportScroll = class {
|
|
|
908
908
|
const atRight = scrollLeft + clientWidth >= scrollWidth && e.deltaX > 0;
|
|
909
909
|
// Detect if the user has reached the left end
|
|
910
910
|
const atLeft = scrollLeft === 0 && e.deltaX < 0;
|
|
911
|
-
if (
|
|
912
|
-
(
|
|
911
|
+
if (this.noHorizontalScrollTransfer) {
|
|
912
|
+
if (!atRight && !atLeft) {
|
|
913
|
+
const nextScrollLeft = scrollLeft + e[delta];
|
|
914
|
+
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
915
|
+
this.horizontalScroll.scrollLeft = nextScrollLeft;
|
|
916
|
+
(_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(this.horizontalScroll.scrollLeft, type, undefined, e[delta]);
|
|
917
|
+
this.localScrollTimer.latestScrollUpdate(type);
|
|
918
|
+
}
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
if (!atRight && !atLeft) {
|
|
922
|
+
(_c = e.preventDefault) === null || _c === void 0 ? void 0 : _c.call(e);
|
|
913
923
|
}
|
|
914
924
|
const pos = scrollLeft + e[delta];
|
|
915
|
-
(
|
|
925
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
916
926
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
917
927
|
}
|
|
918
928
|
get horizontalScroll() { return getElement(this); }
|
|
@@ -103,5 +103,5 @@ export declare class RevogrData {
|
|
|
103
103
|
componentWillRender(): Promise<any[]>;
|
|
104
104
|
componentDidRender(): void;
|
|
105
105
|
render(): any;
|
|
106
|
-
triggerBeforeCellRender(model: CellTemplateProp, row: VirtualPositionItem, column: VirtualPositionItem): CustomEvent<BeforeCellRenderEvent<CellTemplateProp
|
|
106
|
+
triggerBeforeCellRender(model: CellTemplateProp, row: VirtualPositionItem, column: VirtualPositionItem): CustomEvent<BeforeCellRenderEvent<CellTemplateProp<DataType<any, import("@type").ColumnProp>, ColumnRegular<import("@type").ColumnProp>, import("@type").ColumnProp>>>;
|
|
107
107
|
}
|
|
@@ -6,7 +6,8 @@ export interface RowProps extends JSXBase.HTMLAttributes {
|
|
|
6
6
|
index: number;
|
|
7
7
|
rowClass?: string;
|
|
8
8
|
depth?: number;
|
|
9
|
+
groupingLevel?: number;
|
|
9
10
|
}
|
|
10
11
|
export declare const PADDING_DEPTH = 10;
|
|
11
|
-
declare const RowRenderer: ({ rowClass, index, size, start, depth }: RowProps, cells: VNode[]) => any;
|
|
12
|
+
declare const RowRenderer: ({ rowClass, index, size, start, depth, groupingLevel }: RowProps, cells: VNode[]) => any;
|
|
12
13
|
export default RowRenderer;
|
|
@@ -12,7 +12,7 @@ export default class ColumnDataProvider {
|
|
|
12
12
|
getRawColumns(): Record<DimensionCols, ColumnRegular[]>;
|
|
13
13
|
getColumns(type?: DimensionCols | 'all'): ColumnRegular[];
|
|
14
14
|
getColumnIndexByProp(prop: ColumnProp, type: DimensionCols): number;
|
|
15
|
-
getColumnByProp(prop: ColumnProp): ColumnRegular[] | undefined;
|
|
15
|
+
getColumnByProp(prop: ColumnProp): ColumnRegular<ColumnProp>[] | undefined;
|
|
16
16
|
refreshByType(type: DimensionCols): void;
|
|
17
17
|
/**
|
|
18
18
|
* Main method to set columns
|
|
@@ -10,19 +10,20 @@ export type Nullable<T> = {
|
|
|
10
10
|
* Advanced column data schema model.
|
|
11
11
|
* Used for transpassing data to cell renderer and editor.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
type ModelValueByProp<TModel extends DataType, TProp extends ColumnProp> = TProp extends keyof TModel ? TModel[TProp] : any;
|
|
14
|
+
export interface ColumnDataSchemaModel<TModel extends DataType = DataType, TColumn extends ColumnRegular = ColumnRegular, TProp extends ColumnProp = TColumn['prop']> {
|
|
14
15
|
/**
|
|
15
16
|
* Column prop used for mapping value to cell from data source model/row
|
|
16
17
|
*/
|
|
17
|
-
prop:
|
|
18
|
+
prop: TProp;
|
|
18
19
|
/**
|
|
19
20
|
* Row data object
|
|
20
21
|
*/
|
|
21
|
-
model:
|
|
22
|
+
model: TModel;
|
|
22
23
|
/**
|
|
23
24
|
* Column data object
|
|
24
25
|
*/
|
|
25
|
-
column:
|
|
26
|
+
column: TColumn;
|
|
26
27
|
/**
|
|
27
28
|
* Virtual index of the row in the viewport
|
|
28
29
|
*/
|
|
@@ -42,18 +43,18 @@ export interface ColumnDataSchemaModel {
|
|
|
42
43
|
/**
|
|
43
44
|
* Row models based on viewport
|
|
44
45
|
*/
|
|
45
|
-
data:
|
|
46
|
+
data: TModel[];
|
|
46
47
|
/**
|
|
47
48
|
* Current cell data value
|
|
48
49
|
* Mapped from model through column property like model['prop']
|
|
49
50
|
*/
|
|
50
|
-
value?:
|
|
51
|
+
value?: ModelValueByProp<TModel, TProp>;
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* Template property for each cell, extends the column data schema model.
|
|
54
55
|
* Additionally, it provides access to the providers injected into the template.
|
|
55
56
|
*/
|
|
56
|
-
export interface CellTemplateProp extends ColumnDataSchemaModel {
|
|
57
|
+
export interface CellTemplateProp<TModel extends DataType = DataType, TColumn extends ColumnRegular = ColumnRegular, TProp extends ColumnProp = TColumn['prop']> extends ColumnDataSchemaModel<TModel, TColumn, TProp> {
|
|
57
58
|
/**
|
|
58
59
|
* Providers injected into the template
|
|
59
60
|
* Also to get grouping depth
|
|
@@ -68,10 +69,8 @@ export interface CellTemplateProp extends ColumnDataSchemaModel {
|
|
|
68
69
|
* If it is a function, it returns whether the cell in question is read-only based on the provided
|
|
69
70
|
* ColumnDataSchemaModel.
|
|
70
71
|
*/
|
|
71
|
-
export type ReadOnlyFormat = boolean | ((params: ColumnDataSchemaModel) => boolean);
|
|
72
|
-
export type RowDrag = boolean |
|
|
73
|
-
(params: ColumnDataSchemaModel): boolean;
|
|
74
|
-
};
|
|
72
|
+
export type ReadOnlyFormat<TModel extends DataType = DataType, TColumn extends ColumnRegular = ColumnRegular> = boolean | ((params: ColumnDataSchemaModel<TModel, TColumn>) => boolean);
|
|
73
|
+
export type RowDrag<TModel extends DataType = DataType, TColumn extends ColumnRegular = ColumnRegular> = boolean | ((params: ColumnDataSchemaModel<TModel, TColumn>) => boolean);
|
|
75
74
|
/**
|
|
76
75
|
* `ColumnGrouping` type is used to define a grouping in a column.
|
|
77
76
|
*/
|
|
@@ -174,11 +173,11 @@ export type Order = 'asc' | 'desc' | undefined;
|
|
|
174
173
|
* ColumnRegular interface represents regular column definition.
|
|
175
174
|
* Regular column can be any column that is not a grouping column.
|
|
176
175
|
*/
|
|
177
|
-
export interface ColumnRegular extends ColumnType {
|
|
176
|
+
export interface ColumnRegular<P extends ColumnProp = ColumnProp> extends ColumnType {
|
|
178
177
|
/**
|
|
179
178
|
* Column prop used for mapping value to cell from data source model/row, used for indexing.
|
|
180
179
|
*/
|
|
181
|
-
prop:
|
|
180
|
+
prop: P;
|
|
182
181
|
/**
|
|
183
182
|
* Column pin 'colPinStart'|'colPinEnd'.
|
|
184
183
|
*/
|
|
@@ -225,7 +224,7 @@ export type ColumnData = (ColumnGrouping | ColumnRegular)[];
|
|
|
225
224
|
* Column template property.
|
|
226
225
|
* Contains extended properties for column.
|
|
227
226
|
*/
|
|
228
|
-
export interface ColumnTemplateProp extends ColumnRegular {
|
|
227
|
+
export interface ColumnTemplateProp<P extends ColumnProp = ColumnProp> extends ColumnRegular<P> {
|
|
229
228
|
/**
|
|
230
229
|
* Providers injected into the template.
|
|
231
230
|
*/
|
|
@@ -375,11 +374,11 @@ export type CellCompareFunc = (prop: ColumnProp, a: DataType, b: DataType) => nu
|
|
|
375
374
|
export type ColumnTemplateFunc = (createElement: HyperFunc<VNode>, props: ColumnTemplateProp, additionalData?: any) => any;
|
|
376
375
|
export type PropertiesFunc = (props: CellTemplateProp) => CellProps | void | undefined;
|
|
377
376
|
export type ColPropertiesFunc = (props: ColumnPropProp) => CellProps | void | undefined;
|
|
378
|
-
export type DataType<D = any> = {
|
|
379
|
-
[T in
|
|
377
|
+
export type DataType<D = any, K extends ColumnProp = ColumnProp> = {
|
|
378
|
+
[T in K]: DataFormat<D>;
|
|
380
379
|
};
|
|
381
|
-
export type DataLookup<T = any> = {
|
|
382
|
-
[rowIndex: number]: DataType<T>;
|
|
380
|
+
export type DataLookup<T = any, K extends ColumnProp = ColumnProp> = {
|
|
381
|
+
[rowIndex: number]: DataType<T, K>;
|
|
383
382
|
};
|
|
384
383
|
/**
|
|
385
384
|
* `RowDefinition` is a type that represents a row definition in the
|
|
@@ -624,7 +623,7 @@ export type ViewportStores = {
|
|
|
624
623
|
/**
|
|
625
624
|
* Represents the event object that is emitted when the drag operation starts.
|
|
626
625
|
*/
|
|
627
|
-
export interface DragStartEvent {
|
|
626
|
+
export interface DragStartEvent<TModel extends DataType = DataType, TColumn extends ColumnRegular = ColumnRegular> {
|
|
628
627
|
/**
|
|
629
628
|
* Represents the original mouse event that triggered the drag operation.
|
|
630
629
|
*/
|
|
@@ -632,7 +631,7 @@ export interface DragStartEvent {
|
|
|
632
631
|
/**
|
|
633
632
|
* Represents the model of the column being dragged.
|
|
634
633
|
*/
|
|
635
|
-
model: ColumnDataSchemaModel
|
|
634
|
+
model: ColumnDataSchemaModel<TModel, TColumn>;
|
|
636
635
|
}
|
|
637
636
|
/**
|
|
638
637
|
* Represents the event object that is emitted before cell rendering.
|
|
@@ -762,3 +761,4 @@ export interface AdditionalData {
|
|
|
762
761
|
*/
|
|
763
762
|
[key: string]: any;
|
|
764
763
|
}
|
|
764
|
+
export {};
|
package/hydrate/index.js
CHANGED
|
@@ -16698,8 +16698,10 @@ function filterOutEmptyGroupRows(source, filterTrimmed) {
|
|
|
16698
16698
|
}
|
|
16699
16699
|
|
|
16700
16700
|
const PADDING_DEPTH = 10;
|
|
16701
|
-
const RowRenderer = ({ rowClass, index, size, start, depth }, cells) => {
|
|
16702
|
-
const props = Object.assign({ [DATA_ROW]: index }
|
|
16701
|
+
const RowRenderer = ({ rowClass, index, size, start, depth, groupingLevel }, cells) => {
|
|
16702
|
+
const props = Object.assign({ [DATA_ROW]: index }, (typeof groupingLevel === 'number'
|
|
16703
|
+
? { 'data-level': groupingLevel }
|
|
16704
|
+
: {}));
|
|
16703
16705
|
return (hAsync("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
16704
16706
|
height: `${size}px`,
|
|
16705
16707
|
transform: `translateY(${start}px)`,
|
|
@@ -20085,7 +20087,7 @@ class RevogrData {
|
|
|
20085
20087
|
if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {
|
|
20086
20088
|
rowClass += ` ${ROW_FOCUSED_CLASS}`;
|
|
20087
20089
|
}
|
|
20088
|
-
const row = (hAsync(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start }, cells));
|
|
20090
|
+
const row = (hAsync(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start, groupingLevel: groupDepth || undefined }, cells));
|
|
20089
20091
|
this.beforerowrender.emit({
|
|
20090
20092
|
node: row,
|
|
20091
20093
|
item: rgRow,
|
|
@@ -21503,7 +21505,7 @@ class RevogrViewportScroll {
|
|
|
21503
21505
|
* @param e
|
|
21504
21506
|
*/
|
|
21505
21507
|
onHorizontalMouseWheel(type, delta, e) {
|
|
21506
|
-
var _a, _b;
|
|
21508
|
+
var _a, _b, _c, _d;
|
|
21507
21509
|
if (!e.deltaX) {
|
|
21508
21510
|
return;
|
|
21509
21511
|
}
|
|
@@ -21512,11 +21514,21 @@ class RevogrViewportScroll {
|
|
|
21512
21514
|
const atRight = scrollLeft + clientWidth >= scrollWidth && e.deltaX > 0;
|
|
21513
21515
|
// Detect if the user has reached the left end
|
|
21514
21516
|
const atLeft = scrollLeft === 0 && e.deltaX < 0;
|
|
21515
|
-
if (
|
|
21516
|
-
(
|
|
21517
|
+
if (this.noHorizontalScrollTransfer) {
|
|
21518
|
+
if (!atRight && !atLeft) {
|
|
21519
|
+
const nextScrollLeft = scrollLeft + e[delta];
|
|
21520
|
+
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
21521
|
+
this.horizontalScroll.scrollLeft = nextScrollLeft;
|
|
21522
|
+
(_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(this.horizontalScroll.scrollLeft, type, undefined, e[delta]);
|
|
21523
|
+
this.localScrollTimer.latestScrollUpdate(type);
|
|
21524
|
+
}
|
|
21525
|
+
return;
|
|
21526
|
+
}
|
|
21527
|
+
if (!atRight && !atLeft) {
|
|
21528
|
+
(_c = e.preventDefault) === null || _c === void 0 ? void 0 : _c.call(e);
|
|
21517
21529
|
}
|
|
21518
21530
|
const pos = scrollLeft + e[delta];
|
|
21519
|
-
(
|
|
21531
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
21520
21532
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
21521
21533
|
}
|
|
21522
21534
|
get horizontalScroll() { return getElement(this); }
|
package/hydrate/index.mjs
CHANGED
|
@@ -16696,8 +16696,10 @@ function filterOutEmptyGroupRows(source, filterTrimmed) {
|
|
|
16696
16696
|
}
|
|
16697
16697
|
|
|
16698
16698
|
const PADDING_DEPTH = 10;
|
|
16699
|
-
const RowRenderer = ({ rowClass, index, size, start, depth }, cells) => {
|
|
16700
|
-
const props = Object.assign({ [DATA_ROW]: index }
|
|
16699
|
+
const RowRenderer = ({ rowClass, index, size, start, depth, groupingLevel }, cells) => {
|
|
16700
|
+
const props = Object.assign({ [DATA_ROW]: index }, (typeof groupingLevel === 'number'
|
|
16701
|
+
? { 'data-level': groupingLevel }
|
|
16702
|
+
: {}));
|
|
16701
16703
|
return (hAsync("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
16702
16704
|
height: `${size}px`,
|
|
16703
16705
|
transform: `translateY(${start}px)`,
|
|
@@ -20083,7 +20085,7 @@ class RevogrData {
|
|
|
20083
20085
|
if (this.rowHighlightPlugin.isRowFocused(rgRow.itemIndex)) {
|
|
20084
20086
|
rowClass += ` ${ROW_FOCUSED_CLASS}`;
|
|
20085
20087
|
}
|
|
20086
|
-
const row = (hAsync(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start }, cells));
|
|
20088
|
+
const row = (hAsync(RowRenderer, { index: rgRow.itemIndex, rowClass: rowClass, size: rgRow.size, start: rgRow.start, groupingLevel: groupDepth || undefined }, cells));
|
|
20087
20089
|
this.beforerowrender.emit({
|
|
20088
20090
|
node: row,
|
|
20089
20091
|
item: rgRow,
|
|
@@ -21501,7 +21503,7 @@ class RevogrViewportScroll {
|
|
|
21501
21503
|
* @param e
|
|
21502
21504
|
*/
|
|
21503
21505
|
onHorizontalMouseWheel(type, delta, e) {
|
|
21504
|
-
var _a, _b;
|
|
21506
|
+
var _a, _b, _c, _d;
|
|
21505
21507
|
if (!e.deltaX) {
|
|
21506
21508
|
return;
|
|
21507
21509
|
}
|
|
@@ -21510,11 +21512,21 @@ class RevogrViewportScroll {
|
|
|
21510
21512
|
const atRight = scrollLeft + clientWidth >= scrollWidth && e.deltaX > 0;
|
|
21511
21513
|
// Detect if the user has reached the left end
|
|
21512
21514
|
const atLeft = scrollLeft === 0 && e.deltaX < 0;
|
|
21513
|
-
if (
|
|
21514
|
-
(
|
|
21515
|
+
if (this.noHorizontalScrollTransfer) {
|
|
21516
|
+
if (!atRight && !atLeft) {
|
|
21517
|
+
const nextScrollLeft = scrollLeft + e[delta];
|
|
21518
|
+
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
21519
|
+
this.horizontalScroll.scrollLeft = nextScrollLeft;
|
|
21520
|
+
(_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(this.horizontalScroll.scrollLeft, type, undefined, e[delta]);
|
|
21521
|
+
this.localScrollTimer.latestScrollUpdate(type);
|
|
21522
|
+
}
|
|
21523
|
+
return;
|
|
21524
|
+
}
|
|
21525
|
+
if (!atRight && !atLeft) {
|
|
21526
|
+
(_c = e.preventDefault) === null || _c === void 0 ? void 0 : _c.call(e);
|
|
21515
21527
|
}
|
|
21516
21528
|
const pos = scrollLeft + e[delta];
|
|
21517
|
-
(
|
|
21529
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
21518
21530
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
21519
21531
|
}
|
|
21520
21532
|
get horizontalScroll() { return getElement(this); }
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import{h as t,Build as e,proxyCustomElement as o,HTMLElement as i,createEvent as r,Host as n,transformTag as s}from"@stencil/core/internal/client";import{l as a,m as l,G as d,h as c,P as h,O as g,B as p,M as v,u as C}from"./column.service.js";import{a as u,h as m,g as w,l as L,D as x}from"./consts.js";import{b as f}from"./data.store.js";import"./platform.js";import{d as b}from"./vnode-converter.js";const y=({rowClass:e,index:o,size:i,start:r,depth:n},s)=>{const a=Object.assign({[u]:o});return t("div",Object.assign({},a,{class:`rgRow ${e||""}`,style:{height:`${i}px`,transform:`translateY(${r}px)`,paddingLeft:n?10*n+"px":void 0}}),s)};function E(t,e,o){var i;const r=new CustomEvent(l,{detail:{model:e,virtualIndex:o},cancelable:!0,bubbles:!0});null===(i=t.target)||void 0===i||i.dispatchEvent(r)}const R=e=>{const{model:o,itemIndex:i,hasExpand:r,groupingCustomRenderer:n}=e,s=o[h],l=o[c],g=parseInt(o[d],10)||0;return t(y,Object.assign({},e,{rowClass:"groupingRow",depth:g}),n?t("div",{onClick:t=>E(t,o,i)},n(t,Object.assign(Object.assign({},e),{colType:e.providers.colType,name:s,expanded:l,depth:g}))):r&&[t("button",{class:{[a]:!0},onClick:t=>E(t,o,i)},j(l)),s])},j=(e=!1)=>t("svg",{"aria-hidden":"true",style:{transform:`rotate(${e?0:-90}deg)`},focusable:"false",viewBox:"0 0 448 512"},t("path",{fill:"currentColor",d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"}));function k(o){var i;const r=[],n=null===(i=o.schemaModel.column)||void 0===i?void 0:i.cellTemplate;if(n)r.push(n(t,o.schemaModel,o.additionalData));else{if(!o.schemaModel.column)return(null==e?void 0:e.isDev)&&console.error("Investigate column problem.",o.schemaModel),"";o.schemaModel.column.rowDrag&&g(o.schemaModel.column.rowDrag,o.schemaModel)&&r.push(t("span",{class:m,onMouseDown:t=>{var e;return null===(e=o.dragStartCell)||void 0===e?void 0:e.emit({originalEvent:t,model:o.schemaModel})}},t("span",{class:w}))),r.push(`${p(o.schemaModel.model,o.schemaModel.column)}`)}return r}const D=({renderProps:e,cellProps:o})=>{const i=k.bind(null,e);return t("div",Object.assign({},o,{redraw:i}),i())};class T{constructor(){this.currentRange=null}selectionChange(t,e){if(this.currentRange&&e.forEach(((e,o)=>{var i;t&&o>=t.y&&o<=t.y1||e&&e.t instanceof HTMLElement&&e.t.classList.contains(L)&&(e.t.classList.remove(L),(null===(i=e.o)||void 0===i?void 0:i.class.includes(L))&&(e.o.class=e.o.class.replace(L,"")))})),t)for(let o=t.y;o<=t.y1;o++){const t=e.get(o);if(t&&t.t instanceof HTMLElement&&!t.t.classList.contains(L)){const e=t.o=t.o||{};e.class=(e.class||"")+" "+L,t.t.classList.add(L)}}this.currentRange=t}isRowFocused(t){return this.currentRange&&t>=this.currentRange.y&&t<=this.currentRange.y1}}const M=o(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.beforerowrender=r(this,"beforerowrender",7),this.afterrender=r(this,"afterrender",7),this.beforeCellRender=r(this,"beforecellrender",7),this.beforeDataRender=r(this,"beforedatarender",7),this.dragStartCell=r(this,"dragstartcell",7),this.jobsBeforeRender=[],this.renderedRows=new Map}async updateCell(t){var e,o,i;const r=null===(o=null===(e=this.renderedRows.get(t.row))||void 0===e?void 0:e.i)||void 0===o?void 0:o[t.col];if(null===(i=null==r?void 0:r.o)||void 0===i?void 0:i.redraw){const t=await(n=this.element,s=r.o.redraw,new Promise((t=>{const e=document.createElement("vnode-html");n.appendChild(e),e.redraw=s,e.addEventListener("html",(o=>{e.remove(),t(o.detail)}))})));r.t.innerHTML=t.html,r.l=Math.random()}var n,s}onDataStoreChange(){this.onStoreChange()}onColDataChange(){this.onStoreChange()}onStoreChange(){var t,e;null===(t=this.columnService)||void 0===t||t.destroy(),this.columnService=new v(this.dataStore,this.colData),this.providers={type:this.type,colType:this.colType,readonly:this.readonly,data:this.dataStore,columns:this.colData,viewport:this.viewportCol,dimension:this.dimensionRow,selection:this.rowSelectionStore},null===(e=this.rangeUnsubscribe)||void 0===e||e.call(this),this.rangeUnsubscribe=this.rowSelectionStore.onChange("range",(t=>this.rowHighlightPlugin.selectionChange(t,this.renderedRows)))}connectedCallback(){this.rowHighlightPlugin=new T,this.onStoreChange()}disconnectedCallback(){var t,e;null===(t=this.columnService)||void 0===t||t.destroy(),null===(e=this.rangeUnsubscribe)||void 0===e||e.call(this)}async componentWillRender(){return this.beforeDataRender.emit({rowType:this.type,colType:this.colType}),Promise.all(this.jobsBeforeRender.map((t=>"function"==typeof t?t():t)))}componentDidRender(){this.afterrender.emit({type:this.type})}render(){if(this.renderedRows=new Map,!this.columnService.columns.length)return;const e=this.viewportRow.get("items");if(!e.length)return;const o=this.viewportCol.get("items");if(!o.length)return;const i=[],r=this.dataStore.get("groupingDepth"),s=this.dataStore.get("groupingCustomRenderer"),a=this.columnService.hasGrouping?r:0;for(let r of e){const e=f(this.dataStore,r.itemIndex);if(C(e)){const n=Object.assign(Object.assign({},r),{index:r.itemIndex,model:e,groupingCustomRenderer:s,hasExpand:this.columnService.hasGrouping&&"rowHeaders"!==this.colType,columnItems:o,providers:this.providers});i.push(t(R,Object.assign({},n)));continue}const n=[];for(let e of o){const o=Object.assign(Object.assign({},this.columnService.rowDataModel(r.itemIndex,e.itemIndex)),{providers:this.providers}),i=this.triggerBeforeCellRender(o,r,e);if(i.defaultPrevented)continue;const{detail:{column:s,row:l,model:d}}=i,c={[x]:s.itemIndex,[u]:l.itemIndex,style:{width:`${s.size}px`,transform:`translateX(${s.start}px)`,height:l.size?`${l.size}px`:void 0}};a&&!s.itemIndex&&c.style&&(c.style.paddingLeft=10*a+"px");const h=this.columnService.mergeProperties(l.itemIndex,s.itemIndex,c,d),g=t(D,{renderProps:{schemaModel:d,additionalData:this.additionalData,dragStartCell:this.dragStartCell},cellProps:h});n.push(g)}let l=this.rowClass?this.columnService.getRowClass(r.itemIndex,this.rowClass):"";this.rowHighlightPlugin.isRowFocused(r.itemIndex)&&(l+=` ${L}`);const d=t(y,{index:r.itemIndex,rowClass:l,size:r.size,start:r.start},n);this.beforerowrender.emit({node:d,item:r,model:e,colType:this.columnService.type,rowType:this.type}),i.push(d),this.renderedRows.set(r.itemIndex,d)}return t(n,null,t("slot",null),i)}triggerBeforeCellRender(t,e,o){return this.beforeCellRender.emit({column:o,row:e,model:t,rowType:t.type,colType:t.colType})}get element(){return this}static get watchers(){return{dataStore:[{onDataStoreChange:0}],colData:[{onColDataChange:0}]}}static get style(){return".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\";display:inline-block}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}revogr-data{display:block;width:100%;position:relative}revogr-data .rgRow{position:absolute;width:100%;left:0}revogr-data .rgRow.groupingRow{font-weight:600;text-align:left}revogr-data .rgRow.groupingRow .group-expand{width:25px;height:100%;max-height:25px;margin-right:2px;background-color:transparent;border-color:transparent;vertical-align:middle;padding-left:5px;display:inline-flex}revogr-data .rgRow.groupingRow .group-expand svg{width:7px}revogr-data .revo-draggable{border:none;height:32px;display:inline-flex;outline:0;padding:0;font-size:0.8125rem;box-sizing:border-box;align-items:center;white-space:nowrap;vertical-align:middle;justify-content:center;text-decoration:none;width:24px;height:100%;cursor:pointer;display:inline-flex}revogr-data .revo-draggable:hover>.revo-drag-icon{opacity:1;zoom:1.2;font-weight:600}revogr-data .revo-draggable>.revo-drag-icon{pointer-events:none;transition:opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, zoom 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}revogr-data .rgCell{top:0;left:0;position:absolute;box-sizing:border-box;height:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;outline:none}revogr-data .rgCell.align-center{text-align:center}revogr-data .rgCell.align-left{text-align:left}revogr-data .rgCell.align-right{text-align:right}"}},[260,"revogr-data",{readonly:[4],range:[4],rowClass:[1,"row-class"],additionalData:[8,"additional-data"],rowSelectionStore:[16],viewportRow:[16],viewportCol:[16],dimensionRow:[16],colData:[16],dataStore:[16],type:[513],colType:[513,"col-type"],jobsBeforeRender:[16],providers:[32],updateCell:[64]},void 0,{dataStore:[{onDataStoreChange:0}],colData:[{onColDataChange:0}]}]);function O(){"undefined"!=typeof customElements&&["revogr-data","vnode-html"].forEach((t=>{switch(t){case"revogr-data":customElements.get(s(t))||customElements.define(s(t),M);break;case"vnode-html":customElements.get(s(t))||b()}}))}export{D as C,R as G,M as R,j as a,O as d,E as e}
|
|
4
|
+
import{h as t,Build as e,proxyCustomElement as o,HTMLElement as i,createEvent as r,Host as n,transformTag as s}from"@stencil/core/internal/client";import{l as a,m as l,G as d,h as c,P as h,O as g,B as p,M as v,u}from"./column.service.js";import{a as C,h as m,g as w,l as L,D as x}from"./consts.js";import{b as f}from"./data.store.js";import"./platform.js";import{d as b}from"./vnode-converter.js";const y=({rowClass:e,index:o,size:i,start:r,depth:n,groupingLevel:s},a)=>{const l=Object.assign({[C]:o},"number"==typeof s?{"data-level":s}:{});return t("div",Object.assign({},l,{class:`rgRow ${e||""}`,style:{height:`${i}px`,transform:`translateY(${r}px)`,paddingLeft:n?10*n+"px":void 0}}),a)};function E(t,e,o){var i;const r=new CustomEvent(l,{detail:{model:e,virtualIndex:o},cancelable:!0,bubbles:!0});null===(i=t.target)||void 0===i||i.dispatchEvent(r)}const R=e=>{const{model:o,itemIndex:i,hasExpand:r,groupingCustomRenderer:n}=e,s=o[h],l=o[c],g=parseInt(o[d],10)||0;return t(y,Object.assign({},e,{rowClass:"groupingRow",depth:g}),n?t("div",{onClick:t=>E(t,o,i)},n(t,Object.assign(Object.assign({},e),{colType:e.providers.colType,name:s,expanded:l,depth:g}))):r&&[t("button",{class:{[a]:!0},onClick:t=>E(t,o,i)},j(l)),s])},j=(e=!1)=>t("svg",{"aria-hidden":"true",style:{transform:`rotate(${e?0:-90}deg)`},focusable:"false",viewBox:"0 0 448 512"},t("path",{fill:"currentColor",d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"}));function k(o){var i;const r=[],n=null===(i=o.schemaModel.column)||void 0===i?void 0:i.cellTemplate;if(n)r.push(n(t,o.schemaModel,o.additionalData));else{if(!o.schemaModel.column)return(null==e?void 0:e.isDev)&&console.error("Investigate column problem.",o.schemaModel),"";o.schemaModel.column.rowDrag&&g(o.schemaModel.column.rowDrag,o.schemaModel)&&r.push(t("span",{class:m,onMouseDown:t=>{var e;return null===(e=o.dragStartCell)||void 0===e?void 0:e.emit({originalEvent:t,model:o.schemaModel})}},t("span",{class:w}))),r.push(`${p(o.schemaModel.model,o.schemaModel.column)}`)}return r}const D=({renderProps:e,cellProps:o})=>{const i=k.bind(null,e);return t("div",Object.assign({},o,{redraw:i}),i())};class T{constructor(){this.currentRange=null}selectionChange(t,e){if(this.currentRange&&e.forEach(((e,o)=>{var i;t&&o>=t.y&&o<=t.y1||e&&e.t instanceof HTMLElement&&e.t.classList.contains(L)&&(e.t.classList.remove(L),(null===(i=e.o)||void 0===i?void 0:i.class.includes(L))&&(e.o.class=e.o.class.replace(L,"")))})),t)for(let o=t.y;o<=t.y1;o++){const t=e.get(o);if(t&&t.t instanceof HTMLElement&&!t.t.classList.contains(L)){const e=t.o=t.o||{};e.class=(e.class||"")+" "+L,t.t.classList.add(L)}}this.currentRange=t}isRowFocused(t){return this.currentRange&&t>=this.currentRange.y&&t<=this.currentRange.y1}}const M=o(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.beforerowrender=r(this,"beforerowrender",7),this.afterrender=r(this,"afterrender",7),this.beforeCellRender=r(this,"beforecellrender",7),this.beforeDataRender=r(this,"beforedatarender",7),this.dragStartCell=r(this,"dragstartcell",7),this.jobsBeforeRender=[],this.renderedRows=new Map}async updateCell(t){var e,o,i;const r=null===(o=null===(e=this.renderedRows.get(t.row))||void 0===e?void 0:e.i)||void 0===o?void 0:o[t.col];if(null===(i=null==r?void 0:r.o)||void 0===i?void 0:i.redraw){const t=await(n=this.element,s=r.o.redraw,new Promise((t=>{const e=document.createElement("vnode-html");n.appendChild(e),e.redraw=s,e.addEventListener("html",(o=>{e.remove(),t(o.detail)}))})));r.t.innerHTML=t.html,r.l=Math.random()}var n,s}onDataStoreChange(){this.onStoreChange()}onColDataChange(){this.onStoreChange()}onStoreChange(){var t,e;null===(t=this.columnService)||void 0===t||t.destroy(),this.columnService=new v(this.dataStore,this.colData),this.providers={type:this.type,colType:this.colType,readonly:this.readonly,data:this.dataStore,columns:this.colData,viewport:this.viewportCol,dimension:this.dimensionRow,selection:this.rowSelectionStore},null===(e=this.rangeUnsubscribe)||void 0===e||e.call(this),this.rangeUnsubscribe=this.rowSelectionStore.onChange("range",(t=>this.rowHighlightPlugin.selectionChange(t,this.renderedRows)))}connectedCallback(){this.rowHighlightPlugin=new T,this.onStoreChange()}disconnectedCallback(){var t,e;null===(t=this.columnService)||void 0===t||t.destroy(),null===(e=this.rangeUnsubscribe)||void 0===e||e.call(this)}async componentWillRender(){return this.beforeDataRender.emit({rowType:this.type,colType:this.colType}),Promise.all(this.jobsBeforeRender.map((t=>"function"==typeof t?t():t)))}componentDidRender(){this.afterrender.emit({type:this.type})}render(){if(this.renderedRows=new Map,!this.columnService.columns.length)return;const e=this.viewportRow.get("items");if(!e.length)return;const o=this.viewportCol.get("items");if(!o.length)return;const i=[],r=this.dataStore.get("groupingDepth"),s=this.dataStore.get("groupingCustomRenderer"),a=this.columnService.hasGrouping?r:0;for(let r of e){const e=f(this.dataStore,r.itemIndex);if(u(e)){const n=Object.assign(Object.assign({},r),{index:r.itemIndex,model:e,groupingCustomRenderer:s,hasExpand:this.columnService.hasGrouping&&"rowHeaders"!==this.colType,columnItems:o,providers:this.providers});i.push(t(R,Object.assign({},n)));continue}const n=[];for(let e of o){const o=Object.assign(Object.assign({},this.columnService.rowDataModel(r.itemIndex,e.itemIndex)),{providers:this.providers}),i=this.triggerBeforeCellRender(o,r,e);if(i.defaultPrevented)continue;const{detail:{column:s,row:l,model:d}}=i,c={[x]:s.itemIndex,[C]:l.itemIndex,style:{width:`${s.size}px`,transform:`translateX(${s.start}px)`,height:l.size?`${l.size}px`:void 0}};a&&!s.itemIndex&&c.style&&(c.style.paddingLeft=10*a+"px");const h=this.columnService.mergeProperties(l.itemIndex,s.itemIndex,c,d),g=t(D,{renderProps:{schemaModel:d,additionalData:this.additionalData,dragStartCell:this.dragStartCell},cellProps:h});n.push(g)}let l=this.rowClass?this.columnService.getRowClass(r.itemIndex,this.rowClass):"";this.rowHighlightPlugin.isRowFocused(r.itemIndex)&&(l+=` ${L}`);const d=t(y,{index:r.itemIndex,rowClass:l,size:r.size,start:r.start,groupingLevel:a||void 0},n);this.beforerowrender.emit({node:d,item:r,model:e,colType:this.columnService.type,rowType:this.type}),i.push(d),this.renderedRows.set(r.itemIndex,d)}return t(n,null,t("slot",null),i)}triggerBeforeCellRender(t,e,o){return this.beforeCellRender.emit({column:o,row:e,model:t,rowType:t.type,colType:t.colType})}get element(){return this}static get watchers(){return{dataStore:[{onDataStoreChange:0}],colData:[{onColDataChange:0}]}}static get style(){return".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\";display:inline-block}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}revogr-data{display:block;width:100%;position:relative}revogr-data .rgRow{position:absolute;width:100%;left:0}revogr-data .rgRow.groupingRow{font-weight:600;text-align:left}revogr-data .rgRow.groupingRow .group-expand{width:25px;height:100%;max-height:25px;margin-right:2px;background-color:transparent;border-color:transparent;vertical-align:middle;padding-left:5px;display:inline-flex}revogr-data .rgRow.groupingRow .group-expand svg{width:7px}revogr-data .revo-draggable{border:none;height:32px;display:inline-flex;outline:0;padding:0;font-size:0.8125rem;box-sizing:border-box;align-items:center;white-space:nowrap;vertical-align:middle;justify-content:center;text-decoration:none;width:24px;height:100%;cursor:pointer;display:inline-flex}revogr-data .revo-draggable:hover>.revo-drag-icon{opacity:1;zoom:1.2;font-weight:600}revogr-data .revo-draggable>.revo-drag-icon{pointer-events:none;transition:opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, zoom 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}revogr-data .rgCell{top:0;left:0;position:absolute;box-sizing:border-box;height:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;outline:none}revogr-data .rgCell.align-center{text-align:center}revogr-data .rgCell.align-left{text-align:left}revogr-data .rgCell.align-right{text-align:right}"}},[260,"revogr-data",{readonly:[4],range:[4],rowClass:[1,"row-class"],additionalData:[8,"additional-data"],rowSelectionStore:[16],viewportRow:[16],viewportCol:[16],dimensionRow:[16],colData:[16],dataStore:[16],type:[513],colType:[513,"col-type"],jobsBeforeRender:[16],providers:[32],updateCell:[64]},void 0,{dataStore:[{onDataStoreChange:0}],colData:[{onColDataChange:0}]}]);function O(){"undefined"!=typeof customElements&&["revogr-data","vnode-html"].forEach((t=>{switch(t){case"revogr-data":customElements.get(s(t))||customElements.define(s(t),M);break;case"vnode-html":customElements.get(s(t))||b()}}))}export{D as C,R as G,M as R,j as a,O as d,E as e}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as o,Host as l,transformTag as r}from"@stencil/core/internal/client";import{t as s}from"./throttle.js";import{L as n,a as c}from"./local.scroll.timer.js";const a="header",h="footer",d="content",v="data";function w(e,t){return{x:e.viewports[e.colType].store.get("realCount"),y:e.viewports[t].store.get("realCount")}}function p(e,t,i,o){return{colData:e.colStore,viewportCol:e.viewports[e.colType].store,viewportRow:e.viewports[t].store,lastCell:w(e,t),slot:i,type:t,canDrag:!o,position:e.position,dataStore:e.rowStores[t].store,dimensionCol:e.dimensions[e.colType].store,dimensionRow:e.dimensions[t].store,style:o?{height:`${e.dimensions[t].store.get("realSize")}px`}:void 0}}class u{constructor(e,t,i){this.resize=t,this.resizeObserver=null,this.previousSize={width:0,height:0},this.apply=s((e=>{var t;const i={width:e.width,height:e.height};null===(t=this.resize)||void 0===t||t.call(this,i,this.previousSize),this.previousSize=i}),40,{leading:!1,trailing:!0});const o=[];i.forEach((e=>{e&&o.push(e)})),this.init(e,o)}init(e,t=[]){const i=this.resizeObserver=new ResizeObserver((t=>{t.length&&this.apply(t[0].target===e?t[0].contentRect:e.getBoundingClientRect())}));i.observe(e),t.forEach((e=>{i.observe(e)}))}destroy(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.resizeObserver=null}}const
|
|
4
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as o,Host as l,transformTag as r}from"@stencil/core/internal/client";import{t as s}from"./throttle.js";import{L as n,a as c}from"./local.scroll.timer.js";const a="header",h="footer",d="content",v="data";function w(e,t){return{x:e.viewports[e.colType].store.get("realCount"),y:e.viewports[t].store.get("realCount")}}function p(e,t,i,o){return{colData:e.colStore,viewportCol:e.viewports[e.colType].store,viewportRow:e.viewports[t].store,lastCell:w(e,t),slot:i,type:t,canDrag:!o,position:e.position,dataStore:e.rowStores[t].store,dimensionCol:e.dimensions[e.colType].store,dimensionRow:e.dimensions[t].store,style:o?{height:`${e.dimensions[t].store.get("realSize")}px`}:void 0}}class u{constructor(e,t,i){this.resize=t,this.resizeObserver=null,this.previousSize={width:0,height:0},this.apply=s((e=>{var t;const i={width:e.width,height:e.height};null===(t=this.resize)||void 0===t||t.call(this,i,this.previousSize),this.previousSize=i}),40,{leading:!1,trailing:!0});const o=[];i.forEach((e=>{e&&o.push(e)})),this.init(e,o)}init(e,t=[]){const i=this.resizeObserver=new ResizeObserver((t=>{t.length&&this.apply(t[0].target===e?t[0].contentRect:e.getBoundingClientRect())}));i.observe(e),t.forEach((e=>{i.observe(e)}))}destroy(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.resizeObserver=null}}const f=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.scrollViewport=i(this,"scrollviewport",7),this.resizeViewport=i(this,"resizeviewport",7),this.scrollchange=i(this,"scrollchange",7),this.silentScroll=i(this,"scrollviewportsilent",7),this.contentWidth=0,this.contentHeight=0,this.noHorizontalScrollTransfer=!1}async setScroll(e){var t;this.localScrollTimer.latestScrollUpdate(e.dimension),null===(t=this.localScrollService)||void 0===t||t.setScroll(e)}async changeScroll(e,t=!1){var i,o;if(!t){if(e.delta){switch(e.dimension){case"rgCol":e.coordinate=this.horizontalScroll.scrollLeft+e.delta;break;case"rgRow":e.coordinate=(null!==(o=null===(i=this.verticalScroll)||void 0===i?void 0:i.scrollTop)&&void 0!==o?o:0)+e.delta}this.setScroll(e)}return e}e.coordinate&&this.verticalScroll&&"rgRow"===e.dimension&&(this.verticalScroll.style.transform=`translateY(${-1*e.coordinate}px)`)}mousewheelVertical({detail:e}){this.verticalMouseWheel(e)}mousewheelHorizontal({detail:e}){this.horizontalMouseWheel(e)}scrollApply({detail:{type:e,coordinate:t}}){this.applyOnScroll(e,t,!0)}connectedCallback(){this.verticalMouseWheel=this.onVerticalMouseWheel.bind(this,"rgRow","deltaY"),this.horizontalMouseWheel=this.onHorizontalMouseWheel.bind(this,"rgCol","deltaX"),this.localScrollTimer=new n("ontouchstart"in document.documentElement?0:10),this.localScrollService=new c({runScroll:e=>this.scrollViewport.emit(e),applyScroll:e=>{switch(this.localScrollTimer.setCoordinate(e),e.dimension){case"rgCol":this.horizontalScroll.scrollLeft=e.coordinate;break;case"rgRow":this.verticalScroll&&(this.verticalScroll.scrollTop=e.coordinate,this.verticalScroll.style.transform&&(this.verticalScroll.style.transform=""))}}})}componentDidLoad(){this.resizeService=new u(this.horizontalScroll,(e=>{var t,i,o,l,r,s,n,c;const a={};let h=e.height||0;h&&(h-=(null!==(i=null===(t=this.header)||void 0===t?void 0:t.clientHeight)&&void 0!==i?i:0)+(null!==(l=null===(o=this.footer)||void 0===o?void 0:o.clientHeight)&&void 0!==l?l:0)),a.rgRow={size:h,contentSize:this.contentHeight,scroll:null!==(s=null===(r=this.verticalScroll)||void 0===r?void 0:r.scrollTop)&&void 0!==s?s:0,noScroll:!1},a.rgCol={size:e.width||0,contentSize:this.contentWidth,scroll:this.horizontalScroll.scrollLeft,noScroll:"rgCol"!==this.colType};const d=["rgCol","rgRow"];for(const e of d){const t=a[e];t&&(this.resizeViewport.emit({dimension:e,size:t.size,rowHeader:this.rowHeader}),t.noScroll||(null===(n=this.localScrollService)||void 0===n||n.scroll(null!==(c=t.scroll)&&void 0!==c?c:0,e,!0),this.setScrollVisibility(e,t.size,t.contentSize)))}}),[this.footer,this.header])}setScrollVisibility(e,t,i){const o=t<i;let l;switch(e){case"rgCol":l=this.horizontalScroll;break;case"rgRow":l=this.verticalScroll}o?null==l||l.classList.add(`scroll-${e}`):null==l||l.classList.remove(`scroll-${e}`),this.scrollchange.emit({type:e,hasScroll:o})}disconnectedCallback(){var e;null===(e=this.resizeService)||void 0===e||e.destroy()}async componentDidRender(){var e,t,i,o;this.localScrollService.setParams({contentSize:this.contentHeight,clientSize:null!==(t=null===(e=this.verticalScroll)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,virtualSize:0},"rgRow"),this.localScrollService.setParams({contentSize:this.contentWidth,clientSize:this.horizontalScroll.clientWidth,virtualSize:0},"rgCol"),this.setScrollVisibility("rgRow",null!==(o=null===(i=this.verticalScroll)||void 0===i?void 0:i.clientHeight)&&void 0!==o?o:0,this.contentHeight),this.setScrollVisibility("rgCol",this.horizontalScroll.clientWidth,this.contentWidth)}render(){return o(l,{key:"adc7378dba1794ca2ec263d52b09abefe50bcbfd",onWheel:this.horizontalMouseWheel,onScroll:e=>this.applyScroll("rgCol",e)},o("div",{key:"7b57a8a0ea44629fefcfe4d2cd77bf0f048d8e06",class:"inner-content-table",style:{width:`${this.contentWidth}px`}},o("div",{key:"cca3de158bc2a7f0651f578a281819be5698b257",class:"header-wrapper",ref:e=>this.header=e},o("slot",{key:"1d170147dabe034f2c35481a8e2fedd6de2b6aed",name:a})),o("div",{key:"b6dd29a91bb1f380a83a035dfdb749ca669936f2",class:"vertical-inner",ref:e=>this.verticalScroll=e,onWheel:this.verticalMouseWheel,onScroll:e=>this.applyScroll("rgRow",e)},o("div",{key:"9bce27bf8ec4d3b679aa9a34eb6379a8c2d46cac",class:"content-wrapper",style:{height:`${this.contentHeight}px`}},o("slot",{key:"b44a082c9fbb948fd87bd235b4cd4356fd4a3536",name:d}))),o("div",{key:"28c305ff6bc664f1d1bbb117e8b8565c8d4bb6b2",class:"footer-wrapper",ref:e=>this.footer=e},o("slot",{key:"96312fb7f18198fd1feb9dcc00c79cde74ba9c9f",name:h}))))}async applyScroll(e,i){if(!(i.target instanceof t))return;let o=0;switch(e){case"rgCol":o=i.target.scrollLeft;break;case"rgRow":o=i.target.scrollTop}o<0?this.silentScroll.emit({dimension:e,coordinate:o}):this.applyOnScroll(e,o)}applyOnScroll(e,t,i=!1){const o=()=>{var o;null===(o=this.localScrollService)||void 0===o||o.scroll(t,e,void 0,void 0,i)};this.localScrollTimer.isReady(e,t)?o():this.localScrollTimer.throttleLastScrollUpdate(e,t,(()=>o()))}onVerticalMouseWheel(e,t,i){var o,l,r,s,n,c,a,h;const d=null!==(l=null===(o=this.verticalScroll)||void 0===o?void 0:o.scrollTop)&&void 0!==l?l:0;d+(null!==(s=null===(r=this.verticalScroll)||void 0===r?void 0:r.clientHeight)&&void 0!==s?s:0)>=(null!==(c=null===(n=this.verticalScroll)||void 0===n?void 0:n.scrollHeight)&&void 0!==c?c:0)&&i.deltaY>0||0===d&&i.deltaY<0||null===(a=i.preventDefault)||void 0===a||a.call(i),null===(h=this.localScrollService)||void 0===h||h.scroll(d+i[t],e,void 0,i[t]),this.localScrollTimer.latestScrollUpdate(e)}onHorizontalMouseWheel(e,t,i){var o,l,r,s;if(!i.deltaX)return;const{scrollLeft:n,scrollWidth:c,clientWidth:a}=this.horizontalScroll,h=n+a>=c&&i.deltaX>0,d=0===n&&i.deltaX<0;if(this.noHorizontalScrollTransfer){if(!h&&!d){const r=n+i[t];null===(o=i.preventDefault)||void 0===o||o.call(i),this.horizontalScroll.scrollLeft=r,null===(l=this.localScrollService)||void 0===l||l.scroll(this.horizontalScroll.scrollLeft,e,void 0,i[t]),this.localScrollTimer.latestScrollUpdate(e)}}else h||d||null===(r=i.preventDefault)||void 0===r||r.call(i),null===(s=this.localScrollService)||void 0===s||s.scroll(n+i[t],e,void 0,i[t]),this.localScrollTimer.latestScrollUpdate(e)}get horizontalScroll(){return this}static get style(){return".rowHeaders{z-index:2;font-size:10px;display:flex;height:100%}.rowHeaders revogr-data .rgCell{text-align:center}.rowHeaders .rgCell{padding:0 1em !important;min-width:100%}revogr-viewport-scroll{-ms-overflow-style:none;scrollbar-width:none;overflow-x:auto;overflow-y:hidden;position:relative;z-index:1;height:100%}revogr-viewport-scroll::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll.colPinStart,revogr-viewport-scroll.colPinEnd{z-index:2}revogr-viewport-scroll.colPinEnd:has(.active){overflow:visible}revogr-viewport-scroll.rgCol{flex-grow:1}revogr-viewport-scroll .content-wrapper{overflow:hidden}revogr-viewport-scroll .inner-content-table{display:flex;flex-direction:column;max-height:100%;width:100%;min-width:100%;position:relative;z-index:0}revogr-viewport-scroll .vertical-inner{overflow-y:auto;position:relative;width:100%;flex-grow:1;outline:none;-ms-overflow-style:none;scrollbar-width:none;}revogr-viewport-scroll .vertical-inner::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll .vertical-inner revogr-data,revogr-viewport-scroll .vertical-inner revogr-overlay-selection{height:100%}"}},[260,"revogr-viewport-scroll",{rowHeader:[4,"row-header"],contentWidth:[2,"content-width"],contentHeight:[2,"content-height"],colType:[1,"col-type"],noHorizontalScrollTransfer:[4,"no-horizontal-scroll-transfer"],setScroll:[64],changeScroll:[64],applyScroll:[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]]);function g(){"undefined"!=typeof customElements&&["revogr-viewport-scroll"].forEach((e=>{"revogr-viewport-scroll"===e&&(customElements.get(r(e))||customElements.define(r(e),f))}))}export{d as C,v as D,h as F,a as H,f as R,g as d,p as v}
|