@svgrid/grid-wc 2.6.1 → 2.7.0

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.
Files changed (50) hide show
  1. package/dist/{GridMenus-Boz00ms0.js → GridMenus-DE0zNY_3.js} +265 -243
  2. package/dist/{SvDateTimePicker-Ch1Vug8H.js → SvDateTimePicker-BpeEupA2.js} +81 -81
  3. package/dist/SvGrid.helpers-BZPDBcza.js +125 -0
  4. package/dist/SvGridCellEditor-_rqEaig7.js +531 -0
  5. package/dist/{SvGridChart-BztTavvw.js → SvGridChart-yK5Zv85y.js} +158 -158
  6. package/dist/{SvGridChartPanel-Ca5HWIZ3.js → SvGridChartPanel-B38_VjXM.js} +52 -52
  7. package/dist/{SvGridChartView-AcWj_tcs.js → SvGridChartView-ScXTF6t-.js} +4 -4
  8. package/dist/{SvGridDropdown-BXqvR1cs.js → SvGridDropdown-DnAESFDu.js} +29 -29
  9. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +358 -0
  10. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -0
  11. package/dist/angular/package.json +25 -0
  12. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +161 -0
  13. package/dist/{client-DoXxrq8q.js → client-DjwUji8D.js} +1 -1
  14. package/dist/column-resize-DvCRUrN3.js +101 -0
  15. package/dist/{dismissable-xj_k_fnZ.js → dismissable-Nx79OIVg.js} +36 -36
  16. package/dist/editor-registry-DxGKqcvx.js +24 -0
  17. package/dist/react/index.d.ts +313 -0
  18. package/dist/react/index.js +72 -0
  19. package/dist/row-drag-touch-Ddaa-QeB.js +91 -0
  20. package/dist/row-resize-D-8s3cqT.js +94 -0
  21. package/dist/shadow/GridMenus-DE0zNY_3.js +1022 -0
  22. package/dist/shadow/SvDateTimePicker-BpeEupA2.js +1885 -0
  23. package/dist/shadow/SvGrid.helpers-BZPDBcza.js +125 -0
  24. package/dist/shadow/SvGridCellEditor-_rqEaig7.js +531 -0
  25. package/dist/shadow/SvGridChart-yK5Zv85y.js +1199 -0
  26. package/dist/shadow/SvGridChartPanel-B38_VjXM.js +584 -0
  27. package/dist/shadow/SvGridChartView-ScXTF6t-.js +50 -0
  28. package/dist/shadow/SvGridDropdown-DnAESFDu.js +256 -0
  29. package/dist/shadow/cell-formatting-C0OsDmi_.js +86 -0
  30. package/dist/shadow/chart-uvs3sFJA.js +1220 -0
  31. package/dist/shadow/client-DjwUji8D.js +2960 -0
  32. package/dist/shadow/column-resize-DvCRUrN3.js +101 -0
  33. package/dist/shadow/dismissable-Nx79OIVg.js +186 -0
  34. package/dist/shadow/editor-contract-peBDxir_.js +22 -0
  35. package/dist/shadow/editor-registry-DxGKqcvx.js +24 -0
  36. package/dist/shadow/export-format-C8kZGZfz.js +161 -0
  37. package/dist/shadow/popover-WsGlvtQv.js +69 -0
  38. package/dist/shadow/row-drag-touch-Ddaa-QeB.js +91 -0
  39. package/dist/shadow/row-resize-D-8s3cqT.js +94 -0
  40. package/dist/shadow/sv-grid-shadow-element.d.ts +246 -0
  41. package/dist/shadow/sv-grid-shadow-element.js +10067 -0
  42. package/dist/{svelte-virtualizer.svelte-ZL3wxPzD.js → shadow/svelte-virtualizer.svelte-DZ9UcyfT.js} +79 -166
  43. package/dist/shadow/validate-CgmAtX1A.js +75 -0
  44. package/dist/sv-grid-element.d.ts +246 -0
  45. package/dist/sv-grid-element.js +3927 -3202
  46. package/dist/svelte-virtualizer.svelte-DZ9UcyfT.js +527 -0
  47. package/dist/validate-CgmAtX1A.js +75 -0
  48. package/dist/vue/index.d.ts +147 -0
  49. package/dist/vue/index.js +72 -0
  50. package/package.json +85 -6
