dtable-ui-component 4.3.10-alpha2 → 4.3.10-alpha4
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.
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
min-height: 160px;
|
|
15
15
|
max-height: 200px;
|
|
16
16
|
margin: 10px 0;
|
|
17
|
-
padding: 0 10px;
|
|
18
17
|
overflow: auto;
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
align-items: center;
|
|
24
23
|
justify-content: space-between;
|
|
25
24
|
height: 30px;
|
|
26
|
-
padding
|
|
25
|
+
padding: 0 10px;
|
|
27
26
|
font-size: 14px;
|
|
28
27
|
cursor: pointer;
|
|
29
28
|
}
|
|
@@ -45,3 +44,22 @@
|
|
|
45
44
|
font-size: 12px;
|
|
46
45
|
color: #798d99;
|
|
47
46
|
}
|
|
47
|
+
|
|
48
|
+
.dtable-ui-collaborator-editor .dtable-ui-collaborator-editor-container-no-btn {
|
|
49
|
+
min-height: 40px;
|
|
50
|
+
padding: 0.375rem 0.75rem;
|
|
51
|
+
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
52
|
+
border-radius: 3px;
|
|
53
|
+
transition: border-color .15s ease-in-out;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dtable-ui-collaborator-editor .dtable-ui-collaborator-editor-container-no-btn .collaborators-container {
|
|
57
|
+
min-height: 26px;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dtable-ui-collaborator-editor .dtable-ui-collaborator-editor-container-no-btn .collaborators-container .collaborator-item {
|
|
64
|
+
margin: 2px 10px 2px 0;
|
|
65
|
+
}
|
|
@@ -9,7 +9,7 @@ import './index.css';
|
|
|
9
9
|
class CollaboratorEditor extends React.Component {
|
|
10
10
|
constructor(props) {
|
|
11
11
|
super(props);
|
|
12
|
-
this.
|
|
12
|
+
this.onDocumentClick = e => {
|
|
13
13
|
if (this.editorContainer !== e.target && !this.editorContainer.contains(e.target)) {
|
|
14
14
|
this.onClosePopover();
|
|
15
15
|
}
|
|
@@ -28,7 +28,7 @@ class CollaboratorEditor extends React.Component {
|
|
|
28
28
|
}
|
|
29
29
|
return [];
|
|
30
30
|
};
|
|
31
|
-
this.
|
|
31
|
+
this.togglePopover = event => {
|
|
32
32
|
event.nativeEvent.stopImmediatePropagation();
|
|
33
33
|
event.stopPropagation();
|
|
34
34
|
if (this.props.isReadOnly) {
|
|
@@ -67,7 +67,6 @@ class CollaboratorEditor extends React.Component {
|
|
|
67
67
|
newValue
|
|
68
68
|
}, () => {
|
|
69
69
|
this.onCommit(newValue);
|
|
70
|
-
this.onClosePopover();
|
|
71
70
|
});
|
|
72
71
|
};
|
|
73
72
|
this.onDeleteCollaborator = collaborator => {
|
|
@@ -108,6 +107,15 @@ class CollaboratorEditor extends React.Component {
|
|
|
108
107
|
isPopoverShow: false
|
|
109
108
|
});
|
|
110
109
|
};
|
|
110
|
+
this.onClickContainer = e => {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
if (!this.props.isShowEditButton && !this.state.isPopoverShow) {
|
|
113
|
+
this.setState({
|
|
114
|
+
isPopoverShow: true,
|
|
115
|
+
popoverPosition: this.caculatePopoverPosition()
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
};
|
|
111
119
|
this.setEditorContainerRef = editorContainer => {
|
|
112
120
|
this.editorContainer = editorContainer;
|
|
113
121
|
};
|
|
@@ -121,15 +129,16 @@ class CollaboratorEditor extends React.Component {
|
|
|
121
129
|
};
|
|
122
130
|
}
|
|
123
131
|
componentDidMount() {
|
|
124
|
-
document.addEventListener('click', this.
|
|
132
|
+
document.addEventListener('click', this.onDocumentClick);
|
|
125
133
|
}
|
|
126
134
|
componentWillUnmount() {
|
|
127
|
-
document.removeEventListener('click', this.
|
|
135
|
+
document.removeEventListener('click', this.onDocumentClick);
|
|
128
136
|
}
|
|
129
137
|
render() {
|
|
130
138
|
let {
|
|
131
139
|
collaborators,
|
|
132
|
-
isReadOnly
|
|
140
|
+
isReadOnly,
|
|
141
|
+
isShowEditButton
|
|
133
142
|
} = this.props;
|
|
134
143
|
let {
|
|
135
144
|
isPopoverShow,
|
|
@@ -142,12 +151,13 @@ class CollaboratorEditor extends React.Component {
|
|
|
142
151
|
className: "dtable-ui-collaborator-editor"
|
|
143
152
|
}, /*#__PURE__*/React.createElement("div", {
|
|
144
153
|
ref: this.setEditorRef,
|
|
145
|
-
className: "dtable-ui-collaborator-editor-container"
|
|
146
|
-
|
|
154
|
+
className: "dtable-ui-collaborator-editor-container ".concat(isShowEditButton ? '' : 'dtable-ui-collaborator-editor-container-no-btn'),
|
|
155
|
+
onClick: this.onClickContainer
|
|
156
|
+
}, isShowEditButton && /*#__PURE__*/React.createElement(EditEditorButton, {
|
|
147
157
|
text: getLocale('Add_a_collaborator'),
|
|
148
|
-
onClick: this.
|
|
158
|
+
onClick: this.togglePopover
|
|
149
159
|
}), selectedCollaborators.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
150
|
-
className: "collaborators-container mt-2
|
|
160
|
+
className: "collaborators-container ".concat(isShowEditButton ? 'mt-2' : '')
|
|
151
161
|
}, selectedCollaborators.map(collaborator => {
|
|
152
162
|
return /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
153
163
|
key: collaborator.email,
|
|
@@ -176,6 +186,7 @@ class CollaboratorEditor extends React.Component {
|
|
|
176
186
|
}
|
|
177
187
|
}
|
|
178
188
|
CollaboratorEditor.defaultProps = {
|
|
189
|
+
isShowEditButton: true,
|
|
179
190
|
isReadOnly: false,
|
|
180
191
|
value: []
|
|
181
192
|
};
|
package/lib/DateEditor/index.js
CHANGED
|
@@ -50,7 +50,6 @@ class PCDateEditorPopover extends React.Component {
|
|
|
50
50
|
lang
|
|
51
51
|
} = this.props;
|
|
52
52
|
let defaultValue = dayjs().clone();
|
|
53
|
-
console.log('pc date editor', 67, getLocale('Please_input'));
|
|
54
53
|
return /*#__PURE__*/React.createElement(Calendar, {
|
|
55
54
|
locale: initDateEditorLanguage(lang),
|
|
56
55
|
style: {
|
package/lib/lang/index.js
CHANGED
|
@@ -14,13 +14,11 @@ export function setLocale(args) {
|
|
|
14
14
|
let lang = typeof args === 'string' ? args : LANGUAGE;
|
|
15
15
|
LANGUAGE_MAP = langData[lang] || langData[LANGUAGE];
|
|
16
16
|
}
|
|
17
|
-
console.log(22, LANGUAGE_MAP);
|
|
18
17
|
export function getLocale(key, def) {
|
|
19
18
|
if (!key) return def;
|
|
20
19
|
if (!LANGUAGE_MAP[key]) {
|
|
21
20
|
return def || key;
|
|
22
21
|
}
|
|
23
|
-
console.log(LANGUAGE_MAP[key]);
|
|
24
22
|
return LANGUAGE_MAP[key];
|
|
25
23
|
}
|
|
26
24
|
export function substitute(str, obj) {
|