@sheetxl/studio-mui 0.8.0-beta.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/LICENSE.md +17 -7
  2. package/browser/esm/{DT71hr6qq9QMKf7Q.mjs → 2dGXbxSvPxpMpoQB.mjs} +2 -2
  3. package/browser/esm/AKfq7wiKunwYv5Co.mjs +87 -0
  4. package/browser/esm/{C--IZ8To0PhVLhoX.mjs → B16SyYhTCohin7vO.mjs} +4 -4
  5. package/browser/esm/B4qh8uSPezvUgs_C.mjs +414 -0
  6. package/browser/esm/BGR0Hv_mjOPfYxiD.mjs +975 -0
  7. package/browser/esm/{ipftNUxAU0HR-0YP.mjs → BVbTWo0j5ttMcIWs.mjs} +3 -3
  8. package/browser/esm/BctMjTuii_LaWmHJ.mjs +119 -0
  9. package/browser/esm/{DiKCs9R7e4MgyayQ.mjs → Bf-pwjpYBKNwL4f8.mjs} +4 -4
  10. package/browser/esm/Bh7XfTPJIFjaL6fa.mjs +13 -0
  11. package/browser/esm/BjH_mK6445rm6PL1.mjs +94 -0
  12. package/browser/esm/BqJSEK805PP8lILC.mjs +197 -0
  13. package/browser/esm/BrIWEn7tabhEreBm.mjs +973 -0
  14. package/browser/esm/{BscaD3SzYM6ysjgy.mjs → BsFK55lPALVUu31_.mjs} +5 -5
  15. package/browser/esm/{BdkeyaHAtiNa6jqW.mjs → C0PinnqWu_JwK9l_.mjs} +33 -31
  16. package/browser/esm/C1KcphZVjVAE638t.mjs +415 -0
  17. package/browser/esm/{80XYmJwiiFLBmpH2.mjs → C3V7EwPHHPx9aEkE.mjs} +47 -48
  18. package/browser/esm/CCAPeyEqlStPrh6B.mjs +294 -0
  19. package/browser/esm/{BNYKPFICOYt2VRsP.mjs → CF2Az5oBVjAigMRt.mjs} +2 -2
  20. package/browser/esm/CIqEqDyl8JZRMblX.mjs +225 -0
  21. package/browser/esm/CJERhz_1u40JkHfH.mjs +235 -0
  22. package/browser/esm/CNtF9Fix0G6BEVEl.mjs +424 -0
  23. package/browser/esm/{a5G-3nVFn86pvt8H.mjs → CWP52da2iNOs3Qtz.mjs} +82 -94
  24. package/browser/esm/CWpF_0HjYiRiddX6.mjs +31 -0
  25. package/browser/esm/CbedwfwBLBaagGD-.mjs +360 -0
  26. package/browser/esm/{ffz9LGAgGiWQQav9.mjs → Cc9tcBSYzJIv-dZw.mjs} +156 -109
  27. package/browser/esm/CcPLziOAdWTbG7xx.mjs +141 -0
  28. package/browser/esm/CdRnGw_9tvkn9d9o.mjs +335 -0
  29. package/browser/esm/{BXQPMQyxdiYwawjE.mjs → CgLDSZ8XvBqAB-Y2.mjs} +20 -18
  30. package/browser/esm/CgZLR7ijzsUoawf8.mjs +1281 -0
  31. package/browser/esm/Cn6OsV-MbO0rIM-o.mjs +442 -0
  32. package/browser/esm/{CHLqCxo3afOV1Otw.mjs → CnDnNU6GGzM05K8w.mjs} +4 -4
  33. package/browser/esm/CnVHQ6i6a8VCMsn1.mjs +106 -0
  34. package/browser/esm/D06He-Tw4moPdM5f.mjs +103 -0
  35. package/browser/esm/D9lQwTAJ9RO60ovS.mjs +72 -0
  36. package/browser/esm/{Cykd-NaZAtHJlQmQ.mjs → D9xw1YuRJUjPMaqA.mjs} +2 -2
  37. package/browser/esm/DBr6lCvWLLwnzSGy.mjs +386 -0
  38. package/browser/esm/DEdHwT-2JZO9HyZN.mjs +14 -0
  39. package/browser/esm/DH4SdW-02-I8082_.mjs +14 -0
  40. package/browser/esm/DHbnrUh5rdi62fgO.mjs +516 -0
  41. package/browser/esm/DJRKcOT0Xv-1r0OP.mjs +161 -0
  42. package/browser/esm/DPycoTH_4RNdK2hu.mjs +252 -0
  43. package/browser/esm/{BIZX_0jxF9Fmaxuy.mjs → DXQTN_6-MvPivCrz.mjs} +8 -6
  44. package/browser/esm/DaNVYYZLCql8_n0i.mjs +831 -0
  45. package/browser/esm/Dakiv-oEU8ty2ILI.mjs +77 -0
  46. package/browser/esm/DfCd-MxLjE3gZ5jl.mjs +392 -0
  47. package/browser/esm/DhZqt49Ue-lveZv3.mjs +2692 -0
  48. package/browser/esm/DkxgFV6jJb6pO6lM.mjs +490 -0
  49. package/browser/esm/{DpdMtsE7oOAIJqFo.mjs → QKDgV7kur90Bzexo.mjs} +14 -13
  50. package/browser/esm/R8q92QTpUT-sB4Nq.mjs +8547 -0
  51. package/browser/esm/RaV_j7qhH97TUb6P.mjs +1550 -0
  52. package/browser/esm/S-MJsifSUY334In9.mjs +8 -0
  53. package/browser/esm/UW74C3TpyGhFEOFO.mjs +267 -0
  54. package/browser/esm/W-jkQJTDojDSK93k.mjs +242 -0
  55. package/browser/esm/czz-Du13p5saoAex.mjs +318 -0
  56. package/browser/esm/{CawSvjLj4-2Qqyef.mjs → ilgUW6eI60262DJU.mjs} +2 -2
  57. package/browser/esm/index.mjs +1910 -289
  58. package/browser/esm/kbx_7Y2kVGMGIWtW.mjs +633 -0
  59. package/browser/esm/vCWRBUPIH8HXlYjO.mjs +94 -0
  60. package/browser/esm/w0DasqEtSJvoQVk2.mjs +517 -0
  61. package/browser/esm/w5dY32V2IxkbDBsT.mjs +225 -0
  62. package/licenses/dependencies.txt +106 -359
  63. package/node/esm/7GlVS1uyKRUAAjw9.mjs +1831 -0
  64. package/node/esm/B0mjDApnDOWo9UGr.mjs +412 -0
  65. package/node/esm/B19kx8jtLWU7WYCa.mjs +142 -0
  66. package/node/esm/BAFf7hg6qgFyQDW8.mjs +73 -0
  67. package/node/esm/BDdBcx7cNTM1hIXu.mjs +972 -0
  68. package/node/esm/BGBolrjPvNncjS1h.mjs +94 -0
  69. package/node/esm/BI3dFg_vx1Vgxgps.mjs +516 -0
  70. package/node/esm/BO19LMEPFqVsK1xu.mjs +267 -0
  71. package/node/esm/{b05_u9WnJaVGO0nq.mjs → BSrtVTtNqcTg8QKK.mjs} +2 -2
  72. package/node/esm/BcLccq7CvZiJXCDZ.mjs +319 -0
  73. package/node/esm/BeZ1ZY1UJepW8u1f.mjs +118 -0
  74. package/node/esm/BkLwJxkD4pyrume5.mjs +425 -0
  75. package/node/esm/{CTtj1NR0IrcN8PTy.mjs → Bl_AT6xOKzBqc3PT.mjs} +10 -10
  76. package/node/esm/{Defb5qpSal98J5ay.mjs → Bqah1dCUEhmRmY3c.mjs} +2 -2
  77. package/node/esm/Bv5awmbwVUdl4rma.mjs +106 -0
  78. package/node/esm/C3mSFWiCu7iONlk6.mjs +638 -0
  79. package/node/esm/CAJhvJU0gj93fPWl.mjs +141 -0
  80. package/node/esm/CJobW3iRAQ5vHeQr.mjs +14 -0
  81. package/node/esm/{Dyd7va4aqC1jIzAk.mjs → CSJTM9SCqIDkHlpm.mjs} +21 -21
  82. package/node/esm/CUnv4ewRTvuP0si8.mjs +1276 -0
  83. package/node/esm/CWnezGEPuX9UeJ8E.mjs +385 -0
  84. package/node/esm/{BHuZQ-LJ2GgDLYSz.mjs → CarjiReyjevcMdlI.mjs} +190 -141
  85. package/node/esm/CoG2fq6dYCvhC5yu.mjs +224 -0
  86. package/node/esm/Cpegk2BA6FOrOkZ0.mjs +77 -0
  87. package/node/esm/Cq1V2i0dRTWnoU1K.mjs +94 -0
  88. package/node/esm/{9k03YHFiw-wlUS8d.mjs → CyPtKWjud-Y-Pvq8.mjs} +2 -2
  89. package/node/esm/DEVN1ZPedFq8Bnui.mjs +197 -0
  90. package/node/esm/{BkoorcOtOEh_Y7ck.mjs → DFUPAGKlHT2-8dyC.mjs} +33 -31
  91. package/node/esm/DMxfzW-UQdMaV-Gx.mjs +975 -0
  92. package/node/esm/DWbMD1KaT8mlCUfO.mjs +519 -0
  93. package/node/esm/{DHHgNbakbpNnu0oW.mjs → DffuRwJI_5oVtzZb.mjs} +23 -23
  94. package/node/esm/Dg9rTwnydI2UVmGG.mjs +242 -0
  95. package/node/esm/{D4KDk-w7Khu7LrSi.mjs → DmQMejdH1-aYq99z.mjs} +70 -71
  96. package/node/esm/{BiHw3x2LPWT-kK8G.mjs → DvSoGqy_51YQZzYM.mjs} +84 -96
  97. package/node/esm/DzTvKGqU1I9m-_qd.mjs +391 -0
  98. package/node/esm/{CNkqJbFlITxBA0t4.mjs → PKRuDgaA8RrsqSNn.mjs} +29 -29
  99. package/node/esm/{C5g2gBoUk3-cn94h.mjs → POUGgaN5BmOnEPPl.mjs} +2 -2
  100. package/node/esm/WqxW6Up5_6oeJrSr.mjs +489 -0
  101. package/node/esm/ehyFZGpXZSmR7Q7-.mjs +294 -0
  102. package/node/esm/index.mjs +9717 -8954
  103. package/package.json +16 -19
  104. package/resources/contents.json +6 -0
  105. package/resources/locales/contents.json +14 -0
  106. package/resources/locales/de/groups.cmd.json +59 -10
  107. package/resources/locales/de/ui.msg.json +267 -14
  108. package/resources/locales/de/workbookAnomalies.cmd.json +14 -0
  109. package/resources/locales/en/groups.cmd.json +63 -11
  110. package/resources/locales/en/ui.msg.json +272 -14
  111. package/resources/locales/en/workbookAnomalies.cmd.json +14 -0
  112. package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
  113. package/types/src/anomalies/AnomaliesCommands.d.ts +8 -0
  114. package/types/src/anomalies/AnomaliesMessages.d.ts +30 -0
  115. package/types/src/anomalies/AnomaliesPlugin.d.ts +12 -0
  116. package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
  117. package/types/src/anomalies/_source.d.ts +7 -0
  118. package/types/src/anomalies/index.d.ts +3 -0
  119. package/types/src/border/BorderPopupButton.d.ts +1 -1
  120. package/types/src/border/BorderTemplateIcon.d.ts +6 -1
  121. package/types/src/chart/ChartFormatPanel.d.ts +20 -0
  122. package/types/src/chart/ChartPlugin.d.ts +6 -0
  123. package/types/src/chart/index.d.ts +3 -0
  124. package/types/src/color/ColorPopupButton.d.ts +1 -1
  125. package/types/src/command/AccountingStyleCommandButton.d.ts +1 -1
  126. package/types/src/command/ColorCommandButton.d.ts +5 -0
  127. package/types/src/command/DocThemeCommandButton.d.ts +1 -1
  128. package/types/src/command/FontFamilyCommandButton.d.ts +1 -1
  129. package/types/src/command/FontSizeCommandButton.d.ts +1 -1
  130. package/types/src/command/InsertCellControlCommandButton.d.ts +17 -0
  131. package/types/src/command/LanguageCommandButton.d.ts +1 -1
  132. package/types/src/command/LocaleCommandButton.d.ts +1 -1
  133. package/types/src/command/PresetCellStylesCommandButton.d.ts +3 -3
  134. package/types/src/command/PresetPivotStylesCommandButton.d.ts +17 -0
  135. package/types/src/command/SheetZoomCommandButton.d.ts +4 -3
  136. package/types/src/command/index.d.ts +2 -0
  137. package/types/src/comments/CommentCard.d.ts +2 -2
  138. package/types/src/comments/CommentsPlugin.d.ts +1 -1
  139. package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts +1 -1
  140. package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +4 -4
  141. package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +3 -3
  142. package/types/src/conditionalFormat/IconSetRulePanel.d.ts +1 -1
  143. package/types/src/conditions/CombinatorOption.d.ts +7 -0
  144. package/types/src/conditions/ConditionEditor.d.ts +55 -3
  145. package/types/src/conditions/ConditionUtils.d.ts +34 -6
  146. package/types/src/conditions/ExpressionOption.d.ts +6 -0
  147. package/types/src/conditions/MembershipOption.d.ts +67 -0
  148. package/types/src/conditions/OperatorAndParamEditor.d.ts +36 -1
  149. package/types/src/conditions/OperatorSelectPopupButton.d.ts +1 -1
  150. package/types/src/conditions/ScalarOption.d.ts +5 -4
  151. package/types/src/conditions/SelectorSelect.d.ts +16 -7
  152. package/types/src/conditions/index.d.ts +1 -1
  153. package/types/src/conditions/useFormulaOption.d.ts +2 -2
  154. package/types/src/dataValidation/DataValidationEditorPanel.d.ts +9 -5
  155. package/types/src/dataValidation/DataValidationIcon.d.ts +1 -1
  156. package/types/src/dataValidation/DataValidationPlugin.d.ts +1 -1
  157. package/types/src/dialog/HyperlinkDialog.d.ts +15 -0
  158. package/types/src/dialog/PivotTableNewDialog.d.ts +11 -0
  159. package/types/src/dialog/SparklineEditDialog.d.ts +10 -0
  160. package/types/src/dialog/SparklineNewDialog.d.ts +23 -0
  161. package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
  162. package/types/src/dialog/_ShortcutSearch.d.ts +26 -0
  163. package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +1 -1
  164. package/types/src/externalLink/ExternalLinksPlugin.d.ts +1 -1
  165. package/types/src/fill/GradientEditor.d.ts +15 -13
  166. package/types/src/fill/GradientStopsBar.d.ts +43 -0
  167. package/types/src/fill/PatternPopupButton.d.ts +1 -1
  168. package/types/src/fill/index.d.ts +1 -0
  169. package/types/src/filter/ColumnMenu.d.ts +31 -1
  170. package/types/src/filter/PivotMenu.d.ts +31 -0
  171. package/types/src/filter/index.d.ts +1 -1
  172. package/types/src/form/FormulaField.d.ts +4 -4
  173. package/types/src/form/InputField.d.ts +5 -5
  174. package/types/src/format/BorderPreview.d.ts +11 -4
  175. package/types/src/format/FillPanel.d.ts +42 -2
  176. package/types/src/format/FormatPanelParts.d.ts +3 -1
  177. package/types/src/format/FormatPlugin.d.ts +1 -6
  178. package/types/src/format/LinePanel.d.ts +53 -0
  179. package/types/src/format/LinePreviews.d.ts +71 -0
  180. package/types/src/format/index.d.ts +1 -0
  181. package/types/src/format/useFormatSelection.d.ts +6 -6
  182. package/types/src/formulaBar/IFormulaBar.d.ts +32 -3
  183. package/types/src/formulaBar/MobileFormulaBar.d.ts +42 -0
  184. package/types/src/formulaBar/MobileInputToolbar.d.ts +43 -0
  185. package/types/src/formulaBar/index.d.ts +3 -0
  186. package/types/src/formulaBar/useFormulaBarSession.d.ts +68 -0
  187. package/types/src/index.d.ts +19 -6
  188. package/types/src/itemsPanel/ItemCard.d.ts +50 -7
  189. package/types/src/itemsPanel/ItemsPanel.d.ts +5 -0
  190. package/types/src/itemsPanel/ItemsSearchField.d.ts +17 -0
  191. package/types/src/itemsPanel/index.d.ts +1 -0
  192. package/types/src/named/NamedDetailsPanel.d.ts +2 -2
  193. package/types/src/named/NamedPlugin.d.ts +1 -1
  194. package/types/src/picture/PicturePlugin.d.ts +6 -0
  195. package/types/src/picture/index.d.ts +2 -0
  196. package/types/src/pivot/PivotChipMenu.d.ts +10 -0
  197. package/types/src/pivot/PivotPlugin.d.ts +3 -0
  198. package/types/src/pivot/PivotStyleCanvasPreview.d.ts +23 -0
  199. package/types/src/pivot/PivotTableHeader.d.ts +12 -0
  200. package/types/src/pivot/PivotValueSettingsDialog.d.ts +15 -0
  201. package/types/src/pivot/_pivotSource.d.ts +7 -0
  202. package/types/src/presence/PresenceOverlay.d.ts +14 -0
  203. package/types/src/presence/PresencePlugin.d.ts +31 -0
  204. package/types/src/presence/PresenceStrip.d.ts +22 -0
  205. package/types/src/presence/PresenceTaskPane.d.ts +13 -0
  206. package/types/src/presence/Timeline.d.ts +29 -0
  207. package/types/src/presence/index.d.ts +5 -0
  208. package/types/src/protection/ProtectedCellsPanel.d.ts +3 -3
  209. package/types/src/protection/ProtectionPlugin.d.ts +1 -1
  210. package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
  211. package/types/src/protection/index.d.ts +1 -1
  212. package/types/src/shape/ShapeFormatPanel.d.ts +11 -0
  213. package/types/src/shape/ShapeGalleryCommandButton.d.ts +18 -0
  214. package/types/src/shape/ShapePlugin.d.ts +8 -0
  215. package/types/src/shape/index.d.ts +2 -1
  216. package/types/src/slicer/InsertSlicerCommandButton.d.ts +13 -0
  217. package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +12 -0
  218. package/types/src/slicer/SlicerPlugin.d.ts +6 -0
  219. package/types/src/slicer/index.d.ts +3 -0
  220. package/types/src/statusBar/PendingStatus.d.ts +19 -0
  221. package/types/src/statusBar/SheetZoomScale.d.ts +6 -0
  222. package/types/src/statusBar/index.d.ts +1 -0
  223. package/types/src/studio/StudioProps.d.ts +62 -27
  224. package/types/src/studio/formulaBarPlacement.d.ts +35 -0
  225. package/types/src/studio/useStudioApp.d.ts +25 -24
  226. package/types/src/table/TablePlugin.d.ts +1 -1
  227. package/types/src/table/_drawStyleSwatch.d.ts +25 -0
  228. package/types/src/template/TemplateDialog.d.ts +1 -1
  229. package/types/src/template/TemplatePanel.d.ts +5 -1
  230. package/types/src/template/TemplateSearchField.d.ts +17 -1
  231. package/types/src/template/categoryColor.d.ts +8 -0
  232. package/types/src/template/useTemplateCatalog.d.ts +2 -0
  233. package/types/src/theme/ThemeSelectPopupButton.d.ts +1 -1
  234. package/types/src/theme/ThemeUtils.d.ts +8 -27
  235. package/types/src/toolbar/WorkbookToolbars.d.ts +2 -2
  236. package/types/src/workbook/DefaultRenderers.d.ts +42 -18
  237. package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
  238. package/types/src/workbook/WorkbookElement.d.ts +5 -4
  239. package/types/src/workbook/WorkbookStrip.d.ts +8 -7
  240. package/types/src/workbook/index.d.ts +1 -1
  241. package/browser/cjs/2tG9HJLr-WjsOCP3.cjs +0 -1
  242. package/browser/cjs/3RXtLkq7wTAV6y_e.cjs +0 -1
  243. package/browser/cjs/3k_KqDFr-AybPztc.cjs +0 -5
  244. package/browser/cjs/4_Zy3pR6YXkzISoK.cjs +0 -1
  245. package/browser/cjs/BD50lsTki7wvzb5g.cjs +0 -1
  246. package/browser/cjs/BJ-wdkCaXqJaejKf.cjs +0 -1
  247. package/browser/cjs/BQJKf40kttQWOzLw.cjs +0 -20
  248. package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +0 -1
  249. package/browser/cjs/Bc-YisjBtD56vBAW.cjs +0 -1
  250. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
  251. package/browser/cjs/BpG4iwTKbAnpi0wM.cjs +0 -1
  252. package/browser/cjs/ByIUHPOa02D7XbdC.cjs +0 -1
  253. package/browser/cjs/C97KHSuikAbr1qVM.cjs +0 -1
  254. package/browser/cjs/CMfoKJ3ehdXuld_7.cjs +0 -14
  255. package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +0 -1
  256. package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +0 -1
  257. package/browser/cjs/CdDYyAfccXme8w6m.cjs +0 -1
  258. package/browser/cjs/CkroJ2FmfFvk6Eyv.cjs +0 -1
  259. package/browser/cjs/CzJvR12QCQb-0Rtn.cjs +0 -1
  260. package/browser/cjs/D-Yo5aV9STT5KH4G.cjs +0 -1
  261. package/browser/cjs/DwkiLFWUtLC8ZcIQ.cjs +0 -1
  262. package/browser/cjs/HuPFsmz7kyZVo3c7.cjs +0 -1
  263. package/browser/cjs/KZvriGbhEOVkQD0b.cjs +0 -1
  264. package/browser/cjs/M0_dvdYwhikqP9kg.cjs +0 -2
  265. package/browser/cjs/g1WhGOz5epV7Hqsg.cjs +0 -8
  266. package/browser/cjs/iMWEL01eC83oU-YY.cjs +0 -1
  267. package/browser/cjs/index.cjs +0 -2
  268. package/browser/esm/BoLRDhnoO3gvviYD.mjs +0 -13811
  269. package/browser/esm/CH-Y2-p8GRvCHvd4.mjs +0 -52
  270. package/browser/esm/CUhtBLyaGSkcKB_1.mjs +0 -236
  271. package/browser/esm/D-Kit71xiitqCWVY.mjs +0 -5356
  272. package/browser/esm/DkUDZxFxx9n2Cked.mjs +0 -223
  273. package/browser/esm/F6kkwcBr0l-496tC.mjs +0 -152
  274. package/browser/esm/Q8r5yuh8Yx2ROnhC.mjs +0 -115
  275. package/browser/esm/iRFlbG6hQyKLVagS.mjs +0 -411
  276. package/browser/esm/lftI5b4ZCHVYc6OZ.mjs +0 -1150
  277. package/node/esm/BTZGnNrgV1na62gd.mjs +0 -415
  278. package/node/esm/Be0G9parvc2CTpFQ.mjs +0 -4504
  279. package/node/esm/CTJqjeq3smY8jw5J.mjs +0 -236
  280. package/node/esm/DbLFR_dnQQmZC_jm.mjs +0 -115
  281. package/types/src/conditions/DateTimeOption.d.ts +0 -43
  282. package/types/src/conditions/ListSourceOption.d.ts +0 -31
  283. package/types/src/filter/FilterList.d.ts +0 -32
  284. package/types/src/shape/InsertShapeCommandButton.d.ts +0 -10
