diff --git a/tests/static-toolboxes.test.mjs b/tests/static-toolboxes.test.mjs index a3eba93..c776e46 100644 --- a/tests/static-toolboxes.test.mjs +++ b/tests/static-toolboxes.test.mjs @@ -147,6 +147,8 @@ test("toolbox module registry and modules expose expected behavior", async () => const calculatorModule = await readFile("website/src/features/toolboxes/modules/CalculatorModule.jsx", "utf8"); const tableModule = await readFile("website/src/features/toolboxes/modules/TableModule.jsx", "utf8"); const tableGridParts = await readFile("website/src/features/toolboxes/modules/TableGridParts.jsx", "utf8"); + const tableToolbar = await readFile("website/src/features/toolboxes/modules/TableToolbar.jsx", "utf8"); + const tableBundle = `${tableModule}\n${tableGridParts}\n${tableToolbar}`; const tableUtils = await readFile("website/src/features/toolboxes/modules/tableUtils.js", "utf8"); const tableFormulaEngine = await readFile("website/src/features/toolboxes/modules/tableFormulaEngine.js", "utf8"); const timerModule = await readFile("website/src/features/toolboxes/modules/TimerModule.jsx", "utf8"); @@ -283,16 +285,16 @@ test("toolbox module registry and modules expose expected behavior", async () => assert.match(calculatorModule, /--calculator-scroll-height/); assert.match(calculatorModule, /CalculatorEntries/); assert.match(tableModule, /export function TableModule/); - assert.match(tableModule, /Icon name="add-row"/); - assert.match(tableModule, /Icon name="add-column"/); - assert.match(tableModule, /Icon name="remove-row"/); - assert.match(tableModule, /Icon name="remove-column"/); + assert.match(tableBundle, /Icon name="add-row"/); + assert.match(tableBundle, /Icon name="add-column"/); + assert.match(tableBundle, /Icon name="remove-row"/); + assert.match(tableBundle, /Icon name="remove-column"/); assert.match(tableModule, /insertFormulaReferenceSelection/); assert.match(tableModule, /startFormulaSelection/); assert.match(tableModule, /copyTsv/); - assert.match(tableModule, /notepad-toolbar table-toolbar/); - assert.match(tableModule, /notepad-toolbar-group/); - assert.match(tableModule, /notepad-toolbar-button/); + assert.match(tableBundle, /notepad-toolbar table-toolbar/); + assert.match(tableBundle, /notepad-toolbar-group/); + assert.match(tableBundle, /notepad-toolbar-button/); assert.match(tableModule, /selection/); assert.match(tableModule, /draggingSelectionRef/); assert.match(tableModule, /movingSelectionRef/); diff --git a/website/src/features/toolboxes/modules/TableModule.jsx b/website/src/features/toolboxes/modules/TableModule.jsx index 4f9dfe2..d75b21c 100644 --- a/website/src/features/toolboxes/modules/TableModule.jsx +++ b/website/src/features/toolboxes/modules/TableModule.jsx @@ -1,14 +1,12 @@ // Rôle : fournit l'outil tableau avec cellules libres, formules simples et échange TSV. import { useEffect, useMemo, useRef, useState } from "react"; -import { Icon } from "../../../components/Icon.jsx"; import { TextExchangeActions } from "./TextExchangeActions.jsx"; import { cellAddress, columnIndexToName, evaluateTable, parseCellAddress } from "./tableFormulaEngine.js"; import { HeaderLabelInput, TableRow } from "./TableGridParts.jsx"; +import { TableToolbar } from "./TableToolbar.jsx"; import { DEFAULT_COLUMNS, DEFAULT_ROWS, - MAX_COLUMNS, - MAX_ROWS, clampCellPosition, cleanCells, cleanLabels, @@ -411,69 +409,7 @@ export function TableModule({ toolboxId, moduleId, context, textExchangeOpen }) context.setModuleData(toolboxId, moduleId, nextData, "table")} /> )} -
-
-
- - -
-
- - -
-
- {data.rows} x {data.columns} -
-
-
- -
-
+
+
+
+ + +
+
+ + +
+
+ {rows} x {columns} +
+
+
+ +
+
+ ); +}