@@ -0,0 +1,72 @@
1
+ import { createElement as e, forwardRef as t, useEffect as n, useImperativeHandle as r, useRef as i } from "react";
2
+ import "@svgrid/grid-wc";
3
+ //#region src/react/index.tsx
4
+ var a = /* @__PURE__ */ "data.columns.board.scheduler.chart.pivot.pivotMode.contextMenu.selectionBar.features.sortable.filterable.editable.treeData.groupable.groupBy.expanded.groupFooters.grandTotalRow.groupDisplayMode.autoGroupColumnHeader.autoGroupColumnWidth.pageable.loading.loadingOverlay.loadingSkeletonRows.error.emptyMessage.localization.showGlobalFilter.showColumnFilters.filterMode.showGroupingControls.showRowSelection.showPagination.pageSize.pageSizeOptions.paginationPosition.externalPagination.rowCount.pageIndex.virtualization.rowHeight.autoRowHeight.rowResize.headerHeight.overscan.containerHeight.columnVirtualization.columnOverscan.columnWidth.initialColumnPinning.fitColumns.columnResize.responsive.showFilterMenu.showFilterRow.enableCellSelection.moveCells.enableRowHover.copyHeadersToClipboard.processCellForClipboard.enableInlineEditing.fullRowEditing.enableRowSummaries.summary.statusBar.toolPanel.charting.columnMenuTabs.toolPanelDefaultOpen.toolPanelDefaultTab.selectionMode.showRowNumbers.zebraRows.rowNumberWidth.externalSort.initialSorting.initialAdvancedFilter.externalFilter.getRowId.rowClass.notes.editableComments.conditionalFormats.conditionalStatScope.isDetailRow.serverGroup.serverFilterValues.pinnedTopRows.pinnedBottomRows.enableColumnReorder.columnOrder.inferColumnTypes.rowDragManaged.rowDragGroup.alignedGridGroup.filterLocale".split("."), o = [
5
+ ["onPivotModeChange", "pivotmodechange"],
6
+ ["onExpandedChange", "expandedchange"],
7
+ ["onPaginationChange", "paginationchange"],
8
+ ["onApiReady", "apiready"],
9
+ ["onRowSelectionChange", "rowselectionchange"],
10
+ ["onCellSelectionChange", "cellselectionchange"],
11
+ ["onSortingChange", "sortingchange"],
12
+ ["onAdvancedFilterChange", "advancedfilterchange"],
13
+ ["onFiltersChange", "filterschange"],
14
+ ["onNoteChange", "notechange"],
15
+ ["onCellValueChange", "cellvaluechange"],
16
+ ["onActiveCellChange", "activecellchange"],
17
+ ["onCellClick", "cellclick"],
18
+ ["onRowClick", "rowclick"],
19
+ ["onCellDoubleClick", "celldoubleclick"],
20
+ ["onRowDoubleClick", "rowdoubleclick"],
21
+ ["onScrollBottomReached", "scrollbottomreached"],
22
+ ["onColumnOrderChange", "columnorderchange"],
23
+ ["onRowDragEnd", "rowdragend"],
24
+ ["onSelectionchange", "selectionchange"]
25
+ ], s = t(function(t, s) {
26
+ let c = i(null), { shadow: l, className: u, style: d, ...f } = t;
27
+ n(() => {
28
+ l && import("@svgrid/grid-wc/shadow");
29
+ }, [l]);
30
+ let p = i({});
31
+ n(() => {
32
+ let e = c.current;
33
+ if (e) for (let t of a) {
34
+ let n = f[t];
35
+ n === void 0 || Object.is(p.current[t], n) || (p.current[t] = n, e[t] = n);
36
+ }
37
+ });
38
+ let m = i(f);
39
+ return m.current = f, n(() => {
40
+ let e = c.current;
41
+ if (!e) return;
42
+ let t = [];
43
+ for (let [n, r] of o) {
44
+ let i = (e) => {
45
+ let t = m.current[n];
46
+ t?.(e.detail);
47
+ };
48
+ e.addEventListener(r, i), t.push([r, i]);
49
+ }
50
+ let n = m.current.onApiReady, r = e.api;
51
+ return n && r != null && n(r), () => {
52
+ for (let [n, r] of t) e.removeEventListener(n, r);
53
+ };
54
+ }, []), r(s, () => ({
55
+ get element() {
56
+ return c.current;
57
+ },
58
+ get api() {
59
+ return c.current?.api ?? null;
60
+ }
61
+ }), []), e(l ? "sv-grid-shadow" : "sv-grid", {
62
+ ref: c,
63
+ class: u,
64
+ style: {
65
+ display: "block",
66
+ height: "100%",
67
+ ...d
68
+ }
69
+ });
70
+ });
71
+ //#endregion
72
+ export { s as SvGrid, s as default };
@@ -0,0 +1,91 @@
1
+ function e(e) {
2
+ let { ctx: t } = e, n = null;
3
+ function r(e, t) {
4
+ let n = document.elementFromPoint(e, t)?.closest?.("tr.sv-grid-row");
5
+ if (!n) return null;
6
+ let r = n.querySelector("[data-svgrid-row]")?.dataset.svgridRow;
7
+ if (r == null) return null;
8
+ let i = Number(r);
9
+ if (!Number.isFinite(i)) return null;
10
+ let a = n.getBoundingClientRect();
11
+ return {
12
+ index: i,
13
+ side: t < a.top + a.height / 2 ? "before" : "after"
14
+ };
15
+ }
16
+ function i() {
17
+ n?.scrollFrame != null && (cancelAnimationFrame(n.scrollFrame), n.scrollFrame = null);
18
+ }
19
+ function a(e) {
20
+ let a = n?.scroller;
21
+ if (!n || !a) return;
22
+ let o = a.getBoundingClientRect(), s = 0;
23
+ if (e < o.top + 48 ? s = -12 : e > o.bottom - 48 && (s = 12), i(), s === 0) return;
24
+ let c = () => {
25
+ if (!n?.started) return;
26
+ a.scrollTop += s;
27
+ let i = r(n.startX, e);
28
+ i && (t.rowDropIndex = i.index, t.rowDropSide = i.side), n.scrollFrame = requestAnimationFrame(c);
29
+ };
30
+ n.scrollFrame = requestAnimationFrame(c);
31
+ }
32
+ function o(e) {
33
+ n?.started && e.preventDefault();
34
+ }
35
+ function s() {
36
+ window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u), window.removeEventListener("pointercancel", d), window.removeEventListener("touchmove", o);
37
+ }
38
+ function c(r) {
39
+ if (!n) return;
40
+ let a = n;
41
+ a.timer && clearTimeout(a.timer), i(), n = null, s(), a.root?.classList.remove("sv-grid-row-drag-active"), a.started && (r && t.rowDropIndex != null ? e.commitDropOnRow(t.rowDropIndex, t.rowDropSide ?? "before") : (e.clearIndicators(), e.closeBus()));
42
+ }
43
+ function l(i) {
44
+ if (!n || i.pointerId !== n.pointerId) return;
45
+ if (!n.started) {
46
+ Math.abs(i.clientY - n.startY) + Math.abs(i.clientX - n.startX) > 10 && c(!1);
47
+ return;
48
+ }
49
+ i.preventDefault();
50
+ let o = r(i.clientX, i.clientY);
51
+ o && (e.cancelPendingLeave(), t.rowDropIndex = o.index, t.rowDropSide = o.side), n.startX = i.clientX, a(i.clientY);
52
+ }
53
+ function u(e) {
54
+ !n || e.pointerId !== n.pointerId || c(!0);
55
+ }
56
+ function d(e) {
57
+ !n || e.pointerId !== n.pointerId || c(!1);
58
+ }
59
+ return {
60
+ start(r, i) {
61
+ if (!e.managed() || n) return;
62
+ let a = e.originalAt(i);
63
+ if (a == null) return;
64
+ let s = r.currentTarget;
65
+ n = {
66
+ pointerId: r.pointerId,
67
+ rowIndex: i,
68
+ startX: r.clientX,
69
+ startY: r.clientY,
70
+ started: !1,
71
+ timer: null,
72
+ scrollFrame: null,
73
+ scroller: s?.closest?.(".sv-grid-container") ?? null,
74
+ root: s?.closest?.(".sv-grid-root") ?? null
75
+ }, window.addEventListener("pointermove", l, { passive: !1 }), window.addEventListener("pointerup", u), window.addEventListener("pointercancel", d), window.addEventListener("touchmove", o, { passive: !1 }), n.timer = setTimeout(() => {
76
+ if (n) {
77
+ n.started = !0, n.timer = null, n.root?.classList.add("sv-grid-row-drag-active");
78
+ try {
79
+ s?.setPointerCapture?.(r.pointerId);
80
+ } catch {}
81
+ e.openBus(a), t.rowDragActive = !0, t.rowDropIndex = i, t.rowDropSide = "before";
82
+ }
83
+ }, 350);
84
+ },
85
+ destroy() {
86
+ c(!1);
87
+ }
88
+ };
89
+ }
90
+ //#endregion
91
+ export { e as createTouchDrag };
@@ -0,0 +1,94 @@
1
+ //#region ../grid/dist/row-resize.js
2
+ var e = "sv-grid-row-resize-handle";
3
+ function t(t, n) {
4
+ let r = n, i = null;
5
+ function a(e) {
6
+ let t = e.querySelector("[data-svgrid-row]")?.dataset.svgridRow;
7
+ return t == null ? NaN : Number(t);
8
+ }
9
+ function o(e) {
10
+ if (!i) return;
11
+ 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));
13
+ }
14
+ function s(e) {
15
+ if (!i) return;
16
+ let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
17
+ r.onResize(i.rowIndex, Math.round(a)), i.strip.classList.remove("is-resizing");
18
+ try {
19
+ i.trEl.releasePointerCapture(e.pointerId);
20
+ } catch {}
21
+ i = null, window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), document.body.style.cursor = "";
22
+ }
23
+ function c(t) {
24
+ if (r.disabled) return;
25
+ let n = t.target;
26
+ if (!n?.classList.contains(e)) return;
27
+ let i = t.shiftKey ? 1 : 10, o = 0;
28
+ if (t.key === "ArrowUp") o = -i;
29
+ else if (t.key === "ArrowDown") o = i;
30
+ else return;
31
+ let s = n.closest("tr.sv-grid-row");
32
+ if (!s) return;
33
+ let c = a(s);
34
+ if (!Number.isFinite(c)) return;
35
+ t.preventDefault(), t.stopPropagation();
36
+ let l = r.min ?? 20, u = r.max ?? 320, d = Math.round(Math.max(l, Math.min(u, s.getBoundingClientRect().height + o)));
37
+ s.style.height = `${d}px`, r.onResizeMove?.(c, d), r.onResize(c, d);
38
+ }
39
+ function l(t) {
40
+ if (r.disabled) return;
41
+ let n = t.target;
42
+ if (!n?.classList.contains(e)) return;
43
+ let c = n.closest("tr.sv-grid-row");
44
+ if (!c) return;
45
+ let l = a(c);
46
+ if (Number.isFinite(l)) {
47
+ t.preventDefault(), t.stopPropagation(), n.classList.add("is-resizing"), i = {
48
+ rowIndex: l,
49
+ startY: t.clientY,
50
+ startHeight: c.getBoundingClientRect().height,
51
+ trEl: c,
52
+ strip: n
53
+ };
54
+ try {
55
+ c.setPointerCapture(t.pointerId);
56
+ } catch {}
57
+ document.body.style.cursor = "row-resize", window.addEventListener("pointermove", o), window.addEventListener("pointerup", s);
58
+ }
59
+ }
60
+ function u() {
61
+ if (r.disabled) {
62
+ d();
63
+ return;
64
+ }
65
+ let n = t.querySelectorAll("tr.sv-grid-row");
66
+ for (let t of n) {
67
+ if (t.classList.contains("sv-grid-header-row") || t.classList.contains("sv-grid-row-spacer")) continue;
68
+ 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);
69
+ if (!n || n.querySelector(`:scope > .${e}`)) continue;
70
+ getComputedStyle(n).position === "static" && (n.style.position = "relative"), n.style.overflow = "visible";
71
+ let i = document.createElement("div");
72
+ i.className = e, i.setAttribute("role", "separator"), i.setAttribute("aria-orientation", "horizontal"), i.setAttribute("aria-label", "Resize row"), i.tabIndex = 0, i.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(i);
73
+ }
74
+ }
75
+ function d() {
76
+ t.querySelectorAll(`.${e}`).forEach((e) => e.remove());
77
+ }
78
+ t.addEventListener("pointerdown", l, { capture: !0 }), t.addEventListener("keydown", c, { capture: !0 });
79
+ let f = new MutationObserver(() => u());
80
+ return f.observe(t, {
81
+ childList: !0,
82
+ subtree: !0
83
+ }), u(), {
84
+ update(e) {
85
+ let t = r.disabled;
86
+ r = e, t !== r.disabled && u();
87
+ },
88
+ destroy() {
89
+ t.removeEventListener("pointerdown", l, { capture: !0 }), t.removeEventListener("keydown", c, { capture: !0 }), window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), f.disconnect(), d();
90
+ }
91
+ };
92
+ }
93
+ //#endregion
94
+ export { t as rowResize };