@nutui/nutui-react-taro 1.3.13-beta.0 → 1.3.14-beta.0

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 +19 -2
  2. package/README.md +54 -43
  3. package/dist/esm/Collapse.js +2 -2
  4. package/dist/esm/CollapseItem.js +2 -2
  5. package/dist/esm/FormItem.js +5 -4
  6. package/dist/esm/Grid.js +3 -2
  7. package/dist/esm/GridItem.js +3 -2
  8. package/dist/esm/NoticeBar.js +2 -2
  9. package/dist/esm/TrendArrow/style/index.js +1 -1
  10. package/dist/esm/{collapse.taro-13cde270.js → collapse.taro-af58206c.js} +1 -1
  11. package/dist/esm/{collapseitem-75843a5e.js → collapseitem-ce1849d2.js} +9 -5
  12. package/dist/esm/{formitem-9f11e314.js → formitem.taro-fef76bf1.js} +1 -102
  13. package/dist/esm/{grid.taro-d244170c.js → grid.taro-1f03be03.js} +9 -3
  14. package/dist/esm/grid.taro.context-39636af9.js +6 -0
  15. package/dist/esm/{griditem.taro-f7ee189b.js → griditem.taro-1452609c.js} +19 -1
  16. package/dist/esm/{noticebar.taro-4915fed3.js → noticebar.taro-43c18dc9.js} +7 -4
  17. package/dist/esm/nutui-react.es.js +7 -7
  18. package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +30 -0
  19. package/dist/esm/types/src/packages/formitem/index.taro.d.ts +1 -1
  20. package/dist/esm/types/src/packages/grid/grid.context.d.ts +6 -0
  21. package/dist/esm/types/src/packages/grid/grid.d.ts +3 -1
  22. package/dist/esm/types/src/packages/grid/grid.taro.context.d.ts +6 -0
  23. package/dist/esm/types/src/packages/grid/grid.taro.d.ts +3 -1
  24. package/dist/esm/types/src/utils/render.d.ts +8 -1
  25. package/dist/locales/base.js +1 -1
  26. package/dist/locales/en-US.js +1 -1
  27. package/dist/locales/id-ID.js +1 -1
  28. package/dist/locales/zh-CN.js +1 -1
  29. package/dist/locales/zh-TW.js +1 -1
  30. package/dist/nutui.react.es.js +551 -1804
  31. package/dist/nutui.react.umd.js +543 -1796
  32. package/dist/packages/noticebar/noticebar.scss +0 -1
  33. package/dist/style.css +1 -1
  34. package/dist/style.es.js +1 -1
  35. package/dist/styles/font/config.json +5 -1
  36. package/dist/styles/font/demo_index.html +118 -26
  37. package/dist/styles/font/iconfont.css +23 -7
  38. package/dist/styles/font/iconfont.js +6 -6
  39. package/dist/styles/font/iconfont.json +35 -7
  40. package/dist/styles/font/iconfont.ttf +0 -0
  41. package/dist/styles/font/iconfont.woff +0 -0
  42. package/dist/styles/font/iconfont.woff2 +0 -0
  43. package/dist/types/index.d.ts +16 -15
  44. package/dist/types/nutui.taro.react.build.ts +1 -1
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,8 +1,25 @@
1
+ # v1.3.14
2
+ `2022-12-09`
3
+
4
+ feat: image 适配 taro (#507) @vickyYe
5
+ feat: Grid 组件添加 onClick 事件,统一管理子项点击事件,无需在GridItem组件中分别添加点击事件 (#492) @cuicuiworld
6
+ fix: react18 render 提示错误信息 (#524) @oasis-cloud
7
+ fix: noticebar 纵向滚动渲染慢问题修复,设置高度小于默认值时动效失效问题修复 (#528) @vickyYe
8
+ fix: icon 组件 mask-close 未展示叉号 (#527) @oasis-cloud
9
+ fix: #508 修改折叠面板组件修改后不刷新问题 (#521) @zhenyulei
10
+ fix: imagepreview 设置 initNo 后 active 计算错误 (#512) @oasis-cloud
11
+ fix: 移除 formitem 对 react-router-dom 的依赖 (#513) @oasis-cloud
12
+ fix: trendarrow 组件文档增加taro引入方式说明、css文件引入icon的scss文件、修改icon组件的引入方式 (#502) @irisSong
13
+ docs: 修正 virtualList 的文档错误 (#510) @Antee
14
+ docs: Readme 中英文修改 (#525) @vickyYe
15
+ docs: 文档中增加 nutui-react-taro的 import 方式 (#522) @oasis-cloud
16
+
17
+
1
18
  # v1.3.13
2
19
  `2022-11-30`
3
20
  * :sparkles: feat: 新增image组件,适配多语言,增加单元测试 (#498) @vickyYe
4
21
  * :sparkles: feat: trendarrow趋势箭头组件开发完成 (#491) @irisSong
5
- * :bug: fix: 提交skeleton骨架屏白底修改 @junjun666
22
+ * :bug: fix: 提交skeleton骨架屏白底修改 (#499) @junjun666
6
23
  * 📖 docs: pagination demo 增加白色底 (#496) @oasis-cloud
7
24
  * 📖 docs: popover demo 增加白色底 (#497) @oasis-cloud
8
25
  * :bug: fix: cell 空链接不需跳转 (#495) @oasis-cloud
@@ -41,7 +58,7 @@
41
58
  * :bug: fix: 修复Row组件的文档示例错误 (#453) @simpleStyle
42
59
  * 📖 docs: 修复 datepicker 文档中示例代码错误 (#449) @xxxnine
43
60
  * :sparkles: feat: 补全button的关于小程序API的typescript支持 (#447) @simpleStyle
44
- * :bug: fix: input组件defaultvalue值为空时不可清除问题修复 (#452) vickyYe*
61
+ * :bug: fix: input组件defaultvalue值为空时不可清除问题修复 (#452) @vickyYe
45
62
  * :sparkles: feat: menuitem 支持 ref (#450) @oasis-cloud
46
63
  * :sparkles: feat: badge组件支持className和style属性 (#444) @cuicuiworld
47
64
  * :bug: fix: 引入样式文件运行报错(#439) (#441) @hydeia
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;">
4
4
  </p>
5
5
 
6
- <p align="center">京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序</p>
6
+ <p align="center">JD-style mobile UI components based on React that support users to develop H5 and mini-programs.</p>
7
7
 
8
8
  <p align="center">
9
9
  <a href="http://makeapullrequest.com">
@@ -35,90 +35,100 @@
35
35
  </p>
36
36
 
37
37
  ---
38
- > Nut[nʌt],源自电影《冰河世纪》里松鼠 Scrat "执迷不悟",一生追求,即便引发大灾难也绝不松手的坚果。
39
38
 
40
- ## 特性
39
+ > Nut[nʌt]: the one Squirrel Scrat pursues resolutely for a lifetime and will never let go even if it causes a catastrophe from the animated film ***Ice Age***.
41
40
 
42
- * 🚀 60+ 高质量组件, 覆盖移动端主流场景
43
- * 📖 基于京东APP 10.0 视觉规范
44
- * 🍭 支持按需引用
45
- * 📖 详尽的文档和示例
46
- * 💪 支持 TypeScript
47
- * 💪 支持服务端渲染(测试阶段)
48
- * 🍭 支持定制主题
49
- * 🍭 单元测试覆盖率超过80%, 保障稳定性
50
- * 📖 提供 Sketch 设计资源
41
+ [简体中文](./README_ZH.md) | English
51
42
 
52
- ## 构建版本
43
+ ## Features
53
44
 
54
- > AMD 环境、Webpack、Vite 等构建工具环境、服务端建议使用 es 版,非模块化环境(如通过 `<script>` 标签直接引用)建议使用 umd 压缩版。
45
+ * 🚀 60+ High Quality Components
46
+ * 📖 Based on JD APP 10.0 Visual Specifications
47
+ * 🍭 Support Tree Shaking
48
+ * 📖 Extensive Documentation and Demos
49
+ * 💪 Written in TypeScript
50
+ * 💪 Support SSR (Experimental)
51
+ * 🍭 Support Custom Themes
52
+ * 🍭 80%+ Unit Test Coverage
53
+ * 📖 Provide Sketch Design Resources
55
54
 
56
- * es **nutui.react.es.js**
55
+
56
+ ## Build Versions
57
+
58
+ > If you are using AMD environment or build tools such as Webpack, Vite, etc., we recommend using the `es` version. If it is a non-module environment (such as direct reference through the `<script>` tag), it is recommended to use the `umd` compressed version.
59
+
60
+ * es **nutui.es.js**
57
61
 
58
62
  * umd **nutui.umd.js**
59
63
 
60
64
 
61
- ## 链接
65
+ ## Links
62
66
 
63
67
  <ul>
64
68
  <li>
65
69
  <a href="https://github.com/jdf2e/nutui-react/discussions">
66
- Discussions (用👍投票)
70
+ Discussions (vote with 👍)
67
71
  </a>
68
72
  </li>
69
73
  <li>
70
74
  <a href="https://github.com/jdf2e/nutui-react/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22">
71
- Feature Requests (用👍投票)
75
+ Feature Requests (vote with 👍)
72
76
  </a>
73
77
  </li>
74
78
  <li>
75
79
  <a href="https://github.com/jdf2e/nutui-react/labels/bug%203.0">
76
- Bugs (用👍投票)
80
+ Bugs (vote with 👍)
77
81
  </a>
78
82
  </li>
79
83
  <li>
80
84
  <a href="https://github.com/jdf2e/nutui-react/issues?q=is%3Aissue+is%3Aopen+label%3Aquestion">
81
- Question (用👍投票)
85
+ Question (vote with 👍)
82
86
  </a>
83
87
  </li>
84
88
  </ul>
85
89
 
86
- ## 开发交流
87
- | 版本 | 微信群 |内部咚咚群 |
90
+
91
+ ## Communication
92
+
93
+ | Version | WeChat Group | JD Dongdong Group |
88
94
  | --- | --- |--- |
89
- | [NutUI React](https://github.com/jdf2e/nutui-react/issues) | <img src="https://storage.360buyimg.com/imgtools/17c67beff6-4acf07c0-609c-11ed-a6ef-69df15b605e4.png" width="100" /> 关注后回复「NutUI-React」 | 1025679314 |
90
- | [NutUI x Taro](https://github.com/jdf2e/nutui/issues) | <img src="https://camo.githubusercontent.com/db4276b4ee4b443158195e943e9e678cb4d2afb7580f70d4d817ef0a90413aec/687474703a2f2f73746f726167652e333630627579696d672e636f6d2f7461726f2d6a642d636f6d2f7374617469632f636f6e746163745f7461726f5f6e757475695f71722e706e67" width="100" /> 关注后回复「NutUI-React」 | 1022545110 |
95
+ | [NutUI React](https://github.com/jdf2e/nutui-react/issues) | <img src="https://storage.360buyimg.com/imgtools/17c67beff6-4acf07c0-609c-11ed-a6ef-69df15b605e4.png" width="100" /> Reply 「NutUI-React」 after following | 1025679314 |
96
+ | [NutUI x Taro](https://github.com/jdf2e/nutui/issues) | <img src="https://camo.githubusercontent.com/db4276b4ee4b443158195e943e9e678cb4d2afb7580f70d4d817ef0a90413aec/687474703a2f2f73746f726167652e333630627579696d672e636f6d2f7461726f2d6a642d636f6d2f7374617469632f636f6e746163745f7461726f5f6e757475695f71722e706e67" width="100" />Reply NutUI-React」 after following | 1022545110 |
91
97
 
92
- ## 参与共建
93
98
 
94
- #### NutUI 社区共建倡议
99
+ ## Join Us
95
100
 
96
- [NutUI-React 邀您共建,Contributor 您好](https://github.com/jdf2e/nutui-react/discussions/348)
101
+ #### NutUI Community
97
102
 
98
- #### NutUI 贡献代码
103
+ [*Welcome To NutUI-React Community*](https://github.com/jdf2e/nutui-react/discussions/348)
99
104
 
100
- NutUI 的共建方向主要分为:解决 issue、修复 bug、新增组件、增加国际化、UI 定制、平台适配、跨端扩展等。
105
+ #### Contribute to NutUI
101
106
 
102
- 欢迎社区开发者参与共建,在贡献您的代码之前请先阅读 [《NutUI 贡献指南》](https://github.com/jdf2e/nutui-react/discussions/348)。
107
+ There are some choices of contributing to NutUI as follows, solving issues, fixing bugs, adding new components, i18n, UI customization, platform and cross-end adaptation, etc.
103
108
 
104
- ## 问题反馈与建议
109
+ You are very welcome to contribute code to NutUI. Before your pull requests, please read [*NutUI Developer Contributing Guide*](https://github.com/jdf2e/nutui-react/discussions/348)。
105
110
 
106
- [给 NutUI 提 Issue](https://nutui.jd.com/nutui-issue-helper/?repo=jdf2e/nutui-react&lang=zh-cn)
107
111
 
108
- > 在反馈问题之前,推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545)和[《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html),这样您能够更容易获得理解和帮助。
112
+ ## Issue & Discussion
109
113
 
110
- [参与 NutUI 社区讨论](https://github.com/jdf2e/nutui-react/discussions)
114
+ [Report issues to NutUI](https://nutui.jd.com/nutui-issue-helper/?repo=jdf2e/nutui-react&lang=zh-cn)
111
115
 
112
- 如果您有任何想法、疑问或建议,都可以参与社区讨论分享您的观点。
116
+ > It is highly recommended to read [*How To Ask Questions The Smart Way*](https://github.com/ryanhanwu/, [*How To Ask Questions Of GitHub Community*](https://github.com/seajs/seajs/issues/545) and [*How to Report Bugs Effectively*](https://www.chiark.greenend.org.uk/~sgtatham/bugs.html), then you can get understanding and help more easily.
113
117
 
114
- ## 贡献者们
118
+ [NutUI Discussion](https://github.com/jdf2e/nutui-react/discussions)
119
+
120
+ If you have any ideas, questions or suggestions, you can share your opinions here.
121
+
122
+ ## Contributors
123
+
124
+ Thanks to all the following [developers](https://github.com/jdf2e/nutui-react/graphs/contributors)。 who have contributed code to NutUI.
115
125
 
116
- 感谢以下所有给 NutUI 贡献过代码的 [开发者](https://github.com/jdf2e/nutui-react/graphs/contributors)。
117
126
 
118
127
  <a href="https://github.com/jdf2e/nutui-react/graphs/contributors">
119
- <img src="https://contrib.rocks/image?repo=jdf2e/nutui-react" />
128
+ <img src="https://contrib.rocks/image?repo=jdf2e/nutui-react" alt="contributors"/>
120
129
  </a>
121
130
 
131
+
122
132
  ## Stargazers
123
133
 
124
134
  [![Stargazers repo roster for @jdf2e/nutui-react](https://reporoster.com/stars/jdf2e/nutui-react)](https://github.com/jdf2e/nutui-react/stargazers)
@@ -127,14 +137,15 @@ NutUI 的共建方向主要分为:解决 issue、修复 bug、新增组件、
127
137
 
128
138
  [![Forkers repo roster for @jdf2e/nutui-react](https://reporoster.com/forks/jdf2e/nutui-react)](https://github.com/jdf2e/nutui-react/network/members)
129
139
 
130
- ## 开发计划
140
+ ## Milestones
131
141
 
132
142
  [Milestones](https://github.com/jdf2e/nutui-react/projects)
133
143
 
134
- ## 更新日志
144
+ ## Release Notes
145
+
146
+ NutUI follows [Angular Style Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153). The up-to-date release notes are available on [Release](https://github.com/jdf2e/nutui-react/releases)
135
147
 
136
- 本项目遵从 [Angular Style Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153),更新日志请查阅 [Release](https://github.com/jdf2e/nutui-react/releases)。
137
148
 
138
- ## 开源协议
149
+ ## Open Source License
139
150
 
140
- 本项目基于 **MIT** 协议
151
+ This project is based on **MIT** protocol
@@ -1,5 +1,5 @@
1
- import { C as Collapse } from './collapse.taro-13cde270.js';
2
- export { C as default } from './collapse.taro-13cde270.js';
1
+ import { C as Collapse } from './collapse.taro-af58206c.js';
2
+ export { C as default } from './collapse.taro-af58206c.js';
3
3
  import 'react';
4
4
  import './bem-893ad28d.js';
5
5
  import '@bem-react/classname';
@@ -1,5 +1,5 @@
1
- import { C as CollapseItem } from './collapseitem-75843a5e.js';
2
- export { C as default } from './collapseitem-75843a5e.js';
1
+ import { C as CollapseItem } from './collapseitem-ce1849d2.js';
2
+ export { C as default } from './collapseitem-ce1849d2.js';
3
3
  import 'react';
4
4
  import './bem-893ad28d.js';
5
5
  import '@bem-react/classname';
@@ -1,8 +1,9 @@
1
- import { F as FormItem } from './formitem-9f11e314.js';
2
- export { F as default } from './formitem-9f11e314.js';
1
+ import { F as FormItem } from './formitem.taro-fef76bf1.js';
2
+ export { F as default } from './formitem.taro-fef76bf1.js';
3
3
  import 'react';
4
- import 'react-router-dom';
4
+ import './cell.taro-cf50c4f2.js';
5
+ import '@tarojs/taro';
5
6
  import './bem-893ad28d.js';
6
7
  import '@bem-react/classname';
7
- import './icon-8dc4de10.js';
8
+ import './icon.taro-1d0d4fb7.js';
8
9
  import './typings-1c5f2628.js';
package/dist/esm/Grid.js CHANGED
@@ -1,7 +1,8 @@
1
- import { G as Grid } from './grid.taro-d244170c.js';
2
- export { G as default } from './grid.taro-d244170c.js';
1
+ import { G as Grid } from './grid.taro-1f03be03.js';
2
+ export { G as default } from './grid.taro-1f03be03.js';
3
3
  import 'react';
4
4
  import './configprovider.taro-3838604b.js';
5
5
  import './zh-CN-dfc384d0.js';
6
6
  import './bem-893ad28d.js';
7
7
  import '@bem-react/classname';
8
+ import './grid.taro.context-39636af9.js';
@@ -1,5 +1,5 @@
1
- import { G as GridItem } from './griditem.taro-f7ee189b.js';
2
- export { G as default } from './griditem.taro-f7ee189b.js';
1
+ import { G as GridItem } from './griditem.taro-1452609c.js';
2
+ export { G as default } from './griditem.taro-1452609c.js';
3
3
  import 'react';
4
4
  import './configprovider.taro-3838604b.js';
5
5
  import './zh-CN-dfc384d0.js';
@@ -7,3 +7,4 @@ import './bem-893ad28d.js';
7
7
  import '@bem-react/classname';
8
8
  import './icon.taro-1d0d4fb7.js';
9
9
  import './typings-1c5f2628.js';
10
+ import './grid.taro.context-39636af9.js';
@@ -1,5 +1,5 @@
1
- import { N as NoticeBar } from './noticebar.taro-4915fed3.js';
2
- export { N as default } from './noticebar.taro-4915fed3.js';
1
+ import { N as NoticeBar } from './noticebar.taro-43c18dc9.js';
2
+ export { N as default } from './noticebar.taro-43c18dc9.js';
3
3
  import 'react';
4
4
  import 'classnames';
5
5
  import './icon.taro-1d0d4fb7.js';
@@ -1,2 +1,2 @@
1
-
1
+ import '../../Icon/style'
2
2
  import '../../../packages/trendarrow/trendarrow.scss'
@@ -14,7 +14,7 @@ var defaultProps = {
14
14
  rotate: 180
15
15
  };
16
16
  function areEqual(prevProps, nextProps) {
17
- return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
17
+ return prevProps.children === nextProps.children && JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
18
18
  }
19
19
  var Collapse = memo(function (props) {
20
20
  var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  var _excluded = ["children", "title", "isOpen", "onToggle", "name", "disabled", "icon", "rotate", "subTitle", "titleIcon", "titleIconColor", "titleIconPosition", "titleIconSize", "iconSize", "iconColor", "childnull", "iconClassPrefix", "iconFontClassName"];
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
- import React__default, { useState, useEffect, useCallback } from 'react';
7
+ import React__default, { useState, useCallback, useEffect } from 'react';
8
8
  import { c as cn } from './bem-893ad28d.js';
9
9
  import { I as Icon } from './icon-8dc4de10.js';
10
10
  import { C as ComponentDefaults } from './typings-1c5f2628.js';
@@ -64,10 +64,6 @@ var CollapseItem = function CollapseItem(props) {
64
64
  iconStyle = _useState8[0],
65
65
  setIconStyle = _useState8[1];
66
66
  var colBem = cn('collapse-item');
67
- useEffect(function () {
68
- setCurrHeight('auto');
69
- setUpdate(!update);
70
- }, [children]);
71
67
  var measuredRef = useCallback(function (node) {
72
68
  if (node !== null) {
73
69
  setDomHeight(node.getBoundingClientRect().height);
@@ -87,6 +83,14 @@ var CollapseItem = function CollapseItem(props) {
87
83
  setIconStyle(newIconStyle);
88
84
  }, 10);
89
85
  }, [isOpen, domHeight, rotate]);
86
+ useEffect(function () {
87
+ if (!isOpen) {
88
+ setCurrHeight('0px');
89
+ } else {
90
+ setCurrHeight('auto');
91
+ }
92
+ setUpdate(!update);
93
+ }, [children, isOpen]);
90
94
  return React__default.createElement("div", _objectSpread({
91
95
  className: colBem()
92
96
  }, rest), React__default.createElement("div", {
@@ -4,116 +4,15 @@ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized
4
4
  import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
8
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- var _excluded = ["children", "click", "onClick", "title", "subTitle", "desc", "descTextAlign", "isLink", "icon", "roundRadius", "url", "to", "replace", "center", "size", "className", "iconSlot", "linkSlot", "iconClassPrefix", "iconFontClassName"];
10
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
9
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
14
12
  import React__default, { createContext } from 'react';
15
- import { useHistory } from 'react-router-dom';
16
- import { c as cn } from './bem-893ad28d.js';
17
- import { I as Icon } from './icon-8dc4de10.js';
13
+ import { C as Cell } from './cell.taro-cf50c4f2.js';
18
14
  import { C as ComponentDefaults } from './typings-1c5f2628.js';
19
15
  var FormItemContext = createContext({});
20
- var defaultProps$1 = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
21
- title: null,
22
- subTitle: null,
23
- desc: '',
24
- descTextAlign: 'right',
25
- isLink: false,
26
- icon: '',
27
- roundRadius: '6px',
28
- url: '',
29
- to: '',
30
- replace: false,
31
- center: false,
32
- size: '',
33
- className: '',
34
- iconSlot: null,
35
- linkSlot: null,
36
- click: function click(event) {},
37
- onClick: function onClick(event) {}
38
- });
39
- var Cell = function Cell(props) {
40
- var _defaultProps$1$props = _objectSpread(_objectSpread({}, defaultProps$1), props),
41
- children = _defaultProps$1$props.children,
42
- click = _defaultProps$1$props.click,
43
- onClick = _defaultProps$1$props.onClick,
44
- title = _defaultProps$1$props.title,
45
- subTitle = _defaultProps$1$props.subTitle,
46
- desc = _defaultProps$1$props.desc,
47
- descTextAlign = _defaultProps$1$props.descTextAlign,
48
- isLink = _defaultProps$1$props.isLink,
49
- icon = _defaultProps$1$props.icon,
50
- roundRadius = _defaultProps$1$props.roundRadius,
51
- url = _defaultProps$1$props.url,
52
- to = _defaultProps$1$props.to,
53
- replace = _defaultProps$1$props.replace,
54
- center = _defaultProps$1$props.center,
55
- size = _defaultProps$1$props.size,
56
- className = _defaultProps$1$props.className,
57
- iconSlot = _defaultProps$1$props.iconSlot,
58
- linkSlot = _defaultProps$1$props.linkSlot,
59
- iconClassPrefix = _defaultProps$1$props.iconClassPrefix,
60
- iconFontClassName = _defaultProps$1$props.iconFontClassName,
61
- rest = _objectWithoutProperties(_defaultProps$1$props, _excluded);
62
- var b = cn('cell');
63
- var history = useHistory();
64
- var handleClick = function handleClick(event) {
65
- click(event);
66
- onClick(event);
67
- if (to && history) {
68
- history[replace ? 'replace' : 'push'](to);
69
- } else if (url) {
70
- replace ? window.location.replace(url) : window.location.href = url;
71
- }
72
- };
73
- var baseStyle = {
74
- borderRadius: Number.isNaN(Number(roundRadius)) ? String(roundRadius) : "".concat(roundRadius, "px")
75
- };
76
- var styles = title || subTitle || icon ? {} : {
77
- textAlign: descTextAlign,
78
- flex: 1
79
- };
80
- return React__default.createElement("div", _objectSpread({
81
- className: "".concat(b({
82
- clickable: !!(isLink || to),
83
- center: center,
84
- large: size === 'large'
85
- }, [className]), " "),
86
- onClick: function onClick(event) {
87
- return handleClick(event);
88
- },
89
- style: baseStyle
90
- }, rest), children || React__default.createElement(React__default.Fragment, null, icon || iconSlot ? React__default.createElement("div", {
91
- className: b('icon')
92
- }, iconSlot || (icon ? React__default.createElement(Icon, {
93
- classPrefix: iconClassPrefix,
94
- fontClassName: iconFontClassName,
95
- name: icon,
96
- className: "icon"
97
- }) : null)) : null, title || subTitle ? React__default.createElement("div", {
98
- className: "".concat(b('title'))
99
- }, title ? React__default.createElement("div", {
100
- className: b('maintitle')
101
- }, title) : null, subTitle ? React__default.createElement("div", {
102
- className: b('subtitle')
103
- }, subTitle) : null) : null, desc ? React__default.createElement("div", {
104
- className: b('value', {
105
- alone: !title && !subTitle
106
- }),
107
- style: styles
108
- }, desc) : null, !linkSlot && (isLink || to) ? React__default.createElement(Icon, {
109
- classPrefix: iconClassPrefix,
110
- fontClassName: iconFontClassName,
111
- name: "right",
112
- className: b('link')
113
- }) : linkSlot));
114
- };
115
- Cell.defaultProps = defaultProps$1;
116
- Cell.displayName = 'NutCell';
117
16
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
118
17
  name: '',
119
18
  label: '',
@@ -1,11 +1,12 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["children", "columnNum", "border", "gutter", "center", "square", "reverse", "direction", "style", "iconSize", "iconColor", "className"];
3
+ var _excluded = ["children", "columnNum", "border", "gutter", "center", "square", "reverse", "direction", "style", "iconSize", "iconColor", "className", "onClick"];
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
  import React__default from 'react';
7
7
  import { u as useConfig } from './configprovider.taro-3838604b.js';
8
8
  import { c as cn } from './bem-893ad28d.js';
9
+ import { G as GridContext } from './grid.taro.context-39636af9.js';
9
10
  var defaultProps = {
10
11
  columnNum: 4,
11
12
  border: true,
@@ -32,6 +33,7 @@ var Grid = function Grid(props) {
32
33
  iconSize = _defaultProps$props.iconSize,
33
34
  iconColor = _defaultProps$props.iconColor,
34
35
  className = _defaultProps$props.className,
36
+ onClick = _defaultProps$props.onClick,
35
37
  rest = _objectWithoutProperties(_defaultProps$props, _excluded);
36
38
  var childrenDom = React__default.Children.toArray(children);
37
39
  var pxCheck = function pxCheck(value) {
@@ -55,7 +57,11 @@ var Grid = function Grid(props) {
55
57
  return React__default.createElement("div", _objectSpread({
56
58
  className: rootClass(),
57
59
  style: rootStyle()
58
- }, rest), childrenDom.map(function (item, idex) {
60
+ }, rest), React__default.createElement(GridContext.Provider, {
61
+ value: {
62
+ onClick: onClick
63
+ }
64
+ }, childrenDom.map(function (item, idex) {
59
65
  return React__default.cloneElement(item, {
60
66
  index: idex,
61
67
  columnNum: columnNum,
@@ -68,7 +74,7 @@ var Grid = function Grid(props) {
68
74
  parentIconSize: iconSize,
69
75
  parentIconColor: iconColor
70
76
  });
71
- }));
77
+ })));
72
78
  };
73
79
  Grid.defaultProps = defaultProps;
74
80
  Grid.displayName = 'NutGrid';
@@ -0,0 +1,6 @@
1
+ import React__default from 'react';
2
+ var gridContext = {
3
+ onClick: function onClick(item, index) {}
4
+ };
5
+ var GridContext = React__default.createContext(gridContext);
6
+ export { GridContext as G };
@@ -3,11 +3,12 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  var _excluded = ["children", "columnNum", "index", "gutter", "square", "text", "icon", "iconColor", "iconSize", "parentIconSize", "parentIconColor", "border", "center", "reverse", "direction", "iconClassPrefix", "iconFontClassName", "onClick"];
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
- import React__default from 'react';
6
+ import React__default, { useContext } from 'react';
7
7
  import { u as useConfig } from './configprovider.taro-3838604b.js';
8
8
  import { c as cn } from './bem-893ad28d.js';
9
9
  import { I as Icon } from './icon.taro-1d0d4fb7.js';
10
10
  import { C as ComponentDefaults } from './typings-1c5f2628.js';
11
+ import { G as GridContext } from './grid.taro.context-39636af9.js';
11
12
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
12
13
  text: '',
13
14
  icon: '',
@@ -46,6 +47,7 @@ var GridItem = function GridItem(props) {
46
47
  onClick = _defaultProps$props.onClick,
47
48
  rest = _objectWithoutProperties(_defaultProps$props, _excluded);
48
49
  var b = cn('grid-item');
50
+ var context = useContext(GridContext);
49
51
  var pxCheck = function pxCheck(value) {
50
52
  return Number.isNaN(Number(value)) ? String(value) : "".concat(value, "px");
51
53
  };
@@ -71,6 +73,22 @@ var GridItem = function GridItem(props) {
71
73
  };
72
74
  var handleClick = function handleClick(e) {
73
75
  onClick && onClick(e);
76
+ context.onClick && context.onClick({
77
+ text: text,
78
+ icon: icon,
79
+ iconSize: iconSize,
80
+ iconColor: iconColor,
81
+ parentIconSize: parentIconSize,
82
+ parentIconColor: parentIconColor,
83
+ index: index,
84
+ columnNum: columnNum,
85
+ border: border,
86
+ gutter: gutter,
87
+ center: center,
88
+ square: square,
89
+ reverse: reverse,
90
+ direction: direction
91
+ }, index);
74
92
  };
75
93
  return React__default.createElement("div", _objectSpread(_objectSpread({
76
94
  className: b(),
@@ -205,16 +205,18 @@ var NoticeBar = function NoticeBar(props) {
205
205
  */
206
206
  var startRollEasy = function startRollEasy() {
207
207
  showhorseLamp();
208
- var timerCurr = setInterval(showhorseLamp, ~~(height / speed / 4) * 1000 + Number(standTime));
208
+ var time = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) * 1000 : ~~(height / speed / 4) * 1000;
209
+ var timerCurr = setInterval(showhorseLamp, time + Number(standTime));
209
210
  SetTimer(timerCurr);
210
211
  };
211
212
  var showhorseLamp = function showhorseLamp() {
212
213
  SetAnimate(true);
214
+ var time = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) * 1000 : ~~(height / speed / 4) * 1000;
213
215
  setTimeout(function () {
214
216
  scrollList.current.push(scrollList.current[0]);
215
217
  scrollList.current.shift();
216
218
  SetAnimate(false);
217
- }, ~~(height / speed / 4) * 1000);
219
+ }, time);
218
220
  };
219
221
  var startRoll = function startRoll() {
220
222
  var timerCurr = setInterval(function () {
@@ -277,10 +279,11 @@ var NoticeBar = function NoticeBar(props) {
277
279
  background: background,
278
280
  height: direction === 'vertical' ? "".concat(height, "px") : ''
279
281
  };
280
- var duringTime = ~~(height / speed / 4);
282
+ var duringTime = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) : ~~(height / speed / 4);
283
+ var noDuring = height / speed < 1 ? (height / speed).toFixed(1) : ~~(height / speed);
281
284
  var horseLampStyle = {
282
285
  transform: complexAm ? "translateY(".concat(distance, "px)") : '',
283
- transition: animate ? "all ".concat(duringTime === 0 ? ~~(height / speed) : duringTime, "s") : '',
286
+ transition: animate ? "all ".concat(duringTime === 0 ? noDuring : duringTime, "s") : '',
284
287
  marginTop: animate ? "-".concat(height, "px") : ''
285
288
  };
286
289
  var b = cn('noticebar');
@@ -10,8 +10,8 @@ export { L as Layout } from './layout.taro-358f014f.js';
10
10
  export { C as Col } from './col.taro-b61c7cba.js';
11
11
  export { R as Row } from './row.taro-37a895de.js';
12
12
  export { D as Divider } from './divider.taro-5236fe6a.js';
13
- export { G as Grid } from './grid.taro-d244170c.js';
14
- export { G as GridItem } from './griditem.taro-f7ee189b.js';
13
+ export { G as Grid } from './grid.taro-1f03be03.js';
14
+ export { G as GridItem } from './griditem.taro-1452609c.js';
15
15
  export { S as Sticky } from './sticky.taro-f35f365b.js';
16
16
  export { N as NavBar } from './navbar.taro-c931c078.js';
17
17
  export { F as FixedNav } from './fixednav.taro-7f01a850.js';
@@ -44,7 +44,7 @@ export { C as Cascader } from './cascader.taro-459f7d45.js';
44
44
  export { S as SearchBar } from './searchbar.taro-7347bd21.js';
45
45
  export { N as NumberKeyboard } from './numberkeyboard.taro-8ff8d319.js';
46
46
  export { F as Form } from './form.taro-111f816d.js';
47
- export { F as FormItem } from './formitem-9f11e314.js';
47
+ export { F as FormItem } from './formitem.taro-fef76bf1.js';
48
48
  export { A as ActionSheet } from './actionsheet.taro-360d8d34.js';
49
49
  export { B as BackTop } from './backtop.taro-99107c30.js';
50
50
  export { D as Drag } from './drag.taro-0717c783.js';
@@ -56,7 +56,7 @@ export { T as Toast } from './toast.taro-86862dff.js';
56
56
  export { S as Swipe } from './swipe.taro-83bc248f.js';
57
57
  export { P as PullToRefresh } from './pulltorefresh.taro-92ad45af.js';
58
58
  export { C as CircleProgress } from './circleprogress.taro-3c89a157.js';
59
- export { N as NoticeBar } from './noticebar.taro-4915fed3.js';
59
+ export { N as NoticeBar } from './noticebar.taro-43c18dc9.js';
60
60
  export { S as Steps } from './steps.taro-acf205a0.js';
61
61
  export { S as Step } from './step.taro-1c94e067.js';
62
62
  export { S as Swiper } from './swiper.taro-f314d67a.js';
@@ -69,8 +69,8 @@ export { T as Tag } from './tag.taro-bd900990.js';
69
69
  export { P as Popover } from './popover.taro-7e5dff8c.js';
70
70
  export { S as Skeleton } from './skeleton.taro-853ce460.js';
71
71
  export { C as CountDown } from './countdown.taro-c9a93845.js';
72
- export { C as Collapse } from './collapse.taro-13cde270.js';
73
- export { C as CollapseItem } from './collapseitem-75843a5e.js';
72
+ export { C as Collapse } from './collapse.taro-af58206c.js';
73
+ export { C as CollapseItem } from './collapseitem-ce1849d2.js';
74
74
  export { A as AnimatingNumbers } from './animatingnumbers.taro-6f40a2e9.js';
75
75
  export { E as Empty } from './empty.taro-b69b51fb.js';
76
76
  export { V as VirtualList } from './virtuallist.taro-f97ca13a.js';
@@ -98,13 +98,13 @@ import 'react-dom';
98
98
  import 'react-transition-group';
99
99
  import './zh-CN-dfc384d0.js';
100
100
  import './UserContext-be8097d2.js';
101
+ import './grid.taro.context-39636af9.js';
101
102
  import './configprovider-c5b2fa7f.js';
102
103
  import '@tarojs/components';
103
104
  import './offsetContext-0e3d04b3.js';
104
105
  import './useTouch-a2ea68c6.js';
105
106
  import './useClientRect-bf69d7b3.js';
106
107
  import './icon-8dc4de10.js';
107
- import 'react-router-dom';
108
108
  import '@use-gesture/react';
109
109
  import '@react-spring/web';
110
110
  import './UserContext-68f62e66.js';