dtable-ui-component 4.3.2 → 4.3.3-alpha2
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.
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './dtable-select-label.css';
|
|
3
|
+
function DTableSelectLabel(_ref) {
|
|
4
|
+
var classname = _ref.classname,
|
|
5
|
+
name = _ref.name,
|
|
6
|
+
isSelect = _ref.isSelect;
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "".concat(classname, " w-100 d-flex justify-content-between")
|
|
9
|
+
}, /*#__PURE__*/React.createElement("span", null, name), isSelect && /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "dtable-select-check-icon"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
12
|
+
className: "dtable-font dtable-icon-check-mark"
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
DTableSelectLabel.defaultProps = {
|
|
16
|
+
classname: '',
|
|
17
|
+
name: '',
|
|
18
|
+
isSelect: false
|
|
19
|
+
};
|
|
20
|
+
export default DTableSelectLabel;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.role-status-permission-editor .dropdown-toggle-button .dtable-icon-drop-down {
|
|
2
|
+
font-size: 12px;
|
|
3
|
+
color: #b5b5b5;
|
|
4
|
+
transform: scale(0.8);
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.role-status-permission-editor .dropdown-toggle-button .dtable-icon-drop-down.hide{
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.role-status-permission-editor .dropdown-toggle-button .dtable-icon-drop-down:hover {
|
|
13
|
+
color: #555;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.role-status-permission-editor .dropdown-toggle-button .dropdown-icon-container {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
flex: 1 0 auto;
|
|
20
|
+
width: 20px;
|
|
21
|
+
height: 20px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.role-status-permission-editor .dropdown-menu {
|
|
25
|
+
max-width: 200px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.role-status-permission-editor .dropdown-menu .dropdown-item {
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 2px 12px;
|
|
33
|
+
min-width: 140px;
|
|
34
|
+
min-height: 28px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.role-status-permission-editor .dropdown-menu .dropdown-item .label-container span {
|
|
38
|
+
word-wrap: normal;
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.role-status-permission-editor .dropdown-menu .dropdown-item:hover {
|
|
43
|
+
color: #212529;
|
|
44
|
+
background: #f5f5f5;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.role-status-permission-editor .dropdown-menu .dropdown-item:focus {
|
|
49
|
+
outline: 0;
|
|
50
|
+
color: unset;
|
|
51
|
+
background-color: unset;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.role-status-permission-editor .dropdown-menu .dropdown-item .dtable-icon-check-mark {
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
color: #798d99;
|
|
57
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import './index.css';
|
|
6
|
+
var RoleStatusPermissionEditor = function RoleStatusPermissionEditor(_ref) {
|
|
7
|
+
var isShowDropdownIcon = _ref.isShowDropdownIcon,
|
|
8
|
+
currentOption = _ref.currentOption,
|
|
9
|
+
menuOptions = _ref.menuOptions,
|
|
10
|
+
onChangeOption = _ref.onChangeOption;
|
|
11
|
+
var _useState = useState(false),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
isOpen = _useState2[0],
|
|
14
|
+
setIsOpen = _useState2[1];
|
|
15
|
+
var handleClickMenuOption = function handleClickMenuOption(menuOption) {
|
|
16
|
+
var value = menuOption.value;
|
|
17
|
+
if (value === currentOption.value) return;
|
|
18
|
+
onChangeOption(value);
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
21
|
+
isOpen: isOpen,
|
|
22
|
+
className: "role-status-permission-editor",
|
|
23
|
+
toggle: function toggle() {
|
|
24
|
+
return setIsOpen(!isOpen);
|
|
25
|
+
}
|
|
26
|
+
}, /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
27
|
+
className: "dropdown-toggle-button d-flex align-items-center",
|
|
28
|
+
tag: "div"
|
|
29
|
+
}, currentOption.label, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: "dropdown-icon-container ml-2"
|
|
31
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
className: classnames('dtable-font dtable-icon-drop-down', {
|
|
33
|
+
'hide': !isShowDropdownIcon
|
|
34
|
+
})
|
|
35
|
+
}))), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
36
|
+
positionFixed: true,
|
|
37
|
+
modifiers: {
|
|
38
|
+
preventOverflow: {
|
|
39
|
+
boundariesElement: document.body
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, menuOptions.map(function (option) {
|
|
43
|
+
var _option$menuOptionCla = option.menuOptionClassName,
|
|
44
|
+
menuOptionClassName = _option$menuOptionCla === void 0 ? '' : _option$menuOptionCla,
|
|
45
|
+
value = option.value,
|
|
46
|
+
label = option.label;
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
key: "item-".concat(value),
|
|
49
|
+
className: classnames('editor-item', menuOptionClassName)
|
|
50
|
+
}, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
return handleClickMenuOption(option);
|
|
53
|
+
}
|
|
54
|
+
}, label, value === currentOption.value && /*#__PURE__*/React.createElement("i", {
|
|
55
|
+
className: "dtable-font dtable-icon-check-mark ml-2"
|
|
56
|
+
})));
|
|
57
|
+
})));
|
|
58
|
+
};
|
|
59
|
+
export default RoleStatusPermissionEditor;
|
package/lib/index.js
CHANGED
|
@@ -61,11 +61,13 @@ export { default as LinkEditor } from './LinkEditor';
|
|
|
61
61
|
export { default as DTablePopover } from './DTablePopover';
|
|
62
62
|
export { default as NotificationPopover } from './NotificationPopover';
|
|
63
63
|
export { default as DTableSelect } from './DTableSelect';
|
|
64
|
+
export { default as DTableSelectLabel } from './DTableSelect/dtable-select-label';
|
|
64
65
|
export { default as DTableSwitch } from './DTableSwitch';
|
|
65
66
|
export { default as DTableCustomizeSelect } from './DTableCustomizeSelect';
|
|
66
67
|
export { default as DTableCustomizeCollaboratorSelect } from './DTableCustomizeCollaboratorSelect';
|
|
67
68
|
export { default as DTableSearchInput } from './DTableSearchInput';
|
|
68
69
|
export { default as ModalPortal } from './ModalPortal';
|
|
70
|
+
export { default as RoleStatusPermissionEditor } from './RoleStatusPermissionEditor';
|
|
69
71
|
|
|
70
72
|
// setting
|
|
71
73
|
export { default as FieldDisplaySetting } from './FieldDisplaySetting';
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3-alpha2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@seafile/react-image-lightbox": "2.0.5",
|
|
7
7
|
"@seafile/seafile-calendar": "0.0.24",
|
|
8
|
-
"@seafile/seafile-editor": "0.3.
|
|
8
|
+
"@seafile/seafile-editor": "0.3.140",
|
|
9
9
|
"antd-mobile": "2.3.1",
|
|
10
10
|
"bail": "1.0.5",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"dayjs": "1.10.7",
|
|
13
13
|
"deepmerge": "^2.1.0",
|
|
14
|
-
"dtable-utils": "4.3.
|
|
14
|
+
"dtable-utils": "4.3.5",
|
|
15
15
|
"glamor": "^2.20.40",
|
|
16
16
|
"hast-util-sanitize": "^1.1.2",
|
|
17
17
|
"hast-util-to-html": "3.1.0",
|