@nutui/nutui 3.2.7 → 3.2.8-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/dist/nutui.es.js +1932 -3372
  2. package/dist/nutui.umd.js +1929 -3370
  3. package/dist/packages/_es/ActionSheet.js +2 -5
  4. package/dist/packages/_es/Address.js +162 -250
  5. package/dist/packages/_es/AddressList.js +229 -307
  6. package/dist/packages/_es/Animate.js +1 -1
  7. package/dist/packages/_es/Audio.js +1 -1
  8. package/dist/packages/_es/AudioOperate.js +1 -1
  9. package/dist/packages/_es/Avatar.js +1 -1
  10. package/dist/packages/_es/AvatarGroup.js +1 -1
  11. package/dist/packages/_es/BackTop.js +1 -1
  12. package/dist/packages/_es/Badge.js +1 -1
  13. package/dist/packages/_es/Barrage.js +1 -1
  14. package/dist/packages/_es/Button.js +1 -1
  15. package/dist/packages/_es/Calendar.js +1 -1
  16. package/dist/packages/_es/CalendarItem.js +1 -1
  17. package/dist/packages/_es/Card.js +1 -1
  18. package/dist/packages/_es/Cascader.js +2 -5
  19. package/dist/packages/_es/Category.js +1 -1
  20. package/dist/packages/_es/CategoryPane.js +1 -1
  21. package/dist/packages/_es/Cell.js +1 -1
  22. package/dist/packages/_es/CellGroup.js +1 -1
  23. package/dist/packages/_es/Checkbox.js +1 -1
  24. package/dist/packages/_es/CheckboxGroup.js +1 -1
  25. package/dist/packages/_es/CircleProgress.js +2 -2
  26. package/dist/packages/_es/Col.js +1 -1
  27. package/dist/packages/_es/Collapse.js +4 -11
  28. package/dist/packages/_es/CollapseItem.js +8 -5
  29. package/dist/packages/_es/Comment.js +1 -1
  30. package/dist/packages/_es/ConfigProvider.js +1 -1
  31. package/dist/packages/_es/CountDown.js +2 -10
  32. package/dist/packages/_es/CountUp.js +1 -1
  33. package/dist/packages/_es/DatePicker.js +8 -17
  34. package/dist/packages/_es/Dialog.js +38 -63
  35. package/dist/packages/_es/Divider.js +1 -1
  36. package/dist/packages/_es/Drag.js +1 -1
  37. package/dist/packages/_es/Ecard.js +1 -1
  38. package/dist/packages/_es/Elevator.js +2 -2
  39. package/dist/packages/_es/Ellipsis.js +1 -1
  40. package/dist/packages/_es/Empty.js +1 -1
  41. package/dist/packages/_es/FixedNav.js +1 -1
  42. package/dist/packages/_es/Form.js +39 -31
  43. package/dist/packages/_es/FormItem.js +1 -1
  44. package/dist/packages/_es/Grid.js +2 -2
  45. package/dist/packages/_es/GridItem.js +1 -1
  46. package/dist/packages/_es/Icon.js +1 -1
  47. package/dist/packages/_es/Image.js +1 -1
  48. package/dist/packages/_es/ImagePreview.js +126 -220
  49. package/dist/packages/_es/Indicator.js +4 -4
  50. package/dist/packages/_es/InfiniteLoading.js +1 -1
  51. package/dist/packages/_es/Input.js +107 -123
  52. package/dist/packages/_es/InputNumber.js +1 -1
  53. package/dist/packages/_es/Invoice.js +1 -1
  54. package/dist/packages/_es/Layout.js +1 -1
  55. package/dist/packages/_es/List.js +1 -1
  56. package/dist/packages/_es/Menu.js +14 -1
  57. package/dist/packages/_es/MenuItem.js +10 -7
  58. package/dist/packages/_es/Navbar.js +1 -1
  59. package/dist/packages/_es/NoticeBar.js +1 -1
  60. package/dist/packages/_es/Notify.js +5 -7
  61. package/dist/packages/_es/NumberKeyboard.js +4 -4
  62. package/dist/packages/_es/OverLay.js +60 -63
  63. package/dist/packages/_es/Pagination.js +1 -1
  64. package/dist/packages/_es/Picker.js +25 -50
  65. package/dist/packages/_es/Popover.js +111 -930
  66. package/dist/packages/_es/Popup.js +105 -217
  67. package/dist/packages/_es/Price.js +1 -1
  68. package/dist/packages/_es/Progress.js +1 -1
  69. package/dist/packages/_es/Radio.js +1 -1
  70. package/dist/packages/_es/RadioGroup.js +1 -1
  71. package/dist/packages/_es/Range.js +1 -1
  72. package/dist/packages/_es/Rate.js +1 -1
  73. package/dist/packages/_es/Row.js +1 -1
  74. package/dist/packages/_es/SearchBar.js +1 -1
  75. package/dist/packages/_es/ShortPassword.js +4 -4
  76. package/dist/packages/_es/SideNavBar.js +1 -1
  77. package/dist/packages/_es/SideNavBarItem.js +1 -1
  78. package/dist/packages/_es/Signature.js +1 -1
  79. package/dist/packages/_es/Skeleton.js +1 -1
  80. package/dist/packages/_es/Sku.js +4 -7
  81. package/dist/packages/_es/Step.js +1 -1
  82. package/dist/packages/_es/Steps.js +1 -1
  83. package/dist/packages/_es/Sticky.js +1 -1
  84. package/dist/packages/_es/SubSideNavBar.js +1 -1
  85. package/dist/packages/_es/Swipe.js +1 -1
  86. package/dist/packages/_es/Swiper.js +1 -1
  87. package/dist/packages/_es/SwiperItem.js +1 -1
  88. package/dist/packages/_es/Switch.js +1 -1
  89. package/dist/packages/_es/TabPane.js +1 -1
  90. package/dist/packages/_es/Tabbar.js +1 -1
  91. package/dist/packages/_es/TabbarItem.js +2 -2
  92. package/dist/packages/_es/Table.js +1 -1
  93. package/dist/packages/_es/Tabs.js +2 -2
  94. package/dist/packages/_es/Tag.js +1 -1
  95. package/dist/packages/_es/TextArea.js +1 -1
  96. package/dist/packages/_es/TimeDetail.js +1 -1
  97. package/dist/packages/_es/TimePannel.js +1 -1
  98. package/dist/packages/_es/TimeSelect.js +4 -4
  99. package/dist/packages/_es/Toast.js +5 -6
  100. package/dist/packages/_es/TrendArrow.js +1 -1
  101. package/dist/packages/_es/Uploader.js +2 -2
  102. package/dist/packages/_es/Video.js +1 -1
  103. package/dist/packages/_es/WaterMark.js +1 -1
  104. package/dist/packages/_es/common.js +1 -1
  105. package/dist/packages/_es/component.js +22 -2
  106. package/dist/packages/_es/index.js +1 -1
  107. package/dist/packages/_es/index2.js +1 -1
  108. package/dist/packages/_es/index3.js +1 -1
  109. package/dist/packages/_es/index4.js +1 -1
  110. package/dist/packages/_es/index5.js +1 -1
  111. package/dist/packages/_es/interceptor.js +32 -0
  112. package/dist/packages/_es/mountComponent.js +42 -0
  113. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  114. package/dist/packages/_es/props.js +80 -0
  115. package/dist/packages/_es/pxCheck.js +1 -1
  116. package/dist/packages/_es/raf.js +1 -1
  117. package/dist/packages/_es/style.css +1 -1
  118. package/dist/packages/address/index.scss +7 -2
  119. package/dist/packages/addresslist/index.scss +61 -101
  120. package/dist/packages/imagepreview/index.scss +9 -1
  121. package/dist/packages/inputnumber/index.scss +5 -1
  122. package/dist/packages/locale/lang/baseLang.js +1 -1
  123. package/dist/packages/locale/lang/en-US.js +1 -1
  124. package/dist/packages/locale/lang/id-ID.js +1 -1
  125. package/dist/packages/locale/lang/index.js +1 -1
  126. package/dist/packages/locale/lang/zh-CN.js +1 -1
  127. package/dist/packages/locale/lang/zh-TW.js +1 -1
  128. package/dist/packages/menuitem/index.scss +0 -15
  129. package/dist/packages/notify/index.scss +2 -2
  130. package/dist/packages/overlay/index.scss +2 -1
  131. package/dist/packages/picker/index.scss +20 -12
  132. package/dist/packages/popover/index.scss +191 -363
  133. package/dist/packages/popup/index.scss +3 -14
  134. package/dist/smartips/attributes.json +59 -55
  135. package/dist/smartips/tags.json +16 -19
  136. package/dist/smartips/web-types.json +115 -113
  137. package/dist/style.css +1 -1
  138. package/dist/styles/themes/default.scss +54 -55
  139. package/dist/styles/themes/jdb.scss +54 -55
  140. package/dist/styles/themes/jddkh.scss +54 -55
  141. package/dist/styles/themes/jdt.scss +54 -55
  142. package/dist/styles/variables.scss +9 -0
  143. package/dist/types/__VUE/actionsheet/index.vue.d.ts +61 -57
  144. package/dist/types/__VUE/address/index.vue.d.ts +74 -94
  145. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +29 -9
  146. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +4 -13
  147. package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +9 -9
  148. package/dist/types/__VUE/addresslist/index.vue.d.ts +23 -20
  149. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  150. package/dist/types/__VUE/cascader/index.vue.d.ts +49 -54
  151. package/dist/types/__VUE/cell/index.vue.d.ts +1 -1
  152. package/dist/types/__VUE/countdown/index.vue.d.ts +0 -1
  153. package/dist/types/__VUE/countdown/util.d.ts +0 -1
  154. package/dist/types/__VUE/datepicker/index.vue.d.ts +57 -62
  155. package/dist/types/__VUE/dialog/index.d.ts +0 -3
  156. package/dist/types/__VUE/dialog/index.vue.d.ts +52 -61
  157. package/dist/types/__VUE/divider/index.vue.d.ts +1 -1
  158. package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
  159. package/dist/types/__VUE/form/common.d.ts +4 -2
  160. package/dist/types/__VUE/form/index.vue.d.ts +4 -4
  161. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  162. package/dist/types/__VUE/image/index.vue.d.ts +1 -1
  163. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +27 -20
  164. package/dist/types/__VUE/imagepreview/index.d.ts +19 -5
  165. package/dist/types/__VUE/imagepreview/index.vue.d.ts +57 -43
  166. package/dist/types/__VUE/imagepreview/types.d.ts +44 -0
  167. package/dist/types/__VUE/indicator/index.vue.d.ts +1 -0
  168. package/dist/types/__VUE/input/index.vue.d.ts +35 -23
  169. package/dist/types/__VUE/inputnumber/index.vue.d.ts +1 -1
  170. package/dist/types/__VUE/invoice/index.vue.d.ts +1 -1
  171. package/dist/types/__VUE/menu/index.vue.d.ts +1 -1
  172. package/dist/types/__VUE/menuitem/index.vue.d.ts +3 -3
  173. package/dist/types/__VUE/notify/index.vue.d.ts +3 -3
  174. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +4 -4
  175. package/dist/types/__VUE/overlay/index.vue.d.ts +12 -13
  176. package/dist/types/__VUE/picker/Column.vue.d.ts +0 -2
  177. package/dist/types/__VUE/picker/index.vue.d.ts +59 -66
  178. package/dist/types/__VUE/popover/index.vue.d.ts +40 -143
  179. package/dist/types/__VUE/popup/common.d.ts +103 -0
  180. package/dist/types/__VUE/popup/index.vue.d.ts +57 -1593
  181. package/dist/types/__VUE/popup/props.d.ts +82 -0
  182. package/dist/types/__VUE/rate/index.vue.d.ts +1 -1
  183. package/dist/types/__VUE/shortpassword/index.vue.d.ts +5 -5
  184. package/dist/types/__VUE/sku/index.vue.d.ts +59 -64
  185. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  186. package/dist/types/__VUE/switch/index.vue.d.ts +1 -1
  187. package/dist/types/__VUE/tabbar/index.vue.d.ts +1 -1
  188. package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -3
  189. package/dist/types/__VUE/video/index.vue.d.ts +2 -2
  190. package/dist/types/index.d.ts +1 -1
  191. package/dist/types/nutui.d.ts +1 -2
  192. package/package.json +2 -3
  193. package/dist/packages/_es/PullRefresh.js +0 -349
  194. package/dist/packages/pullrefresh/index.scss +0 -71
  195. package/dist/types/__VUE/addresslist/components/LongPressShell.vue.d.ts +0 -47
  196. package/dist/types/__VUE/datepicker/utils.d.ts +0 -5
  197. package/dist/types/__VUE/popup/use-lock-scroll.d.ts +0 -5
  198. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -128
  199. package/dist/types/__VUE/pullrefresh/use-touch.d.ts +0 -20
  200. package/dist/types/__VUE/pullrefresh/util.d.ts +0 -6
