@adaptabletools/adaptable 24.0.0-canary.5 → 24.0.0-canary.7
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/devtools.d.ts +182 -1
- package/index.css +300 -275
- package/package.json +2 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -4
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +5 -5
- package/src/AdaptableOptions/FlashingCellOptions.d.ts +3 -3
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +6 -4
- package/src/AdaptableOptions/StateOptions.d.ts +37 -13
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +4 -6
- package/src/AdaptableState/AdaptableState.d.ts +2 -0
- package/src/AdaptableState/QuickSearchState.d.ts +4 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +4 -0
- package/src/Api/Implementation/ColumnScopeApiImpl.js +3 -3
- package/src/Api/Implementation/QuickSearchApiImpl.js +2 -2
- package/src/Api/Implementation/StateApiImpl.d.ts +1 -1
- package/src/Api/Implementation/StateApiImpl.js +4 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +9 -15
- package/src/Api/Internal/AdaptableInternalApi.js +5 -3
- package/src/Api/Internal/CalculatedColumnInternalApi.js +1 -1
- package/src/Api/Internal/StateInternalApi.d.ts +1 -1
- package/src/Api/Internal/StateInternalApi.js +6 -5
- package/src/Api/StateApi.d.ts +2 -2
- package/src/Api/UserInterfaceApi.d.ts +0 -4
- package/src/Redux/ActionsReducers/QuickSearchRedux.d.ts +9 -4
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +12 -7
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.d.ts +8 -0
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +12 -12
- package/src/Redux/Store/AdaptableStore.d.ts +8 -5
- package/src/Redux/Store/AdaptableStore.js +51 -21
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +5 -5
- package/src/Redux/Store/Interface/IStorageEngine.d.ts +4 -4
- package/src/Redux/Store/StateOptionsGuards.d.ts +58 -0
- package/src/Redux/Store/StateOptionsGuards.js +112 -0
- package/src/Redux/Store/isTransientReduxAction.d.ts +5 -0
- package/src/Redux/Store/isTransientReduxAction.js +19 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -0
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +5 -5
- package/src/Utilities/Helpers/AlertTypeHelper.d.ts +1 -1
- package/src/Utilities/Helpers/SettingsPanelHelper.d.ts +14 -0
- package/src/Utilities/Helpers/SettingsPanelHelper.js +37 -1
- package/src/Utilities/Helpers/UIHelper.d.ts +12 -14
- package/src/Utilities/Helpers/UIHelper.js +12 -35
- package/src/Utilities/ObjectFactory.js +3 -3
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +9 -11
- package/src/View/Components/StyleComponent.js +2 -2
- package/src/View/Dashboard/Dashboard.d.ts +1 -1
- package/src/View/Dashboard/Dashboard.js +1 -1
- package/src/View/Dashboard/DashboardPopupSections.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +62 -25
- package/src/View/QuickSearch/QuickSearchInput.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.d.ts +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
- package/src/View/QuickSearch/Utilities/useQuickSearchDebounced.d.ts +2 -2
- package/src/View/StyledColumn/RangesComponent.js +13 -16
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +0 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +3 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +7 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +6 -6
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +8 -8
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +4 -4
- package/src/View/Wizard/CollapsibleWizardCard.d.ts +3 -1
- package/src/View/Wizard/CollapsibleWizardCard.js +17 -9
- package/src/agGrid/AdaptableAgGrid.d.ts +4 -4
- package/src/agGrid/AdaptableAgGrid.js +2 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
- package/src/agGrid/AgGridColumnAdapter.js +4 -4
- package/src/components/ColorField/index.d.ts +14 -0
- package/src/components/ColorField/index.js +6 -0
- package/src/components/aql/QueryBuilder/QueryBuilderInputs.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/normalizeLayoutModel.d.ts +1 -1
- package/src/layout-manager/src/simplifyLayoutModel.d.ts +1 -1
- package/src/migration/AdaptableUpgradeHelper.d.ts +7 -2
- package/src/migration/VersionUpgrade17.js +13 -8
- package/src/migration/VersionUpgrade24.d.ts +9 -0
- package/src/migration/VersionUpgrade24.js +27 -0
- package/src/setupDevTools.js +605 -112
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/components/Button/index.d.ts +1 -1
- package/vendor/components/Button/index.d.ts.map +1 -1
- package/vendor/components/Button/index.js.map +1 -1
- package/vendor/components/CheckBox/index.d.ts +1 -1
- package/vendor/components/CheckBox/index.d.ts.map +1 -1
- package/vendor/components/CheckBox/index.js.map +1 -1
- package/vendor/components/ColorField/index.d.ts +43 -0
- package/vendor/components/ColorField/index.d.ts.map +1 -0
- package/vendor/components/ColorField/index.js +81 -0
- package/vendor/components/ColorField/index.js.map +1 -0
- package/vendor/components/ColorPicker/colorPickerTab.d.ts +4 -0
- package/vendor/components/ColorPicker/colorPickerTab.d.ts.map +1 -0
- package/vendor/components/ColorPicker/colorPickerTab.js +28 -0
- package/vendor/components/ColorPicker/colorPickerTab.js.map +1 -0
- package/vendor/components/ColorPicker/index.d.ts +59 -0
- package/vendor/components/ColorPicker/index.d.ts.map +1 -0
- package/vendor/components/ColorPicker/index.js +204 -0
- package/vendor/components/ColorPicker/index.js.map +1 -0
- package/vendor/components/ColorPicker/themeColors.d.ts +53 -0
- package/vendor/components/ColorPicker/themeColors.d.ts.map +1 -0
- package/vendor/components/ColorPicker/themeColors.js +110 -0
- package/vendor/components/ColorPicker/themeColors.js.map +1 -0
- package/vendor/components/Combobox/VirtualizedList.d.ts +1 -1
- package/vendor/components/Combobox/VirtualizedList.d.ts.map +1 -1
- package/vendor/components/Combobox/VirtualizedList.js.map +1 -1
- package/vendor/components/Combobox/index.d.ts +1 -1
- package/vendor/components/Combobox/index.d.ts.map +1 -1
- package/vendor/components/Combobox/index.js.map +1 -1
- package/vendor/components/NumberInput/index.d.ts +51 -0
- package/vendor/components/NumberInput/index.d.ts.map +1 -0
- package/vendor/components/NumberInput/index.js +82 -0
- package/vendor/components/NumberInput/index.js.map +1 -0
- package/vendor/components/index.css +280 -24
- package/vendor/components/index.d.ts +6 -0
- package/vendor/components/index.d.ts.map +1 -1
- package/vendor/components/index.js +3 -0
- package/vendor/components/index.js.map +1 -1
- package/vendor/components/ui/combobox.d.ts.map +1 -1
- package/vendor/components/ui/combobox.js +1 -1
- package/vendor/components/ui/combobox.js.map +1 -1
- package/vendor/components/ui/input-group.d.ts.map +1 -1
- package/vendor/components/ui/input-group.js +5 -4
- package/vendor/components/ui/input-group.js.map +1 -1
- package/src/components/ColorPicker/ColorPicker.d.ts +0 -12
- package/src/components/ColorPicker/ColorPicker.js +0 -48
- package/src/components/ColorPicker/OptionalColorPicker.d.ts +0 -12
- package/src/components/ColorPicker/OptionalColorPicker.js +0 -13
- package/src/components/ColorPicker/index.d.ts +0 -2
- package/src/components/ColorPicker/index.js +0 -2
|
@@ -6,15 +6,15 @@ import { Schedule, Weekday } from '../../AdaptableState/Common/Schedule';
|
|
|
6
6
|
import { AdaptableColumnDataType, AdaptableSystemIconName } from '../../types';
|
|
7
7
|
import { AdaptableAlert } from '../../AdaptableState/Common/AdaptableAlert';
|
|
8
8
|
import { AdaptableMessageType } from '../../AdaptableState/Common/AdaptableMessageType';
|
|
9
|
-
/**
|
|
10
|
-
export declare function
|
|
11
|
-
/** Default
|
|
12
|
-
export declare function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
/** A theme colour token as a CSS value: `themeColorVar('badge')` → `var(--ab-color-badge)`. */
|
|
10
|
+
export declare function themeColorVar(token: string): string;
|
|
11
|
+
/** Default colour of a new range in Range Bar, Bullet and Ranges styled columns. */
|
|
12
|
+
export declare function getDefaultRangeColor(): string;
|
|
13
|
+
/** Default colours for a new Gradient Zero Centred range (follows the theme). */
|
|
14
|
+
export declare function getDefaultZeroCentredColors(): {
|
|
15
|
+
NegativeColor: string;
|
|
16
|
+
PositiveColor: string;
|
|
17
|
+
};
|
|
18
18
|
export declare function getEmptyConfigState(): EditableConfigEntityState;
|
|
19
19
|
export declare function getDescriptionForDataType(dataType: AdaptableColumnDataType): "text" | "number" | "date";
|
|
20
20
|
export declare function getPlaceholderForDataType(dataType: AdaptableColumnDataType): "Enter Value" | "Enter Number" | "Enter Date";
|
|
@@ -41,11 +41,9 @@ export declare function getCSSVariableValue(cssVariable: string): string | undef
|
|
|
41
41
|
export declare function setCSSVariableValue(cssVariable: string, value: string): void;
|
|
42
42
|
export declare function isBrowserDocumentAvailable(): boolean;
|
|
43
43
|
export declare const UIHelper: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
getThemeSemanticColorPaletteEntries: typeof getThemeSemanticColorPaletteEntries;
|
|
48
|
-
getDefaultColorPalette: typeof getDefaultColorPalette;
|
|
44
|
+
themeColorVar: typeof themeColorVar;
|
|
45
|
+
getDefaultRangeColor: typeof getDefaultRangeColor;
|
|
46
|
+
getDefaultZeroCentredColors: typeof getDefaultZeroCentredColors;
|
|
49
47
|
getEmptyConfigState: typeof getEmptyConfigState;
|
|
50
48
|
getDescriptionForDataType: typeof getDescriptionForDataType;
|
|
51
49
|
getPlaceholderForDataType: typeof getPlaceholderForDataType;
|
|
@@ -3,38 +3,17 @@ import { FontWeight, FontStyle, StatusColour } from '../../AdaptableState/Common
|
|
|
3
3
|
import { StringExtensions } from '../Extensions/StringExtensions';
|
|
4
4
|
import { getScheduleDescription as getScheduleDescriptionFromHelper } from './Scheduling/ScheduleHelper';
|
|
5
5
|
import ArrayExtensions from '../Extensions/ArrayExtensions';
|
|
6
|
-
export function
|
|
7
|
-
return `var(--ab-color
|
|
6
|
+
export function themeColorVar(token) {
|
|
7
|
+
return `var(--ab-color-${token})`;
|
|
8
8
|
}
|
|
9
|
-
export function
|
|
10
|
-
return
|
|
9
|
+
export function getDefaultRangeColor() {
|
|
10
|
+
return themeColorVar('range-default');
|
|
11
11
|
}
|
|
12
|
-
export function
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'var(--ab-color-destructive)',
|
|
18
|
-
'var(--ab-color-warn)',
|
|
19
|
-
'var(--ab-color-success)',
|
|
20
|
-
'var(--ab-color-info)',
|
|
21
|
-
'var(--ab-color-accent)',
|
|
22
|
-
'var(--ab-color-palette-1)',
|
|
23
|
-
'var(--ab-color-palette-2)',
|
|
24
|
-
'var(--ab-color-palette-3)',
|
|
25
|
-
'var(--ab-color-palette-4)',
|
|
26
|
-
'var(--ab-color-palette-5)',
|
|
27
|
-
'var(--ab-color-palette-6)',
|
|
28
|
-
'var(--ab-color-palette-7)',
|
|
29
|
-
'var(--ab-color-palette-8)',
|
|
30
|
-
'var(--ab-color-palette-9)',
|
|
31
|
-
'var(--ab-color-palette-10)',
|
|
32
|
-
'var(--ab-color-palette-11)',
|
|
33
|
-
'var(--ab-color-palette-12)',
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
export function getDefaultColorPalette() {
|
|
37
|
-
return [...getSwatchColorPaletteEntries(), ...getThemeSemanticColorPaletteEntries()];
|
|
12
|
+
export function getDefaultZeroCentredColors() {
|
|
13
|
+
return {
|
|
14
|
+
NegativeColor: themeColorVar('destructive'),
|
|
15
|
+
PositiveColor: themeColorVar('success'),
|
|
16
|
+
};
|
|
38
17
|
}
|
|
39
18
|
export function getEmptyConfigState() {
|
|
40
19
|
return {
|
|
@@ -324,11 +303,9 @@ export function isBrowserDocumentAvailable() {
|
|
|
324
303
|
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
325
304
|
}
|
|
326
305
|
export const UIHelper = {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
getThemeSemanticColorPaletteEntries,
|
|
331
|
-
getDefaultColorPalette,
|
|
306
|
+
themeColorVar,
|
|
307
|
+
getDefaultRangeColor,
|
|
308
|
+
getDefaultZeroCentredColors,
|
|
332
309
|
getEmptyConfigState,
|
|
333
310
|
getDescriptionForDataType,
|
|
334
311
|
getPlaceholderForDataType,
|
|
@@ -4,7 +4,7 @@ import { buildCronExpression } from './Helpers/Scheduling/ScheduleHelper';
|
|
|
4
4
|
import { EMPTY_STRING } from './Constants/GeneralConstants';
|
|
5
5
|
import { ALERT_DEFAULT_MESSAGE_TYPE, ALERT_DEFAULT_SHOW_POPUP, PLUS_MINUS_DEFAULT_NUDGE_VALUE, } from './Constants/ObjectDefaultConstants';
|
|
6
6
|
import { Bounce, Flip, Slide, Zoom } from '../components/Toastify';
|
|
7
|
-
import {
|
|
7
|
+
import { themeColorVar } from './Helpers/UIHelper';
|
|
8
8
|
import { isPivotLayout } from './Helpers/Layouts/LayoutHelper';
|
|
9
9
|
export function CreateEmptyCustomSort() {
|
|
10
10
|
return { Uuid: createUuid(), Name: EMPTY_STRING, ColumnId: EMPTY_STRING, SortedValues: [] };
|
|
@@ -250,8 +250,8 @@ export function CreateDefaultStyledColumnBadge() {
|
|
|
250
250
|
return {
|
|
251
251
|
Shape: 'Rounded',
|
|
252
252
|
PillStyle: {
|
|
253
|
-
BackColor:
|
|
254
|
-
ForeColor:
|
|
253
|
+
BackColor: themeColorVar('badge'),
|
|
254
|
+
ForeColor: themeColorVar('badge-foreground'),
|
|
255
255
|
},
|
|
256
256
|
};
|
|
257
257
|
}
|
|
@@ -10,7 +10,7 @@ import { getSettingsPanelNavigationItems } from './useMenuItems';
|
|
|
10
10
|
import { isSettingsPanelNavigationItem, } from './settingsPanelNavigationTypes';
|
|
11
11
|
import { SidebarTrigger } from '../../../../components/ui/sidebar';
|
|
12
12
|
import { Flex } from '../../../../components/Flex';
|
|
13
|
-
import {
|
|
13
|
+
import { AdaptableFormControlTextClear } from '../../Forms/AdaptableFormControlTextClear';
|
|
14
14
|
import { Tooltip } from '../../../../components/Tooltip';
|
|
15
15
|
import { resolveSettingsPanelDisplayOptions } from '../../../../Utilities/Helpers/SettingsPanelHelper';
|
|
16
16
|
const navigationItemClassName = 'ab-Adaptable-Popup__Navigation__List__Item';
|
|
@@ -56,13 +56,7 @@ export const filterSettingsPanelNavigationEntries = (entries, query) => {
|
|
|
56
56
|
}
|
|
57
57
|
return filtered;
|
|
58
58
|
};
|
|
59
|
-
const NavigationItem = ({ menuItem, description, isActive, dataName, customPanelIcon, isCustomSettingsPanel, onAction, showModuleIcons, showModuleDescriptions, collapsed, }) => {
|
|
60
|
-
const ref = useRef(null);
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (isActive) {
|
|
63
|
-
ref.current?.focus();
|
|
64
|
-
}
|
|
65
|
-
}, [isActive]);
|
|
59
|
+
const NavigationItem = ({ menuItem, description, isActive, dataName, customPanelIcon, isCustomSettingsPanel, onAction, showModuleIcons, showModuleDescriptions, collapsed, buttonRef, }) => {
|
|
66
60
|
const visibleDescription = !collapsed && showModuleDescriptions ? description : undefined;
|
|
67
61
|
let icon = null;
|
|
68
62
|
if (isCustomSettingsPanel) {
|
|
@@ -82,7 +76,7 @@ const NavigationItem = ({ menuItem, description, isActive, dataName, customPanel
|
|
|
82
76
|
return (_jsx("li", { className: cn(navigationItemClassName, {
|
|
83
77
|
[`${navigationItemClassName}--active`]: isActive,
|
|
84
78
|
[`${navigationItemClassName}--collapsed`]: collapsed,
|
|
85
|
-
}), children: _jsxs("button", { ref:
|
|
79
|
+
}), children: _jsxs("button", { ref: buttonRef, type: "button", title: tooltip, "aria-label": menuItem.label, className: cn(`${navigationItemClassName}__Button ${targetOwn.focusOutline}`, {
|
|
86
80
|
'twa:flex twa:flex-row twa:gap-2': true,
|
|
87
81
|
'twa:items-start': Boolean(visibleDescription),
|
|
88
82
|
'twa:items-center': !visibleDescription,
|
|
@@ -128,6 +122,10 @@ export const Navigation = (props) => {
|
|
|
128
122
|
const { showModuleIcons, showModuleDescriptions, showNavigationSearch, enableCollapseView, } = displayOptions;
|
|
129
123
|
const collapsed = enableCollapseView && (props.collapsed ?? false);
|
|
130
124
|
const visibleMenuItems = useMemo(() => filterSettingsPanelNavigationEntries(props.menuItems, searchQuery), [props.menuItems, searchQuery]);
|
|
125
|
+
const activeButtonRef = useRef(null);
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
activeButtonRef.current?.focus();
|
|
128
|
+
}, [props.activeItem]);
|
|
131
129
|
const makeActive = (menuItem) => {
|
|
132
130
|
dispatch(menuItem.reduxAction);
|
|
133
131
|
};
|
|
@@ -167,7 +165,7 @@ export const Navigation = (props) => {
|
|
|
167
165
|
'twa:justify-center twa:px-1 twa:pt-2 twa:pb-1': collapsed,
|
|
168
166
|
'twa:px-2 twa:pt-2 twa:pb-1': !collapsed,
|
|
169
167
|
'twa:justify-end': !collapsed && !showSearchInput,
|
|
170
|
-
}), children: [showSearchInput ? (_jsx(
|
|
168
|
+
}), children: [showSearchInput ? (_jsx(AdaptableFormControlTextClear, { "data-name": "settings-panel-nav-search", value: searchQuery, OnTextChange: setSearchQuery, placeholder: "Search...", "aria-label": "Search Settings Panel modules", className: "twa:h-8 twa:flex-1 twa:min-w-0", inputClassName: "twa:text-2" })) : null, collapseTrigger] })) : null, _jsxs("ul", { className: "ab-Adaptable-Popup__Navigation__List twa:m-0 twa:list-none twa:py-3 twa:gap-1 twa:flex twa:flex-col twa:flex-1 twa:min-h-0 twa:overflow-auto", onKeyDown: handleKeyPress, children: [!hasVisibleItems ? (_jsx("li", { className: "twa:list-none twa:px-3 twa:py-2 twa:text-2 twa:opacity-70", children: collapsed ? null : 'No modules match' })) : null, visibleMenuItems.map((entry, index) => {
|
|
171
169
|
if (entry.type === 'header') {
|
|
172
170
|
if (collapsed) {
|
|
173
171
|
return null;
|
|
@@ -181,6 +179,6 @@ export const Navigation = (props) => {
|
|
|
181
179
|
const dataName = isCustomSettingsPanel
|
|
182
180
|
? `CSP-${menuItem.label}`
|
|
183
181
|
: menuItem.category ?? menuItem.label;
|
|
184
|
-
return (_jsx(NavigationItem, { menuItem: menuItem, description: entry.description, isActive: isActive, dataName: dataName, customPanelIcon: customPanelIcon, isCustomSettingsPanel: isCustomSettingsPanel, showModuleIcons: showModuleIcons, showModuleDescriptions: showModuleDescriptions, collapsed: collapsed, onAction: () => makeActive(menuItem) }, menuItem.label));
|
|
182
|
+
return (_jsx(NavigationItem, { menuItem: menuItem, description: entry.description, isActive: isActive, dataName: dataName, customPanelIcon: customPanelIcon, isCustomSettingsPanel: isCustomSettingsPanel, showModuleIcons: showModuleIcons, showModuleDescriptions: showModuleDescriptions, collapsed: collapsed, onAction: () => makeActive(menuItem), buttonRef: isActive ? activeButtonRef : undefined }, menuItem.label));
|
|
185
183
|
})] })] }));
|
|
186
184
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ColorField } from '../../components/ColorField';
|
|
4
4
|
import HelpBlock from '../../components/HelpBlock';
|
|
5
5
|
import Panel from '../../components/Panel';
|
|
6
6
|
import { Tabs } from '../../components/Tabs';
|
|
@@ -131,7 +131,7 @@ export const StyleComponent = (props) => {
|
|
|
131
131
|
const styleClassNames = props.api.userInterfaceApi.getStyleClassNames();
|
|
132
132
|
const colourSpellingVariant = props.api.internalApi.getCorrectEnglishVariant('Colour');
|
|
133
133
|
const coloursSpellingVariant = props.api.internalApi.getCorrectEnglishVariant('colours');
|
|
134
|
-
const styleEditorGrid = (_jsxs(Card.Body, { gap: 2, className: "twa:grid twa:grid-cols-[auto_1fr_auto_1fr] twa:items-center twa:p-1", children: [_jsxs(Card.Title, { className: "twa:col-span-2 twa:self-stretch", children: [_jsxs(Box, { className: "twa:font-medium", children: [colourSpellingVariant, " & Border Properties"] }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["Select ", coloursSpellingVariant, " and radius"] })] }), _jsxs("span", { children: ["Back ", colourSpellingVariant] }), _jsx(
|
|
134
|
+
const styleEditorGrid = (_jsxs(Card.Body, { gap: 2, className: "twa:grid twa:grid-cols-[auto_1fr_auto_1fr] twa:items-center twa:p-1", children: [_jsxs(Card.Title, { className: "twa:col-span-2 twa:self-stretch", children: [_jsxs(Box, { className: "twa:font-medium", children: [colourSpellingVariant, " & Border Properties"] }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["Select ", coloursSpellingVariant, " and radius"] })] }), _jsxs("span", { children: ["Back ", colourSpellingVariant] }), _jsx(ColorField, { value: componentStyle.BackColor, defaultColor: "#ffffff", onChange: onBackColorChange }), _jsxs("span", { className: "twa:row-start-3", children: ["Fore ", colourSpellingVariant] }), _jsx(ColorField, { className: "twa:row-start-3", value: componentStyle.ForeColor, defaultColor: "#000000", onChange: onForeColorChange }), _jsxs("span", { className: "twa:row-start-4", children: ["Border ", colourSpellingVariant] }), _jsx(ColorField, { className: "twa:row-start-4", value: componentStyle.BorderColor, defaultColor: "#000000", onChange: onBorderColorChange }), _jsx("span", { className: "twa:row-start-5", children: "Border Radius" }), _jsx(AdaptableInput, { className: "twa:w-[100px] twa:row-start-5", type: "number", min: "0", value: componentStyle.BorderRadius, onChange: (event) => {
|
|
135
135
|
const number = Number(event.target.value);
|
|
136
136
|
if (isNaN(number)) {
|
|
137
137
|
onBorderRadiusChange(0);
|
|
@@ -18,7 +18,7 @@ interface DashboardComponentProps extends ModuleViewPopupProps<any> {
|
|
|
18
18
|
onSetIsCollapsed: (IsCollapsed: boolean) => DashboardRedux.DashboardSetIsCollapsedAction;
|
|
19
19
|
onSetIsFloating: (IsFloating: boolean) => DashboardRedux.DashboardSetIsFloatingAction;
|
|
20
20
|
onSetFloatingPosition: (FloatingPosition: AdaptableCoordinate) => DashboardRedux.DashboardSetFloatingPositionAction;
|
|
21
|
-
onRunQuickSearch: (quickSearchText: string) => QuickSearchRedux.QuickSearchRunAction;
|
|
21
|
+
onRunQuickSearch: (quickSearchText: string) => QuickSearchRedux.QuickSearchRunAction | QuickSearchRedux.QuickSearchClearAction;
|
|
22
22
|
onShowQuickSearchPopup: () => PopupRedux.PopupShowScreenAction;
|
|
23
23
|
onShowDashboardPopup: () => PopupRedux.PopupShowScreenAction;
|
|
24
24
|
}
|
|
@@ -126,7 +126,7 @@ function mapDispatchToProps(dispatch) {
|
|
|
126
126
|
onSetIsCollapsed: (IsCollapsed) => dispatch(DashboardRedux.DashboardSetIsCollapsed(IsCollapsed)),
|
|
127
127
|
onSetIsFloating: (IsFloating) => dispatch(DashboardRedux.DashboardSetIsFloating(IsFloating)),
|
|
128
128
|
onSetFloatingPosition: (FloatingPosition) => dispatch(DashboardRedux.DashboardSetFloatingPosition(FloatingPosition)),
|
|
129
|
-
onRunQuickSearch: (newQuickSearchText) => dispatch(QuickSearchRedux.
|
|
129
|
+
onRunQuickSearch: (newQuickSearchText) => dispatch(QuickSearchRedux.QuickSearchTextAction(newQuickSearchText)),
|
|
130
130
|
onShowQuickSearchPopup: () => dispatch(PopupRedux.PopupShowScreen(ModuleConstants.QuickSearchModuleId, 'QuickSearchPopup')),
|
|
131
131
|
onShowDashboardPopup: () => dispatch(PopupRedux.PopupShowScreen(ModuleConstants.DashboardModuleId, 'DashboardPopup')),
|
|
132
132
|
};
|
|
@@ -61,5 +61,5 @@ export const DashboardPopupSections = (props) => {
|
|
|
61
61
|
return (_jsxs(Flex, { flexWrap: "wrap", alignItems: "center", className: "twa:gap-1", children: [_jsxs(Tag, { children: ["Tab: ", tab.Name] }), toolbarTitles.map((title, index) => (_jsx(Tag, { children: title }, `${tab.Name}-${title}-${index}`)))] }, tab.Uuid ?? tab.Name));
|
|
62
62
|
}) })) : (_jsx(Tag, { children: "No Tabs Configured" }));
|
|
63
63
|
const moduleButtonsSummary = moduleButtonLabels.length > 0 ? (_jsx(Flex, { flexWrap: "wrap", alignItems: "center", className: "twa:gap-1", children: moduleButtonLabels.map((label) => (_jsx(Tag, { children: label }, label))) })) : (_jsx(Tag, { children: "No Module Buttons" }));
|
|
64
|
-
return (_jsxs(Flex, { flexDirection: "column", className: "twa:h-full twa:min-h-0 twa:gap-3 twa:overflow-y-auto", children: [props.areDashboardSettingsVisible && (_jsx(CollapsibleWizardCard, {
|
|
64
|
+
return (_jsxs(Flex, { flexDirection: "column", className: "twa:h-full twa:min-h-0 twa:gap-3 twa:overflow-y-auto", children: [props.areDashboardSettingsVisible && (_jsx(CollapsibleWizardCard, { "data-name": "dashboard-settings", title: "Settings", help: "Control Dashboard visibility, expansion and floating mode", summary: settingsToggles, collapsible: false, className: "twa:overflow-hidden" })), _jsx(CollapsibleWizardCard, { ...bindCard('pinned-toolbars'), "data-name": "dashboard-pinned-toolbars", title: "Pinned Toolbars", help: "Optional strip along the top of the grid \u2014 pin Toolbars you want always visible (e.g. Grid Filter)", compactSummary: renderCompactAccentTags(pinnedToolbarTitles, (title) => title, { emptyLabel: 'No Pinned Toolbars' }), summary: pinnedSummary, className: "twa:overflow-hidden twa:flex twa:flex-col", bodyClassName: "twa:min-h-[200px] twa:overflow-hidden", children: _jsx(PinnedToolbarsSelector, {}) }), _jsx(CollapsibleWizardCard, { ...bindCard('tabs-toolbars'), "data-name": "dashboard-tabs-toolbars", title: "Tabs & Toolbars", help: "Group Toolbars into named Tabs in the Dashboard header (independent of Pinned Toolbars)", compactSummary: renderCompactAccentTags(tabsCompactLabels, (label) => label, { emptyLabel: 'No Tabs Configured' }), summary: tabsSummary, className: "twa:overflow-hidden twa:flex twa:flex-col", bodyClassName: "twa:min-h-[280px] twa:overflow-hidden", children: _jsx(DashboardManagerUI, { disabled: props.isDashboardDisabled, availableToolbars: [...systemToolbars, ...customToolbars], tabs: tabs, onTabsChange: props.onDashboardSetTabs, api: api }) }), _jsx(CollapsibleWizardCard, { ...bindCard('module-buttons', { fillAvailable: true }), "data-name": "dashboard-module-buttons", title: "Module Buttons", help: "Buttons in the Dashboard header that open Module settings", compactSummary: renderCompactAccentTags(moduleButtonLabels, (label) => label, { emptyLabel: 'No Module Buttons' }), summary: moduleButtonsSummary, className: "twa:overflow-hidden twa:flex twa:flex-col", bodyClassName: "twa:min-h-[240px] twa:overflow-hidden twa:flex twa:flex-col twa:!pt-0 twa:!pb-0 twa:px-1", children: _jsx(ModuleValueSelector, { disabled: props.isDashboardDisabled, options: allModuleButtons, value: selectedModuleButtons, onChange: (selectedValues) => props.onDashboardSetModuleButtons(selectedValues) }) })] }));
|
|
65
65
|
};
|
|
@@ -8,12 +8,14 @@ import { Tabs } from '../../components/Tabs';
|
|
|
8
8
|
import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
|
|
9
9
|
import { AdaptableObjectsSummary } from './AdaptableObjectsSummary';
|
|
10
10
|
import { getDefaultAdaptableOptions } from '../../AdaptableOptions/DefaultAdaptableOptions';
|
|
11
|
+
import { isPivotLayout } from '../../Utilities/Helpers/Layouts/LayoutHelper';
|
|
11
12
|
import { cn } from '../../lib/utils';
|
|
12
13
|
const adaptableVersion = ADAPTABLE_VERSION;
|
|
13
14
|
const agGridVersion = AG_GRID_VERSION;
|
|
14
15
|
export const GridInfoPopup = (props) => {
|
|
15
16
|
const api = props.api;
|
|
16
|
-
const
|
|
17
|
+
const summaryKeyValuePairs = [];
|
|
18
|
+
const layoutKeyValuePairs = [];
|
|
17
19
|
const calcColumns = api.calculatedColumnApi
|
|
18
20
|
.getCalculatedColumns()
|
|
19
21
|
.map((c) => c.ColumnId);
|
|
@@ -32,40 +34,74 @@ export const GridInfoPopup = (props) => {
|
|
|
32
34
|
: null;
|
|
33
35
|
const selectedRowInfo = api.gridApi.getSelectedRowInfo();
|
|
34
36
|
if (api.optionsApi.getUserInterfaceOptions()?.showAdapTableVersion) {
|
|
35
|
-
|
|
37
|
+
summaryKeyValuePairs.push({ Key: 'AdapTable Version', Value: adaptableVersion });
|
|
36
38
|
}
|
|
37
39
|
if (api.optionsApi.getUserInterfaceOptions()?.showAgGridVersion) {
|
|
38
|
-
|
|
40
|
+
summaryKeyValuePairs.push({ Key: 'AG Grid Version', Value: agGridVersion });
|
|
39
41
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
summaryKeyValuePairs.push({ Key: 'License Key', Value: api.optionsApi.getAdaptableOptions().licenseKey });
|
|
43
|
+
summaryKeyValuePairs.push({ Key: 'Adaptable Id', Value: api.optionsApi.getAdaptableId() });
|
|
44
|
+
summaryKeyValuePairs.push({ Key: 'State Key', Value: api.optionsApi.getAdaptableStateKey() });
|
|
45
|
+
summaryKeyValuePairs.push({ Key: 'User Name', Value: api.optionsApi.getUserName() });
|
|
46
|
+
const primaryKey = api.optionsApi.getPrimaryKey();
|
|
47
|
+
const primaryKeyFriendly = primaryKey
|
|
48
|
+
? api.columnApi.getFriendlyNameForColumnId(primaryKey)
|
|
49
|
+
: undefined;
|
|
50
|
+
const primaryKeyLabel = primaryKeyFriendly && primaryKeyFriendly !== primaryKey
|
|
51
|
+
? `${primaryKeyFriendly} (${primaryKey})`
|
|
52
|
+
: primaryKey;
|
|
53
|
+
summaryKeyValuePairs.push({
|
|
54
|
+
Key: 'Primary Key',
|
|
55
|
+
Value: api.optionsApi.isAutogeneratePrimaryKey()
|
|
56
|
+
? `${primaryKeyLabel} (auto-generated)`
|
|
57
|
+
: primaryKeyLabel,
|
|
58
|
+
});
|
|
59
|
+
const currentLayout = api.layoutApi.getCurrentLayout();
|
|
60
|
+
const isPivot = isPivotLayout(currentLayout);
|
|
61
|
+
const columnLabels = (columnIds) => ArrayExtensions.IsNotNullOrEmpty(columnIds)
|
|
62
|
+
? columnIds
|
|
63
|
+
.map((columnId) => api.columnApi.getFriendlyNameForColumnId(columnId) || columnId)
|
|
64
|
+
.join(', ')
|
|
65
|
+
: 'None';
|
|
66
|
+
layoutKeyValuePairs.push({
|
|
67
|
+
Key: 'Current Layout',
|
|
68
|
+
Value: api.layoutApi.getCurrentLayoutName() || 'None',
|
|
69
|
+
});
|
|
70
|
+
layoutKeyValuePairs.push({
|
|
71
|
+
Key: 'Layout Type',
|
|
72
|
+
Value: isPivot ? 'Pivot' : 'Table',
|
|
73
|
+
});
|
|
74
|
+
layoutKeyValuePairs.push({
|
|
75
|
+
Key: 'Row Groups',
|
|
76
|
+
Value: columnLabels(api.layoutApi.getCurrentRowGroupsColumnIds()),
|
|
77
|
+
});
|
|
78
|
+
if (isPivot) {
|
|
79
|
+
layoutKeyValuePairs.push({
|
|
80
|
+
Key: 'Pivot Columns',
|
|
81
|
+
Value: columnLabels(currentLayout.PivotColumns),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
layoutKeyValuePairs.push({ Key: 'Sorted Columns', Value: ArrayExtensions.IsNotNullOrEmpty(sorts) ? sorts.join('; ') : 'None' });
|
|
85
|
+
layoutKeyValuePairs.push({ Key: 'Column Filters', Value: columnFilterDescription });
|
|
86
|
+
layoutKeyValuePairs.push({ Key: 'Grid Filter', Value: gridFilterExpression });
|
|
87
|
+
layoutKeyValuePairs.push({ Key: 'All Rows', Value: props.api.gridApi.getRowCount() });
|
|
88
|
+
layoutKeyValuePairs.push({ Key: 'Visible Rows', Value: props.api.gridApi.getVisibleRowCount() });
|
|
89
|
+
layoutKeyValuePairs.push({ Key: 'Selected Rows', Value: selectedRowInfo?.gridRows.length });
|
|
90
|
+
layoutKeyValuePairs.push({ Key: 'Visible Selected Rows', Value: selectedRowInfo?.gridRows.filter((gr) => gr.rowNode?.displayed == true).length });
|
|
91
|
+
layoutKeyValuePairs.push({ Key: 'All Columns', Value: props.api.gridApi.getColumnCount() });
|
|
92
|
+
layoutKeyValuePairs.push({ Key: 'Visible Columns', Value: props.api.gridApi.getVisibleColumnCount() });
|
|
93
|
+
layoutKeyValuePairs.push({ Key: 'Calculated Columns', Value: ArrayExtensions.IsNotNullOrEmpty(calcColumns)
|
|
51
94
|
? ArrayExtensions.createCommaSeparatedString(calcColumns)
|
|
52
95
|
: 'None' });
|
|
53
|
-
|
|
96
|
+
layoutKeyValuePairs.push({ Key: 'Free Text Columns', Value: ArrayExtensions.IsNotNullOrEmpty(freeTextColumns)
|
|
54
97
|
? ArrayExtensions.createCommaSeparatedString(freeTextColumns)
|
|
55
98
|
: 'None' });
|
|
56
|
-
|
|
99
|
+
layoutKeyValuePairs.push({ Key: 'Action Columns', Value: ArrayExtensions.IsNotNullOrEmpty(actionColumns)
|
|
57
100
|
? ArrayExtensions.createCommaSeparatedString(actionColumns)
|
|
58
101
|
: 'None' });
|
|
59
102
|
const domProps = {
|
|
60
103
|
className: 'twa:flex-1 twa:min-h-0 twa:w-full',
|
|
61
104
|
};
|
|
62
|
-
keyValuePairs.map((keyValuePair) => {
|
|
63
|
-
return {
|
|
64
|
-
Key: keyValuePair.Key,
|
|
65
|
-
Value: keyValuePair.Value === 'Ignore' ? null : keyValuePair.Value,
|
|
66
|
-
};
|
|
67
|
-
})
|
|
68
|
-
.filter((x) => x.Value);
|
|
69
105
|
const columnsMap = {
|
|
70
106
|
Key: { field: 'Key', header: 'Property', defaultFlex: 1 },
|
|
71
107
|
Value: { field: 'Value', header: 'Value', defaultFlex: 3 },
|
|
@@ -199,12 +235,13 @@ export const GridInfoPopup = (props) => {
|
|
|
199
235
|
return Math.min(total + 40, 400);
|
|
200
236
|
};
|
|
201
237
|
const enabledTabs = api.optionsApi.getSettingsPanelOptions()?.gridInfoTabs ??
|
|
202
|
-
['Grid
|
|
238
|
+
['Grid Summary', 'Layout', 'Grid State', 'Grid Options'];
|
|
203
239
|
const showSummary = enabledTabs.includes('Grid Summary');
|
|
240
|
+
const showLayout = enabledTabs.includes('Layout');
|
|
204
241
|
const showState = enabledTabs.includes('Grid State');
|
|
205
242
|
const showOptions = enabledTabs.includes('Grid Options');
|
|
206
243
|
const baseClassName = 'ab-GridInfo';
|
|
207
|
-
return (_jsx(PopupPanel, { className: cn(baseClassName), headerText: 'Grid Info', glyphicon: 'info', scrollable: false, children: _jsx(Panel, { className: "twa:flex-1 twa:border-none twa:shadow-md twa:overflow-hidden", children: _jsx(Panel.FlexBody, { children: _jsxs(Tabs, { className: "twa:flex-1 twa:min-h-0", children: [showSummary ? _jsx(Tabs.Tab, { children: "
|
|
244
|
+
return (_jsx(PopupPanel, { className: cn(baseClassName), headerText: 'Grid Info', glyphicon: 'info', scrollable: false, children: _jsx(Panel, { className: "twa:flex-1 twa:border-none twa:shadow-md twa:overflow-hidden", children: _jsx(Panel.FlexBody, { children: _jsxs(Tabs, { className: "twa:flex-1 twa:min-h-0", children: [showSummary ? _jsx(Tabs.Tab, { children: "Summary" }) : null, showLayout ? _jsx(Tabs.Tab, { children: "Layout" }) : null, showState ? _jsx(Tabs.Tab, { children: "State" }) : null, showOptions ? _jsx(Tabs.Tab, { children: "Options" }) : null, showSummary ? (_jsx(Tabs.Content, { children: _jsx(DataSource, { data: summaryKeyValuePairs, primaryKey: "Key", children: _jsx(InfiniteTableGrid, { domProps: domProps, columns: columnsMap }) }) })) : null, showLayout ? (_jsx(Tabs.Content, { children: _jsx(DataSource, { data: layoutKeyValuePairs, primaryKey: "Key", children: _jsx(InfiniteTableGrid, { domProps: domProps, columns: columnsMap }) }) })) : null, showState ? (_jsx(Tabs.Content, { children: _jsx(AdaptableObjectsSummary, { className: "twa:min-h-0 twa:overflow-auto twa:p-2" }) })) : null, showOptions ? (_jsx(Tabs.Content, { children: _jsx("div", { className: "twa:min-h-0 twa:overflow-auto twa:p-2 twa:flex twa:flex-col twa:gap-4", children: gridOptionsSections.map((section) => (_jsxs("div", { children: [_jsx("h4", { className: "twa:font-semibold twa:mb-1", children: section.title }), _jsx(DataSource, { data: section.rows, primaryKey: "Key", children: _jsx(InfiniteTableGrid, { domProps: {
|
|
208
245
|
style: { height: sectionHeight(section.rows), width: '100%' },
|
|
209
246
|
}, rowHeight: (rowInfo) => calculateRowHeight(rowInfo.data), columns: optionsColumnsMap }) })] }, section.title))) }) })) : null] }) }) }) }));
|
|
210
247
|
};
|
|
@@ -12,7 +12,7 @@ export const QuickSearchInput = (props) => {
|
|
|
12
12
|
const adaptable = useAdaptable();
|
|
13
13
|
const QuickSearchText = useSelector((state) => state.QuickSearch.QuickSearchText);
|
|
14
14
|
const dispatch = useDispatch();
|
|
15
|
-
const onRunQuickSearch = React.useCallback((newQuickSearchText) => dispatch(QuickSearchRedux.
|
|
15
|
+
const onRunQuickSearch = React.useCallback((newQuickSearchText) => dispatch(QuickSearchRedux.QuickSearchTextAction(newQuickSearchText)), []);
|
|
16
16
|
const isServerSideRowModel = adaptable.api.gridApi.getAgGridRowModelType() === 'serverSide';
|
|
17
17
|
const [searchText, search] = useQuickSearchDebounced({
|
|
18
18
|
QuickSearchText,
|
|
@@ -7,7 +7,7 @@ interface QuickSearchPopupProps extends ModuleViewPopupProps<any> {
|
|
|
7
7
|
QuickSearchTextMatchStyle: AdaptableStyle;
|
|
8
8
|
QuickSearchCurrentTextMatchStyle: AdaptableStyle;
|
|
9
9
|
QuickSearchCellMatchStyle: AdaptableStyle;
|
|
10
|
-
onRunQuickSearch: (quickSearchText: string) => QuickSearchRedux.QuickSearchRunAction;
|
|
10
|
+
onRunQuickSearch: (quickSearchText: string) => QuickSearchRedux.QuickSearchRunAction | QuickSearchRedux.QuickSearchClearAction;
|
|
11
11
|
onSetTextMatchingStyle: (style: AdaptableStyle) => QuickSearchRedux.QuickSearchSetTextMatchingStyleAction;
|
|
12
12
|
onSetCurrentTextMatchingStyle: (style: AdaptableStyle) => QuickSearchRedux.QuickSearchSetCurrentTextMatchingStyleAction;
|
|
13
13
|
onSetCellMatchingStyle: (style: AdaptableStyle) => QuickSearchRedux.QuickSearchSetMatchingCellStyleAction;
|
|
@@ -39,7 +39,7 @@ function mapStateToProps(state, ownProps) {
|
|
|
39
39
|
}
|
|
40
40
|
function mapDispatchToProps(dispatch) {
|
|
41
41
|
return {
|
|
42
|
-
onRunQuickSearch: (quickSearchText) => dispatch(QuickSearchRedux.
|
|
42
|
+
onRunQuickSearch: (quickSearchText) => dispatch(QuickSearchRedux.QuickSearchTextAction(quickSearchText)),
|
|
43
43
|
onSetTextMatchingStyle: (style) => dispatch(QuickSearchRedux.QuickSearchSetTextMatchingStyle(style)),
|
|
44
44
|
onSetCurrentTextMatchingStyle: (style) => dispatch(QuickSearchRedux.QuickSearchSetCurrentTextMatchingStyle(style)),
|
|
45
45
|
onSetCellMatchingStyle: (style) => dispatch(QuickSearchRedux.QuickSearchSetCellMatchingStyle(style)),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QuickSearchRunAction } from '../../../Redux/ActionsReducers/QuickSearchRedux';
|
|
1
|
+
import { QuickSearchClearAction, QuickSearchRunAction } from '../../../Redux/ActionsReducers/QuickSearchRedux';
|
|
2
2
|
type UseQuickSearchProps = {
|
|
3
|
-
onRunQuickSearch: (quickSearchText: string) => QuickSearchRunAction;
|
|
3
|
+
onRunQuickSearch: (quickSearchText: string) => QuickSearchRunAction | QuickSearchClearAction;
|
|
4
4
|
QuickSearchText: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const useQuickSearchDebounced: (props: UseQuickSearchProps) => [string, (s: string) => void];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ColorField } from '../../components/ColorField';
|
|
4
4
|
import { clamp } from '../../Utilities/Extensions/NumberExtensions';
|
|
5
5
|
import { CheckBox } from '../../components/CheckBox';
|
|
6
6
|
import FormLayout, { FormRow } from '../../components/FormLayout';
|
|
7
7
|
import { NumberInput } from '../../components/Input/NumberInput';
|
|
8
8
|
import SimpleButton from '../../components/SimpleButton';
|
|
9
9
|
import { ButtonNew } from '../Components/Buttons/ButtonNew';
|
|
10
|
-
import {
|
|
10
|
+
import { getDefaultRangeColor, getDefaultZeroCentredColors, } from '../../Utilities/Helpers/UIHelper';
|
|
11
11
|
import { ColumnSelector } from '../Components/Selectors/ColumnSelector';
|
|
12
12
|
import { Tabs } from '../../components/Tabs';
|
|
13
13
|
import Radio from '../../components/Radio';
|
|
@@ -16,10 +16,7 @@ import { SingleSelect } from '../../components/Select';
|
|
|
16
16
|
import { InputGroup } from '../../components/InputGroup';
|
|
17
17
|
import { Icon } from '../../components/icons';
|
|
18
18
|
import HelpBlock from '../../components/HelpBlock';
|
|
19
|
-
const DEFAULT_ZERO_CENTRED_COLORS =
|
|
20
|
-
NegativeColor: 'rgba(220, 53, 69, 0.55)',
|
|
21
|
-
PositiveColor: 'rgba(40, 167, 69, 0.55)',
|
|
22
|
-
};
|
|
19
|
+
const DEFAULT_ZERO_CENTRED_COLORS = getDefaultZeroCentredColors();
|
|
23
20
|
const hasConfiguredRanges = (ranges) => (ranges?.length ?? 0) > 0;
|
|
24
21
|
function deriveInitialRangesType(props) {
|
|
25
22
|
if (props.columnComparison) {
|
|
@@ -82,7 +79,7 @@ export class RangesComponent extends React.Component {
|
|
|
82
79
|
range.Max === 'Col-Max' ||
|
|
83
80
|
(index === list.length - 1 && !isRangeValueTypeNumber), onChange: (value) => {
|
|
84
81
|
this.changeRangeMax(index, value);
|
|
85
|
-
} })] }), _jsx(
|
|
82
|
+
} })] }), _jsx(ColorField, { clearable: false, value: range.Color, onChange: (color) => {
|
|
86
83
|
this.changeRangeColor(index, color);
|
|
87
84
|
}, className: "twa:h-[33px] twa:pl-2" }), this.props.showRangeDirection && (_jsx(CheckBox, { disabled: this.props.disabled, checked: !!range.ReverseGradient, onChange: (checked) => this.changeRangeDirectionUp(index, checked), children: "Reverse Gradient" })), _jsx(SimpleButton, { icon: "delete", disabled: this.props.disabled ||
|
|
88
85
|
(!this.props.allowEmptyRanges &&
|
|
@@ -93,7 +90,7 @@ export class RangesComponent extends React.Component {
|
|
|
93
90
|
const apply = (next) => this.props.onApplyZeroCentred?.(next);
|
|
94
91
|
const minLabel = this.props.minMaxRangeValues != null ? this.props.minMaxRangeValues.min : 'column min';
|
|
95
92
|
const maxLabel = this.props.minMaxRangeValues != null ? this.props.minMaxRangeValues.max : 'column max';
|
|
96
|
-
return (_jsxs(Flex, { flexDirection: "column", "data-name": "zero-centred-ranges", children: [_jsxs(HelpBlock, { className: "twa:my-2 twa:text-3", children: [_jsx(Box, { children: "Colour cells on a diverging scale centred at zero." }), _jsx(Box, { children: "Negative values shade toward the column minimum, positive values toward the maximum \u2014 deeper as they move away from 0." })] }), _jsxs(FormLayout, { columns: ['label', 'colour'], sizes: ['200px', '1fr'], className: "twa:ml-2", children: [_jsx(FormRow, { label: `Negative (${minLabel} → 0):`, children: _jsx(Flex, { alignItems: "center", className: "twa:ml-2", children: _jsx(
|
|
93
|
+
return (_jsxs(Flex, { flexDirection: "column", "data-name": "zero-centred-ranges", children: [_jsxs(HelpBlock, { className: "twa:my-2 twa:text-3", children: [_jsx(Box, { children: "Colour cells on a diverging scale centred at zero." }), _jsx(Box, { children: "Negative values shade toward the column minimum, positive values toward the maximum \u2014 deeper as they move away from 0." })] }), _jsxs(FormLayout, { columns: ['label', 'colour'], sizes: ['200px', '1fr'], className: "twa:ml-2", children: [_jsx(FormRow, { label: `Negative (${minLabel} → 0):`, children: _jsx(Flex, { alignItems: "center", className: "twa:ml-2", children: _jsx(ColorField, { clearable: false, disabled: this.props.disabled, value: zc.NegativeColor, onChange: (color) => apply({ ...zc, NegativeColor: color }) }) }) }), _jsx(FormRow, { label: `Positive (0 → ${maxLabel}):`, children: _jsx(Flex, { alignItems: "center", className: "twa:ml-2", children: _jsx(ColorField, { clearable: false, disabled: this.props.disabled, value: zc.PositiveColor, onChange: (color) => apply({ ...zc, PositiveColor: color }) }) }) })] })] }));
|
|
97
94
|
};
|
|
98
95
|
const describeBound = (bound) => {
|
|
99
96
|
if (bound == null || bound === '') {
|
|
@@ -105,7 +102,7 @@ export class RangesComponent extends React.Component {
|
|
|
105
102
|
const friendlyName = this.props.api.columnApi.getFriendlyNameForColumnId(String(bound));
|
|
106
103
|
return (_jsxs(_Fragment, { children: [_jsx("strong", { children: friendlyName }), " ", _jsx("span", { className: "twa:opacity-60", children: "(per row)" })] }));
|
|
107
104
|
};
|
|
108
|
-
const renderColumnComparisonContent = () => (_jsxs(Flex, { flexDirection: "column", "data-name": "percent-bar-column-comparison", children: [_jsxs(HelpBlock, { className: "twa:my-2 twa:text-3", children: [_jsxs(Box, { children: ["Scale each cell's bar between a ", _jsx("strong", { children: "Minimum" }), " and a", ' ', _jsx("strong", { children: "Maximum" }), "."] }), _jsxs(Box, { children: ["Set each to a fixed ", _jsx("strong", { children: "Value" }), " (same for all rows) or a", ' ', _jsx("strong", { children: "Column" }), " (read from that column on each row)."] })] }), _jsxs(FormLayout, { columns: ['label', 'first'], sizes: ['auto', '1fr'], children: [_jsx(FormRow, { label: "Minimum:", first: _jsx(ColumnComparisonBoundInput, { disabled: this.props.disabled, value: this.props.columnComparison?.MinValue, onChange: (value) => this.setColumnComparisonMin(value) }) }), _jsx(FormRow, { label: "Maximum:", first: _jsx(ColumnComparisonBoundInput, { disabled: this.props.disabled, value: this.props.columnComparison?.MaxValue, onChange: (value) => this.setColumnComparisonMax(value) }) }), _jsx(FormRow, { label: `Bar ${this.props.api.internalApi.getCorrectEnglishVariant('Colour')}`, first: _jsx(
|
|
105
|
+
const renderColumnComparisonContent = () => (_jsxs(Flex, { flexDirection: "column", "data-name": "percent-bar-column-comparison", children: [_jsxs(HelpBlock, { className: "twa:my-2 twa:text-3", children: [_jsxs(Box, { children: ["Scale each cell's bar between a ", _jsx("strong", { children: "Minimum" }), " and a", ' ', _jsx("strong", { children: "Maximum" }), "."] }), _jsxs(Box, { children: ["Set each to a fixed ", _jsx("strong", { children: "Value" }), " (same for all rows) or a", ' ', _jsx("strong", { children: "Column" }), " (read from that column on each row)."] })] }), _jsxs(FormLayout, { columns: ['label', 'first'], sizes: ['auto', '1fr'], children: [_jsx(FormRow, { label: "Minimum:", first: _jsx(ColumnComparisonBoundInput, { disabled: this.props.disabled, value: this.props.columnComparison?.MinValue, onChange: (value) => this.setColumnComparisonMin(value) }) }), _jsx(FormRow, { label: "Maximum:", first: _jsx(ColumnComparisonBoundInput, { disabled: this.props.disabled, value: this.props.columnComparison?.MaxValue, onChange: (value) => this.setColumnComparisonMax(value) }) }), _jsx(FormRow, { label: `Bar ${this.props.api.internalApi.getCorrectEnglishVariant('Colour')}`, first: _jsx(ColorField, { clearable: false, disabled: this.props.disabled, value: comparisonColor, onChange: (color) => {
|
|
109
106
|
this.changeColumnComparisonColor(color);
|
|
110
107
|
} }) })] }), _jsxs(Box, { className: "twa:mt-2 twa:p-2 twa:text-3 twa:opacity-80", "data-name": "cc-summary", children: ["Each row's bar runs from ", describeBound(this.props.columnComparison?.MinValue), " to", ' ', describeBound(this.props.columnComparison?.MaxValue), "."] })] }, 'cc'));
|
|
111
108
|
const tabFlex = { flex: 1 };
|
|
@@ -159,7 +156,7 @@ export class RangesComponent extends React.Component {
|
|
|
159
156
|
}
|
|
160
157
|
if (value === 'ColumnComparison') {
|
|
161
158
|
const columnComparison = {
|
|
162
|
-
Color:
|
|
159
|
+
Color: getDefaultRangeColor(),
|
|
163
160
|
MinValue: undefined,
|
|
164
161
|
MaxValue: undefined,
|
|
165
162
|
};
|
|
@@ -252,7 +249,7 @@ export class RangesComponent extends React.Component {
|
|
|
252
249
|
{
|
|
253
250
|
Min: isPercentage ? 0 : 'Col-Min',
|
|
254
251
|
Max: isPercentage ? 100 : 'Col-Max',
|
|
255
|
-
Color:
|
|
252
|
+
Color: getDefaultRangeColor(),
|
|
256
253
|
},
|
|
257
254
|
]
|
|
258
255
|
: (() => {
|
|
@@ -263,12 +260,12 @@ export class RangesComponent extends React.Component {
|
|
|
263
260
|
{
|
|
264
261
|
Min: isPercentage ? 0 : 'Col-Min',
|
|
265
262
|
Max: mid,
|
|
266
|
-
Color:
|
|
263
|
+
Color: getDefaultRangeColor(),
|
|
267
264
|
},
|
|
268
265
|
{
|
|
269
266
|
Min: mid,
|
|
270
267
|
Max: isPercentage ? 100 : 'Col-Max',
|
|
271
|
-
Color:
|
|
268
|
+
Color: getDefaultRangeColor(),
|
|
272
269
|
},
|
|
273
270
|
];
|
|
274
271
|
})();
|
|
@@ -298,7 +295,7 @@ export class RangesComponent extends React.Component {
|
|
|
298
295
|
const newRange = {
|
|
299
296
|
Min,
|
|
300
297
|
Max: lastRange.Max,
|
|
301
|
-
Color:
|
|
298
|
+
Color: getDefaultRangeColor(),
|
|
302
299
|
};
|
|
303
300
|
const newRanges = [...existingRanges.slice(0, -1), previousRange, newRange];
|
|
304
301
|
this.props.updateRanges(newRanges);
|
|
@@ -311,7 +308,7 @@ export class RangesComponent extends React.Component {
|
|
|
311
308
|
}
|
|
312
309
|
return [
|
|
313
310
|
{ ...onlyRange, Max: 50 },
|
|
314
|
-
{ Min: 50, Max: 100, Color:
|
|
311
|
+
{ Min: 50, Max: 100, Color: getDefaultRangeColor() },
|
|
315
312
|
];
|
|
316
313
|
}
|
|
317
314
|
if (onlyRange.Min !== 'Col-Min' || onlyRange.Max !== 'Col-Max') {
|
|
@@ -322,7 +319,7 @@ export class RangesComponent extends React.Component {
|
|
|
322
319
|
const mid = Math.round((min + max) / 2);
|
|
323
320
|
return [
|
|
324
321
|
{ ...onlyRange, Max: mid },
|
|
325
|
-
{ Min: mid, Max: 'Col-Max', Color:
|
|
322
|
+
{ Min: mid, Max: 'Col-Max', Color: getDefaultRangeColor() },
|
|
326
323
|
];
|
|
327
324
|
}
|
|
328
325
|
setColumnComparisonMin(value) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
3
2
|
import { BadgePillStyle } from '../../../AdaptableState/StyledColumns/BadgeStyle';
|
|
4
3
|
export interface BadgePillStyleEditorProps {
|
|
5
|
-
api: AdaptableApi;
|
|
6
4
|
/** Current pill style (may be undefined / partial). */
|
|
7
5
|
value: BadgePillStyle | undefined;
|
|
8
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { ColorField } from '../../../components/ColorField';
|
|
3
3
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
4
4
|
import { Box, Flex } from '../../../components/Flex';
|
|
5
5
|
import { Toggle, ToggleGroup } from '../../../components/Toggle';
|
|
@@ -25,7 +25,7 @@ export const BadgePillStyleEditor = (props) => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
const disabledClass = disabled ? 'twa:opacity-50 twa:pointer-events-none' : '';
|
|
28
|
-
const form = (_jsxs(FormLayout, { columns: [LABEL_COLUMN, CHILD_COLUMN], sizes: ['7.5rem', '1fr'], gridColumnGap: "0.75rem", children: [_jsx(FormRow, { label: "Background", children: _jsx(
|
|
28
|
+
const form = (_jsxs(FormLayout, { columns: [LABEL_COLUMN, CHILD_COLUMN], sizes: ['7.5rem', '1fr'], gridColumnGap: "0.75rem", children: [_jsx(FormRow, { label: "Background", children: _jsx(ColorField, { disabled: disabled, value: pill.BackColor, defaultColor: "#cccccc", onChange: (c) => update({ BackColor: c }) }) }), _jsx(FormRow, { label: "Text", children: _jsx(ColorField, { disabled: disabled, value: pill.ForeColor, defaultColor: "#000000", onChange: (c) => update({ ForeColor: c }) }) }), _jsx(FormRow, { label: "Border", children: _jsx(ColorField, { disabled: disabled, value: pill.BorderColor, defaultColor: "#000000", onChange: (c) => update({ BorderColor: c }) }) }), _jsx(FormRow, { label: "Font", children: _jsx(Box, { className: disabledClass, children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2 twa:flex-wrap", children: [_jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Toggle, { standalone: true, pressed: pill.FontStyle === 'Italic', onPressedChange: (pressed) => update({ FontStyle: pressed ? 'Italic' : undefined }), icon: "italic" }), _jsx(Toggle, { standalone: true, pressed: pill.FontWeight === 'Bold', onPressedChange: (pressed) => update({ FontWeight: pressed ? 'Bold' : undefined }), icon: "bold" })] }), _jsxs(ToggleGroup, { children: [_jsx(Toggle, { pressed: pill.TextDecoration === 'Underline', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'Underline' : undefined }), icon: "underline" }), _jsx(Toggle, { pressed: pill.TextDecoration === 'LineThrough', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'LineThrough' : undefined }), icon: "strikethrough" }), _jsx(Toggle, { pressed: pill.TextDecoration === 'Overline', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'Overline' : undefined }), icon: "overline" })] })] }) }) })] }));
|
|
29
29
|
if (props.embedded) {
|
|
30
30
|
return form;
|
|
31
31
|
}
|