wimui 0.43.0 → 0.44.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.
package/README.ja.md CHANGED
@@ -307,7 +307,7 @@ peer 依存コンポーネントは**コンポーネント別の専用サブパ
307
307
  | Markdown | `wimui/data-display/markdown` | `react-markdown` `remark-gfm` |
308
308
  | QRCode | `wimui/data-display/qr-code` | `qrcode.react` |
309
309
  | NodeGraph | `wimui/data-display/node-graph` | `@xyflow/react` |
310
- | ScheduleView | `wimui/data-display/schedule-view` | `@fullcalendar/core` `@fullcalendar/react` `@fullcalendar/daygrid` `@fullcalendar/timegrid` `@fullcalendar/interaction` |
310
+ | ScheduleView | `wimui/data-display/schedule-view` | `@fullcalendar/core` `@fullcalendar/react` `@fullcalendar/daygrid` `@fullcalendar/timegrid` `@fullcalendar/interaction`(`^6`。@6 を付けて入れてください。FullCalendar 7 には対応しておらず、pnpm は版を指定しないと core と react の最新(7)を入れます) |
311
311
  | JsonDiffViewer | `wimui/data-display/json-diff-viewer` | `diff` |
312
312
  | StreamingText | `wimui/ai/streaming-text` | `react-markdown` `remark-gfm` |
313
313
  | MarkdownRenderer | `wimui/ai/markdown-renderer` | `react-markdown` `remark-gfm` |
package/README.md CHANGED
@@ -305,7 +305,7 @@ Each peer-dependent component has its **own subpath** whose name documents its p
305
305
  | Markdown | `wimui/data-display/markdown` | `react-markdown` `remark-gfm` |
306
306
  | QRCode | `wimui/data-display/qr-code` | `qrcode.react` |
307
307
  | NodeGraph | `wimui/data-display/node-graph` | `@xyflow/react` |
308
- | ScheduleView | `wimui/data-display/schedule-view` | `@fullcalendar/core` `@fullcalendar/react` `@fullcalendar/daygrid` `@fullcalendar/timegrid` `@fullcalendar/interaction` |
308
+ | ScheduleView | `wimui/data-display/schedule-view` | `@fullcalendar/core` `@fullcalendar/react` `@fullcalendar/daygrid` `@fullcalendar/timegrid` `@fullcalendar/interaction` (`^6`. Install them with @6: FullCalendar 7 is not supported, and pnpm installs the latest core and react (7) unless you pin them) |
309
309
  | JsonDiffViewer | `wimui/data-display/json-diff-viewer` | `diff` |
310
310
  | StreamingText | `wimui/ai/streaming-text` | `react-markdown` `remark-gfm` |
