@nutui/nutui 3.1.21 → 3.1.22-beta.5

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 (233) hide show
  1. package/dist/nutui.es.js +4203 -19263
  2. package/dist/nutui.umd.js +4208 -19368
  3. package/dist/packages/_es/ActionSheet.js +17 -167
  4. package/dist/packages/_es/Address.js +110 -552
  5. package/dist/packages/_es/AddressList.js +113 -613
  6. package/dist/packages/_es/Animate.js +22 -0
  7. package/dist/packages/_es/Audio.js +53 -274
  8. package/dist/packages/_es/AudioOperate.js +13 -121
  9. package/dist/packages/_es/Avatar.js +38 -177
  10. package/dist/packages/_es/AvatarGroup.js +14 -73
  11. package/dist/packages/_es/BackTop.js +43 -156
  12. package/dist/packages/_es/Badge.js +14 -86
  13. package/dist/packages/_es/Barrage.js +41 -120
  14. package/dist/packages/_es/Button.js +23 -128
  15. package/dist/packages/_es/Calendar.js +30 -237
  16. package/dist/packages/_es/CalendarItem.js +2 -1
  17. package/dist/packages/_es/Card.js +10 -107
  18. package/dist/packages/_es/Cascader.js +147 -523
  19. package/dist/packages/_es/Category.js +15 -58
  20. package/dist/packages/_es/CategoryPane.js +11 -111
  21. package/dist/packages/_es/Cell.js +21 -100
  22. package/dist/packages/_es/CellGroup.js +9 -44
  23. package/dist/packages/_es/Checkbox.js +31 -113
  24. package/dist/packages/_es/CheckboxGroup.js +29 -58
  25. package/dist/packages/_es/CircleProgress.js +28 -151
  26. package/dist/packages/_es/Col.js +14 -56
  27. package/dist/packages/_es/Collapse.js +32 -84
  28. package/dist/packages/_es/CollapseItem.js +59 -272
  29. package/dist/packages/_es/Comment.js +64 -434
  30. package/dist/packages/_es/ConfigProvider.js +13 -0
  31. package/dist/packages/_es/CountDown.js +56 -256
  32. package/dist/packages/_es/CountUp.js +140 -556
  33. package/dist/packages/_es/DatePicker.js +98 -332
  34. package/dist/packages/_es/Dialog.js +60 -271
  35. package/dist/packages/_es/Divider.js +13 -82
  36. package/dist/packages/_es/Drag.js +56 -197
  37. package/dist/packages/_es/Ecard.js +24 -159
  38. package/dist/packages/_es/Elevator.js +58 -212
  39. package/dist/packages/_es/Ellipsis.js +64 -0
  40. package/dist/packages/_es/Empty.js +12 -71
  41. package/dist/packages/_es/FixedNav.js +15 -122
  42. package/dist/packages/_es/Form.js +64 -151
  43. package/dist/packages/_es/FormItem.js +15 -110
  44. package/dist/packages/_es/Grid.js +5 -6
  45. package/dist/packages/_es/GridItem.js +33 -144
  46. package/dist/packages/_es/Icon.js +15 -40
  47. package/dist/packages/_es/Image.js +31 -0
  48. package/dist/packages/_es/ImagePreview.js +77 -309
  49. package/dist/packages/_es/Indicator.js +15 -62
  50. package/dist/packages/_es/InfiniteLoading.js +57 -268
  51. package/dist/packages/_es/Input.js +51 -413
  52. package/dist/packages/_es/InputNumber.js +41 -160
  53. package/dist/packages/_es/Layout.js +4 -5
  54. package/dist/packages/_es/List.js +18 -124
  55. package/dist/packages/_es/Menu.js +45 -118
  56. package/dist/packages/_es/MenuItem.js +37 -162
  57. package/dist/packages/_es/Navbar.js +30 -192
  58. package/dist/packages/_es/NoticeBar.js +74 -397
  59. package/dist/packages/_es/Notify.js +72 -246
  60. package/dist/packages/_es/NumberKeyboard.js +41 -272
  61. package/dist/packages/_es/OldPicker.js +131 -474
  62. package/dist/packages/_es/OverLay.js +24 -113
  63. package/dist/packages/_es/Pagination.js +39 -157
  64. package/dist/packages/_es/Picker.js +129 -469
  65. package/dist/packages/_es/Popover.js +318 -975
  66. package/dist/packages/_es/Popup.js +55 -313
  67. package/dist/packages/_es/Price.js +16 -118
  68. package/dist/packages/_es/Progress.js +14 -146
  69. package/dist/packages/_es/PullRefresh.js +84 -354
  70. package/dist/packages/_es/Radio.js +22 -90
  71. package/dist/packages/_es/RadioGroup.js +8 -37
  72. package/dist/packages/_es/Range.js +83 -427
  73. package/dist/packages/_es/Rate.js +35 -137
  74. package/dist/packages/_es/Row.js +22 -64
  75. package/dist/packages/_es/SearchBar.js +37 -257
  76. package/dist/packages/_es/ShortPassword.js +35 -225
  77. package/dist/packages/_es/SideNavBar.js +24 -99
  78. package/dist/packages/_es/SideNavBarItem.js +11 -46
  79. package/dist/packages/_es/Signature.js +41 -179
  80. package/dist/packages/_es/Skeleton.js +20 -136
  81. package/dist/packages/_es/Sku.js +84 -509
  82. package/dist/packages/_es/Step.js +20 -133
  83. package/dist/packages/_es/Steps.js +18 -53
  84. package/dist/packages/_es/Sticky.js +53 -138
  85. package/dist/packages/_es/SubSideNavBar.js +17 -100
  86. package/dist/packages/_es/Swipe.js +41 -197
  87. package/dist/packages/_es/Swiper.js +121 -433
  88. package/dist/packages/_es/SwiperItem.js +22 -53
  89. package/dist/packages/_es/Switch.js +21 -116
  90. package/dist/packages/_es/TabPane.js +12 -39
  91. package/dist/packages/_es/Tabbar.js +17 -72
  92. package/dist/packages/_es/TabbarItem.js +29 -151
  93. package/dist/packages/_es/Table.js +18 -196
  94. package/dist/packages/_es/Tabs.js +43 -217
  95. package/dist/packages/_es/Tag.js +20 -97
  96. package/dist/packages/_es/TextArea.js +42 -160
  97. package/dist/packages/_es/TimeDetail.js +18 -98
  98. package/dist/packages/_es/TimePannel.js +14 -66
  99. package/dist/packages/_es/TimeSelect.js +15 -103
  100. package/dist/packages/_es/Toast.js +71 -329
  101. package/dist/packages/_es/Uploader.js +104 -468
  102. package/dist/packages/_es/Video.js +74 -350
  103. package/dist/packages/_es/common.js +38 -128
  104. package/dist/packages/_es/component.js +35 -76
  105. package/dist/packages/_es/index.js +5 -6
  106. package/dist/packages/_es/index2.js +9 -30
  107. package/dist/packages/_es/index3.js +6 -8
  108. package/dist/packages/_es/index4.js +13 -58
  109. package/dist/packages/_es/index5.js +164 -682
  110. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  111. package/dist/packages/_es/pxCheck.js +3 -5
  112. package/dist/packages/_es/raf.js +8 -15
  113. package/dist/packages/animate/index.scss +299 -0
  114. package/dist/packages/button/index.scss +2 -1
  115. package/dist/packages/cell/index.scss +18 -1
  116. package/dist/packages/checkbox/index.scss +16 -0
  117. package/dist/packages/configprovider/index.scss +2 -0
  118. package/dist/packages/dialog/index.scss +1 -0
  119. package/dist/packages/elevator/index.scss +21 -0
  120. package/dist/packages/ellipsis/index.scss +12 -0
  121. package/dist/packages/formitem/index.scss +12 -0
  122. package/dist/packages/griditem/index.scss +11 -0
  123. package/dist/packages/image/index.scss +39 -0
  124. package/dist/packages/imagepreview/index.scss +21 -2
  125. package/dist/packages/input/index.scss +26 -1
  126. package/dist/packages/inputnumber/index.scss +21 -0
  127. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  128. package/dist/packages/locale/lang/baseLang.js +3 -3
  129. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  130. package/dist/packages/locale/lang/en-US.js +5 -97
  131. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  132. package/dist/packages/locale/lang/id-ID.js +5 -97
  133. package/dist/packages/locale/lang/index.js +16 -38
  134. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  135. package/dist/packages/locale/lang/zh-CN.js +5 -97
  136. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  137. package/dist/packages/locale/lang/zh-TW.js +5 -97
  138. package/dist/packages/menu/index.scss +45 -36
  139. package/dist/packages/menuitem/index.scss +4 -0
  140. package/dist/packages/navbar/index.scss +9 -0
  141. package/dist/packages/pagination/index.scss +19 -0
  142. package/dist/packages/radio/index.scss +19 -0
  143. package/dist/packages/range/index.scss +19 -0
  144. package/dist/packages/rate/index.scss +1 -1
  145. package/dist/packages/searchbar/index.scss +21 -0
  146. package/dist/packages/switch/index.scss +4 -3
  147. package/dist/packages/tabbar/index.scss +5 -0
  148. package/dist/packages/tabbaritem/index.scss +7 -0
  149. package/dist/packages/tabpane/index.scss +6 -0
  150. package/dist/packages/tabs/index.scss +22 -0
  151. package/dist/packages/textarea/index.scss +8 -0
  152. package/dist/smartips/attributes.json +192 -12
  153. package/dist/smartips/tags.json +70 -10
  154. package/dist/smartips/web-types.json +6945 -0
  155. package/dist/style.css +1 -1
  156. package/dist/style.es.js +1 -1
  157. package/dist/styles/font/config.json +3 -1
  158. package/dist/styles/font/demo_index.html +49 -3
  159. package/dist/styles/font/iconfont.css +11 -3
  160. package/dist/styles/font/iconfont.js +15 -15
  161. package/dist/styles/font/iconfont.json +14 -0
  162. package/dist/styles/font/iconfont.ttf +0 -0
  163. package/dist/styles/font/iconfont.woff +0 -0
  164. package/dist/styles/font/iconfont.woff2 +0 -0
  165. package/dist/styles/themes/default.scss +54 -50
  166. package/dist/styles/themes/jdb.scss +54 -50
  167. package/dist/styles/themes/jdt.scss +54 -50
  168. package/dist/styles/variables-jdb.scss +19 -1
  169. package/dist/styles/variables-jdt.scss +19 -1
  170. package/dist/styles/variables.scss +22 -1
  171. package/dist/types/__VUE/address/index.vue.d.ts +2 -2
  172. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  173. package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
  174. package/dist/types/__VUE/animate/type.d.ts +6 -0
  175. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  176. package/dist/types/__VUE/avatar/index.vue.d.ts +7 -7
  177. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  178. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  179. package/dist/types/__VUE/button/index.vue.d.ts +2 -2
  180. package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
  181. package/dist/types/__VUE/cell/index.vue.d.ts +13 -6
  182. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  183. package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
  184. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  185. package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
  186. package/dist/types/__VUE/collapse/index.vue.d.ts +5 -3
  187. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  188. package/dist/types/__VUE/configprovider/common.d.ts +20 -0
  189. package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
  190. package/dist/types/__VUE/datepicker/index.vue.d.ts +5 -5
  191. package/dist/types/__VUE/datepicker/type.d.ts +6 -0
  192. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  193. package/dist/types/__VUE/dialog/index.vue.d.ts +26 -17
  194. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  195. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  196. package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
  197. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  198. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  199. package/dist/types/__VUE/grid/common.d.ts +3 -3
  200. package/dist/types/__VUE/grid/index.vue.d.ts +5 -5
  201. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  202. package/dist/types/__VUE/image/index.vue.d.ts +105 -0
  203. package/dist/types/__VUE/image/type.d.ts +6 -0
  204. package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
  205. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
  206. package/dist/types/__VUE/input/index.vue.d.ts +4 -4
  207. package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
  208. package/dist/types/__VUE/menuitem/index.vue.d.ts +16 -7
  209. package/dist/types/__VUE/menuitem/type.d.ts +8 -0
  210. package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
  211. package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
  212. package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
  213. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  214. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  215. package/dist/types/__VUE/rate/common.d.ts +149 -0
  216. package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
  217. package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
  218. package/dist/types/__VUE/skeleton/common.d.ts +2 -4
  219. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  220. package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
  221. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  222. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  223. package/dist/types/__VUE/tabs/common.d.ts +2 -2
  224. package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
  225. package/dist/types/__VUE/timeselect/index.vue.d.ts +8 -0
  226. package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
  227. package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
  228. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  229. package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
  230. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  231. package/dist/types/index.d.ts +1 -1
  232. package/dist/types/nutui.d.ts +5 -1
  233. package/package.json +7 -3
