@qn-pandora/pandora-component 4.1.7 → 4.3.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.
Files changed (59) hide show
  1. package/CHANGELOG.json +25 -8
  2. package/CHANGELOG.md +12 -5
  3. package/es/components/DateTimePicker/Base/index.d.ts +6 -1
  4. package/es/components/DateTimePicker/Base/index.js +44 -17
  5. package/es/components/DateTimePicker/Base/relativeTimePicker.js +10 -7
  6. package/es/components/DateTimePicker/constants.d.ts +57 -1
  7. package/es/components/DateTimePicker/constants.js +3 -5
  8. package/es/components/DateTimePicker/time.js +2 -2
  9. package/es/components/DateTimePicker/transform.d.ts +5 -1
  10. package/es/components/DateTimePicker/transform.js +3 -2
  11. package/es/components/Drawer/index.d.ts +21 -1
  12. package/es/components/Drawer/index.js +74 -13
  13. package/es/components/Drawer/style.css +11 -0
  14. package/es/components/Drawer/style.less +13 -0
  15. package/es/components/RadioGroup/style.css +7 -0
  16. package/es/components/RadioGroup/style.less +9 -0
  17. package/es/components/Table/ColumnSetting/index.d.ts +16 -0
  18. package/es/components/Table/ColumnSetting/index.js +91 -0
  19. package/es/components/Table/ColumnSetting/style.css +47 -0
  20. package/es/components/Table/ColumnSetting/style.less +46 -0
  21. package/es/components/Table/index.d.ts +27 -2
  22. package/es/components/Table/index.js +127 -3
  23. package/es/components/Table/style.css +4 -0
  24. package/es/components/Table/style.less +7 -0
  25. package/es/constants/language/table/en.js +4 -1
  26. package/es/constants/language/table/type.d.ts +3 -0
  27. package/es/constants/language/table/zh.js +4 -1
  28. package/es/index.css +2758 -2689
  29. package/es/index.less +5 -4
  30. package/es/style/theme.less +5 -0
  31. package/lib/components/DateTimePicker/Base/index.d.ts +6 -1
  32. package/lib/components/DateTimePicker/Base/index.js +43 -16
  33. package/lib/components/DateTimePicker/Base/relativeTimePicker.js +8 -5
  34. package/lib/components/DateTimePicker/constants.d.ts +57 -1
  35. package/lib/components/DateTimePicker/constants.js +3 -5
  36. package/lib/components/DateTimePicker/time.js +1 -1
  37. package/lib/components/DateTimePicker/transform.d.ts +5 -1
  38. package/lib/components/DateTimePicker/transform.js +3 -2
  39. package/lib/components/Drawer/index.d.ts +21 -1
  40. package/lib/components/Drawer/index.js +74 -13
  41. package/lib/components/Drawer/style.css +11 -0
  42. package/lib/components/Drawer/style.less +13 -0
  43. package/lib/components/RadioGroup/style.css +7 -0
  44. package/lib/components/RadioGroup/style.less +9 -0
  45. package/lib/components/Table/ColumnSetting/index.d.ts +16 -0
  46. package/lib/components/Table/ColumnSetting/index.js +104 -0
  47. package/lib/components/Table/ColumnSetting/style.css +47 -0
  48. package/lib/components/Table/ColumnSetting/style.less +46 -0
  49. package/lib/components/Table/index.d.ts +27 -2
  50. package/lib/components/Table/index.js +126 -2
  51. package/lib/components/Table/style.css +4 -0
  52. package/lib/components/Table/style.less +7 -0
  53. package/lib/constants/language/table/en.js +4 -1
  54. package/lib/constants/language/table/type.d.ts +3 -0
  55. package/lib/constants/language/table/zh.js +4 -1
  56. package/lib/index.css +2295 -2226
  57. package/lib/index.less +3 -2
  58. package/lib/style/theme.less +5 -0
  59. package/package.json +6 -5
package/CHANGELOG.json CHANGED
@@ -2,24 +2,41 @@
2
2
  "name": "@qn-pandora/pandora-component",
