@adaptabletools/adaptable-cjs 23.0.4 → 23.0.5-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.js +0 -31
- package/index.js +0 -31
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
- package/src/AdaptableOptions/AdaptablePlugin.js +1 -9
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +3 -39
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +44 -16
- package/src/AdaptableState/Aggregations/only.js +0 -11
- package/src/AdaptableState/Aggregations/weightedAverage.js +0 -26
- package/src/AdaptableState/Common/AdaptableColumn.js +0 -1
- package/src/AdaptableState/Common/AdaptableForm.js +0 -49
- package/src/AdaptableState/Common/AdaptableFormatPresets.js +0 -13
- package/src/AdaptableState/Common/AdaptablePredicate.js +3 -125
- package/src/AdaptableState/Common/AggregationColumns.js +0 -10
- package/src/AdaptableState/Common/Enums.js +0 -3
- package/src/AdaptableState/Common/Menu.js +1 -7
- package/src/AdaptableState/Common/MenuItem.js +0 -2
- package/src/AdaptableState/Common/Types.js +2 -5
- package/src/AdaptableState/StatusBarState.js +0 -3
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +0 -1
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.js +0 -4
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +0 -5
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +0 -8
- package/src/AdaptableState/Uuid.js +0 -1
- package/src/Api/Implementation/AdaptableApiImpl.js +0 -4
- package/src/Api/Implementation/AlertApiImpl.js +0 -21
- package/src/Api/Implementation/ApiBase.js +0 -24
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +0 -1
- package/src/Api/Implementation/ChartingApiImpl.js +0 -3
- package/src/Api/Implementation/ColumnApiImpl.js +1 -15
- package/src/Api/Implementation/ColumnFilterApiImpl.js +0 -9
- package/src/Api/Implementation/ColumnScopeApiImpl.js +0 -21
- package/src/Api/Implementation/DashboardApiImpl.js +0 -1
- package/src/Api/Implementation/EntitlementApiImpl.js +0 -1
- package/src/Api/Implementation/ExportApiImpl.js +0 -10
- package/src/Api/Implementation/ExpressionApiImpl.js +0 -1
- package/src/Api/Implementation/FormatColumnApiImpl.js +0 -3
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +0 -2
- package/src/Api/Implementation/GridApiImpl.js +1 -22
- package/src/Api/Implementation/GridFilterApiImpl.js +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -18
- package/src/Api/Implementation/LayoutHelpers.js +0 -16
- package/src/Api/Implementation/NamedQueryApiImpl.js +0 -1
- package/src/Api/Implementation/PredicateApiImpl.js +0 -5
- package/src/Api/Implementation/RowFormApiImpl.js +0 -2
- package/src/Api/Implementation/StateApiImpl.js +0 -7
- package/src/Api/Implementation/SystemStatusApiImpl.js +0 -2
- package/src/Api/Implementation/TeamSharingApiImpl.js +0 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -1
- package/src/Api/Internal/ActionColumnInternalApi.js +0 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
- package/src/Api/Internal/AdaptableInternalApi.js +1 -39
- package/src/Api/Internal/AlertInternalApi.js +1 -102
- package/src/Api/Internal/CalculatedColumnInternalApi.js +0 -17
- package/src/Api/Internal/ChartingInternalApi.js +0 -1
- package/src/Api/Internal/ColumnFilterInternalApi.js +0 -52
- package/src/Api/Internal/ColumnInternalApi.js +0 -32
- package/src/Api/Internal/CustomSortInternalApi.js +0 -5
- package/src/Api/Internal/DashboardInternalApi.js +0 -23
- package/src/Api/Internal/DataImportInternalApi.js +0 -1
- package/src/Api/Internal/EventInternalApi.js +0 -2
- package/src/Api/Internal/ExportInternalApi.js +1 -16
- package/src/Api/Internal/ExpressionInternalApi.js +0 -23
- package/src/Api/Internal/Fdc3InternalApi.js +0 -9
- package/src/Api/Internal/FlashingCellInternalApi.js +0 -5
- package/src/Api/Internal/FormatColumnInternalApi.js +5 -107
- package/src/Api/Internal/FreeTextColumnInternalApi.js +0 -8
- package/src/Api/Internal/GridFilterInternalApi.js +0 -3
- package/src/Api/Internal/GridInternalApi.js +0 -37
- package/src/Api/Internal/LayoutInternalApi.js +0 -18
- package/src/Api/Internal/NamedQueryInternalApi.js +0 -9
- package/src/Api/Internal/PredicateInternalApi.js +0 -23
- package/src/Api/Internal/RowFormInternalApi.js +0 -18
- package/src/Api/Internal/StateInternalApi.js +0 -25
- package/src/Api/Internal/StyledColumnInternalApi.js +0 -62
- package/src/Api/Internal/TeamSharingInternalApi.js +0 -9
- package/src/Redux/ActionsReducers/AlertRedux.js +0 -24
- package/src/Redux/ActionsReducers/ApplicationRedux.js +0 -9
- package/src/Redux/ActionsReducers/BulkUpdateRedux.js +0 -6
- package/src/Redux/ActionsReducers/CalculatedColumnRedux.js +1 -16
- package/src/Redux/ActionsReducers/ChartingRedux.js +0 -24
- package/src/Redux/ActionsReducers/CommentsRedux.js +0 -24
- package/src/Redux/ActionsReducers/CustomSortRedux.js +0 -24
- package/src/Redux/ActionsReducers/DashboardRedux.js +0 -33
- package/src/Redux/ActionsReducers/ExportRedux.js +0 -36
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +0 -24
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +0 -36
- package/src/Redux/ActionsReducers/FreeTextColumnRedux.js +1 -20
- package/src/Redux/ActionsReducers/InternalRedux.js +0 -42
- package/src/Redux/ActionsReducers/LayoutRedux.js +1 -67
- package/src/Redux/ActionsReducers/NamedQueryRedux.js +0 -15
- package/src/Redux/ActionsReducers/NoteRedux.js +0 -14
- package/src/Redux/ActionsReducers/PluginsRedux.js +0 -3
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +0 -34
- package/src/Redux/ActionsReducers/PopupRedux.js +2 -6
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +0 -15
- package/src/Redux/ActionsReducers/ShortcutRedux.js +0 -24
- package/src/Redux/ActionsReducers/SmartEditRedux.js +0 -6
- package/src/Redux/ActionsReducers/StatusBarRedux.js +0 -6
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +0 -27
- package/src/Redux/ActionsReducers/SystemStatusRedux.js +0 -6
- package/src/Redux/ActionsReducers/TeamSharingRedux.js +0 -1
- package/src/Redux/ActionsReducers/ThemeRedux.js +0 -26
- package/src/Redux/ActionsReducers/ToolPanelRedux.js +0 -22
- package/src/Redux/ActionsReducers/UserInterfaceRedux.js +0 -3
- package/src/Redux/ActionsReducers/utils.js +0 -6
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +0 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +0 -25
- package/src/Redux/Store/AdaptableStore.js +5 -301
- package/src/Strategy/AdaptableModuleBase.js +0 -35
- package/src/Strategy/AlertModule.js +0 -9
- package/src/Strategy/CellSummaryModule.js +0 -12
- package/src/Strategy/ChartingModule.js +0 -1
- package/src/Strategy/ColumnFilterModule.js +1 -11
- package/src/Strategy/CommentModule.js +0 -2
- package/src/Strategy/DashboardModule.js +0 -4
- package/src/Strategy/ExportModule.js +0 -1
- package/src/Strategy/FlashingCellModule.js +0 -8
- package/src/Strategy/FormatColumnModule.js +0 -3
- package/src/Strategy/FreeTextColumnModule.js +0 -3
- package/src/Strategy/LayoutModule.js +0 -26
- package/src/Strategy/NoteModule.js +0 -3
- package/src/Strategy/PlusMinusModule.js +0 -3
- package/src/Strategy/SettingsPanelModule.js +0 -1
- package/src/Strategy/ShortcutModule.js +0 -1
- package/src/Strategy/SmartEditModule.js +0 -5
- package/src/Strategy/StatusBarModule.js +0 -7
- package/src/Strategy/StyledColumnModule.js +1 -16
- package/src/Strategy/TeamSharingModule.js +0 -9
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +0 -5
- package/src/Utilities/Constants/DocumentationLinkConstants.js +0 -1
- package/src/Utilities/Constants/GeneralConstants.js +0 -10
- package/src/Utilities/Constants/ObjectDefaultConstants.js +0 -3
- package/src/Utilities/Constants/ReduxConstants.js +4 -8
- package/src/Utilities/Emitter.js +0 -9
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +0 -8
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +0 -15
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +0 -3
- package/src/Utilities/ExpressionFunctions/deepMap.js +0 -16
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +0 -9
- package/src/Utilities/ExpressionFunctions/groupingMap.js +0 -9
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +7 -78
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +0 -9
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +2 -16
- package/src/Utilities/Extensions/ArrayExtensions.js +1 -63
- package/src/Utilities/Extensions/NumberExtensions.js +0 -27
- package/src/Utilities/Extensions/ObjectExtensions.js +0 -36
- package/src/Utilities/Extensions/StringExtensions.js +0 -27
- package/src/Utilities/Helpers/ActionColumnHelper.js +0 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +0 -8
- package/src/Utilities/Helpers/DateHelper.js +0 -10
- package/src/Utilities/Helpers/DisplayFormatHelper.js +0 -8
- package/src/Utilities/Helpers/Helper.js +3 -9
- package/src/Utilities/Helpers/PlusMinusHelper.js +0 -20
- package/src/Utilities/Helpers/QuickSearchHelper.js +0 -5
- package/src/Utilities/Helpers/Scheduling/CronExpression.js +0 -43
- package/src/Utilities/Helpers/Scheduling/ScheduledReportHelper.js +0 -4
- package/src/Utilities/Helpers/SettingsPanelHelper.js +40 -4
- package/src/Utilities/Helpers/StyleHelper.js +0 -56
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.js +0 -46
- package/src/Utilities/Helpers/StyledColumns/GradientStyleHelper.js +0 -38
- package/src/Utilities/Helpers/StyledColumns/IconStyleHelper.js +0 -39
- package/src/Utilities/Helpers/StyledColumns/PercentBarStyleHelper.js +0 -1
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.js +0 -5
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.js +0 -37
- package/src/Utilities/Helpers/TimingHelper.js +0 -13
- package/src/Utilities/ObjectFactory.js +2 -4
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +0 -7
- package/src/Utilities/Services/AlertService.js +0 -1
- package/src/Utilities/Services/AnnotationsService.js +0 -22
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +0 -8
- package/src/Utilities/Services/ChartingService.js +0 -9
- package/src/Utilities/Services/DataService.js +0 -11
- package/src/Utilities/Services/Fdc3Service.js +0 -3
- package/src/Utilities/Services/FlashingCellService.js +0 -6
- package/src/Utilities/Services/ModuleService.js +0 -8
- package/src/Utilities/Services/QueryLanguageService.js +2 -25
- package/src/Utilities/Services/RowFormService.js +0 -1
- package/src/Utilities/Services/RowSummaryService.js +1 -20
- package/src/Utilities/Services/TeamSharingService.js +0 -15
- package/src/Utilities/Services/ThemeService.js +0 -7
- package/src/Utilities/Services/ValidationService.js +0 -21
- package/src/Utilities/createAgStatusPanelComponent.js +0 -3
- package/src/Utilities/getExpressionViewItems.js +0 -2
- package/src/Utilities/getObjectTagsViewItems.js +0 -1
- package/src/Utilities/getScrollbarSize.js +0 -1
- package/src/Utilities/logDeprecation.js +0 -3
- package/src/Utilities/resolveContainerElement.js +0 -21
- package/src/Utilities/runIfNotResolvedIn.js +0 -7
- package/src/Utilities/sortColumnStateForVisibleColumns.js +2 -12
- package/src/Utilities/waitForTimeout.js +0 -1
- package/src/Utilities/wizardSelection.js +0 -2
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/AdaptableView.js +1 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +0 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +0 -23
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +0 -2
- package/src/View/AdaptableWizardView/Wizard.js +0 -12
- package/src/View/AdaptableWizardView/helper.js +0 -11
- package/src/View/Alert/ActiveAlertsPanel.js +0 -2
- package/src/View/Alert/AlertStatusSubPanel.js +0 -8
- package/src/View/Alert/Utilities/getAlertType.js +0 -7
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +0 -5
- package/src/View/Alert/Utilities/mapAlertDefinition.js +0 -3
- package/src/View/Alert/Wizard/AlertWizard.js +0 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +0 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +0 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +0 -1
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +0 -3
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -7
- package/src/View/Charting/EditChartButton.js +1 -4
- package/src/View/Charting/ShowChartButton.js +0 -3
- package/src/View/Charting/useAgChartState.js +0 -5
- package/src/View/Charting/useChartingElements.js +0 -4
- package/src/View/Charting/useExternalChartState.js +0 -6
- package/src/View/ColumnInfo/ColumnInfo.js +7 -17
- package/src/View/Comments/CommentsEditor.js +1 -16
- package/src/View/Components/AdaptableButton/AdaptableButtonComponent.js +0 -1
- package/src/View/Components/AdaptableButton/AdaptableButtonView.js +0 -3
- package/src/View/Components/AdaptableDateInput/index.js +2 -9
- package/src/View/Components/AdaptableIconComponent/index.js +0 -4
- package/src/View/Components/AdaptableIconSelector/index.js +0 -3
- package/src/View/Components/AdaptableInput/index.js +0 -2
- package/src/View/Components/Badge/index.js +0 -8
- package/src/View/Components/Buttons/ButtonNewPage.js +1 -2
- package/src/View/Components/Buttons/EntityListActionButtons.js +0 -1
- package/src/View/Components/CellPopup/index.js +1 -2
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +0 -4
- package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.js +0 -4
- package/src/View/Components/ColumnFilter/ColumnFilter.js +3 -46
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +0 -2
- package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -20
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +2 -16
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +1 -4
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +0 -1
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +1 -6
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +0 -20
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +0 -5
- package/src/View/Components/ColumnFilter/utils.js +2 -9
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicateEditor.js +0 -2
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +0 -1
- package/src/View/Components/EntityRulesEditor/index.js +1 -11
- package/src/View/Components/ExternalRenderer.js +1 -3
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -52
- package/src/View/Components/ModuleValueSelector/index.js +0 -2
- package/src/View/Components/Panels/PanelWithImage.js +1 -5
- package/src/View/Components/Panels/PanelWithRow.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -2
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +0 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +0 -3
- package/src/View/Components/Popups/AdaptableToaster.js +0 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +0 -8
- package/src/View/Components/RangesComponent.js +0 -57
- package/src/View/Components/Selectors/BulkUpdateValueSelector.js +0 -3
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -6
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -18
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +0 -4
- package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -4
- package/src/View/Components/ValueSelector/index.js +0 -4
- package/src/View/Components/wizardColumnListStyles.js +0 -5
- package/src/View/Dashboard/CustomToolbar.js +1 -25
- package/src/View/Dashboard/PinnedToolbarsSelector.js +0 -1
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -22
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +0 -1
- package/src/View/DataImport/systemFileHandlers.js +1 -1
- package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +0 -27
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +0 -7
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -12
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +0 -10
- package/src/View/GridFilter/GridFilterPopup.js +0 -1
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +0 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -31
- package/src/View/Layout/LayoutViewPanel.js +0 -2
- package/src/View/Layout/PivotDetailsPopoup.js +0 -2
- package/src/View/Layout/TransposedPopup.js +0 -7
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -6
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +0 -2
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -32
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +0 -3
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +0 -2
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +0 -4
- package/src/View/Note/NotePopup.js +0 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +0 -1
- package/src/View/StatusBar/AdaptableStatusBar.js +0 -4
- package/src/View/StatusBar/StatusBarPanel.js +0 -8
- package/src/View/StatusBar/StatusBarPopup.js +0 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +0 -11
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +0 -28
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -25
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +0 -26
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +0 -40
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +0 -55
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +0 -15
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +0 -21
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.js +0 -10
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +0 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +1 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +0 -21
- package/src/View/SystemStatus/SystemStatusPopup.js +0 -1
- package/src/View/TeamSharing/SharedEntityObjectView.js +0 -1
- package/src/View/Theme/ThemeSelector.js +0 -1
- package/src/View/UIHelper.js +0 -6
- package/src/View/UIInterfaces.js +0 -1
- package/src/View/Wizard/CollapsibleWizardCard.js +1 -8
- package/src/View/Wizard/OnePageWizards.js +2 -9
- package/src/View/Wizard/SummaryColorTag.js +0 -1
- package/src/View/Wizard/useKeyboardNavigation.js +1 -3
- package/src/agGrid/Adaptable.js +0 -12
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
- package/src/agGrid/AdaptableAgGrid.js +3 -482
- package/src/agGrid/AdaptableFilterHandler.js +0 -5
- package/src/agGrid/AdaptableLogger.js +0 -6
- package/src/agGrid/AgGridAdapter.js +3 -90
- package/src/agGrid/AgGridColumnAdapter.js +6 -168
- package/src/agGrid/AgGridExportAdapter.js +4 -106
- package/src/agGrid/AgGridFilterAdapter.js +0 -5
- package/src/agGrid/AgGridFloatingFilterAdapter.js +0 -10
- package/src/agGrid/AgGridMenuAdapter.js +0 -143
- package/src/agGrid/AgGridModulesAdapter.js +0 -2
- package/src/agGrid/AgGridOptionsService.js +0 -2
- package/src/agGrid/AgGridThemeAdapter.js +0 -7
- package/src/agGrid/agGridDataTypeDefinitions.js +0 -8
- package/src/agGrid/cellRenderers/BadgeRenderer.js +0 -10
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +1 -96
- package/src/agGrid/cellRenderers/IconRenderer.js +0 -55
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +0 -51
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +1 -50
- package/src/agGrid/cellRenderers/RatingRenderer.js +0 -40
- package/src/agGrid/editors/AdaptableDateEditor/index.js +0 -18
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +0 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +0 -11
- package/src/agGrid/editors/AdaptablePercentageEditor/index.js +0 -9
- package/src/agGrid/index.js +0 -6
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -73
- package/src/components/ColorPicker/ColorPicker.js +0 -6
- package/src/components/Combobox/VirtualizedList.js +0 -5
- package/src/components/Combobox/index.js +5 -63
- package/src/components/Dashboard/Dashboard.js +1 -4
- package/src/components/Datepicker/index.js +2 -97
- package/src/components/DragAndDropContext/TabList.js +2 -6
- package/src/components/Drawer/index.js +0 -7
- package/src/components/Dropdown/index.js +0 -1
- package/src/components/DropdownButton/index.js +0 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -16
- package/src/components/ExpressionEditor/EditorButton.js +0 -1
- package/src/components/ExpressionEditor/EditorInput.js +1 -7
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +0 -1
- package/src/components/ExpressionEditor/ExpressionPreview.js +4 -14
- package/src/components/ExpressionEditor/NamedQueryContext.js +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -6
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +0 -12
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +0 -4
- package/src/components/ExpressionEditor/index.js +5 -14
- package/src/components/Icon/index.js +0 -2
- package/src/components/Input/NumberInput.js +0 -10
- package/src/components/Modal/Backdrop.js +0 -1
- package/src/components/OverlayTrigger/Overlay.js +0 -1
- package/src/components/OverlayTrigger/index.js +3 -15
- package/src/components/ProgressIndicator/ProgressIndicator.js +3 -16
- package/src/components/ResizeObserver/index.js +0 -7
- package/src/components/SelectableList/index.js +0 -7
- package/src/components/SimpleButton/index.js +2 -16
- package/src/components/Tabs/index.js +0 -3
- package/src/components/Tag/Tag.js +0 -1
- package/src/components/Tag/columnScopeTagHelpers.js +0 -2
- package/src/components/Textarea/index.js +1 -8
- package/src/components/Toggle/Toggle.js +1 -5
- package/src/components/Toggle/ToggleGroup.js +1 -3
- package/src/components/ToggleButton/index.js +1 -3
- package/src/components/Tree/TreeDropdown/index.js +2 -130
- package/src/components/Tree/treeUtils.js +0 -4
- package/src/components/WindowModal/WindowModal.js +1 -14
- package/src/components/WindowModal/useStacking.js +0 -7
- package/src/components/icons/bullet-chart.js +0 -4
- package/src/components/icons/icon-style.js +0 -4
- package/src/components/icons/index.js +26 -36
- package/src/components/icons/range-bar.js +0 -5
- package/src/components/icons/star.js +0 -1
- package/src/components/twUtils.js +3 -12
- package/src/components/ui/calendar.js +1 -9
- package/src/components/ui/combobox.js +0 -4
- package/src/components/utils/captureTabNavigation/getFocusableChildren.js +0 -1
- package/src/components/utils/useDraggable.js +0 -4
- package/src/components/utils/useProperty.js +0 -18
- package/src/devTools/index.js +0 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/LMEmitter.js +0 -5
- package/src/layout-manager/src/destructurePivotColumnId.js +0 -19
- package/src/layout-manager/src/index.js +2 -182
- package/src/layout-manager/src/isLayoutEqual.js +0 -1
- package/src/layout-manager/src/isPivotColumnTotal.js +0 -2
- package/src/layout-manager/src/normalizeLayoutModel.js +0 -27
- package/src/layout-manager/src/simplifyLayoutModel.js +0 -11
- package/src/layout-manager/src/sortColumnIdsByOrder.js +2 -12
- package/src/lib/utils.js +0 -1
- package/src/migration/AdaptableUpgradeHelper.js +0 -2
- package/src/migration/VersionUpgrade17.js +0 -33
- package/src/migration/VersionUpgrade20.js +1 -21
- package/src/migration/VersionUpgrade21.js +0 -3
- package/src/migration/VersionUpgrade22.js +0 -11
- package/src/migration/VersionUpgrade23.js +0 -73
- package/src/parser/src/evaluator.js +0 -1
- package/src/parser/src/index.js +0 -1
- package/src/parser/src/parser.js +4 -103
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +0 -5
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +0 -2
- package/src/parser/src/tokenizer.js +0 -2
- package/src/parser/src/utils.js +0 -1
- package/src/renderReactRoot.js +0 -12
- package/src/setupDevTools.js +0 -6
- package/src/twMerge.js +0 -1
- package/src/types.d.ts +1 -1
- package/src/types.js +0 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +0 -20
- package/src/Utilities/Services/Interface/IMetamodelService.js +0 -2
- package/src/Utilities/Services/MetamodelService.d.ts +0 -17
- package/src/Utilities/Services/MetamodelService.js +0 -167
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +0 -104
- package/src/metamodel/adaptable-metamodel-model.d.ts +0 -26
- package/src/metamodel/adaptable-metamodel-model.js +0 -2
- package/src/metamodel/adaptable.metamodel.d.ts +0 -6244
- package/src/metamodel/adaptable.metamodel.js +0 -1
|
@@ -7,9 +7,8 @@ const NumberExtensions_1 = require("../Extensions/NumberExtensions");
|
|
|
7
7
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
8
8
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
9
9
|
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
10
|
-
// numeric value(digits) followed by a single 's', 'm' or 'h' letter (case insensitive)
|
|
11
10
|
const TIMEFRAME_REGEX = /^(\d+)(s|m|h)$/i;
|
|
12
|
-
const SYSTEM_MAX_TIMEFRAME_SIZE = 86400000;
|
|
11
|
+
const SYSTEM_MAX_TIMEFRAME_SIZE = 86400000;
|
|
13
12
|
exports.observableExpressionFunctions = {
|
|
14
13
|
WHERE: {
|
|
15
14
|
handler(args, context) {
|
|
@@ -43,13 +42,7 @@ exports.observableExpressionFunctions = {
|
|
|
43
42
|
return getDataChangeMax$(dataChangeLog$, timeframeChange$);
|
|
44
43
|
}
|
|
45
44
|
case 'NONE': {
|
|
46
|
-
return dataChangeLog$.pipe(
|
|
47
|
-
// wait for the given time
|
|
48
|
-
(0, operators_1.debounceTime)(timeframeParameter.value),
|
|
49
|
-
// completing the observable (ex. alert deletion) will also fire the NONE event
|
|
50
|
-
// takeUntil takes care of this, ignoring any emissions as soon as the source completes
|
|
51
|
-
// (count() result is irrelevant here, the main thing is that it emits an source completion)
|
|
52
|
-
(0, operators_1.takeUntil)(dataChangeLog$.pipe((0, operators_1.count)())));
|
|
45
|
+
return dataChangeLog$.pipe((0, operators_1.debounceTime)(timeframeParameter.value), (0, operators_1.takeUntil)(dataChangeLog$.pipe((0, operators_1.count)())));
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
48
|
},
|
|
@@ -83,15 +76,7 @@ exports.observableExpressionFunctions = {
|
|
|
83
76
|
return getDataChangeMax$(dataChangeLog$, timeframeChange$);
|
|
84
77
|
}
|
|
85
78
|
case 'NONE': {
|
|
86
|
-
return dataChangeLog$.pipe(
|
|
87
|
-
// add a synthetic first value to ensure the grid is observed even when there are no changes
|
|
88
|
-
(0, operators_1.startWith)(getDataChangedInfoStub(context)),
|
|
89
|
-
// wait for the given time
|
|
90
|
-
(0, operators_1.debounceTime)(timeframeParameter.value),
|
|
91
|
-
// completing the observable (ex. alert deletion) will also fire the NONE event
|
|
92
|
-
// takeUntil takes care of this, ignoring any emissions as soon as the source completes
|
|
93
|
-
// (count() result is irrelevant here, the main thing is that it emits a source completion)
|
|
94
|
-
(0, operators_1.takeUntil)(dataChangeLog$.pipe((0, operators_1.count)())));
|
|
79
|
+
return dataChangeLog$.pipe((0, operators_1.startWith)(getDataChangedInfoStub(context)), (0, operators_1.debounceTime)(timeframeParameter.value), (0, operators_1.takeUntil)(dataChangeLog$.pipe((0, operators_1.count)())));
|
|
95
80
|
}
|
|
96
81
|
}
|
|
97
82
|
},
|
|
@@ -225,14 +210,12 @@ exports.observableExpressionFunctions = {
|
|
|
225
210
|
},
|
|
226
211
|
TIMEFRAME: {
|
|
227
212
|
handler(args, context) {
|
|
228
|
-
// unit -> milliseconds
|
|
229
213
|
const durationUnitRatios = {
|
|
230
214
|
s: 1000,
|
|
231
215
|
m: 60000,
|
|
232
216
|
h: 3600000,
|
|
233
217
|
};
|
|
234
218
|
const input = args[0] + '';
|
|
235
|
-
//we allow only seconds, minutes & hours durations
|
|
236
219
|
const matchingResult = input.match(TIMEFRAME_REGEX);
|
|
237
220
|
const value = matchingResult?.[1];
|
|
238
221
|
const unit = matchingResult?.[2]?.toLowerCase();
|
|
@@ -243,7 +226,6 @@ exports.observableExpressionFunctions = {
|
|
|
243
226
|
if (!duration) {
|
|
244
227
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('TIMEFRAME', `timeframe expression is invalid`);
|
|
245
228
|
}
|
|
246
|
-
// check if the given duration is greater than the generally defined maxTimeframe size
|
|
247
229
|
duration = getMaxTimeframeSize(duration, context);
|
|
248
230
|
const result = {
|
|
249
231
|
type: 'config',
|
|
@@ -263,26 +245,22 @@ exports.observableExpressionFunctions = {
|
|
|
263
245
|
},
|
|
264
246
|
};
|
|
265
247
|
exports.observableExpressionFunctionNames = (0, TypeExtensions_1.getTypedKeys)(exports.observableExpressionFunctions);
|
|
266
|
-
// return TRUE if the last(tail) element has the greatest value
|
|
267
248
|
const isLastElementMaxValue = (values) => {
|
|
268
249
|
const [tailValue] = values.slice(-1);
|
|
269
250
|
const restValues = values.slice(0, -1);
|
|
270
251
|
return restValues.every((value) => value < tailValue);
|
|
271
252
|
};
|
|
272
|
-
// return TRUE if the last(tail) element has the greatest value
|
|
273
253
|
const isLastElementMinValue = (values) => {
|
|
274
254
|
const [tailValue] = values.slice(-1);
|
|
275
255
|
const restValues = values.slice(0, -1);
|
|
276
256
|
return restValues.every((value) => value > tailValue);
|
|
277
257
|
};
|
|
278
|
-
// useful for functions which do NOT have an initial change (ex. GRID_CHANGE NONE)
|
|
279
258
|
const getDataChangedInfoStub = (context) => {
|
|
280
259
|
let rowNodeStub;
|
|
281
260
|
if (!context.filterFn) {
|
|
282
261
|
rowNodeStub = context.node ?? context.adaptableApi.gridApi.getFirstRowNode();
|
|
283
262
|
}
|
|
284
263
|
else {
|
|
285
|
-
// if there is a WHERE clause defined, find the first rowNode which satisfies the condition
|
|
286
264
|
context.adaptableApi.internalApi.forAllRowNodesDo((rowNode) => {
|
|
287
265
|
if (!rowNodeStub) {
|
|
288
266
|
if (context.filterFn(rowNode)) {
|
|
@@ -313,13 +291,11 @@ const getDataChangedInfoStub = (context) => {
|
|
|
313
291
|
};
|
|
314
292
|
}
|
|
315
293
|
};
|
|
316
|
-
// returns an observable which fires if the source$ emitted `targetCount` times in the given `timeframeChange$` period
|
|
317
294
|
const getDataChangeCount$ = (dataChangeLog$, timeframeChange$, targetCount) => {
|
|
318
295
|
return dataChangeLog$.pipe((0, operators_1.withLatestFrom)(timeframeChange$), (0, operators_1.filter)(([_, changeCountWithinTimeframe]) => {
|
|
319
296
|
return targetCount === changeCountWithinTimeframe;
|
|
320
297
|
}), (0, operators_1.map)(([source]) => source));
|
|
321
298
|
};
|
|
322
|
-
// returns an observable which fires if the last source$ emission had the lowest(min) value in the given `timeframeChange$` period
|
|
323
299
|
const getDataChangeMin$ = (dataChangeLog$, timeframeChange$) => {
|
|
324
300
|
return dataChangeLog$.pipe((0, operators_1.withLatestFrom)(timeframeChange$), (0, operators_1.filter)(([changeLog, values]) => {
|
|
325
301
|
return values.length > 1
|
|
@@ -329,7 +305,6 @@ const getDataChangeMin$ = (dataChangeLog$, timeframeChange$) => {
|
|
|
329
305
|
return changeLog;
|
|
330
306
|
}));
|
|
331
307
|
};
|
|
332
|
-
// returns an observable which fires if the last source$ emission had the highest(max) value in the given `timeframeChange$` period
|
|
333
308
|
const getDataChangeMax$ = (dataChangeLog$, timeframeChange$) => {
|
|
334
309
|
return dataChangeLog$.pipe((0, operators_1.withLatestFrom)(timeframeChange$), (0, operators_1.filter)(([changeLog, values]) => {
|
|
335
310
|
return values.length > 1
|
|
@@ -339,17 +314,12 @@ const getDataChangeMax$ = (dataChangeLog$, timeframeChange$) => {
|
|
|
339
314
|
return changeLog;
|
|
340
315
|
}));
|
|
341
316
|
};
|
|
342
|
-
// returns an observable which maps a dataChangeLogEntry to the number(count) of changed values in the entire grid
|
|
343
|
-
// the counter is continuously up-to-date in the given timeframe
|
|
344
|
-
// if the given counterLimit is reached, the counter is reset
|
|
345
317
|
const getTrailingGridCountChange$ = (source$, trailingPeriod, counterLimit) => {
|
|
346
318
|
return (0, rxjs_1.defer)(() => {
|
|
347
|
-
// keep the counter value in an internal intermediary state
|
|
348
319
|
let counter = 0;
|
|
349
320
|
const movingTimeWindow$ = getSlidingTimeframe$(source$, trailingPeriod, (dataChangeLog) => {
|
|
350
321
|
counter++;
|
|
351
322
|
}, (dataChangeLog) => {
|
|
352
|
-
// counter may have been reset during the timeframe, in which case we skip the decrement
|
|
353
323
|
if (counter > 0) {
|
|
354
324
|
counter--;
|
|
355
325
|
}
|
|
@@ -357,19 +327,14 @@ const getTrailingGridCountChange$ = (source$, trailingPeriod, counterLimit) => {
|
|
|
357
327
|
return movingTimeWindow$.pipe((0, operators_1.map)(() => {
|
|
358
328
|
const gridCounter = counter;
|
|
359
329
|
if (gridCounter === counterLimit) {
|
|
360
|
-
// reset counter
|
|
361
330
|
counter = 0;
|
|
362
331
|
}
|
|
363
332
|
return gridCounter;
|
|
364
333
|
}));
|
|
365
334
|
});
|
|
366
335
|
};
|
|
367
|
-
// returns an observable which maps a dataChangeLogEntry to the number(count) of changed values in the row of the given dataChangeLogEntry
|
|
368
|
-
// the counter is continuously up-to-date in the given timeframe
|
|
369
|
-
// if the given counterLimit is reached, the counter is reset
|
|
370
336
|
const getTrailingRowCountChange$ = (source$, trailingPeriod, counterLimit) => {
|
|
371
337
|
return (0, rxjs_1.defer)(() => {
|
|
372
|
-
// keep the counter value in an internal intermediary state (distinct per row PK)
|
|
373
338
|
const counterMap = new Map();
|
|
374
339
|
const getCellCounter = (dataChangeLog) => counterMap.get(dataChangeLog.primaryKeyValue) ?? 0;
|
|
375
340
|
const slidingTimeframe$ = getSlidingTimeframe$(source$, trailingPeriod, (dataChangeLog) => {
|
|
@@ -377,7 +342,6 @@ const getTrailingRowCountChange$ = (source$, trailingPeriod, counterLimit) => {
|
|
|
377
342
|
counterMap.set(dataChangeLog.primaryKeyValue, ++currentCounter);
|
|
378
343
|
}, (dataChangeLog) => {
|
|
379
344
|
let currentCounter = getCellCounter(dataChangeLog);
|
|
380
|
-
// counter may have been reset during the timeframe, in which case we skip the decrement
|
|
381
345
|
if (currentCounter > 0) {
|
|
382
346
|
counterMap.set(dataChangeLog.primaryKeyValue, --currentCounter);
|
|
383
347
|
}
|
|
@@ -385,32 +349,25 @@ const getTrailingRowCountChange$ = (source$, trailingPeriod, counterLimit) => {
|
|
|
385
349
|
return slidingTimeframe$.pipe((0, operators_1.map)((dataChangeLog) => {
|
|
386
350
|
const cellCounter = getCellCounter(dataChangeLog);
|
|
387
351
|
if (cellCounter === counterLimit) {
|
|
388
|
-
// reset counter
|
|
389
352
|
counterMap.set(dataChangeLog.primaryKeyValue, 0);
|
|
390
353
|
}
|
|
391
354
|
return cellCounter;
|
|
392
355
|
}));
|
|
393
356
|
});
|
|
394
357
|
};
|
|
395
|
-
// returns an observable which maps a dataChangeLogEntry to the array of changed values in the entire grid
|
|
396
|
-
// the changed values array is continuously up-to-date in the given timeframe
|
|
397
358
|
const getTrailingGridValueChange$ = (source$, trailingPeriod) => {
|
|
398
359
|
return (0, rxjs_1.defer)(() => {
|
|
399
|
-
// keep the changed values in an internal intermediary state
|
|
400
360
|
let values = [];
|
|
401
361
|
const doubleInsertionsMap = new WeakMap();
|
|
402
362
|
const slidingTimeframe$ = getSlidingTimeframe$(source$, trailingPeriod, (dataChangeLog) => {
|
|
403
363
|
if (!values.length) {
|
|
404
|
-
// values is empty, so we evaluate both old & new node values
|
|
405
364
|
values.push((0, expressionFunctionUtils_1.getNumericValue)(dataChangeLog.oldValue));
|
|
406
|
-
// mark the double insertion, we will have to pop 2 elements
|
|
407
365
|
doubleInsertionsMap.set(dataChangeLog, true);
|
|
408
366
|
}
|
|
409
367
|
values.push((0, expressionFunctionUtils_1.getNumericValue)(dataChangeLog.newValue));
|
|
410
368
|
}, (dataChangeLog) => {
|
|
411
369
|
values.shift();
|
|
412
370
|
if (doubleInsertionsMap.get(dataChangeLog)) {
|
|
413
|
-
// the current change inserted both old and new values, so we have to extract 2 elements
|
|
414
371
|
values.shift();
|
|
415
372
|
doubleInsertionsMap.delete(dataChangeLog);
|
|
416
373
|
}
|
|
@@ -418,20 +375,15 @@ const getTrailingGridValueChange$ = (source$, trailingPeriod) => {
|
|
|
418
375
|
return slidingTimeframe$.pipe((0, operators_1.map)(() => values));
|
|
419
376
|
});
|
|
420
377
|
};
|
|
421
|
-
// returns an observable which maps a dataChangeLogEntry to the array of changed values in the row of the given dataChangeLogEntry
|
|
422
|
-
// the changed values array is continuously up-to-date in the given timeframe
|
|
423
378
|
const getTrailingRowValueChange$ = (source$, trailingPeriod) => {
|
|
424
379
|
return (0, rxjs_1.defer)(() => {
|
|
425
|
-
// keep the changed values in an internal intermediary state (distinct per row PK)
|
|
426
380
|
const rowValuesMap = new Map();
|
|
427
381
|
const doubleInsertionsMap = new WeakMap();
|
|
428
382
|
const getRowValues = (dataChangeLog) => rowValuesMap.get(dataChangeLog.primaryKeyValue) ?? [];
|
|
429
383
|
const slidingTimeframe$ = getSlidingTimeframe$(source$, trailingPeriod, (dataChangeLog) => {
|
|
430
384
|
let rowValues = getRowValues(dataChangeLog);
|
|
431
385
|
if (!rowValues.length) {
|
|
432
|
-
// values is empty, so we evaluate both old & new node values
|
|
433
386
|
rowValues.push((0, expressionFunctionUtils_1.getNumericValue)(dataChangeLog.oldValue));
|
|
434
|
-
// mark the double insertion, we will have to pop 2 elements
|
|
435
387
|
doubleInsertionsMap.set(dataChangeLog, true);
|
|
436
388
|
}
|
|
437
389
|
rowValues.push((0, expressionFunctionUtils_1.getNumericValue)(dataChangeLog.newValue));
|
|
@@ -440,7 +392,6 @@ const getTrailingRowValueChange$ = (source$, trailingPeriod) => {
|
|
|
440
392
|
let rowValues = getRowValues(dataChangeLog);
|
|
441
393
|
rowValues.shift();
|
|
442
394
|
if (doubleInsertionsMap.get(dataChangeLog)) {
|
|
443
|
-
// the current change inserted both old and new values, so we have to extract 2 elements
|
|
444
395
|
rowValues.shift();
|
|
445
396
|
doubleInsertionsMap.delete(dataChangeLog);
|
|
446
397
|
}
|
|
@@ -449,20 +400,10 @@ const getTrailingRowValueChange$ = (source$, trailingPeriod) => {
|
|
|
449
400
|
return slidingTimeframe$.pipe((0, operators_1.map)((dataChangeLog) => getRowValues(dataChangeLog)));
|
|
450
401
|
});
|
|
451
402
|
};
|
|
452
|
-
// return an observable which will emit when the source$ event enters, respectively exits the timeframe
|
|
453
|
-
// it also executes the provided onEnter/onExit handlers
|
|
454
403
|
const getSlidingTimeframe$ = (source$, timeframeDuration, onTimeframeEnter, onTimeframeExit) => {
|
|
455
|
-
return source$.pipe(
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
// 1. it will emit the payload immediately...
|
|
459
|
-
const enter$ = (0, rxjs_1.of)(dataChangeLog).pipe(
|
|
460
|
-
// ...and execute the provided onPushHandler() callback
|
|
461
|
-
(0, operators_1.tap)((dataChangeLog) => onTimeframeEnter(dataChangeLog)));
|
|
462
|
-
// 2. and after a given 'timeWindowSize' delay it will re-emit the payload...
|
|
463
|
-
const exit$ = (0, rxjs_1.of)(dataChangeLog).pipe((0, operators_1.delay)(timeframeDuration),
|
|
464
|
-
// ...and execute the provided onPopHandler() callback
|
|
465
|
-
(0, operators_1.tap)((dataChangeLog) => onTimeframeExit(dataChangeLog)));
|
|
404
|
+
return source$.pipe((0, operators_1.mergeMap)((dataChangeLog) => {
|
|
405
|
+
const enter$ = (0, rxjs_1.of)(dataChangeLog).pipe((0, operators_1.tap)((dataChangeLog) => onTimeframeEnter(dataChangeLog)));
|
|
406
|
+
const exit$ = (0, rxjs_1.of)(dataChangeLog).pipe((0, operators_1.delay)(timeframeDuration), (0, operators_1.tap)((dataChangeLog) => onTimeframeExit(dataChangeLog)));
|
|
466
407
|
return (0, rxjs_1.of)(enter$, exit$).pipe((0, operators_1.mergeAll)());
|
|
467
408
|
}));
|
|
468
409
|
};
|
|
@@ -483,15 +424,12 @@ const handleGridRowAddedOrRemoved = (args, gridChangeLog$, consumingFunction, co
|
|
|
483
424
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError(consumingFunction, 'requires a TIMEFRAME parameter when observing for no changes');
|
|
484
425
|
}
|
|
485
426
|
if (countValue == null && timeframeParameter == null) {
|
|
486
|
-
// default - return all new rows
|
|
487
427
|
return gridChangeLog$;
|
|
488
428
|
}
|
|
489
429
|
if (countValue == null) {
|
|
490
|
-
// default count value of 1
|
|
491
430
|
countValue = 1;
|
|
492
431
|
}
|
|
493
432
|
if (timeframeParameter == null) {
|
|
494
|
-
// default time parameter of max
|
|
495
433
|
timeframeParameter = {
|
|
496
434
|
name: 'TIMEFRAME',
|
|
497
435
|
type: 'config',
|
|
@@ -499,7 +437,6 @@ const handleGridRowAddedOrRemoved = (args, gridChangeLog$, consumingFunction, co
|
|
|
499
437
|
};
|
|
500
438
|
}
|
|
501
439
|
if (countValue === 0) {
|
|
502
|
-
// handle special case when observing NO changes
|
|
503
440
|
const rowDataChangeInfoStub = {
|
|
504
441
|
rowTrigger: consumingFunction === 'ROW_ADDED' ? 'Add' : 'Delete',
|
|
505
442
|
rowNodes: [],
|
|
@@ -507,15 +444,7 @@ const handleGridRowAddedOrRemoved = (args, gridChangeLog$, consumingFunction, co
|
|
|
507
444
|
changedAt: Date.now(),
|
|
508
445
|
...context.adaptableApi.internalApi.buildBaseContext(),
|
|
509
446
|
};
|
|
510
|
-
return gridChangeLog$.pipe(
|
|
511
|
-
// add a synthetic first value to ensure the grid is observed even when there are no changes
|
|
512
|
-
(0, operators_1.startWith)(rowDataChangeInfoStub),
|
|
513
|
-
// wait for the given time
|
|
514
|
-
(0, operators_1.debounceTime)(timeframeParameter.value),
|
|
515
|
-
// completing the observable (ex. alert deletion) will also fire the NONE event
|
|
516
|
-
// takeUntil takes care of this, ignoring any emissions as soon as the source completes
|
|
517
|
-
// (count() result is irrelevant here, the main thing is that it emits a source completion)
|
|
518
|
-
(0, operators_1.takeUntil)(gridChangeLog$.pipe((0, operators_1.count)())));
|
|
447
|
+
return gridChangeLog$.pipe((0, operators_1.startWith)(rowDataChangeInfoStub), (0, operators_1.debounceTime)(timeframeParameter.value), (0, operators_1.takeUntil)(gridChangeLog$.pipe((0, operators_1.count)())));
|
|
519
448
|
}
|
|
520
449
|
const timeframeChange$ = getTrailingGridCountChange$(gridChangeLog$, timeframeParameter.value, countValue);
|
|
521
450
|
return getDataChangeCount$(gridChangeLog$, timeframeChange$, countValue);
|
|
@@ -66,15 +66,6 @@ function initReducers(reducers) {
|
|
|
66
66
|
}
|
|
67
67
|
return result;
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* This fn mutates the reducerResults array!!!
|
|
72
|
-
*
|
|
73
|
-
* @param data data item
|
|
74
|
-
* @param reducers an array of reducers
|
|
75
|
-
* @param reducerResults the results on which to operate
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
69
|
function computeReducersFor(data, reducers, reducerResults, dataIndex) {
|
|
79
70
|
if (!reducers || !Object.keys(reducers).length) {
|
|
80
71
|
return;
|
|
@@ -22,8 +22,6 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/String
|
|
|
22
22
|
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
23
23
|
const src_1 = require("../../parser/src");
|
|
24
24
|
const evaluator_1 = require("../../parser/src/evaluator");
|
|
25
|
-
// useful for unary operators which expect a list of arguments
|
|
26
|
-
// we extract the provided array elements into a list
|
|
27
25
|
const flattenArguments = (values) => {
|
|
28
26
|
if (!Array.isArray(values)) {
|
|
29
27
|
return values;
|
|
@@ -64,11 +62,9 @@ exports.scalarExpressionFunctions = {
|
|
|
64
62
|
if (!column.queryable) {
|
|
65
63
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('COL', `Column name "${columnId}" is not queryable`);
|
|
66
64
|
}
|
|
67
|
-
// see #derived_pivot_cell_style
|
|
68
65
|
if (context.pivotResultColumn) {
|
|
69
66
|
const baseColumnId = context.pivotResultColumn.getColDef()?.pivotValueColumn?.getColId();
|
|
70
67
|
if (baseColumnId === columnId) {
|
|
71
|
-
// we evaluate the pivot result column instead of the base column
|
|
72
68
|
return context.adaptableApi?.gridApi.getNormalisedValueFromRowNode(context.node, context.pivotResultColumn.getColId());
|
|
73
69
|
}
|
|
74
70
|
}
|
|
@@ -107,11 +103,9 @@ exports.scalarExpressionFunctions = {
|
|
|
107
103
|
if (!column.queryable) {
|
|
108
104
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('$SCOPE', `Column name "${scopeColumnId}" is not queryable`);
|
|
109
105
|
}
|
|
110
|
-
// see #derived_pivot_cell_style
|
|
111
106
|
if (context.pivotResultColumn) {
|
|
112
107
|
const baseColumnId = context.pivotResultColumn.getColDef()?.pivotValueColumn?.getColId();
|
|
113
108
|
if (baseColumnId === scopeColumnId) {
|
|
114
|
-
// we evaluate the pivot result column instead of the base column
|
|
115
109
|
return context.adaptableApi?.gridApi.getNormalisedValueFromRowNode(context.node, context.pivotResultColumn.getColId());
|
|
116
110
|
}
|
|
117
111
|
}
|
|
@@ -133,12 +127,10 @@ exports.scalarExpressionFunctions = {
|
|
|
133
127
|
if (!namedQuery) {
|
|
134
128
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('QUERY', `Named Query with name ${namedQueryName} not found!`);
|
|
135
129
|
}
|
|
136
|
-
// add query to call stack
|
|
137
130
|
if (!context.namedQueryCallStack) {
|
|
138
131
|
context.namedQueryCallStack = [];
|
|
139
132
|
}
|
|
140
133
|
context.namedQueryCallStack.push(namedQueryName);
|
|
141
|
-
//check if this Named Query is not already evaluated, in which case this would lead to an infinite evaluation cycle
|
|
142
134
|
const firstIndex = context.namedQueryCallStack.indexOf(namedQueryName);
|
|
143
135
|
const lastIndex = context.namedQueryCallStack.lastIndexOf(namedQueryName);
|
|
144
136
|
if (firstIndex !== lastIndex) {
|
|
@@ -146,7 +138,6 @@ exports.scalarExpressionFunctions = {
|
|
|
146
138
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError(`${namedQueryName}`, ` contains a circular reference: ${cycle.join(' -> ')}`);
|
|
147
139
|
}
|
|
148
140
|
const queryEvaluationResult = (0, src_1.evaluate)(namedQuery.BooleanExpression, context);
|
|
149
|
-
// remove query name from callstack
|
|
150
141
|
context.namedQueryCallStack?.pop();
|
|
151
142
|
return queryEvaluationResult;
|
|
152
143
|
},
|
|
@@ -277,7 +268,6 @@ exports.scalarExpressionFunctions = {
|
|
|
277
268
|
handler(args) {
|
|
278
269
|
const sanitizedArguments = sanitizeArguments(flattenArguments(args));
|
|
279
270
|
if (args.length && !sanitizedArguments.length) {
|
|
280
|
-
// expression is syntactically valid, but operates with incompatible values
|
|
281
271
|
return;
|
|
282
272
|
}
|
|
283
273
|
return sanitizedArguments.reduce((a, b) => a + b) / sanitizedArguments.length;
|
|
@@ -292,7 +282,6 @@ exports.scalarExpressionFunctions = {
|
|
|
292
282
|
handler(args) {
|
|
293
283
|
const sanitizedArguments = sanitizeArguments(args, true);
|
|
294
284
|
if (args.length && !sanitizedArguments.length) {
|
|
295
|
-
// expression is syntactically valid, but operates with incompatible values
|
|
296
285
|
return;
|
|
297
286
|
}
|
|
298
287
|
return sanitizedArguments.reduce((a, b) => a + b);
|
|
@@ -308,7 +297,6 @@ exports.scalarExpressionFunctions = {
|
|
|
308
297
|
handler(args) {
|
|
309
298
|
const sanitizedArguments = sanitizeArguments(args);
|
|
310
299
|
if (args.length && !sanitizedArguments.length) {
|
|
311
|
-
// expression is syntactically valid, but operates with incompatible values
|
|
312
300
|
return;
|
|
313
301
|
}
|
|
314
302
|
return sanitizedArguments.reduce((a, b) => a - b);
|
|
@@ -367,9 +355,9 @@ exports.scalarExpressionFunctions = {
|
|
|
367
355
|
CASE: {
|
|
368
356
|
handler([expressionValueNode, whenThenListNodes, defaultValueNode], context) {
|
|
369
357
|
const caseExpressionValue = expressionValueNode != undefined
|
|
370
|
-
?
|
|
358
|
+
?
|
|
371
359
|
(0, expressionFunctionUtils_1.evaluateExpressionNode)(expressionValueNode, context)
|
|
372
|
-
:
|
|
360
|
+
:
|
|
373
361
|
true;
|
|
374
362
|
const matchingWhen = whenThenListNodes.find((whenThenStatement) => {
|
|
375
363
|
const whenValue = (0, expressionFunctionUtils_1.evaluateExpressionNode)(whenThenStatement.WHEN, context);
|
|
@@ -738,10 +726,8 @@ exports.scalarExpressionFunctions = {
|
|
|
738
726
|
}
|
|
739
727
|
const columnArg = args[0];
|
|
740
728
|
if (!columnArg) {
|
|
741
|
-
// if no column is provided, we check if any value has changed
|
|
742
729
|
return context.dataChangedEvent.oldValue !== context.dataChangedEvent.newValue;
|
|
743
730
|
}
|
|
744
|
-
// only COL argument is supported
|
|
745
731
|
if (columnArg.type !== 'COL' && columnArg.type !== '$SCOPE') {
|
|
746
732
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('ANY_CHANGE', 'accepts only a column reference or scope as an argument');
|
|
747
733
|
}
|
|
@@ -132,7 +132,6 @@ function hasItemsOfCount(arrayToCheck, numberOfItems) {
|
|
|
132
132
|
function moveArray(array, from, to) {
|
|
133
133
|
array.splice(to, 0, array.splice(from, 1)[0]);
|
|
134
134
|
}
|
|
135
|
-
//This deliberately only checks contents equality and not positional so [1, 2, 3]== [1, 3, 2]
|
|
136
135
|
function areArraysEqual(arr1, arr2) {
|
|
137
136
|
if (IsNullOrEmpty(arr1) && IsNotNullOrEmpty(arr2)) {
|
|
138
137
|
return false;
|
|
@@ -157,29 +156,17 @@ function areArraysEqualWithOrder(arr1, arr2) {
|
|
|
157
156
|
}
|
|
158
157
|
return arr1.every((x, index) => arr2.indexOf(x) == index);
|
|
159
158
|
}
|
|
160
|
-
/**
|
|
161
|
-
* Checks if two arrays contain the same elements (order-independent).
|
|
162
|
-
*
|
|
163
|
-
* @param arr1 First array to compare
|
|
164
|
-
* @param arr2 Second array to compare
|
|
165
|
-
* @param equalityFn Optional function to determine if two elements are equal
|
|
166
|
-
* @returns True if arrays contain the same elements, false otherwise
|
|
167
|
-
*/
|
|
168
159
|
function areArraysEqualWithCustomComparator(arr1, arr2, equalityFn) {
|
|
169
|
-
// Handle null/undefined cases
|
|
170
160
|
if (!arr1 && !arr2) {
|
|
171
161
|
return true;
|
|
172
162
|
}
|
|
173
163
|
if (!arr1 || !arr2) {
|
|
174
164
|
return false;
|
|
175
165
|
}
|
|
176
|
-
// Check length
|
|
177
166
|
if (arr1.length !== arr2.length) {
|
|
178
167
|
return false;
|
|
179
168
|
}
|
|
180
|
-
// Use default equality comparison if no custom function provided
|
|
181
169
|
const compareElements = equalityFn || ((a, b) => a === b);
|
|
182
|
-
// For each element in arr1, find a matching element in arr2
|
|
183
170
|
const arr2Copy = [...arr2];
|
|
184
171
|
for (let i = 0; i < arr1.length; i++) {
|
|
185
172
|
const element = arr1[i];
|
|
@@ -187,45 +174,34 @@ function areArraysEqualWithCustomComparator(arr1, arr2, equalityFn) {
|
|
|
187
174
|
if (matchIndex === -1) {
|
|
188
175
|
return false;
|
|
189
176
|
}
|
|
190
|
-
// Remove the matched element to prevent duplicate matches
|
|
191
177
|
arr2Copy.splice(matchIndex, 1);
|
|
192
178
|
}
|
|
193
179
|
return true;
|
|
194
180
|
}
|
|
195
181
|
function areArraysEqualWithOrderAndProperties(value, other) {
|
|
196
182
|
const type = Object.prototype.toString.call(value);
|
|
197
|
-
// If the two objects are not the same type, return false
|
|
198
183
|
if (type !== Object.prototype.toString.call(other)) {
|
|
199
184
|
return false;
|
|
200
185
|
}
|
|
201
|
-
// If items are not an object or array, return false
|
|
202
186
|
if (['[object Array]', '[object Object]'].indexOf(type) < 0) {
|
|
203
187
|
return false;
|
|
204
188
|
}
|
|
205
|
-
// Compare the length of the length of the two items
|
|
206
189
|
const valueLen = type === '[object Array]' ? value.length : Object.keys(value).length;
|
|
207
190
|
const otherLen = type === '[object Array]' ? other.length : Object.keys(other).length;
|
|
208
191
|
if (valueLen !== otherLen) {
|
|
209
192
|
return false;
|
|
210
193
|
}
|
|
211
|
-
// Compare two items
|
|
212
194
|
const compare = function (item1, item2) {
|
|
213
|
-
// Get the object type
|
|
214
195
|
const itemType = Object.prototype.toString.call(item1);
|
|
215
|
-
// If an object or array, compare recursively
|
|
216
196
|
if (['[object Array]', '[object Object]'].indexOf(itemType) >= 0) {
|
|
217
197
|
if (!areArraysEqualWithOrderAndProperties(item1, item2)) {
|
|
218
198
|
return false;
|
|
219
199
|
}
|
|
220
200
|
}
|
|
221
|
-
// Otherwise, do a simple comparison
|
|
222
201
|
else {
|
|
223
|
-
// If the two items are not the same type, return false
|
|
224
202
|
if (itemType !== Object.prototype.toString.call(item2)) {
|
|
225
203
|
return false;
|
|
226
204
|
}
|
|
227
|
-
// Else if it's a function, convert to a string and compare
|
|
228
|
-
// Otherwise, just compare
|
|
229
205
|
if (itemType === '[object Function]') {
|
|
230
206
|
if (item1.toString() !== item2.toString()) {
|
|
231
207
|
return false;
|
|
@@ -238,7 +214,6 @@ function areArraysEqualWithOrderAndProperties(value, other) {
|
|
|
238
214
|
}
|
|
239
215
|
}
|
|
240
216
|
};
|
|
241
|
-
// Compare properties
|
|
242
217
|
if (type === '[object Array]') {
|
|
243
218
|
for (let i = 0; i < valueLen; i++) {
|
|
244
219
|
if (compare(value[i], other[i]) === false) {
|
|
@@ -255,7 +230,6 @@ function areArraysEqualWithOrderAndProperties(value, other) {
|
|
|
255
230
|
}
|
|
256
231
|
}
|
|
257
232
|
}
|
|
258
|
-
// If nothing failed, return true
|
|
259
233
|
return true;
|
|
260
234
|
}
|
|
261
235
|
function sortArrayWithProperty(sortOrder, values, sortProperty) {
|
|
@@ -354,7 +328,6 @@ function SumArray(array) {
|
|
|
354
328
|
function reorderArray(array, startIndex, endIndex) {
|
|
355
329
|
const result = [...array];
|
|
356
330
|
if (startIndex > array.length - 1) {
|
|
357
|
-
// not much that we can do if the dragged item is out of bounds...
|
|
358
331
|
return result;
|
|
359
332
|
}
|
|
360
333
|
if (endIndex > array.length - 1) {
|
|
@@ -364,15 +337,7 @@ function reorderArray(array, startIndex, endIndex) {
|
|
|
364
337
|
result.splice(endIndex, 0, removed);
|
|
365
338
|
return result;
|
|
366
339
|
}
|
|
367
|
-
function sortArrayWithOrder(array, order,
|
|
368
|
-
/**
|
|
369
|
-
*
|
|
370
|
-
* The array can contain items which are not listed in the order array.
|
|
371
|
-
* So sortUnorderedItems decides whether to leave these items untouched
|
|
372
|
-
* in the current order in which they are in the array (sortUnorderedItems: false)
|
|
373
|
-
* or to sort them using normal comparison rules
|
|
374
|
-
*/
|
|
375
|
-
{ sortUnorderedItems }) {
|
|
340
|
+
function sortArrayWithOrder(array, order, { sortUnorderedItems }) {
|
|
376
341
|
const itemsToIndex = array.reduce((acc, x, i) => {
|
|
377
342
|
acc.set(x, i);
|
|
378
343
|
return acc;
|
|
@@ -390,10 +355,8 @@ function sortArrayWithOrder(array, order,
|
|
|
390
355
|
const indexInOrderSecondElement = orderContainsSecondElement
|
|
391
356
|
? orderItemsToIndex.get(valueB)
|
|
392
357
|
: -1;
|
|
393
|
-
//if none of the element are in the order list we just return normal compare
|
|
394
358
|
if (!orderContainsFirstElement && !orderContainsSecondElement) {
|
|
395
359
|
if (!sortUnorderedItems) {
|
|
396
|
-
// keep the original order
|
|
397
360
|
return itemsToIndex.get(valueA) - itemsToIndex.get(valueB);
|
|
398
361
|
}
|
|
399
362
|
if (valueA == valueB) {
|
|
@@ -401,24 +364,16 @@ function sortArrayWithOrder(array, order,
|
|
|
401
364
|
}
|
|
402
365
|
return valueA < valueB ? -1 : 1;
|
|
403
366
|
}
|
|
404
|
-
//if first item not in the list make sure we put it after the second item
|
|
405
367
|
if (!orderContainsFirstElement) {
|
|
406
368
|
return 1;
|
|
407
369
|
}
|
|
408
|
-
//if second item not in the list make sure we put it after the first item
|
|
409
370
|
if (!orderContainsSecondElement) {
|
|
410
371
|
return -1;
|
|
411
372
|
}
|
|
412
|
-
//return the comparison from the list if the two items are in the list
|
|
413
373
|
return indexInOrderOfFirstElement - indexInOrderSecondElement;
|
|
414
374
|
}
|
|
415
375
|
return [].concat(array).sort(compareItemsOfCustomSort);
|
|
416
376
|
}
|
|
417
|
-
/**
|
|
418
|
-
* Creates an array of elements split into groups the length of `size`.
|
|
419
|
-
* If `array` can't be split evenly, the final chunk will be the remaining elements.
|
|
420
|
-
* Drop-in replacement for lodash/chunk.
|
|
421
|
-
*/
|
|
422
377
|
function chunk(array, size = 1) {
|
|
423
378
|
const length = array.length;
|
|
424
379
|
if (!length || !(size >= 1)) {
|
|
@@ -431,32 +386,15 @@ function chunk(array, size = 1) {
|
|
|
431
386
|
}
|
|
432
387
|
return result;
|
|
433
388
|
}
|
|
434
|
-
/**
|
|
435
|
-
* Flattens array a single level deep.
|
|
436
|
-
* Drop-in replacement for lodash/flatten.
|
|
437
|
-
*/
|
|
438
389
|
function flatten(array) {
|
|
439
390
|
return array.flat();
|
|
440
391
|
}
|
|
441
|
-
/**
|
|
442
|
-
* Recursively flattens array.
|
|
443
|
-
* Drop-in replacement for lodash/flattenDeep.
|
|
444
|
-
*/
|
|
445
392
|
function flattenDeep(array) {
|
|
446
393
|
return array.flat(Infinity);
|
|
447
394
|
}
|
|
448
|
-
/**
|
|
449
|
-
* Creates a duplicate-free version of an array, using SameValueZero for equality
|
|
450
|
-
* comparisons, in which only the first occurrence of each element is kept.
|
|
451
|
-
* Drop-in replacement for lodash/uniq.
|
|
452
|
-
*/
|
|
453
395
|
function uniq(array) {
|
|
454
396
|
return [...new Set(array)];
|
|
455
397
|
}
|
|
456
|
-
/**
|
|
457
|
-
* Checks if `value` is classified as an Array object.
|
|
458
|
-
* Drop-in replacement for lodash/isArray.
|
|
459
|
-
*/
|
|
460
398
|
exports.isArray = Array.isArray;
|
|
461
399
|
exports.ArrayExtensions = {
|
|
462
400
|
GetLength,
|
|
@@ -30,14 +30,6 @@ function wrapInParentheses(numberToWrap) {
|
|
|
30
30
|
return ' (' + numberToWrap + ')';
|
|
31
31
|
}
|
|
32
32
|
function timesBy100(value) {
|
|
33
|
-
// the simple solution does not work
|
|
34
|
-
// return value * 100;
|
|
35
|
-
// needed because 0.12676 * 100 = 12.676000000000002
|
|
36
|
-
// but we dont want that to happen
|
|
37
|
-
// this solution does not handle -0 correctly
|
|
38
|
-
// also 1267.6 * 100 is 126759.99999999999
|
|
39
|
-
// which is not what we want
|
|
40
|
-
// return parseFloat((value * 100).toFixed(12));
|
|
41
33
|
if (isNaN(value) || !value) {
|
|
42
34
|
return value;
|
|
43
35
|
}
|
|
@@ -53,12 +45,6 @@ function timesBy100(value) {
|
|
|
53
45
|
return Number(num.join(''));
|
|
54
46
|
}
|
|
55
47
|
function divideBy100(value) {
|
|
56
|
-
// the simple solution does not work
|
|
57
|
-
// return value / 100;
|
|
58
|
-
// needed because 4012.3456/100 = 40.123456000000004
|
|
59
|
-
// but we dont want that to happen
|
|
60
|
-
// this solution does not handle -0 correctly
|
|
61
|
-
// return parseFloat((value / 100).toFixed(12));
|
|
62
48
|
if (isNaN(value) || !value) {
|
|
63
49
|
return value;
|
|
64
50
|
}
|
|
@@ -89,10 +75,6 @@ function avoidJavascriptPrecisionIssues(value) {
|
|
|
89
75
|
}
|
|
90
76
|
return newValue;
|
|
91
77
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Clamps `number` within the inclusive `lower` and `upper` bounds.
|
|
94
|
-
* Drop-in replacement for lodash/clamp.
|
|
95
|
-
*/
|
|
96
78
|
function clamp(value, lower, upper) {
|
|
97
79
|
return Math.min(Math.max(value, lower), upper);
|
|
98
80
|
}
|
|
@@ -117,10 +99,6 @@ const _reTrimEnd = /\s+$/;
|
|
|
117
99
|
const _reIsBinary = /^0b[01]+$/i;
|
|
118
100
|
const _reIsOctal = /^0o[0-7]+$/i;
|
|
119
101
|
const _reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
120
|
-
/**
|
|
121
|
-
* Converts value to a number.
|
|
122
|
-
* Drop-in replacement for lodash/toNumber.
|
|
123
|
-
*/
|
|
124
102
|
function toNumber(value) {
|
|
125
103
|
if (typeof value === 'number') {
|
|
126
104
|
return value;
|
|
@@ -150,11 +128,6 @@ function toNumber(value) {
|
|
|
150
128
|
const other = typeof value.valueOf === 'function' ? value.valueOf() : value;
|
|
151
129
|
return +other;
|
|
152
130
|
}
|
|
153
|
-
/**
|
|
154
|
-
* Converts string to an integer of the specified radix.
|
|
155
|
-
* If radix is undefined or 0, a radix of 10 is used (unlike native parseInt which auto-detects).
|
|
156
|
-
* Drop-in replacement for lodash/parseInt.
|
|
157
|
-
*/
|
|
158
131
|
function parseIntFn(string, radix) {
|
|
159
132
|
const str = typeof string === 'string' ? string.trim() : String(string);
|
|
160
133
|
return globalThis.parseInt(str, radix || 10);
|