311
311
  | MarkdownRenderer | `wimui/ai/markdown-renderer` | `react-markdown` `remark-gfm` |
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../Table/Table.cjs"),i=require("./layoutPivot.cjs"),a=require("./pivot-table.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=o.default.forwardRef(({rows:e,columns:l,getValue:u,rowAxisLabel:d,caption:f,columnSubtotals:p=!1,totalRow:m=!1,totalColumn:h=!1,labels:g,className:_,...v},y)=>{let{t:b}=t.useWimTranslation(`components`),x=o.default.useId(),S=g?.total??b(`pivottable.total`),C=(0,o.useMemo)(()=>i.layoutPivotColumns(l,{subtotals:p,total:h}),[l,p,h]),w=(0,o.useMemo)(()=>i.layoutPivotRows(e),[e]),T=d!=null&&d!==!1,E=`${x}corner`,D=e=>`${x}c${e}`,O=e=>`${x}r${e}`,k=`${x}total`,A=(0,o.useMemo)(()=>C.columns.map(e=>e.headerIds.map(e=>`${x}c${e}`).join(` `)),[C,x]),j=o.default.useRef(null),M=o.default.useRef(null),[N,P]=o.default.useState(!1);o.default.useLayoutEffect(()=>{let e=j.current,t=M.current;if(!e||!t||typeof ResizeObserver>`u`)return;let n=()=>P(e.scrollWidth>e.clientWidth);n();let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[]);let F=n.useMergedRef(y,M),I=`${x}caption`,L=f?{"aria-labelledby":I}:v[`aria-label`]?{"aria-label":v[`aria-label`]}:v[`aria-labelledby`]?{"aria-labelledby":v[`aria-labelledby`]}:null;return(0,c.jsx)(`div`,{ref:j,className:a.default.scroller,tabIndex:N?0:void 0,...N&&L?{role:`region`,...L}:null,children:(0,c.jsxs)(`table`,{ref:F,className:(0,s.default)(`wim-pivot-table`,a.default.root,_),...v,children:[f&&(0,c.jsx)(`caption`,{id:I,className:a.default.caption,children:f}),(0,c.jsx)(`colgroup`,{}),C.groupSpans.map((e,t)=>(0,c.jsx)(`colgroup`,{span:e},t)),(0,c.jsx)(r.Table.Header,{children:C.headerRows.map((e,t)=>(0,c.jsxs)(`tr`,{children:[t===0&&(T?(0,c.jsx)(`th`,{id:E,scope:`col`,rowSpan:C.depth,className:(0,s.default)(a.default.columnHeader,a.default.corner,a.default.bottom),children:d}):(0,c.jsx)(`td`,{rowSpan:C.depth,className:(0,s.default)(a.default.columnHeader,a.default.bottom)})),e.map(e=>(0,c.jsx)(`th`,{id:D(e.id),scope:e.kind===`group`&&e.topLevel?`colgroup`:`col`,colSpan:e.colSpan>1?e.colSpan:void 0,rowSpan:e.rowSpan>1?e.rowSpan:void 0,className:(0,s.default)(a.default.columnHeader,e.kind===`group`&&a.default.group,e.reachesBottom&&a.default.bottom,e.startsGroup&&a.default.groupStart),children:e.kind===`group`||e.kind===`leaf`?e.node?.label:S},e.id))]},t))}),(0,c.jsx)(r.Table.Body,{children:w.map((e,t)=>{let n=[...e.ancestors.map(O),O(t)].join(` `),i=[...T?[E]:[],...e.ancestors.map(O)].join(` `);return(0,c.jsxs)(r.Table.Row,{className:(0,s.default)(e.hasChildren&&a.default.groupRow),children:[(0,c.jsx)(`th`,{id:O(t),scope:`row`,headers:i||void 0,className:a.default.rowHeader,style:{"--wim-pivot-table-depth":e.depth},children:e.node.label}),C.columns.map((t,i)=>(0,c.jsx)(r.Table.Cell,{headers:`${n} ${A[i]}`,className:(0,s.default)(a.default.value,t.kind!==`leaf`&&a.default.aggregate,t.startsGroup&&a.default.groupStart),children:u(e.key,t.key)},i))]},e.key)})}),m&&(0,c.jsx)(r.Table.Footer,{children:(0,c.jsxs)(r.Table.Row,{className:a.default.totalRow,children:[(0,c.jsx)(`th`,{id:k,scope:`row`,headers:T?E:void 0,className:a.default.rowHeader,children:S}),C.columns.map((e,t)=>(0,c.jsx)(r.Table.Cell,{headers:`${k} ${A[t]}`,className:(0,s.default)(a.default.value,e.startsGroup&&a.default.groupStart),children:u(null,e.key)},t))]})})]})})});l.displayName=`PivotTable`,exports.PivotTable=l;
@@ -0,0 +1,76 @@
1
+ import { default as React } from 'react';
2
+ export type PivotTableAxisNode = {
3
+ /** Unique within its axis. Passed back to `getValue`. */
4
+ key: string;
5
+ /** Heading shown for this row or column. */
6
+ label: React.ReactNode;
7
+ /** Nested headings. A node with children is a group; its own value is the subtotal. */
8
+ children?: PivotTableAxisNode[];
9
+ };
10
+ export type PivotTableLabels = {
11
+ /** Heading of the grand total row / column and of each subtotal column. */
12
+ total?: string;
13
+ };
14
+ export type PivotTableProps = Omit<React.ComponentPropsWithoutRef<"table">, "children"> & {
15
+ /** The row axis as a tree. Groups are drawn as an outline: one indented row per node. */
16
+ rows: PivotTableAxisNode[];
17
+ /** The column axis as a tree. Groups become headings that span their columns. */
18
+ columns: PivotTableAxisNode[];
19
+ /**
20
+ * Returns the content of one cell. The component does not aggregate: a group key asks
21
+ * for that group's subtotal and `null` asks for the grand total of that axis. Return
22
+ * `null` or `undefined` for an empty cell.
23
+ */
24
+ getValue: (rowKey: string | null, columnKey: string | null) => React.ReactNode;
25
+ /** Heading of the row axis, shown in the top-left corner. */
26
+ rowAxisLabel?: React.ReactNode;
27
+ /** Visible title of the table, also its accessible name. */
28
+ caption?: React.ReactNode;
29
+ /** Adds a subtotal column after the columns of each column group. */
30
+ columnSubtotals?: boolean;
31
+ /** Adds a grand total row at the bottom. */
32
+ totalRow?: boolean;
33
+ /** Adds a grand total column at the right edge. */
34
+ totalColumn?: boolean;
35
+ /** Text of the total headings, for when the built-in translations do not fit. */
36
+ labels?: PivotTableLabels;
37
+ };
38
+ /**
39
+ * PivotTable — draws already aggregated data as a table with multi-level row and column
40
+ * headings, subtotals and grand totals. It only draws: grouping and summing stay with the
41
+ * caller, who answers `getValue(rowKey, columnKey)` for every cell.
42
+ *
43
+ * Every cell lists the headings it belongs to in its `headers` attribute, so a screen
44
+ * reader announces the full row path and column path of a value.
45
+ *
46
+ * The shell is its own (a sideways scroller and a plain `table`); rows and value cells are
47
+ * `Table.Row` / `Table.Cell`, so spacing and density follow `Table`.
48
+ *
49
+ * Composition Contract:
50
+ * - Managed by: App consumption
51
+ * - Scroll lock: No (the table scrolls sideways inside its own box when it is wider than it)
52
+ */
53
+ export declare const PivotTable: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref">, "children"> & {
54
+ /** The row axis as a tree. Groups are drawn as an outline: one indented row per node. */
55
+ rows: PivotTableAxisNode[];
56
+ /** The column axis as a tree. Groups become headings that span their columns. */
57
+ columns: PivotTableAxisNode[];
58
+ /**
59
+ * Returns the content of one cell. The component does not aggregate: a group key asks
60
+ * for that group's subtotal and `null` asks for the grand total of that axis. Return
61
+ * `null` or `undefined` for an empty cell.
62
+ */
63
+ getValue: (rowKey: string | null, columnKey: string | null) => React.ReactNode;
64
+ /** Heading of the row axis, shown in the top-left corner. */
65
+ rowAxisLabel?: React.ReactNode;
66
+ /** Visible title of the table, also its accessible name. */
67
+ caption?: React.ReactNode;
68
+ /** Adds a subtotal column after the columns of each column group. */
69
+ columnSubtotals?: boolean;
70
+ /** Adds a grand total row at the bottom. */
71
+ totalRow?: boolean;
72
+ /** Adds a grand total column at the right edge. */
73
+ totalColumn?: boolean;
74
+ /** Text of the total headings, for when the built-in translations do not fit. */
75
+ labels?: PivotTableLabels;
76
+ } & React.RefAttributes<HTMLTableElement>>;
@@ -0,0 +1,104 @@
1
+ "use client";
2
+ import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
3
+ import { useMergedRef as t } from "../../../hooks/useMergedRef.js";
4
+ import { Table as n } from "../Table/Table.js";
5
+ import { layoutPivotColumns as r, layoutPivotRows as i } from "./layoutPivot.js";
6
+ import a from "./pivot-table.module.js";
7
+ import o, { useMemo as s } from "react";
8
+ import c from "classnames";
9
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
+ //#region src/components/data-display/PivotTable/PivotTable.tsx
11
+ var d = o.forwardRef(({ rows: d, columns: f, getValue: p, rowAxisLabel: m, caption: h, columnSubtotals: g = !1, totalRow: _ = !1, totalColumn: v = !1, labels: y, className: b, ...x }, S) => {
12
+ let { t: C } = e("components"), w = o.useId(), T = y?.total ?? C("pivottable.total"), E = s(() => r(f, {
13
+ subtotals: g,
14
+ total: v
15
+ }), [
16
+ f,
17
+ g,
18
+ v
19
+ ]), D = s(() => i(d), [d]), O = m != null && m !== !1, k = `${w}corner`, A = (e) => `${w}c${e}`, j = (e) => `${w}r${e}`, M = `${w}total`, N = s(() => E.columns.map((e) => e.headerIds.map((e) => `${w}c${e}`).join(" ")), [E, w]), P = o.useRef(null), F = o.useRef(null), [I, L] = o.useState(!1);
20
+ o.useLayoutEffect(() => {
21
+ let e = P.current, t = F.current;
22
+ if (!e || !t || typeof ResizeObserver > "u") return;
23
+ let n = () => L(e.scrollWidth > e.clientWidth);
24
+ n();
25
+ let r = new ResizeObserver(n);
26
+ return r.observe(e), r.observe(t), () => r.disconnect();
27
+ }, []);
28
+ let R = t(S, F), z = `${w}caption`, B = h ? { "aria-labelledby": z } : x["aria-label"] ? { "aria-label": x["aria-label"] } : x["aria-labelledby"] ? { "aria-labelledby": x["aria-labelledby"] } : null;
29
+ return /* @__PURE__ */ l("div", {
30
+ ref: P,
31
+ className: a.scroller,
32
+ tabIndex: I ? 0 : void 0,
33
+ ...I && B ? {
34
+ role: "region",
35
+ ...B
36
+ } : null,
37
+ children: /* @__PURE__ */ u("table", {
38
+ ref: R,
39
+ className: c("wim-pivot-table", a.root, b),
40
+ ...x,
41
+ children: [
42
+ h && /* @__PURE__ */ l("caption", {
43
+ id: z,
44
+ className: a.caption,
45
+ children: h
46
+ }),
47
+ /* @__PURE__ */ l("colgroup", {}),
48
+ E.groupSpans.map((e, t) => /* @__PURE__ */ l("colgroup", { span: e }, t)),
49
+ /* @__PURE__ */ l(n.Header, { children: E.headerRows.map((e, t) => /* @__PURE__ */ u("tr", { children: [t === 0 && (O ? /* @__PURE__ */ l("th", {
50
+ id: k,
51
+ scope: "col",
52
+ rowSpan: E.depth,
53
+ className: c(a.columnHeader, a.corner, a.bottom),
54
+ children: m
55
+ }) : /* @__PURE__ */ l("td", {
56
+ rowSpan: E.depth,
57
+ className: c(a.columnHeader, a.bottom)
58
+ })), e.map((e) => /* @__PURE__ */ l("th", {
59
+ id: A(e.id),
60
+ scope: e.kind === "group" && e.topLevel ? "colgroup" : "col",
61
+ colSpan: e.colSpan > 1 ? e.colSpan : void 0,
62
+ rowSpan: e.rowSpan > 1 ? e.rowSpan : void 0,
63
+ className: c(a.columnHeader, e.kind === "group" && a.group, e.reachesBottom && a.bottom, e.startsGroup && a.groupStart),
64
+ children: e.kind === "group" || e.kind === "leaf" ? e.node?.label : T
65
+ }, e.id))] }, t)) }),
66
+ /* @__PURE__ */ l(n.Body, { children: D.map((e, t) => {
67
+ let r = [...e.ancestors.map(j), j(t)].join(" "), i = [...O ? [k] : [], ...e.ancestors.map(j)].join(" ");
68
+ return /* @__PURE__ */ u(n.Row, {
69
+ className: c(e.hasChildren && a.groupRow),
70
+ children: [/* @__PURE__ */ l("th", {
71
+ id: j(t),
72
+ scope: "row",
73
+ headers: i || void 0,
74
+ className: a.rowHeader,
75
+ style: { "--wim-pivot-table-depth": e.depth },
76
+ children: e.node.label
77
+ }), E.columns.map((t, i) => /* @__PURE__ */ l(n.Cell, {
78
+ headers: `${r} ${N[i]}`,
79
+ className: c(a.value, t.kind !== "leaf" && a.aggregate, t.startsGroup && a.groupStart),
80
+ children: p(e.key, t.key)
81
+ }, i))]
82
+ }, e.key);
83
+ }) }),
84
+ _ && /* @__PURE__ */ l(n.Footer, { children: /* @__PURE__ */ u(n.Row, {
85
+ className: a.totalRow,
86
+ children: [/* @__PURE__ */ l("th", {
87
+ id: M,
88
+ scope: "row",
89
+ headers: O ? k : void 0,
90
+ className: a.rowHeader,
91
+ children: T
92
+ }), E.columns.map((e, t) => /* @__PURE__ */ l(n.Cell, {
93
+ headers: `${M} ${N[t]}`,
94
+ className: c(a.value, e.startsGroup && a.groupStart),
95
+ children: p(null, e.key)
96
+ }, t))]
97
+ }) })
98
+ ]
99
+ })
100
+ });
101
+ });
102
+ d.displayName = "PivotTable";
103
+ //#endregion
104
+ export { d as PivotTable };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var e=e=>!!e.children?.length,t=n=>n.reduce((n,r)=>Math.max(n,1+(e(r)?t(r.children):0)),0);function n(n,r={}){let i=Math.max(1,t(n)),a=Array.from({length:i},()=>[]),o=[],s=[],c=0,l=(e,t,n,r,s,l)=>{let u=c++,d=e?.key??null;a[n].push({id:u,key:d,node:e,kind:t,colSpan:1,rowSpan:i-n,reachesBottom:!0,startsGroup:l,topLevel:s}),o.push({key:d,kind:t,headerIds:[...r,u],startsGroup:l})},u=(t,n,i,o)=>{let s=n===0;if(!e(t))return l(t,`leaf`,n,i,s,o),1;let d={id:c++,key:t.key,node:t,kind:`group`,colSpan:0,rowSpan:1,reachesBottom:!1,startsGroup:o,topLevel:s};a[n].push(d);let f=[...i,d.id],p=0;return t.children.forEach((e,t)=>{p+=u(e,n+1,f,o&&t===0)}),r.subtotals&&(l(t,`subtotal`,n+1,f,!1,!1),p+=1),d.colSpan=p,p};for(let e of n)s.push(u(e,0,[],!0));return r.total&&(l(null,`total`,0,[],!0,!0),s.push(1)),{headerRows:a,columns:o,depth:i,groupSpans:s}}function r(t){let n=[],r=(t,i,a)=>{for(let o of t){let t=n.length,s=e(o);n.push({key:o.key,node:o,depth:i,hasChildren:s,ancestors:a}),s&&r(o.children,i+1,[...a,t])}};return r(t,0,[]),n}exports.layoutPivotColumns=n,exports.layoutPivotRows=r;
@@ -0,0 +1,62 @@
1
+ /** 軸の木の 1 節。ラベルなど、配置の計算に関係しない項目は型引数の側が持つ。 */
2
+ export type PivotAxisInput = {
3
+ key: string;
4
+ children?: PivotAxisInput[];
5
+ };
6
+ export type PivotHeaderKind = "group" | "leaf" | "subtotal" | "total";
7
+ /** 列見出しの 1 セル。`id` は軸の中で一意な連番で、`headers` 属性の組み立てに使う。 */
8
+ export type PivotHeaderCell<T extends PivotAxisInput = PivotAxisInput> = {
9
+ id: number;
10
+ /** 軸のキー。総計の列は `null`。小計の列は、まとめているグループのキー。 */
11
+ key: string | null;
12
+ /** 元の節。総計の列は `null`。小計の列は、まとめているグループの節。 */
13
+ node: T | null;
14
+ kind: PivotHeaderKind;
15
+ colSpan: number;
16
+ rowSpan: number;
17
+ /** 見出しの最下段に届いているか(本文との境界の帯を描くセル)。 */
18
+ reachesBottom: boolean;
19
+ /** 最上位の節の先頭の列から始まるか(グループの境目)。 */
20
+ startsGroup: boolean;
21
+ /** 最上位の節か。`colgroup` と 1 対 1 に対応するのはこの段だけ。 */
22
+ topLevel: boolean;
23
+ };
24
+ /** 値を持つ 1 列。 */
25
+ export type PivotColumn = {
26
+ /** `getValue` に渡す列のキー。総計の列は `null`。 */
27
+ key: string | null;
28
+ kind: Exclude<PivotHeaderKind, "group">;
29
+ /** この列に掛かる見出しのセルの `id`(上の段から順)。 */
30
+ headerIds: number[];
31
+ startsGroup: boolean;
32
+ };
33
+ export type PivotColumnLayout<T extends PivotAxisInput = PivotAxisInput> = {
34
+ /** 見出しの段ごとのセル(上の段から順・各段は左から順)。 */
35
+ headerRows: PivotHeaderCell<T>[][];
36
+ columns: PivotColumn[];
37
+ /** 見出しの段の数(列の軸が空でも 1)。 */
38
+ depth: number;
39
+ /** 最上位の節ごとの列の数。`colgroup` の `span` に使う。 */
40
+ groupSpans: number[];
41
+ };
42
+ export type PivotRow<T extends PivotAxisInput = PivotAxisInput> = {
43
+ key: string;
44
+ node: T;
45
+ depth: number;
46
+ hasChildren: boolean;
47
+ /** 祖先の行の番号(返り値の配列の中の位置。根から順)。 */
48
+ ancestors: number[];
49
+ };
50
+ /**
51
+ * 列の軸の木を、見出しの段(`colSpan` / `rowSpan` 付き)と値の列の並びにする。
52
+ *
53
+ * - 葉は、自分の段から最下段まで縦に伸びる(木の深さが揃っていなくても段がずれない)
54
+ * - `subtotals` を付けると、グループごとに子の後ろへ小計の列を 1 本足す
55
+ * - `total` を付けると、右端に総計の列を 1 本足す
56
+ */
57
+ export declare function layoutPivotColumns<T extends PivotAxisInput>(nodes: T[], options?: {
58
+ subtotals?: boolean;
59
+ total?: boolean;
60
+ }): PivotColumnLayout<T>;
61
+ /** 行の軸の木を、深さ優先で 1 行ずつに並べる(アウトライン形式: グループも 1 行を持つ)。 */
62
+ export declare function layoutPivotRows<T extends PivotAxisInput>(nodes: T[]): PivotRow<T>[];
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ //#region src/components/data-display/PivotTable/layoutPivot.ts
3
+ var e = (e) => !!e.children?.length, t = (n) => n.reduce((n, r) => Math.max(n, 1 + (e(r) ? t(r.children) : 0)), 0);
4
+ function n(n, r = {}) {
5
+ let i = Math.max(1, t(n)), a = Array.from({ length: i }, () => []), o = [], s = [], c = 0, l = (e, t, n, r, s, l) => {
6
+ let u = c++, d = e?.key ?? null;
7
+ a[n].push({
8
+ id: u,
9
+ key: d,
10
+ node: e,
11
+ kind: t,
12
+ colSpan: 1,
13
+ rowSpan: i - n,
14
+ reachesBottom: !0,
15
+ startsGroup: l,
16
+ topLevel: s
17
+ }), o.push({
18
+ key: d,
19
+ kind: t,
20
+ headerIds: [...r, u],
21
+ startsGroup: l
22
+ });
23
+ }, u = (t, n, i, o) => {
24
+ let s = n === 0;
25
+ if (!e(t)) return l(t, "leaf", n, i, s, o), 1;
26
+ let d = {
27
+ id: c++,
28
+ key: t.key,
29
+ node: t,
30
+ kind: "group",
31
+ colSpan: 0,
32
+ rowSpan: 1,
33
+ reachesBottom: !1,
34
+ startsGroup: o,
35
+ topLevel: s
36
+ };
37
+ a[n].push(d);
38
+ let f = [...i, d.id], p = 0;
39
+ return t.children.forEach((e, t) => {
40
+ p += u(e, n + 1, f, o && t === 0);
41
+ }), r.subtotals && (l(t, "subtotal", n + 1, f, !1, !1), p += 1), d.colSpan = p, p;
42
+ };
43
+ for (let e of n) s.push(u(e, 0, [], !0));
44
+ return r.total && (l(null, "total", 0, [], !0, !0), s.push(1)), {
45
+ headerRows: a,
46
+ columns: o,
47
+ depth: i,
48
+ groupSpans: s
49
+ };
50
+ }
51
+ function r(t) {
52
+ let n = [], r = (t, i, a) => {
53
+ for (let o of t) {
54
+ let t = n.length, s = e(o);
55
+ n.push({
56
+ key: o.key,
57
+ node: o,
58
+ depth: i,
59
+ hasChildren: s,
60
+ ancestors: a
61
+ }), s && r(o.children, i + 1, [...a, t]);
62
+ }
63
+ };
64
+ return r(t, 0, []), n;
65
+ }
66
+ //#endregion
67
+ export { n as layoutPivotColumns, r as layoutPivotRows };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var e=`_scroller_x2q1s_7`,t=`_root_x2q1s_20`,n=`_caption_x2q1s_27`,r=`_columnHeader_x2q1s_34`,i=`_group_x2q1s_48`,a=`_bottom_x2q1s_56`,o=`_corner_x2q1s_60`,s=`_rowHeader_x2q1s_63`,c=`_value_x2q1s_72`,l=`_groupRow_x2q1s_77`,u=`_aggregate_x2q1s_82`,d=`_groupStart_x2q1s_86`,f=`_totalRow_x2q1s_89`,p={scroller:e,root:t,caption:n,columnHeader:r,group:i,bottom:a,corner:o,rowHeader:s,value:c,groupRow:l,aggregate:u,groupStart:d,totalRow:f};exports.aggregate=u,exports.bottom=a,exports.caption=n,exports.columnHeader=r,exports.corner=o,exports.default=p,exports.group=i,exports.groupRow=l,exports.groupStart=d,exports.root=t,exports.rowHeader=s,exports.scroller=e,exports.totalRow=f,exports.value=c;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ //#region src/components/data-display/PivotTable/pivot-table.module.scss
3
+ var e = "_scroller_x2q1s_7", t = "_root_x2q1s_20", n = "_caption_x2q1s_27", r = "_columnHeader_x2q1s_34", i = "_group_x2q1s_48", a = "_bottom_x2q1s_56", o = "_corner_x2q1s_60", s = "_rowHeader_x2q1s_63", c = "_value_x2q1s_72", l = "_groupRow_x2q1s_77", u = "_aggregate_x2q1s_82", d = "_groupStart_x2q1s_86", f = "_totalRow_x2q1s_89", p = {
4
+ scroller: e,
5
+ root: t,
6
+ caption: n,
7
+ columnHeader: r,
8
+ group: i,
9
+ bottom: a,
10
+ corner: o,
11
+ rowHeader: s,
12
+ value: c,
13
+ groupRow: l,
14
+ aggregate: u,
15
+ groupStart: d,
16
+ totalRow: f
17
+ };
18
+ //#endregion
19
+ export { u as aggregate, a as bottom, n as caption, r as columnHeader, o as corner, p as default, i as group, l as groupRow, d as groupStart, t as root, s as rowHeader, e as scroller, f as totalRow, c as value };
@@ -19,6 +19,7 @@ export * from './components/data-display/Tag/Tag';
19
19
  export * from './components/data-display/Timeline/Timeline';
