@nutui/nutui-react-taro 2.3.9 → 2.3.10
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/CHANGELOG.md +13 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +4 -2
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cascader.js +2 -2
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/Form.js +1 -1
- package/dist/esm/FormItem.js +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +1 -1
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/Sticky.js +1 -1
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/{address.taro-B54ZOtmo.js → address.taro-zQuxQEce.js} +1 -1
- package/dist/esm/barrage.taro-6nbq7wtt.js +118 -0
- package/dist/esm/{cascader.taro-BxyK5ybo.js → cascader.taro-M2nZWxiB.js} +1 -1
- package/dist/esm/{formitem.taro-atY4A0pS.js → formitem.taro-PPkTQGfW.js} +39 -10
- package/dist/esm/nutui-react.es.js +7 -7
- package/dist/esm/{shortpassword.taro-bZCwIpEn.js → shortpassword.taro-ECs_E1Xn.js} +18 -5
- package/dist/esm/{sticky.taro-MmKUU2Wv.js → sticky.taro-p-evMNR-.js} +1 -1
- package/dist/esm/{tabs.taro-w8ra49Qb.js → tabs.taro-Yj7vgtSg.js} +1 -1
- package/dist/esm/types/src/packages/formitem/formitem.d.ts +6 -2
- package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +6 -2
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/types.d.ts +4 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +141 -80
- package/dist/nutui.react.umd.js +141 -80
- package/dist/packages/barrage/barrage.scss +1 -1
- package/dist/packages/popup/popup.scss +1 -0
- package/dist/packages/tabs/tabs.scss +14 -14
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/packages/formitem/formitem.d.ts +6 -2
- package/dist/types/packages/formitem/formitem.taro.d.ts +14 -2
- package/dist/types/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/types/packages/shortpassword/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/esm/barrage.taro-HsivAhbE.js +0 -91
package/dist/style.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseFormField } from './types';
|
|
3
3
|
import { Context } from '../form/context';
|
|
4
4
|
import { BasicComponent } from '../../utils/typings';
|
|
5
5
|
type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'match-parent';
|
|
6
|
-
export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
6
|
+
export interface FormItemProps extends Omit<BasicComponent, 'children'>, BaseFormField {
|
|
7
7
|
required: boolean;
|
|
8
8
|
initialValue: any;
|
|
9
9
|
trigger: string;
|
|
@@ -12,6 +12,9 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
|
12
12
|
onClick: (event: React.MouseEvent, componentRef: React.MutableRefObject<any>) => void;
|
|
13
13
|
errorMessageAlign: TextAlign;
|
|
14
14
|
validateTrigger: string | string[];
|
|
15
|
+
shouldUpdate: boolean;
|
|
16
|
+
noStyle: boolean;
|
|
17
|
+
children: ReactNode | ((obj: any) => React.ReactNode);
|
|
15
18
|
}
|
|
16
19
|
export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
17
20
|
resetCount: number;
|
|
@@ -21,6 +24,7 @@ export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
|
21
24
|
context: React.ContextType<typeof Context>;
|
|
22
25
|
private cancelRegister;
|
|
23
26
|
private componentRef;
|
|
27
|
+
private eventOff;
|
|
24
28
|
constructor(props: FormItemProps);
|
|
25
29
|
componentDidMount(): void;
|
|
26
30
|
componentWillUnmount(): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseFormField } from './types';
|
|
3
3
|
import { Context } from '../form/context';
|
|
4
4
|
import { BasicComponent } from '../../utils/typings';
|
|
5
5
|
type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'match-parent';
|
|
6
|
-
export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
6
|
+
export interface FormItemProps extends Omit<BasicComponent, 'children'>, BaseFormField {
|
|
7
7
|
/**
|
|
8
8
|
* 必填表单项 label 的红色星标,仅用于控制样式
|
|
9
9
|
* @default false
|
|
@@ -44,6 +44,17 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
|
44
44
|
* @default onChange
|
|
45
45
|
*/
|
|
46
46
|
validateTrigger: string | string[]
|
|
47
|
+
/**
|
|
48
|
+
* 更新逻辑
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
shouldUpdate: boolean
|
|
52
|
+
/**
|
|
53
|
+
* 不使用样式,只使用字段管理
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
noStyle: boolean
|
|
57
|
+
children: ReactNode | ((obj: any) => React.ReactNode);
|
|
47
58
|
}
|
|
48
59
|
export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
49
60
|
resetCount: number;
|
|
@@ -53,6 +64,7 @@ export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
|
53
64
|
context: React.ContextType<typeof Context>;
|
|
54
65
|
private cancelRegister;
|
|
55
66
|
private componentRef;
|
|
67
|
+
private eventOff;
|
|
56
68
|
constructor(props: FormItemProps);
|
|
57
69
|
componentDidMount(): void;
|
|
58
70
|
componentWillUnmount(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ForwardRefRenderFunction, ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../../packages/popup/index';
|
|
3
3
|
export interface ShortPasswordProps extends PopupProps {
|
|
4
4
|
value: string;
|
|
@@ -19,4 +19,5 @@ export interface ShortPasswordProps extends PopupProps {
|
|
|
19
19
|
onTips: () => void;
|
|
20
20
|
onComplete: (value: string) => void;
|
|
21
21
|
}
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const InternalShortPassword: ForwardRefRenderFunction<unknown, Partial<ShortPasswordProps>>;
|
|
23
|
+
export declare const ShortPassword: React.ForwardRefExoticComponent<Partial<ShortPasswordProps> & React.RefAttributes<unknown>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ForwardRefRenderFunction, ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../../packages/popup/popup.taro';
|
|
3
3
|
export interface ShortPasswordProps extends PopupProps {
|
|
4
4
|
/**
|
|
@@ -87,4 +87,5 @@ export interface ShortPasswordProps extends PopupProps {
|
|
|
87
87
|
*/
|
|
88
88
|
onComplete: (value: string) => void
|
|
89
89
|
}
|
|
90
|
-
export declare const
|
|
90
|
+
export declare const InternalShortPassword: ForwardRefRenderFunction<unknown, Partial<ShortPasswordProps>>;
|
|
91
|
+
export declare const ShortPassword: React.ForwardRefExoticComponent<Partial<ShortPasswordProps> & React.RefAttributes<unknown>>;
|
package/package.json
CHANGED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React__default, { useState, useRef, useImperativeHandle, useEffect } from "react";
|
|
2
|
-
import { createSelectorQuery } from "@tarojs/taro";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
5
|
-
const defaultProps = {
|
|
6
|
-
...ComponentDefaults,
|
|
7
|
-
list: [],
|
|
8
|
-
interval: 500,
|
|
9
|
-
loop: true,
|
|
10
|
-
duration: 3e3,
|
|
11
|
-
rows: 3,
|
|
12
|
-
gapY: 10
|
|
13
|
-
};
|
|
14
|
-
const classPrefix = `nut-barrage`;
|
|
15
|
-
const InternalBarrage = (props, ref) => {
|
|
16
|
-
const { className, interval, loop, list, duration, rows, gapY, ...restProps } = {
|
|
17
|
-
...defaultProps,
|
|
18
|
-
...props
|
|
19
|
-
};
|
|
20
|
-
const [styleList, setStyleList] = useState([]);
|
|
21
|
-
const [baItemList, setBaItemList] = useState(list);
|
|
22
|
-
const barrageListSet = useRef(list);
|
|
23
|
-
const barrageBody = useRef(null);
|
|
24
|
-
const barrageContainer = useRef(null);
|
|
25
|
-
const timeId = useRef((/* @__PURE__ */ new Date()).getTime());
|
|
26
|
-
const timer = useRef(0);
|
|
27
|
-
const classes = classNames(classPrefix, {
|
|
28
|
-
[`${classPrefix}-body${timeId.current}`]: true
|
|
29
|
-
}, className);
|
|
30
|
-
useImperativeHandle(ref, () => ({
|
|
31
|
-
add: (word) => {
|
|
32
|
-
barrageListSet.current = [...barrageListSet.current, word];
|
|
33
|
-
run();
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
barrageListSet.current = [...list];
|
|
38
|
-
run();
|
|
39
|
-
return () => {
|
|
40
|
-
clearInterval(timer.current);
|
|
41
|
-
};
|
|
42
|
-
}, [list]);
|
|
43
|
-
const run = () => {
|
|
44
|
-
setBaItemList(barrageListSet.current);
|
|
45
|
-
barrageListSet.current.forEach((item, index) => {
|
|
46
|
-
getNode(index);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
const getNode = (index) => {
|
|
50
|
-
const query = createSelectorQuery();
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
let width = 100;
|
|
53
|
-
query.select(`.${classPrefix}-body${timeId.current}`).boundingClientRect((rec) => {
|
|
54
|
-
width = rec.width || 300;
|
|
55
|
-
});
|
|
56
|
-
query.select(`.${classPrefix}-item${index}`).boundingClientRect((recs) => {
|
|
57
|
-
const height = recs.height;
|
|
58
|
-
const nodeTop = `${index % rows * (height + gapY) + 20}px`;
|
|
59
|
-
styleInfo(index, nodeTop, width);
|
|
60
|
-
}).exec();
|
|
61
|
-
}, 500);
|
|
62
|
-
};
|
|
63
|
-
const styleInfo = (index, nodeTop, width) => {
|
|
64
|
-
const timeIndex = index - rows > 0 ? index - rows : 0;
|
|
65
|
-
const list2 = styleList;
|
|
66
|
-
const time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
|
|
67
|
-
const obj = {
|
|
68
|
-
top: nodeTop,
|
|
69
|
-
"--time": `${interval * index + time}`,
|
|
70
|
-
animationDuration: `${duration}ms`,
|
|
71
|
-
animationIterationCount: `${loop ? "infinite" : 1}`,
|
|
72
|
-
animationDelay: `${interval * index + time}ms`,
|
|
73
|
-
"--move-distance": `-${width}px`
|
|
74
|
-
};
|
|
75
|
-
list2.push(obj);
|
|
76
|
-
setStyleList([...list2]);
|
|
77
|
-
};
|
|
78
|
-
return React__default.createElement(
|
|
79
|
-
"div",
|
|
80
|
-
{ className: classes, ref: barrageBody, ...restProps },
|
|
81
|
-
React__default.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index) => {
|
|
82
|
-
return React__default.createElement("div", { className: `barrage-item ${classPrefix}-item${index} move`, style: styleList[index], key: index }, item.length > 8 ? `${item.substr(0, 8)}...` : item);
|
|
83
|
-
}))
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
const Barrage = React__default.forwardRef(InternalBarrage);
|
|
87
|
-
Barrage.defaultProps = defaultProps;
|
|
88
|
-
Barrage.displayName = "NutBarrage";
|
|
89
|
-
export {
|
|
90
|
-
Barrage as B
|
|
91
|
-
};
|