@titaui/pc 1.7.100 → 1.8.2
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/dialog/index.css +4 -0
- package/lib/components/dialog/index.js +7 -6
- package/lib/components/form/form-fields/input/index.css +19 -5
- package/lib/components/form/form-fields/input/index.js +11 -8
- package/lib/components/form/form-fields/input-verification-code/index.css +117 -0
- package/lib/components/form/form-fields/input-verification-code/index.js +230 -0
- package/lib/components/form/form-fields/password/index.css +2 -2
- package/lib/components/form/form-fields/radios/index.js +1 -1
- package/lib/components/form/index.js +4 -1
- package/lib/components/grid-layout/near-visitors/index.js +4 -2
- package/lib/components/grid-layout/okr-align/index.js +4 -4
- package/lib/components/grid-layout/okr-progress/index.js +6 -6
- package/lib/components/grid-layout/okr-target/index.js +2 -2
- package/lib/components/grid-layout/over-view/index.js +1 -1
- package/lib/components/grid-layout/personal-info/index.js +5 -3
- package/lib/components/grid-layout/sub-employee-okr/index.js +1 -1
- package/lib/components/grid-layout/week-task/index.js +4 -4
- package/lib/components/grid-layout/words-cloud/index.js +5 -3
- package/lib/components/grid-page/personal-info/index.js +5 -3
- package/lib/components/img-viewer/index.js +1 -1
- package/lib/components/mblog/style.js +4 -4
- package/lib/components/nav-top/components/user-message/components/empty/index.js +4 -2
- package/lib/components/nav-top/components/user-message/msg/index.js +1 -1
- package/lib/components/okr-detail/base-info/base-info.js +4 -3
- package/lib/components/okr-detail/base-info/o-desc/index.js +2 -8
- package/lib/components/point-demo/constant.js +1 -3
- package/lib/components/point-demo/drop-down-box/index.js +1 -3
- package/lib/components/point-demo/index.js +8 -10
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +1 -1
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +2 -1
- package/lib/components/table/index.css +4 -0
- package/lib/components/table/index.js +3 -0
- package/lib/components/upload-photo-modal/constant.js +99 -0
- package/lib/components/upload-photo-modal/img/browser-preview-bgc.png +0 -0
- package/lib/components/upload-photo-modal/index.css +276 -0
- package/lib/components/upload-photo-modal/index.js +332 -0
- package/lib/components/upload-photo-modal/request-api.js +44 -0
- package/lib/components/user-selector/category-selector-panel/depart-tree.js +3 -0
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +1 -1
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +2 -0
- package/lib/components/user-selector/request-apis.js +1 -1
- package/lib/components/word-cloud/index.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +1 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +1 -1
- package/lib/index.js +8 -0
- package/lib/pages/home/components/data-list/index.js +2 -2
- package/lib/pages/home/components/data-list/nav-selector/index.js +2 -2
- package/lib/pages/home/components/data-list/table/columns/index.js +1 -1
- package/lib/pages/home/components/guide/index.js +14 -12
- package/lib/pages/home/components/header/index.js +3 -1
- package/lib/pages/home-page-data-list/index.js +2 -2
- package/lib/pages/personal-info/components/base-info/index.css +36 -1
- package/lib/pages/personal-info/components/base-info/index.js +22 -90
- package/lib/pages/personal-info/components/edit-info/index.js +192 -0
- package/lib/pages/personal-info/components/edit-info/input/index.css +89 -0
- package/lib/pages/personal-info/components/edit-info/input/index.js +199 -0
- package/lib/pages/personal-info/components/person-photo/index.css +88 -0
- package/lib/pages/personal-info/components/person-photo/index.js +86 -0
- package/lib/pages/personal-info/index.js +3 -1
- package/package.json +3 -1
- package/src/components/dialog/index.js +2 -1
- package/src/components/dialog/index.scss +3 -0
- package/src/components/form/form-fields/input/index.scss +16 -5
- package/src/components/form/form-fields/input/index.tsx +9 -4
- package/src/components/form/form-fields/input-verification-code/index.scss +108 -0
- package/src/components/form/form-fields/input-verification-code/index.tsx +171 -0
- package/src/components/form/form-fields/password/index.scss +2 -2
- package/src/components/form/form-fields/radios/index.tsx +2 -2
- package/src/components/form/index.tsx +2 -0
- package/src/components/grid-layout/near-visitors/index.tsx +3 -2
- package/src/components/grid-layout/okr-align/index.tsx +4 -4
- package/src/components/grid-layout/okr-progress/index.tsx +6 -6
- package/src/components/grid-layout/okr-target/index.tsx +2 -2
- package/src/components/grid-layout/over-view/index.tsx +1 -1
- package/src/components/grid-layout/personal-info/index.tsx +4 -3
- package/src/components/grid-layout/sub-employee-okr/index.tsx +1 -1
- package/src/components/grid-layout/week-task/index.tsx +3 -3
- package/src/components/grid-layout/words-cloud/index.tsx +4 -3
- package/src/components/grid-page/personal-info/index.tsx +4 -3
- package/src/components/img-viewer/index.tsx +1 -1
- package/src/components/mblog/style.ts +5 -5
- package/src/components/nav-top/components/user-message/components/empty/index.tsx +3 -2
- package/src/components/nav-top/components/user-message/msg/index.tsx +1 -1
- package/src/components/okr-detail/base-info/base-info.tsx +2 -4
- package/src/components/okr-detail/base-info/o-desc/index.tsx +0 -7
- package/src/components/point-demo/constant.ts +1 -3
- package/src/components/point-demo/drop-down-box/index.js +1 -2
- package/src/components/point-demo/index.js +8 -9
- package/src/components/publish-dynamic-modal/publish-dynamic-modal.scss +1 -1
- package/src/components/publish-dynamic-modal/publish-dynamic-modal.tsx +1 -0
- package/src/components/table/index.js +1 -0
- package/src/components/table/index.scss +5 -0
- package/src/components/upload-photo-modal/constant.ts +71 -0
- package/src/components/upload-photo-modal/img/browser-preview-bgc.png +0 -0
- package/src/components/upload-photo-modal/index.scss +248 -0
- package/src/components/upload-photo-modal/index.tsx +236 -0
- package/src/components/upload-photo-modal/request-api.ts +23 -0
- package/src/components/user-selector/category-selector-panel/depart-tree.tsx +3 -2
- package/src/components/user-selector/export-modules/field-tree-selector/index.scss +1 -1
- package/src/components/user-selector/export-modules/field-tree-selector/index.tsx +3 -0
- package/src/components/user-selector/request-apis.js +1 -1
- package/src/components/word-cloud/index.js +1 -1
- package/src/components-v1/userSelector/components/MultiMode/CommonList.tsx +1 -1
- package/src/components-v1/userSelector/components/MultiMode/DepartmentList.tsx +1 -1
- package/src/components-v1/userSelector/components/MultiMode/SubsList.tsx +1 -1
- package/src/components-v1/userSelector/components/SingleMode.tsx +1 -1
- package/src/index.js +1 -0
- package/src/pages/home/components/data-list/index.tsx +2 -2
- package/src/pages/home/components/data-list/nav-selector/index.tsx +2 -2
- package/src/pages/home/components/data-list/table/columns/index.tsx +1 -1
- package/src/pages/home/components/guide/index.tsx +13 -12
- package/src/pages/home/components/header/index.tsx +2 -1
- package/src/pages/home-page-data-list/index.tsx +2 -2
- package/src/pages/personal-info/components/base-info/index.scss +30 -1
- package/src/pages/personal-info/components/base-info/index.tsx +26 -97
- package/src/pages/personal-info/components/edit-info/index.tsx +152 -0
- package/src/pages/personal-info/components/edit-info/input/index.scss +82 -0
- package/src/pages/personal-info/components/edit-info/input/index.tsx +145 -0
- package/src/pages/personal-info/components/person-photo/index.scss +80 -0
- package/src/pages/personal-info/components/person-photo/index.tsx +49 -0
- package/src/pages/personal-info/index.tsx +2 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.edit-base-info-input {
|
|
2
|
+
display: flex;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
padding: 0 32px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
margin-bottom: 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.edit-base-info-input__label {
|
|
10
|
+
width: 56px;
|
|
11
|
+
height: 22px;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
margin-bottom: 5px;
|
|
14
|
+
margin-right: 20px;
|
|
15
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
line-height: 22px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.edit-base-info-input__label-text {
|
|
21
|
+
color: #89919F;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.edit-base-info-input__label-require {
|
|
25
|
+
color: red;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.edit-base-info-input__border {
|
|
29
|
+
flex: 1;
|
|
30
|
+
padding: 6px 12px;
|
|
31
|
+
transition: all 0.2s;
|
|
32
|
+
border: 1px solid #e9ecf0;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.edit-base-info-input__border--disabled {
|
|
38
|
+
background-color: #fafafa;
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.edit-base-info-input__border--disabled input:disabled {
|
|
43
|
+
background-color: #fafafa;
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
color: #3f475594;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.edit-base-info-input__border--error {
|
|
49
|
+
box-shadow: inset 0px 0px 4px 0px rgba(240, 94, 94, 0.3) !important;
|
|
50
|
+
border: 1px solid #f05e5e !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.edit-base-info-input__border--active {
|
|
54
|
+
box-shadow: inset 0px 0px 4px 0px rgba(40, 121, 255, 0.3);
|
|
55
|
+
border: 1px solid #2879ff;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.edit-base-info-input__input {
|
|
59
|
+
display: inline-block;
|
|
60
|
+
padding: 0;
|
|
61
|
+
width: calc(100% - 12px);
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
color: #3f4755;
|
|
66
|
+
height: 22px;
|
|
67
|
+
line-height: inherit;
|
|
68
|
+
border: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.edit-base-info-input__input::-webkit-input-placeholder {
|
|
72
|
+
color: #bfc7d5;
|
|
73
|
+
font-weight: unset;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.edit-base-info-input__input::-moz-placeholder {
|
|
77
|
+
color: #bfc7d5;
|
|
78
|
+
font-weight: unset;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.edit-base-info-input__input:-moz-placeholder {
|
|
82
|
+
color: #bfc7d5;
|
|
83
|
+
font-weight: unset;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.edit-base-info-input__input:-ms-input-placeholder {
|
|
87
|
+
color: #bfc7d5;
|
|
88
|
+
font-weight: unset;
|
|
89
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _errorTip = _interopRequireDefault(require("../../../../../components/tooltip/error-tip"));
|
|
15
|
+
|
|
16
|
+
require("./index.css");
|
|
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 _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; }
|
|
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
|
+
var preCls = 'edit-base-info-input';
|
|
39
|
+
|
|
40
|
+
var OverlayInner = function OverlayInner(_ref) {
|
|
41
|
+
var hasError = _ref.hasError,
|
|
42
|
+
hasActive = _ref.hasActive,
|
|
43
|
+
tip = _ref.tip;
|
|
44
|
+
if (hasError) return /*#__PURE__*/_react["default"].createElement("span", {
|
|
45
|
+
style: {
|
|
46
|
+
'color': '#F05E5E'
|
|
47
|
+
}
|
|
48
|
+
}, tip);
|
|
49
|
+
if (hasActive) return /*#__PURE__*/_react["default"].createElement("span", {
|
|
50
|
+
style: {
|
|
51
|
+
'color': '#3F4755'
|
|
52
|
+
}
|
|
53
|
+
}, tip);
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement("span", null);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var popupAlign = {
|
|
58
|
+
offset: [-12, -4],
|
|
59
|
+
overflow: {
|
|
60
|
+
adjustX: true,
|
|
61
|
+
adjustY: true
|
|
62
|
+
},
|
|
63
|
+
targetOffset: [0, 0]
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
67
|
+
var _classNames;
|
|
68
|
+
|
|
69
|
+
var label = props.label,
|
|
70
|
+
verifies = props.verifies,
|
|
71
|
+
placeholder = props.placeholder,
|
|
72
|
+
onChange = props.onChange,
|
|
73
|
+
require = props.require,
|
|
74
|
+
type = props.type,
|
|
75
|
+
name = props.name,
|
|
76
|
+
disabled = props.disabled,
|
|
77
|
+
getContainer = props.getContainer;
|
|
78
|
+
var inputRef = (0, _react.useRef)();
|
|
79
|
+
|
|
80
|
+
var _useState = (0, _react.useState)(false),
|
|
81
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
82
|
+
hasError = _useState2[0],
|
|
83
|
+
setHasError = _useState2[1];
|
|
84
|
+
|
|
85
|
+
var _useState3 = (0, _react.useState)(false),
|
|
86
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
+
hasActive = _useState4[0],
|
|
88
|
+
setHasActive = _useState4[1];
|
|
89
|
+
|
|
90
|
+
var _useState5 = (0, _react.useState)(''),
|
|
91
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
92
|
+
tip = _useState6[0],
|
|
93
|
+
setTip = _useState6[1];
|
|
94
|
+
|
|
95
|
+
var _useState7 = (0, _react.useState)(props.value || ''),
|
|
96
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
97
|
+
value = _useState8[0],
|
|
98
|
+
setValue = _useState8[1];
|
|
99
|
+
|
|
100
|
+
(0, _react.useEffect)(function () {
|
|
101
|
+
setValue(props.value);
|
|
102
|
+
}, [props.value]);
|
|
103
|
+
|
|
104
|
+
var _verifing = function verifing() {
|
|
105
|
+
var value = inputRef.current && inputRef.current.value;
|
|
106
|
+
if (!verifies || !verifies.length) return [];
|
|
107
|
+
if (!require && !value) return [];
|
|
108
|
+
var errors = [];
|
|
109
|
+
|
|
110
|
+
for (var i = 0; i < verifies.length; i++) {
|
|
111
|
+
var _verifies$i = verifies[i],
|
|
112
|
+
test = _verifies$i.test,
|
|
113
|
+
_tip = _verifies$i.tip;
|
|
114
|
+
|
|
115
|
+
if (!value.match(test)) {
|
|
116
|
+
errors.push({
|
|
117
|
+
name: name,
|
|
118
|
+
tip: _tip
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return errors;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var onInputFocusHandler = function onInputFocusHandler() {
|
|
127
|
+
setHasActive(true);
|
|
128
|
+
inputRef.current.setSelectionRange(9999999, 9999999);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
var onBlurHandler = function onBlurHandler() {
|
|
132
|
+
setHasActive(false);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var onChangeHandler = function onChangeHandler() {
|
|
136
|
+
var value = inputRef.current && inputRef.current.value;
|
|
137
|
+
onChange && onChange(value);
|
|
138
|
+
setValue(value);
|
|
139
|
+
|
|
140
|
+
var errors = _verifing();
|
|
141
|
+
|
|
142
|
+
if (errors.length) {
|
|
143
|
+
setHasError(true);
|
|
144
|
+
setTip(errors[0].tip);
|
|
145
|
+
} else {
|
|
146
|
+
setHasError(false);
|
|
147
|
+
setTip('');
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
152
|
+
return {
|
|
153
|
+
'verifing': function verifing() {
|
|
154
|
+
var errors = _verifing();
|
|
155
|
+
|
|
156
|
+
if (errors.length) {
|
|
157
|
+
setHasError(true);
|
|
158
|
+
setTip(errors[0].tip);
|
|
159
|
+
inputRef.current.focus();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return errors;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
167
|
+
className: (0, _classnames["default"])(preCls)
|
|
168
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
|
+
className: (0, _classnames["default"])("".concat(preCls, "__label"))
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
171
|
+
className: (0, _classnames["default"])("".concat(preCls, "__label-text"))
|
|
172
|
+
}, label)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
173
|
+
className: (0, _classnames["default"])("".concat(preCls, "__border"), (_classNames = {}, _defineProperty(_classNames, "".concat(preCls, "__border--error"), hasError), _defineProperty(_classNames, "".concat(preCls, "__border--active"), hasActive), _defineProperty(_classNames, "".concat(preCls, "__border--disabled"), disabled), _classNames))
|
|
174
|
+
}, /*#__PURE__*/_react["default"].createElement(_errorTip["default"], {
|
|
175
|
+
placement: 'topLeft',
|
|
176
|
+
popupAlign: popupAlign,
|
|
177
|
+
destroyTooltipOnHide: true,
|
|
178
|
+
visible: (hasActive || hasError) && tip,
|
|
179
|
+
overlay: /*#__PURE__*/_react["default"].createElement(OverlayInner, {
|
|
180
|
+
hasActive: hasActive,
|
|
181
|
+
hasError: hasError,
|
|
182
|
+
tip: tip
|
|
183
|
+
}),
|
|
184
|
+
getTooltipContainer: getContainer
|
|
185
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
186
|
+
ref: inputRef,
|
|
187
|
+
type: type,
|
|
188
|
+
disabled: disabled,
|
|
189
|
+
className: (0, _classnames["default"])("".concat(preCls, "__input")),
|
|
190
|
+
value: value,
|
|
191
|
+
placeholder: placeholder,
|
|
192
|
+
onFocus: onInputFocusHandler,
|
|
193
|
+
onBlur: onBlurHandler,
|
|
194
|
+
onChange: onChangeHandler,
|
|
195
|
+
autoComplete: "off"
|
|
196
|
+
}))));
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
.titaui-personal-info-person-photo {
|
|
4
|
+
background: #ffffff;
|
|
5
|
+
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
|
|
6
|
+
border-radius: 12px;
|
|
7
|
+
padding: 20px 32px;
|
|
8
|
+
margin-top: 10px;
|
|
9
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.titaui-personal-info-person-photo__header {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
margin-bottom: 12px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.titaui-personal-info-person-photo__header-title {
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
color: #141c28;
|
|
23
|
+
line-height: 24px;
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.titaui-personal-info-person-photo__header-title::before {
|
|
30
|
+
content: "";
|
|
31
|
+
width: 4px;
|
|
32
|
+
height: 16px;
|
|
33
|
+
background: linear-gradient(90deg, #4e90ff 0%, #2879ff 100%);
|
|
34
|
+
border-radius: 2px;
|
|
35
|
+
display: inline-block;
|
|
36
|
+
position: absolute;
|
|
37
|
+
left: -8px;
|
|
38
|
+
top: 3px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.titaui-personal-info-person-photo__main {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.titaui-personal-info-person-photo__main-mask {
|
|
47
|
+
position: absolute;
|
|
48
|
+
width: 160px;
|
|
49
|
+
height: 32px;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
padding: 7px 52px;
|
|
52
|
+
background: rgba(20, 28, 40, 0.5);
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
color: #FFFFFF;
|
|
55
|
+
line-height: 18px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.titaui-personal-info-person-photo__main > span {
|
|
59
|
+
margin-left: 24px;
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
color: #A4ACB9;
|
|
62
|
+
line-height: 20px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.titaui-personal-info-person-photo .titaui-pc-avator-container {
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.titaui-personal-info-person-photo .titaui-pc-avator-wrapper::before {
|
|
70
|
+
position: absolute;
|
|
71
|
+
bottom: 0;
|
|
72
|
+
display: block;
|
|
73
|
+
content: "点击修改";
|
|
74
|
+
width: 160px;
|
|
75
|
+
height: 32px;
|
|
76
|
+
background: rgba(20, 28, 40, 0.5);
|
|
77
|
+
color: #FFFFFF;
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
line-height: 18px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
padding: 7px 0;
|
|
83
|
+
backdrop-filter: blur(4px);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.titaui-personal-info-person-photo .titaui-pc-avator-wrapper:hover::before {
|
|
87
|
+
background: rgba(20, 28, 40, 0.4);
|
|
88
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 _bsGlobal = require("../../../../utils/bs-global");
|
|
13
|
+
|
|
14
|
+
var _avatar = _interopRequireDefault(require("../../../../components/avatar"));
|
|
15
|
+
|
|
16
|
+
var _uploadPhotoModal = _interopRequireDefault(require("../../../../components/upload-photo-modal"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
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
|
+
var prefix = 'titaui-personal-info-person-photo';
|
|
39
|
+
|
|
40
|
+
var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
|
|
41
|
+
Id = _getUserInfo.Id,
|
|
42
|
+
Name = _getUserInfo.Name,
|
|
43
|
+
UserAvatar = _getUserInfo.UserAvatar;
|
|
44
|
+
|
|
45
|
+
var PersonPhoto = function PersonPhoto() {
|
|
46
|
+
var _useState = (0, _react.useState)(false),
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
visible = _useState2[0],
|
|
49
|
+
setVisible = _useState2[1];
|
|
50
|
+
|
|
51
|
+
var handleChangePhoto = function handleChangePhoto() {
|
|
52
|
+
setVisible(true);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var handleCancel = function handleCancel() {
|
|
56
|
+
setVisible(false);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
|
+
className: prefix
|
|
61
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
|
+
className: "".concat(prefix, "__header")
|
|
63
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
64
|
+
className: "".concat(prefix, "__header-title")
|
|
65
|
+
}, "\u4E0A\u4F20\u5934\u50CF")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
|
+
className: "".concat(prefix, "__main")
|
|
67
|
+
}, /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
|
|
68
|
+
userId: Id,
|
|
69
|
+
name: Name,
|
|
70
|
+
color: UserAvatar.Color,
|
|
71
|
+
src: UserAvatar.Large,
|
|
72
|
+
size: {
|
|
73
|
+
width: 160,
|
|
74
|
+
textNum: 1,
|
|
75
|
+
fontSize: 24
|
|
76
|
+
},
|
|
77
|
+
onClick: handleChangePhoto
|
|
78
|
+
}), /*#__PURE__*/_react["default"].createElement("span", null, "\xB7 \u5EFA\u8BAE\u56FE\u7247\u6700\u5C0F\u5C3A\u5BF8 150*150px")), /*#__PURE__*/_react["default"].createElement(_uploadPhotoModal["default"], {
|
|
79
|
+
visible: visible,
|
|
80
|
+
onCancel: handleCancel,
|
|
81
|
+
type: "person"
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var _default = PersonPhoto;
|
|
86
|
+
exports["default"] = _default;
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _baseInfo = _interopRequireDefault(require("./components/base-info"));
|
|
11
11
|
|
|
12
|
+
var _personPhoto = _interopRequireDefault(require("./components/person-photo"));
|
|
13
|
+
|
|
12
14
|
var _aha = _interopRequireDefault(require("../aha2021"));
|
|
13
15
|
|
|
14
16
|
require("./index.css");
|
|
@@ -20,7 +22,7 @@ var prefix = "titaui-personal-info";
|
|
|
20
22
|
var PersonalInfo = function PersonalInfo() {
|
|
21
23
|
return /*#__PURE__*/_react["default"].createElement(_aha["default"].ContentTemplate, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
22
24
|
className: prefix
|
|
23
|
-
}, /*#__PURE__*/_react["default"].createElement(_baseInfo["default"], null)));
|
|
25
|
+
}, /*#__PURE__*/_react["default"].createElement(_baseInfo["default"], null), /*#__PURE__*/_react["default"].createElement(_personPhoto["default"], null)));
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
var _default = PersonalInfo;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"rc-cascader": "^2.2.0",
|
|
82
82
|
"rc-checkbox": "^2.3.2",
|
|
83
83
|
"rc-color-picker": "^1.2.6",
|
|
84
|
+
"rc-cropper": "^1.3.1",
|
|
84
85
|
"rc-dialog": "8.5.2",
|
|
85
86
|
"rc-drawer": "^4.3.1",
|
|
86
87
|
"rc-input-number": "^5.0.0",
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
"rc-util": "^5.13.1",
|
|
98
99
|
"react-collapse": "^5.1.0",
|
|
99
100
|
"react-content-loader": "^6.0.3",
|
|
101
|
+
"react-cropper": "^2.1.8",
|
|
100
102
|
"react-custom-scrollbars": "^4.2.1",
|
|
101
103
|
"react-grid-layout": "^1.2.5",
|
|
102
104
|
"react-sizeme": "^3.0.1",
|
|
@@ -22,6 +22,7 @@ export default props => {
|
|
|
22
22
|
visible,
|
|
23
23
|
extraClass=[],
|
|
24
24
|
extendFooterBtn,
|
|
25
|
+
disabled,
|
|
25
26
|
...restProps
|
|
26
27
|
} = props;
|
|
27
28
|
|
|
@@ -30,7 +31,7 @@ export default props => {
|
|
|
30
31
|
<span key="cancel" className={classNames(`${preCls}__btn`, `${preCls}__btn-cancel`)} onClick={onCancel}>
|
|
31
32
|
<span className={classNames(`${preCls}__btn-cancel-text`)}>{cancelText}</span>
|
|
32
33
|
</span>,
|
|
33
|
-
<span key="ok" className={classNames(`${preCls}__btn`, `${preCls}__btn-ok`)} onClick={onOk}>
|
|
34
|
+
<span key="ok" className={classNames(`${preCls}__btn`, `${preCls}__btn-ok`, {[`${preCls}__btn-ok-not-allowed`]:disabled})} onClick={onOk}>
|
|
34
35
|
<span className={classNames(`${preCls}__btn-ok-text`)}>{okText}</span>
|
|
35
36
|
</span>
|
|
36
37
|
];
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
.form-field-input {
|
|
2
|
+
&-row{
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
.form-field-input__label{
|
|
6
|
+
margin-bottom: unset;
|
|
7
|
+
}
|
|
8
|
+
.form-field-input__border{
|
|
9
|
+
margin-left: 16px;
|
|
10
|
+
flex: 1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
2
13
|
&__label {
|
|
3
14
|
height: 22px;
|
|
4
15
|
font-size: 14px;
|
|
@@ -18,7 +29,7 @@
|
|
|
18
29
|
|
|
19
30
|
&__border {
|
|
20
31
|
padding: 6px 12px;
|
|
21
|
-
border-radius:
|
|
32
|
+
border-radius: 8px;
|
|
22
33
|
transition: all 0.2s;
|
|
23
34
|
border: 1px solid #e9ecf0;
|
|
24
35
|
box-sizing: border-box;
|
|
@@ -34,12 +45,12 @@
|
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
47
|
&__border--error {
|
|
37
|
-
box-shadow: inset 0px 0px 4px 0px rgba(240, 94, 94, 0.3)
|
|
38
|
-
border: 1px solid #f05e5e
|
|
48
|
+
box-shadow: inset 0px 0px 4px 0px rgba(240, 94, 94, 0.3) ;
|
|
49
|
+
border: 1px solid #f05e5e ;
|
|
39
50
|
}
|
|
40
51
|
&__border--active {
|
|
41
|
-
box-shadow: inset 0px 0px 4px 0px rgba(40, 121, 255, 0.3);
|
|
42
|
-
border: 1px solid #2879ff;
|
|
52
|
+
box-shadow: inset 0px 0px 4px 0px rgba(40, 121, 255, 0.3) !important;
|
|
53
|
+
border: 1px solid #2879ff !important;
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
&__input {
|
|
@@ -19,7 +19,9 @@ interface Props {
|
|
|
19
19
|
type?: string;
|
|
20
20
|
name: string;
|
|
21
21
|
getContainer?: Function;
|
|
22
|
-
disabled?: boolean
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
layout?: 'clomn'|'row';
|
|
24
|
+
className?:string;
|
|
23
25
|
}
|
|
24
26
|
interface Error {
|
|
25
27
|
name: string;
|
|
@@ -27,8 +29,9 @@ interface Error {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
const OverlayInner = ({ hasError, hasActive, tip }) => {
|
|
30
|
-
if (hasError) return <span style={{ 'color': '#F05E5E' }}>{tip}</span>;
|
|
31
32
|
if (hasActive) return <span style={{ 'color': '#3F4755' }}>{tip}</span>;
|
|
33
|
+
if (hasError) return <span style={{ 'color': '#F05E5E' }}>{tip}</span>;
|
|
34
|
+
|
|
32
35
|
return <span />;
|
|
33
36
|
}
|
|
34
37
|
|
|
@@ -42,7 +45,9 @@ export default forwardRef((props: Props, ref) => {
|
|
|
42
45
|
type,
|
|
43
46
|
name,
|
|
44
47
|
disabled,
|
|
45
|
-
getContainer
|
|
48
|
+
getContainer,
|
|
49
|
+
layout,
|
|
50
|
+
className="",
|
|
46
51
|
} = props;
|
|
47
52
|
|
|
48
53
|
const inputRef = useRef<any>();
|
|
@@ -104,7 +109,7 @@ export default forwardRef((props: Props, ref) => {
|
|
|
104
109
|
}
|
|
105
110
|
}))
|
|
106
111
|
|
|
107
|
-
return <div className={classNames(preCls)}>
|
|
112
|
+
return <div className={classNames(preCls,{[`${preCls}-row`]:layout==='row'},className)}>
|
|
108
113
|
<div className={classNames(`${preCls}__label`)}>
|
|
109
114
|
<span className={classNames(`${preCls}__label-text`)}>{label}</span>
|
|
110
115
|
{require && <span className={classNames(`${preCls}__label-require`)}>*</span>}
|