@sheetxl/studio-mui 0.8.0-beta.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +17 -7
- package/browser/esm/{B57WM1X24rsvTF_o.mjs → 2dGXbxSvPxpMpoQB.mjs} +2 -2
- package/browser/esm/AKfq7wiKunwYv5Co.mjs +87 -0
- package/browser/esm/{DyNZEBlugP-x15kP.mjs → B16SyYhTCohin7vO.mjs} +4 -4
- package/browser/esm/B4qh8uSPezvUgs_C.mjs +414 -0
- package/browser/esm/BGR0Hv_mjOPfYxiD.mjs +975 -0
- package/browser/esm/{DR95Rgl8ItgWla8V.mjs → BVbTWo0j5ttMcIWs.mjs} +3 -3
- package/browser/esm/BctMjTuii_LaWmHJ.mjs +119 -0
- package/browser/esm/{CH7ZfljN7ru0Y9Wg.mjs → Bf-pwjpYBKNwL4f8.mjs} +4 -4
- package/browser/esm/Bh7XfTPJIFjaL6fa.mjs +13 -0
- package/browser/esm/BjH_mK6445rm6PL1.mjs +94 -0
- package/browser/esm/BqJSEK805PP8lILC.mjs +197 -0
- package/browser/esm/BrIWEn7tabhEreBm.mjs +973 -0
- package/browser/esm/{D88iVsgfDG9k-qf_.mjs → BsFK55lPALVUu31_.mjs} +5 -5
- package/browser/esm/{3L04oqyfyjRxhmzg.mjs → C0PinnqWu_JwK9l_.mjs} +33 -31
- package/browser/esm/C1KcphZVjVAE638t.mjs +415 -0
- package/browser/esm/{C36WT3I3aIR8y7I6.mjs → C3V7EwPHHPx9aEkE.mjs} +47 -48
- package/browser/esm/CCAPeyEqlStPrh6B.mjs +294 -0
- package/browser/esm/CF2Az5oBVjAigMRt.mjs +68 -0
- package/browser/esm/CIqEqDyl8JZRMblX.mjs +225 -0
- package/browser/esm/CJERhz_1u40JkHfH.mjs +235 -0
- package/browser/esm/CNtF9Fix0G6BEVEl.mjs +424 -0
- package/browser/esm/{D7HOLngE_1FYF6y6.mjs → CWP52da2iNOs3Qtz.mjs} +82 -94
- package/browser/esm/CWpF_0HjYiRiddX6.mjs +31 -0
- package/browser/esm/CbedwfwBLBaagGD-.mjs +360 -0
- package/browser/esm/{DNhLiDpvz3lAR190.mjs → Cc9tcBSYzJIv-dZw.mjs} +156 -109
- package/browser/esm/CcPLziOAdWTbG7xx.mjs +141 -0
- package/browser/esm/CdRnGw_9tvkn9d9o.mjs +335 -0
- package/browser/esm/{BWAIbfQZ6h5xVLdB.mjs → CgLDSZ8XvBqAB-Y2.mjs} +20 -18
- package/browser/esm/CgZLR7ijzsUoawf8.mjs +1281 -0
- package/browser/esm/Cn6OsV-MbO0rIM-o.mjs +442 -0
- package/browser/esm/{0Rpk1T56LoSnDrmq.mjs → CnDnNU6GGzM05K8w.mjs} +4 -4
- package/browser/esm/CnVHQ6i6a8VCMsn1.mjs +106 -0
- package/browser/esm/D06He-Tw4moPdM5f.mjs +103 -0
- package/browser/esm/D9lQwTAJ9RO60ovS.mjs +72 -0
- package/browser/esm/{D3BwGfI_IEjay0dA.mjs → D9xw1YuRJUjPMaqA.mjs} +2 -2
- package/browser/esm/DBr6lCvWLLwnzSGy.mjs +386 -0
- package/browser/esm/DEdHwT-2JZO9HyZN.mjs +14 -0
- package/browser/esm/DH4SdW-02-I8082_.mjs +14 -0
- package/browser/esm/DHbnrUh5rdi62fgO.mjs +516 -0
- package/browser/esm/DJRKcOT0Xv-1r0OP.mjs +161 -0
- package/browser/esm/DPycoTH_4RNdK2hu.mjs +252 -0
- package/browser/esm/{CpTqhDZotYaKGbLl.mjs → DXQTN_6-MvPivCrz.mjs} +8 -6
- package/browser/esm/DaNVYYZLCql8_n0i.mjs +831 -0
- package/browser/esm/Dakiv-oEU8ty2ILI.mjs +77 -0
- package/browser/esm/DfCd-MxLjE3gZ5jl.mjs +392 -0
- package/browser/esm/DhZqt49Ue-lveZv3.mjs +2692 -0
- package/browser/esm/DkxgFV6jJb6pO6lM.mjs +490 -0
- package/browser/esm/{B_PhUn6yySwXt2wo.mjs → QKDgV7kur90Bzexo.mjs} +14 -13
- package/browser/esm/R8q92QTpUT-sB4Nq.mjs +8547 -0
- package/browser/esm/RaV_j7qhH97TUb6P.mjs +1550 -0
- package/browser/esm/S-MJsifSUY334In9.mjs +8 -0
- package/browser/esm/UW74C3TpyGhFEOFO.mjs +267 -0
- package/browser/esm/W-jkQJTDojDSK93k.mjs +242 -0
- package/browser/esm/czz-Du13p5saoAex.mjs +318 -0
- package/browser/esm/{DErAKw-lIK3RY8m-.mjs → ilgUW6eI60262DJU.mjs} +2 -2
- package/browser/esm/index.mjs +1910 -289
- package/browser/esm/kbx_7Y2kVGMGIWtW.mjs +633 -0
- package/browser/esm/vCWRBUPIH8HXlYjO.mjs +94 -0
- package/browser/esm/w0DasqEtSJvoQVk2.mjs +517 -0
- package/browser/esm/w5dY32V2IxkbDBsT.mjs +225 -0
- package/licenses/dependencies.txt +113 -366
- package/node/esm/7GlVS1uyKRUAAjw9.mjs +1831 -0
- package/node/esm/B0mjDApnDOWo9UGr.mjs +412 -0
- package/node/esm/B19kx8jtLWU7WYCa.mjs +142 -0
- package/node/esm/BAFf7hg6qgFyQDW8.mjs +73 -0
- package/node/esm/BDdBcx7cNTM1hIXu.mjs +972 -0
- package/node/esm/BGBolrjPvNncjS1h.mjs +94 -0
- package/node/esm/BI3dFg_vx1Vgxgps.mjs +516 -0
- package/node/esm/BO19LMEPFqVsK1xu.mjs +267 -0
- package/node/esm/BSrtVTtNqcTg8QKK.mjs +68 -0
- package/node/esm/BcLccq7CvZiJXCDZ.mjs +319 -0
- package/node/esm/BeZ1ZY1UJepW8u1f.mjs +118 -0
- package/node/esm/BkLwJxkD4pyrume5.mjs +425 -0
- package/node/esm/{YKY4d8_Ckc8nPQqI.mjs → Bl_AT6xOKzBqc3PT.mjs} +10 -10
- package/node/esm/{DQtpY5kX99aMHygs.mjs → Bqah1dCUEhmRmY3c.mjs} +2 -2
- package/node/esm/Bv5awmbwVUdl4rma.mjs +106 -0
- package/node/esm/C3mSFWiCu7iONlk6.mjs +638 -0
- package/node/esm/CAJhvJU0gj93fPWl.mjs +141 -0
- package/node/esm/CJobW3iRAQ5vHeQr.mjs +14 -0
- package/node/esm/{BbXHuDHRHOW_6Sbs.mjs → CSJTM9SCqIDkHlpm.mjs} +21 -21
- package/node/esm/CUnv4ewRTvuP0si8.mjs +1276 -0
- package/node/esm/CWnezGEPuX9UeJ8E.mjs +385 -0
- package/node/esm/{Cul_Vgip2OE8yFBQ.mjs → CarjiReyjevcMdlI.mjs} +190 -141
- package/node/esm/CoG2fq6dYCvhC5yu.mjs +224 -0
- package/node/esm/Cpegk2BA6FOrOkZ0.mjs +77 -0
- package/node/esm/Cq1V2i0dRTWnoU1K.mjs +94 -0
- package/node/esm/{Ccrq9TNkiiSHKw-m.mjs → CyPtKWjud-Y-Pvq8.mjs} +2 -2
- package/node/esm/DEVN1ZPedFq8Bnui.mjs +197 -0
- package/node/esm/{BlD3bHo8AAxK7O1j.mjs → DFUPAGKlHT2-8dyC.mjs} +33 -31
- package/node/esm/DMxfzW-UQdMaV-Gx.mjs +975 -0
- package/node/esm/DWbMD1KaT8mlCUfO.mjs +519 -0
- package/node/esm/{DifZAchLTKOmWpkv.mjs → DffuRwJI_5oVtzZb.mjs} +23 -23
- package/node/esm/Dg9rTwnydI2UVmGG.mjs +242 -0
- package/node/esm/{BTI9exTFHEYzVjw9.mjs → DmQMejdH1-aYq99z.mjs} +70 -71
- package/node/esm/{CbpkRpNbQYYOJbxH.mjs → DvSoGqy_51YQZzYM.mjs} +84 -96
- package/node/esm/DzTvKGqU1I9m-_qd.mjs +391 -0
- package/node/esm/{Dvvg1Yo2e7OGd8sv.mjs → PKRuDgaA8RrsqSNn.mjs} +29 -29
- package/node/esm/{v0BFuYjhq2G8zDRe.mjs → POUGgaN5BmOnEPPl.mjs} +2 -2
- package/node/esm/WqxW6Up5_6oeJrSr.mjs +489 -0
- package/node/esm/ehyFZGpXZSmR7Q7-.mjs +294 -0
- package/node/esm/index.mjs +9829 -8837
- 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 +61 -10
- package/resources/locales/de/ui.msg.json +273 -15
- package/resources/locales/de/workbookAnomalies.cmd.json +14 -0
- package/resources/locales/en/groups.cmd.json +71 -11
- package/resources/locales/en/ui.msg.json +278 -15
- 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/OutlineSettingsDialog.d.ts +12 -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 +3 -0
- 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 +44 -16
- package/types/src/workbook/OutlineButtons.d.ts +11 -0
- 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/BcBrhEv9acaTxPkO.cjs +0 -13
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
- package/browser/cjs/ByIUHPOa02D7XbdC.cjs +0 -1
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +0 -1
- 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/Clzu4HOXk3QSlzUD.cjs +0 -8
- 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/iMWEL01eC83oU-YY.cjs +0 -1
- package/browser/cjs/index.cjs +0 -2
- package/browser/esm/7gisHVXYgcPxWH8-.mjs +0 -223
- package/browser/esm/B7k8enrhC2Rvqhn1.mjs +0 -152
- package/browser/esm/BK4OEmeaw-kC-vAN.mjs +0 -5355
- package/browser/esm/DvYZOxsaTNeBKuFq.mjs +0 -411
- package/browser/esm/DzWcb3yuPXS0E4_P.mjs +0 -236
- package/browser/esm/WftYXVWvPKx99H0H.mjs +0 -115
- package/browser/esm/eoNyVUe5ZEpHwJ7k.mjs +0 -52
- package/browser/esm/hFLn30a6N1fEy7fz.mjs +0 -13582
- package/browser/esm/jkFhDHWwKoyTSSDL.mjs +0 -1150
- package/node/esm/CpteKzMPi39jxmYL.mjs +0 -236
- package/node/esm/DA2gosTk8L-FUVI5.mjs +0 -4503
- package/node/esm/DP23-d6_VRFro0_D.mjs +0 -415
- package/node/esm/lH1iFsECniBRMubb.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 -31
|
@@ -0,0 +1,1276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v1.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { AutoColorPosition as e, BorderPopupButton as o, ColorPopupButton as l, FormulaField as t, PresetChip as n, S as a, _ as r, a as i, b as d, d as s, f as c, g as p, h as m, i as u, l as h, m as g, n as y, p as x, r as C, v, x as f, y as b } from "./index.mjs";
|
|
8
|
+
import { n as S, t as F } from "./CAJhvJU0gj93fPWl.mjs";
|
|
9
|
+
import { Color as T, CommonUtils as k, ICellStyle as w, ICondition as P, IConditionalFormat as I, IFill as N, IFont as B } from "@sheetxl/sdk";
|
|
10
|
+
import { COLOR_SCALE_PRESETS as M, DATA_BAR_PRESETS as O, ICON_CATALOG as z, IconSetGlyphs as R, NO_CELL_ICON as A, STYLE_PRESETS as D, defaultColorScale as j, defaultDataBar as W, defaultIconSet as $, defaultIconStops as K, getConditionalIconSet as E, iconSetSize as U, resolveIconSetIcons as L, useModelSync as _, withIconOverride as G } from "@sheetxl/react";
|
|
11
|
+
import { DynamicIcon as V, useTranslator as H } from "@sheetxl/utils-react";
|
|
12
|
+
import { forwardRef as Y, memo as q, useCallback as J, useMemo as Q, useRef as X } from "react";
|
|
13
|
+
import { ExhibitPopupIconButton as Z, defaultRenderPopupPanel as ee } from "@sheetxl/utils-mui";
|
|
14
|
+
import { Fragment as oe, jsx as le, jsxs as te } from "react/jsx-runtime";
|
|
15
|
+
import { Box as ne, Checkbox as ae, FormControl as re, FormControlLabel as ie, InputLabel as de, MenuItem as se, Paper as ce, Select as pe, Tab as me, Tabs as ue, TextField as he, ToggleButton as ge, ToggleButtonGroup as ye, Typography as xe } from "@mui/material";
|
|
16
|
+
import { messageKey as Ce } from "@sheetxl/utils";
|
|
17
|
+
var ve = q((e) => {
|
|
18
|
+
const { variant: o = "format", children: l, sx: t, ...n } = e;
|
|
19
|
+
return le(ne, {
|
|
20
|
+
className: `sxl-cf-rule-section sxl-cf-rule-section-${o}`,
|
|
21
|
+
sx: {
|
|
22
|
+
display: "flex",
|
|
23
|
+
flexDirection: "column",
|
|
24
|
+
gap: 1,
|
|
25
|
+
p: 2,
|
|
26
|
+
border: 1,
|
|
27
|
+
borderColor: "divider",
|
|
28
|
+
borderRadius: 1,
|
|
29
|
+
..."config" === o ? { backgroundColor: "action.hover" } : null,
|
|
30
|
+
...t
|
|
31
|
+
},
|
|
32
|
+
...n,
|
|
33
|
+
children: l
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
ve.displayName = "RuleSection";
|
|
37
|
+
var fe = new T("transparent"), be = {
|
|
38
|
+
lightRedFillDarkRedText: Ce("conditionalFormat.preset.lightRedFillDarkRedText"),
|
|
39
|
+
yellowFillDarkYellowText: Ce("conditionalFormat.preset.yellowFillDarkYellowText"),
|
|
40
|
+
greenFillDarkGreenText: Ce("conditionalFormat.preset.greenFillDarkGreenText"),
|
|
41
|
+
lightRedFill: Ce("conditionalFormat.preset.lightRedFill"),
|
|
42
|
+
redText: Ce("conditionalFormat.preset.redText"),
|
|
43
|
+
redBorder: Ce("conditionalFormat.preset.redBorder")
|
|
44
|
+
}, Se = (e) => e ? "string" == typeof e ? e : e.type === N.Type.None ? null : e.color ?? e.foreground ?? null : null, Fe = (e, o) => "auto" === e ? null : f(e, o), Te = q((t) => {
|
|
45
|
+
const { format: r, onFormatChange: i, readOnly: d, ...s } = t, c = H(), { workbook: p, schemeLookup: m, themeKey: u, darkMode: h, propsColorPanel: g } = a(), y = r?.font ?? null, x = (y?.weight ?? 400) >= 600, C = y?.style === B.Style.Italic, v = !!y?.underline && y.underline !== B.UnderlineStyle.None, f = !!y?.strike && y.strike !== B.StrikeStyle.None, b = (e) => {
|
|
46
|
+
const o = { ...y };
|
|
47
|
+
for (const [l, t] of Object.entries(e)) void 0 === t ? delete o[l] : o[l] = t;
|
|
48
|
+
const l = { ...r };
|
|
49
|
+
0 === Object.keys(o).length ? delete l.font : l.font = o, i(0 === Object.keys(l).length ? null : l);
|
|
50
|
+
}, S = Q(() => p?.getStyles().getNormal().getFont().getColor(), [p, u]), F = Q(() => Fe(y?.color, p), [
|
|
51
|
+
y?.color,
|
|
52
|
+
p,
|
|
53
|
+
u
|
|
54
|
+
]), T = Q(() => Fe(Se(r?.fill), p), [
|
|
55
|
+
r?.fill,
|
|
56
|
+
p,
|
|
57
|
+
u
|
|
58
|
+
]), k = {
|
|
59
|
+
padding: "4px",
|
|
60
|
+
border: "none",
|
|
61
|
+
borderRadius: 1
|
|
62
|
+
};
|
|
63
|
+
return te(ve, {
|
|
64
|
+
...s,
|
|
65
|
+
children: [te(ne, {
|
|
66
|
+
sx: {
|
|
67
|
+
display: "flex",
|
|
68
|
+
alignItems: "flex-start",
|
|
69
|
+
gap: 1
|
|
70
|
+
},
|
|
71
|
+
children: [le(ne, {
|
|
72
|
+
sx: {
|
|
73
|
+
flex: "1 1 auto",
|
|
74
|
+
minWidth: 0,
|
|
75
|
+
display: "flex",
|
|
76
|
+
gap: .5,
|
|
77
|
+
flexWrap: "wrap"
|
|
78
|
+
},
|
|
79
|
+
children: D.map((e, o) => {
|
|
80
|
+
const l = Fe(Se(e.style.fill), p), t = Fe(e.style.font?.color, p), a = e.style.borders ? Fe(Object.values(e.style.borders)[0]?.color, p) : null;
|
|
81
|
+
return le(n, {
|
|
82
|
+
sheet: !0,
|
|
83
|
+
title: c(be[e.key] ?? e.key),
|
|
84
|
+
disabled: d,
|
|
85
|
+
onClick: () => i(structuredClone(e.style)),
|
|
86
|
+
sx: {
|
|
87
|
+
backgroundColor: l?.toCSS("adaptive") ?? void 0,
|
|
88
|
+
color: t?.toCSS("adaptive") ?? void 0,
|
|
89
|
+
outline: a ? `1px solid ${a.toCSS("adaptive")}` : void 0,
|
|
90
|
+
outlineOffset: "-3px"
|
|
91
|
+
},
|
|
92
|
+
children: "Aa"
|
|
93
|
+
}, o);
|
|
94
|
+
})
|
|
95
|
+
}), le(n, {
|
|
96
|
+
title: c("conditionalFormat.clearStyle"),
|
|
97
|
+
disabled: d || !r,
|
|
98
|
+
onClick: () => i(null),
|
|
99
|
+
sx: {
|
|
100
|
+
color: "text.secondary",
|
|
101
|
+
"&:disabled": { opacity: .4 }
|
|
102
|
+
},
|
|
103
|
+
children: le(V, {
|
|
104
|
+
iconKey: "ClearFormats",
|
|
105
|
+
size: 16
|
|
106
|
+
})
|
|
107
|
+
})]
|
|
108
|
+
}), te(ne, {
|
|
109
|
+
sx: {
|
|
110
|
+
display: "flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
gap: .25
|
|
113
|
+
},
|
|
114
|
+
children: [
|
|
115
|
+
le(ge, {
|
|
116
|
+
value: "bold",
|
|
117
|
+
size: "small",
|
|
118
|
+
sx: k,
|
|
119
|
+
selected: x,
|
|
120
|
+
disabled: d,
|
|
121
|
+
onChange: () => b({ weight: x ? void 0 : 700 }),
|
|
122
|
+
children: le(V, { iconKey: "TextBold" })
|
|
123
|
+
}),
|
|
124
|
+
le(ge, {
|
|
125
|
+
value: "italic",
|
|
126
|
+
size: "small",
|
|
127
|
+
sx: k,
|
|
128
|
+
selected: C,
|
|
129
|
+
disabled: d,
|
|
130
|
+
onChange: () => b({ style: C ? void 0 : B.Style.Italic }),
|
|
131
|
+
children: le(V, { iconKey: "TextItalic" })
|
|
132
|
+
}),
|
|
133
|
+
le(ge, {
|
|
134
|
+
value: "underline",
|
|
135
|
+
size: "small",
|
|
136
|
+
sx: k,
|
|
137
|
+
selected: v,
|
|
138
|
+
disabled: d,
|
|
139
|
+
onChange: () => b({ underline: v ? void 0 : B.UnderlineStyle.Single }),
|
|
140
|
+
children: le(V, { iconKey: "TextUnderline" })
|
|
141
|
+
}),
|
|
142
|
+
le(ge, {
|
|
143
|
+
value: "strike",
|
|
144
|
+
size: "small",
|
|
145
|
+
sx: k,
|
|
146
|
+
selected: f,
|
|
147
|
+
disabled: d,
|
|
148
|
+
onChange: () => b({ strike: f ? void 0 : B.StrikeStyle.Single }),
|
|
149
|
+
children: le(V, { iconKey: "TextStrike" })
|
|
150
|
+
}),
|
|
151
|
+
p && le(o, {
|
|
152
|
+
tooltip: c("conditionalFormat.border"),
|
|
153
|
+
selectedBorder: r?.borders,
|
|
154
|
+
createBorder: (e) => p.getStyles().getNormal().createStyle({ borders: e }).getBorders(),
|
|
155
|
+
schemeLookup: m,
|
|
156
|
+
autoColor: S,
|
|
157
|
+
darkMode: h,
|
|
158
|
+
disabled: d,
|
|
159
|
+
onSelectBorder: (e) => ((e) => {
|
|
160
|
+
const o = { ...r };
|
|
161
|
+
e && 0 !== Object.keys(e).length ? o.borders = e : delete o.borders, i(0 === Object.keys(o).length ? null : o);
|
|
162
|
+
})(e)
|
|
163
|
+
}),
|
|
164
|
+
le(l, {
|
|
165
|
+
icon: "fill.colored",
|
|
166
|
+
tooltip: c("conditionalFormat.fillColor"),
|
|
167
|
+
selectedColor: T,
|
|
168
|
+
disabled: d,
|
|
169
|
+
onSelectColor: (e) => ((e) => {
|
|
170
|
+
const o = { ...r };
|
|
171
|
+
e ? o.fill = {
|
|
172
|
+
type: N.Type.Solid,
|
|
173
|
+
color: e.toString()
|
|
174
|
+
} : delete o.fill, i(0 === Object.keys(o).length ? null : o);
|
|
175
|
+
})(e),
|
|
176
|
+
darkMode: h,
|
|
177
|
+
propsPanel: {
|
|
178
|
+
disableAlpha: !0,
|
|
179
|
+
autoColor: fe,
|
|
180
|
+
autoColorLabelKey: Ce("color.noFill"),
|
|
181
|
+
autoColorPosition: e.End,
|
|
182
|
+
...g
|
|
183
|
+
}
|
|
184
|
+
}),
|
|
185
|
+
le(l, {
|
|
186
|
+
icon: "text.colored",
|
|
187
|
+
tooltip: c("conditionalFormat.fontColor"),
|
|
188
|
+
selectedColor: F,
|
|
189
|
+
disabled: d,
|
|
190
|
+
onSelectColor: (e) => b({ color: e ? e.toString() : void 0 }),
|
|
191
|
+
darkMode: h,
|
|
192
|
+
propsPanel: {
|
|
193
|
+
disableAlpha: !0,
|
|
194
|
+
autoColor: S,
|
|
195
|
+
...g
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
})]
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
Te.displayName = "ConditionalFormatStylePicker";
|
|
203
|
+
var ke = {
|
|
204
|
+
[I.ColorStopType.AutoMin]: Ce("conditionalFormat.stopType.autoMin"),
|
|
205
|
+
[I.ColorStopType.AutoMax]: Ce("conditionalFormat.stopType.autoMax"),
|
|
206
|
+
[I.ColorStopType.Min]: Ce("conditionalFormat.stopType.min"),
|
|
207
|
+
[I.ColorStopType.Max]: Ce("conditionalFormat.stopType.max"),
|
|
208
|
+
[I.ColorStopType.Num]: Ce("conditionalFormat.stopType.num"),
|
|
209
|
+
[I.ColorStopType.Percent]: Ce("conditionalFormat.stopType.percent"),
|
|
210
|
+
[I.ColorStopType.Percentile]: Ce("conditionalFormat.stopType.percentile"),
|
|
211
|
+
[I.ColorStopType.Formula]: Ce("conditionalFormat.stopType.formula")
|
|
212
|
+
}, we = /* @__PURE__ */ new Set([
|
|
213
|
+
I.ColorStopType.AutoMin,
|
|
214
|
+
I.ColorStopType.AutoMax,
|
|
215
|
+
I.ColorStopType.Min,
|
|
216
|
+
I.ColorStopType.Max
|
|
217
|
+
]), Pe = q((e) => {
|
|
218
|
+
const { label: o, stop: n, onStopChange: r, allowedTypes: d, showColor: s = !1, leading: c, showExclusive: p = !1, readOnly: m, ...u } = e, h = H(), { darkMode: g, toColor: y, propsColorPanel: x } = a(), C = i(), v = n.type ?? I.ColorStopType.Num, f = !we.has(v), b = m || !f, S = v === I.ColorStopType.Formula, F = n.value?.isIFormula ? n.value : null, T = n.color, k = s ? y(T) : null;
|
|
219
|
+
return te(ne, {
|
|
220
|
+
sx: {
|
|
221
|
+
display: "flex",
|
|
222
|
+
alignItems: "center",
|
|
223
|
+
gap: .5
|
|
224
|
+
},
|
|
225
|
+
...u,
|
|
226
|
+
children: [
|
|
227
|
+
void 0 !== o && le(xe, {
|
|
228
|
+
variant: "caption",
|
|
229
|
+
sx: {
|
|
230
|
+
color: "text.secondary",
|
|
231
|
+
flex: "0 0 62px",
|
|
232
|
+
minWidth: 0,
|
|
233
|
+
overflow: "hidden",
|
|
234
|
+
textOverflow: "ellipsis"
|
|
235
|
+
},
|
|
236
|
+
children: o
|
|
237
|
+
}),
|
|
238
|
+
c,
|
|
239
|
+
s && le(l, {
|
|
240
|
+
tooltip: h("conditionalFormat.stopColor"),
|
|
241
|
+
selectedColor: k,
|
|
242
|
+
disabled: m,
|
|
243
|
+
onSelectColor: (e) => {
|
|
244
|
+
e && r({
|
|
245
|
+
...n,
|
|
246
|
+
color: e.toString()
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
darkMode: g,
|
|
250
|
+
propsPanel: {
|
|
251
|
+
disableAlpha: !0,
|
|
252
|
+
...x
|
|
253
|
+
}
|
|
254
|
+
}),
|
|
255
|
+
p && te(pe, {
|
|
256
|
+
size: "small",
|
|
257
|
+
value: n.exclusive ? "gt" : "gte",
|
|
258
|
+
disabled: m,
|
|
259
|
+
onChange: (e) => {
|
|
260
|
+
const o = { ...n };
|
|
261
|
+
"gt" === e.target.value ? o.exclusive = !0 : delete o.exclusive, r(o);
|
|
262
|
+
},
|
|
263
|
+
sx: {
|
|
264
|
+
flex: "0 0 auto",
|
|
265
|
+
backgroundColor: "background.paper"
|
|
266
|
+
},
|
|
267
|
+
children: [le(se, {
|
|
268
|
+
value: "gte",
|
|
269
|
+
children: ">="
|
|
270
|
+
}), le(se, {
|
|
271
|
+
value: "gt",
|
|
272
|
+
children: ">"
|
|
273
|
+
})]
|
|
274
|
+
}),
|
|
275
|
+
le(pe, {
|
|
276
|
+
size: "small",
|
|
277
|
+
value: v,
|
|
278
|
+
disabled: m,
|
|
279
|
+
onChange: (e) => ((e) => {
|
|
280
|
+
const o = {
|
|
281
|
+
...n,
|
|
282
|
+
type: e
|
|
283
|
+
};
|
|
284
|
+
if (we.has(e)) delete o.value;
|
|
285
|
+
else if (void 0 === o.value) o.value = e === I.ColorStopType.Formula ? "" : 0;
|
|
286
|
+
else if (e !== I.ColorStopType.Formula && "number" != typeof o.value) {
|
|
287
|
+
const e = "string" == typeof o.value ? Number(o.value) : NaN;
|
|
288
|
+
o.value = Number.isFinite(e) ? e : 0;
|
|
289
|
+
}
|
|
290
|
+
r(o);
|
|
291
|
+
})(e.target.value),
|
|
292
|
+
sx: {
|
|
293
|
+
flex: "1 1 40%",
|
|
294
|
+
minWidth: 0,
|
|
295
|
+
backgroundColor: "background.paper"
|
|
296
|
+
},
|
|
297
|
+
children: d.map((e) => le(se, {
|
|
298
|
+
value: e,
|
|
299
|
+
children: h(ke[e])
|
|
300
|
+
}, e))
|
|
301
|
+
}),
|
|
302
|
+
S ? le(t, {
|
|
303
|
+
size: "small",
|
|
304
|
+
home: C.home,
|
|
305
|
+
value: F ? C.display(F) : `${n.value ?? ""}`,
|
|
306
|
+
onChangeText: (e) => {
|
|
307
|
+
r({
|
|
308
|
+
...n,
|
|
309
|
+
value: e.trim().length > 0 ? C.compile(e) : e
|
|
310
|
+
});
|
|
311
|
+
},
|
|
312
|
+
placeholder: h("conditionalFormat.enterFormula"),
|
|
313
|
+
disabled: b,
|
|
314
|
+
equals: "bare",
|
|
315
|
+
pickAs: "absolute",
|
|
316
|
+
label: null,
|
|
317
|
+
showError: !1,
|
|
318
|
+
helperText: null,
|
|
319
|
+
sx: {
|
|
320
|
+
flex: "1 1 30%",
|
|
321
|
+
minWidth: 0,
|
|
322
|
+
"& .MuiInputBase-root": { backgroundColor: b ? "action.disabledBackground" : "background.paper" }
|
|
323
|
+
}
|
|
324
|
+
}) : le(he, {
|
|
325
|
+
size: "small",
|
|
326
|
+
type: "number",
|
|
327
|
+
placeholder: f ? void 0 : h("conditionalFormat.stopFromData"),
|
|
328
|
+
value: f ? `${n.value ?? ""}` : "",
|
|
329
|
+
disabled: b,
|
|
330
|
+
onChange: (e) => {
|
|
331
|
+
const o = e.target.value;
|
|
332
|
+
r({
|
|
333
|
+
...n,
|
|
334
|
+
value: "" === o ? 0 : Number(o)
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
sx: {
|
|
338
|
+
flex: "1 1 30%",
|
|
339
|
+
minWidth: 0,
|
|
340
|
+
cursor: b ? "not-allowed" : void 0
|
|
341
|
+
},
|
|
342
|
+
slotProps: { input: { sx: {
|
|
343
|
+
backgroundColor: b ? "action.disabledBackground" : "background.paper",
|
|
344
|
+
cursor: b ? "not-allowed" : void 0
|
|
345
|
+
} } }
|
|
346
|
+
})
|
|
347
|
+
]
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
Pe.displayName = "ScaleStopRow";
|
|
351
|
+
var Ie = [
|
|
352
|
+
I.ColorStopType.Min,
|
|
353
|
+
I.ColorStopType.Max,
|
|
354
|
+
I.ColorStopType.Num,
|
|
355
|
+
I.ColorStopType.Percent,
|
|
356
|
+
I.ColorStopType.Percentile,
|
|
357
|
+
I.ColorStopType.Formula
|
|
358
|
+
], Ne = q((e) => {
|
|
359
|
+
const { scale: o, onScaleChange: l, readOnly: t, ...r } = e, i = H(), { workbook: d, toColor: s } = a(), c = o.stops ?? [], p = 2 === c.length ? [Ce("conditionalFormat.stop.minimum"), Ce("conditionalFormat.stop.maximum")] : [
|
|
360
|
+
Ce("conditionalFormat.stop.minimum"),
|
|
361
|
+
Ce("conditionalFormat.stop.midpoint"),
|
|
362
|
+
Ce("conditionalFormat.stop.maximum")
|
|
363
|
+
];
|
|
364
|
+
return te(ne, {
|
|
365
|
+
sx: {
|
|
366
|
+
display: "flex",
|
|
367
|
+
flexDirection: "column",
|
|
368
|
+
gap: 1
|
|
369
|
+
},
|
|
370
|
+
...r,
|
|
371
|
+
children: [le(ve, { children: te(ne, {
|
|
372
|
+
sx: {
|
|
373
|
+
display: "flex",
|
|
374
|
+
alignItems: "flex-start",
|
|
375
|
+
gap: 1
|
|
376
|
+
},
|
|
377
|
+
children: [le(ne, {
|
|
378
|
+
sx: {
|
|
379
|
+
flex: "1 1 auto",
|
|
380
|
+
minWidth: 0,
|
|
381
|
+
display: "flex",
|
|
382
|
+
gap: .5,
|
|
383
|
+
flexWrap: "wrap"
|
|
384
|
+
},
|
|
385
|
+
children: M.filter((e) => e.stops.length === (2 === c.length ? 2 : 3)).map((e, o) => le(n, {
|
|
386
|
+
sheet: !0,
|
|
387
|
+
disabled: t,
|
|
388
|
+
onClick: () => l(structuredClone(e)),
|
|
389
|
+
children: le(v, { rows: b(e.stops ?? [], m, d) })
|
|
390
|
+
}, o))
|
|
391
|
+
}), te(ye, {
|
|
392
|
+
exclusive: !0,
|
|
393
|
+
size: "small",
|
|
394
|
+
value: 2 === c.length ? 2 : 3,
|
|
395
|
+
disabled: t,
|
|
396
|
+
onChange: (e, t) => {
|
|
397
|
+
t && ((e) => {
|
|
398
|
+
if (e === c.length || 2 !== e && 3 !== e) return;
|
|
399
|
+
const t = c.slice();
|
|
400
|
+
if (3 === e) {
|
|
401
|
+
let e = "#FFEB84";
|
|
402
|
+
const o = s(c[0]?.color ?? e)?.toRGBA(), l = s(c[c.length - 1]?.color ?? e)?.toRGBA();
|
|
403
|
+
if (o && l) {
|
|
404
|
+
const t = (e) => Math.round(e).toString(16).padStart(2, "0").toUpperCase();
|
|
405
|
+
e = `#${t((o.red + l.red) / 2)}${t((o.green + l.green) / 2)}${t((o.blue + l.blue) / 2)}`;
|
|
406
|
+
}
|
|
407
|
+
t.splice(1, 0, {
|
|
408
|
+
type: I.ColorStopType.Percentile,
|
|
409
|
+
value: 50,
|
|
410
|
+
color: e
|
|
411
|
+
});
|
|
412
|
+
} else t.splice(1, t.length - 2);
|
|
413
|
+
l({
|
|
414
|
+
...o,
|
|
415
|
+
stops: t
|
|
416
|
+
});
|
|
417
|
+
})(t);
|
|
418
|
+
},
|
|
419
|
+
sx: { flex: "0 0 auto" },
|
|
420
|
+
children: [le(ge, {
|
|
421
|
+
value: 2,
|
|
422
|
+
sx: {
|
|
423
|
+
textTransform: "none",
|
|
424
|
+
pt: .25,
|
|
425
|
+
pb: .25
|
|
426
|
+
},
|
|
427
|
+
children: i("conditionalFormat.twoColor")
|
|
428
|
+
}), le(ge, {
|
|
429
|
+
value: 3,
|
|
430
|
+
sx: {
|
|
431
|
+
textTransform: "none",
|
|
432
|
+
pt: .25,
|
|
433
|
+
pb: .25
|
|
434
|
+
},
|
|
435
|
+
children: i("conditionalFormat.threeColor")
|
|
436
|
+
})]
|
|
437
|
+
})]
|
|
438
|
+
}) }), le(ve, {
|
|
439
|
+
variant: "config",
|
|
440
|
+
children: c.map((e, n) => le(Pe, {
|
|
441
|
+
label: i(p[Math.min(n, p.length - 1)]),
|
|
442
|
+
stop: e,
|
|
443
|
+
allowedTypes: Ie,
|
|
444
|
+
showColor: !0,
|
|
445
|
+
readOnly: t,
|
|
446
|
+
onStopChange: (e) => {
|
|
447
|
+
const t = c.slice();
|
|
448
|
+
t[n] = e, l({
|
|
449
|
+
...o,
|
|
450
|
+
stops: t
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}, n))
|
|
454
|
+
})]
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
Ne.displayName = "ColorScaleRulePanel";
|
|
458
|
+
var Be = [
|
|
459
|
+
I.ColorStopType.AutoMin,
|
|
460
|
+
I.ColorStopType.Min,
|
|
461
|
+
I.ColorStopType.Num,
|
|
462
|
+
I.ColorStopType.Percent,
|
|
463
|
+
I.ColorStopType.Percentile,
|
|
464
|
+
I.ColorStopType.Formula
|
|
465
|
+
], Me = [
|
|
466
|
+
I.ColorStopType.AutoMax,
|
|
467
|
+
I.ColorStopType.Max,
|
|
468
|
+
I.ColorStopType.Num,
|
|
469
|
+
I.ColorStopType.Percent,
|
|
470
|
+
I.ColorStopType.Percentile,
|
|
471
|
+
I.ColorStopType.Formula
|
|
472
|
+
], Oe = "__auto__", ze = q((e) => {
|
|
473
|
+
const { scale: o, onScaleChange: t, readOnly: r, ...i } = e, s = H(), { darkMode: c, toColor: p, propsColorPanel: m } = a(), u = p(o.color), h = p(o.negativeFillColor), g = p(o.borderColor), y = p(o.negativeBorderColor), x = o.solidFill ?? !1, C = (e) => {
|
|
474
|
+
const l = { ...o };
|
|
475
|
+
for (const [o, t] of Object.entries(e)) void 0 === t ? delete l[o] : l[o] = t;
|
|
476
|
+
t(l);
|
|
477
|
+
}, f = { backgroundColor: "background.paper" };
|
|
478
|
+
return te(ne, {
|
|
479
|
+
sx: {
|
|
480
|
+
display: "flex",
|
|
481
|
+
flexDirection: "column",
|
|
482
|
+
gap: 1
|
|
483
|
+
},
|
|
484
|
+
...i,
|
|
485
|
+
children: [te(ve, { children: [
|
|
486
|
+
te(ne, {
|
|
487
|
+
sx: {
|
|
488
|
+
display: "flex",
|
|
489
|
+
alignItems: "flex-start",
|
|
490
|
+
gap: 1
|
|
491
|
+
},
|
|
492
|
+
children: [le(ne, {
|
|
493
|
+
sx: {
|
|
494
|
+
flex: "1 1 auto",
|
|
495
|
+
minWidth: 0,
|
|
496
|
+
display: "flex",
|
|
497
|
+
gap: .5,
|
|
498
|
+
flexWrap: "wrap"
|
|
499
|
+
},
|
|
500
|
+
children: O.filter((e) => (e.solidFill ?? !1) === x).map((e, o) => le(n, {
|
|
501
|
+
sheet: !0,
|
|
502
|
+
disabled: r,
|
|
503
|
+
onClick: () => C({
|
|
504
|
+
color: e.color,
|
|
505
|
+
solidFill: e.solidFill,
|
|
506
|
+
borderColor: e.borderColor
|
|
507
|
+
}),
|
|
508
|
+
children: le(v, { rows: d(e, p(e.color)?.toCSS("adaptive") ?? "var(--sxl-color-primary, rgb(33, 115, 70))") })
|
|
509
|
+
}, o))
|
|
510
|
+
}), te(ye, {
|
|
511
|
+
exclusive: !0,
|
|
512
|
+
size: "small",
|
|
513
|
+
value: x,
|
|
514
|
+
disabled: r,
|
|
515
|
+
onChange: (e, o) => {
|
|
516
|
+
null !== o && C({ solidFill: !!o || void 0 });
|
|
517
|
+
},
|
|
518
|
+
sx: { flex: "0 0 auto" },
|
|
519
|
+
children: [le(ge, {
|
|
520
|
+
value: !0,
|
|
521
|
+
sx: {
|
|
522
|
+
textTransform: "none",
|
|
523
|
+
pt: .25,
|
|
524
|
+
pb: .25
|
|
525
|
+
},
|
|
526
|
+
children: s("conditionalFormat.solidFill")
|
|
527
|
+
}), le(ge, {
|
|
528
|
+
value: !1,
|
|
529
|
+
sx: {
|
|
530
|
+
textTransform: "none",
|
|
531
|
+
pt: .25,
|
|
532
|
+
pb: .25
|
|
533
|
+
},
|
|
534
|
+
children: s("conditionalFormat.gradientFill")
|
|
535
|
+
})]
|
|
536
|
+
})]
|
|
537
|
+
}),
|
|
538
|
+
le(ie, {
|
|
539
|
+
control: le(ae, {
|
|
540
|
+
size: "small",
|
|
541
|
+
checked: !1 === o.showValue,
|
|
542
|
+
disabled: r,
|
|
543
|
+
onChange: (e) => C({ showValue: !e.target.checked && void 0 })
|
|
544
|
+
}),
|
|
545
|
+
label: le(xe, {
|
|
546
|
+
variant: "body2",
|
|
547
|
+
children: s("conditionalFormat.showBarsOnly")
|
|
548
|
+
})
|
|
549
|
+
}),
|
|
550
|
+
te(ne, {
|
|
551
|
+
sx: {
|
|
552
|
+
display: "flex",
|
|
553
|
+
alignItems: "center",
|
|
554
|
+
gap: .5
|
|
555
|
+
},
|
|
556
|
+
children: [
|
|
557
|
+
le(xe, {
|
|
558
|
+
variant: "caption",
|
|
559
|
+
sx: {
|
|
560
|
+
color: "text.secondary",
|
|
561
|
+
flex: "0 0 62px"
|
|
562
|
+
},
|
|
563
|
+
children: s("conditionalFormat.bar")
|
|
564
|
+
}),
|
|
565
|
+
le(l, {
|
|
566
|
+
icon: "fill.colored",
|
|
567
|
+
tooltip: s("conditionalFormat.barColor"),
|
|
568
|
+
selectedColor: u,
|
|
569
|
+
disabled: r,
|
|
570
|
+
onSelectColor: (e) => C({ color: e ? e.toString() : void 0 }),
|
|
571
|
+
darkMode: c,
|
|
572
|
+
propsPanel: {
|
|
573
|
+
disableAlpha: !0,
|
|
574
|
+
...m
|
|
575
|
+
}
|
|
576
|
+
}),
|
|
577
|
+
le(l, {
|
|
578
|
+
icon: "stroke.colored",
|
|
579
|
+
tooltip: s("conditionalFormat.barBorderColor"),
|
|
580
|
+
selectedColor: g,
|
|
581
|
+
disabled: r,
|
|
582
|
+
onSelectColor: (e) => C({ borderColor: e ? e.toString() : void 0 }),
|
|
583
|
+
darkMode: c,
|
|
584
|
+
propsPanel: {
|
|
585
|
+
disableAlpha: !0,
|
|
586
|
+
...m
|
|
587
|
+
}
|
|
588
|
+
})
|
|
589
|
+
]
|
|
590
|
+
}),
|
|
591
|
+
te(ne, {
|
|
592
|
+
sx: {
|
|
593
|
+
display: "flex",
|
|
594
|
+
alignItems: "center",
|
|
595
|
+
gap: .5
|
|
596
|
+
},
|
|
597
|
+
children: [
|
|
598
|
+
le(xe, {
|
|
599
|
+
variant: "caption",
|
|
600
|
+
sx: {
|
|
601
|
+
color: "text.secondary",
|
|
602
|
+
flex: "0 0 62px"
|
|
603
|
+
},
|
|
604
|
+
children: s("conditionalFormat.negative")
|
|
605
|
+
}),
|
|
606
|
+
le(l, {
|
|
607
|
+
icon: "fill.colored",
|
|
608
|
+
tooltip: s("conditionalFormat.negativeColor"),
|
|
609
|
+
selectedColor: h ?? u,
|
|
610
|
+
disabled: r,
|
|
611
|
+
onSelectColor: (e) => C({ negativeFillColor: e ? e.toString() : void 0 }),
|
|
612
|
+
darkMode: c,
|
|
613
|
+
propsPanel: {
|
|
614
|
+
disableAlpha: !0,
|
|
615
|
+
...m
|
|
616
|
+
}
|
|
617
|
+
}),
|
|
618
|
+
le(l, {
|
|
619
|
+
icon: "stroke.colored",
|
|
620
|
+
tooltip: s("conditionalFormat.negativeBorderColor"),
|
|
621
|
+
selectedColor: y ?? g,
|
|
622
|
+
disabled: r,
|
|
623
|
+
onSelectColor: (e) => C({ negativeBorderColor: e ? e.toString() : void 0 }),
|
|
624
|
+
darkMode: c,
|
|
625
|
+
propsPanel: {
|
|
626
|
+
disableAlpha: !0,
|
|
627
|
+
...m
|
|
628
|
+
}
|
|
629
|
+
}),
|
|
630
|
+
le(n, {
|
|
631
|
+
title: s("conditionalFormat.sameAsPositive"),
|
|
632
|
+
disabled: r || !o.negativeFillColor && !o.negativeBorderColor,
|
|
633
|
+
onClick: () => C({
|
|
634
|
+
negativeFillColor: void 0,
|
|
635
|
+
negativeBorderColor: void 0
|
|
636
|
+
}),
|
|
637
|
+
sx: {
|
|
638
|
+
color: "text.secondary",
|
|
639
|
+
"&:disabled": { opacity: .4 }
|
|
640
|
+
},
|
|
641
|
+
children: le(V, {
|
|
642
|
+
iconKey: "ClearFormats",
|
|
643
|
+
size: 16
|
|
644
|
+
})
|
|
645
|
+
})
|
|
646
|
+
]
|
|
647
|
+
}),
|
|
648
|
+
te(ne, {
|
|
649
|
+
sx: {
|
|
650
|
+
display: "flex",
|
|
651
|
+
gap: 1,
|
|
652
|
+
mt: .5
|
|
653
|
+
},
|
|
654
|
+
children: [te(re, {
|
|
655
|
+
size: "small",
|
|
656
|
+
sx: {
|
|
657
|
+
flex: 1,
|
|
658
|
+
minWidth: 0
|
|
659
|
+
},
|
|
660
|
+
children: [le(de, { children: s("conditionalFormat.axis") }), te(pe, {
|
|
661
|
+
label: s("conditionalFormat.axis"),
|
|
662
|
+
value: o.axisPosition ?? Oe,
|
|
663
|
+
disabled: r,
|
|
664
|
+
sx: f,
|
|
665
|
+
onChange: (e) => {
|
|
666
|
+
const o = e.target.value;
|
|
667
|
+
C({ axisPosition: o === Oe ? void 0 : o });
|
|
668
|
+
},
|
|
669
|
+
children: [
|
|
670
|
+
le(se, {
|
|
671
|
+
value: Oe,
|
|
672
|
+
children: s("conditionalFormat.automatic")
|
|
673
|
+
}),
|
|
674
|
+
le(se, {
|
|
675
|
+
value: "middle",
|
|
676
|
+
children: s("conditionalFormat.axisMiddle")
|
|
677
|
+
}),
|
|
678
|
+
le(se, {
|
|
679
|
+
value: "none",
|
|
680
|
+
children: s("conditionalFormat.axisNone")
|
|
681
|
+
})
|
|
682
|
+
]
|
|
683
|
+
})]
|
|
684
|
+
}), te(re, {
|
|
685
|
+
size: "small",
|
|
686
|
+
sx: {
|
|
687
|
+
flex: 1,
|
|
688
|
+
minWidth: 0
|
|
689
|
+
},
|
|
690
|
+
children: [le(de, { children: s("conditionalFormat.direction") }), te(pe, {
|
|
691
|
+
label: s("conditionalFormat.direction"),
|
|
692
|
+
value: o.direction ?? Oe,
|
|
693
|
+
disabled: r,
|
|
694
|
+
sx: f,
|
|
695
|
+
onChange: (e) => {
|
|
696
|
+
const o = e.target.value;
|
|
697
|
+
C({ direction: o === Oe ? void 0 : o });
|
|
698
|
+
},
|
|
699
|
+
children: [
|
|
700
|
+
le(se, {
|
|
701
|
+
value: Oe,
|
|
702
|
+
children: s("conditionalFormat.automatic")
|
|
703
|
+
}),
|
|
704
|
+
le(se, {
|
|
705
|
+
value: "leftToRight",
|
|
706
|
+
children: s("conditionalFormat.leftToRight")
|
|
707
|
+
}),
|
|
708
|
+
le(se, {
|
|
709
|
+
value: "rightToLeft",
|
|
710
|
+
children: s("conditionalFormat.rightToLeft")
|
|
711
|
+
})
|
|
712
|
+
]
|
|
713
|
+
})]
|
|
714
|
+
})]
|
|
715
|
+
})
|
|
716
|
+
] }), te(ve, {
|
|
717
|
+
variant: "config",
|
|
718
|
+
children: [le(Pe, {
|
|
719
|
+
label: s("conditionalFormat.stop.minimum"),
|
|
720
|
+
stop: o.minPoint ?? { type: I.ColorStopType.Min },
|
|
721
|
+
allowedTypes: Be,
|
|
722
|
+
readOnly: r,
|
|
723
|
+
onStopChange: (e) => C({ minPoint: e })
|
|
724
|
+
}), le(Pe, {
|
|
725
|
+
label: s("conditionalFormat.stop.maximum"),
|
|
726
|
+
stop: o.maxPoint ?? { type: I.ColorStopType.Max },
|
|
727
|
+
allowedTypes: Me,
|
|
728
|
+
readOnly: r,
|
|
729
|
+
onStopChange: (e) => C({ maxPoint: e })
|
|
730
|
+
})]
|
|
731
|
+
})]
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
ze.displayName = "DataBarRulePanel";
|
|
735
|
+
var Re = Ce("conditionalFormat.noCellIcon"), Ae = Ce("conditionalFormat.cellIcon"), De = {
|
|
736
|
+
borderColor: "primary.main",
|
|
737
|
+
boxShadow: (e) => `inset 0 0 0 1px ${e.palette.primary.main}`
|
|
738
|
+
}, je = {
|
|
739
|
+
width: "28px",
|
|
740
|
+
height: "26px"
|
|
741
|
+
}, We = q((e) => {
|
|
742
|
+
const { icon: o, onPick: l } = e, t = H();
|
|
743
|
+
return te(ne, {
|
|
744
|
+
sx: {
|
|
745
|
+
display: "flex",
|
|
746
|
+
flexDirection: "column",
|
|
747
|
+
gap: "4px",
|
|
748
|
+
padding: "6px 8px"
|
|
749
|
+
},
|
|
750
|
+
children: [le(n, {
|
|
751
|
+
sheet: !0,
|
|
752
|
+
title: t(Re),
|
|
753
|
+
"aria-pressed": null === o,
|
|
754
|
+
sx: {
|
|
755
|
+
...je,
|
|
756
|
+
...null === o ? De : null
|
|
757
|
+
},
|
|
758
|
+
onClick: () => {
|
|
759
|
+
l({ ...A });
|
|
760
|
+
},
|
|
761
|
+
children: le(R, {
|
|
762
|
+
icons: [null],
|
|
763
|
+
size: 16
|
|
764
|
+
})
|
|
765
|
+
}), le(ne, {
|
|
766
|
+
sx: {
|
|
767
|
+
display: "grid",
|
|
768
|
+
gridTemplateColumns: "repeat(8, auto)",
|
|
769
|
+
justifyContent: "start",
|
|
770
|
+
gap: "3px"
|
|
771
|
+
},
|
|
772
|
+
children: z.map((e) => {
|
|
773
|
+
const a = (r = o, i = e.spec, !!r && r.iconKey === i.iconKey && r.color === i.color);
|
|
774
|
+
var r, i;
|
|
775
|
+
return le(n, {
|
|
776
|
+
sheet: !0,
|
|
777
|
+
title: x(t, e.spec),
|
|
778
|
+
"aria-pressed": a,
|
|
779
|
+
sx: {
|
|
780
|
+
...je,
|
|
781
|
+
...a ? De : null
|
|
782
|
+
},
|
|
783
|
+
onClick: () => {
|
|
784
|
+
l({
|
|
785
|
+
set: e.set,
|
|
786
|
+
id: e.id
|
|
787
|
+
});
|
|
788
|
+
},
|
|
789
|
+
children: le(R, {
|
|
790
|
+
icons: [e.spec],
|
|
791
|
+
size: 16
|
|
792
|
+
})
|
|
793
|
+
}, `${e.set}:${e.id}`);
|
|
794
|
+
})
|
|
795
|
+
})]
|
|
796
|
+
});
|
|
797
|
+
});
|
|
798
|
+
We.displayName = "IconCatalogPanel";
|
|
799
|
+
var $e = q(Y((e, o) => {
|
|
800
|
+
const { icon: l, onPick: t, tooltip: n, ...a } = e, r = H(), i = J((e) => {
|
|
801
|
+
const { closeFloat: o } = e, n = le(We, {
|
|
802
|
+
icon: l,
|
|
803
|
+
onPick: (e) => {
|
|
804
|
+
o?.(), t(e);
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
return ee({
|
|
808
|
+
...e,
|
|
809
|
+
children: n
|
|
810
|
+
});
|
|
811
|
+
}, [l, t]);
|
|
812
|
+
return le(Z, {
|
|
813
|
+
ref: o,
|
|
814
|
+
renderPopupPanel: i,
|
|
815
|
+
tooltip: n ?? r(Ae),
|
|
816
|
+
icon: le(R, {
|
|
817
|
+
icons: [l],
|
|
818
|
+
size: 16
|
|
819
|
+
}),
|
|
820
|
+
outlined: !0,
|
|
821
|
+
...a
|
|
822
|
+
});
|
|
823
|
+
}));
|
|
824
|
+
$e.displayName = "IconPickerPopupButton";
|
|
825
|
+
var Ke = [
|
|
826
|
+
I.ColorStopType.Percent,
|
|
827
|
+
I.ColorStopType.Num,
|
|
828
|
+
I.ColorStopType.Percentile,
|
|
829
|
+
I.ColorStopType.Formula
|
|
830
|
+
], Ee = q((e) => {
|
|
831
|
+
const { scale: o, onScaleChange: l, readOnly: t, ...n } = e, a = H(), r = o.iconSet ?? w.IconSet.TrafficLights3, i = 0 === E(r).length, d = o.stops ?? [], p = d.length, m = L(o), u = (e) => {
|
|
832
|
+
const t = { ...o };
|
|
833
|
+
for (const [o, l] of Object.entries(e)) void 0 === l ? delete t[o] : t[o] = l;
|
|
834
|
+
l(t);
|
|
835
|
+
}, h = J((e) => {
|
|
836
|
+
const { closeFloat: o } = e, l = le(c, {
|
|
837
|
+
groups: s,
|
|
838
|
+
disabled: t,
|
|
839
|
+
onPick: (e) => {
|
|
840
|
+
o?.(), e.type === I.ScaleType.IconSet && e.iconSet && ((e) => {
|
|
841
|
+
if (e === r) return;
|
|
842
|
+
const o = U(e);
|
|
843
|
+
let l = d;
|
|
844
|
+
o !== d.length && (l = K(o)), u({
|
|
845
|
+
iconSet: e,
|
|
846
|
+
stops: l,
|
|
847
|
+
icon: void 0
|
|
848
|
+
});
|
|
849
|
+
})(e.iconSet);
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
return ee({
|
|
853
|
+
...e,
|
|
854
|
+
children: l
|
|
855
|
+
});
|
|
856
|
+
}, [t, o]), g = k.camelToPrettyCase(r);
|
|
857
|
+
return te(ne, {
|
|
858
|
+
sx: {
|
|
859
|
+
display: "flex",
|
|
860
|
+
flexDirection: "column",
|
|
861
|
+
gap: 1
|
|
862
|
+
},
|
|
863
|
+
...n,
|
|
864
|
+
children: [te(ve, { children: [
|
|
865
|
+
le(ne, {
|
|
866
|
+
sx: {
|
|
867
|
+
display: "flex",
|
|
868
|
+
alignItems: "center",
|
|
869
|
+
gap: 1
|
|
870
|
+
},
|
|
871
|
+
children: le(Z, {
|
|
872
|
+
outlined: !0,
|
|
873
|
+
disabled: t,
|
|
874
|
+
label: g,
|
|
875
|
+
tooltip: g,
|
|
876
|
+
icon: le(ne, {
|
|
877
|
+
sx: {
|
|
878
|
+
width: "82px",
|
|
879
|
+
display: "flex",
|
|
880
|
+
justifyContent: "center"
|
|
881
|
+
},
|
|
882
|
+
children: i ? le(xe, {
|
|
883
|
+
variant: "caption",
|
|
884
|
+
noWrap: !0,
|
|
885
|
+
children: g
|
|
886
|
+
}) : le(R, {
|
|
887
|
+
icons: E(r),
|
|
888
|
+
order: "descending",
|
|
889
|
+
size: 14,
|
|
890
|
+
gap: 3
|
|
891
|
+
})
|
|
892
|
+
}),
|
|
893
|
+
renderPopupPanel: h
|
|
894
|
+
})
|
|
895
|
+
}),
|
|
896
|
+
i && le(xe, {
|
|
897
|
+
variant: "caption",
|
|
898
|
+
sx: { color: "text.secondary" },
|
|
899
|
+
children: a("conditionalFormat.adoptedIconSet")
|
|
900
|
+
}),
|
|
901
|
+
te(ne, {
|
|
902
|
+
sx: {
|
|
903
|
+
display: "flex",
|
|
904
|
+
gap: 1
|
|
905
|
+
},
|
|
906
|
+
children: [le(ie, {
|
|
907
|
+
control: le(ae, {
|
|
908
|
+
size: "small",
|
|
909
|
+
checked: !1 === o.showValue,
|
|
910
|
+
disabled: t,
|
|
911
|
+
onChange: (e) => u({ showValue: !e.target.checked && void 0 })
|
|
912
|
+
}),
|
|
913
|
+
label: le(xe, {
|
|
914
|
+
variant: "body2",
|
|
915
|
+
children: a("conditionalFormat.showIconsOnly")
|
|
916
|
+
})
|
|
917
|
+
}), le(ie, {
|
|
918
|
+
control: le(ae, {
|
|
919
|
+
size: "small",
|
|
920
|
+
checked: o.reverse ?? !1,
|
|
921
|
+
disabled: t,
|
|
922
|
+
onChange: (e) => u({ reverse: !!e.target.checked || void 0 })
|
|
923
|
+
}),
|
|
924
|
+
label: le(xe, {
|
|
925
|
+
variant: "body2",
|
|
926
|
+
children: a("conditionalFormat.reverseIcons")
|
|
927
|
+
})
|
|
928
|
+
})]
|
|
929
|
+
})
|
|
930
|
+
] }), le(ve, {
|
|
931
|
+
variant: "config",
|
|
932
|
+
children: d.map((e, n) => {
|
|
933
|
+
const a = o.reverse ? p - 1 - n : n;
|
|
934
|
+
return le(Pe, {
|
|
935
|
+
stop: e,
|
|
936
|
+
allowedTypes: Ke,
|
|
937
|
+
showExclusive: !0,
|
|
938
|
+
readOnly: t || 0 === n,
|
|
939
|
+
leading: le($e, {
|
|
940
|
+
icon: m[n] ?? null,
|
|
941
|
+
disabled: t || i,
|
|
942
|
+
onPick: (e) => l(G(o, a, e))
|
|
943
|
+
}),
|
|
944
|
+
onStopChange: (e) => {
|
|
945
|
+
const o = d.slice();
|
|
946
|
+
o[n] = e, u({ stops: o });
|
|
947
|
+
}
|
|
948
|
+
}, n);
|
|
949
|
+
})
|
|
950
|
+
})]
|
|
951
|
+
});
|
|
952
|
+
});
|
|
953
|
+
Ee.displayName = "IconSetRulePanel";
|
|
954
|
+
var Ue = (e, o, l) => f(e, o)?.toCSS("adaptive") ?? l, Le = (e, o, l) => {
|
|
955
|
+
if (!e) return l;
|
|
956
|
+
if ("string" == typeof e) return Ue(e, o, l);
|
|
957
|
+
if (e.type === N.Type.None) return l;
|
|
958
|
+
const t = e, n = e;
|
|
959
|
+
return Ue(n.foreground ?? t.color ?? n.background, o, l);
|
|
960
|
+
}, _e = q((e) => {
|
|
961
|
+
const { conditionalFormat: o, size: l = 28, ...t } = e, { workbook: i, themeKey: s } = a();
|
|
962
|
+
_(o, "onAnyChange");
|
|
963
|
+
const c = o.getScale(), u = o.getStyle(), h = Q(() => {
|
|
964
|
+
try {
|
|
965
|
+
return i?.getStyles().getNormal().getFont().toCSS("adaptive") ?? {};
|
|
966
|
+
} catch {
|
|
967
|
+
return {};
|
|
968
|
+
}
|
|
969
|
+
}, [i, s]), y = Q(() => {
|
|
970
|
+
if (c?.type === I.ScaleType.ColorScale) return le(v, { rows: b(c.stops ?? [], m, i) });
|
|
971
|
+
if (c?.type === I.ScaleType.DataBar) return le(v, { rows: d(c, Ue(c.color, i, g), c.borderColor ? Ue(c.borderColor, i, g) : void 0) });
|
|
972
|
+
if (c?.type === I.ScaleType.IconSet) return le(ne, {
|
|
973
|
+
sx: {
|
|
974
|
+
display: "flex",
|
|
975
|
+
alignItems: "center",
|
|
976
|
+
justifyContent: "center",
|
|
977
|
+
width: "100%",
|
|
978
|
+
height: "100%",
|
|
979
|
+
px: .5
|
|
980
|
+
},
|
|
981
|
+
children: le(R, {
|
|
982
|
+
icons: L(c),
|
|
983
|
+
order: "descending",
|
|
984
|
+
size: 14,
|
|
985
|
+
gap: 3
|
|
986
|
+
})
|
|
987
|
+
});
|
|
988
|
+
const e = u?.font, o = e?.underline && e.underline !== B.UnderlineStyle.None;
|
|
989
|
+
return le(ne, {
|
|
990
|
+
sx: {
|
|
991
|
+
width: "100%",
|
|
992
|
+
height: "100%",
|
|
993
|
+
display: "flex",
|
|
994
|
+
alignItems: "center",
|
|
995
|
+
justifyContent: "center",
|
|
996
|
+
...h,
|
|
997
|
+
backgroundColor: Le(u?.fill, i, "transparent"),
|
|
998
|
+
...e?.color && "auto" !== e.color ? { color: Ue(e.color, i, r) } : null,
|
|
999
|
+
...e?.weight ? { fontWeight: e.weight } : null,
|
|
1000
|
+
...e?.style ? { fontStyle: e.style } : null,
|
|
1001
|
+
textDecoration: [o ? "underline" : "", e?.strike ? "line-through" : ""].join(" ").trim() || "none",
|
|
1002
|
+
fontSize: `${Math.round(.5 * l)}px`,
|
|
1003
|
+
lineHeight: 1,
|
|
1004
|
+
outline: u?.borders ? `1px solid ${Ue(Object.values(u.borders)[0]?.color, i, p)}` : void 0,
|
|
1005
|
+
outlineOffset: "-3px"
|
|
1006
|
+
},
|
|
1007
|
+
children: "Aa"
|
|
1008
|
+
});
|
|
1009
|
+
}, [
|
|
1010
|
+
c,
|
|
1011
|
+
u,
|
|
1012
|
+
l,
|
|
1013
|
+
h,
|
|
1014
|
+
i,
|
|
1015
|
+
s
|
|
1016
|
+
]);
|
|
1017
|
+
return le(n, {
|
|
1018
|
+
sheet: !0,
|
|
1019
|
+
className: "sxl-cf-rule-preview",
|
|
1020
|
+
sx: {
|
|
1021
|
+
width: "auto",
|
|
1022
|
+
minWidth: 1.7 * l + "px",
|
|
1023
|
+
height: `${l}px`
|
|
1024
|
+
},
|
|
1025
|
+
...t,
|
|
1026
|
+
children: y
|
|
1027
|
+
});
|
|
1028
|
+
});
|
|
1029
|
+
_e.displayName = "RulePreview";
|
|
1030
|
+
var Ge = (e, o) => {
|
|
1031
|
+
const l = e.getCondition()?.toString();
|
|
1032
|
+
if (l) return l;
|
|
1033
|
+
const t = e.getScale();
|
|
1034
|
+
return t ? k.camelToPrettyCase(t.type) : o("conditionalFormat.noCondition");
|
|
1035
|
+
}, Ve = {
|
|
1036
|
+
classic: Ce("conditionalFormat.tab.classic"),
|
|
1037
|
+
[I.ScaleType.ColorScale]: Ce("conditionalFormat.tab.colorScale"),
|
|
1038
|
+
[I.ScaleType.DataBar]: Ce("conditionalFormat.tab.dataBars"),
|
|
1039
|
+
[I.ScaleType.IconSet]: Ce("conditionalFormat.tab.iconSets")
|
|
1040
|
+
}, He = q((e) => {
|
|
1041
|
+
const { conditionalFormat: o } = e, l = H();
|
|
1042
|
+
_(o, "onAnyChange");
|
|
1043
|
+
const t = o.getScale(), n = o.getCondition(), a = o.getStyle(), r = o.isProtected(), i = t?.type ?? "classic", d = X({ scales: {} }), s = (e) => {
|
|
1044
|
+
o.update({ scale: e });
|
|
1045
|
+
}, c = te(ce, {
|
|
1046
|
+
tabIndex: 0,
|
|
1047
|
+
className: h["editor-panel"],
|
|
1048
|
+
sx: {
|
|
1049
|
+
gap: (e) => e.spacing(1),
|
|
1050
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
1051
|
+
paddingBottom: (e) => e.spacing(2),
|
|
1052
|
+
paddingLeft: (e) => e.spacing(1.5),
|
|
1053
|
+
paddingRight: (e) => e.spacing(1.5),
|
|
1054
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
1055
|
+
borderRadius: (e) => e.spacing(1.25),
|
|
1056
|
+
overflow: "auto"
|
|
1057
|
+
},
|
|
1058
|
+
children: [
|
|
1059
|
+
te(ne, {
|
|
1060
|
+
sx: {
|
|
1061
|
+
display: "flex",
|
|
1062
|
+
flexDirection: "column",
|
|
1063
|
+
gap: (e) => e.spacing(1.75),
|
|
1064
|
+
margin: (e) => e.spacing(1.25),
|
|
1065
|
+
marginBottom: 0
|
|
1066
|
+
},
|
|
1067
|
+
children: [te(ne, {
|
|
1068
|
+
sx: {
|
|
1069
|
+
display: "flex",
|
|
1070
|
+
alignItems: "center",
|
|
1071
|
+
gap: (e) => e.spacing(1.5)
|
|
1072
|
+
},
|
|
1073
|
+
children: [le(_e, {
|
|
1074
|
+
conditionalFormat: o,
|
|
1075
|
+
size: 48
|
|
1076
|
+
}), le(xe, {
|
|
1077
|
+
variant: "body2",
|
|
1078
|
+
sx: {
|
|
1079
|
+
minWidth: 0,
|
|
1080
|
+
wordBreak: "break-word"
|
|
1081
|
+
},
|
|
1082
|
+
children: Ge(o, l)
|
|
1083
|
+
})]
|
|
1084
|
+
}), le(F, {
|
|
1085
|
+
item: o,
|
|
1086
|
+
label: l("conditionalFormat.applyTo")
|
|
1087
|
+
})]
|
|
1088
|
+
}),
|
|
1089
|
+
le(ue, {
|
|
1090
|
+
value: i,
|
|
1091
|
+
onChange: (e, l) => {
|
|
1092
|
+
r || ((e) => {
|
|
1093
|
+
if (e !== i) if ("classic" === i ? (d.current.condition = n?.toJSON() ?? null, d.current.style = a) : t && (d.current.scales[t.type] = t), "classic" === e) o.update({
|
|
1094
|
+
condition: d.current.condition ?? {
|
|
1095
|
+
operator: P.BuiltInOperatorNames.Between,
|
|
1096
|
+
param: null
|
|
1097
|
+
},
|
|
1098
|
+
style: d.current.style ?? null,
|
|
1099
|
+
scale: null
|
|
1100
|
+
});
|
|
1101
|
+
else {
|
|
1102
|
+
const l = d.current.scales[e] ?? (e === I.ScaleType.ColorScale ? j() : e === I.ScaleType.DataBar ? W() : $());
|
|
1103
|
+
o.update({
|
|
1104
|
+
scale: l,
|
|
1105
|
+
condition: null,
|
|
1106
|
+
style: null
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
})(l);
|
|
1110
|
+
},
|
|
1111
|
+
variant: "fullWidth",
|
|
1112
|
+
sx: {
|
|
1113
|
+
minHeight: "36px",
|
|
1114
|
+
borderBottom: 1,
|
|
1115
|
+
borderColor: "divider",
|
|
1116
|
+
"& .MuiTab-root": {
|
|
1117
|
+
minHeight: "36px",
|
|
1118
|
+
textTransform: "none",
|
|
1119
|
+
pt: .5,
|
|
1120
|
+
pb: .5,
|
|
1121
|
+
px: .5,
|
|
1122
|
+
minWidth: 0
|
|
1123
|
+
}
|
|
1124
|
+
},
|
|
1125
|
+
children: Object.keys(Ve).map((e) => le(me, {
|
|
1126
|
+
value: e,
|
|
1127
|
+
label: l(Ve[e])
|
|
1128
|
+
}, e))
|
|
1129
|
+
}),
|
|
1130
|
+
"classic" === i && te(oe, { children: [le(Te, {
|
|
1131
|
+
format: a,
|
|
1132
|
+
readOnly: r,
|
|
1133
|
+
onFormatChange: (e) => o.update({ style: e })
|
|
1134
|
+
}), le(y, {
|
|
1135
|
+
sx: {
|
|
1136
|
+
...C,
|
|
1137
|
+
p: 2,
|
|
1138
|
+
pb: 1
|
|
1139
|
+
},
|
|
1140
|
+
selectorTitle: l("conditionalFormat.highlight"),
|
|
1141
|
+
condition: n,
|
|
1142
|
+
ranges: o.getRanges(),
|
|
1143
|
+
readOnly: r,
|
|
1144
|
+
onConditionChange: (e) => o.setCondition(e)
|
|
1145
|
+
})] }),
|
|
1146
|
+
t?.type === I.ScaleType.ColorScale && le(Ne, {
|
|
1147
|
+
scale: t,
|
|
1148
|
+
onScaleChange: s,
|
|
1149
|
+
readOnly: r
|
|
1150
|
+
}),
|
|
1151
|
+
t?.type === I.ScaleType.DataBar && le(ze, {
|
|
1152
|
+
scale: t,
|
|
1153
|
+
onScaleChange: s,
|
|
1154
|
+
readOnly: r
|
|
1155
|
+
}),
|
|
1156
|
+
t?.type === I.ScaleType.IconSet && le(Ee, {
|
|
1157
|
+
scale: t,
|
|
1158
|
+
onScaleChange: s,
|
|
1159
|
+
readOnly: r
|
|
1160
|
+
}),
|
|
1161
|
+
"classic" === i && le(ne, {
|
|
1162
|
+
sx: {
|
|
1163
|
+
pl: 2,
|
|
1164
|
+
pr: 2,
|
|
1165
|
+
border: 1,
|
|
1166
|
+
borderColor: "divider",
|
|
1167
|
+
borderRadius: 1
|
|
1168
|
+
},
|
|
1169
|
+
children: le(ie, {
|
|
1170
|
+
control: le(ae, {
|
|
1171
|
+
checked: o.isStopIfTrue(),
|
|
1172
|
+
disabled: r,
|
|
1173
|
+
onChange: (e) => o.setStopIfTrue(e.target.checked)
|
|
1174
|
+
}),
|
|
1175
|
+
label: l("conditionalFormat.stopIfTrue")
|
|
1176
|
+
})
|
|
1177
|
+
})
|
|
1178
|
+
]
|
|
1179
|
+
});
|
|
1180
|
+
return le(u.Provider, {
|
|
1181
|
+
value: o,
|
|
1182
|
+
children: c
|
|
1183
|
+
});
|
|
1184
|
+
});
|
|
1185
|
+
He.displayName = "ConditionalFormatEditorPanel";
|
|
1186
|
+
var Ye = q(({ item: e }) => {
|
|
1187
|
+
const o = H();
|
|
1188
|
+
return _(e, "onAnyChange"), !e.isStopIfTrue() || e.getScale() ? null : le(ne, {
|
|
1189
|
+
sx: {
|
|
1190
|
+
display: "inline-flex",
|
|
1191
|
+
alignItems: "center",
|
|
1192
|
+
alignSelf: "flex-start",
|
|
1193
|
+
px: .75,
|
|
1194
|
+
py: .25,
|
|
1195
|
+
border: 1,
|
|
1196
|
+
borderColor: "divider",
|
|
1197
|
+
borderRadius: 1,
|
|
1198
|
+
color: "text.secondary"
|
|
1199
|
+
},
|
|
1200
|
+
children: le(xe, {
|
|
1201
|
+
variant: "caption",
|
|
1202
|
+
children: o("conditionalFormat.stopIfTrue")
|
|
1203
|
+
})
|
|
1204
|
+
});
|
|
1205
|
+
});
|
|
1206
|
+
Ye.displayName = "StopIfTrueBadge";
|
|
1207
|
+
var qe = q(({ item: e }) => {
|
|
1208
|
+
const o = H();
|
|
1209
|
+
return le(F, {
|
|
1210
|
+
item: e,
|
|
1211
|
+
label: o("conditionalFormat.applyTo"),
|
|
1212
|
+
helperText: null
|
|
1213
|
+
});
|
|
1214
|
+
});
|
|
1215
|
+
qe.displayName = "ConditionalFormatCardRanges";
|
|
1216
|
+
var Je = {
|
|
1217
|
+
key: "conditional-format",
|
|
1218
|
+
messageKeys: {
|
|
1219
|
+
none: Ce("conditionalFormat.none"),
|
|
1220
|
+
addPrompt: Ce("conditionalFormat.addPrompt"),
|
|
1221
|
+
heading: Ce("conditionalFormat.heading"),
|
|
1222
|
+
insert: Ce("conditionalFormat.insert"),
|
|
1223
|
+
new: Ce("conditionalFormat.new"),
|
|
1224
|
+
moveUp: Ce("conditionalFormat.moveUp"),
|
|
1225
|
+
moveDown: Ce("conditionalFormat.moveDown"),
|
|
1226
|
+
edit: Ce("conditionalFormat.edit"),
|
|
1227
|
+
duplicate: Ce("conditionalFormat.duplicate"),
|
|
1228
|
+
delete: Ce("conditionalFormat.delete"),
|
|
1229
|
+
cancel: Ce("conditionalFormat.cancel"),
|
|
1230
|
+
save: Ce("conditionalFormat.save")
|
|
1231
|
+
},
|
|
1232
|
+
getCollection: (e) => e.getConditionalFormats(),
|
|
1233
|
+
changeEvents: ["onConditionalFormatsChange"],
|
|
1234
|
+
isReadOnly: (e) => !e.getProtection().isFormatCellsAllowed(),
|
|
1235
|
+
applyUpdate: (e, o) => {
|
|
1236
|
+
e.update(o);
|
|
1237
|
+
},
|
|
1238
|
+
validate: (e) => e.getCondition()?.validate() ?? null,
|
|
1239
|
+
applySeed: (e, o) => {
|
|
1240
|
+
e.update({
|
|
1241
|
+
condition: o.condition ?? null,
|
|
1242
|
+
style: o.style ?? null,
|
|
1243
|
+
scale: o.scale ?? null,
|
|
1244
|
+
stopIfTrue: o.stopIfTrue ?? !1
|
|
1245
|
+
});
|
|
1246
|
+
},
|
|
1247
|
+
getCardTitle: Ge,
|
|
1248
|
+
CardMedia: ({ item: e }) => le(_e, {
|
|
1249
|
+
conditionalFormat: e,
|
|
1250
|
+
size: 32
|
|
1251
|
+
}),
|
|
1252
|
+
CardSubtitle: qe,
|
|
1253
|
+
CardBody: Ye,
|
|
1254
|
+
EditorBody: ({ item: e }) => le(He, { conditionalFormat: e })
|
|
1255
|
+
}, Qe = q(Y((e, o) => {
|
|
1256
|
+
const { workbook: l, args: t, ...n } = e;
|
|
1257
|
+
return le(S, {
|
|
1258
|
+
ref: o,
|
|
1259
|
+
workbook: l,
|
|
1260
|
+
descriptor: Je,
|
|
1261
|
+
args: t,
|
|
1262
|
+
dragReorder: !0,
|
|
1263
|
+
...n
|
|
1264
|
+
});
|
|
1265
|
+
}));
|
|
1266
|
+
Qe.displayName = "ConditionalFormatDetailsPanel";
|
|
1267
|
+
var Xe = (e) => {
|
|
1268
|
+
const { model: o, entryKey: l, frame: t, args: n, ref: a, ...r } = e;
|
|
1269
|
+
return le(Qe, {
|
|
1270
|
+
ref: a,
|
|
1271
|
+
workbook: o,
|
|
1272
|
+
args: n,
|
|
1273
|
+
...r
|
|
1274
|
+
});
|
|
1275
|
+
};
|
|
1276
|
+
export { Xe as ConditionalFormatDetailsTaskPane };
|