@adaptabletools/adaptable 17.0.0 → 17.0.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/bundle.cjs.js +143 -143
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/Api/Internal/DashboardInternalApi.d.ts +1 -0
- package/src/Api/Internal/DashboardInternalApi.js +5 -0
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -2
- package/src/View/Dashboard/PinnedDashboard.js +2 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +23 -4
- package/src/components/Select/Select.d.ts +1 -1
- package/src/components/Select/Select.js +17 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1705922479309;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -6,6 +6,7 @@ export declare class DashboardInternalApi extends ApiBase {
|
|
|
6
6
|
*/
|
|
7
7
|
fireDashboardChangedEvent(trigger: string, oldDashboardState: DashboardState, newDashboardState: DashboardState): void;
|
|
8
8
|
isToolbarInActiveTab(toolbarName: string, dashboardState: DashboardState): boolean;
|
|
9
|
+
isToolbarCustom(toolbarName: string): boolean;
|
|
9
10
|
getCustomToolbarRenderContainerId(customToolbarName: string): string;
|
|
10
11
|
getCustomToolbarButtonsContainerId(customToolbarName: string): string;
|
|
11
12
|
getCustomToolbarComponentContainerId(customToolbarName: string): string;
|
|
@@ -60,6 +60,11 @@ class DashboardInternalApi extends ApiBase_1.ApiBase {
|
|
|
60
60
|
}
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
63
|
+
isToolbarCustom(toolbarName) {
|
|
64
|
+
return this.adaptable.api.dashboardApi
|
|
65
|
+
.getCustomToolbars()
|
|
66
|
+
.some((tb) => tb.name === toolbarName);
|
|
67
|
+
}
|
|
63
68
|
getCustomToolbarRenderContainerId(customToolbarName) {
|
|
64
69
|
return `ab-CustomToolbar__${customToolbarName}__renderContent`;
|
|
65
70
|
}
|
|
@@ -154,7 +154,7 @@ const AlertButtonsEditor = (props) => {
|
|
|
154
154
|
label: StringExtensions_1.default.CapitaliseFirstLetter(variant),
|
|
155
155
|
value: variant,
|
|
156
156
|
};
|
|
157
|
-
}),
|
|
157
|
+
}), renderSingleValue: (option) => `Variant: ${option.label}`, value: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant, onChange: (value) => {
|
|
158
158
|
setVariant(value);
|
|
159
159
|
} })),
|
|
160
160
|
React.createElement(Select_1.Select, { options: [
|
|
@@ -168,7 +168,7 @@ const AlertButtonsEditor = (props) => {
|
|
|
168
168
|
value: tone,
|
|
169
169
|
};
|
|
170
170
|
}),
|
|
171
|
-
],
|
|
171
|
+
], renderSingleValue: (option) => `Tone: ${option.label}`, onChange: (value) => {
|
|
172
172
|
if (value === 'text') {
|
|
173
173
|
setTone(null);
|
|
174
174
|
}
|
|
@@ -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
|
}
|
|
@@ -102,7 +102,7 @@ const PrimiteValueInput = (props) => {
|
|
|
102
102
|
];
|
|
103
103
|
const typeOption = options.find((option) => option.value === type);
|
|
104
104
|
return (react_1.default.createElement(InputGroup_1.InputGroup, { Component: rebass_1.Flex, "data-id": "query-input-wrapper", mr: 2 },
|
|
105
|
-
react_1.default.createElement(Select_1.Select, {
|
|
105
|
+
react_1.default.createElement(Select_1.Select, { renderSingleValue: (value) => {
|
|
106
106
|
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" })));
|
|
107
107
|
}, value: typeOption.value, options: options, onChange: (value) => handleTypeChange(value) }),
|
|
108
108
|
editor));
|
|
@@ -114,18 +114,37 @@ const PrimitiveMultiValueInput = (props) => {
|
|
|
114
114
|
} }));
|
|
115
115
|
};
|
|
116
116
|
exports.PrimitiveMultiValueInput = PrimitiveMultiValueInput;
|
|
117
|
+
const SymbolToIcon = (props) => {
|
|
118
|
+
switch (props.symbol) {
|
|
119
|
+
case '=':
|
|
120
|
+
return react_1.default.createElement(icons_1.Icon, { name: "equals" });
|
|
121
|
+
case '!=':
|
|
122
|
+
return react_1.default.createElement(icons_1.Icon, { name: "not-equal" });
|
|
123
|
+
case '>':
|
|
124
|
+
return react_1.default.createElement(icons_1.Icon, { name: "greater-than" });
|
|
125
|
+
case '>=':
|
|
126
|
+
return react_1.default.createElement(icons_1.Icon, { name: "greater-than-or-equal" });
|
|
127
|
+
case '<':
|
|
128
|
+
return react_1.default.createElement(icons_1.Icon, { name: "less-than" });
|
|
129
|
+
case '<=':
|
|
130
|
+
return react_1.default.createElement(icons_1.Icon, { name: "less-than-or-equal" });
|
|
131
|
+
default:
|
|
132
|
+
return react_1.default.createElement(react_1.default.Fragment, null, props.symbol);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
117
135
|
const ExpressionSelector = (props) => {
|
|
118
136
|
var _a;
|
|
119
137
|
const { getExpressions } = (0, QueryBuilder_1.useQueryBuilderContext)();
|
|
120
138
|
const expressions = props.dataType ? getExpressions(props.dataType) : [];
|
|
121
|
-
return (react_1.default.createElement(DropdownButton_1.default, { "data-id": "expression-selector", "data-value": props.value, variant: "raised", columns: ['label'], items: expressions.map((expression) => ({
|
|
122
|
-
label: (0, mapQlPredicateToExpression_1.getQlPredicateSymbol)(expression),
|
|
139
|
+
return (react_1.default.createElement(DropdownButton_1.default, { "data-id": "expression-selector", "data-value": props.value, variant: "raised", tone: 'accent', columns: ['label'], items: expressions.map((expression) => ({
|
|
140
|
+
label: react_1.default.createElement(SymbolToIcon, { symbol: (0, mapQlPredicateToExpression_1.getQlPredicateSymbol)(expression) }),
|
|
123
141
|
onClick: () => {
|
|
124
142
|
if (expression !== props.value) {
|
|
125
143
|
props.onExpressionChange(expression);
|
|
126
144
|
}
|
|
127
145
|
},
|
|
128
|
-
})) },
|
|
146
|
+
})) },
|
|
147
|
+
react_1.default.createElement(SymbolToIcon, { symbol: (_a = (0, mapQlPredicateToExpression_1.getQlPredicateSymbol)(props.value)) !== null && _a !== void 0 ? _a : 'Select Operator' })));
|
|
129
148
|
};
|
|
130
149
|
exports.ExpressionSelector = ExpressionSelector;
|
|
131
150
|
const CombinatorSelector = (props) => {
|
|
@@ -17,7 +17,7 @@ export type SelectProps<SelectValue extends unknown, IsMulti extends boolean = f
|
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
'data-name'?: string;
|
|
19
19
|
'data-id'?: string;
|
|
20
|
-
|
|
20
|
+
renderSingleValue?: (option: SelectOption<SelectValue>) => React.ReactNode;
|
|
21
21
|
className?: string;
|
|
22
22
|
isLoding?: boolean;
|
|
23
23
|
onFocus?: () => void;
|
|
@@ -6,6 +6,7 @@ const date_fns_1 = require("date-fns");
|
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const react_select_1 = tslib_1.__importStar(require("react-select"));
|
|
8
8
|
const creatable_1 = tslib_1.__importDefault(require("react-select/creatable"));
|
|
9
|
+
const icons_1 = require("../icons");
|
|
9
10
|
const commonStyles = ({ isFocused, isDisabled, }) => {
|
|
10
11
|
return {
|
|
11
12
|
color: 'var(--ab-cmp-input__color)',
|
|
@@ -71,6 +72,18 @@ const Select = function (props) {
|
|
|
71
72
|
};
|
|
72
73
|
}, []);
|
|
73
74
|
const SelectComponent = props.isCreatable ? creatable_1.default : react_select_1.default;
|
|
75
|
+
const ClearIndicator = React.useMemo(() => {
|
|
76
|
+
return (clearIndicatorProps) => {
|
|
77
|
+
return (React.createElement(react_select_1.components.ClearIndicator, Object.assign({}, clearIndicatorProps),
|
|
78
|
+
React.createElement(icons_1.Icon, { name: "close" })));
|
|
79
|
+
};
|
|
80
|
+
}, []);
|
|
81
|
+
const DropdownIndicator = React.useMemo(() => {
|
|
82
|
+
return (props) => {
|
|
83
|
+
return (React.createElement(react_select_1.components.DropdownIndicator, Object.assign({}, props),
|
|
84
|
+
React.createElement(icons_1.Icon, { name: "triangle-down", style: { height: 20, width: 20 } })));
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
74
87
|
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: (_g = props.menuPosition) !== null && _g !== void 0 ? _g : 'absolute',
|
|
75
88
|
// This needed so the menu is not clipped by overflow: hidden
|
|
76
89
|
menuPortalTarget: document.body, isClearable: props.isClearable, onChange: (option) => {
|
|
@@ -84,10 +97,12 @@ const Select = function (props) {
|
|
|
84
97
|
SelectContainer,
|
|
85
98
|
ValueContainer,
|
|
86
99
|
SingleValue: (singleValueProps) => {
|
|
87
|
-
return (React.createElement(react_select_1.components.SingleValue, Object.assign({}, singleValueProps), props.
|
|
88
|
-
? props.
|
|
100
|
+
return (React.createElement(react_select_1.components.SingleValue, Object.assign({}, singleValueProps), props.renderSingleValue
|
|
101
|
+
? props.renderSingleValue(selectedOption)
|
|
89
102
|
: singleValueProps.children));
|
|
90
103
|
},
|
|
104
|
+
ClearIndicator,
|
|
105
|
+
DropdownIndicator,
|
|
91
106
|
},
|
|
92
107
|
/**
|
|
93
108
|
* Using styles is the preferred way to style react-select.
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "17.0.
|
|
1
|
+
declare const _default: "17.0.1";
|
|
2
2
|
export default _default;
|
package/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = '17.0.
|
|
3
|
+
exports.default = '17.0.1'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
|