20
20
  export * from './components/data-display/TreeView/TreeView';
21
21
  export * from './components/data-display/TreeDiagram/TreeDiagram';
22
+ export * from './components/data-display/PivotTable/PivotTable';
22
23
  export * from './components/data-display/VirtualList/VirtualList';
23
24
  export * from './components/data-display/FAQSection/FAQSection';
24
25
  export * from './components/data-display/InfiniteScroll/InfiniteScroll';
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./components/data-display/Card/Card.cjs"),t=require("./components/data-display/Badge/Badge.cjs"),n=require("./components/data-display/Calendar/Calendar.cjs"),r=require("./components/data-display/Chip/Chip.cjs"),i=require("./components/data-display/VirtualList/VirtualList.cjs"),a=require("./components/data-display/TreeView/TreeView.cjs"),o=require("./components/data-display/Tag/Tag.cjs"),s=require("./components/data-display/Accordion/Accordion.cjs"),c=require("./components/data-display/Avatar/Avatar.cjs"),l=require("./components/data-display/AvatarGroup/AvatarGroup.cjs"),u=require("./components/data-display/Calendar/RangeCalendar.cjs"),d=require("./components/data-display/Carousel/Carousel.cjs"),f=require("./components/data-display/Table/useTableSort.cjs"),p=require("./components/data-display/Table/Table.cjs"),m=require("./components/data-display/DataGrid/DataGrid.cjs"),h=require("./components/data-display/DescriptionList/DescriptionList.cjs"),g=require("./components/data-display/EmptyState/EmptyState.cjs"),_=require("./components/data-display/Kanban/Kanban.cjs"),v=require("./components/data-display/List/List.cjs"),y=require("./components/data-display/Marquee/Marquee.cjs"),b=require("./components/data-display/Stats/Stats.cjs"),x=require("./components/data-display/Timeline/Timeline.cjs"),S=require("./components/data-display/TreeDiagram/TreeDiagram.cjs"),C=require("./components/data-display/FAQSection/FAQSection.cjs"),w=require("./components/data-display/InfiniteScroll/InfiniteScroll.cjs"),T=require("./components/data-display/SortableList/SortableList.cjs"),E=require("./components/data-display/SwipeAction/SwipeableList.cjs"),D=require("./components/data-display/SwipeAction/SwipeAction.cjs"),O=require("./components/data-display/PullToRefresh/PullToRefresh.cjs"),k=require("./components/data-display/JsonViewer/JsonViewer.cjs"),A=require("./components/data-display/CalendarHeatmap/CalendarHeatmap.cjs"),j=require("./components/data-display/Reaction/Reaction.cjs"),M=require("./components/data-display/Leaderboard/Leaderboard.cjs"),N=require("./components/data-display/RelativeTime/RelativeTime.cjs"),P=require("./components/data-display/Comment/Comment.cjs"),F=require("./components/data-display/Countdown/Countdown.cjs"),I=require("./components/data-display/Presence/Presence.cjs"),L=require("./components/data-display/Barcode/Barcode.cjs");exports.Accordion=s.Accordion,exports.AccordionContent=s.AccordionContent,exports.AccordionItem=s.AccordionItem,exports.AccordionTrigger=s.AccordionTrigger,exports.Avatar=c.Avatar,exports.AvatarGroup=l.AvatarGroup,exports.Badge=t.Badge,exports.Barcode=L.Barcode,exports.Calendar=n.Calendar,exports.CalendarHeatmap=A.CalendarHeatmap,exports.Card=e.Card,exports.CardBody=e.CardBody,exports.CardFooter=e.CardFooter,exports.CardHeader=e.CardHeader,exports.Carousel=d.Carousel,exports.Chip=r.Chip,exports.Comment=P.Comment,exports.Countdown=F.Countdown,exports.DataGrid=m.DataGrid,exports.DescriptionList=h.DescriptionList,exports.DescriptionListDetails=h.DescriptionListDetails,exports.DescriptionListItem=h.DescriptionListItem,exports.DescriptionListTerm=h.DescriptionListTerm,exports.EmptyState=g.EmptyState,exports.FAQSection=C.FAQSection,exports.InfiniteScroll=w.InfiniteScroll,exports.JsonViewer=k.JsonViewer,exports.Kanban=_.Kanban,exports.KanbanBoard=_.KanbanBoard,exports.KanbanCard=_.KanbanCard,exports.KanbanColumn=_.KanbanColumn,exports.Leaderboard=M.Leaderboard,exports.List=v.List,exports.ListItem=v.ListItem,exports.Marquee=y.Marquee,exports.Presence=I.Presence,exports.PullToRefresh=O.PullToRefresh,exports.RangeCalendar=u.RangeCalendar,exports.Reaction=j.Reaction,exports.RelativeTime=N.RelativeTime,exports.SortableList=T.SortableList,exports.SortableListDragHandle=T.SortableListDragHandle,exports.SortableListItem=T.SortableListItem,exports.Stats=b.Stats,exports.StatsDescription=b.StatsDescription,exports.StatsLabel=b.StatsLabel,exports.StatsTrend=b.StatsTrend,exports.StatsValue=b.StatsValue,exports.SwipeAction=D.SwipeAction,exports.SwipeableList=E.SwipeableList,exports.Table=p.Table,exports.TableBody=p.TableBody,exports.TableCell=p.TableCell,exports.TableFooter=p.TableFooter,exports.TableHead=p.TableHead,exports.TableHeader=p.TableHeader,exports.TableRow=p.TableRow,exports.Tag=o.Tag,exports.Timeline=x.Timeline,exports.TimelineConnector=x.TimelineConnector,exports.TimelineContent=x.TimelineContent,exports.TimelineItem=x.TimelineItem,exports.TimelineOppositeContent=x.TimelineOppositeContent,exports.TimelinePoint=x.TimelinePoint,exports.TimelineSeparator=x.TimelineSeparator,exports.TreeDiagram=S.TreeDiagram,exports.TreeView=a.TreeView,exports.TreeViewItem=a.TreeViewItem,exports.VirtualList=i.VirtualList,exports.getNextSortDirection=f.getNextSortDirection,exports.useTableSort=f.useTableSort;
2
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./components/data-display/Card/Card.cjs"),t=require("./components/data-display/Badge/Badge.cjs"),n=require("./components/data-display/Calendar/Calendar.cjs"),r=require("./components/data-display/Chip/Chip.cjs"),i=require("./components/data-display/VirtualList/VirtualList.cjs"),a=require("./components/data-display/TreeView/TreeView.cjs"),o=require("./components/data-display/Tag/Tag.cjs"),s=require("./components/data-display/Accordion/Accordion.cjs"),c=require("./components/data-display/Avatar/Avatar.cjs"),l=require("./components/data-display/AvatarGroup/AvatarGroup.cjs"),u=require("./components/data-display/Calendar/RangeCalendar.cjs"),d=require("./components/data-display/Carousel/Carousel.cjs"),f=require("./components/data-display/Table/useTableSort.cjs"),p=require("./components/data-display/Table/Table.cjs"),m=require("./components/data-display/DataGrid/DataGrid.cjs"),h=require("./components/data-display/DescriptionList/DescriptionList.cjs"),g=require("./components/data-display/EmptyState/EmptyState.cjs"),_=require("./components/data-display/Kanban/Kanban.cjs"),v=require("./components/data-display/List/List.cjs"),y=require("./components/data-display/Marquee/Marquee.cjs"),b=require("./components/data-display/Stats/Stats.cjs"),x=require("./components/data-display/Timeline/Timeline.cjs"),S=require("./components/data-display/TreeDiagram/TreeDiagram.cjs"),C=require("./components/data-display/PivotTable/PivotTable.cjs"),w=require("./components/data-display/FAQSection/FAQSection.cjs"),T=require("./components/data-display/InfiniteScroll/InfiniteScroll.cjs"),E=require("./components/data-display/SortableList/SortableList.cjs"),D=require("./components/data-display/SwipeAction/SwipeableList.cjs"),O=require("./components/data-display/SwipeAction/SwipeAction.cjs"),k=require("./components/data-display/PullToRefresh/PullToRefresh.cjs"),A=require("./components/data-display/JsonViewer/JsonViewer.cjs"),j=require("./components/data-display/CalendarHeatmap/CalendarHeatmap.cjs"),M=require("./components/data-display/Reaction/Reaction.cjs"),N=require("./components/data-display/Leaderboard/Leaderboard.cjs"),P=require("./components/data-display/RelativeTime/RelativeTime.cjs"),F=require("./components/data-display/Comment/Comment.cjs"),I=require("./components/data-display/Countdown/Countdown.cjs"),L=require("./components/data-display/Presence/Presence.cjs"),R=require("./components/data-display/Barcode/Barcode.cjs");exports.Accordion=s.Accordion,exports.AccordionContent=s.AccordionContent,exports.AccordionItem=s.AccordionItem,exports.AccordionTrigger=s.AccordionTrigger,exports.Avatar=c.Avatar,exports.AvatarGroup=l.AvatarGroup,exports.Badge=t.Badge,exports.Barcode=R.Barcode,exports.Calendar=n.Calendar,exports.CalendarHeatmap=j.CalendarHeatmap,exports.Card=e.Card,exports.CardBody=e.CardBody,exports.CardFooter=e.CardFooter,exports.CardHeader=e.CardHeader,exports.Carousel=d.Carousel,exports.Chip=r.Chip,exports.Comment=F.Comment,exports.Countdown=I.Countdown,exports.DataGrid=m.DataGrid,exports.DescriptionList=h.DescriptionList,exports.DescriptionListDetails=h.DescriptionListDetails,exports.DescriptionListItem=h.DescriptionListItem,exports.DescriptionListTerm=h.DescriptionListTerm,exports.EmptyState=g.EmptyState,exports.FAQSection=w.FAQSection,exports.InfiniteScroll=T.InfiniteScroll,exports.JsonViewer=A.JsonViewer,exports.Kanban=_.Kanban,exports.KanbanBoard=_.KanbanBoard,exports.KanbanCard=_.KanbanCard,exports.KanbanColumn=_.KanbanColumn,exports.Leaderboard=N.Leaderboard,exports.List=v.List,exports.ListItem=v.ListItem,exports.Marquee=y.Marquee,exports.PivotTable=C.PivotTable,exports.Presence=L.Presence,exports.PullToRefresh=k.PullToRefresh,exports.RangeCalendar=u.RangeCalendar,exports.Reaction=M.Reaction,exports.RelativeTime=P.RelativeTime,exports.SortableList=E.SortableList,exports.SortableListDragHandle=E.SortableListDragHandle,exports.SortableListItem=E.SortableListItem,exports.Stats=b.Stats,exports.StatsDescription=b.StatsDescription,exports.StatsLabel=b.StatsLabel,exports.StatsTrend=b.StatsTrend,exports.StatsValue=b.StatsValue,exports.SwipeAction=O.SwipeAction,exports.SwipeableList=D.SwipeableList,exports.Table=p.Table,exports.TableBody=p.TableBody,exports.TableCell=p.TableCell,exports.TableFooter=p.TableFooter,exports.TableHead=p.TableHead,exports.TableHeader=p.TableHeader,exports.TableRow=p.TableRow,exports.Tag=o.Tag,exports.Timeline=x.Timeline,exports.TimelineConnector=x.TimelineConnector,exports.TimelineContent=x.TimelineContent,exports.TimelineItem=x.TimelineItem,exports.TimelineOppositeContent=x.TimelineOppositeContent,exports.TimelinePoint=x.TimelinePoint,exports.TimelineSeparator=x.TimelineSeparator,exports.TreeDiagram=S.TreeDiagram,exports.TreeView=a.TreeView,exports.TreeViewItem=a.TreeViewItem,exports.VirtualList=i.VirtualList,exports.getNextSortDirection=f.getNextSortDirection,exports.useTableSort=f.useTableSort;
@@ -22,19 +22,20 @@ import { Marquee as B } from "./components/data-display/Marquee/Marquee.js";
22
22
  import { Stats as V, StatsDescription as H, StatsLabel as U, StatsTrend as W, StatsValue as G } from "./components/data-display/Stats/Stats.js";
