@ex-grid/pivot-react 0.0.0-stage → 0.2.0-rc.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AkiraMisawa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,43 @@
1
- # Temporary Holding Version
1
+ # @ex-grid/pivot-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ExPivot for React: the Framework Adapter of ExPivot's Script Core, which mounts Excel's PivotTable, drawn by ExGrid, in a React tree.
4
+
5
+ It is one of the packages of the ExGrid family: Excel-like grids, sheets, pivot tables and charts for reading
6
+ money and risk numbers, published to npm under `@ex-grid` and to NuGet for Blazor, at one shared version.
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install @ex-grid/pivot-react react react-dom
12
+ ```
13
+
14
+ `react` and `react-dom` are peer dependencies: your application provides them, at the versions `package.json` names.
15
+
16
+ It depends on exactly the version of `@ex-grid/pivot` and `@ex-grid/react` it was built with, so upgrade the family's packages together.
17
+
18
+ What it draws reads these stylesheets. Import them once in your application:
19
+
20
+ ```ts
21
+ import '@ex-grid/core/styles.css';
22
+ import '@ex-grid/pivot/styles.css';
23
+ ```
24
+
25
+ ## Documentation
26
+
27
+ [ExPivot on the documentation site](https://akiramisawa.github.io/ex-grid/expivot), read for React with the switch at the top, and every
28
+ version's [Release Notes](https://akiramisawa.github.io/ex-grid/release-notes).
29
+
30
+ > **The API may still change.** While the version is `0.x`, it may change from one version to the next; each
31
+ > version's Release Notes say what changed. A prerelease, a version with a suffix such as `-rc.1`, passed every
32
+ > test layer in CI on the commit it was built from. A version without a suffix is published only once the
33
+ > project's [Definition of Done](https://github.com/AkiraMisawa/ex-grid/blob/main/docs/definition-of-done.md) is
34
+ > signed off on it.
35
+
36
+ ## Requirements
37
+
38
+ - **Chrome or Edge.** They are the supported browsers; Safari and Firefox are out of scope.
39
+ - **React 19.0.0 or a later 19.x.**
40
+
41
+ ## License
42
+
43
+ MIT
@@ -0,0 +1,167 @@
1
+ /**
2
+ * ExPivot for React: the Framework Adapter of ExPivot's Script Core (ADR-0370). `ExPivot` renders the element
3
+ * the pivot draws into and hands it its props; everything the pivot shows and decides is the Script Core's.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+
8
+ import { ChromeMountsMade } from '@ex-grid/react';
9
+ import { ExGridChrome } from '@ex-grid/react';
10
+ import { GridPortals } from '@ex-grid/react';
11
+ import type { PivotChrome } from '@ex-grid/pivot';
12
+ import type { PivotDetailsDialogSlotContext } from '@ex-grid/pivot';
13
+ import type { PivotDetailsTabsSlotContext } from '@ex-grid/pivot';
14
+ import type { PivotFieldListSlotContext } from '@ex-grid/pivot';
15
+ import type { PivotFieldSettingsSlotContext } from '@ex-grid/pivot';
16
+ import type { PivotItemFilterSlotContext } from '@ex-grid/pivot';
17
+ import type { PivotMenuSlotContext } from '@ex-grid/pivot';
18
+ import type { PivotMenuView } from '@ex-grid/pivot';
19
+ import type { PivotPanelSlotContext } from '@ex-grid/pivot';
20
+ import type { PivotReportFiltersSlotContext } from '@ex-grid/pivot';
21
+ import type { PivotStaleReportSlotContext } from '@ex-grid/pivot';
22
+ import type { PivotStandingSlotContext } from '@ex-grid/pivot';
23
+ import type { PivotToolbarSlotContext } from '@ex-grid/pivot';
24
+ import type { PivotValueFieldSettingsSlotContext } from '@ex-grid/pivot';
25
+ import { PivotViewOptions } from '@ex-grid/pivot';
26
+ import { ReactElement } from 'react';
27
+ import { ReactNode } from 'react';
28
+
29
+ /**
30
+ * Excel's PivotTable, drawn by ExGrid, beside its Field List. The element it renders is the pivot's root,
31
+ * which the Script Core owns; every render hands the core the props again, and what did not change asks
32
+ * nothing again.
33
+ */
34
+ export declare function ExPivot(props: ExPivotProps): ReactElement;
35
+
36
+ /**
37
+ * The Chrome slots an ExPivot takes, each a render function of what the pivot hands that slot (ADR-0390 section 3),
38
+ * and `grid`, ExGrid's own, which dresses the report's grid and Show Details' grids. A slot not given is drawn by the
39
+ * built-in markup. A render function is read when its part opens; its answer is rendered as a component of its own,
40
+ * so it may hold state, kept while the part stands, and a hook belongs in a component it renders.
41
+ */
42
+ export declare interface ExPivotChrome {
43
+ /** ExGrid's Chrome for the report's grid and Show Details' grids; the Context Menu's commands are worded by the
44
+ * pivot. */
45
+ readonly grid?: ExGridChrome<unknown>;
46
+ /** A placed field's menu and the Layout menu, drawn with {@link usePivotMenu}. */
47
+ readonly menu?: (context: PivotMenuSlotContext) => ReactNode;
48
+ /** Filter…, drawn with {@link usePivotPanel}. */
49
+ readonly itemFilter?: (context: PivotItemFilterSlotContext) => ReactNode;
50
+ /** Field Settings…, drawn with {@link usePivotPanel}. */
51
+ readonly fieldSettings?: (context: PivotFieldSettingsSlotContext) => ReactNode;
52
+ /** Value Field Settings…, drawn with {@link usePivotPanel}. */
53
+ readonly valueFieldSettings?: (context: PivotValueFieldSettingsSlotContext) => ReactNode;
54
+ /** The Pivot Toolbar, drawn with {@link usePivotPart}. */
55
+ readonly toolbar?: (context: PivotToolbarSlotContext) => ReactNode;
56
+ /** The report filter band, drawn with {@link usePivotPart}. */
57
+ readonly reportFilters?: (context: PivotReportFiltersSlotContext) => ReactNode;
58
+ /** The Stale Report's notice, drawn with {@link usePivotPart}. */
59
+ readonly staleReport?: (context: PivotStaleReportSlotContext) => ReactNode;
60
+ /** The Field List, drawn with {@link usePivotPart}. */
61
+ readonly fieldList?: (context: PivotFieldListSlotContext) => ReactNode;
62
+ /** The sheet tabs at the report's foot, while Show Details' records stand in a tab, drawn with {@link usePivotPart}. */
63
+ readonly detailsTabs?: (context: PivotDetailsTabsSlotContext) => ReactNode;
64
+ /** What the Show Details dialog draws inside the pivot's frame, drawn with {@link usePivotPart}. */
65
+ readonly detailsDialog?: (context: PivotDetailsDialogSlotContext) => ReactNode;
66
+ }
67
+
68
+ /**
69
+ * An ExPivot's props: the Script Core's options, whole, its `chrome` as render functions. `locale` is the browser's
70
+ * language where not given, the first of its languages the pivot writes in, read once, the first time the pivot is
71
+ * given none (ADR-0370 section 10); the core never reads it on its own.
72
+ */
73
+ export declare type ExPivotProps = Omit<PivotViewOptions, 'chrome'> & {
74
+ /** The parts a Wrapper's Chrome, or the Consumer's own, draws in place of the built-in markup (ADR-0390). */
75
+ readonly chrome?: ExPivotChrome;
76
+ };
77
+
78
+ /**
79
+ * A design-system Wrapper's Chrome with the Consumer's `chrome` over it (ADR-0390): `pivot`, the Wrapper's pivot
80
+ * slots, and `grid`, its ExGrid Chrome for the report's grid, each slot the Consumer names in its place. A slot given
81
+ * as `undefined` leaves the Wrapper's, as one not named does. The grid's Chrome is the Wrapper's own object while the
82
+ * Consumer names none of its slots, so a Chrome handed again with only pivot slots does not dress the report's grid
83
+ * again. Every Wrapper of ExPivot lays its Chrome so, once per `given`.
84
+ */
85
+ export declare function layPivotChrome(pivot: Omit<ExPivotChrome, 'grid'>, grid: ExGridChrome<unknown>, given: ExPivotChrome | undefined): ExPivotChrome;
86
+
87
+ /** The ExPivot's Chrome as the pivot takes it: each slot's render function as a mount function rendering it through
88
+ * the ExPivot's portals, and `grid`'s as ExGrid for React makes its own. A render function handed again keeps its
89
+ * mount function. Which slots there are is the pivot's to check; a render function that is not a function is named
90
+ * here, in React's terms. Exported for the family's Framework Adapters, whose products hand ExPivot's Chrome on to the
91
+ * pivots they draw, not for a Consumer. */
92
+ export declare function pivotChromeMounts(given: ExPivotChrome | undefined, portals: GridPortals, made: PivotMountsMade): PivotChrome | undefined;
93
+
94
+ /** What {@link usePivotMenu} hands a menu's contents. */
95
+ export declare interface PivotMenuHandles {
96
+ /** What the menu shows now: its commands, in the pivot's order, with their group headings. */
97
+ readonly view: PivotMenuView;
98
+ /** The props of the command at `index` in the view's commands. */
99
+ readonly item: (index: number) => PivotMenuItemProps;
100
+ }
101
+
102
+ /** The props {@link usePivotMenu} hands each command's control: spread them onto it. */
103
+ export declare interface PivotMenuItemProps {
104
+ /** A choice is a `menuitemradio`, any other command a `menuitem`. */
105
+ readonly role: 'menuitem' | 'menuitemradio';
106
+ /** On a choice: whether it is the current one. */
107
+ readonly 'aria-checked'?: boolean;
108
+ /** Whether the command cannot run now; a disabled command is shown, never left out. */
109
+ readonly disabled: boolean;
110
+ /** Claims the click for the pivot's Input Order (ADR-0240). */
111
+ readonly 'data-ex-claims': 'click';
112
+ /** Runs the command the pivot drew last under this one's id. */
113
+ readonly onClick: () => void;
114
+ /** On the first enabled command: the one a request for the keyboard is for. */
115
+ readonly ref?: (control: HTMLElement | null) => void;
116
+ }
117
+
118
+ /** The mount functions made for an ExPivot's render functions: the pivot's slots', and the grid's. */
119
+ export declare interface PivotMountsMade {
120
+ /** The pivot's slots' render functions, and the mount function made for each, by slot. */
121
+ readonly pivot: Map<string, {
122
+ readonly render: unknown;
123
+ readonly mount: (slot: HTMLElement, context: unknown) => () => void;
124
+ }>;
125
+ /** The report grid's slots', as ExGrid for React makes them. */
126
+ readonly grid: ChromeMountsMade;
127
+ /** The report grid's Chrome last handed, and its mount functions. */
128
+ gridChrome?: {
129
+ readonly given: unknown;
130
+ readonly mounts: PivotChrome['grid'];
131
+ };
132
+ }
133
+
134
+ /** What {@link usePivotPanel} hands a panel's contents. */
135
+ export declare interface PivotPanelHandles<View> {
136
+ /** What the panel shows now, drawn again at each change the pivot makes to it. */
137
+ readonly view: View;
138
+ /** Takes the panel's first control: the one each request of the pivot's for the keyboard is for. */
139
+ readonly first: (control: HTMLElement | null) => void;
140
+ }
141
+
142
+ /**
143
+ * Draws a menu from its context (ADR-0390 section 3): one control per command, in the pivot's order, a choice as a
144
+ * `menuitemradio` marked while it is the current one. A press runs the command the pivot drew last under its id, and
145
+ * the first enabled command takes the keyboard at each request of the pivot's.
146
+ */
147
+ export declare function usePivotMenu(context: PivotMenuSlotContext): PivotMenuHandles;
148
+
149
+ /**
150
+ * Draws one of the pivot's panels from its context (ADR-0390 section 3): Filter…, Field Settings… or Value Field
151
+ * Settings…. The view is the pivot's draft, read again at each change; each choice goes to the context's setter, and
152
+ * the hook gives the panel's first control the keyboard at each request, once it is drawn, through the pivot.
153
+ */
154
+ export declare function usePivotPanel<View>(context: PivotPanelSlotContext & {
155
+ readonly view: () => View;
156
+ }): PivotPanelHandles<View>;
157
+
158
+ /**
159
+ * Draws one of the pivot's standing parts from its context (ADR-0390 section 3): the Pivot Toolbar, the report filter
160
+ * band, the Stale Report's notice or the Field List. The view is the pivot's, read again at each change; each press goes to the
161
+ * context's callback, and each control and anchor is handed in by its `ref`, `context.control(name)` and
162
+ * `context.anchor(name)`, so the pivot gives the keyboard to the control it means and places a popup's frame in its
163
+ * anchor itself.
164
+ */
165
+ export declare function usePivotPart<View>(context: PivotStandingSlotContext<View>): View;
166
+
167
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,160 @@
1
+ // src/ex-pivot.ts
2
+ import { createElement, Fragment, useLayoutEffect as useLayoutEffect2, useMemo, useRef as useRef2, useState as useState2 } from "react";
3
+ import { browserPivotLocale, createPivot } from "@ex-grid/pivot";
4
+ import { useGridPortals } from "@ex-grid/react";
5
+
6
+ // src/chrome.ts
7
+ import { useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
8
+ import { chromeMounts } from "@ex-grid/react";
9
+ function laid(under, over) {
10
+ return { ...under, ...Object.fromEntries(Object.entries(over).filter(([, slot]) => slot !== void 0)) };
11
+ }
12
+ function layPivotChrome(pivot, grid, given) {
13
+ if (given === void 0) return { ...pivot, grid };
14
+ const { grid: givenGrid, ...givenPivot } = given;
15
+ return { ...laid(pivot, givenPivot), grid: givenGrid === void 0 ? grid : laid(grid, givenGrid) };
16
+ }
17
+ var pivotSlots = [
18
+ "menu",
19
+ "itemFilter",
20
+ "fieldSettings",
21
+ "valueFieldSettings",
22
+ "toolbar",
23
+ "reportFilters",
24
+ "staleReport",
25
+ "fieldList",
26
+ "detailsTabs",
27
+ "detailsDialog"
28
+ ];
29
+ function pivotChromeMounts(given, portals, made) {
30
+ const chrome = given;
31
+ if (chrome === void 0) return void 0;
32
+ if (typeof chrome !== "object" || chrome === null) {
33
+ throw new TypeError("An ExPivot's chrome is an object of Chrome slots, each a render function of its context (ADR-0390).");
34
+ }
35
+ const mounts = {};
36
+ for (const entry of Object.entries(chrome)) {
37
+ const name = entry[0];
38
+ const render = entry[1];
39
+ if (render === void 0) continue;
40
+ if (name === "grid") {
41
+ let grid = made.gridChrome;
42
+ if (grid === void 0 || grid.given !== render) {
43
+ grid = { given: render, mounts: chromeMounts(render, portals, made.grid) };
44
+ made.gridChrome = grid;
45
+ }
46
+ mounts[name] = grid.mounts;
47
+ continue;
48
+ }
49
+ if (!pivotSlots.includes(name)) {
50
+ mounts[name] = render;
51
+ continue;
52
+ }
53
+ if (typeof render !== "function") throw new TypeError(`An ExPivot's chrome.${name} is a render function of the slot's context (ADR-0390).`);
54
+ const before = made.pivot.get(name);
55
+ if (before !== void 0 && before.render === render) {
56
+ mounts[name] = before.mount;
57
+ continue;
58
+ }
59
+ const mount = (slot, context) => portals.mount(slot, () => {
60
+ const node = Reflect.apply(render, void 0, [context]);
61
+ return node;
62
+ });
63
+ made.pivot.set(name, { render, mount });
64
+ mounts[name] = mount;
65
+ }
66
+ return mounts;
67
+ }
68
+ var answered = /* @__PURE__ */ new WeakSet();
69
+ function useViewedPart(context, what) {
70
+ const view = useSyncExternalStore(context.subscribe, context.view);
71
+ const control = useRef(null);
72
+ useLayoutEffect(() => {
73
+ if (context.focusRequest === 0 || answered.has(context)) return;
74
+ answered.add(context);
75
+ const target = control.current;
76
+ if (target === null) throw new Error(`The ${what} is not drawn: hand the hook's \`focus\` ref to it.`);
77
+ context.takeFocus(target);
78
+ }, [context, what]);
79
+ const [focus] = useState(() => (element) => {
80
+ control.current = element;
81
+ });
82
+ return { view, focus };
83
+ }
84
+ function usePivotPanel(context) {
85
+ const { view, focus } = useViewedPart(context, "panel's first control");
86
+ return { view, first: focus };
87
+ }
88
+ function usePivotPart(context) {
89
+ return useSyncExternalStore(context.subscribe, context.view);
90
+ }
91
+ function usePivotMenu(context) {
92
+ const { view, focus } = useViewedPart(context, "menu's first enabled command");
93
+ const first = view.commands.findIndex((command) => command.enabled);
94
+ return {
95
+ view,
96
+ item: (index) => {
97
+ const command = view.commands[index];
98
+ if (command === void 0) throw new RangeError(`The menu has ${view.commands.length} commands, not one at ${index}.`);
99
+ return {
100
+ role: command.checked === void 0 ? "menuitem" : "menuitemradio",
101
+ ...command.checked === void 0 ? {} : { "aria-checked": command.checked },
102
+ disabled: !command.enabled,
103
+ "data-ex-claims": "click",
104
+ onClick: command.invoke,
105
+ ...index === first ? { ref: focus } : {}
106
+ };
107
+ }
108
+ };
109
+ }
110
+
111
+ // src/ex-pivot.ts
112
+ function withLocale(props, browserLocale) {
113
+ if (props.locale !== void 0) return props;
114
+ if (browserLocale === void 0) throw new Error("Internal: the browser's locale was not read for a pivot given none.");
115
+ return { ...props, locale: browserLocale };
116
+ }
117
+ function sameOptions(a, b) {
118
+ const keys = Object.keys(a);
119
+ return keys.length === Object.keys(b).length && keys.every((key) => Object.is(Reflect.get(a, key), Reflect.get(b, key)));
120
+ }
121
+ function ExPivot(props) {
122
+ const { chrome, ...given } = props;
123
+ const element = useRef2(null);
124
+ const pivot = useRef2(void 0);
125
+ const browserLocale = useRef2(void 0);
126
+ const handed = useRef2(void 0);
127
+ const portals = useGridPortals();
128
+ const [made] = useState2(() => ({ pivot: /* @__PURE__ */ new Map(), grid: /* @__PURE__ */ new Map() }));
129
+ const mounts = useMemo(() => pivotChromeMounts(chrome, portals, made), [chrome, portals, made]);
130
+ useLayoutEffect2(() => {
131
+ const root = element.current;
132
+ if (root === null) throw new Error("Internal: React mounted no element for the pivot to draw into.");
133
+ if (given.locale === void 0) browserLocale.current ??= browserPivotLocale(navigator.languages.length > 0 ? navigator.languages : [navigator.language]);
134
+ const options = withLocale(mounts === void 0 ? given : { ...given, chrome: mounts }, browserLocale.current);
135
+ if (pivot.current === void 0) {
136
+ portals.begin();
137
+ pivot.current = createPivot(root, options);
138
+ } else if (handed.current === void 0 || !sameOptions(handed.current, options)) {
139
+ pivot.current.update(options);
140
+ }
141
+ handed.current = options;
142
+ });
143
+ useLayoutEffect2(() => () => {
144
+ portals.end();
145
+ pivot.current?.destroy();
146
+ pivot.current = void 0;
147
+ handed.current = void 0;
148
+ browserLocale.current = void 0;
149
+ }, [portals]);
150
+ return createElement(Fragment, null, createElement("div", { ref: element }), ...portals.elements());
151
+ }
152
+ export {
153
+ ExPivot,
154
+ layPivotChrome,
155
+ pivotChromeMounts,
156
+ usePivotMenu,
157
+ usePivotPanel,
158
+ usePivotPart
159
+ };
160
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/ex-pivot.ts", "../src/chrome.ts"],
4
+ "sourcesContent": ["// The React Framework Adapter of ExPivot's Script Core (ADR-0370 section 1): it renders the element the pivot\n// draws into, hands the pivot its props, and unmounts it. It holds no state of the pivot's, draws nothing\n// inside its root but the Chrome slots it is handed, and decides nothing.\n\nimport { createElement, Fragment, useLayoutEffect, useMemo, useRef, useState, type ReactElement } from 'react';\nimport { browserPivotLocale, createPivot, type PivotHandle, type PivotViewOptions } from '@ex-grid/pivot';\nimport { useGridPortals } from '@ex-grid/react';\nimport { pivotChromeMounts, type ExPivotChrome, type PivotMountsMade } from './chrome';\n\n/**\n * An ExPivot's props: the Script Core's options, whole, its `chrome` as render functions. `locale` is the browser's\n * language where not given, the first of its languages the pivot writes in, read once, the first time the pivot is\n * given none (ADR-0370 section 10); the core never reads it on its own.\n */\nexport type ExPivotProps = Omit<PivotViewOptions, 'chrome'> & {\n /** The parts a Wrapper's Chrome, or the Consumer's own, draws in place of the built-in markup (ADR-0390). */\n readonly chrome?: ExPivotChrome;\n};\n\n/** The props as the core takes them: the browser's language where the Consumer gave no locale. */\nfunction withLocale(props: PivotViewOptions, browserLocale: string | undefined): PivotViewOptions {\n if (props.locale !== undefined) return props;\n if (browserLocale === undefined) throw new Error('Internal: the browser\\'s locale was not read for a pivot given none.');\n return { ...props, locale: browserLocale };\n}\n\n// Whether `b` hands the pivot what `a` did, option by option: a render of the ExPivot's own, for a portal of its\n// Chrome slots, asks the pivot nothing.\nfunction sameOptions(a: PivotViewOptions, b: PivotViewOptions): boolean {\n const keys = Object.keys(a);\n return keys.length === Object.keys(b).length && keys.every(key => Object.is(Reflect.get(a, key), Reflect.get(b, key)));\n}\n\n/**\n * Excel's PivotTable, drawn by ExGrid, beside its Field List. The element it renders is the pivot's root,\n * which the Script Core owns; every render hands the core the props again, and what did not change asks\n * nothing again.\n */\nexport function ExPivot(props: ExPivotProps): ReactElement {\n const { chrome, ...given } = props;\n const element = useRef<HTMLDivElement>(null);\n const pivot = useRef<PivotHandle | undefined>(undefined);\n const browserLocale = useRef<string | undefined>(undefined);\n // The options the pivot was handed last.\n const handed = useRef<PivotViewOptions | undefined>(undefined);\n // The Chrome slots' content, rendered by this component into the slots the pivot and its grids keep (ADR-0390).\n const portals = useGridPortals();\n // A render function handed again keeps its mount function, so the pivot does not draw its part again.\n const [made] = useState<PivotMountsMade>(() => ({ pivot: new Map(), grid: new Map() }));\n const mounts = useMemo(() => pivotChromeMounts(chrome, portals, made), [chrome, portals, made]);\n // Drawn before the browser paints, so a mounted pivot is never seen empty.\n useLayoutEffect(() => {\n const root = element.current;\n if (root === null) throw new Error('Internal: React mounted no element for the pivot to draw into.');\n // The browser is asked only where the Consumer gave no locale: one that did needs nothing of it.\n if (given.locale === undefined) browserLocale.current ??= browserPivotLocale(navigator.languages.length > 0 ? navigator.languages : [navigator.language]);\n const options = withLocale(mounts === undefined ? given : { ...given, chrome: mounts }, browserLocale.current);\n if (pivot.current === undefined) {\n portals.begin();\n pivot.current = createPivot(root, options);\n } else if (handed.current === undefined || !sameOptions(handed.current, options)) {\n pivot.current.update(options);\n }\n handed.current = options;\n });\n useLayoutEffect(() => () => {\n // The portals go first: the contents the pivot takes away as it goes ask for no render of a component gone.\n portals.end();\n pivot.current?.destroy();\n pivot.current = undefined;\n handed.current = undefined;\n browserLocale.current = undefined;\n }, [portals]);\n return createElement(Fragment, null, createElement('div', { ref: element }), ...portals.elements());\n}\n", "// ExPivot's Chrome slots for React (ADR-0061, ADR-0390 section 3): a Wrapper, or a Consumer's own design system,\n// renders a part of the pivot in place of the built-in markup, as a render function of what the pivot hands the\n// slot. The ExPivot draws it through a portal into the slot the pivot made. What the part means stays the pivot's: the\n// hooks here read the pivot's view of the part and give the keyboard to the control the pivot asks for, so a Wrapper\n// draws its own components and decides nothing.\n\nimport { useLayoutEffect, useRef, useState, useSyncExternalStore, type ReactNode } from 'react';\nimport type {\n PivotDetailsDialogSlotContext, PivotDetailsTabsSlotContext,\n PivotChrome, PivotFieldListSlotContext, PivotFieldSettingsSlotContext, PivotItemFilterSlotContext, PivotMenuSlotContext, PivotMenuView, PivotPanelSlotContext, PivotReportFiltersSlotContext,\n PivotStaleReportSlotContext, PivotStandingSlotContext, PivotToolbarSlotContext, PivotValueFieldSettingsSlotContext,\n} from '@ex-grid/pivot';\nimport { chromeMounts, type ChromeMountsMade, type ExGridChrome, type GridPortals } from '@ex-grid/react';\n\n/**\n * The Chrome slots an ExPivot takes, each a render function of what the pivot hands that slot (ADR-0390 section 3),\n * and `grid`, ExGrid's own, which dresses the report's grid and Show Details' grids. A slot not given is drawn by the\n * built-in markup. A render function is read when its part opens; its answer is rendered as a component of its own,\n * so it may hold state, kept while the part stands, and a hook belongs in a component it renders.\n */\nexport interface ExPivotChrome {\n /** ExGrid's Chrome for the report's grid and Show Details' grids; the Context Menu's commands are worded by the\n * pivot. */\n readonly grid?: ExGridChrome<unknown>;\n /** A placed field's menu and the Layout menu, drawn with {@link usePivotMenu}. */\n readonly menu?: (context: PivotMenuSlotContext) => ReactNode;\n /** Filter\u2026, drawn with {@link usePivotPanel}. */\n readonly itemFilter?: (context: PivotItemFilterSlotContext) => ReactNode;\n /** Field Settings\u2026, drawn with {@link usePivotPanel}. */\n readonly fieldSettings?: (context: PivotFieldSettingsSlotContext) => ReactNode;\n /** Value Field Settings\u2026, drawn with {@link usePivotPanel}. */\n readonly valueFieldSettings?: (context: PivotValueFieldSettingsSlotContext) => ReactNode;\n /** The Pivot Toolbar, drawn with {@link usePivotPart}. */\n readonly toolbar?: (context: PivotToolbarSlotContext) => ReactNode;\n /** The report filter band, drawn with {@link usePivotPart}. */\n readonly reportFilters?: (context: PivotReportFiltersSlotContext) => ReactNode;\n /** The Stale Report's notice, drawn with {@link usePivotPart}. */\n readonly staleReport?: (context: PivotStaleReportSlotContext) => ReactNode;\n /** The Field List, drawn with {@link usePivotPart}. */\n readonly fieldList?: (context: PivotFieldListSlotContext) => ReactNode;\n /** The sheet tabs at the report's foot, while Show Details' records stand in a tab, drawn with {@link usePivotPart}. */\n readonly detailsTabs?: (context: PivotDetailsTabsSlotContext) => ReactNode;\n /** What the Show Details dialog draws inside the pivot's frame, drawn with {@link usePivotPart}. */\n readonly detailsDialog?: (context: PivotDetailsDialogSlotContext) => ReactNode;\n}\n\n/** The slots of `over` given a render function laid over `under`: a slot given as `undefined` leaves the Wrapper's,\n * as one not named does. */\nfunction laid<T extends object>(under: T, over: Partial<T>): T {\n return { ...under, ...Object.fromEntries(Object.entries(over).filter(([, slot]) => slot !== undefined)) };\n}\n\n/**\n * A design-system Wrapper's Chrome with the Consumer's `chrome` over it (ADR-0390): `pivot`, the Wrapper's pivot\n * slots, and `grid`, its ExGrid Chrome for the report's grid, each slot the Consumer names in its place. A slot given\n * as `undefined` leaves the Wrapper's, as one not named does. The grid's Chrome is the Wrapper's own object while the\n * Consumer names none of its slots, so a Chrome handed again with only pivot slots does not dress the report's grid\n * again. Every Wrapper of ExPivot lays its Chrome so, once per `given`.\n */\nexport function layPivotChrome(pivot: Omit<ExPivotChrome, 'grid'>, grid: ExGridChrome<unknown>, given: ExPivotChrome | undefined): ExPivotChrome {\n if (given === undefined) return { ...pivot, grid };\n const { grid: givenGrid, ...givenPivot } = given;\n return { ...laid(pivot, givenPivot), grid: givenGrid === undefined ? grid : laid(grid, givenGrid) };\n}\n\n/** The mount functions made for an ExPivot's render functions: the pivot's slots', and the grid's. */\nexport interface PivotMountsMade {\n /** The pivot's slots' render functions, and the mount function made for each, by slot. */\n readonly pivot: Map<string, { readonly render: unknown; readonly mount: (slot: HTMLElement, context: unknown) => () => void }>;\n /** The report grid's slots', as ExGrid for React makes them. */\n readonly grid: ChromeMountsMade;\n /** The report grid's Chrome last handed, and its mount functions. */\n gridChrome?: { readonly given: unknown; readonly mounts: PivotChrome['grid'] };\n}\n\nconst pivotSlots: readonly string[] = ['menu', 'itemFilter', 'fieldSettings', 'valueFieldSettings', 'toolbar', 'reportFilters', 'staleReport', 'fieldList', 'detailsTabs',\n 'detailsDialog'];\n\n/** The ExPivot's Chrome as the pivot takes it: each slot's render function as a mount function rendering it through\n * the ExPivot's portals, and `grid`'s as ExGrid for React makes its own. A render function handed again keeps its\n * mount function. Which slots there are is the pivot's to check; a render function that is not a function is named\n * here, in React's terms. Exported for the family's Framework Adapters, whose products hand ExPivot's Chrome on to the\n * pivots they draw, not for a Consumer. */\nexport function pivotChromeMounts(given: ExPivotChrome | undefined, portals: GridPortals, made: PivotMountsMade): PivotChrome | undefined {\n // Checked as a script may hand it, whatever its type says.\n const chrome: unknown = given;\n if (chrome === undefined) return undefined;\n if (typeof chrome !== 'object' || chrome === null) {\n throw new TypeError('An ExPivot\\'s chrome is an object of Chrome slots, each a render function of its context (ADR-0390).');\n }\n const mounts: Record<string, unknown> = {};\n for (const entry of Object.entries(chrome)) {\n const name = entry[0];\n const render: unknown = entry[1];\n if (render === undefined) continue;\n if (name === 'grid') {\n // The grid's mounts are made again only for another grid chrome, so its standing parts keep theirs.\n let grid = made.gridChrome;\n if (grid === undefined || grid.given !== render) {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- checked by chromeMounts, as ExGrid for React checks its own chrome\n grid = { given: render, mounts: chromeMounts(render as ExGridChrome<unknown>, portals, made.grid) };\n made.gridChrome = grid;\n }\n mounts[name] = grid.mounts;\n continue;\n }\n // A slot the pivot does not have is handed on, for the pivot to refuse by name.\n if (!pivotSlots.includes(name)) {\n mounts[name] = render;\n continue;\n }\n if (typeof render !== 'function') throw new TypeError(`An ExPivot's chrome.${name} is a render function of the slot's context (ADR-0390).`);\n const before = made.pivot.get(name);\n if (before !== undefined && before.render === render) {\n mounts[name] = before.mount;\n continue;\n }\n const mount = (slot: HTMLElement, context: unknown): (() => void) => portals.mount(slot, () => {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- the pivot hands each slot's mount that slot's context, the one its render function takes\n const node = Reflect.apply(render, undefined, [context]) as ReactNode;\n return node;\n });\n made.pivot.set(name, { render, mount });\n mounts[name] = mount;\n }\n return mounts;\n}\n\n/** What a part's context offers every hook here: its view, and the keyboard's requests. */\ninterface ViewedPart<View> {\n readonly view: () => View;\n readonly subscribe: (listener: () => void) => () => void;\n readonly focusRequest: number;\n readonly takeFocus: (control: HTMLElement) => void;\n}\n\n/** The contexts whose request for the keyboard has been answered. Each request comes in a context of its own, so one\n * answered is never answered again: not by a component of the contents mounted after it, nor by an effect run twice. */\nconst answered = new WeakSet<object>();\n\n/** The view, read again at each change, and the ref of the control a request for the keyboard is for, focused once it\n * is drawn. */\nfunction useViewedPart<View>(context: ViewedPart<View>, what: string): { readonly view: View; readonly focus: (control: HTMLElement | null) => void } {\n const view = useSyncExternalStore(context.subscribe, context.view);\n const control = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (context.focusRequest === 0 || answered.has(context)) return;\n answered.add(context);\n const target = control.current;\n if (target === null) throw new Error(`The ${what} is not drawn: hand the hook's \\`focus\\` ref to it.`);\n context.takeFocus(target);\n }, [context, what]);\n // Made once, so a render hands React the same ref and it does not take it away and back.\n const [focus] = useState(() => (element: HTMLElement | null): void => { control.current = element; });\n return { view, focus };\n}\n\n/** What {@link usePivotPanel} hands a panel's contents. */\nexport interface PivotPanelHandles<View> {\n /** What the panel shows now, drawn again at each change the pivot makes to it. */\n readonly view: View;\n /** Takes the panel's first control: the one each request of the pivot's for the keyboard is for. */\n readonly first: (control: HTMLElement | null) => void;\n}\n\n/**\n * Draws one of the pivot's panels from its context (ADR-0390 section 3): Filter\u2026, Field Settings\u2026 or Value Field\n * Settings\u2026. The view is the pivot's draft, read again at each change; each choice goes to the context's setter, and\n * the hook gives the panel's first control the keyboard at each request, once it is drawn, through the pivot.\n */\nexport function usePivotPanel<View>(context: PivotPanelSlotContext & { readonly view: () => View }): PivotPanelHandles<View> {\n const { view, focus } = useViewedPart(context, 'panel\\'s first control');\n return { view, first: focus };\n}\n\n/**\n * Draws one of the pivot's standing parts from its context (ADR-0390 section 3): the Pivot Toolbar, the report filter\n * band, the Stale Report's notice or the Field List. The view is the pivot's, read again at each change; each press goes to the\n * context's callback, and each control and anchor is handed in by its `ref`, `context.control(name)` and\n * `context.anchor(name)`, so the pivot gives the keyboard to the control it means and places a popup's frame in its\n * anchor itself.\n */\nexport function usePivotPart<View>(context: PivotStandingSlotContext<View>): View {\n return useSyncExternalStore(context.subscribe, context.view);\n}\n\n/** The props {@link usePivotMenu} hands each command's control: spread them onto it. */\nexport interface PivotMenuItemProps {\n /** A choice is a `menuitemradio`, any other command a `menuitem`. */\n readonly role: 'menuitem' | 'menuitemradio';\n /** On a choice: whether it is the current one. */\n readonly 'aria-checked'?: boolean;\n /** Whether the command cannot run now; a disabled command is shown, never left out. */\n readonly disabled: boolean;\n /** Claims the click for the pivot's Input Order (ADR-0240). */\n readonly 'data-ex-claims': 'click';\n /** Runs the command the pivot drew last under this one's id. */\n readonly onClick: () => void;\n /** On the first enabled command: the one a request for the keyboard is for. */\n readonly ref?: (control: HTMLElement | null) => void;\n}\n\n/** What {@link usePivotMenu} hands a menu's contents. */\nexport interface PivotMenuHandles {\n /** What the menu shows now: its commands, in the pivot's order, with their group headings. */\n readonly view: PivotMenuView;\n /** The props of the command at `index` in the view's commands. */\n readonly item: (index: number) => PivotMenuItemProps;\n}\n\n/**\n * Draws a menu from its context (ADR-0390 section 3): one control per command, in the pivot's order, a choice as a\n * `menuitemradio` marked while it is the current one. A press runs the command the pivot drew last under its id, and\n * the first enabled command takes the keyboard at each request of the pivot's.\n */\nexport function usePivotMenu(context: PivotMenuSlotContext): PivotMenuHandles {\n const { view, focus } = useViewedPart(context, 'menu\\'s first enabled command');\n const first = view.commands.findIndex(command => command.enabled);\n return {\n view,\n item: index => {\n const command = view.commands[index];\n if (command === undefined) throw new RangeError(`The menu has ${view.commands.length} commands, not one at ${index}.`);\n return {\n role: command.checked === undefined ? 'menuitem' : 'menuitemradio',\n ...(command.checked === undefined ? {} : { 'aria-checked': command.checked }),\n disabled: !command.enabled,\n 'data-ex-claims': 'click',\n onClick: command.invoke,\n ...(index === first ? { ref: focus } : {}),\n };\n },\n };\n}\n"],
5
+ "mappings": ";AAIA,SAAS,eAAe,UAAU,mBAAAA,kBAAiB,SAAS,UAAAC,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ef", "useState", "useLayoutEffect"]
7
+ }
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@ex-grid/pivot-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0-rc.1",
4
+ "description": "ExPivot for React: the Framework Adapter of ExPivot's Script Core, which mounts Excel's PivotTable, drawn by ExGrid, in a React tree.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/AkiraMisawa/ex-grid.git",
9
+ "directory": "packages/pivot-react"
10
+ },
11
+ "homepage": "https://akiramisawa.github.io/ex-grid/",
12
+ "type": "module",
13
+ "sideEffects": false,
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist/index.js",
22
+ "dist/index.js.map",
23
+ "dist/index.d.ts"
24
+ ],
25
+ "dependencies": {
26
+ "@ex-grid/pivot": "0.2.0-rc.1",
27
+ "@ex-grid/react": "0.2.0-rc.1"
28
+ },
29
+ "peerDependencies": {
30
+ "react": "^19.0.0",
31
+ "react-dom": "^19.0.0"
32
+ }
33
+ }