@nutui/nutui 3.1.22 → 3.1.23-beta.2

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 (186) hide show
  1. package/dist/nutui.es.js +20643 -4214
  2. package/dist/nutui.umd.js +20750 -4216
  3. package/dist/packages/_es/ActionSheet.js +149 -17
  4. package/dist/packages/_es/Address.js +535 -110
  5. package/dist/packages/_es/AddressList.js +615 -113
  6. package/dist/packages/_es/Animate.js +59 -17
  7. package/dist/packages/_es/Audio.js +257 -53
  8. package/dist/packages/_es/AudioOperate.js +100 -13
  9. package/dist/packages/_es/Avatar.js +162 -38
  10. package/dist/packages/_es/AvatarGroup.js +73 -14
  11. package/dist/packages/_es/BackTop.js +156 -43
  12. package/dist/packages/_es/Badge.js +86 -14
  13. package/dist/packages/_es/Barrage.js +120 -41
  14. package/dist/packages/_es/Button.js +128 -23
  15. package/dist/packages/_es/Calendar.js +246 -30
  16. package/dist/packages/_es/CalendarItem.js +1 -1
  17. package/dist/packages/_es/Card.js +107 -10
  18. package/dist/packages/_es/Cascader.js +496 -147
  19. package/dist/packages/_es/Category.js +58 -15
  20. package/dist/packages/_es/CategoryPane.js +113 -11
  21. package/dist/packages/_es/Cell.js +108 -21
  22. package/dist/packages/_es/CellGroup.js +44 -9
  23. package/dist/packages/_es/Checkbox.js +143 -29
  24. package/dist/packages/_es/CheckboxGroup.js +79 -29
  25. package/dist/packages/_es/CircleProgress.js +150 -28
  26. package/dist/packages/_es/Col.js +56 -14
  27. package/dist/packages/_es/Collapse.js +109 -32
  28. package/dist/packages/_es/CollapseItem.js +253 -59
  29. package/dist/packages/_es/Comment.js +434 -64
  30. package/dist/packages/_es/ConfigProvider.js +20 -8
  31. package/dist/packages/_es/CountDown.js +238 -56
  32. package/dist/packages/_es/CountUp.js +539 -140
  33. package/dist/packages/_es/DatePicker.js +316 -98
  34. package/dist/packages/_es/Dialog.js +289 -60
  35. package/dist/packages/_es/Divider.js +65 -13
  36. package/dist/packages/_es/Drag.js +197 -56
  37. package/dist/packages/_es/Ecard.js +159 -24
  38. package/dist/packages/_es/Elevator.js +255 -58
  39. package/dist/packages/_es/Ellipsis.js +200 -58
  40. package/dist/packages/_es/Empty.js +71 -12
  41. package/dist/packages/_es/FixedNav.js +122 -15
  42. package/dist/packages/_es/Form.js +151 -64
  43. package/dist/packages/_es/FormItem.js +114 -15
  44. package/dist/packages/_es/Grid.js +6 -5
  45. package/dist/packages/_es/GridItem.js +144 -33
  46. package/dist/packages/_es/Icon.js +40 -15
  47. package/dist/packages/_es/Image.js +137 -26
  48. package/dist/packages/_es/ImagePreview.js +547 -76
  49. package/dist/packages/_es/Indicator.js +62 -15
  50. package/dist/packages/_es/InfiniteLoading.js +249 -57
  51. package/dist/packages/_es/Input.js +433 -51
  52. package/dist/packages/_es/InputNumber.js +160 -41
  53. package/dist/packages/_es/Layout.js +5 -4
  54. package/dist/packages/_es/List.js +106 -18
  55. package/dist/packages/_es/Menu.js +168 -44
  56. package/dist/packages/_es/MenuItem.js +173 -37
  57. package/dist/packages/_es/Navbar.js +192 -30
  58. package/dist/packages/_es/NoticeBar.js +380 -74
  59. package/dist/packages/_es/Notify.js +227 -72
  60. package/dist/packages/_es/NumberKeyboard.js +272 -41
  61. package/dist/packages/_es/OldPicker.js +457 -130
  62. package/dist/packages/_es/OverLay.js +98 -24
  63. package/dist/packages/_es/Pagination.js +157 -39
  64. package/dist/packages/_es/Picker.js +482 -129
  65. package/dist/packages/_es/Popover.js +957 -318
  66. package/dist/packages/_es/Popup.js +295 -55
  67. package/dist/packages/_es/Price.js +118 -16
  68. package/dist/packages/_es/Progress.js +146 -14
  69. package/dist/packages/_es/PullRefresh.js +339 -84
  70. package/dist/packages/_es/Radio.js +90 -22
  71. package/dist/packages/_es/RadioGroup.js +37 -8
  72. package/dist/packages/_es/Range.js +408 -83
  73. package/dist/packages/_es/Rate.js +192 -36
  74. package/dist/packages/_es/Row.js +64 -22
  75. package/dist/packages/_es/SearchBar.js +238 -37
  76. package/dist/packages/_es/ShortPassword.js +225 -35
  77. package/dist/packages/_es/SideNavBar.js +81 -24
  78. package/dist/packages/_es/SideNavBarItem.js +46 -11
  79. package/dist/packages/_es/Signature.js +160 -41
  80. package/dist/packages/_es/Skeleton.js +136 -20
  81. package/dist/packages/_es/Sku.js +491 -84
  82. package/dist/packages/_es/Step.js +115 -20
  83. package/dist/packages/_es/Steps.js +53 -18
  84. package/dist/packages/_es/Sticky.js +138 -53
  85. package/dist/packages/_es/SubSideNavBar.js +82 -17
  86. package/dist/packages/_es/Swipe.js +178 -41
  87. package/dist/packages/_es/Swiper.js +444 -121
  88. package/dist/packages/_es/SwiperItem.js +53 -22
  89. package/dist/packages/_es/Switch.js +124 -21
  90. package/dist/packages/_es/TabPane.js +39 -12
  91. package/dist/packages/_es/Tabbar.js +72 -17
  92. package/dist/packages/_es/TabbarItem.js +151 -29
  93. package/dist/packages/_es/Table.js +178 -18
  94. package/dist/packages/_es/Tabs.js +202 -43
  95. package/dist/packages/_es/Tag.js +97 -20
  96. package/dist/packages/_es/TextArea.js +160 -42
  97. package/dist/packages/_es/TimeDetail.js +79 -18
  98. package/dist/packages/_es/TimePannel.js +48 -14
  99. package/dist/packages/_es/TimeSelect.js +112 -15
  100. package/dist/packages/_es/Toast.js +310 -71
  101. package/dist/packages/_es/Uploader.js +455 -104
  102. package/dist/packages/_es/Video.js +332 -74
  103. package/dist/packages/_es/WaterMark.js +187 -0
  104. package/dist/packages/_es/common.js +128 -38
  105. package/dist/packages/_es/component.js +76 -35
  106. package/dist/packages/_es/index.js +6 -5
  107. package/dist/packages/_es/index2.js +30 -9
  108. package/dist/packages/_es/index3.js +8 -6
  109. package/dist/packages/_es/index4.js +64 -13
  110. package/dist/packages/_es/index5.js +781 -164
  111. package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
  112. package/dist/packages/_es/pxCheck.js +5 -3
  113. package/dist/packages/_es/raf.js +15 -8
  114. package/dist/packages/imagepreview/index.scss +5 -1
  115. package/dist/packages/locale/lang/baseLang.js +3 -3
  116. package/dist/packages/locale/lang/en-US.js +105 -5
  117. package/dist/packages/locale/lang/id-ID.js +105 -5
  118. package/dist/packages/locale/lang/index.js +38 -16
  119. package/dist/packages/locale/lang/zh-CN.js +105 -5
  120. package/dist/packages/locale/lang/zh-TW.js +105 -5
  121. package/dist/packages/picker/index.scss +14 -0
  122. package/dist/packages/watermark/index.scss +13 -0
  123. package/dist/smartips/attributes.json +68 -0
  124. package/dist/smartips/tags.json +23 -2
  125. package/dist/smartips/web-types.json +161 -1
  126. package/dist/style.css +1 -1
  127. package/dist/style.es.js +1 -1
  128. package/dist/styles/themes/default.scss +51 -50
  129. package/dist/styles/themes/jdb.scss +51 -50
  130. package/dist/styles/themes/jdt.scss +51 -50
  131. package/dist/styles/variables-jdb.scss +3 -1
  132. package/dist/styles/variables-jdt.scss +3 -1
  133. package/dist/styles/variables.scss +4 -1
  134. package/dist/types/__VUE/actionsheet/index.vue.d.ts +5 -5
  135. package/dist/types/__VUE/address/index.vue.d.ts +7 -7
  136. package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
  137. package/dist/types/__VUE/avatargroup/index.vue.d.ts +2 -2
  138. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  139. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  140. package/dist/types/__VUE/button/index.vue.d.ts +8 -8
  141. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  142. package/dist/types/__VUE/cascader/index.vue.d.ts +4 -4
  143. package/dist/types/__VUE/categorypane/index.vue.d.ts +1 -1
  144. package/dist/types/__VUE/cell/index.vue.d.ts +6 -6
  145. package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
  146. package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
  147. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  148. package/dist/types/__VUE/comment/index.vue.d.ts +2 -2
  149. package/dist/types/__VUE/datepicker/index.vue.d.ts +4 -4
  150. package/dist/types/__VUE/dialog/index.vue.d.ts +4 -4
  151. package/dist/types/__VUE/fixednav/index.vue.d.ts +4 -4
  152. package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
  153. package/dist/types/__VUE/image/index.vue.d.ts +4 -4
  154. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
  155. package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
  156. package/dist/types/__VUE/input/index.vue.d.ts +4 -4
  157. package/dist/types/__VUE/inputnumber/index.vue.d.ts +2 -2
  158. package/dist/types/__VUE/menu/index.vue.d.ts +2 -2
  159. package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
  160. package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
  161. package/dist/types/__VUE/notify/index.vue.d.ts +2 -2
  162. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
  163. package/dist/types/__VUE/oldpicker/index.vue.d.ts +5 -5
  164. package/dist/types/__VUE/picker/Column.vue.d.ts +2 -1
  165. package/dist/types/__VUE/picker/index.vue.d.ts +7 -6
  166. package/dist/types/__VUE/popover/index.vue.d.ts +8 -8
  167. package/dist/types/__VUE/popup/index.vue.d.ts +8 -8
  168. package/dist/types/__VUE/radio/index.vue.d.ts +4 -4
  169. package/dist/types/__VUE/range/index.vue.d.ts +4 -4
  170. package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
  171. package/dist/types/__VUE/skeleton/index.vue.d.ts +4 -4
  172. package/dist/types/__VUE/sku/index.vue.d.ts +5 -5
  173. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  174. package/dist/types/__VUE/sticky/index.vue.d.ts +4 -4
  175. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  176. package/dist/types/__VUE/swiper/index.vue.d.ts +9 -2
  177. package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
  178. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  179. package/dist/types/__VUE/tag/index.vue.d.ts +2 -2
  180. package/dist/types/__VUE/timeselect/index.vue.d.ts +2 -2
  181. package/dist/types/__VUE/toast/index.vue.d.ts +4 -4
  182. package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
  183. package/dist/types/__VUE/watermark/index.vue.d.ts +143 -0
  184. package/dist/types/index.d.ts +1 -1
  185. package/dist/types/nutui.d.ts +2 -1
  186. package/package.json +8 -3