23
23
  import { Timeline as K, TimelineConnector as q, TimelineContent as J, TimelineItem as Y, TimelineOppositeContent as X, TimelinePoint as Z, TimelineSeparator as Q } from "./components/data-display/Timeline/Timeline.js";
24
24
  import { TreeDiagram as $ } from "./components/data-display/TreeDiagram/TreeDiagram.js";
25
- import { FAQSection as ee } from "./components/data-display/FAQSection/FAQSection.js";
26
- import { InfiniteScroll as te } from "./components/data-display/InfiniteScroll/InfiniteScroll.js";
27
- import { SortableList as ne, SortableListDragHandle as re, SortableListItem as ie } from "./components/data-display/SortableList/SortableList.js";
28
- import { SwipeableList as ae } from "./components/data-display/SwipeAction/SwipeableList.js";
29
- import { SwipeAction as oe } from "./components/data-display/SwipeAction/SwipeAction.js";
30
- import { PullToRefresh as se } from "./components/data-display/PullToRefresh/PullToRefresh.js";
31
- import { JsonViewer as ce } from "./components/data-display/JsonViewer/JsonViewer.js";
32
- import { CalendarHeatmap as le } from "./components/data-display/CalendarHeatmap/CalendarHeatmap.js";
33
- import { Reaction as ue } from "./components/data-display/Reaction/Reaction.js";
34
- import { Leaderboard as de } from "./components/data-display/Leaderboard/Leaderboard.js";
35
- import { RelativeTime as fe } from "./components/data-display/RelativeTime/RelativeTime.js";
36
- import { Comment as pe } from "./components/data-display/Comment/Comment.js";
37
- import { Countdown as me } from "./components/data-display/Countdown/Countdown.js";
38
- import { Presence as he } from "./components/data-display/Presence/Presence.js";
39
- import { Barcode as ge } from "./components/data-display/Barcode/Barcode.js";
40
- export { d as Accordion, f as AccordionContent, p as AccordionItem, m as AccordionTrigger, h as Avatar, g as AvatarGroup, i as Badge, ge as Barcode, a as Calendar, le as CalendarHeatmap, e as Card, t as CardBody, n as CardFooter, r as CardHeader, v as Carousel, o as Chip, pe as Comment, me as Countdown, O as DataGrid, k as DescriptionList, A as DescriptionListDetails, j as DescriptionListItem, M as DescriptionListTerm, N as EmptyState, ee as FAQSection, te as InfiniteScroll, ce as JsonViewer, P as Kanban, F as KanbanBoard, I as KanbanCard, L as KanbanColumn, de as Leaderboard, R as List, z as ListItem, B as Marquee, he as Presence, se as PullToRefresh, _ as RangeCalendar, ue as Reaction, fe as RelativeTime, ne as SortableList, re as SortableListDragHandle, ie as SortableListItem, V as Stats, H as StatsDescription, U as StatsLabel, W as StatsTrend, G as StatsValue, oe as SwipeAction, ae as SwipeableList, x as Table, S as TableBody, C as TableCell, w as TableFooter, T as TableHead, E as TableHeader, D as TableRow, u as Tag, K as Timeline, q as TimelineConnector, J as TimelineContent, Y as TimelineItem, X as TimelineOppositeContent, Z as TimelinePoint, Q as TimelineSeparator, $ as TreeDiagram, c as TreeView, l as TreeViewItem, s as VirtualList, y as getNextSortDirection, b as useTableSort };
25
+ import { PivotTable as ee } from "./components/data-display/PivotTable/PivotTable.js";
26
+ import { FAQSection as te } from "./components/data-display/FAQSection/FAQSection.js";
27
+ import { InfiniteScroll as ne } from "./components/data-display/InfiniteScroll/InfiniteScroll.js";
28
+ import { SortableList as re, SortableListDragHandle as ie, SortableListItem as ae } from "./components/data-display/SortableList/SortableList.js";
29
+ import { SwipeableList as oe } from "./components/data-display/SwipeAction/SwipeableList.js";
30
+ import { SwipeAction as se } from "./components/data-display/SwipeAction/SwipeAction.js";
31
+ import { PullToRefresh as ce } from "./components/data-display/PullToRefresh/PullToRefresh.js";
32
+ import { JsonViewer as le } from "./components/data-display/JsonViewer/JsonViewer.js";
33
+ import { CalendarHeatmap as ue } from "./components/data-display/CalendarHeatmap/CalendarHeatmap.js";
34
+ import { Reaction as de } from "./components/data-display/Reaction/Reaction.js";
35
+ import { Leaderboard as fe } from "./components/data-display/Leaderboard/Leaderboard.js";
36
+ import { RelativeTime as pe } from "./components/data-display/RelativeTime/RelativeTime.js";
37
+ import { Comment as me } from "./components/data-display/Comment/Comment.js";
38
+ import { Countdown as he } from "./components/data-display/Countdown/Countdown.js";
39
+ import { Presence as ge } from "./components/data-display/Presence/Presence.js";
40
+ import { Barcode as _e } from "./components/data-display/Barcode/Barcode.js";
41
+ export { d as Accordion, f as AccordionContent, p as AccordionItem, m as AccordionTrigger, h as Avatar, g as AvatarGroup, i as Badge, _e as Barcode, a as Calendar, ue as CalendarHeatmap, e as Card, t as CardBody, n as CardFooter, r as CardHeader, v as Carousel, o as Chip, me as Comment, he as Countdown, O as DataGrid, k as DescriptionList, A as DescriptionListDetails, j as DescriptionListItem, M as DescriptionListTerm, N as EmptyState, te as FAQSection, ne as InfiniteScroll, le as JsonViewer, P as Kanban, F as KanbanBoard, I as KanbanCard, L as KanbanColumn, fe as Leaderboard, R as List, z as ListItem, B as Marquee, ee as PivotTable, ge as Presence, ce as PullToRefresh, _ as RangeCalendar, de as Reaction, pe as RelativeTime, re as SortableList, ie as SortableListDragHandle, ae as SortableListItem, V as Stats, H as StatsDescription, U as StatsLabel, W as StatsTrend, G as StatsValue, se as SwipeAction, oe as SwipeableList, x as Table, S as TableBody, C as TableCell, w as TableFooter, T as TableHead, E as TableHeader, D as TableRow, u as Tag, K as Timeline, q as TimelineConnector, J as TimelineContent, Y as TimelineItem, X as TimelineOppositeContent, Z as TimelinePoint, Q as TimelineSeparator, $ as TreeDiagram, c as TreeView, l as TreeViewItem, s as VirtualList, y as getNextSortDirection, b as useTableSort };