@titaui/pc 1.11.4-0 → 1.11.4-3

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 (61) hide show
  1. package/lib/components/dynamic/constant.js +2 -1
  2. package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
  3. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
  4. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
  5. package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
  6. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
  7. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
  8. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +54 -0
  9. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
  10. package/lib/components/dynamic/dynamic-item/index.js +17 -0
  11. package/lib/components/form/form-fields/date/index.css +24 -0
  12. package/lib/components/form/form-fields/date/index.js +98 -0
  13. package/lib/components/form/form-fields/user/index.css +1 -1
  14. package/lib/components/form/index.js +10 -3
  15. package/lib/components/menus/export-modules/interview-menus/constant.js +23 -17
  16. package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +5 -5
  17. package/lib/components/menus/export-modules/interview-menus/index.js +1 -2
  18. package/lib/components/picker/components/picker-trigger/index.css +16 -0
  19. package/lib/components/picker/components/picker-trigger/index.js +18 -9
  20. package/lib/components/picker/picker-panels.js +1 -1
  21. package/lib/components/picker/picker.js +12 -13
  22. package/lib/components/task-tree/helper.js +61 -0
  23. package/lib/components/task-tree/images/P1.svg +15 -0
  24. package/lib/components/task-tree/images/P2.svg +15 -0
  25. package/lib/components/task-tree/images/P3.svg +15 -0
  26. package/lib/components/task-tree/images/P4.svg +15 -0
  27. package/lib/components/task-tree/images/P5.svg +15 -0
  28. package/lib/components/task-tree/images/arrow.svg +9 -0
  29. package/lib/components/task-tree/images/empty-131.png +0 -0
  30. package/lib/components/task-tree/images/followed.svg +33 -0
  31. package/lib/components/task-tree/images/nice.svg +108 -0
  32. package/lib/components/task-tree/images/struc12.png +0 -0
  33. package/lib/components/task-tree/images/struc2.png +0 -0
  34. package/lib/components/task-tree/images/xialat-s.svg +13 -0
  35. package/lib/components/task-tree/index.js +27 -0
  36. package/lib/components/task-tree/mock.js +944 -0
  37. package/lib/components/task-tree/precls.js +8 -0
  38. package/lib/components/task-tree/request-apis.js +88 -0
  39. package/lib/components/task-tree/task-item-node/constant.js +45 -0
  40. package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
  41. package/lib/components/task-tree/task-item-node/e-project.js +195 -0
  42. package/lib/components/task-tree/task-item-node/e-status-dropdown.js +94 -0
  43. package/lib/components/task-tree/task-item-node/e-task.js +431 -0
  44. package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
  45. package/lib/components/task-tree/task-item-node/index.css +290 -0
  46. package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
  47. package/lib/components/task-tree/task-tree.css +8 -0
  48. package/lib/components/task-tree/task-tree.js +49 -0
  49. package/lib/components/time-picker/index.css +18 -0
  50. package/lib/components/time-picker/time-picker-selector.js +8 -12
  51. package/lib/components/time-picker/time-picker.js +117 -100
  52. package/lib/components/time-picker/utils.js +13 -2
  53. package/lib/index.js +8 -0
  54. package/package.json +5 -2
  55. package/.eslintignore +0 -3
  56. package/.eslintrc.js +0 -223
  57. package/.husky/pre-commit +0 -4
  58. package/.prettierignore +0 -31
  59. package/.prettierrc.js +0 -90
  60. package/.vscode/settings.json +0 -5
  61. package/yarn-error.log +0 -22184
@@ -21,7 +21,7 @@ var _utils = require("./utils");
21
21
 
22
22
  require("./index.css");
23
23
 
24
- var _excluded = ["hourStep", "minuteStep", "onChange", "value"];
24
+ var _excluded = ["disabled", "timeFormat", "hourStep", "minuteStep", "onChange", "value"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
27
 
@@ -31,6 +31,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
31
31
 
32
32
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
33
33
 
34
+ function _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
+
34
36
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
35
37
 
36
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."); }
@@ -48,7 +50,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
48
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; }
49
51
 
