dtable-ui-component 5.0.9-beta.4 → 5.0.11-beta
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/DTableCustomizeCollaboratorSelect/index.js +1 -1
- package/lib/DTableCustomizeSelect/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-item.js +1 -1
- package/lib/DTableRadioGroup/index.css +69 -0
- package/lib/{RadioGroup → DTableRadioGroup}/index.js +14 -3
- package/lib/DepartmentSelectFilter/index.js +0 -1
- package/lib/DigitalSignFormatter/index.js +4 -2
- package/lib/FileFormatter/index.js +12 -5
- package/lib/ImageFormatter/images-lazy-load.js +12 -3
- package/lib/ImageFormatter/index.js +2 -1
- package/lib/NumberEditor/index.js +1 -1
- package/lib/SelectOptionGroup/KeyCodes.js +3 -2
- package/lib/index.js +7 -7
- package/lib/utils/event-bus.js +2 -1
- package/package.json +1 -1
- package/lib/RadioGroup/index.css +0 -48
|
@@ -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;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.radio-group-wrapper {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 2.375rem;
|
|
5
|
+
color: #212529;
|
|
6
|
+
background-color: #fff;
|
|
7
|
+
background-clip: padding-box;
|
|
8
|
+
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
9
|
+
border-radius: 3px;
|
|
10
|
+
padding: 4px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.radio-group-options {
|
|
14
|
+
height: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.radio-group-options .radio-group-button {
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
flex: 1;
|
|
25
|
+
height: 100%;
|
|
26
|
+
padding: 0 8px;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
border-radius: 3px;
|
|
31
|
+
z-index: 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.radio-group-options .radio-group-button:hover {
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.radio-group-options .radio-group-button:not(.active):hover {
|
|
39
|
+
background-color: #f0f0f0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.radio-group-options .radio-group-button.active {
|
|
43
|
+
color:#fff;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.radio-group-options .radio-group-slider {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
position: absolute;
|
|
49
|
+
height: 100%;
|
|
50
|
+
transition: 150ms cubic-bezier(.4, 0, .2, 1);
|
|
51
|
+
border-radius: 3px;
|
|
52
|
+
z-index: 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.radio-group-options .radio-group-button:nth-of-type(1).active ~ .radio-group-slider {
|
|
56
|
+
transform:translateX(0%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.radio-group-options .radio-group-button:nth-of-type(2).active ~ .radio-group-slider {
|
|
60
|
+
transform:translateX(100%);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.radio-group-options .radio-group-button:nth-of-type(3).active ~ .radio-group-slider {
|
|
64
|
+
transform:translateX(200%);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.radio-group-options .radio-group-button:nth-of-type(4).active ~ .radio-group-slider {
|
|
68
|
+
transform:translateX(300%);
|
|
69
|
+
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
require("./index.css");
|
|
10
|
-
class
|
|
10
|
+
class DTableRadioGroup extends _react.default.Component {
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props);
|
|
13
13
|
this.onSelectChanged = event => {
|
|
@@ -24,6 +24,13 @@ class RadioGroup extends _react.default.Component {
|
|
|
24
24
|
activeOption: props.activeOption
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
+
componentDidMount() {
|
|
28
|
+
if (!this.btn) return;
|
|
29
|
+
const {
|
|
30
|
+
width
|
|
31
|
+
} = this.btn.getBoundingClientRect();
|
|
32
|
+
this.slider.style.width = "".concat(width, "px");
|
|
33
|
+
}
|
|
27
34
|
componentDidUpdate(prevProps) {
|
|
28
35
|
if (this.props.activeOption !== prevProps.activeOption) {
|
|
29
36
|
this.setState({
|
|
@@ -48,11 +55,15 @@ class RadioGroup extends _react.default.Component {
|
|
|
48
55
|
const displayOption = optionsDisplay && optionsDisplay[option] || '';
|
|
49
56
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
50
57
|
key: option,
|
|
51
|
-
|
|
58
|
+
ref: ref => this.btn = ref,
|
|
59
|
+
className: "radio-group-button ".concat(isActive ? 'active' : ''),
|
|
52
60
|
"data-option": option,
|
|
53
61
|
onClick: this.onSelectChanged
|
|
54
62
|
}, displayOption);
|
|
63
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
64
|
+
className: "radio-group-slider btn-primary",
|
|
65
|
+
ref: ref => this.slider = ref
|
|
55
66
|
})));
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
|
-
var _default = exports.default =
|
|
69
|
+
var _default = exports.default = DTableRadioGroup;
|
|
@@ -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;
|
|
@@ -60,7 +60,8 @@ class DigitalSignFormatter extends _react.Component {
|
|
|
60
60
|
containerClassName,
|
|
61
61
|
readOnly,
|
|
62
62
|
config,
|
|
63
|
-
isSample
|
|
63
|
+
isSample,
|
|
64
|
+
renderItem
|
|
64
65
|
} = this.props;
|
|
65
66
|
const className = (0, _classnames.default)('dtable-ui cell-formatter-container digital-sign-formatter', containerClassName);
|
|
66
67
|
const signImages = this.getSignImages();
|
|
@@ -74,7 +75,8 @@ class DigitalSignFormatter extends _react.Component {
|
|
|
74
75
|
}, /*#__PURE__*/_react.default.createElement(_imagesLazyLoad.default, {
|
|
75
76
|
images: signImages,
|
|
76
77
|
server: config.server,
|
|
77
|
-
onImageClick: this.onClickSignImage
|
|
78
|
+
onImageClick: this.onClickSignImage,
|
|
79
|
+
renderItem: renderItem
|
|
78
80
|
})), isPreviewSignImage && /*#__PURE__*/_react.default.createElement(_ImagePreviewerLightbox.default, {
|
|
79
81
|
className: "digital-sign-formatter-image-previewer",
|
|
80
82
|
readOnly: readOnly,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
var _FileItemFormatter = _interopRequireDefault(require("../FileItemFormatter"));
|
|
11
12
|
require("./index.css");
|
|
@@ -14,7 +15,8 @@ class FileFormatter extends _react.default.PureComponent {
|
|
|
14
15
|
let {
|
|
15
16
|
isSample,
|
|
16
17
|
value,
|
|
17
|
-
containerClassName
|
|
18
|
+
containerClassName,
|
|
19
|
+
renderItem
|
|
18
20
|
} = this.props;
|
|
19
21
|
if (!Array.isArray(value) || value.length === 0) {
|
|
20
22
|
return null;
|
|
@@ -33,10 +35,15 @@ class FileFormatter extends _react.default.PureComponent {
|
|
|
33
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
36
|
className: className
|
|
35
37
|
}, value.map((item, index) => {
|
|
36
|
-
|
|
37
|
-
file: item
|
|
38
|
-
key: index
|
|
38
|
+
const dom = /*#__PURE__*/_react.default.createElement(_FileItemFormatter.default, {
|
|
39
|
+
file: item
|
|
39
40
|
});
|
|
41
|
+
if (renderItem) return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
42
|
+
key: index
|
|
43
|
+
}, renderItem(dom));
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
45
|
+
key: index
|
|
46
|
+
}, dom);
|
|
40
47
|
}));
|
|
41
48
|
}
|
|
42
49
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _Loading = _interopRequireDefault(require("../Loading"));
|
|
10
11
|
var _utils = require("./utils");
|
|
11
12
|
class ImagesLazyLoad extends _react.default.Component {
|
|
@@ -97,6 +98,9 @@ class ImagesLazyLoad extends _react.default.Component {
|
|
|
97
98
|
loadedImages,
|
|
98
99
|
loadedCount
|
|
99
100
|
} = this.state;
|
|
101
|
+
const {
|
|
102
|
+
renderItem
|
|
103
|
+
} = this.props;
|
|
100
104
|
if (!Array.isArray(images) || images.length === 0) {
|
|
101
105
|
return '';
|
|
102
106
|
}
|
|
@@ -110,14 +114,19 @@ class ImagesLazyLoad extends _react.default.Component {
|
|
|
110
114
|
}, /*#__PURE__*/_react.default.createElement(_Loading.default, null));
|
|
111
115
|
}
|
|
112
116
|
return loadedImages.map((image, index) => {
|
|
113
|
-
|
|
114
|
-
key: index,
|
|
117
|
+
const imgDom = /*#__PURE__*/_react.default.createElement("img", {
|
|
115
118
|
className: "image-item",
|
|
116
119
|
src: image.src,
|
|
117
120
|
onMouseDown: this.onMouseDown,
|
|
118
121
|
onClick: event => this.onImageClick(event, index),
|
|
119
122
|
alt: ""
|
|
120
123
|
});
|
|
124
|
+
if (renderItem) return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
125
|
+
key: index
|
|
126
|
+
}, renderItem(imgDom));
|
|
127
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
128
|
+
key: index
|
|
129
|
+
}, imgDom);
|
|
121
130
|
});
|
|
122
131
|
}
|
|
123
132
|
}
|
|
@@ -95,7 +95,8 @@ class ImageFormatter extends _react.default.Component {
|
|
|
95
95
|
}, /*#__PURE__*/_react.default.createElement(_imagesLazyLoad.default, {
|
|
96
96
|
images: value,
|
|
97
97
|
server: server,
|
|
98
|
-
onImageClick: this.onImageClick
|
|
98
|
+
onImageClick: this.onImageClick,
|
|
99
|
+
renderItem: this.props.renderItem
|
|
99
100
|
})), isPreviewImage && /*#__PURE__*/_react.default.createElement(_ImagePreviewerLightbox.default, {
|
|
100
101
|
imageItems: value,
|
|
101
102
|
imageIndex: previewImageIndex,
|
|
@@ -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
|
-
|
|
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;
|
package/lib/index.js
CHANGED
|
@@ -106,6 +106,12 @@ Object.defineProperty(exports, "DTableRadio", {
|
|
|
106
106
|
return _DTableRadio.default;
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
+
Object.defineProperty(exports, "DTableRadioGroup", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () {
|
|
112
|
+
return _DTableRadioGroup.default;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
109
115
|
Object.defineProperty(exports, "DTableSearchInput", {
|
|
110
116
|
enumerable: true,
|
|
111
117
|
get: function () {
|
|
@@ -286,12 +292,6 @@ Object.defineProperty(exports, "NumberFormatter", {
|
|
|
286
292
|
return _NumberFormatter.default;
|
|
287
293
|
}
|
|
288
294
|
});
|
|
289
|
-
Object.defineProperty(exports, "RadioGroup", {
|
|
290
|
-
enumerable: true,
|
|
291
|
-
get: function () {
|
|
292
|
-
return _RadioGroup.default;
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
295
|
Object.defineProperty(exports, "RateFormatter", {
|
|
296
296
|
enumerable: true,
|
|
297
297
|
get: function () {
|
|
@@ -472,4 +472,4 @@ var _FieldDisplaySetting = _interopRequireDefault(require("./FieldDisplaySetting
|
|
|
472
472
|
var _DTableFiltersPopover = _interopRequireDefault(require("./DTableFiltersPopover"));
|
|
473
473
|
var _ClickOutside = _interopRequireDefault(require("./ClickOutside"));
|
|
474
474
|
var _CollapsibleSettingLayout = _interopRequireDefault(require("./CollapsibleSettingLayout"));
|
|
475
|
-
var
|
|
475
|
+
var _DTableRadioGroup = _interopRequireDefault(require("./DTableRadioGroup"));
|
package/lib/utils/event-bus.js
CHANGED
package/package.json
CHANGED
package/lib/RadioGroup/index.css
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
.radio-group-wrapper {
|
|
2
|
-
display: block;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 2.375rem;
|
|
5
|
-
color: #212529;
|
|
6
|
-
background-color: #fff;
|
|
7
|
-
background-clip: padding-box;
|
|
8
|
-
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
9
|
-
border-radius: 3px;
|
|
10
|
-
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.radio-group-options {
|
|
14
|
-
height: 100%;
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
padding: 4px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.radio-group-options .radio-group-button {
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
flex: 1;
|
|
26
|
-
height: 100%;
|
|
27
|
-
padding: 0 8px;
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
text-overflow: ellipsis;
|
|
30
|
-
white-space: nowrap;
|
|
31
|
-
border-radius: 3px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.radio-group-options .radio-group-button:hover {
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
background-color: #f0f0f0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.radio-group-options .radio-group-button.readOnly {
|
|
40
|
-
cursor: default;
|
|
41
|
-
opacity: 0.6;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.radio-group-options .radio-group-button.btn-primary:hover {
|
|
45
|
-
color: #fff;
|
|
46
|
-
background-color: #ED7109;
|
|
47
|
-
border-color: #ED7109;
|
|
48
|
-
}
|