@bifrostui/react 2.0.0-alpha.26 → 2.0.0-alpha.28
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/CSSTransition/demo/CSSTransitionDemo.js +3 -0
- package/dist/CSSTransition/demo/index.css +0 -3
- package/dist/Dialog/Dialog.types.d.ts +6 -2
- package/dist/Tabs/Tabs.css +1 -0
- package/dist/Tabs/index.css +1 -0
- package/dist/Tabs/miniapp/Tabs.js +1 -2
- package/dist/Toast/FunctionalToast.js +2 -3
- package/dist/Toast/index.css +7 -5
- package/es/CSSTransition/demo/CSSTransitionDemo.js +3 -0
- package/es/CSSTransition/demo/index.css +0 -3
- package/es/Dialog/Dialog.types.d.ts +6 -2
- package/es/Tabs/Tabs.css +1 -0
- package/es/Tabs/index.css +1 -0
- package/es/Tabs/miniapp/Tabs.js +1 -2
- package/es/Toast/FunctionalToast.js +3 -4
- package/es/Toast/index.css +7 -5
- package/package.json +5 -5
|
@@ -33,11 +33,11 @@ export interface DialogProps extends Omit<ModalProps, 'title' | 'content'> {
|
|
|
33
33
|
/**
|
|
34
34
|
* 透传给内部Button组件的属性
|
|
35
35
|
*/
|
|
36
|
-
okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`,
|
|
36
|
+
okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
|
|
37
37
|
/**
|
|
38
38
|
* 透传给内部Button组件的属性
|
|
39
39
|
*/
|
|
40
|
-
cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`,
|
|
40
|
+
cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
|
|
41
41
|
/**
|
|
42
42
|
* 确认按钮文本内容
|
|
43
43
|
*/
|
|
@@ -80,6 +80,10 @@ export type DialogOptions = Omit<DialogProps, 'placeholder' | 'inputProps' | 'on
|
|
|
80
80
|
* 取消回调
|
|
81
81
|
*/
|
|
82
82
|
onCancel?: (e: React.SyntheticEvent) => void;
|
|
83
|
+
/**
|
|
84
|
+
* 透传 data- 属性
|
|
85
|
+
*/
|
|
86
|
+
[key: `data-${string}`]: any;
|
|
83
87
|
};
|
|
84
88
|
/**
|
|
85
89
|
* prompt函数式调用配置参数
|
package/dist/Tabs/Tabs.css
CHANGED
package/dist/Tabs/index.css
CHANGED
|
@@ -232,8 +232,7 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
232
232
|
onScroll: handleScroll,
|
|
233
233
|
enhanced: true,
|
|
234
234
|
showScrollbar: false,
|
|
235
|
-
enablePassive: true
|
|
236
|
-
enableFlex: true
|
|
235
|
+
enablePassive: true
|
|
237
236
|
},
|
|
238
237
|
/* @__PURE__ */ import_react.default.createElement("div", { id: wrapperId, className: import_classes.tabsScrollWrapperClass }, /* @__PURE__ */ import_react.default.createElement(
|
|
239
238
|
import_TabIndicator.default,
|
|
@@ -86,8 +86,7 @@ const Toast = (props) => {
|
|
|
86
86
|
};
|
|
87
87
|
const _a = options, { container } = _a, restOptions = __objRest(_a, ["container"]);
|
|
88
88
|
const rootWrapper = document.createElement("div");
|
|
89
|
-
|
|
90
|
-
rootElement == null ? void 0 : rootElement.appendChild(rootWrapper);
|
|
89
|
+
document.body.appendChild(rootWrapper);
|
|
91
90
|
const ToastComponent = () => {
|
|
92
91
|
const _a2 = restOptions, { duration, multiple, onClose, onExited } = _a2, others = __objRest(_a2, ["duration", "multiple", "onClose", "onExited"]);
|
|
93
92
|
const [open, setOpen] = (0, import_react.useState)(true);
|
|
@@ -125,7 +124,7 @@ const Toast = (props) => {
|
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
126
|
instance.close = close;
|
|
128
|
-
return /* @__PURE__ */ import_react.default.createElement(import_Toast.default, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited }));
|
|
127
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { container }, /* @__PURE__ */ import_react.default.createElement(import_Toast.default, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited })));
|
|
129
128
|
};
|
|
130
129
|
(0, import_utils.render)(/* @__PURE__ */ import_react.default.createElement(ToastComponent, null), rootWrapper);
|
|
131
130
|
return instance;
|
package/dist/Toast/index.css
CHANGED
|
@@ -15,10 +15,13 @@ xhs-page {
|
|
|
15
15
|
}
|
|
16
16
|
.bui-toast {
|
|
17
17
|
position: fixed;
|
|
18
|
-
left:
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
margin: 0 auto;
|
|
19
21
|
z-index: var(--bui-z-index-toast);
|
|
20
22
|
min-width: var(--bui-toast-min-width);
|
|
21
23
|
max-width: var(--bui-toast-max-width);
|
|
24
|
+
width: fit-content;
|
|
22
25
|
padding: var(--bui-toast-padding);
|
|
23
26
|
font-size: var(--bui-text-size-1);
|
|
24
27
|
color: var(--bui-color-white);
|
|
@@ -31,20 +34,19 @@ xhs-page {
|
|
|
31
34
|
}
|
|
32
35
|
.bui-toast.bui-toast-allow-click {
|
|
33
36
|
position: fixed;
|
|
34
|
-
right: unset;
|
|
35
37
|
bottom: unset;
|
|
36
38
|
}
|
|
37
39
|
.bui-toast-center {
|
|
38
40
|
top: 50%;
|
|
39
|
-
transform:
|
|
41
|
+
transform: translateY(-50%);
|
|
40
42
|
}
|
|
41
43
|
.bui-toast-top {
|
|
42
44
|
top: var(--bui-toast-position-top);
|
|
43
|
-
transform:
|
|
45
|
+
transform: translateY(calc(-1 * var(--bui-toast-position-top)));
|
|
44
46
|
}
|
|
45
47
|
.bui-toast-bottom {
|
|
46
48
|
top: var(--bui-toast-position-bottom);
|
|
47
|
-
transform:
|
|
49
|
+
transform: translateY(calc(-1 * var(--bui-toast-position-bottom)));
|
|
48
50
|
}
|
|
49
51
|
.bui-toast-icon {
|
|
50
52
|
display: flex;
|
|
@@ -33,11 +33,11 @@ export interface DialogProps extends Omit<ModalProps, 'title' | 'content'> {
|
|
|
33
33
|
/**
|
|
34
34
|
* 透传给内部Button组件的属性
|
|
35
35
|
*/
|
|
36
|
-
okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`,
|
|
36
|
+
okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
|
|
37
37
|
/**
|
|
38
38
|
* 透传给内部Button组件的属性
|
|
39
39
|
*/
|
|
40
|
-
cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`,
|
|
40
|
+
cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
|
|
41
41
|
/**
|
|
42
42
|
* 确认按钮文本内容
|
|
43
43
|
*/
|
|
@@ -80,6 +80,10 @@ export type DialogOptions = Omit<DialogProps, 'placeholder' | 'inputProps' | 'on
|
|
|
80
80
|
* 取消回调
|
|
81
81
|
*/
|
|
82
82
|
onCancel?: (e: React.SyntheticEvent) => void;
|
|
83
|
+
/**
|
|
84
|
+
* 透传 data- 属性
|
|
85
|
+
*/
|
|
86
|
+
[key: `data-${string}`]: any;
|
|
83
87
|
};
|
|
84
88
|
/**
|
|
85
89
|
* prompt函数式调用配置参数
|
package/es/Tabs/Tabs.css
CHANGED
package/es/Tabs/index.css
CHANGED
package/es/Tabs/miniapp/Tabs.js
CHANGED
|
@@ -207,8 +207,7 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
207
207
|
onScroll: handleScroll,
|
|
208
208
|
enhanced: true,
|
|
209
209
|
showScrollbar: false,
|
|
210
|
-
enablePassive: true
|
|
211
|
-
enableFlex: true
|
|
210
|
+
enablePassive: true
|
|
212
211
|
},
|
|
213
212
|
/* @__PURE__ */ React.createElement("div", { id: wrapperId, className: tabsScrollWrapperClass }, /* @__PURE__ */ React.createElement(
|
|
214
213
|
TabIndicator,
|
|
@@ -35,7 +35,7 @@ import React, {
|
|
|
35
35
|
useState,
|
|
36
36
|
useRef
|
|
37
37
|
} from "react";
|
|
38
|
-
import { render, unmount
|
|
38
|
+
import { render, unmount } from "@bifrostui/utils";
|
|
39
39
|
import Portal from "../Portal";
|
|
40
40
|
import ToastView from "./Toast";
|
|
41
41
|
const defaultProps = {
|
|
@@ -61,8 +61,7 @@ const Toast = (props) => {
|
|
|
61
61
|
};
|
|
62
62
|
const _a = options, { container } = _a, restOptions = __objRest(_a, ["container"]);
|
|
63
63
|
const rootWrapper = document.createElement("div");
|
|
64
|
-
|
|
65
|
-
rootElement == null ? void 0 : rootElement.appendChild(rootWrapper);
|
|
64
|
+
document.body.appendChild(rootWrapper);
|
|
66
65
|
const ToastComponent = () => {
|
|
67
66
|
const _a2 = restOptions, { duration, multiple, onClose, onExited } = _a2, others = __objRest(_a2, ["duration", "multiple", "onClose", "onExited"]);
|
|
68
67
|
const [open, setOpen] = useState(true);
|
|
@@ -100,7 +99,7 @@ const Toast = (props) => {
|
|
|
100
99
|
}
|
|
101
100
|
};
|
|
102
101
|
instance.close = close;
|
|
103
|
-
return /* @__PURE__ */ React.createElement(ToastView, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited }));
|
|
102
|
+
return /* @__PURE__ */ React.createElement(Portal, { container }, /* @__PURE__ */ React.createElement(ToastView, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited })));
|
|
104
103
|
};
|
|
105
104
|
render(/* @__PURE__ */ React.createElement(ToastComponent, null), rootWrapper);
|
|
106
105
|
return instance;
|
package/es/Toast/index.css
CHANGED
|
@@ -15,10 +15,13 @@ xhs-page {
|
|
|
15
15
|
}
|
|
16
16
|
.bui-toast {
|
|
17
17
|
position: fixed;
|
|
18
|
-
left:
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
margin: 0 auto;
|
|
19
21
|
z-index: var(--bui-z-index-toast);
|
|
20
22
|
min-width: var(--bui-toast-min-width);
|
|
21
23
|
max-width: var(--bui-toast-max-width);
|
|
24
|
+
width: fit-content;
|
|
22
25
|
padding: var(--bui-toast-padding);
|
|
23
26
|
font-size: var(--bui-text-size-1);
|
|
24
27
|
color: var(--bui-color-white);
|
|
@@ -31,20 +34,19 @@ xhs-page {
|
|
|
31
34
|
}
|
|
32
35
|
.bui-toast.bui-toast-allow-click {
|
|
33
36
|
position: fixed;
|
|
34
|
-
right: unset;
|
|
35
37
|
bottom: unset;
|
|
36
38
|
}
|
|
37
39
|
.bui-toast-center {
|
|
38
40
|
top: 50%;
|
|
39
|
-
transform:
|
|
41
|
+
transform: translateY(-50%);
|
|
40
42
|
}
|
|
41
43
|
.bui-toast-top {
|
|
42
44
|
top: var(--bui-toast-position-top);
|
|
43
|
-
transform:
|
|
45
|
+
transform: translateY(calc(-1 * var(--bui-toast-position-top)));
|
|
44
46
|
}
|
|
45
47
|
.bui-toast-bottom {
|
|
46
48
|
top: var(--bui-toast-position-bottom);
|
|
47
|
-
transform:
|
|
49
|
+
transform: translateY(calc(-1 * var(--bui-toast-position-bottom)));
|
|
48
50
|
}
|
|
49
51
|
.bui-toast-icon {
|
|
50
52
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bifrostui/react",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.28",
|
|
4
4
|
"description": "React components for building mobile application",
|
|
5
5
|
"homepage": "http://bui.taopiaopiao.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"dayjs": "^1.11.7",
|
|
45
45
|
"swiper": "^8.1.5",
|
|
46
|
-
"@bifrostui/icons": "2.0.0-alpha.
|
|
47
|
-
"@bifrostui/styles": "2.0.0-alpha.
|
|
48
|
-
"@bifrostui/types": "2.0.0-alpha.
|
|
49
|
-
"@bifrostui/utils": "2.0.0-alpha.
|
|
46
|
+
"@bifrostui/icons": "2.0.0-alpha.28",
|
|
47
|
+
"@bifrostui/styles": "2.0.0-alpha.28",
|
|
48
|
+
"@bifrostui/types": "2.0.0-alpha.28",
|
|
49
|
+
"@bifrostui/utils": "2.0.0-alpha.28"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@tarojs/components": "^3.0.0",
|