@sheetxl/studio-mui 0.8.0-beta.1 → 0.8.0-beta.11
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/browser/esm/0BWO0bLZ8Vm_dKd2.mjs +582 -0
- package/browser/esm/BAbq4-I5f5oUiNaF.mjs +141 -0
- package/browser/esm/BED6h6YAwCf1HEQJ.mjs +161 -0
- package/browser/esm/{DMLXV4EKl1NCp_jk.mjs → BXhNFzyEGokTF-BL.mjs} +2 -2
- package/browser/esm/BYE9gCDWKyx6mnVs.mjs +381 -0
- package/browser/esm/BjvD_4t2KGsZP5V8.mjs +71 -0
- package/browser/esm/{zWTZ8BvT4hjgC2ua.mjs → BknfGJouygmnpFIU.mjs} +13 -12
- package/browser/esm/{DNDrQKMTzKzNMjl-.mjs → BlE_8o8tO2AgAlaj.mjs} +19 -17
- package/browser/esm/BokqKEpU6TFgfRs6.mjs +252 -0
- package/browser/esm/{BoLxSRdEWt-Yg2RI.mjs → Brsh5yscJ_4uKFXp.mjs} +130 -103
- package/browser/esm/Bujtz_Guj88d03vI.mjs +831 -0
- package/browser/esm/Buqcl7J75MJrhpVE.mjs +1379 -0
- package/browser/esm/BvhYPwX3GrRaO9CM.mjs +319 -0
- package/browser/esm/C0wlMAIn9iREPK6w.mjs +87 -0
- package/browser/esm/C8JU4KsMasmLvojI.mjs +103 -0
- package/browser/esm/C9pIZVACtl9unFOp.mjs +77 -0
- package/browser/esm/CBD4RiRKbbZtSXV-.mjs +318 -0
- package/browser/esm/CEtXsBzEjEKk9GOj.mjs +117 -0
- package/browser/esm/{BZBJG2tDdD3-VujP.mjs → COlZu93LRwuBvjE-.mjs} +195 -174
- package/browser/esm/{Cj2pgCNqBCGl4rTX.mjs → CTjqDD-swFMZzI-Y.mjs} +587 -556
- package/browser/esm/CWkOgdL7mOKiTR62.mjs +975 -0
- package/browser/esm/ChSVxkPTIjgcC8PL.mjs +412 -0
- package/browser/esm/{Cd6n1XUgF0VItpkH.mjs → ClBvNPeNCAhuVWrG.mjs} +7 -5
- package/browser/esm/CyLn6zOOp_biA3xU.mjs +335 -0
- package/browser/esm/CynTY0oNtyJnoaBq.mjs +14 -0
- package/browser/esm/D3rRUK4dIM5gUSmj.mjs +256 -0
- package/browser/esm/D9ISy7VkaRRFJl46.mjs +515 -0
- package/browser/esm/DDc6rDuU9JAo1DH_.mjs +225 -0
- package/browser/esm/DDczwkXhz_MHub4z.mjs +197 -0
- package/browser/esm/{3ydDykDMtDYbfVVn.mjs → DEv4pIEgYr5C7etm.mjs} +178 -129
- package/browser/esm/DG21x7RKDpge6zAE.mjs +31 -0
- package/browser/esm/DJOOed_OtB-XT7f3.mjs +437 -0
- package/browser/esm/{Bz5LiUe3SZ8g42Ia.mjs → DKtJxrpN0axtuQ0l.mjs} +1 -1
- package/browser/esm/DRSCS6aLiYmPjUz1.mjs +1543 -0
- package/browser/esm/{ChwS_ougBsogOEsP.mjs → DTpRkgsTm_zYnWfW.mjs} +46 -47
- package/browser/esm/DV6i9RQZfJiKtEaJ.mjs +2552 -0
- package/browser/esm/DdcZrjMLWVukWcU5.mjs +7473 -0
- package/browser/esm/Di3BUxA0SqFWWgeg.mjs +94 -0
- package/browser/esm/DnGaP5F7mLwCGUYG.mjs +408 -0
- package/browser/esm/DpD4fg2WcyiKX_2K.mjs +414 -0
- package/browser/esm/{BUGepznywvV0tUjW.mjs → Ds3XRkne7HxcXD8J.mjs} +2 -2
- package/browser/esm/DsoNMWDwHZP8UXQd.mjs +293 -0
- package/browser/esm/G0Inqm6Eqw47dMpa.mjs +212 -0
- package/browser/esm/HViD4Wfoi0mmqk9w.mjs +13 -0
- package/browser/esm/LZoYSQAYV2wksnDv.mjs +386 -0
- package/browser/esm/{rU8xNPVQtDSnujM-.mjs → QgaAIDUMmBQBsXP9.mjs} +3 -3
- package/browser/esm/YThnrg3PadGs7B4j.mjs +627 -0
- package/browser/esm/index.mjs +1208 -67
- package/browser/esm/ttjcNHcFn8O6hfnd.mjs +1288 -0
- package/browser/esm/w_JrR69vEpvoyeMy.mjs +68 -0
- package/browser/esm/{CVfuCNRpODUw04IH.mjs → xFqkfN8QMCxvsetB.mjs} +1 -1
- package/browser/esm/zqilJefihVd7At2T.mjs +517 -0
- package/licenses/dependencies.txt +96 -349
- package/node/esm/1bf4gn-2vld4BZ9u.mjs +294 -0
- package/node/esm/{BhqI3pQFkV8K_612.mjs → 3WghtBXAvCDwcVrq.mjs} +1 -1
- package/node/esm/4HmLH0bPVJCZLgik.mjs +116 -0
- package/node/esm/{DM7K7-284z-PczVz.mjs → B0bdb_6p7fQI_ivo.mjs} +28 -28
- package/node/esm/BIMkjQUwG4Ih-6Sh.mjs +142 -0
- package/node/esm/BNg4QQY0WAPLE0q7.mjs +141 -0
- package/node/esm/BPzcW4BejRqso338.mjs +72 -0
- package/node/esm/BR45ogAR-hY2bE60.mjs +318 -0
- package/node/esm/BlN7G0DVC24zauig.mjs +197 -0
- package/node/esm/Bph-sR3l6AYWeuxK.mjs +256 -0
- package/node/esm/CPq-MIdEnc-53JpF.mjs +319 -0
- package/node/esm/CSAnTp5rwId0DUb8.mjs +380 -0
- package/node/esm/CWcv7UVXF8IUB0PC.mjs +1379 -0
- package/node/esm/{BA7VzUQ2sKRLTZ5c.mjs → CYIoK22I6Yvv12_x.mjs} +20 -20
- package/node/esm/CZyA9uD4SkTvqp_G.mjs +1283 -0
- package/node/esm/{CHi3AuWEwEPOg9IZ.mjs → CjC6s3RUJQNCF7mP.mjs} +1 -1
- package/node/esm/{DXZrzWee8K5FPOW1.mjs → CuMePia6i_8yfJ6S.mjs} +9 -9
- package/node/esm/CvRbu8JPxFarsSR-.mjs +412 -0
- package/node/esm/CyafafEgfmjLqE5O.mjs +521 -0
- package/node/esm/D-xqQ5qOSd6WrzwJ.mjs +94 -0
- package/node/esm/DLqBHdFp6wvm6EGs.mjs +212 -0
- package/node/esm/{BwZcoHDBmLPIVOT5.mjs → DMXLxp3T0E0SRTQc.mjs} +69 -70
- package/node/esm/{CUMKTjYv6VTkcWYi.mjs → DWqvf4H5F2wMnZ0L.mjs} +32 -30
- package/node/esm/DatM6eEYPpAtIMy-.mjs +405 -0
- package/node/esm/Db3dbaYLKUO66T9s.mjs +1689 -0
- package/node/esm/DdEzhVqYTrGODXrz.mjs +68 -0
- package/node/esm/DeZJlLk8WJ3BLtLs.mjs +975 -0
- package/node/esm/DfCuL8AUxMFoEG2s.mjs +519 -0
- package/node/esm/Do-zCKziWhoG5eAv.mjs +77 -0
- package/node/esm/DpJ2gmZJioCyq8La.mjs +632 -0
- package/node/esm/{Qpuqm6xBr_da38Ht.mjs → XEDcegsv5AGKBfu2.mjs} +165 -137
- package/node/esm/index.mjs +10124 -6751
- package/node/esm/yCUxQuqVuC4DHKPx.mjs +385 -0
- package/node/esm/zITjZ7R4raDqhP-n.mjs +515 -0
- package/package.json +15 -18
- package/resources/locales/de/groups.cmd.json +29 -16
- package/resources/locales/de/studio.cmd.json +18 -1
- package/resources/locales/de/ui.msg.json +447 -40
- package/resources/locales/en/groups.cmd.json +39 -17
- package/resources/locales/en/studio.cmd.json +18 -1
- package/resources/locales/en/ui.msg.json +403 -40
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +21 -5
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +14 -0
- package/types/src/anchorItems/AnchoredRangeField.d.ts +40 -0
- package/types/src/anchorItems/index.d.ts +1 -0
- package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
- package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
- package/types/src/anomalies/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +6 -6
- package/types/src/border/BorderStylePopupButton.d.ts +3 -3
- package/types/src/border/BorderTemplateIcon.d.ts +29 -0
- package/types/src/border/index.d.ts +1 -0
- 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/ColorPanel.d.ts +8 -2
- package/types/src/color/ColorPopupButton.d.ts +2 -1
- package/types/src/command/NumberFormatQuickButtons.d.ts +32 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts +3 -3
- package/types/src/command/SheetZoomCommandButton.d.ts +4 -3
- package/types/src/comments/CommentCard.d.ts +41 -0
- package/types/src/comments/CommentsPlugin.d.ts +6 -0
- package/types/src/comments/CommentsTaskPane.d.ts +23 -0
- package/types/src/comments/index.d.ts +4 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +4 -4
- package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +2 -2
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +1 -1
- package/types/src/conditions/BetweenOption.d.ts +6 -1
- package/types/src/conditions/CombinatorOption.d.ts +7 -0
- package/types/src/conditions/ConditionEditor.d.ts +61 -4
- package/types/src/conditions/ConditionUtils.d.ts +65 -6
- package/types/src/conditions/ExpressionOption.d.ts +12 -6
- package/types/src/conditions/MembershipOption.d.ts +67 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +36 -1
- package/types/src/conditions/ScalarOption.d.ts +25 -6
- 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 +54 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +7 -1
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -2
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +13 -2
- package/types/src/dataValidation/DataValidationIcon.d.ts +22 -0
- package/types/src/dataValidation/DataValidationTitle.d.ts +13 -0
- package/types/src/dialog/FillSeriesDialog.d.ts +16 -0
- package/types/src/dialog/OutlineSettingsDialog.d.ts +12 -0
- package/types/src/dialog/TableNewDialog.d.ts +1 -4
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/dialog/_ShortcutSearch.d.ts +26 -0
- package/types/src/dialog/index.d.ts +0 -2
- package/types/src/externalLink/ExternalLinkCardBody.d.ts +9 -0
- package/types/src/externalLink/ExternalLinkChip.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkLocation.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +18 -0
- package/types/src/externalLink/ExternalLinksPanel.d.ts +11 -0
- package/types/src/externalLink/ExternalLinksPlugin.d.ts +5 -0
- package/types/src/externalLink/ExternalLinksTaskPane.d.ts +19 -0
- package/types/src/externalLink/index.d.ts +8 -0
- package/types/src/fill/GradientEditor.d.ts +41 -0
- package/types/src/fill/GradientStopsBar.d.ts +43 -0
- package/types/src/fill/PatternPopupButton.d.ts +26 -0
- package/types/src/fill/PatternSwatch.d.ts +53 -0
- package/types/src/fill/index.d.ts +5 -0
- package/types/src/filter/ColumnMenu.d.ts +31 -1
- package/types/src/filter/index.d.ts +0 -1
- package/types/src/form/FormulaField.d.ts +35 -6
- package/types/src/form/InputField.d.ts +35 -5
- package/types/src/format/AlignmentPanel.d.ts +13 -0
- package/types/src/format/BorderPanel.d.ts +22 -0
- package/types/src/format/BorderPreview.d.ts +101 -0
- package/types/src/format/FillPanel.d.ts +65 -0
- package/types/src/format/FontPanel.d.ts +12 -0
- package/types/src/format/FormatCellPreview.d.ts +35 -0
- package/types/src/format/FormatPanelParts.d.ts +85 -0
- package/types/src/format/FormatPlugin.d.ts +11 -0
- package/types/src/format/FormatTaskPane.d.ts +39 -0
- package/types/src/format/LinePanel.d.ts +53 -0
- package/types/src/format/LinePreviews.d.ts +71 -0
- package/types/src/format/NumberFormatOption.d.ts +43 -0
- package/types/src/{numberFormat → format}/NumberFormatPanel.d.ts +20 -0
- package/types/src/format/index.d.ts +14 -0
- package/types/src/format/useFormatSelection.d.ts +93 -0
- package/types/src/formulaBar/IFormulaBar.d.ts +11 -0
- package/types/src/formulaBar/MobileFormulaBar.d.ts +33 -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 -4
- package/types/src/itemsPanel/EditorCommit.d.ts +32 -0
- package/types/src/itemsPanel/EditorPanel.d.ts +4 -1
- package/types/src/itemsPanel/ItemCard.d.ts +60 -8
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +68 -19
- package/types/src/itemsPanel/ItemsPanel.d.ts +9 -0
- package/types/src/itemsPanel/ItemsSearchField.d.ts +17 -0
- package/types/src/itemsPanel/index.d.ts +2 -0
- package/types/src/named/NamedDetailsPanel.d.ts +9 -2
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -2
- package/types/src/named/NamedEditorPanel.d.ts +1 -1
- package/types/src/named/NamedExpressionField.d.ts +32 -0
- package/types/src/named/NamedKindChip.d.ts +38 -0
- package/types/src/picture/PicturePlugin.d.ts +6 -0
- package/types/src/picture/index.d.ts +2 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +6 -0
- package/types/src/protectedRange/ProtectedRangeDraft.d.ts +22 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +0 -14
- package/types/src/protectedRange/index.d.ts +2 -1
- package/types/src/protection/ManageProtectionTaskPane.d.ts +29 -0
- package/types/src/protection/PasswordDialog.d.ts +32 -0
- package/types/src/protection/PasswordField.d.ts +35 -0
- package/types/src/protection/ProtectedCellsPanel.d.ts +20 -0
- package/types/src/protection/ProtectionPlugin.d.ts +11 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +34 -15
- package/types/src/protection/WorkbookProtectionTab.d.ts +22 -0
- package/types/src/protection/WorksheetProtectionPanel.d.ts +35 -0
- package/types/src/protection/index.d.ts +7 -1
- package/types/src/shape/InsertShapeCommandButton.d.ts +20 -0
- package/types/src/shape/ShapeFormatPanel.d.ts +11 -0
- package/types/src/shape/ShapePlugin.d.ts +6 -0
- package/types/src/shape/index.d.ts +3 -0
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +18 -0
- package/types/src/slicer/SlicerPlugin.d.ts +6 -0
- package/types/src/slicer/index.d.ts +3 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +6 -0
- package/types/src/studio/CommandsWrapper.d.ts +5 -0
- package/types/src/studio/EagerStudio.d.ts +14 -1
- package/types/src/studio/StudioCommandProvider.d.ts +10 -0
- package/types/src/studio/StudioCommands.d.ts +40 -4
- package/types/src/studio/StudioProps.d.ts +64 -2
- package/types/src/studio/StudioSplitPane.d.ts +1 -1
- package/types/src/studio/formulaBarPlacement.d.ts +35 -0
- package/types/src/studio/splitStudioProps.d.ts +7 -0
- package/types/src/studio/useStudioApp.d.ts +31 -18
- package/types/src/template/TemplateCommands.d.ts +29 -0
- package/types/src/template/TemplateDialog.d.ts +19 -0
- package/types/src/template/TemplatePanel.d.ts +50 -0
- package/types/src/template/TemplateSearchField.d.ts +29 -0
- package/types/src/template/WelcomeDialog.d.ts +29 -0
- package/types/src/template/categoryColor.d.ts +8 -0
- package/types/src/template/index.d.ts +3 -0
- package/types/src/template/useTemplateCatalog.d.ts +71 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
- package/types/src/workbook/DefaultRenderers.d.ts +16 -2
- package/types/src/workbook/FillMenu.d.ts +21 -0
- 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 +1 -1
- package/types/src/workbook/index.d.ts +1 -0
- package/browser/cjs/BQJKf40kttQWOzLw.cjs +0 -20
- package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +0 -1
- package/browser/cjs/B_D3JKseVvpRyX-E.cjs +0 -1
- package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +0 -2
- package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +0 -2
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
- package/browser/cjs/Bte6P3MhSjajJmmY.cjs +0 -7
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +0 -1
- package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +0 -1
- package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +0 -1
- package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +0 -1
- package/browser/cjs/CYxc8vnRi8dNpDPk.cjs +0 -1
- package/browser/cjs/CZm1jVZaHQ246prW.cjs +0 -1
- package/browser/cjs/CdDYyAfccXme8w6m.cjs +0 -1
- package/browser/cjs/Cm1APq2MraYNNhyI.cjs +0 -1
- package/browser/cjs/DO8V31Z1ewgMA1di.cjs +0 -5
- package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +0 -1
- package/browser/cjs/IASAYG6qgv7lJY7y.cjs +0 -1
- package/browser/cjs/KZvriGbhEOVkQD0b.cjs +0 -1
- package/browser/cjs/UnMhi28mbvLiOXQe.cjs +0 -1
- package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +0 -1
- package/browser/cjs/iMWEL01eC83oU-YY.cjs +0 -1
- package/browser/cjs/index.cjs +0 -2
- package/browser/cjs/w2GjebPlOFv3pCbm.cjs +0 -1
- package/browser/cjs/z0rB4fK6X1M6PpVD.cjs +0 -11
- package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +0 -1
- package/browser/esm/BuY3uV47Bwbqpasq.mjs +0 -219
- package/browser/esm/CAs1MWvJTcRfJy26.mjs +0 -217
- package/browser/esm/CBU3LgLYmqtQjJbu.mjs +0 -1150
- package/browser/esm/CDU0rqpLNVtMLI-f.mjs +0 -52
- package/browser/esm/CVBub6pgTsJzCc5m.mjs +0 -5429
- package/browser/esm/C_XvSsQ9BVdHffCO.mjs +0 -47
- package/browser/esm/FT29q8yNwsEpVZjt.mjs +0 -9257
- package/browser/esm/Hb1rlHT4tE5hLcjM.mjs +0 -82
- package/browser/esm/UJOXCQv6KrG1gY3l.mjs +0 -105
- package/browser/esm/s46El7mT6oKLSnYB.mjs +0 -411
- package/node/esm/9FY82fj1R1c-AczW.mjs +0 -47
- package/node/esm/C-boHCnJditFzng3.mjs +0 -106
- package/node/esm/DxXM8qHi0Oz4Zovl.mjs +0 -4575
- package/node/esm/sQt2wWGTRLzqeJdG.mjs +0 -82
- package/node/esm/yCHAZKxJR7qY_ySy.mjs +0 -470
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +0 -32
- package/types/src/conditions/DateTimeOption.d.ts +0 -43
- package/types/src/conditions/InSetOption.d.ts +0 -37
- package/types/src/dialog/CommentsDialog.d.ts +0 -11
- package/types/src/dialog/NumberFormatDialog.d.ts +0 -12
- package/types/src/filter/FilterList.d.ts +0 -28
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +0 -12
- package/types/src/numberFormat/index.d.ts +0 -8
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +0 -3
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +0 -2
- package/types/src/protection/WorkbookProtectionDialog.d.ts +0 -23
|
@@ -0,0 +1,1283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { AutoColorPosition as e, BorderPopupButton as o, C as l, ColorPopupButton as t, FormulaField as a, PresetChip as n, S as r, T as i, _ as d, b as s, c, f as p, g as u, h as m, l as g, m as h, o as y, s as x, v as C, w as f, x as v, y as b } from "./index.mjs";
|
|
8
|
+
import { n as S, t as F } from "./BNg4QQY0WAPLE0q7.mjs";
|
|
9
|
+
import { Color as T, CommonUtils as k, ICellStyle as w, ICondition as P, IConditionalFormat as I, IFill as N, IFont as M } from "@sheetxl/sdk";
|
|
10
|
+
import { COLOR_SCALE_PRESETS as B, DATA_BAR_PRESETS as O, ICON_CATALOG as z, IconSetGlyphs as A, NO_CELL_ICON as R, 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, defaultCreatePopupPanel 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 ae, Checkbox as ne, FormControl as re, FormControlLabel as ie, InputLabel as de, MenuItem as se, Paper as ce, Select as pe, Tab as ue, Tabs as me, TextField as ge, ToggleButton as he, ToggleButtonGroup as ye, Typography as xe } from "@mui/material";
|
|
16
|
+
import { messageKey as Ce } from "@sheetxl/utils";
|
|
17
|
+
var fe = q((e) => {
|
|
18
|
+
const { variant: o = "format", children: l, sx: t, ...a } = e;
|
|
19
|
+
return le(ae, {
|
|
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
|
+
...a,
|
|
33
|
+
children: l
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
fe.displayName = "RuleSection";
|
|
37
|
+
var ve = 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((l) => {
|
|
45
|
+
const { format: a, onFormatChange: r, readOnly: d, ...s } = l, c = H(), { workbook: p, schemeLookup: u, themeKey: m, darkMode: g, propsColorPanel: h } = i(), y = a?.font ?? null, x = (y?.weight ?? 400) >= 600, C = y?.style === M.Style.Italic, f = !!y?.underline && y.underline !== M.UnderlineStyle.None, v = !!y?.strike && y.strike !== M.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 = { ...a };
|
|
49
|
+
0 === Object.keys(o).length ? delete l.font : l.font = o, r(0 === Object.keys(l).length ? null : l);
|
|
50
|
+
}, S = Q(() => p?.getStyles().getNormal().getFont().getColor(), [p, m]), F = Q(() => Fe(y?.color, p), [
|
|
51
|
+
y?.color,
|
|
52
|
+
p,
|
|
53
|
+
m
|
|
54
|
+
]), T = Q(() => Fe(Se(a?.fill), p), [
|
|
55
|
+
a?.fill,
|
|
56
|
+
p,
|
|
57
|
+
m
|
|
58
|
+
]), k = {
|
|
59
|
+
padding: "4px",
|
|
60
|
+
border: "none",
|
|
61
|
+
borderRadius: 1
|
|
62
|
+
};
|
|
63
|
+
return te(fe, {
|
|
64
|
+
...s,
|
|
65
|
+
children: [te(ae, {
|
|
66
|
+
sx: {
|
|
67
|
+
display: "flex",
|
|
68
|
+
alignItems: "flex-start",
|
|
69
|
+
gap: 1
|
|
70
|
+
},
|
|
71
|
+
children: [le(ae, {
|
|
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: () => r(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 || !a,
|
|
98
|
+
onClick: () => r(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(ae, {
|
|
109
|
+
sx: {
|
|
110
|
+
display: "flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
gap: .25
|
|
113
|
+
},
|
|
114
|
+
children: [
|
|
115
|
+
le(he, {
|
|
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(he, {
|
|
125
|
+
value: "italic",
|
|
126
|
+
size: "small",
|
|
127
|
+
sx: k,
|
|
128
|
+
selected: C,
|
|
129
|
+
disabled: d,
|
|
130
|
+
onChange: () => b({ style: C ? void 0 : M.Style.Italic }),
|
|
131
|
+
children: le(V, { iconKey: "TextItalic" })
|
|
132
|
+
}),
|
|
133
|
+
le(he, {
|
|
134
|
+
value: "underline",
|
|
135
|
+
size: "small",
|
|
136
|
+
sx: k,
|
|
137
|
+
selected: f,
|
|
138
|
+
disabled: d,
|
|
139
|
+
onChange: () => b({ underline: f ? void 0 : M.UnderlineStyle.Single }),
|
|
140
|
+
children: le(V, { iconKey: "TextUnderline" })
|
|
141
|
+
}),
|
|
142
|
+
le(he, {
|
|
143
|
+
value: "strike",
|
|
144
|
+
size: "small",
|
|
145
|
+
sx: k,
|
|
146
|
+
selected: v,
|
|
147
|
+
disabled: d,
|
|
148
|
+
onChange: () => b({ strike: v ? void 0 : M.StrikeStyle.Single }),
|
|
149
|
+
children: le(V, { iconKey: "TextStrike" })
|
|
150
|
+
}),
|
|
151
|
+
p && le(o, {
|
|
152
|
+
tooltip: c("conditionalFormat.border"),
|
|
153
|
+
selectedBorder: a?.borders,
|
|
154
|
+
createBorder: (e) => p.getStyles().getNormal().createStyle({ borders: e }).getBorders(),
|
|
155
|
+
schemeLookup: u,
|
|
156
|
+
autoColor: S,
|
|
157
|
+
darkMode: g,
|
|
158
|
+
disabled: d,
|
|
159
|
+
onSelectBorder: (e) => ((e) => {
|
|
160
|
+
const o = { ...a };
|
|
161
|
+
e && 0 !== Object.keys(e).length ? o.borders = e : delete o.borders, r(0 === Object.keys(o).length ? null : o);
|
|
162
|
+
})(e)
|
|
163
|
+
}),
|
|
164
|
+
le(t, {
|
|
165
|
+
icon: "fill.colored",
|
|
166
|
+
tooltip: c("conditionalFormat.fillColor"),
|
|
167
|
+
selectedColor: T,
|
|
168
|
+
disabled: d,
|
|
169
|
+
onSelectColor: (e) => ((e) => {
|
|
170
|
+
const o = { ...a };
|
|
171
|
+
e ? o.fill = {
|
|
172
|
+
type: N.Type.Solid,
|
|
173
|
+
color: e.toString()
|
|
174
|
+
} : delete o.fill, r(0 === Object.keys(o).length ? null : o);
|
|
175
|
+
})(e),
|
|
176
|
+
darkMode: g,
|
|
177
|
+
propsPanel: {
|
|
178
|
+
disableAlpha: !0,
|
|
179
|
+
autoColor: ve,
|
|
180
|
+
autoColorLabelKey: Ce("color.noFill"),
|
|
181
|
+
autoColorPosition: e.End,
|
|
182
|
+
...h
|
|
183
|
+
}
|
|
184
|
+
}),
|
|
185
|
+
le(t, {
|
|
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: g,
|
|
192
|
+
propsPanel: {
|
|
193
|
+
disableAlpha: !0,
|
|
194
|
+
autoColor: S,
|
|
195
|
+
...h
|
|
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: l, onStopChange: n, allowedTypes: r, showColor: d = !1, leading: s, showExclusive: c = !1, readOnly: p, ...u } = e, m = H(), { darkMode: h, toColor: y, propsColorPanel: x } = i(), C = g(), f = l.type ?? I.ColorStopType.Num, v = !we.has(f), b = p || !v, S = f === I.ColorStopType.Formula, F = l.value?.isIFormula ? l.value : null, T = l.color, k = d ? y(T) : null;
|
|
219
|
+
return te(ae, {
|
|
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
|
+
s,
|
|
239
|
+
d && le(t, {
|
|
240
|
+
tooltip: m("conditionalFormat.stopColor"),
|
|
241
|
+
selectedColor: k,
|
|
242
|
+
disabled: p,
|
|
243
|
+
onSelectColor: (e) => {
|
|
244
|
+
e && n({
|
|
245
|
+
...l,
|
|
246
|
+
color: e.toString()
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
darkMode: h,
|
|
250
|
+
propsPanel: {
|
|
251
|
+
disableAlpha: !0,
|
|
252
|
+
...x
|
|
253
|
+
}
|
|
254
|
+
}),
|
|
255
|
+
c && te(pe, {
|
|
256
|
+
size: "small",
|
|
257
|
+
value: l.exclusive ? "gt" : "gte",
|
|
258
|
+
disabled: p,
|
|
259
|
+
onChange: (e) => {
|
|
260
|
+
const o = { ...l };
|
|
261
|
+
"gt" === e.target.value ? o.exclusive = !0 : delete o.exclusive, n(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: f,
|
|
278
|
+
disabled: p,
|
|
279
|
+
onChange: (e) => ((e) => {
|
|
280
|
+
const o = {
|
|
281
|
+
...l,
|
|
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
|
+
n(o);
|
|
291
|
+
})(e.target.value),
|
|
292
|
+
sx: {
|
|
293
|
+
flex: "1 1 40%",
|
|
294
|
+
minWidth: 0,
|
|
295
|
+
backgroundColor: "background.paper"
|
|
296
|
+
},
|
|
297
|
+
children: r.map((e) => le(se, {
|
|
298
|
+
value: e,
|
|
299
|
+
children: m(ke[e])
|
|
300
|
+
}, e))
|
|
301
|
+
}),
|
|
302
|
+
S ? le(a, {
|
|
303
|
+
size: "small",
|
|
304
|
+
home: C.home,
|
|
305
|
+
value: F ? C.display(F) : `${l.value ?? ""}`,
|
|
306
|
+
onChangeText: (e) => {
|
|
307
|
+
n({
|
|
308
|
+
...l,
|
|
309
|
+
value: e.trim().length > 0 ? C.compile(e) : e
|
|
310
|
+
});
|
|
311
|
+
},
|
|
312
|
+
placeholder: m("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(ge, {
|
|
325
|
+
size: "small",
|
|
326
|
+
type: "number",
|
|
327
|
+
placeholder: v ? void 0 : m("conditionalFormat.stopFromData"),
|
|
328
|
+
value: v ? `${l.value ?? ""}` : "",
|
|
329
|
+
disabled: b,
|
|
330
|
+
onChange: (e) => {
|
|
331
|
+
const o = e.target.value;
|
|
332
|
+
n({
|
|
333
|
+
...l,
|
|
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, ...a } = e, d = H(), { workbook: s, toColor: c } = i(), p = o.stops ?? [], u = 2 === p.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(ae, {
|
|
365
|
+
sx: {
|
|
366
|
+
display: "flex",
|
|
367
|
+
flexDirection: "column",
|
|
368
|
+
gap: 1
|
|
369
|
+
},
|
|
370
|
+
...a,
|
|
371
|
+
children: [le(fe, { children: te(ae, {
|
|
372
|
+
sx: {
|
|
373
|
+
display: "flex",
|
|
374
|
+
alignItems: "flex-start",
|
|
375
|
+
gap: 1
|
|
376
|
+
},
|
|
377
|
+
children: [le(ae, {
|
|
378
|
+
sx: {
|
|
379
|
+
flex: "1 1 auto",
|
|
380
|
+
minWidth: 0,
|
|
381
|
+
display: "flex",
|
|
382
|
+
gap: .5,
|
|
383
|
+
flexWrap: "wrap"
|
|
384
|
+
},
|
|
385
|
+
children: B.filter((e) => e.stops.length === (2 === p.length ? 2 : 3)).map((e, o) => le(n, {
|
|
386
|
+
sheet: !0,
|
|
387
|
+
disabled: t,
|
|
388
|
+
onClick: () => l(structuredClone(e)),
|
|
389
|
+
children: le(v, { rows: r(e.stops ?? [], C, s) })
|
|
390
|
+
}, o))
|
|
391
|
+
}), te(ye, {
|
|
392
|
+
exclusive: !0,
|
|
393
|
+
size: "small",
|
|
394
|
+
value: 2 === p.length ? 2 : 3,
|
|
395
|
+
disabled: t,
|
|
396
|
+
onChange: (e, t) => {
|
|
397
|
+
t && ((e) => {
|
|
398
|
+
if (e === p.length || 2 !== e && 3 !== e) return;
|
|
399
|
+
const t = p.slice();
|
|
400
|
+
if (3 === e) {
|
|
401
|
+
let e = "#FFEB84";
|
|
402
|
+
const o = c(p[0]?.color ?? e)?.toRGBA(), l = c(p[p.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(he, {
|
|
421
|
+
value: 2,
|
|
422
|
+
sx: {
|
|
423
|
+
textTransform: "none",
|
|
424
|
+
pt: .25,
|
|
425
|
+
pb: .25
|
|
426
|
+
},
|
|
427
|
+
children: d("conditionalFormat.twoColor")
|
|
428
|
+
}), le(he, {
|
|
429
|
+
value: 3,
|
|
430
|
+
sx: {
|
|
431
|
+
textTransform: "none",
|
|
432
|
+
pt: .25,
|
|
433
|
+
pb: .25
|
|
434
|
+
},
|
|
435
|
+
children: d("conditionalFormat.threeColor")
|
|
436
|
+
})]
|
|
437
|
+
})]
|
|
438
|
+
}) }), le(fe, {
|
|
439
|
+
variant: "config",
|
|
440
|
+
children: p.map((e, a) => le(Pe, {
|
|
441
|
+
label: d(u[Math.min(a, u.length - 1)]),
|
|
442
|
+
stop: e,
|
|
443
|
+
allowedTypes: Ie,
|
|
444
|
+
showColor: !0,
|
|
445
|
+
readOnly: t,
|
|
446
|
+
onStopChange: (e) => {
|
|
447
|
+
const t = p.slice();
|
|
448
|
+
t[a] = e, l({
|
|
449
|
+
...o,
|
|
450
|
+
stops: t
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}, a))
|
|
454
|
+
})]
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
Ne.displayName = "ColorScaleRulePanel";
|
|
458
|
+
var Me = [
|
|
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
|
+
], Be = [
|
|
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: a, readOnly: r, ...d } = e, s = H(), { darkMode: c, toColor: p, propsColorPanel: u } = i(), m = o.stops ?? [], g = p(o.color), h = p(o.negativeFillColor), y = p(o.borderColor), x = p(o.negativeBorderColor), C = o.gradient ?? !1, f = (e) => {
|
|
474
|
+
const l = { ...o };
|
|
475
|
+
for (const [o, t] of Object.entries(e)) void 0 === t ? delete l[o] : l[o] = t;
|
|
476
|
+
a(l);
|
|
477
|
+
}, b = { backgroundColor: "background.paper" };
|
|
478
|
+
return te(ae, {
|
|
479
|
+
sx: {
|
|
480
|
+
display: "flex",
|
|
481
|
+
flexDirection: "column",
|
|
482
|
+
gap: 1
|
|
483
|
+
},
|
|
484
|
+
...d,
|
|
485
|
+
children: [te(fe, { children: [
|
|
486
|
+
te(ae, {
|
|
487
|
+
sx: {
|
|
488
|
+
display: "flex",
|
|
489
|
+
alignItems: "flex-start",
|
|
490
|
+
gap: 1
|
|
491
|
+
},
|
|
492
|
+
children: [le(ae, {
|
|
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.gradient ?? !1) === C).map((e, o) => le(n, {
|
|
501
|
+
sheet: !0,
|
|
502
|
+
disabled: r,
|
|
503
|
+
onClick: () => f({
|
|
504
|
+
color: e.color,
|
|
505
|
+
gradient: e.gradient,
|
|
506
|
+
borderColor: e.borderColor
|
|
507
|
+
}),
|
|
508
|
+
children: le(v, { rows: l(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: C,
|
|
514
|
+
disabled: r,
|
|
515
|
+
onChange: (e, o) => {
|
|
516
|
+
null !== o && f({ gradient: !!o || void 0 });
|
|
517
|
+
},
|
|
518
|
+
sx: { flex: "0 0 auto" },
|
|
519
|
+
children: [le(he, {
|
|
520
|
+
value: !1,
|
|
521
|
+
sx: {
|
|
522
|
+
textTransform: "none",
|
|
523
|
+
pt: .25,
|
|
524
|
+
pb: .25
|
|
525
|
+
},
|
|
526
|
+
children: s("conditionalFormat.solidFill")
|
|
527
|
+
}), le(he, {
|
|
528
|
+
value: !0,
|
|
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(ne, {
|
|
540
|
+
size: "small",
|
|
541
|
+
checked: !1 === o.showValue,
|
|
542
|
+
disabled: r,
|
|
543
|
+
onChange: (e) => f({ showValue: !e.target.checked && void 0 })
|
|
544
|
+
}),
|
|
545
|
+
label: le(xe, {
|
|
546
|
+
variant: "body2",
|
|
547
|
+
children: s("conditionalFormat.showBarsOnly")
|
|
548
|
+
})
|
|
549
|
+
}),
|
|
550
|
+
te(ae, {
|
|
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(t, {
|
|
566
|
+
icon: "fill.colored",
|
|
567
|
+
tooltip: s("conditionalFormat.barColor"),
|
|
568
|
+
selectedColor: g,
|
|
569
|
+
disabled: r,
|
|
570
|
+
onSelectColor: (e) => f({ color: e ? e.toString() : void 0 }),
|
|
571
|
+
darkMode: c,
|
|
572
|
+
propsPanel: {
|
|
573
|
+
disableAlpha: !0,
|
|
574
|
+
...u
|
|
575
|
+
}
|
|
576
|
+
}),
|
|
577
|
+
le(t, {
|
|
578
|
+
icon: "stroke.colored",
|
|
579
|
+
tooltip: s("conditionalFormat.barBorderColor"),
|
|
580
|
+
selectedColor: y,
|
|
581
|
+
disabled: r,
|
|
582
|
+
onSelectColor: (e) => f({ borderColor: e ? e.toString() : void 0 }),
|
|
583
|
+
darkMode: c,
|
|
584
|
+
propsPanel: {
|
|
585
|
+
disableAlpha: !0,
|
|
586
|
+
...u
|
|
587
|
+
}
|
|
588
|
+
})
|
|
589
|
+
]
|
|
590
|
+
}),
|
|
591
|
+
te(ae, {
|
|
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(t, {
|
|
607
|
+
icon: "fill.colored",
|
|
608
|
+
tooltip: s("conditionalFormat.negativeColor"),
|
|
609
|
+
selectedColor: h ?? g,
|
|
610
|
+
disabled: r,
|
|
611
|
+
onSelectColor: (e) => f({ negativeFillColor: e ? e.toString() : void 0 }),
|
|
612
|
+
darkMode: c,
|
|
613
|
+
propsPanel: {
|
|
614
|
+
disableAlpha: !0,
|
|
615
|
+
...u
|
|
616
|
+
}
|
|
617
|
+
}),
|
|
618
|
+
le(t, {
|
|
619
|
+
icon: "stroke.colored",
|
|
620
|
+
tooltip: s("conditionalFormat.negativeBorderColor"),
|
|
621
|
+
selectedColor: x ?? y,
|
|
622
|
+
disabled: r,
|
|
623
|
+
onSelectColor: (e) => f({ negativeBorderColor: e ? e.toString() : void 0 }),
|
|
624
|
+
darkMode: c,
|
|
625
|
+
propsPanel: {
|
|
626
|
+
disableAlpha: !0,
|
|
627
|
+
...u
|
|
628
|
+
}
|
|
629
|
+
}),
|
|
630
|
+
le(n, {
|
|
631
|
+
title: s("conditionalFormat.sameAsPositive"),
|
|
632
|
+
disabled: r || !o.negativeFillColor && !o.negativeBorderColor,
|
|
633
|
+
onClick: () => f({
|
|
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(ae, {
|
|
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: b,
|
|
665
|
+
onChange: (e) => {
|
|
666
|
+
const o = e.target.value;
|
|
667
|
+
f({ 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: b,
|
|
695
|
+
onChange: (e) => {
|
|
696
|
+
const o = e.target.value;
|
|
697
|
+
f({ 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(fe, {
|
|
717
|
+
variant: "config",
|
|
718
|
+
children: [le(Pe, {
|
|
719
|
+
label: s("conditionalFormat.stop.minimum"),
|
|
720
|
+
stop: m[0] ?? { type: I.ColorStopType.AutoMin },
|
|
721
|
+
allowedTypes: Me,
|
|
722
|
+
readOnly: r,
|
|
723
|
+
onStopChange: (e) => {
|
|
724
|
+
const o = m.slice();
|
|
725
|
+
o[0] = e, f({ stops: o });
|
|
726
|
+
}
|
|
727
|
+
}), le(Pe, {
|
|
728
|
+
label: s("conditionalFormat.stop.maximum"),
|
|
729
|
+
stop: m[1] ?? { type: I.ColorStopType.AutoMax },
|
|
730
|
+
allowedTypes: Be,
|
|
731
|
+
readOnly: r,
|
|
732
|
+
onStopChange: (e) => {
|
|
733
|
+
const o = m.slice();
|
|
734
|
+
for (; o.length < 2;) o.push({ type: I.ColorStopType.AutoMax });
|
|
735
|
+
o[1] = e, f({ stops: o });
|
|
736
|
+
}
|
|
737
|
+
})]
|
|
738
|
+
})]
|
|
739
|
+
});
|
|
740
|
+
});
|
|
741
|
+
ze.displayName = "DataBarRulePanel";
|
|
742
|
+
var Ae = Ce("conditionalFormat.noCellIcon"), Re = Ce("conditionalFormat.cellIcon"), De = {
|
|
743
|
+
borderColor: "primary.main",
|
|
744
|
+
boxShadow: (e) => `inset 0 0 0 1px ${e.palette.primary.main}`
|
|
745
|
+
}, je = {
|
|
746
|
+
width: "28px",
|
|
747
|
+
height: "26px"
|
|
748
|
+
}, We = q((e) => {
|
|
749
|
+
const { icon: o, onPick: l } = e, t = H();
|
|
750
|
+
return te(ae, {
|
|
751
|
+
sx: {
|
|
752
|
+
display: "flex",
|
|
753
|
+
flexDirection: "column",
|
|
754
|
+
gap: "4px",
|
|
755
|
+
padding: "6px 8px"
|
|
756
|
+
},
|
|
757
|
+
children: [le(n, {
|
|
758
|
+
sheet: !0,
|
|
759
|
+
title: t(Ae),
|
|
760
|
+
"aria-pressed": null === o,
|
|
761
|
+
sx: {
|
|
762
|
+
...je,
|
|
763
|
+
...null === o ? De : null
|
|
764
|
+
},
|
|
765
|
+
onClick: () => {
|
|
766
|
+
l({ ...R });
|
|
767
|
+
},
|
|
768
|
+
children: le(A, {
|
|
769
|
+
icons: [null],
|
|
770
|
+
size: 16
|
|
771
|
+
})
|
|
772
|
+
}), le(ae, {
|
|
773
|
+
sx: {
|
|
774
|
+
display: "grid",
|
|
775
|
+
gridTemplateColumns: "repeat(8, auto)",
|
|
776
|
+
justifyContent: "start",
|
|
777
|
+
gap: "3px"
|
|
778
|
+
},
|
|
779
|
+
children: z.map((e) => {
|
|
780
|
+
const a = (r = o, i = e.spec, !!r && r.iconKey === i.iconKey && r.color === i.color);
|
|
781
|
+
var r, i;
|
|
782
|
+
return le(n, {
|
|
783
|
+
sheet: !0,
|
|
784
|
+
title: u(t, e.spec),
|
|
785
|
+
"aria-pressed": a,
|
|
786
|
+
sx: {
|
|
787
|
+
...je,
|
|
788
|
+
...a ? De : null
|
|
789
|
+
},
|
|
790
|
+
onClick: () => {
|
|
791
|
+
l({
|
|
792
|
+
set: e.set,
|
|
793
|
+
id: e.id
|
|
794
|
+
});
|
|
795
|
+
},
|
|
796
|
+
children: le(A, {
|
|
797
|
+
icons: [e.spec],
|
|
798
|
+
size: 16
|
|
799
|
+
})
|
|
800
|
+
}, `${e.set}:${e.id}`);
|
|
801
|
+
})
|
|
802
|
+
})]
|
|
803
|
+
});
|
|
804
|
+
});
|
|
805
|
+
We.displayName = "IconCatalogPanel";
|
|
806
|
+
var $e = q(Y((e, o) => {
|
|
807
|
+
const { icon: l, onPick: t, tooltip: a, ...n } = e, r = H(), i = J((e) => {
|
|
808
|
+
const { closeFloat: o } = e, a = le(We, {
|
|
809
|
+
icon: l,
|
|
810
|
+
onPick: (e) => {
|
|
811
|
+
o?.(), t(e);
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
return ee({
|
|
815
|
+
...e,
|
|
816
|
+
children: a
|
|
817
|
+
});
|
|
818
|
+
}, [l, t]);
|
|
819
|
+
return le(Z, {
|
|
820
|
+
ref: o,
|
|
821
|
+
createPopupPanel: i,
|
|
822
|
+
tooltip: a ?? r(Re),
|
|
823
|
+
icon: le(A, {
|
|
824
|
+
icons: [l],
|
|
825
|
+
size: 16
|
|
826
|
+
}),
|
|
827
|
+
outlined: !0,
|
|
828
|
+
...n
|
|
829
|
+
});
|
|
830
|
+
}));
|
|
831
|
+
$e.displayName = "IconPickerPopupButton";
|
|
832
|
+
var Ke = [
|
|
833
|
+
I.ColorStopType.Percent,
|
|
834
|
+
I.ColorStopType.Num,
|
|
835
|
+
I.ColorStopType.Percentile,
|
|
836
|
+
I.ColorStopType.Formula
|
|
837
|
+
], Ee = q((e) => {
|
|
838
|
+
const { scale: o, onScaleChange: l, readOnly: t, ...a } = e, n = H(), r = o.iconSet ?? w.IconSet.TrafficLights3, i = 0 === E(r).length, d = o.stops ?? [], s = d.length, c = L(o), p = (e) => {
|
|
839
|
+
const t = { ...o };
|
|
840
|
+
for (const [o, l] of Object.entries(e)) void 0 === l ? delete t[o] : t[o] = l;
|
|
841
|
+
l(t);
|
|
842
|
+
}, u = J((e) => {
|
|
843
|
+
const { closeFloat: o } = e, l = le(m, {
|
|
844
|
+
groups: h,
|
|
845
|
+
disabled: t,
|
|
846
|
+
onPick: (e) => {
|
|
847
|
+
o?.(), e.type === I.ScaleType.IconSet && e.iconSet && ((e) => {
|
|
848
|
+
if (e === r) return;
|
|
849
|
+
const o = U(e);
|
|
850
|
+
let l = d;
|
|
851
|
+
o !== d.length && (l = K(o)), p({
|
|
852
|
+
iconSet: e,
|
|
853
|
+
stops: l,
|
|
854
|
+
icon: void 0
|
|
855
|
+
});
|
|
856
|
+
})(e.iconSet);
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
return ee({
|
|
860
|
+
...e,
|
|
861
|
+
children: l
|
|
862
|
+
});
|
|
863
|
+
}, [t, o]), g = k.camelToPrettyCase(r);
|
|
864
|
+
return te(ae, {
|
|
865
|
+
sx: {
|
|
866
|
+
display: "flex",
|
|
867
|
+
flexDirection: "column",
|
|
868
|
+
gap: 1
|
|
869
|
+
},
|
|
870
|
+
...a,
|
|
871
|
+
children: [te(fe, { children: [
|
|
872
|
+
le(ae, {
|
|
873
|
+
sx: {
|
|
874
|
+
display: "flex",
|
|
875
|
+
alignItems: "center",
|
|
876
|
+
gap: 1
|
|
877
|
+
},
|
|
878
|
+
children: le(Z, {
|
|
879
|
+
outlined: !0,
|
|
880
|
+
disabled: t,
|
|
881
|
+
label: g,
|
|
882
|
+
tooltip: g,
|
|
883
|
+
icon: le(ae, {
|
|
884
|
+
sx: {
|
|
885
|
+
width: "82px",
|
|
886
|
+
display: "flex",
|
|
887
|
+
justifyContent: "center"
|
|
888
|
+
},
|
|
889
|
+
children: i ? le(xe, {
|
|
890
|
+
variant: "caption",
|
|
891
|
+
noWrap: !0,
|
|
892
|
+
children: g
|
|
893
|
+
}) : le(A, {
|
|
894
|
+
icons: E(r),
|
|
895
|
+
order: "descending",
|
|
896
|
+
size: 14,
|
|
897
|
+
gap: 3
|
|
898
|
+
})
|
|
899
|
+
}),
|
|
900
|
+
createPopupPanel: u
|
|
901
|
+
})
|
|
902
|
+
}),
|
|
903
|
+
i && le(xe, {
|
|
904
|
+
variant: "caption",
|
|
905
|
+
sx: { color: "text.secondary" },
|
|
906
|
+
children: n("conditionalFormat.adoptedIconSet")
|
|
907
|
+
}),
|
|
908
|
+
te(ae, {
|
|
909
|
+
sx: {
|
|
910
|
+
display: "flex",
|
|
911
|
+
gap: 1
|
|
912
|
+
},
|
|
913
|
+
children: [le(ie, {
|
|
914
|
+
control: le(ne, {
|
|
915
|
+
size: "small",
|
|
916
|
+
checked: !1 === o.showValue,
|
|
917
|
+
disabled: t,
|
|
918
|
+
onChange: (e) => p({ showValue: !e.target.checked && void 0 })
|
|
919
|
+
}),
|
|
920
|
+
label: le(xe, {
|
|
921
|
+
variant: "body2",
|
|
922
|
+
children: n("conditionalFormat.showIconsOnly")
|
|
923
|
+
})
|
|
924
|
+
}), le(ie, {
|
|
925
|
+
control: le(ne, {
|
|
926
|
+
size: "small",
|
|
927
|
+
checked: o.reverse ?? !1,
|
|
928
|
+
disabled: t,
|
|
929
|
+
onChange: (e) => p({ reverse: !!e.target.checked || void 0 })
|
|
930
|
+
}),
|
|
931
|
+
label: le(xe, {
|
|
932
|
+
variant: "body2",
|
|
933
|
+
children: n("conditionalFormat.reverseIcons")
|
|
934
|
+
})
|
|
935
|
+
})]
|
|
936
|
+
})
|
|
937
|
+
] }), le(fe, {
|
|
938
|
+
variant: "config",
|
|
939
|
+
children: d.map((e, a) => {
|
|
940
|
+
const n = o.reverse ? s - 1 - a : a;
|
|
941
|
+
return le(Pe, {
|
|
942
|
+
stop: e,
|
|
943
|
+
allowedTypes: Ke,
|
|
944
|
+
showExclusive: !0,
|
|
945
|
+
readOnly: t || 0 === a,
|
|
946
|
+
leading: le($e, {
|
|
947
|
+
icon: c[a] ?? null,
|
|
948
|
+
disabled: t || i,
|
|
949
|
+
onPick: (e) => l(G(o, n, e))
|
|
950
|
+
}),
|
|
951
|
+
onStopChange: (e) => {
|
|
952
|
+
const o = d.slice();
|
|
953
|
+
o[a] = e, p({ stops: o });
|
|
954
|
+
}
|
|
955
|
+
}, a);
|
|
956
|
+
})
|
|
957
|
+
})]
|
|
958
|
+
});
|
|
959
|
+
});
|
|
960
|
+
Ee.displayName = "IconSetRulePanel";
|
|
961
|
+
var Ue = (e, o, l) => f(e, o)?.toCSS("adaptive") ?? l, Le = (e, o, l) => {
|
|
962
|
+
if (!e) return l;
|
|
963
|
+
if ("string" == typeof e) return Ue(e, o, l);
|
|
964
|
+
if (e.type === N.Type.None) return l;
|
|
965
|
+
const t = e, a = e;
|
|
966
|
+
return Ue(a.foreground ?? t.color ?? a.background, o, l);
|
|
967
|
+
}, _e = q((e) => {
|
|
968
|
+
const { conditionalFormat: o, size: t = 28, ...a } = e, { workbook: c, themeKey: p } = i();
|
|
969
|
+
_(o, "onAnyChange");
|
|
970
|
+
const u = o.getScale(), m = o.getStyle(), g = Q(() => {
|
|
971
|
+
try {
|
|
972
|
+
return c?.getStyles().getNormal().getFont().toCSS("adaptive") ?? {};
|
|
973
|
+
} catch {
|
|
974
|
+
return {};
|
|
975
|
+
}
|
|
976
|
+
}, [c, p]), h = Q(() => {
|
|
977
|
+
if (u?.type === I.ScaleType.ColorScale) return le(v, { rows: r(u.stops ?? [], C, c) });
|
|
978
|
+
if (u?.type === I.ScaleType.DataBar) return le(v, { rows: l(u, Ue(u.color, c, d), u.borderColor ? Ue(u.borderColor, c, d) : void 0) });
|
|
979
|
+
if (u?.type === I.ScaleType.IconSet) return le(ae, {
|
|
980
|
+
sx: {
|
|
981
|
+
display: "flex",
|
|
982
|
+
alignItems: "center",
|
|
983
|
+
justifyContent: "center",
|
|
984
|
+
width: "100%",
|
|
985
|
+
height: "100%",
|
|
986
|
+
px: .5
|
|
987
|
+
},
|
|
988
|
+
children: le(A, {
|
|
989
|
+
icons: L(u),
|
|
990
|
+
order: "descending",
|
|
991
|
+
size: 14,
|
|
992
|
+
gap: 3
|
|
993
|
+
})
|
|
994
|
+
});
|
|
995
|
+
const e = m?.font, o = e?.underline && e.underline !== M.UnderlineStyle.None;
|
|
996
|
+
return le(ae, {
|
|
997
|
+
sx: {
|
|
998
|
+
width: "100%",
|
|
999
|
+
height: "100%",
|
|
1000
|
+
display: "flex",
|
|
1001
|
+
alignItems: "center",
|
|
1002
|
+
justifyContent: "center",
|
|
1003
|
+
...g,
|
|
1004
|
+
backgroundColor: Le(m?.fill, c, "transparent"),
|
|
1005
|
+
...e?.color && "auto" !== e.color ? { color: Ue(e.color, c, s) } : null,
|
|
1006
|
+
...e?.weight ? { fontWeight: e.weight } : null,
|
|
1007
|
+
...e?.style ? { fontStyle: e.style } : null,
|
|
1008
|
+
textDecoration: [o ? "underline" : "", e?.strike ? "line-through" : ""].join(" ").trim() || "none",
|
|
1009
|
+
fontSize: `${Math.round(.5 * t)}px`,
|
|
1010
|
+
lineHeight: 1,
|
|
1011
|
+
outline: m?.borders ? `1px solid ${Ue(Object.values(m.borders)[0]?.color, c, b)}` : void 0,
|
|
1012
|
+
outlineOffset: "-3px"
|
|
1013
|
+
},
|
|
1014
|
+
children: "Aa"
|
|
1015
|
+
});
|
|
1016
|
+
}, [
|
|
1017
|
+
u,
|
|
1018
|
+
m,
|
|
1019
|
+
t,
|
|
1020
|
+
g,
|
|
1021
|
+
c,
|
|
1022
|
+
p
|
|
1023
|
+
]);
|
|
1024
|
+
return le(n, {
|
|
1025
|
+
sheet: !0,
|
|
1026
|
+
className: "sxl-cf-rule-preview",
|
|
1027
|
+
sx: {
|
|
1028
|
+
width: "auto",
|
|
1029
|
+
minWidth: 1.7 * t + "px",
|
|
1030
|
+
height: `${t}px`
|
|
1031
|
+
},
|
|
1032
|
+
...a,
|
|
1033
|
+
children: h
|
|
1034
|
+
});
|
|
1035
|
+
});
|
|
1036
|
+
_e.displayName = "RulePreview";
|
|
1037
|
+
var Ge = (e, o) => {
|
|
1038
|
+
const l = e.getCondition()?.toString();
|
|
1039
|
+
if (l) return l;
|
|
1040
|
+
const t = e.getScale();
|
|
1041
|
+
return t ? k.camelToPrettyCase(t.type) : o("conditionalFormat.noCondition");
|
|
1042
|
+
}, Ve = {
|
|
1043
|
+
classic: Ce("conditionalFormat.tab.classic"),
|
|
1044
|
+
[I.ScaleType.ColorScale]: Ce("conditionalFormat.tab.colorScale"),
|
|
1045
|
+
[I.ScaleType.DataBar]: Ce("conditionalFormat.tab.dataBars"),
|
|
1046
|
+
[I.ScaleType.IconSet]: Ce("conditionalFormat.tab.iconSets")
|
|
1047
|
+
}, He = q((e) => {
|
|
1048
|
+
const { conditionalFormat: o } = e, l = H();
|
|
1049
|
+
_(o, "onAnyChange");
|
|
1050
|
+
const t = o.getScale(), a = o.getCondition(), n = o.getStyle(), r = o.isProtected(), i = t?.type ?? "classic", d = X({ scales: {} }), s = (e) => {
|
|
1051
|
+
o.update({ scale: e });
|
|
1052
|
+
}, u = te(ce, {
|
|
1053
|
+
tabIndex: 0,
|
|
1054
|
+
className: p["editor-panel"],
|
|
1055
|
+
sx: {
|
|
1056
|
+
gap: (e) => e.spacing(1),
|
|
1057
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
1058
|
+
paddingBottom: (e) => e.spacing(2),
|
|
1059
|
+
paddingLeft: (e) => e.spacing(1.5),
|
|
1060
|
+
paddingRight: (e) => e.spacing(1.5),
|
|
1061
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
1062
|
+
borderRadius: (e) => e.spacing(1.25),
|
|
1063
|
+
overflow: "auto"
|
|
1064
|
+
},
|
|
1065
|
+
children: [
|
|
1066
|
+
te(ae, {
|
|
1067
|
+
sx: {
|
|
1068
|
+
display: "flex",
|
|
1069
|
+
flexDirection: "column",
|
|
1070
|
+
gap: (e) => e.spacing(1.75),
|
|
1071
|
+
margin: (e) => e.spacing(1.25),
|
|
1072
|
+
marginBottom: 0
|
|
1073
|
+
},
|
|
1074
|
+
children: [te(ae, {
|
|
1075
|
+
sx: {
|
|
1076
|
+
display: "flex",
|
|
1077
|
+
alignItems: "center",
|
|
1078
|
+
gap: (e) => e.spacing(1.5)
|
|
1079
|
+
},
|
|
1080
|
+
children: [le(_e, {
|
|
1081
|
+
conditionalFormat: o,
|
|
1082
|
+
size: 48
|
|
1083
|
+
}), le(xe, {
|
|
1084
|
+
variant: "body2",
|
|
1085
|
+
sx: {
|
|
1086
|
+
minWidth: 0,
|
|
1087
|
+
wordBreak: "break-word"
|
|
1088
|
+
},
|
|
1089
|
+
children: Ge(o, l)
|
|
1090
|
+
})]
|
|
1091
|
+
}), le(F, {
|
|
1092
|
+
item: o,
|
|
1093
|
+
label: l("conditionalFormat.applyTo")
|
|
1094
|
+
})]
|
|
1095
|
+
}),
|
|
1096
|
+
le(me, {
|
|
1097
|
+
value: i,
|
|
1098
|
+
onChange: (e, l) => {
|
|
1099
|
+
r || ((e) => {
|
|
1100
|
+
if (e !== i) if ("classic" === i ? (d.current.condition = a?.toJSON() ?? null, d.current.style = n) : t && (d.current.scales[t.type] = t), "classic" === e) o.update({
|
|
1101
|
+
condition: d.current.condition ?? {
|
|
1102
|
+
operator: P.BuiltInOperatorNames.Between,
|
|
1103
|
+
param: null
|
|
1104
|
+
},
|
|
1105
|
+
style: d.current.style ?? null,
|
|
1106
|
+
scale: null
|
|
1107
|
+
});
|
|
1108
|
+
else {
|
|
1109
|
+
const l = d.current.scales[e] ?? (e === I.ScaleType.ColorScale ? j() : e === I.ScaleType.DataBar ? W() : $());
|
|
1110
|
+
o.update({
|
|
1111
|
+
scale: l,
|
|
1112
|
+
condition: null,
|
|
1113
|
+
style: null
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
})(l);
|
|
1117
|
+
},
|
|
1118
|
+
variant: "fullWidth",
|
|
1119
|
+
sx: {
|
|
1120
|
+
minHeight: "36px",
|
|
1121
|
+
borderBottom: 1,
|
|
1122
|
+
borderColor: "divider",
|
|
1123
|
+
"& .MuiTab-root": {
|
|
1124
|
+
minHeight: "36px",
|
|
1125
|
+
textTransform: "none",
|
|
1126
|
+
pt: .5,
|
|
1127
|
+
pb: .5,
|
|
1128
|
+
px: .5,
|
|
1129
|
+
minWidth: 0
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
children: Object.keys(Ve).map((e) => le(ue, {
|
|
1133
|
+
value: e,
|
|
1134
|
+
label: l(Ve[e])
|
|
1135
|
+
}, e))
|
|
1136
|
+
}),
|
|
1137
|
+
"classic" === i && te(oe, { children: [le(Te, {
|
|
1138
|
+
format: n,
|
|
1139
|
+
readOnly: r,
|
|
1140
|
+
onFormatChange: (e) => o.update({ style: e })
|
|
1141
|
+
}), le(y, {
|
|
1142
|
+
sx: {
|
|
1143
|
+
...x,
|
|
1144
|
+
p: 2,
|
|
1145
|
+
pb: 1
|
|
1146
|
+
},
|
|
1147
|
+
selectorTitle: l("conditionalFormat.highlight"),
|
|
1148
|
+
condition: a,
|
|
1149
|
+
ranges: o.getRanges(),
|
|
1150
|
+
readOnly: r,
|
|
1151
|
+
onConditionChange: (e) => o.setCondition(e)
|
|
1152
|
+
})] }),
|
|
1153
|
+
t?.type === I.ScaleType.ColorScale && le(Ne, {
|
|
1154
|
+
scale: t,
|
|
1155
|
+
onScaleChange: s,
|
|
1156
|
+
readOnly: r
|
|
1157
|
+
}),
|
|
1158
|
+
t?.type === I.ScaleType.DataBar && le(ze, {
|
|
1159
|
+
scale: t,
|
|
1160
|
+
onScaleChange: s,
|
|
1161
|
+
readOnly: r
|
|
1162
|
+
}),
|
|
1163
|
+
t?.type === I.ScaleType.IconSet && le(Ee, {
|
|
1164
|
+
scale: t,
|
|
1165
|
+
onScaleChange: s,
|
|
1166
|
+
readOnly: r
|
|
1167
|
+
}),
|
|
1168
|
+
"classic" === i && le(ae, {
|
|
1169
|
+
sx: {
|
|
1170
|
+
pl: 2,
|
|
1171
|
+
pr: 2,
|
|
1172
|
+
border: 1,
|
|
1173
|
+
borderColor: "divider",
|
|
1174
|
+
borderRadius: 1
|
|
1175
|
+
},
|
|
1176
|
+
children: le(ie, {
|
|
1177
|
+
control: le(ne, {
|
|
1178
|
+
checked: o.isStopIfTrue(),
|
|
1179
|
+
disabled: r,
|
|
1180
|
+
onChange: (e) => o.setStopIfTrue(e.target.checked)
|
|
1181
|
+
}),
|
|
1182
|
+
label: l("conditionalFormat.stopIfTrue")
|
|
1183
|
+
})
|
|
1184
|
+
})
|
|
1185
|
+
]
|
|
1186
|
+
});
|
|
1187
|
+
return le(c.Provider, {
|
|
1188
|
+
value: o,
|
|
1189
|
+
children: u
|
|
1190
|
+
});
|
|
1191
|
+
});
|
|
1192
|
+
He.displayName = "ConditionalFormatEditorPanel";
|
|
1193
|
+
var Ye = q(({ item: e }) => {
|
|
1194
|
+
const o = H();
|
|
1195
|
+
return _(e, "onAnyChange"), !e.isStopIfTrue() || e.getScale() ? null : le(ae, {
|
|
1196
|
+
sx: {
|
|
1197
|
+
display: "inline-flex",
|
|
1198
|
+
alignItems: "center",
|
|
1199
|
+
alignSelf: "flex-start",
|
|
1200
|
+
px: .75,
|
|
1201
|
+
py: .25,
|
|
1202
|
+
border: 1,
|
|
1203
|
+
borderColor: "divider",
|
|
1204
|
+
borderRadius: 1,
|
|
1205
|
+
color: "text.secondary"
|
|
1206
|
+
},
|
|
1207
|
+
children: le(xe, {
|
|
1208
|
+
variant: "caption",
|
|
1209
|
+
children: o("conditionalFormat.stopIfTrue")
|
|
1210
|
+
})
|
|
1211
|
+
});
|
|
1212
|
+
});
|
|
1213
|
+
Ye.displayName = "StopIfTrueBadge";
|
|
1214
|
+
var qe = q(({ item: e }) => {
|
|
1215
|
+
const o = H();
|
|
1216
|
+
return le(F, {
|
|
1217
|
+
item: e,
|
|
1218
|
+
label: o("conditionalFormat.applyTo"),
|
|
1219
|
+
helperText: null
|
|
1220
|
+
});
|
|
1221
|
+
});
|
|
1222
|
+
qe.displayName = "ConditionalFormatCardRanges";
|
|
1223
|
+
var Je = {
|
|
1224
|
+
key: "conditional-format",
|
|
1225
|
+
messageKeys: {
|
|
1226
|
+
none: Ce("conditionalFormat.none"),
|
|
1227
|
+
addPrompt: Ce("conditionalFormat.addPrompt"),
|
|
1228
|
+
heading: Ce("conditionalFormat.heading"),
|
|
1229
|
+
insert: Ce("conditionalFormat.insert"),
|
|
1230
|
+
new: Ce("conditionalFormat.new"),
|
|
1231
|
+
moveUp: Ce("conditionalFormat.moveUp"),
|
|
1232
|
+
moveDown: Ce("conditionalFormat.moveDown"),
|
|
1233
|
+
edit: Ce("conditionalFormat.edit"),
|
|
1234
|
+
duplicate: Ce("conditionalFormat.duplicate"),
|
|
1235
|
+
delete: Ce("conditionalFormat.delete"),
|
|
1236
|
+
cancel: Ce("conditionalFormat.cancel"),
|
|
1237
|
+
save: Ce("conditionalFormat.save")
|
|
1238
|
+
},
|
|
1239
|
+
getCollection: (e) => e.getConditionalFormats(),
|
|
1240
|
+
changeEvents: ["onConditionalFormatsChange"],
|
|
1241
|
+
isReadOnly: (e) => !e.getProtection().isFormatCellsAllowed(),
|
|
1242
|
+
applyUpdate: (e, o) => {
|
|
1243
|
+
e.update(o);
|
|
1244
|
+
},
|
|
1245
|
+
validate: (e) => e.getCondition()?.validate() ?? null,
|
|
1246
|
+
applySeed: (e, o) => {
|
|
1247
|
+
e.update({
|
|
1248
|
+
condition: o.condition ?? null,
|
|
1249
|
+
style: o.style ?? null,
|
|
1250
|
+
scale: o.scale ?? null,
|
|
1251
|
+
stopIfTrue: o.stopIfTrue ?? !1
|
|
1252
|
+
});
|
|
1253
|
+
},
|
|
1254
|
+
getCardTitle: Ge,
|
|
1255
|
+
CardMedia: ({ item: e }) => le(_e, {
|
|
1256
|
+
conditionalFormat: e,
|
|
1257
|
+
size: 32
|
|
1258
|
+
}),
|
|
1259
|
+
CardSubtitle: qe,
|
|
1260
|
+
CardBody: Ye,
|
|
1261
|
+
EditorBody: ({ item: e }) => le(He, { conditionalFormat: e })
|
|
1262
|
+
}, Qe = q(Y((e, o) => {
|
|
1263
|
+
const { workbook: l, args: t, ...a } = e;
|
|
1264
|
+
return le(S, {
|
|
1265
|
+
ref: o,
|
|
1266
|
+
workbook: l,
|
|
1267
|
+
descriptor: Je,
|
|
1268
|
+
args: t,
|
|
1269
|
+
dragReorder: !0,
|
|
1270
|
+
...a
|
|
1271
|
+
});
|
|
1272
|
+
}));
|
|
1273
|
+
Qe.displayName = "ConditionalFormatDetailsPanel";
|
|
1274
|
+
var Xe = (e) => {
|
|
1275
|
+
const { model: o, entryKey: l, frame: t, args: a, ref: n, ...r } = e;
|
|
1276
|
+
return le(Qe, {
|
|
1277
|
+
ref: n,
|
|
1278
|
+
workbook: o,
|
|
1279
|
+
args: a,
|
|
1280
|
+
...r
|
|
1281
|
+
});
|
|
1282
|
+
};
|
|
1283
|
+
export { Xe as ConditionalFormatDetailsTaskPane };
|