dtable-ui-component 4.3.0 → 4.3.1-alpha3

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.
@@ -56,7 +56,6 @@
56
56
  padding: 10px 10px 10px 16px;
57
57
  font-size: 13px;
58
58
  background-color: #fff;
59
- color: #202428;
60
59
  }
61
60
 
62
61
  .dtable-ui-mb-collaborator-editor-body .mb-collaborator-option-item {
@@ -92,7 +92,7 @@
92
92
  }
93
93
 
94
94
  .dtable-customize-collaborator-select.dtable-select .option.option-active .select-option-name {
95
- color: #202428;
95
+ color: #212529;
96
96
  }
97
97
 
98
98
  .collaborator-select .option-group-content .collaborator,
@@ -0,0 +1,29 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ export var MenuSelectStyle = {
3
+ option: function option(provided, state) {
4
+ var isDisabled = state.isDisabled,
5
+ isFocused = state.isFocused;
6
+ return _objectSpread(_objectSpread({}, provided), {}, {
7
+ fontSize: '13px',
8
+ color: '#212529',
9
+ cursor: isDisabled ? 'default' : 'pointer',
10
+ backgroundColor: isFocused ? '#f5f5f5' : '#fff',
11
+ '.header-icon .dtable-font': {
12
+ color: '#aaa'
13
+ }
14
+ });
15
+ },
16
+ control: function control(provided) {
17
+ return _objectSpread(_objectSpread({}, provided), {}, {
18
+ fontSize: '14px',
19
+ cursor: 'pointer',
20
+ lineHeight: '1.5'
21
+ });
22
+ },
23
+ menuPortal: function menuPortal(base) {
24
+ return _objectSpread(_objectSpread({}, base), {}, {
25
+ zIndex: 9999
26
+ });
27
+ },
28
+ indicatorSeparator: function indicatorSeparator() {}
29
+ };
@@ -2,76 +2,17 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
5
  import React from 'react';