50
52
  var TimePicker = function TimePicker(props) {
51
- var _props$hourStep = props.hourStep,
53
+ var disabled = props.disabled,
54
+ _props$timeFormat = props.timeFormat,
55
+ timeFormat = _props$timeFormat === void 0 ? "hh:mm" : _props$timeFormat,
56
+ _props$hourStep = props.hourStep,
52
57
  hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,
53
58
  _props$minuteStep = props.minuteStep,
54
59
  minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,
@@ -57,117 +62,120 @@ var TimePicker = function TimePicker(props) {
57
62
  value = _props$value === void 0 ? "00:00" : _props$value,
58
63
  restProps = _objectWithoutProperties(props, _excluded);
59
64
 
60
- var _useState = (0, _react.useState)((0, _moment["default"])(value, "hh:mm").format("HH")),
65
+ var _useState = (0, _react.useState)(""),
61
66
  _useState2 = _slicedToArray(_useState, 2),
62
- hour = _useState2[0],
63
- setHour = _useState2[1];
67
+ timeSetType = _useState2[0],
68
+ setTimeSetType = _useState2[1];
64
69
 
65
- var _useState3 = (0, _react.useState)((0, _moment["default"])(value, "hh:mm").format("mm")),
70
+ var _useState3 = (0, _react.useState)(false),
66
71
  _useState4 = _slicedToArray(_useState3, 2),
67
- minute = _useState4[0],
68
- setMinute = _useState4[1];
69
-
70
- var _useState5 = (0, _react.useState)(),
71
- _useState6 = _slicedToArray(_useState5, 2),
72
- target = _useState6[0],
73
- setTarget = _useState6[1];
74
-
75
- var _useState7 = (0, _react.useState)(false),
76
- _useState8 = _slicedToArray(_useState7, 2),
77
- visible = _useState8[0],
78
- setVisible = _useState8[1];
72
+ visible = _useState4[0],
73
+ setVisible = _useState4[1];
79
74
 
80
- var hourRef = (0, _react.useRef)(hour);
75
+ var hourRef = (0, _react.useRef)((0, _moment["default"])(value || "00:00", timeFormat).format("HH"));
81
76
  var hInputRef = (0, _react.useRef)();
82
77
  var mInputRef = (0, _react.useRef)();
83
- var minuteRef = (0, _react.useRef)(minute);
78
+ var minuteRef = (0, _react.useRef)((0, _moment["default"])(value || "00:00", timeFormat).format("mm"));
84
79
  var triggerRef = (0, _react.useRef)();
80
+ var timerRef = (0, _react.useRef)();
85
81
  var hours = (0, _utils.getHours)(hourStep);
86
82
  var minutes = (0, _utils.getMinutes)(minuteStep);
87
83
 
88
- var onHourInputBlur = function onHourInputBlur() {
89
- setHour(function (prevHour) {
90
- var nextHour = (Array(2).join("0") + prevHour).slice(-2);
84
+ var onTimeChange = function onTimeChange() {
85
+ onChange === null || onChange === void 0 ? void 0 : onChange("".concat(hourRef.current, ":").concat(minuteRef.current));
86
+ };
91
87
 
92
- if (Number(prevHour) > Number(hours[hours.length - 1])) {
93
- nextHour = "0".concat(prevHour.slice(0, 1));
88
+ var onInputClick = function onInputClick(type) {
89
+ clearTimeout(timerRef.current);
90
+ timerRef.current = setTimeout(function () {
91
+ if (type === "hour") {
92
+ var _hInputRef$current;
93
+
94
+ (_hInputRef$current = hInputRef.current) === null || _hInputRef$current === void 0 ? void 0 : _hInputRef$current.focus();
95
+ } else {
96
+ var _mInputRef$current;
97
+
98
+ (_mInputRef$current = mInputRef.current) === null || _mInputRef$current === void 0 ? void 0 : _mInputRef$current.focus();
94
99
  }
95
100
 
96
- return nextHour;
97
- });
101
+ setTimeSetType(function () {
102
+ return type;
103
+ });
104
+ }, 0);
105
+ };
98
106
 
99
- if (target === "hour" && hInputRef.current) {
100
- hInputRef.current.focus();
101
- }
107
+ var onHourInputBlur = function onHourInputBlur() {
108
+ // setHour((prevHour) => {
109
+ // const prevHour = hourRef.current;
110
+ // let nextHour = (Array(2).join("0") + prevHour).slice(-2);
111
+ // if (Number(prevHour) > Number(hours[hours.length - 1])) {
112
+ // nextHour = `0${prevHour.slice(0, 1)}`;
113
+ // }
114
+ // hourRef.current = nextHour;
115
+ // });
116
+ // if (timeSetType === "hour" && hInputRef.current) {
117
+ // hInputRef.current.focus();
118
+ // }
119
+ // onTimeChange();
120
+ setTimeSetType("");
102
121
  };
103
122
 
104
123
  var onHourInputChange = function onHourInputChange(e) {
105
124
  var v = e.target.value;
106
125
 
107
126
  if (!Number.isNaN(Number(v))) {
108
- setHour(v);
127
+ // setHour(v);
128
+ hourRef.current = v;
109
129
  setTimeout(function () {
110
130
  if (hInputRef.current) {
111
131
  hInputRef.current.blur();
112
132
  }
113
133
  }, 1000);
134
+ onTimeChange();
114
135
  }
115
136
  };
116
137
 
117
- var onHourInputClick = function onHourInputClick() {
118
- setTarget("hour");
119
- setTimeout(function () {
120
- if (hInputRef.current) {
121
- hInputRef.current.focus();
122
- }
123
- }, 0);
124
- };
125
-
126
138
  var onMinuteInputBlur = function onMinuteInputBlur() {
127
- setMinute(function (prevMinute) {
128
- var nextMinute = prevMinute;
129
- minutes.forEach(function (m, i) {
130
- var mNum = Number(m);
131
- var nextMinuteNum = Number(nextMinute);
132
-
133
- if (mNum === nextMinuteNum) {
134
- nextMinute = m;
135
- } else if (mNum < nextMinuteNum && Number(minutes[i + 1]) > nextMinuteNum) {
136
- nextMinute = m;
137
- } else if (nextMinuteNum > Number(minutes[minutes.length - 1])) {
138
- nextMinute = "00";
139
- }
140
- });
141
- return nextMinute;
142
- });
143
-
144
- if (target === "minute" && mInputRef.current) {
145
- mInputRef.current.focus();
146
- }
139
+ // setMinute((prevMinute) => {
140
+ // let nextMinute = minuteRef.current;
141
+ // minutes.forEach((m, i) => {
142
+ // const mNum = Number(m);
143
+ // const nextMinuteNum = Number(nextMinute);
144
+ // if (mNum === nextMinuteNum) {
145
+ // nextMinute = m;
146
+ // } else if (
147
+ // mNum < nextMinuteNum
148
+ // && Number(minutes[i + 1]) > nextMinuteNum
149
+ // ) {
150
+ // nextMinute = m;
151
+ // } else if (nextMinuteNum > Number(minutes[minutes.length - 1])) {
152
+ // nextMinute = "00";
153
+ // }
154
+ // });
155
+ // minuteRef.current = nextMinute;
156
+ // });
157
+ // if (timeSetType === "minute" && mInputRef.current) {
158
+ // mInputRef.current.focus();
159
+ // }
160
+ // onTimeChange();
161
+ setTimeSetType("");
147
162
  };
148
163
 
149
164
  var onMinuteInputChange = function onMinuteInputChange(e) {
150
165
  var v = e.target.value;
151
166
 
152
167
  if (!Number.isNaN(Number(v))) {
153
- setMinute(v);
168
+ // setMinute(v);
169
+ minuteRef.current = v;
154
170
  setTimeout(function () {
155
171
  if (mInputRef.current) {
156
172
  mInputRef.current.blur();
157
173
  }
158
174
  }, 1000);
175
+ onTimeChange();
159
176
  }
160
177
  };
161
178
 
162
- var onMinuteInputClick = function onMinuteInputClick() {
163
- setTarget("minute");
164
- setTimeout(function () {
165
- if (mInputRef.current) {
166
- mInputRef.current.focus();
167
- }
168
- }, 0);
169
- };
170
-
171
179
  var setTimeOnKeyboardDirectionChange = function setTimeOnKeyboardDirectionChange(keyCode, type, currTime) {
172
180
  var datas = JSON.parse(JSON.stringify(type === "hour" ? hours : minutes));
173
181
  var currentTimeIndex;
@@ -179,31 +187,31 @@ var TimePicker = function TimePicker(props) {
179
187
  var nextData = datas[nextIndex];
180
188
 
181
189
  if (!nextData || nextData && nextData > currTime) {
182
- currentTimeIndex = keyCode === 38 || !nextData ? index : nextIndex;
190
+ currentTimeIndex = keyCode === _utils.KEYCODE.directionUp || !nextData ? index : nextIndex;
183
191
  }
184
192
  }
185
193
  });
186
194
 
187
- if (keyCode === 38) {
195
+ if (keyCode === _utils.KEYCODE.directionUp) {
188
196
  // 方向键:↑
189
197
  var nextIndex = currentTimeIndex + 1 === datas.length ? 0 : currentTimeIndex + 1;
190
198
  var nextValue = datas[nextIndex];
191
199
 
192
200
  if (currentTimeIndex > -1 && !!nextValue) {
193
201
  if (type === "minute" && nextValue === datas[0]) {
194
- setHour(setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current));
202
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
195
203
  }
196
204
 
197
205
  return nextValue;
198
206
  }
199
- } else if (keyCode === 40) {
207
+ } else if (keyCode === _utils.KEYCODE.directionDown) {
200
208
  // 方向键:↓
201
209
  var prevIndex = currentTimeIndex - 1 < 0 ? datas.length - 1 : currentTimeIndex - 1;
202
210
  var prevValue = datas[prevIndex];
203
211
 
204
212
  if (currentTimeIndex > -1 && !!prevValue) {
205
213
  if (type === "minute" && prevValue === datas[datas.length - 1]) {
206
- setHour(setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current));
214
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
207
215
  }
208
216
 
209
217
  return prevValue;
@@ -214,65 +222,71 @@ var TimePicker = function TimePicker(props) {
214
222
  };
215
223
 
216
224
  var handleKeyDown = function handleKeyDown(e) {
217
- if (e.keyCode === 37 || e.keyCode === 39) {
218
- setTarget(_utils.TargetMapByKeyCode[e.keyCode]);
225
+ var keyCode = e.keyCode;
226
+
227
+ if ([_utils.KEYCODE.directionLeft, _utils.KEYCODE.directionRight].includes(keyCode)) {
228
+ setTimeSetType(_utils.TargetMapByKeyCode[keyCode]);
219
229
  }
220
230
 
221
- if (e.keyCode !== 38 && e.keyCode !== 40) return;
231
+ if ([_utils.KEYCODE.directionUp, _utils.KEYCODE.directionDown].indexOf(keyCode) === -1) return;
222
232
 
223
- switch (target) {
233
+ switch (timeSetType) {
224
234
  case "hour":
225
- setHour(setTimeOnKeyboardDirectionChange(e.keyCode, "hour", hourRef.current));
235
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
226
236
  break;
227
237
 
228
238
  case "minute":
229
- setMinute(setTimeOnKeyboardDirectionChange(e.keyCode, "minute", minuteRef.current));
239
+ minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, "minute", minuteRef.current);
230
240
  break;
231
241
 
232
242
  default:
233
243
  break;
234
244
  }
245
+
246
+ onTimeChange();
235
247
  };
236
248
 
237
249
  (0, _react.useEffect)(function () {
250
+ document.removeEventListener("keydown", handleKeyDown);
238
251
  document.addEventListener("keydown", handleKeyDown);
239
252
  return function () {
240
253
  document.removeEventListener("keydown", handleKeyDown);
241
254
  };
242
- }, [target]);
243
- (0, _react.useEffect)(function () {
244
- hourRef.current = hour;
245
- minuteRef.current = minute;
246
- onChange === null || onChange === void 0 ? void 0 : onChange("".concat(hour, ":").concat(minute));
247
- }, [hour, minutes]);
255
+ }, [timeSetType]);
248
256
  return /*#__PURE__*/_react["default"].createElement("div", {
249
257
  className: _utils.TimePickerClass
250
258
  }, /*#__PURE__*/_react["default"].createElement("div", {
251
- className: "".concat(_utils.TimePickerClass, "-trigger"),
259
+ className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-trigger"), _defineProperty({}, "".concat(_utils.TimePickerClass, "-trigger--disabled"), disabled)),
252
260
  ref: triggerRef
253
261
  }, /*#__PURE__*/_react["default"].createElement("div", {
254
- className: "".concat(_utils.TimePickerClass, "-inputs")
262
+ className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-inputs"), _defineProperty({}, "".concat(_utils.TimePickerClass, "-inputs--placeholder"), !value))
255
263
  }, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
256
264
  className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
257
- active: target === "hour"
265
+ active: timeSetType === "hour"
258
266
  }),
267
+ disabled: disabled,
259
268
  maxLength: 2,
260
269
  onBlur: onHourInputBlur,
261
270
  onChange: onHourInputChange,
262
- onClick: onHourInputClick,
271
+ onClick: function onClick() {
272
+ return onInputClick("hour");
273
+ },
263
274
  ref: hInputRef,
264
- value: hour
275
+ value: hourRef.current
265
276
  }), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
266
277
  className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
267
- active: target === "minute"
278
+ active: timeSetType === "minute"
268
279
  }),
