@nutui/nutui-react 3.0.8 → 3.0.9-beta.1

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 (141) hide show
  1. package/CHANGELOG.md +13 -14
  2. package/dist/cjs/hooks/index.d.ts +12 -0
  3. package/dist/cjs/hooks/index.js +17 -0
  4. package/dist/cjs/hooks/index.taro.js +19 -0
  5. package/dist/cjs/hooks/{use-custom-event.js → taro/use-custom-event.js} +1 -1
  6. package/dist/cjs/hooks/{use-lock-scoll-taro.js → taro/use-lock-scoll.js} +1 -1
  7. package/dist/cjs/hooks/use-memo.d.ts +1 -1
  8. package/dist/cjs/hooks/use-memo.js +1 -1
  9. package/dist/cjs/hooks/use-refs.d.ts +1 -1
  10. package/dist/cjs/hooks/use-refs.js +1 -1
  11. package/dist/cjs/hooks/use-uuid.d.ts +1 -1
  12. package/dist/cjs/hooks/use-uuid.js +1 -1
  13. package/dist/cjs/hooks/use-watch.d.ts +2 -2
  14. package/dist/cjs/hooks/use-watch.js +2 -3
  15. package/dist/cjs/packages/avatarcropper/avatarcropper.js +2 -2
  16. package/dist/cjs/packages/configprovider/configprovider.js +4 -4
  17. package/dist/cjs/packages/noticebar/noticebar.js +4 -4
  18. package/dist/cjs/packages/nutui.react.build.d.ts +2 -0
  19. package/dist/cjs/packages/nutui.react.build.js +2 -0
  20. package/dist/cjs/packages/nutui.react.d.ts +2 -0
  21. package/dist/cjs/packages/nutui.react.js +2 -0
  22. package/dist/cjs/packages/picker/picker.js +2 -2
  23. package/dist/cjs/packages/popover/popover.js +2 -2
  24. package/dist/cjs/packages/range/range.js +3 -3
  25. package/dist/cjs/packages/rate/rate.js +4 -4
  26. package/dist/cjs/packages/sticky/sticky.js +9 -9
  27. package/dist/cjs/packages/swipe/swipe.js +2 -2
  28. package/dist/cjs/packages/tour/tour.js +2 -2
  29. package/dist/cjs/utils/clamp.d.ts +1 -0
  30. package/dist/cjs/utils/clamp.js +13 -0
  31. package/dist/cjs/utils/index.d.ts +28 -6
  32. package/dist/cjs/utils/index.js +29 -54
  33. package/dist/cjs/utils/index.taro.js +39 -0
  34. package/dist/cjs/utils/interceptor.js +2 -2
  35. package/dist/cjs/utils/is-function.d.ts +1 -0
  36. package/dist/cjs/utils/is-function.js +14 -0
  37. package/dist/cjs/utils/is-object.d.ts +1 -0
  38. package/dist/cjs/utils/is-object.js +14 -0
  39. package/dist/cjs/utils/is-promise.d.ts +1 -0
  40. package/dist/cjs/utils/is-promise.js +15 -0
  41. package/dist/cjs/utils/lru.d.ts +1 -1
  42. package/dist/cjs/utils/lru.js +1 -1
  43. package/dist/cjs/utils/merge.d.ts +0 -1
  44. package/dist/cjs/utils/merge.js +0 -4
  45. package/dist/cjs/utils/prevent-default.d.ts +1 -0
  46. package/dist/cjs/utils/prevent-default.js +18 -0
  47. package/dist/cjs/utils/raf.d.ts +0 -1
  48. package/dist/cjs/utils/raf.js +3 -6
  49. package/dist/{es/utils → cjs/utils/taro}/add-color-for-harmony.d.ts +1 -2
  50. package/dist/cjs/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +5 -11
  51. package/dist/cjs/utils/taro/get-rect-by-id.d.ts +1 -0
  52. package/dist/cjs/{hooks/use-taro-rect.js → utils/taro/get-rect-by-id.js} +3 -3
  53. package/dist/cjs/utils/{get-rect-by-taro.d.ts → taro/get-rect.d.ts} +1 -1
  54. package/dist/cjs/utils/{get-rect-by-taro.js → taro/get-rect.js} +9 -10
  55. package/dist/cjs/utils/taro/px-transform.d.ts +1 -0
  56. package/dist/cjs/utils/{px-transform.js → taro/px-transform.js} +3 -3
  57. package/dist/cjs/utils/upper-case-first.d.ts +1 -0
  58. package/dist/cjs/utils/upper-case-first.js +17 -0
  59. package/dist/es/hooks/index.d.ts +12 -0
  60. package/dist/es/hooks/index.js +12 -0
  61. package/dist/es/hooks/index.taro.js +14 -0
  62. package/dist/es/hooks/{use-custom-event.js → taro/use-custom-event.js} +1 -1
  63. package/dist/es/hooks/{use-lock-scoll-taro.js → taro/use-lock-scoll.js} +1 -1
  64. package/dist/es/hooks/use-memo.d.ts +1 -1
  65. package/dist/es/hooks/use-memo.js +1 -1
  66. package/dist/es/hooks/use-refs.d.ts +1 -1
  67. package/dist/es/hooks/use-refs.js +1 -1
  68. package/dist/es/hooks/use-uuid.d.ts +1 -1
  69. package/dist/es/hooks/use-uuid.js +1 -1
  70. package/dist/es/hooks/use-watch.d.ts +2 -2
  71. package/dist/es/hooks/use-watch.js +1 -2
  72. package/dist/es/packages/avatarcropper/avatarcropper.js +1 -1
  73. package/dist/es/packages/configprovider/configprovider.js +2 -2
  74. package/dist/es/packages/noticebar/noticebar.js +1 -1
  75. package/dist/es/packages/nutui.react.build.d.ts +2 -0
  76. package/dist/es/packages/nutui.react.build.js +2 -0
  77. package/dist/es/packages/picker/picker.js +1 -1
  78. package/dist/es/packages/popover/popover.js +1 -1
  79. package/dist/es/packages/range/range.js +1 -1
  80. package/dist/es/packages/rate/rate.js +2 -2
  81. package/dist/es/packages/sticky/sticky.js +2 -2
  82. package/dist/es/packages/swipe/swipe.js +1 -1
  83. package/dist/es/packages/tour/tour.js +1 -1
  84. package/dist/es/utils/clamp.d.ts +1 -0
  85. package/dist/es/utils/clamp.js +3 -0
  86. package/dist/es/utils/index.d.ts +28 -6
  87. package/dist/es/utils/index.js +28 -29
  88. package/dist/es/utils/index.taro.js +34 -0
  89. package/dist/es/utils/interceptor.js +1 -1
  90. package/dist/es/utils/is-function.d.ts +1 -0
  91. package/dist/es/utils/is-function.js +4 -0
  92. package/dist/es/utils/is-object.d.ts +1 -0
  93. package/dist/es/utils/is-object.js +4 -0
  94. package/dist/es/utils/is-promise.d.ts +1 -0
  95. package/dist/es/utils/is-promise.js +5 -0
  96. package/dist/es/utils/lru.d.ts +1 -1
  97. package/dist/es/utils/lru.js +1 -2
  98. package/dist/es/utils/merge.d.ts +0 -1
  99. package/dist/es/utils/merge.js +0 -1
  100. package/dist/es/utils/prevent-default.d.ts +1 -0
  101. package/dist/es/utils/prevent-default.js +8 -0
  102. package/dist/es/utils/raf.d.ts +0 -1
  103. package/dist/es/utils/raf.js +1 -1
  104. package/dist/{cjs/utils → es/utils/taro}/add-color-for-harmony.d.ts +1 -2
  105. package/dist/es/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +2 -3
  106. package/dist/es/utils/taro/get-rect-by-id.d.ts +1 -0
  107. package/dist/es/{hooks/use-taro-rect.js → utils/taro/get-rect-by-id.js} +1 -1
  108. package/dist/es/utils/{get-rect-by-taro.d.ts → taro/get-rect.d.ts} +1 -1
  109. package/dist/es/utils/{get-rect-by-taro.js → taro/get-rect.js} +4 -4
  110. package/dist/es/utils/taro/px-transform.d.ts +1 -0
  111. package/dist/es/utils/{px-transform.js → taro/px-transform.js} +2 -2
  112. package/dist/es/utils/upper-case-first.d.ts +1 -0
  113. package/dist/es/utils/upper-case-first.js +7 -0
  114. package/dist/nutui.react.umd.js +961 -724
  115. package/dist/style.css +1 -1
  116. package/dist/style.scss +33 -33
  117. package/package.json +1 -1
  118. package/dist/cjs/hooks/use-taro-rect.d.ts +0 -1
  119. package/dist/cjs/utils/px-transform.d.ts +0 -1
  120. package/dist/es/hooks/use-taro-rect.d.ts +0 -1
  121. package/dist/es/utils/px-transform.d.ts +0 -1
  122. /package/dist/cjs/hooks/{use-custom-event.d.ts → taro/use-custom-event.d.ts} +0 -0
  123. /package/dist/cjs/hooks/{use-lock-scoll-taro.d.ts → taro/use-lock-scoll.d.ts} +0 -0
  124. /package/dist/cjs/utils/{test/event.d.ts → event-mocker.d.ts} +0 -0
  125. /package/dist/cjs/utils/{test/event.js → event-mocker.js} +0 -0
  126. /package/dist/cjs/{hooks/use-client-rect.d.ts → utils/get-rect.d.ts} +0 -0
  127. /package/dist/cjs/{hooks/use-client-rect.js → utils/get-rect.js} +0 -0
  128. /package/dist/cjs/utils/{get-system-info.d.ts → taro/get-system-info.d.ts} +0 -0
  129. /package/dist/cjs/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
  130. /package/dist/cjs/utils/{platform-taro.d.ts → taro/platform.d.ts} +0 -0
  131. /package/dist/cjs/utils/{platform-taro.js → taro/platform.js} +0 -0
  132. /package/dist/es/hooks/{use-custom-event.d.ts → taro/use-custom-event.d.ts} +0 -0
  133. /package/dist/es/hooks/{use-lock-scoll-taro.d.ts → taro/use-lock-scoll.d.ts} +0 -0
  134. /package/dist/es/utils/{test/event.d.ts → event-mocker.d.ts} +0 -0
  135. /package/dist/es/utils/{test/event.js → event-mocker.js} +0 -0
  136. /package/dist/es/{hooks/use-client-rect.d.ts → utils/get-rect.d.ts} +0 -0
  137. /package/dist/es/{hooks/use-client-rect.js → utils/get-rect.js} +0 -0
  138. /package/dist/es/utils/{get-system-info.d.ts → taro/get-system-info.d.ts} +0 -0
  139. /package/dist/es/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
  140. /package/dist/es/utils/{platform-taro.d.ts → taro/platform.d.ts} +0 -0
  141. /package/dist/es/utils/{platform-taro.js → taro/platform.js} +0 -0
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ var _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./taro/add-color-for-harmony"), exports);
7
+ _export_star._(require("./bound"), exports);
8
+ _export_star._(require("./camel-case"), exports);
9
+ _export_star._(require("./can-use-dom"), exports);
10
+ _export_star._(require("./clamp"), exports);
11
+ _export_star._(require("./date"), exports);
12
+ _export_star._(require("./taro/get-rect"), exports);
13
+ _export_star._(require("./taro/get-rect-by-id"), exports);
14
+ _export_star._(require("./get-rect"), exports);
15
+ _export_star._(require("./get-scroll-parent"), exports);
16
+ _export_star._(require("./taro/get-system-info"), exports);
17
+ _export_star._(require("./interceptor"), exports);
18
+ _export_star._(require("./is-date"), exports);
19
+ _export_star._(require("./is-empty"), exports);
20
+ _export_star._(require("./is-forward-ref-component"), exports);
21
+ _export_star._(require("./is-function"), exports);
22
+ _export_star._(require("./is-object"), exports);
23
+ _export_star._(require("./is-promise"), exports);
24
+ _export_star._(require("./lru"), exports);
25
+ _export_star._(require("./merge"), exports);
26
+ _export_star._(require("./merge-props"), exports);
27
+ _export_star._(require("./pad-zero"), exports);
28
+ _export_star._(require("./taro/platform"), exports);
29
+ _export_star._(require("./prevent-default"), exports);
30
+ _export_star._(require("./px-check"), exports);
31
+ _export_star._(require("./taro/px-transform"), exports);
32
+ _export_star._(require("./raf"), exports);
33
+ _export_star._(require("./render"), exports);
34
+ _export_star._(require("./rubberband"), exports);
35
+ _export_star._(require("./sleep"), exports);
36
+ _export_star._(require("./supports-passive"), exports);
37
+ _export_star._(require("./to-array"), exports);
38
+ _export_star._(require("./typings"), exports);
39
+ _export_star._(require("./upper-case-first"), exports);
@@ -8,13 +8,13 @@ Object.defineProperty(exports, "funcInterceptor", {
8
8
  return funcInterceptor;
9
9
  }
10
10
  });
