@sheetxl/studio-mui 0.8.0-beta.9 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +17 -7
- package/browser/esm/{DT71hr6qq9QMKf7Q.mjs → -xbfcBB_r6yovwt0.mjs} +2 -2
- package/browser/esm/0Ui7wtwIglVNcnjK.mjs +975 -0
- package/browser/esm/0pDgMMkwtzP7yApV.mjs +294 -0
- package/browser/esm/3F82kokAv56WeIOp.mjs +94 -0
- package/browser/esm/B7rXnRqYPMeFo7lF.mjs +415 -0
- package/browser/esm/BDXrBgqLv2G_aBxW.mjs +8 -0
- package/browser/esm/{a5G-3nVFn86pvt8H.mjs → BEvHafOOTIvsHfzb.mjs} +82 -94
- package/browser/esm/{BscaD3SzYM6ysjgy.mjs → BF7tsgFfA5kiGqvA.mjs} +5 -5
- package/browser/esm/BGxILWytBh1gGIqX.mjs +1281 -0
- package/browser/esm/BMtcK4QQebSd-gg_.mjs +14 -0
- package/browser/esm/{DpdMtsE7oOAIJqFo.mjs → BN-SV9n15bsIT7UF.mjs} +14 -13
- package/browser/esm/BPw9ZOfyIYNPmxbo.mjs +252 -0
- package/browser/esm/Be-rw5ILGyBK1k5g.mjs +633 -0
- package/browser/esm/Bezw0tyQZcU_2PRi.mjs +242 -0
- package/browser/esm/BjHVW5_EgY2JEOYR.mjs +106 -0
- package/browser/esm/BsQHoNsrcsZZeolo.mjs +103 -0
- package/browser/esm/BtbpQMP61r1e5s6G.mjs +516 -0
- package/browser/esm/BvCt1gSMp3TNaras.mjs +424 -0
- package/browser/esm/By-REgl0FtVnNxzf.mjs +831 -0
- package/browser/esm/{DiKCs9R7e4MgyayQ.mjs → BzPrRiCDzZQnKqH4.mjs} +4 -4
- package/browser/esm/C2NKkLNVwF6qUNv1.mjs +94 -0
- package/browser/esm/C5Y1q7udZf2PwslP.mjs +973 -0
- package/browser/esm/CEbCLniKqzKNP6MP.mjs +392 -0
- package/browser/esm/CFz8KVBAQoF-AJHf.mjs +414 -0
- package/browser/esm/CKVZ-Qa6AcojcV6x.mjs +119 -0
- package/browser/esm/CPawgAiTfoCklxuh.mjs +267 -0
- package/browser/esm/CQyLZmquw7Cn-0Yv.mjs +14 -0
- package/browser/esm/{ipftNUxAU0HR-0YP.mjs → CS7kr0WaYPFpIH95.mjs} +3 -3
- package/browser/esm/CT8hUU9KN4TmEBld.mjs +8547 -0
- package/browser/esm/CX2LPfZw79Z0uRhG.mjs +386 -0
- package/browser/esm/CXViQNtqX1jITZyu.mjs +197 -0
- package/browser/esm/CbNQrqPTogPk-TRE.mjs +1550 -0
- package/browser/esm/{BdkeyaHAtiNa6jqW.mjs → CdeLvf6DfzWVbVw5.mjs} +33 -31
- package/browser/esm/{CawSvjLj4-2Qqyef.mjs → ChytgpwnPlu_VG4E.mjs} +2 -2
- package/browser/esm/CmAMY8rXqmvbCx1E.mjs +360 -0
- package/browser/esm/{BNYKPFICOYt2VRsP.mjs → CukQww6Fo8MyF56L.mjs} +2 -2
- package/browser/esm/Cupln-3vYNmxrrM2.mjs +13 -0
- package/browser/esm/Cy6Q7KGXWYIosYTX.mjs +31 -0
- package/browser/esm/{ffz9LGAgGiWQQav9.mjs → D4IXtjIE97zSR0kY.mjs} +156 -109
- package/browser/esm/D5IXaQlvCuPu8zeG.mjs +72 -0
- package/browser/esm/{CHLqCxo3afOV1Otw.mjs → D6Rur-jnQXX3jzQH.mjs} +4 -4
- package/browser/esm/D8sXey2okO2icU8d.mjs +2692 -0
- package/browser/esm/DE7H4jbuXYB08_dQ.mjs +225 -0
- package/browser/esm/DaISN0TvyxafPIve.mjs +490 -0
- package/browser/esm/{80XYmJwiiFLBmpH2.mjs → DpwtflGvQFbBSLdo.mjs} +47 -48
- package/browser/esm/DrdNTvMdXdsemC4B.mjs +225 -0
- package/browser/esm/DsxPHa5JNx8ovALW.mjs +442 -0
- package/browser/esm/DvJk84TQ-8JsgXcp.mjs +235 -0
- package/browser/esm/Dw9nScfNdZ0Cjwne.mjs +87 -0
- package/browser/esm/{BXQPMQyxdiYwawjE.mjs → PvQUVsO3tH532wV8.mjs} +20 -18
- package/browser/esm/RrujsbEgx2HUeD4s.mjs +161 -0
- package/browser/esm/S2tFDJI2wIBAgQaA.mjs +335 -0
- package/browser/esm/{Cykd-NaZAtHJlQmQ.mjs → STe4CGP-g8tCf7c5.mjs} +2 -2
- package/browser/esm/SgyjQbszb0ptsRk8.mjs +517 -0
- package/browser/esm/d1P5kwJg3I0rdzn5.mjs +318 -0
- package/browser/esm/hfHpykzxUMe5LvVF.mjs +141 -0
- package/browser/esm/{BIZX_0jxF9Fmaxuy.mjs → hjbPNszp95-0VCIw.mjs} +8 -6
- package/browser/esm/index.mjs +1910 -289
- package/browser/esm/sxqx9rjKZcYNC4Hx.mjs +77 -0
- package/browser/esm/{C--IZ8To0PhVLhoX.mjs → voMEQNZgdyO6soYo.mjs} +4 -4
- package/licenses/dependencies.txt +106 -359
- package/node/esm/{C5g2gBoUk3-cn94h.mjs → 1PN4BMQucW63NWcA.mjs} +2 -2
- package/node/esm/{BHuZQ-LJ2GgDLYSz.mjs → 4FcYpbmSwjqrMhol.mjs} +190 -141
- package/node/esm/{9k03YHFiw-wlUS8d.mjs → 6e2HZudCTjTzf6ih.mjs} +2 -2
- package/node/esm/{D4KDk-w7Khu7LrSi.mjs → B1MFTyLMh_SZnQbk.mjs} +70 -71
- package/node/esm/B2WLecbdSqMD1YVq.mjs +519 -0
- package/node/esm/BImYtxlBDnxbuYJQ.mjs +94 -0
- package/node/esm/{CNkqJbFlITxBA0t4.mjs → BQ_0nUqKSPxxzxTT.mjs} +29 -29
- package/node/esm/{Defb5qpSal98J5ay.mjs → BSJerjorDJ4w9N6r.mjs} +2 -2
- package/node/esm/{Dyd7va4aqC1jIzAk.mjs → C0KFwVu86wTgTd54.mjs} +21 -21
- package/node/esm/C0kd2sPUnsgdGUtj.mjs +197 -0
- package/node/esm/C4UnectGYMh-7x7y.mjs +267 -0
- package/node/esm/C5pD4ZSa_HiL9qxk.mjs +14 -0
- package/node/esm/C9W1LtNkMMtOs7Qg.mjs +73 -0
- package/node/esm/CAFHLlFMItMl9TpP.mjs +412 -0
- package/node/esm/CW3fvozHERUfT6Bc.mjs +294 -0
- package/node/esm/CWTDdTicFuH60csl.mjs +972 -0
- package/node/esm/ChO1UxVGRIBuNPOZ.mjs +489 -0
- package/node/esm/{BkoorcOtOEh_Y7ck.mjs → CkIf9KMnQ26-zlEa.mjs} +33 -31
- package/node/esm/CsI3f2TN7jrLwudM.mjs +106 -0
- package/node/esm/CvM_8IuzxswqHgRo.mjs +224 -0
- package/node/esm/D7iklNCWLGeAIvrP.mjs +142 -0
- package/node/esm/D9Inb0eBSow2sR6u.mjs +319 -0
- package/node/esm/DKpUHQxiykyKEuyT.mjs +638 -0
- package/node/esm/DL4-uvtWGuGAfnne.mjs +391 -0
- package/node/esm/{CTtj1NR0IrcN8PTy.mjs → DP_w1SJKb-yFCvb7.mjs} +10 -10
- package/node/esm/DR7dWTccTfAqn8m8.mjs +516 -0
- package/node/esm/DXRJq0Bn7sDr_vXm.mjs +242 -0
- package/node/esm/DZ57bmwliKKBEzB7.mjs +1276 -0
- package/node/esm/Df5VcbKeW9cXY1Lw.mjs +141 -0
- package/node/esm/{b05_u9WnJaVGO0nq.mjs → DxWAgNvtIylA_ta_.mjs} +2 -2
- package/node/esm/GsWeMsCRXwvvpe2Z.mjs +77 -0
- package/node/esm/ONS9B46FEPFzjQsi.mjs +425 -0
- package/node/esm/QfWVpAmFeAecSa0o.mjs +385 -0
- package/node/esm/{BiHw3x2LPWT-kK8G.mjs → RgfhTFBh6fACzrx4.mjs} +84 -96
- package/node/esm/UCHoCHXSYWtQeJ-9.mjs +118 -0
- package/node/esm/index.mjs +9717 -8954
- package/node/esm/mmKhNlIs2nFTMbl5.mjs +94 -0
- package/node/esm/stC67-iHu8jB-gTl.mjs +1831 -0
- package/node/esm/{DHHgNbakbpNnu0oW.mjs → uFGXjoHpIjHX5bT8.mjs} +23 -23
- package/node/esm/z_MOgf-yg9GWQtPj.mjs +975 -0
- package/package.json +16 -19
- package/resources/contents.json +6 -0
- package/resources/locales/contents.json +14 -0
- package/resources/locales/de/groups.cmd.json +59 -10
- package/resources/locales/de/ui.msg.json +267 -14
- package/resources/locales/de/workbookAnomalies.cmd.json +14 -0
- package/resources/locales/en/groups.cmd.json +63 -11
- package/resources/locales/en/ui.msg.json +272 -14
- package/resources/locales/en/workbookAnomalies.cmd.json +14 -0
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
- package/types/src/anomalies/AnomaliesCommands.d.ts +8 -0
- package/types/src/anomalies/AnomaliesMessages.d.ts +30 -0
- package/types/src/anomalies/AnomaliesPlugin.d.ts +12 -0
- package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
- package/types/src/anomalies/_source.d.ts +7 -0
- package/types/src/anomalies/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +1 -1
- package/types/src/border/BorderTemplateIcon.d.ts +6 -1
- package/types/src/chart/ChartFormatPanel.d.ts +20 -0
- package/types/src/chart/ChartPlugin.d.ts +6 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/color/ColorPopupButton.d.ts +1 -1
- package/types/src/command/AccountingStyleCommandButton.d.ts +1 -1
- package/types/src/command/ColorCommandButton.d.ts +5 -0
- package/types/src/command/DocThemeCommandButton.d.ts +1 -1
- package/types/src/command/FontFamilyCommandButton.d.ts +1 -1
- package/types/src/command/FontSizeCommandButton.d.ts +1 -1
- package/types/src/command/InsertCellControlCommandButton.d.ts +17 -0
- package/types/src/command/LanguageCommandButton.d.ts +1 -1
- package/types/src/command/LocaleCommandButton.d.ts +1 -1
- package/types/src/command/PresetCellStylesCommandButton.d.ts +3 -3
- package/types/src/command/PresetPivotStylesCommandButton.d.ts +17 -0
- package/types/src/command/SheetZoomCommandButton.d.ts +4 -3
- package/types/src/command/index.d.ts +2 -0
- package/types/src/comments/CommentCard.d.ts +2 -2
- package/types/src/comments/CommentsPlugin.d.ts +1 -1
- package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts +1 -1
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +4 -4
- package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +3 -3
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +1 -1
- package/types/src/conditions/CombinatorOption.d.ts +7 -0
- package/types/src/conditions/ConditionEditor.d.ts +55 -3
- package/types/src/conditions/ConditionUtils.d.ts +34 -6
- package/types/src/conditions/ExpressionOption.d.ts +6 -0
- package/types/src/conditions/MembershipOption.d.ts +67 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +36 -1
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +1 -1
- package/types/src/conditions/ScalarOption.d.ts +5 -4
- package/types/src/conditions/SelectorSelect.d.ts +16 -7
- package/types/src/conditions/index.d.ts +1 -1
- package/types/src/conditions/useFormulaOption.d.ts +2 -2
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +9 -5
- package/types/src/dataValidation/DataValidationIcon.d.ts +1 -1
- package/types/src/dataValidation/DataValidationPlugin.d.ts +1 -1
- package/types/src/dialog/HyperlinkDialog.d.ts +15 -0
- package/types/src/dialog/PivotTableNewDialog.d.ts +11 -0
- package/types/src/dialog/SparklineEditDialog.d.ts +10 -0
- package/types/src/dialog/SparklineNewDialog.d.ts +23 -0
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/dialog/_ShortcutSearch.d.ts +26 -0
- package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +1 -1
- package/types/src/externalLink/ExternalLinksPlugin.d.ts +1 -1
- package/types/src/fill/GradientEditor.d.ts +15 -13
- package/types/src/fill/GradientStopsBar.d.ts +43 -0
- package/types/src/fill/PatternPopupButton.d.ts +1 -1
- package/types/src/fill/index.d.ts +1 -0
- package/types/src/filter/ColumnMenu.d.ts +31 -1
- package/types/src/filter/PivotMenu.d.ts +31 -0
- package/types/src/filter/index.d.ts +1 -1
- package/types/src/form/FormulaField.d.ts +4 -4
- package/types/src/form/InputField.d.ts +5 -5
- package/types/src/format/BorderPreview.d.ts +11 -4
- package/types/src/format/FillPanel.d.ts +42 -2
- package/types/src/format/FormatPanelParts.d.ts +3 -1
- package/types/src/format/FormatPlugin.d.ts +1 -6
- package/types/src/format/LinePanel.d.ts +53 -0
- package/types/src/format/LinePreviews.d.ts +71 -0
- package/types/src/format/index.d.ts +1 -0
- package/types/src/format/useFormatSelection.d.ts +6 -6
- package/types/src/formulaBar/IFormulaBar.d.ts +32 -3
- package/types/src/formulaBar/MobileFormulaBar.d.ts +42 -0
- package/types/src/formulaBar/MobileInputToolbar.d.ts +43 -0
- package/types/src/formulaBar/index.d.ts +3 -0
- package/types/src/formulaBar/useFormulaBarSession.d.ts +68 -0
- package/types/src/index.d.ts +19 -6
- package/types/src/itemsPanel/ItemCard.d.ts +50 -7
- package/types/src/itemsPanel/ItemsPanel.d.ts +5 -0
- package/types/src/itemsPanel/ItemsSearchField.d.ts +17 -0
- package/types/src/itemsPanel/index.d.ts +1 -0
- package/types/src/named/NamedDetailsPanel.d.ts +2 -2
- package/types/src/named/NamedPlugin.d.ts +1 -1
- package/types/src/picture/PicturePlugin.d.ts +6 -0
- package/types/src/picture/index.d.ts +2 -0
- package/types/src/pivot/PivotChipMenu.d.ts +10 -0
- package/types/src/pivot/PivotPlugin.d.ts +3 -0
- package/types/src/pivot/PivotStyleCanvasPreview.d.ts +23 -0
- package/types/src/pivot/PivotTableHeader.d.ts +12 -0
- package/types/src/pivot/PivotValueSettingsDialog.d.ts +15 -0
- package/types/src/pivot/_pivotSource.d.ts +7 -0
- package/types/src/presence/PresenceOverlay.d.ts +14 -0
- package/types/src/presence/PresencePlugin.d.ts +31 -0
- package/types/src/presence/PresenceStrip.d.ts +22 -0
- package/types/src/presence/PresenceTaskPane.d.ts +13 -0
- package/types/src/presence/Timeline.d.ts +29 -0
- package/types/src/presence/index.d.ts +5 -0
- package/types/src/protection/ProtectedCellsPanel.d.ts +3 -3
- package/types/src/protection/ProtectionPlugin.d.ts +1 -1
- package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
- package/types/src/protection/index.d.ts +1 -1
- package/types/src/shape/ShapeFormatPanel.d.ts +11 -0
- package/types/src/shape/ShapeGalleryCommandButton.d.ts +18 -0
- package/types/src/shape/ShapePlugin.d.ts +8 -0
- package/types/src/shape/index.d.ts +2 -1
- package/types/src/slicer/InsertSlicerCommandButton.d.ts +13 -0
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +12 -0
- package/types/src/slicer/SlicerPlugin.d.ts +6 -0
- package/types/src/slicer/index.d.ts +3 -0
- package/types/src/statusBar/PendingStatus.d.ts +19 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +6 -0
- package/types/src/statusBar/index.d.ts +1 -0
- package/types/src/studio/StudioProps.d.ts +62 -27
- package/types/src/studio/formulaBarPlacement.d.ts +35 -0
- package/types/src/studio/useStudioApp.d.ts +25 -24
- package/types/src/table/TablePlugin.d.ts +1 -1
- package/types/src/table/_drawStyleSwatch.d.ts +25 -0
- package/types/src/template/TemplateDialog.d.ts +1 -1
- package/types/src/template/TemplatePanel.d.ts +5 -1
- package/types/src/template/TemplateSearchField.d.ts +17 -1
- package/types/src/template/categoryColor.d.ts +8 -0
- package/types/src/template/useTemplateCatalog.d.ts +2 -0
- package/types/src/theme/ThemeSelectPopupButton.d.ts +1 -1
- package/types/src/theme/ThemeUtils.d.ts +8 -27
- package/types/src/toolbar/WorkbookToolbars.d.ts +2 -2
- package/types/src/workbook/DefaultRenderers.d.ts +42 -18
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/types/src/workbook/WorkbookElement.d.ts +5 -4
- package/types/src/workbook/WorkbookStrip.d.ts +8 -7
- package/types/src/workbook/index.d.ts +1 -1
- package/browser/cjs/2tG9HJLr-WjsOCP3.cjs +0 -1
- package/browser/cjs/3RXtLkq7wTAV6y_e.cjs +0 -1
- package/browser/cjs/3k_KqDFr-AybPztc.cjs +0 -5
- package/browser/cjs/4_Zy3pR6YXkzISoK.cjs +0 -1
- package/browser/cjs/BD50lsTki7wvzb5g.cjs +0 -1
- package/browser/cjs/BJ-wdkCaXqJaejKf.cjs +0 -1
- package/browser/cjs/BQJKf40kttQWOzLw.cjs +0 -20
- package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +0 -1
- package/browser/cjs/Bc-YisjBtD56vBAW.cjs +0 -1
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
- package/browser/cjs/BpG4iwTKbAnpi0wM.cjs +0 -1
- package/browser/cjs/ByIUHPOa02D7XbdC.cjs +0 -1
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +0 -1
- package/browser/cjs/CMfoKJ3ehdXuld_7.cjs +0 -14
- package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +0 -1
- package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +0 -1
- package/browser/cjs/CdDYyAfccXme8w6m.cjs +0 -1
- package/browser/cjs/CkroJ2FmfFvk6Eyv.cjs +0 -1
- package/browser/cjs/CzJvR12QCQb-0Rtn.cjs +0 -1
- package/browser/cjs/D-Yo5aV9STT5KH4G.cjs +0 -1
- package/browser/cjs/DwkiLFWUtLC8ZcIQ.cjs +0 -1
- package/browser/cjs/HuPFsmz7kyZVo3c7.cjs +0 -1
- package/browser/cjs/KZvriGbhEOVkQD0b.cjs +0 -1
- package/browser/cjs/M0_dvdYwhikqP9kg.cjs +0 -2
- package/browser/cjs/g1WhGOz5epV7Hqsg.cjs +0 -8
- package/browser/cjs/iMWEL01eC83oU-YY.cjs +0 -1
- package/browser/cjs/index.cjs +0 -2
- package/browser/esm/BoLRDhnoO3gvviYD.mjs +0 -13811
- package/browser/esm/CH-Y2-p8GRvCHvd4.mjs +0 -52
- package/browser/esm/CUhtBLyaGSkcKB_1.mjs +0 -236
- package/browser/esm/D-Kit71xiitqCWVY.mjs +0 -5356
- package/browser/esm/DkUDZxFxx9n2Cked.mjs +0 -223
- package/browser/esm/F6kkwcBr0l-496tC.mjs +0 -152
- package/browser/esm/Q8r5yuh8Yx2ROnhC.mjs +0 -115
- package/browser/esm/iRFlbG6hQyKLVagS.mjs +0 -411
- package/browser/esm/lftI5b4ZCHVYc6OZ.mjs +0 -1150
- package/node/esm/BTZGnNrgV1na62gd.mjs +0 -415
- package/node/esm/Be0G9parvc2CTpFQ.mjs +0 -4504
- package/node/esm/CTJqjeq3smY8jw5J.mjs +0 -236
- package/node/esm/DbLFR_dnQQmZC_jm.mjs +0 -115
- package/types/src/conditions/DateTimeOption.d.ts +0 -43
- package/types/src/conditions/ListSourceOption.d.ts +0 -31
- package/types/src/filter/FilterList.d.ts +0 -32
- package/types/src/shape/InsertShapeCommandButton.d.ts +0 -10
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v1.0.2
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./hjbPNszp95-0VCIw.mjs";
|
|
8
|
+
import { IFill as t, Table as n } from "@sheetxl/sdk";
|
|
9
|
+
import { StaticBorderRenderer as r, useGridColorScheme as i } from "@sheetxl/react";
|
|
10
|
+
import { CommandButtonType as a, useCallbackRef as o, useCommands as s, useTranslator as c } from "@sheetxl/utils-react";
|
|
11
|
+
import { forwardRef as l, memo as u, useCallback as d, useEffect as f, useLayoutEffect as p, useMemo as m, useReducer as h, useRef as g, useState as _ } from "react";
|
|
12
|
+
import { CommandButton as v, CommandPopupButton as y, ContextMenu as b, ExhibitDivider as x, ExhibitIconButton as S, ExhibitMenuHeader as C, ExhibitTooltip as w, defaultRenderPopupPanel as T } from "@sheetxl/utils-mui";
|
|
13
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
14
|
+
import { Box as k } from "@mui/material";
|
|
15
|
+
var A = "_sheetxl-reset_11z3j_1", j = 10, M = u(l((t, a) => {
|
|
16
|
+
let { styles: o, table: s, tableStyle: c = s?.getStyle() ?? o.getTableStyles().getDefault(), sx: l, disabled: u, className: p, forceThinBorder: g, cellHeight: _ = j, isLive: v = !1, ...y } = t, b = i(), x = b === "dark", S = Math.ceil(1.3 * _), [C, w] = h((e) => e + 1, 0);
|
|
17
|
+
f(() => {
|
|
18
|
+
if (v && s) return s.addListeners({ onAnyChange: () => {
|
|
19
|
+
w();
|
|
20
|
+
} });
|
|
21
|
+
}, [s, v]);
|
|
22
|
+
let T = m(() => {
|
|
23
|
+
let e = s?.toJSON() ?? {}, t = {
|
|
24
|
+
width: 5,
|
|
25
|
+
height: 5
|
|
26
|
+
};
|
|
27
|
+
return e && (e.style = {
|
|
28
|
+
...e.style,
|
|
29
|
+
name: c.getName()
|
|
30
|
+
}), new n({
|
|
31
|
+
size: t,
|
|
32
|
+
json: e,
|
|
33
|
+
styles: o
|
|
34
|
+
});
|
|
35
|
+
}, [
|
|
36
|
+
C,
|
|
37
|
+
s,
|
|
38
|
+
c,
|
|
39
|
+
o
|
|
40
|
+
]), E = m(() => {
|
|
41
|
+
let e = [];
|
|
42
|
+
for (let t = 0; t < 5; t++) for (let n = 0; n < 5; n++) {
|
|
43
|
+
let r = T.getStyleAt(t, n);
|
|
44
|
+
e.push(r);
|
|
45
|
+
}
|
|
46
|
+
return e;
|
|
47
|
+
}, [T]), M = m(() => {
|
|
48
|
+
let e = T.isHiddenButtons() || !T.isShowHeaders(), t = (t, n, r) => {
|
|
49
|
+
let i = !e && t === 0, a = r.getFill().toCSS(x), o = S - +(n < 4), s = _ - +(t < 4), c = r.getFont().getColor().toCSS(x);
|
|
50
|
+
a = {
|
|
51
|
+
...a,
|
|
52
|
+
position: "absolute",
|
|
53
|
+
display: "flex",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
justifyContent: i ? "space-evenly" : "center",
|
|
56
|
+
boxSizing: "border-box",
|
|
57
|
+
left: n * (S - 1),
|
|
58
|
+
top: t * (_ - 1),
|
|
59
|
+
width: o,
|
|
60
|
+
height: s
|
|
61
|
+
};
|
|
62
|
+
let l = null;
|
|
63
|
+
return i && (l = D("svg", {
|
|
64
|
+
width: "15",
|
|
65
|
+
height: "15",
|
|
66
|
+
viewBox: "0 0 15 15",
|
|
67
|
+
style: { fill: c },
|
|
68
|
+
children: D("path", { d: "M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673" })
|
|
69
|
+
})), O("td", {
|
|
70
|
+
className: `table-style-fill ${t}-${n}`,
|
|
71
|
+
style: a,
|
|
72
|
+
children: [D("div", {
|
|
73
|
+
className: `table-style-text ${t}-${n}`,
|
|
74
|
+
style: {
|
|
75
|
+
boxSizing: "border-box",
|
|
76
|
+
width: "6px",
|
|
77
|
+
borderTop: `1px solid ${c}`
|
|
78
|
+
}
|
|
79
|
+
}), l]
|
|
80
|
+
}, `${t}-${n}`);
|
|
81
|
+
}, n = [];
|
|
82
|
+
for (let e = 0; e < 5; e++) {
|
|
83
|
+
let r = [];
|
|
84
|
+
for (let n = 0; n < 5; n++) {
|
|
85
|
+
let i = E[5 * e + n];
|
|
86
|
+
r.push(t(e, n, i));
|
|
87
|
+
}
|
|
88
|
+
n.push(D("tr", { children: r }, e));
|
|
89
|
+
}
|
|
90
|
+
return n;
|
|
91
|
+
}, [
|
|
92
|
+
T,
|
|
93
|
+
c,
|
|
94
|
+
x,
|
|
95
|
+
T.isHiddenButtons()
|
|
96
|
+
]), N = d((e, t) => E[t].getBorders() ?? null, [E]);
|
|
97
|
+
return D(k, {
|
|
98
|
+
ref: a,
|
|
99
|
+
className: "table-format-preview",
|
|
100
|
+
"data-sxl-theme-surface": "grid",
|
|
101
|
+
"data-sxl-theme-mode": b,
|
|
102
|
+
sx: {
|
|
103
|
+
background: "var(--sxl-color-base-100)",
|
|
104
|
+
filter: u ? "grayscale(0.4) opacity(0.8);" : "none",
|
|
105
|
+
"& .styled-element": { position: "absolute" },
|
|
106
|
+
...l
|
|
107
|
+
},
|
|
108
|
+
...y,
|
|
109
|
+
children: D(r, {
|
|
110
|
+
getBorderAt: N,
|
|
111
|
+
rowCount: 5,
|
|
112
|
+
columnCount: 5,
|
|
113
|
+
forceThinBorder: g,
|
|
114
|
+
width: 5 * (S - 1) + 1,
|
|
115
|
+
height: 5 * (_ - 1) + 1,
|
|
116
|
+
style: { pointerEvents: "none" },
|
|
117
|
+
children: D("table", {
|
|
118
|
+
className: e(p, "sheetxl-table-preview", A),
|
|
119
|
+
style: {
|
|
120
|
+
borderCollapse: "collapse",
|
|
121
|
+
width: 5 * (S - 1) + 1,
|
|
122
|
+
height: 5 * (_ - 1) + 1
|
|
123
|
+
},
|
|
124
|
+
children: D("tbody", { children: M })
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
});
|
|
128
|
+
})), N = (e) => ({
|
|
129
|
+
width: e.columns * e.cellWidth - (e.columns - 1),
|
|
130
|
+
height: e.rows * e.cellHeight - (e.rows - 1)
|
|
131
|
+
}), P = (e, t, n, r, i) => {
|
|
132
|
+
e.beginPath(), e.moveTo(t + .5, n + .5), e.lineTo(r + .5, i + .5), e.stroke();
|
|
133
|
+
}, F = (e, n, r, i, a, o) => {
|
|
134
|
+
let { rows: s, columns: c } = n, l = [];
|
|
135
|
+
for (let e = 0; e < s; e++) for (let t = 0; t < c; t++) l.push(r(e, t));
|
|
136
|
+
let { width: u, height: d } = N(n);
|
|
137
|
+
e.width !== u && (e.width = u), e.height !== d && (e.height = d);
|
|
138
|
+
let f = e.getContext("2d", {
|
|
139
|
+
alpha: !1,
|
|
140
|
+
willReadFrequently: !0
|
|
141
|
+
});
|
|
142
|
+
if (!f) return null;
|
|
143
|
+
let p = n.cellWidth - 1, m = n.cellHeight - 1;
|
|
144
|
+
for (let e = 0; e < s; e++) for (let n = 0; n < c; n++) {
|
|
145
|
+
let r = l[e * c + n].getFill(), o = a;
|
|
146
|
+
r.getType() === t.Type.Solid ? o = r.getColor().toRGBA(i).toString() : r.getType() === t.Type.Gradient ? o = r.getStops()[0]?.getColor().toRGBA(i).toString() : r.getType() === t.Type.Pattern && (o = r.getForeground().toRGBA(i).toString()), f.fillStyle = o ?? a;
|
|
147
|
+
let s = n * p, u = e * m;
|
|
148
|
+
f.fillRect(s, u, p + 1, m + 1);
|
|
149
|
+
}
|
|
150
|
+
f.lineWidth = 1;
|
|
151
|
+
for (let e = 0; e < s; e++) for (let t = 0; t < c; t++) {
|
|
152
|
+
let n = l[e * c + t], r = t * p, a = e * m, s = n.getBorders();
|
|
153
|
+
if (!s.isEmpty()) {
|
|
154
|
+
let t = s.getLeft();
|
|
155
|
+
t.isNone() || (f.strokeStyle = t.getColor().toRGBA(i).toString(), P(f, r, a, r, a + m));
|
|
156
|
+
let n = s.getTop();
|
|
157
|
+
n.isNone() || (f.strokeStyle = n.getColor().toRGBA(i).toString(), P(f, r, a, r + p, e * m));
|
|
158
|
+
let o = s.getRight();
|
|
159
|
+
o.isNone() || (f.strokeStyle = o.getColor().toRGBA(i).toString(), P(f, r + p, a, r + p, a + m));
|
|
160
|
+
let c = s.getBottom();
|
|
161
|
+
c.isNone() || (f.strokeStyle = c.getColor().toRGBA(i).toString(), P(f, r, a + m, r + p, a + m));
|
|
162
|
+
}
|
|
163
|
+
if (o && !o(e, t)) continue;
|
|
164
|
+
f.strokeStyle = n.getFont().getColor().toRGBA(i).toString();
|
|
165
|
+
let u = Math.floor((m - 1 + 1) / 2), d = (p - 7) / 2;
|
|
166
|
+
P(f, t * p + d, e * m + u, t * p + d + 7, e * m + u);
|
|
167
|
+
}
|
|
168
|
+
return `url(${e.toDataURL()})`;
|
|
169
|
+
}, I = /* @__PURE__ */ new WeakMap(), L = {
|
|
170
|
+
rows: 5,
|
|
171
|
+
columns: 5,
|
|
172
|
+
cellWidth: 13,
|
|
173
|
+
cellHeight: 10
|
|
174
|
+
}, { width: R, height: z } = N(L), B = u(l((t, r) => {
|
|
175
|
+
let { table: a, tableStyle: o, styles: s, disabled: c, style: l, className: u, canvas: f, ...h } = t, g = i(), v = g === "dark", [y, b] = _(null), [x, S] = _(void 0), C = d((e) => {
|
|
176
|
+
b(e), typeof r == "function" ? r(e) : r && (r.current = e);
|
|
177
|
+
}, [r]);
|
|
178
|
+
p(() => {
|
|
179
|
+
y && S(getComputedStyle(y).getPropertyValue("--sxl-color-base-100").trim() || "#ffffff");
|
|
180
|
+
}, [y, g]);
|
|
181
|
+
let w = m(() => {
|
|
182
|
+
if (x === void 0) return null;
|
|
183
|
+
let e = a.toJSON();
|
|
184
|
+
if (!e) return null;
|
|
185
|
+
e.style = {
|
|
186
|
+
...e.style,
|
|
187
|
+
name: o.getName()
|
|
188
|
+
};
|
|
189
|
+
let t = x, r = s?.getTheme(), i = `${JSON.stringify(e.style)}|h${e.headerRowCount ?? 0}|t${e.totalsRowCount ?? 0}|${v ? "dark" : "light"}|${t}` + (o.isBuiltIn() ? "" : `|${JSON.stringify(o.toJSON())}`), c = r ? I.get(r) : void 0, l = c?.get(i);
|
|
190
|
+
if (l) return l;
|
|
191
|
+
let u = new n({
|
|
192
|
+
size: {
|
|
193
|
+
width: 5,
|
|
194
|
+
height: 5
|
|
195
|
+
},
|
|
196
|
+
json: e,
|
|
197
|
+
styles: s
|
|
198
|
+
}), d = F(f ?? document.createElement("canvas"), L, (e, t) => u.getStyleAt(e, t), v, t);
|
|
199
|
+
return d ? (r && (c || (c = /* @__PURE__ */ new Map(), I.set(r, c)), c.set(i, d)), d) : null;
|
|
200
|
+
}, [
|
|
201
|
+
f,
|
|
202
|
+
a,
|
|
203
|
+
o,
|
|
204
|
+
s,
|
|
205
|
+
v,
|
|
206
|
+
x
|
|
207
|
+
]);
|
|
208
|
+
return D("div", {
|
|
209
|
+
ref: C,
|
|
210
|
+
"data-sxl-theme-surface": "grid",
|
|
211
|
+
"data-sxl-theme-mode": g,
|
|
212
|
+
className: e("table-style-preview", u),
|
|
213
|
+
style: {
|
|
214
|
+
backgroundImage: w ?? void 0,
|
|
215
|
+
width: R,
|
|
216
|
+
height: z,
|
|
217
|
+
...l
|
|
218
|
+
},
|
|
219
|
+
...h
|
|
220
|
+
});
|
|
221
|
+
})), V = u((e) => {
|
|
222
|
+
let { table: t, tableStyle: n, selectedTableStyleName: r, onSelectTableStyleName: i, styles: o, hasContextMenu: s = !0, disabled: l, useCanvasPreview: u = !0, canvas: f, ...p } = e, h = c(), g = d((e) => {
|
|
223
|
+
let t = {
|
|
224
|
+
variant: a.Menuitem,
|
|
225
|
+
groupKey: "tableStyleOptions"
|
|
226
|
+
}, r = O(E, { children: [
|
|
227
|
+
D(v, {
|
|
228
|
+
...t,
|
|
229
|
+
commandKey: "formatTableStyleClearCellStyles",
|
|
230
|
+
commandState: n,
|
|
231
|
+
disabled: l
|
|
232
|
+
}),
|
|
233
|
+
D(v, {
|
|
234
|
+
...t,
|
|
235
|
+
style: { fontWeight: 550 },
|
|
236
|
+
commandKey: "formatTableStyle",
|
|
237
|
+
commandState: { name: n.getName() },
|
|
238
|
+
disabled: l
|
|
239
|
+
}),
|
|
240
|
+
D(x, { orientation: "horizontal" }),
|
|
241
|
+
D(v, {
|
|
242
|
+
...t,
|
|
243
|
+
commandKey: "setDefaultTableStyle",
|
|
244
|
+
commandState: n.getName(),
|
|
245
|
+
disabled: l
|
|
246
|
+
}),
|
|
247
|
+
D(x, { orientation: "horizontal" }),
|
|
248
|
+
D(v, {
|
|
249
|
+
...t,
|
|
250
|
+
commandKey: "deleteTableStyle",
|
|
251
|
+
commandState: n?.getName(),
|
|
252
|
+
disabled: l || !n || n.isBuiltIn()
|
|
253
|
+
})
|
|
254
|
+
] });
|
|
255
|
+
return T({
|
|
256
|
+
...e,
|
|
257
|
+
children: D(k, {
|
|
258
|
+
sx: {
|
|
259
|
+
display: "flex",
|
|
260
|
+
flexDirection: "column",
|
|
261
|
+
flex: "1 1 100%",
|
|
262
|
+
overflow: "hidden"
|
|
263
|
+
},
|
|
264
|
+
children: D(k, {
|
|
265
|
+
sx: {
|
|
266
|
+
overflow: "auto",
|
|
267
|
+
flex: "1 1 100%"
|
|
268
|
+
},
|
|
269
|
+
children: r
|
|
270
|
+
})
|
|
271
|
+
})
|
|
272
|
+
});
|
|
273
|
+
}, []), _ = n?.getName() === r, y = m(() => {
|
|
274
|
+
let e = {
|
|
275
|
+
table: t,
|
|
276
|
+
tableStyle: n,
|
|
277
|
+
styles: o
|
|
278
|
+
};
|
|
279
|
+
return u ? D(B, {
|
|
280
|
+
canvas: f,
|
|
281
|
+
...e
|
|
282
|
+
}) : D(M, { ...e });
|
|
283
|
+
}, [
|
|
284
|
+
t,
|
|
285
|
+
n,
|
|
286
|
+
o
|
|
287
|
+
]), C = D(S, {
|
|
288
|
+
sx: {
|
|
289
|
+
borderRadius: "2px",
|
|
290
|
+
padding: "2px",
|
|
291
|
+
margin: "0px 0px",
|
|
292
|
+
display: "flex",
|
|
293
|
+
border: (e) => `solid ${_ ? e.palette.primary.dark : "transparent"} 1px`
|
|
294
|
+
},
|
|
295
|
+
propsTooltip: {
|
|
296
|
+
label: n.getName() ?? h("tableStyle.none"),
|
|
297
|
+
placement: "bottom-start"
|
|
298
|
+
},
|
|
299
|
+
disabled: l,
|
|
300
|
+
icon: null,
|
|
301
|
+
onClick: () => {
|
|
302
|
+
i?.(n?.getName());
|
|
303
|
+
},
|
|
304
|
+
...p,
|
|
305
|
+
children: y
|
|
306
|
+
}, n.getName());
|
|
307
|
+
return s && (C = D(b, {
|
|
308
|
+
label: t.getStyleOptions().name,
|
|
309
|
+
renderPopupPanel: g,
|
|
310
|
+
children: C
|
|
311
|
+
})), C;
|
|
312
|
+
}), H = u(l((e, t) => {
|
|
313
|
+
let { commandKey: r, selectedTable: i, onSelectTableStyleName: l, disabled: u, disabledQuickKey: p = !1, usePreviewIcon: h = !1, groupKey: b, ...S } = e, T = c(), A = s([r])[0], j = A?.getContext(), M = j?.styles, N = M?.(), P = i ?? j?.table?.() ?? null, F = "insertTable";
|
|
314
|
+
P && (F = "editTable");
|
|
315
|
+
let I = m(() => ((e, t) => new n({
|
|
316
|
+
size: {
|
|
317
|
+
width: 5,
|
|
318
|
+
height: 5
|
|
319
|
+
},
|
|
320
|
+
styles: t,
|
|
321
|
+
json: {
|
|
322
|
+
name: "PreviewTable",
|
|
323
|
+
description: "PreviewTable",
|
|
324
|
+
headerRowCount: 1,
|
|
325
|
+
totalsRowCount: 0,
|
|
326
|
+
style: e
|
|
327
|
+
}
|
|
328
|
+
}))(P?.getStyleOptions(), N), [N?.getTableStyles().getDefault(), P?.getStyleOptions()]), L = P ?? I, [R, z] = _(L);
|
|
329
|
+
f(() => {
|
|
330
|
+
z(L);
|
|
331
|
+
}, [L]);
|
|
332
|
+
let B = o((e) => {
|
|
333
|
+
l?.(e), A?.execute({ name: e });
|
|
334
|
+
}, [A, l]), H = g(null), U = d((e) => {
|
|
335
|
+
let t = {
|
|
336
|
+
onSelectTableStyleName: B,
|
|
337
|
+
styles: N
|
|
338
|
+
};
|
|
339
|
+
H.current ||= document.createElement("canvas");
|
|
340
|
+
let n = (e) => {
|
|
341
|
+
if (!e) return null;
|
|
342
|
+
let n = N?.getTableStyles().getByName(e);
|
|
343
|
+
return n ? D(V, {
|
|
344
|
+
table: R,
|
|
345
|
+
tableStyle: n,
|
|
346
|
+
selectedTableStyleName: R.getStyleOptions().name,
|
|
347
|
+
canvas: H.current,
|
|
348
|
+
...t
|
|
349
|
+
}, e) : null;
|
|
350
|
+
}, r = (e, t, r = !0) => {
|
|
351
|
+
let i = [];
|
|
352
|
+
for (let e = 0; e < t.length; e++) {
|
|
353
|
+
let r = n(t[e]);
|
|
354
|
+
r && i.push(r);
|
|
355
|
+
}
|
|
356
|
+
return i.length === 0 ? null : O(k, { children: [
|
|
357
|
+
r ? D(x, { orientation: "horizontal" }) : null,
|
|
358
|
+
D(C, { children: e }, e + "-header"),
|
|
359
|
+
D(k, {
|
|
360
|
+
sx: {
|
|
361
|
+
display: "flex",
|
|
362
|
+
gap: "2px",
|
|
363
|
+
marginBottom: "6px",
|
|
364
|
+
flexWrap: "wrap",
|
|
365
|
+
width: "481px",
|
|
366
|
+
maxWidth: "100%"
|
|
367
|
+
},
|
|
368
|
+
children: i
|
|
369
|
+
}, e + "-presets")
|
|
370
|
+
] }, e);
|
|
371
|
+
}, i = [], o = N?.getTableStyles().getItems({ type: "custom" }), s = [], c = o ? o.length : 0;
|
|
372
|
+
if (c > 0) {
|
|
373
|
+
for (let e = 0; e < c; e++) {
|
|
374
|
+
let t = o[e];
|
|
375
|
+
t.isShownInTableStyles() && s.push(t.getName());
|
|
376
|
+
}
|
|
377
|
+
i.push(r(T("tableStyle.category.custom"), s, !1));
|
|
378
|
+
}
|
|
379
|
+
let l = [];
|
|
380
|
+
P && !P.getStyleOptions().name && l.push(null);
|
|
381
|
+
for (let e = 0; e < 21; e++) l.push("TableStyleLight" + (e + 1));
|
|
382
|
+
i.push(r(T("tableStyle.category.light"), l, s.length > 0));
|
|
383
|
+
let d = [];
|
|
384
|
+
for (let e = 0; e < 28; e++) d.push("TableStyleMedium" + (e + 1));
|
|
385
|
+
i.push(r(T("tableStyle.category.medium"), d));
|
|
386
|
+
let f = [];
|
|
387
|
+
for (let e = 0; e < 11; e++) f.push("TableStyleDark" + (e + 1));
|
|
388
|
+
i.push(r(T("tableStyle.category.dark"), f));
|
|
389
|
+
let p = null;
|
|
390
|
+
return P && (p = O(E, { children: [D(x, { orientation: "horizontal" }), D(v, {
|
|
391
|
+
variant: a.Menuitem,
|
|
392
|
+
commandKey: "formatTableStyleClearTableStyle",
|
|
393
|
+
disabled: u
|
|
394
|
+
})] })), O(k, {
|
|
395
|
+
sx: {
|
|
396
|
+
display: "flex",
|
|
397
|
+
flexDirection: "column",
|
|
398
|
+
maxWidth: "100%",
|
|
399
|
+
paddingTop: (e) => `${e.shape.borderRadius}px`,
|
|
400
|
+
paddingBottom: (e) => `${e.shape.borderRadius}px`
|
|
401
|
+
},
|
|
402
|
+
children: [D(k, {
|
|
403
|
+
onContextMenu: () => {},
|
|
404
|
+
sx: {
|
|
405
|
+
display: "flex",
|
|
406
|
+
flexDirection: "column",
|
|
407
|
+
padding: "6px 16px"
|
|
408
|
+
},
|
|
409
|
+
children: i
|
|
410
|
+
}), p]
|
|
411
|
+
});
|
|
412
|
+
}, [
|
|
413
|
+
N,
|
|
414
|
+
N?.getTheme(),
|
|
415
|
+
R,
|
|
416
|
+
T
|
|
417
|
+
]), W = u ?? (!A || A.disabled()), G = m(() => {
|
|
418
|
+
if (!j || !h) return A?.getIcon();
|
|
419
|
+
}, [
|
|
420
|
+
R,
|
|
421
|
+
W,
|
|
422
|
+
A
|
|
423
|
+
]);
|
|
424
|
+
return D(y, {
|
|
425
|
+
ref: t,
|
|
426
|
+
quickCommand: p ? void 0 : F,
|
|
427
|
+
renderPopupPanel: U,
|
|
428
|
+
label: A?.getLabel(b),
|
|
429
|
+
groupKey: b,
|
|
430
|
+
commandState: P,
|
|
431
|
+
renderTooltip: ({ children: e, disabled: t }) => D(w, {
|
|
432
|
+
label: A?.getLabel(),
|
|
433
|
+
description: A?.getDescription(),
|
|
434
|
+
disabled: t,
|
|
435
|
+
children: e
|
|
436
|
+
}),
|
|
437
|
+
disabled: W,
|
|
438
|
+
icon: G,
|
|
439
|
+
...S
|
|
440
|
+
});
|
|
441
|
+
}));
|
|
442
|
+
export { M as a, N as i, B as n, F as r, H as t };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v1.0.2
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { NumberFormat as e } from "@sheetxl/sdk";
|
|
8
|
+
import { DynamicIcon as t, KeyCodes as n, useCommands as r, useLanguage as i, useTranslator as a } from "@sheetxl/utils-react";
|
|
9
|
+
import { forwardRef as o, memo as s, useCallback as c } from "react";
|
|
10
|
+
import { CommandButton as l, CommandPopupButton as u, ExhibitDivider as d, ExhibitMenuItem as f, ExhibitTooltip as p, defaultRenderPopupPanel as m } from "@sheetxl/utils-mui";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { Box as _, Typography as v } from "@mui/material";
|
|
13
|
+
import { alpha as y } from "@mui/system";
|
|
14
|
+
var b = s((e) => {
|
|
15
|
+
let { label: t, sample: n, sx: r, ...i } = e, a = !!n && n.length > 0;
|
|
16
|
+
return g(_, {
|
|
17
|
+
sx: {
|
|
18
|
+
display: "flex",
|
|
19
|
+
flex: "1 1 100%",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
overflow: "hidden",
|
|
22
|
+
"*": { lineHeight: "1.4" },
|
|
23
|
+
...r
|
|
24
|
+
},
|
|
25
|
+
...i,
|
|
26
|
+
children: [h(v, {
|
|
27
|
+
component: "div",
|
|
28
|
+
children: t
|
|
29
|
+
}), h(v, {
|
|
30
|
+
variant: "caption",
|
|
31
|
+
component: "div",
|
|
32
|
+
sx: {
|
|
33
|
+
color: (e) => y(e.palette.text.primary, .6),
|
|
34
|
+
paddingTop: a ? "1px" : void 0,
|
|
35
|
+
overflow: "hidden",
|
|
36
|
+
textOverflow: "ellipsis"
|
|
37
|
+
},
|
|
38
|
+
children: a ? n : " "
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
b.displayName = "NumberFormatOption";
|
|
43
|
+
var x = (t, n) => {
|
|
44
|
+
switch (n) {
|
|
45
|
+
case e.Type.General: return t("numberFormat.catGeneral");
|
|
46
|
+
case e.Type.Number: return t("numberFormat.catNumber");
|
|
47
|
+
case e.Type.Currency: return t("numberFormat.catCurrency");
|
|
48
|
+
case e.Type.Accounting: return t("numberFormat.catAccounting");
|
|
49
|
+
case e.Type.ShortDate: return t("numberFormat.typeShortDate");
|
|
50
|
+
case e.Type.MediumDate: return t("numberFormat.typeMediumDate");
|
|
51
|
+
case e.Type.LongDate: return t("numberFormat.typeLongDate");
|
|
52
|
+
case e.Type.ShortTime: return t("numberFormat.typeShortTime");
|
|
53
|
+
case e.Type.MediumTime: return t("numberFormat.typeMediumTime");
|
|
54
|
+
case e.Type.LongTime: return t("numberFormat.typeLongTime");
|
|
55
|
+
case e.Type.Comma: return t("numberFormat.typeComma");
|
|
56
|
+
case e.Type.Percentage: return t("numberFormat.catPercentage");
|
|
57
|
+
case e.Type.Fraction: return t("numberFormat.catFraction");
|
|
58
|
+
case e.Type.Scientific: return t("numberFormat.catScientific");
|
|
59
|
+
case e.Type.Text: return t("numberFormat.catText");
|
|
60
|
+
case e.Type.Special: return t("numberFormat.catSpecial");
|
|
61
|
+
case e.Type.Custom: return t("numberFormat.catCustom");
|
|
62
|
+
default: return n;
|
|
63
|
+
}
|
|
64
|
+
}, S = (e, t) => {
|
|
65
|
+
switch (t) {
|
|
66
|
+
case "General": return e("numberFormat.catGeneral");
|
|
67
|
+
case "Number": return e("numberFormat.catNumber");
|
|
68
|
+
case "Currency": return e("numberFormat.catCurrency");
|
|
69
|
+
case "Accounting": return e("numberFormat.catAccounting");
|
|
70
|
+
case "Date": return e("numberFormat.catDate");
|
|
71
|
+
case "Time": return e("numberFormat.catTime");
|
|
72
|
+
case "Percentage": return e("numberFormat.catPercentage");
|
|
73
|
+
case "Fraction": return e("numberFormat.catFraction");
|
|
74
|
+
case "Scientific": return e("numberFormat.catScientific");
|
|
75
|
+
case "Text": return e("numberFormat.catText");
|
|
76
|
+
case "Special": return e("numberFormat.catSpecial");
|
|
77
|
+
case "Custom": return e("numberFormat.catCustom");
|
|
78
|
+
default: return t;
|
|
79
|
+
}
|
|
80
|
+
}, { Builder: C } = e, w = /* @__PURE__ */ "USD.EUR.JPY.GBP.CNY.AUD.CAD.CHF.HKD.SGD.SEK.NOK.DKK.NZD.KRW.INR.BRL.RUB.ZAR.MXN.TRY.PLN.THB.IDR.ILS.AED.SAR.CZK.HUF.PHP.MYR.TWD".split("."), T = s(o((e, o) => {
|
|
81
|
+
let { sx: s, disabled: l, groupKey: y, ...b } = e, x = a(), S = i(), [T] = r(["formatNumberFormatAccountingStyle"]), D = l ?? (!T || T.disabled()), O = c((e) => {
|
|
82
|
+
let t = (t) => {
|
|
83
|
+
e.closeFloat?.(), T?.execute(t ?? void 0);
|
|
84
|
+
}, r = (e) => ({
|
|
85
|
+
disabled: D,
|
|
86
|
+
sx: {
|
|
87
|
+
display: "flex",
|
|
88
|
+
paddingTop: "4px",
|
|
89
|
+
paddingBottom: "4px",
|
|
90
|
+
flex: "none"
|
|
91
|
+
},
|
|
92
|
+
onMouseUp: (t) => {
|
|
93
|
+
t.button === 0 && e();
|
|
94
|
+
},
|
|
95
|
+
onMouseDown: (e) => {
|
|
96
|
+
e.button === 0 && e.preventDefault();
|
|
97
|
+
},
|
|
98
|
+
onKeyDown: (t) => {
|
|
99
|
+
t.keyCode !== n.Enter && t.keyCode !== n.Space || e();
|
|
100
|
+
}
|
|
101
|
+
}), i = (e) => h(_, {
|
|
102
|
+
sx: {
|
|
103
|
+
display: "flex",
|
|
104
|
+
flex: "1 1 100%",
|
|
105
|
+
flexDirection: "column",
|
|
106
|
+
overflow: "hidden"
|
|
107
|
+
},
|
|
108
|
+
children: h(v, {
|
|
109
|
+
component: "div",
|
|
110
|
+
sx: {
|
|
111
|
+
whiteSpace: "nowrap",
|
|
112
|
+
overflow: "hidden",
|
|
113
|
+
textOverflow: "ellipsis"
|
|
114
|
+
},
|
|
115
|
+
children: e
|
|
116
|
+
})
|
|
117
|
+
}), a = [...w].sort((e, t) => E(e, S).localeCompare(E(t, S))).map((e) => {
|
|
118
|
+
let n = function(e) {
|
|
119
|
+
try {
|
|
120
|
+
return new Intl.NumberFormat("en", {
|
|
121
|
+
style: "currency",
|
|
122
|
+
currency: e,
|
|
123
|
+
currencyDisplay: "narrowSymbol"
|
|
124
|
+
}).formatToParts(0).find((e) => e.type === "currency")?.value ?? e;
|
|
125
|
+
} catch {
|
|
126
|
+
return e;
|
|
127
|
+
}
|
|
128
|
+
}(e);
|
|
129
|
+
return h(f, {
|
|
130
|
+
...r(() => t(function(e) {
|
|
131
|
+
let t = C.parse(C.defaultCodeForCategory("Accounting"));
|
|
132
|
+
return C.build({
|
|
133
|
+
...t,
|
|
134
|
+
currencySymbol: e
|
|
135
|
+
});
|
|
136
|
+
}(n))),
|
|
137
|
+
children: i(`${n} ${E(e, S)} (${e})`)
|
|
138
|
+
}, e);
|
|
139
|
+
});
|
|
140
|
+
return m({
|
|
141
|
+
...e,
|
|
142
|
+
children: g(_, {
|
|
143
|
+
sx: {
|
|
144
|
+
display: "flex",
|
|
145
|
+
flexDirection: "column",
|
|
146
|
+
flex: "1 1 100%",
|
|
147
|
+
overflow: "hidden"
|
|
148
|
+
},
|
|
149
|
+
children: [g(_, {
|
|
150
|
+
sx: { flex: "none" },
|
|
151
|
+
children: [h(f, {
|
|
152
|
+
...r(() => t()),
|
|
153
|
+
children: i(x("numberFormat.accountingDefault"))
|
|
154
|
+
}, "default-currency"), h(d, { orientation: "horizontal" })]
|
|
155
|
+
}), h(_, {
|
|
156
|
+
sx: {
|
|
157
|
+
overflow: "auto",
|
|
158
|
+
flex: "1 1 100%"
|
|
159
|
+
},
|
|
160
|
+
children: a
|
|
161
|
+
})]
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
}, [
|
|
165
|
+
T,
|
|
166
|
+
D,
|
|
167
|
+
x,
|
|
168
|
+
S
|
|
169
|
+
]);
|
|
170
|
+
return h(u, {
|
|
171
|
+
ref: o,
|
|
172
|
+
sx: { ...s },
|
|
173
|
+
disabled: D,
|
|
174
|
+
quickCommand: "formatNumberFormatAccountingStyle",
|
|
175
|
+
renderPopupPanel: O,
|
|
176
|
+
renderTooltip: ({ children: e, disabled: t }) => h(p, {
|
|
177
|
+
label: T?.getLabel?.(y),
|
|
178
|
+
description: T?.getDescription?.(y),
|
|
179
|
+
disabled: t,
|
|
180
|
+
children: e
|
|
181
|
+
}),
|
|
182
|
+
icon: h(t, { iconKey: "CurrencyDollar" }),
|
|
183
|
+
label: T?.getLabel?.(y),
|
|
184
|
+
...b
|
|
185
|
+
});
|
|
186
|
+
}));
|
|
187
|
+
function E(e, t) {
|
|
188
|
+
try {
|
|
189
|
+
return new Intl.DisplayNames([t ?? "en"], { type: "currency" }).of(e) ?? e;
|
|
190
|
+
} catch {
|
|
191
|
+
return e;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
var D = "numberFormatOptions", O = s(o((e, t) => {
|
|
195
|
+
let { groupKey: n = D, disabled: r, sx: i, ...a } = e;
|
|
196
|
+
return g(_, {
|
|
197
|
+
ref: t,
|
|
198
|
+
className: "quick-buttons",
|
|
199
|
+
sx: {
|
|
200
|
+
display: "flex",
|
|
201
|
+
alignItems: "center",
|
|
202
|
+
justifyContent: "center",
|
|
203
|
+
...i
|
|
204
|
+
},
|
|
205
|
+
...a,
|
|
206
|
+
children: [
|
|
207
|
+
h(T, {
|
|
208
|
+
groupKey: n,
|
|
209
|
+
disabled: r
|
|
210
|
+
}),
|
|
211
|
+
h(l, {
|
|
212
|
+
commandKey: "formatNumberFormatPercentStyle",
|
|
213
|
+
groupKey: n,
|
|
214
|
+
disabled: r
|
|
215
|
+
}),
|
|
216
|
+
h(l, {
|
|
217
|
+
commandKey: "formatNumberFormatCommaStyle",
|
|
218
|
+
groupKey: n,
|
|
219
|
+
disabled: r
|
|
220
|
+
}),
|
|
221
|
+
h(l, {
|
|
222
|
+
commandKey: "formatNumberFormatIncreaseDecimal",
|
|
223
|
+
groupKey: n,
|
|
224
|
+
disabled: r
|
|
225
|
+
}),
|
|
226
|
+
h(l, {
|
|
227
|
+
commandKey: "formatNumberFormatDecreaseDecimal",
|
|
228
|
+
groupKey: n,
|
|
229
|
+
disabled: r
|
|
230
|
+
})
|
|
231
|
+
]
|
|
232
|
+
});
|
|
233
|
+
}));
|
|
234
|
+
O.displayName = "NumberFormatQuickButtons";
|
|
235
|
+
export { x as a, S as i, O as n, b as r, D as t };
|