@sheetxl/studio-mui 0.7.27 → 0.7.28-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.
Files changed (302) hide show
  1. package/README.md +2 -2
  2. package/browser/cjs/BQJKf40kttQWOzLw.cjs +20 -0
  3. package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +1 -0
  4. package/browser/cjs/B_D3JKseVvpRyX-E.cjs +1 -0
  5. package/browser/cjs/B_WyRpeiesnEiNP4.cjs +11 -0
  6. package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +2 -0
  7. package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +2 -0
  8. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
  9. package/browser/cjs/ByIEqNsvj52sihT9.cjs +5 -0
  10. package/browser/cjs/C3moehR3VOd0LnmM.cjs +1 -0
  11. package/browser/cjs/C97KHSuikAbr1qVM.cjs +1 -0
  12. package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +1 -0
  13. package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +1 -0
  14. package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +1 -0
  15. package/browser/cjs/CZm1jVZaHQ246prW.cjs +1 -0
  16. package/browser/cjs/CdDYyAfccXme8w6m.cjs +1 -0
  17. package/browser/cjs/DBJLJGiCGXesx5n6.cjs +1 -0
  18. package/browser/cjs/DLScL5AOXhHu9O9H.cjs +7 -0
  19. package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +1 -0
  20. package/browser/cjs/IASAYG6qgv7lJY7y.cjs +1 -0
  21. package/browser/cjs/KZvriGbhEOVkQD0b.cjs +1 -0
  22. package/browser/cjs/UnMhi28mbvLiOXQe.cjs +1 -0
  23. package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +1 -0
  24. package/browser/cjs/iMWEL01eC83oU-YY.cjs +1 -0
  25. package/browser/cjs/index.cjs +2 -7
  26. package/browser/cjs/w2GjebPlOFv3pCbm.cjs +1 -0
  27. package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +1 -0
  28. package/browser/esm/BFnJuOSao7TjbB-2.mjs +1150 -0
  29. package/browser/esm/BGngIqHYTFzsezh-.mjs +105 -0
  30. package/browser/esm/BH0fLaa4Vfda2U-T.mjs +155 -0
  31. package/browser/esm/BKadOi_4tf3UqilJ.mjs +8878 -0
  32. package/browser/esm/BNhUUeacBwGsPLBQ.mjs +42 -0
  33. package/browser/esm/BkP8c-zrLAqdNL5E.mjs +82 -0
  34. package/browser/esm/BlykPulAqes3JMee.mjs +1376 -0
  35. package/browser/esm/Bt_J_RX2M5EfualB.mjs +217 -0
  36. package/browser/esm/CIvpm_sHFmNjZQ7A.mjs +52 -0
  37. package/browser/esm/Cwku0NEsbyq9Q_RE.mjs +129 -0
  38. package/browser/esm/D4-E6nt8hrlNPIFy.mjs +5391 -0
  39. package/browser/esm/D5kzg7IfEtrExqiB.mjs +47 -0
  40. package/browser/esm/DLG0lDeb0t2L5dW4.mjs +468 -0
  41. package/browser/esm/DN5ACcUVdZeTSdLP.mjs +411 -0
  42. package/browser/esm/DP50mI7SOk1spPHv.mjs +516 -0
  43. package/browser/esm/DfZkO9tkYUlBUgXw.mjs +508 -0
  44. package/browser/esm/DhSHhyt16cHMvS_1.mjs +612 -0
  45. package/browser/esm/DxEzstNhMkJ0uzic.mjs +191 -0
  46. package/browser/esm/DxurARMNTQF7_rno.mjs +99 -0
  47. package/browser/esm/EK3JudzGAPbSIzUc.mjs +2207 -0
  48. package/browser/esm/Lds8JbV0rmFse8IO.mjs +113 -0
  49. package/browser/esm/gdfNDmwpOOPidxVx.mjs +20 -0
  50. package/browser/esm/gr4KpbaVpVfm8KOB.mjs +219 -0
  51. package/browser/esm/index.mjs +152 -91
  52. package/licenses/dependencies.txt +137 -627
  53. package/node/esm/-xXP4QK8hYGcJeug.mjs +509 -0
  54. package/node/esm/BVNe-px0vKah_sh2.mjs +516 -0
  55. package/node/esm/CLqRv2FWsGMrPoB0.mjs +47 -0
  56. package/node/esm/CSaiKMpmmQJY2xtl.mjs +113 -0
  57. package/node/esm/CTVMIjaQZQtJ05F8.mjs +129 -0
  58. package/node/esm/CWDr4rcpYux8bSQk.mjs +82 -0
  59. package/node/esm/CgDlduchq8t6DdhF.mjs +190 -0
  60. package/node/esm/Ck1Im-zWbwJqZNU1.mjs +470 -0
  61. package/node/esm/Ctakr7TocM8RykpC.mjs +679 -0
  62. package/node/esm/DMhU1sS3kX-Im83k.mjs +106 -0
  63. package/node/esm/Dh2MI-_NSwxjrRP8.mjs +99 -0
  64. package/node/esm/ED4g6Bsz9syAhAW3.mjs +155 -0
  65. package/node/esm/VuLRDpv46Yib6fpp.mjs +4536 -0
  66. package/node/esm/index.mjs +10603 -2832
  67. package/package.json +27 -27
  68. package/resources/contents.json +30 -0
  69. package/resources/locales/contents.json +44 -0
  70. package/resources/locales/de/groups.cmd.json +219 -0
  71. package/resources/locales/de/studio.cmd.json +159 -0
  72. package/resources/locales/de/ui.msg.json +507 -0
  73. package/resources/locales/en/groups.cmd.json +219 -0
  74. package/resources/locales/en/studio.cmd.json +159 -0
  75. package/resources/locales/en/ui.msg.json +508 -0
  76. package/types/index.d.ts +2 -1761
  77. package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +131 -0
  78. package/types/src/anchorItems/AnchorItemsPanel.d.ts +29 -0
  79. package/types/src/anchorItems/index.d.ts +3 -0
  80. package/types/src/border/BorderPopupButton.d.ts +30 -0
  81. package/types/src/border/BorderStylePopupButton.d.ts +40 -0
  82. package/types/src/border/index.d.ts +3 -0
  83. package/types/src/chart/command/InsertChartCommandButton.d.ts +10 -0
  84. package/types/src/chart/command/index.d.ts +2 -0
  85. package/types/src/color/Alpha.d.ts +36 -0
  86. package/types/src/color/Checkboard.d.ts +11 -0
  87. package/types/src/color/CheckboardUtils.d.ts +3 -0
  88. package/types/src/color/ColorButton.d.ts +21 -0
  89. package/types/src/color/ColorButtonList.d.ts +17 -0
  90. package/types/src/color/ColorPanel.d.ts +71 -0
  91. package/types/src/color/ColorPopupButton.d.ts +29 -0
  92. package/types/src/color/CustomColorPanel.d.ts +16 -0
  93. package/types/src/color/EditableInput.d.ts +22 -0
  94. package/types/src/color/Hue.d.ts +29 -0
  95. package/types/src/color/Saturation.d.ts +45 -0
  96. package/types/src/color/SketchFields.d.ts +9 -0
  97. package/types/src/color/Swatch.d.ts +16 -0
  98. package/types/src/color/Types.d.ts +11 -0
  99. package/types/src/color/_Utils.d.ts +4 -0
  100. package/types/src/color/index.d.ts +7 -0
  101. package/types/src/command/AccountingStyleCommandButton.d.ts +18 -0
  102. package/types/src/command/AppearanceCommandButton.d.ts +3 -0
  103. package/types/src/command/BorderCommandButton.d.ts +20 -0
  104. package/types/src/command/ColorCommandButton.d.ts +23 -0
  105. package/types/src/command/DocThemeCommandButton.d.ts +19 -0
  106. package/types/src/command/FileCommandButton.d.ts +8 -0
  107. package/types/src/command/FontFamilyCommandButton.d.ts +9 -0
  108. package/types/src/command/FontSizeCommandButton.d.ts +21 -0
  109. package/types/src/command/InsertFunctionCommandPopupButton.d.ts +9 -0
  110. package/types/src/command/InsertFunctionSumCommandPopupButton.d.ts +8 -0
  111. package/types/src/command/LanguageCommandButton.d.ts +19 -0
  112. package/types/src/command/LocaleCommandButton.d.ts +17 -0
  113. package/types/src/command/NumberFormatCommandButton.d.ts +6 -0
  114. package/types/src/command/PasteCommandButton.d.ts +14 -0
  115. package/types/src/command/PresetCellStylesCommandButton.d.ts +11 -0
  116. package/types/src/command/PresetTableStylesCommandButton.d.ts +12 -0
  117. package/types/src/command/RegisterCatalog.d.ts +3 -0
  118. package/types/src/command/SheetCommandGroups.d.ts +10 -0
  119. package/types/src/command/SheetZoomCommandButton.d.ts +9 -0
  120. package/types/src/command/StudioCommandGroups.d.ts +11 -0
  121. package/types/src/command/TextEffectsCommandButton.d.ts +6 -0
  122. package/types/src/command/TextRotateGroupButton.d.ts +14 -0
  123. package/types/src/command/UndoRedoCommandButton.d.ts +14 -0
  124. package/types/src/command/WalkingCopyCommandButton.d.ts +6 -0
  125. package/types/src/command/WorkbookCommandGroups.d.ts +11 -0
  126. package/types/src/command/index.d.ts +23 -0
  127. package/types/src/conditionalFormat/ColorScaleRulePanel.d.ts +18 -0
  128. package/types/src/conditionalFormat/ConditionalFormatDetailsPanel.d.ts +23 -0
  129. package/types/src/conditionalFormat/ConditionalFormatDetailsTaskPane.d.ts +4 -0
  130. package/types/src/conditionalFormat/ConditionalFormatEditorPanel.d.ts +20 -0
  131. package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts +2 -0
  132. package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +32 -0
  133. package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +34 -0
  134. package/types/src/conditionalFormat/ConditionalFormatTitle.d.ts +10 -0
  135. package/types/src/conditionalFormat/DataBarRulePanel.d.ts +23 -0
  136. package/types/src/conditionalFormat/IconSetRulePanel.d.ts +23 -0
  137. package/types/src/conditionalFormat/PresetChip.d.ts +30 -0
  138. package/types/src/conditionalFormat/PresetScalesCommandButton.d.ts +20 -0
  139. package/types/src/conditionalFormat/RulePreview.d.ts +23 -0
  140. package/types/src/conditionalFormat/RuleSection.d.ts +20 -0
  141. package/types/src/conditionalFormat/ScaleMiniGrid.d.ts +59 -0
  142. package/types/src/conditionalFormat/ScaleStopRow.d.ts +34 -0
  143. package/types/src/conditionalFormat/index.d.ts +3 -0
  144. package/types/src/conditionalFormat/previewColor.d.ts +50 -0
  145. package/types/src/conditions/AverageOption.d.ts +25 -0
  146. package/types/src/conditions/BetweenOption.d.ts +25 -0
  147. package/types/src/conditions/BooleanOption.d.ts +24 -0
  148. package/types/src/conditions/CombinatorOption.d.ts +41 -0
  149. package/types/src/conditions/ConditionEditor.d.ts +57 -0
  150. package/types/src/conditions/ConditionUtils.d.ts +83 -0
  151. package/types/src/conditions/DateTimeOption.d.ts +43 -0
  152. package/types/src/conditions/ExpressionOption.d.ts +26 -0
  153. package/types/src/conditions/InSetOption.d.ts +37 -0
  154. package/types/src/conditions/NumberOption.d.ts +24 -0
  155. package/types/src/conditions/OperatorAndParamEditor.d.ts +55 -0
  156. package/types/src/conditions/OperatorSelect.d.ts +35 -0
  157. package/types/src/conditions/OperatorSelectPopupButton.d.ts +39 -0
  158. package/types/src/conditions/ScalarOption.d.ts +29 -0
  159. package/types/src/conditions/SelectorSelect.d.ts +43 -0
  160. package/types/src/conditions/StringOption.d.ts +24 -0
  161. package/types/src/conditions/TimePeriodOption.d.ts +25 -0
  162. package/types/src/conditions/TopNOption.d.ts +25 -0
  163. package/types/src/conditions/index.d.ts +13 -0
  164. package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +16 -0
  165. package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -0
  166. package/types/src/dataValidation/DataValidationEditorPanel.d.ts +12 -0
  167. package/types/src/dataValidation/DataValidationPlugin.d.ts +2 -0
  168. package/types/src/dataValidation/index.d.ts +2 -0
  169. package/types/src/debug/DebugUtils.d.ts +4 -0
  170. package/types/src/debug/index.d.ts +2 -0
  171. package/types/src/dialog/CommentsDialog.d.ts +11 -0
  172. package/types/src/dialog/FindReplaceWindow.d.ts +13 -0
  173. package/types/src/dialog/HyperlinkDialog.d.ts +28 -0
  174. package/types/src/dialog/InsertFunctionDialog.d.ts +25 -0
  175. package/types/src/dialog/NamedReferenceDialog.d.ts +17 -0
  176. package/types/src/dialog/NumberFormatDialog.d.ts +12 -0
  177. package/types/src/dialog/ResizeHeaderDialog.d.ts +15 -0
  178. package/types/src/dialog/ShortcutKeysDialog.d.ts +9 -0
  179. package/types/src/dialog/ShortcutKeysPanel.d.ts +28 -0
  180. package/types/src/dialog/SortDialog.d.ts +9 -0
  181. package/types/src/dialog/TableNewDialog.d.ts +14 -0
  182. package/types/src/dialog/WorkbookStatisticsDialog.d.ts +13 -0
  183. package/types/src/dialog/index.d.ts +10 -0
  184. package/types/src/filter/ColumnMenu.d.ts +13 -0
  185. package/types/src/filter/FilterList.d.ts +28 -0
  186. package/types/src/filter/index.d.ts +3 -0
  187. package/types/src/form/FormulaField.d.ts +221 -0
  188. package/types/src/form/InputField.d.ts +89 -0
  189. package/types/src/form/index.d.ts +3 -0
  190. package/types/src/formulaBar/FormulaBar.d.ts +8 -0
  191. package/types/src/formulaBar/IFormulaBar.d.ts +51 -0
  192. package/types/src/formulaBar/index.d.ts +3 -0
  193. package/types/src/function/FunctionArgumentsPanel.d.ts +57 -0
  194. package/types/src/function/FunctionSearchPanel.d.ts +35 -0
  195. package/types/src/function/InsertFunctionWizard.d.ts +79 -0
  196. package/types/src/function/index.d.ts +4 -0
  197. package/types/src/function/paneMetrics.d.ts +33 -0
  198. package/types/src/index.d.ts +21 -0
  199. package/types/src/itemsPanel/EditorPanel.d.ts +21 -0
  200. package/types/src/itemsPanel/ItemCard.d.ts +57 -0
  201. package/types/src/itemsPanel/ItemsDescriptor.d.ts +215 -0
  202. package/types/src/itemsPanel/ItemsPanel.d.ts +45 -0
  203. package/types/src/itemsPanel/SortableCards.d.ts +67 -0
  204. package/types/src/itemsPanel/index.d.ts +6 -0
  205. package/types/src/movable/MovableContextMenu.d.ts +13 -0
  206. package/types/src/movable/index.d.ts +2 -0
  207. package/types/src/named/INamedCollectionEditor.d.ts +37 -0
  208. package/types/src/named/NamedCollectionEditor.d.ts +7 -0
  209. package/types/src/named/NamedDetailsPanel.d.ts +11 -0
  210. package/types/src/named/NamedDetailsTaskPane.d.ts +3 -0
  211. package/types/src/named/NamedDraft.d.ts +68 -0
  212. package/types/src/named/NamedEditorPanel.d.ts +19 -0
  213. package/types/src/named/NamedPlugin.d.ts +2 -0
  214. package/types/src/named/index.d.ts +8 -0
  215. package/types/src/numberFormat/NumberFormatPanel.d.ts +29 -0
  216. package/types/src/numberFormat/NumberFormatTaskPane.d.ts +12 -0
  217. package/types/src/numberFormat/index.d.ts +8 -0
  218. package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +20 -0
  219. package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +3 -0
  220. package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +27 -0
  221. package/types/src/protectedRange/ProtectedRangePlugin.d.ts +2 -0
  222. package/types/src/protectedRange/index.d.ts +2 -0
  223. package/types/src/protection/WorkbookProtectionDialog.d.ts +23 -0
  224. package/types/src/protection/WorkbookProtectionPanel.d.ts +51 -0
  225. package/types/src/protection/index.d.ts +3 -0
  226. package/types/src/sheet/SheetTabMenu.d.ts +21 -0
  227. package/types/src/sheet/SheetsAllMenu.d.ts +16 -0
  228. package/types/src/sheet/index.d.ts +3 -0
  229. package/types/src/statusBar/NumberStats.d.ts +27 -0
  230. package/types/src/statusBar/SheetZoomScale.d.ts +11 -0
  231. package/types/src/statusBar/StatusBar.d.ts +35 -0
  232. package/types/src/statusBar/index.d.ts +4 -0
  233. package/types/src/studio/CommandsWrapper.d.ts +36 -0
  234. package/types/src/studio/DefaultLogo.d.ts +3 -0
  235. package/types/src/studio/EagerStudio.d.ts +5 -0
  236. package/types/src/studio/Studio.d.ts +26 -0
  237. package/types/src/studio/StudioCommandProvider.d.ts +26 -0
  238. package/types/src/studio/StudioCommands.d.ts +115 -0
  239. package/types/src/studio/StudioNotifierProvider.d.ts +10 -0
  240. package/types/src/studio/StudioProps.d.ts +372 -0
  241. package/types/src/studio/StudioSplitPane.d.ts +60 -0
  242. package/types/src/studio/StudioTaskPaneArea.d.ts +8 -0
  243. package/types/src/studio/StudioToolbar.d.ts +37 -0
  244. package/types/src/studio/index.d.ts +4 -0
  245. package/types/src/studio/useStudioApp.d.ts +51 -0
  246. package/types/src/table/TableDetailsPanel.d.ts +17 -0
  247. package/types/src/table/TableDetailsTaskPane.d.ts +3 -0
  248. package/types/src/table/TablePlugin.d.ts +2 -0
  249. package/types/src/table/TableStyleCanvasPreview.d.ts +21 -0
  250. package/types/src/table/TableStyleOptionsPanel.d.ts +38 -0
  251. package/types/src/table/TableStylePreview.d.ts +43 -0
  252. package/types/src/table/index.d.ts +7 -0
  253. package/types/src/theme/ThemeSelectButton.d.ts +23 -0
  254. package/types/src/theme/ThemeSelectPanel.d.ts +17 -0
  255. package/types/src/theme/ThemeSelectPopupButton.d.ts +24 -0
  256. package/types/src/theme/ThemeUtils.d.ts +57 -0
  257. package/types/src/theme/index.d.ts +5 -0
  258. package/types/src/toast/ToastError.d.ts +10 -0
  259. package/types/src/toast/index.d.ts +2 -0
  260. package/types/src/toolbar/WorkbookToolbars.d.ts +46 -0
  261. package/types/src/toolbar/index.d.ts +2 -0
  262. package/types/src/workbook/DefaultRenderers.d.ts +23 -0
  263. package/types/src/workbook/DocumentTitle.d.ts +69 -0
  264. package/types/src/workbook/WorkbookContextMenu.d.ts +13 -0
  265. package/types/src/workbook/WorkbookElement.d.ts +12 -0
  266. package/types/src/workbook/WorkbookStrip.d.ts +37 -0
  267. package/types/src/workbook/index.d.ts +7 -0
  268. package/browser/cjs/0DtrpXkQQehBmvSv.cjs +0 -6
  269. package/browser/cjs/6C3ia2nz4Zm-AdMZ.cjs +0 -7
  270. package/browser/cjs/BR_EGEaHisRrXAtK.cjs +0 -6
  271. package/browser/cjs/B_v_M4TiavtofChs.cjs +0 -42
  272. package/browser/cjs/C17p-h_nw582H7WD.cjs +0 -20
  273. package/browser/cjs/CInmVysdoHEvvW9h.cjs +0 -6
  274. package/browser/cjs/CMvQZPQsE7MuTMy_.cjs +0 -6
  275. package/browser/cjs/CkNt54AXVfJjIWja.cjs +0 -6
  276. package/browser/cjs/CtRvyhDzQxsk7dkI.cjs +0 -6
  277. package/browser/cjs/DN9cQ4_4ERQvzKn6.cjs +0 -6
  278. package/browser/cjs/DUTuBWUNF-w3Fxtb.cjs +0 -6
  279. package/browser/cjs/pTzEs1wlZj5Bb6xc.cjs +0 -18
  280. package/browser/esm/8ZnwcsRrGO3Nlw9Y.mjs +0 -54
  281. package/browser/esm/BFZ4oCbQukelEVLI.mjs +0 -53
  282. package/browser/esm/BP3nTf4-SLftsj61.mjs +0 -640
  283. package/browser/esm/BSMkBkXBQgZhX1xk.mjs +0 -2159
  284. package/browser/esm/CPLIJbynjEkwF2T0.mjs +0 -4533
  285. package/browser/esm/CuC13VFjBYFE7kub.mjs +0 -155
  286. package/browser/esm/Cw3i8T1tVnm8o6eB.mjs +0 -46
  287. package/browser/esm/D6E8W2KK4dGVRQO_.mjs +0 -25
  288. package/browser/esm/D8xc3AM9QHEqmpb9.mjs +0 -50
  289. package/browser/esm/DA_bEpA5kkn89fmW.mjs +0 -2411
  290. package/browser/esm/DVqOr-7nEXA7IjKJ.mjs +0 -26
  291. package/browser/esm/VAUOzclLs-dR9nt_.mjs +0 -50
  292. package/node/assets/style.css +0 -1
  293. package/node/esm/B9dvpdCD_p2q8aNP.mjs +0 -156
  294. package/node/esm/BBxZemzbmUkoOYdq.mjs +0 -46
  295. package/node/esm/BDdkV45Cf7BLs5jE.mjs +0 -25
  296. package/node/esm/BoX8OuVRgUNgw0Wb.mjs +0 -91
  297. package/node/esm/CPbwVoL6mq66TtTR.mjs +0 -53
  298. package/node/esm/DMd6h1vz-USluank.mjs +0 -88
  299. package/node/esm/DYgtaT_soTbSP8M9.mjs +0 -52
  300. package/node/esm/DxDGSRoOYlWydiwL.mjs +0 -57
  301. package/node/esm/OMgXBbHk-VRNKAop.mjs +0 -26
  302. package/node/esm/bGXLfLFngllNb8U1.mjs +0 -50
@@ -0,0 +1,509 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.28-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 { ICell as e, IRange as n } from "@sheetxl/sdk";
8
+ import { CommandContext as t } from "@sheetxl/react";
9
+ import { DynamicIcon as i, KeyCodes as o, KeyModifiers as l, useCallbackRef as s, useTranslator as r } from "@sheetxl/utils-react";
10
+ import { memo as c, useEffect as a, useLayoutEffect as p, useMemo as d, useRef as u, useState as f } from "react";
11
+ import { ExhibitDivider as m, ExhibitOptionButton as x, InternalWindow as g } from "@sheetxl/utils-mui";
12
+ import { jsx as h, jsxs as O } from "react/jsx-runtime";
13
+ import { Box as y, Collapse as R, DialogContent as C, FormControl as b, InputAdornment as v, InputLabel as k, MenuItem as F, Select as w, TextField as S } from "@mui/material";
14
+ import { useMeasure as T } from "react-use";
15
+ var K = {
16
+ width: "1.5rem",
17
+ height: "1.5rem"
18
+ }, E = c((e) => {
19
+ const { label: n, value: t, options: i, onSelect: o, tabIndex: l = 0, ...r } = e, [c, p] = f(() => D(t, i));
20
+ a(() => {
21
+ p(D(t, i));
22
+ }, [t, i]);
23
+ const u = s((e) => {
24
+ const n = e.target.value;
25
+ p(n), o?.(i[n]);
26
+ }, [o, i]), m = d(() => Object.keys(i).map((e) => h(F, {
27
+ value: e,
28
+ children: e
29
+ }, e)), [i]);
30
+ return O(b, {
31
+ sx: { minWidth: 135 },
32
+ size: "small",
33
+ children: [h(k, { children: n }), h(w, {
34
+ inputProps: { tabIndex: l },
35
+ value: c,
36
+ label: n,
37
+ onChange: u,
38
+ ...r,
39
+ children: m
40
+ })]
41
+ });
42
+ }), A = {
43
+ enter: 140,
44
+ exit: 140
45
+ }, D = (e, n) => {
46
+ const t = Object.keys(n);
47
+ for (let i = 0; i < t.length; i++) {
48
+ const o = t[i];
49
+ if (n[o] === e) return o;
50
+ }
51
+ return "";
52
+ }, I = c((c) => {
53
+ const { initialValue: b, context: k, onInput: F, title: w, onHide: D, autoFocus: I, ...P } = c, V = r(), W = d(() => ({
54
+ [V("findReplace.fieldFormulas")]: e.Content.Formulas,
55
+ [V("findReplace.fieldValues")]: e.Content.Values,
56
+ [V("findReplace.fieldNotes")]: e.Content.Notes,
57
+ [V("findReplace.fieldComments")]: e.Content.Comments
58
+ }), [V]), z = d(() => {
59
+ const e = { ...W };
60
+ return delete e[V("findReplace.fieldValues")], e;
61
+ }, [W, V]), B = d(() => ({
62
+ [V("findReplace.byRows")]: !0,
63
+ [V("findReplace.byColumns")]: !1
64
+ }), [V]), L = d(() => ({
65
+ [V("findReplace.scopeWorkbook")]: t.FindScopeOptions.Workbook,
66
+ [V("findReplace.scopeSheet")]: t.FindScopeOptions.Sheet
67
+ }), [V]), M = b?.replace ?? !1, j = b?.findOptions, H = j?.text ?? null, N = b?.replaceOptions, $ = b?.replaceText ?? null, G = k?.(), U = u(null), q = u(null), J = u(null), Q = u(null), X = u(null), Y = u(null), Z = (e, n) => {
68
+ if (!n) return;
69
+ n.start(e, { center: !1 }), setTimeout(() => n.stop(e), 180);
70
+ }, [_, ee] = f(!1), [ne, te] = f(!1), [ie, oe] = f(M), [le, se] = f(!1), [re, ce] = f(!1), [ae, pe] = f({
71
+ replaceText: null,
72
+ replace: M,
73
+ replaceOptions: null,
74
+ findOptions: {
75
+ text: null,
76
+ matchCase: !1,
77
+ matchEntireCell: !1,
78
+ useRegex: !1,
79
+ axis: n.Axis.Row,
80
+ fields: [e.Content.Formulas]
81
+ },
82
+ scope: t.FindScopeOptions.Sheet
83
+ }), de = s(async (n, t, i, o) => {
84
+ if (!G) return;
85
+ const l = { ...ae };
86
+ l.replaceOptions = { ...l.replaceOptions }, l.findOptions = { ...l.findOptions }, l.replaceOptions.maxCount = i ? void 0 : 1, l.replace = t, t && ae.findOptions.fields?.[0] === e.Content.Values && (l.findOptions.fields = [e.Content.Formulas]), l.findOptions.reverse = !n;
87
+ const s = await G({
88
+ autoFocus: o,
89
+ ...l,
90
+ findOptions: {
91
+ ...l.findOptions,
92
+ text: l.findOptions.text ?? ""
93
+ }
94
+ });
95
+ se(0 === s);
96
+ }, [ae, G]);
97
+ a(() => {
98
+ se(!1);
99
+ }, [
100
+ ae,
101
+ ne,
102
+ ie
103
+ ]);
104
+ const ue = s((e, n) => {
105
+ if (e.keyCode === o.Enter) {
106
+ if (!ae.findOptions.text) return;
107
+ let t = !0, i = !1;
108
+ e.shiftKey && (t = !1), n ? (e.ctrlKey && e.altKey && (i = !0), Z(e, i ? Y.current : X.current)) : Z(e, t ? Q.current : J.current), de(t, n, i, !1);
109
+ }
110
+ }, [ae]), fe = u(null);
111
+ p(() => {
112
+ pe((n) => {
113
+ const t = { ...n };
114
+ t.findOptions.text = H && H.length > 0 ? H : n.findOptions.text ?? "", ee(!0), null !== $ && (t.replaceText = $ ?? ""), j && (t.findOptions = {
115
+ ...t.findOptions,
116
+ ...j
117
+ }), t.replaceText || (t.replaceText = ""), t.replaceOptions && (t.replaceOptions = { ...t.replaceOptions }), N && (t.replaceOptions = {
118
+ ...t.replaceOptions,
119
+ ...N
120
+ }), ae.findOptions.fields?.[0] || (ae.findOptions.fields = [e.Content.Formulas]);
121
+ const i = !(!M && !N && null === $);
122
+ return i && oe(i), t;
123
+ }), re || fe.current?.focus();
124
+ }, [
125
+ b,
126
+ M,
127
+ H,
128
+ $,
129
+ j,
130
+ N
131
+ ]), a(() => {
132
+ ie ? (ae.findOptions.fields, e.Content.Values) : ee(!0);
133
+ }, [ie]), a(() => {
134
+ if (_ && U.current && ae.findOptions.text === U.current.value) return U.current === document.activeElement || U.current.contains(document.activeElement) ? (U.current?.select(), void ee(!1)) : void U.current.addEventListener("focus", () => {
135
+ U.current?.select(), ee(!1);
136
+ }, { once: !0 });
137
+ }, [_, ae]);
138
+ const [me, { width: xe }] = T();
139
+ return h(g, {
140
+ ref: fe,
141
+ title: w ?? V(ie ? "findReplace.titleFindReplace" : "findReplace.titleFind"),
142
+ initialPosition: { y: "35" },
143
+ autoFocusSel: ".input",
144
+ onHide: D,
145
+ onFocus: () => ce(!0),
146
+ onBlur: () => {
147
+ ce(!1), se(!1);
148
+ },
149
+ slotProps: { paper: { elevation: re ? 3 : 1 } },
150
+ ...P,
151
+ children: O(C, {
152
+ dividers: !0,
153
+ ref: me,
154
+ sx: {
155
+ display: "flex",
156
+ flexDirection: "column",
157
+ paddingLeft: (e) => e.spacing(1.5),
158
+ paddingRight: (e) => e.spacing(1.5)
159
+ },
160
+ onKeyDown: (e) => {
161
+ if ("h" === e.key && e.ctrlKey) oe(!0), U.current?.contains(document.activeElement) && q.current?.focus();
162
+ else if ("f" === e.key && e.ctrlKey) U.current?.focus();
163
+ else if ("c" === e.key && e.altKey) pe((e) => {
164
+ const n = { ...e };
165
+ return n.findOptions.matchCase = !e.findOptions.matchCase, n;
166
+ });
167
+ else if ("e" === e.key && e.altKey) pe((e) => {
168
+ const n = { ...e };
169
+ return n.findOptions.matchEntireCell = !e.findOptions.matchEntireCell, n;
170
+ });
171
+ else {
172
+ if ("r" !== e.key || !e.altKey) return;
173
+ pe((e) => {
174
+ const n = { ...e };
175
+ return n.findOptions.useRegex = !e.findOptions.useRegex, n;
176
+ });
177
+ }
178
+ e.preventDefault();
179
+ },
180
+ children: [O(y, {
181
+ sx: {
182
+ display: "flex",
183
+ flexDirection: "row",
184
+ gap: (e) => e.spacing(1)
185
+ },
186
+ children: [O(y, {
187
+ sx: {
188
+ display: "flex",
189
+ flexDirection: "row",
190
+ alignItems: "start",
191
+ gap: (e) => e.spacing(.25),
192
+ paddingTop: "3px"
193
+ },
194
+ children: [h(x, {
195
+ selected: ne,
196
+ onSelectToggle: (e) => {
197
+ te(e);
198
+ },
199
+ preventFocus: !0,
200
+ label: V("findReplace.toggleOptions"),
201
+ icon: h(i, { iconKey: "FindOptions" })
202
+ }), h(x, {
203
+ selected: ie,
204
+ onSelectToggle: (e) => {
205
+ oe(e);
206
+ },
207
+ preventFocus: !0,
208
+ label: V("findReplace.toggleReplace"),
209
+ icon: h(i, { iconKey: "FindReplaceToggle" }),
210
+ shortcut: {
211
+ key: ie ? "F" : "H",
212
+ modifiers: [l.Ctrl]
213
+ }
214
+ })]
215
+ }), O(y, {
216
+ sx: {
217
+ display: "flex",
218
+ flexDirection: "column",
219
+ maxWidth: "100%",
220
+ boxSizing: "border-box"
221
+ },
222
+ children: [O(y, {
223
+ sx: {
224
+ display: "flex",
225
+ flexDirection: "row",
226
+ alignItems: "center"
227
+ },
228
+ children: [
229
+ h(S, {
230
+ label: V("findReplace.find"),
231
+ slotProps: {
232
+ input: {
233
+ sx: {
234
+ paddingRight: (e) => e.spacing(1),
235
+ minWidth: xe > 460 ? "20em" : void 0
236
+ },
237
+ endAdornment: h(v, {
238
+ position: "end",
239
+ children: O(y, {
240
+ sx: {
241
+ display: "flex",
242
+ alignItems: "center",
243
+ flexDirection: "row",
244
+ gap: "2px"
245
+ },
246
+ children: [
247
+ h(x, {
248
+ style: K,
249
+ selected: ae.findOptions.matchCase,
250
+ onBlur: () => {},
251
+ onSelectToggle: (e) => {
252
+ pe((n) => {
253
+ const t = { ...n };
254
+ return t.findOptions.matchCase = e, t;
255
+ });
256
+ },
257
+ label: V("findReplace.matchCase"),
258
+ shortcut: {
259
+ key: "C",
260
+ modifiers: [l.Alt]
261
+ },
262
+ icon: h(i, {
263
+ iconKey: "FindCaseSensitive",
264
+ size: "1rem"
265
+ })
266
+ }),
267
+ h(x, {
268
+ style: K,
269
+ selected: ae.findOptions.matchEntireCell,
270
+ onSelectToggle: (e) => {
271
+ pe((n) => {
272
+ const t = { ...n };
273
+ return t.findOptions.matchEntireCell = e, t;
274
+ });
275
+ },
276
+ label: V("findReplace.matchEntireCell"),
277
+ shortcut: {
278
+ key: "E",
279
+ modifiers: [l.Alt]
280
+ },
281
+ icon: h(i, {
282
+ iconKey: "FindWholeWord",
283
+ size: "1rem"
284
+ })
285
+ }),
286
+ h(x, {
287
+ style: K,
288
+ selected: ae.findOptions.useRegex,
289
+ onSelectToggle: (e) => {
290
+ pe((n) => {
291
+ const t = { ...n };
292
+ return t.findOptions.useRegex = e, t;
293
+ });
294
+ },
295
+ label: V("findReplace.useRegex"),
296
+ shortcut: {
297
+ key: "R",
298
+ modifiers: [l.Alt]
299
+ },
300
+ icon: h(i, {
301
+ iconKey: "FindRegEx",
302
+ size: "1rem"
303
+ })
304
+ })
305
+ ]
306
+ })
307
+ })
308
+ },
309
+ inputLabel: { shrink: !0 },
310
+ htmlInput: {
311
+ draggable: !1,
312
+ ref: U,
313
+ className: "input",
314
+ autoFocus: !0,
315
+ spellCheck: !1,
316
+ autoComplete: "off",
317
+ sx: {
318
+ paddingTop: (e) => e.spacing(1.25),
319
+ paddingBottom: (e) => e.spacing(.75)
320
+ }
321
+ }
322
+ },
323
+ sx: {
324
+ flex: "1 1 100%",
325
+ marginRight: (e) => e.spacing(1),
326
+ "& .MuiOutlinedInput-notchedOutline": { borderColor: (e) => le ? `${e.palette.error.main} !important` : void 0 },
327
+ "& .MuiInputLabel-outlined": { color: (e) => le ? `${e.palette.error.main} !important` : void 0 }
328
+ },
329
+ value: ae.findOptions.text ?? "",
330
+ onChange: (e) => {
331
+ pe((n) => {
332
+ const t = { ...n };
333
+ return t.findOptions.text = e.target.value, t;
334
+ });
335
+ },
336
+ onKeyDown: (e) => ue(e, !1),
337
+ onContextMenu: (e) => {
338
+ e.stopPropagation();
339
+ }
340
+ }),
341
+ h(x, {
342
+ selected: ae.findOptions.reverse,
343
+ onSelectToggle: (e) => {
344
+ de(!1, !1);
345
+ },
346
+ touchRippleRef: J,
347
+ label: "",
348
+ shortcut: {
349
+ key: "Enter",
350
+ modifiers: [l.Shift]
351
+ },
352
+ icon: h(i, { iconKey: ae.findOptions.axis !== n.Axis.Column ? "ArrowBack" : "ArrowUpward" }),
353
+ disabled: !ae.findOptions.text
354
+ }),
355
+ h(x, {
356
+ selected: !ae.findOptions.reverse,
357
+ onSelectToggle: (e) => {
358
+ de(!0, !1);
359
+ },
360
+ touchRippleRef: Q,
361
+ label: V("findReplace.nextMatch"),
362
+ shortcut: { key: "Enter" },
363
+ icon: h(i, { iconKey: ae.findOptions.axis !== n.Axis.Column ? "ArrowForward" : "ArrowDownward" }),
364
+ disabled: !ae.findOptions.text
365
+ })
366
+ ]
367
+ }), h(R, {
368
+ in: ie,
369
+ timeout: A,
370
+ onExit: () => {
371
+ U.current?.focus();
372
+ },
373
+ children: O(y, {
374
+ sx: {
375
+ display: "flex",
376
+ flexDirection: "row",
377
+ alignItems: "center",
378
+ marginTop: (e) => e.spacing(2)
379
+ },
380
+ children: [
381
+ h(S, {
382
+ label: V("findReplace.replace"),
383
+ slotProps: {
384
+ input: { sx: { paddingRight: (e) => e.spacing(1) } },
385
+ inputLabel: { shrink: !0 },
386
+ htmlInput: {
387
+ ref: q,
388
+ className: "input",
389
+ spellCheck: !1,
390
+ autoComplete: "off",
391
+ sx: {
392
+ paddingTop: (e) => e.spacing(1.25),
393
+ paddingBottom: (e) => e.spacing(.75)
394
+ }
395
+ }
396
+ },
397
+ sx: {
398
+ flex: "1 1 100%",
399
+ marginRight: (e) => e.spacing(1)
400
+ },
401
+ value: ae.replaceText ?? "",
402
+ onChange: (e) => {
403
+ pe((n) => {
404
+ const t = { ...n };
405
+ return t.replaceText = e.target.value, t;
406
+ });
407
+ },
408
+ onKeyDown: (e) => ue(e, !0),
409
+ onContextMenu: (e) => {
410
+ e.stopPropagation();
411
+ }
412
+ }),
413
+ h(x, {
414
+ onSelectToggle: (e) => {
415
+ de(!0, !0);
416
+ },
417
+ touchRippleRef: X,
418
+ label: V("findReplace.replace"),
419
+ shortcut: { key: "Enter" },
420
+ icon: h(i, { iconKey: "FindReplace" }),
421
+ disabled: !ae.findOptions.text
422
+ }),
423
+ h(x, {
424
+ onSelectToggle: (e) => {
425
+ de(!0, !0, !0);
426
+ },
427
+ touchRippleRef: Y,
428
+ label: V("findReplace.replaceAll"),
429
+ shortcut: {
430
+ key: "Enter",
431
+ modifiers: [l.Ctrl, l.Alt]
432
+ },
433
+ icon: h(i, { iconKey: "FindReplaceAll" }),
434
+ disabled: !ae.findOptions.text
435
+ })
436
+ ]
437
+ })
438
+ })]
439
+ })]
440
+ }), h(R, {
441
+ in: ne,
442
+ timeout: A,
443
+ onExit: () => {
444
+ U.current?.focus();
445
+ },
446
+ children: O(y, {
447
+ sx: {
448
+ minHeight: "10px",
449
+ flex: "1 1 100%",
450
+ display: "flex",
451
+ flexDirection: "column",
452
+ gap: (e) => e.spacing(1.5),
453
+ marginTop: (e) => e.spacing(1)
454
+ },
455
+ children: [h(m, {
456
+ orientation: "horizontal",
457
+ sx: { marginBottom: (e) => e.spacing(1.5) }
458
+ }), O(y, {
459
+ sx: {
460
+ display: "flex",
461
+ flexDirection: xe >= 383 ? "row" : "column",
462
+ justifyContent: "space-evenly",
463
+ alignItems: "center",
464
+ gap: (e) => e.spacing(1),
465
+ rowGap: (e) => e.spacing(2)
466
+ },
467
+ tabIndex: -1,
468
+ children: [
469
+ h(E, {
470
+ label: V("findReplace.within"),
471
+ value: ae.scope,
472
+ options: L,
473
+ onSelect: (e) => {
474
+ pe((n) => {
475
+ const t = { ...n };
476
+ return t.scope = e, t;
477
+ });
478
+ }
479
+ }),
480
+ h(E, {
481
+ label: V("findReplace.searchOrder"),
482
+ value: ae.findOptions.axis !== n.Axis.Column,
483
+ options: B,
484
+ onSelect: (e) => {
485
+ pe((t) => {
486
+ const i = { ...t };
487
+ return i.findOptions.axis = e ? n.Axis.Row : n.Axis.Column, i;
488
+ });
489
+ }
490
+ }),
491
+ h(E, {
492
+ label: V("findReplace.lookIn"),
493
+ value: ie && ae.findOptions.fields?.[0] === e.Content.Values ? e.Content.Formulas : ae.findOptions.fields?.[0],
494
+ options: ie ? z : W,
495
+ onSelect: (e) => {
496
+ pe((n) => {
497
+ const t = { ...n };
498
+ return t.findOptions.fields = [e], t;
499
+ });
500
+ }
501
+ })
502
+ ]
503
+ })]
504
+ })
505
+ })]
506
+ })
507
+ });
508
+ });
509
+ export { I as FindReplaceWindow, I as default };