@refinitiv-ui/efx-grid 6.0.79 → 6.0.81
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/column-dragging/es6/ColumnDragging.js +1 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +12 -11
- package/lib/column-selection-dialog/lib/locale/translation-de.js +2 -1
- package/lib/column-selection-dialog/lib/locale/translation-en.js +2 -1
- package/lib/column-selection-dialog/lib/locale/translation-ja.js +2 -1
- package/lib/column-selection-dialog/lib/locale/translation-zh-hant.js +2 -1
- package/lib/column-selection-dialog/lib/locale/translation-zh.js +2 -1
- package/lib/column-selection-dialog/themes/base.less +45 -24
- package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/core/dist/core.js +26 -1
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.d.ts +4 -0
- package/lib/core/es6/data/DataView.js +25 -0
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +4 -4
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +1 -2
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +12 -42
- package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +1 -2
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +99 -132
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +3 -1
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +181 -85
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +2 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +46 -13
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +1 -2
- package/lib/tr-grid-row-selection/es6/RowSelection.js +28 -51
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +1 -4
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +1 -3
- package/lib/types/es6/ColumnSelection.d.ts +1 -2
- package/lib/types/es6/ContextMenu.d.ts +1 -2
- package/lib/types/es6/Core/data/DataView.d.ts +4 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +36 -1
- package/lib/types/es6/RowFiltering.d.ts +3 -1
- package/lib/types/es6/RowGrouping.d.ts +2 -0
- package/lib/types/es6/RowSelection.d.ts +1 -2
- package/lib/types/es6/TextFormatting.d.ts +1 -5
- package/lib/versions.json +10 -10
- package/package.json +2 -2
@@ -198,6 +198,10 @@ declare class DataView extends EventDispatcher {
|
|
198
198
|
|
199
199
|
public disableCollapsing(bool?: boolean|null): void;
|
200
200
|
|
201
|
+
public setGroupColor(groupColor: string): void;
|
202
|
+
|
203
|
+
public getGroupColor(): string;
|
204
|
+
|
201
205
|
public getVisibleRowCount(): number;
|
202
206
|
|
203
207
|
public isRowDataInGroup(rowData: any, groupID?: string|null): boolean;
|
@@ -233,6 +233,10 @@ DataView.prototype._groupRows = null; // Shared between groups
|
|
233
233
|
*/
|
234
234
|
DataView.prototype._groupId = "";
|
235
235
|
/** @private
|
236
|
+
* @type {string}
|
237
|
+
*/
|
238
|
+
DataView.prototype._groupColor = "";
|
239
|
+
/** @private
|
236
240
|
* @type {*}
|
237
241
|
*/
|
238
242
|
DataView.prototype._groupValue;
|
@@ -1815,6 +1819,27 @@ DataView.prototype.isCollapsible = function() {
|
|
1815
1819
|
DataView.prototype.disableCollapsing = function(bool) {
|
1816
1820
|
this._collapsible = !(bool !== false);
|
1817
1821
|
};
|
1822
|
+
/**
|
1823
|
+
* @public
|
1824
|
+
* @param {string} groupColor
|
1825
|
+
*/
|
1826
|
+
DataView.prototype.setGroupColor = function(groupColor) {
|
1827
|
+
if(this._groupLevel === 1) {
|
1828
|
+
this._groupColor = groupColor;
|
1829
|
+
}
|
1830
|
+
};
|
1831
|
+
/**
|
1832
|
+
* @public
|
1833
|
+
* @return {string}
|
1834
|
+
*/
|
1835
|
+
DataView.prototype.getGroupColor = function() {
|
1836
|
+
if(this._groupLevel === 0) {
|
1837
|
+
return "";
|
1838
|
+
} else if(this._groupLevel === 1) {
|
1839
|
+
return this._groupColor;
|
1840
|
+
}
|
1841
|
+
return this._parent.getGroupColor();
|
1842
|
+
};
|
1818
1843
|
/** @private
|
1819
1844
|
* @return {?Array.<string>}
|
1820
1845
|
*/
|
package/lib/grid/index.js
CHANGED
@@ -1394,21 +1394,21 @@ CheckboxPlugin.prototype._onCheckboxChanged = function (e, toggling) {
|
|
1394
1394
|
}
|
1395
1395
|
}
|
1396
1396
|
|
1397
|
+
var checked = newState !== "unchecked";
|
1397
1398
|
if(changeRange) {
|
1398
1399
|
this.setCheckStates(changeRange, !e.altKey);
|
1399
1400
|
} else {
|
1400
|
-
var bool = newState !== "unchecked";
|
1401
1401
|
var subGroup = dv.getGroupByRowId(rid);
|
1402
1402
|
if (subGroup) {
|
1403
1403
|
var rowMemberIds = this._getRowMemberIdsOfSubgroup(dv, subGroup);
|
1404
|
-
this._setColumnData(dv, this._checkboxField,
|
1404
|
+
this._setColumnData(dv, this._checkboxField, checked, rowMemberIds);
|
1405
1405
|
|
1406
1406
|
// WORKAROUND: to force group move to next state from partial state
|
1407
1407
|
if (newState === 'checked' && chkbox._prevState === 'partial') {
|
1408
1408
|
chkbox._forceNewState = newState;
|
1409
1409
|
}
|
1410
1410
|
} else {
|
1411
|
-
this._setData(dv, rowIndex, this._checkboxField,
|
1411
|
+
this._setData(dv, rowIndex, this._checkboxField, checked);
|
1412
1412
|
}
|
1413
1413
|
}
|
1414
1414
|
}
|
@@ -1419,7 +1419,7 @@ CheckboxPlugin.prototype._onCheckboxChanged = function (e, toggling) {
|
|
1419
1419
|
if (this.hasListener("clicked")) {
|
1420
1420
|
pos["checkbox"] = chkbox;
|
1421
1421
|
pos["checkState"] = newState;
|
1422
|
-
pos["checked"] =
|
1422
|
+
pos["checked"] = checked;
|
1423
1423
|
this._dispatch("clicked", pos);
|
1424
1424
|
}
|
1425
1425
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
2
|
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
3
3
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
4
|
-
import {
|
5
|
-
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
4
|
+
import { prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
5
|
|
7
6
|
declare namespace ColumnSelectionPlugin {
|
8
7
|
|
@@ -3,8 +3,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
3
3
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
4
4
|
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
5
5
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
6
|
-
import {
|
7
|
-
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
|
+
import { prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
8
7
|
/** @event ColumnSelectionPlugin#selectionChanged
|
9
8
|
* @description Fired when selection is changed by mouse down or key press. A change by JavaScript APIs will not trigger this event.
|
10
9
|
*/
|
@@ -36,7 +35,6 @@ var ColumnSelectionPlugin = function ColumnSelectionPlugin(options) {
|
|
36
35
|
t._onColumnRemoved = t._onColumnRemoved.bind(t);
|
37
36
|
t._onColumnAdded = t._onColumnAdded.bind(t);
|
38
37
|
t._onReselection = t._onReselection.bind(t);
|
39
|
-
t._onThemeLoaded = t._onThemeLoaded.bind(t);
|
40
38
|
t._onColumnPositionChanged = t._onColumnPositionChanged.bind(t);
|
41
39
|
t._onBeforeBatchOperation = t._onBeforeBatchOperation.bind(t);
|
42
40
|
t._onAfterBatchOperation = t._onAfterBatchOperation.bind(t);
|
@@ -129,10 +127,20 @@ ColumnSelectionPlugin.prototype._cgp = null; // Column grouping extension
|
|
129
127
|
|
130
128
|
ColumnSelectionPlugin.prototype._prevSelectedCols = {}; // previous selected columns during batch operation
|
131
129
|
|
130
|
+
/** @private
|
131
|
+
* @return {string}
|
132
|
+
*/
|
133
|
+
|
134
|
+
ColumnSelectionPlugin._styleCalculator = function () {
|
135
|
+
var styles = [".column-selection-menu", ["position: absolute;", "background-color: var(--grid-column-menu-icon-bgcolor);", "color: var(--grid-column-menu-icon-color);", "z-index: 1;", "cursor: pointer;", "text-align: center;", "width: 16px;", "height: 16px;", "padding: 6px;"], ".column-selection-menu:hover", ["background-color: var(--grid-column-menu-icon-hover-bgcolor);"], ".column-selection-menu-inside", ["padding: 4px;" // if not outside icon, move to inside
|
136
|
+
], ".selected-column .cell.selected-group", ["background-color: var(--grid-selection-bgcolor);"]];
|
137
|
+
return prettifyCss(styles);
|
138
|
+
};
|
132
139
|
/** @public
|
133
140
|
* @return {string}
|
134
141
|
*/
|
135
142
|
|
143
|
+
|
136
144
|
ColumnSelectionPlugin.prototype.getName = function () {
|
137
145
|
return "ColumnSelectionPlugin"; // Read Only
|
138
146
|
};
|
@@ -167,45 +175,7 @@ ColumnSelectionPlugin.prototype.initialize = function (host, options) {
|
|
167
175
|
host.listen("beforeBatchOperation", this._onBeforeBatchOperation);
|
168
176
|
host.listen("afterBatchOperation", this._onAfterBatchOperation);
|
169
177
|
this.config(options);
|
170
|
-
|
171
|
-
if (ColumnSelectionPlugin._stylePromise) {
|
172
|
-
ColumnSelectionPlugin._applyThemeColor(host);
|
173
|
-
} else {
|
174
|
-
ColumnSelectionPlugin._stylePromise = ElfUtil.getThemeColors();
|
175
|
-
|
176
|
-
ColumnSelectionPlugin._stylePromise.then(this._onThemeLoaded)["catch"](this._onThemeLoaded);
|
177
|
-
}
|
178
|
-
};
|
179
|
-
/** @private
|
180
|
-
*/
|
181
|
-
|
182
|
-
|
183
|
-
ColumnSelectionPlugin.prototype._onThemeLoaded = function () {
|
184
|
-
if (!ColumnSelectionPlugin._styles) {
|
185
|
-
var styles = [".column-selection-menu", ["position: absolute;", "background-color: var(--grid-column-menu-icon-bgcolor);", "color: var(--grid-column-menu-icon-color);", "z-index: 1;", "cursor: pointer;", "text-align: center;", "width: 16px;", "height: 16px;", "padding: 6px;"], ".column-selection-menu:hover", ["background-color: var(--grid-column-menu-icon-hover-bgcolor);"], ".column-selection-menu-inside", ["padding: 4px;" // if not outside icon, move to inside
|
186
|
-
], ".selected-column .cell.selected-group", ["background-color: var(--grid-selection-bgcolor);"]];
|
187
|
-
ColumnSelectionPlugin._styles = prettifyCss(styles);
|
188
|
-
}
|
189
|
-
|
190
|
-
for (var i = this._hosts.length; --i >= 0;) {
|
191
|
-
ColumnSelectionPlugin._applyThemeColor(this._hosts[i]);
|
192
|
-
}
|
193
|
-
};
|
194
|
-
/** @private
|
195
|
-
* @param {Object} grid core grid instance
|
196
|
-
*/
|
197
|
-
|
198
|
-
|
199
|
-
ColumnSelectionPlugin._applyThemeColor = function (grid) {
|
200
|
-
if (!grid || grid._columnSelectionStyles) {
|
201
|
-
return;
|
202
|
-
}
|
203
|
-
|
204
|
-
if (ColumnSelectionPlugin._styles) {
|
205
|
-
grid._columnSelectionStyles = true; // Prevent loading the same style twice
|
206
|
-
|
207
|
-
injectCss(ColumnSelectionPlugin._styles, grid.getParent());
|
208
|
-
}
|
178
|
+
this.applyStaticStyles(ColumnSelectionPlugin._styleCalculator);
|
209
179
|
};
|
210
180
|
/**
|
211
181
|
* @protected
|
@@ -2,8 +2,7 @@ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
|
2
2
|
import Ext from "../../tr-grid-util/es6/Ext.js";
|
3
3
|
import MenuEventAPI from "./MenuEventAPI.js";
|
4
4
|
import PopupMenu from "./PopupMenu.js";
|
5
|
-
import {
|
6
|
-
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
|
+
import { prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
6
|
import CellPainter from "../../tr-grid-util/es6/CellPainter.js";
|
8
7
|
|
9
8
|
declare namespace ContextMenuPlugin {
|
@@ -2,8 +2,7 @@ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
|
2
2
|
import Ext from "../../tr-grid-util/es6/Ext.js";
|
3
3
|
import MenuEventAPI from "./MenuEventAPI.js";
|
4
4
|
import PopupMenu from "./PopupMenu.js";
|
5
|
-
import {
|
6
|
-
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
|
+
import { prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
6
|
import CellPainter from "../../tr-grid-util/es6/CellPainter.js";
|
8
7
|
|
9
8
|
/** @typedef {"header" | "content" | "footer" | "filterRow"} ContextMenuPlugin~Context
|
@@ -78,7 +77,6 @@ var ContextMenuPlugin = function (options) {
|
|
78
77
|
|
79
78
|
t._onItemClicked = t._onItemClicked.bind(t);
|
80
79
|
t._rightClickedHandler = t._rightClickedHandler.bind(t);
|
81
|
-
t._onThemeLoaded = t._onThemeLoaded.bind(t);
|
82
80
|
|
83
81
|
t.config({ "contextMenu": options });
|
84
82
|
};
|
@@ -93,14 +91,7 @@ ContextMenuPlugin.prototype._contextMap = {
|
|
93
91
|
"footer": "footer",
|
94
92
|
"filterRow": "filterRow"
|
95
93
|
};
|
96
|
-
|
97
|
-
* @private
|
98
|
-
*/
|
99
|
-
ContextMenuPlugin._styles = ""; // Static variable
|
100
|
-
/** @type {Promise<Object>}
|
101
|
-
* @private
|
102
|
-
*/
|
103
|
-
ContextMenuPlugin._stylePromise = null; // Static variable
|
94
|
+
|
104
95
|
/** @type {boolean}
|
105
96
|
* @private
|
106
97
|
*/
|
@@ -130,6 +121,102 @@ ContextMenuPlugin.prototype._rsp = null;
|
|
130
121
|
*/
|
131
122
|
ContextMenuPlugin.prototype._contextMenu = null;
|
132
123
|
|
124
|
+
/** @private
|
125
|
+
* @param {Object} colors
|
126
|
+
* @return {string}
|
127
|
+
*/
|
128
|
+
ContextMenuPlugin._styleCalculator = function (colors) {
|
129
|
+
var css = prettifyCss([
|
130
|
+
".tr-contextmenu", [
|
131
|
+
"outline: none;",
|
132
|
+
"box-sizing: border-box;",
|
133
|
+
"-moz-box-sizing: border-box;",
|
134
|
+
"border-style: solid;",
|
135
|
+
"border-width: 1px;",
|
136
|
+
"overflow: hidden;",
|
137
|
+
"padding: 1px;",
|
138
|
+
"margin: 0;",
|
139
|
+
"user-select: none;",
|
140
|
+
"list-style-type: none;",
|
141
|
+
"background-color: backgroundColor;",
|
142
|
+
"color: fontColor;",
|
143
|
+
"border-color: borderColor;"
|
144
|
+
],
|
145
|
+
".tr-contextmenu-item", [
|
146
|
+
"list-style: none;",
|
147
|
+
"padding: 3px 7px;",
|
148
|
+
"margin: 0;",
|
149
|
+
"vertical-align: middle;",
|
150
|
+
"white-space: nowrap;",
|
151
|
+
"cursor: pointer;",
|
152
|
+
"line-height: 20px;"
|
153
|
+
],
|
154
|
+
".tr-contextmenu-item[disabled]", [
|
155
|
+
"color: disabledColor;",
|
156
|
+
"cursor: default;"
|
157
|
+
],
|
158
|
+
".tr-contextmenu-item", [
|
159
|
+
"padding-right: 20px;"
|
160
|
+
],
|
161
|
+
".tr-contextmenu-item:hover:not([disabled])", [
|
162
|
+
"background-color: hoveredColor;"
|
163
|
+
],
|
164
|
+
".tr-contextmenu-popup", [
|
165
|
+
"box-shadow: 0 0 10px rgba(0,0,0,0.5);",
|
166
|
+
"z-index: 10;"
|
167
|
+
],
|
168
|
+
".tr-contextmenu-item.has-child", [
|
169
|
+
"position: relative;"
|
170
|
+
],
|
171
|
+
".tr-contextmenu-item.has-child:after", [
|
172
|
+
"box-sizing: border-box;",
|
173
|
+
"-moz-box-sizing: border-box;",
|
174
|
+
"display: inline-block;",
|
175
|
+
"width: 7px;",
|
176
|
+
"height: 7px;",
|
177
|
+
"border-style: solid;",
|
178
|
+
"border-width: 1px;",
|
179
|
+
"content: \"\";",
|
180
|
+
"-webkit-transform: rotate(45deg);",
|
181
|
+
"transform: rotate(45deg);",
|
182
|
+
"border-left-width: 0;",
|
183
|
+
"border-bottom-width: 0;",
|
184
|
+
"position: absolute;",
|
185
|
+
"right: 8px;",
|
186
|
+
"top: -webkit-calc(50% - 4px);",
|
187
|
+
"top: -moz-calc(50% - 4px);",
|
188
|
+
"top: calc(50% - 4px);",
|
189
|
+
"border-color: fontColor;"
|
190
|
+
],
|
191
|
+
".tr-contextmenu-item[data-type=\"separator\"]", [
|
192
|
+
"padding: 0;",
|
193
|
+
"border: none;",
|
194
|
+
"border-bottom-style: solid;",
|
195
|
+
"border-bottom-width: 1px;",
|
196
|
+
"border-bottom-color: disabledColor;"
|
197
|
+
]
|
198
|
+
]);
|
199
|
+
|
200
|
+
var hex = CellPainter.rgb2Hex(colors.tableBg);
|
201
|
+
var triplet = CellPainter.hex2Num(hex);
|
202
|
+
var bw = CellPainter.blackAndWhite(triplet);
|
203
|
+
var blendRatio;
|
204
|
+
if (bw === "#000000") { // Light theme
|
205
|
+
blendRatio = 0.1;
|
206
|
+
css = css.replace(/disabledColor/g, "lightgrey");
|
207
|
+
} else { // Dark theme
|
208
|
+
blendRatio = 0.2;
|
209
|
+
css = css.replace(/disabledColor/g, "gray");
|
210
|
+
}
|
211
|
+
var hoverd = CellPainter.num2Hex(CellPainter.blendColor(hex, bw, blendRatio));
|
212
|
+
css = css.replace(/hoveredColor/g, hoverd);
|
213
|
+
css = css.replace(/backgroundColor/g, colors.tableBg);
|
214
|
+
css = css.replace(/fontColor/g, colors.tableText);
|
215
|
+
css = css.replace(/borderColor/g, colors.tableBorder);
|
216
|
+
|
217
|
+
return css;
|
218
|
+
};
|
219
|
+
|
133
220
|
/** @public
|
134
221
|
* @return {string}
|
135
222
|
*/
|
@@ -151,14 +238,7 @@ ContextMenuPlugin.prototype.initialize = function (host, options) {
|
|
151
238
|
|
152
239
|
t.config(options);
|
153
240
|
|
154
|
-
|
155
|
-
ContextMenuPlugin._applyThemeColor(host);
|
156
|
-
} else { // Theme has NOT been loaded. Wait for the theme to be loaded
|
157
|
-
if(!ContextMenuPlugin._stylePromise) {
|
158
|
-
ContextMenuPlugin._stylePromise = ElfUtil.getThemeColors();
|
159
|
-
}
|
160
|
-
ContextMenuPlugin._stylePromise.then(t._onThemeLoaded).catch(t._onThemeLoaded);
|
161
|
-
}
|
241
|
+
t.applyStaticStyles(ContextMenuPlugin._styleCalculator);
|
162
242
|
};
|
163
243
|
|
164
244
|
/** @public
|
@@ -356,119 +436,6 @@ ContextMenuPlugin.prototype._onItemClicked = function (e) {
|
|
356
436
|
}
|
357
437
|
};
|
358
438
|
|
359
|
-
/** @private
|
360
|
-
*/
|
361
|
-
ContextMenuPlugin.prototype._onThemeLoaded = function () {
|
362
|
-
if(!ContextMenuPlugin._styles) { // Theme can be loaded only once
|
363
|
-
var colors = ElfUtil.getColors();
|
364
|
-
var css = prettifyCss([
|
365
|
-
".tr-contextmenu", [
|
366
|
-
"outline: none;",
|
367
|
-
"box-sizing: border-box;",
|
368
|
-
"-moz-box-sizing: border-box;",
|
369
|
-
"border-style: solid;",
|
370
|
-
"border-width: 1px;",
|
371
|
-
"overflow: hidden;",
|
372
|
-
"padding: 1px;",
|
373
|
-
"margin: 0;",
|
374
|
-
"user-select: none;",
|
375
|
-
"list-style-type: none;",
|
376
|
-
"background-color: backgroundColor;",
|
377
|
-
"color: fontColor;",
|
378
|
-
"border-color: borderColor;"
|
379
|
-
],
|
380
|
-
".tr-contextmenu-item", [
|
381
|
-
"list-style: none;",
|
382
|
-
"padding: 3px 7px;",
|
383
|
-
"margin: 0;",
|
384
|
-
"vertical-align: middle;",
|
385
|
-
"white-space: nowrap;",
|
386
|
-
"cursor: pointer;",
|
387
|
-
"line-height: 20px;"
|
388
|
-
],
|
389
|
-
".tr-contextmenu-item[disabled]", [
|
390
|
-
"color: disabledColor;",
|
391
|
-
"cursor: default;"
|
392
|
-
],
|
393
|
-
".tr-contextmenu-item", [
|
394
|
-
"padding-right: 20px;"
|
395
|
-
],
|
396
|
-
".tr-contextmenu-item:hover:not([disabled])", [
|
397
|
-
"background-color: hoveredColor;"
|
398
|
-
],
|
399
|
-
".tr-contextmenu-popup", [
|
400
|
-
"box-shadow: 0 0 10px rgba(0,0,0,0.5);",
|
401
|
-
"z-index: 10;"
|
402
|
-
],
|
403
|
-
".tr-contextmenu-item.has-child", [
|
404
|
-
"position: relative;"
|
405
|
-
],
|
406
|
-
".tr-contextmenu-item.has-child:after", [
|
407
|
-
"box-sizing: border-box;",
|
408
|
-
"-moz-box-sizing: border-box;",
|
409
|
-
"display: inline-block;",
|
410
|
-
"width: 7px;",
|
411
|
-
"height: 7px;",
|
412
|
-
"border-style: solid;",
|
413
|
-
"border-width: 1px;",
|
414
|
-
"content: \"\";",
|
415
|
-
"-webkit-transform: rotate(45deg);",
|
416
|
-
"transform: rotate(45deg);",
|
417
|
-
"border-left-width: 0;",
|
418
|
-
"border-bottom-width: 0;",
|
419
|
-
"position: absolute;",
|
420
|
-
"right: 8px;",
|
421
|
-
"top: -webkit-calc(50% - 4px);",
|
422
|
-
"top: -moz-calc(50% - 4px);",
|
423
|
-
"top: calc(50% - 4px);",
|
424
|
-
"border-color: fontColor;"
|
425
|
-
],
|
426
|
-
".tr-contextmenu-item[data-type=\"separator\"]", [
|
427
|
-
"padding: 0;",
|
428
|
-
"border: none;",
|
429
|
-
"border-bottom-style: solid;",
|
430
|
-
"border-bottom-width: 1px;",
|
431
|
-
"border-bottom-color: disabledColor;"
|
432
|
-
]
|
433
|
-
]);
|
434
|
-
|
435
|
-
var hex = CellPainter.rgb2Hex(colors.tableBg);
|
436
|
-
var triplet = CellPainter.hex2Num(hex);
|
437
|
-
var bw = CellPainter.blackAndWhite(triplet);
|
438
|
-
var blendRatio;
|
439
|
-
if (bw === "#000000") { // Light theme
|
440
|
-
blendRatio = 0.1;
|
441
|
-
css = css.replace(/disabledColor/g, "lightgrey");
|
442
|
-
} else { // Dark theme
|
443
|
-
blendRatio = 0.2;
|
444
|
-
css = css.replace(/disabledColor/g, "gray");
|
445
|
-
}
|
446
|
-
var hoverd = CellPainter.num2Hex(CellPainter.blendColor(hex, bw, blendRatio));
|
447
|
-
css = css.replace(/hoveredColor/g, hoverd);
|
448
|
-
css = css.replace(/backgroundColor/g, colors.tableBg);
|
449
|
-
css = css.replace(/fontColor/g, colors.tableText);
|
450
|
-
css = css.replace(/borderColor/g, colors.tableBorder);
|
451
|
-
|
452
|
-
ContextMenuPlugin._styles = css;
|
453
|
-
}
|
454
|
-
|
455
|
-
for(var i = this._hosts.length; --i >= 0;) {
|
456
|
-
ContextMenuPlugin._applyThemeColor(this._hosts[i]);
|
457
|
-
}
|
458
|
-
};
|
459
|
-
/** @private
|
460
|
-
* @param {Object} grid core grid object
|
461
|
-
*/
|
462
|
-
ContextMenuPlugin._applyThemeColor = function(grid) {
|
463
|
-
if(!grid || grid._contextMenuStyles) {
|
464
|
-
return;
|
465
|
-
}
|
466
|
-
if(ContextMenuPlugin._styles) {
|
467
|
-
grid._contextMenuStyles = true; // Prevent loading the same style twice
|
468
|
-
injectCss(ContextMenuPlugin._styles, grid.getElement());
|
469
|
-
}
|
470
|
-
};
|
471
|
-
|
472
439
|
|
473
440
|
|
474
441
|
export default ContextMenuPlugin;
|
@@ -30,7 +30,9 @@ declare namespace RowFilteringPlugin {
|
|
30
30
|
lang?: string|null,
|
31
31
|
rawDataAccessor?: ((...params: any[]) => any)|null,
|
32
32
|
formattedDataAccessor?: ((...params: any[]) => any)|null,
|
33
|
-
sortLogic?: ((...params: any[]) => any)|null
|
33
|
+
sortLogic?: ((...params: any[]) => any)|null,
|
34
|
+
itemList?: any[]|null,
|
35
|
+
additionalItems?: any[]|null
|
34
36
|
};
|
35
37
|
|
36
38
|
type Options = {
|