@titaui/pc 1.11.27 → 1.11.30

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.
Files changed (158) hide show
  1. package/lib/components/avatar/text-avatar/index.css +7 -0
  2. package/lib/components/avatar/text-avatar/index.js +32 -7
  3. package/lib/components/button/icon-btn/index.js +17 -8
  4. package/lib/components/button/rect-btn/index.js +7 -7
  5. package/lib/components/change-okr-modal/Item.js +14 -14
  6. package/lib/components/drawer/index.js +4 -4
  7. package/lib/components/drop-selector/index.js +25 -10
  8. package/lib/components/dynamic/constant.js +33 -32
  9. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +9 -9
  10. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +1 -1
  11. package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
  12. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
  13. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
  14. package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
  15. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
  16. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
  17. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
  18. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
  19. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +5 -5
  20. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +6 -6
  21. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +10 -10
  22. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +13 -13
  23. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +9 -9
  24. package/lib/components/dynamic/dynamic-item/index.js +50 -32
  25. package/lib/components/dynamic/dynamic-list/index.js +4 -4
  26. package/lib/components/e-priority/index.js +8 -8
  27. package/lib/components/eReport/eReportShare/index.js +11 -11
  28. package/lib/components/form/form-fields/date/index.css +24 -0
  29. package/lib/components/form/form-fields/date/index.js +102 -0
  30. package/lib/components/form/form-fields/input/index.js +10 -10
  31. package/lib/components/form/form-fields/user/index.css +23 -3
  32. package/lib/components/form/form-fields/user/index.js +18 -8
  33. package/lib/components/form/form-fields/user/user-input.js +15 -6
  34. package/lib/components/form/index.js +10 -3
  35. package/lib/components/grid-layout/sub-employee-okr/person-okr.js +5 -5
  36. package/lib/components/icon-button-list/index.js +3 -3
  37. package/lib/components/img-viewer/index.css +3 -3
  38. package/lib/components/img-viewer/index.js +11 -11
  39. package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
  40. package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
  41. package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
  42. package/lib/components/menus/components/menu-tree/index.css +4 -2
  43. package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
  44. package/lib/components/menus/export-modules/interview-menus/constant.js +30 -0
  45. package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +63 -0
  46. package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
  47. package/lib/components/menus/export-modules/interview-menus/index.js +128 -0
  48. package/lib/components/menus/index.js +11 -5
  49. package/lib/components/nav-top/components/menu/index.js +14 -14
  50. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
  51. package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
  52. package/lib/components/nav-top/components/user-message/constant.js +1 -0
  53. package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
  54. package/lib/components/nav-top/components/user-message/index.js +23 -20
  55. package/lib/components/nav-top/request.apis.js +3 -1
  56. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
  57. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +3 -2
  58. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +10 -0
  59. package/lib/components/okr-detail/detail-header/actions.js +23 -23
  60. package/lib/components/okr-detail/index.js +19 -19
  61. package/lib/components/okr-detail/okr-list/index.js +5 -3
  62. package/lib/components/okr-flow/child-node/index.css +6 -6
  63. package/lib/components/okr-flow/child-node/work-node.js +21 -21
  64. package/lib/components/okr-flow/export-modal/index.js +37 -19
  65. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +14 -14
  66. package/lib/components/okr-flow/okr-map/index.js +5 -5
  67. package/lib/components/okr-flow/request-apis.js +4 -4
  68. package/lib/components/okr-flow/root-node/index.js +25 -24
  69. package/lib/components/okr-flow/utils/index.js +5 -5
  70. package/lib/components/okr-flow/utils/tree-handler.js +17 -17
  71. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +30 -30
  72. package/lib/components/pagination/index.css +3 -3
  73. package/lib/components/pagination/select.css +58 -23
  74. package/lib/components/period-selector/index.css +3 -3
  75. package/lib/components/period-selector/index.js +11 -11
  76. package/lib/components/picker/components/panels/date-panel/date-body.js +118 -0
  77. package/lib/components/picker/components/panels/date-panel/date-head.js +87 -0
  78. package/lib/components/picker/components/panels/date-panel/index.css +14 -0
  79. package/lib/components/picker/components/panels/date-panel/index.js +49 -0
  80. package/lib/components/picker/components/panels/month-panel/index.css +27 -0
  81. package/lib/components/picker/components/panels/month-panel/index.js +63 -0
  82. package/lib/components/picker/components/panels/month-panel/month-body.js +89 -0
  83. package/lib/components/picker/components/panels/month-panel/month-head.js +47 -0
  84. package/lib/components/picker/components/panels/panel-body/index.js +53 -0
  85. package/lib/components/picker/components/panels/panel-head/index.js +48 -0
  86. package/lib/components/picker/components/panels/year-panel/index.css +23 -0
  87. package/lib/components/picker/components/panels/year-panel/index.js +65 -0
  88. package/lib/components/picker/components/panels/year-panel/year-body.js +92 -0
  89. package/lib/components/picker/components/panels/year-panel/year-head.js +35 -0
  90. package/lib/components/picker/components/picker-trigger/index.css +57 -0
  91. package/lib/components/picker/components/picker-trigger/index.js +94 -0
  92. package/lib/components/picker/context.js +15 -0
  93. package/lib/components/picker/index.css +121 -0
  94. package/lib/components/picker/index.js +13 -0
  95. package/lib/components/picker/picker-panels.js +182 -0
  96. package/lib/components/picker/picker.js +132 -0
  97. package/lib/components/picker/type.js +5 -0
  98. package/lib/components/picker/utils.js +28 -0
  99. package/lib/components/popup/index.js +4 -4
  100. package/lib/components/radio/index.css +9 -9
  101. package/lib/components/scrollbar/scroll-mask/index.js +1 -1
  102. package/lib/components/superset-charts/utils/axios.js +5 -5
  103. package/lib/components/survey-model/index.css +18 -18
  104. package/lib/components/survey-model/instance.js +1 -1
  105. package/lib/components/task-tree/helper.js +61 -0
  106. package/lib/components/task-tree/images/P1.svg +15 -0
  107. package/lib/components/task-tree/images/P2.svg +15 -0
  108. package/lib/components/task-tree/images/P3.svg +15 -0
  109. package/lib/components/task-tree/images/P4.svg +15 -0
  110. package/lib/components/task-tree/images/P5.svg +15 -0
  111. package/lib/components/task-tree/images/arrow.svg +9 -0
  112. package/lib/components/task-tree/images/empty-131.png +0 -0
  113. package/lib/components/task-tree/images/followed.svg +33 -0
  114. package/lib/components/task-tree/images/nice.svg +108 -0
  115. package/lib/components/task-tree/images/struc12.png +0 -0
  116. package/lib/components/task-tree/images/struc2.png +0 -0
  117. package/lib/components/task-tree/images/xialat-s.svg +13 -0
  118. package/lib/components/task-tree/index.js +22 -0
  119. package/lib/components/task-tree/mock.js +944 -0
  120. package/lib/components/task-tree/precls.js +8 -0
  121. package/lib/components/task-tree/request-apis.js +88 -0
  122. package/lib/components/task-tree/task-item-node/constant.js +45 -0
  123. package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
  124. package/lib/components/task-tree/task-item-node/e-project.js +212 -0
  125. package/lib/components/task-tree/task-item-node/e-status-dropdown.js +94 -0
  126. package/lib/components/task-tree/task-item-node/e-task.js +426 -0
  127. package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
  128. package/lib/components/task-tree/task-item-node/index.css +289 -0
  129. package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
  130. package/lib/components/task-tree/task-tree.css +16 -0
  131. package/lib/components/task-tree/task-tree.js +49 -0
  132. package/lib/components/time-picker/index.css +123 -0
  133. package/lib/components/time-picker/index.js +13 -0
  134. package/lib/components/time-picker/time-picker-selector.js +138 -0
  135. package/lib/components/time-picker/time-picker.js +336 -0
  136. package/lib/components/time-picker/timer-picker-input.js +96 -0
  137. package/lib/components/time-picker/utils.js +52 -0
  138. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
  139. package/lib/components-v1/radio/radio.js +3 -3
  140. package/lib/components-v1/radio/style/index.css +8 -8
  141. package/lib/pages/aha2021/index.js +5 -1
  142. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +24 -24
  143. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +31 -31
  144. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +2 -2
  145. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +11 -11
  146. package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +8 -8
  147. package/lib/pages/okr-map/number-select/index.js +2 -2
  148. package/lib/utils/auth.js +6 -6
  149. package/lib/utils/bs-global.js +12 -12
  150. package/lib/utils/hooks.js +72 -0
  151. package/lib/utils/open-data.js +26 -26
  152. package/package.json +5 -2
  153. package/.eslintignore +0 -3
  154. package/.eslintrc.js +0 -223
  155. package/.husky/pre-commit +0 -4
  156. package/.prettierignore +0 -31
  157. package/.prettierrc.js +0 -90
  158. package/.vscode/settings.json +0 -5
