@sheetxl/studio-mui 0.7.21 → 0.7.23-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/browser/cjs/BQJKf40kttQWOzLw.cjs +20 -0
- package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +1 -0
- package/browser/cjs/B_D3JKseVvpRyX-E.cjs +1 -0
- package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +2 -0
- package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +2 -0
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
- package/browser/cjs/ByIEqNsvj52sihT9.cjs +5 -0
- package/browser/cjs/C3moehR3VOd0LnmM.cjs +1 -0
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +1 -0
- package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +1 -0
- package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +1 -0
- package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +1 -0
- package/browser/cjs/CZm1jVZaHQ246prW.cjs +1 -0
- package/browser/cjs/CdDYyAfccXme8w6m.cjs +1 -0
- package/browser/cjs/Cpr3LpTBt3SSArSw.cjs +7 -0
- package/browser/cjs/DBJLJGiCGXesx5n6.cjs +1 -0
- package/browser/cjs/DEaHGn2Rbgcj_fbR.cjs +11 -0
- package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +1 -0
- package/browser/cjs/IASAYG6qgv7lJY7y.cjs +1 -0
- package/browser/cjs/KZvriGbhEOVkQD0b.cjs +1 -0
- package/browser/cjs/UnMhi28mbvLiOXQe.cjs +1 -0
- package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +1 -0
- package/browser/cjs/iMWEL01eC83oU-YY.cjs +1 -0
- package/browser/cjs/index.cjs +2 -7
- package/browser/cjs/w2GjebPlOFv3pCbm.cjs +1 -0
- package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +1 -0
- package/browser/esm/B-2XwThOta_tt8BT.mjs +612 -0
- package/browser/esm/B8qmg9lVcO1_FX1t.mjs +508 -0
- package/browser/esm/BBwrhUtlLbuFQ67J.mjs +5398 -0
- package/browser/esm/BkcTkK4tR4b-px3e.mjs +42 -0
- package/browser/esm/BvQKaacvx0Q4evfJ.mjs +99 -0
- package/browser/esm/C9GBv4ZkH2P6xOGI.mjs +2207 -0
- package/browser/esm/C9MY76RbJdvrNOgK.mjs +411 -0
- package/browser/esm/CCiAWSm5lQALhezl.mjs +82 -0
- package/browser/esm/CGcdue-1rj_uOLLO.mjs +47 -0
- package/browser/esm/CPR9Jpd8zfoZUwWE.mjs +113 -0
- package/browser/esm/CkocGozEYIwcmc-x.mjs +105 -0
- package/browser/esm/D3E3Pf2O3BHV0mYQ.mjs +52 -0
- package/browser/esm/DNv3-zAolc7Scol_.mjs +129 -0
- package/browser/esm/DRCKGFtIKBxmTaJW.mjs +191 -0
- package/browser/esm/Ddp-16AGwwlZkglN.mjs +219 -0
- package/browser/esm/Ft9o24lP0MNgSqIB.mjs +1376 -0
- package/browser/esm/IIP2sN_X3kztI92r.mjs +155 -0
- package/browser/esm/WSDlFfjApTM0cJ4V.mjs +468 -0
- package/browser/esm/dfnya7tN7P1UeVvc.mjs +516 -0
- package/browser/esm/dhuC1s94dyRTzxgk.mjs +8869 -0
- package/browser/esm/eL50tJKtsxKJk7-6.mjs +217 -0
- package/browser/esm/index.mjs +152 -91
- package/browser/esm/suPpQTgd0X3baAFS.mjs +20 -0
- package/browser/esm/zRDngVAuXekzPZuz.mjs +1150 -0
- package/licenses/dependencies.txt +133 -623
- package/node/esm/0FcokH6jWYoKKyvJ.mjs +155 -0
- package/node/esm/BUqFn97L8YiLtWbW.mjs +129 -0
- package/node/esm/CH7ZFM-RHFeeCuff.mjs +82 -0
- package/node/esm/CghsKfVdQBikiGJk.mjs +679 -0
- package/node/esm/Cv3xawSybVla_gE-.mjs +47 -0
- package/node/esm/CwSCTBxawz0-VqW9.mjs +99 -0
- package/node/esm/D70ZQyxt_JcDRn7d.mjs +516 -0
- package/node/esm/DJnr-2wytqQ57aiM.mjs +4543 -0
- package/node/esm/DMDanrARYHWYLx37.mjs +190 -0
- package/node/esm/DMtIfyV60BcLQkTD.mjs +470 -0
- package/node/esm/DNJmWZomszXCkDx7.mjs +106 -0
- package/node/esm/DNkUDrpOmhF_vVDS.mjs +509 -0
- package/node/esm/DZG5Pd01dM-dgS3n.mjs +113 -0
- package/node/esm/index.mjs +10594 -2831
- package/package.json +27 -27
- package/resources/contents.json +30 -0
- package/resources/locales/contents.json +44 -0
- package/resources/locales/de/groups.cmd.json +219 -0
- package/resources/locales/de/studio.cmd.json +159 -0
- package/resources/locales/de/ui.msg.json +507 -0
- package/resources/locales/en/groups.cmd.json +219 -0
- package/resources/locales/en/studio.cmd.json +159 -0
- package/resources/locales/en/ui.msg.json +508 -0
- package/types/index.d.ts +2 -1762
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +131 -0
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts.map +1 -0
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +29 -0
- package/types/src/anchorItems/AnchorItemsPanel.d.ts.map +1 -0
- package/types/src/anchorItems/index.d.ts +3 -0
- package/types/src/anchorItems/index.d.ts.map +1 -0
- package/types/src/border/BorderPopupButton.d.ts +30 -0
- package/types/src/border/BorderPopupButton.d.ts.map +1 -0
- package/types/src/border/BorderStylePopupButton.d.ts +40 -0
- package/types/src/border/BorderStylePopupButton.d.ts.map +1 -0
- package/types/src/border/index.d.ts +3 -0
- package/types/src/border/index.d.ts.map +1 -0
- package/types/src/chart/command/InsertChartCommandButton.d.ts +10 -0
- package/types/src/chart/command/InsertChartCommandButton.d.ts.map +1 -0
- package/types/src/chart/command/index.d.ts +2 -0
- package/types/src/chart/command/index.d.ts.map +1 -0
- package/types/src/color/Alpha.d.ts +36 -0
- package/types/src/color/Alpha.d.ts.map +1 -0
- package/types/src/color/Checkboard.d.ts +11 -0
- package/types/src/color/Checkboard.d.ts.map +1 -0
- package/types/src/color/CheckboardUtils.d.ts +3 -0
- package/types/src/color/CheckboardUtils.d.ts.map +1 -0
- package/types/src/color/ColorButton.d.ts +21 -0
- package/types/src/color/ColorButton.d.ts.map +1 -0
- package/types/src/color/ColorButtonList.d.ts +17 -0
- package/types/src/color/ColorButtonList.d.ts.map +1 -0
- package/types/src/color/ColorPanel.d.ts +71 -0
- package/types/src/color/ColorPanel.d.ts.map +1 -0
- package/types/src/color/ColorPopupButton.d.ts +29 -0
- package/types/src/color/ColorPopupButton.d.ts.map +1 -0
- package/types/src/color/CustomColorPanel.d.ts +16 -0
- package/types/src/color/CustomColorPanel.d.ts.map +1 -0
- package/types/src/color/EditableInput.d.ts +22 -0
- package/types/src/color/EditableInput.d.ts.map +1 -0
- package/types/src/color/Hue.d.ts +29 -0
- package/types/src/color/Hue.d.ts.map +1 -0
- package/types/src/color/Saturation.d.ts +45 -0
- package/types/src/color/Saturation.d.ts.map +1 -0
- package/types/src/color/SketchFields.d.ts +9 -0
- package/types/src/color/SketchFields.d.ts.map +1 -0
- package/types/src/color/Swatch.d.ts +16 -0
- package/types/src/color/Swatch.d.ts.map +1 -0
- package/types/src/color/Types.d.ts +11 -0
- package/types/src/color/Types.d.ts.map +1 -0
- package/types/src/color/_Utils.d.ts +4 -0
- package/types/src/color/_Utils.d.ts.map +1 -0
- package/types/src/color/index.d.ts +7 -0
- package/types/src/color/index.d.ts.map +1 -0
- package/types/src/command/AccountingStyleCommandButton.d.ts +18 -0
- package/types/src/command/AccountingStyleCommandButton.d.ts.map +1 -0
- package/types/src/command/AppearanceCommandButton.d.ts +3 -0
- package/types/src/command/AppearanceCommandButton.d.ts.map +1 -0
- package/types/src/command/BorderCommandButton.d.ts +20 -0
- package/types/src/command/BorderCommandButton.d.ts.map +1 -0
- package/types/src/command/ColorCommandButton.d.ts +23 -0
- package/types/src/command/ColorCommandButton.d.ts.map +1 -0
- package/types/src/command/DocThemeCommandButton.d.ts +19 -0
- package/types/src/command/DocThemeCommandButton.d.ts.map +1 -0
- package/types/src/command/FileCommandButton.d.ts +8 -0
- package/types/src/command/FileCommandButton.d.ts.map +1 -0
- package/types/src/command/FontFamilyCommandButton.d.ts +9 -0
- package/types/src/command/FontFamilyCommandButton.d.ts.map +1 -0
- package/types/src/command/FontSizeCommandButton.d.ts +21 -0
- package/types/src/command/FontSizeCommandButton.d.ts.map +1 -0
- package/types/src/command/InsertFunctionCommandPopupButton.d.ts +9 -0
- package/types/src/command/InsertFunctionCommandPopupButton.d.ts.map +1 -0
- package/types/src/command/InsertFunctionSumCommandPopupButton.d.ts +8 -0
- package/types/src/command/InsertFunctionSumCommandPopupButton.d.ts.map +1 -0
- package/types/src/command/LanguageCommandButton.d.ts +19 -0
- package/types/src/command/LanguageCommandButton.d.ts.map +1 -0
- package/types/src/command/LocaleCommandButton.d.ts +17 -0
- package/types/src/command/LocaleCommandButton.d.ts.map +1 -0
- package/types/src/command/NumberFormatCommandButton.d.ts +6 -0
- package/types/src/command/NumberFormatCommandButton.d.ts.map +1 -0
- package/types/src/command/PasteCommandButton.d.ts +14 -0
- package/types/src/command/PasteCommandButton.d.ts.map +1 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts +11 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts.map +1 -0
- package/types/src/command/PresetTableStylesCommandButton.d.ts +12 -0
- package/types/src/command/PresetTableStylesCommandButton.d.ts.map +1 -0
- package/types/src/command/RegisterCatalog.d.ts +3 -0
- package/types/src/command/RegisterCatalog.d.ts.map +1 -0
- package/types/src/command/SheetCommandGroups.d.ts +10 -0
- package/types/src/command/SheetCommandGroups.d.ts.map +1 -0
- package/types/src/command/SheetZoomCommandButton.d.ts +9 -0
- package/types/src/command/SheetZoomCommandButton.d.ts.map +1 -0
- package/types/src/command/StudioCommandGroups.d.ts +11 -0
- package/types/src/command/StudioCommandGroups.d.ts.map +1 -0
- package/types/src/command/TextEffectsCommandButton.d.ts +6 -0
- package/types/src/command/TextEffectsCommandButton.d.ts.map +1 -0
- package/types/src/command/TextRotateGroupButton.d.ts +14 -0
- package/types/src/command/TextRotateGroupButton.d.ts.map +1 -0
- package/types/src/command/UndoRedoCommandButton.d.ts +14 -0
- package/types/src/command/UndoRedoCommandButton.d.ts.map +1 -0
- package/types/src/command/WalkingCopyCommandButton.d.ts +6 -0
- package/types/src/command/WalkingCopyCommandButton.d.ts.map +1 -0
- package/types/src/command/WorkbookCommandGroups.d.ts +11 -0
- package/types/src/command/WorkbookCommandGroups.d.ts.map +1 -0
- package/types/src/command/index.d.ts +23 -0
- package/types/src/command/index.d.ts.map +1 -0
- package/types/src/conditionalFormat/ColorScaleRulePanel.d.ts +18 -0
- package/types/src/conditionalFormat/ColorScaleRulePanel.d.ts.map +1 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsPanel.d.ts +23 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsPanel.d.ts.map +1 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsTaskPane.d.ts +4 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsTaskPane.d.ts.map +1 -0
- package/types/src/conditionalFormat/ConditionalFormatEditorPanel.d.ts +20 -0
- package/types/src/conditionalFormat/ConditionalFormatEditorPanel.d.ts.map +1 -0
- package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts +2 -0
- package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts.map +1 -0
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +32 -0
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts.map +1 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +34 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts.map +1 -0
- package/types/src/conditionalFormat/ConditionalFormatTitle.d.ts +10 -0
- package/types/src/conditionalFormat/ConditionalFormatTitle.d.ts.map +1 -0
- package/types/src/conditionalFormat/DataBarRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/DataBarRulePanel.d.ts.map +1 -0
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts.map +1 -0
- package/types/src/conditionalFormat/PresetChip.d.ts +17 -0
- package/types/src/conditionalFormat/PresetChip.d.ts.map +1 -0
- package/types/src/conditionalFormat/PresetScalesCommandButton.d.ts +20 -0
- package/types/src/conditionalFormat/PresetScalesCommandButton.d.ts.map +1 -0
- package/types/src/conditionalFormat/RulePreview.d.ts +23 -0
- package/types/src/conditionalFormat/RulePreview.d.ts.map +1 -0
- package/types/src/conditionalFormat/RuleSection.d.ts +20 -0
- package/types/src/conditionalFormat/RuleSection.d.ts.map +1 -0
- package/types/src/conditionalFormat/ScaleMiniGrid.d.ts +59 -0
- package/types/src/conditionalFormat/ScaleMiniGrid.d.ts.map +1 -0
- package/types/src/conditionalFormat/ScaleStopRow.d.ts +34 -0
- package/types/src/conditionalFormat/ScaleStopRow.d.ts.map +1 -0
- package/types/src/conditionalFormat/index.d.ts +3 -0
- package/types/src/conditionalFormat/index.d.ts.map +1 -0
- package/types/src/conditionalFormat/previewColor.d.ts +50 -0
- package/types/src/conditionalFormat/previewColor.d.ts.map +1 -0
- package/types/src/conditions/AverageOption.d.ts +25 -0
- package/types/src/conditions/AverageOption.d.ts.map +1 -0
- package/types/src/conditions/BetweenOption.d.ts +25 -0
- package/types/src/conditions/BetweenOption.d.ts.map +1 -0
- package/types/src/conditions/BooleanOption.d.ts +24 -0
- package/types/src/conditions/BooleanOption.d.ts.map +1 -0
- package/types/src/conditions/CombinatorOption.d.ts +41 -0
- package/types/src/conditions/CombinatorOption.d.ts.map +1 -0
- package/types/src/conditions/ConditionEditor.d.ts +57 -0
- package/types/src/conditions/ConditionEditor.d.ts.map +1 -0
- package/types/src/conditions/ConditionUtils.d.ts +83 -0
- package/types/src/conditions/ConditionUtils.d.ts.map +1 -0
- package/types/src/conditions/DateTimeOption.d.ts +43 -0
- package/types/src/conditions/DateTimeOption.d.ts.map +1 -0
- package/types/src/conditions/ExpressionOption.d.ts +26 -0
- package/types/src/conditions/ExpressionOption.d.ts.map +1 -0
- package/types/src/conditions/InSetOption.d.ts +37 -0
- package/types/src/conditions/InSetOption.d.ts.map +1 -0
- package/types/src/conditions/NumberOption.d.ts +24 -0
- package/types/src/conditions/NumberOption.d.ts.map +1 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +55 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts.map +1 -0
- package/types/src/conditions/OperatorSelect.d.ts +35 -0
- package/types/src/conditions/OperatorSelect.d.ts.map +1 -0
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +39 -0
- package/types/src/conditions/OperatorSelectPopupButton.d.ts.map +1 -0
- package/types/src/conditions/ScalarOption.d.ts +29 -0
- package/types/src/conditions/ScalarOption.d.ts.map +1 -0
- package/types/src/conditions/SelectorSelect.d.ts +43 -0
- package/types/src/conditions/SelectorSelect.d.ts.map +1 -0
- package/types/src/conditions/StringOption.d.ts +24 -0
- package/types/src/conditions/StringOption.d.ts.map +1 -0
- package/types/src/conditions/TimePeriodOption.d.ts +25 -0
- package/types/src/conditions/TimePeriodOption.d.ts.map +1 -0
- package/types/src/conditions/TopNOption.d.ts +25 -0
- package/types/src/conditions/TopNOption.d.ts.map +1 -0
- package/types/src/conditions/index.d.ts +13 -0
- package/types/src/conditions/index.d.ts.map +1 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +16 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts.map +1 -0
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -0
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts.map +1 -0
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +12 -0
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts.map +1 -0
- package/types/src/dataValidation/DataValidationPlugin.d.ts +2 -0
- package/types/src/dataValidation/DataValidationPlugin.d.ts.map +1 -0
- package/types/src/dataValidation/index.d.ts +2 -0
- package/types/src/dataValidation/index.d.ts.map +1 -0
- package/types/src/debug/DebugUtils.d.ts +4 -0
- package/types/src/debug/DebugUtils.d.ts.map +1 -0
- package/types/src/debug/index.d.ts +2 -0
- package/types/src/debug/index.d.ts.map +1 -0
- package/types/src/dialog/CommentsDialog.d.ts +11 -0
- package/types/src/dialog/CommentsDialog.d.ts.map +1 -0
- package/types/src/dialog/FindReplaceWindow.d.ts +13 -0
- package/types/src/dialog/FindReplaceWindow.d.ts.map +1 -0
- package/types/src/dialog/HyperlinkDialog.d.ts +28 -0
- package/types/src/dialog/HyperlinkDialog.d.ts.map +1 -0
- package/types/src/dialog/InsertFunctionDialog.d.ts +25 -0
- package/types/src/dialog/InsertFunctionDialog.d.ts.map +1 -0
- package/types/src/dialog/NamedReferenceDialog.d.ts +17 -0
- package/types/src/dialog/NamedReferenceDialog.d.ts.map +1 -0
- package/types/src/dialog/NumberFormatDialog.d.ts +12 -0
- package/types/src/dialog/NumberFormatDialog.d.ts.map +1 -0
- package/types/src/dialog/ResizeHeaderDialog.d.ts +15 -0
- package/types/src/dialog/ResizeHeaderDialog.d.ts.map +1 -0
- package/types/src/dialog/ShortcutKeysDialog.d.ts +9 -0
- package/types/src/dialog/ShortcutKeysDialog.d.ts.map +1 -0
- package/types/src/dialog/ShortcutKeysPanel.d.ts +28 -0
- package/types/src/dialog/ShortcutKeysPanel.d.ts.map +1 -0
- package/types/src/dialog/SortDialog.d.ts +9 -0
- package/types/src/dialog/SortDialog.d.ts.map +1 -0
- package/types/src/dialog/TableNewDialog.d.ts +14 -0
- package/types/src/dialog/TableNewDialog.d.ts.map +1 -0
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +13 -0
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts.map +1 -0
- package/types/src/dialog/index.d.ts +10 -0
- package/types/src/dialog/index.d.ts.map +1 -0
- package/types/src/filter/ColumnMenu.d.ts +13 -0
- package/types/src/filter/ColumnMenu.d.ts.map +1 -0
- package/types/src/filter/FilterList.d.ts +28 -0
- package/types/src/filter/FilterList.d.ts.map +1 -0
- package/types/src/filter/index.d.ts +3 -0
- package/types/src/filter/index.d.ts.map +1 -0
- package/types/src/form/FormulaField.d.ts +221 -0
- package/types/src/form/FormulaField.d.ts.map +1 -0
- package/types/src/form/InputField.d.ts +89 -0
- package/types/src/form/InputField.d.ts.map +1 -0
- package/types/src/form/index.d.ts +3 -0
- package/types/src/form/index.d.ts.map +1 -0
- package/types/src/formulaBar/FormulaBar.d.ts +8 -0
- package/types/src/formulaBar/FormulaBar.d.ts.map +1 -0
- package/types/src/formulaBar/IFormulaBar.d.ts +51 -0
- package/types/src/formulaBar/IFormulaBar.d.ts.map +1 -0
- package/types/src/formulaBar/index.d.ts +3 -0
- package/types/src/formulaBar/index.d.ts.map +1 -0
- package/types/src/function/FunctionArgumentsPanel.d.ts +57 -0
- package/types/src/function/FunctionArgumentsPanel.d.ts.map +1 -0
- package/types/src/function/FunctionSearchPanel.d.ts +35 -0
- package/types/src/function/FunctionSearchPanel.d.ts.map +1 -0
- package/types/src/function/InsertFunctionWizard.d.ts +79 -0
- package/types/src/function/InsertFunctionWizard.d.ts.map +1 -0
- package/types/src/function/index.d.ts +4 -0
- package/types/src/function/index.d.ts.map +1 -0
- package/types/src/function/paneMetrics.d.ts +33 -0
- package/types/src/function/paneMetrics.d.ts.map +1 -0
- package/types/src/index.d.ts +21 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/itemsPanel/EditorPanel.d.ts +21 -0
- package/types/src/itemsPanel/EditorPanel.d.ts.map +1 -0
- package/types/src/itemsPanel/ItemCard.d.ts +57 -0
- package/types/src/itemsPanel/ItemCard.d.ts.map +1 -0
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +215 -0
- package/types/src/itemsPanel/ItemsDescriptor.d.ts.map +1 -0
- package/types/src/itemsPanel/ItemsPanel.d.ts +45 -0
- package/types/src/itemsPanel/ItemsPanel.d.ts.map +1 -0
- package/types/src/itemsPanel/SortableCards.d.ts +67 -0
- package/types/src/itemsPanel/SortableCards.d.ts.map +1 -0
- package/types/src/itemsPanel/index.d.ts +6 -0
- package/types/src/itemsPanel/index.d.ts.map +1 -0
- package/types/src/movable/MovableContextMenu.d.ts +13 -0
- package/types/src/movable/MovableContextMenu.d.ts.map +1 -0
- package/types/src/movable/index.d.ts +2 -0
- package/types/src/movable/index.d.ts.map +1 -0
- package/types/src/named/INamedCollectionEditor.d.ts +37 -0
- package/types/src/named/INamedCollectionEditor.d.ts.map +1 -0
- package/types/src/named/NamedCollectionEditor.d.ts +7 -0
- package/types/src/named/NamedCollectionEditor.d.ts.map +1 -0
- package/types/src/named/NamedDetailsPanel.d.ts +11 -0
- package/types/src/named/NamedDetailsPanel.d.ts.map +1 -0
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -0
- package/types/src/named/NamedDetailsTaskPane.d.ts.map +1 -0
- package/types/src/named/NamedDraft.d.ts +68 -0
- package/types/src/named/NamedDraft.d.ts.map +1 -0
- package/types/src/named/NamedEditorPanel.d.ts +19 -0
- package/types/src/named/NamedEditorPanel.d.ts.map +1 -0
- package/types/src/named/NamedPlugin.d.ts +2 -0
- package/types/src/named/NamedPlugin.d.ts.map +1 -0
- package/types/src/named/index.d.ts +8 -0
- package/types/src/named/index.d.ts.map +1 -0
- package/types/src/numberFormat/NumberFormatPanel.d.ts +29 -0
- package/types/src/numberFormat/NumberFormatPanel.d.ts.map +1 -0
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +12 -0
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts.map +1 -0
- package/types/src/numberFormat/index.d.ts +8 -0
- package/types/src/numberFormat/index.d.ts.map +1 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +20 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts.map +1 -0
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +3 -0
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts.map +1 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +27 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts.map +1 -0
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +2 -0
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts.map +1 -0
- package/types/src/protectedRange/index.d.ts +2 -0
- package/types/src/protectedRange/index.d.ts.map +1 -0
- package/types/src/protection/WorkbookProtectionDialog.d.ts +23 -0
- package/types/src/protection/WorkbookProtectionDialog.d.ts.map +1 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +51 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts.map +1 -0
- package/types/src/protection/index.d.ts +3 -0
- package/types/src/protection/index.d.ts.map +1 -0
- package/types/src/sheet/SheetTabMenu.d.ts +21 -0
- package/types/src/sheet/SheetTabMenu.d.ts.map +1 -0
- package/types/src/sheet/SheetsAllMenu.d.ts +16 -0
- package/types/src/sheet/SheetsAllMenu.d.ts.map +1 -0
- package/types/src/sheet/index.d.ts +3 -0
- package/types/src/sheet/index.d.ts.map +1 -0
- package/types/src/statusBar/NumberStats.d.ts +27 -0
- package/types/src/statusBar/NumberStats.d.ts.map +1 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +11 -0
- package/types/src/statusBar/SheetZoomScale.d.ts.map +1 -0
- package/types/src/statusBar/StatusBar.d.ts +35 -0
- package/types/src/statusBar/StatusBar.d.ts.map +1 -0
- package/types/src/statusBar/index.d.ts +4 -0
- package/types/src/statusBar/index.d.ts.map +1 -0
- package/types/src/studio/CommandsWrapper.d.ts +36 -0
- package/types/src/studio/CommandsWrapper.d.ts.map +1 -0
- package/types/src/studio/DefaultLogo.d.ts +3 -0
- package/types/src/studio/DefaultLogo.d.ts.map +1 -0
- package/types/src/studio/EagerStudio.d.ts +5 -0
- package/types/src/studio/EagerStudio.d.ts.map +1 -0
- package/types/src/studio/Studio.d.ts +26 -0
- package/types/src/studio/Studio.d.ts.map +1 -0
- package/types/src/studio/StudioCommandProvider.d.ts +26 -0
- package/types/src/studio/StudioCommandProvider.d.ts.map +1 -0
- package/types/src/studio/StudioCommands.d.ts +115 -0
- package/types/src/studio/StudioCommands.d.ts.map +1 -0
- package/types/src/studio/StudioNotifierProvider.d.ts +10 -0
- package/types/src/studio/StudioNotifierProvider.d.ts.map +1 -0
- package/types/src/studio/StudioProps.d.ts +372 -0
- package/types/src/studio/StudioProps.d.ts.map +1 -0
- package/types/src/studio/StudioSplitPane.d.ts +60 -0
- package/types/src/studio/StudioSplitPane.d.ts.map +1 -0
- package/types/src/studio/StudioTaskPaneArea.d.ts +8 -0
- package/types/src/studio/StudioTaskPaneArea.d.ts.map +1 -0
- package/types/src/studio/StudioToolbar.d.ts +37 -0
- package/types/src/studio/StudioToolbar.d.ts.map +1 -0
- package/types/src/studio/index.d.ts +4 -0
- package/types/src/studio/index.d.ts.map +1 -0
- package/types/src/studio/useStudioApp.d.ts +51 -0
- package/types/src/studio/useStudioApp.d.ts.map +1 -0
- package/types/src/table/TableDetailsPanel.d.ts +17 -0
- package/types/src/table/TableDetailsPanel.d.ts.map +1 -0
- package/types/src/table/TableDetailsTaskPane.d.ts +3 -0
- package/types/src/table/TableDetailsTaskPane.d.ts.map +1 -0
- package/types/src/table/TablePlugin.d.ts +2 -0
- package/types/src/table/TablePlugin.d.ts.map +1 -0
- package/types/src/table/TableStyleCanvasPreview.d.ts +21 -0
- package/types/src/table/TableStyleCanvasPreview.d.ts.map +1 -0
- package/types/src/table/TableStyleOptionsPanel.d.ts +38 -0
- package/types/src/table/TableStyleOptionsPanel.d.ts.map +1 -0
- package/types/src/table/TableStylePreview.d.ts +43 -0
- package/types/src/table/TableStylePreview.d.ts.map +1 -0
- package/types/src/table/index.d.ts +7 -0
- package/types/src/table/index.d.ts.map +1 -0
- package/types/src/theme/ThemeSelectButton.d.ts +23 -0
- package/types/src/theme/ThemeSelectButton.d.ts.map +1 -0
- package/types/src/theme/ThemeSelectPanel.d.ts +17 -0
- package/types/src/theme/ThemeSelectPanel.d.ts.map +1 -0
- package/types/src/theme/ThemeSelectPopupButton.d.ts +24 -0
- package/types/src/theme/ThemeSelectPopupButton.d.ts.map +1 -0
- package/types/src/theme/ThemeUtils.d.ts +57 -0
- package/types/src/theme/ThemeUtils.d.ts.map +1 -0
- package/types/src/theme/index.d.ts +5 -0
- package/types/src/theme/index.d.ts.map +1 -0
- package/types/src/toast/ToastError.d.ts +10 -0
- package/types/src/toast/ToastError.d.ts.map +1 -0
- package/types/src/toast/index.d.ts +2 -0
- package/types/src/toast/index.d.ts.map +1 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts +46 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts.map +1 -0
- package/types/src/toolbar/index.d.ts +2 -0
- package/types/src/toolbar/index.d.ts.map +1 -0
- package/types/src/workbook/DefaultRenderers.d.ts +23 -0
- package/types/src/workbook/DefaultRenderers.d.ts.map +1 -0
- package/types/src/workbook/DocumentTitle.d.ts +69 -0
- package/types/src/workbook/DocumentTitle.d.ts.map +1 -0
- package/types/src/workbook/WorkbookContextMenu.d.ts +13 -0
- package/types/src/workbook/WorkbookContextMenu.d.ts.map +1 -0
- package/types/src/workbook/WorkbookElement.d.ts +12 -0
- package/types/src/workbook/WorkbookElement.d.ts.map +1 -0
- package/types/src/workbook/WorkbookStrip.d.ts +37 -0
- package/types/src/workbook/WorkbookStrip.d.ts.map +1 -0
- package/types/src/workbook/index.d.ts +7 -0
- package/types/src/workbook/index.d.ts.map +1 -0
- package/browser/cjs/7uRpnSJkNHg_E-KO.cjs +0 -6
- package/browser/cjs/B-O26BvbKDImp7pm.cjs +0 -20
- package/browser/cjs/B4j_sdzJNzq1ZPbT.cjs +0 -6
- package/browser/cjs/BWS4gFWp8lDPvR9C.cjs +0 -6
- package/browser/cjs/CmSwD6NZAHhOcRi3.cjs +0 -6
- package/browser/cjs/DHwhTAQeNs4slttB.cjs +0 -6
- package/browser/cjs/DMOT_ixtKqRvPULq.cjs +0 -6
- package/browser/cjs/DX5ji_lT0Qlqznv7.cjs +0 -42
- package/browser/cjs/DbqHWelIXc-F2a9N.cjs +0 -6
- package/browser/cjs/muTJOFrCXh156rjc.cjs +0 -6
- package/browser/cjs/rIy1Cx7HX-8zaQjY.cjs +0 -18
- package/browser/cjs/saPH3d5fE-ugXp6m.cjs +0 -7
- package/browser/esm/0D8VtNalLeBTB51a.mjs +0 -640
- package/browser/esm/BMo7K5LaD7zuDVg9.mjs +0 -2159
- package/browser/esm/BNmwaUWz2DJqWumP.mjs +0 -25
- package/browser/esm/Btt4G85L5v01eySb.mjs +0 -46
- package/browser/esm/C7jHdVMf6Yr4eH_B.mjs +0 -50
- package/browser/esm/CROTe62QHFVo8YMt.mjs +0 -155
- package/browser/esm/D5XNYGaC4Yw6vCRL.mjs +0 -54
- package/browser/esm/DUzVAMWTrS0u37LX.mjs +0 -2411
- package/browser/esm/DltuoFr9A-WJccbV.mjs +0 -26
- package/browser/esm/DtifaYF85GrfJ9_1.mjs +0 -50
- package/browser/esm/aUkJls9HzxnrZSof.mjs +0 -53
- package/browser/esm/mqkuG-TcLS4nn4x0.mjs +0 -4531
- package/node/assets/style.css +0 -1
- package/node/esm/BYjJIMFsheqJcsEI.mjs +0 -57
- package/node/esm/CACqTiBtxYlo1mu7.mjs +0 -26
- package/node/esm/CJU8jJhxtR3PEj2I.mjs +0 -52
- package/node/esm/CS0OWM24rZpAGRKU.mjs +0 -50
- package/node/esm/CdUceTAldsMTIFnD.mjs +0 -53
- package/node/esm/D6B7z_d11sd-U1fU.mjs +0 -46
- package/node/esm/DCngEQG4um0yTeoj.mjs +0 -91
- package/node/esm/DQnCFz2zJgMwLou_.mjs +0 -88
- package/node/esm/Do7ts-uMkQANfvhq.mjs +0 -156
- package/node/esm/oYh6joioOWhFd_R3.mjs +0 -25
|
@@ -0,0 +1,4543 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.23-beta.2
|
|
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 t, ColorPopupButton as o, DocumentTitle as n, FormulaField as r, NamedPlugin as a, TablePlugin as l, WorkbookElement as i, b as s, c as d, createStudioThemeCSS as c, d as p, f as u, g as m, h as g, i as h, l as y, m as b, n as f, o as x, p as v, r as C, registerStudioCommandCatalogs as k, registerStudioCommandGroups as w, renderWorkbookToolbars as S, s as T, t as P, tokensToMuiOptions as F, u as D } from "./index.mjs";
|
|
8
|
+
import { Color as N, CommonUtils as O, Condition as I, FormulaError as M, ICondition as R, IConditionalFormat as A, IDataValidation as E, IFill as W, IFont as B, IStyle as L, ScalarType as z } from "@sheetxl/sdk";
|
|
9
|
+
import { COLOR_SCALE_PRESETS as j, CommandRootProvider as K, DATA_BAR_PRESETS as V, DefaultTaskPaneRegistry as $, ICON_SET_GROUPS as _, LogoNoPaddingIcon as U, STYLE_PRESETS as q, TaskPaneArea as H, TaskPaneProvider as G, ThemeStateKey as Q, WorkbookIO as Y, WorkbookProvider as X, buildOOXMLThemeCSS as J, createEditable as Z, createSystemColorVars as ee, defaultColorScale as te, defaultDataBar as oe, defaultIconSet as ne, defaultIconStops as re, getConditionalIconSet as ae, iconSetSize as le, useDocThemes as ie, useModelSync as se, useReferenceModeStore as de, useResolvedWorkbook as ce, useSheet as pe, useWorkbookEncrypted as ue, useWorkbookName as me, useWorkbookSaveState as ge } from "@sheetxl/react";
|
|
10
|
+
import { Command as he, DefaultIconService as ye, DefaultReactNotifier as be, DynamicIcon as fe, KeyCodes as xe, LanguageStateKey as ve, NotifierType as Ce, ReactErrorBoundary as ke, ReactNotifierProvider as we, SplitPane as Se, UncaughtErrorBoundary as Te, createBusyHandle as Pe, createThemeScopeClass as Fe, useCallbackRef as De, useFullscreen as Ne, useImperativeElement as Oe, useLanguage as Ie, useNotifier as Me, usePersistenceState as Re, useResolvedThemeMode as Ae, useTokenThemeContext as Ee, useTranslator as We } from "@sheetxl/utils-react";
|
|
11
|
+
import Be, { forwardRef as Le, isValidElement as ze, lazy as je, memo as Ke, useCallback as Ve, useEffect as $e, useId as _e, useMemo as Ue, useRef as qe, useState as He } from "react";
|
|
12
|
+
import { AnimatedLoadingPanel as Ge, AnimatedTraversingEllipsisIcon as Qe, CommandGroup as Ye, ExhibitFloatProvider as Xe, ExhibitIconButton as Je, ExhibitPopupIconButton as Ze, ExhibitTooltip as et, ModalProvider as tt, SimpleTooltip as ot, StackTrace as nt, createExhibitTheme as rt, useInputDialog as at, useLazyWindow as lt, useModal as it, useOptionsDialog as st } from "@sheetxl/utils-mui";
|
|
13
|
+
import { Fragment as dt, jsx as ct, jsxs as pt } from "react/jsx-runtime";
|
|
14
|
+
import { Accordion as ut, AccordionDetails as mt, AccordionSummary as gt, Box as ht, Button as yt, Card as bt, CardActions as ft, Checkbox as xt, Chip as vt, Collapse as Ct, CssBaseline as kt, DialogTitle as wt, Divider as St, FormControl as Tt, FormControlLabel as Pt, IconButton as Ft, InputAdornment as Dt, InputLabel as Nt, ListSubheader as Ot, MenuItem as It, MenuList as Mt, Paper as Rt, Select as At, Stack as Et, SvgIcon as Wt, Tab as Bt, Tabs as Lt, TextField as zt, ThemeProvider as jt, ToggleButton as Kt, ToggleButtonGroup as Vt, Typography as $t, alpha as _t, useMediaQuery as Ut, useTheme as qt } from "@mui/material";
|
|
15
|
+
import { CommonUtils as Ht, DOMUtils as Gt, DefaultLanguagePackService as Qt, ErrorUtils as Yt, ExpectedError as Xt, PartialError as Jt, formatMessage as Zt, messageKey as eo, t as to } from "@sheetxl/utils";
|
|
16
|
+
import oo from "clsx";
|
|
17
|
+
import { mergeRefs as no } from "react-merge-refs";
|
|
18
|
+
import { useMeasure as ro } from "react-use";
|
|
19
|
+
import { SnackbarContent as ao, SnackbarProvider as lo, useSnackbar as io } from "notistack";
|
|
20
|
+
var so = Ke(Le((e, t) => {
|
|
21
|
+
const { workbook: o, descriptor: n, args: r, dragReorder: a, ...l } = e;
|
|
22
|
+
return ct(m, {
|
|
23
|
+
ref: t,
|
|
24
|
+
workbook: o,
|
|
25
|
+
descriptor: Ue(() => ((e) => {
|
|
26
|
+
const t = (t) => e.getCollection(t.getSelectedSheet());
|
|
27
|
+
return {
|
|
28
|
+
key: e.key,
|
|
29
|
+
messageKeys: e.messageKeys,
|
|
30
|
+
getItems: (e) => t(e).getItems(),
|
|
31
|
+
subscribe: (t, o) => {
|
|
32
|
+
let n = null;
|
|
33
|
+
const r = () => {
|
|
34
|
+
n?.();
|
|
35
|
+
const r = {
|
|
36
|
+
onProtectionChange: () => o.onChange(),
|
|
37
|
+
onInvalidated: () => o.onInvalidated()
|
|
38
|
+
};
|
|
39
|
+
for (const t of e.changeEvents) r[t] = () => o.onChange();
|
|
40
|
+
n = t.getSelectedSheet().addListeners(r, { transactional: !1 });
|
|
41
|
+
};
|
|
42
|
+
r();
|
|
43
|
+
const a = t.addListeners({ onSelectedSheetChange: () => {
|
|
44
|
+
r(), o.onChange();
|
|
45
|
+
} }, { transactional: !1 });
|
|
46
|
+
return () => {
|
|
47
|
+
n?.(), a?.();
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
isReadOnly: (t) => {
|
|
51
|
+
const o = t.getSelectedSheet();
|
|
52
|
+
return e.isReadOnly?.(o) ?? !o.getProtection().isObjectsAllowed();
|
|
53
|
+
},
|
|
54
|
+
isItemReadOnly: (t, o) => {
|
|
55
|
+
const n = o.getSelectedSheet();
|
|
56
|
+
return (e.isReadOnly?.(n) ?? !n.getProtection().isObjectsAllowed()) || t.isProtected();
|
|
57
|
+
},
|
|
58
|
+
subscribeItem: (e, t) => e.addListeners({
|
|
59
|
+
onInvalidated: () => t(),
|
|
60
|
+
onProtectedChange: () => t()
|
|
61
|
+
}, { transactional: !1 }),
|
|
62
|
+
createDraft: (e, o) => t(e).createItem(o),
|
|
63
|
+
createSeededDraft: e.applySeed ? (o, n) => {
|
|
64
|
+
const r = t(o).createItem();
|
|
65
|
+
return e.applySeed(r, n), r;
|
|
66
|
+
} : void 0,
|
|
67
|
+
beforeSave: e.beforeSave,
|
|
68
|
+
save: (o, n, r) => {
|
|
69
|
+
null === r ? t(o).add(n) : e.applyUpdate(r, n);
|
|
70
|
+
},
|
|
71
|
+
delete: (e) => e.delete(),
|
|
72
|
+
duplicate: (e, o) => {
|
|
73
|
+
const n = t(o);
|
|
74
|
+
n.add(n.createItem(e));
|
|
75
|
+
},
|
|
76
|
+
moveBy: e.reorderable ?? 1 ? (e, t) => {
|
|
77
|
+
e.setIndex(e.getIndex() + t);
|
|
78
|
+
} : void 0,
|
|
79
|
+
getCardTitle: e.getCardTitle,
|
|
80
|
+
getCardSubtitle: (e) => e.getRanges().toString(),
|
|
81
|
+
CardSubtitle: e.CardSubtitle,
|
|
82
|
+
CardMedia: e.CardMedia,
|
|
83
|
+
CardBody: e.CardBody,
|
|
84
|
+
EditorBody: ({ draft: t }) => {
|
|
85
|
+
const o = e.EditorBody;
|
|
86
|
+
return ct(o, { item: t });
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
})(n), [n]),
|
|
90
|
+
args: r,
|
|
91
|
+
dragReorder: a,
|
|
92
|
+
...l
|
|
93
|
+
});
|
|
94
|
+
}));
|
|
95
|
+
so.displayName = "AnchorItemsPanel";
|
|
96
|
+
var co = Ke((e) => {
|
|
97
|
+
const { option: t, onOptionChange: o, readOnly: n, ...r } = e;
|
|
98
|
+
return ct(zt, {
|
|
99
|
+
size: "small",
|
|
100
|
+
type: "text",
|
|
101
|
+
placeholder: We()("condition.enterText"),
|
|
102
|
+
value: t ?? "",
|
|
103
|
+
onChange: (e) => o(String(e.target.value)),
|
|
104
|
+
disabled: n,
|
|
105
|
+
...r,
|
|
106
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } }
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
co.displayName = "StringOption";
|
|
110
|
+
var po = Ke((e) => {
|
|
111
|
+
const { option: t, onOptionChange: o, readOnly: n, ...r } = e;
|
|
112
|
+
return ct(zt, {
|
|
113
|
+
size: "small",
|
|
114
|
+
type: "number",
|
|
115
|
+
placeholder: We()("condition.enterNumber"),
|
|
116
|
+
value: "" + (t ?? ""),
|
|
117
|
+
onChange: (e) => o(Number(e.target.value)),
|
|
118
|
+
disabled: n,
|
|
119
|
+
...r,
|
|
120
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } }
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
po.displayName = "NumberOption";
|
|
124
|
+
var uo = (e) => null == e ? "" : "boolean" == typeof e ? e ? "TRUE" : "FALSE" : M.isError(e) ? e.getLabel() : String(e), mo = Ke((e) => {
|
|
125
|
+
const { option: t, onOptionChange: o, readOnly: n, ...a } = e, l = We();
|
|
126
|
+
return ct(r, {
|
|
127
|
+
size: "small",
|
|
128
|
+
value: uo(t),
|
|
129
|
+
onChangeText: (e) => o(((e) => {
|
|
130
|
+
if (0 === e.length) return null;
|
|
131
|
+
if (!e.startsWith("=")) {
|
|
132
|
+
const t = e.trim();
|
|
133
|
+
if (t.length > 0) {
|
|
134
|
+
const e = Number(t);
|
|
135
|
+
if (Number.isFinite(e)) return e;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return e;
|
|
139
|
+
})(e)),
|
|
140
|
+
placeholder: l("condition.enterValueOrFormula"),
|
|
141
|
+
disabled: n,
|
|
142
|
+
fullWidth: !0,
|
|
143
|
+
equals: "literal",
|
|
144
|
+
pickAs: "absolute",
|
|
145
|
+
label: null,
|
|
146
|
+
showError: !1,
|
|
147
|
+
helperText: null,
|
|
148
|
+
...a
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
mo.displayName = "ScalarOption";
|
|
152
|
+
var go = Ke((e) => {
|
|
153
|
+
const { option: t, onOptionChange: o, ...n } = e, r = We(), [a, l] = He(""), i = "string" == typeof t?.items, s = Ue(() => t?.items && Array.isArray(t.items) ? t.items : [], [t?.items]), d = () => {
|
|
154
|
+
if (!a.trim()) return;
|
|
155
|
+
let e = a;
|
|
156
|
+
const n = [...s, e];
|
|
157
|
+
o({
|
|
158
|
+
...t,
|
|
159
|
+
items: n
|
|
160
|
+
}), l("");
|
|
161
|
+
};
|
|
162
|
+
return pt(ht, {
|
|
163
|
+
...n,
|
|
164
|
+
style: {
|
|
165
|
+
display: "flex",
|
|
166
|
+
flex: "1 1 auto",
|
|
167
|
+
flexDirection: "column",
|
|
168
|
+
gap: "8px",
|
|
169
|
+
...n?.style
|
|
170
|
+
},
|
|
171
|
+
children: [
|
|
172
|
+
pt(ht, {
|
|
173
|
+
sx: {
|
|
174
|
+
display: "flex",
|
|
175
|
+
alignItems: "center",
|
|
176
|
+
gap: 1
|
|
177
|
+
},
|
|
178
|
+
children: [ct($t, {
|
|
179
|
+
variant: "body2",
|
|
180
|
+
sx: { flexGrow: 1 },
|
|
181
|
+
children: r(i ? "condition.formulaMode" : "condition.listMode")
|
|
182
|
+
}), ct(yt, {
|
|
183
|
+
size: "small",
|
|
184
|
+
variant: "outlined",
|
|
185
|
+
onClick: () => {
|
|
186
|
+
o(i ? {
|
|
187
|
+
...t,
|
|
188
|
+
items: []
|
|
189
|
+
} : {
|
|
190
|
+
...t,
|
|
191
|
+
items: ""
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
|
+
children: r(i ? "condition.switchToList" : "condition.switchToFormula")
|
|
195
|
+
})]
|
|
196
|
+
}),
|
|
197
|
+
i && ct(zt, {
|
|
198
|
+
fullWidth: !0,
|
|
199
|
+
size: "small",
|
|
200
|
+
label: r("condition.formula"),
|
|
201
|
+
value: t.items || "",
|
|
202
|
+
onChange: (e) => {
|
|
203
|
+
n = e.target.value, o({
|
|
204
|
+
...t,
|
|
205
|
+
items: n
|
|
206
|
+
});
|
|
207
|
+
return;
|
|
208
|
+
var n;
|
|
209
|
+
},
|
|
210
|
+
placeholder: "=A1:A10",
|
|
211
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } },
|
|
212
|
+
helperText: r("condition.formulaHelper")
|
|
213
|
+
}),
|
|
214
|
+
!i && pt(dt, { children: [
|
|
215
|
+
pt(ht, {
|
|
216
|
+
sx: {
|
|
217
|
+
display: "flex",
|
|
218
|
+
gap: 1
|
|
219
|
+
},
|
|
220
|
+
children: [ct(zt, {
|
|
221
|
+
fullWidth: !0,
|
|
222
|
+
size: "small",
|
|
223
|
+
label: r("condition.addValue"),
|
|
224
|
+
value: a,
|
|
225
|
+
onChange: (e) => l(e.target.value),
|
|
226
|
+
onKeyPress: (e) => {
|
|
227
|
+
"Enter" === e.key && d();
|
|
228
|
+
},
|
|
229
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } }
|
|
230
|
+
}), ct(Ft, {
|
|
231
|
+
color: "primary",
|
|
232
|
+
onClick: d,
|
|
233
|
+
disabled: !a.trim(),
|
|
234
|
+
sx: { backgroundColor: "background.paper" },
|
|
235
|
+
children: ct(fe, { iconKey: "Add" })
|
|
236
|
+
})]
|
|
237
|
+
}),
|
|
238
|
+
s.length > 0 && pt(ht, {
|
|
239
|
+
sx: {
|
|
240
|
+
p: 2,
|
|
241
|
+
backgroundColor: "background.paper",
|
|
242
|
+
border: 1,
|
|
243
|
+
borderColor: "divider",
|
|
244
|
+
borderRadius: 1
|
|
245
|
+
},
|
|
246
|
+
children: [ct($t, {
|
|
247
|
+
variant: "caption",
|
|
248
|
+
sx: {
|
|
249
|
+
mb: 1,
|
|
250
|
+
display: "block",
|
|
251
|
+
color: "text.secondary"
|
|
252
|
+
},
|
|
253
|
+
children: r("condition.valuesCount", { count: s.length })
|
|
254
|
+
}), ct(Et, {
|
|
255
|
+
direction: "row",
|
|
256
|
+
spacing: 1,
|
|
257
|
+
useFlexGap: !0,
|
|
258
|
+
sx: { flexWrap: "wrap" },
|
|
259
|
+
children: s.map((e, n) => ct(vt, {
|
|
260
|
+
label: String(e),
|
|
261
|
+
onDelete: () => ((e) => {
|
|
262
|
+
const n = s.filter((t, o) => o !== e);
|
|
263
|
+
o({
|
|
264
|
+
...t,
|
|
265
|
+
items: n.length > 0 ? n : void 0
|
|
266
|
+
});
|
|
267
|
+
})(n),
|
|
268
|
+
size: "small",
|
|
269
|
+
sx: { mb: 1 }
|
|
270
|
+
}, n))
|
|
271
|
+
})]
|
|
272
|
+
}),
|
|
273
|
+
0 === s.length && ct(ht, {
|
|
274
|
+
sx: {
|
|
275
|
+
p: 3,
|
|
276
|
+
textAlign: "center",
|
|
277
|
+
backgroundColor: "action.hover",
|
|
278
|
+
borderRadius: 1,
|
|
279
|
+
border: 1,
|
|
280
|
+
borderColor: "divider",
|
|
281
|
+
borderStyle: "dashed"
|
|
282
|
+
},
|
|
283
|
+
children: ct($t, {
|
|
284
|
+
variant: "body2",
|
|
285
|
+
sx: { color: "text.secondary" },
|
|
286
|
+
children: r("condition.noValues")
|
|
287
|
+
})
|
|
288
|
+
})
|
|
289
|
+
] })
|
|
290
|
+
]
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
go.displayName = "InSetOption";
|
|
294
|
+
var ho = {}, yo = Ke((e) => {
|
|
295
|
+
const { option: t, onOptionChange: o, className: n, readOnly: r, ...a } = e, l = We(), i = t?.type ?? R.AverageType.Above, s = t?.stdDevs ?? "";
|
|
296
|
+
let d = { backgroundColor: "background.paper" };
|
|
297
|
+
return r && (d = {
|
|
298
|
+
...d,
|
|
299
|
+
"& .MuiSelect-icon": { display: "none" },
|
|
300
|
+
"& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
|
|
301
|
+
}), pt(ht, {
|
|
302
|
+
className: oo(n, ho.option),
|
|
303
|
+
...a,
|
|
304
|
+
sx: {
|
|
305
|
+
display: "flex",
|
|
306
|
+
flexDirection: "row",
|
|
307
|
+
gap: .25,
|
|
308
|
+
...a?.sx
|
|
309
|
+
},
|
|
310
|
+
children: [ct(Tt, {
|
|
311
|
+
sx: { flex: .5 },
|
|
312
|
+
size: "small",
|
|
313
|
+
children: pt(At, {
|
|
314
|
+
value: i,
|
|
315
|
+
sx: d,
|
|
316
|
+
IconComponent: (e) => ct(fe, {
|
|
317
|
+
iconKey: "ExpandMore",
|
|
318
|
+
...e
|
|
319
|
+
}),
|
|
320
|
+
disabled: r,
|
|
321
|
+
onChange: (e) => o({
|
|
322
|
+
...t,
|
|
323
|
+
type: e.target.value
|
|
324
|
+
}),
|
|
325
|
+
children: [ct(It, {
|
|
326
|
+
value: R.AverageType.Above,
|
|
327
|
+
children: l("condition.above")
|
|
328
|
+
}), ct(It, {
|
|
329
|
+
value: R.AverageType.Below,
|
|
330
|
+
children: l("condition.below")
|
|
331
|
+
})]
|
|
332
|
+
})
|
|
333
|
+
}), ct(zt, {
|
|
334
|
+
size: "small",
|
|
335
|
+
placeholder: l("condition.stdDevs"),
|
|
336
|
+
value: s,
|
|
337
|
+
onChange: (e) => {
|
|
338
|
+
const n = Number(e.target.value) || "", r = { ...t };
|
|
339
|
+
"number" == typeof n ? r.stdDevs = n : delete r.stdDevs, o(r);
|
|
340
|
+
},
|
|
341
|
+
sx: { flex: .5 },
|
|
342
|
+
disabled: r,
|
|
343
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } },
|
|
344
|
+
type: "number"
|
|
345
|
+
})]
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
yo.displayName = "AverageOption";
|
|
349
|
+
var bo = 0, fo = /* @__PURE__ */ new WeakMap(), xo = (e) => {
|
|
350
|
+
let t = fo.get(e);
|
|
351
|
+
return t || (t = "__ci_" + ++bo, fo.set(e, t)), t;
|
|
352
|
+
}, vo = Object.freeze([R.BuiltInOperatorNames.Icon, R.BuiltInOperatorNames.Color]), Co = (e, t, o, n = vo) => {
|
|
353
|
+
const r = t ?? Object.values(I.BuiltInOperators), a = e?.getSelectType() ?? null, l = e?.isList;
|
|
354
|
+
return r.filter((t) => {
|
|
355
|
+
if (n.includes(t.getName())) return !1;
|
|
356
|
+
const o = t.acceptsList?.();
|
|
357
|
+
if (!l && o) return !1;
|
|
358
|
+
if (l && !o) return !1;
|
|
359
|
+
if (!e) return !0;
|
|
360
|
+
const r = t.getAcceptsTypes?.();
|
|
361
|
+
return !r || r.includes(a);
|
|
362
|
+
}).sort((e, t) => (e.getTitle?.() ?? "").localeCompare(t.getTitle?.() ?? "", o));
|
|
363
|
+
}, ko = (e, t, o, n) => {
|
|
364
|
+
const r = (e, t) => (e.getTitle?.() ?? "").localeCompare(t.getTitle?.() ?? "", n), a = e.filter((e) => !e.isCombinator?.()).sort(r), l = e.filter((e) => e.isCombinator?.()).sort(r), i = [];
|
|
365
|
+
return a.length > 0 && (i.push(ct(Ot, {
|
|
366
|
+
disableSticky: !0,
|
|
367
|
+
sx: So,
|
|
368
|
+
children: o("condition.groupBasic")
|
|
369
|
+
}, "__header:leaf")), a.forEach((e) => i.push(t(e)))), a.length > 0 && l.length > 0 && i.push(ct(St, {}, "__divider")), l.length > 0 && (i.push(ct(Ot, {
|
|
370
|
+
disableSticky: !0,
|
|
371
|
+
sx: So,
|
|
372
|
+
children: o("condition.groupCombine")
|
|
373
|
+
}, "__header:combinator")), l.forEach((e) => i.push(t(e)))), i;
|
|
374
|
+
}, wo = (e, t, o = null) => {
|
|
375
|
+
if (!e.isCombinator?.()) return e.createDefaultParam?.(o ?? void 0) ?? null;
|
|
376
|
+
const n = t.find((e) => !e.isCombinator?.()) ?? null, r = n ? {
|
|
377
|
+
operator: n.getName(),
|
|
378
|
+
param: n.createDefaultParam?.(o ?? void 0) ?? null
|
|
379
|
+
} : null;
|
|
380
|
+
return "not" === e.getName() ? r : r ? [r] : [];
|
|
381
|
+
}, So = {
|
|
382
|
+
userSelect: "none",
|
|
383
|
+
lineHeight: "2",
|
|
384
|
+
fontSize: "0.75rem",
|
|
385
|
+
fontWeight: 600,
|
|
386
|
+
color: "text.secondary",
|
|
387
|
+
paddingLeft: 1,
|
|
388
|
+
paddingRight: 1
|
|
389
|
+
}, To = { pl: 2 };
|
|
390
|
+
var Po = Ke((e) => {
|
|
391
|
+
const { option: t, onOptionChange: o, readOnly: n, ...r } = e, a = function(e, t) {
|
|
392
|
+
const o = (e) => new Intl.DateTimeFormat(t, { month: "long" }).format(new Date(2e3, e, 1));
|
|
393
|
+
return [
|
|
394
|
+
{
|
|
395
|
+
header: e("condition.period.day"),
|
|
396
|
+
options: [
|
|
397
|
+
{
|
|
398
|
+
value: R.TimePeriodType.Today,
|
|
399
|
+
label: e("condition.period.today")
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
value: R.TimePeriodType.Yesterday,
|
|
403
|
+
label: e("condition.period.yesterday")
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
value: R.TimePeriodType.Tomorrow,
|
|
407
|
+
label: e("condition.period.tomorrow")
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
header: e("condition.period.week"),
|
|
413
|
+
options: [
|
|
414
|
+
{
|
|
415
|
+
value: R.TimePeriodType.ThisWeek,
|
|
416
|
+
label: e("condition.period.thisWeek")
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
value: R.TimePeriodType.LastWeek,
|
|
420
|
+
label: e("condition.period.lastWeek")
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
value: R.TimePeriodType.NextWeek,
|
|
424
|
+
label: e("condition.period.nextWeek")
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
header: e("condition.period.month"),
|
|
430
|
+
options: [
|
|
431
|
+
{
|
|
432
|
+
value: R.TimePeriodType.ThisMonth,
|
|
433
|
+
label: e("condition.period.thisMonth")
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
value: R.TimePeriodType.LastMonth,
|
|
437
|
+
label: e("condition.period.lastMonth")
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
value: R.TimePeriodType.NextMonth,
|
|
441
|
+
label: e("condition.period.nextMonth")
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
header: e("condition.period.year"),
|
|
447
|
+
options: [{
|
|
448
|
+
value: R.TimePeriodType.YearToDate,
|
|
449
|
+
label: e("condition.period.yearToDate")
|
|
450
|
+
}, {
|
|
451
|
+
value: R.TimePeriodType.LastYear,
|
|
452
|
+
label: e("condition.period.lastYear")
|
|
453
|
+
}]
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
header: e("condition.period.byMonth"),
|
|
457
|
+
options: [
|
|
458
|
+
{
|
|
459
|
+
value: R.TimePeriodType.M1,
|
|
460
|
+
label: o(0)
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
value: R.TimePeriodType.M2,
|
|
464
|
+
label: o(1)
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
value: R.TimePeriodType.M3,
|
|
468
|
+
label: o(2)
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
value: R.TimePeriodType.M4,
|
|
472
|
+
label: o(3)
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
value: R.TimePeriodType.M5,
|
|
476
|
+
label: o(4)
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
value: R.TimePeriodType.M6,
|
|
480
|
+
label: o(5)
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
value: R.TimePeriodType.M7,
|
|
484
|
+
label: o(6)
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
value: R.TimePeriodType.M8,
|
|
488
|
+
label: o(7)
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
value: R.TimePeriodType.M9,
|
|
492
|
+
label: o(8)
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
value: R.TimePeriodType.M10,
|
|
496
|
+
label: o(9)
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
value: R.TimePeriodType.M11,
|
|
500
|
+
label: o(10)
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
value: R.TimePeriodType.M12,
|
|
504
|
+
label: o(11)
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
header: e("condition.period.byQuarter"),
|
|
510
|
+
options: [
|
|
511
|
+
{
|
|
512
|
+
value: R.TimePeriodType.ThisQuarter,
|
|
513
|
+
label: e("condition.period.thisQuarter")
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
value: R.TimePeriodType.LastQuarter,
|
|
517
|
+
label: e("condition.period.lastQuarter")
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
value: R.TimePeriodType.NextQuarter,
|
|
521
|
+
label: e("condition.period.nextQuarter")
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
value: R.TimePeriodType.Q1,
|
|
525
|
+
label: e("condition.period.q1")
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
value: R.TimePeriodType.Q2,
|
|
529
|
+
label: e("condition.period.q2")
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
value: R.TimePeriodType.Q3,
|
|
533
|
+
label: e("condition.period.q3")
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
value: R.TimePeriodType.Q4,
|
|
537
|
+
label: e("condition.period.q4")
|
|
538
|
+
}
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
];
|
|
542
|
+
}(We(), Ie()), l = t?.type ?? R.TimePeriodType.Today;
|
|
543
|
+
return ct(ht, {
|
|
544
|
+
...r,
|
|
545
|
+
sx: {
|
|
546
|
+
display: "flex",
|
|
547
|
+
flexDirection: "column",
|
|
548
|
+
gap: 2,
|
|
549
|
+
...r?.sx
|
|
550
|
+
},
|
|
551
|
+
children: ct(Tt, {
|
|
552
|
+
size: "small",
|
|
553
|
+
children: ct(At, {
|
|
554
|
+
value: l,
|
|
555
|
+
sx: { backgroundColor: "background.paper" },
|
|
556
|
+
IconComponent: (e) => ct(fe, {
|
|
557
|
+
iconKey: "ExpandMore",
|
|
558
|
+
...e
|
|
559
|
+
}),
|
|
560
|
+
onChange: (e) => o({
|
|
561
|
+
...t,
|
|
562
|
+
type: e.target.value
|
|
563
|
+
}),
|
|
564
|
+
disabled: n,
|
|
565
|
+
children: a.map((e, t) => {
|
|
566
|
+
const o = [];
|
|
567
|
+
return t > 0 && o.push(ct(St, {}, `divider-${t}`)), o.push(ct(Ot, {
|
|
568
|
+
sx: So,
|
|
569
|
+
children: e.header
|
|
570
|
+
}, `header-${t}`)), e.options.map((e) => o.push(ct(It, {
|
|
571
|
+
sx: To,
|
|
572
|
+
value: e.value,
|
|
573
|
+
children: e.label
|
|
574
|
+
}, e.value))), o;
|
|
575
|
+
})
|
|
576
|
+
})
|
|
577
|
+
})
|
|
578
|
+
});
|
|
579
|
+
});
|
|
580
|
+
Po.displayName = "TimePeriodOption";
|
|
581
|
+
var Fo = Ke((e) => {
|
|
582
|
+
const { option: t, onOptionChange: o, readOnly: n, ...r } = e, a = We(), l = t?.top ?? !0, i = t?.limit ?? 10, s = t?.percent ?? !1;
|
|
583
|
+
return pt(ht, {
|
|
584
|
+
...r,
|
|
585
|
+
sx: {
|
|
586
|
+
display: "flex",
|
|
587
|
+
flexDirection: "row",
|
|
588
|
+
gap: .25,
|
|
589
|
+
...r?.sx
|
|
590
|
+
},
|
|
591
|
+
children: [
|
|
592
|
+
ct(Tt, {
|
|
593
|
+
size: "small",
|
|
594
|
+
sx: { flex: 1 },
|
|
595
|
+
children: pt(At, {
|
|
596
|
+
value: l ? "top" : "bottom",
|
|
597
|
+
sx: { backgroundColor: "background.paper" },
|
|
598
|
+
IconComponent: (e) => ct(fe, {
|
|
599
|
+
iconKey: "ExpandMore",
|
|
600
|
+
...e
|
|
601
|
+
}),
|
|
602
|
+
onChange: (e) => o({
|
|
603
|
+
...t,
|
|
604
|
+
top: "top" === e.target.value
|
|
605
|
+
}),
|
|
606
|
+
disabled: n,
|
|
607
|
+
children: [ct(It, {
|
|
608
|
+
value: "top",
|
|
609
|
+
children: a("condition.top")
|
|
610
|
+
}), ct(It, {
|
|
611
|
+
value: "bottom",
|
|
612
|
+
children: a("condition.bottom")
|
|
613
|
+
})]
|
|
614
|
+
})
|
|
615
|
+
}),
|
|
616
|
+
ct(zt, {
|
|
617
|
+
size: "small",
|
|
618
|
+
placeholder: "10",
|
|
619
|
+
value: i,
|
|
620
|
+
onChange: (e) => {
|
|
621
|
+
const n = parseFloat(e.target.value) || 10;
|
|
622
|
+
o({
|
|
623
|
+
...t,
|
|
624
|
+
limit: n
|
|
625
|
+
});
|
|
626
|
+
},
|
|
627
|
+
disabled: n,
|
|
628
|
+
type: "number",
|
|
629
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } },
|
|
630
|
+
sx: { flex: .6 }
|
|
631
|
+
}),
|
|
632
|
+
ct(Tt, {
|
|
633
|
+
size: "small",
|
|
634
|
+
sx: { flex: 1 },
|
|
635
|
+
children: pt(At, {
|
|
636
|
+
value: s ? "percent" : "items",
|
|
637
|
+
sx: { backgroundColor: "background.paper" },
|
|
638
|
+
IconComponent: (e) => ct(fe, {
|
|
639
|
+
iconKey: "ExpandMore",
|
|
640
|
+
...e
|
|
641
|
+
}),
|
|
642
|
+
onChange: (e) => o({
|
|
643
|
+
...t,
|
|
644
|
+
percent: "percent" === e.target.value
|
|
645
|
+
}),
|
|
646
|
+
disabled: n,
|
|
647
|
+
children: [ct(It, {
|
|
648
|
+
value: "items",
|
|
649
|
+
children: a("condition.items")
|
|
650
|
+
}), ct(It, {
|
|
651
|
+
value: "percent",
|
|
652
|
+
children: a("condition.percent")
|
|
653
|
+
})]
|
|
654
|
+
})
|
|
655
|
+
})
|
|
656
|
+
]
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
Fo.displayName = "TopNOption";
|
|
660
|
+
var Do = Ke((e) => {
|
|
661
|
+
const { option: t, onOptionChange: o, readOnly: n, ...r } = e, a = We();
|
|
662
|
+
return pt(ht, {
|
|
663
|
+
...r,
|
|
664
|
+
sx: {
|
|
665
|
+
display: "flex",
|
|
666
|
+
flexDirection: "row",
|
|
667
|
+
gap: .25,
|
|
668
|
+
...r?.sx
|
|
669
|
+
},
|
|
670
|
+
children: [ct(mo, {
|
|
671
|
+
option: t?.from ?? null,
|
|
672
|
+
placeholder: a("condition.from"),
|
|
673
|
+
onOptionChange: (e) => {
|
|
674
|
+
o({
|
|
675
|
+
...t,
|
|
676
|
+
from: e
|
|
677
|
+
});
|
|
678
|
+
},
|
|
679
|
+
readOnly: n,
|
|
680
|
+
sx: {
|
|
681
|
+
flex: .6,
|
|
682
|
+
minWidth: 0
|
|
683
|
+
}
|
|
684
|
+
}), ct(mo, {
|
|
685
|
+
option: t?.to ?? null,
|
|
686
|
+
placeholder: a("condition.to"),
|
|
687
|
+
onOptionChange: (e) => {
|
|
688
|
+
o({
|
|
689
|
+
...t,
|
|
690
|
+
to: e
|
|
691
|
+
});
|
|
692
|
+
},
|
|
693
|
+
readOnly: n,
|
|
694
|
+
sx: {
|
|
695
|
+
flex: .6,
|
|
696
|
+
minWidth: 0
|
|
697
|
+
}
|
|
698
|
+
})]
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
Do.displayName = "BetweenOption";
|
|
702
|
+
var No = Ke((e) => {
|
|
703
|
+
const { option: t, onOptionChange: o, readOnly: n, ...a } = e, l = We();
|
|
704
|
+
return ct(r, {
|
|
705
|
+
size: "small",
|
|
706
|
+
value: t ?? "",
|
|
707
|
+
onChangeText: (e) => o(e),
|
|
708
|
+
placeholder: l("condition.enterFormula"),
|
|
709
|
+
disabled: n,
|
|
710
|
+
fullWidth: !0,
|
|
711
|
+
equals: "bare",
|
|
712
|
+
label: null,
|
|
713
|
+
showError: !1,
|
|
714
|
+
helperText: null,
|
|
715
|
+
...a
|
|
716
|
+
});
|
|
717
|
+
});
|
|
718
|
+
No.displayName = "ExpressionOption";
|
|
719
|
+
var Oo = Ke((e) => {
|
|
720
|
+
const { value: t = null, selectors: o, onChange: n, title: r, allowNull: a = !1, readOnly: l = !1, ...i } = e, s = We(), d = r ?? s("condition.selectorTitle"), c = o.map((e) => {
|
|
721
|
+
const t = e.getName();
|
|
722
|
+
return ct(It, {
|
|
723
|
+
value: t,
|
|
724
|
+
children: e.getTitle?.() ?? e.getName()
|
|
725
|
+
}, t);
|
|
726
|
+
});
|
|
727
|
+
let p = { backgroundColor: "background.paper" };
|
|
728
|
+
return l && (p = {
|
|
729
|
+
...p,
|
|
730
|
+
"& .MuiSelect-icon": { display: "none" },
|
|
731
|
+
"& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
|
|
732
|
+
}), pt(Tt, {
|
|
733
|
+
size: "small",
|
|
734
|
+
...i,
|
|
735
|
+
children: [ct(Nt, { children: d }), pt(At, {
|
|
736
|
+
value: t?.getName() ?? "null",
|
|
737
|
+
label: d,
|
|
738
|
+
readOnly: l,
|
|
739
|
+
IconComponent: (e) => ct(fe, {
|
|
740
|
+
iconKey: "ExpandMore",
|
|
741
|
+
...e
|
|
742
|
+
}),
|
|
743
|
+
onChange: (e) => {
|
|
744
|
+
const t = e.target.value, r = "null" === t ? null : o.find((e) => e.getName() === t) ?? null;
|
|
745
|
+
n(r);
|
|
746
|
+
},
|
|
747
|
+
sx: p,
|
|
748
|
+
children: [a && ct(It, {
|
|
749
|
+
value: "null",
|
|
750
|
+
children: s("condition.anySelector")
|
|
751
|
+
}), c]
|
|
752
|
+
})]
|
|
753
|
+
});
|
|
754
|
+
});
|
|
755
|
+
Oo.displayName = "SelectorSelect";
|
|
756
|
+
var Io = Ke((e) => {
|
|
757
|
+
const { value: t, operators: o, onChange: n, title: r, readOnly: a = !1, ...l } = e, i = We(), s = Ie(), d = r ?? i("condition.operatorTitle"), c = /* @__PURE__ */ new Map();
|
|
758
|
+
o.forEach((e) => {
|
|
759
|
+
c.set(e.getName(), e);
|
|
760
|
+
});
|
|
761
|
+
const p = ko(o, (e) => ct(It, {
|
|
762
|
+
value: e.getName(),
|
|
763
|
+
sx: To,
|
|
764
|
+
children: e.getTitle?.()
|
|
765
|
+
}, e.getName()), i, s);
|
|
766
|
+
return pt(Tt, {
|
|
767
|
+
size: "small",
|
|
768
|
+
...l,
|
|
769
|
+
children: [ct(Nt, { children: d }), ct(At, {
|
|
770
|
+
value: t?.getName() ?? "null",
|
|
771
|
+
label: d,
|
|
772
|
+
readOnly: a,
|
|
773
|
+
IconComponent: (e) => ct(fe, {
|
|
774
|
+
iconKey: "ExpandMore",
|
|
775
|
+
...e
|
|
776
|
+
}),
|
|
777
|
+
onChange: (e) => {
|
|
778
|
+
const t = e.target.value, o = "null" === t ? null : c.get(t) ?? null;
|
|
779
|
+
n(o);
|
|
780
|
+
},
|
|
781
|
+
sx: a ? {
|
|
782
|
+
"& .MuiSelect-icon": { display: "none" },
|
|
783
|
+
"& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
|
|
784
|
+
} : void 0,
|
|
785
|
+
children: p
|
|
786
|
+
})]
|
|
787
|
+
});
|
|
788
|
+
});
|
|
789
|
+
Io.displayName = "OperatorSelect";
|
|
790
|
+
var Mo = Ke(Le((e, t) => {
|
|
791
|
+
const { icon: o, tooltip: n, label: r, darkMode: a, propsPanel: l, value: i, operators: s, onChange: d, title: c, readOnly: p = !1, ...u } = e, m = We(), g = Ie();
|
|
792
|
+
c ?? m("condition.operatorTitle");
|
|
793
|
+
const h = o || ct(fe, { iconKey: "Add" }), y = qe(d);
|
|
794
|
+
return y.current = d, ct(Ze, {
|
|
795
|
+
ref: t,
|
|
796
|
+
createPopupPanel: Ve((e) => {
|
|
797
|
+
const { closeFloatAll: t } = e, o = ko(s, (e) => ct(It, {
|
|
798
|
+
sx: To,
|
|
799
|
+
value: e.getName(),
|
|
800
|
+
onClick: () => {
|
|
801
|
+
t?.(), y.current(e);
|
|
802
|
+
},
|
|
803
|
+
children: e.getTitle?.()
|
|
804
|
+
}, e.getName()), m, g);
|
|
805
|
+
return ct("div", {
|
|
806
|
+
style: {
|
|
807
|
+
minWidth: 200,
|
|
808
|
+
paddingTop: "8px",
|
|
809
|
+
paddingBottom: "8px",
|
|
810
|
+
...l?.style
|
|
811
|
+
},
|
|
812
|
+
...l,
|
|
813
|
+
onKeyDown: (e) => {
|
|
814
|
+
e.which === xe.Enter && t?.();
|
|
815
|
+
},
|
|
816
|
+
children: ct(Mt, {
|
|
817
|
+
disablePadding: !0,
|
|
818
|
+
children: o
|
|
819
|
+
})
|
|
820
|
+
});
|
|
821
|
+
}, [
|
|
822
|
+
s,
|
|
823
|
+
m,
|
|
824
|
+
g
|
|
825
|
+
]),
|
|
826
|
+
tooltip: n || r || "When",
|
|
827
|
+
label: r,
|
|
828
|
+
disabled: p,
|
|
829
|
+
icon: h,
|
|
830
|
+
...u
|
|
831
|
+
});
|
|
832
|
+
})), Ro = Ke((e) => {
|
|
833
|
+
const { operator: t, inputs: o, onOptionChange: n, operators: r, selector: a, readOnly: l, ...i } = e, s = We(), d = "not" === t.getName(), c = d ? null : "and" === t.getName() ? s("condition.and") : s("condition.or"), p = (e, t) => {
|
|
834
|
+
const r = o.slice(), a = {
|
|
835
|
+
operator: t.operator,
|
|
836
|
+
param: t.param
|
|
837
|
+
};
|
|
838
|
+
((e, t) => {
|
|
839
|
+
const o = fo.get(e);
|
|
840
|
+
o && fo.set(t, o);
|
|
841
|
+
})(o[e], a), r[e] = a, n(r);
|
|
842
|
+
}, u = d ? s("condition.not") : c;
|
|
843
|
+
return ct(ht, {
|
|
844
|
+
sx: {
|
|
845
|
+
display: "flex",
|
|
846
|
+
flexDirection: "column",
|
|
847
|
+
gap: .5,
|
|
848
|
+
pl: 1,
|
|
849
|
+
borderLeft: 2,
|
|
850
|
+
borderColor: "divider"
|
|
851
|
+
},
|
|
852
|
+
...i,
|
|
853
|
+
children: o.map((e, t) => ct(Be.Fragment, { children: ct(jo, {
|
|
854
|
+
operatorTitle: t > 0 ? u ?? "" : "",
|
|
855
|
+
operatorParam: e,
|
|
856
|
+
onOperatorParamChange: (e) => p(t, e),
|
|
857
|
+
onRemove: () => ((e) => {
|
|
858
|
+
const t = o.filter((t, o) => o !== e);
|
|
859
|
+
n(t);
|
|
860
|
+
})(t),
|
|
861
|
+
operators: r,
|
|
862
|
+
selector: a,
|
|
863
|
+
readOnly: l,
|
|
864
|
+
required: d
|
|
865
|
+
}) }, xo(e)))
|
|
866
|
+
});
|
|
867
|
+
});
|
|
868
|
+
Ro.displayName = "CombinatorOption";
|
|
869
|
+
var Ao = Ke((e) => {
|
|
870
|
+
const { option: t, onOptionChange: o, readOnly: n } = e, r = We();
|
|
871
|
+
return pt(Vt, {
|
|
872
|
+
exclusive: !0,
|
|
873
|
+
size: "small",
|
|
874
|
+
value: t ?? !0,
|
|
875
|
+
onChange: (e, t) => {
|
|
876
|
+
null !== t && o(t);
|
|
877
|
+
},
|
|
878
|
+
sx: {
|
|
879
|
+
my: 0,
|
|
880
|
+
py: 0,
|
|
881
|
+
backgroundColor: "background.paper"
|
|
882
|
+
},
|
|
883
|
+
disabled: n,
|
|
884
|
+
children: [ct(Kt, {
|
|
885
|
+
value: !0,
|
|
886
|
+
children: r("condition.true")
|
|
887
|
+
}), ct(Kt, {
|
|
888
|
+
value: !1,
|
|
889
|
+
children: r("condition.false")
|
|
890
|
+
})]
|
|
891
|
+
});
|
|
892
|
+
});
|
|
893
|
+
function Eo(e, t) {
|
|
894
|
+
if (!e) return Wo(t);
|
|
895
|
+
const o = /* @__PURE__ */ new Date(`${e}T${t || "00:00"}`);
|
|
896
|
+
return isNaN(o.getTime()) ? null : o;
|
|
897
|
+
}
|
|
898
|
+
function Wo(e) {
|
|
899
|
+
return e ? Eo("1970-01-01", e) : null;
|
|
900
|
+
}
|
|
901
|
+
Ao.displayName = "BooleanOption";
|
|
902
|
+
var Bo = Ke((e) => {
|
|
903
|
+
const { option: t, onOptionChange: o, allowFormula: n, readOnly: r, type: a = "dateTime", ...l } = e, i = We(), s = "date" === a || "dateTime" === a, d = "time" === a || "dateTime" === a, c = pe(), p = Ve((e) => {
|
|
904
|
+
if (!c || null === e) return null;
|
|
905
|
+
const t = c.createCell({ value: e }), o = t.getValue();
|
|
906
|
+
return t.getType() !== z.Number ? null : o;
|
|
907
|
+
}, [c]), u = Ve((e) => c ? c.createCell({
|
|
908
|
+
value: e,
|
|
909
|
+
style: { numberFormat: "Short DateTime" }
|
|
910
|
+
}).getDate() : null, [c]);
|
|
911
|
+
if (n && "string" == typeof t) return ct(mo, {
|
|
912
|
+
option: t,
|
|
913
|
+
onOptionChange: (e) => o(e),
|
|
914
|
+
readOnly: r,
|
|
915
|
+
sx: l?.sx
|
|
916
|
+
});
|
|
917
|
+
const m = u(t ?? null), g = !(h = m) || isNaN(h.getTime()) ? "" : `${h.getFullYear()}-${String(h.getMonth() + 1).padStart(2, "0")}-${String(h.getDate()).padStart(2, "0")}`;
|
|
918
|
+
var h;
|
|
919
|
+
const y = function(e) {
|
|
920
|
+
return !e || isNaN(e.getTime()) ? "" : `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}`;
|
|
921
|
+
}(m);
|
|
922
|
+
return pt(ht, {
|
|
923
|
+
...l,
|
|
924
|
+
sx: {
|
|
925
|
+
display: "flex",
|
|
926
|
+
flexDirection: "row",
|
|
927
|
+
gap: .5,
|
|
928
|
+
...l?.sx
|
|
929
|
+
},
|
|
930
|
+
children: [s && ct(co, {
|
|
931
|
+
option: g,
|
|
932
|
+
type: "date",
|
|
933
|
+
placeholder: i("condition.enterDate"),
|
|
934
|
+
onOptionChange: (e) => {
|
|
935
|
+
const t = p(Eo(e, y));
|
|
936
|
+
o(t);
|
|
937
|
+
},
|
|
938
|
+
sx: { flex: 1.5 },
|
|
939
|
+
readOnly: r
|
|
940
|
+
}), d && ct(co, {
|
|
941
|
+
option: y,
|
|
942
|
+
type: "time",
|
|
943
|
+
placeholder: i("condition.enterTime"),
|
|
944
|
+
onOptionChange: (e) => {
|
|
945
|
+
const t = p("time" === a ? Wo(e) : Eo(g, e));
|
|
946
|
+
o(t);
|
|
947
|
+
},
|
|
948
|
+
sx: { flex: 1 },
|
|
949
|
+
readOnly: r
|
|
950
|
+
})]
|
|
951
|
+
});
|
|
952
|
+
});
|
|
953
|
+
Bo.displayName = "DateTimeOption";
|
|
954
|
+
var Lo = R.BuiltInOperatorNames, zo = /* @__PURE__ */ new Set([
|
|
955
|
+
Lo.EqualTo,
|
|
956
|
+
Lo.GreaterThan,
|
|
957
|
+
Lo.GreaterThanEqualTo,
|
|
958
|
+
Lo.LessThan,
|
|
959
|
+
Lo.LessThanEqualTo,
|
|
960
|
+
Lo.After,
|
|
961
|
+
Lo.AfterEqualTo,
|
|
962
|
+
Lo.Before,
|
|
963
|
+
Lo.BeforeEqualTo
|
|
964
|
+
]), jo = Ke((e) => {
|
|
965
|
+
const { operatorParam: t, onOperatorParamChange: o, onRemove: n, operators: r, selector: a, operatorTitle: l, readOnly: i, required: s, ...d } = e, c = We(), p = l ?? c("condition.when"), u = t?.operator ?? null, m = r.find((e) => e.getName() === u) ?? null, g = t?.param ?? null, h = !!m?.isCombinator?.(), [y, { width: b }] = ro(), f = Ue(() => !m || h ? null : m.getParamType?.(a ?? void 0) ?? null, [
|
|
966
|
+
m,
|
|
967
|
+
h,
|
|
968
|
+
a
|
|
969
|
+
]), x = !h && "list" !== f && b > 360, v = De((e) => {
|
|
970
|
+
o({
|
|
971
|
+
operator: u,
|
|
972
|
+
param: e
|
|
973
|
+
});
|
|
974
|
+
}, [o, u]), C = Ue(() => {
|
|
975
|
+
if (!m || h || !f) return null;
|
|
976
|
+
const e = {
|
|
977
|
+
sx: {
|
|
978
|
+
flex: .6,
|
|
979
|
+
minWidth: 0
|
|
980
|
+
},
|
|
981
|
+
option: g,
|
|
982
|
+
onOptionChange: v
|
|
983
|
+
}, t = !!u && zo.has(u);
|
|
984
|
+
return f === R.BuiltInSelectorNames.Number || f === R.BuiltInSelectorNames.TextLength ? ct(t ? mo : po, { ...e }) : f === R.BuiltInSelectorNames.Whole ? t ? ct(mo, { ...e }) : ct(po, {
|
|
985
|
+
...e,
|
|
986
|
+
placeholder: c("condition.enterWholeNumber"),
|
|
987
|
+
slotProps: { htmlInput: {
|
|
988
|
+
step: 1,
|
|
989
|
+
onKeyDown: (e) => {
|
|
990
|
+
[
|
|
991
|
+
".",
|
|
992
|
+
",",
|
|
993
|
+
"e",
|
|
994
|
+
"E"
|
|
995
|
+
].includes(e.key) && e.preventDefault();
|
|
996
|
+
},
|
|
997
|
+
onPaste: (e) => {
|
|
998
|
+
/^-?\d+$/.test(e.clipboardData.getData("text")) || e.preventDefault();
|
|
999
|
+
}
|
|
1000
|
+
} }
|
|
1001
|
+
}) : f === R.BuiltInSelectorNames.Text ? ct(t ? mo : co, { ...e }) : f === R.BuiltInSelectorNames.DateTime ? ct(Bo, {
|
|
1002
|
+
...e,
|
|
1003
|
+
allowFormula: t
|
|
1004
|
+
}) : f === R.BuiltInSelectorNames.Date ? ct(Bo, {
|
|
1005
|
+
...e,
|
|
1006
|
+
type: "date",
|
|
1007
|
+
allowFormula: t
|
|
1008
|
+
}) : f === R.BuiltInSelectorNames.Time ? ct(Bo, {
|
|
1009
|
+
...e,
|
|
1010
|
+
type: "time",
|
|
1011
|
+
allowFormula: t
|
|
1012
|
+
}) : f === R.BuiltInSelectorNames.List ? ct(go, { ...e }) : f === R.BuiltInSelectorNames.Logical ? ct(Ao, { ...e }) : f === R.BuiltInOperatorNames.Average ? ct(yo, { ...e }) : f === R.BuiltInOperatorNames.TimePeriod ? ct(Po, { ...e }) : f === R.BuiltInOperatorNames.TopN ? ct(Fo, { ...e }) : f === R.BuiltInOperatorNames.Between ? ct(Do, { ...e }) : f === R.BuiltInOperatorNames.Expression ? ct(No, { ...e }) : null;
|
|
1013
|
+
}, [
|
|
1014
|
+
m,
|
|
1015
|
+
h,
|
|
1016
|
+
f,
|
|
1017
|
+
g,
|
|
1018
|
+
c
|
|
1019
|
+
]), k = Ue(() => h && g ? Array.isArray(g) ? g : [g] : [], [h, g]), w = h && "not" === m?.getName(), S = (e) => {
|
|
1020
|
+
if (!e || e === m) return;
|
|
1021
|
+
const t = !!e.isCombinator?.();
|
|
1022
|
+
let n;
|
|
1023
|
+
if (t && h) n = "not" === e.getName() ? k[0] ?? wo(e, r, a) : k.length > 0 ? k : wo(e, r, a);
|
|
1024
|
+
else {
|
|
1025
|
+
const o = m?.getParamType?.(a ?? void 0) ?? null, l = e.getParamType?.(a ?? void 0) ?? null;
|
|
1026
|
+
n = !t && l && l === o ? g : wo(e, r, a);
|
|
1027
|
+
}
|
|
1028
|
+
o({
|
|
1029
|
+
operator: e?.getName() ?? null,
|
|
1030
|
+
param: n
|
|
1031
|
+
});
|
|
1032
|
+
};
|
|
1033
|
+
return ct(ht, {
|
|
1034
|
+
ref: y,
|
|
1035
|
+
sx: {
|
|
1036
|
+
display: "flex",
|
|
1037
|
+
flexDirection: "column",
|
|
1038
|
+
gap: .5,
|
|
1039
|
+
backgroundColor: "background.paper",
|
|
1040
|
+
border: 1,
|
|
1041
|
+
borderColor: "divider",
|
|
1042
|
+
borderRadius: 1,
|
|
1043
|
+
p: 1
|
|
1044
|
+
},
|
|
1045
|
+
...d,
|
|
1046
|
+
children: x ? pt(ht, {
|
|
1047
|
+
sx: {
|
|
1048
|
+
display: "flex",
|
|
1049
|
+
flexDirection: "row",
|
|
1050
|
+
alignItems: "center",
|
|
1051
|
+
gap: .5
|
|
1052
|
+
},
|
|
1053
|
+
children: [
|
|
1054
|
+
ct(Io, {
|
|
1055
|
+
title: p,
|
|
1056
|
+
sx: { flex: .4 },
|
|
1057
|
+
value: m,
|
|
1058
|
+
operators: r,
|
|
1059
|
+
onChange: S,
|
|
1060
|
+
readOnly: i
|
|
1061
|
+
}),
|
|
1062
|
+
C,
|
|
1063
|
+
!i && !s && ct(Je, {
|
|
1064
|
+
icon: ct(fe, { iconKey: "Close" }),
|
|
1065
|
+
onClick: n
|
|
1066
|
+
})
|
|
1067
|
+
]
|
|
1068
|
+
}) : pt(dt, { children: [pt(ht, {
|
|
1069
|
+
sx: {
|
|
1070
|
+
display: "flex",
|
|
1071
|
+
flexDirection: "row",
|
|
1072
|
+
alignItems: "center",
|
|
1073
|
+
gap: .5
|
|
1074
|
+
},
|
|
1075
|
+
children: [
|
|
1076
|
+
ct(Io, {
|
|
1077
|
+
title: p,
|
|
1078
|
+
sx: { flex: 1 },
|
|
1079
|
+
value: m,
|
|
1080
|
+
operators: r,
|
|
1081
|
+
onChange: S,
|
|
1082
|
+
readOnly: i
|
|
1083
|
+
}),
|
|
1084
|
+
h && !w && !i && ct(Mo, {
|
|
1085
|
+
label: m?.getTitle?.(),
|
|
1086
|
+
icon: ct(fe, { iconKey: "Add" }),
|
|
1087
|
+
operators: r,
|
|
1088
|
+
value: null,
|
|
1089
|
+
onChange: (e) => {
|
|
1090
|
+
if (!e) return;
|
|
1091
|
+
const t = wo(e, r, a), n = [...k, {
|
|
1092
|
+
operator: e?.getName() ?? null,
|
|
1093
|
+
param: t
|
|
1094
|
+
}];
|
|
1095
|
+
o({
|
|
1096
|
+
operator: u,
|
|
1097
|
+
param: n
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
}),
|
|
1101
|
+
!i && !s && ct(Je, {
|
|
1102
|
+
icon: ct(fe, { iconKey: "Close" }),
|
|
1103
|
+
disabled: i,
|
|
1104
|
+
onClick: n
|
|
1105
|
+
})
|
|
1106
|
+
]
|
|
1107
|
+
}), h ? ct(Ro, {
|
|
1108
|
+
operator: m,
|
|
1109
|
+
inputs: k,
|
|
1110
|
+
onOptionChange: (e) => {
|
|
1111
|
+
o({
|
|
1112
|
+
operator: u,
|
|
1113
|
+
param: w ? e[0] ?? null : e
|
|
1114
|
+
});
|
|
1115
|
+
},
|
|
1116
|
+
operators: r,
|
|
1117
|
+
selector: a,
|
|
1118
|
+
readOnly: i
|
|
1119
|
+
}) : C] })
|
|
1120
|
+
});
|
|
1121
|
+
});
|
|
1122
|
+
jo.displayName = "OperatorAndParamEditor";
|
|
1123
|
+
var Ko = Ke((e) => {
|
|
1124
|
+
const { condition: t, onConditionChange: o, showIncludeBlanks: n = !1, selectorTitle: r, readOnly: a, operators: l, selectors: i, ...s } = e, d = We(), c = Ie(), [p, u] = He(() => t?.getSelector() ?? null), [m, g] = He(() => t?.getOperator() ? {
|
|
1125
|
+
operator: t.getOperator().getName(),
|
|
1126
|
+
param: t.getParam()
|
|
1127
|
+
} : null), [h, y] = He(() => t?.isIncludeBlanks() ?? !1);
|
|
1128
|
+
$e(() => {
|
|
1129
|
+
if (!t) return u(null), void g(null);
|
|
1130
|
+
const e = t.getOperator(), o = t.getSelector() ?? null;
|
|
1131
|
+
u(o), g(e ? {
|
|
1132
|
+
operator: e.getName(),
|
|
1133
|
+
param: t.getParam()
|
|
1134
|
+
} : null), y(t.isIncludeBlanks());
|
|
1135
|
+
}, [t]);
|
|
1136
|
+
const b = Ue(() => (i ?? Object.values(I.BuiltInSelectors)).slice().sort((e, t) => (e.getTitle?.() ?? "").localeCompare(t.getTitle?.() ?? "", c)), [i, c]), f = Ue(() => l ?? Object.values(I.BuiltInOperators), [l]), x = Ue(() => Co(p, f, c), [
|
|
1137
|
+
p,
|
|
1138
|
+
f,
|
|
1139
|
+
c
|
|
1140
|
+
]), v = (e) => {
|
|
1141
|
+
g(e), o?.({
|
|
1142
|
+
selector: p,
|
|
1143
|
+
...e
|
|
1144
|
+
});
|
|
1145
|
+
}, C = n;
|
|
1146
|
+
return pt(ht, {
|
|
1147
|
+
sx: {
|
|
1148
|
+
display: "flex",
|
|
1149
|
+
flexDirection: "column",
|
|
1150
|
+
p: 2,
|
|
1151
|
+
pb: C ? 0 : 1,
|
|
1152
|
+
gap: 1,
|
|
1153
|
+
backgroundColor: "action.hover",
|
|
1154
|
+
border: 1,
|
|
1155
|
+
borderColor: "divider",
|
|
1156
|
+
borderRadius: 1
|
|
1157
|
+
},
|
|
1158
|
+
...s,
|
|
1159
|
+
children: [
|
|
1160
|
+
ct(Oo, {
|
|
1161
|
+
title: r,
|
|
1162
|
+
selectors: b,
|
|
1163
|
+
value: p,
|
|
1164
|
+
onChange: (e) => {
|
|
1165
|
+
if (u(e), m) {
|
|
1166
|
+
const { operator: t } = m, n = f.find((e) => e.getName() === t) ?? null, r = Co(e, f);
|
|
1167
|
+
if (!n || !r.includes(n)) return g(null), void o?.({
|
|
1168
|
+
selector: e,
|
|
1169
|
+
operator: null,
|
|
1170
|
+
param: null
|
|
1171
|
+
});
|
|
1172
|
+
const a = !!n.isCombinator?.(), l = n.getParamType?.(p ?? void 0) ?? null, i = n.getParamType?.(e ?? void 0) ?? null;
|
|
1173
|
+
if (a || l !== i) {
|
|
1174
|
+
const t = wo(n, r, e), a = {
|
|
1175
|
+
operator: n.getName(),
|
|
1176
|
+
param: t
|
|
1177
|
+
};
|
|
1178
|
+
g(a), o?.({
|
|
1179
|
+
selector: e,
|
|
1180
|
+
...a
|
|
1181
|
+
});
|
|
1182
|
+
return;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
o?.({
|
|
1186
|
+
selector: e,
|
|
1187
|
+
...m
|
|
1188
|
+
});
|
|
1189
|
+
},
|
|
1190
|
+
allowNull: !0,
|
|
1191
|
+
readOnly: a
|
|
1192
|
+
}),
|
|
1193
|
+
m ? ct(jo, {
|
|
1194
|
+
operatorParam: m,
|
|
1195
|
+
onOperatorParamChange: v,
|
|
1196
|
+
onRemove: () => {
|
|
1197
|
+
g(null), o?.({
|
|
1198
|
+
selector: p,
|
|
1199
|
+
operator: null,
|
|
1200
|
+
param: null
|
|
1201
|
+
});
|
|
1202
|
+
},
|
|
1203
|
+
operators: x,
|
|
1204
|
+
selector: p,
|
|
1205
|
+
readOnly: a
|
|
1206
|
+
}) : !a && ct(ht, {
|
|
1207
|
+
sx: { display: "flex" },
|
|
1208
|
+
children: ct(Mo, {
|
|
1209
|
+
label: d("condition.when"),
|
|
1210
|
+
operators: x,
|
|
1211
|
+
value: null,
|
|
1212
|
+
onChange: (e) => {
|
|
1213
|
+
e && v({
|
|
1214
|
+
operator: e?.getName() ?? null,
|
|
1215
|
+
param: wo(e, x, p)
|
|
1216
|
+
});
|
|
1217
|
+
},
|
|
1218
|
+
readOnly: a
|
|
1219
|
+
})
|
|
1220
|
+
}),
|
|
1221
|
+
C && ct(Pt, {
|
|
1222
|
+
control: ct(xt, {
|
|
1223
|
+
checked: !h,
|
|
1224
|
+
onChange: (e) => {
|
|
1225
|
+
t = !e.target.checked, y(t), o?.({
|
|
1226
|
+
selector: p,
|
|
1227
|
+
...m,
|
|
1228
|
+
includeBlanks: t
|
|
1229
|
+
});
|
|
1230
|
+
return;
|
|
1231
|
+
var t;
|
|
1232
|
+
}
|
|
1233
|
+
}),
|
|
1234
|
+
disabled: a,
|
|
1235
|
+
label: d("condition.ignoreBlanks")
|
|
1236
|
+
})
|
|
1237
|
+
]
|
|
1238
|
+
});
|
|
1239
|
+
});
|
|
1240
|
+
Ko.displayName = "ConditionEditor";
|
|
1241
|
+
var Vo = Ke((e) => {
|
|
1242
|
+
const { variant: t = "format", children: o, sx: n, ...r } = e;
|
|
1243
|
+
return ct(ht, {
|
|
1244
|
+
className: `sxl-cf-rule-section sxl-cf-rule-section-${t}`,
|
|
1245
|
+
sx: {
|
|
1246
|
+
display: "flex",
|
|
1247
|
+
flexDirection: "column",
|
|
1248
|
+
gap: 1,
|
|
1249
|
+
p: 2,
|
|
1250
|
+
border: 1,
|
|
1251
|
+
borderColor: "divider",
|
|
1252
|
+
borderRadius: 1,
|
|
1253
|
+
..."config" === t ? { backgroundColor: "action.hover" } : null,
|
|
1254
|
+
...n
|
|
1255
|
+
},
|
|
1256
|
+
...r,
|
|
1257
|
+
children: o
|
|
1258
|
+
});
|
|
1259
|
+
});
|
|
1260
|
+
Vo.displayName = "RuleSection";
|
|
1261
|
+
var $o = new N("transparent"), _o = {
|
|
1262
|
+
lightRedFillDarkRedText: eo("conditionalFormat.preset.lightRedFillDarkRedText"),
|
|
1263
|
+
yellowFillDarkYellowText: eo("conditionalFormat.preset.yellowFillDarkYellowText"),
|
|
1264
|
+
greenFillDarkGreenText: eo("conditionalFormat.preset.greenFillDarkGreenText"),
|
|
1265
|
+
lightRedFill: eo("conditionalFormat.preset.lightRedFill"),
|
|
1266
|
+
redText: eo("conditionalFormat.preset.redText"),
|
|
1267
|
+
redBorder: eo("conditionalFormat.preset.redBorder")
|
|
1268
|
+
}, Uo = (e) => e ? "string" == typeof e ? e : e.type === W.Type.None ? null : e.color ?? e.foreground ?? null : null, qo = (e, t) => "auto" === e ? null : v(e, t), Ho = Ke((n) => {
|
|
1269
|
+
const { format: r, onFormatChange: a, readOnly: l, ...i } = n, s = We(), { workbook: d, schemeLookup: c, themeKey: p, gridColorScheme: u, darkMode: m, propsColorPanel: h } = b(), y = r?.font ?? null, f = (y?.weight ?? 400) >= 600, x = y?.style === B.Style.Italic, v = !!y?.underline && y.underline !== B.UnderlineStyle.None, C = !!y?.strike, k = (e) => {
|
|
1270
|
+
const t = { ...y };
|
|
1271
|
+
for (const [o, n] of Object.entries(e)) void 0 === n ? delete t[o] : t[o] = n;
|
|
1272
|
+
const o = { ...r };
|
|
1273
|
+
0 === Object.keys(t).length ? delete o.font : o.font = t, a(0 === Object.keys(o).length ? null : o);
|
|
1274
|
+
}, w = Ue(() => d?.getStyles().getNormal().getFont().getColor(), [d, p]), S = Ue(() => qo(y?.color, d), [
|
|
1275
|
+
y?.color,
|
|
1276
|
+
d,
|
|
1277
|
+
p
|
|
1278
|
+
]), T = Ue(() => qo(Uo(r?.fill), d), [
|
|
1279
|
+
r?.fill,
|
|
1280
|
+
d,
|
|
1281
|
+
p
|
|
1282
|
+
]), P = {
|
|
1283
|
+
padding: "4px",
|
|
1284
|
+
border: "none",
|
|
1285
|
+
borderRadius: 1
|
|
1286
|
+
};
|
|
1287
|
+
return pt(Vo, {
|
|
1288
|
+
...i,
|
|
1289
|
+
children: [pt(ht, {
|
|
1290
|
+
sx: {
|
|
1291
|
+
display: "flex",
|
|
1292
|
+
alignItems: "flex-start",
|
|
1293
|
+
gap: 1
|
|
1294
|
+
},
|
|
1295
|
+
children: [ct(ht, {
|
|
1296
|
+
sx: {
|
|
1297
|
+
flex: "1 1 auto",
|
|
1298
|
+
minWidth: 0,
|
|
1299
|
+
display: "flex",
|
|
1300
|
+
gap: .5,
|
|
1301
|
+
flexWrap: "wrap"
|
|
1302
|
+
},
|
|
1303
|
+
children: q.map((e, t) => {
|
|
1304
|
+
const o = qo(Uo(e.style.fill), d), n = qo(e.style.font?.color, d), r = e.style.border ? qo(Object.values(e.style.border)[0]?.color, d) : null;
|
|
1305
|
+
return ct(g, {
|
|
1306
|
+
title: s(_o[e.key] ?? e.key),
|
|
1307
|
+
disabled: l,
|
|
1308
|
+
onClick: () => a(structuredClone(e.style)),
|
|
1309
|
+
"data-sxl-theme-surface": "grid",
|
|
1310
|
+
"data-sxl-theme-mode": u,
|
|
1311
|
+
sx: {
|
|
1312
|
+
backgroundColor: o?.toCSS("adaptive") ?? "var(--sxl-color-base-100, rgb(255, 255, 255))",
|
|
1313
|
+
color: n?.toCSS("adaptive") ?? "var(--sxl-color-base-content, rgba(0, 0, 0, 0.87))",
|
|
1314
|
+
outline: r ? `1px solid ${r.toCSS("adaptive")}` : void 0,
|
|
1315
|
+
outlineOffset: "-3px"
|
|
1316
|
+
},
|
|
1317
|
+
children: "Aa"
|
|
1318
|
+
}, t);
|
|
1319
|
+
})
|
|
1320
|
+
}), ct(g, {
|
|
1321
|
+
title: s("conditionalFormat.clearStyle"),
|
|
1322
|
+
disabled: l || !r,
|
|
1323
|
+
onClick: () => a(null),
|
|
1324
|
+
sx: {
|
|
1325
|
+
color: "text.secondary",
|
|
1326
|
+
"&:disabled": { opacity: .4 }
|
|
1327
|
+
},
|
|
1328
|
+
children: ct(fe, {
|
|
1329
|
+
iconKey: "ClearFormats",
|
|
1330
|
+
size: 16
|
|
1331
|
+
})
|
|
1332
|
+
})]
|
|
1333
|
+
}), pt(ht, {
|
|
1334
|
+
sx: {
|
|
1335
|
+
display: "flex",
|
|
1336
|
+
alignItems: "center",
|
|
1337
|
+
gap: .25
|
|
1338
|
+
},
|
|
1339
|
+
children: [
|
|
1340
|
+
ct(Kt, {
|
|
1341
|
+
value: "bold",
|
|
1342
|
+
size: "small",
|
|
1343
|
+
sx: P,
|
|
1344
|
+
selected: f,
|
|
1345
|
+
disabled: l,
|
|
1346
|
+
onChange: () => k({ weight: f ? void 0 : 700 }),
|
|
1347
|
+
children: ct(fe, { iconKey: "TextBold" })
|
|
1348
|
+
}),
|
|
1349
|
+
ct(Kt, {
|
|
1350
|
+
value: "italic",
|
|
1351
|
+
size: "small",
|
|
1352
|
+
sx: P,
|
|
1353
|
+
selected: x,
|
|
1354
|
+
disabled: l,
|
|
1355
|
+
onChange: () => k({ style: x ? void 0 : B.Style.Italic }),
|
|
1356
|
+
children: ct(fe, { iconKey: "TextItalic" })
|
|
1357
|
+
}),
|
|
1358
|
+
ct(Kt, {
|
|
1359
|
+
value: "underline",
|
|
1360
|
+
size: "small",
|
|
1361
|
+
sx: P,
|
|
1362
|
+
selected: v,
|
|
1363
|
+
disabled: l,
|
|
1364
|
+
onChange: () => k({ underline: v ? void 0 : B.UnderlineStyle.Single }),
|
|
1365
|
+
children: ct(fe, { iconKey: "TextUnderline" })
|
|
1366
|
+
}),
|
|
1367
|
+
ct(Kt, {
|
|
1368
|
+
value: "strike",
|
|
1369
|
+
size: "small",
|
|
1370
|
+
sx: P,
|
|
1371
|
+
selected: C,
|
|
1372
|
+
disabled: l,
|
|
1373
|
+
onChange: () => k({ strike: !C || void 0 }),
|
|
1374
|
+
children: ct(fe, { iconKey: "TextStrike" })
|
|
1375
|
+
}),
|
|
1376
|
+
d && ct(t, {
|
|
1377
|
+
tooltip: s("conditionalFormat.border"),
|
|
1378
|
+
selectedBorder: r?.border,
|
|
1379
|
+
createBorder: (e) => d.getStyles().getNormal().createStyle({ border: e }).getBorder(),
|
|
1380
|
+
schemeLookup: c,
|
|
1381
|
+
autoColor: w,
|
|
1382
|
+
darkMode: m,
|
|
1383
|
+
disabled: l,
|
|
1384
|
+
onSelectBorder: (e) => ((e) => {
|
|
1385
|
+
const t = { ...r };
|
|
1386
|
+
e && 0 !== Object.keys(e).length ? t.border = e : delete t.border, a(0 === Object.keys(t).length ? null : t);
|
|
1387
|
+
})(e)
|
|
1388
|
+
}),
|
|
1389
|
+
ct(o, {
|
|
1390
|
+
icon: "fill.colored",
|
|
1391
|
+
tooltip: s("conditionalFormat.fillColor"),
|
|
1392
|
+
selectedColor: T,
|
|
1393
|
+
disabled: l,
|
|
1394
|
+
onSelectColor: (e) => ((e) => {
|
|
1395
|
+
const t = { ...r };
|
|
1396
|
+
e ? t.fill = {
|
|
1397
|
+
type: W.Type.Solid,
|
|
1398
|
+
color: e.toString()
|
|
1399
|
+
} : delete t.fill, a(0 === Object.keys(t).length ? null : t);
|
|
1400
|
+
})(e),
|
|
1401
|
+
darkMode: m,
|
|
1402
|
+
propsPanel: {
|
|
1403
|
+
disableAlpha: !0,
|
|
1404
|
+
autoColor: $o,
|
|
1405
|
+
autoColorLabelKey: eo("color.noFill"),
|
|
1406
|
+
autoColorPosition: e.End,
|
|
1407
|
+
...h
|
|
1408
|
+
}
|
|
1409
|
+
}),
|
|
1410
|
+
ct(o, {
|
|
1411
|
+
icon: "text.colored",
|
|
1412
|
+
tooltip: s("conditionalFormat.fontColor"),
|
|
1413
|
+
selectedColor: S,
|
|
1414
|
+
disabled: l,
|
|
1415
|
+
onSelectColor: (e) => k({ color: e ? e.toString() : void 0 }),
|
|
1416
|
+
darkMode: m,
|
|
1417
|
+
propsPanel: {
|
|
1418
|
+
disableAlpha: !0,
|
|
1419
|
+
autoColor: w,
|
|
1420
|
+
...h
|
|
1421
|
+
}
|
|
1422
|
+
})
|
|
1423
|
+
]
|
|
1424
|
+
})]
|
|
1425
|
+
});
|
|
1426
|
+
});
|
|
1427
|
+
Ho.displayName = "ConditionalFormatStylePicker";
|
|
1428
|
+
var Go = {
|
|
1429
|
+
[A.ColorStopType.AutoMin]: eo("conditionalFormat.stopType.autoMin"),
|
|
1430
|
+
[A.ColorStopType.AutoMax]: eo("conditionalFormat.stopType.autoMax"),
|
|
1431
|
+
[A.ColorStopType.Min]: eo("conditionalFormat.stopType.min"),
|
|
1432
|
+
[A.ColorStopType.Max]: eo("conditionalFormat.stopType.max"),
|
|
1433
|
+
[A.ColorStopType.Num]: eo("conditionalFormat.stopType.num"),
|
|
1434
|
+
[A.ColorStopType.Percent]: eo("conditionalFormat.stopType.percent"),
|
|
1435
|
+
[A.ColorStopType.Percentile]: eo("conditionalFormat.stopType.percentile"),
|
|
1436
|
+
[A.ColorStopType.Formula]: eo("conditionalFormat.stopType.formula")
|
|
1437
|
+
}, Qo = /* @__PURE__ */ new Set([
|
|
1438
|
+
A.ColorStopType.AutoMin,
|
|
1439
|
+
A.ColorStopType.AutoMax,
|
|
1440
|
+
A.ColorStopType.Min,
|
|
1441
|
+
A.ColorStopType.Max
|
|
1442
|
+
]), Yo = Ke((e) => {
|
|
1443
|
+
const { label: t, stop: n, onStopChange: a, allowedTypes: l, showColor: i = !1, showExclusive: s = !1, readOnly: d, ...c } = e, p = We(), { darkMode: u, toColor: m, propsColorPanel: g } = b(), h = n.type ?? A.ColorStopType.Num, y = !Qo.has(h), f = d || !y, x = h === A.ColorStopType.Formula, v = n.color, C = i ? m(v) : null;
|
|
1444
|
+
return pt(ht, {
|
|
1445
|
+
sx: {
|
|
1446
|
+
display: "flex",
|
|
1447
|
+
alignItems: "center",
|
|
1448
|
+
gap: .5
|
|
1449
|
+
},
|
|
1450
|
+
...c,
|
|
1451
|
+
children: [
|
|
1452
|
+
ct($t, {
|
|
1453
|
+
variant: "caption",
|
|
1454
|
+
sx: {
|
|
1455
|
+
color: "text.secondary",
|
|
1456
|
+
flex: "0 0 62px",
|
|
1457
|
+
minWidth: 0,
|
|
1458
|
+
overflow: "hidden",
|
|
1459
|
+
textOverflow: "ellipsis"
|
|
1460
|
+
},
|
|
1461
|
+
children: t
|
|
1462
|
+
}),
|
|
1463
|
+
i && ct(o, {
|
|
1464
|
+
tooltip: p("conditionalFormat.stopColor"),
|
|
1465
|
+
selectedColor: C,
|
|
1466
|
+
disabled: d,
|
|
1467
|
+
onSelectColor: (e) => {
|
|
1468
|
+
e && a({
|
|
1469
|
+
...n,
|
|
1470
|
+
color: e.toString()
|
|
1471
|
+
});
|
|
1472
|
+
},
|
|
1473
|
+
darkMode: u,
|
|
1474
|
+
propsPanel: {
|
|
1475
|
+
disableAlpha: !0,
|
|
1476
|
+
...g
|
|
1477
|
+
}
|
|
1478
|
+
}),
|
|
1479
|
+
s && pt(At, {
|
|
1480
|
+
size: "small",
|
|
1481
|
+
value: n.exclusive ? "gt" : "gte",
|
|
1482
|
+
disabled: d,
|
|
1483
|
+
onChange: (e) => {
|
|
1484
|
+
const t = { ...n };
|
|
1485
|
+
"gt" === e.target.value ? t.exclusive = !0 : delete t.exclusive, a(t);
|
|
1486
|
+
},
|
|
1487
|
+
sx: {
|
|
1488
|
+
flex: "0 0 auto",
|
|
1489
|
+
backgroundColor: "background.paper"
|
|
1490
|
+
},
|
|
1491
|
+
children: [ct(It, {
|
|
1492
|
+
value: "gte",
|
|
1493
|
+
children: ">="
|
|
1494
|
+
}), ct(It, {
|
|
1495
|
+
value: "gt",
|
|
1496
|
+
children: ">"
|
|
1497
|
+
})]
|
|
1498
|
+
}),
|
|
1499
|
+
ct(At, {
|
|
1500
|
+
size: "small",
|
|
1501
|
+
value: h,
|
|
1502
|
+
disabled: d,
|
|
1503
|
+
onChange: (e) => ((e) => {
|
|
1504
|
+
const t = {
|
|
1505
|
+
...n,
|
|
1506
|
+
type: e
|
|
1507
|
+
};
|
|
1508
|
+
if (Qo.has(e)) delete t.value;
|
|
1509
|
+
else if (void 0 === t.value) t.value = e === A.ColorStopType.Formula ? "" : 0;
|
|
1510
|
+
else if (e !== A.ColorStopType.Formula && "string" == typeof t.value) {
|
|
1511
|
+
const e = Number(t.value);
|
|
1512
|
+
t.value = Number.isFinite(e) ? e : 0;
|
|
1513
|
+
}
|
|
1514
|
+
a(t);
|
|
1515
|
+
})(e.target.value),
|
|
1516
|
+
sx: {
|
|
1517
|
+
flex: "1 1 40%",
|
|
1518
|
+
minWidth: 0,
|
|
1519
|
+
backgroundColor: "background.paper"
|
|
1520
|
+
},
|
|
1521
|
+
children: l.map((e) => ct(It, {
|
|
1522
|
+
value: e,
|
|
1523
|
+
children: p(Go[e])
|
|
1524
|
+
}, e))
|
|
1525
|
+
}),
|
|
1526
|
+
x ? ct(r, {
|
|
1527
|
+
size: "small",
|
|
1528
|
+
value: `${n.value ?? ""}`,
|
|
1529
|
+
onChangeText: (e) => {
|
|
1530
|
+
a({
|
|
1531
|
+
...n,
|
|
1532
|
+
value: e
|
|
1533
|
+
});
|
|
1534
|
+
},
|
|
1535
|
+
placeholder: p("conditionalFormat.enterFormula"),
|
|
1536
|
+
disabled: f,
|
|
1537
|
+
equals: "bare",
|
|
1538
|
+
pickAs: "absolute",
|
|
1539
|
+
label: null,
|
|
1540
|
+
showError: !1,
|
|
1541
|
+
helperText: null,
|
|
1542
|
+
sx: {
|
|
1543
|
+
flex: "1 1 30%",
|
|
1544
|
+
minWidth: 0,
|
|
1545
|
+
"& .MuiInputBase-root": { backgroundColor: f ? "action.disabledBackground" : "background.paper" }
|
|
1546
|
+
}
|
|
1547
|
+
}) : ct(zt, {
|
|
1548
|
+
size: "small",
|
|
1549
|
+
type: "number",
|
|
1550
|
+
placeholder: y ? void 0 : p("conditionalFormat.stopFromData"),
|
|
1551
|
+
value: y ? `${n.value ?? ""}` : "",
|
|
1552
|
+
disabled: f,
|
|
1553
|
+
onChange: (e) => {
|
|
1554
|
+
const t = e.target.value;
|
|
1555
|
+
a({
|
|
1556
|
+
...n,
|
|
1557
|
+
value: "" === t ? 0 : Number(t)
|
|
1558
|
+
});
|
|
1559
|
+
},
|
|
1560
|
+
sx: {
|
|
1561
|
+
flex: "1 1 30%",
|
|
1562
|
+
minWidth: 0,
|
|
1563
|
+
cursor: f ? "not-allowed" : void 0
|
|
1564
|
+
},
|
|
1565
|
+
slotProps: { input: { sx: {
|
|
1566
|
+
backgroundColor: f ? "action.disabledBackground" : "background.paper",
|
|
1567
|
+
cursor: f ? "not-allowed" : void 0
|
|
1568
|
+
} } }
|
|
1569
|
+
})
|
|
1570
|
+
]
|
|
1571
|
+
});
|
|
1572
|
+
});
|
|
1573
|
+
Yo.displayName = "ScaleStopRow";
|
|
1574
|
+
var Xo = [
|
|
1575
|
+
A.ColorStopType.Min,
|
|
1576
|
+
A.ColorStopType.Max,
|
|
1577
|
+
A.ColorStopType.Num,
|
|
1578
|
+
A.ColorStopType.Percent,
|
|
1579
|
+
A.ColorStopType.Percentile,
|
|
1580
|
+
A.ColorStopType.Formula
|
|
1581
|
+
], Jo = Ke((e) => {
|
|
1582
|
+
const { scale: t, onScaleChange: o, readOnly: n, ...r } = e, a = We(), { workbook: l, toColor: i } = b(), s = t.stops ?? [], d = 2 === s.length ? [eo("conditionalFormat.stop.minimum"), eo("conditionalFormat.stop.maximum")] : [
|
|
1583
|
+
eo("conditionalFormat.stop.minimum"),
|
|
1584
|
+
eo("conditionalFormat.stop.midpoint"),
|
|
1585
|
+
eo("conditionalFormat.stop.maximum")
|
|
1586
|
+
];
|
|
1587
|
+
return pt(ht, {
|
|
1588
|
+
sx: {
|
|
1589
|
+
display: "flex",
|
|
1590
|
+
flexDirection: "column",
|
|
1591
|
+
gap: 1
|
|
1592
|
+
},
|
|
1593
|
+
...r,
|
|
1594
|
+
children: [ct(Vo, { children: pt(ht, {
|
|
1595
|
+
sx: {
|
|
1596
|
+
display: "flex",
|
|
1597
|
+
alignItems: "flex-start",
|
|
1598
|
+
gap: 1
|
|
1599
|
+
},
|
|
1600
|
+
children: [ct(ht, {
|
|
1601
|
+
sx: {
|
|
1602
|
+
flex: "1 1 auto",
|
|
1603
|
+
minWidth: 0,
|
|
1604
|
+
display: "flex",
|
|
1605
|
+
gap: .5,
|
|
1606
|
+
flexWrap: "wrap"
|
|
1607
|
+
},
|
|
1608
|
+
children: j.filter((e) => e.stops.length === (2 === s.length ? 2 : 3)).map((e, t) => ct(g, {
|
|
1609
|
+
disabled: n,
|
|
1610
|
+
onClick: () => o(structuredClone(e)),
|
|
1611
|
+
children: ct(D, { rows: p(e.stops ?? [], T, l) })
|
|
1612
|
+
}, t))
|
|
1613
|
+
}), pt(Vt, {
|
|
1614
|
+
exclusive: !0,
|
|
1615
|
+
size: "small",
|
|
1616
|
+
value: 2 === s.length ? 2 : 3,
|
|
1617
|
+
disabled: n,
|
|
1618
|
+
onChange: (e, n) => {
|
|
1619
|
+
n && ((e) => {
|
|
1620
|
+
if (e === s.length || 2 !== e && 3 !== e) return;
|
|
1621
|
+
const n = s.slice();
|
|
1622
|
+
if (3 === e) {
|
|
1623
|
+
let e = "#FFEB84";
|
|
1624
|
+
const t = i(s[0]?.color ?? e)?.toRGBA(), o = i(s[s.length - 1]?.color ?? e)?.toRGBA();
|
|
1625
|
+
if (t && o) {
|
|
1626
|
+
const n = (e) => Math.round(e).toString(16).padStart(2, "0").toUpperCase();
|
|
1627
|
+
e = `#${n((t.red + o.red) / 2)}${n((t.green + o.green) / 2)}${n((t.blue + o.blue) / 2)}`;
|
|
1628
|
+
}
|
|
1629
|
+
n.splice(1, 0, {
|
|
1630
|
+
type: A.ColorStopType.Percentile,
|
|
1631
|
+
value: 50,
|
|
1632
|
+
color: e
|
|
1633
|
+
});
|
|
1634
|
+
} else n.splice(1, n.length - 2);
|
|
1635
|
+
o({
|
|
1636
|
+
...t,
|
|
1637
|
+
stops: n
|
|
1638
|
+
});
|
|
1639
|
+
})(n);
|
|
1640
|
+
},
|
|
1641
|
+
sx: { flex: "0 0 auto" },
|
|
1642
|
+
children: [ct(Kt, {
|
|
1643
|
+
value: 2,
|
|
1644
|
+
sx: {
|
|
1645
|
+
textTransform: "none",
|
|
1646
|
+
pt: .25,
|
|
1647
|
+
pb: .25
|
|
1648
|
+
},
|
|
1649
|
+
children: a("conditionalFormat.twoColor")
|
|
1650
|
+
}), ct(Kt, {
|
|
1651
|
+
value: 3,
|
|
1652
|
+
sx: {
|
|
1653
|
+
textTransform: "none",
|
|
1654
|
+
pt: .25,
|
|
1655
|
+
pb: .25
|
|
1656
|
+
},
|
|
1657
|
+
children: a("conditionalFormat.threeColor")
|
|
1658
|
+
})]
|
|
1659
|
+
})]
|
|
1660
|
+
}) }), ct(Vo, {
|
|
1661
|
+
variant: "config",
|
|
1662
|
+
children: s.map((e, r) => ct(Yo, {
|
|
1663
|
+
label: a(d[Math.min(r, d.length - 1)]),
|
|
1664
|
+
stop: e,
|
|
1665
|
+
allowedTypes: Xo,
|
|
1666
|
+
showColor: !0,
|
|
1667
|
+
readOnly: n,
|
|
1668
|
+
onStopChange: (e) => {
|
|
1669
|
+
const n = s.slice();
|
|
1670
|
+
n[r] = e, o({
|
|
1671
|
+
...t,
|
|
1672
|
+
stops: n
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
}, r))
|
|
1676
|
+
})]
|
|
1677
|
+
});
|
|
1678
|
+
});
|
|
1679
|
+
Jo.displayName = "ColorScaleRulePanel";
|
|
1680
|
+
var Zo = [
|
|
1681
|
+
A.ColorStopType.AutoMin,
|
|
1682
|
+
A.ColorStopType.Min,
|
|
1683
|
+
A.ColorStopType.Num,
|
|
1684
|
+
A.ColorStopType.Percent,
|
|
1685
|
+
A.ColorStopType.Percentile,
|
|
1686
|
+
A.ColorStopType.Formula
|
|
1687
|
+
], en = [
|
|
1688
|
+
A.ColorStopType.AutoMax,
|
|
1689
|
+
A.ColorStopType.Max,
|
|
1690
|
+
A.ColorStopType.Num,
|
|
1691
|
+
A.ColorStopType.Percent,
|
|
1692
|
+
A.ColorStopType.Percentile,
|
|
1693
|
+
A.ColorStopType.Formula
|
|
1694
|
+
], tn = "__auto__", on = Ke((e) => {
|
|
1695
|
+
const { scale: t, onScaleChange: n, readOnly: r, ...a } = e, l = We(), { darkMode: i, toColor: s, propsColorPanel: d } = b(), c = t.stops ?? [], p = s(t.color), m = s(t.negativeFillColor), h = s(t.borderColor), y = s(t.negativeBorderColor), f = t.gradient ?? !1, x = (e) => {
|
|
1696
|
+
const o = { ...t };
|
|
1697
|
+
for (const [t, n] of Object.entries(e)) void 0 === n ? delete o[t] : o[t] = n;
|
|
1698
|
+
n(o);
|
|
1699
|
+
}, v = { backgroundColor: "background.paper" };
|
|
1700
|
+
return pt(ht, {
|
|
1701
|
+
sx: {
|
|
1702
|
+
display: "flex",
|
|
1703
|
+
flexDirection: "column",
|
|
1704
|
+
gap: 1
|
|
1705
|
+
},
|
|
1706
|
+
...a,
|
|
1707
|
+
children: [pt(Vo, { children: [
|
|
1708
|
+
pt(ht, {
|
|
1709
|
+
sx: {
|
|
1710
|
+
display: "flex",
|
|
1711
|
+
alignItems: "flex-start",
|
|
1712
|
+
gap: 1
|
|
1713
|
+
},
|
|
1714
|
+
children: [ct(ht, {
|
|
1715
|
+
sx: {
|
|
1716
|
+
flex: "1 1 auto",
|
|
1717
|
+
minWidth: 0,
|
|
1718
|
+
display: "flex",
|
|
1719
|
+
gap: .5,
|
|
1720
|
+
flexWrap: "wrap"
|
|
1721
|
+
},
|
|
1722
|
+
children: V.filter((e) => (e.gradient ?? !1) === f).map((e, t) => ct(g, {
|
|
1723
|
+
disabled: r,
|
|
1724
|
+
onClick: () => x({
|
|
1725
|
+
color: e.color,
|
|
1726
|
+
gradient: e.gradient,
|
|
1727
|
+
borderColor: e.borderColor
|
|
1728
|
+
}),
|
|
1729
|
+
children: ct(D, { rows: u(e, s(e.color)?.toCSS("adaptive") ?? "var(--sxl-color-primary, rgb(33, 115, 70))") })
|
|
1730
|
+
}, t))
|
|
1731
|
+
}), pt(Vt, {
|
|
1732
|
+
exclusive: !0,
|
|
1733
|
+
size: "small",
|
|
1734
|
+
value: f,
|
|
1735
|
+
disabled: r,
|
|
1736
|
+
onChange: (e, t) => {
|
|
1737
|
+
null !== t && x({ gradient: !!t || void 0 });
|
|
1738
|
+
},
|
|
1739
|
+
sx: { flex: "0 0 auto" },
|
|
1740
|
+
children: [ct(Kt, {
|
|
1741
|
+
value: !1,
|
|
1742
|
+
sx: {
|
|
1743
|
+
textTransform: "none",
|
|
1744
|
+
pt: .25,
|
|
1745
|
+
pb: .25
|
|
1746
|
+
},
|
|
1747
|
+
children: l("conditionalFormat.solidFill")
|
|
1748
|
+
}), ct(Kt, {
|
|
1749
|
+
value: !0,
|
|
1750
|
+
sx: {
|
|
1751
|
+
textTransform: "none",
|
|
1752
|
+
pt: .25,
|
|
1753
|
+
pb: .25
|
|
1754
|
+
},
|
|
1755
|
+
children: l("conditionalFormat.gradientFill")
|
|
1756
|
+
})]
|
|
1757
|
+
})]
|
|
1758
|
+
}),
|
|
1759
|
+
ct(Pt, {
|
|
1760
|
+
control: ct(xt, {
|
|
1761
|
+
size: "small",
|
|
1762
|
+
checked: !1 === t.showValue,
|
|
1763
|
+
disabled: r,
|
|
1764
|
+
onChange: (e) => x({ showValue: !e.target.checked && void 0 })
|
|
1765
|
+
}),
|
|
1766
|
+
label: ct($t, {
|
|
1767
|
+
variant: "body2",
|
|
1768
|
+
children: l("conditionalFormat.showBarsOnly")
|
|
1769
|
+
})
|
|
1770
|
+
}),
|
|
1771
|
+
pt(ht, {
|
|
1772
|
+
sx: {
|
|
1773
|
+
display: "flex",
|
|
1774
|
+
alignItems: "center",
|
|
1775
|
+
gap: .5
|
|
1776
|
+
},
|
|
1777
|
+
children: [
|
|
1778
|
+
ct($t, {
|
|
1779
|
+
variant: "caption",
|
|
1780
|
+
sx: {
|
|
1781
|
+
color: "text.secondary",
|
|
1782
|
+
flex: "0 0 62px"
|
|
1783
|
+
},
|
|
1784
|
+
children: l("conditionalFormat.bar")
|
|
1785
|
+
}),
|
|
1786
|
+
ct(o, {
|
|
1787
|
+
icon: "fill.colored",
|
|
1788
|
+
tooltip: l("conditionalFormat.barColor"),
|
|
1789
|
+
selectedColor: p,
|
|
1790
|
+
disabled: r,
|
|
1791
|
+
onSelectColor: (e) => x({ color: e ? e.toString() : void 0 }),
|
|
1792
|
+
darkMode: i,
|
|
1793
|
+
propsPanel: {
|
|
1794
|
+
disableAlpha: !0,
|
|
1795
|
+
...d
|
|
1796
|
+
}
|
|
1797
|
+
}),
|
|
1798
|
+
ct(o, {
|
|
1799
|
+
icon: "stroke.colored",
|
|
1800
|
+
tooltip: l("conditionalFormat.barBorderColor"),
|
|
1801
|
+
selectedColor: h,
|
|
1802
|
+
disabled: r,
|
|
1803
|
+
onSelectColor: (e) => x({ borderColor: e ? e.toString() : void 0 }),
|
|
1804
|
+
darkMode: i,
|
|
1805
|
+
propsPanel: {
|
|
1806
|
+
disableAlpha: !0,
|
|
1807
|
+
...d
|
|
1808
|
+
}
|
|
1809
|
+
})
|
|
1810
|
+
]
|
|
1811
|
+
}),
|
|
1812
|
+
pt(ht, {
|
|
1813
|
+
sx: {
|
|
1814
|
+
display: "flex",
|
|
1815
|
+
alignItems: "center",
|
|
1816
|
+
gap: .5
|
|
1817
|
+
},
|
|
1818
|
+
children: [
|
|
1819
|
+
ct($t, {
|
|
1820
|
+
variant: "caption",
|
|
1821
|
+
sx: {
|
|
1822
|
+
color: "text.secondary",
|
|
1823
|
+
flex: "0 0 62px"
|
|
1824
|
+
},
|
|
1825
|
+
children: l("conditionalFormat.negative")
|
|
1826
|
+
}),
|
|
1827
|
+
ct(o, {
|
|
1828
|
+
icon: "fill.colored",
|
|
1829
|
+
tooltip: l("conditionalFormat.negativeColor"),
|
|
1830
|
+
selectedColor: m ?? p,
|
|
1831
|
+
disabled: r,
|
|
1832
|
+
onSelectColor: (e) => x({ negativeFillColor: e ? e.toString() : void 0 }),
|
|
1833
|
+
darkMode: i,
|
|
1834
|
+
propsPanel: {
|
|
1835
|
+
disableAlpha: !0,
|
|
1836
|
+
...d
|
|
1837
|
+
}
|
|
1838
|
+
}),
|
|
1839
|
+
ct(o, {
|
|
1840
|
+
icon: "stroke.colored",
|
|
1841
|
+
tooltip: l("conditionalFormat.negativeBorderColor"),
|
|
1842
|
+
selectedColor: y ?? h,
|
|
1843
|
+
disabled: r,
|
|
1844
|
+
onSelectColor: (e) => x({ negativeBorderColor: e ? e.toString() : void 0 }),
|
|
1845
|
+
darkMode: i,
|
|
1846
|
+
propsPanel: {
|
|
1847
|
+
disableAlpha: !0,
|
|
1848
|
+
...d
|
|
1849
|
+
}
|
|
1850
|
+
}),
|
|
1851
|
+
ct(g, {
|
|
1852
|
+
title: l("conditionalFormat.sameAsPositive"),
|
|
1853
|
+
disabled: r || !t.negativeFillColor && !t.negativeBorderColor,
|
|
1854
|
+
onClick: () => x({
|
|
1855
|
+
negativeFillColor: void 0,
|
|
1856
|
+
negativeBorderColor: void 0
|
|
1857
|
+
}),
|
|
1858
|
+
sx: {
|
|
1859
|
+
color: "text.secondary",
|
|
1860
|
+
"&:disabled": { opacity: .4 }
|
|
1861
|
+
},
|
|
1862
|
+
children: ct(fe, {
|
|
1863
|
+
iconKey: "ClearFormats",
|
|
1864
|
+
size: 16
|
|
1865
|
+
})
|
|
1866
|
+
})
|
|
1867
|
+
]
|
|
1868
|
+
}),
|
|
1869
|
+
pt(ht, {
|
|
1870
|
+
sx: {
|
|
1871
|
+
display: "flex",
|
|
1872
|
+
gap: 1,
|
|
1873
|
+
mt: .5
|
|
1874
|
+
},
|
|
1875
|
+
children: [pt(Tt, {
|
|
1876
|
+
size: "small",
|
|
1877
|
+
sx: {
|
|
1878
|
+
flex: 1,
|
|
1879
|
+
minWidth: 0
|
|
1880
|
+
},
|
|
1881
|
+
children: [ct(Nt, { children: l("conditionalFormat.axis") }), pt(At, {
|
|
1882
|
+
label: l("conditionalFormat.axis"),
|
|
1883
|
+
value: t.axisPosition ?? tn,
|
|
1884
|
+
disabled: r,
|
|
1885
|
+
sx: v,
|
|
1886
|
+
onChange: (e) => {
|
|
1887
|
+
const t = e.target.value;
|
|
1888
|
+
x({ axisPosition: t === tn ? void 0 : t });
|
|
1889
|
+
},
|
|
1890
|
+
children: [
|
|
1891
|
+
ct(It, {
|
|
1892
|
+
value: tn,
|
|
1893
|
+
children: l("conditionalFormat.automatic")
|
|
1894
|
+
}),
|
|
1895
|
+
ct(It, {
|
|
1896
|
+
value: "middle",
|
|
1897
|
+
children: l("conditionalFormat.axisMiddle")
|
|
1898
|
+
}),
|
|
1899
|
+
ct(It, {
|
|
1900
|
+
value: "none",
|
|
1901
|
+
children: l("conditionalFormat.axisNone")
|
|
1902
|
+
})
|
|
1903
|
+
]
|
|
1904
|
+
})]
|
|
1905
|
+
}), pt(Tt, {
|
|
1906
|
+
size: "small",
|
|
1907
|
+
sx: {
|
|
1908
|
+
flex: 1,
|
|
1909
|
+
minWidth: 0
|
|
1910
|
+
},
|
|
1911
|
+
children: [ct(Nt, { children: l("conditionalFormat.direction") }), pt(At, {
|
|
1912
|
+
label: l("conditionalFormat.direction"),
|
|
1913
|
+
value: t.direction ?? tn,
|
|
1914
|
+
disabled: r,
|
|
1915
|
+
sx: v,
|
|
1916
|
+
onChange: (e) => {
|
|
1917
|
+
const t = e.target.value;
|
|
1918
|
+
x({ direction: t === tn ? void 0 : t });
|
|
1919
|
+
},
|
|
1920
|
+
children: [
|
|
1921
|
+
ct(It, {
|
|
1922
|
+
value: tn,
|
|
1923
|
+
children: l("conditionalFormat.automatic")
|
|
1924
|
+
}),
|
|
1925
|
+
ct(It, {
|
|
1926
|
+
value: "leftToRight",
|
|
1927
|
+
children: l("conditionalFormat.leftToRight")
|
|
1928
|
+
}),
|
|
1929
|
+
ct(It, {
|
|
1930
|
+
value: "rightToLeft",
|
|
1931
|
+
children: l("conditionalFormat.rightToLeft")
|
|
1932
|
+
})
|
|
1933
|
+
]
|
|
1934
|
+
})]
|
|
1935
|
+
})]
|
|
1936
|
+
})
|
|
1937
|
+
] }), pt(Vo, {
|
|
1938
|
+
variant: "config",
|
|
1939
|
+
children: [ct(Yo, {
|
|
1940
|
+
label: l("conditionalFormat.stop.minimum"),
|
|
1941
|
+
stop: c[0] ?? { type: A.ColorStopType.AutoMin },
|
|
1942
|
+
allowedTypes: Zo,
|
|
1943
|
+
readOnly: r,
|
|
1944
|
+
onStopChange: (e) => {
|
|
1945
|
+
const t = c.slice();
|
|
1946
|
+
t[0] = e, x({ stops: t });
|
|
1947
|
+
}
|
|
1948
|
+
}), ct(Yo, {
|
|
1949
|
+
label: l("conditionalFormat.stop.maximum"),
|
|
1950
|
+
stop: c[1] ?? { type: A.ColorStopType.AutoMax },
|
|
1951
|
+
allowedTypes: en,
|
|
1952
|
+
readOnly: r,
|
|
1953
|
+
onStopChange: (e) => {
|
|
1954
|
+
const t = c.slice();
|
|
1955
|
+
for (; t.length < 2;) t.push({ type: A.ColorStopType.AutoMax });
|
|
1956
|
+
t[1] = e, x({ stops: t });
|
|
1957
|
+
}
|
|
1958
|
+
})]
|
|
1959
|
+
})]
|
|
1960
|
+
});
|
|
1961
|
+
});
|
|
1962
|
+
on.displayName = "DataBarRulePanel";
|
|
1963
|
+
var nn = {
|
|
1964
|
+
directional: eo("conditionalFormat.iconGroup.directional"),
|
|
1965
|
+
shapes: eo("conditionalFormat.iconGroup.shapes"),
|
|
1966
|
+
indicators: eo("conditionalFormat.iconGroup.indicators"),
|
|
1967
|
+
ratings: eo("conditionalFormat.iconGroup.ratings")
|
|
1968
|
+
}, rn = [
|
|
1969
|
+
A.ColorStopType.Percent,
|
|
1970
|
+
A.ColorStopType.Num,
|
|
1971
|
+
A.ColorStopType.Percentile,
|
|
1972
|
+
A.ColorStopType.Formula
|
|
1973
|
+
], an = new Set(Object.values(L.IconSet)), ln = Ke(({ set: e }) => {
|
|
1974
|
+
const t = ae(e);
|
|
1975
|
+
return 0 === t.length ? null : ct(ht, {
|
|
1976
|
+
sx: {
|
|
1977
|
+
display: "flex",
|
|
1978
|
+
alignItems: "center",
|
|
1979
|
+
gap: .75,
|
|
1980
|
+
lineHeight: 1
|
|
1981
|
+
},
|
|
1982
|
+
children: t.map((e, t) => ct(fe, {
|
|
1983
|
+
iconKey: e.iconKey,
|
|
1984
|
+
size: 16,
|
|
1985
|
+
style: {
|
|
1986
|
+
color: e.color,
|
|
1987
|
+
flex: "0 0 auto"
|
|
1988
|
+
}
|
|
1989
|
+
}, t))
|
|
1990
|
+
});
|
|
1991
|
+
});
|
|
1992
|
+
ln.displayName = "IconSetGlyphs";
|
|
1993
|
+
var sn = Ke((e) => {
|
|
1994
|
+
const { scale: t, onScaleChange: o, readOnly: n, ...r } = e, a = We(), l = t.iconSet ?? L.IconSet.TrafficLights3, i = !an.has(l), s = t.stops ?? [], d = (e) => {
|
|
1995
|
+
const n = { ...t };
|
|
1996
|
+
for (const [t, o] of Object.entries(e)) void 0 === o ? delete n[t] : n[t] = o;
|
|
1997
|
+
o(n);
|
|
1998
|
+
}, c = Ue(() => {
|
|
1999
|
+
const e = [];
|
|
2000
|
+
i && e.push(ct(It, {
|
|
2001
|
+
value: l,
|
|
2002
|
+
disabled: !0,
|
|
2003
|
+
children: O.camelToPrettyCase(l)
|
|
2004
|
+
}, l));
|
|
2005
|
+
for (const t of _) {
|
|
2006
|
+
e.push(ct(Ot, {
|
|
2007
|
+
disableSticky: !0,
|
|
2008
|
+
sx: So,
|
|
2009
|
+
children: a(nn[t.key])
|
|
2010
|
+
}, `__header:${t.key}`));
|
|
2011
|
+
for (const o of t.sets) {
|
|
2012
|
+
const t = O.camelToPrettyCase(o);
|
|
2013
|
+
e.push(ct(It, {
|
|
2014
|
+
value: o,
|
|
2015
|
+
"aria-label": t,
|
|
2016
|
+
sx: {
|
|
2017
|
+
pl: 2,
|
|
2018
|
+
py: .75
|
|
2019
|
+
},
|
|
2020
|
+
children: ct(ot, {
|
|
2021
|
+
disableInteractive: !0,
|
|
2022
|
+
placement: "right",
|
|
2023
|
+
title: t,
|
|
2024
|
+
children: ct(ht, {
|
|
2025
|
+
sx: {
|
|
2026
|
+
display: "flex",
|
|
2027
|
+
alignItems: "center",
|
|
2028
|
+
width: "100%"
|
|
2029
|
+
},
|
|
2030
|
+
children: ct(ln, { set: o })
|
|
2031
|
+
})
|
|
2032
|
+
})
|
|
2033
|
+
}, o));
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
return e;
|
|
2037
|
+
}, [
|
|
2038
|
+
a,
|
|
2039
|
+
i,
|
|
2040
|
+
l
|
|
2041
|
+
]);
|
|
2042
|
+
return pt(ht, {
|
|
2043
|
+
sx: {
|
|
2044
|
+
display: "flex",
|
|
2045
|
+
flexDirection: "column",
|
|
2046
|
+
gap: 1
|
|
2047
|
+
},
|
|
2048
|
+
...r,
|
|
2049
|
+
children: [pt(Vo, { children: [
|
|
2050
|
+
pt(Tt, {
|
|
2051
|
+
size: "small",
|
|
2052
|
+
fullWidth: !0,
|
|
2053
|
+
children: [ct(Nt, { children: a("conditionalFormat.iconSet") }), ct(At, {
|
|
2054
|
+
label: a("conditionalFormat.iconSet"),
|
|
2055
|
+
value: l,
|
|
2056
|
+
renderValue: (e) => ct(ht, {
|
|
2057
|
+
sx: {
|
|
2058
|
+
display: "flex",
|
|
2059
|
+
alignItems: "center",
|
|
2060
|
+
minHeight: "1.4375em"
|
|
2061
|
+
},
|
|
2062
|
+
children: 0 === ae(e).length ? O.camelToPrettyCase(e) : ct(ln, { set: e })
|
|
2063
|
+
}),
|
|
2064
|
+
disabled: n || i,
|
|
2065
|
+
sx: { backgroundColor: "background.paper" },
|
|
2066
|
+
onChange: (e) => ((e) => {
|
|
2067
|
+
const t = le(e);
|
|
2068
|
+
let o = s;
|
|
2069
|
+
t !== s.length && (o = re(t)), d({
|
|
2070
|
+
iconSet: e,
|
|
2071
|
+
stops: o
|
|
2072
|
+
});
|
|
2073
|
+
})(e.target.value),
|
|
2074
|
+
children: c
|
|
2075
|
+
})]
|
|
2076
|
+
}),
|
|
2077
|
+
i && ct($t, {
|
|
2078
|
+
variant: "caption",
|
|
2079
|
+
sx: { color: "text.secondary" },
|
|
2080
|
+
children: a("conditionalFormat.adoptedIconSet")
|
|
2081
|
+
}),
|
|
2082
|
+
pt(ht, {
|
|
2083
|
+
sx: {
|
|
2084
|
+
display: "flex",
|
|
2085
|
+
gap: 1
|
|
2086
|
+
},
|
|
2087
|
+
children: [ct(Pt, {
|
|
2088
|
+
control: ct(xt, {
|
|
2089
|
+
size: "small",
|
|
2090
|
+
checked: !1 === t.showValue,
|
|
2091
|
+
disabled: n,
|
|
2092
|
+
onChange: (e) => d({ showValue: !e.target.checked && void 0 })
|
|
2093
|
+
}),
|
|
2094
|
+
label: ct($t, {
|
|
2095
|
+
variant: "body2",
|
|
2096
|
+
children: a("conditionalFormat.showIconsOnly")
|
|
2097
|
+
})
|
|
2098
|
+
}), ct(Pt, {
|
|
2099
|
+
control: ct(xt, {
|
|
2100
|
+
size: "small",
|
|
2101
|
+
checked: t.reverse ?? !1,
|
|
2102
|
+
disabled: n,
|
|
2103
|
+
onChange: (e) => d({ reverse: !!e.target.checked || void 0 })
|
|
2104
|
+
}),
|
|
2105
|
+
label: ct($t, {
|
|
2106
|
+
variant: "body2",
|
|
2107
|
+
children: a("conditionalFormat.reverseIcons")
|
|
2108
|
+
})
|
|
2109
|
+
})]
|
|
2110
|
+
})
|
|
2111
|
+
] }), ct(Vo, {
|
|
2112
|
+
variant: "config",
|
|
2113
|
+
children: s.map((e, t) => ct(Yo, {
|
|
2114
|
+
label: a("conditionalFormat.iconN", { n: t + 1 }),
|
|
2115
|
+
stop: e,
|
|
2116
|
+
allowedTypes: rn,
|
|
2117
|
+
showExclusive: !0,
|
|
2118
|
+
readOnly: n || 0 === t,
|
|
2119
|
+
onStopChange: (e) => {
|
|
2120
|
+
const o = s.slice();
|
|
2121
|
+
o[t] = e, d({ stops: o });
|
|
2122
|
+
}
|
|
2123
|
+
}, t))
|
|
2124
|
+
})]
|
|
2125
|
+
});
|
|
2126
|
+
});
|
|
2127
|
+
sn.displayName = "IconSetRulePanel";
|
|
2128
|
+
var dn = (e, t, o) => v(e, t)?.toCSS("adaptive") ?? o, cn = (e, t, o) => {
|
|
2129
|
+
if (!e) return o;
|
|
2130
|
+
if ("string" == typeof e) return dn(e, t, o);
|
|
2131
|
+
if (e.type === W.Type.None) return o;
|
|
2132
|
+
const n = e, r = e;
|
|
2133
|
+
return dn(r.foreground ?? n.color ?? r.background, t, o);
|
|
2134
|
+
}, pn = Ke((e) => {
|
|
2135
|
+
const { conditionalFormat: t, size: o = 28, style: n, ...r } = e, a = qt(), { workbook: l, themeKey: i, gridColorScheme: s } = b();
|
|
2136
|
+
se(t, "onAnyChange");
|
|
2137
|
+
const c = t.getScale(), m = t.getStyle(), g = Ue(() => {
|
|
2138
|
+
try {
|
|
2139
|
+
return l?.getStyles().getNormal().getFont().toCSS("adaptive") ?? {};
|
|
2140
|
+
} catch {
|
|
2141
|
+
return {};
|
|
2142
|
+
}
|
|
2143
|
+
}, [l, i]), h = {
|
|
2144
|
+
height: `${o}px`,
|
|
2145
|
+
minWidth: 1.7 * o + "px",
|
|
2146
|
+
border: `1px solid ${a.palette.divider}`,
|
|
2147
|
+
borderRadius: "4px",
|
|
2148
|
+
overflow: "hidden",
|
|
2149
|
+
display: "flex",
|
|
2150
|
+
alignItems: "center",
|
|
2151
|
+
justifyContent: "center",
|
|
2152
|
+
flex: "0 0 auto",
|
|
2153
|
+
...n
|
|
2154
|
+
}, f = Ue(() => {
|
|
2155
|
+
if (c?.type === A.ScaleType.ColorScale) return ct(D, { rows: p(c.stops ?? [], T, l) });
|
|
2156
|
+
if (c?.type === A.ScaleType.DataBar) return ct(D, { rows: u(c, dn(c.color, l, x), c.borderColor ? dn(c.borderColor, l, x) : void 0) });
|
|
2157
|
+
if (c?.type === A.ScaleType.IconSet) {
|
|
2158
|
+
const e = c.stops?.length ?? 3, t = [
|
|
2159
|
+
"#D6604D",
|
|
2160
|
+
"#F5A623",
|
|
2161
|
+
"#57A45B",
|
|
2162
|
+
"#4472C4",
|
|
2163
|
+
"#7F7F7F"
|
|
2164
|
+
], o = [];
|
|
2165
|
+
for (let n = 0; n < e; n++) o.push(ct(ht, { sx: {
|
|
2166
|
+
width: "12px",
|
|
2167
|
+
height: "12px",
|
|
2168
|
+
borderRadius: "50%",
|
|
2169
|
+
backgroundColor: t[n % t.length]
|
|
2170
|
+
} }, n));
|
|
2171
|
+
return c.reverse && o.reverse(), ct(ht, {
|
|
2172
|
+
sx: {
|
|
2173
|
+
display: "flex",
|
|
2174
|
+
alignItems: "center",
|
|
2175
|
+
justifyContent: "center",
|
|
2176
|
+
gap: "3px",
|
|
2177
|
+
width: "100%",
|
|
2178
|
+
height: "100%"
|
|
2179
|
+
},
|
|
2180
|
+
children: o
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
const e = m?.font, t = e?.underline && e.underline !== B.UnderlineStyle.None;
|
|
2184
|
+
return ct(ht, {
|
|
2185
|
+
sx: {
|
|
2186
|
+
width: "100%",
|
|
2187
|
+
height: "100%",
|
|
2188
|
+
display: "flex",
|
|
2189
|
+
alignItems: "center",
|
|
2190
|
+
justifyContent: "center",
|
|
2191
|
+
...g,
|
|
2192
|
+
backgroundColor: cn(m?.fill, l, "transparent"),
|
|
2193
|
+
...e?.color && "auto" !== e.color ? { color: dn(e.color, l, y) } : null,
|
|
2194
|
+
...e?.weight ? { fontWeight: e.weight } : null,
|
|
2195
|
+
...e?.style ? { fontStyle: e.style } : null,
|
|
2196
|
+
textDecoration: [t ? "underline" : "", e?.strike ? "line-through" : ""].join(" ").trim() || "none",
|
|
2197
|
+
fontSize: `${Math.round(.5 * o)}px`,
|
|
2198
|
+
lineHeight: 1,
|
|
2199
|
+
outline: m?.border ? `1px solid ${dn(Object.values(m.border)[0]?.color, l, d)}` : void 0,
|
|
2200
|
+
outlineOffset: "-3px"
|
|
2201
|
+
},
|
|
2202
|
+
children: "Aa"
|
|
2203
|
+
});
|
|
2204
|
+
}, [
|
|
2205
|
+
c,
|
|
2206
|
+
m,
|
|
2207
|
+
o,
|
|
2208
|
+
g,
|
|
2209
|
+
l,
|
|
2210
|
+
i
|
|
2211
|
+
]);
|
|
2212
|
+
return ct("div", {
|
|
2213
|
+
className: "sxl-cf-rule-preview",
|
|
2214
|
+
"data-sxl-theme-surface": "grid",
|
|
2215
|
+
"data-sxl-theme-mode": s,
|
|
2216
|
+
style: h,
|
|
2217
|
+
...r,
|
|
2218
|
+
children: f
|
|
2219
|
+
});
|
|
2220
|
+
});
|
|
2221
|
+
pn.displayName = "RulePreview";
|
|
2222
|
+
var un = Ke((e) => {
|
|
2223
|
+
const { conditionalFormat: t, label: o, helperText: n } = e, a = We(), l = Me();
|
|
2224
|
+
se(t, ["onAnchorCoordsChange", "onAnyChange"]);
|
|
2225
|
+
const i = t.getRanges();
|
|
2226
|
+
return ct(r, {
|
|
2227
|
+
grammar: "reference",
|
|
2228
|
+
value: i,
|
|
2229
|
+
allowMulti: !0,
|
|
2230
|
+
allowCrossSheet: !1,
|
|
2231
|
+
home: Ue(() => {
|
|
2232
|
+
if (i.isInvalid()) return;
|
|
2233
|
+
const e = i.at(0).getCoords();
|
|
2234
|
+
return {
|
|
2235
|
+
rowIndex: e.rowStart,
|
|
2236
|
+
colIndex: e.colStart,
|
|
2237
|
+
scope: i.at(0).getSheet().getName()
|
|
2238
|
+
};
|
|
2239
|
+
}, [i]),
|
|
2240
|
+
pickAs: "absolute",
|
|
2241
|
+
changeOn: "done",
|
|
2242
|
+
onDone: Ve((e) => {
|
|
2243
|
+
const o = e?.getReferences();
|
|
2244
|
+
if (o && !o.isInvalid()) try {
|
|
2245
|
+
t.setRanges(o);
|
|
2246
|
+
} catch (e) {
|
|
2247
|
+
l.showMessage?.(e.message, { type: Ce.Error });
|
|
2248
|
+
}
|
|
2249
|
+
}, [t, l]),
|
|
2250
|
+
label: void 0 === o ? a("conditionalFormat.applyTo") : o,
|
|
2251
|
+
helperText: n,
|
|
2252
|
+
disabled: t.isProtected()
|
|
2253
|
+
});
|
|
2254
|
+
});
|
|
2255
|
+
un.displayName = "ConditionalFormatRangeField";
|
|
2256
|
+
var mn = (e, t) => {
|
|
2257
|
+
const o = e.getCondition()?.toString();
|
|
2258
|
+
if (o) return o;
|
|
2259
|
+
const n = e.getScale();
|
|
2260
|
+
return n ? O.camelToPrettyCase(n.type) : t("conditionalFormat.noCondition");
|
|
2261
|
+
}, gn = {
|
|
2262
|
+
classic: eo("conditionalFormat.tab.classic"),
|
|
2263
|
+
[A.ScaleType.ColorScale]: eo("conditionalFormat.tab.colorScale"),
|
|
2264
|
+
[A.ScaleType.DataBar]: eo("conditionalFormat.tab.dataBars"),
|
|
2265
|
+
[A.ScaleType.IconSet]: eo("conditionalFormat.tab.iconSets")
|
|
2266
|
+
}, hn = Ke((e) => {
|
|
2267
|
+
const { conditionalFormat: t } = e, o = We();
|
|
2268
|
+
se(t, "onAnyChange");
|
|
2269
|
+
const n = t.getScale(), r = t.getCondition(), a = t.getStyle(), l = t.isProtected(), i = n?.type ?? "classic", d = qe({ scales: {} }), c = (e) => {
|
|
2270
|
+
t.update({ scale: e });
|
|
2271
|
+
};
|
|
2272
|
+
return pt(Rt, {
|
|
2273
|
+
tabIndex: 0,
|
|
2274
|
+
className: s["editor-panel"],
|
|
2275
|
+
sx: {
|
|
2276
|
+
gap: (e) => e.spacing(1),
|
|
2277
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
2278
|
+
paddingBottom: (e) => e.spacing(2),
|
|
2279
|
+
paddingLeft: (e) => e.spacing(1.5),
|
|
2280
|
+
paddingRight: (e) => e.spacing(1.5),
|
|
2281
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
2282
|
+
borderRadius: (e) => e.spacing(1.25),
|
|
2283
|
+
overflow: "auto"
|
|
2284
|
+
},
|
|
2285
|
+
children: [
|
|
2286
|
+
pt(ht, {
|
|
2287
|
+
sx: {
|
|
2288
|
+
display: "flex",
|
|
2289
|
+
flexDirection: "column",
|
|
2290
|
+
gap: (e) => e.spacing(1.75),
|
|
2291
|
+
margin: (e) => e.spacing(1.25),
|
|
2292
|
+
marginBottom: 0
|
|
2293
|
+
},
|
|
2294
|
+
children: [pt(ht, {
|
|
2295
|
+
sx: {
|
|
2296
|
+
display: "flex",
|
|
2297
|
+
alignItems: "center",
|
|
2298
|
+
gap: (e) => e.spacing(1.5)
|
|
2299
|
+
},
|
|
2300
|
+
children: [ct(pn, {
|
|
2301
|
+
conditionalFormat: t,
|
|
2302
|
+
size: 48
|
|
2303
|
+
}), ct($t, {
|
|
2304
|
+
variant: "body2",
|
|
2305
|
+
sx: {
|
|
2306
|
+
minWidth: 0,
|
|
2307
|
+
wordBreak: "break-word"
|
|
2308
|
+
},
|
|
2309
|
+
children: mn(t, o)
|
|
2310
|
+
})]
|
|
2311
|
+
}), ct(un, { conditionalFormat: t })]
|
|
2312
|
+
}),
|
|
2313
|
+
ct(Lt, {
|
|
2314
|
+
value: i,
|
|
2315
|
+
onChange: (e, o) => {
|
|
2316
|
+
l || ((e) => {
|
|
2317
|
+
if (e !== i) if ("classic" === i ? (d.current.condition = r?.toJSON() ?? null, d.current.style = a) : n && (d.current.scales[n.type] = n), "classic" === e) t.update({
|
|
2318
|
+
condition: d.current.condition ?? {
|
|
2319
|
+
operator: R.BuiltInOperatorNames.Between,
|
|
2320
|
+
param: null
|
|
2321
|
+
},
|
|
2322
|
+
style: d.current.style ?? null,
|
|
2323
|
+
scale: null
|
|
2324
|
+
});
|
|
2325
|
+
else {
|
|
2326
|
+
const o = d.current.scales[e] ?? (e === A.ScaleType.ColorScale ? te() : e === A.ScaleType.DataBar ? oe() : ne());
|
|
2327
|
+
t.update({
|
|
2328
|
+
scale: o,
|
|
2329
|
+
condition: null,
|
|
2330
|
+
style: null
|
|
2331
|
+
});
|
|
2332
|
+
}
|
|
2333
|
+
})(o);
|
|
2334
|
+
},
|
|
2335
|
+
variant: "fullWidth",
|
|
2336
|
+
sx: {
|
|
2337
|
+
minHeight: "36px",
|
|
2338
|
+
borderBottom: 1,
|
|
2339
|
+
borderColor: "divider",
|
|
2340
|
+
"& .MuiTab-root": {
|
|
2341
|
+
minHeight: "36px",
|
|
2342
|
+
textTransform: "none",
|
|
2343
|
+
pt: .5,
|
|
2344
|
+
pb: .5,
|
|
2345
|
+
px: .5,
|
|
2346
|
+
minWidth: 0
|
|
2347
|
+
}
|
|
2348
|
+
},
|
|
2349
|
+
children: Object.keys(gn).map((e) => ct(Bt, {
|
|
2350
|
+
value: e,
|
|
2351
|
+
label: o(gn[e])
|
|
2352
|
+
}, e))
|
|
2353
|
+
}),
|
|
2354
|
+
"classic" === i && pt(dt, { children: [ct(Ho, {
|
|
2355
|
+
format: a,
|
|
2356
|
+
readOnly: l,
|
|
2357
|
+
onFormatChange: (e) => t.update({ style: e })
|
|
2358
|
+
}), ct(Ko, {
|
|
2359
|
+
selectorTitle: o("conditionalFormat.highlight"),
|
|
2360
|
+
condition: r,
|
|
2361
|
+
readOnly: l,
|
|
2362
|
+
onConditionChange: (e) => t.setCondition(e)
|
|
2363
|
+
})] }),
|
|
2364
|
+
n?.type === A.ScaleType.ColorScale && ct(Jo, {
|
|
2365
|
+
scale: n,
|
|
2366
|
+
onScaleChange: c,
|
|
2367
|
+
readOnly: l
|
|
2368
|
+
}),
|
|
2369
|
+
n?.type === A.ScaleType.DataBar && ct(on, {
|
|
2370
|
+
scale: n,
|
|
2371
|
+
onScaleChange: c,
|
|
2372
|
+
readOnly: l
|
|
2373
|
+
}),
|
|
2374
|
+
n?.type === A.ScaleType.IconSet && ct(sn, {
|
|
2375
|
+
scale: n,
|
|
2376
|
+
onScaleChange: c,
|
|
2377
|
+
readOnly: l
|
|
2378
|
+
}),
|
|
2379
|
+
"classic" === i && ct(ht, {
|
|
2380
|
+
sx: {
|
|
2381
|
+
pl: 2,
|
|
2382
|
+
pr: 2,
|
|
2383
|
+
border: 1,
|
|
2384
|
+
borderColor: "divider",
|
|
2385
|
+
borderRadius: 1
|
|
2386
|
+
},
|
|
2387
|
+
children: ct(Pt, {
|
|
2388
|
+
control: ct(xt, {
|
|
2389
|
+
checked: t.isStopIfTrue(),
|
|
2390
|
+
disabled: l,
|
|
2391
|
+
onChange: (e) => t.setStopIfTrue(e.target.checked)
|
|
2392
|
+
}),
|
|
2393
|
+
label: o("conditionalFormat.stopIfTrue")
|
|
2394
|
+
})
|
|
2395
|
+
})
|
|
2396
|
+
]
|
|
2397
|
+
});
|
|
2398
|
+
});
|
|
2399
|
+
hn.displayName = "ConditionalFormatEditorPanel";
|
|
2400
|
+
var yn = Ke(({ item: e }) => {
|
|
2401
|
+
const t = We();
|
|
2402
|
+
return se(e, "onAnyChange"), !e.isStopIfTrue() || e.getScale() ? null : ct(ht, {
|
|
2403
|
+
sx: {
|
|
2404
|
+
display: "inline-flex",
|
|
2405
|
+
alignItems: "center",
|
|
2406
|
+
alignSelf: "flex-start",
|
|
2407
|
+
px: .75,
|
|
2408
|
+
py: .25,
|
|
2409
|
+
border: 1,
|
|
2410
|
+
borderColor: "divider",
|
|
2411
|
+
borderRadius: 1,
|
|
2412
|
+
color: "text.secondary"
|
|
2413
|
+
},
|
|
2414
|
+
children: ct($t, {
|
|
2415
|
+
variant: "caption",
|
|
2416
|
+
children: t("conditionalFormat.stopIfTrue")
|
|
2417
|
+
})
|
|
2418
|
+
});
|
|
2419
|
+
});
|
|
2420
|
+
yn.displayName = "StopIfTrueBadge";
|
|
2421
|
+
var bn = {
|
|
2422
|
+
key: "conditional-format",
|
|
2423
|
+
messageKeys: {
|
|
2424
|
+
none: eo("conditionalFormat.none"),
|
|
2425
|
+
addPrompt: eo("conditionalFormat.addPrompt"),
|
|
2426
|
+
heading: eo("conditionalFormat.heading"),
|
|
2427
|
+
insert: eo("conditionalFormat.insert"),
|
|
2428
|
+
new: eo("conditionalFormat.new"),
|
|
2429
|
+
moveUp: eo("conditionalFormat.moveUp"),
|
|
2430
|
+
moveDown: eo("conditionalFormat.moveDown"),
|
|
2431
|
+
edit: eo("conditionalFormat.edit"),
|
|
2432
|
+
duplicate: eo("conditionalFormat.duplicate"),
|
|
2433
|
+
delete: eo("conditionalFormat.delete"),
|
|
2434
|
+
cancel: eo("conditionalFormat.cancel"),
|
|
2435
|
+
save: eo("conditionalFormat.save")
|
|
2436
|
+
},
|
|
2437
|
+
getCollection: (e) => e.getConditionalFormats(),
|
|
2438
|
+
changeEvents: ["onConditionalFormatsChange"],
|
|
2439
|
+
applyUpdate: (e, t) => {
|
|
2440
|
+
const o = t.toJSON() ?? {};
|
|
2441
|
+
e.update({
|
|
2442
|
+
condition: o.condition ?? null,
|
|
2443
|
+
style: o.style ?? null,
|
|
2444
|
+
scale: o.scale ?? null,
|
|
2445
|
+
stopIfTrue: o.stopIfTrue ?? !1
|
|
2446
|
+
});
|
|
2447
|
+
const n = t.getRanges();
|
|
2448
|
+
n.isInvalid() || n.toString() === e.getRanges().toString() || e.setRanges(n);
|
|
2449
|
+
},
|
|
2450
|
+
applySeed: (e, t) => {
|
|
2451
|
+
e.update({
|
|
2452
|
+
condition: t.condition ?? null,
|
|
2453
|
+
style: t.style ?? null,
|
|
2454
|
+
scale: t.scale ?? null,
|
|
2455
|
+
stopIfTrue: t.stopIfTrue ?? !1
|
|
2456
|
+
});
|
|
2457
|
+
},
|
|
2458
|
+
getCardTitle: mn,
|
|
2459
|
+
CardMedia: ({ item: e }) => ct(pn, {
|
|
2460
|
+
conditionalFormat: e,
|
|
2461
|
+
size: 32
|
|
2462
|
+
}),
|
|
2463
|
+
CardSubtitle: ({ item: e }) => ct(un, {
|
|
2464
|
+
conditionalFormat: e,
|
|
2465
|
+
helperText: null
|
|
2466
|
+
}),
|
|
2467
|
+
CardBody: yn,
|
|
2468
|
+
EditorBody: ({ item: e }) => ct(hn, { conditionalFormat: e })
|
|
2469
|
+
}, fn = Ke(Le((e, t) => {
|
|
2470
|
+
const { workbook: o, args: n, ...r } = e;
|
|
2471
|
+
return ct(so, {
|
|
2472
|
+
ref: t,
|
|
2473
|
+
workbook: o,
|
|
2474
|
+
descriptor: bn,
|
|
2475
|
+
args: n,
|
|
2476
|
+
dragReorder: !0,
|
|
2477
|
+
...r
|
|
2478
|
+
});
|
|
2479
|
+
}));
|
|
2480
|
+
fn.displayName = "ConditionalFormatDetailsPanel";
|
|
2481
|
+
var xn = (e) => {
|
|
2482
|
+
const { model: t, entryKey: o, frame: n, args: r, ref: a, ...l } = e;
|
|
2483
|
+
return ct(fn, {
|
|
2484
|
+
ref: a,
|
|
2485
|
+
workbook: t,
|
|
2486
|
+
args: r,
|
|
2487
|
+
...l
|
|
2488
|
+
});
|
|
2489
|
+
}, vn = {
|
|
2490
|
+
card: "_card_h0jnt_7",
|
|
2491
|
+
actionRoot: "_actionRoot_h0jnt_11",
|
|
2492
|
+
icons: "_icons_h0jnt_16",
|
|
2493
|
+
expand: "_expand_h0jnt_22",
|
|
2494
|
+
expandOpen: "_expandOpen_h0jnt_29",
|
|
2495
|
+
stackTraceContainer: "_stackTraceContainer_h0jnt_33",
|
|
2496
|
+
paper: "_paper_h0jnt_37",
|
|
2497
|
+
checkIcon: "_checkIcon_h0jnt_42",
|
|
2498
|
+
button: "_button_h0jnt_47"
|
|
2499
|
+
}, Cn = Ke(Le((e, t) => {
|
|
2500
|
+
const { id: o, message: n, iconVariant: r, error: a, hideIconVariant: l, ...i } = e, s = We(), { closeSnackbar: d } = io(), [c, p] = He(!1), u = a ? Yt.collectErrorChain(a, !0)?.[0]?.error : void 0, m = u && !(u instanceof Xt), g = Ve(() => {
|
|
2501
|
+
p((e) => !e);
|
|
2502
|
+
}, []), h = Ve(() => {
|
|
2503
|
+
d(o);
|
|
2504
|
+
}, [o, d]);
|
|
2505
|
+
let y = u?.message;
|
|
2506
|
+
return !y && ze(n) && (y = n), y || "string" != typeof n || (y = n), y || (y = `Unknown Error: ${n}`), ct(ao, {
|
|
2507
|
+
ref: t,
|
|
2508
|
+
className: oo(vn.root, "error-snackbar"),
|
|
2509
|
+
children: pt(bt, {
|
|
2510
|
+
className: vn.card,
|
|
2511
|
+
style: {
|
|
2512
|
+
backgroundColor: "var(--sxl-color-error)",
|
|
2513
|
+
color: "var(--sxl-color-error-content)",
|
|
2514
|
+
border: "1px solid var(--sxl-color-error)"
|
|
2515
|
+
},
|
|
2516
|
+
children: [pt(ft, {
|
|
2517
|
+
className: vn.actionRoot,
|
|
2518
|
+
children: [
|
|
2519
|
+
l ? null : r?.error,
|
|
2520
|
+
ct($t, {
|
|
2521
|
+
variant: "body2",
|
|
2522
|
+
component: "div",
|
|
2523
|
+
className: vn.typography,
|
|
2524
|
+
children: y
|
|
2525
|
+
}),
|
|
2526
|
+
ct("div", { style: { flex: "1 1 auto" } }),
|
|
2527
|
+
pt("div", {
|
|
2528
|
+
className: vn.icons,
|
|
2529
|
+
children: [m ? ct(Ft, {
|
|
2530
|
+
"aria-label": s("toast.showMore"),
|
|
2531
|
+
size: "small",
|
|
2532
|
+
className: oo(vn.expand, { [vn.expandOpen]: c }),
|
|
2533
|
+
onClick: g,
|
|
2534
|
+
children: ct(fe, { iconKey: "ExpandMore" })
|
|
2535
|
+
}) : null, ct(Ft, {
|
|
2536
|
+
size: "small",
|
|
2537
|
+
className: vn.expand,
|
|
2538
|
+
onClick: h,
|
|
2539
|
+
children: ct(fe, {
|
|
2540
|
+
iconKey: "Close",
|
|
2541
|
+
style: { transform: "scale(0.8)" }
|
|
2542
|
+
})
|
|
2543
|
+
})]
|
|
2544
|
+
})
|
|
2545
|
+
]
|
|
2546
|
+
}), m ? ct(Ct, {
|
|
2547
|
+
in: c,
|
|
2548
|
+
timeout: "auto",
|
|
2549
|
+
children: ct("div", {
|
|
2550
|
+
className: vn.stackTraceContainer,
|
|
2551
|
+
style: {
|
|
2552
|
+
backgroundColor: "color-mix(in srgb, var(--sxl-color-error) 90%, var(--sxl-color-base-100))",
|
|
2553
|
+
borderTop: "1px solid var(--sxl-color-error)"
|
|
2554
|
+
},
|
|
2555
|
+
children: ct(nt, {
|
|
2556
|
+
error: a,
|
|
2557
|
+
hideLineNumbers: !0
|
|
2558
|
+
})
|
|
2559
|
+
})
|
|
2560
|
+
}) : null]
|
|
2561
|
+
})
|
|
2562
|
+
});
|
|
2563
|
+
}));
|
|
2564
|
+
Cn.displayName = "ToastError";
|
|
2565
|
+
var kn = ct(() => ct(et, {
|
|
2566
|
+
label: "SheetXL",
|
|
2567
|
+
description: We()("logo.description"),
|
|
2568
|
+
children: ct(ht, {
|
|
2569
|
+
component: "a",
|
|
2570
|
+
href: "https://www.sheetxl.com",
|
|
2571
|
+
target: "_blank",
|
|
2572
|
+
rel: "noopener noreferrer",
|
|
2573
|
+
sx: {
|
|
2574
|
+
display: "inline-flex",
|
|
2575
|
+
width: "24px",
|
|
2576
|
+
height: "24px",
|
|
2577
|
+
marginBottom: "4px",
|
|
2578
|
+
marginLeft: "6px",
|
|
2579
|
+
cursor: "pointer"
|
|
2580
|
+
},
|
|
2581
|
+
children: ct(U, { style: {
|
|
2582
|
+
width: "24px",
|
|
2583
|
+
height: "24px"
|
|
2584
|
+
} })
|
|
2585
|
+
})
|
|
2586
|
+
}), {}), wn = Ke(Le((e, t) => {
|
|
2587
|
+
const { workbook: o, className: n, logo: r = kn, mainElement: a, startElement: l, endElement: i, ...s } = e, [d, { width: c }] = ro(), p = c < 530, u = qe(null);
|
|
2588
|
+
return ct(ht, {
|
|
2589
|
+
...s,
|
|
2590
|
+
ref: no([
|
|
2591
|
+
u,
|
|
2592
|
+
d,
|
|
2593
|
+
t
|
|
2594
|
+
]),
|
|
2595
|
+
className: n,
|
|
2596
|
+
children: S({
|
|
2597
|
+
isCompact: p,
|
|
2598
|
+
wrapperSelect: (e) => pt(ht, {
|
|
2599
|
+
sx: {
|
|
2600
|
+
display: "grid",
|
|
2601
|
+
gridTemplateColumns: "1fr auto 1fr",
|
|
2602
|
+
flex: "1",
|
|
2603
|
+
alignItems: "stretch",
|
|
2604
|
+
gap: (e) => e.spacing(1),
|
|
2605
|
+
paddingLeft: (e) => e.spacing(1),
|
|
2606
|
+
paddingRight: (e) => e.spacing(1)
|
|
2607
|
+
},
|
|
2608
|
+
children: [
|
|
2609
|
+
pt(ht, {
|
|
2610
|
+
sx: {
|
|
2611
|
+
display: "flex",
|
|
2612
|
+
flexDirection: "row",
|
|
2613
|
+
alignItems: "center",
|
|
2614
|
+
justifyContent: "start",
|
|
2615
|
+
gap: (e) => e.spacing(.5)
|
|
2616
|
+
},
|
|
2617
|
+
children: [r, pt(ht, {
|
|
2618
|
+
sx: {
|
|
2619
|
+
display: "flex",
|
|
2620
|
+
flexDirection: "row",
|
|
2621
|
+
alignItems: "center",
|
|
2622
|
+
gap: (e) => e.spacing(.25)
|
|
2623
|
+
},
|
|
2624
|
+
children: [l, e]
|
|
2625
|
+
})]
|
|
2626
|
+
}),
|
|
2627
|
+
ct(ht, {
|
|
2628
|
+
sx: {
|
|
2629
|
+
display: "flex",
|
|
2630
|
+
flexDirection: "row",
|
|
2631
|
+
minWidth: 0,
|
|
2632
|
+
overflow: "hidden",
|
|
2633
|
+
alignItems: "center",
|
|
2634
|
+
justifyContent: "center"
|
|
2635
|
+
},
|
|
2636
|
+
children: a
|
|
2637
|
+
}),
|
|
2638
|
+
ct(ht, {
|
|
2639
|
+
sx: {
|
|
2640
|
+
display: "flex",
|
|
2641
|
+
alignItems: "center",
|
|
2642
|
+
justifyContent: "end"
|
|
2643
|
+
},
|
|
2644
|
+
children: i
|
|
2645
|
+
})
|
|
2646
|
+
]
|
|
2647
|
+
})
|
|
2648
|
+
})
|
|
2649
|
+
});
|
|
2650
|
+
}));
|
|
2651
|
+
wn.displayName = "StudioToolbar";
|
|
2652
|
+
function Sn(e, t) {
|
|
2653
|
+
const { workbook: o, setWorkbook: n, workbookTitle: r = "export", isDirty: a, notifier: l } = t;
|
|
2654
|
+
let i = !1;
|
|
2655
|
+
const s = async (e = null, t = null, o = null) => {
|
|
2656
|
+
const n = [], r = {
|
|
2657
|
+
source: e && "string" != typeof e ? e : null,
|
|
2658
|
+
typedCreateWorkbookOptions: t ?? void 0,
|
|
2659
|
+
onPassword: async ({ origin: e, validate: t }) => {
|
|
2660
|
+
const o = await l.showInput({
|
|
2661
|
+
title: to("dialog.password.title"),
|
|
2662
|
+
description: to("dialog.password.open.description", { name: e.getName() ?? "" }),
|
|
2663
|
+
inputType: "password",
|
|
2664
|
+
options: [{
|
|
2665
|
+
id: "Open",
|
|
2666
|
+
label: () => to("dialog.open")
|
|
2667
|
+
}, "Cancel"],
|
|
2668
|
+
defaultOption: "Open",
|
|
2669
|
+
onValidateInput: async (e, o) => void 0 === o ? { valid: !0 } : e ? await t(e) ? { valid: !0 } : {
|
|
2670
|
+
valid: !1,
|
|
2671
|
+
message: to("dialog.password.open.retry")
|
|
2672
|
+
} : {
|
|
2673
|
+
valid: !1,
|
|
2674
|
+
message: to("dialog.password.open.required")
|
|
2675
|
+
}
|
|
2676
|
+
});
|
|
2677
|
+
return "Open" === o?.option ? o.input ?? null : null;
|
|
2678
|
+
},
|
|
2679
|
+
progress: { onWarning: (e) => {
|
|
2680
|
+
n.push(e);
|
|
2681
|
+
} }
|
|
2682
|
+
};
|
|
2683
|
+
let a;
|
|
2684
|
+
o && (r.progress.onStart = o);
|
|
2685
|
+
let i = -5;
|
|
2686
|
+
return Y.read({
|
|
2687
|
+
...r,
|
|
2688
|
+
progress: {
|
|
2689
|
+
async onStart(e, t) {
|
|
2690
|
+
await r?.progress?.onStart?.(e, t), a = await l?.showBusy?.(to("workbook.opening", { name: e?.getName() ?? "" })), t && a?.setProgress?.(0, t);
|
|
2691
|
+
},
|
|
2692
|
+
onProgress(e, t) {
|
|
2693
|
+
if (!t) return;
|
|
2694
|
+
const o = Math.min(100, Math.round(e / t * 100));
|
|
2695
|
+
if (o >= 100) {
|
|
2696
|
+
if (100 === i) return;
|
|
2697
|
+
i = 100, a?.setProgress?.(e, t);
|
|
2698
|
+
return;
|
|
2699
|
+
}
|
|
2700
|
+
o - i < 5 || (i = o, a?.setProgress?.(e, t));
|
|
2701
|
+
},
|
|
2702
|
+
onComplete() {
|
|
2703
|
+
a?.(), n.length > 0 && (l.showMessage(to("workbook.importWarnings")), console.warn("Import warnings:\n" + n.join("\n")));
|
|
2704
|
+
},
|
|
2705
|
+
onWarning(e) {
|
|
2706
|
+
l.showMessage(e, { type: Ce.Info });
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
});
|
|
2710
|
+
}, d = async (e, t, o = !1) => {
|
|
2711
|
+
let n;
|
|
2712
|
+
const a = {
|
|
2713
|
+
format: t?.key,
|
|
2714
|
+
progress: {
|
|
2715
|
+
async onStart(e) {
|
|
2716
|
+
n = await l?.showBusy?.(to("workbook.saving", { name: e?.getName() ?? "" }));
|
|
2717
|
+
},
|
|
2718
|
+
onComplete() {
|
|
2719
|
+
n?.();
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
};
|
|
2723
|
+
let i;
|
|
2724
|
+
if (o) {
|
|
2725
|
+
const o = e.getOrigin(), n = t?.exts?.[0] ?? (o.getExtension() || "sxl"), l = `${r || o.getName() || to("workbook.defaultName")}.${n}`;
|
|
2726
|
+
i = await Y.writeAs(e, l, {
|
|
2727
|
+
...a,
|
|
2728
|
+
prompt: !0
|
|
2729
|
+
});
|
|
2730
|
+
} else i = await Y.write(e, void 0, a);
|
|
2731
|
+
return !!i;
|
|
2732
|
+
};
|
|
2733
|
+
return e.updateCommand("newWorkbook", { callback: () => {
|
|
2734
|
+
window.open(window.origin.toString(), "sheetxl-" + Ht.uuidV4(), "popup=true");
|
|
2735
|
+
} }), e.updateCommand("closeWorkbook", { callback: async () => {
|
|
2736
|
+
a() && "Close" !== await l.showOptions({
|
|
2737
|
+
title: to("dialog.confirm.title"),
|
|
2738
|
+
description: to("dialog.unsavedChanges"),
|
|
2739
|
+
options: [{
|
|
2740
|
+
id: "Close",
|
|
2741
|
+
label: () => to("dialog.close")
|
|
2742
|
+
}, "Cancel"],
|
|
2743
|
+
defaultOption: "Cancel"
|
|
2744
|
+
}) || window.close();
|
|
2745
|
+
} }), (async () => {
|
|
2746
|
+
const t = await Y.getWriteFormats();
|
|
2747
|
+
if (i) return;
|
|
2748
|
+
const r = Y.canWrite(), c = Y.canRead();
|
|
2749
|
+
if (r) {
|
|
2750
|
+
const n = (e) => {
|
|
2751
|
+
const n = e ? t.find((t) => t.key === e) : void 0;
|
|
2752
|
+
d(o, n, !0).catch((e) => l.showError(e));
|
|
2753
|
+
};
|
|
2754
|
+
e.updateCommand("saveWorkbook", { callback: () => {
|
|
2755
|
+
d(o, void 0, !1).catch((e) => l.showError(e));
|
|
2756
|
+
} }), e.updateCommand("saveWorkbookAs", { callback: (e) => {
|
|
2757
|
+
n(e);
|
|
2758
|
+
} }), e.updateCommand("protectWorkbook", {
|
|
2759
|
+
tags: ["noTransaction", "noRepeat"],
|
|
2760
|
+
callback: async () => {
|
|
2761
|
+
const e = o.getOrigin(), t = o.getProtection(), n = t.hasPassword();
|
|
2762
|
+
await l.showWindow("protectWorkbook", {
|
|
2763
|
+
initialValue: {
|
|
2764
|
+
encrypt: e.isEncrypted(),
|
|
2765
|
+
encryptPassword: e.isEncrypted() ? null : "",
|
|
2766
|
+
structure: t.isLocked(),
|
|
2767
|
+
structurePassword: n ? null : "",
|
|
2768
|
+
lockStructure: !t.isStructureAllowed(),
|
|
2769
|
+
lockWindows: !t.isWindowsAllowed()
|
|
2770
|
+
},
|
|
2771
|
+
onApply: async (o) => {
|
|
2772
|
+
try {
|
|
2773
|
+
o.encrypt ? null !== o.encryptPassword && "" !== o.encryptPassword && e.setPassword(o.encryptPassword) : e.setPassword(null);
|
|
2774
|
+
const n = o.structure;
|
|
2775
|
+
!n && t.isLocked() ? await t.unlock(o.structurePassword ?? void 0) : n && !t.isLocked() && await t.lock({
|
|
2776
|
+
structure: o.lockStructure,
|
|
2777
|
+
windows: o.lockWindows
|
|
2778
|
+
}, o.structurePassword || void 0);
|
|
2779
|
+
} catch (e) {
|
|
2780
|
+
l.showError(e);
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
});
|
|
2786
|
+
for (const o of t) {
|
|
2787
|
+
const t = o.key;
|
|
2788
|
+
e.updateCommand(`saveWorkbookAs${t}`, {
|
|
2789
|
+
label: () => to("command.saveAsFormat.label", { format: o.description }),
|
|
2790
|
+
groupLabels: {
|
|
2791
|
+
workbook: () => to("command.saveAsFormat.workbook", { format: o.description }),
|
|
2792
|
+
saveWorkbookOptions: () => to("command.saveAsFormat.compact", { format: o.description })
|
|
2793
|
+
},
|
|
2794
|
+
tags: o.tags,
|
|
2795
|
+
description: () => to("command.saveAsFormat", { format: o.description }),
|
|
2796
|
+
icon: "CSV" === t ? "FileDownloadAsCSV" : "Excel" === t ? "FileDownloadAsExcel" : "FileDownloadAsSheet",
|
|
2797
|
+
callback: () => {
|
|
2798
|
+
n(t);
|
|
2799
|
+
}
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
const p = async (e = null) => {
|
|
2804
|
+
const t = { csv: {
|
|
2805
|
+
date1904: o.getRuntime().isDate1904(),
|
|
2806
|
+
...o.options
|
|
2807
|
+
} };
|
|
2808
|
+
try {
|
|
2809
|
+
let n = "";
|
|
2810
|
+
const r = async (e) => {
|
|
2811
|
+
n = e?.getName() ?? "";
|
|
2812
|
+
}, a = await s(e, t, r);
|
|
2813
|
+
if (!a) return;
|
|
2814
|
+
const l = a.getSheets().getItems();
|
|
2815
|
+
await o.doBatch(async () => {
|
|
2816
|
+
for (let e = 0; e < l.length; e++) {
|
|
2817
|
+
const t = l[e], r = 1 === l.length ? n : t.getName(), a = o.findValidSheetName(r);
|
|
2818
|
+
await o.getSheets().add({
|
|
2819
|
+
name: a,
|
|
2820
|
+
autoSelect: e === l.length - 1
|
|
2821
|
+
}).getEntireRange().copyFrom(t.getEntireRange());
|
|
2822
|
+
}
|
|
2823
|
+
}, eo("op.importData")), a.close();
|
|
2824
|
+
} catch (e) {
|
|
2825
|
+
l.showError(e);
|
|
2826
|
+
}
|
|
2827
|
+
};
|
|
2828
|
+
if (e.updateCommand("insertDataFromFile", {
|
|
2829
|
+
tags: ["noTransaction", "noRepeat"],
|
|
2830
|
+
callback: async (e = null) => {
|
|
2831
|
+
let t = e;
|
|
2832
|
+
if (t || Y.canRead() || (t = await (async () => {
|
|
2833
|
+
const e = await Y.getReadFormats(), t = [...new Set(e.flatMap((e) => e.exts))].map((e) => `.${e}`);
|
|
2834
|
+
return Gt.openFileDialog(t.length ? t.join(",") : "*.*");
|
|
2835
|
+
})(), t)) return p(t);
|
|
2836
|
+
}
|
|
2837
|
+
}), e.updateCommand("insertDataFromURL", {
|
|
2838
|
+
tags: ["noTransaction", "noRepeat"],
|
|
2839
|
+
callback: async (e) => {
|
|
2840
|
+
if (!e) {
|
|
2841
|
+
const t = await l.showInput({
|
|
2842
|
+
title: to("dialog.importFromWeb.title"),
|
|
2843
|
+
description: to("dialog.importFromWeb.description"),
|
|
2844
|
+
inputLabel: to("dialog.webAddress.inputLabel"),
|
|
2845
|
+
initialValue: "https://www.sheetxl.com/docs/examples/financial-calculators.xlsx",
|
|
2846
|
+
propsInput: { style: { minWidth: "440px" } },
|
|
2847
|
+
options: [{
|
|
2848
|
+
id: "Import",
|
|
2849
|
+
label: () => to("dialog.import")
|
|
2850
|
+
}]
|
|
2851
|
+
});
|
|
2852
|
+
if ("Import" !== t.option) return;
|
|
2853
|
+
e = t.input;
|
|
2854
|
+
}
|
|
2855
|
+
if (e) try {
|
|
2856
|
+
const t = await fetch(e);
|
|
2857
|
+
if (!t.ok) throw new Error(`Could not fetch '${e}' (${t.status} ${t.statusText}).`);
|
|
2858
|
+
const o = await t.blob(), n = decodeURIComponent(e.split("/").pop()?.split("?")[0] || "") || "import.xlsx";
|
|
2859
|
+
await p(new File([o], n, { type: o.type }));
|
|
2860
|
+
} catch (e) {
|
|
2861
|
+
l.showError(e);
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
}), c) {
|
|
2865
|
+
const t = async () => !a() || "Open" === await l.showOptions({
|
|
2866
|
+
title: to("dialog.confirm.title"),
|
|
2867
|
+
description: to("dialog.unsavedChanges"),
|
|
2868
|
+
options: [{
|
|
2869
|
+
id: "Open",
|
|
2870
|
+
label: () => to("dialog.open")
|
|
2871
|
+
}, "Cancel"],
|
|
2872
|
+
defaultOption: "Cancel"
|
|
2873
|
+
}), r = async (e = null) => {
|
|
2874
|
+
const t = { csv: {
|
|
2875
|
+
date1904: o.getRuntime().isDate1904(),
|
|
2876
|
+
...o.options
|
|
2877
|
+
} };
|
|
2878
|
+
try {
|
|
2879
|
+
const o = await s(e, t);
|
|
2880
|
+
if (!o) return;
|
|
2881
|
+
n(o);
|
|
2882
|
+
} catch (e) {
|
|
2883
|
+
l.showError(e);
|
|
2884
|
+
}
|
|
2885
|
+
};
|
|
2886
|
+
e.updateCommand("openWorkbook", { callback: async (e = null) => {
|
|
2887
|
+
await t() && await r(e);
|
|
2888
|
+
} }), e.updateCommand("openWorkbookFromUrl", { callback: async (e) => {
|
|
2889
|
+
if (!e) {
|
|
2890
|
+
const t = await l.showInput({
|
|
2891
|
+
title: to("dialog.openFromWeb.title"),
|
|
2892
|
+
description: to("dialog.openFromWeb.description"),
|
|
2893
|
+
inputLabel: to("dialog.webAddress.inputLabel"),
|
|
2894
|
+
initialValue: "https://www.sheetxl.com/docs/examples/financial-calculators.xlsx",
|
|
2895
|
+
propsInput: { style: { minWidth: "440px" } },
|
|
2896
|
+
options: [{
|
|
2897
|
+
id: "Open",
|
|
2898
|
+
label: () => to("dialog.open")
|
|
2899
|
+
}]
|
|
2900
|
+
});
|
|
2901
|
+
if ("Open" !== t.option) return;
|
|
2902
|
+
e = t.input;
|
|
2903
|
+
}
|
|
2904
|
+
if (e && await t()) try {
|
|
2905
|
+
const t = await fetch(e);
|
|
2906
|
+
if (!t.ok) throw new Error(`Could not fetch '${e}' (${t.status} ${t.statusText}).`);
|
|
2907
|
+
const o = await t.blob(), n = decodeURIComponent(e.split("/").pop()?.split("?")[0] || "") || "workbook.xlsx";
|
|
2908
|
+
await r(new File([o], n, { type: o.type }));
|
|
2909
|
+
} catch (e) {
|
|
2910
|
+
l.showError(e);
|
|
2911
|
+
}
|
|
2912
|
+
} });
|
|
2913
|
+
}
|
|
2914
|
+
})(), () => {
|
|
2915
|
+
i = !0;
|
|
2916
|
+
};
|
|
2917
|
+
}
|
|
2918
|
+
var Tn = je(() => import("./DMtIfyV60BcLQkTD.mjs"));
|
|
2919
|
+
k();
|
|
2920
|
+
var Pn = /* @__PURE__ */ new Set(["ui"]), Fn = (e) => {
|
|
2921
|
+
const t = (e) => {
|
|
2922
|
+
if ("function" != typeof e) return e;
|
|
2923
|
+
try {
|
|
2924
|
+
return e();
|
|
2925
|
+
} catch {
|
|
2926
|
+
return;
|
|
2927
|
+
}
|
|
2928
|
+
}, o = (e, o) => {
|
|
2929
|
+
const n = t(e);
|
|
2930
|
+
return "string" == typeof n ? Zt(n, o, Qt.getActive()) : void 0;
|
|
2931
|
+
}, n = [];
|
|
2932
|
+
for (const r of e.names()) if (!Pn.has(r)) for (const a of e.keys(r)) {
|
|
2933
|
+
const l = e.resolveDefinition(r, a);
|
|
2934
|
+
n.push({
|
|
2935
|
+
groupKey: r,
|
|
2936
|
+
command: {
|
|
2937
|
+
getLabel: () => o(l?.label, l?.params) ?? a,
|
|
2938
|
+
getIcon: () => t(l?.icon),
|
|
2939
|
+
getDescription: () => o(l?.description, l?.params) ?? "",
|
|
2940
|
+
getShortcut: () => t(l?.shortcut) ?? null,
|
|
2941
|
+
getScope: () => r,
|
|
2942
|
+
getScopeLabel: () => he.DefaultCommandCatalogService.getScopeLabel(r)
|
|
2943
|
+
}
|
|
2944
|
+
});
|
|
2945
|
+
}
|
|
2946
|
+
return { getAllCommands: () => n };
|
|
2947
|
+
}, Dn = (e) => {
|
|
2948
|
+
const { children: t, workbook: o, setWorkbook: n, workbookTitle: r, isDirty: a } = e, l = he.useCommandScope(), i = Me(), { showModal: s } = it(), d = We(), c = qe(a);
|
|
2949
|
+
c.current = a;
|
|
2950
|
+
const p = De(() => {
|
|
2951
|
+
const e = l?.getRoot().getRegistry();
|
|
2952
|
+
if (!e) return;
|
|
2953
|
+
const t = s(Tn, {
|
|
2954
|
+
title: d("dialog.shortcutKeys.title"),
|
|
2955
|
+
commands: Fn(e),
|
|
2956
|
+
onDone: () => t.hide()
|
|
2957
|
+
});
|
|
2958
|
+
}, [l, s]);
|
|
2959
|
+
$e(() => {
|
|
2960
|
+
if (!l) return;
|
|
2961
|
+
const e = l.getRoot().contribution();
|
|
2962
|
+
return function(e, t) {
|
|
2963
|
+
const o = () => t.showShortcuts();
|
|
2964
|
+
e.updateCommand("showKeyboardShortcuts", { callback: o }), e.updateCommand("help", { callback: o });
|
|
2965
|
+
for (const [t, o] of Object.entries({
|
|
2966
|
+
gotoUrlGithub: "https://github.com/sheetxl/sheetxl",
|
|
2967
|
+
gotoUrlDiscord: "https://discord.gg/NTKdwUgK9p",
|
|
2968
|
+
gotoUrlDocumentation: "https://www.sheetxl.com/docs",
|
|
2969
|
+
gotoUrlIssue: "https://github.com/sheetxl/sheetxl/issues"
|
|
2970
|
+
})) e.updateCommand(t, { callback: () => {
|
|
2971
|
+
window?.open(o);
|
|
2972
|
+
} });
|
|
2973
|
+
}(e, { showShortcuts: p }), () => e.remove();
|
|
2974
|
+
}, [l, p]);
|
|
2975
|
+
const u = Ut("(prefers-color-scheme: dark)"), { themeMode: m } = Ae(), [g, h] = Re(Q.Mode, null), [y, b] = Re(Q.DarkGrid, !1), [f, x] = Re(Q.DarkImages, !1);
|
|
2976
|
+
$e(() => {
|
|
2977
|
+
if (!l) return;
|
|
2978
|
+
const e = l.getRoot().contribution();
|
|
2979
|
+
return function(e, t) {
|
|
2980
|
+
e.updateCommand("themeMode", {
|
|
2981
|
+
state: t.mode ?? null,
|
|
2982
|
+
params: { dark: t.isDark },
|
|
2983
|
+
icon: t.isDark ? "DarkMode" : "LightMode",
|
|
2984
|
+
callback: () => t.setMode(t.isDark ? "light" : "dark")
|
|
2985
|
+
}), e.updateCommand("defaultThemeMode", {
|
|
2986
|
+
state: !t.mode,
|
|
2987
|
+
icon: t.systemDefaultDark ? "SystemDefaultDarkMode" : "SystemDefaultLightMode",
|
|
2988
|
+
callback: () => t.setMode(null)
|
|
2989
|
+
}), e.updateCommand("enableDarkGrid", {
|
|
2990
|
+
state: t.enableDarkGrid,
|
|
2991
|
+
callback: () => t.setEnableDarkGrid((e) => !e)
|
|
2992
|
+
}), e.updateCommand("enableDarkImages", {
|
|
2993
|
+
state: t.enableDarkImages,
|
|
2994
|
+
callback: () => t.setEnableDarkImages((e) => !e)
|
|
2995
|
+
});
|
|
2996
|
+
}(e, {
|
|
2997
|
+
mode: g,
|
|
2998
|
+
setMode: h,
|
|
2999
|
+
isDark: "dark" === g || !g && "dark" === m,
|
|
3000
|
+
systemDefaultDark: u,
|
|
3001
|
+
enableDarkGrid: y,
|
|
3002
|
+
setEnableDarkGrid: b,
|
|
3003
|
+
enableDarkImages: f,
|
|
3004
|
+
setEnableDarkImages: x
|
|
3005
|
+
}), () => e.remove();
|
|
3006
|
+
}, [
|
|
3007
|
+
l,
|
|
3008
|
+
g,
|
|
3009
|
+
m,
|
|
3010
|
+
u,
|
|
3011
|
+
y,
|
|
3012
|
+
f,
|
|
3013
|
+
h,
|
|
3014
|
+
b,
|
|
3015
|
+
x
|
|
3016
|
+
]);
|
|
3017
|
+
const [v, C] = Re(ve.Active, null), [k, w] = He(() => Qt.getActive());
|
|
3018
|
+
$e(() => Qt.addChangeListener(w), []), $e(() => {
|
|
3019
|
+
v && v !== Qt.getActive() && Qt.setActive(v);
|
|
3020
|
+
}, [v]), $e(() => {
|
|
3021
|
+
if (!l) return;
|
|
3022
|
+
const e = l.getRoot().contribution();
|
|
3023
|
+
return function(e, t) {
|
|
3024
|
+
e.updateCommand("language", {
|
|
3025
|
+
state: t.active,
|
|
3026
|
+
callback: (e) => {
|
|
3027
|
+
e && t.setActive(e);
|
|
3028
|
+
}
|
|
3029
|
+
});
|
|
3030
|
+
}(e, {
|
|
3031
|
+
active: k,
|
|
3032
|
+
setActive: (e) => {
|
|
3033
|
+
C(e);
|
|
3034
|
+
}
|
|
3035
|
+
}), () => e.remove();
|
|
3036
|
+
}, [
|
|
3037
|
+
l,
|
|
3038
|
+
k,
|
|
3039
|
+
C
|
|
3040
|
+
]);
|
|
3041
|
+
const { isFullscreenAvailable: S, isFullscreenEnabled: T, toggleFullscreen: P } = Ne();
|
|
3042
|
+
return $e(() => {
|
|
3043
|
+
if (!l) return;
|
|
3044
|
+
const e = l.getRoot().contribution();
|
|
3045
|
+
return function(e, t) {
|
|
3046
|
+
e.updateCommand("fullScreenToggle", {
|
|
3047
|
+
state: t.isFullscreenEnabled,
|
|
3048
|
+
disabledReasons: t.isFullscreenAvailable ? [] : [eo("reason.fullscreenUnavailable")],
|
|
3049
|
+
icon: t.isFullscreenEnabled ? "FullScreenOff" : "FullScreen",
|
|
3050
|
+
callback: () => {
|
|
3051
|
+
t.toggleFullscreen();
|
|
3052
|
+
}
|
|
3053
|
+
});
|
|
3054
|
+
}(e, {
|
|
3055
|
+
isFullscreenAvailable: S,
|
|
3056
|
+
isFullscreenEnabled: T,
|
|
3057
|
+
toggleFullscreen: P
|
|
3058
|
+
}), () => e.remove();
|
|
3059
|
+
}, [
|
|
3060
|
+
l,
|
|
3061
|
+
S,
|
|
3062
|
+
T,
|
|
3063
|
+
P
|
|
3064
|
+
]), $e(() => {
|
|
3065
|
+
if (!l || !o) return;
|
|
3066
|
+
const e = l.getRoot().contribution(), t = Sn(e, {
|
|
3067
|
+
workbook: o,
|
|
3068
|
+
setWorkbook: n,
|
|
3069
|
+
workbookTitle: r ?? void 0,
|
|
3070
|
+
isDirty: () => c.current?.() ?? !1,
|
|
3071
|
+
notifier: i
|
|
3072
|
+
});
|
|
3073
|
+
return () => {
|
|
3074
|
+
t(), e.remove();
|
|
3075
|
+
};
|
|
3076
|
+
}, [
|
|
3077
|
+
l,
|
|
3078
|
+
o,
|
|
3079
|
+
n,
|
|
3080
|
+
r,
|
|
3081
|
+
i
|
|
3082
|
+
]), t;
|
|
3083
|
+
};
|
|
3084
|
+
Dn.displayName = "StudioCommandProvider";
|
|
3085
|
+
var Nn = ({ renderWorkbook: e }) => {
|
|
3086
|
+
const t = he.useCommandResolver(), o = qe(null), [n, r] = He(null), a = Ve((e) => {
|
|
3087
|
+
const o = e.dataTransfer;
|
|
3088
|
+
if (t && o) {
|
|
3089
|
+
if ("dragenter" === e.type || "dragover" === e.type) {
|
|
3090
|
+
const e = (e) => {
|
|
3091
|
+
const t = o.items, n = t.length;
|
|
3092
|
+
for (let o = 0; o < n; o++) {
|
|
3093
|
+
const n = t[o];
|
|
3094
|
+
if (n.type.startsWith(e)) return n;
|
|
3095
|
+
}
|
|
3096
|
+
return null;
|
|
3097
|
+
};
|
|
3098
|
+
let t = null;
|
|
3099
|
+
t = e("image/");
|
|
3100
|
+
const n = o.types, a = o.items;
|
|
3101
|
+
t ? r({
|
|
3102
|
+
item: t,
|
|
3103
|
+
text: ""
|
|
3104
|
+
}) : n.includes("Files") && a.length > 0 ? r({
|
|
3105
|
+
item: a[0],
|
|
3106
|
+
text: "Drop to open"
|
|
3107
|
+
}) : n.includes("text/html") || n.includes("text/plain") ? (r({
|
|
3108
|
+
item: a[0],
|
|
3109
|
+
text: ""
|
|
3110
|
+
}), o.effectAllowed = "none", o.dropEffect = "none") : (o.effectAllowed = "none", o.dropEffect = "none");
|
|
3111
|
+
} else "dragleave" === e.type && r(null);
|
|
3112
|
+
e.preventDefault();
|
|
3113
|
+
}
|
|
3114
|
+
}, [t]), l = De((e) => {
|
|
3115
|
+
if (n && t && (e.preventDefault(), e.stopPropagation(), r(null), e.dataTransfer.files && e.dataTransfer.files.length > 0)) {
|
|
3116
|
+
const n = e.dataTransfer.files[0];
|
|
3117
|
+
if (!n) return;
|
|
3118
|
+
if (n?.type?.startsWith("image/")) {
|
|
3119
|
+
const r = o.current?.getSheetElement()?.getGridSurface().getPaneFromClient(e.clientX, e.clientY);
|
|
3120
|
+
if (!r) return;
|
|
3121
|
+
const a = r.getPanePointFromPointer(e.clientX, e.clientY);
|
|
3122
|
+
if (!a) return;
|
|
3123
|
+
const l = r.toAbsoluteBounds({
|
|
3124
|
+
x: a.x ?? 0,
|
|
3125
|
+
y: a.y ?? 0,
|
|
3126
|
+
width: 0,
|
|
3127
|
+
height: 0
|
|
3128
|
+
});
|
|
3129
|
+
t.execute("insertImageFromFile", {
|
|
3130
|
+
file: n,
|
|
3131
|
+
options: { bounds: {
|
|
3132
|
+
x: l.x,
|
|
3133
|
+
y: l.y
|
|
3134
|
+
} }
|
|
3135
|
+
});
|
|
3136
|
+
} else {
|
|
3137
|
+
if (!Y.canRead()) return;
|
|
3138
|
+
const o = (e.dataTransfer.items?.[0])?.getAsFileSystemHandle?.();
|
|
3139
|
+
o ? o.then((e) => t.execute("openWorkbook", "file" === e?.kind ? e : n)).catch(() => t.execute("openWorkbook", n)) : t.execute("openWorkbook", n);
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
}, [t, n]), i = Ue(() => n && n.text ? ct(ht, {
|
|
3143
|
+
className: "drop-overlay",
|
|
3144
|
+
sx: {
|
|
3145
|
+
position: "absolute",
|
|
3146
|
+
width: "100%",
|
|
3147
|
+
height: "100%",
|
|
3148
|
+
boxSizing: "border-box",
|
|
3149
|
+
pointerEvents: "none",
|
|
3150
|
+
display: "flex",
|
|
3151
|
+
justifyContent: "center",
|
|
3152
|
+
alignItems: "center",
|
|
3153
|
+
background: (e) => e.palette.divider,
|
|
3154
|
+
color: (e) => e.palette.primary.dark
|
|
3155
|
+
},
|
|
3156
|
+
children: ct($t, {
|
|
3157
|
+
variant: "h4",
|
|
3158
|
+
children: n.text
|
|
3159
|
+
})
|
|
3160
|
+
}) : null, [n]);
|
|
3161
|
+
return pt(dt, { children: [e({
|
|
3162
|
+
ref: o,
|
|
3163
|
+
onDragStart: (e) => {
|
|
3164
|
+
if (e.target.src) {
|
|
3165
|
+
const t = new Image();
|
|
3166
|
+
t.src = e.target.src, e.dataTransfer.setDragImage(t, 1, 1);
|
|
3167
|
+
}
|
|
3168
|
+
},
|
|
3169
|
+
onDragEnter: a,
|
|
3170
|
+
onDragLeave: a,
|
|
3171
|
+
onDragOver: a,
|
|
3172
|
+
onDrop: l
|
|
3173
|
+
}), i] });
|
|
3174
|
+
}, On = Ke((e) => {
|
|
3175
|
+
const { workbook: t, setWorkbook: o, refDocumentTitle: n, titleWorkbook: r, setWorkbookTitle: a, isDirty: l, initialCommandAnchor: i, renderWorkbook: s } = e;
|
|
3176
|
+
return ct(K, {
|
|
3177
|
+
initialAnchor: i,
|
|
3178
|
+
children: ct(Dn, {
|
|
3179
|
+
workbook: t,
|
|
3180
|
+
setWorkbook: o,
|
|
3181
|
+
workbookTitle: r,
|
|
3182
|
+
isDirty: l,
|
|
3183
|
+
children: ct(Nn, { renderWorkbook: s })
|
|
3184
|
+
})
|
|
3185
|
+
});
|
|
3186
|
+
});
|
|
3187
|
+
On.displayName = "CommandsWrapper";
|
|
3188
|
+
var In = {
|
|
3189
|
+
sort: () => import("./D70ZQyxt_JcDRn7d.mjs"),
|
|
3190
|
+
numberFormat: () => import("./Cv3xawSybVla_gE-.mjs"),
|
|
3191
|
+
hyperlink: () => import("./DMDanrARYHWYLx37.mjs"),
|
|
3192
|
+
comments: () => import("./DNJmWZomszXCkDx7.mjs"),
|
|
3193
|
+
find: () => import("./DNkUDrpOmhF_vVDS.mjs"),
|
|
3194
|
+
tableNew: () => import("./CH7ZFM-RHFeeCuff.mjs"),
|
|
3195
|
+
namedDetails: () => import("./DZG5Pd01dM-dgS3n.mjs"),
|
|
3196
|
+
insertFunction: () => import("./CwSCTBxawz0-VqW9.mjs"),
|
|
3197
|
+
resizeHeader: () => import("./0FcokH6jWYoKKyvJ.mjs"),
|
|
3198
|
+
workbookStatistics: () => import("./BUqFn97L8YiLtWbW.mjs"),
|
|
3199
|
+
protectWorkbook: () => import("./index.mjs").then((e) => e.a)
|
|
3200
|
+
}, Mn = ["find"], Rn = Ke((e) => {
|
|
3201
|
+
const { children: t } = e, o = io(), n = o ? o.enqueueSnackbar : () => {}, r = o ? o.closeSnackbar : () => {}, [a, l] = He({
|
|
3202
|
+
isMounted: !1,
|
|
3203
|
+
label: null,
|
|
3204
|
+
progress: null,
|
|
3205
|
+
starting: /* @__PURE__ */ new Map(),
|
|
3206
|
+
running: /* @__PURE__ */ new Map()
|
|
3207
|
+
}), i = Ve(() => {
|
|
3208
|
+
l((e) => ({
|
|
3209
|
+
...e,
|
|
3210
|
+
isMounted: !0
|
|
3211
|
+
}));
|
|
3212
|
+
}, []), s = Ve(() => {
|
|
3213
|
+
l((e) => ({
|
|
3214
|
+
...e,
|
|
3215
|
+
isMounted: !1
|
|
3216
|
+
}));
|
|
3217
|
+
}, []), d = We(), c = Ht.EmptyObject, p = lt(c), u = st(c), m = at(c), g = qe(!1);
|
|
3218
|
+
$e(() => {
|
|
3219
|
+
if (g.current) return;
|
|
3220
|
+
g.current = !0;
|
|
3221
|
+
const e = window, t = e.requestIdleCallback ?? ((e) => setTimeout(e, 500)), o = e.cancelIdleCallback ?? clearTimeout, n = t(() => {
|
|
3222
|
+
for (const e of Mn) p(e, In[e], { prewarm: !0 }).catch(() => {});
|
|
3223
|
+
});
|
|
3224
|
+
return () => o(n);
|
|
3225
|
+
}, []);
|
|
3226
|
+
const h = qe(/* @__PURE__ */ new Set()), y = Ue(() => {
|
|
3227
|
+
const e = (e, t) => {
|
|
3228
|
+
if (t?.onceKey) {
|
|
3229
|
+
if (h.current.has(t.onceKey)) return;
|
|
3230
|
+
const e = new Set(h.current);
|
|
3231
|
+
e.add(t.onceKey), h.current = e;
|
|
3232
|
+
}
|
|
3233
|
+
const o = {
|
|
3234
|
+
variant: t?.type ?? Ce.Info,
|
|
3235
|
+
anchorOrigin: {
|
|
3236
|
+
vertical: "top",
|
|
3237
|
+
horizontal: "center"
|
|
3238
|
+
},
|
|
3239
|
+
preventDuplicate: t?.preventDuplicate,
|
|
3240
|
+
persist: t?.persist ?? t?.type === Ce.Error,
|
|
3241
|
+
action: (e) => ct(Ft, {
|
|
3242
|
+
onClick: () => r(e),
|
|
3243
|
+
children: ct(fe, { iconKey: "Cancel" })
|
|
3244
|
+
})
|
|
3245
|
+
};
|
|
3246
|
+
t?.enqueueProps && Object.assign(o, t.enqueueProps), e || console.log("message is 'null'", t), n(e ?? "Alert", o);
|
|
3247
|
+
}, t = {
|
|
3248
|
+
showMessage: e,
|
|
3249
|
+
showBusy: (e, t) => {
|
|
3250
|
+
let o = null;
|
|
3251
|
+
const n = new Promise((e) => {
|
|
3252
|
+
o = e;
|
|
3253
|
+
});
|
|
3254
|
+
return l((t) => {
|
|
3255
|
+
const r = new Map(t.starting);
|
|
3256
|
+
return r.set(n, o), {
|
|
3257
|
+
...t,
|
|
3258
|
+
label: e,
|
|
3259
|
+
starting: r
|
|
3260
|
+
};
|
|
3261
|
+
}), n;
|
|
3262
|
+
},
|
|
3263
|
+
showWindow: (e, t) => {
|
|
3264
|
+
const o = t;
|
|
3265
|
+
return t = {
|
|
3266
|
+
...t,
|
|
3267
|
+
onKeyDown: (e) => {
|
|
3268
|
+
e.isDefaultPrevented() || e.isPropagationStopped() || o?.onKeyDown?.(e);
|
|
3269
|
+
}
|
|
3270
|
+
}, p(e, In[e], t);
|
|
3271
|
+
},
|
|
3272
|
+
showOptions: u,
|
|
3273
|
+
showInput: m,
|
|
3274
|
+
showError: (t) => {
|
|
3275
|
+
let o, n = Ce.Error, r = d("error.unknown");
|
|
3276
|
+
"string" == typeof t ? r = t : t instanceof Error && (o = t, t.message && (r = d(t.message))), t instanceof Jt && (n = Ce.Info), e(r, {
|
|
3277
|
+
type: n,
|
|
3278
|
+
enqueueProps: { error: o }
|
|
3279
|
+
});
|
|
3280
|
+
}
|
|
3281
|
+
}, o = new be();
|
|
3282
|
+
return o.setOverrides(t), o;
|
|
3283
|
+
}, [d]);
|
|
3284
|
+
$e(() => {
|
|
3285
|
+
a.starting.size <= 0 || !a.isMounted || l((e) => {
|
|
3286
|
+
const t = new Map(e.running);
|
|
3287
|
+
return e.starting.forEach((e, o) => {
|
|
3288
|
+
const n = Pe(() => {
|
|
3289
|
+
l((e) => {
|
|
3290
|
+
const t = new Map(e.running);
|
|
3291
|
+
return t.delete(o), {
|
|
3292
|
+
...e,
|
|
3293
|
+
progress: 0 === t.size ? null : e.progress,
|
|
3294
|
+
running: t
|
|
3295
|
+
};
|
|
3296
|
+
});
|
|
3297
|
+
}, (e, t) => {
|
|
3298
|
+
const o = t && t > 0 && null != e ? Math.max(0, Math.min(1, e / t)) : null;
|
|
3299
|
+
l((e) => e.progress === o ? e : {
|
|
3300
|
+
...e,
|
|
3301
|
+
progress: o
|
|
3302
|
+
});
|
|
3303
|
+
}, (e) => {
|
|
3304
|
+
l((t) => ({
|
|
3305
|
+
...t,
|
|
3306
|
+
label: e
|
|
3307
|
+
}));
|
|
3308
|
+
});
|
|
3309
|
+
t.set(o, n), e(n);
|
|
3310
|
+
}), {
|
|
3311
|
+
...e,
|
|
3312
|
+
starting: /* @__PURE__ */ new Map(),
|
|
3313
|
+
running: t
|
|
3314
|
+
};
|
|
3315
|
+
});
|
|
3316
|
+
}, [a]);
|
|
3317
|
+
const [b, f] = He(null);
|
|
3318
|
+
return $e(() => {
|
|
3319
|
+
0 !== a.starting.size || 0 !== a.running.size ? f(ct(Ge, {
|
|
3320
|
+
icon: ct(Qe, { sx: {
|
|
3321
|
+
transform: "scale(0.7)",
|
|
3322
|
+
marginLeft: "-6px"
|
|
3323
|
+
} }),
|
|
3324
|
+
panel: !0,
|
|
3325
|
+
label: a.label,
|
|
3326
|
+
progress: a.progress,
|
|
3327
|
+
onMount: i,
|
|
3328
|
+
onUnmount: s,
|
|
3329
|
+
sx: {
|
|
3330
|
+
position: "absolute",
|
|
3331
|
+
left: "0",
|
|
3332
|
+
top: "0",
|
|
3333
|
+
width: "100%",
|
|
3334
|
+
height: "100%",
|
|
3335
|
+
zIndex: "9999"
|
|
3336
|
+
}
|
|
3337
|
+
})) : f(null);
|
|
3338
|
+
}, [
|
|
3339
|
+
a.starting,
|
|
3340
|
+
a.running,
|
|
3341
|
+
a.label,
|
|
3342
|
+
a.progress
|
|
3343
|
+
]), pt(we, {
|
|
3344
|
+
notifier: y,
|
|
3345
|
+
children: [b, t]
|
|
3346
|
+
});
|
|
3347
|
+
});
|
|
3348
|
+
Rn.displayName = "StudioNotifierProvider";
|
|
3349
|
+
var An = "var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))", En = Ke(Le((e, t) => {
|
|
3350
|
+
const { children: o, title: n, taskPanes: r, onSelect: a, selected: l, registry: i = $, style: s, iconsOnly: d, side: c = "right", className: p, ...u } = e, m = "right" !== c, g = Ue(() => r.map((t) => {
|
|
3351
|
+
const o = i.getRegisteredTaskPane(t);
|
|
3352
|
+
if (!o) return null;
|
|
3353
|
+
let n = o.getIcon?.();
|
|
3354
|
+
"string" == typeof n && (n = ct(fe, { iconKey: n }));
|
|
3355
|
+
const r = t === l, a = n ? ct(ht, {
|
|
3356
|
+
sx: {
|
|
3357
|
+
display: "inline-block",
|
|
3358
|
+
transform: m ? "rotate(-90deg)" : "rotate(90deg)",
|
|
3359
|
+
transformOrigin: "center",
|
|
3360
|
+
color: (e) => e.palette.text.secondary
|
|
3361
|
+
},
|
|
3362
|
+
children: n
|
|
3363
|
+
}) : null, s = !n || !d && r, c = ct(ht, {
|
|
3364
|
+
sx: {
|
|
3365
|
+
display: "grid",
|
|
3366
|
+
gridTemplateColumns: s ? "1fr" : "0fr",
|
|
3367
|
+
opacity: s ? 1 : 0,
|
|
3368
|
+
transition: (e) => e.transitions.create(["grid-template-columns", "opacity"], { duration: e.transitions.duration.short })
|
|
3369
|
+
},
|
|
3370
|
+
children: ct(ht, {
|
|
3371
|
+
sx: {
|
|
3372
|
+
overflow: "hidden",
|
|
3373
|
+
minWidth: 0,
|
|
3374
|
+
minHeight: 0
|
|
3375
|
+
},
|
|
3376
|
+
children: ct($t, {
|
|
3377
|
+
component: "div",
|
|
3378
|
+
sx: {
|
|
3379
|
+
textTransform: "none",
|
|
3380
|
+
whiteSpace: "nowrap",
|
|
3381
|
+
transform: m ? "rotate(180deg)" : void 0,
|
|
3382
|
+
padding: "4px 0px",
|
|
3383
|
+
color: (e) => r ? e.palette.primary.main : e.palette.text.secondary
|
|
3384
|
+
},
|
|
3385
|
+
children: o.getTitle()
|
|
3386
|
+
})
|
|
3387
|
+
})
|
|
3388
|
+
});
|
|
3389
|
+
return ct(Bt, {
|
|
3390
|
+
value: t,
|
|
3391
|
+
label: ct(ot, {
|
|
3392
|
+
disableInteractive: !0,
|
|
3393
|
+
title: o.getTitle() ?? "",
|
|
3394
|
+
placement: "left-start",
|
|
3395
|
+
children: pt(ht, {
|
|
3396
|
+
sx: {
|
|
3397
|
+
padding: "0px 0px",
|
|
3398
|
+
writingMode: m ? "vertical-lr" : "vertical-rl",
|
|
3399
|
+
textOrientation: "mixed",
|
|
3400
|
+
display: "flex",
|
|
3401
|
+
alignItems: "center",
|
|
3402
|
+
justifyContent: "space-between",
|
|
3403
|
+
minWidth: "0px",
|
|
3404
|
+
color: (e) => e.palette.text.secondary
|
|
3405
|
+
},
|
|
3406
|
+
children: [m ? c : a, m ? a : c]
|
|
3407
|
+
})
|
|
3408
|
+
}),
|
|
3409
|
+
sx: {
|
|
3410
|
+
padding: "4px 4px",
|
|
3411
|
+
minWidth: "0px",
|
|
3412
|
+
minHeight: "0px",
|
|
3413
|
+
borderRadius: "4px"
|
|
3414
|
+
},
|
|
3415
|
+
className: oo("taskpane-strip-item", { "Mui-selected": r }),
|
|
3416
|
+
onClick: () => e.onSelect(t)
|
|
3417
|
+
}, t);
|
|
3418
|
+
}), [
|
|
3419
|
+
r,
|
|
3420
|
+
l,
|
|
3421
|
+
a,
|
|
3422
|
+
i,
|
|
3423
|
+
m,
|
|
3424
|
+
d,
|
|
3425
|
+
Ie()
|
|
3426
|
+
]);
|
|
3427
|
+
return ct(ht, {
|
|
3428
|
+
ref: Oe(t, () => ({ isTaskPaneStrip: () => !0 }), []),
|
|
3429
|
+
className: Ue(() => oo("taskpane-strip", p), [p]),
|
|
3430
|
+
sx: {
|
|
3431
|
+
paddingLeft: m ? void 0 : "2px",
|
|
3432
|
+
paddingRight: m ? "2px" : void 0,
|
|
3433
|
+
paddingTop: "4px",
|
|
3434
|
+
...s
|
|
3435
|
+
},
|
|
3436
|
+
...u,
|
|
3437
|
+
children: ct(Lt, {
|
|
3438
|
+
orientation: "vertical",
|
|
3439
|
+
variant: "scrollable",
|
|
3440
|
+
value: l,
|
|
3441
|
+
onChange: (e, t) => {
|
|
3442
|
+
a(t);
|
|
3443
|
+
},
|
|
3444
|
+
slotProps: {
|
|
3445
|
+
list: { sx: { gap: "2px" } },
|
|
3446
|
+
indicator: { sx: {
|
|
3447
|
+
left: m ? void 0 : "0px",
|
|
3448
|
+
right: m ? void 0 : "unset",
|
|
3449
|
+
bottom: m ? "0px" : void 0
|
|
3450
|
+
} }
|
|
3451
|
+
},
|
|
3452
|
+
children: g
|
|
3453
|
+
})
|
|
3454
|
+
});
|
|
3455
|
+
})), Wn = (e) => {
|
|
3456
|
+
const { title: t, icon: o, onClose: n, readOnly: r, focused: a, ...l } = e, i = qe(null), s = We();
|
|
3457
|
+
return ct(wt, {
|
|
3458
|
+
className: oo({ "Mui-selected": a }),
|
|
3459
|
+
sx: {
|
|
3460
|
+
display: "flex",
|
|
3461
|
+
flex: "1 1 %0",
|
|
3462
|
+
color: (e) => e.palette.text.secondary,
|
|
3463
|
+
boxSizing: "border-box",
|
|
3464
|
+
padding: "0 0",
|
|
3465
|
+
transitionProperty: "opacity",
|
|
3466
|
+
transitionDuration: (e) => `${e.transitions.duration.shortest}ms`,
|
|
3467
|
+
opacity: .7,
|
|
3468
|
+
"&.Mui-selected": {
|
|
3469
|
+
opacity: 1,
|
|
3470
|
+
transitionDuration: (e) => e.transitions.duration.shortest / 2 + "ms"
|
|
3471
|
+
},
|
|
3472
|
+
backgroundColor: (e) => _t(e.palette.action.hover, .03),
|
|
3473
|
+
borderBottom: `solid ${An} 1px`
|
|
3474
|
+
},
|
|
3475
|
+
...l,
|
|
3476
|
+
children: pt(ht, {
|
|
3477
|
+
sx: {
|
|
3478
|
+
display: "flex",
|
|
3479
|
+
flex: "1 1 10%",
|
|
3480
|
+
flexDirection: "row",
|
|
3481
|
+
alignItems: "center",
|
|
3482
|
+
marginTop: (e) => e.spacing(.25),
|
|
3483
|
+
marginBottom: (e) => e.spacing(.25),
|
|
3484
|
+
marginLeft: (e) => e.spacing(1),
|
|
3485
|
+
marginRight: (e) => e.spacing(1)
|
|
3486
|
+
},
|
|
3487
|
+
children: [ct(ht, {
|
|
3488
|
+
sx: {
|
|
3489
|
+
flex: "1 1 100%",
|
|
3490
|
+
paddingLeft: (e) => e.spacing(1)
|
|
3491
|
+
},
|
|
3492
|
+
children: t
|
|
3493
|
+
}), ct(et, {
|
|
3494
|
+
label: s("taskPane.close"),
|
|
3495
|
+
children: ct(Ft, {
|
|
3496
|
+
"aria-label": "close",
|
|
3497
|
+
sx: { color: (e) => e.palette.text.icon ?? e.palette.action.active },
|
|
3498
|
+
touchRippleRef: i,
|
|
3499
|
+
onPointerDown: (e) => {
|
|
3500
|
+
i.current?.start(e, { center: !1 }), e.stopPropagation(), e.preventDefault();
|
|
3501
|
+
},
|
|
3502
|
+
onPointerUp: () => {
|
|
3503
|
+
n();
|
|
3504
|
+
},
|
|
3505
|
+
children: ct(fe, { iconKey: "Close" })
|
|
3506
|
+
})
|
|
3507
|
+
})]
|
|
3508
|
+
})
|
|
3509
|
+
});
|
|
3510
|
+
}, Bn = Le((e, t) => {
|
|
3511
|
+
const { model: o, side: n, ...r } = e, a = qt();
|
|
3512
|
+
return ct(H, {
|
|
3513
|
+
model: o,
|
|
3514
|
+
ref: t,
|
|
3515
|
+
propsFrame: { style: {
|
|
3516
|
+
border: `solid ${An} 1px`,
|
|
3517
|
+
borderRadius: `${a.shape.borderRadius ?? 4}px`,
|
|
3518
|
+
marginBottom: `${a.spacing?.(.5) ?? 4}px`
|
|
3519
|
+
} },
|
|
3520
|
+
alwaysShowStrip: !0,
|
|
3521
|
+
componentTitle: Wn,
|
|
3522
|
+
componentStrip: En,
|
|
3523
|
+
side: n,
|
|
3524
|
+
...e,
|
|
3525
|
+
onOpen: () => {
|
|
3526
|
+
e?.onOpen?.();
|
|
3527
|
+
},
|
|
3528
|
+
onClose: () => {
|
|
3529
|
+
e?.onClose?.();
|
|
3530
|
+
},
|
|
3531
|
+
...r
|
|
3532
|
+
});
|
|
3533
|
+
}), Ln = "_styled-resizer_fdl5y_3", zn = {}, jn = {
|
|
3534
|
+
flex: "1 1 100%",
|
|
3535
|
+
display: "flex",
|
|
3536
|
+
boxSizing: "border-box"
|
|
3537
|
+
}, Kn = Ke(Le((e, t) => {
|
|
3538
|
+
const { mainElement: o, sidebarElement: n, position: r, persistKey: a, onPositionChange: l, className: i, style: s, taskSide: d = "right", ...c } = e, [p, u] = Re(a ?? null, zn), m = qt(), [g, { width: h }] = ro(), y = h > 530 || 0 === h, b = qe(null);
|
|
3539
|
+
let f, x, v = null, C = 4, k = 13;
|
|
3540
|
+
y ? v = "m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991" : (v = "M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991", C = 13, k = 4);
|
|
3541
|
+
let w, S = o, T = n;
|
|
3542
|
+
const P = "right" !== d, F = y ? "row" : "column", D = P && T ? "before" : "after", N = `${F}:${D}`, O = a ? p[N] : void 0, I = null != O ? `${O}%` : ((e, t) => {
|
|
3543
|
+
if (null == e) return "40%";
|
|
3544
|
+
if ("number" == typeof e || "string" == typeof e) return e;
|
|
3545
|
+
const o = e[t];
|
|
3546
|
+
return null != o ? `${o}%` : "40%";
|
|
3547
|
+
})(r, N), M = a || l ? (e) => {
|
|
3548
|
+
a && u((t) => ({
|
|
3549
|
+
...t,
|
|
3550
|
+
[N]: e.percent
|
|
3551
|
+
})), l?.(e, {
|
|
3552
|
+
orientation: F,
|
|
3553
|
+
side: D,
|
|
3554
|
+
key: N
|
|
3555
|
+
});
|
|
3556
|
+
} : void 0;
|
|
3557
|
+
return P && T ? (S = n, T = o, x = { style: {
|
|
3558
|
+
flexDirection: "column",
|
|
3559
|
+
boxSizing: "border-box",
|
|
3560
|
+
paddingRight: "2px"
|
|
3561
|
+
} }, f = {}, w = {
|
|
3562
|
+
fixedPane: "before",
|
|
3563
|
+
position: I,
|
|
3564
|
+
minBefore: y ? "280px" : "120px",
|
|
3565
|
+
splitDirection: y ? "row" : "column"
|
|
3566
|
+
}) : (f = { style: {
|
|
3567
|
+
flexDirection: "column",
|
|
3568
|
+
marginRight: n ? void 0 : "6px"
|
|
3569
|
+
} }, x = { style: {
|
|
3570
|
+
marginLeft: y ? "0px" : "4px",
|
|
3571
|
+
marginRight: y ? "8px" : "4px"
|
|
3572
|
+
} }, w = {
|
|
3573
|
+
fixedPane: "after",
|
|
3574
|
+
position: I,
|
|
3575
|
+
minAfter: y ? "280px" : "120px",
|
|
3576
|
+
splitDirection: y ? "row" : "column"
|
|
3577
|
+
}), ct(Se, {
|
|
3578
|
+
ref: no([
|
|
3579
|
+
b,
|
|
3580
|
+
g,
|
|
3581
|
+
t
|
|
3582
|
+
]),
|
|
3583
|
+
className: i,
|
|
3584
|
+
style: s ? {
|
|
3585
|
+
...jn,
|
|
3586
|
+
...s
|
|
3587
|
+
} : jn,
|
|
3588
|
+
...c,
|
|
3589
|
+
...w,
|
|
3590
|
+
onPositionChange: M,
|
|
3591
|
+
propsResizer: {
|
|
3592
|
+
className: oo("styled-resizer", Ln),
|
|
3593
|
+
style: {
|
|
3594
|
+
minWidth: y ? "7px" : void 0,
|
|
3595
|
+
minHeight: y ? void 0 : "6px",
|
|
3596
|
+
maskImage: `url("data:image/svg+xml,%3Csvg width='${C}' height='${k}' viewBox='0 0 ${C} ${k}' version='1.1' fill='${m.palette.text.icon ?? m.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${v}' /%3E%3C/svg%3E%0A")`,
|
|
3597
|
+
maskRepeat: "no-repeat",
|
|
3598
|
+
maskPosition: P ? y ? "center center" : "bottom center" : y ? "left center" : "top center"
|
|
3599
|
+
}
|
|
3600
|
+
},
|
|
3601
|
+
elementBefore: S,
|
|
3602
|
+
propsPaneBefore: f,
|
|
3603
|
+
elementAfter: T,
|
|
3604
|
+
propsPaneAfter: x
|
|
3605
|
+
});
|
|
3606
|
+
}));
|
|
3607
|
+
Kn.displayName = "StudioSplitPane";
|
|
3608
|
+
var Vn = Ke((e) => {
|
|
3609
|
+
const { dataValidation: t } = e, o = We(), n = t.getRenderHints();
|
|
3610
|
+
return se(t, "onAnyChange"), pt(Rt, {
|
|
3611
|
+
tabIndex: 0,
|
|
3612
|
+
className: s["editor-panel"],
|
|
3613
|
+
sx: {
|
|
3614
|
+
gap: (e) => e.spacing(1),
|
|
3615
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
3616
|
+
paddingBottom: (e) => e.spacing(2),
|
|
3617
|
+
paddingLeft: (e) => e.spacing(1.5),
|
|
3618
|
+
paddingRight: (e) => e.spacing(1.5),
|
|
3619
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
3620
|
+
borderRadius: (e) => e.spacing(1.25),
|
|
3621
|
+
overflow: "auto"
|
|
3622
|
+
},
|
|
3623
|
+
children: [
|
|
3624
|
+
ct(ht, {
|
|
3625
|
+
sx: { margin: (e) => e.spacing(1.25) },
|
|
3626
|
+
children: ct($t, {
|
|
3627
|
+
variant: "body2",
|
|
3628
|
+
sx: { color: "text.secondary" },
|
|
3629
|
+
children: o("dataValidation.range", { range: t.getRanges().toString() })
|
|
3630
|
+
})
|
|
3631
|
+
}),
|
|
3632
|
+
ct(Ko, {
|
|
3633
|
+
selectorTitle: o("dataValidation.allow"),
|
|
3634
|
+
showIncludeBlanks: !0,
|
|
3635
|
+
condition: t.getCondition(),
|
|
3636
|
+
readOnly: t.isProtected(),
|
|
3637
|
+
onConditionChange: (e) => t.setCondition(e)
|
|
3638
|
+
}),
|
|
3639
|
+
pt(ut, {
|
|
3640
|
+
expanded: t.isShowPromptMessage(),
|
|
3641
|
+
onChange: (e, o) => t.setShowPromptMessage(o),
|
|
3642
|
+
disableGutters: !0,
|
|
3643
|
+
elevation: 0,
|
|
3644
|
+
sx: {
|
|
3645
|
+
backgroundColor: "action.hover",
|
|
3646
|
+
border: 1,
|
|
3647
|
+
borderColor: "divider",
|
|
3648
|
+
borderRadius: 1,
|
|
3649
|
+
mb: 0,
|
|
3650
|
+
"&:before": { display: "none" },
|
|
3651
|
+
"&.Mui-expanded": {
|
|
3652
|
+
margin: 0,
|
|
3653
|
+
mb: 1
|
|
3654
|
+
}
|
|
3655
|
+
},
|
|
3656
|
+
children: [ct(gt, {
|
|
3657
|
+
expandIcon: ct(fe, { iconKey: "ExpandMore" }),
|
|
3658
|
+
sx: {
|
|
3659
|
+
px: 2,
|
|
3660
|
+
"& .MuiAccordionSummary-content": { my: 0 },
|
|
3661
|
+
"&.Mui-expanded .MuiAccordionSummary-content": { my: 0 }
|
|
3662
|
+
},
|
|
3663
|
+
children: ct(Pt, {
|
|
3664
|
+
control: ct(xt, {
|
|
3665
|
+
checked: t.isShowPromptMessage(),
|
|
3666
|
+
onChange: (e) => {
|
|
3667
|
+
e.stopPropagation();
|
|
3668
|
+
const o = e.target.checked;
|
|
3669
|
+
t.setShowPromptMessage(o);
|
|
3670
|
+
},
|
|
3671
|
+
onClick: (e) => e.stopPropagation()
|
|
3672
|
+
}),
|
|
3673
|
+
label: o("dataValidation.showPrompt"),
|
|
3674
|
+
onClick: (e) => e.stopPropagation()
|
|
3675
|
+
})
|
|
3676
|
+
}), pt(mt, {
|
|
3677
|
+
sx: {
|
|
3678
|
+
pl: 2,
|
|
3679
|
+
pr: 2,
|
|
3680
|
+
pt: 0,
|
|
3681
|
+
pb: 2,
|
|
3682
|
+
display: "flex",
|
|
3683
|
+
flexDirection: "column",
|
|
3684
|
+
gap: 2
|
|
3685
|
+
},
|
|
3686
|
+
children: [ct(zt, {
|
|
3687
|
+
size: "small",
|
|
3688
|
+
label: o("dataValidation.title"),
|
|
3689
|
+
value: t.getPromptTitle(),
|
|
3690
|
+
onChange: (e) => t.setPromptTitle(e.target.value),
|
|
3691
|
+
fullWidth: !0,
|
|
3692
|
+
sx: { backgroundColor: "background.paper" }
|
|
3693
|
+
}), ct(zt, {
|
|
3694
|
+
size: "small",
|
|
3695
|
+
label: o("dataValidation.message"),
|
|
3696
|
+
value: t.getPromptMessage(),
|
|
3697
|
+
onChange: (e) => t.setPromptMessage(e.target.value),
|
|
3698
|
+
multiline: !0,
|
|
3699
|
+
rows: 2,
|
|
3700
|
+
fullWidth: !0,
|
|
3701
|
+
sx: { backgroundColor: "background.paper" }
|
|
3702
|
+
})]
|
|
3703
|
+
})]
|
|
3704
|
+
}),
|
|
3705
|
+
pt(ut, {
|
|
3706
|
+
expanded: t.isShowAlertMessage(),
|
|
3707
|
+
onChange: (e, o) => t.setShowAlertMessage(o),
|
|
3708
|
+
disableGutters: !0,
|
|
3709
|
+
elevation: 0,
|
|
3710
|
+
sx: {
|
|
3711
|
+
backgroundColor: "action.hover",
|
|
3712
|
+
border: 1,
|
|
3713
|
+
borderColor: "divider",
|
|
3714
|
+
borderRadius: 1,
|
|
3715
|
+
mb: 0,
|
|
3716
|
+
"&:before": { display: "none" },
|
|
3717
|
+
"&.Mui-expanded": {
|
|
3718
|
+
margin: 0,
|
|
3719
|
+
mb: 1
|
|
3720
|
+
}
|
|
3721
|
+
},
|
|
3722
|
+
children: [ct(gt, {
|
|
3723
|
+
expandIcon: ct(fe, { iconKey: "ExpandMore" }),
|
|
3724
|
+
sx: {
|
|
3725
|
+
px: 2,
|
|
3726
|
+
"& .MuiAccordionSummary-content": { my: 0 },
|
|
3727
|
+
"&.Mui-expanded .MuiAccordionSummary-content": { my: 0 }
|
|
3728
|
+
},
|
|
3729
|
+
children: ct(Pt, {
|
|
3730
|
+
control: ct(xt, {
|
|
3731
|
+
checked: t.isShowAlertMessage(),
|
|
3732
|
+
onChange: (e) => {
|
|
3733
|
+
e.stopPropagation();
|
|
3734
|
+
const o = e.target.checked;
|
|
3735
|
+
t.setShowAlertMessage(o);
|
|
3736
|
+
},
|
|
3737
|
+
onClick: (e) => e.stopPropagation()
|
|
3738
|
+
}),
|
|
3739
|
+
label: o("dataValidation.showAlert"),
|
|
3740
|
+
onClick: (e) => e.stopPropagation()
|
|
3741
|
+
})
|
|
3742
|
+
}), pt(mt, {
|
|
3743
|
+
sx: {
|
|
3744
|
+
pl: 2,
|
|
3745
|
+
pr: 2,
|
|
3746
|
+
pt: 0,
|
|
3747
|
+
pb: 2,
|
|
3748
|
+
display: "flex",
|
|
3749
|
+
flexDirection: "column",
|
|
3750
|
+
gap: 2
|
|
3751
|
+
},
|
|
3752
|
+
children: [
|
|
3753
|
+
pt(Tt, {
|
|
3754
|
+
fullWidth: !0,
|
|
3755
|
+
size: "small",
|
|
3756
|
+
sx: { backgroundColor: "background.paper" },
|
|
3757
|
+
children: [ct(Nt, { children: o("dataValidation.alertStyle") }), pt(At, {
|
|
3758
|
+
value: t.getAlertStyle(),
|
|
3759
|
+
label: o("dataValidation.alertStyle"),
|
|
3760
|
+
onChange: (e) => t.setAlertStyle(e.target.value),
|
|
3761
|
+
children: [
|
|
3762
|
+
ct(It, {
|
|
3763
|
+
value: E.AlertStyle.Stop,
|
|
3764
|
+
children: o("dataValidation.alertStop")
|
|
3765
|
+
}),
|
|
3766
|
+
ct(It, {
|
|
3767
|
+
value: E.AlertStyle.Warning,
|
|
3768
|
+
children: o("dataValidation.alertWarning")
|
|
3769
|
+
}),
|
|
3770
|
+
ct(It, {
|
|
3771
|
+
value: E.AlertStyle.Information,
|
|
3772
|
+
children: o("dataValidation.alertInformation")
|
|
3773
|
+
})
|
|
3774
|
+
]
|
|
3775
|
+
})]
|
|
3776
|
+
}),
|
|
3777
|
+
ct(zt, {
|
|
3778
|
+
size: "small",
|
|
3779
|
+
label: o("dataValidation.title"),
|
|
3780
|
+
value: t.getAlertTitle(),
|
|
3781
|
+
onChange: (e) => t.setAlertTitle(e.target.value),
|
|
3782
|
+
fullWidth: !0,
|
|
3783
|
+
sx: { backgroundColor: "background.paper" }
|
|
3784
|
+
}),
|
|
3785
|
+
ct(zt, {
|
|
3786
|
+
size: "small",
|
|
3787
|
+
label: o("dataValidation.message"),
|
|
3788
|
+
value: t.getAlertMessage(),
|
|
3789
|
+
onChange: (e) => t.setAlertMessage(e.target.value),
|
|
3790
|
+
multiline: !0,
|
|
3791
|
+
rows: 2,
|
|
3792
|
+
fullWidth: !0,
|
|
3793
|
+
sx: { backgroundColor: "background.paper" }
|
|
3794
|
+
})
|
|
3795
|
+
]
|
|
3796
|
+
})]
|
|
3797
|
+
}),
|
|
3798
|
+
n.length > 0 && ct(ht, {
|
|
3799
|
+
sx: {
|
|
3800
|
+
pl: 2,
|
|
3801
|
+
pr: 2,
|
|
3802
|
+
backgroundColor: "action.hover",
|
|
3803
|
+
border: 1,
|
|
3804
|
+
borderColor: "divider",
|
|
3805
|
+
borderRadius: 1
|
|
3806
|
+
},
|
|
3807
|
+
children: ct(Pt, {
|
|
3808
|
+
control: ct(xt, {
|
|
3809
|
+
checked: !t.isHideDropdown(),
|
|
3810
|
+
onChange: (e) => t.setHideDropdown(!e.target.checked)
|
|
3811
|
+
}),
|
|
3812
|
+
label: o("dataValidation.useCustomInput", { type: O.camelToPrettyCase(n[0]) })
|
|
3813
|
+
})
|
|
3814
|
+
})
|
|
3815
|
+
]
|
|
3816
|
+
});
|
|
3817
|
+
});
|
|
3818
|
+
Vn.displayName = "DataValidationEditorPanel";
|
|
3819
|
+
var $n = {
|
|
3820
|
+
key: "data-validation",
|
|
3821
|
+
messageKeys: {
|
|
3822
|
+
none: eo("dataValidation.none"),
|
|
3823
|
+
addPrompt: eo("dataValidation.addPrompt"),
|
|
3824
|
+
heading: eo("dataValidation.heading"),
|
|
3825
|
+
insert: eo("dataValidation.insert"),
|
|
3826
|
+
new: eo("dataValidation.new"),
|
|
3827
|
+
moveUp: eo("dataValidation.moveUp"),
|
|
3828
|
+
moveDown: eo("dataValidation.moveDown"),
|
|
3829
|
+
edit: eo("dataValidation.edit"),
|
|
3830
|
+
duplicate: eo("dataValidation.duplicate"),
|
|
3831
|
+
delete: eo("dataValidation.delete"),
|
|
3832
|
+
cancel: eo("dataValidation.cancel"),
|
|
3833
|
+
save: eo("dataValidation.save")
|
|
3834
|
+
},
|
|
3835
|
+
getCollection: (e) => e.getDataValidations(),
|
|
3836
|
+
changeEvents: ["onDataValidationsChange"],
|
|
3837
|
+
applyUpdate: (e, t) => {
|
|
3838
|
+
e.update(t);
|
|
3839
|
+
},
|
|
3840
|
+
getCardTitle: (e, t) => e.getCondition()?.toString() ?? t("dataValidation.noCondition"),
|
|
3841
|
+
CardBody: ({ item: e }) => {
|
|
3842
|
+
const t = We();
|
|
3843
|
+
return e.isShowPromptMessage() && e.getPromptTitle() ? ct($t, {
|
|
3844
|
+
variant: "caption",
|
|
3845
|
+
sx: {
|
|
3846
|
+
color: (e) => e.palette.text.secondary,
|
|
3847
|
+
fontStyle: "italic"
|
|
3848
|
+
},
|
|
3849
|
+
children: t("dataValidation.promptPrefix", { title: e.getPromptTitle() })
|
|
3850
|
+
}) : null;
|
|
3851
|
+
},
|
|
3852
|
+
EditorBody: ({ item: e }) => ct(Vn, { dataValidation: e })
|
|
3853
|
+
}, _n = Ke(Le((e, t) => {
|
|
3854
|
+
const { workbook: o, ...n } = e;
|
|
3855
|
+
return ct(so, {
|
|
3856
|
+
ref: t,
|
|
3857
|
+
workbook: o,
|
|
3858
|
+
descriptor: $n,
|
|
3859
|
+
dragReorder: !0,
|
|
3860
|
+
...n
|
|
3861
|
+
});
|
|
3862
|
+
}));
|
|
3863
|
+
_n.displayName = "DataValidationDetailsPanel";
|
|
3864
|
+
var Un = (e) => {
|
|
3865
|
+
const { model: t, entryKey: o, frame: n, ref: r, ...a } = e;
|
|
3866
|
+
return ct(_n, {
|
|
3867
|
+
ref: r,
|
|
3868
|
+
workbook: t,
|
|
3869
|
+
...a
|
|
3870
|
+
});
|
|
3871
|
+
}, qn = /* @__PURE__ */ new WeakMap(), Hn = Ke((e) => {
|
|
3872
|
+
const { protectedRange: t } = e, o = We();
|
|
3873
|
+
se(t, "onAnyChange");
|
|
3874
|
+
const n = t.isProtected(), [r, a] = He(() => t.getName()), [l] = He(() => t.getName()), [i, d] = He(null), [c, p] = He(""), [u, m] = He(!1), [g] = He(() => t.hasPassword()), h = (() => {
|
|
3875
|
+
try {
|
|
3876
|
+
const e = t.getRanges();
|
|
3877
|
+
return e.isInvalid() ? null : e.getSheet().getProtectedRanges();
|
|
3878
|
+
} catch {
|
|
3879
|
+
return null;
|
|
3880
|
+
}
|
|
3881
|
+
})(), y = () => {
|
|
3882
|
+
const e = r.trim();
|
|
3883
|
+
if (!e) return void d(o("protectedRange.nameRequired"));
|
|
3884
|
+
const n = h?.getItems({ name: e })[0];
|
|
3885
|
+
if (n && n.getName().toLocaleLowerCase() !== l.toLocaleLowerCase()) d(o("protectedRange.nameTaken", { name: e }));
|
|
3886
|
+
else if (e !== t.getName()) try {
|
|
3887
|
+
t.setName(e), d(null);
|
|
3888
|
+
} catch (e) {
|
|
3889
|
+
d(e?.message ?? o("protectedRange.nameRequired"));
|
|
3890
|
+
}
|
|
3891
|
+
else d(null);
|
|
3892
|
+
};
|
|
3893
|
+
return pt(Rt, {
|
|
3894
|
+
tabIndex: 0,
|
|
3895
|
+
className: s["editor-panel"],
|
|
3896
|
+
sx: {
|
|
3897
|
+
gap: (e) => e.spacing(1),
|
|
3898
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
3899
|
+
paddingBottom: (e) => e.spacing(2),
|
|
3900
|
+
paddingLeft: (e) => e.spacing(1.5),
|
|
3901
|
+
paddingRight: (e) => e.spacing(1.5),
|
|
3902
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
3903
|
+
borderRadius: (e) => e.spacing(1.25),
|
|
3904
|
+
overflow: "auto"
|
|
3905
|
+
},
|
|
3906
|
+
children: [ct(ht, {
|
|
3907
|
+
sx: { margin: (e) => e.spacing(1.25) },
|
|
3908
|
+
children: ct($t, {
|
|
3909
|
+
variant: "body2",
|
|
3910
|
+
sx: { color: "text.secondary" },
|
|
3911
|
+
children: o("protectedRange.range", { range: t.getRanges().toString() })
|
|
3912
|
+
})
|
|
3913
|
+
}), pt(ht, {
|
|
3914
|
+
sx: {
|
|
3915
|
+
display: "flex",
|
|
3916
|
+
flexDirection: "column",
|
|
3917
|
+
gap: (e) => e.spacing(2),
|
|
3918
|
+
margin: (e) => e.spacing(1.25)
|
|
3919
|
+
},
|
|
3920
|
+
children: [
|
|
3921
|
+
ct(zt, {
|
|
3922
|
+
label: o("protectedRange.name"),
|
|
3923
|
+
size: "small",
|
|
3924
|
+
fullWidth: !0,
|
|
3925
|
+
disabled: n,
|
|
3926
|
+
value: r,
|
|
3927
|
+
error: null !== i,
|
|
3928
|
+
helperText: i ?? void 0,
|
|
3929
|
+
onChange: (e) => {
|
|
3930
|
+
a(e.target.value), d(null);
|
|
3931
|
+
},
|
|
3932
|
+
onBlur: y,
|
|
3933
|
+
onKeyDown: (e) => {
|
|
3934
|
+
"Enter" === e.key && y();
|
|
3935
|
+
}
|
|
3936
|
+
}),
|
|
3937
|
+
ct(zt, {
|
|
3938
|
+
label: o("protectedRange.password"),
|
|
3939
|
+
size: "small",
|
|
3940
|
+
fullWidth: !0,
|
|
3941
|
+
disabled: n,
|
|
3942
|
+
type: "password",
|
|
3943
|
+
value: c,
|
|
3944
|
+
placeholder: g && !u ? o("protectedRange.passwordUnchanged") : void 0,
|
|
3945
|
+
helperText: o(u ? "protectedRange.passwordCleared" : "protectedRange.passwordHelp"),
|
|
3946
|
+
autoComplete: "new-password",
|
|
3947
|
+
onChange: (e) => {
|
|
3948
|
+
const o = e.target.value;
|
|
3949
|
+
p(o), m(!1), o ? qn.set(t, o) : qn.delete(t);
|
|
3950
|
+
},
|
|
3951
|
+
slotProps: { input: { startAdornment: g && !u ? ct(Dt, {
|
|
3952
|
+
position: "start",
|
|
3953
|
+
children: ct(fe, { iconKey: "Lock" })
|
|
3954
|
+
}) : void 0 } }
|
|
3955
|
+
}),
|
|
3956
|
+
g && !c ? ct(yt, {
|
|
3957
|
+
size: "small",
|
|
3958
|
+
color: "inherit",
|
|
3959
|
+
disabled: n || u,
|
|
3960
|
+
sx: {
|
|
3961
|
+
alignSelf: "flex-start",
|
|
3962
|
+
textTransform: "none"
|
|
3963
|
+
},
|
|
3964
|
+
onClick: () => {
|
|
3965
|
+
m(!0), qn.set(t, null);
|
|
3966
|
+
},
|
|
3967
|
+
children: o("protectedRange.removePassword")
|
|
3968
|
+
}) : null,
|
|
3969
|
+
t.getSecurityDescriptor() ? ct($t, {
|
|
3970
|
+
variant: "caption",
|
|
3971
|
+
sx: {
|
|
3972
|
+
color: "text.secondary",
|
|
3973
|
+
fontStyle: "italic"
|
|
3974
|
+
},
|
|
3975
|
+
children: o("protectedRange.hasPermissions")
|
|
3976
|
+
}) : null
|
|
3977
|
+
]
|
|
3978
|
+
})]
|
|
3979
|
+
});
|
|
3980
|
+
});
|
|
3981
|
+
Hn.displayName = "ProtectedRangeEditorPanel";
|
|
3982
|
+
var Gn = {
|
|
3983
|
+
key: "protected-range",
|
|
3984
|
+
messageKeys: {
|
|
3985
|
+
none: eo("protectedRange.none"),
|
|
3986
|
+
addPrompt: eo("protectedRange.addPrompt"),
|
|
3987
|
+
heading: eo("protectedRange.heading"),
|
|
3988
|
+
insert: eo("protectedRange.insert"),
|
|
3989
|
+
new: eo("protectedRange.new"),
|
|
3990
|
+
edit: eo("protectedRange.edit"),
|
|
3991
|
+
duplicate: eo("protectedRange.duplicate"),
|
|
3992
|
+
delete: eo("protectedRange.delete"),
|
|
3993
|
+
cancel: eo("protectedRange.cancel"),
|
|
3994
|
+
save: eo("protectedRange.save")
|
|
3995
|
+
},
|
|
3996
|
+
getCollection: (e) => e.getProtectedRanges(),
|
|
3997
|
+
changeEvents: ["onProtectedRangesChange"],
|
|
3998
|
+
reorderable: !1,
|
|
3999
|
+
beforeSave: (e) => (async (e) => {
|
|
4000
|
+
if (!qn.has(e)) return;
|
|
4001
|
+
const t = qn.get(e);
|
|
4002
|
+
qn.delete(e), await e.setPassword(t);
|
|
4003
|
+
})(e),
|
|
4004
|
+
applyUpdate: (e, t) => {
|
|
4005
|
+
e.update(t);
|
|
4006
|
+
},
|
|
4007
|
+
getCardTitle: (e, t) => e.getName() || t("protectedRange.unnamed"),
|
|
4008
|
+
CardBody: ({ item: e }) => {
|
|
4009
|
+
const t = We();
|
|
4010
|
+
return e.hasPassword() ? ct($t, {
|
|
4011
|
+
variant: "caption",
|
|
4012
|
+
sx: {
|
|
4013
|
+
color: (e) => e.palette.text.secondary,
|
|
4014
|
+
fontStyle: "italic"
|
|
4015
|
+
},
|
|
4016
|
+
children: t("protectedRange.passwordRequired")
|
|
4017
|
+
}) : null;
|
|
4018
|
+
},
|
|
4019
|
+
EditorBody: ({ item: e }) => ct(Hn, { protectedRange: e })
|
|
4020
|
+
}, Qn = Ke(Le((e, t) => {
|
|
4021
|
+
const { workbook: o, ...n } = e;
|
|
4022
|
+
return ct(so, {
|
|
4023
|
+
ref: t,
|
|
4024
|
+
workbook: o,
|
|
4025
|
+
descriptor: Gn,
|
|
4026
|
+
...n
|
|
4027
|
+
});
|
|
4028
|
+
}));
|
|
4029
|
+
Qn.displayName = "ProtectedRangeDetailsPanel";
|
|
4030
|
+
var Yn = (e) => {
|
|
4031
|
+
const { model: t, entryKey: o, frame: n, ref: r, ...a } = e;
|
|
4032
|
+
return ct(Qn, {
|
|
4033
|
+
ref: r,
|
|
4034
|
+
workbook: t,
|
|
4035
|
+
...a
|
|
4036
|
+
});
|
|
4037
|
+
};
|
|
4038
|
+
l(), ye.register("plugin-table", { icons: {} }), $.registerTaskPane({
|
|
4039
|
+
key: "dataValidationDetails",
|
|
4040
|
+
getTitle: () => "Data Validation",
|
|
4041
|
+
getIcon: () => "DataValidation",
|
|
4042
|
+
component: Un
|
|
4043
|
+
}, !0), $.registerTaskPane({
|
|
4044
|
+
key: "conditionalFormatDetails",
|
|
4045
|
+
getTitle: () => "Conditional Formatting",
|
|
4046
|
+
getIcon: () => "FormatPaint",
|
|
4047
|
+
component: xn
|
|
4048
|
+
}, !0), $.registerTaskPane({
|
|
4049
|
+
key: "protectedRangeDetails",
|
|
4050
|
+
getTitle: () => "Allow Edit Ranges",
|
|
4051
|
+
getIcon: () => "Lock",
|
|
4052
|
+
component: Yn
|
|
4053
|
+
}, !0), a(), w();
|
|
4054
|
+
var Xn = () => {
|
|
4055
|
+
let e, t;
|
|
4056
|
+
const o = new Promise((o, n) => {
|
|
4057
|
+
e = o, t = n;
|
|
4058
|
+
}), n = {
|
|
4059
|
+
promise: o,
|
|
4060
|
+
settled: !1,
|
|
4061
|
+
resolve: (t) => {
|
|
4062
|
+
n.settled = !0, e(t);
|
|
4063
|
+
},
|
|
4064
|
+
reject: (e) => {
|
|
4065
|
+
n.settled = !0, t(e);
|
|
4066
|
+
}
|
|
4067
|
+
};
|
|
4068
|
+
return o.catch(() => {}), n;
|
|
4069
|
+
}, Jn = (e, t) => {
|
|
4070
|
+
if (!e) return {};
|
|
4071
|
+
const { colorSchemes: o, ...n } = e, r = o?.[t ? "dark" : "light"];
|
|
4072
|
+
return r && "object" == typeof r ? Ht.deepMerge(n, r) : n;
|
|
4073
|
+
}, Zn = "taskPanePosition", er = Ke(Le((e, t) => {
|
|
4074
|
+
const { className: o, sx: r, square: a, elevation: l, variant: s, style: d, onWorkbookLoad: p, onDocumentError: u, renderDocumentError: m = P, propsDocumentError: g, propsTaskPaneArea: y, renderTaskPaneArea: b = tr, taskPaneSide: x = "right", onKeyDown: v, workbook: k, onWorkbookChange: w, logo: S, topLeft: T, topRight: D, muiTheme: N, tokens: O, cssBaseline: I, autoFocus: M = !1, title: R, onDirtyChange: A, propsDocumentTitle: E, renderDocumentLoading: W = C, propsDocumentLoading: B, propsWorkbook: L, showFormulaBar: z, propsFormulaBar: j, renderFormulaBar: K, editable: V, showStatusBar: $, propsStatusBar: _, renderStatusBar: U, propsToolbar: q, renderToolbar: H, ...te } = e, oe = qe(null), ne = qe(null), re = qe(null), ae = De(() => {
|
|
4075
|
+
re.current?.getNamedCollectionEditorElement?.()?.focus?.();
|
|
4076
|
+
}, []), le = De(u ?? (() => {}), [u]), pe = De(A ?? (() => {}), [A]), be = E?.placeHolder, [xe] = Re(Q.Mode, void 0), { themeMode: Ce } = Ae({ mode: xe ?? void 0 }), [we] = Re(ve.Active, null), Se = qe(we);
|
|
4077
|
+
Se.current = we;
|
|
4078
|
+
const Pe = Ee(), Ne = Ue(() => ({
|
|
4079
|
+
light: rt(!1, Ht.deepMerge(Jn(N, !1), F(Pe?.light))),
|
|
4080
|
+
dark: rt(!0, Ht.deepMerge(Jn(N, !0), F(Pe?.dark)))
|
|
4081
|
+
}), [
|
|
4082
|
+
N,
|
|
4083
|
+
Pe?.light,
|
|
4084
|
+
Pe?.dark
|
|
4085
|
+
]), Ie = "dark" === Ce, Me = Fe("studio", _e()), We = Ue(() => c(Ne.light, Ne.dark, `.${Me}`, O), [
|
|
4086
|
+
Ne,
|
|
4087
|
+
Me,
|
|
4088
|
+
O
|
|
4089
|
+
]), Be = Ue(() => J("sxl-defaults", `.${Me}`), [Me]), Le = ie(), [ze, je] = He(() => k ?? null);
|
|
4090
|
+
$e(() => {
|
|
4091
|
+
je(k ?? null);
|
|
4092
|
+
}, [k]);
|
|
4093
|
+
const [Ke, Ge] = He(0), Qe = qe(null);
|
|
4094
|
+
Qe.current || (Qe.current = Xn());
|
|
4095
|
+
const Je = ce(ze, {
|
|
4096
|
+
io: Y,
|
|
4097
|
+
defaultTheme: Le.getDefaultTheme(),
|
|
4098
|
+
reloadKey: Ke
|
|
4099
|
+
}), Ze = "loaded" === Je.status ? Je.workbook : null, et = Ue(() => "error" === Je.status ? {
|
|
4100
|
+
status: "error",
|
|
4101
|
+
error: Je.error
|
|
4102
|
+
} : "loaded" === Je.status ? {
|
|
4103
|
+
status: "loaded",
|
|
4104
|
+
workbook: Je.workbook
|
|
4105
|
+
} : { status: "loading" }, [Je]);
|
|
4106
|
+
$e(() => {
|
|
4107
|
+
Qe.current.settled && (Qe.current = Xn());
|
|
4108
|
+
}, [ze, Ke]), $e(() => {
|
|
4109
|
+
"loaded" === et.status ? Qe.current.resolve(et.workbook) : "error" === et.status && (le?.(et.error), Qe.current.reject(et.error));
|
|
4110
|
+
}, [et]);
|
|
4111
|
+
const [ot, nt] = He(null);
|
|
4112
|
+
Ze && !ot && nt(Ze);
|
|
4113
|
+
const at = Ze && ot && Ze !== ot ? Ze : null, lt = qe(at);
|
|
4114
|
+
lt.current = at;
|
|
4115
|
+
const it = qe(ot);
|
|
4116
|
+
it.current = ot;
|
|
4117
|
+
const st = qe([]), ut = Ve((e) => {
|
|
4118
|
+
const t = it.current;
|
|
4119
|
+
t && st.current.push(t), je(e);
|
|
4120
|
+
}, []);
|
|
4121
|
+
$e(() => {
|
|
4122
|
+
const e = st.current;
|
|
4123
|
+
if (0 !== e.length) {
|
|
4124
|
+
st.current = e.filter((e) => e === ot);
|
|
4125
|
+
for (let t = 0; t < e.length; t++) {
|
|
4126
|
+
const o = e[t];
|
|
4127
|
+
if (o !== ot) try {
|
|
4128
|
+
o.close();
|
|
4129
|
+
} catch (e) {
|
|
4130
|
+
console.warn("Unable to close the replaced workbook", e);
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
}, [ot]);
|
|
4135
|
+
const mt = V ? null : ot, gt = de(), yt = Ue(() => mt ? Z(mt.getSelectedSheet(), { referenceMode: gt }) : null, [mt, gt]), bt = V ?? yt, ft = qe(bt);
|
|
4136
|
+
ft.current = bt, $e(() => {
|
|
4137
|
+
if (!bt) return;
|
|
4138
|
+
let e = bt.getSession();
|
|
4139
|
+
return bt.subscribe(() => {
|
|
4140
|
+
const t = e;
|
|
4141
|
+
e = bt.getSession(), t && !e && "formula-bar" === t.getActiveEditorId() && re.current?.contains?.(document.activeElement) && oe.current?.focus();
|
|
4142
|
+
});
|
|
4143
|
+
}, [bt]);
|
|
4144
|
+
const xt = me(ot), { isDirty: vt, saveState: Ct } = ge(ot, Y), wt = ue(ot), St = qe(Ct);
|
|
4145
|
+
St.current = Ct;
|
|
4146
|
+
const Tt = Ve(() => St.current?.isDirty() ?? !1, []), Pt = qe(et);
|
|
4147
|
+
Pt.current = et;
|
|
4148
|
+
const [Ft, Dt] = He(null), Nt = R ?? E?.title, [Ot, It] = He(null);
|
|
4149
|
+
$e(() => {
|
|
4150
|
+
It(null);
|
|
4151
|
+
}, [ot]);
|
|
4152
|
+
const Mt = Nt ?? Ot ?? xt ?? "";
|
|
4153
|
+
$e(() => {
|
|
4154
|
+
pe?.(vt);
|
|
4155
|
+
}, [vt]);
|
|
4156
|
+
const At = De(w ?? (() => {}), [w]);
|
|
4157
|
+
$e(() => {
|
|
4158
|
+
At?.(Ze);
|
|
4159
|
+
}, [Ze]);
|
|
4160
|
+
const Et = qe(Ze);
|
|
4161
|
+
Et.current = Ze, se(ot, "onViewChange");
|
|
4162
|
+
const Bt = Ue(() => ct(Ye, {
|
|
4163
|
+
groupKey: "helpOptions",
|
|
4164
|
+
disableHover: !0,
|
|
4165
|
+
sx: { padding: "0" },
|
|
4166
|
+
propsButton: { sx: { maxHeight: "22px" } }
|
|
4167
|
+
}), []), [Lt, zt] = He(null), Kt = Ve((e) => {
|
|
4168
|
+
zt(e);
|
|
4169
|
+
}, []);
|
|
4170
|
+
$e(() => {
|
|
4171
|
+
ye.prefetch();
|
|
4172
|
+
}, []);
|
|
4173
|
+
const Vt = qe(null);
|
|
4174
|
+
Vt.current || (Vt.current = Xn());
|
|
4175
|
+
const $t = qe(null), _t = Ve(() => $t.current?.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? Vt.current.promise, []), Ut = De(async (e) => {
|
|
4176
|
+
const t = Se.current;
|
|
4177
|
+
t && t !== Qt.getActive() && await Qt.setActive(t), await he.DefaultCommandCatalogService.prefetch(t ?? void 0), Dt(e), $t.current = e.source, Vt.current.settled || Vt.current.resolve(e.source.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? null), p?.(e);
|
|
4178
|
+
}, []), qt = qe(null), Gt = Ve((e) => {
|
|
4179
|
+
let t = null, o = {
|
|
4180
|
+
readOnly: !0,
|
|
4181
|
+
...E
|
|
4182
|
+
};
|
|
4183
|
+
return E?.hidden || (t = ct(n, {
|
|
4184
|
+
...o,
|
|
4185
|
+
style: {
|
|
4186
|
+
maxWidth: "100%",
|
|
4187
|
+
...E?.style
|
|
4188
|
+
},
|
|
4189
|
+
workbook: e.workbook ?? oe.current,
|
|
4190
|
+
ref: qt,
|
|
4191
|
+
title: Mt,
|
|
4192
|
+
modified: vt,
|
|
4193
|
+
encrypted: wt,
|
|
4194
|
+
placeHolder: be,
|
|
4195
|
+
onTitleChange: (e) => {
|
|
4196
|
+
It(e), E?.onTitleChange?.(e);
|
|
4197
|
+
}
|
|
4198
|
+
})), ct(wn, {
|
|
4199
|
+
...e,
|
|
4200
|
+
logo: S,
|
|
4201
|
+
mainElement: t,
|
|
4202
|
+
startElement: T,
|
|
4203
|
+
endElement: D
|
|
4204
|
+
});
|
|
4205
|
+
}, [
|
|
4206
|
+
S,
|
|
4207
|
+
Mt,
|
|
4208
|
+
vt,
|
|
4209
|
+
wt,
|
|
4210
|
+
E,
|
|
4211
|
+
T,
|
|
4212
|
+
D
|
|
4213
|
+
]);
|
|
4214
|
+
$e(() => {
|
|
4215
|
+
const e = oe.current;
|
|
4216
|
+
if (!e) return;
|
|
4217
|
+
const t = (e) => e.preventDefault();
|
|
4218
|
+
return e.addEventListener("wheel", t, { passive: !1 }), () => {
|
|
4219
|
+
e.removeEventListener("wheel", t);
|
|
4220
|
+
};
|
|
4221
|
+
}, [Ft]);
|
|
4222
|
+
const [Yt, Xt] = He(null);
|
|
4223
|
+
$e(() => {
|
|
4224
|
+
Xt(Ft?.source?.getCommandScope?.() ?? null);
|
|
4225
|
+
}, [Ft]);
|
|
4226
|
+
const Jt = Ue(() => ({
|
|
4227
|
+
"& .SnackbarContainer-root": { position: "absolute !important" },
|
|
4228
|
+
"& .notistack-SnackbarContainer > div": { maxWidth: "min(100%, 720px)" },
|
|
4229
|
+
"& .notistack-Snackbar": { minWidth: "unset" },
|
|
4230
|
+
"& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
|
|
4231
|
+
"& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
|
|
4232
|
+
"& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
|
|
4233
|
+
"& .notistack-MuiContent *": { fontFamily: (e) => e.typography.fontFamily },
|
|
4234
|
+
"& #notistack-snackbar": {
|
|
4235
|
+
maxWidth: "560px",
|
|
4236
|
+
whiteSpace: "pre-wrap"
|
|
4237
|
+
},
|
|
4238
|
+
"*": { userSelect: "none" },
|
|
4239
|
+
...r
|
|
4240
|
+
}), [r]), [Zt, eo] = He(null), [, to] = Re(null, !1);
|
|
4241
|
+
$e(() => {
|
|
4242
|
+
to(null != Zt);
|
|
4243
|
+
}, [Zt, to]);
|
|
4244
|
+
const ro = Ve((e) => b({
|
|
4245
|
+
model: ot,
|
|
4246
|
+
side: x,
|
|
4247
|
+
...e,
|
|
4248
|
+
...y
|
|
4249
|
+
}), [
|
|
4250
|
+
ot,
|
|
4251
|
+
x,
|
|
4252
|
+
y
|
|
4253
|
+
]), ao = Oe(t, () => ({
|
|
4254
|
+
isStudioElement: () => !0,
|
|
4255
|
+
getWorkbookElement: () => oe.current,
|
|
4256
|
+
getWorkbook: () => Et.current ?? null,
|
|
4257
|
+
isDirty: () => St.current?.isDirty() ?? !1,
|
|
4258
|
+
getEditable: () => ft.current,
|
|
4259
|
+
getFormulaBarElement: () => re.current ?? null,
|
|
4260
|
+
focus: () => oe.current?.focus(),
|
|
4261
|
+
whenReady: () => (Qe.current || (Qe.current = Xn()), Qe.current.promise),
|
|
4262
|
+
getWorkbookState: () => Pt.current,
|
|
4263
|
+
retry: () => Ge((e) => e + 1)
|
|
4264
|
+
}), []), io = qe(!1), so = De((e, t) => {
|
|
4265
|
+
t === lt.current && requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
4266
|
+
t === lt.current && (io.current = ao.current?.contains(document.activeElement) ?? !0, nt(t), Ut(e));
|
|
4267
|
+
}));
|
|
4268
|
+
}, []);
|
|
4269
|
+
$e(() => {
|
|
4270
|
+
io.current && (io.current = !1, oe.current?.focus());
|
|
4271
|
+
}, [ot]);
|
|
4272
|
+
const co = Ve(() => ct(dt, {}), []), po = Ve((e) => {
|
|
4273
|
+
const { ref: t, ...o } = e, n = Ie ? Ne.dark : Ne.light, d = "error" === et.status ? m({
|
|
4274
|
+
...g,
|
|
4275
|
+
style: {
|
|
4276
|
+
width: "100%",
|
|
4277
|
+
height: "100%",
|
|
4278
|
+
...g?.style
|
|
4279
|
+
},
|
|
4280
|
+
error: et.error
|
|
4281
|
+
}) : null;
|
|
4282
|
+
if (d && !ot) return ct(Rt, {
|
|
4283
|
+
sx: r,
|
|
4284
|
+
style: {
|
|
4285
|
+
width: "100%",
|
|
4286
|
+
height: "100%",
|
|
4287
|
+
position: "absolute",
|
|
4288
|
+
display: "flex",
|
|
4289
|
+
alignItems: "stretch",
|
|
4290
|
+
justifyContent: "stretch"
|
|
4291
|
+
},
|
|
4292
|
+
children: d
|
|
4293
|
+
});
|
|
4294
|
+
let c = null;
|
|
4295
|
+
if (ot) {
|
|
4296
|
+
const e = ot, r = e.getView(), a = z ?? r?.isShowFormulaBar(), l = $ ?? r?.isShowStatusBar(), s = Ft?.source ?? oe.current, d = (H ?? Gt)({
|
|
4297
|
+
workbook: s,
|
|
4298
|
+
...q
|
|
4299
|
+
}), p = a ? (K ?? f)({
|
|
4300
|
+
ref: re,
|
|
4301
|
+
style: {
|
|
4302
|
+
marginTop: n.spacing(.25),
|
|
4303
|
+
marginLeft: n.spacing(1),
|
|
4304
|
+
marginRight: n.spacing(1),
|
|
4305
|
+
marginBottom: n.spacing(.75)
|
|
4306
|
+
},
|
|
4307
|
+
workbook: e,
|
|
4308
|
+
editable: bt ?? void 0,
|
|
4309
|
+
...j,
|
|
4310
|
+
propsNamedCollectionEditor: {
|
|
4311
|
+
restoreFocus: (e) => s?.focus(e),
|
|
4312
|
+
...j?.propsNamedCollectionEditor
|
|
4313
|
+
}
|
|
4314
|
+
}) : null, u = l ? (U ?? h)({
|
|
4315
|
+
childrenEnd: Bt,
|
|
4316
|
+
..._
|
|
4317
|
+
}) : null, m = (e, n) => ct(i, {
|
|
4318
|
+
...L,
|
|
4319
|
+
tabIndex: 0,
|
|
4320
|
+
autoFocus: !n && M,
|
|
4321
|
+
workbook: e,
|
|
4322
|
+
editable: n ? void 0 : bt ?? void 0,
|
|
4323
|
+
focusNameBox: n ? void 0 : ae,
|
|
4324
|
+
ref: n ? ne : no([t, oe]),
|
|
4325
|
+
onWorkbookLoad: n ? (t) => so(t, e) : Ut,
|
|
4326
|
+
onKeyDown: (e) => {
|
|
4327
|
+
v?.(e);
|
|
4328
|
+
},
|
|
4329
|
+
propsWorkbookLoading: B,
|
|
4330
|
+
renderWorkbookLoading: co,
|
|
4331
|
+
style: n ? {
|
|
4332
|
+
...L?.style,
|
|
4333
|
+
position: "absolute",
|
|
4334
|
+
inset: 0,
|
|
4335
|
+
visibility: "hidden"
|
|
4336
|
+
} : {
|
|
4337
|
+
flex: "1 1 100%",
|
|
4338
|
+
minHeight: 0,
|
|
4339
|
+
...L?.style
|
|
4340
|
+
},
|
|
4341
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
4342
|
+
...n ? null : o
|
|
4343
|
+
}, e.getId());
|
|
4344
|
+
c = pt("div", {
|
|
4345
|
+
style: {
|
|
4346
|
+
display: "flex",
|
|
4347
|
+
flexDirection: "column",
|
|
4348
|
+
flex: "1 1 100%",
|
|
4349
|
+
minWidth: 0,
|
|
4350
|
+
minHeight: 0,
|
|
4351
|
+
...ee({
|
|
4352
|
+
window: n.palette.background.default,
|
|
4353
|
+
windowText: n.palette.text.primary
|
|
4354
|
+
})
|
|
4355
|
+
},
|
|
4356
|
+
children: [
|
|
4357
|
+
d,
|
|
4358
|
+
p,
|
|
4359
|
+
ct(Kn, {
|
|
4360
|
+
taskSide: x,
|
|
4361
|
+
persistKey: Zn,
|
|
4362
|
+
sidebarElement: Zt ? ct(he.CommandScopeProvider, {
|
|
4363
|
+
scope: Yt,
|
|
4364
|
+
children: Zt
|
|
4365
|
+
}) : void 0,
|
|
4366
|
+
mainElement: pt("div", {
|
|
4367
|
+
style: {
|
|
4368
|
+
position: "relative",
|
|
4369
|
+
display: "flex",
|
|
4370
|
+
flexDirection: "column",
|
|
4371
|
+
flex: "1 1 100%",
|
|
4372
|
+
minWidth: 0,
|
|
4373
|
+
minHeight: 0
|
|
4374
|
+
},
|
|
4375
|
+
children: [[m(ot, !1), at ? m(at, !0) : null], ct(ht, {
|
|
4376
|
+
ref: Kt,
|
|
4377
|
+
sx: {
|
|
4378
|
+
position: "absolute",
|
|
4379
|
+
top: "10%",
|
|
4380
|
+
left: 0,
|
|
4381
|
+
right: 0,
|
|
4382
|
+
bottom: 0,
|
|
4383
|
+
pointerEvents: "none",
|
|
4384
|
+
"& > :first-of-type": { position: "relative" }
|
|
4385
|
+
}
|
|
4386
|
+
})]
|
|
4387
|
+
})
|
|
4388
|
+
}),
|
|
4389
|
+
u
|
|
4390
|
+
]
|
|
4391
|
+
});
|
|
4392
|
+
}
|
|
4393
|
+
const p = Ft ? null : W({ ...B });
|
|
4394
|
+
return pt(Rt, {
|
|
4395
|
+
sx: Jt,
|
|
4396
|
+
style: {
|
|
4397
|
+
width: "100%",
|
|
4398
|
+
height: "100%",
|
|
4399
|
+
position: "absolute",
|
|
4400
|
+
display: "flex",
|
|
4401
|
+
alignItems: "stretch",
|
|
4402
|
+
justifyContent: "stretch",
|
|
4403
|
+
backgroundColor: "var(--sxl-color-base-200)"
|
|
4404
|
+
},
|
|
4405
|
+
className: "eager-studio",
|
|
4406
|
+
square: a,
|
|
4407
|
+
elevation: l,
|
|
4408
|
+
variant: s,
|
|
4409
|
+
children: [
|
|
4410
|
+
c,
|
|
4411
|
+
d ? ct(Rt, {
|
|
4412
|
+
style: {
|
|
4413
|
+
position: "absolute",
|
|
4414
|
+
inset: 0,
|
|
4415
|
+
display: "flex",
|
|
4416
|
+
alignItems: "stretch",
|
|
4417
|
+
justifyContent: "stretch"
|
|
4418
|
+
},
|
|
4419
|
+
children: d
|
|
4420
|
+
}) : null,
|
|
4421
|
+
p ? ct("div", {
|
|
4422
|
+
style: {
|
|
4423
|
+
position: "absolute",
|
|
4424
|
+
inset: 0,
|
|
4425
|
+
display: "flex",
|
|
4426
|
+
alignItems: "center",
|
|
4427
|
+
justifyContent: "center",
|
|
4428
|
+
background: `var(--sxl-color-base-100, ${Ie ? "#121212" : "#fff"})`
|
|
4429
|
+
},
|
|
4430
|
+
children: p
|
|
4431
|
+
}) : null
|
|
4432
|
+
]
|
|
4433
|
+
});
|
|
4434
|
+
}, [
|
|
4435
|
+
et,
|
|
4436
|
+
ot,
|
|
4437
|
+
at,
|
|
4438
|
+
Ft,
|
|
4439
|
+
Mt,
|
|
4440
|
+
W,
|
|
4441
|
+
B,
|
|
4442
|
+
co,
|
|
4443
|
+
L,
|
|
4444
|
+
te,
|
|
4445
|
+
a,
|
|
4446
|
+
l,
|
|
4447
|
+
s,
|
|
4448
|
+
Bt,
|
|
4449
|
+
m,
|
|
4450
|
+
g,
|
|
4451
|
+
Gt,
|
|
4452
|
+
Jt,
|
|
4453
|
+
Zt,
|
|
4454
|
+
x,
|
|
4455
|
+
Yt,
|
|
4456
|
+
z,
|
|
4457
|
+
j,
|
|
4458
|
+
K,
|
|
4459
|
+
bt,
|
|
4460
|
+
$,
|
|
4461
|
+
_,
|
|
4462
|
+
U,
|
|
4463
|
+
q,
|
|
4464
|
+
H,
|
|
4465
|
+
Ne,
|
|
4466
|
+
Ie
|
|
4467
|
+
]);
|
|
4468
|
+
let uo = ct(lo, {
|
|
4469
|
+
maxSnack: 3,
|
|
4470
|
+
domRoot: Lt ?? void 0,
|
|
4471
|
+
anchorOrigin: {
|
|
4472
|
+
vertical: "bottom",
|
|
4473
|
+
horizontal: "right"
|
|
4474
|
+
},
|
|
4475
|
+
autoHideDuration: 3500,
|
|
4476
|
+
onClose: (e, t, o) => {
|
|
4477
|
+
oe.current?.focus();
|
|
4478
|
+
},
|
|
4479
|
+
Components: { error: Cn },
|
|
4480
|
+
iconVariant: {
|
|
4481
|
+
success: ct(Wt, {
|
|
4482
|
+
style: { marginRight: "8px" },
|
|
4483
|
+
children: ct("path", { d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z" })
|
|
4484
|
+
}),
|
|
4485
|
+
error: ct(fe, {
|
|
4486
|
+
iconKey: "ErrorAlert",
|
|
4487
|
+
style: { marginRight: "8px" }
|
|
4488
|
+
})
|
|
4489
|
+
},
|
|
4490
|
+
children: ct(X, {
|
|
4491
|
+
workbook: ot,
|
|
4492
|
+
children: ct(G, {
|
|
4493
|
+
renderArea: ro,
|
|
4494
|
+
onUpdateArea: (e) => {
|
|
4495
|
+
eo(e);
|
|
4496
|
+
},
|
|
4497
|
+
children: ct(tt, { children: ct(Rn, { children: ct(Te, { children: ct(ke, { children: ct(On, {
|
|
4498
|
+
workbook: ot,
|
|
4499
|
+
initialCommandAnchor: _t,
|
|
4500
|
+
renderWorkbook: po,
|
|
4501
|
+
setWorkbook: ut,
|
|
4502
|
+
titleWorkbook: Mt,
|
|
4503
|
+
setWorkbookTitle: It,
|
|
4504
|
+
refDocumentTitle: qt,
|
|
4505
|
+
isDirty: Tt
|
|
4506
|
+
}) }) }) }) })
|
|
4507
|
+
})
|
|
4508
|
+
})
|
|
4509
|
+
});
|
|
4510
|
+
return uo = pt(jt, {
|
|
4511
|
+
theme: Ie ? Ne.dark : Ne.light,
|
|
4512
|
+
children: [I ? ct(kt, {}) : null, pt("div", {
|
|
4513
|
+
ref: ao,
|
|
4514
|
+
className: oo("sheetxl-studio", Me, o),
|
|
4515
|
+
"data-sxl-theme-mode": Ie ? "dark" : "light",
|
|
4516
|
+
style: {
|
|
4517
|
+
display: "flex",
|
|
4518
|
+
flexDirection: "column",
|
|
4519
|
+
flex: "1 1 100%",
|
|
4520
|
+
width: "100%",
|
|
4521
|
+
height: "100%",
|
|
4522
|
+
minWidth: 0,
|
|
4523
|
+
minHeight: 0,
|
|
4524
|
+
position: "relative",
|
|
4525
|
+
...d
|
|
4526
|
+
},
|
|
4527
|
+
...te,
|
|
4528
|
+
children: [
|
|
4529
|
+
ct("style", { children: We }),
|
|
4530
|
+
ct("style", { children: Be }),
|
|
4531
|
+
ct(Xe, {
|
|
4532
|
+
themeScopeClass: Me,
|
|
4533
|
+
themeSurface: "app",
|
|
4534
|
+
themeMode: Ce,
|
|
4535
|
+
children: uo
|
|
4536
|
+
})
|
|
4537
|
+
]
|
|
4538
|
+
})]
|
|
4539
|
+
}), uo;
|
|
4540
|
+
}));
|
|
4541
|
+
er.displayName = "EagerStudio";
|
|
4542
|
+
var tr = (e) => ct(Bn, { ...e });
|
|
4543
|
+
export { er as EagerStudio, er as default };
|