@titaui/pc 1.16.90-beta.24 → 1.16.92
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 +2 -5
- package/lib/components/guide-tip/index.js +5 -11
- package/lib/components/menus/components/menu-tree/tree-node/assess-manage.js +7 -52
- package/lib/components/menus/export-modules/appraisal-menus/index.js +7 -11
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +14 -14
- package/lib/components/menus/export-modules/interview-menus/index.js +7 -11
- package/lib/components/regulation-setting-item/index.css +6 -6
- package/lib/components/regulation-setting-item/index.js +1 -1
- package/lib/components/switch/index.css +0 -5
- 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 +12 -44
- package/package.json +1 -1
@@ -38,8 +38,6 @@ 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,
|
43
41
|
label = props.label,
|
44
42
|
onChange = props.onChange,
|
45
43
|
radios = props.radios,
|
@@ -76,10 +74,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
76
74
|
className: "".concat(prefixCls, "__radios")
|
77
75
|
}, radios.map(function (radio) {
|
78
76
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
79
|
-
className: "".concat(prefixCls, "__radios-item ").concat(radioClass)
|
80
|
-
key: radio.value
|
77
|
+
className: "".concat(prefixCls, "__radios-item ").concat(radioClass)
|
81
78
|
}, /*#__PURE__*/_react["default"].createElement(_radio.Radio, {
|
82
|
-
|
79
|
+
key: radio.value,
|
83
80
|
value: radio.value,
|
84
81
|
onChange: onChangeHandler,
|
85
82
|
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 = ["
|
24
|
+
var _excluded = ["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,10 +31,6 @@ 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
|
-
|
38
34
|
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; }
|
39
35
|
|
40
36
|
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; }
|
@@ -43,9 +39,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
43
39
|
|
44
40
|
var preCls = 'titaui-pc__guide-tip';
|
45
41
|
var GuideTip = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
46
|
-
var _props$
|
47
|
-
arrowStyle = _props$arrowStyle === void 0 ? {} : _props$arrowStyle,
|
48
|
-
_props$type = props.type,
|
42
|
+
var _props$type = props.type,
|
49
43
|
type = _props$type === void 0 ? 'default' : _props$type,
|
50
44
|
_props$width = props.width,
|
51
45
|
width = _props$width === void 0 ? 304 : _props$width,
|
@@ -89,12 +83,12 @@ var GuideTip = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
89
83
|
var _popupAlign$offset;
|
90
84
|
|
91
85
|
var offsetY = (popupAlign === null || popupAlign === void 0 ? void 0 : (_popupAlign$offset = popupAlign.offset) === null || _popupAlign$offset === void 0 ? void 0 : _popupAlign$offset[1]) || 0;
|
92
|
-
return
|
86
|
+
return {
|
93
87
|
marginTop: "".concat(-offsetY - 4, "px")
|
94
|
-
}
|
88
|
+
};
|
95
89
|
}
|
96
90
|
|
97
|
-
return
|
91
|
+
return {};
|
98
92
|
};
|
99
93
|
|
100
94
|
var renderPopupContent = function renderPopupContent() {
|
@@ -9,73 +9,28 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
11
11
|
|
12
|
-
var _bsGlobal = require("../../../../../utils/bs-global");
|
13
|
-
|
14
|
-
var _guideTip = _interopRequireDefault(require("../../../../guide-tip"));
|
15
|
-
|
16
12
|
var _precls = _interopRequireDefault(require("../precls"));
|
17
13
|
|
18
|
-
require("
|
14
|
+
var _bsGlobal = require("../../../../../utils/bs-global");
|
19
15
|
|
20
|
-
|
16
|
+
require("./index.css");
|
21
17
|
|
22
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
23
19
|
|
24
|
-
|
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';
|
20
|
+
var i18nInfo = (0, _bsGlobal.getBSGlobal)("I18NInfo");
|
21
|
+
var isZn = !i18nInfo || i18nInfo && i18nInfo.I18NOpen && i18nInfo.I18NUserLang === "zh_CN";
|
38
22
|
|
39
23
|
function _default(props) {
|
40
24
|
var data = props.data,
|
41
25
|
level = props.level;
|
42
26
|
|
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
|
-
|
52
27
|
var onNodeClickHandler = function onNodeClickHandler() {
|
53
28
|
if (data.href) {
|
54
29
|
window.location.href = data.href;
|
55
30
|
}
|
56
31
|
};
|
57
32
|
|
58
|
-
return /*#__PURE__*/_react["default"].createElement(
|
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", {
|
33
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
79
34
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node")),
|
80
35
|
onClick: onNodeClickHandler,
|
81
36
|
title: ""
|
@@ -84,8 +39,8 @@ function _default(props) {
|
|
84
39
|
}), data.icon && /*#__PURE__*/_react["default"].createElement("span", {
|
85
40
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-icon"), data.icon)
|
86
41
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
87
|
-
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-title"),
|
42
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-title"), "noselect")
|
88
43
|
}, props.title), isZn && /*#__PURE__*/_react["default"].createElement("span", {
|
89
44
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__ass-manage-node-suffix"))
|
90
|
-
}))
|
45
|
+
}));
|
91
46
|
}
|
@@ -90,20 +90,16 @@ 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
|
+
setMenus(newMenus);
|
94
94
|
|
95
|
-
|
96
|
-
|
95
|
+
var _getQueryString = (0, _tools.getQueryString)(),
|
96
|
+
_getQueryString$react = _getQueryString.reactRouterName,
|
97
|
+
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
97
98
|
|
98
|
-
|
99
|
-
_getQueryString$react = _getQueryString.reactRouterName,
|
100
|
-
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
99
|
+
var isAppraisalPage = window.location.hash.startsWith('#/performance');
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
if (!reactRouterName && isAppraisalPage) {
|
105
|
-
window.location.href = newMenus[0].data.href;
|
106
|
-
}
|
101
|
+
if (!reactRouterName && isAppraisalPage) {
|
102
|
+
window.location.href = newMenus[0].data.href;
|
107
103
|
}
|
108
104
|
}, [history.location.pathname]); // 判断路由高亮菜单
|
109
105
|
|
@@ -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: 'untitled',
|
107
|
-
label: _i18n.locale.menu_management_ass,
|
108
|
-
key: PAGE_MANAGE_APPRAISAL,
|
109
|
-
type: _index.MENU_ASSESS_MANAGE,
|
110
|
-
href: '#/performance?reactRouterName=manage',
|
111
|
-
isShow: performanceManageAuthority
|
112
105
|
}, {
|
113
106
|
icon: 'uniEA10',
|
114
107
|
label: _i18n.locale.menu_template_ass,
|
@@ -116,6 +109,13 @@ var AppraisalMenus = /*#__PURE__*/function () {
|
|
116
109
|
type: _index.MENU_ASSESS_TEMPLATE,
|
117
110
|
href: '#/performance?reactRouterName=template',
|
118
111
|
isShow: performanceManageAuthority
|
112
|
+
}, {
|
113
|
+
icon: 'untitled',
|
114
|
+
label: _i18n.locale.menu_management_ass,
|
115
|
+
key: PAGE_MANAGE_APPRAISAL,
|
116
|
+
type: _index.MENU_ASSESS_MANAGE,
|
117
|
+
href: '#/performance?reactRouterName=manage',
|
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: 'untitled',
|
185
|
-
label: _i18n.locale.menu_management_ass,
|
186
|
-
key: PAGE_MANAGE_APPRAISAL,
|
187
|
-
type: _index.MENU_ASSESS_MANAGE,
|
188
|
-
href: '#/performance/manage?reactRouterName=manage',
|
189
|
-
isShow: performanceManageAuthority
|
190
|
-
}, {
|
191
184
|
icon: 'uniEA10',
|
192
185
|
label: _i18n.locale.menu_template_ass,
|
193
186
|
key: PAGE_TEMPLATE_APPRAISAL,
|
194
187
|
type: _index.MENU_ASSESS_TEMPLATE,
|
195
188
|
href: '#/performance/manage?reactRouterName=template',
|
196
189
|
isShow: performanceManageAuthority
|
190
|
+
}, {
|
191
|
+
icon: 'untitled',
|
192
|
+
label: _i18n.locale.menu_management_ass,
|
193
|
+
key: PAGE_MANAGE_APPRAISAL,
|
194
|
+
type: _index.MENU_ASSESS_MANAGE,
|
195
|
+
href: '#/performance/manage?reactRouterName=manage',
|
196
|
+
isShow: performanceManageAuthority
|
197
197
|
}, {
|
198
198
|
icon: '',
|
199
199
|
label: _i18n.locale.menu_basesetting,
|
@@ -85,20 +85,16 @@ 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
|
+
setMenus(newMenus);
|
89
89
|
|
90
|
-
|
91
|
-
|
90
|
+
var _getQueryString = (0, _tools.getQueryString)(),
|
91
|
+
_getQueryString$react = _getQueryString.reactRouterName,
|
92
|
+
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
92
93
|
|
93
|
-
|
94
|
-
_getQueryString$react = _getQueryString.reactRouterName,
|
95
|
-
reactRouterName = _getQueryString$react === void 0 ? '' : _getQueryString$react;
|
94
|
+
var isInterviewPage = window.location.hash.indexOf('interview') != -1;
|
96
95
|
|
97
|
-
|
98
|
-
|
99
|
-
if (!reactRouterName && isInterviewPage) {
|
100
|
-
window.location.href = newMenus[0].data.href;
|
101
|
-
}
|
96
|
+
if (!reactRouterName && isInterviewPage) {
|
97
|
+
window.location.href = newMenus[0].data.href;
|
102
98
|
}
|
103
99
|
}, [history.location.pathname]);
|
104
100
|
(0, _react.useEffect)(function () {
|
@@ -1,8 +1,8 @@
|
|
1
|
-
.
|
1
|
+
.dialog-setting-item {
|
2
2
|
display: flex;
|
3
3
|
}
|
4
4
|
|
5
|
-
.
|
5
|
+
.dialog-setting-item__label {
|
6
6
|
color: #89919F;
|
7
7
|
font-size: 14px;
|
8
8
|
line-height: 22px;
|
@@ -13,21 +13,21 @@
|
|
13
13
|
align-items: center;
|
14
14
|
}
|
15
15
|
|
16
|
-
.
|
16
|
+
.dialog-setting-item__content {
|
17
17
|
display: flex;
|
18
18
|
align-items: center;
|
19
19
|
}
|
20
20
|
|
21
|
-
.
|
21
|
+
.dialog-setting-item__text {
|
22
22
|
display: flex;
|
23
23
|
align-items: center;
|
24
24
|
}
|
25
25
|
|
26
|
-
.
|
26
|
+
.dialog-setting-item__text .dialog-setting-item__label {
|
27
27
|
top: unset;
|
28
28
|
white-space: nowrap;
|
29
29
|
}
|
30
30
|
|
31
|
-
.
|
31
|
+
.dialog-setting-item__nofirst {
|
32
32
|
margin-top: 16px;
|
33
33
|
}
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
15
15
|
|
16
16
|
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; }
|
17
17
|
|
18
|
-
var precls = '
|
18
|
+
var precls = 'dialog-setting-item';
|
19
19
|
|
20
20
|
var RegulationSettingItem = function RegulationSettingItem(props) {
|
21
21
|
var label = props.label,
|
@@ -16,11 +16,6 @@
|
|
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
|
-
|
24
19
|
.titaui-switch .tui-switch:focus {
|
25
20
|
box-shadow: unset !important;
|
26
21
|
}
|
@@ -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), /*#__PURE__*/_react["default"].createElement(_rcSwitch["default"], _extends({
|
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: #ccc;
|
69
|
+
border-color: #ccc;
|
70
70
|
}
|
71
71
|
|
72
72
|
.tui-switch-disabled:after {
|
73
|
-
background
|
73
|
+
background: #9e9e9e;
|
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 _styledComponents = _interopRequireDefault(require("styled-components"));
|
13
13
|
|
14
14
|
require("./style/index.css");
|
15
15
|
|
16
|
+
var _templateObject;
|
17
|
+
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17
19
|
|
18
20
|
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); }
|
19
21
|
|
20
22
|
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; }
|
21
23
|
|
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,7 +41,9 @@ 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
|
-
|
44
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
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"])));
|
45
47
|
|
46
48
|
var Radio = /*#__PURE__*/function (_Component) {
|
47
49
|
_inherits(Radio, _Component);
|
@@ -71,12 +73,6 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
71
73
|
|
72
74
|
};
|
73
75
|
|
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
|
-
|
80
76
|
_this.state = {
|
81
77
|
checked: _this.getChecked(props)
|
82
78
|
};
|
@@ -104,29 +100,33 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
104
100
|
}, {
|
105
101
|
key: "render",
|
106
102
|
value: function render() {
|
107
|
-
var
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
onMouseUp:
|
103
|
+
var _this2 = this;
|
104
|
+
|
105
|
+
var _this$props = this.props,
|
106
|
+
children = _this$props.children,
|
107
|
+
checked = _this$props.checked,
|
108
|
+
name = _this$props.name,
|
109
|
+
value = _this$props.value;
|
110
|
+
return /*#__PURE__*/_react["default"].createElement(RadioWrapper, {
|
111
|
+
onMouseUp: function onMouseUp() {
|
112
|
+
_this2.props.onChange && _this2.props.onChange(_this2.props.value);
|
113
|
+
}
|
116
114
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
117
|
-
className:
|
115
|
+
className: "tita-radio"
|
118
116
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
119
|
-
className: "".concat(prefixCls, "__input"),
|
120
|
-
checked: checked,
|
121
|
-
disabled: disabled,
|
122
|
-
name: name,
|
123
|
-
onChange: this.onChange,
|
124
117
|
type: "radio",
|
125
|
-
|
118
|
+
name: name,
|
119
|
+
value: value,
|
120
|
+
className: "tita-radio-input",
|
121
|
+
checked: checked,
|
122
|
+
onChange: this.onChange
|
126
123
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
127
|
-
className: ""
|
124
|
+
className: "tita-radio-inner"
|
128
125
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
129
|
-
className: ""
|
126
|
+
className: "label",
|
127
|
+
style: {
|
128
|
+
fontSize: 12
|
129
|
+
}
|
130
130
|
}, children));
|
131
131
|
}
|
132
132
|
}]);
|
@@ -1,38 +1,28 @@
|
|
1
1
|
.tita-radio {
|
2
|
+
display: inline-block;
|
3
|
+
position: relative;
|
4
|
+
top: 1px;
|
2
5
|
width: 16px;
|
3
6
|
min-width: 16px;
|
4
7
|
height: 16px;
|
5
8
|
min-height: 16px;
|
6
9
|
margin-right: 5px;
|
7
|
-
display: inline-block;
|
8
|
-
position: relative;
|
9
|
-
top: 0;
|
10
10
|
}
|
11
11
|
|
12
|
-
.tita-
|
13
|
-
|
14
|
-
|
15
|
-
color: #36434d;
|
16
|
-
cursor: pointer;
|
17
|
-
display: inline-flex;
|
18
|
-
align-items: center;
|
19
|
-
}
|
20
|
-
|
21
|
-
.tita-radio--disabled {
|
22
|
-
cursor: default;
|
12
|
+
.tita-radio input[type='radio'] {
|
13
|
+
width: 16px;
|
14
|
+
height: 16px;
|
23
15
|
}
|
24
16
|
|
25
|
-
.tita-radio:hover > .tita-
|
17
|
+
.tita-radio:hover > .tita-radio-inner {
|
26
18
|
border: 1px solid #2879ff;
|
27
19
|
}
|
28
20
|
|
29
|
-
.tita-
|
30
|
-
width: 16px;
|
31
|
-
height: 16px;
|
21
|
+
.tita-radio .tita-radio-input {
|
32
22
|
opacity: 0;
|
33
23
|
}
|
34
24
|
|
35
|
-
.tita-
|
25
|
+
.tita-radio .tita-radio-inner {
|
36
26
|
position: absolute;
|
37
27
|
top: 0;
|
38
28
|
left: 0;
|
@@ -44,7 +34,7 @@
|
|
44
34
|
transition: all 300ms;
|
45
35
|
}
|
46
36
|
|
47
|
-
.tita-
|
37
|
+
.tita-radio .tita-radio-inner::after {
|
48
38
|
content: '';
|
49
39
|
position: absolute;
|
50
40
|
top: 2px;
|
@@ -60,33 +50,11 @@
|
|
60
50
|
transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
61
51
|
}
|
62
52
|
|
63
|
-
.tita-
|
53
|
+
.tita-radio .tita-radio-input:checked + .tita-radio-inner {
|
64
54
|
border-color: #2879ff !important;
|
65
55
|
}
|
66
56
|
|
67
|
-
.tita-
|
57
|
+
.tita-radio .tita-radio-input:checked + .tita-radio-inner:after {
|
68
58
|
transform: scale(1);
|
69
59
|
opacity: 1;
|
70
60
|
}
|
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
|
-
}
|