@titaui/pc 1.16.92 → 1.16.93
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/form/form-fields/radios/index.js +5 -2
- package/lib/components/guide-tip/index.js +11 -5
- package/lib/components/menus/components/menu-tree/tree-node/assess-manage.js +52 -7
- package/lib/components/menus/export-modules/appraisal-menus/index.js +11 -7
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +14 -14
- package/lib/components/menus/export-modules/interview-menus/index.js +11 -7
- package/lib/components/switch/index.css +5 -0
- package/lib/components/switch/index.js +3 -3
- package/lib/components/switch/rc-switch.css +3 -3
- package/lib/components-v1/radio/radio.js +28 -28
- package/lib/components-v1/radio/style/index.css +44 -12
- package/package.json +1 -1
@@ -38,6 +38,8 @@ var prefixCls = 'form-field-radio';
|
|
38
38
|
var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
39
39
|
var _props$className = props.className,
|
40
40
|
className = _props$className === void 0 ? '' : _props$className,
|
41
|
+
_props$disabled = props.disabled,
|
42
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
41
43
|
label = props.label,
|
42
44
|
onChange = props.onChange,
|
43
45
|
radios = props.radios,
|
@@ -74,9 +76,10 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
74
76
|
className: "".concat(prefixCls, "__radios")
|
75
77
|
}, radios.map(function (radio) {
|
76
78
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
77
|
-
className: "".concat(prefixCls, "__radios-item ").concat(radioClass)
|
79
|
+
className: "".concat(prefixCls, "__radios-item ").concat(radioClass),
|
80
|
+
key: radio.value
|
78
81
|
}, /*#__PURE__*/_react["default"].createElement(_radio.Radio, {
|
79
|
-
|
82
|
+
disabled: disabled,
|
80
83
|
value: radio.value,
|
81
84
|
onChange: onChangeHandler,
|
82
85
|
checked: radio.value == activedValue
|
@@ -21,7 +21,7 @@ var _bsGlobal = require("../../utils/bs-global");
|
|
21
21
|
|
22
22
|
require("./index.css");
|
23
23
|
|
24
|
-
var _excluded = ["type", "width", "time", "children", "popupPlacement", "classnames", "content", "onClickClose", "buttonTitle", "visible", "isShowPopup"];
|
24
|
+
var _excluded = ["arrowStyle", "type", "width", "time", "children", "popupPlacement", "classnames", "content", "onClickClose", "buttonTitle", "visible", "isShowPopup"];
|
25
25
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
27
27
|
|
@@ -31,6 +31,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
31
31
|
|
32
32
|
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); }
|
33
33
|
|
34
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
35
|
+
|
36
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
37
|
+
|
34
38
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
35
39
|
|
36
40
|
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; }
|
@@ -39,7 +43,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
39
43
|
|
40
44
|
var preCls = 'titaui-pc__guide-tip';
|
41
45
|
var GuideTip = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
42
|
-
var _props$
|
46
|
+
var _props$arrowStyle = props.arrowStyle,
|
47
|
+
arrowStyle = _props$arrowStyle === void 0 ? {} : _props$arrowStyle,
|
48
|
+
_props$type = props.type,
|
43
49
|
type = _props$type === void 0 ? 'default' : _props$type,
|
44
50
|
_props$width = props.width,
|
45
51
|
width = _props$width === void 0 ? 304 : _props$width,
|
@@ -83,12 +89,12 @@ var GuideTip = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
83
89
|
var _popupAlign$offset;
|
84
90
|
|
85
91
|
var offsetY = (popupAlign === null || popupAlign === void 0 ? void 0 : (_popupAlign$offset = popupAlign.offset) === null || _popupAlign$offset === void 0 ? void 0 : _popupAlign$offset[1]) || 0;
|
86
|
-
return {
|
92
|
+
return _objectSpread({
|
87
93
|
marginTop: "".concat(-offsetY - 4, "px")
|
88
|
-
};
|
94
|
+
}, arrowStyle);
|
89
95
|
}
|
90
96
|
|
91
|
-
return
|
97
|
+
return arrowStyle;
|
92
98
|
};
|
93
99
|
|
94
100
|
var renderPopupContent = function renderPopupContent() {
|
@@ -9,28 +9,73 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
11
11
|
|
12
|
-
var _precls = _interopRequireDefault(require("../precls"));
|
13
|
-
|
14
12
|
var _bsGlobal = require("../../../../../utils/bs-global");
|
15
13
|
|
14
|
+
var _guideTip = _interopRequireDefault(require("../../../../guide-tip"));
|
15
|
+
|
16
|
+
var _precls = _interopRequireDefault(require("../precls"));
|
17
|
+
|
16
18
|
require("./index.css");
|
17
19
|
|
20
|
+
var _useLocalStorage3 = _interopRequireDefault(require("&/hooks/useLocalStorage"));
|
21
|
+
|
18
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
23
|
|
20
|
-
|
21
|
-
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
25
|
+
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
27
|
+
|
28
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
29
|
+
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
31
|
+
|
32
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
33
|
+
|
34
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
35
|
+
|
36
|
+
var i18nInfo = (0, _bsGlobal.getBSGlobal)('I18NInfo');
|
37
|
+
var isZn = !i18nInfo || i18nInfo && i18nInfo.I18NOpen && i18nInfo.I18NUserLang === 'zh_CN';
|
22
38
|
|
23
39
|
function _default(props) {
|
24
40
|
var data = props.data,
|
25
41
|
level = props.level;
|
26
42
|
|
43
|
+
var _useLocalStorage = (0, _useLocalStorage3["default"])('guideTipVisible', 'tita-performance__navigation-guide', true),
|
44
|
+
_useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
|
45
|
+
guideTipVisible = _useLocalStorage2[0],
|
46
|
+
setGuideTipVisible = _useLocalStorage2[1];
|
47
|
+
|
48
|
+
var onGuideTipHide = function onGuideTipHide() {
|
49
|
+
return setGuideTipVisible(false);
|
50
|
+
};
|
51
|
+
|
27
52
|
var onNodeClickHandler = function onNodeClickHandler() {
|
28
53
|
if (data.href) {
|
29
54
|
window.location.href = data.href;
|
30
55
|
}
|
31
56
|
};
|
32
57
|
|
33
|
-
return /*#__PURE__*/_react["default"].createElement("
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_guideTip["default"], {
|
59
|
+
arrowStyle: {
|
60
|
+
marginTop: '-4px'
|
61
|
+
},
|
62
|
+
content: /*#__PURE__*/_react["default"].createElement("span", {
|
63
|
+
style: {
|
64
|
+
color: '#ffffff'
|
65
|
+
}
|
66
|
+
}, "\u8003\u6838\u6A21\u677F\u548C\u8003\u6838\u7BA1\u7406\u8C03\u6574\u4F4D\u7F6E\u4E86\u54E6~"),
|
67
|
+
onClickClose: onGuideTipHide,
|
68
|
+
popupAlign: {
|
69
|
+
offset: [0, 20],
|
70
|
+
overflow: {
|
71
|
+
adjustX: 1,
|
72
|
+
adjustY: 1
|
73
|
+
}
|
74
|
+
},
|
75
|
+
popupPlacement: "right",
|
76
|
+
visible: guideTipVisible,
|
77
|
+
width: 182
|
78
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
34
79
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node")),
|
35
80
|
onClick: onNodeClickHandler,
|
36
81
|
title: ""
|
@@ -39,8 +84,8 @@ function _default(props) {
|
|
39
84
|
}), data.icon && /*#__PURE__*/_react["default"].createElement("span", {
|
40
85
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-icon"), data.icon)
|
41
86
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
42
|
-
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-title"),
|
87
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-title"), 'noselect')
|
43
88
|
}, props.title), isZn && /*#__PURE__*/_react["default"].createElement("span", {
|
44
89
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-suffix"))
|
45
|
-
}));
|
90
|
+
})));
|
46
91
|
}
|
@@ -90,16 +90,20 @@ function AppraisalMenus(props) {
|
|
90
90
|
(0, _react.useEffect)(function () {
|
91
91
|
okrMenusData.current = new _menus["default"]();
|
92
92
|
var newMenus = okrMenusData.current.getMenus();
|
93
|
-
|
93
|
+
var menuSize = newMenus.length;
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
95
|
+
if (menuSize > 0) {
|
96
|
+
setMenus(newMenus);
|
98
97
|
|
99
|
-
|
98
|
+
var _getQueryString = (0, _tools.getQueryString)(),
|
99
|
+
_getQueryString$react = _getQueryString.reactRouterName,
|
100
|
+
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
100
101
|
|
101
|
-
|
102
|
-
|
102
|
+
var isAppraisalPage = window.location.hash.startsWith('#/performance');
|
103
|
+
|
104
|
+
if (!reactRouterName && isAppraisalPage) {
|
105
|
+
window.location.href = newMenus[0].data.href;
|
106
|
+
}
|
103
107
|
}
|
104
108
|
}, [history.location.pathname]); // 判断路由高亮菜单
|
105
109
|
|
@@ -102,13 +102,6 @@ var AppraisalMenus = /*#__PURE__*/function () {
|
|
102
102
|
type: _index.GROUP_NAME_NODE,
|
103
103
|
href: '',
|
104
104
|
isShow: performanceManageAuthority || performanceStatisticsAuthority
|
105
|
-
}, {
|
106
|
-
icon: 'uniEA10',
|
107
|
-
label: _i18n.locale.menu_template_ass,
|
108
|
-
key: PAGE_TEMPLATE_APPRAISAL,
|
109
|
-
type: _index.MENU_ASSESS_TEMPLATE,
|
110
|
-
href: '#/performance?reactRouterName=template',
|
111
|
-
isShow: performanceManageAuthority
|
112
105
|
}, {
|
113
106
|
icon: 'untitled',
|
114
107
|
label: _i18n.locale.menu_management_ass,
|
@@ -116,6 +109,13 @@ var AppraisalMenus = /*#__PURE__*/function () {
|
|
116
109
|
type: _index.MENU_ASSESS_MANAGE,
|
117
110
|
href: '#/performance?reactRouterName=manage',
|
118
111
|
isShow: performanceManageAuthority
|
112
|
+
}, {
|
113
|
+
icon: 'uniEA10',
|
114
|
+
label: _i18n.locale.menu_template_ass,
|
115
|
+
key: PAGE_TEMPLATE_APPRAISAL,
|
116
|
+
type: _index.MENU_ASSESS_TEMPLATE,
|
117
|
+
href: '#/performance?reactRouterName=template',
|
118
|
+
isShow: performanceManageAuthority
|
119
119
|
}, {
|
120
120
|
icon: 'yibiao',
|
121
121
|
label: _i18n.locale.menu_dashboard_ass,
|
@@ -181,19 +181,19 @@ var AppraisalMenus = /*#__PURE__*/function () {
|
|
181
181
|
isShow: IsLeader || IsHrbp
|
182
182
|
}],
|
183
183
|
performanceManage: [{
|
184
|
-
icon: 'uniEA10',
|
185
|
-
label: _i18n.locale.menu_template_ass,
|
186
|
-
key: PAGE_TEMPLATE_APPRAISAL,
|
187
|
-
type: _index.MENU_ASSESS_TEMPLATE,
|
188
|
-
href: '#/performance/manage?reactRouterName=template',
|
189
|
-
isShow: performanceManageAuthority
|
190
|
-
}, {
|
191
184
|
icon: 'untitled',
|
192
185
|
label: _i18n.locale.menu_management_ass,
|
193
186
|
key: PAGE_MANAGE_APPRAISAL,
|
194
187
|
type: _index.MENU_ASSESS_MANAGE,
|
195
188
|
href: '#/performance/manage?reactRouterName=manage',
|
196
189
|
isShow: performanceManageAuthority
|
190
|
+
}, {
|
191
|
+
icon: 'uniEA10',
|
192
|
+
label: _i18n.locale.menu_template_ass,
|
193
|
+
key: PAGE_TEMPLATE_APPRAISAL,
|
194
|
+
type: _index.MENU_ASSESS_TEMPLATE,
|
195
|
+
href: '#/performance/manage?reactRouterName=template',
|
196
|
+
isShow: performanceManageAuthority
|
197
197
|
}, {
|
198
198
|
icon: '',
|
199
199
|
label: _i18n.locale.menu_basesetting,
|
@@ -85,16 +85,20 @@ function InterviewMenus(props) {
|
|
85
85
|
(0, _react.useEffect)(function () {
|
86
86
|
interviewMenusData.current = new _menus["default"]();
|
87
87
|
var newMenus = interviewMenusData.current.getMenus();
|
88
|
-
|
88
|
+
var menuSize = newMenus.length;
|
89
89
|
|
90
|
-
|
91
|
-
|
92
|
-
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
90
|
+
if (menuSize > 0) {
|
91
|
+
setMenus(newMenus);
|
93
92
|
|
94
|
-
|
93
|
+
var _getQueryString = (0, _tools.getQueryString)(),
|
94
|
+
_getQueryString$react = _getQueryString.reactRouterName,
|
95
|
+
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
95
96
|
|
96
|
-
|
97
|
-
|
97
|
+
var isInterviewPage = window.location.hash.indexOf('interview') != -1;
|
98
|
+
|
99
|
+
if (!reactRouterName && isInterviewPage) {
|
100
|
+
window.location.href = newMenus[0].data.href;
|
101
|
+
}
|
98
102
|
}
|
99
103
|
}, [history.location.pathname]);
|
100
104
|
(0, _react.useEffect)(function () {
|
@@ -16,6 +16,11 @@
|
|
16
16
|
background-color: #2879FF;
|
17
17
|
}
|
18
18
|
|
19
|
+
.titaui-switch .tui-switch-checked.tui-switch-disabled {
|
20
|
+
background-color: #93BCFF !important;
|
21
|
+
border-color: #93BCFF !important;
|
22
|
+
}
|
23
|
+
|
19
24
|
.titaui-switch .tui-switch:focus {
|
20
25
|
box-shadow: unset !important;
|
21
26
|
}
|
@@ -26,14 +26,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
26
26
|
function _default(props) {
|
27
27
|
var label = props.label,
|
28
28
|
_props$size = props.size,
|
29
|
-
size = _props$size === void 0 ?
|
29
|
+
size = _props$size === void 0 ? 'normal' : _props$size,
|
30
30
|
restProps = _objectWithoutProperties(props, _excluded);
|
31
31
|
|
32
32
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
33
33
|
className: "titaui-switch"
|
34
|
-
}, label
|
34
|
+
}, label && /*#__PURE__*/_react["default"].createElement("span", {
|
35
35
|
className: "titaui-switch-label"
|
36
|
-
}, label)
|
36
|
+
}, label), /*#__PURE__*/_react["default"].createElement(_rcSwitch["default"], _extends({
|
37
37
|
prefixCls: "tui-switch"
|
38
38
|
}, restProps)));
|
39
39
|
}
|
@@ -65,12 +65,12 @@
|
|
65
65
|
|
66
66
|
.tui-switch-disabled {
|
67
67
|
cursor: no-drop;
|
68
|
-
background: #
|
69
|
-
border-color: #
|
68
|
+
background-color: #DFE3EA !important;
|
69
|
+
border-color: #DFE3EA !important;
|
70
70
|
}
|
71
71
|
|
72
72
|
.tui-switch-disabled:after {
|
73
|
-
background: #
|
73
|
+
background-color: #ffffff;
|
74
74
|
animation-name: none;
|
75
75
|
cursor: no-drop;
|
76
76
|
}
|
@@ -9,18 +9,18 @@ exports["default"] = void 0;
|
|
9
9
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
11
11
|
|
12
|
-
var
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
|
14
14
|
require("./style/index.css");
|
15
15
|
|
16
|
-
var _templateObject;
|
17
|
-
|
18
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
17
|
|
20
18
|
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); }
|
21
19
|
|
22
20
|
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; }
|
23
21
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
23
|
+
|
24
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
25
25
|
|
26
26
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -41,9 +41,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
41
41
|
|
42
42
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
var RadioWrapper = _styledComponents["default"].label(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n color: #36434d;\n margin-right: 15px;\n box-sizing: border-box;\n display: inline-flex;\n\n .label {\n position: relative;\n user-select: none;\n top: -2px;\n }\n"])));
|
44
|
+
var prefixCls = 'tita-radio';
|
47
45
|
|
48
46
|
var Radio = /*#__PURE__*/function (_Component) {
|
49
47
|
_inherits(Radio, _Component);
|
@@ -73,6 +71,12 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
73
71
|
|
74
72
|
};
|
75
73
|
|
74
|
+
_this.onMouseUpHandler = function () {
|
75
|
+
var _this$props;
|
76
|
+
|
77
|
+
!((_this$props = _this.props) !== null && _this$props !== void 0 && _this$props.disabled) && _this.props.onChange && _this.props.onChange(_this.props.value);
|
78
|
+
};
|
79
|
+
|
76
80
|
_this.state = {
|
77
81
|
checked: _this.getChecked(props)
|
78
82
|
};
|
@@ -100,33 +104,29 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
100
104
|
}, {
|
101
105
|
key: "render",
|
102
106
|
value: function render() {
|
103
|
-
var
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
onMouseUp:
|
112
|
-
_this2.props.onChange && _this2.props.onChange(_this2.props.value);
|
113
|
-
}
|
107
|
+
var _this$props2 = this.props,
|
108
|
+
children = _this$props2.children,
|
109
|
+
checked = _this$props2.checked,
|
110
|
+
disabled = _this$props2.disabled,
|
111
|
+
name = _this$props2.name,
|
112
|
+
value = _this$props2.value;
|
113
|
+
return /*#__PURE__*/_react["default"].createElement("label", {
|
114
|
+
className: (0, _classnames["default"])("".concat(prefixCls, "__wrapper"), _defineProperty({}, "".concat(prefixCls, "--disabled"), disabled)),
|
115
|
+
onMouseUp: this.onMouseUpHandler
|
114
116
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
115
|
-
className:
|
117
|
+
className: prefixCls
|
116
118
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
117
|
-
|
118
|
-
name: name,
|
119
|
-
value: value,
|
120
|
-
className: "tita-radio-input",
|
119
|
+
className: "".concat(prefixCls, "__input"),
|
121
120
|
checked: checked,
|
122
|
-
|
121
|
+
disabled: disabled,
|
122
|
+
name: name,
|
123
|
+
onChange: this.onChange,
|
124
|
+
type: "radio",
|
125
|
+
value: value
|
123
126
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
124
|
-
className: "
|
127
|
+
className: "".concat(prefixCls, "__inner")
|
125
128
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
126
|
-
className: "
|
127
|
-
style: {
|
128
|
-
fontSize: 12
|
129
|
-
}
|
129
|
+
className: "".concat(prefixCls, "__label")
|
130
130
|
}, children));
|
131
131
|
}
|
132
132
|
}]);
|
@@ -1,28 +1,38 @@
|
|
1
1
|
.tita-radio {
|
2
|
-
display: inline-block;
|
3
|
-
position: relative;
|
4
|
-
top: 1px;
|
5
2
|
width: 16px;
|
6
3
|
min-width: 16px;
|
7
4
|
height: 16px;
|
8
5
|
min-height: 16px;
|
9
6
|
margin-right: 5px;
|
7
|
+
display: inline-block;
|
8
|
+
position: relative;
|
9
|
+
top: 0;
|
10
10
|
}
|
11
11
|
|
12
|
-
.tita-
|
13
|
-
|
14
|
-
|
12
|
+
.tita-radio__wrapper {
|
13
|
+
margin-right: 15px;
|
14
|
+
box-sizing: border-box;
|
15
|
+
color: #36434d;
|
16
|
+
cursor: pointer;
|
17
|
+
display: inline-flex;
|
18
|
+
align-items: center;
|
19
|
+
}
|
20
|
+
|
21
|
+
.tita-radio--disabled {
|
22
|
+
cursor: default;
|
15
23
|
}
|
16
24
|
|
17
|
-
.tita-radio:hover > .tita-
|
25
|
+
.tita-radio:hover > .tita-radio__inner {
|
18
26
|
border: 1px solid #2879ff;
|
19
27
|
}
|
20
28
|
|
21
|
-
.tita-
|
29
|
+
.tita-radio__input {
|
30
|
+
width: 16px;
|
31
|
+
height: 16px;
|
22
32
|
opacity: 0;
|
23
33
|
}
|
24
34
|
|
25
|
-
.tita-
|
35
|
+
.tita-radio__inner {
|
26
36
|
position: absolute;
|
27
37
|
top: 0;
|
28
38
|
left: 0;
|
@@ -34,7 +44,7 @@
|
|
34
44
|
transition: all 300ms;
|
35
45
|
}
|
36
46
|
|
37
|
-
.tita-
|
47
|
+
.tita-radio__inner::after {
|
38
48
|
content: '';
|
39
49
|
position: absolute;
|
40
50
|
top: 2px;
|
@@ -50,11 +60,33 @@
|
|
50
60
|
transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
51
61
|
}
|
52
62
|
|
53
|
-
.tita-
|
63
|
+
.tita-radio__input:checked + .tita-radio__inner {
|
54
64
|
border-color: #2879ff !important;
|
55
65
|
}
|
56
66
|
|
57
|
-
.tita-
|
67
|
+
.tita-radio__input:checked + .tita-radio__inner:after {
|
58
68
|
transform: scale(1);
|
59
69
|
opacity: 1;
|
60
70
|
}
|
71
|
+
|
72
|
+
.tita-radio__input:disabled + .tita-radio__inner {
|
73
|
+
background-color: #F0F4FA;
|
74
|
+
border-color: #BFC7D5 !important;
|
75
|
+
}
|
76
|
+
|
77
|
+
.tita-radio__input:disabled + .tita-radio__inner::after {
|
78
|
+
background-color: #BFC7D5 !important;
|
79
|
+
}
|
80
|
+
|
81
|
+
.tita-radio__input:checked.tita-radio__input:disabled + .tita-radio__inner {
|
82
|
+
background-color: #ffffff;
|
83
|
+
border-color: rgba(40, 121, 255, 0.5) !important;
|
84
|
+
}
|
85
|
+
|
86
|
+
.tita-radio__input:checked.tita-radio__input:disabled + .tita-radio__inner::after {
|
87
|
+
background-color: rgba(40, 121, 255, 0.5) !important;
|
88
|
+
}
|
89
|
+
|
90
|
+
.tita-radio__label {
|
91
|
+
font-size: 12px;
|
92
|
+
}
|