@adaptabletools/adaptable-cjs 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.
Files changed (48) hide show
  1. package/base.css +1206 -1192
  2. package/base.css.map +1 -1
  3. package/index.css +1981 -6
  4. package/index.css.map +1 -1
  5. package/package.json +3 -3
  6. package/src/Redux/ActionsReducers/ExportRedux.js +0 -2
  7. package/src/Redux/Store/AdaptableStore.js +1 -1
  8. package/src/Strategy/LayoutModule.js +3 -7
  9. package/src/Strategy/ThemeModule.js +2 -10
  10. package/src/View/Alert/Utilities/getAlertType.d.ts +1 -0
  11. package/src/View/Alert/Utilities/getAlertType.js +9 -1
  12. package/src/View/Alert/Utilities/getAvailablePredicates.js +1 -1
  13. package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +5 -0
  14. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +2 -6
  15. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +8 -5
  16. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +1 -1
  17. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -1
  18. package/src/View/Alert/Wizard/AlertWizard.js +1 -1
  19. package/src/View/Charting/useChartingElements.js +8 -10
  20. package/src/View/Components/Selectors/ColumnSelector.js +1 -1
  21. package/src/View/Export/ExportSelector.js +15 -17
  22. package/src/View/Export/ExportViewPanel.d.ts +4 -4
  23. package/src/View/Export/ExportViewPanel.js +14 -19
  24. package/src/View/Layout/LayoutStatusBarSubPanelPopover.d.ts +1 -1
  25. package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +14 -9
  26. package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
  27. package/src/View/Layout/LayoutViewPanel.js +7 -7
  28. package/src/View/Theme/ThemePopup.js +3 -18
  29. package/src/View/Theme/ThemeSelector.d.ts +5 -0
  30. package/src/View/Theme/ThemeSelector.js +34 -0
  31. package/src/View/Theme/ThemeStatusbar.d.ts +2 -0
  32. package/src/View/Theme/ThemeStatusbar.js +14 -0
  33. package/src/View/Theme/ThemeViewPanel.d.ts +2 -13
  34. package/src/View/Theme/ThemeViewPanel.js +7 -53
  35. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +6 -5
  36. package/src/components/Select/Select.d.ts +1 -0
  37. package/src/components/Select/Select.js +12 -9
  38. package/src/metamodel/adaptable.metamodel.d.ts +1 -1
  39. package/src/metamodel/adaptable.metamodel.js +5 -5
  40. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +3 -1
  41. package/src/parser/src/predicate/mapQlPredicateToExpression.js +9 -0
  42. package/themes/dark.css +1 -1
  43. package/themes/dark.css.map +1 -1
  44. package/themes/light.css +1 -1
  45. package/themes/light.css.map +1 -1
  46. package/tsconfig.cjs.tsbuildinfo +1 -1
  47. package/src/View/Theme/ThemeStatusPanelPopover.d.ts +0 -2
  48. package/src/View/Theme/ThemeStatusPanelPopover.js +0 -25
@@ -2,33 +2,30 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExportViewPanelControl = void 0;
4
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 Select_1 = require("../../components/Select");
9
+ const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
5
10
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
6
11
  const ExportRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ExportRedux"));
7
12
  const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
8
- const React = tslib_1.__importStar(require("react"));
9
- const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
10
13
  const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
11
14
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
15
+ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
16
+ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
12
17
  const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
13
- const rebass_1 = require("rebass");
14
- const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
15
- const ButtonExport_1 = require("../Components/Buttons/ButtonExport");
18
+ const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
19
+ const ButtonDelete_1 = require("../Components/Buttons/ButtonDelete");
16
20
  const ButtonEdit_1 = require("../Components/Buttons/ButtonEdit");
21
+ const ButtonExport_1 = require("../Components/Buttons/ButtonExport");
17
22
  const ButtonNew_1 = require("../Components/Buttons/ButtonNew");
18
- const ButtonDelete_1 = require("../Components/Buttons/ButtonDelete");
19
23
  const ButtonSchedule_1 = require("../Components/Buttons/ButtonSchedule");
