@nutui/nutui 3.2.6 → 3.2.8-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 (239) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +11 -1
  3. package/dist/nutui.es.js +2685 -4599
  4. package/dist/nutui.umd.js +2684 -4600
  5. package/dist/packages/_es/ActionSheet.js +2 -5
  6. package/dist/packages/_es/Address.js +162 -250
  7. package/dist/packages/_es/AddressList.js +229 -307
  8. package/dist/packages/_es/Animate.js +1 -1
  9. package/dist/packages/_es/Audio.js +1 -1
  10. package/dist/packages/_es/AudioOperate.js +1 -1
  11. package/dist/packages/_es/Avatar.js +1 -1
  12. package/dist/packages/_es/AvatarGroup.js +1 -1
  13. package/dist/packages/_es/BackTop.js +1 -1
  14. package/dist/packages/_es/Badge.js +1 -1
  15. package/dist/packages/_es/Barrage.js +1 -1
  16. package/dist/packages/_es/Button.js +1 -1
  17. package/dist/packages/_es/Calendar.js +11 -4
  18. package/dist/packages/_es/CalendarItem.js +1 -1
  19. package/dist/packages/_es/Card.js +1 -1
  20. package/dist/packages/_es/Cascader.js +2 -5
  21. package/dist/packages/_es/Category.js +1 -1
  22. package/dist/packages/_es/CategoryPane.js +1 -1
  23. package/dist/packages/_es/Cell.js +1 -1
  24. package/dist/packages/_es/CellGroup.js +1 -1
  25. package/dist/packages/_es/Checkbox.js +1 -1
  26. package/dist/packages/_es/CheckboxGroup.js +1 -1
  27. package/dist/packages/_es/CircleProgress.js +2 -2
  28. package/dist/packages/_es/Col.js +1 -1
  29. package/dist/packages/_es/Collapse.js +4 -11
  30. package/dist/packages/_es/CollapseItem.js +12 -12
  31. package/dist/packages/_es/Comment.js +1 -1
  32. package/dist/packages/_es/ConfigProvider.js +1 -1
  33. package/dist/packages/_es/CountDown.js +2 -10
  34. package/dist/packages/_es/CountUp.js +1 -1
  35. package/dist/packages/_es/DatePicker.js +8 -17
  36. package/dist/packages/_es/Dialog.js +38 -63
  37. package/dist/packages/_es/Divider.js +1 -1
  38. package/dist/packages/_es/Drag.js +1 -1
  39. package/dist/packages/_es/Ecard.js +1 -1
  40. package/dist/packages/_es/Elevator.js +9 -3
  41. package/dist/packages/_es/Ellipsis.js +3 -3
  42. package/dist/packages/_es/Empty.js +1 -1
  43. package/dist/packages/_es/FixedNav.js +1 -1
  44. package/dist/packages/_es/Form.js +39 -31
  45. package/dist/packages/_es/FormItem.js +1 -1
  46. package/dist/packages/_es/Grid.js +2 -2
  47. package/dist/packages/_es/GridItem.js +1 -1
  48. package/dist/packages/_es/Icon.js +1 -1
  49. package/dist/packages/_es/Image.js +1 -1
  50. package/dist/packages/_es/ImagePreview.js +131 -214
  51. package/dist/packages/_es/Indicator.js +4 -4
  52. package/dist/packages/_es/InfiniteLoading.js +9 -2
  53. package/dist/packages/_es/Input.js +109 -132
  54. package/dist/packages/_es/InputNumber.js +1 -1
  55. package/dist/packages/_es/Invoice.js +1 -1
  56. package/dist/packages/_es/Layout.js +1 -1
  57. package/dist/packages/_es/List.js +1 -1
  58. package/dist/packages/_es/Menu.js +14 -1
  59. package/dist/packages/_es/MenuItem.js +14 -8
  60. package/dist/packages/_es/Navbar.js +1 -1
  61. package/dist/packages/_es/NoticeBar.js +1 -1
  62. package/dist/packages/_es/Notify.js +5 -7
  63. package/dist/packages/_es/NumberKeyboard.js +4 -4
  64. package/dist/packages/_es/OverLay.js +60 -63
  65. package/dist/packages/_es/Pagination.js +1 -1
  66. package/dist/packages/_es/Picker.js +25 -50
  67. package/dist/packages/_es/Popover.js +111 -930
  68. package/dist/packages/_es/Popup.js +108 -261
  69. package/dist/packages/_es/Price.js +1 -1
  70. package/dist/packages/_es/Progress.js +1 -1
  71. package/dist/packages/_es/Radio.js +1 -1
  72. package/dist/packages/_es/RadioGroup.js +1 -1
  73. package/dist/packages/_es/Range.js +1 -1
  74. package/dist/packages/_es/Rate.js +1 -1
  75. package/dist/packages/_es/Row.js +1 -1
  76. package/dist/packages/_es/SearchBar.js +1 -1
  77. package/dist/packages/_es/ShortPassword.js +4 -4
  78. package/dist/packages/_es/SideNavBar.js +1 -1
  79. package/dist/packages/_es/SideNavBarItem.js +1 -1
  80. package/dist/packages/_es/Signature.js +1 -1
  81. package/dist/packages/_es/Skeleton.js +19 -24
  82. package/dist/packages/_es/Sku.js +4 -7
  83. package/dist/packages/_es/Step.js +1 -1
  84. package/dist/packages/_es/Steps.js +1 -1
  85. package/dist/packages/_es/Sticky.js +1 -1
  86. package/dist/packages/_es/SubSideNavBar.js +1 -1
  87. package/dist/packages/_es/Swipe.js +1 -1
  88. package/dist/packages/_es/Swiper.js +1 -1
  89. package/dist/packages/_es/SwiperItem.js +1 -1
  90. package/dist/packages/_es/Switch.js +1 -1
  91. package/dist/packages/_es/TabPane.js +1 -1
  92. package/dist/packages/_es/Tabbar.js +1 -1
  93. package/dist/packages/_es/TabbarItem.js +24 -10
  94. package/dist/packages/_es/Table.js +1 -1
  95. package/dist/packages/_es/Tabs.js +2 -2
  96. package/dist/packages/_es/Tag.js +1 -1
  97. package/dist/packages/_es/TextArea.js +1 -1
  98. package/dist/packages/_es/TimeDetail.js +1 -1
  99. package/dist/packages/_es/TimePannel.js +1 -1
  100. package/dist/packages/_es/TimeSelect.js +4 -4
  101. package/dist/packages/_es/Toast.js +5 -6
  102. package/dist/packages/_es/TrendArrow.js +1 -1
  103. package/dist/packages/_es/Uploader.js +7 -7
  104. package/dist/packages/_es/Video.js +3 -2
  105. package/dist/packages/_es/WaterMark.js +1 -1
  106. package/dist/packages/_es/common.js +1 -1
  107. package/dist/packages/_es/component.js +22 -2
  108. package/dist/packages/_es/index.js +1 -1
  109. package/dist/packages/_es/index2.js +1 -1
  110. package/dist/packages/_es/index3.js +1 -1
  111. package/dist/packages/_es/index4.js +1 -1
  112. package/dist/packages/_es/index5.js +8 -2
  113. package/dist/packages/_es/interceptor.js +32 -0
  114. package/dist/packages/_es/mountComponent.js +42 -0
  115. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  116. package/dist/packages/_es/props.js +80 -0
  117. package/dist/packages/_es/pxCheck.js +1 -1
  118. package/dist/packages/_es/raf.js +1 -1
  119. package/dist/packages/_es/style.css +1 -1
  120. package/dist/packages/address/index.scss +12 -3
  121. package/dist/packages/addresslist/index.scss +61 -101
  122. package/dist/packages/card/index.scss +1 -0
  123. package/dist/packages/ellipsis/index.scss +4 -0
  124. package/dist/packages/formitem/index.scss +2 -0
  125. package/dist/packages/imagepreview/index.scss +14 -1
  126. package/dist/packages/inputnumber/index.scss +5 -1
  127. package/dist/packages/locale/lang/baseLang.js +1 -1
  128. package/dist/packages/locale/lang/en-US.js +1 -1
  129. package/dist/packages/locale/lang/id-ID.js +1 -1
  130. package/dist/packages/locale/lang/index.js +1 -1
  131. package/dist/packages/locale/lang/zh-CN.js +1 -1
  132. package/dist/packages/locale/lang/zh-TW.js +1 -1
  133. package/dist/packages/menuitem/index.scss +0 -14
  134. package/dist/packages/notify/index.scss +2 -2
  135. package/dist/packages/overlay/index.scss +2 -1
  136. package/dist/packages/picker/index.scss +20 -12
  137. package/dist/packages/popover/index.scss +191 -363
  138. package/dist/packages/popup/index.scss +3 -14
  139. package/dist/packages/signature/index.scss +6 -2
  140. package/dist/packages/skeleton/index.scss +21 -19
  141. package/dist/packages/sticky/index.scss +3 -0
  142. package/dist/packages/tabbaritem/index.scss +4 -0
  143. package/dist/packages/timeselect/index.scss +0 -1
  144. package/dist/smartips/attributes.json +91 -111
  145. package/dist/smartips/tags.json +22 -35
  146. package/dist/smartips/web-types.json +162 -221
  147. package/dist/style.css +1 -1
  148. package/dist/styles/font/config.json +4 -0
  149. package/dist/styles/font/demo_index.html +118 -26
  150. package/dist/styles/font/iconfont.css +23 -7
  151. package/dist/styles/font/iconfont.js +6 -6
  152. package/dist/styles/font/iconfont.json +35 -7
  153. package/dist/styles/font/iconfont.ttf +0 -0
  154. package/dist/styles/font/iconfont.woff +0 -0
  155. package/dist/styles/font/iconfont.woff2 +0 -0
  156. package/dist/styles/themes/default.scss +52 -54
  157. package/dist/styles/themes/jdb.scss +52 -54
  158. package/dist/styles/themes/jddkh.scss +52 -54
  159. package/dist/styles/themes/jdt.scss +52 -54
  160. package/dist/styles/variables-jdb.scss +8 -1
  161. package/dist/styles/variables-jddkh.scss +8 -1
  162. package/dist/styles/variables-jdt.scss +8 -1
  163. package/dist/styles/variables.scss +17 -1
  164. package/dist/types/__VUE/actionsheet/index.vue.d.ts +58 -54
  165. package/dist/types/__VUE/address/index.vue.d.ts +71 -91
  166. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +29 -9
  167. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +4 -13
  168. package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +9 -9
  169. package/dist/types/__VUE/addresslist/index.vue.d.ts +23 -20
  170. package/dist/types/__VUE/audio/index.vue.d.ts +4 -4
  171. package/dist/types/__VUE/avatar/index.vue.d.ts +2 -2
  172. package/dist/types/__VUE/avatargroup/index.vue.d.ts +1 -1
  173. package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
  174. package/dist/types/__VUE/badge/index.vue.d.ts +1 -1
  175. package/dist/types/__VUE/button/index.vue.d.ts +1 -1
  176. package/dist/types/__VUE/calendar/index.vue.d.ts +11 -0
  177. package/dist/types/__VUE/calendaritem/index.vue.d.ts +15 -5
  178. package/dist/types/__VUE/cascader/index.vue.d.ts +47 -52
  179. package/dist/types/__VUE/cell/index.vue.d.ts +5 -5
  180. package/dist/types/__VUE/collapseitem/index.vue.d.ts +1 -1
  181. package/dist/types/__VUE/countdown/index.vue.d.ts +0 -1
  182. package/dist/types/__VUE/countdown/util.d.ts +0 -1
  183. package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
  184. package/dist/types/__VUE/datepicker/index.vue.d.ts +55 -60
  185. package/dist/types/__VUE/dialog/index.d.ts +0 -3
  186. package/dist/types/__VUE/dialog/index.vue.d.ts +48 -57
  187. package/dist/types/__VUE/elevator/index.vue.d.ts +2 -1
  188. package/dist/types/__VUE/form/common.d.ts +4 -2
  189. package/dist/types/__VUE/form/index.vue.d.ts +4 -4
  190. package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
  191. package/dist/types/__VUE/image/index.vue.d.ts +1 -1
  192. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +27 -20
  193. package/dist/types/__VUE/imagepreview/index.d.ts +19 -5
  194. package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -42
  195. package/dist/types/__VUE/imagepreview/types.d.ts +44 -0
  196. package/dist/types/__VUE/indicator/index.vue.d.ts +1 -0
  197. package/dist/types/__VUE/input/index.vue.d.ts +37 -26
  198. package/dist/types/__VUE/invoice/index.vue.d.ts +1 -1
  199. package/dist/types/__VUE/menuitem/index.vue.d.ts +3 -1
  200. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  201. package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -4
  202. package/dist/types/__VUE/notify/index.vue.d.ts +3 -3
  203. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +3 -3
  204. package/dist/types/__VUE/overlay/index.vue.d.ts +11 -12
  205. package/dist/types/__VUE/picker/Column.vue.d.ts +4 -6
  206. package/dist/types/__VUE/picker/index.vue.d.ts +60 -67
  207. package/dist/types/__VUE/popover/index.vue.d.ts +36 -139
  208. package/dist/types/__VUE/popup/common.d.ts +103 -0
  209. package/dist/types/__VUE/popup/index.vue.d.ts +55 -1591
  210. package/dist/types/__VUE/popup/props.d.ts +82 -0
  211. package/dist/types/__VUE/range/index.vue.d.ts +7 -7
  212. package/dist/types/__VUE/shortpassword/index.vue.d.ts +4 -4
  213. package/dist/types/__VUE/skeleton/common.d.ts +2 -3
  214. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -3
  215. package/dist/types/__VUE/sku/index.vue.d.ts +56 -61
  216. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  217. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  218. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -1
  219. package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -3
  220. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  221. package/dist/types/__VUE/uploader/index.vue.d.ts +15 -6
  222. package/dist/types/__VUE/video/index.vue.d.ts +5 -5
  223. package/dist/types/index.d.ts +1 -1
  224. package/dist/types/nutui.d.ts +1 -3
  225. package/package.json +3 -3
  226. package/dist/packages/_es/OldPicker.js +0 -486
  227. package/dist/packages/_es/PullRefresh.js +0 -349
  228. package/dist/packages/oldpicker/index.scss +0 -133
  229. package/dist/packages/pullrefresh/index.scss +0 -71
  230. package/dist/types/__VUE/addresslist/components/LongPressShell.vue.d.ts +0 -47
  231. package/dist/types/__VUE/datepicker/utils.d.ts +0 -5
  232. package/dist/types/__VUE/oldpicker/Column.vue.d.ts +0 -96
  233. package/dist/types/__VUE/oldpicker/commonProps.d.ts +0 -22
  234. package/dist/types/__VUE/oldpicker/index.vue.d.ts +0 -369
  235. package/dist/types/__VUE/oldpicker/types.d.ts +0 -24
  236. package/dist/types/__VUE/popup/use-lock-scroll.d.ts +0 -5
  237. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -128
  238. package/dist/types/__VUE/pullrefresh/use-touch.d.ts +0 -20
  239. package/dist/types/__VUE/pullrefresh/util.d.ts +0 -6
