@zgfe/business-lib 1.2.11-data.0 → 1.2.11-data.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.
@@ -194,9 +194,11 @@
194
194
  }
195
195
  }
196
196
 
197
- &:hover:not(.ant-picker-disabled),
198
- &.ant-picker-focused {
199
- border-color: @primary-color!important;
197
+ &:not(.ant-picker-disabled, .ant-picker-status-error) {
198
+ &:hover,
199
+ &.ant-picker-focused {
200
+ border-color: @primary-color!important;
201
+ }
200
202
  }
201
203
 
202
204
  .ant-picker-active-bar {
@@ -1,6 +1,13 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
7
  import React from 'react';
2
8
  import { BizCycleTime } from '@zgfe/business-lib';
3
9
  import { CycleTimeUnit } from '..';
10
+ import { Button, Form } from 'antd';
4
11
  export default (function () {
5
12
  var options = [{
6
13
  label: '每小时',
@@ -15,6 +22,9 @@ export default (function () {
15
22
  label: '每月',
16
23
  value: CycleTimeUnit.month
17
24
  }];
25
+ var _Form$useForm = Form.useForm(),
26
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
27
+ form = _Form$useForm2[0];
18
28
  var onChange = function onChange(data) {
19
29
  console.log('change:', data);
20
30
  };
@@ -34,5 +44,30 @@ export default (function () {
34
44
  options: options,
35
45
  format: "HH",
36
46
  onChange: onChange
37
- }));
47
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("b", null, "Form")), /*#__PURE__*/React.createElement(Form, {
48
+ form: form
49
+ }, /*#__PURE__*/React.createElement(Form.Item, {
50
+ label: "\u65E5\u671F",
51
+ name: "date",
52
+ rules: [{
53
+ validator: function validator(_, value) {
54
+ if (value.unit > 1 && !value.day.length) {
55
+ return Promise.reject('请选择日期');
56
+ }
57
+ if (value.unit > 0 && !value.time) {
58
+ return Promise.reject('请选择小时');
59
+ }
60
+ return Promise.resolve();
61
+ }
62
+ }]
63
+ }, /*#__PURE__*/React.createElement(BizCycleTime, {
64
+ multiple: true,
65
+ showHour: true,
66
+ options: options,
67
+ format: "HH",
68
+ onChange: onChange
69
+ })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
70
+ type: "primary",
71
+ htmlType: "submit"
72
+ }, "\u786E\u5B9A"))));
38
73
  });
@@ -5,10 +5,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { Dropdown, Tag } from 'antd';
8
- import React, { useEffect, useState } from 'react';
8
+ import React, { useContext, useEffect, useState } from 'react';
9
9
  import { IconFont } from '..';
10
10
  import './styles/month.less';
11
11
  import _ from 'lodash';
12
+ import { FormItemInputContext } from 'antd/es/form/context';
12
13
  var MonthDay = function MonthDay(props) {
13
14
  var classPrefix = 'biz-month-day';
14
15
  var disable = props.disable;
@@ -20,6 +21,8 @@ var MonthDay = function MonthDay(props) {
20
21
  _useState4 = _slicedToArray(_useState3, 2),
21
22
  visible = _useState4[0],
22
23
  setVisible = _useState4[1];
24
+ var _useContext = useContext(FormItemInputContext),
25
+ status = _useContext.status;
23
26
  var dayList = [];
24
27
  for (var i = 1; i < 33; i++) {
25
28
  dayList.push({
@@ -90,7 +93,7 @@ var MonthDay = function MonthDay(props) {
90
93
  }, /*#__PURE__*/React.createElement("div", {
91
94
  className: "".concat(classPrefix, "-wrapper")
92
95
  }, /*#__PURE__*/React.createElement("div", {
93
- className: "".concat(classPrefix, "-handle ").concat(props.size, " ").concat(!chosenDayList.length ? "holder" : '', " ").concat(disable ? 'disable' : '')
96
+ className: "".concat(classPrefix, "-handle ").concat(props.size, " ").concat(!chosenDayList.length ? "holder" : '', " ").concat(disable ? 'disable' : '').concat(status ? " ".concat(classPrefix, "-status-").concat(status) : '')
94
97
  }, /*#__PURE__*/React.createElement("div", {
95
98
  className: "".concat(classPrefix, "-val")
96
99
  }, chosenDayList.map(function (item) {
@@ -35,6 +35,13 @@
35
35
  &-holder {
36
36
  color: @input-placeholder-color;
37
37
  }
38
+
39
+ &-status-error:not(.disable) {
40
+ border-color: @error-color;
41
+ &.biz-month-day-handle:hover {
42
+ border-color: @error-color;
43
+ }
44
+ }
38
45
  &-val {
39
46
  flex: 1;
40
47
  .ant-tag {
@@ -46,6 +53,10 @@
46
53
  vertical-align: top;
47
54
  &.ant-dropdown-open > .biz-month-day-handle {
48
55
  .__default-focused();
56
+ &.biz-month-day-status-error:not(.disable) {
57
+ border-color: @error-color;
58
+ box-shadow: 0 0 0 4px rgba(#ff8170, 0.2) !important;
59
+ }
49
60
  }
50
61
  .biz-month-day-handle {
51
62
  &.disable {
@@ -156,5 +156,9 @@
156
156
  &.biz-select-handle-input:hover {
157
157
  border-color: @error-color;
158
158
  }
159
+ &.biz-select-handle-input.active:not(.disable) {
160
+ border-color: @error-color;
161
+ box-shadow: 0 0 0 4px rgba(#ff8170, 0.2) !important;
162
+ }
159
163
  }
160
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.11-data.0",
3
+ "version": "1.2.11-data.2",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -55,7 +55,7 @@
55
55
  "react": "^16.12.0 || ^17.0.0",
56
56
  "yorkie": "^2.0.0"
57
57
  },
58
- "gitHead": "dd0fcae68835a8dfbc1bacd80ed6a06c7f7a7e4c",
58
+ "gitHead": "d7b92f56d95d403c04fce4f5a19009bce1186820",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }