@nutui/nutui-react-taro 2.0.0-alpha.16 → 2.0.0-alpha.18

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 (160) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/ActionSheet/style/style.css +1 -1
  3. package/dist/esm/ActionSheet.js +2 -2
  4. package/dist/esm/Address.js +2 -2
  5. package/dist/esm/Audio.js +2 -2
  6. package/dist/esm/Avatar.js +2 -2
  7. package/dist/esm/Button.js +2 -1
  8. package/dist/esm/Calendar.js +2 -2
  9. package/dist/esm/Cascader.js +2 -2
  10. package/dist/esm/DatePicker.js +3 -3
  11. package/dist/esm/Dialog.js +3 -2
  12. package/dist/esm/Divider/style/style.css +1 -1
  13. package/dist/esm/Form/style/index.js +3 -1
  14. package/dist/esm/Form/style/style.css +1 -1
  15. package/dist/esm/Form.js +4 -4
  16. package/dist/esm/FormItem/style/index.js +1 -1
  17. package/dist/esm/FormItem/style/style.css +1 -1
  18. package/dist/esm/FormItem.js +1 -1
  19. package/dist/esm/ImagePreview.js +2 -2
  20. package/dist/esm/InputNumber/style/style.css +1 -1
  21. package/dist/esm/InputNumber.js +1 -1
  22. package/dist/esm/NumberKeyboard.js +2 -2
  23. package/dist/esm/Pagination/style/style.css +1 -1
  24. package/dist/esm/Picker.js +2 -2
  25. package/dist/esm/Popover.js +3 -3
  26. package/dist/esm/Popup.js +1 -1
  27. package/dist/esm/SearchBar.js +1 -1
  28. package/dist/esm/ShortPassword.js +2 -2
  29. package/dist/esm/SideNavBar.js +2 -2
  30. package/dist/esm/Skeleton.js +3 -3
  31. package/dist/esm/Swipe.js +2 -3
  32. package/dist/esm/Tabbar/style/style.css +1 -1
  33. package/dist/esm/Tabbar.js +2 -2
  34. package/dist/esm/TabbarItem/style/index.js +1 -1
  35. package/dist/esm/TabbarItem/style/style.css +1 -1
  36. package/dist/esm/TabbarItem.js +1 -1
  37. package/dist/esm/TimeSelect.js +2 -2
  38. package/dist/esm/Uploader.js +2 -2
  39. package/dist/esm/{actionsheet.taro-697a594b.js → actionsheet.taro-8e7cbd0f.js} +1 -1
  40. package/dist/esm/{address.taro-cc879a1d.js → address.taro-3cfe1767.js} +1 -1
  41. package/dist/esm/{audio.taro-64b15071.js → audio.taro-09305bcb.js} +1 -1
  42. package/dist/esm/{button.taro-01eae688.js → button.taro-60dfd83e.js} +18 -7
  43. package/dist/esm/{calendar.taro-02195ddb.js → calendar.taro-3568a214.js} +1 -1
  44. package/dist/esm/{cascader.taro-fb7a0230.js → cascader.taro-91cf3ca6.js} +1 -1
  45. package/dist/esm/{datepicker.taro-b480d072.js → datepicker.taro-108eb7c8.js} +1 -1
  46. package/dist/esm/{dialog.taro-e5c2cb03.js → dialog.taro-2de109c0.js} +1 -1
  47. package/dist/esm/form.taro-33a19e85.js +1275 -0
  48. package/dist/esm/formitem.taro-c9ded1ef.js +139 -0
  49. package/dist/esm/{imagepreview.taro-cfe0a4cc.js → imagepreview.taro-29717406.js} +1 -1
  50. package/dist/esm/{inputnumber.taro-6657d2c1.js → inputnumber.taro-c4c0cfb3.js} +5 -5
  51. package/dist/esm/{numberkeyboard.taro-18879f04.js → numberkeyboard.taro-ee984036.js} +1 -1
  52. package/dist/esm/nutui-react.es.js +27 -27
  53. package/dist/esm/{picker.taro-3781a455.js → picker.taro-9ca039c4.js} +54 -27
  54. package/dist/esm/{popover.taro-ba6c323a.js → popover.taro-52c02926.js} +12 -12
  55. package/dist/esm/{popup.taro-e756f3fc.js → popup.taro-687437a0.js} +1 -0
  56. package/dist/esm/{searchbar.taro-39351331.js → searchbar.taro-b2d6eff2.js} +2 -2
  57. package/dist/esm/{shortpassword.taro-cff61e4e.js → shortpassword.taro-4f714afb.js} +1 -1
  58. package/dist/esm/{sidenavbar.taro-1aefdd3c.js → sidenavbar.taro-03fb1fc6.js} +1 -1
  59. package/dist/esm/{skeleton.taro-ce714b06.js → skeleton.taro-e29f9f0c.js} +1 -1
  60. package/dist/esm/{swipe.taro-966af6d3.js → swipe.taro-4eb0cc9a.js} +6 -5
  61. package/dist/esm/{tabbar.taro-18eee41f.js → tabbar.taro-4f49ed90.js} +1 -1
  62. package/dist/esm/{tabbaritem.taro-89646ca1.js → tabbaritem.taro-16a380db.js} +16 -5
  63. package/dist/esm/{timeselect.taro-9e37e648.js → timeselect.taro-9de6ab39.js} +1 -1
  64. package/dist/esm/types/src/packages/button/button.d.ts +1 -0
  65. package/dist/esm/types/src/packages/elevator/elevator.d.ts +0 -1
  66. package/dist/esm/types/src/packages/elevator/elevator.taro.d.ts +0 -1
  67. package/dist/esm/types/src/packages/form/__tests__/form.spec.d.ts +1 -0
  68. package/dist/esm/types/src/packages/form/context.d.ts +4 -0
  69. package/dist/esm/types/src/packages/form/form.d.ts +11 -4
  70. package/dist/esm/types/src/packages/form/form.taro.d.ts +14 -4
  71. package/dist/esm/types/src/packages/form/index.d.ts +1 -0
  72. package/dist/esm/types/src/packages/form/index.taro.d.ts +1 -0
  73. package/dist/esm/types/src/packages/form/types.d.ts +4 -52
  74. package/dist/esm/types/src/packages/formitem/formitem.d.ts +16 -15
  75. package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +16 -12
  76. package/dist/esm/types/src/packages/formitem/index.d.ts +1 -0
  77. package/dist/esm/types/src/packages/formitem/index.taro.d.ts +1 -0
  78. package/dist/esm/types/src/packages/formitem/types.d.ts +1 -31
  79. package/dist/esm/types/src/packages/inputnumber/inputnumber.d.ts +1 -1
  80. package/dist/esm/types/src/packages/inputnumber/inputnumber.taro.d.ts +1 -1
  81. package/dist/esm/types/src/packages/picker/picker.d.ts +7 -2
  82. package/dist/esm/types/src/packages/picker/picker.taro.d.ts +7 -2
  83. package/dist/esm/types/src/packages/sticky/sticky.d.ts +0 -1
  84. package/dist/esm/types/src/packages/swipe/swipe.d.ts +2 -6
  85. package/dist/esm/types/src/packages/swipe/swipe.taro.d.ts +2 -6
  86. package/dist/esm/types/src/packages/tabbaritem/tabbaritem.d.ts +7 -2
  87. package/dist/esm/types/src/packages/tabbaritem/tabbaritem.taro.d.ts +7 -2
  88. package/dist/esm/types/src/utils/is-forward-ref-component.d.ts +1 -0
  89. package/dist/esm/{uploader.taro-5ad88f83.js → uploader.taro-13591ac2.js} +1 -1
  90. package/dist/locales/base.js +1 -1
  91. package/dist/locales/en-US.js +1 -1
  92. package/dist/locales/id-ID.js +1 -1
  93. package/dist/locales/tr-TR.js +1 -1
  94. package/dist/locales/zh-CN.js +1 -1
  95. package/dist/locales/zh-TW.js +1 -1
  96. package/dist/locales/zh-UG.js +1 -1
  97. package/dist/nutui.react.es.js +1689 -502
  98. package/dist/nutui.react.umd.js +1734 -547
  99. package/dist/packages/actionsheet/actionsheet.scss +6 -6
  100. package/dist/packages/divider/divider.scss +8 -7
  101. package/dist/packages/formitem/formitem.scss +1 -13
  102. package/dist/packages/inputnumber/inputnumber.scss +4 -2
  103. package/dist/packages/layout/layout.scss +0 -2
  104. package/dist/packages/pagination/pagination.scss +8 -30
  105. package/dist/packages/tabbaritem/tabbaritem.scss +1 -0
  106. package/dist/style.css +1 -1
  107. package/dist/style.mjs +1 -1
  108. package/dist/types/packages/animate/animate.taro.d.ts +3 -3
  109. package/dist/types/packages/audio/audio.taro.d.ts +28 -8
  110. package/dist/types/packages/avatar/avatar.taro.d.ts +4 -4
  111. package/dist/types/packages/avatargroup/avatargroup.taro.d.ts +5 -5
  112. package/dist/types/packages/button/button.taro.d.ts +4 -4
  113. package/dist/types/packages/cascader/cascader.taro.d.ts +4 -4
  114. package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +3 -3
  115. package/dist/types/packages/datepicker/datepicker.taro.d.ts +75 -15
  116. package/dist/types/packages/divider/divider.taro.d.ts +2 -2
  117. package/dist/types/packages/drag/drag.taro.d.ts +1 -1
  118. package/dist/types/packages/elevator/elevator.taro.d.ts +0 -1
  119. package/dist/types/packages/empty/empty.taro.d.ts +3 -3
  120. package/dist/types/packages/fixednav/fixednav.taro.d.ts +3 -3
  121. package/dist/types/packages/form/context.d.ts +3 -0
  122. package/dist/types/packages/form/form.taro.d.ts +46 -4
  123. package/dist/types/packages/form/index.taro.d.ts +1 -0
  124. package/dist/types/packages/form/types.d.ts +4 -52
  125. package/dist/types/packages/formitem/formitem.taro.d.ts +45 -13
  126. package/dist/types/packages/formitem/index.taro.d.ts +1 -0
  127. package/dist/types/packages/formitem/types.d.ts +1 -31
  128. package/dist/types/packages/grid/grid.taro.d.ts +1 -1
  129. package/dist/types/packages/infiniteloading/infiniteloading.taro.d.ts +1 -1
  130. package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +1 -1
  131. package/dist/types/packages/noticebar/noticebar.taro.d.ts +3 -3
  132. package/dist/types/packages/overlay/overlay.taro.d.ts +1 -1
  133. package/dist/types/packages/picker/picker.d.ts +7 -2
  134. package/dist/types/packages/picker/picker.taro.d.ts +7 -2
  135. package/dist/types/packages/popover/popover.taro.d.ts +5 -5
  136. package/dist/types/packages/popup/popup.taro.d.ts +2 -2
  137. package/dist/types/packages/radio/radio.taro.d.ts +2 -2
  138. package/dist/types/packages/range/range.taro.d.ts +3 -3
  139. package/dist/types/packages/searchbar/searchbar.taro.d.ts +5 -5
  140. package/dist/types/packages/step/step.taro.d.ts +3 -3
  141. package/dist/types/packages/steps/steps.taro.d.ts +1 -1
  142. package/dist/types/packages/sticky/sticky.taro.d.ts +1 -1
  143. package/dist/types/packages/swipe/swipe.taro.d.ts +2 -6
  144. package/dist/types/packages/swiper/swiper.taro.d.ts +1 -1
  145. package/dist/types/packages/tabbaritem/tabbaritem.taro.d.ts +27 -2
  146. package/dist/types/packages/tabs/tabs.taro.d.ts +1 -1
  147. package/dist/types/packages/tag/tag.taro.d.ts +1 -1
  148. package/dist/types/packages/timeselect/timeselect.taro.d.ts +2 -2
  149. package/dist/types/packages/toast/toast.taro.d.ts +4 -4
  150. package/dist/types/packages/uploader/uploader.taro.d.ts +18 -18
  151. package/dist/types/utils/is-forward-ref-component.d.ts +1 -0
  152. package/package.json +1 -1
  153. package/dist/esm/form.taro-b06754e8.js +0 -182
  154. package/dist/esm/formitem.taro-b326809d.js +0 -108
  155. package/dist/esm/types/src/packages/formitem/formitemcontext.d.ts +0 -6
  156. package/dist/types/packages/formitem/formitemcontext.d.ts +0 -5
  157. package/dist/esm/{avatar.taro-8a26cd6c.js → avatar.taro-9ab097d0.js} +1 -1
  158. /package/dist/esm/types/src/packages/form/{useForm.d.ts → useform.d.ts} +0 -0
  159. /package/dist/esm/types/src/packages/form/{useForm.taro.d.ts → useform.taro.d.ts} +0 -0
  160. /package/dist/types/packages/form/{useForm.taro.d.ts → useform.taro.d.ts} +0 -0
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import classNames from "classnames";
3
3
  import { C as ComponentDefaults } from "./typings-11d83a22.js";