7
- import Select, { components } from 'react-select';
8
- var MenuSelectStyle = {
9
- option: function option(provided, state) {
10
- var isDisabled = state.isDisabled,
11
- isSelected = state.isSelected,
12
- isFocused = state.isFocused;
13
- return _objectSpread(_objectSpread({}, provided), {}, {
14
- cursor: isDisabled ? 'default' : 'pointer',
15
- backgroundColor: isSelected ? '#20a0ff' : isFocused ? '#f5f5f5' : '#fff',
16
- '.header-icon .dtable-font': {
17
- color: isSelected ? '#fff' : '#aaa'
18
- }
19
- });
20
- },
21
- control: function control(provided) {
22
- return _objectSpread(_objectSpread({}, provided), {}, {
23
- fontSize: '14px',
24
- cursor: 'pointer',
25
- lineHeight: '1.5'
26
- });
27
- },
28
- menuPortal: function menuPortal(base) {
29
- return _objectSpread(_objectSpread({}, base), {}, {
30
- zIndex: 9999
31
- });
32
- },
33
- indicatorSeparator: function indicatorSeparator() {}
34
- };
35
- var DropdownIndicator = function DropdownIndicator(props) {
36
- return components.DropdownIndicator && /*#__PURE__*/React.createElement(components.DropdownIndicator, props, /*#__PURE__*/React.createElement("span", {
37
- className: "dtable-font dtable-icon-drop-down",
38
- style: {
39
- fontSize: '12px'
40
- }
41
- }));
42
- };
43
- var MenuList = function MenuList(props) {
44
- return /*#__PURE__*/React.createElement("div", {
45
- onClick: function onClick(e) {
46
- return e.nativeEvent.stopImmediatePropagation();
47
- },
48
- onMouseDown: function onMouseDown(e) {
49
- return e.nativeEvent.stopImmediatePropagation();
50
- }
51
- }, /*#__PURE__*/React.createElement(components.MenuList, props, props.children));
52
- };
53
- var Option = function Option(props) {
54
- return /*#__PURE__*/React.createElement("div", {
55
- style: props.data.style
56
- }, /*#__PURE__*/React.createElement(components.Option, props));
57
- };
58
- var DtableSelect = /*#__PURE__*/function (_React$Component) {
59
- _inherits(DtableSelect, _React$Component);
60
- var _super = _createSuper(DtableSelect);
61
- function DtableSelect() {
62
- var _this;
63
- _classCallCheck(this, DtableSelect);
64
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
65
- args[_key] = arguments[_key];
66
- }
67
- _this = _super.call.apply(_super, [this].concat(args));
68
- _this.getMenuPortalTarget = function () {
69
- var menuPortalTarget = _this.props.menuPortalTarget;
70
- return document.querySelector(menuPortalTarget);
71
- };
72
- return _this;
6
+ import Select from 'react-select';
7
+ import { MenuSelectStyle, DropdownIndicator, ClearIndicator, MenuList, Option } from './utils';
8
+ var DTableSelect = /*#__PURE__*/function (_React$Component) {
9
+ _inherits(DTableSelect, _React$Component);
10
+ var _super = _createSuper(DTableSelect);
11
+ function DTableSelect() {
12
+ _classCallCheck(this, DTableSelect);
13
+ return _super.apply(this, arguments);
73
14
  }
74
- _createClass(DtableSelect, [{
15
+ _createClass(DTableSelect, [{
75
16
  key: "render",
76
17
  value: function render() {
77
18
  var _this$props = this.props,
@@ -85,7 +26,11 @@ var DtableSelect = /*#__PURE__*/function (_React$Component) {
85
26
  isClearable = _this$props.isClearable,
86
27
  noOptionsMessage = _this$props.noOptionsMessage,
87
28
  classNamePrefix = _this$props.classNamePrefix,
88
- style = _this$props.style;
29
+ style = _this$props.style,
30
+ innerRef = _this$props.innerRef,
31
+ isDisabled = _this$props.isDisabled,
32
+ form = _this$props.form,
33
+ customFilterOption = _this$props.customFilterOption;
89
34
  return /*#__PURE__*/React.createElement(Select, {
90
35
  value: value,
91
36
  onChange: onChange,
@@ -96,7 +41,8 @@ var DtableSelect = /*#__PURE__*/function (_React$Component) {
96
41
  components: {
97
42
  Option: Option,
98
43
  DropdownIndicator: DropdownIndicator,
99
- MenuList: MenuList
44
+ MenuList: MenuList,
45
+ ClearIndicator: ClearIndicator
100
46
  },
101
47
  placeholder: placeholder,
102
48
  isSearchable: isSearchable,
@@ -104,17 +50,23 @@ var DtableSelect = /*#__PURE__*/function (_React$Component) {
104
50
  menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
105
51
  ,
106
52
  menuShouldScrollIntoView: true,
107
- menuPortalTarget: this.getMenuPortalTarget(),
53
+ menuPortalTarget: document.querySelector(this.props.menuPortalTarget),
108
54
  captureMenuScroll: false,
109
- noOptionsMessage: noOptionsMessage
55
+ hideSelectedOptions: false,
56
+ noOptionsMessage: noOptionsMessage,
57
+ isDisabled: isDisabled,
58
+ ref: innerRef,
59
+ filterOption: customFilterOption,
60
+ form: form
110
61
  });
111
62
  }
112
63
  }]);
113
- return DtableSelect;
64
+ return DTableSelect;
114
65
  }(React.Component);
115
- DtableSelect.defaultProps = {
66
+ DTableSelect.defaultProps = {
116
67
  options: [],
117
68
  value: {},
69
+ isDisabled: false,
118
70
  isSearchable: false,
119
71
  isClearable: false,
120
72
  placeholder: '',
@@ -124,4 +76,4 @@ DtableSelect.defaultProps = {
124
76
  return null;
125
77
  }
126
78
  };
127
- export default DtableSelect;
79
+ export { DTableSelect as default };
@@ -0,0 +1,69 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ var _excluded = ["innerProps"];
4
+ import React from 'react';
5
+ import { components } from 'react-select';
6
+ var MenuSelectStyle = {
7
+ option: function option(provided, state) {
8
+ var isDisabled = state.isDisabled,
9
+ isFocused = state.isFocused;
10
+ return _objectSpread(_objectSpread({}, provided), {}, {
11
+ fontSize: '13px',
12
+ color: '#212529',
13
+ cursor: isDisabled ? 'default' : 'pointer',
14
+ backgroundColor: isFocused ? '#f5f5f5' : '#fff',
15
+ '.header-icon .dtable-font': {
16
+ color: '#aaa'
17
+ }
18
+ });
19
+ },
20
+ control: function control(provided) {
21
+ return _objectSpread(_objectSpread({}, provided), {}, {
22
+ fontSize: '14px',
23
+ cursor: 'pointer',
24
+ lineHeight: '1.5'
25
+ });
26
+ },
27
+ menuPortal: function menuPortal(base) {
28
+ return _objectSpread(_objectSpread({}, base), {}, {
29
+ zIndex: 9999
30
+ });
31
+ },
32
+ indicatorSeparator: function indicatorSeparator() {}
33
+ };
34
+ var DropdownIndicator = function DropdownIndicator(props) {
35
+ return components.DropdownIndicator && /*#__PURE__*/React.createElement(components.DropdownIndicator, props, /*#__PURE__*/React.createElement("span", {
36
+ className: "dtable-font dtable-icon-drop-down",
37
+ style: {
38
+ fontSize: '12px'
39
+ }
40
+ }));
41
+ };
42
+ var ClearIndicator = function ClearIndicator(_ref) {
43
+ var innerProps = _ref.innerProps,
44
+ props = _objectWithoutProperties(_ref, _excluded);
45
+ var onMouseDown = function onMouseDown(e) {
46
+ e.nativeEvent.stopImmediatePropagation();
47
+ innerProps.onMouseDown(e);
48
+ };
49
+ props.innerProps = _objectSpread(_objectSpread({}, innerProps), {}, {
50
+ onMouseDown: onMouseDown
51
+ });
52
+ return /*#__PURE__*/React.createElement(components.ClearIndicator, props);
53
+ };
54
+ var MenuList = function MenuList(props) {
55
+ return /*#__PURE__*/React.createElement("div", {
56
+ onClick: function onClick(e) {
57
+ return e.nativeEvent.stopImmediatePropagation();
58
+ },
59
+ onMouseDown: function onMouseDown(e) {
60
+ return e.nativeEvent.stopImmediatePropagation();
61
+ }
62
+ }, /*#__PURE__*/React.createElement(components.MenuList, props, props.children));
63
+ };
64
+ var Option = function Option(props) {
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ style: props.data.style
67
+ }, /*#__PURE__*/React.createElement(components.Option, props));
68
+ };
69
+ export { MenuSelectStyle, DropdownIndicator, ClearIndicator, MenuList, Option };
@@ -55,7 +55,7 @@
55
55
  height: 50px;
56
56
  padding: 10px 10px 10px 16px;
57
57
  font-size: 13px;
58
- color: #202428;
58
+ color: #212529;
59
59
  background-color: #fff;
60
60
  }
61
61
 
@@ -37,7 +37,7 @@
37
37
  }
38
38
 
39
39
  .dtable-select .select-option-name {
40
- color: #202428;
40
+ color: #212529;
41
41
  }
42
42
 
43
43
  .dtable-select .dtable-icon-drop-down {
@@ -33,7 +33,6 @@
33
33
  font-size: 18px;
34
34
  text-align: center;
35
35
  text-overflow: ellipsis;
36
- color: #333;
37
36
  overflow: hidden;
38
37
  white-space: nowrap;
39
38
  }
@@ -534,15 +534,15 @@ var DTABLE_VALUE = {
534
534
  }, {
535
535
  'name': 'Start',
536
536
  'color': '#D7E8FF',
537
- 'text_color': '#202428',
537
+ 'text_color': '#212529',
538
538
  'id': '968592',
539
- 'textColor': '#202428'
539
+ 'textColor': '#212529'
540
540
  }, {
541
541
  'name': 'Finished',
542
542
  'color': '#DDFFE6',
543
- 'text_color': '#202428',
543
+ 'text_color': '#212529',
544
544
  'id': '523201',
545
- 'textColor': '#202428'
545
+ 'textColor': '#212529'
546
546
  }, {
547
547
  'name': 'Node 1',
548
548
  'color': '#FBD44A',
@@ -77,7 +77,7 @@
77
77
  padding: 10px 10px 10px 16px;
78
78
  font-size: 13px;
79
79
  background-color: #fff;
80
- color: #202428;
80
+ color: #212529;
81
81
  }
82
82
 
83
83
  .dtable-ui-mb-select-editor-body .mb-select-options-container .mb-select-option-item + .mb-select-option-item {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.3.0",
3
+ "version": "4.3.1-alpha3",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",