280
+ disabled: disabled,
269
281
  maxLength: 2,
270
282
  onBlur: onMinuteInputBlur,
271
283
  onChange: onMinuteInputChange,
272
- onClick: onMinuteInputClick,
284
+ onClick: function onClick() {
285
+ return onInputClick("minute");
286
+ },
273
287
  ref: mInputRef,
274
- value: minute
275
- })), /*#__PURE__*/_react["default"].createElement(_timePickerSelector["default"], _extends({
288
+ value: minuteRef.current
289
+ })), !disabled && /*#__PURE__*/_react["default"].createElement(_timePickerSelector["default"], _extends({
276
290
  popupAlign: {
277
291
  offset: [12, 8],
278
292
  overflow: {
@@ -286,10 +300,13 @@ var TimePicker = function TimePicker(props) {
286
300
  minutes: minutes
287
301
  },
288
302
  timeSetting: {
289
- hour: hour,
290
- setHour: setHour,
291
- minute: minute,
292
- setMinute: setMinute
303
+ hour: hourRef.current,
304
+ minute: minuteRef.current,
305
+ setTime: function setTime(time) {
306
+ hourRef.current = (0, _moment["default"])(time, "HH:mm").format("HH");
307
+ minuteRef.current = (0, _moment["default"])(time, "HH:mm").format("mm");
308
+ onChange(time);
309
+ }
293
310
  },
294
311
  visibleSetting: {
295
312
  visible: visible,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TimePickerClass = exports.TargetMapByKeyCode = void 0;
6
+ exports.TimePickerClass = exports.TargetMapByKeyCode = exports.KEYCODE = void 0;
7
7
  exports.getHours = getHours;
8
8
  exports.getMinutes = getMinutes;
9
9
  var TimePickerClass = "tita-ui__time-picker";
@@ -38,4 +38,15 @@ function getMinutes() {
38
38
  }
39
39
 
40
40
  return minutes;
41
- }
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 = {}));
package/lib/index.js CHANGED
@@ -471,6 +471,12 @@ Object.defineProperty(exports, "TaskRelationModal", {
471
471
  return _taskRelationModal["default"];
472
472
  }
473
473
  });
474
+ Object.defineProperty(exports, "TaskTree", {
475
+ enumerable: true,
476
+ get: function get() {
477
+ return _taskTree["default"];
478
+ }
479
+ });
474
480
  Object.defineProperty(exports, "TimePicker", {
475
481
  enumerable: true,
476
482
  get: function get() {
@@ -782,4 +788,6 @@ var _picker = _interopRequireDefault(require("./components/picker"));
782
788
 
783
789
  var _timePicker = _interopRequireDefault(require("./components/time-picker"));
784
790
 
791
+ var _taskTree = _interopRequireDefault(require("./components/task-tree"));
792
+
785
793
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.11.4-0",
3
+ "version": "1.11.4-3",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
@@ -154,5 +154,8 @@
154
154
  "pretty-quick --staged",
155
155
  "eslint --fix"
156
156
  ]
157
- }
157
+ },
158
+ "files": [
159
+ "lib/"
160
+ ]
158
161
  }
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- **/*.scss
2
-
3
- **/*.css
package/.eslintrc.js DELETED
@@ -1,223 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- },
6
- extends: ['plugin:react/recommended', 'airbnb'],
7
- parser: '@typescript-eslint/parser',
8
- parserOptions: {
9
- ecmaFeatures: {
10
- jsx: true,
11
- },
12
- ecmaVersion: 'latest',
13
- sourceType: 'module',
14
- },
15
- plugins: ['react', '@typescript-eslint'],
16
- rules: {
17
- quotes: [2, 'double'],
18
- //强制不使用分号结尾
19
- semi: [2, 'always'],
20
- "import/no-extraneous-dependencies": 1,
21
- "keyword-spacing": 2,
22
- "comma-dangle": 2,
23
- "operator-linebreak": 2,
24
- "prefer-template": 2,
25
- "radix": 2,
26
- "eqeqeq": 2,
27
- "spaced-comment": 2,
28
- "prefer-object-spread": 2,
29
- 'no-unused-expressions': 'off',
30
- '@typescript-eslint/no-unused-expressions': 2,
31
- "no-plusplus": 2,
32
- "no-multiple-empty-lines": 2,
33
- "arrow-body-style": 2,
34
- "array-callback-return": 2,
35
- "prefer-const": 2,
36
- "no-restricted-globals": 2,
37
- "guard-for-in": 2,
38
- "no-restricted-syntax": 2,
39
- "prefer-destructuring": 1,
40
- "no-param-reassign": 2,
41
- "import/extensions": 0,
42
- "import/no-unresolved": 1,
43
- "eol-last": 2,
44
- "no-restricted-properties": 2,
45
- "prefer-exponentiation-operator": 2,
46
- "no-mixed-operators": 2,
47
- "no-empty": 2,
48
- "one-var-declaration-per-line": 2,
49
- "indent": 2,
50
- "no-var": 2,
51
- "vars-on-top": 2,
52
- "one-var": 2,
53
- "brace-style": 2,
54
- "no-else-return": 2,
55
- "arrow-parens": 2,
56
- "no-underscore-dangle": 2,
57
- "no-shadow": 1,
58
- "no-undef": 2,
59
- "consistent-return": 2,
60
- "react/jsx-curly-brace-presence": 2,
61
- "react/jsx-no-useless-fragment": 2,
62
- "react/jsx-filename-extension": 0,
63
- "react/prop-types": 2,
64
- "react/function-component-definition": 0,
65
- "react/no-danger": 0,
66
- "react/self-closing-comp": 2,
67
- "no-useless-escape": 2,
68
- "curly": 2,
69
- "nonblock-statement-body-position": 2,
70
- "react/jsx-one-expression-per-line": 2,
71
- "jsx-a11y/no-static-element-interactions": 0,
72
- "jsx-a11y/click-events-have-key-events": 0,
73
- "no-trailing-spaces": 2,
74
- "no-unused-vars": 0,
75
- "@typescript-eslint/no-unused-vars": 2,
76
- "default-case": 2,
77
- "implicit-arrow-linebreak": 2,
78
- "react/jsx-closing-bracket-location": 2,
79
- "quote-props": 2,
80
- "react/destructuring-assignment": 2,
81
- "object-curly-newline": 2,
82
- "key-spacing": 2,
83
- "comma-spacing": 2,
84
- "object-curly-spacing": 2,
85
- "no-dupe-keys": 2,
86
- "padded-blocks": 2,
87
- "space-infix-ops": 2,
88
- "space-in-parens": 2,
89
- "import/prefer-default-export": 2,
90
- "import/newline-after-import": 2,
91
- "space-before-blocks": 2,
92
- "space-before-function-paren": 2,
93
- "dot-notation": 2,
94
- "func-names": 2,
95
- "prefer-arrow-callback": 2,
96
- "arrow-spacing": 2,
97
- "no-nested-ternary": 2,
98
- "max-len": ["error", { "code": 200 }],
99
- "lines-between-class-members": 2,
100
- "no-tabs": 2,
101
- "react/jsx-indent": 0,
102
- "react/jsx-closing-tag-location": 2,
103
- "react/jsx-tag-spacing": 2,
104
- "react/jsx-indent-props": 2,
105
- "no-useless-return": 2,
106
- "no-use-before-define": 2,
107
- "react/jsx-fragments": 2,
108
- "react/jsx-wrap-multilines": 2,
109
- "react/jsx-boolean-value": 2,
110
- "import/no-duplicates": 2,
111
- "react/react-in-jsx-scope": 2,
112
- "max-classes-per-file": 2,
113
- "react/jsx-props-no-spreading": 1,
114
- "react/jsx-props-no-multi-spaces": 2,
115
- "react/jsx-first-prop-new-line": 2,
116
- "no-multi-spaces": 2,
117
- "react/jsx-curly-newline": 2,
118
- "no-unneeded-ternary": 2,
119
- "no-empty-pattern": 2,
120
- "no-case-declarations": 2,
121
- "import/order": 2,
122
- "jsx-quotes": 2,
123
- "react/jsx-curly-spacing": 2,
124
- "no-extra-semi": 2,
125
- "block-spacing": 2,
126
- "react/require-default-props": 2,
127
- "react/jsx-no-constructed-context-values": 1,
128
- "new-cap": 2,
129
- "function-paren-newline": 2,
130
- "global-require": 2,
131
- "jsx-a11y/alt-text": 2,
132
- "react/no-array-index-key": 2,
133
- "react/no-unstable-nested-components": 2,
134
- "object-shorthand": 2,
135
- "operator-assignment": 2,
136
- "no-console": 2,
137
- "react/jsx-max-props-per-line": 2,
138
- "import/no-dynamic-require": 2,
139
- "no-unreachable": 2,
140
- "prefer-promise-reject-errors": 2,
141
- "jsx-a11y/anchor-is-valid": 2,
142
- "jsx-a11y/no-noninteractive-element-interactions": 2,
143
- "no-lonely-if": 2,
144
- "react/jsx-no-target-blank": 2,
145
- "react/jsx-no-undef": 2,
146
- "linebreak-style": 2,
147
- "react/no-string-refs": 2,
148
- "react/no-unused-class-component-methods": 2,
149
- "react/static-property-placement": 2,
150
- "camelcase": 2,
151
- "import/first": 2,
152
- "import/no-named-default": 2,
153
- "no-extra-boolean-cast": 2,
154
- "react/no-unused-prop-types": 2,
155
- "no-cond-assign": 2,
156
- "no-async-promise-executor": 2,
157
- "react/no-find-dom-node": 2,
158
- "semi-spacing": 2,
159
- "no-eval": 2,
160
- "no-return-assign": 1,
161
- "react/sort-comp": 2,
162
- "jsx-a11y/anchor-has-content": 2,
163
- "default-param-last": 2,
164
- "no-useless-computed-key": 2,
165
- "no-promise-executor-return": 2,
166
- "object-property-newline": 2,
167
- "no-undef-init": 2,
168
- "jsx-a11y/mouse-events-have-key-events": 2,
169
- "no-throw-literal": 2,
170
- "switch-colon-spacing": 2,
171
- "class-methods-use-this": 2,
172
- "react/no-access-state-in-setstate": 2,
173
- "no-confusing-arrow": 2,
174
- "react/no-deprecated": 1,
175
- "no-mixed-spaces-and-tabs": 2,
176
- "array-bracket-spacing": 2,
177
- "import/no-useless-path-segments": 2,
178
- "no-prototype-builtins": 2,
179
- "react/state-in-constructor": 2,
180
- "no-debugger": 2,
181
- "space-unary-ops": 2,
182
- "no-sequences": 2,
183
- "no-fallthrough": 2,
184
- "comma-style": 2,
185
- "no-useless-constructor": 2,
186
- "prefer-rest-params": 2,
187
- "no-bitwise": 2,
188
- "no-new": 2,
189
- "react/forbid-prop-types": 2,
190
- "jsx-a11y/label-has-associated-control": 2,
191
- "function-call-argument-newline": 2,
192
- "react/button-has-type": 2,
193
- "no-constant-condition": 2,
194
- "react/no-unknown-property": 2,
195
- "react/prefer-stateless-function": 2,
196
- "react/default-props-match-prop-types": 2,
197
- "no-useless-catch": 2,
198
- "react/jsx-no-duplicate-props": 2,
199
- "import/no-named-as-default-member": 2,
200
- "react/no-unused-state": 2,
201
- "react/no-did-update-set-state": 2,
202
- "no-void": 2,
203
- "no-redeclare": 2,
204
- "jsx-a11y/no-autofocus": 2,
205
- "no-self-assign": 2,
206
- "no-empty-function": 2,
207
- "no-continue": 2,
208
- "no-irregular-whitespace": 2,
209
- "no-control-regex": 2,
210
- "no-script-url": 2,
211
- "new-parens": 2,
212
- "import/named": 2,
213
- "react/no-children-prop": 2,
214
- "react/no-arrow-function-lifecycle": 2,
215
- "react/jsx-no-bind": 2,
216
- "prefer-spread": 2,
217
- "no-lone-blocks": 2,
218
- "no-unsafe-negation": 2,
219
- "import/no-mutable-exports": 2,
220
- "valid-typeof": 2,
221
- "no-alert": 2,
222
- },
223
- }
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npm run lint-staged