@nutui/nutui-react-taro 1.4.9-beta.0 → 1.4.9-beta.2

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 (109) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/esm/ActionSheet.js +3 -3
  3. package/dist/esm/Address.js +3 -3
  4. package/dist/esm/Badge.js +3 -2
  5. package/dist/esm/Calendar.js +4 -4
  6. package/dist/esm/CalendarItem.js +3 -2
  7. package/dist/esm/Card.js +3 -3
  8. package/dist/esm/Cascader.js +4 -4
  9. package/dist/esm/Checkbox.js +2 -2
  10. package/dist/esm/CheckboxGroup.js +2 -2
  11. package/dist/esm/CircleProgress.js +3 -2
  12. package/dist/esm/Collapse.js +3 -2
  13. package/dist/esm/DatePicker.js +5 -4
  14. package/dist/esm/Form/style/index.js +1 -1
  15. package/dist/esm/FormItem/style/index.js +1 -1
  16. package/dist/esm/Grid.js +3 -2
  17. package/dist/esm/GridItem.js +3 -2
  18. package/dist/esm/ImagePreview.js +3 -3
  19. package/dist/esm/Indicator.js +2 -2
  20. package/dist/esm/MenuItem/style/index.js +1 -1
  21. package/dist/esm/NavBar/style/index.js +1 -1
  22. package/dist/esm/NumberKeyboard/style/index.js +1 -1
  23. package/dist/esm/NumberKeyboard.js +3 -3
  24. package/dist/esm/Picker.js +3 -3
  25. package/dist/esm/Popover/style/index.js +2 -1
  26. package/dist/esm/Popup.js +2 -2
  27. package/dist/esm/Rate.js +3 -2
  28. package/dist/esm/SearchBar/style/index.js +1 -1
  29. package/dist/esm/ShortPassword.js +3 -3
  30. package/dist/esm/SideNavBar/style/index.js +1 -1
  31. package/dist/esm/SideNavBar.js +3 -3
  32. package/dist/esm/Skeleton/style/index.js +1 -1
  33. package/dist/esm/Sticky.js +6 -3
  34. package/dist/esm/Swipe.js +3 -2
  35. package/dist/esm/Table/style/index.js +1 -1
  36. package/dist/esm/Tabs/style/index.js +2 -1
  37. package/dist/esm/Tabs.js +3 -2
  38. package/dist/esm/TimeSelect/style/index.js +1 -0
  39. package/dist/esm/TimeSelect.js +3 -3
  40. package/dist/esm/Uploader/style/index.js +1 -0
  41. package/dist/esm/Uploader.js +4 -2
  42. package/dist/esm/{actionsheet.taro-166ce936.js → actionsheet.taro-c5ccaf4e.js} +1 -1
  43. package/dist/esm/{address.taro-55f308f1.js → address.taro-f977bad0.js} +1 -1
  44. package/dist/esm/{badge.taro-116b2521.js → badge.taro-a2e7dd5a.js} +5 -2
  45. package/dist/esm/{calendar.taro-c95e6998.js → calendar.taro-2dee4f90.js} +2 -2
  46. package/dist/esm/{calendaritem.taro-86412398.js → calendaritem.taro-f5da0936.js} +6 -2
  47. package/dist/esm/{card.taro-a03f0dfc.js → card.taro-4fb6bc4e.js} +2 -1
  48. package/dist/esm/{cascader.taro-e0fb7e63.js → cascader.taro-a2ee549c.js} +2 -2
  49. package/dist/esm/{checkbox.taro-b76b1c82.js → checkbox.taro-6aab93c3.js} +60 -69
  50. package/dist/esm/{circleprogress.taro-47db537c.js → circleprogress.taro-897ea24b.js} +1 -2
  51. package/dist/esm/{collapse.taro-af58206c.js → collapse.taro-c903a060.js} +2 -1
  52. package/dist/esm/{datepicker.taro-c61c6586.js → datepicker.taro-e5f3aa90.js} +11 -10
  53. package/dist/esm/{grid.taro-e6decfce.js → grid.taro-9410ff69.js} +4 -1
  54. package/dist/esm/{griditem.taro-5406bd2c.js → griditem.taro-26863577.js} +9 -2
  55. package/dist/esm/{imagepreview.taro-2d23d0ae.js → imagepreview.taro-3a5722e8.js} +1 -1
  56. package/dist/esm/index-a90733f9.js +7 -0
  57. package/dist/esm/{indicator.taro-183ea169.js → indicator.taro-25682172.js} +1 -1
  58. package/dist/esm/{numberkeyboard.taro-c6b5b0e1.js → numberkeyboard.taro-78224b3a.js} +1 -1
  59. package/dist/esm/nutui-react.es.js +28 -27
  60. package/dist/esm/{picker.taro-fa937ea1.js → picker.taro-4298ce4e.js} +2 -2
  61. package/dist/esm/{popup.taro-4c18f46c.js → popup.taro-6e81162a.js} +1 -1
  62. package/dist/esm/{rate.taro-17b84a51.js → rate.taro-f18381f3.js} +5 -2
  63. package/dist/esm/{shortpassword.taro-53b7ee7b.js → shortpassword.taro-e8ea4593.js} +1 -1
  64. package/dist/esm/{sidenavbar.taro-51a133e6.js → sidenavbar.taro-e03a5287.js} +1 -1
  65. package/dist/esm/{sticky.taro-2d9b2804.js → sticky.taro-b15d1173.js} +9 -4
  66. package/dist/esm/{swipe.taro-6532405d.js → swipe.taro-9375a9a1.js} +2 -1
  67. package/dist/esm/{tabs.taro-4629d66c.js → tabs.taro-95edd45d.js} +2 -0
  68. package/dist/esm/{timeselect.taro-4fb46162.js → timeselect.taro-f276b0a9.js} +1 -1
  69. package/dist/esm/types/src/packages/checkbox/checkbox.d.ts +2 -7
  70. package/dist/esm/types/src/packages/checkbox/checkbox.taro.d.ts +2 -7
  71. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +4 -5
  72. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +4 -5
  73. package/dist/esm/types/src/packages/checkboxgroup/context.d.ts +10 -0
  74. package/dist/esm/types/src/packages/tabs/tabs.d.ts +4 -1
  75. package/dist/esm/types/src/packages/tabs/tabs.taro.d.ts +4 -1
  76. package/dist/esm/types/src/packages/uploader/upload.d.ts +3 -0
  77. package/dist/esm/types/src/packages/uploader/uploader.d.ts +4 -1
  78. package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +15 -6
  79. package/dist/esm/types/src/utils/Interceptor.d.ts +6 -0
  80. package/dist/esm/types/src/utils/index.d.ts +2 -0
  81. package/dist/esm/{uploader.taro-c830b573.js → uploader.taro-77396b5d.js} +183 -81
  82. package/dist/locales/base.js +1 -1
  83. package/dist/locales/en-US.js +1 -1
  84. package/dist/locales/id-ID.js +1 -1
  85. package/dist/locales/zh-CN.js +1 -1
  86. package/dist/locales/zh-TW.js +1 -1
  87. package/dist/locales/zh-UG.js +1 -1
  88. package/dist/nutui.react.es.js +320 -219
  89. package/dist/nutui.react.umd.js +319 -218
  90. package/dist/packages/datepicker/datepicker.scss +0 -3
  91. package/dist/packages/form/form.scss +1 -0
  92. package/dist/packages/formitem/formitem.scss +13 -0
  93. package/dist/packages/menuitem/menuitem.scss +4 -0
  94. package/dist/packages/navbar/navbar.scss +24 -0
  95. package/dist/packages/numberkeyboard/numberkeyboard.scss +1 -0
  96. package/dist/packages/picker/picker.scss +47 -14
  97. package/dist/packages/searchbar/searchbar.scss +1 -0
  98. package/dist/packages/sidenavbar/sidenavbar.scss +13 -0
  99. package/dist/packages/skeleton/skeleton.scss +7 -0
  100. package/dist/packages/table/table.scss +22 -0
  101. package/dist/packages/tabs/tabs.scss +65 -35
  102. package/dist/packages/timeselect/timeselect.scss +7 -0
  103. package/dist/packages/uploader/uploader.scss +85 -28
  104. package/dist/style.css +1 -1
  105. package/dist/style.es.js +1 -1
  106. package/dist/styles/variables.scss +95 -21
  107. package/dist/types/index.d.ts +28 -21
  108. package/package.json +1 -1
  109. package/dist/esm/types/src/packages/tabbar/use-props-value.d.ts +0 -7
