@adaptabletools/adaptable 17.0.0-canary.2 → 17.0.0-canary.3
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 +1 -1
- package/index.css +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/tsconfig.esm.tsbuildinfo +1 -1
- package/src/View/Theme/ThemeStatusPanelPopover.d.ts +0 -2
- package/src/View/Theme/ThemeStatusPanelPopover.js +0 -20
|
@@ -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})`;
|