20
- const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
21
- const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
22
- const react_redux_1 = require("react-redux");
23
24
  const constants_1 = require("./constants");
24
- const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
25
- const Select_1 = require("../../components/Select");
26
25
  class ExportViewPanelComponent extends React.Component {
27
26
  render() {
28
27
  let currentReport = this.props.api.exportApi.getReportByName(this.props.CurrentReport);
29
- let currentReportId = StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.CurrentReport)
30
- ? constants_1.SELECT_REPORT_STRING
31
- : this.props.CurrentReport;
28
+ let currentReportId = this.props.CurrentReport;
32
29
  const allReportNames = this.getAllReportNames();
33
30
  const reportItems = allReportNames.map((report) => {
34
31
  return {
@@ -40,12 +37,10 @@ class ExportViewPanelComponent extends React.Component {
40
37
  if (currentReport && !allReportNames.includes(currentReport.Name)) {
41
38
  // current report is not available
42
39
  currentReport = undefined;
43
- currentReportId = constants_1.SELECT_REPORT_STRING;
40
+ currentReportId = undefined;
44
41
  }
45
42
  let currentDestination = this.props.api.exportApi.getDestinationByName(this.props.CurrentDestination);
46
- let currentDestinationId = StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.CurrentDestination)
47
- ? constants_1.SELECT_DESTINATION_STRING
48
- : this.props.CurrentDestination;
43
+ let currentDestinationId = this.props.CurrentDestination;
49
44
  const destinationItems = [
50
45
  ...this.props.api.exportApi.getAvailableExportDestinations().map((destination) => ({
51
46
  label: destination,
@@ -70,7 +65,7 @@ class ExportViewPanelComponent extends React.Component {
70
65
  .includes(this.props.CurrentDestination)) {
71
66
  // current destination is not available
72
67
  currentDestination = undefined;
73
- currentDestinationId = constants_1.SELECT_DESTINATION_STRING;
68
+ currentDestinationId = undefined;
74
69
  }
75
70
  let accessLevel = AdaptableHelper_1.default.getAppropriateAccessLevel(currentReport, this.props.accessLevel);
76
71
  let deleteMessage = "Are you sure you want to delete '";
@@ -1,2 +1,2 @@
1
1
  import * as React from 'react';
2
- export declare const LayoutStatusBarSubPanelPopover: React.FunctionComponent;
2
+ export declare const LayoutStatusbar: React.FunctionComponent;
@@ -1,17 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LayoutStatusBarSubPanelPopover = void 0;
3
+ exports.LayoutStatusbar = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const SelectList_1 = require("../../components/SelectList");
6
+ const react_redux_1 = require("react-redux");
7
+ const rebass_1 = require("rebass");
8
+ const Select_1 = require("../../components/Select");
7
9
  const AdaptableContext_1 = require("../AdaptableContext");
8
- const LayoutStatusBarSubPanelPopover = () => {
10
+ const LayoutStatusbar = () => {
9
11
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
10
12
  const layouts = adaptable.api.layoutApi.getLayouts();
11
- const options = layouts.map((layout) => ({ label: layout.Name, value: layout.Uuid }));
12
- const handleChange = (option) => {
13
- adaptable.api.layoutApi.setLayout(option.label);
14
- };
15
- return React.createElement(SelectList_1.SelectList, { options: options, onChange: handleChange });
13
+ const options = layouts.map((layout) => ({ label: layout.Name, value: layout.Name }));
14
+ const currentLayout = (0, react_redux_1.useSelector)((state) => state.Layout.CurrentLayout);
15
+ return (React.createElement(rebass_1.Box, { onClick: (event) => {
16
+ event.stopPropagation();
17
+ } },
18
+ React.createElement(Select_1.Select, { size: "small", options: options, value: currentLayout, onChange: (value) => {
19
+ adaptable.api.layoutApi.setLayout(value);
20
+ } })));
16
21
  };
17
- exports.LayoutStatusBarSubPanelPopover = LayoutStatusBarSubPanelPopover;
22
+ exports.LayoutStatusbar = LayoutStatusbar;
@@ -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;
@@ -4,18 +4,18 @@ exports.LayoutViewPanelControl = exports.COMPONENT_LAYOUT_POPUP_NAME = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
- const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
8
7
  const rebass_1 = require("rebass");
8
+ const Select_1 = require("../../components/Select");
9
9
  const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
10
+ const GridRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/GridRedux"));
11
+ const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
10
12
  const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
11
- const ButtonSave_1 = require("../Components/Buttons/ButtonSave");
13
+ const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
14
+ const ButtonClone_1 = require("../Components/Buttons/ButtonClone");
15
+ const ButtonDelete_1 = require("../Components/Buttons/ButtonDelete");
12
16
  const ButtonEdit_1 = require("../Components/Buttons/ButtonEdit");
13
17
  const ButtonNew_1 = require("../Components/Buttons/ButtonNew");
14
- const ButtonDelete_1 = require("../Components/Buttons/ButtonDelete");
15
- const ButtonClone_1 = require("../Components/Buttons/ButtonClone");
16
- const GridRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/GridRedux"));
17
- const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
18
- const Select_1 = require("../../components/Select");
18
+ const ButtonSave_1 = require("../Components/Buttons/ButtonSave");
19
19
  exports.COMPONENT_LAYOUT_POPUP_NAME = 'LayoutEditorStandalonePopup';
20
20
  class LayoutViewPanelComponent extends React.Component {
21
21
  render() {
@@ -13,6 +13,7 @@ const rebass_1 = require("rebass");
13
13
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
14
14
  const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
15
15
  const icons_1 = require("../../components/icons");
16
+ const ThemeSelector_1 = require("./ThemeSelector");
16
17
  class ThemePopupComponent extends React.Component {
17
18
  constructor() {
18
19
  super(...arguments);
@@ -31,23 +32,6 @@ class ThemePopupComponent extends React.Component {
31
32
  };
32
33
  }
33
34
  render() {
34
- const availableThemes = this.props.api.themeApi.getThemes();
35
- const theme = this.props.api.themeApi.getCurrentThemeObject();
36
- const currentThemeDescription = theme.Description || theme.Name;
37
- const optionThemes = availableThemes.map((theme) => {
38
- if (typeof theme === 'string') {
39
- // protection against old state, which could be string
40
- theme = {
41
- Name: theme,
42
- Description: theme,
43
- };
44
- }
45
- return {
46
- value: theme.Name,
47
- label: theme.Description,
48
- onClick: () => this.onChangeTheme(theme.Name),
49
- };
50
- });
51
35
  const isCustomTheme = this.props.api.themeApi
52
36
  .getUserThemes()
53
37
  .some((theme) => theme.Name === this.props.CurrentTheme);
@@ -71,7 +55,8 @@ class ThemePopupComponent extends React.Component {
71
55
  newButton) },
72
56
  React.createElement(FormLayout_1.default, null,
73
57
  React.createElement(FormLayout_1.FormRow, { label: "Current Theme:" },
74
- React.createElement(DropdownButton_1.default, { "data-name": "select-theme-dropdown", columns: ['label'], style: { width: '50%', minWidth: 200 }, placeholder: "Select theme", value: this.props.CurrentTheme, items: optionThemes, accessLevel: this.props.accessLevel }, currentThemeDescription))),
58
+ React.createElement(rebass_1.Box, { maxWidth: 150 },
59
+ React.createElement(ThemeSelector_1.ThemeSelector, null)))),
75
60
  isCustomTheme && (React.createElement(rebass_1.Box, { mt: 3 },
76
61
  React.createElement(ThemeEditor_1.ThemeEditor, { accessLevel: this.props.accessLevel, theme: this.props.CurrentTheme })))));
77
62
  }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { SelectProps } from '../../components/Select';
3
+ export declare const ThemeSelector: React.FunctionComponent<{
4
+ size?: SelectProps<any>['size'];
5
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemeSelector = 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 Select_1 = require("../../components/Select");
8
+ const ThemeRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ThemeRedux"));
9
+ const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
10
+ const AdaptableContext_1 = require("../AdaptableContext");
11
+ const ThemeSelector = (props) => {
12
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
13
+ const dispatch = (0, react_redux_1.useDispatch)();
14
+ const availableThemes = adaptable.api.themeApi.getThemes();
15
+ const disabled = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(ModuleConstants_1.ThemeModuleId) === 'ReadOnly';
16
+ const optionThemes = availableThemes.map((theme) => {
17
+ if (typeof theme === 'string') {
18
+ // protection against old state, which could be string
19
+ theme = {
20
+ Name: theme,
21
+ Description: theme,
22
+ };
23
+ }
24
+ return {
25
+ value: theme.Name,
26
+ label: theme.Description,
27
+ };
28
+ });
29
+ const theme = adaptable.api.themeApi.getCurrentThemeObject();
30
+ return (React.createElement(Select_1.Select, { "data-name": "select-theme-dropdown", options: optionThemes, value: theme.Name, disabled: disabled, size: props.size, onChange: (themeName) => {
31
+ dispatch(ThemeRedux.ThemeSelect(themeName));
32
+ } }));
33
+ };
34
+ exports.ThemeSelector = ThemeSelector;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ThemeStatusbar: () => JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemeStatusbar = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const ThemeSelector_1 = require("./ThemeSelector");
8
+ const ThemeStatusbar = () => {
9
+ return (react_1.default.createElement(rebass_1.Box, { onClick: (event) => {
10
+ event.stopPropagation();
11
+ } },
12
+ react_1.default.createElement(ThemeSelector_1.ThemeSelector, { size: "small" })));
13
+ };
14
+ exports.ThemeStatusbar = ThemeStatusbar;
@@ -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 class ThemeViewPanelComponent extends React.Component<ThemeViewPanelComponentProps, {}> {
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;
@@ -2,59 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ThemeViewPanelControl = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const ThemeRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ThemeRedux"));
6
5
  const React = tslib_1.__importStar(require("react"));
7
6
  const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
8
7
  const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
9
- const react_redux_1 = require("react-redux");
10
- const Select_1 = require("../../components/Select");
11
- class ThemeViewPanelComponent extends React.Component {
12
- render() {
13
- var _a, _b, _c, _d;
14
- const allThemes = (_c = (_b = (_a = this.props.api) === null || _a === void 0 ? void 0 : _a.themeApi) === null || _b === void 0 ? void 0 : _b.getThemes) === null || _c === void 0 ? void 0 : _c.call(_b);
15
- const themes = allThemes.map((theme, index) => {
16
- if (typeof theme === 'string') {
17
- // protection against old state, which could be string
18
- theme = {
19
- Name: theme,
20
- Description: theme,
21
- };
22
- }
23
- return {
24
- label: theme.Description,
25
- value: theme.Name,
26
- onClick: () => this.onSelectTheme(theme),
27
- };
28
- });
29
- const currentThemeObj = allThemes.find((theme) => theme.Name === this.props.CurrentTheme);
30
- const currentThemeDescription = (_d = currentThemeObj === null || currentThemeObj === void 0 ? void 0 : currentThemeObj.Description) !== null && _d !== void 0 ? _d : this.props.CurrentTheme;
31
- const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
32
- const dropDownStyle = this.props.viewType === 'Toolbar'
33
- ? {
34
- maxWidth: '25rem',
35
- whiteSpace: 'nowrap',
36
- overflow: 'hidden',
37
- textOverflow: 'ellipsis',
38
- fontSize: 'small',
39
- }
40
- : { minWidth: '100%', fontSize: 'small' };
41
- return (React.createElement("div", { className: (0, join_1.default)(this.props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Theme__wrap`) },
42
- React.createElement(Select_1.Select, { className: `ab-${elementType}__Theme__select`, options: themes, value: currentThemeObj === null || currentThemeObj === void 0 ? void 0 : currentThemeObj.Name, onChange: (theme) => this.onSelectTheme({ Name: theme }) })));
43
- }
44
- onSelectTheme(theme) {
45
- this.props.onSelectTheme(theme.Name);
46
- }
47
- }
48
- function mapStateToProps(state, ownProps) {
49
- return {
50
- SystemThemes: state.Theme.SystemThemes,
51
- CurrentTheme: state.Theme.CurrentTheme,
52
- UserThemes: state.Theme.UserThemes,
53
- };
54
- }
55
- function mapDispatchToProps(dispatch) {
56
- return {
57
- onSelectTheme: (theme) => dispatch(ThemeRedux.ThemeSelect(theme)),
58
- };
59
- }
60
- exports.ThemeViewPanelControl = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(ThemeViewPanelComponent);
8
+ const ThemeSelector_1 = require("./ThemeSelector");
9
+ const ThemeViewPanelControl = (props) => {
10
+ const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
11
+ return (React.createElement("div", { className: (0, join_1.default)(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Theme__wrap`) },
12
+ React.createElement(ThemeSelector_1.ThemeSelector, null)));
13
+ };
14
+ exports.ThemeViewPanelControl = ThemeViewPanelControl;
@@ -15,9 +15,10 @@ const Select_1 = require("../../Select");
15
15
  const QueryBuilder_1 = require("./QueryBuilder");
16
16
  const utils_1 = require("./utils");
17
17
  const PrimitiveColumnSelector = (props) => {
18
- return (react_1.default.createElement(ColumnSelector_1.ColumnSelector, { value: props.columnId, type: props.type, onChange: (columnId) => {
19
- props.onChange(`[${columnId}]`);
20
- } }));
18
+ return (react_1.default.createElement(rebass_1.Box, null,
19
+ react_1.default.createElement(ColumnSelector_1.ColumnSelector, { value: props.columnId, type: props.type, onChange: (columnId) => {
20
+ props.onChange(`[${columnId}]`);
21
+ } })));
21
22
  };
22
23
  exports.PrimitiveColumnSelector = PrimitiveColumnSelector;
23
24
  const PrimiteValueInput = (props) => {
@@ -96,11 +97,11 @@ const PrimiteValueInput = (props) => {
96
97
  ];
97
98
  const typeOption = options.find((option) => option.value === type);
98
99
  return (react_1.default.createElement(rebass_1.Flex, { "data-id": "query-input-wrapper", mr: 2 },
99
- editor,
100
100
  react_1.default.createElement(rebass_1.Flex, null,
101
101
  react_1.default.createElement(Select_1.Select, { rederSingleValue: (value) => {
102
102
  return (react_1.default.createElement(react_1.default.Fragment, null, typeOption.value === 'column-name' ? react_1.default.createElement(icons_1.Icon, { name: "grid" }) : react_1.default.createElement(icons_1.Icon, { name: "edit" })));
103
- }, variant: "raised", value: typeOption.value, options: options, onChange: (value) => handleTypeChange(value) }))));
103
+ }, variant: "raised", value: typeOption.value, options: options, onChange: (value) => handleTypeChange(value) })),
104
+ editor));
104
105
  };
105
106
  exports.PrimiteValueInput = PrimiteValueInput;
106
107
  const ExpressionSelector = (props) => {
@@ -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;
@@ -15,21 +15,21 @@ const commonStyles = ({ isFocused, isDisabled, }) => {
15
15
  };
16
16
  };
17
17
  const Select = function (props) {
18
- var _a, _b, _c, _d;
19
- let selectedOption = (_a = props.options.find((option) => {
18
+ var _a, _b, _c, _d, _e;
19
+ let selectedOption = (_b = ((_a = props.options) !== null && _a !== void 0 ? _a : []).find((option) => {
20
20
  if (typeof option.value === 'object' && option.value instanceof Date) {
21
21
  return (0, date_fns_1.isSameDay)(option.value, props.value);
22
22
  }
23
23
  return option.value === props.value;
24
- })) !== null && _a !== void 0 ? _a : null;
24
+ })) !== null && _b !== void 0 ? _b : null;
25
25
  if (!selectedOption && props.value !== undefined && props.value !== null) {
26
26
  selectedOption = {
27
27
  value: props.value,
28
28
  label: props.value,
29
29
  };
30
30
  }
31
- let disabled = (_b = props.disabled) !== null && _b !== void 0 ? _b : false;
32
- const accessLevel = (_c = props.accessLevel) !== null && _c !== void 0 ? _c : 'Full';
31
+ let disabled = (_c = props.disabled) !== null && _c !== void 0 ? _c : false;
32
+ const accessLevel = (_d = props.accessLevel) !== null && _d !== void 0 ? _d : 'Full';
33
33
  if (accessLevel === 'Hidden') {
34
34
  return null;
35
35
  }
@@ -52,7 +52,7 @@ const Select = function (props) {
52
52
  };
53
53
  }, []);
54
54
  const SelectComponent = props.isCreatable ? creatable_1.default : react_select_1.default;
55
- 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: (_d = props.menuPosition) !== null && _d !== void 0 ? _d : 'fixed', isClearable: props.isClearable, onChange: (option) => {
55
+ 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) => {
56
56
  if (props.isMulti) {
57
57
  props.onChange(option.map((x) => x === null || x === void 0 ? void 0 : x.value));
58
58
  }
@@ -81,7 +81,7 @@ const Select = function (props) {
81
81
  },
82
82
  // @ts-ignorets-ignore when fixed
83
83
  menuPortal: (baseStyle) => {
84
- return Object.assign(Object.assign({}, baseStyle), { zIndex: 999999 });
84
+ return Object.assign(Object.assign({}, baseStyle), { zIndex: 999999, textAlign: 'left' });
85
85
  },
86
86
  // @ts-ignore
87
87
  menu: (baseStyle, state) => {
@@ -103,7 +103,10 @@ const Select = function (props) {
103
103
  },
104
104
  // @ts-ignore
105
105
  input: (baseStyle, state) => {
106
- return Object.assign(Object.assign({}, baseStyle), { color: 'var(--ab-cmp-input__color)' });
106
+ return Object.assign(Object.assign({}, baseStyle), { padding: props.size === 'small' ? 0 : baseStyle.padding, color: 'var(--ab-cmp-input__color)' });
107
+ },
108
+ valueContainer: (baseStyle) => {
109
+ return Object.assign(Object.assign({}, baseStyle), { padding: props.size === 'small' ? `0 var(--ab-space-1)` : baseStyle.padding });
107
110
  },
108
111
  // @ts-ignore
109
112
  singleValue: (baseStyle, state) => {
@@ -114,7 +117,7 @@ const Select = function (props) {
114
117
  state;
115
118
  return Object.assign(Object.assign(Object.assign({}, baseStyle), commonStyles(state)), {
116
119
  // height: 30,
117
- 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'
120
+ 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'
118
121
  ? '1px solid transparent'
119
122
  : 'var(--ab-cmp-input__border)', '&:hover': {
120
123
  border: 'var(--ab-cmp-input__border)',
@@ -4588,7 +4588,7 @@ export declare const ADAPTABLE_METAMODEL: {
4588
4588
  isOpt?: undefined;
4589
4589
  })[];
4590
4590
  };
4591
- Report_2: {
4591
+ Report: {
4592
4592
  name: string;
4593
4593
  kind: string;
4594
4594
  desc: string;
@@ -4628,7 +4628,7 @@ exports.ADAPTABLE_METAMODEL = {
4628
4628
  "name": "report",
4629
4629
  "kind": "R",
4630
4630
  "desc": "The exported report",
4631
- "ref": "unknown"
4631
+ "ref": "Report"
4632
4632
  },
4633
4633
  {
4634
4634
  "name": "reportData",
@@ -7567,7 +7567,7 @@ exports.ADAPTABLE_METAMODEL = {
7567
7567
  "name": "report",
7568
7568
  "kind": "R",
7569
7569
  "desc": "Report being exported",
7570
- "ref": "unknown"
7570
+ "ref": "Report"
7571
7571
  }
7572
7572
  ]
7573
7573
  },
@@ -7868,8 +7868,8 @@ exports.ADAPTABLE_METAMODEL = {
7868
7868
  }
7869
7869
  ]
7870
7870
  },
7871
- "Report_2": {
7872
- "name": "Report_2",
7871
+ "Report": {
7872
+ "name": "Report",
7873
7873
  "kind": "I",
7874
7874
  "desc": "A Report which can export data from AdapTable",
7875
7875
  "props": [
@@ -7920,7 +7920,7 @@ exports.ADAPTABLE_METAMODEL = {
7920
7920
  "name": "report",
7921
7921
  "kind": "R",
7922
7922
  "desc": "Definition of Report being Run",
7923
- "ref": "unknown"
7923
+ "ref": "Report"
7924
7924
  },
7925
7925
  {
7926
7926
  "name": "reportData",
@@ -80,7 +80,9 @@ function mapExpressionToQlPredicate(expression) {
80
80
  }
81
81
  }
82
82
  catch (err) {
83
- return { errorMessage: `Query Builder does not support the expression: ${expression}` };
83
+ return {
84
+ errorMessage: `Query Builder does not support the expression: ${expression}`,
85
+ };
84
86
  }
85
87
  }
86
88
  exports.mapExpressionToQlPredicate = mapExpressionToQlPredicate;
@@ -38,6 +38,9 @@ function mapQlPredicateToExpression(predicate) {
38
38
  return `"${arg}"`;
39
39
  }
40
40
  if (typeof arg === 'object') {
41
+ if ((0, types_1.isQlLogicalOperator)(arg.operator)) {
42
+ return `(${mapQlPredicateToExpression(arg)})`;
43
+ }
41
44
  return mapQlPredicateToExpression(arg);
42
45
  }
43
46
  if (typeof arg === 'boolean') {
@@ -48,6 +51,12 @@ function mapQlPredicateToExpression(predicate) {
48
51
  if (typeof firstArg === 'object') {
49
52
  firstArg = mapQlPredicateToExpression(firstArg);
50
53
  }
54
+ if ((0, types_1.isQlLogicalOperator)(operator)) {
55
+ // need to compose with AND [] AND ...
56
+ return mappedArgs.length
57
+ ? `${firstArg} ${operatorSymbol} ${mappedArgs.join(` ${operatorSymbol} `)}`
58
+ : `${firstArg}`;
59
+ }
51
60
  if (predicateType === 'INFIX') {
52
61
  if (operator === 'BETWEEN') {
53
62
  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=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3BhY2thZ2VzL2FkYXB0YWJsZS9zcmMvdGhlbWVzL2Rhcmsuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFO0VBQ0E7RUFFQTtFQUVBO0VBQ0E7RUFFQTtFQUNBO0VBQ0E7RUFDQTtFQVFBO0VBQ0E7RUFFQTtFQUVBO0VBQ0E7O0FBRUE7QUFBQTtFQUVFIiwiZmlsZSI6ImRhcmsuY3NzIiwic291cmNlUm9vdCI6IiJ9 */
22
+ /*# sourceMappingURL=dark.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../packages/adaptable/src/themes/dark.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EAEA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAQA;EACA;EAEA;EAEA;EACA;;AAEA;AAAA;EAEE","file":"dark.css"}
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=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3BhY2thZ2VzL2FkYXB0YWJsZS9zcmMvdGhlbWVzL2xpZ2h0LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSIsImZpbGUiOiJsaWdodC5jc3MiLCJzb3VyY2VSb290IjoiIn0= */
5
+ /*# sourceMappingURL=light.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../packages/adaptable/src/themes/light.scss"],"names":[],"mappings":"AAAA;EACE","file":"light.css"}
1
+ {"version":3,"sources":["../../packages/adaptable/src/themes/light.scss","light.css"],"names":[],"mappings":"AAAA;EACE,wBAAA;ACCF","file":"light.css"}