@@ -1,8 +1,10 @@
1
- import React__default, { useState, useImperativeHandle, useEffect, useCallback } from 'react';
1
+ import React__default, { createContext, useImperativeHandle, useState, useEffect, useCallback, useContext } from 'react';
2
2
  import { I as Icon } from './icon.taro-c9254a81.js';
3
3
  import { c as cn } from './bem-893ad28d.js';
4
4
  import { C as ComponentDefaults } from './typings-1c5f2628.js';
5
5
 
6
+ const CheckboxGroupContext = createContext(null);
7
+
6
8
  const defaultProps$1 = {
7
9
  disabled: false,
8
10
  checkedValue: [],
@@ -16,8 +18,6 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
16
18
  const { children } = { ...defaultProps$1, ...props };
17
19
  const b = cn('checkboxgroup');
18
20
  const { className, disabled, onChange, checkedValue, max, textPosition, direction, options, ...rest } = props;
19
- const [innerDisabled, setInnerDisabled] = useState(disabled);
20
- const [innerValue, setInnerValue] = useState(checkedValue);
21
21
  useImperativeHandle(ref, () => ({
22
22
  toggleAll(state) {
23
23
  if (state === false) {
@@ -42,62 +42,32 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
42
42
  setInnerValue(reverse);
43
43
  },
44
44
  }));
45
+ const [innerValue, setInnerValue] = useState(checkedValue || []);
45
46
  useEffect(() => {
46
- setInnerDisabled(disabled);
47
- setInnerValue(checkedValue);
48
- }, [disabled, checkedValue]);
49
- function handleChildChange(state, label) {
50
- if (max !== undefined && innerValue && innerValue.length > max)
51
- return;
52
- if (innerValue) {
53
- let clippedValue = [];
54
- if (state) {
55
- clippedValue = [...innerValue, label];
56
- }
57
- else {
58
- innerValue?.splice(innerValue?.indexOf(label), 1);
59
- clippedValue = [...innerValue];
60
- }
61
- setInnerValue(clippedValue);
62
- onChange && onChange(clippedValue);
63
- }
64
- }
65
- function validateChildChecked(child) {
66
- if (!innerValue)
67
- return false;
68
- return innerValue?.indexOf(child.props.label || child.children) > -1;
69
- }
70
- function validateChecked(value) {
71
- if (!innerValue)
72
- return false;
73
- return innerValue?.indexOf(value) > -1;
74
- }
75
- function getParentVals() {
76
- return innerValue;
77
- }
78
- function cloneChildren() {
79
- return React__default.Children.map(children, (child) => {
80
- const childChecked = validateChildChecked(child);
81
- if (child.type.displayName !== 'NutCheckBox') {
82
- return React__default.cloneElement(child);
83
- }
84
- return React__default.cloneElement(child, {
85
- disabled: innerDisabled,
86
- checked: childChecked,
87
- onChange: handleChildChange,
88
- getParentVals,
89
- max,
90
- textPosition,
91
- });
92
- });
93
- }
94
- const renderOptionsChildren = useCallback(() => {
47
+ setInnerValue(checkedValue || []);
48
+ }, [checkedValue]);
49
+ const renderOptions = useCallback(() => {
95
50
  return options?.map(({ label, value, disabled, onChange, ...rest }) => {
96
- const childChecked = validateChecked(value);
97
- return (React__default.createElement(Checkbox, { key: value?.toString(), children: label, label: value, disabled: innerDisabled ? true : disabled, onChange: handleChildChange, ...rest, max: max, textPosition: textPosition, getParentVals: getParentVals, checked: childChecked }));
51
+ return (React__default.createElement(Checkbox, { key: value?.toString(), children: label, label: value, ...rest }));
98
52
  });
99
- }, [innerValue, options, innerDisabled, max]);
100
- return (React__default.createElement("div", { className: `${b()} nut-checkboxgroup--${props.direction} ${className || ''}`, ...rest }, options?.length ? renderOptionsChildren() : cloneChildren()));
53
+ }, [options, max]);
54
+ return (React__default.createElement(CheckboxGroupContext.Provider, { value: {
55
+ textPosition: textPosition || 'left',
56
+ disabled,
57
+ max,
58
+ checkedValue: innerValue || [],
59
+ check: (value) => {
60
+ const combined = [...innerValue, value];
61
+ setInnerValue(combined);
62
+ onChange && onChange(combined);
63
+ },
64
+ uncheck: (value) => {
65
+ const reduced = innerValue.filter((item) => item !== value);
66
+ setInnerValue(reduced);
67
+ onChange && onChange(reduced);
68
+ },
69
+ } },
70
+ React__default.createElement("div", { className: `${b()} nut-checkboxgroup--${props.direction} ${className || ''}`, ...rest }, options?.length ? renderOptions() : children)));
101
71
  });
