@nutui/nutui-react-taro 1.3.14 → 1.3.15

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 +21 -12
  2. package/dist/esm/Animate/style/index.js +2 -0
  3. package/dist/esm/Animate.js +6 -0
  4. package/dist/esm/Ellipsis/style/index.js +2 -0
  5. package/dist/esm/Ellipsis.js +7 -0
  6. package/dist/esm/animate.taro-b0e83dd5.js +54 -0
  7. package/dist/esm/ellipsis.taro-5c2eac2a.js +309 -0
  8. package/dist/esm/nutui-react.es.js +2 -0
  9. package/dist/esm/types/src/locales/zh-UG.d.ts +3 -0
  10. package/dist/esm/types/src/packages/animate/__tests__/animate.spec.d.ts +1 -0
  11. package/dist/esm/types/src/packages/animate/animate.d.ts +11 -0
  12. package/dist/esm/types/src/packages/animate/animate.taro.d.ts +11 -0
  13. package/dist/esm/types/src/packages/animate/demo.d.ts +4 -0
  14. package/dist/esm/types/src/packages/animate/index.d.ts +2 -0
  15. package/dist/esm/types/src/packages/animate/index.taro.d.ts +2 -0
  16. package/dist/esm/types/src/packages/animate/type.d.ts +2 -0
  17. package/dist/esm/types/src/packages/ellipsis/__test__/ellipsis.spec.d.ts +1 -0
  18. package/dist/esm/types/src/packages/ellipsis/demo.d.ts +3 -0
  19. package/dist/esm/types/src/packages/ellipsis/ellipsis.d.ts +14 -0
  20. package/dist/esm/types/src/packages/ellipsis/ellipsis.taro.d.ts +14 -0
  21. package/dist/esm/types/src/packages/ellipsis/index.d.ts +2 -0
  22. package/dist/esm/types/src/packages/ellipsis/index.taro.d.ts +2 -0
  23. package/dist/esm/types/src/packages/nutui.react.build.d.ts +3 -1
  24. package/dist/esm/types/src/packages/nutui.react.d.ts +5 -1
  25. package/dist/esm/types/src/packages/nutui.react.scss.d.ts +2 -0
  26. package/dist/esm/types/src/packages/nutui.react.taro.d.ts +5 -1
  27. package/dist/esm/types/src/packages/nutui.react.taro.scss.d.ts +2 -0
  28. package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +3 -1
  29. package/dist/locales/base.js +1 -1
  30. package/dist/locales/en-US.js +1 -1
  31. package/dist/locales/id-ID.js +1 -1
  32. package/dist/locales/zh-CN.js +1 -1
  33. package/dist/locales/zh-TW.js +1 -1
  34. package/dist/locales/zh-UG.d.ts +3 -0
  35. package/dist/locales/zh-UG.js +132 -0
  36. package/dist/nutui.react.es.js +532 -251
  37. package/dist/nutui.react.umd.js +533 -250
  38. package/dist/packages/animate/animate.scss +284 -0
  39. package/dist/packages/ellipsis/ellipsis.scss +17 -0
  40. package/dist/style.css +1 -1
  41. package/dist/style.es.js +1 -1
  42. package/dist/styles/themes/default.scss +2 -0
  43. package/dist/types/index.d.ts +27 -1
  44. package/dist/types/nutui.taro.react.build.ts +5 -1
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,18 +1,27 @@
1
+ # v1.3.15
2
+ `2022-12-14`
3
+
4
+ * :sparkles: feat: 新增 animate 动画/动效组件 (#541) @junjun666
5
+ * :sparkles: feat: 新增 ellipsis 组件 (#515) @vickyYe
6
+ * :sparkles: feat: 新增维吾尔语言包 (#526) @MirGhojam
7
+ * :bug: fix: 修复 publish 脚本执行时机错误的问题 (#540) @oasis-cloud
8
+ * 📖 docs: 文档更新 tabbar 的 to 增加属性的说明 (#539) @oasis-cloud
9
+
1
10
  # v1.3.14
2
11
  `2022-12-09`
3
12
 
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
13
+ * :sparkles: feat: image 适配 taro (#507) @vickyYe
14
+ * :sparkles: feat: Grid 组件添加 onClick 事件,统一管理子项点击事件,无需在GridItem组件中分别添加点击事件 (#492) @cuicuiworld
15
+ * :bug: fix: react18 render 提示错误信息 (#524) @oasis-cloud
16
+ * :bug: fix: noticebar 纵向滚动渲染慢问题修复,设置高度小于默认值时动效失效问题修复 (#528) @vickyYe
17
+ * :bug: fix: icon 组件 mask-close 未展示叉号 (#527) @oasis-cloud
18
+ * :bug: fix: #508 修改折叠面板组件修改后不刷新问题 (#521) @zhenyulei
19
+ * :bug: fix: imagepreview 设置 initNo 后 active 计算错误 (#512) @oasis-cloud
20
+ * :bug: fix: 移除 formitem 对 react-router-dom 的依赖 (#513) @oasis-cloud
21
+ * :bug: fix: trendarrow 组件文档增加taro引入方式说明、css文件引入icon的scss文件、修改icon组件的引入方式 (#502) @irisSong
22
+ * 📖 docs: 修正 virtualList 的文档错误 (#510) @Antee
23
+ * 📖 docs: Readme 中英文修改 (#525) @vickyYe
24
+ * 📖 docs: 文档中增加 nutui-react-taro的 import 方式 (#522) @oasis-cloud
16
25
 
17
26
 
18
27
  # v1.3.13
@@ -0,0 +1,2 @@
1
+
2
+ import '../../../packages/animate/animate.scss'
@@ -0,0 +1,6 @@
1
+ import { A as Animate } from './animate.taro-b0e83dd5.js';
2
+ export { A as default } from './animate.taro-b0e83dd5.js';
3
+ import 'react';
4
+ import 'classnames';
5
+ import './bem-893ad28d.js';
6
+ import '@bem-react/classname';
@@ -0,0 +1,2 @@
1
+
2
+ import '../../../packages/ellipsis/ellipsis.scss'
@@ -0,0 +1,7 @@
1
+ import { E as Ellipsis } from './ellipsis.taro-5c2eac2a.js';
2
+ export { E as default } from './ellipsis.taro-5c2eac2a.js';
3
+ import 'react';
4
+ import '@tarojs/taro';
5
+ import './configprovider.taro-3838604b.js';
6
+ import './zh-CN-dfc384d0.js';
7
+ import './useClientRect-bf69d7b3.js';
@@ -0,0 +1,54 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["className", "type", "action", "loop", "onClick", "children"];
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
+ 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 } from 'react';
8
+ import classNames from 'classnames';
9
+ import { c as cn } from './bem-893ad28d.js';
10
+ var defaultProps = {
11
+ type: 'shake',
12
+ action: 'initial',
13
+ loop: false,
14
+ onClick: function onClick(event) {}
15
+ };
16
+ var Animate = function Animate(props) {
17
+ var _classNames;
18
+ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
19
+ className = _defaultProps$props.className,
20
+ type = _defaultProps$props.type,
21
+ action = _defaultProps$props.action,
22
+ loop = _defaultProps$props.loop,
23
+ onClick = _defaultProps$props.onClick,
24
+ children = _defaultProps$props.children,
25
+ rest = _objectWithoutProperties(_defaultProps$props, _excluded);
26
+ var _useState = useState(false),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ clicked = _useState2[0],
29
+ setClicked = _useState2[1];
30
+ var b = cn('animate');
31
+ var classes = classNames((_classNames = {
32
+ 'nut-ani-container': true
33
+ }, _defineProperty(_classNames, "".concat(b(''), "-").concat(type), action === 'initial' || clicked ? type : false), _defineProperty(_classNames, "loop", loop), _classNames));
34
+ var cls = classNames(classes, className);
35
+ var handleClick = function handleClick(event) {
36
+ setClicked(true);
37
+ //如果不是无限循环,清除类名
38
+ if (!loop) {
39
+ setTimeout(function () {
40
+ setClicked(false);
41
+ }, 1000);
42
+ }
43
+ onClick && onClick(event);
44
+ };
45
+ return React__default.createElement("div", {
46
+ className: "nut-animate"
47
+ }, React__default.createElement("div", _objectSpread({
48
+ className: cls,
49
+ onClick: handleClick
50
+ }, rest), children));
51
+ };
52
+ Animate.defaultProps = defaultProps;
53
+ Animate.displayName = 'NutAnimate';
54
+ export { Animate as A };
@@ -0,0 +1,309 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
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
+ 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, useRef, useLayoutEffect } from 'react';
8
+ import Taro from '@tarojs/taro';
9
+ import { u as useConfig } from './configprovider.taro-3838604b.js';
10
+ import { g as getRectByTaro } from './useClientRect-bf69d7b3.js';
11
+ var defaultProps = {
12
+ content: '',
13
+ direction: 'end',
14
+ rows: 1,
15
+ expandText: '',
16
+ collapseText: '',
17
+ symbol: '...',
18
+ lineHeight: '20'
19
+ };
20
+ var Ellipsis = function Ellipsis(props) {
21
+ var _ellipsis$current9, _ellipsis$current10, _ellipsis$current11, _ellipsis$current12;
22
+ useConfig();
23
+ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
24
+ children = _defaultProps$props.children,
25
+ content = _defaultProps$props.content,
26
+ direction = _defaultProps$props.direction,
27
+ rows = _defaultProps$props.rows,
28
+ expandText = _defaultProps$props.expandText,
29
+ collapseText = _defaultProps$props.collapseText,
30
+ symbol = _defaultProps$props.symbol,
31
+ lineHeight = _defaultProps$props.lineHeight,
32
+ onClick = _defaultProps$props.onClick,
33
+ onChange = _defaultProps$props.onChange;
34
+ var maxHeight = 0; // 当行的最大高度
35
+ var _useState = useState(false),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ exceeded = _useState2[0],
38
+ setExceeded = _useState2[1];
39
+ var _useState3 = useState(false),
40
+ _useState4 = _slicedToArray(_useState3, 2),
41
+ expanded = _useState4[0],
42
+ setExpanded = _useState4[1];
43
+ var ellipsis = useRef({
44
+ leading: '',
45
+ tailing: ''
46
+ });
47
+ var root = useRef(null);
48
+ var rootContain = useRef(null);
49
+ var symbolContain = useRef(null);
50
+ var contantCopy = useRef(content);
51
+ var lineH = 0; // 当行的最大高度
52
+ var originHeight = 0; // 原始高度
53
+ var refRandomId = Math.random().toString(36).slice(-8);
54
+ var widthRef = useRef('auto');
55
+ var widthBase = [14, 10, 7, 8.4, 10]; // 中、英(大)、英(小)、数字、其他字符的基础宽度
56
+ var symbolTextWidth = widthBase[0] * 0.7921;
57
+ var chineseReg = /^[\u4e00-\u9fa5]+$/; // 汉字
58
+ var digitReg = /^[0-9]+$/; // 数字
59
+ var letterUpperReg = /^[A-Z]+$/; // 字母
60
+ var letterLowerReg = /^[a-z]+$/; // 字母
61
+ useLayoutEffect(function () {
62
+ setTimeout(function () {
63
+ getSymbolInfo();
64
+ getReference();
65
+ }, 100);
66
+ }, []);
67
+ // 获取省略号宽度
68
+ var getSymbolInfo = /*#__PURE__*/function () {
69
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
70
+ var refe;
71
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
72
+ while (1) {
73
+ switch (_context.prev = _context.next) {
74
+ case 0:
75
+ _context.next = 2;
76
+ return getRectByTaro(symbolContain === null || symbolContain === void 0 ? void 0 : symbolContain.current);
77
+ case 2:
78
+ refe = _context.sent;
79
+ symbolTextWidth = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase[0] * 0.7921);
80
+ case 4:
81
+ case "end":
82
+ return _context.stop();
83
+ }
84
+ }
85
+ }, _callee);
86
+ }));
87
+ return function getSymbolInfo() {
88
+ return _ref.apply(this, arguments);
89
+ };
90
+ }();
91
+ var symbolText = function symbolText() {
92
+ if (direction === 'end' || direction === 'middle') {
93
+ return "".concat(symbol).concat(expandText);
94
+ }
95
+ return "".concat(symbol).concat(expandText).concat(symbol);
96
+ };
97
+ var getReference = /*#__PURE__*/function () {
98
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
99
+ var element, query;
100
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
101
+ while (1) {
102
+ switch (_context2.prev = _context2.next) {
103
+ case 0:
104
+ element = root.current;
105
+ query = Taro.createSelectorQuery();
106
+ query.select("#".concat(element.id)) && query.select("#".concat(element.id)).fields({
107
+ computedStyle: ['width', 'height', 'lineHeight', 'paddingTop', 'paddingBottom', 'fontSize']
108
+ }, function (res) {
109
+ lineH = pxToNumber(res.lineHeight === 'normal' ? lineHeight : res.lineHeight);
110
+ maxHeight = Math.floor(lineH * (Number(rows) + 0.5) + pxToNumber(res.paddingTop) + pxToNumber(res.paddingBottom));
111
+ originHeight = pxToNumber(res.height);
112
+ widthRef.current = res.width;
113
+ // 设置基础字符
114
+ var bsize = pxToNumber(res.fontSize);
115
+ widthBase = [bsize, bsize * 0.72, bsize * 0.53, bsize * 0.4, bsize * 0.75];
116
+ calcEllipse();
117
+ }).exec();
118
+ case 3:
119
+ case "end":
120
+ return _context2.stop();
121
+ }
122
+ }
123
+ }, _callee2);
124
+ }));
125
+ return function getReference() {
126
+ return _ref2.apply(this, arguments);
127
+ };
128
+ }();
129
+ // 计算省略号的位置
130
+ var calcEllipse = /*#__PURE__*/function () {
131
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
132
+ var refe, rowNum, end, _end, start;
133
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
134
+ while (1) {
135
+ switch (_context3.prev = _context3.next) {
136
+ case 0:
137
+ _context3.next = 2;
138
+ return getRectByTaro(rootContain.current);
139
+ case 2:
140
+ refe = _context3.sent;
141
+ if (refe.height <= maxHeight) {
142
+ setExceeded(false);
143
+ } else {
144
+ rowNum = Math.floor(content.length / (originHeight / lineH - 1)); // 每行的字数
145
+ if (direction === 'middle') {
146
+ end = content.length;
147
+ ellipsis.current.leading = tailorContent(0, rowNum * (Number(rows) + 0.5), 'end');
148
+ ellipsis.current.tailing = tailorContent(content.length - rowNum * (Number(rows) + 0.5), end, 'start');
149
+ } else if (direction === 'end') {
150
+ _end = rowNum * (Number(rows) + 0.5);
151
+ ellipsis.current.leading = tailorContent(0, _end);
152
+ } else {
153
+ start = content.length - rowNum * (Number(rows) + 0.5) - 5;
154
+ ellipsis.current.tailing = tailorContent(start, content.length);
155
+ }
156
+ // 进行兜底判断,是否符合要求
157
+ assignContent();
158
+ setTimeout(function () {
159
+ verifyEllipsis();
160
+ }, 100);
161
+ }
162
+ case 4:
163
+ case "end":
164
+ return _context3.stop();
165
+ }
166
+ }
167
+ }, _callee3);
168
+ }));
169
+ return function calcEllipse() {
170
+ return _ref3.apply(this, arguments);
171
+ };
172
+ }();
173
+ // 验证省略号
174
+ var verifyEllipsis = /*#__PURE__*/function () {
175
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
176
+ var refe, _ellipsis$current, _ellipsis$current$lea, _ellipsis$current2, _ellipsis$current3, _ellipsis$current3$ta, _ellipsis$current4;
177
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
178
+ while (1) {
179
+ switch (_context4.prev = _context4.next) {
180
+ case 0:
181
+ _context4.next = 2;
182
+ return getRectByTaro(rootContain.current);
183
+ case 2:
184
+ refe = _context4.sent;
185
+ if (refe && refe.height && refe.height > maxHeight) {
186
+ if (direction === 'end') {
187
+ ellipsis.current.leading = (_ellipsis$current = ellipsis.current) === null || _ellipsis$current === void 0 ? void 0 : (_ellipsis$current$lea = _ellipsis$current.leading) === null || _ellipsis$current$lea === void 0 ? void 0 : _ellipsis$current$lea.slice(0, ((_ellipsis$current2 = ellipsis.current) === null || _ellipsis$current2 === void 0 ? void 0 : _ellipsis$current2.leading.length) - 1);
188
+ } else {
189
+ ellipsis.current.tailing = (_ellipsis$current3 = ellipsis.current) === null || _ellipsis$current3 === void 0 ? void 0 : (_ellipsis$current3$ta = _ellipsis$current3.tailing) === null || _ellipsis$current3$ta === void 0 ? void 0 : _ellipsis$current3$ta.slice(1, (_ellipsis$current4 = ellipsis.current) === null || _ellipsis$current4 === void 0 ? void 0 : _ellipsis$current4.tailing.length);
190
+ }
191
+ assignContent();
192
+ setTimeout(function () {
193
+ verifyEllipsis();
194
+ }, 100);
195
+ }
196
+ case 4:
197
+ case "end":
198
+ return _context4.stop();
199
+ }
200
+ }
201
+ }, _callee4);
202
+ }));
203
+ return function verifyEllipsis() {
204
+ return _ref4.apply(this, arguments);
205
+ };
206
+ }();
207
+ var assignContent = function assignContent() {
208
+ var _ellipsis$current5, _ellipsis$current6, _ellipsis$current7, _ellipsis$current8;
209
+ contantCopy.current = "".concat(((_ellipsis$current5 = ellipsis.current) === null || _ellipsis$current5 === void 0 ? void 0 : _ellipsis$current5.leading) || '').concat((_ellipsis$current6 = ellipsis.current) !== null && _ellipsis$current6 !== void 0 && _ellipsis$current6.leading ? symbol : '').concat(expandText || '').concat((_ellipsis$current7 = ellipsis.current) !== null && _ellipsis$current7 !== void 0 && _ellipsis$current7.tailing ? symbol : '').concat(((_ellipsis$current8 = ellipsis.current) === null || _ellipsis$current8 === void 0 ? void 0 : _ellipsis$current8.tailing) || '');
210
+ };
211
+ // 计算省略号
212
+ var tailorContent = function tailorContent(left, right) {
213
+ var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
214
+ var threeDotWidth = symbolTextWidth;
215
+ var direc = direction === 'middle' && type ? type : direction;
216
+ setExceeded(true);
217
+ var widthPart = -1;
218
+ var start = left;
219
+ var end = right;
220
+ var cutoff = 0;
221
+ var marking = 0;
222
+ if (direc === 'end') {
223
+ marking = start;
224
+ cutoff = end;
225
+ } else {
226
+ marking = end;
227
+ cutoff = start;
228
+ }
229
+ var contentWidth = pxToNumber(widthRef.current) * Number(rows) - threeDotWidth;
230
+ var contentPartWidth = direction === 'middle' ? contentWidth / 2 : contentWidth;
231
+ while (widthPart < contentPartWidth) {
232
+ var zi = content[marking];
233
+ if (chineseReg.test(zi)) {
234
+ widthPart = Number(widthPart + widthBase[0]);
235
+ } else if (letterUpperReg.test(zi)) {
236
+ widthPart = Number(widthPart + widthBase[1]);
237
+ } else if (letterLowerReg.test(zi)) {
238
+ widthPart = Number(widthPart + widthBase[2]);
239
+ } else if (digitReg.test(zi)) {
240
+ widthPart = Number(widthPart + widthBase[3]);
241
+ } else {
242
+ widthPart = Number(widthPart + widthBase[4]);
243
+ }
244
+ cutoff = marking;
245
+ direc === 'end' ? marking++ : marking--;
246
+ }
247
+ if (direc === 'end') {
248
+ return content.slice(0, cutoff);
249
+ }
250
+ return content.slice(cutoff, end);
251
+ };
252
+ var pxToNumber = function pxToNumber(value) {
253
+ if (!value) return 0;
254
+ var match = value.match(/^\d*(\.\d*)?/);
255
+ return match ? Number(match[0]) : 0;
256
+ };
257
+ // 展开收起
258
+ var clickHandle = function clickHandle(type) {
259
+ if (type === 1) {
260
+ setExpanded(true);
261
+ onChange && onChange('expand');
262
+ // emit('change', 'expand')
263
+ } else {
264
+ setExpanded(false);
265
+ onChange && onChange('collapse');
266
+ }
267
+ };
268
+ // 文本点击
269
+ var handleClick = function handleClick() {
270
+ onClick && onClick();
271
+ };
272
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
273
+ className: "nut-ellipsis",
274
+ onClick: handleClick,
275
+ ref: root,
276
+ id: "root".concat(refRandomId)
277
+ }, React__default.createElement("div", null, !exceeded ? React__default.createElement("div", {
278
+ className: "nut-ellipsis-wordbreak"
279
+ }, content) : null, exceeded && !expanded ? React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
280
+ className: "nut-ellipsis-wordbreak"
281
+ }, (_ellipsis$current9 = ellipsis.current) === null || _ellipsis$current9 === void 0 ? void 0 : _ellipsis$current9.leading, ((_ellipsis$current10 = ellipsis.current) === null || _ellipsis$current10 === void 0 ? void 0 : _ellipsis$current10.leading) && symbol, expandText ? React__default.createElement("span", {
282
+ className: "nut-ellipsis-text",
283
+ onClick: function onClick() {
284
+ clickHandle(1);
285
+ }
286
+ }, expandText) : null, ((_ellipsis$current11 = ellipsis.current) === null || _ellipsis$current11 === void 0 ? void 0 : _ellipsis$current11.tailing) && symbol, (_ellipsis$current12 = ellipsis.current) === null || _ellipsis$current12 === void 0 ? void 0 : _ellipsis$current12.tailing)) : null, exceeded && expanded ? React__default.createElement(React__default.Fragment, null, content, expandText ? React__default.createElement("span", {
287
+ className: "nut-ellipsis-text",
288
+ onClick: function onClick() {
289
+ clickHandle(2);
290
+ }
291
+ }, collapseText) : null) : null)), React__default.createElement("div", {
292
+ className: "nut-ellipsis-copy",
293
+ ref: rootContain,
294
+ id: "rootContain".concat(refRandomId),
295
+ style: {
296
+ width: "".concat(widthRef)
297
+ }
298
+ }, React__default.createElement("div", null, contantCopy.current)), React__default.createElement("div", {
299
+ className: "nut-ellipsis-copy",
300
+ ref: symbolContain,
301
+ id: "symbolContain".concat(refRandomId),
302
+ style: {
303
+ display: 'inline'
304
+ }
305
+ }, symbolText()));
306
+ };
307
+ Ellipsis.defaultProps = defaultProps;
308
+ Ellipsis.displayName = 'NutEllipsis';
309
+ export { Ellipsis as E };
@@ -81,6 +81,8 @@ export { A as Audio } from './audio.taro-ba2f6d01.js';
81
81
  export { I as ImagePreview } from './imagepreview.taro-69d47ab0.js';
