@nutui/nutui-react 2.3.8 → 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 +37 -4
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Animate/style/style.css +1 -1
- package/dist/esm/Audio/style/style.css +1 -1
- package/dist/esm/Avatar/style/style.css +1 -1
- package/dist/esm/AvatarCropper/style/style.css +1 -1
- package/dist/esm/AvatarGroup/style/style.css +1 -1
- package/dist/esm/Badge/style/style.css +1 -1
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +18 -3
- package/dist/esm/Button/style/style.css +1 -1
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/CalendarCard/style/style.css +1 -1
- package/dist/esm/Card/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cell/style/style.css +1 -1
- package/dist/esm/CellGroup/style/style.css +1 -1
- package/dist/esm/Checkbox/style/style.css +1 -1
- package/dist/esm/CheckboxGroup/style/style.css +1 -1
- package/dist/esm/CircleProgress/style/style.css +1 -1
- package/dist/esm/Col/style/style.css +1 -1
- package/dist/esm/Collapse/style/style.css +1 -1
- package/dist/esm/CollapseItem/style/style.css +1 -1
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Divider/style/style.css +1 -1
- package/dist/esm/Elevator/style/style.css +1 -1
- package/dist/esm/Empty/style/style.css +1 -1
- package/dist/esm/FixedNav/style/style.css +1 -1
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/Grid/style/style.css +1 -1
- package/dist/esm/GridItem/style/style.css +1 -1
- package/dist/esm/Image/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/Indicator/style/style.css +1 -1
- package/dist/esm/InfiniteLoading/style/style.css +1 -1
- package/dist/esm/InfiniteLoading.js +7 -6
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/NavBar/style/style.css +1 -1
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/Notify/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Overlay/style/style.css +1 -1
- package/dist/esm/Pagination/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/Price/style/style.css +1 -1
- package/dist/esm/Progress/style/style.css +1 -1
- package/dist/esm/PullToRefresh/style/style.css +1 -1
- package/dist/esm/Radio/style/style.css +1 -1
- package/dist/esm/Range/style/style.css +1 -1
- package/dist/esm/Rate/style/style.css +1 -1
- package/dist/esm/SearchBar/style/style.css +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +27 -8
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/Skeleton/style/style.css +1 -1
- package/dist/esm/Space/style/style.css +1 -1
- package/dist/esm/Step/style/style.css +1 -1
- package/dist/esm/Steps/style/style.css +1 -1
- package/dist/esm/Swipe/style/style.css +1 -1
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/Switch/style/style.css +1 -1
- package/dist/esm/Tabbar/style/style.css +1 -1
- package/dist/esm/TabbarItem/style/style.css +1 -1
- package/dist/esm/Table/style/style.css +1 -1
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/Tag/style/style.css +1 -1
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TextArea.js +1 -1
- package/dist/esm/TimeDetail/style/style.css +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/Toast/style/style.css +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/TrendArrow/style/style.css +1 -1
- package/dist/esm/Uploader/style/style.css +1 -1
- package/dist/esm/VirtualList/style/style.css +1 -1
- package/dist/esm/configprovider2.js +8 -4
- package/dist/esm/formitem2.js +39 -5
- package/dist/esm/popup2.js +2 -1
- package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -1
- package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +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/popover/popover.taro.d.ts +7 -0
- 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 +96 -24
- package/dist/nutui.react.umd.js +96 -24
- package/dist/packages/address/address.scss +12 -0
- package/dist/packages/animate/animate.scss +49 -0
- package/dist/packages/audio/audio.scss +14 -0
- package/dist/packages/avatar/avatar.scss +25 -0
- package/dist/packages/avatarcropper/avatarcropper.scss +52 -0
- package/dist/packages/avatargroup/avatargroup.scss +11 -0
- package/dist/packages/badge/badge.scss +8 -0
- package/dist/packages/barrage/barrage.scss +18 -1
- package/dist/packages/button/button.scss +18 -0
- package/dist/packages/calendar/calendar.scss +24 -0
- package/dist/packages/calendarcard/calendarcard.scss +41 -0
- package/dist/packages/card/card.scss +21 -0
- package/dist/packages/cascader/cascader.scss +8 -0
- package/dist/packages/cellgroup/cellgroup.scss +14 -0
- package/dist/packages/checkbox/checkbox.scss +38 -0
- package/dist/packages/checkboxgroup/checkboxgroup.scss +24 -8
- package/dist/packages/circleprogress/circleprogress.scss +8 -0
- package/dist/packages/col/col.scss +25 -0
- package/dist/packages/collapseitem/collapseitem.scss +15 -0
- package/dist/packages/dialog/dialog.scss +29 -0
- package/dist/packages/divider/divider.scss +22 -0
- package/dist/packages/elevator/elevator.scss +20 -0
- package/dist/packages/ellipsis/ellipsis.scss +1 -0
- package/dist/packages/empty/empty.scss +11 -0
- package/dist/packages/fixednav/fixednav.scss +75 -0
- package/dist/packages/form/form.scss +31 -0
- package/dist/packages/formitem/formitem.scss +15 -0
- package/dist/packages/grid/grid.scss +8 -0
- package/dist/packages/griditem/griditem.scss +37 -0
- package/dist/packages/image/image.scss +13 -0
- package/dist/packages/imagepreview/imagepreview.scss +26 -0
- package/dist/packages/indicator/indicator.scss +15 -0
- package/dist/packages/infiniteloading/infiniteloading.scss +13 -0
- package/dist/packages/loading/loading.scss +6 -0
- package/dist/packages/menu/menu.scss +9 -0
- package/dist/packages/menuitem/menuitem.scss +12 -0
- package/dist/packages/navbar/navbar.scss +61 -0
- package/dist/packages/noticebar/noticebar.scss +22 -0
- package/dist/packages/notify/notify.scss +10 -0
- package/dist/packages/numberkeyboard/numberkeyboard.scss +27 -0
- package/dist/packages/overlay/overlay.scss +6 -0
- package/dist/packages/pagination/pagination.scss +24 -0
- package/dist/packages/popover/popover.scss +105 -0
- package/dist/packages/popup/popup.scss +77 -0
- package/dist/packages/price/price.scss +19 -0
- package/dist/packages/progress/progress.scss +7 -0
- package/dist/packages/pulltorefresh/pulltorefresh.scss +10 -0
- package/dist/packages/radio/radio.scss +21 -0
- package/dist/packages/range/range.scss +65 -0
- package/dist/packages/rate/rate.scss +30 -0
- package/dist/packages/safearea/safearea.scss +2 -0
- package/dist/packages/searchbar/searchbar.scss +65 -0
- package/dist/packages/shortpassword/shortpassword.scss +25 -0
- package/dist/packages/sidenavbar/sidenavbar.scss +15 -0
- package/dist/packages/skeleton/skeleton.scss +22 -1
- package/dist/packages/space/space.scss +30 -0
- package/dist/packages/step/step.scss +45 -0
- package/dist/packages/swipe/swipe.scss +15 -0
- package/dist/packages/swiper/swiper.scss +14 -0
- package/dist/packages/switch/switch.scss +13 -0
- package/dist/packages/tabbar/tabbar.scss +13 -0
- package/dist/packages/tabbaritem/tabbaritem.scss +2 -0
- package/dist/packages/table/table.scss +57 -0
- package/dist/packages/tabs/tabs.scss +85 -14
- package/dist/packages/tag/tag.scss +8 -0
- package/dist/packages/textarea/textarea.scss +17 -0
- package/dist/packages/timedetail/timedetail.scss +5 -0
- package/dist/packages/timeselect/timeselect.scss +5 -0
- package/dist/packages/toast/toast.scss +15 -0
- package/dist/packages/tour/tour.scss +23 -0
- package/dist/packages/trendarrow/trendarrow.scss +13 -0
- package/dist/packages/uploader/uploader.scss +36 -0
- package/dist/packages/video/video.scss +3 -0
- package/dist/packages/virtuallist/virtuallist.scss +11 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/packages/backtop/backtop.d.ts +1 -1
- package/dist/types/packages/configprovider/configprovider.d.ts +2 -0
- package/dist/types/packages/configprovider/configprovider.taro.d.ts +2 -0
- package/dist/types/packages/configprovider/index.d.ts +1 -1
- package/dist/types/packages/configprovider/index.taro.d.ts +1 -1
- package/dist/types/packages/formitem/formitem.d.ts +14 -2
- package/dist/types/packages/formitem/formitem.taro.d.ts +6 -2
- package/dist/types/packages/popover/popover.taro.d.ts +7 -0
- 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/popup2.js
CHANGED
|
@@ -150,7 +150,8 @@ var Popup = function Popup2(props) {
|
|
|
150
150
|
return React__default.createElement(CSSTransition, {
|
|
151
151
|
nodeRef,
|
|
152
152
|
classNames: transitionName,
|
|
153
|
-
|
|
153
|
+
mountOnEnter: true,
|
|
154
|
+
unmountOnExit: destroyOnClose,
|
|
154
155
|
timeout: duration,
|
|
155
156
|
"in": innerVisible,
|
|
156
157
|
onEntered: onHandleOpened,
|
|
@@ -4,8 +4,10 @@ import { BaseLang } from '@/locales/base';
|
|
|
4
4
|
import type { NutCSSVariables } from './types';
|
|
5
5
|
export interface ConfigProviderProps extends BasicComponent {
|
|
6
6
|
locale: BaseLang;
|
|
7
|
+
direction?: Direction;
|
|
7
8
|
theme?: Record<string | NutCSSVariables, string>;
|
|
8
9
|
}
|
|
10
|
+
export type Direction = 'ltr' | 'rtl' | undefined;
|
|
9
11
|
export declare const defaultConfigRef: {
|
|
10
12
|
current: ConfigProviderProps;
|
|
11
13
|
};
|
|
@@ -4,8 +4,10 @@ import { BaseLang } from '@/locales/base';
|
|
|
4
4
|
import type { NutCSSVariables } from './types';
|
|
5
5
|
export interface ConfigProviderProps extends BasicComponent {
|
|
6
6
|
locale: BaseLang;
|
|
7
|
+
direction?: Direction;
|
|
7
8
|
theme?: Record<string | NutCSSVariables, string>;
|
|
8
9
|
}
|
|
10
|
+
export type Direction = 'ltr' | 'rtl' | undefined;
|
|
9
11
|
export declare const defaultConfigRef: {
|
|
10
12
|
current: ConfigProviderProps;
|
|
11
13
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigProvider, useConfig, setDefaultConfig, getDefaultConfig } from './configprovider';
|
|
2
|
-
export type { ConfigProviderProps } from './configprovider';
|
|
2
|
+
export type { ConfigProviderProps, Direction } from './configprovider';
|
|
3
3
|
export type { NutCSSVariables } from './types';
|
|
4
4
|
export { useConfig, setDefaultConfig, getDefaultConfig };
|
|
5
5
|
export default ConfigProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigProvider, useConfig, setDefaultConfig, getDefaultConfig } from './configprovider.taro';
|
|
2
|
-
export type { ConfigProviderProps } from './configprovider.taro';
|
|
2
|
+
export type { ConfigProviderProps, Direction } from './configprovider.taro';
|
|
3
3
|
export type { NutCSSVariables } from './types';
|
|
4
4
|
export { useConfig, setDefaultConfig, getDefaultConfig };
|
|
5
5
|
export default ConfigProvider;
|
|
@@ -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
|
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;
|
|
@@ -28,4 +28,11 @@ export interface PopoverProps extends PopupProps {
|
|
|
28
28
|
onClose: () => void;
|
|
29
29
|
onSelect: (item: List, index: number) => void;
|
|
30
30
|
}
|
|
31
|
+
export interface RootPosition {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
left: number;
|
|
35
|
+
top: number;
|
|
36
|
+
right: number;
|
|
37
|
+
}
|
|
31
38
|
export declare const Popover: FunctionComponent<Partial<PopoverProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'>>;
|
|
@@ -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
|
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>>;
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/tr-TR.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED
package/dist/nutui.react.es.js
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react v2.3.
|
|
8
|
+
* @nutui/nutui-react v2.3.10 Tue Feb 06 2024 16:12:46 GMT+0800 (China Standard Time)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
@@ -2379,7 +2379,8 @@ const zhCN = {
|
|
|
2379
2379
|
const classPrefix$p = "nut-configprovider";
|
|
2380
2380
|
const defaultConfigRef = {
|
|
2381
2381
|
current: {
|
|
2382
|
-
locale: zhCN
|
|
2382
|
+
locale: zhCN,
|
|
2383
|
+
direction: "ltr"
|
|
2383
2384
|
}
|
|
2384
2385
|
};
|
|
2385
2386
|
const getDefaultConfig = () => {
|
|
@@ -2397,7 +2398,7 @@ function convertThemeVarsToCSSVars(themeVars) {
|
|
|
2397
2398
|
return cssVars;
|
|
2398
2399
|
}
|
|
2399
2400
|
const ConfigProvider = (props) => {
|
|
2400
|
-
const { style, className, children, ...config2 } = props;
|
|
2401
|
+
const { style, className, children, direction, ...config2 } = props;
|
|
2401
2402
|
const mergedConfig = useMemo(
|
|
2402
2403
|
() => {
|
|
2403
2404
|
return {
|
|
@@ -2420,8 +2421,10 @@ const ConfigProvider = (props) => {
|
|
|
2420
2421
|
className: classNames(classPrefix$p, className),
|
|
2421
2422
|
style: {
|
|
2422
2423
|
...cssVarStyle,
|
|
2423
|
-
...style
|
|
2424
|
-
|
|
2424
|
+
...style,
|
|
2425
|
+
direction
|
|
2426
|
+
},
|
|
2427
|
+
dir: direction
|
|
2425
2428
|
},
|
|
2426
2429
|
children
|
|
2427
2430
|
));
|
|
@@ -10881,7 +10884,8 @@ const Popup = (props) => {
|
|
|
10881
10884
|
{
|
|
10882
10885
|
nodeRef,
|
|
10883
10886
|
classNames: transitionName,
|
|
10884
|
-
|
|
10887
|
+
mountOnEnter: true,
|
|
10888
|
+
unmountOnExit: destroyOnClose,
|
|
10885
10889
|
timeout: duration,
|
|
10886
10890
|
in: innerVisible,
|
|
10887
10891
|
onEntered: onHandleOpened,
|
|
@@ -15782,6 +15786,7 @@ class FormStore {
|
|
|
15782
15786
|
constructor() {
|
|
15783
15787
|
// 初始化数据
|
|
15784
15788
|
__publicField(this, "initialValues", {});
|
|
15789
|
+
__publicField(this, "updateList", []);
|
|
15785
15790
|
// 存放表单中所有的数据 eg. {password: "ddd",username: "123"}
|
|
15786
15791
|
__publicField(this, "store", {});
|
|
15787
15792
|
// 所有的组件实例
|
|
@@ -15851,6 +15856,15 @@ class FormStore {
|
|
|
15851
15856
|
}
|
|
15852
15857
|
});
|
|
15853
15858
|
});
|
|
15859
|
+
this.updateList.forEach((item) => {
|
|
15860
|
+
let shouldUpdate = item.condition;
|
|
15861
|
+
if (typeof item.condition === "function") {
|
|
15862
|
+
shouldUpdate = item.condition();
|
|
15863
|
+
}
|
|
15864
|
+
if (shouldUpdate) {
|
|
15865
|
+
item.entity.onStoreChange("update");
|
|
15866
|
+
}
|
|
15867
|
+
});
|
|
15854
15868
|
});
|
|
15855
15869
|
__publicField(this, "setCallback", (callback) => {
|
|
15856
15870
|
this.callbacks = {
|
|
@@ -15916,6 +15930,16 @@ class FormStore {
|
|
|
15916
15930
|
entity.onStoreChange("reset");
|
|
15917
15931
|
});
|
|
15918
15932
|
});
|
|
15933
|
+
// 监听事件
|
|
15934
|
+
__publicField(this, "registerUpdate", (field, shouldUpdate) => {
|
|
15935
|
+
this.updateList.push({
|
|
15936
|
+
entity: field,
|
|
15937
|
+
condition: shouldUpdate
|
|
15938
|
+
});
|
|
15939
|
+
return () => {
|
|
15940
|
+
this.updateList = this.updateList.filter((i) => i.entity !== field);
|
|
15941
|
+
};
|
|
15942
|
+
});
|
|
15919
15943
|
__publicField(this, "dispatch", ({ name }) => {
|
|
15920
15944
|
this.validateFields([name]);
|
|
15921
15945
|
});
|
|
@@ -15927,7 +15951,8 @@ class FormStore {
|
|
|
15927
15951
|
setInitialValues: this.setInitialValues,
|
|
15928
15952
|
dispatch: this.dispatch,
|
|
15929
15953
|
store: this.store,
|
|
15930
|
-
fieldEntities: this.fieldEntities
|
|
15954
|
+
fieldEntities: this.fieldEntities,
|
|
15955
|
+
registerUpdate: this.registerUpdate
|
|
15931
15956
|
};
|
|
15932
15957
|
}
|
|
15933
15958
|
});
|
|
@@ -16058,13 +16083,16 @@ const defaultProps$W = {
|
|
|
16058
16083
|
label: "",
|
|
16059
16084
|
rules: [{ required: false, message: "" }],
|
|
16060
16085
|
errorMessageAlign: "left",
|
|
16061
|
-
validateTrigger: "onChange"
|
|
16086
|
+
validateTrigger: "onChange",
|
|
16087
|
+
shouldUpdate: false,
|
|
16088
|
+
noStyle: false
|
|
16062
16089
|
};
|
|
16063
16090
|
class FormItem extends React__default.Component {
|
|
16064
16091
|
constructor(props) {
|
|
16065
16092
|
super(props);
|
|
16066
16093
|
__publicField(this, "cancelRegister");
|
|
16067
16094
|
__publicField(this, "componentRef");
|
|
16095
|
+
__publicField(this, "eventOff");
|
|
16068
16096
|
// children添加value属性和onChange事件
|
|
16069
16097
|
__publicField(this, "getControlled", (children) => {
|
|
16070
16098
|
var _a2;
|
|
@@ -16179,22 +16207,31 @@ class FormItem extends React__default.Component {
|
|
|
16179
16207
|
};
|
|
16180
16208
|
}
|
|
16181
16209
|
componentDidMount() {
|
|
16182
|
-
const { registerField } = this.context.getInternal(SECRET);
|
|
16210
|
+
const { registerField, registerUpdate } = this.context.getInternal(SECRET);
|
|
16183
16211
|
this.cancelRegister = registerField(this);
|
|
16212
|
+
this.eventOff = registerUpdate(this, this.props.shouldUpdate);
|
|
16184
16213
|
}
|
|
16185
16214
|
componentWillUnmount() {
|
|
16186
16215
|
if (this.cancelRegister) {
|
|
16187
16216
|
this.cancelRegister();
|
|
16188
16217
|
}
|
|
16218
|
+
if (this.eventOff) {
|
|
16219
|
+
this.eventOff();
|
|
16220
|
+
}
|
|
16189
16221
|
}
|
|
16190
16222
|
render() {
|
|
16191
16223
|
const { children } = this.props;
|
|
16192
16224
|
const child = Array.isArray(children) ? children[0] : children;
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16225
|
+
let returnChildNode;
|
|
16226
|
+
if (!this.props.shouldUpdate) {
|
|
16227
|
+
returnChildNode = React__default.cloneElement(
|
|
16228
|
+
child,
|
|
16229
|
+
this.getControlled(child)
|
|
16230
|
+
);
|
|
16231
|
+
} else {
|
|
16232
|
+
returnChildNode = child(this.context);
|
|
16233
|
+
}
|
|
16234
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: this.state.resetCount }, this.props.noStyle ? returnChildNode : this.renderLayout(returnChildNode));
|
|
16198
16235
|
}
|
|
16199
16236
|
}
|
|
16200
16237
|
__publicField(FormItem, "defaultProps", defaultProps$W);
|
|
@@ -18105,13 +18142,13 @@ const defaultProps$L = {
|
|
|
18105
18142
|
// 1~6
|
|
18106
18143
|
autoFocus: false
|
|
18107
18144
|
};
|
|
18108
|
-
const
|
|
18145
|
+
const InternalShortPassword = (props, ref) => {
|
|
18109
18146
|
const { locale } = useConfig();
|
|
18110
18147
|
const {
|
|
18111
18148
|
title,
|
|
18112
18149
|
description,
|
|
18113
18150
|
tips,
|
|
18114
|
-
visible,
|
|
18151
|
+
visible: deleteVisible,
|
|
18115
18152
|
value,
|
|
18116
18153
|
error,
|
|
18117
18154
|
hideFooter,
|
|
@@ -18142,6 +18179,24 @@ const ShortPassword = (props) => {
|
|
|
18142
18179
|
const format2 = (val) => {
|
|
18143
18180
|
return val.slice(0, comLen);
|
|
18144
18181
|
};
|
|
18182
|
+
const [visible, setVisible] = usePropsValue({
|
|
18183
|
+
value: props.visible,
|
|
18184
|
+
defaultValue: false,
|
|
18185
|
+
finalValue: false
|
|
18186
|
+
});
|
|
18187
|
+
const handleClose = () => {
|
|
18188
|
+
onClose == null ? void 0 : onClose();
|
|
18189
|
+
setVisible(false);
|
|
18190
|
+
};
|
|
18191
|
+
const actions = {
|
|
18192
|
+
open: () => {
|
|
18193
|
+
setVisible(true);
|
|
18194
|
+
},
|
|
18195
|
+
close: () => {
|
|
18196
|
+
setVisible(false);
|
|
18197
|
+
}
|
|
18198
|
+
};
|
|
18199
|
+
useImperativeHandle(ref, () => actions);
|
|
18145
18200
|
const [inputValue, setInputValue] = usePropsValue({ value, onChange });
|
|
18146
18201
|
useEffect(() => {
|
|
18147
18202
|
if (visible && autoFocus) {
|
|
@@ -18168,8 +18223,8 @@ const ShortPassword = (props) => {
|
|
|
18168
18223
|
},
|
|
18169
18224
|
visible,
|
|
18170
18225
|
closeable: true,
|
|
18171
|
-
onOverlayClick:
|
|
18172
|
-
onCloseIconClick:
|
|
18226
|
+
onOverlayClick: handleClose,
|
|
18227
|
+
onCloseIconClick: handleClose,
|
|
18173
18228
|
...rest
|
|
18174
18229
|
},
|
|
18175
18230
|
/* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className), style }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-title` }, title || locale.shortpassword.title), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-description` }, description || locale.shortpassword.description), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-input`, onClick: onFocus }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-input-site` }), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-input-fake` }, [...new Array(comLen).keys()].map((item, index) => {
|
|
@@ -18177,8 +18232,7 @@ const ShortPassword = (props) => {
|
|
|
18177
18232
|
}))), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-message` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-message-error` }, error), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-message-forget`, onClick: onTips }, tips || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(s, { width: 11, height: 11, style: { marginRight: "3px" } }), locale.shortpassword.tips))), !hideFooter && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer-cancel`, onClick: onCancel }, locale.cancel), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer-sure`, onClick: sure }, locale.confirm)))
|
|
18178
18233
|
);
|
|
18179
18234
|
};
|
|
18180
|
-
ShortPassword
|
|
18181
|
-
ShortPassword.displayName = "NutShortPassword";
|
|
18235
|
+
const ShortPassword = React__default.forwardRef(InternalShortPassword);
|
|
18182
18236
|
const defaultProps$K = {
|
|
18183
18237
|
...ComponentDefaults,
|
|
18184
18238
|
type: "png",
|
|
@@ -18387,7 +18441,7 @@ const TextArea = (props) => {
|
|
|
18387
18441
|
const textareaRef = useRef(null);
|
|
18388
18442
|
const compositionRef = useRef(false);
|
|
18389
18443
|
const format2 = (value2) => {
|
|
18390
|
-
if (maxLength !==
|
|
18444
|
+
if (maxLength !== -1 && value2.length > maxLength) {
|
|
18391
18445
|
return value2.substring(0, maxLength);
|
|
18392
18446
|
}
|
|
18393
18447
|
return value2;
|
|
@@ -19826,6 +19880,7 @@ const InfiniteLoading = (props) => {
|
|
|
19826
19880
|
if (distance.current < refreshMaxH.current) {
|
|
19827
19881
|
distance.current = 0;
|
|
19828
19882
|
getRefreshTop().style.height = `${distance.current}px`;
|
|
19883
|
+
isTouching.current = false;
|
|
19829
19884
|
} else {
|
|
19830
19885
|
await (onRefresh == null ? void 0 : onRefresh());
|
|
19831
19886
|
refreshDone();
|
|
@@ -24482,6 +24537,8 @@ const InternalBarrage = (props, ref) => {
|
|
|
24482
24537
|
const barrageCWidth = useRef(0);
|
|
24483
24538
|
const timer = useRef(0);
|
|
24484
24539
|
const index = useRef(0);
|
|
24540
|
+
const times = useRef([]);
|
|
24541
|
+
const historyIndex = useRef(-1);
|
|
24485
24542
|
const classes = classNames(classPrefix$1, className);
|
|
24486
24543
|
useImperativeHandle(ref, () => ({
|
|
24487
24544
|
add: (word) => {
|
|
@@ -24512,9 +24569,15 @@ const InternalBarrage = (props, ref) => {
|
|
|
24512
24569
|
}, [list]);
|
|
24513
24570
|
const run = () => {
|
|
24514
24571
|
clearInterval(timer.current);
|
|
24572
|
+
let intervalCache = interval;
|
|
24573
|
+
const _index = (loop2 ? index.current % list.length : index.current) % rows;
|
|
24574
|
+
const result = times.current[_index] - rows * interval;
|
|
24575
|
+
if (result > 0) {
|
|
24576
|
+
intervalCache += result;
|
|
24577
|
+
}
|
|
24515
24578
|
timer.current = window.setTimeout(() => {
|
|
24516
24579
|
play();
|
|
24517
|
-
},
|
|
24580
|
+
}, intervalCache);
|
|
24518
24581
|
};
|
|
24519
24582
|
const play = () => {
|
|
24520
24583
|
if (!loop2 && index.current >= list.length) {
|
|
@@ -24522,14 +24585,23 @@ const InternalBarrage = (props, ref) => {
|
|
|
24522
24585
|
}
|
|
24523
24586
|
const _index = loop2 ? index.current % list.length : index.current;
|
|
24524
24587
|
const el = document.createElement(`div`);
|
|
24588
|
+
let currentIndex = _index % rows;
|
|
24589
|
+
if (currentIndex <= historyIndex.current || historyIndex.current === 3 && currentIndex !== 0 || Math.abs(currentIndex - historyIndex.current) !== 1) {
|
|
24590
|
+
currentIndex = historyIndex.current + 1 >= rows ? 0 : historyIndex.current + 1;
|
|
24591
|
+
}
|
|
24592
|
+
historyIndex.current = currentIndex;
|
|
24525
24593
|
el.innerHTML = list[_index];
|
|
24526
24594
|
el.classList.add("barrage-item");
|
|
24527
24595
|
barrageContainer.current.appendChild(el);
|
|
24528
24596
|
const width = el.offsetWidth;
|
|
24529
24597
|
const height = el.offsetHeight;
|
|
24530
24598
|
el.classList.add("move");
|
|
24531
|
-
|
|
24532
|
-
|
|
24599
|
+
const elScrollDuration = Math.ceil(
|
|
24600
|
+
width / barrageCWidth.current * duration
|
|
24601
|
+
);
|
|
24602
|
+
times.current[currentIndex] = elScrollDuration;
|
|
24603
|
+
el.style.animationDuration = `${duration + elScrollDuration}ms`;
|
|
24604
|
+
el.style.top = `${currentIndex * (height + gapY) + 20}px`;
|
|
24533
24605
|
el.style.width = `${width}px`;
|
|
24534
24606
|
el.addEventListener("animationend", () => {
|
|
24535
24607
|
barrageContainer.current.removeChild(el);
|