@sheetxl/studio-mui 0.8.0-beta.1 → 0.8.0-beta.11
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/browser/esm/0BWO0bLZ8Vm_dKd2.mjs +582 -0
- package/browser/esm/BAbq4-I5f5oUiNaF.mjs +141 -0
- package/browser/esm/BED6h6YAwCf1HEQJ.mjs +161 -0
- package/browser/esm/{DMLXV4EKl1NCp_jk.mjs → BXhNFzyEGokTF-BL.mjs} +2 -2
- package/browser/esm/BYE9gCDWKyx6mnVs.mjs +381 -0
- package/browser/esm/BjvD_4t2KGsZP5V8.mjs +71 -0
- package/browser/esm/{zWTZ8BvT4hjgC2ua.mjs → BknfGJouygmnpFIU.mjs} +13 -12
- package/browser/esm/{DNDrQKMTzKzNMjl-.mjs → BlE_8o8tO2AgAlaj.mjs} +19 -17
- package/browser/esm/BokqKEpU6TFgfRs6.mjs +252 -0
- package/browser/esm/{BoLxSRdEWt-Yg2RI.mjs → Brsh5yscJ_4uKFXp.mjs} +130 -103
- package/browser/esm/Bujtz_Guj88d03vI.mjs +831 -0
- package/browser/esm/Buqcl7J75MJrhpVE.mjs +1379 -0
- package/browser/esm/BvhYPwX3GrRaO9CM.mjs +319 -0
- package/browser/esm/C0wlMAIn9iREPK6w.mjs +87 -0
- package/browser/esm/C8JU4KsMasmLvojI.mjs +103 -0
- package/browser/esm/C9pIZVACtl9unFOp.mjs +77 -0
- package/browser/esm/CBD4RiRKbbZtSXV-.mjs +318 -0
- package/browser/esm/CEtXsBzEjEKk9GOj.mjs +117 -0
- package/browser/esm/{BZBJG2tDdD3-VujP.mjs → COlZu93LRwuBvjE-.mjs} +195 -174
- package/browser/esm/{Cj2pgCNqBCGl4rTX.mjs → CTjqDD-swFMZzI-Y.mjs} +587 -556
- package/browser/esm/CWkOgdL7mOKiTR62.mjs +975 -0
- package/browser/esm/ChSVxkPTIjgcC8PL.mjs +412 -0
- package/browser/esm/{Cd6n1XUgF0VItpkH.mjs → ClBvNPeNCAhuVWrG.mjs} +7 -5
- package/browser/esm/CyLn6zOOp_biA3xU.mjs +335 -0
- package/browser/esm/CynTY0oNtyJnoaBq.mjs +14 -0
- package/browser/esm/D3rRUK4dIM5gUSmj.mjs +256 -0
- package/browser/esm/D9ISy7VkaRRFJl46.mjs +515 -0
- package/browser/esm/DDc6rDuU9JAo1DH_.mjs +225 -0
- package/browser/esm/DDczwkXhz_MHub4z.mjs +197 -0
- package/browser/esm/{3ydDykDMtDYbfVVn.mjs → DEv4pIEgYr5C7etm.mjs} +178 -129
- package/browser/esm/DG21x7RKDpge6zAE.mjs +31 -0
- package/browser/esm/DJOOed_OtB-XT7f3.mjs +437 -0
- package/browser/esm/{Bz5LiUe3SZ8g42Ia.mjs → DKtJxrpN0axtuQ0l.mjs} +1 -1
- package/browser/esm/DRSCS6aLiYmPjUz1.mjs +1543 -0
- package/browser/esm/{ChwS_ougBsogOEsP.mjs → DTpRkgsTm_zYnWfW.mjs} +46 -47
- package/browser/esm/DV6i9RQZfJiKtEaJ.mjs +2552 -0
- package/browser/esm/DdcZrjMLWVukWcU5.mjs +7473 -0
- package/browser/esm/Di3BUxA0SqFWWgeg.mjs +94 -0
- package/browser/esm/DnGaP5F7mLwCGUYG.mjs +408 -0
- package/browser/esm/DpD4fg2WcyiKX_2K.mjs +414 -0
- package/browser/esm/{BUGepznywvV0tUjW.mjs → Ds3XRkne7HxcXD8J.mjs} +2 -2
- package/browser/esm/DsoNMWDwHZP8UXQd.mjs +293 -0
- package/browser/esm/G0Inqm6Eqw47dMpa.mjs +212 -0
- package/browser/esm/HViD4Wfoi0mmqk9w.mjs +13 -0
- package/browser/esm/LZoYSQAYV2wksnDv.mjs +386 -0
- package/browser/esm/{rU8xNPVQtDSnujM-.mjs → QgaAIDUMmBQBsXP9.mjs} +3 -3
- package/browser/esm/YThnrg3PadGs7B4j.mjs +627 -0
- package/browser/esm/index.mjs +1208 -67
- package/browser/esm/ttjcNHcFn8O6hfnd.mjs +1288 -0
- package/browser/esm/w_JrR69vEpvoyeMy.mjs +68 -0
- package/browser/esm/{CVfuCNRpODUw04IH.mjs → xFqkfN8QMCxvsetB.mjs} +1 -1
- package/browser/esm/zqilJefihVd7At2T.mjs +517 -0
- package/licenses/dependencies.txt +96 -349
- package/node/esm/1bf4gn-2vld4BZ9u.mjs +294 -0
- package/node/esm/{BhqI3pQFkV8K_612.mjs → 3WghtBXAvCDwcVrq.mjs} +1 -1
- package/node/esm/4HmLH0bPVJCZLgik.mjs +116 -0
- package/node/esm/{DM7K7-284z-PczVz.mjs → B0bdb_6p7fQI_ivo.mjs} +28 -28
- package/node/esm/BIMkjQUwG4Ih-6Sh.mjs +142 -0
- package/node/esm/BNg4QQY0WAPLE0q7.mjs +141 -0
- package/node/esm/BPzcW4BejRqso338.mjs +72 -0
- package/node/esm/BR45ogAR-hY2bE60.mjs +318 -0
- package/node/esm/BlN7G0DVC24zauig.mjs +197 -0
- package/node/esm/Bph-sR3l6AYWeuxK.mjs +256 -0
- package/node/esm/CPq-MIdEnc-53JpF.mjs +319 -0
- package/node/esm/CSAnTp5rwId0DUb8.mjs +380 -0
- package/node/esm/CWcv7UVXF8IUB0PC.mjs +1379 -0
- package/node/esm/{BA7VzUQ2sKRLTZ5c.mjs → CYIoK22I6Yvv12_x.mjs} +20 -20
- package/node/esm/CZyA9uD4SkTvqp_G.mjs +1283 -0
- package/node/esm/{CHi3AuWEwEPOg9IZ.mjs → CjC6s3RUJQNCF7mP.mjs} +1 -1
- package/node/esm/{DXZrzWee8K5FPOW1.mjs → CuMePia6i_8yfJ6S.mjs} +9 -9
- package/node/esm/CvRbu8JPxFarsSR-.mjs +412 -0
- package/node/esm/CyafafEgfmjLqE5O.mjs +521 -0
- package/node/esm/D-xqQ5qOSd6WrzwJ.mjs +94 -0
- package/node/esm/DLqBHdFp6wvm6EGs.mjs +212 -0
- package/node/esm/{BwZcoHDBmLPIVOT5.mjs → DMXLxp3T0E0SRTQc.mjs} +69 -70
- package/node/esm/{CUMKTjYv6VTkcWYi.mjs → DWqvf4H5F2wMnZ0L.mjs} +32 -30
- package/node/esm/DatM6eEYPpAtIMy-.mjs +405 -0
- package/node/esm/Db3dbaYLKUO66T9s.mjs +1689 -0
- package/node/esm/DdEzhVqYTrGODXrz.mjs +68 -0
- package/node/esm/DeZJlLk8WJ3BLtLs.mjs +975 -0
- package/node/esm/DfCuL8AUxMFoEG2s.mjs +519 -0
- package/node/esm/Do-zCKziWhoG5eAv.mjs +77 -0
- package/node/esm/DpJ2gmZJioCyq8La.mjs +632 -0
- package/node/esm/{Qpuqm6xBr_da38Ht.mjs → XEDcegsv5AGKBfu2.mjs} +165 -137
- package/node/esm/index.mjs +10124 -6751
- package/node/esm/yCUxQuqVuC4DHKPx.mjs +385 -0
- package/node/esm/zITjZ7R4raDqhP-n.mjs +515 -0
- package/package.json +15 -18
- package/resources/locales/de/groups.cmd.json +29 -16
- package/resources/locales/de/studio.cmd.json +18 -1
- package/resources/locales/de/ui.msg.json +447 -40
- package/resources/locales/en/groups.cmd.json +39 -17
- package/resources/locales/en/studio.cmd.json +18 -1
- package/resources/locales/en/ui.msg.json +403 -40
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +21 -5
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +14 -0
- package/types/src/anchorItems/AnchoredRangeField.d.ts +40 -0
- package/types/src/anchorItems/index.d.ts +1 -0
- package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
- package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
- package/types/src/anomalies/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +6 -6
- package/types/src/border/BorderStylePopupButton.d.ts +3 -3
- package/types/src/border/BorderTemplateIcon.d.ts +29 -0
- package/types/src/border/index.d.ts +1 -0
- package/types/src/chart/ChartFormatPanel.d.ts +20 -0
- package/types/src/chart/ChartPlugin.d.ts +6 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/color/ColorPanel.d.ts +8 -2
- package/types/src/color/ColorPopupButton.d.ts +2 -1
- package/types/src/command/NumberFormatQuickButtons.d.ts +32 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts +3 -3
- package/types/src/command/SheetZoomCommandButton.d.ts +4 -3
- package/types/src/comments/CommentCard.d.ts +41 -0
- package/types/src/comments/CommentsPlugin.d.ts +6 -0
- package/types/src/comments/CommentsTaskPane.d.ts +23 -0
- package/types/src/comments/index.d.ts +4 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +4 -4
- package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +2 -2
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +1 -1
- package/types/src/conditions/BetweenOption.d.ts +6 -1
- package/types/src/conditions/CombinatorOption.d.ts +7 -0
- package/types/src/conditions/ConditionEditor.d.ts +61 -4
- package/types/src/conditions/ConditionUtils.d.ts +65 -6
- package/types/src/conditions/ExpressionOption.d.ts +12 -6
- package/types/src/conditions/MembershipOption.d.ts +67 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +36 -1
- package/types/src/conditions/ScalarOption.d.ts +25 -6
- package/types/src/conditions/SelectorSelect.d.ts +16 -7
- package/types/src/conditions/index.d.ts +1 -1
- package/types/src/conditions/useFormulaOption.d.ts +54 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +7 -1
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -2
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +13 -2
- package/types/src/dataValidation/DataValidationIcon.d.ts +22 -0
- package/types/src/dataValidation/DataValidationTitle.d.ts +13 -0
- package/types/src/dialog/FillSeriesDialog.d.ts +16 -0
- package/types/src/dialog/OutlineSettingsDialog.d.ts +12 -0
- package/types/src/dialog/TableNewDialog.d.ts +1 -4
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/dialog/_ShortcutSearch.d.ts +26 -0
- package/types/src/dialog/index.d.ts +0 -2
- package/types/src/externalLink/ExternalLinkCardBody.d.ts +9 -0
- package/types/src/externalLink/ExternalLinkChip.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkLocation.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +18 -0
- package/types/src/externalLink/ExternalLinksPanel.d.ts +11 -0
- package/types/src/externalLink/ExternalLinksPlugin.d.ts +5 -0
- package/types/src/externalLink/ExternalLinksTaskPane.d.ts +19 -0
- package/types/src/externalLink/index.d.ts +8 -0
- package/types/src/fill/GradientEditor.d.ts +41 -0
- package/types/src/fill/GradientStopsBar.d.ts +43 -0
- package/types/src/fill/PatternPopupButton.d.ts +26 -0
- package/types/src/fill/PatternSwatch.d.ts +53 -0
- package/types/src/fill/index.d.ts +5 -0
- package/types/src/filter/ColumnMenu.d.ts +31 -1
- package/types/src/filter/index.d.ts +0 -1
- package/types/src/form/FormulaField.d.ts +35 -6
- package/types/src/form/InputField.d.ts +35 -5
- package/types/src/format/AlignmentPanel.d.ts +13 -0
- package/types/src/format/BorderPanel.d.ts +22 -0
- package/types/src/format/BorderPreview.d.ts +101 -0
- package/types/src/format/FillPanel.d.ts +65 -0
- package/types/src/format/FontPanel.d.ts +12 -0
- package/types/src/format/FormatCellPreview.d.ts +35 -0
- package/types/src/format/FormatPanelParts.d.ts +85 -0
- package/types/src/format/FormatPlugin.d.ts +11 -0
- package/types/src/format/FormatTaskPane.d.ts +39 -0
- package/types/src/format/LinePanel.d.ts +53 -0
- package/types/src/format/LinePreviews.d.ts +71 -0
- package/types/src/format/NumberFormatOption.d.ts +43 -0
- package/types/src/{numberFormat → format}/NumberFormatPanel.d.ts +20 -0
- package/types/src/format/index.d.ts +14 -0
- package/types/src/format/useFormatSelection.d.ts +93 -0
- package/types/src/formulaBar/IFormulaBar.d.ts +11 -0
- package/types/src/formulaBar/MobileFormulaBar.d.ts +33 -0
- package/types/src/formulaBar/MobileInputToolbar.d.ts +43 -0
- package/types/src/formulaBar/index.d.ts +3 -0
- package/types/src/formulaBar/useFormulaBarSession.d.ts +68 -0
- package/types/src/index.d.ts +19 -4
- package/types/src/itemsPanel/EditorCommit.d.ts +32 -0
- package/types/src/itemsPanel/EditorPanel.d.ts +4 -1
- package/types/src/itemsPanel/ItemCard.d.ts +60 -8
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +68 -19
- package/types/src/itemsPanel/ItemsPanel.d.ts +9 -0
- package/types/src/itemsPanel/ItemsSearchField.d.ts +17 -0
- package/types/src/itemsPanel/index.d.ts +2 -0
- package/types/src/named/NamedDetailsPanel.d.ts +9 -2
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -2
- package/types/src/named/NamedEditorPanel.d.ts +1 -1
- package/types/src/named/NamedExpressionField.d.ts +32 -0
- package/types/src/named/NamedKindChip.d.ts +38 -0
- package/types/src/picture/PicturePlugin.d.ts +6 -0
- package/types/src/picture/index.d.ts +2 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +6 -0
- package/types/src/protectedRange/ProtectedRangeDraft.d.ts +22 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +0 -14
- package/types/src/protectedRange/index.d.ts +2 -1
- package/types/src/protection/ManageProtectionTaskPane.d.ts +29 -0
- package/types/src/protection/PasswordDialog.d.ts +32 -0
- package/types/src/protection/PasswordField.d.ts +35 -0
- package/types/src/protection/ProtectedCellsPanel.d.ts +20 -0
- package/types/src/protection/ProtectionPlugin.d.ts +11 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +34 -15
- package/types/src/protection/WorkbookProtectionTab.d.ts +22 -0
- package/types/src/protection/WorksheetProtectionPanel.d.ts +35 -0
- package/types/src/protection/index.d.ts +7 -1
- package/types/src/shape/InsertShapeCommandButton.d.ts +20 -0
- package/types/src/shape/ShapeFormatPanel.d.ts +11 -0
- package/types/src/shape/ShapePlugin.d.ts +6 -0
- package/types/src/shape/index.d.ts +3 -0
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +18 -0
- package/types/src/slicer/SlicerPlugin.d.ts +6 -0
- package/types/src/slicer/index.d.ts +3 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +6 -0
- package/types/src/studio/CommandsWrapper.d.ts +5 -0
- package/types/src/studio/EagerStudio.d.ts +14 -1
- package/types/src/studio/StudioCommandProvider.d.ts +10 -0
- package/types/src/studio/StudioCommands.d.ts +40 -4
- package/types/src/studio/StudioProps.d.ts +64 -2
- package/types/src/studio/StudioSplitPane.d.ts +1 -1
- package/types/src/studio/formulaBarPlacement.d.ts +35 -0
- package/types/src/studio/splitStudioProps.d.ts +7 -0
- package/types/src/studio/useStudioApp.d.ts +31 -18
- package/types/src/template/TemplateCommands.d.ts +29 -0
- package/types/src/template/TemplateDialog.d.ts +19 -0
- package/types/src/template/TemplatePanel.d.ts +50 -0
- package/types/src/template/TemplateSearchField.d.ts +29 -0
- package/types/src/template/WelcomeDialog.d.ts +29 -0
- package/types/src/template/categoryColor.d.ts +8 -0
- package/types/src/template/index.d.ts +3 -0
- package/types/src/template/useTemplateCatalog.d.ts +71 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
- package/types/src/workbook/DefaultRenderers.d.ts +16 -2
- package/types/src/workbook/FillMenu.d.ts +21 -0
- package/types/src/workbook/OutlineButtons.d.ts +11 -0
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/types/src/workbook/WorkbookElement.d.ts +1 -1
- package/types/src/workbook/index.d.ts +1 -0
- package/browser/cjs/BQJKf40kttQWOzLw.cjs +0 -20
- package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +0 -1
- package/browser/cjs/B_D3JKseVvpRyX-E.cjs +0 -1
- package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +0 -2
- package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +0 -2
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
- package/browser/cjs/Bte6P3MhSjajJmmY.cjs +0 -7
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +0 -1
- package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +0 -1
- package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +0 -1
- package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +0 -1
- package/browser/cjs/CYxc8vnRi8dNpDPk.cjs +0 -1
- package/browser/cjs/CZm1jVZaHQ246prW.cjs +0 -1
- package/browser/cjs/CdDYyAfccXme8w6m.cjs +0 -1
- package/browser/cjs/Cm1APq2MraYNNhyI.cjs +0 -1
- package/browser/cjs/DO8V31Z1ewgMA1di.cjs +0 -5
- package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +0 -1
- package/browser/cjs/IASAYG6qgv7lJY7y.cjs +0 -1
- package/browser/cjs/KZvriGbhEOVkQD0b.cjs +0 -1
- package/browser/cjs/UnMhi28mbvLiOXQe.cjs +0 -1
- package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +0 -1
- package/browser/cjs/iMWEL01eC83oU-YY.cjs +0 -1
- package/browser/cjs/index.cjs +0 -2
- package/browser/cjs/w2GjebPlOFv3pCbm.cjs +0 -1
- package/browser/cjs/z0rB4fK6X1M6PpVD.cjs +0 -11
- package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +0 -1
- package/browser/esm/BuY3uV47Bwbqpasq.mjs +0 -219
- package/browser/esm/CAs1MWvJTcRfJy26.mjs +0 -217
- package/browser/esm/CBU3LgLYmqtQjJbu.mjs +0 -1150
- package/browser/esm/CDU0rqpLNVtMLI-f.mjs +0 -52
- package/browser/esm/CVBub6pgTsJzCc5m.mjs +0 -5429
- package/browser/esm/C_XvSsQ9BVdHffCO.mjs +0 -47
- package/browser/esm/FT29q8yNwsEpVZjt.mjs +0 -9257
- package/browser/esm/Hb1rlHT4tE5hLcjM.mjs +0 -82
- package/browser/esm/UJOXCQv6KrG1gY3l.mjs +0 -105
- package/browser/esm/s46El7mT6oKLSnYB.mjs +0 -411
- package/node/esm/9FY82fj1R1c-AczW.mjs +0 -47
- package/node/esm/C-boHCnJditFzng3.mjs +0 -106
- package/node/esm/DxXM8qHi0Oz4Zovl.mjs +0 -4575
- package/node/esm/sQt2wWGTRLzqeJdG.mjs +0 -82
- package/node/esm/yCHAZKxJR7qY_ySy.mjs +0 -470
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +0 -32
- package/types/src/conditions/DateTimeOption.d.ts +0 -43
- package/types/src/conditions/InSetOption.d.ts +0 -37
- package/types/src/dialog/CommentsDialog.d.ts +0 -11
- package/types/src/dialog/NumberFormatDialog.d.ts +0 -12
- package/types/src/filter/FilterList.d.ts +0 -28
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +0 -12
- package/types/src/numberFormat/index.d.ts +0 -8
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +0 -3
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +0 -2
- package/types/src/protection/WorkbookProtectionDialog.d.ts +0 -23
|
@@ -0,0 +1,1543 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./ClBvNPeNCAhuVWrG.mjs";
|
|
8
|
+
import { n as t } from "./DDc6rDuU9JAo1DH_.mjs";
|
|
9
|
+
import { n } from "./CynTY0oNtyJnoaBq.mjs";
|
|
10
|
+
import { Condition as r, FormulaError as i, FormulaText as a, ICondition as o, ScalarType as s, getLocaleProfile as c } from "@sheetxl/sdk";
|
|
11
|
+
import { ValueChecklist as l, useWorksheet as u } from "@sheetxl/react";
|
|
12
|
+
import { DynamicIcon as d, KeyCodes as f, useCallbackRef as p, useLanguage as m, useMeasure as h, useTranslator as g } from "@sheetxl/utils-react";
|
|
13
|
+
import _, { createContext as v, forwardRef as y, memo as b, useCallback as x, useContext as S, useEffect as C, useMemo as w, useRef as T, useState as E } from "react";
|
|
14
|
+
import { ExhibitIconButton as D, ExhibitPopupIconButton as O } from "@sheetxl/utils-mui";
|
|
15
|
+
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
16
|
+
import { Box as M, Checkbox as N, Divider as P, FormControl as F, FormControlLabel as I, FormHelperText as L, InputLabel as R, ListSubheader as z, MenuItem as B, MenuList as V, Select as H, TextField as U, ToggleButton as W, ToggleButtonGroup as ee, Typography as te } from "@mui/material";
|
|
17
|
+
import { messageKey as G } from "@sheetxl/utils";
|
|
18
|
+
import { ListSearch as ne, PickList as K, filterByText as re } from "@sheetxl/grid-react";
|
|
19
|
+
var ie = b((e) => {
|
|
20
|
+
let { value: t = null, selectors: n, onChange: r, title: i, allowNull: a = !1, readOnly: o = !1, extras: s, extraValue: c = null, ...l } = e, u = g(), f = i ?? u("condition.selectorTitle"), p = n.map((e) => ({
|
|
21
|
+
value: e.getName(),
|
|
22
|
+
title: e.getTitle?.() ?? e.getName()
|
|
23
|
+
})).map((e) => A(B, {
|
|
24
|
+
value: e.value,
|
|
25
|
+
children: e.title
|
|
26
|
+
}, e.value)), m = (s ?? []).map((e) => A(B, {
|
|
27
|
+
value: e.value,
|
|
28
|
+
children: e.title
|
|
29
|
+
}, `extra:${e.value}`)), h = { backgroundColor: "background.paper" };
|
|
30
|
+
return o && (h = {
|
|
31
|
+
...h,
|
|
32
|
+
"& .MuiSelect-icon": { display: "none" },
|
|
33
|
+
"& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
|
|
34
|
+
}), j(F, {
|
|
35
|
+
size: "small",
|
|
36
|
+
...l,
|
|
37
|
+
children: [A(R, { children: f }), j(H, {
|
|
38
|
+
value: c ?? t?.getName() ?? "null",
|
|
39
|
+
label: f,
|
|
40
|
+
readOnly: o,
|
|
41
|
+
IconComponent: (e) => A(d, {
|
|
42
|
+
iconKey: "ExpandMore",
|
|
43
|
+
...e
|
|
44
|
+
}),
|
|
45
|
+
onChange: (e) => {
|
|
46
|
+
let t = e.target.value;
|
|
47
|
+
if (s?.some((e) => e.value === t)) return void r(null, t);
|
|
48
|
+
let i = t === "null" ? null : n.find((e) => e.getName() === t) ?? null;
|
|
49
|
+
r(i);
|
|
50
|
+
},
|
|
51
|
+
sx: h,
|
|
52
|
+
children: [
|
|
53
|
+
a && A(B, {
|
|
54
|
+
value: "null",
|
|
55
|
+
children: u("condition.anySelector")
|
|
56
|
+
}),
|
|
57
|
+
p,
|
|
58
|
+
m
|
|
59
|
+
]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
ie.displayName = "SelectorSelect";
|
|
64
|
+
var ae = 0, q = /* @__PURE__ */ new WeakMap(), oe = (e) => {
|
|
65
|
+
let t = q.get(e);
|
|
66
|
+
return t || (t = "__ci_" + ++ae, q.set(e, t)), t;
|
|
67
|
+
}, J = (e, t) => {
|
|
68
|
+
let n = q.get(e);
|
|
69
|
+
n && q.set(t, n);
|
|
70
|
+
}, se = Object.freeze([o.BuiltInOperatorNames.Icon, o.BuiltInOperatorNames.Color]), ce = /* @__PURE__ */ new Set([
|
|
71
|
+
o.BuiltInOperatorNames.TextContains,
|
|
72
|
+
o.BuiltInOperatorNames.TextStartsWith,
|
|
73
|
+
o.BuiltInOperatorNames.TextEndsWith,
|
|
74
|
+
o.BuiltInOperatorNames.TextEmail,
|
|
75
|
+
o.BuiltInOperatorNames.TextIsUrl
|
|
76
|
+
]), le = /* @__PURE__ */ new WeakSet(), Y = /* @__PURE__ */ new WeakMap(), ue = (e, t) => (Y.set(e, t), e), de = (e) => (t, n) => {
|
|
77
|
+
let r = Number(le.has(n)) - Number(le.has(t));
|
|
78
|
+
if (r !== 0) return r;
|
|
79
|
+
let i = Y.has(t), a = Y.has(n);
|
|
80
|
+
return i || a ? Number(a) - Number(i) : (t.getTitle?.() ?? "").localeCompare(n.getTitle?.() ?? "", e);
|
|
81
|
+
}, fe = (e, t, n, i = se) => {
|
|
82
|
+
let a = t ?? Object.values(r.BuiltInOperators), s = e?.getSelectType() ?? null, c = e?.getName() === o.BuiltInSelectorNames.Display;
|
|
83
|
+
return a.filter((t) => {
|
|
84
|
+
if (i.includes(t.getName())) return !1;
|
|
85
|
+
if (!e) return !0;
|
|
86
|
+
if (c && ce.has(t.getName())) return !1;
|
|
87
|
+
let n = t.getAcceptsTypes?.();
|
|
88
|
+
return !n || n.includes(s);
|
|
89
|
+
}).sort(de(n));
|
|
90
|
+
}, pe = (e, t, n, r) => {
|
|
91
|
+
let i = de(r), a = /* @__PURE__ */ new Map();
|
|
92
|
+
for (let t of e) {
|
|
93
|
+
let e = Y.get(t);
|
|
94
|
+
if (e === void 0) continue;
|
|
95
|
+
let n = a.get(e);
|
|
96
|
+
n ? n.push(t) : a.set(e, [t]);
|
|
97
|
+
}
|
|
98
|
+
let o = e.filter((e) => !e.isCombinator?.() && !Y.has(e)).sort(i), s = e.filter((e) => e.isCombinator?.()).sort(i), c = [];
|
|
99
|
+
for (let [e, n] of a) c.push(A(z, {
|
|
100
|
+
disableSticky: !0,
|
|
101
|
+
sx: me,
|
|
102
|
+
children: e
|
|
103
|
+
}, `__header:${e}`)), n.forEach((e) => c.push(t(e)));
|
|
104
|
+
return a.size > 0 && o.length > 0 && c.push(A(P, {}, "__divider:grouped")), o.length > 0 && (c.push(A(z, {
|
|
105
|
+
disableSticky: !0,
|
|
106
|
+
sx: me,
|
|
107
|
+
children: n("condition.groupBasic")
|
|
108
|
+
}, "__header:leaf")), o.forEach((e) => c.push(t(e)))), o.length > 0 && s.length > 0 && c.push(A(P, {}, "__divider")), s.length > 0 && (c.push(A(z, {
|
|
109
|
+
disableSticky: !0,
|
|
110
|
+
sx: me,
|
|
111
|
+
children: n("condition.groupCombine")
|
|
112
|
+
}, "__header:combinator")), s.forEach((e) => c.push(t(e)))), c;
|
|
113
|
+
}, X = (e, t, n = null, r) => {
|
|
114
|
+
if (!e.isCombinator?.()) return e.createDefaultParam?.(n ?? void 0, r) ?? null;
|
|
115
|
+
let i = t.find((e) => !e.isCombinator?.()) ?? null, a = i ? {
|
|
116
|
+
operator: i.getName(),
|
|
117
|
+
param: i.createDefaultParam?.(n ?? void 0) ?? null
|
|
118
|
+
} : null;
|
|
119
|
+
return e.getName() === "not" ? a : a ? [a] : [];
|
|
120
|
+
}, me = {
|
|
121
|
+
userSelect: "none",
|
|
122
|
+
lineHeight: "2",
|
|
123
|
+
fontSize: "0.75rem",
|
|
124
|
+
fontWeight: 600,
|
|
125
|
+
color: "text.secondary",
|
|
126
|
+
paddingLeft: 1,
|
|
127
|
+
paddingRight: 1
|
|
128
|
+
}, he = { pl: 2 }, ge = b(y((e, t) => {
|
|
129
|
+
let { icon: n, tooltip: r, label: i, darkMode: a, propsPanel: o, value: s, operators: c, onChange: l, title: u, readOnly: p = !1, ...h } = e, _ = g(), v = m();
|
|
130
|
+
u ?? _("condition.operatorTitle");
|
|
131
|
+
let y = n || A(d, { iconKey: "Add" }), b = T(l);
|
|
132
|
+
b.current = l;
|
|
133
|
+
let S = {
|
|
134
|
+
createPopupPanel: x((e) => {
|
|
135
|
+
let { closeFloatAll: t } = e, n = pe(c, (e) => A(B, {
|
|
136
|
+
sx: he,
|
|
137
|
+
value: e.getName(),
|
|
138
|
+
onClick: () => {
|
|
139
|
+
t?.(), b.current(e);
|
|
140
|
+
},
|
|
141
|
+
children: e.getTitle?.()
|
|
142
|
+
}, e.getName()), _, v);
|
|
143
|
+
return A("div", {
|
|
144
|
+
style: {
|
|
145
|
+
minWidth: 200,
|
|
146
|
+
paddingTop: "8px",
|
|
147
|
+
paddingBottom: "8px",
|
|
148
|
+
...o?.style
|
|
149
|
+
},
|
|
150
|
+
...o,
|
|
151
|
+
onKeyDown: (e) => {
|
|
152
|
+
e.which === f.Enter && t?.();
|
|
153
|
+
},
|
|
154
|
+
children: A(V, {
|
|
155
|
+
disablePadding: !0,
|
|
156
|
+
children: n
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
}, [
|
|
160
|
+
c,
|
|
161
|
+
_,
|
|
162
|
+
v
|
|
163
|
+
]),
|
|
164
|
+
tooltip: r || i || "When",
|
|
165
|
+
label: i,
|
|
166
|
+
disabled: p,
|
|
167
|
+
icon: y,
|
|
168
|
+
...h
|
|
169
|
+
};
|
|
170
|
+
return A(O, {
|
|
171
|
+
ref: t,
|
|
172
|
+
...S
|
|
173
|
+
});
|
|
174
|
+
})), _e = b((e) => {
|
|
175
|
+
let { value: t, operators: n, onChange: r, title: i, readOnly: a = !1, ...o } = e, s = g(), c = m(), l = i ?? s("condition.operatorTitle"), u = /* @__PURE__ */ new Map();
|
|
176
|
+
n.forEach((e) => {
|
|
177
|
+
u.set(e.getName(), e);
|
|
178
|
+
});
|
|
179
|
+
let f = pe(n, (e) => A(B, {
|
|
180
|
+
value: e.getName(),
|
|
181
|
+
sx: he,
|
|
182
|
+
children: e.getTitle?.()
|
|
183
|
+
}, e.getName()), s, c);
|
|
184
|
+
return j(F, {
|
|
185
|
+
size: "small",
|
|
186
|
+
...o,
|
|
187
|
+
children: [A(R, { children: l }), A(H, {
|
|
188
|
+
value: t?.getName() ?? "null",
|
|
189
|
+
label: l,
|
|
190
|
+
readOnly: a,
|
|
191
|
+
IconComponent: (e) => A(d, {
|
|
192
|
+
iconKey: "ExpandMore",
|
|
193
|
+
...e
|
|
194
|
+
}),
|
|
195
|
+
onChange: (e) => {
|
|
196
|
+
let t = e.target.value, n = t === "null" ? null : u.get(t) ?? null;
|
|
197
|
+
r(n);
|
|
198
|
+
},
|
|
199
|
+
sx: a ? {
|
|
200
|
+
"& .MuiSelect-icon": { display: "none" },
|
|
201
|
+
"& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
|
|
202
|
+
} : void 0,
|
|
203
|
+
children: f
|
|
204
|
+
})]
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
_e.displayName = "OperatorSelect";
|
|
208
|
+
var ve = b((e) => {
|
|
209
|
+
let { operator: t, inputs: n, onOptionChange: i, operators: a, selector: o, getItems: s, propsChecklist: c, ignoreBlank: l, readOnly: u, ...d } = e, f = g(), p = t.getName() === "not", m = p ? null : t.getName() === "and" ? f("condition.and") : f("condition.or"), h = (e) => e.selector ? r.Selectors.get(e.selector) ?? o : o, v = p ? f("condition.not") : m;
|
|
210
|
+
return A(M, {
|
|
211
|
+
sx: {
|
|
212
|
+
display: "flex",
|
|
213
|
+
flexDirection: "column",
|
|
214
|
+
gap: .5,
|
|
215
|
+
pl: 1,
|
|
216
|
+
borderLeft: 2,
|
|
217
|
+
borderColor: "divider"
|
|
218
|
+
},
|
|
219
|
+
...d,
|
|
220
|
+
children: n.map((e, t) => A(_.Fragment, { children: A(qe, {
|
|
221
|
+
operatorTitle: t > 0 ? v ?? "" : "",
|
|
222
|
+
operatorParam: e,
|
|
223
|
+
onOperatorParamChange: (e) => ((e, t) => {
|
|
224
|
+
let r = n.slice(), a = n[e], o = {
|
|
225
|
+
operator: t.operator,
|
|
226
|
+
param: t.param
|
|
227
|
+
};
|
|
228
|
+
a?.selector && (o.selector = a.selector), J(n[e], o), r[e] = o, i(r);
|
|
229
|
+
})(t, e),
|
|
230
|
+
onRemove: () => ((e) => {
|
|
231
|
+
let t = n.filter((t, n) => n !== e);
|
|
232
|
+
i(t);
|
|
233
|
+
})(t),
|
|
234
|
+
operators: a,
|
|
235
|
+
selector: h(e),
|
|
236
|
+
onSelectorChange: (e) => ((e, t) => {
|
|
237
|
+
let r = n.slice(), { selector: a, ...o } = n[e], s = t ? {
|
|
238
|
+
...o,
|
|
239
|
+
selector: t
|
|
240
|
+
} : o;
|
|
241
|
+
J(n[e], s), r[e] = s, i(r);
|
|
242
|
+
})(t, e),
|
|
243
|
+
getItems: s,
|
|
244
|
+
propsChecklist: c,
|
|
245
|
+
ignoreBlank: l,
|
|
246
|
+
readOnly: u,
|
|
247
|
+
required: p
|
|
248
|
+
}) }, oe(e)))
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
ve.displayName = "CombinatorOption";
|
|
252
|
+
var ye = b((e) => {
|
|
253
|
+
let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = g();
|
|
254
|
+
return A(U, {
|
|
255
|
+
size: "small",
|
|
256
|
+
type: "text",
|
|
257
|
+
placeholder: a("condition.enterText"),
|
|
258
|
+
value: t ?? "",
|
|
259
|
+
onChange: (e) => n(String(e.target.value)),
|
|
260
|
+
disabled: r,
|
|
261
|
+
...i,
|
|
262
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } }
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
ye.displayName = "StringOption";
|
|
266
|
+
var be = b((e) => {
|
|
267
|
+
let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = g();
|
|
268
|
+
return A(U, {
|
|
269
|
+
size: "small",
|
|
270
|
+
type: "number",
|
|
271
|
+
placeholder: a("condition.enterNumber"),
|
|
272
|
+
value: "" + (t ?? ""),
|
|
273
|
+
onChange: (e) => n(Number(e.target.value)),
|
|
274
|
+
disabled: r,
|
|
275
|
+
...i,
|
|
276
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } }
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
be.displayName = "NumberOption";
|
|
280
|
+
var xe = v(null), Se = (e) => {
|
|
281
|
+
let { rowIndex: t, colIndex: n } = e.getSelectedCell().getCoords();
|
|
282
|
+
return {
|
|
283
|
+
rowIndex: t,
|
|
284
|
+
colIndex: n
|
|
285
|
+
};
|
|
286
|
+
}, Ce = (e, t) => {
|
|
287
|
+
let n = ((e) => {
|
|
288
|
+
let t = e?.getCoords();
|
|
289
|
+
if (!t || t.length === 0) return null;
|
|
290
|
+
let n = t[0].rowStart, r = t[0].colStart;
|
|
291
|
+
for (let e = 1; e < t.length; e++) n = Math.min(n, t[e].rowStart), r = Math.min(r, t[e].colStart);
|
|
292
|
+
return {
|
|
293
|
+
rowIndex: n,
|
|
294
|
+
colIndex: r
|
|
295
|
+
};
|
|
296
|
+
})(t?.getRanges() ?? null);
|
|
297
|
+
if (!e || !n) return null;
|
|
298
|
+
let { rowIndex: r, colIndex: i } = Se(e);
|
|
299
|
+
return r === n.rowIndex && i === n.colIndex ? null : {
|
|
300
|
+
active: {
|
|
301
|
+
rowIndex: r,
|
|
302
|
+
colIndex: i
|
|
303
|
+
},
|
|
304
|
+
anchor: n
|
|
305
|
+
};
|
|
306
|
+
}, we = () => {
|
|
307
|
+
let e = u(), t = S(xe), n = T(null), r = e ? Se(e) : null, i = e?.getName() ?? null, a = w(() => r && i ? {
|
|
308
|
+
...r,
|
|
309
|
+
scope: i
|
|
310
|
+
} : void 0, [
|
|
311
|
+
i,
|
|
312
|
+
r?.rowIndex,
|
|
313
|
+
r?.colIndex
|
|
314
|
+
]);
|
|
315
|
+
return w(() => ({
|
|
316
|
+
home: a,
|
|
317
|
+
display: (r) => {
|
|
318
|
+
let i = n.current;
|
|
319
|
+
if (i && i.stored === r.getExpression()) return i.text;
|
|
320
|
+
let a = Ce(e, t);
|
|
321
|
+
if (a) try {
|
|
322
|
+
let t = e.createFormula(r.getExpression(), a.anchor).shift(a.active);
|
|
323
|
+
if (t) return t.getExpression({ target: "display" });
|
|
324
|
+
} catch {}
|
|
325
|
+
return r.getExpression({ target: "display" });
|
|
326
|
+
},
|
|
327
|
+
compile: (r) => {
|
|
328
|
+
let i = Ce(e, t), a = null;
|
|
329
|
+
try {
|
|
330
|
+
a = e?.createFormula(r, i?.active, { target: "display" }) ?? null, a && i && (a = a.shift(i.anchor));
|
|
331
|
+
} catch {
|
|
332
|
+
a = null;
|
|
333
|
+
}
|
|
334
|
+
return n.current = a ? {
|
|
335
|
+
stored: a.getExpression(),
|
|
336
|
+
text: r
|
|
337
|
+
} : null, a ?? r;
|
|
338
|
+
}
|
|
339
|
+
}), [
|
|
340
|
+
e,
|
|
341
|
+
t,
|
|
342
|
+
a
|
|
343
|
+
]);
|
|
344
|
+
}, Te = (e, t) => !!t && typeof e == "string" && !e.startsWith("="), Ee = (e, t, n, r) => e == null ? "" : e.isIFormula ? "=" + t.display(e) : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : i.isError(e) ? e.getLabel() : r && typeof e == "number" ? ((e, t, n) => {
|
|
345
|
+
if (!e || t < 0) return String(t);
|
|
346
|
+
let r = t >= 1, i = !Number.isInteger(t), a;
|
|
347
|
+
return a = n !== "time" || r ? i ? r ? "Short DateTime" : "Long Time" : "Short Date" : "Long Time", e.createCell({
|
|
348
|
+
value: t,
|
|
349
|
+
style: { numberFormat: a }
|
|
350
|
+
}).getText();
|
|
351
|
+
})(n, e, r) : String(e), De = (e, t, n, r) => {
|
|
352
|
+
if (e.length === 0) return null;
|
|
353
|
+
if (e.startsWith("=")) {
|
|
354
|
+
let n = t.compile(e.substring(1));
|
|
355
|
+
return typeof n == "string" ? e : n;
|
|
356
|
+
}
|
|
357
|
+
let i = e.trim();
|
|
358
|
+
if (i.length === 0) return e;
|
|
359
|
+
if (r) return ((e, t) => {
|
|
360
|
+
if (!e) return null;
|
|
361
|
+
let n = e.createCell({ value: t }, void 0, { textParser: !0 });
|
|
362
|
+
return n.getType() === s.Number ? n.getValue() : null;
|
|
363
|
+
})(n, i) ?? e;
|
|
364
|
+
let a = Number(i);
|
|
365
|
+
return Number.isFinite(a) ? a : e;
|
|
366
|
+
}, Oe = (e, t, n, r) => {
|
|
367
|
+
let i = De(e, t, n, r);
|
|
368
|
+
if ((!i?.isIFormula || i.isValid()) && !Te(i, r)) return i;
|
|
369
|
+
}, Z = b((e) => {
|
|
370
|
+
let { option: r, onOptionChange: i, literal: a, readOnly: o, ...s } = e, c = g(), l = u(), d = we(), f = T(null), p = T(null), [m, h] = E(!1), _ = () => p.current === null || Oe(p.current, d, l, a) !== void 0;
|
|
371
|
+
return n(() => {
|
|
372
|
+
let e = f.current;
|
|
373
|
+
return !e?.error && (p.current !== null && e?.commit(), _() ? !Te(r, a) : (h(!0), !1));
|
|
374
|
+
}), A(t, {
|
|
375
|
+
size: "small",
|
|
376
|
+
home: d.home,
|
|
377
|
+
value: Ee(r, d, l, a),
|
|
378
|
+
apiRef: f,
|
|
379
|
+
onChangeText: (e) => {
|
|
380
|
+
h(!1), p.current = e;
|
|
381
|
+
let t = Oe(e, d, l, a);
|
|
382
|
+
t !== void 0 && i(t);
|
|
383
|
+
},
|
|
384
|
+
onDone: () => {
|
|
385
|
+
_() ? p.current = null : h(!0);
|
|
386
|
+
},
|
|
387
|
+
validationError: m || Te(r, a) ? G("condition.invalidDateTime") : null,
|
|
388
|
+
placeholder: c("condition.enterValueOrFormula"),
|
|
389
|
+
disabled: o,
|
|
390
|
+
fullWidth: !0,
|
|
391
|
+
equals: "literal",
|
|
392
|
+
pickAs: "absolute",
|
|
393
|
+
label: null,
|
|
394
|
+
showError: !1,
|
|
395
|
+
helperText: null,
|
|
396
|
+
...s
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
Z.displayName = "ScalarOption";
|
|
400
|
+
var ke = b((e) => {
|
|
401
|
+
let { option: t, onOptionChange: n, readOnly: r } = e, i = g();
|
|
402
|
+
return j(ee, {
|
|
403
|
+
exclusive: !0,
|
|
404
|
+
size: "small",
|
|
405
|
+
value: t ?? !0,
|
|
406
|
+
onChange: (e, t) => {
|
|
407
|
+
t !== null && n(t);
|
|
408
|
+
},
|
|
409
|
+
sx: {
|
|
410
|
+
my: 0,
|
|
411
|
+
py: 0,
|
|
412
|
+
backgroundColor: "background.paper"
|
|
413
|
+
},
|
|
414
|
+
disabled: r,
|
|
415
|
+
children: [A(W, {
|
|
416
|
+
value: !0,
|
|
417
|
+
children: i("condition.true")
|
|
418
|
+
}), A(W, {
|
|
419
|
+
value: !1,
|
|
420
|
+
children: i("condition.false")
|
|
421
|
+
})]
|
|
422
|
+
});
|
|
423
|
+
});
|
|
424
|
+
ke.displayName = "BooleanOption";
|
|
425
|
+
var Ae = {}, je = b((t) => {
|
|
426
|
+
let { option: n, onOptionChange: r, className: i, readOnly: a, ...s } = t, c = g(), l = n?.type ?? o.AverageType.Above, u = n?.stdDevs ?? "", f = { backgroundColor: "background.paper" };
|
|
427
|
+
return a && (f = {
|
|
428
|
+
...f,
|
|
429
|
+
"& .MuiSelect-icon": { display: "none" },
|
|
430
|
+
"& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
|
|
431
|
+
}), j(M, {
|
|
432
|
+
className: e(i, Ae.option),
|
|
433
|
+
...s,
|
|
434
|
+
sx: {
|
|
435
|
+
display: "flex",
|
|
436
|
+
flexDirection: "row",
|
|
437
|
+
gap: .25,
|
|
438
|
+
...s?.sx
|
|
439
|
+
},
|
|
440
|
+
children: [A(F, {
|
|
441
|
+
sx: { flex: .5 },
|
|
442
|
+
size: "small",
|
|
443
|
+
children: j(H, {
|
|
444
|
+
value: l,
|
|
445
|
+
sx: f,
|
|
446
|
+
IconComponent: (e) => A(d, {
|
|
447
|
+
iconKey: "ExpandMore",
|
|
448
|
+
...e
|
|
449
|
+
}),
|
|
450
|
+
disabled: a,
|
|
451
|
+
onChange: (e) => r({
|
|
452
|
+
...n,
|
|
453
|
+
type: e.target.value
|
|
454
|
+
}),
|
|
455
|
+
children: [A(B, {
|
|
456
|
+
value: o.AverageType.Above,
|
|
457
|
+
children: c("condition.above")
|
|
458
|
+
}), A(B, {
|
|
459
|
+
value: o.AverageType.Below,
|
|
460
|
+
children: c("condition.below")
|
|
461
|
+
})]
|
|
462
|
+
})
|
|
463
|
+
}), A(U, {
|
|
464
|
+
size: "small",
|
|
465
|
+
placeholder: c("condition.stdDevs"),
|
|
466
|
+
value: u,
|
|
467
|
+
onChange: (e) => {
|
|
468
|
+
let t = Number(e.target.value) || "", i = { ...n };
|
|
469
|
+
typeof t == "number" ? i.stdDevs = t : delete i.stdDevs, r(i);
|
|
470
|
+
},
|
|
471
|
+
sx: { flex: .5 },
|
|
472
|
+
disabled: a,
|
|
473
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } },
|
|
474
|
+
type: "number"
|
|
475
|
+
})]
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
je.displayName = "AverageOption";
|
|
479
|
+
var Me = b((e) => {
|
|
480
|
+
let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = function(e, t) {
|
|
481
|
+
let n = (e) => new Intl.DateTimeFormat(t, { month: "long" }).format(new Date(2e3, e, 1));
|
|
482
|
+
return [
|
|
483
|
+
{
|
|
484
|
+
header: e("condition.period.day"),
|
|
485
|
+
options: [
|
|
486
|
+
{
|
|
487
|
+
value: o.TimePeriodType.Today,
|
|
488
|
+
label: e("condition.period.today")
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
value: o.TimePeriodType.Yesterday,
|
|
492
|
+
label: e("condition.period.yesterday")
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
value: o.TimePeriodType.Tomorrow,
|
|
496
|
+
label: e("condition.period.tomorrow")
|
|
497
|
+
}
|
|
498
|
+
]
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
header: e("condition.period.week"),
|
|
502
|
+
options: [
|
|
503
|
+
{
|
|
504
|
+
value: o.TimePeriodType.ThisWeek,
|
|
505
|
+
label: e("condition.period.thisWeek")
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
value: o.TimePeriodType.LastWeek,
|
|
509
|
+
label: e("condition.period.lastWeek")
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
value: o.TimePeriodType.NextWeek,
|
|
513
|
+
label: e("condition.period.nextWeek")
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
header: e("condition.period.month"),
|
|
519
|
+
options: [
|
|
520
|
+
{
|
|
521
|
+
value: o.TimePeriodType.ThisMonth,
|
|
522
|
+
label: e("condition.period.thisMonth")
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
value: o.TimePeriodType.LastMonth,
|
|
526
|
+
label: e("condition.period.lastMonth")
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
value: o.TimePeriodType.NextMonth,
|
|
530
|
+
label: e("condition.period.nextMonth")
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
header: e("condition.period.year"),
|
|
536
|
+
options: [{
|
|
537
|
+
value: o.TimePeriodType.YearToDate,
|
|
538
|
+
label: e("condition.period.yearToDate")
|
|
539
|
+
}, {
|
|
540
|
+
value: o.TimePeriodType.LastYear,
|
|
541
|
+
label: e("condition.period.lastYear")
|
|
542
|
+
}]
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
header: e("condition.period.byMonth"),
|
|
546
|
+
options: [
|
|
547
|
+
{
|
|
548
|
+
value: o.TimePeriodType.M1,
|
|
549
|
+
label: n(0)
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
value: o.TimePeriodType.M2,
|
|
553
|
+
label: n(1)
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
value: o.TimePeriodType.M3,
|
|
557
|
+
label: n(2)
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
value: o.TimePeriodType.M4,
|
|
561
|
+
label: n(3)
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
value: o.TimePeriodType.M5,
|
|
565
|
+
label: n(4)
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
value: o.TimePeriodType.M6,
|
|
569
|
+
label: n(5)
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
value: o.TimePeriodType.M7,
|
|
573
|
+
label: n(6)
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
value: o.TimePeriodType.M8,
|
|
577
|
+
label: n(7)
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
value: o.TimePeriodType.M9,
|
|
581
|
+
label: n(8)
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
value: o.TimePeriodType.M10,
|
|
585
|
+
label: n(9)
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
value: o.TimePeriodType.M11,
|
|
589
|
+
label: n(10)
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
value: o.TimePeriodType.M12,
|
|
593
|
+
label: n(11)
|
|
594
|
+
}
|
|
595
|
+
]
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
header: e("condition.period.byQuarter"),
|
|
599
|
+
options: [
|
|
600
|
+
{
|
|
601
|
+
value: o.TimePeriodType.ThisQuarter,
|
|
602
|
+
label: e("condition.period.thisQuarter")
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
value: o.TimePeriodType.LastQuarter,
|
|
606
|
+
label: e("condition.period.lastQuarter")
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
value: o.TimePeriodType.NextQuarter,
|
|
610
|
+
label: e("condition.period.nextQuarter")
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
value: o.TimePeriodType.Q1,
|
|
614
|
+
label: e("condition.period.q1")
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
value: o.TimePeriodType.Q2,
|
|
618
|
+
label: e("condition.period.q2")
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
value: o.TimePeriodType.Q3,
|
|
622
|
+
label: e("condition.period.q3")
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
value: o.TimePeriodType.Q4,
|
|
626
|
+
label: e("condition.period.q4")
|
|
627
|
+
}
|
|
628
|
+
]
|
|
629
|
+
}
|
|
630
|
+
];
|
|
631
|
+
}(g(), m()), s = t?.type ?? o.TimePeriodType.Today;
|
|
632
|
+
return A(M, {
|
|
633
|
+
...i,
|
|
634
|
+
sx: {
|
|
635
|
+
display: "flex",
|
|
636
|
+
flexDirection: "column",
|
|
637
|
+
gap: 2,
|
|
638
|
+
...i?.sx
|
|
639
|
+
},
|
|
640
|
+
children: A(F, {
|
|
641
|
+
size: "small",
|
|
642
|
+
children: A(H, {
|
|
643
|
+
value: s,
|
|
644
|
+
sx: { backgroundColor: "background.paper" },
|
|
645
|
+
IconComponent: (e) => A(d, {
|
|
646
|
+
iconKey: "ExpandMore",
|
|
647
|
+
...e
|
|
648
|
+
}),
|
|
649
|
+
onChange: (e) => n({
|
|
650
|
+
...t,
|
|
651
|
+
type: e.target.value
|
|
652
|
+
}),
|
|
653
|
+
disabled: r,
|
|
654
|
+
children: a.map((e, t) => {
|
|
655
|
+
let n = [];
|
|
656
|
+
return t > 0 && n.push(A(P, {}, `divider-${t}`)), n.push(A(z, {
|
|
657
|
+
sx: me,
|
|
658
|
+
children: e.header
|
|
659
|
+
}, `header-${t}`)), e.options.map((e) => n.push(A(B, {
|
|
660
|
+
sx: he,
|
|
661
|
+
value: e.value,
|
|
662
|
+
children: e.label
|
|
663
|
+
}, e.value))), n;
|
|
664
|
+
})
|
|
665
|
+
})
|
|
666
|
+
})
|
|
667
|
+
});
|
|
668
|
+
});
|
|
669
|
+
Me.displayName = "TimePeriodOption";
|
|
670
|
+
var Ne = b((e) => {
|
|
671
|
+
let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = g(), o = t?.top ?? !0, s = t?.limit ?? 10, c = t?.percent ?? !1;
|
|
672
|
+
return j(M, {
|
|
673
|
+
...i,
|
|
674
|
+
sx: {
|
|
675
|
+
display: "flex",
|
|
676
|
+
flexDirection: "row",
|
|
677
|
+
gap: .25,
|
|
678
|
+
...i?.sx
|
|
679
|
+
},
|
|
680
|
+
children: [
|
|
681
|
+
A(F, {
|
|
682
|
+
size: "small",
|
|
683
|
+
sx: { flex: 1 },
|
|
684
|
+
children: j(H, {
|
|
685
|
+
value: o ? "top" : "bottom",
|
|
686
|
+
sx: { backgroundColor: "background.paper" },
|
|
687
|
+
IconComponent: (e) => A(d, {
|
|
688
|
+
iconKey: "ExpandMore",
|
|
689
|
+
...e
|
|
690
|
+
}),
|
|
691
|
+
onChange: (e) => n({
|
|
692
|
+
...t,
|
|
693
|
+
top: e.target.value === "top"
|
|
694
|
+
}),
|
|
695
|
+
disabled: r,
|
|
696
|
+
children: [A(B, {
|
|
697
|
+
value: "top",
|
|
698
|
+
children: a("condition.top")
|
|
699
|
+
}), A(B, {
|
|
700
|
+
value: "bottom",
|
|
701
|
+
children: a("condition.bottom")
|
|
702
|
+
})]
|
|
703
|
+
})
|
|
704
|
+
}),
|
|
705
|
+
A(U, {
|
|
706
|
+
size: "small",
|
|
707
|
+
placeholder: "10",
|
|
708
|
+
value: s,
|
|
709
|
+
onChange: (e) => {
|
|
710
|
+
let r = parseFloat(e.target.value) || 10;
|
|
711
|
+
n({
|
|
712
|
+
...t,
|
|
713
|
+
limit: r
|
|
714
|
+
});
|
|
715
|
+
},
|
|
716
|
+
disabled: r,
|
|
717
|
+
type: "number",
|
|
718
|
+
slotProps: { input: { sx: { backgroundColor: "background.paper" } } },
|
|
719
|
+
sx: { flex: .6 }
|
|
720
|
+
}),
|
|
721
|
+
A(F, {
|
|
722
|
+
size: "small",
|
|
723
|
+
sx: { flex: 1 },
|
|
724
|
+
children: j(H, {
|
|
725
|
+
value: c ? "percent" : "items",
|
|
726
|
+
sx: { backgroundColor: "background.paper" },
|
|
727
|
+
IconComponent: (e) => A(d, {
|
|
728
|
+
iconKey: "ExpandMore",
|
|
729
|
+
...e
|
|
730
|
+
}),
|
|
731
|
+
onChange: (e) => n({
|
|
732
|
+
...t,
|
|
733
|
+
percent: e.target.value === "percent"
|
|
734
|
+
}),
|
|
735
|
+
disabled: r,
|
|
736
|
+
children: [A(B, {
|
|
737
|
+
value: "items",
|
|
738
|
+
children: a("condition.items")
|
|
739
|
+
}), A(B, {
|
|
740
|
+
value: "percent",
|
|
741
|
+
children: a("condition.percent")
|
|
742
|
+
})]
|
|
743
|
+
})
|
|
744
|
+
})
|
|
745
|
+
]
|
|
746
|
+
});
|
|
747
|
+
});
|
|
748
|
+
Ne.displayName = "TopNOption";
|
|
749
|
+
var Pe = b((e) => {
|
|
750
|
+
let { option: t, onOptionChange: n, selector: r, readOnly: i, ...a } = e, s = g(), c = ((e) => {
|
|
751
|
+
switch (e?.getName()) {
|
|
752
|
+
case o.BuiltInSelectorNames.Date: return "date";
|
|
753
|
+
case o.BuiltInSelectorNames.Time: return "time";
|
|
754
|
+
case o.BuiltInSelectorNames.DateTime: return "dateTime";
|
|
755
|
+
default: return;
|
|
756
|
+
}
|
|
757
|
+
})(r);
|
|
758
|
+
return j(M, {
|
|
759
|
+
...a,
|
|
760
|
+
sx: {
|
|
761
|
+
display: "flex",
|
|
762
|
+
flexDirection: "row",
|
|
763
|
+
gap: .25,
|
|
764
|
+
...a?.sx
|
|
765
|
+
},
|
|
766
|
+
children: [A(Z, {
|
|
767
|
+
option: t?.from ?? null,
|
|
768
|
+
literal: c,
|
|
769
|
+
placeholder: s("condition.from"),
|
|
770
|
+
onOptionChange: (e) => {
|
|
771
|
+
n({
|
|
772
|
+
...t,
|
|
773
|
+
from: e
|
|
774
|
+
});
|
|
775
|
+
},
|
|
776
|
+
readOnly: i,
|
|
777
|
+
sx: {
|
|
778
|
+
flex: .6,
|
|
779
|
+
minWidth: 0
|
|
780
|
+
}
|
|
781
|
+
}), A(Z, {
|
|
782
|
+
option: t?.to ?? null,
|
|
783
|
+
literal: c,
|
|
784
|
+
placeholder: s("condition.to"),
|
|
785
|
+
onOptionChange: (e) => {
|
|
786
|
+
n({
|
|
787
|
+
...t,
|
|
788
|
+
to: e
|
|
789
|
+
});
|
|
790
|
+
},
|
|
791
|
+
readOnly: i,
|
|
792
|
+
sx: {
|
|
793
|
+
flex: .6,
|
|
794
|
+
minWidth: 0
|
|
795
|
+
}
|
|
796
|
+
})]
|
|
797
|
+
});
|
|
798
|
+
});
|
|
799
|
+
Pe.displayName = "BetweenOption";
|
|
800
|
+
var Fe = b((e) => {
|
|
801
|
+
let { option: r, onOptionChange: i, readOnly: a, ...o } = e, s = g(), c = we(), l = T(null), u = r?.isIFormula ? c.display(r) : r ?? "";
|
|
802
|
+
return n(() => !l.current?.error), A(t, {
|
|
803
|
+
size: "small",
|
|
804
|
+
home: c.home,
|
|
805
|
+
value: u,
|
|
806
|
+
apiRef: l,
|
|
807
|
+
onChangeText: (e) => {
|
|
808
|
+
let t = e.trim();
|
|
809
|
+
if (t.length === 0) return void i("");
|
|
810
|
+
if (!t.startsWith("=")) return;
|
|
811
|
+
let n = t.substring(1);
|
|
812
|
+
i(n.trim().length > 0 ? c.compile(n) : "");
|
|
813
|
+
},
|
|
814
|
+
placeholder: s("condition.enterFormula"),
|
|
815
|
+
disabled: a,
|
|
816
|
+
fullWidth: !0,
|
|
817
|
+
equals: "required",
|
|
818
|
+
label: null,
|
|
819
|
+
showError: !1,
|
|
820
|
+
helperText: null,
|
|
821
|
+
...o
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
Fe.displayName = "ExpressionOption";
|
|
825
|
+
var Ie = "\0blank", Le = (e) => typeof e == "string" ? "s:" + e.toLowerCase() : typeof e + ":" + String(e), Re = (e, t) => t ? e.text : Le(e.value), ze = (e) => {
|
|
826
|
+
let t = e?.[0]?.runs;
|
|
827
|
+
return t && t.length > 0 ? t[t.length - 1].max : -1;
|
|
828
|
+
}, Be = (e, t, n) => {
|
|
829
|
+
let r = e.items, i = (e) => t.has(Re(r[e], n)), { groups: a, leafItems: o } = ((e, t, n) => {
|
|
830
|
+
let r = [], i = [];
|
|
831
|
+
if (!t || t.length === 0) return {
|
|
832
|
+
groups: r,
|
|
833
|
+
leafItems: i
|
|
834
|
+
};
|
|
835
|
+
let a = (e, o, s) => {
|
|
836
|
+
let c = t[e].runs;
|
|
837
|
+
for (let l = 0; l < c.length; l++) {
|
|
838
|
+
let u = c[l];
|
|
839
|
+
if (u.max < o) continue;
|
|
840
|
+
if (u.min > s) break;
|
|
841
|
+
let d = !1, f = !0;
|
|
842
|
+
for (let e = u.min; e <= u.max; e++) n(e) ? d = !0 : f = !1;
|
|
843
|
+
if (f && u.value) r.push(u.value);
|
|
844
|
+
else if (d && e + 1 < t.length) a(e + 1, u.min, u.max);
|
|
845
|
+
else if (d) for (let e = u.min; e <= u.max; e++) n(e) && i.push(e);
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
return a(0, 0, ze(t)), {
|
|
849
|
+
groups: r,
|
|
850
|
+
leafItems: i
|
|
851
|
+
};
|
|
852
|
+
})(0, e.dates, i), s = [], c = (e) => {
|
|
853
|
+
s.push(n ? r[e].text : r[e].value);
|
|
854
|
+
};
|
|
855
|
+
for (let e = 0; e < o.length; e++) c(o[e]);
|
|
856
|
+
for (let t = ze(e.dates) + 1; t < r.length; t++) i(t) && c(t);
|
|
857
|
+
let l = { items: s };
|
|
858
|
+
return a.length > 0 && (l.dateGroups = a), e.hasBlanks && t.has(Ie) && (l.blank = !0), l;
|
|
859
|
+
}, Ve = o.BuiltInSelectorNames.Display, He = b((e) => {
|
|
860
|
+
let { onOptionChange: t, getItems: n, selector: r, onSelectorChange: i, ignoreBlank: a = !1, readOnly: o, sx: s, propsChecklist: c } = e, { onWholeChange: u, ...d } = c ?? {}, f = g(), p = r?.getName() === Ve, [m, h] = E(null), [_, v] = E(() => /* @__PURE__ */ new Set()), y = T(null), b = T(t);
|
|
861
|
+
b.current = t;
|
|
862
|
+
let S = T(u);
|
|
863
|
+
S.current = u, C(() => {
|
|
864
|
+
let e = !0;
|
|
865
|
+
return n({ selector: p ? Ve : null }).then((t) => {
|
|
866
|
+
if (!e) return;
|
|
867
|
+
let n = y.current;
|
|
868
|
+
y.current = null;
|
|
869
|
+
let r = /* @__PURE__ */ new Set();
|
|
870
|
+
for (let e of t.items) (n ? n.values.has(Le(e.value)) || n.texts.has(e.text) : e.checked) && r.add(Re(e, p));
|
|
871
|
+
t.hasBlanks && (n ? n.blank : t.blanksChecked) && r.add(Ie), h(t), v(r);
|
|
872
|
+
}), () => {
|
|
873
|
+
e = !1;
|
|
874
|
+
};
|
|
875
|
+
}, [n, p]), C(() => {
|
|
876
|
+
if (!m) return;
|
|
877
|
+
b.current(Be(m, _, p));
|
|
878
|
+
let e = !m.truncated;
|
|
879
|
+
for (let t = 0; e && t < m.items.length; t++) e = _.has(Re(m.items[t], p));
|
|
880
|
+
let t = !m.hasBlanks || a || _.has(Ie);
|
|
881
|
+
S.current?.(e, t);
|
|
882
|
+
}, [
|
|
883
|
+
m,
|
|
884
|
+
_,
|
|
885
|
+
p,
|
|
886
|
+
a
|
|
887
|
+
]);
|
|
888
|
+
let D = w(() => {
|
|
889
|
+
if (!m) return [];
|
|
890
|
+
let e = ((e, t, n) => {
|
|
891
|
+
let r = /* @__PURE__ */ new Map();
|
|
892
|
+
for (let t of e) {
|
|
893
|
+
let e = t.text.trim();
|
|
894
|
+
r.set(e, (r.get(e) ?? 0) + 1);
|
|
895
|
+
}
|
|
896
|
+
return e.map((e) => {
|
|
897
|
+
if (!t && typeof (i = e.value) == "string" && i.length > 0 && /^ +$/.test(i)) return n("checklist.spaces", { count: e.value.length });
|
|
898
|
+
var i;
|
|
899
|
+
let a = e.text, o = a.trim();
|
|
900
|
+
return a === o || (r.get(o) ?? 0) < 2 ? a : a.replace(/^ +| +$/g, (e) => "␣".repeat(e.length));
|
|
901
|
+
});
|
|
902
|
+
})(m.items, p, f), t = m.items.map((t, n) => ({
|
|
903
|
+
text: e[n],
|
|
904
|
+
value: t.value,
|
|
905
|
+
count: t.count,
|
|
906
|
+
key: Re(t, p)
|
|
907
|
+
}));
|
|
908
|
+
return m.hasBlanks && !a && t.push({
|
|
909
|
+
text: f("checklist.blank"),
|
|
910
|
+
value: null,
|
|
911
|
+
key: Ie,
|
|
912
|
+
blank: !0
|
|
913
|
+
}), t;
|
|
914
|
+
}, [
|
|
915
|
+
m,
|
|
916
|
+
p,
|
|
917
|
+
a,
|
|
918
|
+
f
|
|
919
|
+
]), O = x((e, t) => {
|
|
920
|
+
o || v((n) => {
|
|
921
|
+
let r = new Set(n);
|
|
922
|
+
for (let n of e) t ? r.add(n) : r.delete(n);
|
|
923
|
+
return r;
|
|
924
|
+
});
|
|
925
|
+
}, [o]), k = x((e) => {
|
|
926
|
+
if (o || !m || !i || e === p) return;
|
|
927
|
+
let t = {
|
|
928
|
+
values: /* @__PURE__ */ new Set(),
|
|
929
|
+
texts: /* @__PURE__ */ new Set(),
|
|
930
|
+
blank: _.has(Ie)
|
|
931
|
+
};
|
|
932
|
+
for (let e of m.items) _.has(Re(e, p)) && (t.values.add(Le(e.value)), t.texts.add(e.text));
|
|
933
|
+
y.current = t, i(e ? Ve : null);
|
|
934
|
+
}, [
|
|
935
|
+
o,
|
|
936
|
+
m,
|
|
937
|
+
_,
|
|
938
|
+
p,
|
|
939
|
+
i
|
|
940
|
+
]);
|
|
941
|
+
return A(M, {
|
|
942
|
+
sx: {
|
|
943
|
+
display: "flex",
|
|
944
|
+
flexDirection: "column",
|
|
945
|
+
minWidth: 0,
|
|
946
|
+
typography: "body2",
|
|
947
|
+
...s
|
|
948
|
+
},
|
|
949
|
+
children: A(l, {
|
|
950
|
+
items: D,
|
|
951
|
+
dates: m?.dates,
|
|
952
|
+
checked: _,
|
|
953
|
+
onCheckedChange: O,
|
|
954
|
+
byDisplay: p,
|
|
955
|
+
onByDisplayChange: i ? k : void 0,
|
|
956
|
+
truncated: m?.truncated ?? !1,
|
|
957
|
+
style: {
|
|
958
|
+
minHeight: 220,
|
|
959
|
+
maxHeight: 260
|
|
960
|
+
},
|
|
961
|
+
...d
|
|
962
|
+
})
|
|
963
|
+
});
|
|
964
|
+
});
|
|
965
|
+
He.displayName = "SnapshotMembership";
|
|
966
|
+
var Ue = (e) => e == null ? "" : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : String(e), We = b((e) => {
|
|
967
|
+
let { option: n, onOptionChange: r, ignoreBlank: i = !1, readOnly: o, sx: s, propsChecklist: l } = e, d = g(), f = u(), p = S(xe), m = we(), h = c(f?.getWorkbook()?.getLocale() ?? "en").listSeparator, _ = n?.items, v = n?.source, y = n?.additions, b = n?.subtractions, D = n?.blank, O = v != null && v !== "", k = w(() => {
|
|
968
|
+
let e = [];
|
|
969
|
+
if (Array.isArray(_)) for (let t = 0; t < _.length; t++) {
|
|
970
|
+
let n = Ue(_[t]);
|
|
971
|
+
n.length > 0 && e.push(n);
|
|
972
|
+
}
|
|
973
|
+
if (y) for (let t = 0; t < y.length; t++) e.push(y[t]);
|
|
974
|
+
return e;
|
|
975
|
+
}, [_, y]), [N, P] = E(null), F = T(0);
|
|
976
|
+
C(() => {
|
|
977
|
+
if (!p?.getListItemsAt || !f) return void P(null);
|
|
978
|
+
let e = ++F.current, { rowIndex: t, colIndex: n } = Se(f);
|
|
979
|
+
p.getListItemsAt(t, n).then((t) => {
|
|
980
|
+
e === F.current && P(t);
|
|
981
|
+
}, () => {
|
|
982
|
+
e === F.current && P([]);
|
|
983
|
+
});
|
|
984
|
+
}, [
|
|
985
|
+
p,
|
|
986
|
+
f,
|
|
987
|
+
_,
|
|
988
|
+
v,
|
|
989
|
+
y,
|
|
990
|
+
b,
|
|
991
|
+
D
|
|
992
|
+
]);
|
|
993
|
+
let I = w(() => {
|
|
994
|
+
let e = [];
|
|
995
|
+
if (N) {
|
|
996
|
+
for (let t = 0; t < N.length; t++) {
|
|
997
|
+
let n = N[t];
|
|
998
|
+
n.value === null ? i || e.push({ text: d("checklist.blank") }) : e.push({ text: n.text });
|
|
999
|
+
}
|
|
1000
|
+
return e;
|
|
1001
|
+
}
|
|
1002
|
+
for (let t = 0; t < k.length; t++) e.push({ text: k[t] });
|
|
1003
|
+
return D && !i && e.push({ text: d("checklist.blank") }), e;
|
|
1004
|
+
}, [
|
|
1005
|
+
N,
|
|
1006
|
+
k,
|
|
1007
|
+
D,
|
|
1008
|
+
i,
|
|
1009
|
+
d
|
|
1010
|
+
]), [R, z] = E(null), [B, V] = E(null), H = x((e) => {
|
|
1011
|
+
let { source: t, items: i, additions: o, subtractions: s, ...c } = n ?? {}, l = e.trim();
|
|
1012
|
+
if (l.startsWith("=")) {
|
|
1013
|
+
let e = l.substring(1).trim();
|
|
1014
|
+
if (e.length === 0) return void z(null);
|
|
1015
|
+
let t = m.compile(e), n = typeof t == "string" ? t : t.getExpression();
|
|
1016
|
+
typeof t != "string" && ((e) => {
|
|
1017
|
+
let t = e;
|
|
1018
|
+
for (; t?.type === "paren" && t.inputs?.length === 1;) t = t.inputs[0];
|
|
1019
|
+
return t?.type === "list" || t?.type === "paren" && (t.inputs?.length ?? 0) > 1;
|
|
1020
|
+
})(a.parse(n)) ? z(G("condition.listSourceOneRange")) : (z(null), r({
|
|
1021
|
+
...c,
|
|
1022
|
+
source: n
|
|
1023
|
+
}));
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
let u = l.length === 0 ? [] : l.split(h).map((e) => e.trim()).filter((e) => e.length > 0);
|
|
1027
|
+
u.some((e) => e.includes(",")) ? z(G("condition.listItemHasComma")) : (z(null), r(u.length > 0 ? {
|
|
1028
|
+
...c,
|
|
1029
|
+
additions: u
|
|
1030
|
+
} : c));
|
|
1031
|
+
}, [
|
|
1032
|
+
n,
|
|
1033
|
+
r,
|
|
1034
|
+
m,
|
|
1035
|
+
h
|
|
1036
|
+
]), U = w(() => O ? "=" + (v.isIFormula ? m.display(v) : v) : k.join(h + " "), [
|
|
1037
|
+
O,
|
|
1038
|
+
v,
|
|
1039
|
+
m,
|
|
1040
|
+
k,
|
|
1041
|
+
h
|
|
1042
|
+
]), W = B ?? R, { viewport: ee, itemHeight: ie } = l ?? {}, ae = ie ?? 24, [q, oe] = E(""), J = w(() => q ? re(I, q) : I, [I, q]);
|
|
1043
|
+
return j(M, {
|
|
1044
|
+
sx: {
|
|
1045
|
+
display: "flex",
|
|
1046
|
+
flexDirection: "column",
|
|
1047
|
+
minWidth: 0,
|
|
1048
|
+
gap: 1,
|
|
1049
|
+
typography: "body2",
|
|
1050
|
+
...s
|
|
1051
|
+
},
|
|
1052
|
+
children: [
|
|
1053
|
+
A(t, {
|
|
1054
|
+
size: "small",
|
|
1055
|
+
home: m.home,
|
|
1056
|
+
value: U,
|
|
1057
|
+
onChangeText: H,
|
|
1058
|
+
label: null,
|
|
1059
|
+
placeholder: d("condition.enterListSource"),
|
|
1060
|
+
disabled: o,
|
|
1061
|
+
fullWidth: !0,
|
|
1062
|
+
equals: "literal",
|
|
1063
|
+
pickAs: "absolute",
|
|
1064
|
+
allowMulti: !1,
|
|
1065
|
+
validationError: R,
|
|
1066
|
+
onChangeError: V,
|
|
1067
|
+
showError: !1,
|
|
1068
|
+
helperText: null
|
|
1069
|
+
}),
|
|
1070
|
+
W && A(L, {
|
|
1071
|
+
error: !0,
|
|
1072
|
+
sx: { mt: -.5 },
|
|
1073
|
+
children: d(W)
|
|
1074
|
+
}),
|
|
1075
|
+
j(M, {
|
|
1076
|
+
className: "list-preview",
|
|
1077
|
+
sx: {
|
|
1078
|
+
display: "flex",
|
|
1079
|
+
flexDirection: "column",
|
|
1080
|
+
gap: .5,
|
|
1081
|
+
minWidth: 0
|
|
1082
|
+
},
|
|
1083
|
+
children: [A(ne, {
|
|
1084
|
+
value: q,
|
|
1085
|
+
onChange: oe,
|
|
1086
|
+
placeholder: d("condition.listPreviewSearch"),
|
|
1087
|
+
clearLabel: d("condition.listPreviewClearSearch"),
|
|
1088
|
+
trailing: A(M, {
|
|
1089
|
+
component: "span",
|
|
1090
|
+
className: "list-preview-count",
|
|
1091
|
+
sx: {
|
|
1092
|
+
flex: "0 0 auto",
|
|
1093
|
+
fontSize: 12,
|
|
1094
|
+
opacity: .75,
|
|
1095
|
+
whiteSpace: "nowrap"
|
|
1096
|
+
},
|
|
1097
|
+
children: q ? d("checklist.countFiltered", {
|
|
1098
|
+
checked: J.length,
|
|
1099
|
+
total: I.length
|
|
1100
|
+
}) : d("condition.listItems", { count: I.length })
|
|
1101
|
+
})
|
|
1102
|
+
}), A(M, {
|
|
1103
|
+
sx: {
|
|
1104
|
+
display: "flex",
|
|
1105
|
+
flexDirection: "column",
|
|
1106
|
+
border: "1px solid var(--sxl-color-base-300, light-dark(rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.16)))",
|
|
1107
|
+
borderRadius: "4px",
|
|
1108
|
+
overflow: "hidden",
|
|
1109
|
+
minWidth: 0,
|
|
1110
|
+
height: 6 * ae + 2
|
|
1111
|
+
},
|
|
1112
|
+
children: J.length === 0 ? A(te, {
|
|
1113
|
+
variant: "body2",
|
|
1114
|
+
color: "text.disabled",
|
|
1115
|
+
sx: {
|
|
1116
|
+
flex: 1,
|
|
1117
|
+
display: "flex",
|
|
1118
|
+
alignItems: "center",
|
|
1119
|
+
justifyContent: "center",
|
|
1120
|
+
px: 1
|
|
1121
|
+
},
|
|
1122
|
+
children: d(q ? "condition.listPreviewNoMatch" : "condition.listPreviewEmpty")
|
|
1123
|
+
}) : A(K, {
|
|
1124
|
+
items: J,
|
|
1125
|
+
itemHeight: ie,
|
|
1126
|
+
viewport: ee,
|
|
1127
|
+
visibleRows: 6,
|
|
1128
|
+
style: { minWidth: "100%" }
|
|
1129
|
+
})
|
|
1130
|
+
})]
|
|
1131
|
+
})
|
|
1132
|
+
]
|
|
1133
|
+
});
|
|
1134
|
+
});
|
|
1135
|
+
We.displayName = "AuthoredMembership";
|
|
1136
|
+
var Ge = b((e) => {
|
|
1137
|
+
let t = e.getItems;
|
|
1138
|
+
return t ? A(He, {
|
|
1139
|
+
...e,
|
|
1140
|
+
getItems: t
|
|
1141
|
+
}) : A(We, { ...e });
|
|
1142
|
+
});
|
|
1143
|
+
Ge.displayName = "MembershipOption";
|
|
1144
|
+
var Q = o.BuiltInOperatorNames, Ke = /* @__PURE__ */ new Set([
|
|
1145
|
+
Q.EqualTo,
|
|
1146
|
+
Q.GreaterThan,
|
|
1147
|
+
Q.GreaterThanEqualTo,
|
|
1148
|
+
Q.LessThan,
|
|
1149
|
+
Q.LessThanEqualTo,
|
|
1150
|
+
Q.After,
|
|
1151
|
+
Q.AfterEqualTo,
|
|
1152
|
+
Q.Before,
|
|
1153
|
+
Q.BeforeEqualTo
|
|
1154
|
+
]), qe = b((e) => {
|
|
1155
|
+
let { operatorParam: t, onOperatorParamChange: n, onRemove: r, renderRemove: i, operators: a, selector: s, onSelectorChange: c, getItems: l, propsChecklist: u, ignoreBlank: f, operatorTitle: m, operatorFixed: _ = !1, readOnly: v, required: y, ...b } = e, x = g(), S = m ?? x("condition.when"), C = t?.operator ?? null, T = () => v || y || i === null ? null : i ? i({
|
|
1156
|
+
onClick: r,
|
|
1157
|
+
operator: C,
|
|
1158
|
+
readOnly: v
|
|
1159
|
+
}) : A(D, {
|
|
1160
|
+
icon: A(d, { iconKey: "Close" }),
|
|
1161
|
+
onClick: r
|
|
1162
|
+
}), E = a.find((e) => e.getName() === C) ?? null, O = t?.param ?? null, N = !!E?.isCombinator?.(), P = C === o.BuiltInOperatorNames.InSet, [F, { width: I }] = h(), L = w(() => !E || N ? null : E.getParamType?.(s ?? void 0) ?? null, [
|
|
1163
|
+
E,
|
|
1164
|
+
N,
|
|
1165
|
+
s
|
|
1166
|
+
]), R = _ || !N && !P && I > 360, z = p((e) => {
|
|
1167
|
+
n({
|
|
1168
|
+
operator: C,
|
|
1169
|
+
param: e
|
|
1170
|
+
});
|
|
1171
|
+
}, [n, C]), B = w(() => {
|
|
1172
|
+
if (!E || N) return null;
|
|
1173
|
+
let e = {
|
|
1174
|
+
sx: {
|
|
1175
|
+
flex: _ ? 1 : .6,
|
|
1176
|
+
minWidth: 0
|
|
1177
|
+
},
|
|
1178
|
+
option: O,
|
|
1179
|
+
onOptionChange: z
|
|
1180
|
+
};
|
|
1181
|
+
if (P) return A(Ge, {
|
|
1182
|
+
...e,
|
|
1183
|
+
getItems: l,
|
|
1184
|
+
selector: s,
|
|
1185
|
+
onSelectorChange: c,
|
|
1186
|
+
readOnly: v,
|
|
1187
|
+
propsChecklist: u,
|
|
1188
|
+
ignoreBlank: f
|
|
1189
|
+
});
|
|
1190
|
+
if (!L) return null;
|
|
1191
|
+
let t = !!C && Ke.has(C);
|
|
1192
|
+
return L === o.BuiltInSelectorNames.Number || L === o.BuiltInSelectorNames.TextLength ? A(t ? Z : be, { ...e }) : L === o.BuiltInSelectorNames.Whole ? t ? A(Z, { ...e }) : A(be, {
|
|
1193
|
+
...e,
|
|
1194
|
+
placeholder: x("condition.enterWholeNumber"),
|
|
1195
|
+
slotProps: { htmlInput: {
|
|
1196
|
+
step: 1,
|
|
1197
|
+
onKeyDown: (e) => {
|
|
1198
|
+
[
|
|
1199
|
+
".",
|
|
1200
|
+
",",
|
|
1201
|
+
"e",
|
|
1202
|
+
"E"
|
|
1203
|
+
].includes(e.key) && e.preventDefault();
|
|
1204
|
+
},
|
|
1205
|
+
onPaste: (e) => {
|
|
1206
|
+
/^-?\d+$/.test(e.clipboardData.getData("text")) || e.preventDefault();
|
|
1207
|
+
}
|
|
1208
|
+
} }
|
|
1209
|
+
}) : L === o.BuiltInSelectorNames.Text || L === o.BuiltInSelectorNames.Display ? A(t ? Z : ye, { ...e }) : L === o.BuiltInSelectorNames.DateTime ? A(Z, {
|
|
1210
|
+
...e,
|
|
1211
|
+
literal: "dateTime"
|
|
1212
|
+
}) : L === o.BuiltInSelectorNames.Date ? A(Z, {
|
|
1213
|
+
...e,
|
|
1214
|
+
literal: "date"
|
|
1215
|
+
}) : L === o.BuiltInSelectorNames.Time ? A(Z, {
|
|
1216
|
+
...e,
|
|
1217
|
+
literal: "time"
|
|
1218
|
+
}) : L === o.BuiltInSelectorNames.Logical ? A(ke, { ...e }) : L === o.BuiltInOperatorNames.Average ? A(je, { ...e }) : L === o.BuiltInOperatorNames.TimePeriod ? A(Me, { ...e }) : L === o.BuiltInOperatorNames.TopN ? A(Ne, { ...e }) : L === o.BuiltInOperatorNames.Between ? A(Pe, {
|
|
1219
|
+
...e,
|
|
1220
|
+
selector: s
|
|
1221
|
+
}) : L === o.BuiltInOperatorNames.Expression ? A(Fe, { ...e }) : null;
|
|
1222
|
+
}, [
|
|
1223
|
+
E,
|
|
1224
|
+
N,
|
|
1225
|
+
P,
|
|
1226
|
+
l,
|
|
1227
|
+
u,
|
|
1228
|
+
f,
|
|
1229
|
+
v,
|
|
1230
|
+
L,
|
|
1231
|
+
O,
|
|
1232
|
+
s,
|
|
1233
|
+
c,
|
|
1234
|
+
_,
|
|
1235
|
+
x
|
|
1236
|
+
]), V = w(() => N && O ? Array.isArray(O) ? O : [O] : [], [N, O]), H = N && E?.getName() === "not", U = (e) => {
|
|
1237
|
+
if (!e || e === E) return;
|
|
1238
|
+
let t = !!e.isCombinator?.(), r;
|
|
1239
|
+
if (t && N) r = e.getName() === "not" ? V[0] ?? X(e, a, s) : V.length > 0 ? V : X(e, a, s);
|
|
1240
|
+
else {
|
|
1241
|
+
let n = E?.getParamType?.(s ?? void 0) ?? null, i = e.getParamType?.(s ?? void 0) ?? null;
|
|
1242
|
+
r = t || N || !i || i !== n ? X(e, a, s) : O;
|
|
1243
|
+
}
|
|
1244
|
+
n({
|
|
1245
|
+
operator: e?.getName() ?? null,
|
|
1246
|
+
param: r
|
|
1247
|
+
});
|
|
1248
|
+
};
|
|
1249
|
+
return A(M, {
|
|
1250
|
+
ref: F,
|
|
1251
|
+
sx: {
|
|
1252
|
+
display: "flex",
|
|
1253
|
+
flexDirection: "column",
|
|
1254
|
+
gap: .5,
|
|
1255
|
+
backgroundColor: "background.paper",
|
|
1256
|
+
border: 1,
|
|
1257
|
+
borderColor: "divider",
|
|
1258
|
+
borderRadius: 1,
|
|
1259
|
+
p: 1
|
|
1260
|
+
},
|
|
1261
|
+
...b,
|
|
1262
|
+
children: R ? j(M, {
|
|
1263
|
+
sx: {
|
|
1264
|
+
display: "flex",
|
|
1265
|
+
flexDirection: "row",
|
|
1266
|
+
alignItems: "center",
|
|
1267
|
+
gap: .5
|
|
1268
|
+
},
|
|
1269
|
+
children: [
|
|
1270
|
+
_ ? null : A(_e, {
|
|
1271
|
+
title: S,
|
|
1272
|
+
sx: { flex: .4 },
|
|
1273
|
+
value: E,
|
|
1274
|
+
operators: a,
|
|
1275
|
+
onChange: U,
|
|
1276
|
+
readOnly: v
|
|
1277
|
+
}),
|
|
1278
|
+
B,
|
|
1279
|
+
T()
|
|
1280
|
+
]
|
|
1281
|
+
}) : j(k, { children: [j(M, {
|
|
1282
|
+
sx: {
|
|
1283
|
+
display: "flex",
|
|
1284
|
+
flexDirection: "row",
|
|
1285
|
+
alignItems: "center",
|
|
1286
|
+
gap: .5
|
|
1287
|
+
},
|
|
1288
|
+
children: [
|
|
1289
|
+
A(_e, {
|
|
1290
|
+
title: S,
|
|
1291
|
+
sx: { flex: 1 },
|
|
1292
|
+
value: E,
|
|
1293
|
+
operators: a,
|
|
1294
|
+
onChange: U,
|
|
1295
|
+
readOnly: v
|
|
1296
|
+
}),
|
|
1297
|
+
N && !H && !v && A(ge, {
|
|
1298
|
+
label: E?.getTitle?.(),
|
|
1299
|
+
icon: A(d, { iconKey: "Add" }),
|
|
1300
|
+
operators: a,
|
|
1301
|
+
value: null,
|
|
1302
|
+
onChange: (e) => {
|
|
1303
|
+
if (!e) return;
|
|
1304
|
+
let t = X(e, a, s), r = [...V, {
|
|
1305
|
+
operator: e?.getName() ?? null,
|
|
1306
|
+
param: t
|
|
1307
|
+
}];
|
|
1308
|
+
n({
|
|
1309
|
+
operator: C,
|
|
1310
|
+
param: r
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
}),
|
|
1314
|
+
T()
|
|
1315
|
+
]
|
|
1316
|
+
}), N ? A(ve, {
|
|
1317
|
+
operator: E,
|
|
1318
|
+
inputs: V,
|
|
1319
|
+
onOptionChange: (e) => {
|
|
1320
|
+
n({
|
|
1321
|
+
operator: C,
|
|
1322
|
+
param: H ? e[0] ?? null : e
|
|
1323
|
+
});
|
|
1324
|
+
},
|
|
1325
|
+
operators: a,
|
|
1326
|
+
selector: s,
|
|
1327
|
+
getItems: l,
|
|
1328
|
+
propsChecklist: u,
|
|
1329
|
+
ignoreBlank: f,
|
|
1330
|
+
readOnly: v
|
|
1331
|
+
}) : B] })
|
|
1332
|
+
});
|
|
1333
|
+
});
|
|
1334
|
+
qe.displayName = "OperatorAndParamEditor";
|
|
1335
|
+
var Je = {
|
|
1336
|
+
backgroundColor: "action.hover",
|
|
1337
|
+
border: 1,
|
|
1338
|
+
borderColor: "divider",
|
|
1339
|
+
borderRadius: 1
|
|
1340
|
+
}, $ = "formula", Ye = b((e) => {
|
|
1341
|
+
let { condition: t, onConditionChange: n, showIncludeBlanks: i = !0, qualifiers: a, selectorTitle: s, readOnly: c, operators: l, selectors: u, ranges: d, getItems: f, propsChecklist: p, showSelector: h = !0, operatorTitle: _, renderRemove: v, sx: y, ...b } = e, x = g(), S = m(), [D, O] = E(() => t?.getSelector() ?? null), [k, P] = E(() => t?.getOperator() ? {
|
|
1342
|
+
operator: t.getOperator().getName(),
|
|
1343
|
+
param: t.getParam()
|
|
1344
|
+
} : null), [F, L] = E(() => t?.isIncludeBlanks() ?? !1);
|
|
1345
|
+
C(() => {
|
|
1346
|
+
if (!t) return O(null), void P(null);
|
|
1347
|
+
let e = t.getOperator(), n = t.getSelector() ?? null;
|
|
1348
|
+
O(n), P(e ? {
|
|
1349
|
+
operator: e.getName(),
|
|
1350
|
+
param: t.getParam()
|
|
1351
|
+
} : null), L(t.isIncludeBlanks());
|
|
1352
|
+
}, [t]);
|
|
1353
|
+
let R = w(() => (u ?? Object.values(r.BuiltInSelectors)).slice().sort((e, t) => (e.getTitle?.() ?? "").localeCompare(t.getTitle?.() ?? "", S)), [u, S]), z = w(() => l ?? Object.values(r.BuiltInOperators), [l]), B = w(() => z.find((e) => e.getName() === o.BuiltInOperatorNames.Expression) ?? null, [z]), V = h && !!B, H = V && k?.operator === o.BuiltInOperatorNames.Expression, U = w(() => {
|
|
1354
|
+
if (l) return null;
|
|
1355
|
+
let e = z.find((e) => e.getName() === o.BuiltInOperatorNames.InSet);
|
|
1356
|
+
return e ? (t = Object.create(e), le.add(t), t) : null;
|
|
1357
|
+
var t;
|
|
1358
|
+
}, [z, l]), W = w(() => {
|
|
1359
|
+
let e = fe(h ? D : null, z, S, l ? [] : void 0);
|
|
1360
|
+
if (f) {
|
|
1361
|
+
let t = z.find((e) => e.getName() === o.BuiltInOperatorNames.InSet);
|
|
1362
|
+
t && !e.includes(t) && e.unshift(t);
|
|
1363
|
+
}
|
|
1364
|
+
if (U && !D) {
|
|
1365
|
+
let t = e.findIndex((e) => e.getName() === o.BuiltInOperatorNames.InSet);
|
|
1366
|
+
t >= 0 && e.splice(t, 1, U);
|
|
1367
|
+
}
|
|
1368
|
+
return e;
|
|
1369
|
+
}, [
|
|
1370
|
+
D,
|
|
1371
|
+
z,
|
|
1372
|
+
S,
|
|
1373
|
+
l,
|
|
1374
|
+
f,
|
|
1375
|
+
h,
|
|
1376
|
+
U
|
|
1377
|
+
]), ee = w(() => V ? W.filter((e) => e.getName() !== o.BuiltInOperatorNames.Expression) : W, [W, V]), te = T(/* @__PURE__ */ new Map()), G = (e) => e?.getName() ?? "", ne = T(null), K = T(!1);
|
|
1378
|
+
C(() => {
|
|
1379
|
+
if (!K.current) return;
|
|
1380
|
+
K.current = !1;
|
|
1381
|
+
let e = Array.from(ne.current?.querySelectorAll("input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"hidden\"]):not([tabindex=\"-1\"]), textarea") ?? []).find((e) => !e.disabled && !e.readOnly && e.getAttribute("aria-hidden") !== "true");
|
|
1382
|
+
e && (e.focus(), e.select());
|
|
1383
|
+
}, [D, k]);
|
|
1384
|
+
let re = (e) => {
|
|
1385
|
+
let t = z.find((t) => t.getName() === e.operator) ?? null, r = h || !D || !t || ((e, t) => {
|
|
1386
|
+
if (!e) return !0;
|
|
1387
|
+
let n = t.getName();
|
|
1388
|
+
if (n === o.BuiltInOperatorNames.Blank) return !0;
|
|
1389
|
+
if (e.getName() === o.BuiltInSelectorNames.Display && ce.has(n)) return !1;
|
|
1390
|
+
let r = t.getAcceptsTypes?.();
|
|
1391
|
+
return !r || r.includes(e.getSelectType() ?? null);
|
|
1392
|
+
})(D, t) ? D : null;
|
|
1393
|
+
r !== D && O(r), P(e), n?.({
|
|
1394
|
+
selector: r,
|
|
1395
|
+
...e,
|
|
1396
|
+
includeBlanks: F
|
|
1397
|
+
});
|
|
1398
|
+
};
|
|
1399
|
+
return j(M, {
|
|
1400
|
+
sx: [{
|
|
1401
|
+
display: "flex",
|
|
1402
|
+
flexDirection: "column",
|
|
1403
|
+
gap: 1
|
|
1404
|
+
}, ...Array.isArray(y) ? y : [y]],
|
|
1405
|
+
...b,
|
|
1406
|
+
children: [
|
|
1407
|
+
h ? A(ie, {
|
|
1408
|
+
title: s,
|
|
1409
|
+
selectors: R,
|
|
1410
|
+
value: D,
|
|
1411
|
+
onChange: (e, t) => {
|
|
1412
|
+
if (k && te.current.set(H ? $ : G(D), k), t === $ && B) {
|
|
1413
|
+
let e = te.current.get($) ?? {
|
|
1414
|
+
operator: B.getName(),
|
|
1415
|
+
param: B.createDefaultParam?.() ?? ""
|
|
1416
|
+
};
|
|
1417
|
+
O(null), P(e), K.current = !0, n?.({
|
|
1418
|
+
selector: null,
|
|
1419
|
+
...e,
|
|
1420
|
+
includeBlanks: F
|
|
1421
|
+
});
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1424
|
+
let r = ((e) => {
|
|
1425
|
+
let { from: t, to: n, current: r, remembered: i, operators: a, context: o } = e, s = fe(n, a), c = (e) => e && s.find((t) => t.getName() === e) || null;
|
|
1426
|
+
if (i && c(i.operator)) return i;
|
|
1427
|
+
let l = c(r?.operator);
|
|
1428
|
+
if (r && l) {
|
|
1429
|
+
let e = (l.getParamType?.(t ?? void 0) ?? null) !== (l.getParamType?.(n ?? void 0) ?? null);
|
|
1430
|
+
return l.isCombinator?.() || e ? {
|
|
1431
|
+
operator: r.operator,
|
|
1432
|
+
param: X(l, s, n)
|
|
1433
|
+
} : r;
|
|
1434
|
+
}
|
|
1435
|
+
let u = n?.getDefaultCondition?.(o) ?? null, d = c(u?.operator);
|
|
1436
|
+
return u && d ? {
|
|
1437
|
+
operator: u.operator,
|
|
1438
|
+
param: u.param === void 0 ? X(d, s, n) : u.param
|
|
1439
|
+
} : null;
|
|
1440
|
+
})({
|
|
1441
|
+
from: D,
|
|
1442
|
+
to: e,
|
|
1443
|
+
current: H ? null : k,
|
|
1444
|
+
remembered: te.current.get(G(e)) ?? null,
|
|
1445
|
+
operators: z,
|
|
1446
|
+
context: { ranges: d }
|
|
1447
|
+
});
|
|
1448
|
+
O(e), P(r), K.current = !0, n?.({
|
|
1449
|
+
selector: e,
|
|
1450
|
+
...r ?? {
|
|
1451
|
+
operator: null,
|
|
1452
|
+
param: null
|
|
1453
|
+
},
|
|
1454
|
+
includeBlanks: F
|
|
1455
|
+
});
|
|
1456
|
+
},
|
|
1457
|
+
allowNull: !0,
|
|
1458
|
+
readOnly: c,
|
|
1459
|
+
extras: V ? [{
|
|
1460
|
+
value: $,
|
|
1461
|
+
title: B.getTitle?.() ?? $
|
|
1462
|
+
}] : void 0,
|
|
1463
|
+
extraValue: H ? $ : null
|
|
1464
|
+
}) : null,
|
|
1465
|
+
k ? A(M, {
|
|
1466
|
+
ref: ne,
|
|
1467
|
+
sx: { display: "contents" },
|
|
1468
|
+
children: A(qe, {
|
|
1469
|
+
operatorParam: k,
|
|
1470
|
+
onOperatorParamChange: re,
|
|
1471
|
+
onRemove: () => {
|
|
1472
|
+
P(null), n?.({
|
|
1473
|
+
selector: D,
|
|
1474
|
+
operator: null,
|
|
1475
|
+
param: null,
|
|
1476
|
+
includeBlanks: F
|
|
1477
|
+
});
|
|
1478
|
+
},
|
|
1479
|
+
renderRemove: v,
|
|
1480
|
+
operatorTitle: _,
|
|
1481
|
+
operators: H ? W : ee,
|
|
1482
|
+
operatorFixed: H,
|
|
1483
|
+
selector: D,
|
|
1484
|
+
onSelectorChange: (e) => {
|
|
1485
|
+
let t = e ? R.find((t) => t.getName() === e) ?? r.Selectors.get(e) ?? null : null;
|
|
1486
|
+
O(t), n?.({
|
|
1487
|
+
selector: t,
|
|
1488
|
+
...k,
|
|
1489
|
+
includeBlanks: F
|
|
1490
|
+
});
|
|
1491
|
+
},
|
|
1492
|
+
getItems: f,
|
|
1493
|
+
propsChecklist: p,
|
|
1494
|
+
ignoreBlank: F,
|
|
1495
|
+
readOnly: c
|
|
1496
|
+
})
|
|
1497
|
+
}) : !c && A(M, {
|
|
1498
|
+
sx: { display: "flex" },
|
|
1499
|
+
children: A(ge, {
|
|
1500
|
+
label: _ ?? x("condition.when"),
|
|
1501
|
+
operators: ee,
|
|
1502
|
+
value: null,
|
|
1503
|
+
onChange: (e) => {
|
|
1504
|
+
e && (K.current = !0, re({
|
|
1505
|
+
operator: e?.getName() ?? null,
|
|
1506
|
+
param: X(e, W, D, f ? void 0 : { ranges: d })
|
|
1507
|
+
}));
|
|
1508
|
+
},
|
|
1509
|
+
readOnly: c
|
|
1510
|
+
})
|
|
1511
|
+
}),
|
|
1512
|
+
i || a ? j(M, {
|
|
1513
|
+
className: "condition-qualifiers",
|
|
1514
|
+
sx: {
|
|
1515
|
+
display: "flex",
|
|
1516
|
+
flexWrap: "wrap",
|
|
1517
|
+
alignItems: "center",
|
|
1518
|
+
columnGap: 2
|
|
1519
|
+
},
|
|
1520
|
+
children: [i ? A(I, {
|
|
1521
|
+
className: "include-blanks",
|
|
1522
|
+
control: A(N, {
|
|
1523
|
+
size: "small",
|
|
1524
|
+
checked: F,
|
|
1525
|
+
onChange: (e) => {
|
|
1526
|
+
t = e.target.checked, L(t), n?.({
|
|
1527
|
+
selector: D,
|
|
1528
|
+
...k,
|
|
1529
|
+
includeBlanks: t
|
|
1530
|
+
});
|
|
1531
|
+
return;
|
|
1532
|
+
var t;
|
|
1533
|
+
}
|
|
1534
|
+
}),
|
|
1535
|
+
disabled: c,
|
|
1536
|
+
label: x("condition.ignoreBlank")
|
|
1537
|
+
}) : null, a]
|
|
1538
|
+
}) : null
|
|
1539
|
+
]
|
|
1540
|
+
});
|
|
1541
|
+
});
|
|
1542
|
+
Ye.displayName = "ConditionEditor";
|
|
1543
|
+
export { we as a, de as c, xe as i, ue as l, Je as n, se as o, Ge as r, X as s, Ye as t };
|