102
72
  CheckboxGroup.defaultProps = defaultProps$1;
103
73
  CheckboxGroup.displayName = 'NutCheckboxGroup';
@@ -121,17 +91,34 @@ const Checkbox = (props) => {
121
91
  ...props,
122
92
  };
123
93
  const b = cn('checkbox');
124
- const { iconName, iconSize, label, className, textPosition, iconActiveName, checked, disabled, onChange, indeterminate, iconClassPrefix, iconFontClassName, iconIndeterminateName, getParentVals, max, ...rest } = props;
125
- const [innerChecked, setInnerChecked] = useState(checked);
126
- const [innerDisabled, setDisabled] = useState(disabled);
94
+ const { iconName, iconSize, label, className, iconActiveName, checked, disabled, onChange, indeterminate, iconClassPrefix, iconFontClassName, iconIndeterminateName, ...others } = props;
95
+ // eslint-disable-next-line prefer-const
96
+ let { textPosition, ...rest } = others;
97
+ const ctx = useContext(CheckboxGroupContext);
98
+ let [innerChecked, setInnerChecked] = useState(checked);
99
+ // eslint-disable-next-line prefer-const
100
+ let [innerDisabled, setDisabled] = useState(disabled);
127
101
  const [_indeterminate, setIndeterminate] = useState(indeterminate);
