@endge/ui-vue 0.23.3
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/LICENSE +201 -0
- package/dist/domain/core/endge-vue.d.ts +22 -0
- package/dist/domain/types/filter-renderer.type.d.ts +5 -0
- package/dist/domain/types/sfc-render.type.d.ts +143 -0
- package/dist/edit.utils-Dnnbd0xG-D9ndNtVP.js +51 -0
- package/dist/events-BvSmBueA-Doh7RyHn.js +23 -0
- package/dist/main-CQv-nkoD.js +19453 -0
- package/dist/main.d.ts +42 -0
- package/dist/model/render/sfc/SFCVueRenderInspection.d.ts +12 -0
- package/dist/model/render/sfc/SFCVueRuntimeBridge.d.ts +43 -0
- package/dist/model/render/sfc/native-vue-sfc-adapter.d.ts +4 -0
- package/dist/model/style/EndgeDOMStyleRuntime.d.ts +10 -0
- package/dist/model/style/endge-dom-style.d.ts +17 -0
- package/dist/model/style/index.d.ts +2 -0
- package/dist/reactive/use-current-environment.d.ts +8 -0
- package/dist/reactive/use-current-locale.d.ts +8 -0
- package/dist/reactive/use-current-project-filter.d.ts +8 -0
- package/dist/reactive/use-current-theme.d.ts +8 -0
- package/dist/reactive/use-ui.d.ts +3 -0
- package/dist/revo-grid.entry-BAwst49a.js +1615 -0
- package/dist/revogr-attribution_7.entry-BMG7pXkt.js +967 -0
- package/dist/revogr-clipboard_3.entry-BRLLR59Q.js +334 -0
- package/dist/revogr-data_4.entry-D1ndZEok.js +745 -0
- package/dist/revogr-filter-panel.entry-C-xzIppO.js +329 -0
- package/dist/store/domain.d.ts +91 -0
- package/dist/test/overlay/context-menu-manager.test.d.ts +1 -0
- package/dist/test/sfc/EndgeVueAdapter.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_Component.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_Evaluator.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_FormControls.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_Grid.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_IntrinsicEvents.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_TableAlignment.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_TableLayout.test.d.ts +1 -0
- package/dist/test/sfc/SFCRender_TableVisibility.test.d.ts +1 -0
- package/dist/test/sfc/SFCVueRenderInspection.test.d.ts +1 -0
- package/dist/test/style/endge-dom-runtime-placement.test.d.ts +1 -0
- package/dist/test/style/endge-dom-style-jsdom.test.d.ts +1 -0
- package/dist/test/style/endge-dom-style.test.d.ts +1 -0
- package/dist/test/style/sfc-style-markers.test.d.ts +1 -0
- package/dist/throttle-Cpk1LoGk-5dM_0aHc.js +183 -0
- package/dist/ui/filter/EndgeFilterControlRenderer.d.ts +33 -0
- package/dist/ui/filter/EndgeFilterField.vue.d.ts +13 -0
- package/dist/ui/filter/EndgeFilterRenderer.vue.d.ts +3 -0
- package/dist/ui/filter/index.d.ts +2 -0
- package/dist/ui/layout/EndgeShell.vue.d.ts +22 -0
- package/dist/ui/overlay/EndgeContextMenuRoot.vue.d.ts +4 -0
- package/dist/ui/overlay/context-menu-manager.d.ts +46 -0
- package/dist/ui/render/entities/EndgePage.vue.d.ts +1852 -0
- package/dist/ui/render/sfc/SFCRender_Badge.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Base.d.ts +8 -0
- package/dist/ui/render/sfc/SFCRender_BoundaryRegistry.d.ts +15 -0
- package/dist/ui/render/sfc/SFCRender_Box.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Checkbox.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Component.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Context.d.ts +8 -0
- package/dist/ui/render/sfc/SFCRender_DateTime.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Divider.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Dot.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Evaluator.d.ts +19 -0
- package/dist/ui/render/sfc/SFCRender_Flex.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Grid.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Icon.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Input.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Node.d.ts +6 -0
- package/dist/ui/render/sfc/SFCRender_Number.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Select.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Table.d.ts +9 -0
- package/dist/ui/render/sfc/SFCRender_TableAlignment.d.ts +8 -0
- package/dist/ui/render/sfc/SFCRender_TableStyle.d.ts +35 -0
- package/dist/ui/render/sfc/SFCRender_Text.d.ts +3 -0
- package/dist/ui/render/sfc/SFCRender_Textarea.d.ts +3 -0
- package/dist/ui/render/sfc/SFC_Renderer.vue.d.ts +3 -0
- package/dist/ui/render/sfc/SFC_RuntimeRenderer.vue.d.ts +3 -0
- package/dist/ui/table/NativeTablePagination.vue.d.ts +15 -0
- package/dist/viewport.helpers-CoCAvmZs-f555rwPU.js +77 -0
- package/dist/vue.css +1 -0
- package/dist/vue.js +75 -0
- package/package.json +77 -0
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
import { a7 as W, a8 as B, a9 as U, h as a, aa as V, ab as E, ac as z, ad as F, ae as N, af as X, ag as K, ah as Y, r as x, c as v, N as Z, q, ai as J, aj as T, H, f as R, o as L, ak as D, al as Q, am as m, an as ee, ao as I, a0 as te, ap as re, aq as P, ar as M } from "./main-CQv-nkoD.js";
|
|
2
|
+
import { L as ie, a as oe, g as k, t as le } from "./throttle-Cpk1LoGk-5dM_0aHc.js";
|
|
3
|
+
import { H as se, C as ne, F as ae } from "./viewport.helpers-CoCAvmZs-f555rwPU.js";
|
|
4
|
+
/*!
|
|
5
|
+
* Built by Revolist OU ❤️
|
|
6
|
+
*/
|
|
7
|
+
const de = ({ column: e }) => {
|
|
8
|
+
var t;
|
|
9
|
+
const r = { class: "sort-indicator" }, i = { class: (t = e == null ? void 0 : e.order) !== null && t !== void 0 ? t : "sort-off" }, o = { class: "sort-order-index" };
|
|
10
|
+
return a("span", Object.assign({}, r), a("i", Object.assign({}, i)), e != null && e.sortIndex ? a("sup", Object.assign({}, o), e.sortIndex) : null);
|
|
11
|
+
};
|
|
12
|
+
var ce = function(e, t) {
|
|
13
|
+
var r = {};
|
|
14
|
+
for (var i in e)
|
|
15
|
+
Object.prototype.hasOwnProperty.call(e, i) && t.indexOf(i) < 0 && (r[i] = e[i]);
|
|
16
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
17
|
+
for (var o = 0, i = Object.getOwnPropertySymbols(e); o < i.length; o++)
|
|
18
|
+
t.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, i[o]) && (r[i[o]] = e[i[o]]);
|
|
19
|
+
return r;
|
|
20
|
+
};
|
|
21
|
+
const j = 10, _ = (e, t) => {
|
|
22
|
+
var { rowClass: r, index: i, size: o, start: l, depth: s, groupingLevel: d } = e, h = ce(e, ["rowClass", "index", "size", "start", "depth", "groupingLevel"]);
|
|
23
|
+
const n = Object.assign(Object.assign(Object.assign({}, h), { [E]: i }), typeof d == "number" ? { "data-level": d } : {});
|
|
24
|
+
return a("div", Object.assign({}, n, { class: `rgRow ${r || ""}`, style: {
|
|
25
|
+
height: `${o}px`,
|
|
26
|
+
transform: `translateY(${l}px)`,
|
|
27
|
+
paddingLeft: s ? `${j * s}px` : void 0
|
|
28
|
+
} }), t);
|
|
29
|
+
};
|
|
30
|
+
function $(e, t, r) {
|
|
31
|
+
var i;
|
|
32
|
+
const o = new CustomEvent(Y, {
|
|
33
|
+
detail: {
|
|
34
|
+
model: t,
|
|
35
|
+
virtualIndex: r
|
|
36
|
+
},
|
|
37
|
+
cancelable: !0,
|
|
38
|
+
bubbles: !0
|
|
39
|
+
});
|
|
40
|
+
(i = e.target) === null || i === void 0 || i.dispatchEvent(o);
|
|
41
|
+
}
|
|
42
|
+
const he = (e) => {
|
|
43
|
+
const { model: t, itemIndex: r, hasExpand: i, groupingCustomRenderer: o } = e, l = t[W], s = t[B], d = parseInt(t[U], 10) || 0, h = {
|
|
44
|
+
rowClass: "groupingRow",
|
|
45
|
+
depth: d,
|
|
46
|
+
expanded: s
|
|
47
|
+
};
|
|
48
|
+
return o ? a(_, Object.assign({}, e, h), a("div", { onClick: (n) => $(n, t, r) }, o(a, Object.assign(Object.assign({}, e), {
|
|
49
|
+
colType: e.providers.colType,
|
|
50
|
+
name: l,
|
|
51
|
+
expanded: s,
|
|
52
|
+
depth: d
|
|
53
|
+
})))) : a(_, Object.assign({}, e, h), i && [
|
|
54
|
+
a("button", { class: { [V]: !0 }, onClick: (n) => $(n, t, r) }, ge(s)),
|
|
55
|
+
l
|
|
56
|
+
]);
|
|
57
|
+
}, ge = (e = !1) => a("svg", { "aria-hidden": "true", style: { transform: `rotate(${e ? 0 : -90}deg)` }, focusable: "false", viewBox: "0 0 448 512" }, a("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
|
+
function ve(e) {
|
|
59
|
+
var t;
|
|
60
|
+
const r = [], i = (t = e.schemaModel.column) === null || t === void 0 ? void 0 : t.cellTemplate;
|
|
61
|
+
if (i)
|
|
62
|
+
r.push(i(a, e.schemaModel, e.additionalData));
|
|
63
|
+
else {
|
|
64
|
+
if (!e.schemaModel.column)
|
|
65
|
+
return !(z === null || z === void 0) && z.isDev && console.error("Investigate column problem.", e.schemaModel), "";
|
|
66
|
+
e.schemaModel.column.rowDrag && F(e.schemaModel.column.rowDrag, e.schemaModel) && r.push(a("span", { class: X, onMouseDown: (o) => {
|
|
67
|
+
var l;
|
|
68
|
+
return (l = e.dragStartCell) === null || l === void 0 ? void 0 : l.emit({
|
|
69
|
+
originalEvent: o,
|
|
70
|
+
model: e.schemaModel
|
|
71
|
+
});
|
|
72
|
+
} }, a("span", { class: N }))), r.push(`${K(e.schemaModel.model, e.schemaModel.column)}`);
|
|
73
|
+
}
|
|
74
|
+
return r;
|
|
75
|
+
}
|
|
76
|
+
const ue = ({ renderProps: e, cellProps: t }) => {
|
|
77
|
+
const r = ve.bind(null, e);
|
|
78
|
+
return a("div", Object.assign({}, t, { redraw: r }), r());
|
|
79
|
+
};
|
|
80
|
+
/*!
|
|
81
|
+
* Built by Revolist OU ❤️
|
|
82
|
+
*/
|
|
83
|
+
class pe {
|
|
84
|
+
constructor() {
|
|
85
|
+
this.currentRange = null;
|
|
86
|
+
}
|
|
87
|
+
selectionChange(t, r) {
|
|
88
|
+
if (this.currentRange && r.forEach((i, o) => {
|
|
89
|
+
var l;
|
|
90
|
+
t && o >= t.y && o <= t.y1 || i && i.$elm$ instanceof HTMLElement && i.$elm$.classList.contains(m) && (i.$elm$.classList.remove(m), !((l = i.$attrs$) === null || l === void 0) && l.class.includes(m) && (i.$attrs$.class = i.$attrs$.class.replace(m, "")));
|
|
91
|
+
}), t)
|
|
92
|
+
for (let i = t.y; i <= t.y1; i++) {
|
|
93
|
+
const o = r.get(i);
|
|
94
|
+
if (o && o.$elm$ instanceof HTMLElement && !o.$elm$.classList.contains(m)) {
|
|
95
|
+
const l = o.$attrs$ = o.$attrs$ || {};
|
|
96
|
+
l.class = (l.class || "") + " " + m, o.$elm$.classList.add(m);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
this.currentRange = t;
|
|
100
|
+
}
|
|
101
|
+
isRowFocused(t) {
|
|
102
|
+
return this.currentRange && t >= this.currentRange.y && t <= this.currentRange.y1;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function fe(e, t) {
|
|
106
|
+
return new Promise((r) => {
|
|
107
|
+
const i = document.createElement("vnode-html");
|
|
108
|
+
e.appendChild(i), i.redraw = t, i.addEventListener("html", (o) => {
|
|
109
|
+
i.remove(), r(o.detail);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const me = () => `.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}`, we = class {
|
|
114
|
+
constructor(e) {
|
|
115
|
+
x(this, e), this.beforerowrender = v(this, "beforerowrender", 7), this.afterrender = v(this, "afterrender", 7), this.beforeCellRender = v(this, "beforecellrender", 7), this.beforeDataRender = v(this, "beforedatarender", 7), this.dragStartCell = v(this, "dragstartcell", 7), this.jobsBeforeRender = [], this.renderedRows = /* @__PURE__ */ new Map();
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Pointed cell update.
|
|
119
|
+
*/
|
|
120
|
+
async updateCell(e) {
|
|
121
|
+
var t, r, i;
|
|
122
|
+
const o = (r = (t = this.renderedRows.get(e.row)) === null || t === void 0 ? void 0 : t.$children$) === null || r === void 0 ? void 0 : r[e.col];
|
|
123
|
+
if (!((i = o == null ? void 0 : o.$attrs$) === null || i === void 0) && i.redraw) {
|
|
124
|
+
const l = await fe(this.element, o.$attrs$.redraw);
|
|
125
|
+
o.$elm$.innerHTML = l.html, o.$key$ = Math.random();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
onDataStoreChange() {
|
|
129
|
+
this.onStoreChange();
|
|
130
|
+
}
|
|
131
|
+
onColDataChange() {
|
|
132
|
+
this.onStoreChange();
|
|
133
|
+
}
|
|
134
|
+
onStoreChange() {
|
|
135
|
+
var e, t;
|
|
136
|
+
(e = this.columnService) === null || e === void 0 || e.destroy(), this.columnService = new Z(this.dataStore, this.colData), this.providers = {
|
|
137
|
+
type: this.type,
|
|
138
|
+
colType: this.colType,
|
|
139
|
+
readonly: this.readonly,
|
|
140
|
+
data: this.dataStore,
|
|
141
|
+
columns: this.colData,
|
|
142
|
+
viewport: this.viewportCol,
|
|
143
|
+
dimension: this.dimensionRow,
|
|
144
|
+
selection: this.rowSelectionStore
|
|
145
|
+
}, (t = this.rangeUnsubscribe) === null || t === void 0 || t.call(this), this.rangeUnsubscribe = this.rowSelectionStore.onChange("range", (r) => this.rowHighlightPlugin.selectionChange(r, this.renderedRows));
|
|
146
|
+
}
|
|
147
|
+
connectedCallback() {
|
|
148
|
+
this.rowHighlightPlugin = new pe(), this.onStoreChange();
|
|
149
|
+
}
|
|
150
|
+
disconnectedCallback() {
|
|
151
|
+
var e, t;
|
|
152
|
+
(e = this.columnService) === null || e === void 0 || e.destroy(), (t = this.rangeUnsubscribe) === null || t === void 0 || t.call(this);
|
|
153
|
+
}
|
|
154
|
+
async componentWillRender() {
|
|
155
|
+
return this.beforeDataRender.emit({
|
|
156
|
+
rowType: this.type,
|
|
157
|
+
colType: this.colType
|
|
158
|
+
}), Promise.all(this.jobsBeforeRender.map((e) => typeof e == "function" ? e() : e));
|
|
159
|
+
}
|
|
160
|
+
componentDidRender() {
|
|
161
|
+
this.afterrender.emit({ type: this.type });
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
if (this.renderedRows = /* @__PURE__ */ new Map(), !this.columnService.columns.length)
|
|
165
|
+
return;
|
|
166
|
+
const t = this.viewportRow.get("items");
|
|
167
|
+
if (!t.length)
|
|
168
|
+
return;
|
|
169
|
+
const r = this.viewportCol.get("items");
|
|
170
|
+
if (!r.length)
|
|
171
|
+
return;
|
|
172
|
+
const i = [], o = this.dataStore.get("groupingDepth"), l = this.dataStore.get("groupingCustomRenderer"), s = this.columnService.hasGrouping ? o : 0, d = this.viewportRow.get("renderOffset") || 0, h = this.viewportCol.get("renderOffset") || 0;
|
|
173
|
+
for (let n of t) {
|
|
174
|
+
const c = q(this.dataStore, n.itemIndex);
|
|
175
|
+
if (J(c)) {
|
|
176
|
+
const g = Object.assign(Object.assign({}, n), {
|
|
177
|
+
start: n.start - d,
|
|
178
|
+
index: n.itemIndex,
|
|
179
|
+
model: c,
|
|
180
|
+
groupingCustomRenderer: l,
|
|
181
|
+
// Only show expand button if grouping is enabled and not in row headers
|
|
182
|
+
hasExpand: this.columnService.hasGrouping && this.colType !== "rowHeaders",
|
|
183
|
+
columnItems: r,
|
|
184
|
+
providers: this.providers
|
|
185
|
+
});
|
|
186
|
+
i.push(a(he, Object.assign({}, g)));
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const p = [];
|
|
190
|
+
for (let g of r) {
|
|
191
|
+
const w = Object.assign(Object.assign({}, this.columnService.rowDataModel(n.itemIndex, g.itemIndex)), { providers: this.providers }), b = this.triggerBeforeCellRender(w, n, g);
|
|
192
|
+
if (b.defaultPrevented)
|
|
193
|
+
continue;
|
|
194
|
+
const { detail: { column: C, row: S, model: O } } = b, y = {
|
|
195
|
+
[T]: C.itemIndex,
|
|
196
|
+
[E]: S.itemIndex,
|
|
197
|
+
style: {
|
|
198
|
+
width: `${C.size}px`,
|
|
199
|
+
transform: `translateX(${C.start - h}px)`,
|
|
200
|
+
height: S.size ? `${S.size}px` : void 0
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
s && !C.itemIndex && y.style && (y.style.paddingLeft = `${j * s}px`);
|
|
204
|
+
const G = this.columnService.mergeProperties(S.itemIndex, C.itemIndex, y, O), A = a(ue, { renderProps: {
|
|
205
|
+
schemaModel: O,
|
|
206
|
+
additionalData: this.additionalData,
|
|
207
|
+
dragStartCell: this.dragStartCell
|
|
208
|
+
}, cellProps: G });
|
|
209
|
+
p.push(A);
|
|
210
|
+
}
|
|
211
|
+
let f = this.rowClass ? this.columnService.getRowClass(n.itemIndex, this.rowClass) : "";
|
|
212
|
+
this.rowHighlightPlugin.isRowFocused(n.itemIndex) && (f += ` ${m}`);
|
|
213
|
+
const u = a(_, { index: n.itemIndex, rowClass: f, size: n.size, start: n.start - d, groupingLevel: s || void 0 }, p);
|
|
214
|
+
this.beforerowrender.emit({
|
|
215
|
+
node: u,
|
|
216
|
+
item: n,
|
|
217
|
+
model: c,
|
|
218
|
+
colType: this.columnService.type,
|
|
219
|
+
rowType: this.type
|
|
220
|
+
}), i.push(u), this.renderedRows.set(n.itemIndex, u);
|
|
221
|
+
}
|
|
222
|
+
return a(H, null, a("slot", null), i);
|
|
223
|
+
}
|
|
224
|
+
triggerBeforeCellRender(e, t, r) {
|
|
225
|
+
const i = {
|
|
226
|
+
column: r,
|
|
227
|
+
row: t,
|
|
228
|
+
model: e,
|
|
229
|
+
rowType: e.type,
|
|
230
|
+
colType: e.colType
|
|
231
|
+
};
|
|
232
|
+
return this.beforeCellRender.emit(i);
|
|
233
|
+
}
|
|
234
|
+
get element() {
|
|
235
|
+
return R(this);
|
|
236
|
+
}
|
|
237
|
+
static get watchers() {
|
|
238
|
+
return {
|
|
239
|
+
dataStore: [{
|
|
240
|
+
onDataStoreChange: 0
|
|
241
|
+
}],
|
|
242
|
+
colData: [{
|
|
243
|
+
onColDataChange: 0
|
|
244
|
+
}]
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
we.style = me();
|
|
249
|
+
const Ce = (e) => {
|
|
250
|
+
var t, r, i, o, l, s, d, h, n, c;
|
|
251
|
+
const p = !!(!((t = e.data) === null || t === void 0) && t.sortable || !((r = e.data) === null || r === void 0) && r.order || !((i = e.data) === null || i === void 0) && i.sortIndex), f = {
|
|
252
|
+
[M]: !0,
|
|
253
|
+
[ee]: !!(!((o = e.data) === null || o === void 0) && o.sortable)
|
|
254
|
+
};
|
|
255
|
+
!((l = e.data) === null || l === void 0) && l.order && (f[e.data.order] = !0);
|
|
256
|
+
const u = {
|
|
257
|
+
key: String((d = (s = e.data) === null || s === void 0 ? void 0 : s.prop) !== null && d !== void 0 ? d : e.column.itemIndex),
|
|
258
|
+
[T]: e.column.itemIndex,
|
|
259
|
+
canResize: e.canResize,
|
|
260
|
+
minWidth: ((h = e.data) === null || h === void 0 ? void 0 : h.minSize) || I,
|
|
261
|
+
maxWidth: (n = e.data) === null || n === void 0 ? void 0 : n.maxSize,
|
|
262
|
+
active: e.active || ["r"],
|
|
263
|
+
class: f,
|
|
264
|
+
style: {
|
|
265
|
+
width: `${e.column.size}px`,
|
|
266
|
+
transform: `translateX(${e.column.start - (e.renderOffset || 0)}px)`
|
|
267
|
+
},
|
|
268
|
+
onResize: e.onResize,
|
|
269
|
+
onDblClick(g) {
|
|
270
|
+
var w;
|
|
271
|
+
(w = e.onDblClick) === null || w === void 0 || w.call(e, {
|
|
272
|
+
column: e.data,
|
|
273
|
+
index: e.column.itemIndex,
|
|
274
|
+
originalEvent: g,
|
|
275
|
+
providers: e.data.providers
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
onClick(g) {
|
|
279
|
+
g.defaultPrevented || !e.onClick || e.onClick({
|
|
280
|
+
column: e.data,
|
|
281
|
+
index: e.column.itemIndex,
|
|
282
|
+
originalEvent: g,
|
|
283
|
+
providers: e.data.providers
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
return e.range && e.column.itemIndex >= e.range.x && e.column.itemIndex <= e.range.x1 && typeof u.class == "object" && (u.class[te] = !0), a(P, { data: e.data, props: u, additionalData: e.additionalData }, p ? a(de, { column: e.data }) : null, e.canFilter && ((c = e.data) === null || c === void 0 ? void 0 : c.filter) !== !1 ? a(re, { column: e.data }) : "");
|
|
288
|
+
}, be = (e) => {
|
|
289
|
+
const t = {
|
|
290
|
+
key: `${e.group.name}-${e.group.indexes.join("-")}`,
|
|
291
|
+
canResize: e.canResize,
|
|
292
|
+
minWidth: e.group.indexes.length * I,
|
|
293
|
+
maxWidth: 0,
|
|
294
|
+
active: e.active || ["r"],
|
|
295
|
+
class: {
|
|
296
|
+
[M]: !0
|
|
297
|
+
},
|
|
298
|
+
style: {
|
|
299
|
+
transform: `translateX(${e.start - (e.renderOffset || 0)}px)`,
|
|
300
|
+
width: `${e.end - e.start}px`
|
|
301
|
+
},
|
|
302
|
+
onResize: e.onResize
|
|
303
|
+
};
|
|
304
|
+
return a(P, { data: Object.assign(Object.assign({}, e.group), { prop: "", providers: e.providers, index: e.start }), props: t, additionalData: e.additionalData });
|
|
305
|
+
}, Se = () => '@charset "UTF-8";revogr-header{position:relative;z-index:5;display:block}revogr-header .header-rgRow{display:block;position:relative}revogr-header .header-rgRow.group{z-index:0}revogr-header .group-rgRow{position:relative;overflow:hidden}revogr-header .rgHeaderCell{position:absolute;box-sizing:border-box;height:100%;z-index:1;display:flex}revogr-header .rgHeaderCell.align-center{text-align:center}revogr-header .rgHeaderCell.align-left{text-align:left}revogr-header .rgHeaderCell.align-right{text-align:right}revogr-header .rgHeaderCell.sortable{cursor:pointer}revogr-header .rgHeaderCell .sort-indicator{display:inline-flex;align-items:flex-start;gap:1px}revogr-header .rgHeaderCell .sort-indicator i.asc:after,revogr-header .rgHeaderCell .sort-indicator i.desc:after{font-size:13px}revogr-header .rgHeaderCell .sort-indicator i.asc:after{content:"↑"}revogr-header .rgHeaderCell .sort-indicator i.desc:after{content:"↓"}revogr-header .rgHeaderCell .sort-indicator .sort-order-index{font-size:10px;line-height:1;top:0}revogr-header .rgHeaderCell.active{z-index:10}revogr-header .rgHeaderCell.active .resizable{background-color:deepskyblue}revogr-header .rgHeaderCell .header-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}revogr-header .rgHeaderCell .resizable{display:block;position:absolute;z-index:90;touch-action:none;user-select:none}revogr-header .rgHeaderCell .resizable:hover{background-color:deepskyblue}revogr-header .rgHeaderCell>.resizable-r{cursor:ew-resize;width:6px;right:0;top:0;height:100%}revogr-header .rgHeaderCell>.resizable-rb{cursor:se-resize;width:6px;height:6px;right:0;bottom:0}revogr-header .rgHeaderCell>.resizable-b{cursor:s-resize;height:6px;bottom:0;width:100%;left:0}revogr-header .rgHeaderCell>.resizable-lb{cursor:sw-resize;width:6px;height:6px;left:0;bottom:0}revogr-header .rgHeaderCell>.resizable-l{cursor:w-resize;width:6px;left:0;height:100%;top:0}revogr-header .rgHeaderCell>.resizable-lt{cursor:nw-resize;width:6px;height:6px;left:0;top:0}revogr-header .rgHeaderCell>.resizable-t{cursor:n-resize;height:6px;top:0;width:100%;left:0}revogr-header .rgHeaderCell>.resizable-rt{cursor:ne-resize;width:6px;height:6px;right:0;top:0}revogr-header .rv-filter{visibility:hidden}', xe = class {
|
|
306
|
+
constructor(e) {
|
|
307
|
+
x(this, e), this.initialHeaderClick = v(this, "beforeheaderclick", 7), this.headerresize = v(this, "headerresize", 7), this.beforeResize = v(this, "beforeheaderresize", 7), this.headerdblClick = v(this, "headerdblclick", 7), this.beforeHeaderRender = v(this, "beforeheaderrender", 7), this.beforeGroupHeaderRender = v(this, "beforegroupheaderrender", 7), this.afterHeaderRender = v(this, "afterheaderrender", 7), this.groupingDepth = 0, this.additionalData = {};
|
|
308
|
+
}
|
|
309
|
+
onResize({ width: e }, t) {
|
|
310
|
+
const r = this.colData[t];
|
|
311
|
+
this.beforeResize.emit([
|
|
312
|
+
Object.assign(Object.assign({}, r), { size: e || void 0 })
|
|
313
|
+
]).defaultPrevented || this.headerresize.emit({ [t]: e || 0 });
|
|
314
|
+
}
|
|
315
|
+
onResizeGroup(e, t, r) {
|
|
316
|
+
const i = {}, o = e / (r - t + 1);
|
|
317
|
+
for (let l = t; l <= r; l++) {
|
|
318
|
+
const s = L(this.dimensionCol.state, l);
|
|
319
|
+
i[l] = s.end - s.start + o;
|
|
320
|
+
}
|
|
321
|
+
this.headerresize.emit(i);
|
|
322
|
+
}
|
|
323
|
+
componentDidRender() {
|
|
324
|
+
this.afterHeaderRender.emit(this.providers);
|
|
325
|
+
}
|
|
326
|
+
render() {
|
|
327
|
+
var e;
|
|
328
|
+
const t = this.viewportCol.get("items"), r = (e = this.selectionStore) === null || e === void 0 ? void 0 : e.get("range"), { cells: i } = this.renderHeaderColumns(t, r), o = this.renderGroupingColumns();
|
|
329
|
+
return [
|
|
330
|
+
a("div", { key: "3cc466db6bc4df0cd61c47a22c3a0473318e5dd8", class: "group-rgRow" }, o),
|
|
331
|
+
a("div", { key: "9742a3fa4d4b75073aef5544806f42386ebffdea", class: `${D} ${Q}` }, i)
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
renderHeaderColumns(e, t) {
|
|
335
|
+
const r = [], i = this.viewportCol.get("renderOffset") || 0;
|
|
336
|
+
for (let s of e) {
|
|
337
|
+
const d = this.colData[s.itemIndex], h = {
|
|
338
|
+
range: t,
|
|
339
|
+
column: s,
|
|
340
|
+
data: Object.assign(Object.assign({}, d), { index: s.itemIndex, providers: this.providers }),
|
|
341
|
+
canFilter: !!this.columnFilter,
|
|
342
|
+
canResize: this.canResize,
|
|
343
|
+
renderOffset: i,
|
|
344
|
+
active: this.resizeHandler,
|
|
345
|
+
additionalData: this.additionalData,
|
|
346
|
+
onResize: (c) => this.onResize(c, s.itemIndex),
|
|
347
|
+
onDblClick: (c) => this.headerdblClick.emit(c),
|
|
348
|
+
onClick: (c) => this.initialHeaderClick.emit(c)
|
|
349
|
+
}, n = this.beforeHeaderRender.emit(h);
|
|
350
|
+
n.defaultPrevented || r.push(n.detail);
|
|
351
|
+
}
|
|
352
|
+
const o = this.getDuplicateHeaderProps(r);
|
|
353
|
+
return { cells: r.map((s) => a(Ce, Object.assign({ key: this.getHeaderCellKey(s.data, this.type, o) }, s))) };
|
|
354
|
+
}
|
|
355
|
+
renderGroupingColumns() {
|
|
356
|
+
const e = this.getVisibleGroupRange();
|
|
357
|
+
return Array.from({ length: this.groupingDepth }, (t, r) => this.renderGroupRow(r, e)).flat();
|
|
358
|
+
}
|
|
359
|
+
renderGroupRow(e, t) {
|
|
360
|
+
return [
|
|
361
|
+
...(this.groups[e] || []).map((i) => this.renderGroupColumn(i, e, t)).filter((i) => !!i),
|
|
362
|
+
a("div", {
|
|
363
|
+
key: `group-row-${e}`,
|
|
364
|
+
class: {
|
|
365
|
+
[D]: !0,
|
|
366
|
+
group: !0
|
|
367
|
+
}
|
|
368
|
+
})
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
renderGroupColumn(e, t, r) {
|
|
372
|
+
const i = this.getGroupIndexRange(e), o = this.getGroupBounds(i), l = {
|
|
373
|
+
level: t,
|
|
374
|
+
providers: this.providers,
|
|
375
|
+
start: o.start,
|
|
376
|
+
end: o.end,
|
|
377
|
+
group: e,
|
|
378
|
+
renderOffset: this.viewportCol.get("renderOffset") || 0,
|
|
379
|
+
active: this.resizeHandler,
|
|
380
|
+
canResize: this.canResize,
|
|
381
|
+
additionalData: this.additionalData,
|
|
382
|
+
onResize: (n) => {
|
|
383
|
+
var c;
|
|
384
|
+
return i ? this.onResizeGroup((c = n.changedX) !== null && c !== void 0 ? c : 0, i.startIndex, i.endIndex) : void 0;
|
|
385
|
+
}
|
|
386
|
+
}, s = this.beforeGroupHeaderRender.emit(l);
|
|
387
|
+
if (s.defaultPrevented)
|
|
388
|
+
return;
|
|
389
|
+
const d = this.getGroupIndexRange(s.detail.group);
|
|
390
|
+
if (!d || !r || !Re(d.startIndex, d.endIndex, r))
|
|
391
|
+
return;
|
|
392
|
+
s.detail.onResize === l.onResize && (s.detail.onResize = (n) => {
|
|
393
|
+
var c;
|
|
394
|
+
return this.onResizeGroup((c = n.changedX) !== null && c !== void 0 ? c : 0, d.startIndex, d.endIndex);
|
|
395
|
+
});
|
|
396
|
+
const h = this.getGroupBounds(d);
|
|
397
|
+
return s.detail.start === l.start && (s.detail.start = h.start), s.detail.end === l.end && (s.detail.end = h.end), a(be, Object.assign({ key: this.getGroupHeaderCellKey(s.detail.group, t) }, s.detail));
|
|
398
|
+
}
|
|
399
|
+
getGroupIndexRange(e) {
|
|
400
|
+
var t;
|
|
401
|
+
const r = (t = e.indexes[0]) !== null && t !== void 0 ? t : -1;
|
|
402
|
+
if (r < 0)
|
|
403
|
+
return;
|
|
404
|
+
const i = e.indexes[e.indexes.length - 1];
|
|
405
|
+
return {
|
|
406
|
+
startIndex: r,
|
|
407
|
+
endIndex: i
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
getGroupBounds(e) {
|
|
411
|
+
return e ? {
|
|
412
|
+
start: L(this.dimensionCol.state, e.startIndex).start,
|
|
413
|
+
end: L(this.dimensionCol.state, e.endIndex).end
|
|
414
|
+
} : { start: 0, end: 0 };
|
|
415
|
+
}
|
|
416
|
+
getVisibleGroupRange() {
|
|
417
|
+
const e = this.viewportCol.get("items");
|
|
418
|
+
if (e.length)
|
|
419
|
+
return e.reduce((t, r) => ({
|
|
420
|
+
start: Math.min(t.start, r.itemIndex),
|
|
421
|
+
end: Math.max(t.end, r.itemIndex)
|
|
422
|
+
}), {
|
|
423
|
+
start: e[0].itemIndex,
|
|
424
|
+
end: e[0].itemIndex
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
getHeaderCellKey(e, t, r) {
|
|
428
|
+
if ((e == null ? void 0 : e.prop) === void 0)
|
|
429
|
+
return `${t}-${String(e == null ? void 0 : e.index)}`;
|
|
430
|
+
const i = String(e.prop);
|
|
431
|
+
return r.has(i) ? `${t}-${i}-${String(e.index)}` : `${t}-${i}`;
|
|
432
|
+
}
|
|
433
|
+
getDuplicateHeaderProps(e) {
|
|
434
|
+
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
435
|
+
return e.forEach(({ data: i }) => {
|
|
436
|
+
if ((i == null ? void 0 : i.prop) !== void 0) {
|
|
437
|
+
const o = String(i.prop);
|
|
438
|
+
t.has(o) ? r.add(o) : t.add(o);
|
|
439
|
+
}
|
|
440
|
+
}), r;
|
|
441
|
+
}
|
|
442
|
+
getGroupHeaderCellKey(e, t) {
|
|
443
|
+
return `group-${t}-${e.name}-${e.indexes.join("-")}`;
|
|
444
|
+
}
|
|
445
|
+
get providers() {
|
|
446
|
+
return {
|
|
447
|
+
type: this.type,
|
|
448
|
+
readonly: this.readonly,
|
|
449
|
+
data: this.colData,
|
|
450
|
+
viewport: this.viewportCol,
|
|
451
|
+
dimension: this.dimensionCol,
|
|
452
|
+
selection: this.selectionStore
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
get element() {
|
|
456
|
+
return R(this);
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
function Re(e, t, r) {
|
|
460
|
+
return e <= r.end && t >= r.start;
|
|
461
|
+
}
|
|
462
|
+
xe.style = Se();
|
|
463
|
+
class ye {
|
|
464
|
+
constructor(t, r, i) {
|
|
465
|
+
this.resize = r, this.resizeObserver = null, this.previousSize = {
|
|
466
|
+
width: 0,
|
|
467
|
+
height: 0
|
|
468
|
+
}, this.apply = le((l) => {
|
|
469
|
+
var s;
|
|
470
|
+
const d = {
|
|
471
|
+
width: l.width,
|
|
472
|
+
height: l.height
|
|
473
|
+
};
|
|
474
|
+
(s = this.resize) === null || s === void 0 || s.call(this, d, this.previousSize), this.previousSize = d;
|
|
475
|
+
}, 40, {
|
|
476
|
+
leading: !1,
|
|
477
|
+
trailing: !0
|
|
478
|
+
});
|
|
479
|
+
const o = [];
|
|
480
|
+
i.forEach((l) => {
|
|
481
|
+
l && o.push(l);
|
|
482
|
+
}), this.init(t, o);
|
|
483
|
+
}
|
|
484
|
+
init(t, r = []) {
|
|
485
|
+
const i = this.resizeObserver = new ResizeObserver((o) => {
|
|
486
|
+
o.length && (o[0].target === t ? this.apply(o[0].contentRect) : this.apply(t.getBoundingClientRect()));
|
|
487
|
+
});
|
|
488
|
+
i.observe(t), r.forEach((o) => {
|
|
489
|
+
i.observe(o);
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
destroy() {
|
|
493
|
+
var t;
|
|
494
|
+
this.apply.cancel(), (t = this.resizeObserver) === null || t === void 0 || t.disconnect(), this.resizeObserver = null;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
const ze = () => ".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%}", Le = class {
|
|
498
|
+
constructor(e) {
|
|
499
|
+
x(this, e), this.scrollViewport = v(this, "scrollviewport", 7), this.resizeViewport = v(this, "resizeviewport", 7), this.scrollchange = v(this, "scrollchange", 7), this.silentScroll = v(this, "scrollviewportsilent", 7), this.contentWidth = 0, this.contentHeight = 0, this.noHorizontalScrollTransfer = !1;
|
|
500
|
+
}
|
|
501
|
+
async setScroll(e) {
|
|
502
|
+
var t;
|
|
503
|
+
this.localScrollTimer.latestScrollUpdate(e.dimension), (t = this.localScrollService) === null || t === void 0 || t.setScroll(e);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* update on delta in case we don't know existing position or external change
|
|
507
|
+
* @param e
|
|
508
|
+
*/
|
|
509
|
+
async changeScroll(e, t = !1) {
|
|
510
|
+
var r, i, o, l;
|
|
511
|
+
if (t) {
|
|
512
|
+
if (e.coordinate && this.verticalScroll)
|
|
513
|
+
switch (e.dimension) {
|
|
514
|
+
// for mobile devices to skip negative scroll loop. only on vertical scroll
|
|
515
|
+
case "rgRow":
|
|
516
|
+
this.verticalScroll.style.transform = `translateY(${-1 * e.coordinate}px)`;
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
if (e.delta) {
|
|
522
|
+
let s = 0;
|
|
523
|
+
switch (e.dimension) {
|
|
524
|
+
case "rgCol":
|
|
525
|
+
s = this.horizontalScroll.scrollLeft;
|
|
526
|
+
break;
|
|
527
|
+
case "rgRow":
|
|
528
|
+
s = (i = (r = this.verticalScroll) === null || r === void 0 ? void 0 : r.scrollTop) !== null && i !== void 0 ? i : 0;
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
return (l = (o = this.localScrollService) === null || o === void 0 ? void 0 : o.setScrollByDelta(e, s)) !== null && l !== void 0 ? l : e;
|
|
532
|
+
}
|
|
533
|
+
return e;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Dispatch this event to trigger vertical mouse wheel from plugins
|
|
537
|
+
*/
|
|
538
|
+
mousewheelVertical({ detail: e }) {
|
|
539
|
+
this.verticalMouseWheel(e);
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Dispatch this event to trigger horizontal mouse wheel from plugins
|
|
543
|
+
*/
|
|
544
|
+
mousewheelHorizontal({ detail: e }) {
|
|
545
|
+
this.horizontalMouseWheel(e);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Allows to use outside listener
|
|
549
|
+
*/
|
|
550
|
+
scrollApply({ detail: { type: e, coordinate: t } }) {
|
|
551
|
+
this.applyOnScroll(e, t, !0);
|
|
552
|
+
}
|
|
553
|
+
connectedCallback() {
|
|
554
|
+
this.verticalMouseWheel = this.onVerticalMouseWheel.bind(this, "rgRow", "deltaY"), this.horizontalMouseWheel = this.onHorizontalMouseWheel.bind(this, "rgCol", "deltaX"), this.localScrollTimer = new ie("ontouchstart" in document.documentElement ? 0 : 10), this.localScrollService = new oe({
|
|
555
|
+
// to improve safari smoothnes on scroll
|
|
556
|
+
// skipAnimationFrame: isSafariDesktop(),
|
|
557
|
+
runScroll: (e) => this.scrollViewport.emit(e),
|
|
558
|
+
applyScroll: (e) => {
|
|
559
|
+
switch (this.localScrollTimer.setCoordinate(e), e.dimension) {
|
|
560
|
+
case "rgCol":
|
|
561
|
+
this.horizontalScroll.scrollLeft = e.coordinate;
|
|
562
|
+
break;
|
|
563
|
+
case "rgRow":
|
|
564
|
+
this.verticalScroll && (this.verticalScroll.scrollTop = e.coordinate, this.verticalScroll.style.transform && (this.verticalScroll.style.transform = ""));
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
componentDidLoad() {
|
|
571
|
+
this.resizeService = new ye(this.horizontalScroll, (e) => {
|
|
572
|
+
var t, r, i, o, l, s, d, h;
|
|
573
|
+
const n = {};
|
|
574
|
+
let c = e.height || 0;
|
|
575
|
+
c && (c -= ((r = (t = this.header) === null || t === void 0 ? void 0 : t.clientHeight) !== null && r !== void 0 ? r : 0) + ((o = (i = this.footer) === null || i === void 0 ? void 0 : i.clientHeight) !== null && o !== void 0 ? o : 0)), n.rgRow = {
|
|
576
|
+
size: c,
|
|
577
|
+
contentSize: this.contentHeight,
|
|
578
|
+
scroll: (s = (l = this.verticalScroll) === null || l === void 0 ? void 0 : l.scrollTop) !== null && s !== void 0 ? s : 0,
|
|
579
|
+
noScroll: !1
|
|
580
|
+
};
|
|
581
|
+
const p = e.width || 0;
|
|
582
|
+
n.rgCol = {
|
|
583
|
+
size: p,
|
|
584
|
+
contentSize: this.contentWidth,
|
|
585
|
+
scroll: this.horizontalScroll.scrollLeft,
|
|
586
|
+
noScroll: this.colType !== "rgCol"
|
|
587
|
+
}, this.setScrollParams({
|
|
588
|
+
rgRow: c,
|
|
589
|
+
rgCol: p
|
|
590
|
+
});
|
|
591
|
+
const f = ["rgCol", "rgRow"];
|
|
592
|
+
for (const u of f) {
|
|
593
|
+
const g = n[u];
|
|
594
|
+
g && (this.resizeViewport.emit({
|
|
595
|
+
dimension: u,
|
|
596
|
+
size: g.size,
|
|
597
|
+
rowHeader: this.rowHeader
|
|
598
|
+
}), !g.noScroll && ((d = this.localScrollService) === null || d === void 0 || d.scroll((h = g.scroll) !== null && h !== void 0 ? h : 0, u, !0), this.setScrollVisibility(u, g.size, g.contentSize)));
|
|
599
|
+
}
|
|
600
|
+
}, [this.footer, this.header]);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Check if scroll present or not per type
|
|
604
|
+
* Trigger this method on inner content size change or on outer element size change
|
|
605
|
+
* If inner content bigger then outer size then scroll is present and mousewheel binding required
|
|
606
|
+
* @param type - dimension type 'rgRow/y' or 'rgCol/x'
|
|
607
|
+
* @param size - outer content size
|
|
608
|
+
* @param innerContentSize - inner content size
|
|
609
|
+
*/
|
|
610
|
+
setScrollVisibility(e, t, r) {
|
|
611
|
+
const i = t < r;
|
|
612
|
+
let o;
|
|
613
|
+
switch (e) {
|
|
614
|
+
case "rgCol":
|
|
615
|
+
o = this.horizontalScroll;
|
|
616
|
+
break;
|
|
617
|
+
case "rgRow":
|
|
618
|
+
o = this.verticalScroll;
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
i ? o == null || o.classList.add(`scroll-${e}`) : o == null || o.classList.remove(`scroll-${e}`), this.scrollchange.emit({ type: e, hasScroll: i });
|
|
622
|
+
}
|
|
623
|
+
disconnectedCallback() {
|
|
624
|
+
var e;
|
|
625
|
+
(e = this.resizeService) === null || e === void 0 || e.destroy();
|
|
626
|
+
}
|
|
627
|
+
async componentDidRender() {
|
|
628
|
+
var e, t, r, i;
|
|
629
|
+
this.setScrollParams({
|
|
630
|
+
rgRow: (t = (e = this.verticalScroll) === null || e === void 0 ? void 0 : e.clientHeight) !== null && t !== void 0 ? t : 0,
|
|
631
|
+
rgCol: this.horizontalScroll.clientWidth
|
|
632
|
+
}), this.setScrollVisibility("rgRow", (i = (r = this.verticalScroll) === null || r === void 0 ? void 0 : r.clientHeight) !== null && i !== void 0 ? i : 0, this.contentHeight), this.setScrollVisibility("rgCol", this.horizontalScroll.clientWidth, this.contentWidth);
|
|
633
|
+
}
|
|
634
|
+
setScrollParams(e) {
|
|
635
|
+
this.localScrollService.setParams({
|
|
636
|
+
contentSize: this.contentHeight,
|
|
637
|
+
clientSize: e.rgRow,
|
|
638
|
+
virtualSize: 0
|
|
639
|
+
}, "rgRow"), this.localScrollService.setParams({
|
|
640
|
+
contentSize: this.contentWidth,
|
|
641
|
+
clientSize: e.rgCol,
|
|
642
|
+
virtualSize: 0
|
|
643
|
+
}, "rgCol");
|
|
644
|
+
}
|
|
645
|
+
render() {
|
|
646
|
+
var e, t;
|
|
647
|
+
const r = (t = (e = this.verticalScroll) === null || e === void 0 ? void 0 : e.clientHeight) !== null && t !== void 0 ? t : 0, i = this.contentHeight < r ? Math.max(this.contentHeight, 0) : k(this.contentHeight, r), o = k(this.contentWidth, 0);
|
|
648
|
+
return a(H, { key: "3dd9d29cf26743d7aa4995f51180d56008526e54", onWheel: this.horizontalMouseWheel, onScroll: (l) => this.applyScroll("rgCol", l) }, a("div", { key: "af75428e845044c33eba2fecd1ec04a9177b9b5c", class: "inner-content-table", style: { width: `${o}px` } }, a("div", { key: "a0149f597588371e1fafe69efc3bd4411379a017", class: "header-wrapper", ref: (l) => this.header = l }, a("slot", { key: "e5d2570bf93897cd97ef702141c83bb8c0e13ee2", name: se })), a("div", { key: "d1388ff0d721dd8ce925b934bb2128fddc1ac17b", class: "vertical-inner", ref: (l) => this.verticalScroll = l, onWheel: this.verticalMouseWheel, onScroll: (l) => this.applyScroll("rgRow", l) }, a("div", { key: "a306ff56f62279402e2a881a081e3224341d5bdf", class: "content-wrapper", style: { height: `${i}px` } }, a("slot", { key: "898bda8e9429da06c9ff2bd41626ac27f3cde3cc", name: ne }))), a("div", { key: "5e9eba1edd5fca07a964971054a7900e4dd84099", class: "footer-wrapper", ref: (l) => this.footer = l }, a("slot", { key: "f233ad1c23b3f692c45e1db235cfef4704a80726", name: ae }))));
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|
|
652
|
+
* We need to trigger scroll event in case there is no mousewheel event
|
|
653
|
+
*/
|
|
654
|
+
async applyScroll(e, t) {
|
|
655
|
+
if (!(t.target instanceof HTMLElement))
|
|
656
|
+
return;
|
|
657
|
+
let r = 0;
|
|
658
|
+
switch (e) {
|
|
659
|
+
case "rgCol":
|
|
660
|
+
r = t.target.scrollLeft;
|
|
661
|
+
break;
|
|
662
|
+
case "rgRow":
|
|
663
|
+
r = t.target.scrollTop;
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
if (r < 0) {
|
|
667
|
+
this.silentScroll.emit({ dimension: e, coordinate: r });
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
this.applyOnScroll(e, r);
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Applies change on scroll event only if mousewheel event happened some time ago
|
|
674
|
+
*/
|
|
675
|
+
applyOnScroll(e, t, r = !1) {
|
|
676
|
+
const i = () => {
|
|
677
|
+
var o;
|
|
678
|
+
(o = this.localScrollService) === null || o === void 0 || o.scroll(t, e, void 0, void 0, r), this.localScrollTimer.setCoordinateFromScroll({ dimension: e, coordinate: t });
|
|
679
|
+
};
|
|
680
|
+
this.localScrollTimer.isReady(e, t) ? i() : this.localScrollTimer.throttleLastScrollUpdate(e, t, () => i());
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* On vertical mousewheel event
|
|
684
|
+
* @param type
|
|
685
|
+
* @param delta
|
|
686
|
+
* @param e
|
|
687
|
+
*/
|
|
688
|
+
onVerticalMouseWheel(e, t, r) {
|
|
689
|
+
var i, o, l, s, d, h, n, c;
|
|
690
|
+
const p = (o = (i = this.verticalScroll) === null || i === void 0 ? void 0 : i.scrollTop) !== null && o !== void 0 ? o : 0, f = (s = (l = this.verticalScroll) === null || l === void 0 ? void 0 : l.clientHeight) !== null && s !== void 0 ? s : 0, u = (h = (d = this.verticalScroll) === null || d === void 0 ? void 0 : d.scrollHeight) !== null && h !== void 0 ? h : 0, g = p + f >= u && r.deltaY > 0, w = p === 0 && r.deltaY < 0;
|
|
691
|
+
!g && !w && ((n = r.preventDefault) === null || n === void 0 || n.call(r));
|
|
692
|
+
const b = p + r[t];
|
|
693
|
+
(c = this.localScrollService) === null || c === void 0 || c.scroll(b, e, void 0, r[t]), this.localScrollTimer.latestScrollUpdate(e);
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* On horizontal mousewheel event
|
|
697
|
+
* @param type
|
|
698
|
+
* @param delta
|
|
699
|
+
* @param e
|
|
700
|
+
*/
|
|
701
|
+
onHorizontalMouseWheel(e, t, r) {
|
|
702
|
+
var i, o, l, s;
|
|
703
|
+
if (!r.deltaX)
|
|
704
|
+
return;
|
|
705
|
+
const { scrollLeft: d, scrollWidth: h, clientWidth: n } = this.horizontalScroll, c = d + n >= h && r.deltaX > 0, p = d === 0 && r.deltaX < 0;
|
|
706
|
+
if (this.noHorizontalScrollTransfer) {
|
|
707
|
+
if (!c && !p) {
|
|
708
|
+
const u = d + r[t];
|
|
709
|
+
(i = r.preventDefault) === null || i === void 0 || i.call(r), this.horizontalScroll.scrollLeft = u, (o = this.localScrollService) === null || o === void 0 || o.scroll(this.horizontalScroll.scrollLeft, e, void 0, r[t]), this.localScrollTimer.latestScrollUpdate(e);
|
|
710
|
+
}
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
!c && !p && ((l = r.preventDefault) === null || l === void 0 || l.call(r));
|
|
714
|
+
const f = d + r[t];
|
|
715
|
+
(s = this.localScrollService) === null || s === void 0 || s.scroll(f, e, void 0, r[t]), this.localScrollTimer.latestScrollUpdate(e);
|
|
716
|
+
}
|
|
717
|
+
get horizontalScroll() {
|
|
718
|
+
return R(this);
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
Le.style = ze();
|
|
722
|
+
const De = class {
|
|
723
|
+
constructor(e) {
|
|
724
|
+
x(this, e), this.html = v(this, "html", 7), this.redraw = null, this.vnodes = [];
|
|
725
|
+
}
|
|
726
|
+
componentDidRender() {
|
|
727
|
+
this.html.emit({
|
|
728
|
+
html: this.el.innerHTML,
|
|
729
|
+
vnodes: this.vnodes
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
render() {
|
|
733
|
+
var e, t;
|
|
734
|
+
return this.vnodes = (t = (e = this.redraw) === null || e === void 0 ? void 0 : e.call(this)) !== null && t !== void 0 ? t : null, a(H, { key: "11b76ca8a86ebf279add88bbd86ef9eb5149605a", style: { visibility: "hidden", position: "absolute" } }, this.vnodes);
|
|
735
|
+
}
|
|
736
|
+
get el() {
|
|
737
|
+
return R(this);
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
export {
|
|
741
|
+
we as revogr_data,
|
|
742
|
+
xe as revogr_header,
|
|
743
|
+
Le as revogr_viewport_scroll,
|
|
744
|
+
De as vnode_html
|
|
745
|
+
};
|