@titaui/pc 1.7.21 → 1.7.22
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/components/cascader/index.css +38 -11
- package/lib/components/cascader/index.js +10 -5
- package/lib/components/cascader/time.js +31 -0
- package/lib/components/form/form-fields/group/index.js +2 -1
- package/lib/components/scrollbar/index.js +13 -3
- package/lib/components/select-tags/index.css +22 -18
- package/lib/components/select-tags/index.js +1 -1
- package/package.json +1 -1
- package/src/components/cascader/index.scss +50 -27
- package/src/components/cascader/index.tsx +18 -16
- package/src/components/cascader/time.js +13 -0
- package/src/components/form/form-fields/group/index.tsx +3 -3
- package/src/components/scrollbar/index.tsx +2 -1
- package/src/components/select-tags/index.scss +2 -1
- package/src/components/select-tags/index.tsx +1 -1
|
@@ -16,39 +16,66 @@
|
|
|
16
16
|
color: #3F4755;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.titaui-cascader
|
|
20
|
-
font-size: 16px;
|
|
21
|
-
transform: scale(0.5);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.rc-cascader-dropdown {
|
|
19
|
+
.titaui-cascader-popup {
|
|
25
20
|
z-index: 2000;
|
|
26
21
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
27
22
|
border: 1px solid #F0F2F5;
|
|
23
|
+
border-radius: 12px;
|
|
24
|
+
overflow: hidden;
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
.rc-cascader-menu {
|
|
27
|
+
.titaui-cascader-popup .rc-cascader-menu {
|
|
31
28
|
width: 139px;
|
|
32
29
|
box-sizing: border-box;
|
|
33
30
|
border: 1px solid #F0F2F5;
|
|
34
|
-
padding: 16px 6px;
|
|
31
|
+
padding: 16px 0 16px 6px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.titaui-cascader-popup .rc-cascader-menu::-webkit-scrollbar {
|
|
35
|
+
width: 6px !important;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
.rc-cascader-menu-item-active {
|
|
38
|
+
.titaui-cascader-popup .rc-cascader-menu-item-active {
|
|
38
39
|
background: unset;
|
|
39
40
|
color: #2879ff;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
.rc-cascader-menu-item {
|
|
43
|
+
.titaui-cascader-popup .rc-cascader-menu-item {
|
|
43
44
|
box-sizing: border-box;
|
|
44
45
|
cursor: pointer;
|
|
45
46
|
padding: 0 6px;
|
|
46
47
|
height: 36px;
|
|
47
48
|
align-items: center;
|
|
49
|
+
color: #3F4755;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
.rc-cascader-menu-item:hover {
|
|
52
|
+
.titaui-cascader-popup .rc-cascader-menu-item:hover {
|
|
51
53
|
color: #2879ff;
|
|
52
54
|
background: #F7F8FA;
|
|
53
55
|
border-radius: 8px;
|
|
54
56
|
}
|
|
57
|
+
|
|
58
|
+
.titaui-cascader-popup .rc-cascader-menu-item-disabled {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
cursor: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.titaui-cascader-popup .rc-cascader-menu-item-disabled:hover {
|
|
64
|
+
color: #3F4755;
|
|
65
|
+
background: #FFFFFF;
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.titaui-cascader-popup .rc-cascader-menu-item-expand-icon {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.titaui-cascader .tu-icon-caret-down {
|
|
74
|
+
font-size: 16px;
|
|
75
|
+
transform: scale(0.5);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.titaui-cascader-time-popup .rc-cascader-menu {
|
|
79
|
+
width: 80px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
}
|
|
@@ -11,11 +11,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _rcCascader = _interopRequireDefault(require("rc-cascader"));
|
|
13
13
|
|
|
14
|
+
var _time = _interopRequireDefault(require("./time"));
|
|
15
|
+
|
|
14
16
|
require("rc-cascader/assets/index.less");
|
|
15
17
|
|
|
16
18
|
require("./index.css");
|
|
17
19
|
|
|
18
|
-
var _excluded = ["value", "initText", "options", "onChange", "style", "placeholder", "splitSymbol"];
|
|
20
|
+
var _excluded = ["value", "initText", "options", "onChange", "style", "placeholder", "splitSymbol", "popupClassName"];
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
23
|
|
|
@@ -57,6 +59,8 @@ var Cascader = function Cascader(_ref) {
|
|
|
57
59
|
placeholder = _ref$placeholder === void 0 ? "请选择" : _ref$placeholder,
|
|
58
60
|
_ref$splitSymbol = _ref.splitSymbol,
|
|
59
61
|
splitSymbol = _ref$splitSymbol === void 0 ? "" : _ref$splitSymbol,
|
|
62
|
+
_ref$popupClassName = _ref.popupClassName,
|
|
63
|
+
popupClassName = _ref$popupClassName === void 0 ? "" : _ref$popupClassName,
|
|
60
64
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
61
65
|
|
|
62
66
|
var _useState = (0, _react.useState)(value),
|
|
@@ -70,7 +74,6 @@ var Cascader = function Cascader(_ref) {
|
|
|
70
74
|
setInputValue = _useState4[1];
|
|
71
75
|
|
|
72
76
|
var handleChange = function handleChange(value, selectedOptions) {
|
|
73
|
-
console.log(value, selectedOptions);
|
|
74
77
|
onChange && onChange(value, selectedOptions);
|
|
75
78
|
setSelectValue(value);
|
|
76
79
|
var str = selectedOptions.map(function (o) {
|
|
@@ -82,10 +85,11 @@ var Cascader = function Cascader(_ref) {
|
|
|
82
85
|
(0, _react.useEffect)(function () {
|
|
83
86
|
setSelectValue(value);
|
|
84
87
|
}, [value]);
|
|
85
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
88
|
+
return /*#__PURE__*/_react["default"].createElement(_rcCascader["default"], _extends({
|
|
86
89
|
options: options,
|
|
87
90
|
onChange: handleChange,
|
|
88
|
-
value: selectValue
|
|
91
|
+
value: selectValue,
|
|
92
|
+
popupClassName: "".concat(preCls, "-popup ").concat(popupClassName)
|
|
89
93
|
}, restProps), /*#__PURE__*/_react["default"].createElement("div", {
|
|
90
94
|
className: preCls,
|
|
91
95
|
style: style
|
|
@@ -93,8 +97,9 @@ var Cascader = function Cascader(_ref) {
|
|
|
93
97
|
className: "".concat(preCls, "-text")
|
|
94
98
|
}, inputValue ? inputValue : placeholder), /*#__PURE__*/_react["default"].createElement("span", {
|
|
95
99
|
className: "tu-icon-caret-down"
|
|
96
|
-
})))
|
|
100
|
+
})));
|
|
97
101
|
};
|
|
98
102
|
|
|
103
|
+
Cascader.TimeCascader = _time["default"];
|
|
99
104
|
var _default = Cascader;
|
|
100
105
|
exports["default"] = _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
var TimeCascader = function TimeCascader(_ref) {
|
|
23
|
+
var restProps = _extends({}, _ref);
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_index["default"], _extends({
|
|
26
|
+
popupClassName: ' titaui-cascader-time-popup'
|
|
27
|
+
}, restProps)));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var _default = TimeCascader;
|
|
31
|
+
exports["default"] = _default;
|
|
@@ -26,12 +26,13 @@ var FieldGroup = function FieldGroup(props, ref) {
|
|
|
26
26
|
label = _props$label === void 0 ? "" : _props$label,
|
|
27
27
|
_props$direction = props.direction,
|
|
28
28
|
direction = _props$direction === void 0 ? "vertical" : _props$direction,
|
|
29
|
+
className = props.className,
|
|
29
30
|
children = props.children;
|
|
30
31
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
31
32
|
return {};
|
|
32
33
|
});
|
|
33
34
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
34
|
-
className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(direction))
|
|
35
|
+
className: (0, _classnames["default"])(precls, className, "".concat(precls, "--").concat(direction))
|
|
35
36
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
36
37
|
className: "".concat(precls, "__label")
|
|
37
38
|
}, label), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -13,19 +13,29 @@ var _simplebarReact = _interopRequireDefault(require("./simplebar-react"));
|
|
|
13
13
|
|
|
14
14
|
require("./index.css");
|
|
15
15
|
|
|
16
|
+
var _excluded = ["children", "style"];
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
19
|
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
|
|
18
26
|
var preCls = 'titaui-scrollbar';
|
|
19
27
|
|
|
20
28
|
var _default = function _default(props) {
|
|
21
29
|
var children = props.children,
|
|
22
|
-
style = props.style
|
|
30
|
+
style = props.style,
|
|
31
|
+
restProps = _objectWithoutProperties(props, _excluded); // @ts-ignore
|
|
32
|
+
|
|
23
33
|
|
|
24
|
-
return /*#__PURE__*/_react["default"].createElement(_simplebarReact["default"], {
|
|
34
|
+
return /*#__PURE__*/_react["default"].createElement(_simplebarReact["default"], _extends({
|
|
25
35
|
className: (0, _classnames["default"])(preCls),
|
|
26
36
|
timeout: 800,
|
|
27
37
|
style: style
|
|
28
|
-
}, children);
|
|
38
|
+
}, restProps), children);
|
|
29
39
|
};
|
|
30
40
|
|
|
31
41
|
exports["default"] = _default;
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
.titaui-select
|
|
1
|
+
.titaui-select-tags {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.titaui-select-tags .rc-select-single:not(.rc-select-customize-input) .rc-select-selector {
|
|
2
6
|
border: 1px solid #DFE3EA;
|
|
3
7
|
}
|
|
4
8
|
|
|
5
|
-
.titaui-select .rc-select-focused .rc-select-selector {
|
|
9
|
+
.titaui-select-tags .rc-select-focused .rc-select-selector {
|
|
6
10
|
border: 1px solid #DFE3EA !important;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
|
-
.titaui-select .rc-select-selection-item-remove {
|
|
13
|
+
.titaui-select-tags .rc-select-selection-item-remove {
|
|
10
14
|
display: flex;
|
|
11
15
|
align-items: center;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
.titaui-select .rc-select-multiple .rc-select-selector .rc-select-selection-search-input {
|
|
18
|
+
.titaui-select-tags .rc-select-multiple .rc-select-selector .rc-select-selection-search-input {
|
|
15
19
|
display: none;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
.titaui-select .rc-select-single:not(.rc-select-customize-input) .rc-select-selector .rc-select-selection-search-input {
|
|
22
|
+
.titaui-select-tags .rc-select-single:not(.rc-select-customize-input) .rc-select-selector .rc-select-selection-search-input {
|
|
19
23
|
display: none;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
.titaui-select .rc-select-single .rc-select-selector .rc-select-selection-item,
|
|
23
|
-
.titaui-select .rc-select-single .rc-select-selector .rc-select-selection-placeholder {
|
|
26
|
+
.titaui-select-tags .rc-select-single .rc-select-selector .rc-select-selection-item,
|
|
27
|
+
.titaui-select-tags .rc-select-single .rc-select-selector .rc-select-selection-placeholder {
|
|
24
28
|
top: unset;
|
|
25
29
|
left: 12px;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
.titaui-select .rc-select-single .rc-select-selector {
|
|
32
|
+
.titaui-select-tags .rc-select-single .rc-select-selector {
|
|
29
33
|
align-items: center;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
|
-
.titaui-select .rc-select-selector {
|
|
36
|
+
.titaui-select-tags .rc-select-selector {
|
|
33
37
|
cursor: pointer;
|
|
34
38
|
padding: 0 12px;
|
|
35
39
|
background: #FFFFFF;
|
|
@@ -39,30 +43,30 @@
|
|
|
39
43
|
box-sizing: border-box;
|
|
40
44
|
}
|
|
41
45
|
|
|
42
|
-
.titaui-select .rc-select-multiple .rc-select-selector {
|
|
46
|
+
.titaui-select-tags .rc-select-multiple .rc-select-selector {
|
|
43
47
|
height: unset;
|
|
44
48
|
padding: 7px 12px 0;
|
|
45
49
|
border: 1px solid #DFE3EA;
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
.titaui-select .rc-select-multiple .rc-select-selector .rc-select-selection-overflow-item {
|
|
52
|
+
.titaui-select-tags .rc-select-multiple .rc-select-selector .rc-select-selection-overflow-item {
|
|
49
53
|
display: flex;
|
|
50
54
|
align-items: center;
|
|
51
55
|
margin-bottom: 7px;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
.titaui-select .rc-select-multiple .rc-select-selector .rc-select-selection-placeholder {
|
|
58
|
+
.titaui-select-tags .rc-select-multiple .rc-select-selector .rc-select-selection-placeholder {
|
|
55
59
|
line-height: 1;
|
|
56
60
|
margin-bottom: 7px;
|
|
57
61
|
position: relative;
|
|
58
62
|
top: -2px;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
.titaui-select .rc-select-selection-item-content {
|
|
65
|
+
.titaui-select-tags .rc-select-selection-item-content {
|
|
62
66
|
margin-right: 8px;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
.titaui-select .rc-select-multiple .rc-select-selector .rc-select-selection-item {
|
|
69
|
+
.titaui-select-tags .rc-select-multiple .rc-select-selector .rc-select-selection-item {
|
|
66
70
|
font-size: 12px;
|
|
67
71
|
flex: none;
|
|
68
72
|
height: 20px;
|
|
@@ -74,24 +78,24 @@
|
|
|
74
78
|
padding: 0 5px 0 10px;
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
.titaui-select .rc-select-multiple .rc-select-selector .rc-select-selection-item .tu-icon-cross {
|
|
81
|
+
.titaui-select-tags .rc-select-multiple .rc-select-selector .rc-select-selection-item .tu-icon-cross {
|
|
78
82
|
cursor: pointer;
|
|
79
83
|
color: #a4acB9;
|
|
80
84
|
font-size: 14px;
|
|
81
85
|
}
|
|
82
86
|
|
|
83
|
-
.titaui-select .titaui-select-noborder .rc-select-selector {
|
|
87
|
+
.titaui-select-tags .titaui-select-noborder .rc-select-selector {
|
|
84
88
|
border: none !important;
|
|
85
89
|
height: 22px;
|
|
86
90
|
line-height: 1;
|
|
87
91
|
}
|
|
88
92
|
|
|
89
|
-
.titaui-select .rc-select-arrow {
|
|
93
|
+
.titaui-select-tags .rc-select-arrow {
|
|
90
94
|
font-size: 16px;
|
|
91
95
|
transform: scale(0.5);
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
.titaui-select .rc-select-show-arrow .rc-select-arrow {
|
|
98
|
+
.titaui-select-tags .rc-select-show-arrow .rc-select-arrow {
|
|
95
99
|
top: 0;
|
|
96
100
|
bottom: 0;
|
|
97
101
|
margin: auto;
|
|
@@ -45,7 +45,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
45
45
|
|
|
46
46
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
47
47
|
|
|
48
|
-
var preCls = "titaui-select";
|
|
48
|
+
var preCls = "titaui-select-tags";
|
|
49
49
|
|
|
50
50
|
var SelectTags = function SelectTags(_ref) {
|
|
51
51
|
var _ref$selected = _ref.selected,
|
package/package.json
CHANGED
|
@@ -13,37 +13,60 @@
|
|
|
13
13
|
font-size: 14px;
|
|
14
14
|
color: #3F4755;
|
|
15
15
|
}
|
|
16
|
+
&-popup{
|
|
17
|
+
z-index: 2000;
|
|
18
|
+
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
19
|
+
border: 1px solid #F0F2F5;
|
|
20
|
+
border-radius: 12px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
.rc-cascader-menu{
|
|
23
|
+
width: 139px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
border: 1px solid #F0F2F5;
|
|
26
|
+
padding: 16px 0 16px 6px;
|
|
27
|
+
&::-webkit-scrollbar{
|
|
28
|
+
width: 6px !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
.rc-cascader-menu-item-active{
|
|
33
|
+
background: unset;
|
|
34
|
+
color: #2879ff;
|
|
35
|
+
}
|
|
36
|
+
.rc-cascader-menu-item{
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
padding: 0 6px;
|
|
40
|
+
height: 36px;
|
|
41
|
+
align-items: center;
|
|
42
|
+
color: #3F4755;
|
|
43
|
+
&:hover{
|
|
44
|
+
color: #2879ff;
|
|
45
|
+
background: #F7F8FA;
|
|
46
|
+
border-radius: 8px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.rc-cascader-menu-item-disabled{
|
|
50
|
+
opacity:1;
|
|
51
|
+
cursor: auto;
|
|
52
|
+
&:hover{
|
|
53
|
+
color: #3F4755;
|
|
54
|
+
background: #FFFFFF;
|
|
55
|
+
border-radius: 8px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.rc-cascader-menu-item-expand-icon{
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
16
62
|
.tu-icon-caret-down{
|
|
17
63
|
font-size: 16px;
|
|
18
64
|
transform: scale(0.5);
|
|
19
65
|
}
|
|
20
66
|
}
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
.rc-cascader-menu{
|
|
28
|
-
width: 139px;
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
border: 1px solid #F0F2F5;
|
|
31
|
-
padding: 16px 6px;
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
.rc-cascader-menu-item-active{
|
|
35
|
-
background: unset;
|
|
36
|
-
color: #2879ff;
|
|
37
|
-
}
|
|
38
|
-
.rc-cascader-menu-item{
|
|
39
|
-
box-sizing: border-box;
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
padding: 0 6px;
|
|
42
|
-
height: 36px;
|
|
43
|
-
align-items: center;
|
|
44
|
-
&:hover{
|
|
45
|
-
color: #2879ff;
|
|
46
|
-
background: #F7F8FA;
|
|
47
|
-
border-radius: 8px;
|
|
67
|
+
.titaui-cascader-time-popup{
|
|
68
|
+
.rc-cascader-menu{
|
|
69
|
+
width: 80px;
|
|
70
|
+
text-align: center;
|
|
48
71
|
}
|
|
49
72
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { useState, useEffect
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import Rccascader from "rc-cascader";
|
|
3
|
+
import TimeCascader from "./time";
|
|
3
4
|
import "rc-cascader/assets/index.less";
|
|
4
5
|
import "./index.scss";
|
|
5
6
|
|
|
@@ -10,6 +11,7 @@ interface Props {
|
|
|
10
11
|
placeholder?: any;
|
|
11
12
|
initText?: any; //想要默认值输入框的值就传进来,不要问组件里为什么不做这个事情,优化算法
|
|
12
13
|
style?: any;
|
|
14
|
+
popupClassName?: any;
|
|
13
15
|
splitSymbol?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -23,13 +25,13 @@ const Cascader = ({
|
|
|
23
25
|
style = { width: "100px" },
|
|
24
26
|
placeholder = "请选择",
|
|
25
27
|
splitSymbol = "",
|
|
28
|
+
popupClassName = "",
|
|
26
29
|
...restProps
|
|
27
30
|
}: Props) => {
|
|
28
31
|
const [selectValue, setSelectValue] = useState(value);
|
|
29
32
|
const [inputValue, setInputValue] = useState(initText);
|
|
30
33
|
|
|
31
34
|
const handleChange = (value, selectedOptions) => {
|
|
32
|
-
console.log(value, selectedOptions);
|
|
33
35
|
onChange && onChange(value, selectedOptions);
|
|
34
36
|
setSelectValue(value);
|
|
35
37
|
let str = selectedOptions.map((o) => o.label).join(splitSymbol);
|
|
@@ -41,22 +43,22 @@ const Cascader = ({
|
|
|
41
43
|
}, [value]);
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>
|
|
55
|
-
<span className="tu-icon-caret-down" />
|
|
46
|
+
<Rccascader
|
|
47
|
+
options={options}
|
|
48
|
+
onChange={handleChange}
|
|
49
|
+
value={selectValue}
|
|
50
|
+
popupClassName={`${preCls}-popup ${popupClassName}`}
|
|
51
|
+
{...restProps}
|
|
52
|
+
>
|
|
53
|
+
<div className={preCls} style={style}>
|
|
54
|
+
<div className={`${preCls}-text`}>
|
|
55
|
+
{inputValue ? inputValue : placeholder}
|
|
56
56
|
</div>
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
<span className="tu-icon-caret-down" />
|
|
58
|
+
</div>
|
|
59
|
+
</Rccascader>
|
|
59
60
|
);
|
|
60
61
|
};
|
|
61
62
|
|
|
63
|
+
Cascader.TimeCascader = TimeCascader;
|
|
62
64
|
export default Cascader;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC,Fragment } from "react";
|
|
2
|
+
import Cascader from './index'
|
|
3
|
+
|
|
4
|
+
const TimeCascader = ({...restProps})=>{
|
|
5
|
+
return <Fragment>
|
|
6
|
+
<Cascader
|
|
7
|
+
popupClassName={' titaui-cascader-time-popup'}
|
|
8
|
+
{...restProps}
|
|
9
|
+
/>
|
|
10
|
+
</Fragment>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default TimeCascader
|
|
@@ -11,6 +11,7 @@ interface IProps {
|
|
|
11
11
|
require?: boolean;
|
|
12
12
|
width?: number;
|
|
13
13
|
children?: ReactElement;
|
|
14
|
+
className?: any;
|
|
14
15
|
direction?: "horizontal" | "vertical";
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -18,15 +19,14 @@ const FieldGroup = (props: IProps, ref) => {
|
|
|
18
19
|
const {
|
|
19
20
|
label = "",
|
|
20
21
|
direction = "vertical",
|
|
21
|
-
|
|
22
|
-
// values,
|
|
22
|
+
className,
|
|
23
23
|
children,
|
|
24
24
|
} = props;
|
|
25
25
|
|
|
26
26
|
useImperativeHandle(ref, () => ({}));
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<div className={classNames(precls, `${precls}--${direction}`)}>
|
|
29
|
+
<div className={classNames(precls,className, `${precls}--${direction}`)}>
|
|
30
30
|
<div className={`${precls}__label`}>{label}</div>
|
|
31
31
|
<div className={`${precls}__content`}>
|
|
32
32
|
{React.Children.map(children, (child) => {
|
|
@@ -11,13 +11,14 @@ interface Props {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export default (props: Props) => {
|
|
14
|
-
const { children, style } = props;
|
|
14
|
+
const { children, style,...restProps } = props;
|
|
15
15
|
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
return <SimpleBar
|
|
18
18
|
className={classNames(preCls)}
|
|
19
19
|
timeout={800}
|
|
20
20
|
style={style}
|
|
21
|
+
{...restProps}
|
|
21
22
|
>
|
|
22
23
|
{children}
|
|
23
24
|
</SimpleBar>
|