@seafile/sdoc-editor 2.0.18-alph-0.0.5 → 2.0.18-alph-0.0.7
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/dist/basic-sdk/extension/plugins/seatable-row/dialog/add-seatable-row-dialog/helpers.js +47 -41
- package/dist/basic-sdk/extension/plugins/seatable-row/dialog/add-seatable-row-dialog/row-card-header-cell.js +3 -4
- package/dist/basic-sdk/extension/plugins/seatable-row/dialog/add-seatable-row-dialog/row-card-item.js +4 -3
- package/package.json +1 -1
package/dist/basic-sdk/extension/plugins/seatable-row/dialog/add-seatable-row-dialog/helpers.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getRowRecord = exports.getRowName = exports.getFormattedCell = exports.getAllCollaborators = exports.UNSHOW_COLUMN_TYPE = void 0;
|
|
8
8
|
exports.getSelectColumnOptions = getSelectColumnOptions;
|
|
9
9
|
exports.isFunction = void 0;
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
11
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
12
|
var _dtableUtils = require("dtable-utils");
|
|
12
13
|
var _SimpleCellFormatter = _interopRequireDefault(require("./formatters/SimpleCellFormatter"));
|
|
@@ -25,23 +26,27 @@ const getRowName = (columns, row, formula_rows) => {
|
|
|
25
26
|
if (formula_rows) {
|
|
26
27
|
formulaRows = formula_rows;
|
|
27
28
|
} else {
|
|
28
|
-
const view = window.app.getSelectedView();
|
|
29
|
-
formulaRows = view.formula_rows || {};
|
|
30
|
-
|
|
29
|
+
// const view = window.app.getSelectedView();
|
|
30
|
+
// formulaRows = view.formula_rows || {};
|
|
31
|
+
formulaRows = {
|
|
32
|
+
VMjdqn_yQAWIdPFwvp_72g: {
|
|
33
|
+
I3hm: null
|
|
34
|
+
}
|
|
35
|
+
};
|
|
31
36
|
}
|
|
32
|
-
const tables = window.app.state.value.tables;
|
|
33
|
-
|
|
34
|
-
const departments = window.app.state;
|
|
35
|
-
|
|
36
|
-
const collaborators = window.app.state.collaboratorsWithAppUsers;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
// const tables = window.app.state.value.tables;
|
|
38
|
+
const tables = null;
|
|
39
|
+
// const departments = window.app.state;
|
|
40
|
+
const departments = null;
|
|
41
|
+
// const collaborators = window.app.state.collaboratorsWithAppUsers;
|
|
42
|
+
const collaborators = [{
|
|
43
|
+
avatar_url: 'http://127.0.0.1:80/media/avatars/default.png',
|
|
44
|
+
contact_email: '',
|
|
45
|
+
email: 'cf496c43676c427e8bf1acb8736b2491@auth.local',
|
|
46
|
+
id: '',
|
|
47
|
+
name: 'admin',
|
|
48
|
+
name_pinyin: 'admin'
|
|
49
|
+
}];
|
|
45
50
|
// console.log(1, formulaRows, data, tables, collaborators, departments);
|
|
46
51
|
return (0, _dtableUtils.getCellValueDisplayString)(row, type, key, {
|
|
47
52
|
formulaRows,
|
|
@@ -77,7 +82,7 @@ const getFormattedCell = function (column, row) {
|
|
|
77
82
|
if (searchValue) {
|
|
78
83
|
// displayValue = _renderSearch(value, searchValue);
|
|
79
84
|
} else {
|
|
80
|
-
displayValue = /*#__PURE__*/
|
|
85
|
+
displayValue = /*#__PURE__*/_react.default.createElement("span", {
|
|
81
86
|
className: "cell-value-ellipsis text-truncate",
|
|
82
87
|
title: value
|
|
83
88
|
}, value);
|
|
@@ -121,7 +126,7 @@ const getFormattedCell = function (column, row) {
|
|
|
121
126
|
if (searchValue) {
|
|
122
127
|
// displayValue = _renderSearch(formatedValue, searchValue);
|
|
123
128
|
} else {
|
|
124
|
-
displayValue = /*#__PURE__*/
|
|
129
|
+
displayValue = /*#__PURE__*/_react.default.createElement("div", {
|
|
125
130
|
className: "number-formatter"
|
|
126
131
|
}, formatedValue);
|
|
127
132
|
}
|
|
@@ -156,9 +161,9 @@ const getFormattedCell = function (column, row) {
|
|
|
156
161
|
type: array_type,
|
|
157
162
|
data: array_data
|
|
158
163
|
};
|
|
159
|
-
displayValue = /*#__PURE__*/
|
|
164
|
+
displayValue = /*#__PURE__*/_react.default.createElement("div", {
|
|
160
165
|
className: "links-formatter"
|
|
161
|
-
}, /*#__PURE__*/
|
|
166
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
162
167
|
className: "formatter-show"
|
|
163
168
|
}, value.map(item => {
|
|
164
169
|
const {
|
|
@@ -177,10 +182,10 @@ const getFormattedCell = function (column, row) {
|
|
|
177
182
|
collaborators,
|
|
178
183
|
departments
|
|
179
184
|
});
|
|
180
|
-
return /*#__PURE__*/
|
|
185
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
181
186
|
key: `${rowId}_${display_column_key}`,
|
|
182
187
|
className: "link"
|
|
183
|
-
}, /*#__PURE__*/
|
|
188
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
184
189
|
className: "link-name"
|
|
185
190
|
}, displayResult));
|
|
186
191
|
})));
|
|
@@ -202,7 +207,7 @@ const getFormattedCell = function (column, row) {
|
|
|
202
207
|
case _dtableUtils.CellType.SINGLE_SELECT:
|
|
203
208
|
{
|
|
204
209
|
if (value && typeof value === 'string') {
|
|
205
|
-
displayValue = /*#__PURE__*/
|
|
210
|
+
displayValue = /*#__PURE__*/_react.default.createElement(_SingleSelectOption.default, {
|
|
206
211
|
column: column,
|
|
207
212
|
value: value
|
|
208
213
|
});
|
|
@@ -212,10 +217,10 @@ const getFormattedCell = function (column, row) {
|
|
|
212
217
|
case _dtableUtils.CellType.MULTIPLE_SELECT:
|
|
213
218
|
{
|
|
214
219
|
if (value && isNonEmptyArray) {
|
|
215
|
-
displayValue = /*#__PURE__*/
|
|
220
|
+
displayValue = /*#__PURE__*/_react.default.createElement("span", {
|
|
216
221
|
className: "multiple-select-formatter"
|
|
217
222
|
}, value.map((item, index) => {
|
|
218
|
-
return /*#__PURE__*/
|
|
223
|
+
return /*#__PURE__*/_react.default.createElement(_SingleSelectOption.default, {
|
|
219
224
|
column: column,
|
|
220
225
|
value: item,
|
|
221
226
|
key: `row-operation-multiple-select-${index}`
|
|
@@ -227,7 +232,7 @@ const getFormattedCell = function (column, row) {
|
|
|
227
232
|
case _dtableUtils.CellType.FILE:
|
|
228
233
|
{
|
|
229
234
|
if (value) {
|
|
230
|
-
displayValue = /*#__PURE__*/
|
|
235
|
+
displayValue = /*#__PURE__*/_react.default.createElement("span", {
|
|
231
236
|
className: "row-cell-value-empty"
|
|
232
237
|
});
|
|
233
238
|
}
|
|
@@ -236,7 +241,7 @@ const getFormattedCell = function (column, row) {
|
|
|
236
241
|
case _dtableUtils.CellType.IMAGE:
|
|
237
242
|
{
|
|
238
243
|
if (value) {
|
|
239
|
-
displayValue = /*#__PURE__*/
|
|
244
|
+
displayValue = /*#__PURE__*/_react.default.createElement("span", {
|
|
240
245
|
className: "row-cell-value-empty"
|
|
241
246
|
});
|
|
242
247
|
}
|
|
@@ -245,7 +250,7 @@ const getFormattedCell = function (column, row) {
|
|
|
245
250
|
case _dtableUtils.CellType.DIGITAL_SIGN:
|
|
246
251
|
{
|
|
247
252
|
if (value) {
|
|
248
|
-
displayValue = /*#__PURE__*/
|
|
253
|
+
displayValue = /*#__PURE__*/_react.default.createElement("span", {
|
|
249
254
|
className: "row-cell-value-empty"
|
|
250
255
|
});
|
|
251
256
|
}
|
|
@@ -263,7 +268,7 @@ const getFormattedCell = function (column, row) {
|
|
|
263
268
|
case _dtableUtils.CellType.CHECKBOX:
|
|
264
269
|
{
|
|
265
270
|
if (value) {
|
|
266
|
-
displayValue = /*#__PURE__*/
|
|
271
|
+
displayValue = /*#__PURE__*/_react.default.createElement("span", {
|
|
267
272
|
className: "row-cell-value-empty"
|
|
268
273
|
});
|
|
269
274
|
}
|
|
@@ -272,7 +277,7 @@ const getFormattedCell = function (column, row) {
|
|
|
272
277
|
case _dtableUtils.CellType.GEOLOCATION:
|
|
273
278
|
{
|
|
274
279
|
if (value && typeof value === 'object') {
|
|
275
|
-
displayValue = /*#__PURE__*/
|
|
280
|
+
displayValue = /*#__PURE__*/_react.default.createElement("div", {
|
|
276
281
|
className: "geolocation-formatter"
|
|
277
282
|
}, createColumnFormatter(type, {
|
|
278
283
|
value,
|
|
@@ -341,7 +346,7 @@ const getFormattedCell = function (column, row) {
|
|
|
341
346
|
case _dtableUtils.CellType.RATE:
|
|
342
347
|
{
|
|
343
348
|
if (value) {
|
|
344
|
-
displayValue = /*#__PURE__*/
|
|
349
|
+
displayValue = /*#__PURE__*/_react.default.createElement(_RateFormatter.default, {
|
|
345
350
|
value: value,
|
|
346
351
|
column: column,
|
|
347
352
|
editable: false
|
|
@@ -352,7 +357,7 @@ const getFormattedCell = function (column, row) {
|
|
|
352
357
|
case _dtableUtils.CellType.BUTTON:
|
|
353
358
|
{
|
|
354
359
|
if (value) {
|
|
355
|
-
displayValue = /*#__PURE__*/
|
|
360
|
+
displayValue = /*#__PURE__*/_react.default.createElement("span", {
|
|
356
361
|
className: "row-cell-value-empty"
|
|
357
362
|
});
|
|
358
363
|
}
|
|
@@ -363,7 +368,7 @@ const getFormattedCell = function (column, row) {
|
|
|
363
368
|
break;
|
|
364
369
|
}
|
|
365
370
|
}
|
|
366
|
-
return
|
|
371
|
+
return getCellRecord(displayValue, rowId, column, columnWidth, isShowColumnName);
|
|
367
372
|
};
|
|
368
373
|
exports.getFormattedCell = getFormattedCell;
|
|
369
374
|
const getAllCollaborators = () => {
|
|
@@ -381,39 +386,39 @@ const createColumnFormatter = (columnType, formatterProps) => {
|
|
|
381
386
|
// } else if (isFunction(Formatter)) {
|
|
382
387
|
// return <Formatter {...formatterProps} />;
|
|
383
388
|
// }
|
|
384
|
-
return /*#__PURE__*/
|
|
389
|
+
return /*#__PURE__*/_react.default.createElement(_SimpleCellFormatter.default, formatterProps);
|
|
385
390
|
};
|
|
386
|
-
const
|
|
391
|
+
const getCellRecord = function (displayValue, rowId, column, columnWidth) {
|
|
387
392
|
let isShowColumnName = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
388
393
|
let {
|
|
389
394
|
key,
|
|
390
395
|
name
|
|
391
396
|
} = column;
|
|
392
397
|
if (!isShowColumnName) {
|
|
393
|
-
return /*#__PURE__*/
|
|
398
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
394
399
|
className: "row-cell-value text-truncate",
|
|
395
400
|
key: rowId + '_' + key,
|
|
396
401
|
style: {
|
|
397
402
|
width: columnWidth
|
|
398
403
|
}
|
|
399
|
-
}, displayValue ? displayValue : /*#__PURE__*/
|
|
404
|
+
}, displayValue ? displayValue : /*#__PURE__*/_react.default.createElement("span", {
|
|
400
405
|
className: "row-cell-value-empty"
|
|
401
406
|
}));
|
|
402
407
|
}
|
|
403
|
-
return /*#__PURE__*/
|
|
408
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
404
409
|
className: `row-cell-value text-truncate ${isShowColumnName && 'show-name'}`,
|
|
405
410
|
key: rowId + '_' + key,
|
|
406
411
|
style: {
|
|
407
412
|
width: columnWidth
|
|
408
413
|
}
|
|
409
|
-
}, /*#__PURE__*/
|
|
414
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
410
415
|
className: "column-name text-truncate"
|
|
411
|
-
}, name), /*#__PURE__*/
|
|
416
|
+
}, name), /*#__PURE__*/_react.default.createElement("div", {
|
|
412
417
|
className: "row-cell-value-content",
|
|
413
418
|
style: {
|
|
414
419
|
width: columnWidth
|
|
415
420
|
}
|
|
416
|
-
}, displayValue ? displayValue : /*#__PURE__*/
|
|
421
|
+
}, displayValue ? displayValue : /*#__PURE__*/_react.default.createElement("span", {
|
|
417
422
|
className: "row-cell-value-empty"
|
|
418
423
|
})));
|
|
419
424
|
};
|
|
@@ -428,6 +433,7 @@ const getRowRecord = function (currentTableId, row, columns, unShowColumnKeyList
|
|
|
428
433
|
if (UNSHOW_COLUMN_TYPE.includes(column.type)) return false;
|
|
429
434
|
return true;
|
|
430
435
|
}).map(column => {
|
|
436
|
+
console.log(1, column);
|
|
431
437
|
const searchValue = matchedResult && matchedResult[column.key];
|
|
432
438
|
return getFormattedCell(column, row, {
|
|
433
439
|
tableId: currentTableId,
|
|
@@ -11,6 +11,7 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _ResizeHandle = _interopRequireDefault(require("./resize-handle/ResizeHandle"));
|
|
13
13
|
var _constants = require("../../../../../../constants");
|
|
14
|
+
var _basicSdk = _interopRequireDefault(require("../../../../../../basic-sdk"));
|
|
14
15
|
class RowCardHeaderCell extends _react.default.Component {
|
|
15
16
|
constructor(props) {
|
|
16
17
|
super(props);
|
|
@@ -57,13 +58,11 @@ class RowCardHeaderCell extends _react.default.Component {
|
|
|
57
58
|
} = table;
|
|
58
59
|
const draggedCellId = `${tableId}-${columnKey}`;
|
|
59
60
|
let width = this.getWidthFromMouseEvent(e);
|
|
60
|
-
width = 100;
|
|
61
|
+
// width = 100;
|
|
61
62
|
this.setState({
|
|
62
63
|
resizing: false
|
|
63
64
|
});
|
|
64
|
-
const
|
|
65
|
-
eventBus
|
|
66
|
-
} = window.app;
|
|
65
|
+
const eventBus = _basicSdk.default.getInstance();
|
|
67
66
|
eventBus.dispatch(_constants.EXTERNAL_EVENT.CHANGE_HEADER_WIDTH, {
|
|
68
67
|
id: draggedCellId,
|
|
69
68
|
width
|
|
@@ -13,6 +13,7 @@ var _reactI18next = require("react-i18next");
|
|
|
13
13
|
var _helpers = require("./helpers");
|
|
14
14
|
var _linkContent = _interopRequireDefault(require("./link-content"));
|
|
15
15
|
var _constants = require("../../../../../../constants");
|
|
16
|
+
var _basicSdk = _interopRequireDefault(require("../../../../../../basic-sdk"));
|
|
16
17
|
const EMPTY_LINK = /*#__PURE__*/_react.default.createElement("span", {
|
|
17
18
|
className: "row-cell-value-empty"
|
|
18
19
|
});
|
|
@@ -66,6 +67,7 @@ class RowCardItem extends _react.PureComponent {
|
|
|
66
67
|
} = column;
|
|
67
68
|
const draggedCellId = `${tableId}-${key}`;
|
|
68
69
|
const existedWidth = JSON.parse(localStorage.getItem(draggedCellId));
|
|
70
|
+
console.log(2, existedWidth, width, column);
|
|
69
71
|
let columnWidth = existedWidth && rowCardType === 'link' ? existedWidth : width;
|
|
70
72
|
if (draggedCell.id === draggedCellId) {
|
|
71
73
|
columnWidth = draggedCell.width;
|
|
@@ -140,9 +142,8 @@ class RowCardItem extends _react.PureComponent {
|
|
|
140
142
|
onRef
|
|
141
143
|
} = this.props;
|
|
142
144
|
onRef && onRef(this, rowIdx);
|
|
143
|
-
const {
|
|
144
|
-
|
|
145
|
-
} = window.app;
|
|
145
|
+
// const { eventBus } = window.app;
|
|
146
|
+
const eventBus = _basicSdk.default.getInstance();
|
|
146
147
|
this.unsubscribeChangeHeaderWidth = eventBus.subscribe(_constants.EXTERNAL_EVENT.CHANGE_HEADER_WIDTH, this.setDraggedCell);
|
|
147
148
|
}
|
|
148
149
|
componentWillUnmount() {
|