dtable-ui-component 5.0.12 → 5.0.14

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.
@@ -24,7 +24,7 @@ class CollaboratorSelect extends _react.Component {
24
24
  if (this.state.isShowSelectOptions) event.nativeEvent.stopImmediatePropagation();
25
25
  let eventClassName = event.target.className;
26
26
  if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return;
27
- //Prevent closing by pressing the spacebar in the search input
27
+ // Prevent closing by pressing the spacebar in the search input
28
28
  if (event.target.value === '') return;
29
29
  this.selectedOptionWidth = this.selectedOptionRef.clientWidth;
30
30
  this.setState({
@@ -23,7 +23,7 @@ class DTableCustomizeSelect extends _react.Component {
23
23
  if (this.state.isShowSelectOptions) event.stopPropagation();
24
24
  let eventClassName = event.target.className;
25
25
  if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return;
26
- //Prevent closing by pressing the spacebar in the search input
26
+ // Prevent closing by pressing the spacebar in the search input
27
27
  if (event.target.value === '') return;
28
28
  this.setState({
29
29
  isShowSelectOptions: !this.state.isShowSelectOptions
@@ -81,7 +81,7 @@ class FilterCalendar extends _react.Component {
81
81
  value: null
82
82
  };
83
83
  const DataFormat = (0, _utils.getDateColumnFormat)(props.filterColumn).trim();
84
- //Minutes and seconds are not supported at present
84
+ // Minutes and seconds are not supported at present
85
85
  this.columnDataFormat = DataFormat.split(' ')[0];
86
86
  this.calendarContainerRef = /*#__PURE__*/_react.default.createRef();
87
87
  this.defaultCalendarValue = null;
@@ -274,7 +274,7 @@ class FilterItem extends _react.default.Component {
274
274
  filter_predicate
275
275
  } = filter;
276
276
  let isSupportMultipleSelect = false;
277
- //The first two options are used for single selection, and the last four options are used for multiple selection
277
+ // The first two options are used for single selection, and the last four options are used for multiple selection
278
278
  const supportMultipleSelectOptions = [_dtableUtils.FILTER_PREDICATE_TYPE.IS_ANY_OF, _dtableUtils.FILTER_PREDICATE_TYPE.IS_NONE_OF, _dtableUtils.FILTER_PREDICATE_TYPE.HAS_ANY_OF, _dtableUtils.FILTER_PREDICATE_TYPE.HAS_ALL_OF, _dtableUtils.FILTER_PREDICATE_TYPE.HAS_NONE_OF, _dtableUtils.FILTER_PREDICATE_TYPE.IS_EXACTLY];
279
279
  if (supportMultipleSelectOptions.includes(filter_predicate)) {
280
280
  isSupportMultipleSelect = true;
@@ -44,11 +44,11 @@ class DTableRadioGroup extends _react.default.Component {
44
44
  this.setTransitionTimer = null;
45
45
  }
46
46
  componentDidMount() {
47
- if (!this.btn || !this.slider) return;
48
47
  const {
49
- width
50
- } = this.btn.getBoundingClientRect();
51
- this.slider.style.width = "".concat(width, "px");
48
+ options
49
+ } = this.props;
50
+ if (!this.btn || !this.slider || !Array.isArray(options)) return;
51
+ this.slider.style.width = "".concat(100 / options.length, "%");
52
52
  this.setSliderTransition();
53
53
  }
54
54
  componentDidUpdate(prevProps) {
@@ -26,5 +26,4 @@ function DepartmentSelectFilter(props) {
26
26
  };
27
27
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isMultiple ? /*#__PURE__*/_react.default.createElement(_departmentMultipleSelectFilter.default, filterProps) : /*#__PURE__*/_react.default.createElement(_departmentSingleSelectFilter.default, filterProps));
28
28
  }
29
- ;
30
29
  var _default = exports.default = DepartmentSelectFilter;
@@ -49,7 +49,7 @@ class NumberEditor extends _react.default.Component {
49
49
  currency_symbol = data['currency_symbol'];
50
50
  }
51
51
 
52
- //Prevent the repetition of periods bug in the Chinese input method of the Windows system
52
+ // Prevent the repetition of periods bug in the Chinese input method of the Windows system
53
53
  if (!(0, _utils.isMac)() && value.indexOf('.。') > -1) return;
54
54
  value = (0, _dtableUtils.replaceNumberNotAllowInput)(value, this.dataFormat, currency_symbol);
55
55
  if (value === this.state.inputValue) return;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = exports.default = {
7
+ const KeyCodes = {
8
8
  LeftArrow: 37,
9
9
  UpArrow: 38,
10
10
  RightArrow: 39,
@@ -13,4 +13,5 @@ var _default = exports.default = {
13
13
  Tab: 9,
14
14
  Escape: 27,
15
15
  Esc: 27
16
- };
16
+ };
17
+ var _default = exports.default = KeyCodes;
@@ -31,4 +31,5 @@ class EventBus {
31
31
  }
32
32
  }
33
33
  }
34
- var _default = exports.default = new EventBus();
34
+ const eventBus = new EventBus();
35
+ var _default = exports.default = eventBus;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "5.0.12",
3
+ "version": "5.0.14",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",
7
7
  "@seafile/seafile-calendar": "0.0.24",
8
- "@seafile/seafile-editor": "~1.0.77",
8
+ "@seafile/seafile-editor": "~1.0.96",
9
9
  "antd-mobile": "2.3.1",
10
10
  "classnames": "2.3.2",
11
11
  "dayjs": "1.10.7",