@zgfe/business-lib 1.0.21-cdp.6 → 1.0.21-cdp.9

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.
@@ -108,8 +108,6 @@
108
108
 
109
109
  // 下拉框默认样式
110
110
  .__select-default {
111
- height: @height-lg;
112
- line-height: @height-lg;
113
111
  background-color: @background-color-base;
114
112
  border: 1px solid @background-color-base;
115
113
  border-radius: @border-radius-small;
@@ -165,7 +165,7 @@ var StringList = function StringList(props) {
165
165
  multiple: true,
166
166
  enableCreate: true,
167
167
  theme: props.theme,
168
- size: "base",
168
+ size: "middle",
169
169
  className: "".concat(classPrefix, "-multi-select"),
170
170
  options: [],
171
171
  disable: true
@@ -178,7 +178,7 @@ var StringList = function StringList(props) {
178
178
  multiple: true,
179
179
  enableCreate: true,
180
180
  theme: props.theme,
181
- size: "base",
181
+ size: "middle",
182
182
  disable: props.operate === OperateTypes.IsNull || props.operate === OperateTypes.IsNotNull,
183
183
  labelField: "name",
184
184
  keyField: "value",
@@ -1,2 +1,3 @@
1
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
1
2
  declare const _default: () => JSX.Element;
2
3
  export default _default;
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BizCycleTime } from '@zgfe/business-lib';
3
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
4
+ import { Form } from 'antd';
3
5
  export default (function () {
4
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizCycleTime, null));
6
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(BizCycleTime, null))));
5
7
  });
@@ -1,17 +1,19 @@
1
+ import { SizeType } from 'antd/es/config-provider/SizeContext';
1
2
  import React from 'react';
2
3
  import './styles/index.less';
