@sheetxl/studio-mui 0.7.27 → 0.7.28-beta.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/README.md +2 -2
- package/browser/cjs/BQJKf40kttQWOzLw.cjs +20 -0
- package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +1 -0
- package/browser/cjs/B_D3JKseVvpRyX-E.cjs +1 -0
- package/browser/cjs/B_WyRpeiesnEiNP4.cjs +11 -0
- package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +2 -0
- package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +2 -0
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
- package/browser/cjs/ByIEqNsvj52sihT9.cjs +5 -0
- package/browser/cjs/C3moehR3VOd0LnmM.cjs +1 -0
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +1 -0
- package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +1 -0
- package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +1 -0
- package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +1 -0
- package/browser/cjs/CZm1jVZaHQ246prW.cjs +1 -0
- package/browser/cjs/CdDYyAfccXme8w6m.cjs +1 -0
- package/browser/cjs/DBJLJGiCGXesx5n6.cjs +1 -0
- package/browser/cjs/DLScL5AOXhHu9O9H.cjs +7 -0
- package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +1 -0
- package/browser/cjs/IASAYG6qgv7lJY7y.cjs +1 -0
- package/browser/cjs/KZvriGbhEOVkQD0b.cjs +1 -0
- package/browser/cjs/UnMhi28mbvLiOXQe.cjs +1 -0
- package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +1 -0
- package/browser/cjs/iMWEL01eC83oU-YY.cjs +1 -0
- package/browser/cjs/index.cjs +2 -7
- package/browser/cjs/w2GjebPlOFv3pCbm.cjs +1 -0
- package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +1 -0
- package/browser/esm/0EONOhVZ7oT0C_G2.mjs +1150 -0
- package/browser/esm/5x7evORpymnb5SfW.mjs +129 -0
- package/browser/esm/BACBR1jjcpJbhOWA.mjs +191 -0
- package/browser/esm/BPZne8WpzrkWOH6L.mjs +47 -0
- package/browser/esm/BeKa8xVj69hAVKRN.mjs +155 -0
- package/browser/esm/BeQ9bqOvNNP-arFP.mjs +219 -0
- package/browser/esm/Bf3PIOM6U-NmWk2O.mjs +20 -0
- package/browser/esm/C4BPDYeqgN59wMGp.mjs +411 -0
- package/browser/esm/CGbn_xdhgTvk2mvb.mjs +612 -0
- package/browser/esm/CKADOp3hTx0MSNY7.mjs +52 -0
- package/browser/esm/CR2sUEZyRqVv2SNl.mjs +105 -0
- package/browser/esm/CTN8J8c1AneJu3Lu.mjs +2207 -0
- package/browser/esm/Cc5akPEmIwbgKIfc.mjs +516 -0
- package/browser/esm/CePKCTL6D05kDy2E.mjs +82 -0
- package/browser/esm/DBM1blcMTZMAM-eR.mjs +217 -0
- package/browser/esm/DPBnKqhSuJ414Pxx.mjs +99 -0
- package/browser/esm/F51tGfYHocox80zY.mjs +468 -0
- package/browser/esm/SDzKpaiuhQux7tAh.mjs +5391 -0
- package/browser/esm/TDH9XceS8cAkO5d3.mjs +508 -0
- package/browser/esm/XKVlG-x_9q5dbVIW.mjs +8878 -0
- package/browser/esm/fJiwyUQJ18X-cCQz.mjs +1376 -0
- package/browser/esm/fel6EbPAcZOsBmks.mjs +42 -0
- package/browser/esm/flvjZEXrSDrtDzLB.mjs +113 -0
- package/browser/esm/index.mjs +152 -91
- package/licenses/dependencies.txt +137 -627
- package/node/esm/B9-0usA1hSoD0Nk3.mjs +679 -0
- package/node/esm/BO1vNzjGWYdZdbq9.mjs +113 -0
- package/node/esm/BYigefA8bf9FOVib.mjs +47 -0
- package/node/esm/BdrLZp98HQaVMykZ.mjs +82 -0
- package/node/esm/BlubX7gm8wTUNiZ-.mjs +106 -0
- package/node/esm/C8a6QwMGW1tMiWA6.mjs +516 -0
- package/node/esm/CCCnorMn30oUDDIY.mjs +4536 -0
- package/node/esm/CKpik3HRSANKEy4G.mjs +99 -0
- package/node/esm/CTZcfST8pUcLMail.mjs +509 -0
- package/node/esm/D1K9Ji7iQwnOnd1-.mjs +190 -0
- package/node/esm/DuUiuB59bQRPQi-D.mjs +155 -0
- package/node/esm/eKP73GEWmonTXpfv.mjs +470 -0
- package/node/esm/g3y8kxL1Ln214UNr.mjs +129 -0
- package/node/esm/index.mjs +10603 -2832
- package/package.json +27 -27
- package/resources/contents.json +30 -0
- package/resources/locales/contents.json +44 -0
- package/resources/locales/de/groups.cmd.json +219 -0
- package/resources/locales/de/studio.cmd.json +159 -0
- package/resources/locales/de/ui.msg.json +507 -0
- package/resources/locales/en/groups.cmd.json +219 -0
- package/resources/locales/en/studio.cmd.json +159 -0
- package/resources/locales/en/ui.msg.json +508 -0
- package/types/index.d.ts +2 -1761
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +131 -0
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +29 -0
- package/types/src/anchorItems/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +30 -0
- package/types/src/border/BorderStylePopupButton.d.ts +40 -0
- package/types/src/border/index.d.ts +3 -0
- package/types/src/chart/command/InsertChartCommandButton.d.ts +10 -0
- package/types/src/chart/command/index.d.ts +2 -0
- package/types/src/color/Alpha.d.ts +36 -0
- package/types/src/color/Checkboard.d.ts +11 -0
- package/types/src/color/CheckboardUtils.d.ts +3 -0
- package/types/src/color/ColorButton.d.ts +21 -0
- package/types/src/color/ColorButtonList.d.ts +17 -0
- package/types/src/color/ColorPanel.d.ts +71 -0
- package/types/src/color/ColorPopupButton.d.ts +29 -0
- package/types/src/color/CustomColorPanel.d.ts +16 -0
- package/types/src/color/EditableInput.d.ts +22 -0
- package/types/src/color/Hue.d.ts +29 -0
- package/types/src/color/Saturation.d.ts +45 -0
- package/types/src/color/SketchFields.d.ts +9 -0
- package/types/src/color/Swatch.d.ts +16 -0
- package/types/src/color/Types.d.ts +11 -0
- package/types/src/color/_Utils.d.ts +4 -0
- package/types/src/color/index.d.ts +7 -0
- package/types/src/command/AccountingStyleCommandButton.d.ts +18 -0
- package/types/src/command/AppearanceCommandButton.d.ts +3 -0
- package/types/src/command/BorderCommandButton.d.ts +20 -0
- package/types/src/command/ColorCommandButton.d.ts +23 -0
- package/types/src/command/DocThemeCommandButton.d.ts +19 -0
- package/types/src/command/FileCommandButton.d.ts +8 -0
- package/types/src/command/FontFamilyCommandButton.d.ts +9 -0
- package/types/src/command/FontSizeCommandButton.d.ts +21 -0
- package/types/src/command/InsertFunctionCommandPopupButton.d.ts +9 -0
- package/types/src/command/InsertFunctionSumCommandPopupButton.d.ts +8 -0
- package/types/src/command/LanguageCommandButton.d.ts +19 -0
- package/types/src/command/LocaleCommandButton.d.ts +17 -0
- package/types/src/command/NumberFormatCommandButton.d.ts +6 -0
- package/types/src/command/PasteCommandButton.d.ts +14 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts +11 -0
- package/types/src/command/PresetTableStylesCommandButton.d.ts +12 -0
- package/types/src/command/RegisterCatalog.d.ts +3 -0
- package/types/src/command/SheetCommandGroups.d.ts +10 -0
- package/types/src/command/SheetZoomCommandButton.d.ts +9 -0
- package/types/src/command/StudioCommandGroups.d.ts +11 -0
- package/types/src/command/TextEffectsCommandButton.d.ts +6 -0
- package/types/src/command/TextRotateGroupButton.d.ts +14 -0
- package/types/src/command/UndoRedoCommandButton.d.ts +14 -0
- package/types/src/command/WalkingCopyCommandButton.d.ts +6 -0
- package/types/src/command/WorkbookCommandGroups.d.ts +11 -0
- package/types/src/command/index.d.ts +23 -0
- package/types/src/conditionalFormat/ColorScaleRulePanel.d.ts +18 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsPanel.d.ts +23 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsTaskPane.d.ts +4 -0
- package/types/src/conditionalFormat/ConditionalFormatEditorPanel.d.ts +20 -0
- package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts +2 -0
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +32 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +34 -0
- package/types/src/conditionalFormat/ConditionalFormatTitle.d.ts +10 -0
- package/types/src/conditionalFormat/DataBarRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/PresetChip.d.ts +30 -0
- package/types/src/conditionalFormat/PresetScalesCommandButton.d.ts +20 -0
- package/types/src/conditionalFormat/RulePreview.d.ts +23 -0
- package/types/src/conditionalFormat/RuleSection.d.ts +20 -0
- package/types/src/conditionalFormat/ScaleMiniGrid.d.ts +59 -0
- package/types/src/conditionalFormat/ScaleStopRow.d.ts +34 -0
- package/types/src/conditionalFormat/index.d.ts +3 -0
- package/types/src/conditionalFormat/previewColor.d.ts +50 -0
- package/types/src/conditions/AverageOption.d.ts +25 -0
- package/types/src/conditions/BetweenOption.d.ts +25 -0
- package/types/src/conditions/BooleanOption.d.ts +24 -0
- package/types/src/conditions/CombinatorOption.d.ts +41 -0
- package/types/src/conditions/ConditionEditor.d.ts +57 -0
- package/types/src/conditions/ConditionUtils.d.ts +83 -0
- package/types/src/conditions/DateTimeOption.d.ts +43 -0
- package/types/src/conditions/ExpressionOption.d.ts +26 -0
- package/types/src/conditions/InSetOption.d.ts +37 -0
- package/types/src/conditions/NumberOption.d.ts +24 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +55 -0
- package/types/src/conditions/OperatorSelect.d.ts +35 -0
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +39 -0
- package/types/src/conditions/ScalarOption.d.ts +29 -0
- package/types/src/conditions/SelectorSelect.d.ts +43 -0
- package/types/src/conditions/StringOption.d.ts +24 -0
- package/types/src/conditions/TimePeriodOption.d.ts +25 -0
- package/types/src/conditions/TopNOption.d.ts +25 -0
- package/types/src/conditions/index.d.ts +13 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +16 -0
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -0
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +12 -0
- package/types/src/dataValidation/DataValidationPlugin.d.ts +2 -0
- package/types/src/dataValidation/index.d.ts +2 -0
- package/types/src/debug/DebugUtils.d.ts +4 -0
- package/types/src/debug/index.d.ts +2 -0
- package/types/src/dialog/CommentsDialog.d.ts +11 -0
- package/types/src/dialog/FindReplaceWindow.d.ts +13 -0
- package/types/src/dialog/HyperlinkDialog.d.ts +28 -0
- package/types/src/dialog/InsertFunctionDialog.d.ts +25 -0
- package/types/src/dialog/NamedReferenceDialog.d.ts +17 -0
- package/types/src/dialog/NumberFormatDialog.d.ts +12 -0
- package/types/src/dialog/ResizeHeaderDialog.d.ts +15 -0
- package/types/src/dialog/ShortcutKeysDialog.d.ts +9 -0
- package/types/src/dialog/ShortcutKeysPanel.d.ts +28 -0
- package/types/src/dialog/SortDialog.d.ts +9 -0
- package/types/src/dialog/TableNewDialog.d.ts +14 -0
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +13 -0
- package/types/src/dialog/index.d.ts +10 -0
- package/types/src/filter/ColumnMenu.d.ts +13 -0
- package/types/src/filter/FilterList.d.ts +28 -0
- package/types/src/filter/index.d.ts +3 -0
- package/types/src/form/FormulaField.d.ts +221 -0
- package/types/src/form/InputField.d.ts +89 -0
- package/types/src/form/index.d.ts +3 -0
- package/types/src/formulaBar/FormulaBar.d.ts +8 -0
- package/types/src/formulaBar/IFormulaBar.d.ts +51 -0
- package/types/src/formulaBar/index.d.ts +3 -0
- package/types/src/function/FunctionArgumentsPanel.d.ts +57 -0
- package/types/src/function/FunctionSearchPanel.d.ts +35 -0
- package/types/src/function/InsertFunctionWizard.d.ts +79 -0
- package/types/src/function/index.d.ts +4 -0
- package/types/src/function/paneMetrics.d.ts +33 -0
- package/types/src/index.d.ts +21 -0
- package/types/src/itemsPanel/EditorPanel.d.ts +21 -0
- package/types/src/itemsPanel/ItemCard.d.ts +57 -0
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +215 -0
- package/types/src/itemsPanel/ItemsPanel.d.ts +45 -0
- package/types/src/itemsPanel/SortableCards.d.ts +67 -0
- package/types/src/itemsPanel/index.d.ts +6 -0
- package/types/src/movable/MovableContextMenu.d.ts +13 -0
- package/types/src/movable/index.d.ts +2 -0
- package/types/src/named/INamedCollectionEditor.d.ts +37 -0
- package/types/src/named/NamedCollectionEditor.d.ts +7 -0
- package/types/src/named/NamedDetailsPanel.d.ts +11 -0
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -0
- package/types/src/named/NamedDraft.d.ts +68 -0
- package/types/src/named/NamedEditorPanel.d.ts +19 -0
- package/types/src/named/NamedPlugin.d.ts +2 -0
- package/types/src/named/index.d.ts +8 -0
- package/types/src/numberFormat/NumberFormatPanel.d.ts +29 -0
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +12 -0
- package/types/src/numberFormat/index.d.ts +8 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +20 -0
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +3 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +27 -0
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +2 -0
- package/types/src/protectedRange/index.d.ts +2 -0
- package/types/src/protection/WorkbookProtectionDialog.d.ts +23 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +51 -0
- package/types/src/protection/index.d.ts +3 -0
- package/types/src/sheet/SheetTabMenu.d.ts +21 -0
- package/types/src/sheet/SheetsAllMenu.d.ts +16 -0
- package/types/src/sheet/index.d.ts +3 -0
- package/types/src/statusBar/NumberStats.d.ts +27 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +11 -0
- package/types/src/statusBar/StatusBar.d.ts +35 -0
- package/types/src/statusBar/index.d.ts +4 -0
- package/types/src/studio/CommandsWrapper.d.ts +36 -0
- package/types/src/studio/DefaultLogo.d.ts +3 -0
- package/types/src/studio/EagerStudio.d.ts +5 -0
- package/types/src/studio/Studio.d.ts +26 -0
- package/types/src/studio/StudioCommandProvider.d.ts +26 -0
- package/types/src/studio/StudioCommands.d.ts +115 -0
- package/types/src/studio/StudioNotifierProvider.d.ts +10 -0
- package/types/src/studio/StudioProps.d.ts +372 -0
- package/types/src/studio/StudioSplitPane.d.ts +60 -0
- package/types/src/studio/StudioTaskPaneArea.d.ts +8 -0
- package/types/src/studio/StudioToolbar.d.ts +37 -0
- package/types/src/studio/index.d.ts +4 -0
- package/types/src/studio/useStudioApp.d.ts +51 -0
- package/types/src/table/TableDetailsPanel.d.ts +17 -0
- package/types/src/table/TableDetailsTaskPane.d.ts +3 -0
- package/types/src/table/TablePlugin.d.ts +2 -0
- package/types/src/table/TableStyleCanvasPreview.d.ts +21 -0
- package/types/src/table/TableStyleOptionsPanel.d.ts +38 -0
- package/types/src/table/TableStylePreview.d.ts +43 -0
- package/types/src/table/index.d.ts +7 -0
- package/types/src/theme/ThemeSelectButton.d.ts +23 -0
- package/types/src/theme/ThemeSelectPanel.d.ts +17 -0
- package/types/src/theme/ThemeSelectPopupButton.d.ts +24 -0
- package/types/src/theme/ThemeUtils.d.ts +57 -0
- package/types/src/theme/index.d.ts +5 -0
- package/types/src/toast/ToastError.d.ts +10 -0
- package/types/src/toast/index.d.ts +2 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts +46 -0
- package/types/src/toolbar/index.d.ts +2 -0
- package/types/src/workbook/DefaultRenderers.d.ts +23 -0
- package/types/src/workbook/DocumentTitle.d.ts +69 -0
- package/types/src/workbook/WorkbookContextMenu.d.ts +13 -0
- package/types/src/workbook/WorkbookElement.d.ts +12 -0
- package/types/src/workbook/WorkbookStrip.d.ts +37 -0
- package/types/src/workbook/index.d.ts +7 -0
- package/browser/cjs/0DtrpXkQQehBmvSv.cjs +0 -6
- package/browser/cjs/6C3ia2nz4Zm-AdMZ.cjs +0 -7
- package/browser/cjs/BR_EGEaHisRrXAtK.cjs +0 -6
- package/browser/cjs/B_v_M4TiavtofChs.cjs +0 -42
- package/browser/cjs/C17p-h_nw582H7WD.cjs +0 -20
- package/browser/cjs/CInmVysdoHEvvW9h.cjs +0 -6
- package/browser/cjs/CMvQZPQsE7MuTMy_.cjs +0 -6
- package/browser/cjs/CkNt54AXVfJjIWja.cjs +0 -6
- package/browser/cjs/CtRvyhDzQxsk7dkI.cjs +0 -6
- package/browser/cjs/DN9cQ4_4ERQvzKn6.cjs +0 -6
- package/browser/cjs/DUTuBWUNF-w3Fxtb.cjs +0 -6
- package/browser/cjs/pTzEs1wlZj5Bb6xc.cjs +0 -18
- package/browser/esm/8ZnwcsRrGO3Nlw9Y.mjs +0 -54
- package/browser/esm/BFZ4oCbQukelEVLI.mjs +0 -53
- package/browser/esm/BP3nTf4-SLftsj61.mjs +0 -640
- package/browser/esm/BSMkBkXBQgZhX1xk.mjs +0 -2159
- package/browser/esm/CPLIJbynjEkwF2T0.mjs +0 -4533
- package/browser/esm/CuC13VFjBYFE7kub.mjs +0 -155
- package/browser/esm/Cw3i8T1tVnm8o6eB.mjs +0 -46
- package/browser/esm/D6E8W2KK4dGVRQO_.mjs +0 -25
- package/browser/esm/D8xc3AM9QHEqmpb9.mjs +0 -50
- package/browser/esm/DA_bEpA5kkn89fmW.mjs +0 -2411
- package/browser/esm/DVqOr-7nEXA7IjKJ.mjs +0 -26
- package/browser/esm/VAUOzclLs-dR9nt_.mjs +0 -50
- package/node/assets/style.css +0 -1
- package/node/esm/B9dvpdCD_p2q8aNP.mjs +0 -156
- package/node/esm/BBxZemzbmUkoOYdq.mjs +0 -46
- package/node/esm/BDdkV45Cf7BLs5jE.mjs +0 -25
- package/node/esm/BoX8OuVRgUNgw0Wb.mjs +0 -91
- package/node/esm/CPbwVoL6mq66TtTR.mjs +0 -53
- package/node/esm/DMd6h1vz-USluank.mjs +0 -88
- package/node/esm/DYgtaT_soTbSP8M9.mjs +0 -52
- package/node/esm/DxDGSRoOYlWydiwL.mjs +0 -57
- package/node/esm/OMgXBbHk-VRNKAop.mjs +0 -26
- package/node/esm/bGXLfLFngllNb8U1.mjs +0 -50
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import { FormControlProps } from '@mui/material';
|
|
4
|
+
import { ICalculation, ICellRanges, IRange, IWorkbook } from '@sheetxl/sdk';
|
|
5
|
+
import { FormulaInputApi, FormulaInputGrammar, FormulaInputEquals, ReferenceDoneArgs } from '@sheetxl/react';
|
|
6
|
+
/**
|
|
7
|
+
* The height an `'above'` label adds over the input — its line plus the gap under it.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Exported for a host aligning something to the INPUT of a field whose helper line is collapsed
|
|
11
|
+
* (`helperText: null`): the block is no longer symmetric, so its middle is no longer the input, and
|
|
12
|
+
* `align-items: center` on the row would sit that high by exactly this much. Pad the sibling by this
|
|
13
|
+
* and center it in what is left. With the helper line RESERVED (the default) nothing needs it.
|
|
14
|
+
*/
|
|
15
|
+
export declare const FORMULA_FIELD_ABOVE_LABEL_HEIGHT = "calc(20px + 4px)";
|
|
16
|
+
export interface FormulaFieldProps extends FormControlProps {
|
|
17
|
+
/**
|
|
18
|
+
* The field's grammar. `'formula'` (default) accepts any expression (`=SUM(A1:A5)*2`);
|
|
19
|
+
* `'reference'` is the "limit input" specialization — a pure reference list
|
|
20
|
+
* (`Sheet1!A1:B2, Sheet2!C1`), rejecting function calls and computed references per
|
|
21
|
+
* `ICalculation.IFormula.isReferenceOnly` (Excel's RefEdit contract).
|
|
22
|
+
*/
|
|
23
|
+
grammar?: FormulaInputGrammar;
|
|
24
|
+
/**
|
|
25
|
+
* If provided will be registered with react-hook-form.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* We don't support changing the formName once rendered.
|
|
29
|
+
* @see
|
|
30
|
+
* {@link https://react-hook-form.com/}
|
|
31
|
+
*/
|
|
32
|
+
formName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* React-hook-form options.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Only used if formName is provided.
|
|
38
|
+
*/
|
|
39
|
+
formOptions?: RegisterOptions;
|
|
40
|
+
/**
|
|
41
|
+
* The committed value. The display text re-derives whenever it changes (per the grammar's
|
|
42
|
+
* serialization policy). Accepted as `IFormula | ICellRanges | string` for DX — a host holding
|
|
43
|
+
* ranges passes them straight in. With a {@link home} the address is localized to it (bare there,
|
|
44
|
+
* qualified elsewhere); without one the ranges' own scoping is what the field shows (sheet-scoped
|
|
45
|
+
* read bare, workbook-scoped sheet-qualified; see `ICellRanges.getAddress`). The change channels
|
|
46
|
+
* always emit `IFormula` — read ranges via `value.getReferences()` or `apiRef.current.getRanges()`.
|
|
47
|
+
*/
|
|
48
|
+
value: ICalculation.IFormula | ICellRanges | string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Live notification of the value change — fires on every VALID text state (typed or picked);
|
|
51
|
+
* invalid in-progress text shows the error state instead.
|
|
52
|
+
*
|
|
53
|
+
* A PREVIEW channel: hosts that mutate the model per change (resize a table, re-source a chart)
|
|
54
|
+
* should act on {@link onDone} instead and treat this as optional live feedback.
|
|
55
|
+
*/
|
|
56
|
+
onChangeInput?: (value: ICalculation.IFormula | null) => void;
|
|
57
|
+
/**
|
|
58
|
+
* The raw TEXT channel: every display-text change the user causes (typed, picked, F4'd, reverted) —
|
|
59
|
+
* INVALID states included, and regardless of {@link changeOn}.
|
|
60
|
+
*
|
|
61
|
+
* For hosts that persist authored TEXT rather than a parsed value (a name's "refers to", written
|
|
62
|
+
* through to a draft that validates on save): {@link onChangeInput} would leave them holding the
|
|
63
|
+
* last VALID text while the field shows something else. An outside {@link value} change does not
|
|
64
|
+
* fire it.
|
|
65
|
+
*/
|
|
66
|
+
onChangeText?: (text: string) => void;
|
|
67
|
+
/**
|
|
68
|
+
* The COMMIT channel: fires once with the final parsed value when the edit finishes — a done key
|
|
69
|
+
* (Enter/Tab/Escape, from the field or the grid), the adornment toggle-off, or blur to another
|
|
70
|
+
* field. `args.reason` distinguishes accept from cancel (a cancel delivers the reverted session
|
|
71
|
+
* baseline). Not fired on an accept while the text is invalid — the error stays shown instead.
|
|
72
|
+
*/
|
|
73
|
+
onDone?: (value: ICalculation.IFormula | null, args: ReferenceDoneArgs) => void;
|
|
74
|
+
/**
|
|
75
|
+
* The field's CHANGE MODEL. Default `'live'`.
|
|
76
|
+
*
|
|
77
|
+
* `'done'` does three things, not one:
|
|
78
|
+
*
|
|
79
|
+
* 1. suppresses the live {@link onChangeInput} notifications entirely — parsing still runs (error
|
|
80
|
+
* state, picker sync) and the host hears only {@link onDone};
|
|
81
|
+
* 2. makes Enter the FIELD's commit point — captured, so a host dialog's default button never
|
|
82
|
+
* submits over it (in `'live'` mode Enter bubbles, since every change already applied);
|
|
83
|
+
* 3. drops the picker to caret-edit while the user TYPES (`'reference'` grammar; a pick re-arms) —
|
|
84
|
+
* a `'live'` field points for its whole engagement, the Excel RefEdit contract.
|
|
85
|
+
*
|
|
86
|
+
* A host that acts only on the commit channel should say so here rather than merely leaving
|
|
87
|
+
* {@link onChangeInput} unwired — the two look the same to the host but differ at the keyboard.
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* Independent of the modal ✓/✗ adornments, which follow {@link onDone} — the commit channel is what
|
|
91
|
+
* gives them something to do.
|
|
92
|
+
*/
|
|
93
|
+
changeOn?: 'live' | 'done';
|
|
94
|
+
/**
|
|
95
|
+
* The headless field API, for host-driven commit points the blur heuristic can't see — a dialog's
|
|
96
|
+
* OK handler calls `apiRef.current?.commit()` (Cancel: `.cancel()`).
|
|
97
|
+
*/
|
|
98
|
+
apiRef?: React.Ref<FormulaInputApi>;
|
|
99
|
+
/** Resolution/picking context. Defaults to the enclosing `WorkbookContext`. */
|
|
100
|
+
workbook?: IWorkbook | null;
|
|
101
|
+
/**
|
|
102
|
+
* The field's HOME anchor — the coords (with `scope`) a bare reference (`A1`) resolves against and
|
|
103
|
+
* serializes bare for. BOTH grammars honor it; a field with no home (either grammar) has no bare
|
|
104
|
+
* form and stays fully qualified, picks included — the visible tab does not stand in for one.
|
|
105
|
+
*/
|
|
106
|
+
home?: Partial<IRange.CellCoords>;
|
|
107
|
+
/** Leading-`=` policy (`'formula'` grammar only). Default `'optional'`. */
|
|
108
|
+
equals?: FormulaInputEquals;
|
|
109
|
+
/**
|
|
110
|
+
* What a PICK writes — `'absolute'` (`$A$1:$B$2`) or `'relative'` (`A1:B2`). Default `'relative'`
|
|
111
|
+
* (the cell editor's behavior). A DEFAULT, not a constraint: typing and F4 still reach either form,
|
|
112
|
+
* and a value handed in keeps the fixability it came with. `'absolute'` is the defined-name and
|
|
113
|
+
* table-resize shape. See `UseFormulaInputOptions.pickAs`.
|
|
114
|
+
*/
|
|
115
|
+
pickAs?: 'absolute' | 'relative';
|
|
116
|
+
/** Allow a comma-separated multi-range reference (typed, or Ctrl+click-picked). Default `false`. */
|
|
117
|
+
allowMulti?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Whether references may reach other sheets. Default `true`. Set `false` for a single-sheet input (a
|
|
120
|
+
* table's range, conditional formatting's "Applies to"): typed cross-sheet references become errors,
|
|
121
|
+
* the grid refuses picks on other sheets, and addresses display bare. Independent of
|
|
122
|
+
* {@link allowMulti} — see `UseFormulaInputOptions.allowCrossSheet`.
|
|
123
|
+
*/
|
|
124
|
+
allowCrossSheet?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Field label. Default `"Formula"` (`'reference'` grammar: `"Range"`).
|
|
127
|
+
*
|
|
128
|
+
* @remarks
|
|
129
|
+
* `null` (explicitly — not `undefined`, which takes the default) renders NO label, and the
|
|
130
|
+
* input's text re-centers in its box (the asymmetric padding only exists to clear the label on
|
|
131
|
+
* the border). For a field composed into a row whose meaning the row already states — pair with
|
|
132
|
+
* `helperText: null` for a fully compact field that centers against its siblings.
|
|
133
|
+
*/
|
|
134
|
+
label?: React.ReactNode | null;
|
|
135
|
+
/**
|
|
136
|
+
* Where the label goes.
|
|
137
|
+
*
|
|
138
|
+
* @defaultValue `'floating'` — MUI's notched outline label.
|
|
139
|
+
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* `'above'` puts it on its own line above the field, sized to match the helper/error line BELOW
|
|
142
|
+
* the field. That symmetry is the point: it leaves the input at the vertical middle of the whole
|
|
143
|
+
* field block, so a host can vertically center something beside it (a per-argument evaluated
|
|
144
|
+
* value) and have it line up with the text in the field — without measuring anything, and without
|
|
145
|
+
* moving when an error appears.
|
|
146
|
+
*/
|
|
147
|
+
labelPlacement?: 'floating' | 'above';
|
|
148
|
+
/**
|
|
149
|
+
* Show the parse error under the field.
|
|
150
|
+
*
|
|
151
|
+
* @defaultValue `true`
|
|
152
|
+
*
|
|
153
|
+
* @remarks
|
|
154
|
+
* `false` keeps the error OUTLINE (the field still reads as wrong) but leaves the helper line to
|
|
155
|
+
* {@link helperText} — for a host that collects errors through {@link onChangeError} and shows
|
|
156
|
+
* them somewhere of its own: one message area for a form of many fields, rather than a line under
|
|
157
|
+
* each.
|
|
158
|
+
*/
|
|
159
|
+
showError?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* The parse error CHANGED — the message key, or `null` when the text became valid again.
|
|
162
|
+
*
|
|
163
|
+
* @remarks
|
|
164
|
+
* A message KEY, not a sentence (the same rule as `disabledReasons`): the error is state that
|
|
165
|
+
* outlives a language switch, so the chrome that renders it translates at display — `t(key)`, which
|
|
166
|
+
* passes a non-key through unchanged.
|
|
167
|
+
*/
|
|
168
|
+
onChangeError?: (error: string | null) => void;
|
|
169
|
+
/** Placeholder. Default `"Enter Formula"` (`'reference'` grammar: `"Enter Range"`). */
|
|
170
|
+
placeholder?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Guidance shown under the field while it is VALID. The error takes that line when there is one —
|
|
173
|
+
* the field reserves it either way, so the layout never shifts.
|
|
174
|
+
*
|
|
175
|
+
* @remarks
|
|
176
|
+
* Without this a host had to render its own caption below the field, on top of the reserved line
|
|
177
|
+
* (which then hid the error).
|
|
178
|
+
*
|
|
179
|
+
* `null` (explicitly — not `undefined`, which takes the reserved default) COLLAPSES the line
|
|
180
|
+
* instead: the field's block ends at the input. For a form of many fields that shows its messages
|
|
181
|
+
* somewhere else, ~24px per field of reserved emptiness is most of the page. Pair it with
|
|
182
|
+
* {@link showError} `false` — otherwise an error still claims a line, and the layout shifts as it
|
|
183
|
+
* appears — and note that an `'above'` label then leaves the block ASYMMETRIC (see
|
|
184
|
+
* {@link FORMULA_FIELD_ABOVE_LABEL_HEIGHT}).
|
|
185
|
+
*/
|
|
186
|
+
helperText?: React.ReactNode | null;
|
|
187
|
+
/** Hide the adornment cluster (✓/✗ while engaged in modal mode; the select-current action). */
|
|
188
|
+
hideAdornment?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Class(es) for the INNER `<input>` — `className` styles the FormControl root, which selectors
|
|
191
|
+
* aimed at the input (a dialog's `autoFocusSel`) can't use. The dialogs' autofocus convention is
|
|
192
|
+
* the main use: pass `'autoFocus'` and the host's `.autoFocus` selector finds this field.
|
|
193
|
+
* OPT-IN, unlike `InputField` (which always tags its input): a dialog holding both field kinds
|
|
194
|
+
* decides which one takes first focus by tagging it, rather than by DOM order.
|
|
195
|
+
*/
|
|
196
|
+
classNameInput?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Reference to the element.
|
|
199
|
+
*/
|
|
200
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The **formula field**, MUI tier (supersedes `ReferenceInput`/`RangeInput` — see
|
|
204
|
+
* `@sheetxl/react` `form/README-FORM-INPUTS.md`): a form-shaped (TextField) input whose value is an
|
|
205
|
+
* `ICalculation.IFormula`. One component covers both grammars (see {@link FormulaFieldProps.grammar})
|
|
206
|
+
* — a `'formula'` field colors its tokens with the editor's syntax palette; a `'reference'` field is
|
|
207
|
+
* the "limit input" (a pure reference list — multi-range per `allowMulti`, cross-sheet per
|
|
208
|
+
* `allowCrossSheet`, addressed against `home`) coloring its segments by picker index. While focused it is the
|
|
209
|
+
* reference-mode bus PRODUCER — grid drags, header picks and keyboard point-nav write into the field
|
|
210
|
+
* through the same machinery the formula editor uses — with keyboard pointing armed without F2 (a
|
|
211
|
+
* live field points while engaged; a done-mode field drops to caret-edit while typing; Enter/Escape
|
|
212
|
+
* on the grid come home to the field via `onDone`).
|
|
213
|
+
*
|
|
214
|
+
* @remarks
|
|
215
|
+
* A THIN chrome wrapper: all behavior lives in the headless `useFormulaInput` + the shared
|
|
216
|
+
* chrome parts `useFormulaInputParts` (`@sheetxl/react`) — this file is only the MUI field +
|
|
217
|
+
* adornments + react-hook-form wiring around them. Without a workbook (no context, no prop) it
|
|
218
|
+
* degrades to a plain validated text field — picking requires the resolution context.
|
|
219
|
+
*/
|
|
220
|
+
export declare const FormulaField: React.NamedExoticComponent<Omit<FormulaFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
221
|
+
//# sourceMappingURL=FormulaField.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import { FormControlProps } from '@mui/material';
|
|
4
|
+
import { InputFieldApi, EditDoneArgs } from '@sheetxl/react';
|
|
5
|
+
export interface InputFieldProps extends FormControlProps {
|
|
6
|
+
/**
|
|
7
|
+
* The committed value. The display text re-derives whenever it changes.
|
|
8
|
+
*/
|
|
9
|
+
value?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Live notification of the value change — fires on every VALID text state.
|
|
12
|
+
*
|
|
13
|
+
* A PREVIEW channel: hosts that mutate the model per change (renaming a table) should act on
|
|
14
|
+
* {@link onDone} instead and treat this as optional live feedback.
|
|
15
|
+
*/
|
|
16
|
+
onChangeInput?: (value: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* The raw TEXT channel: every display-text change the user causes — INVALID states included, and
|
|
19
|
+
* regardless of {@link changeOn}. For hosts that persist authored text and validate it later;
|
|
20
|
+
* {@link onChangeInput} would leave them holding the last VALID text while the field shows
|
|
21
|
+
* something else. An outside {@link value} change does not fire it.
|
|
22
|
+
*/
|
|
23
|
+
onChangeText?: (text: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* The COMMIT channel: fires once with the final text when the edit finishes — a done key
|
|
26
|
+
* (Enter/Tab/Escape), the adornment ✓/✗, `apiRef.current.commit()`, or blur to another field.
|
|
27
|
+
* `args.reason` distinguishes accept from cancel (a cancel delivers the reverted session baseline).
|
|
28
|
+
* Not fired on an accept while the text is invalid — the error stays shown instead.
|
|
29
|
+
*
|
|
30
|
+
* Wiring this is also what shows the modal ✓/✗ adornment pair.
|
|
31
|
+
*/
|
|
32
|
+
onDone?: (value: string, args: EditDoneArgs) => void;
|
|
33
|
+
/**
|
|
34
|
+
* `'done'` suppresses the live {@link onChangeInput} notifications entirely (validation still runs —
|
|
35
|
+
* error state stays live — but the host hears only {@link onDone}) and makes Enter the field's own
|
|
36
|
+
* commit point rather than a key the host form gets to see. Default `'live'`.
|
|
37
|
+
*/
|
|
38
|
+
changeOn?: 'live' | 'done';
|
|
39
|
+
/**
|
|
40
|
+
* Validate the text — THROW to reject it. The message (an SDK validation error carries a message
|
|
41
|
+
* key) is shown as the field's error and blocks every accept path until it clears.
|
|
42
|
+
*/
|
|
43
|
+
onValidate?: (text: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* The headless field API, for host-driven commit points the blur heuristic can't see — a dialog's
|
|
46
|
+
* OK handler calls `apiRef.current?.commit()` (Cancel: `.cancel()`).
|
|
47
|
+
*/
|
|
48
|
+
apiRef?: React.Ref<InputFieldApi>;
|
|
49
|
+
/**
|
|
50
|
+
* A default value — shown as the placeholder.
|
|
51
|
+
*/
|
|
52
|
+
defaultInput?: string;
|
|
53
|
+
/**
|
|
54
|
+
* If provided will register with react-hook-form.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* We don't support changing the formName once rendered.
|
|
58
|
+
* @see {@link https://react-hook-form.com}
|
|
59
|
+
*/
|
|
60
|
+
formName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* React-hook-form options.
|
|
63
|
+
* @remarks
|
|
64
|
+
* This is only used if formName is provided.
|
|
65
|
+
*/
|
|
66
|
+
formOptions?: RegisterOptions;
|
|
67
|
+
/** Field label. Default `"Name"`. */
|
|
68
|
+
label?: string;
|
|
69
|
+
/** Hide the adornment cluster (the ✓/✗ pair shown while engaged in modal mode). */
|
|
70
|
+
hideAdornment?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Underlying reference to the input element.
|
|
73
|
+
*/
|
|
74
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The **text field**, MUI tier — a form-shaped (TextField) validated text input, and `FormulaField`'s
|
|
78
|
+
* plain-value sibling: the same edit contract (see {@link InputFieldProps.changeOn}), the same
|
|
79
|
+
* two-level Escape, the same modal ✓/✗ adornments, the same `apiRef` commit points — differing only in
|
|
80
|
+
* that its value is TEXT (validated by {@link InputFieldProps.onValidate}) rather than a parsed
|
|
81
|
+
* formula, and that it never touches the reference-mode bus.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* A THIN chrome wrapper: the behavior lives in the headless `useInputField` (`@sheetxl/react`), which
|
|
85
|
+
* shares its whole commit state machine (`useEditCommit`) with the formula field — the two cannot
|
|
86
|
+
* drift. This file is only the MUI field + adornments + react-hook-form wiring.
|
|
87
|
+
*/
|
|
88
|
+
export declare const InputField: React.NamedExoticComponent<Omit<InputFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
//# sourceMappingURL=InputField.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormulaBarProps, IFormulaBarElement } from './IFormulaBar';
|
|
3
|
+
/**
|
|
4
|
+
* This tracks the selection of the sheet and
|
|
5
|
+
* updates the a named range editor and a sheet cell editor.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FormulaBar: React.NamedExoticComponent<Omit<FormulaBarProps, "ref"> & React.RefAttributes<IFormulaBarElement>>;
|
|
8
|
+
//# sourceMappingURL=FormulaBar.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
3
|
+
import { SheetEditable } from '@sheetxl/react';
|
|
4
|
+
import { NamedCollectionEditorProps, INamedCollectionEditorElement } from '../named';
|
|
5
|
+
export interface FormulaBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* The workbook that is used for the range.use
|
|
8
|
+
*/
|
|
9
|
+
workbook?: IWorkbook;
|
|
10
|
+
/**
|
|
11
|
+
* The shared cell editor. When provided (and the editor is on), the
|
|
12
|
+
* formula bar edits through this SAME {@link SheetEditable} the grid uses — live two-way sync.
|
|
13
|
+
*/
|
|
14
|
+
editable?: SheetEditable;
|
|
15
|
+
/**
|
|
16
|
+
* If the NamedCollectionEditor should be shown.
|
|
17
|
+
* @defaultValue true
|
|
18
|
+
*/
|
|
19
|
+
showNamedCollectionEditor?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Allow for customizations on NamedCollectionEditor
|
|
22
|
+
*/
|
|
23
|
+
propsNamedCollectionEditor?: NamedCollectionEditorProps;
|
|
24
|
+
/**
|
|
25
|
+
* Override the default NamedCollectionEditor
|
|
26
|
+
*/
|
|
27
|
+
renderNamedCollectionEditor?: (props: NamedCollectionEditorProps, ref: React.Ref<INamedCollectionEditorElement>) => React.ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* Disabled the ui.
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Ref for the FormulaBar element.
|
|
34
|
+
*/
|
|
35
|
+
ref?: React.Ref<IFormulaBarElement>;
|
|
36
|
+
}
|
|
37
|
+
export interface FormulaBarAttributes {
|
|
38
|
+
isFormulaBarElement: () => true;
|
|
39
|
+
getNamedCollectionEditorElement: () => INamedCollectionEditorElement | null;
|
|
40
|
+
/**
|
|
41
|
+
* The shared cell editor the formula bar drives, or `null` if none. The same instance
|
|
42
|
+
* the grid uses.
|
|
43
|
+
*/
|
|
44
|
+
getEditable: () => SheetEditable | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Type returned via ref property.
|
|
48
|
+
*/
|
|
49
|
+
export interface IFormulaBarElement extends FormulaBarAttributes, HTMLDivElement {
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=IFormulaBar.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IFunction, IRange, IWorkbook } from '@sheetxl/sdk';
|
|
3
|
+
export interface FunctionArgumentsPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* The function whose arguments are being filled. ONE function — this panel never searches (in the
|
|
6
|
+
* script editor there is nothing to search: the function is the one being written).
|
|
7
|
+
*/
|
|
8
|
+
func: IFunction;
|
|
9
|
+
/**
|
|
10
|
+
* Resolution/evaluation context. Defaults to the enclosing `WorkbookContext`.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Optional, and genuinely so: without one the fields degrade to validated text (no picking, no
|
|
14
|
+
* per-argument values, no result) rather than the panel refusing to render.
|
|
15
|
+
*/
|
|
16
|
+
workbook?: IWorkbook | null;
|
|
17
|
+
/**
|
|
18
|
+
* The anchor a bare reference (`A1`) resolves against and serializes bare for — normally the cell
|
|
19
|
+
* the call is being inserted into. Without one the fields fall back to the workbook's selected
|
|
20
|
+
* sheet, and the result evaluates against its own default cell.
|
|
21
|
+
*/
|
|
22
|
+
home?: Partial<IRange.CellCoords>;
|
|
23
|
+
/** Take focus (the first argument field) on mount. @defaultValue `false` */
|
|
24
|
+
autoFocus?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The assembled call, on every change — `=SUM(A1:A5,B1)`. The host is what inserts it; this panel
|
|
27
|
+
* owns no action row (see the class doc).
|
|
28
|
+
*/
|
|
29
|
+
onChangeCall?: (call: string) => void;
|
|
30
|
+
/** Class(es) for the panel root. */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Excel's **Function Arguments** — the function's name and summary, then one labelled field per
|
|
35
|
+
* argument (each showing what it evaluates to), the focused argument's description, and the assembled
|
|
36
|
+
* call's result.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* A WIDGET, not a dialog page: it takes one function, renders no buttons, and treats `workbook` /
|
|
40
|
+
* `home` as optional, so the same panel serves the Insert Function wizard's second page and (later) a
|
|
41
|
+
* debug pane in the script editor, where a custom function being written can be filled in and watched
|
|
42
|
+
* evaluate.
|
|
43
|
+
*
|
|
44
|
+
* **TEXT is the state of record.** Assembly is string concatenation, and an argument mid-typing
|
|
45
|
+
* (`A1:`) has no `IFormula` at all — which is most of the time this panel is being used. Each row's
|
|
46
|
+
* text is seeded into its field ONCE and never echoed back: `FormulaField`'s `value` is a committed
|
|
47
|
+
* baseline that re-derives the display text whenever it changes, so feeding a keystroke back through
|
|
48
|
+
* it would re-serialize under the caret (`A1` → `=A1`).
|
|
49
|
+
*
|
|
50
|
+
* **Each argument evaluates on its own**, through the `IFormula` its own field parsed — never as a
|
|
51
|
+
* subtree of the assembled call. One blank or half-typed argument fails that parse, and every row's
|
|
52
|
+
* value would blank at once, during the exact activity this panel exists for. Only the result line
|
|
53
|
+
* evaluates the whole call.
|
|
54
|
+
*/
|
|
55
|
+
export declare const FunctionArgumentsPanel: React.NamedExoticComponent<FunctionArgumentsPanelProps>;
|
|
56
|
+
export default FunctionArgumentsPanel;
|
|
57
|
+
//# sourceMappingURL=FunctionArgumentsPanel.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IFunction } from '@sheetxl/sdk';
|
|
3
|
+
import { CommandContext } from '@sheetxl/react';
|
|
4
|
+
export interface FunctionSearchPanelProps {
|
|
5
|
+
/** The catalog: category list, per-category listing and ranked text search. */
|
|
6
|
+
context?: () => CommandContext.FormulaFunction | null | undefined;
|
|
7
|
+
/** The chosen function. CONTROLLED — the host needs it (to insert it, or to fill its arguments). */
|
|
8
|
+
selected: IFunction | null;
|
|
9
|
+
/** The selection changed: a click, an arrow key, or a new query landing on its own top row. */
|
|
10
|
+
onChangeSelected: (fn: IFunction | null) => void;
|
|
11
|
+
/** "That one" — a double-click on a row. The host takes its default action. */
|
|
12
|
+
onActivate?: () => void;
|
|
13
|
+
/** Take focus (the search box) on mount. @defaultValue `false` */
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
/** Class(es) for the panel root. */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* **Pick a function** — search or browse by category, and read what the chosen one does.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* A WIDGET (see {@link FunctionArgumentsPanel} for why both halves of the Insert Function dialog are
|
|
23
|
+
* shaped this way): it renders no buttons and does not close anything. The catalog is the SDK's,
|
|
24
|
+
* through {@link CommandContext.FormulaFunction} — so custom (workbook-defined) functions appear
|
|
25
|
+
* beside the built-ins, no category table is maintained here, and deprecated/hidden functions are
|
|
26
|
+
* filtered out by the SDK.
|
|
27
|
+
*
|
|
28
|
+
* The summary + signature come from the SAME components the in-cell editor shows while typing
|
|
29
|
+
* ({@link FunctionSignature} / {@link FunctionPreviewContent}), so a function reads identically
|
|
30
|
+
* wherever it is met. Here the per-argument prose is suppressed (`showParameters={false}`): this page
|
|
31
|
+
* answers "which function", not "what do I pass it".
|
|
32
|
+
*/
|
|
33
|
+
export declare const FunctionSearchPanel: React.NamedExoticComponent<FunctionSearchPanelProps>;
|
|
34
|
+
export default FunctionSearchPanel;
|
|
35
|
+
//# sourceMappingURL=FunctionSearchPanel.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { IFunction, IRange, IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
import { OptionInput } from '@sheetxl/utils-react';
|
|
3
|
+
import { CommandContext } from '@sheetxl/react';
|
|
4
|
+
/** Which of the wizard's two pages is showing. */
|
|
5
|
+
export type InsertFunctionPage = 'search' | 'arguments';
|
|
6
|
+
/**
|
|
7
|
+
* The class on each page's wrapper, carrying `data-page` and the `hidden` attribute.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Both pages stay MOUNTED once visited (see {@link InsertFunctionWizard}), so "is this page up" is a
|
|
11
|
+
* question about `hidden`, not about what is in the document: `.insert-function-page[data-page="…"]:not([hidden])`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const INSERT_FUNCTION_PAGE_CLASS = "insert-function-page";
|
|
14
|
+
/**
|
|
15
|
+
* The option identities the wizard's host acts on. Language-free (the labels are thunks) — this is
|
|
16
|
+
* what arrives as `onOption`'s `option`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const InsertFunctionOption: Readonly<{
|
|
19
|
+
/** Page 1's default — go fill the chosen function's arguments. */
|
|
20
|
+
Next: "Next";
|
|
21
|
+
/** Page 2 → page 1, keeping the search behind it. */
|
|
22
|
+
Back: "Back";
|
|
23
|
+
/** Insert: the seeded call from page 1, the assembled one from page 2. */
|
|
24
|
+
Insert: "Insert";
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* The action row for a page — FIRST entry is the default (`OptionsDialog`'s own rule).
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* A helper rather than an action-model protocol: a second host (a taskpane, the script editor) reuses
|
|
31
|
+
* ten lines of button logic by calling this, instead of implementing an interface to be handed the
|
|
32
|
+
* same array. `OptionsDialog` re-reads `options`/`defaultOption` every render, so a page flip needs
|
|
33
|
+
* nothing else.
|
|
34
|
+
*
|
|
35
|
+
* @param page The page being shown.
|
|
36
|
+
* @param t The host's translator — the labels resolve at render, so a language switch while the
|
|
37
|
+
* dialog is open re-localizes them.
|
|
38
|
+
*/
|
|
39
|
+
export declare const optionsForPage: (page: InsertFunctionPage, t: (key: string) => string) => OptionInput[];
|
|
40
|
+
export interface InsertFunctionWizardProps {
|
|
41
|
+
/** The catalog — page 1's search/browse. */
|
|
42
|
+
context?: () => CommandContext.FormulaFunction | null | undefined;
|
|
43
|
+
/** Which page is showing. CONTROLLED: the host owns it, because its action row depends on it. */
|
|
44
|
+
page: InsertFunctionPage;
|
|
45
|
+
/** The chosen function, and the second page's subject. */
|
|
46
|
+
selected: IFunction | null;
|
|
47
|
+
/** The selection changed (a click, an arrow key, or a new query landing on its own top row). */
|
|
48
|
+
onChangeSelected: (fn: IFunction | null) => void;
|
|
49
|
+
/** "That one" — a double-click in the list. The host takes its own default action. */
|
|
50
|
+
onActivate?: () => void;
|
|
51
|
+
/** The assembled call from page 2, on every change — `=SUM(A1:A5,B1)`. */
|
|
52
|
+
onChangeCall?: (call: string) => void;
|
|
53
|
+
/** Evaluation/resolution context for page 2. Defaults to the enclosing `WorkbookContext`. */
|
|
54
|
+
workbook?: IWorkbook | null;
|
|
55
|
+
/** The cell the call is being inserted into — page 2's anchor for bare references. */
|
|
56
|
+
home?: Partial<IRange.CellCoords>;
|
|
57
|
+
/** Class(es) for the showing page's root. */
|
|
58
|
+
className?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The two pages of **Insert Function**, composed: pick a function, then fill its arguments.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* Renders NO chrome — no title, no buttons, no window. The host owns the page state (`page` /
|
|
65
|
+
* `onPageChange` at the call site) and builds its action row from {@link optionsForPage}, which is
|
|
66
|
+
* what lets the same pair live in a dialog today and a taskpane later.
|
|
67
|
+
*
|
|
68
|
+
* **A page turn HIDES, it does not unmount.** Next/Back is one window changing what it shows, and
|
|
69
|
+
* everything the user built on the page behind it survives: the query, the category, the scroll
|
|
70
|
+
* position, and page 2's filled-in arguments. Re-mounting threw all of that away — going Back to
|
|
71
|
+
* refine a search landed on an empty box with the whole catalog under it.
|
|
72
|
+
*
|
|
73
|
+
* What resets page 2 is therefore a different FUNCTION, not a page turn: it is keyed on the one it
|
|
74
|
+
* was opened for. That is also why it does not mount until the first Next — an argument form for
|
|
75
|
+
* every function arrowed past on page 1 would evaluate the whole time the user is still choosing.
|
|
76
|
+
*/
|
|
77
|
+
export declare const InsertFunctionWizard: import('react').NamedExoticComponent<InsertFunctionWizardProps>;
|
|
78
|
+
export default InsertFunctionWizard;
|
|
79
|
+
//# sourceMappingURL=InsertFunctionWizard.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Each page's PREFERRED height, in px — what it asks for, not what it gets.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Internal to this folder (not exported from the package).
|
|
6
|
+
*
|
|
7
|
+
* Neither page can be content-sized: the search page's list is as long as the search found (~15000px
|
|
8
|
+
* of rows), and the argument page GROWS a row every time a rest parameter's last one is filled. So
|
|
9
|
+
* each declares the height it wants and gives its one scrolling region the remainder.
|
|
10
|
+
*
|
|
11
|
+
* They no longer have to AGREE. A host showing both ({@link InsertFunctionWizard}) sizes itself to
|
|
12
|
+
* the taller of the two and lets each page fill it — which is what keeps Next/Back from resizing the
|
|
13
|
+
* window under the pointer, and is a fact about the host rather than a number each page has to be
|
|
14
|
+
* told. And a preference is all these are: both pages shrink below them when the host is shorter (a
|
|
15
|
+
* short window, a taskpane), which is what a hard `height` here could not do.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The search page's own sum — a search field (40) + a category field (40) + the hint (88), the 16px
|
|
19
|
+
* gaps between them and its 12px top padding, with the function list taking the remainder. The list
|
|
20
|
+
* asks for little here on purpose: in the wizard the page renders at the taller argument page's
|
|
21
|
+
* height, and the difference all lands in the list.
|
|
22
|
+
*/
|
|
23
|
+
export declare const FUNCTION_SEARCH_PANE_HEIGHT = 415;
|
|
24
|
+
/**
|
|
25
|
+
* The argument page's, which is the taller: prose (the function's summary at the top, the focused
|
|
26
|
+
* argument's description at the bottom) is what a first-time user of a function is here to read.
|
|
27
|
+
* The extra goes to the argument rows, which is where the user is working — and, on the search
|
|
28
|
+
* page, to its function list, which simply shows more rows.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FUNCTION_ARGUMENTS_PANE_HEIGHT = 450;
|
|
31
|
+
/** What a host showing BOTH pages sizes to: the taller page's preference. */
|
|
32
|
+
export declare const FUNCTION_PANE_HEIGHT: number;
|
|
33
|
+
//# sourceMappingURL=paneMetrics.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { LicenseManager, type LicenseDetails } from '@sheetxl/sdk';
|
|
2
|
+
export { useModelListener, useRangeListener, DefaultTaskPaneRegistry, WorkbookIO } from '@sheetxl/react';
|
|
3
|
+
export * from './command';
|
|
4
|
+
export * from './form';
|
|
5
|
+
export * from './function';
|
|
6
|
+
export * from './border';
|
|
7
|
+
export * from './color';
|
|
8
|
+
export * from './theme';
|
|
9
|
+
export * from './toolbar';
|
|
10
|
+
export * from './statusBar';
|
|
11
|
+
export * from './formulaBar';
|
|
12
|
+
export * from './named';
|
|
13
|
+
export * from './filter';
|
|
14
|
+
export * from './table';
|
|
15
|
+
export * from './numberFormat';
|
|
16
|
+
export * from './protection';
|
|
17
|
+
export * from './sheet';
|
|
18
|
+
export * from './workbook';
|
|
19
|
+
export * from './theme';
|
|
20
|
+
export * from './studio';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ItemMessageKeys } from './ItemsDescriptor';
|
|
3
|
+
export interface EditorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The feature's catalog keys for the cancel/save labels.
|
|
6
|
+
*/
|
|
7
|
+
messageKeys: Pick<ItemMessageKeys, 'cancel' | 'save'>;
|
|
8
|
+
/**
|
|
9
|
+
* Called when save is requested
|
|
10
|
+
*/
|
|
11
|
+
onSave: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Called when cancel is requested
|
|
14
|
+
*/
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Save/cancel shell wrapped around a feature editor.
|
|
19
|
+
*/
|
|
20
|
+
export declare const EditorPanel: React.NamedExoticComponent<EditorProps>;
|
|
21
|
+
//# sourceMappingURL=EditorPanel.d.ts.map
|