@revolist/revogrid 4.10.2 → 4.10.4
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-08ca04f4.js → column.drag.plugin-1005d5e5.js} +3 -3
- package/dist/cjs/{column.drag.plugin-08ca04f4.js.map → column.drag.plugin-1005d5e5.js.map} +1 -1
- package/dist/cjs/{column.service-2670e6e7.js → column.service-07fca9ee.js} +13 -7
- package/dist/cjs/column.service-07fca9ee.js.map +1 -0
- package/dist/cjs/{header-cell-renderer-db089f54.js → header-cell-renderer-452be4b4.js} +2 -2
- package/dist/cjs/{header-cell-renderer-db089f54.js.map → header-cell-renderer-452be4b4.js.map} +1 -1
- package/dist/cjs/index.cjs.js +4 -3
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +9 -8
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +17 -18
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/collection/components/data/cell-renderer.js +11 -9
- package/dist/collection/components/data/cell-renderer.js.map +1 -1
- package/dist/collection/components/data/column.service.js +5 -5
- package/dist/collection/components/data/column.service.js.map +1 -1
- package/dist/collection/components/data/revogr-data.js +10 -13
- package/dist/collection/components/data/revogr-data.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +3 -3
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/plugins/sorting/sorting.plugin.js +7 -6
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
- package/dist/collection/serve/data.js +12 -9
- package/dist/collection/types/interfaces.js.map +1 -1
- package/dist/collection/utils/column.utils.js +7 -2
- package/dist/collection/utils/column.utils.js.map +1 -1
- package/dist/esm/{column.drag.plugin-b7bba0da.js → column.drag.plugin-8ea8fdab.js} +3 -3
- package/dist/esm/{column.drag.plugin-b7bba0da.js.map → column.drag.plugin-8ea8fdab.js.map} +1 -1
- package/dist/esm/{column.service-9b0603f4.js → column.service-5d1cf29d.js} +13 -8
- package/dist/esm/column.service-5d1cf29d.js.map +1 -0
- package/dist/esm/{header-cell-renderer-fce020c3.js → header-cell-renderer-49cd23aa.js} +2 -2
- package/dist/esm/{header-cell-renderer-fce020c3.js.map → header-cell-renderer-49cd23aa.js.map} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/revo-grid.entry.js +9 -8
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +1 -1
- package/dist/esm/revogr-data_4.entry.js +17 -18
- package/dist/esm/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/{column.drag.plugin-b7bba0da.js → column.drag.plugin-8ea8fdab.js} +2 -2
- package/dist/revo-grid/column.service-5d1cf29d.js +5 -0
- package/dist/revo-grid/column.service-5d1cf29d.js.map +1 -0
- package/dist/revo-grid/{header-cell-renderer-fce020c3.js → header-cell-renderer-49cd23aa.js} +2 -2
- package/dist/revo-grid/index.esm.js +1 -1
- package/dist/revo-grid/index.esm.js.map +1 -1
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/types/components/data/cell-renderer.d.ts +2 -4
- package/dist/types/components/data/column.service.d.ts +2 -2
- package/dist/types/components/data/revogr-data.d.ts +4 -4
- package/dist/types/components/revoGrid/revo-grid.d.ts +3 -3
- package/dist/types/components.d.ts +16 -16
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +3 -1
- package/dist/types/types/interfaces.d.ts +5 -5
- package/dist/types/utils/column.utils.d.ts +1 -0
- package/hydrate/index.js +35 -30
- package/hydrate/index.mjs +35 -30
- package/package.json +1 -1
- package/readme.md +3 -3
- package/standalone/column.service.js +12 -7
- package/standalone/column.service.js.map +1 -1
- package/standalone/index.js +1 -1
- package/standalone/revo-grid.js +7 -6
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-data2.js +17 -18
- package/standalone/revogr-data2.js.map +1 -1
- package/standalone/revogr-header2.js +1 -1
- package/standalone/revogr-overlay-selection2.js +1 -1
- package/dist/cjs/column.service-2670e6e7.js.map +0 -1
- package/dist/esm/column.service-9b0603f4.js.map +0 -1
- package/dist/revo-grid/column.service-9b0603f4.js +0 -5
- package/dist/revo-grid/column.service-9b0603f4.js.map +0 -1
- /package/dist/revo-grid/{column.drag.plugin-b7bba0da.js.map → column.drag.plugin-8ea8fdab.js.map} +0 -0
- /package/dist/revo-grid/{header-cell-renderer-fce020c3.js.map → header-cell-renderer-49cd23aa.js.map} +0 -0
|
@@ -140,7 +140,7 @@ export interface ColumnType extends ColumnProperties {
|
|
|
140
140
|
*/
|
|
141
141
|
maxSize?: number;
|
|
142
142
|
/**
|
|
143
|
-
* Represents a custom editor defined in
|
|
143
|
+
* Represents a custom editor defined in editors property.
|
|
144
144
|
* Can be a string or an editor constructor function.
|
|
145
145
|
*/
|
|
146
146
|
editor?: string | EditorCtr;
|
|
@@ -190,11 +190,11 @@ export interface ColumnRegular extends ColumnType {
|
|
|
190
190
|
*/
|
|
191
191
|
autoSize?: boolean;
|
|
192
192
|
/**
|
|
193
|
-
* Filter. Require filter plugin to be installed and activated through grid config
|
|
193
|
+
* Filter. Require filter plugin to be installed and activated through grid config filter.
|
|
194
194
|
*/
|
|
195
195
|
filter?: boolean | string | string[];
|
|
196
196
|
/**
|
|
197
|
-
* Is column can be sorted, check
|
|
197
|
+
* Is column can be sorted, check cellCompare function for custom sorting.
|
|
198
198
|
*/
|
|
199
199
|
sortable?: boolean;
|
|
200
200
|
/**
|
|
@@ -206,7 +206,7 @@ export interface ColumnRegular extends ColumnType {
|
|
|
206
206
|
*/
|
|
207
207
|
rowDrag?: RowDrag;
|
|
208
208
|
/**
|
|
209
|
-
* Represents type defined in
|
|
209
|
+
* Represents type defined in columnTypes property through grid config.
|
|
210
210
|
*/
|
|
211
211
|
columnType?: string;
|
|
212
212
|
/**
|
|
@@ -342,7 +342,7 @@ export type FocusTemplateFunc = (createElement: HyperFunc<VNode>, detail: FocusR
|
|
|
342
342
|
*/
|
|
343
343
|
export type CellCompareFunc = (prop: ColumnProp, a: DataType, b: DataType) => number;
|
|
344
344
|
export type ColumnTemplateFunc = (createElement: HyperFunc<VNode>, props: ColumnTemplateProp, additionalData?: any) => any;
|
|
345
|
-
export type PropertiesFunc = (props:
|
|
345
|
+
export type PropertiesFunc = (props: CellTemplateProp) => CellProps | void | undefined;
|
|
346
346
|
export type ColPropertiesFunc = (props: ColumnPropProp) => CellProps | void | undefined;
|
|
347
347
|
export type DataType<D = any> = {
|
|
348
348
|
[T in ColumnProp]: DataFormat<D>;
|
|
@@ -6,6 +6,7 @@ export interface ColumnGroup extends StoreGroup {
|
|
|
6
6
|
}
|
|
7
7
|
export type ColumnGroupingCollection = Record<DimensionCols, ColumnGroup[]>;
|
|
8
8
|
export declare function getCellData(val?: any): any;
|
|
9
|
+
export declare function getCellRaw(model: DataType, column: ColumnRegular): any;
|
|
9
10
|
export declare function getCellDataParsed(model: DataType, column: ColumnRegular): any;
|
|
10
11
|
/**
|
|
11
12
|
* Column collection definition.
|
package/hydrate/index.js
CHANGED
|
@@ -8098,9 +8098,14 @@ function getCellData(val) {
|
|
|
8098
8098
|
}
|
|
8099
8099
|
return val;
|
|
8100
8100
|
}
|
|
8101
|
+
function getCellRaw(model, column) {
|
|
8102
|
+
if (column.cellParser) {
|
|
8103
|
+
return column.cellParser(model, column);
|
|
8104
|
+
}
|
|
8105
|
+
return model[column.prop];
|
|
8106
|
+
}
|
|
8101
8107
|
function getCellDataParsed(model, column) {
|
|
8102
|
-
|
|
8103
|
-
return getCellData(val);
|
|
8108
|
+
return getCellData(getCellRaw(model, column));
|
|
8104
8109
|
}
|
|
8105
8110
|
/**
|
|
8106
8111
|
* Get column type from column data
|
|
@@ -8610,12 +8615,13 @@ class ColumnService {
|
|
|
8610
8615
|
}
|
|
8611
8616
|
return !!readOnly;
|
|
8612
8617
|
}
|
|
8613
|
-
mergeProperties(r, c, defaultProps,
|
|
8618
|
+
mergeProperties(r, c, defaultProps, schemaModel) {
|
|
8619
|
+
var _a, _b;
|
|
8614
8620
|
const props = Object.assign({}, defaultProps);
|
|
8615
8621
|
props.class = Object.assign(Object.assign({}, (typeof props.class === 'string'
|
|
8616
8622
|
? { [props.class]: true }
|
|
8617
8623
|
: props.class)), { [CELL_CLASS]: true, [DISABLED_CLASS]: this.isReadOnly(r, c) });
|
|
8618
|
-
const extra =
|
|
8624
|
+
const extra = (_b = (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties) === null || _b === void 0 ? void 0 : _b.call(_a, schemaModel);
|
|
8619
8625
|
if (!extra) {
|
|
8620
8626
|
return props;
|
|
8621
8627
|
}
|
|
@@ -8664,7 +8670,6 @@ class ColumnService {
|
|
|
8664
8670
|
const column = this.columns[colIndex];
|
|
8665
8671
|
const prop = column === null || column === void 0 ? void 0 : column.prop;
|
|
8666
8672
|
const model = getSourceItem(this.dataStore, rowIndex) || {};
|
|
8667
|
-
const value = model[prop];
|
|
8668
8673
|
const type = this.dataStore.get('type');
|
|
8669
8674
|
return {
|
|
8670
8675
|
prop,
|
|
@@ -8675,7 +8680,7 @@ class ColumnService {
|
|
|
8675
8680
|
colIndex,
|
|
8676
8681
|
colType: this.type,
|
|
8677
8682
|
type,
|
|
8678
|
-
value,
|
|
8683
|
+
value: getCellRaw(model, column),
|
|
8679
8684
|
};
|
|
8680
8685
|
}
|
|
8681
8686
|
getRangeData(d, columns) {
|
|
@@ -11701,8 +11706,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
11701
11706
|
this.postponeSort(order, sortingFunc);
|
|
11702
11707
|
}
|
|
11703
11708
|
getComparer(column, order) {
|
|
11704
|
-
var _a;
|
|
11705
|
-
const cellCmp = ((_a = column === null || column === void 0 ? void 0 : column.cellCompare) === null || _a === void 0 ? void 0 : _a.bind({ order })) || this.defaultCellCompare;
|
|
11709
|
+
var _a, _b;
|
|
11710
|
+
const cellCmp = ((_a = column === null || column === void 0 ? void 0 : column.cellCompare) === null || _a === void 0 ? void 0 : _a.bind({ order })) || ((_b = this.defaultCellCompare) === null || _b === void 0 ? void 0 : _b.bind({ column }));
|
|
11706
11711
|
if (order == 'asc') {
|
|
11707
11712
|
return cellCmp;
|
|
11708
11713
|
}
|
|
@@ -11812,9 +11817,10 @@ class SortingPlugin extends BasePlugin {
|
|
|
11812
11817
|
this.emit('aftersortingapply');
|
|
11813
11818
|
}
|
|
11814
11819
|
defaultCellCompare(prop, a, b) {
|
|
11815
|
-
|
|
11816
|
-
const
|
|
11817
|
-
const
|
|
11820
|
+
const aRaw = this.column ? getCellRaw(a, this.column) : a === null || a === void 0 ? void 0 : a[prop];
|
|
11821
|
+
const bRaw = this.column ? getCellRaw(b, this.column) : b === null || b === void 0 ? void 0 : b[prop];
|
|
11822
|
+
const av = aRaw === null || aRaw === void 0 ? void 0 : aRaw.toString().toLowerCase();
|
|
11823
|
+
const bv = bRaw === null || bRaw === void 0 ? void 0 : bRaw.toString().toLowerCase();
|
|
11818
11824
|
return av == bv ? 0 : av > bv ? 1 : -1;
|
|
11819
11825
|
}
|
|
11820
11826
|
descCellCompare(cmp) {
|
|
@@ -13732,9 +13738,9 @@ var RevoGridStyle0 = revoGridStyleCss;
|
|
|
13732
13738
|
* All complex property types such as `ColumnRegular`, `ColumnProp`, `ColumnDataSchemaModel` can be found there.
|
|
13733
13739
|
* :::
|
|
13734
13740
|
*
|
|
13735
|
-
* :::
|
|
13736
|
-
* For a comprehensive events guide, check the [
|
|
13737
|
-
* All events propagate to the root level of the grid.
|
|
13741
|
+
* :::info
|
|
13742
|
+
* For a comprehensive events guide, check the [Events](./events.md).
|
|
13743
|
+
* All events propagate to the root level of the grid. [Dependency tree](#Dependencies).
|
|
13738
13744
|
* :::
|
|
13739
13745
|
*
|
|
13740
13746
|
* @slot data-{column-type}-{row-type}. @example data-rgCol-rgRow - main data slot. Applies extra elements in <revogr-data />.
|
|
@@ -14817,30 +14823,32 @@ function convertVNodeToHTML(parentHolder, redraw) {
|
|
|
14817
14823
|
}
|
|
14818
14824
|
|
|
14819
14825
|
function renderCell(v) {
|
|
14826
|
+
var _a;
|
|
14820
14827
|
const els = [];
|
|
14821
14828
|
// #region Custom cell
|
|
14822
|
-
|
|
14823
|
-
|
|
14829
|
+
const template = (_a = v.schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellTemplate;
|
|
14830
|
+
if (template) {
|
|
14831
|
+
els.push(template(hAsync, v.schemaModel, v.additionalData));
|
|
14824
14832
|
}
|
|
14825
14833
|
// #endregion
|
|
14826
14834
|
// #region Regular cell
|
|
14827
14835
|
else {
|
|
14828
|
-
if (!v.
|
|
14836
|
+
if (!v.schemaModel.column) {
|
|
14829
14837
|
return '';
|
|
14830
14838
|
}
|
|
14831
14839
|
// Row drag
|
|
14832
|
-
if (v.
|
|
14833
|
-
isRowDragService(v.
|
|
14840
|
+
if (v.schemaModel.column.rowDrag &&
|
|
14841
|
+
isRowDragService(v.schemaModel.column.rowDrag, v.schemaModel)) {
|
|
14834
14842
|
els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent => {
|
|
14835
14843
|
var _a;
|
|
14836
14844
|
return (_a = v.dragStartCell) === null || _a === void 0 ? void 0 : _a.emit({
|
|
14837
14845
|
originalEvent,
|
|
14838
|
-
model: v.
|
|
14846
|
+
model: v.schemaModel,
|
|
14839
14847
|
});
|
|
14840
14848
|
} },
|
|
14841
14849
|
hAsync("span", { class: DRAG_ICON_CLASS })));
|
|
14842
14850
|
}
|
|
14843
|
-
els.push(`${
|
|
14851
|
+
els.push(`${getCellDataParsed(v.schemaModel.model, v.schemaModel.column)}`);
|
|
14844
14852
|
}
|
|
14845
14853
|
return els;
|
|
14846
14854
|
}
|
|
@@ -14938,7 +14946,6 @@ class RevogrData {
|
|
|
14938
14946
|
this.afterrender.emit({ type: this.type });
|
|
14939
14947
|
}
|
|
14940
14948
|
render() {
|
|
14941
|
-
var _a, _b;
|
|
14942
14949
|
this.renderedRows = new Map();
|
|
14943
14950
|
const columnsData = this.columnService.columns;
|
|
14944
14951
|
if (!columnsData.length) {
|
|
@@ -14967,9 +14974,9 @@ class RevogrData {
|
|
|
14967
14974
|
const cells = [];
|
|
14968
14975
|
// #region Cells
|
|
14969
14976
|
for (let rgCol of cols) {
|
|
14970
|
-
const
|
|
14977
|
+
const smodel = Object.assign(Object.assign({}, this.columnService.rowDataModel(rgRow.itemIndex, rgCol.itemIndex)), { providers: this.providers });
|
|
14971
14978
|
// call before cell render
|
|
14972
|
-
const cellEvent = this.triggerBeforeCellRender(
|
|
14979
|
+
const cellEvent = this.triggerBeforeCellRender(smodel, rgRow, rgCol);
|
|
14973
14980
|
// if event was prevented
|
|
14974
14981
|
if (cellEvent.defaultPrevented) {
|
|
14975
14982
|
continue;
|
|
@@ -14990,13 +14997,11 @@ class RevogrData {
|
|
|
14990
14997
|
if (groupDepth && !columnProps.itemIndex && defaultProps.style) {
|
|
14991
14998
|
defaultProps.style.paddingLeft = `${PADDING_DEPTH * groupDepth}px`;
|
|
14992
14999
|
}
|
|
14993
|
-
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel
|
|
15000
|
+
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel);
|
|
14994
15001
|
// Never use webcomponent for cell render
|
|
14995
15002
|
// It's very slow because of webcomponent initialization takes time
|
|
14996
15003
|
const cellNode = hAsync(CellRenderer, { renderProps: {
|
|
14997
|
-
|
|
14998
|
-
providers: this.providers,
|
|
14999
|
-
template: (_b = schemaModel.column) === null || _b === void 0 ? void 0 : _b.cellTemplate,
|
|
15004
|
+
schemaModel,
|
|
15000
15005
|
additionalData: this.additionalData,
|
|
15001
15006
|
dragStartCell: this.dragStartCell,
|
|
15002
15007
|
}, cellProps: props });
|
|
@@ -15026,8 +15031,8 @@ class RevogrData {
|
|
|
15026
15031
|
}
|
|
15027
15032
|
triggerBeforeCellRender(model, row, column) {
|
|
15028
15033
|
const detail = {
|
|
15029
|
-
column
|
|
15030
|
-
row
|
|
15034
|
+
column,
|
|
15035
|
+
row,
|
|
15031
15036
|
model,
|
|
15032
15037
|
rowType: model.type,
|
|
15033
15038
|
colType: model.colType,
|
package/hydrate/index.mjs
CHANGED
|
@@ -8094,9 +8094,14 @@ function getCellData(val) {
|
|
|
8094
8094
|
}
|
|
8095
8095
|
return val;
|
|
8096
8096
|
}
|
|
8097
|
+
function getCellRaw(model, column) {
|
|
8098
|
+
if (column.cellParser) {
|
|
8099
|
+
return column.cellParser(model, column);
|
|
8100
|
+
}
|
|
8101
|
+
return model[column.prop];
|
|
8102
|
+
}
|
|
8097
8103
|
function getCellDataParsed(model, column) {
|
|
8098
|
-
|
|
8099
|
-
return getCellData(val);
|
|
8104
|
+
return getCellData(getCellRaw(model, column));
|
|
8100
8105
|
}
|
|
8101
8106
|
/**
|
|
8102
8107
|
* Get column type from column data
|
|
@@ -8606,12 +8611,13 @@ class ColumnService {
|
|
|
8606
8611
|
}
|
|
8607
8612
|
return !!readOnly;
|
|
8608
8613
|
}
|
|
8609
|
-
mergeProperties(r, c, defaultProps,
|
|
8614
|
+
mergeProperties(r, c, defaultProps, schemaModel) {
|
|
8615
|
+
var _a, _b;
|
|
8610
8616
|
const props = Object.assign({}, defaultProps);
|
|
8611
8617
|
props.class = Object.assign(Object.assign({}, (typeof props.class === 'string'
|
|
8612
8618
|
? { [props.class]: true }
|
|
8613
8619
|
: props.class)), { [CELL_CLASS]: true, [DISABLED_CLASS]: this.isReadOnly(r, c) });
|
|
8614
|
-
const extra =
|
|
8620
|
+
const extra = (_b = (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties) === null || _b === void 0 ? void 0 : _b.call(_a, schemaModel);
|
|
8615
8621
|
if (!extra) {
|
|
8616
8622
|
return props;
|
|
8617
8623
|
}
|
|
@@ -8660,7 +8666,6 @@ class ColumnService {
|
|
|
8660
8666
|
const column = this.columns[colIndex];
|
|
8661
8667
|
const prop = column === null || column === void 0 ? void 0 : column.prop;
|
|
8662
8668
|
const model = getSourceItem(this.dataStore, rowIndex) || {};
|
|
8663
|
-
const value = model[prop];
|
|
8664
8669
|
const type = this.dataStore.get('type');
|
|
8665
8670
|
return {
|
|
8666
8671
|
prop,
|
|
@@ -8671,7 +8676,7 @@ class ColumnService {
|
|
|
8671
8676
|
colIndex,
|
|
8672
8677
|
colType: this.type,
|
|
8673
8678
|
type,
|
|
8674
|
-
value,
|
|
8679
|
+
value: getCellRaw(model, column),
|
|
8675
8680
|
};
|
|
8676
8681
|
}
|
|
8677
8682
|
getRangeData(d, columns) {
|
|
@@ -11697,8 +11702,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
11697
11702
|
this.postponeSort(order, sortingFunc);
|
|
11698
11703
|
}
|
|
11699
11704
|
getComparer(column, order) {
|
|
11700
|
-
var _a;
|
|
11701
|
-
const cellCmp = ((_a = column === null || column === void 0 ? void 0 : column.cellCompare) === null || _a === void 0 ? void 0 : _a.bind({ order })) || this.defaultCellCompare;
|
|
11705
|
+
var _a, _b;
|
|
11706
|
+
const cellCmp = ((_a = column === null || column === void 0 ? void 0 : column.cellCompare) === null || _a === void 0 ? void 0 : _a.bind({ order })) || ((_b = this.defaultCellCompare) === null || _b === void 0 ? void 0 : _b.bind({ column }));
|
|
11702
11707
|
if (order == 'asc') {
|
|
11703
11708
|
return cellCmp;
|
|
11704
11709
|
}
|
|
@@ -11808,9 +11813,10 @@ class SortingPlugin extends BasePlugin {
|
|
|
11808
11813
|
this.emit('aftersortingapply');
|
|
11809
11814
|
}
|
|
11810
11815
|
defaultCellCompare(prop, a, b) {
|
|
11811
|
-
|
|
11812
|
-
const
|
|
11813
|
-
const
|
|
11816
|
+
const aRaw = this.column ? getCellRaw(a, this.column) : a === null || a === void 0 ? void 0 : a[prop];
|
|
11817
|
+
const bRaw = this.column ? getCellRaw(b, this.column) : b === null || b === void 0 ? void 0 : b[prop];
|
|
11818
|
+
const av = aRaw === null || aRaw === void 0 ? void 0 : aRaw.toString().toLowerCase();
|
|
11819
|
+
const bv = bRaw === null || bRaw === void 0 ? void 0 : bRaw.toString().toLowerCase();
|
|
11814
11820
|
return av == bv ? 0 : av > bv ? 1 : -1;
|
|
11815
11821
|
}
|
|
11816
11822
|
descCellCompare(cmp) {
|
|
@@ -13728,9 +13734,9 @@ var RevoGridStyle0 = revoGridStyleCss;
|
|
|
13728
13734
|
* All complex property types such as `ColumnRegular`, `ColumnProp`, `ColumnDataSchemaModel` can be found there.
|
|
13729
13735
|
* :::
|
|
13730
13736
|
*
|
|
13731
|
-
* :::
|
|
13732
|
-
* For a comprehensive events guide, check the [
|
|
13733
|
-
* All events propagate to the root level of the grid.
|
|
13737
|
+
* :::info
|
|
13738
|
+
* For a comprehensive events guide, check the [Events](./events.md).
|
|
13739
|
+
* All events propagate to the root level of the grid. [Dependency tree](#Dependencies).
|
|
13734
13740
|
* :::
|
|
13735
13741
|
*
|
|
13736
13742
|
* @slot data-{column-type}-{row-type}. @example data-rgCol-rgRow - main data slot. Applies extra elements in <revogr-data />.
|
|
@@ -14813,30 +14819,32 @@ function convertVNodeToHTML(parentHolder, redraw) {
|
|
|
14813
14819
|
}
|
|
14814
14820
|
|
|
14815
14821
|
function renderCell(v) {
|
|
14822
|
+
var _a;
|
|
14816
14823
|
const els = [];
|
|
14817
14824
|
// #region Custom cell
|
|
14818
|
-
|
|
14819
|
-
|
|
14825
|
+
const template = (_a = v.schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellTemplate;
|
|
14826
|
+
if (template) {
|
|
14827
|
+
els.push(template(hAsync, v.schemaModel, v.additionalData));
|
|
14820
14828
|
}
|
|
14821
14829
|
// #endregion
|
|
14822
14830
|
// #region Regular cell
|
|
14823
14831
|
else {
|
|
14824
|
-
if (!v.
|
|
14832
|
+
if (!v.schemaModel.column) {
|
|
14825
14833
|
return '';
|
|
14826
14834
|
}
|
|
14827
14835
|
// Row drag
|
|
14828
|
-
if (v.
|
|
14829
|
-
isRowDragService(v.
|
|
14836
|
+
if (v.schemaModel.column.rowDrag &&
|
|
14837
|
+
isRowDragService(v.schemaModel.column.rowDrag, v.schemaModel)) {
|
|
14830
14838
|
els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent => {
|
|
14831
14839
|
var _a;
|
|
14832
14840
|
return (_a = v.dragStartCell) === null || _a === void 0 ? void 0 : _a.emit({
|
|
14833
14841
|
originalEvent,
|
|
14834
|
-
model: v.
|
|
14842
|
+
model: v.schemaModel,
|
|
14835
14843
|
});
|
|
14836
14844
|
} },
|
|
14837
14845
|
hAsync("span", { class: DRAG_ICON_CLASS })));
|
|
14838
14846
|
}
|
|
14839
|
-
els.push(`${
|
|
14847
|
+
els.push(`${getCellDataParsed(v.schemaModel.model, v.schemaModel.column)}`);
|
|
14840
14848
|
}
|
|
14841
14849
|
return els;
|
|
14842
14850
|
}
|
|
@@ -14934,7 +14942,6 @@ class RevogrData {
|
|
|
14934
14942
|
this.afterrender.emit({ type: this.type });
|
|
14935
14943
|
}
|
|
14936
14944
|
render() {
|
|
14937
|
-
var _a, _b;
|
|
14938
14945
|
this.renderedRows = new Map();
|
|
14939
14946
|
const columnsData = this.columnService.columns;
|
|
14940
14947
|
if (!columnsData.length) {
|
|
@@ -14963,9 +14970,9 @@ class RevogrData {
|
|
|
14963
14970
|
const cells = [];
|
|
14964
14971
|
// #region Cells
|
|
14965
14972
|
for (let rgCol of cols) {
|
|
14966
|
-
const
|
|
14973
|
+
const smodel = Object.assign(Object.assign({}, this.columnService.rowDataModel(rgRow.itemIndex, rgCol.itemIndex)), { providers: this.providers });
|
|
14967
14974
|
// call before cell render
|
|
14968
|
-
const cellEvent = this.triggerBeforeCellRender(
|
|
14975
|
+
const cellEvent = this.triggerBeforeCellRender(smodel, rgRow, rgCol);
|
|
14969
14976
|
// if event was prevented
|
|
14970
14977
|
if (cellEvent.defaultPrevented) {
|
|
14971
14978
|
continue;
|
|
@@ -14986,13 +14993,11 @@ class RevogrData {
|
|
|
14986
14993
|
if (groupDepth && !columnProps.itemIndex && defaultProps.style) {
|
|
14987
14994
|
defaultProps.style.paddingLeft = `${PADDING_DEPTH * groupDepth}px`;
|
|
14988
14995
|
}
|
|
14989
|
-
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel
|
|
14996
|
+
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel);
|
|
14990
14997
|
// Never use webcomponent for cell render
|
|
14991
14998
|
// It's very slow because of webcomponent initialization takes time
|
|
14992
14999
|
const cellNode = hAsync(CellRenderer, { renderProps: {
|
|
14993
|
-
|
|
14994
|
-
providers: this.providers,
|
|
14995
|
-
template: (_b = schemaModel.column) === null || _b === void 0 ? void 0 : _b.cellTemplate,
|
|
15000
|
+
schemaModel,
|
|
14996
15001
|
additionalData: this.additionalData,
|
|
14997
15002
|
dragStartCell: this.dragStartCell,
|
|
14998
15003
|
}, cellProps: props });
|
|
@@ -15022,8 +15027,8 @@ class RevogrData {
|
|
|
15022
15027
|
}
|
|
15023
15028
|
triggerBeforeCellRender(model, row, column) {
|
|
15024
15029
|
const detail = {
|
|
15025
|
-
column
|
|
15026
|
-
row
|
|
15030
|
+
column,
|
|
15031
|
+
row,
|
|
15027
15032
|
model,
|
|
15028
15033
|
rowType: model.type,
|
|
15029
15034
|
colType: model.colType,
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@revolist/revogrid"><img src="https://img.shields.io/npm/v/@revolist/revogrid" alt="Latest Version on NPM"/></a>
|
|
9
9
|
<a href="https://github.com/revolist/revogrid/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/@revolist/revogrid" alt="Software License"/></a>
|
|
10
|
-
<img src="https://badgen.net/bundlephobia/dependency-count/@revolist/revogrid
|
|
11
|
-
<img src="https://badgen.net/bundlephobia/tree-shaking/@revolist/revogrid
|
|
12
|
-
<img src="https://
|
|
10
|
+
<img src="https://badgen.net/bundlephobia/dependency-count/@revolist/revogrid" alt="Dependency count"/>
|
|
11
|
+
<img src="https://badgen.net/bundlephobia/tree-shaking/@revolist/revogrid" alt="Tree shaking"/>
|
|
12
|
+
<img src="https://img.shields.io/bundlephobia/min/@revolist/revogrid" alt="Bundle size"/>
|
|
13
13
|
<img src="https://sonarcloud.io/api/project_badges/measure?project=revolist_revogrid&metric=alert_status" alt="Sonar Quality Gate"/>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
@@ -626,9 +626,14 @@ function getCellData(val) {
|
|
|
626
626
|
}
|
|
627
627
|
return val;
|
|
628
628
|
}
|
|
629
|
+
function getCellRaw(model, column) {
|
|
630
|
+
if (column.cellParser) {
|
|
631
|
+
return column.cellParser(model, column);
|
|
632
|
+
}
|
|
633
|
+
return model[column.prop];
|
|
634
|
+
}
|
|
629
635
|
function getCellDataParsed(model, column) {
|
|
630
|
-
|
|
631
|
-
return getCellData(val);
|
|
636
|
+
return getCellData(getCellRaw(model, column));
|
|
632
637
|
}
|
|
633
638
|
/**
|
|
634
639
|
* Get column type from column data
|
|
@@ -979,12 +984,13 @@ class ColumnService {
|
|
|
979
984
|
}
|
|
980
985
|
return !!readOnly;
|
|
981
986
|
}
|
|
982
|
-
mergeProperties(r, c, defaultProps,
|
|
987
|
+
mergeProperties(r, c, defaultProps, schemaModel) {
|
|
988
|
+
var _a, _b;
|
|
983
989
|
const props = Object.assign({}, defaultProps);
|
|
984
990
|
props.class = Object.assign(Object.assign({}, (typeof props.class === 'string'
|
|
985
991
|
? { [props.class]: true }
|
|
986
992
|
: props.class)), { [CELL_CLASS]: true, [DISABLED_CLASS]: this.isReadOnly(r, c) });
|
|
987
|
-
const extra =
|
|
993
|
+
const extra = (_b = (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties) === null || _b === void 0 ? void 0 : _b.call(_a, schemaModel);
|
|
988
994
|
if (!extra) {
|
|
989
995
|
return props;
|
|
990
996
|
}
|
|
@@ -1033,7 +1039,6 @@ class ColumnService {
|
|
|
1033
1039
|
const column = this.columns[colIndex];
|
|
1034
1040
|
const prop = column === null || column === void 0 ? void 0 : column.prop;
|
|
1035
1041
|
const model = getSourceItem(this.dataStore, rowIndex) || {};
|
|
1036
|
-
const value = model[prop];
|
|
1037
1042
|
const type = this.dataStore.get('type');
|
|
1038
1043
|
return {
|
|
1039
1044
|
prop,
|
|
@@ -1044,7 +1049,7 @@ class ColumnService {
|
|
|
1044
1049
|
colIndex,
|
|
1045
1050
|
colType: this.type,
|
|
1046
1051
|
type,
|
|
1047
|
-
value,
|
|
1052
|
+
value: getCellRaw(model, column),
|
|
1048
1053
|
};
|
|
1049
1054
|
}
|
|
1050
1055
|
getRangeData(d, columns) {
|
|
@@ -1246,6 +1251,6 @@ function doPropMerge(existing, extra) {
|
|
|
1246
1251
|
return props;
|
|
1247
1252
|
}
|
|
1248
1253
|
|
|
1249
|
-
export {
|
|
1254
|
+
export { isGroupingColumn as A, SelectionStoreConnector as B, doPropMerge as C, GROUP_EXPAND_BTN as D, EMPTY_INDEX as E, PSEUDO_GROUP_ITEM as F, GROUP_EXPANDED as G, isRowDragService as H, ColumnService as I, PSEUDO_GROUP_ITEM_VALUE as P, SelectionStore as S, isRangeSingleCell as a, getCellData as b, cropCellToMax as c, getCellRaw as d, getCellDataParsed as e, getColumnType as f, getRange as g, getColumnSizes as h, isHiddenStore as i, isColGrouping as j, getColumns as k, gatherGroup as l, getColumnByProp as m, nextCell as n, baseEach$1 as o, isGrouping as p, getGroupingName as q, reduce as r, getParsedGroup as s, isSameGroup as t, GROUP_DEPTH as u, PSEUDO_GROUP_ITEM_ID as v, GROUPING_ROW_TYPE as w, PSEUDO_GROUP_COLUMN as x, GROUP_EXPAND_EVENT as y, gatherGrouping as z };
|
|
1250
1255
|
|
|
1251
1256
|
//# sourceMappingURL=column.service.js.map
|