@svgrid/grid-wc 3.0.0 → 3.0.2

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 (96) hide show
  1. package/README.md +130 -110
  2. package/dist/GridMenus-B1mC1aPp.js +1077 -0
  3. package/dist/SvChartMenu-CBMKm7Xb.js +413 -0
  4. package/dist/SvDateRangeInput-BrYTQEMM.js +197 -0
  5. package/dist/SvDateTimePicker-CnLlqNDQ.js +766 -0
  6. package/dist/SvField-Bmzp3ObZ.js +147 -0
  7. package/dist/SvGridCellEditor-B005dmV1.js +560 -0
  8. package/dist/SvGridChart-4TcL9Rj2.js +3702 -0
  9. package/dist/SvGridChartBuilder-C4OL4XYx.js +1165 -0
  10. package/dist/SvGridChartPanel-CfHA8Ioq.js +1743 -0
  11. package/dist/SvGridChartView-Ci-9_EJ0.js +45 -0
  12. package/dist/SvGridDropdown-BlA6iw9m.js +257 -0
  13. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +178 -7
  14. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
  15. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +77 -2
  16. package/dist/{shadow/cell-formatting-C0OsDmi_.js → cell-formatting-Eypm-id0.js} +1 -1
  17. package/dist/chart/SvChartMenu-C-sbGNk8.js +586 -0
  18. package/dist/chart/chart-export-BHGuh_kZ.js +127 -0
  19. package/dist/chart/chart-export-pdf-BjkkIEkE.js +104 -0
  20. package/dist/chart/chart-summary-B86RFA3M.js +137 -0
  21. package/dist/chart/chart-trend-DP6DSsBa.js +56 -0
  22. package/dist/chart/chart-validate-CD6ptiwg.js +180 -0
  23. package/dist/chart/client-BuB0wIgc.js +2757 -0
  24. package/dist/chart/sv-chart-element.d.ts +98 -0
  25. package/dist/chart/sv-chart-element.js +7282 -0
  26. package/dist/chart-DoqdUoGg.js +4398 -0
  27. package/dist/chart-export-pdf-BirUdchl.js +104 -0
  28. package/dist/chart-summary-BP9i-v8M.js +137 -0
  29. package/dist/chart-validate-CD6ptiwg.js +180 -0
  30. package/dist/{shadow/client-DjwUji8D.js → client-DEF0GRjE.js} +1 -1
  31. package/dist/{shadow/column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
  32. package/dist/date-format-DMTwV8NC.js +1128 -0
  33. package/dist/{export-format-B6FUgOll.js → export-format-uGayRKWM.js} +3 -3
  34. package/dist/focus-trap-DvlOlOGM.js +65 -0
  35. package/dist/list-option-DrRyivWp.js +82 -0
  36. package/dist/react/chart.d.ts +99 -0
  37. package/dist/react/chart.js +49 -0
  38. package/dist/react/index.d.ts +28 -0
  39. package/dist/react/index.js +4 -1
  40. package/dist/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
  41. package/dist/shadow/GridMenus-B1mC1aPp.js +1077 -0
  42. package/dist/shadow/SvChartMenu-CBMKm7Xb.js +413 -0
  43. package/dist/shadow/SvDateRangeInput-BrYTQEMM.js +197 -0
  44. package/dist/shadow/SvDateTimePicker-CnLlqNDQ.js +766 -0
  45. package/dist/shadow/SvField-Bmzp3ObZ.js +147 -0
  46. package/dist/shadow/SvGridCellEditor-B005dmV1.js +560 -0
  47. package/dist/shadow/SvGridChart-4TcL9Rj2.js +3702 -0
  48. package/dist/shadow/SvGridChartBuilder-C4OL4XYx.js +1165 -0
  49. package/dist/shadow/SvGridChartPanel-CfHA8Ioq.js +1743 -0
  50. package/dist/shadow/SvGridChartView-Ci-9_EJ0.js +45 -0
  51. package/dist/shadow/SvGridDropdown-BlA6iw9m.js +257 -0
  52. package/dist/{cell-formatting-C0OsDmi_.js → shadow/cell-formatting-Eypm-id0.js} +1 -1
  53. package/dist/shadow/chart-DoqdUoGg.js +4398 -0
  54. package/dist/shadow/chart-export-pdf-BirUdchl.js +104 -0
  55. package/dist/shadow/chart-summary-BP9i-v8M.js +137 -0
  56. package/dist/shadow/chart-validate-CD6ptiwg.js +180 -0
  57. package/dist/{client-DjwUji8D.js → shadow/client-DEF0GRjE.js} +1 -1
  58. package/dist/{column-resize-DvCRUrN3.js → shadow/column-resize-DUPgynvc.js} +3 -3
  59. package/dist/shadow/date-format-DMTwV8NC.js +1128 -0
  60. package/dist/shadow/{export-format-C8kZGZfz.js → export-format-DhdZREP1.js} +3 -3
  61. package/dist/shadow/focus-trap-DvlOlOGM.js +65 -0
  62. package/dist/shadow/list-option-DrRyivWp.js +82 -0
  63. package/dist/shadow/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
  64. package/dist/shadow/sv-grid-shadow-element.d.ts +15 -0
  65. package/dist/shadow/sv-grid-shadow-element.js +4853 -3626
  66. package/dist/shadow/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  67. package/dist/sv-grid-element.d.ts +15 -0
  68. package/dist/sv-grid-element.js +4809 -3612
  69. package/dist/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  70. package/dist/vue/chart.d.ts +64 -0
  71. package/dist/vue/chart.js +41 -0
  72. package/dist/vue/index.d.ts +11 -2
  73. package/dist/vue/index.js +4 -1
  74. package/package.json +18 -5
  75. package/dist/GridMenus-DpmS1pzo.js +0 -1121
  76. package/dist/SvDateRangeInput-u4ibte8S.js +0 -196
  77. package/dist/SvDateTimePicker-DVFiDxUq.js +0 -765
  78. package/dist/SvField-ChCI-O2O.js +0 -146
  79. package/dist/SvGridCellEditor-DvsQyE9a.js +0 -550
  80. package/dist/SvGridChart-yK5Zv85y.js +0 -1199
  81. package/dist/SvGridChartPanel-B38_VjXM.js +0 -584
  82. package/dist/SvGridChartView-ScXTF6t-.js +0 -50
  83. package/dist/SvGridDropdown-DnAESFDu.js +0 -256
  84. package/dist/chart-uvs3sFJA.js +0 -1220
  85. package/dist/date-format-CPHqTHN6.js +0 -1127
  86. package/dist/shadow/GridMenus-DpmS1pzo.js +0 -1121
  87. package/dist/shadow/SvDateRangeInput-u4ibte8S.js +0 -196
  88. package/dist/shadow/SvDateTimePicker-DVFiDxUq.js +0 -765
  89. package/dist/shadow/SvField-ChCI-O2O.js +0 -146
  90. package/dist/shadow/SvGridCellEditor-DvsQyE9a.js +0 -550
  91. package/dist/shadow/SvGridChart-yK5Zv85y.js +0 -1199
  92. package/dist/shadow/SvGridChartPanel-B38_VjXM.js +0 -584
  93. package/dist/shadow/SvGridChartView-ScXTF6t-.js +0 -50
  94. package/dist/shadow/SvGridDropdown-DnAESFDu.js +0 -256
  95. package/dist/shadow/chart-uvs3sFJA.js +0 -1220
  96. package/dist/shadow/date-format-CPHqTHN6.js +0 -1127
@@ -1,4 +1,4 @@
1
- import { n as e, r as t, t as n } from "./cell-formatting-C0OsDmi_.js";
1
+ import { i as e, n as t, t as n } from "./cell-formatting-Eypm-id0.js";
2
2
  import "./sv-grid-element.js";
3
3
  //#region ../grid/dist/export-format.js
4
4
  function r(e) {
@@ -26,7 +26,7 @@ function i(i, a) {
26
26
  if (a.type === "date" || a.type === "datetime") {
27
27
  let n = r(i);
28
28
  if (n) {
29
- let r = t(a.pattern, a.type), i = r || a.options ? {
29
+ let r = e(a.pattern, a.type), i = r || a.options ? {
30
30
  ...r,
31
31
  ...a.options
32
32
  } : a.type === "date" ? {
@@ -40,7 +40,7 @@ function i(i, a) {
40
40
  hour: "2-digit",
41
41
  minute: "2-digit"
42
42
  };
43
- return e(a.locales, i).format(n);
43
+ return t(a.locales, i).format(n);
44
44
  }
45
45
  }
46
46
  return String(i);
@@ -0,0 +1,65 @@
1
+ //#region ../grid/dist/a11y/focus-trap.js
2
+ var e = [
3
+ "a[href]",
4
+ "area[href]",
5
+ "button:not([disabled])",
6
+ "input:not([disabled])",
7
+ "select:not([disabled])",
8
+ "textarea:not([disabled])",
9
+ "iframe",
10
+ "audio[controls]",
11
+ "video[controls]",
12
+ "[contenteditable]:not([contenteditable=\"false\"])",
13
+ "[tabindex]"
14
+ ].join(",");
15
+ function t(e) {
16
+ if (e.hasAttribute("disabled") || e.getAttribute("aria-hidden") === "true" || e.hidden || e.closest("[hidden]")) return !1;
17
+ let t = e.style;
18
+ return !(t.display === "none" || t.visibility === "hidden" || typeof e.getClientRects == "function" && e.getClientRects().length === 0 && document.body.getClientRects().length > 0);
19
+ }
20
+ function n(n) {
21
+ return Array.from(n.querySelectorAll(e)).filter((e) => {
22
+ let n = e.getAttribute("tabindex");
23
+ return n !== null && Number(n) < 0 ? !1 : t(e);
24
+ });
25
+ }
26
+ function r(e, t = {}) {
27
+ let { initialFocus: r = "first", returnFocus: i = !0 } = t, a = null, o = !1;
28
+ function s() {
29
+ let t = r;
30
+ return t === "container" ? e : t === "first" ? n(e)[0] ?? e : typeof t == "function" ? t() : t;
31
+ }
32
+ function c(r) {
33
+ if (!o) return;
34
+ if (r.key === "Escape" && t.onEscape) {
35
+ t.onEscape(r);
36
+ return;
37
+ }
38
+ if (r.key !== "Tab") return;
39
+ let i = n(e);
40
+ if (!i.length) {
41
+ r.preventDefault(), e.focus();
42
+ return;
43
+ }
44
+ let a = i[0], s = i[i.length - 1], c = document.activeElement;
45
+ if (!e.contains(c)) {
46
+ r.preventDefault(), a.focus();
47
+ return;
48
+ }
49
+ r.shiftKey && c === a ? (r.preventDefault(), s.focus()) : !r.shiftKey && c === s && (r.preventDefault(), a.focus());
50
+ }
51
+ function l() {
52
+ o || (o = !0, a = document.activeElement, e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), document.addEventListener("keydown", c, !0), queueMicrotask(() => {
53
+ o && s()?.focus();
54
+ }));
55
+ }
56
+ function u() {
57
+ o && (o = !1, document.removeEventListener("keydown", c, !0), i && a?.focus?.(), a = null);
58
+ }
59
+ return {
60
+ activate: l,
61
+ release: u
62
+ };
63
+ }
64
+ //#endregion
65
+ export { r as t };
@@ -0,0 +1,82 @@
1
+ //#region ../grid/dist/list-option.js
2
+ function e(e) {
3
+ return e ? e.map((e) => {
4
+ if (typeof e == "object" && e) {
5
+ let t = e, n = t.value ?? t.label ?? "";
6
+ return {
7
+ ...t,
8
+ value: n,
9
+ label: t.label ?? String(n)
10
+ };
11
+ }
12
+ return {
13
+ value: e,
14
+ label: String(e)
15
+ };
16
+ }) : [];
17
+ }
18
+ function t(e) {
19
+ let t = [], n = /* @__PURE__ */ new Map();
20
+ return e.forEach((e, r) => {
21
+ let i = e.group ?? null, a = n.get(i);
22
+ a || (a = {
23
+ group: i,
24
+ options: []
25
+ }, n.set(i, a), t.push(a)), a.options.push({
26
+ ...e,
27
+ index: r
28
+ });
29
+ }), t;
30
+ }
31
+ function n(e, n) {
32
+ let r = Math.max(1, n.groupHeaderHeight ?? 28), i = n.rowHeight, a = (e) => Math.max(1, typeof i == "function" ? i(e, e.index) : i), o = [], s = Array(e.length), c = !1;
33
+ for (let n of t(e)) {
34
+ n.group != null && (c = !0, o.push({
35
+ type: "group",
36
+ label: n.group,
37
+ size: r
38
+ }));
39
+ for (let e of n.options) s[e.index] = o.length, o.push({
40
+ type: "option",
41
+ opt: e,
42
+ size: a(e)
43
+ });
44
+ }
45
+ return {
46
+ entries: o,
47
+ hasGroups: c,
48
+ sizeAt: (e) => o[e]?.size ?? 0,
49
+ optionFlatIndex: s
50
+ };
51
+ }
52
+ function r(e, t, n) {
53
+ let r = t.trim().toLowerCase();
54
+ if (!r || !e.length) return -1;
55
+ let i = e.length;
56
+ for (let t = 1; t <= i; t++) {
57
+ let a = (n + t) % i, o = e[a];
58
+ if (o && !o.disabled && o.label.toLowerCase().startsWith(r)) return a;
59
+ }
60
+ return -1;
61
+ }
62
+ function i(e = 600) {
63
+ let t = "", n;
64
+ return {
65
+ get value() {
66
+ return t;
67
+ },
68
+ push(r) {
69
+ return t += r, n && clearTimeout(n), n = setTimeout(() => {
70
+ t = "";
71
+ }, e), t;
72
+ },
73
+ clear() {
74
+ t = "", n && clearTimeout(n);
75
+ }
76
+ };
77
+ }
78
+ function a(e) {
79
+ return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && e.key !== " ";
80
+ }
81
+ //#endregion
82
+ export { r as a, a as i, n, e as o, t as r, i as t };
@@ -0,0 +1,99 @@
1
+ import '@svgrid/grid-wc/chart';
2
+ export interface SvChartProps {
3
+ /** `property only` - ChartSpec */
4
+ spec?: unknown;
5
+ /** `legend` - boolean | ChartLegendPosition */
6
+ legend?: string;
7
+ /** `interactive` - boolean */
8
+ interactive?: boolean;
9
+ /** `data-labels` - boolean | ChartDataLabelConfig */
10
+ dataLabels?: boolean;
11
+ /** `property only` - (value: number) => string */
12
+ formatValue?: unknown;
13
+ /** `property only` - (ctx: ChartTooltipContext) => { title?: string; rows?: ChartTooltipRow[] } */
14
+ tooltipFormat?: unknown;
15
+ /** `tooltip-mode` - 'shared' | 'single' */
16
+ tooltipMode?: "shared" | "single";
17
+ /** `tooltip-position` - 'follow' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' */
18
+ tooltipPosition?: "follow" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
19
+ /** `tooltip-sticky` - boolean */
20
+ tooltipSticky?: boolean;
21
+ /** `zoomable` - boolean | ChartZoomConfig */
22
+ zoomable?: boolean;
23
+ /** `property only` - ChartZoomWindow | null */
24
+ zoom?: unknown;
25
+ /** `range-presets` - boolean | ChartRangePreset[] */
26
+ rangePresets?: boolean;
27
+ /** `sync-group` - string */
28
+ syncGroup?: string;
29
+ /** `context-menu` - boolean | MenuItem[] | ((target: ChartContextTarget) => MenuItem[]) */
30
+ contextMenu?: boolean;
31
+ /** `animate` - boolean | ChartAnimateConfig */
32
+ animate?: boolean;
33
+ /** `live` - boolean */
34
+ live?: boolean;
35
+ /** `drillable` - boolean */
36
+ drillable?: boolean;
37
+ /** `property only` - string[] */
38
+ drillPath?: readonly unknown[];
39
+ /** `selectable` - boolean | 'single' | 'multi' */
40
+ selectable?: string;
41
+ /** `property only` - ChartPointRef[] */
42
+ selected?: readonly unknown[];
43
+ /** `hover-highlight` - boolean */
44
+ hoverHighlight?: boolean;
45
+ /** `announce` - boolean */
46
+ announce?: boolean;
47
+ /** `describe` - boolean */
48
+ describe?: boolean;
49
+ /** `property only` - Partial<ChartMessages> */
50
+ localeText?: unknown;
51
+ /** `crosshair-labels` - boolean */
52
+ crosshairLabels?: boolean;
53
+ /** `brush` - boolean */
54
+ brush?: boolean;
55
+ /** `brush-height` - number */
56
+ brushHeight?: number;
57
+ /** `toolbar` - boolean */
58
+ toolbar?: boolean;
59
+ /** `width` - number */
60
+ width?: number;
61
+ /** `height` - number */
62
+ height?: number;
63
+ /** `autosize` - boolean */
64
+ autosize?: boolean;
65
+ /** `annotatable` - boolean */
66
+ annotatable?: boolean;
67
+ /** `drawable` - boolean | ChartDrawingKind[] */
68
+ drawable?: boolean;
69
+ /** `select` */
70
+ onSelect?: (detail: unknown) => void;
71
+ /** `drill` */
72
+ onDrill?: (detail: unknown) => void;
73
+ /** `zoom` */
74
+ onZoom?: (detail: unknown) => void;
75
+ /** `selectionchange` */
76
+ onSelectionChange?: (detail: unknown) => void;
77
+ /** `hover` */
78
+ onHover?: (detail: unknown) => void;
79
+ /** `annotate` */
80
+ onAnnotate?: (detail: unknown) => void;
81
+ /** `annotationremove` */
82
+ onAnnotationRemove?: (detail: number) => void;
83
+ /** `drawingschange` */
84
+ onDrawingsChange?: (detail: unknown) => void;
85
+ /** Forwarded to the host element. */
86
+ className?: string;
87
+ style?: Record<string, string | number>;
88
+ }
89
+ /** The host element, reachable through a ref. */
90
+ export interface SvChartHandle {
91
+ element: HTMLElement | null;
92
+ }
93
+ /**
94
+ * SvChart as a React component. Same shape as the grid wrapper: props are
95
+ * written as DOM properties when they change, handlers are bound once through
96
+ * a ref so inline arrows do not rebind on every render.
97
+ */
98
+ export declare const SvChart: import("react").ForwardRefExoticComponent<SvChartProps & import("react").RefAttributes<SvChartHandle>>;
99
+ export default SvChart;
@@ -0,0 +1,49 @@
1
+ import { createElement as e, forwardRef as t, useEffect as n, useImperativeHandle as r, useRef as i } from "react";
2
+ import "@svgrid/grid-wc/chart";
3
+ //#region src/react/chart.tsx
4
+ var a = /* @__PURE__ */ "spec.legend.interactive.dataLabels.formatValue.tooltipFormat.tooltipMode.tooltipPosition.tooltipSticky.zoomable.zoom.rangePresets.syncGroup.contextMenu.animate.live.drillable.drillPath.selectable.selected.hoverHighlight.announce.describe.localeText.crosshairLabels.brush.brushHeight.toolbar.width.height.autosize.annotatable.drawable".split("."), o = [
5
+ ["onSelect", "select"],
6
+ ["onDrill", "drill"],
7
+ ["onZoom", "zoom"],
8
+ ["onSelectionChange", "selectionchange"],
9
+ ["onHover", "hover"],
10
+ ["onAnnotate", "annotate"],
11
+ ["onAnnotationRemove", "annotationremove"],
12
+ ["onDrawingsChange", "drawingschange"]
13
+ ], s = t(function(t, s) {
14
+ let c = i(null), { className: l, style: u, ...d } = t, f = i({});
15
+ n(() => {
16
+ let e = c.current;
17
+ if (e) for (let t of a) {
18
+ let n = d[t];
19
+ n === void 0 || Object.is(f.current[t], n) || (f.current[t] = n, e[t] = n);
20
+ }
21
+ });
22
+ let p = i(d);
23
+ return p.current = d, n(() => {
24
+ let e = c.current;
25
+ if (!e) return;
26
+ let t = [];
27
+ for (let [n, r] of o) {
28
+ let i = (e) => {
29
+ let t = p.current[n];
30
+ t?.(e.detail);
31
+ };
32
+ e.addEventListener(r, i), t.push([r, i]);
33
+ }
34
+ return () => {
35
+ for (let [n, r] of t) e.removeEventListener(n, r);
36
+ };
37
+ }, []), r(s, () => ({ get element() {
38
+ return c.current;
39
+ } }), []), e("sv-chart", {
40
+ ref: c,
41
+ class: l,
42
+ style: {
43
+ display: "block",
44
+ ...u
45
+ }
46
+ });
47
+ });
48
+ //#endregion
49
+ export { s as SvChart, s as default };
@@ -122,10 +122,18 @@ export interface SvGridProps {
122
122
  enableRowHover?: boolean;
123
123
  /** `copy-headers-to-clipboard` - boolean */
124
124
  copyHeadersToClipboard?: boolean;
125
+ /** `property only` - (params: { value: unknown; delta: { rows: number; cols: number }; rowIndex: number; column */
126
+ processCellForFill?: unknown;
125
127
  /** `property only` - (params: { value: unknown; column: unknown; row: TData; rowIndex: number; columnId: string */
126
128
  processCellForClipboard?: unknown;
129
+ /** `property only` - (params: { rects: ReadonlyArray<{ minRow: number; maxRow: number; minCol: number; maxCol: */
130
+ clipboardHtml?: unknown;
131
+ /** `property only` - (params: { text: string; parsedValue: unknown; row: TData; rowIndex: number; columnId: str */
132
+ processCellFromClipboard?: unknown;
127
133
  /** `enable-inline-editing` - boolean */
128
134
  enableInlineEditing?: boolean;
135
+ /** `edit-on-second-click` - boolean */
136
+ editOnSecondClick?: boolean;
129
137
  /** `full-row-editing` - boolean */
130
138
  fullRowEditing?: boolean;
131
139
  /** `enable-row-summaries` - boolean */
@@ -180,6 +188,10 @@ export interface SvGridProps {
180
188
  serverFilterValues?: unknown;
181
189
  /** `property only` - ReadonlyArray<TData> */
182
190
  pinnedTopRows?: readonly unknown[];
191
+ /** `frozen-rows` - number */
192
+ frozenRows?: number;
193
+ /** `property only` - ReadonlyArray<{ rowIndex: number; colIndex: number; rowSpan: number; colSpan: number }> */
194
+ mergedCells?: readonly unknown[];
183
195
  /** `property only` - ReadonlyArray<TData> */
184
196
  pinnedBottomRows?: readonly unknown[];
185
197
  /** `enable-column-reorder` - boolean */
@@ -205,6 +217,22 @@ export interface SvGridProps {
205
217
  pageIndex: number;
206
218
  pageSize: number;
207
219
  }) => void;
220
+ /** `columnresize` */
221
+ onColumnResize?: (detail: {
222
+ columnId: string;
223
+ width: number;
224
+ }) => void;
225
+ /** `rowresize` */
226
+ onRowResize?: (detail: {
227
+ rowIndex: number;
228
+ height: number | null;
229
+ }) => void;
230
+ /** `pasteclipboard` */
231
+ onPasteClipboard?: (detail: {
232
+ text: string;
233
+ html: string | null;
234
+ source: "event" | "async";
235
+ }) => void;
208
236
  /** `apiready` */
209
237
  onApiReady?: (detail: unknown) => void;
210
238
  /** `rowselectionchange` */
@@ -1,10 +1,13 @@
1
1
  import { createElement as e, forwardRef as t, useEffect as n, useImperativeHandle as r, useRef as i } from "react";
2
2
  import "@svgrid/grid-wc";
3
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 = [
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.processCellForFill.processCellForClipboard.clipboardHtml.processCellFromClipboard.enableInlineEditing.editOnSecondClick.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.frozenRows.mergedCells.pinnedBottomRows.enableColumnReorder.columnOrder.inferColumnTypes.rowDragManaged.rowDragGroup.alignedGridGroup.filterLocale".split("."), o = [
5
5
  ["onPivotModeChange", "pivotmodechange"],
6
6
  ["onExpandedChange", "expandedchange"],
7
7
  ["onPaginationChange", "paginationchange"],
8
+ ["onColumnResize", "columnresize"],
9
+ ["onRowResize", "rowresize"],
10
+ ["onPasteClipboard", "pasteclipboard"],
8
11
  ["onApiReady", "apiready"],
9
12
  ["onRowSelectionChange", "rowselectionchange"],
10
13
  ["onCellSelectionChange", "cellselectionchange"],
@@ -1,65 +1,73 @@
1
1
  //#region ../grid/dist/row-resize.js
2
2
  var e = "sv-grid-row-resize-handle";
3
3
  function t(t, n) {
4
- let r = n, i = null;
5
- function a(e) {
4
+ let r = n, i = null, a = null;
5
+ function o(e) {
6
6
  let t = e.querySelector("[data-svgrid-row]")?.dataset.svgridRow;
7
7
  return t == null ? NaN : Number(t);
8
8
  }
9
- function o(e) {
9
+ function s(e) {
10
10
  if (!i) return;
11
11
  let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
12
12
  i.trEl.style.height = `${Math.round(a)}px`, r.onResizeMove?.(i.rowIndex, Math.round(a));
13
13
  }
14
- function s(e) {
14
+ function c(e) {
15
15
  if (!i) return;
16
16
  let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
17
17
  r.onResize(i.rowIndex, Math.round(a)), i.strip.classList.remove("is-resizing");
18
18
  try {
19
19
  i.trEl.releasePointerCapture(e.pointerId);
20
20
  } catch {}
21
- i = null, window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), document.body.style.cursor = "";
21
+ i = null, window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c), document.body.style.cursor = "";
22
22
  }
23
- function c(t) {
23
+ function l(t) {
24
24
  if (r.disabled) return;
25
25
  let n = t.target;
26
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;
27
+ let i = t.shiftKey ? 1 : 10, a = 0;
28
+ if (t.key === "ArrowUp") a = -i;
29
+ else if (t.key === "ArrowDown") a = i;
30
30
  else return;
31
31
  let s = n.closest("tr.sv-grid-row");
32
32
  if (!s) return;
33
- let c = a(s);
33
+ let c = o(s);
34
34
  if (!Number.isFinite(c)) return;
35
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)));
36
+ let l = r.min ?? 20, u = r.max ?? 320, d = Math.round(Math.max(l, Math.min(u, s.getBoundingClientRect().height + a)));
37
37
  s.style.height = `${d}px`, r.onResizeMove?.(c, d), r.onResize(c, d);
38
38
  }
39
- function l(t) {
39
+ function u(t) {
40
40
  if (r.disabled) return;
41
41
  let n = t.target;
42
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);
43
+ let l = n.closest("tr.sv-grid-row");
44
+ if (!l) return;
45
+ let u = o(l);
46
+ if (!Number.isFinite(u)) return;
47
+ t.preventDefault(), t.stopPropagation();
48
+ let d = t.timeStamp, f = a !== null && a.rowIndex === u && d - a.at < 400;
49
+ if (a = {
50
+ rowIndex: u,
51
+ at: d
52
+ }, f && r.onAutosize) {
53
+ a = null, r.onAutosize(u);
54
+ return;
58
55
  }
56
+ n.classList.add("is-resizing"), i = {
57
+ rowIndex: u,
58
+ startY: t.clientY,
59
+ startHeight: l.getBoundingClientRect().height,
60
+ trEl: l,
61
+ strip: n
62
+ };
63
+ try {
64
+ l.setPointerCapture(t.pointerId);
65
+ } catch {}
66
+ document.body.style.cursor = "row-resize", window.addEventListener("pointermove", s), window.addEventListener("pointerup", c);
59
67
  }
60
- function u() {
68
+ function d() {
61
69
  if (r.disabled) {
62
- d();
70
+ f();
63
71
  return;
64
72
  }
65
73
  let n = t.querySelectorAll("tr.sv-grid-row");
@@ -72,21 +80,21 @@ function t(t, n) {
72
80
  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
81
  }
74
82
  }
75
- function d() {
83
+ function f() {
76
84
  t.querySelectorAll(`.${e}`).forEach((e) => e.remove());
77
85
  }
78
- t.addEventListener("pointerdown", l, { capture: !0 }), t.addEventListener("keydown", c, { capture: !0 });
79
- let f = new MutationObserver(() => u());
80
- return f.observe(t, {
86
+ t.addEventListener("pointerdown", u, { capture: !0 }), t.addEventListener("keydown", l, { capture: !0 });
87
+ let p = new MutationObserver(() => d());
88
+ return p.observe(t, {
81
89
  childList: !0,
82
90
  subtree: !0
83
- }), u(), {
91
+ }), d(), {
84
92
  update(e) {
85
93
  let t = r.disabled;
86
- r = e, t !== r.disabled && u();
94
+ r = e, t !== r.disabled && d();
87
95
  },
88
96
  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();
97
+ t.removeEventListener("pointerdown", u, { capture: !0 }), t.removeEventListener("keydown", l, { capture: !0 }), window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c), p.disconnect(), f();
90
98
  }
91
99
  };
92
100
  }