@nutui/nutui-react-taro 3.0.19-cpp-beta.3 → 3.0.19-cpp-beta.ios.1
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/cjs/hooks/taro/use-custom-event.js +1 -1
- package/dist/cjs/packages/button/button.d.ts +2 -5
- package/dist/cjs/packages/button/button.js +7 -9
- package/dist/cjs/packages/input/input.js +13 -1
- package/dist/cjs/packages/swipe/swipe.d.ts +1 -1
- package/dist/cjs/utils/taro/get-rect-by-id.js +13 -1
- package/dist/es/hooks/taro/use-custom-event.js +3 -2
- package/dist/es/packages/button/button.d.ts +2 -5
- package/dist/es/packages/button/button.js +10 -10
- package/dist/es/packages/input/input.js +13 -1
- package/dist/es/packages/swipe/swipe.d.ts +1 -1
- package/dist/es/utils/taro/get-rect-by-id.js +13 -1
- package/dist/nutui.react.umd.js +80 -53
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +25 -25
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +29 -29
- package/dist/style.css +1 -1
- package/dist/style.scss +39 -39
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ var _react = require("react");
|
|
|
28
28
|
var _reactfastcompare = /*#__PURE__*/ _interop_require_default._(require("react-fast-compare"));
|
|
29
29
|
var _taro = require("@tarojs/taro");
|
|
30
30
|
var _useforceupdate = require("../use-force-update");
|
|
31
|
-
var customEvents =
|
|
31
|
+
var customEvents = _taro.eventCenter;
|
|
32
32
|
function useCustomEventsPath(selector) {
|
|
33
33
|
var _getCurrentInstance_router;
|
|
34
34
|
selector = selector || '';
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
|
-
import { ButtonProps as MiniProgramButtonProps } from '@tarojs/components';
|
|
4
3
|
import { BasicComponent } from "../../utils/typings";
|
|
5
|
-
type OmitMiniProgramButtonProps = Omit<MiniProgramButtonProps, 'size' | 'type' | 'onClick' | 'style'>;
|
|
6
4
|
export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
7
5
|
export type ButtonSize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini';
|
|
8
6
|
export type ButtonShape = 'square' | 'round';
|
|
9
7
|
export type ButtonFill = 'solid' | 'outline' | 'dashed' | 'none';
|
|
10
|
-
export interface ButtonProps extends BasicComponent
|
|
8
|
+
export interface ButtonProps extends BasicComponent {
|
|
11
9
|
color: string;
|
|
12
10
|
shape: ButtonShape;
|
|
13
11
|
type: ButtonType;
|
|
@@ -21,5 +19,4 @@ export interface ButtonProps extends BasicComponent, OmitMiniProgramButtonProps
|
|
|
21
19
|
nativeType: 'submit' | 'reset';
|
|
22
20
|
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
23
21
|
}
|
|
24
|
-
export declare const Button: React.ForwardRefExoticComponent<
|
|
25
|
-
export {};
|
|
22
|
+
export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -18,7 +18,6 @@ var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
|
18
18
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
19
19
|
var _components = require("@tarojs/components");
|
|
20
20
|
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
21
|
-
var _taro = require("@tarojs/taro");
|
|
22
21
|
var _typings = require("../../utils/typings");
|
|
23
22
|
var _platform = require("../../utils/taro/platform");
|
|
24
23
|
var prefixCls = 'nut-button';
|
|
@@ -36,7 +35,7 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
36
35
|
onClick: function onClick(e) {}
|
|
37
36
|
});
|
|
38
37
|
var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
39
|
-
var _ref = (0, _object_spread._)({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style,
|
|
38
|
+
var _ref = (0, _object_spread._)({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style, nativeType = _ref.nativeType, onClick = _ref.onClick, rest = (0, _object_without_properties._)(_ref, [
|
|
40
39
|
"color",
|
|
41
40
|
"shape",
|
|
42
41
|
"fill",
|
|
@@ -50,7 +49,6 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
50
49
|
"children",
|
|
51
50
|
"className",
|
|
52
51
|
"style",
|
|
53
|
-
"formType",
|
|
54
52
|
"nativeType",
|
|
55
53
|
"onClick"
|
|
56
54
|
]);
|
|
@@ -104,16 +102,16 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
104
102
|
]);
|
|
105
103
|
var _obj;
|
|
106
104
|
var buttonClassNames = (0, _classnames.default)(prefixCls, "".concat(prefixCls, "-").concat(type), (_obj = {}, (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(type, "-solid"), type === 'primary' && !props.fill), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(fill), props.fill), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(type, "-").concat(fill), props.fill), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(size), size), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(shape), shape), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(shape, "-").concat(size), shape && size), (0, _define_property._)(_obj, "".concat(prefixCls, "-block"), block), (0, _define_property._)(_obj, "".concat(prefixCls, "-disabled"), disabled || loading), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(type).concat(props.fill ? "-".concat(fill) : '', "-disabled"), disabled || loading), (0, _define_property._)(_obj, "".concat(prefixCls, "-loading"), loading), (0, _define_property._)(_obj, "".concat(prefixCls, "-icononly"), !children), _obj), className);
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
105
|
+
// if (getEnv() === 'WEB') {
|
|
106
|
+
// ;(rest as any).type = formType
|
|
107
|
+
// }
|
|
111
108
|
return(// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
112
109
|
// @ts-ignore
|
|
113
110
|
// eslint-disable-next-line react/button-has-type
|
|
114
|
-
|
|
111
|
+
// <TaroButton
|
|
112
|
+
/*#__PURE__*/ /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread_props._)((0, _object_spread._)({}, rest), {
|
|
115
113
|
ref: ref,
|
|
116
|
-
|
|
114
|
+
// formType={formType || nativeType}
|
|
117
115
|
className: buttonClassNames,
|
|
118
116
|
style: (0, _object_spread._)({}, getStyle, style),
|
|
119
117
|
onClick: function onClick(e) {
|
|
@@ -21,6 +21,18 @@ var _utils = require("./utils");
|
|
|
21
21
|
var _index = require("../configprovider/index");
|
|
22
22
|
var _typings = require("../../utils/typings");
|
|
23
23
|
var _usepropsvalue = require("../../hooks/use-props-value");
|
|
24
|
+
var ENV_TYPE = {
|
|
25
|
+
WEAPP: 'WEAPP',
|
|
26
|
+
SWAN: 'SWAN',
|
|
27
|
+
ALIPAY: 'ALIPAY',
|
|
28
|
+
TT: 'TT',
|
|
29
|
+
QQ: 'QQ',
|
|
30
|
+
JD: 'JD',
|
|
31
|
+
WEB: 'WEB',
|
|
32
|
+
RN: 'RN',
|
|
33
|
+
HARMONY: 'HARMONY',
|
|
34
|
+
QUICKAPP: 'QUICKAPP'
|
|
35
|
+
};
|
|
24
36
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
25
37
|
type: 'text',
|
|
26
38
|
name: '',
|
|
@@ -150,7 +162,7 @@ var Input = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
|
|
|
150
162
|
}, 200);
|
|
151
163
|
};
|
|
152
164
|
var inputType = function inputType(type) {
|
|
153
|
-
if ((0, _taro.getEnv)() ===
|
|
165
|
+
if ((0, _taro.getEnv)() === ENV_TYPE.WEB) {
|
|
154
166
|
if (type === 'digit') return 'text';
|
|
155
167
|
if (type === 'number') return 'tel';
|
|
156
168
|
} else if (type === 'password') {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SwipeRef, TaroSwipeProps } from "../../types";
|
|
3
|
-
export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
3
|
+
export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeRef>>;
|
|
@@ -10,9 +10,21 @@ Object.defineProperty(exports, "getRectById", {
|
|
|
10
10
|
});
|
|
11
11
|
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
var _taro = /*#__PURE__*/ _interop_require_wildcard._(require("@tarojs/taro"));
|
|
13
|
+
var ENV_TYPE = {
|
|
14
|
+
WEAPP: 'WEAPP',
|
|
15
|
+
SWAN: 'SWAN',
|
|
16
|
+
ALIPAY: 'ALIPAY',
|
|
17
|
+
TT: 'TT',
|
|
18
|
+
QQ: 'QQ',
|
|
19
|
+
JD: 'JD',
|
|
20
|
+
WEB: 'WEB',
|
|
21
|
+
RN: 'RN',
|
|
22
|
+
HARMONY: 'HARMONY',
|
|
23
|
+
QUICKAPP: 'QUICKAPP'
|
|
24
|
+
};
|
|
13
25
|
var getRectById = function getRectById(id) {
|
|
14
26
|
return new Promise(function(resolve, reject) {
|
|
15
|
-
if (_taro.default.getEnv() ===
|
|
27
|
+
if (_taro.default.getEnv() === ENV_TYPE.WEB) {
|
|
16
28
|
var t = document ? document.querySelector("#".concat(id)) : '';
|
|
17
29
|
if (t) {
|
|
18
30
|
resolve(t === null || t === void 0 ? void 0 : t.getBoundingClientRect());
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import isEqual from "react-fast-compare";
|
|
4
|
-
import {
|
|
4
|
+
import { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
5
5
|
import { useForceUpdate } from "../use-force-update";
|
|
6
|
-
export
|
|
6
|
+
// export const customEvents = new Events()
|
|
7
|
+
export var customEvents = eventCenter;
|
|
7
8
|
export function useCustomEventsPath(selector) {
|
|
8
9
|
var _getCurrentInstance_router;
|
|
9
10
|
selector = selector || '';
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
|
-
import { ButtonProps as MiniProgramButtonProps } from '@tarojs/components';
|
|
4
3
|
import { BasicComponent } from "../../utils/typings";
|
|
5
|
-
type OmitMiniProgramButtonProps = Omit<MiniProgramButtonProps, 'size' | 'type' | 'onClick' | 'style'>;
|
|
6
4
|
export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
7
5
|
export type ButtonSize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini';
|
|
8
6
|
export type ButtonShape = 'square' | 'round';
|
|
9
7
|
export type ButtonFill = 'solid' | 'outline' | 'dashed' | 'none';
|
|
10
|
-
export interface ButtonProps extends BasicComponent
|
|
8
|
+
export interface ButtonProps extends BasicComponent {
|
|
11
9
|
color: string;
|
|
12
10
|
shape: ButtonShape;
|
|
13
11
|
type: ButtonType;
|
|
@@ -21,5 +19,4 @@ export interface ButtonProps extends BasicComponent, OmitMiniProgramButtonProps
|
|
|
21
19
|
nativeType: 'submit' | 'reset';
|
|
22
20
|
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
23
21
|
}
|
|
24
|
-
export declare const Button: React.ForwardRefExoticComponent<
|
|
25
|
-
export {};
|
|
22
|
+
export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,9 +4,9 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
|
4
4
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
5
|
import React, { useCallback, useMemo } from "react";
|
|
6
6
|
import classNames from "classnames";
|
|
7
|
-
import {
|
|
7
|
+
import { // ButtonProps as MiniProgramButtonProps,
|
|
8
|
+
View } from "@tarojs/components";
|
|
8
9
|
import { Loading } from "@nutui/icons-react-taro";
|
|
9
|
-
import { getEnv } from "@tarojs/taro";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
11
|
import { harmony } from "../../utils/taro/platform";
|
|
12
12
|
var prefixCls = 'nut-button';
|
|
@@ -24,7 +24,8 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
24
24
|
onClick: function(e) {}
|
|
25
25
|
});
|
|
26
26
|
export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
27
|
-
var _ref = _object_spread({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style,
|
|
27
|
+
var _ref = _object_spread({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style, // formType,
|
|
28
|
+
nativeType = _ref.nativeType, onClick = _ref.onClick, rest = _object_without_properties(_ref, [
|
|
28
29
|
"color",
|
|
29
30
|
"shape",
|
|
30
31
|
"fill",
|
|
@@ -38,7 +39,6 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
38
39
|
"children",
|
|
39
40
|
"className",
|
|
40
41
|
"style",
|
|
41
|
-
"formType",
|
|
42
42
|
"nativeType",
|
|
43
43
|
"onClick"
|
|
44
44
|
]);
|
|
@@ -92,17 +92,17 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
92
92
|
]);
|
|
93
93
|
var _obj;
|
|
94
94
|
var buttonClassNames = classNames(prefixCls, "".concat(prefixCls, "-").concat(type), (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-").concat(type, "-solid"), type === 'primary' && !props.fill), _define_property(_obj, "".concat(prefixCls, "-").concat(fill), props.fill), _define_property(_obj, "".concat(prefixCls, "-").concat(type, "-").concat(fill), props.fill), _define_property(_obj, "".concat(prefixCls, "-").concat(size), size), _define_property(_obj, "".concat(prefixCls, "-").concat(shape), shape), _define_property(_obj, "".concat(prefixCls, "-").concat(shape, "-").concat(size), shape && size), _define_property(_obj, "".concat(prefixCls, "-block"), block), _define_property(_obj, "".concat(prefixCls, "-disabled"), disabled || loading), _define_property(_obj, "".concat(prefixCls, "-").concat(type).concat(props.fill ? "-".concat(fill) : '', "-disabled"), disabled || loading), _define_property(_obj, "".concat(prefixCls, "-loading"), loading), _define_property(_obj, "".concat(prefixCls, "-icononly"), !children), _obj), className);
|
|
95
|
-
if (getEnv() === 'WEB') {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
95
|
+
// if (getEnv() === 'WEB') {
|
|
96
|
+
// ;(rest as any).type = formType
|
|
97
|
+
// }
|
|
99
98
|
return (
|
|
100
99
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
101
100
|
// @ts-ignore
|
|
102
101
|
// eslint-disable-next-line react/button-has-type
|
|
103
|
-
|
|
102
|
+
// <TaroButton
|
|
103
|
+
/*#__PURE__*/ (React.createElement(View, _object_spread_props(_object_spread({}, rest), {
|
|
104
104
|
ref: ref,
|
|
105
|
-
|
|
105
|
+
// formType={formType || nativeType}
|
|
106
106
|
className: buttonClassNames,
|
|
107
107
|
style: _object_spread({}, getStyle, style),
|
|
108
108
|
onClick: function(e) {
|
|
@@ -5,11 +5,23 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
5
5
|
import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from "react";
|
|
6
6
|
import { Input as TaroInput, View } from "@tarojs/components";
|
|
7
7
|
import { MaskClose } from "@nutui/icons-react-taro";
|
|
8
|
-
import Taro, {
|
|
8
|
+
import Taro, { getEnv } from "@tarojs/taro";
|
|
9
9
|
import { formatNumber } from "./utils";
|
|
10
10
|
import { useConfig, useRtl } from "../configprovider/index";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
12
|
import { usePropsValue } from "../../hooks/use-props-value";
|
|
13
|
+
var ENV_TYPE = {
|
|
14
|
+
WEAPP: 'WEAPP',
|
|
15
|
+
SWAN: 'SWAN',
|
|
16
|
+
ALIPAY: 'ALIPAY',
|
|
17
|
+
TT: 'TT',
|
|
18
|
+
QQ: 'QQ',
|
|
19
|
+
JD: 'JD',
|
|
20
|
+
WEB: 'WEB',
|
|
21
|
+
RN: 'RN',
|
|
22
|
+
HARMONY: 'HARMONY',
|
|
23
|
+
QUICKAPP: 'QUICKAPP'
|
|
24
|
+
};
|
|
13
25
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14
26
|
type: 'text',
|
|
15
27
|
name: '',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SwipeRef, TaroSwipeProps } from "../../types";
|
|
3
|
-
export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
3
|
+
export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeRef>>;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import Taro, { createSelectorQuery } from "@tarojs/taro";
|
|
2
|
+
var ENV_TYPE = {
|
|
3
|
+
WEAPP: 'WEAPP',
|
|
4
|
+
SWAN: 'SWAN',
|
|
5
|
+
ALIPAY: 'ALIPAY',
|
|
6
|
+
TT: 'TT',
|
|
7
|
+
QQ: 'QQ',
|
|
8
|
+
JD: 'JD',
|
|
9
|
+
WEB: 'WEB',
|
|
10
|
+
RN: 'RN',
|
|
11
|
+
HARMONY: 'HARMONY',
|
|
12
|
+
QUICKAPP: 'QUICKAPP'
|
|
13
|
+
};
|
|
2
14
|
export var getRectById = function(id) {
|
|
3
15
|
return new Promise(function(resolve, reject) {
|
|
4
|
-
if (Taro.getEnv() ===
|
|
16
|
+
if (Taro.getEnv() === ENV_TYPE.WEB) {
|
|
5
17
|
var t = document ? document.querySelector("#".concat(id)) : '';
|
|
6
18
|
if (t) {
|
|
7
19
|
resolve(t === null || t === void 0 ? void 0 : t.getBoundingClientRect());
|