@@ -0,0 +1,336 @@
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
+ var _moment = _interopRequireDefault(require("moment"));
15
+
16
+ var _timerPickerInput = _interopRequireDefault(require("./timer-picker-input"));
17
+
18
+ var _timePickerSelector = _interopRequireDefault(require("./time-picker-selector"));
19
+
20
+ var _utils = require("./utils");
21
+
22
+ require("./index.css");
23
+
24
+ var _excluded = ["disabled", "enableKeyBoard", "timeFormat", "hourStep", "minuteStep", "onChange", "value"];
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
+
28
+ 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); }
29
+
30
+ 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; }
31
+
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
+
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; }
35
+
36
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
37
+
38
+ 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."); }
39
+
40
+ 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); }
41
+
42
+ 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; }
43
+
44
+ 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; }
45
+
46
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
+
48
+ 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; }
49
+
50
+ 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; }
51
+
52
+ var TimePicker = function TimePicker(props) {
53
+ var disabled = props.disabled,
54
+ _props$enableKeyBoard = props.enableKeyBoard,
55
+ enableKeyBoard = _props$enableKeyBoard === void 0 ? true : _props$enableKeyBoard,
56
+ _props$timeFormat = props.timeFormat,
57
+ timeFormat = _props$timeFormat === void 0 ? 'hh:mm' : _props$timeFormat,
58
+ _props$hourStep = props.hourStep,
59
+ hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,
60
+ _props$minuteStep = props.minuteStep,
61
+ minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,
62
+ onChange = props.onChange,
63
+ _props$value = props.value,
64
+ value = _props$value === void 0 ? '00:00' : _props$value,
65
+ restProps = _objectWithoutProperties(props, _excluded);
66
+
67
+ var _useState = (0, _react.useState)(''),
68
+ _useState2 = _slicedToArray(_useState, 2),
69
+ timeSetingtType = _useState2[0],
70
+ setTimeSettingType = _useState2[1];
71
+
72
+ var _useState3 = (0, _react.useState)(false),
73
+ _useState4 = _slicedToArray(_useState3, 2),
74
+ visible = _useState4[0],
75
+ setVisible = _useState4[1];
76
+
77
+ var hourRef = (0, _react.useRef)((0, _moment["default"])(value || '00:00', timeFormat).format('HH'));
78
+ var hInputRef = (0, _react.useRef)();
79
+ var mInputRef = (0, _react.useRef)();
80
+ var minuteRef = (0, _react.useRef)((0, _moment["default"])(value || '00:00', timeFormat).format('mm'));
81
+ var triggerRef = (0, _react.useRef)();
82
+ var timerRef = (0, _react.useRef)();
83
+ var hours = (0, _utils.getHours)(hourStep);
84
+ var minutes = (0, _utils.getMinutes)(minuteStep);
85
+
86
+ 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);
103
+ };
104
+
105
+ var onFocusHandler = function onFocusHandler(type) {
106
+ setTimeSettingType(function () {
107
+ return type;
108
+ });
109
+ };
110
+
111
+ var onHourInputBlur = function onHourInputBlur() {
112
+ // setHour((prevHour) => {
113
+ // const prevHour = hourRef.current;
114
+ // let nextHour = (Array(2).join("0") + prevHour).slice(-2);
115
+ // if (Number(prevHour) > Number(hours[hours.length - 1])) {
116
+ // nextHour = `0${prevHour.slice(0, 1)}`;
117
+ // }
118
+ // hourRef.current = nextHour;
119
+ // });
120
+ // if (timeSetType === "hour" && hInputRef.current) {
121
+ // hInputRef.current.focus();
122
+ // }
123
+ // onTimeChange();
124
+ setTimeSettingType('');
125
+ };
126
+
127
+ var onHourInputChange = function onHourInputChange(e) {
128
+ var v = e.target.value;
129
+
130
+ if (!Number.isNaN(Number(v))) {
131
+ // setHour(v);
132
+ hourRef.current = v;
133
+ setTimeout(function () {
134
+ if (hInputRef.current) {
135
+ hInputRef.current.blur();
136
+ }
137
+ }, 1000);
138
+ onTimeChange();
139
+ }
140
+ };
141
+
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
+ var onMinuteInputChange = function onMinuteInputChange(e) {
169
+ var v = e.target.value;
170
+
171
+ if (!Number.isNaN(Number(v))) {
172
+ // setMinute(v);
173
+ minuteRef.current = v;
174
+ setTimeout(function () {
175
+ if (mInputRef.current) {
176
+ mInputRef.current.blur();
177
+ }
178
+ }, 1000);
179
+ onTimeChange();
180
+ }
181
+ };
182
+
183
+ var setTimeOnKeyboardDirectionChange = function setTimeOnKeyboardDirectionChange(keyCode, type, currTime) {
184
+ var datas = JSON.parse(JSON.stringify(type === 'hour' ? hours : minutes));
185
+ var currentTimeIndex;
186
+ datas.forEach(function (item, index) {
187
+ if (item === currTime) {
188
+ currentTimeIndex = index;
189
+ } else if (item < currTime) {
190
+ var nextIndex = index + 1;
191
+ var nextData = datas[nextIndex];
192
+
193
+ if (!nextData || nextData && nextData > currTime) {
194
+ currentTimeIndex = keyCode === _utils.KEYCODE.directionUp || !nextData ? index : nextIndex;
195
+ }
196
+ }
197
+ });
198
+
199
+ if (keyCode === _utils.KEYCODE.directionUp) {
200
+ // 方向键:↑
201
+ var nextIndex = currentTimeIndex + 1 === datas.length ? 0 : currentTimeIndex + 1;
202
+ var nextValue = datas[nextIndex];
203
+
204
+ if (currentTimeIndex > -1 && !!nextValue) {
205
+ if (type === 'minute' && nextValue === datas[0]) {
206
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
207
+ }
208
+
209
+ return nextValue;
210
+ }
211
+ } else if (keyCode === _utils.KEYCODE.directionDown) {
212
+ // 方向键:↓
213
+ var prevIndex = currentTimeIndex - 1 < 0 ? datas.length - 1 : currentTimeIndex - 1;
214
+ var prevValue = datas[prevIndex];
215
+
216
+ if (currentTimeIndex > -1 && !!prevValue) {
217
+ if (type === 'minute' && prevValue === datas[datas.length - 1]) {
218
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
219
+ }
220
+
221
+ return prevValue;
222
+ }
223
+ }
224
+
225
+ return currTime;
226
+ };
227
+
228
+ var handleKeyDown = function handleKeyDown(e) {
229
+ var keyCode = e.keyCode;
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
+ }
251
+ };
252
+
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
+ return /*#__PURE__*/_react["default"].createElement("div", {
262
+ className: _utils.TimePickerClass
263
+ }, /*#__PURE__*/_react["default"].createElement("div", {
264
+ className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-trigger"), _defineProperty({}, "".concat(_utils.TimePickerClass, "-trigger--disabled"), disabled)),
265
+ ref: triggerRef
266
+ }, /*#__PURE__*/_react["default"].createElement("div", {
267
+ className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-inputs"), _defineProperty({}, "".concat(_utils.TimePickerClass, "-inputs--placeholder"), !value)),
268
+ onClick: function onClick() {
269
+ return !enableKeyBoard && showSelectorPop();
270
+ }
271
+ }, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
272
+ className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
273
+ active: enableKeyBoard && timeSetingtType === 'hour'
274
+ }),
275
+ disabled: disabled,
276
+ maxLength: 2,
277
+ onBlur: onHourInputBlur,
278
+ onChange: onHourInputChange,
279
+ onClick: function onClick() {
280
+ return !enableKeyBoard && showSelectorPop();
281
+ },
282
+ onFocus: function onFocus() {
283
+ return onFocusHandler('hour');
284
+ },
285
+ ref: hInputRef,
286
+ value: hourRef.current
287
+ }), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
288
+ className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
289
+ active: enableKeyBoard && timeSetingtType === 'minute'
290
+ }),
291
+ disabled: disabled,
292
+ maxLength: 2,
293
+ onBlur: onMinuteInputBlur,
294
+ onChange: onMinuteInputChange,
295
+ onClick: function onClick() {
296
+ return !enableKeyBoard && showSelectorPop();
297
+ },
298
+ onFocus: function onFocus() {
299
+ return onFocusHandler('minute');
300
+ },
301
+ ref: mInputRef,
302
+ value: minuteRef.current
303
+ })), !disabled && /*#__PURE__*/_react["default"].createElement(_timePickerSelector["default"], _extends({
304
+ popupAlign: {
305
+ offset: [12, 8],
306
+ overflow: {
307
+ adjustX: true,
308
+ adjustY: true
309
+ },
310
+ targetOffset: [0, 0]
311
+ },
312
+ timeData: {
313
+ hours: hours,
314
+ minutes: minutes
315
+ },
316
+ timeSetting: {
317
+ hour: hourRef.current,
318
+ minute: minuteRef.current,
319
+ setTime: function setTime(time) {
320
+ hourRef.current = (0, _moment["default"])(time, 'HH:mm').format('HH');
321
+ minuteRef.current = (0, _moment["default"])(time, 'HH:mm').format('mm');
322
+ onChange(time);
323
+ }
324
+ },
325
+ visibleSetting: {
326
+ visible: visible,
327
+ setVisible: setVisible
328
+ }
329
+ }, restProps), /*#__PURE__*/_react["default"].createElement("span", {
330
+ className: "".concat(_utils.TimePickerClass, "-icon tu-icon-caret-down"),
331
+ onClick: showSelectorPop
332
+ }))));
333
+ };
334
+
335
+ var _default = TimePicker;
336
+ exports["default"] = _default;
@@ -0,0 +1,96 @@
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 _excluded = ["className", "changeTimeout", "maxLength", "onClick", "onChange", "onFocus", "stopPropagation", "type", "value"];
13
+
14
+ 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); }
15
+
16
+ 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; }
17
+
18
+ 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); }
19
+
20
+ 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; }
21
+
22
+ 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; }
23
+
24
+ var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
25
+ var className = props.className,
26
+ _props$changeTimeout = props.changeTimeout,
27
+ changeTimeout = _props$changeTimeout === void 0 ? 500 : _props$changeTimeout,
28
+ maxLength = props.maxLength,
29
+ onClick = props.onClick,
30
+ onChange = props.onChange,
31
+ onFocus = props.onFocus,
32
+ _props$stopPropagatio = props.stopPropagation,
33
+ stopPropagation = _props$stopPropagatio === void 0 ? true : _props$stopPropagatio,
34
+ _props$type = props.type,
35
+ type = _props$type === void 0 ? 'text' : _props$type,
36
+ value = props.value,
37
+ restProps = _objectWithoutProperties(props, _excluded);
38
+
39
+ var inputRef = (0, _react.useRef)();
40
+
41
+ var setSelectionRange = function setSelectionRange(timeout) {
42
+ setTimeout(function () {
43
+ if (inputRef.current) {
44
+ inputRef.current.selectionStart = 0;
45
+ inputRef.current.selectionEnd = inputRef.current.value.length;
46
+ }
47
+ }, timeout);
48
+ };
49
+
50
+ var onClickHandler = function onClickHandler(e) {
51
+ if (stopPropagation) {
52
+ e.stopPropagation();
53
+ e.nativeEvent.stopImmediatePropagation();
54
+ }
55
+
56
+ setSelectionRange(0);
57
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
58
+ };
59
+
60
+ var onFocusHandler = function onFocusHandler(e) {
61
+ setSelectionRange(0);
62
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
63
+ };
64
+
65
+ var onChangeHandler = function onChangeHandler(e) {
66
+ return onChange === null || onChange === void 0 ? void 0 : onChange(e);
67
+ };
68
+
69
+ (0, _react.useImperativeHandle)(ref, function () {
70
+ return {
71
+ focus: function focus() {
72
+ return inputRef.current && inputRef.current.focus();
73
+ },
74
+ blur: function blur() {
75
+ return inputRef.current && inputRef.current.blur();
76
+ }
77
+ };
78
+ });
79
+ (0, _react.useEffect)(function () {
80
+ setSelectionRange(changeTimeout);
81
+ }, [value]);
82
+ return /*#__PURE__*/_react["default"].createElement("input", _extends({
83
+ autoFocus: false,
84
+ autoComplete: "off",
85
+ className: className,
86
+ maxLength: maxLength,
87
+ onClick: onClickHandler,
88
+ onChange: onChangeHandler,
89
+ onFocus: onFocusHandler,
90
+ ref: inputRef,
91
+ type: type,
92
+ value: value
93
+ }, restProps));
94
+ });
95
+ var _default = TimePickerInput;
96
+ exports["default"] = _default;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TimePickerClass = exports.TargetMapByKeyCode = exports.KEYCODE = void 0;
7
+ exports.getHours = getHours;
8
+ exports.getMinutes = getMinutes;
9
+ var TimePickerClass = "tita-ui__time-picker";
10
+ exports.TimePickerClass = TimePickerClass;
11
+ var TargetMapByKeyCode = {
12
+ 37: "hour",
13
+ 39: "minute"
14
+ };
15
+ exports.TargetMapByKeyCode = TargetMapByKeyCode;
16
+
17
+ function getHours() {
18
+ var hourStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
19
+ var hours = [];
20
+
21
+ for (var i = 0; i < 24; i += 1) {
22
+ if (i % hourStep === 0) {
23
+ hours.push(i < 10 ? "0".concat(i) : "".concat(i));
24
+ }
25
+ }
26
+
27
+ return hours;
28
+ }
29
+
30
+ function getMinutes() {
31
+ var minuteStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
32
+ var minutes = [];
33
+
34
+ for (var i = 0; i < 60; i += 1) {
35
+ if (i % minuteStep === 0) {
36
+ minutes.push(i < 10 ? "0".concat(i) : "".concat(i));
37
+ }
38
+ }
39
+
40
+ return minutes;
41
+ } // eslint-disable-next-line no-shadow
42
+
43
+
44
+ var KEYCODE;
45
+ exports.KEYCODE = KEYCODE;
46
+
47
+ (function (KEYCODE) {
48
+ KEYCODE[KEYCODE["directionLeft"] = 37] = "directionLeft";
49
+ KEYCODE[KEYCODE["directionUp"] = 38] = "directionUp";
50
+ KEYCODE[KEYCODE["directionRight"] = 39] = "directionRight";
51
+ KEYCODE[KEYCODE["directionDown"] = 40] = "directionDown";
52
+ })(KEYCODE || (exports.KEYCODE = KEYCODE = {}));
@@ -14,6 +14,7 @@
14
14
  line-height: 28px;
