@titaui/pc 1.11.36 → 1.11.39-beta.1
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/avatar/name-avatar/index.css +1 -0
- package/lib/components/avatar/name-avatar/index.js +22 -13
- package/lib/components/avatar/text-avatar/index.css +2 -2
- package/lib/components/avatar/text-avatar/index.js +2 -2
- package/lib/components/button/rect-btn/index.css +45 -11
- package/lib/components/button/rect-btn/index.js +12 -6
- package/lib/components/change-okr-modal/index.js +2 -1
- package/lib/components/checkbox/index.css +3 -3
- package/lib/components/create-okr-modal/index.js +45 -41
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/dialog-confirm/index.css +2 -2
- package/lib/components/drawer/headerAction.js +5 -1
- package/lib/components/drawer/headerDrop.js +42 -4
- package/lib/components/drawer/index.css +33 -0
- package/lib/components/drawer/index.js +26 -3
- package/lib/components/dynamic/new-ui.css +4 -4
- package/lib/components/nav-top/components/menu/img/new.svg +30 -0
- package/lib/components/nav-top/components/menu/img/wecome-temp.png +0 -0
- package/lib/components/nav-top/components/menu/index.css +91 -0
- package/lib/components/nav-top/components/menu/index.js +72 -24
- package/lib/components/nav-top/index.js +6 -2
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +20 -4
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +9 -1
- package/lib/components/okr-detail/components/header/index.js +10 -3
- package/lib/components/okr-detail/components/header/o-name.js +10 -3
- package/lib/components/okr-detail/components/o-classify.js +5 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +13 -14
- package/lib/components/okr-detail/detail-header/constant.js +53 -0
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +98 -43
- package/lib/components/okr-detail/detail-header/delete-confirm/index.css +55 -0
- package/lib/components/okr-detail/detail-header/index.css +11 -0
- package/lib/components/okr-detail/detail-header/index.js +228 -234
- package/lib/components/okr-detail/helper.js +108 -0
- package/lib/components/okr-detail/index.js +21 -4
- package/lib/components/okr-detail/okr-list/index.js +8 -3
- package/lib/components/okr-detail/request-apis.js +10 -4
- package/lib/components/okr-flow/child-node/index.css +1 -1
- package/lib/components/okr-flow/export-modal/index.js +47 -2
- package/lib/components/okr-period-selector/index.js +9 -5
- package/lib/components/okr-period-selector/select-cycle.js +23 -19
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/operation-records/style.js +1 -1
- package/lib/components/task-relation-modal/request-api.js +2 -1
- package/lib/components/task-tree/task-item-node/e-status-dropdown.js +33 -13
- package/lib/components/task-tree/task-item-node/e-task.js +2 -2
- package/lib/components/task-tree/task-item-node/index.css +16 -4
- package/lib/components/textarea/index.css +142 -0
- package/lib/components/textarea/index.js +259 -0
- package/lib/components/time-picker/time-picker.js +34 -102
- package/lib/components/time-picker/timer-picker-input.js +0 -6
- package/lib/components/toast/index.js +5 -3
- package/lib/index.js +40 -0
- package/lib/pages/new-okr-list/header/common.js +52 -0
- package/lib/pages/new-okr-list/header/index.css +45 -0
- package/lib/pages/new-okr-list/header/index.js +38 -16
- package/lib/pages/new-okr-list/header/operate-record.js +131 -0
- package/lib/pages/new-okr-list/index.js +3 -1
- package/lib/pages/new-okr-list/list/index.js +19 -2
- package/lib/pages/new-okr-list/request-api.js +8 -2
- package/lib/pages/okr-map/unsupport-ie/index.js +3 -5
- package/lib/utils/format-time.js +8 -1
- package/lib/utils/open-data.js +5 -1
- package/package.json +1 -1
- package/lib/components/okr-detail/detail-header/delete-confirm/style.js +0 -38
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
.titaui-textArea {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
position: relative;
|
|
4
|
+
min-height: 36px;
|
|
5
|
+
background: #ffffff;
|
|
6
|
+
cursor: text;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 7px 0;
|
|
11
|
+
transition: border 0.2s ease 0.2s, box-shadow 0.2s ease 0.2s;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.titaui-textArea.has-error {
|
|
15
|
+
border: 1px solid #f05e5e !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.titaui-textArea:hover {
|
|
19
|
+
border: 1px solid #2879ff;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.titaui-textArea > input {
|
|
23
|
+
flex-grow: 1;
|
|
24
|
+
border: none;
|
|
25
|
+
padding: 0 12px;
|
|
26
|
+
margin: 0;
|
|
27
|
+
outline: none;
|
|
28
|
+
width: 0;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
color: #3f4755;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.titaui-textArea > input ::-webkit-input-placeholder {
|
|
35
|
+
color: #bfc7d5;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.titaui-textArea > input :-ms-input-placeholder {
|
|
39
|
+
color: #bfc7d5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.titaui-textArea > input :-moz-input-placeholder {
|
|
43
|
+
color: #bfc7d5;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.titaui-textArea textarea {
|
|
47
|
+
flex: 1;
|
|
48
|
+
line-height: 20px;
|
|
49
|
+
min-height: 20px;
|
|
50
|
+
border: none;
|
|
51
|
+
padding: 0;
|
|
52
|
+
margin: 0;
|
|
53
|
+
outline: none;
|
|
54
|
+
resize: none;
|
|
55
|
+
padding: 0 12px;
|
|
56
|
+
width: 100%;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
color: #3f4755;
|
|
60
|
+
word-break: break-all;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.titaui-textArea textarea ::-webkit-input-placeholder {
|
|
64
|
+
color: #bfc7d5;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.titaui-textArea textarea :-ms-input-placeholder {
|
|
68
|
+
color: #bfc7d5;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.titaui-textArea textarea :-moz-input-placeholder {
|
|
72
|
+
color: #bfc7d5;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.titaui-textArea.disabled {
|
|
76
|
+
background-color: rgba(240, 242, 245, 0.4);
|
|
77
|
+
border-color: #f0f2f5;
|
|
78
|
+
color: #bfc7d5;
|
|
79
|
+
cursor: default;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.titaui-textArea.disabled > input,
|
|
83
|
+
.titaui-textArea.disabled textarea,
|
|
84
|
+
.titaui-textArea.disabled .tail-wrapper {
|
|
85
|
+
color: #bfc7d5;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.titaui-textArea.disabled:hover {
|
|
89
|
+
border-color: #f0f2f5;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.area-error {
|
|
93
|
+
border: 1px solid #f05e5e !important;
|
|
94
|
+
box-shadow: 0px 0px 6px 0px rgba(240, 94, 94, 0.3);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.area-focus {
|
|
98
|
+
border: 1px solid #2879ff !important;
|
|
99
|
+
box-shadow: 0px 0px 6px 0px rgba(40, 121, 255, 0.3);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.area-normal {
|
|
103
|
+
border: 1px solid #e9ecf0 !important;
|
|
104
|
+
box-shadow: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.inner {
|
|
108
|
+
overflow: auto;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex: 1;
|
|
111
|
+
width: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.err-color {
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
font-weight: 400;
|
|
117
|
+
color: #f05e5e;
|
|
118
|
+
line-height: 18px;
|
|
119
|
+
padding-left: 12px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.commonTextAreaWrapperTopShadow::before {
|
|
123
|
+
content: '';
|
|
124
|
+
border-radius: 8px;
|
|
125
|
+
height: 30px;
|
|
126
|
+
background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 0;
|
|
129
|
+
width: 100%;
|
|
130
|
+
z-index: 2;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.commonTextAreaWrapperBottomShadow::after {
|
|
134
|
+
content: '';
|
|
135
|
+
border-radius: 8px;
|
|
136
|
+
height: 30px;
|
|
137
|
+
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
|
|
138
|
+
position: absolute;
|
|
139
|
+
bottom: 0;
|
|
140
|
+
width: 100%;
|
|
141
|
+
z-index: 2;
|
|
142
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _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 _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
require("./index.css");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["disabled", "onFocus", "onBlur", "inputRef", "onChange", "className", "value", "placeholder", "maxLine", "maxLength", "initValue", "onErrorChange", "validator", "onKeyDown"];
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
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); }
|
|
21
|
+
|
|
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; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
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."); }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
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
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
var Textarea = function Textarea(p) {
|
|
43
|
+
var disabled = p.disabled,
|
|
44
|
+
_onFocus = p.onFocus,
|
|
45
|
+
_onBlur = p.onBlur,
|
|
46
|
+
inputRef = p.inputRef,
|
|
47
|
+
_onChange = p.onChange,
|
|
48
|
+
className = p.className,
|
|
49
|
+
value = p.value,
|
|
50
|
+
placeholder = p.placeholder,
|
|
51
|
+
_p$maxLine = p.maxLine,
|
|
52
|
+
maxLine = _p$maxLine === void 0 ? 4 : _p$maxLine,
|
|
53
|
+
maxLength = p.maxLength,
|
|
54
|
+
initValue = p.initValue,
|
|
55
|
+
onErrorChange = p.onErrorChange,
|
|
56
|
+
validator = p.validator,
|
|
57
|
+
_onKeyDown = p.onKeyDown,
|
|
58
|
+
others = _objectWithoutProperties(p, _excluded);
|
|
59
|
+
|
|
60
|
+
var prefixCls = "titaui-textArea";
|
|
61
|
+
|
|
62
|
+
var _useState = (0, _react.useState)(false),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
active = _useState2[0],
|
|
65
|
+
setActive = _useState2[1];
|
|
66
|
+
|
|
67
|
+
var _useState3 = (0, _react.useState)(initValue || ""),
|
|
68
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
69
|
+
selfValue = _useState4[0],
|
|
70
|
+
setSelfValue = _useState4[1];
|
|
71
|
+
|
|
72
|
+
var selfInputRef = (0, _react.useRef)();
|
|
73
|
+
var realInputRef = inputRef || selfInputRef;
|
|
74
|
+
var isControlled = ("value" in p);
|
|
75
|
+
var realValue = isControlled ? value : selfValue;
|
|
76
|
+
|
|
77
|
+
var _useState5 = (0, _react.useState)(false),
|
|
78
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
79
|
+
error = _useState6[0],
|
|
80
|
+
setError = _useState6[1];
|
|
81
|
+
|
|
82
|
+
var _useState7 = (0, _react.useState)(""),
|
|
83
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
84
|
+
errorText = _useState8[0],
|
|
85
|
+
setErrorText = _useState8[1];
|
|
86
|
+
|
|
87
|
+
var wrapperRef = (0, _react.useRef)();
|
|
88
|
+
|
|
89
|
+
var _useState9 = (0, _react.useState)(false),
|
|
90
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
91
|
+
validateEnable = _useState10[0],
|
|
92
|
+
setvalidateEnable = _useState10[1];
|
|
93
|
+
|
|
94
|
+
var _useState11 = (0, _react.useState)(false),
|
|
95
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
96
|
+
isTrue = _useState12[0],
|
|
97
|
+
setIsTrue = _useState12[1];
|
|
98
|
+
|
|
99
|
+
var _useState13 = (0, _react.useState)(1),
|
|
100
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
101
|
+
textAreaRows = _useState14[0],
|
|
102
|
+
setTextAreaRows = _useState14[1];
|
|
103
|
+
|
|
104
|
+
var _useState15 = (0, _react.useState)(false),
|
|
105
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
106
|
+
showTopShadow = _useState16[0],
|
|
107
|
+
setShowTopShadow = _useState16[1];
|
|
108
|
+
|
|
109
|
+
var _useState17 = (0, _react.useState)(false),
|
|
110
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
111
|
+
showBottomShadow = _useState18[0],
|
|
112
|
+
setShowBottomShadow = _useState18[1];
|
|
113
|
+
|
|
114
|
+
(0, _react.useEffect)(function () {
|
|
115
|
+
if (!validateEnable) return;
|
|
116
|
+
var hasError = false;
|
|
117
|
+
var eText = "";
|
|
118
|
+
|
|
119
|
+
if (maxLength !== undefined) {
|
|
120
|
+
if (realValue.length > maxLength) {
|
|
121
|
+
hasError = true;
|
|
122
|
+
eText = "\u5DF2\u8F93\u5165 ".concat(realValue.length, " \u4E2A\u5B57\uFF0C\u6700\u591A\u53EF\u8F93\u5165 ").concat(maxLength, " \u4E2A\u5B57");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!hasError && validator) {
|
|
127
|
+
var _validator = validator(realValue),
|
|
128
|
+
isValid = _validator.isValid,
|
|
129
|
+
_errorText = _validator.errorText;
|
|
130
|
+
|
|
131
|
+
if (!isValid) {
|
|
132
|
+
hasError = true;
|
|
133
|
+
eText = _errorText || "";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
setErrorText(eText);
|
|
138
|
+
|
|
139
|
+
if (hasError !== error) {
|
|
140
|
+
if (onErrorChange) {
|
|
141
|
+
onErrorChange(hasError);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
setError(hasError);
|
|
145
|
+
}
|
|
146
|
+
}, [realValue]);
|
|
147
|
+
|
|
148
|
+
var handleShadowVisible = function handleShadowVisible() {
|
|
149
|
+
setTimeout(function () {
|
|
150
|
+
if (realInputRef.current) {
|
|
151
|
+
if (Math.abs(realInputRef.current.scrollHeight - realInputRef.current.offsetHeight) <= 3) {
|
|
152
|
+
setShowTopShadow(false);
|
|
153
|
+
setShowBottomShadow(false);
|
|
154
|
+
} else if (realInputRef.current.scrollTop > 0 && Math.abs(realInputRef.current.scrollHeight - realInputRef.current.scrollTop - realInputRef.current.offsetHeight) > 3) {
|
|
155
|
+
setShowTopShadow(true);
|
|
156
|
+
setShowBottomShadow(true);
|
|
157
|
+
} else if (realInputRef.current.scrollTop > 0) {
|
|
158
|
+
setShowTopShadow(true);
|
|
159
|
+
setShowBottomShadow(false);
|
|
160
|
+
} else {
|
|
161
|
+
setShowTopShadow(false);
|
|
162
|
+
setShowBottomShadow(true);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, 0);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
var resetTextareaHeight = function resetTextareaHeight() {
|
|
169
|
+
setTimeout(function () {
|
|
170
|
+
var rows = realInputRef.current && Math.ceil(realInputRef.current.scrollHeight / 22);
|
|
171
|
+
|
|
172
|
+
if (rows && rows <= maxLine) {
|
|
173
|
+
setTextAreaRows(rows);
|
|
174
|
+
} else {
|
|
175
|
+
setTextAreaRows(maxLine);
|
|
176
|
+
}
|
|
177
|
+
}, 0);
|
|
178
|
+
}; // 鼠标移入
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
var changeMoveOver = function changeMoveOver() {
|
|
182
|
+
setIsTrue(true);
|
|
183
|
+
}; // 鼠标移出
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
var changeMoveOut = function changeMoveOut() {
|
|
187
|
+
setIsTrue(false);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
var areaNormal = isTrue ? "area-focus" : "area-normal";
|
|
191
|
+
var areaFocus = active ? "area-focus" : areaNormal;
|
|
192
|
+
var areaError = error ? "area-error" : areaFocus;
|
|
193
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
194
|
+
className: "\n ".concat(prefixCls, "\n ").concat(areaError, "\n ").concat(disabled ? " disabled" : "", "\n "),
|
|
195
|
+
onFocus: function onFocus() {},
|
|
196
|
+
onBlur: function onBlur() {},
|
|
197
|
+
onMouseOver: changeMoveOver,
|
|
198
|
+
onMouseOut: changeMoveOut,
|
|
199
|
+
ref: wrapperRef,
|
|
200
|
+
onClick: function onClick() {
|
|
201
|
+
var _realInputRef$current;
|
|
202
|
+
|
|
203
|
+
(_realInputRef$current = realInputRef.current) === null || _realInputRef$current === void 0 ? void 0 : _realInputRef$current.focus();
|
|
204
|
+
}
|
|
205
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
206
|
+
className: (0, _classnames["default"])("inner scrollbar-size-sm", {
|
|
207
|
+
commonTextAreaWrapperTopShadow: showTopShadow,
|
|
208
|
+
commonTextAreaWrapperBottomShadow: showBottomShadow
|
|
209
|
+
})
|
|
210
|
+
}, /*#__PURE__*/_react["default"].createElement("textarea", _extends({
|
|
211
|
+
className: "".concat(className, " scrollbar-size-sm"),
|
|
212
|
+
disabled: disabled,
|
|
213
|
+
ref: realInputRef,
|
|
214
|
+
value: realValue,
|
|
215
|
+
rows: textAreaRows,
|
|
216
|
+
placeholder: placeholder,
|
|
217
|
+
onScroll: handleShadowVisible,
|
|
218
|
+
onChange: function onChange(e) {
|
|
219
|
+
if (!isControlled) {
|
|
220
|
+
setSelfValue(e.target.value);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (_onChange) {
|
|
224
|
+
_onChange(e);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
resetTextareaHeight();
|
|
228
|
+
setvalidateEnable(true);
|
|
229
|
+
},
|
|
230
|
+
onFocus: function onFocus(e) {
|
|
231
|
+
setActive(true);
|
|
232
|
+
|
|
233
|
+
if (_onFocus) {
|
|
234
|
+
_onFocus(e);
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
onKeyDown: function onKeyDown(e) {
|
|
238
|
+
if (_onKeyDown) {
|
|
239
|
+
_onKeyDown(e);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (e.keyCode === 13) {
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
onBlur: function onBlur(e) {
|
|
247
|
+
setActive(false);
|
|
248
|
+
|
|
249
|
+
if (_onBlur) {
|
|
250
|
+
_onBlur(e);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}, others)))), error && /*#__PURE__*/_react["default"].createElement("div", {
|
|
254
|
+
className: "err-color"
|
|
255
|
+
}, errorText));
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
var _default = Textarea;
|
|
259
|
+
exports["default"] = _default;
|
|
@@ -79,49 +79,42 @@ var TimePicker = function TimePicker(props) {
|
|
|
79
79
|
var mInputRef = (0, _react.useRef)();
|
|
80
80
|
var minuteRef = (0, _react.useRef)((0, _moment["default"])(value || '00:00', timeFormat).format('mm'));
|
|
81
81
|
var triggerRef = (0, _react.useRef)();
|
|
82
|
-
var timerRef = (0, _react.useRef)();
|
|
83
82
|
var hours = (0, _utils.getHours)(hourStep);
|
|
84
83
|
var minutes = (0, _utils.getMinutes)(minuteStep);
|
|
85
84
|
|
|
86
85
|
var onTimeChange = function onTimeChange() {
|
|
87
|
-
onChange === null || onChange === void 0 ? void 0 : onChange("".concat(hourRef.current, ":").concat(minuteRef.current));
|
|
88
|
-
}; // const onInputClick = (type) => {
|
|
89
|
-
// clearTimeout(timerRef.current)
|
|
90
|
-
// timerRef.current = setTimeout(() => {
|
|
91
|
-
// if (type === 'hour') {
|
|
92
|
-
// hInputRef.current?.focus()
|
|
93
|
-
// } else {
|
|
94
|
-
// mInputRef.current?.focus()
|
|
95
|
-
// }
|
|
96
|
-
// setTimeSettingType(() => type)
|
|
97
|
-
// }, 0)
|
|
98
|
-
// }
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var showSelectorPop = function showSelectorPop() {
|
|
102
|
-
return setVisible(true);
|
|
86
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange("".concat(hourRef.current, ":").concat(minuteRef.current));
|
|
103
87
|
};
|
|
104
88
|
|
|
105
|
-
var
|
|
106
|
-
setTimeSettingType(function () {
|
|
89
|
+
var onInputClickHandler = function onInputClickHandler(type) {
|
|
90
|
+
return setTimeSettingType(function () {
|
|
107
91
|
return type;
|
|
108
92
|
});
|
|
109
93
|
};
|
|
110
94
|
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
95
|
+
var onKeyDownHandler = function onKeyDownHandler(e) {
|
|
96
|
+
var keyCode = e.keyCode;
|
|
97
|
+
|
|
98
|
+
if ([_utils.KEYCODE.directionLeft, _utils.KEYCODE.directionRight].includes(keyCode)) {
|
|
99
|
+
setTimeSettingType(_utils.TargetMapByKeyCode[keyCode]);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if ([_utils.KEYCODE.directionUp, _utils.KEYCODE.directionDown].includes(keyCode)) {
|
|
103
|
+
switch (timeSetingtType) {
|
|
104
|
+
case 'hour':
|
|
105
|
+
hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
|
|
106
|
+
break;
|
|
107
|
+
|
|
108
|
+
case 'minute':
|
|
109
|
+
minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'minute', minuteRef.current);
|
|
110
|
+
break;
|
|
111
|
+
|
|
112
|
+
default:
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
onTimeChange();
|
|
117
|
+
}
|
|
125
118
|
};
|
|
126
119
|
|
|
127
120
|
var onHourInputChange = function onHourInputChange(e) {
|
|
@@ -139,32 +132,6 @@ var TimePicker = function TimePicker(props) {
|
|
|
139
132
|
}
|
|
140
133
|
};
|
|
141
134
|
|
|
142
|
-
var onMinuteInputBlur = function onMinuteInputBlur() {
|
|
143
|
-
// setMinute((prevMinute) => {
|
|
144
|
-
// let nextMinute = minuteRef.current;
|
|
145
|
-
// minutes.forEach((m, i) => {
|
|
146
|
-
// const mNum = Number(m);
|
|
147
|
-
// const nextMinuteNum = Number(nextMinute);
|
|
148
|
-
// if (mNum === nextMinuteNum) {
|
|
149
|
-
// nextMinute = m;
|
|
150
|
-
// } else if (
|
|
151
|
-
// mNum < nextMinuteNum
|
|
152
|
-
// && Number(minutes[i + 1]) > nextMinuteNum
|
|
153
|
-
// ) {
|
|
154
|
-
// nextMinute = m;
|
|
155
|
-
// } else if (nextMinuteNum > Number(minutes[minutes.length - 1])) {
|
|
156
|
-
// nextMinute = "00";
|
|
157
|
-
// }
|
|
158
|
-
// });
|
|
159
|
-
// minuteRef.current = nextMinute;
|
|
160
|
-
// });
|
|
161
|
-
// if (timeSetType === "minute" && mInputRef.current) {
|
|
162
|
-
// mInputRef.current.focus();
|
|
163
|
-
// }
|
|
164
|
-
// onTimeChange();
|
|
165
|
-
setTimeSettingType('');
|
|
166
|
-
};
|
|
167
|
-
|
|
168
135
|
var onMinuteInputChange = function onMinuteInputChange(e) {
|
|
169
136
|
var v = e.target.value;
|
|
170
137
|
|
|
@@ -225,39 +192,10 @@ var TimePicker = function TimePicker(props) {
|
|
|
225
192
|
return currTime;
|
|
226
193
|
};
|
|
227
194
|
|
|
228
|
-
var
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if ([_utils.KEYCODE.directionLeft, _utils.KEYCODE.directionRight].includes(keyCode)) {
|
|
232
|
-
setTimeSettingType(_utils.TargetMapByKeyCode[keyCode]);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if ([_utils.KEYCODE.directionUp, _utils.KEYCODE.directionDown].includes(keyCode)) {
|
|
236
|
-
switch (timeSetingtType) {
|
|
237
|
-
case 'hour':
|
|
238
|
-
hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
|
|
239
|
-
break;
|
|
240
|
-
|
|
241
|
-
case 'minute':
|
|
242
|
-
minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'minute', minuteRef.current);
|
|
243
|
-
break;
|
|
244
|
-
|
|
245
|
-
default:
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
onTimeChange();
|
|
250
|
-
}
|
|
195
|
+
var showSelectorPop = function showSelectorPop() {
|
|
196
|
+
return setVisible(true);
|
|
251
197
|
};
|
|
252
198
|
|
|
253
|
-
(0, _react.useEffect)(function () {
|
|
254
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
255
|
-
enableKeyBoard && timeSetingtType && document.addEventListener('keydown', handleKeyDown);
|
|
256
|
-
return function () {
|
|
257
|
-
clearTimeout(timerRef.current);
|
|
258
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
259
|
-
};
|
|
260
|
-
}, [timeSetingtType]);
|
|
261
199
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
262
200
|
className: _utils.TimePickerClass
|
|
263
201
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -268,36 +206,30 @@ var TimePicker = function TimePicker(props) {
|
|
|
268
206
|
onClick: function onClick() {
|
|
269
207
|
return !enableKeyBoard && showSelectorPop();
|
|
270
208
|
}
|
|
271
|
-
}, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
|
|
209
|
+
}, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], _extends({
|
|
272
210
|
className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
|
|
273
211
|
active: enableKeyBoard && timeSetingtType === 'hour'
|
|
274
212
|
}),
|
|
275
213
|
disabled: disabled,
|
|
276
214
|
maxLength: 2,
|
|
277
|
-
onBlur: onHourInputBlur,
|
|
278
215
|
onChange: onHourInputChange,
|
|
279
216
|
onClick: function onClick() {
|
|
280
|
-
return
|
|
281
|
-
},
|
|
282
|
-
onFocus: function onFocus() {
|
|
283
|
-
return onFocusHandler('hour');
|
|
217
|
+
return onInputClickHandler('hour');
|
|
284
218
|
},
|
|
219
|
+
onKeyDown: onKeyDownHandler,
|
|
285
220
|
ref: hInputRef,
|
|
286
221
|
value: hourRef.current
|
|
287
|
-
}), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
|
|
222
|
+
}, restProps)), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
|
|
288
223
|
className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
|
|
289
224
|
active: enableKeyBoard && timeSetingtType === 'minute'
|
|
290
225
|
}),
|
|
291
226
|
disabled: disabled,
|
|
292
227
|
maxLength: 2,
|
|
293
|
-
onBlur: onMinuteInputBlur,
|
|
294
228
|
onChange: onMinuteInputChange,
|
|
295
229
|
onClick: function onClick() {
|
|
296
|
-
return
|
|
297
|
-
},
|
|
298
|
-
onFocus: function onFocus() {
|
|
299
|
-
return onFocusHandler('minute');
|
|
230
|
+
return onInputClickHandler('minute');
|
|
300
231
|
},
|
|
232
|
+
onKeyDown: onKeyDownHandler,
|
|
301
233
|
ref: mInputRef,
|
|
302
234
|
value: minuteRef.current
|
|
303
235
|
})), !disabled && /*#__PURE__*/_react["default"].createElement(_timePickerSelector["default"], _extends({
|
|
@@ -57,11 +57,6 @@ var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
57
57
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
var onFocusHandler = function onFocusHandler(e) {
|
|
61
|
-
setSelectionRange(0);
|
|
62
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
60
|
var onChangeHandler = function onChangeHandler(e) {
|
|
66
61
|
return onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
67
62
|
};
|
|
@@ -86,7 +81,6 @@ var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
86
81
|
maxLength: maxLength,
|
|
87
82
|
onClick: onClickHandler,
|
|
88
83
|
onChange: onChangeHandler,
|
|
89
|
-
onFocus: onFocusHandler,
|
|
90
84
|
ref: inputRef,
|
|
91
85
|
type: type,
|
|
92
86
|
value: value
|
|
@@ -168,6 +168,7 @@ var Toast = /*#__PURE__*/function () {
|
|
|
168
168
|
var options,
|
|
169
169
|
key,
|
|
170
170
|
ins,
|
|
171
|
+
canClose,
|
|
171
172
|
_args3 = arguments;
|
|
172
173
|
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
173
174
|
while (1) {
|
|
@@ -180,14 +181,15 @@ var Toast = /*#__PURE__*/function () {
|
|
|
180
181
|
|
|
181
182
|
case 4:
|
|
182
183
|
ins = _context3.sent;
|
|
184
|
+
canClose = options.canClose !== undefined ? options.canClose : false;
|
|
183
185
|
ins.notice({
|
|
184
|
-
content: (0, _SuccessRender.RenderError)(msg, key,
|
|
186
|
+
content: (0, _SuccessRender.RenderError)(msg, key, canClose, ins),
|
|
185
187
|
style: options.style,
|
|
186
|
-
duration: options.duration ||
|
|
188
|
+
duration: options.duration || canClose === false ? 3 : 3000,
|
|
187
189
|
key: key
|
|
188
190
|
});
|
|
189
191
|
|
|
190
|
-
case
|
|
192
|
+
case 7:
|
|
191
193
|
case "end":
|
|
192
194
|
return _context3.stop();
|
|
193
195
|
}
|