@synerise/ds-column-manager 1.0.13 → 1.1.0
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/CHANGELOG.md +11 -0
- package/README.md +29 -96
- package/dist/ColumnManager.d.ts +4 -6
- package/dist/ColumnManager.js +108 -420
- package/dist/ColumnManager.styles.d.ts +5 -0
- package/dist/ColumnManager.styles.js +15 -0
- package/dist/ColumnManager.types.d.ts +15 -45
- package/dist/ColumnManagerActions/ColumnManagerActions.d.ts +2 -10
- package/dist/ColumnManagerActions/ColumnManagerActions.js +16 -122
- package/dist/ColumnManagerActions/ColumnManagerActions.styles.d.ts +0 -2
- package/dist/ColumnManagerActions/ColumnManagerActions.styles.js +2 -11
- package/dist/ColumnManagerActions/ColumnManagerActions.types.d.ts +3 -17
- package/dist/ColumnManagerActions/ColumnManagerActions.types.js +1 -1
- package/dist/ColumnManagerItem/ColumManagerItem.types.d.ts +14 -14
- package/dist/ColumnManagerItem/ColumnManagerItem.d.ts +3 -14
- package/dist/ColumnManagerItem/ColumnManagerItem.js +25 -82
- package/dist/ColumnManagerItem/ColumnManagerItem.styles.d.ts +3 -1
- package/dist/ColumnManagerItem/ColumnManagerItem.styles.js +6 -2
- package/dist/ColumnManagerList/ColumnManager.style.d.ts +5 -0
- package/dist/ColumnManagerList/ColumnManager.style.js +14 -7
- package/dist/ColumnManagerList/ColumnManagerList.d.ts +5 -3
- package/dist/ColumnManagerList/ColumnManagerList.js +86 -53
- package/dist/ColumnManagerList/ColumnManagerList.types.d.ts +7 -15
- package/dist/ColumnManagerSortableItem/ColumnManagerSortableItem.d.ts +4 -0
- package/dist/ColumnManagerSortableItem/ColumnManagerSortableItem.js +36 -0
- package/dist/ColumnManagerSortableItem/ColumnManagerSortableItem.types.d.ts +3 -0
- package/dist/hooks/useTranslations.d.ts +2 -0
- package/dist/hooks/useTranslations.js +43 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/utils/matchesSearchQuery.d.ts +1 -0
- package/dist/utils/matchesSearchQuery.js +3 -0
- package/package.json +15 -22
- package/dist/ColumnManagerGroupSettings/ColumnManagerGroupSettings.d.ts +0 -4
- package/dist/ColumnManagerGroupSettings/ColumnManagerGroupSettings.js +0 -210
- package/dist/ColumnManagerGroupSettings/ColumnManagerGroupSettings.types.d.ts +0 -27
- package/dist/ColumnManagerGroupSettings/ColumnManagerGroupSettings.types.js +0 -6
- package/dist/ColumnManagerGroupSettings/ColumnManangerGroupSettings.styles.d.ts +0 -4
- package/dist/ColumnManagerGroupSettings/ColumnManangerGroupSettings.styles.js +0 -19
- package/dist/ColumnManagerGroupSettings/RangesForm/RangeInput.d.ts +0 -9
- package/dist/ColumnManagerGroupSettings/RangesForm/RangeInput.js +0 -30
- package/dist/ColumnManagerGroupSettings/RangesForm/RangeRow.d.ts +0 -16
- package/dist/ColumnManagerGroupSettings/RangesForm/RangeRow.js +0 -64
- package/dist/ColumnManagerGroupSettings/RangesForm/RangesForm.d.ts +0 -13
- package/dist/ColumnManagerGroupSettings/RangesForm/RangesForm.js +0 -37
- package/dist/ColumnManagerGroupSettings/RangesForm/RangesForm.styles.d.ts +0 -7
- package/dist/ColumnManagerGroupSettings/RangesForm/RangesForm.styles.js +0 -24
- package/dist/ColumnManagerSearchResults/ColumManagerResults.types.d.ts +0 -12
- package/dist/ColumnManagerSearchResults/ColumnManagerSearchResults.d.ts +0 -4
- package/dist/ColumnManagerSearchResults/ColumnManagerSearchResults.js +0 -32
- package/dist/ColumnManagerSearchResults/ColumnMangerSearchResults.styles.d.ts +0 -1
- package/dist/ColumnManagerSearchResults/ColumnMangerSearchResults.styles.js +0 -7
- package/dist/styles/ColumnManager.styles.d.ts +0 -2
- package/dist/styles/ColumnManager.styles.js +0 -9
- /package/dist/{ColumnManagerSearchResults/ColumManagerResults.types.js → ColumnManagerSortableItem/ColumnManagerSortableItem.types.js} +0 -0
|
@@ -1,125 +1,19 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
3
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import Button from '@synerise/ds-button';
|
|
6
|
-
import Modal from '@synerise/ds-modal';
|
|
7
|
-
import { Input, TextArea } from '@synerise/ds-input';
|
|
8
3
|
import * as S from './ColumnManagerActions.styles';
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
27
|
-
_this.state = DEFAULT_STATE;
|
|
28
|
-
_this.handleCancel = function () {
|
|
29
|
-
_this.setState(DEFAULT_STATE);
|
|
30
|
-
};
|
|
31
|
-
_this.handleShowModal = function () {
|
|
32
|
-
_this.setState({
|
|
33
|
-
modalVisible: true
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
_this.handleChange = function (event) {
|
|
37
|
-
var _this$setState;
|
|
38
|
-
var _event$currentTarget = event.currentTarget,
|
|
39
|
-
name = _event$currentTarget.name,
|
|
40
|
-
value = _event$currentTarget.value;
|
|
41
|
-
_this.setState((_this$setState = {}, _this$setState[name] = {
|
|
42
|
-
value: value,
|
|
43
|
-
error: ''
|
|
44
|
-
}, _this$setState));
|
|
45
|
-
};
|
|
46
|
-
_this.handleSubmit = function () {
|
|
47
|
-
var _this$state = _this.state,
|
|
48
|
-
name = _this$state.name,
|
|
49
|
-
description = _this$state.description;
|
|
50
|
-
var _this$props = _this.props,
|
|
51
|
-
onSave = _this$props.onSave,
|
|
52
|
-
texts = _this$props.texts;
|
|
53
|
-
if (name.value !== '') {
|
|
54
|
-
_this.setState(DEFAULT_STATE);
|
|
55
|
-
onSave({
|
|
56
|
-
name: name.value,
|
|
57
|
-
description: description.value
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
_this.setState({
|
|
61
|
-
name: _extends({}, name, {
|
|
62
|
-
error: texts.mustNotBeEmpty
|
|
63
|
-
})
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
return _this;
|
|
68
|
-
}
|
|
69
|
-
_inheritsLoose(ColumnManagerActions, _React$Component);
|
|
70
|
-
var _proto = ColumnManagerActions.prototype;
|
|
71
|
-
_proto.render = function render() {
|
|
72
|
-
var _this$props2 = this.props,
|
|
73
|
-
texts = _this$props2.texts,
|
|
74
|
-
onCancel = _this$props2.onCancel,
|
|
75
|
-
onApply = _this$props2.onApply;
|
|
76
|
-
var _this$state2 = this.state,
|
|
77
|
-
modalVisible = _this$state2.modalVisible,
|
|
78
|
-
name = _this$state2.name,
|
|
79
|
-
description = _this$state2.description;
|
|
80
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.ColumnManagerActions, null, /*#__PURE__*/React.createElement(Button, {
|
|
81
|
-
type: "secondary",
|
|
82
|
-
mode: "simple",
|
|
83
|
-
onClick: this.handleShowModal
|
|
84
|
-
}, texts.saveView), /*#__PURE__*/React.createElement(S.RightButtons, null, /*#__PURE__*/React.createElement(Button, {
|
|
85
|
-
"data-testid": "ds-column-manager-cancel",
|
|
86
|
-
type: "ghost",
|
|
87
|
-
mode: "simple",
|
|
88
|
-
onClick: onCancel
|
|
89
|
-
}, texts.cancel), /*#__PURE__*/React.createElement(Button, {
|
|
90
|
-
"data-testid": "ds-column-manager-apply",
|
|
91
|
-
type: "primary",
|
|
92
|
-
mode: "simple",
|
|
93
|
-
onClick: onApply
|
|
94
|
-
}, texts.apply))), /*#__PURE__*/React.createElement(Modal, {
|
|
95
|
-
visible: modalVisible,
|
|
96
|
-
onCancel: this.handleCancel,
|
|
97
|
-
title: texts.saveView,
|
|
98
|
-
footer: /*#__PURE__*/React.createElement(S.ModalFooter, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
99
|
-
"data-testid": "ds-modal-cancel",
|
|
100
|
-
type: "ghost",
|
|
101
|
-
onClick: this.handleCancel
|
|
102
|
-
}, texts.cancel), /*#__PURE__*/React.createElement(Button, {
|
|
103
|
-
"data-testid": "ds-modal-apply",
|
|
104
|
-
type: "primary",
|
|
105
|
-
onClick: this.handleSubmit
|
|
106
|
-
}, texts.apply)))
|
|
107
|
-
}, /*#__PURE__*/React.createElement(S.Form, null, /*#__PURE__*/React.createElement(Input, {
|
|
108
|
-
name: "name",
|
|
109
|
-
onChange: this.handleChange,
|
|
110
|
-
value: name.value,
|
|
111
|
-
label: texts.viewName,
|
|
112
|
-
placeholder: texts.viewNamePlaceholder,
|
|
113
|
-
errorText: name.error
|
|
114
|
-
}), /*#__PURE__*/React.createElement(TextArea, {
|
|
115
|
-
name: "description",
|
|
116
|
-
value: description.value,
|
|
117
|
-
onChange: this.handleChange,
|
|
118
|
-
label: texts.viewDescription,
|
|
119
|
-
placeholder: texts.viewDescriptionPlaceholder,
|
|
120
|
-
rows: 2
|
|
121
|
-
}))));
|
|
122
|
-
};
|
|
123
|
-
return ColumnManagerActions;
|
|
124
|
-
}(React.Component);
|
|
125
|
-
export default ColumnManagerActions;
|
|
4
|
+
export var ColumnManagerActions = function ColumnManagerActions(_ref) {
|
|
5
|
+
var texts = _ref.texts,
|
|
6
|
+
onApply = _ref.onApply,
|
|
7
|
+
onCancel = _ref.onCancel;
|
|
8
|
+
return /*#__PURE__*/React.createElement(S.ColumnManagerActions, null, /*#__PURE__*/React.createElement(S.RightButtons, null, /*#__PURE__*/React.createElement(Button, {
|
|
9
|
+
"data-testid": "ds-column-manager-cancel",
|
|
10
|
+
type: "ghost",
|
|
11
|
+
mode: "simple",
|
|
12
|
+
onClick: onCancel
|
|
13
|
+
}, texts.cancel), /*#__PURE__*/React.createElement(Button, {
|
|
14
|
+
"data-testid": "ds-column-manager-apply",
|
|
15
|
+
type: "primary",
|
|
16
|
+
mode: "simple",
|
|
17
|
+
onClick: onApply
|
|
18
|
+
}, texts.apply)));
|
|
19
|
+
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
export declare const ColumnManagerActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export declare const RightButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const Form: import("styled-components").StyledComponent<"form", any, {}, never>;
|
|
4
|
-
export declare const ModalFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { OuterWrapper } from '@synerise/ds-input/dist/Input.styles';
|
|
3
2
|
export var ColumnManagerActions = styled.div.withConfig({
|
|
4
3
|
displayName: "ColumnManagerActionsstyles__ColumnManagerActions",
|
|
5
4
|
componentId: "sc-1vmwevx-0"
|
|
6
|
-
})(["display:flex;flex-direction:row;align-items:center;justify-content:
|
|
5
|
+
})(["display:flex;flex:0 0 80px;flex-direction:row;align-items:center;justify-content:flex-end;background-color:", ";padding:24px;"], function (props) {
|
|
7
6
|
return props.theme.palette['grey-050'];
|
|
8
7
|
});
|
|
9
8
|
export var RightButtons = styled.div.withConfig({
|
|
10
9
|
displayName: "ColumnManagerActionsstyles__RightButtons",
|
|
11
10
|
componentId: "sc-1vmwevx-1"
|
|
12
|
-
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-end;button{margin-left:8px;}"]);
|
|
13
|
-
export var Form = styled.form.withConfig({
|
|
14
|
-
displayName: "ColumnManagerActionsstyles__Form",
|
|
15
|
-
componentId: "sc-1vmwevx-2"
|
|
16
|
-
})(["display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:282px;margin:16px auto 0;", "{margin-bottom:24px;}"], OuterWrapper);
|
|
17
|
-
export var ModalFooter = styled.div.withConfig({
|
|
18
|
-
displayName: "ColumnManagerActionsstyles__ModalFooter",
|
|
19
|
-
componentId: "sc-1vmwevx-3"
|
|
20
|
-
})(["display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;justify-content:flex-end;> div{display:flex;}"]);
|
|
11
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-end;button{margin-left:8px;}"]);
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export type Props = {
|
|
4
|
-
onSave: (viewMeta: ViewMeta) => void;
|
|
1
|
+
import { ColumnManagerTexts } from '../ColumnManager.types';
|
|
2
|
+
export type ColumnManagerActionsProps = {
|
|
5
3
|
onApply: () => void;
|
|
6
4
|
onCancel: () => void;
|
|
7
|
-
texts:
|
|
8
|
-
[k: string]: string | React.ReactNode;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare const INPUT_NAMES: readonly ["name", "description"];
|
|
12
|
-
export type FormFields = {
|
|
13
|
-
[k in typeof INPUT_NAMES[number]]: {
|
|
14
|
-
value: string;
|
|
15
|
-
error: string | React.ReactNode;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type State = FormFields & {
|
|
19
|
-
modalVisible: boolean;
|
|
5
|
+
texts: ColumnManagerTexts;
|
|
20
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export type
|
|
1
|
+
import type { DraggableAttributes, DraggableSyntheticListeners } from '@dnd-kit/core';
|
|
2
|
+
import type { ColumnManagerTexts } from '../ColumnManager.types';
|
|
3
|
+
export type ColumnIconType = string | 'text' | 'number' | 'date' | 'boolean' | 'list';
|
|
4
4
|
export type Column = {
|
|
5
5
|
id: string;
|
|
6
|
-
key: ReactText;
|
|
7
6
|
name: string;
|
|
8
7
|
visible: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
group?: boolean;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
type?: ColumnIconType;
|
|
12
10
|
};
|
|
13
|
-
export type
|
|
14
|
-
setFixed: (id: string, fixed?: string) => void;
|
|
15
|
-
showGroupSettings: (item: Column) => void;
|
|
11
|
+
export type ColumnManagerItemProps<ColumnType extends Column> = {
|
|
16
12
|
draggable?: boolean;
|
|
13
|
+
isDragged?: boolean;
|
|
17
14
|
switchAction: (id: string, visible: boolean) => void;
|
|
18
15
|
searchQuery?: string;
|
|
19
|
-
item:
|
|
20
|
-
texts:
|
|
21
|
-
|
|
16
|
+
item: ColumnType;
|
|
17
|
+
texts: ColumnManagerTexts;
|
|
18
|
+
index?: number;
|
|
19
|
+
dragHandleProps?: {
|
|
20
|
+
attributes: DraggableAttributes;
|
|
21
|
+
listeners: DraggableSyntheticListeners;
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
id: string | number;
|
|
24
24
|
};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[k: string]: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
item: import("./ColumManagerItem.types").Column;
|
|
8
|
-
setFixed: (id: string, fixed?: string | undefined) => void;
|
|
9
|
-
switchAction: (id: string, visible: boolean) => void;
|
|
10
|
-
searchQuery?: string | undefined;
|
|
11
|
-
showGroupSettings: (item: import("./ColumManagerItem.types").Column) => void;
|
|
12
|
-
} & {
|
|
13
|
-
theme?: any;
|
|
14
|
-
}>;
|
|
15
|
-
export default _default;
|
|
2
|
+
import { Column, ColumnManagerItemProps } from './ColumManagerItem.types';
|
|
3
|
+
export declare const ColumnManagerItem: <ColumnType extends Column>({ item, switchAction, draggable, searchQuery, texts, dragHandleProps, id, isDragged, ...rest }: ColumnManagerItemProps<ColumnType>) => React.JSX.Element;
|
|
4
|
+
export default ColumnManagerItem;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
var _excluded = ["item", "
|
|
1
|
+
var _excluded = ["item", "switchAction", "draggable", "searchQuery", "texts", "dragHandleProps", "id", "isDragged"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3
4
|
import React, { useMemo } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import Icon, {
|
|
6
|
-
import
|
|
7
|
-
import Dropdown from '@synerise/ds-dropdown';
|
|
8
|
-
import Button from '@synerise/ds-button';
|
|
5
|
+
import { useTheme } from '@synerise/ds-core';
|
|
6
|
+
import Icon, { DragHandleM, VarTypeBooleanM, VarTypeDateM, VarTypeListM, VarTypeNumberM, VarTypeStringM } from '@synerise/ds-icon';
|
|
7
|
+
import { RawSwitch } from '@synerise/ds-switch';
|
|
9
8
|
import { escapeRegEx } from '@synerise/ds-utils';
|
|
10
9
|
import Tooltip from '@synerise/ds-tooltip';
|
|
11
10
|
import * as S from './ColumnManagerItem.styles';
|
|
12
|
-
var
|
|
13
|
-
left: 'left',
|
|
14
|
-
right: 'right'
|
|
15
|
-
};
|
|
11
|
+
var DEFAULT_TYPE = 'text';
|
|
16
12
|
var typeIcon = {
|
|
17
13
|
text: /*#__PURE__*/React.createElement(VarTypeStringM, null),
|
|
18
14
|
number: /*#__PURE__*/React.createElement(VarTypeNumberM, null),
|
|
@@ -20,16 +16,17 @@ var typeIcon = {
|
|
|
20
16
|
"boolean": /*#__PURE__*/React.createElement(VarTypeBooleanM, null),
|
|
21
17
|
list: /*#__PURE__*/React.createElement(VarTypeListM, null)
|
|
22
18
|
};
|
|
23
|
-
var ColumnManagerItem = function ColumnManagerItem(_ref) {
|
|
19
|
+
export var ColumnManagerItem = function ColumnManagerItem(_ref) {
|
|
24
20
|
var item = _ref.item,
|
|
25
|
-
theme = _ref.theme,
|
|
26
|
-
setFixed = _ref.setFixed,
|
|
27
21
|
switchAction = _ref.switchAction,
|
|
28
22
|
draggable = _ref.draggable,
|
|
29
23
|
searchQuery = _ref.searchQuery,
|
|
30
24
|
texts = _ref.texts,
|
|
31
|
-
|
|
25
|
+
dragHandleProps = _ref.dragHandleProps,
|
|
26
|
+
id = _ref.id,
|
|
27
|
+
isDragged = _ref.isDragged,
|
|
32
28
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
|
+
var theme = useTheme();
|
|
33
30
|
var columnName = useMemo(function () {
|
|
34
31
|
if (searchQuery) {
|
|
35
32
|
var escapedQuery = escapeRegEx(searchQuery);
|
|
@@ -39,55 +36,16 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
|
|
|
39
36
|
}
|
|
40
37
|
return item.name;
|
|
41
38
|
}, [item.name, searchQuery]);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
48
|
-
component: /*#__PURE__*/React.createElement(Grid4M, null),
|
|
49
|
-
color: theme.palette['grey-600']
|
|
50
|
-
}),
|
|
51
|
-
suffixel: item.fixed === FIXED_TYPES.left && /*#__PURE__*/React.createElement(Icon, {
|
|
52
|
-
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
53
|
-
color: theme.palette['green-600']
|
|
54
|
-
}),
|
|
55
|
-
text: texts.fixedLeft
|
|
56
|
-
}, {
|
|
57
|
-
onClick: function onClick() {
|
|
58
|
-
return setFixed(item.id, FIXED_TYPES.right);
|
|
59
|
-
},
|
|
60
|
-
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
61
|
-
component: /*#__PURE__*/React.createElement(Grid5M, null),
|
|
62
|
-
color: theme.palette['grey-600']
|
|
63
|
-
}),
|
|
64
|
-
suffixel: item.fixed === FIXED_TYPES.right && /*#__PURE__*/React.createElement(Icon, {
|
|
65
|
-
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
66
|
-
color: theme.palette['green-600']
|
|
67
|
-
}),
|
|
68
|
-
text: texts.fixedRight
|
|
69
|
-
}, {
|
|
70
|
-
onClick: function onClick() {
|
|
71
|
-
return showGroupSettings(item);
|
|
72
|
-
},
|
|
73
|
-
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
74
|
-
component: /*#__PURE__*/React.createElement(DividerM, null),
|
|
75
|
-
color: theme.palette['grey-600']
|
|
76
|
-
}),
|
|
77
|
-
suffixel: item.group && /*#__PURE__*/React.createElement(Icon, {
|
|
78
|
-
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
79
|
-
color: theme.palette['green-600']
|
|
80
|
-
}),
|
|
81
|
-
text: texts.group
|
|
82
|
-
}];
|
|
83
|
-
}, [item, setFixed, showGroupSettings, texts.fixedLeft, texts.fixedRight, texts.group, theme.palette]);
|
|
84
|
-
return /*#__PURE__*/React.createElement(S.ColumnManagerItem, rest, /*#__PURE__*/React.createElement(S.ItemPart, {
|
|
39
|
+
return /*#__PURE__*/React.createElement(S.ColumnManagerItem, _extends({
|
|
40
|
+
"data-testid": "ds-column-manager-item",
|
|
41
|
+
isDragged: isDragged
|
|
42
|
+
}, rest), /*#__PURE__*/React.createElement(S.ItemPart, {
|
|
85
43
|
align: "left"
|
|
86
|
-
}, draggable && /*#__PURE__*/React.createElement(S.DragHandler, {
|
|
44
|
+
}, draggable && /*#__PURE__*/React.createElement(S.DragHandler, _extends({
|
|
87
45
|
component: /*#__PURE__*/React.createElement(DragHandleM, null),
|
|
88
46
|
color: theme.palette['grey-400']
|
|
89
|
-
}), /*#__PURE__*/React.createElement(Icon, {
|
|
90
|
-
component: typeIcon[item.type],
|
|
47
|
+
}, dragHandleProps == null ? void 0 : dragHandleProps.attributes, dragHandleProps == null ? void 0 : dragHandleProps.listeners)), /*#__PURE__*/React.createElement(Icon, {
|
|
48
|
+
component: typeIcon[item.type || DEFAULT_TYPE],
|
|
91
49
|
color: theme.palette['grey-600']
|
|
92
50
|
}), /*#__PURE__*/React.createElement(S.ColumnManagerItemName, {
|
|
93
51
|
dangerouslySetInnerHTML: {
|
|
@@ -95,31 +53,16 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
|
|
|
95
53
|
}
|
|
96
54
|
})), /*#__PURE__*/React.createElement(S.ItemPart, {
|
|
97
55
|
align: "right"
|
|
98
|
-
}, /*#__PURE__*/React.createElement(
|
|
99
|
-
component: /*#__PURE__*/React.createElement(DividerM, null),
|
|
100
|
-
color: theme.palette['grey-400']
|
|
101
|
-
}), item.fixed && /*#__PURE__*/React.createElement(Icon, {
|
|
102
|
-
component: /*#__PURE__*/React.createElement(PinM, null),
|
|
103
|
-
color: theme.palette['grey-400']
|
|
104
|
-
})), item.visible && /*#__PURE__*/React.createElement(Dropdown, {
|
|
105
|
-
overlay: /*#__PURE__*/React.createElement(S.FixedMenu, {
|
|
106
|
-
dataSource: menuDataSource
|
|
107
|
-
})
|
|
108
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
109
|
-
type: "ghost",
|
|
110
|
-
mode: "single-icon"
|
|
111
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
112
|
-
component: /*#__PURE__*/React.createElement(OptionHorizontalM, null),
|
|
113
|
-
color: theme.palette['grey-700']
|
|
114
|
-
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
115
57
|
title: item.visible ? texts.switchOff : texts.switchOn,
|
|
116
|
-
placement: "topRight"
|
|
117
|
-
|
|
58
|
+
placement: "topRight",
|
|
59
|
+
disabled: item.readOnly
|
|
60
|
+
}, /*#__PURE__*/React.createElement(RawSwitch, {
|
|
61
|
+
disabled: item.readOnly,
|
|
118
62
|
checked: item.visible,
|
|
119
|
-
label: "",
|
|
120
63
|
onChange: function onChange() {
|
|
121
|
-
return switchAction(item.id, item.visible);
|
|
64
|
+
return switchAction(item.id, !item.visible);
|
|
122
65
|
}
|
|
123
66
|
}))));
|
|
124
67
|
};
|
|
125
|
-
export default
|
|
68
|
+
export default ColumnManagerItem;
|
|
@@ -5,6 +5,8 @@ export declare const Icons: import("styled-components").StyledComponent<"div", a
|
|
|
5
5
|
export declare const ItemPart: import("styled-components").StyledComponent<"div", any, {
|
|
6
6
|
align: string;
|
|
7
7
|
}, never>;
|
|
8
|
-
export declare const ColumnManagerItem: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
export declare const ColumnManagerItem: import("styled-components").StyledComponent<"div", any, {
|
|
9
|
+
isDragged?: boolean | undefined;
|
|
10
|
+
}, never>;
|
|
9
11
|
export declare const ColumnManagerItemName: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
10
12
|
export declare const FixedMenu: import("styled-components").StyledComponent<typeof Menu, any, {}, never>;
|
|
@@ -4,7 +4,7 @@ import Menu from '@synerise/ds-menu';
|
|
|
4
4
|
export var DragHandler = styled(Icon).withConfig({
|
|
5
5
|
displayName: "ColumnManagerItemstyles__DragHandler",
|
|
6
6
|
componentId: "sc-12ob8aa-0"
|
|
7
|
-
})(["position:absolute;top:16px;left:-24px;opacity:0;"]);
|
|
7
|
+
})(["position:absolute;top:16px;left:-24px;opacity:0;cursor:pointer;"]);
|
|
8
8
|
export var Icons = styled.div.withConfig({
|
|
9
9
|
displayName: "ColumnManagerItemstyles__Icons",
|
|
10
10
|
componentId: "sc-12ob8aa-1"
|
|
@@ -22,8 +22,12 @@ export var ItemPart = styled.div.withConfig({
|
|
|
22
22
|
export var ColumnManagerItem = styled.div.withConfig({
|
|
23
23
|
displayName: "ColumnManagerItemstyles__ColumnManagerItem",
|
|
24
24
|
componentId: "sc-12ob8aa-3"
|
|
25
|
-
})(["display:flex;flex-direction:row;align-items:center;height:56px;justify-content:space-between;width:100%;padding:13px 24px;position:relative;border-bottom:1px solid ", "
|
|
25
|
+
})(["display:flex;flex-direction:row;align-items:center;height:56px;justify-content:space-between;width:100%;padding:13px 24px;position:relative;background:", ";border-bottom:1px solid ", ";", " &:hover{background-color:", ";&:before{width:2px;position:absolute;top:0;left:0;height:100%;background-color:", ";content:'';}", "{opacity:1;}", "{display:none;}&&{.ds-button{visibility:visible;opacity:1;}}}&&{.ds-button{position:absolute;right:36px;top:12px;display:flex;visibility:hidden;opacity:0;transition:all 0s;}}"], function (props) {
|
|
26
|
+
return props.theme.palette.white;
|
|
27
|
+
}, function (props) {
|
|
26
28
|
return props.theme.palette['grey-200'];
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.isDragged && "\n opacity: 0;\n ";
|
|
27
31
|
}, function (props) {
|
|
28
32
|
return props.theme.palette['grey-050'];
|
|
29
33
|
}, function (props) {
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import { FixedSizeList } from 'react-window';
|
|
1
2
|
export declare const ColumnManagerList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const ListHeadline: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
|
+
export declare const List: import("styled-components").StyledComponent<typeof FixedSizeList, any, {
|
|
5
|
+
maxHeight?: number | undefined;
|
|
6
|
+
isDragging?: boolean | undefined;
|
|
7
|
+
}, never>;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
+
import { FixedSizeList } from 'react-window';
|
|
2
3
|
export var ColumnManagerList = styled.div.withConfig({
|
|
3
4
|
displayName: "ColumnManagerstyle__ColumnManagerList",
|
|
4
5
|
componentId: "sc-8vnyk-0"
|
|
5
|
-
})(["display:flex;flex-direction:column;align-items:
|
|
6
|
-
return props.theme.palette.white;
|
|
7
|
-
}, function (props) {
|
|
8
|
-
return props.theme.palette['blue-050'];
|
|
9
|
-
}, function (props) {
|
|
10
|
-
return props.theme.palette['blue-050'];
|
|
11
|
-
});
|
|
6
|
+
})(["display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:100%;height:100%;"]);
|
|
12
7
|
export var ListHeadline = styled.span.withConfig({
|
|
13
8
|
displayName: "ColumnManagerstyle__ListHeadline",
|
|
14
9
|
componentId: "sc-8vnyk-1"
|
|
@@ -16,4 +11,16 @@ export var ListHeadline = styled.span.withConfig({
|
|
|
16
11
|
return props.theme.palette['grey-200'];
|
|
17
12
|
}, function (props) {
|
|
18
13
|
return props.theme.palette['grey-800'];
|
|
14
|
+
});
|
|
15
|
+
export var List = styled(FixedSizeList).withConfig({
|
|
16
|
+
displayName: "ColumnManagerstyle__List",
|
|
17
|
+
componentId: "sc-8vnyk-2"
|
|
18
|
+
})(["overflow-x:unset;overflow-y:unset;height:auto !important;background:", ";box-shadow:2px 0 0 0 ", " inset;", " ", ""], function (props) {
|
|
19
|
+
return props.theme.palette['blue-050'];
|
|
20
|
+
}, function (props) {
|
|
21
|
+
return props.theme.palette['blue-600'];
|
|
22
|
+
}, function (props) {
|
|
23
|
+
return props.maxHeight !== undefined && "max-height: " + props.maxHeight + "px;";
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return props.isDragging && "user-select: none;";
|
|
19
26
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { ColumnManagerListProps } from './ColumnManagerList.types';
|
|
3
|
+
import type { Column } from '../ColumnManagerItem/ColumManagerItem.types';
|
|
4
|
+
export declare const LIST_STYLE: CSSProperties;
|
|
5
|
+
declare const ColumnManagerList: <ColumnType extends Column>({ searchQuery, columns, draggable, handleOrderChange, toggleColumn, texts, }: ColumnManagerListProps<ColumnType>) => React.JSX.Element;
|
|
4
6
|
export default ColumnManagerList;
|