11
- var _index = require("./index");
11
+ var _ispromise = require("./is-promise");
12
12
  var funcInterceptor = function funcInterceptor(interceptor, param) {
13
13
  var _param_args = param.args, args = _param_args === void 0 ? [] : _param_args, done = param.done, canceled = param.canceled;
14
14
  if (interceptor) {
15
15
  // eslint-disable-next-line prefer-spread
16
16
  var returnVal = interceptor.apply(null, args);
17
- if ((0, _index.isPromise)(returnVal)) {
17
+ if ((0, _ispromise.isPromise)(returnVal)) {
18
18
  returnVal.then(function(value) {
19
19
  if (value) {
20
20
  done(value);
@@ -0,0 +1 @@
1
+ export declare const isFunction: (val: unknown) => val is Function;
@@ -0,0 +1,14 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-types
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "isFunction", {
7
+ enumerable: true,
8
+ get: function() {
9
+ return isFunction;
10
+ }
11
+ });
12
+ var isFunction = function isFunction(val) {
13
+ return typeof val === 'function';
14
+ };
@@ -0,0 +1 @@
1
+ export declare const isObject: (val: unknown) => val is Record<any, any>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "isObject", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return isObject;
9
+ }
10
+ });
11
+ var _type_of = require("@swc/helpers/_/_type_of");
12
+ var isObject = function isObject(val) {
13
+ return val !== null && (typeof val === "undefined" ? "undefined" : (0, _type_of._)(val)) === 'object';
14
+ };
@@ -0,0 +1 @@
1
+ export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "isPromise", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return isPromise;
9
+ }
10
+ });
11
+ var _isobject = require("./is-object");
12
+ var _isfunction = require("./is-function");
13
+ var isPromise = function isPromise(val) {
14
+ return (0, _isobject.isObject)(val) && (0, _isfunction.isFunction)(val.then) && (0, _isfunction.isFunction)(val.catch);
15
+ };
@@ -1,4 +1,4 @@
1
- export default class MiniLru {
1
+ export declare class MiniLru {
2
2
  private cache;
3
3
  private capacity;
4
4
  constructor(capacity: number);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
5
+ Object.defineProperty(exports, "MiniLru", {
6
6
  enumerable: true,
7
7
  get: function() {
8
8
  return MiniLru;
@@ -1,4 +1,3 @@
1
- export default main;
2
1
  export declare function main(clone: boolean, ...items: any[]): any;
3
2
  export declare function main(...items: any[]): any;
4
3
  export declare namespace main {
@@ -12,9 +12,6 @@ _export(exports, {
12
12
  clone: function() {
13
13
  return clone;
14
14
  },
15
- default: function() {
16
- return _default;
17
- },
18
15
  isPlainObject: function() {
19
16
  return isPlainObject;
20
17
  },
@@ -30,7 +27,6 @@ _export(exports, {
30
27
  });
31
28
  var _to_consumable_array = require("@swc/helpers/_/_to_consumable_array");
32
29
  var _type_of = require("@swc/helpers/_/_type_of");
33
- var _default = main;
34
30
  function main() {
35
31
  for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
36
32
  items[_key] = arguments[_key];
@@ -0,0 +1 @@
1
+ export declare function preventDefault(event: React.TouchEvent<HTMLElement> | TouchEvent, isStopPropagation?: boolean): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "preventDefault", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return preventDefault;
9
+ }
10
+ });
11
+ function preventDefault(event, isStopPropagation) {
12
+ if (typeof event.cancelable !== 'boolean' || event.cancelable) {
13
+ event.preventDefault();
14
+ }
15
+ if (isStopPropagation) {
16
+ event.stopPropagation();
17
+ }
18
+ }
@@ -1,4 +1,3 @@
1
- export declare const inBrowser: boolean;
2
1
  export declare function cancelRaf(id: number): void;
3
2
  declare const _default: any;
4
3
  export default _default;
@@ -14,15 +14,12 @@ _export(exports, {
14
14
  },
15
15
  default: function() {
16
16
  return _default;
17
- },
18
- inBrowser: function() {
19
- return inBrowser;
20
17
  }
21
18
  });
22
- var inBrowser = typeof window !== 'undefined';
19
+ var _getrect = require("./get-rect");
23
20
  // 防频
24
21
  function requestAniFrame() {
25
- if (inBrowser) {
22
+ if (_getrect.inBrowser) {
26
23
  var _window = window;
27
24
  return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
28
25
  _window.setTimeout(callback, 1000 / 60);
@@ -33,7 +30,7 @@ function requestAniFrame() {
33
30
  };
34
31
  }
35
32
  function cancelRaf(id) {
36
- if (inBrowser) {
33
+ if (_getrect.inBrowser) {
37
34
  var _window = window;
38
35
  (_window.cancelAnimationFrame || _window.webkitCancelAnimationFrame)(id);
39
36
  } else {
@@ -5,5 +5,4 @@ import React, { ReactNode } from 'react';
5
5
  * @param color - 要添加的颜色值(如:'#ff0000')
6
6
  * @returns 处理后的 React 节点
7
7
  */
8
- declare function addColorForHarmony(maybeElement: ReactNode, color?: string): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
9
- export default addColorForHarmony;
8
+ export declare function addColorForHarmony(maybeElement: ReactNode, color?: string): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
@@ -2,26 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
5
+ Object.defineProperty(exports, "addColorForHarmony", {
6
6
  enumerable: true,
7
7
  get: function() {
8
- return _default;
8
+ return addColorForHarmony;
9
9
  }
10
10
  });
11
11
  var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
12
  var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
13
- var _platformtaro = require("./platform-taro");
14
- /**
15
- * 为支持 Harmony React 元素添加颜色属性
16
- * @param maybeElement - 要处理的 React 节点
17
- * @param color - 要添加的颜色值(如:'#ff0000')
18
- * @returns 处理后的 React 节点
19
- */ function addColorForHarmony(maybeElement, color) {
20
- if (/*#__PURE__*/ _react.default.isValidElement(maybeElement) && (0, _platformtaro.harmony)()) {
13
+ var _platform = require("./platform");
14
+ function addColorForHarmony(maybeElement, color) {
15
+ if (/*#__PURE__*/ _react.default.isValidElement(maybeElement) && (0, _platform.harmony)()) {
21
16
  return /*#__PURE__*/ _react.default.cloneElement(maybeElement, {
22
17
  color: color
23
18
  });
24
19
  }
25
20
  return maybeElement;
26
21
  }
27
- var _default = addColorForHarmony;
@@ -0,0 +1 @@
1
+ export declare const getRectById: (id: string) => Promise<unknown>;
@@ -2,15 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "getTaroRectById", {
5
+ Object.defineProperty(exports, "getRectById", {
6
6
  enumerable: true,
7
7
  get: function() {
8
- return getTaroRectById;
8
+ return getRectById;
9
9
  }
10
10
  });
11
11
  var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  var _taro = /*#__PURE__*/ _interop_require_wildcard._(require("@tarojs/taro"));
13
- var getTaroRectById = function getTaroRectById(id) {
13
+ var getRectById = function getRectById(id) {
14
14
  return new Promise(function(resolve, reject) {
15
15
  if (_taro.default.getEnv() === _taro.default.ENV_TYPE.WEB) {
16
16
  var t = document ? document.querySelector("#".concat(id)) : '';
@@ -9,4 +9,4 @@ export interface Rect {
9
9
  height: number;
10
10
  }
11
11
  export declare function makeRect(width: number, height: number): Rect;
12
- export declare const getRectByTaro: (element: any, harmonyId?: string) => Promise<Rect>;
12
+ export declare const getRectInMultiPlatform: (element: any, harmonyId?: string) => Promise<Rect>;
@@ -9,21 +9,20 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getRectByTaro: function() {
13
- return getRectByTaro;
12
+ getRectInMultiPlatform: function() {
13
+ return getRectInMultiPlatform;
14
14
  },
15
15
  makeRect: function() {
16
16
  return makeRect;
17
17
  }
18
18
  });
19
- var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
19
  var _async_to_generator = require("@swc/helpers/_/_async_to_generator");
21
20
  var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
22
21
  var _ts_generator = require("@swc/helpers/_/_ts_generator");
23
22
  var _taro = require("@tarojs/taro");
24
- var _lru = /*#__PURE__*/ _interop_require_default._(require("./lru"));
25
- var _useclientrect = require("../hooks/use-client-rect");
26
- var lru = new _lru.default(10);
23
+ var _lru = require("../lru");
24
+ var _getrect = require("../get-rect");
25
+ var lru = new _lru.MiniLru(10);
27
26
  function makeRect(width, height) {
28
27
  return {
29
28
  top: 0,
@@ -34,17 +33,17 @@ function makeRect(width, height) {
34
33
  height: height
35
34
  };
36
35
  }
37
- var getRectByTaro = /*#__PURE__*/ function() {
36
+ var getRectInMultiPlatform = /*#__PURE__*/ function() {
38
37
  var _ref = (0, _async_to_generator._)(function(element) {
39
38
  var harmonyId;
40
39
  var _arguments = arguments;
41
40
  return (0, _ts_generator._)(this, function(_state) {
42
41
  harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
43
42
  if (element) {
44
- if (_useclientrect.inBrowser) {
43
+ if (_getrect.inBrowser) {
45
44
  return [
46
45
  2,
47
- Promise.resolve((0, _useclientrect.getRect)(element))
46
+ Promise.resolve((0, _getrect.getRect)(element))
48
47
  ];
49
48
  }
50
49
  // 小程序下的逻辑
@@ -71,7 +70,7 @@ var getRectByTaro = /*#__PURE__*/ function() {
71
70
  ];
72
71
  });
73
72
  });
74
- return function getRectByTaro(element) {
73
+ return function getRectInMultiPlatform(element) {
75
74
  return _ref.apply(this, arguments);
76
75
  };
77
76
  }();
@@ -0,0 +1 @@
1
+ export declare function pxTransform(value: number, radix?: number): any;
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
5
+ Object.defineProperty(exports, "pxTransform", {
6
6
  enumerable: true,
7
7
  get: function() {
8
8
  return pxTransform;
9
9
  }
10
10
  });
11
11
  var _taro = require("@tarojs/taro");
12
- var _platformtaro = require("./platform-taro");
12
+ var _platform = require("./platform");
13
13
  function pxTransform(value, radix) {
14
14
  // @ts-ignore
15
- if ((0, _platformtaro.harmony)()) return (0, _taro.pxTransform)(value, radix || 375);
15
+ if ((0, _platform.harmony)()) return (0, _taro.pxTransform)(value, radix || 375);
16
16
  return "".concat(value, "px");
17
17
  }
@@ -0,0 +1 @@
1
+ export declare const upperCaseFirst: (str: string) => string;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "upperCaseFirst", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return upperCaseFirst;
9
+ }
10
+ });
11
+ var upperCaseFirst = function upperCaseFirst(str) {
12
+ str = str.toLowerCase();
13
+ str = str.replace(/\b\w+\b/g, function(word) {
14
+ return word.substring(0, 1).toUpperCase() + word.substring(1);
15
+ });
16
+ return str;
17
+ };
@@ -0,0 +1,12 @@
1
+ export * from './use-click-away';
2
+ export * from './use-force-update';
3
+ export * from './use-isomprphic-layout-effect';
4
+ export * from './use-lock-scroll';
5
+ export * from './use-memo';
6
+ export * from './use-pagination';
7
+ export * from './use-props-value';
8
+ export * from './use-ref-state';
9
+ export * from './use-refs';
10
+ export * from './use-touch';
11
+ export * from './use-uuid';
12
+ export * from './use-watch';
@@ -0,0 +1,12 @@
1
+ export * from "./use-click-away";
2
+ export * from "./use-force-update";
3
+ export * from "./use-isomprphic-layout-effect";
4
+ export * from "./use-lock-scroll";
5
+ export * from "./use-memo";
6
+ export * from "./use-pagination";
7
+ export * from "./use-props-value";
8
+ export * from "./use-ref-state";
9
+ export * from "./use-refs";
10
+ export * from "./use-touch";
11
+ export * from "./use-uuid";
12
+ export * from "./use-watch";
@@ -0,0 +1,14 @@
1
+ export * from "./use-click-away";
2
+ export * from "./taro/use-custom-event";
3
+ export * from "./use-force-update";
4
+ export * from "./use-isomprphic-layout-effect";
5
+ export * from "./taro/use-lock-scoll";
6
+ export * from "./use-lock-scroll";
7
+ export * from "./use-memo";
8
+ export * from "./use-pagination";
9
+ export * from "./use-props-value";
10
+ export * from "./use-ref-state";
11
+ export * from "./use-refs";
12
+ export * from "./use-touch";
13
+ export * from "./use-uuid";
14
+ export * from "./use-watch";
@@ -2,7 +2,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { useEffect, useRef } from "react";
3
3
  import isEqual from "react-fast-compare";
4
4
  import { Events, getCurrentInstance } from "@tarojs/taro";
5
- import { useForceUpdate } from "./use-force-update";
5
+ import { useForceUpdate } from "../use-force-update";
6
6
  export var customEvents = new Events();
7
7
  export function useCustomEventsPath(selector) {
8
8
  var _getCurrentInstance_router;
@@ -1,6 +1,6 @@
1
1
  import { useRef } from "react";
2
2
  import { getEnv } from "@tarojs/taro";
3
- import { useLockScroll } from "./use-lock-scroll";
3
+ import { useLockScroll } from "../use-lock-scroll";
4
4
  export var useLockScrollTaro = function(shouldLock) {
5
5
  var refObject = useRef(null);
6
6
  if (getEnv() === 'WEB') {
@@ -1 +1 @@
1
- export default function useMemo<Value, Condition = any[]>(getValue: () => Value, condition: Condition, shouldUpdate: (prev: Condition, next: Condition) => boolean): Value | undefined;
1
+ export declare function useMemo<Value, Condition = any[]>(getValue: () => Value, condition: Condition, shouldUpdate: (prev: Condition, next: Condition) => boolean): Value | undefined;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- export default function useMemo(getValue, condition, shouldUpdate) {
2
+ export function useMemo(getValue, condition, shouldUpdate) {
3
3
  var cacheRef = React.useRef({});
4
4
  if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
5
5
  cacheRef.current.value = getValue();
@@ -1 +1 @@
1
- export default function useRefs(): any[];
1
+ export declare function useRefs(): any[];
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- export default function useRefs() {
2
+ export function useRefs() {
3
3
  var refs = React.useRef([]);
4
4
  var setRefs = React.useCallback(function(index) {
5
5
  return function(el) {
@@ -1 +1 @@
1
- export default function useUuid(): string;
1
+ export declare function useUuid(): string;
@@ -11,7 +11,7 @@ function uniqueId() {
11
11
  }
12
12
  return "".concat(prefix).concat(id);
13
13
  }
14
- export default function useUuid() {
14
+ export function useUuid() {
15
15
  var idRef = useRef(uniqueId());
16
16
  return idRef.current;
17
17
  }
@@ -2,5 +2,5 @@ type Callback<T> = (prev: T | undefined) => void;
2
2
  type Config = {
3
3
  immediate: boolean;
4
4
  };
5
- declare function useWatch<T>(dep: T, callback: Callback<T>, config?: Config): () => void;
6
- export default useWatch;
5
+ export declare function useWatch<T>(dep: T, callback: Callback<T>, config?: Config): () => void;
6
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef } from "react";
2
- function useWatch(dep, callback) {
2
+ export function useWatch(dep, callback) {
3
3
  var config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
4
4
  immediate: false
5
5
  };
@@ -29,4 +29,3 @@ function useWatch(dep, callback) {
29
29
  stop.current = true;
30
30
  };
31
31
  }
32
- export default useWatch;
@@ -10,7 +10,7 @@ import Button from "../button";
10
10
  import { ComponentDefaults } from "../../utils/typings";
11
11
  import { useTouch } from "../../hooks/use-touch";
12
12
  import { clamp, preventDefault } from "../../utils";
13
- import { getRect } from "../../hooks/use-client-rect";
13
+ import { getRect } from "../../utils/get-rect";
14
14
  import { useConfig } from "../configprovider";
15
15
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
16
16
  maxZoom: 3,
@@ -5,9 +5,9 @@ import React, { createContext, useContext } from "react";
5
5
  import classNames from "classnames";
6
6
  import kebabCase from "lodash.kebabcase";
7
7
  import isEqual from "react-fast-compare";
8
- import useMemo from "../../hooks/use-memo";
8
+ import { useMemo } from "../../hooks/use-memo";
9
9
  import zhCN from "../../locales/zh-CN";
10
- import { inBrowser } from "../../utils/raf";
10
+ import { inBrowser } from "../../utils";
11
11
  var classPrefix = 'nut-configprovider';
12
12
  export var defaultConfigRef = {
13
13
  current: {
@@ -5,7 +5,7 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
5
5
  import React, { useEffect, useMemo, useRef, useState } from "react";
6
6
  import { Close, Notice } from "@nutui/icons-react";
7
7
  import classNames from "classnames";
8
- import { getRect } from "../../hooks/use-client-rect";
8
+ import { getRect } from "../../utils/get-rect";
9
9
  import { ComponentDefaults } from "../../utils/typings";
10
10
  import { useRtl } from "../configprovider";
11
11
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
@@ -207,4 +207,6 @@ export * from "./trendarrow";
207
207
  import WaterMark from "./watermark";
208
208
  export * from "./watermark";
209
209
  export * from "../types";
210
+ export * from "../utils";
211
+ export * from "../hooks";
210
212
  export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Divider, Grid, GridItem, Layout, Col, Row, SafeArea, Space, Sticky, BackTop, Elevator, FixedNav, HoverButton, HoverButtonItem, NavBar, SideBar, SideBarItem, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, DatePickerView, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, PickerView, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, ResultPage, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Lottie, Pagination, Price, Progress, Segmented, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, AvatarCropper, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
@@ -207,4 +207,6 @@ export * from "./trendarrow";
207
207
  import WaterMark from "./watermark";
208
208
  export * from "./watermark";
209
209
  export * from "../types";
210
+ export * from "../utils";
211
+ export * from "../hooks";
210
212
  export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Divider, Grid, GridItem, Layout, Col, Row, SafeArea, Space, Sticky, BackTop, Elevator, FixedNav, HoverButton, HoverButtonItem, NavBar, SideBar, SideBarItem, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, DatePickerView, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, PickerView, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, ResultPage, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Lottie, Pagination, Price, Progress, Segmented, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, AvatarCropper, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
@@ -9,7 +9,7 @@ import isEqual from "react-fast-compare";
9
9
  import PickerView from "../pickerview/index";
10
10
  import Popup from "../popup/index";
11
11
  import SafeArea from "../safearea/index";
12
- import useRefs from "../../hooks/use-refs";
12
+ import { useRefs } from "../../hooks/use-refs";
13
13
  import { useConfig } from "../configprovider";
14
14
  import { usePropsValue } from "../../hooks/use-props-value";
15
15
  import { ComponentDefaults } from "../../utils/typings";
@@ -8,7 +8,7 @@ import classNames from "classnames";
8
8
  import { createPortal } from "react-dom";
9
9
  import { ArrowRadius } from "@nutui/icons-react";
10
10
  import Popup from "../popup/index";
11
- import { getRect } from "../../hooks/use-client-rect";
11
+ import { getRect } from "../../utils/get-rect";
12
12
  import { ComponentDefaults } from "../../utils/typings";
13
13
  import useClickAway from "../../hooks/use-click-away";
14
14
  import { canUseDom } from "../../utils/can-use-dom";
@@ -5,7 +5,7 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
5
5
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
6
  import classNames from "classnames";
7
7
  import { useTouch } from "../../hooks/use-touch";
8
- import { getRect } from "../../hooks/use-client-rect";
8
+ import { getRect } from "../../utils/get-rect";
9
9
  import { ComponentDefaults } from "../../utils/typings";
10
10
  import { usePropsValue } from "../../hooks/use-props-value";
11
11
  import { useRtl } from "../configprovider";
@@ -7,8 +7,8 @@ import classNames from "classnames";
7
7
  import { StarFill } from "@nutui/icons-react";
8
8
  import { ComponentDefaults } from "../../utils/typings";
9
9
  import { usePropsValue } from "../../hooks/use-props-value";
10
- import { getRect } from "../../hooks/use-client-rect";
11
- import useRefs from "../../hooks/use-refs";
10
+ import { getRect } from "../../utils/get-rect";
11
+ import { useRefs } from "../../hooks/use-refs";
12
12
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
13
13
  size: 'normal',
14
14
  showScore: false,
@@ -6,8 +6,8 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
6
6
  import React, { useCallback, useEffect, useRef, useState } from "react";
7
7
  import classNames from "classnames";
8
8
  import { getScrollParent } from "../../utils/get-scroll-parent";
9
- import { getRect } from "../../hooks/use-client-rect";
10
- import useWatch from "../../hooks/use-watch";
9
+ import { getRect } from "../../utils/get-rect";
10
+ import { useWatch } from "../../hooks/use-watch";
11
11
  import { ComponentDefaults } from "../../utils/typings";
12
12
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
13
13
  position: 'top',