@adaptabletools/adaptable-cjs 17.0.0-canary.4 → 18.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +62 -14
- package/base.css.map +1 -1
- package/index.css +267 -165
- package/index.css.map +1 -1
- package/package.json +5 -4
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
- package/src/AdaptableOptions/AdaptableOptions.d.ts +5 -0
- package/src/AdaptableOptions/AlertOptions.d.ts +7 -7
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +9 -9
- package/src/AdaptableOptions/CommentsOptions.d.ts +28 -0
- package/src/AdaptableOptions/EditOptions.d.ts +6 -6
- package/src/AdaptableOptions/GridFilterOptions.d.ts +13 -8
- package/src/AdaptableOptions/GroupingOptions.d.ts +9 -9
- package/src/AdaptableOptions/InteropioPluginOptions.d.ts +10 -0
- package/src/AdaptableOptions/MenuOptions.d.ts +18 -4
- package/src/AdaptableOptions/MenuOptions.js +14 -6
- package/src/AdaptableOptions/NotesOptions.d.ts +2 -9
- package/src/Api/AdaptableApi.d.ts +6 -1
- package/src/Api/CommentApi.d.ts +58 -0
- package/src/Api/EventApi.d.ts +48 -12
- package/src/Api/Events/CalculatedColumnChanged.d.ts +19 -0
- package/src/Api/Events/CellSelectionChanged.d.ts +11 -0
- package/src/Api/Events/CommentsChangedInfo.d.ts +5 -0
- package/src/Api/Events/LiveDataChanged.d.ts +3 -3
- package/src/Api/Events/RowSelectionChanged.d.ts +11 -0
- package/src/Api/GridApi.d.ts +0 -6
- package/src/Api/GridFilterApi.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +6 -6
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
- package/src/Api/Implementation/CommentsApiImpl.d.ts +15 -0
- package/src/Api/Implementation/CommentsApiImpl.js +46 -0
- package/src/Api/Implementation/ExpressionApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ExpressionApiImpl.js +3 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +0 -1
- package/src/Api/Implementation/GridApiImpl.js +0 -4
- package/src/Api/Implementation/GridFilterApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridFilterApiImpl.js +1 -1
- package/src/Api/Implementation/NotesApiImpl.d.ts +3 -7
- package/src/Api/Implementation/NotesApiImpl.js +1 -15
- package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -0
- package/src/Api/Implementation/OptionsApiImpl.js +3 -0
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -6
- package/src/Api/Implementation/PluginsApiImpl.js +3 -15
- package/src/Api/Implementation/ScheduleApiImpl.d.ts +1 -12
- package/src/Api/Implementation/ScheduleApiImpl.js +0 -36
- package/src/Api/Implementation/ThemeApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +3 -0
- package/src/Api/Internal/ActionRowInternalApi.js +1 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -0
- package/src/Api/Internal/AdaptableInternalApi.js +3 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +16 -0
- package/src/Api/Internal/DashboardInternalApi.d.ts +1 -0
- package/src/Api/Internal/DashboardInternalApi.js +5 -0
- package/src/Api/Internal/DataImportInternalApi.js +2 -0
- package/src/Api/Internal/DataSetInternalApi.js +2 -1
- package/src/Api/Internal/GridInternalApi.d.ts +3 -1
- package/src/Api/Internal/GridInternalApi.js +32 -9
- package/src/Api/Internal/LayoutInternalApi.d.ts +2 -2
- package/src/Api/Internal/LayoutInternalApi.js +11 -11
- package/src/Api/InteropioPluginApi.d.ts +10 -0
- package/src/Api/{NotesAPi.d.ts → NotesApi.d.ts} +19 -21
- package/src/Api/OptionsApi.d.ts +5 -0
- package/src/Api/PluginsApi.d.ts +3 -13
- package/src/Api/ScheduleApi.d.ts +1 -48
- package/src/Api/ThemeApi.d.ts +5 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +4 -2
- package/src/PredefinedConfig/CellAddress.d.ts +13 -0
- package/src/PredefinedConfig/CellAddress.js +5 -0
- package/src/PredefinedConfig/CommentState.d.ts +48 -0
- package/src/PredefinedConfig/CommentState.js +2 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +2 -1
- package/src/PredefinedConfig/Common/Enums.d.ts +0 -1
- package/src/PredefinedConfig/Common/Enums.js +0 -1
- package/src/PredefinedConfig/Common/Schedule.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +5 -5
- package/src/PredefinedConfig/Common/Types.js +0 -2
- package/src/PredefinedConfig/NotesState.d.ts +0 -13
- package/src/PredefinedConfig/PredefinedConfig.d.ts +3 -0
- package/src/PredefinedConfig/ScheduleState.d.ts +0 -5
- package/src/PredefinedConfig/SystemState.d.ts +5 -6
- package/src/PredefinedConfig/ThemeState.d.ts +1 -1
- package/src/Redux/ActionsReducers/CommentsRedux.d.ts +79 -0
- package/src/Redux/ActionsReducers/CommentsRedux.js +189 -0
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.js +4 -5
- package/src/Redux/ActionsReducers/PluginsRedux.d.ts +0 -48
- package/src/Redux/ActionsReducers/PluginsRedux.js +1 -49
- package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +16 -0
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +47 -1
- package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +0 -53
- package/src/Redux/ActionsReducers/ScheduleRedux.js +2 -90
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +23 -12
- package/src/Redux/ActionsReducers/SystemRedux.js +55 -23
- package/src/Redux/Store/AdaptableStore.d.ts +2 -2
- package/src/Redux/Store/AdaptableStore.js +107 -46
- package/src/Strategy/CommentsModule.d.ts +16 -0
- package/src/Strategy/CommentsModule.js +82 -0
- package/src/Strategy/LayoutModule.d.ts +12 -4
- package/src/Strategy/LayoutModule.js +19 -14
- package/src/Strategy/NotesModule.d.ts +0 -13
- package/src/Strategy/NotesModule.js +9 -88
- package/src/Strategy/PlusMinusModule.js +2 -0
- package/src/Strategy/ScheduleModule.js +0 -23
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.d.ts +2 -1
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +14 -5
- package/src/Strategy/Utilities/getExpressionViewItems.js +8 -2
- package/src/Utilities/Constants/ConfigConstants.d.ts +1 -0
- package/src/Utilities/Constants/ConfigConstants.js +2 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +8 -3
- package/src/Utilities/Constants/ModuleConstants.d.ts +3 -3
- package/src/Utilities/Constants/ModuleConstants.js +4 -4
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -3
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +7 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +6 -0
- package/src/Utilities/ExpressionFunctions/dateUtils.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/dateUtils.js +18 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +12 -12
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +8 -1
- package/src/Utilities/Helpers/PreviewHelper.js +5 -2
- package/src/Utilities/ObjectFactory.d.ts +19 -22
- package/src/Utilities/ObjectFactory.js +51 -60
- package/src/Utilities/Services/CellPopupService.d.ts +23 -0
- package/src/Utilities/Services/CellPopupService.js +138 -0
- package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
- package/src/Utilities/Services/Interface/IThemeService.d.ts +8 -0
- package/src/Utilities/Services/ModuleService.js +1 -3
- package/src/Utilities/Services/ReportService.d.ts +1 -1
- package/src/Utilities/Services/ThemeService.d.ts +3 -0
- package/src/Utilities/Services/ThemeService.js +33 -1
- package/src/Utilities/Services/ValidationService.js +11 -11
- package/src/View/AdaptableView.js +3 -3
- package/src/View/AdaptableViewFactory.js +4 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +1 -1
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -2
- package/src/View/Alert/Wizard/AlertRulesWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
- package/src/View/Charting/useChartingElements.js +8 -3
- package/src/View/Comments/CommentsEditor.d.ts +7 -0
- package/src/View/Comments/CommentsEditor.js +100 -0
- package/src/View/Comments/CommentsPopup.d.ts +2 -0
- package/src/View/Comments/CommentsPopup.js +87 -0
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +2 -1
- package/src/View/Components/CellPopup/index.js +1 -1
- package/src/View/Components/FilterForm/FilterForm.js +8 -2
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -3
- package/src/View/Components/FilterForm/QuickFilterForm.js +5 -4
- package/src/View/Components/FilterForm/QuickFilterValues.d.ts +2 -2
- package/src/View/Components/FilterForm/QuickFilterValues.js +4 -3
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.d.ts +5 -0
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +67 -0
- package/src/View/Components/Popups/GridCellPopup/index.d.ts +1 -0
- package/src/View/Components/Popups/GridCellPopup/index.js +5 -0
- package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
- package/src/View/Components/Selectors/ColumnSelector.js +2 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.d.ts +5 -4
- package/src/View/Components/Selectors/PermittedValuesSelector.js +25 -3
- package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -4
- package/src/View/Dashboard/ModuleToolbarWrapper.js +1 -1
- package/src/View/Dashboard/PinnedDashboard.js +2 -1
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +2 -2
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +3 -1
- package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
- package/src/View/GridFilter/GridFilterPopup.js +10 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +51 -14
- package/src/View/GridFilter/NamedQuerySelector.js +1 -1
- package/src/View/GridFilter/useGridFilterExpressionEditor.d.ts +3 -0
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +17 -6
- package/src/View/GridFilter/useGridFilterOptionsForExpressionEditor.js +5 -23
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +3 -2
- package/src/View/Layout/Wizard/getGridFilterPreview.d.ts +6 -0
- package/src/View/Layout/Wizard/getGridFilterPreview.js +16 -0
- package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
- package/src/View/Layout/Wizard/sections/GridFilterSection.js +4 -4
- package/src/View/NamedQuery/EditCurrentQueryButton.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/Notes/NoteEditor.d.ts +8 -0
- package/src/View/Notes/NoteEditor.js +33 -0
- package/src/View/Notes/NotesPopup.d.ts +2 -2
- package/src/View/Notes/NotesPopup.js +78 -55
- package/src/View/PlusMinus/MovePlusMinus.d.ts +7 -0
- package/src/View/PlusMinus/MovePlusMinus.js +27 -0
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +0 -9
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +0 -4
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.js +2 -8
- package/src/View/Schedule/Wizard/ScheduleWizard.js +0 -8
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +3 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -2
- package/src/agGrid/Adaptable.d.ts +7 -0
- package/src/agGrid/Adaptable.js +49 -35
- package/src/agGrid/BadgeRenderer.js +9 -5
- package/src/agGrid/agGridHelper.d.ts +2 -1
- package/src/agGrid/agGridHelper.js +15 -3
- package/src/agGrid/agGridMenuHelper.d.ts +2 -0
- package/src/agGrid/agGridMenuHelper.js +73 -25
- package/src/components/Datepicker/index.js +4 -4
- package/src/components/ExpressionEditor/ExpressionPreview.d.ts +7 -0
- package/src/components/ExpressionEditor/ExpressionPreview.js +25 -0
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.js +2 -2
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.d.ts +6 -0
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +40 -11
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +14 -2
- package/src/components/ExpressionEditor/QueryBuilder/booleanExpressions.js +1 -0
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -1
- package/src/components/ExpressionEditor/index.js +4 -7
- package/src/components/InputGroup/InputGroup.d.ts +7 -0
- package/src/components/InputGroup/InputGroup.js +12 -0
- package/src/components/InputGroup/index.d.ts +1 -0
- package/src/components/InputGroup/index.js +4 -0
- package/src/components/OverlayTrigger/index.js +7 -2
- package/src/components/Select/Select.d.ts +1 -2
- package/src/components/Select/Select.js +63 -23
- package/src/components/Textarea/index.d.ts +9 -0
- package/src/components/Textarea/index.js +50 -2
- package/src/components/Toastify/index.d.ts +2 -2
- package/src/components/Toastify/index.js +1 -1
- package/src/components/icons/comments.d.ts +3 -0
- package/src/components/icons/comments.js +7 -0
- package/src/components/icons/index.js +3 -1
- package/src/env.d.ts +3 -1
- package/src/env.js +3 -1
- package/src/metamodel/adaptable.metamodel.d.ts +72 -158
- package/src/metamodel/adaptable.metamodel.js +138 -260
- package/src/parser/src/parser.d.ts +2 -0
- package/src/parser/src/parser.js +1880 -705
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +5 -2
- package/src/parser/src/predicate/types.d.ts +1 -1
- package/src/parser/src/types.d.ts +1 -1
- package/src/renderReactRoot.js +15 -0
- package/src/themes/index.js +4 -0
- package/src/types.d.ts +10 -13
- package/themes/dark.css +3 -3
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +0 -35
- package/src/AdaptableOptions/Glue42PluginOptions.d.ts +0 -25
- package/src/AdaptableOptions/Glue42WebPluginOptions.d.ts +0 -10
- package/src/Api/Events/SelectionChanged.d.ts +0 -16
- package/src/Api/FinsembleApi.d.ts +0 -10
- package/src/Api/Glue42Api.d.ts +0 -75
- package/src/Api/Glue42WebApi.d.ts +0 -10
- package/src/PredefinedConfig/Glue42State.d.ts +0 -46
- package/src/View/Notes/NotesListing.d.ts +0 -2
- package/src/View/Notes/NotesListing.js +0 -88
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.d.ts +0 -9
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.js +0 -25
- package/src/bundle-dependencies/bundles/react-toastify/components/CloseButton.d.ts +0 -9
- package/src/bundle-dependencies/bundles/react-toastify/components/Icons.d.ts +0 -24
- package/src/bundle-dependencies/bundles/react-toastify/components/ProgressBar.d.ts +0 -59
- package/src/bundle-dependencies/bundles/react-toastify/components/Toast.d.ts +0 -3
- package/src/bundle-dependencies/bundles/react-toastify/components/ToastContainer.d.ts +0 -3
- package/src/bundle-dependencies/bundles/react-toastify/components/Transitions.d.ts +0 -6
- package/src/bundle-dependencies/bundles/react-toastify/components/index.d.ts +0 -6
- package/src/bundle-dependencies/bundles/react-toastify/core/eventManager.d.ts +0 -39
- package/src/bundle-dependencies/bundles/react-toastify/core/index.d.ts +0 -2
- package/src/bundle-dependencies/bundles/react-toastify/core/toast.d.ts +0 -41
- package/src/bundle-dependencies/bundles/react-toastify/hooks/index.d.ts +0 -2
- package/src/bundle-dependencies/bundles/react-toastify/hooks/useToast.d.ts +0 -10
- package/src/bundle-dependencies/bundles/react-toastify/hooks/useToastContainer.d.ts +0 -23
- package/src/bundle-dependencies/bundles/react-toastify/index.d.ts +0 -5
- package/src/bundle-dependencies/bundles/react-toastify/index.js +0 -1
- package/src/bundle-dependencies/bundles/react-toastify/inject-style.d.ts +0 -8
- package/src/bundle-dependencies/bundles/react-toastify/types/index.d.ts +0 -269
- package/src/bundle-dependencies/bundles/react-toastify/utils/collapseToast.d.ts +0 -5
- package/src/bundle-dependencies/bundles/react-toastify/utils/constant.d.ts +0 -23
- package/src/bundle-dependencies/bundles/react-toastify/utils/cssTransition.d.ts +0 -43
- package/src/bundle-dependencies/bundles/react-toastify/utils/index.d.ts +0 -5
- package/src/bundle-dependencies/bundles/react-toastify/utils/mapper.d.ts +0 -2
- package/src/bundle-dependencies/bundles/react-toastify/utils/propValidator.d.ts +0 -9
- /package/src/AdaptableOptions/{FinsemblePluginOptions.js → CommentsOptions.js} +0 -0
- /package/src/AdaptableOptions/{Glue42PluginOptions.js → InteropioPluginOptions.js} +0 -0
- /package/src/{AdaptableOptions/Glue42WebPluginOptions.js → Api/CommentApi.js} +0 -0
- /package/src/Api/Events/{SelectionChanged.js → CalculatedColumnChanged.js} +0 -0
- /package/src/Api/{FinsembleApi.js → Events/CellSelectionChanged.js} +0 -0
- /package/src/Api/{Glue42Api.js → Events/CommentsChangedInfo.js} +0 -0
- /package/src/Api/{Glue42WebApi.js → Events/RowSelectionChanged.js} +0 -0
- /package/src/Api/Internal/{ExpressionnternalApi.d.ts → ExpressionInternalApi.d.ts} +0 -0
- /package/src/Api/Internal/{ExpressionnternalApi.js → ExpressionInternalApi.js} +0 -0
- /package/src/Api/{NotesAPi.js → InteropioPluginApi.js} +0 -0
- /package/src/{PredefinedConfig/Glue42State.js → Api/NotesApi.js} +0 -0
|
@@ -57,7 +57,8 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
57
57
|
hideEvent = 'blur';
|
|
58
58
|
}
|
|
59
59
|
let showQuickFilterDropdown = true;
|
|
60
|
-
let hideQuickFilterDropdownFunction = this.props.api.optionsApi.getColumnFilterOptions().quickFilterOptions
|
|
60
|
+
let hideQuickFilterDropdownFunction = this.props.api.optionsApi.getColumnFilterOptions().quickFilterOptions
|
|
61
|
+
.hideQuickFilterDropdown;
|
|
61
62
|
if (hideQuickFilterDropdownFunction) {
|
|
62
63
|
const columnFilterContext = {
|
|
63
64
|
column: this.props.currentColumn,
|
|
@@ -79,7 +80,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
79
80
|
showQuickFilterInput = !hideQuickFilterInputFunction(columnFilterContext);
|
|
80
81
|
}
|
|
81
82
|
return (React.createElement(React.Fragment, null,
|
|
82
|
-
showQuickFilterDropdown && (React.createElement(OverlayTrigger_1.default, { className: "ab-QuickFilter", showEvent: showEvent, hideEvent: hideEvent, preventPortalEventPropagation: showEvent === 'click', targetOffset: 10, hideDelay:
|
|
83
|
+
showQuickFilterDropdown && (React.createElement(OverlayTrigger_1.default, { className: "ab-QuickFilter", showEvent: showEvent, hideEvent: hideEvent, preventPortalEventPropagation: showEvent === 'click', targetOffset: 10, hideDelay: 50, "data-name": "quick-filter-overlay", render: () => (React.createElement(rebass_1.Flex, { className: "ab-QuickFilter__dropdown", flexDirection: "column", "data-name": "quick-filter", fontSize: 2 },
|
|
83
84
|
(transientColumnFilter === null || transientColumnFilter === void 0 ? void 0 : transientColumnFilter.Predicate.PredicateId) && (React.createElement(SimpleButton_1.default, { p: 2, variant: "text", onClick: () => this.clearFilter() },
|
|
84
85
|
React.createElement("span", { style: { width: 20, marginRight: 10 } },
|
|
85
86
|
React.createElement(icons_1.Icon, { name: "delete" })),
|
|
@@ -102,7 +103,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
102
103
|
api.show();
|
|
103
104
|
this.shouldOpenValuesDropdown = false;
|
|
104
105
|
}
|
|
105
|
-
},
|
|
106
|
+
}, valuesFilterTrigger: this.props.valuesFilterTrigger }));
|
|
106
107
|
}
|
|
107
108
|
return (activePredicateDef &&
|
|
108
109
|
(activePredicateDef === null || activePredicateDef === void 0 ? void 0 : activePredicateDef.inputs) === undefined && (React.createElement(rebass_1.Box, { color: this.isFilterDisabled() ? undefined : 'var(--ab-color-text-on-primary)', disabled: this.isFilterDisabled(), p: 1, alignSelf: "center" }, activePredicateDef.label)));
|
|
@@ -252,6 +253,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
252
253
|
const QuickFilterForm = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(QuickFilterFormComponent);
|
|
253
254
|
const QuickFilterFormReact = (columnFilterProps) => {
|
|
254
255
|
var _a, _b, _c;
|
|
255
|
-
return (0, renderWithAdaptableContext_1.renderWithAdaptableContext)(React.createElement(QuickFilterForm, { api: columnFilterProps.Adaptable.api, quickFilterTrigger: (_a = columnFilterProps.Adaptable.adaptableOptions.columnFilterOptions) === null || _a === void 0 ? void 0 : _a.quickFilterOptions.quickFilterTrigger,
|
|
256
|
+
return (0, renderWithAdaptableContext_1.renderWithAdaptableContext)(React.createElement(QuickFilterForm, { api: columnFilterProps.Adaptable.api, quickFilterTrigger: (_a = columnFilterProps.Adaptable.adaptableOptions.columnFilterOptions) === null || _a === void 0 ? void 0 : _a.quickFilterOptions.quickFilterTrigger, valuesFilterTrigger: (_b = columnFilterProps.Adaptable.adaptableOptions.columnFilterOptions) === null || _b === void 0 ? void 0 : _b.valuesFilterOptions.valuesFilterTrigger, quickFilterDebounce: (_c = columnFilterProps.Adaptable.adaptableOptions.columnFilterOptions) === null || _c === void 0 ? void 0 : _c.quickFilterOptions.quickFilterDebounce, currentColumn: columnFilterProps.Column, teamSharingActivated: false, embedColumnMenu: columnFilterProps.Adaptable.embedColumnMenu }), columnFilterProps.Adaptable);
|
|
256
257
|
};
|
|
257
258
|
exports.QuickFilterFormReact = QuickFilterFormReact;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ColumnFilter } from '../../../PredefinedConfig/Common/ColumnFilter';
|
|
3
3
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
4
4
|
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
5
|
-
import {
|
|
5
|
+
import { ValuesFilterOptions } from '../../../types';
|
|
6
6
|
export interface QuickFilterValuesProps {
|
|
7
7
|
api: AdaptableApi;
|
|
8
8
|
currentColumn: AdaptableColumn;
|
|
@@ -14,6 +14,6 @@ export interface QuickFilterValuesProps {
|
|
|
14
14
|
show: () => any;
|
|
15
15
|
hide: () => any;
|
|
16
16
|
}) => void;
|
|
17
|
-
|
|
17
|
+
valuesFilterTrigger?: ValuesFilterOptions['valuesFilterTrigger'];
|
|
18
18
|
}
|
|
19
19
|
export declare const QuickFilterValues: (props: QuickFilterValuesProps) => JSX.Element;
|
|
@@ -99,7 +99,7 @@ const QuickFilterValues = (props) => {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
let showEvent = 'mouseenter';
|
|
102
|
-
if (props.
|
|
102
|
+
if (props.valuesFilterTrigger === 'click') {
|
|
103
103
|
showEvent = 'click';
|
|
104
104
|
}
|
|
105
105
|
let selectedValues = props.columnFilter.Predicate.PredicateId === 'Values' ? 'Select Values' : 'Exclude Values';
|
|
@@ -115,7 +115,8 @@ const QuickFilterValues = (props) => {
|
|
|
115
115
|
return label !== null && label !== void 0 ? label : input;
|
|
116
116
|
}).join(', ');
|
|
117
117
|
}
|
|
118
|
-
const quickFilterValuesWidth = props.api.optionsApi.getAdaptableOptions().columnFilterOptions.quickFilterOptions
|
|
118
|
+
const quickFilterValuesWidth = props.api.optionsApi.getAdaptableOptions().columnFilterOptions.quickFilterOptions
|
|
119
|
+
.quickFilterValuesWidth;
|
|
119
120
|
const getPopoverWidth = (targetWidth) => {
|
|
120
121
|
if (quickFilterValuesWidth === 'auto') {
|
|
121
122
|
return Math.max(180, targetWidth);
|
|
@@ -127,7 +128,7 @@ const QuickFilterValues = (props) => {
|
|
|
127
128
|
};
|
|
128
129
|
return (React.createElement(OverlayTrigger_1.default, { showEvent: showEvent,
|
|
129
130
|
// cannot hide on blur, because the form input receives the input when this is opened
|
|
130
|
-
hideEvent: "mouseleave", hideDelay:
|
|
131
|
+
hideEvent: "mouseleave", hideDelay: 50, ref: (api) => {
|
|
131
132
|
valuesDropdownRef.current = api;
|
|
132
133
|
props.registerValuesDropdownApi(api);
|
|
133
134
|
}, onVisibleChange: (visible) => {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GridCellPopup = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_redux_1 = require("react-redux");
|
|
7
|
+
const rebass_1 = require("rebass");
|
|
8
|
+
const NotesRedux_1 = require("../../../../Redux/ActionsReducers/NotesRedux");
|
|
9
|
+
const SystemRedux_1 = require("../../../../Redux/ActionsReducers/SystemRedux");
|
|
10
|
+
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
11
|
+
const CommentsEditor_1 = require("../../../Comments/CommentsEditor");
|
|
12
|
+
const NoteEditor_1 = require("../../../Notes/NoteEditor");
|
|
13
|
+
const CellPopup_1 = require("../../CellPopup");
|
|
14
|
+
const ConnectedNoteEditor = ({ enableEditMode }) => {
|
|
15
|
+
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
16
|
+
const isReadonly = api.entitlementApi.isModuleReadOnlyEntitlement('Notes');
|
|
17
|
+
const editMode = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemCommentsAndNotesEditModeSelector)(state.System));
|
|
18
|
+
const cellPopupService = api.internalApi.getCellPopupService();
|
|
19
|
+
const cellAddress = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemCommentsAndNotesSelector)(state.System));
|
|
20
|
+
const [
|
|
21
|
+
// Only handle first note for now
|
|
22
|
+
// Later we can handle multiple notes
|
|
23
|
+
note,] = (0, react_redux_1.useSelector)((state) => {
|
|
24
|
+
return cellAddress ? (0, NotesRedux_1.GetNotesSelector)(state.Notes, cellAddress) : [];
|
|
25
|
+
});
|
|
26
|
+
const handleNoteChange = React.useCallback((value) => {
|
|
27
|
+
api.notesApi.updateNoteText(value, note);
|
|
28
|
+
}, [note]);
|
|
29
|
+
return (React.createElement(rebass_1.Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotesPopup" },
|
|
30
|
+
React.createElement(NoteEditor_1.NoteEditor, { isReadonly: isReadonly, editMode: editMode, key: note === null || note === void 0 ? void 0 : note.Uuid, onClose: () => cellPopupService.hidePopup(), note: note === null || note === void 0 ? void 0 : note.Value, onNoteChange: (value) => handleNoteChange(value) })));
|
|
31
|
+
};
|
|
32
|
+
const GridCellPopup = (props) => {
|
|
33
|
+
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
34
|
+
const cellPopupRef = React.useRef(null);
|
|
35
|
+
const editMode = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemCommentsAndNotesEditModeSelector)(state.System));
|
|
36
|
+
const focusedEntity = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemCommentsAndNotesFocusedEntitySelector)(state.System));
|
|
37
|
+
const cellAddress = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemCommentsAndNotesSelector)(state.System));
|
|
38
|
+
const enableEditMode = (entity) => {
|
|
39
|
+
if (!editMode) {
|
|
40
|
+
const cellPopupService = api.internalApi.getCellPopupService();
|
|
41
|
+
cellPopupService.showPopup(cellAddress, true);
|
|
42
|
+
cellPopupService.editFocusedEntity(entity);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
(_b = (_a = cellPopupRef === null || cellPopupRef === void 0 ? void 0 : cellPopupRef.current) === null || _a === void 0 ? void 0 : _a.refreshContent) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
48
|
+
}, [focusedEntity]);
|
|
49
|
+
if (!cellAddress) {
|
|
50
|
+
return React.createElement(React.Fragment, null);
|
|
51
|
+
}
|
|
52
|
+
const noteEditor = React.createElement(ConnectedNoteEditor, { enableEditMode: () => enableEditMode('Note') });
|
|
53
|
+
const commentEditor = (React.createElement(CommentsEditor_1.CommentsEditor, { onRefreshContent: () => { var _a, _b; return (_b = (_a = cellPopupRef === null || cellPopupRef === void 0 ? void 0 : cellPopupRef.current) === null || _a === void 0 ? void 0 : _a.refreshContent) === null || _b === void 0 ? void 0 : _b.call(_a); }, enableEditMode: () => enableEditMode('Comment') }));
|
|
54
|
+
return (React.createElement(CellPopup_1.CellPopup, { ref: cellPopupRef, key: `${cellAddress.PrimaryKeyValue}-${cellAddress.ColumnId}`, isOpen: true, primaryKeyValue: cellAddress.PrimaryKeyValue, columnId: cellAddress.ColumnId }, (() => {
|
|
55
|
+
switch (focusedEntity) {
|
|
56
|
+
case 'Note':
|
|
57
|
+
return noteEditor;
|
|
58
|
+
case 'Comment':
|
|
59
|
+
return commentEditor;
|
|
60
|
+
default:
|
|
61
|
+
return (React.createElement(React.Fragment, null,
|
|
62
|
+
noteEditor,
|
|
63
|
+
commentEditor));
|
|
64
|
+
}
|
|
65
|
+
})()));
|
|
66
|
+
};
|
|
67
|
+
exports.GridCellPopup = GridCellPopup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GridCellPopup } from './GridCellPopup';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GridCellPopup = void 0;
|
|
4
|
+
var GridCellPopup_1 = require("./GridCellPopup");
|
|
5
|
+
Object.defineProperty(exports, "GridCellPopup", { enumerable: true, get: function () { return GridCellPopup_1.GridCellPopup; } });
|
|
@@ -9,5 +9,6 @@ export type ColumnSelectorProps<IsMulti extends boolean = false> = {
|
|
|
9
9
|
filterColumn?: (column: AdaptableColumn) => boolean;
|
|
10
10
|
value?: IsMulti extends true ? string[] : string;
|
|
11
11
|
onChange: (column: IsMulti extends true ? string[] : string) => void;
|
|
12
|
+
placeholder?: string;
|
|
12
13
|
};
|
|
13
14
|
export declare const ColumnSelector: <IsMulti extends boolean = false>(props: ColumnSelectorProps<IsMulti>) => JSX.Element;
|
|
@@ -6,6 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const Select_1 = require("../../../components/Select");
|
|
7
7
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
8
8
|
const ColumnSelector = function (props) {
|
|
9
|
+
var _a;
|
|
9
10
|
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
10
11
|
const columns = React.useMemo(() => {
|
|
11
12
|
return api.columnApi.getColumnsOfType(props.type);
|
|
@@ -25,7 +26,7 @@ const ColumnSelector = function (props) {
|
|
|
25
26
|
}
|
|
26
27
|
return true;
|
|
27
28
|
});
|
|
28
|
-
return (React.createElement(Select_1.Select, { "data-name": "column-selector", disabled: props.disabled, isMulti: props.isMulti, menuPosition: props.menuPosition, value: props.value, placeholder:
|
|
29
|
+
return (React.createElement(Select_1.Select, { "data-name": "column-selector", disabled: props.disabled, isMulti: props.isMulti, menuPosition: props.menuPosition, value: props.value, placeholder: (_a = props.placeholder) !== null && _a !== void 0 ? _a : 'Select Column', onChange: (colId) => {
|
|
29
30
|
props.onChange(colId);
|
|
30
31
|
}, options: options }));
|
|
31
32
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export type ValueType = number | string | Date;
|
|
3
|
-
interface PermittedValuesSelectorProps<Value extends ValueType> {
|
|
3
|
+
interface PermittedValuesSelectorProps<Value extends ValueType, IsMulti extends boolean> {
|
|
4
|
+
isMulti?: IsMulti;
|
|
4
5
|
columnId: string;
|
|
5
|
-
value: Value;
|
|
6
|
-
onChange: (value: Value) => void;
|
|
6
|
+
value: IsMulti extends true ? Value[] : Value;
|
|
7
|
+
onChange: (value: IsMulti extends true ? Value[] : Value) => void;
|
|
7
8
|
allowNewValues?: boolean;
|
|
8
9
|
className?: string;
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
placeholder?: string;
|
|
11
12
|
}
|
|
12
|
-
export declare const PermittedValuesSelector: <Value extends ValueType>(props: PermittedValuesSelectorProps<Value>) => JSX.Element;
|
|
13
|
+
export declare const PermittedValuesSelector: <Value extends ValueType, IsMulti extends boolean = false>(props: PermittedValuesSelectorProps<Value, IsMulti>) => JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -30,8 +30,7 @@ const PermittedValuesSelector = function (props) {
|
|
|
30
30
|
})();
|
|
31
31
|
}, [props.columnId, filter]);
|
|
32
32
|
const isCreatable = props.allowNewValues && ['String', 'Number'].includes(columnType);
|
|
33
|
-
const
|
|
34
|
-
// convert numbers
|
|
33
|
+
const handleSingleValueChange = (value) => {
|
|
35
34
|
if (isCreatable) {
|
|
36
35
|
if (columnType === 'Number') {
|
|
37
36
|
let num = parseFloat(value);
|
|
@@ -46,6 +45,29 @@ const PermittedValuesSelector = function (props) {
|
|
|
46
45
|
props.onChange(value);
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
|
-
|
|
48
|
+
const handleMultiValueChange = (values) => {
|
|
49
|
+
if (isCreatable) {
|
|
50
|
+
if (columnType === 'Number') {
|
|
51
|
+
const nums = values.map((v) => parseFloat(v)).filter((v) => !isNaN(v));
|
|
52
|
+
props.onChange(nums);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
props.onChange(values);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
props.onChange(values);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const handleOnChange = (value) => {
|
|
63
|
+
// convert numbers
|
|
64
|
+
if (props.isMulti) {
|
|
65
|
+
handleMultiValueChange(value);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
handleSingleValueChange(value);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return (React.createElement(Select_1.Select, { isMulti: props.isMulti, className: props.className, disabled: props.disabled, "data-name": "permitted-values-selector", placeholder: props.placeholder || (props.allowNewValues ? 'Select or type new value' : 'Select value'), isCreatable: isCreatable, isClearable: true, options: options, isLoding: isLoading, onInputChange: setFilter, onChange: handleOnChange, value: props.value }));
|
|
50
72
|
};
|
|
51
73
|
exports.PermittedValuesSelector = PermittedValuesSelector;
|
|
@@ -44,10 +44,7 @@ const ToolPanelWrapper = (props) => {
|
|
|
44
44
|
const isMinimised = visibilityMode === 'collapsed';
|
|
45
45
|
const isConfigurable =
|
|
46
46
|
// only module toolPanels are configurable
|
|
47
|
-
!!moduleInfo &&
|
|
48
|
-
toolPanelName !== 'OpenFin' &&
|
|
49
|
-
toolPanelName !== 'IPushPull' &&
|
|
50
|
-
toolPanelName !== 'Glue42';
|
|
47
|
+
!!moduleInfo && toolPanelName !== 'OpenFin' && toolPanelName !== 'IPushPull';
|
|
51
48
|
const isToolPanelModuleConfigurable = api.internalApi
|
|
52
49
|
.getModuleService()
|
|
53
50
|
.getModuleById(ModuleConstants_1.ToolPanelModuleId)
|
|
@@ -11,7 +11,7 @@ const ModuleToolbarWrapper = (props) => {
|
|
|
11
11
|
const moduleName = props.moduleInfo.ModuleName;
|
|
12
12
|
const moduleFriendlyName = props.moduleInfo.FriendlyName;
|
|
13
13
|
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
14
|
-
const isConfigurable = moduleName !== 'OpenFin' && moduleName !== 'IPushPull'
|
|
14
|
+
const isConfigurable = moduleName !== 'OpenFin' && moduleName !== 'IPushPull';
|
|
15
15
|
return (React.createElement(PanelDashboard_1.PanelDashboard, { className: `ab-DashboardToolbar__${moduleName}`, "data-name": `ab-DashboardToolbar__${moduleName}`, headerText: moduleFriendlyName, showConfigureButton: isConfigurable, onConfigure: () => {
|
|
16
16
|
const maxWidth = api.internalApi.getModuleService().getPopupMaxWidth(moduleName);
|
|
17
17
|
const popupParams = maxWidth
|
|
@@ -11,7 +11,8 @@ const PinnedDashboard = (props) => {
|
|
|
11
11
|
var _a;
|
|
12
12
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
13
13
|
const dashboardState = (0, react_redux_1.useSelector)((state) => state.Dashboard);
|
|
14
|
-
const pinnedToolbars = ((_a = dashboardState.PinnedToolbars) !== null && _a !== void 0 ? _a : []).filter((tb) => adaptable.api.internalApi.
|
|
14
|
+
const pinnedToolbars = ((_a = dashboardState.PinnedToolbars) !== null && _a !== void 0 ? _a : []).filter((tb) => adaptable.api.dashboardApi.internalApi.isToolbarCustom(tb) ||
|
|
15
|
+
adaptable.api.internalApi.getModuleService().isModuleAvailable(tb));
|
|
15
16
|
if (!pinnedToolbars || pinnedToolbars.length == 0) {
|
|
16
17
|
return React.createElement(React.Fragment, null);
|
|
17
18
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DataPreview = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../../components/HelpBlock"));
|
|
8
8
|
const icons_1 = require("../../../../components/icons");
|
|
@@ -130,7 +130,7 @@ const DataPreview = (props) => {
|
|
|
130
130
|
};
|
|
131
131
|
return (React.createElement(InfiniteTable_1.DataSource, { data: props.data, primaryKey: primaryKey, onDataMutations: (params) => {
|
|
132
132
|
const newRowData = [...props.data];
|
|
133
|
-
const mutationsList = (0,
|
|
133
|
+
const mutationsList = (0, flatten_1.default)(Array.from(params.mutations.values()));
|
|
134
134
|
if (!mutationsList.length) {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
@@ -6,6 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const ExpressionEditor_1 = require("../../../components/ExpressionEditor");
|
|
9
|
+
const ExpressionPreview_1 = require("../../../components/ExpressionEditor/ExpressionPreview");
|
|
9
10
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
10
11
|
const Tabs_1 = require("../../../components/Tabs");
|
|
11
12
|
const Tag_1 = require("../../../components/Tag");
|
|
@@ -32,7 +33,8 @@ const renderReportRowsSummary = (report) => {
|
|
|
32
33
|
report.ReportRowScope === 'ExpressionRows' ? (React.createElement(React.Fragment, null,
|
|
33
34
|
"Include Rows matching the query:",
|
|
34
35
|
' ',
|
|
35
|
-
React.createElement(Tag_1.Tag, null,
|
|
36
|
+
React.createElement(Tag_1.Tag, null,
|
|
37
|
+
React.createElement(ExpressionPreview_1.ExpressionPreview, { query: report.Query })))) : null));
|
|
36
38
|
};
|
|
37
39
|
exports.renderReportRowsSummary = renderReportRowsSummary;
|
|
38
40
|
const ReportRowsWizardSection = (props) => {
|
|
@@ -99,7 +99,7 @@ const GridFilterExpressionEditor = (props) => {
|
|
|
99
99
|
} }, "CLOSE")),
|
|
100
100
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
101
101
|
React.createElement(SimpleButton_1.default, { disabled: actionsDisabled, onClick: handleSaveQuery, icon: "save" }, "Save Query"),
|
|
102
|
-
React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-run", margin: 1, onClick: () => {
|
|
102
|
+
React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-run", margin: 1, icon: "play", onClick: () => {
|
|
103
103
|
var _a;
|
|
104
104
|
if (namedQuery) {
|
|
105
105
|
onAddNamedQuery({
|
|
@@ -9,6 +9,7 @@ const FieldWrap_1 = tslib_1.__importDefault(require("../../components/FieldWrap"
|
|
|
9
9
|
const FormLayout_1 = tslib_1.__importStar(require("../../components/FormLayout"));
|
|
10
10
|
const Input_1 = tslib_1.__importDefault(require("../../components/Input"));
|
|
11
11
|
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
12
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
12
13
|
const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
|
|
13
14
|
const ButtonExpand_1 = require("../Components/Buttons/ButtonExpand");
|
|
14
15
|
const ButtonInvalid_1 = require("../Components/Buttons/ButtonInvalid");
|
|
@@ -20,27 +21,28 @@ const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
|
20
21
|
const NamedQuerySelector_1 = require("./NamedQuerySelector");
|
|
21
22
|
const useGridFilterExpressionEditor_1 = require("./useGridFilterExpressionEditor");
|
|
22
23
|
const GridFilterPopup = () => {
|
|
23
|
-
const { cachedQueries, expression, setExpression, isExpressionNamedQuery, isExpressionValid, isSuspended, gridFilter, namedQueries, availableColumns, runQuery, onExpand, clearQuery, namedQueryModuleAccessLevel, saveQuery, suspendGridFilter, unSuspendGridFilter, setGridFilterExpression, gridFilterAccessLevel, } = (0, useGridFilterExpressionEditor_1.useGridFilterExpressionEditor)();
|
|
24
|
+
const { cachedQueries, expression, setExpression, isExpressionNamedQuery, isExpressionValid, isSuspended, gridFilter, namedQueries, availableColumns, runQuery, onExpand, clearQuery, namedQueryModuleAccessLevel, saveQuery, suspendGridFilter, unSuspendGridFilter, setGridFilterExpression, gridFilterAccessLevel, gridFilterHelpPage, gridFilterLinkDisabled, isReadOnly, } = (0, useGridFilterExpressionEditor_1.useGridFilterExpressionEditor)();
|
|
24
25
|
const handleEnter = (e) => {
|
|
25
26
|
if (e.key === 'Enter') {
|
|
26
27
|
runQuery();
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
const disabled = isSuspended || gridFilterAccessLevel === 'ReadOnly';
|
|
30
|
-
return (React.createElement(PopupPanel_1.PopupPanel, { className: "ab-GridFilter", headerText: "Grid Filter", glyphicon: "grid-filter" },
|
|
30
|
+
const disabled = isReadOnly || isSuspended || gridFilterAccessLevel === 'ReadOnly';
|
|
31
|
+
return (React.createElement(PopupPanel_1.PopupPanel, { className: "ab-GridFilter", headerText: "Grid Filter", glyphicon: "grid-filter", infoLink: gridFilterHelpPage, infoLinkDisabled: gridFilterLinkDisabled },
|
|
31
32
|
React.createElement(Panel_1.default, { bodyProps: { height: '100%' }, height: "100%" },
|
|
32
33
|
React.createElement(FormLayout_1.default, null,
|
|
33
34
|
React.createElement(FormLayout_1.FormRow, { label: "Expression" },
|
|
34
35
|
React.createElement(FieldWrap_1.default, { marginRight: 1, width: "100%" },
|
|
35
|
-
React.createElement(ButtonExpand_1.ButtonExpand, { disabled: disabled, variant: "text", tone: "neutral", onClick: onExpand, tooltip: "
|
|
36
|
+
React.createElement(ButtonExpand_1.ButtonExpand, { disabled: disabled, variant: "text", tone: "neutral", onClick: onExpand, tooltip: "Edit the Expression in UI", marginLeft: 1 }),
|
|
36
37
|
React.createElement(Input_1.default, { onKeyDown: handleEnter, disabled: disabled, type: "text", "data-name": "grid-filter-input", placeholder: "Grid Filter", spellCheck: false, value: expression, onChange: (x) => setExpression(x.target.value), style: { fontFamily: 'monospace', fontSize: 12 } }),
|
|
37
|
-
isExpressionValid
|
|
38
|
+
isExpressionValid && (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => runQuery(), tooltip: '', accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || expression == '' || expression == (gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression), marginRight: 1 })),
|
|
39
|
+
gridFilter && !isExpressionValid && (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Grid Filter", marginRight: 1 })),
|
|
38
40
|
' ',
|
|
39
|
-
(
|
|
41
|
+
StringExtensions_1.default.IsNotNullOrEmpty(expression) && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel })))),
|
|
40
42
|
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
41
43
|
React.createElement(rebass_1.Flex, { justifyContent: "space-around" },
|
|
42
|
-
React.createElement(ButtonSave_1.ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: !isExpressionValid || isExpressionNamedQuery || expression == '', variant: "text", tone: "neutral", marginRight: 1 }, "Save"),
|
|
43
|
-
isSuspended ? (React.createElement(ButtonUnsuspend_1.ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }, "Resume")) : (React.createElement(ButtonPause_1.ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled:
|
|
44
|
+
React.createElement(ButtonSave_1.ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: disabled || !isExpressionValid || isExpressionNamedQuery || expression == '', variant: "text", tone: "neutral", marginRight: 1 }, "Save"),
|
|
45
|
+
isSuspended ? (React.createElement(ButtonUnsuspend_1.ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }, "Resume")) : (React.createElement(ButtonPause_1.ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }, "Suspend")),
|
|
44
46
|
React.createElement(DropdownButton_1.default, { disabled: disabled, variant: "text", items: availableColumns, marginRight: 1, tooltip: "Pick Columns", icon: "list", iconPosition: "start" }, "Columns"),
|
|
45
47
|
React.createElement(NamedQuerySelector_1.NamedQuerySelector, { disabled: disabled, namedQueries: namedQueries, cachedQueries: cachedQueries, currentQuery: gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression, onSelect: (query) => runQuery(query), setGridFilterExpression: (query) => setGridFilterExpression(query) }, "Named Queries")))))));
|
|
46
48
|
};
|
|
@@ -4,10 +4,11 @@ exports.GridFilterPanelControl = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
7
8
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
|
|
8
9
|
const FieldWrap_1 = tslib_1.__importDefault(require("../../components/FieldWrap"));
|
|
10
|
+
const Textarea_1 = tslib_1.__importDefault(require("../../components/Textarea"));
|
|
9
11
|
const icons_1 = require("../../components/icons");
|
|
10
|
-
const Input_1 = tslib_1.__importDefault(require("../../components/Input"));
|
|
11
12
|
const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
|
|
12
13
|
const ButtonExpand_1 = require("../Components/Buttons/ButtonExpand");
|
|
13
14
|
const ButtonInvalid_1 = require("../Components/Buttons/ButtonInvalid");
|
|
@@ -18,33 +19,69 @@ const ButtonUnsuspend_1 = require("../Components/Buttons/ButtonUnsuspend");
|
|
|
18
19
|
const NamedQuerySelector_1 = require("./NamedQuerySelector");
|
|
19
20
|
const useGridFilterExpressionEditor_1 = require("./useGridFilterExpressionEditor");
|
|
20
21
|
const QueryViewPanelComponent = (props) => {
|
|
21
|
-
const { cachedQueries, expression, setExpression, isExpressionNamedQuery, isExpressionValid, isSuspended, gridFilter, isAdaptableReady, namedQueries, availableColumns, runQuery, onExpand, clearQuery, namedQueryModuleAccessLevel, saveQuery, suspendGridFilter, unSuspendGridFilter, setGridFilterExpression, gridFilterAccessLevel, } = (0, useGridFilterExpressionEditor_1.useGridFilterExpressionEditor)();
|
|
22
|
+
const { cachedQueries, expression, setExpression, isExpressionNamedQuery, isExpressionValid, isSuspended, gridFilter, isAdaptableReady, namedQueries, availableColumns, runQuery, onExpand, clearQuery, namedQueryModuleAccessLevel, saveQuery, suspendGridFilter, unSuspendGridFilter, setGridFilterExpression, gridFilterAccessLevel, isReadOnly, } = (0, useGridFilterExpressionEditor_1.useGridFilterExpressionEditor)();
|
|
22
23
|
if (!isAdaptableReady) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
26
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
27
|
+
const disabled = isReadOnly || isSuspended || gridFilterAccessLevel === 'ReadOnly';
|
|
26
28
|
const handleEnter = (e) => {
|
|
27
29
|
if (e.key === 'Enter') {
|
|
28
30
|
runQuery();
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
|
-
const buttonExpand = (React.createElement(ButtonExpand_1.ButtonExpand, { disabled:
|
|
33
|
+
const buttonExpand = (React.createElement(ButtonExpand_1.ButtonExpand, { disabled: disabled, accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", onClick: onExpand, tooltip: "Edit the Expression in UI", marginLeft: 1 }));
|
|
32
34
|
const renderTextInput = () => {
|
|
33
|
-
return props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 500 },
|
|
35
|
+
return props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 500, style: { overflow: 'visible' } },
|
|
34
36
|
buttonExpand,
|
|
35
|
-
React.createElement(
|
|
36
|
-
|
|
37
|
+
React.createElement(rebass_1.Box, { style: {
|
|
38
|
+
position: 'relative',
|
|
39
|
+
height: '100%',
|
|
40
|
+
}, flex: 1 },
|
|
41
|
+
React.createElement(Textarea_1.default, { "data-name": "grid-filter-input", autoResizeOnFocus: true, style: {
|
|
42
|
+
left: 0,
|
|
43
|
+
top: 0,
|
|
44
|
+
right: 0,
|
|
45
|
+
border: 0,
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
resize: 'none',
|
|
48
|
+
fontFamily: 'monospace',
|
|
49
|
+
fontSize: 12,
|
|
50
|
+
maxHeight: 52,
|
|
51
|
+
height: 21,
|
|
52
|
+
paddingTop: 7,
|
|
53
|
+
zIndex: 100,
|
|
54
|
+
}, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression })),
|
|
55
|
+
isExpressionValid && (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => runQuery(), tooltip: '', accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || expression == '' || expression == (gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression), marginRight: 1 })),
|
|
56
|
+
gridFilter && !isExpressionValid && (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Grid Filter", marginRight: 1 })),
|
|
37
57
|
' ',
|
|
38
|
-
(
|
|
58
|
+
StringExtensions_1.default.IsNotNullOrEmpty(expression) && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel })))) : (React.createElement(FieldWrap_1.default, { width: "100%", overflow: "visible" },
|
|
39
59
|
' ',
|
|
40
60
|
buttonExpand,
|
|
41
|
-
React.createElement(
|
|
61
|
+
React.createElement(rebass_1.Box, { style: {
|
|
62
|
+
position: 'relative',
|
|
63
|
+
minHeight: 40,
|
|
64
|
+
width: '100%',
|
|
65
|
+
}, flex: 1 },
|
|
66
|
+
React.createElement(Textarea_1.default, { "data-name": "grid-filter-input", autoResizeOnFocus: true, style: {
|
|
67
|
+
left: 0,
|
|
68
|
+
top: 0,
|
|
69
|
+
right: 0,
|
|
70
|
+
border: 0,
|
|
71
|
+
position: 'absolute',
|
|
72
|
+
resize: 'none',
|
|
73
|
+
fontFamily: 'monospace',
|
|
74
|
+
fontSize: 12,
|
|
75
|
+
maxHeight: 60,
|
|
76
|
+
paddingTop: 7,
|
|
77
|
+
zIndex: 100,
|
|
78
|
+
}, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression }))));
|
|
42
79
|
};
|
|
43
|
-
const saveButton = (React.createElement(ButtonSave_1.ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled:
|
|
44
|
-
const suspendButton = (React.createElement(ButtonPause_1.ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
45
|
-
const unSuspendButton = (React.createElement(ButtonUnsuspend_1.ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
80
|
+
const saveButton = (React.createElement(ButtonSave_1.ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: disabled || !isExpressionValid || isExpressionNamedQuery || expression == '', variant: "text", tone: "neutral", marginRight: 1 }));
|
|
81
|
+
const suspendButton = (React.createElement(ButtonPause_1.ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
82
|
+
const unSuspendButton = (React.createElement(ButtonUnsuspend_1.ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
46
83
|
const namedQuerySelector = (React.createElement(NamedQuerySelector_1.NamedQuerySelector, { namedQueries: namedQueries, cachedQueries: cachedQueries, currentQuery: gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression, onSelect: (query) => runQuery(query), setGridFilterExpression: (query) => setGridFilterExpression(query) }));
|
|
47
|
-
const columnsDropdown = (React.createElement(DropdownButton_1.default, { disabled:
|
|
84
|
+
const columnsDropdown = (React.createElement(DropdownButton_1.default, { disabled: disabled, accessLevel: gridFilterAccessLevel, variant: "text", items: availableColumns, marginRight: 1, tooltip: "Pick Columns" },
|
|
48
85
|
React.createElement(icons_1.Icon, { name: 'list' })));
|
|
49
86
|
const renderButtons = () => {
|
|
50
87
|
return props.viewType === 'Toolbar' ? (React.createElement(React.Fragment, null,
|
|
@@ -53,7 +90,7 @@ const QueryViewPanelComponent = (props) => {
|
|
|
53
90
|
columnsDropdown,
|
|
54
91
|
namedQuerySelector,
|
|
55
92
|
' ')) : (React.createElement(React.Fragment, null,
|
|
56
|
-
React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => runQuery(), tooltip: "Run Grid Filter", accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled:
|
|
93
|
+
React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => runQuery(), tooltip: "Run Grid Filter", accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || !isExpressionValid || expression == '' || expression == gridFilter, marginRight: 1 }),
|
|
57
94
|
' ',
|
|
58
95
|
React.createElement(ButtonClear_1.ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel, disabled: expression == '' }),
|
|
59
96
|
' ',
|
|
@@ -62,7 +99,7 @@ const QueryViewPanelComponent = (props) => {
|
|
|
62
99
|
namedQuerySelector));
|
|
63
100
|
};
|
|
64
101
|
return (React.createElement(rebass_1.Flex, { onKeyDown: handleEnter, flexDirection: "row", className: `ab-${elementType}__Query__wrap`, flexWrap: props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
65
|
-
React.createElement(rebass_1.Flex,
|
|
102
|
+
React.createElement(rebass_1.Flex, { width: props.viewType === 'ToolPanel' ? '100%' : 'auto' }, renderTextInput()),
|
|
66
103
|
React.createElement(rebass_1.Flex, null, renderButtons())));
|
|
67
104
|
};
|
|
68
105
|
exports.GridFilterPanelControl = QueryViewPanelComponent;
|
|
@@ -48,7 +48,7 @@ const NamedQuerySelector = (props) => {
|
|
|
48
48
|
cachedQueries ? (React.createElement(React.Fragment, null,
|
|
49
49
|
React.createElement(Panel_1.default, { mt: 2, header: "Recent Grid Filters" },
|
|
50
50
|
React.createElement(rebass_1.Flex, { flexDirection: "column" }, cachedQueries.map((cachedQuery, index) => {
|
|
51
|
-
return (React.createElement(SimpleButton_1.default, { mb: 2, variant: "text", key: index, onClick: cachedQuery.onClick }, cachedQuery.label));
|
|
51
|
+
return (React.createElement(SimpleButton_1.default, { disabled: props.disabled, mb: 2, variant: "text", key: index, onClick: cachedQuery.onClick }, cachedQuery.label));
|
|
52
52
|
}))))) : null),
|
|
53
53
|
] },
|
|
54
54
|
React.createElement(SimpleButton_1.default, { disabled: props.disabled, variant: "text", icon: "folder-open" }, props.children))) : (React.createElement(ButtonOpen_1.ButtonOpen, { tooltip: "Load Named Query", disabled: true }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CachedQuery } from '../../PredefinedConfig/NamedQueryState';
|
|
3
3
|
export declare const useGridFilterExpressionEditor: () => {
|
|
4
|
+
isReadOnly: boolean;
|
|
4
5
|
namedQueryModuleAccessLevel: import("../../types").AccessLevel;
|
|
5
6
|
cachedQueries: CachedQuery[];
|
|
6
7
|
expression: string;
|
|
@@ -21,4 +22,6 @@ export declare const useGridFilterExpressionEditor: () => {
|
|
|
21
22
|
unSuspendGridFilter: () => void;
|
|
22
23
|
setGridFilterExpression: (expression: string) => void;
|
|
23
24
|
gridFilterAccessLevel: import("../../types").AccessLevel;
|
|
25
|
+
gridFilterHelpPage: string;
|
|
26
|
+
gridFilterLinkDisabled: boolean;
|
|
24
27
|
};
|
|
@@ -13,10 +13,11 @@ const useGridFilterExpressionEditor = () => {
|
|
|
13
13
|
var _a, _b, _c;
|
|
14
14
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
15
15
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
return (_a = state.Layout.Layouts.find((l) => l.Name == state.Layout.CurrentLayout)) === null || _a === void 0 ? void 0 : _a.GridFilter;
|
|
16
|
+
const currentLayout = (0, react_redux_1.useSelector)((state) => {
|
|
17
|
+
return state.Layout.Layouts.find((l) => l.Name == state.Layout.CurrentLayout);
|
|
19
18
|
});
|
|
19
|
+
const isReadOnly = Boolean(currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.IsReadOnly);
|
|
20
|
+
const gridFilter = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.GridFilter;
|
|
20
21
|
const [isAdaptableReady, setIsAdaptableReady] = React.useState(false);
|
|
21
22
|
const [expression, setExpression] = React.useState(() => {
|
|
22
23
|
return adaptable.api.gridFilterApi.getCurrentGridFilterExpression();
|
|
@@ -27,14 +28,17 @@ const useGridFilterExpressionEditor = () => {
|
|
|
27
28
|
const onAddCachedQuery = (cachedQuery) => {
|
|
28
29
|
dispatch(SystemRedux.SystemCachedQueryAdd(cachedQuery));
|
|
29
30
|
};
|
|
31
|
+
const gridFilterHelpPage = adaptable.ModuleService.getModuleById('GridFilter').moduleInfo.HelpPage;
|
|
32
|
+
const gridFilterLinkDisabled = !adaptable.api.internalApi.isDocumentationLinksDisplayed();
|
|
30
33
|
React.useEffect(() => {
|
|
31
34
|
adaptable.api.eventApi.on('AdaptableReady', () => {
|
|
32
35
|
setIsAdaptableReady(true);
|
|
33
36
|
});
|
|
34
37
|
}, []);
|
|
35
38
|
React.useEffect(() => {
|
|
39
|
+
var _a;
|
|
36
40
|
if ((gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression) != expression) {
|
|
37
|
-
setExpression(gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression);
|
|
41
|
+
setExpression((_a = gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression) !== null && _a !== void 0 ? _a : '');
|
|
38
42
|
}
|
|
39
43
|
}, [gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression]);
|
|
40
44
|
const isExpressionValid = expression == '' ||
|
|
@@ -45,7 +49,11 @@ const useGridFilterExpressionEditor = () => {
|
|
|
45
49
|
let availableColumns = adaptable.api.columnApi.getColumns().map((col) => {
|
|
46
50
|
return {
|
|
47
51
|
label: col.friendlyName,
|
|
48
|
-
onClick: () =>
|
|
52
|
+
onClick: () => {
|
|
53
|
+
// Bogdan - im sure there is a better way to do this check with fancy operators i dont know
|
|
54
|
+
const newExp = StringExtensions_1.default.IsNotNullOrEmpty(expression) ? expression : '';
|
|
55
|
+
setExpression(newExp + `[${col.columnId}]`);
|
|
56
|
+
},
|
|
49
57
|
};
|
|
50
58
|
});
|
|
51
59
|
const clearQuery = () => {
|
|
@@ -101,6 +109,7 @@ const useGridFilterExpressionEditor = () => {
|
|
|
101
109
|
adaptable.api.gridFilterApi.unSuspendGridFilter();
|
|
102
110
|
};
|
|
103
111
|
return {
|
|
112
|
+
isReadOnly,
|
|
104
113
|
namedQueryModuleAccessLevel,
|
|
105
114
|
cachedQueries,
|
|
106
115
|
expression,
|
|
@@ -115,7 +124,7 @@ const useGridFilterExpressionEditor = () => {
|
|
|
115
124
|
availableColumns,
|
|
116
125
|
runQuery,
|
|
117
126
|
clearQuery,
|
|
118
|
-
onExpand: () => adaptable.api.gridFilterApi.
|
|
127
|
+
onExpand: () => adaptable.api.gridFilterApi.openUIEditorForGridFilter(expression),
|
|
119
128
|
saveQuery,
|
|
120
129
|
suspendGridFilter,
|
|
121
130
|
unSuspendGridFilter,
|
|
@@ -123,6 +132,8 @@ const useGridFilterExpressionEditor = () => {
|
|
|
123
132
|
adaptable.api.gridFilterApi.setGridFilterExpression(expression);
|
|
124
133
|
},
|
|
125
134
|
gridFilterAccessLevel,
|
|
135
|
+
gridFilterHelpPage,
|
|
136
|
+
gridFilterLinkDisabled,
|
|
126
137
|
};
|
|
127
138
|
};
|
|
128
139
|
exports.useGridFilterExpressionEditor = useGridFilterExpressionEditor;
|