3
3
  "entries": [
4
4
  {
5
- "version": "4.1.7",
6
- "tag": "@qn-pandora/pandora-component_v4.1.7",
7
- "date": "Tue, 29 Aug 2023 06:22:20 GMT",
5
+ "version": "4.3.0",
6
+ "tag": "@qn-pandora/pandora-component_v4.3.0",
7
+ "date": "Tue, 24 Oct 2023 08:06:30 GMT",
8
8
  "comments": {
9
- "patch": [
9
+ "minor": [
10
10
  {
11
- "comment": "2023-08-29发包"
11
+ "comment": "2023-10-24发包"
12
12
  }
13
13
  ],
14
14
  "dependency": [
15
15
  {
16
- "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.1.6` to `^3.1.7`"
16
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.2.0` to `^3.3.0`"
17
17
  },
18
18
  {
19
- "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.1.6` to `^3.1.7`"
19
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.2.0` to `^3.3.0`"
20
+ }
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "version": "4.2.0",
26
+ "tag": "@qn-pandora/pandora-component_v4.2.0",
27
+ "date": "Mon, 25 Sep 2023 07:36:39 GMT",
28
+ "comments": {
29
+ "minor": [
30
+ {
31
+ "comment": "2023-09-25发包"
32
+ }
33
+ ],
34
+ "dependency": [
35
+ {
36
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.1.6` to `^3.2.0`"
20
37
  },
21
38
  {
22
- "comment": "Updating dependency \"@qn-pandora/pandora-tools\" from `^2.0.15` to `^2.0.16`"
39
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.1.6` to `^3.2.0`"
23
40
  }
24
41
  ]
25
42
  }
package/CHANGELOG.md CHANGED
@@ -1,13 +1,20 @@
1
1
  # Change Log - @qn-pandora/pandora-component
2
2
 
3
- This log was last generated on Tue, 29 Aug 2023 06:22:20 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 24 Oct 2023 08:06:30 GMT and should not be manually modified.
4
4
 
5
- ## 4.1.7
6
- Tue, 29 Aug 2023 06:22:20 GMT
5
+ ## 4.3.0
6
+ Tue, 24 Oct 2023 08:06:30 GMT
7
7
 
8
- ### Patches
8
+ ### Minor changes
9
+
10
+ - 2023-10-24发包
11
+
12
+ ## 4.2.0
13
+ Mon, 25 Sep 2023 07:36:39 GMT
14
+
15
+ ### Minor changes
9
16
 
10
- - 2023-08-29发包
17
+ - 2023-09-25发包
11
18
 
12
19
  ## 4.1.6
13
20
  Fri, 25 Aug 2023 10:29:46 GMT
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as moment from 'moment';
3
3
  import { ICompositedTime } from './relativeTimePicker';
4
- import { EPresetMode, IPreset, RangePreset, IRelativeTime, IQuarterTime, IBaseProps, TimeType } from '../constants';
4
+ import { EPresetMode, IPreset, RangePreset, IRelativeTime, IQuarterTime, IBaseProps, TimeType, IRelativeTimeUnit } from '../constants';
5
5
  declare enum RelativeInvalid {
6
6
  Valid = 0,
7
7
  From = 1,
@@ -51,6 +51,11 @@ export default class Base extends React.Component<IBaseProps, any> {
51
51
  getYears(): number[];
52
52
  constructor(props: IBaseProps);
53
53
  UNSAFE_componentWillReceiveProps(nextProps: IBaseProps): void;
54
+ getRelativeMap(relativeTimeUnits: IRelativeTimeUnit[]): IKeyValues<{
55
+ text: string;
56
+ value: string;
57
+ time: (num: number) => moment.Moment;
58
+ }>;
54
59
  isRelativeTimeValidFunc(from: ICompositedTime, to: ICompositedTime): boolean;
55
60
  getAllPresetItems(): JSX.Element[];
56
61
  handlePresetClick(preset: IPreset): void;
@@ -50,7 +50,7 @@ import Selector from '../../Selector';
50
50
  import NameLimiter from '../../NameLimiter';
51
51
  import RelativeTimePicker from './relativeTimePicker';
52
52
  import Time from '../time';
53
- import { defaultPresets, EPresetMode, relativeMap, RangePreset, rangePresetOptions, TimeType, RelativeUnitValue } from '../constants';
53
+ import { defaultPresets, EPresetMode, RangePreset, rangePresetOptions, TimeType, RelativeUnitValue, RELATIVE_TIME_UNITS } from '../constants';
54
54
  import { Quarters } from './constants';
55
55
  var Panel = Collapse.Panel;
56
56
  var RelativeInvalid;
@@ -71,17 +71,22 @@ export var RELATIVE_DEFAULT_VALUE = {
71
71
  var Base = /** @class */ (function (_super) {
72
72
  __extends(Base, _super);
73
73
  function Base(props) {
74
+ var _a, _b, _c, _d;
74
75
  var _this = _super.call(this, props) || this;
75
76
  _this.range = [undefined, undefined];
76
77
  _this.rangePreset = RangePreset.BetweenTime;
77
78
  _this.relative = {
78
79
  from: {
79
- num: RELATIVE_DEFAULT_VALUE.FROM_NUM,
80
- unit: RELATIVE_DEFAULT_VALUE.FROM_UNIT
80
+ num: ((_a = _this.props.defaultRelativeValue) === null || _a === void 0 ? void 0 : _a.from.num) ||
81
+ RELATIVE_DEFAULT_VALUE.FROM_NUM,
82
+ unit: ((_b = _this.props.defaultRelativeValue) === null || _b === void 0 ? void 0 : _b.from.unit) ||
83
+ RELATIVE_DEFAULT_VALUE.FROM_UNIT
81
84
  },
82
85
  to: {
83
- num: RELATIVE_DEFAULT_VALUE.TO_NUM,
84
- unit: RELATIVE_DEFAULT_VALUE.TO_UNIT
86
+ num: ((_c = _this.props.defaultRelativeValue) === null || _c === void 0 ? void 0 : _c.to.num) ||
87
+ RELATIVE_DEFAULT_VALUE.TO_NUM,
88
+ unit: ((_d = _this.props.defaultRelativeValue) === null || _d === void 0 ? void 0 : _d.to.unit) ||
89
+ RELATIVE_DEFAULT_VALUE.TO_UNIT
85
90
  }
86
91
  };
87
92
  _this.relativeTimeInValid = RelativeInvalid.Valid;
@@ -233,9 +238,21 @@ var Base = /** @class */ (function (_super) {
233
238
  }
234
239
  }
235
240
  };
241
+ Base.prototype.getRelativeMap = function (relativeTimeUnits) {
242
+ var res = {};
243
+ relativeTimeUnits.forEach(function (relative) {
244
+ res[relative.value] = relative;
245
+ });
246
+ return res;
247
+ };
236
248
  Base.prototype.isRelativeTimeValidFunc = function (from, to) {
237
- var fromDate = relativeMap[from.unit].time(from.num).valueOf();
238
- var toDate = relativeMap[to.unit].time(to.num).valueOf();
249
+ var _a = this.props, relativeTimeUnits = _a.relativeTimeUnits, relativeStartTimeUnits = _a.relativeStartTimeUnits, relativeEndTimeUnits = _a.relativeEndTimeUnits;
250
+ var start = relativeStartTimeUnits || relativeTimeUnits || RELATIVE_TIME_UNITS;
251
+ var end = relativeEndTimeUnits || relativeTimeUnits || RELATIVE_TIME_UNITS;
252
+ var startRelativeMap = this.getRelativeMap(start);
253
+ var endRelativeMap = this.getRelativeMap(end);
254
+ var fromDate = startRelativeMap["" + from.unit].time(from.num).valueOf();
255
+ var toDate = endRelativeMap["" + to.unit].time(to.num).valueOf();
239
256
  return fromDate < toDate;
240
257
  };
241
258
  Base.prototype.getAllPresetItems = function () {
@@ -262,14 +279,14 @@ var Base = /** @class */ (function (_super) {
262
279
  }
263
280
  };
264
281
  Base.prototype.handlePickerOk = function () {
265
- var onChange = this.props.onChange;
282
+ var _a = this.props, onChange = _a.onChange, showTime = _a.showTime;
266
283
  if (onChange) {
267
284
  var start = this.range[0];
268
285
  var end = this.range[1];
269
286
  onChange(new Time({
270
287
  // 赋值时将毫秒数清零
271
- start: start === null || start === void 0 ? void 0 : start.milliseconds(0),
272
- end: end === null || end === void 0 ? void 0 : end.milliseconds(0),
288
+ start: showTime === false ? start === null || start === void 0 ? void 0 : start.startOf('day') : start === null || start === void 0 ? void 0 : start.milliseconds(0),
289
+ end: showTime === false ? end === null || end === void 0 ? void 0 : end.startOf('day') : end === null || end === void 0 ? void 0 : end.milliseconds(0),
273
290
  rangePreset: this.rangePreset
274
291
  }));
275
292
  }
@@ -328,22 +345,26 @@ var Base = /** @class */ (function (_super) {
328
345
  };
329
346
  Base.prototype.renderRelativeContent = function () {
330
347
  var _a;
348
+ var _b, _c, _d, _e;
331
349
  var locale = this.context.locale;
332
- var fromNum = _.get(this.relative, 'from.num', RELATIVE_DEFAULT_VALUE.FROM_NUM);
333
- var fromUnit = _.get(this.relative, 'from.unit', RELATIVE_DEFAULT_VALUE.FROM_UNIT);
334
- var toNum = _.get(this.relative, 'to.num', RELATIVE_DEFAULT_VALUE.TO_NUM);
335
- var toUnit = _.get(this.relative, 'to.unit', RELATIVE_DEFAULT_VALUE.TO_UNIT);
350
+ var fromNum = _.get(this.relative, 'from.num', ((_b = this.props.defaultRelativeValue) === null || _b === void 0 ? void 0 : _b.from.num) ||
351
+ RELATIVE_DEFAULT_VALUE.FROM_NUM);
352
+ var fromUnit = _.get(this.relative, 'from.unit', ((_c = this.props.defaultRelativeValue) === null || _c === void 0 ? void 0 : _c.from.unit) ||
353
+ RELATIVE_DEFAULT_VALUE.FROM_UNIT);
354
+ var toNum = _.get(this.relative, 'to.num', ((_d = this.props.defaultRelativeValue) === null || _d === void 0 ? void 0 : _d.to.num) || RELATIVE_DEFAULT_VALUE.TO_NUM);
355
+ var toUnit = _.get(this.relative, 'to.unit', ((_e = this.props.defaultRelativeValue) === null || _e === void 0 ? void 0 : _e.to.unit) || RELATIVE_DEFAULT_VALUE.TO_UNIT);
356
+ var _f = this.props, relativeStartTimeUnits = _f.relativeStartTimeUnits, relativeEndTimeUnits = _f.relativeEndTimeUnits, relativeTimeUnits = _f.relativeTimeUnits;
336
357
  if (!this.isRangePicker()) {
337
358
  return (React.createElement("div", { className: SDK_PREFIX + "-datetime-pick-content" },
338
359
  React.createElement("div", { className: SDK_PREFIX + "-datetime-pick-relative-container" },
339
- React.createElement(RelativeTimePicker, { className: SDK_PREFIX + "-datetime-pick-relative", num: fromNum, unit: fromUnit, onChange: this.handleRetiveTimeFromChange, relativeTimeUnits: this.props.relativeTimeUnits }),
360
+ React.createElement(RelativeTimePicker, { className: SDK_PREFIX + "-datetime-pick-relative", num: fromNum, unit: fromUnit, onChange: this.handleRetiveTimeFromChange, relativeTimeUnits: relativeStartTimeUnits || relativeTimeUnits }),
340
361
  React.createElement(Button, { disabled: !this.isRelativeTimeValid, className: SDK_PREFIX + "-datetime-pick-relative-confirm", onClick: this.handleRelativeChange }, formatString(DateTimeLocale.confirm, locale)))));
341
362
  }
342
363
  return (React.createElement("div", { className: SDK_PREFIX + "-datetime-pick-content" },
343
364
  React.createElement("div", { className: SDK_PREFIX + "-datetime-pick-relative-container" },
344
- React.createElement(RelativeTimePicker, { className: SDK_PREFIX + "-datetime-pick-relative-timepicker", num: fromNum, unit: fromUnit, onChange: this.handleRetiveTimeFromChange, relativeTimeUnits: this.props.relativeTimeUnits, withoutNow: true }),
365
+ React.createElement(RelativeTimePicker, { className: SDK_PREFIX + "-datetime-pick-relative-timepicker", num: fromNum, unit: fromUnit, onChange: this.handleRetiveTimeFromChange, relativeTimeUnits: relativeStartTimeUnits || relativeTimeUnits, withoutNow: true }),
345
366
  React.createElement("span", { className: SDK_PREFIX + "-datetime-pick-relative-container-to" }, formatString(DateTimeLocale.to, locale)),
346
- React.createElement(RelativeTimePicker, { className: SDK_PREFIX + "-datetime-pick-relative-timepicker", num: toNum, unit: toUnit, onChange: this.handleRetiveTimeToChange, relativeTimeUnits: this.props.relativeTimeUnits })),
367
+ React.createElement(RelativeTimePicker, { className: SDK_PREFIX + "-datetime-pick-relative-timepicker", num: toNum, unit: toUnit, onChange: this.handleRetiveTimeToChange, relativeTimeUnits: relativeEndTimeUnits || relativeTimeUnits })),
347
368
  React.createElement("div", { className: classnames(SDK_PREFIX + "-datetime-pick-relative-footer", (_a = {},
348
369
  _a[SDK_PREFIX + "-datetime-pick-relative-footer-witNow"] = toUnit === RelativeUnitValue.NowStatic,
349
370
  _a)) },
@@ -521,6 +542,12 @@ var Base = /** @class */ (function (_super) {
521
542
  __metadata("design:paramtypes", [Object]),
522
543
  __metadata("design:returntype", void 0)
523
544
  ], Base.prototype, "setRelative", null);
545
+ __decorate([
546
+ bind,
547
+ __metadata("design:type", Function),
548
+ __metadata("design:paramtypes", [Array]),
549
+ __metadata("design:returntype", void 0)
550
+ ], Base.prototype, "getRelativeMap", null);
524
551
  __decorate([
525
552
  bind,
526
553
  __metadata("design:type", Function),
@@ -14,14 +14,14 @@ var __extends = (this && this.__extends) || (function () {
14
14
  import * as React from 'react';
15
15
  import { InputNumber } from 'antd';
16
16
  import { ConfigContext } from 'antd/es/config-provider';
17
- import { isNil } from 'lodash';
17
+ import { isNil, find } from 'lodash';
18
18
  import classnames from 'classnames';
19
19
  import { formatString } from '../../../utils/language';
20
20
  import { SDK_PREFIX } from '../../../constants/style';
21
21
  import { DateTimeLocale } from '../../../constants/language/datetime/type';
22
22
  import { toFormatTime } from '../../../utils/time';
23
23
  import Selector from '../../Selector';
24
- import { relativeTimeUnits, RelativeUnitValue } from '../constants';
24
+ import { RELATIVE_TIME_UNITS, RelativeUnitValue } from '../constants';
25
25
  var RetiveTimePicker = /** @class */ (function (_super) {
26
26
  __extends(RetiveTimePicker, _super);
27
27
  function RetiveTimePicker() {
@@ -60,16 +60,19 @@ var RetiveTimePicker = /** @class */ (function (_super) {
60
60
  return _this.containerRef.current || document.body;
61
61
  };
62
62
  _this.shouldShowInput = function () {
63
- var unit = _this.props.unit;
64
- return (unit !== RelativeUnitValue.Now && unit !== RelativeUnitValue.NowStatic);
63
+ var _a;
64
+ var _b = _this.props, unit = _b.unit, relativeTimeUnits = _b.relativeTimeUnits;
65
+ return (unit !== RelativeUnitValue.Now &&
66
+ unit !== RelativeUnitValue.NowStatic &&
67
+ ((_a = find(relativeTimeUnits || RELATIVE_TIME_UNITS, function (item) { return item.value === unit; })) === null || _a === void 0 ? void 0 : _a.static) !== true);
65
68
  };
66
69
  return _this;
67
70
  }
68
71
  RetiveTimePicker.prototype.render = function () {
69
- var _a = this.props, num = _a.num, unit = _a.unit, className = _a.className, withoutNow = _a.withoutNow;
72
+ var _a = this.props, num = _a.num, unit = _a.unit, className = _a.className, withoutNow = _a.withoutNow, relativeTimeUnits = _a.relativeTimeUnits;
70
73
  var locale = this.context.locale;
71
- var options = this.props.relativeTimeUnits ||
72
- relativeTimeUnits.map(function (option) {
74
+ var options = relativeTimeUnits ||
75
+ RELATIVE_TIME_UNITS.map(function (option) {
73
76
  return {
74
77
  text: formatString(option.text, locale),
75
78
  value: option.value,
@@ -32,6 +32,28 @@ export interface IPreset {
32
32
  export interface IRelativeTimeUnit {
33
33
  text: string;
34
34
  value: string;
35
+ /**
36
+ * 是否是一个能完整表达的静态时间,例如昨天、前天、上个月,不需要用户再额外输入数字
37
+ *
38
+ * 例:
39
+ * 像两天前,或者几天前,需要用户输入一个数字来确定具体的时间,就是不完整时间。
40
+ * {
41
+ text: '天前',
42
+ value: 'day',
43
+ static: false,
44
+ time: (num: number) => moment().startOf('day').subtract(num, 'days')
45
+ }
46
+ *
47
+
48
+ * 像 昨天、前天、上个月,不需要用户再额外输入数字。
49
+ * {
50
+ text: '昨天',
51
+ value: 'yesterday',
52
+ static: true,
53
+ time: (_: number) => moment().startOf('day').subtract(1, 'days')
54
+ }
55
+ */
56
+ static?: boolean;
35
57
  time: (num: number) => moment.Moment;
36
58
  }
37
59
  export declare const defaultPresets: IPreset[];
@@ -55,10 +77,32 @@ export declare enum RelativeUnitValue {
55
77
  Quarter = "Q",
56
78
  Year = "y"
57
79
  }
58
- export declare const relativeTimeUnits: IRelativeTimeUnit[];
80
+ export declare const RELATIVE_TIME_UNITS: IRelativeTimeUnit[];
59
81
  export declare const relativeTimeUnitsWithoutNowStatic: {
60
82
  text: string;
61
83
  value: string;
84
+ /**
85
+ * 是否是一个能完整表达的静态时间,例如昨天、前天、上个月,不需要用户再额外输入数字
86
+ *
87
+ * 例:
88
+ * 像两天前,或者几天前,需要用户输入一个数字来确定具体的时间,就是不完整时间。
89
+ * {
90
+ text: '天前',
91
+ value: 'day',
92
+ static: false,
93
+ time: (num: number) => moment().startOf('day').subtract(num, 'days')
94
+ }
95
+ *
96
+
97
+ * 像 昨天、前天、上个月,不需要用户再额外输入数字。
98
+ * {
99
+ text: '昨天',
100
+ value: 'yesterday',
101
+ static: true,
102
+ time: (_: number) => moment().startOf('day').subtract(1, 'days')
103
+ }
104
+ */
105
+ static?: boolean | undefined;
62
106
  time: (num: number) => moment.Moment;
63
107
  }[];
64
108
  export declare const relativeMap: IKeyValues<{
@@ -114,6 +158,14 @@ export interface IBaseProps {
114
158
  * 预设
115
159
  */
116
160
  presets?: IPreset[];
161
+ /**
162
+ * 自定义相对时间单位(开始)
163
+ */
164
+ relativeStartTimeUnits?: IRelativeTimeUnit[];
165
+ /**
166
+ * 自定义相对时间单位(结束)
167
+ */
168
+ relativeEndTimeUnits?: IRelativeTimeUnit[];
117
169
  /**
118
170
  * 自定义相对时间单位
119
171
  */
@@ -196,6 +248,10 @@ export interface IBaseProps {
196
248
  * 语言
197
249
  */
198
250
  locale?: string;
251
+ /**
252
+ * 默认的相对时间
253
+ */
254
+ defaultRelativeValue?: IRelativeTime;
199
255
  }
200
256
  export interface ITimeRange {
201
257
  relative?: IRelativeTime;
@@ -242,7 +242,7 @@ export var RelativeUnitValue;
242
242
  RelativeUnitValue["Quarter"] = "Q";
243
243
  RelativeUnitValue["Year"] = "y";
244
244
  })(RelativeUnitValue || (RelativeUnitValue = {}));
245
- export var relativeTimeUnits = [
245
+ export var RELATIVE_TIME_UNITS = [
246
246
  {
247
247
  text: DateTimeLocale.relative.now,
248
248
  value: RelativeUnitValue.Now,
@@ -294,15 +294,13 @@ export var relativeTimeUnits = [
294
294
  time: function (num) { return moment().subtract(num, 'years'); }
295
295
  }
296
296
  ];
297
- export var relativeTimeUnitsWithoutNowStatic = relativeTimeUnits
298
- .filter(function (item) { return item.value !== RelativeUnitValue.NowStatic; })
299
- .map(function (item) {
297
+ export var relativeTimeUnitsWithoutNowStatic = RELATIVE_TIME_UNITS.filter(function (item) { return item.value !== RelativeUnitValue.NowStatic; }).map(function (item) {
300
298
  return item.value === RelativeUnitValue.Now
301
299
  ? __assign(__assign({}, item), { text: DateTimeLocale.relative.now_text }) : __assign({}, item);
302
300
  });
303
301
  export var relativeMap = (function () {
304
302
  var res = {};
305
- relativeTimeUnits.forEach(function (relative) {
303
+ RELATIVE_TIME_UNITS.forEach(function (relative) {
306
304
  res[relative.value] = relative;
307
305
  });
308
306
  return res;
@@ -2,7 +2,7 @@ import moment from 'moment';
2
2
  import { isEmpty, isEqual } from 'lodash';
3
3
  import zhCN from 'antd/es/locale-provider/zh_CN';
4
4
  import { toFormatTime } from '../../utils/time';
5
- import { defaultPresets, relativeTimeUnits, RelativeUnitValue, RangePreset, QuartersMap } from './constants';
5
+ import { defaultPresets, RELATIVE_TIME_UNITS, RelativeUnitValue, RangePreset, QuartersMap } from './constants';
6
6
  import { formatString } from '../../utils/language';
7
7
  import { DateTimeLocale } from '../../constants/language/datetime/type';
8
8
  var Time = /** @class */ (function () {
@@ -34,7 +34,7 @@ var Time = /** @class */ (function () {
34
34
  this.isPointPicker = options.isPointPicker;
35
35
  this.quarterTime = time.quarterTime;
36
36
  this.presetMap = this.getPresetMap(isEmpty(options.presets) ? defaultPresets : options.presets);
37
- this.relativeMap = this.getRelativeMap(isEmpty(options.relatives) ? relativeTimeUnits : options.relatives);
37
+ this.relativeMap = this.getRelativeMap(isEmpty(options.relatives) ? RELATIVE_TIME_UNITS : options.relatives);
38
38
  }
39
39
  Time.toMoment = function (time) {
40
40
  try {
@@ -4,7 +4,11 @@ export declare function transformToTime(time: ITimeRange): ITime;
4
4
  export declare function transformToTimeRange(time: ITime): ITimeRange;
5
5
  export declare function getTimeShiftUnit(time: string): TimeShiftUnit.Second | TimeShiftUnit;
6
6
  export declare function getRelativeTime(timeShift: string, time: moment.Moment): moment.Moment | undefined;
7
- export declare function calcFullTime(time?: ITimeRange): {
7
+ export declare function calcFullTime(time?: ITimeRange, options?: {
8
+ presets?: any;
9
+ relatives?: any;
10
+ isPointPicker?: boolean;
11
+ }): {
8
12
  start: number | undefined;
9
13
  end: number | undefined;
10
14
  } | undefined;
@@ -59,12 +59,13 @@ export function getRelativeTime(timeShift, time) {
59
59
  return moment(time).subtract(timeShiftValue, timeShiftUnit);
60
60
  }
61
61
  }
62
- export function calcFullTime(time) {
62
+ export function calcFullTime(time, options) {
63
+ if (options === void 0) { options = {}; }
63
64
  if (!time) {
64
65
  return;
65
66
  }
66
67
  var timeShift = time.timeShift;
67
- var _a = new Time(transformToTime(time)).toDate(), start = _a.start, end = _a.end;
68
+ var _a = new Time(transformToTime(time), options).toDate(), start = _a.start, end = _a.end;
68
69
  var relativeStart = timeShift && start ? getRelativeTime(timeShift, start) : start;
69
70
  var relativeEnd = timeShift && end ? getRelativeTime(timeShift, end) : end;
70
71
  return {
@@ -57,27 +57,39 @@ export declare type IDrawerProps = Overwrite<DrawerProps, {
57
57
  * 是否允许拖拽
58
58
  */
59
59
  canDrag?: boolean;
60
+ /**
61
+ * 关闭按钮显示的位置,默认left
62
+ */
60
63
  closeIconPlacement?: 'left' | 'right';
61
64
  /**
62
65
  * 无遮罩时点击空白处中的哪些元素不关闭
63
66
  */
64
67
  nonCloseSelector?: string;
65
68
  size?: 'small' | 'default' | 'large';
69
+ /**
70
+ * 是否显示全屏按钮
71
+ */
72
+ showFullScreen?: boolean;
73
+ onScreenFullChange?: (showFullScreen: boolean) => void;
66
74
  }>;
67
75
  export declare class Drawer extends React.Component<React.PropsWithChildren<IDrawerProps>, any> {
68
76
  drawerId: string;
69
77
  isResizing: boolean;
70
78
  realWidth: React.ReactText;
79
+ isFullscreen: boolean;
71
80
  throttleMouseMove: import("lodash").DebouncedFunc<(e: any) => void>;
72
81
  get closable(): boolean | undefined;
73
- get extra(): {} | null | undefined;
82
+ get extra(): JSX.Element;
74
83
  setIsResizing(isResizing?: boolean): void;
75
84
  setRealWidth(realWidth: string | number): void;
85
+ setIsFullscreen(isFullscreen: boolean): void;
86
+ handleFull(): void;
76
87
  onMouseDown(): void;
77
88
  onMouseUp(): void;
78
89
  onMouseMove(e: any): void;
79
90
  onMouseClick(e: MouseEvent): void;
80
91
  initWidth(width?: string | number, size?: string): React.ReactText;
92
+ handleClose(e: EventType | null): void;
81
93
  componentDidMount(): void;
82
94
  UNSAFE_componentWillUpdate(nextProps: Readonly<React.PropsWithChildren<IDrawerProps>>): void;
83
95
  componentWillUnmount(): void;
@@ -136,12 +148,20 @@ declare const _default: (props: {
136
148
  * 是否允许拖拽
137
149
  */
138
150
  canDrag?: boolean | undefined;
151
+ /**
152
+ * 关闭按钮显示的位置,默认left
153
+ */
139
154
  closeIconPlacement?: import("antd/es/collapse/Collapse").ExpandIconPosition;
140
155
  /**
141
156
  * 无遮罩时点击空白处中的哪些元素不关闭
142
157
  */
143
158
  nonCloseSelector?: string | undefined;
144
159
  size?: "small" | "default" | "large" | undefined;
160
+ /**
161
+ * 是否显示全屏按钮
162
+ */
163
+ showFullScreen?: boolean | undefined;
164
+ onScreenFullChange?: ((showFullScreen: boolean) => void) | undefined;
145
165
  } & Pick<DrawerProps, "style" | "autoFocus" | "prefixCls" | "footer" | "extra" | "bodyStyle" | "forceRender" | "keyboard" | "destroyOnClose" | "closeIcon" | "drawerStyle" | "headerStyle" | "contentWrapperStyle" | "push" | "handler" | "footerStyle" | "level" | "levelMove"> & {
146
166
  children?: React.ReactNode;
147
167
  } & {