128
102
  useEffect(() => {
129
- setInnerChecked(checked);
103
+ !ctx && setInnerChecked(checked);
130
104
  setDisabled(disabled);
131
- }, [disabled, checked]);
132
- useEffect(() => {
133
105
  setIndeterminate(indeterminate);
134
- }, [indeterminate]);
106
+ }, [disabled, checked, indeterminate]);
107
+ if (ctx) {
108
+ if (ctx.textPosition !== undefined) {
109
+ textPosition = ctx.textPosition;
110
+ }
111
+ innerDisabled = ctx.disabled;
112
+ innerChecked = ctx.checkedValue.includes(label);
113
+ setInnerChecked = (checked) => {
114
+ if (ctx.disabled)
115
+ return;
116
+ if (checked)
117
+ ctx.check(label);
118
+ if (!checked)
119
+ ctx.uncheck(label);
120
+ };
121
+ }
135
122
  const getIconName = () => {
136
123
  if (!innerChecked) {
137
124
  return iconName;
@@ -155,19 +142,23 @@ const Checkbox = (props) => {
155
142
  return 'nut-checkbox__icon';
156
143
  }
157
144
  return 'nut-checkbox__icon--unchecked';
158
- // return !innerDisabled ? (!innerChecked ? '#d6d6d6' : '#fa2c19') : '#f5f5f5'
159
145
  };
160
146
  const renderLabel = () => {
161
147
  return (React__default.createElement("span", { className: `${b('label', { disabled: innerDisabled })} ` }, children || label));
162
148
  };
163
149
  const handleClick = () => {
164
- if (!disabled) {
165
- const latest = !innerChecked;
166
- if (max !== undefined && latest && getParentVals().length >= max)
150
+ // 禁用的时候直接返回
151
+ if (disabled)
152
+ return;
153
+ // 先转换状态
154
+ const latestChecked = !innerChecked;
155
+ // 判断是不是有 context 和 max,有的话需要判断是不是超过最大限制
156
+ if (ctx && ctx.max !== undefined) {
157
+ if (latestChecked && ctx.checkedValue.length >= ctx.max)
167
158
  return;
168
- onChange && onChange(latest, label || children);
169
- setInnerChecked(latest);
170
159
  }
160
+ onChange && onChange(latestChecked, label || children);
161
+ setInnerChecked(latestChecked);
171
162
  };
172
163
  return (React__default.createElement("div", { className: `${b({ reverse: textPosition === 'left' })} ${className || ''}`, ...rest, onClick: handleClick },
173
164
  renderIcon(),
@@ -1,9 +1,8 @@
1
1
  import React__default, { useState, useEffect } from 'react';
2
2
  import classNames from 'classnames';
3
+ import { a as isObject } from './index-a90733f9.js';
3
4
  import { c as cn } from './bem-893ad28d.js';
4
5
 
5
- const isObject = (val) => val !== null && typeof val === 'object';
6
-
7
6
  const defaultProps = {
8
7
  strokeWidth: 5,
9
8
  radius: 50,
@@ -1,4 +1,5 @@
1
1
  import React__default, { memo, useState, useEffect } from 'react';
2
+ import classNames from 'classnames';
2
3
  import { c as cn } from './bem-893ad28d.js';
3
4
 
4
5
  const defaultProps = {
@@ -65,7 +66,7 @@ const Collapse = memo((props) => {
65
66
  setDefaultOpenIndex(newOpenIndex);
66
67
  onChange && onChange(!isOpen, name);
67
68
  };
68
- return (React__default.createElement("div", { className: `${colBem()} ${className}`, style: style }, childrenDom.map((item) => {
69
+ return (React__default.createElement("div", { className: classNames(colBem(), className), style: style }, childrenDom.map((item) => {
69
70
  return React__default.cloneElement(item, {
70
71
  isOpen: defaultOpenIndex.includes(item.props.name),
71
72
  onToggle: (isOpen, name) => onToggle(isOpen, name),
@@ -1,5 +1,6 @@
1
1
  import React__default, { useState, useRef, useEffect } from 'react';
2
- import { P as Picker } from './picker.taro-fa937ea1.js';
2
+ import { P as Picker } from './picker.taro-4298ce4e.js';
3
+ import { u as useConfig } from './configprovider-5eea4f5d.js';
3
4
 
4
5
  const currentYear = new Date().getFullYear();
5
6
  const defaultProps = {
@@ -18,6 +19,7 @@ const DatePicker = (props) => {
18
19
  ...defaultProps,
19
20
  ...props,
20
21
  };
22
+ const { locale } = useConfig();
21
23
  const [show, setShow] = useState(false);
22
24
  const [currentDate, setCurrentDate] = useState(modelValue);
23
25
  const [defaultValue, setDefaultValue] = useState([]);
@@ -27,13 +29,14 @@ const DatePicker = (props) => {
27
29
  return (Object.prototype.toString.call(val) === '[object Date]' &&
28
30
  !Number.isNaN(val.getTime()));
29
31
  };
32
+ const datepickerLang = locale.datepicker;
30
33
  const zhCNType = {
31
- day: '日',
32
- year: '年',
33
- month: '月',
34
- hour: '时',
35
- minute: '分',
36
- seconds: '秒',
34
+ day: datepickerLang.day,
35
+ year: datepickerLang.year,
36
+ month: datepickerLang.month,
37
+ hour: datepickerLang.hour,
38
+ minute: datepickerLang.min,
39
+ seconds: datepickerLang.seconds,
37
40
  };
38
41
  const formatValue = (value) => {
39
42
  let cvalue = value;
@@ -84,7 +87,6 @@ const DatePicker = (props) => {
84
87
  };
85
88
  const ranges = (date) => {
86
89
  const curDate = date || currentDate;
87
- console.log(11, currentDate);
88
90
  if (!curDate)
89
91
  return [];
90
92
  const { maxYear, maxDate, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary('max', curDate);
@@ -249,7 +251,6 @@ const DatePicker = (props) => {
249
251
  };
250
252
  useEffect(() => {
251
253
  setCurrentDate(formatValue(modelValue));
252
- // initDefault()
253
254
  }, []);
254
255
  useEffect(() => {
255
256
  setCurrentDate(formatValue(modelValue));
@@ -262,7 +263,7 @@ const DatePicker = (props) => {
262
263
  setListData(columns());
263
264
  }
264
265
  }, [currentDate]);
265
- return (React__default.createElement("div", { className: `nut-datepicker ${className || ''}`, style: style, ...rest }, listData.length > 0 && (React__default.createElement(Picker, { isVisible: show, listData: listData, onClose: onCloseDatePicker, defaultValueData: defaultValue, onConfirm: (values, options) => onConfirmDatePicker && onConfirmDatePicker(values, options), onChange: (index, value, list) => updateChooseValueCustmer(index, value, list), threeDimensional: threeDimensional, ref: pickerRef }))));
266
+ return (React__default.createElement("div", { className: `nut-datepicker ${className || ''}`, style: style, ...rest }, listData.length > 0 && (React__default.createElement(Picker, { title: title, isVisible: show, listData: listData, onClose: onCloseDatePicker, defaultValueData: defaultValue, onConfirm: (values, options) => onConfirmDatePicker && onConfirmDatePicker(values, options), onChange: (index, value, list) => updateChooseValueCustmer(index, value, list), threeDimensional: threeDimensional, ref: pickerRef }))));
266
267
  };
267
268
  DatePicker.defaultProps = defaultProps;
268
269
  DatePicker.displayName = 'NutDatePicker';
@@ -1,4 +1,5 @@
1
1
  import React__default from 'react';
2
+ import classNames from 'classnames';
2
3
  import { u as useConfig } from './configprovider.taro-26882dd2.js';
3
4
  import { c as cn } from './bem-893ad28d.js';
4
5
  import { G as GridContext } from './grid.taro.context-39636af9.js';
@@ -24,7 +25,9 @@ const Grid = (props) => {
24
25
  const b = cn('grid');
25
26
  const rootClass = () => {
26
27
  const prefixCls = b();
27
- return `${className} ${prefixCls} ${border && !gutter ? `${b('border')}` : ''}`;
28
+ return classNames(className, prefixCls, {
29
+ [b('border')]: border && !gutter,
30
+ });
28
31
  };
29
32
  const rootStyle = () => {
30
33
  let styleSelf = {};
@@ -1,4 +1,5 @@
1
1
  import React__default, { useContext } from 'react';
2
+ import classNames from 'classnames';
2
3
  import { u as useConfig } from './configprovider.taro-26882dd2.js';
3
4
  import { c as cn } from './bem-893ad28d.js';
4
5
  import { I as Icon } from './icon.taro-c9254a81.js';
@@ -50,8 +51,14 @@ const GridItem = (props) => {
50
51
  return style;
51
52
  };
52
53
  const contentClass = () => {
53
- return `${b('content')} ${border && b('content--border')} ${border && gutter && b('content--surround')} ${center && b('content--center')} ${square && b('content--square')} ${reverse && b('content--reverse')} ${!!direction && b(`content--${direction}`)}
54
- `;
54
+ return classNames(b('content'), {
55
+ [b('content--border')]: border,
56
+ [b('content--surround')]: border && gutter,
57
+ [b('content--center')]: center,
58
+ [b('content--square')]: square,
59
+ [b('content--reverse')]: reverse,
60
+ [b(`content--${direction}`)]: !!direction,
61
+ });
55
62
  };
56
63
  const isIconName = () => {
57
64
  return typeof icon === 'string';
@@ -1,5 +1,5 @@
1
1
  import React__default, { useRef, useState, useEffect } from 'react';
2
- import { P as Popup } from './popup.taro-4c18f46c.js';
2
+ import { P as Popup } from './popup.taro-6e81162a.js';
3
3
  import { S as Swiper } from './swiper.taro-8164df5b.js';
4
4
  import { S as SwiperItem } from './swiperitem-86a3578a.js';
5
5
 
@@ -0,0 +1,7 @@
1
+ const isObject = (val) => val !== null && typeof val === 'object';
2
+ const isFunction = (val) => typeof val === 'function';
3
+ const isPromise = (val) => {
4
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
5
+ };
6
+
7
+ export { isObject as a, isPromise as i };
@@ -29,7 +29,7 @@ const Indicator = (props) => {
29
29
  return childs;
30
30
  };
31
31
  useEffect(() => { }, []);
32
- return (React__default.createElement("div", { className: `${classes} ${className}`, ...rest }, renderEles()));
32
+ return (React__default.createElement("div", { className: classNames(classes, className), ...rest }, renderEles()));
33
33
  };
34
34
  Indicator.defaultProps = defaultProps;
35
35
  Indicator.displayName = 'NutIndicator';
@@ -1,7 +1,7 @@
1
1
  import React__default, { useState, useEffect } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { c as cn } from './bem-893ad28d.js';
4
- import { P as Popup } from './popup.taro-4c18f46c.js';
4
+ import { P as Popup } from './popup.taro-6e81162a.js';
5
5
  import { u as useConfig } from './configprovider.taro-26882dd2.js';
6
6
 
7
7
  const defaultProps = {
@@ -5,54 +5,54 @@ export { C as ConfigProvider } from './configprovider.taro-26882dd2.js';
5
5
  export { I as Icon } from './icon.taro-c9254a81.js';
6
6
  export { I as Image } from './image.taro-1d867416.js';
7
7
  export { O as Overlay } from './overlay.taro-1e74a71d.js';
8
- export { P as Popup } from './popup.taro-4c18f46c.js';
8
+ export { P as Popup } from './popup.taro-6e81162a.js';
9
9
  export { C as Col } from './col.taro-9e4c5cc0.js';
10
10
  export { D as Divider } from './divider.taro-5236fe6a.js';
11
- export { G as Grid } from './grid.taro-e6decfce.js';
12
- export { G as GridItem } from './griditem.taro-5406bd2c.js';
11
+ export { G as Grid } from './grid.taro-9410ff69.js';
12
+ export { G as GridItem } from './griditem.taro-26863577.js';
13
13
  export { L as Layout } from './layout.taro-358f014f.js';
14
14
  export { R as Row } from './row.taro-4e697aa2.js';
15
- export { S as Sticky } from './sticky.taro-2d9b2804.js';
15
+ export { S as Sticky } from './sticky.taro-b15d1173.js';
16
16
  export { E as Elevator } from './elevator.taro-1d749ab0.js';
17
17
  export { F as FixedNav } from './fixednav.taro-84930e08.js';
18
- export { I as Indicator } from './indicator.taro-183ea169.js';
18
+ export { I as Indicator } from './indicator.taro-25682172.js';
19
19
  export { M as Menu } from './menu.taro-e5b84501.js';
20
20
  export { M as MenuItem } from './menuitem.taro-f2129be6.js';
21
21
  export { N as NavBar } from './navbar.taro-70514adf.js';
22
22
  export { P as Pagination } from './pagination.taro-bb490de9.js';
23
- export { S as SideNavBar } from './sidenavbar.taro-51a133e6.js';
23
+ export { S as SideNavBar } from './sidenavbar.taro-e03a5287.js';
24
24
  export { S as SideNavBarItem } from './sidenavbaritem.taro-fee11d26.js';
25
25
  export { S as SubSideNavBar } from './subsidenavbar.taro-f46b4c73.js';
26
26
  export { T as Tabbar } from './tabbar.taro-17d898d9.js';
27
27
  export { T as TabbarItem } from './tabbaritem.taro-3643f585.js';
28
28
  export { T as TabPane } from './tabpane.taro-9512e308.js';
29
- export { T as Tabs } from './tabs.taro-4629d66c.js';
30
- export { C as Calendar } from './calendar.taro-c95e6998.js';
31
- export { C as CalendarItem } from './calendaritem.taro-86412398.js';
32
- export { C as Cascader } from './cascader.taro-e0fb7e63.js';
33
- export { C as Checkbox, a as CheckboxGroup } from './checkbox.taro-b76b1c82.js';
34
- export { D as DatePicker } from './datepicker.taro-c61c6586.js';
29
+ export { T as Tabs } from './tabs.taro-95edd45d.js';
30
+ export { C as Calendar } from './calendar.taro-2dee4f90.js';
31
+ export { C as CalendarItem } from './calendaritem.taro-f5da0936.js';
32
+ export { C as Cascader } from './cascader.taro-a2ee549c.js';
33
+ export { C as Checkbox, a as CheckboxGroup } from './checkbox.taro-6aab93c3.js';
34
+ export { D as DatePicker } from './datepicker.taro-e5f3aa90.js';
35
35
  export { F as Form } from './form.taro-ce791a58.js';
36
36
  export { F as FormItem } from './formitem.taro-f2ed02d4.js';
37
37
  export { I as Input } from './input.taro-991945d1.js';
38
38
  export { I as InputNumber } from './inputnumber.taro-94c75663.js';
39
- export { N as NumberKeyboard } from './numberkeyboard.taro-c6b5b0e1.js';
40
- export { P as Picker } from './picker.taro-fa937ea1.js';
39
+ export { N as NumberKeyboard } from './numberkeyboard.taro-78224b3a.js';
40
+ export { P as Picker } from './picker.taro-4298ce4e.js';
41
41
  export { R as Radio, a as RadioGroup } from './index.taro-84346556.js';
42
42
  export { R as Range } from './range.taro-b628f1ed.js';
43
- export { R as Rate } from './rate.taro-17b84a51.js';
43
+ export { R as Rate } from './rate.taro-f18381f3.js';
44
44
  export { S as SearchBar } from './searchbar.taro-6864f7bc.js';
45
- export { S as ShortPassword } from './shortpassword.taro-53b7ee7b.js';
45
+ export { S as ShortPassword } from './shortpassword.taro-e8ea4593.js';
46
46
  export { T as TextArea } from './textarea.taro-47addd05.js';
47
- export { U as Uploader } from './uploader.taro-c830b573.js';
48
- export { A as ActionSheet } from './actionsheet.taro-166ce936.js';
47
+ export { U as Uploader } from './uploader.taro-77396b5d.js';
48
+ export { A as ActionSheet } from './actionsheet.taro-c5ccaf4e.js';
49
49
  export { B as BackTop } from './backtop.taro-e53236c7.js';
50
50
  export { B as Dialog } from './dialog.taro-7608bd26.js';
51
51
  export { D as Drag } from './drag.taro-703560c4.js';
52
52
  export { I as Infiniteloading } from './infiniteloading.taro-8ead43b0.js';
53
53
  export { N as Notify } from './notify.taro-c9ea8d68.js';
54
54
  export { P as PullToRefresh } from './pulltorefresh.taro-2b50fdf3.js';
55
- export { S as Swipe } from './swipe.taro-6532405d.js';
55
+ export { S as Swipe } from './swipe.taro-9375a9a1.js';
56
56
  export { S as Switch } from './switch.taro-bae2dca0.js';
57
57
  export { T as Toast } from './toast.taro-0f972a92.js';
58
58
  export { A as Animate } from './animate.taro-b0e83dd5.js';
@@ -60,14 +60,14 @@ export { A as AnimatingNumbers } from './animatingnumbers.taro-6307a3a5.js';
60
60
  export { A as Audio } from './audio.taro-c2cdbe18.js';
61
61
  export { A as Avatar } from './avatar.taro-c17c3d15.js';
62
62
  export { A as AvatarGroup } from './avatargroup-1d900174.js';
63
- export { B as Badge } from './badge.taro-116b2521.js';
64
- export { C as CircleProgress } from './circleprogress.taro-47db537c.js';
65
- export { C as Collapse } from './collapse.taro-af58206c.js';
63
+ export { B as Badge } from './badge.taro-a2e7dd5a.js';
64
+ export { C as CircleProgress } from './circleprogress.taro-897ea24b.js';
65
+ export { C as Collapse } from './collapse.taro-c903a060.js';
66
66
  export { C as CollapseItem } from './collapseitem-2e864527.js';
67
67
  export { C as CountDown } from './countdown.taro-9e40de9c.js';
68
68
  export { E as Ellipsis } from './ellipsis.taro-5aa23940.js';
69
69
  export { E as Empty } from './empty.taro-7bd813f9.js';
70
- export { I as ImagePreview } from './imagepreview.taro-2d23d0ae.js';
70
+ export { I as ImagePreview } from './imagepreview.taro-3a5722e8.js';
71
71
  export { N as NoticeBar } from './noticebar.taro-22486646.js';
72
72
  export { P as Popover } from './popover.taro-f144cd02.js';
73
73
  export { P as Price } from './price.taro-8801462e.js';
@@ -83,13 +83,13 @@ export { T as TrendArrow } from './trendarrow.taro-d79fc8e2.js';
83
83
  export { V as Video } from './video-8a3518c5.js';
84
84
  export { V as VirtualList } from './virtuallist.taro-1688484f.js';
85
85
  export { W as WaterMark } from './watermark.taro-a948c735.js';
86
- export { A as Address } from './address.taro-55f308f1.js';
86
+ export { A as Address } from './address.taro-f977bad0.js';
87
87
  export { B as Barrage } from './barrage.taro-5dbab093.js';
88
- export { C as Card } from './card.taro-a03f0dfc.js';
88
+ export { C as Card } from './card.taro-4fb6bc4e.js';
89
89
  export { S as Signature } from './signature.taro-45d1dde3.js';
90
90
  export { T as TimeDetail } from './timedetail.taro-c5f564fd.js';
91
91
  export { T as TimePannel } from './timepannel.taro-29f9dd86.js';
92
- export { T as TimeSelect } from './timeselect.taro-4fb46162.js';
92
+ export { T as TimeSelect } from './timeselect.taro-f276b0a9.js';
93
93
  import 'react';
94
94
  import './typings-1c5f2628.js';
95
95
  import '@tarojs/taro';
@@ -106,11 +106,12 @@ import './grid.taro.context-39636af9.js';
106
106
  import './useClientRect-4506e52f.js';
107
107
  import './get-scroll-parent-3dcd3f53.js';
108
108
  import './offsetContext-bfb02c25.js';
109
+ import './configprovider-5eea4f5d.js';
109
110
  import './useTouch-a2ea68c6.js';
110
111
  import './icon-2242973e.js';
112
+ import './index-a90733f9.js';
111
113
  import '@use-gesture/react';
112
114
  import '@react-spring/web';
113
115
  import './AvatarContext-7153ad2b.js';
114
- import './configprovider-5eea4f5d.js';
115
116
  import './UserContext-68f62e66.js';
116
117
  import './UserContext-b4181162.js';
@@ -1,5 +1,5 @@
1
1
  import React__default, { useState, useRef, useEffect, useImperativeHandle } from 'react';
2
- import { P as Popup } from './popup.taro-4c18f46c.js';
2
+ import { P as Popup } from './popup.taro-6e81162a.js';
3
3
  import { u as useTouch } from './useTouch-a2ea68c6.js';
4
4
  import { g as getRectByTaro } from './useClientRect-4506e52f.js';
5
5
  import { u as useConfig } from './configprovider.taro-26882dd2.js';
@@ -209,7 +209,7 @@ const InternalPickerSlot = (props, ref) => {
209
209
  }),
210
210
  !threeDimensional &&
211
211
  listData.map((item, index) => {
212
- return (React__default.createElement("div", { className: "nut-picker-roller-item-tile", key: item.value ? item.value : index, style: {
212
+ return (React__default.createElement("div", { className: "nut-picker-roller-item-title", key: item.value ? item.value : index, style: {
213
213
  height: `${lineSpacing.current}px`,
214
214
  lineHeight: `${lineSpacing.current}px`,
215
215
  } },
@@ -53,7 +53,7 @@ const Popup = (props) => {
53
53
  round,
54
54
  [`nut-popup-${position}`]: true,
55
55
  [`${popClass}`]: true,
56
- [`${className}`]: true,
56
+ [`${className || ''}`]: true,
57
57
  }, b(''));
58
58
  const closeClasses = classNames({
59
59
  'nut-popup__close-icon': true,
@@ -1,4 +1,5 @@
1
1
  import React__default, { useState, useEffect } from 'react';
2
+ import classNames from 'classnames';
2
3
  import { c as cn } from './bem-893ad28d.js';
3
4
  import { I as Icon } from './icon-2242973e.js';
4
5
  import { C as ComponentDefaults } from './typings-1c5f2628.js';
@@ -60,9 +61,11 @@ const Rate = (props) => {
60
61
  setScore(value);
61
62
  onChange && onChange(value);
62
63
  };
63
- return (React__default.createElement("div", { className: `${b()} ${className}`, style: style }, countArray.map((n) => {
64
+ return (React__default.createElement("div", { className: classNames(b(), className), style: style }, countArray.map((n) => {
64
65
  return (React__default.createElement("div", { className: bi(), key: n, onClick: (event) => onClick(event, n), style: { marginRight: pxCheck(spacing) } },
65
- React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, size: iconSize, className: `${bi('icon')} ${disabled || n > score ? bi('icon--disabled') : ''}`, name: n <= score ? checkedIcon : uncheckedIcon, color: n <= score ? activeColor : voidColor }),
66
+ React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, size: iconSize, className: classNames(bi('icon'), {
67
+ [bi('icon--disabled')]: disabled || n > score,
68
+ }), name: n <= score ? checkedIcon : uncheckedIcon, color: n <= score ? activeColor : voidColor }),
66
69
  allowHalf && score > n - 1 && (React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, onClick: (event) => onHalfClick(event, n), className: `${bi('icon')} ${bi('icon--half')}`, color: n <= score ? activeColor : voidColor, size: iconSize, name: checkedIcon }))));
67
70
  })));
68
71
  };
@@ -1,6 +1,6 @@
1
1
  import React__default, { useRef, useState, useEffect } from 'react';
2
2
  import { c as cn } from './bem-893ad28d.js';
3
- import { P as Popup } from './popup.taro-4c18f46c.js';
3
+ import { P as Popup } from './popup.taro-6e81162a.js';
4
4
  import { I as Icon } from './icon.taro-c9254a81.js';
5
5
  import { u as useConfig } from './configprovider.taro-26882dd2.js';
6
6
  import { C as ComponentDefaults } from './typings-1c5f2628.js';
@@ -1,6 +1,6 @@
1
1
  import React__default, { useState } from 'react';
2
2
  import { u as useConfig } from './configprovider.taro-26882dd2.js';
3
- import { P as Popup } from './popup.taro-4c18f46c.js';
3
+ import { P as Popup } from './popup.taro-6e81162a.js';
4
4
  import { O as OffsetContext } from './offsetContext-bfb02c25.js';
5
5
 
6
6
  const defaultProps = {
@@ -1,7 +1,9 @@
1
1
  import React__default, { useRef, useEffect, useState, useMemo, useCallback } from 'react';
2
- import { g as getRectByTaro } from './useClientRect-4506e52f.js';
2
+ import classNames from 'classnames';
3
3
  import { getEnv, usePageScroll, getSystemInfoSync } from '@tarojs/taro';
4
+ import { g as getRectByTaro } from './useClientRect-4506e52f.js';
4
5
  import { g as getScrollParent } from './get-scroll-parent-3dcd3f53.js';
6
+ import { c as cn } from './bem-893ad28d.js';
5
7
 
6
8
  function useWatch(dep, callback, config = { immediate: false }) {
7
9
  const { immediate } = config;
@@ -34,6 +36,7 @@ const defaultProps = {
34
36
  bottom: 0,
35
37
  zIndex: 2000,
36
38
  };
39
+ const b = cn('sticky');
37
40
  const Sticky = (props) => {
38
41
  const { position = 'top', top = 0, bottom = 0, zIndex = 2000, children, container, className, onChange, ...rest } = props;
39
42
  const stickyRef = useRef(null);
@@ -41,7 +44,7 @@ const Sticky = (props) => {
41
44
  const offset = position === 'top' ? top : bottom;
42
45
  const [rootRect, setRootRect] = useState({});
43
46
  const [fixed, setFixed] = useState(false);
44
- const [transform, setTransform] = useState(0); //相对容器偏移距离
47
+ const [transform, setTransform] = useState(0); // 相对容器偏移距离
45
48
  useWatch(fixed, () => {
46
49
  onChange && onChange(fixed);
47
50
  });
@@ -124,8 +127,10 @@ const Sticky = (props) => {
124
127
  handleScroll(res.scrollTop);
125
128
  }
126
129
  });
127
- return (React__default.createElement("div", { ref: rootRef, style: rootStyle, className: `nut-sticky ${className}`, ...rest },
128
- React__default.createElement("div", { className: `nut-sticky-box ${fixed ? 'nut-sticky-fixed' : ''}`, ref: stickyRef, style: stickyStyle }, children)));
130
+ return (React__default.createElement("div", { ref: rootRef, style: rootStyle, className: classNames(b(), className), ...rest },
131
+ React__default.createElement("div", {
132
+ // 应符合 bem 规范
133
+ className: classNames('nut-sticky-box', { 'nut-sticky-fixed': fixed }), ref: stickyRef, style: stickyStyle }, children)));
129
134
  };
130
135
  Sticky.defaultProps = defaultProps;
131
136
  Sticky.displayName = 'NutSticky';
@@ -1,4 +1,5 @@
1
1
  import React__default, { forwardRef, useRef, useState, useMemo, useImperativeHandle, useEffect } from 'react';
2
+ import classNames from 'classnames';
2
3
  import { useReady, nextTick } from '@tarojs/taro';
3
4
  import { c as cn } from './bem-893ad28d.js';
4
5
  import { u as useTouch } from './useTouch-a2ea68c6.js';
@@ -164,7 +165,7 @@ const Swipe = forwardRef((props, instanceRef) => {
164
165
  document.removeEventListener('touchstart', handler);
165
166
  };
166
167
  }, []);
167
- return (React__default.createElement("div", { ref: root, className: `${swipeBem()} ${className}`, onTouchStart: (e) => onTouchStart(e), onTouchMove: (e) => onTouchMove(e), onTouchEnd: (e) => onTouchEnd(e), style: style },
168
+ return (React__default.createElement("div", { ref: root, className: classNames(swipeBem(), className), onTouchStart: (e) => onTouchStart(e), onTouchMove: (e) => onTouchMove(e), onTouchEnd: (e) => onTouchEnd(e), style: style },
168
169
  React__default.createElement("div", { className: `${swipeBem('wrapper')}`, style: wrapperStyle },
169
170
  renderActionContent('left'),
170
171
  children,
@@ -3,6 +3,7 @@ import classNames from 'classnames';
3
3
  import { c as cn } from './bem-893ad28d.js';
4
4
  import { I as Icon } from './icon.taro-c9254a81.js';
5
5
  import { C as ComponentDefaults } from './typings-1c5f2628.js';
6
+ import { T as TabPane } from './tabpane.taro-9512e308.js';
6
7
 
7
8
  class Title {
8
9
  title = '';
@@ -131,5 +132,6 @@ const Tabs = (props) => {
131
132
  };
132
133
  Tabs.defaultProps = defaultProps;
133
134
  Tabs.displayName = 'NutTabs';
135
+ Tabs.TabPane = TabPane;
134
136
 
135
137
  export { Tabs as T };
@@ -1,5 +1,5 @@
1
1
  import React__default, { useState, useEffect } from 'react';
2
- import { P as Popup } from './popup.taro-4c18f46c.js';
2
+ import { P as Popup } from './popup.taro-6e81162a.js';
3
3
  import { T as TimePannel } from './timepannel.taro-29f9dd86.js';
4
4
  import { T as TimeDetail } from './timedetail.taro-c5f564fd.js';
5
5
  import { c as cn } from './bem-893ad28d.js';