@zgfe/business-lib 1.2.51 → 1.2.53
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.
- package/es/assets/colorIcon/demo_index.html +717 -4
- package/es/assets/colorIcon/iconfont.css +128 -4
- package/es/assets/colorIcon/iconfont.js +16 -16
- package/es/assets/colorIcon/iconfont.json +217 -0
- package/es/assets/colorIcon/iconfont.svg +62 -0
- package/es/assets/colorIcon/iconfont.ttf +0 -0
- package/es/assets/colorIcon/iconfont.woff +0 -0
- package/es/assets/colorIcon/iconfont.woff2 +0 -0
- package/es/assets/iconfont/demo_index.html +310 -11
- package/es/assets/iconfont/iconfont.css +57 -5
- package/es/assets/iconfont/iconfont.js +14 -15
- package/es/assets/iconfont/iconfont.json +93 -2
- package/es/assets/iconfont/iconfont.ttf +0 -0
- package/es/assets/iconfont/iconfont.woff +0 -0
- package/es/assets/iconfont/iconfont.woff2 +0 -0
- package/es/assets/styles/resetAntd.less +3 -2
- package/es/datePicker/demo/index.js +3 -1
- package/es/datePickerV2/context.d.ts +13 -0
- package/es/datePickerV2/context.js +3 -0
- package/es/datePickerV2/datePicker.d.ts +7 -0
- package/es/datePickerV2/datePicker.js +149 -0
- package/es/datePickerV2/demo/customType.d.ts +4 -0
- package/es/datePickerV2/demo/customType.js +38 -0
- package/es/datePickerV2/demo/day.d.ts +4 -0
- package/es/datePickerV2/demo/day.js +47 -0
- package/es/datePickerV2/demo/index.d.ts +4 -0
- package/es/datePickerV2/demo/index.js +67 -0
- package/es/datePickerV2/index.d.ts +6 -0
- package/es/datePickerV2/index.js +243 -0
- package/es/datePickerV2/popoverContent.d.ts +13 -0
- package/es/datePickerV2/popoverContent.js +53 -0
- package/es/datePickerV2/shortcut.d.ts +7 -0
- package/es/datePickerV2/shortcut.js +120 -0
- package/es/datePickerV2/styles/index.less +184 -0
- package/es/datePickerV2/types.d.ts +38 -0
- package/es/datePickerV2/types.js +12 -0
- package/es/datePickerV2/utils.d.ts +30 -0
- package/es/datePickerV2/utils.js +139 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/package.json +3 -3
- package/es/table/font_2545884_ievcoe4sky/demo.css +0 -539
- package/es/table/font_2545884_ievcoe4sky/demo_index.html +0 -4857
- package/es/table/font_2545884_ievcoe4sky/iconfont.css +0 -827
- package/es/table/font_2545884_ievcoe4sky/iconfont.js +0 -43
- package/es/table/font_2545884_ievcoe4sky/iconfont.json +0 -1430
- package/es/table/font_2545884_ievcoe4sky/iconfont.ttf +0 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.woff +0 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.woff2 +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
import { DatePickerTypes } from './types';
|
|
3
|
+
export declare const getDateRange: (type: DatePickerTypes.Unit, count: number, includeToday: boolean) => {
|
|
4
|
+
begin: string;
|
|
5
|
+
end: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const isTodayInRange: (_startDate: moment.Moment, _endDate: moment.Moment) => boolean;
|
|
8
|
+
export declare const getTypeList: (currentType: DatePickerTypes.Unit, includeToday: boolean) => DatePickerTypes.ListOption[];
|
|
9
|
+
export declare const DateOptionMap: {
|
|
10
|
+
day: string;
|
|
11
|
+
week: string;
|
|
12
|
+
month: string;
|
|
13
|
+
quarter: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const DateMaxMap: {
|
|
16
|
+
day: number;
|
|
17
|
+
week: number;
|
|
18
|
+
month: number;
|
|
19
|
+
quarter: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const DateSingleMap: {
|
|
22
|
+
day: number;
|
|
23
|
+
days: number;
|
|
24
|
+
week: number;
|
|
25
|
+
weeks: number;
|
|
26
|
+
month: number;
|
|
27
|
+
months: number;
|
|
28
|
+
quarter: number;
|
|
29
|
+
quarters: number;
|
|
30
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
import { DatePickerTypes } from './types';
|
|
3
|
+
function getAbsoluteDate(unit, count, maxDate) {
|
|
4
|
+
var res = {};
|
|
5
|
+
switch (unit) {
|
|
6
|
+
case DatePickerTypes.Unit.hour:
|
|
7
|
+
res.endDate = res.startDate = moment().subtract(count, 'days').toDate();
|
|
8
|
+
break;
|
|
9
|
+
case DatePickerTypes.Unit.day:
|
|
10
|
+
res.startDate = moment().subtract(count, 'days').toDate();
|
|
11
|
+
count == 1 ? res.endDate = moment().subtract(count, 'days').toDate() : res.endDate = maxDate;
|
|
12
|
+
break;
|
|
13
|
+
case DatePickerTypes.Unit.week:
|
|
14
|
+
res.endDate = maxDate;
|
|
15
|
+
res.startDate = moment(maxDate).subtract(count, 'weeks').toDate();
|
|
16
|
+
break;
|
|
17
|
+
case DatePickerTypes.Unit.month:
|
|
18
|
+
res.endDate = maxDate;
|
|
19
|
+
res.startDate = moment(maxDate).subtract(count, 'months').add(1, 'days').toDate();
|
|
20
|
+
break;
|
|
21
|
+
case DatePickerTypes.Unit.quarter:
|
|
22
|
+
res.endDate = maxDate;
|
|
23
|
+
res.startDate = moment(maxDate).subtract(count, 'quarters').add(1, 'days').toDate();
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
return res;
|
|
27
|
+
}
|
|
28
|
+
export var getDateRange = function getDateRange(type, count, includeToday) {
|
|
29
|
+
var maxDate = moment().subtract(includeToday || count == 0 ? 0 : 1, 'days').toDate();
|
|
30
|
+
var res = getAbsoluteDate(type, count, maxDate);
|
|
31
|
+
return {
|
|
32
|
+
begin: moment(res.startDate).format('YYYY-MM-DD'),
|
|
33
|
+
end: moment(res.endDate).format('YYYY-MM-DD')
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export var isTodayInRange = function isTodayInRange(_startDate, _endDate) {
|
|
37
|
+
var startDate = _startDate.format('x');
|
|
38
|
+
var endDate = moment(_endDate).add(1, 'days').format('x');
|
|
39
|
+
var dateToCheck = moment(new Date()).format('x');
|
|
40
|
+
return dateToCheck >= startDate && dateToCheck <= endDate;
|
|
41
|
+
};
|
|
42
|
+
export var getTypeList = function getTypeList(currentType, includeToday) {
|
|
43
|
+
var _shortcuts$find;
|
|
44
|
+
var shortcuts = [{
|
|
45
|
+
label: '按小时',
|
|
46
|
+
value: DatePickerTypes.Unit.hour,
|
|
47
|
+
children: [{
|
|
48
|
+
value: '昨天',
|
|
49
|
+
count: 1
|
|
50
|
+
}, {
|
|
51
|
+
value: '前天',
|
|
52
|
+
count: 2
|
|
53
|
+
}]
|
|
54
|
+
}, {
|
|
55
|
+
label: '按天',
|
|
56
|
+
value: DatePickerTypes.Unit.day,
|
|
57
|
+
children: [{
|
|
58
|
+
value: '7天',
|
|
59
|
+
count: 7
|
|
60
|
+
}, {
|
|
61
|
+
value: '14天',
|
|
62
|
+
count: 14
|
|
63
|
+
}, {
|
|
64
|
+
value: '30天',
|
|
65
|
+
count: 30
|
|
66
|
+
}]
|
|
67
|
+
}, {
|
|
68
|
+
label: '按周',
|
|
69
|
+
value: DatePickerTypes.Unit.week,
|
|
70
|
+
children: [{
|
|
71
|
+
value: '4周',
|
|
72
|
+
count: 4
|
|
73
|
+
}, {
|
|
74
|
+
value: '8周',
|
|
75
|
+
count: 8
|
|
76
|
+
}, {
|
|
77
|
+
value: '12周',
|
|
78
|
+
count: 12
|
|
79
|
+
}]
|
|
80
|
+
}, {
|
|
81
|
+
label: '按月',
|
|
82
|
+
value: DatePickerTypes.Unit.month,
|
|
83
|
+
children: [{
|
|
84
|
+
value: '1个月',
|
|
85
|
+
count: 1
|
|
86
|
+
}, {
|
|
87
|
+
value: '2个月',
|
|
88
|
+
count: 2
|
|
89
|
+
}, {
|
|
90
|
+
value: '3个月',
|
|
91
|
+
count: 3
|
|
92
|
+
}]
|
|
93
|
+
}, {
|
|
94
|
+
label: '按季度',
|
|
95
|
+
value: DatePickerTypes.Unit.quarter,
|
|
96
|
+
children: [{
|
|
97
|
+
value: '1季度',
|
|
98
|
+
count: 1
|
|
99
|
+
}, {
|
|
100
|
+
value: '2季度',
|
|
101
|
+
count: 2
|
|
102
|
+
}, {
|
|
103
|
+
value: '4季度',
|
|
104
|
+
count: 4
|
|
105
|
+
}]
|
|
106
|
+
}];
|
|
107
|
+
var list = (((_shortcuts$find = shortcuts.find(function (item) {
|
|
108
|
+
return item.value === currentType;
|
|
109
|
+
})) === null || _shortcuts$find === void 0 ? void 0 : _shortcuts$find.children) || []).filter(function (item) {
|
|
110
|
+
if (currentType === 'day') {
|
|
111
|
+
if (!includeToday && (item.count === 0 || item.count === 1)) return false;
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
});
|
|
116
|
+
return list;
|
|
117
|
+
};
|
|
118
|
+
export var DateOptionMap = {
|
|
119
|
+
day: '天',
|
|
120
|
+
week: '周',
|
|
121
|
+
month: '个月',
|
|
122
|
+
quarter: '个季度'
|
|
123
|
+
};
|
|
124
|
+
export var DateMaxMap = {
|
|
125
|
+
day: 365,
|
|
126
|
+
week: 52,
|
|
127
|
+
month: 12,
|
|
128
|
+
quarter: 4
|
|
129
|
+
};
|
|
130
|
+
export var DateSingleMap = {
|
|
131
|
+
day: 1,
|
|
132
|
+
days: 1,
|
|
133
|
+
week: 7,
|
|
134
|
+
weeks: 7,
|
|
135
|
+
month: 30,
|
|
136
|
+
months: 30,
|
|
137
|
+
quarter: 91,
|
|
138
|
+
quarters: 91
|
|
139
|
+
};
|
package/es/index.d.ts
CHANGED
|
@@ -48,7 +48,8 @@ import useChanged from './hooks/useChanged';
|
|
|
48
48
|
import useSubject from './hooks/useSubject';
|
|
49
49
|
import BizPlatformSelector from './platformSelector';
|
|
50
50
|
import DataSetGroup from './dataSetGroup';
|
|
51
|
-
|
|
51
|
+
import BizDatePickerV2 from './datePickerV2';
|
|
52
|
+
export { BizTargetDimension, BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizLayout, BizAnalysisLayout, BizDetailLayout, BizUserGroup, BizUserGroupHeader, IconFont, ColorIcon, BizFormulaTarget, BizAUMFormulaTarget, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizLoading, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizProductCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, base64, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, chartColors, useBizStore, useChanged, useSubject, DataSetGroup, BizDatePickerV2, BizPlatformSelector, };
|
|
52
53
|
export type { UserGroupTypes } from './userGroup/types';
|
|
53
54
|
export type { BizProductConditionT } from './productCondition/types';
|
|
54
55
|
export type { BizSelectTypes } from './select/types';
|
package/es/index.js
CHANGED
|
@@ -47,4 +47,5 @@ import useChanged from './hooks/useChanged';
|
|
|
47
47
|
import useSubject from './hooks/useSubject';
|
|
48
48
|
import BizPlatformSelector from './platformSelector';
|
|
49
49
|
import DataSetGroup from './dataSetGroup';
|
|
50
|
-
|
|
50
|
+
import BizDatePickerV2 from './datePickerV2';
|
|
51
|
+
export { BizTargetDimension, BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizLayout, BizAnalysisLayout, BizDetailLayout, BizUserGroup, BizUserGroupHeader, IconFont, ColorIcon, BizFormulaTarget, BizAUMFormulaTarget, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizLoading, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizProductCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, base64, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, chartColors, useBizStore, useChanged, useSubject, DataSetGroup, BizDatePickerV2, BizPlatformSelector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.53",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/lodash": "^4.14.182",
|
|
46
46
|
"@umijs/fabric": "^2.8.1",
|
|
47
47
|
"@umijs/test": "^3.0.5",
|
|
48
|
-
"antd": "
|
|
48
|
+
"antd": "4.24.16",
|
|
49
49
|
"dumi": "^1.1.0",
|
|
50
50
|
"father-build": "^1.17.2",
|
|
51
51
|
"gh-pages": "^3.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ba9a9d18dfdcab3ac09e1b55b17d549a04b29045",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|