dtable-ui-component 6.0.88 → 6.0.91

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.
@@ -16,6 +16,7 @@ function DepartmentSingleSelectFormatter(props) {
16
16
  containerClassName,
17
17
  tip
18
18
  } = props;
19
+ console.log('DepartmentSingleSelectFormatter', props);
19
20
  if (!value || !Array.isArray(departments)) return null;
20
21
  const deletedTip = tip || (0, _lang.getLocale)('Deleted_department');
21
22
  const department = departments.find(department => department.id === value);
@@ -91,7 +91,8 @@ class RowExpandFormulaFormatter extends _react.default.Component {
91
91
  const {
92
92
  value,
93
93
  column,
94
- collaborators
94
+ collaborators,
95
+ departments
95
96
  } = this.props;
96
97
  const {
97
98
  array_type,
@@ -101,13 +102,7 @@ class RowExpandFormulaFormatter extends _react.default.Component {
101
102
  return null;
102
103
  }
103
104
  const Formatter = _baseFormatterConfig.default[array_type];
104
- // let formatterProps = this.getFormatterProps(array_type, array_data, collaborators);
105
- let formatterProps = {
106
- column: {
107
- data: array_data
108
- },
109
- readOnly: true
110
- };
105
+ let formatterProps = this.getFormatterProps(array_type, array_data, collaborators, departments);
111
106
  if ((0, _utils.isArrayFormatColumn)(array_type)) {
112
107
  formatterProps.value = value;
113
108
  return this.renderBorder(this.createColumnFormatter(Formatter, formatterProps));
@@ -127,8 +122,6 @@ class RowExpandFormulaFormatter extends _react.default.Component {
127
122
  formulaEmail = cellValue[0];
128
123
  formulaEmail = formulaEmail ? formulaEmail.trim() : '';
129
124
  }
130
- console.log('Formatter', Formatter);
131
- console.log('formatterProps', formatterProps);
132
125
  return this.renderBorder( /*#__PURE__*/_react.default.createElement("div", {
133
126
  className: "dtable-ui formula-formatter multiple"
134
127
  }, cellValue.map((v, index) => {
@@ -151,7 +144,7 @@ class RowExpandFormulaFormatter extends _react.default.Component {
151
144
  }), this.createColumnFormatter(Formatter, formatterProps));
152
145
  })));
153
146
  };
154
- this.getFormatterProps = (array_type, array_data, collaborators) => {
147
+ this.getFormatterProps = (array_type, array_data, collaborators, departments) => {
155
148
  switch (array_type) {
156
149
  case _dtableUtils.CellType.DURATION:
157
150
  {
@@ -164,6 +157,16 @@ class RowExpandFormulaFormatter extends _react.default.Component {
164
157
  }
165
158
  case _dtableUtils.CellType.NUMBER:
166
159
  case _dtableUtils.CellType.RATE:
160
+ case _dtableUtils.CellType.DEPARTMENT_SINGLE_SELECT:
161
+ {
162
+ return {
163
+ column: {
164
+ data: array_data
165
+ },
166
+ readOnly: true,
167
+ departments
168
+ };
169
+ }
167
170
  case _dtableUtils.CellType.GEOLOCATION:
168
171
  {
169
172
  return {
@@ -235,7 +235,8 @@ class RowExpandFormatter extends _react.default.Component {
235
235
  value: cellValue,
236
236
  column: column,
237
237
  collaborators: collaborators,
238
- containerClassName: containerClassName
238
+ containerClassName: containerClassName,
239
+ departments: this.props.departments
239
240
  });
240
241
  }
241
242
  case _dtableUtils.CellType.LINK:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.88",
3
+ "version": "6.0.91",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "4.0.2",