dtable-ui-component 0.1.79 → 0.1.80
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.
- package/lib/RateFormatter/index.js +4 -2
- package/lib/index.js +2 -3
- package/package.json +1 -2
- package/lib/DtableSelect/index.js +0 -140
|
@@ -31,7 +31,9 @@ var RateFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
31
31
|
_ref$rate_max_number = _ref.rate_max_number,
|
|
32
32
|
rate_max_number = _ref$rate_max_number === void 0 ? 5 : _ref$rate_max_number,
|
|
33
33
|
_ref$rate_style_color = _ref.rate_style_color,
|
|
34
|
-
rate_style_color = _ref$rate_style_color === void 0 ? '#e5e5e5' : _ref$rate_style_color
|
|
34
|
+
rate_style_color = _ref$rate_style_color === void 0 ? '#e5e5e5' : _ref$rate_style_color,
|
|
35
|
+
_ref$rate_style_type = _ref.rate_style_type,
|
|
36
|
+
rate_style_type = _ref$rate_style_type === void 0 ? 'dtable-icon-rate' : _ref$rate_style_type;
|
|
35
37
|
|
|
36
38
|
var validValue = Math.min(rate_max_number, value);
|
|
37
39
|
var rateList = [];
|
|
@@ -39,7 +41,7 @@ var RateFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
39
41
|
for (var i = 0; i < validValue; i++) {
|
|
40
42
|
rateList.push( /*#__PURE__*/React.createElement("i", {
|
|
41
43
|
key: "dtable-ui-component-rate-".concat(i),
|
|
42
|
-
className: "dtable-font
|
|
44
|
+
className: "dtable-font ".concat(rate_style_type),
|
|
43
45
|
style: {
|
|
44
46
|
color: rate_style_color || '#e5e5e5'
|
|
45
47
|
}
|
package/lib/index.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
export { default as toaster } from './toaster'; // Loading
|
|
3
3
|
|
|
4
4
|
export { default as Loading } from './Loading';
|
|
5
|
-
export { setLocale } from './lang'; //
|
|
6
|
-
|
|
7
|
-
export { default as DtableSelect } from './DtableSelect'; // utils
|
|
5
|
+
export { setLocale } from './lang'; // utils
|
|
8
6
|
|
|
9
7
|
export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, formatNumberString } from './utils/value-format-utils'; // formatter
|
|
10
8
|
|
|
@@ -14,6 +12,7 @@ export { default as LongTextFormatter } from './LongTextFormatter';
|
|
|
14
12
|
export { default as TextFormatter } from './TextFormatter';
|
|
15
13
|
export { default as SingleSelectFormatter } from './SingleSelectFormatter';
|
|
16
14
|
export { default as MultipleSelectFormatter } from './MultipleSelectFormatter';
|
|
15
|
+
export { default as SelectItem } from './SelectItem';
|
|
17
16
|
export { default as FileFormatter } from './FileFormatter';
|
|
18
17
|
export { default as LinkFormatter } from './LinkFormatter';
|
|
19
18
|
export { default as CollaboratorFormatter } from './CollaboratorFormatter';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.80",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@seafile/react-image-lightbox": "0.0.9",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"react-app-polyfill": "^1.0.6",
|
|
21
21
|
"react-dom": "16.14.0",
|
|
22
22
|
"react-responsive": "^8.0.3",
|
|
23
|
-
"react-select": "^3.1.0",
|
|
24
23
|
"react-transition-group": "^4.4.1",
|
|
25
24
|
"reactstrap": "^8.4.1",
|
|
26
25
|
"rehype-format": "^2.2.0",
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
-
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 ? '#5A98F8' : 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
|
-
|
|
36
|
-
var DropdownIndicator = function DropdownIndicator(props) {
|
|
37
|
-
return components.DropdownIndicator && /*#__PURE__*/React.createElement(components.DropdownIndicator, props, /*#__PURE__*/React.createElement("span", {
|
|
38
|
-
className: "dtable-font dtable-icon-drop-down",
|
|
39
|
-
style: {
|
|
40
|
-
fontSize: '12px'
|
|
41
|
-
}
|
|
42
|
-
}));
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var MenuList = function MenuList(props) {
|
|
46
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
onClick: function onClick(e) {
|
|
48
|
-
return e.nativeEvent.stopImmediatePropagation();
|
|
49
|
-
},
|
|
50
|
-
onMouseDown: function onMouseDown(e) {
|
|
51
|
-
return e.nativeEvent.stopImmediatePropagation();
|
|
52
|
-
}
|
|
53
|
-
}, /*#__PURE__*/React.createElement(components.MenuList, props, props.children));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var Option = function Option(props) {
|
|
57
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
style: props.data.style
|
|
59
|
-
}, /*#__PURE__*/React.createElement(components.Option, props));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
var DTableSelect = /*#__PURE__*/function (_React$Component) {
|
|
63
|
-
_inherits(DTableSelect, _React$Component);
|
|
64
|
-
|
|
65
|
-
var _super = _createSuper(DTableSelect);
|
|
66
|
-
|
|
67
|
-
function DTableSelect() {
|
|
68
|
-
var _this;
|
|
69
|
-
|
|
70
|
-
_classCallCheck(this, DTableSelect);
|
|
71
|
-
|
|
72
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
|
-
args[_key] = arguments[_key];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
77
|
-
|
|
78
|
-
_this.getMenuPortalTarget = function () {
|
|
79
|
-
var menuPortalTarget = _this.props.menuPortalTarget;
|
|
80
|
-
return document.querySelector(menuPortalTarget);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
return _this;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
_createClass(DTableSelect, [{
|
|
87
|
-
key: "render",
|
|
88
|
-
value: function render() {
|
|
89
|
-
var _this$props = this.props,
|
|
90
|
-
options = _this$props.options,
|
|
91
|
-
onChange = _this$props.onChange,
|
|
92
|
-
value = _this$props.value,
|
|
93
|
-
isSearchable = _this$props.isSearchable,
|
|
94
|
-
placeholder = _this$props.placeholder,
|
|
95
|
-
isMulti = _this$props.isMulti,
|
|
96
|
-
menuPosition = _this$props.menuPosition,
|
|
97
|
-
isClearable = _this$props.isClearable,
|
|
98
|
-
noOptionsMessage = _this$props.noOptionsMessage,
|
|
99
|
-
classNamePrefix = _this$props.classNamePrefix;
|
|
100
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
101
|
-
value: value,
|
|
102
|
-
onChange: onChange,
|
|
103
|
-
options: options,
|
|
104
|
-
isMulti: isMulti,
|
|
105
|
-
classNamePrefix: classNamePrefix,
|
|
106
|
-
styles: MenuSelectStyle,
|
|
107
|
-
components: {
|
|
108
|
-
Option: Option,
|
|
109
|
-
DropdownIndicator: DropdownIndicator,
|
|
110
|
-
MenuList: MenuList
|
|
111
|
-
},
|
|
112
|
-
placeholder: placeholder,
|
|
113
|
-
isSearchable: isSearchable,
|
|
114
|
-
isClearable: isClearable,
|
|
115
|
-
menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
|
|
116
|
-
,
|
|
117
|
-
menuShouldScrollIntoView: true,
|
|
118
|
-
menuPortalTarget: this.getMenuPortalTarget(),
|
|
119
|
-
captureMenuScroll: false,
|
|
120
|
-
noOptionsMessage: noOptionsMessage
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}]);
|
|
124
|
-
|
|
125
|
-
return DTableSelect;
|
|
126
|
-
}(React.Component);
|
|
127
|
-
|
|
128
|
-
DTableSelect.defaultProps = {
|
|
129
|
-
options: [],
|
|
130
|
-
value: {},
|
|
131
|
-
isSearchable: false,
|
|
132
|
-
isClearable: false,
|
|
133
|
-
placeholder: '',
|
|
134
|
-
isMulti: false,
|
|
135
|
-
menuPortalTarget: '.modal',
|
|
136
|
-
noOptionsMessage: function noOptionsMessage() {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
export default DTableSelect;
|