@adaptabletools/adaptable 23.0.0-canary.2 → 23.0.0-canary.4
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 +68 -73
- package/package.json +1 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -3
- package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
- package/src/AdaptableState/Common/AdaptableForm.js +31 -0
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +1 -1
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
- package/src/AdaptableState/Common/Enums.d.ts +0 -5
- package/src/AdaptableState/Common/Enums.js +0 -6
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/ReportScheduleRan.d.ts +4 -0
- package/src/Api/Implementation/LayoutHelpers.js +12 -0
- package/src/Api/Internal/EventInternalApi.js +2 -1
- package/src/Strategy/CalculatedColumnModule.js +3 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +115 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +8 -16
- package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonInfo.js +4 -3
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilter.js +15 -5
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
- package/src/View/Components/ColumnFilter/FloatingFilter.js +58 -60
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -0
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +3 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +23 -21
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +3 -3
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +1 -1
- package/src/View/Wizard/OnePageWizards.js +1 -1
- package/src/View/renderWithAdaptableContext.js +2 -3
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -1
- package/src/agGrid/AdaptableAgGrid.js +3 -18
- package/src/agGrid/AgGridColumnAdapter.js +1 -4
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +11 -6
- package/src/components/Card/index.js +1 -1
- package/src/components/Combobox/VirtualizedList.js +5 -5
- package/src/components/Combobox/comboboxUtils.d.ts +4 -1
- package/src/components/Combobox/comboboxUtils.js +2 -0
- package/src/components/Combobox/index.d.ts +1 -0
- package/src/components/Combobox/index.js +38 -12
- package/src/components/Datepicker/index.js +2 -2
- package/src/components/Dialog/index.js +1 -1
- package/src/components/DragAndDropContext/TabList.js +1 -1
- package/src/components/Dropdown/Arrows.js +0 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/index.js +1 -1
- package/src/components/Input/index.js +1 -1
- package/src/components/NewDropdownButton/index.d.ts +1 -0
- package/src/components/NewDropdownButton/index.js +2 -2
- package/src/components/NewSelect/index.d.ts +2 -0
- package/src/components/NewSelect/index.js +10 -7
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +1 -1
- package/src/components/Tabs/index.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +6 -14
- package/src/components/ui/button.d.ts +5 -2
- package/src/components/ui/button.js +5 -4
- package/src/components/ui/combobox.d.ts +16 -16
- package/src/components/ui/combobox.js +37 -37
- package/src/components/ui/input-group.d.ts +10 -9
- package/src/components/ui/input-group.js +13 -12
- package/src/components/ui/input.d.ts +2 -2
- package/src/components/ui/input.js +5 -4
- package/src/components/ui/popover.d.ts +5 -5
- package/src/components/ui/popover.js +7 -7
- package/src/components/ui/select.d.ts +7 -6
- package/src/components/ui/select.js +13 -12
- package/src/components/ui/textarea.d.ts +2 -2
- package/src/components/ui/textarea.js +4 -3
- package/src/components/ui/tooltip.d.ts +6 -5
- package/src/components/ui/tooltip.js +8 -7
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
- package/src/lib/utils.d.ts +20 -0
- package/src/lib/utils.js +45 -0
- package/src/metamodel/adaptable.metamodel.d.ts +7 -19
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.d.ts +2 -3
- package/src/migration/VersionUpgrade23.js +4 -16
- package/src/types.d.ts +0 -1
- package/themes/dark.css +7 -17
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -4
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -29
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -45
|
@@ -55,9 +55,7 @@ export const FormatColumnScopeWizardSection = (props) => {
|
|
|
55
55
|
newData.Rule.BooleanExpression = '';
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
|
-
const validPredicateIds = new Set(api.formatColumnApi.internalApi
|
|
59
|
-
.getFormatColumnDefsForScope(Scope)
|
|
60
|
-
.map((def) => def.id));
|
|
58
|
+
const validPredicateIds = new Set(api.formatColumnApi.internalApi.getFormatColumnDefsForScope(Scope).map((def) => def.id));
|
|
61
59
|
newData.Rule = {
|
|
62
60
|
Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
|
|
63
61
|
// if there are more than 1 column, then we must eliminate the IN/NotIn predicates
|
|
@@ -82,11 +80,8 @@ export const FormatColumnScopeWizardSection = (props) => {
|
|
|
82
80
|
});
|
|
83
81
|
};
|
|
84
82
|
const showRowToggles = data.Target === 'cell';
|
|
85
|
-
return (_jsxs(Flex, { flexDirection: "column", style: { height: '100%' }, children: [_jsxs(Flex, { flexDirection: "column", className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:border-b-
|
|
83
|
+
return (_jsxs(Flex, { flexDirection: "column", style: { height: '100%' }, children: [_jsxs(Flex, { flexDirection: "column", className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-5 twa:font-medium", children: "Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: "Which Columns the Format Column will be applied to" })] }), _jsx(Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:p-2", children: _jsx(NewScopeComponent, { descriptions: {
|
|
86
84
|
rowScope: 'Format all columns in the row',
|
|
87
85
|
columnScope: 'Select columns to format',
|
|
88
|
-
}, scope: data.Scope, updateScope: handleScopeChange }) })] }), showRowToggles && (_jsxs(Box, { className: "twa:border-t twa:border-border twa:
|
|
89
|
-
FORMAT_COLUMN_ROW_KINDS.slice(0, 2),
|
|
90
|
-
FORMAT_COLUMN_ROW_KINDS.slice(2),
|
|
91
|
-
].map((rowKindGroup, groupIndex) => (_jsx(Box, { className: "twa:flex-1 twa:min-w-[220px]", children: _jsx(FormLayout, { sizes: ['180px', '1fr'], children: rowKindGroup.map((kind) => (_jsx(FormRow, { label: `${ROW_KIND_LABELS[kind]}:`, children: _jsx(Flex, { alignItems: "center", className: "twa:ml-2", children: _jsx(CheckBox, { "data-name": `include-${kind.toLowerCase()}-rows-checkbox`, className: "twa:mr-2", checked: isRowKindIncluded(data, kind), onChange: (checked) => handleRowKindChange(kind, checked) }) }) }, kind))) }) }, groupIndex))) })] }))] }));
|
|
86
|
+
}, scope: data.Scope, updateScope: handleScopeChange }) })] }), showRowToggles && (_jsxs(Box, { className: "twa:border-t twa:border-border twa:py-3 twa:shrink-0", children: [_jsxs(Flex, { alignItems: "center", className: "twa:gap-3 twa:px-2 twa:pb-2 twa:mb-3 twa:flex-wrap twa:border-b twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-5 twa:font-medium", children: "Rows" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Which kinds of Rows the Format Column will be applied to" })] }), _jsx(Flex, { flexDirection: "row", className: "twa:gap-6 twa:flex-wrap", children: [FORMAT_COLUMN_ROW_KINDS.slice(0, 2), FORMAT_COLUMN_ROW_KINDS.slice(2)].map((rowKindGroup, groupIndex) => (_jsx(Box, { className: "twa:flex-1 twa:min-w-[220px]", children: _jsx(FormLayout, { sizes: ['180px', '1fr'], children: rowKindGroup.map((kind) => (_jsx(FormRow, { label: `${ROW_KIND_LABELS[kind]}:`, children: _jsx(Flex, { alignItems: "center", className: "twa:ml-2", children: _jsx(CheckBox, { "data-name": `include-${kind.toLowerCase()}-rows-checkbox`, className: "twa:mr-2", checked: isRowKindIncluded(data, kind), onChange: (checked) => handleRowKindChange(kind, checked) }) }) }, kind))) }) }, groupIndex))) })] }))] }));
|
|
92
87
|
};
|
|
@@ -22,7 +22,7 @@ const QueryViewPanelComponent = (props) => {
|
|
|
22
22
|
const disabled = isReadOnly || isSuspended || gridFilterAccessLevel === ACCESS_LEVEL_READ_ONLY;
|
|
23
23
|
const buttonExpand = (_jsx(ButtonExpand, { disabled: disabled, accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", onClick: onExpand, tooltip: "Edit the Expression in UI", className: "twa:ml-1" }));
|
|
24
24
|
const renderExpressionLabel = () => {
|
|
25
|
-
const baseClasses = 'twa:font-mono twa:text-s twa:py-2 twa:px-2 twa:overflow-hidden twa:text-ellipsis twa:whitespace-nowrap twa:bg-
|
|
25
|
+
const baseClasses = 'twa:font-mono twa:text-s twa:py-2 twa:px-2 twa:overflow-hidden twa:text-ellipsis twa:whitespace-nowrap twa:bg-background twa:text-foreground twa:rounded twa:cursor-pointer twa:leading-4 twa:flex twa:items-center';
|
|
26
26
|
const placeholderClasses = 'twa:text-gray-400 twa:italic';
|
|
27
27
|
const labelClassName = clsx(baseClasses, {
|
|
28
28
|
[placeholderClasses]: !expression,
|
|
@@ -33,29 +33,31 @@ const LayoutViewPanelComponent = (props) => {
|
|
|
33
33
|
const entityAccessLevel = AdaptableHelper.getAccessLevelForObject(layoutEntity, accessLevel);
|
|
34
34
|
const elementType = viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
35
35
|
const layoutSelectStyle = elementType === 'ToolPanel' ? { minWidth: '100%' } : {};
|
|
36
|
+
const toLayoutSelectItems = (layouts) => layouts.map((layout) => ({
|
|
37
|
+
label: layout.Name,
|
|
38
|
+
value: layout.Name,
|
|
39
|
+
}));
|
|
36
40
|
const tableLayoutsArray = Layouts.filter((layout) => !isPivotLayout(layout));
|
|
37
41
|
const pivotLayoutsArray = Layouts.filter((layout) => isPivotLayout(layout));
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
].filter(Boolean);
|
|
58
|
-
return (_jsxs(Flex, { flexDirection: "row", className: `ab-${elementType}__Layout__wrap twa:gap-0.5`, flexWrap: viewType === 'ToolPanel' ? 'wrap' : 'nowrap', children: [_jsx(Flex, { style: layoutSelectStyle, className: "twa:flex-1", children: _jsx(SingleSelect, { groups: layoutGroups, showItemTooltip: true, disabled: isErrorLayout, className: `twa:w-full twa:min-w-30 ab-${elementType}__Layout__select`, ariaLabel: 'Select Layout', value: layoutEntity ? layoutEntity.Name : null, onValueChange: (layout) => onSelectLayout(layout) }) }), _jsxs(Flex, { flexDirection: "row", className: join(accessLevel === GeneralConstants.ACCESS_LEVEL_READ_ONLY
|
|
42
|
+
const showLayoutTypeHeadings = tableLayoutsArray.length > 0 && pivotLayoutsArray.length > 0;
|
|
43
|
+
const layoutSelectCommonProps = {
|
|
44
|
+
showItemTooltip: true,
|
|
45
|
+
disabled: isErrorLayout,
|
|
46
|
+
className: `twa:w-full twa:min-w-30 ab-${elementType}__Layout__select`,
|
|
47
|
+
ariaLabel: 'Select Layout',
|
|
48
|
+
value: layoutEntity ? layoutEntity.Name : null,
|
|
49
|
+
onValueChange: (layout) => onSelectLayout(layout),
|
|
50
|
+
};
|
|
51
|
+
return (_jsxs(Flex, { flexDirection: "row", className: `ab-${elementType}__Layout__wrap twa:gap-0.5`, flexWrap: viewType === 'ToolPanel' ? 'wrap' : 'nowrap', children: [_jsx(Flex, { style: layoutSelectStyle, className: "twa:flex-1", children: showLayoutTypeHeadings ? (_jsx(SingleSelect, { ...layoutSelectCommonProps, groups: [
|
|
52
|
+
{
|
|
53
|
+
label: 'Table Layouts',
|
|
54
|
+
items: toLayoutSelectItems(tableLayoutsArray),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Pivot Layouts',
|
|
58
|
+
items: toLayoutSelectItems(pivotLayoutsArray),
|
|
59
|
+
},
|
|
60
|
+
] })) : (_jsx(SingleSelect, { ...layoutSelectCommonProps, items: toLayoutSelectItems(Layouts) })) }), _jsxs(Flex, { flexDirection: "row", className: join(accessLevel === GeneralConstants.ACCESS_LEVEL_READ_ONLY
|
|
59
61
|
? GeneralConstants.READ_ONLY_STYLE
|
|
60
62
|
: '', `ab-${elementType}__Layout__wrap`), children: [_jsx(ButtonEdit, { disabled: isErrorLayout, onClick: () => api.layoutApi.showLayoutEditor(layoutEntity.Name), tooltip: LAYOUT_EDIT_TOOLTIP, className: `ab-${elementType}__Layout__edit`, accessLevel: entityAccessLevel }), _jsx(ButtonClone, { disabled: isErrorLayout, onClick: () => api.layoutApi.showLayoutEditor(layoutEntity.Name, isPivotLayout(layoutEntity) ? 'pivot' : 'table', 'Clone'), tooltip: LAYOUT_CLONE_TOOLTIP, className: `ab-${elementType}__Layout__clone`, tone: "neutral", variant: "text", children: null, accessLevel: cloneAccessLevel }), _jsx(NewDropdownButton, { variant: "text", tooltip: LAYOUT_NEW_TABLE_OR_PIVOT_TOOLTIP, "data-name": "new", items: [
|
|
61
63
|
{
|
|
@@ -423,7 +423,7 @@ export const ColumnsSection = (props) => {
|
|
|
423
423
|
const visible = isColumnVisible({ columnId: selectedColumnId, layout });
|
|
424
424
|
handleColumnVisibilityChange(selectedColumnId, !visible);
|
|
425
425
|
}
|
|
426
|
-
}, children: _jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-2 twa:h-full twa:overflow-hidden twa:p-1", children: [_jsx(AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Search Columns...", className: "twa:w-full twa:
|
|
426
|
+
}, children: _jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-2 twa:h-full twa:overflow-hidden twa:p-1", children: [_jsx(AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Search Columns...", className: "twa:w-full twa:p-1" }), _jsx(Box, { className: clsx('twa:font-bold', 'twa:border-b twa:border-primarydark/30 twa:rounded-standard'), children: _jsx(CheckBox, { checked: currentlyDisplayedColumnIds.length
|
|
427
427
|
? currentlyDisplayedColumnIds.length === visibleIdsCurrentlyDisplayed.length
|
|
428
428
|
? true
|
|
429
429
|
: visibleIdsCurrentlyDisplayed.length
|
|
@@ -460,7 +460,7 @@ const ColumnPropertiesEditor = (props) => {
|
|
|
460
460
|
const adaptable = useAdaptable();
|
|
461
461
|
const baseCls = 'ab-Layout-Wizard__ColumnPropertiesEditor twa:border twa:rounded-standard';
|
|
462
462
|
if (!props.column) {
|
|
463
|
-
return (_jsx(Box, { className: clsx(baseCls, 'twa:border-input-border twa:grid twa:place-items-center twa:border-dashed twa:border-2'), children: _jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-2 twa:items-center twa:justify-center", children: [_jsx(Box, { className: "twa:text-
|
|
463
|
+
return (_jsx(Box, { className: clsx(baseCls, 'twa:border-input-border twa:grid twa:place-items-center twa:border-dashed twa:border-2'), children: _jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-2 twa:items-center twa:justify-center", children: [_jsx(Box, { className: "twa:text-muted-foreground ab-Layout-Wizard__ColumnPropertiesEditor__Placeholder__Icon", children: _jsx(NaturallySizedIcon, { name: "inspector", style: { stroke: 'currentColor', fill: 'none', strokeWidth: 2 } }) }), _jsx(Box, { className: "twa:text-4 twa:font-bold ab-Layout-Wizard__ColumnPropertiesEditor__Placeholder__Title", children: "No Column Selected" }), _jsx(Box, { className: "twa:text-3 twa:opacity-80 ab-Layout-Wizard__ColumnPropertiesEditor__Placeholder__Description", children: "Select a Column to view and edit its properties" })] }) }));
|
|
464
464
|
}
|
|
465
465
|
const { column } = props;
|
|
466
466
|
const columnWidth = props.layout.ColumnSizing?.[column.columnId]?.Width;
|
|
@@ -472,7 +472,7 @@ const ColumnPropertiesEditor = (props) => {
|
|
|
472
472
|
const columnPinning = props.layout.ColumnPinning?.[props.column.columnId] || 'None';
|
|
473
473
|
const initialHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(props.column.columnId, props.layout);
|
|
474
474
|
const customHeader = props.layout.ColumnHeaders?.[props.column.columnId] ?? initialHeader;
|
|
475
|
-
return (_jsxs(Box, { className: clsx(baseCls, 'ab-Layout-Wizard__ColumnPropertiesEditor__Container twa:border-none twa:bg-
|
|
475
|
+
return (_jsxs(Box, { className: clsx(baseCls, 'ab-Layout-Wizard__ColumnPropertiesEditor__Container twa:border-none twa:bg-background twa:shadow-md', 'twa:max-h-full twa:overflow-hidden twa:flex twa:flex-col'), children: [_jsxs(Box, { className: "twa:px-4 twa:pt-4", children: [_jsxs(Box, { className: "twa:text-5 twa:font-bold twa:leading-relaxed ab-Layout-Wizard__ColumnPropertiesEditor__Title", children: ["Column Settings: ", column.friendlyName] }), _jsxs(Box, { className: "twa:text-3 twa:opacity-80 twa:flex twa:flex-row twa:gap-1 twa:items-center", children: ["Column ID:", ' ', _jsx(Box, { className: "twa:bg-primarydark/20 twa:text-muted-foreground twa:px-1 twa:py-0.5 twa:rounded-standard", children: column.columnId })] }), props.column.columnGroup && props.column.columnGroup.groupCount > 1 ? (_jsxs(Box, { className: "ab-Layout-Wizard__ColumnRow__Title twa:mx-2 twa:p-1", children: ["Column Group: ", props.column.columnGroup.friendlyName] })) : null] }), hr, _jsxs(Box, { className: "twa:px-4 twa:flex-1 twa:overflow-y-auto twa:pb-3", children: [_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:mt-3", children: [_jsxs(Flex, { flexDirection: "column", className: "twa:gap-1", children: ["Header", _jsx(Input, { "data-name": "column-header", className: "ab-Layout-Wizard__ColumnPropertiesEditor__Input twa:w-full", placeholder: "Custom name (optional)", disabled: props.column.isGeneratedSelectionColumn, onChange: () => {
|
|
476
476
|
props.onColumnNameChange(props.column.columnId, event.target.value);
|
|
477
477
|
}, value: customHeader })] }), _jsxs(Box, { className: "twa:grid twa:grid-cols-[1fr_1fr] twa:gap-2", children: [_jsx(Box, { children: "Width:" }), " ", _jsx(Box, { children: "Flex:" }), _jsx(Input, { "data-name": "column-width", className: "ab-Layout-Wizard__ColumnPropertiesEditor__Input", type: "number", placeholder: "Column width", disabled: resizable === false, onChange: (event) => {
|
|
478
478
|
let value = parseFloat(event.target.value);
|
|
@@ -12,7 +12,7 @@ import { CheckBox } from '../../../../components/CheckBox';
|
|
|
12
12
|
export const PivotColumnsSectionSummary = () => {
|
|
13
13
|
const adaptable = useAdaptable();
|
|
14
14
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
15
|
-
return (_jsx(Box, { className: "twa:p-2 twa:rounded-standard twa:bg-
|
|
15
|
+
return (_jsx(Box, { className: "twa:p-2 twa:rounded-standard twa:bg-background", children: layout.PivotColumns?.length ? (layout.PivotColumns.map((columnId) => (_jsx(Tag, { className: "twa:mr-1", children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }, columnId)))) : (_jsx(Tag, { children: "No Pivot Columns Defined" })) }));
|
|
16
16
|
};
|
|
17
17
|
export const PivotColumnsSection = (props) => {
|
|
18
18
|
const adaptable = useAdaptable();
|
|
@@ -69,5 +69,5 @@ export const RowSelectionSection = (props) => {
|
|
|
69
69
|
}
|
|
70
70
|
props.onChange(newLayout);
|
|
71
71
|
};
|
|
72
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Tabs, { children: [_jsx(Tabs.Tab, { children: "Row Selection Mode" }), _jsx(Tabs.Content, { children: _jsx(Flex, { flexDirection: "column", children: _jsxs(RadioGroup, { orientation: "horizontal", variant: "text-only", className: twMerge(radioGroupStyling.horizontalTextOnly, 'twa:gap-2 twa:max-w-[500px] twa:bg-
|
|
72
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Tabs, { children: [_jsx(Tabs.Tab, { children: "Row Selection Mode" }), _jsx(Tabs.Content, { children: _jsx(Flex, { flexDirection: "column", children: _jsxs(RadioGroup, { orientation: "horizontal", variant: "text-only", className: twMerge(radioGroupStyling.horizontalTextOnly, 'twa:gap-2 twa:max-w-[500px] twa:bg-background twa:p-2'), value: mode, name: "rowSelectionMode", onRadioChange: handleModeChange, children: [_jsx(Radio, { value: false, children: "Disabled" }), _jsx(Radio, { value: "singleRow", children: "Single Row" }), _jsx(Radio, { value: "multiRow", children: "Multi Row" })] }) }) })] }), !rowSelection && _jsx(HelpBlock, { children: "There is no Row Selection configured for this Layout" }), rowSelection && (_jsxs(_Fragment, { children: [_jsxs(Tabs, { className: "twa:mt-2", children: [_jsx(Tabs.Tab, { children: "Row Selection Column Checkboxes" }), _jsx(Tabs.Content, { children: _jsxs(Flex, { flexDirection: "row", className: "twa:gap-6", children: [_jsx(CheckBox, { className: "twa:flex-1", checked: rowSelection.Checkboxes ?? true, onChange: (checked) => updateRowSelection({ Checkboxes: checked }), children: "Checkboxes in Column Cells" }), mode === 'multiRow' && (_jsx(CheckBox, { className: "twa:flex-1", checked: rowSelection.HeaderCheckbox ?? true, onChange: (checked) => updateRowSelection({ HeaderCheckbox: checked }), children: "Checkbox in Column Header (to enable Select All)" }))] }) })] }), (rowSelection.Checkboxes ?? true) && (_jsxs(Tabs, { className: "twa:mt-2", children: [_jsx(Tabs.Tab, { children: "Row Grouping Selection Checkboxes" }), _jsx(Tabs.Content, { children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.CheckboxInGroupColumn ?? false, name: "checkboxLocation", onRadioChange: (value) => updateRowSelection({ CheckboxInGroupColumn: value }), children: [_jsx(Radio, { value: false, children: "Display in dedicated Selection Column" }), _jsx(Radio, { value: true, children: "Display in Row Grouped Column" })] }) })] })), _jsxs(Tabs, { className: "twa:mt-2", children: [_jsx(Tabs.Tab, { children: "Row Click Selection (when user clicks on Row outside of Selection Checkbox)" }), _jsx(Tabs.Content, { children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.EnableClickSelection ?? false, name: "clickSelection", onRadioChange: (value) => updateRowSelection({ EnableClickSelection: value }), children: [_jsx(Radio, { value: false, children: "Disabled (Cannot select or deselect by clicking in Row)" }), _jsx(Radio, { value: true, children: "Full (Enable selection by clicking in Row and deselection by Ctrl+clicking in Row)" }), _jsx(Radio, { value: 'enableSelection', children: "Selection Only (Enable selection by clicking in Row)" }), _jsx(Radio, { value: 'enableDeselection', children: "Deselection Only (Enable deselection by Ctrl+clicking in Row)" })] }) })] }), mode === 'multiRow' && !isPivot && (_jsxs(Tabs, { className: "twa:mt-2", children: [_jsx(Tabs.Tab, { children: "Grouped Row Selection Behaviour" }), _jsx(Tabs.Content, { children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.GroupSelectMode ?? 'self', name: "groupSelectMode", onRadioChange: (value) => updateRowSelection({ GroupSelectMode: value }), children: [_jsx(Radio, { value: 'self', children: "Select Grouped Row Only (no cascade)" }), _jsx(Radio, { value: 'descendants', children: "Select Grouped Row and all descendants" }), _jsx(Radio, { value: 'filteredDescendants', children: "Select Grouped Row and only filtered descendants" })] }) })] })), mode === 'multiRow' && (_jsxs(Tabs, { className: "twa:mt-2", children: [_jsx(Tabs.Tab, { children: "Select All (in Header) Behaviour" }), _jsx(Tabs.Content, { children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.SelectAllMode ?? 'all', name: "selectAllMode", onRadioChange: (value) => updateRowSelection({ SelectAllMode: value }), children: [_jsx(Radio, { value: 'all', children: "All rows" }), _jsx(Radio, { value: 'filtered', children: "Filtered rows only" }), _jsx(Radio, { value: 'currentPage', children: "Current page only" })] }) })] }))] }))] }));
|
|
73
73
|
};
|
|
@@ -20,5 +20,5 @@ export const SettingsSection = (props) => {
|
|
|
20
20
|
Name: event.target.value,
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Tabs, { className: "twa:mb-
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Tabs, { className: "twa:mb-2", children: [_jsx(Tabs.Tab, { children: "Settings" }), _jsx(Tabs.Content, { children: _jsx(Flex, { flexDirection: "row", children: _jsx(FormLayout, { className: "twa:max-w-[300px] twa:w-full", children: _jsx(FormRow, { label: "Name", children: _jsx(Input, { className: "twa:w-full", "data-name": "layout-name", onChange: onNameChange, value: layout?.Name ?? '' }) }) }) }) })] }), _jsxs(Tabs, { className: "twa:mb-2", children: [_jsx(Tabs.Tab, { children: "Grid Type" }), _jsx(Tabs.Content, { children: _jsxs(Flex, { flexDirection: "column", children: [_jsx(Radio, { "data-name": "layout-type-table", disabled: true, checked: !isPivotLayout(layout), children: "Table" }), _jsx(Radio, { "data-name": "layout-type-pivot", disabled: true, checked: isPivotLayout(layout), children: "Pivot" })] }) })] })] }));
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as t}from"react/jsx-runtime";import*as e from"react";import{Logo as o}from"../../components/Logo";import{Flex as n}from"../../components/Flex";const i={border:"1px solid var(--ab-color-error)",padding:"5px",fontWeight:600,margin:"5px",fontSize:"14px",alignItems:"center",color:"var(--ab-color-foreground)",background:"var(--ab-color-
|
|
1
|
+
import{jsx as r,jsxs as t}from"react/jsx-runtime";import*as e from"react";import{Logo as o}from"../../components/Logo";import{Flex as n}from"../../components/Flex";const i={border:"1px solid var(--ab-color-error)",padding:"5px",fontWeight:600,margin:"5px",fontSize:"14px",alignItems:"center",color:"var(--ab-color-foreground)",background:"var(--ab-color-background)"},s=r=>{const t=[["display","none"],["opacity","0"],["position","absolute"],["position","fixed"],["position","relative"],["visibility","hidden"]];for(const[e,o]of t)if(r.style[e]===o)return!1;return!0};export const LicenseWatermark=l=>{const a=e.useRef(null);return e.useEffect(()=>{const r=setInterval(()=>{a.current?.isConnected||alert("It is not allowed to remove the Adaptable watermark."),s(a.current)||alert("It is not allowed to modify the Adaptable watermark."),a?.current?.style&&(a.current.style.border=i.border,a.current.style.padding=i.padding,a.current.style.fontWeight=`${i.fontWeight}`,a.current.style.margin=i.margin,a.current.style.fontSize=i.fontSize,a.current.style.color=i.color,a.current.style.background=i.background,a.current.style.display="flex",a.current.style.position="static",a.current.style.opacity="1",a.current.style.visibility="visible")},5e3);return()=>clearTimeout(r)},[]),t(n,{style:i,ref:a,children:[r(o,{style:{marginRight:10}}),r("div",{children:l.children})]})};
|
|
@@ -227,7 +227,7 @@ export const StyledColumnWizardScopeSection = (props) => {
|
|
|
227
227
|
// -------------------------------------------------------------------------
|
|
228
228
|
// Render
|
|
229
229
|
// -------------------------------------------------------------------------
|
|
230
|
-
return (_jsxs(Flex, { flexDirection: "column", style: { height: '100%' }, children: [_jsxs(Flex, { flexDirection: "column", className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:border-b-
|
|
230
|
+
return (_jsxs(Flex, { flexDirection: "column", style: { height: '100%' }, children: [_jsxs(Flex, { flexDirection: "column", className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-5 twa:font-medium", children: "Column" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: "The Column the Style is applied to" }), _jsx(Box, { className: "twa:flex-1" }), _jsx(AdaptableFormControlTextClear, { value: columnsSearchText, OnTextChange: setColumnsSearchText, placeholder: "Type to search columns", style: { flex: 1, maxWidth: 320 } })] }), _jsx(Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto", children: _jsx(NewColumnSelector, { columnFilterText: columnsSearchText, availableColumns: sortableCols, selected: data.ColumnId ? [data.ColumnId] : [], singleSelect: true, onChange: handleColumnsChange, allowReorder: false }) })] }), _jsxs(Box, { className: "twa:border-t twa:border-border twa:px-2 twa:py-3 twa:shrink-0", children: [_jsxs(Flex, { alignItems: "center", className: "twa:gap-3 twa:pb-2 twa:mb-3 twa:flex-wrap twa:border-b twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-5 twa:font-medium", children: "Rows" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Which kinds of Rows should the Styled Column render on" })] }), _jsx(Flex, { flexDirection: "row", className: "twa:gap-6 twa:flex-wrap", children: [
|
|
231
231
|
STYLED_COLUMN_ROW_KINDS.slice(0, 2),
|
|
232
232
|
STYLED_COLUMN_ROW_KINDS.slice(2),
|
|
233
233
|
].map((rowKindGroup, groupIndex) => (_jsx(Box, { className: "twa:flex-1 twa:min-w-[220px]", children: _jsx(FormLayout, { sizes: ['180px', '1fr'], children: rowKindGroup.map((kind) => {
|
|
@@ -78,7 +78,7 @@ export const OnePageWizard = (props) => {
|
|
|
78
78
|
if (section === '-') {
|
|
79
79
|
return _jsx(React.Fragment, {}, index);
|
|
80
80
|
}
|
|
81
|
-
return (_jsx(Flex, { flexDirection: "column", "data-name": `section-${index}`, className: "twa:min-h-full twa:mr-2", children: _jsx(Box, { className: "ab-OnePageWizard__section twa:flex-1 twa:rounded-standard twa:overflow-auto twa:bg-
|
|
81
|
+
return (_jsx(Flex, { flexDirection: "column", "data-name": `section-${index}`, className: "twa:min-h-full twa:mr-2", children: _jsx(Box, { className: "ab-OnePageWizard__section twa:flex-1 twa:rounded-standard twa:overflow-auto twa:bg-background", children: section.render(props.data, index) }) }, index));
|
|
82
82
|
};
|
|
83
83
|
const handleNavigation = useKeyboardNavigation(setCurrentSection, visibleSections);
|
|
84
84
|
const selectedNodeRef = useRef(null);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Provider } from 'react-redux';
|
|
3
3
|
import AdaptableContext from './AdaptableContext';
|
|
4
|
-
import {
|
|
5
|
-
import { TooltipProvider } from '../components/ui/tooltip';
|
|
4
|
+
import { TooltipProvider } from "../components/ui/tooltip";
|
|
6
5
|
export const renderWithAdaptableContext = (children, adaptable) => {
|
|
7
|
-
return (_jsx(TooltipProvider, { delay: 300, children: _jsx(Provider, { store: adaptable.adaptableStore.TheStore, children: _jsx(
|
|
6
|
+
return (_jsx(TooltipProvider, { delay: 300, children: _jsx(Provider, { store: adaptable.adaptableStore.TheStore, children: _jsx(AdaptableContext.Provider, { value: adaptable, children: children }) }) }));
|
|
8
7
|
};
|
|
@@ -97,7 +97,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
97
97
|
private LicenseService;
|
|
98
98
|
private ChartingService;
|
|
99
99
|
private rowListeners;
|
|
100
|
-
private throttleFilterOnDataChange;
|
|
101
100
|
private debouncedSetSelectedRows;
|
|
102
101
|
private debouncedSetSelectedCells;
|
|
103
102
|
private agGridListenerKeydown;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import throttle from '../Utilities/utils/throttle';
|
|
2
1
|
import debounce from '../Utilities/utils/debounce';
|
|
3
2
|
import { createGrid, LocalEventService, } from 'ag-grid-enterprise';
|
|
4
3
|
import { AdaptableLogger } from './AdaptableLogger';
|
|
@@ -21,6 +20,7 @@ import { ThemeService } from '../Utilities/Services/ThemeService';
|
|
|
21
20
|
import { ValidationService } from '../Utilities/Services/ValidationService';
|
|
22
21
|
import { ModuleService } from '../Utilities/Services/ModuleService';
|
|
23
22
|
import { CalculatedColumnExpressionService } from '../Utilities/Services/CalculatedColumnExpressionService';
|
|
23
|
+
import { expandCellDataChangedInfosWithCalculatedColumns } from '../Utilities/Services/CalculatedColumnSyntheticChange';
|
|
24
24
|
import { QueryLanguageService } from '../Utilities/Services/QueryLanguageService';
|
|
25
25
|
import { AlertService } from '../Utilities/Services/AlertService';
|
|
26
26
|
import { TeamSharingService } from '../Utilities/Services/TeamSharingService';
|
|
@@ -83,7 +83,6 @@ import { computeParameterizedAggregation, getParameterizedAggregationDefinitions
|
|
|
83
83
|
import { getParameterizedAggForColumn } from '../Aggregation/parameterizedAggregationHelpers';
|
|
84
84
|
import { getParameterizedAggregationHeaderParenthesisValue } from '../Aggregation/parameterizedAggregationHeader';
|
|
85
85
|
import { RowFormService } from '../Utilities/Services/RowFormService';
|
|
86
|
-
import { FilterOnDataChangeOptions } from '../AdaptableState/Common/Enums';
|
|
87
86
|
import { ADAPTABLE_PUBLISH_TIMESTAMP } from '../EnvVars';
|
|
88
87
|
import { AdaptableUpgradeHelper } from '../migration/AdaptableUpgradeHelper';
|
|
89
88
|
import { ensureLoadingScreenPortalElement } from '../components/Modal';
|
|
@@ -204,7 +203,6 @@ export class AdaptableAgGrid {
|
|
|
204
203
|
LicenseService;
|
|
205
204
|
ChartingService;
|
|
206
205
|
rowListeners;
|
|
207
|
-
throttleFilterOnDataChange;
|
|
208
206
|
debouncedSetSelectedRows;
|
|
209
207
|
debouncedSetSelectedCells;
|
|
210
208
|
agGridListenerKeydown;
|
|
@@ -1699,12 +1697,6 @@ export class AdaptableAgGrid {
|
|
|
1699
1697
|
}), true);
|
|
1700
1698
|
gridContainerElement.addEventListener('mouseleave', (this.agGridListenerMouseLeave = (event) => this._emit('MouseLeave', event)));
|
|
1701
1699
|
}
|
|
1702
|
-
this.throttleFilterOnDataChange = throttle(
|
|
1703
|
-
// the extra function is to make sure we have a reference to ag-grid-api
|
|
1704
|
-
() => this.agGridAdapter.getAgGridApi()?.onFilterChanged(), this.adaptableOptions.filterOptions.filterActionOnDataChange.throttleDelay, {
|
|
1705
|
-
trailing: true,
|
|
1706
|
-
leading: false,
|
|
1707
|
-
});
|
|
1708
1700
|
/**
|
|
1709
1701
|
* Use Case: User has started inline editing but its disabled in Row Form Options
|
|
1710
1702
|
* Action: Stop editing
|
|
@@ -3813,7 +3805,6 @@ export class AdaptableAgGrid {
|
|
|
3813
3805
|
this.listenerCellSelectionChanged = null;
|
|
3814
3806
|
this.listenerGlobalSetRowSelection = null;
|
|
3815
3807
|
this.listenerSortChanged = null;
|
|
3816
|
-
this.throttleFilterOnDataChange = null;
|
|
3817
3808
|
const liveGridOptions = this.agGridAdapter.DANGER_getLiveGridOptions();
|
|
3818
3809
|
if (liveGridOptions) {
|
|
3819
3810
|
this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
|
|
@@ -4133,6 +4124,7 @@ export class AdaptableAgGrid {
|
|
|
4133
4124
|
* There are a few things we need to do AFTER we edit a cell and it makes sense to put them in one place
|
|
4134
4125
|
*/
|
|
4135
4126
|
performPostEditChecks(rowNode, cellDataChangedInfos) {
|
|
4127
|
+
cellDataChangedInfos = expandCellDataChangedInfosWithCalculatedColumns(this.api, cellDataChangedInfos);
|
|
4136
4128
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
4137
4129
|
// if a Cell Data Change is undone, log to the Console
|
|
4138
4130
|
if (cellDataChangedInfo.trigger === 'undo') {
|
|
@@ -4290,14 +4282,7 @@ export class AdaptableAgGrid {
|
|
|
4290
4282
|
}
|
|
4291
4283
|
}
|
|
4292
4284
|
filterOnDataChange() {
|
|
4293
|
-
|
|
4294
|
-
FilterOnDataChangeOptions.Always) {
|
|
4295
|
-
this.agGridAdapter.getAgGridApi()?.onFilterChanged();
|
|
4296
|
-
}
|
|
4297
|
-
else if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
|
|
4298
|
-
FilterOnDataChangeOptions.Throttle) {
|
|
4299
|
-
this.throttleFilterOnDataChange();
|
|
4300
|
-
}
|
|
4285
|
+
this.agGridAdapter.getAgGridApi()?.onFilterChanged();
|
|
4301
4286
|
}
|
|
4302
4287
|
refreshLayout() {
|
|
4303
4288
|
const columnDefs = this.agGridAdapter.getColumnDefinitionsInclSpecialColumns();
|
|
@@ -951,10 +951,7 @@ export class AgGridColumnAdapter {
|
|
|
951
951
|
// 1. evaluate EditOptions.isCellEditable if provided
|
|
952
952
|
if (this.adaptableApi.gridApi.internalApi.hasCellEditableAccordingToEditOptions()) {
|
|
953
953
|
const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
954
|
-
|
|
955
|
-
if (editOptionsEditability) {
|
|
956
|
-
return editOptionsEditability;
|
|
957
|
-
}
|
|
954
|
+
return this.adaptableApi.gridApi.internalApi.isCellEditableAccordingToEditOptions(gridCell, getOriginalColDefEditable());
|
|
958
955
|
}
|
|
959
956
|
// 2. otherwise, fallback to colDef.editable
|
|
960
957
|
return getOriginalColDefEditable();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { flattenAdaptableFormFields, isAdaptableFormFieldDisabled, isAdaptableFormFieldGroup, isAdaptableFormFieldGroupHidden, isAdaptableFormFieldHidden, validateAdaptableForm, } from '../../AdaptableState/Common/AdaptableForm';
|
|
3
|
+
import { flattenAdaptableFormFields, isAdaptableFormFieldDisabled, isAdaptableFormFieldGroup, isAdaptableFormFieldGroupHidden, isAdaptableFormFieldHidden, resolveSelectPlaceholder, resolveSelectValueAfterClear, validateAdaptableForm, } from '../../AdaptableState/Common/AdaptableForm';
|
|
4
4
|
import FormLayout, { FormRow } from '../FormLayout';
|
|
5
5
|
import Input from '../Input';
|
|
6
6
|
import { AdaptableButtonView, } from '../../View/Components/AdaptableButton';
|
|
@@ -204,10 +204,12 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
204
204
|
break;
|
|
205
205
|
}
|
|
206
206
|
case 'select': {
|
|
207
|
-
const
|
|
207
|
+
const optionItems = resolveOptions(field);
|
|
208
|
+
const items = optionItems.map((item) => ({
|
|
208
209
|
value: item.value,
|
|
209
210
|
label: item.label,
|
|
210
211
|
}));
|
|
212
|
+
const selectPlaceholder = resolveSelectPlaceholder(field, optionItems);
|
|
211
213
|
// The underlying SingleCombobox / MultiCombobox manage their own
|
|
212
214
|
// popup-based focus; we wrap them in a labelled `role="group"` so
|
|
213
215
|
// assistive tech announces "<label> group" when focus enters and
|
|
@@ -225,10 +227,10 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
225
227
|
// anything else (e.g. legacy string defaults) to [] so the
|
|
226
228
|
// underlying combobox never receives a non-array value.
|
|
227
229
|
const selected = Array.isArray(value) ? value : [];
|
|
228
|
-
control = (_jsx(Box, { ...groupProps, children: _jsx(MultiCombobox, { items: items, onValueChange: (newValues) => setFieldValue(field.name, newValues), value: selected, disabled: isDisabled, placeholder:
|
|
230
|
+
control = (_jsx(Box, { ...groupProps, children: _jsx(MultiCombobox, { items: items, onValueChange: (newValues) => setFieldValue(field.name, newValues), value: selected, disabled: isDisabled, placeholder: selectPlaceholder }) }));
|
|
229
231
|
}
|
|
230
232
|
else {
|
|
231
|
-
control = (_jsx(Box, { ...groupProps, children: _jsx(SingleCombobox, { items: items, onValueChange: (newValue) => setFieldValue(field.name, newValue), value: value, disabled: isDisabled, placeholder:
|
|
233
|
+
control = (_jsx(Box, { ...groupProps, children: _jsx(SingleCombobox, { items: items, onValueChange: (newValue) => setFieldValue(field.name, resolveSelectValueAfterClear(field, newValue)), value: value, disabled: isDisabled, placeholder: selectPlaceholder }) }));
|
|
232
234
|
}
|
|
233
235
|
break;
|
|
234
236
|
}
|
|
@@ -354,10 +356,13 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
354
356
|
}
|
|
355
357
|
return items
|
|
356
358
|
.filter((field) => !isAdaptableFormFieldHidden(field, data, context))
|
|
357
|
-
.map((field) => {
|
|
359
|
+
.map((field, index) => {
|
|
358
360
|
const useFor = field.fieldType !== 'radio' && field.fieldType !== 'textOutput';
|
|
359
361
|
const requiredMarker = field.required ? (_jsx("span", { className: "ab-Form_required-marker", "aria-hidden": "true", children: ' *' })) : null;
|
|
360
|
-
return (_jsxs(Flex, { flexDirection: "row", alignItems: "center", style: {
|
|
362
|
+
return (_jsxs(Flex, { flexDirection: "row", alignItems: "center", style: {
|
|
363
|
+
columnGap: 'var(--ab-base-space)',
|
|
364
|
+
marginLeft: index > 0 ? 'var(--ab-base-space)' : undefined,
|
|
365
|
+
}, children: [field.label ? (useFor ? (_jsxs("label", { id: fieldLabelId(field), htmlFor: fieldDomId(field), className: "ab-FormLayout--inline_field-label", title: field.tooltip, children: [field.label, requiredMarker] })) : (_jsxs(Box, { id: fieldLabelId(field), className: "ab-FormLayout--inline_field-label", title: field.tooltip, children: [field.label, requiredMarker] }))) : null, renderField(field)] }, field.name));
|
|
361
366
|
});
|
|
362
367
|
};
|
|
363
368
|
const renderRowsEntry = (entry, index) => {
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { Box } from '../Flex';
|
|
5
5
|
export function Card(props) {
|
|
6
6
|
const { shadow = true, children, className, style, gap = 2 } = props;
|
|
7
|
-
return (_jsx(Box, { className: clsx('twa:bg-
|
|
7
|
+
return (_jsx(Box, { className: clsx('twa:bg-background twa:text-foreground', 'ab-Card', 'twa:text-3', 'twa:rounded-standard twa:p-2', 'twa:flex twa:flex-col', {
|
|
8
8
|
'twa:shadow-sm': shadow,
|
|
9
9
|
'twa:gap-0': gap === 0,
|
|
10
10
|
'twa:gap-1': gap === 1,
|
|
@@ -36,16 +36,16 @@ export function VirtualizedList({ open, virtualizerRef, showItemTooltip, renderC
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
const isUncreatedCreatable = item.creatable && !item.created;
|
|
39
|
-
const
|
|
40
|
-
const tooltipText =
|
|
39
|
+
const itemText = getItemTextLabel(item);
|
|
40
|
+
const tooltipText = showItemTooltip && itemText != null
|
|
41
41
|
? isUncreatedCreatable
|
|
42
|
-
? `Create "${
|
|
43
|
-
:
|
|
42
|
+
? `Create "${itemText}"`
|
|
43
|
+
: itemText
|
|
44
44
|
: undefined;
|
|
45
45
|
const label = isUncreatedCreatable ? `Create "${item.label}"` : item.label;
|
|
46
46
|
const itemLabel = renderItemLabel ? (renderItemLabel(label, item)) : (_jsx("span", { className: "twa:min-w-0 twa:flex-1 twa:truncate", children: label }));
|
|
47
47
|
const itemContent = isUncreatedCreatable ? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, {}), itemLabel] })) : (itemLabel);
|
|
48
|
-
const itemElement = (_jsx(ComboboxItem, { index: virtualItem.index, "data-index": virtualItem.index, ref: virtualizer.measureElement, value: item, renderCheckboxIndicator: renderCheckboxIndicator, "aria-setsize": filteredItems.length, "aria-posinset": virtualItem.index + 1, style: {
|
|
48
|
+
const itemElement = (_jsx(ComboboxItem, { index: virtualItem.index, "data-index": virtualItem.index, ref: virtualizer.measureElement, value: item, renderCheckboxIndicator: renderCheckboxIndicator, "aria-setsize": filteredItems.length, "aria-posinset": virtualItem.index + 1, "aria-label": itemText ?? undefined, style: {
|
|
49
49
|
position: 'absolute',
|
|
50
50
|
left: `var(--ab-base-space)`,
|
|
51
51
|
right: `var(--ab-base-space)`,
|
|
@@ -9,7 +9,9 @@ export type ComboboxItemType = {
|
|
|
9
9
|
value: any;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare function getItemTextLabel<T extends ComboboxItemType>(item: T
|
|
12
|
+
export declare function getItemTextLabel<T extends ComboboxItemType>(item: T & {
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
}): string;
|
|
13
15
|
export type ComboboxGroupType<T extends ComboboxItemType> = {
|
|
14
16
|
label: React.ReactNode;
|
|
15
17
|
items: T[];
|
|
@@ -45,6 +47,7 @@ export type ComboboxCommonProps<T extends ComboboxItemType> = {
|
|
|
45
47
|
renderItemLabel?: (defaultLabel: React.ReactNode, item: T) => React.ReactNode;
|
|
46
48
|
multiple?: boolean;
|
|
47
49
|
showClear?: boolean;
|
|
50
|
+
clearOnEscape?: boolean;
|
|
48
51
|
searchable?: boolean | 'inline' | 'menulist';
|
|
49
52
|
/**
|
|
50
53
|
* Custom filter function, or `null` to disable built-in filtering
|
|
@@ -5,6 +5,8 @@ export function getItemTextLabel(item) {
|
|
|
5
5
|
return item.label;
|
|
6
6
|
if (typeof item.label === 'number')
|
|
7
7
|
return String(item.label);
|
|
8
|
+
if (typeof item.tooltip === 'string')
|
|
9
|
+
return String(item.tooltip);
|
|
8
10
|
return String(item.value);
|
|
9
11
|
}
|
|
10
12
|
export function valueToItem(stringValue, lookup) {
|
|
@@ -35,4 +35,5 @@ export declare const MultiCombobox: <T extends ComboboxItemType>(props: MultiCom
|
|
|
35
35
|
export type GridFilterComboboxProps<T extends ComboboxItemType> = Omit<MultiComboboxProps<T>, 'showSelectAllCheckbox' | 'searchable' | 'renderInput' | 'renderInputValues'> & {
|
|
36
36
|
showSelectedCount?: boolean;
|
|
37
37
|
};
|
|
38
|
+
export declare const GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME: string;
|
|
38
39
|
export declare const GridFilterCombobox: <T extends ComboboxItemType>(props: GridFilterComboboxProps<T>) => React.JSX.Element;
|
|
@@ -31,9 +31,13 @@ const AdaptableComboboxList = (props) => {
|
|
|
31
31
|
const label = isUncreatedCreatable ? `Create "${item.label}"` : item.label;
|
|
32
32
|
const itemLabel = props.renderItemLabel ? props.renderItemLabel(label, item) : label;
|
|
33
33
|
const itemContent = isUncreatedCreatable ? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, {}), " ", itemLabel] })) : (itemLabel);
|
|
34
|
-
const
|
|
35
|
-
const tooltipText =
|
|
36
|
-
|
|
34
|
+
const itemText = getItemTextLabel(item);
|
|
35
|
+
const tooltipText = props.showItemTooltip && itemText != null
|
|
36
|
+
? isUncreatedCreatable
|
|
37
|
+
? `Create "${itemText}"`
|
|
38
|
+
: itemText
|
|
39
|
+
: undefined;
|
|
40
|
+
const itemElement = (_jsx(ComboboxItem, { value: item, "aria-label": itemText ?? undefined, className: 'ab-Combobox-Row', disabled: item.disabled, renderCheckboxIndicator: props.renderCheckboxIndicator, children: itemContent }, item.value));
|
|
37
41
|
if (tooltipText != null) {
|
|
38
42
|
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: itemElement, children: itemContent }), _jsx(TooltipContent, { side: "right", children: tooltipText })] }, item.value));
|
|
39
43
|
}
|
|
@@ -88,9 +92,15 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
88
92
|
const internalDefaultValue = props.multiple
|
|
89
93
|
? valueToItems(props.defaultValue, itemByValue)
|
|
90
94
|
: valueToItem(props.defaultValue, itemByValue);
|
|
91
|
-
const handleValueChange = (next) => {
|
|
95
|
+
const handleValueChange = (next, eventDetails) => {
|
|
92
96
|
if (!props.onValueChange)
|
|
93
97
|
return;
|
|
98
|
+
// base-ui clears the selected value when Escape is pressed
|
|
99
|
+
// we only want to allow this if the clearOnEscape prop is true
|
|
100
|
+
if (eventDetails?.reason === 'escape-key' && !props.clearOnEscape) {
|
|
101
|
+
eventDetails.cancel?.();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
94
104
|
if (Array.isArray(next)) {
|
|
95
105
|
props.onValueChange(toStringValues(next), next);
|
|
96
106
|
}
|
|
@@ -98,6 +108,15 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
98
108
|
props.onValueChange(toStringValue(next), next);
|
|
99
109
|
}
|
|
100
110
|
};
|
|
111
|
+
const handleInputValueChange = (next, eventDetails) => {
|
|
112
|
+
// base-ui blanks the input text (and then the selected value) when Escape is pressed
|
|
113
|
+
// we only want to allow this if the clearOnEscape prop is true
|
|
114
|
+
if (eventDetails?.reason === 'escape-key' && !props.clearOnEscape) {
|
|
115
|
+
eventDetails.cancel?.();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
props.onInputValueChange?.(next);
|
|
119
|
+
};
|
|
101
120
|
let comboboxItems = props.groups ?? props.items;
|
|
102
121
|
if (props.isCreatable && allItems[allItems.length - 1]?.creatable) {
|
|
103
122
|
// let's detect all "creatable" items and add them to the combobox items
|
|
@@ -113,7 +132,7 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
113
132
|
}
|
|
114
133
|
comboboxItems = [...comboboxItems, ...creatableItems];
|
|
115
134
|
}
|
|
116
|
-
return (_jsx(Combobox, { ...props, items: comboboxItems, isItemEqualToValue: isItemEqualToValue, itemToStringLabel: getItemTextLabel, value: internalValue, defaultValue: internalDefaultValue, onValueChange: handleValueChange, "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], disabled: props.disabled, open: props.open, onOpenChange: props.onOpenChange, multiple: props.multiple, filter: props.filter, autoHighlight: true, children: props.children }));
|
|
135
|
+
return (_jsx(Combobox, { ...props, items: comboboxItems, isItemEqualToValue: isItemEqualToValue, itemToStringLabel: getItemTextLabel, value: internalValue, defaultValue: internalDefaultValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], disabled: props.disabled, open: props.open, onOpenChange: props.onOpenChange, multiple: props.multiple, filter: props.filter, autoHighlight: true, children: props.children }));
|
|
117
136
|
};
|
|
118
137
|
const useGetAllItems = (props) => {
|
|
119
138
|
const allItems = props.groups
|
|
@@ -385,7 +404,7 @@ const MultiCombobox_SimpleSearchable = (props) => {
|
|
|
385
404
|
const shouldKeepTrigger = props.searchable === false && selectedItems.length > 0;
|
|
386
405
|
return (_jsxs(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : (_jsx(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? (_jsxs(_Fragment, { children: [_jsx(ComboboxChipsInput, { placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: props.searchable === false, onFocus: props.onFocus, onBlur: props.onBlur, className: props.searchable === false && selectedItems.length > 0
|
|
387
406
|
? 'twa:absolute! twa:inset-0 twa:min-h-auto! twa:max-h-auto!' // so we fill the parent container and on click we can open the combobox as usual
|
|
388
|
-
: 'twa:flex-1' }), props.searchable === false && selectedItems.length > 0 ? (_jsx("div", { className: "twa:flex-1" })) : null, _jsx("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group twa:z-10", children: _jsxs(InputGroupAddon, { align: "inline-end", className: "twa:p-0 px twa:gap-0.5", children: [props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), _jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, { className: "twa:min-h-auto!" }), "data-slot": "
|
|
407
|
+
: 'twa:flex-1' }), props.searchable === false && selectedItems.length > 0 ? (_jsx("div", { className: "twa:flex-1" })) : null, _jsx("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group twa:z-10", children: _jsxs(InputGroupAddon, { align: "inline-end", className: "twa:p-0 px twa:gap-0.5", children: [props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), _jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, { className: "twa:min-h-auto!" }), "data-slot": "combobox-toggle", className: clsx(`twa:data-pressed:bg-transparent`, shouldKeepTrigger
|
|
389
408
|
? ''
|
|
390
409
|
: 'twa:group-has-data-[slot=combobox-clear]/input-group:hidden'), disabled: isDisabled }), showClear && _jsx(ComboboxClear, { disabled: isDisabled })] }) })] })) : null] }));
|
|
391
410
|
} }) }), _jsx(ComboboxContent, { anchor: anchor, style: getContentStyle({ maxLabelLength }), resizable: props.resizable, children: _jsx(AdaptableComboboxList, { searchable: props.searchable, emptyText: emptyText, renderItemLabel: props.renderItemLabel, showSelectAllCheckbox: props.showSelectAllCheckbox, renderCheckboxIndicator: props.renderCheckboxIndicator ?? true, onCheckAllChange: onCheckAllChange, totalCount: allItems.length, groups: props.groups, virtualized: !!props.virtualized, showItemTooltip: !!props.showItemTooltip, open: props.open, isLoading: props.isLoading }) })] }));
|
|
@@ -474,11 +493,11 @@ const MultiCombobox_MenuListSearchable = (props) => {
|
|
|
474
493
|
props.onBlur?.();
|
|
475
494
|
}
|
|
476
495
|
}, className: clsx('twa:relative', props.className, _props?.className), children: _jsx(ComboboxValue, { children: (selectedItems) => {
|
|
477
|
-
return (_jsxs(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : (_jsx(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? (_jsx(_Fragment, { children: _jsx(ComboboxChipsInput, { ref: chipsInputRef, placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: true, value: '', className: 'twa:flex-1' }) })) : (_jsx("div", { className: "twa:flex-1" })), _jsx("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group", children: _jsxs(InputGroupAddon, { align: "inline-end", className: "twa:p-0 px", children: [props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), _jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, { className: "twa:min-h-auto!", ref: chevronRef, "data-slot": "
|
|
496
|
+
return (_jsxs(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : (_jsx(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? (_jsx(_Fragment, { children: _jsx(ComboboxChipsInput, { ref: chipsInputRef, placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: true, value: '', className: 'twa:flex-1' }) })) : (_jsx("div", { className: "twa:flex-1" })), _jsx("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group", children: _jsxs(InputGroupAddon, { align: "inline-end", className: "twa:p-0 px", children: [props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), _jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, { className: "twa:min-h-auto!", ref: chevronRef, "data-slot": "combobox-toggle",
|
|
478
497
|
// we already have the role="combobox" on the parent
|
|
479
498
|
// so we want to avoid the same role twice in the component,
|
|
480
499
|
// hence we use the role="widget" here.
|
|
481
|
-
role: "widget" }), "data-slot": "
|
|
500
|
+
role: "widget" }), "data-slot": "combobox-toggle", className: clsx(`twa:data-pressed:bg-transparent`, 'twa:group-has-data-[slot=combobox-clear]/input-group:hidden'), disabled: isDisabled }), showClear && _jsx(ComboboxClear, { disabled: isDisabled })] }) })] }));
|
|
482
501
|
} }) }));
|
|
483
502
|
};
|
|
484
503
|
return (_jsxs(AdaptableCombobox_Root, { ...props, value: value, multiple: true, allItems: allItems, itemByValue: itemByValue, inputValue: inputValue, onInputValueChange: onInputValueChange, onValueChange: onValueChange, onOpenChange: onOpenChange, children: [props.renderInput === false ? (_jsx(ComboboxTrigger, { nativeButton: false, render: renderChips })) : (renderChips(undefined)), _jsxs(ComboboxContent, { anchor: anchor, style: getContentStyle({ maxLabelLength }), resizable: props.resizable, contentRef: contentRefCallback, children: [_jsx(ComboboxInput, { placeholder: 'Filter...', showClear: false, ref: searchInputRef, showTrigger: false, disabled: isDisabled, onFocus: handleFocus, onBlur: handleBlur, role: "searchbox", className: 'twa:min-h-input', children: typeof props.renderSearchInputTrailing === 'function'
|
|
@@ -495,6 +514,16 @@ export const MultiCombobox = (props) => {
|
|
|
495
514
|
const showItemTooltip = props.showItemTooltip ?? !!props.virtualized;
|
|
496
515
|
return searchable === 'menulist' ? (_jsx(MultiCombobox_MenuListSearchable, { renderInput: false, ...props, multiple: true, open: open, onOpenChange: onOpenChange, searchable: searchable, showItemTooltip: showItemTooltip })) : (_jsx(MultiCombobox_SimpleSearchable, { ...props, open: open, multiple: true, onOpenChange: onOpenChange, searchable: searchable, showItemTooltip: showItemTooltip }));
|
|
497
516
|
};
|
|
517
|
+
export const GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME = cn(
|
|
518
|
+
// remove the border/shadow and position it properly
|
|
519
|
+
// to adjust for outline on the input
|
|
520
|
+
'twa:[.ab-FloatingFilter_&]:border-none twa:[.ab-FloatingFilter_&]:inset-y-0.5 twa:[.ab-FloatingFilter_&]:inset-x-0 twa:[.ab-FloatingFilter_&]:absolute twa:[.ab-FloatingFilter_&]:shadow-none twa:[.ab-FloatingFilter_&]:min-h-auto!',
|
|
521
|
+
// more adjustments for very compact ag grid themes
|
|
522
|
+
'twa:[.ab-FloatingFilter_&]:[line-height:1]', 'twa:[.ab-FloatingFilter_[data-slot=combobox-trigger]]:py-0',
|
|
523
|
+
// also for very compact ag grid themes
|
|
524
|
+
// make the floating-filter combobox a size container so the toggle can
|
|
525
|
+
// shrink purely via CSS when the control is small in height (see ColumnFilter/base.css)
|
|
526
|
+
'twa:[.ab-FloatingFilter_&]:[container-type:size]');
|
|
498
527
|
export const GridFilterCombobox = (props) => {
|
|
499
528
|
const { showSelectedCount = false, placeholder = 'Select...', ...comboboxProps } = props;
|
|
500
529
|
const sharedProps = {
|
|
@@ -514,10 +543,7 @@ export const GridFilterCombobox = (props) => {
|
|
|
514
543
|
return (_jsx(_Fragment, { children: _jsxs("div", { className: "twa:text-ellipsis twa:overflow-hidden twa:whitespace-nowrap twa:flex-1000", "data-slot": "combobox-selected-values", children: [showSelectedCount && items.length > 0 && (_jsxs("span", { "data-name": "multiple-values-count", className: "twa:mr-0.5", children: ["(", items.length, ")"] })), children] }) }));
|
|
515
544
|
},
|
|
516
545
|
};
|
|
517
|
-
const className = cn(
|
|
518
|
-
// remove the border/shadow and position it properly
|
|
519
|
-
// to adjust for outline on the input
|
|
520
|
-
'twa:[.ab-FloatingFilter_&]:border-none twa:[.ab-FloatingFilter_&]:inset-y-0.5 twa:[.ab-FloatingFilter_&]:inset-x-0 twa:[.ab-FloatingFilter_&]:absolute twa:[.ab-FloatingFilter_&]:shadow-none twa:[.ab-FloatingFilter_&]:min-h-auto!', comboboxProps.className);
|
|
546
|
+
const className = cn(GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME, comboboxProps.className);
|
|
521
547
|
const mergedProps = {
|
|
522
548
|
...sharedProps,
|
|
523
549
|
...comboboxProps,
|