@nutui/nutui 3.1.17 → 3.1.19-beta.0

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 (155) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +1 -1
  3. package/README.md +7 -1
  4. package/dist/nutui.d.ts +3 -1
  5. package/dist/nutui.es.js +2335 -1280
  6. package/dist/nutui.umd.js +2350 -1293
  7. package/dist/packages/_es/ActionSheet.js +8 -3
  8. package/dist/packages/_es/Address.js +17 -11
  9. package/dist/packages/_es/Audio.js +2 -2
  10. package/dist/packages/_es/AudioOperate.js +125 -0
  11. package/dist/packages/_es/Avatar.js +2 -2
  12. package/dist/packages/_es/BackTop.js +7 -4
  13. package/dist/packages/_es/Badge.js +2 -2
  14. package/dist/packages/_es/Barrage.js +2 -2
  15. package/dist/packages/_es/Button.js +2 -2
  16. package/dist/packages/_es/Calendar.js +10 -687
  17. package/dist/packages/_es/CalendarItem.js +10 -0
  18. package/dist/packages/_es/Card.js +2 -2
  19. package/dist/packages/_es/Cascader.js +2 -2
  20. package/dist/packages/_es/Cell.js +25 -18
  21. package/dist/packages/_es/CellGroup.js +2 -2
  22. package/dist/packages/_es/Checkbox.js +4 -4
  23. package/dist/packages/_es/CheckboxGroup.js +4 -4
  24. package/dist/packages/_es/CircleProgress.js +2 -2
  25. package/dist/packages/_es/Col.js +2 -2
  26. package/dist/packages/_es/Collapse.js +2 -2
  27. package/dist/packages/_es/CollapseItem.js +31 -19
  28. package/dist/packages/_es/CountDown.js +4 -2
  29. package/dist/packages/_es/CountUp.js +25 -16
  30. package/dist/packages/_es/DatePicker.js +83 -47
  31. package/dist/packages/_es/Dialog.js +7 -5
  32. package/dist/packages/_es/Divider.js +2 -2
  33. package/dist/packages/_es/Drag.js +4 -4
  34. package/dist/packages/_es/Elevator.js +3 -3
  35. package/dist/packages/_es/Empty.js +2 -2
  36. package/dist/packages/_es/FixedNav.js +2 -2
  37. package/dist/packages/_es/Form.js +8 -6
  38. package/dist/packages/_es/FormItem.js +9 -6
  39. package/dist/packages/_es/Grid.js +2 -2
  40. package/dist/packages/_es/GridItem.js +3 -3
  41. package/dist/packages/_es/Icon.js +2 -2
  42. package/dist/packages/_es/ImagePreview.js +11 -6
  43. package/dist/packages/_es/Indicator.js +2 -2
  44. package/dist/packages/_es/InfiniteLoading.js +2 -2
  45. package/dist/packages/_es/Input.js +290 -66
  46. package/dist/packages/_es/InputNumber.js +2 -2
  47. package/dist/packages/_es/Layout.js +2 -2
  48. package/dist/packages/_es/List.js +124 -0
  49. package/dist/packages/_es/Menu.js +3 -3
  50. package/dist/packages/_es/MenuItem.js +4 -4
  51. package/dist/packages/_es/Navbar.js +31 -66
  52. package/dist/packages/_es/NoticeBar.js +41 -22
  53. package/dist/packages/_es/Notify.js +9 -5
  54. package/dist/packages/_es/NumberKeyboard.js +9 -4
  55. package/dist/packages/_es/OldPicker.js +484 -0
  56. package/dist/packages/_es/OverLay.js +2 -2
  57. package/dist/packages/_es/Pagination.js +2 -2
  58. package/dist/packages/_es/Picker.js +164 -157
  59. package/dist/packages/_es/Popover.js +7 -4
  60. package/dist/packages/_es/Popup.js +4 -4
  61. package/dist/packages/_es/Price.js +2 -2
  62. package/dist/packages/_es/Progress.js +14 -22
  63. package/dist/packages/_es/PullRefresh.js +363 -0
  64. package/dist/packages/_es/Radio.js +3 -3
  65. package/dist/packages/_es/RadioGroup.js +2 -2
  66. package/dist/packages/_es/Range.js +131 -21
  67. package/dist/packages/_es/Rate.js +2 -2
  68. package/dist/packages/_es/Row.js +2 -2
  69. package/dist/packages/_es/SearchBar.js +2 -2
  70. package/dist/packages/_es/ShortPassword.js +9 -4
  71. package/dist/packages/_es/SideNavBar.js +2 -2
  72. package/dist/packages/_es/SideNavBarItem.js +2 -2
  73. package/dist/packages/_es/Signature.js +25 -6
  74. package/dist/packages/_es/Skeleton.js +2 -2
  75. package/dist/packages/_es/Sku.js +31 -13
  76. package/dist/packages/_es/Step.js +28 -12
  77. package/dist/packages/_es/Steps.js +8 -3
  78. package/dist/packages/_es/Sticky.js +3 -3
  79. package/dist/packages/_es/SubSideNavBar.js +2 -2
  80. package/dist/packages/_es/Swipe.js +3 -3
  81. package/dist/packages/_es/Swiper.js +3 -3
  82. package/dist/packages/_es/SwiperItem.js +3 -3
  83. package/dist/packages/_es/Switch.js +2 -2
  84. package/dist/packages/_es/TabPane.js +2 -2
  85. package/dist/packages/_es/Tabbar.js +2 -2
  86. package/dist/packages/_es/TabbarItem.js +23 -8
  87. package/dist/packages/_es/Table.js +2 -2
  88. package/dist/packages/_es/Tabs.js +8 -5
  89. package/dist/packages/_es/Tag.js +11 -5
  90. package/dist/packages/_es/TextArea.js +38 -6
  91. package/dist/packages/_es/TimeDetail.js +2 -2
  92. package/dist/packages/_es/TimePannel.js +2 -2
  93. package/dist/packages/_es/TimeSelect.js +8 -3
  94. package/dist/packages/_es/Toast.js +16 -9
  95. package/dist/packages/_es/Uploader.js +2 -4
  96. package/dist/packages/_es/Video.js +12 -8
  97. package/dist/packages/_es/common.js +2 -2
  98. package/dist/packages/_es/component.js +2 -2
  99. package/dist/packages/_es/index.js +6 -8
  100. package/dist/packages/_es/index2.js +9 -32
  101. package/dist/packages/_es/index3.js +29 -57
  102. package/dist/packages/_es/index4.js +64 -0
  103. package/dist/packages/_es/index5.js +687 -0
  104. package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
  105. package/dist/packages/_es/pxCheck.js +2 -2
  106. package/dist/packages/_es/raf.js +2 -2
  107. package/dist/packages/_es/util.js +2 -2
  108. package/dist/packages/actionsheet/index.scss +7 -6
  109. package/dist/packages/badge/index.scss +11 -13
  110. package/dist/packages/button/index.scss +6 -5
  111. package/dist/packages/calendar/index.scss +9 -4
  112. package/dist/packages/calendaritem/index.scss +0 -207
  113. package/dist/packages/cell/index.scss +9 -9
  114. package/dist/packages/cellgroup/index.scss +1 -1
  115. package/dist/packages/checkbox/index.scss +4 -3
  116. package/dist/packages/collapseitem/index.scss +21 -11
  117. package/dist/packages/countdown/index.scss +3 -1
  118. package/dist/packages/divider/index.scss +8 -8
  119. package/dist/packages/elevator/index.scss +36 -36
  120. package/dist/packages/formitem/index.scss +15 -8
  121. package/dist/packages/indicator/index.scss +1 -1
  122. package/dist/packages/input/index.scss +70 -24
  123. package/dist/packages/inputnumber/index.scss +4 -2
  124. package/dist/packages/list/index.scss +24 -0
  125. package/dist/packages/menu/index.scss +3 -3
  126. package/dist/packages/navbar/index.scss +30 -8
  127. package/dist/packages/noticebar/index.scss +10 -5
  128. package/dist/packages/notify/index.scss +10 -0
  129. package/dist/packages/numberkeyboard/index.scss +22 -21
  130. package/dist/packages/oldpicker/index.scss +131 -0
  131. package/dist/packages/picker/index.scss +38 -32
  132. package/dist/packages/progress/index.scss +24 -19
  133. package/dist/packages/radio/index.scss +7 -6
  134. package/dist/packages/range/index.scss +113 -6
  135. package/dist/packages/searchbar/index.scss +7 -7
  136. package/dist/packages/sidenavbaritem/index.scss +5 -5
  137. package/dist/packages/step/index.scss +29 -29
  138. package/dist/packages/subsidenavbar/index.scss +10 -8
  139. package/dist/packages/swiper/index.scss +4 -4
  140. package/dist/packages/switch/index.scss +8 -8
  141. package/dist/packages/tabbar/index.scss +3 -2
  142. package/dist/packages/tabbaritem/index.scss +19 -3
  143. package/dist/packages/tabs/index.scss +1 -0
  144. package/dist/packages/timedetail/index.scss +13 -13
  145. package/dist/packages/timepannel/index.scss +7 -7
  146. package/dist/packages/timeselect/index.scss +3 -3
  147. package/dist/packages/toast/index.scss +8 -7
  148. package/dist/packages/uploader/index.scss +4 -4
  149. package/dist/style.css +1 -1
  150. package/dist/styles/themes/default.scss +43 -41
  151. package/dist/styles/themes/jdt.scss +91 -0
  152. package/dist/styles/variables-jdt.scss +728 -0
  153. package/dist/styles/variables.scss +322 -38
  154. package/package.json +3 -2
  155. package/dist/styles/themes/jdd.scss +0 -2
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { computed, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode } from "vue";
6
+ import { ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  const { componentName, create } = createComponent("textarea");
@@ -15,7 +15,7 @@ const _sfc_main = create({
15
15
  },
16
16
  textAlign: {
17
17
  type: String,
18
- default: "left"
18
+ default: ""
19
19
  },
20
20
  limitShow: {
21
21
  type: Boolean,
@@ -52,6 +52,7 @@ const _sfc_main = create({
52
52
  },
53
53
  emits: ["update:modelValue", "change", "blur", "focus"],
54
54
  setup(props, { emit }) {
55
+ const textareaRef = ref();
55
56
  const classes = computed(() => {
56
57
  const prefixCls = componentName;
57
58
  return {
@@ -59,12 +60,41 @@ const _sfc_main = create({
59
60
  [`${prefixCls}--disabled`]: props.disabled
60
61
  };
61
62
  });
63
+ onMounted(() => {
64
+ if (props.modelValue) {
65
+ emitChange(String(props.modelValue));
66
+ }
67
+ if (props.autosize) {
68
+ nextTick(getContentHeight);
69
+ }
70
+ });
62
71
  const styles = computed(() => {
63
72
  return {
64
- textAlign: props.textAlign,
65
- resize: props.autosize ? "vertical" : "none"
73
+ textAlign: props.textAlign
66
74
  };
67
75
  });
76
+ const getContentHeight = () => {
77
+ let textarea = textareaRef.value;
78
+ textarea.style.height = "auto";
79
+ let height = textarea.scrollHeight;
80
+ if (typeof props.autosize === "object") {
81
+ const { maxHeight, minHeight } = props.autosize;
82
+ if (maxHeight !== void 0) {
83
+ height = Math.min(height, maxHeight);
84
+ }
85
+ if (minHeight !== void 0) {
86
+ height = Math.max(height, minHeight);
87
+ }
88
+ }
89
+ if (height) {
90
+ textarea.style.height = height + "px";
91
+ }
92
+ };
93
+ watch(() => props.modelValue, () => {
94
+ if (props.autosize) {
95
+ nextTick(getContentHeight);
96
+ }
97
+ });
68
98
  const emitChange = (value, event) => {
69
99
  if (props.maxLength && value.length > Number(props.maxLength)) {
70
100
  value = value.substring(0, Number(props.maxLength));
@@ -94,6 +124,7 @@ const _sfc_main = create({
94
124
  emit("blur", { value, event });
95
125
  };
96
126
  return {
127
+ textareaRef,
97
128
  classes,
98
129
  styles,
99
130
  change,
@@ -112,6 +143,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
112
143
  class: normalizeClass(_ctx.classes)
113
144
  }, [
114
145
  createElementVNode("textarea", {
146
+ ref: "textareaRef",
115
147
  class: "nut-textarea__textarea",
116
148
  style: normalizeStyle(_ctx.styles),
117
149
  rows: _ctx.rows,
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, toDisplayString } from "vue";
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString } from "vue";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, toDisplayString, renderSlot } from "vue";
@@ -30,6 +30,10 @@ const _sfc_main = create({
30
30
  default: () => {
31
31
  return [];
32
32
  }
33
+ },
34
+ isWrapTeleport: {
35
+ type: Boolean,
36
+ default: false
33
37
  }
34
38
  },
35
39
  emits: ["update:visible", "select"],
@@ -72,6 +76,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
72
76
  position: "bottom",
73
77
  closeable: "",
74
78
  round: "",
79
+ isWrapTeleport: _ctx.isWrapTeleport,
75
80
  visible: _ctx.visible,
76
81
  style: normalizeStyle(_ctx.popStyle),
77
82
  onClickOverlay: _ctx.close,
@@ -95,7 +100,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
95
100
  ], 2)
96
101
  ]),
97
102
  _: 3
98
- }, 8, ["visible", "style", "onClickOverlay", "onClickCloseIcon"]);
103
+ }, 8, ["isWrapTeleport", "visible", "style", "onClickOverlay", "onClickCloseIcon"]);
99
104
  }
100
105
  var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
101
106
  export { index as default };
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { reactive, onMounted, watch, computed, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, createVNode, createCommentVNode, toDisplayString, vShow, render } from "vue";
@@ -53,6 +53,10 @@ const _sfc_main = create({
53
53
  type: [String, Number],
54
54
  default: "base"
55
55
  },
56
+ iconSize: {
57
+ type: String,
58
+ default: "20"
59
+ },
56
60
  icon: String,
57
61
  textAlignCenter: {
58
62
  type: Boolean,
@@ -64,7 +68,7 @@ const _sfc_main = create({
64
68
  },
65
69
  bgColor: {
66
70
  type: String,
67
- default: "rgba(0, 0, 0, .8)"
71
+ default: ""
68
72
  },
69
73
  onClose: Function,
70
74
  unmount: Function,
@@ -74,7 +78,7 @@ const _sfc_main = create({
74
78
  },
75
79
  coverColor: {
76
80
  type: String,
77
- default: "rgba(0, 0, 0, 0)"
81
+ default: ""
78
82
  },
79
83
  title: {
80
84
  type: String,
@@ -85,7 +89,8 @@ const _sfc_main = create({
85
89
  default: false
86
90
  }
87
91
  },
88
- setup(props) {
92
+ emits: ["close"],
93
+ setup(props, { emit }) {
89
94
  let timer;
90
95
  const state = reactive({
91
96
  mounted: false
@@ -113,6 +118,7 @@ const _sfc_main = create({
113
118
  const clickCover = () => {
114
119
  if (props.closeOnClickOverlay) {
115
120
  hide();
121
+ emit("close");
116
122
  }
117
123
  };
118
124
  if (props.duration) {
@@ -189,10 +195,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
189
195
  }, [
190
196
  _ctx.hasIcon ? (openBlock(), createElementBlock("view", _hoisted_1, [
191
197
  createVNode(_component_nut_icon, {
192
- size: "20",
198
+ size: _ctx.iconSize,
193
199
  color: "#ffffff",
194
200
  name: _ctx.icon
195
- }, null, 8, ["name"])
201
+ }, null, 8, ["size", "name"])
196
202
  ])) : createCommentVNode("", true),
197
203
  _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
198
204
  createElementVNode("view", {
@@ -218,14 +224,15 @@ const defaultOptions = {
218
224
  customClass: "",
219
225
  bottom: "30px",
220
226
  size: "base",
227
+ iconSize: "20",
221
228
  icon: null,
222
229
  textAlignCenter: true,
223
230
  loadingRotate: true,
224
- bgColor: "rgba(0, 0, 0, .8)",
231
+ bgColor: "",
225
232
  onClose: null,
226
233
  unmount: null,
227
234
  cover: false,
228
- coverColor: "rgba(0, 0, 0, 0)",
235
+ coverColor: "",
229
236
  closeOnClickOverlay: false
230
237
  };
231
238
  let idsMap = [];
@@ -19,8 +19,8 @@ var __publicField = (obj, key, value) => {
19
19
  return value;
20
20
  };
21
21
  /*!
22
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
23
- * (c) 2021 @jdf2e.
22
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
23
+ * (c) 2022 @jdf2e.
24
24
  * Released under the MIT License.
25
25
  */
26
26
  import { reactive, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, Fragment, createCommentVNode, renderList, createElementVNode, toDisplayString, createVNode, createBlock, createTextVNode } from "vue";
@@ -302,8 +302,6 @@ const _sfc_main = create({
302
302
  fileList,
303
303
  index: index2
304
304
  });
305
- } else {
306
- console.log("\u7528\u6237\u963B\u6B62\u4E86\u5220\u9664\uFF01");
307
305
  }
308
306
  };
309
307
  const onChange = (event) => {
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, createCommentVNode, withDirectives, vShow, normalizeClass, toDisplayString, normalizeStyle, withModifiers } from "vue";
@@ -90,24 +90,26 @@ const _sfc_main = create({
90
90
  },
91
91
  showTouchMask: false
92
92
  });
93
- const root = ref();
93
+ const root = ref(null);
94
94
  const isDisabled = computed(() => {
95
95
  return props.options.disabled;
96
96
  });
97
- watch(props.source, (newValue) => {
97
+ watch(() => props.source, (newValue) => {
98
98
  if (newValue.src) {
99
99
  nextTick(() => {
100
100
  state.videoElm.load();
101
101
  });
102
102
  }
103
103
  });
104
- watch(props.options, (newValue) => {
105
- state.state.isMuted = newValue.muted ? newValue.muted : false;
104
+ watch(() => props.options, (newValue) => {
105
+ state.state.isMuted = newValue ? newValue.muted : false;
106
106
  }, { immediate: true });
107
107
  const init = () => {
108
108
  state.videoElm = root.value;
109
109
  if (props.options.autoplay) {
110
- state.videoElm.play();
110
+ setTimeout(() => {
111
+ state.videoElm.play();
112
+ }, 200);
111
113
  }
112
114
  if (props.options.touchPlay) {
113
115
  state.showTouchMask = true;
@@ -150,7 +152,9 @@ const _sfc_main = create({
150
152
  if (state.videoElm) {
151
153
  if (state.state.playing) {
152
154
  try {
153
- state.videoElm.play();
155
+ setTimeout(() => {
156
+ state.videoElm.play();
157
+ }, 200);
154
158
  state.videoElm.addEventListener("progress", () => {
155
159
  getLoadTime();
156
160
  });
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { provide, shallowReactive, getCurrentInstance, markRaw, isVNode, computed, h } from "vue";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { defineComponent } from "vue";
@@ -1,13 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { getCurrentInstance } from "vue";
7
- function useExpose(apis) {
8
- const instance = getCurrentInstance();
9
- if (instance) {
10
- Object.assign(instance.proxy, apis);
11
- }
7
+ function useRouter() {
8
+ const proxy = getCurrentInstance().proxy;
9
+ return proxy.$router || null;
12
10
  }
13
- export { useExpose as u };
11
+ export { useRouter as u };
@@ -1,36 +1,13 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
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
- };
23
- }
24
- if (element && element.getBoundingClientRect) {
25
- return element.getBoundingClientRect();
6
+ import { getCurrentInstance } from "vue";
7
+ function useExpose(apis) {
8
+ const instance = getCurrentInstance();
9
+ if (instance) {
10
+ Object.assign(instance.proxy, apis);
26
11
  }
27
- return {
28
- top: 0,
29
- left: 0,
30
- right: 0,
31
- bottom: 0,
32
- width: 0,
33
- height: 0
34
- };
35
- };
36
- export { useRect as u };
12
+ }
13
+ export { useExpose as u };
@@ -1,64 +1,36 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
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";
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
+ };
11
23
  }
12
- if (y > x && y > MIN_DISTANCE) {
13
- return "vertical";
24
+ if (element && element.getBoundingClientRect) {
25
+ return element.getBoundingClientRect();
14
26
  }
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
27
  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
28
+ top: 0,
29
+ left: 0,
30
+ right: 0,
31
+ bottom: 0,
32
+ width: 0,
33
+ height: 0
62
34
  };
63
- }
64
- export { useTouch as u };
35
+ };
36
+ export { useRect as u };
@@ -0,0 +1,64 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
+ * Released under the MIT License.
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
62
+ };
63
+ }
64
+ export { useTouch as u };