82
82
  export { T as TrendArrow } from './trendarrow.taro-5a7153e4.js';
83
83
  export { W as WaterMark } from './watermark.taro-7aab4afb.js';
84
+ export { A as Animate } from './animate.taro-b0e83dd5.js';
85
+ export { E as Ellipsis } from './ellipsis.taro-5c2eac2a.js';
84
86
  export { A as Address } from './address.taro-5e5bdac3.js';
85
87
  export { B as Barrage } from './barrage.taro-d86c367a.js';
86
88
  export { S as Signature } from './signature.taro-a4f4b45a.js';
@@ -0,0 +1,3 @@
1
+ import { BaseLang } from './base';
2
+ declare const zhUG: BaseLang;
3
+ export default zhUG;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,11 @@
1
+ import React, { FunctionComponent } from 'react';
2
+ import { AnimateType, AnimateAction } from './type';
3
+ export interface AnimateProps {
4
+ type: AnimateType;
5
+ action: AnimateAction;
6
+ loop: boolean;
7
+ className: string;
8
+ style: React.CSSProperties;
9
+ onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
10
+ }
11
+ export declare const Animate: FunctionComponent<Partial<AnimateProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -0,0 +1,11 @@
1
+ import React, { FunctionComponent } from 'react';
2
+ import { AnimateType, AnimateAction } from './type';
3
+ export interface AnimateProps {
4
+ type: AnimateType;
5
+ action: AnimateAction;
6
+ loop: boolean;
7
+ className: string;
8
+ style: React.CSSProperties;
9
+ onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
10
+ }
11
+ export declare const Animate: FunctionComponent<Partial<AnimateProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './demo.scss';
3
+ declare const AnimateDemo: () => JSX.Element;
4
+ export default AnimateDemo;
@@ -0,0 +1,2 @@
1
+ import { Animate } from './animate';
2
+ export default Animate;
@@ -0,0 +1,2 @@
1
+ import { Animate } from './animate.taro';
2
+ export default Animate;
@@ -0,0 +1,2 @@
1
+ export declare type AnimateType = 'shake' | 'ripple' | 'breath' | 'float' | 'slide-right' | 'slide-left' | 'slide-top' | 'slide-bottom' | 'jump' | 'twinkle' | 'flicker';
2
+ export declare type AnimateAction = 'initial' | 'click';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const EllipsisDemo: () => JSX.Element;
3
+ export default EllipsisDemo;
@@ -0,0 +1,14 @@
1
+ import React, { FunctionComponent } from 'react';
2
+ export declare type Direction = 'start' | 'end' | 'middle';
3
+ export interface EllipsisProps {
4
+ content: string;
5
+ direction: string;
6
+ rows: number | string;
7
+ expandText: string;
8
+ collapseText: string;
9
+ symbol: string;
10
+ lineHeight: number | string;
11
+ onClick: () => void;
12
+ onChange: (type: string) => void;
13
+ }
14
+ export declare const Ellipsis: FunctionComponent<Partial<EllipsisProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange'>>;
@@ -0,0 +1,14 @@
1
+ import React, { FunctionComponent } from 'react';
2
+ export declare type Direction = 'start' | 'end' | 'middle';
3
+ export interface EllipsisProps {
4
+ content: string;
5
+ direction: string;
6
+ rows: number | string;
7
+ expandText: string;
8
+ collapseText: string;
9
+ symbol: string;
10
+ lineHeight: number | string;
11
+ onClick: () => void;
12
+ onChange: (type: string) => void;
13
+ }
14
+ export declare const Ellipsis: FunctionComponent<Partial<EllipsisProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange'>>;
@@ -0,0 +1,2 @@
1
+ import { Ellipsis } from './ellipsis';
2
+ export default Ellipsis;
@@ -0,0 +1,2 @@
1
+ import { Ellipsis } from './ellipsis.taro';
2
+ export default Ellipsis;
@@ -83,6 +83,8 @@ import Audio from '@/packages/audio';
83
83
  import ImagePreview from '@/packages/imagepreview';
