@canlooks/can-ui 0.0.85 → 0.0.87
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/dist/cjs/components/boundary/errorBoundary.js +1 -3
- package/dist/cjs/components/calendar/calendar.style.js +124 -124
- package/dist/cjs/components/clickAway/clickAway.d.ts +1 -1
- package/dist/cjs/components/dialog/dialog.js +42 -9
- package/dist/cjs/components/dialog/dialog.style.d.ts +1 -0
- package/dist/cjs/components/dialog/dialog.style.js +21 -17
- package/dist/cjs/components/form/form.d.ts +3 -2
- package/dist/cjs/components/modal/modal.js +1 -1
- package/dist/cjs/components/modal/modal.style.d.ts +0 -1
- package/dist/cjs/components/modal/modal.style.js +5 -1
- package/dist/cjs/components/overlayBase/overlayBase.js +7 -7
- package/dist/cjs/components/overlayBase/overlayBase.style.d.ts +0 -1
- package/dist/cjs/components/overlayBase/overlayBase.style.js +0 -6
- package/dist/cjs/components/scrollbar/scrollbar.style.js +0 -1
- package/dist/cjs/components/status/status.d.ts +6 -6
- package/dist/esm/components/boundary/errorBoundary.js +1 -3
- package/dist/esm/components/calendar/calendar.style.js +124 -124
- package/dist/esm/components/clickAway/clickAway.d.ts +1 -1
- package/dist/esm/components/dialog/dialog.js +42 -9
- package/dist/esm/components/dialog/dialog.style.d.ts +1 -0
- package/dist/esm/components/dialog/dialog.style.js +21 -17
- package/dist/esm/components/form/form.d.ts +3 -2
- package/dist/esm/components/modal/modal.js +1 -1
- package/dist/esm/components/modal/modal.style.d.ts +0 -1
- package/dist/esm/components/modal/modal.style.js +5 -1
- package/dist/esm/components/overlayBase/overlayBase.js +8 -8
- package/dist/esm/components/overlayBase/overlayBase.style.d.ts +0 -1
- package/dist/esm/components/overlayBase/overlayBase.style.js +0 -6
- package/dist/esm/components/scrollbar/scrollbar.style.js +0 -1
- package/dist/esm/components/status/status.d.ts +6 -6
- package/documentation/dist/assets/index-DvrKS6Tv.js +7747 -0
- package/documentation/dist/atom-one-dark.min.css +1 -0
- package/documentation/dist/components/accordion.md +38 -0
- package/documentation/dist/components/actionSheet.md +49 -0
- package/documentation/dist/components/alert.md +38 -0
- package/documentation/dist/components/anchorList.md +36 -0
- package/documentation/dist/components/autocomplete.md +68 -0
- package/documentation/dist/components/avatar.md +79 -0
- package/documentation/dist/components/badge.md +33 -0
- package/documentation/dist/components/bottomNavigation.md +39 -0
- package/documentation/dist/components/breadcrumb.md +28 -0
- package/documentation/dist/components/bubbleConfirm.md +34 -0
- package/documentation/dist/components/button.md +62 -0
- package/documentation/dist/components/card.md +30 -0
- package/documentation/dist/components/cascade.md +48 -0
- package/documentation/dist/components/checkbox.md +36 -0
- package/documentation/dist/components/colorPicker.md +27 -0
- package/documentation/dist/components/contextMenu.md +27 -0
- package/documentation/dist/components/counter.md +29 -0
- package/documentation/dist/components/dataGrid.md +112 -0
- package/documentation/dist/components/dateTimePicker.md +35 -0
- package/documentation/dist/components/dateTimeRangePicker.md +36 -0
- package/documentation/dist/components/descriptions.md +35 -0
- package/documentation/dist/components/dialog.md +56 -0
- package/documentation/dist/components/divider.md +26 -0
- package/documentation/dist/components/drawer.md +40 -0
- package/documentation/dist/components/flex.md +20 -0
- package/documentation/dist/components/form.md +131 -0
- package/documentation/dist/components/formDialog.md +36 -0
- package/documentation/dist/components/grid.md +34 -0
- package/documentation/dist/components/highlight.md +26 -0
- package/documentation/dist/components/image.md +90 -0
- package/documentation/dist/components/input.md +39 -0
- package/documentation/dist/components/loading.md +46 -0
- package/documentation/dist/components/menu.md +85 -0
- package/documentation/dist/components/pagination.md +38 -0
- package/documentation/dist/components/pickerDialog.md +56 -0
- package/documentation/dist/components/placeholder.md +30 -0
- package/documentation/dist/components/progress.md +43 -0
- package/documentation/dist/components/radio.md +37 -0
- package/documentation/dist/components/rating.md +35 -0
- package/documentation/dist/components/resizable.md +41 -0
- package/documentation/dist/components/scrollbar.md +31 -0
- package/documentation/dist/components/segmented.md +57 -0
- package/documentation/dist/components/select.md +30 -0
- package/documentation/dist/components/skeleton.md +26 -0
- package/documentation/dist/components/slidableActions.md +53 -0
- package/documentation/dist/guide/appComponent.md +30 -0
- package/documentation/dist/guide/globalMethods.md +238 -0
- package/documentation/dist/guide/icon.md +57 -0
- package/documentation/dist/guide/introduction.md +2 -0
- package/documentation/dist/guide/overrideProps.md +0 -0
- package/documentation/dist/guide/startup.md +23 -0
- package/documentation/dist/guide/theme.md +249 -0
- package/documentation/dist/index.html +13 -0
- package/documentation/dist/logo.png +0 -0
- package/extensions/curd.cjs +5 -5
- package/extensions/documentViewer.cjs +5 -5
- package/extensions/textFormatter.cjs +5 -5
- package/package.json +1 -1
|
@@ -13,128 +13,128 @@ export const classes = defineInnerClasses('calendar', [
|
|
|
13
13
|
'yearItem',
|
|
14
14
|
'foot'
|
|
15
15
|
]);
|
|
16
|
-
export const style = defineCss(({ divider, text, spacing }) => css `
|
|
17
|
-
.${classes.head} {
|
|
18
|
-
height: 40px;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
border-bottom: 1px solid ${divider};
|
|
23
|
-
padding: 0 ${menuListPadding}px;
|
|
24
|
-
position: relative;
|
|
25
|
-
|
|
26
|
-
.${classes.headSide} {
|
|
27
|
-
z-index: 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.${classes.headControl} {
|
|
31
|
-
color: ${text.placeholder};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.${classes.headCenter} {
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
position: absolute;
|
|
39
|
-
inset: 0;
|
|
40
|
-
|
|
41
|
-
.${classes.headButton} {
|
|
42
|
-
font-weight: bold;
|
|
43
|
-
color: ${text.primary};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.${classes.body} {
|
|
49
|
-
padding: ${spacing[3]}px ${spacing[4]}px;
|
|
50
|
-
display: grid;
|
|
51
|
-
place-items: center;
|
|
52
|
-
|
|
53
|
-
&[data-view-type=date] {
|
|
54
|
-
font-size: ${13 / 14}em;
|
|
55
|
-
grid-template-columns: repeat(7, 36px);
|
|
56
|
-
grid-template-rows: repeat(7, 36px);
|
|
57
|
-
|
|
58
|
-
.${classes.dateItem} {
|
|
59
|
-
width: 24px;
|
|
60
|
-
height: 24px;
|
|
61
|
-
|
|
62
|
-
&:not([data-variant=filled]) {
|
|
63
|
-
color: ${text.primary};
|
|
64
|
-
border-color: ${text.disabled};
|
|
65
|
-
|
|
66
|
-
&[data-other-month=true] {
|
|
67
|
-
color: ${text.placeholder};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&:disabled {
|
|
72
|
-
width: 100%;
|
|
73
|
-
border-radius: 0;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&[data-view-type=month], &[data-view-type=year] {
|
|
79
|
-
grid-template-columns: repeat(3, 84px);
|
|
80
|
-
grid-template-rows: repeat(4, 63px);
|
|
81
|
-
|
|
82
|
-
.${classes.monthItem},
|
|
83
|
-
.${classes.yearItem} {
|
|
84
|
-
width: 72px;
|
|
85
|
-
padding-inline: 0;
|
|
86
|
-
|
|
87
|
-
&:not([data-variant=filled]) {
|
|
88
|
-
color: ${text.primary};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&[data-size=small] {
|
|
95
|
-
.${classes.body} {
|
|
96
|
-
&[data-view-type=date] {
|
|
97
|
-
grid-template-columns: repeat(7, 30px);
|
|
98
|
-
grid-template-rows: repeat(7, 30px);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
&[data-view-type=month], &[data-view-type=year] {
|
|
102
|
-
grid-template-columns: repeat(3, 70px);
|
|
103
|
-
grid-template-rows: repeat(4, 52.5px);
|
|
104
|
-
|
|
105
|
-
.${classes.monthItem},
|
|
106
|
-
.${classes.yearItem} {
|
|
107
|
-
width: 60px;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&[data-size=large] {
|
|
114
|
-
.${classes.body} {
|
|
115
|
-
&[data-view-type=date] {
|
|
116
|
-
font-size: 1em;
|
|
117
|
-
grid-template-columns: repeat(7, 42px);
|
|
118
|
-
grid-template-rows: repeat(7, 42px);
|
|
119
|
-
|
|
120
|
-
.${classes.dateItem} {
|
|
121
|
-
width: 32px;
|
|
122
|
-
height: 32px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&[data-view-type=month], &[data-view-type=year] {
|
|
127
|
-
grid-template-columns: repeat(3, 98px);
|
|
128
|
-
grid-template-rows: repeat(4, 73.5px);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.${classes.foot} {
|
|
134
|
-
height: 41px;
|
|
135
|
-
display: flex;
|
|
136
|
-
align-items: center;
|
|
137
|
-
justify-content: center;
|
|
138
|
-
border-top: 1px solid ${divider};
|
|
139
|
-
}
|
|
16
|
+
export const style = defineCss(({ divider, text, spacing }) => css `
|
|
17
|
+
.${classes.head} {
|
|
18
|
+
height: 40px;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
border-bottom: 1px solid ${divider};
|
|
23
|
+
padding: 0 ${menuListPadding}px;
|
|
24
|
+
position: relative;
|
|
25
|
+
|
|
26
|
+
.${classes.headSide} {
|
|
27
|
+
z-index: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.${classes.headControl} {
|
|
31
|
+
color: ${text.placeholder};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.${classes.headCenter} {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
|
|
41
|
+
.${classes.headButton} {
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
color: ${text.primary};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.${classes.body} {
|
|
49
|
+
padding: ${spacing[3]}px ${spacing[4]}px;
|
|
50
|
+
display: grid;
|
|
51
|
+
place-items: center;
|
|
52
|
+
|
|
53
|
+
&[data-view-type=date] {
|
|
54
|
+
font-size: ${13 / 14}em;
|
|
55
|
+
grid-template-columns: repeat(7, 36px);
|
|
56
|
+
grid-template-rows: repeat(7, 36px);
|
|
57
|
+
|
|
58
|
+
.${classes.dateItem} {
|
|
59
|
+
width: 24px;
|
|
60
|
+
height: 24px;
|
|
61
|
+
|
|
62
|
+
&:not([data-variant=filled]) {
|
|
63
|
+
color: ${text.primary};
|
|
64
|
+
border-color: ${text.disabled};
|
|
65
|
+
|
|
66
|
+
&[data-other-month=true] {
|
|
67
|
+
color: ${text.placeholder};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:disabled {
|
|
72
|
+
width: 100%;
|
|
73
|
+
border-radius: 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[data-view-type=month], &[data-view-type=year] {
|
|
79
|
+
grid-template-columns: repeat(3, 84px);
|
|
80
|
+
grid-template-rows: repeat(4, 63px);
|
|
81
|
+
|
|
82
|
+
.${classes.monthItem},
|
|
83
|
+
.${classes.yearItem} {
|
|
84
|
+
width: 72px;
|
|
85
|
+
padding-inline: 0;
|
|
86
|
+
|
|
87
|
+
&:not([data-variant=filled]) {
|
|
88
|
+
color: ${text.primary};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&[data-size=small] {
|
|
95
|
+
.${classes.body} {
|
|
96
|
+
&[data-view-type=date] {
|
|
97
|
+
grid-template-columns: repeat(7, 30px);
|
|
98
|
+
grid-template-rows: repeat(7, 30px);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&[data-view-type=month], &[data-view-type=year] {
|
|
102
|
+
grid-template-columns: repeat(3, 70px);
|
|
103
|
+
grid-template-rows: repeat(4, 52.5px);
|
|
104
|
+
|
|
105
|
+
.${classes.monthItem},
|
|
106
|
+
.${classes.yearItem} {
|
|
107
|
+
width: 60px;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&[data-size=large] {
|
|
114
|
+
.${classes.body} {
|
|
115
|
+
&[data-view-type=date] {
|
|
116
|
+
font-size: 1em;
|
|
117
|
+
grid-template-columns: repeat(7, 42px);
|
|
118
|
+
grid-template-rows: repeat(7, 42px);
|
|
119
|
+
|
|
120
|
+
.${classes.dateItem} {
|
|
121
|
+
width: 32px;
|
|
122
|
+
height: 32px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&[data-view-type=month], &[data-view-type=year] {
|
|
127
|
+
grid-template-columns: repeat(3, 98px);
|
|
128
|
+
grid-template-rows: repeat(4, 73.5px);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.${classes.foot} {
|
|
134
|
+
height: 41px;
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
border-top: 1px solid ${divider};
|
|
139
|
+
}
|
|
140
140
|
`);
|
|
@@ -60,7 +60,7 @@ export declare function ClickAway({ ref, container, eventType, onClickAway, disa
|
|
|
60
60
|
results: number;
|
|
61
61
|
security: string;
|
|
62
62
|
unselectable: "off" | "on";
|
|
63
|
-
popover: "" | "auto" | "manual"
|
|
63
|
+
popover: "" | "auto" | "manual";
|
|
64
64
|
popoverTargetAction: "toggle" | "hide" | "show";
|
|
65
65
|
popoverTarget: string;
|
|
66
66
|
inert: boolean;
|
|
@@ -17,8 +17,12 @@ export function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWi
|
|
|
17
17
|
};
|
|
18
18
|
// 绑定ESC键
|
|
19
19
|
const overlayRef = useEscapeClosable({ escapeClosable, close }, onCancel);
|
|
20
|
+
const containerRef = useRef(null);
|
|
20
21
|
// 点击遮罩层
|
|
21
22
|
const onMaskClick = (e) => {
|
|
23
|
+
if (e.target !== containerRef.current) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
22
26
|
props.onMaskClick?.(e);
|
|
23
27
|
if (maskClosable) {
|
|
24
28
|
onCancel?.(e);
|
|
@@ -45,7 +49,7 @@ export function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWi
|
|
|
45
49
|
}, confirmLoading);
|
|
46
50
|
/**
|
|
47
51
|
* ---------------------------------------------------------------------
|
|
48
|
-
* 长内容滚动
|
|
52
|
+
* 长内容滚动 - card模式
|
|
49
53
|
*/
|
|
50
54
|
const bodyRef = useRef(null);
|
|
51
55
|
const bodyWrapRef = useRef(null);
|
|
@@ -57,6 +61,17 @@ export function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWi
|
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
63
|
useEffect(() => {
|
|
64
|
+
if (scrollBehavior === 'card') {
|
|
65
|
+
bodyRef.current.addEventListener('scroll', onScroll);
|
|
66
|
+
return () => {
|
|
67
|
+
bodyRef.current.removeEventListener('scroll', onScroll);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}, [scrollBehavior]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (scrollBehavior !== 'card') {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
60
75
|
if (innerOpen.current) {
|
|
61
76
|
const resizeObserver = new ResizeObserver(onScroll);
|
|
62
77
|
resizeObserver.observe(bodyRef.current);
|
|
@@ -65,7 +80,25 @@ export function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWi
|
|
|
65
80
|
resizeObserver.disconnect();
|
|
66
81
|
};
|
|
67
82
|
}
|
|
68
|
-
}, [innerOpen.current]);
|
|
83
|
+
}, [innerOpen.current, scrollBehavior]);
|
|
84
|
+
/**
|
|
85
|
+
* ---------------------------------------------------------------------
|
|
86
|
+
* 长内容滚动 - card模式
|
|
87
|
+
*/
|
|
88
|
+
const cardRef = useRef(null);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (scrollBehavior === 'body' && innerOpen.current) {
|
|
91
|
+
const containerEl = containerRef.current;
|
|
92
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
93
|
+
containerEl.dataset.scrollable = (containerEl.scrollHeight > containerEl.clientHeight).toString();
|
|
94
|
+
});
|
|
95
|
+
resizeObserver.observe(containerEl);
|
|
96
|
+
resizeObserver.observe(cardRef.current);
|
|
97
|
+
return () => {
|
|
98
|
+
resizeObserver.disconnect();
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}, [innerOpen.current, scrollBehavior]);
|
|
69
102
|
/**
|
|
70
103
|
* ---------------------------------------------------------------------
|
|
71
104
|
* 渲染
|
|
@@ -78,11 +111,11 @@ export function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWi
|
|
|
78
111
|
}
|
|
79
112
|
return footer;
|
|
80
113
|
};
|
|
81
|
-
return (_jsx(Modal, { ...props, ref: cloneRef(overlayRef, props.ref), css: style, className: clsx(classes.root, props.className), open: innerOpen.current,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
114
|
+
return (_jsx(Modal, { ...props, ref: cloneRef(overlayRef, props.ref), css: style, className: clsx(classes.root, props.className), open: innerOpen.current, "data-scroll-behavior": scrollBehavior, "data-draggable": draggable, children: _jsx("div", { ref: containerRef, className: classes.container, onClick: onMaskClick, children: _jsx(Draggable, { container: () => overlayRef.current, children: (targetProps, handleProps) => _jsxs("div", { ref: cardRef, className: classes.card, ...targetProps, style: { width, minWidth, maxWidth, ...targetProps.style }, children: [!!icon &&
|
|
115
|
+
_jsx("div", { className: classes.icon, children: icon }), _jsxs("div", { className: classes.content, children: [!!(title || showClose) &&
|
|
116
|
+
_jsxs("div", { className: classes.titleRow, ...handleProps, children: [_jsx("div", { className: classes.title, children: title }), showClose &&
|
|
117
|
+
_jsx(Button, { shape: "circular", variant: "text", color: "text.secondary", ...closeProps, className: clsx(classes.close, closeProps?.className), onClick: closeHandler, children: _jsx(Icon, { icon: faXmark }) })] }), _jsxs("div", { ref: bodyRef, className: classes.body, onScroll: scrollBehavior === 'card' ? onScroll : void 0, children: [!!prefix &&
|
|
118
|
+
_jsx("div", { className: classes.prefix, children: prefix }), _jsx("div", { ref: bodyWrapRef, className: classes.bodyWrap, children: props.children }), !!suffix &&
|
|
119
|
+
_jsx("div", { className: classes.suffix, children: suffix })] }), (typeof footer === 'undefined' || !!footer) &&
|
|
120
|
+
_jsx("div", { className: classes.footer, children: renderFooter() })] })] }) }) }) }));
|
|
88
121
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { defineInnerClasses, defineCss } from '../../utils';
|
|
3
|
-
import { classes as modalClasses } from '../modal/modal.style';
|
|
4
|
-
import { classes as overlayBaseClasses } from '../overlayBase/overlayBase.style';
|
|
5
3
|
export const classes = defineInnerClasses('dialog', [
|
|
4
|
+
'container',
|
|
6
5
|
'card',
|
|
7
6
|
'icon',
|
|
8
7
|
'content',
|
|
@@ -16,6 +15,16 @@ export const classes = defineInnerClasses('dialog', [
|
|
|
16
15
|
'footer'
|
|
17
16
|
]);
|
|
18
17
|
export const style = defineCss(({ background, borderRadius, boxShadow, spacing, colors, divider }) => css `
|
|
18
|
+
.${classes.container} {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
padding: 40px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|
|
27
|
+
|
|
19
28
|
.${classes.card} {
|
|
20
29
|
display: flex;
|
|
21
30
|
background-color: ${background.content};
|
|
@@ -23,29 +32,24 @@ export const style = defineCss(({ background, borderRadius, boxShadow, spacing,
|
|
|
23
32
|
box-shadow: ${boxShadow[0]};
|
|
24
33
|
}
|
|
25
34
|
|
|
26
|
-
.${modalClasses.childrenWrap} {
|
|
27
|
-
max-width: 100%;
|
|
28
|
-
padding: 40px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
35
|
&[data-scroll-behavior=card] {
|
|
32
|
-
.${modalClasses.childrenWrap} {
|
|
33
|
-
height: 100%;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
36
|
.${classes.card} {
|
|
37
37
|
max-height: 100%;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&[data-scroll-behavior=body] {
|
|
42
|
-
.${
|
|
43
|
-
height: auto;
|
|
44
|
-
min-height: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.enter-done .${overlayBaseClasses.childrenWrap} {
|
|
42
|
+
.${classes.container} {
|
|
48
43
|
overflow: hidden auto;
|
|
44
|
+
scrollbar-width: none;
|
|
45
|
+
|
|
46
|
+
&[data-scrollable=true] {
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.enter-done .${classes.container} {
|
|
52
|
+
scrollbar-width: auto;
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -31,11 +31,12 @@ type FormContext<V extends FormValue> = {
|
|
|
31
31
|
};
|
|
32
32
|
declare const FormContext: React.Context<FormContext<any>>;
|
|
33
33
|
export declare function useFormContext<V extends FormValue>(): FormContext<V>;
|
|
34
|
-
type
|
|
34
|
+
type FormValueContext<V extends FormValue> = {
|
|
35
35
|
formValue?: V;
|
|
36
36
|
setFieldValue?(field: FieldPath, value: any, silent?: boolean): void;
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
declare const FormValueContext: React.Context<FormValueContext<any>>;
|
|
39
|
+
export declare function useFormValueContext<V extends FormValue>(): FormValueContext<V>;
|
|
39
40
|
export declare function useFormStyleContext(): FormSharedProps;
|
|
40
41
|
export type FormRef<V extends FormValue = FormValue> = {
|
|
41
42
|
/** 存在校验不通过的字段时会得到`null` */
|
|
@@ -19,5 +19,5 @@ export function Modal({ modalProps, ...props }) {
|
|
|
19
19
|
return (_jsx(OverlayBase, { ...props, css: style, className: clsx(classes.root, props.className), children: _jsx(Grow, { timeout: overlayBaseTransitionDuration, ...modalProps, in: props.open, className: clsx(classes.modal, modalProps?.className), style: {
|
|
20
20
|
transformOrigin: transformOrigin.current,
|
|
21
21
|
...modalProps?.style
|
|
22
|
-
}, children:
|
|
22
|
+
}, children: props.children }) }));
|
|
23
23
|
}
|
|
@@ -2,7 +2,6 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { defineInnerClasses } from '../../utils';
|
|
3
3
|
export const classes = defineInnerClasses('modal', [
|
|
4
4
|
'modal',
|
|
5
|
-
'childrenWrap'
|
|
6
5
|
]);
|
|
7
6
|
export const style = css `
|
|
8
7
|
.${classes.modal} {
|
|
@@ -11,5 +10,10 @@ export const style = css `
|
|
|
11
10
|
display: flex;
|
|
12
11
|
align-items: center;
|
|
13
12
|
justify-content: center;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
|
|
15
|
+
> * {
|
|
16
|
+
pointer-events: all;
|
|
17
|
+
}
|
|
14
18
|
}
|
|
15
19
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
import { classes, style } from './overlayBase.style';
|
|
4
4
|
import { clsx, mergeComponentProps, useContainer, useDerivedState } from '../../utils';
|
|
@@ -33,11 +33,11 @@ export function OverlayBase({ container, effectContainer, forceRender, open, onM
|
|
|
33
33
|
onClosed?.();
|
|
34
34
|
forceRender === false && setShouldRender(false);
|
|
35
35
|
};
|
|
36
|
-
return shouldRender.current && createPortal(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
return shouldRender.current && createPortal(_jsxs("div", { ...props, css: style, className: clsx(classes.root, props.className), "data-open": open, "data-custom-container": containerEl.current !== document.body, children: [_jsx(Fade, { timeout: overlayBaseTransitionDuration, ...mergeComponentProps(maskProps, {
|
|
37
|
+
in: open,
|
|
38
|
+
className: classes.mask,
|
|
39
|
+
onClick,
|
|
40
|
+
onEntered,
|
|
41
|
+
onExited
|
|
42
|
+
}) }), props.children] }), containerEl.current);
|
|
43
43
|
}
|
|
@@ -4,7 +4,6 @@ import { appStyleCallback } from '../app/app.style';
|
|
|
4
4
|
import { zIndex } from '../theme';
|
|
5
5
|
export const classes = defineInnerClasses('overlay-base', [
|
|
6
6
|
'mask',
|
|
7
|
-
'childrenWrap'
|
|
8
7
|
]);
|
|
9
8
|
export const style = defineCss(theme => {
|
|
10
9
|
return [
|
|
@@ -27,11 +26,6 @@ export const style = defineCss(theme => {
|
|
|
27
26
|
&:not([data-open=true]) {
|
|
28
27
|
pointer-events: none;
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
.${classes.childrenWrap} {
|
|
32
|
-
height: 100%;
|
|
33
|
-
position: relative;
|
|
34
|
-
}
|
|
35
29
|
`
|
|
36
30
|
];
|
|
37
31
|
});
|
|
@@ -3,12 +3,12 @@ import { DivProps, Status as IStatus } from '../../types';
|
|
|
3
3
|
import { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
|
|
4
4
|
export type StatusType = IStatus | 'confirm' | 'unknown';
|
|
5
5
|
export declare const statusMapToIconDefinition: {
|
|
6
|
-
info: import("@fortawesome/
|
|
7
|
-
success: import("@fortawesome/
|
|
8
|
-
warning: import("@fortawesome/
|
|
9
|
-
error: import("@fortawesome/
|
|
10
|
-
confirm: import("@fortawesome/
|
|
11
|
-
unknown: import("@fortawesome/
|
|
6
|
+
info: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
7
|
+
success: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
8
|
+
warning: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
9
|
+
error: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
10
|
+
confirm: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
11
|
+
unknown: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
12
12
|
};
|
|
13
13
|
export interface StatusIconProps extends Partial<FontAwesomeIconProps> {
|
|
14
14
|
status?: StatusType;
|