4
4
  import { u as usePropsValue } from "./use-props-value-7ac1b1b5.js";
5
- import { T as TabbarItem } from "./tabbaritem.taro-89646ca1.js";
5
+ import { T as TabbarItem } from "./tabbaritem.taro-16a380db.js";
6
6
  const defaultProps = {
7
7
  ...ComponentDefaults,
8
8
  defaultValue: 0,
@@ -8,11 +8,14 @@ const defaultProps = {
8
8
  icon: null,
9
9
  active: false,
10
10
  index: 0,
11
- handleClick: (idx) => {
12
- }
11
+ value: "",
12
+ dot: false,
13
+ max: 99,
14
+ top: "0",
15
+ right: "5"
13
16
  };
14
17
  const TabbarItem = (props) => {
15
- const { className, style, title, icon, active, activeColor, inactiveColor, index, handleClick, ...rest } = {
18
+ const { className, style, title, icon, active, activeColor, inactiveColor, index, value, dot, max, top, right, handleClick } = {
16
19
  ...defaultProps,
17
20
  ...props
18
21
  };
@@ -24,6 +27,14 @@ const TabbarItem = (props) => {
24
27
  const titleClass = classNames(boxPrefix, `${boxPrefix}-nav`, {
25
28
  [`${boxPrefix}-large`]: !icon
26
29
  });
30
+ const badgeProps = {
31
+ value,
32
+ dot,
33
+ max,
34
+ top,
35
+ right,
36
+ color: activeColor
37
+ };
27
38
  return React.createElement("div", { className: tabbarItemClass, style: {
28
39
  color: active ? activeColor : inactiveColor,
29
40
  ...style
@@ -32,13 +43,13 @@ const TabbarItem = (props) => {
32
43
  null,
33
44
  React.createElement(
34
45
  Badge,
35
- { ...rest },
46
+ { ...badgeProps },
36
47
  React.createElement("div", { className: boxPrefix }, icon)
37
48
  ),
38
49
  React.createElement("div", { className: titleClass }, title)
39
50
  ) : React.createElement(
40
51
  Badge,
41
- { ...rest },
52
+ { ...badgeProps },
42
53
  React.createElement("div", { className: titleClass }, title)
43
54
  ));
44
55
  };
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import classNames from "classnames";
3
- import { P as Popup } from "./popup.taro-e756f3fc.js";
3
+ import { P as Popup } from "./popup.taro-687437a0.js";
4
4
  import { T as TimeDetail } from "./timedetail.taro-d7aa4c1b.js";
5
5
  import { C as ComponentDefaults } from "./typings-11d83a22.js";
6
6
  import { u as useConfig } from "./configprovider.taro-372b1525.js";
@@ -15,6 +15,7 @@ export interface ButtonProps extends BasicComponent {
15
15
  disabled: boolean;
16
16
  icon: React.ReactNode;
17
17
  id: string;
18
+ nativeType: 'submit' | 'reset' | 'button';
18
19
  onClick: (e: MouseEvent) => void;
19
20
  }
20
21
  export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
@@ -9,7 +9,6 @@ export interface ElevatorProps extends BasicComponent {
9
9
  spaceHeight: number;
10
10
  titleHeight: number;
11
11
  showKeys: boolean;
12
- children: React.ReactNode;
13
12
  onClickItem: (key: string, item: ElevatorData) => void;
14
13
  onClickIndex: (key: string) => void;
15
14
  }
@@ -9,7 +9,6 @@ export interface ElevatorProps extends BasicComponent {
9
9
  spaceHeight: number;
10
10
  titleHeight: number;
11
11
  showKeys: boolean;
12
- children: React.ReactNode;
13
12
  onClickItem: (key: string, item: ElevatorData) => void;
14
13
  onClickIndex: (key: string) => void;
15
14
  }
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const Context: import("react").Context<{
3
+ [key: string]: any;
4
+ }>;
@@ -1,9 +1,16 @@
1
- import React, { FunctionComponent } from 'react';
2
- import { useForm } from './useForm';
1
+ import React, { FunctionComponent, ReactNode } from 'react';
2
+ import { useForm } from './useform';
3
3
  import { BasicComponent } from '@/utils/typings';
4
4
  import { FormItem } from '../formitem/formitem';
5
- import { BaseForm } from './types';
6
- export interface FormProps extends BasicComponent, BaseForm {
5
+ export interface FormProps extends BasicComponent {
6
+ footer: ReactNode;
7
+ initialValues: any;
8
+ name: string;
9
+ form: any;
10
+ labelPosition: 'top' | 'left' | 'right';
11
+ starPosition: 'left' | 'right';
12
+ onFinish: (values: any) => void;
13
+ onFinishFailed: (values: any, errorFields: any) => void;
7
14
  }
8
15
  export declare const Form: FunctionComponent<Partial<FormProps> & React.HTMLAttributes<HTMLFormElement>> & {
9
16
  Item: typeof FormItem;
@@ -1,9 +1,19 @@
1
- import React, { FunctionComponent } from 'react';
1
+ import React, { FunctionComponent, ReactNode } from 'react';
2
2
  import { BasicComponent } from '@/utils/typings';
3
- import FormItem from '@/packages/formitem/index.taro';
4
- import { BaseForm } from './types';
5
- export interface FormProps extends BasicComponent, BaseForm {
3
+ import { useForm } from './useform.taro';
4
+ import { FormItem } from '../formitem/formitem.taro';
5
+ export interface FormProps extends BasicComponent {
6
+ footer: ReactNode;
7
+ initialValues: any;
8
+ name: string;
9
+ form: any;
10
+ labelPosition: 'top' | 'left' | 'right';
11
+ starPosition: 'left' | 'right';
12
+ onFinish: (values: any) => void;
13
+ onFinishFailed: (values: any, errorFields: any) => void;
6
14
  }
7
15
  export declare const Form: FunctionComponent<Partial<FormProps> & React.HTMLAttributes<HTMLFormElement>> & {
8
16
  Item: typeof FormItem;
17
+ } & {
18
+ useForm: typeof useForm;
9
19
  };
@@ -1,2 +1,3 @@
1
1
  import { Form } from './form';
2
+ export type { FormItemRuleWithoutValidator, StoreValue, NamePath, FormInstance, FieldEntity, } from './types';
2
3
  export default Form;
@@ -1,2 +1,3 @@
1
1
  import { Form } from './form.taro';
2
+ export type { FormItemRuleWithoutValidator, StoreValue, NamePath, FormInstance, FieldEntity, } from './types';
2
3
  export default Form;
@@ -1,63 +1,18 @@
1
- export interface BaseForm {
2
- /**
3
- * 经 Form.useForm() 创建的 form 控制实例,不提供时会自动创建
4
- */
5
- form: any;
6
- /**
7
- * label的位置
8
- * 可选值 top/left/right
9
- */
10
- labelPosition: string | number;
11
- /**
12
- * 表单分组名称
13
- */
14
- formGroupTitle: string;
15
- starPositon: string;
16
- /**
17
- * 表单校验成功回调
18
- */
19
- onFinish: (obj: object) => void;
20
- /**
21
- * 表单校验失败回调
22
- */
23
- onFinishFailed: (value: []) => void;
24
- }
25
1
  export interface FormItemRuleWithoutValidator {
26
2
  [key: string]: any;
27
3
  regex?: RegExp;
28
4
  required?: boolean;
29
5
  message?: string;
30
6
  }
31
- export interface FormItemRule extends FormItemRuleWithoutValidator {
32
- validator?: (value: any, ruleCfg: FormItemRuleWithoutValidator) => boolean | string | Promise<boolean | string>;
33
- }
34
- export interface BaseFormField {
35
- /**
36
- * 字段名
37
- */
38
- name: string;
39
- /**
40
- * label 标签的文本
41
- */
42
- label: string;
43
- /**
44
- * 校验规则,设置字段的校验逻辑
45
- */
46
- rules: FormItemRule[];
47
- /**
48
- * 是否禁用表单项
49
- */
50
- disabled: boolean;
51
- }
52
- export type StoreValue = string | number;
7
+ export type StoreValue = any;
53
8
  export type NamePath = string | number;
54
9
  export interface Callbacks<Values = any> {
55
10
  onValuesChange?: (values: Values) => void;
56
11
  onFinish?: (values: Values) => void;
57
- onFinishFailed?: (Values: Values) => void;
12
+ onFinishFailed?: (values: Values, errorFields: any) => void;
58
13
  }
59
14
  export interface Store {
60
- [name: string]: StoreValue;
15
+ [name: string]: any;
61
16
  }
62
17
  export interface FormInstance<Values = any> {
63
18
  registerField: (entity: FieldEntity) => () => void;
@@ -68,7 +23,7 @@ export interface FormInstance<Values = any> {
68
23
  setCallback: (callbacks: Callbacks) => void;
69
24
  }
70
25
  export interface FieldEntity {
71
- onStoreChange: () => void;
26
+ onStoreChange: (type?: string) => void;
72
27
  getNamePath: () => NamePath;
73
28
  props: {
74
29
  name: NamePath;
@@ -77,6 +32,3 @@ export interface FieldEntity {
77
32
  initialValue?: any;
78
33
  };
79
34
  }
80
- export interface IDescriptor {
81
- [name: string]: string;
82
- }
@@ -1,33 +1,34 @@
1
1
  import React from 'react';
2
2
  import { BaseFormField } from './types';
3
- import { FormItemContext } from './formitemcontext';
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
6
  export interface FormItemProps extends BasicComponent, BaseFormField {
7
- labelWidth: string | number;
7
+ required: boolean;
8
+ initialValue: any;
9
+ trigger: string;
10
+ valuePropName: string;
11
+ getValueFromEvent: (...args: any) => any;
12
+ onClick: (event: React.MouseEvent, componentRef: React.MutableRefObject<any>) => void;
8
13
  errorMessageAlign: TextAlign;
9
- showErrorLine: boolean;
10
- showErrorMessage: boolean;
11
- initialValue: string;
12
14
  }
13
15
  declare const defaultProps: FormItemProps;
14
16
  export type FieldProps = typeof defaultProps & Partial<BaseFormField>;
15
- export declare class FormItem extends React.Component<FieldProps> {
17
+ export declare class FormItem extends React.Component<FieldProps, {
18
+ resetCount: number;
19
+ }> {
16
20
  static defaultProps: FormItemProps;
17
21
  static contextType: any;
18
- context: React.ContextType<typeof FormItemContext>;
22
+ context: React.ContextType<typeof Context>;
19
23
  private cancelRegister;
20
- private isInitialValue;
24
+ private componentRef;
25
+ constructor(props: FieldProps);
21
26
  componentDidMount(): void;
22
27
  componentWillUnmount(): void;
23
- getControlled: (children: React.ReactElement) => {
24
- value: any;
25
- defaultValue: any;
26
- onChange: (event: React.ChangeEvent<HTMLInputElement> | number | string | string[]) => void;
27
- };
28
- onStoreChange: () => void;
28
+ getControlled: (children: React.ReactElement) => any;
29
+ refresh: () => void;
30
+ onStoreChange: (type?: string) => void;
29
31
  renderLayout: (childNode: React.ReactNode) => JSX.Element;
30
- pxCheck: (value: string | number) => string;
31
32
  render(): JSX.Element;
32
33
  }
33
34
  export {};
@@ -1,30 +1,34 @@
1
1
  import React from 'react';
2
2
  import { BaseFormField } from './types';
3
- import { FormItemContext } from './formitemcontext';
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
6
  export interface FormItemProps extends BasicComponent, BaseFormField {
7
- labelWidth: string | number;
7
+ required: boolean;
8
+ initialValue: any;
9
+ trigger: string;
10
+ valuePropName: string;
11
+ getValueFromEvent: (...args: any) => any;
12
+ onClick: (event: React.MouseEvent, componentRef: React.MutableRefObject<any>) => void;
8
13
  errorMessageAlign: TextAlign;
9
- showErrorLine: boolean;
10
- showErrorMessage: boolean;
11
14
  }
12
15
  declare const defaultProps: FormItemProps;
13
16
  export type FieldProps = typeof defaultProps & Partial<BaseFormField>;
14
- export declare class FormItem extends React.Component<FieldProps> {
17
+ export declare class FormItem extends React.Component<FieldProps, {
18
+ resetCount: number;
19
+ }> {
15
20
  static defaultProps: FormItemProps;
16
21
  static contextType: any;
17
- context: React.ContextType<typeof FormItemContext>;
22
+ context: React.ContextType<typeof Context>;
18
23
  private cancelRegister;
24
+ private componentRef;
25
+ constructor(props: FieldProps);
19
26
  componentDidMount(): void;
20
27
  componentWillUnmount(): void;
21
- getControlled: (children: React.ReactElement) => {
22
- value: any;
23
- onChange: (event: React.ChangeEvent<HTMLInputElement> | number | string | string[]) => void;
24
- };
25
- onStoreChange: () => void;
28
+ getControlled: (children: React.ReactElement) => any;
29
+ refresh: () => void;
30
+ onStoreChange: (type?: string) => void;
26
31
  renderLayout: (childNode: React.ReactNode) => JSX.Element;
27
- pxCheck: (value: string | number) => string;
28
32
  render(): JSX.Element;
29
33
  }
30
34
  export {};
@@ -1,2 +1,3 @@
1
1
  import { FormItem } from './formitem';
2
+ export type { FormItemRuleWithoutValidator, FormItemRule, FormInstance, } from './types';
2
3
  export default FormItem;
@@ -1,2 +1,3 @@
1
1
  import { FormItem } from './formitem.taro';
2
+ export type { FormItemRuleWithoutValidator, FormItemRule, FormInstance, } from './types';
2
3
  export default FormItem;
@@ -1,27 +1,3 @@
1
- export interface BaseForm {
2
- /**
3
- * 经 Form.useForm() 创建的 form 控制实例,不提供时会自动创建
4
- */
5
- form: any;
6
- /**
7
- * label的位置
8
- * 可选值 top/left/right
9
- */
10
- labelPosition: string | number;
11
- /**
12
- * 表单分组名称
13
- */
14
- formGroupTitle: string;
15
- starPositon: string;
16
- /**
17
- * 表单校验成功回调
18
- */
19
- onFinish: (obj: object) => void;
20
- /**
21
- * 表单校验失败回调
22
- */
23
- onFinishFailed: (value: []) => void;
24
- }
25
1
  export interface FormItemRuleWithoutValidator {
26
2
  [key: string]: any;
27
3
  regex?: RegExp;
@@ -49,16 +25,13 @@ export interface BaseFormField {
49
25
  */
50
26
  disabled: boolean;
51
27
  }
52
- export type StoreValue = string | number;
28
+ export type StoreValue = any;
53
29
  export type NamePath = string | number;
54
30
  export interface Callbacks<Values = any> {
55
31
  onValuesChange?: (values: Values) => void;
56
32
  onFinish?: (values: Values) => void;
57
33
  onFinishFailed?: (Values: Values) => void;
58
34
  }
59
- export interface Store {
60
- [name: string]: StoreValue;
61
- }
62
35
  export interface FormInstance<Values = any> {
63
36
  registerField: (entity: FieldEntity) => () => void;
64
37
  getFieldValue: (name: NamePath) => StoreValue;
@@ -77,6 +50,3 @@ export interface FieldEntity {
77
50
  initialValue?: any;
78
51
  };
79
52
  }
80
- export interface IDescriptor {
81
- [name: string]: string;
82
- }
@@ -4,7 +4,7 @@ export interface InputNumberProps extends BasicComponent {
4
4
  disabled: boolean;
5
5
  min: string | number;
6
6
  max: string | number;
7
- readonly: boolean;
7
+ readOnly: boolean;
8
8
  value: string | number;
9
9
  defaultValue: string | number;
10
10
  allowEmpty: boolean;
@@ -4,7 +4,7 @@ export interface InputNumberProps extends BasicComponent {
4
4
  disabled: boolean;
5
5
  min: string | number;
6
6
  max: string | number;
7
- readonly: boolean;
7
+ readOnly: boolean;
8
8
  value: string | number;
9
9
  defaultValue: string | number;
10
10
  allowEmpty: boolean;
@@ -1,8 +1,12 @@
1
1
  import React, { RefObject } from 'react';
2
2
  import { PickerOption } from './types';
3
3
  import { BasicComponent } from '@/utils/typings';
4
- export interface PickerProps extends BasicComponent {
5
- visible: boolean;
4
+ export type PickerActions = {
5
+ open: () => void;
6
+ close: () => void;
7
+ };
8
+ export interface PickerProps extends Omit<BasicComponent, 'children'> {
9
+ visible?: boolean | undefined;
6
10
  title?: string;
7
11
  options: (PickerOption | PickerOption[])[];
8
12
  value?: (number | string)[];
@@ -13,6 +17,7 @@ export interface PickerProps extends BasicComponent {
13
17
  onClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void;
14
18
  afterClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], pickerRef: RefObject<HTMLDivElement>) => void;
15
19
  onChange?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], columnIndex: number) => void;
20
+ children?: any;
16
21
  }
17
22
  declare const Picker: React.ForwardRefExoticComponent<Partial<PickerProps> & React.RefAttributes<unknown>>;
18
23
  export default Picker;
@@ -1,8 +1,12 @@
1
1
  import React, { RefObject } from 'react';
2
2
  import { PickerOption } from './types';
3
3
  import { BasicComponent } from '@/utils/typings';
4
- export interface PickerProps extends BasicComponent {
5
- visible: boolean;
4
+ export type PickerActions = {
5
+ open: () => void;
6
+ close: () => void;
7
+ };
8
+ export interface PickerProps extends Omit<BasicComponent, 'children'> {
9
+ visible?: boolean | undefined;
6
10
  title?: string;
7
11
  options: (PickerOption | PickerOption[])[];
8
12
  value?: (number | string)[];
@@ -13,6 +17,7 @@ export interface PickerProps extends BasicComponent {
13
17
  onClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void;
14
18
  afterClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], pickerRef: RefObject<HTMLDivElement>) => void;
15
19
  onChange?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], columnIndex: number) => void;
20
+ children?: any;
16
21
  }
17
22
  declare const Picker: React.ForwardRefExoticComponent<Partial<PickerProps> & React.RefAttributes<unknown>>;
18
23
  export default Picker;
@@ -5,7 +5,6 @@ export interface StickyProps extends BasicComponent {
5
5
  position: 'top' | 'bottom';
6
6
  threshold: number;
7
7
  zIndex: number;
8
- children: React.ReactNode;
9
8
  onChange: (val: boolean) => void;
10
9
  }
11
10
  export declare const Sticky: FunctionComponent<Partial<StickyProps>>;
@@ -1,14 +1,11 @@
1
1
  import React from 'react';
2
+ import { BasicComponent } from '@/utils/typings';
2
3
  export type SwipeSide = 'left' | 'right';
3
4
  export interface SwipeInstance {
4
5
  open: (side: SwipeSide) => void;
5
6
  close: () => void;
6
7
  }
7
- export interface SwipeProps {
8
- /** 自定义类名 */
9
- className: string;
10
- /** 自定义样式 */
11
- style: React.CSSProperties;
8
+ export interface SwipeProps extends BasicComponent {
12
9
  /** 标识符,可以在事件参数中获取到 */
13
10
  name?: string | number;
14
11
  /** 左侧滑动区域的内容 */
@@ -34,6 +31,5 @@ export interface SwipeProps {
34
31
  onTouchStart?: (event: Event) => void;
35
32
  onTouchEnd?: (event: Event) => void;
36
33
  onTouchMove?: (event: Event) => void;
37
- children?: React.ReactNode;
38
34
  }
39
35
  export declare const Swipe: React.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeInstance>>;
@@ -1,14 +1,11 @@
1
1
  import React from 'react';
2
+ import { BasicComponent } from '@/utils/typings';
2
3
  export type SwipeSide = 'left' | 'right';
3
4
  export interface SwipeInstance {
4
5
  open: (side: SwipeSide) => void;
5
6
  close: () => void;
6
7
  }
7
- export interface SwipeProps {
8
- /** 自定义类名 */
9
- className: string;
10
- /** 自定义样式 */
11
- style: React.CSSProperties;
8
+ export interface SwipeProps extends BasicComponent {
12
9
  /** 标识符,可以在事件参数中获取到 */
13
10
  name?: string | number;
14
11
  /** 左侧滑动区域的内容 */
@@ -34,6 +31,5 @@ export interface SwipeProps {
34
31
  onTouchStart?: (event: Event) => void;
35
32
  onTouchEnd?: (event: Event) => void;
36
33
  onTouchMove?: (event: Event) => void;
37
- children?: React.ReactNode;
38
34
  }
39
35
  export declare const Swipe: React.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeInstance>>;
@@ -1,12 +1,17 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
- import { BadgeProps } from '../badge/badge';
3
- export interface TabbarItemProps extends BadgeProps {
2
+ import { BasicComponent } from '@/utils/typings';
3
+ export interface TabbarItemProps extends BasicComponent {
4
4
  title: ReactNode;
5
5
  icon: ReactNode;
6
6
  active: boolean;
7
7
  activeColor: string;
8
8
  inactiveColor: string;
9
9
  index: number;
10
+ value: ReactNode;
11
+ dot: boolean;
12
+ max: number;
13
+ top: string;
14
+ right: string;
10
15
  handleClick: (idx: number) => void;
11
16
  }
12
17
  export declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
@@ -1,12 +1,17 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
- import { BadgeProps } from '../badge/badge.taro';
3
- export interface TabbarItemProps extends BadgeProps {
2
+ import { BasicComponent } from '@/utils/typings';
3
+ export interface TabbarItemProps extends BasicComponent {
4
4
  title: ReactNode;
5
5
  icon: ReactNode;
6
6
  active: boolean;
7
7
  activeColor: string;
8
8
  inactiveColor: string;
9
9
  index: number;
10
+ value: ReactNode;
11
+ dot: boolean;
12
+ max: number;
13
+ top: string;
14
+ right: string;
10
15
  handleClick: (idx: number) => void;
11
16
  }
12
17
  export declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
@@ -0,0 +1 @@
1
+ export declare function isForwardRefComponent(component: any): any;
@@ -9,7 +9,7 @@ import classNames from "classnames";
9
9
  import Taro, { uploadFile, getEnv, chooseMedia, chooseImage } from "@tarojs/taro";
10
10
  import { Failure, Loading, Link, Del, Photograph } from "@nutui/icons-react-taro";
11
11
  import { Image } from "@tarojs/components";
12
- import { B as Button } from "./button.taro-01eae688.js";
12
+ import { B as Button } from "./button.taro-60dfd83e.js";
13
13
  import { P as Progress } from "./progress.taro-437b9f6a.js";
14
14
  import { u as useConfig } from "./configprovider.taro-372b1525.js";
15
15
  import { i as isPromise } from "./index-0a89a47b.js";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.0.0-alpha.16 Fri Jun 09 2023 18:38:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.18 Fri Jun 16 2023 18:34:22 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-taro v2.0.0-alpha.16 Fri Jun 09 2023 18:38:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.18 Fri Jun 16 2023 18:34:22 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-taro v2.0.0-alpha.16 Fri Jun 09 2023 18:38:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.18 Fri Jun 16 2023 18:34:22 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-taro v2.0.0-alpha.16 Fri Jun 09 2023 18:38:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.18 Fri Jun 16 2023 18:34:22 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-taro v2.0.0-alpha.16 Fri Jun 09 2023 18:38:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.18 Fri Jun 16 2023 18:34:22 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-taro v2.0.0-alpha.16 Fri Jun 09 2023 18:38:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.18 Fri Jun 16 2023 18:34:22 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-taro v2.0.0-alpha.16 Fri Jun 09 2023 18:38:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.18 Fri Jun 16 2023 18:34:22 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */