@nutui/nutui-react-taro 2.0.15 → 2.0.16
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/Address.js +2 -2
- package/dist/esm/Cascader.js +1 -1
- package/dist/esm/Cell.js +2 -2
- package/dist/esm/CellGroup.js +1 -1
- package/dist/esm/Dialog.js +2 -2
- package/dist/esm/Form.js +1274 -8
- package/dist/esm/FormItem.js +3 -3
- package/dist/esm/Notify.js +2 -2
- package/dist/esm/PullToRefresh.js +1 -1
- package/dist/esm/Swipe.js +2 -1
- package/dist/esm/Toast.js +2 -2
- package/dist/esm/{address.taro-b58603a5.js → address.taro-6d420871.js} +1 -1
- package/dist/esm/{cascader.taro-ec5179d6.js → cascader.taro-01ffbfb1.js} +1 -0
- package/dist/esm/cell.taro-010b73ed.js +55 -0
- package/dist/esm/{cellgroup.taro-d2fad5e7.js → cellgroup.taro-9dc59f11.js} +9 -3
- package/dist/esm/{dialog.taro-a1309ced.js → dialog.taro-1426fb49.js} +4 -4
- package/dist/esm/{formitem.taro-9e2d3898.js → formitem.taro-bb63ac0a.js} +1 -1
- package/dist/esm/{notify.taro-07e9ead7.js → notify.taro-6798c31f.js} +1 -1
- package/dist/esm/nutui-react.es.js +18 -18
- package/dist/esm/{pulltorefresh.taro-f3ab76c2.js → pulltorefresh.taro-d35571e8.js} +6 -4
- package/dist/esm/{swipe.taro-36f8782e.js → swipe.taro-2fa2479c.js} +4 -3
- package/dist/esm/{toast.taro-a907b5f5.js → toast.taro-44ebc833.js} +1 -1
- package/dist/esm/types/src/packages/cellgroup/context.d.ts +5 -0
- package/dist/esm/types/src/packages/dialog/config.d.ts +2 -1
- package/dist/esm/types/src/packages/dialog/content.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/form/form.d.ts +4 -8
- package/dist/esm/types/src/packages/form/form.taro.d.ts +4 -8
- package/dist/esm/types/src/packages/form/index.d.ts +11 -2
- package/dist/esm/types/src/packages/form/index.taro.d.ts +11 -2
- package/dist/esm/types/src/packages/form/types.d.ts +1 -0
- package/dist/esm/types/src/packages/swipe/swipe.taro.d.ts +5 -4
- package/dist/esm/types/src/utils/use-custom-event.d.ts +1 -1
- package/dist/esm/{use-custom-event-e1689884.js → use-custom-event-bb9c7f2e.js} +1 -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 +125 -101
- package/dist/nutui.react.umd.js +125 -101
- package/dist/style.mjs +1 -1
- package/dist/types/packages/cellgroup/context.d.ts +4 -0
- package/dist/types/packages/dialog/config.d.ts +2 -1
- package/dist/types/packages/dialog/content.taro.d.ts +2 -1
- package/dist/types/packages/form/form.taro.d.ts +4 -8
- package/dist/types/packages/form/index.taro.d.ts +11 -2
- package/dist/types/packages/form/types.d.ts +1 -0
- package/dist/types/packages/swipe/swipe.taro.d.ts +5 -4
- package/dist/types/utils/use-custom-event.d.ts +1 -1
- package/package.json +1 -1
- package/dist/esm/cell.taro-0a9f80bc.js +0 -50
- package/dist/esm/form.taro-6166be06.js +0 -1273
package/dist/esm/FormItem.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { F as FormItem } from "./formitem.taro-
|
|
1
|
+
import { F as FormItem } from "./formitem.taro-bb63ac0a.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import "./cell.taro-
|
|
3
|
+
import "./cell.taro-010b73ed.js";
|
|
4
4
|
import "classnames";
|
|
5
5
|
import "./typings-11d83a22.js";
|
|
6
|
-
import "./cellgroup.taro-
|
|
6
|
+
import "./cellgroup.taro-9dc59f11.js";
|
|
7
7
|
export {
|
|
8
8
|
FormItem as default
|
|
9
9
|
};
|
package/dist/esm/Notify.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { N as Notify } from "./notify.taro-
|
|
1
|
+
import { N as Notify } from "./notify.taro-6798c31f.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "classnames";
|
|
4
4
|
import "react-transition-group";
|
|
5
5
|
import "./typings-11d83a22.js";
|
|
6
|
-
import "./use-custom-event-
|
|
6
|
+
import "./use-custom-event-bb9c7f2e.js";
|
|
7
7
|
import "./index-21e61675.js";
|
|
8
8
|
import "@tarojs/taro";
|
|
9
9
|
import "./use-force-update-9cd7c164.js";
|
package/dist/esm/Swipe.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { S as Swipe } from "./swipe.taro-
|
|
1
|
+
import { S as Swipe } from "./swipe.taro-2fa2479c.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "classnames";
|
|
4
|
+
import "@tarojs/components";
|
|
4
5
|
import "@tarojs/taro";
|
|
5
6
|
import "./use-touch-ff43512c.js";
|
|
6
7
|
import "./use-client-rect-2bb6c562.js";
|
package/dist/esm/Toast.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Toast } from "./toast.taro-
|
|
1
|
+
import { T as Toast } from "./toast.taro-44ebc833.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "classnames";
|
|
4
4
|
import "@nutui/icons-react-taro";
|
|
@@ -6,7 +6,7 @@ import "./overlay.taro-626840fc.js";
|
|
|
6
6
|
import "react-transition-group";
|
|
7
7
|
import "@tarojs/components";
|
|
8
8
|
import "./typings-11d83a22.js";
|
|
9
|
-
import "./use-custom-event-
|
|
9
|
+
import "./use-custom-event-bb9c7f2e.js";
|
|
10
10
|
import "./index-21e61675.js";
|
|
11
11
|
import "@tarojs/taro";
|
|
12
12
|
import "./use-force-update-9cd7c164.js";
|
|
@@ -2,7 +2,7 @@ import React__default, { forwardRef, useState, useImperativeHandle } from "react
|
|
|
2
2
|
import { Check, Location2, Left } from "@nutui/icons-react-taro";
|
|
3
3
|
import { P as Popup } from "./popup.taro-487eb86e.js";
|
|
4
4
|
import { u as useConfig } from "./configprovider.taro-c5ff4877.js";
|
|
5
|
-
import { C as Cascader } from "./cascader.taro-
|
|
5
|
+
import { C as Cascader } from "./cascader.taro-01ffbfb1.js";
|
|
6
6
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
7
7
|
import { u as usePropsValue } from "./use-props-value-c78cbf9b.js";
|
|
8
8
|
const defaultProps$2 = {
|
|
@@ -78,6 +78,7 @@ class Tree {
|
|
|
78
78
|
constructor(nodes, config) {
|
|
79
79
|
__publicField(this, "nodes");
|
|
80
80
|
__publicField(this, "config");
|
|
81
|
+
// eslint-disable-next-line class-methods-use-this
|
|
81
82
|
__publicField(this, "isLeaf", (node, lazy) => {
|
|
82
83
|
const { leaf, children } = node;
|
|
83
84
|
const hasChildren = Array.isArray(children) && Boolean(children.length);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React__default, { useContext } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
4
|
+
import { a as CellGroupContext, C as CellGroup } from "./cellgroup.taro-9dc59f11.js";
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
...ComponentDefaults,
|
|
7
|
+
title: null,
|
|
8
|
+
description: null,
|
|
9
|
+
extra: null,
|
|
10
|
+
radius: "6px",
|
|
11
|
+
align: "flex-start",
|
|
12
|
+
onClick: (event) => {
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const classPrefix = "nut-cell";
|
|
16
|
+
const Cell = (props) => {
|
|
17
|
+
const ctx = useContext(CellGroupContext);
|
|
18
|
+
const { children, onClick, title, description, extra, radius, align, className, style, ...rest } = {
|
|
19
|
+
...defaultProps,
|
|
20
|
+
...props
|
|
21
|
+
};
|
|
22
|
+
const handleClick = (event) => {
|
|
23
|
+
onClick(event);
|
|
24
|
+
};
|
|
25
|
+
const baseStyle = {
|
|
26
|
+
...style,
|
|
27
|
+
borderRadius: Number.isNaN(Number(radius)) ? String(radius) : `${radius}px`,
|
|
28
|
+
alignItems: align
|
|
29
|
+
};
|
|
30
|
+
const styles = title || description ? {} : {
|
|
31
|
+
flex: 1
|
|
32
|
+
};
|
|
33
|
+
return React__default.createElement(
|
|
34
|
+
"div",
|
|
35
|
+
{ className: classNames(classPrefix, className), onClick: (event) => handleClick(event), style: baseStyle, ...rest },
|
|
36
|
+
children || React__default.createElement(
|
|
37
|
+
React__default.Fragment,
|
|
38
|
+
null,
|
|
39
|
+
title || description ? React__default.createElement(
|
|
40
|
+
"div",
|
|
41
|
+
{ className: `${classPrefix}__left` },
|
|
42
|
+
title ? React__default.createElement("div", { className: `${classPrefix}__title` }, title) : null,
|
|
43
|
+
description ? React__default.createElement("div", { className: `${classPrefix}__description` }, description) : null
|
|
44
|
+
) : null,
|
|
45
|
+
extra ? React__default.createElement("div", { className: `${classPrefix}__extra`, style: styles }, extra) : null
|
|
46
|
+
),
|
|
47
|
+
(ctx == null ? void 0 : ctx.divider) ? React__default.createElement("div", { className: `${classPrefix}__divider` }) : null
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
Cell.defaultProps = defaultProps;
|
|
51
|
+
Cell.displayName = "NutCell";
|
|
52
|
+
Cell.Group = CellGroup;
|
|
53
|
+
export {
|
|
54
|
+
Cell as C
|
|
55
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React__default from "react";
|
|
1
|
+
import React__default, { createContext } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
4
|
+
const CellGroupContext = createContext(null);
|
|
4
5
|
const defaultProps = {
|
|
5
6
|
...ComponentDefaults,
|
|
6
7
|
title: "",
|
|
@@ -18,11 +19,16 @@ const CellGroup = (props) => {
|
|
|
18
19
|
{ className: classNames(classPrefix, className), ...rest },
|
|
19
20
|
title ? React__default.createElement("div", { className: `${classPrefix}__title` }, title) : null,
|
|
20
21
|
description ? React__default.createElement("div", { className: `${classPrefix}__description` }, description) : null,
|
|
21
|
-
React__default.createElement(
|
|
22
|
+
React__default.createElement(
|
|
23
|
+
"div",
|
|
24
|
+
{ className: `${classPrefix}__wrap ${divider ? `${classPrefix}__wrap--divider` : ""}` },
|
|
25
|
+
React__default.createElement(CellGroupContext.Provider, { value: { divider } }, children)
|
|
26
|
+
)
|
|
22
27
|
);
|
|
23
28
|
};
|
|
24
29
|
CellGroup.defaultProps = defaultProps;
|
|
25
30
|
CellGroup.displayName = "NutCellGroup";
|
|
26
31
|
export {
|
|
27
|
-
CellGroup as C
|
|
32
|
+
CellGroup as C,
|
|
33
|
+
CellGroupContext as a
|
|
28
34
|
};
|
|
@@ -5,7 +5,7 @@ import { View } from "@tarojs/components";
|
|
|
5
5
|
import { B as Button } from "./button.taro-25f559e1.js";
|
|
6
6
|
import { u as useConfig } from "./configprovider.taro-c5ff4877.js";
|
|
7
7
|
import { O as Overlay } from "./overlay.taro-626840fc.js";
|
|
8
|
-
import { u as useParams, a as useCustomEvent, b as useCustomEventsPath, c as customEvents } from "./use-custom-event-
|
|
8
|
+
import { u as useParams, a as useCustomEvent, b as useCustomEventsPath, c as customEvents } from "./use-custom-event-bb9c7f2e.js";
|
|
9
9
|
const Content = (props) => {
|
|
10
10
|
const { visible, title, footer, footerDirection, onClick, children } = props;
|
|
11
11
|
const classPrefix = "nut-dialog";
|
|
@@ -22,7 +22,7 @@ const Content = (props) => {
|
|
|
22
22
|
};
|
|
23
23
|
return React__default.createElement(
|
|
24
24
|
"div",
|
|
25
|
-
{ className: `${classPrefix}__outer`, onClick: (e) => handleClick(e) },
|
|
25
|
+
{ className: classNames(`${classPrefix}__outer`, props.className), style: props.style, onClick: (e) => handleClick(e) },
|
|
26
26
|
React__default.createElement(
|
|
27
27
|
"div",
|
|
28
28
|
{ className: classPrefix, style: { display: visible ? "flex" : "none" } },
|
|
@@ -57,7 +57,7 @@ const defaultProps = {
|
|
|
57
57
|
const BaseDialog = (props) => {
|
|
58
58
|
const classPrefix = "nut-dialog";
|
|
59
59
|
const { locale } = useConfig();
|
|
60
|
-
const { params: { id, visible, footer, title, content, children, footerDirection, hideConfirmButton, hideCancelButton, lockScroll, disableConfirmButton, closeOnOverlayClick, onOverlayClick, confirmText, cancelText, overlay, onClose, onCancel, onConfirm, beforeCancel, beforeClose }, setParams } = useParams({ ...defaultProps, ...props });
|
|
60
|
+
const { params: { id, className, style, visible, footer, title, content, children, footerDirection, hideConfirmButton, hideCancelButton, lockScroll, disableConfirmButton, closeOnOverlayClick, onOverlayClick, confirmText, cancelText, overlay, onClose, onCancel, onConfirm, beforeCancel, beforeClose }, setParams } = useParams({ ...defaultProps, ...props });
|
|
61
61
|
useCustomEvent(id, ({ status, options }) => {
|
|
62
62
|
if (status) {
|
|
63
63
|
setParams({ ...options, visible: true });
|
|
@@ -108,7 +108,7 @@ const BaseDialog = (props) => {
|
|
|
108
108
|
React__default.createElement(
|
|
109
109
|
CSSTransition,
|
|
110
110
|
{ in: visible, timeout: 300, classNames: "fadeDialog", unmountOnExit: true, appear: true },
|
|
111
|
-
React__default.createElement(Content, { title, footer: renderFooter(), footerDirection, visible }, content || children)
|
|
111
|
+
React__default.createElement(Content, { className, style, title, footer: renderFooter(), footerDirection, visible }, content || children)
|
|
112
112
|
)
|
|
113
113
|
)
|
|
114
114
|
);
|
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
import React__default, { createContext } from "react";
|
|
8
|
-
import { C as Cell } from "./cell.taro-
|
|
8
|
+
import { C as Cell } from "./cell.taro-010b73ed.js";
|
|
9
9
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
10
10
|
const Context = createContext({});
|
|
11
11
|
function isForwardRefComponent(component) {
|
|
@@ -2,7 +2,7 @@ import React__default, { useState, useEffect } from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { CSSTransition } from "react-transition-group";
|
|
4
4
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
5
|
-
import { a as useCustomEvent, b as useCustomEventsPath, c as customEvents } from "./use-custom-event-
|
|
5
|
+
import { a as useCustomEvent, b as useCustomEventsPath, c as customEvents } from "./use-custom-event-bb9c7f2e.js";
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
...ComponentDefaults,
|
|
8
8
|
id: "",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B } from "./button.taro-25f559e1.js";
|
|
2
|
-
import { C } from "./cell.taro-
|
|
3
|
-
import { C as C2 } from "./cellgroup.taro-
|
|
2
|
+
import { C } from "./cell.taro-010b73ed.js";
|
|
3
|
+
import { C as C2 } from "./cellgroup.taro-9dc59f11.js";
|
|
4
4
|
import { C as C3 } from "./configprovider.taro-c5ff4877.js";
|
|
5
5
|
import { I } from "./image.taro-a7ad2272.js";
|
|
6
6
|
import { O } from "./overlay.taro-626840fc.js";
|
|
@@ -23,14 +23,14 @@ import { T } from "./tabbar.taro-4397646a.js";
|
|
|
23
23
|
import { T as T2 } from "./tabbaritem.taro-1d27af28.js";
|
|
24
24
|
import { T as T3 } from "./tabpane.taro-d0eea168.js";
|
|
25
25
|
import { T as T4 } from "./tabs.taro-3ece2221.js";
|
|
26
|
-
import { A } from "./address.taro-
|
|
26
|
+
import { A } from "./address.taro-6d420871.js";
|
|
27
27
|
import { C as C5 } from "./calendar.taro-c8ddf452.js";
|
|
28
28
|
import { C as C6 } from "./calendaritem.taro-0bd17638.js";
|
|
29
|
-
import { C as C7 } from "./cascader.taro-
|
|
29
|
+
import { C as C7 } from "./cascader.taro-01ffbfb1.js";
|
|
30
30
|
import { C as C8, a } from "./checkbox.taro-22cd35c4.js";
|
|
31
31
|
import { D as D2 } from "./datepicker.taro-288d64bb.js";
|
|
32
|
-
import {
|
|
33
|
-
import { F as
|
|
32
|
+
import { default as default2 } from "./Form.js";
|
|
33
|
+
import { F as F2 } from "./formitem.taro-bb63ac0a.js";
|
|
34
34
|
import { I as I2 } from "./input.taro-fbcb7090.js";
|
|
35
35
|
import { I as I3 } from "./inputnumber.taro-2f6f30d7.js";
|
|
36
36
|
import { M } from "./menu.taro-4cde3e7f.js";
|
|
@@ -48,21 +48,21 @@ import { T as T5 } from "./textarea.taro-6ebe789c.js";
|
|
|
48
48
|
import { U } from "./uploader.taro-c0bcca89.js";
|
|
49
49
|
import { A as A2 } from "./actionsheet.taro-0a411006.js";
|
|
50
50
|
import { B as B3 } from "./badge.taro-289489e5.js";
|
|
51
|
-
import { B as B4 } from "./dialog.taro-
|
|
51
|
+
import { B as B4 } from "./dialog.taro-1426fb49.js";
|
|
52
52
|
import { D as D3 } from "./drag.taro-ce333e51.js";
|
|
53
53
|
import { E as E2 } from "./empty.taro-05f15f93.js";
|
|
54
54
|
import { I as I4 } from "./infiniteloading.taro-cb3b949e.js";
|
|
55
55
|
import { L as L2 } from "./loading.taro-0799622f.js";
|
|
56
56
|
import { N as N3 } from "./noticebar.taro-d95c13b6.js";
|
|
57
|
-
import { N as N4 } from "./notify.taro-
|
|
57
|
+
import { N as N4 } from "./notify.taro-6798c31f.js";
|
|
58
58
|
import { P as P2 } from "./popover.taro-7a482b85.js";
|
|
59
59
|
import { P as P3 } from "./popup.taro-487eb86e.js";
|
|
60
|
-
import { P as P4 } from "./pulltorefresh.taro-
|
|
60
|
+
import { P as P4 } from "./pulltorefresh.taro-d35571e8.js";
|
|
61
61
|
import { S as S10 } from "./skeleton.taro-1896ff37.js";
|
|
62
|
-
import { S as S11 } from "./swipe.taro-
|
|
63
|
-
import { T as T6 } from "./toast.taro-
|
|
62
|
+
import { S as S11 } from "./swipe.taro-2fa2479c.js";
|
|
63
|
+
import { T as T6 } from "./toast.taro-44ebc833.js";
|
|
64
64
|
import { A as A3 } from "./animate.taro-37bf4eab.js";
|
|
65
|
-
import { default as
|
|
65
|
+
import { default as default3 } from "./AnimatingNumbers.js";
|
|
66
66
|
import { A as A4 } from "./audio.taro-ef39c1d9.js";
|
|
67
67
|
import { A as A5 } from "./avatar.taro-47abbb9f.js";
|
|
68
68
|
import { A as A6 } from "./avatargroup.taro-1f8b7174.js";
|
|
@@ -78,7 +78,7 @@ import { P as P6 } from "./price.taro-0bd3f07a.js";
|
|
|
78
78
|
import { P as P7 } from "./progress.taro-421575b9.js";
|
|
79
79
|
import { S as S12 } from "./step.taro-dd522794.js";
|
|
80
80
|
import { S as S13 } from "./steps.taro-0680ae4f.js";
|
|
81
|
-
import { default as
|
|
81
|
+
import { default as default4 } from "./Swiper.js";
|
|
82
82
|
import { S as S14 } from "./swiperitem.taro-da39a67b.js";
|
|
83
83
|
import { T as T7 } from "./table.taro-072907bf.js";
|
|
84
84
|
import { T as T8 } from "./tag.taro-518b9c70.js";
|
|
@@ -108,7 +108,7 @@ import "./use-force-update-9cd7c164.js";
|
|
|
108
108
|
import "./raf-a9ff50ad.js";
|
|
109
109
|
import "./use-touch-ff43512c.js";
|
|
110
110
|
import "./index-e3184f19.js";
|
|
111
|
-
import "./use-custom-event-
|
|
111
|
+
import "./use-custom-event-bb9c7f2e.js";
|
|
112
112
|
import "react-dom";
|
|
113
113
|
import "./context-ab42ba7f.js";
|
|
114
114
|
import "./ConfigProvider.js";
|
|
@@ -116,7 +116,7 @@ export {
|
|
|
116
116
|
A2 as ActionSheet,
|
|
117
117
|
A as Address,
|
|
118
118
|
A3 as Animate,
|
|
119
|
-
|
|
119
|
+
default3 as AnimatingNumbers,
|
|
120
120
|
A4 as Audio,
|
|
121
121
|
A5 as Avatar,
|
|
122
122
|
A6 as AvatarGroup,
|
|
@@ -146,8 +146,8 @@ export {
|
|
|
146
146
|
E3 as Ellipsis,
|
|
147
147
|
E2 as Empty,
|
|
148
148
|
F as FixedNav,
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
default2 as Form,
|
|
150
|
+
F2 as FormItem,
|
|
151
151
|
G as Grid,
|
|
152
152
|
G2 as GridItem,
|
|
153
153
|
I as Image,
|
|
@@ -189,7 +189,7 @@ export {
|
|
|
189
189
|
S2 as Sticky,
|
|
190
190
|
S5 as SubSideNavBar,
|
|
191
191
|
S11 as Swipe,
|
|
192
|
-
|
|
192
|
+
default4 as Swiper,
|
|
193
193
|
S14 as SwiperItem,
|
|
194
194
|
S9 as Switch,
|
|
195
195
|
T3 as TabPane,
|
|
@@ -76,6 +76,7 @@ const PullToRefresh = (p) => {
|
|
|
76
76
|
};
|
|
77
77
|
const handleTouchStart = (e) => {
|
|
78
78
|
touch.start(e);
|
|
79
|
+
pullingRef.current = true;
|
|
79
80
|
};
|
|
80
81
|
const handleTouchMove = (e) => {
|
|
81
82
|
if (props.scrollTop > 0) {
|
|
@@ -84,11 +85,12 @@ const PullToRefresh = (p) => {
|
|
|
84
85
|
if (status === "refreshing" || status === "complete")
|
|
85
86
|
return;
|
|
86
87
|
touch.move(e);
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
setHeight(Math.max(rubberbandIfOutOfBounds(touch.deltaY, 0, 0, headHeight * 5, 0.5), 0));
|
|
90
|
-
setStatus(height > threshold ? "canRelease" : "pulling");
|
|
88
|
+
if (e.cancelable) {
|
|
89
|
+
e.preventDefault();
|
|
91
90
|
}
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
setHeight(Math.max(rubberbandIfOutOfBounds(touch.deltaY, 0, 0, headHeight * 5, 0.5), 0));
|
|
93
|
+
setStatus(height > threshold ? "canRelease" : "pulling");
|
|
92
94
|
};
|
|
93
95
|
async function doRefresh() {
|
|
94
96
|
setHeight(headHeight);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React__default, { forwardRef, useRef, useState, useImperativeHandle, useEffect } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
+
import { View } from "@tarojs/components";
|
|
3
4
|
import { useReady, nextTick } from "@tarojs/taro";
|
|
4
5
|
import { u as useTouch } from "./use-touch-ff43512c.js";
|
|
5
6
|
import { g as getRectByTaro } from "./use-client-rect-2bb6c562.js";
|
|
@@ -130,7 +131,7 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
130
131
|
const rightWrapper = useRef(null);
|
|
131
132
|
const renderActionContent = (side) => {
|
|
132
133
|
if (props[`${side}Action`]) {
|
|
133
|
-
return React__default.createElement("div", {
|
|
134
|
+
return React__default.createElement("div", { ref: side === "left" ? leftWrapper : rightWrapper, className: `${classPrefix}__${side}`, onClick: (e) => handleOperate(e, side) }, props[`${side}Action`]);
|
|
134
135
|
}
|
|
135
136
|
return null;
|
|
136
137
|
};
|
|
@@ -163,8 +164,8 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
163
164
|
};
|
|
164
165
|
}, []);
|
|
165
166
|
return React__default.createElement(
|
|
166
|
-
|
|
167
|
-
{ ref: root, className: classNames(classPrefix, className), onTouchStart: (e) => onTouchStart(e), onTouchMove: (e) => onTouchMove(e), onTouchEnd: (e) => onTouchEnd(e), style },
|
|
167
|
+
View,
|
|
168
|
+
{ ref: root, className: classNames(classPrefix, className), onTouchStart: (e) => onTouchStart(e), onTouchMove: (e) => onTouchMove(e), onTouchEnd: (e) => onTouchEnd(e), style, catchMove: true },
|
|
168
169
|
React__default.createElement(
|
|
169
170
|
"div",
|
|
170
171
|
{ className: `${classPrefix}__wrapper`, style: wrapperStyle },
|
|
@@ -3,7 +3,7 @@ import classNames from "classnames";
|
|
|
3
3
|
import { Success, Failure, Tips, Loading } from "@nutui/icons-react-taro";
|
|
4
4
|
import { O as Overlay } from "./overlay.taro-626840fc.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
|
-
import { u as useParams, a as useCustomEvent, b as useCustomEventsPath, c as customEvents } from "./use-custom-event-
|
|
6
|
+
import { u as useParams, a as useCustomEvent, b as useCustomEventsPath, c as customEvents } from "./use-custom-event-bb9c7f2e.js";
|
|
7
7
|
const defaultProps = {
|
|
8
8
|
...ComponentDefaults,
|
|
9
9
|
id: "",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode, ForwardRefExoticComponent, PropsWithChildren } from 'react';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
|
+
import { BasicComponent } from '@/utils/typings';
|
|
3
4
|
export type DialogConfigType = {
|
|
4
5
|
prefixCls?: string;
|
|
5
6
|
simple?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export interface BasicDialogProps {
|
|
8
|
+
export interface BasicDialogProps extends BasicComponent {
|
|
8
9
|
visible?: boolean;
|
|
9
10
|
title?: ReactNode;
|
|
10
11
|
content?: ReactNode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode, HTMLAttributes } from 'react';
|
|
2
2
|
import { ITouchEvent } from '@tarojs/components';
|
|
3
|
-
|
|
3
|
+
import { BasicComponent } from '@/utils/typings';
|
|
4
|
+
interface ContentProps extends BasicComponent {
|
|
4
5
|
visible: boolean;
|
|
5
6
|
title: ReactNode;
|
|
6
7
|
footer: ReactNode;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { useForm } from './useform';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
3
2
|
import { BasicComponent } from '@/utils/typings';
|
|
4
|
-
import {
|
|
3
|
+
import { FormInstance } from '@/packages/form/types';
|
|
5
4
|
export interface FormProps extends BasicComponent {
|
|
6
5
|
footer: ReactNode;
|
|
7
6
|
initialValues: any;
|
|
8
7
|
name: string;
|
|
9
8
|
form: any;
|
|
9
|
+
divider: boolean;
|
|
10
10
|
labelPosition: 'top' | 'left' | 'right';
|
|
11
11
|
starPosition: 'left' | 'right';
|
|
12
12
|
onFinish: (values: any) => void;
|
|
13
13
|
onFinishFailed: (values: any, errorFields: any) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare const Form:
|
|
16
|
-
Item: typeof FormItem;
|
|
17
|
-
} & {
|
|
18
|
-
useForm: typeof useForm;
|
|
19
|
-
};
|
|
15
|
+
export declare const Form: React.ForwardRefExoticComponent<Partial<FormProps> & React.RefAttributes<FormInstance<any>>>;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
-
import {
|
|
4
|
-
import { FormItem } from '../formitem/formitem.taro';
|
|
3
|
+
import { FormInstance } from '@/packages/form/types';
|
|
5
4
|
export interface FormProps extends BasicComponent {
|
|
6
5
|
footer: ReactNode;
|
|
7
6
|
initialValues: any;
|
|
8
7
|
name: string;
|
|
9
8
|
form: any;
|
|
9
|
+
divider: boolean;
|
|
10
10
|
labelPosition: 'top' | 'left' | 'right';
|
|
11
11
|
starPosition: 'left' | 'right';
|
|
12
12
|
onFinish: (values: any) => void;
|
|
13
13
|
onFinishFailed: (values: any, errorFields: any) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare const Form:
|
|
16
|
-
Item: typeof FormItem;
|
|
17
|
-
} & {
|
|
18
|
-
useForm: typeof useForm;
|
|
19
|
-
};
|
|
15
|
+
export declare const Form: React.ForwardRefExoticComponent<Partial<FormProps> & React.RefAttributes<FormInstance<any>>>;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormProps } from './form';
|
|
3
|
+
import { FormItem } from '../formitem/formitem';
|
|
4
|
+
import { FormInstance } from './types';
|
|
5
|
+
import { useForm } from '@/packages/form/useform';
|
|
2
6
|
export type { FormItemRuleWithoutValidator, StoreValue, NamePath, FormInstance, FieldEntity, } from './types';
|
|
3
|
-
|
|
7
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<Partial<FormProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & React.RefAttributes<FormInstance>> & {
|
|
8
|
+
Item: typeof FormItem;
|
|
9
|
+
useForm: typeof useForm;
|
|
10
|
+
};
|
|
11
|
+
declare const InnerForm: CompoundedComponent;
|
|
12
|
+
export default InnerForm;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormProps } from './form.taro';
|
|
3
|
+
import { FormItem } from '../formitem/formitem.taro';
|
|
4
|
+
import { FormInstance } from './types';
|
|
5
|
+
import { useForm } from '@/packages/form/useform.taro';
|
|
2
6
|
export type { FormItemRuleWithoutValidator, StoreValue, NamePath, FormInstance, FieldEntity, } from './types';
|
|
3
|
-
|
|
7
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<Partial<FormProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & React.RefAttributes<FormInstance>> & {
|
|
8
|
+
Item: typeof FormItem;
|
|
9
|
+
useForm: typeof useForm;
|
|
10
|
+
};
|
|
11
|
+
declare const InnerForm: CompoundedComponent;
|
|
12
|
+
export default InnerForm;
|
|
@@ -17,6 +17,7 @@ export interface Store {
|
|
|
17
17
|
export interface FormInstance<Values = any> {
|
|
18
18
|
registerField: (entity: FieldEntity) => () => void;
|
|
19
19
|
getFieldValue: (name: NamePath) => StoreValue;
|
|
20
|
+
setInitialValues: (values: any, init: boolean) => void;
|
|
20
21
|
setFieldsValue: (value: any) => void;
|
|
21
22
|
resetFields: (fields?: NamePath[]) => void;
|
|
22
23
|
submit: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MouseEvent } from 'react';
|
|
3
|
+
import { BaseEventOrig } from '@tarojs/components/types/common';
|
|
3
4
|
import { BasicComponent } from '@/utils/typings';
|
|
4
5
|
export type SwipeSide = 'left' | 'right';
|
|
5
6
|
export interface SwipeInstance {
|
|
@@ -29,8 +30,8 @@ export interface SwipeProps extends BasicComponent {
|
|
|
29
30
|
}) => void;
|
|
30
31
|
/** 点击时触发 */
|
|
31
32
|
onActionClick?: (event: MouseEvent<HTMLDivElement>, position: SwipeSide) => void;
|
|
32
|
-
onTouchStart?: (event:
|
|
33
|
-
onTouchEnd?: (event:
|
|
34
|
-
onTouchMove?: (event:
|
|
33
|
+
onTouchStart?: (event: BaseEventOrig<HTMLDivElement>) => void;
|
|
34
|
+
onTouchEnd?: (event: BaseEventOrig<HTMLDivElement>) => void;
|
|
35
|
+
onTouchMove?: (event: BaseEventOrig<HTMLDivElement>) => void;
|
|
35
36
|
}
|
|
36
37
|
export declare const Swipe: React.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeInstance>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const customEvents: TaroGeneral.Events;
|
|
2
|
-
export declare function useCustomEventsPath(selector
|
|
2
|
+
export declare function useCustomEventsPath(selector?: string): string;
|
|
3
3
|
export declare function useCustomEvent(selector: string, cb: any): (<T = any>(args: T) => void)[];
|
|
4
4
|
export declare function useParams<T = any>(args: T): {
|
|
5
5
|
params: T;
|
|
@@ -5,6 +5,7 @@ import { u as useForceUpdate } from "./use-force-update-9cd7c164.js";
|
|
|
5
5
|
const customEvents = new Events();
|
|
6
6
|
function useCustomEventsPath(selector) {
|
|
7
7
|
var _a;
|
|
8
|
+
selector = selector || "";
|
|
8
9
|
const path = (_a = getCurrentInstance().router) == null ? void 0 : _a.path;
|
|
9
10
|
return path ? `${path}__${selector}` : selector;
|
|
10
11
|
}
|
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