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