@nutui/nutui-react 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.
Files changed (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/esm/Avatar.js +1 -1
  3. package/dist/esm/AvatarGroup.js +1 -1
  4. package/dist/esm/Cell.js +5 -3
  5. package/dist/esm/CellGroup.js +6 -1
  6. package/dist/esm/Dialog.js +4 -3
  7. package/dist/esm/Form.js +14 -7
  8. package/dist/esm/SideNavBar.js +1 -1
  9. package/dist/esm/Step.js +1 -1
  10. package/dist/esm/Steps.js +1 -1
  11. package/dist/esm/SubSideNavBar.js +1 -1
  12. package/dist/esm/Swiper.js +1 -1
  13. package/dist/esm/SwiperItem.js +1 -1
  14. package/dist/esm/context.js +2 -16
  15. package/dist/esm/context2.js +16 -2
  16. package/dist/esm/context3.js +2 -2
  17. package/dist/esm/context5.js +5 -0
  18. package/dist/esm/overlay2.js +4 -1
  19. package/dist/esm/popup2.js +3 -0
  20. package/dist/esm/types/src/packages/cellgroup/context.d.ts +5 -0
  21. package/dist/esm/types/src/packages/dialog/config.d.ts +2 -1
  22. package/dist/esm/types/src/packages/dialog/content.taro.d.ts +2 -1
  23. package/dist/esm/types/src/packages/form/form.d.ts +4 -8
  24. package/dist/esm/types/src/packages/form/form.taro.d.ts +4 -8
  25. package/dist/esm/types/src/packages/form/index.d.ts +11 -2
  26. package/dist/esm/types/src/packages/form/index.taro.d.ts +11 -2
  27. package/dist/esm/types/src/packages/form/types.d.ts +1 -0
  28. package/dist/esm/types/src/packages/swipe/swipe.taro.d.ts +5 -4
  29. package/dist/esm/types/src/utils/use-custom-event.d.ts +1 -1
  30. package/dist/locales/base.js +1 -1
  31. package/dist/locales/en-US.js +1 -1
  32. package/dist/locales/id-ID.js +1 -1
  33. package/dist/locales/tr-TR.js +1 -1
  34. package/dist/locales/zh-CN.js +1 -1
  35. package/dist/locales/zh-TW.js +1 -1
  36. package/dist/locales/zh-UG.js +1 -1
  37. package/dist/nutui.react.es.js +135 -91
  38. package/dist/nutui.react.umd.js +135 -91
  39. package/dist/style.mjs +1 -1
  40. package/dist/types/packages/cellgroup/context.d.ts +5 -0
  41. package/dist/types/packages/dialog/config.d.ts +2 -1
  42. package/dist/types/packages/form/form.d.ts +4 -8
  43. package/dist/types/packages/form/index.d.ts +11 -2
  44. package/dist/types/packages/form/types.d.ts +1 -0
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v2.0.16
2
+ `2023-09-06`
3
+
4
+ * :sparkles: feat: form 支持分割线 (#1389) @oasis-cloud
5
+ * :bug: fix(pulltorefresh): 修复 H5 卡顿 & 小程序滑动距离问题 @Eiinu
6
+ * :bug: fix: csstransition using findDOMNode which is deprecated (#1370) @oasis-cloud
7
+ * :bug: fix: dialog 的函数调用增加对 classname 和 style 的支持 (#1391) @oasis-cloud
8
+ * :bug: fix: swipe 阻止页面滚动 (#1380) @oasis-cloud
9
+ * :bug: fix: useForm 在类组件下报错,可以采用 ref 的方式使用 FormInstance (#1383) @oasis-cloud
10
+ * :bug: fix: 多个 Swipe 的滑动选项完全相等 (#1334) @Clay Zhang
11
+ * 📖 docs: toast组件完善了样式变量 (#1379) @ivan-My
12
+
13
+
1
14
  # v2.0.15
2
15
  `2023-08-30`
3
16
 
@@ -26,7 +26,7 @@ function _objectSpread(target) {
26
26
  import React__default, { useState, useRef, useContext, useEffect } from "react";
27
27
  import classNames from "classnames";
28
28
  import { My } from "@nutui/icons-react";
29
- import { A as AvatarContext } from "./context2.js";
29
+ import { A as AvatarContext } from "./context3.js";
30
30
  import Image from "./Image.js";
31
31
  import { C as ComponentDefaults } from "./typings.js";
32
32
  import AvatarGroup from "./AvatarGroup.js";
@@ -22,7 +22,7 @@ function _objectSpread(target) {
22
22
  }
23
23
  import React__default, { useRef } from "react";
24
24
  import classNames from "classnames";
25
- import { A as AvatarContext } from "./context2.js";
25
+ import { A as AvatarContext } from "./context3.js";
26
26
  import { C as ComponentDefaults } from "./typings.js";
27
27
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
28
28
  maxContent: "",
package/dist/esm/Cell.js CHANGED
@@ -22,10 +22,11 @@ function _objectSpread(target) {
22
22
  }
23
23
  return target;
24
24
  }
25
- import React__default from "react";
25
+ import React__default, { useContext } from "react";
26
26
  import classNames from "classnames";
27
27
  import { C as ComponentDefaults } from "./typings.js";
28
28
  import CellGroup from "./CellGroup.js";
29
+ import { C as CellGroupContext } from "./context.js";
29
30
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
30
31
  title: null,
31
32
  description: null,
@@ -37,6 +38,7 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
37
38
  });
38
39
  var classPrefix = "nut-cell";
39
40
  var Cell = function Cell2(props) {
41
+ var ctx = useContext(CellGroupContext);
40
42
  var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), children = _defaultProps$props.children, onClick2 = _defaultProps$props.onClick, title = _defaultProps$props.title, description = _defaultProps$props.description, extra = _defaultProps$props.extra, radius = _defaultProps$props.radius, align = _defaultProps$props.align, className = _defaultProps$props.className, style = _defaultProps$props.style, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
41
43
  var handleClick = function handleClick2(event) {
42
44
  onClick2(event);
@@ -63,9 +65,9 @@ var Cell = function Cell2(props) {
63
65
  }, description) : null) : null, extra ? React__default.createElement("div", {
64
66
  className: "".concat(classPrefix, "__extra"),
65
67
  style: styles
66
- }, extra) : null, React__default.createElement("div", {
68
+ }, extra) : null), ctx !== null && ctx !== void 0 && ctx.divider ? React__default.createElement("div", {
67
69
  className: "".concat(classPrefix, "__divider")
68
- })));
70
+ }) : null);
69
71
  };
