yootd 0.0.38 → 0.0.39
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/LICENSE +21 -21
- package/README.md +43 -43
- package/dist/Preview/components/preview/phone.scss +8 -8
- package/dist/Preview/index.scss +35 -35
- package/dist/Preview/types/type.d.ts +22 -22
- package/dist/anchor/index.scss +23 -23
- package/dist/approval-process/index.scss +95 -95
- package/dist/areas/index.scss +21 -21
- package/dist/areas/types/types.d.ts +39 -39
- package/dist/aside/components/SortableItem.scss +93 -93
- package/dist/aside/index.scss +25 -25
- package/dist/aside/types/types.d.ts +44 -44
- package/dist/badge/index.scss +5 -5
- package/dist/buildings/types/types.d.ts +21 -21
- package/dist/button/index.scss +30 -30
- package/dist/cascader/index.scss +5 -5
- package/dist/courses/types/types.d.ts +18 -18
- package/dist/date-interval/index.d.ts +1 -0
- package/dist/date-interval/index.js +33 -30
- package/dist/date-range/index.d.ts +1 -0
- package/dist/date-range/index.js +5 -4
- package/dist/dictionary/types/types.d.ts +14 -14
- package/dist/drawer-modal/index.scss +39 -39
- package/dist/drawer-modal/types/types.d.ts +3 -3
- package/dist/dropdown/assets/arrow-down.svg +5 -5
- package/dist/empty/index.scss +15 -15
- package/dist/group-title/index.scss +31 -31
- package/dist/image/index.scss +26 -26
- package/dist/input/index.scss +5 -5
- package/dist/modal/index.scss +3 -0
- package/dist/pagination/index.scss +47 -47
- package/dist/school/index.scss +21 -21
- package/dist/school/types/types.d.ts +85 -85
- package/dist/state/index.scss +89 -89
- package/dist/steps/index.scss +32 -32
- package/dist/student-dropdown/types/types.d.ts +44 -44
- package/dist/table/components/primary-header-row/index.scss +58 -58
- package/dist/table/components/primary-tbody-row/index.scss +5 -5
- package/dist/table/index.module.scss +9 -9
- package/dist/table/index.scss +33 -33
- package/dist/tabs/index.scss +86 -86
- package/dist/tag/index.scss +4 -4
- package/dist/teacher/types/types.d.ts +31 -31
- package/dist/tree/index.scss +25 -25
- package/dist/upload/index.scss +115 -115
- package/dist/user-dropdown/types/types.d.ts +45 -45
- package/dist/video-player/index.js +20 -20
- package/dist/video-player/index.scss +310 -310
- package/dist/year-term/index.scss +21 -21
- package/dist/year-term/types/types.d.ts +28 -28
- package/dist/zones/index.module.scss +23 -23
- package/dist/zones/types/types.d.ts +26 -26
- package/package.json +1 -1
@@ -1,93 +1,93 @@
|
|
1
|
-
.yot-SortableItem {
|
2
|
-
&-content {
|
3
|
-
position: relative;
|
4
|
-
padding: 12px 16px;
|
5
|
-
box-sizing: border-box;
|
6
|
-
cursor: pointer;
|
7
|
-
&-top {
|
8
|
-
display: flex;
|
9
|
-
justify-content: space-between;
|
10
|
-
align-items: start;
|
11
|
-
&-top-left {
|
12
|
-
display: flex;
|
13
|
-
align-items: start;
|
14
|
-
&-top-drag-btn-icon {
|
15
|
-
cursor: move;
|
16
|
-
&__drag-btn-icon-svg {
|
17
|
-
display: inline-block;
|
18
|
-
vertical-align: middle;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
&-top-title-wrap {
|
22
|
-
display: flex;
|
23
|
-
align-items: center;
|
24
|
-
justify-content: center;
|
25
|
-
&__top-title {
|
26
|
-
font-size: 16px;
|
27
|
-
font-weight: 400;
|
28
|
-
line-height: 1.5em;
|
29
|
-
overflow: hidden;
|
30
|
-
display: -webkit-box; //将元素设为盒子伸缩模型显示
|
31
|
-
-webkit-box-orient: vertical; //伸缩方向设为垂直方向
|
32
|
-
-webkit-line-clamp: 2; //超出2行隐藏,并显示省略号
|
33
|
-
line-clamp: 2;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
37
|
-
&-top-middle {
|
38
|
-
display: flex;
|
39
|
-
align-items: center;
|
40
|
-
&-top-edit-btn-icon {
|
41
|
-
cursor: pointer;
|
42
|
-
&__edit-btn-icon-svg {
|
43
|
-
display: inline-block;
|
44
|
-
vertical-align: middle;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
&-top-del-btn-icon {
|
48
|
-
cursor: pointer;
|
49
|
-
margin-left: 12px;
|
50
|
-
&__del-btn-icon-svg {
|
51
|
-
display: inline-block;
|
52
|
-
vertical-align: middle;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
&-bottom {
|
58
|
-
text-overflow: ellipsis;
|
59
|
-
overflow: hidden;
|
60
|
-
white-space: nowrap;
|
61
|
-
&__extra {
|
62
|
-
font-size: 12px;
|
63
|
-
font-weight: 400;
|
64
|
-
color: rgba(0, 0, 0, 0.45);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
&-content:hover {
|
69
|
-
background-color: #d1eaff;
|
70
|
-
transition: all 0.05s ease;
|
71
|
-
}
|
72
|
-
&-content::before {
|
73
|
-
content: '';
|
74
|
-
position: absolute;
|
75
|
-
bottom: -0.5px;
|
76
|
-
left: 16px;
|
77
|
-
right: 16px;
|
78
|
-
height: 1px;
|
79
|
-
background-color: #e5e5e5;
|
80
|
-
}
|
81
|
-
&__content-active {
|
82
|
-
background-color: #d1eaff;
|
83
|
-
}
|
84
|
-
&__content-active::after {
|
85
|
-
content: '';
|
86
|
-
position: absolute;
|
87
|
-
bottom: 0;
|
88
|
-
left: 0;
|
89
|
-
width: 4px;
|
90
|
-
height: 100%;
|
91
|
-
background-color: #4d8de2;
|
92
|
-
}
|
93
|
-
}
|
1
|
+
.yot-SortableItem {
|
2
|
+
&-content {
|
3
|
+
position: relative;
|
4
|
+
padding: 12px 16px;
|
5
|
+
box-sizing: border-box;
|
6
|
+
cursor: pointer;
|
7
|
+
&-top {
|
8
|
+
display: flex;
|
9
|
+
justify-content: space-between;
|
10
|
+
align-items: start;
|
11
|
+
&-top-left {
|
12
|
+
display: flex;
|
13
|
+
align-items: start;
|
14
|
+
&-top-drag-btn-icon {
|
15
|
+
cursor: move;
|
16
|
+
&__drag-btn-icon-svg {
|
17
|
+
display: inline-block;
|
18
|
+
vertical-align: middle;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
&-top-title-wrap {
|
22
|
+
display: flex;
|
23
|
+
align-items: center;
|
24
|
+
justify-content: center;
|
25
|
+
&__top-title {
|
26
|
+
font-size: 16px;
|
27
|
+
font-weight: 400;
|
28
|
+
line-height: 1.5em;
|
29
|
+
overflow: hidden;
|
30
|
+
display: -webkit-box; //将元素设为盒子伸缩模型显示
|
31
|
+
-webkit-box-orient: vertical; //伸缩方向设为垂直方向
|
32
|
+
-webkit-line-clamp: 2; //超出2行隐藏,并显示省略号
|
33
|
+
line-clamp: 2;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
&-top-middle {
|
38
|
+
display: flex;
|
39
|
+
align-items: center;
|
40
|
+
&-top-edit-btn-icon {
|
41
|
+
cursor: pointer;
|
42
|
+
&__edit-btn-icon-svg {
|
43
|
+
display: inline-block;
|
44
|
+
vertical-align: middle;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
&-top-del-btn-icon {
|
48
|
+
cursor: pointer;
|
49
|
+
margin-left: 12px;
|
50
|
+
&__del-btn-icon-svg {
|
51
|
+
display: inline-block;
|
52
|
+
vertical-align: middle;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
&-bottom {
|
58
|
+
text-overflow: ellipsis;
|
59
|
+
overflow: hidden;
|
60
|
+
white-space: nowrap;
|
61
|
+
&__extra {
|
62
|
+
font-size: 12px;
|
63
|
+
font-weight: 400;
|
64
|
+
color: rgba(0, 0, 0, 0.45);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
&-content:hover {
|
69
|
+
background-color: #d1eaff;
|
70
|
+
transition: all 0.05s ease;
|
71
|
+
}
|
72
|
+
&-content::before {
|
73
|
+
content: '';
|
74
|
+
position: absolute;
|
75
|
+
bottom: -0.5px;
|
76
|
+
left: 16px;
|
77
|
+
right: 16px;
|
78
|
+
height: 1px;
|
79
|
+
background-color: #e5e5e5;
|
80
|
+
}
|
81
|
+
&__content-active {
|
82
|
+
background-color: #d1eaff;
|
83
|
+
}
|
84
|
+
&__content-active::after {
|
85
|
+
content: '';
|
86
|
+
position: absolute;
|
87
|
+
bottom: 0;
|
88
|
+
left: 0;
|
89
|
+
width: 4px;
|
90
|
+
height: 100%;
|
91
|
+
background-color: #4d8de2;
|
92
|
+
}
|
93
|
+
}
|
package/dist/aside/index.scss
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
.yot-aside {
|
2
|
-
background-color: #ffffff;
|
3
|
-
border-radius: 8px;
|
4
|
-
box-sizing: border-box;
|
5
|
-
&-title {
|
6
|
-
border-bottom: 1px solid #e5e5e5;
|
7
|
-
padding: 16px 0px;
|
8
|
-
margin: 0px 16px;
|
9
|
-
box-sizing: border-box;
|
10
|
-
display: flex;
|
11
|
-
align-items: start;
|
12
|
-
justify-content: space-between;
|
13
|
-
&__title-text {
|
14
|
-
font-size: 18px;
|
15
|
-
font-weight: bold;
|
16
|
-
overflow: hidden;
|
17
|
-
text-overflow: ellipsis;
|
18
|
-
white-space: nowrap;
|
19
|
-
}
|
20
|
-
&__add-btn-icon {
|
21
|
-
cursor: pointer;
|
22
|
-
margin-top: 8px;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
1
|
+
.yot-aside {
|
2
|
+
background-color: #ffffff;
|
3
|
+
border-radius: 8px;
|
4
|
+
box-sizing: border-box;
|
5
|
+
&-title {
|
6
|
+
border-bottom: 1px solid #e5e5e5;
|
7
|
+
padding: 16px 0px;
|
8
|
+
margin: 0px 16px;
|
9
|
+
box-sizing: border-box;
|
10
|
+
display: flex;
|
11
|
+
align-items: start;
|
12
|
+
justify-content: space-between;
|
13
|
+
&__title-text {
|
14
|
+
font-size: 18px;
|
15
|
+
font-weight: bold;
|
16
|
+
overflow: hidden;
|
17
|
+
text-overflow: ellipsis;
|
18
|
+
white-space: nowrap;
|
19
|
+
}
|
20
|
+
&__add-btn-icon {
|
21
|
+
cursor: pointer;
|
22
|
+
margin-top: 8px;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
@@ -1,44 +1,44 @@
|
|
1
|
-
type IdataItem = {
|
2
|
-
key: string;
|
3
|
-
title: string;
|
4
|
-
extra?: string;
|
5
|
-
checked?: boolean;
|
6
|
-
};
|
7
|
-
export type AsideProps = {
|
8
|
-
width?: number;
|
9
|
-
height?: number | string;
|
10
|
-
style?: React.CSSProperties;
|
11
|
-
activeKey?: string;
|
12
|
-
title?: string;
|
13
|
-
data: IdataItem[];
|
14
|
-
titleShow?: boolean;
|
15
|
-
addBtnIcon?: boolean;
|
16
|
-
editBtnIcon?: boolean;
|
17
|
-
delBtnIcon?: boolean;
|
18
|
-
switchBtnIcon?: boolean;
|
19
|
-
dragBtnIcon?: boolean;
|
20
|
-
onClick?: (key: string) => void;
|
21
|
-
onAdd?: () => void;
|
22
|
-
onEdit?: (key: string) => void;
|
23
|
-
onDel?: (key: string) => void;
|
24
|
-
onSwitch?: (
|
25
|
-
changeValue: { key: string; checked: boolean },
|
26
|
-
data: IdataItem[],
|
27
|
-
) => void;
|
28
|
-
onDragEnd?: (data: IdataItem[]) => void;
|
29
|
-
};
|
30
|
-
export type AsideItemProps = {
|
31
|
-
activeKey: string;
|
32
|
-
id: string;
|
33
|
-
title: string;
|
34
|
-
editBtnIcon?: boolean;
|
35
|
-
delBtnIcon?: boolean;
|
36
|
-
switchBtnIcon?: boolean;
|
37
|
-
dragBtnIcon?: boolean;
|
38
|
-
checked?: boolean;
|
39
|
-
extra?: string;
|
40
|
-
onClick?: (key: string) => void;
|
41
|
-
onEdit?: (key: string) => void;
|
42
|
-
onDel?: (key: string) => void;
|
43
|
-
onSwitch?: (key: string, e: boolean) => void;
|
44
|
-
};
|
1
|
+
type IdataItem = {
|
2
|
+
key: string;
|
3
|
+
title: string;
|
4
|
+
extra?: string;
|
5
|
+
checked?: boolean;
|
6
|
+
};
|
7
|
+
export type AsideProps = {
|
8
|
+
width?: number;
|
9
|
+
height?: number | string;
|
10
|
+
style?: React.CSSProperties;
|
11
|
+
activeKey?: string;
|
12
|
+
title?: string;
|
13
|
+
data: IdataItem[];
|
14
|
+
titleShow?: boolean;
|
15
|
+
addBtnIcon?: boolean;
|
16
|
+
editBtnIcon?: boolean;
|
17
|
+
delBtnIcon?: boolean;
|
18
|
+
switchBtnIcon?: boolean;
|
19
|
+
dragBtnIcon?: boolean;
|
20
|
+
onClick?: (key: string) => void;
|
21
|
+
onAdd?: () => void;
|
22
|
+
onEdit?: (key: string) => void;
|
23
|
+
onDel?: (key: string) => void;
|
24
|
+
onSwitch?: (
|
25
|
+
changeValue: { key: string; checked: boolean },
|
26
|
+
data: IdataItem[],
|
27
|
+
) => void;
|
28
|
+
onDragEnd?: (data: IdataItem[]) => void;
|
29
|
+
};
|
30
|
+
export type AsideItemProps = {
|
31
|
+
activeKey: string;
|
32
|
+
id: string;
|
33
|
+
title: string;
|
34
|
+
editBtnIcon?: boolean;
|
35
|
+
delBtnIcon?: boolean;
|
36
|
+
switchBtnIcon?: boolean;
|
37
|
+
dragBtnIcon?: boolean;
|
38
|
+
checked?: boolean;
|
39
|
+
extra?: string;
|
40
|
+
onClick?: (key: string) => void;
|
41
|
+
onEdit?: (key: string) => void;
|
42
|
+
onDel?: (key: string) => void;
|
43
|
+
onSwitch?: (key: string, e: boolean) => void;
|
44
|
+
};
|
package/dist/badge/index.scss
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
.yot-badge {
|
2
|
-
.ant-scroll-number.ant-badge-count {
|
3
|
-
background-color: var(--ant-color-error);
|
4
|
-
}
|
5
|
-
}
|
1
|
+
.yot-badge {
|
2
|
+
.ant-scroll-number.ant-badge-count {
|
3
|
+
background-color: var(--ant-color-error);
|
4
|
+
}
|
5
|
+
}
|
@@ -1,21 +1,21 @@
|
|
1
|
-
export interface PageData<T> {
|
2
|
-
content: T[];
|
3
|
-
page: {
|
4
|
-
number: number;
|
5
|
-
size: number;
|
6
|
-
totalElements: number;
|
7
|
-
totalPages: number;
|
8
|
-
};
|
9
|
-
}
|
10
|
-
// 查询位置接口返回的数据类型
|
11
|
-
export interface IareaItem {
|
12
|
-
areaId: number;
|
13
|
-
areaLevel: number;
|
14
|
-
areaName: string;
|
15
|
-
areaType: number;
|
16
|
-
}
|
17
|
-
export interface IBuildingsProps {
|
18
|
-
showSearch?: boolean;
|
19
|
-
areaType?: number;
|
20
|
-
areaSubType?: number;
|
21
|
-
}
|
1
|
+
export interface PageData<T> {
|
2
|
+
content: T[];
|
3
|
+
page: {
|
4
|
+
number: number;
|
5
|
+
size: number;
|
6
|
+
totalElements: number;
|
7
|
+
totalPages: number;
|
8
|
+
};
|
9
|
+
}
|
10
|
+
// 查询位置接口返回的数据类型
|
11
|
+
export interface IareaItem {
|
12
|
+
areaId: number;
|
13
|
+
areaLevel: number;
|
14
|
+
areaName: string;
|
15
|
+
areaType: number;
|
16
|
+
}
|
17
|
+
export interface IBuildingsProps {
|
18
|
+
showSearch?: boolean;
|
19
|
+
areaType?: number;
|
20
|
+
areaSubType?: number;
|
21
|
+
}
|
package/dist/button/index.scss
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
.yot-button {
|
2
|
-
&--small {
|
3
|
-
height: 26px;
|
4
|
-
padding-left: 16px;
|
5
|
-
padding-right: 16px;
|
6
|
-
border-radius: 4px;
|
7
|
-
font-size: 14px;
|
8
|
-
}
|
9
|
-
|
10
|
-
&--middle {
|
11
|
-
height: 32px;
|
12
|
-
padding-left: 16px;
|
13
|
-
padding-right: 16px;
|
14
|
-
border-radius: 4px;
|
15
|
-
font-size: 14px;
|
16
|
-
}
|
17
|
-
|
18
|
-
&--large {
|
19
|
-
height: 40px;
|
20
|
-
padding-left: 32px;
|
21
|
-
padding-right: 32px;
|
22
|
-
border-radius: 8px;
|
23
|
-
font-size: 16px;
|
24
|
-
}
|
25
|
-
|
26
|
-
&__link{
|
27
|
-
padding: 0 !important;
|
28
|
-
border: 0 !important;
|
29
|
-
}
|
30
|
-
|
1
|
+
.yot-button {
|
2
|
+
&--small {
|
3
|
+
height: 26px;
|
4
|
+
padding-left: 16px;
|
5
|
+
padding-right: 16px;
|
6
|
+
border-radius: 4px;
|
7
|
+
font-size: 14px;
|
8
|
+
}
|
9
|
+
|
10
|
+
&--middle {
|
11
|
+
height: 32px;
|
12
|
+
padding-left: 16px;
|
13
|
+
padding-right: 16px;
|
14
|
+
border-radius: 4px;
|
15
|
+
font-size: 14px;
|
16
|
+
}
|
17
|
+
|
18
|
+
&--large {
|
19
|
+
height: 40px;
|
20
|
+
padding-left: 32px;
|
21
|
+
padding-right: 32px;
|
22
|
+
border-radius: 8px;
|
23
|
+
font-size: 16px;
|
24
|
+
}
|
25
|
+
|
26
|
+
&__link{
|
27
|
+
padding: 0 !important;
|
28
|
+
border: 0 !important;
|
29
|
+
}
|
30
|
+
|
31
31
|
}
|
package/dist/cascader/index.scss
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
.yot-cascader {
|
2
|
-
.ant-cascader-menu-item[aria-checked='true'] {
|
3
|
-
background-color: var(--ant-color-primary-bg);
|
4
|
-
}
|
5
|
-
}
|
1
|
+
.yot-cascader {
|
2
|
+
.ant-cascader-menu-item[aria-checked='true'] {
|
3
|
+
background-color: var(--ant-color-primary-bg);
|
4
|
+
}
|
5
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
export interface PageData<T> {
|
2
|
-
content: T[];
|
3
|
-
page: {
|
4
|
-
number: number;
|
5
|
-
size: number;
|
6
|
-
totalElements: number;
|
7
|
-
totalPages: number;
|
8
|
-
};
|
9
|
-
}
|
10
|
-
// 查询课程返回的数据类型
|
11
|
-
export interface ICourseItem {
|
12
|
-
courseDefId: number;
|
13
|
-
courseName: string;
|
14
|
-
courseNo: string;
|
15
|
-
}
|
16
|
-
export interface ICourseProps {
|
17
|
-
showSearch?: boolean;
|
18
|
-
}
|
1
|
+
export interface PageData<T> {
|
2
|
+
content: T[];
|
3
|
+
page: {
|
4
|
+
number: number;
|
5
|
+
size: number;
|
6
|
+
totalElements: number;
|
7
|
+
totalPages: number;
|
8
|
+
};
|
9
|
+
}
|
10
|
+
// 查询课程返回的数据类型
|
11
|
+
export interface ICourseItem {
|
12
|
+
courseDefId: number;
|
13
|
+
courseName: string;
|
14
|
+
courseNo: string;
|
15
|
+
}
|
16
|
+
export interface ICourseProps {
|
17
|
+
showSearch?: boolean;
|
18
|
+
}
|
@@ -3,6 +3,7 @@ import dayjs from 'dayjs';
|
|
3
3
|
import { FC } from 'react';
|
4
4
|
type PickerType = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year';
|
5
5
|
export type DateIntervalProps = AntdDatePickerProps & {
|
6
|
+
defaultType?: PickerType;
|
6
7
|
options?: {
|
7
8
|
label: string;
|
8
9
|
value: PickerType;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["options", "onChange", "value"];
|
1
|
+
var _excluded = ["defaultType", "options", "onChange", "value"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
4
|
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."); }
|
@@ -10,13 +10,34 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
10
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
11
11
|
import { DatePicker as AntdDatePicker, Select } from 'antd';
|
12
12
|
import React, { useEffect, useMemo, useState } from 'react';
|
13
|
+
var defaultOptions = [{
|
14
|
+
label: '时间',
|
15
|
+
value: 'time'
|
16
|
+
}, {
|
17
|
+
label: '日期',
|
18
|
+
value: 'date'
|
19
|
+
}, {
|
20
|
+
label: '周',
|
21
|
+
value: 'week'
|
22
|
+
}, {
|
23
|
+
label: '月份',
|
24
|
+
value: 'month'
|
25
|
+
}, {
|
26
|
+
label: '季度',
|
27
|
+
value: 'quarter'
|
28
|
+
}, {
|
29
|
+
label: '年份',
|
30
|
+
value: 'year'
|
31
|
+
}];
|
13
32
|
export var DateInterval = function DateInterval(_ref) {
|
14
33
|
var _options$;
|
15
|
-
var
|
34
|
+
var defaultType = _ref.defaultType,
|
35
|
+
_ref$options = _ref.options,
|
36
|
+
options = _ref$options === void 0 ? defaultOptions : _ref$options,
|
16
37
|
onChange = _ref.onChange,
|
17
38
|
value = _ref.value,
|
18
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
19
|
-
var _useState = useState(
|
40
|
+
var _useState = useState(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
20
41
|
_useState2 = _slicedToArray(_useState, 2),
|
21
42
|
type = _useState2[0],
|
22
43
|
setType = _useState2[1];
|
@@ -38,13 +59,6 @@ export var DateInterval = function DateInterval(_ref) {
|
|
38
59
|
type: type
|
39
60
|
});
|
40
61
|
};
|
41
|
-
var handleSelectChange = function handleSelectChange(e) {
|
42
|
-
setType(e);
|
43
|
-
onChange === null || onChange === void 0 || onChange({
|
44
|
-
date: date,
|
45
|
-
type: e
|
46
|
-
});
|
47
|
-
};
|
48
62
|
var datePickerMap = useMemo(function () {
|
49
63
|
return {
|
50
64
|
time: /*#__PURE__*/React.createElement(AntdDatePicker.TimePicker, _extends({}, props, {
|
@@ -99,13 +113,20 @@ export var DateInterval = function DateInterval(_ref) {
|
|
99
113
|
}))
|
100
114
|
};
|
101
115
|
}, [type, date]);
|
116
|
+
var handleSelectChange = function handleSelectChange(e) {
|
117
|
+
setType(e);
|
118
|
+
onChange === null || onChange === void 0 || onChange({
|
119
|
+
date: date,
|
120
|
+
type: e
|
121
|
+
});
|
122
|
+
};
|
102
123
|
// 设置初始值
|
103
124
|
useEffect(function () {
|
104
125
|
if ((value === null || value === void 0 ? void 0 : value.type) != null) {
|
105
126
|
setType(value.type);
|
106
127
|
} else {
|
107
128
|
var _options$2;
|
108
|
-
setType(
|
129
|
+
setType(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
|
109
130
|
}
|
110
131
|
if ((value === null || value === void 0 ? void 0 : value.date) != null) {
|
111
132
|
setDate(value.date);
|
@@ -118,25 +139,7 @@ export var DateInterval = function DateInterval(_ref) {
|
|
118
139
|
style: {
|
119
140
|
width: 92
|
120
141
|
},
|
121
|
-
options: options
|
122
|
-
label: '时间',
|
123
|
-
value: 'time'
|
124
|
-
}, {
|
125
|
-
label: '日期',
|
126
|
-
value: 'date'
|
127
|
-
}, {
|
128
|
-
label: '周',
|
129
|
-
value: 'week'
|
130
|
-
}, {
|
131
|
-
label: '月份',
|
132
|
-
value: 'month'
|
133
|
-
}, {
|
134
|
-
label: '季度',
|
135
|
-
value: 'quarter'
|
136
|
-
}, {
|
137
|
-
label: '年份',
|
138
|
-
value: 'year'
|
139
|
-
}],
|
142
|
+
options: options,
|
140
143
|
onChange: handleSelectChange
|
141
144
|
}), datePickerMap[type]);
|
142
145
|
};
|
package/dist/date-range/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["options", "value", "onChange"];
|
1
|
+
var _excluded = ["defaultType", "options", "value", "onChange"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
4
|
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."); }
|
@@ -31,12 +31,13 @@ var defaultOptions = [{
|
|
31
31
|
}];
|
32
32
|
export var DateRange = function DateRange(_ref) {
|
33
33
|
var _options$;
|
34
|
-
var
|
34
|
+
var defaultType = _ref.defaultType,
|
35
|
+
_ref$options = _ref.options,
|
35
36
|
options = _ref$options === void 0 ? defaultOptions : _ref$options,
|
36
37
|
value = _ref.value,
|
37
38
|
onChange = _ref.onChange,
|
38
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
39
|
-
var _useState = useState(options === null || options === void 0 || (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
40
|
+
var _useState = useState(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
40
41
|
_useState2 = _slicedToArray(_useState, 2),
|
41
42
|
type = _useState2[0],
|
42
43
|
setType = _useState2[1];
|
@@ -118,7 +119,7 @@ export var DateRange = function DateRange(_ref) {
|
|
118
119
|
setType(value === null || value === void 0 ? void 0 : value.type);
|
119
120
|
} else {
|
120
121
|
var _options$2;
|
121
|
-
setType(options === null || options === void 0 || (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
|
122
|
+
setType(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
|
122
123
|
}
|
123
124
|
if ((value === null || value === void 0 ? void 0 : value.dates) != null) {
|
124
125
|
setDates(value === null || value === void 0 ? void 0 : value.dates);
|
@@ -1,14 +1,14 @@
|
|
1
|
-
export interface PageData<T> {
|
2
|
-
content: T[];
|
3
|
-
page: {
|
4
|
-
number: number;
|
5
|
-
size: number;
|
6
|
-
totalElements: number;
|
7
|
-
totalPages: number;
|
8
|
-
};
|
9
|
-
}
|
10
|
-
export interface dictionaryItem {
|
11
|
-
dictValue: string; // 字典项编码
|
12
|
-
dictTitle: string; // 字典项名称
|
13
|
-
dictTitle2?: string; // 字典项描述
|
14
|
-
}
|
1
|
+
export interface PageData<T> {
|
2
|
+
content: T[];
|
3
|
+
page: {
|
4
|
+
number: number;
|
5
|
+
size: number;
|
6
|
+
totalElements: number;
|
7
|
+
totalPages: number;
|
8
|
+
};
|
9
|
+
}
|
10
|
+
export interface dictionaryItem {
|
11
|
+
dictValue: string; // 字典项编码
|
12
|
+
dictTitle: string; // 字典项名称
|
13
|
+
dictTitle2?: string; // 字典项描述
|
14
|
+
}
|