@omegagrid/grid 0.5.15 → 0.5.17
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/ActionRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/ActionRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA0B7D,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAI,cAAc,CAoBpF"}
|
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActionRenderer = void 0;
|
|
4
|
-
const
|
|
5
|
-
const map_js_1 = require("lit
|
|
4
|
+
const lit_1 = require("lit");
|
|
5
|
+
const map_js_1 = require("lit/directives/map.js");
|
|
6
6
|
const ui_1 = require("../ui");
|
|
7
7
|
const BaseRenderer_1 = require("./BaseRenderer");
|
|
8
|
-
function _onButtonClick(e, cell, action) {
|
|
8
|
+
function _onButtonClick(e, grid, cell, action) {
|
|
9
9
|
e.stopPropagation();
|
|
10
|
-
|
|
10
|
+
grid.selecting.select(cell.range);
|
|
11
11
|
grid.dispatchEvent(new ui_1.GridEvent('action', { grid, cell, action: action.action }));
|
|
12
12
|
}
|
|
13
|
+
function showTooltip(grid, action) {
|
|
14
|
+
if (!action.title) {
|
|
15
|
+
hideTooltip(grid);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
grid.tooltip.content = action.title;
|
|
19
|
+
grid.tooltip.attachToCursor();
|
|
20
|
+
}
|
|
21
|
+
function hideTooltip(grid) {
|
|
22
|
+
var _a;
|
|
23
|
+
(_a = grid.tooltip) === null || _a === void 0 ? void 0 : _a.hide();
|
|
24
|
+
}
|
|
13
25
|
function ActionRenderer(div, cell) {
|
|
14
26
|
var _a;
|
|
15
27
|
const actions = (((_a = cell.editorContent) !== null && _a !== void 0 ? _a : cell.value) || []);
|
|
16
28
|
div.innerHTML = '';
|
|
17
|
-
|
|
29
|
+
const grid = this.grid;
|
|
30
|
+
(0, lit_1.render)((0, lit_1.html) `
|
|
18
31
|
<div class="actions">
|
|
19
|
-
${(0, map_js_1.map)(actions, action => (0,
|
|
32
|
+
${(0, map_js_1.map)(actions, action => (0, lit_1.html) `
|
|
20
33
|
<og-button
|
|
34
|
+
@pointermove="${(e) => e.stopPropagation()}"
|
|
35
|
+
@pointerdown="${(e) => e.stopPropagation()}"
|
|
36
|
+
@click="${(e) => _onButtonClick(e, grid, cell, action)}"
|
|
37
|
+
@mouseenter="${() => showTooltip(grid, action)}"
|
|
38
|
+
@mouseout="${() => hideTooltip(grid)}"
|
|
21
39
|
icon="${action.icon}"
|
|
22
|
-
color="${action.color}"
|
|
23
|
-
@mousedown="${(e) => _onButtonClick.call(this, e, cell, action)}">
|
|
40
|
+
color="${action.color}"></og-button>
|
|
24
41
|
</og-button>
|
|
25
42
|
`)}
|
|
26
43
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionRenderer.js","sourceRoot":"","sources":["../../src/renderers/ActionRenderer.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"ActionRenderer.js","sourceRoot":"","sources":["../../src/renderers/ActionRenderer.ts"],"names":[],"mappings":";;;AACA,6BAAmC;AACnC,kDAA4C;AAC5C,8BAA+C;AAC/C,iDAA8C;AAE9C,SAAS,cAAc,CAAC,CAAQ,EAAE,IAAU,EAAE,IAAe,EAAE,MAAkB;IAChF,CAAC,CAAC,eAAe,EAAE,CAAC;IACpB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,I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AAE,CAAC,WAAW,CAAC,IAAI,CAAC;aAC5B,MAAM,CAAC,IAAI;cACV,MAAM,CAAC,KAAK;;IAEtB,CAAC;;EAEH,EAAE,GAAG,CAAC,CAAC;IACR,OAAO,2BAAY,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AApBD,wCAoBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/grid",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.17",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Universal datagrid component",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"_prepublish": "yarn test && yarn lint"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@omegagrid/commands": "^0.5.
|
|
39
|
-
"@omegagrid/core": "^0.5.
|
|
40
|
-
"@omegagrid/grid-core": "^0.5.
|
|
41
|
-
"@omegagrid/localize": "^0.5.
|
|
42
|
-
"@omegagrid/tabs": "^0.5.
|
|
43
|
-
"@omegagrid/tree": "^0.5.
|
|
38
|
+
"@omegagrid/commands": "^0.5.17",
|
|
39
|
+
"@omegagrid/core": "^0.5.17",
|
|
40
|
+
"@omegagrid/grid-core": "^0.5.17",
|
|
41
|
+
"@omegagrid/localize": "^0.5.17",
|
|
42
|
+
"@omegagrid/tabs": "^0.5.17",
|
|
43
|
+
"@omegagrid/tree": "^0.5.17",
|
|
44
44
|
"@stdlib/stats": "^0.0.13",
|
|
45
45
|
"lit": "^3.1.1",
|
|
46
46
|
"lit-html": "^3.1.1",
|