@@ -1,349 +0,0 @@
1
- /*!
2
- * @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 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,133 +0,0 @@
1
- .nut-oldpicker {
2
- &__content {
3
- display: block;
4
- position: relative;
5
- text-align: center;
6
- overflow-y: hidden;
7
- &:hover {
8
- cursor: grab;
9
- }
10
- }
11
-
12
- &__bar {
13
- display: flex;
14
- height: 56px;
15
- align-items: center;
16
- justify-content: space-between;
17
- }
18
- &__column {
19
- display: flex;
20
- position: relative;
21
- height: 252px;
22
- }
23
- &__columnitem {
24
- width: 0;
25
- flex-grow: 1;
26
- height: 100%;
27
- }
28
- &__left {
29
- color: $picker-cancel-color;
30
- font-size: $picker-bar-cancel-font-size;
31
- }
32
- &__right {
33
- color: $picker-ok-color;
34
- font-size: $picker-bar-ok-font-size;
35
- }
36
-
37
- &__title {
38
- color: $picker-bar-title-color;
39
- font-size: $picker-bar-title-font-size;
40
- font-weight: $picker-bar-title-font-weight;
41
- }
42
-
43
- &__button {
44
- cursor: pointer;
45
- padding: $picker-bar-button-padding;
46
- display: flex;
47
- align-items: center;
48
- height: 100%;
49
- }
50
- &__wrapper {
51
- display: block;
52
- }
53
- &__item {
54
- display: flex;
55
- justify-content: center;
56
- align-items: center;
57
- height: 35px;
58
- }
59
- &__hairline {
60
- position: absolute;
61
- top: 108px;
62
- height: 34px;
63
- width: 100%;
64
- border: $picker-item-active-line-border;
65
- border-left: 0;
66
- border-right: 0;
67
- }
68
-
69
- &__list {
70
- position: relative;
71
- display: block;
72
- width: 100%;
73
- height: 252px;
74
- overflow: hidden;
75
- text-align: center;
76
- }
77
-
78
- &-roller {
79
- display: block;
80
- position: absolute;
81
- top: 108px;
82
- width: 100%;
83
- height: $picker-item-height;
84
- z-index: 1;
85
- transform-style: preserve-3d;
86
-
87
- &-item {
88
- display: block;
89
- backface-visibility: hidden;
90
- -moz-backface-visibility: hidden;
91
- -webkit-backface-visibility: hidden;
92
- position: absolute;
93
- top: 0;
94
- width: 100%;
95
- height: $picker-item-height;
96
- line-height: $picker-item-height;
97
- color: $picker-item-text-color;
98
- font-size: $picker-item-text-font-size;
99
-
100
- &-hidden {
101
- visibility: hidden;
102
- opacity: 0;
103
- }
104
- }
105
- }
106
-
107
- &-content {
108
- display: block;
109
- position: absolute;
110
- top: 108px;
111
- width: 100%;
112
- height: $picker-item-height;
113
- color: $picker-item-active-text-color;
114
- z-index: 2;
115
- overflow: hidden;
116
- border-left: 0;
117
- border-right: 0;
118
- }
119
- &-list-panel {
120
- display: block;
121
- transform-style: preserve-3d;
122
- }
123
- &-item {
124
- display: block;
125
- white-space: nowrap;
126
- overflow: hidden;
127
- text-overflow: ellipsis;
128
- height: $picker-item-height;
129
- line-height: $picker-item-height;
130
- text-align: center;
131
- font-size: 16px;
132
- }
133
- }
@@ -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,96 +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
- dataType: StringConstructor;
7
- itemShow: {
8
- type: BooleanConstructor;
9
- default: boolean;
10
- };
11
- listData: {
12
- type: ObjectConstructor;
13
- default: () => {};
14
- };
15
- readonly: {
16
- type: BooleanConstructor;
17
- default: boolean;
18
- };
19
- defaultIndex: {
20
- type: (NumberConstructor | StringConstructor)[];
21
- default: number;
22
- };
23
- }, {
24
- wrapper: import("vue").Ref<any>;
25
- setRollerStyle: (index: number) => string;
26
- isHidden: (index: number) => boolean;
27
- roller: import("vue").Ref<null>;
28
- list: import("vue").Ref<null>;
29
- listItem: import("vue").Ref<null>;
30
- onTouchStart: (event: TouchEvent) => void;
31
- onTouchMove: (event: TouchEvent) => void;
32
- onTouchEnd: (event: TouchEvent) => void;
33
- touchRollerStyle: import("vue").ComputedRef<{
34
- transition: string;
35
- transform: string;
36
- }>;
37
- touchListStyle: import("vue").ComputedRef<{
38
- transition: string;
39
- transform: string;
40
- }>;
41
- setMove: (move: number, type?: string | undefined, time?: number | undefined) => void;
42
- onClick: import("vue").Ref<((...args: any[]) => any) | undefined>;
43
- onChange: import("vue").Ref<((...args: any[]) => any) | undefined>;
44
- readonly: import("vue").Ref<boolean>;
45
- itemShow: import("vue").Ref<boolean>;
46
- dataType: import("vue").Ref<string | undefined>;
47
- listData: import("vue").Ref<Record<string, any>>;
48
- defaultIndex: import("vue").Ref<string | number>;
49
- touchParams: import("vue").Ref<{
50
- startY: number;
51
- endY: number;
52
- startTime: number;
53
- endTime: number;
54
- lastY: number;
55
- }>;
56
- currIndex: import("vue").Ref<number>;
57
- transformY: import("vue").Ref<number>;
58
- scrollDistance: import("vue").Ref<number>;
59
- lineSpacing: import("vue").Ref<number>;
60
- rotation: import("vue").Ref<number>;
61
- timer: import("vue").Ref<null>;
62
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "change")[], "click" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
63
- dataType: StringConstructor;
64
- itemShow: {
65
- type: BooleanConstructor;
66
- default: boolean;
67
- };
68
- listData: {
69
- type: ObjectConstructor;
70
- default: () => {};
71
- };
72
- readonly: {
73
- type: BooleanConstructor;
74
- default: boolean;
75
- };
76
- defaultIndex: {
77
- type: (NumberConstructor | StringConstructor)[];
78
- default: number;
79
- };
80
- }>> & {
81
- onClick?: ((...args: any[]) => any) | undefined;
82
- onChange?: ((...args: any[]) => any) | undefined;
83
- }, {
84
- readonly: boolean;
85
- itemShow: boolean;
86
- listData: Record<string, any>;
87
- defaultIndex: string | number;
88
- }>>;
89
- export default _sfc_main;
90
-
91
- declare module 'vue' {
92
- interface GlobalComponents {
93
- NutOldPicker: typeof _sfc_main;
94
- }
95
- }
96
-