@adaptabletools/adaptable 11.1.1 → 11.1.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/base.css +2 -0
- package/bundle.cjs.js +119 -119
- package/index.css +3 -0
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -2
- package/src/AdaptableOptions/AdaptableOptions.d.ts +49 -49
- package/src/AdaptableOptions/ContainerOptions.d.ts +1 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +1 -1
- package/src/AdaptableOptions/EditOptions.d.ts +4 -0
- package/src/AdaptableOptions/LayoutOptions.d.ts +11 -0
- package/src/AdaptableOptions/NotificationsOptions.d.ts +2 -2
- package/src/AdaptableOptions/SmartEdit.d.ts +34 -0
- package/src/AdaptableOptions/SmartEdit.js +2 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +1 -1
- package/src/Api/Implementation/FilterApiImpl.js +8 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
- package/src/Api/Implementation/GridApiImpl.js +15 -18
- package/src/Api/Implementation/InternalApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutApiImpl.js +7 -1
- package/src/Api/Implementation/SmartEditApiImpl.d.ts +3 -2
- package/src/Api/SmartEditApi.d.ts +3 -2
- package/src/PredefinedConfig/ExportState.d.ts +0 -5
- package/src/PredefinedConfig/PopupState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -5
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +22 -3
- package/src/Redux/ActionsReducers/PopupRedux.js +42 -8
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -23
- package/src/Redux/ActionsReducers/SystemRedux.js +3 -32
- package/src/Strategy/AlertModule.js +28 -6
- package/src/Strategy/CalculatedColumnModule.js +5 -0
- package/src/Strategy/ExportModule.js +14 -4
- 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/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +24 -13
- package/src/Strategy/Utilities/getFlashingCellStyleViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/getFlashingCellStyleViewItems.js +2 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +4 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +0 -3
- package/src/Utilities/Helpers/StyleHelper.d.ts +1 -0
- package/src/Utilities/Helpers/StyleHelper.js +13 -1
- package/src/Utilities/Interface/MessagePopups.d.ts +12 -0
- package/src/View/AdaptableView.js +2 -2
- 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/FormPopups/FormPopups.d.ts +10 -0
- package/src/View/Components/Popups/FormPopups/FormPopups.js +37 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +2 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +10 -6
- 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/DataSource/DataSourceViewPanel.d.ts +3 -3
- package/src/View/DataSource/DataSourceViewPanel.js +15 -13
- package/src/View/Export/ExportViewPanel.d.ts +1 -3
- package/src/View/Export/ExportViewPanel.js +1 -17
- 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 +13 -5
- 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/Layout/Wizard/LayoutEditor/index.js +1 -4
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +6 -1
- 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/View/SmartEdit/SmartEditPopup.d.ts +3 -3
- package/src/View/SmartEdit/SmartEditPopup.js +15 -3
- package/src/View/SmartEdit/SmartEditViewPanel.d.ts +3 -4
- package/src/View/SmartEdit/SmartEditViewPanel.js +15 -6
- package/src/agGrid/Adaptable.d.ts +7 -5
- package/src/agGrid/Adaptable.js +63 -56
- 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.d.ts +5 -0
- package/src/metamodel/adaptable.metamodel.js +17 -5
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/Export/ExportCustomDestinationDialog.d.ts +0 -11
- package/src/View/Export/ExportCustomDestinationDialog.js +0 -47
- package/src/View/Export/ExportCustomDestinationFormPopups.d.ts +0 -5
- package/src/View/Export/ExportCustomDestinationFormPopups.js +0 -15
|
@@ -93,9 +93,6 @@ exports.scalarExpressionFunctions = {
|
|
|
93
93
|
if (!column.queryable) {
|
|
94
94
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('COL', `Column name "${columnId}" is not queryable`);
|
|
95
95
|
}
|
|
96
|
-
// return context.api?.gridApi.getNormalisedValueFromRowNode(context.node, columnId);
|
|
97
|
-
// const gridCell = context.api?.gridApi.getGridCellFromRowNode(context.node, columnId);
|
|
98
|
-
// return gridCell.rawValue;
|
|
99
96
|
return (_b = context.api) === null || _b === void 0 ? void 0 : _b.gridApi.getRawValueFromRowNode(context.node, columnId);
|
|
100
97
|
},
|
|
101
98
|
description: 'Returns the value of a column',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toStyle = exports.convertCSSAbsoluteFontSizeToPt = exports.convertAdaptableStyleToCSS = void 0;
|
|
3
|
+
exports.getVariableColor = exports.toStyle = exports.convertCSSAbsoluteFontSizeToPt = exports.convertAdaptableStyleToCSS = void 0;
|
|
4
4
|
const EnumExtensions_1 = require("../Extensions/EnumExtensions");
|
|
5
5
|
exports.convertAdaptableStyleToCSS = (style) => {
|
|
6
6
|
let result = {};
|
|
@@ -45,3 +45,15 @@ exports.convertCSSAbsoluteFontSizeToPt = (fontSize) => {
|
|
|
45
45
|
exports.toStyle = (style) => {
|
|
46
46
|
return Object.assign(Object.assign({}, exports.convertAdaptableStyleToCSS(style !== null && style !== void 0 ? style : {})), { borderWidth: (style === null || style === void 0 ? void 0 : style.BorderColor) ? 2 : 0, borderStyle: 'solid' });
|
|
47
47
|
};
|
|
48
|
+
exports.getVariableColor = (variable) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const isVariable = (_a = variable === null || variable === void 0 ? void 0 : variable.startsWith) === null || _a === void 0 ? void 0 : _a.call(variable, 'var(');
|
|
51
|
+
if (!isVariable) {
|
|
52
|
+
return variable;
|
|
53
|
+
}
|
|
54
|
+
const match = /\((.+)\)/.exec(variable);
|
|
55
|
+
if (!match) {
|
|
56
|
+
return variable;
|
|
57
|
+
}
|
|
58
|
+
return getComputedStyle(document.documentElement).getPropertyValue(match[1]).trim();
|
|
59
|
+
};
|
|
@@ -3,6 +3,7 @@ import { ModuleParams } from '../../View/Components/SharedProps/ModuleViewPopupP
|
|
|
3
3
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
4
4
|
import { AdaptableMessageType } from '../../PredefinedConfig/Common/AdaptableMessageType';
|
|
5
5
|
import { AdaptableAlert } from '../../PredefinedConfig/Common/AdaptableAlert';
|
|
6
|
+
import { AdaptableForm, ButtonContext } from '../../types';
|
|
6
7
|
export interface UIConfirmation {
|
|
7
8
|
Header: string;
|
|
8
9
|
Msg: string;
|
|
@@ -71,3 +72,14 @@ export interface WindowPopup {
|
|
|
71
72
|
Icon?: string;
|
|
72
73
|
}[];
|
|
73
74
|
}
|
|
75
|
+
export interface FormPopup {
|
|
76
|
+
FormList: {
|
|
77
|
+
Id: string;
|
|
78
|
+
FormProps: any;
|
|
79
|
+
/**
|
|
80
|
+
* Allows to customise the context before submitting the form
|
|
81
|
+
*/
|
|
82
|
+
prepareContext?: (context: ButtonContext) => Promise<ButtonContext> | ButtonContext;
|
|
83
|
+
Form: AdaptableForm<ButtonContext>;
|
|
84
|
+
}[];
|
|
85
|
+
}
|
|
@@ -12,10 +12,10 @@ const AdaptablePopupConfirmation_1 = require("./Components/Popups/AdaptablePopup
|
|
|
12
12
|
const AdaptableLoadingScreen_1 = require("./Components/Popups/AdaptableLoadingScreen");
|
|
13
13
|
const renderWithAdaptableContext_1 = require("./renderWithAdaptableContext");
|
|
14
14
|
const License_1 = require("./License");
|
|
15
|
-
const ExportCustomDestinationFormPopups_1 = require("./Export/ExportCustomDestinationFormPopups");
|
|
16
15
|
const ProgressIndicator_1 = require("../components/ProgressIndicator/ProgressIndicator");
|
|
17
16
|
const react_toastify_1 = require("react-toastify");
|
|
18
17
|
const WindowPopups_1 = require("./Components/Popups/WindowPopups/WindowPopups");
|
|
18
|
+
const FormPopups_1 = require("./Components/Popups/FormPopups/FormPopups");
|
|
19
19
|
class AdaptableView extends React.Component {
|
|
20
20
|
render() {
|
|
21
21
|
var _a, _b, _c, _d;
|
|
@@ -26,11 +26,11 @@ class AdaptableView extends React.Component {
|
|
|
26
26
|
this.props.PopupState.PromptPopup.ShowPromptPopup && (React.createElement(AdaptablePopupPrompt_1.AdaptablePopupPrompt, { message: this.props.PopupState.PromptPopup.Message, header: this.props.PopupState.PromptPopup.Header, onClose: this.props.onClosePromptPopup, onConfirm: this.props.onConfirmPromptPopup, onConfirmActionCreator: this.props.PopupState.PromptPopup.ConfirmActionCreator, defaultValue: this.props.PopupState.PromptPopup.DefaultValue })),
|
|
27
27
|
React.createElement(AdaptablePopupConfirmation_1.AdaptablePopupConfirmation, { header: this.props.PopupState.ConfirmationPopup.Header, messsage: this.props.PopupState.ConfirmationPopup.Msg, showPopup: this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup, cancelButtonText: this.props.PopupState.ConfirmationPopup.CancelButtonText, confirmButtonText: this.props.PopupState.ConfirmationPopup.ConfirmButtonText, onCancel: this.props.onCancelConfirmationPopup, onConfirm: this.props.onConfirmConfirmationPopup, showInputBox: this.props.PopupState.ConfirmationPopup.ShowInputBox, messageType: this.props.PopupState.ConfirmationPopup.MessageType, api: this.props.AdaptableApi }),
|
|
28
28
|
Boolean(this.props.PopupState.ScreenPopup.ShowScreenPopup) && (React.createElement(AdaptablePopup_1.AdaptablePopup, { componentName: this.props.PopupState.ScreenPopup.ComponentName, componentModule: this.props.PopupState.ScreenPopup.ComponentModule, onHide: this.props.onCloseScreenPopup, api: this.props.AdaptableApi, onClearParams: () => this.props.onClearPopupParams(), moduleParams: this.props.PopupState.ScreenPopup.Params, moduleProps: this.props.PopupState.ScreenPopup.PopupProps })),
|
|
29
|
-
React.createElement(ExportCustomDestinationFormPopups_1.ExportCustomDestinationFormPopups, { api: this.props.AdaptableApi }),
|
|
30
29
|
React.createElement(react_toastify_1.ToastContainer, { limit: this.props.AdaptableApi.internalApi.getAdaptableOptions().notificationsOptions
|
|
31
30
|
.maxNotifications, closeButton: false, icon: false, theme: "colored" }),
|
|
32
31
|
(watermark === null || watermark === void 0 ? void 0 : watermark.show) && React.createElement(License_1.LicenseWatermark, null, watermark === null || watermark === void 0 ? void 0 : watermark.text),
|
|
33
32
|
React.createElement(WindowPopups_1.WindowPopups, null),
|
|
33
|
+
React.createElement(FormPopups_1.FormPopups, null),
|
|
34
34
|
React.createElement(ProgressIndicator_1.ProgressIndicator, null)));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -4,10 +4,8 @@ exports.AdaptableViewPanelFactory = exports.AdaptableViewFactory = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const SmartEditPopup_1 = require("./SmartEdit/SmartEditPopup");
|
|
6
6
|
const QuickSearchPopup_1 = require("./QuickSearch/QuickSearchPopup");
|
|
7
|
-
const ExpandedQueryPopup_1 = require("./Query/ExpandedQueryPopup");
|
|
8
7
|
const ThemePopup_1 = require("./Theme/ThemePopup");
|
|
9
8
|
const ToolPanelPopup_1 = require("./Components/ToolPanel/ToolPanelPopup");
|
|
10
|
-
const LayoutPopup_1 = require("./Layout/LayoutPopup");
|
|
11
9
|
const GridInfoPopup_1 = require("./GridInfo/GridInfoPopup");
|
|
12
10
|
const TeamSharingPopup_1 = require("./TeamSharing/TeamSharingPopup");
|
|
13
11
|
const DashboardPopup_1 = require("./Dashboard/DashboardPopup");
|
|
@@ -33,12 +31,12 @@ const DataChangeHistoryPopup_1 = require("./DataChangeHistory/DataChangeHistoryP
|
|
|
33
31
|
const DataChangeHistoryViewPanel_1 = require("./DataChangeHistory/DataChangeHistoryViewPanel");
|
|
34
32
|
const StateManagementViewPanel_1 = require("./StateManagement/StateManagementViewPanel");
|
|
35
33
|
exports.AdaptableViewFactory = {
|
|
36
|
-
|
|
34
|
+
// ExpandedQueryPopup,
|
|
37
35
|
BulkUpdatePopup: BulkUpdatePopup_1.BulkUpdatePopup,
|
|
38
36
|
DashboardPopup: DashboardPopup_1.DashboardPopup,
|
|
39
37
|
StateManagementPopup: StateManagementPopup_1.StateManagementPopup,
|
|
40
38
|
GridInfoPopup: GridInfoPopup_1.GridInfoPopup,
|
|
41
|
-
|
|
39
|
+
// LayoutPopup,
|
|
42
40
|
QuickSearchPopup: QuickSearchPopup_1.QuickSearchPopup,
|
|
43
41
|
CellSummaryPopup: CellSummaryPopup_1.CellSummaryPopup,
|
|
44
42
|
SmartEditPopup: SmartEditPopup_1.SmartEditPopup,
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AdaptableForm, ButtonContext } from '../../../../../types';
|
|
3
|
+
export interface FormDialogProps {
|
|
4
|
+
id: string;
|
|
5
|
+
formProps: any;
|
|
6
|
+
prepareContext: (context: ButtonContext) => Promise<ButtonContext> | ButtonContext;
|
|
7
|
+
form: AdaptableForm<ButtonContext>;
|
|
8
|
+
}
|
|
9
|
+
export declare const FormDialog: React.FunctionComponent<FormDialogProps>;
|
|
10
|
+
export declare const FormPopups: React.FunctionComponent;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormPopups = exports.FormDialog = 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 rebass_1 = require("rebass");
|
|
8
|
+
const AdaptableFormComponent_1 = require("../../../../components/AdaptableFormComponent");
|
|
9
|
+
const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
|
|
10
|
+
const AdaptableForm_1 = require("../../../../PredefinedConfig/Common/AdaptableForm");
|
|
11
|
+
const PopupRedux_1 = require("../../../../Redux/ActionsReducers/PopupRedux");
|
|
12
|
+
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
13
|
+
exports.FormDialog = ({ id, formProps, form, prepareContext, }) => {
|
|
14
|
+
const dispatch = react_redux_1.useDispatch();
|
|
15
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
16
|
+
const [data, setData] = React.useState(() => {
|
|
17
|
+
return AdaptableForm_1.getDefaultAdaptableFormData(form);
|
|
18
|
+
});
|
|
19
|
+
const handleDismiss = () => {
|
|
20
|
+
dispatch(PopupRedux_1.PopupHideForm(id));
|
|
21
|
+
};
|
|
22
|
+
const context = Object.assign({ adaptableApi: adaptable.api, formData: data }, formProps);
|
|
23
|
+
return (React.createElement(Dialog_1.default, { isOpen: true, showCloseButton: false, style: { minHeight: 'auto', minWidth: 400 }, onDismiss: handleDismiss },
|
|
24
|
+
React.createElement(rebass_1.Box, { padding: 4 },
|
|
25
|
+
React.createElement(AdaptableFormComponent_1.AdaptableFormComponent, { formDef: form, data: data, context: context, onChange: setData, api: adaptable.api, displayTitle: true, onButtonClick: async (button) => {
|
|
26
|
+
var _a;
|
|
27
|
+
handleDismiss();
|
|
28
|
+
const preparedContext = typeof prepareContext === 'function' ? await prepareContext(context) : context;
|
|
29
|
+
(_a = button.onClick) === null || _a === void 0 ? void 0 : _a.call(button, button, preparedContext);
|
|
30
|
+
} }))));
|
|
31
|
+
};
|
|
32
|
+
exports.FormPopups = () => {
|
|
33
|
+
const forms = react_redux_1.useSelector((state) => state.Popup.FormPopup.FormList);
|
|
34
|
+
return (React.createElement(React.Fragment, null, forms.map((form) => {
|
|
35
|
+
return (React.createElement(exports.FormDialog, { key: form.Id, prepareContext: form.prepareContext, id: form.Id, formProps: form.FormProps, form: form.Form }));
|
|
36
|
+
})));
|
|
37
|
+
};
|
|
@@ -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
|
-
dispatch(PopupRedux_1.
|
|
26
|
+
dispatch(PopupRedux_1.PopupHideWindow(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
|
}))));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
|
|
2
2
|
import { DataSource } from '../../PredefinedConfig/DataSourceState';
|
|
3
|
-
import * as DataSourceRedux from '../../Redux/ActionsReducers/DataSourceRedux';
|
|
4
3
|
import * as React from 'react';
|
|
4
|
+
import * as Redux from 'redux';
|
|
5
5
|
export interface DataSourceViewPanelComponentProps extends ViewPanelProps {
|
|
6
6
|
CurrentDataSourceName: string;
|
|
7
7
|
DataSources: DataSource[];
|
|
8
|
-
onSelectDataSource: (DataSource: DataSource) =>
|
|
8
|
+
onSelectDataSource: (DataSource: DataSource) => Redux.Action;
|
|
9
9
|
}
|
|
10
10
|
interface DataSourceViewPanelComponentState {
|
|
11
11
|
CurrentDataSource: DataSource;
|
|
@@ -15,5 +15,5 @@ declare class DataSourceViewPanelComponent extends React.Component<DataSourceVie
|
|
|
15
15
|
render(): JSX.Element;
|
|
16
16
|
onSelectedDataSourceChanged(dataSourceName: string): void;
|
|
17
17
|
}
|
|
18
|
-
export declare let DataSourceViewPanelControl: import("react-redux").ConnectedComponent<typeof DataSourceViewPanelComponent,
|
|
18
|
+
export declare let DataSourceViewPanelControl: import("react-redux").ConnectedComponent<typeof DataSourceViewPanelComponent, Pick<React.ClassAttributes<DataSourceViewPanelComponent> & DataSourceViewPanelComponentProps, "ref" | "key">>;
|
|
19
19
|
export {};
|