@@ -1,20 +1,17 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { defineComponent } from "vue";
7
- import locale from "../locale/lang";
8
- const TypeOfFun = (value) => {
9
- if (value === null) {
6
+ import { defineComponent as e } from "vue";
7
+ import t from "../locale/lang";
8
+ const n = (e2) => {
9
+ if (e2 === null)
10
10
  return "null";
11
- }
12
- const type = typeof value;
13
- if (type === "undefined" || type === "string") {
14
- return type;
15
- }
16
- const typeString = toString.call(value);
17
- switch (typeString) {
11
+ const t2 = typeof e2;
12
+ if (t2 === "undefined" || t2 === "string")
13
+ return t2;
14
+ switch (toString.call(e2)) {
18
15
  case "[object Array]":
19
16
  return "array";
20
17
  case "[object Date]":
@@ -28,75 +25,37 @@ const TypeOfFun = (value) => {
28
25
  case "[object RegExp]":
29
26
  return "regexp";
30
27
  case "[object Object]":
31
- if (value.nodeType !== void 0) {
32
- if (value.nodeType == 3) {
33
- return /\S/.test(value.nodeValue) ? "textnode" : "whitespace";
34
- } else {
35
- return "element";
36
- }
37
- } else {
38
- return "object";
39
- }
28
+ return e2.nodeType !== void 0 ? e2.nodeType == 3 ? /\S/.test(e2.nodeValue) ? "textnode" : "whitespace" : "element" : "object";
40
29
  default:
41
30
  return "unknow";
42
31
  }
43
- };
44
- const isFunction = (val) => typeof val === "function";
45
- const isObject = (val) => val !== null && typeof val === "object";
46
- const isPromise = (val) => {
47
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
48
- };
49
- const getPropByPath = (obj, keyPath) => {
32
+ }, r = (e2) => typeof e2 == "function", a = (e2) => e2 !== null && typeof e2 == "object", c = (e2) => a(e2) && r(e2.then) && r(e2.catch), o = (e2, t2) => {
50
33
  try {
51
- return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
52
- } catch (error) {
34
+ return t2.split(".").reduce((e3, t3) => e3[t3], e2);
35
+ } catch (e3) {
53
36
  return "";
54
37
  }
38
+ }, s = (e2, t2, r2) => {
39
+ let a2 = Object.assign({}, e2), c2 = Object.assign({}, r2);
40
+ return Object.keys(t2).length > 0 ? (Object.keys(a2).forEach((e3) => {
41
+ if (c2.hasOwnProperty(e3)) {
42
+ const r3 = n(c2[e3]);
43
+ r3 == "function" && (a2[e3] = c2[e3](t2)), r3 == "string" && (a2[e3] = t2[c2[e3]]);
44
+ } else
45
+ t2[e3] && (a2[e3] = t2[e3]);
46
+ }), a2) : e2;
55
47
  };
56
- const floatData = (format, dataOp, mapOps) => {
57
- let mergeFormat = Object.assign({}, format);
58
- let mergeMapOps = Object.assign({}, mapOps);
59
- if (Object.keys(dataOp).length > 0) {
60
- Object.keys(mergeFormat).forEach((keys) => {
61
- if (mergeMapOps.hasOwnProperty(keys)) {
62
- const tof = TypeOfFun(mergeMapOps[keys]);
63
- if (tof == "function") {
64
- mergeFormat[keys] = mergeMapOps[keys](dataOp);
65
- }
66
- if (tof == "string") {
67
- mergeFormat[keys] = dataOp[mergeMapOps[keys]];
68
- }
69
- } else {
70
- if (dataOp[keys])
71
- mergeFormat[keys] = dataOp[keys];
72
- }
73
- });
74
- return mergeFormat;
75
- }
76
- return format;
77
- };
78
- function createComponent(name) {
79
- const componentName = "nut-" + name;
80
- return {
81
- componentName,
82
- translate(keyPath, ...args) {
83
- const languages = locale.languages();
84
- const text = getPropByPath(languages, `${name.replace("-", "")}.${keyPath}`) || getPropByPath(languages, keyPath);
85
- return isFunction(text) ? text(...args) : text;
86
- },
87
- create: function(_component) {
88
- _component.baseName = name;
89
- _component.name = componentName;
90
- _component.install = (vue) => {
91
- vue.component(_component.name, _component);
92
- };
93
- return defineComponent(_component);
94
- },
95
- createDemo: function(_component) {
96
- _component.baseName = name;
97
- _component.name = "demo-" + name;
98
- return defineComponent(_component);
99
- }
100
- };
48
+ function u(n2) {
49
+ const a2 = "nut-" + n2;
50
+ return { componentName: a2, translate(e2, ...a3) {
51
+ const c2 = t.languages(), s2 = o(c2, `${n2.replace("-", "")}.${e2}`) || o(c2, e2);
52
+ return r(s2) ? s2(...a3) : s2;
53
+ }, create: function(t2) {
54
+ return t2.baseName = n2, t2.name = a2, t2.install = (e2) => {
55
+ e2.component(t2.name, t2);
56
+ }, e(t2);
57
+ }, createDemo: function(t2) {
58
+ return t2.baseName = n2, t2.name = "demo-" + n2, e(t2);
59
+ } };
101
60
  }
102
- export { TypeOfFun as T, isPromise as a, createComponent as c, floatData as f, getPropByPath as g, isObject as i };
61
+ export { n as T, c as a, u as c, s as f, o as g, a as i };
@@ -1,11 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { getCurrentInstance } from "vue";
7
- function useRouter() {
8
- const proxy = getCurrentInstance().proxy;
9
- return proxy.$router || null;
6
+ import { getCurrentInstance as r } from "vue";
7
+ function o() {
8
+ return r().proxy.$router || null;
10
9
  }
11
- export { useRouter as u };
10
+ export { o as u };
@@ -1,36 +1,15 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { unref } from "vue";
7
- function isWindow(val) {
8
- return val === window;
9
- }
10
- const useRect = (elementRef) => {
11
- const element = unref(elementRef);
12
- if (isWindow(element)) {
13
- const width = element.innerWidth;
14
- const height = element.innerHeight;
15
- return {
16
- top: 0,
17
- left: 0,
18
- right: width,
19
- bottom: height,
20
- width,
21
- height
22
- };
6
+ import { unref as t } from "vue";
7
+ const e = (e2) => {
8
+ const i = t(e2);
9
+ if (i === window) {
10
+ const t2 = i.innerWidth, e3 = i.innerHeight;
11
+ return { top: 0, left: 0, right: t2, bottom: e3, width: t2, height: e3 };
23
12
  }
24
- if (element && element.getBoundingClientRect) {
25
- return element.getBoundingClientRect();
26
- }
27
- return {
28
- top: 0,
29
- left: 0,
30
- right: 0,
31
- bottom: 0,
32
- width: 0,
33
- height: 0
34
- };
13
+ return i && i.getBoundingClientRect ? i.getBoundingClientRect() : { top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0 };
35
14
  };
36
- export { useRect as u };
15
+ export { e as u };
@@ -1,13 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { getCurrentInstance } from "vue";
7
- function useExpose(apis) {
8
- const instance = getCurrentInstance();
9
- if (instance) {
10
- Object.assign(instance.proxy, apis);
11
- }
6
+ import { getCurrentInstance as o } from "vue";
7
+ function t(t2) {
8
+ const n = o();
9
+ n && Object.assign(n.proxy, t2);
12
10
  }
13
- export { useExpose as u };
11
+ export { t as u };
@@ -1,64 +1,19 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref } from "vue";
7
- const MIN_DISTANCE = 10;
8
- function getDirection(x, y) {
9
- if (x > y && x > MIN_DISTANCE) {
10
- return "horizontal";
11
- }
12
- if (y > x && y > MIN_DISTANCE) {
13
- return "vertical";
14
- }
15
- return "";
16
- }
17
- function useTouch() {
18
- const startX = ref(0);
19
- const startY = ref(0);
20
- const deltaX = ref(0);
21
- const deltaY = ref(0);
22
- const offsetX = ref(0);
23
- const offsetY = ref(0);
24
- const direction = ref("");
25
- const isVertical = () => direction.value === "vertical";
26
- const isHorizontal = () => direction.value === "horizontal";
27
- const reset = () => {
28
- deltaX.value = 0;
29
- deltaY.value = 0;
30
- offsetX.value = 0;
31
- offsetY.value = 0;
32
- direction.value = "";
33
- };
34
- const start = (event) => {
35
- reset();
36
- startX.value = event.touches[0].clientX;
37
- startY.value = event.touches[0].clientY;
38
- };
39
- const move = (event) => {
40
- const touch = event.touches[0];
41
- deltaX.value = touch.clientX - startX.value;
42
- deltaY.value = touch.clientY - startY.value;
43
- offsetX.value = Math.abs(deltaX.value);
44
- offsetY.value = Math.abs(deltaY.value);
45
- if (!direction.value) {
46
- direction.value = getDirection(offsetX.value, offsetY.value);
47
- }
48
- };
49
- return {
50
- move,
51
- start,
52
- reset,
53
- startX,
54
- startY,
55
- deltaX,
56
- deltaY,
57
- offsetX,
58
- offsetY,
59
- direction,
60
- isVertical,
61
- isHorizontal
6
+ import { ref as e } from "vue";
7
+ function a() {
8
+ const a2 = e(0), l = e(0), t = e(0), u = e(0), v = e(0), o = e(0), i = e(0), r = e(0), c = e(""), s = () => {
9
+ v.value = 0, o.value = 0, i.value = 0, r.value = 0, c.value = "";
62
10
  };
11
+ return { move: (e2) => {
12
+ const s2 = e2.touches[0];
13
+ var n, h;
14
+ v.value = s2.clientX - a2.value, o.value = s2.clientY - l.value, t.value = s2.clientX, u.value = s2.clientY, i.value = Math.abs(v.value), r.value = Math.abs(o.value), c.value || (c.value = (n = i.value, h = r.value, n > h && n > 10 ? "horizontal" : h > n && h > 10 ? "vertical" : ""));
15
+ }, start: (e2) => {
16
+ s(), a2.value = e2.touches[0].clientX, l.value = e2.touches[0].clientY;
17
+ }, reset: s, startX: a2, startY: l, moveX: t, moveY: u, deltaX: v, deltaY: o, offsetX: i, offsetY: r, direction: c, isVertical: () => c.value === "vertical", isHorizontal: () => c.value === "horizontal" };
63
18
  }
64
- export { useTouch as u };
19
+ export { a as u };