@adaptabletools/adaptable-cjs 18.0.0-canary.0 → 18.0.0-canary.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/package.json +1 -1
- package/src/Api/Implementation/NotesApiImpl.d.ts +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.js +3 -3
- package/src/View/GridFilter/GridFilterViewPanel.js +41 -7
- package/src/components/Textarea/index.d.ts +9 -0
- package/src/components/Textarea/index.js +50 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +10 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "18.0.0-canary.
|
|
3
|
+
"version": "18.0.0-canary.2",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -11,6 +11,6 @@ export declare class NotesApiImpl extends ApiBase implements NotesApi {
|
|
|
11
11
|
getCellNotes(config: {
|
|
12
12
|
PrimaryKeyValue: string | number;
|
|
13
13
|
ColumnId: string;
|
|
14
|
-
}):
|
|
14
|
+
}): AdaptableNote[];
|
|
15
15
|
getNoteByUuid(uuid: string): AdaptableNote | undefined;
|
|
16
16
|
}
|
|
@@ -35,5 +35,5 @@ export declare const NotesReady: (note: NotesState) => NoteReadyAction;
|
|
|
35
35
|
export declare const GetNotesSelector: (state: NotesState, config?: {
|
|
36
36
|
PrimaryKeyValue: string | number;
|
|
37
37
|
ColumnId: string;
|
|
38
|
-
}) =>
|
|
38
|
+
}) => AdaptableNote[];
|
|
39
39
|
export declare const NotesReducer: Redux.Reducer<NotesState>;
|
|
@@ -41,11 +41,11 @@ const NotesReady = (note) => ({
|
|
|
41
41
|
});
|
|
42
42
|
exports.NotesReady = NotesReady;
|
|
43
43
|
const GetNotesSelector = (state, config) => {
|
|
44
|
-
var _a
|
|
44
|
+
var _a;
|
|
45
45
|
if (!config) {
|
|
46
|
-
return
|
|
46
|
+
return [];
|
|
47
47
|
}
|
|
48
|
-
return ((
|
|
48
|
+
return ((_a = state === null || state === void 0 ? void 0 : state.Notes) !== null && _a !== void 0 ? _a : []).filter((note) => {
|
|
49
49
|
if (note.PrimaryKeyValue === config.PrimaryKeyValue && note.ColumnId === config.ColumnId) {
|
|
50
50
|
// happy check
|
|
51
51
|
return true;
|
|
@@ -4,11 +4,11 @@ exports.GridFilterPanelControl = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
7
8
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
|
|
8
9
|
const FieldWrap_1 = tslib_1.__importDefault(require("../../components/FieldWrap"));
|
|
10
|
+
const Textarea_1 = tslib_1.__importDefault(require("../../components/Textarea"));
|
|
9
11
|
const icons_1 = require("../../components/icons");
|
|
10
|
-
const Input_1 = tslib_1.__importDefault(require("../../components/Input"));
|
|
11
|
-
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
12
12
|
const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
|
|
13
13
|
const ButtonExpand_1 = require("../Components/Buttons/ButtonExpand");
|
|
14
14
|
const ButtonInvalid_1 = require("../Components/Buttons/ButtonInvalid");
|
|
@@ -32,16 +32,50 @@ const QueryViewPanelComponent = (props) => {
|
|
|
32
32
|
};
|
|
33
33
|
const buttonExpand = (React.createElement(ButtonExpand_1.ButtonExpand, { disabled: disabled, accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", onClick: onExpand, tooltip: "Edit the Expression in UI", marginLeft: 1 }));
|
|
34
34
|
const renderTextInput = () => {
|
|
35
|
-
return props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 500 },
|
|
35
|
+
return props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 500, style: { overflow: 'visible' } },
|
|
36
36
|
buttonExpand,
|
|
37
|
-
React.createElement(
|
|
37
|
+
React.createElement(rebass_1.Box, { style: {
|
|
38
|
+
position: 'relative',
|
|
39
|
+
height: '100%',
|
|
40
|
+
}, flex: 1 },
|
|
41
|
+
React.createElement(Textarea_1.default, { "data-name": "grid-filter-input", autoResizeOnFocus: true, style: {
|
|
42
|
+
left: 0,
|
|
43
|
+
top: 0,
|
|
44
|
+
right: 0,
|
|
45
|
+
border: 0,
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
resize: 'none',
|
|
48
|
+
fontFamily: 'monospace',
|
|
49
|
+
fontSize: 12,
|
|
50
|
+
maxHeight: 52,
|
|
51
|
+
height: 21,
|
|
52
|
+
paddingTop: 7,
|
|
53
|
+
zIndex: 100,
|
|
54
|
+
}, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression })),
|
|
38
55
|
isExpressionValid && (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => runQuery(), tooltip: '', accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || expression == '' || expression == (gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression), marginRight: 1 })),
|
|
39
56
|
gridFilter && !isExpressionValid && (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Grid Filter", marginRight: 1 })),
|
|
40
57
|
' ',
|
|
41
|
-
StringExtensions_1.default.IsNotNullOrEmpty(expression) && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel })))) : (React.createElement(FieldWrap_1.default,
|
|
58
|
+
StringExtensions_1.default.IsNotNullOrEmpty(expression) && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => clearQuery(), tooltip: "Clear Grid Filter", accessLevel: gridFilterAccessLevel })))) : (React.createElement(FieldWrap_1.default, { width: "100%", overflow: "visible" },
|
|
42
59
|
' ',
|
|
43
60
|
buttonExpand,
|
|
44
|
-
React.createElement(
|
|
61
|
+
React.createElement(rebass_1.Box, { style: {
|
|
62
|
+
position: 'relative',
|
|
63
|
+
minHeight: 40,
|
|
64
|
+
width: '100%',
|
|
65
|
+
}, flex: 1 },
|
|
66
|
+
React.createElement(Textarea_1.default, { "data-name": "grid-filter-input", autoResizeOnFocus: true, style: {
|
|
67
|
+
left: 0,
|
|
68
|
+
top: 0,
|
|
69
|
+
right: 0,
|
|
70
|
+
border: 0,
|
|
71
|
+
position: 'absolute',
|
|
72
|
+
resize: 'none',
|
|
73
|
+
fontFamily: 'monospace',
|
|
74
|
+
fontSize: 12,
|
|
75
|
+
maxHeight: 60,
|
|
76
|
+
paddingTop: 7,
|
|
77
|
+
zIndex: 100,
|
|
78
|
+
}, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression }))));
|
|
45
79
|
};
|
|
46
80
|
const saveButton = (React.createElement(ButtonSave_1.ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: disabled || !isExpressionValid || isExpressionNamedQuery || expression == '', variant: "text", tone: "neutral", marginRight: 1 }));
|
|
47
81
|
const suspendButton = (React.createElement(ButtonPause_1.ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
@@ -65,7 +99,7 @@ const QueryViewPanelComponent = (props) => {
|
|
|
65
99
|
namedQuerySelector));
|
|
66
100
|
};
|
|
67
101
|
return (React.createElement(rebass_1.Flex, { onKeyDown: handleEnter, flexDirection: "row", className: `ab-${elementType}__Query__wrap`, flexWrap: props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
68
|
-
React.createElement(rebass_1.Flex,
|
|
102
|
+
React.createElement(rebass_1.Flex, { width: props.viewType === 'ToolPanel' ? '100%' : 'auto' }, renderTextInput()),
|
|
69
103
|
React.createElement(rebass_1.Flex, null, renderButtons())));
|
|
70
104
|
};
|
|
71
105
|
exports.GridFilterPanelControl = QueryViewPanelComponent;
|
|
@@ -2,16 +2,25 @@ import * as React from 'react';
|
|
|
2
2
|
import { BoxProps } from 'rebass';
|
|
3
3
|
import { HTMLProps } from 'react';
|
|
4
4
|
export declare const baseClassName = "ab-Textarea";
|
|
5
|
+
/**
|
|
6
|
+
* Autoheight strategy:
|
|
7
|
+
* - save initial height
|
|
8
|
+
* - when focused, expand to fit content - max x px
|
|
9
|
+
* - when blurred, shrink to initial height
|
|
10
|
+
* - when typing, expand to fit content - max x px
|
|
11
|
+
*/
|
|
5
12
|
export type TextareaProps = Omit<HTMLProps<HTMLTextAreaElement>, 'ref'> & {
|
|
6
13
|
placehoder?: string;
|
|
7
14
|
type?: string;
|
|
8
15
|
disabled?: boolean;
|
|
9
16
|
value?: string;
|
|
17
|
+
autoResizeOnFocus?: boolean;
|
|
10
18
|
} & Omit<BoxProps, 'ref'>;
|
|
11
19
|
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLTextAreaElement>, "ref"> & {
|
|
12
20
|
placehoder?: string;
|
|
13
21
|
type?: string;
|
|
14
22
|
disabled?: boolean;
|
|
15
23
|
value?: string;
|
|
24
|
+
autoResizeOnFocus?: boolean;
|
|
16
25
|
} & Omit<BoxProps, "ref"> & React.RefAttributes<HTMLDivElement | HTMLInputElement | HTMLTextAreaElement>>;
|
|
17
26
|
export default Textarea;
|
|
@@ -7,7 +7,9 @@ const rebass_1 = require("rebass");
|
|
|
7
7
|
const join_1 = tslib_1.__importDefault(require("../utils/join"));
|
|
8
8
|
exports.baseClassName = 'ab-Textarea';
|
|
9
9
|
const Textarea = React.forwardRef((props, ref) => {
|
|
10
|
-
|
|
10
|
+
const internalRef = React.useRef(null);
|
|
11
|
+
let { disabled, autoResizeOnFocus, className } = props, textareaProps = tslib_1.__rest(props, ["disabled", "autoResizeOnFocus", "className"]);
|
|
12
|
+
const initialHeight = React.useRef(null);
|
|
11
13
|
let type = 'text';
|
|
12
14
|
if (textareaProps && textareaProps.type) {
|
|
13
15
|
type = textareaProps.type;
|
|
@@ -15,6 +17,52 @@ const Textarea = React.forwardRef((props, ref) => {
|
|
|
15
17
|
if (type === 'string') {
|
|
16
18
|
type = 'text';
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
const expandToFitContent = () => {
|
|
21
|
+
if (autoResizeOnFocus && initialHeight.current !== null && internalRef.current) {
|
|
22
|
+
internalRef.current.style.height = `0px`; // makes sure it shrinks when needed
|
|
23
|
+
const height = internalRef.current.scrollHeight;
|
|
24
|
+
internalRef.current.style.height = `${height}px`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const shrinkToInitialHeight = () => {
|
|
28
|
+
if (autoResizeOnFocus) {
|
|
29
|
+
internalRef.current.style.height = `${initialHeight.current}px`;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return (React.createElement(rebass_1.Box, Object.assign({}, textareaProps, { onFocus: (e) => {
|
|
33
|
+
var _a;
|
|
34
|
+
expandToFitContent();
|
|
35
|
+
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
36
|
+
if (internalRef.current && initialHeight.current === null) {
|
|
37
|
+
const height = internalRef.current.getBoundingClientRect().height;
|
|
38
|
+
initialHeight.current = height;
|
|
39
|
+
}
|
|
40
|
+
}, onBlur: (e) => {
|
|
41
|
+
var _a;
|
|
42
|
+
shrinkToInitialHeight();
|
|
43
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
44
|
+
}, ref: (elRef) => {
|
|
45
|
+
// SAVE INITIAL HEIGHT
|
|
46
|
+
// if (elRef && initialHeight.current === null) {
|
|
47
|
+
// const height = elRef.getBoundingClientRect().height;
|
|
48
|
+
// initialHeight.current = isNaN(height) ? 'auto' : height;
|
|
49
|
+
// }
|
|
50
|
+
// SAVE REF
|
|
51
|
+
if (internalRef) {
|
|
52
|
+
internalRef.current = elRef;
|
|
53
|
+
}
|
|
54
|
+
// CALL EXTERNAL REF
|
|
55
|
+
if (ref) {
|
|
56
|
+
if (typeof ref === 'function') {
|
|
57
|
+
ref(elRef);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
ref.current = elRef;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, onChange: (e) => {
|
|
64
|
+
expandToFitContent();
|
|
65
|
+
props.onChange && props.onChange(e);
|
|
66
|
+
}, as: "textarea", type: type, disabled: disabled, className: (0, join_1.default)(className, exports.baseClassName, disabled ? `${exports.baseClassName}--disabled` : ''), spellCheck: false })));
|
|
19
67
|
});
|
|
20
68
|
exports.default = Textarea;
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "18.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1707925070993 || Date.now(),
|
|
6
|
+
VERSION: "18.0.0-canary.2" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -3516,6 +3516,11 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
3516
3516
|
"name": "defaultAgGridMenuItems",
|
|
3517
3517
|
"kind": "a",
|
|
3518
3518
|
"desc": "Default AG Grid Menu Items"
|
|
3519
|
+
},
|
|
3520
|
+
{
|
|
3521
|
+
"name": "structuredAdaptableMenuItems",
|
|
3522
|
+
"kind": "a",
|
|
3523
|
+
"desc": "All Adaptable Menu Items sorted and grouped"
|
|
3519
3524
|
}
|
|
3520
3525
|
]
|
|
3521
3526
|
},
|
|
@@ -3538,6 +3543,11 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
3538
3543
|
"name": "defaultAgGridMenuItems",
|
|
3539
3544
|
"kind": "a",
|
|
3540
3545
|
"desc": "Default AG Grid Menu Items"
|
|
3546
|
+
},
|
|
3547
|
+
{
|
|
3548
|
+
"name": "structuredAdaptableMenuItems",
|
|
3549
|
+
"kind": "a",
|
|
3550
|
+
"desc": "All Adaptable Menu Items sorted and grouped"
|
|
3541
3551
|
}
|
|
3542
3552
|
]
|
|
3543
3553
|
},
|