3
- declare enum Unit {
4
- day = "day",
5
- week = "week",
6
- month = "month"
4
+ export declare enum CycleTimeUnit {
5
+ day = 1,
6
+ week = 2,
7
+ month = 3
7
8
  }
8
9
  interface Value {
9
- unit: Unit;
10
+ unit: CycleTimeUnit;
10
11
  day?: number[];
11
12
  time?: string;
12
13
  }
13
14
  declare const BizCycleTime: React.FC<{
14
15
  multiple?: boolean;
15
16
  onChange?: (val: Value) => void;
17
+ size?: SizeType;
16
18
  }>;
17
19
  export default BizCycleTime;
@@ -15,26 +15,27 @@ import React, { useEffect, useState } from 'react';
15
15
  import { BizSelect } from '..';
16
16
  import MonthDay from './month';
17
17
  import './styles/index.less';
18
- var Unit;
18
+ export var CycleTimeUnit;
19
19
 
20
- (function (Unit) {
21
- Unit["day"] = "day";
22
- Unit["week"] = "week";
23
- Unit["month"] = "month";
24
- })(Unit || (Unit = {}));
20
+ (function (CycleTimeUnit) {
21
+ CycleTimeUnit[CycleTimeUnit["day"] = 1] = "day";
22
+ CycleTimeUnit[CycleTimeUnit["week"] = 2] = "week";
23
+ CycleTimeUnit[CycleTimeUnit["month"] = 3] = "month";
24
+ })(CycleTimeUnit || (CycleTimeUnit = {}));
25
25
 
26
26
  var BizCycleTime = function BizCycleTime(props) {
27
- var multiple = props.multiple;
27
+ var multiple = props.multiple,
28
+ size = props.size;
28
29
  var classPrefix = 'biz-cycle-time';
29
30
  var unitList = [{
30
31
  label: '每日',
31
- value: Unit.day
32
+ value: CycleTimeUnit.day
32
33
  }, {
33
34
  label: '每周',
34
- value: Unit.week
35
+ value: CycleTimeUnit.week
35
36
  }, {
36
37
  label: '每月',
37
- value: Unit.month
38
+ value: CycleTimeUnit.month
38
39
  }];
39
40
  var days = [];
40
41
 
@@ -61,7 +62,7 @@ var BizCycleTime = function BizCycleTime(props) {
61
62
  useEffect(function () {
62
63
  var res = {
63
64
  unit: unit.value,
64
- day: unit.value === Unit.month ? dayList === null || dayList === void 0 ? void 0 : dayList.map(function (item) {
65
+ day: unit.value === CycleTimeUnit.month ? dayList === null || dayList === void 0 ? void 0 : dayList.map(function (item) {
65
66
  return item.value;
66
67
  }) : multiple ? day.map(function (item) {
67
68
  return item.value;
@@ -69,7 +70,7 @@ var BizCycleTime = function BizCycleTime(props) {
69
70
  time: time
70
71
  };
71
72
 
72
- if (unit.value === Unit.day) {
73
+ if (unit.value === CycleTimeUnit.day) {
73
74
  delete res.day;
74
75
  } else {
75
76
  delete res.time;
@@ -94,29 +95,33 @@ var BizCycleTime = function BizCycleTime(props) {
94
95
  keyField: "value",
95
96
  className: "".concat(classPrefix, "-unit"),
96
97
  defaultValue: unit,
98
+ size: size,
97
99
  onChange: function onChange(v) {
98
100
  setUnit(v);
99
101
  }
100
- }), unit.value === Unit.day && /*#__PURE__*/React.createElement(DatePicker.TimePicker, {
102
+ }), unit.value === CycleTimeUnit.day && /*#__PURE__*/React.createElement(DatePicker.TimePicker, {
101
103
  className: "".concat(classPrefix, "-hour"),
104
+ size: size,
102
105
  onChange: function onChange(time) {
103
106
  setTime(time === null || time === void 0 ? void 0 : time.format('hh:mm:ss'));
104
107
  }
105
- }), unit.value === Unit.week && /*#__PURE__*/React.createElement(BizSelect, {
108
+ }), unit.value === CycleTimeUnit.week && /*#__PURE__*/React.createElement(BizSelect, {
106
109
  options: days,
107
110
  labelField: "label",
108
111
  keyField: "value",
112
+ size: size,
109
113
  multiple: multiple,
110
114
  className: "".concat(classPrefix, "-day"),
111
115
  onChange: function onChange(v) {
112
116
  setDay(v);
113
117
  }
114
- }), unit.value === Unit.month && /*#__PURE__*/React.createElement(MonthDay, {
118
+ }), unit.value === CycleTimeUnit.month && /*#__PURE__*/React.createElement(MonthDay, {
115
119
  onChange: setDayList
116
120
  }));
117
121
  };
118
122
 
119
123
  BizCycleTime.defaultProps = {
120
- multiple: false
124
+ multiple: false,
125
+ size: 'middle'
121
126
  };
122
127
  export default BizCycleTime;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import './styles/month.less';
3
3
  import { BaseOption } from '../utils/type';
4
+ import { SizeType } from 'antd/es/config-provider/SizeContext';
4
5
  declare const MonthDay: React.FC<{
5
- size?: 'large' | 'normal' | 'small';
6
+ size?: SizeType;
6
7
  className?: string;
7
8
  onChange?: (days: BaseOption<number>[]) => void;
8
9
  }>;
@@ -95,6 +95,6 @@ var MonthDay = function MonthDay(props) {
95
95
  };
96
96
 
97
97
  MonthDay.defaultProps = {
98
- size: 'normal'
98
+ size: 'middle'
99
99
  };
100
100
  export default MonthDay;
@@ -1,18 +1,16 @@
1
1
  @import '../../assets//styles/inner.less';
2
2
  .biz-month-day {
3
3
  &-handle {
4
- .__select-handle();
4
+ .__select-default();
5
5
  display: flex;
6
6
  flex-direction: row;
7
7
  width: 280px;
8
- &:hover,
9
- &:active {
10
- .__default-focused();
11
- }
8
+ padding: @padding-xss - 1 @padding-xss 0 @padding-xss;
9
+ white-space: break-spaces;
12
10
  &.large {
13
11
  min-height: @height-lg;
14
12
  }
15
- &.normal {
13
+ &.middle {
16
14
  min-height: @height-base;
17
15
  }
18
16
  &.small {
@@ -197,6 +197,6 @@ BizSelect.defaultProps = {
197
197
  keyField: 'id',
198
198
  popupContainer: true,
199
199
  destroyPopupOnHide: true,
200
- size: 'base'
200
+ size: 'middle'
201
201
  };
202
202
  export default BizSelect;
@@ -20,18 +20,18 @@
20
20
  border: none;
21
21
  }
22
22
 
23
- &.lg {
23
+ &.large {
24
24
  height: @height-lg;
25
25
  font-size: @font-size-lg;
26
26
  line-height: @height-lg;
27
27
  }
28
28
 
29
- &.sm {
29
+ &.small {
30
30
  height: @height-sm;
31
31
  line-height: @height-sm;
32
32
  }
33
33
 
34
- &.base {
34
+ &.middle {
35
35
  height: @height-base;
36
36
  line-height: @height-base;
37
37
  }
@@ -45,12 +45,12 @@
45
45
  height: auto;
46
46
  overflow: visible;
47
47
  line-height: 1;
48
- &.sm {
48
+ &.small {
49
49
  height: auto;
50
50
  min-height: @height-sm;
51
51
  }
52
52
 
53
- &.base {
53
+ &.middle {
54
54
  height: auto;
55
55
  min-height: @height-base;
56
56
  }
@@ -1,3 +1,4 @@
1
+ import { SizeType } from 'antd/es/config-provider/SizeContext';
1
2
  import { ReactNode } from 'react';
2
3
  export declare namespace BizSelectTypes {
3
4
  interface Group {
@@ -16,7 +17,7 @@ export declare namespace BizSelectTypes {
16
17
  className?: string;
17
18
  type?: 'group' | 'normal';
18
19
  theme?: string;
19
- size?: 'lg' | 'base' | 'sm';
20
+ size?: SizeType;
20
21
  border?: boolean;
21
22
  multiple?: boolean;
22
23
  minDropdownWidth?: number;
@@ -65,7 +66,7 @@ export interface HandlerTypes {
65
66
  keyField?: string | number;
66
67
  disable?: boolean;
67
68
  theme?: string;
68
- size?: 'lg' | 'base' | 'sm';
69
+ size?: SizeType;
69
70
  border?: boolean;
70
71
  onDelete?: (data: BizSelectTypes.Option) => void;
71
72
  onSearch?: (val: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.21-cdp.6",
3
+ "version": "1.0.21-cdp.9",
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": "678ee4c35972fecb35fe80d13259a69e651f8b6d"
61
+ "gitHead": "dab7c9facdadd1dbab45ef27728d93f9558b6334"
62
62
  }