@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,1376 @@
|
|
|
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 { t as e } from "./BkcTkK4tR4b-px3e.mjs";
|
|
8
|
+
import { ReactUtils as t } from "@sheetxl/utils-react";
|
|
9
|
+
import { Component as n, PureComponent as r, memo as i, useCallback as a, useLayoutEffect as o, useState as s } from "react";
|
|
10
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
+
import { Box as u, useTheme as d } from "@mui/material";
|
|
12
|
+
function f(e) {
|
|
13
|
+
return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
14
|
+
return typeof e;
|
|
15
|
+
} : function(e) {
|
|
16
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
17
|
+
}, f(e);
|
|
18
|
+
}
|
|
19
|
+
var p = /^\s+/, m = /\s+$/;
|
|
20
|
+
function h(e, t) {
|
|
21
|
+
if (t ||= {}, (e ||= "") instanceof h) return e;
|
|
22
|
+
if (!(this instanceof h)) return new h(e, t);
|
|
23
|
+
var n = function(e) {
|
|
24
|
+
var t = {
|
|
25
|
+
r: 0,
|
|
26
|
+
g: 0,
|
|
27
|
+
b: 0
|
|
28
|
+
}, n = 1, r = null, i = null, a = null, o = !1, s = !1;
|
|
29
|
+
typeof e == "string" && (e = function(e) {
|
|
30
|
+
e = e.replace(p, "").replace(m, "").toLowerCase();
|
|
31
|
+
var t, n = !1;
|
|
32
|
+
if (M[e]) e = M[e], n = !0;
|
|
33
|
+
else if (e == "transparent") return {
|
|
34
|
+
r: 0,
|
|
35
|
+
g: 0,
|
|
36
|
+
b: 0,
|
|
37
|
+
a: 0,
|
|
38
|
+
format: "name"
|
|
39
|
+
};
|
|
40
|
+
return (t = G.rgb.exec(e)) ? {
|
|
41
|
+
r: t[1],
|
|
42
|
+
g: t[2],
|
|
43
|
+
b: t[3]
|
|
44
|
+
} : (t = G.rgba.exec(e)) ? {
|
|
45
|
+
r: t[1],
|
|
46
|
+
g: t[2],
|
|
47
|
+
b: t[3],
|
|
48
|
+
a: t[4]
|
|
49
|
+
} : (t = G.hsl.exec(e)) ? {
|
|
50
|
+
h: t[1],
|
|
51
|
+
s: t[2],
|
|
52
|
+
l: t[3]
|
|
53
|
+
} : (t = G.hsla.exec(e)) ? {
|
|
54
|
+
h: t[1],
|
|
55
|
+
s: t[2],
|
|
56
|
+
l: t[3],
|
|
57
|
+
a: t[4]
|
|
58
|
+
} : (t = G.hsv.exec(e)) ? {
|
|
59
|
+
h: t[1],
|
|
60
|
+
s: t[2],
|
|
61
|
+
v: t[3]
|
|
62
|
+
} : (t = G.hsva.exec(e)) ? {
|
|
63
|
+
h: t[1],
|
|
64
|
+
s: t[2],
|
|
65
|
+
v: t[3],
|
|
66
|
+
a: t[4]
|
|
67
|
+
} : (t = G.hex8.exec(e)) ? {
|
|
68
|
+
r: L(t[1]),
|
|
69
|
+
g: L(t[2]),
|
|
70
|
+
b: L(t[3]),
|
|
71
|
+
a: V(t[4]),
|
|
72
|
+
format: n ? "name" : "hex8"
|
|
73
|
+
} : (t = G.hex6.exec(e)) ? {
|
|
74
|
+
r: L(t[1]),
|
|
75
|
+
g: L(t[2]),
|
|
76
|
+
b: L(t[3]),
|
|
77
|
+
format: n ? "name" : "hex"
|
|
78
|
+
} : (t = G.hex4.exec(e)) ? {
|
|
79
|
+
r: L(t[1] + "" + t[1]),
|
|
80
|
+
g: L(t[2] + "" + t[2]),
|
|
81
|
+
b: L(t[3] + "" + t[3]),
|
|
82
|
+
a: V(t[4] + "" + t[4]),
|
|
83
|
+
format: n ? "name" : "hex8"
|
|
84
|
+
} : !!(t = G.hex3.exec(e)) && {
|
|
85
|
+
r: L(t[1] + "" + t[1]),
|
|
86
|
+
g: L(t[2] + "" + t[2]),
|
|
87
|
+
b: L(t[3] + "" + t[3]),
|
|
88
|
+
format: n ? "name" : "hex"
|
|
89
|
+
};
|
|
90
|
+
}(e)), f(e) == "object" && (K(e.r) && K(e.g) && K(e.b) ? (c = e.r, l = e.g, u = e.b, t = {
|
|
91
|
+
r: 255 * F(c, 255),
|
|
92
|
+
g: 255 * F(l, 255),
|
|
93
|
+
b: 255 * F(u, 255)
|
|
94
|
+
}, o = !0, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : K(e.h) && K(e.s) && K(e.v) ? (r = z(e.s), i = z(e.v), t = function(e, t, n) {
|
|
95
|
+
e = 6 * F(e, 360), t = F(t, 100), n = F(n, 100);
|
|
96
|
+
var r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
|
|
97
|
+
n,
|
|
98
|
+
o,
|
|
99
|
+
a,
|
|
100
|
+
a,
|
|
101
|
+
s,
|
|
102
|
+
n
|
|
103
|
+
][c], u = [
|
|
104
|
+
s,
|
|
105
|
+
n,
|
|
106
|
+
n,
|
|
107
|
+
o,
|
|
108
|
+
a,
|
|
109
|
+
a
|
|
110
|
+
][c], d = [
|
|
111
|
+
a,
|
|
112
|
+
a,
|
|
113
|
+
s,
|
|
114
|
+
n,
|
|
115
|
+
n,
|
|
116
|
+
o
|
|
117
|
+
][c];
|
|
118
|
+
return {
|
|
119
|
+
r: 255 * l,
|
|
120
|
+
g: 255 * u,
|
|
121
|
+
b: 255 * d
|
|
122
|
+
};
|
|
123
|
+
}(e.h, r, i), o = !0, s = "hsv") : K(e.h) && K(e.s) && K(e.l) && (r = z(e.s), a = z(e.l), t = function(e, t, n) {
|
|
124
|
+
var r, i, a;
|
|
125
|
+
function o(e, t, n) {
|
|
126
|
+
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + 6 * (t - e) * n : n < .5 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
127
|
+
}
|
|
128
|
+
if (e = F(e, 360), t = F(t, 100), n = F(n, 100), t === 0) r = i = a = n;
|
|
129
|
+
else {
|
|
130
|
+
var s = n < .5 ? n * (1 + t) : n + t - n * t, c = 2 * n - s;
|
|
131
|
+
r = o(c, s, e + 1 / 3), i = o(c, s, e), a = o(c, s, e - 1 / 3);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
r: 255 * r,
|
|
135
|
+
g: 255 * i,
|
|
136
|
+
b: 255 * a
|
|
137
|
+
};
|
|
138
|
+
}(e.h, r, a), o = !0, s = "hsl"), e.hasOwnProperty("a") && (n = e.a));
|
|
139
|
+
var c, l, u;
|
|
140
|
+
return n = P(n), {
|
|
141
|
+
ok: o,
|
|
142
|
+
format: e.format || s,
|
|
143
|
+
r: Math.min(255, Math.max(t.r, 0)),
|
|
144
|
+
g: Math.min(255, Math.max(t.g, 0)),
|
|
145
|
+
b: Math.min(255, Math.max(t.b, 0)),
|
|
146
|
+
a: n
|
|
147
|
+
};
|
|
148
|
+
}(e);
|
|
149
|
+
this._originalInput = e, this._r = n.r, this._g = n.g, this._b = n.b, this._a = n.a, this._roundA = Math.round(100 * this._a) / 100, this._format = t.format || n.format, this._gradientType = t.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = n.ok;
|
|
150
|
+
}
|
|
151
|
+
function g(e, t, n) {
|
|
152
|
+
e = F(e, 255), t = F(t, 255), n = F(n, 255);
|
|
153
|
+
var r, i, a = Math.max(e, t, n), o = Math.min(e, t, n), s = (a + o) / 2;
|
|
154
|
+
if (a == o) r = i = 0;
|
|
155
|
+
else {
|
|
156
|
+
var c = a - o;
|
|
157
|
+
switch (i = s > .5 ? c / (2 - a - o) : c / (a + o), a) {
|
|
158
|
+
case e:
|
|
159
|
+
r = (t - n) / c + (t < n ? 6 : 0);
|
|
160
|
+
break;
|
|
161
|
+
case t:
|
|
162
|
+
r = (n - e) / c + 2;
|
|
163
|
+
break;
|
|
164
|
+
case n: r = (e - t) / c + 4;
|
|
165
|
+
}
|
|
166
|
+
r /= 6;
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
h: r,
|
|
170
|
+
s: i,
|
|
171
|
+
l: s
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function _(e, t, n) {
|
|
175
|
+
e = F(e, 255), t = F(t, 255), n = F(n, 255);
|
|
176
|
+
var r, i, a = Math.max(e, t, n), o = Math.min(e, t, n), s = a, c = a - o;
|
|
177
|
+
if (i = a === 0 ? 0 : c / a, a == o) r = 0;
|
|
178
|
+
else {
|
|
179
|
+
switch (a) {
|
|
180
|
+
case e:
|
|
181
|
+
r = (t - n) / c + (t < n ? 6 : 0);
|
|
182
|
+
break;
|
|
183
|
+
case t:
|
|
184
|
+
r = (n - e) / c + 2;
|
|
185
|
+
break;
|
|
186
|
+
case n: r = (e - t) / c + 4;
|
|
187
|
+
}
|
|
188
|
+
r /= 6;
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
h: r,
|
|
192
|
+
s: i,
|
|
193
|
+
v: s
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function v(e, t, n, r) {
|
|
197
|
+
var i = [
|
|
198
|
+
R(Math.round(e).toString(16)),
|
|
199
|
+
R(Math.round(t).toString(16)),
|
|
200
|
+
R(Math.round(n).toString(16))
|
|
201
|
+
];
|
|
202
|
+
return r && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
|
|
203
|
+
}
|
|
204
|
+
function y(e, t, n, r) {
|
|
205
|
+
return [
|
|
206
|
+
R(B(r)),
|
|
207
|
+
R(Math.round(e).toString(16)),
|
|
208
|
+
R(Math.round(t).toString(16)),
|
|
209
|
+
R(Math.round(n).toString(16))
|
|
210
|
+
].join("");
|
|
211
|
+
}
|
|
212
|
+
function b(e, t) {
|
|
213
|
+
t = t === 0 ? 0 : t || 10;
|
|
214
|
+
var n = h(e).toHsl();
|
|
215
|
+
return n.s -= t / 100, n.s = I(n.s), h(n);
|
|
216
|
+
}
|
|
217
|
+
function x(e, t) {
|
|
218
|
+
t = t === 0 ? 0 : t || 10;
|
|
219
|
+
var n = h(e).toHsl();
|
|
220
|
+
return n.s += t / 100, n.s = I(n.s), h(n);
|
|
221
|
+
}
|
|
222
|
+
function S(e) {
|
|
223
|
+
return h(e).desaturate(100);
|
|
224
|
+
}
|
|
225
|
+
function C(e, t) {
|
|
226
|
+
t = t === 0 ? 0 : t || 10;
|
|
227
|
+
var n = h(e).toHsl();
|
|
228
|
+
return n.l += t / 100, n.l = I(n.l), h(n);
|
|
229
|
+
}
|
|
230
|
+
function w(e, t) {
|
|
231
|
+
t = t === 0 ? 0 : t || 10;
|
|
232
|
+
var n = h(e).toRgb();
|
|
233
|
+
return n.r = Math.max(0, Math.min(255, n.r - Math.round(-t / 100 * 255))), n.g = Math.max(0, Math.min(255, n.g - Math.round(-t / 100 * 255))), n.b = Math.max(0, Math.min(255, n.b - Math.round(-t / 100 * 255))), h(n);
|
|
234
|
+
}
|
|
235
|
+
function T(e, t) {
|
|
236
|
+
t = t === 0 ? 0 : t || 10;
|
|
237
|
+
var n = h(e).toHsl();
|
|
238
|
+
return n.l -= t / 100, n.l = I(n.l), h(n);
|
|
239
|
+
}
|
|
240
|
+
function E(e, t) {
|
|
241
|
+
var n = h(e).toHsl(), r = (n.h + t) % 360;
|
|
242
|
+
return n.h = r < 0 ? 360 + r : r, h(n);
|
|
243
|
+
}
|
|
244
|
+
function D(e) {
|
|
245
|
+
var t = h(e).toHsl();
|
|
246
|
+
return t.h = (t.h + 180) % 360, h(t);
|
|
247
|
+
}
|
|
248
|
+
function O(e, t) {
|
|
249
|
+
if (isNaN(t) || t <= 0) throw Error("Argument to polyad must be a positive number");
|
|
250
|
+
for (var n = h(e).toHsl(), r = [h(e)], i = 360 / t, a = 1; a < t; a++) r.push(h({
|
|
251
|
+
h: (n.h + a * i) % 360,
|
|
252
|
+
s: n.s,
|
|
253
|
+
l: n.l
|
|
254
|
+
}));
|
|
255
|
+
return r;
|
|
256
|
+
}
|
|
257
|
+
function k(e) {
|
|
258
|
+
var t = h(e).toHsl(), n = t.h;
|
|
259
|
+
return [
|
|
260
|
+
h(e),
|
|
261
|
+
h({
|
|
262
|
+
h: (n + 72) % 360,
|
|
263
|
+
s: t.s,
|
|
264
|
+
l: t.l
|
|
265
|
+
}),
|
|
266
|
+
h({
|
|
267
|
+
h: (n + 216) % 360,
|
|
268
|
+
s: t.s,
|
|
269
|
+
l: t.l
|
|
270
|
+
})
|
|
271
|
+
];
|
|
272
|
+
}
|
|
273
|
+
function A(e, t, n) {
|
|
274
|
+
t ||= 6, n ||= 30;
|
|
275
|
+
var r = h(e).toHsl(), i = 360 / n, a = [h(e)];
|
|
276
|
+
for (r.h = (r.h - (i * t >> 1) + 720) % 360; --t;) r.h = (r.h + i) % 360, a.push(h(r));
|
|
277
|
+
return a;
|
|
278
|
+
}
|
|
279
|
+
function j(e, t) {
|
|
280
|
+
t ||= 6;
|
|
281
|
+
for (var n = h(e).toHsv(), r = n.h, i = n.s, a = n.v, o = [], s = 1 / t; t--;) o.push(h({
|
|
282
|
+
h: r,
|
|
283
|
+
s: i,
|
|
284
|
+
v: a
|
|
285
|
+
})), a = (a + s) % 1;
|
|
286
|
+
return o;
|
|
287
|
+
}
|
|
288
|
+
h.prototype = {
|
|
289
|
+
isDark: function() {
|
|
290
|
+
return this.getBrightness() < 128;
|
|
291
|
+
},
|
|
292
|
+
isLight: function() {
|
|
293
|
+
return !this.isDark();
|
|
294
|
+
},
|
|
295
|
+
isValid: function() {
|
|
296
|
+
return this._ok;
|
|
297
|
+
},
|
|
298
|
+
getOriginalInput: function() {
|
|
299
|
+
return this._originalInput;
|
|
300
|
+
},
|
|
301
|
+
getFormat: function() {
|
|
302
|
+
return this._format;
|
|
303
|
+
},
|
|
304
|
+
getAlpha: function() {
|
|
305
|
+
return this._a;
|
|
306
|
+
},
|
|
307
|
+
getBrightness: function() {
|
|
308
|
+
var e = this.toRgb();
|
|
309
|
+
return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3;
|
|
310
|
+
},
|
|
311
|
+
getLuminance: function() {
|
|
312
|
+
var e = this.toRgb(), t = e.r / 255, n = e.g / 255, r = e.b / 255;
|
|
313
|
+
return .2126 * (t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4) + .7152 * (n <= .03928 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4) + .0722 * (r <= .03928 ? r / 12.92 : ((r + .055) / 1.055) ** 2.4);
|
|
314
|
+
},
|
|
315
|
+
setAlpha: function(e) {
|
|
316
|
+
return this._a = P(e), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
317
|
+
},
|
|
318
|
+
toHsv: function() {
|
|
319
|
+
var e = _(this._r, this._g, this._b);
|
|
320
|
+
return {
|
|
321
|
+
h: 360 * e.h,
|
|
322
|
+
s: e.s,
|
|
323
|
+
v: e.v,
|
|
324
|
+
a: this._a
|
|
325
|
+
};
|
|
326
|
+
},
|
|
327
|
+
toHsvString: function() {
|
|
328
|
+
var e = _(this._r, this._g, this._b), t = Math.round(360 * e.h), n = Math.round(100 * e.s), r = Math.round(100 * e.v);
|
|
329
|
+
return this._a == 1 ? "hsv(" + t + ", " + n + "%, " + r + "%)" : "hsva(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
|
|
330
|
+
},
|
|
331
|
+
toHsl: function() {
|
|
332
|
+
var e = g(this._r, this._g, this._b);
|
|
333
|
+
return {
|
|
334
|
+
h: 360 * e.h,
|
|
335
|
+
s: e.s,
|
|
336
|
+
l: e.l,
|
|
337
|
+
a: this._a
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
toHslString: function() {
|
|
341
|
+
var e = g(this._r, this._g, this._b), t = Math.round(360 * e.h), n = Math.round(100 * e.s), r = Math.round(100 * e.l);
|
|
342
|
+
return this._a == 1 ? "hsl(" + t + ", " + n + "%, " + r + "%)" : "hsla(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
|
|
343
|
+
},
|
|
344
|
+
toHex: function(e) {
|
|
345
|
+
return v(this._r, this._g, this._b, e);
|
|
346
|
+
},
|
|
347
|
+
toHexString: function(e) {
|
|
348
|
+
return "#" + this.toHex(e);
|
|
349
|
+
},
|
|
350
|
+
toHex8: function(e) {
|
|
351
|
+
return function(e, t, n, r, i) {
|
|
352
|
+
var a = [
|
|
353
|
+
R(Math.round(e).toString(16)),
|
|
354
|
+
R(Math.round(t).toString(16)),
|
|
355
|
+
R(Math.round(n).toString(16)),
|
|
356
|
+
R(B(r))
|
|
357
|
+
];
|
|
358
|
+
return i && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
359
|
+
}(this._r, this._g, this._b, this._a, e);
|
|
360
|
+
},
|
|
361
|
+
toHex8String: function(e) {
|
|
362
|
+
return "#" + this.toHex8(e);
|
|
363
|
+
},
|
|
364
|
+
toRgb: function() {
|
|
365
|
+
return {
|
|
366
|
+
r: Math.round(this._r),
|
|
367
|
+
g: Math.round(this._g),
|
|
368
|
+
b: Math.round(this._b),
|
|
369
|
+
a: this._a
|
|
370
|
+
};
|
|
371
|
+
},
|
|
372
|
+
toRgbString: function() {
|
|
373
|
+
return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
|
|
374
|
+
},
|
|
375
|
+
toPercentageRgb: function() {
|
|
376
|
+
return {
|
|
377
|
+
r: Math.round(100 * F(this._r, 255)) + "%",
|
|
378
|
+
g: Math.round(100 * F(this._g, 255)) + "%",
|
|
379
|
+
b: Math.round(100 * F(this._b, 255)) + "%",
|
|
380
|
+
a: this._a
|
|
381
|
+
};
|
|
382
|
+
},
|
|
383
|
+
toPercentageRgbString: function() {
|
|
384
|
+
return this._a == 1 ? "rgb(" + Math.round(100 * F(this._r, 255)) + "%, " + Math.round(100 * F(this._g, 255)) + "%, " + Math.round(100 * F(this._b, 255)) + "%)" : "rgba(" + Math.round(100 * F(this._r, 255)) + "%, " + Math.round(100 * F(this._g, 255)) + "%, " + Math.round(100 * F(this._b, 255)) + "%, " + this._roundA + ")";
|
|
385
|
+
},
|
|
386
|
+
toName: function() {
|
|
387
|
+
return this._a === 0 ? "transparent" : !(this._a < 1) && (N[v(this._r, this._g, this._b, !0)] || !1);
|
|
388
|
+
},
|
|
389
|
+
toFilter: function(e) {
|
|
390
|
+
var t = "#" + y(this._r, this._g, this._b, this._a), n = t, r = this._gradientType ? "GradientType = 1, " : "";
|
|
391
|
+
if (e) {
|
|
392
|
+
var i = h(e);
|
|
393
|
+
n = "#" + y(i._r, i._g, i._b, i._a);
|
|
394
|
+
}
|
|
395
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + r + "startColorstr=" + t + ",endColorstr=" + n + ")";
|
|
396
|
+
},
|
|
397
|
+
toString: function(e) {
|
|
398
|
+
var t = !!e;
|
|
399
|
+
e ||= this._format;
|
|
400
|
+
var n = !1, r = this._a < 1 && this._a >= 0;
|
|
401
|
+
return t || !r || e !== "hex" && e !== "hex6" && e !== "hex3" && e !== "hex4" && e !== "hex8" && e !== "name" ? (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), e !== "hex" && e !== "hex6" || (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString()) : e === "name" && this._a === 0 ? this.toName() : this.toRgbString();
|
|
402
|
+
},
|
|
403
|
+
clone: function() {
|
|
404
|
+
return h(this.toString());
|
|
405
|
+
},
|
|
406
|
+
_applyModification: function(e, t) {
|
|
407
|
+
var n = e.apply(null, [this].concat([].slice.call(t)));
|
|
408
|
+
return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
|
|
409
|
+
},
|
|
410
|
+
lighten: function() {
|
|
411
|
+
return this._applyModification(C, arguments);
|
|
412
|
+
},
|
|
413
|
+
brighten: function() {
|
|
414
|
+
return this._applyModification(w, arguments);
|
|
415
|
+
},
|
|
416
|
+
darken: function() {
|
|
417
|
+
return this._applyModification(T, arguments);
|
|
418
|
+
},
|
|
419
|
+
desaturate: function() {
|
|
420
|
+
return this._applyModification(b, arguments);
|
|
421
|
+
},
|
|
422
|
+
saturate: function() {
|
|
423
|
+
return this._applyModification(x, arguments);
|
|
424
|
+
},
|
|
425
|
+
greyscale: function() {
|
|
426
|
+
return this._applyModification(S, arguments);
|
|
427
|
+
},
|
|
428
|
+
spin: function() {
|
|
429
|
+
return this._applyModification(E, arguments);
|
|
430
|
+
},
|
|
431
|
+
_applyCombination: function(e, t) {
|
|
432
|
+
return e.apply(null, [this].concat([].slice.call(t)));
|
|
433
|
+
},
|
|
434
|
+
analogous: function() {
|
|
435
|
+
return this._applyCombination(A, arguments);
|
|
436
|
+
},
|
|
437
|
+
complement: function() {
|
|
438
|
+
return this._applyCombination(D, arguments);
|
|
439
|
+
},
|
|
440
|
+
monochromatic: function() {
|
|
441
|
+
return this._applyCombination(j, arguments);
|
|
442
|
+
},
|
|
443
|
+
splitcomplement: function() {
|
|
444
|
+
return this._applyCombination(k, arguments);
|
|
445
|
+
},
|
|
446
|
+
triad: function() {
|
|
447
|
+
return this._applyCombination(O, [3]);
|
|
448
|
+
},
|
|
449
|
+
tetrad: function() {
|
|
450
|
+
return this._applyCombination(O, [4]);
|
|
451
|
+
}
|
|
452
|
+
}, h.fromRatio = function(e, t) {
|
|
453
|
+
if (f(e) == "object") {
|
|
454
|
+
var n = {};
|
|
455
|
+
for (var r in e) e.hasOwnProperty(r) && (n[r] = r === "a" ? e[r] : z(e[r]));
|
|
456
|
+
e = n;
|
|
457
|
+
}
|
|
458
|
+
return h(e, t);
|
|
459
|
+
}, h.equals = function(e, t) {
|
|
460
|
+
return !(!e || !t) && h(e).toRgbString() == h(t).toRgbString();
|
|
461
|
+
}, h.random = function() {
|
|
462
|
+
return h.fromRatio({
|
|
463
|
+
r: Math.random(),
|
|
464
|
+
g: Math.random(),
|
|
465
|
+
b: Math.random()
|
|
466
|
+
});
|
|
467
|
+
}, h.mix = function(e, t, n) {
|
|
468
|
+
n = n === 0 ? 0 : n || 50;
|
|
469
|
+
var r = h(e).toRgb(), i = h(t).toRgb(), a = n / 100;
|
|
470
|
+
return h({
|
|
471
|
+
r: (i.r - r.r) * a + r.r,
|
|
472
|
+
g: (i.g - r.g) * a + r.g,
|
|
473
|
+
b: (i.b - r.b) * a + r.b,
|
|
474
|
+
a: (i.a - r.a) * a + r.a
|
|
475
|
+
});
|
|
476
|
+
}, h.readability = function(e, t) {
|
|
477
|
+
var n = h(e), r = h(t);
|
|
478
|
+
return (Math.max(n.getLuminance(), r.getLuminance()) + .05) / (Math.min(n.getLuminance(), r.getLuminance()) + .05);
|
|
479
|
+
}, h.isReadable = function(e, t, n) {
|
|
480
|
+
var r, i = h.readability(e, t), a = !1;
|
|
481
|
+
switch ((r = function(e) {
|
|
482
|
+
var t = ((e ||= {
|
|
483
|
+
level: "AA",
|
|
484
|
+
size: "small"
|
|
485
|
+
}).level || "AA").toUpperCase(), n = (e.size || "small").toLowerCase();
|
|
486
|
+
return t !== "AA" && t !== "AAA" && (t = "AA"), n !== "small" && n !== "large" && (n = "small"), {
|
|
487
|
+
level: t,
|
|
488
|
+
size: n
|
|
489
|
+
};
|
|
490
|
+
}(n)).level + r.size) {
|
|
491
|
+
case "AAsmall":
|
|
492
|
+
case "AAAlarge":
|
|
493
|
+
a = i >= 4.5;
|
|
494
|
+
break;
|
|
495
|
+
case "AAlarge":
|
|
496
|
+
a = i >= 3;
|
|
497
|
+
break;
|
|
498
|
+
case "AAAsmall": a = i >= 7;
|
|
499
|
+
}
|
|
500
|
+
return a;
|
|
501
|
+
}, h.mostReadable = function(e, t, n) {
|
|
502
|
+
var r, i, a, o, s = null, c = 0;
|
|
503
|
+
i = (n ||= {}).includeFallbackColors, a = n.level, o = n.size;
|
|
504
|
+
for (var l = 0; l < t.length; l++) (r = h.readability(e, t[l])) > c && (c = r, s = h(t[l]));
|
|
505
|
+
return h.isReadable(e, s, {
|
|
506
|
+
level: a,
|
|
507
|
+
size: o
|
|
508
|
+
}) || !i ? s : (n.includeFallbackColors = !1, h.mostReadable(e, ["#fff", "#000"], n));
|
|
509
|
+
};
|
|
510
|
+
var M = h.names = {
|
|
511
|
+
aliceblue: "f0f8ff",
|
|
512
|
+
antiquewhite: "faebd7",
|
|
513
|
+
aqua: "0ff",
|
|
514
|
+
aquamarine: "7fffd4",
|
|
515
|
+
azure: "f0ffff",
|
|
516
|
+
beige: "f5f5dc",
|
|
517
|
+
bisque: "ffe4c4",
|
|
518
|
+
black: "000",
|
|
519
|
+
blanchedalmond: "ffebcd",
|
|
520
|
+
blue: "00f",
|
|
521
|
+
blueviolet: "8a2be2",
|
|
522
|
+
brown: "a52a2a",
|
|
523
|
+
burlywood: "deb887",
|
|
524
|
+
burntsienna: "ea7e5d",
|
|
525
|
+
cadetblue: "5f9ea0",
|
|
526
|
+
chartreuse: "7fff00",
|
|
527
|
+
chocolate: "d2691e",
|
|
528
|
+
coral: "ff7f50",
|
|
529
|
+
cornflowerblue: "6495ed",
|
|
530
|
+
cornsilk: "fff8dc",
|
|
531
|
+
crimson: "dc143c",
|
|
532
|
+
cyan: "0ff",
|
|
533
|
+
darkblue: "00008b",
|
|
534
|
+
darkcyan: "008b8b",
|
|
535
|
+
darkgoldenrod: "b8860b",
|
|
536
|
+
darkgray: "a9a9a9",
|
|
537
|
+
darkgreen: "006400",
|
|
538
|
+
darkgrey: "a9a9a9",
|
|
539
|
+
darkkhaki: "bdb76b",
|
|
540
|
+
darkmagenta: "8b008b",
|
|
541
|
+
darkolivegreen: "556b2f",
|
|
542
|
+
darkorange: "ff8c00",
|
|
543
|
+
darkorchid: "9932cc",
|
|
544
|
+
darkred: "8b0000",
|
|
545
|
+
darksalmon: "e9967a",
|
|
546
|
+
darkseagreen: "8fbc8f",
|
|
547
|
+
darkslateblue: "483d8b",
|
|
548
|
+
darkslategray: "2f4f4f",
|
|
549
|
+
darkslategrey: "2f4f4f",
|
|
550
|
+
darkturquoise: "00ced1",
|
|
551
|
+
darkviolet: "9400d3",
|
|
552
|
+
deeppink: "ff1493",
|
|
553
|
+
deepskyblue: "00bfff",
|
|
554
|
+
dimgray: "696969",
|
|
555
|
+
dimgrey: "696969",
|
|
556
|
+
dodgerblue: "1e90ff",
|
|
557
|
+
firebrick: "b22222",
|
|
558
|
+
floralwhite: "fffaf0",
|
|
559
|
+
forestgreen: "228b22",
|
|
560
|
+
fuchsia: "f0f",
|
|
561
|
+
gainsboro: "dcdcdc",
|
|
562
|
+
ghostwhite: "f8f8ff",
|
|
563
|
+
gold: "ffd700",
|
|
564
|
+
goldenrod: "daa520",
|
|
565
|
+
gray: "808080",
|
|
566
|
+
green: "008000",
|
|
567
|
+
greenyellow: "adff2f",
|
|
568
|
+
grey: "808080",
|
|
569
|
+
honeydew: "f0fff0",
|
|
570
|
+
hotpink: "ff69b4",
|
|
571
|
+
indianred: "cd5c5c",
|
|
572
|
+
indigo: "4b0082",
|
|
573
|
+
ivory: "fffff0",
|
|
574
|
+
khaki: "f0e68c",
|
|
575
|
+
lavender: "e6e6fa",
|
|
576
|
+
lavenderblush: "fff0f5",
|
|
577
|
+
lawngreen: "7cfc00",
|
|
578
|
+
lemonchiffon: "fffacd",
|
|
579
|
+
lightblue: "add8e6",
|
|
580
|
+
lightcoral: "f08080",
|
|
581
|
+
lightcyan: "e0ffff",
|
|
582
|
+
lightgoldenrodyellow: "fafad2",
|
|
583
|
+
lightgray: "d3d3d3",
|
|
584
|
+
lightgreen: "90ee90",
|
|
585
|
+
lightgrey: "d3d3d3",
|
|
586
|
+
lightpink: "ffb6c1",
|
|
587
|
+
lightsalmon: "ffa07a",
|
|
588
|
+
lightseagreen: "20b2aa",
|
|
589
|
+
lightskyblue: "87cefa",
|
|
590
|
+
lightslategray: "789",
|
|
591
|
+
lightslategrey: "789",
|
|
592
|
+
lightsteelblue: "b0c4de",
|
|
593
|
+
lightyellow: "ffffe0",
|
|
594
|
+
lime: "0f0",
|
|
595
|
+
limegreen: "32cd32",
|
|
596
|
+
linen: "faf0e6",
|
|
597
|
+
magenta: "f0f",
|
|
598
|
+
maroon: "800000",
|
|
599
|
+
mediumaquamarine: "66cdaa",
|
|
600
|
+
mediumblue: "0000cd",
|
|
601
|
+
mediumorchid: "ba55d3",
|
|
602
|
+
mediumpurple: "9370db",
|
|
603
|
+
mediumseagreen: "3cb371",
|
|
604
|
+
mediumslateblue: "7b68ee",
|
|
605
|
+
mediumspringgreen: "00fa9a",
|
|
606
|
+
mediumturquoise: "48d1cc",
|
|
607
|
+
mediumvioletred: "c71585",
|
|
608
|
+
midnightblue: "191970",
|
|
609
|
+
mintcream: "f5fffa",
|
|
610
|
+
mistyrose: "ffe4e1",
|
|
611
|
+
moccasin: "ffe4b5",
|
|
612
|
+
navajowhite: "ffdead",
|
|
613
|
+
navy: "000080",
|
|
614
|
+
oldlace: "fdf5e6",
|
|
615
|
+
olive: "808000",
|
|
616
|
+
olivedrab: "6b8e23",
|
|
617
|
+
orange: "ffa500",
|
|
618
|
+
orangered: "ff4500",
|
|
619
|
+
orchid: "da70d6",
|
|
620
|
+
palegoldenrod: "eee8aa",
|
|
621
|
+
palegreen: "98fb98",
|
|
622
|
+
paleturquoise: "afeeee",
|
|
623
|
+
palevioletred: "db7093",
|
|
624
|
+
papayawhip: "ffefd5",
|
|
625
|
+
peachpuff: "ffdab9",
|
|
626
|
+
peru: "cd853f",
|
|
627
|
+
pink: "ffc0cb",
|
|
628
|
+
plum: "dda0dd",
|
|
629
|
+
powderblue: "b0e0e6",
|
|
630
|
+
purple: "800080",
|
|
631
|
+
rebeccapurple: "663399",
|
|
632
|
+
red: "f00",
|
|
633
|
+
rosybrown: "bc8f8f",
|
|
634
|
+
royalblue: "4169e1",
|
|
635
|
+
saddlebrown: "8b4513",
|
|
636
|
+
salmon: "fa8072",
|
|
637
|
+
sandybrown: "f4a460",
|
|
638
|
+
seagreen: "2e8b57",
|
|
639
|
+
seashell: "fff5ee",
|
|
640
|
+
sienna: "a0522d",
|
|
641
|
+
silver: "c0c0c0",
|
|
642
|
+
skyblue: "87ceeb",
|
|
643
|
+
slateblue: "6a5acd",
|
|
644
|
+
slategray: "708090",
|
|
645
|
+
slategrey: "708090",
|
|
646
|
+
snow: "fffafa",
|
|
647
|
+
springgreen: "00ff7f",
|
|
648
|
+
steelblue: "4682b4",
|
|
649
|
+
tan: "d2b48c",
|
|
650
|
+
teal: "008080",
|
|
651
|
+
thistle: "d8bfd8",
|
|
652
|
+
tomato: "ff6347",
|
|
653
|
+
turquoise: "40e0d0",
|
|
654
|
+
violet: "ee82ee",
|
|
655
|
+
wheat: "f5deb3",
|
|
656
|
+
white: "fff",
|
|
657
|
+
whitesmoke: "f5f5f5",
|
|
658
|
+
yellow: "ff0",
|
|
659
|
+
yellowgreen: "9acd32"
|
|
660
|
+
}, N = h.hexNames = function(e) {
|
|
661
|
+
var t = {};
|
|
662
|
+
for (var n in e) e.hasOwnProperty(n) && (t[e[n]] = n);
|
|
663
|
+
return t;
|
|
664
|
+
}(M);
|
|
665
|
+
function P(e) {
|
|
666
|
+
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
667
|
+
}
|
|
668
|
+
function F(e, t) {
|
|
669
|
+
(function(e) {
|
|
670
|
+
return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
|
|
671
|
+
})(e) && (e = "100%");
|
|
672
|
+
var n = function(e) {
|
|
673
|
+
return typeof e == "string" && e.indexOf("%") != -1;
|
|
674
|
+
}(e);
|
|
675
|
+
return e = Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(e * t, 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : e % t / parseFloat(t);
|
|
676
|
+
}
|
|
677
|
+
function I(e) {
|
|
678
|
+
return Math.min(1, Math.max(0, e));
|
|
679
|
+
}
|
|
680
|
+
function L(e) {
|
|
681
|
+
return parseInt(e, 16);
|
|
682
|
+
}
|
|
683
|
+
function R(e) {
|
|
684
|
+
return e.length == 1 ? "0" + e : "" + e;
|
|
685
|
+
}
|
|
686
|
+
function z(e) {
|
|
687
|
+
return e <= 1 && (e = 100 * e + "%"), e;
|
|
688
|
+
}
|
|
689
|
+
function B(e) {
|
|
690
|
+
return Math.round(255 * parseFloat(e)).toString(16);
|
|
691
|
+
}
|
|
692
|
+
function V(e) {
|
|
693
|
+
return L(e) / 255;
|
|
694
|
+
}
|
|
695
|
+
var H, U, W, G = (U = "[\\s|\\(]+(" + (H = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)") + ")[,|\\s]+(" + H + ")[,|\\s]+(" + H + ")\\s*\\)?", W = "[\\s|\\(]+(" + H + ")[,|\\s]+(" + H + ")[,|\\s]+(" + H + ")[,|\\s]+(" + H + ")\\s*\\)?", {
|
|
696
|
+
CSS_UNIT: new RegExp(H),
|
|
697
|
+
rgb: RegExp("rgb" + U),
|
|
698
|
+
rgba: RegExp("rgba" + W),
|
|
699
|
+
hsl: RegExp("hsl" + U),
|
|
700
|
+
hsla: RegExp("hsla" + W),
|
|
701
|
+
hsv: RegExp("hsv" + U),
|
|
702
|
+
hsva: RegExp("hsva" + W),
|
|
703
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
704
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
705
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
706
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
707
|
+
});
|
|
708
|
+
function K(e) {
|
|
709
|
+
return !!G.CSS_UNIT.exec(e);
|
|
710
|
+
}
|
|
711
|
+
var q = class extends (r || n) {
|
|
712
|
+
constructor(...e) {
|
|
713
|
+
super(...e), this.handleChange = (e) => {
|
|
714
|
+
let t = ((e, t, n, r) => {
|
|
715
|
+
let i = r.clientWidth, a = r.clientHeight, o = typeof e.pageX == "number" ? e.pageX : e.touches[0].pageX, s = typeof e.pageY == "number" ? e.pageY : e.touches[0].pageY, c = o - (r.getBoundingClientRect().left + window.pageXOffset), l = s - (r.getBoundingClientRect().top + window.pageYOffset);
|
|
716
|
+
if (t === "vertical") {
|
|
717
|
+
let e;
|
|
718
|
+
if (e = l < 0 ? 359 : l > a ? 0 : 360 * (-100 * l / a + 100) / 100, n.h !== e) return {
|
|
719
|
+
h: e,
|
|
720
|
+
s: n.s,
|
|
721
|
+
l: n.l,
|
|
722
|
+
a: n.a,
|
|
723
|
+
source: "hsl"
|
|
724
|
+
};
|
|
725
|
+
} else {
|
|
726
|
+
let e;
|
|
727
|
+
if (e = c < 0 ? 0 : c > i ? 359 : 100 * c / i * 360 / 100, n.h !== e) return {
|
|
728
|
+
h: e,
|
|
729
|
+
s: n.s,
|
|
730
|
+
l: n.l,
|
|
731
|
+
a: n.a,
|
|
732
|
+
source: "hsl"
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
return null;
|
|
736
|
+
})(e, this.props.direction, this.props.hsl, this.container);
|
|
737
|
+
t && typeof this.props.onChange == "function" && this.props.onChange(t, e);
|
|
738
|
+
}, this.handleMouseDown = (e) => {
|
|
739
|
+
this.handleChange(e), window.addEventListener("mousemove", this.handleChange), window.addEventListener("mouseup", this.handleMouseUp);
|
|
740
|
+
}, this.handleMouseUp = () => {
|
|
741
|
+
this.unbindEventListeners();
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
componentWillUnmount() {
|
|
745
|
+
this.unbindEventListeners();
|
|
746
|
+
}
|
|
747
|
+
unbindEventListeners() {
|
|
748
|
+
window.removeEventListener("mousemove", this.handleChange), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
749
|
+
}
|
|
750
|
+
render() {
|
|
751
|
+
let e = this.props.direction ?? "horizontal", t = e === "vertical", n = {
|
|
752
|
+
hue: {
|
|
753
|
+
position: "absolute",
|
|
754
|
+
top: "0px",
|
|
755
|
+
right: "0px",
|
|
756
|
+
bottom: "0px",
|
|
757
|
+
left: "0px",
|
|
758
|
+
borderRadius: this.props.radius,
|
|
759
|
+
boxShadow: this.props.shadow
|
|
760
|
+
},
|
|
761
|
+
container: {
|
|
762
|
+
padding: "0 2px",
|
|
763
|
+
position: "relative",
|
|
764
|
+
height: "100%",
|
|
765
|
+
borderRadius: this.props.radius
|
|
766
|
+
},
|
|
767
|
+
pointer: {
|
|
768
|
+
position: "absolute",
|
|
769
|
+
left: t ? "0px" : 100 * this.props.hsl.h / 360 + "%",
|
|
770
|
+
...t ? { top: -100 * this.props.hsl.h / 360 + 100 + "%" } : {}
|
|
771
|
+
},
|
|
772
|
+
slider: {
|
|
773
|
+
marginTop: "1px",
|
|
774
|
+
width: "4px",
|
|
775
|
+
borderRadius: "1px",
|
|
776
|
+
height: "8px",
|
|
777
|
+
boxShadow: "0 0 2px rgba(0, 0, 0, .6)",
|
|
778
|
+
background: "#fff",
|
|
779
|
+
transform: "translateX(-2px)"
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
return c("div", {
|
|
783
|
+
style: n.hue,
|
|
784
|
+
children: l("div", {
|
|
785
|
+
className: `hue-${e}`,
|
|
786
|
+
style: n.container,
|
|
787
|
+
ref: (e) => {
|
|
788
|
+
this.container = e;
|
|
789
|
+
},
|
|
790
|
+
onMouseDown: this.handleMouseDown,
|
|
791
|
+
onTouchMove: this.handleChange,
|
|
792
|
+
onTouchStart: this.handleChange,
|
|
793
|
+
children: [c("style", { children: "\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n " }), c("div", {
|
|
794
|
+
style: n.pointer,
|
|
795
|
+
children: this.props.pointer ? c(this.props.pointer, { ...this.props }) : c("div", { style: n.slider })
|
|
796
|
+
})]
|
|
797
|
+
})
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
}, J = class extends (r || n) {
|
|
801
|
+
constructor(...e) {
|
|
802
|
+
super(...e), this.handleChange = (e) => {
|
|
803
|
+
let t = ((e, t, n, r, i) => {
|
|
804
|
+
let a = i.clientWidth, o = i.clientHeight, s = typeof e.pageX == "number" ? e.pageX : e.touches[0].pageX, c = typeof e.pageY == "number" ? e.pageY : e.touches[0].pageY, l = s - (i.getBoundingClientRect().left + window.pageXOffset), u = c - (i.getBoundingClientRect().top + window.pageYOffset);
|
|
805
|
+
if (n === "vertical") {
|
|
806
|
+
let e;
|
|
807
|
+
if (e = u < 0 ? 0 : u > o ? 1 : Math.round(100 * u / o) / 100, t.a !== e) return {
|
|
808
|
+
h: t.h,
|
|
809
|
+
s: t.s,
|
|
810
|
+
l: t.l,
|
|
811
|
+
a: e,
|
|
812
|
+
source: "rgb"
|
|
813
|
+
};
|
|
814
|
+
} else {
|
|
815
|
+
let e;
|
|
816
|
+
if (e = l < 0 ? 0 : l > a ? 1 : Math.round(100 * l / a) / 100, r !== e) return {
|
|
817
|
+
h: t.h,
|
|
818
|
+
s: t.s,
|
|
819
|
+
l: t.l,
|
|
820
|
+
a: e,
|
|
821
|
+
source: "rgb"
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
return null;
|
|
825
|
+
})(e, this.props.hsl, this.props.direction, this.props.a, this.container);
|
|
826
|
+
t && typeof this.props.onChange == "function" && this.props.onChange(t, e);
|
|
827
|
+
}, this.handleMouseDown = (e) => {
|
|
828
|
+
this.handleChange(e), window.addEventListener("mousemove", this.handleChange), window.addEventListener("mouseup", this.handleMouseUp);
|
|
829
|
+
}, this.handleMouseUp = () => {
|
|
830
|
+
this.unbindEventListeners();
|
|
831
|
+
}, this.unbindEventListeners = () => {
|
|
832
|
+
window.removeEventListener("mousemove", this.handleChange), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
componentWillUnmount() {
|
|
836
|
+
this.unbindEventListeners();
|
|
837
|
+
}
|
|
838
|
+
render() {
|
|
839
|
+
let { rgb: t } = this.props, n = this.props.direction === "vertical", r = {
|
|
840
|
+
position: "absolute",
|
|
841
|
+
top: "0px",
|
|
842
|
+
right: "0px",
|
|
843
|
+
bottom: "0px",
|
|
844
|
+
left: "0px"
|
|
845
|
+
}, i = `linear-gradient(to right, rgba(${t.r},${t.g},${t.b}, 0) 0%,\n rgba(${t.r},${t.g},${t.b}, 1) 100%)`, a = `linear-gradient(to bottom, rgba(${t.r},${t.g},${t.b}, 0) 0%,\n rgba(${t.r},${t.g},${t.b}, 1) 100%)`, o = {
|
|
846
|
+
alpha: {
|
|
847
|
+
...r,
|
|
848
|
+
borderRadius: this.props.radius
|
|
849
|
+
},
|
|
850
|
+
checkboard: {
|
|
851
|
+
...r,
|
|
852
|
+
overflow: "hidden",
|
|
853
|
+
borderRadius: this.props.radius
|
|
854
|
+
},
|
|
855
|
+
gradient: {
|
|
856
|
+
...r,
|
|
857
|
+
background: n ? a : i,
|
|
858
|
+
boxShadow: this.props.shadow,
|
|
859
|
+
borderRadius: this.props.radius
|
|
860
|
+
},
|
|
861
|
+
container: {
|
|
862
|
+
position: "relative",
|
|
863
|
+
height: "100%",
|
|
864
|
+
margin: "0 3px"
|
|
865
|
+
},
|
|
866
|
+
pointer: {
|
|
867
|
+
position: "absolute",
|
|
868
|
+
left: n ? 0 : 100 * t.a + "%",
|
|
869
|
+
...n ? { top: 100 * t.a + "%" } : {}
|
|
870
|
+
},
|
|
871
|
+
slider: {
|
|
872
|
+
width: "4px",
|
|
873
|
+
borderRadius: "1px",
|
|
874
|
+
height: "8px",
|
|
875
|
+
boxShadow: "0 0 2px rgba(0, 0, 0, .6)",
|
|
876
|
+
background: "#fff",
|
|
877
|
+
marginTop: "1px",
|
|
878
|
+
transform: "translateX(-2px)"
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
return l("div", {
|
|
882
|
+
style: o.alpha,
|
|
883
|
+
children: [
|
|
884
|
+
c("div", {
|
|
885
|
+
style: o.checkboard,
|
|
886
|
+
children: c(e, {
|
|
887
|
+
grey: "rgba(0,0,0,.08)",
|
|
888
|
+
renderers: this.props.renderers
|
|
889
|
+
})
|
|
890
|
+
}),
|
|
891
|
+
c("div", { style: o.gradient }),
|
|
892
|
+
c("div", {
|
|
893
|
+
style: o.container,
|
|
894
|
+
ref: (e) => {
|
|
895
|
+
this.container = e;
|
|
896
|
+
},
|
|
897
|
+
onMouseDown: this.handleMouseDown,
|
|
898
|
+
onTouchMove: this.handleChange,
|
|
899
|
+
onTouchStart: this.handleChange,
|
|
900
|
+
children: c("div", {
|
|
901
|
+
style: o.pointer,
|
|
902
|
+
children: this.props.pointer ? c(this.props.pointer, { ...this.props }) : c("div", { style: o.slider })
|
|
903
|
+
})
|
|
904
|
+
})
|
|
905
|
+
]
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
}, Y = [38, 40], X = 1, Z = class extends (r || n) {
|
|
909
|
+
constructor(e) {
|
|
910
|
+
super(e), this.handleBlur = () => {
|
|
911
|
+
this.state.blurValue && this.setState({
|
|
912
|
+
value: this.state.blurValue,
|
|
913
|
+
blurValue: null
|
|
914
|
+
});
|
|
915
|
+
}, this.handleChange = (e) => {
|
|
916
|
+
this.setUpdatedValue(e.target.value, e);
|
|
917
|
+
}, this.handleKeyDown = (e) => {
|
|
918
|
+
let t = ((e) => Number(String(e).replace(/%/g, "")))(e.target.value);
|
|
919
|
+
if (!isNaN(t) && (n = e.keyCode, Y.indexOf(n) > -1)) {
|
|
920
|
+
let n = this.getArrowOffset(), r = e.keyCode === 38 ? t + n : t - n;
|
|
921
|
+
this.setUpdatedValue(r, e);
|
|
922
|
+
}
|
|
923
|
+
var n;
|
|
924
|
+
}, this.handleDrag = (e) => {
|
|
925
|
+
if (this.props.dragLabel) {
|
|
926
|
+
let t = Math.round(this.props.value + e.movementX);
|
|
927
|
+
t >= 0 && t <= this.props.dragMax && this.props.onChange && this.props.onChange(this.getValueObjectWithLabel(t), e);
|
|
928
|
+
}
|
|
929
|
+
}, this.handleMouseDown = (e) => {
|
|
930
|
+
this.props.dragLabel && (e.preventDefault(), this.handleDrag(e), window.addEventListener("mousemove", this.handleDrag), window.addEventListener("mouseup", this.handleMouseUp));
|
|
931
|
+
}, this.handleMouseUp = () => {
|
|
932
|
+
this.unbindEventListeners();
|
|
933
|
+
}, this.unbindEventListeners = () => {
|
|
934
|
+
window.removeEventListener("mousemove", this.handleDrag), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
935
|
+
}, this.state = {
|
|
936
|
+
value: String(e.value).toUpperCase(),
|
|
937
|
+
blurValue: String(e.value).toUpperCase()
|
|
938
|
+
}, this.inputId = "rc-editable-input-" + X++;
|
|
939
|
+
}
|
|
940
|
+
componentDidUpdate(e, t) {
|
|
941
|
+
this.props.value === this.state.value || e.value === this.props.value && t.value === this.state.value || (this.input === document.activeElement ? this.setState({ blurValue: String(this.props.value).toUpperCase() }) : this.setState({
|
|
942
|
+
value: String(this.props.value).toUpperCase(),
|
|
943
|
+
blurValue: !this.state.blurValue && String(this.props.value).toUpperCase()
|
|
944
|
+
}));
|
|
945
|
+
}
|
|
946
|
+
componentWillUnmount() {
|
|
947
|
+
this.unbindEventListeners();
|
|
948
|
+
}
|
|
949
|
+
getValueObjectWithLabel(e) {
|
|
950
|
+
return { [this.props.label]: e };
|
|
951
|
+
}
|
|
952
|
+
getArrowOffset() {
|
|
953
|
+
return this.props.arrowOffset || 1;
|
|
954
|
+
}
|
|
955
|
+
setUpdatedValue(e, t) {
|
|
956
|
+
let n = this.props.label ? this.getValueObjectWithLabel(e) : e;
|
|
957
|
+
this.props.onChange && this.props.onChange(n, t), this.setState({ value: e });
|
|
958
|
+
}
|
|
959
|
+
render() {
|
|
960
|
+
let e = this.props.style || {}, t = {
|
|
961
|
+
wrap: {
|
|
962
|
+
position: "relative",
|
|
963
|
+
...e.wrap || {}
|
|
964
|
+
},
|
|
965
|
+
input: { ...e.input || {} },
|
|
966
|
+
label: {
|
|
967
|
+
...e.label || {},
|
|
968
|
+
...this.props.dragLabel ? { cursor: "ew-resize" } : {}
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
return l("div", {
|
|
972
|
+
style: t.wrap,
|
|
973
|
+
children: [c("input", {
|
|
974
|
+
id: this.inputId,
|
|
975
|
+
style: t.input,
|
|
976
|
+
ref: (e) => {
|
|
977
|
+
this.input = e;
|
|
978
|
+
},
|
|
979
|
+
value: this.state.value,
|
|
980
|
+
onKeyDown: this.handleKeyDown,
|
|
981
|
+
onChange: this.handleChange,
|
|
982
|
+
onBlur: this.handleBlur,
|
|
983
|
+
placeholder: this.props.placeholder,
|
|
984
|
+
spellCheck: "false"
|
|
985
|
+
}), this.props.label && !this.props.hideLabel ? c("label", {
|
|
986
|
+
htmlFor: this.inputId,
|
|
987
|
+
style: t.label,
|
|
988
|
+
onMouseDown: this.handleMouseDown,
|
|
989
|
+
children: this.props.label
|
|
990
|
+
}) : null]
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
}, ee = ({ onChange: e, rgb: t, hsl: n, hex: r, disableAlpha: i }) => {
|
|
994
|
+
let a = {
|
|
995
|
+
fields: {
|
|
996
|
+
display: "flex",
|
|
997
|
+
paddingTop: "4px"
|
|
998
|
+
},
|
|
999
|
+
single: {
|
|
1000
|
+
flex: "1",
|
|
1001
|
+
paddingLeft: "6px"
|
|
1002
|
+
},
|
|
1003
|
+
alpha: {
|
|
1004
|
+
flex: "1",
|
|
1005
|
+
paddingLeft: "6px",
|
|
1006
|
+
...i ? { display: "none" } : {}
|
|
1007
|
+
},
|
|
1008
|
+
double: { flex: "2" },
|
|
1009
|
+
input: {
|
|
1010
|
+
width: "80%",
|
|
1011
|
+
padding: "4px 10% 3px",
|
|
1012
|
+
border: "none",
|
|
1013
|
+
boxShadow: "inset 0 0 0 1px #ccc",
|
|
1014
|
+
fontSize: "11px"
|
|
1015
|
+
},
|
|
1016
|
+
label: {
|
|
1017
|
+
display: "block",
|
|
1018
|
+
textAlign: "center",
|
|
1019
|
+
fontSize: "11px",
|
|
1020
|
+
color: "#222",
|
|
1021
|
+
paddingTop: "3px",
|
|
1022
|
+
paddingBottom: "4px",
|
|
1023
|
+
textTransform: "capitalize"
|
|
1024
|
+
}
|
|
1025
|
+
}, o = (r, i) => {
|
|
1026
|
+
r.hex ? ((e) => {
|
|
1027
|
+
if (e === "transparent") return !0;
|
|
1028
|
+
let t = +(String(e).charAt(0) === "#");
|
|
1029
|
+
return e.length !== 4 + t && e.length < 7 + t && h(e).isValid();
|
|
1030
|
+
})(r.hex) && e({
|
|
1031
|
+
hex: r.hex,
|
|
1032
|
+
source: "hex"
|
|
1033
|
+
}, i) : r.r || r.g || r.b ? e({
|
|
1034
|
+
r: r.r || t.r,
|
|
1035
|
+
g: r.g || t.g,
|
|
1036
|
+
b: r.b || t.b,
|
|
1037
|
+
a: t.a,
|
|
1038
|
+
source: "rgb"
|
|
1039
|
+
}, i) : r.a && (r.a < 0 ? r.a = 0 : r.a > 100 && (r.a = 100), r.a /= 100, e({
|
|
1040
|
+
h: n.h,
|
|
1041
|
+
s: n.s,
|
|
1042
|
+
l: n.l,
|
|
1043
|
+
a: r.a,
|
|
1044
|
+
source: "rgb"
|
|
1045
|
+
}, i));
|
|
1046
|
+
};
|
|
1047
|
+
return l("div", {
|
|
1048
|
+
style: a.fields,
|
|
1049
|
+
className: "flexbox-fix",
|
|
1050
|
+
children: [
|
|
1051
|
+
c("div", {
|
|
1052
|
+
style: a.double,
|
|
1053
|
+
children: c(Z, {
|
|
1054
|
+
style: {
|
|
1055
|
+
input: a.input,
|
|
1056
|
+
label: a.label
|
|
1057
|
+
},
|
|
1058
|
+
label: "hex",
|
|
1059
|
+
value: r.replace("#", ""),
|
|
1060
|
+
onChange: o
|
|
1061
|
+
})
|
|
1062
|
+
}),
|
|
1063
|
+
c("div", {
|
|
1064
|
+
style: a.single,
|
|
1065
|
+
children: c(Z, {
|
|
1066
|
+
style: {
|
|
1067
|
+
input: a.input,
|
|
1068
|
+
label: a.label
|
|
1069
|
+
},
|
|
1070
|
+
label: "r",
|
|
1071
|
+
value: t.r,
|
|
1072
|
+
onChange: o,
|
|
1073
|
+
dragLabel: "true",
|
|
1074
|
+
dragMax: "255"
|
|
1075
|
+
})
|
|
1076
|
+
}),
|
|
1077
|
+
c("div", {
|
|
1078
|
+
style: a.single,
|
|
1079
|
+
children: c(Z, {
|
|
1080
|
+
style: {
|
|
1081
|
+
input: a.input,
|
|
1082
|
+
label: a.label
|
|
1083
|
+
},
|
|
1084
|
+
label: "g",
|
|
1085
|
+
value: t.g,
|
|
1086
|
+
onChange: o,
|
|
1087
|
+
dragLabel: "true",
|
|
1088
|
+
dragMax: "255"
|
|
1089
|
+
})
|
|
1090
|
+
}),
|
|
1091
|
+
c("div", {
|
|
1092
|
+
style: a.single,
|
|
1093
|
+
children: c(Z, {
|
|
1094
|
+
style: {
|
|
1095
|
+
input: a.input,
|
|
1096
|
+
label: a.label
|
|
1097
|
+
},
|
|
1098
|
+
label: "b",
|
|
1099
|
+
value: t.b,
|
|
1100
|
+
onChange: o,
|
|
1101
|
+
dragLabel: "true",
|
|
1102
|
+
dragMax: "255"
|
|
1103
|
+
})
|
|
1104
|
+
}),
|
|
1105
|
+
c("div", {
|
|
1106
|
+
style: a.alpha,
|
|
1107
|
+
children: c(Z, {
|
|
1108
|
+
style: {
|
|
1109
|
+
input: a.input,
|
|
1110
|
+
label: a.label
|
|
1111
|
+
},
|
|
1112
|
+
label: "a",
|
|
1113
|
+
value: Math.round(100 * t.a),
|
|
1114
|
+
onChange: o,
|
|
1115
|
+
dragLabel: "true",
|
|
1116
|
+
dragMax: "100"
|
|
1117
|
+
})
|
|
1118
|
+
})
|
|
1119
|
+
]
|
|
1120
|
+
});
|
|
1121
|
+
}, te = class extends (r || n) {
|
|
1122
|
+
constructor(e) {
|
|
1123
|
+
super(e), this.handleChange = (e) => {
|
|
1124
|
+
typeof this.props.onChange == "function" && this.throttle(this.props.onChange, ((e, t, n) => {
|
|
1125
|
+
var r = n.getBoundingClientRect(), i = r.width, a = r.height, o = typeof e.pageX == "number" ? e.pageX : e.touches[0].pageX, s = typeof e.pageY == "number" ? e.pageY : e.touches[0].pageY, c = o - (n.getBoundingClientRect().left + window.pageXOffset), l = s - (n.getBoundingClientRect().top + window.pageYOffset);
|
|
1126
|
+
c < 0 ? c = 0 : c > i && (c = i), l < 0 ? l = 0 : l > a && (l = a);
|
|
1127
|
+
var u = c / i, d = 1 - l / a;
|
|
1128
|
+
return {
|
|
1129
|
+
h: t.h,
|
|
1130
|
+
s: u,
|
|
1131
|
+
v: d,
|
|
1132
|
+
a: t.a,
|
|
1133
|
+
source: "hsv"
|
|
1134
|
+
};
|
|
1135
|
+
})(e, this.props.hsl, this.container), e), e.preventDefault();
|
|
1136
|
+
}, this.handleMouseDown = (e) => {
|
|
1137
|
+
this.handleChange(e);
|
|
1138
|
+
let t = this.getContainerRenderWindow();
|
|
1139
|
+
t.addEventListener("mousemove", this.handleChange), t.addEventListener("mouseup", this.handleMouseUp);
|
|
1140
|
+
}, this.handleMouseUp = (e) => {
|
|
1141
|
+
e.preventDefault(), this.unbindEventListeners();
|
|
1142
|
+
}, this.throttle = function(e, t, n) {
|
|
1143
|
+
let r, i, a, o;
|
|
1144
|
+
var s = 0;
|
|
1145
|
+
n ||= {};
|
|
1146
|
+
let c = function() {
|
|
1147
|
+
s = !1 === n.leading ? 0 : Date.now(), r = null, o = e.apply(i, a), r || (i = a = null);
|
|
1148
|
+
}, l = function() {
|
|
1149
|
+
var l = Date.now();
|
|
1150
|
+
s || !1 !== n.leading || (s = l);
|
|
1151
|
+
var u = t - (l - s);
|
|
1152
|
+
return i = this, a = arguments, u <= 0 || u > t ? (r &&= (clearTimeout(r), null), s = l, o = e.apply(i, a), r || (i = a = null)) : r || !1 === n.trailing || (r = setTimeout(c, u)), o;
|
|
1153
|
+
};
|
|
1154
|
+
return l.cancel = function() {
|
|
1155
|
+
clearTimeout(r), s = 0, r = i = a = null;
|
|
1156
|
+
}, l;
|
|
1157
|
+
}((e, t, n) => {
|
|
1158
|
+
e(t, n);
|
|
1159
|
+
}, 50);
|
|
1160
|
+
}
|
|
1161
|
+
componentWillUnmount() {
|
|
1162
|
+
this.throttle.cancel(), this.unbindEventListeners();
|
|
1163
|
+
}
|
|
1164
|
+
getContainerRenderWindow() {
|
|
1165
|
+
let { container: e } = this, t = window;
|
|
1166
|
+
for (; !t.document.contains(e) && t.parent !== t;) t = t.parent;
|
|
1167
|
+
return t;
|
|
1168
|
+
}
|
|
1169
|
+
unbindEventListeners() {
|
|
1170
|
+
let e = this.getContainerRenderWindow();
|
|
1171
|
+
e.removeEventListener("mousemove", this.handleChange), e.removeEventListener("mouseup", this.handleMouseUp);
|
|
1172
|
+
}
|
|
1173
|
+
render() {
|
|
1174
|
+
let { color: e, white: t, black: n, pointer: r, circle: i } = this.props || {}, a = {
|
|
1175
|
+
position: "absolute",
|
|
1176
|
+
top: "0px",
|
|
1177
|
+
left: "0px",
|
|
1178
|
+
right: "0px",
|
|
1179
|
+
bottom: "0px"
|
|
1180
|
+
}, o = {
|
|
1181
|
+
color: {
|
|
1182
|
+
...a,
|
|
1183
|
+
backgroundColor: `hsl(${this.props.hsl?.h},100%, 50%)`,
|
|
1184
|
+
borderRadius: this.props.style?.borderRadius
|
|
1185
|
+
},
|
|
1186
|
+
white: {
|
|
1187
|
+
...a,
|
|
1188
|
+
borderRadius: this.props.style?.borderRadius
|
|
1189
|
+
},
|
|
1190
|
+
black: {
|
|
1191
|
+
...a,
|
|
1192
|
+
boxShadow: this.props.style?.boxShadow,
|
|
1193
|
+
borderRadius: this.props.style?.borderRadius
|
|
1194
|
+
},
|
|
1195
|
+
pointer: {
|
|
1196
|
+
...a,
|
|
1197
|
+
top: -100 * this.props.hsv?.v + 100 + "%",
|
|
1198
|
+
left: 100 * this.props.hsv?.s + "%",
|
|
1199
|
+
cursor: "default"
|
|
1200
|
+
},
|
|
1201
|
+
circle: {
|
|
1202
|
+
width: "4px",
|
|
1203
|
+
height: "4px",
|
|
1204
|
+
boxShadow: "0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",
|
|
1205
|
+
borderRadius: "50%",
|
|
1206
|
+
cursor: "hand",
|
|
1207
|
+
transform: "translate(-2px, -2px)"
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
return l("div", {
|
|
1211
|
+
style: o.color,
|
|
1212
|
+
ref: (e) => this.container = e,
|
|
1213
|
+
onMouseDown: this.handleMouseDown,
|
|
1214
|
+
onTouchMove: this.handleChange,
|
|
1215
|
+
onTouchStart: this.handleChange,
|
|
1216
|
+
children: [c("style", { children: "\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n " }), l("div", {
|
|
1217
|
+
style: o.white,
|
|
1218
|
+
className: "saturation-white",
|
|
1219
|
+
children: [c("div", {
|
|
1220
|
+
style: o.black,
|
|
1221
|
+
className: "saturation-black"
|
|
1222
|
+
}), c("div", {
|
|
1223
|
+
style: o.pointer,
|
|
1224
|
+
children: this.props.pointer ? c(this.props.pointer, { ...this.props }) : c("div", { style: o.circle })
|
|
1225
|
+
})]
|
|
1226
|
+
})]
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
}, Q = (e, t = null) => {
|
|
1230
|
+
let n = e.hex ? h(e.hex) : h(e || "transparent"), r = n.toHsl(), i = n.toHsv(), a = n.toRgb(), o = n.toHex();
|
|
1231
|
+
return r.s === 0 && (r.h = t ?? 0, i.h = t ?? 0), {
|
|
1232
|
+
hsl: r,
|
|
1233
|
+
hex: "#" + o,
|
|
1234
|
+
rgb: a,
|
|
1235
|
+
hsv: i,
|
|
1236
|
+
source: e.source
|
|
1237
|
+
};
|
|
1238
|
+
}, $ = i((n) => {
|
|
1239
|
+
let { selectedColor: r, onColorChange: i, renderers: f, disableAlpha: p = !1, style: m = t.EmptyCssProperties, ...h } = n, g = d(), [_, v] = s(() => Q(r)), [y, b] = s(_.hsl.h ?? 0), x = a((e) => {
|
|
1240
|
+
let t = Q(e, y);
|
|
1241
|
+
return b(t.hsl.h ?? 0), v(t), t;
|
|
1242
|
+
}, [y]), S = a((e) => {
|
|
1243
|
+
let t = x(e), n = `rgba(${t.rgb.r},${t.rgb.g},${t.rgb.b},${p ? 1 : t.rgb.a})`;
|
|
1244
|
+
i?.(n);
|
|
1245
|
+
}, [
|
|
1246
|
+
i,
|
|
1247
|
+
x,
|
|
1248
|
+
p
|
|
1249
|
+
]);
|
|
1250
|
+
o(() => {
|
|
1251
|
+
x(r);
|
|
1252
|
+
}, [r, x]);
|
|
1253
|
+
let C = c("div", {
|
|
1254
|
+
style: {
|
|
1255
|
+
position: "relative",
|
|
1256
|
+
minHeight: "10px",
|
|
1257
|
+
maxHeight: "10px",
|
|
1258
|
+
width: "100%"
|
|
1259
|
+
},
|
|
1260
|
+
children: c(J, {
|
|
1261
|
+
style: {
|
|
1262
|
+
radius: "2px",
|
|
1263
|
+
shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
1264
|
+
},
|
|
1265
|
+
rgb: _.rgb,
|
|
1266
|
+
hsl: _.hsl,
|
|
1267
|
+
renderers: f,
|
|
1268
|
+
onChange: S
|
|
1269
|
+
})
|
|
1270
|
+
});
|
|
1271
|
+
return l("div", {
|
|
1272
|
+
style: {
|
|
1273
|
+
display: "flex",
|
|
1274
|
+
flexDirection: "column",
|
|
1275
|
+
...m
|
|
1276
|
+
},
|
|
1277
|
+
...h,
|
|
1278
|
+
children: [
|
|
1279
|
+
c("div", {
|
|
1280
|
+
style: {
|
|
1281
|
+
width: "100%",
|
|
1282
|
+
flex: "1 1 100%",
|
|
1283
|
+
position: "relative",
|
|
1284
|
+
overflow: "hidden"
|
|
1285
|
+
},
|
|
1286
|
+
children: c(te, {
|
|
1287
|
+
style: {
|
|
1288
|
+
borderRadius: "3px",
|
|
1289
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
1290
|
+
},
|
|
1291
|
+
hsl: _.hsl,
|
|
1292
|
+
hsv: _.hsv,
|
|
1293
|
+
onChange: S
|
|
1294
|
+
})
|
|
1295
|
+
}),
|
|
1296
|
+
l("div", {
|
|
1297
|
+
style: {
|
|
1298
|
+
marginTop: "4px",
|
|
1299
|
+
display: "flex",
|
|
1300
|
+
gap: "4px"
|
|
1301
|
+
},
|
|
1302
|
+
children: [l("div", {
|
|
1303
|
+
style: {
|
|
1304
|
+
flex: "1",
|
|
1305
|
+
display: "flex",
|
|
1306
|
+
flexDirection: p ? "row" : "column",
|
|
1307
|
+
justifyContent: "space-between",
|
|
1308
|
+
alignItems: "center"
|
|
1309
|
+
},
|
|
1310
|
+
children: [c("div", {
|
|
1311
|
+
style: {
|
|
1312
|
+
position: "relative",
|
|
1313
|
+
minHeight: "10px",
|
|
1314
|
+
maxHeight: "10px",
|
|
1315
|
+
width: "100%"
|
|
1316
|
+
},
|
|
1317
|
+
children: c(q, {
|
|
1318
|
+
style: {
|
|
1319
|
+
radius: "2px",
|
|
1320
|
+
shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
1321
|
+
},
|
|
1322
|
+
hsl: _.hsl,
|
|
1323
|
+
onChange: S
|
|
1324
|
+
})
|
|
1325
|
+
}), p ? null : C]
|
|
1326
|
+
}), l("div", {
|
|
1327
|
+
style: {
|
|
1328
|
+
minWidth: "24px",
|
|
1329
|
+
maxWidth: "24px",
|
|
1330
|
+
minHeight: "24px",
|
|
1331
|
+
maxHeight: "24px",
|
|
1332
|
+
position: "relative",
|
|
1333
|
+
borderRadius: "1px",
|
|
1334
|
+
overflow: "hidden"
|
|
1335
|
+
},
|
|
1336
|
+
children: [c(e, { grey: g.palette.text.icon ?? g.palette.action.active }), c("div", { style: {
|
|
1337
|
+
position: "absolute",
|
|
1338
|
+
height: "100%",
|
|
1339
|
+
width: "100%",
|
|
1340
|
+
background: `rgba(${_.rgb.r},${_.rgb.g},${_.rgb.b},${p ? 1 : _.rgb.a})`,
|
|
1341
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
1342
|
+
} })]
|
|
1343
|
+
})]
|
|
1344
|
+
}),
|
|
1345
|
+
c(u, {
|
|
1346
|
+
sx: {
|
|
1347
|
+
marginBottom: "4px",
|
|
1348
|
+
"& label": {
|
|
1349
|
+
fontFamily: (e) => `${e.typography.fontFamily} !important`,
|
|
1350
|
+
color: (e) => `${e.palette.text.secondary} !important`
|
|
1351
|
+
},
|
|
1352
|
+
"& *": {
|
|
1353
|
+
fontFamily: (e) => `${e.typography.fontFamily} !important`,
|
|
1354
|
+
userSelect: "none"
|
|
1355
|
+
},
|
|
1356
|
+
"& input": {
|
|
1357
|
+
paddingLeft: (e) => `${e.spacing(.5)} !important`,
|
|
1358
|
+
paddingRight: (e) => `${e.spacing(.5)} !important`,
|
|
1359
|
+
outline: "none",
|
|
1360
|
+
boxSizing: "border-box",
|
|
1361
|
+
width: "100% !important",
|
|
1362
|
+
textAlign: "center"
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
children: c(ee, {
|
|
1366
|
+
rgb: _.rgb,
|
|
1367
|
+
hsl: _.hsl,
|
|
1368
|
+
hex: _.hex,
|
|
1369
|
+
disableAlpha: p,
|
|
1370
|
+
onChange: S
|
|
1371
|
+
})
|
|
1372
|
+
})
|
|
1373
|
+
]
|
|
1374
|
+
});
|
|
1375
|
+
});
|
|
1376
|
+
export { $ as CustomColorPanel, $ as default };
|