assui 2.0.134 → 2.0.137

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.
@@ -13,7 +13,10 @@ export declare enum dateTypeEnum {
13
13
  BEFORE_30_DAY = 11,
14
14
  BEFORE_90_DAY = 12,
15
15
  BEFORE_180_DAY = 13,
16
- BEFORE_365_DAY = 14
16
+ BEFORE_365_DAY = 14,
17
+ PAST_7_DAY = 15,
18
+ FUTURE_7_DAY = 16,
19
+ TOMORROW = 17
17
20
  }
18
21
  export declare const useDateScope: () => {
19
22
  dateScopeList: {
@@ -35,5 +38,8 @@ export declare const useDateScope: () => {
35
38
  12: moment.Moment[];
36
39
  13: moment.Moment[];
37
40
  14: moment.Moment[];
41
+ 15: moment.Moment[];
42
+ 17: moment.Moment[];
43
+ 16: moment.Moment[];
38
44
  };
39
45
  };
@@ -17,6 +17,9 @@ export var dateTypeEnum;
17
17
  dateTypeEnum[dateTypeEnum["BEFORE_90_DAY"] = 12] = "BEFORE_90_DAY";
18
18
  dateTypeEnum[dateTypeEnum["BEFORE_180_DAY"] = 13] = "BEFORE_180_DAY";
19
19
  dateTypeEnum[dateTypeEnum["BEFORE_365_DAY"] = 14] = "BEFORE_365_DAY";
20
+ dateTypeEnum[dateTypeEnum["PAST_7_DAY"] = 15] = "PAST_7_DAY";
21
+ dateTypeEnum[dateTypeEnum["FUTURE_7_DAY"] = 16] = "FUTURE_7_DAY";
22
+ dateTypeEnum[dateTypeEnum["TOMORROW"] = 17] = "TOMORROW";
20
23
  })(dateTypeEnum || (dateTypeEnum = {}));
21
24
 
