@adaptabletools/adaptable 11.1.1-canary.1 → 11.1.2
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/README.md +6 -4
- package/agGrid.d.ts +2 -2
- package/base.css +6 -6
- package/bundle.cjs.js +97 -97
- package/index.css +7 -6
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
- package/src/AdaptableOptions/LayoutOptions.d.ts +11 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +9 -13
- package/src/Api/Implementation/EventApiImpl.js +2 -1
- package/src/Api/Implementation/GridApiImpl.js +9 -10
- package/src/Api/Implementation/InternalApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutApiImpl.js +7 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -1
- package/src/Api/QueryLanguageApi.d.ts +6 -6
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/Strategy/CalculatedColumnModule.js +5 -0
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/Interface/IModule.d.ts +2 -1
- package/src/Strategy/LayoutModule.d.ts +23 -0
- package/src/Strategy/LayoutModule.js +70 -0
- package/src/Strategy/Utilities/getFlashingCellStyleViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/getFlashingCellStyleViewItems.js +2 -1
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +3 -6
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -1
- package/src/Utilities/Helpers/StyleHelper.d.ts +1 -0
- package/src/Utilities/Helpers/StyleHelper.js +13 -1
- package/src/View/AdaptableViewFactory.js +2 -4
- package/src/View/ColorPicker.d.ts +4 -2
- package/src/View/ColorPicker.js +16 -4
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +24 -19
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +3 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +23 -15
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +2 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +9 -5
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
- package/src/View/Components/RangesComponent.js +4 -6
- package/src/View/Components/StyleComponent.js +6 -9
- package/src/View/Components/ValueSelector/index.d.ts +1 -0
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/Dashboard/CustomToolbarWrapper.js +9 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -3
- package/src/View/GridInfo/AdaptableObjectsSummary.d.ts +2 -0
- package/src/View/GridInfo/AdaptableObjectsSummary.js +26 -0
- package/src/View/GridInfo/GridInfoPopup.js +11 -3
- package/src/View/Layout/LayoutEditorStandalonePopup.js +3 -4
- package/src/View/Layout/LayoutRadioSelector.d.ts +5 -0
- package/src/View/Layout/LayoutRadioSelector.js +18 -0
- package/src/View/Query/ExpandedQueryPopup.d.ts +2 -18
- package/src/View/Query/ExpandedQueryPopup.js +42 -57
- package/src/View/Query/QueryViewPanel.js +8 -5
- package/src/agGrid/ActionColumnRenderer.d.ts +1 -6
- package/src/agGrid/ActionColumnRenderer.js +50 -59
- package/src/agGrid/Adaptable.d.ts +3 -1
- package/src/agGrid/Adaptable.js +63 -27
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +16 -2
- package/src/components/ExpressionEditor/index.js +0 -1
- package/src/components/OverlayTrigger/index.js +1 -0
- package/src/components/Radio/index.d.ts +1 -1
- package/src/components/Radio/index.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +17 -10
- package/src/types.d.ts +5 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/LICENSE.md +0 -264
|
@@ -2,7 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { HTMLProps } from 'react';
|
|
3
3
|
import { BoxProps } from 'rebass';
|
|
4
4
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
5
|
-
export declare type ColorPickerProps = HTMLProps<HTMLInputElement> & {
|
|
5
|
+
export declare type ColorPickerProps = Omit<HTMLProps<HTMLInputElement>, 'onChange'> & {
|
|
6
6
|
api: AdaptableApi;
|
|
7
|
-
|
|
7
|
+
onChange: (color: string) => void;
|
|
8
|
+
value: string;
|
|
9
|
+
} & Omit<BoxProps, 'onChange'>;
|
|
8
10
|
export declare const ColorPicker: React.ForwardRefExoticComponent<Pick<ColorPickerProps, "max" | "required" | "default" | "high" | "low" | "disabled" | "start" | "open" | "media" | "hidden" | "cite" | "data" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "async" | "defer" | "manifest" | "m" | "color" | "content" | "size" | "flex" | "wrap" | "padding" | "multiple" | "alignSelf" | "backgroundColor" | "fontSize" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "width" | "margin" | "children" | "key" | "list" | "step" | "contextMenu" | "api" | "type" | "min" | "rows" | "download" | "value" | "checked" | "onClick" | "name" | "colSpan" | "rowSpan" | "className" | "id" | "lang" | "method" | "target" | "role" | "tabIndex" | "crossOrigin" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classID" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "as" | "hrefLang" | "integrity" | "rel" | "sizes" | "charSet" | "kind" | "src" | "srcLang" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "accept" | "capture" | "maxLength" | "minLength" | "readOnly" | "htmlFor" | "httpEquiv" | "optimum" | "reversed" | "selected" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "headers" | "scope" | "cols" | "poster" | "challenge" | "keyType" | "keyParams" | "mt" | "mb" | "ml" | "mr" | "my" | "marginY" | "mx" | "marginX" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "bg"> & React.RefAttributes<unknown>>;
|
package/src/View/ColorPicker.js
CHANGED
|
@@ -4,17 +4,29 @@ exports.ColorPicker = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const Input_1 = tslib_1.__importDefault(require("../components/Input"));
|
|
7
|
+
const StyleHelper_1 = require("../Utilities/Helpers/StyleHelper");
|
|
7
8
|
const tinycolor = require('tinycolor2');
|
|
8
9
|
exports.ColorPicker = React.forwardRef((props, ref) => {
|
|
9
10
|
const ColorPalette = props.api.userInterfaceApi.getColorPalette();
|
|
10
11
|
let { api, value } = props, restProps = tslib_1.__rest(props, ["api", "value"]);
|
|
11
|
-
const
|
|
12
|
+
const optionsMap = ColorPalette.reduce((acc, colorItem) => (Object.assign(Object.assign({}, acc), { [StyleHelper_1.getVariableColor(colorItem)]: colorItem })), {});
|
|
13
|
+
const ABcolorChoicesOptions = Object.keys(optionsMap).map((x) => {
|
|
14
|
+
return (React.createElement("option", { key: x, value: x }, x));
|
|
15
|
+
});
|
|
12
16
|
const ABcolorChoices = React.createElement("datalist", { id: 'ABcolorChoices' }, ABcolorChoicesOptions);
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
const preparedValue = React.useMemo(() => {
|
|
18
|
+
const color = StyleHelper_1.getVariableColor(value);
|
|
19
|
+
return tinycolor(color).toHexString();
|
|
15
20
|
}, [value]);
|
|
16
21
|
return (React.createElement("div", { className: 'ColorPicker' },
|
|
17
|
-
React.createElement(Input_1.default, Object.assign({}, restProps, {
|
|
22
|
+
React.createElement(Input_1.default, Object.assign({}, restProps, { onChange: (event) => {
|
|
23
|
+
var _a;
|
|
24
|
+
/**
|
|
25
|
+
* The value is not in the map when the color is not in the palette.
|
|
26
|
+
*/
|
|
27
|
+
const color = (_a = optionsMap[event.target.value]) !== null && _a !== void 0 ? _a : event.target.value;
|
|
28
|
+
props.onChange(color);
|
|
29
|
+
}, value: preparedValue, ref: ref, type: "color", style: {
|
|
18
30
|
width: 70,
|
|
19
31
|
padding: 0 /* we need this to be 0, since otherwise on Windows browsers, the chosen color cannot be seen */,
|
|
20
32
|
}, list: "ABcolorChoices" })),
|
|
@@ -15,15 +15,16 @@ const ButtonEdit_1 = require("../Buttons/ButtonEdit");
|
|
|
15
15
|
const ButtonShare_1 = require("../Buttons/ButtonShare");
|
|
16
16
|
const SuspendToggleButton_1 = require("../Buttons/SuspendToggleButton/SuspendToggleButton");
|
|
17
17
|
const ValueSelector_1 = require("../ValueSelector");
|
|
18
|
+
const ICON_SIZE = 26;
|
|
18
19
|
exports.AdaptableObjectListItem = (props) => {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f;
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20
21
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
21
22
|
const dispatch = react_redux_1.useDispatch();
|
|
22
23
|
const [isEditWizardVisible, setIsEditWizardVisible] = React.useState(false);
|
|
23
24
|
const [wizardStepName, setWizardStepName] = React.useState(null);
|
|
24
|
-
const viewOptions = (_a = props.module) === null || _a === void 0 ? void 0 : _a.getViewProperties();
|
|
25
|
-
const EditWizard = (
|
|
26
|
-
const deleteAction = (
|
|
25
|
+
const viewOptions = (_b = (_a = props.module) === null || _a === void 0 ? void 0 : _a.getViewProperties) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
26
|
+
const EditWizard = (_c = viewOptions.getEditWizard) === null || _c === void 0 ? void 0 : _c.call(viewOptions, props.data.abObject);
|
|
27
|
+
const deleteAction = (_d = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getDeleteAction) === null || _d === void 0 ? void 0 : _d.call(viewOptions, props.data.abObject);
|
|
27
28
|
const teamSharingActivated = adaptable.api.teamSharingApi.isTeamSharingActivated() &&
|
|
28
29
|
adaptable.api.teamSharingApi.hasTeamSharingFullRights();
|
|
29
30
|
const entityType = props.module.moduleInfo.FriendlyName;
|
|
@@ -33,46 +34,50 @@ exports.AdaptableObjectListItem = (props) => {
|
|
|
33
34
|
const accessLevel = AdaptableHelper_1.default.getAppropriateAccessLevel(props.data.abObject, moduleAccessLevel);
|
|
34
35
|
const baseClassName = `${props.baseClassName}__Item`;
|
|
35
36
|
const itemClassName = join_1.default(baseClassName, props.data.abObject.IsSuspended && `${baseClassName}--is-suspended`);
|
|
36
|
-
const handleCloseWizard = () => {
|
|
37
|
+
const handleCloseWizard = React.useCallback(() => {
|
|
37
38
|
setIsEditWizardVisible(false);
|
|
38
39
|
setWizardStepName(null);
|
|
39
|
-
};
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
|
|
40
|
+
}, []);
|
|
41
|
+
const handleOnEdit = React.useCallback((sectionName) => {
|
|
42
|
+
var _a;
|
|
43
|
+
if (EditWizard) {
|
|
44
|
+
setIsEditWizardVisible(true);
|
|
45
|
+
if (sectionName) {
|
|
46
|
+
setWizardStepName(sectionName);
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
|
-
|
|
49
|
+
(_a = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.onOpenEditPopup) === null || _a === void 0 ? void 0 : _a.call(viewOptions, props.data.abObject);
|
|
50
|
+
}, []);
|
|
46
51
|
const hasSuspend = Boolean(viewOptions.getSuspendAction);
|
|
47
|
-
const actions = (
|
|
52
|
+
const actions = (_f = (_e = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.actions) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, (component, index) => {
|
|
48
53
|
return React.createElement(component, {
|
|
49
54
|
data: props.data.abObject,
|
|
50
55
|
key: index,
|
|
51
56
|
});
|
|
52
57
|
});
|
|
53
|
-
const
|
|
58
|
+
const isEditDisabled = !Boolean(EditWizard || viewOptions.onOpenEditPopup);
|
|
54
59
|
return (React.createElement(rebass_1.Flex, { as: "li", mb: 3, className: itemClassName },
|
|
55
|
-
React.createElement(rebass_1.Box, { flex: 1, className: `${baseClassName}__rows` }, (
|
|
60
|
+
React.createElement(rebass_1.Box, { flex: 1, className: `${baseClassName}__rows` }, (_g = props.data.items) === null || _g === void 0 ? void 0 : _g.map((tag, index) => {
|
|
56
61
|
var _a;
|
|
57
62
|
return (React.createElement(rebass_1.Flex, { "data-name": tag.name, key: index, mb: 2, className: `${baseClassName}__row` },
|
|
58
63
|
React.createElement(rebass_1.Box, { className: `${baseClassName}__label`, mr: 3 },
|
|
59
64
|
tag.label || tag.name,
|
|
60
65
|
EditWizard && (React.createElement(SimpleButton_1.default, { accessLevel: accessLevel, className: `${baseClassName}__edit-property`, ml: 1, icon: "edit", tooltip: "edit", iconSize: 18, variant: "text", onClick: () => {
|
|
61
|
-
|
|
66
|
+
handleOnEdit(tag.name);
|
|
62
67
|
} }))),
|
|
63
68
|
React.createElement(rebass_1.Box, { flex: 1, className: `${baseClassName}__values` },
|
|
64
69
|
tag.view &&
|
|
65
70
|
React.createElement(tag.view, {
|
|
66
71
|
data: props.data.abObject,
|
|
67
72
|
}),
|
|
68
|
-
Boolean((tag === null || tag === void 0 ? void 0 : tag.values) && ((_a = tag === null || tag === void 0 ? void 0 : tag.values) === null || _a === void 0 ? void 0 : _a.length)) && (React.createElement(ValueSelector_1.ValueOptionsTags, { readOnly: true, options: tag.values, value: tag.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) })))));
|
|
73
|
+
Boolean((tag === null || tag === void 0 ? void 0 : tag.values) && ((_a = tag === null || tag === void 0 ? void 0 : tag.values) === null || _a === void 0 ? void 0 : _a.length)) && (React.createElement(ValueSelector_1.ValueOptionsTags, { style: { marginRight: 0 }, readOnly: true, options: tag.values, value: tag.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) })))));
|
|
69
74
|
})),
|
|
70
75
|
React.createElement(rebass_1.Flex, { flexDirection: "column", className: `${baseClassName}__buttons` },
|
|
71
76
|
React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
72
77
|
actions,
|
|
73
|
-
teamSharingActivated && (React.createElement(ButtonShare_1.ButtonShare, { iconSize:
|
|
74
|
-
deleteAction && (React.createElement(ButtonDelete_1.ButtonDelete, { iconSize:
|
|
75
|
-
React.createElement(ButtonEdit_1.ButtonEdit, { iconSize:
|
|
78
|
+
teamSharingActivated && (React.createElement(ButtonShare_1.ButtonShare, { iconSize: ICON_SIZE, Header: `TeamSharing ${entityType}`, accessLevel: accessLevel, onShare: (config) => dispatch(TeamSharingRedux_1.TeamSharingShare(props.data.abObject, props.module.moduleInfo.ModuleName, config)) })),
|
|
79
|
+
deleteAction && (React.createElement(ButtonDelete_1.ButtonDelete, { iconSize: ICON_SIZE, ConfirmationMsg: `Are you sure you want to delete this ${entityType}?`, ConfirmationTitle: `Delete ${entityType}`, ConfirmAction: deleteAction, accessLevel: accessLevel })),
|
|
80
|
+
React.createElement(ButtonEdit_1.ButtonEdit, { iconSize: ICON_SIZE, disabled: isEditDisabled, accessLevel: accessLevel, onClick: () => handleOnEdit() })),
|
|
76
81
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
77
82
|
hasSuspend && (React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
78
83
|
React.createElement(SuspendToggleButton_1.SuspendToggleButton, { onSuspend: () => dispatch(viewOptions.getSuspendAction(props.data.abObject)), onUnSuspend: () => dispatch(viewOptions.getUnSuspendAction(props.data.abObject)), suspendableObject: props.data.abObject, accessLevel: accessLevel })))),
|
|
@@ -31,5 +31,7 @@ exports.AdaptablePopupBody = (props) => {
|
|
|
31
31
|
moduleInfo,
|
|
32
32
|
};
|
|
33
33
|
const BodyComponent = (AdaptableViewFactory_1.AdaptableViewFactory === null || AdaptableViewFactory_1.AdaptableViewFactory === void 0 ? void 0 : AdaptableViewFactory_1.AdaptableViewFactory[(_a = props === null || props === void 0 ? void 0 : props.componentName) !== null && _a !== void 0 ? _a : moduleInfo.Popup]) || AdaptablePopupModuleView_1.AdaptablePopupModuleView;
|
|
34
|
-
|
|
34
|
+
// key is to make sure state is reset between views
|
|
35
|
+
// most of the views use the `AdaptablePopupModuleView` component
|
|
36
|
+
return React.createElement(BodyComponent, Object.assign({ key: props === null || props === void 0 ? void 0 : props.componentName, module: props.module }, moduleProps));
|
|
35
37
|
};
|
|
@@ -17,21 +17,29 @@ exports.AdaptablePopupModuleView = (props) => {
|
|
|
17
17
|
* Not sure yet how to trigger this component to render when an item is edited.
|
|
18
18
|
*/
|
|
19
19
|
react_redux_1.useSelector((state) => state);
|
|
20
|
+
const [abObjectType, setAbObjectType] = React.useState(null);
|
|
21
|
+
const moduleInfo = props.module.moduleInfo;
|
|
22
|
+
const items = (_a = props.module) === null || _a === void 0 ? void 0 : _a.toViewAll();
|
|
23
|
+
const moduleViewProperties = props.module.getViewProperties();
|
|
24
|
+
const EditWizard = (_b = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getEditWizard) === null || _b === void 0 ? void 0 : _b.call(moduleViewProperties);
|
|
20
25
|
const [isWizardOpen, setIsWizardOpen] = React.useState(() => {
|
|
21
26
|
var _a, _b;
|
|
22
27
|
return ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' || ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'Edit';
|
|
23
28
|
});
|
|
29
|
+
const handleOpenEditPopup = React.useCallback(() => {
|
|
30
|
+
if (EditWizard) {
|
|
31
|
+
setIsWizardOpen(true);
|
|
32
|
+
}
|
|
33
|
+
if (moduleViewProperties.onOpenEditPopup) {
|
|
34
|
+
moduleViewProperties.onOpenEditPopup();
|
|
35
|
+
}
|
|
36
|
+
}, []);
|
|
24
37
|
React.useEffect(() => {
|
|
25
38
|
var _a, _b;
|
|
26
39
|
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' || ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'Edit') {
|
|
27
|
-
|
|
40
|
+
handleOpenEditPopup();
|
|
28
41
|
}
|
|
29
|
-
}, [(
|
|
30
|
-
const [abObjectType, setAbObjectType] = React.useState(null);
|
|
31
|
-
const moduleInfo = props.module.moduleInfo;
|
|
32
|
-
const items = (_b = props.module) === null || _b === void 0 ? void 0 : _b.toViewAll();
|
|
33
|
-
const moduleViewProperties = props.module.getViewProperties();
|
|
34
|
-
const EditWizard = (_c = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getEditWizard) === null || _c === void 0 ? void 0 : _c.call(moduleViewProperties);
|
|
42
|
+
}, [(_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.action]);
|
|
35
43
|
const emptyView = moduleViewProperties.emptyView;
|
|
36
44
|
let emptyContent = null;
|
|
37
45
|
if (typeof emptyView === 'function') {
|
|
@@ -44,23 +52,23 @@ exports.AdaptablePopupModuleView = (props) => {
|
|
|
44
52
|
// e.g. filter
|
|
45
53
|
let newButton = null;
|
|
46
54
|
if ((_d = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes) === null || _d === void 0 ? void 0 : _d.length) {
|
|
47
|
-
const items = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes.map((
|
|
55
|
+
const items = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes.map((abObjectType) => {
|
|
48
56
|
var _a;
|
|
49
57
|
return {
|
|
50
|
-
disabled: (
|
|
58
|
+
disabled: (abObjectType === null || abObjectType === void 0 ? void 0 : abObjectType.accessLevel) === 'ReadOnly',
|
|
51
59
|
onClick: () => {
|
|
52
|
-
setAbObjectType(
|
|
53
|
-
|
|
60
|
+
setAbObjectType(abObjectType);
|
|
61
|
+
handleOpenEditPopup();
|
|
54
62
|
},
|
|
55
|
-
label: (_a =
|
|
63
|
+
label: (_a = abObjectType.label) !== null && _a !== void 0 ? _a : abObjectType.name,
|
|
56
64
|
};
|
|
57
65
|
});
|
|
58
66
|
newButton = (React.createElement(DropdownButton_1.default, { tone: "accent", variant: "raised", columns: ['label'], items: items, tooltip: 'Create ' + moduleInfo.FriendlyName },
|
|
59
67
|
React.createElement(icons_1.Icon, { name: "plus" }),
|
|
60
68
|
" New"));
|
|
61
69
|
}
|
|
62
|
-
else if (EditWizard) {
|
|
63
|
-
newButton = (React.createElement(ButtonNew_1.ButtonNew, { onClick: () =>
|
|
70
|
+
else if (EditWizard || moduleViewProperties.onOpenEditPopup) {
|
|
71
|
+
newButton = (React.createElement(ButtonNew_1.ButtonNew, { onClick: () => handleOpenEditPopup(), tooltip: 'Create ' + moduleInfo.FriendlyName, accessLevel: props.accessLevel, style: {
|
|
64
72
|
color: 'var(--ab-color-text-on-add)',
|
|
65
73
|
fill: 'var(--ab-color-text-on-add)',
|
|
66
74
|
background: 'var(--ab-color-action-add)',
|
|
@@ -76,5 +84,5 @@ exports.AdaptablePopupModuleView = (props) => {
|
|
|
76
84
|
};
|
|
77
85
|
return (React.createElement(PopupPanel_1.PopupPanel, { glyphicon: moduleInfo.Glyph, infoLink: moduleInfo.HelpPage, headerText: moduleInfo.FriendlyName, button: newButton },
|
|
78
86
|
(items === null || items === void 0 ? void 0 : items.length) ? (React.createElement(AdaptableObjectList_1.AdaptableObjectList, { module: props.module, items: items })) : (React.createElement(EmptyContent_1.default, null, emptyContent !== null && emptyContent !== void 0 ? emptyContent : `Click 'New' to create a new ${moduleInfo.FriendlyName}`)),
|
|
79
|
-
isWizardOpen && (React.createElement(EditWizard, { abObjectType: abObjectType, moduleInfo: moduleInfo, data: null, popupParams: props.popupParams, configEntities: null, onCloseWizard: handleWizardClose, onFinishWizard: handleWizardClose }))));
|
|
87
|
+
isWizardOpen && EditWizard && (React.createElement(EditWizard, { abObjectType: abObjectType, moduleInfo: moduleInfo, data: null, popupParams: props.popupParams, configEntities: null, onCloseWizard: handleWizardClose, onFinishWizard: handleWizardClose }))));
|
|
80
88
|
};
|
|
@@ -6,6 +6,8 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
7
|
const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
|
|
8
8
|
const PopupRedux_1 = require("../../../../Redux/ActionsReducers/PopupRedux");
|
|
9
|
+
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
10
|
+
const PanelWithImage_1 = require("../../Panels/PanelWithImage");
|
|
9
11
|
const Utilities_1 = require("../Utilities");
|
|
10
12
|
const windowFactory_1 = require("./windowFactory");
|
|
11
13
|
const NoopComponent = () => {
|
|
@@ -13,20 +15,22 @@ const NoopComponent = () => {
|
|
|
13
15
|
};
|
|
14
16
|
exports.WindowPopups = () => {
|
|
15
17
|
const [windowModalSettings, setWindowModalSettings] = React.useState({});
|
|
18
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
16
19
|
const dispatch = react_redux_1.useDispatch();
|
|
17
20
|
const windowItems = react_redux_1.useSelector((state) => state.Popup.WindowPopup.PopupList);
|
|
18
21
|
return (React.createElement(React.Fragment, null, windowItems === null || windowItems === void 0 ? void 0 : windowItems.map((windowItem, index) => {
|
|
19
|
-
var _a, _b, _c, _d, _e;
|
|
22
|
+
var _a, _b, _c, _d, _e, _f;
|
|
20
23
|
const Component = (_a = windowFactory_1.windowFactory[windowItem.Id]) !== null && _a !== void 0 ? _a : NoopComponent;
|
|
21
|
-
const
|
|
24
|
+
const _g = (_b = windowItem === null || windowItem === void 0 ? void 0 : windowItem.PopupProps) !== null && _b !== void 0 ? _b : {}, { windowModalProps } = _g, restPopupProps = tslib_1.__rest(_g, ["windowModalProps"]);
|
|
22
25
|
const handleDismiss = () => {
|
|
23
26
|
dispatch(PopupRedux_1.PopupWindowHide(windowItem.Id));
|
|
24
27
|
};
|
|
25
|
-
const size = (
|
|
26
|
-
const position = (
|
|
28
|
+
const size = (_d = (_c = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : Utilities_1.getWindowPopupSize();
|
|
29
|
+
const position = (_f = (_e = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _e === void 0 ? void 0 : _e.position) !== null && _f !== void 0 ? _f : Utilities_1.getMiddlePosition(size);
|
|
27
30
|
return (React.createElement(Dialog_1.default, { "data-name": windowItem.Id, style: { height: '100%' }, className: "ab-Window-Modal", key: windowItem.Id, windowModal: true, windowModalProps: Object.assign(Object.assign({}, windowModalProps), { onChange: (settings) => {
|
|
28
31
|
setWindowModalSettings((settingsMap) => (Object.assign(Object.assign({}, settingsMap), { [windowItem.Id]: settings })));
|
|
29
32
|
}, handleSelector: '.ab-Window-Modal .ab-Panel__header', size: size, position: position }), fixed: false, padding: 0, onDismiss: handleDismiss, isOpen: true, showCloseButton: true },
|
|
30
|
-
React.createElement(
|
|
33
|
+
React.createElement(PanelWithImage_1.PanelWithImage, { style: { height: '100%' }, bodyProps: { padding: 0, height: '100%' }, header: windowItem.Title, glyphicon: windowItem.Icon, variant: "primary" },
|
|
34
|
+
React.createElement(Component, { api: adaptable.api, onDismiss: handleDismiss, popupProps: restPopupProps }))));
|
|
31
35
|
})));
|
|
32
36
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WindowPopupChildProps } from './WindowPopups';
|
|
3
3
|
export declare const WINDOW_LAYOUT_EDITOR = "WINDOW_LAYOUT_EDITOR";
|
|
4
|
+
export declare const WINDOW_QUERY_EDITOR = "WINDOW_QUERY_EDITOR";
|
|
4
5
|
export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.windowFactory = exports.WINDOW_LAYOUT_EDITOR = void 0;
|
|
3
|
+
exports.windowFactory = exports.WINDOW_QUERY_EDITOR = exports.WINDOW_LAYOUT_EDITOR = void 0;
|
|
4
4
|
const LayoutEditorStandalonePopup_1 = require("../../../Layout/LayoutEditorStandalonePopup");
|
|
5
|
+
const ExpandedQueryPopup_1 = require("../../../Query/ExpandedQueryPopup");
|
|
5
6
|
exports.WINDOW_LAYOUT_EDITOR = 'WINDOW_LAYOUT_EDITOR';
|
|
7
|
+
exports.WINDOW_QUERY_EDITOR = 'WINDOW_QUERY_EDITOR';
|
|
6
8
|
exports.windowFactory = {
|
|
7
9
|
[exports.WINDOW_LAYOUT_EDITOR]: LayoutEditorStandalonePopup_1.LayoutEditorStandalonePopup,
|
|
10
|
+
[exports.WINDOW_QUERY_EDITOR]: ExpandedQueryPopup_1.ExpandedQueryPopup,
|
|
8
11
|
};
|
|
@@ -63,9 +63,8 @@ class RangesComponent extends React.Component {
|
|
|
63
63
|
const { value } = event.target;
|
|
64
64
|
this.changeRangeMax(index, value);
|
|
65
65
|
}, mr: 2 }),
|
|
66
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: range.Color, onChange: (
|
|
67
|
-
|
|
68
|
-
this.changeRangeColor(index, value);
|
|
66
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: range.Color, onChange: (color) => {
|
|
67
|
+
this.changeRangeColor(index, color);
|
|
69
68
|
}, mr: 2, height: "100%" }),
|
|
70
69
|
this.props.showRangeDirection && (React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, marginRight: 2, checked: range.ReverseGradient && range.ReverseGradient == true, onChange: (checked) => this.changeRangeDirectionUp(index, checked) }, "Reverse Gradient")),
|
|
71
70
|
React.createElement(SimpleButton_1.default, { icon: "delete", disabled: this.state.ranges && this.state.ranges.length == 1, onClick: () => this.removeRange(index) })))),
|
|
@@ -84,9 +83,8 @@ class RangesComponent extends React.Component {
|
|
|
84
83
|
React.createElement(FormLayout_1.FormRow, { label: "Max Value:", first: React.createElement(Input_1.default, { type: "number", value: comparisonMaxValueNumber, onChange: (e) => {
|
|
85
84
|
this.changeColumnComparisonMaxValue(e);
|
|
86
85
|
} }), or: "OR", second: React.createElement(ColumnSelector_1.ColumnSelector, { style: { maxWidth: '15rem' }, SelectedColumnIds: [comparisonMaxValueColumnId], ColumnList: this.props.api.columnApi.getNumericColumns(), onColumnChange: (columns) => this.onMaxColumnSelectedChanged(columns), SelectionMode: Enums_1.SelectionMode.Single }) }),
|
|
87
|
-
React.createElement(FormLayout_1.FormRow, { label: "Bar Colour:", first: React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: comparisonColor, onChange: (
|
|
88
|
-
|
|
89
|
-
this.changeColumnComparisonColor(value);
|
|
86
|
+
React.createElement(FormLayout_1.FormRow, { label: "Bar Colour:", first: React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: comparisonColor, onChange: (color) => {
|
|
87
|
+
this.changeColumnComparisonColor(color);
|
|
90
88
|
} }) }))))))));
|
|
91
89
|
}
|
|
92
90
|
onRangesTypeChanged(checked) {
|
|
@@ -120,19 +120,16 @@ class StyleComponent extends React.Component {
|
|
|
120
120
|
this.state.componentStyle.FontSize = checked ? Enums_1.FontSize.Medium : null;
|
|
121
121
|
this.props.UpdateStyle(this.state.componentStyle);
|
|
122
122
|
}
|
|
123
|
-
onBackColorSelectChange(
|
|
124
|
-
|
|
125
|
-
this.state.componentStyle.BackColor = e.value;
|
|
123
|
+
onBackColorSelectChange(color) {
|
|
124
|
+
this.state.componentStyle.BackColor = color;
|
|
126
125
|
this.props.UpdateStyle(this.state.componentStyle);
|
|
127
126
|
}
|
|
128
|
-
onForeColorSelectChange(
|
|
129
|
-
|
|
130
|
-
this.state.componentStyle.ForeColor = e.value;
|
|
127
|
+
onForeColorSelectChange(color) {
|
|
128
|
+
this.state.componentStyle.ForeColor = color;
|
|
131
129
|
this.props.UpdateStyle(this.state.componentStyle);
|
|
132
130
|
}
|
|
133
|
-
onBorderColorSelectChange(
|
|
134
|
-
|
|
135
|
-
this.state.componentStyle.BorderColor = e.value;
|
|
131
|
+
onBorderColorSelectChange(color) {
|
|
132
|
+
this.state.componentStyle.BorderColor = color;
|
|
136
133
|
this.props.UpdateStyle(this.state.componentStyle);
|
|
137
134
|
}
|
|
138
135
|
onFontWeightChange(checked) {
|
|
@@ -25,6 +25,7 @@ export declare namespace ValueSelector {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
declare type ValueOptionsTagsProps<OPTION_TYPE, ID_TYPE extends number | string> = {
|
|
28
|
+
style?: React.CSSProperties;
|
|
28
29
|
options: OPTION_TYPE[];
|
|
29
30
|
value: ID_TYPE[];
|
|
30
31
|
selectedMap?: Map<ID_TYPE, OPTION_TYPE>;
|
|
@@ -198,6 +198,6 @@ function ValueOptionsTags(props) {
|
|
|
198
198
|
" ",
|
|
199
199
|
remaining > 1 ? 'others' : 'other'));
|
|
200
200
|
}, []);
|
|
201
|
-
return (React.createElement(EllipsisContainer_1.EllipsisContainer, { marginRight: 4, my: 1, allowWrap: allowWrap, count: value.length, direction: "horizontal", renderItem: renderOptionTag, renderEllipsis: renderEllipsis }));
|
|
201
|
+
return (React.createElement(EllipsisContainer_1.EllipsisContainer, { style: props.style, marginRight: 4, my: 1, allowWrap: allowWrap, count: value.length, direction: "horizontal", renderItem: renderOptionTag, renderEllipsis: renderEllipsis }));
|
|
202
202
|
}
|
|
203
203
|
exports.ValueOptionsTags = ValueOptionsTags;
|
|
@@ -11,6 +11,8 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
11
11
|
let contentsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__contents';
|
|
12
12
|
let buttonsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__buttons';
|
|
13
13
|
const [contentsHTML, setContentsHTML] = react_1.useState('');
|
|
14
|
+
// dummy object which is used to force a re-render of the toolbar
|
|
15
|
+
const [revision, setRevision] = react_1.useState(1);
|
|
14
16
|
const contentsDivRef = react_1.useRef(null);
|
|
15
17
|
const { api } = AdaptableContext_1.useAdaptable();
|
|
16
18
|
react_1.useLayoutEffect(() => {
|
|
@@ -65,7 +67,13 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
65
67
|
const disabled = button.disabled && button.disabled(button, dashboardContext);
|
|
66
68
|
let buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'outlined';
|
|
67
69
|
let buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'neutral';
|
|
68
|
-
return (React.createElement(SimpleButton_1.default, { style: { marginLeft: index ? 'var(--ab-space-1)' : 0 }, key: index, disabled: disabled, tooltip: buttonTooltip, variant: buttonVariant, tone: buttonTone, onClick: () =>
|
|
70
|
+
return (React.createElement(SimpleButton_1.default, { style: { marginLeft: index ? 'var(--ab-space-1)' : 0 }, key: index, disabled: disabled, tooltip: buttonTooltip, variant: buttonVariant, tone: buttonTone, onClick: () => {
|
|
71
|
+
button.onClick ? button.onClick(button, dashboardContext) : null;
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
// mutate state to force a re-rendering
|
|
74
|
+
setRevision(revision + 1);
|
|
75
|
+
}, 16);
|
|
76
|
+
} },
|
|
69
77
|
button.icon ? React.createElement("img", Object.assign({}, button.icon)) : null,
|
|
70
78
|
buttonLabel));
|
|
71
79
|
}))));
|
|
@@ -204,11 +204,10 @@ function FormatColumnStyleWizardSection(props) {
|
|
|
204
204
|
PercentBarStyle: percentBarStyle,
|
|
205
205
|
} }));
|
|
206
206
|
};
|
|
207
|
-
const onForeColorSelectChange = (
|
|
207
|
+
const onForeColorSelectChange = (color) => {
|
|
208
208
|
var _a;
|
|
209
|
-
let e = event.target;
|
|
210
209
|
let percentBarStyle = (_a = data.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle;
|
|
211
|
-
percentBarStyle.BackColor =
|
|
210
|
+
percentBarStyle.BackColor = color;
|
|
212
211
|
props.onChange(Object.assign(Object.assign({}, data), { ColumnStyle: {
|
|
213
212
|
PercentBarStyle: percentBarStyle,
|
|
214
213
|
} }));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdaptableObjectsSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_redux_1 = require("react-redux");
|
|
7
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
8
|
+
const AdaptableObjectList_1 = require("../Components/AdaptableObjectList");
|
|
9
|
+
exports.AdaptableObjectsSummary = () => {
|
|
10
|
+
const state = react_redux_1.useSelector((state) => state);
|
|
11
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
12
|
+
const modules = adaptable.ModuleService.getModuleCollection();
|
|
13
|
+
return (React.createElement(React.Fragment, null, [...modules].map(([moduleName, module]) => {
|
|
14
|
+
var _a;
|
|
15
|
+
if (!module.isModuleAvailable()) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const items = (_a = module === null || module === void 0 ? void 0 : module.toViewAll) === null || _a === void 0 ? void 0 : _a.call(module);
|
|
19
|
+
if (!(items === null || items === void 0 ? void 0 : items.length)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return (React.createElement("div", null,
|
|
23
|
+
React.createElement("b", null, module.moduleInfo.FriendlyName),
|
|
24
|
+
(items === null || items === void 0 ? void 0 : items.length) && React.createElement(AdaptableObjectList_1.AdaptableObjectList, { items: items, module: module })));
|
|
25
|
+
})));
|
|
26
|
+
};
|
|
@@ -14,12 +14,18 @@ const AdaptablePopover_1 = require("../AdaptablePopover");
|
|
|
14
14
|
const version_1 = tslib_1.__importDefault(require("../../../version"));
|
|
15
15
|
const ColumnInfoComponent_1 = require("./ColumnInfoComponent");
|
|
16
16
|
const AdaptableOptionsComponent_1 = require("./AdaptableOptionsComponent");
|
|
17
|
+
const AdaptableObjectsSummary_1 = require("./AdaptableObjectsSummary");
|
|
17
18
|
exports.GridInfoPopup = (props) => {
|
|
18
19
|
var _a, _b, _c;
|
|
19
20
|
const entitlementService = props.api.internalApi.getEntitlementService();
|
|
20
21
|
const showGridSummary = entitlementService.isGridInfoSectionVisible('GridSummary');
|
|
21
22
|
const showAdaptableOptions = entitlementService.isGridInfoSectionVisible('AdaptableOptions');
|
|
22
23
|
const showColumnInfo = entitlementService.isGridInfoSectionVisible('ColumnInfo');
|
|
24
|
+
/**
|
|
25
|
+
* Because it is not associated with a module yet, setting this flag to true.
|
|
26
|
+
* Needed for the logic weather to show radio buttons (buttons.length >= 2)
|
|
27
|
+
*/
|
|
28
|
+
const showAdaptableObjects = true;
|
|
23
29
|
const [state, setState] = React.useState({
|
|
24
30
|
ActiveTab: ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column) ? 'ColumnInfo'
|
|
25
31
|
: showGridSummary
|
|
@@ -91,15 +97,17 @@ exports.GridInfoPopup = (props) => {
|
|
|
91
97
|
let gridSummaries = CreateGridSummaries(propValueColItems).map((x, index) => {
|
|
92
98
|
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: x });
|
|
93
99
|
});
|
|
94
|
-
const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo].filter((item) => item).length > 1;
|
|
100
|
+
const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo, showAdaptableObjects].filter((item) => item).length > 1;
|
|
95
101
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Grid Info', glyphicon: 'info-sign' },
|
|
96
102
|
React.createElement(rebass_1.Flex, { marginBottom: 2, padding: 3 }, showRadioButtons && (React.createElement(React.Fragment, null,
|
|
97
103
|
showGridSummary && (React.createElement(Radio_1.default, { "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Grid Summary")),
|
|
98
104
|
showAdaptableOptions && (React.createElement(Radio_1.default, { "data-name": "radioButton-AdaptableOptions", marginRight: 3, value: "AdaptableOptions", checked: state.ActiveTab == 'AdaptableOptions', onChange: (_, e) => onShowGridSummaryChanged('AdaptableOptions') }, "Adaptable Options")),
|
|
99
|
-
showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Column Info"))
|
|
105
|
+
showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", marginRight: 3, value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Column Info")),
|
|
106
|
+
showAdaptableObjects && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'AdaptableObjectsSummary', onChange: (_, e) => onShowGridSummaryChanged('AdaptableObjectsSummary') }, "Adaptable Objects"))))),
|
|
100
107
|
state.ActiveTab == 'GridSummary' && (React.createElement(rebass_1.Box, { margin: 2 },
|
|
101
108
|
React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { colItems: propValueColItems, items: gridSummaries }))),
|
|
102
109
|
state.ActiveTab == 'AdaptableOptions' && React.createElement(AdaptableOptionsComponent_1.AdaptableOptionsComponent, { api: props.api }),
|
|
103
110
|
state.ActiveTab == 'ColumnInfo' && (React.createElement("div", null,
|
|
104
|
-
React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn })))
|
|
111
|
+
React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn }))),
|
|
112
|
+
state.ActiveTab === 'AdaptableObjectsSummary' && React.createElement(AdaptableObjectsSummary_1.AdaptableObjectsSummary, null)));
|
|
105
113
|
};
|
|
@@ -9,9 +9,9 @@ const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper
|
|
|
9
9
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
|
|
10
10
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
11
11
|
const PanelFooter_1 = require("../Components/Panels/PanelFooter");
|
|
12
|
-
const PanelWithImage_1 = require("../Components/Panels/PanelWithImage");
|
|
13
12
|
const LayoutEditorWizard_1 = require("./Wizard/LayoutEditorWizard");
|
|
14
13
|
const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
|
|
14
|
+
const rebass_1 = require("rebass");
|
|
15
15
|
exports.LayoutEditorStandalonePopup = (props) => {
|
|
16
16
|
/**
|
|
17
17
|
* This is here because the old code mutates the object.
|
|
@@ -69,8 +69,7 @@ exports.LayoutEditorStandalonePopup = (props) => {
|
|
|
69
69
|
props.onDismiss();
|
|
70
70
|
}, []);
|
|
71
71
|
const finishDisabled = !layoutData.Name;
|
|
72
|
-
return (React.createElement(
|
|
73
|
-
React.createElement(
|
|
74
|
-
React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null })),
|
|
72
|
+
return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column" },
|
|
73
|
+
React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null }),
|
|
75
74
|
React.createElement(PanelFooter_1.PanelFooter, { acceptDisabled: finishDisabled, onAccept: handleAccept, onCancel: handleCancel })));
|
|
76
75
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LayoutRadioSelector = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const Radio_1 = tslib_1.__importDefault(require("../../components/Radio"));
|
|
7
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
8
|
+
exports.LayoutRadioSelector = ({ data }) => {
|
|
9
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
10
|
+
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
11
|
+
const layouts = adaptable.api.layoutApi.getAllLayout();
|
|
12
|
+
const isDisabled = (layouts === null || layouts === void 0 ? void 0 : layouts.length) === 1;
|
|
13
|
+
const isSelected = currentLayout.Name === data.Name;
|
|
14
|
+
const handleToggle = React.useCallback(() => {
|
|
15
|
+
adaptable.api.layoutApi.setLayout(data.Name);
|
|
16
|
+
}, [isSelected]);
|
|
17
|
+
return React.createElement(Radio_1.default, { disabled: isDisabled, checked: isSelected, onClick: handleToggle });
|
|
18
|
+
};
|
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { NamedQuery } from '../../PredefinedConfig/QueryState';
|
|
5
|
-
import { ExpressionEditorNamedQuery } from '../../components/ExpressionEditor/NamedQueryContext';
|
|
6
|
-
interface ExpandedQueryPopupComponentProps extends ModuleViewPopupProps<ExpandedQueryPopupComponent> {
|
|
7
|
-
onRunQuery: (expression: string) => QueryRedux.QueryRunAction;
|
|
8
|
-
onAddNamedQuery: (namedQuery: NamedQuery) => QueryRedux.NamedQueryAddAction;
|
|
9
|
-
}
|
|
10
|
-
export interface ExpandedQueryPopupState {
|
|
11
|
-
namedQuery: ExpressionEditorNamedQuery;
|
|
12
|
-
expression: string;
|
|
13
|
-
}
|
|
14
|
-
declare class ExpandedQueryPopupComponent extends React.Component<ExpandedQueryPopupComponentProps, ExpandedQueryPopupState> {
|
|
15
|
-
constructor(props: ExpandedQueryPopupComponentProps);
|
|
16
|
-
render(): JSX.Element;
|
|
17
|
-
}
|
|
18
|
-
export declare let ExpandedQueryPopup: import("react-redux").ConnectedComponent<typeof ExpandedQueryPopupComponent, Pick<React.ClassAttributes<ExpandedQueryPopupComponent> & ExpandedQueryPopupComponentProps, never>>;
|
|
19
|
-
export {};
|
|
2
|
+
import { WindowPopupChildProps } from '../Components/Popups/WindowPopups/WindowPopups';
|
|
3
|
+
export declare const ExpandedQueryPopup: React.FunctionComponent<WindowPopupChildProps>;
|