@@ -1,46 +1,136 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { provide as e, shallowReactive as t, getCurrentInstance as r, markRaw as n, isVNode as o, computed as i, h as u } from "vue";
7
- import { c as l } from "./component.js";
8
- import { p as s } from "./pxCheck.js";
9
- function a(e2, t2, r2) {
10
- const n2 = function(e3, t3) {
11
- const r3 = [], n3 = (e4) => {
12
- Array.isArray(e4) && e4.forEach((e5) => {
13
- var _a;
14
- if (o(e5)) {
15
- if (t3) {
16
- if (e5.type && e5.type.name === t3)
17
- return void r3.push(e5);
18
- } else
19
- r3.push(e5);
20
- ((_a = e5.component) == null ? void 0 : _a.subTree) && n3(e5.component.subTree.children), e5.children && n3(e5.children);
6
+ import { provide, shallowReactive, getCurrentInstance, markRaw, isVNode, computed, h } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { p as pxCheck } from "./pxCheck.js";
9
+ function flattenVNodes(children, childName) {
10
+ const result = [];
11
+ const traverse = (children2) => {
12
+ if (!Array.isArray(children2))
13
+ return;
14
+ children2.forEach((child) => {
15
+ var _a;
16
+ if (!isVNode(child))
17
+ return;
18
+ if (childName) {
19
+ if (child.type && child.type.name === childName) {
20
+ result.push(child);
21
+ return;
21
22
  }
22
- });
23
- };
24
- return n3(e3), r3;
25
- }(e2.subTree.children, r2);
26
- t2.sort((e3, t3) => n2.indexOf(e3.vnode) - n2.indexOf(t3.vnode));
23
+ } else {
24
+ result.push(child);
25
+ }
26
+ if ((_a = child.component) == null ? void 0 : _a.subTree) {
27
+ traverse(child.component.subTree.children);
28
+ }
29
+ if (child.children) {
30
+ traverse(child.children);
31
+ }
32
+ });
33
+ };
34
+ traverse(children);
35
+ return result;
27
36
  }
28
- const { componentName: p } = l("grid"), c = Symbol("grid"), d = { props: { columnNum: { type: [Number, String], default: 4 }, iconSize: { type: [Number, String], default: 28 }, iconColor: { type: String }, border: { type: Boolean, default: true }, gutter: { type: [Number, String], default: 0 }, center: { type: Boolean, default: true }, square: { type: Boolean, default: false }, reverse: { type: Boolean, default: false }, direction: { type: String }, clickable: { type: Boolean, default: false } }, setup(o2, { slots: l2 }) {
29
- !function(o3, i2) {
30
- const u2 = t([]), l3 = r(), s2 = (e2) => {
31
- e2.proxy && (u2.push(n(e2)), a(l3, u2, i2));
32
- }, p2 = (e2) => {
33
- u2.splice(u2.indexOf(n(e2)), 1);
34
- }, c2 = Object.assign;
35
- return (t2) => (e(o3, c2({ add: s2, remove: p2, internalChildren: u2 }, t2)), { internalChildren: u2 });
36
- }(c, `${p}-item`)({ props: o2 });
37
- const d2 = i(() => ({ [p]: true, [`${p}--border`]: o2.border && !o2.gutter })), f = i(() => {
38
- const e2 = {};
39
- return o2.gutter && (e2.paddingLeft = s(o2.gutter)), e2;
37
+ function sortChildren(parent, internalChildren, childName) {
38
+ const vnodes = flattenVNodes(parent.subTree.children, childName);
39
+ internalChildren.sort((a, b) => {
40
+ return vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode);
40
41
  });
41
- return () => {
42
- var _a;
43
- return u("view", { class: d2.value, style: f.value }, (_a = l2.default) == null ? void 0 : _a.call(l2));
42
+ }
43
+ function useProvide(key, childName) {
44
+ const internalChildren = shallowReactive([]);
45
+ const parent = getCurrentInstance();
46
+ const add = (child) => {
47
+ if (!child.proxy)
48
+ return;
49
+ internalChildren.push(markRaw(child));
50
+ sortChildren(parent, internalChildren, childName);
51
+ };
52
+ const remove = (child) => {
53
+ internalChildren.splice(internalChildren.indexOf(markRaw(child)), 1);
44
54
  };
45
- } };
46
- export { c as G, d as c };
55
+ const extend = Object.assign;
56
+ return (value) => {
57
+ provide(key, extend({
58
+ add,
59
+ remove,
60
+ internalChildren
61
+ }, value));
62
+ return {
63
+ internalChildren
64
+ };
65
+ };
66
+ }
67
+ const { componentName } = createComponent("grid");
68
+ const GRID_KEY = Symbol("grid");
69
+ const gridProps = {
70
+ columnNum: {
71
+ type: [Number, String],
72
+ default: 4
73
+ },
74
+ iconSize: {
75
+ type: [Number, String],
76
+ default: 28
77
+ },
78
+ iconColor: {
79
+ type: String
80
+ },
81
+ border: {
82
+ type: Boolean,
83
+ default: true
84
+ },
85
+ gutter: {
86
+ type: [Number, String],
87
+ default: 0
88
+ },
89
+ center: {
90
+ type: Boolean,
91
+ default: true
92
+ },
93
+ square: {
94
+ type: Boolean,
95
+ default: false
96
+ },
97
+ reverse: {
98
+ type: Boolean,
99
+ default: false
100
+ },
101
+ direction: {
102
+ type: String
103
+ },
104
+ clickable: {
105
+ type: Boolean,
106
+ default: false
107
+ }
108
+ };
109
+ const component = {
110
+ props: gridProps,
111
+ setup(props, { slots }) {
112
+ useProvide(GRID_KEY, `${componentName}-item`)({ props });
113
+ const rootClass = computed(() => {
114
+ const prefixCls = componentName;
115
+ return {
116
+ [prefixCls]: true,
117
+ [`${prefixCls}--border`]: props.border && !props.gutter
118
+ };
119
+ });
120
+ const rootStyle = computed(() => {
121
+ const style = {};
122
+ if (props.gutter) {
123
+ style.paddingLeft = pxCheck(props.gutter);
124
+ }
125
+ return style;
126
+ });
127
+ return () => {
128
+ var _a;
129
+ return h("view", {
130
+ class: rootClass.value,
131
+ style: rootStyle.value
132
+ }, (_a = slots.default) == null ? void 0 : _a.call(slots));
133
+ };
134
+ }
135
+ };
136
+ export { GRID_KEY as G, component as c };
@@ -1,17 +1,20 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { defineComponent as e } from "vue";
7
- import t from "../locale/lang";
8
- const n = (e2) => {
9
- if (e2 === null)
6
+ import { defineComponent } from "vue";
7
+ import locale from "../locale/lang";
8
+ const TypeOfFun = (value) => {
9
+ if (value === null) {
10
10
  return "null";
11
- const t2 = typeof e2;
12
- if (t2 === "undefined" || t2 === "string")
13
- return t2;
14
- switch (toString.call(e2)) {
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) {
15
18
  case "[object Array]":
16
19
  return "array";
17
20
  case "[object Date]":
@@ -25,37 +28,75 @@ const n = (e2) => {
25
28
  case "[object RegExp]":
26
29
  return "regexp";
27
30
  case "[object Object]":
28
- return e2.nodeType !== void 0 ? e2.nodeType == 3 ? /\S/.test(e2.nodeValue) ? "textnode" : "whitespace" : "element" : "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
+ }
29
40
  default:
30
41
  return "unknow";
31
42
  }
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) => {
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) => {
33
50
  try {
34
- return t2.split(".").reduce((e3, t3) => e3[t3], e2);
35
- } catch (e3) {
51
+ return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
52
+ } catch (error) {
36
53
  return "";
37
54
  }
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;
47
55
  };
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
- } };
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
+ };
60
101
  }
61
- export { n as T, c as a, u as c, s as f, o as g, a as i };
102
+ export { TypeOfFun as T, isPromise as a, createComponent as c, floatData as f, getPropByPath as g, isObject as i };
@@ -1,10 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { getCurrentInstance as r } from "vue";
7
- function o() {
8
- return r().proxy.$router || null;
6
+ import { getCurrentInstance } from "vue";
7
+ function useRouter() {
8
+ const proxy = getCurrentInstance().proxy;
9
+ return proxy.$router || null;
9
10
  }
10
- export { o as u };
11
+ export { useRouter as u };
@@ -1,15 +1,36 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
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 };
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
+ };
12
23
  }
