@adaptabletools/adaptable 22.0.0-canary.4 → 22.0.0-canary.5
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/index.css +46 -26
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableState/Common/AdaptableStyle.d.ts +1 -1
- package/src/AdaptableState/LayoutState.d.ts +1 -1
- package/src/Api/Implementation/LayoutHelpers.js +4 -4
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +84 -33
- package/src/View/GridFilter/GridFilterExpressionEditor.js +6 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +33 -70
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +2 -2
- package/src/components/ColorPicker/ColorPicker.js +5 -4
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +1 -1
- package/src/layout-manager/src/index.js +5 -5
- package/src/layout-manager/src/normalizeLayoutModel.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +0 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +0 -632
- package/src/View/Alert/AlertEntityRow.d.ts +0 -11
- package/src/View/Alert/AlertEntityRow.js +0 -28
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +0 -21
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +0 -58
- package/src/View/Components/Buttons/ButtonFunction.d.ts +0 -7
- package/src/View/Components/Buttons/ButtonFunction.js +0 -8
- package/src/View/Components/Buttons/ButtonGeneral.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonGeneral.js +0 -7
- package/src/View/Components/Buttons/ButtonPreviewDelete.d.ts +0 -4
- package/src/View/Components/Buttons/ButtonPreviewDelete.js +0 -5
- package/src/View/Components/Buttons/ButtonShow.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonShow.js +0 -7
- package/src/View/Components/Buttons/ButtonShowChart.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonShowChart.js +0 -7
- package/src/View/Components/Buttons/ButtonUndo.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonUndo.js +0 -7
- package/src/View/Components/ExpressionWizard.d.ts +0 -24
- package/src/View/Components/ExpressionWizard.js +0 -77
- package/src/View/Components/FilterForm/Waiting.d.ts +0 -10
- package/src/View/Components/FilterForm/Waiting.js +0 -14
- package/src/View/Components/Panels/PanelFooter.d.ts +0 -10
- package/src/View/Components/Panels/PanelFooter.js +0 -9
- package/src/View/Components/Panels/PanelWithTwoButtons.d.ts +0 -12
- package/src/View/Components/Panels/PanelWithTwoButtons.js +0 -15
- package/src/View/Components/Panels/ToolPanelSettingsPanel.d.ts +0 -8
- package/src/View/Components/Panels/ToolPanelSettingsPanel.js +0 -26
- package/src/View/Components/Selectors/ColumnSelectorOld.d.ts +0 -18
- package/src/View/Components/Selectors/ColumnSelectorOld.js +0 -45
- package/src/View/Components/SharedProps/WizardScopeState.d.ts +0 -4
- package/src/View/Components/SharedProps/WizardScopeState.js +0 -1
- package/src/View/Components/WizardSummaryRow.d.ts +0 -9
- package/src/View/Components/WizardSummaryRow.js +0 -11
- package/src/View/CustomSort/CustomSortSummary.d.ts +0 -23
- package/src/View/CustomSort/CustomSortSummary.js +0 -105
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.d.ts +0 -9
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.js +0 -19
- package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +0 -19
- package/src/View/Export/Wizard/ReportColumnTypeWizard.js +0 -68
- package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +0 -19
- package/src/View/Export/Wizard/ReportRowTypeWizard.js +0 -68
- package/src/View/Export/Wizard/ReportSettingsWizard.d.ts +0 -21
- package/src/View/Export/Wizard/ReportSettingsWizard.js +0 -56
- package/src/View/Export/Wizard/ReportSummaryWizard.d.ts +0 -15
- package/src/View/Export/Wizard/ReportSummaryWizard.js +0 -35
- package/src/View/Filter/FilterSummary.d.ts +0 -18
- package/src/View/Filter/FilterSummary.js +0 -48
- package/src/View/FormatColumn/FormatColumnSummary.d.ts +0 -22
- package/src/View/FormatColumn/FormatColumnSummary.js +0 -90
- package/src/View/FreeTextColumn/FreeTextColumnSummary.d.ts +0 -22
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +0 -88
- package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.d.ts +0 -7
- package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.js +0 -94
- package/src/View/PlusMinus/PlusMinusSummary.d.ts +0 -22
- package/src/View/PlusMinus/PlusMinusSummary.js +0 -95
- package/src/View/Wizard/WizardLegend.d.ts +0 -12
- package/src/View/Wizard/WizardLegend.js +0 -23
|
@@ -5,7 +5,7 @@ import { CheckBox } from '../../components/CheckBox';
|
|
|
5
5
|
import { ColorPicker } from '../../components/ColorPicker';
|
|
6
6
|
import HelpBlock from '../../components/HelpBlock';
|
|
7
7
|
import Panel from '../../components/Panel';
|
|
8
|
-
import
|
|
8
|
+
import { Tabs } from '../../components/Tabs';
|
|
9
9
|
import { Select } from '../../components/Select';
|
|
10
10
|
import { StylePreview } from '../../components/StylePreview';
|
|
11
11
|
import { Toggle, ToggleGroup } from '../../components/Toggle';
|
|
@@ -148,25 +148,85 @@ export const StyleComponent = (props) => {
|
|
|
148
148
|
const styleClassNames = props.api.userInterfaceApi.getStyleClassNames();
|
|
149
149
|
const colourSpellingVariant = props.api.internalApi.getCorrectEnglishVariant('Colour');
|
|
150
150
|
const coloursSpellingVariant = props.api.internalApi.getCorrectEnglishVariant('colours');
|
|
151
|
-
const fontSizes = ['Default', ...EnumExtensions.getNames(FontSize)];
|
|
152
151
|
return (React.createElement(Cmp, { ...cmpProps, className: twMerge(clsx('ab-StyleComponent twa:text-3', props.className)) },
|
|
153
|
-
ArrayExtensions.IsNotNullOrEmpty(styleClassNames)
|
|
154
|
-
React.createElement(
|
|
155
|
-
|
|
156
|
-
React.createElement(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
152
|
+
ArrayExtensions.IsNotNullOrEmpty(styleClassNames) ? (React.createElement(Tabs, { value: showClassName ? 'classname' : 'createstyle', onValueChange: (value) => onShowClassNameChanged(value === 'classname') },
|
|
153
|
+
React.createElement(Tabs.Tab, { "data-name": "show-class-name", value: "classname" }, "Use Style Class Name"),
|
|
154
|
+
React.createElement(Tabs.Tab, { "data-name": "create-style", value: "createstyle" }, "Create Style"),
|
|
155
|
+
React.createElement(Tabs.Content, { value: "classname" },
|
|
156
|
+
React.createElement(Card, { shadow: false },
|
|
157
|
+
React.createElement(Card.Title, null, "CSS Class Name"),
|
|
158
|
+
React.createElement(Card.Body, { gap: 2, className: "twa:p-1" },
|
|
159
|
+
React.createElement(HelpBlock, null, "Select a CSS Class Name"),
|
|
160
|
+
React.createElement(Box, { className: "twa:max-w-[15rem]" },
|
|
161
|
+
React.createElement(Select, { options: ArrayExtensions.IsNullOrEmpty(styleClassNames)
|
|
162
|
+
? []
|
|
163
|
+
: styleClassNames.map((item) => ({
|
|
164
|
+
label: item,
|
|
165
|
+
value: item,
|
|
166
|
+
})), value: componentStyle.ClassName, onChange: (value) => onStyleClassNameChanged(value) })),
|
|
167
|
+
React.createElement(Box, { className: "twa:m-2 twa:flex-2 twa:text-warn" }, 'Please ensure that the styles listed are in the current stylesheet')))),
|
|
168
|
+
React.createElement(Tabs.Content, { value: "createstyle" },
|
|
169
|
+
React.createElement(Flex, { className: "twa:flex-1 twa:flex twa:flex-col twa:gap-2 twa:lg:flex-row" },
|
|
170
|
+
React.createElement(Card, { shadow: false, className: "twa:flex-1" },
|
|
171
|
+
React.createElement(Card.Body, { gap: 2, className: "twa:grid twa:grid-cols-[auto_1fr_auto_1fr] twa:items-center twa:p-1" },
|
|
172
|
+
React.createElement(Card.Title, { className: "twa:col-span-2" },
|
|
173
|
+
colourSpellingVariant,
|
|
174
|
+
" & Border Properties"),
|
|
175
|
+
React.createElement(HelpBlock, { className: "twa:col-span-2" },
|
|
176
|
+
"Set ",
|
|
177
|
+
coloursSpellingVariant,
|
|
178
|
+
" by ticking a checkbox and selecting from the dropdown; leave unchecked to use cell's existing ",
|
|
179
|
+
coloursSpellingVariant),
|
|
180
|
+
React.createElement(CheckBox, { "data-name": "set-background-color", value: "existing", checked: !!componentStyle.BackColor, onChange: (checked) => onUseBackColorCheckChange(checked) },
|
|
181
|
+
"Back ",
|
|
182
|
+
colourSpellingVariant),
|
|
183
|
+
React.createElement(ColorPicker, { disabled: componentStyle.BackColor == null, api: props.api, value: componentStyle.BackColor || '#ffffff', onChange: (x) => onBackColorSelectChange(x) }),
|
|
184
|
+
React.createElement(CheckBox, { "data-name": "set-foreground-color", value: "existing", className: "twa:row-start-4", checked: componentStyle.ForeColor ? true : false, onChange: (checked) => onUseForeColorCheckChange(checked) },
|
|
185
|
+
"Fore ",
|
|
186
|
+
colourSpellingVariant),
|
|
187
|
+
React.createElement(ColorPicker, { className: "twa:row-start-4 twa:col-start-2", disabled: componentStyle.ForeColor == null, api: props.api, value: componentStyle.ForeColor || '#ffffff', onChange: (x) => onForeColorSelectChange(x) }),
|
|
188
|
+
React.createElement(CheckBox, { "data-name": "set-border-color", value: "existing", className: "twa:row-start-5 twa:col-start-1", checked: componentStyle.BorderColor ? true : false, onChange: (checked) => onUseBorderColorCheckChange(checked) },
|
|
189
|
+
"Border ",
|
|
190
|
+
colourSpellingVariant),
|
|
191
|
+
React.createElement(ColorPicker, { disabled: componentStyle.BorderColor == null, api: props.api, className: "twa:row-start-5 twa:col-start-2", value: componentStyle.BorderColor || '#ffffff', onChange: (x) => onBorderColorSelectChange(x) }),
|
|
192
|
+
React.createElement("span", { className: "twa:row-start-6" }, "Border Radius"),
|
|
193
|
+
React.createElement(AdaptableInput, { className: "twa:w-[100px] twa:row-start-6", type: "number", min: "0", value: componentStyle.BorderRadius, onChange: (event) => {
|
|
194
|
+
const number = Number(event.target.value);
|
|
195
|
+
if (isNaN(number)) {
|
|
196
|
+
onBorderRadiusChange(0);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
onBorderRadiusChange(number);
|
|
200
|
+
}
|
|
201
|
+
} }),
|
|
202
|
+
React.createElement(Card.Title, { className: "twa:col-span-2 twa:col-start-3 twa:row-start-1" }, "Font Properties"),
|
|
203
|
+
React.createElement(HelpBlock, { className: "twa:self-stretch twa:col-span-2 twa:col-start-3 twa:row-start-2" }, "Set the font properties of the Style"),
|
|
204
|
+
React.createElement("span", null, "Font Style"),
|
|
205
|
+
React.createElement(ToggleGroup, null,
|
|
206
|
+
React.createElement(Toggle, { pressed: componentStyle.FontStyle == FontStyle.Italic, onPressedChange: (checked) => onFontStyleChange(checked), icon: "italic" }),
|
|
207
|
+
React.createElement(Toggle, { pressed: componentStyle.FontWeight == FontWeight.Bold, onPressedChange: (checked) => onFontWeightChange(checked), icon: "bold" })),
|
|
208
|
+
React.createElement("span", null, "Text Decoration"),
|
|
209
|
+
React.createElement(ToggleGroup, null,
|
|
210
|
+
React.createElement(Toggle, { icon: "underline", pressed: componentStyle.TextDecoration === 'Underline', onPressedChange: (checked) => onTextDecorationChange(checked ? 'Underline' : 'None') }),
|
|
211
|
+
React.createElement(Toggle, { icon: "strikethrough", pressed: componentStyle.TextDecoration === 'LineThrough', onPressedChange: (checked) => onTextDecorationChange(checked ? 'LineThrough' : 'None') }),
|
|
212
|
+
React.createElement(Toggle, { icon: "overline", pressed: componentStyle.TextDecoration === 'Overline', onPressedChange: (checked) => onTextDecorationChange(checked ? 'Overline' : 'None') })),
|
|
213
|
+
React.createElement("span", null, "Font Size"),
|
|
214
|
+
React.createElement(Flex, { flexDirection: "row", alignItems: "center" },
|
|
215
|
+
React.createElement(Select, { placeholder: "Default", options: [
|
|
216
|
+
{
|
|
217
|
+
label: 'Default',
|
|
218
|
+
value: '',
|
|
219
|
+
},
|
|
220
|
+
...EnumExtensions.getNames(FontSize).map((enumName) => ({
|
|
221
|
+
label: enumName,
|
|
222
|
+
value: enumName,
|
|
223
|
+
})),
|
|
224
|
+
], value: componentStyle.FontSize?.toString() ?? '', onChange: (value) => onFontSizeChange(value) })),
|
|
225
|
+
React.createElement("span", null, "Alignment"),
|
|
226
|
+
React.createElement(ToggleGroup, null,
|
|
227
|
+
React.createElement(Toggle, { icon: "align-left", pressed: componentStyle.Alignment === 'Left', onPressedChange: (pressed) => pressed ? onAlignmentChange('Left') : onAlignmentChange('Default') }),
|
|
228
|
+
React.createElement(Toggle, { icon: "align-center", pressed: componentStyle.Alignment === 'Center', onPressedChange: (pressed) => pressed ? onAlignmentChange('Center') : onAlignmentChange('Default') }),
|
|
229
|
+
React.createElement(Toggle, { icon: "align-right", pressed: componentStyle.Alignment === 'Right', onPressedChange: (pressed) => pressed ? onAlignmentChange('Right') : onAlignmentChange('Default') })))))))) : (React.createElement(Flex, { className: "twa:flex-1 twa:flex twa:flex-col twa:gap-2 twa:lg:flex-row" },
|
|
170
230
|
React.createElement(Card, { shadow: false, className: "twa:flex-1" },
|
|
171
231
|
React.createElement(Card.Body, { gap: 2, className: "twa:grid twa:grid-cols-[auto_1fr_auto_1fr] twa:items-center twa:p-1" },
|
|
172
232
|
React.createElement(Card.Title, { className: "twa:col-span-2" },
|
|
@@ -211,7 +271,7 @@ export const StyleComponent = (props) => {
|
|
|
211
271
|
React.createElement(Toggle, { icon: "strikethrough", pressed: componentStyle.TextDecoration === 'LineThrough', onPressedChange: (checked) => onTextDecorationChange(checked ? 'LineThrough' : 'None') }),
|
|
212
272
|
React.createElement(Toggle, { icon: "overline", pressed: componentStyle.TextDecoration === 'Overline', onPressedChange: (checked) => onTextDecorationChange(checked ? 'Overline' : 'None') })),
|
|
213
273
|
React.createElement("span", null, "Font Size"),
|
|
214
|
-
|
|
274
|
+
React.createElement(Flex, { flexDirection: "row", alignItems: "center" },
|
|
215
275
|
React.createElement(Select, { placeholder: "Default", options: [
|
|
216
276
|
{
|
|
217
277
|
label: 'Default',
|
|
@@ -221,21 +281,12 @@ export const StyleComponent = (props) => {
|
|
|
221
281
|
label: enumName,
|
|
222
282
|
value: enumName,
|
|
223
283
|
})),
|
|
224
|
-
], value: componentStyle.FontSize?.toString() ?? '', onChange: (value) => onFontSizeChange(value) }))
|
|
225
|
-
return (React.createElement(Radio, { onClick: () => onFontSizeChange(enumName), checked: (enumName == 'Default' && !componentStyle.FontSize) ||
|
|
226
|
-
componentStyle.FontSize === enumName, key: enumName }, enumName));
|
|
227
|
-
}))),
|
|
284
|
+
], value: componentStyle.FontSize?.toString() ?? '', onChange: (value) => onFontSizeChange(value) })),
|
|
228
285
|
React.createElement("span", null, "Alignment"),
|
|
229
286
|
React.createElement(ToggleGroup, null,
|
|
230
|
-
React.createElement(Toggle, { icon: "align-left", pressed: componentStyle.Alignment === 'Left', onPressedChange: (pressed) => pressed
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
React.createElement(Toggle, { icon: "align-center", pressed: componentStyle.Alignment === 'Center', onPressedChange: (pressed) => pressed
|
|
234
|
-
? onAlignmentChange('Center')
|
|
235
|
-
: onAlignmentChange('Default') }),
|
|
236
|
-
React.createElement(Toggle, { icon: "align-right", pressed: componentStyle.Alignment === 'Right', onPressedChange: (pressed) => pressed
|
|
237
|
-
? onAlignmentChange('Right')
|
|
238
|
-
: onAlignmentChange('Default') })))))),
|
|
287
|
+
React.createElement(Toggle, { icon: "align-left", pressed: componentStyle.Alignment === 'Left', onPressedChange: (pressed) => pressed ? onAlignmentChange('Left') : onAlignmentChange('Default') }),
|
|
288
|
+
React.createElement(Toggle, { icon: "align-center", pressed: componentStyle.Alignment === 'Center', onPressedChange: (pressed) => pressed ? onAlignmentChange('Center') : onAlignmentChange('Default') }),
|
|
289
|
+
React.createElement(Toggle, { icon: "align-right", pressed: componentStyle.Alignment === 'Right', onPressedChange: (pressed) => pressed ? onAlignmentChange('Right') : onAlignmentChange('Default') })))))),
|
|
239
290
|
!props.hidePreview && (React.createElement(Card, { shadow: false },
|
|
240
291
|
React.createElement(Card.Title, null, "Preview"),
|
|
241
292
|
React.createElement(Card.Body, { className: "twa:grid twa:place-items-center" },
|
|
@@ -28,6 +28,10 @@ export const GridFilterExpressionEditor = (props) => {
|
|
|
28
28
|
const onRunQuery = (expression) => {
|
|
29
29
|
api.filterApi.gridFilterApi.setGridFilterExpression(expression);
|
|
30
30
|
};
|
|
31
|
+
const onClearExpression = () => {
|
|
32
|
+
setExpression('');
|
|
33
|
+
api.filterApi.gridFilterApi.clearGridFilter();
|
|
34
|
+
};
|
|
31
35
|
const onAddNamedQuery = (namedQuery) => dispatch(NamedQueryRedux.NamedQueryAdd(namedQuery));
|
|
32
36
|
const handleSaveQuery = () => {
|
|
33
37
|
dispatch(PopupShowForm({
|
|
@@ -80,7 +84,7 @@ export const GridFilterExpressionEditor = (props) => {
|
|
|
80
84
|
}));
|
|
81
85
|
};
|
|
82
86
|
const expressionEditorProps = useGridFilterOptionsForExpressionEditorProps();
|
|
83
|
-
const actionsDisabled = !isExpressionValid || IsNullOrEmpty(expression) || hasNamedQueryError
|
|
87
|
+
const actionsDisabled = !isExpressionValid || IsNullOrEmpty(expression) || hasNamedQueryError;
|
|
84
88
|
return (React.createElement(NamedQueryContext.Provider, { value: {
|
|
85
89
|
namedQuery: namedQuery,
|
|
86
90
|
setNamedQuery: (newQuery) => {
|
|
@@ -95,6 +99,7 @@ export const GridFilterExpressionEditor = (props) => {
|
|
|
95
99
|
} }, "CLOSE")),
|
|
96
100
|
React.createElement(Box, { className: "twa:flex-1" }),
|
|
97
101
|
React.createElement(SimpleButton, { disabled: actionsDisabled, onClick: handleSaveQuery, icon: "save" }, "Save Query"),
|
|
102
|
+
React.createElement(SimpleButton, { "data-name": "action-clear", onClick: onClearExpression, icon: "close", disabled: IsNullOrEmpty(expression), className: "twa:ml-1" }, "Clear Query"),
|
|
98
103
|
React.createElement(SimpleButton, { variant: "raised", tone: "accent", "data-name": "action-run", className: "twa:m-1", icon: "play", onClick: () => {
|
|
99
104
|
if (namedQuery) {
|
|
100
105
|
onAddNamedQuery({
|
|
@@ -1,98 +1,61 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
2
3
|
import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
3
|
-
import DropdownButton from '../../components/DropdownButton';
|
|
4
4
|
import FieldWrap from '../../components/FieldWrap';
|
|
5
|
-
import Textarea from '../../components/Textarea';
|
|
6
|
-
import { Icon } from '../../components/icons';
|
|
7
5
|
import { ButtonClear } from '../Components/Buttons/ButtonClear';
|
|
8
6
|
import { ButtonExpand } from '../Components/Buttons/ButtonExpand';
|
|
9
7
|
import { ButtonInvalid } from '../Components/Buttons/ButtonInvalid';
|
|
10
8
|
import { ButtonPause } from '../Components/Buttons/ButtonPause';
|
|
11
|
-
import { ButtonPlay } from '../Components/Buttons/ButtonPlay';
|
|
12
9
|
import { ButtonSave } from '../Components/Buttons/ButtonSave';
|
|
13
10
|
import { ButtonUnsuspend } from '../Components/Buttons/ButtonUnsuspend';
|
|
14
11
|
import { NamedQuerySelector } from './NamedQuerySelector';
|
|
15
12
|
import { useGridFilterExpressionEditor } from './useGridFilterExpressionEditor';
|
|
16
13
|
import { Box, Flex } from '../../components/Flex';
|
|
14
|
+
import Tooltip from '../../components/Tooltip';
|
|
17
15
|
const QueryViewPanelComponent = (props) => {
|
|
18
|
-
const { cachedQueries, expression,
|
|
16
|
+
const { cachedQueries, expression, isExpressionNamedQuery, isExpressionValid, isSuspended, gridFilter, isAdaptableReady, namedQueries, runQuery, onExpand, clearQuery, namedQueryModuleAccessLevel, saveQuery, suspendGridFilter, unSuspendGridFilter, setGridFilterExpression, gridFilterAccessLevel, isReadOnly, } = useGridFilterExpressionEditor();
|
|
19
17
|
if (!isAdaptableReady) {
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
20
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
23
21
|
const disabled = isReadOnly || isSuspended || gridFilterAccessLevel === 'ReadOnly';
|
|
24
|
-
const handleEnter = (e) => {
|
|
25
|
-
if (e.key === 'Enter') {
|
|
26
|
-
e.preventDefault();
|
|
27
|
-
runQuery();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
22
|
const buttonExpand = (React.createElement(ButtonExpand, { disabled: disabled, accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", onClick: onExpand, tooltip: "Edit the Expression in UI", className: "twa:ml-1" }));
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
resize: 'none',
|
|
42
|
-
fontFamily: 'monospace',
|
|
43
|
-
fontSize: 12,
|
|
44
|
-
maxHeight: 52,
|
|
45
|
-
height: '100%',
|
|
46
|
-
paddingTop: 6,
|
|
47
|
-
overflow: 'hidden',
|
|
48
|
-
zIndex: 100,
|
|
49
|
-
}, placeholder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression })),
|
|
50
|
-
isExpressionValid && (React.createElement(ButtonPlay, { onClick: () => runQuery(), tooltip: '', accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || expression == '' || expression == gridFilter?.Expression, className: "twa:mr-1" })),
|
|
51
|
-
gridFilter && !isExpressionValid && (React.createElement(ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Grid Filter", className: "twa:mr-1" })),
|
|
52
|
-
' ',
|
|
53
|
-
StringExtensions.IsNotNullOrEmpty(expression) && (React.createElement(ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel })))) : (React.createElement(FieldWrap, { className: "twa:w-full twa:overflow-visible" },
|
|
54
|
-
' ',
|
|
23
|
+
const renderExpressionLabel = () => {
|
|
24
|
+
const baseClasses = 'twa:font-mono twa:text-xs twa:py-1.5 twa:px-2 twa:overflow-hidden twa:text-ellipsis twa:whitespace-nowrap twa:bg-white twa:rounded twa:cursor-pointer twa:h-7 twa:leading-4';
|
|
25
|
+
const placeholderClasses = 'twa:text-gray-400 twa:italic';
|
|
26
|
+
const labelClassName = clsx(baseClasses, {
|
|
27
|
+
[placeholderClasses]: !expression,
|
|
28
|
+
});
|
|
29
|
+
const expressionLabel = (React.createElement(Tooltip, { label: expression || 'Click to edit Grid Filter' },
|
|
30
|
+
React.createElement(Box, { className: clsx('twa:flex-1 twa:h-full twa:min-w-0', labelClassName), "data-name": "grid-filter-input", onClick: onExpand }, expression || 'Grid Filter')));
|
|
31
|
+
return (React.createElement(FieldWrap, { className: "twa:flex-1 twa:min-w-0 twa:overflow-visible" },
|
|
55
32
|
buttonExpand,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
left: 0,
|
|
59
|
-
top: 0,
|
|
60
|
-
right: 0,
|
|
61
|
-
border: 0,
|
|
62
|
-
position: 'absolute',
|
|
63
|
-
resize: 'none',
|
|
64
|
-
fontFamily: 'monospace',
|
|
65
|
-
fontSize: 12,
|
|
66
|
-
maxHeight: 60,
|
|
67
|
-
paddingTop: 7,
|
|
68
|
-
zIndex: 100,
|
|
69
|
-
height: '100%',
|
|
70
|
-
overflow: 'hidden',
|
|
71
|
-
}, placeholder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression }))));
|
|
33
|
+
expressionLabel,
|
|
34
|
+
gridFilter && !isExpressionValid && (React.createElement(ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Grid Filter" }))));
|
|
72
35
|
};
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
36
|
+
const hasExpression = StringExtensions.IsNotNullOrEmpty(expression);
|
|
37
|
+
const hasActiveGridFilter = gridFilter != null && hasExpression;
|
|
38
|
+
const hasNamedQueries = namedQueries && namedQueries.length > 0;
|
|
39
|
+
const clearButton = hasExpression ? (React.createElement(ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral" })) : null;
|
|
40
|
+
const saveButton = hasExpression ? (React.createElement(ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: isReadOnly || gridFilterAccessLevel === 'ReadOnly' || !isExpressionValid || isExpressionNamedQuery, variant: "text", tone: "neutral" })) : null;
|
|
41
|
+
const suspendButton = hasActiveGridFilter ? (React.createElement(ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral" })) : null;
|
|
42
|
+
const unSuspendButton = hasActiveGridFilter ? (React.createElement(ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: !isExpressionValid, variant: "text", tone: "neutral" })) : null;
|
|
43
|
+
const namedQuerySelector = hasNamedQueries ? (React.createElement(NamedQuerySelector, { namedQueries: namedQueries, cachedQueries: cachedQueries, currentQuery: gridFilter?.Expression, onSelect: (query) => runQuery(query), setGridFilterExpression: (query) => setGridFilterExpression(query) })) : null;
|
|
79
44
|
const renderButtons = () => {
|
|
80
|
-
return
|
|
81
|
-
|
|
45
|
+
return (React.createElement(React.Fragment, null,
|
|
46
|
+
clearButton,
|
|
82
47
|
isSuspended ? unSuspendButton : suspendButton,
|
|
83
|
-
columnsDropdown,
|
|
84
|
-
namedQuerySelector,
|
|
85
|
-
' ')) : (React.createElement(React.Fragment, null,
|
|
86
|
-
React.createElement(ButtonPlay, { "aria-label": 'Run Grid Filter', onClick: () => runQuery(), tooltip: "Run Grid Filter", accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || !isExpressionValid || expression == '' || expression == gridFilter, className: "twa:mr-1" }),
|
|
87
|
-
' ',
|
|
88
|
-
React.createElement(ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel, disabled: expression == '' }),
|
|
89
|
-
' ',
|
|
90
48
|
saveButton,
|
|
91
|
-
isSuspended ? unSuspendButton : suspendButton,
|
|
92
49
|
namedQuerySelector));
|
|
93
50
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
51
|
+
const isToolbar = props.viewType === 'Toolbar';
|
|
52
|
+
return (React.createElement(Flex, { flexDirection: isToolbar ? 'row' : 'column', className: clsx(`ab-${elementType}__Query__wrap`, {
|
|
53
|
+
'twa:w-[500px]': isToolbar,
|
|
54
|
+
}) },
|
|
55
|
+
React.createElement(Flex, { className: clsx({ 'twa:flex-1 twa:min-w-0': isToolbar }) }, renderExpressionLabel()),
|
|
56
|
+
React.createElement(Flex, { className: clsx('twa:flex-shrink-0', {
|
|
57
|
+
'twa:pl-1': isToolbar,
|
|
58
|
+
'twa:pt-1': !isToolbar,
|
|
59
|
+
}) }, renderButtons())));
|
|
97
60
|
};
|
|
98
61
|
export const GridFilterPanelControl = QueryViewPanelComponent;
|
|
@@ -30,10 +30,10 @@ export const PivotColumnsSection = (props) => {
|
|
|
30
30
|
React.createElement(Tabs.Tab, null, "Pivot Columns"),
|
|
31
31
|
React.createElement(Tabs.Content, null,
|
|
32
32
|
React.createElement(Box, { className: "twa:mb-3 twa:px-2" },
|
|
33
|
-
React.createElement(CheckBox, { checked: !!layout.
|
|
33
|
+
React.createElement(CheckBox, { checked: !!layout.PivotResultColumnsOrder, onChange: (checked) => {
|
|
34
34
|
props.onChange({
|
|
35
35
|
...layout,
|
|
36
|
-
|
|
36
|
+
PivotResultColumnsOrder: checked,
|
|
37
37
|
});
|
|
38
38
|
} }, "Persist Order of Pivot Result Columns")),
|
|
39
39
|
React.createElement(ValueSelector, { showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, options: sortedPivotColumns, value: layout.PivotColumns ?? [], allowReorder: true, onChange: handleColumnsChange }))));
|
|
@@ -49,8 +49,9 @@ export const ColorPicker = React.forwardRef((props, ref) => {
|
|
|
49
49
|
ABcolorChoices,
|
|
50
50
|
includeAlpha && (React.createElement(Flex, { alignItems: "center", className: "twa:gap-1" },
|
|
51
51
|
React.createElement(Box, null, "Opacity"),
|
|
52
|
-
React.createElement(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
React.createElement(Flex, { alignItems: "center", className: "twa:min-h-input" },
|
|
53
|
+
React.createElement(Input, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
|
|
54
|
+
const color = tinycolor(value).setAlpha(event.target.value).toRgbString();
|
|
55
|
+
debouncedOnChange(color);
|
|
56
|
+
}, min: 0, max: 1, step: 0.01, type: "range" }))))));
|
|
56
57
|
});
|
|
@@ -15,5 +15,5 @@ export const ExpressionFunctionDocumentation = (props) => {
|
|
|
15
15
|
React.createElement("pre", { className: signatureClassName }, example))))))),
|
|
16
16
|
props.expressionFunction.returnType && (React.createElement(Box, { "data-name": "expression-editor-documentation-examples" },
|
|
17
17
|
React.createElement("b", null, "Return Type"),
|
|
18
|
-
React.createElement(Tag, { className: "twa:bg-accentlight twa:text-accent twa:ml-3 twa:rounded-full" }, props.expressionFunction.returnType))))) : null;
|
|
18
|
+
React.createElement(Tag, { className: "twa:bg-accentlight twa:text-accent twa:ml-3 twa:rounded-full twa:py-1" }, props.expressionFunction.returnType))))) : null;
|
|
19
19
|
};
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "22.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1770330484844 || Date.now(),
|
|
4
|
+
VERSION: "22.0.0-canary.5" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -172,6 +172,6 @@ export interface PivotLayoutModel extends BaseLayoutModel {
|
|
|
172
172
|
* Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
|
|
173
173
|
*/
|
|
174
174
|
PivotColumnTotal?: 'before' | 'after' | boolean;
|
|
175
|
-
|
|
175
|
+
PivotResultColumnsOrder?: string[] | boolean;
|
|
176
176
|
}
|
|
177
177
|
export type LayoutModel = TableLayoutModel | PivotLayoutModel;
|
|
@@ -348,7 +348,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
348
348
|
const layout = this.getUndecidedLayoutModelFromGrid(columnState);
|
|
349
349
|
let ColumnSizing = layout.ColumnSizing || {};
|
|
350
350
|
let ColumnVisibility = { ...layout.ColumnVisibility };
|
|
351
|
-
const storePivotResultColumns = !!prevLayout?.
|
|
351
|
+
const storePivotResultColumns = !!prevLayout?.PivotResultColumnsOrder;
|
|
352
352
|
//let's also include the column widths of the pivotResult columns
|
|
353
353
|
pivotResultColumns.forEach((col) => {
|
|
354
354
|
const colId = col.getColId();
|
|
@@ -407,7 +407,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
407
407
|
const displayedPivotResultColumns = this.gridApi
|
|
408
408
|
.getAllDisplayedColumns()
|
|
409
409
|
.filter((col) => pivotResultColumnsSet.has(col.getColId()));
|
|
410
|
-
pivotLayout.
|
|
410
|
+
pivotLayout.PivotResultColumnsOrder = displayedPivotResultColumns.map((col) => col.getColId());
|
|
411
411
|
}
|
|
412
412
|
if (layout.SuppressAggFuncInHeader) {
|
|
413
413
|
pivotLayout.SuppressAggFuncInHeader = layout.SuppressAggFuncInHeader;
|
|
@@ -1279,8 +1279,8 @@ export class LayoutManager extends LMEmitter {
|
|
|
1279
1279
|
this.computePinnedColumns(layout, columnState);
|
|
1280
1280
|
this.computePivotAggregations(layout, columnState);
|
|
1281
1281
|
// Add pivot result columns to the state for ordering (will be applied with applyOrder: true later)
|
|
1282
|
-
if (Array.isArray(layout.
|
|
1283
|
-
layout.
|
|
1282
|
+
if (Array.isArray(layout.PivotResultColumnsOrder)) {
|
|
1283
|
+
layout.PivotResultColumnsOrder.forEach((colId) => {
|
|
1284
1284
|
columnState.state.push({ colId });
|
|
1285
1285
|
});
|
|
1286
1286
|
}
|
|
@@ -1525,7 +1525,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
1525
1525
|
// now recompute and apply the last one
|
|
1526
1526
|
this.computePivotAggregations(layout, columnState);
|
|
1527
1527
|
// Apply order only on the final call when PivotResultColumns is specified
|
|
1528
|
-
if (Array.isArray(layout.
|
|
1528
|
+
if (Array.isArray(layout.PivotResultColumnsOrder)) {
|
|
1529
1529
|
columnState.applyOrder = true;
|
|
1530
1530
|
}
|
|
1531
1531
|
this.gridApi.applyColumnState(columnState);
|
|
@@ -132,8 +132,8 @@ export function normalizePivotLayoutModel(layout) {
|
|
|
132
132
|
if (!layout.ColumnPinning) {
|
|
133
133
|
layout.ColumnPinning = {};
|
|
134
134
|
}
|
|
135
|
-
if (!layout.
|
|
136
|
-
layout.
|
|
135
|
+
if (!layout.PivotResultColumnsOrder) {
|
|
136
|
+
layout.PivotResultColumnsOrder = false;
|
|
137
137
|
}
|
|
138
138
|
if (!layout.ColumnSizing) {
|
|
139
139
|
layout.ColumnSizing = {};
|