@adaptabletools/adaptable 23.0.21 → 23.1.0-canary.0
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/package.json +3 -2
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/ColumnMenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/ContextMenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +34 -0
- package/src/Api/GridApi.d.ts +5 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +22 -1
- package/src/Redux/Store/AdaptableStore.js +6 -1
- package/src/Utilities/Helpers/DisplayFormatHelper.js +16 -4
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.d.ts +2 -0
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.js +13 -10
- package/src/Utilities/Hooks/useAdaptableOptions.d.ts +1 -1
- package/src/Utilities/Services/AnnotationsService.js +8 -8
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.d.ts +3 -0
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +16 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
- package/src/View/Components/PredicateEditor/PredicateEditor.js +11 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +6 -2
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +18 -8
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +2 -2
- package/src/View/Wizard/OnePageWizards.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +30 -6
- package/src/agGrid/AdaptableAgGrid.js +60 -78
- package/src/agGrid/AgGridAdapter.d.ts +32 -1
- package/src/agGrid/AgGridAdapter.js +88 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +44 -0
- package/src/agGrid/AgGridColumnAdapter.js +153 -37
- package/src/agGrid/AgGridMenuAdapter.d.ts +8 -2
- package/src/agGrid/AgGridMenuAdapter.js +17 -4
- package/src/agGrid/AgGridModulesAdapter.js +6 -1
- package/src/agGrid/AgGridThemeAdapter.d.ts +17 -0
- package/src/agGrid/AgGridThemeAdapter.js +37 -6
- package/src/components/Combobox/index.d.ts +11 -0
- package/src/components/Combobox/index.js +5 -3
- package/src/components/Radio/index.d.ts +2 -2
- package/src/components/Tree/TreeDropdown/index.d.ts +11 -0
- package/src/components/Tree/TreeDropdown/index.js +6 -3
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.d.ts +9 -0
- package/src/layout-manager/src/index.js +38 -17
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.1.0-canary.0",
|
|
4
4
|
"description": "Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -68,7 +68,8 @@
|
|
|
68
68
|
"uuid": "9.0.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"ag-grid-enterprise": ">=
|
|
71
|
+
"ag-grid-enterprise": ">=36.1.0",
|
|
72
|
+
"ag-stack": ">=36.1.0"
|
|
72
73
|
},
|
|
73
74
|
"publishTimestamp": 0,
|
|
74
75
|
"type": "module",
|
|
@@ -281,6 +281,7 @@ export interface IAdaptable {
|
|
|
281
281
|
getAdaptableContainerElement(): HTMLElement | null;
|
|
282
282
|
getAgGridContainerElement(): HTMLElement | null;
|
|
283
283
|
updateColumnModelAndRefreshGrid(): void;
|
|
284
|
+
refreshSortIfColumnsSorted(): void;
|
|
284
285
|
getAgGridColumnForColumnId(columnId: string): Column;
|
|
285
286
|
getMinMaxCachedValueForColumn(column: AdaptableColumn, aggregation: 'min' | 'max' | 'avg' | 'median'): number | undefined;
|
|
286
287
|
destroy(config?: DestroyConfig): void;
|
|
@@ -125,4 +125,4 @@ export interface UserColumnMenuItem {
|
|
|
125
125
|
/**
|
|
126
126
|
* Defines AG Grid Column Menu Items
|
|
127
127
|
*/
|
|
128
|
-
export type AgGridColumnMenuItemType = 'sortAscending' | 'sortDescending' | 'sortUnSort' | 'columnFilter' | 'columnChooser' | 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'separator';
|
|
128
|
+
export type AgGridColumnMenuItemType = 'sortAscending' | 'sortDescending' | 'sortUnSort' | 'columnFilter' | 'columnChooser' | 'pinSubMenu' | 'valueAggSubMenu' | 'showValuesAsSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'calculatedColumn' | 'editCalculatedColumn' | 'removeCalculatedColumn' | 'editColumnName' | 'separator';
|
|
@@ -120,7 +120,7 @@ export interface UserContextMenuItem {
|
|
|
120
120
|
/**
|
|
121
121
|
* Defines AG Grid Context Menu Items
|
|
122
122
|
*/
|
|
123
|
-
export type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractAll' | 'copy' | 'copyWithHeaders' | 'copyWithGroupHeaders' | 'cut' | 'paste' | 'resetColumns' | 'export' | 'csvExport' | 'excelExport' | 'chartRange' | 'pivotChart' | 'separator';
|
|
123
|
+
export type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractAll' | 'copy' | 'copyWithHeaders' | 'copyWithGroupHeaders' | 'cut' | 'paste' | 'resetColumns' | 'export' | 'csvExport' | 'excelExport' | 'chartRange' | 'pivotChart' | 'calculatedColumn' | 'editCalculatedColumn' | 'removeCalculatedColumn' | 'editColumnName' | 'showValuesAsSubMenu' | 'separator';
|
|
124
124
|
/**
|
|
125
125
|
* The Context Menu provided by AadapTable by default
|
|
126
126
|
*/
|
|
@@ -206,6 +206,40 @@ export interface InFilterValueResult {
|
|
|
206
206
|
* Search changes reset the list and set `offset` back to 0.
|
|
207
207
|
*/
|
|
208
208
|
hasMore?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Custom text for the collapsed IN Filter input.
|
|
211
|
+
*
|
|
212
|
+
* Receives an {@link InFilterLabelContext} and must return a string.
|
|
213
|
+
*
|
|
214
|
+
* When omitted, the input shows the selected count (e.g. `(3)`) followed by the
|
|
215
|
+
* selected labels joined with a comma. When provided, it fully replaces that
|
|
216
|
+
* text (including the count - render one yourself if you want it).
|
|
217
|
+
*
|
|
218
|
+
* For tree-shaped filters (group columns and date columns), each selected leaf
|
|
219
|
+
* is one entry in `selectedValues`: its `value` is the full leaf path and its
|
|
220
|
+
* `label` the joined path label. `selectedCount` is the number of selected leaves.
|
|
221
|
+
*/
|
|
222
|
+
inFilterLabel?: (context: InFilterLabelContext) => string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Context passed to {@link InFilterValueResult.inFilterLabel} when customising
|
|
226
|
+
* the collapsed IN Filter label.
|
|
227
|
+
*/
|
|
228
|
+
export interface InFilterLabelContext extends BaseContext {
|
|
229
|
+
/**
|
|
230
|
+
* Currently selected items, in selection order.
|
|
231
|
+
*
|
|
232
|
+
* For tree-shaped filters (group columns and date columns), each selected leaf
|
|
233
|
+
* is one entry: its `value` is the full leaf path and its `label` the joined
|
|
234
|
+
* path label.
|
|
235
|
+
*/
|
|
236
|
+
selectedValues: InFilterValue[];
|
|
237
|
+
/**
|
|
238
|
+
* Number of selected items.
|
|
239
|
+
*
|
|
240
|
+
* For tree-shaped filters, this is the number of selected leaves (not parent nodes).
|
|
241
|
+
*/
|
|
242
|
+
selectedCount: number;
|
|
209
243
|
}
|
|
210
244
|
/**
|
|
211
245
|
* Information about items in the IN Column Filter
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -35,9 +35,13 @@ export interface GridApi {
|
|
|
35
35
|
*/
|
|
36
36
|
getFilteredData(): any[];
|
|
37
37
|
/**
|
|
38
|
-
* Retrieves visible data from the grid (filtered and sorted)
|
|
38
|
+
* Retrieves visible data from the grid (filtered and sorted from visible columns only)
|
|
39
39
|
*/
|
|
40
40
|
getVisibleData(): any[];
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the displayed (formatted but not styled) data from the grid (filtered and sorted and visible columns only)
|
|
43
|
+
*/
|
|
44
|
+
getDisplayedData(): any[];
|
|
41
45
|
/**
|
|
42
46
|
* Retrieves all the values for a single Column.
|
|
43
47
|
*
|
|
@@ -27,6 +27,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
27
27
|
getGridData(): any[];
|
|
28
28
|
getFilteredData(): any[];
|
|
29
29
|
getVisibleData(): any[];
|
|
30
|
+
getDisplayedData(): any[];
|
|
30
31
|
getColumnData(columnId: string): any[];
|
|
31
32
|
getFilteredColumnData(columnId: string): any[];
|
|
32
33
|
getVisibleColumnData(columnId: string): any[];
|
|
@@ -36,9 +36,30 @@ export class GridApiImpl extends ApiBase {
|
|
|
36
36
|
}
|
|
37
37
|
getVisibleData() {
|
|
38
38
|
const data = [];
|
|
39
|
+
const visibleColumns = this.getColumnApi().getVisibleColumns();
|
|
39
40
|
this.getAdaptableInternalApi().forAllVisibleRowNodesDo((rowNode) => {
|
|
40
41
|
if (!this.isGroupRowNode(rowNode)) {
|
|
41
|
-
|
|
42
|
+
const visibleRow = {};
|
|
43
|
+
visibleColumns.forEach((column) => {
|
|
44
|
+
const key = column.field ?? column.columnId;
|
|
45
|
+
visibleRow[key] = this.getRawValueFromRowNode(rowNode, column.columnId);
|
|
46
|
+
});
|
|
47
|
+
data.push(visibleRow);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
getDisplayedData() {
|
|
53
|
+
const data = [];
|
|
54
|
+
const visibleColumns = this.getColumnApi().getVisibleColumns();
|
|
55
|
+
this.getAdaptableInternalApi().forAllVisibleRowNodesDo((rowNode) => {
|
|
56
|
+
if (!this.isGroupRowNode(rowNode)) {
|
|
57
|
+
const displayedRow = {};
|
|
58
|
+
visibleColumns.forEach((column) => {
|
|
59
|
+
const key = column.field ?? column.columnId;
|
|
60
|
+
displayedRow[key] = this.getDisplayValueFromRowNode(rowNode, column.columnId);
|
|
61
|
+
});
|
|
62
|
+
data.push(displayedRow);
|
|
42
63
|
}
|
|
43
64
|
});
|
|
44
65
|
return data;
|
|
@@ -562,7 +562,11 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
562
562
|
case StyledColumnRedux.STYLED_COLUMN_SUSPEND:
|
|
563
563
|
case StyledColumnRedux.STYLED_COLUMN_UNSUSPEND:
|
|
564
564
|
case StyledColumnRedux.STYLED_COLUMN_SUSPEND_ALL:
|
|
565
|
-
case StyledColumnRedux.STYLED_COLUMN_UNSUSPEND_ALL:
|
|
565
|
+
case StyledColumnRedux.STYLED_COLUMN_UNSUSPEND_ALL: {
|
|
566
|
+
const returnAction = next(action);
|
|
567
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
568
|
+
return returnAction;
|
|
569
|
+
}
|
|
566
570
|
case CustomSortRedux.CUSTOM_SORT_ADD:
|
|
567
571
|
case CustomSortRedux.CUSTOM_SORT_EDIT:
|
|
568
572
|
case CustomSortRedux.CUSTOM_SORT_DELETE:
|
|
@@ -572,6 +576,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
572
576
|
case CustomSortRedux.CUSTOM_SORT_UNSUSPEND_ALL: {
|
|
573
577
|
const returnAction = next(action);
|
|
574
578
|
adaptable.updateColumnModelAndRefreshGrid();
|
|
579
|
+
adaptable.refreshSortIfColumnsSorted();
|
|
575
580
|
return returnAction;
|
|
576
581
|
}
|
|
577
582
|
case QuickSearchRedux.QUICK_SEARCH_RUN: {
|
|
@@ -14,9 +14,21 @@ const getFractionDigitsAfterMultiplier = (input, multiplier, explicitFractionDig
|
|
|
14
14
|
if (multiplier === 1) {
|
|
15
15
|
return getInputFractionDigitCount(input);
|
|
16
16
|
}
|
|
17
|
+
if (!Number.isFinite(multiplier) || multiplier === 0) {
|
|
18
|
+
return getInputFractionDigitCount(input);
|
|
19
|
+
}
|
|
17
20
|
const multiplierPower = Math.round(Math.log10(Math.abs(multiplier)));
|
|
21
|
+
if (!Number.isFinite(multiplierPower)) {
|
|
22
|
+
return getInputFractionDigitCount(input);
|
|
23
|
+
}
|
|
18
24
|
return Math.max(0, getInputFractionDigitCount(input) - multiplierPower);
|
|
19
25
|
};
|
|
26
|
+
const normalizeMultiplier = (multiplier) => {
|
|
27
|
+
if (multiplier == null || !Number.isFinite(multiplier) || multiplier === 0) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
return multiplier;
|
|
31
|
+
};
|
|
20
32
|
export function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
21
33
|
let preparedInput;
|
|
22
34
|
if (options.Content) {
|
|
@@ -41,11 +53,11 @@ export function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
|
41
53
|
if (isNaN(n)) {
|
|
42
54
|
return preparedInput.toString();
|
|
43
55
|
}
|
|
44
|
-
|
|
56
|
+
const effectiveMultiplier = normalizeMultiplier(options.Multiplier);
|
|
45
57
|
let multiplierFractionDigits;
|
|
46
|
-
if (
|
|
47
|
-
n *=
|
|
48
|
-
multiplierFractionDigits = getFractionDigitsAfterMultiplier(preparedInput,
|
|
58
|
+
if (effectiveMultiplier !== undefined) {
|
|
59
|
+
n *= effectiveMultiplier;
|
|
60
|
+
multiplierFractionDigits = getFractionDigitsAfterMultiplier(preparedInput, effectiveMultiplier, options.FractionDigits);
|
|
49
61
|
n = parseFloat(n.toFixed(multiplierFractionDigits));
|
|
50
62
|
}
|
|
51
63
|
if (options.IntegerDigits > 20) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { AgSparklineOptions } from 'ag-charts-types';
|
|
2
|
+
/** AG Charts 14 colours may be a CSS string or a theme colour-ref object. */
|
|
3
|
+
export declare const cssColorToString: (color: unknown) => string | undefined;
|
|
2
4
|
/**
|
|
3
5
|
* AG Charts sparklines do not resolve Adaptable `var(--ab-color-*)` tokens.
|
|
4
6
|
* Resolve palette / theme CSS variables to concrete colours at render time so
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { getVariableColor } from '../StyleHelper';
|
|
2
|
+
export const cssColorToString = (color) => {
|
|
3
|
+
return typeof color === 'string' ? color : undefined;
|
|
4
|
+
};
|
|
2
5
|
const resolveCssColor = (color) => {
|
|
3
|
-
if (color
|
|
4
|
-
return color;
|
|
6
|
+
if (typeof color !== 'string' || color === '') {
|
|
7
|
+
return typeof color === 'string' ? color : undefined;
|
|
5
8
|
}
|
|
6
9
|
const resolved = getVariableColor(color);
|
|
7
10
|
return resolved || color;
|
|
@@ -11,23 +14,23 @@ const resolveHighlightStyle = (style) => {
|
|
|
11
14
|
return style;
|
|
12
15
|
}
|
|
13
16
|
const resolved = { ...style };
|
|
14
|
-
if (style.fill
|
|
17
|
+
if (typeof style.fill === 'string') {
|
|
15
18
|
resolved.fill = resolveCssColor(style.fill);
|
|
16
19
|
}
|
|
17
|
-
if (style.stroke
|
|
20
|
+
if (typeof style.stroke === 'string') {
|
|
18
21
|
resolved.stroke = resolveCssColor(style.stroke);
|
|
19
22
|
}
|
|
20
23
|
return resolved;
|
|
21
24
|
};
|
|
22
25
|
export function resolveSparklineOptionsForRender(options) {
|
|
23
26
|
const resolved = { ...options };
|
|
24
|
-
if ('fill' in options && options.fill
|
|
27
|
+
if ('fill' in options && typeof options.fill === 'string') {
|
|
25
28
|
resolved.fill = resolveCssColor(options.fill);
|
|
26
29
|
}
|
|
27
|
-
if (options.stroke
|
|
30
|
+
if (typeof options.stroke === 'string') {
|
|
28
31
|
resolved.stroke = resolveCssColor(options.stroke);
|
|
29
32
|
}
|
|
30
|
-
if (options.background?.fill
|
|
33
|
+
if (typeof options.background?.fill === 'string') {
|
|
31
34
|
resolved.background = {
|
|
32
35
|
...options.background,
|
|
33
36
|
fill: resolveCssColor(options.background.fill),
|
|
@@ -35,10 +38,10 @@ export function resolveSparklineOptionsForRender(options) {
|
|
|
35
38
|
}
|
|
36
39
|
if ('marker' in options && options.marker) {
|
|
37
40
|
const marker = { ...options.marker };
|
|
38
|
-
if (marker.fill
|
|
41
|
+
if (typeof marker.fill === 'string') {
|
|
39
42
|
marker.fill = resolveCssColor(marker.fill);
|
|
40
43
|
}
|
|
41
|
-
if (marker.stroke
|
|
44
|
+
if (typeof marker.stroke === 'string') {
|
|
42
45
|
marker.stroke = resolveCssColor(marker.stroke);
|
|
43
46
|
}
|
|
44
47
|
resolved.marker = marker;
|
|
@@ -50,7 +53,7 @@ export function resolveSparklineOptionsForRender(options) {
|
|
|
50
53
|
highlightedSeries: resolveHighlightStyle(options.highlight.highlightedSeries),
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
|
-
if (options.axis && typeof options.axis === 'object' && options.axis.stroke
|
|
56
|
+
if (options.axis && typeof options.axis === 'object' && typeof options.axis.stroke === 'string') {
|
|
54
57
|
resolved.axis = {
|
|
55
58
|
...options.axis,
|
|
56
59
|
stroke: resolveCssColor(options.axis.stroke),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AdaptableOptions } from '../../types';
|
|
2
|
-
export declare const useAdaptableOptions: <T = AdaptableOptions
|
|
2
|
+
export declare const useAdaptableOptions: <T = AdaptableOptions>(fn?: (adaptableOptions: AdaptableOptions) => T) => T;
|
|
@@ -61,16 +61,16 @@ export class AnnotationsService {
|
|
|
61
61
|
if (!target?.classList?.contains?.('ag-cell')) {
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ColumnId: target.getAttribute('col-id'),
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
64
|
+
const rowElement = target.closest('[row-id]');
|
|
65
|
+
const PrimaryKeyValue = rowElement?.getAttribute('row-id');
|
|
66
|
+
const ColumnId = target.getAttribute('col-id');
|
|
67
|
+
if (PrimaryKeyValue == null || ColumnId == null) {
|
|
72
68
|
return null;
|
|
73
69
|
}
|
|
70
|
+
return {
|
|
71
|
+
PrimaryKeyValue,
|
|
72
|
+
ColumnId,
|
|
73
|
+
};
|
|
74
74
|
}
|
|
75
75
|
handleMouseEnter(event) {
|
|
76
76
|
const editMode = this.getEditMode();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ColumnValuesSelectProps } from '../../FilterForm/ListBoxFilterForm';
|
|
3
|
+
import { InFilterLabelContext } from '../../../../types';
|
|
3
4
|
/** Suggested page size passed to `customInFilterValues` as `context.limit`. */
|
|
4
5
|
export declare const IN_FILTER_VALUES_PAGE_SIZE = 1000;
|
|
5
6
|
export interface FloatingFilterValuesProps {
|
|
@@ -31,6 +32,7 @@ export declare function useDistinctFilterColumnValues(options: {
|
|
|
31
32
|
skipDefaultSearch: boolean;
|
|
32
33
|
searchValueUsedInFilterValue: boolean;
|
|
33
34
|
hasMore: boolean;
|
|
35
|
+
inFilterLabel?: (context: InFilterLabelContext) => string;
|
|
34
36
|
};
|
|
35
37
|
setQuickFilterValues: React.Dispatch<React.SetStateAction<{
|
|
36
38
|
values: {
|
|
@@ -41,6 +43,7 @@ export declare function useDistinctFilterColumnValues(options: {
|
|
|
41
43
|
skipDefaultSearch: boolean;
|
|
42
44
|
searchValueUsedInFilterValue: boolean;
|
|
43
45
|
hasMore: boolean;
|
|
46
|
+
inFilterLabel?: (context: InFilterLabelContext) => string;
|
|
44
47
|
}>>;
|
|
45
48
|
triggerValuesLoad: (options?: {
|
|
46
49
|
usePrevious: boolean;
|
|
@@ -118,6 +118,7 @@ export function useDistinctFilterColumnValues(options) {
|
|
|
118
118
|
skipDefaultSearch: !!result.skipDefaultSearch,
|
|
119
119
|
searchValueUsedInFilterValue: prev.searchValueUsedInFilterValue || searchValueUsedInFilterValue,
|
|
120
120
|
hasMore: !!result.hasMore,
|
|
121
|
+
inFilterLabel: result.inFilterLabel,
|
|
121
122
|
dataLoadIsComplete: true,
|
|
122
123
|
}));
|
|
123
124
|
})
|
|
@@ -171,6 +172,7 @@ export function useDistinctFilterColumnValues(options) {
|
|
|
171
172
|
skipDefaultSearch: !!distinctFilterDisplayValues.skipDefaultSearch,
|
|
172
173
|
searchValueUsedInFilterValue,
|
|
173
174
|
hasMore: !!distinctFilterDisplayValues.hasMore,
|
|
175
|
+
inFilterLabel: distinctFilterDisplayValues.inFilterLabel,
|
|
174
176
|
});
|
|
175
177
|
lastRequestedOffsetRef.current = 0;
|
|
176
178
|
setIsDistinctColumnValuesLoading(false);
|
|
@@ -335,7 +337,14 @@ export const FloatingFilterValues = (props) => {
|
|
|
335
337
|
triggerValuesLoad();
|
|
336
338
|
}
|
|
337
339
|
}, []);
|
|
338
|
-
const { skipDefaultSearch } = quickFilterValues;
|
|
340
|
+
const { skipDefaultSearch, inFilterLabel } = quickFilterValues;
|
|
341
|
+
const renderComboboxInputValues = React.useMemo(() => inFilterLabel
|
|
342
|
+
? (items) => inFilterLabel({
|
|
343
|
+
...api.internalApi.buildBaseContext(),
|
|
344
|
+
selectedValues: items,
|
|
345
|
+
selectedCount: items.length,
|
|
346
|
+
})
|
|
347
|
+
: undefined, [api, inFilterLabel]);
|
|
339
348
|
if (props.columnId === AG_GRID_GROUPED_COLUMN) {
|
|
340
349
|
if (Array.isArray(props.value) && !props.value.every((value) => Array.isArray(value))) {
|
|
341
350
|
logOnce(`All the inputs for the IN predicate for the column "${props.columnId}" need to be arrays. Example:
|
|
@@ -358,11 +367,17 @@ export const FloatingFilterValues = (props) => {
|
|
|
358
367
|
...props.selectProps,
|
|
359
368
|
'data-name': 'Select Values',
|
|
360
369
|
showSelectedCount: true,
|
|
370
|
+
...(renderComboboxInputValues
|
|
371
|
+
? { renderInputValues: renderComboboxInputValues }
|
|
372
|
+
: {}),
|
|
361
373
|
filter: skipDefaultSearch ? null : undefined,
|
|
362
374
|
onInputValueChange: onInputChange,
|
|
363
375
|
}
|
|
364
376
|
: {
|
|
365
377
|
...props.selectProps,
|
|
378
|
+
...(renderComboboxInputValues
|
|
379
|
+
? { renderInputValues: renderComboboxInputValues }
|
|
380
|
+
: {}),
|
|
366
381
|
filter: skipDefaultSearch ? null : undefined,
|
|
367
382
|
onInputValueChange: onInputChange,
|
|
368
383
|
}, disabled: props.disabled, onMenuOpen: onMenuOpen, isLoading: isDistinctColumnValuesLoading, column: currentColumn, dataType: currentColumn.dataType, options: quickFilterValues.values, value: props.value, onChange: props.onChange }));
|
|
@@ -117,7 +117,7 @@ export const ColumnValuesSelect = (props) => {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
: undefined;
|
|
120
|
-
const component = column.dataType === 'date' || column.columnId === AG_GRID_GROUPED_COLUMN ? (_jsx(GridFilterTreeDropdown, { toDisplayValue: treeDropdownToDisplayValue, resizable: true, onValueChange: column.dataType === 'date'
|
|
120
|
+
const component = column.dataType === 'date' || column.columnId === AG_GRID_GROUPED_COLUMN ? (_jsx(GridFilterTreeDropdown, { toDisplayValue: treeDropdownToDisplayValue, renderInputValues: selectProps.renderInputValues, resizable: true, onValueChange: column.dataType === 'date'
|
|
121
121
|
? (value) => props.onChange(dateOnChangeParser(value))
|
|
122
122
|
: props.onChange, items: options, value: selectedColumnValues, "data-name": "Select Values", primaryKey: 'value', isLoading: props.isLoading, onOpenChange: onOpenChange, showClear: isEmbeddedColumnFilterLocation(location) })) : (_jsx(GridFilterCombobox, { disabled: props.disabled, ...selectProps, onOpenChange: onOpenChange, items: options, value: value, lookupItems: lookupItems, isLoading: props.isLoading, onValueChange: props.onChange, showClear: isEmbeddedColumnFilterLocation(location) }, "select"));
|
|
123
123
|
return (_jsx("div", { className: join(baseClassName, 'twa:relative', props.isLoading && `${baseClassName}--loading`, !value.length && `${baseClassName}--empty`), onKeyDownCapture: (e) => {
|
|
@@ -64,7 +64,14 @@ export const PredicateEditor = (props) => {
|
|
|
64
64
|
triggerValuesLoad();
|
|
65
65
|
}
|
|
66
66
|
}, []);
|
|
67
|
-
const { skipDefaultSearch } = quickFilterValues;
|
|
67
|
+
const { skipDefaultSearch, inFilterLabel } = quickFilterValues;
|
|
68
|
+
const renderComboboxInputValues = React.useMemo(() => inFilterLabel
|
|
69
|
+
? (items) => inFilterLabel({
|
|
70
|
+
...adaptable.api.internalApi.buildBaseContext(),
|
|
71
|
+
selectedValues: items,
|
|
72
|
+
selectedCount: items.length,
|
|
73
|
+
})
|
|
74
|
+
: undefined, [adaptable.api, inFilterLabel]);
|
|
68
75
|
return (_jsxs(Box, { className: baseClassName, children: [_jsxs(Flex, { alignItems: "center", className: "twa:justify-stretch", children: [icon && _jsx(Tag, { className: "twa:mr-2", children: icon }), _jsx(SingleSelect, { items: predicateDefsOptions, "data-name": "select-predicate", placeholder: "Select Rule", value: props.predicate?.PredicateId ?? null, onValueChange: (value) => {
|
|
69
76
|
const option = predicateDefsOptions.find((x) => x.value === value);
|
|
70
77
|
props.onChange({
|
|
@@ -75,5 +82,8 @@ export const PredicateEditor = (props) => {
|
|
|
75
82
|
} })] }), _jsx(Flex, { children: currentPredicateDef?.inputs?.map((predicateDefInput, index) => (_jsxs(_Fragment, { children: [index > 0 && _jsx(HelpBlock, { className: "twa:m-2", children: "AND" }), _jsx(Flex, { className: "twa:flex-1", flexDirection: "column", children: _jsx(AdaptableInput, { "data-name": `predicate-input-${index}`, className: "twa:mt-2", type: predicateDefInput.type, autoFocus: index === 0, value: props.predicate.Inputs?.[index] ?? '', onChange: (e) => handlePredicateInputChange(e, index) }) }, index)] }))) }), adaptable.api.predicateApi.internalApi.IsInOrNotInPredicateDef(currentPredicateDef) && (_jsx(Box, { className: "twa:mt-2", children: _jsx(ColumnValuesSelect, { isLoading: isDistinctColumnValuesLoading, column: column, options: quickFilterValues.values, onMenuOpen: onMenuOpen, selectProps: {
|
|
76
83
|
onInputValueChange: onInputChange,
|
|
77
84
|
filter: skipDefaultSearch ? null : undefined,
|
|
85
|
+
...(renderComboboxInputValues
|
|
86
|
+
? { renderInputValues: renderComboboxInputValues }
|
|
87
|
+
: {}),
|
|
78
88
|
}, dataType: column.dataType, value: props.predicate.Inputs, onChange: handlePredicateValuesChange }) }))] }));
|
|
79
89
|
};
|
|
@@ -71,7 +71,7 @@ const appendNumberFormatOptions = (items, options) => {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
appendDisplayFormatItem(items, 'Content', options.Content);
|
|
74
|
-
if (options.Multiplier != null && options.Multiplier !== 1) {
|
|
74
|
+
if (options.Multiplier != null && options.Multiplier !== 0 && options.Multiplier !== 1) {
|
|
75
75
|
items.push({ label: 'Multiplier', value: String(options.Multiplier) });
|
|
76
76
|
}
|
|
77
77
|
appendDisplayFormatItem(items, 'Parentheses', options.Parentheses);
|
|
@@ -342,7 +342,11 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
342
342
|
? clamp(Number(e.currentTarget.value), 0, 20)
|
|
343
343
|
: undefined) }) }), _jsx(FormRow, { label: "Integer Digits", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "integer-digits", type: "number", min: "0", value: resolved.Options.IntegerDigits, onChange: (e) => setFormatOption('IntegerDigits', StringExtensions.IsNumeric(e.currentTarget.value)
|
|
344
344
|
? clamp(Number(e.currentTarget.value), 0, 20)
|
|
345
|
-
: undefined) }) }), _jsx(FormRow, { label: "Fraction Separator", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "fraction-separator", value: resolved.Options.FractionSeparator ?? '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Integer Separator", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "integer-separator", value: resolved.Options.IntegerSeparator ?? '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) }) })] }), _jsxs(FormLayout, { sizes: NUMBER_FORMAT_VALUE_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, NUMBER_FORMAT_VALUE_CHILDREN_COLUMN], className: "twa:mr-5 twa:shrink-0", children: [_jsx(FormRow, { label: "Multiplier", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "multiplier", type: "number", value: resolved.Options.Multiplier
|
|
345
|
+
: undefined) }) }), _jsx(FormRow, { label: "Fraction Separator", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "fraction-separator", value: resolved.Options.FractionSeparator ?? '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Integer Separator", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "integer-separator", value: resolved.Options.IntegerSeparator ?? '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) }) })] }), _jsxs(FormLayout, { sizes: NUMBER_FORMAT_VALUE_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, NUMBER_FORMAT_VALUE_CHILDREN_COLUMN], className: "twa:mr-5 twa:shrink-0", children: [_jsx(FormRow, { label: "Multiplier", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "multiplier", type: "number", value: typeof resolved.Options.Multiplier === 'number'
|
|
346
|
+
? resolved.Options.Multiplier
|
|
347
|
+
: '', onChange: (e) => setFormatOption('Multiplier', StringExtensions.IsNumeric(e.currentTarget.value)
|
|
348
|
+
? Number(e.currentTarget.value)
|
|
349
|
+
: undefined) }) }), _jsx(FormRow, { label: "Prefix", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "prefix", value: resolved.Options.Prefix ?? '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Suffix", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "suffix", value: resolved.Options.Suffix ?? '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Zero Display", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "zero-display", value: resolved.Options.ZeroDisplay === undefined ||
|
|
346
350
|
resolved.Options.ZeroDisplay === '0'
|
|
347
351
|
? '0'
|
|
348
352
|
: resolved.Options.ZeroDisplay, onChange: (e) => {
|
|
@@ -10,6 +10,7 @@ import { ColorPicker } from '../../../components/ColorPicker';
|
|
|
10
10
|
import { CheckBox } from '../../../components/CheckBox';
|
|
11
11
|
import { Box, Flex } from '../../../components/Flex';
|
|
12
12
|
import { getCellBoxStyleSummaryItems, StyledColumnCellStyleEditor, } from './StyledColumnSliceStyleEditors';
|
|
13
|
+
import { cssColorToString } from '../../../Utilities/Helpers/StyledColumns/SparklineStyleHelper';
|
|
13
14
|
import { Card } from '../../../components/Card';
|
|
14
15
|
import ErrorBox from '../../../components/ErrorBox';
|
|
15
16
|
const STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
@@ -193,9 +194,18 @@ const SparklineThemingOptions = ({ options, onChange, }) => {
|
|
|
193
194
|
delete next.theme;
|
|
194
195
|
onChange(next);
|
|
195
196
|
};
|
|
197
|
+
const getPaddingOptions = () => {
|
|
198
|
+
const padding = sparklineOptions.padding;
|
|
199
|
+
if (padding == null) {
|
|
200
|
+
return {};
|
|
201
|
+
}
|
|
202
|
+
if (typeof padding === 'number') {
|
|
203
|
+
return { top: padding, right: padding, bottom: padding, left: padding };
|
|
204
|
+
}
|
|
205
|
+
return padding;
|
|
206
|
+
};
|
|
196
207
|
const handlePaddingChange = (key, value) => {
|
|
197
|
-
|
|
198
|
-
handleChange('padding', { ...currentPadding, [key]: value });
|
|
208
|
+
handleChange('padding', { ...getPaddingOptions(), [key]: value });
|
|
199
209
|
};
|
|
200
210
|
const themes = [
|
|
201
211
|
{ value: SPARKLINE_CUSTOM_COLOURS_THEME, label: 'Custom colours' },
|
|
@@ -212,9 +222,9 @@ const SparklineThemingOptions = ({ options, onChange, }) => {
|
|
|
212
222
|
{ value: 'ag-financial', label: 'Financial' },
|
|
213
223
|
{ value: 'ag-financial-dark', label: 'Financial Dark' },
|
|
214
224
|
];
|
|
215
|
-
return (_jsxs(FormLayout, { children: [sparklineOptions.type !== 'line' && (_jsx(FormRow, { label: "Fill", children: _jsxs(Box, { children: [_jsx(ColorPicker, { title: "The colour for filling shapes", api: api, value: sparklineOptions.fill, onChange: (color) => applySeriesColour({ fill: color }) }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: "Bar, column, and area body colour." })] }) })), _jsx(FormRow, { label: "Stroke", children: _jsxs(Box, { children: [_jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the stroke", api: api, value: sparklineOptions.stroke, onChange: (color) => applySeriesColour({ stroke: color }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { title: "The width of the stroke in pixels", type: "number", className: "twa:w-[70px]", min: 0, value: sparklineOptions.strokeWidth ?? '', onChange: (e) => handleChange('strokeWidth', Number(e.target.value)) })] }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: sparklineOptions.type === 'line'
|
|
225
|
+
return (_jsxs(FormLayout, { children: [sparklineOptions.type !== 'line' && (_jsx(FormRow, { label: "Fill", children: _jsxs(Box, { children: [_jsx(ColorPicker, { title: "The colour for filling shapes", api: api, value: cssColorToString(sparklineOptions.fill) ?? '', onChange: (color) => applySeriesColour({ fill: color }) }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: "Bar, column, and area body colour." })] }) })), _jsx(FormRow, { label: "Stroke", children: _jsxs(Box, { children: [_jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the stroke", api: api, value: cssColorToString(sparklineOptions.stroke) ?? '', onChange: (color) => applySeriesColour({ stroke: color }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { title: "The width of the stroke in pixels", type: "number", className: "twa:w-[70px]", min: 0, value: sparklineOptions.strokeWidth ?? '', onChange: (e) => handleChange('strokeWidth', Number(e.target.value)) })] }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: sparklineOptions.type === 'line'
|
|
216
226
|
? 'Line colour. Marker colours are in the Markers card.'
|
|
217
|
-
: 'Outline colour — increase width to see it on bars and columns.' })] }) }), _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Top" }), _jsx(AdaptableInput, { type: "number", min: 0, value:
|
|
227
|
+
: 'Outline colour — increase width to see it on bars and columns.' })] }) }), _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Top" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().top ?? '', onChange: (e) => handlePaddingChange('top', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the top of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Right" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().right ?? '', onChange: (e) => handlePaddingChange('right', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the right of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Bottom" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().bottom ?? '', onChange: (e) => handlePaddingChange('bottom', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the bottom of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Left" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().left ?? '', onChange: (e) => handlePaddingChange('left', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the left of the chart area" })] }) }), _jsx(FormRow, { label: "Line Dash", children: _jsx(AdaptableInput, { title: "Length of dashes and gaps in pixels (comma-separated values, e.g. '3,6,9')", value: sparklineOptions.lineDash?.join(',') ?? '', onChange: (e) => {
|
|
218
228
|
const value = e.target.value;
|
|
219
229
|
const dashArray = value
|
|
220
230
|
? value
|
|
@@ -226,7 +236,7 @@ const SparklineThemingOptions = ({ options, onChange, }) => {
|
|
|
226
236
|
} }) }), _jsx(FormRow, { label: "Line Dash Offset", children: _jsx(AdaptableInput, { title: "The offset of the line dash pattern in pixels", type: "number", min: 0, value: sparklineOptions.lineDashOffset ?? '', onChange: (e) => handleChange('lineDashOffset', Number(e.target.value)) }) }), _jsx(FormRow, { label: "Background", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(CheckBox, { checked: sparklineOptions.background?.visible ?? false, onChange: (visible) => handleChange('background', {
|
|
227
237
|
...sparklineOptions.background,
|
|
228
238
|
visible,
|
|
229
|
-
}) }), _jsx(Box, { className: "twa:ml-2", children: _jsx(ColorPicker, { disabled: !sparklineOptions.background?.visible, title: "The colour of the chart background", api: api, value: sparklineOptions.background?.fill, onChange: (fill) => handleChange('background', {
|
|
239
|
+
}) }), _jsx(Box, { className: "twa:ml-2", children: _jsx(ColorPicker, { disabled: !sparklineOptions.background?.visible, title: "The colour of the chart background", api: api, value: cssColorToString(sparklineOptions.background?.fill) ?? '', onChange: (fill) => handleChange('background', {
|
|
230
240
|
...sparklineOptions.background,
|
|
231
241
|
fill,
|
|
232
242
|
}) }) })] }) }), typeof sparklineOptions.theme !== 'object' && (_jsx(FormRow, { label: "Theme", children: _jsxs(Box, { children: [_jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: sparklineOptions.theme ?? SPARKLINE_CUSTOM_COLOURS_THEME, onValueChange: (themeName) => {
|
|
@@ -263,7 +273,7 @@ const SparklineAxisOptions = ({ options, onChange, }) => {
|
|
|
263
273
|
{ value: 'time', label: 'Time' },
|
|
264
274
|
];
|
|
265
275
|
const isAxisEnabled = sparklineOptions.axis?.visible ?? false;
|
|
266
|
-
return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Axis", children: _jsx(CheckBox, { checked: isAxisEnabled, onChange: (visible) => handleChange({ visible }) }) }), _jsx(FormRow, { label: "Axis Type", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isAxisEnabled, value: sparklineOptions.axis.type, onValueChange: (type) => handleChange({ type }), items: axisTypes }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isAxisEnabled, title: "The colour of the axis line", api: api, value: sparklineOptions.axis?.stroke, onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, className: "twa:w-[70px]", title: "The width in pixels of the axis line", type: "number", min: 0, value: sparklineOptions.axis?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }) })] }) }), _jsx(FormRow, { label: "Reverse Scale", children: _jsx(CheckBox, { disabled: !isAxisEnabled, checked: sparklineOptions.axis?.reverse, onChange: (reverse) => handleChange({ reverse }) }) }), sparklineOptions.axis.type === 'category' && (_jsx(_Fragment, { children: _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Inner" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The size of the gap between categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingInner ?? '', onChange: (e) => handleChange({ paddingInner: Number(e.target.value) }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Outer" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The padding on the outside of first and last categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingOuter ?? '', onChange: (e) => handleChange({ paddingOuter: Number(e.target.value) }) })] }) }) }))] }));
|
|
276
|
+
return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Axis", children: _jsx(CheckBox, { checked: isAxisEnabled, onChange: (visible) => handleChange({ visible }) }) }), _jsx(FormRow, { label: "Axis Type", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isAxisEnabled, value: sparklineOptions.axis.type, onValueChange: (type) => handleChange({ type }), items: axisTypes }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isAxisEnabled, title: "The colour of the axis line", api: api, value: cssColorToString(sparklineOptions.axis?.stroke) ?? '', onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, className: "twa:w-[70px]", title: "The width in pixels of the axis line", type: "number", min: 0, value: sparklineOptions.axis?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }) })] }) }), _jsx(FormRow, { label: "Reverse Scale", children: _jsx(CheckBox, { disabled: !isAxisEnabled, checked: sparklineOptions.axis?.reverse, onChange: (reverse) => handleChange({ reverse }) }) }), sparklineOptions.axis.type === 'category' && (_jsx(_Fragment, { children: _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Inner" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The size of the gap between categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingInner ?? '', onChange: (e) => handleChange({ paddingInner: Number(e.target.value) }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Outer" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The padding on the outside of first and last categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingOuter ?? '', onChange: (e) => handleChange({ paddingOuter: Number(e.target.value) }) })] }) }) }))] }));
|
|
267
277
|
};
|
|
268
278
|
const SparklineTooltipOptions = ({ options, onChange, }) => {
|
|
269
279
|
const sparklineOptions = options;
|
|
@@ -331,7 +341,7 @@ const SparklineMarkerOptions = ({ options, onChange }) => {
|
|
|
331
341
|
{ value: 'triangle', label: 'Triangle' },
|
|
332
342
|
];
|
|
333
343
|
const isMarkerEnabled = sparklineOptions.marker?.enabled ?? false;
|
|
334
|
-
return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Markers", children: _jsx(CheckBox, { checked: isMarkerEnabled, onChange: (enabled) => handleChange({ enabled }) }) }), _jsx(FormRow, { label: "Marker Size", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(AdaptableInput, { disabled: !isMarkerEnabled, type: "number", className: "twa:w-full", min: 1, value: sparklineOptions.marker?.size ?? '', onChange: (e) => handleChange({ size: Number(e.target.value) }), title: "The size in pixels of the markers" }) }) }), _jsx(FormRow, { label: "Marker Shape", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isMarkerEnabled, value: sparklineOptions.marker?.shape, onValueChange: (shape) => handleChange({ shape: shape }), items: markerShapes }) }) }), _jsx(FormRow, { label: "Fill", children: _jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for filling markers", api: api, value: sparklineOptions.marker?.fill, onChange: (fill) => handleChange({ fill }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for the marker stroke", api: api, value: sparklineOptions.marker?.stroke, onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isMarkerEnabled, className: "twa:w-[70px]", type: "number", min: 0, value: sparklineOptions.marker?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }), title: "The width of the marker stroke in pixels" })] }) })] }));
|
|
344
|
+
return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Markers", children: _jsx(CheckBox, { checked: isMarkerEnabled, onChange: (enabled) => handleChange({ enabled }) }) }), _jsx(FormRow, { label: "Marker Size", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(AdaptableInput, { disabled: !isMarkerEnabled, type: "number", className: "twa:w-full", min: 1, value: sparklineOptions.marker?.size ?? '', onChange: (e) => handleChange({ size: Number(e.target.value) }), title: "The size in pixels of the markers" }) }) }), _jsx(FormRow, { label: "Marker Shape", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isMarkerEnabled, value: sparklineOptions.marker?.shape, onValueChange: (shape) => handleChange({ shape: shape }), items: markerShapes }) }) }), _jsx(FormRow, { label: "Fill", children: _jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for filling markers", api: api, value: sparklineOptions.marker?.fill, onChange: (fill) => handleChange({ fill }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for the marker stroke", api: api, value: cssColorToString(sparklineOptions.marker?.stroke) ?? '', onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isMarkerEnabled, className: "twa:w-[70px]", type: "number", min: 0, value: sparklineOptions.marker?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }), title: "The width of the marker stroke in pixels" })] }) })] }));
|
|
335
345
|
};
|
|
336
346
|
const SparklineHighlightOptions = ({ options, onChange, }) => {
|
|
337
347
|
const { api } = useOnePageAdaptableWizardContext();
|
|
@@ -369,5 +379,5 @@ const SparklineHighlightOptions = ({ options, onChange, }) => {
|
|
|
369
379
|
},
|
|
370
380
|
});
|
|
371
381
|
};
|
|
372
|
-
return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Item Fill", children: _jsx(ColorPicker, { title: "The colour for filling highlighted items", api: api, value: highlightOptions?.highlightedItem?.fill, onChange: (fill) => handleItemChange({ fill }) }) }), _jsx(FormRow, { label: "Item Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the highlighted item stroke", api: api, value: highlightOptions?.highlightedItem?.stroke, onChange: (stroke) => handleItemChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedItem?.strokeWidth ?? '', onChange: (e) => handleItemChange({ strokeWidth: Number(e.target.value) }), title: "The width of the highlighted item stroke in pixels" })] }) }), _jsx(FormRow, { label: "Series", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(CheckBox, { checked: highlightOptions?.enabled ?? false, onChange: (enabled) => handleBaseChange({ enabled }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Stroke Width" }), _jsx(AdaptableInput, { disabled: !highlightOptions?.enabled, className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedSeries?.strokeWidth ?? '', onChange: (e) => handleSeriesChange({ strokeWidth: Number(e.target.value) }), title: "The stroke width when markers are hovered or tooltip is shown" })] }) })] }));
|
|
382
|
+
return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Item Fill", children: _jsx(ColorPicker, { title: "The colour for filling highlighted items", api: api, value: highlightOptions?.highlightedItem?.fill, onChange: (fill) => handleItemChange({ fill }) }) }), _jsx(FormRow, { label: "Item Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the highlighted item stroke", api: api, value: cssColorToString(highlightOptions?.highlightedItem?.stroke) ?? '', onChange: (stroke) => handleItemChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedItem?.strokeWidth ?? '', onChange: (e) => handleItemChange({ strokeWidth: Number(e.target.value) }), title: "The width of the highlighted item stroke in pixels" })] }) }), _jsx(FormRow, { label: "Series", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(CheckBox, { checked: highlightOptions?.enabled ?? false, onChange: (enabled) => handleBaseChange({ enabled }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Stroke Width" }), _jsx(AdaptableInput, { disabled: !highlightOptions?.enabled, className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedSeries?.strokeWidth ?? '', onChange: (e) => handleSeriesChange({ strokeWidth: Number(e.target.value) }), title: "The stroke width when markers are hovered or tooltip is shown" })] }) })] }));
|
|
373
383
|
};
|
|
@@ -65,6 +65,6 @@ export interface OnePageAdaptableWizardProps<ENTITY> {
|
|
|
65
65
|
*/
|
|
66
66
|
headerPreview?: React.ReactNode;
|
|
67
67
|
}
|
|
68
|
-
export declare const OnePageAdaptableWizard: <ENTITY extends
|
|
69
|
-
export declare const OnePageWizardSummary: <ENTITY extends
|
|
68
|
+
export declare const OnePageAdaptableWizard: <ENTITY extends any>(props: OnePageAdaptableWizardProps<ENTITY>) => React.JSX.Element;
|
|
69
|
+
export declare const OnePageWizardSummary: <ENTITY extends any>() => React.JSX.Element;
|
|
70
70
|
export {};
|
|
@@ -50,5 +50,5 @@ export interface OnePageWizardProps<ENTITY> {
|
|
|
50
50
|
*/
|
|
51
51
|
headerPreview?: React.ReactNode;
|
|
52
52
|
}
|
|
53
|
-
export declare const OnePageWizard: <ENTITY extends
|
|
53
|
+
export declare const OnePageWizard: <ENTITY extends any>(props: OnePageWizardProps<ENTITY>) => React.JSX.Element;
|
|
54
54
|
export {};
|