15
15
  border-radius: 50%;
16
16
  overflow: hidden;
17
+ display: flex;
17
18
  }
18
19
 
19
20
  .perspm-person--small .perspm-person__info {
@@ -9,10 +9,10 @@ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
- require("./style/index.css");
13
-
14
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
15
13
 
14
+ require("./style/index.css");
15
+
16
16
  var _templateObject;
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -43,7 +43,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
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
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 .label {\n position: relative;\n user-select: none;\n top: -2px;\n }\n"])));
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: flex;\n\n .label {\n position: relative;\n user-select: none;\n top: -2px;\n }\n"])));
47
47
 
48
48
  var Radio = /*#__PURE__*/function (_Component) {
49
49
  _inherits(Radio, _Component);
@@ -1,7 +1,7 @@
1
1
  .tita-radio {
2
2
  display: inline-block;
3
3
  position: relative;
4
- top: 5px;
4
+ top: 1px;
5
5
  width: 16px;
6
6
  min-width: 16px;
7
7
  height: 16px;
@@ -30,19 +30,19 @@
30
30
  bottom: 0;
31
31
  border-radius: 100px;
32
32
  background-color: #fff;
33
- border: 1px solid #DFE3EA;
33
+ border: 1px solid #dfe3ea;
34
34
  transition: all 300ms;
35
35
  }
36
36
 
37
37
  .tita-radio .tita-radio-inner::after {
38
38
  content: '';
39
39
  position: absolute;
40
- top: 3px;
41
- left: 3px;
42
- width: 8px;
43
- min-width: 8px;
44
- height: 8px;
45
- min-height: 8px;
40
+ top: 2px;
41
+ left: 2px;
42
+ width: 10px;
43
+ min-width: 10px;
44
+ height: 10px;
45
+ min-height: 10px;
46
46
  border-radius: 50%;
47
47
  background-color: #2879ff !important;
48
48
  transform: scale(0);
@@ -45,6 +45,8 @@ var _try = _interopRequireDefault(require("./img/try.png"));
45
45
 
46
46
  require("./index.css");
47
47
 
48
+ var _hooks = _interopRequireDefault(require("../../utils/hooks"));
49
+
48
50
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
49
51
 
50
52
  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); }
@@ -96,6 +98,8 @@ function PageLayout(props) {
96
98
  visible = _useState2[0],
97
99
  setVisible = _useState2[1];
98
100
 
101
+ var hideNavTop = (0, _hooks["default"])("hideNavTop");
102
+
99
103
  var handleShowCode = function handleShowCode() {
100
104
  setVisible(true);
101
105
  };
@@ -141,7 +145,7 @@ function PageLayout(props) {
141
145
 
142
146
  return /*#__PURE__*/_react["default"].createElement("div", {
143
147
  className: (0, _classnames["default"])(preCls)
144
- }, /*#__PURE__*/_react["default"].createElement("div", {
148
+ }, hideNavTop !== "true" && /*#__PURE__*/_react["default"].createElement("div", {
145
149
  className: (0, _classnames["default"])("".concat(preCls, "__header"))
146
150
  }, (0, _helpers.getTenantInfo)().Source === 964 ? /*#__PURE__*/_react["default"].createElement(_hrHeader["default"], null) : /*#__PURE__*/_react["default"].createElement(_navTop["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
147
151
  className: (0, _classnames["default"])("".concat(preCls, "__message"))