@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3

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 (176) hide show
  1. package/dist/nutui.es.js +4019 -19251
  2. package/dist/nutui.umd.js +4012 -19344
  3. package/dist/packages/_es/ActionSheet.js +26 -157
  4. package/dist/packages/_es/Address.js +119 -542
  5. package/dist/packages/_es/AddressList.js +113 -613
  6. package/dist/packages/_es/Audio.js +62 -264
  7. package/dist/packages/_es/AudioOperate.js +18 -107
  8. package/dist/packages/_es/Avatar.js +42 -165
  9. package/dist/packages/_es/AvatarGroup.js +14 -73
  10. package/dist/packages/_es/BackTop.js +43 -156
  11. package/dist/packages/_es/Badge.js +14 -86
  12. package/dist/packages/_es/Barrage.js +41 -120
  13. package/dist/packages/_es/Button.js +23 -128
  14. package/dist/packages/_es/Calendar.js +24 -237
  15. package/dist/packages/_es/CalendarItem.js +1 -1
  16. package/dist/packages/_es/Card.js +10 -107
  17. package/dist/packages/_es/Cascader.js +156 -500
  18. package/dist/packages/_es/Category.js +15 -58
  19. package/dist/packages/_es/CategoryPane.js +11 -111
  20. package/dist/packages/_es/Cell.js +21 -100
  21. package/dist/packages/_es/CellGroup.js +9 -44
  22. package/dist/packages/_es/Checkbox.js +31 -113
  23. package/dist/packages/_es/CheckboxGroup.js +29 -58
  24. package/dist/packages/_es/CircleProgress.js +28 -151
  25. package/dist/packages/_es/Col.js +14 -56
  26. package/dist/packages/_es/Collapse.js +24 -85
  27. package/dist/packages/_es/CollapseItem.js +70 -261
  28. package/dist/packages/_es/Comment.js +64 -434
  29. package/dist/packages/_es/CountDown.js +61 -242
  30. package/dist/packages/_es/CountUp.js +149 -546
  31. package/dist/packages/_es/DatePicker.js +107 -322
  32. package/dist/packages/_es/Dialog.js +69 -261
  33. package/dist/packages/_es/Divider.js +18 -68
  34. package/dist/packages/_es/Drag.js +56 -197
  35. package/dist/packages/_es/Ecard.js +24 -159
  36. package/dist/packages/_es/Elevator.js +63 -198
  37. package/dist/packages/_es/Empty.js +12 -71
  38. package/dist/packages/_es/FixedNav.js +15 -122
  39. package/dist/packages/_es/Form.js +64 -151
  40. package/dist/packages/_es/FormItem.js +15 -110
  41. package/dist/packages/_es/Grid.js +5 -6
  42. package/dist/packages/_es/GridItem.js +33 -144
  43. package/dist/packages/_es/Icon.js +15 -40
  44. package/dist/packages/_es/ImagePreview.js +74 -298
  45. package/dist/packages/_es/Indicator.js +15 -62
  46. package/dist/packages/_es/InfiniteLoading.js +66 -258
  47. package/dist/packages/_es/Input.js +51 -413
  48. package/dist/packages/_es/InputNumber.js +41 -160
  49. package/dist/packages/_es/Layout.js +4 -5
  50. package/dist/packages/_es/List.js +23 -110
  51. package/dist/packages/_es/Menu.js +30 -118
  52. package/dist/packages/_es/MenuItem.js +34 -162
  53. package/dist/packages/_es/Navbar.js +30 -192
  54. package/dist/packages/_es/NoticeBar.js +83 -387
  55. package/dist/packages/_es/Notify.js +81 -236
  56. package/dist/packages/_es/NumberKeyboard.js +41 -272
  57. package/dist/packages/_es/OldPicker.js +140 -464
  58. package/dist/packages/_es/OverLay.js +32 -105
  59. package/dist/packages/_es/Pagination.js +39 -157
  60. package/dist/packages/_es/Picker.js +138 -459
  61. package/dist/packages/_es/Popover.js +327 -965
  62. package/dist/packages/_es/Popup.js +64 -303
  63. package/dist/packages/_es/Price.js +16 -118
  64. package/dist/packages/_es/Progress.js +14 -146
  65. package/dist/packages/_es/PullRefresh.js +92 -346
  66. package/dist/packages/_es/Radio.js +22 -90
  67. package/dist/packages/_es/RadioGroup.js +8 -37
  68. package/dist/packages/_es/Range.js +92 -417
  69. package/dist/packages/_es/Rate.js +16 -139
  70. package/dist/packages/_es/Row.js +22 -64
  71. package/dist/packages/_es/SearchBar.js +46 -247
  72. package/dist/packages/_es/ShortPassword.js +35 -225
  73. package/dist/packages/_es/SideNavBar.js +33 -89
  74. package/dist/packages/_es/SideNavBarItem.js +11 -46
  75. package/dist/packages/_es/Signature.js +46 -165
  76. package/dist/packages/_es/Skeleton.js +20 -136
  77. package/dist/packages/_es/Sku.js +93 -499
  78. package/dist/packages/_es/Step.js +25 -119
  79. package/dist/packages/_es/Steps.js +18 -53
  80. package/dist/packages/_es/Sticky.js +53 -138
  81. package/dist/packages/_es/SubSideNavBar.js +26 -90
  82. package/dist/packages/_es/Swipe.js +46 -183
  83. package/dist/packages/_es/Swiper.js +121 -433
  84. package/dist/packages/_es/SwiperItem.js +22 -53
  85. package/dist/packages/_es/Switch.js +21 -116
  86. package/dist/packages/_es/TabPane.js +12 -39
  87. package/dist/packages/_es/Tabbar.js +17 -72
  88. package/dist/packages/_es/TabbarItem.js +29 -151
  89. package/dist/packages/_es/Table.js +27 -186
  90. package/dist/packages/_es/Tabs.js +51 -209
  91. package/dist/packages/_es/Tag.js +20 -97
  92. package/dist/packages/_es/TextArea.js +42 -160
  93. package/dist/packages/_es/TimeDetail.js +23 -84
  94. package/dist/packages/_es/TimePannel.js +19 -52
  95. package/dist/packages/_es/TimeSelect.js +15 -103
  96. package/dist/packages/_es/Toast.js +80 -319
  97. package/dist/packages/_es/Uploader.js +112 -460
  98. package/dist/packages/_es/Video.js +83 -340
  99. package/dist/packages/_es/common.js +38 -128
  100. package/dist/packages/_es/component.js +35 -76
  101. package/dist/packages/_es/index.js +5 -6
  102. package/dist/packages/_es/index2.js +9 -30
  103. package/dist/packages/_es/index3.js +6 -8
  104. package/dist/packages/_es/index4.js +13 -58
  105. package/dist/packages/_es/index5.js +120 -675
  106. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  107. package/dist/packages/_es/pxCheck.js +3 -5
  108. package/dist/packages/_es/raf.js +8 -15
  109. package/dist/packages/button/index.scss +2 -1
  110. package/dist/packages/cell/index.scss +11 -0
  111. package/dist/packages/checkbox/index.scss +6 -0
  112. package/dist/packages/dialog/index.scss +1 -0
  113. package/dist/packages/elevator/index.scss +21 -0
  114. package/dist/packages/input/index.scss +13 -1
  115. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  116. package/dist/packages/locale/lang/baseLang.js +3 -3
  117. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  118. package/dist/packages/locale/lang/en-US.js +5 -97
  119. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  120. package/dist/packages/locale/lang/id-ID.js +5 -97
  121. package/dist/packages/locale/lang/index.js +16 -38
  122. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  123. package/dist/packages/locale/lang/zh-CN.js +5 -97
  124. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  125. package/dist/packages/locale/lang/zh-TW.js +5 -97
  126. package/dist/packages/radio/index.scss +1 -0
  127. package/dist/packages/switch/index.scss +3 -3
  128. package/dist/packages/tabpane/index.scss +1 -0
  129. package/dist/smartips/attributes.json +62 -10
  130. package/dist/smartips/tags.json +17 -4
  131. package/dist/style.css +1 -1
  132. package/dist/styles/themes/default.scss +49 -49
  133. package/dist/styles/themes/jdb.scss +49 -49
  134. package/dist/styles/themes/jdt.scss +49 -49
  135. package/dist/styles/variables-jdb.scss +10 -1
  136. package/dist/styles/variables-jdt.scss +10 -1
  137. package/dist/styles/variables.scss +10 -1
  138. package/dist/types/__VUE/address/index.vue.d.ts +5 -5
  139. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  140. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  141. package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
  142. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  143. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  144. package/dist/types/__VUE/button/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
  146. package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
  147. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  148. package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
  149. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  150. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  151. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  152. package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
  153. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  154. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  155. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  156. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  157. package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
  158. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  159. package/dist/types/__VUE/input/index.vue.d.ts +2 -2
  160. package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
  161. package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
  162. package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
  163. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  164. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  165. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  166. package/dist/types/__VUE/row/index.vue.d.ts +2 -2
  167. package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
  168. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  169. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  170. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  171. package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
  172. package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
  173. package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
  174. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  175. package/dist/types/index.d.ts +1 -1
  176. package/package.json +2 -1
@@ -1,20 +1,17 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 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.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 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.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 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.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 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.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 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), r = e(""), i = () => {
9
+ t.value = 0, u.value = 0, v.value = 0, o.value = 0, r.value = "";
62
10
  };
11
+ return { move: (e2) => {
12
+ const i2 = e2.touches[0];
13
+ var s, c;
14
+ t.value = i2.clientX - a2.value, u.value = i2.clientY - l.value, v.value = Math.abs(t.value), o.value = Math.abs(u.value), r.value || (r.value = (s = v.value, c = o.value, s > c && s > 10 ? "horizontal" : c > s && c > 10 ? "vertical" : ""));
15
+ }, start: (e2) => {
16
+ i(), a2.value = e2.touches[0].clientX, l.value = e2.touches[0].clientY;
17
+ }, reset: i, startX: a2, startY: l, deltaX: t, deltaY: u, offsetX: v, offsetY: o, direction: r, isVertical: () => r.value === "vertical", isHorizontal: () => r.value === "horizontal" };
63
18
  }
64
- export { useTouch as u };
19
+ export { a as u };