@@ -0,0 +1,975 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v1.0.0
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: MIT
6
+ */
7
+ import { i as e } from "./DPycoTH_4RNdK2hu.mjs";
8
+ import { t } from "./AKfq7wiKunwYv5Co.mjs";
9
+ import { n, t as r } from "./CcPLziOAdWTbG7xx.mjs";
10
+ import { ICellRange as i } from "@sheetxl/sdk";
11
+ import { promptUnlockProtectedRanges as a, useModelListener as o, useModelSync as s } from "@sheetxl/react";
12
+ import { DynamicIcon as c, NotifierType as l, useNotifier as u, useTranslator as d } from "@sheetxl/utils-react";
13
+ import { forwardRef as f, memo as p, useCallback as m, useReducer as h, useState as g } from "react";
14
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
15
+ import { Accordion as y, AccordionDetails as b, AccordionSummary as x, Alert as S, Box as C, Button as w, Checkbox as T, FormControlLabel as E, Paper as D, Switch as O, Tab as k, Tabs as A, TextField as j, Typography as M } from "@mui/material";
16
+ import { messageKey as N } from "@sheetxl/utils";
17
+ var P = /* @__PURE__ */ new WeakMap(), F = p((n) => {
18
+ let { protectedRange: i } = n, a = d();
19
+ s(i, "onAnyChange");
20
+ let o = i.isProtected(), [c, l] = g(() => i.getName()), [u] = g(() => i.getName()), [f, p] = g(null), [m, h] = g(() => i.hasPassword()), y = (() => {
21
+ try {
22
+ let e = i.getRanges();
23
+ return e.isInvalid() ? null : e.getWorksheet().getProtectedRanges();
24
+ } catch {
25
+ return null;
26
+ }
27
+ })(), b = () => {
28
+ let e = c.trim();
29
+ if (!e) return void p(a("protectedRange.nameRequired"));
30
+ let t = y?.getItems({ name: e })[0];
31
+ if (t && t.getName().toLocaleLowerCase() !== u.toLocaleLowerCase()) p(a("protectedRange.nameTaken", { name: e }));
32
+ else if (e !== i.getName()) try {
33
+ i.setName(e), p(null);
34
+ } catch (e) {
35
+ p(e?.message ?? a("protectedRange.nameRequired"));
36
+ }
37
+ else p(null);
38
+ };
39
+ return _(D, {
40
+ tabIndex: 0,
41
+ className: e["editor-panel"],
42
+ sx: {
43
+ gap: (e) => e.spacing(1),
44
+ paddingTop: (e) => e.spacing(1.25),
45
+ paddingBottom: (e) => e.spacing(2),
46
+ paddingLeft: (e) => e.spacing(1.5),
47
+ paddingRight: (e) => e.spacing(1.5),
48
+ border: (e) => `1px solid ${e.palette.divider}`,
49
+ borderRadius: (e) => e.spacing(1.25),
50
+ overflow: "auto"
51
+ },
52
+ children: v(C, {
53
+ sx: {
54
+ display: "flex",
55
+ flexDirection: "column",
56
+ gap: (e) => e.spacing(2),
57
+ margin: (e) => e.spacing(1.25)
58
+ },
59
+ children: [
60
+ _(j, {
61
+ label: a("protectedRange.name"),
62
+ size: "small",
63
+ fullWidth: !0,
64
+ disabled: o,
65
+ value: c,
66
+ error: f !== null,
67
+ helperText: f ?? void 0,
68
+ onChange: (e) => {
69
+ l(e.target.value), p(null);
70
+ },
71
+ onBlur: b,
72
+ onKeyDown: (e) => {
73
+ e.key === "Enter" && b();
74
+ }
75
+ }),
76
+ _(r, {
77
+ item: i,
78
+ label: a("protectedRange.applyTo")
79
+ }),
80
+ _(t, {
81
+ label: a("protectedRange.password"),
82
+ description: a("protectedRange.passwordHelp"),
83
+ hasPassword: m,
84
+ disabled: o,
85
+ onSet: (e) => {
86
+ h(!0), P.set(i, e);
87
+ },
88
+ onClear: () => {
89
+ h(!1), P.set(i, null);
90
+ }
91
+ }),
92
+ i.getSecurityDescriptor() ? _(M, {
93
+ variant: "caption",
94
+ sx: {
95
+ color: "text.secondary",
96
+ fontStyle: "italic"
97
+ },
98
+ children: a("protectedRange.hasPermissions")
99
+ }) : null
100
+ ]
101
+ })
102
+ });
103
+ });
104
+ F.displayName = "ProtectedRangeEditorPanel";
105
+ var I = {
106
+ color: (e) => e.palette.text.secondary,
107
+ fontStyle: "italic",
108
+ minWidth: 0
109
+ }, L = {
110
+ key: "protected-range",
111
+ messageKeys: {
112
+ none: N("protectedRange.none"),
113
+ addPrompt: N("protectedRange.addPrompt"),
114
+ insert: N("protectedRange.insert"),
115
+ new: N("protectedRange.new"),
116
+ edit: N("protectedRange.edit"),
117
+ duplicate: N("protectedRange.duplicate"),
118
+ delete: N("protectedRange.delete"),
119
+ cancel: N("protectedRange.cancel"),
120
+ save: N("protectedRange.save")
121
+ },
122
+ getCollection: (e) => e.getProtectedRanges(),
123
+ changeEvents: ["onProtectedRangesChange"],
124
+ isReadOnly: (e) => e.getProtection().isLocked(),
125
+ reorderable: !1,
126
+ beforeSave: (e) => (async (e) => {
127
+ if (!P.has(e)) return;
128
+ let t = P.get(e);
129
+ P.delete(e), await e.setPassword(t);
130
+ })(e),
131
+ applyUpdate: (e, t) => {
132
+ e.update(t);
133
+ },
134
+ getCardTitle: (e, t) => e.getName() || t("protectedRange.unnamed"),
135
+ CardMedia: () => _(c, {
136
+ iconKey: "LockRange",
137
+ size: 24,
138
+ ariaHidden: !0
139
+ }),
140
+ CardBody: ({ item: e }) => {
141
+ let t = d(), n = u(), r = e.getRanges(), i = r.isInvalid() ? null : r.getWorksheet();
142
+ if (s(e, ["onUnlockChange"]), s(i, ["onProtectionChange"]), !e.hasPassword()) return null;
143
+ if (!i?.getProtection().isLocked()) return _(M, {
144
+ variant: "caption",
145
+ sx: I,
146
+ children: t("protectedRange.passwordRequired")
147
+ });
148
+ let o = e.isUnlocked();
149
+ return v(C, {
150
+ sx: {
151
+ display: "grid",
152
+ gridTemplateColumns: "minmax(0, 1fr) auto",
153
+ alignItems: "center",
154
+ columnGap: (e) => e.spacing(1)
155
+ },
156
+ children: [_(M, {
157
+ variant: "caption",
158
+ sx: I,
159
+ children: t(o ? "protectedRange.unlocked" : "protectedRange.passwordRequired")
160
+ }), _(w, {
161
+ size: "small",
162
+ color: o ? "inherit" : "primary",
163
+ sx: { textTransform: "none" },
164
+ onClick: () => {
165
+ o ? e.relock() : a(n, [e]);
166
+ },
167
+ children: t(o ? "protectedRange.lock" : "protectedRange.unlock")
168
+ })]
169
+ });
170
+ },
171
+ EditorBody: ({ item: e }) => _(F, { protectedRange: e })
172
+ }, R = p(f((e, t) => {
173
+ let { workbook: r, args: i, ...a } = e;
174
+ return _(n, {
175
+ ref: t,
176
+ workbook: r,
177
+ descriptor: L,
178
+ args: i,
179
+ ...a
180
+ });
181
+ }));
182
+ R.displayName = "ProtectedRangeDetailsPanel";
183
+ var z = Object.freeze([
184
+ {
185
+ key: "selectLockedCells",
186
+ messageKey: N("sheetProtection.option.selectLockedCells"),
187
+ defaultValue: !0
188
+ },
189
+ {
190
+ key: "selectUnlockedCells",
191
+ messageKey: N("sheetProtection.option.selectUnlockedCells"),
192
+ defaultValue: !0
193
+ },
194
+ {
195
+ key: "formatCells",
196
+ messageKey: N("sheetProtection.option.formatCells")
197
+ },
198
+ {
199
+ key: "formatColumns",
200
+ messageKey: N("sheetProtection.option.formatColumns")
201
+ },
202
+ {
203
+ key: "formatRows",
204
+ messageKey: N("sheetProtection.option.formatRows")
205
+ },
206
+ {
207
+ key: "insertColumns",
208
+ messageKey: N("sheetProtection.option.insertColumns")
209
+ },
210
+ {
211
+ key: "insertRows",
212
+ messageKey: N("sheetProtection.option.insertRows")
213
+ },
214
+ {
215
+ key: "insertHyperlinks",
216
+ messageKey: N("sheetProtection.option.insertHyperlinks")
217
+ },
218
+ {
219
+ key: "deleteColumns",
220
+ messageKey: N("sheetProtection.option.deleteColumns")
221
+ },
222
+ {
223
+ key: "deleteRows",
224
+ messageKey: N("sheetProtection.option.deleteRows")
225
+ },
226
+ {
227
+ key: "sort",
228
+ messageKey: N("sheetProtection.option.sort")
229
+ },
230
+ {
231
+ key: "autoTable",
232
+ messageKey: N("sheetProtection.option.autoFilter")
233
+ },
234
+ {
235
+ key: "pivotTables",
236
+ messageKey: N("sheetProtection.option.pivotTables")
237
+ },
238
+ {
239
+ key: "objects",
240
+ messageKey: N("sheetProtection.option.objects")
241
+ },
242
+ {
243
+ key: "scenarios",
244
+ messageKey: N("sheetProtection.option.scenarios")
245
+ },
246
+ {
247
+ key: "showFormulas",
248
+ messageKey: N("sheetProtection.option.showFormulas"),
249
+ defaultValue: !0
250
+ }
251
+ ]), B = (e) => {
252
+ let t = e.getProperties() ?? {}, n = {};
253
+ for (let e of z) n[e.key] = !0 === (t[e.key] ?? e.defaultValue ?? !1);
254
+ return n;
255
+ }, V = p(f((e, n) => {
256
+ let { sheet: r, ...i } = e, a = d(), o = u(), f = r.getProtection(), p = r.getView();
257
+ s(r, ["onProtectionChange"]), s(p, ["onAnyChange"]);
258
+ let h = f.isPaused(), D = f.isLocked() || h, k = f.hasPassword(), [A, j] = g(null), [N, P] = g(!1), F = B(f), I = f.isLocked(), L = m((e) => {
259
+ o.showMessage?.(e?.message ?? String(e), { type: l.Error });
260
+ }, [o]), R = m(async (e) => {
261
+ let t = await o.showInput({
262
+ title: a("dialog.password.title"),
263
+ description: e,
264
+ options: ["Ok", "Cancel"],
265
+ defaultOption: "Ok",
266
+ cancelOption: "Cancel",
267
+ inputType: "password"
268
+ });
269
+ return t?.option === "Ok" ? t.input ?? "" : null;
270
+ }, [o, a]), V = m((e, t) => {
271
+ f.setProperties({
272
+ ...B(f),
273
+ [e]: t
274
+ }).catch(L);
275
+ }, [f, L]), H = m(async (e) => {
276
+ try {
277
+ if (!e) {
278
+ let e;
279
+ if (f.hasPassword()) {
280
+ let t = await R(a("dialog.password.description"));
281
+ if (t === null) return;
282
+ e = t || void 0;
283
+ }
284
+ await f.unlock(e), j(null);
285
+ return;
286
+ }
287
+ await f.lock(void 0, A || void 0), j(null);
288
+ } catch (e) {
289
+ L(e);
290
+ }
291
+ }, [
292
+ f,
293
+ R,
294
+ a,
295
+ A,
296
+ L
297
+ ]), U = m(async () => {
298
+ try {
299
+ if (f.isPaused()) return void f.resume();
300
+ let e;
301
+ if (f.hasPassword()) {
302
+ let t = await R(a("dialog.password.pauseDescription"));
303
+ if (t === null) return;
304
+ e = t || void 0;
305
+ }
306
+ await f.pause(e);
307
+ } catch (e) {
308
+ L(e);
309
+ }
310
+ }, [
311
+ f,
312
+ R,
313
+ a,
314
+ L
315
+ ]), W = m((e) => {
316
+ j(e);
317
+ }, []), G = m(() => {
318
+ j(null);
319
+ }, []);
320
+ return v(C, {
321
+ ref: n,
322
+ ...i,
323
+ sx: {
324
+ display: "flex",
325
+ flexDirection: "column",
326
+ width: "100%",
327
+ minWidth: 0,
328
+ flex: "1 1 auto",
329
+ minHeight: 0,
330
+ overflowX: "hidden",
331
+ overflowY: "auto",
332
+ boxSizing: "border-box",
333
+ gap: (e) => e.spacing(2),
334
+ paddingTop: (e) => e.spacing(1.5),
335
+ paddingBottom: (e) => e.spacing(1.5),
336
+ paddingLeft: (e) => e.spacing(2),
337
+ paddingRight: (e) => e.spacing(2)
338
+ },
339
+ children: [
340
+ v(C, {
341
+ sx: {
342
+ display: "flex",
343
+ flexDirection: "column",
344
+ minWidth: 0
345
+ },
346
+ children: [
347
+ _(E, {
348
+ control: _(O, {
349
+ checked: D,
350
+ onChange: (e) => {
351
+ H(e.target.checked);
352
+ }
353
+ }),
354
+ label: a("sheetProtection.protect")
355
+ }),
356
+ _(C, {
357
+ sx: {
358
+ display: "flex",
359
+ alignItems: "center",
360
+ minHeight: "38px"
361
+ },
362
+ children: _(w, {
363
+ size: "small",
364
+ variant: "outlined",
365
+ color: "inherit",
366
+ disabled: !D,
367
+ startIcon: _(c, {
368
+ iconKey: h ? "Lock" : "LockOpen",
369
+ size: 18,
370
+ ariaHidden: !0
371
+ }),
372
+ onClick: () => {
373
+ U();
374
+ },
375
+ sx: { textTransform: "none" },
376
+ children: a(h ? "sheetProtection.resume" : "sheetProtection.pause")
377
+ })
378
+ }),
379
+ h ? _(S, {
380
+ severity: "warning",
381
+ sx: {
382
+ marginTop: (e) => e.spacing(.5),
383
+ marginBottom: (e) => e.spacing(1)
384
+ },
385
+ children: a("sheetProtection.pausedBanner")
386
+ }) : null,
387
+ _(E, {
388
+ control: _(O, {
389
+ checked: p.isShowLockedShading(),
390
+ onChange: (e) => {
391
+ p.setShowLockedShading(e.target.checked);
392
+ }
393
+ }),
394
+ label: a("sheetProtection.highlightLocked")
395
+ })
396
+ ]
397
+ }),
398
+ _(t, {
399
+ label: a("sheetProtection.passwordHeading"),
400
+ description: a("sheetProtection.passwordDescription"),
401
+ hasPassword: D ? k : A !== null,
402
+ note: D || A === null ? void 0 : a("sheetProtection.passwordPending"),
403
+ disabled: D,
404
+ onSet: W,
405
+ onClear: G
406
+ }),
407
+ v(y, {
408
+ expanded: N,
409
+ onChange: (e, t) => P(t),
410
+ disableGutters: !0,
411
+ elevation: 0,
412
+ sx: {
413
+ backgroundColor: "action.hover",
414
+ border: 1,
415
+ borderColor: "divider",
416
+ borderRadius: 1,
417
+ "&:before": { display: "none" },
418
+ "&.Mui-expanded": { margin: 0 },
419
+ ...N ? {
420
+ flex: "1 1 auto",
421
+ minHeight: 0,
422
+ display: "flex",
423
+ flexDirection: "column",
424
+ "& .MuiCollapse-root": {
425
+ flex: "1 1 auto",
426
+ minHeight: 0,
427
+ display: "flex"
428
+ },
429
+ "& .MuiCollapse-wrapper": {
430
+ flex: "1 1 auto",
431
+ minHeight: 0,
432
+ display: "flex"
433
+ },
434
+ "& .MuiCollapse-wrapperInner": {
435
+ flex: "1 1 auto",
436
+ minHeight: 0,
437
+ display: "flex"
438
+ },
439
+ "& .MuiAccordion-region": {
440
+ flex: "1 1 auto",
441
+ minHeight: 0,
442
+ display: "flex",
443
+ flexDirection: "column"
444
+ },
445
+ "& .MuiAccordionDetails-root": {
446
+ flex: "1 1 auto",
447
+ minHeight: 0,
448
+ display: "flex",
449
+ flexDirection: "column"
450
+ }
451
+ } : { flex: "0 0 auto" }
452
+ },
453
+ children: [_(x, {
454
+ expandIcon: _(c, { iconKey: "ExpandMore" }),
455
+ sx: {
456
+ px: 2,
457
+ "& .MuiAccordionSummary-content": { my: 0 },
458
+ "&.Mui-expanded .MuiAccordionSummary-content": { my: 0 }
459
+ },
460
+ children: _(M, {
461
+ variant: "subtitle2",
462
+ sx: { alignSelf: "center" },
463
+ children: a("sheetProtection.optionsHeading")
464
+ })
465
+ }), v(b, {
466
+ sx: {
467
+ px: 2,
468
+ pt: 0,
469
+ pb: 2,
470
+ display: "flex",
471
+ flexDirection: "column"
472
+ },
473
+ children: [I ? _(M, {
474
+ variant: "caption",
475
+ sx: {
476
+ color: "text.secondary",
477
+ pb: 1
478
+ },
479
+ children: a("sheetProtection.optionsLocked")
480
+ }) : null, _(C, {
481
+ sx: {
482
+ display: "flex",
483
+ flexDirection: "column",
484
+ flex: "1 1 auto",
485
+ minHeight: 0,
486
+ overflowY: "auto"
487
+ },
488
+ children: z.map((e) => _(E, {
489
+ control: _(T, {
490
+ size: "small",
491
+ sx: {
492
+ paddingTop: .5,
493
+ paddingBottom: .5
494
+ },
495
+ disabled: I,
496
+ checked: !0 === F[e.key],
497
+ onChange: (t) => V(e.key, t.target.checked)
498
+ }),
499
+ label: _(M, {
500
+ variant: "body2",
501
+ children: a(e.messageKey)
502
+ })
503
+ }, e.key))
504
+ })]
505
+ })]
506
+ })
507
+ ]
508
+ });
509
+ }));
510
+ V.displayName = "WorksheetProtectionPanel";
511
+ var H = (e, t) => e === void 0 || e === t ? t : null, U = (e) => (e.rowEnd - e.rowStart + 1) * (e.colEnd - e.colStart + 1), W = p(f((e, t) => {
512
+ let { sheet: n, ...r } = e, a = d(), s = u(), [, c] = h((e) => e + 1, 0);
513
+ o(n, {
514
+ onSelectionChange: () => c(),
515
+ onStyleChange: () => c(),
516
+ onProtectionChange: () => c()
517
+ });
518
+ let f = n.getProtection().isLocked(), { alwaysUnlocked: p, showFormulas: g } = ((e) => {
519
+ let t, n, r = (e) => {
520
+ t = H(t, e.isAlwaysUnlocked()), n = H(n, e.isShowFormulas());
521
+ };
522
+ for (let t of e.getSelectedRanges().getCoords()) {
523
+ let n = 0;
524
+ for (let a of e.getRange(t).getRegions(i.Feature.Protection)) n += U(a.getCoords()), r(a.getCell().getProtection());
525
+ n < U(t) && r(e.getStyles().getNormal().getProtection());
526
+ }
527
+ return {
528
+ alwaysUnlocked: t ?? null,
529
+ showFormulas: n ?? null
530
+ };
531
+ })(n), y = m((e) => {
532
+ try {
533
+ e(n.getSelectedRanges().getStyle().getProtection());
534
+ } catch (e) {
535
+ s.showMessage?.(e?.message ?? String(e), { type: l.Error });
536
+ }
537
+ }, [n, s]);
538
+ return v(C, {
539
+ ref: t,
540
+ ...r,
541
+ sx: {
542
+ display: "flex",
543
+ flexDirection: "column",
544
+ width: "100%",
545
+ minWidth: 0,
546
+ flex: "1 1 auto",
547
+ minHeight: 0,
548
+ overflowX: "hidden",
549
+ overflowY: "auto",
550
+ boxSizing: "border-box",
551
+ gap: (e) => e.spacing(1),
552
+ paddingTop: (e) => e.spacing(1.5),
553
+ paddingBottom: (e) => e.spacing(1.5),
554
+ paddingLeft: (e) => e.spacing(2),
555
+ paddingRight: (e) => e.spacing(2)
556
+ },
557
+ children: [
558
+ _(M, {
559
+ variant: "body2",
560
+ sx: { color: "text.secondary" },
561
+ children: a("sheetProtection.cells.description")
562
+ }),
563
+ f ? _(M, {
564
+ variant: "caption",
565
+ sx: { color: "text.secondary" },
566
+ children: a("sheetProtection.cells.locked")
567
+ }) : null,
568
+ v(C, {
569
+ sx: {
570
+ display: "flex",
571
+ flexDirection: "column",
572
+ minWidth: 0
573
+ },
574
+ children: [_(E, {
575
+ control: _(T, {
576
+ size: "small",
577
+ sx: {
578
+ paddingTop: .5,
579
+ paddingBottom: .5
580
+ },
581
+ disabled: f,
582
+ checked: !0 === p,
583
+ indeterminate: p === null,
584
+ onChange: () => y((e) => e.setAlwaysUnlocked(!0 !== p))
585
+ }),
586
+ label: _(M, {
587
+ variant: "body2",
588
+ children: a("sheetProtection.cells.alwaysUnlocked")
589
+ })
590
+ }), _(E, {
591
+ control: _(T, {
592
+ size: "small",
593
+ sx: {
594
+ paddingTop: .5,
595
+ paddingBottom: .5
596
+ },
597
+ disabled: f,
598
+ checked: !0 === g,
599
+ indeterminate: g === null,
600
+ onChange: () => y((e) => e.setShowFormulas(!0 !== g))
601
+ }),
602
+ label: _(M, {
603
+ variant: "body2",
604
+ children: a("sheetProtection.cells.showFormulas")
605
+ })
606
+ })]
607
+ })
608
+ ]
609
+ });
610
+ }));
611
+ W.displayName = "ProtectedCellsPanel";
612
+ var G = p(f((e, n) => {
613
+ let { value: r, onEncryptPassword: i, onEncryptPasswordClear: a, onStructureChange: o, onStructurePassword: s, onStructurePasswordClear: c, onLocksChange: l, sx: u } = e, f = d();
614
+ return v(C, {
615
+ ref: n,
616
+ sx: {
617
+ display: "flex",
618
+ flexDirection: "column",
619
+ minWidth: 0,
620
+ gap: (e) => e.spacing(2.5),
621
+ ...u
622
+ },
623
+ children: [v(C, {
624
+ sx: {
625
+ display: "flex",
626
+ flexDirection: "column",
627
+ minWidth: 0,
628
+ gap: (e) => e.spacing(1)
629
+ },
630
+ children: [
631
+ _(E, {
632
+ control: _(T, {
633
+ checked: r.structure,
634
+ onChange: (e) => o(e.target.checked)
635
+ }),
636
+ label: f("protection.structure.label")
637
+ }),
638
+ _(C, {
639
+ sx: {
640
+ paddingLeft: 4,
641
+ minWidth: 0
642
+ },
643
+ children: _(t, {
644
+ hasPassword: r.hasStructurePassword,
645
+ description: f("protection.structure.passwordDescription"),
646
+ disabled: !r.structure,
647
+ requireCurrent: !0,
648
+ onSet: s,
649
+ onClear: c
650
+ })
651
+ }),
652
+ v(C, {
653
+ sx: {
654
+ display: "flex",
655
+ flexWrap: "wrap",
656
+ columnGap: (e) => e.spacing(2),
657
+ paddingLeft: 4,
658
+ minWidth: 0
659
+ },
660
+ children: [_(E, {
661
+ control: _(T, {
662
+ size: "small",
663
+ sx: {
664
+ paddingTop: .5,
665
+ paddingBottom: .5
666
+ },
667
+ disabled: !r.locksEditable,
668
+ checked: r.lockStructure,
669
+ onChange: (e) => l({
670
+ lockStructure: e.target.checked,
671
+ lockWindows: r.lockWindows
672
+ })
673
+ }),
674
+ label: f("protection.structure.lockStructure")
675
+ }), _(E, {
676
+ control: _(T, {
677
+ size: "small",
678
+ sx: {
679
+ paddingTop: .5,
680
+ paddingBottom: .5
681
+ },
682
+ disabled: !r.locksEditable,
683
+ checked: r.lockWindows,
684
+ onChange: (e) => l({
685
+ lockStructure: r.lockStructure,
686
+ lockWindows: e.target.checked
687
+ })
688
+ }),
689
+ label: f("protection.structure.lockWindows")
690
+ })]
691
+ }),
692
+ _(M, {
693
+ variant: "caption",
694
+ sx: {
695
+ minWidth: 0,
696
+ color: "text.secondary"
697
+ },
698
+ children: r.locksEditable ? f("protection.structure.note") : f("protection.structure.locksLocked")
699
+ })
700
+ ]
701
+ }), v(C, {
702
+ sx: {
703
+ display: "flex",
704
+ flexDirection: "column",
705
+ minWidth: 0,
706
+ gap: (e) => e.spacing(1)
707
+ },
708
+ children: [
709
+ _(M, {
710
+ variant: "body1",
711
+ sx: { minWidth: 0 },
712
+ children: f("protection.encrypt.label")
713
+ }),
714
+ _(t, {
715
+ hasPassword: r.hasEncryptPassword,
716
+ description: f("protection.encrypt.passwordDescription"),
717
+ onSet: i,
718
+ onClear: a
719
+ }),
720
+ _(M, {
721
+ variant: "caption",
722
+ sx: {
723
+ minWidth: 0,
724
+ color: "warning.main"
725
+ },
726
+ children: f("protection.encrypt.warning")
727
+ })
728
+ ]
729
+ })]
730
+ });
731
+ })), K = (e) => ({
732
+ structure: !e.lockStructure,
733
+ windows: !e.lockWindows
734
+ }), q = p(f((e, t) => {
735
+ let { workbook: n, ...r } = e, i = d(), a = u();
736
+ s(n, ["onProtectionChange", "onOriginChange"]);
737
+ let o = ((e) => {
738
+ let t = e.getOrigin(), n = e.getProtection(), r = n.isLocked(), i = r ? null : n.getProperties();
739
+ return {
740
+ hasEncryptPassword: t.isEncrypted(),
741
+ structure: r,
742
+ hasStructurePassword: n.hasPassword(),
743
+ lockStructure: r ? !n.isStructureAllowed() : !i || !0 !== i.structure,
744
+ lockWindows: r ? !n.isWindowsAllowed() : !!i && !0 !== i.windows,
745
+ locksEditable: !r
746
+ };
747
+ })(n), { lockStructure: c, lockWindows: f } = o, p = m((e) => {
748
+ a.showMessage?.(e?.message ?? String(e), { type: l.Error });
749
+ }, [a]), g = m(async () => {
750
+ if (!n.getProtection().hasPassword()) return;
751
+ let e = await a.showInput({
752
+ title: i("dialog.password.title"),
753
+ description: i("protection.structure.passwordPrompt"),
754
+ options: ["Ok", "Cancel"],
755
+ defaultOption: "Ok",
756
+ cancelOption: "Cancel",
757
+ inputType: "password"
758
+ });
759
+ return e?.option === "Ok" ? e.input || void 0 : null;
760
+ }, [
761
+ n,
762
+ a,
763
+ i
764
+ ]), [, v] = h((e) => e + 1, 0), y = m((e) => {
765
+ n.getOrigin().setPassword(e), v();
766
+ }, [n]), b = m(() => {
767
+ n.getOrigin().setPassword(null), v();
768
+ }, [n]), x = m(async (e) => {
769
+ let t = n.getProtection();
770
+ try {
771
+ if (!e) {
772
+ let e = await g();
773
+ if (e === null) return;
774
+ await t.unlock(e);
775
+ return;
776
+ }
777
+ await t.lock(K({
778
+ lockStructure: c,
779
+ lockWindows: f
780
+ }));
781
+ } catch (e) {
782
+ p(e);
783
+ }
784
+ }, [
785
+ n,
786
+ g,
787
+ c,
788
+ f,
789
+ p
790
+ ]), S = m(async (e) => {
791
+ try {
792
+ await n.getProtection().setProperties(K(e));
793
+ } catch (e) {
794
+ p(e);
795
+ }
796
+ }, [n, p]), w = m(async (e, t) => {
797
+ let r = n.getProtection();
798
+ try {
799
+ r.isLocked() && await r.unlock(t), await r.lock(K({
800
+ lockStructure: c,
801
+ lockWindows: f
802
+ }), e);
803
+ } catch (e) {
804
+ p(e);
805
+ }
806
+ }, [
807
+ n,
808
+ c,
809
+ f,
810
+ p
811
+ ]), T = m(async () => {
812
+ let e = n.getProtection();
813
+ try {
814
+ let t = await g();
815
+ if (t === null) return;
816
+ await e.unlock(t), await e.lock(K({
817
+ lockStructure: c,
818
+ lockWindows: f
819
+ }));
820
+ } catch (e) {
821
+ p(e);
822
+ }
823
+ }, [
824
+ n,
825
+ g,
826
+ c,
827
+ f,
828
+ p
829
+ ]);
830
+ return _(C, {
831
+ ref: t,
832
+ ...r,
833
+ sx: {
834
+ display: "flex",
835
+ flexDirection: "column",
836
+ width: "100%",
837
+ minWidth: 0,
838
+ flex: "1 1 auto",
839
+ minHeight: 0,
840
+ overflowX: "hidden",
841
+ overflowY: "auto",
842
+ boxSizing: "border-box",
843
+ gap: (e) => e.spacing(2),
844
+ paddingTop: (e) => e.spacing(1.5),
845
+ paddingBottom: (e) => e.spacing(1.5),
846
+ paddingLeft: (e) => e.spacing(2),
847
+ paddingRight: (e) => e.spacing(2)
848
+ },
849
+ children: _(G, {
850
+ value: o,
851
+ onEncryptPassword: y,
852
+ onEncryptPasswordClear: b,
853
+ onStructureChange: (e) => {
854
+ x(e);
855
+ },
856
+ onStructurePassword: (e, t) => {
857
+ w(e, t);
858
+ },
859
+ onStructurePasswordClear: () => {
860
+ T();
861
+ },
862
+ onLocksChange: (e) => {
863
+ S(e);
864
+ }
865
+ })
866
+ });
867
+ }));
868
+ q.displayName = "WorkbookProtectionTab";
869
+ var J = {
870
+ sheet: N("protection.tab.sheet"),
871
+ ranges: N("protection.tab.ranges"),
872
+ cells: N("protection.tab.cells"),
873
+ workbook: N("protection.tab.workbook")
874
+ }, Y = Object.keys(J), X = (e) => Y.includes(e) ? e : null, Z = p((e) => {
875
+ let { model: t, args: n, defaultTab: r = "sheet", entryKey: i, frame: a, ref: o, ...c } = e, l = d(), [u, f] = g(() => X(n?.tab) ?? r), [p, m] = g(n);
876
+ if (n !== p) {
877
+ m(n);
878
+ let e = X(n?.tab);
879
+ e && f(e);
880
+ }
881
+ s(t, ["onSelectedSheetChange"]);
882
+ let h = t?.getSelectedWorksheet() ?? null;
883
+ return t ? v(C, {
884
+ ref: o,
885
+ ...c,
886
+ sx: {
887
+ display: "flex",
888
+ flexDirection: "column",
889
+ width: "100%",
890
+ minWidth: 0,
891
+ flex: "1 1 auto",
892
+ height: "100%",
893
+ minHeight: 0,
894
+ overflowX: "hidden"
895
+ },
896
+ children: [_(A, {
897
+ value: u,
898
+ onChange: (e, t) => f(t),
899
+ variant: "fullWidth",
900
+ sx: {
901
+ width: "100%",
902
+ flex: "0 0 auto",
903
+ minHeight: "36px",
904
+ borderBottom: 1,
905
+ borderColor: "divider",
906
+ "& .MuiTab-root": {
907
+ minHeight: "36px",
908
+ textTransform: "none",
909
+ pt: .5,
910
+ pb: .5,
911
+ px: .5,
912
+ minWidth: 0
913
+ }
914
+ },
915
+ children: Y.map((e) => _(k, {
916
+ value: e,
917
+ label: l(J[e])
918
+ }, e))
919
+ }), v(C, {
920
+ sx: {
921
+ flex: "1 1 auto",
922
+ minHeight: 0,
923
+ minWidth: 0,
924
+ width: "100%",
925
+ display: "flex",
926
+ flexDirection: "column"
927
+ },
928
+ children: [
929
+ u === "sheet" && h ? _(V, {
930
+ sheet: h,
931
+ style: {
932
+ flex: "1 1 auto",
933
+ minHeight: 0,
934
+ minWidth: 0,
935
+ width: "100%"
936
+ }
937
+ }, h.getId()) : null,
938
+ u === "cells" && h ? _(W, {
939
+ sheet: h,
940
+ style: {
941
+ flex: "1 1 auto",
942
+ minHeight: 0,
943
+ minWidth: 0,
944
+ width: "100%"
945
+ }
946
+ }, h.getId()) : null,
947
+ u === "ranges" ? _(R, {
948
+ workbook: t,
949
+ args: n?.items,
950
+ style: {
951
+ flex: "1 1 auto",
952
+ minHeight: 0,
953
+ minWidth: 0,
954
+ width: "100%"
955
+ }
956
+ }) : null,
957
+ u === "workbook" ? _(q, {
958
+ workbook: t,
959
+ style: {
960
+ flex: "1 1 auto",
961
+ minHeight: 0,
962
+ minWidth: 0,
963
+ width: "100%"
964
+ }
965
+ }) : null
966
+ ]
967
+ })]
968
+ }) : null;
969
+ });
970
+ Z.displayName = "ManageProtectionTaskPane";
971
+ var Q = (e) => _(Z, {
972
+ ...e,
973
+ defaultTab: "ranges"
974
+ });
975
+ export { Z as ManageProtectionTaskPane, Z as default, Q as ProtectedRangeDetailsTaskPane };