@revolist/revogrid 3.2.13 → 3.2.16
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/custom-element/_baseIteratee.js +2070 -0
- package/custom-element/columnService.js +743 -0
- package/custom-element/consts.js +46 -0
- package/custom-element/data.store.js +545 -0
- package/custom-element/debounce.js +217 -0
- package/custom-element/dimension.helpers.js +340 -0
- package/custom-element/each.js +180 -0
- package/custom-element/filter.button.js +36 -0
- package/custom-element/identity.js +26 -0
- package/custom-element/index.d.ts +15 -98
- package/custom-element/index.js +15 -29221
- package/custom-element/isSymbol.js +220 -0
- package/custom-element/keys.js +561 -0
- package/custom-element/localScrollService.js +86 -0
- package/custom-element/revo-grid.d.ts +11 -0
- package/custom-element/revo-grid.js +3662 -0
- package/custom-element/revogr-clipboard.d.ts +11 -0
- package/custom-element/revogr-clipboard.js +72 -0
- package/custom-element/revogr-data.d.ts +11 -0
- package/custom-element/revogr-data.js +9 -0
- package/custom-element/revogr-data2.js +171 -0
- package/custom-element/revogr-edit.d.ts +11 -0
- package/custom-element/revogr-edit.js +9 -0
- package/custom-element/revogr-edit2.js +402 -0
- package/custom-element/revogr-filter-panel.d.ts +11 -0
- package/custom-element/revogr-filter-panel.js +308 -0
- package/custom-element/revogr-focus.d.ts +11 -0
- package/custom-element/revogr-focus.js +9 -0
- package/custom-element/revogr-focus2.js +64 -0
- package/custom-element/revogr-header.d.ts +11 -0
- package/custom-element/revogr-header.js +9 -0
- package/custom-element/revogr-header2.js +591 -0
- package/custom-element/revogr-order-editor.d.ts +11 -0
- package/custom-element/revogr-order-editor.js +9 -0
- package/custom-element/revogr-order-editor2.js +190 -0
- package/custom-element/revogr-overlay-selection.d.ts +11 -0
- package/custom-element/revogr-overlay-selection.js +9 -0
- package/custom-element/revogr-overlay-selection2.js +741 -0
- package/custom-element/revogr-row-headers.d.ts +11 -0
- package/custom-element/revogr-row-headers.js +9 -0
- package/custom-element/revogr-row-headers2.js +403 -0
- package/custom-element/revogr-scroll-virtual.d.ts +11 -0
- package/custom-element/revogr-scroll-virtual.js +9 -0
- package/custom-element/revogr-scroll-virtual2.js +135 -0
- package/custom-element/revogr-temp-range.d.ts +11 -0
- package/custom-element/revogr-temp-range.js +9 -0
- package/custom-element/revogr-temp-range2.js +17275 -0
- package/custom-element/revogr-viewport-scroll.d.ts +11 -0
- package/custom-element/revogr-viewport-scroll.js +9 -0
- package/custom-element/revogr-viewport-scroll2.js +367 -0
- package/custom-element/selection.utils.js +106 -0
- package/custom-element/toInteger.js +107 -0
- package/custom-element/toNumber.js +105 -0
- package/custom-element/utils.js +69 -0
- package/dist/cjs/revo-grid_11.cjs.entry.js +1 -1
- package/dist/collection/plugins/filter/filter.plugin.js +1 -1
- package/dist/collection/utilsExternal/generate-data.js +1 -0
- package/dist/esm/revo-grid_11.entry.js +1 -1
- package/dist/esm-es5/revo-grid_11.entry.js +1 -1
- package/dist/revo-grid/revo-grid_11.entry.js +1 -1
- package/dist/revo-grid/revo-grid_11.system.entry.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface RevogrClipboard extends Components.RevogrClipboard, HTMLElement {}
|
|
4
|
+
export const RevogrClipboard: {
|
|
5
|
+
prototype: RevogrClipboard;
|
|
6
|
+
new (): RevogrClipboard;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
5
|
+
|
|
6
|
+
const Clipboard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.copyRegion = createEvent(this, "copyRegion", 3);
|
|
11
|
+
this.pasteRegion = createEvent(this, "pasteRegion", 3);
|
|
12
|
+
}
|
|
13
|
+
onPaste(e) {
|
|
14
|
+
const clipboardData = this.getData(e);
|
|
15
|
+
const isHTML = clipboardData.types.indexOf('text/html') > -1;
|
|
16
|
+
const data = isHTML ? clipboardData.getData('text/html') : clipboardData.getData('text');
|
|
17
|
+
const parsedData = isHTML ? this.htmlParse(data) : this.textParse(data);
|
|
18
|
+
this.pasteRegion.emit(parsedData);
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
}
|
|
21
|
+
copyStarted(e) {
|
|
22
|
+
this.copyRegion.emit(this.getData(e));
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
}
|
|
25
|
+
async doCopy(e, data) {
|
|
26
|
+
e.setData('text/plain', data ? this.parserCopy(data) : '');
|
|
27
|
+
}
|
|
28
|
+
parserCopy(data) {
|
|
29
|
+
return data.map(rgRow => rgRow.join('\t')).join('\n');
|
|
30
|
+
}
|
|
31
|
+
textParse(data) {
|
|
32
|
+
const result = [];
|
|
33
|
+
const rows = data.split(/\r\n|\n|\r/);
|
|
34
|
+
for (let y in rows) {
|
|
35
|
+
result.push(rows[y].split('\t'));
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
htmlParse(data) {
|
|
40
|
+
const result = [];
|
|
41
|
+
const table = document.createRange().createContextualFragment(data).querySelector('table');
|
|
42
|
+
for (const rgRow of Array.from(table.rows)) {
|
|
43
|
+
result.push(Array.from(rgRow.cells).map(cell => cell.innerText));
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
getData(e) {
|
|
48
|
+
var _a;
|
|
49
|
+
return e.clipboardData || ((_a = window) === null || _a === void 0 ? void 0 : _a.clipboardData);
|
|
50
|
+
}
|
|
51
|
+
}, [0, "revogr-clipboard", {
|
|
52
|
+
"doCopy": [64]
|
|
53
|
+
}, [[4, "paste", "onPaste"], [4, "copy", "copyStarted"]]]);
|
|
54
|
+
function defineCustomElement$1() {
|
|
55
|
+
if (typeof customElements === "undefined") {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const components = ["revogr-clipboard"];
|
|
59
|
+
components.forEach(tagName => { switch (tagName) {
|
|
60
|
+
case "revogr-clipboard":
|
|
61
|
+
if (!customElements.get(tagName)) {
|
|
62
|
+
customElements.define(tagName, Clipboard);
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
} });
|
|
66
|
+
}
|
|
67
|
+
defineCustomElement$1();
|
|
68
|
+
|
|
69
|
+
const RevogrClipboard = Clipboard;
|
|
70
|
+
const defineCustomElement = defineCustomElement$1;
|
|
71
|
+
|
|
72
|
+
export { RevogrClipboard, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface RevogrData extends Components.RevogrData, HTMLElement {}
|
|
4
|
+
export const RevogrData: {
|
|
5
|
+
prototype: RevogrData;
|
|
6
|
+
new (): RevogrData;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
5
|
+
import { C as ColumnService, l as GROUP_EXPAND_BTN, h as GROUP_EXPAND_EVENT, m as PSEUDO_GROUP_ITEM, G as GROUP_EXPANDED, c as GROUP_DEPTH, i as isGrouping } from './columnService.js';
|
|
6
|
+
import { D as DRAGGABLE_CLASS, a as DRAG_ICON_CLASS, b as DATA_COL, c as DATA_ROW } from './consts.js';
|
|
7
|
+
import { g as getSourceItem } from './data.store.js';
|
|
8
|
+
|
|
9
|
+
const CellRenderer = ({ model, canDrag, onDragStart }) => {
|
|
10
|
+
const els = [];
|
|
11
|
+
if (model.column.rowDrag && isRowDragService(model.column.rowDrag, model)) {
|
|
12
|
+
if (canDrag) {
|
|
13
|
+
els.push(h("span", { class: DRAGGABLE_CLASS, onMouseDown: e => onDragStart(e) },
|
|
14
|
+
h("span", { class: DRAG_ICON_CLASS })));
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
els.push(h("span", { class: DRAGGABLE_CLASS }));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
els.push(`${ColumnService.getData(model.model[model.prop])}`);
|
|
21
|
+
return els;
|
|
22
|
+
};
|
|
23
|
+
function isRowDragService(rowDrag, model) {
|
|
24
|
+
if (typeof rowDrag === 'function') {
|
|
25
|
+
return rowDrag(model);
|
|
26
|
+
}
|
|
27
|
+
return !!rowDrag;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const PADDING_DEPTH = 10;
|
|
31
|
+
const RowRenderer = ({ rowClass, size, start, style, depth }, cells) => {
|
|
32
|
+
return (h("div", { class: `rgRow ${rowClass || ''}`, style: Object.assign(Object.assign({}, style), { height: `${size}px`, transform: `translateY(${start}px)`, paddingLeft: depth ? `${PADDING_DEPTH * depth}px` : undefined }) }, cells));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function expandEvent(e, model, virtualIndex) {
|
|
36
|
+
const event = new CustomEvent(GROUP_EXPAND_EVENT, {
|
|
37
|
+
detail: {
|
|
38
|
+
model,
|
|
39
|
+
virtualIndex,
|
|
40
|
+
},
|
|
41
|
+
cancelable: true,
|
|
42
|
+
bubbles: true,
|
|
43
|
+
});
|
|
44
|
+
e.target.dispatchEvent(event);
|
|
45
|
+
}
|
|
46
|
+
const GroupingRowRenderer = (props) => {
|
|
47
|
+
const { model, itemIndex, hasExpand } = props;
|
|
48
|
+
const name = model[PSEUDO_GROUP_ITEM];
|
|
49
|
+
const expanded = model[GROUP_EXPANDED];
|
|
50
|
+
const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
|
|
51
|
+
if (!hasExpand) {
|
|
52
|
+
return h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }));
|
|
53
|
+
}
|
|
54
|
+
return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }),
|
|
55
|
+
h("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) },
|
|
56
|
+
h("svg", { "aria-hidden": "true", style: { transform: `rotate(${!expanded ? -90 : 0}deg)` }, focusable: "false", viewBox: "0 0 448 512" },
|
|
57
|
+
h("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" }))),
|
|
58
|
+
name));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const revogrDataStyleCss = ".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 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 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.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}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}revogr-data{display:block;width:100%;position:relative}revogr-data .rgRow{position:absolute;width:100%;left:0}revogr-data .rgRow.groupingRow{font-weight:600}revogr-data .rgRow.groupingRow .group-expand{width:25px;height:100%;max-height:25px;margin-right:2px;background-color:transparent;border-color:transparent}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}revogr-data .revo-draggable>.revo-drag-icon{vertical-align:middle;display:inline-block;pointer-events:none;transition:background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}revogr-data .rgCell{top:0;position:absolute;box-sizing:border-box;height:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}revogr-data .rgCell.align-center{text-align:center}revogr-data .rgCell.align-left{text-align:left}revogr-data .rgCell.align-right{text-align:right}";
|
|
62
|
+
|
|
63
|
+
const RevogrData = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
64
|
+
constructor() {
|
|
65
|
+
super();
|
|
66
|
+
this.__registerHost();
|
|
67
|
+
this.dragStartCell = createEvent(this, "dragStartCell", 7);
|
|
68
|
+
}
|
|
69
|
+
onStoreChange() {
|
|
70
|
+
var _a;
|
|
71
|
+
(_a = this.columnService) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
72
|
+
this.columnService = new ColumnService(this.dataStore, this.colData);
|
|
73
|
+
}
|
|
74
|
+
connectedCallback() {
|
|
75
|
+
this.onStoreChange();
|
|
76
|
+
}
|
|
77
|
+
disconnectedCallback() {
|
|
78
|
+
var _a;
|
|
79
|
+
(_a = this.columnService) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
var _a;
|
|
83
|
+
const rows = this.viewportRow.get('items');
|
|
84
|
+
const cols = this.viewportCol.get('items');
|
|
85
|
+
if (!this.columnService.columns.length || !rows.length || !cols.length) {
|
|
86
|
+
return '';
|
|
87
|
+
}
|
|
88
|
+
const range = (_a = this.rowSelectionStore) === null || _a === void 0 ? void 0 : _a.get('range');
|
|
89
|
+
const rowsEls = [];
|
|
90
|
+
const depth = this.dataStore.get('groupingDepth');
|
|
91
|
+
for (let rgRow of rows) {
|
|
92
|
+
const dataRow = getSourceItem(this.dataStore, rgRow.itemIndex);
|
|
93
|
+
/** grouping */
|
|
94
|
+
if (isGrouping(dataRow)) {
|
|
95
|
+
rowsEls.push(h(GroupingRowRenderer, Object.assign({}, rgRow, { model: dataRow, hasExpand: this.columnService.hasGrouping })));
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
/** grouping end */
|
|
99
|
+
const cells = [];
|
|
100
|
+
let rowClass = this.rowClass ? this.columnService.getRowClass(rgRow.itemIndex, this.rowClass) : '';
|
|
101
|
+
if (range && rgRow.itemIndex >= range.y && rgRow.itemIndex <= range.y1) {
|
|
102
|
+
rowClass += ' focused-rgRow';
|
|
103
|
+
}
|
|
104
|
+
for (let rgCol of cols) {
|
|
105
|
+
cells.push(this.getCellRenderer(rgRow, rgCol, this.canDrag, /** grouping apply*/ this.columnService.hasGrouping ? depth : 0));
|
|
106
|
+
}
|
|
107
|
+
rowsEls.push(h(RowRenderer, { rowClass: rowClass, size: rgRow.size, start: rgRow.start }, cells));
|
|
108
|
+
}
|
|
109
|
+
return rowsEls;
|
|
110
|
+
}
|
|
111
|
+
getCellRenderer(rgRow, rgCol, draggable = false, depth = 0) {
|
|
112
|
+
const model = this.columnService.rowDataModel(rgRow.itemIndex, rgCol.itemIndex);
|
|
113
|
+
const defaultProps = {
|
|
114
|
+
[DATA_COL]: rgCol.itemIndex,
|
|
115
|
+
[DATA_ROW]: rgRow.itemIndex,
|
|
116
|
+
style: {
|
|
117
|
+
width: `${rgCol.size}px`,
|
|
118
|
+
transform: `translateX(${rgCol.start}px)`,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
if (depth && !rgCol.itemIndex) {
|
|
122
|
+
defaultProps.style.paddingLeft = `${PADDING_DEPTH * depth}px`;
|
|
123
|
+
}
|
|
124
|
+
const props = this.columnService.mergeProperties(rgRow.itemIndex, rgCol.itemIndex, defaultProps);
|
|
125
|
+
const custom = this.columnService.customRenderer(rgRow.itemIndex, rgCol.itemIndex, model);
|
|
126
|
+
// if custom render
|
|
127
|
+
if (typeof custom !== 'undefined') {
|
|
128
|
+
return h("div", Object.assign({}, props), custom);
|
|
129
|
+
}
|
|
130
|
+
// something is wrong with data
|
|
131
|
+
if (!model.column) {
|
|
132
|
+
console.error('Investigate column problem');
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
// if regular render
|
|
136
|
+
return (h("div", Object.assign({}, props), h(CellRenderer, { model: model, canDrag: draggable, onDragStart: e => this.dragStartCell.emit(e) })));
|
|
137
|
+
}
|
|
138
|
+
get element() { return this; }
|
|
139
|
+
static get watchers() { return {
|
|
140
|
+
"dataStore": ["onStoreChange"],
|
|
141
|
+
"colData": ["onStoreChange"]
|
|
142
|
+
}; }
|
|
143
|
+
static get style() { return revogrDataStyleCss; }
|
|
144
|
+
}, [0, "revogr-data", {
|
|
145
|
+
"readonly": [4],
|
|
146
|
+
"range": [4],
|
|
147
|
+
"canDrag": [4, "can-drag"],
|
|
148
|
+
"rowClass": [1, "row-class"],
|
|
149
|
+
"rowSelectionStore": [16],
|
|
150
|
+
"viewportRow": [16],
|
|
151
|
+
"viewportCol": [16],
|
|
152
|
+
"dimensionRow": [16],
|
|
153
|
+
"colData": [16],
|
|
154
|
+
"dataStore": [16]
|
|
155
|
+
}]);
|
|
156
|
+
function defineCustomElement() {
|
|
157
|
+
if (typeof customElements === "undefined") {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const components = ["revogr-data"];
|
|
161
|
+
components.forEach(tagName => { switch (tagName) {
|
|
162
|
+
case "revogr-data":
|
|
163
|
+
if (!customElements.get(tagName)) {
|
|
164
|
+
customElements.define(tagName, RevogrData);
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
} });
|
|
168
|
+
}
|
|
169
|
+
defineCustomElement();
|
|
170
|
+
|
|
171
|
+
export { RevogrData as R, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface RevogrEdit extends Components.RevogrEdit, HTMLElement {}
|
|
4
|
+
export const RevogrEdit: {
|
|
5
|
+
prototype: RevogrEdit;
|
|
6
|
+
new (): RevogrEdit;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|