22
25
  export var useDateScope = function useDateScope() {
@@ -64,8 +67,17 @@ export var useDateScope = function useDateScope() {
64
67
  }, {
65
68
  key: dateTypeEnum.BEFORE_365_DAY,
66
69
  value: [now.clone().subtract(364, 'day').startOf('day'), now.endOf('day')]
70
+ }, {
71
+ key: dateTypeEnum.PAST_7_DAY,
72
+ value: [now.clone().subtract(7, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')]
73
+ }, {
74
+ key: dateTypeEnum.TOMORROW,
75
+ value: [now.clone().add(1, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')]
76
+ }, {
77
+ key: dateTypeEnum.FUTURE_7_DAY,
78
+ value: [now.clone().add(7, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')]
67
79
  }];
68
- var dateScopeMap = (_a = {}, _a[dateTypeEnum.TODAY] = [now.clone().startOf('day'), now.clone().endOf('day')], _a[dateTypeEnum.YESTERDAY] = [now.clone().subtract(1, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')], _a[dateTypeEnum.WEEK] = [now.clone().startOf('week'), now.clone().endOf('week')], _a[dateTypeEnum.LAST_WEEK] = [now.clone().subtract(1, 'week').startOf('week'), now.clone().subtract(1, 'week').endOf('week')], _a[dateTypeEnum.MONTH] = [now.clone().startOf('month'), now.clone().endOf('month')], _a[dateTypeEnum.LAST_MONTH] = [now.clone().subtract(1, 'month').startOf('month'), now.clone().subtract(1, 'month').endOf('month')], _a[dateTypeEnum.QUARTER] = [now.clone().startOf('quarter'), now.clone().endOf('quarter')], _a[dateTypeEnum.LAST_QUARTER] = [now.clone().subtract(1, 'quarter').startOf('quarter'), now.clone().subtract(1, 'quarter').endOf('quarter')], _a[dateTypeEnum.BEFORE_7_DAY] = [now.clone().subtract(6, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_14_DAY] = [now.clone().subtract(13, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_30_DAY] = [now.clone().subtract(29, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_90_DAY] = [now.clone().subtract(89, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_180_DAY] = [now.clone().subtract(179, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_365_DAY] = [now.clone().subtract(364, 'day').startOf('day'), now.endOf('day')], _a);
80
+ var dateScopeMap = (_a = {}, _a[dateTypeEnum.TODAY] = [now.clone().startOf('day'), now.clone().endOf('day')], _a[dateTypeEnum.YESTERDAY] = [now.clone().subtract(1, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')], _a[dateTypeEnum.WEEK] = [now.clone().startOf('week'), now.clone().endOf('week')], _a[dateTypeEnum.LAST_WEEK] = [now.clone().subtract(1, 'week').startOf('week'), now.clone().subtract(1, 'week').endOf('week')], _a[dateTypeEnum.MONTH] = [now.clone().startOf('month'), now.clone().endOf('month')], _a[dateTypeEnum.LAST_MONTH] = [now.clone().subtract(1, 'month').startOf('month'), now.clone().subtract(1, 'month').endOf('month')], _a[dateTypeEnum.QUARTER] = [now.clone().startOf('quarter'), now.clone().endOf('quarter')], _a[dateTypeEnum.LAST_QUARTER] = [now.clone().subtract(1, 'quarter').startOf('quarter'), now.clone().subtract(1, 'quarter').endOf('quarter')], _a[dateTypeEnum.BEFORE_7_DAY] = [now.clone().subtract(6, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_14_DAY] = [now.clone().subtract(13, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_30_DAY] = [now.clone().subtract(29, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_90_DAY] = [now.clone().subtract(89, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_180_DAY] = [now.clone().subtract(179, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_365_DAY] = [now.clone().subtract(364, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.PAST_7_DAY] = [now.clone().subtract(7, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')], _a[dateTypeEnum.TOMORROW] = [now.clone().add(1, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')], _a[dateTypeEnum.FUTURE_7_DAY] = [now.clone().add(7, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')], _a);
69
81
  return {
70
82
  dateScopeList: dateScopeList,
71
83
  dateScopeMap: dateScopeMap
@@ -1,7 +1,12 @@
1
1
  import { dateTypeEnum } from './getDateScope';
2
2
  import type { LabelRangePickerProps } from '../label-range-picker';
3
+ export declare type RadioListType = {
4
+ key: dateTypeEnum;
5
+ text: string;
6
+ };
3
7
  export interface LabelCustomizeRangePickerProps extends LabelRangePickerProps {
4
8
  customizeTimeList?: dateTypeEnum[];
9
+ radioList?: RadioListType[];
5
10
  }
6
11
  declare const LabelCustomizeRangePicker: {
7
12
  (props: LabelCustomizeRangePickerProps): JSX.Element;
@@ -64,7 +64,8 @@ import { useDateScope, dateTypeEnum } from './getDateScope';
64
64
 
65
65
  var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
66
66
  var customizeTimeList = props.customizeTimeList,
67
- options = __rest(props, ["customizeTimeList"]);
67
+ radioList = props.radioList,
68
+ options = __rest(props, ["customizeTimeList", "radioList"]);
68
69
 
69
70
  var _a = __read(useControllableValue(props), 2),
70
71
  date = _a[0],
@@ -119,7 +120,7 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
119
120
  setDate(dateScopeMap[value]);
120
121
  };
121
122
 
122
- var list = getRadioList().filter(function (item) {
123
+ var list = radioList !== null && radioList !== void 0 ? radioList : getRadioList().filter(function (item) {
123
124
  return customizeTimeList === null || customizeTimeList === void 0 ? void 0 : customizeTimeList.includes(item.key);
124
125
  });
125
126
  var finallyRadioList = list.length ? list : getRadioList();
@@ -13,7 +13,10 @@ export declare enum dateTypeEnum {
13
13
  BEFORE_30_DAY = 11,
14
14
  BEFORE_90_DAY = 12,
15
15
  BEFORE_180_DAY = 13,
16
- BEFORE_365_DAY = 14
16
+ BEFORE_365_DAY = 14,
17
+ PAST_7_DAY = 15,
18
+ FUTURE_7_DAY = 16,
19
+ TOMORROW = 17
17
20
  }
18
21
  export declare const useDateScope: () => {
19
22
  dateScopeList: {
@@ -35,5 +38,8 @@ export declare const useDateScope: () => {
35
38
  12: moment.Moment[];
36
39
  13: moment.Moment[];
37
40
  14: moment.Moment[];
41
+ 15: moment.Moment[];
42
+ 17: moment.Moment[];
43
+ 16: moment.Moment[];
38
44
  };
39
45
  };
@@ -31,6 +31,9 @@ var dateTypeEnum;
31
31
  dateTypeEnum[dateTypeEnum["BEFORE_90_DAY"] = 12] = "BEFORE_90_DAY";
32
32
  dateTypeEnum[dateTypeEnum["BEFORE_180_DAY"] = 13] = "BEFORE_180_DAY";
33
33
  dateTypeEnum[dateTypeEnum["BEFORE_365_DAY"] = 14] = "BEFORE_365_DAY";
34
+ dateTypeEnum[dateTypeEnum["PAST_7_DAY"] = 15] = "PAST_7_DAY";
35
+ dateTypeEnum[dateTypeEnum["FUTURE_7_DAY"] = 16] = "FUTURE_7_DAY";
36
+ dateTypeEnum[dateTypeEnum["TOMORROW"] = 17] = "TOMORROW";
34
37
  })(dateTypeEnum = exports.dateTypeEnum || (exports.dateTypeEnum = {}));
35
38
 
36
39
  exports.useDateScope = function () {
@@ -78,8 +81,17 @@ exports.useDateScope = function () {
78
81
  }, {
79
82
  key: dateTypeEnum.BEFORE_365_DAY,
80
83
  value: [now.clone().subtract(364, 'day').startOf('day'), now.endOf('day')]
84
+ }, {
85
+ key: dateTypeEnum.PAST_7_DAY,
86
+ value: [now.clone().subtract(7, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')]
87
+ }, {
88
+ key: dateTypeEnum.TOMORROW,
89
+ value: [now.clone().add(1, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')]
90
+ }, {
91
+ key: dateTypeEnum.FUTURE_7_DAY,
92
+ value: [now.clone().add(7, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')]
81
93
  }];
82
- var dateScopeMap = (_a = {}, _a[dateTypeEnum.TODAY] = [now.clone().startOf('day'), now.clone().endOf('day')], _a[dateTypeEnum.YESTERDAY] = [now.clone().subtract(1, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')], _a[dateTypeEnum.WEEK] = [now.clone().startOf('week'), now.clone().endOf('week')], _a[dateTypeEnum.LAST_WEEK] = [now.clone().subtract(1, 'week').startOf('week'), now.clone().subtract(1, 'week').endOf('week')], _a[dateTypeEnum.MONTH] = [now.clone().startOf('month'), now.clone().endOf('month')], _a[dateTypeEnum.LAST_MONTH] = [now.clone().subtract(1, 'month').startOf('month'), now.clone().subtract(1, 'month').endOf('month')], _a[dateTypeEnum.QUARTER] = [now.clone().startOf('quarter'), now.clone().endOf('quarter')], _a[dateTypeEnum.LAST_QUARTER] = [now.clone().subtract(1, 'quarter').startOf('quarter'), now.clone().subtract(1, 'quarter').endOf('quarter')], _a[dateTypeEnum.BEFORE_7_DAY] = [now.clone().subtract(6, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_14_DAY] = [now.clone().subtract(13, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_30_DAY] = [now.clone().subtract(29, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_90_DAY] = [now.clone().subtract(89, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_180_DAY] = [now.clone().subtract(179, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_365_DAY] = [now.clone().subtract(364, 'day').startOf('day'), now.endOf('day')], _a);
94
+ var dateScopeMap = (_a = {}, _a[dateTypeEnum.TODAY] = [now.clone().startOf('day'), now.clone().endOf('day')], _a[dateTypeEnum.YESTERDAY] = [now.clone().subtract(1, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')], _a[dateTypeEnum.WEEK] = [now.clone().startOf('week'), now.clone().endOf('week')], _a[dateTypeEnum.LAST_WEEK] = [now.clone().subtract(1, 'week').startOf('week'), now.clone().subtract(1, 'week').endOf('week')], _a[dateTypeEnum.MONTH] = [now.clone().startOf('month'), now.clone().endOf('month')], _a[dateTypeEnum.LAST_MONTH] = [now.clone().subtract(1, 'month').startOf('month'), now.clone().subtract(1, 'month').endOf('month')], _a[dateTypeEnum.QUARTER] = [now.clone().startOf('quarter'), now.clone().endOf('quarter')], _a[dateTypeEnum.LAST_QUARTER] = [now.clone().subtract(1, 'quarter').startOf('quarter'), now.clone().subtract(1, 'quarter').endOf('quarter')], _a[dateTypeEnum.BEFORE_7_DAY] = [now.clone().subtract(6, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_14_DAY] = [now.clone().subtract(13, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_30_DAY] = [now.clone().subtract(29, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_90_DAY] = [now.clone().subtract(89, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_180_DAY] = [now.clone().subtract(179, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.BEFORE_365_DAY] = [now.clone().subtract(364, 'day').startOf('day'), now.endOf('day')], _a[dateTypeEnum.PAST_7_DAY] = [now.clone().subtract(7, 'day').startOf('day'), now.clone().subtract(1, 'day').endOf('day')], _a[dateTypeEnum.TOMORROW] = [now.clone().add(1, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')], _a[dateTypeEnum.FUTURE_7_DAY] = [now.clone().add(7, 'day').startOf('day'), now.clone().add(1, 'day').endOf('day')], _a);
83
95
  return {
84
96
  dateScopeList: dateScopeList,
85
97
  dateScopeMap: dateScopeMap
@@ -1,7 +1,12 @@
1
1
  import { dateTypeEnum } from './getDateScope';
2
2
  import type { LabelRangePickerProps } from '../label-range-picker';
3
+ export declare type RadioListType = {
4
+ key: dateTypeEnum;
5
+ text: string;
6
+ };
3
7
  export interface LabelCustomizeRangePickerProps extends LabelRangePickerProps {
4
8
  customizeTimeList?: dateTypeEnum[];
9
+ radioList?: RadioListType[];
5
10
  }
6
11
  declare const LabelCustomizeRangePicker: {
7
12
  (props: LabelCustomizeRangePickerProps): JSX.Element;
@@ -116,7 +116,8 @@ var getDateScope_1 = require("./getDateScope");
116
116
 
117
117
  var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
118
118
  var customizeTimeList = props.customizeTimeList,
119
- options = __rest(props, ["customizeTimeList"]);
119
+ radioList = props.radioList,
120
+ options = __rest(props, ["customizeTimeList", "radioList"]);
120
121
 
121
122
  var _a = __read(useControllableValue_1["default"](props), 2),
122
123
  date = _a[0],
@@ -171,7 +172,7 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
171
172
  setDate(dateScopeMap[value]);
172
173
  };
173
174
 
174
- var list = getRadioList_1["default"]().filter(function (item) {
175
+ var list = radioList !== null && radioList !== void 0 ? radioList : getRadioList_1["default"]().filter(function (item) {
175
176
  return customizeTimeList === null || customizeTimeList === void 0 ? void 0 : customizeTimeList.includes(item.key);
176
177
  });
177
178
  var finallyRadioList = list.length ? list : getRadioList_1["default"]();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "2.0.134",
3
+ "version": "2.0.137",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -33,7 +33,7 @@
33
33
  "@ahooksjs/use-url-state": "^2.5.8",
34
34
  "@tinymce/tinymce-react": "^3.13.0",
35
35
  "@types/react-beautiful-dnd": "^13.1.2",
36
- "a-icons": "^1.0.58",
36
+ "a-icons": "^1.0.60",
37
37
  "ahooks": "^3.0.8",
38
38
  "bignumber.js": "^9.0.1",
39
39
  "copy-to-clipboard": "^3.3.1",
@@ -69,5 +69,5 @@
69
69
  "node": ">=10.0.0"
70
70
  },
71
71
  "license": "MIT",
72
- "gitHead": "21adc6130fe9c1d23370896f7b10f1c54a9baf22"
72
+ "gitHead": "b0e8f43537bb8546d8f3c7219a8456dc08a88fa7"
73
73
  }