@adaptabletools/adaptable 23.0.5-canary.0 → 23.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +0 -64
- package/package.json +1 -1
- package/src/AdaptableState/Aggregations/weightedAverage.d.ts +0 -1
- package/src/AdaptableState/Aggregations/weightedAverage.js +1 -1
- package/src/components/CodeBlock/index.d.ts +0 -1
- package/src/components/CodeBlock/index.js +1 -2
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/NamedObject.d.ts +0 -10
- package/src/AdaptableState/Common/NamedObject.js +0 -1
- package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +0 -35
- package/src/Utilities/ExpressionFunctions/groupingMap.js +0 -91
- package/src/Utilities/Interface/AdaptableToolPanelContext.d.ts +0 -4
- package/src/Utilities/Interface/AdaptableToolPanelContext.js +0 -1
- package/src/View/Components/Buttons/EntityListActionButtons.d.ts +0 -38
- package/src/View/Components/Buttons/EntityListActionButtons.js +0 -41
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.d.ts +0 -12
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +0 -66
- package/src/View/Components/EntityRowItem.d.ts +0 -7
- package/src/View/Components/EntityRowItem.js +0 -7
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +0 -3
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +0 -5
- package/src/View/Components/ModuleProfile.d.ts +0 -8
- package/src/View/Components/ModuleProfile.js +0 -10
- package/src/View/Components/ModuleSummary/ModuleDetail.d.ts +0 -23
- package/src/View/Components/ModuleSummary/ModuleDetail.js +0 -15
- package/src/View/Components/ModuleSummary/ModuleHeader.d.ts +0 -15
- package/src/View/Components/ModuleSummary/ModuleHeader.js +0 -15
- package/src/View/Components/ModuleSummary/SummaryRowItem.d.ts +0 -7
- package/src/View/Components/ModuleSummary/SummaryRowItem.js +0 -12
- package/src/View/Components/SharedProps/ModuleSummaryProps.d.ts +0 -9
- package/src/View/Components/SharedProps/ModuleSummaryProps.js +0 -1
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.d.ts +0 -13
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.js +0 -1
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.d.ts +0 -14
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.js +0 -1
- package/src/View/Components/StyleVisualItem.d.ts +0 -9
- package/src/View/Components/StyleVisualItem.js +0 -40
- package/src/View/Components/WizardSummaryPage.d.ts +0 -7
- package/src/View/Components/WizardSummaryPage.js +0 -17
- package/src/components/Accordion.d.ts +0 -7
- package/src/components/Accordion.js +0 -33
- package/src/components/FlexWithFooter.d.ts +0 -9
- package/src/components/FlexWithFooter.js +0 -13
- package/src/components/NotifyResize/index.d.ts +0 -9
- package/src/components/NotifyResize/index.js +0 -35
- package/src/components/PopupWithFooter.d.ts +0 -14
- package/src/components/PopupWithFooter.js +0 -11
- package/src/components/SelectableList/index.d.ts +0 -15
- package/src/components/SelectableList/index.js +0 -88
- package/src/components/SizedContainer/index.d.ts +0 -17
- package/src/components/SizedContainer/index.js +0 -20
- package/src/components/Table/index.d.ts +0 -4
- package/src/components/Table/index.js +0 -6
- package/src/components/WizardPanel/index.d.ts +0 -9
- package/src/components/WizardPanel/index.js +0 -7
- package/src/components/icons/align-justify.d.ts +0 -3
- package/src/components/icons/align-justify.js +0 -3
- package/src/components/icons/column-info.d.ts +0 -3
- package/src/components/icons/column-info.js +0 -3
- package/src/components/icons/gradient-column.d.ts +0 -3
- package/src/components/icons/gradient-column.js +0 -3
- package/src/components/icons/invalid.d.ts +0 -3
- package/src/components/icons/invalid.js +0 -3
- package/src/components/icons/logout copy.d.ts +0 -3
- package/src/components/icons/logout copy.js +0 -3
- package/src/components/icons/smart-edit.d.ts +0 -3
- package/src/components/icons/smart-edit.js +0 -3
- package/src/components/icons/team-share.d.ts +0 -3
- package/src/components/icons/team-share.js +0 -3
- package/src/components/icons/unchecked.d.ts +0 -3
- package/src/components/icons/unchecked.js +0 -3
- package/src/components/icons/user-filter.d.ts +0 -3
- package/src/components/icons/user-filter.js +0 -3
- package/src/components/utils/useContainerScrollObserver/index.d.ts +0 -6
- package/src/components/utils/useContainerScrollObserver/index.js +0 -79
- package/src/components/utils/useGlobalEvent.d.ts +0 -1
- package/src/components/utils/useGlobalEvent.js +0 -7
- package/src/components/utils/useLatest.d.ts +0 -1
- package/src/components/utils/useLatest.js +0 -6
- package/src/components/utils/usePropState.d.ts +0 -2
- package/src/components/utils/usePropState.js +0 -8
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AdaptableObject } from './AdaptableObject';
|
|
2
|
-
/**
|
|
3
|
-
* Interface that extends Adaptable Object for those config items that have a Name
|
|
4
|
-
*/
|
|
5
|
-
export interface NamedObject extends AdaptableObject {
|
|
6
|
-
/**
|
|
7
|
-
* Name of the Adaptable Object
|
|
8
|
-
*/
|
|
9
|
-
Name: string;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { DeepMap } from './deepMap';
|
|
2
|
-
export type GroupKeyType<T extends any = any> = T;
|
|
3
|
-
export type GroupBy<DataType, KeyType> = {
|
|
4
|
-
field: keyof DataType;
|
|
5
|
-
toKey?: (value: any, data: DataType) => GroupKeyType<KeyType>;
|
|
6
|
-
};
|
|
7
|
-
export type GroupParams<DataType, KeyType> = {
|
|
8
|
-
groupBy: GroupBy<DataType, KeyType>[];
|
|
9
|
-
defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
|
|
10
|
-
reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
|
|
11
|
-
};
|
|
12
|
-
export type DataSourceAggregationReducer<T, AggregationResultType> = {
|
|
13
|
-
name?: string;
|
|
14
|
-
field?: keyof T;
|
|
15
|
-
initialValue?: AggregationResultType;
|
|
16
|
-
getter?: (data: T) => any;
|
|
17
|
-
reducer: string | ((accumulator: any, value: any, data: T) => AggregationResultType | any);
|
|
18
|
-
done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
|
|
19
|
-
};
|
|
20
|
-
export type DataGroupResult<DataType, KeyType extends any> = {
|
|
21
|
-
deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
|
|
22
|
-
groupParams: GroupParams<DataType, KeyType>;
|
|
23
|
-
initialData: DataType[];
|
|
24
|
-
reducerResults?: Record<string, any>;
|
|
25
|
-
};
|
|
26
|
-
export type DeepMapGroupValueType<DataType, KeyType> = {
|
|
27
|
-
items: DataType[];
|
|
28
|
-
commonData?: Partial<DataType>;
|
|
29
|
-
reducerResults: Record<string, any>;
|
|
30
|
-
};
|
|
31
|
-
export type AggregationReducerResult<AggregationResultType extends any = any> = {
|
|
32
|
-
value: AggregationResultType;
|
|
33
|
-
id: string;
|
|
34
|
-
};
|
|
35
|
-
export declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { DeepMap } from './deepMap';
|
|
2
|
-
function DEFAULT_TO_KEY(value) {
|
|
3
|
-
return value;
|
|
4
|
-
}
|
|
5
|
-
export function group(groupParams, data) {
|
|
6
|
-
const { groupBy, defaultToKey = DEFAULT_TO_KEY, reducers } = groupParams;
|
|
7
|
-
const groupByLength = groupBy.length;
|
|
8
|
-
const deepMap = new DeepMap();
|
|
9
|
-
let currentGroupKeys = [];
|
|
10
|
-
const initialReducerValue = initReducers(reducers);
|
|
11
|
-
const globalReducerResults = { ...initialReducerValue };
|
|
12
|
-
for (let i = 0, len = data.length; i < len; i++) {
|
|
13
|
-
let item = data[i];
|
|
14
|
-
for (let groupByIndex = 0; groupByIndex < groupByLength; groupByIndex++) {
|
|
15
|
-
const { field: groupByProperty, toKey: groupToKey } = groupBy[groupByIndex];
|
|
16
|
-
const key = (groupToKey || defaultToKey)(item[groupByProperty], item);
|
|
17
|
-
currentGroupKeys.push(key);
|
|
18
|
-
if (!deepMap.has(currentGroupKeys)) {
|
|
19
|
-
const deepMapGroupValue = {
|
|
20
|
-
items: [],
|
|
21
|
-
reducerResults: { ...initialReducerValue },
|
|
22
|
-
};
|
|
23
|
-
deepMap.set(currentGroupKeys, deepMapGroupValue);
|
|
24
|
-
}
|
|
25
|
-
const { items: currentGroupItems, reducerResults } = deepMap.get(currentGroupKeys);
|
|
26
|
-
currentGroupItems.push(item);
|
|
27
|
-
if (reducers) {
|
|
28
|
-
computeReducersFor(item, reducers, reducerResults);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (reducers) {
|
|
32
|
-
computeReducersFor(item, reducers, globalReducerResults);
|
|
33
|
-
}
|
|
34
|
-
currentGroupKeys.length = 0;
|
|
35
|
-
}
|
|
36
|
-
const hasReducersWithDoneFn = reducers && Object.values(reducers).some((reducer) => reducer.done);
|
|
37
|
-
if (hasReducersWithDoneFn) {
|
|
38
|
-
deepMap.visitDepthFirst((deepMapValue, _keys, _indexInGroup, next) => {
|
|
39
|
-
completeReducers(reducers, deepMapValue.reducerResults, deepMapValue.items);
|
|
40
|
-
next?.();
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
if (hasReducersWithDoneFn) {
|
|
44
|
-
completeReducers(reducers, globalReducerResults, data);
|
|
45
|
-
}
|
|
46
|
-
const result = {
|
|
47
|
-
deepMap,
|
|
48
|
-
groupParams,
|
|
49
|
-
initialData: data,
|
|
50
|
-
reducerResults: globalReducerResults,
|
|
51
|
-
};
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
function initReducers(reducers) {
|
|
55
|
-
if (!reducers || !Object.keys(reducers).length) {
|
|
56
|
-
return {};
|
|
57
|
-
}
|
|
58
|
-
const result = {};
|
|
59
|
-
for (let key in reducers)
|
|
60
|
-
if (reducers.hasOwnProperty(key)) {
|
|
61
|
-
result[key] = reducers[key].initialValue;
|
|
62
|
-
}
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
function computeReducersFor(data, reducers, reducerResults) {
|
|
66
|
-
if (!reducers || !Object.keys(reducers).length) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
for (let key in reducers)
|
|
70
|
-
if (reducers.hasOwnProperty(key)) {
|
|
71
|
-
const reducer = reducers[key];
|
|
72
|
-
if (typeof reducer.reducer !== 'function') {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
const currentValue = reducerResults[key];
|
|
76
|
-
const value = reducer.field ? data[reducer.field] : reducer.getter?.(data) ?? null;
|
|
77
|
-
reducerResults[key] = reducer.reducer(currentValue, value, data);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function completeReducers(reducers, reducerResults, items) {
|
|
81
|
-
if (reducers) {
|
|
82
|
-
for (let key in reducers)
|
|
83
|
-
if (reducers.hasOwnProperty(key)) {
|
|
84
|
-
const reducer = reducers[key];
|
|
85
|
-
if (reducer.done) {
|
|
86
|
-
reducerResults[key] = reducer.done(reducerResults[key], items);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return reducerResults;
|
|
91
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as Redux from 'redux';
|
|
3
|
-
import { AccessLevel } from '../../../AdaptableState/Common/Entitlement';
|
|
4
|
-
import { AdaptableSharedEntityConfig } from '../../../AdaptableState/TeamSharingState';
|
|
5
|
-
import { AdaptableObject, SuspendableObject } from '../../../AdaptableState/Common/AdaptableObject';
|
|
6
|
-
export interface EntityListActionButtonsProps extends React.ClassAttributes<EntityListActionButtons> {
|
|
7
|
-
editClick?: () => void;
|
|
8
|
-
cloneClick?: () => void;
|
|
9
|
-
shareClick?: (config: AdaptableSharedEntityConfig) => void;
|
|
10
|
-
showEdit?: boolean;
|
|
11
|
-
showClone?: boolean;
|
|
12
|
-
showDelete?: boolean;
|
|
13
|
-
showShare?: boolean;
|
|
14
|
-
showSuspend?: boolean;
|
|
15
|
-
onSuspend?: (adaptableObject: AdaptableObject) => void;
|
|
16
|
-
onUnSuspend?: (adaptableObject: AdaptableObject) => void;
|
|
17
|
-
overrideDisableEdit?: boolean;
|
|
18
|
-
overrideDisableDelete?: boolean;
|
|
19
|
-
overrideDisableClone?: boolean;
|
|
20
|
-
overrideDisableShare?: boolean;
|
|
21
|
-
overrideTooltipEdit?: string;
|
|
22
|
-
overrideTooltipClone?: string;
|
|
23
|
-
overrideTooltipDelete?: string;
|
|
24
|
-
overrideTooltipShare?: string;
|
|
25
|
-
confirmDeleteAction: Redux.Action;
|
|
26
|
-
entityType: string;
|
|
27
|
-
justifyContent?: 'start' | 'center' | 'end';
|
|
28
|
-
accessLevel: AccessLevel;
|
|
29
|
-
cloneAccessLevel?: AccessLevel;
|
|
30
|
-
editSize: any;
|
|
31
|
-
deleteSize: any;
|
|
32
|
-
shareSize: any;
|
|
33
|
-
suspendableObject: SuspendableObject;
|
|
34
|
-
}
|
|
35
|
-
export declare class EntityListActionButtons extends React.Component<EntityListActionButtonsProps, {}> {
|
|
36
|
-
static defaultProps: EntityListActionButtonsProps;
|
|
37
|
-
render(): React.JSX.Element;
|
|
38
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { ButtonEdit } from './ButtonEdit';
|
|
4
|
-
import { ButtonClone } from './ButtonClone';
|
|
5
|
-
import { ButtonDelete } from './ButtonDelete';
|
|
6
|
-
import { ButtonShare } from './ButtonShare';
|
|
7
|
-
import { SuspendToggleButton } from './SuspendToggleButton/SuspendToggleButton';
|
|
8
|
-
import { cn } from '../../../lib/utils';
|
|
9
|
-
import { ACCESS_LEVEL_FULL, ACCESS_LEVEL_READ_ONLY, } from '../../../Utilities/Constants/GeneralConstants';
|
|
10
|
-
import { Flex } from '../../../components/Flex';
|
|
11
|
-
const stopPropagation = (e) => {
|
|
12
|
-
e.stopPropagation();
|
|
13
|
-
};
|
|
14
|
-
export class EntityListActionButtons extends React.Component {
|
|
15
|
-
static defaultProps = {
|
|
16
|
-
suspendableObject: null,
|
|
17
|
-
showEdit: true,
|
|
18
|
-
showDelete: true,
|
|
19
|
-
showShare: false,
|
|
20
|
-
showSuspend: false,
|
|
21
|
-
overrideDisableEdit: false,
|
|
22
|
-
overrideDisableDelete: false,
|
|
23
|
-
overrideDisableClone: false,
|
|
24
|
-
overrideDisableShare: false,
|
|
25
|
-
confirmDeleteAction: null,
|
|
26
|
-
entityType: '',
|
|
27
|
-
accessLevel: ACCESS_LEVEL_FULL,
|
|
28
|
-
editSize: 'xsmall',
|
|
29
|
-
deleteSize: 'xsmall',
|
|
30
|
-
shareSize: 'xsmall',
|
|
31
|
-
};
|
|
32
|
-
render() {
|
|
33
|
-
const { justifyContent } = this.props;
|
|
34
|
-
const justifyContentClassName = cn({
|
|
35
|
-
'twa:justify-start': justifyContent === 'start',
|
|
36
|
-
'twa:justify-center': justifyContent === 'center',
|
|
37
|
-
'twa:justify-end': justifyContent === 'end',
|
|
38
|
-
}) || 'twa:justify-center';
|
|
39
|
-
return (_jsxs(Flex, { className: `${justifyContentClassName} twa:m-0 twa:p-0`, onClick: stopPropagation, children: [this.props.showEdit && (_jsx(ButtonEdit, { onClick: () => (this.props.editClick ? this.props.editClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-action-edit-foreground twa:bg-action-edit twa:fill-action-edit-foreground`, disabled: this.props.overrideDisableEdit || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipEdit, accessLevel: this.props.accessLevel })), this.props.showClone && (_jsx(ButtonClone, { onClick: () => (this.props.cloneClick ? this.props.cloneClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-action-clone-foreground twa:bg-action-clone twa:fill-action-clone-foreground`, children: null, disabled: this.props.overrideDisableClone || this.props.cloneAccessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipClone, accessLevel: this.props.cloneAccessLevel })), this.props.showDelete && (_jsx(ButtonDelete, { "data-name": "delete", className: `twa:mx-[px] twa:my-[2px] twa:text-action-delete-foreground twa:bg-action-delete twa:fill-action-delete-foreground`, disabled: this.props.overrideDisableDelete || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipDelete, ConfirmAction: this.props.confirmDeleteAction, ConfirmationMsg: 'Are you sure you want to delete this ' + this.props.entityType + '?', ConfirmationTitle: 'Delete ' + this.props.entityType, accessLevel: this.props.accessLevel })), this.props.showShare && (_jsx(ButtonShare, { className: `twa:mx-[1px] twa:my-[2px] twa:text-action-share-foreground twa:bg-action-share twa:fill-action-share-foreground`, onShare: (config) => this.props.shareClick ? this.props.shareClick(config) : null, Header: `TeamSharing ${this.props.entityType}`, disabled: this.props.overrideDisableShare || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipShare, accessLevel: this.props.accessLevel })), this.props.showSuspend && this.props.suspendableObject && (_jsx(SuspendToggleButton, { className: "twa:align-self-center", iconSize: 24, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend, suspendableObject: this.props.suspendableObject, disabled: this.props.accessLevel == ACCESS_LEVEL_READ_ONLY }))] }));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { QlPredicate, QlPredicateDef } from '../../../../parser/src/predicate';
|
|
3
|
-
interface ColumnFilterMenuProps {
|
|
4
|
-
columnId: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
predicate?: QlPredicate;
|
|
7
|
-
predicateDefs: QlPredicateDef[];
|
|
8
|
-
onPredicateChange: (predicate: QlPredicate) => void;
|
|
9
|
-
multiple?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const ColumnFilterMenu: React.FunctionComponent<ColumnFilterMenuProps>;
|
|
12
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import Panel from '../../../../components/Panel';
|
|
4
|
-
import SimpleButton from '../../../../components/SimpleButton';
|
|
5
|
-
import { Box, Flex } from '../../../../components/Flex';
|
|
6
|
-
import { useEffect, useLayoutEffect } from 'react';
|
|
7
|
-
import { cn } from '../../../../lib/utils';
|
|
8
|
-
const ColumnFilterMenuItem = ({ active, onClick, icon, label, }) => {
|
|
9
|
-
return (_jsxs(SimpleButton, { className: "twa:p-1 twa:w-full", variant: "text", tone: active ? 'info' : 'none', onClick: onClick, "aria-label": label, children: [_jsx(Box, { className: "twa:mr-2", children: icon }), _jsx(Box, { className: "twa:text-2", children: label })] }));
|
|
10
|
-
};
|
|
11
|
-
export const ColumnFilterMenu = (props) => {
|
|
12
|
-
const [activeIndex, setActiveIndex] = React.useState(() => {
|
|
13
|
-
const index = props.predicateDefs.findIndex((predicateDef) => predicateDef.operator === props.predicate.operator);
|
|
14
|
-
return index === -1 ? 0 : index;
|
|
15
|
-
});
|
|
16
|
-
const activeIndexRef = React.useRef(activeIndex);
|
|
17
|
-
const onPredicateChangeRef = React.useRef(props.onPredicateChange);
|
|
18
|
-
const predicateDefsRef = React.useRef(props.predicateDefs);
|
|
19
|
-
useLayoutEffect(() => {
|
|
20
|
-
activeIndexRef.current = activeIndex;
|
|
21
|
-
onPredicateChangeRef.current = props.onPredicateChange;
|
|
22
|
-
predicateDefsRef.current = props.predicateDefs;
|
|
23
|
-
});
|
|
24
|
-
const confirm = React.useCallback((predicateDef) => {
|
|
25
|
-
onPredicateChangeRef.current({ operator: predicateDef.operator, args: [] });
|
|
26
|
-
}, []);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const onKeyDown = (e) => {
|
|
29
|
-
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp' && e.key !== 'Enter') {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const activeIndex = activeIndexRef.current;
|
|
33
|
-
const predicateDefs = predicateDefsRef.current;
|
|
34
|
-
if (e.key === 'Enter') {
|
|
35
|
-
const predicateDef = predicateDefs[activeIndex];
|
|
36
|
-
if (predicateDef) {
|
|
37
|
-
confirm(predicateDef);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
e.stopPropagation();
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
const dir = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : 0;
|
|
43
|
-
if (dir) {
|
|
44
|
-
let nextIndex = activeIndex + dir;
|
|
45
|
-
if (nextIndex < 0) {
|
|
46
|
-
nextIndex = predicateDefs.length - 1;
|
|
47
|
-
}
|
|
48
|
-
else if (nextIndex >= predicateDefs.length) {
|
|
49
|
-
nextIndex = 0;
|
|
50
|
-
}
|
|
51
|
-
setActiveIndex(nextIndex);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
document.addEventListener('keydown', onKeyDown);
|
|
55
|
-
return () => {
|
|
56
|
-
document.removeEventListener('keydown', onKeyDown);
|
|
57
|
-
};
|
|
58
|
-
}, [confirm]);
|
|
59
|
-
return (_jsx(Panel, { className: "twa:min-w-max", children: props.predicateDefs?.map((predicateDef, index) => {
|
|
60
|
-
const active = activeIndex === index;
|
|
61
|
-
return (_jsx(Flex, { className: cn('twa:mb-1', active && 'twa:bg-primarylight'), onMouseDownCapture: (e) => {
|
|
62
|
-
e.stopPropagation();
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
}, children: _jsx(ColumnFilterMenuItem, { onClick: () => confirm(predicateDef), icon: predicateDef.icon, label: predicateDef.label, active: active }) }, index));
|
|
65
|
-
}) }));
|
|
66
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { AdaptableColumn } from '../../../AdaptableState/Common/AdaptableColumn';
|
|
2
|
-
import { SystemFilterPredicateId } from '../../../types';
|
|
3
|
-
export declare const getDefaultColumnFilterPredicate: (column: AdaptableColumn, defaultColumnFilter: SystemFilterPredicateId | ((column: AdaptableColumn) => SystemFilterPredicateId)) => SystemFilterPredicateId;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ModuleInfo } from '../../Strategy/Interface/IModule';
|
|
3
|
-
export interface ModuleProfileProps extends React.ClassAttributes<ModuleProfile> {
|
|
4
|
-
moduleInfo: ModuleInfo;
|
|
5
|
-
}
|
|
6
|
-
export declare class ModuleProfile extends React.Component<ModuleProfileProps, {}> {
|
|
7
|
-
render(): any;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Icon } from '../../components/icons';
|
|
4
|
-
export class ModuleProfile extends React.Component {
|
|
5
|
-
render() {
|
|
6
|
-
return (_jsxs("div", { children: [_jsx(Icon, { name: this.props.moduleInfo.Glyph, style: {
|
|
7
|
-
fill: 'var(--ab-color-primary-foreground)',
|
|
8
|
-
} }), ' ', this.props.moduleInfo.FriendlyName] }));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as Redux from 'redux';
|
|
3
|
-
import { AdaptableObject } from '../../../AdaptableState/Common/AdaptableObject';
|
|
4
|
-
import { ModuleInfo } from '../../../Strategy/Interface/IModule';
|
|
5
|
-
import { AdaptableSharedEntityConfig } from '../../../AdaptableState/TeamSharingState';
|
|
6
|
-
import { AccessLevel } from '../../../AdaptableState/Common/Entitlement';
|
|
7
|
-
export interface ModuleDetailProps extends React.ClassAttributes<ModuleDetail> {
|
|
8
|
-
key: string;
|
|
9
|
-
item1: any;
|
|
10
|
-
item2: any;
|
|
11
|
-
configEnity: AdaptableObject;
|
|
12
|
-
moduleInfo: ModuleInfo;
|
|
13
|
-
accessLevel: AccessLevel;
|
|
14
|
-
onEdit: () => void;
|
|
15
|
-
onShare: (config: AdaptableSharedEntityConfig) => void;
|
|
16
|
-
onDelete: Redux.Action;
|
|
17
|
-
showBold?: boolean;
|
|
18
|
-
showEdit?: boolean;
|
|
19
|
-
showShare?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare class ModuleDetail extends React.Component<ModuleDetailProps, {}> {
|
|
22
|
-
render(): any;
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { EntityListActionButtons } from '../Buttons/EntityListActionButtons';
|
|
4
|
-
import { SummaryRowItem } from './SummaryRowItem';
|
|
5
|
-
export class ModuleDetail extends React.Component {
|
|
6
|
-
render() {
|
|
7
|
-
let summaryItems = [];
|
|
8
|
-
this.props.showBold
|
|
9
|
-
? summaryItems.push(_jsx("b", { children: this.props.item1 }))
|
|
10
|
-
: summaryItems.push(_jsx("i", { children: this.props.item1 }));
|
|
11
|
-
summaryItems.push(_jsx("i", { children: this.props.item2 }));
|
|
12
|
-
summaryItems.push(_jsx(EntityListActionButtons, { justifyContent: "start", confirmDeleteAction: this.props.onDelete, showEdit: this.props.showEdit, editClick: () => this.props.onEdit(), shareClick: (config) => this.props.onShare(config), showShare: this.props.showShare, entityType: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel }));
|
|
13
|
-
return _jsx(SummaryRowItem, { SummaryItems: summaryItems });
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ModuleInfo } from '../../../Strategy/Interface/IModule';
|
|
3
|
-
import { AccessLevel } from '../../../AdaptableState/Common/Entitlement';
|
|
4
|
-
export interface ModuleHeaderProps extends React.ClassAttributes<ModuleHeader> {
|
|
5
|
-
key: string;
|
|
6
|
-
moduleInfo: ModuleInfo;
|
|
7
|
-
moduleSummary: any;
|
|
8
|
-
onNew: () => void;
|
|
9
|
-
newButtonTooltip: string;
|
|
10
|
-
newButtonDisabled?: boolean;
|
|
11
|
-
accessLevel: AccessLevel;
|
|
12
|
-
}
|
|
13
|
-
export declare class ModuleHeader extends React.Component<ModuleHeaderProps, {}> {
|
|
14
|
-
render(): any;
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { ButtonNew } from '../Buttons/ButtonNew';
|
|
4
|
-
import { SummaryRowItem } from './SummaryRowItem';
|
|
5
|
-
import { ModuleProfile } from '../ModuleProfile';
|
|
6
|
-
export class ModuleHeader extends React.Component {
|
|
7
|
-
render() {
|
|
8
|
-
let summaryItems = [];
|
|
9
|
-
let newButton = this.props.newButtonDisabled ? null : (_jsx(ButtonNew, { onClick: () => this.props.onNew(), tooltip: 'Create ' + this.props.newButtonTooltip, accessLevel: this.props.accessLevel }));
|
|
10
|
-
summaryItems.push(_jsx("b", { children: _jsx(ModuleProfile, { moduleInfo: this.props.moduleInfo }) }));
|
|
11
|
-
summaryItems.push(this.props.moduleSummary);
|
|
12
|
-
summaryItems.push(newButton);
|
|
13
|
-
return _jsx(SummaryRowItem, { SummaryItems: summaryItems });
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { AdaptableObjectRow } from '../AdaptableObjectRow';
|
|
4
|
-
export class SummaryRowItem extends React.Component {
|
|
5
|
-
render() {
|
|
6
|
-
let colItems = [];
|
|
7
|
-
colItems.push({ Size: 3, Content: this.props.SummaryItems[0] });
|
|
8
|
-
colItems.push({ Size: 7, Content: this.props.SummaryItems[1] });
|
|
9
|
-
colItems.push({ Size: 2, Content: this.props.SummaryItems[2] });
|
|
10
|
-
return _jsx(AdaptableObjectRow, { colItems: colItems });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AdaptableColumn } from '../../../AdaptableState/Common/AdaptableColumn';
|
|
2
|
-
import { ModuleViewPopupProps } from './ModuleViewPopupProps';
|
|
3
|
-
import * as TeamSharingRedux from '../../../Redux/ActionsReducers/TeamSharingRedux';
|
|
4
|
-
import { AdaptableObject } from '../../../AdaptableState/Common/AdaptableObject';
|
|
5
|
-
import { AdaptableSharedEntityConfig } from '../../../AdaptableState/TeamSharingState';
|
|
6
|
-
export interface ModuleSummaryProps<View> extends ModuleViewPopupProps<View> {
|
|
7
|
-
summarisedColumn: AdaptableColumn;
|
|
8
|
-
onShare: (entity: AdaptableObject, config: AdaptableSharedEntityConfig) => TeamSharingRedux.TeamSharingShareAction;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ModuleViewPopupProps } from './ModuleViewPopupProps';
|
|
2
|
-
import * as Redux from 'redux';
|
|
3
|
-
import * as PopupRedux from '../../../Redux/ActionsReducers/PopupRedux';
|
|
4
|
-
import * as ToolPanelRedux from '../../../Redux/ActionsReducers/ToolPanelRedux';
|
|
5
|
-
import { AdaptableToolPanel } from '../../../AdaptableState/Common/Types';
|
|
6
|
-
import { ToolPanelVisibilityMode } from '../../../AdaptableState/ToolPanelState';
|
|
7
|
-
export interface ToolPanelModuleViewPopupProps<View> extends ModuleViewPopupProps<View> {
|
|
8
|
-
onClick: (action: Redux.Action) => Redux.Action;
|
|
9
|
-
onClose: (toolPanel: AdaptableToolPanel) => ToolPanelRedux.ToolPanelHideToolPanelAction;
|
|
10
|
-
onConfigure: (popup: string) => PopupRedux.PopupShowScreenAction;
|
|
11
|
-
visibilityMode: ToolPanelVisibilityMode;
|
|
12
|
-
onVisibilityModeChange: (visibilityMode: ToolPanelVisibilityMode) => void;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ModuleViewPopupProps } from './ModuleViewPopupProps';
|
|
2
|
-
import * as Redux from 'redux';
|
|
3
|
-
import * as PopupRedux from '../../../Redux/ActionsReducers/PopupRedux';
|
|
4
|
-
import * as DashboardRedux from '../../../Redux/ActionsReducers/DashboardRedux';
|
|
5
|
-
import { AdaptableDashboardToolbar } from '../../../AdaptableState/Common/Types';
|
|
6
|
-
import { CustomToolbar } from '../../../AdaptableOptions/DashboardOptions';
|
|
7
|
-
export interface CustomToolbarModuleViewPopupProps<View> extends ModuleViewPopupProps<View> {
|
|
8
|
-
customToolbar: CustomToolbar;
|
|
9
|
-
}
|
|
10
|
-
export interface ToolbarModuleViewPopupProps<View> extends ModuleViewPopupProps<View> {
|
|
11
|
-
onClick: (action: Redux.Action) => Redux.Action;
|
|
12
|
-
onConfigure: (popup: string) => PopupRedux.PopupShowScreenAction;
|
|
13
|
-
onClose: (toolBar: AdaptableDashboardToolbar) => DashboardRedux.DashboardCloseToolbarAction;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AdaptableStyle } from '../../AdaptableState/Common/AdaptableStyle';
|
|
3
|
-
export interface StyleVisualItemProps extends React.ClassAttributes<StyleVisualItem> {
|
|
4
|
-
Style: AdaptableStyle;
|
|
5
|
-
Text?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class StyleVisualItem extends React.Component<StyleVisualItemProps, {}> {
|
|
8
|
-
render(): any;
|
|
9
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { EnumExtensions } from '../../Utilities/Extensions/EnumExtensions';
|
|
4
|
-
import { FontWeight, FontStyle } from '../../AdaptableState/Common/Enums';
|
|
5
|
-
import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
6
|
-
export class StyleVisualItem extends React.Component {
|
|
7
|
-
render() {
|
|
8
|
-
if (!this.props.Style) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
let styleText = StringExtensions.IsNotNullOrEmpty(this.props.Text)
|
|
12
|
-
? this.props.Text
|
|
13
|
-
: 'Style';
|
|
14
|
-
let styleVisualisation;
|
|
15
|
-
if (this.props.Style.ClassName) {
|
|
16
|
-
styleVisualisation = _jsx("div", { children: 'CSS Class: ' + this.props.Style.ClassName });
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
let backColorForStyle = this.props.Style.BackColor != undefined ? this.props.Style.BackColor : null;
|
|
20
|
-
let foreColorForStyle = this.props.Style.ForeColor != undefined ? this.props.Style.ForeColor : 'black';
|
|
21
|
-
let borderColorForStyle = this.props.Style.BorderColor != undefined ? this.props.Style.BorderColor : null;
|
|
22
|
-
let fontWeightForStyle = this.props.Style.FontWeight == FontWeight.Bold ? 'bold' : 'normal';
|
|
23
|
-
let fontStyleForStyle = this.props.Style.FontStyle == FontStyle.Italic ? 'italic' : 'normal';
|
|
24
|
-
let fontSizeForStyle = EnumExtensions.getCssFontSizeFromFontSizeEnum(this.props.Style.FontSize);
|
|
25
|
-
styleVisualisation = (_jsx("div", { className: this.props.Style.BackColor != undefined ? '' : 'ab_white_grey_stripes', style: {
|
|
26
|
-
textAlign: 'center',
|
|
27
|
-
margin: '2px',
|
|
28
|
-
padding: '3px',
|
|
29
|
-
background: backColorForStyle,
|
|
30
|
-
color: foreColorForStyle,
|
|
31
|
-
borderColor: borderColorForStyle,
|
|
32
|
-
borderStyle: borderColorForStyle ? 'solid' : 'none',
|
|
33
|
-
fontWeight: fontWeightForStyle,
|
|
34
|
-
fontStyle: fontStyleForStyle,
|
|
35
|
-
fontSize: fontSizeForStyle,
|
|
36
|
-
}, children: styleText }));
|
|
37
|
-
}
|
|
38
|
-
return styleVisualisation;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { KeyValuePair } from '../../Utilities/Interface/KeyValuePair';
|
|
3
|
-
export interface WizardSummaryPageProps {
|
|
4
|
-
KeyValuePairs: KeyValuePair[];
|
|
5
|
-
header?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const WizardSummaryPage: (props: WizardSummaryPageProps) => React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import WizardPanel from '../../components/WizardPanel';
|
|
3
|
-
import { DataSource, InfiniteTableGrid } from '../../components/InfiniteTable';
|
|
4
|
-
const columnsMap = {
|
|
5
|
-
Key: { field: 'Key', header: 'Property', defaultFlex: 1 },
|
|
6
|
-
Value: { field: 'Value', header: 'Value', defaultFlex: 3 },
|
|
7
|
-
};
|
|
8
|
-
const tableDOMProps = {
|
|
9
|
-
className: 'ab-WizardSummary__list',
|
|
10
|
-
style: {
|
|
11
|
-
height: '100%',
|
|
12
|
-
margin: 'calc(var(--ab-base-space) * 2)',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export const WizardSummaryPage = (props) => {
|
|
16
|
-
return (_jsx(WizardPanel, { bodyProps: { className: 'twa:p-0' }, className: "ab-WizardSummary", "data-name": 'wizard-summary', children: _jsx(DataSource, { data: props.KeyValuePairs, primaryKey: "Key", children: _jsx(InfiniteTableGrid, { showZebraRows: true, domProps: tableDOMProps, columns: columnsMap }) }) }));
|
|
17
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import SimpleButton from './SimpleButton';
|
|
4
|
-
import Panel from './Panel';
|
|
5
|
-
export const Accordion = ({ title, children }) => {
|
|
6
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
-
const [height, setHeight] = useState('0px');
|
|
8
|
-
const content = useRef(null);
|
|
9
|
-
const observer = useRef(null);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
setHeight(isOpen && content.current ? `${content.current.scrollHeight}px` : '0px');
|
|
12
|
-
}, [isOpen, content]);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (content.current) {
|
|
15
|
-
observer.current = new MutationObserver(() => {
|
|
16
|
-
setHeight(`${content.current?.scrollHeight}px`);
|
|
17
|
-
});
|
|
18
|
-
observer.current.observe(content.current, { childList: true, subtree: true });
|
|
19
|
-
}
|
|
20
|
-
return () => {
|
|
21
|
-
observer.current?.disconnect();
|
|
22
|
-
};
|
|
23
|
-
}, []);
|
|
24
|
-
const toggleAccordion = () => {
|
|
25
|
-
setIsOpen(!isOpen);
|
|
26
|
-
};
|
|
27
|
-
return (_jsxs(Panel, { className: "ab-Accordion", children: [_jsx(SimpleButton, { iconPosition: "end", icon: isOpen ? 'expand-all' : 'collapse-all', variant: "text", onClick: toggleAccordion, style: { width: '100%', textAlign: 'left' }, children: title }), _jsx("div", { ref: content, style: {
|
|
28
|
-
maxHeight: `${height}`,
|
|
29
|
-
overflow: 'hidden',
|
|
30
|
-
transition: 'max-height 0.6s ease',
|
|
31
|
-
}, children: children })] }));
|
|
32
|
-
};
|
|
33
|
-
export default Accordion;
|