dtable-ui-component 4.3.2 → 4.3.3-alpha1

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,10 @@
1
+ .dtable-select-check-icon {
2
+ width: 20px;
3
+ height: 20px;
4
+ text-align: center;
5
+ }
6
+
7
+ .dtable-select-check-icon .dtable-font {
8
+ font-size: 12px;
9
+ color: #798d99;
10
+ }
@@ -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,48 @@
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:hover {
9
+ color: #555;
10
+ }
11
+
12
+ .role-status-permission-editor .dropdown-menu {
13
+ max-width: 200px;
14
+ }
15
+
16
+ .role-status-permission-editor .dropdown-menu .dropdown-item {
17
+ display: flex;
18
+ justify-content: space-between;
19
+ align-items: center;
20
+ padding: 2px 12px;
21
+ min-width: 140px;
22
+ min-height: 28px;
23
+ }
24
+
25
+ .role-status-permission-editor .dropdown-menu .dropdown-item:hover {
26
+ color: #212529;
27
+ background: #f5f5f5;
28
+ cursor: pointer;
29
+ }
30
+
31
+ .role-status-permission-editor .dropdown-menu .dropdown-item:focus {
32
+ outline: 0;
33
+ color: unset;
34
+ background-color: unset;
35
+ }
36
+
37
+ .role-status-permission-editor .dropdown-toggle-button div,
38
+ .role-status-permission-editor .dropdown-menu .dropdown-item div {
39
+ white-space: pre-wrap;
40
+ word-wrap: break-word;
41
+ word-break: break-all;
42
+ user-select: none;
43
+ }
44
+
45
+ .role-status-permission-editor .dropdown-menu .dropdown-item .dtable-icon-check-mark {
46
+ font-size: 12px;
47
+ color: #798d99;
48
+ }
@@ -0,0 +1,54 @@
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 currentOption = _ref.currentOption,
8
+ menuOptions = _ref.menuOptions,
9
+ onChangeOption = _ref.onChangeOption;
10
+ var _useState = useState(false),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ isOpen = _useState2[0],
13
+ setIsOpen = _useState2[1];
14
+ var handleClickMenuOption = function handleClickMenuOption(menuOption) {
15
+ var value = menuOption.value;
16
+ if (value === currentOption.value) return;
17
+ onChangeOption(value);
18
+ };
19
+ return /*#__PURE__*/React.createElement(Dropdown, {
20
+ isOpen: isOpen,
21
+ className: "role-status-permission-editor",
22
+ toggle: function toggle() {
23
+ return setIsOpen(!isOpen);
24
+ }
25
+ }, /*#__PURE__*/React.createElement(DropdownToggle, {
26
+ className: "dropdown-toggle-button d-flex align-items-center",
27
+ tag: "div"
28
+ }, currentOption.label, /*#__PURE__*/React.createElement("span", {
29
+ className: "dtable-font dtable-icon-drop-down ml-2"
30
+ })), /*#__PURE__*/React.createElement(DropdownMenu, {
31
+ positionFixed: true,
32
+ modifiers: {
33
+ preventOverflow: {
34
+ boundariesElement: document.body
35
+ }
36
+ }
37
+ }, menuOptions.map(function (option) {
38
+ var _option$menuOptionCla = option.menuOptionClassName,
39
+ menuOptionClassName = _option$menuOptionCla === void 0 ? '' : _option$menuOptionCla,
40
+ value = option.value,
41
+ label = option.label;
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ key: "item-".concat(value),
44
+ className: classnames('editor-item', menuOptionClassName)
45
+ }, /*#__PURE__*/React.createElement(DropdownItem, {
46
+ onClick: function onClick() {
47
+ return handleClickMenuOption(option);
48
+ }
49
+ }, label, value === currentOption.value && /*#__PURE__*/React.createElement("i", {
50
+ className: "dtable-font dtable-icon-check-mark"
51
+ })));
52
+ })));
53
+ };
54
+ 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.2",
3
+ "version": "4.3.3-alpha1",
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.139",
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.1",
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",