84
84
  import TrendArrow from '@/packages/trendarrow';
85
85
  import WaterMark from '@/packages/watermark';
86
+ import Animate from '@/packages/animate';
87
+ import Ellipsis from '@/packages/ellipsis';
86
88
  import Address from '@/packages/address';
87
89
  import Barrage from '@/packages/barrage';
88
90
  import Signature from '@/packages/signature';
@@ -90,4 +92,4 @@ import Card from '@/packages/card';
90
92
  import TimePannel from '@/packages/timepannel';
91
93
  import TimeDetail from '@/packages/timedetail';
92
94
  import TimeSelect from '@/packages/timeselect';
93
- export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Image, Layout, Col, Row, Divider, Grid, GridItem, Sticky, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, Form, FormItem, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, TrendArrow, WaterMark, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
95
+ export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Image, Layout, Col, Row, Divider, Grid, GridItem, Sticky, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, Form, FormItem, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, TrendArrow, WaterMark, Animate, Ellipsis, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
@@ -83,6 +83,8 @@ import Audio from '@/packages/audio';
83
83
  import ImagePreview from '@/packages/imagepreview';
84
84
  import TrendArrow from '@/packages/trendarrow';
85
85
  import WaterMark from '@/packages/watermark';
86
+ import Animate from '@/packages/animate';
87
+ import Ellipsis from '@/packages/ellipsis';
86
88
  import Address from '@/packages/address';
87
89
  import Barrage from '@/packages/barrage';
88
90
  import Signature from '@/packages/signature';
@@ -175,6 +177,8 @@ import '@/packages/audio/audio.scss';
175
177
  import '@/packages/imagepreview/imagepreview.scss';
176
178
  import '@/packages/trendarrow/trendarrow.scss';
177
179
  import '@/packages/watermark/watermark.scss';
180
+ import '@/packages/animate/animate.scss';
181
+ import '@/packages/ellipsis/ellipsis.scss';
178
182
  import '@/packages/address/address.scss';
179
183
  import '@/packages/barrage/barrage.scss';
180
184
  import '@/packages/signature/signature.scss';
@@ -182,4 +186,4 @@ import '@/packages/card/card.scss';
182
186
  import '@/packages/timepannel/timepannel.scss';
183
187
  import '@/packages/timedetail/timedetail.scss';
184
188
  import '@/packages/timeselect/timeselect.scss';
185
- export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Image, Layout, Col, Row, Divider, Grid, GridItem, Sticky, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, Form, FormItem, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, TrendArrow, WaterMark, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
189
+ export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Image, Layout, Col, Row, Divider, Grid, GridItem, Sticky, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, Form, FormItem, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, TrendArrow, WaterMark, Animate, Ellipsis, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
@@ -83,6 +83,8 @@ import '@/packages/audio/audio.scss';
83
83
  import '@/packages/imagepreview/imagepreview.scss';
