dtable-ui-component 0.3.13 → 0.3.15
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,186 @@
|
|
|
1
|
+
.notification-wrapper .popover {
|
|
2
|
+
max-width: 300px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.notification-container {
|
|
6
|
+
position: absolute;
|
|
7
|
+
background: #fff;
|
|
8
|
+
width: 320px;
|
|
9
|
+
right: -10px;
|
|
10
|
+
top: -1px;
|
|
11
|
+
border-radius: 3px;
|
|
12
|
+
box-shadow: 0 0 5px #ccc;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.notification-container .notification-header {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
height: 50px;
|
|
20
|
+
border-bottom: 1px solid #ededed;
|
|
21
|
+
font-size: 16px;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.notification-container .notification-header .notification-close-icon {
|
|
27
|
+
position: absolute;
|
|
28
|
+
right: 14px;
|
|
29
|
+
height: 24px;
|
|
30
|
+
width: 24px;
|
|
31
|
+
text-align: center;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
color: #000;
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.notification-container .notification-header .notification-close-icon:hover {
|
|
39
|
+
opacity: 0.75;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.notification-container .notification-body {
|
|
43
|
+
padding: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.notification-container .notification-body .show-weixin-qrcode {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
border-bottom: 1px solid #ededed;
|
|
49
|
+
height: 40px;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: flex-start;
|
|
53
|
+
padding-left: 10px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.show-weixin-qrcode .weixin-icon {
|
|
57
|
+
color: #999;
|
|
58
|
+
font-size: 20px;
|
|
59
|
+
margin-left: 20px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.notification-container .notification-body .mark-notifications {
|
|
63
|
+
color: #b4b4b4;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
border-bottom: 1px solid #ededed;
|
|
66
|
+
height: 36px;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
padding-right: 1rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.notification-container .notification-body .mark-notifications:hover {
|
|
74
|
+
text-decoration: underline;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.notification-body .notification-list-container {
|
|
78
|
+
max-height: 260px;
|
|
79
|
+
overflow: auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.notification-list-container .notification-item {
|
|
83
|
+
padding: 14px 16px 14px 10px;
|
|
84
|
+
border-bottom: 1px solid #ededed;
|
|
85
|
+
position: relative;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.notification-list-container .notification-item:last-child {
|
|
90
|
+
border-bottom: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.notification-list-container .notification-item:hover {
|
|
94
|
+
background: #f5f5f5;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.notification-list-container .notification-item .notification-item-header {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.notification-list-container .notification-item .notification-point {
|
|
103
|
+
display: inline-block;
|
|
104
|
+
width: 8px;
|
|
105
|
+
height: 8px;
|
|
106
|
+
border-radius: 50%;
|
|
107
|
+
background: red;
|
|
108
|
+
margin-right: 12px;
|
|
109
|
+
position: absolute;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.notification-list-container .notification-item .notification-header-info {
|
|
113
|
+
display: flex;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
flex: 1;
|
|
116
|
+
margin-left: 20px;
|
|
117
|
+
width: calc(100% - 20px);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.notification-user-detail {
|
|
121
|
+
display: flex;
|
|
122
|
+
width: 65%;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.notification-user-detail img {
|
|
126
|
+
margin-top: 3px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.notification-user-name {
|
|
130
|
+
text-overflow: ellipsis;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
white-space: nowrap;
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.notification-item .notification-header-info .notification-time {
|
|
137
|
+
color: #b4b4b4;
|
|
138
|
+
text-overflow: ellipsis;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
white-space: nowrap;
|
|
141
|
+
font-size: 13px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.notification-list-container .notification-item .notification-content-wrapper {
|
|
145
|
+
font-size: 13px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.notification-item .notification-content-quotes {
|
|
149
|
+
width: 8px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.notification-list-container .notification-item .notification-comment-content {
|
|
153
|
+
max-width: calc(100% - 16px);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.notification-list-container .notification-item .notification-comment-content p {
|
|
157
|
+
display: inline-block;
|
|
158
|
+
letter-spacing: 1px;
|
|
159
|
+
max-width: 100%;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
text-overflow: ellipsis;
|
|
162
|
+
white-space: nowrap;
|
|
163
|
+
margin-bottom: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.notification-list-container .notification-item .notification-comment-content p img {
|
|
167
|
+
max-width: 70%;
|
|
168
|
+
height: auto;
|
|
169
|
+
max-height: 60px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.notification-body .notification-footer {
|
|
173
|
+
height: 40px;
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
background: #f9f9f9;
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
border-bottom-right-radius: 3px;
|
|
180
|
+
border-bottom-left-radius: 3px;
|
|
181
|
+
border-top: 1px solid #ededed;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.notification-body .notification-footer:hover {
|
|
185
|
+
text-decoration: underline;
|
|
186
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Popover } from 'reactstrap';
|
|
7
|
+
import './index.css';
|
|
8
|
+
|
|
9
|
+
var NotificationPopover = /*#__PURE__*/function (_React$Component) {
|
|
10
|
+
_inherits(NotificationPopover, _React$Component);
|
|
11
|
+
|
|
12
|
+
var _super = _createSuper(NotificationPopover);
|
|
13
|
+
|
|
14
|
+
function NotificationPopover() {
|
|
15
|
+
var _this;
|
|
16
|
+
|
|
17
|
+
_classCallCheck(this, NotificationPopover);
|
|
18
|
+
|
|
19
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
20
|
+
args[_key] = arguments[_key];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
24
|
+
|
|
25
|
+
_this.handleOutsideClick = function (e) {
|
|
26
|
+
if (!_this.notificationContainerRef.contains(e.target)) {
|
|
27
|
+
document.removeEventListener('mousedown', _this.handleOutsideClick);
|
|
28
|
+
|
|
29
|
+
if (e.target.className === 'tool notification' || e.target.parentNode.className === 'tool notification') {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_this.props.onNotificationListToggle();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
_this.onNotificationDialogToggle = function () {
|
|
38
|
+
_this.props.onNotificationDialogToggle();
|
|
39
|
+
|
|
40
|
+
_this.props.onNotificationListToggle();
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
_this.onWeixinQRCodeDialogToggle = function () {
|
|
44
|
+
_this.props.onOpenWeixinQRCodeDialog();
|
|
45
|
+
|
|
46
|
+
_this.props.onNotificationListToggle();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
_this.onHandleScroll = function () {
|
|
50
|
+
if (_this.notificationListRef.offsetHeight + _this.notificationListRef.scrollTop + 1 >= _this.notificationsWrapperRef.offsetHeight) {
|
|
51
|
+
_this.props.listNotifications && _this.props.listNotifications();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return _this;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
_createClass(NotificationPopover, [{
|
|
59
|
+
key: "componentDidMount",
|
|
60
|
+
value: function componentDidMount() {
|
|
61
|
+
document.addEventListener('mousedown', this.handleOutsideClick);
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "componentWillUnmount",
|
|
65
|
+
value: function componentWillUnmount() {
|
|
66
|
+
document.removeEventListener('mousedown', this.handleOutsideClick);
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "render",
|
|
70
|
+
value: function render() {
|
|
71
|
+
var _this2 = this;
|
|
72
|
+
|
|
73
|
+
var _this$props = this.props,
|
|
74
|
+
headerText = _this$props.headerText,
|
|
75
|
+
bodyText = _this$props.bodyText,
|
|
76
|
+
footerText = _this$props.footerText;
|
|
77
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
78
|
+
className: "notification-wrapper",
|
|
79
|
+
target: "notification-popover",
|
|
80
|
+
isOpen: true,
|
|
81
|
+
fade: false,
|
|
82
|
+
hideArrow: true,
|
|
83
|
+
placement: "bottom"
|
|
84
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: "notification-container",
|
|
86
|
+
ref: function ref(_ref3) {
|
|
87
|
+
return _this2.notificationContainerRef = _ref3;
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: "notification-header"
|
|
91
|
+
}, headerText, /*#__PURE__*/React.createElement("span", {
|
|
92
|
+
className: "dtable-font dtable-icon-x notification-close-icon",
|
|
93
|
+
onClick: this.props.onNotificationListToggle
|
|
94
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "notification-body"
|
|
96
|
+
}, this.props.enableWeixin && /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: "show-weixin-qrcode",
|
|
98
|
+
onClick: this.onWeixinQRCodeDialogToggle
|
|
99
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
100
|
+
className: "dtable-font dtable-icon-wechat weixin-icon"
|
|
101
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
102
|
+
className: "ml-2"
|
|
103
|
+
}, "\u5173\u6CE8\u516C\u4F17\u53F7\u83B7\u53D6\u5B9E\u65F6\u901A\u77E5")), /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
className: "mark-notifications",
|
|
105
|
+
onClick: this.props.onMarkAllNotifications
|
|
106
|
+
}, bodyText), /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: "notification-list-container",
|
|
108
|
+
onScroll: this.onHandleScroll,
|
|
109
|
+
ref: function ref(_ref2) {
|
|
110
|
+
return _this2.notificationListRef = _ref2;
|
|
111
|
+
}
|
|
112
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
ref: function ref(_ref) {
|
|
114
|
+
return _this2.notificationsWrapperRef = _ref;
|
|
115
|
+
}
|
|
116
|
+
}, this.props.children)), /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: "notification-footer",
|
|
118
|
+
onClick: this.onNotificationDialogToggle
|
|
119
|
+
}, footerText))));
|
|
120
|
+
}
|
|
121
|
+
}]);
|
|
122
|
+
|
|
123
|
+
return NotificationPopover;
|
|
124
|
+
}(React.Component);
|
|
125
|
+
|
|
126
|
+
NotificationPopover.defaultProps = {
|
|
127
|
+
headerText: '',
|
|
128
|
+
bodyText: '',
|
|
129
|
+
footerText: ''
|
|
130
|
+
};
|
|
131
|
+
export { NotificationPopover as default };
|
package/lib/index.js
CHANGED
|
@@ -53,6 +53,7 @@ export { default as DateEditor } from './DateEditor';
|
|
|
53
53
|
export { default as LinkEditor } from './LinkEditor'; // dtable custom
|
|
54
54
|
|
|
55
55
|
export { default as DTablePopover } from './DTablePopover';
|
|
56
|
+
export { default as NotificationPopover } from './NotificationPopover';
|
|
56
57
|
export { default as DTableSelect } from './DTableSelect';
|
|
57
58
|
export { default as DTableSwitch } from './DTableSwitch';
|
|
58
59
|
export { default as DTableCustomizeSelect } from './DTableCustomizeSelect';
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.15",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"dtable-utils": "0.0.2",
|
|
7
6
|
"@seafile/react-image-lightbox": "0.0.9",
|
|
8
7
|
"@seafile/seafile-calendar": "0.0.24",
|
|
9
8
|
"@seafile/seafile-editor": "0.3.121",
|
|
@@ -12,6 +11,7 @@
|
|
|
12
11
|
"classnames": "^2.3.2",
|
|
13
12
|
"dayjs": "1.10.7",
|
|
14
13
|
"deepmerge": "^2.1.0",
|
|
14
|
+
"dtable-utils": "4.2.2",
|
|
15
15
|
"glamor": "^2.20.40",
|
|
16
16
|
"hast-util-sanitize": "^1.1.2",
|
|
17
17
|
"hast-util-to-html": "3.1.0",
|