@adaptabletools/adaptable 24.0.0-canary.6 → 24.0.0-canary.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +36 -173
- package/package.json +1 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +6 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +83 -4
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +4 -0
- package/src/Api/Implementation/QuickSearchApiImpl.js +2 -2
- 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/StateInternalApi.js +4 -3
- package/src/Api/UserInterfaceApi.d.ts +0 -4
- package/src/Redux/ActionsReducers/QuickSearchRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +9 -0
- package/src/Redux/Store/AdaptableStore.js +4 -2
- package/src/Utilities/Helpers/UIHelper.d.ts +6 -11
- package/src/Utilities/Helpers/UIHelper.js +6 -33
- 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/Filter/ColumnFilter/ColumnFilterNew.js +14 -9
- 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 +8 -11
- 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 +4 -4
- 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 +7 -7
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +3 -3
- package/src/components/ColorField/index.d.ts +13 -0
- package/src/components/ColorField/index.js +26 -0
- package/src/components/aql/QueryBuilder/GroupEditor.js +1 -1
- package/src/components/aql/QueryBuilder/QueryBuilder.d.ts +5 -0
- package/src/components/aql/QueryBuilder/QueryBuilder.js +1 -1
- package/src/components/aql/QueryBuilder/context.d.ts +7 -0
- package/src/components/aql/QueryBuilder/context.js +3 -1
- package/src/env.js +2 -2
- package/src/migration/VersionUpgrade24.d.ts +9 -0
- package/src/migration/VersionUpgrade24.js +27 -0
- package/src/setupDevTools.js +163 -9
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/components/ColorField/index.d.ts +53 -0
- package/vendor/components/ColorField/index.d.ts.map +1 -0
- package/vendor/components/ColorField/index.js +80 -0
- package/vendor/components/ColorField/index.js.map +1 -0
- package/vendor/components/ColorPicker/colorPickerTab.d.ts +2 -2
- package/vendor/components/ColorPicker/colorPickerTab.d.ts.map +1 -1
- package/vendor/components/ColorPicker/colorPickerTab.js +6 -28
- package/vendor/components/ColorPicker/colorPickerTab.js.map +1 -1
- package/vendor/components/ColorPicker/index.d.ts +76 -9
- package/vendor/components/ColorPicker/index.d.ts.map +1 -1
- package/vendor/components/ColorPicker/index.js +217 -27
- package/vendor/components/ColorPicker/index.js.map +1 -1
- package/vendor/components/ColorPicker/themeColors.d.ts +74 -4
- package/vendor/components/ColorPicker/themeColors.d.ts.map +1 -1
- package/vendor/components/ColorPicker/themeColors.js +206 -18
- package/vendor/components/ColorPicker/themeColors.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 +73 -24
- package/vendor/components/index.d.ts +6 -2
- package/vendor/components/index.d.ts.map +1 -1
- package/vendor/components/index.js +3 -1
- package/vendor/components/index.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
|
@@ -4,7 +4,7 @@ import { CheckBox } from '../../../components/CheckBox';
|
|
|
4
4
|
import ErrorBox from '../../../components/ErrorBox';
|
|
5
5
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
6
6
|
import { Tag } from '../../../components/Tag';
|
|
7
|
-
import {
|
|
7
|
+
import { ColorField } from '../../../components/ColorField';
|
|
8
8
|
import { RangesComponent } from '../RangesComponent';
|
|
9
9
|
import { ColumnSelector } from '../../Components/Selectors/ColumnSelector';
|
|
10
10
|
import { getDefaultRangeColor } from '../../../Utilities/Helpers/UIHelper';
|
|
@@ -346,10 +346,10 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
346
346
|
{ value: 'Column', label: 'Column' },
|
|
347
347
|
{ value: 'Col-Avg', label: 'Column Average' },
|
|
348
348
|
{ value: 'Col-Median', label: 'Column Median' },
|
|
349
|
-
] }) }) }), currentMode === 'Number' && (_jsx(FormRow, { label: "Target Value:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(AdaptableInput, { type: "number", value: numericTargetValue ?? '', onChange: (e) => handleNumericTargetChange(e.target.value === '' ? undefined : Number(e.target.value)) }) }) })), currentMode === 'Column' && (_jsx(FormRow, { label: "Target Column:", children: _jsx(Box, { className: "twa:max-w-[220px]", children: _jsx(ColumnSelector, { type: "number", value: columnTargetValue ?? '', onChange: handleColumnTargetChange, filterColumn: (c) => c.columnId !== data.ColumnId, placeholder: "Select numeric column" }) }) })), currentMode !== 'None' && (_jsxs(_Fragment, { children: [_jsx(FormRow, { label: "Marker Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: marker.Shape, onValueChange: (s) => updateMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: "Marker Colour:", children: _jsx(
|
|
349
|
+
] }) }) }), currentMode === 'Number' && (_jsx(FormRow, { label: "Target Value:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(AdaptableInput, { type: "number", value: numericTargetValue ?? '', onChange: (e) => handleNumericTargetChange(e.target.value === '' ? undefined : Number(e.target.value)) }) }) })), currentMode === 'Column' && (_jsx(FormRow, { label: "Target Column:", children: _jsx(Box, { className: "twa:max-w-[220px]", children: _jsx(ColumnSelector, { type: "number", value: columnTargetValue ?? '', onChange: handleColumnTargetChange, filterColumn: (c) => c.columnId !== data.ColumnId, placeholder: "Select numeric column" }) }) })), currentMode !== 'None' && (_jsxs(_Fragment, { children: [_jsx(FormRow, { label: "Marker Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: marker.Shape, onValueChange: (s) => updateMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: "Marker Colour:", children: _jsx(ColorField, { clearable: false, disabled: disabled, value: marker.Color || undefined, onChange: (c) => updateMarker({ Color: c }) }) }), _jsx(FormRow, { label: "Marker Size:", children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: marker.Size, onChange: (e) => updateMarker({ Size: Number(e.target.value) }) }) }) })] }))] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Bar" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set the bar orientation and height" })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...BULLET_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Orientation:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: bullet.Orientation ?? 'Horizontal', onValueChange: (v) => update({ Orientation: v }), items: [
|
|
350
350
|
{ value: 'Horizontal', label: 'Horizontal' },
|
|
351
351
|
{ value: 'Vertical', label: 'Vertical' },
|
|
352
|
-
] }) }) }), bullet.Orientation === 'Vertical' && (_jsx(FormRow, { label: "", children: _jsxs(Box, { className: "twa:text-xs twa:text-neutral-500", children: ["Tip: vertical bullet charts need a tall row height to be readable (we recommend at least 60px). Set ", _jsx("code", { children: "rowHeight" }), " on ", _jsx("code", { children: " gridOptions " }), " or use", ' ', _jsx("code", { children: "getRowHeight" }), "."] }) })), _jsx(FormRow, { label: "Bar Colour:", children: _jsx(
|
|
352
|
+
] }) }) }), bullet.Orientation === 'Vertical' && (_jsx(FormRow, { label: "", children: _jsxs(Box, { className: "twa:text-xs twa:text-neutral-500", children: ["Tip: vertical bullet charts need a tall row height to be readable (we recommend at least 60px). Set ", _jsx("code", { children: "rowHeight" }), " on ", _jsx("code", { children: " gridOptions " }), " or use", ' ', _jsx("code", { children: "getRowHeight" }), "."] }) })), _jsx(FormRow, { label: "Bar Colour:", children: _jsx(ColorField, { clearable: false, disabled: disabled, value: bullet.Bar?.Color, onChange: (c) => updateBar({ Color: c }) }) }), _jsx(FormRow, { label: bullet.Orientation === 'Vertical' ? 'Bar Width (px):' : 'Bar Height (px):', children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: bullet.Bar?.Height ?? '', onChange: (e) => updateBar({
|
|
353
353
|
Height: e.target.value === '' ? undefined : Number(e.target.value),
|
|
354
354
|
}), placeholder: "8" }) }) }), _jsx(FormRow, { label: "Origin:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: typeof bullet.Origin === 'number' ? 'Number' : bullet.Origin ?? 'Auto', onValueChange: (v) => {
|
|
355
355
|
if (v === 'Auto' || v === 'Zero') {
|
|
@@ -361,7 +361,7 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
361
361
|
}, items: [
|
|
362
362
|
{ value: 'Auto', label: 'Auto' },
|
|
363
363
|
{ value: 'Zero', label: 'Zero' },
|
|
364
|
-
] }) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Text" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Pick which values to display and where each one sits around the bar" })] }), _jsxs(Card.Body, { children: [_jsx(FormLayout, { sizes: [...BULLET_STYLE_FORM_SIZES], children: _jsx(BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: cellTextProperties, onToggle: toggleCellText, onPlacementChange: onCellTextPlacementChange }) }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, {
|
|
364
|
+
] }) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Text" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Pick which values to display and where each one sits around the bar" })] }), _jsxs(Card.Body, { children: [_jsx(FormLayout, { sizes: [...BULLET_STYLE_FORM_SIZES], children: _jsx(BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: cellTextProperties, onToggle: toggleCellText, onPlacementChange: onCellTextPlacementChange }) }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, { disabled: cellTextDisabled, value: bullet.Font, onChange: (next) => {
|
|
365
365
|
if (next) {
|
|
366
366
|
update({ Font: next });
|
|
367
367
|
}
|
|
@@ -51,7 +51,7 @@ export const renderStyledColumnGradientStyleSummary = (data) => {
|
|
|
51
51
|
return renderSummaryStringTags(items);
|
|
52
52
|
};
|
|
53
53
|
export const StyledColumnWizardGradientSection = (props) => {
|
|
54
|
-
const { data
|
|
54
|
+
const { data } = useOnePageAdaptableWizardContext();
|
|
55
55
|
const gs = data.GradientStyle ?? {};
|
|
56
56
|
const disabled = !data.ColumnId;
|
|
57
57
|
const onFontChange = (next) => {
|
|
@@ -106,5 +106,5 @@ export const StyledColumnWizardGradientSection = (props) => {
|
|
|
106
106
|
else {
|
|
107
107
|
patchGradient({ AutoContrastText: true });
|
|
108
108
|
}
|
|
109
|
-
}, children: "Make text readable on tinted backgrounds" }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[600px]", children: "Set Tooltip properties" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Box, { className: "twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: gs.ToolTipText?.includes('CellValue'), onChange: (checked) => onToolTipTextChanged('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: gs.ToolTipText?.includes('PercentageValue'), onChange: (checked) => onToolTipTextChanged('PercentageValue', checked), children: "Percent along scale" })] }) }) }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Font" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[480px]", children: "Optional font properties (takes precedence over Format Column)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnFontStyleEditor, {
|
|
109
|
+
}, children: "Make text readable on tinted backgrounds" }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[600px]", children: "Set Tooltip properties" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Box, { className: "twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: gs.ToolTipText?.includes('CellValue'), onChange: (checked) => onToolTipTextChanged('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: gs.ToolTipText?.includes('PercentageValue'), onChange: (checked) => onToolTipTextChanged('PercentageValue', checked), children: "Percent along scale" })] }) }) }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Font" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[480px]", children: "Optional font properties (takes precedence over Format Column)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnFontStyleEditor, { disabled: disabled, value: gs.Font, onChange: onFontChange }) })] }), !data.ColumnId && (_jsx(ErrorBox, { className: "twa:mt-2", children: "Select a column before changing Gradient style." }))] }));
|
|
110
110
|
};
|
|
@@ -161,7 +161,7 @@ export const isValidIconStyleMappings = (data) => {
|
|
|
161
161
|
return true;
|
|
162
162
|
};
|
|
163
163
|
export const StyledColumnWizardIconSection = (props) => {
|
|
164
|
-
const { data
|
|
164
|
+
const { data } = useOnePageAdaptableWizardContext();
|
|
165
165
|
const iconStyle = data.IconStyle ?? {};
|
|
166
166
|
const mappings = iconStyle.Mappings ?? [];
|
|
167
167
|
const disabled = !data.ColumnId;
|
|
@@ -299,7 +299,7 @@ export const StyledColumnWizardIconSection = (props) => {
|
|
|
299
299
|
{ value: 'After', label: 'After' },
|
|
300
300
|
{ value: 'Above', label: 'Above' },
|
|
301
301
|
{ value: 'Below', label: 'Below' },
|
|
302
|
-
] }) }) })] }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, {
|
|
302
|
+
] }) }) })] }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, { disabled: disabled || cellTextDisabled, value: iconStyle.Font, onChange: onFontChange }) })] })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose whether and how to display a tooltip" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { checked: toolTipText.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { className: "twa:ml-3", checked: toolTipText.includes('IconDescription'), onChange: (checked) => toggleToolTipText('IconDescription', checked), children: "Description" })] }) }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional cell box styling (overrides Format Column properties)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnCellStyleEditor, { disabled: disabled, value: iconStyle.Cell, onChange: onCellChange }) })] })] }));
|
|
303
303
|
};
|
|
304
304
|
const ICON_KIND_OPTIONS = [
|
|
305
305
|
{ value: 'Emoji', label: 'Emoji' },
|
|
@@ -5,10 +5,10 @@ import ErrorBox from '../../../components/ErrorBox';
|
|
|
5
5
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
6
6
|
import { Tag } from '../../../components/Tag';
|
|
7
7
|
import { InputGroup } from '../../../components/InputGroup';
|
|
8
|
-
import {
|
|
8
|
+
import { ColorField } from '../../../components/ColorField';
|
|
9
9
|
import { RangesComponent } from '../RangesComponent';
|
|
10
10
|
import { ColumnSelector } from '../../Components/Selectors/ColumnSelector';
|
|
11
|
-
import { getDefaultRangeColor } from '../../../Utilities/Helpers/UIHelper';
|
|
11
|
+
import { getDefaultRangeColor, themeColorVar } from '../../../Utilities/Helpers/UIHelper';
|
|
12
12
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
13
13
|
import AdaptableInput from '../../Components/AdaptableInput';
|
|
14
14
|
import { Box, Flex } from '../../../components/Flex';
|
|
@@ -419,18 +419,18 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
419
419
|
field: 'Reference',
|
|
420
420
|
optional: true,
|
|
421
421
|
fallbackNumber: minMaxRangeValues?.max ?? 0,
|
|
422
|
-
})] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Ranges" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-700px]", children: ["Optional coloured segments drawn ", _jsx("em", { children: "behind" }), " track to form qualitative scale;leave empty for a plain track"] })] }), _jsx(Card.Body, { children: _jsx(RangesComponent, { allowEmptyRanges: true, disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, ranges: range.CellRanges ?? [], rangeValueType: range.RangeValueType, onRangeValueTypeChange: onRangeValueTypeChange, columnComparison: range.ColumnComparison, updateRanges: onUpdateRanges, updateColumnComparison: onUpdateColumnComparison, hideColumnComparison: true }) })] })] })), !isRangeVariant && (_jsxs(_Fragment, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Value Marker" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Drawn at the cell value's position along the track." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: valueMarker.Shape, onValueChange: (s) => updateValueMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(
|
|
422
|
+
})] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Ranges" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-700px]", children: ["Optional coloured segments drawn ", _jsx("em", { children: "behind" }), " track to form qualitative scale;leave empty for a plain track"] })] }), _jsx(Card.Body, { children: _jsx(RangesComponent, { allowEmptyRanges: true, disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, ranges: range.CellRanges ?? [], rangeValueType: range.RangeValueType, onRangeValueTypeChange: onRangeValueTypeChange, columnComparison: range.ColumnComparison, updateRanges: onUpdateRanges, updateColumnComparison: onUpdateColumnComparison, hideColumnComparison: true }) })] })] })), !isRangeVariant && (_jsxs(_Fragment, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Value Marker" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Drawn at the cell value's position along the track." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: valueMarker.Shape, onValueChange: (s) => updateValueMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorField, { clearable: false, disabled: disabled, value: valueMarker.Color || undefined, onChange: (c) => updateValueMarker({ Color: c }) }) }), _jsx(FormRow, { label: "Size:", children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: valueMarker.Size, onChange: (e) => updateValueMarker({ Size: Number(e.target.value) }) }) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Reference Marker" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: hasReference
|
|
423
423
|
? 'Drawn at the Reference value (e.g. previous close, target, midpoint).'
|
|
424
|
-
: 'Optional second marker when a Reference bound is set on the Style step.' })] }), _jsx(Card.Body, { children: hasReference ? (_jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: referenceMarker.Shape, onValueChange: (s) => updateReferenceMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(
|
|
424
|
+
: 'Optional second marker when a Reference bound is set on the Style step.' })] }), _jsx(Card.Body, { children: hasReference ? (_jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: referenceMarker.Shape, onValueChange: (s) => updateReferenceMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorField, { clearable: false, disabled: disabled, value: referenceMarker.Color || undefined, onChange: (c) => updateReferenceMarker({ Color: c }) }) }), _jsx(FormRow, { label: "Size:", children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: referenceMarker.Size, onChange: (e) => updateReferenceMarker({ Size: Number(e.target.value) }) }) }) })] })) : (_jsx(Box, { className: "twa:text-xs twa:opacity-60 twa:max-w-[520px]", children: "Add a Reference value on the Style step (Bounds section) to enable this marker (e.g. previous close, target, midpoint)." })) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Track" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "The line representing the [Min, Max] interval, plus optional cell background." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Orientation:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: range.Orientation ?? 'Horizontal', onValueChange: (v) => update({ Orientation: v }), items: [
|
|
425
425
|
{ value: 'Horizontal', label: 'Horizontal' },
|
|
426
426
|
{ value: 'Vertical', label: 'Vertical' },
|
|
427
|
-
] }) }) }), range.Orientation === 'Vertical' && (_jsx(FormRow, { label: "", children: _jsxs(Box, { className: "twa:text-xs twa:text-neutral-500 twa:max-w-[520px]", children: ["Tip: vertical Range Bars need a tall row height to be readable (we recommend at least 60px). Set ", _jsx("code", { children: "rowHeight" }), " on ", _jsx("code", { children: " gridOptions " }), " or use ", _jsx("code", { children: "getRowHeight" }), "."] }) })), _jsx(FormRow, { label: `Track ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(
|
|
427
|
+
] }) }) }), range.Orientation === 'Vertical' && (_jsx(FormRow, { label: "", children: _jsxs(Box, { className: "twa:text-xs twa:text-neutral-500 twa:max-w-[520px]", children: ["Tip: vertical Range Bars need a tall row height to be readable (we recommend at least 60px). Set ", _jsx("code", { children: "rowHeight" }), " on ", _jsx("code", { children: " gridOptions " }), " or use ", _jsx("code", { children: "getRowHeight" }), "."] }) })), _jsx(FormRow, { label: `Track ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorField, { disabled: disabled, value: range.Track?.Color, defaultColor: getDefaultRangeColor(), onChange: (c) => updateTrackProperties({ Color: c }) }) }), _jsx(FormRow, { label: range.Orientation === 'Vertical' ? 'Track Width (px):' : 'Track Height (px):', children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: range.Track?.Height ?? '', onChange: (e) => updateTrackProperties({
|
|
428
428
|
Height: e.target.value === '' ? undefined : Number(e.target.value),
|
|
429
|
-
}), placeholder: "4" }) }) }), _jsx(FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(
|
|
429
|
+
}), placeholder: "4" }) }) }), _jsx(FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorField, { disabled: disabled, value: range.BackColor ?? undefined, defaultColor: getDefaultRangeColor(), onChange: (c) => updateBackColor(c) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Out of Range" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "How to draw the value marker when the cell value falls outside [Min, Max]." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Behaviour:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: outOfRangeMode, onValueChange: (v) => updateOutOfRangeProperties({
|
|
430
430
|
Mode: v,
|
|
431
431
|
}), items: [
|
|
432
432
|
{ value: 'Clamp', label: 'Clamp to edge' },
|
|
433
433
|
{ value: 'Overflow', label: 'Show outside' },
|
|
434
434
|
{ value: 'Hide', label: 'Hide marker' },
|
|
435
|
-
] }) }) }), outOfRangeMode === 'Clamp' && (_jsx(FormRow, { label: `Out-of-range ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(
|
|
435
|
+
] }) }) }), outOfRangeMode === 'Clamp' && (_jsx(FormRow, { label: `Out-of-range ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorField, { disabled: disabled, value: range.OutOfRange?.Color, defaultColor: themeColorVar('destructive'), onChange: (c) => updateOutOfRangeProperties({ Color: c }) }) }))] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Text & Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional cell-text overlay and AG Grid tooltip content." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: range.CellTextProperties, onToggle: toggleCellText, onPlacementChange: onCellTextPlacementChange }), _jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] })] }))] }));
|
|
436
436
|
};
|
|
@@ -3,7 +3,7 @@ import { CheckBox } from '../../../components/CheckBox';
|
|
|
3
3
|
import ErrorBox from '../../../components/ErrorBox';
|
|
4
4
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
5
5
|
import { Tag } from '../../../components/Tag';
|
|
6
|
-
import {
|
|
6
|
+
import { ColorField } from '../../../components/ColorField';
|
|
7
7
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
8
8
|
import { Box, Flex } from '../../../components/Flex';
|
|
9
9
|
import { SingleSelect } from '../../../components/Select';
|
|
@@ -112,7 +112,7 @@ export const isValidRatingStyle = (data) => {
|
|
|
112
112
|
return true;
|
|
113
113
|
};
|
|
114
114
|
export const StyledColumnWizardRatingSection = (props) => {
|
|
115
|
-
const { data
|
|
115
|
+
const { data } = useOnePageAdaptableWizardContext();
|
|
116
116
|
const rating = data.RatingStyle ?? {};
|
|
117
117
|
const disabled = !data.ColumnId;
|
|
118
118
|
if (!data.ColumnId) {
|
|
@@ -141,7 +141,7 @@ export const StyledColumnWizardRatingSection = (props) => {
|
|
|
141
141
|
update({
|
|
142
142
|
Max: Number.isFinite(parsed) && parsed >= 1 ? Math.floor(parsed) : undefined,
|
|
143
143
|
});
|
|
144
|
-
} }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Icon count and rating cap (no auto scaling is applied)" })] }) }), _jsx(FormRow, { label: "Icon:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: rating.Icon ?? DEFAULT_RATING_ICON, onValueChange: (v) => update({ Icon: v }), items: ICON_CHOICES }) }) }), _jsx(FormRow, { label: "Filled Colour:", children: _jsx(
|
|
144
|
+
} }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Icon count and rating cap (no auto scaling is applied)" })] }) }), _jsx(FormRow, { label: "Icon:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: rating.Icon ?? DEFAULT_RATING_ICON, onValueChange: (v) => update({ Icon: v }), items: ICON_CHOICES }) }) }), _jsx(FormRow, { label: "Filled Colour:", children: _jsx(ColorField, { clearable: false, disabled: disabled, value: getDisplayedFilledColor(rating), onChange: (c) => update({ FilledColor: c }) }) }), _jsx(FormRow, { label: "Empty Colour:", children: _jsx(ColorField, { clearable: false, disabled: disabled, value: getDisplayedEmptyColor(rating), onChange: (c) => update({ EmptyColor: c }) }) }), _jsx(FormRow, { label: "Icon Size (px):", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Input, { type: "number", min: 4, step: 1, value: rating.Size ?? '', placeholder: String(DEFAULT_RATING_SIZE), style: { width: 80 }, onChange: (event) => {
|
|
145
145
|
const raw = event.target.value;
|
|
146
146
|
if (raw === '' || raw == null) {
|
|
147
147
|
update({ Size: undefined });
|
|
@@ -161,7 +161,7 @@ export const StyledColumnWizardRatingSection = (props) => {
|
|
|
161
161
|
update({
|
|
162
162
|
Gap: Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined,
|
|
163
163
|
});
|
|
164
|
-
} }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Pixel space between adjacent icons" })] }) }), _jsx(FormRow, { label: "Allow Half Icons:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.AllowHalf ?? true, onChange: (checked) => update({ AllowHalf: checked }), children: "Render fractional values as a partial icon (e.g. 3.5 \u2192 \u2605\u2605\u2605\u00BD\u2606)" }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsx(Card.Title, { children: "Text" }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Show Value:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.ShowValue ?? false, onChange: (checked) => update({ ShowValue: checked }), children: "Display the numeric value beside the icons" }) }), _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Flex, { flexDirection: "column", className: "twa:gap-1 twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('CellValue') ?? false, onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), _jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('PercentageValue') ?? false, onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percentage Value (value \u00F7 Max)" })] }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[500px]", children: "Optional Cell Style properties overrides Format Column properties)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnCellStyleEditor, {
|
|
164
|
+
} }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Pixel space between adjacent icons" })] }) }), _jsx(FormRow, { label: "Allow Half Icons:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.AllowHalf ?? true, onChange: (checked) => update({ AllowHalf: checked }), children: "Render fractional values as a partial icon (e.g. 3.5 \u2192 \u2605\u2605\u2605\u00BD\u2606)" }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsx(Card.Title, { children: "Text" }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Show Value:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.ShowValue ?? false, onChange: (checked) => update({ ShowValue: checked }), children: "Display the numeric value beside the icons" }) }), _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Flex, { flexDirection: "column", className: "twa:gap-1 twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('CellValue') ?? false, onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), _jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('PercentageValue') ?? false, onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percentage Value (value \u00F7 Max)" })] }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[500px]", children: "Optional Cell Style properties overrides Format Column properties)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnCellStyleEditor, { disabled: disabled, value: rating.Cell, onChange: (next) => {
|
|
165
165
|
if (next) {
|
|
166
166
|
update({ Cell: next });
|
|
167
167
|
}
|
|
@@ -5,7 +5,7 @@ import FormLayout, { FormRow } from '../../../../components/FormLayout';
|
|
|
5
5
|
import { Tag } from '../../../../components/Tag';
|
|
6
6
|
import { formatBarStyleCellTextLayoutSummary, getActiveBarStyleCellTextTokens, hasBarStyleCellTextConfigured, patchBarStyleCellTextPlacement, resolveBarStyleCellTextLayout, toggleBarStyleCellTextToken, } from '../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
7
7
|
import { BarStyleCellTextLayoutEditor } from './Components/BarStyleCellTextLayoutEditor';
|
|
8
|
-
import {
|
|
8
|
+
import { ColorField } from '../../../../components/ColorField';
|
|
9
9
|
import { getDefaultRangeColor } from '../../../../Utilities/Helpers/UIHelper';
|
|
10
10
|
import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
|
|
11
11
|
import { Box, Flex } from '../../../../components/Flex';
|
|
@@ -136,7 +136,7 @@ export const StyledColumnWizardStyleSection = (props) => {
|
|
|
136
136
|
const currentOrigin = typeof pb.Origin === 'number'
|
|
137
137
|
? 'Min'
|
|
138
138
|
: pb.Origin ?? 'Auto';
|
|
139
|
-
return (_jsxs(Box, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Bar Position" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set the position of the cell text relative to the bar" })] }), _jsx(Card.Body, { children: _jsx(RadioGroup, { orientation: "vertical", name: "ab-percentbar-origin", value: currentOrigin, onRadioChange: handleOriginChange, children: ORIGIN_CHOICES.map((choice) => (_jsx(Radio, { value: choice.value, disabled: disabled, children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:min-w-[60px]", children: choice.label }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: choice.hint })] }) }, choice.value))) }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Text" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[540px]", children: "Pick which values to display and where each one sits around the bar (font properties take precedence over Format Column)" })] }), _jsxs(Card.Body, { children: [_jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsx(BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: cellTextProperties, onToggle: onCellTextLayoutToggle, onPlacementChange: onCellTextPlacementChange }) }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, {
|
|
139
|
+
return (_jsxs(Box, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Bar Position" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set the position of the cell text relative to the bar" })] }), _jsx(Card.Body, { children: _jsx(RadioGroup, { orientation: "vertical", name: "ab-percentbar-origin", value: currentOrigin, onRadioChange: handleOriginChange, children: ORIGIN_CHOICES.map((choice) => (_jsx(Radio, { value: choice.value, disabled: disabled, children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:min-w-[60px]", children: choice.label }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: choice.hint })] }) }, choice.value))) }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Text" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[540px]", children: "Pick which values to display and where each one sits around the bar (font properties take precedence over Format Column)" })] }), _jsxs(Card.Body, { children: [_jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsx(BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: cellTextProperties, onToggle: onCellTextLayoutToggle, onPlacementChange: onCellTextPlacementChange }) }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, { disabled: cellTextDisabled, value: pb.Font, onChange: (next) => {
|
|
140
140
|
if (next) {
|
|
141
141
|
update({ Font: next });
|
|
142
142
|
}
|
|
@@ -145,5 +145,5 @@ export const StyledColumnWizardStyleSection = (props) => {
|
|
|
145
145
|
delete cleaned.Font;
|
|
146
146
|
props.onChange({ ...data, PercentBarStyle: cleaned });
|
|
147
147
|
}
|
|
148
|
-
} }) })] })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Style" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure Tooltip and Background Colour" })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { disabled: disabled, checked: pb.ToolTipText?.includes('CellValue'), onChange: (checked) => onToolTipTextChanged('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: pb.ToolTipText?.includes('PercentageValue'), onChange: (checked) => onToolTipTextChanged('PercentageValue', checked), children: "Percent Value" })] }), _jsx(FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(
|
|
148
|
+
} }) })] })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Style" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure Tooltip and Background Colour" })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { disabled: disabled, checked: pb.ToolTipText?.includes('CellValue'), onChange: (checked) => onToolTipTextChanged('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: pb.ToolTipText?.includes('PercentageValue'), onChange: (checked) => onToolTipTextChanged('PercentageValue', checked), children: "Percent Value" })] }), _jsx(FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorField, { disabled: disabled, value: pb.BackColor ?? undefined, defaultColor: getDefaultRangeColor(), onChange: onBackColorChange }) })] }) })] })] }));
|
|
149
149
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ColorFieldProps as SharedColorFieldProps } from "../../../vendor/components/ColorField";
|
|
2
|
+
export type ColorFieldProps = Omit<SharedColorFieldProps, 'onChange' | 'clearable' | 'data-name' | 'filterColours'> & {
|
|
3
|
+
'data-name'?: string;
|
|
4
|
+
} & ({
|
|
5
|
+
clearable?: true;
|
|
6
|
+
onChange: (color: string | undefined) => void;
|
|
7
|
+
} | {
|
|
8
|
+
/** The colour is required, so there is no clear button and `onChange` always gets one. */
|
|
9
|
+
clearable: false;
|
|
10
|
+
onChange: (color: string) => void;
|
|
11
|
+
});
|
|
12
|
+
/** The shared colour field with AdapTable's defaults. */
|
|
13
|
+
export declare const ColorField: (props: ColorFieldProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ColorField as SharedColorField, } from "../../../vendor/components/ColorField";
|
|
3
|
+
import { useAdaptable } from '../../View/AdaptableContext';
|
|
4
|
+
import { useOnePageAdaptableWizardContext } from '../../View/Wizard/OnePageAdaptableWizard';
|
|
5
|
+
function useEditedModule() {
|
|
6
|
+
const wizard = useOnePageAdaptableWizardContext();
|
|
7
|
+
const adaptable = useAdaptable();
|
|
8
|
+
const fromWizard = wizard.moduleInfo?.ModuleName;
|
|
9
|
+
if (fromWizard) {
|
|
10
|
+
return fromWizard;
|
|
11
|
+
}
|
|
12
|
+
const screenPopup = adaptable?.adaptableStore?.TheStore.getState().Popup.ScreenPopup;
|
|
13
|
+
return screenPopup?.ShowScreenPopup ? screenPopup.ComponentModule : undefined;
|
|
14
|
+
}
|
|
15
|
+
const DEFAULT_TABS = ['Custom', 'Palette'];
|
|
16
|
+
const showAllColours = () => undefined;
|
|
17
|
+
export const ColorField = (props) => {
|
|
18
|
+
const adaptable = useAdaptable();
|
|
19
|
+
const module = useEditedModule();
|
|
20
|
+
const paletteOptions = adaptable?.api.optionsApi.getUserInterfaceOptions().colourPickerOptions;
|
|
21
|
+
const filterColours = paletteOptions?.filterColours;
|
|
22
|
+
const { onChange, tabs, orderPaletteColours, removeDuplicates, showGroupLabels, 'data-name': dataName = 'color-field', ...rest } = props;
|
|
23
|
+
return (_jsx(SharedColorField, { ...rest, "data-name": dataName, tabs: tabs ?? paletteOptions?.tabs ?? DEFAULT_TABS, orderPaletteColours: orderPaletteColours ?? paletteOptions?.orderPaletteColours, removeDuplicates: removeDuplicates ?? paletteOptions?.removeDuplicates, showGroupLabels: showGroupLabels ?? paletteOptions?.showGroupLabels, filterColours: filterColours
|
|
24
|
+
? (colours) => filterColours({ ...colours, module })
|
|
25
|
+
: showAllColours, onChange: onChange }));
|
|
26
|
+
};
|
|
@@ -31,7 +31,7 @@ export const GroupEditor = ({ node, path, isRoot, dispatch, hideDelete, }) => {
|
|
|
31
31
|
};
|
|
32
32
|
return (_jsxs(Box, { className: cn('ab-QueryBuilder__group twa:my-1', !isRoot &&
|
|
33
33
|
'twa:pl-3 twa:border-l twa:rounded-md twa:py-1 twa:pr-1 ' +
|
|
34
|
-
'twa:bg-(--ab-cmp-query-builder-group__background)'), children: [showHeader && (_jsxs(Flex, { alignItems: "center", className: "twa:gap-2 twa:my-1", children: [showCombinator && (_jsx(CombinatorSelector, { value: node.combinator, onChange: (combinator) => dispatch({ type: 'setCombinator', groupPath: path, combinator }) })), _jsx(Box, { className: "twa:flex-1" }), showGroupDelete && (_jsx(RowActions, { rail: qb.hideInlineAdd ? 'compact' : 'full', hideAdd: true, onDelete: () => dispatch({ type: 'delete', path }) }))] })), isEmpty ? (_jsx(PrimitiveEditor, { node: emptyQlPrimitive(), path: [...path, 0], dispatch: seedDispatch, hideAdd: true, hideDelete: true })) : (_jsxs(_Fragment, { children: [hideDragHandles ? (_jsx("div", { className: "ab-QueryBuilder__group-children", children: node.children.map((child, index) => (_jsx(Flex, { className: "ab-QueryBuilder__row", alignItems: "center", children: _jsx(Box, { className: "ab-QueryBuilder__row-body twa:flex-1 twa:min-w-0", children: _jsx(NodeEditor, { node: child, path: [...path, index], dispatch: dispatch }) }) }, `${listId}/${index}`))) })) : (_jsx(DragList, { dragListId: listId, orientation: "vertical", onDrop: handleDrop, onDragProxyMove: defaultDragProxyMove, children: (listDomProps) => (_jsx("div", { ...listDomProps, className: cn('ab-QueryBuilder__group-children', listDomProps.className), children: node.children.map((child, index) => {
|
|
34
|
+
'twa:bg-(--ab-cmp-query-builder-group__background)'), children: [showHeader && (_jsxs(Flex, { alignItems: "center", className: "twa:gap-2 twa:my-1 twa:w-full", children: [showCombinator && (_jsx(CombinatorSelector, { value: node.combinator, onChange: (combinator) => dispatch({ type: 'setCombinator', groupPath: path, combinator }) })), _jsx(Box, { className: "twa:flex-1" }), showGroupDelete && (_jsx(RowActions, { rail: qb.hideInlineAdd ? 'compact' : 'full', hideAdd: true, onDelete: () => dispatch({ type: 'delete', path }) })), isRoot && showCombinator && qb.rootHeaderEnd] })), isEmpty ? (_jsx(PrimitiveEditor, { node: emptyQlPrimitive(), path: [...path, 0], dispatch: seedDispatch, hideAdd: true, hideDelete: true })) : (_jsxs(_Fragment, { children: [hideDragHandles ? (_jsx("div", { className: "ab-QueryBuilder__group-children", children: node.children.map((child, index) => (_jsx(Flex, { className: "ab-QueryBuilder__row", alignItems: "center", children: _jsx(Box, { className: "ab-QueryBuilder__row-body twa:flex-1 twa:min-w-0", children: _jsx(NodeEditor, { node: child, path: [...path, index], dispatch: dispatch }) }) }, `${listId}/${index}`))) })) : (_jsx(DragList, { dragListId: listId, orientation: "vertical", onDrop: handleDrop, onDragProxyMove: defaultDragProxyMove, children: (listDomProps) => (_jsx("div", { ...listDomProps, className: cn('ab-QueryBuilder__group-children', listDomProps.className), children: node.children.map((child, index) => {
|
|
35
35
|
const childId = `${listId}/${index}`;
|
|
36
36
|
return (_jsx(DragList.DraggableItem, { id: childId, children: (itemDomProps) => {
|
|
37
37
|
const { onPointerDown, ...rest } = itemDomProps;
|
|
@@ -88,5 +88,10 @@ export interface QueryBuilderProps {
|
|
|
88
88
|
* @defaultValue 'auto'
|
|
89
89
|
*/
|
|
90
90
|
layout?: QueryBuilderLayoutMode;
|
|
91
|
+
/**
|
|
92
|
+
* Extra control on the right of the root AND/OR row, once there are
|
|
93
|
+
* two or more conditions. Hidden while the editor has a single condition.
|
|
94
|
+
*/
|
|
95
|
+
rootHeaderEnd?: React.ReactNode;
|
|
91
96
|
}
|
|
92
97
|
export declare const QueryBuilder: React.FunctionComponent<QueryBuilderProps>;
|
|
@@ -104,7 +104,7 @@ export const QueryBuilder = (props) => {
|
|
|
104
104
|
: 'query-builder2-invalid-expression', className: "twa:my-2 twa:w-full twa:max-w-full twa:text-2 twa:leading-snug twa:bg-background twa:text-foreground", children: _jsxs(Flex, { flexDirection: "column", className: "twa:gap-3", alignItems: "flex-start", children: [_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsx(Box, { children: primaryLine }), typeMismatchMessages.map((message) => (_jsx(Box, { children: message }, message))), _jsx(Box, { children: "Please edit the Expression in the Expression Editor." })] }), clearExpressionButton] }) }));
|
|
105
105
|
}
|
|
106
106
|
else if (!isQlPredicateError(root) && isQlGroup(root)) {
|
|
107
|
-
body = (_jsx(QueryBuilderProvider, { module: props.module, columnScope: props.columnScope, getColumns: props.getColumns, getFields: props.getFields, subject: props.subject, hideInlineAdd: props.hideInlineAdd ?? true, hideAddGroup: props.hideAddGroup, hideLockedSubject: props.hideLockedSubject, hideDragHandles: props.hideDragHandles, layout: props.layout ?? 'auto', children: props.hideDragHandles ? (_jsx(Box, { "data-name": "query-builder2-editor", className: "twa:my-2", children: _jsx(NodeEditor, { node: root, path: [], isRoot: true, dispatch: dispatch }) })) : (_jsx(DragDropProvider, { children: _jsx(Box, { "data-name": "query-builder2-editor", className: "twa:my-2", children: _jsx(NodeEditor, { node: root, path: [], isRoot: true, dispatch: dispatch }) }) })) }));
|
|
107
|
+
body = (_jsx(QueryBuilderProvider, { module: props.module, columnScope: props.columnScope, getColumns: props.getColumns, getFields: props.getFields, subject: props.subject, hideInlineAdd: props.hideInlineAdd ?? true, hideAddGroup: props.hideAddGroup, hideLockedSubject: props.hideLockedSubject, hideDragHandles: props.hideDragHandles, layout: props.layout ?? 'auto', rootHeaderEnd: props.rootHeaderEnd, children: props.hideDragHandles ? (_jsx(Box, { "data-name": "query-builder2-editor", className: "twa:my-2", children: _jsx(NodeEditor, { node: root, path: [], isRoot: true, dispatch: dispatch }) })) : (_jsx(DragDropProvider, { children: _jsx(Box, { "data-name": "query-builder2-editor", className: "twa:my-2", children: _jsx(NodeEditor, { node: root, path: [], isRoot: true, dispatch: dispatch }) }) })) }));
|
|
108
108
|
}
|
|
109
109
|
return (_jsxs(Box, { className: twMerge(QUERY_BUILDER_CLASSNAME, QUERY_BUILDER_LAYOUT_CLASS[props.layout ?? 'auto']), children: [body, !props.hideExpressionPreview && (_jsxs(Card, { shadow: false, className: "twa:mt-12", children: [_jsxs(Card.Title, { className: "twa:justify-between twa:gap-2", children: [_jsxs(Flex, { flexDirection: "column", className: "twa:min-w-0 twa:gap-0.5", children: [_jsx(Box, { className: "twa:font-medium", children: "Output Expression" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal", children: cannotDisplayInQueryBuilder
|
|
110
110
|
? 'Readonly view of the current Expression'
|
|
@@ -109,6 +109,12 @@ export interface QueryBuilderContextValue {
|
|
|
109
109
|
* narrow (container query).
|
|
110
110
|
*/
|
|
111
111
|
layout?: QueryBuilderLayoutMode;
|
|
112
|
+
/**
|
|
113
|
+
* Extra control rendered on the right of the root group's AND/OR row.
|
|
114
|
+
* Shown only once that row exists (≥2 conditions). Used by the column
|
|
115
|
+
* filter popups for Clear All.
|
|
116
|
+
*/
|
|
117
|
+
rootHeaderEnd?: React.ReactNode;
|
|
112
118
|
}
|
|
113
119
|
export declare const useQueryBuilder: () => QueryBuilderContextValue;
|
|
114
120
|
export interface QueryBuilderProviderProps {
|
|
@@ -123,6 +129,7 @@ export interface QueryBuilderProviderProps {
|
|
|
123
129
|
hideLockedSubject?: boolean;
|
|
124
130
|
hideDragHandles?: boolean;
|
|
125
131
|
layout?: QueryBuilderLayoutMode;
|
|
132
|
+
rootHeaderEnd?: React.ReactNode;
|
|
126
133
|
children: React.ReactNode;
|
|
127
134
|
}
|
|
128
135
|
/**
|
|
@@ -11,7 +11,7 @@ export const useQueryBuilder = () => {
|
|
|
11
11
|
}
|
|
12
12
|
return context;
|
|
13
13
|
};
|
|
14
|
-
export const QueryBuilderProvider = ({ module, columnScope, getColumns, getFields, subject, hideInlineAdd, hideAddGroup, hideLockedSubject, hideDragHandles, layout = 'auto', children, }) => {
|
|
14
|
+
export const QueryBuilderProvider = ({ module, columnScope, getColumns, getFields, subject, hideInlineAdd, hideAddGroup, hideLockedSubject, hideDragHandles, layout = 'auto', rootHeaderEnd, children, }) => {
|
|
15
15
|
const adaptable = useAdaptable();
|
|
16
16
|
const api = adaptable.api;
|
|
17
17
|
const lockedSubject = React.useMemo(() => {
|
|
@@ -72,6 +72,7 @@ export const QueryBuilderProvider = ({ module, columnScope, getColumns, getField
|
|
|
72
72
|
hideLockedSubject,
|
|
73
73
|
hideDragHandles,
|
|
74
74
|
layout,
|
|
75
|
+
rootHeaderEnd,
|
|
75
76
|
};
|
|
76
77
|
}, [
|
|
77
78
|
module,
|
|
@@ -88,6 +89,7 @@ export const QueryBuilderProvider = ({ module, columnScope, getColumns, getField
|
|
|
88
89
|
hideLockedSubject,
|
|
89
90
|
hideDragHandles,
|
|
90
91
|
layout,
|
|
92
|
+
rootHeaderEnd,
|
|
91
93
|
]);
|
|
92
94
|
return _jsx(QueryBuilderContext.Provider, { value: value, children: children });
|
|
93
95
|
};
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "24.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1792792969512 || Date.now(),
|
|
4
|
+
VERSION: "24.0.0-canary.8" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -33,6 +33,8 @@ import type { MigrationLogger } from './AdaptableUpgradeHelper';
|
|
|
33
33
|
* `Type: 'Change'` when missing
|
|
34
34
|
* 16. {@link migrateLayoutTagsToRegistry} — Layout extensions held in object Tags
|
|
35
35
|
* (`layoutTagOptions.autoCheckTagsForLayouts`) → `Layout.LayoutExtensions`
|
|
36
|
+
* 17. {@link VersionUpgrade24.migrateSwatchColorVars} — `--ab-color-swatch-N`
|
|
37
|
+
* colours → `--ab-color-palette-{N+12}`
|
|
36
38
|
*/
|
|
37
39
|
export declare class VersionUpgrade24 extends VersionUpgrade {
|
|
38
40
|
private options;
|
|
@@ -40,6 +42,13 @@ export declare class VersionUpgrade24 extends VersionUpgrade {
|
|
|
40
42
|
layoutTagOptions?: LayoutTagOptions;
|
|
41
43
|
});
|
|
42
44
|
migrateState(state: AdaptableState): AdaptableState;
|
|
45
|
+
/**
|
|
46
|
+
* Step 17. The 20 swatch colours were merged into the palette after its 12
|
|
47
|
+
* light / dark pairs, so `var(--ab-color-swatch-N)` in any saved style
|
|
48
|
+
* (Format Columns, Styled Columns, Alerts, Flashing Cells, shared entities…)
|
|
49
|
+
* becomes `var(--ab-color-palette-{N+12})` with the same colour.
|
|
50
|
+
*/
|
|
51
|
+
private migrateSwatchColorVars;
|
|
43
52
|
/**
|
|
44
53
|
* Migrates Notes from a single `Timestamp` to explicit `CreatedAt` / `UpdatedAt`.
|
|
45
54
|
*
|
|
@@ -34,8 +34,35 @@ export class VersionUpgrade24 extends VersionUpgrade {
|
|
|
34
34
|
this.retypeObservableCalculatedColumns(state);
|
|
35
35
|
this.stampFlashingCellTypes(state);
|
|
36
36
|
migrateLayoutTagsToRegistry(state, this.logger, this.options.layoutTagOptions);
|
|
37
|
+
this.migrateSwatchColorVars(state);
|
|
37
38
|
return state;
|
|
38
39
|
}
|
|
40
|
+
migrateSwatchColorVars(state) {
|
|
41
|
+
const swatchVar = /--ab-color-swatch-(\d+)\b/g;
|
|
42
|
+
let rewritten = 0;
|
|
43
|
+
const visit = (node) => {
|
|
44
|
+
if (!node || typeof node !== 'object') {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const container = node;
|
|
48
|
+
for (const key of Object.keys(container)) {
|
|
49
|
+
const value = container[key];
|
|
50
|
+
if (typeof value !== 'string') {
|
|
51
|
+
visit(value);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const next = value.replace(swatchVar, (_, n) => `--ab-color-palette-${Number(n) + 12}`);
|
|
55
|
+
if (next !== value) {
|
|
56
|
+
container[key] = next;
|
|
57
|
+
rewritten++;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
visit(state);
|
|
62
|
+
if (rewritten > 0) {
|
|
63
|
+
this.logger.info(`Rewrote ${rewritten} colour value(s) from --ab-color-swatch-N to --ab-color-palette-{N+12} (v24).`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
39
66
|
migrateNoteTimestamps(state) {
|
|
40
67
|
const notes = state.Note?.Notes;
|
|
41
68
|
if (!notes?.length) {
|