70
72
  Cell.defaultProps = defaultProps;
71
73
  Cell.displayName = "NutCell";
@@ -25,6 +25,7 @@ function _objectSpread(target) {
25
25
  import React__default from "react";
26
26
  import classNames from "classnames";
27
27
  import { C as ComponentDefaults } from "./typings.js";
28
+ import { C as CellGroupContext } from "./context.js";
28
29
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
29
30
  title: "",
30
31
  description: "",
@@ -41,7 +42,11 @@ var CellGroup = function CellGroup2(props) {
41
42
  className: "".concat(classPrefix, "__description")
42
43
  }, description) : null, React__default.createElement("div", {
43
44
  className: "".concat(classPrefix, "__wrap ").concat(divider ? "".concat(classPrefix, "__wrap--divider") : "")
44
- }, children));
45
+ }, React__default.createElement(CellGroupContext.Provider, {
46
+ value: {
47
+ divider
48
+ }
49
+ }, children)));
45
50
  };
46
51
  CellGroup.defaultProps = defaultProps;
47
52
  CellGroup.displayName = "NutCellGroup";
@@ -138,7 +138,8 @@ var Content = function Content2(props) {
138
138
  onClick && onClick(e);
139
139
  };
140
140
  return React__default.createElement("div", {
141
- className: "".concat(classPrefix, "__outer"),
141
+ className: classNames("".concat(classPrefix, "__outer"), props.className),
142
+ style: props.style,
142
143
  onClick: function onClick2(e) {
143
144
  return handleClick(e);
144
145
  }
@@ -192,7 +193,7 @@ var DialogWrap = function DialogWrap2(props) {
192
193
  };
193
194
  DialogWrap.defaultProps = defaultDialogProps;
194
195
  DialogWrap.displayName = "NutDialogWrap";
195
- var defaultProps = {
196
+ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
196
197
  confirmText: "",
197
198
  cancelText: "",
198
199
  overlay: true,
@@ -208,7 +209,7 @@ var defaultProps = {
208
209
  beforeClose: function beforeClose() {
209
210
  return true;
210
211
  }
211
- };
212
+ });
212
213
  var BaseDialog = function BaseDialog2(props, ref) {
213
214
  var _useConfig = useConfig(), locale = _useConfig.locale;
214
215
  var visible = props.visible, footer = props.footer, hideConfirmButton = props.hideConfirmButton, hideCancelButton = props.hideCancelButton, lockScroll = props.lockScroll, disableConfirmButton = props.disableConfirmButton, closeOnOverlayClick = props.closeOnOverlayClick, confirmText = props.confirmText, cancelText = props.cancelText, onClose2 = props.onClose, onCancel2 = props.onCancel, onConfirm = props.onConfirm, beforeCancel2 = props.beforeCancel, beforeClose2 = props.beforeClose, restProps = _objectWithoutProperties(props, _excluded);
package/dist/esm/Form.js CHANGED
@@ -1209,6 +1209,7 @@ var useForm = function useForm2(form) {
1209
1209
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
1210
1210
  labelPosition: "right",
1211
1211
  starPosition: "left",
1212
+ divider: false,
1212
1213
  onFinish: function onFinish(values) {
1213
1214
  },
1214
1215
  onFinishFailed: function onFinishFailed(values, errorFields) {
@@ -1219,9 +1220,9 @@ var PositionInfo = {
1219
1220
  left: "form-layout-left",
1220
1221
  right: "form-layout-right"
1221
1222
  };
1222
- var Form = function Form2(props) {
1223
+ var Form = React__default.forwardRef(function(props, ref) {
1223
1224
  var classPrefix = "nut-form";
1224
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, style = _defaultProps$props.style, footer = _defaultProps$props.footer, children = _defaultProps$props.children, initialValues = _defaultProps$props.initialValues, onFinish2 = _defaultProps$props.onFinish, onFinishFailed2 = _defaultProps$props.onFinishFailed, labelPosition = _defaultProps$props.labelPosition, starPosition = _defaultProps$props.starPosition, form = _defaultProps$props.form;
1225
+ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, style = _defaultProps$props.style, footer = _defaultProps$props.footer, children = _defaultProps$props.children, initialValues = _defaultProps$props.initialValues, divider = _defaultProps$props.divider, onFinish2 = _defaultProps$props.onFinish, onFinishFailed2 = _defaultProps$props.onFinishFailed, labelPosition = _defaultProps$props.labelPosition, starPosition = _defaultProps$props.starPosition, form = _defaultProps$props.form;
1225
1226
  var formInstance;
1226
1227
  if (form !== void 0) {
1227
1228
  formInstance = form;
@@ -1230,6 +1231,9 @@ var Form = function Form2(props) {
1230
1231
  var _useForm2 = _slicedToArray(_useForm, 1);
1231
1232
  formInstance = _useForm2[0];
1232
1233
  }
1234
+ React__default.useImperativeHandle(ref, function() {
1235
+ return formInstance;
1236
+ });
1233
1237
  formInstance.starPosition = starPosition;
1234
1238
  var _formInstance = formInstance, setCallback = _formInstance.setCallback, submit = _formInstance.submit, resetFields = _formInstance.resetFields, setInitialValues = _formInstance.setInitialValues;
1235
1239
  setCallback({
@@ -1254,14 +1258,17 @@ var Form = function Form2(props) {
1254
1258
  e.stopPropagation();
1255
1259
  resetFields();
1256
1260
  }
1257
- }, React__default.createElement(Cell.Group, null, React__default.createElement(Context.Provider, {
1261
+ }, React__default.createElement(Cell.Group, {
1262
+ divider
1263
+ }, React__default.createElement(Context.Provider, {
1258
1264
  value: formInstance
1259
1265
  }, children), footer ? React__default.createElement(Cell, null, footer) : null));
1260
- };
1266
+ });
1261
1267
  Form.defaultProps = defaultProps;
1262
1268
  Form.displayName = "NutForm";
1263
- Form.Item = FormItem;
1264
- Form.useForm = useForm;
1269
+ var InnerForm = Form;
1270
+ InnerForm.Item = FormItem;
1271
+ InnerForm.useForm = useForm;
1265
1272
  export {
1266
- Form as default
1273
+ InnerForm as default
1267
1274
  };
@@ -25,7 +25,7 @@ function _objectSpread(target) {
25
25
  import React__default from "react";
26
26
  import classNames from "classnames";
27
27
  import Popup from "./Popup.js";
28
- import { h as handleClick, O as OffsetContext } from "./context.js";
28
+ import { h as handleClick, O as OffsetContext } from "./context2.js";
29
29
  import { C as ComponentDefaults } from "./typings.js";
30
30
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
31
31
  position: "left",
package/dist/esm/Step.js CHANGED
@@ -24,7 +24,7 @@ function _objectSpread(target) {
24
24
  }
25
25
  import React__default, { useContext } from "react";
26
26
  import classNames from "classnames";
27
- import { D as DataContext } from "./context3.js";
27
+ import { D as DataContext } from "./context4.js";
28
28
  import { C as ComponentDefaults } from "./typings.js";
29
29
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
30
30
  title: "",
package/dist/esm/Steps.js CHANGED
@@ -24,7 +24,7 @@ function _objectSpread(target) {
24
24
  }
25
25
  import React__default from "react";
26
26
  import classNames from "classnames";
27
- import { D as DataContext } from "./context3.js";
27
+ import { D as DataContext } from "./context4.js";
28
28
  import { C as ComponentDefaults } from "./typings.js";
29
29
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
30
30
  value: 0,
@@ -23,7 +23,7 @@ function _objectSpread(target) {
23
23
  return target;
24
24
  }
25
25
  import React__default, { useContext, useRef, useCallback, useEffect } from "react";
26
- import { O as OffsetContext, h as handleClick } from "./context.js";
26
+ import { O as OffsetContext, h as handleClick } from "./context2.js";
27
27
  var defaultProps = {
28
28
  open: true
29
29
  };
@@ -26,7 +26,7 @@ function _objectSpread(target) {
26
26
  }
27
27
  import React__default, { useRef, useState, useMemo, useEffect } from "react";
28
28
  import classNames from "classnames";
29
- import { D as DataContext } from "./context4.js";
29
+ import { D as DataContext } from "./context5.js";
30
30
  import { g as getRect } from "./use-client-rect.js";
31
31
  import Indicator from "./Indicator.js";
32
32
  import SwiperItem from "./SwiperItem.js";
@@ -22,7 +22,7 @@ function _objectSpread(target) {
22
22
  }
23
23
  import React__default, { useContext } from "react";
24
24
  import classNames from "classnames";
25
- import { D as DataContext } from "./context4.js";
25
+ import { D as DataContext } from "./context5.js";
26
26
  var defaultProps = {
27
27
  direction: "horizontal"
28
28
  };
@@ -1,19 +1,5 @@
1
1
  import { createContext } from "react";
2
- var handleClick = function handleClick2(e) {
3
- e.stopPropagation();
4
- var isIcon = e.target.className.includes("arrow-icon");
5
- var isTitle = e.target.className.includes("__title") || isIcon;
6
- var currentClass = e.currentTarget.className;
7
- var isShow = currentClass.includes("sidenavbar-show");
8
- var arrowIcon = e.currentTarget.querySelector(".arrow-icon");
9
- var iconClass = arrowIcon.className;
10
- if (isTitle) {
11
- e.currentTarget.className = isShow ? currentClass.replace("sidenavbar-show", "sidenavbar-hide") : currentClass.replace("sidenavbar-hide", "sidenavbar-show");
12
- arrowIcon.className = isShow ? iconClass.replace("arrow-down", "arrow-up") : iconClass.replace("arrow-up", "arrow-down");
13
- }
14
- };
15
- var OffsetContext = createContext(20);
2
+ var CellGroupContext = createContext(null);
16
3
  export {
17
- OffsetContext as O,
18
- handleClick as h
4
+ CellGroupContext as C
19
5
  };
@@ -1,5 +1,19 @@
1
1
  import { createContext } from "react";
2
- var AvatarContext = createContext({});
2
+ var handleClick = function handleClick2(e) {
3
+ e.stopPropagation();
4
+ var isIcon = e.target.className.includes("arrow-icon");
5
+ var isTitle = e.target.className.includes("__title") || isIcon;
6
+ var currentClass = e.currentTarget.className;
7
+ var isShow = currentClass.includes("sidenavbar-show");
8
+ var arrowIcon = e.currentTarget.querySelector(".arrow-icon");
9
+ var iconClass = arrowIcon.className;
10
+ if (isTitle) {
11
+ e.currentTarget.className = isShow ? currentClass.replace("sidenavbar-show", "sidenavbar-hide") : currentClass.replace("sidenavbar-hide", "sidenavbar-show");
12
+ arrowIcon.className = isShow ? iconClass.replace("arrow-down", "arrow-up") : iconClass.replace("arrow-up", "arrow-down");
13
+ }
14
+ };
15
+ var OffsetContext = createContext(20);
3
16
  export {
4
- AvatarContext as A
17
+ OffsetContext as O,
18
+ handleClick as h
5
19
  };
@@ -1,5 +1,5 @@
1
1
  import { createContext } from "react";
2
- var DataContext = createContext({});
2
+ var AvatarContext = createContext({});
3
3
  export {
4
- DataContext as D
4
+ AvatarContext as A
5
5
  };
@@ -0,0 +1,5 @@
1
+ import { createContext } from "react";
2
+ var DataContext = createContext({});
3
+ export {
4
+ DataContext as D
5
+ };
@@ -23,7 +23,7 @@ function _objectSpread(target) {
23
23
  }
24
24
  return target;
25
25
  }
26
- import React__default, { useState, useEffect } from "react";
26
+ import React__default, { useState, useRef, useEffect } from "react";
27
27
  import { CSSTransition } from "react-transition-group";
28
28
  import classNames from "classnames";
29
29
  import { C as ComponentDefaults } from "./typings.js";
@@ -40,6 +40,7 @@ var Overlay = function Overlay2(props) {
40
40
  var _defaultOverlayProps$ = _objectSpread(_objectSpread({}, defaultOverlayProps), props), children = _defaultOverlayProps$.children, zIndex = _defaultOverlayProps$.zIndex, duration = _defaultOverlayProps$.duration, className = _defaultOverlayProps$.className, closeOnOverlayClick = _defaultOverlayProps$.closeOnOverlayClick, visible = _defaultOverlayProps$.visible, lockScroll = _defaultOverlayProps$.lockScroll, style = _defaultOverlayProps$.style, afterShow = _defaultOverlayProps$.afterShow, afterClose = _defaultOverlayProps$.afterClose, onClick2 = _defaultOverlayProps$.onClick, rest = _objectWithoutProperties(_defaultOverlayProps$, _excluded);
41
41
  var _useState = useState(visible), _useState2 = _slicedToArray(_useState, 2), innerVisible = _useState2[0], setInnerVisible = _useState2[1];
42
42
  var classPrefix = "nut-overlay";
43
+ var nodeRef = useRef(null);
43
44
  useEffect(function() {
44
45
  if (visible) {
45
46
  setInnerVisible(true);
@@ -74,6 +75,7 @@ var Overlay = function Overlay2(props) {
74
75
  afterClose && afterClose();
75
76
  };
76
77
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(CSSTransition, {
78
+ nodeRef,
77
79
  classNames: "".concat(classPrefix, "-slide"),
78
80
  unmountOnExit: true,
79
81
  timeout: duration,
@@ -81,6 +83,7 @@ var Overlay = function Overlay2(props) {
81
83
  onEntered: onHandleOpened,
82
84
  onExited: onHandleClosed
83
85
  }, React__default.createElement("div", _objectSpread(_objectSpread({
86
+ ref: nodeRef,
84
87
  className: classes,
85
88
  style: styles
86
89
  }, rest), {}, {
@@ -56,6 +56,7 @@ var _zIndex = 1e3;
56
56
  var Popup = function Popup2(props) {
57
57
  var _classNames, _classNames2;
58
58
  var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), children = _defaultProps$props.children, visible = _defaultProps$props.visible, overlay = _defaultProps$props.overlay, closeOnOverlayClick = _defaultProps$props.closeOnOverlayClick, overlayStyle = _defaultProps$props.overlayStyle, overlayClassName = _defaultProps$props.overlayClassName, zIndex = _defaultProps$props.zIndex, lockScroll = _defaultProps$props.lockScroll, duration = _defaultProps$props.duration, closeable = _defaultProps$props.closeable, closeIconPosition = _defaultProps$props.closeIconPosition, closeIcon = _defaultProps$props.closeIcon, left = _defaultProps$props.left, title = _defaultProps$props.title, style = _defaultProps$props.style, transition = _defaultProps$props.transition, round = _defaultProps$props.round, position = _defaultProps$props.position, className = _defaultProps$props.className, destroyOnClose = _defaultProps$props.destroyOnClose, portal = _defaultProps$props.portal, onOpen2 = _defaultProps$props.onOpen, onClose2 = _defaultProps$props.onClose, onOverlayClick2 = _defaultProps$props.onOverlayClick, onCloseIconClick2 = _defaultProps$props.onCloseIconClick, afterShow = _defaultProps$props.afterShow, afterClose = _defaultProps$props.afterClose, onClick = _defaultProps$props.onClick;
59
+ var nodeRef = React__default.useRef(null);
59
60
  var _useState = useState(zIndex || _zIndex), _useState2 = _slicedToArray(_useState, 2), index = _useState2[0], setIndex = _useState2[1];
60
61
  var _useState3 = useState(visible), _useState4 = _slicedToArray(_useState3, 2), innerVisible = _useState4[0], setInnerVisible = _useState4[1];
61
62
  var _useState5 = useState(true), _useState6 = _slicedToArray(_useState5, 2), showChildren = _useState6[0], setShowChildren = _useState6[1];
@@ -145,6 +146,7 @@ var Popup = function Popup2(props) {
145
146
  };
146
147
  var renderPop = function renderPop2() {
147
148
  return React__default.createElement(CSSTransition, {
149
+ nodeRef,
148
150
  classNames: transitionName,
149
151
  unmountOnExit: true,
150
152
  timeout: duration,
@@ -152,6 +154,7 @@ var Popup = function Popup2(props) {
152
154
  onEntered: onHandleOpened,
153
155
  onExited: onHandleClosed
154
156
  }, React__default.createElement("div", {
157
+ ref: nodeRef,
155
158
  style: popStyles,
156
159
  className: popClassName,
157
160
  onClick: onHandleClick
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const CellGroupContext: import("react").Context<{
3
+ divider: boolean;
4
+ } | null>;
5
+ export default CellGroupContext;
@@ -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
- interface ContentProps {
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, { FunctionComponent, ReactNode } from 'react';
2
- import { useForm } from './useform';
1
+ import React, { ReactNode } from 'react';
3
2
  import { BasicComponent } from '@/utils/typings';
4
- import { FormItem } from '../formitem/formitem';
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: FunctionComponent<Partial<FormProps> & React.HTMLAttributes<HTMLFormElement>> & {
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, { FunctionComponent, ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { BasicComponent } from '@/utils/typings';
3
- import { useForm } from './useform.taro';
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: FunctionComponent<Partial<FormProps> & React.HTMLAttributes<HTMLFormElement>> & {
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 { Form } from './form';
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
- export default Form;
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 { Form } from './form.taro';
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
- export default Form;
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 { TouchEvent, MouseEvent } from 'react';
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: TouchEvent<HTMLDivElement>) => void;
33
- onTouchEnd?: (event: TouchEvent<HTMLDivElement>) => void;
34
- onTouchMove?: (event: TouchEvent<HTMLDivElement>) => void;
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: string): string;
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;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.16 Wed Sep 06 2023 15:54:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.16 Wed Sep 06 2023 15:54:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.16 Wed Sep 06 2023 15:54:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.16 Wed Sep 06 2023 15:54:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.16 Wed Sep 06 2023 15:54:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.16 Wed Sep 06 2023 15:54:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.16 Wed Sep 06 2023 15:54:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */