@svgrid/grid-wc 3.0.2 → 3.0.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/README.md +4 -1
- package/dist/GridMenus-DMkf7UMn.js +1086 -0
- package/dist/{SvChartMenu-CBMKm7Xb.js → SvChartMenu-DkSyLWYH.js} +2 -2
- package/dist/{shadow/SvDateTimePicker-CnLlqNDQ.js → SvDateTimePicker-Czin1Ead.js} +1 -1
- package/dist/{shadow/SvGridCellEditor-B005dmV1.js → SvGridCellEditor-DhXEIlyE.js} +1 -1
- package/dist/{SvGridChart-4TcL9Rj2.js → SvGridChart-BMdCbrqb.js} +5 -5
- package/dist/{SvGridChartBuilder-C4OL4XYx.js → SvGridChartBuilder-Chp_MD1B.js} +121 -120
- package/dist/{shadow/SvGridChartPanel-CfHA8Ioq.js → SvGridChartPanel-BIV2O2Lp.js} +6 -6
- package/dist/{SvGridChartView-Ci-9_EJ0.js → SvGridChartView-DyhkumD-.js} +2 -2
- package/dist/{SvGridDropdown-BlA6iw9m.js → SvGridDropdown-BwPpGwLz.js} +140 -140
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +37 -3
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +16 -1
- package/dist/{shadow/cell-formatting-Eypm-id0.js → cell-formatting-CBfgahv1.js} +1 -1
- package/dist/chart/{SvChartMenu-C-sbGNk8.js → SvChartMenu-DslxOgPN.js} +5 -1
- package/dist/chart/{chart-summary-B86RFA3M.js → chart-summary-6Xu2JoNC.js} +1 -1
- package/dist/chart/{chart-trend-DP6DSsBa.js → chart-trend-7fxtAqEl.js} +1 -1
- package/dist/chart/sv-chart-element.js +3 -3
- package/dist/{chart-DoqdUoGg.js → chart-D_LKA1fr.js} +1 -1
- package/dist/{chart-export-pdf-BirUdchl.js → chart-export-pdf-9OCvhzr0.js} +1 -1
- package/dist/{shadow/chart-summary-BP9i-v8M.js → chart-summary-v3Lhe8YD.js} +1 -1
- package/dist/{shadow/dismissable-DvhBKm3q.js → dismissable-CQ6XFXsk.js} +5 -1
- package/dist/{export-format-uGayRKWM.js → export-format-CAi1mp-1.js} +1 -1
- package/dist/{shadow/focus-trap-DvlOlOGM.js → focus-trap-Dbb2tJxb.js} +1 -1
- package/dist/react/index.d.ts +44 -0
- package/dist/react/index.js +5 -1
- package/dist/{row-resize-Cf8qPLbi.js → row-resize-limG_N1z.js} +41 -32
- package/dist/shadow/GridMenus-DMkf7UMn.js +1086 -0
- package/dist/shadow/{SvChartMenu-CBMKm7Xb.js → SvChartMenu-DkSyLWYH.js} +2 -2
- package/dist/{SvDateTimePicker-CnLlqNDQ.js → shadow/SvDateTimePicker-Czin1Ead.js} +1 -1
- package/dist/{SvGridCellEditor-B005dmV1.js → shadow/SvGridCellEditor-DhXEIlyE.js} +1 -1
- package/dist/shadow/{SvGridChart-4TcL9Rj2.js → SvGridChart-BMdCbrqb.js} +5 -5
- package/dist/shadow/{SvGridChartBuilder-C4OL4XYx.js → SvGridChartBuilder-Chp_MD1B.js} +121 -120
- package/dist/{SvGridChartPanel-CfHA8Ioq.js → shadow/SvGridChartPanel-BIV2O2Lp.js} +6 -6
- package/dist/shadow/{SvGridChartView-Ci-9_EJ0.js → SvGridChartView-DyhkumD-.js} +2 -2
- package/dist/shadow/{SvGridDropdown-BlA6iw9m.js → SvGridDropdown-BwPpGwLz.js} +140 -140
- package/dist/{cell-formatting-Eypm-id0.js → shadow/cell-formatting-CBfgahv1.js} +1 -1
- package/dist/shadow/{chart-DoqdUoGg.js → chart-D_LKA1fr.js} +1 -1
- package/dist/shadow/{chart-export-pdf-BirUdchl.js → chart-export-pdf-9OCvhzr0.js} +1 -1
- package/dist/{chart-summary-BP9i-v8M.js → shadow/chart-summary-v3Lhe8YD.js} +1 -1
- package/dist/{dismissable-DvhBKm3q.js → shadow/dismissable-CQ6XFXsk.js} +5 -1
- package/dist/shadow/{export-format-DhdZREP1.js → export-format-mnW_rVBZ.js} +1 -1
- package/dist/{focus-trap-DvlOlOGM.js → shadow/focus-trap-Dbb2tJxb.js} +1 -1
- package/dist/shadow/{row-resize-Cf8qPLbi.js → row-resize-limG_N1z.js} +41 -32
- package/dist/shadow/sv-grid-shadow-element.d.ts +26 -0
- package/dist/shadow/sv-grid-shadow-element.js +3479 -2627
- package/dist/shadow/validate-BqDthkNr.js +88 -0
- package/dist/sv-grid-element.d.ts +26 -0
- package/dist/sv-grid-element.js +3464 -2612
- package/dist/validate-BqDthkNr.js +88 -0
- package/dist/vue/index.d.ts +17 -2
- package/dist/vue/index.js +1 -25
- package/package.json +3 -3
- package/dist/GridMenus-B1mC1aPp.js +0 -1077
- package/dist/shadow/GridMenus-B1mC1aPp.js +0 -1077
- package/dist/shadow/validate-CgmAtX1A.js +0 -75
- package/dist/validate-CgmAtX1A.js +0 -75
|
@@ -2,25 +2,29 @@
|
|
|
2
2
|
var e = "sv-grid-row-resize-handle";
|
|
3
3
|
function t(t, n) {
|
|
4
4
|
let r = n, i = null, a = null;
|
|
5
|
-
function o(e) {
|
|
5
|
+
function o(e, t) {
|
|
6
|
+
let n = r.min ?? 20, i = r.max ?? 320;
|
|
7
|
+
e.setAttribute("aria-valuemin", String(n)), e.setAttribute("aria-valuemax", String(i)), e.setAttribute("aria-valuenow", String(Math.round(Math.max(n, Math.min(i, t || n)))));
|
|
8
|
+
}
|
|
9
|
+
function s(e) {
|
|
6
10
|
let t = e.querySelector("[data-svgrid-row]")?.dataset.svgridRow;
|
|
7
11
|
return t == null ? NaN : Number(t);
|
|
8
12
|
}
|
|
9
|
-
function
|
|
13
|
+
function c(e) {
|
|
10
14
|
if (!i) return;
|
|
11
15
|
let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
|
|
12
|
-
i.trEl.style.height = `${Math.round(a)}px`, r.onResizeMove?.(i.rowIndex, Math.round(a));
|
|
16
|
+
i.trEl.style.height = `${Math.round(a)}px`, o(i.strip, a), r.onResizeMove?.(i.rowIndex, Math.round(a));
|
|
13
17
|
}
|
|
14
|
-
function
|
|
18
|
+
function l(e) {
|
|
15
19
|
if (!i) return;
|
|
16
20
|
let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
|
|
17
21
|
r.onResize(i.rowIndex, Math.round(a)), i.strip.classList.remove("is-resizing");
|
|
18
22
|
try {
|
|
19
23
|
i.trEl.releasePointerCapture(e.pointerId);
|
|
20
24
|
} catch {}
|
|
21
|
-
i = null, window.removeEventListener("pointermove",
|
|
25
|
+
i = null, window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l), document.body.style.cursor = "";
|
|
22
26
|
}
|
|
23
|
-
function
|
|
27
|
+
function u(t) {
|
|
24
28
|
if (r.disabled) return;
|
|
25
29
|
let n = t.target;
|
|
26
30
|
if (!n?.classList.contains(e)) return;
|
|
@@ -28,21 +32,21 @@ function t(t, n) {
|
|
|
28
32
|
if (t.key === "ArrowUp") a = -i;
|
|
29
33
|
else if (t.key === "ArrowDown") a = i;
|
|
30
34
|
else return;
|
|
31
|
-
let
|
|
32
|
-
if (!
|
|
33
|
-
let
|
|
34
|
-
if (!Number.isFinite(
|
|
35
|
+
let c = n.closest("tr.sv-grid-row");
|
|
36
|
+
if (!c) return;
|
|
37
|
+
let l = s(c);
|
|
38
|
+
if (!Number.isFinite(l)) return;
|
|
35
39
|
t.preventDefault(), t.stopPropagation();
|
|
36
|
-
let
|
|
37
|
-
|
|
40
|
+
let u = r.min ?? 20, d = r.max ?? 320, f = Math.round(Math.max(u, Math.min(d, c.getBoundingClientRect().height + a)));
|
|
41
|
+
c.style.height = `${f}px`, o(n, f), r.onResizeMove?.(l, f), r.onResize(l, f);
|
|
38
42
|
}
|
|
39
|
-
function
|
|
43
|
+
function d(t) {
|
|
40
44
|
if (r.disabled) return;
|
|
41
45
|
let n = t.target;
|
|
42
46
|
if (!n?.classList.contains(e)) return;
|
|
43
|
-
let
|
|
44
|
-
if (!
|
|
45
|
-
let u = o
|
|
47
|
+
let o = n.closest("tr.sv-grid-row");
|
|
48
|
+
if (!o) return;
|
|
49
|
+
let u = s(o);
|
|
46
50
|
if (!Number.isFinite(u)) return;
|
|
47
51
|
t.preventDefault(), t.stopPropagation();
|
|
48
52
|
let d = t.timeStamp, f = a !== null && a.rowIndex === u && d - a.at < 400;
|
|
@@ -56,45 +60,50 @@ function t(t, n) {
|
|
|
56
60
|
n.classList.add("is-resizing"), i = {
|
|
57
61
|
rowIndex: u,
|
|
58
62
|
startY: t.clientY,
|
|
59
|
-
startHeight:
|
|
60
|
-
trEl:
|
|
63
|
+
startHeight: o.getBoundingClientRect().height,
|
|
64
|
+
trEl: o,
|
|
61
65
|
strip: n
|
|
62
66
|
};
|
|
63
67
|
try {
|
|
64
|
-
|
|
68
|
+
o.setPointerCapture(t.pointerId);
|
|
65
69
|
} catch {}
|
|
66
|
-
document.body.style.cursor = "row-resize", window.addEventListener("pointermove",
|
|
70
|
+
document.body.style.cursor = "row-resize", window.addEventListener("pointermove", c), window.addEventListener("pointerup", l);
|
|
67
71
|
}
|
|
68
|
-
function
|
|
72
|
+
function f() {
|
|
69
73
|
if (r.disabled) {
|
|
70
|
-
|
|
74
|
+
p();
|
|
71
75
|
return;
|
|
72
76
|
}
|
|
73
77
|
let n = t.querySelectorAll("tr.sv-grid-row");
|
|
74
78
|
for (let t of n) {
|
|
75
79
|
if (t.classList.contains("sv-grid-header-row") || t.classList.contains("sv-grid-row-spacer")) continue;
|
|
76
80
|
let n = t.querySelector(".sv-grid-cell.sv-row-gutter, .sv-grid-cell.sv-grid-row-number-cell") ?? (r.anchor === "row" ? t.querySelector(".sv-grid-cell") : null);
|
|
77
|
-
if (!n
|
|
81
|
+
if (!n) continue;
|
|
82
|
+
let i = n.querySelector(`:scope > .${e}`);
|
|
83
|
+
if (i) {
|
|
84
|
+
o(i, t.getBoundingClientRect().height);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
78
87
|
getComputedStyle(n).position === "static" && (n.style.position = "relative"), n.style.overflow = "visible";
|
|
79
|
-
let
|
|
80
|
-
|
|
88
|
+
let a = document.createElement("div");
|
|
89
|
+
a.className = e, a.setAttribute("role", "separator"), a.setAttribute("aria-orientation", "horizontal"), a.setAttribute("aria-label", "Resize row"), a.tabIndex = 0, o(a, t.getBoundingClientRect().height), a.style.cssText = "position:absolute;left:0;right:0;bottom:0;height:5px;cursor:row-resize;user-select:none;z-index:60;pointer-events:auto;", n.appendChild(a);
|
|
81
90
|
}
|
|
82
91
|
}
|
|
83
|
-
function
|
|
92
|
+
function p() {
|
|
84
93
|
t.querySelectorAll(`.${e}`).forEach((e) => e.remove());
|
|
85
94
|
}
|
|
86
|
-
t.addEventListener("pointerdown",
|
|
87
|
-
let
|
|
88
|
-
return
|
|
95
|
+
t.addEventListener("pointerdown", d, { capture: !0 }), t.addEventListener("keydown", u, { capture: !0 });
|
|
96
|
+
let m = new MutationObserver(() => f());
|
|
97
|
+
return m.observe(t, {
|
|
89
98
|
childList: !0,
|
|
90
99
|
subtree: !0
|
|
91
|
-
}),
|
|
100
|
+
}), f(), {
|
|
92
101
|
update(e) {
|
|
93
102
|
let t = r.disabled;
|
|
94
|
-
r = e, t !== r.disabled &&
|
|
103
|
+
r = e, t !== r.disabled && f();
|
|
95
104
|
},
|
|
96
105
|
destroy() {
|
|
97
|
-
t.removeEventListener("pointerdown",
|
|
106
|
+
t.removeEventListener("pointerdown", d, { capture: !0 }), t.removeEventListener("keydown", u, { capture: !0 }), window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l), m.disconnect(), p();
|
|
98
107
|
}
|
|
99
108
|
};
|
|
100
109
|
}
|