@bifrostui/react 1.4.4-beta.0 → 1.4.5-beta.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.
- package/dist/ActionSheet/ActionSheet.css +2 -2
- package/dist/Button/Button.css +42 -60
- package/dist/IconButton/IconButton.css +5 -5
- package/dist/Input/Input.types.d.ts +3 -3
- package/dist/Picker/Picker.js +4 -1
- package/dist/Picker/Picker.types.d.ts +19 -13
- package/dist/Picker/utils.d.ts +2 -2
- package/dist/Popover/Popover.css +5 -5
- package/dist/Radio/Radio.css +0 -1
- package/dist/Tabs/Tab.css +9 -9
- package/dist/Tabs/Tab.js +4 -4
- package/dist/Tabs/Tabs.css +25 -19
- package/dist/Tabs/Tabs.js +30 -28
- package/dist/Tabs/Tabs.types.d.ts +0 -6
- package/dist/Tag/Tag.css +1 -1
- package/dist/Tooltip/Tooltip.css +5 -5
- package/es/ActionSheet/ActionSheet.css +2 -2
- package/es/Button/Button.css +42 -60
- package/es/IconButton/IconButton.css +5 -5
- package/es/Input/Input.types.d.ts +3 -3
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/Picker/Picker.js +4 -1
- package/es/Picker/Picker.types.d.ts +19 -13
- package/es/Picker/utils.d.ts +2 -2
- package/es/Popover/Popover.css +5 -5
- package/es/Radio/Radio.css +0 -1
- package/es/Tabs/Tab.css +9 -9
- package/es/Tabs/Tab.js +4 -4
- package/es/Tabs/Tabs.css +25 -19
- package/es/Tabs/Tabs.js +30 -28
- package/es/Tabs/Tabs.types.d.ts +0 -6
- package/es/Tag/Tag.css +1 -1
- package/es/Tooltip/Tooltip.css +5 -5
- package/package.json +6 -6
package/dist/Tabs/Tabs.js
CHANGED
|
@@ -64,14 +64,19 @@ var import_TabsContext = require("./TabsContext");
|
|
|
64
64
|
var import_bound = __toESM(require("./utils/bound"));
|
|
65
65
|
var import_Tabs2 = require("./Tabs.css");
|
|
66
66
|
const prefixCls = "bui-tabs";
|
|
67
|
+
const defaultProps = {
|
|
68
|
+
align: "center",
|
|
69
|
+
tabs: []
|
|
70
|
+
};
|
|
67
71
|
const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
68
|
-
const _a = props, { children, className, value, tabs, align, onChange } = _a, others = __objRest(_a, ["children", "className", "value", "tabs", "align", "onChange"]);
|
|
72
|
+
const _a = __spreadValues(__spreadValues({}, defaultProps), props), { children, className, value, tabs, align, onChange } = _a, others = __objRest(_a, ["children", "className", "value", "tabs", "align", "onChange"]);
|
|
69
73
|
const [active, setActive] = (0, import_react.useState)("");
|
|
70
74
|
const tabsRef = (0, import_react.useRef)(null);
|
|
71
75
|
const activeLineRef = (0, import_react.useRef)(null);
|
|
72
76
|
const [lineData, setLineData] = (0, import_react.useState)({
|
|
73
77
|
x: 0,
|
|
74
|
-
transitionInUse: false
|
|
78
|
+
transitionInUse: false,
|
|
79
|
+
hasActiveTab: false
|
|
75
80
|
});
|
|
76
81
|
const [maskData, setMaskData] = (0, import_react.useState)({
|
|
77
82
|
leftMaskOpacity: 0,
|
|
@@ -114,7 +119,8 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
114
119
|
}
|
|
115
120
|
setLineData({
|
|
116
121
|
x,
|
|
117
|
-
transitionInUse
|
|
122
|
+
transitionInUse,
|
|
123
|
+
hasActiveTab: !!activeTab
|
|
118
124
|
});
|
|
119
125
|
const maxScrollDistance = containerScrollWidth - containerWidth;
|
|
120
126
|
if (maxScrollDistance <= 0 || !activeTab)
|
|
@@ -128,25 +134,6 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
128
134
|
tabsRef.current.scrollLeft = nextScrollLeft;
|
|
129
135
|
}
|
|
130
136
|
};
|
|
131
|
-
(0, import_react.useEffect)(() => {
|
|
132
|
-
setActive(value);
|
|
133
|
-
}, [value]);
|
|
134
|
-
(0, import_react.useLayoutEffect)(() => {
|
|
135
|
-
animate({ transitionInUse: false });
|
|
136
|
-
}, []);
|
|
137
|
-
(0, import_react.useEffect)(() => {
|
|
138
|
-
const handleResize = (0, import_utils.debounce)(() => {
|
|
139
|
-
animate({ transitionInUse: true });
|
|
140
|
-
updateMask();
|
|
141
|
-
}, 100);
|
|
142
|
-
window.addEventListener("resize", handleResize);
|
|
143
|
-
return () => {
|
|
144
|
-
window.removeEventListener("resize", handleResize);
|
|
145
|
-
};
|
|
146
|
-
}, [active]);
|
|
147
|
-
(0, import_utils.useDidMountEffect)(() => {
|
|
148
|
-
animate({ transitionInUse: true });
|
|
149
|
-
}, [active, tabs, children]);
|
|
150
137
|
const updateMask = (0, import_react.useMemo)(
|
|
151
138
|
() => (0, import_utils.throttle)(
|
|
152
139
|
() => {
|
|
@@ -169,6 +156,25 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
169
156
|
),
|
|
170
157
|
[]
|
|
171
158
|
);
|
|
159
|
+
(0, import_react.useEffect)(() => {
|
|
160
|
+
setActive(value);
|
|
161
|
+
}, [value]);
|
|
162
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
163
|
+
animate({ transitionInUse: false });
|
|
164
|
+
}, []);
|
|
165
|
+
(0, import_react.useEffect)(() => {
|
|
166
|
+
const handleResize = (0, import_utils.debounce)(() => {
|
|
167
|
+
animate({ transitionInUse: true });
|
|
168
|
+
updateMask();
|
|
169
|
+
}, 100);
|
|
170
|
+
window.addEventListener("resize", handleResize);
|
|
171
|
+
return () => {
|
|
172
|
+
window.removeEventListener("resize", handleResize);
|
|
173
|
+
};
|
|
174
|
+
}, [active]);
|
|
175
|
+
(0, import_utils.useDidMountEffect)(() => {
|
|
176
|
+
animate({ transitionInUse: true });
|
|
177
|
+
}, [active, tabs, children]);
|
|
172
178
|
(0, import_react.useLayoutEffect)(() => {
|
|
173
179
|
updateMask();
|
|
174
180
|
}, []);
|
|
@@ -210,10 +216,10 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
210
216
|
{
|
|
211
217
|
ref: activeLineRef,
|
|
212
218
|
className: (0, import_clsx.default)(`${prefixCls}-tabline`, {
|
|
213
|
-
"bui-tabline-invisible": import_utils.isMini || !lineData.
|
|
219
|
+
"bui-tabline-invisible": import_utils.isMini || !lineData.hasActiveTab
|
|
214
220
|
}),
|
|
215
221
|
style: {
|
|
216
|
-
transition: lineData.transitionInUse ? "transform 0.
|
|
222
|
+
transition: lineData.transitionInUse ? "transform 0.3s ease-in-out" : void 0,
|
|
217
223
|
transform: `translate3d(${lineData.x}px, 0px, 0px)`
|
|
218
224
|
}
|
|
219
225
|
}
|
|
@@ -230,8 +236,4 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
230
236
|
}), children)));
|
|
231
237
|
});
|
|
232
238
|
Tabs.displayName = "BuiTabs";
|
|
233
|
-
Tabs.defaultProps = {
|
|
234
|
-
align: "center",
|
|
235
|
-
tabs: []
|
|
236
|
-
};
|
|
237
239
|
var Tabs_default = Tabs;
|
|
@@ -3,9 +3,6 @@ import React, { SyntheticEvent } from 'react';
|
|
|
3
3
|
export interface TabHeaderItem {
|
|
4
4
|
title: React.ReactNode;
|
|
5
5
|
index: string;
|
|
6
|
-
/**
|
|
7
|
-
* 是否禁止点击
|
|
8
|
-
*/
|
|
9
6
|
disabled?: boolean;
|
|
10
7
|
}
|
|
11
8
|
export interface ITabsChangeData {
|
|
@@ -14,11 +11,8 @@ export interface ITabsChangeData {
|
|
|
14
11
|
}
|
|
15
12
|
export type TabChangeEvent = (e?: SyntheticEvent, data?: ITabsChangeData) => void;
|
|
16
13
|
export interface ITabItem {
|
|
17
|
-
/** 面板标题 */
|
|
18
14
|
title: React.ReactNode;
|
|
19
|
-
/** 面板的索引值 */
|
|
20
15
|
index: string;
|
|
21
|
-
/** 面板是否禁用 */
|
|
22
16
|
disabled?: boolean;
|
|
23
17
|
}
|
|
24
18
|
export type ITabAlign = 'start' | 'center';
|
package/dist/Tag/Tag.css
CHANGED
package/dist/Tooltip/Tooltip.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.bui-tooltip {
|
|
2
2
|
--arrow-size: var(--bui-tooltip-arrow-size, 8PX);
|
|
3
|
-
--
|
|
3
|
+
--location-position: var(--bui-tooltip-location-position, 8PX);
|
|
4
4
|
--max-width: var(--bui-tooltip-max-width, 350px);
|
|
5
5
|
--content-min-width: var(--bui-tooltip-content-min-width, 30px);
|
|
6
6
|
--content-min-height: var(--bui-tooltip-content-min-height, 32px);
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
position: absolute;
|
|
18
18
|
}
|
|
19
19
|
.bui-tooltip .bui-tooltip-arrow.location-left {
|
|
20
|
-
left: var(--
|
|
20
|
+
left: var(--location-position);
|
|
21
21
|
}
|
|
22
22
|
.bui-tooltip .bui-tooltip-arrow.location-right {
|
|
23
|
-
right: var(--
|
|
23
|
+
right: var(--location-position);
|
|
24
24
|
}
|
|
25
25
|
.bui-tooltip .bui-tooltip-arrow.location-top {
|
|
26
|
-
top: var(--
|
|
26
|
+
top: var(--location-position);
|
|
27
27
|
}
|
|
28
28
|
.bui-tooltip .bui-tooltip-arrow.location-bottom {
|
|
29
|
-
bottom: var(--
|
|
29
|
+
bottom: var(--location-position);
|
|
30
30
|
}
|
|
31
31
|
.bui-tooltip.tooltip-top .location-center,
|
|
32
32
|
.bui-tooltip.tooltip-bottom .location-center {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.bui-action-sheet {
|
|
2
2
|
--extra-line-height: var(--bui-action-sheet-extra-line-height, 23px);
|
|
3
3
|
--extra-padding: var(--bui-action-sheet-extra-padding, var(--bui-spacing-xl));
|
|
4
|
-
--extra-
|
|
4
|
+
--extra-margin: var(--bui-action-sheet-extra-margin, 0 var(--bui-spacing-xl));
|
|
5
5
|
font-family: var(--bui-font-family);
|
|
6
6
|
}
|
|
7
7
|
.bui-action-sheet-content {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
background: var(--bui-color-bg-view);
|
|
27
27
|
text-align: center;
|
|
28
28
|
border-bottom: 1px solid var(--bui-color-border-default);
|
|
29
|
-
margin: var(--extra-
|
|
29
|
+
margin: var(--extra-margin);
|
|
30
30
|
}
|
package/es/Button/Button.css
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
.bui-btn {
|
|
2
|
-
--
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--disabled-opacity: var(--bui-button-disabled-opacity, 0.5);
|
|
13
|
-
--small-padding: var(--bui-button-small-padding, 0 11px);
|
|
14
|
-
--small-height: var(--bui-button-small-height, 24px);
|
|
15
|
-
--medium-padding: var(--bui-button-medium-padding, 0 14px);
|
|
16
|
-
--large-padding: var(--bui-button-large-padding, 0 14px);
|
|
17
|
-
--large-height: var(--bui-button-large-height, 33px);
|
|
18
|
-
--full-font-size: var(--bui-button-full-font-size, var(--bui-title-size-4));
|
|
19
|
-
--full-height: var(--bui-button-full-height, 42px);
|
|
20
|
-
border: var(--default-border);
|
|
2
|
+
--bui-btn-font-size: var(--bui-text-size-3);
|
|
3
|
+
--bui-btn-font-weight: var(--bui-font-weight-medium);
|
|
4
|
+
--bui-btn-border-radius: 120px;
|
|
5
|
+
--bui-btn-height: 27px;
|
|
6
|
+
--bui-btn-color: var(--bui-color-fg-muted);
|
|
7
|
+
--bui-btn-bg: var(--bui-color-bg-view);
|
|
8
|
+
--bui-btn-opacity: 1;
|
|
9
|
+
--bui-btn-padding: 0 14px;
|
|
10
|
+
--bui-btn-border: 0;
|
|
11
|
+
--bui-btn-font-family: var(--bui-font-family);
|
|
21
12
|
outline: 0;
|
|
22
|
-
background-color: transparent;
|
|
23
13
|
cursor: pointer;
|
|
24
|
-
color: var(--text-color);
|
|
25
14
|
box-sizing: border-box;
|
|
26
15
|
position: relative;
|
|
27
16
|
display: inline-flex;
|
|
@@ -29,12 +18,17 @@
|
|
|
29
18
|
align-items: center;
|
|
30
19
|
justify-content: center;
|
|
31
20
|
white-space: nowrap;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
color: var(--bui-btn-color);
|
|
22
|
+
background: var(--bui-btn-bg);
|
|
23
|
+
font-size: var(--bui-btn-font-size);
|
|
24
|
+
font-weight: var(--bui-btn-font-weight);
|
|
25
|
+
border: var(--bui-btn-border);
|
|
26
|
+
border-radius: var(--bui-btn-border-radius);
|
|
27
|
+
height: var(--bui-btn-height);
|
|
28
|
+
padding: var(--bui-btn-padding);
|
|
36
29
|
line-height: var(--bui-line-height);
|
|
37
|
-
font-family: var(--bui-font-family);
|
|
30
|
+
font-family: var(--bui-btn-font-family);
|
|
31
|
+
opacity: var(--bui-btn-opacity);
|
|
38
32
|
}
|
|
39
33
|
@keyframes spin {
|
|
40
34
|
from {
|
|
@@ -68,36 +62,31 @@
|
|
|
68
62
|
display: inline-flex;
|
|
69
63
|
align-self: center;
|
|
70
64
|
flex-shrink: 0;
|
|
71
|
-
margin-right: var(--
|
|
65
|
+
margin-right: var(--bui-spacing-xs);
|
|
72
66
|
}
|
|
73
67
|
.bui-btn-icon-end {
|
|
74
68
|
display: inline-flex;
|
|
75
69
|
align-self: center;
|
|
76
70
|
flex-shrink: 0;
|
|
77
|
-
margin-left: var(--
|
|
71
|
+
margin-left: var(--bui-spacing-xs);
|
|
78
72
|
}
|
|
79
73
|
.bui-btn-disabled {
|
|
80
74
|
pointer-events: none;
|
|
81
|
-
opacity:
|
|
75
|
+
--bui-btn-opacity: 0.5;
|
|
82
76
|
}
|
|
83
77
|
.bui-btn-small {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
.bui-btn-medium {
|
|
89
|
-
padding: var(--medium-padding);
|
|
90
|
-
height: var(--height);
|
|
78
|
+
--bui-btn-height: 24px;
|
|
79
|
+
--bui-btn-font-size: var(--bui-text-size-4);
|
|
80
|
+
--bui-btn-padding: 0 11px;
|
|
91
81
|
}
|
|
92
82
|
.bui-btn-large {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
height: var(--large-height);
|
|
83
|
+
--bui-btn-height: 33px;
|
|
84
|
+
--bui-btn-font-size: var(--bui-text-size-2);
|
|
96
85
|
}
|
|
97
86
|
.bui-btn-full {
|
|
98
|
-
|
|
87
|
+
--bui-btn-height: 42px;
|
|
88
|
+
--bui-btn-font-size: var(--bui-title-size-4);
|
|
99
89
|
width: 100%;
|
|
100
|
-
height: var(--full-height);
|
|
101
90
|
}
|
|
102
91
|
.bui-btn-text.bui-btn-primary {
|
|
103
92
|
color: var(--bui-color-primary);
|
|
@@ -118,13 +107,13 @@
|
|
|
118
107
|
color: var(--bui-color-vip);
|
|
119
108
|
}
|
|
120
109
|
.bui-btn-contained {
|
|
121
|
-
|
|
110
|
+
--bui-btn-bg: var(--bui-color-neutral-5);
|
|
122
111
|
}
|
|
123
112
|
.bui-btn-contained.bui-btn-primary {
|
|
124
113
|
color: var(--bui-color-white);
|
|
125
114
|
background-image:
|
|
126
115
|
linear-gradient(
|
|
127
|
-
|
|
116
|
+
90deg,
|
|
128
117
|
var(--bui-color-primary-start) 0%,
|
|
129
118
|
var(--bui-color-primary-end) 100%);
|
|
130
119
|
}
|
|
@@ -132,7 +121,7 @@
|
|
|
132
121
|
color: var(--bui-color-white);
|
|
133
122
|
background-image:
|
|
134
123
|
linear-gradient(
|
|
135
|
-
|
|
124
|
+
90deg,
|
|
136
125
|
var(--bui-color-success-start) 0%,
|
|
137
126
|
var(--bui-color-success-end) 100%);
|
|
138
127
|
}
|
|
@@ -140,7 +129,7 @@
|
|
|
140
129
|
color: var(--bui-color-white);
|
|
141
130
|
background-image:
|
|
142
131
|
linear-gradient(
|
|
143
|
-
|
|
132
|
+
90deg,
|
|
144
133
|
var(--bui-color-info-start) 0%,
|
|
145
134
|
var(--bui-color-info-end) 100%);
|
|
146
135
|
}
|
|
@@ -148,7 +137,7 @@
|
|
|
148
137
|
color: var(--bui-color-white);
|
|
149
138
|
background-image:
|
|
150
139
|
linear-gradient(
|
|
151
|
-
|
|
140
|
+
90deg,
|
|
152
141
|
var(--bui-color-warning-start) 0%,
|
|
153
142
|
var(--bui-color-warning-end) 100%);
|
|
154
143
|
}
|
|
@@ -156,20 +145,20 @@
|
|
|
156
145
|
color: var(--bui-color-white);
|
|
157
146
|
background-image:
|
|
158
147
|
linear-gradient(
|
|
159
|
-
|
|
148
|
+
90deg,
|
|
160
149
|
var(--bui-color-danger-start) 0%,
|
|
161
150
|
var(--bui-color-danger-end) 100%);
|
|
162
151
|
}
|
|
163
152
|
.bui-btn-contained.bui-btn-vip {
|
|
164
|
-
color: #582331;
|
|
165
|
-
|
|
153
|
+
--bui-btn-color: #582331;
|
|
154
|
+
--bui-btn-bg:
|
|
166
155
|
linear-gradient(
|
|
167
156
|
90deg,
|
|
168
157
|
var(--bui-color-vip-start) 3%,
|
|
169
158
|
var(--bui-color-vip-end) 100%);
|
|
170
159
|
}
|
|
171
160
|
.bui-btn-outlined {
|
|
172
|
-
border: var(--
|
|
161
|
+
--bui-btn-border: 1px solid var(--bui-color-neutral-4);
|
|
173
162
|
}
|
|
174
163
|
.bui-btn-outlined.bui-btn-primary {
|
|
175
164
|
color: var(--bui-color-primary);
|
|
@@ -196,42 +185,35 @@
|
|
|
196
185
|
border-color: var(--bui-color-vip);
|
|
197
186
|
}
|
|
198
187
|
.bui-btn-light {
|
|
199
|
-
|
|
200
|
-
background-color: var(--bui-color-gray-light);
|
|
201
|
-
border: var(--light-border);
|
|
188
|
+
--bui-btn-bg: var(--bui-color-gray-light);
|
|
202
189
|
}
|
|
203
190
|
.bui-btn-light.bui-btn-warning {
|
|
204
191
|
background-image: none;
|
|
205
|
-
border: var(--light-border);
|
|
206
192
|
color: var(--bui-color-warning);
|
|
207
193
|
background-color: var(--bui-color-warning-light);
|
|
208
194
|
}
|
|
209
195
|
.bui-btn-light.bui-btn-primary {
|
|
210
196
|
background-image: none;
|
|
211
|
-
border: var(--light-border);
|
|
212
197
|
color: var(--bui-color-primary);
|
|
213
198
|
background-color: var(--bui-color-primary-light);
|
|
214
199
|
}
|
|
215
200
|
.bui-btn-light.bui-btn-info {
|
|
216
201
|
background-image: none;
|
|
217
|
-
border: var(--light-border);
|
|
218
202
|
color: var(--bui-color-info);
|
|
219
203
|
background-color: var(--bui-color-info-light);
|
|
220
204
|
}
|
|
221
205
|
.bui-btn-light.bui-btn-success {
|
|
222
206
|
background-image: none;
|
|
223
|
-
border: var(--light-border);
|
|
224
207
|
color: var(--bui-color-success);
|
|
225
208
|
background-color: var(--bui-color-success-light);
|
|
226
209
|
}
|
|
227
210
|
.bui-btn-light.bui-btn-danger {
|
|
228
211
|
background-image: none;
|
|
229
|
-
border: var(--light-border);
|
|
230
212
|
color: var(--bui-color-danger);
|
|
231
213
|
background-color: var(--bui-color-danger-light);
|
|
232
214
|
}
|
|
233
215
|
.bui-btn-light.bui-btn-vip {
|
|
234
|
-
color: var(--bui-color-vip);
|
|
235
216
|
position: relative;
|
|
236
|
-
|
|
217
|
+
--bui-btn-color: var(--bui-color-vip);
|
|
218
|
+
--bui-btn-bg: rgba(255, 134, 110, 0.3);
|
|
237
219
|
}
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
color: var(--bui-color-white);
|
|
115
115
|
background-image:
|
|
116
116
|
linear-gradient(
|
|
117
|
-
|
|
117
|
+
90deg,
|
|
118
118
|
var(--bui-color-primary-start) 0%,
|
|
119
119
|
var(--bui-color-primary-end) 100%);
|
|
120
120
|
}
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
color: var(--bui-color-white);
|
|
123
123
|
background-image:
|
|
124
124
|
linear-gradient(
|
|
125
|
-
|
|
125
|
+
90deg,
|
|
126
126
|
var(--bui-color-success-start) 0%,
|
|
127
127
|
var(--bui-color-success-end) 100%);
|
|
128
128
|
}
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
color: var(--bui-color-white);
|
|
131
131
|
background-image:
|
|
132
132
|
linear-gradient(
|
|
133
|
-
|
|
133
|
+
90deg,
|
|
134
134
|
var(--bui-color-info-start) 0%,
|
|
135
135
|
var(--bui-color-info-end) 100%);
|
|
136
136
|
}
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
color: var(--bui-color-white);
|
|
139
139
|
background-image:
|
|
140
140
|
linear-gradient(
|
|
141
|
-
|
|
141
|
+
90deg,
|
|
142
142
|
var(--bui-color-warning-start) 0%,
|
|
143
143
|
var(--bui-color-warning-end) 100%);
|
|
144
144
|
}
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
color: var(--bui-color-white);
|
|
147
147
|
background-image:
|
|
148
148
|
linear-gradient(
|
|
149
|
-
|
|
149
|
+
90deg,
|
|
150
150
|
var(--bui-color-danger-start) 0%,
|
|
151
151
|
var(--bui-color-danger-end) 100%);
|
|
152
152
|
}
|
|
@@ -50,7 +50,7 @@ export type InputProps<D extends React.ElementType = 'div', P = {}> = OverridePr
|
|
|
50
50
|
/**
|
|
51
51
|
* 点击清除图标的回调,非受控状态也会清除输入框内容
|
|
52
52
|
*/
|
|
53
|
-
onClear?: (e: React.
|
|
53
|
+
onClear?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
54
54
|
/**
|
|
55
55
|
* 输入框内容变化时的回调
|
|
56
56
|
*/
|
|
@@ -60,11 +60,11 @@ export type InputProps<D extends React.ElementType = 'div', P = {}> = OverridePr
|
|
|
60
60
|
/**
|
|
61
61
|
* 聚焦时的回调
|
|
62
62
|
*/
|
|
63
|
-
onFocus?: (e: React.
|
|
63
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
64
64
|
/**
|
|
65
65
|
* 失焦时的回调
|
|
66
66
|
*/
|
|
67
|
-
onBlur?: (e: React.
|
|
67
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
68
68
|
};
|
|
69
69
|
defaultComponent: D;
|
|
70
70
|
}, D>;
|
|
@@ -12,5 +12,5 @@ declare const Modal: React.ForwardRefExoticComponent<Omit<ViewProps & {
|
|
|
12
12
|
keepMounted?: boolean;
|
|
13
13
|
} & import("@bifrostui/types").ICommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
14
|
ref?: React.Ref<HTMLDivElement>;
|
|
15
|
-
}, keyof import("@bifrostui/types").ICommonProps | "
|
|
15
|
+
}, "open" | keyof import("@bifrostui/types").ICommonProps | "container" | "disablePortal" | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export default Modal;
|
package/es/Picker/Picker.js
CHANGED
|
@@ -161,7 +161,10 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
-
const handleSelect = (e, {
|
|
164
|
+
const handleSelect = (e, {
|
|
165
|
+
columnIndex,
|
|
166
|
+
columnOption
|
|
167
|
+
}) => {
|
|
165
168
|
updateItem(e, columnOption, columnIndex);
|
|
166
169
|
};
|
|
167
170
|
const handleClose = (e, data) => {
|
|
@@ -11,11 +11,17 @@ export interface IPickerOptionItem {
|
|
|
11
11
|
*/
|
|
12
12
|
value: string | number;
|
|
13
13
|
}
|
|
14
|
+
export type ICascadePickerChildOptionItem = IPickerOptionItem & {
|
|
15
|
+
/**
|
|
16
|
+
* 用于级联选项,子节点可能没有children属性
|
|
17
|
+
*/
|
|
18
|
+
children?: ICascadePickerChildOptionItem[];
|
|
19
|
+
};
|
|
14
20
|
export type ICascadePickerOptionItem = IPickerOptionItem & {
|
|
15
21
|
/**
|
|
16
|
-
*
|
|
22
|
+
* 用于级联选项,根节点必须含有children属性
|
|
17
23
|
*/
|
|
18
|
-
children
|
|
24
|
+
children: ICascadePickerChildOptionItem[];
|
|
19
25
|
};
|
|
20
26
|
export type PickerProps<D extends React.ElementType = 'div', P = DrawerProps> = OverrideProps<{
|
|
21
27
|
props: P & {
|
|
@@ -44,29 +50,29 @@ export type PickerProps<D extends React.ElementType = 'div', P = DrawerProps> =
|
|
|
44
50
|
/**
|
|
45
51
|
* 点击确认按钮时候回调
|
|
46
52
|
*/
|
|
47
|
-
onConfirm?: (e: React.
|
|
53
|
+
onConfirm?: (e: React.MouseEvent<HTMLDivElement>, data: {
|
|
48
54
|
value: (string | number)[];
|
|
49
|
-
options:
|
|
55
|
+
options: ICascadePickerChildOptionItem[][];
|
|
50
56
|
}) => void;
|
|
51
57
|
/**
|
|
52
58
|
* 选项值变更时的回调
|
|
53
59
|
*/
|
|
54
|
-
onOptionChange?: (e: React.
|
|
60
|
+
onOptionChange?: (e: React.TransitionEvent<HTMLDivElement>, data: {
|
|
55
61
|
value: (string | number)[];
|
|
56
|
-
options:
|
|
57
|
-
currentOption:
|
|
62
|
+
options: ICascadePickerChildOptionItem[][];
|
|
63
|
+
currentOption: ICascadePickerChildOptionItem;
|
|
58
64
|
}) => void;
|
|
59
65
|
/**
|
|
60
66
|
* 点击取消按钮时候回调
|
|
61
67
|
*/
|
|
62
|
-
onCancel?: (e: React.
|
|
68
|
+
onCancel?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
63
69
|
/**
|
|
64
70
|
* 关闭选择器时执行
|
|
65
71
|
*/
|
|
66
|
-
onClose?: (e: React.
|
|
72
|
+
onClose?: (e: React.MouseEvent<HTMLDivElement>, data: {
|
|
67
73
|
from: string;
|
|
68
74
|
value: (string | number)[];
|
|
69
|
-
options:
|
|
75
|
+
options: ICascadePickerChildOptionItem[][];
|
|
70
76
|
}) => void;
|
|
71
77
|
};
|
|
72
78
|
defaultComponent: D;
|
|
@@ -77,7 +83,7 @@ export type PickerPanelProps<D extends React.ElementType = 'div', P = {}> = Over
|
|
|
77
83
|
* 单列面板的列表数据
|
|
78
84
|
* @default []
|
|
79
85
|
*/
|
|
80
|
-
options?:
|
|
86
|
+
options?: ICascadePickerChildOptionItem[];
|
|
81
87
|
/**
|
|
82
88
|
* 默认值
|
|
83
89
|
*/
|
|
@@ -93,8 +99,8 @@ export type PickerPanelProps<D extends React.ElementType = 'div', P = {}> = Over
|
|
|
93
99
|
/**
|
|
94
100
|
* 选择选项时的回调
|
|
95
101
|
*/
|
|
96
|
-
onSelect?: (e: React.
|
|
97
|
-
columnOption:
|
|
102
|
+
onSelect?: (e: React.TransitionEvent<HTMLDivElement>, data: {
|
|
103
|
+
columnOption: ICascadePickerChildOptionItem;
|
|
98
104
|
columnIndex: number;
|
|
99
105
|
}) => void;
|
|
100
106
|
};
|
package/es/Picker/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICascadePickerOptionItem } from './Picker.types';
|
|
1
|
+
import { ICascadePickerOptionItem, ICascadePickerChildOptionItem } from './Picker.types';
|
|
2
2
|
/**
|
|
3
3
|
* 根据第一列数据判断选择器类型
|
|
4
4
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const pickerPanelType: (options?: any[]) => "multiple" | "single"
|
|
|
6
6
|
/**
|
|
7
7
|
* 格式化级联模式数据
|
|
8
8
|
*/
|
|
9
|
-
export declare const formatCascade: (columns: ICascadePickerOptionItem[], values?: (number | string)[]) =>
|
|
9
|
+
export declare const formatCascade: (columns: ICascadePickerOptionItem[], values?: (number | string)[]) => ICascadePickerChildOptionItem[][];
|
|
10
10
|
/**
|
|
11
11
|
* 统一options数据格式
|
|
12
12
|
*/
|
package/es/Popover/Popover.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.bui-popover {
|
|
2
2
|
--arrow-size: var(--bui-popover-arrow-size, 8PX);
|
|
3
|
-
--
|
|
3
|
+
--location-position: var(--bui-popover-location-position, 8PX);
|
|
4
4
|
--max-width: var(--bui-popover-max-width, 350px);
|
|
5
5
|
--content-min-width: var(--bui-popover-content-min-width, 30px);
|
|
6
6
|
--content-padding: var(--bui-popover-content-padding, 6px 8px);
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
position: absolute;
|
|
17
17
|
}
|
|
18
18
|
.bui-popover .bui-popover-arrow.location-left {
|
|
19
|
-
left: var(--
|
|
19
|
+
left: var(--location-position);
|
|
20
20
|
}
|
|
21
21
|
.bui-popover .bui-popover-arrow.location-right {
|
|
22
|
-
right: var(--
|
|
22
|
+
right: var(--location-position);
|
|
23
23
|
}
|
|
24
24
|
.bui-popover .bui-popover-arrow.location-top {
|
|
25
|
-
top: var(--
|
|
25
|
+
top: var(--location-position);
|
|
26
26
|
}
|
|
27
27
|
.bui-popover .bui-popover-arrow.location-bottom {
|
|
28
|
-
bottom: var(--
|
|
28
|
+
bottom: var(--location-position);
|
|
29
29
|
}
|
|
30
30
|
.bui-popover.popover-top .location-center,
|
|
31
31
|
.bui-popover.popover-bottom .location-center {
|
package/es/Radio/Radio.css
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
.bui-radio {
|
|
2
2
|
--label-color: var(--bui-radio-label-color, var(--bui-color-fg-default));
|
|
3
3
|
--label-font-size: var(--bui-radio-label-font-size, var(--bui-text-size-1));
|
|
4
|
-
--icon-font-size: var(--bui-radio-icon-font-size, var(--bui-title-size-2));
|
|
5
4
|
--icon-padding: var(--bui-radio-icon-padding, 5px);
|
|
6
5
|
display: inline-flex;
|
|
7
6
|
align-items: center;
|
package/es/Tabs/Tab.css
CHANGED
|
@@ -4,31 +4,31 @@
|
|
|
4
4
|
justify-content: center;
|
|
5
5
|
white-space: nowrap;
|
|
6
6
|
width: min-content;
|
|
7
|
-
height: var(--tab-height);
|
|
7
|
+
height: var(--bui-tab-height);
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
position: relative;
|
|
10
10
|
cursor: pointer;
|
|
11
|
-
font-size: var(--font-size);
|
|
11
|
+
font-size: var(--bui-tab-font-size);
|
|
12
12
|
line-height: var(--bui-line-height);
|
|
13
|
-
color: var(--color);
|
|
14
|
-
padding: var(--tab-padding);
|
|
13
|
+
color: var(--bui-tabs-color);
|
|
14
|
+
padding: var(--bui-tab-padding);
|
|
15
15
|
font-family: var(--bui-font-family);
|
|
16
16
|
}
|
|
17
17
|
.bui-tab-active {
|
|
18
|
-
font-size: var(--font-size);
|
|
18
|
+
font-size: var(--bui-tab-active-font-size);
|
|
19
19
|
line-height: var(--bui-line-height);
|
|
20
|
-
font-weight: var(--bui-font-weight
|
|
21
|
-
color: var(--active-color);
|
|
20
|
+
font-weight: var(--bui-tabs-active-font-weight);
|
|
21
|
+
color: var(--bui-tabs-active-color);
|
|
22
22
|
}
|
|
23
23
|
.bui-tab-center {
|
|
24
24
|
flex: 1 0 0;
|
|
25
25
|
margin: 0 auto;
|
|
26
26
|
}
|
|
27
27
|
.bui-tab-miniapp-active {
|
|
28
|
-
font-size: var(--font-size);
|
|
28
|
+
font-size: var(--bui-tab-font-size);
|
|
29
29
|
line-height: 1.5;
|
|
30
30
|
font-weight: var(--bui-font-weight-medium);
|
|
31
|
-
color: var(--active-color);
|
|
31
|
+
color: var(--bui-tabs-active-color);
|
|
32
32
|
position: relative;
|
|
33
33
|
}
|
|
34
34
|
.bui-tab-miniapp-active-line {
|