@@ -1,349 +0,0 @@
1
- /*!
2
- * @nutui/nutui v3.2.7 Fri Nov 18 2022 19:57:44 GMT+0800 (中国标准时间)
3
- * (c) 2022 @jdf2e.
4
- * Released under the MIT License.
5
- */
6
- import { ref, toRefs, reactive, computed, onMounted, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, toDisplayString, renderSlot } from "vue";
7
- import { c as createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
- import "../locale/lang";
10
- const MIN_DISTANCE = 10;
11
- function getDirection(x, y) {
12
- if (x > y && x > MIN_DISTANCE) {
13
- return "horizontal";
14
- }
15
- if (y > x && y > MIN_DISTANCE) {
16
- return "vertical";
17
- }
18
- return "";
19
- }
20
- function useTouch() {
21
- const startX = ref(0);
22
- const startY = ref(0);
23
- const deltaX = ref(0);
24
- const deltaY = ref(0);
25
- const offsetX = ref(0);
26
- const offsetY = ref(0);
27
- const direction = ref("");
28
- const isVertical = () => direction.value === "vertical";
29
- const isHorizontal = () => direction.value === "horizontal";
30
- const reset = () => {
31
- deltaX.value = 0;
32
- deltaY.value = 0;
33
- offsetX.value = 0;
34
- offsetY.value = 0;
35
- direction.value = "";
36
- };
37
- const start = (event) => {
38
- reset();
39
- startX.value = event.touches[0].clientX;
40
- startY.value = event.touches[0].clientY;
41
- };
42
- const move = (event) => {
43
- const touch = event.touches[0];
44
- deltaX.value = touch.clientX - startX.value;
45
- deltaY.value = touch.clientY - startY.value;
46
- offsetX.value = Math.abs(deltaX.value);
47
- offsetY.value = Math.abs(deltaY.value);
48
- if (!direction.value) {
49
- direction.value = getDirection(offsetX.value, offsetY.value);
50
- }
51
- };
52
- return {
53
- move,
54
- start,
55
- reset,
56
- startX,
57
- startY,
58
- deltaX,
59
- deltaY,
60
- offsetX,
61
- offsetY,
62
- direction,
63
- isVertical,
64
- isHorizontal
65
- };
66
- }
67
- function preventDefault(event, isStopPropagation) {
68
- if (typeof event.cancelable !== "boolean" || event.cancelable) {
69
- event.preventDefault();
70
- }
71
- if (isStopPropagation)
72
- event.stopPropagation();
73
- }
74
- const { componentName, create } = createComponent("pullrefresh");
75
- const _sfc_main = create({
76
- props: {
77
- useWindow: {
78
- type: Boolean,
79
- default: true
80
- },
81
- containerId: {
82
- type: String,
83
- default: ""
84
- },
85
- disabled: {
86
- type: Boolean,
87
- default: false
88
- },
89
- direction: {
90
- type: String,
91
- default: "vertical"
92
- },
93
- pullingText: {
94
- type: Object,
95
- default: {
96
- top: "\u4E0B\u62C9\u5237\u65B0",
97
- bottom: "\u4E0A\u62C9\u52A0\u8F7D",
98
- left: "\u5DE6\u6ED1\u5237\u65B0",
99
- right: "\u53F3\u6ED1\u52A0\u8F7D"
100
- }
101
- },
102
- loosingText: {
103
- type: Object,
104
- default: {
105
- top: "\u677E\u624B\u91CA\u653E\u5237\u65B0",
106
- bottom: "\u677E\u624B\u91CA\u653E\u5237\u65B0",
107
- left: "\u91CA\u653E\u5237\u65B0",
108
- right: "\u52A0\u8F7D\u66F4\u591A"
109
- }
110
- },
111
- loadingText: {
112
- type: Object,
113
- default: {
114
- top: "\u52A0\u8F7D\u4E2D...",
115
- bottom: "\u52A0\u8F7D\u4E2D...",
116
- left: "\u52A0\u8F7D\u4E2D...",
117
- right: "\u52A0\u8F7D\u4E2D..."
118
- }
119
- }
120
- },
121
- emits: ["refresh", "downRefresh"],
122
- setup(props, { emit }) {
123
- const { containerId, useWindow, direction, disabled } = toRefs(props);
124
- const reachTop = ref(false);
125
- const reachBottom = ref(false);
126
- const reachLeft = ref(false);
127
- const reachRight = ref(false);
128
- const state = reactive({
129
- status: "normal",
130
- distance: 0,
131
- duration: 0
132
- });
133
- let scrollEl = document.documentElement || document.body;
134
- const scroller = ref(null);
135
- const touch = useTouch();
136
- const getStyle = computed(() => {
137
- let style = {};
138
- const { deltaY, deltaX } = touch;
139
- if (direction.value == "vertical" && (reachTop.value && deltaY.value > 0 || reachBottom.value && deltaY.value < 0) && touch.isVertical()) {
140
- style = {
141
- transitionDuration: `${state.duration}ms`,
142
- transform: state.distance ? `translate3d(0,${state.distance}px, 0)` : `translate3d(0,0,0)`
143
- };
144
- }
145
- if (direction.value == "horizontal" && (reachLeft.value && deltaX.value > 0 || reachRight.value && deltaX.value < 0) && touch.isHorizontal()) {
146
- style = {
147
- transitionDuration: `${state.duration}ms`,
148
- transform: state.distance ? `translate3d(${state.distance}px, 0,0)` : `translate3d(0,0,0)`
149
- };
150
- }
151
- return style;
152
- });
153
- const getBottomStyle = computed(() => {
154
- let style = {};
155
- if (direction.value == "vertical" && reachBottom.value && touch.deltaY.value < 0 && touch.isVertical()) {
156
- const dis = Math.abs(state.distance) < 50 ? -state.distance : 50;
157
- style = {
158
- height: dis + "px"
159
- };
160
- }
161
- if (direction.value == "horizontal" && reachRight.value && touch.deltaX.value < 0 && touch.isVertical()) {
162
- const dis = Math.abs(state.distance) < 50 ? -state.distance : 50;
163
- style = {
164
- width: dis + "px"
165
- };
166
- }
167
- return style;
168
- });
169
- const refreshTopTem = computed(() => {
170
- const { status, distance } = state;
171
- const tag = direction.value == "vertical" ? "top" : "left";
172
- if (status == "loading" && (reachTop.value || reachLeft.value) && distance > 0) {
173
- return props.loadingText[tag];
174
- }
175
- if (status == "pulling" && (reachTop.value || reachLeft.value) && distance > 0) {
176
- return props.pullingText[tag];
177
- }
178
- if (status == "loosing" && (reachTop.value || reachLeft.value) && distance > 0) {
179
- return props.loosingText[tag];
180
- }
181
- return "";
182
- });
183
- const refreshBottomTem = computed(() => {
184
- const { status, distance } = state;
185
- const tag = direction.value == "vertical" ? "bottom" : "right";
186
- if (status == "loading" && (reachBottom.value || reachRight.value) && distance < 0) {
187
- return props.loadingText[tag];
188
- }
189
- if (status == "pulling" && (reachBottom.value || reachRight.value) && distance < 0) {
190
- return props.pullingText[tag];
191
- }
192
- if (status == "loosing" && (reachBottom.value || reachRight.value) && distance < 0) {
193
- return props.loosingText[tag];
194
- }
195
- return "";
196
- });
197
- const isTouchable = () => state.status !== "loading" && !disabled.value;
198
- const setStatus = (distance, isLoading) => {
199
- state.distance = distance;
200
- if (isLoading) {
201
- state.status = "loading";
202
- } else if (distance === 0) {
203
- state.status = "normal";
204
- } else if (Math.abs(distance) < 50) {
205
- state.status = "pulling";
206
- } else {
207
- state.status = "loosing";
208
- }
209
- };
210
- const getParentElement = (el) => {
211
- if (containerId.value != "") {
212
- return document.querySelector(`#${containerId.value}`);
213
- }
214
- return el && el.parentNode;
215
- };
216
- onMounted(() => {
217
- const parentElement = getParentElement(scroller);
218
- let scrollElCopy = document.documentElement || document.body;
219
- if (useWindow.value === false) {
220
- scrollElCopy = parentElement;
221
- }
222
- scrollEl = scrollElCopy;
223
- });
224
- const ease = (distance) => {
225
- const headHeight = 50;
226
- if (distance > headHeight) {
227
- if (distance < headHeight * 2) {
228
- distance = headHeight + (distance - headHeight) / 2;
229
- } else {
230
- distance = headHeight * 1.5 + (distance - headHeight * 2) / 4;
231
- }
232
- }
233
- return Math.round(distance);
234
- };
235
- const refreshDone = () => {
236
- setStatus(0);
237
- };
238
- const touchStart = (event) => {
239
- if (isTouchable()) {
240
- if (direction.value == "vertical") {
241
- const top = "scrollTop" in scrollEl ? scrollEl.scrollTop : 0;
242
- reachTop.value = Math.max(top, 0) == 0 ? true : false;
243
- const { scrollHeight, clientHeight, scrollTop } = scrollEl;
244
- reachBottom.value = clientHeight + scrollTop == scrollHeight ? true : false;
245
- if (reachTop.value || reachBottom.value) {
246
- state.duration = 0;
247
- touch.start(event);
248
- }
249
- } else {
250
- const { scrollWidth, clientWidth, scrollLeft } = scrollEl;
251
- const left = "scrollLeft" in scrollEl ? scrollEl.scrollLeft : 0;
252
- reachLeft.value = Math.max(left, 0) == 0 ? true : false;
253
- reachRight.value = clientWidth + scrollLeft == scrollWidth ? true : false;
254
- if (reachLeft.value || reachRight.value) {
255
- state.duration = 0;
256
- touch.start(event);
257
- }
258
- }
259
- } else {
260
- preventDefault(event);
261
- }
262
- };
263
- const touchMove = (event) => {
264
- if (isTouchable()) {
265
- const { deltaY, deltaX } = touch;
266
- touch.move(event);
267
- if (direction.value == "vertical" && (reachBottom.value && deltaY.value < 0 || reachTop.value && deltaY.value >= 0) && touch.isVertical()) {
268
- preventDefault(event);
269
- setStatus(ease(deltaY.value));
270
- }
271
- if (direction.value == "horizontal" && (reachLeft.value && deltaX.value >= 0 || reachRight.value && deltaX.value < 0) && touch.isHorizontal()) {
272
- preventDefault(event);
273
- setStatus(ease(deltaX.value));
274
- }
275
- } else {
276
- preventDefault(event);
277
- }
278
- };
279
- const touchEnd = () => {
280
- if (isTouchable()) {
281
- const { deltaY, deltaX } = touch;
282
- if (state.status === "loosing") {
283
- let dis = 0;
284
- if (direction.value == "vertical" && reachTop.value && deltaY.value > 0) {
285
- dis = 50;
286
- emit("downRefresh", refreshDone);
287
- }
288
- if (direction.value == "vertical" && reachBottom.value && deltaY.value < 0) {
289
- dis = -50;
290
- emit("refresh", refreshDone);
291
- }
292
- if (direction.value == "horizontal" && reachLeft.value && deltaX.value > 0) {
293
- dis = 50;
294
- emit("downRefresh", refreshDone);
295
- }
296
- if (direction.value == "horizontal" && reachRight.value && deltaX.value < 0) {
297
- dis = -50;
298
- emit("refresh", refreshDone);
299
- }
300
- setStatus(dis, true);
301
- } else {
302
- setStatus(0);
303
- }
304
- }
305
- };
306
- return {
307
- scroller,
308
- touchStart,
309
- touchMove,
310
- touchEnd,
311
- getStyle,
312
- reachBottom,
313
- reachTop,
314
- reachRight,
315
- reachLeft,
316
- getBottomStyle,
317
- refreshTopTem,
318
- refreshBottomTem,
319
- ...toRefs(state)
320
- };
321
- }
322
- });
323
- const _hoisted_1 = {
324
- class: "pullrefresh-content",
325
- ref: "pull"
326
- };
327
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
328
- return openBlock(), createElementBlock("view", {
329
- class: "nut-pullrefresh",
330
- ref: "scroller",
331
- style: normalizeStyle(_ctx.getStyle),
332
- onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
333
- onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
334
- onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
335
- }, [
336
- createElementVNode("view", {
337
- class: normalizeClass(["pullrefresh-top", _ctx.direction == "horizontal" ? "pullrefresh-top-h" : "pullrefresh-top-v"])
338
- }, toDisplayString(_ctx.refreshTopTem), 3),
339
- createElementVNode("view", _hoisted_1, [
340
- renderSlot(_ctx.$slots, "default")
341
- ], 512),
342
- createElementVNode("view", {
343
- class: normalizeClass(["pullrefresh-bottom", _ctx.direction == "horizontal" ? "pullrefresh-bottom-h" : "pullrefresh-bottom-v"]),
344
- style: normalizeStyle(_ctx.getBottomStyle)
345
- }, toDisplayString(_ctx.refreshBottomTem), 7)
346
- ], 36);
347
- }
348
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
349
- export { index as default };
@@ -1,71 +0,0 @@
1
- .nut-pullrefresh {
2
- position: relative;
3
- height: 100%;
4
- display: block;
5
-
6
- .pullrefresh-top {
7
- position: absolute;
8
- left: 0;
9
-
10
- display: block;
11
- overflow: hidden;
12
- color: #969799;
13
- font-size: 14px;
14
-
15
- text-align: center;
16
- &.pullrefresh-top-v {
17
- line-height: 50px;
18
- width: 100%;
19
- height: 50px;
20
- -webkit-transform: translateY(-100%);
21
- transform: translateY(-100%);
22
- }
23
- &.pullrefresh-top-h {
24
- display: flex;
25
- align-items: center;
26
- width: 50px;
27
- height: 100%;
28
- -webkit-transform: translateX(-100%);
29
- transform: translateX(-100%);
30
- }
31
- }
32
-
33
- .pullrefresh-content {
34
- height: 100%;
35
- overflow: auto;
36
- background: #fff;
37
-
38
- display: block;
39
- }
40
-
41
- .pullrefresh-bottom {
42
- position: absolute;
43
-
44
- display: block;
45
- overflow: hidden;
46
- color: #969799;
47
- font-size: 14px;
48
-
49
- text-align: center;
50
-
51
- &.pullrefresh-bottom-v {
52
- left: 0;
53
- bottom: 0;
54
- width: 100%;
55
- height: 0px;
56
- line-height: 50px;
57
- -webkit-transform: translateY(100%);
58
- transform: translateY(100%);
59
- }
60
- &.pullrefresh-bottom-h {
61
- display: flex;
62
- align-items: center;
63
- top: 0;
64
- right: 0;
65
- width: 50px;
66
- height: 100%;
67
- -webkit-transform: translateX(100%);
68
- transform: translateX(100%);
69
- }
70
- }
71
- }
@@ -1,47 +0,0 @@
1
- import { App, PropType, CSSProperties } from 'vue';
2
- declare type Install<T> = T & {
3
- install(app: App): void;
4
- };
5
- declare const _sfc_main: Install< import("vue").DefineComponent<{
6
- item: {
7
- type: ObjectConstructor;
8
- default: {};
9
- };
10
- }, {
11
- holddownstart: (event: Event) => void;
12
- holddownmove: (event: Event) => void;
13
- holddownend: (event: Event) => void;
14
- showMaskRef: import("vue").Ref<boolean>;
15
- delClick: (event: Event) => void;
16
- copyCLick: (event: Event) => void;
17
- hideMaskClick: (event: Event) => void;
18
- setDefault: (event: Event) => void;
19
- maskClick: (event: Event) => void;
20
- delShellClick: (event: any, item: any) => void;
21
- editShellClick: (event: any, item: any) => void;
22
- itemShellClick: (event: any, item: any) => void;
23
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("holdingDown" | "handleDel" | "handelMask" | "handleCopy" | "handleSet" | "handleDelIcon" | "handleEditIcon" | "handleItemContent")[], "holdingDown" | "handleDel" | "handelMask" | "handleCopy" | "handleSet" | "handleDelIcon" | "handleEditIcon" | "handleItemContent", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
- item: {
25
- type: ObjectConstructor;
26
- default: {};
27
- };
28
- }>> & {
29
- onHoldingDown?: ((...args: any[]) => any) | undefined;
30
- onHandleDel?: ((...args: any[]) => any) | undefined;
31
- onHandelMask?: ((...args: any[]) => any) | undefined;
32
- onHandleCopy?: ((...args: any[]) => any) | undefined;
33
- onHandleSet?: ((...args: any[]) => any) | undefined;
34
- onHandleDelIcon?: ((...args: any[]) => any) | undefined;
35
- onHandleEditIcon?: ((...args: any[]) => any) | undefined;
36
- onHandleItemContent?: ((...args: any[]) => any) | undefined;
37
- }, {
38
- item: Record<string, any>;
39
- }>>;
40
- export default _sfc_main;
41
-
42
- declare module 'vue' {
43
- interface GlobalComponents {
44
- Nut : typeof _sfc_main;
45
- }
46
- }
47
-
@@ -1,5 +0,0 @@
1
- import { App, PropType, CSSProperties } from 'vue';
2
- declare type Install<T> = T & {
3
- install(app: App): void;
4
- };
5
- export declare function padZero(num: number | string, targetLength?: number): string;
@@ -1,5 +0,0 @@
1
- import { App, PropType, CSSProperties } from 'vue';
2
- declare type Install<T> = T & {
3
- install(app: App): void;
4
- };
5
- export declare const useLockScroll: (isLock: () => boolean) => (() => void)[];
@@ -1,128 +0,0 @@
1
- import { App, PropType, CSSProperties } from 'vue';
2
- declare type Install<T> = T & {
3
- install(app: App): void;
4
- };
5
- declare const _sfc_main: Install< import("vue").DefineComponent<{
6
- useWindow: {
7
- type: BooleanConstructor;
8
- default: boolean;
9
- };
10
- containerId: {
11
- type: StringConstructor;
12
- default: string;
13
- };
14
- disabled: {
15
- type: BooleanConstructor;
16
- default: boolean;
17
- };
18
- direction: {
19
- type: StringConstructor;
20
- default: string;
21
- };
22
- pullingText: {
23
- type: ObjectConstructor;
24
- default: {
25
- top: string;
26
- bottom: string;
27
- left: string;
28
- right: string;
29
- };
30
- };
31
- loosingText: {
32
- type: ObjectConstructor;
33
- default: {
34
- top: string;
35
- bottom: string;
36
- left: string;
37
- right: string;
38
- };
39
- };
40
- loadingText: {
41
- type: ObjectConstructor;
42
- default: {
43
- top: string;
44
- bottom: string;
45
- left: string;
46
- right: string;
47
- };
48
- };
49
- }, {
50
- status: import("vue").Ref<string>;
51
- distance: import("vue").Ref<number>;
52
- duration: import("vue").Ref<number>;
53
- scroller: import("vue").Ref<HTMLElement | null>;
54
- touchStart: (event: any) => void;
55
- touchMove: (event: any) => void;
56
- touchEnd: () => void;
57
- getStyle: import("vue").ComputedRef<CSSProperties>;
58
- reachBottom: import("vue").Ref<boolean>;
59
- reachTop: import("vue").Ref<boolean>;
60
- reachRight: import("vue").Ref<boolean>;
61
- reachLeft: import("vue").Ref<boolean>;
62
- getBottomStyle: import("vue").ComputedRef<CSSProperties>;
63
- refreshTopTem: import("vue").ComputedRef<any>;
64
- refreshBottomTem: import("vue").ComputedRef<any>;
65
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("refresh" | "downRefresh")[], "refresh" | "downRefresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
- useWindow: {
67
- type: BooleanConstructor;
68
- default: boolean;
69
- };
70
- containerId: {
71
- type: StringConstructor;
72
- default: string;
73
- };
74
- disabled: {
75
- type: BooleanConstructor;
76
- default: boolean;
77
- };
78
- direction: {
79
- type: StringConstructor;
80
- default: string;
81
- };
82
- pullingText: {
83
- type: ObjectConstructor;
84
- default: {
85
- top: string;
86
- bottom: string;
87
- left: string;
88
- right: string;
89
- };
90
- };
91
- loosingText: {
92
- type: ObjectConstructor;
93
- default: {
94
- top: string;
95
- bottom: string;
96
- left: string;
97
- right: string;
98
- };
99
- };
100
- loadingText: {
101
- type: ObjectConstructor;
102
- default: {
103
- top: string;
104
- bottom: string;
105
- left: string;
106
- right: string;
107
- };
108
- };
109
- }>> & {
110
- onRefresh?: ((...args: any[]) => any) | undefined;
111
- onDownRefresh?: ((...args: any[]) => any) | undefined;
112
- }, {
113
- disabled: boolean;
114
- direction: string;
115
- useWindow: boolean;
116
- containerId: string;
117
- pullingText: Record<string, any>;
118
- loosingText: Record<string, any>;
119
- loadingText: Record<string, any>;
120
- }>>;
121
- export default _sfc_main;
122
-
123
- declare module 'vue' {
124
- interface GlobalComponents {
125
- NutPullRefresh: typeof _sfc_main;
126
- }
127
- }
128
-
@@ -1,20 +0,0 @@
1
- import { App, PropType, CSSProperties } from 'vue';
2
- declare type Install<T> = T & {
3
- install(app: App): void;
4
- };
5
- declare type Direction = '' | 'vertical' | 'horizontal';
6
- export declare function useTouch(): {
7
- move: EventListener;
8
- start: EventListener;
9
- reset: () => void;
10
- startX: import("vue").Ref<number>;
11
- startY: import("vue").Ref<number>;
12
- deltaX: import("vue").Ref<number>;
13
- deltaY: import("vue").Ref<number>;
14
- offsetX: import("vue").Ref<number>;
15
- offsetY: import("vue").Ref<number>;
16
- direction: import("vue").Ref<Direction>;
17
- isVertical: () => boolean;
18
- isHorizontal: () => boolean;
19
- };
20
- export {};
@@ -1,6 +0,0 @@
1
- import { App, PropType, CSSProperties } from 'vue';
2
- declare type Install<T> = T & {
3
- install(app: App): void;
4
- };
5
- export declare function preventDefault(event: Event, isStopPropagation?: boolean): void;
6
- export declare function trigger(target: Element, type: string): void;