@adaptabletools/adaptable 17.0.0-canary.2 → 17.0.0-canary.4
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 +1206 -1192
- package/base.css.map +1 -1
- package/index.css +1981 -6
- package/index.css.map +1 -1
- package/package.json +3 -3
- package/src/Redux/ActionsReducers/ExportRedux.js +1 -3
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/Strategy/LayoutModule.js +4 -8
- package/src/Strategy/ThemeModule.js +2 -10
- package/src/View/Alert/Utilities/getAlertType.d.ts +1 -0
- package/src/View/Alert/Utilities/getAlertType.js +9 -1
- package/src/View/Alert/Utilities/getAvailablePredicates.js +1 -1
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +5 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +2 -6
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +8 -5
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -1
- package/src/View/Alert/Wizard/AlertWizard.js +1 -1
- package/src/View/Charting/useChartingElements.js +8 -10
- package/src/View/Components/Selectors/ColumnSelector.js +1 -1
- package/src/View/Export/ExportSelector.js +15 -17
- package/src/View/Export/ExportViewPanel.d.ts +4 -4
- package/src/View/Export/ExportViewPanel.js +14 -19
- package/src/View/Layout/LayoutStatusBarSubPanelPopover.d.ts +1 -1
- package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +12 -7
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
- package/src/View/Layout/LayoutViewPanel.js +7 -7
- package/src/View/Theme/ThemePopup.js +3 -18
- package/src/View/Theme/ThemeSelector.d.ts +5 -0
- package/src/View/Theme/ThemeSelector.js +29 -0
- package/src/View/Theme/ThemeStatusbar.d.ts +2 -0
- package/src/View/Theme/ThemeStatusbar.js +9 -0
- package/src/View/Theme/ThemeViewPanel.d.ts +2 -13
- package/src/View/Theme/ThemeViewPanel.js +6 -53
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +7 -6
- package/src/components/Select/Select.d.ts +1 -0
- package/src/components/Select/Select.js +12 -9
- package/src/metamodel/adaptable.metamodel.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.js +5 -5
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +3 -1
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +9 -0
- package/themes/dark.css +1 -1
- package/themes/dark.css.map +1 -1
- package/themes/light.css +1 -1
- package/themes/light.css.map +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/View/Theme/ThemeStatusPanelPopover.d.ts +0 -2
- package/src/View/Theme/ThemeStatusPanelPopover.js +0 -20
|
@@ -1,30 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { Flex } from 'rebass';
|
|
4
|
+
import { Select } from '../../components/Select';
|
|
5
|
+
import join from '../../components/utils/join';
|
|
1
6
|
import { ExportDestination } from '../../PredefinedConfig/Common/Enums';
|
|
2
7
|
import * as ExportRedux from '../../Redux/ActionsReducers/ExportRedux';
|
|
3
8
|
import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { StringExtensions } from '../../Utilities/Extensions/StringExtensions';
|
|
6
9
|
import * as GeneralConstants from '../../Utilities/Constants/GeneralConstants';
|
|
7
10
|
import { VISUAL_DATA_REPORT } from '../../Utilities/Constants/GeneralConstants';
|
|
11
|
+
import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
|
|
12
|
+
import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
|
|
8
13
|
import AdaptableHelper from '../../Utilities/Helpers/AdaptableHelper';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { ButtonExport } from '../Components/Buttons/ButtonExport';
|
|
14
|
+
import ObjectFactory from '../../Utilities/ObjectFactory';
|
|
15
|
+
import { ButtonDelete } from '../Components/Buttons/ButtonDelete';
|
|
12
16
|
import { ButtonEdit } from '../Components/Buttons/ButtonEdit';
|
|
17
|
+
import { ButtonExport } from '../Components/Buttons/ButtonExport';
|
|
13
18
|
import { ButtonNew } from '../Components/Buttons/ButtonNew';
|
|
14
|
-
import { ButtonDelete } from '../Components/Buttons/ButtonDelete';
|
|
15
19
|
import { ButtonSchedule } from '../Components/Buttons/ButtonSchedule';
|
|
16
|
-
import ObjectFactory from '../../Utilities/ObjectFactory';
|
|
17
|
-
import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
|
|
18
|
-
import { connect } from 'react-redux';
|
|
19
20
|
import { SELECT_DESTINATION_STRING, SELECT_REPORT_STRING } from './constants';
|
|
20
|
-
import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
|
|
21
|
-
import { Select } from '../../components/Select';
|
|
22
21
|
class ExportViewPanelComponent extends React.Component {
|
|
23
22
|
render() {
|
|
24
23
|
let currentReport = this.props.api.exportApi.getReportByName(this.props.CurrentReport);
|
|
25
|
-
let currentReportId =
|
|
26
|
-
? SELECT_REPORT_STRING
|
|
27
|
-
: this.props.CurrentReport;
|
|
24
|
+
let currentReportId = this.props.CurrentReport;
|
|
28
25
|
const allReportNames = this.getAllReportNames();
|
|
29
26
|
const reportItems = allReportNames.map((report) => {
|
|
30
27
|
return {
|
|
@@ -36,12 +33,10 @@ class ExportViewPanelComponent extends React.Component {
|
|
|
36
33
|
if (currentReport && !allReportNames.includes(currentReport.Name)) {
|
|
37
34
|
// current report is not available
|
|
38
35
|
currentReport = undefined;
|
|
39
|
-
currentReportId =
|
|
36
|
+
currentReportId = undefined;
|
|
40
37
|
}
|
|
41
38
|
let currentDestination = this.props.api.exportApi.getDestinationByName(this.props.CurrentDestination);
|
|
42
|
-
let currentDestinationId =
|
|
43
|
-
? SELECT_DESTINATION_STRING
|
|
44
|
-
: this.props.CurrentDestination;
|
|
39
|
+
let currentDestinationId = this.props.CurrentDestination;
|
|
45
40
|
const destinationItems = [
|
|
46
41
|
...this.props.api.exportApi.getAvailableExportDestinations().map((destination) => ({
|
|
47
42
|
label: destination,
|
|
@@ -66,7 +61,7 @@ class ExportViewPanelComponent extends React.Component {
|
|
|
66
61
|
.includes(this.props.CurrentDestination)) {
|
|
67
62
|
// current destination is not available
|
|
68
63
|
currentDestination = undefined;
|
|
69
|
-
currentDestinationId =
|
|
64
|
+
currentDestinationId = undefined;
|
|
70
65
|
}
|
|
71
66
|
let accessLevel = AdaptableHelper.getAppropriateAccessLevel(currentReport, this.props.accessLevel);
|
|
72
67
|
let deleteMessage = "Are you sure you want to delete '";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const LayoutStatusbar: React.FunctionComponent;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import { Box } from 'rebass';
|
|
4
|
+
import { Select } from '../../components/Select';
|
|
3
5
|
import { useAdaptable } from '../AdaptableContext';
|
|
4
|
-
export const
|
|
6
|
+
export const LayoutStatusbar = () => {
|
|
5
7
|
const adaptable = useAdaptable();
|
|
6
8
|
const layouts = adaptable.api.layoutApi.getLayouts();
|
|
7
|
-
const options = layouts.map((layout) => ({ label: layout.Name, value: layout.
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const options = layouts.map((layout) => ({ label: layout.Name, value: layout.Name }));
|
|
10
|
+
const currentLayout = useSelector((state) => state.Layout.CurrentLayout);
|
|
11
|
+
return (React.createElement(Box, { onClick: (event) => {
|
|
12
|
+
event.stopPropagation();
|
|
13
|
+
} },
|
|
14
|
+
React.createElement(Select, { size: "small", options: options, value: currentLayout, onChange: (value) => {
|
|
15
|
+
adaptable.api.layoutApi.setLayout(value);
|
|
16
|
+
} })));
|
|
12
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
|
|
3
2
|
import { Layout } from '../../PredefinedConfig/LayoutState';
|
|
4
3
|
import * as LayoutRedux from '../../Redux/ActionsReducers/LayoutRedux';
|
|
4
|
+
import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
|
|
5
5
|
export declare const COMPONENT_LAYOUT_POPUP_NAME = "LayoutEditorStandalonePopup";
|
|
6
6
|
export interface LayoutViewPanelComponentProps extends ViewPanelProps {
|
|
7
7
|
onSelectLayout: (layoutName: string) => LayoutRedux.LayoutSelectAction;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { connect } from 'react-redux';
|
|
3
|
-
import AdaptableHelper from '../../Utilities/Helpers/AdaptableHelper';
|
|
4
3
|
import { Flex } from 'rebass';
|
|
4
|
+
import { Select } from '../../components/Select';
|
|
5
5
|
import join from '../../components/utils/join';
|
|
6
|
+
import * as GridRedux from '../../Redux/ActionsReducers/GridRedux';
|
|
7
|
+
import * as LayoutRedux from '../../Redux/ActionsReducers/LayoutRedux';
|
|
6
8
|
import * as GeneralConstants from '../../Utilities/Constants/GeneralConstants';
|
|
7
|
-
import
|
|
9
|
+
import AdaptableHelper from '../../Utilities/Helpers/AdaptableHelper';
|
|
10
|
+
import { ButtonClone } from '../Components/Buttons/ButtonClone';
|
|
11
|
+
import { ButtonDelete } from '../Components/Buttons/ButtonDelete';
|
|
8
12
|
import { ButtonEdit } from '../Components/Buttons/ButtonEdit';
|
|
9
13
|
import { ButtonNew } from '../Components/Buttons/ButtonNew';
|
|
10
|
-
import {
|
|
11
|
-
import { ButtonClone } from '../Components/Buttons/ButtonClone';
|
|
12
|
-
import * as GridRedux from '../../Redux/ActionsReducers/GridRedux';
|
|
13
|
-
import * as LayoutRedux from '../../Redux/ActionsReducers/LayoutRedux';
|
|
14
|
-
import { Select } from '../../components/Select';
|
|
14
|
+
import { ButtonSave } from '../Components/Buttons/ButtonSave';
|
|
15
15
|
export const COMPONENT_LAYOUT_POPUP_NAME = 'LayoutEditorStandalonePopup';
|
|
16
16
|
class LayoutViewPanelComponent extends React.Component {
|
|
17
17
|
render() {
|
|
@@ -9,6 +9,7 @@ import { Box } from 'rebass';
|
|
|
9
9
|
import ObjectFactory from '../../Utilities/ObjectFactory';
|
|
10
10
|
import SimpleButton from '../../components/SimpleButton';
|
|
11
11
|
import { Icon } from '../../components/icons';
|
|
12
|
+
import { ThemeSelector } from './ThemeSelector';
|
|
12
13
|
class ThemePopupComponent extends React.Component {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -27,23 +28,6 @@ class ThemePopupComponent extends React.Component {
|
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
render() {
|
|
30
|
-
const availableThemes = this.props.api.themeApi.getThemes();
|
|
31
|
-
const theme = this.props.api.themeApi.getCurrentThemeObject();
|
|
32
|
-
const currentThemeDescription = theme.Description || theme.Name;
|
|
33
|
-
const optionThemes = availableThemes.map((theme) => {
|
|
34
|
-
if (typeof theme === 'string') {
|
|
35
|
-
// protection against old state, which could be string
|
|
36
|
-
theme = {
|
|
37
|
-
Name: theme,
|
|
38
|
-
Description: theme,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
value: theme.Name,
|
|
43
|
-
label: theme.Description,
|
|
44
|
-
onClick: () => this.onChangeTheme(theme.Name),
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
31
|
const isCustomTheme = this.props.api.themeApi
|
|
48
32
|
.getUserThemes()
|
|
49
33
|
.some((theme) => theme.Name === this.props.CurrentTheme);
|
|
@@ -67,7 +51,8 @@ class ThemePopupComponent extends React.Component {
|
|
|
67
51
|
newButton) },
|
|
68
52
|
React.createElement(FormLayout, null,
|
|
69
53
|
React.createElement(FormRow, { label: "Current Theme:" },
|
|
70
|
-
React.createElement(
|
|
54
|
+
React.createElement(Box, { maxWidth: 150 },
|
|
55
|
+
React.createElement(ThemeSelector, null)))),
|
|
71
56
|
isCustomTheme && (React.createElement(Box, { mt: 3 },
|
|
72
57
|
React.createElement(ThemeEditor, { accessLevel: this.props.accessLevel, theme: this.props.CurrentTheme })))));
|
|
73
58
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useDispatch } from 'react-redux';
|
|
3
|
+
import { Select } from '../../components/Select';
|
|
4
|
+
import * as ThemeRedux from '../../Redux/ActionsReducers/ThemeRedux';
|
|
5
|
+
import { ThemeModuleId } from '../../Utilities/Constants/ModuleConstants';
|
|
6
|
+
import { useAdaptable } from '../AdaptableContext';
|
|
7
|
+
export const ThemeSelector = (props) => {
|
|
8
|
+
const adaptable = useAdaptable();
|
|
9
|
+
const dispatch = useDispatch();
|
|
10
|
+
const availableThemes = adaptable.api.themeApi.getThemes();
|
|
11
|
+
const disabled = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(ThemeModuleId) === 'ReadOnly';
|
|
12
|
+
const optionThemes = availableThemes.map((theme) => {
|
|
13
|
+
if (typeof theme === 'string') {
|
|
14
|
+
// protection against old state, which could be string
|
|
15
|
+
theme = {
|
|
16
|
+
Name: theme,
|
|
17
|
+
Description: theme,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
value: theme.Name,
|
|
22
|
+
label: theme.Description,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
const theme = adaptable.api.themeApi.getCurrentThemeObject();
|
|
26
|
+
return (React.createElement(Select, { "data-name": "select-theme-dropdown", options: optionThemes, value: theme.Name, disabled: disabled, size: props.size, onChange: (themeName) => {
|
|
27
|
+
dispatch(ThemeRedux.ThemeSelect(themeName));
|
|
28
|
+
} }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from 'rebass';
|
|
3
|
+
import { ThemeSelector } from './ThemeSelector';
|
|
4
|
+
export const ThemeStatusbar = () => {
|
|
5
|
+
return (React.createElement(Box, { onClick: (event) => {
|
|
6
|
+
event.stopPropagation();
|
|
7
|
+
} },
|
|
8
|
+
React.createElement(ThemeSelector, { size: "small" })));
|
|
9
|
+
};
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
|
|
2
|
-
import * as ThemeRedux from '../../Redux/ActionsReducers/ThemeRedux';
|
|
3
|
-
import { AdaptableTheme } from '../../PredefinedConfig/ThemeState';
|
|
4
|
-
import * as React from 'react';
|
|
5
3
|
export interface ThemeViewPanelComponentProps extends ViewPanelProps {
|
|
6
|
-
onSelectTheme: (theme: string) => ThemeRedux.ThemeSelectAction;
|
|
7
|
-
SystemThemes: any[];
|
|
8
|
-
UserThemes: AdaptableTheme[];
|
|
9
|
-
CurrentTheme: string;
|
|
10
4
|
}
|
|
11
|
-
declare
|
|
12
|
-
render(): any;
|
|
13
|
-
private onSelectTheme;
|
|
14
|
-
}
|
|
15
|
-
export declare const ThemeViewPanelControl: import("react-redux").ConnectedComponent<typeof ThemeViewPanelComponent, any>;
|
|
16
|
-
export {};
|
|
5
|
+
export declare const ThemeViewPanelControl: (props: ThemeViewPanelComponentProps) => JSX.Element;
|
|
@@ -1,56 +1,9 @@
|
|
|
1
|
-
import * as ThemeRedux from '../../Redux/ActionsReducers/ThemeRedux';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import join from '../../components/utils/join';
|
|
4
3
|
import * as GeneralConstants from '../../Utilities/Constants/GeneralConstants';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const themes = allThemes.map((theme, index) => {
|
|
12
|
-
if (typeof theme === 'string') {
|
|
13
|
-
// protection against old state, which could be string
|
|
14
|
-
theme = {
|
|
15
|
-
Name: theme,
|
|
16
|
-
Description: theme,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
label: theme.Description,
|
|
21
|
-
value: theme.Name,
|
|
22
|
-
onClick: () => this.onSelectTheme(theme),
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
const currentThemeObj = allThemes.find((theme) => theme.Name === this.props.CurrentTheme);
|
|
26
|
-
const currentThemeDescription = (_d = currentThemeObj === null || currentThemeObj === void 0 ? void 0 : currentThemeObj.Description) !== null && _d !== void 0 ? _d : this.props.CurrentTheme;
|
|
27
|
-
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
28
|
-
const dropDownStyle = this.props.viewType === 'Toolbar'
|
|
29
|
-
? {
|
|
30
|
-
maxWidth: '25rem',
|
|
31
|
-
whiteSpace: 'nowrap',
|
|
32
|
-
overflow: 'hidden',
|
|
33
|
-
textOverflow: 'ellipsis',
|
|
34
|
-
fontSize: 'small',
|
|
35
|
-
}
|
|
36
|
-
: { minWidth: '100%', fontSize: 'small' };
|
|
37
|
-
return (React.createElement("div", { className: join(this.props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Theme__wrap`) },
|
|
38
|
-
React.createElement(Select, { className: `ab-${elementType}__Theme__select`, options: themes, value: currentThemeObj === null || currentThemeObj === void 0 ? void 0 : currentThemeObj.Name, onChange: (theme) => this.onSelectTheme({ Name: theme }) })));
|
|
39
|
-
}
|
|
40
|
-
onSelectTheme(theme) {
|
|
41
|
-
this.props.onSelectTheme(theme.Name);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function mapStateToProps(state, ownProps) {
|
|
45
|
-
return {
|
|
46
|
-
SystemThemes: state.Theme.SystemThemes,
|
|
47
|
-
CurrentTheme: state.Theme.CurrentTheme,
|
|
48
|
-
UserThemes: state.Theme.UserThemes,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function mapDispatchToProps(dispatch) {
|
|
52
|
-
return {
|
|
53
|
-
onSelectTheme: (theme) => dispatch(ThemeRedux.ThemeSelect(theme)),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export const ThemeViewPanelControl = connect(mapStateToProps, mapDispatchToProps)(ThemeViewPanelComponent);
|
|
4
|
+
import { ThemeSelector } from './ThemeSelector';
|
|
5
|
+
export const ThemeViewPanelControl = (props) => {
|
|
6
|
+
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
7
|
+
return (React.createElement("div", { className: join(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Theme__wrap`) },
|
|
8
|
+
React.createElement(ThemeSelector, null)));
|
|
9
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Flex } from 'rebass';
|
|
2
|
+
import { Box, Flex } from 'rebass';
|
|
3
3
|
import { getQlPredicateSymbol } from '../../../parser/src/predicate/mapQlPredicateToExpression';
|
|
4
4
|
import AdaptableInput from '../../../View/Components/AdaptableInput';
|
|
5
5
|
import { ColumnSelector } from '../../../View/Components/Selectors/ColumnSelector';
|
|
@@ -11,9 +11,10 @@ import { Select } from '../../Select';
|
|
|
11
11
|
import { useQueryBuilderContext } from './QueryBuilder';
|
|
12
12
|
import { mapExpressionFunctionTypeToColumnDataType } from './utils';
|
|
13
13
|
export const PrimitiveColumnSelector = (props) => {
|
|
14
|
-
return (React.createElement(
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
return (React.createElement(Box, null,
|
|
15
|
+
React.createElement(ColumnSelector, { value: props.columnId, type: props.type, onChange: (columnId) => {
|
|
16
|
+
props.onChange(`[${columnId}]`);
|
|
17
|
+
} })));
|
|
17
18
|
};
|
|
18
19
|
export const PrimiteValueInput = (props) => {
|
|
19
20
|
var _a, _b;
|
|
@@ -91,11 +92,11 @@ export const PrimiteValueInput = (props) => {
|
|
|
91
92
|
];
|
|
92
93
|
const typeOption = options.find((option) => option.value === type);
|
|
93
94
|
return (React.createElement(Flex, { "data-id": "query-input-wrapper", mr: 2 },
|
|
94
|
-
editor,
|
|
95
95
|
React.createElement(Flex, null,
|
|
96
96
|
React.createElement(Select, { rederSingleValue: (value) => {
|
|
97
97
|
return (React.createElement(React.Fragment, null, typeOption.value === 'column-name' ? React.createElement(Icon, { name: "grid" }) : React.createElement(Icon, { name: "edit" })));
|
|
98
|
-
}, variant: "raised", value: typeOption.value, options: options, onChange: (value) => handleTypeChange(value) }))
|
|
98
|
+
}, variant: "raised", value: typeOption.value, options: options, onChange: (value) => handleTypeChange(value) })),
|
|
99
|
+
editor));
|
|
99
100
|
};
|
|
100
101
|
export const ExpressionSelector = (props) => {
|
|
101
102
|
var _a;
|
|
@@ -25,6 +25,7 @@ export type SelectProps<SelectValue extends unknown, IsMulti extends boolean = f
|
|
|
25
25
|
style?: React.CSSProperties;
|
|
26
26
|
onInputChange?: (value: string) => void;
|
|
27
27
|
variant?: 'default' | 'raised';
|
|
28
|
+
size?: 'small' | 'normal';
|
|
28
29
|
isCreatable?: boolean;
|
|
29
30
|
};
|
|
30
31
|
export declare const Select: <SelectValue extends unknown, IsMulti extends boolean = false>(props: SelectProps<SelectValue, IsMulti>) => JSX.Element;
|
|
@@ -11,21 +11,21 @@ const commonStyles = ({ isFocused, isDisabled, }) => {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export const Select = function (props) {
|
|
14
|
-
var _a, _b, _c, _d;
|
|
15
|
-
let selectedOption = (_a = props.options.find((option) => {
|
|
14
|
+
var _a, _b, _c, _d, _e;
|
|
15
|
+
let selectedOption = (_b = ((_a = props.options) !== null && _a !== void 0 ? _a : []).find((option) => {
|
|
16
16
|
if (typeof option.value === 'object' && option.value instanceof Date) {
|
|
17
17
|
return isSameDay(option.value, props.value);
|
|
18
18
|
}
|
|
19
19
|
return option.value === props.value;
|
|
20
|
-
})) !== null &&
|
|
20
|
+
})) !== null && _b !== void 0 ? _b : null;
|
|
21
21
|
if (!selectedOption && props.value !== undefined && props.value !== null) {
|
|
22
22
|
selectedOption = {
|
|
23
23
|
value: props.value,
|
|
24
24
|
label: props.value,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
let disabled = (
|
|
28
|
-
const accessLevel = (
|
|
27
|
+
let disabled = (_c = props.disabled) !== null && _c !== void 0 ? _c : false;
|
|
28
|
+
const accessLevel = (_d = props.accessLevel) !== null && _d !== void 0 ? _d : 'Full';
|
|
29
29
|
if (accessLevel === 'Hidden') {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
@@ -48,7 +48,7 @@ export const Select = function (props) {
|
|
|
48
48
|
};
|
|
49
49
|
}, []);
|
|
50
50
|
const SelectComponent = props.isCreatable ? CreatableSelect : ReactSelect;
|
|
51
|
-
return (React.createElement(SelectComponent, { onInputChange: props.onInputChange, onFocus: props.onFocus, isLoading: props.isLoding, options: props.options, className: props.className, isDisabled: disabled, isMulti: props.isMulti, value: selectedOption, menuPosition: (
|
|
51
|
+
return (React.createElement(SelectComponent, { onInputChange: props.onInputChange, onFocus: props.onFocus, isLoading: props.isLoding, options: props.options, className: props.className, isDisabled: disabled, isMulti: props.isMulti, value: selectedOption, menuPosition: (_e = props.menuPosition) !== null && _e !== void 0 ? _e : 'fixed', isClearable: props.isClearable, onChange: (option) => {
|
|
52
52
|
if (props.isMulti) {
|
|
53
53
|
props.onChange(option.map((x) => x === null || x === void 0 ? void 0 : x.value));
|
|
54
54
|
}
|
|
@@ -77,7 +77,7 @@ export const Select = function (props) {
|
|
|
77
77
|
},
|
|
78
78
|
// @ts-ignorets-ignore when fixed
|
|
79
79
|
menuPortal: (baseStyle) => {
|
|
80
|
-
return Object.assign(Object.assign({}, baseStyle), { zIndex: 999999 });
|
|
80
|
+
return Object.assign(Object.assign({}, baseStyle), { zIndex: 999999, textAlign: 'left' });
|
|
81
81
|
},
|
|
82
82
|
// @ts-ignore
|
|
83
83
|
menu: (baseStyle, state) => {
|
|
@@ -99,7 +99,10 @@ export const Select = function (props) {
|
|
|
99
99
|
},
|
|
100
100
|
// @ts-ignore
|
|
101
101
|
input: (baseStyle, state) => {
|
|
102
|
-
return Object.assign(Object.assign({}, baseStyle), { color: 'var(--ab-cmp-input__color)' });
|
|
102
|
+
return Object.assign(Object.assign({}, baseStyle), { padding: props.size === 'small' ? 0 : baseStyle.padding, color: 'var(--ab-cmp-input__color)' });
|
|
103
|
+
},
|
|
104
|
+
valueContainer: (baseStyle) => {
|
|
105
|
+
return Object.assign(Object.assign({}, baseStyle), { padding: props.size === 'small' ? `0 var(--ab-space-1)` : baseStyle.padding });
|
|
103
106
|
},
|
|
104
107
|
// @ts-ignore
|
|
105
108
|
singleValue: (baseStyle, state) => {
|
|
@@ -110,7 +113,7 @@ export const Select = function (props) {
|
|
|
110
113
|
state;
|
|
111
114
|
return Object.assign(Object.assign(Object.assign({}, baseStyle), commonStyles(state)), {
|
|
112
115
|
// height: 30,
|
|
113
|
-
minHeight: 32, boxShadow: state.isFocused ? 'var(--ab-focus__box-shadow)' : 'none', outline: state.isFocused ? 'var(--ab-focus__outline)' : 'none', border: props.variant && props.variant === 'raised'
|
|
116
|
+
minHeight: props.size === 'small' ? 0 : 32, boxShadow: state.isFocused ? 'var(--ab-focus__box-shadow)' : 'none', outline: state.isFocused ? 'var(--ab-focus__outline)' : 'none', border: props.variant && props.variant === 'raised'
|
|
114
117
|
? '1px solid transparent'
|
|
115
118
|
: 'var(--ab-cmp-input__border)', '&:hover': {
|
|
116
119
|
border: 'var(--ab-cmp-input__border)',
|
|
@@ -4625,7 +4625,7 @@ export const ADAPTABLE_METAMODEL = {
|
|
|
4625
4625
|
"name": "report",
|
|
4626
4626
|
"kind": "R",
|
|
4627
4627
|
"desc": "The exported report",
|
|
4628
|
-
"ref": "
|
|
4628
|
+
"ref": "Report"
|
|
4629
4629
|
},
|
|
4630
4630
|
{
|
|
4631
4631
|
"name": "reportData",
|
|
@@ -7564,7 +7564,7 @@ export const ADAPTABLE_METAMODEL = {
|
|
|
7564
7564
|
"name": "report",
|
|
7565
7565
|
"kind": "R",
|
|
7566
7566
|
"desc": "Report being exported",
|
|
7567
|
-
"ref": "
|
|
7567
|
+
"ref": "Report"
|
|
7568
7568
|
}
|
|
7569
7569
|
]
|
|
7570
7570
|
},
|
|
@@ -7865,8 +7865,8 @@ export const ADAPTABLE_METAMODEL = {
|
|
|
7865
7865
|
}
|
|
7866
7866
|
]
|
|
7867
7867
|
},
|
|
7868
|
-
"
|
|
7869
|
-
"name": "
|
|
7868
|
+
"Report": {
|
|
7869
|
+
"name": "Report",
|
|
7870
7870
|
"kind": "I",
|
|
7871
7871
|
"desc": "A Report which can export data from AdapTable",
|
|
7872
7872
|
"props": [
|
|
@@ -7917,7 +7917,7 @@ export const ADAPTABLE_METAMODEL = {
|
|
|
7917
7917
|
"name": "report",
|
|
7918
7918
|
"kind": "R",
|
|
7919
7919
|
"desc": "Definition of Report being Run",
|
|
7920
|
-
"ref": "
|
|
7920
|
+
"ref": "Report"
|
|
7921
7921
|
},
|
|
7922
7922
|
{
|
|
7923
7923
|
"name": "reportData",
|
|
@@ -77,7 +77,9 @@ export function mapExpressionToQlPredicate(expression) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
catch (err) {
|
|
80
|
-
return {
|
|
80
|
+
return {
|
|
81
|
+
errorMessage: `Query Builder does not support the expression: ${expression}`,
|
|
82
|
+
};
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
function getOperatorFromAST(astRootNode) {
|
|
@@ -35,6 +35,9 @@ export function mapQlPredicateToExpression(predicate) {
|
|
|
35
35
|
return `"${arg}"`;
|
|
36
36
|
}
|
|
37
37
|
if (typeof arg === 'object') {
|
|
38
|
+
if (isQlLogicalOperator(arg.operator)) {
|
|
39
|
+
return `(${mapQlPredicateToExpression(arg)})`;
|
|
40
|
+
}
|
|
38
41
|
return mapQlPredicateToExpression(arg);
|
|
39
42
|
}
|
|
40
43
|
if (typeof arg === 'boolean') {
|
|
@@ -45,6 +48,12 @@ export function mapQlPredicateToExpression(predicate) {
|
|
|
45
48
|
if (typeof firstArg === 'object') {
|
|
46
49
|
firstArg = mapQlPredicateToExpression(firstArg);
|
|
47
50
|
}
|
|
51
|
+
if (isQlLogicalOperator(operator)) {
|
|
52
|
+
// need to compose with AND [] AND ...
|
|
53
|
+
return mappedArgs.length
|
|
54
|
+
? `${firstArg} ${operatorSymbol} ${mappedArgs.join(` ${operatorSymbol} `)}`
|
|
55
|
+
: `${firstArg}`;
|
|
56
|
+
}
|
|
48
57
|
if (predicateType === 'INFIX') {
|
|
49
58
|
if (operator === 'BETWEEN') {
|
|
50
59
|
return `${firstArg} ${operatorSymbol} (${mappedArgs})`;
|
package/themes/dark.css
CHANGED
|
@@ -19,4 +19,4 @@ html.ab--theme-dark input[type=number].ab-Input::-webkit-inner-spin-button {
|
|
|
19
19
|
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="4 0 18 18" version="1.1"><path fill="%23f7f7f7" d="M7 10l5 5 5-5z" transform="translate(0, 2)"/><path fill="%23f7f7f7" d="M7 14l5-5 5 5z" transform="translate(0, -6)"/></svg>') no-repeat center center;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/*# sourceMappingURL=
|
|
22
|
+
/*# sourceMappingURL=dark.css.map */
|
package/themes/dark.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../packages/adaptable/src/themes/dark.scss","dark.css"],"names":[],"mappings":"AAAA;EACE,yCAAA;EACA,uBAAA;EAEA,6CAAA;EAEA,qCAAA;EACA,6CAAA;EAEA,2BAAA;EACA,gCAAA;EACA,+BAAA;EACA,mCAAA;EAQA,4BAAA;EACA,8DAAA;EAEA,wEAAA;EAEA,gEAAA;EACA,gEAAA;ACXF;ADaE;;EAEE,yTAAA;ACXJ","file":"dark.css"}
|
package/themes/light.css
CHANGED
|
@@ -2,4 +2,4 @@ html.ab--theme-light {
|
|
|
2
2
|
--ab-theme-loaded: light;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
/*# sourceMappingURL=
|
|
5
|
+
/*# sourceMappingURL=light.css.map */
|
package/themes/light.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../packages/adaptable/src/themes/light.scss","light.css"],"names":[],"mappings":"AAAA;EACE,wBAAA;ACCF","file":"light.css"}
|