84
84
  import '@/packages/trendarrow/trendarrow.scss';
85
85
  import '@/packages/watermark/watermark.scss';
86
+ import '@/packages/animate/animate.scss';
87
+ import '@/packages/ellipsis/ellipsis.scss';
86
88
  import '@/packages/address/address.scss';
87
89
  import '@/packages/barrage/barrage.scss';
88
90
  import '@/packages/signature/signature.scss';
@@ -83,6 +83,8 @@ import Audio from '@/packages/audio/index.taro';
83
83
  import ImagePreview from '@/packages/imagepreview/index.taro';
84
84
  import TrendArrow from '@/packages/trendarrow/index.taro';
85
85
  import WaterMark from '@/packages/watermark/index.taro';
86
+ import Animate from '@/packages/animate/index.taro';
87
+ import Ellipsis from '@/packages/ellipsis/index.taro';
86
88
  import Address from '@/packages/address/index.taro';
87
89
  import Barrage from '@/packages/barrage/index.taro';
88
90
  import Signature from '@/packages/signature/index.taro';
@@ -175,6 +177,8 @@ import '@/packages/audio/audio.scss';
175
177
  import '@/packages/imagepreview/imagepreview.scss';
176
178
  import '@/packages/trendarrow/trendarrow.scss';
177
179
  import '@/packages/watermark/watermark.scss';
