@zgfe/business-lib 1.0.24 → 1.0.25-adanalysis.0

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.
@@ -303,13 +303,15 @@
303
303
  .ant-modal-body {
304
304
  max-height: 400px;
305
305
  max-height: 400px !important;
306
- padding-top: @padding-xs !important;
307
- // padding-bottom: 0 !important;
308
306
  overflow: auto !important;
309
307
  &:not(:last-child) {
310
308
  padding-bottom: 0 !important;
311
309
  }
312
310
  }
311
+ //只有当有header的时候才修改body的间距
312
+ .ant-modal-header + .ant-modal-body {
313
+ padding-top: @padding-xs !important;
314
+ }
313
315
  }
314
316
 
315
317
  // 分页
@@ -35,9 +35,7 @@ var BizDate = function BizDate(props) {
35
35
  setDateRange(props.value ? props.value : initValue);
36
36
  }, []);
37
37
  useEffect(function () {
38
- var _props$dateCount;
39
-
40
- if (!((_props$dateCount = props.dateCount) === null || _props$dateCount === void 0 ? void 0 : _props$dateCount.count)) return;
38
+ if (!props.dateCount) return;
41
39
  var date = getDateRange(props.type, props.dateCount.count, !!includeToday);
42
40
  setDateRange(date);
43
41
  if (props.onChange) props.onChange(date, true);
@@ -16,15 +16,16 @@ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
16
16
  import { Divider, Switch } from 'antd';
17
17
  export default (function () {
18
18
  var _useState = useState({
19
- unit: 'week',
19
+ unit: 'day',
20
20
  begin: '2022-05-03',
21
- end: '2022-05-30'
21
+ end: '2022-05-30',
22
+ relative: [0, 1]
22
23
  }),
23
24
  _useState2 = _slicedToArray(_useState, 2),
24
25
  time = _useState2[0],
25
26
  setTime = _useState2[1];
26
27
 
27
- var _useState3 = useState(false),
28
+ var _useState3 = useState(true),
28
29
  _useState4 = _slicedToArray(_useState3, 2),
29
30
  includeToday = _useState4[0],
30
31
  setIncludeToday = _useState4[1];
@@ -39,6 +40,7 @@ export default (function () {
39
40
  defaultChecked: includeToday,
40
41
  onChange: setIncludeToday
41
42
  })), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BizDatePicker, {
43
+ includeTodayAndYesterday: true,
42
44
  onChange: handleChange,
43
45
  includeToday: includeToday,
44
46
  defaultValue: time
@@ -4,6 +4,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  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; }
6
6
 
7
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
11
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
+
13
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
+
7
15
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
16
 
9
17
  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,6 +56,19 @@ var BizDatePicker = function BizDatePicker(props) {
48
56
  useEffect(function () {
49
57
  var data = props.defaultValue || props.value;
50
58
 
59
+ if (props.includeTodayAndYesterday) {
60
+ var dayData = dateList.find(function (item) {
61
+ return item.value == 'day';
62
+ });
63
+ dayData.children = [{
64
+ value: '今天',
65
+ count: 0
66
+ }, {
67
+ value: '昨天',
68
+ count: 1
69
+ }].concat(_toConsumableArray(dayData.children));
70
+ }
71
+
51
72
  if (data) {
52
73
  setCurrentType(function () {
53
74
  var list = dateList.filter(function (item) {
@@ -108,7 +129,7 @@ var BizDatePicker = function BizDatePicker(props) {
108
129
  paragraph: {
109
130
  rows: 1
110
131
  }
111
- }, /*#__PURE__*/React.createElement(BizSelect, {
132
+ }, !props.hideSelector ? /*#__PURE__*/React.createElement(BizSelect, {
112
133
  className: "".concat(classPrefix, "-type"),
113
134
  value: currentType,
114
135
  labelField: "label",
@@ -116,7 +137,7 @@ var BizDatePicker = function BizDatePicker(props) {
116
137
  theme: "secondary",
117
138
  options: dateList,
118
139
  onChange: onChangeDateType
119
- }), /*#__PURE__*/React.createElement("div", {
140
+ }) : '', /*#__PURE__*/React.createElement("div", {
120
141
  className: "".concat(classPrefix, "-list")
121
142
  }, currentType.children.map(function (item, index) {
122
143
  return /*#__PURE__*/React.createElement("div", {
@@ -9,10 +9,11 @@
9
9
 
10
10
  &-list {
11
11
  display: flex;
12
- margin: 0 16px;
12
+ margin: 0 16px 0 0;
13
13
  }
14
14
 
15
15
  .biz-select-handle {
16
+ margin-right: 16px;
16
17
  padding: 0;
17
18
  }
18
19
 
@@ -12,6 +12,8 @@ export declare namespace DatePickerTypes {
12
12
  value?: Value;
13
13
  includeToday?: boolean;
14
14
  onChange?: (data: Value) => void;
15
+ includeTodayAndYesterday?: boolean;
16
+ hideSelector?: boolean;
15
17
  }
16
18
  interface Option {
17
19
  label: string;
@@ -50,7 +50,7 @@ export var dateList = [{
50
50
  }]
51
51
  }];
52
52
  export var getDateRange = function getDateRange(type, count, includeToday) {
53
- var endDate = moment().subtract(includeToday ? 0 : 1, 'days').format('YYYY-MM-DD'),
53
+ var endDate = moment().subtract(includeToday || count == 0 ? 0 : 1, 'days').format('YYYY-MM-DD'),
54
54
  startDate = '';
55
55
 
56
56
  if (type === 'month') {
@@ -105,11 +105,13 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
105
105
 
106
106
  return /*#__PURE__*/React.createElement("div", {
107
107
  ref: handleRef,
108
- className: "".concat(classPrefix, "-input ").concat(classPrefix, "-single-input ").concat(props.theme ? props.theme : '', "\n ").concat(props.disable ? 'disable' : '', " ").concat(focus ? 'active' : '', " \n ").concat(border ? '' : 'borderless', " ").concat(props.size ? props.size : 'middle'),
108
+ className: "".concat(classPrefix, "-input ").concat(props.theme ? props.theme : '', "\n ").concat(props.disable ? 'disable' : '', " ").concat(focus ? 'active' : '', " \n ").concat(border ? '' : 'borderless', " ").concat(props.size ? props.size : 'middle'),
109
109
  title: props.label || props.value && props.value[labelField]
110
+ }, /*#__PURE__*/React.createElement("span", {
111
+ className: "".concat(classPrefix, "-content")
110
112
  }, props.label || props.value && props.value[labelField] || /*#__PURE__*/React.createElement("span", {
111
113
  className: "".concat(classPrefix, "-holder")
112
- }, placeholder || '请选择'), /*#__PURE__*/React.createElement(IconFont, {
114
+ }, placeholder || '请选择')), /*#__PURE__*/React.createElement(IconFont, {
113
115
  className: "".concat(classPrefix, "-expand-icon"),
114
116
  type: 'xiangxia'
115
117
  }));
@@ -4,8 +4,7 @@
4
4
  &-input {
5
5
  position: relative;
6
6
  flex: 1;
7
- padding: 0px 8px;
8
-
7
+ padding: 0px 6px 0 8px;
9
8
  &.disable {
10
9
  .__disable();
11
10
  .bsicon {
@@ -78,24 +77,19 @@
78
77
  font-size: @font-size-base;
79
78
  }
80
79
 
81
- &-single-input {
82
- .__default-overflow();
83
- }
84
-
85
80
  &-holder {
86
81
  color: @input-placeholder-color;
87
82
  }
88
-
83
+ &-content {
84
+ flex: 1;
85
+ .__default-overflow();
86
+ }
89
87
  &-expand-icon {
90
- position: absolute;
91
- top: 50%;
92
- right: 8px;
93
- flex: none;
94
- color: @text-color-secondary;
95
- font-size: @font-size-lg;
96
- transform: translateY(-50%);
88
+ width: 14px;
89
+ margin-left: 5px;
97
90
  }
98
91
  &-input {
92
+ display: flex;
99
93
  #biz-select-handle-tag {
100
94
  display: flex;
101
95
  align-items: center;
@@ -7,6 +7,7 @@
7
7
 
8
8
  .biz-event-select {
9
9
  flex: 1;
10
+ width: 0;
10
11
  }
11
12
 
12
13
  .biz-event-select-handle {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.24",
3
+ "version": "1.0.25-adanalysis.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -58,5 +58,5 @@
58
58
  "react": "^16.12.0 || ^17.0.0",
59
59
  "yorkie": "^2.0.0"
60
60
  },
61
- "gitHead": "ac0ce337e692e43ec70d2ae2fadb4a4927904478"
61
+ "gitHead": "bfb2df4f117bea94dc893d008f45770d8296b9ca"
62
62
  }