@sheetxl/studio-mui 0.7.26 → 0.7.28-beta.1
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/B_WyRpeiesnEiNP4.cjs +11 -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/DBJLJGiCGXesx5n6.cjs +1 -0
- package/browser/cjs/DLScL5AOXhHu9O9H.cjs +7 -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/0EONOhVZ7oT0C_G2.mjs +1150 -0
- package/browser/esm/5x7evORpymnb5SfW.mjs +129 -0
- package/browser/esm/BACBR1jjcpJbhOWA.mjs +191 -0
- package/browser/esm/BPZne8WpzrkWOH6L.mjs +47 -0
- package/browser/esm/BeKa8xVj69hAVKRN.mjs +155 -0
- package/browser/esm/BeQ9bqOvNNP-arFP.mjs +219 -0
- package/browser/esm/Bf3PIOM6U-NmWk2O.mjs +20 -0
- package/browser/esm/C4BPDYeqgN59wMGp.mjs +411 -0
- package/browser/esm/CGbn_xdhgTvk2mvb.mjs +612 -0
- package/browser/esm/CKADOp3hTx0MSNY7.mjs +52 -0
- package/browser/esm/CR2sUEZyRqVv2SNl.mjs +105 -0
- package/browser/esm/CTN8J8c1AneJu3Lu.mjs +2207 -0
- package/browser/esm/Cc5akPEmIwbgKIfc.mjs +516 -0
- package/browser/esm/CePKCTL6D05kDy2E.mjs +82 -0
- package/browser/esm/DBM1blcMTZMAM-eR.mjs +217 -0
- package/browser/esm/DPBnKqhSuJ414Pxx.mjs +99 -0
- package/browser/esm/F51tGfYHocox80zY.mjs +468 -0
- package/browser/esm/SDzKpaiuhQux7tAh.mjs +5391 -0
- package/browser/esm/TDH9XceS8cAkO5d3.mjs +508 -0
- package/browser/esm/XKVlG-x_9q5dbVIW.mjs +8878 -0
- package/browser/esm/fJiwyUQJ18X-cCQz.mjs +1376 -0
- package/browser/esm/fel6EbPAcZOsBmks.mjs +42 -0
- package/browser/esm/flvjZEXrSDrtDzLB.mjs +113 -0
- package/browser/esm/index.mjs +152 -91
- package/licenses/dependencies.txt +137 -627
- package/node/esm/B9-0usA1hSoD0Nk3.mjs +679 -0
- package/node/esm/BO1vNzjGWYdZdbq9.mjs +113 -0
- package/node/esm/BYigefA8bf9FOVib.mjs +47 -0
- package/node/esm/BdrLZp98HQaVMykZ.mjs +82 -0
- package/node/esm/BlubX7gm8wTUNiZ-.mjs +106 -0
- package/node/esm/C8a6QwMGW1tMiWA6.mjs +516 -0
- package/node/esm/CCCnorMn30oUDDIY.mjs +4536 -0
- package/node/esm/CKpik3HRSANKEy4G.mjs +99 -0
- package/node/esm/CTZcfST8pUcLMail.mjs +509 -0
- package/node/esm/D1K9Ji7iQwnOnd1-.mjs +190 -0
- package/node/esm/DuUiuB59bQRPQi-D.mjs +155 -0
- package/node/esm/eKP73GEWmonTXpfv.mjs +470 -0
- package/node/esm/g3y8kxL1Ln214UNr.mjs +129 -0
- package/node/esm/index.mjs +10603 -2832
- 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 -1761
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +131 -0
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +29 -0
- package/types/src/anchorItems/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +30 -0
- package/types/src/border/BorderStylePopupButton.d.ts +40 -0
- package/types/src/border/index.d.ts +3 -0
- package/types/src/chart/command/InsertChartCommandButton.d.ts +10 -0
- package/types/src/chart/command/index.d.ts +2 -0
- package/types/src/color/Alpha.d.ts +36 -0
- package/types/src/color/Checkboard.d.ts +11 -0
- package/types/src/color/CheckboardUtils.d.ts +3 -0
- package/types/src/color/ColorButton.d.ts +21 -0
- package/types/src/color/ColorButtonList.d.ts +17 -0
- package/types/src/color/ColorPanel.d.ts +71 -0
- package/types/src/color/ColorPopupButton.d.ts +29 -0
- package/types/src/color/CustomColorPanel.d.ts +16 -0
- package/types/src/color/EditableInput.d.ts +22 -0
- package/types/src/color/Hue.d.ts +29 -0
- package/types/src/color/Saturation.d.ts +45 -0
- package/types/src/color/SketchFields.d.ts +9 -0
- package/types/src/color/Swatch.d.ts +16 -0
- package/types/src/color/Types.d.ts +11 -0
- package/types/src/color/_Utils.d.ts +4 -0
- package/types/src/color/index.d.ts +7 -0
- package/types/src/command/AccountingStyleCommandButton.d.ts +18 -0
- package/types/src/command/AppearanceCommandButton.d.ts +3 -0
- package/types/src/command/BorderCommandButton.d.ts +20 -0
- package/types/src/command/ColorCommandButton.d.ts +23 -0
- package/types/src/command/DocThemeCommandButton.d.ts +19 -0
- package/types/src/command/FileCommandButton.d.ts +8 -0
- package/types/src/command/FontFamilyCommandButton.d.ts +9 -0
- package/types/src/command/FontSizeCommandButton.d.ts +21 -0
- package/types/src/command/InsertFunctionCommandPopupButton.d.ts +9 -0
- package/types/src/command/InsertFunctionSumCommandPopupButton.d.ts +8 -0
- package/types/src/command/LanguageCommandButton.d.ts +19 -0
- package/types/src/command/LocaleCommandButton.d.ts +17 -0
- package/types/src/command/NumberFormatCommandButton.d.ts +6 -0
- package/types/src/command/PasteCommandButton.d.ts +14 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts +11 -0
- package/types/src/command/PresetTableStylesCommandButton.d.ts +12 -0
- package/types/src/command/RegisterCatalog.d.ts +3 -0
- package/types/src/command/SheetCommandGroups.d.ts +10 -0
- package/types/src/command/SheetZoomCommandButton.d.ts +9 -0
- package/types/src/command/StudioCommandGroups.d.ts +11 -0
- package/types/src/command/TextEffectsCommandButton.d.ts +6 -0
- package/types/src/command/TextRotateGroupButton.d.ts +14 -0
- package/types/src/command/UndoRedoCommandButton.d.ts +14 -0
- package/types/src/command/WalkingCopyCommandButton.d.ts +6 -0
- package/types/src/command/WorkbookCommandGroups.d.ts +11 -0
- package/types/src/command/index.d.ts +23 -0
- package/types/src/conditionalFormat/ColorScaleRulePanel.d.ts +18 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsPanel.d.ts +23 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsTaskPane.d.ts +4 -0
- package/types/src/conditionalFormat/ConditionalFormatEditorPanel.d.ts +20 -0
- package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts +2 -0
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +32 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +34 -0
- package/types/src/conditionalFormat/ConditionalFormatTitle.d.ts +10 -0
- package/types/src/conditionalFormat/DataBarRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/PresetChip.d.ts +30 -0
- package/types/src/conditionalFormat/PresetScalesCommandButton.d.ts +20 -0
- package/types/src/conditionalFormat/RulePreview.d.ts +23 -0
- package/types/src/conditionalFormat/RuleSection.d.ts +20 -0
- package/types/src/conditionalFormat/ScaleMiniGrid.d.ts +59 -0
- package/types/src/conditionalFormat/ScaleStopRow.d.ts +34 -0
- package/types/src/conditionalFormat/index.d.ts +3 -0
- package/types/src/conditionalFormat/previewColor.d.ts +50 -0
- package/types/src/conditions/AverageOption.d.ts +25 -0
- package/types/src/conditions/BetweenOption.d.ts +25 -0
- package/types/src/conditions/BooleanOption.d.ts +24 -0
- package/types/src/conditions/CombinatorOption.d.ts +41 -0
- package/types/src/conditions/ConditionEditor.d.ts +57 -0
- package/types/src/conditions/ConditionUtils.d.ts +83 -0
- package/types/src/conditions/DateTimeOption.d.ts +43 -0
- package/types/src/conditions/ExpressionOption.d.ts +26 -0
- package/types/src/conditions/InSetOption.d.ts +37 -0
- package/types/src/conditions/NumberOption.d.ts +24 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +55 -0
- package/types/src/conditions/OperatorSelect.d.ts +35 -0
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +39 -0
- package/types/src/conditions/ScalarOption.d.ts +29 -0
- package/types/src/conditions/SelectorSelect.d.ts +43 -0
- package/types/src/conditions/StringOption.d.ts +24 -0
- package/types/src/conditions/TimePeriodOption.d.ts +25 -0
- package/types/src/conditions/TopNOption.d.ts +25 -0
- package/types/src/conditions/index.d.ts +13 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +16 -0
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -0
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +12 -0
- package/types/src/dataValidation/DataValidationPlugin.d.ts +2 -0
- package/types/src/dataValidation/index.d.ts +2 -0
- package/types/src/debug/DebugUtils.d.ts +4 -0
- package/types/src/debug/index.d.ts +2 -0
- package/types/src/dialog/CommentsDialog.d.ts +11 -0
- package/types/src/dialog/FindReplaceWindow.d.ts +13 -0
- package/types/src/dialog/HyperlinkDialog.d.ts +28 -0
- package/types/src/dialog/InsertFunctionDialog.d.ts +25 -0
- package/types/src/dialog/NamedReferenceDialog.d.ts +17 -0
- package/types/src/dialog/NumberFormatDialog.d.ts +12 -0
- package/types/src/dialog/ResizeHeaderDialog.d.ts +15 -0
- package/types/src/dialog/ShortcutKeysDialog.d.ts +9 -0
- package/types/src/dialog/ShortcutKeysPanel.d.ts +28 -0
- package/types/src/dialog/SortDialog.d.ts +9 -0
- package/types/src/dialog/TableNewDialog.d.ts +14 -0
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +13 -0
- package/types/src/dialog/index.d.ts +10 -0
- package/types/src/filter/ColumnMenu.d.ts +13 -0
- package/types/src/filter/FilterList.d.ts +28 -0
- package/types/src/filter/index.d.ts +3 -0
- package/types/src/form/FormulaField.d.ts +221 -0
- package/types/src/form/InputField.d.ts +89 -0
- package/types/src/form/index.d.ts +3 -0
- package/types/src/formulaBar/FormulaBar.d.ts +8 -0
- package/types/src/formulaBar/IFormulaBar.d.ts +51 -0
- package/types/src/formulaBar/index.d.ts +3 -0
- package/types/src/function/FunctionArgumentsPanel.d.ts +57 -0
- package/types/src/function/FunctionSearchPanel.d.ts +35 -0
- package/types/src/function/InsertFunctionWizard.d.ts +79 -0
- package/types/src/function/index.d.ts +4 -0
- package/types/src/function/paneMetrics.d.ts +33 -0
- package/types/src/index.d.ts +21 -0
- package/types/src/itemsPanel/EditorPanel.d.ts +21 -0
- package/types/src/itemsPanel/ItemCard.d.ts +57 -0
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +215 -0
- package/types/src/itemsPanel/ItemsPanel.d.ts +45 -0
- package/types/src/itemsPanel/SortableCards.d.ts +67 -0
- package/types/src/itemsPanel/index.d.ts +6 -0
- package/types/src/movable/MovableContextMenu.d.ts +13 -0
- package/types/src/movable/index.d.ts +2 -0
- package/types/src/named/INamedCollectionEditor.d.ts +37 -0
- package/types/src/named/NamedCollectionEditor.d.ts +7 -0
- package/types/src/named/NamedDetailsPanel.d.ts +11 -0
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -0
- package/types/src/named/NamedDraft.d.ts +68 -0
- package/types/src/named/NamedEditorPanel.d.ts +19 -0
- package/types/src/named/NamedPlugin.d.ts +2 -0
- package/types/src/named/index.d.ts +8 -0
- package/types/src/numberFormat/NumberFormatPanel.d.ts +29 -0
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +12 -0
- package/types/src/numberFormat/index.d.ts +8 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +20 -0
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +3 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +27 -0
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +2 -0
- package/types/src/protectedRange/index.d.ts +2 -0
- package/types/src/protection/WorkbookProtectionDialog.d.ts +23 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +51 -0
- package/types/src/protection/index.d.ts +3 -0
- package/types/src/sheet/SheetTabMenu.d.ts +21 -0
- package/types/src/sheet/SheetsAllMenu.d.ts +16 -0
- package/types/src/sheet/index.d.ts +3 -0
- package/types/src/statusBar/NumberStats.d.ts +27 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +11 -0
- package/types/src/statusBar/StatusBar.d.ts +35 -0
- package/types/src/statusBar/index.d.ts +4 -0
- package/types/src/studio/CommandsWrapper.d.ts +36 -0
- package/types/src/studio/DefaultLogo.d.ts +3 -0
- package/types/src/studio/EagerStudio.d.ts +5 -0
- package/types/src/studio/Studio.d.ts +26 -0
- package/types/src/studio/StudioCommandProvider.d.ts +26 -0
- package/types/src/studio/StudioCommands.d.ts +115 -0
- package/types/src/studio/StudioNotifierProvider.d.ts +10 -0
- package/types/src/studio/StudioProps.d.ts +372 -0
- package/types/src/studio/StudioSplitPane.d.ts +60 -0
- package/types/src/studio/StudioTaskPaneArea.d.ts +8 -0
- package/types/src/studio/StudioToolbar.d.ts +37 -0
- package/types/src/studio/index.d.ts +4 -0
- package/types/src/studio/useStudioApp.d.ts +51 -0
- package/types/src/table/TableDetailsPanel.d.ts +17 -0
- package/types/src/table/TableDetailsTaskPane.d.ts +3 -0
- package/types/src/table/TablePlugin.d.ts +2 -0
- package/types/src/table/TableStyleCanvasPreview.d.ts +21 -0
- package/types/src/table/TableStyleOptionsPanel.d.ts +38 -0
- package/types/src/table/TableStylePreview.d.ts +43 -0
- package/types/src/table/index.d.ts +7 -0
- package/types/src/theme/ThemeSelectButton.d.ts +23 -0
- package/types/src/theme/ThemeSelectPanel.d.ts +17 -0
- package/types/src/theme/ThemeSelectPopupButton.d.ts +24 -0
- package/types/src/theme/ThemeUtils.d.ts +57 -0
- package/types/src/theme/index.d.ts +5 -0
- package/types/src/toast/ToastError.d.ts +10 -0
- package/types/src/toast/index.d.ts +2 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts +46 -0
- package/types/src/toolbar/index.d.ts +2 -0
- package/types/src/workbook/DefaultRenderers.d.ts +23 -0
- package/types/src/workbook/DocumentTitle.d.ts +69 -0
- package/types/src/workbook/WorkbookContextMenu.d.ts +13 -0
- package/types/src/workbook/WorkbookElement.d.ts +12 -0
- package/types/src/workbook/WorkbookStrip.d.ts +37 -0
- package/types/src/workbook/index.d.ts +7 -0
- package/browser/cjs/52tjAlO48FpZgfzG.cjs +0 -6
- package/browser/cjs/BGu2_YqVJMQjYx4D.cjs +0 -18
- package/browser/cjs/C83Rzj_Jwq-o69wr.cjs +0 -42
- package/browser/cjs/CldYLQnjFC_g8o3t.cjs +0 -6
- package/browser/cjs/Cpv3j_Ra1h-axLRG.cjs +0 -6
- package/browser/cjs/D-5Cg1Y0zALF_JEs.cjs +0 -7
- package/browser/cjs/D58sOTRZwQ59CgOf.cjs +0 -6
- package/browser/cjs/DEd-0xEuUoELRnQb.cjs +0 -6
- package/browser/cjs/DahKlfm68zudpndW.cjs +0 -20
- package/browser/cjs/Dd7t0gfO3bzS0-B8.cjs +0 -6
- package/browser/cjs/DxAU6DV3UCUDVoSH.cjs +0 -6
- package/browser/cjs/uj7GSwDaUyTKEjrN.cjs +0 -6
- package/browser/esm/BLuR1D2n--9QSJL9.mjs +0 -26
- package/browser/esm/BSOhdb74viwmCi54.mjs +0 -2159
- package/browser/esm/BTAhrEfV-DH0-Ldk.mjs +0 -640
- package/browser/esm/BgsyX5QL9OLy0DN3.mjs +0 -4533
- package/browser/esm/CFPGs5_tLGrpkW8L.mjs +0 -25
- package/browser/esm/CbCX3t0hx-h6pV7Q.mjs +0 -46
- package/browser/esm/D3dDP89ml0258MGb.mjs +0 -53
- package/browser/esm/DYk55y6IEOCytW3g.mjs +0 -50
- package/browser/esm/DfUqOxFfhJcaq847.mjs +0 -2411
- package/browser/esm/DhWeeZyxUc-LbP8E.mjs +0 -50
- package/browser/esm/DqLDLUCqiFovdBf0.mjs +0 -155
- package/browser/esm/Dvo0k3olgFuAso_O.mjs +0 -54
- package/node/assets/style.css +0 -1
- package/node/esm/BM_pvbGlgXydGNT3.mjs +0 -52
- package/node/esm/CFBcwLP2q2_EUXvE.mjs +0 -156
- package/node/esm/Cg9JFB8nOnVfR0Uo.mjs +0 -26
- package/node/esm/D3kxA1LpG-PpZvCb.mjs +0 -25
- package/node/esm/D_s6w_GWb8l7uGW3.mjs +0 -53
- package/node/esm/XI3nj4zD7mXOyxSm.mjs +0 -57
- package/node/esm/YXQgUYqP1qsi_MPX.mjs +0 -46
- package/node/esm/m2lejeU-ViEhFj_N.mjs +0 -91
- package/node/esm/sevERUPIPJCb-jYL.mjs +0 -88
- package/node/esm/zdjaq7yEfEvgHrDi.mjs +0 -50
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.26
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),c=require("@mui/material/styles"),m=require("@mui/material"),f=require("@sheetxl/utils-react"),P=require("@sheetxl/utils-mui"),A=["Ok","Cancel"],b=l.memo(k=>{const{initialValue:v=null,onInput:x,context:F,onOption:h,onValidateOption:u,onDone:p,options:C=A,defaultOption:g=C?.[0],cancelOption:d="Cancel",sx:T,...q}=k,O=l.useMemo(()=>{const e=v??F?.()?.getComments();let t="";if(e&&e.content&&e.content.runs){const o=e.content.runs;for(let a=0;a<o.length;a++){const i=o[a];t+=i?.text}}return t},[]),[n,j]=l.useState(O),[w,D]=l.useState(!1),y=l.useCallback(async(e,t)=>null,[]),S=f.useCallbackRef(async e=>{const t=n===""?[]:n.split(`
|
|
7
|
-
`),o=e===d;if(!o){const a=t.length,i=new Array(a);for(let s=0;s<a;s++)i[s]={text:t[s]};x?.({content:{runs:i}})}h?.(e,o,e===g),p?.()},[n,x,p,h,g,d]),I=f.useCallbackRef(e=>{j(e.target.value),y(e.target.value,null)},[u]),M=f.useCallbackRef(async e=>{let t=await Promise.resolve(u?.(e));try{t!==!1&&(t=await y(n,e))}catch{}return t??!0},[u,n]);return r.jsx(P.OptionsDialog,{title:(O?"Edit":"Insert")+" Comments",options:C,onDone:p,onOption:e=>S(e),onValidateOption:M,defaultOption:g,cancelOption:d,autoFocusSel:".autoFocus",sx:{width:"480px",...T},...q,children:r.jsx(m.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:r.jsx(m.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:r.jsx(m.TextField,{label:"Comments",placeholder:"Enter a comment.",onFocus:e=>{w||e.target?.select(),D(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${c.alpha("#fff",c.getOverlayAlpha(5))}, ${c.alpha("#fff",c.getOverlayAlpha(5))})`}}},value:n,onChange:I,onContextMenu:e=>{e.stopPropagation()}})})})})});exports.CommentsDialog=b,exports.default=b;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.26
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),o=require("@mui/material/styles"),i=require("@mui/material"),S=require("@sheetxl/sdk"),u=require("@sheetxl/utils-react"),U=require("@sheetxl/utils-mui"),A=["Autofit","Ok","Cancel"],v=s.memo(j=>{const{initialValue:k,context:l,onOption:y,onValidateOption:p,onInput:C,onDone:d,options:b=A,defaultOption:c=b?.[1],cancelOption:g="Cancel",sx:z,...P}=j,T=s.useMemo(()=>l?.().getOrientation()===S.IRange.Orientation.Column,[l]),[n,O]=s.useState(k),[w,R]=s.useState(!1),x=s.useCallback(async(e,t)=>!0,[]),f=s.useMemo(()=>{if(!l().toUnits)return null;let e=n?.size??0,t="Px";return n.unit==="Px"?(e=l().toUnits?.(e),t=l().getUnitText()):(e=l().toPixels?.(e),t="Px"),{size:e,unit:t}},[n?.unit,n?.size]),m=u.useCallbackRef(async e=>{const t=e===g;t||C?.(n,e),y?.(e,t,e===c),d?.()},[n,C,d,y,g,c]),F=u.useCallbackRef(async e=>{e.keyCode===u.KeyCodes.Enter&&await x?.(n,null)!==!1&&m(c)},[n,m]),I=u.useCallbackRef(async e=>{let t=await Promise.resolve(p?.(e));try{t!==!1&&(t=await Promise.resolve(x?.(n,e))??!0)}catch{}return t??!0},[p]),M=u.useCallbackRef(e=>{const t={...n,size:Number(e.target.value)};O(t),x?.(t,null)},[n,p]),q=u.useCallbackRef(e=>{const t=e.target.value,r={...n,unit:t};O(r)},[n]),D=s.useMemo(()=>{const e=l().getUnitText(),t=h=>a.jsx(i.MenuItem,{value:h,children:h},h),r=[];return r.push(t("Px")),r.push(t(e)),r},[]);return a.jsx(U.OptionsDialog,{title:"Resize "+(T?"Columns":"Rows"),options:b,onDone:d,onOption:e=>m(e),onValidateOption:I,defaultOption:c,cancelOption:g,autoFocusSel:".autoFocus",sx:{width:"380px",...z},...P,children:a.jsxs(i.Box,{sx:{paddingTop:e=>e.spacing(0),paddingBottom:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[a.jsxs(i.Box,{sx:{rowGap:e=>e.spacing(1),display:"flex",flexDirection:"row",gap:e=>e.spacing(.5),alignItems:"end",justifyContent:"center"},children:[a.jsx(i.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:a.jsx(i.TextField,{label:"Size",onFocus:e=>{w||e.target?.select(),R(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:"autoFocus",spellCheck:!1,autoComplete:"off",type:"number",inputMode:"numeric",pattern:"[0-9]*",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${o.alpha("#fff",o.getOverlayAlpha(5))}, ${o.alpha("#fff",o.getOverlayAlpha(5))})`}}},value:n.size,onChange:M,onKeyDown:F,onContextMenu:e=>{e.stopPropagation()}})}),a.jsxs(i.FormControl,{sx:{minWidth:85},size:"small",children:[a.jsx(i.InputLabel,{children:"Unit"}),a.jsx(i.Select,{value:n.unit,label:"Unit",onChange:q,sx:{backgroundImage:`linear-gradient(${o.alpha("#fff",o.getOverlayAlpha(5))}, ${o.alpha("#fff",o.getOverlayAlpha(5))})`},children:D})]})]}),f&&a.jsx(i.Box,{children:a.jsxs(i.Typography,{variant:"body2",component:"div",sx:{paddingLeft:e=>e.spacing(2)},children:[f.size," ",f.unit]})})]})})});exports.ResizeHeaderDialog=v,exports.default=v;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.26
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/function I(t){return Array.isArray?Array.isArray(t):ne(t)==="[object Array]"}function v(t){return typeof t=="string"}function te(t){return typeof t=="number"}function ae(t){return t===!0||t===!1||(function(e){return ie(e)&&e!==null})(t)&&ne(t)=="[object Boolean]"}function ie(t){return typeof t=="object"}function F(t){return t!=null}function K(t){return!t.trim().length}function ne(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=Object.prototype.hasOwnProperty;class le{constructor(e){this._keys=[],this._keyMap={};let i=0;e.forEach(n=>{let s=se(n);this._keys.push(s),this._keyMap[s.id]=s,i+=s.weight}),this._keys.forEach(n=>{n.weight/=i})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function se(t){let e=null,i=null,n=null,s=1,c=null;if(v(t)||I(t))n=t,e=H(t),i=q(t);else{if(!G.call(t,"name"))throw new Error((o=>`Missing ${o} property in key`)("name"));const u=t.name;if(n=u,G.call(t,"weight")&&(s=t.weight,s<=0))throw new Error((o=>`Property 'weight' in key '${o}' must be a positive integer`)(u));e=H(u),i=q(u),c=t.getFn}return{path:e,id:i,weight:s,src:n,getFn:c}}function H(t){return I(t)?t:t.split(".")}function q(t){return I(t)?t.join("."):t}var l={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(t,e){let i=[],n=!1;const s=(c,u,o)=>{if(F(c))if(u[o]){const r=c[u[o]];if(!F(r))return;if(o===u.length-1&&(v(r)||te(r)||ae(r)))i.push((function(a){return a==null?"":(function(h){if(typeof h=="string")return h;let g=h+"";return g=="0"&&1/h==-1/0?"-0":g})(a)})(r));else if(I(r)){n=!0;for(let a=0,h=r.length;a<h;a+=1)s(r[a],u,o+1)}else u.length&&s(r,u,o+1)}else i.push(c)};return s(t,v(e)?e.split("."):e,0),n?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};const de=/[^ ]+/g;class T{constructor({getFn:e=l.getFn,fieldNormWeight:i=l.fieldNormWeight}={}){this.norm=(function(n=1,s=3){const c=new Map,u=Math.pow(10,s);return{get(o){const r=o.match(de).length;if(c.has(r))return c.get(r);const a=1/Math.pow(r,.5*n),h=parseFloat(Math.round(a*u)/u);return c.set(r,h),h},clear(){c.clear()}}})(i,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((i,n)=>{this._keysMap[i.id]=n})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,v(this.docs[0])?this.docs.forEach((e,i)=>{this._addString(e,i)}):this.docs.forEach((e,i)=>{this._addObject(e,i)}),this.norm.clear())}add(e){const i=this.size();v(e)?this._addString(e,i):this._addObject(e,i)}removeAt(e){this.records.splice(e,1);for(let i=e,n=this.size();i<n;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(e,i){return e[this._keysMap[i]]}size(){return this.records.length}_addString(e,i){if(!F(e)||K(e))return;let n={v:e,i,n:this.norm.get(e)};this.records.push(n)}_addObject(e,i){let n={i,$:{}};this.keys.forEach((s,c)=>{let u=s.getFn?s.getFn(e):this.getFn(e,s.path);if(F(u)){if(I(u)){let o=[];const r=[{nestedArrIndex:-1,value:u}];for(;r.length;){const{nestedArrIndex:a,value:h}=r.pop();if(F(h))if(v(h)&&!K(h)){let g={v:h,i:a,n:this.norm.get(h)};o.push(g)}else I(h)&&h.forEach((g,d)=>{r.push({nestedArrIndex:d,value:g})})}n.$[c]=o}else if(v(u)&&!K(u)){let o={v:u,n:this.norm.get(u)};n.$[c]=o}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function re(t,e,{getFn:i=l.getFn,fieldNormWeight:n=l.fieldNormWeight}={}){const s=new T({getFn:i,fieldNormWeight:n});return s.setKeys(t.map(se)),s.setSources(e),s.create(),s}function W(t,{errors:e=0,currentLocation:i=0,expectedLocation:n=0,distance:s=l.distance,ignoreLocation:c=l.ignoreLocation}={}){const u=e/t.length;if(c)return u;const o=Math.abs(n-i);return s?u+o/s:o?1:u}const b=32;function ge(t,e,i,{location:n=l.location,distance:s=l.distance,threshold:c=l.threshold,findAllMatches:u=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,includeMatches:r=l.includeMatches,ignoreLocation:a=l.ignoreLocation}={}){if(e.length>b)throw new Error(`Pattern length exceeds max of ${b}.`);const h=e.length,g=t.length,d=Math.max(0,Math.min(n,g));let f=c,A=d;const C=o>1||r,p=C?Array(g):[];let E;for(;(E=t.indexOf(e,A))>-1;){let D=W(e,{currentLocation:E,expectedLocation:d,distance:s,ignoreLocation:a});if(f=Math.min(D,f),A=E+h,C){let B=0;for(;B<h;)p[E+B]=1,B+=1}}A=-1;let y=[],k=1,M=h+g;const $=1<<h-1;for(let D=0;D<h;D+=1){let B=0,L=M;for(;B<L;)W(e,{errors:D,currentLocation:d+L,expectedLocation:d,distance:s,ignoreLocation:a})<=f?B=L:M=L,L=Math.floor((M-B)/2+B);M=L;let N=Math.max(1,d-L+1),x=u?g:Math.min(d+L,g)+h,_=Array(x+2);_[x+1]=(1<<D)-1;for(let m=x;m>=N;m-=1){let R=m-1,j=i[t.charAt(R)];if(C&&(p[R]=+!!j),_[m]=(_[m+1]<<1|1)&j,D&&(_[m]|=(y[m+1]|y[m])<<1|1|y[m+1]),_[m]&$&&(k=W(e,{errors:D,currentLocation:R,expectedLocation:d,distance:s,ignoreLocation:a}),k<=f)){if(f=k,A=R,A<=d)break;N=Math.max(1,2*d-A)}}if(W(e,{errors:D+1,currentLocation:d,expectedLocation:d,distance:s,ignoreLocation:a})>f)break;y=_}const S={isMatch:A>=0,score:Math.max(.001,k)};if(C){const D=(function(B=[],L=l.minMatchCharLength){let N=[],x=-1,_=-1,m=0;for(let R=B.length;m<R;m+=1){let j=B[m];j&&x===-1?x=m:j||x===-1||(_=m-1,_-x+1>=L&&N.push([x,_]),x=-1)}return B[m-1]&&m-x>=L&&N.push([x,m-1]),N})(p,o);D.length?r&&(S.indices=D):S.isMatch=!1}return S}function fe(t){let e={};for(let i=0,n=t.length;i<n;i+=1){const s=t.charAt(i);e[s]=(e[s]||0)|1<<n-i-1}return e}const z=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):t=>t;class ue{constructor(e,{location:i=l.location,threshold:n=l.threshold,distance:s=l.distance,includeMatches:c=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,isCaseSensitive:r=l.isCaseSensitive,ignoreDiacritics:a=l.ignoreDiacritics,ignoreLocation:h=l.ignoreLocation}={}){if(this.options={location:i,threshold:n,distance:s,includeMatches:c,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:r,ignoreDiacritics:a,ignoreLocation:h},e=r?e:e.toLowerCase(),e=a?z(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(f,A)=>{this.chunks.push({pattern:f,alphabet:fe(f),startIndex:A})},d=this.pattern.length;if(d>b){let f=0;const A=d%b,C=d-A;for(;f<C;)g(this.pattern.substr(f,b),f),f+=b;if(A){const p=d-b;g(this.pattern.substr(p),p)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:i,ignoreDiacritics:n,includeMatches:s}=this.options;if(e=i?e:e.toLowerCase(),e=n?z(e):e,this.pattern===e){let C={isMatch:!0,score:0};return s&&(C.indices=[[0,e.length-1]]),C}const{location:c,distance:u,threshold:o,findAllMatches:r,minMatchCharLength:a,ignoreLocation:h}=this.options;let g=[],d=0,f=!1;this.chunks.forEach(({pattern:C,alphabet:p,startIndex:E})=>{const{isMatch:y,score:k,indices:M}=ge(e,C,p,{location:c+E,distance:u,threshold:o,findAllMatches:r,minMatchCharLength:a,includeMatches:s,ignoreLocation:h});y&&(f=!0),d+=k,y&&M&&(g=[...g,...M])});let A={isMatch:f,score:f?d/this.chunks.length:1};return f&&s&&(A.indices=g),A}}class w{constructor(e){this.pattern=e}static isMultiMatch(e){return X(e,this.multiRegex)}static isSingleMatch(e){return X(e,this.singleRegex)}search(){}}function X(t,e){const i=t.match(e);return i?i[1]:null}class ce extends w{constructor(e,{location:i=l.location,threshold:n=l.threshold,distance:s=l.distance,includeMatches:c=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,isCaseSensitive:r=l.isCaseSensitive,ignoreDiacritics:a=l.ignoreDiacritics,ignoreLocation:h=l.ignoreLocation}={}){super(e),this._bitapSearch=new ue(e,{location:i,threshold:n,distance:s,includeMatches:c,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:r,ignoreDiacritics:a,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class oe extends w{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let i,n=0;const s=[],c=this.pattern.length;for(;(i=e.indexOf(this.pattern,n))>-1;)n=i+c,s.push([i,n-1]);const u=!!s.length;return{isMatch:u,score:u?0:1,indices:s}}}const J=[class extends w{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},oe,class extends w{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=t.indexOf(this.pattern)===-1;return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},ce],Y=J.length,Ae=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,pe=new Set([ce.type,oe.type]);class Ce{constructor(e,{isCaseSensitive:i=l.isCaseSensitive,ignoreDiacritics:n=l.ignoreDiacritics,includeMatches:s=l.includeMatches,minMatchCharLength:c=l.minMatchCharLength,ignoreLocation:u=l.ignoreLocation,findAllMatches:o=l.findAllMatches,location:r=l.location,threshold:a=l.threshold,distance:h=l.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:c,findAllMatches:o,ignoreLocation:u,location:r,threshold:a,distance:h},e=i?e:e.toLowerCase(),e=n?z(e):e,this.pattern=e,this.query=(function(g,d={}){return g.split("|").map(f=>{let A=f.trim().split(Ae).filter(p=>p&&!!p.trim()),C=[];for(let p=0,E=A.length;p<E;p+=1){const y=A[p];let k=!1,M=-1;for(;!k&&++M<Y;){const $=J[M];let S=$.isMultiMatch(y);S&&(C.push(new $(S,d)),k=!0)}if(!k)for(M=-1;++M<Y;){const $=J[M];let S=$.isSingleMatch(y);if(S){C.push(new $(S,d));break}}}return C})})(this.pattern,this.options)}static condition(e,i){return i.useExtendedSearch}searchIn(e){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:c}=this.options;e=s?e:e.toLowerCase(),e=c?z(e):e;let u=0,o=[],r=0;for(let a=0,h=i.length;a<h;a+=1){const g=i[a];o.length=0,u=0;for(let d=0,f=g.length;d<f;d+=1){const A=g[d],{isMatch:C,indices:p,score:E}=A.search(e);if(!C){r=0,u=0,o.length=0;break}if(u+=1,r+=E,n){const y=A.constructor.type;pe.has(y)?o=[...o,...p]:o.push(p)}}if(u){let d={isMatch:!0,score:r/u};return n&&(d.indices=o),d}}return{isMatch:!1,score:1}}}const V=[];function Q(t,e){for(let i=0,n=V.length;i<n;i+=1){let s=V[i];if(s.condition(t,e))return new s(t,e)}return new ue(t,e)}const U="$and",me="$or",Z="$path",Me="$val",P=t=>!(!t[U]&&!t[me]),ee=t=>({[U]:Object.keys(t).map(e=>({[e]:t[e]}))});function he(t,e,{auto:i=!0}={}){const n=s=>{let c=Object.keys(s);const u=(r=>!!r[Z])(s);if(!u&&c.length>1&&!P(s))return n(ee(s));if((r=>!I(r)&&ie(r)&&!P(r))(s)){const r=u?s[Z]:c[0],a=u?s[Me]:s[r];if(!v(a))throw new Error((g=>`Invalid value for key ${g}`)(r));const h={keyId:q(r),pattern:a};return i&&(h.searcher=Q(a,e)),h}let o={children:[],operator:c[0]};return c.forEach(r=>{const a=s[r];I(a)&&a.forEach(h=>{o.children.push(n(h))})}),o};return P(t)||(t=ee(t)),n(t)}function Fe(t,e){const i=t.matches;e.matches=[],F(i)&&i.forEach(n=>{if(!F(n.indices)||!n.indices.length)return;const{indices:s,value:c}=n;let u={indices:s,value:c};n.key&&(u.key=n.key.src),n.idx>-1&&(u.refIndex=n.idx),e.matches.push(u)})}function Ee(t,e){e.score=t.score}class O{constructor(e,i={},n){this.options={...l,...i},this.options.useExtendedSearch,this._keyStore=new le(this.options.keys),this.setCollection(e,n)}setCollection(e,i){if(this._docs=e,i&&!(i instanceof T))throw new Error("Incorrect 'index' type");this._myIndex=i||re(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){F(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const i=[];for(let n=0,s=this._docs.length;n<s;n+=1){const c=this._docs[n];e(c,n)&&(this.removeAt(n),n-=1,s-=1,i.push(c))}return i}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:i=-1}={}){const{includeMatches:n,includeScore:s,shouldSort:c,sortFn:u,ignoreFieldNorm:o}=this.options;let r=v(e)?v(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return(function(a,{ignoreFieldNorm:h=l.ignoreFieldNorm}){a.forEach(g=>{let d=1;g.matches.forEach(({key:f,norm:A,score:C})=>{const p=f?f.weight:null;d*=Math.pow(C===0&&p?Number.EPSILON:C,(p||1)*(h?1:A))}),g.score=d})})(r,{ignoreFieldNorm:o}),c&&r.sort(u),te(i)&&i>-1&&(r=r.slice(0,i)),(function(a,h,{includeMatches:g=l.includeMatches,includeScore:d=l.includeScore}={}){const f=[];return g&&f.push(Fe),d&&f.push(Ee),a.map(A=>{const{idx:C}=A,p={item:h[C],refIndex:C};return f.length&&f.forEach(E=>{E(A,p)}),p})})(r,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(e){const i=Q(e,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:c,i:u,n:o})=>{if(!F(c))return;const{isMatch:r,score:a,indices:h}=i.searchIn(c);r&&s.push({item:c,idx:u,matches:[{score:a,value:c,norm:o,indices:h}]})}),s}_searchLogical(e){const i=he(e,this.options),n=(o,r,a)=>{if(!o.children){const{keyId:g,searcher:d}=o,f=this._findMatches({key:this._keyStore.get(g),value:this._myIndex.getValueForItemAtKeyId(r,g),searcher:d});return f&&f.length?[{idx:a,item:r,matches:f}]:[]}const h=[];for(let g=0,d=o.children.length;g<d;g+=1){const f=o.children[g],A=n(f,r,a);if(A.length)h.push(...A);else if(o.operator===U)return[]}return h},s=this._myIndex.records,c={},u=[];return s.forEach(({$:o,i:r})=>{if(F(o)){let a=n(i,o,r);a.length&&(c[r]||(c[r]={idx:r,item:o,matches:[]},u.push(c[r])),a.forEach(({matches:h})=>{c[r].matches.push(...h)}))}}),u}_searchObjectList(e){const i=Q(e,this.options),{keys:n,records:s}=this._myIndex,c=[];return s.forEach(({$:u,i:o})=>{if(!F(u))return;let r=[];n.forEach((a,h)=>{r.push(...this._findMatches({key:a,value:u[h],searcher:i}))}),r.length&&c.push({idx:o,item:u,matches:r})}),c}_findMatches({key:e,value:i,searcher:n}){if(!F(i))return[];let s=[];if(I(i))i.forEach(({v:c,i:u,n:o})=>{if(!F(c))return;const{isMatch:r,score:a,indices:h}=n.searchIn(c);r&&s.push({score:a,key:e,value:c,idx:u,norm:o,indices:h})});else{const{v:c,n:u}=i,{isMatch:o,score:r,indices:a}=n.searchIn(c);o&&s.push({score:r,key:e,value:c,norm:u,indices:a})}return s}}O.version="7.1.0",O.createIndex=re,O.parseIndex=function(t,{getFn:e=l.getFn,fieldNormWeight:i=l.fieldNormWeight}={}){const{keys:n,records:s}=t,c=new T({getFn:e,fieldNormWeight:i});return c.setKeys(n),c.setIndexRecords(s),c},O.config=l,O.parseQuery=he,(function(...t){V.push(...t)})(Ce),exports.default=O;
|