dtable-ui-component 6.0.110-apv.2 → 6.0.110-gla.9

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.
@@ -118,7 +118,7 @@
118
118
  box-shadow: none !important;
119
119
  }
120
120
 
121
- .seatable-group-select .option-group-content .dtable-icon-check {
121
+ .option-group-content .dtable-icon-check {
122
122
  color: #666666;
123
123
  font-size: 14px;
124
124
  }
@@ -137,6 +137,18 @@
137
137
  background-color:#FFFFFF;
138
138
  }
139
139
 
140
- .option-group-dtable-filter-select-column .option-group-search .clear-search-text {
141
- top: 4px;
140
+ .option-group-dtable-filter-select-column .seatable-icon-btn {
141
+ height: 12px !important;
142
+ width: 12px !important;
143
+ font-size: 12px !important;
144
+ }
145
+
146
+ .option-group-dtable-filter-select-column .clear-search-text {
147
+ position: absolute;
148
+ display: inline-block;
149
+ height: 12px;
150
+ width: 12px;
151
+ line-height: 12px;
152
+ top: 12px;
153
+ right: 18px;
142
154
  }
@@ -83,6 +83,11 @@ class SelectOptionGroup extends _react.Component {
83
83
  });
84
84
  }
85
85
  };
86
+ this.isEqual = (obj1, obj2) => {
87
+ if (obj1 === obj2) return true;
88
+ if (!obj1 || !obj2) return false;
89
+ return JSON.stringify(obj1) === JSON.stringify(obj2);
90
+ };
86
91
  this.onMouseDown = e => {
87
92
  const {
88
93
  isInModal
@@ -134,11 +139,17 @@ class SelectOptionGroup extends _react.Component {
134
139
  });
135
140
  }
136
141
  };
142
+ this.isEqual = (obj1, obj2) => {
143
+ if (obj1 === obj2) return true;
144
+ if (!obj1 || !obj2) return false;
145
+ return JSON.stringify(obj1) === JSON.stringify(obj2);
146
+ };
137
147
  this.renderOptGroup = searchVal => {
138
148
  let {
139
149
  noOptionsPlaceholder,
140
150
  onSelectOption,
141
- value
151
+ value,
152
+ supportMultipleSelect
142
153
  } = this.props;
143
154
  this.filterOptions = this.props.getFilterOptions(searchVal);
144
155
  if (this.filterOptions.length === 0) {
@@ -150,7 +161,7 @@ class SelectOptionGroup extends _react.Component {
150
161
  return this.filterOptions.map((opt, i) => {
151
162
  let key = opt.value.column ? opt.value.column.key : i;
152
163
  let isActive = this.state.activeIndex === i;
153
- let isSelected = value && (typeof value === 'object' && value.value.column.key === opt.value.column.key || typeof value === 'string' && value === opt.value);
164
+ let isSelected = value && typeof value === 'object' && !supportMultipleSelect ? this.isEqual(value.value, opt.value) : Array.isArray(value.value) ? value.value.includes(opt.value.column_key) : false;
154
165
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
155
166
  index: i,
156
167
  isActive: isActive,
@@ -164,10 +175,7 @@ class SelectOptionGroup extends _react.Component {
164
175
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
165
176
  children: [" ", opt.label]
166
177
  }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
167
- className: "dtable-font dtable-icon-check",
168
- style: {
169
- paddingRight: '8px'
170
- }
178
+ className: "dtable-font dtable-icon-check"
171
179
  })]
172
180
  })
173
181
  }, `${key}-${i}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.110-apv.2",
3
+ "version": "6.0.110-gla.9",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.4",