180
+ import '@/packages/animate/animate.scss';
181
+ import '@/packages/ellipsis/ellipsis.scss';
178
182
  import '@/packages/address/address.scss';
179
183
  import '@/packages/barrage/barrage.scss';
180
184
  import '@/packages/signature/signature.scss';
@@ -182,4 +186,4 @@ import '@/packages/card/card.scss';
182
186
  import '@/packages/timepannel/timepannel.scss';
183
187
  import '@/packages/timedetail/timedetail.scss';
184
188
  import '@/packages/timeselect/timeselect.scss';
185
- export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Image, Layout, Col, Row, Divider, Grid, GridItem, Sticky, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, Form, FormItem, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, TrendArrow, WaterMark, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
189
+ export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Image, Layout, Col, Row, Divider, Grid, GridItem, Sticky, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, Form, FormItem, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, TrendArrow, WaterMark, Animate, Ellipsis, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
@@ -83,6 +83,8 @@ import '@/packages/audio/audio.scss';
83
83
  import '@/packages/imagepreview/imagepreview.scss';
84
84
  import '@/packages/trendarrow/trendarrow.scss';
85
85
  import '@/packages/watermark/watermark.scss';
86
+ import '@/packages/animate/animate.scss';
87
+ import '@/packages/ellipsis/ellipsis.scss';
86
88
  import '@/packages/address/address.scss';
87
89
  import '@/packages/barrage/barrage.scss';
88
90
  import '@/packages/signature/signature.scss';