13
- return i && i.getBoundingClientRect ? i.getBoundingClientRect() : { top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0 };
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
+ };
14
35
  };
15
- export { e as u };
36
+ export { useRect as u };
@@ -1,11 +1,13 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { getCurrentInstance as o } from "vue";
7
- function t(t2) {
8
- const n = o();
9
- n && Object.assign(n.proxy, t2);
6
+ import { getCurrentInstance } from "vue";
7
+ function useExpose(apis) {
8
+ const instance = getCurrentInstance();
9
+ if (instance) {
10
+ Object.assign(instance.proxy, apis);
11
+ }
10
12
  }
11
- export { t as u };
13
+ export { useExpose as u };
@@ -1,19 +1,70 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
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 = "";
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 moveX = ref(0);
21
+ const moveY = ref(0);
22
+ const deltaX = ref(0);
23
+ const deltaY = ref(0);
24
+ const offsetX = ref(0);
25
+ const offsetY = ref(0);
26
+ const direction = ref("");
27
+ const isVertical = () => direction.value === "vertical";
28
+ const isHorizontal = () => direction.value === "horizontal";
29
+ const reset = () => {
30
+ deltaX.value = 0;
31
+ deltaY.value = 0;
32
+ offsetX.value = 0;
33
+ offsetY.value = 0;
34
+ direction.value = "";
35
+ };
36
+ const start = (event) => {
37
+ reset();
38
+ startX.value = event.touches[0].clientX;
39
+ startY.value = event.touches[0].clientY;
40
+ };
41
+ const move = (event) => {
42
+ const touch = event.touches[0];
43
+ deltaX.value = touch.clientX - startX.value;
44
+ deltaY.value = touch.clientY - startY.value;
45
+ moveX.value = touch.clientX;
46
+ moveY.value = touch.clientY;
47
+ offsetX.value = Math.abs(deltaX.value);
48
+ offsetY.value = Math.abs(deltaY.value);
49
+ if (!direction.value) {
50
+ direction.value = getDirection(offsetX.value, offsetY.value);
51
+ }
52
+ };
53
+ return {
54
+ move,
55
+ start,
56
+ reset,
57
+ startX,
58
+ startY,
59
+ moveX,
60
+ moveY,
61
+ deltaX,
62
+ deltaY,
63
+ offsetX,
64
+ offsetY,
65
+ direction,
66
+ isVertical,
67
+ isHorizontal
10
68
  };
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" };
18
69
  }
19
- export { a as u };
70
+ export { useTouch as u };