@synerise/ds-column-manager 0.8.94 → 0.9.3
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 +32 -0
- package/dist/ColumnManager.js +169 -200
- package/dist/ColumnManager.types.js +1 -0
- package/dist/ColumnManagerActions/ColumnManagerActions.js +71 -91
- package/dist/ColumnManagerGroupSettings/ColumnManagerGroupSettings.js +33 -58
- package/dist/ColumnManagerGroupSettings/RangesForm/RangeInput.js +5 -5
- package/dist/ColumnManagerGroupSettings/RangesForm/RangeRow.js +12 -27
- package/dist/ColumnManagerGroupSettings/RangesForm/RangesForm.js +2 -2
- package/dist/ColumnManagerItem/ColumManagerItem.types.js +1 -0
- package/dist/ColumnManagerItem/ColumnManagerItem.js +40 -41
- package/dist/ColumnManagerItem/ColumnManagerItem.styles.d.ts +1 -1
- package/dist/ColumnManagerItem/ColumnManagerItem.styles.js +1 -2
- package/dist/ColumnManagerList/ColumnManagerList.js +5 -5
- package/dist/ColumnManagerList/ColumnManagerList.types.js +1 -0
- package/dist/ColumnManagerSearchResults/ColumManagerResults.types.js +1 -0
- package/dist/ColumnManagerSearchResults/ColumnManagerSearchResults.js +3 -3
- package/package.json +13 -13
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["item", "theme", "setFixed", "switchAction", "draggable", "searchQuery", "texts", "showGroupSettings"];
|
|
2
2
|
|
|
3
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { CheckS, DividerM, DragHandleM, Grid4M, Grid5M, OptionHorizontalM, PinM, VarTypeBooleanM, VarTypeDateM, VarTypeListM, VarTypeNumberM, VarTypeStringM } from '@synerise/ds-icon
|
|
7
|
-
import Icon from '@synerise/ds-icon';
|
|
6
|
+
import Icon, { CheckS, DividerM, DragHandleM, Grid4M, Grid5M, OptionHorizontalM, PinM, VarTypeBooleanM, VarTypeDateM, VarTypeListM, VarTypeNumberM, VarTypeStringM } from '@synerise/ds-icon';
|
|
8
7
|
import Switch from '@synerise/ds-switch/dist/Switch';
|
|
9
8
|
import { withTheme } from 'styled-components';
|
|
10
9
|
import Dropdown from '@synerise/ds-dropdown';
|
|
@@ -18,11 +17,11 @@ var FIXED_TYPES = {
|
|
|
18
17
|
right: 'right'
|
|
19
18
|
};
|
|
20
19
|
var typeIcon = {
|
|
21
|
-
text: React.createElement(VarTypeStringM, null),
|
|
22
|
-
number: React.createElement(VarTypeNumberM, null),
|
|
23
|
-
date: React.createElement(VarTypeDateM, null),
|
|
24
|
-
"boolean": React.createElement(VarTypeBooleanM, null),
|
|
25
|
-
list: React.createElement(VarTypeListM, null)
|
|
20
|
+
text: /*#__PURE__*/React.createElement(VarTypeStringM, null),
|
|
21
|
+
number: /*#__PURE__*/React.createElement(VarTypeNumberM, null),
|
|
22
|
+
date: /*#__PURE__*/React.createElement(VarTypeDateM, null),
|
|
23
|
+
"boolean": /*#__PURE__*/React.createElement(VarTypeBooleanM, null),
|
|
24
|
+
list: /*#__PURE__*/React.createElement(VarTypeListM, null)
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
var ColumnManagerItem = function ColumnManagerItem(_ref) {
|
|
@@ -34,91 +33,91 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
|
|
|
34
33
|
searchQuery = _ref.searchQuery,
|
|
35
34
|
texts = _ref.texts,
|
|
36
35
|
showGroupSettings = _ref.showGroupSettings,
|
|
37
|
-
rest =
|
|
36
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
38
37
|
|
|
39
38
|
var columnName = React.useMemo(function () {
|
|
40
39
|
if (searchQuery) {
|
|
41
40
|
var escapedQuery = escapeRegEx(searchQuery);
|
|
42
41
|
var startOfQuery = item.name.toLowerCase().search(escapedQuery.toLowerCase());
|
|
43
42
|
var result = item.name.substr(startOfQuery, searchQuery.length);
|
|
44
|
-
return item.name.replace(result, "<span class=\"search-highlight\">"
|
|
43
|
+
return item.name.replace(result, "<span class=\"search-highlight\">" + result + "</span>");
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
return item.name;
|
|
48
47
|
}, [item.name, searchQuery]);
|
|
49
48
|
|
|
50
49
|
var fixedMenu = function fixedMenu() {
|
|
51
|
-
return React.createElement(S.FixedMenu, null, React.createElement(Menu.Item, {
|
|
50
|
+
return /*#__PURE__*/React.createElement(S.FixedMenu, null, /*#__PURE__*/React.createElement(Menu.Item, {
|
|
52
51
|
onClick: function onClick() {
|
|
53
52
|
return setFixed(item.id, FIXED_TYPES.left);
|
|
54
53
|
},
|
|
55
|
-
prefixel: React.createElement(Icon, {
|
|
56
|
-
component: React.createElement(Grid4M, null),
|
|
54
|
+
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
55
|
+
component: /*#__PURE__*/React.createElement(Grid4M, null),
|
|
57
56
|
color: theme.palette['grey-600']
|
|
58
57
|
}),
|
|
59
|
-
suffixel: item.fixed === FIXED_TYPES.left && React.createElement(Icon, {
|
|
60
|
-
component: React.createElement(CheckS, null),
|
|
58
|
+
suffixel: item.fixed === FIXED_TYPES.left && /*#__PURE__*/React.createElement(Icon, {
|
|
59
|
+
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
61
60
|
color: theme.palette['green-600']
|
|
62
61
|
})
|
|
63
|
-
}, texts.fixedLeft), React.createElement(Menu.Item, {
|
|
62
|
+
}, texts.fixedLeft), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
64
63
|
onClick: function onClick() {
|
|
65
64
|
return setFixed(item.id, FIXED_TYPES.right);
|
|
66
65
|
},
|
|
67
|
-
prefixel: React.createElement(Icon, {
|
|
68
|
-
component: React.createElement(Grid5M, null),
|
|
66
|
+
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
67
|
+
component: /*#__PURE__*/React.createElement(Grid5M, null),
|
|
69
68
|
color: theme.palette['grey-600']
|
|
70
69
|
}),
|
|
71
|
-
suffixel: item.fixed === FIXED_TYPES.right && React.createElement(Icon, {
|
|
72
|
-
component: React.createElement(CheckS, null),
|
|
70
|
+
suffixel: item.fixed === FIXED_TYPES.right && /*#__PURE__*/React.createElement(Icon, {
|
|
71
|
+
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
73
72
|
color: theme.palette['green-600']
|
|
74
73
|
})
|
|
75
|
-
}, texts.fixedRight), React.createElement(Menu.Item, {
|
|
74
|
+
}, texts.fixedRight), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
76
75
|
onClick: function onClick() {
|
|
77
76
|
return showGroupSettings(item);
|
|
78
77
|
},
|
|
79
|
-
prefixel: React.createElement(Icon, {
|
|
80
|
-
component: React.createElement(DividerM, null),
|
|
78
|
+
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
79
|
+
component: /*#__PURE__*/React.createElement(DividerM, null),
|
|
81
80
|
color: theme.palette['grey-600']
|
|
82
81
|
}),
|
|
83
|
-
suffixel: item.group && React.createElement(Icon, {
|
|
84
|
-
component: React.createElement(CheckS, null),
|
|
82
|
+
suffixel: item.group && /*#__PURE__*/React.createElement(Icon, {
|
|
83
|
+
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
85
84
|
color: theme.palette['green-600']
|
|
86
85
|
})
|
|
87
86
|
}, texts.group));
|
|
88
87
|
};
|
|
89
88
|
|
|
90
|
-
return React.createElement(S.ColumnManagerItem, rest, React.createElement(S.ItemPart, {
|
|
89
|
+
return /*#__PURE__*/React.createElement(S.ColumnManagerItem, rest, /*#__PURE__*/React.createElement(S.ItemPart, {
|
|
91
90
|
align: "left"
|
|
92
|
-
}, draggable && React.createElement(S.DragHandler, {
|
|
93
|
-
component: React.createElement(DragHandleM, null),
|
|
91
|
+
}, draggable && /*#__PURE__*/React.createElement(S.DragHandler, {
|
|
92
|
+
component: /*#__PURE__*/React.createElement(DragHandleM, null),
|
|
94
93
|
color: theme.palette['grey-400']
|
|
95
|
-
}), React.createElement(Icon, {
|
|
94
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
96
95
|
component: typeIcon[item.type],
|
|
97
96
|
color: theme.palette['grey-600']
|
|
98
|
-
}), React.createElement(S.ColumnManagerItemName, {
|
|
97
|
+
}), /*#__PURE__*/React.createElement(S.ColumnManagerItemName, {
|
|
99
98
|
dangerouslySetInnerHTML: {
|
|
100
99
|
__html: columnName
|
|
101
100
|
}
|
|
102
|
-
})), React.createElement(S.ItemPart, {
|
|
101
|
+
})), /*#__PURE__*/React.createElement(S.ItemPart, {
|
|
103
102
|
align: "right"
|
|
104
|
-
}, React.createElement(S.Icons, null, item.group && React.createElement(Icon, {
|
|
105
|
-
component: React.createElement(DividerM, null),
|
|
103
|
+
}, /*#__PURE__*/React.createElement(S.Icons, null, item.group && /*#__PURE__*/React.createElement(Icon, {
|
|
104
|
+
component: /*#__PURE__*/React.createElement(DividerM, null),
|
|
106
105
|
color: theme.palette['grey-400']
|
|
107
|
-
}), item.fixed && React.createElement(Icon, {
|
|
108
|
-
component: React.createElement(PinM, null),
|
|
106
|
+
}), item.fixed && /*#__PURE__*/React.createElement(Icon, {
|
|
107
|
+
component: /*#__PURE__*/React.createElement(PinM, null),
|
|
109
108
|
color: theme.palette['grey-400']
|
|
110
|
-
})), item.visible && React.createElement(Dropdown, {
|
|
109
|
+
})), item.visible && /*#__PURE__*/React.createElement(Dropdown, {
|
|
111
110
|
overlay: fixedMenu()
|
|
112
|
-
}, React.createElement(Button, {
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
113
112
|
type: "ghost",
|
|
114
113
|
mode: "single-icon"
|
|
115
|
-
}, React.createElement(Icon, {
|
|
116
|
-
component: React.createElement(OptionHorizontalM, null),
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
115
|
+
component: /*#__PURE__*/React.createElement(OptionHorizontalM, null),
|
|
117
116
|
color: theme.palette['grey-700']
|
|
118
|
-
}))), React.createElement(Tooltip, {
|
|
117
|
+
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
119
118
|
title: item.visible ? texts.switchOff : texts.switchOn,
|
|
120
119
|
placement: "topRight"
|
|
121
|
-
}, React.createElement(Switch, {
|
|
120
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
122
121
|
checked: item.visible,
|
|
123
122
|
label: "",
|
|
124
123
|
onChange: function onChange() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import Menu from '@synerise/ds-menu';
|
|
3
|
-
export declare const DragHandler: import("styled-components").StyledComponent<import("react").FC<import("@synerise/ds-icon
|
|
3
|
+
export declare const DragHandler: import("styled-components").StyledComponent<import("react").FC<import("@synerise/ds-icon").IconProps>, any, {}, never>;
|
|
4
4
|
export declare const Icons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export declare const ItemPart: import("styled-components").StyledComponent<"div", any, {
|
|
6
6
|
align: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import Icon from '@synerise/ds-icon';
|
|
2
|
+
import Icon, { IconContainer } from '@synerise/ds-icon';
|
|
3
3
|
import Menu from '@synerise/ds-menu';
|
|
4
|
-
import { IconContainer } from '@synerise/ds-icon/dist/Icon.styles';
|
|
5
4
|
export var DragHandler = styled(Icon).withConfig({
|
|
6
5
|
displayName: "ColumnManagerItemstyles__DragHandler",
|
|
7
6
|
componentId: "sc-12ob8aa-0"
|
|
@@ -24,11 +24,11 @@ var ColumnManagerList = function ColumnManagerList(_ref) {
|
|
|
24
24
|
toggleColumn = _ref.toggleColumn,
|
|
25
25
|
searchResults = _ref.searchResults,
|
|
26
26
|
texts = _ref.texts;
|
|
27
|
-
return React.createElement(S.ColumnManagerList, null, !searchQuery ? React.createElement(React.Fragment, null, React.createElement(S.ListHeadline, null, texts.visible), React.createElement(ReactSortable, _extends({}, SORTABLE_CONFIG, {
|
|
27
|
+
return /*#__PURE__*/React.createElement(S.ColumnManagerList, null, !searchQuery ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.ListHeadline, null, texts.visible), /*#__PURE__*/React.createElement(ReactSortable, _extends({}, SORTABLE_CONFIG, {
|
|
28
28
|
list: visibleList,
|
|
29
29
|
setList: updateVisibleList
|
|
30
30
|
}), visibleList.map(function (item) {
|
|
31
|
-
return React.createElement(ColumnManagerItem, {
|
|
31
|
+
return /*#__PURE__*/React.createElement(ColumnManagerItem, {
|
|
32
32
|
"data-testid": "ds-column-manager-visible-item",
|
|
33
33
|
key: item.id,
|
|
34
34
|
item: item,
|
|
@@ -38,11 +38,11 @@ var ColumnManagerList = function ColumnManagerList(_ref) {
|
|
|
38
38
|
draggable: true,
|
|
39
39
|
texts: texts
|
|
40
40
|
});
|
|
41
|
-
})), hiddenList.length > 0 && React.createElement(React.Fragment, null, React.createElement(S.ListHeadline, null, texts.hidden), React.createElement(ReactSortable, _extends({}, SORTABLE_CONFIG, {
|
|
41
|
+
})), hiddenList.length > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.ListHeadline, null, texts.hidden), /*#__PURE__*/React.createElement(ReactSortable, _extends({}, SORTABLE_CONFIG, {
|
|
42
42
|
list: hiddenList,
|
|
43
43
|
setList: updateHiddenList
|
|
44
44
|
}), hiddenList.map(function (item) {
|
|
45
|
-
return React.createElement(ColumnManagerItem, {
|
|
45
|
+
return /*#__PURE__*/React.createElement(ColumnManagerItem, {
|
|
46
46
|
"data-testid": "ds-column-manager-hidden-item",
|
|
47
47
|
key: item.id,
|
|
48
48
|
item: item,
|
|
@@ -52,7 +52,7 @@ var ColumnManagerList = function ColumnManagerList(_ref) {
|
|
|
52
52
|
draggable: true,
|
|
53
53
|
texts: texts
|
|
54
54
|
});
|
|
55
|
-
})))) : React.createElement(ColumnManagerSearchResults, {
|
|
55
|
+
})))) : /*#__PURE__*/React.createElement(ColumnManagerSearchResults, {
|
|
56
56
|
texts: texts,
|
|
57
57
|
searchResults: searchResults,
|
|
58
58
|
showGroupSettings: showGroupSettings,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,8 +11,8 @@ var ColumnManagerSearchResults = function ColumnManagerSearchResults(_ref) {
|
|
|
11
11
|
_switchAction = _ref.switchAction,
|
|
12
12
|
texts = _ref.texts,
|
|
13
13
|
showGroupSettings = _ref.showGroupSettings;
|
|
14
|
-
return React.createElement(SearchResults, null, searchResults.length ? React.createElement(React.Fragment, null, React.createElement(S.ListHeadline, null, texts.searchResults), searchResults.map(function (column) {
|
|
15
|
-
return React.createElement(ColumnManagerItem, {
|
|
14
|
+
return /*#__PURE__*/React.createElement(SearchResults, null, searchResults.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.ListHeadline, null, texts.searchResults), searchResults.map(function (column) {
|
|
15
|
+
return /*#__PURE__*/React.createElement(ColumnManagerItem, {
|
|
16
16
|
key: column.id,
|
|
17
17
|
item: column,
|
|
18
18
|
setFixed: setFixed,
|
|
@@ -24,7 +24,7 @@ var ColumnManagerSearchResults = function ColumnManagerSearchResults(_ref) {
|
|
|
24
24
|
"data-testid": "ds-column-manager-filtered-item",
|
|
25
25
|
texts: texts
|
|
26
26
|
});
|
|
27
|
-
})) : React.createElement(Result, {
|
|
27
|
+
})) : /*#__PURE__*/React.createElement(Result, {
|
|
28
28
|
description: texts.noResults,
|
|
29
29
|
type: "no-results",
|
|
30
30
|
noSearchResults: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-column-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "ColumnManager UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"types": "dist/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@synerise/ds-button": "^0.
|
|
33
|
-
"@synerise/ds-drawer": "^0.
|
|
34
|
-
"@synerise/ds-dropdown": "^0.
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
36
|
-
"@synerise/ds-input": "^0.
|
|
37
|
-
"@synerise/ds-item-filter": "^0.
|
|
38
|
-
"@synerise/ds-result": "^0.
|
|
39
|
-
"@synerise/ds-scrollbar": "^0.
|
|
40
|
-
"@synerise/ds-search-bar": "^0.
|
|
41
|
-
"@synerise/ds-tooltip": "^0.
|
|
42
|
-
"@synerise/ds-typography": "^0.
|
|
32
|
+
"@synerise/ds-button": "^0.16.2",
|
|
33
|
+
"@synerise/ds-drawer": "^0.5.3",
|
|
34
|
+
"@synerise/ds-dropdown": "^0.17.3",
|
|
35
|
+
"@synerise/ds-icon": "^0.46.2",
|
|
36
|
+
"@synerise/ds-input": "^0.18.2",
|
|
37
|
+
"@synerise/ds-item-filter": "^0.7.3",
|
|
38
|
+
"@synerise/ds-result": "^0.6.2",
|
|
39
|
+
"@synerise/ds-scrollbar": "^0.4.2",
|
|
40
|
+
"@synerise/ds-search-bar": "^0.5.2",
|
|
41
|
+
"@synerise/ds-tooltip": "^0.11.2",
|
|
42
|
+
"@synerise/ds-typography": "^0.12.2",
|
|
43
43
|
"@synerise/ds-utils": "^0.19.0",
|
|
44
44
|
"react-final-form": "^6.3.5",
|
|
45
45
|
"react-sortablejs": "^6.0.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"moment": "^2.24.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
|
|
56
56
|
}
|