dtable-statistic 4.0.10 → 4.0.11

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.
@@ -86,7 +86,7 @@ var NewTableDialog = /*#__PURE__*/function (_React$Component) {
86
86
  autoFocus: false
87
87
  }, /*#__PURE__*/React.createElement(ModalHeader, {
88
88
  toggle: this.toggle
89
- }, intl.get('New_Table')), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, {
89
+ }, intl.get('New_table')), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, {
90
90
  for: "tableName"
91
91
  }, intl.get('Name')), /*#__PURE__*/React.createElement(Input, {
92
92
  id: "tableName",
@@ -138,8 +138,8 @@ var de = {
138
138
  'Oct': 'Okt',
139
139
  'Nov': 'Nov',
140
140
  'Dec': 'Dez',
141
- 'Enter_date': 'Enter date',
142
- 'Please_select': 'Please select',
141
+ 'Enter_date': 'Datum eingeben',
142
+ 'Please_select': 'Bitte auswählen',
143
143
  'Total': 'Gesamt',
144
144
  'Amount': 'Menge',
145
145
  'Empty': 'Leer',
@@ -237,7 +237,9 @@ var de = {
237
237
  'Add_new_stack': 'Neuen Stapel hinzufügen',
238
238
  'Chart_type': 'Diagrammtyp',
239
239
  'Edit_type': 'Typ ändern',
240
- 'Update_to_a_table': 'Update to a table',
240
+ 'New_table': 'New table',
241
+ 'Select_table': 'Tabelle auswählen',
242
+ 'Update_to_a_table': 'Aktualisierung in eine Tabelle',
241
243
  'Export_to_a_new_table': 'In neue Tabelle exportieren'
242
244
  };
243
245
  export default de;
@@ -237,6 +237,8 @@ var en = {
237
237
  'Add_new_stack': 'Add new stack',
238
238
  'Chart_type': 'Chart type',
239
239
  'Edit_type': 'Edit type',
240
+ 'New_table': 'New table',
241
+ 'Select_table': 'Select table',
240
242
  'Update_to_a_table': 'Update to a table',
241
243
  'Export_to_a_new_table': 'Export to a new table'
242
244
  };
@@ -138,8 +138,8 @@ var fr = {
138
138
  'Oct': 'octobre',
139
139
  'Nov': 'novembre',
140
140
  'Dec': 'décembre',
141
- 'Enter_date': 'Enter date',
142
- 'Please_select': 'Please select',
141
+ 'Enter_date': 'Entrer une date',
142
+ 'Please_select': 'Veuillez sélectionner',
143
143
  'Total': 'Total',
144
144
  'Amount': 'Nombre',
145
145
  'Empty': 'Vide',
@@ -237,7 +237,9 @@ var fr = {
237
237
  'Add_new_stack': 'Ajouter une nouvelle pile',
238
238
  'Chart_type': 'Type de diagramme',
239
239
  'Edit_type': 'Modifier le type',
240
- 'Update_to_a_table': 'Update to a table',
240
+ 'New_table': 'New table',
241
+ 'Select_table': 'Sélectionner un tableau',
242
+ 'Update_to_a_table': 'Mettre à jour vers un tableau',
241
243
  'Export_to_a_new_table': 'Exporter dans un nouveau tableau'
242
244
  };
243
245
  export default fr;
@@ -50,7 +50,7 @@ var zh_CN = {
50
50
  'Style_settings': '样式设置',
51
51
  'Untitled': '未命名',
52
52
  'Settings': '设置',
53
- 'Table': '表格',
53
+ 'Table': '子表',
54
54
  'Views': '视图',
55
55
  'Display_title': '显示标题',
56
56
  'X-axis': 'X 轴',
@@ -237,6 +237,8 @@ var zh_CN = {
237
237
  'Add_new_stack': '添加新的堆叠',
238
238
  'Chart_type': '图表类型',
239
239
  'Edit_type': '编辑类型',
240
+ 'New_table': '新建表',
241
+ 'Select_table': '选择子表',
240
242
  'Update_to_a_table': '更新到子表',
241
243
  'Export_to_a_new_table': '导出到新的子表'
242
244
  };
@@ -101,8 +101,7 @@ var StatList = /*#__PURE__*/function (_Component) {
101
101
  return;
102
102
  }
103
103
  var _exportStatisticToTab = exportStatisticToTable({
104
- statisticalResult: _this.statisticalResult4Export,
105
- t: intl
104
+ statisticalResult: _this.statisticalResult4Export
106
105
  }),
107
106
  columns = _exportStatisticToTab.columns,
108
107
  rows = _exportStatisticToTab.rows;
@@ -142,8 +141,7 @@ var StatList = /*#__PURE__*/function (_Component) {
142
141
  }
143
142
  var _updateStatisticToTab = updateStatisticToTable({
144
143
  updateTable: updateTable,
145
- statisticalResult: _this.statisticalResult4Update,
146
- t: intl
144
+ statisticalResult: _this.statisticalResult4Update
147
145
  }),
148
146
  newRows = _updateStatisticToTab.newRows,
149
147
  updatedRows = _updateStatisticToTab.updatedRows,
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import dayjs from 'dayjs';
3
+ import intl from 'react-intl-universal';
3
4
  import { getOption, getCollaborator, getNumberDisplayString, isNumber, CellType, FORMULA_RESULT_TYPE, FORMULA_COLUMN_TYPES, isDateColumn, TableUtils } from 'dtable-store';
4
5
  import { isCellValueChanged } from './cell-value';
5
6
  import { getSelectColumnOptions, getDateColumnFormat } from './column';
@@ -111,13 +112,13 @@ var getUpdatedOneDimensionStatisticTableResultToTable = function getUpdatedOneDi
111
112
 
112
113
  // one dimension table no summary columns
113
114
  if (pivot_columns.length < 2) {
114
- columnMap['total'] = TableUtils.getTableColumnByName(updateTable, t('Total'));
115
+ columnMap['total'] = TableUtils.getTableColumnByName(updateTable, intl.get('Total'));
115
116
 
116
117
  // updated rows
117
118
  pivot_rows.forEach(function (item) {
118
119
  var name = item.name,
119
120
  total = item.total;
120
- var groupName = name === null ? t(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
121
+ var groupName = name === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
121
122
  var row = tableRows.find(function (row) {
122
123
  return row[nameColumn.key] === groupName;
123
124
  });
@@ -171,7 +172,7 @@ var getUpdatedOneDimensionStatisticTableResultToTable = function getUpdatedOneDi
171
172
  pivot_rows.forEach(function (item) {
172
173
  var name = item.name,
173
174
  total = item.total;
174
- var groupName = name === null ? t(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
175
+ var groupName = name === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
175
176
  var row = tableRows.find(function (row) {
176
177
  return row[nameColumnKey] === name;
177
178
  });
@@ -234,10 +235,10 @@ var getUpdatedTwoDimensionStatisticTableResultToTable = function getUpdatedTwoDi
234
235
  // updated columns
235
236
  Array.isArray(pivot_columns) && pivot_columns.forEach(function (item) {
236
237
  var key = item.key;
237
- var columnName = key === null ? t(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
238
+ var columnName = key === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
238
239
  columnMap[columnName] = TableUtils.getTableColumnByName(updateTable, columnName);
239
240
  });
240
- columnMap['total'] = TableUtils.getTableColumnByName(updateTable, t('Total'));
241
+ columnMap['total'] = TableUtils.getTableColumnByName(updateTable, intl.get('Total'));
241
242
 
242
243
  // updated rows
243
244
  var _loop = function _loop(i) {
@@ -245,7 +246,7 @@ var getUpdatedTwoDimensionStatisticTableResultToTable = function getUpdatedTwoDi
245
246
  var name = pivotRow.name,
246
247
  cells = pivotRow.cells,
247
248
  total = pivotRow.total;
248
- name = name === null ? t(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
249
+ name = name === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
249
250
  var nameColumnKey = nameColumn.key;
250
251
  var row = tableRows.find(function (row) {
251
252
  return row[nameColumnKey] === name;
@@ -261,7 +262,7 @@ var getUpdatedTwoDimensionStatisticTableResultToTable = function getUpdatedTwoDi
261
262
  oldRow = row[totalColumn.key];
262
263
  }
263
264
  Object.keys(cells).forEach(function (key) {
264
- var columnName = key === null ? t(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
265
+ var columnName = key === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
265
266
  var column = columnMap[columnName];
266
267
  var validCellValue = getValidValueForColumn(column, cells[key].total);
267
268
  if (column && isCellValueChanged(row[column.key], validCellValue, column.type)) {
@@ -283,7 +284,7 @@ var getUpdatedTwoDimensionStatisticTableResultToTable = function getUpdatedTwoDi
283
284
  newRow[totalColumn.key] = getValidValueForColumn(totalColumn, name);
284
285
  }
285
286
  Object.keys(cells).forEach(function (key) {
286
- var columnName = key === null ? t(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
287
+ var columnName = key === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
287
288
  var column = columnMap[columnName];
288
289
  if (column) {
289
290
  newRow[column.key] = getValidValueForColumn(column, cells[key].total);
@@ -407,7 +408,7 @@ export var getOneDimensionStatisticTableResultToTable = function getOneDimension
407
408
  // total column
408
409
  var totalColumn = {
409
410
  type: _isDateSummaryColumn ? CellType.DATE : CellType.NUMBER,
410
- name: t('Total'),
411
+ name: intl.get('Total'),
411
412
  data: columnData
412
413
  };
413
414
  columns.push(totalColumn);
@@ -417,12 +418,12 @@ export var getOneDimensionStatisticTableResultToTable = function getOneDimension
417
418
  var _newRow2;
418
419
  var name = item.name,
419
420
  total = item.total;
420
- var groupName = name === null ? t(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
421
+ var groupName = name === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
421
422
  var cellValue = total.total;
422
423
  if (_isDateSummaryColumn && cellValue) {
423
424
  cellValue = isIncludeHour ? dayjs(cellValue).format('YYYY-MM-DD HH:mm') : dayjs(cellValue).format('YYYY-MM-DD');
424
425
  }
425
- var newRow = (_newRow2 = {}, _defineProperty(_newRow2, groupbyColumn.name, groupName), _defineProperty(_newRow2, t('Total'), cellValue), _newRow2);
426
+ var newRow = (_newRow2 = {}, _defineProperty(_newRow2, groupbyColumn.name, groupName), _defineProperty(_newRow2, intl.get('Total'), cellValue), _newRow2);
426
427
  rows.push(newRow);
427
428
  });
428
429
  return {
@@ -482,7 +483,7 @@ export var getOneDimensionStatisticTableResultToTable = function getOneDimension
482
483
  pivot_rows.forEach(function (item) {
483
484
  var name = item.name,
484
485
  total = item.total;
485
- var groupName = name === null ? t(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
486
+ var groupName = name === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
486
487
  var newRow = _defineProperty({}, groupbyColumn.name, groupName);
487
488
  Array.isArray(pivot_columns) && pivot_columns.forEach(function (item) {
488
489
  var key = item.key;
@@ -561,7 +562,7 @@ export var getTwoDimensionStatisticTableResultToTable = function getTwoDimension
561
562
  }
562
563
  Array.isArray(pivot_columns) && pivot_columns.forEach(function (item) {
563
564
  var key = item.key;
564
- var columnName = key === null ? t(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
565
+ var columnName = key === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(key, columnGroupbyColumn);
565
566
  var newColumn = {
566
567
  type: _isDateSummaryColumn ? CellType.DATE : CellType.NUMBER,
567
568
  name: columnName,
@@ -574,7 +575,7 @@ export var getTwoDimensionStatisticTableResultToTable = function getTwoDimension
574
575
  // total column
575
576
  var totalColumn = {
576
577
  type: _isDateSummaryColumn ? CellType.DATE : CellType.NUMBER,
577
- name: t('Total'),
578
+ name: intl.get('Total'),
578
579
  data: columnData
579
580
  };
580
581
  columns.push(totalColumn);
@@ -585,13 +586,13 @@ export var getTwoDimensionStatisticTableResultToTable = function getTwoDimension
585
586
  var name = item.name,
586
587
  cells = item.cells,
587
588
  total = item.total;
588
- name = name === null ? t(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
589
+ name = name === null ? intl.get(EMPTY_NAME) : getTableValueDisplayName(name, groupbyColumn);
589
590
  var newRow = _defineProperty({}, groupbyColumn.name, name);
590
591
  var cellValue = total;
591
592
  if (_isDateSummaryColumn && cellValue) {
592
593
  cellValue = dayjs(cellValue).format(dateFormat);
593
594
  }
594
- newRow[t('Total')] = cellValue;
595
+ newRow[intl.get('Total')] = cellValue;
595
596
  Object.keys(cells).forEach(function (key) {
596
597
  var cellValue = cells[key].total;
597
598
  if (_isDateSummaryColumn) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "4.0.10",
3
+ "version": "4.0.11",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",
@@ -13,7 +13,7 @@
13
13
  "comlink": "^4.3.1",
14
14
  "dayjs": "1.10.7",
15
15
  "dtable-store": "4.0.6",
16
- "dtable-web-api": "4.0.1",
16
+ "dtable-web-api": "4.0.4",
17
17
  "glamor": "^2.20.40",
18
18
  "html2canvas": "^1.4.1",
19
19
  "rc-slider": "^9.7.4",