@bifrostui/react 2.0.0-alpha.27 → 2.0.0-alpha.29
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/Calendar/Calendar.js +5 -1
- package/dist/DatePicker/DatePicker.d.ts +1 -1
- package/dist/Dialog/Dialog.types.d.ts +6 -2
- package/dist/Dialog/index.css +1 -0
- package/dist/Modal/Modal.miniapp.d.ts +1 -1
- package/dist/Radio/index.css +1 -0
- package/dist/Swiper/Swiper.js +2 -0
- package/dist/Tabs/Tabs.js +3 -1
- package/dist/Tabs/miniapp/Tabs.js +1 -1
- 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/Calendar/Calendar.js +5 -1
- package/es/DatePicker/DatePicker.d.ts +1 -1
- package/es/Dialog/Dialog.types.d.ts +6 -2
- package/es/Dialog/index.css +1 -0
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/Radio/index.css +1 -0
- package/es/Swiper/Swiper.js +2 -0
- package/es/Tabs/Tabs.js +3 -1
- package/es/Tabs/miniapp/Tabs.js +1 -1
- package/es/Toast/index.css +7 -5
- package/package.json +5 -5
|
@@ -177,7 +177,11 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
177
177
|
if (!(0, import_utils2.isEqualVal)(prevValueRef.current, value)) {
|
|
178
178
|
const latestDate = formattedValue == null ? void 0 : formattedValue[0];
|
|
179
179
|
const lastInitialValue = renderMonth;
|
|
180
|
-
|
|
180
|
+
if (!latestDate) {
|
|
181
|
+
prevValueRef.current = value;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const inSameMonth = isRangeMode ? selectedStartDate && (0, import_dayjs.default)(selectedStartDate).isSame(lastInitialValue, "month") || selectedEndDate && (0, import_dayjs.default)(selectedEndDate).isSame(lastInitialValue, "month") : latestDate && (0, import_dayjs.default)(latestDate).isSame(lastInitialValue, "month");
|
|
181
185
|
if (!inSameMonth) {
|
|
182
186
|
const latestBeforeThanLast = (0, import_dayjs.default)(latestDate).isBefore(
|
|
183
187
|
lastInitialValue,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DatePickerProps } from './DatePicker.types';
|
|
3
|
-
declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "defaultValue" | "
|
|
3
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "defaultValue" | "onChange" | "value" | "onClose" | "onConfirm">>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default DatePicker;
|
|
@@ -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/Dialog/index.css
CHANGED
|
@@ -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 | "open" | "container" | "
|
|
15
|
+
}, keyof import("@bifrostui/types").ICommonProps | "open" | "container" | "disablePortal" | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export default Modal;
|
package/dist/Radio/index.css
CHANGED
package/dist/Swiper/Swiper.js
CHANGED
|
@@ -174,7 +174,9 @@ const Swiper = (0, import_react.forwardRef)((props, ref) => {
|
|
|
174
174
|
spaceBetween
|
|
175
175
|
}, others), {
|
|
176
176
|
onSwiper: (o) => {
|
|
177
|
+
var _a2;
|
|
177
178
|
swiperInstance.current = o;
|
|
179
|
+
(_a2 = props.onSwiper) == null ? void 0 : _a2.call(props, o);
|
|
178
180
|
},
|
|
179
181
|
style: __spreadProps(__spreadValues({}, sty), {
|
|
180
182
|
"--indicator-color": defaultIndicatorColor,
|
package/dist/Tabs/Tabs.js
CHANGED
|
@@ -153,7 +153,9 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
153
153
|
if (!tabsEl)
|
|
154
154
|
return void 0;
|
|
155
155
|
const checkScrollable = () => {
|
|
156
|
-
|
|
156
|
+
const { scrollWidth = 0, offsetWidth = 0 } = tabsEl;
|
|
157
|
+
const isOverflow = scrollWidth - offsetWidth > 1;
|
|
158
|
+
setIsScrollable(isOverflow);
|
|
157
159
|
};
|
|
158
160
|
checkScrollable();
|
|
159
161
|
if (typeof ResizeObserver === "undefined") {
|
|
@@ -100,7 +100,7 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
100
100
|
const lastScrollLeftRef = import_react.default.useRef(0);
|
|
101
101
|
const isFirstScroll = import_react.default.useRef(true);
|
|
102
102
|
const [scrollWithAnimation, setScrollWithAnimation] = import_react.default.useState(false);
|
|
103
|
-
const isScrollable = scrollWidth >
|
|
103
|
+
const isScrollable = scrollWidth - containerWidth > 1;
|
|
104
104
|
if (process.env.NODE_ENV !== "production") {
|
|
105
105
|
if (tabs.length > 0 && import_react.default.Children.count(children) > 0) {
|
|
106
106
|
console.warn(
|
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;
|
package/es/Calendar/Calendar.js
CHANGED
|
@@ -147,7 +147,11 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
147
147
|
if (!isEqualVal(prevValueRef.current, value)) {
|
|
148
148
|
const latestDate = formattedValue == null ? void 0 : formattedValue[0];
|
|
149
149
|
const lastInitialValue = renderMonth;
|
|
150
|
-
|
|
150
|
+
if (!latestDate) {
|
|
151
|
+
prevValueRef.current = value;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const inSameMonth = isRangeMode ? selectedStartDate && dayjs(selectedStartDate).isSame(lastInitialValue, "month") || selectedEndDate && dayjs(selectedEndDate).isSame(lastInitialValue, "month") : latestDate && dayjs(latestDate).isSame(lastInitialValue, "month");
|
|
151
155
|
if (!inSameMonth) {
|
|
152
156
|
const latestBeforeThanLast = dayjs(latestDate).isBefore(
|
|
153
157
|
lastInitialValue,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DatePickerProps } from './DatePicker.types';
|
|
3
|
-
declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "
|
|
3
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "value" | "defaultValue" | "onChange" | "onClose" | "onConfirm">>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default DatePicker;
|
|
@@ -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/Dialog/index.css
CHANGED
|
@@ -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
|
-
}, "open" | "container" |
|
|
15
|
+
}, "open" | "container" | keyof import("@bifrostui/types").ICommonProps | "disablePortal" | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export default Modal;
|
package/es/Radio/index.css
CHANGED
package/es/Swiper/Swiper.js
CHANGED
|
@@ -148,7 +148,9 @@ const Swiper = forwardRef((props, ref) => {
|
|
|
148
148
|
spaceBetween
|
|
149
149
|
}, others), {
|
|
150
150
|
onSwiper: (o) => {
|
|
151
|
+
var _a2;
|
|
151
152
|
swiperInstance.current = o;
|
|
153
|
+
(_a2 = props.onSwiper) == null ? void 0 : _a2.call(props, o);
|
|
152
154
|
},
|
|
153
155
|
style: __spreadProps(__spreadValues({}, sty), {
|
|
154
156
|
"--indicator-color": defaultIndicatorColor,
|
package/es/Tabs/Tabs.js
CHANGED
|
@@ -123,7 +123,9 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
123
123
|
if (!tabsEl)
|
|
124
124
|
return void 0;
|
|
125
125
|
const checkScrollable = () => {
|
|
126
|
-
|
|
126
|
+
const { scrollWidth = 0, offsetWidth = 0 } = tabsEl;
|
|
127
|
+
const isOverflow = scrollWidth - offsetWidth > 1;
|
|
128
|
+
setIsScrollable(isOverflow);
|
|
127
129
|
};
|
|
128
130
|
checkScrollable();
|
|
129
131
|
if (typeof ResizeObserver === "undefined") {
|
package/es/Tabs/miniapp/Tabs.js
CHANGED
|
@@ -75,7 +75,7 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
75
75
|
const lastScrollLeftRef = React.useRef(0);
|
|
76
76
|
const isFirstScroll = React.useRef(true);
|
|
77
77
|
const [scrollWithAnimation, setScrollWithAnimation] = React.useState(false);
|
|
78
|
-
const isScrollable = scrollWidth >
|
|
78
|
+
const isScrollable = scrollWidth - containerWidth > 1;
|
|
79
79
|
if (process.env.NODE_ENV !== "production") {
|
|
80
80
|
if (tabs.length > 0 && React.Children.count(children) > 0) {
|
|
81
81
|
console.warn(
|
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.29",
|
|
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/
|
|
47
|
-
"@bifrostui/
|
|
48
|
-
"@bifrostui/types": "2.0.0-alpha.
|
|
49
|
-
"@bifrostui/utils": "2.0.0-alpha.
|
|
46
|
+
"@bifrostui/icons": "2.0.0-alpha.29",
|
|
47
|
+
"@bifrostui/styles": "2.0.0-alpha.29",
|
|
48
|
+
"@bifrostui/types": "2.0.0-alpha.29",
|
|
49
|
+
"@bifrostui/utils": "2.0.0-alpha.29"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@tarojs/components": "^3.0.0",
|